@atomic-ui/blocks 0.0.0-stage → 0.6.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 +77 -2
- package/custom-elements.json +8688 -0
- package/dist/chunk-4JW2CHWS.js +708 -0
- package/dist/chunk-4JW2CHWS.js.map +1 -0
- package/dist/chunk-AFN7IAG2.js +379 -0
- package/dist/chunk-AFN7IAG2.js.map +1 -0
- package/dist/chunk-F4BTXUYP.js +65 -0
- package/dist/chunk-F4BTXUYP.js.map +1 -0
- package/dist/chunk-MYTYMOH6.js +193 -0
- package/dist/chunk-MYTYMOH6.js.map +1 -0
- package/dist/chunk-OTOFULMT.js +465 -0
- package/dist/chunk-OTOFULMT.js.map +1 -0
- package/dist/chunk-PORKVHAX.js +255 -0
- package/dist/chunk-PORKVHAX.js.map +1 -0
- package/dist/chunk-T7U4OPTW.js +413 -0
- package/dist/chunk-T7U4OPTW.js.map +1 -0
- package/dist/chunk-WHENVU5E.js +318 -0
- package/dist/chunk-WHENVU5E.js.map +1 -0
- package/dist/chunk-XHFUTZGU.js +228 -0
- package/dist/chunk-XHFUTZGU.js.map +1 -0
- package/dist/chunk-XJMKAK2I.js +442 -0
- package/dist/chunk-XJMKAK2I.js.map +1 -0
- package/dist/components/card-grid.d.ts +72 -0
- package/dist/components/card-grid.js +7 -0
- package/dist/components/card-grid.js.map +1 -0
- package/dist/components/changelog.d.ts +373 -0
- package/dist/components/changelog.js +16 -0
- package/dist/components/changelog.js.map +1 -0
- package/dist/components/estimator.d.ts +246 -0
- package/dist/components/estimator.js +11 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/marketing.d.ts +342 -0
- package/dist/components/marketing.js +17 -0
- package/dist/components/marketing.js.map +1 -0
- package/dist/components/organisms.d.ts +559 -0
- package/dist/components/organisms.js +23 -0
- package/dist/components/organisms.js.map +1 -0
- package/dist/components/property.d.ts +389 -0
- package/dist/components/property.js +17 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +7 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +7 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/selling.d.ts +409 -0
- package/dist/components/selling.js +23 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +235 -0
- package/dist/components/site.js +11 -0
- package/dist/components/site.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone/atomic-ui-blocks.js +1229 -0
- package/dist/standalone/atomic-ui-blocks.js.map +7 -0
- package/dist/standalone/index.html +78 -0
- package/package.json +64 -3
- package/scripts/copy-to-product.mjs +59 -0
- package/specimen/index.html +78 -0
|
@@ -0,0 +1,1229 @@
|
|
|
1
|
+
/* @atomic-ui/blocks version 0.6.0, standalone. Load atomic-ui.js from @atomic-ui/ui first, from the same folder. */
|
|
2
|
+
import"./atomic-ui.js";import{css as ye,html as L,nothing as W}from"./atomic-ui.js";import{ImpaktElement as Q,fontSize as $e,fontWeight as le,lineHeight as Xe,space as g,spaceAround as it,t as w,type as pe,iconSvg as Ve}from"./atomic-ui.js";var Ut=(o,t,e)=>L`<div class=${e} role="heading" aria-level=${o}>${t}</div>`,oi=ye`
|
|
3
|
+
.h { margin: 0; color: ${w.textHeading}; font-family: ${w.fontHeading}; font-weight: ${le("bold")}; line-height: ${Xe("tight")}; }
|
|
4
|
+
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${w.brand})); ${pe("sm")} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${w.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${le("semibold")}); letter-spacing: ${w.trackingWide}; text-transform: uppercase; }
|
|
5
|
+
.body { margin: 0; line-height: ${Xe("normal")}; max-inline-size: 65ch; }
|
|
6
|
+
`,Qe=class extends Q{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=[...Q.styles,it,oi,ye`
|
|
7
|
+
:host { display: block; container-type: inline-size; }
|
|
8
|
+
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${g(8)}; align-items: center; }
|
|
9
|
+
.hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
|
|
10
|
+
.words { display: flex; flex-direction: column; gap: ${g(4)}; }
|
|
11
|
+
:host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
|
|
12
|
+
.h { ${pe("5xl")} letter-spacing: ${w.trackingTight}; text-wrap: balance; }
|
|
13
|
+
.body { ${pe("lg")} color: ${w.textMuted}; text-wrap: pretty; }
|
|
14
|
+
@container (max-width: 40rem) { .h { ${pe("4xl")} } }
|
|
15
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${g(3)} ${g(4)}; align-items: center; margin-block-start: ${g(2)}; }
|
|
16
|
+
:host([align='center']) .actions { justify-content: center; }
|
|
17
|
+
img { display: block; inline-size: 100%; block-size: auto; border-radius: ${w.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${w.shadowLg}; }
|
|
18
|
+
@container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
|
|
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: ${g(32)} max(${g(8)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))) ${g(24)}; overflow: hidden; color: #fff; --impakt-color-text-heading: #fff; }
|
|
21
|
+
.cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
|
|
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
|
+
.cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }
|
|
24
|
+
.cover .eyebrow { display: inline-flex; align-items: center; gap: ${g(2)}; align-self: flex-start; padding: ${g(2)} ${g(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }
|
|
25
|
+
.chip-line { position: relative; z-index: 1; block-size: 0; }
|
|
26
|
+
.chip { position: absolute; inset-block-start: ${g(14)}; inset-inline-end: ${g(9)}; display: inline-flex; align-items: center; gap: ${g(2.5)}; padding: ${g(3)} ${g(4.5)}; ${pe("sm")} font-weight: ${le("semibold")}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${w.radiusXl}; }
|
|
27
|
+
.finder { position: relative; z-index: 1; margin-block-start: ${g(12)}; }
|
|
28
|
+
.cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }
|
|
29
|
+
.cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }
|
|
30
|
+
@container (max-width: 64rem) { .chip { display: none; } }
|
|
31
|
+
@container (max-width: 30rem) { .finder { display: none; } }
|
|
32
|
+
@container (max-width: 48rem) { .finder { margin-block-start: ${g(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${g(32)} ${g(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 L`<div class="cover" part="hero">
|
|
34
|
+
${this.ratingText?L`<div class="chip-line"><div class="chip">${Ve("star","20px")}${this.ratingText}</div></div>`:W}
|
|
35
|
+
<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />
|
|
36
|
+
<div class="words">
|
|
37
|
+
${this.eyebrow?L`<p class="eyebrow" part="eyebrow">${this.eyebrowIcon!=="none"?Ve(this.eyebrowIcon,"16px"):W}${this.eyebrow}</p>`:W}
|
|
38
|
+
${Ut(this.level,this.heading,"h")}
|
|
39
|
+
${this.lead?L`<p class="body">${this.lead}</p>`:W}
|
|
40
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="finder"><slot name="search"></slot></div>
|
|
43
|
+
</div>`;let t=!!this.imageSrc&&this.align!=="center";return L`<div class="hero ${t?"pictured":""}" part="hero">
|
|
44
|
+
<div class="words">
|
|
45
|
+
${this.eyebrow?L`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:W}
|
|
46
|
+
${Ut(this.level,this.heading,"h")}
|
|
47
|
+
${this.lead?L`<p class="body">${this.lead}</p>`:W}
|
|
48
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
49
|
+
</div>
|
|
50
|
+
${t?L`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />`:W}
|
|
51
|
+
</div>`}},Ke=class extends Q{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=[...Q.styles,it,oi,ye`
|
|
52
|
+
:host { display: block; container-type: inline-size; }
|
|
53
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${g(8)} ${g(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
54
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
55
|
+
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
56
|
+
li { display: flex; flex-direction: column; gap: ${g(2)}; }
|
|
57
|
+
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${g(4)}; align-items: start; }
|
|
58
|
+
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${g(1)}; }
|
|
59
|
+
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${w.radiusLg}; background: ${w.brandSubtle}; color: ${w.brand}; margin-block-end: ${g(2)}; }
|
|
60
|
+
:host([layout='inline']) .icon { margin: 0; }
|
|
61
|
+
.h { font-size: ${$e("lg")}; }
|
|
62
|
+
.body { color: ${w.text}; }
|
|
63
|
+
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
64
|
+
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
65
|
+
`]}render(){return L`<ul part="list">${(this.items??[]).map(t=>L`<li part="item">
|
|
66
|
+
${t.icon?L`<span class="icon">${Ve(t.icon,"24px")}</span>`:W}
|
|
67
|
+
<div class="words">${Ut(this.headingLevel,t.heading,"h")}${t.text?L`<p class="body">${t.text}</p>`:W}</div>
|
|
68
|
+
</li>`)}</ul>`}},Ze=class extends Q{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=[...Q.styles,it,ye`
|
|
69
|
+
:host { display: block; }
|
|
70
|
+
figure { margin: 0; display: flex; flex-direction: column; gap: ${g(4)}; max-inline-size: 48rem; }
|
|
71
|
+
:host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
|
|
72
|
+
blockquote { margin: 0; font-family: ${w.fontHeading}; font-size: ${$e("lg")}; line-height: ${Xe("normal")}; color: inherit; }
|
|
73
|
+
:host([size='lg']) blockquote { font-size: ${$e("2xl")}; line-height: ${Xe("tight")}; }
|
|
74
|
+
blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
|
|
75
|
+
figcaption { display: flex; align-items: center; gap: ${g(3)}; }
|
|
76
|
+
img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
|
|
77
|
+
.name { font-weight: ${le("semibold")}; }
|
|
78
|
+
.detail { color: ${w.textMuted}; font-size: ${$e("sm")}; }
|
|
79
|
+
`]}render(){return L`<figure part="figure">
|
|
80
|
+
<blockquote part="quote">${this.quote}</blockquote>
|
|
81
|
+
${this.person?L`<figcaption>${this.imageSrc?L`<img src=${this.imageSrc} alt="" />`:W}<span><span class="name">${this.person}</span>${this.about?L`<br /><span class="detail">${this.about}</span>`:W}</span></figcaption>`:W}
|
|
82
|
+
</figure>`}},Je=class extends Q{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=[...Q.styles,ye`
|
|
83
|
+
:host { display: block; }
|
|
84
|
+
.stat { display: flex; flex-direction: column; gap: ${g(1)}; }
|
|
85
|
+
:host([align='center']) .stat { align-items: center; text-align: center; }
|
|
86
|
+
.value { font-family: ${w.fontHeading}; font-size: ${$e("3xl")}; font-weight: ${le("bold")}; line-height: 1; color: ${w.textHeading}; }
|
|
87
|
+
:host([size='lg']) .value { font-size: ${$e("5xl")}; }
|
|
88
|
+
:host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
|
|
89
|
+
.label { font-weight: ${le("semibold")}; }
|
|
90
|
+
.detail { color: ${w.textMuted}; font-size: ${$e("sm")}; }
|
|
91
|
+
`]}render(){return L`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note?L` <span class="detail">${this.note}</span>`:W}</p>`}},et=class extends Q{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=[...Q.styles,ye`
|
|
92
|
+
:host { display: block; }
|
|
93
|
+
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${g(2)} ${g(3)}; padding: ${g(2.5)} ${g(5)}; ${pe("sm")} text-align: center; color: ${w.onBrand}; background: ${w.brand}; }
|
|
94
|
+
:host { margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); }
|
|
95
|
+
a { display: inline-flex; align-items: center; gap: ${g(1)}; min-block-size: ${w.targetMin}; color: inherit; font-weight: ${le("semibold")}; }
|
|
96
|
+
`]}render(){return L`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText&&this.href?L`<a href=${this.href}>${this.linkText}${Ve("arrow-right","14px")}</a>`:W}</div>`}},tt=class extends Q{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=[...Q.styles,it,ye`
|
|
97
|
+
:host { display: block; container-type: inline-size; }
|
|
98
|
+
form { display: flex; align-items: center; padding: ${g(3)}; background: ${w.surfaceCard}; color: ${w.text}; border-radius: ${w.radius2xl}; box-shadow: ${w.shadowXl}; }
|
|
99
|
+
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${g(1)}; padding: ${g(1.5)} ${g(5)}; }
|
|
100
|
+
label { ${pe("sm")} color: ${w.textMuted}; }
|
|
101
|
+
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${pe("sm")} font-weight: ${le("semibold")}; color: ${w.text}; background: transparent; border: 0; border-radius: ${w.radiusSm}; cursor: pointer; }
|
|
102
|
+
select:focus-visible, button:focus-visible { outline: 2px solid ${w.brand}; outline-offset: 2px; }
|
|
103
|
+
button { flex: none; min-block-size: 48px; padding: ${g(3)} ${g(6)}; font: inherit; font-weight: ${le("semibold")}; color: ${w.onBrand}; background: ${w.brand}; border: 0; border-radius: ${w.radiusLg}; cursor: pointer; }
|
|
104
|
+
button:hover { background: ${w.brandHover}; }
|
|
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: ${g(2)}; } .field { flex: none; } }
|
|
107
|
+
`]}submit(t){let e=new FormData(t.currentTarget),i={};e.forEach((a,s)=>{a!==""&&(i[s]=String(a))}),this.dispatchEvent(new CustomEvent("impakt-submit",{detail:{values:i},bubbles:!0,composed:!0})),this.action||t.preventDefault()}render(){return L`<form role="search" aria-label=${this.label} method="get" action=${this.action||W} @submit=${this.submit} part="form">
|
|
108
|
+
${(this.items??[]).map((t,e)=>{let i=this.id_(`field-${e}`),a=String(t.options??"").split(",").map(s=>s.trim()).filter(Boolean);return L`<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(s=>L`<option value=${s}>${s}</option>`)}
|
|
110
|
+
</select></div>`})}
|
|
111
|
+
<button type="submit">${this.buttonText}</button>
|
|
112
|
+
</form>`}};customElements.define("impakt-search-bar",tt);customElements.define("impakt-announcement",et);customElements.define("impakt-hero",Qe);customElements.define("impakt-feature-list",Ke);customElements.define("impakt-quote",Ze);customElements.define("impakt-stat",Je);import{css as Fi,html as xe,nothing as at}from"./atomic-ui.js";import{ImpaktElement as li,focusRing as Wi,fontSize as ci,fontWeight as Yt,lineHeight as di,space as Ae,spaceAround as _i,t as D,iconSvg as qi}from"./atomic-ui.js";var rt=class extends li{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=[...li.styles,Wi,_i,Fi`
|
|
113
|
+
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
114
|
+
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
115
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
116
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
117
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${Ae(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
118
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
119
|
+
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
120
|
+
li { position: relative; display: flex; flex-direction: column; background: ${D.surfaceCard}; border: ${D.borderThin} solid ${D.hairline}; border-radius: ${D.radiusXl}; box-shadow: ${D.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }
|
|
121
|
+
li.linked:hover { box-shadow: ${D.shadowLg}; transform: translateY(-2px); }
|
|
122
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
123
|
+
.words { display: flex; flex-direction: column; gap: ${Ae(2)}; padding: ${Ae(5)}; flex: 1; }
|
|
124
|
+
.h { margin: 0; color: ${D.textHeading}; font-family: ${D.fontHeading}; font-size: ${ci("lg")}; font-weight: ${Yt("bold")}; line-height: ${di("tight")}; }
|
|
125
|
+
.h a { color: inherit; text-decoration: none; border-radius: ${D.radiusSm}; }
|
|
126
|
+
.h a::after { content: ''; position: absolute; inset: 0; }
|
|
127
|
+
li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
128
|
+
.body { margin: 0; line-height: ${di("normal")}; }
|
|
129
|
+
.badge { align-self: flex-start; padding: ${Ae(.5)} ${Ae(2)}; border-radius: ${D.radius}; font-size: ${ci("sm")}; font-weight: ${Yt("medium")}; background: ${D.brandSubtle}; color: ${D.brand}; box-shadow: inset 0 0 0 1px ${D.hairline}; }
|
|
130
|
+
.more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${Ae(1)}; color: ${D.link}; font-weight: ${Yt("semibold")}; }
|
|
131
|
+
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
132
|
+
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
133
|
+
`]}render(){return xe`<ul part="list">${(this.items??[]).map(t=>xe`<li class=${t.href?"linked":""} part="card">
|
|
134
|
+
${t.imageSrc?xe`<img src=${t.imageSrc} alt=${t.imageAlt??""} loading="lazy" />`:at}
|
|
135
|
+
<div class="words">
|
|
136
|
+
${t.badge?xe`<span class="badge">${t.badge}</span>`:at}
|
|
137
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.href?xe`<a href=${t.href}>${t.heading}</a>`:t.heading}</div>
|
|
138
|
+
${t.text?xe`<p class="body">${t.text}</p>`:at}
|
|
139
|
+
${t.href?xe`<span class="more" aria-hidden="true">${qi("arrow-right","1em")}</span>`:at}
|
|
140
|
+
</div>
|
|
141
|
+
</li>`)}</ul>`}};customElements.define("impakt-card-grid",rt);import{css as re,html as b,nothing as C}from"./atomic-ui.js";import{say as G,ImpaktElement as F,focusRing as mt,targetSize as Gt,visuallyHidden as Di,fontWeight as ae,lineHeight as mi,space as p,spaceAround as he,t as d,token as Ui,type as M,iconSvg as ve}from"./atomic-ui.js";var Yi=Ui("color.accent.default","#c8a15a"),pi=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,ui=re`
|
|
142
|
+
.round { ${Gt} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${d.text}; background: ${d.surfaceCard}; border: ${d.borderThin} solid ${d.rule}; border-radius: 50%; box-shadow: ${d.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
|
|
143
|
+
.round:hover:not(:disabled) { box-shadow: ${d.shadowMd}; }
|
|
144
|
+
.round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
|
145
|
+
`,ut=re`
|
|
146
|
+
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${d.brand})); ${M("sm")} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${d.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${ae("semibold")}); letter-spacing: ${d.trackingWide}; text-transform: uppercase; }
|
|
147
|
+
.h { margin: 0; color: ${d.textHeading}; font-family: ${d.fontHeading}; font-weight: ${ae("bold")}; letter-spacing: ${d.trackingTight}; text-wrap: balance; }
|
|
148
|
+
.lead { margin: 0; color: ${d.textMuted}; text-wrap: pretty; }
|
|
149
|
+
`,st=class extends F{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=[...F.styles,mt,he,ui,re`
|
|
150
|
+
:host { display: block; container-type: inline-size; --most: 1; --gap: ${p(6)}; }
|
|
151
|
+
:host([per-view='2']) { --most: 2; }
|
|
152
|
+
: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: ${p(1)} ${p(2)}; border-radius: ${d.radiusLg}; }
|
|
154
|
+
.track::-webkit-scrollbar { display: none; }
|
|
155
|
+
::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
|
+
/* Whole slides only: a slice of the next one reads as content spilling out of the page. */
|
|
157
|
+
@container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }
|
|
158
|
+
@container (max-width: 40rem) { .track { --per: 1; --gap: ${p(4)}; } }
|
|
159
|
+
.controls { display: flex; align-items: center; justify-content: space-between; gap: ${p(4)}; margin-block-start: ${p(4)}; }
|
|
160
|
+
.dots { display: flex; flex-wrap: wrap; gap: ${p(1)}; }
|
|
161
|
+
.dot { ${Gt} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${d.radiusSm}; }
|
|
162
|
+
.dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${d.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }
|
|
163
|
+
.dot[aria-current='true'] span { inline-size: 24px; background: ${d.brand}; }
|
|
164
|
+
.buttons { display: flex; gap: ${p(2)}; }
|
|
165
|
+
section { position: relative; }
|
|
166
|
+
@container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${p(4)}); inset-inline-end: 0; } }
|
|
167
|
+
.sr-only { ${Di} }
|
|
168
|
+
@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 s=Number.parseFloat(getComputedStyle(e).columnGap)||0,n=Math.max(1,Math.round((e.clientWidth+s)/(a+s)));if(n===this.visible)return;this.visible=n,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",G("slide")),i.setAttribute("aria-label",G("{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 n=this.heading===null;this.heading=null;let l=this.track,y=this.slides[this.index];!n&&l&&y&&typeof l.scrollTo=="function"&&l.scrollTo({left:y.offsetLeft-l.offsetLeft,behavior:"auto"})},900),this.requestUpdate();let a=this.track,s=this.slides[i];a&&s&&typeof a.scrollTo=="function"&&a.scrollTo({left:s.offsetLeft-a.offsetLeft,behavior:pi()?"auto":"smooth"})}onScroll(){let e=this.track,i=this.slides;if(!e||!i.length)return;let a=0,s=1/0;if(i.forEach((n,l)=>{let y=Math.abs(n.offsetLeft-e.offsetLeft-e.scrollLeft);y<s&&(s=y,a=l)}),this.heading!==null){a===this.heading&&s<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&&!pi()}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 b`<section aria-roledescription=${G("carousel")} aria-label=${this.label} part="carousel" @keydown=${this.onKey}
|
|
170
|
+
@mouseenter=${()=>this.hold(!0)} @mouseleave=${()=>this.hold(!1)} @focusin=${()=>this.hold(!0)} @focusout=${()=>this.hold(!1)}>
|
|
171
|
+
<div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
|
|
172
|
+
<div class="controls" part="controls">
|
|
173
|
+
<div class="dots">${e.length>1?e.map(i=>b`<button class="dot" type="button" aria-label=${G("Go to slide {slide}",{slide:i+1})} aria-current=${i===this.index?"true":"false"} @click=${()=>this.go(i)}><span></span></button>`):C}</div>
|
|
174
|
+
<div class="buttons">
|
|
175
|
+
${this.canPlay?b`<button class="round" type="button" aria-label=${G(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?ve("arrow-right","18px"):b`<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>`:C}
|
|
176
|
+
<button class="round" type="button" aria-label=${G("Previous slide")} ?disabled=${this.index===0} @click=${()=>this.go(this.index-1)}>${ve("arrow-left","18px")}</button>
|
|
177
|
+
<button class="round" type="button" aria-label=${G("Next slide")} ?disabled=${this.index>=this.last} @click=${()=>this.go(this.index+1)}>${ve("arrow-right","18px")}</button>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
<p class="sr-only" aria-live="polite">${G("Slide {slide} of {slides}",{slide:this.index+1,slides:this.count})}</p>
|
|
181
|
+
</section>`}};function gi(o,t,e){let i=o===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(o===0)return a;if(t===2)return{wide:2,narrow:2,rows:2};if(t===3)return{...a,wide:2};if(i){let s=(t-5)%4;a.wide=t===4?2:t>5&&s?5-s:1,a.narrow=t%2?1:2}return a}var nt=class extends F{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=[...F.styles,mt,he,ui,re`
|
|
182
|
+
:host { display: block; container-type: inline-size; }
|
|
183
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${p(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
|
|
184
|
+
:host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
|
|
185
|
+
li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }
|
|
186
|
+
: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: ${d.surfaceInset}; border-radius: ${d.radiusXl}; overflow: hidden; cursor: zoom-in; }
|
|
188
|
+
.open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }
|
|
189
|
+
.open:hover img { transform: scale(1.03); }
|
|
190
|
+
@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
|
+
dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }
|
|
192
|
+
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: ${p(4)}; gap: ${p(3)}; color: #fff; }
|
|
194
|
+
.bar { display: flex; align-items: center; justify-content: space-between; ${M("sm")} }
|
|
195
|
+
.middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${p(3)}; min-block-size: 0; }
|
|
196
|
+
.middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${d.radiusLg}; }
|
|
197
|
+
figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }
|
|
198
|
+
.caption { margin: 0; text-align: center; ${M("sm")} }
|
|
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 b`<ul aria-label=${this.label} part="list">${e.map((a,s)=>{let n=gi(s,e.length,this.layout);return b`<li style=${`--span-wide:${n.wide};--span-narrow:${n.narrow};--span-rows:${n.rows}`}>
|
|
200
|
+
<button class="open" type="button" aria-label=${G("View larger: {picture}",{picture:a.alt})} @click=${l=>this.open(s,l)}><img src=${a.src} alt=${a.alt} loading="lazy" /></button>
|
|
201
|
+
</li>`})}</ul>
|
|
202
|
+
<dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>
|
|
203
|
+
${i?b`<div class="stage">
|
|
204
|
+
<div class="bar"><span>${this.shown+1} of ${e.length}</span><button class="round" type="button" aria-label=${G("Close")} @click=${this.close}>${ve("close","18px")}</button></div>
|
|
205
|
+
<div class="middle">
|
|
206
|
+
<button class="round" type="button" aria-label=${G("Previous picture")} @click=${()=>this.step(-1)}>${ve("arrow-left","18px")}</button>
|
|
207
|
+
<figure><img src=${i.src} alt=${i.alt} /></figure>
|
|
208
|
+
<button class="round" type="button" aria-label=${G("Next picture")} @click=${()=>this.step(1)}>${ve("arrow-right","18px")}</button>
|
|
209
|
+
</div>
|
|
210
|
+
<p class="caption">${i.caption??i.alt}</p>
|
|
211
|
+
</div>`:C}
|
|
212
|
+
</dialog>`}},ot=class extends F{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=[...F.styles,mt,he,re`
|
|
213
|
+
:host { display: block; }
|
|
214
|
+
p { margin: 0 0 ${p(6)}; text-align: center; color: ${d.textMuted}; ${M("sm")} font-weight: ${ae("medium")}; }
|
|
215
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${p(8)} ${p(12)}; }
|
|
216
|
+
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
|
+
li:hover img { filter: none; opacity: 1; }
|
|
218
|
+
a { display: block; border-radius: ${d.radiusSm}; }
|
|
219
|
+
`]}render(){return b`${this.heading?b`<p part="heading">${this.heading}</p>`:C}
|
|
220
|
+
<ul part="list">${(this.items??[]).map(t=>b`<li>${t.href?b`<a href=${t.href}><img src=${t.src} alt=${t.alt} /></a>`:b`<img src=${t.src} alt=${t.alt} />`}</li>`)}</ul>`}},lt=class extends F{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=[...F.styles,he,ut,re`
|
|
221
|
+
: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: ${p(6)}; }
|
|
223
|
+
li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${p(2)}; }
|
|
224
|
+
li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${d.brand}; color: ${d.onBrand}; ${M("sm")} font-weight: ${ae("bold")}; position: relative; z-index: 1; margin-block-end: ${p(2)}; }
|
|
225
|
+
li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${p(6)} + 8px); block-size: 2px; background: ${d.rule}; }
|
|
226
|
+
.h { ${M("lg")} letter-spacing: 0; }
|
|
227
|
+
.meta { margin: 0; ${M("sm")} color: ${d.textMuted}; font-family: ${d.fontMono}; letter-spacing: 0.02em; }
|
|
228
|
+
.body { margin: 0; color: ${d.textMuted}; line-height: ${mi("normal")}; text-wrap: pretty; }
|
|
229
|
+
:host([orientation='vertical']) ol { grid-auto-flow: row; }
|
|
230
|
+
:host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
231
|
+
: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 * ${p(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
233
|
+
@container (max-width: 40rem) {
|
|
234
|
+
ol { grid-auto-flow: row; }
|
|
235
|
+
li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
236
|
+
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 * ${p(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
238
|
+
}
|
|
239
|
+
:host([look='ruled']) li { padding-block-start: ${p(5)}; border-block-start: 3px solid var(--rule); }
|
|
240
|
+
:host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }
|
|
241
|
+
:host([look='ruled']) ol { gap: ${p(5)}; }
|
|
242
|
+
/* 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
|
+
@container (max-width: 40rem) {
|
|
244
|
+
:host([look='ruled']) ol { gap: 0; }
|
|
245
|
+
:host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${p(6)}; min-block-size: 0; border-block-start: 0; }
|
|
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: ${d.text}; }
|
|
247
|
+
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${p(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
|
+
}
|
|
249
|
+
@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 b`<ol part="list">${(this.items??[]).map((t,e)=>b`<li part="step" style=${this.look==="ruled"?`--rule:var(--impakt-color-chart-${e%5+1}, var(--impakt-color-brand-default, #1f4ed8))`:C}>
|
|
251
|
+
${t.meta?b`<p class="meta">${t.meta}</p>`:C}
|
|
252
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.heading}</div>
|
|
253
|
+
${t.text?b`<p class="body">${t.text}</p>`:C}
|
|
254
|
+
</li>`)}</ol>`}},ct=class extends F{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=[...F.styles,he,ut,re`
|
|
255
|
+
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
256
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
257
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
258
|
+
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
259
|
+
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${p(16)}; align-items: center; }
|
|
260
|
+
:host([image-side='start']) .picture { order: -1; }
|
|
261
|
+
.words { display: flex; flex-direction: column; gap: ${p(4)}; }
|
|
262
|
+
.h { ${M("4xl")} }
|
|
263
|
+
.lead { ${M("lg")} }
|
|
264
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${p(3)}; }
|
|
265
|
+
li { display: flex; gap: ${p(3)}; align-items: flex-start; line-height: ${mi("normal")}; }
|
|
266
|
+
.tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${d.brandSubtle}; color: ${d.brand}; }
|
|
267
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${p(3)} ${p(4)}; align-items: center; margin-block-start: ${p(2)}; }
|
|
268
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${d.radius2xl}; box-shadow: ${d.shadowXl}; }
|
|
269
|
+
.picture { position: relative; }
|
|
270
|
+
.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 ${d.surfaceCard}; border-radius: ${d.radiusXl}; box-sizing: border-box; }
|
|
272
|
+
@container (max-width: 48rem) {
|
|
273
|
+
.split { grid-template-columns: minmax(0, 1fr); gap: ${p(8)}; }
|
|
274
|
+
:host([image-side='start']) .picture { order: 0; }
|
|
275
|
+
.h { ${M("3xl")} }
|
|
276
|
+
}
|
|
277
|
+
`]}render(){return b`<div class="split" part="split">
|
|
278
|
+
<div class="words">
|
|
279
|
+
${this.eyebrow?b`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:C}
|
|
280
|
+
<div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
|
|
281
|
+
${this.lead?b`<p class="lead">${this.lead}</p>`:C}
|
|
282
|
+
${this.points?.length?b`<ul>${this.points.map(t=>b`<li><span class="tick">${ve("check","14px")}</span><span>${t}</span></li>`)}</ul>`:C}
|
|
283
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
284
|
+
</div>
|
|
285
|
+
${this.imageSrc?b`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?b`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:C}</div>`:C}
|
|
286
|
+
</div>`}},dt=class extends F{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=[...F.styles,he,ut,re`
|
|
287
|
+
:host { display: block; container-type: inline-size; }
|
|
288
|
+
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${p(8)}; padding: ${p(16)}; border-radius: ${d.radius2xl}; background: ${d.surfaceCard}; box-shadow: ${d.shadowSm}, inset 0 0 0 1px ${d.hairline}; }
|
|
289
|
+
:host([tone='subtle']) .panel { background: ${d.surfaceSubtle}; box-shadow: none; }
|
|
290
|
+
:host([tone='brand']) .panel { background: ${d.brand}; color: ${d.onBrand}; box-shadow: ${d.shadowLg}; }
|
|
291
|
+
/* Only the words take the light colours: a button in the actions keeps its own. */
|
|
292
|
+
:host([tone='brand']) .words { --impakt-color-text-heading: ${d.onBrand}; --impakt-color-text-default: ${d.onBrand}; --impakt-color-text-muted: ${d.onBrand}; --impakt-color-text-link: ${d.onBrand}; }
|
|
293
|
+
/* 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, ${d.onBrand} 18%, transparent), transparent); pointer-events: none; }
|
|
295
|
+
.photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
296
|
+
.panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impakt-color-text-heading: #fff; }
|
|
297
|
+
.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
|
+
.panel.pictured .words, .panel.pictured .actions { z-index: 1; }
|
|
299
|
+
@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: ${p(3)}; max-inline-size: 40rem; }
|
|
301
|
+
.h { ${M("4xl")} }
|
|
302
|
+
.lead { ${M("lg")} }
|
|
303
|
+
.actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${p(3)}; }
|
|
304
|
+
:host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }
|
|
305
|
+
:host([align='center']) .panel { flex-direction: column; text-align: center; }
|
|
306
|
+
:host([align='center']) .words { align-items: center; }
|
|
307
|
+
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${p(8)} ${p(6)}; } .h { ${M("3xl")} } :host([align='center']) .panel { align-items: center; } }
|
|
308
|
+
@media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
|
|
309
|
+
`]}render(){return b`<div class="panel ${this.imageSrc?"pictured":""}" part="panel">
|
|
310
|
+
${this.imageSrc?b`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:C}
|
|
311
|
+
<div class="words">
|
|
312
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
|
|
313
|
+
${this.lead?b`<p class="lead">${this.lead}</p>`:C}
|
|
314
|
+
</div>
|
|
315
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
316
|
+
</div>`}},hi=o=>b`<span class="stars" role="img" aria-label=${G("Rated {rating} out of 5",{rating:o})}>${[1,2,3,4,5].map(t=>b`<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true" fill=${t<=o?"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>`,Gi=o=>o.split(/\s+/).filter(t=>/^[A-Za-z]/.test(t)&&t.toLowerCase()!=="and").slice(0,2).map(t=>t[0].toUpperCase()).join(""),pt=class extends F{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=[...F.styles,he,re`
|
|
317
|
+
:host { display: block; container-type: inline-size; }
|
|
318
|
+
.top { display: flex; align-items: center; gap: ${p(3)}; margin-block-end: ${p(6)}; ${M("sm")} font-weight: ${ae("medium")}; }
|
|
319
|
+
.stars { display: inline-flex; gap: 2px; color: ${Yi}; }
|
|
320
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${p(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
321
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
322
|
+
li { display: flex; flex-direction: column; gap: ${p(4)}; padding: ${p(6)}; background: ${d.surfaceCard}; border-radius: ${d.radiusXl}; box-shadow: ${d.shadowSm}, inset 0 0 0 1px ${d.hairline}; }
|
|
323
|
+
blockquote { margin: 0; flex: 1; ${M("md")} text-wrap: pretty; }
|
|
324
|
+
.who { display: flex; align-items: center; gap: ${p(3)}; }
|
|
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: ${d.brandSubtle}; color: ${d.brand}; ${M("sm")} font-weight: ${ae("bold")}; }
|
|
326
|
+
.face img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
327
|
+
.name { font-weight: ${ae("semibold")}; ${M("sm")} }
|
|
328
|
+
.about { color: ${d.textMuted}; ${M("sm")} }
|
|
329
|
+
@container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
330
|
+
`]}render(){return b`${this.summary||this.rating?b`<p class="top" part="summary" style="margin-block-start:0">${this.rating?hi(Math.round(this.rating)):C}<span>${this.summary}</span></p>`:C}
|
|
331
|
+
<ul part="list">${(this.items??[]).map(t=>b`<li part="review">
|
|
332
|
+
${t.rating?hi(t.rating):C}
|
|
333
|
+
<blockquote>${t.quote}</blockquote>
|
|
334
|
+
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?b`<img src=${t.avatarSrc} alt="" />`:Gi(t.person)}</span><span><span class="name">${t.person}</span>${t.about?b`<br /><span class="about">${t.about}</span>`:C}</span></div>
|
|
335
|
+
</li>`)}</ul>`}},ht=class extends F{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=[...F.styles,mt,he,ut,re`
|
|
336
|
+
:host { display: block; container-type: inline-size; }
|
|
337
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${p(8)}; align-items: center; }
|
|
338
|
+
.words { display: flex; flex-direction: column; gap: ${p(2)}; }
|
|
339
|
+
.h { ${M("2xl")} }
|
|
340
|
+
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${p(1)} ${p(3)}; }
|
|
341
|
+
label { grid-column: 1 / -1; ${M("sm")} font-weight: ${ae("semibold")}; }
|
|
342
|
+
input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${p(2.5)} ${p(3)}; font: inherit; color: ${d.text}; background: ${d.surfaceCard}; border: ${d.borderThin} solid ${d.border}; border-radius: ${d.radiusLg}; box-shadow: ${d.shadowXs}; }
|
|
343
|
+
button { ${Gt} min-block-size: 44px; padding: ${p(2)} ${p(5)}; font: inherit; ${M("sm")} font-weight: ${ae("semibold")}; color: ${d.onBrand}; background: ${d.brand}; border: 0; border-radius: ${d.radiusLg}; box-shadow: ${d.shadowXs}; cursor: pointer; }
|
|
344
|
+
button:hover { background: ${d.brandHover}; }
|
|
345
|
+
.note { grid-column: 1 / -1; margin: ${p(1)} 0 0; color: ${d.textMuted}; ${M("sm")} }
|
|
346
|
+
.done { margin: 0; ${M("md")} font-weight: ${ae("semibold")}; }
|
|
347
|
+
@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 b`<div class="wrap" part="wrap">
|
|
349
|
+
<div class="words">
|
|
350
|
+
${this.heading?b`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:C}
|
|
351
|
+
${this.lead?b`<p class="lead">${this.lead}</p>`:C}
|
|
352
|
+
</div>
|
|
353
|
+
<div aria-live="polite">${this.done?b`<p class="done">${this.doneText}</p>`:b`<form @submit=${this.submit}>
|
|
354
|
+
<label for=${e}>${this.label}</label>
|
|
355
|
+
<input id=${e} type="email" name="email" autocomplete="email" required />
|
|
356
|
+
<button type="submit">${this.buttonText}</button>
|
|
357
|
+
${this.smallPrint?b`<p class="note">${this.smallPrint}</p>`:C}
|
|
358
|
+
</form>`}</div>
|
|
359
|
+
</div>`}};customElements.define("impakt-carousel",st);customElements.define("impakt-gallery",nt);customElements.define("impakt-logo-cloud",ot);customElements.define("impakt-steps",lt);customElements.define("impakt-media-split",ct);customElements.define("impakt-cta-banner",dt);customElements.define("impakt-reviews",pt);customElements.define("impakt-newsletter",ht);import{css as Ne,html as E,nothing as U}from"./atomic-ui.js";import{say as me,pageLocale as Xi,ImpaktElement as se,focusRing as je,targetSize as bi,fontWeight as Y,space as h,spaceAround as xt,t as r,type as j,iconSvg as we}from"./atomic-ui.js";var gt=class extends se{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=[...se.styles,je,xt,Ne`
|
|
360
|
+
:host { display: block; container-type: inline-size; }
|
|
361
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: ${h(6)}; align-items: start; }
|
|
362
|
+
.plan { position: relative; overflow: hidden; border-radius: ${r.radius2xl}; background: ${r.surfaceSubtle}; box-shadow: ${r.shadowMd}; line-height: 0; }
|
|
363
|
+
.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; ${j("xs")} line-height: 1; font-weight: ${Y("bold")}; color: ${r.onBrand}; background: ${r.brand}; border: 2px solid ${r.surfaceCard}; border-radius: 50%; box-shadow: ${r.shadowMd}; cursor: pointer; transition: transform 120ms ease-in-out; }
|
|
365
|
+
.pin:hover { transform: scale(1.12); }
|
|
366
|
+
.pin.reserved { color: ${r.text}; background: ${r.warningSubtle}; border-color: ${r.warning}; border-style: dashed; }
|
|
367
|
+
.pin.sold { color: ${r.textMuted}; background: ${r.surfaceCard}; border-color: ${r.border}; border-radius: ${r.radius}; }
|
|
368
|
+
.pin[aria-pressed='true'] { transform: scale(1.22); box-shadow: ${r.shadowLg}, 0 0 0 3px ${r.brand}; }
|
|
369
|
+
.panel { display: flex; flex-direction: column; gap: ${h(3)}; padding: ${h(6)}; background: ${r.surfaceCard}; border-radius: ${r.radius2xl}; box-shadow: ${r.shadowSm}, 0 0 0 1px color-mix(in srgb, ${r.text} 6%, transparent); }
|
|
370
|
+
.hint { margin: 0; color: ${r.textMuted}; }
|
|
371
|
+
.name { margin: 0; font-family: ${r.fontHeading}; ${j("2xl")} font-weight: ${Y("bold")}; color: ${r.textHeading}; }
|
|
372
|
+
.sub { margin: 0; color: ${r.textMuted}; }
|
|
373
|
+
.price { margin: 0; ${j("xl")} font-weight: ${Y("semibold")}; }
|
|
374
|
+
.status { align-self: flex-start; padding: ${h(.5)} ${h(2.5)}; ${j("xs")} font-weight: ${Y("semibold")}; color: ${r.successText}; background: ${r.successSubtle}; border-radius: 999px; }
|
|
375
|
+
.status.reserved { color: ${r.warningText}; background: ${r.warningSubtle}; }
|
|
376
|
+
.status.sold { color: ${r.text}; background: ${r.surfaceSubtle}; }
|
|
377
|
+
.go { ${bi} display: inline-flex; align-items: center; justify-content: center; gap: ${h(2)}; padding: ${h(2)} ${h(4)}; ${j("sm")} font-weight: ${Y("semibold")}; color: ${r.onBrand}; text-decoration: none; background: ${r.brand}; border-radius: ${r.radiusLg}; }
|
|
378
|
+
.go:hover { background: ${r.brandHover}; }
|
|
379
|
+
.legend { display: flex; flex-wrap: wrap; gap: ${h(4)}; margin: ${h(3)} 0 0; padding: 0; list-style: none; ${j("sm")} color: ${r.textMuted}; }
|
|
380
|
+
.legend li { display: inline-flex; align-items: center; gap: ${h(2)}; }
|
|
381
|
+
.key { box-sizing: border-box; inline-size: 14px; block-size: 14px; background: ${r.brand}; border: 2px solid ${r.surfaceCard}; border-radius: 50%; outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
|
|
382
|
+
.key.reserved { background: ${r.warningSubtle}; border: 2px dashed ${r.warning}; }
|
|
383
|
+
.key.sold { background: ${r.surfaceCard}; border: 2px solid ${r.border}; border-radius: 3px; }
|
|
384
|
+
:host { --plan-card: var(--impakt-solid-card, ${r.surfaceCard}); --plan-text: var(--impakt-solid-text, ${r.text}); --plan-heading: var(--impakt-solid-heading, ${r.text}); --plan-muted: var(--impakt-solid-muted, ${r.textMuted}); }
|
|
385
|
+
: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: ${h(8)}; inline-size: 22.5rem; box-sizing: border-box; box-shadow: ${r.shadowXl}; } }
|
|
387
|
+
@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 E`<p class="hint">${this.hint}</p>`;let e=t.status??"available";return E`<span class="status ${e}">${this.word(e)}</span>
|
|
389
|
+
<p class="name">${this.plotWord} ${t.number}</p>
|
|
390
|
+
${t.name||t.beds?E`<p class="sub">${[t.name,t.beds].filter(Boolean).join(" \xB7 ")}</p>`:U}
|
|
391
|
+
${t.price?E`<p class="price">${t.price}</p>`:U}
|
|
392
|
+
${t.href&&e!=="sold"?E`<a class="go" href=${t.href}>${this.actionText}${we("arrow-right","16px")}</a>`:U}`}render(){return E`<div class="wrap" part="wrap">
|
|
393
|
+
<div>
|
|
394
|
+
<div class="plan" part="plan">
|
|
395
|
+
<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 E`<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
|
+
</div>
|
|
398
|
+
<ul class="legend">
|
|
399
|
+
<li><span class="key"></span>${this.availableText}</li>
|
|
400
|
+
<li><span class="key reserved"></span>${this.reservedText}</li>
|
|
401
|
+
<li><span class="key sold"></span>${this.soldText}</li>
|
|
402
|
+
</ul>
|
|
403
|
+
</div>
|
|
404
|
+
<div class="panel" part="panel" aria-live="polite">${this.renderPanel()}</div>
|
|
405
|
+
</div>`}};function fi(o,t,e){let i=e*12;if(o<=0||i<=0)return 0;let a=t/100/12;return a===0?o/i:o*a/(1-(1+a)**-i)}var bt=class extends se{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=[...se.styles,je,xt,Ne`
|
|
406
|
+
:host { display: block; container-type: inline-size; }
|
|
407
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; background: ${r.surfaceCard}; border-radius: ${r.radius2xl}; box-shadow: ${r.shadowMd}, 0 0 0 1px color-mix(in srgb, ${r.text} 6%, transparent); }
|
|
408
|
+
.inputs { display: flex; flex-direction: column; gap: ${h(5)}; padding: ${h(8)}; }
|
|
409
|
+
.h { margin: 0; font-family: ${r.fontHeading}; ${j("2xl")} font-weight: ${Y("bold")}; color: ${r.textHeading}; }
|
|
410
|
+
label { display: flex; justify-content: space-between; gap: ${h(3)}; ${j("sm")} font-weight: ${Y("semibold")}; margin-block-end: ${h(1.5)}; }
|
|
411
|
+
.read { font-weight: ${Y("regular")}; color: ${r.textMuted}; }
|
|
412
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${h(2)} ${h(3)}; font: inherit; color: ${r.text}; background: ${r.surfaceCard}; border: ${r.borderThin} solid ${r.border}; border-radius: ${r.radiusLg}; }
|
|
413
|
+
input[type='range'] { inline-size: 100%; min-block-size: 24px; margin: 0; accent-color: ${r.brand}; }
|
|
414
|
+
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${h(4)}; }
|
|
415
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${h(2)}; padding: ${h(8)}; color: ${r.onBrand}; background: ${r.brand}; }
|
|
416
|
+
.caption { margin: 0; ${j("sm")} opacity: 0.85; }
|
|
417
|
+
output { display: block; font-family: ${r.fontHeading}; ${j("4xl")} font-weight: ${Y("bold")}; }
|
|
418
|
+
dl { display: grid; gap: ${h(2)}; margin: ${h(4)} 0 0; padding-block-start: ${h(4)}; border-block-start: 1px solid color-mix(in srgb, ${r.onBrand} 25%, transparent); ${j("sm")} }
|
|
419
|
+
dl div { display: flex; justify-content: space-between; gap: ${h(3)}; }
|
|
420
|
+
dt { opacity: 0.85; }
|
|
421
|
+
dd { margin: 0; font-weight: ${Y("semibold")}; }
|
|
422
|
+
/* 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: ${h(4)} ${h(8)}; ${j("xs")} color: ${r.text}; background: ${r.surfaceSubtle}; }
|
|
424
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${h(5)}; } .small { padding: ${h(4)} ${h(5)}; } }
|
|
425
|
+
`]}money(t){try{return new Intl.NumberFormat(Xi(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=fi(e,this.rate,this.years);return E`<div class="wrap" part="wrap">
|
|
426
|
+
<div class="inputs">
|
|
427
|
+
${this.heading?E`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:U}
|
|
428
|
+
<div><label for=${this.id_("price")}>${me("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>
|
|
429
|
+
<div><label for=${this.id_("deposit")}>${me("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
|
+
<div class="two">
|
|
431
|
+
<div><label for=${this.id_("years")}>${me("Term")} <span class="read">${me("{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>
|
|
432
|
+
<div><label for=${this.id_("rate")}>${me("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
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
<div class="result">
|
|
436
|
+
<p class="caption">${me("Estimated monthly repayment")}</p>
|
|
437
|
+
<output for=${`${this.id_("price")} ${this.id_("deposit")} ${this.id_("years")} ${this.id_("rate")}`}>${this.money(i)}</output>
|
|
438
|
+
<dl>
|
|
439
|
+
<div><dt>${me("You would borrow")}</dt><dd>${this.money(e)}</dd></div>
|
|
440
|
+
<div><dt>${me("Total repayable")}</dt><dd>${this.money(i*this.years*12)}</dd></div>
|
|
441
|
+
</dl>
|
|
442
|
+
</div>
|
|
443
|
+
${this.smallPrint?E`<p class="small">${this.smallPrint}</p>`:U}
|
|
444
|
+
</div>`}},ft=class extends se{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=[...se.styles,je,xt,Ne`
|
|
445
|
+
.frame { position: relative; overflow: hidden; border-radius: ${r.radius2xl}; box-shadow: ${r.shadowLg}; line-height: 0; --at: 50%; }
|
|
446
|
+
img { display: block; inline-size: 100%; block-size: auto; }
|
|
447
|
+
.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: ${h(3)}; padding: ${h(1)} ${h(3)}; ${j("xs")} line-height: 1.4; font-weight: ${Y("semibold")}; color: ${r.text}; background: ${r.surfaceCard}; border-radius: 999px; box-shadow: ${r.shadowSm}; }
|
|
449
|
+
.tag.b { inset-inline-start: ${h(3)}; }
|
|
450
|
+
.tag.a { inset-inline-end: ${h(3)}; }
|
|
451
|
+
.line { position: absolute; inset-block: 0; inset-inline-start: var(--at); inline-size: 2px; margin-inline-start: -1px; background: ${r.surfaceCard}; pointer-events: none; }
|
|
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: ${r.text}; background: ${r.surfaceCard}; border-radius: 50%; box-shadow: ${r.shadowMd}; }
|
|
453
|
+
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: ${r.focusShadow}; }
|
|
455
|
+
`]}render(){return E`<div class="frame" part="frame" style="--at:${this.position}%">
|
|
456
|
+
<img src=${this.beforeSrc} alt=${this.beforeAlt} />
|
|
457
|
+
<img class="after" src=${this.afterSrc} alt=${this.afterAlt} />
|
|
458
|
+
<span class="tag b" aria-hidden="true">${this.beforeLabel}</span>
|
|
459
|
+
<span class="tag a" aria-hidden="true">${this.afterLabel}</span>
|
|
460
|
+
<span class="line"><span class="grip">${we("arrow-left","14px")}${we("arrow-right","14px")}</span></span>
|
|
461
|
+
<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>`}},$t=class extends se{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=[...se.styles,je,Ne`
|
|
463
|
+
: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: ${h(4)}; padding: ${h(3)} ${h(4)} calc(${h(3)} + env(safe-area-inset-bottom)); background: ${r.surfaceCard}; box-shadow: ${r.shadowXl}, 0 -1px 0 color-mix(in srgb, ${r.text} 8%, transparent); transform: translateY(110%); visibility: hidden; transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms; }
|
|
465
|
+
.bar.on { transform: none; visibility: visible; }
|
|
466
|
+
.spacer { block-size: 5rem; }
|
|
467
|
+
.h { font-family: ${r.fontHeading}; ${j("md")} font-weight: ${Y("bold")}; color: ${r.textHeading}; }
|
|
468
|
+
.t { ${j("xs")} color: ${r.textMuted}; }
|
|
469
|
+
.words { min-inline-size: 0; }
|
|
470
|
+
.actions { display: flex; flex: none; gap: ${h(2)}; }
|
|
471
|
+
@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`:"",s=document.documentElement.style;s.scrollPaddingBlockEnd=a,a?s.setProperty("--impakt-bottom-bar",a):s.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 E`<div class="spacer"></div>
|
|
473
|
+
<section class="bar ${this.shown?"on":""}" part="bar" aria-label=${this.label}>
|
|
474
|
+
<div class="words">
|
|
475
|
+
${this.heading?E`<div class="h">${this.heading}</div>`:U}
|
|
476
|
+
${this.lead?E`<div class="t">${this.lead}</div>`:U}
|
|
477
|
+
</div>
|
|
478
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
479
|
+
</section>`}},yt=class extends se{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=[...se.styles,je,xt,Ne`
|
|
480
|
+
:host { display: block; container-type: inline-size; }
|
|
481
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: ${r.surfaceCard}; border-radius: ${r.radius2xl}; box-shadow: ${r.shadowMd}, 0 0 0 1px color-mix(in srgb, ${r.text} 6%, transparent); }
|
|
482
|
+
.wrap.solo { grid-template-columns: minmax(0, 1fr); }
|
|
483
|
+
.map { min-block-size: 16rem; background: ${r.surfaceSubtle}; }
|
|
484
|
+
.map img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
485
|
+
.info { display: flex; flex-direction: column; gap: ${h(3)}; padding: ${h(8)}; }
|
|
486
|
+
.h { margin: 0; font-family: ${r.fontHeading}; ${j("2xl")} font-weight: ${Y("bold")}; color: ${r.textHeading}; }
|
|
487
|
+
.row { display: flex; gap: ${h(3)}; margin: 0; white-space: pre-line; }
|
|
488
|
+
.row svg { flex: none; margin-block-start: ${h(.5)}; color: ${r.brand}; }
|
|
489
|
+
.row a { display: inline-flex; align-items: center; min-block-size: ${r.targetMin}; margin-block-start: -2px; }
|
|
490
|
+
a { color: ${r.link}; }
|
|
491
|
+
ul { display: grid; gap: ${h(1.5)}; margin: ${h(1)} 0; padding: ${h(3)} 0 0; list-style: none; border-block-start: 1px solid color-mix(in srgb, ${r.text} 10%, transparent); ${j("sm")} }
|
|
492
|
+
li { display: flex; justify-content: space-between; gap: ${h(3)}; }
|
|
493
|
+
li span:last-child { color: ${r.textMuted}; text-align: end; }
|
|
494
|
+
.go { ${bi} align-self: flex-start; display: inline-flex; align-items: center; gap: ${h(2)}; padding: ${h(2)} ${h(4)}; ${j("sm")} font-weight: ${Y("semibold")}; color: ${r.onBrand}; text-decoration: none; background: ${r.brand}; border-radius: ${r.radiusLg}; }
|
|
495
|
+
.go:hover { background: ${r.brandHover}; }
|
|
496
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .info { padding: ${h(5)}; } }
|
|
497
|
+
`]}render(){let t=this.directionsHref||(this.address?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(this.address)}`:"");return E`<div class="wrap ${this.mapSrc?"":"solo"}" part="wrap">
|
|
498
|
+
${this.mapSrc?E`<div class="map"><img src=${this.mapSrc} alt=${this.mapAlt} /></div>`:U}
|
|
499
|
+
<div class="info">
|
|
500
|
+
${this.heading?E`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:U}
|
|
501
|
+
${this.address?E`<p class="row">${we("map-pin","20px")}<span>${this.address}</span></p>`:U}
|
|
502
|
+
${this.hours?E`<p class="row">${we("clock","20px")}<span>${this.hours}</span></p>`:U}
|
|
503
|
+
${this.phone?E`<p class="row">${we("phone","20px")}<a href=${`tel:${this.phone.replace(/\s+/g,"")}`}>${this.phone}</a></p>`:U}
|
|
504
|
+
${this.nearby.length?E`<ul>${this.nearby.map(e=>E`<li><span>${e.place}</span><span>${e.distance}</span></li>`)}</ul>`:U}
|
|
505
|
+
${t?E`<a class="go" href=${t}>${this.directionsText}${we("arrow-right","16px")}</a>`:U}
|
|
506
|
+
</div>
|
|
507
|
+
</div>`}};customElements.define("impakt-site-plan",gt);customElements.define("impakt-mortgage-calculator",bt);customElements.define("impakt-before-after",ft);customElements.define("impakt-sticky-bar",$t);customElements.define("impakt-location-card",yt);import{css as Le,html as f,nothing as I}from"./atomic-ui.js";import{say as z,pageLocale as yi,ImpaktElement as K,focusRing as We,targetSize as Vi,visuallyHidden as Qi,fontWeight as _,space as m,spaceAround as Me,t as c,type as P}from"./atomic-ui.js";var _e=Le`
|
|
508
|
+
.card { background: ${c.surfaceCard}; border-radius: ${c.radiusXl}; box-shadow: ${c.shadowSm}, 0 0 0 1px ${c.hairline}; }
|
|
509
|
+
.h { margin: 0; font-family: ${c.fontHeading}; ${P("2xl")} font-weight: ${_("bold")}; color: ${c.textHeading}; }
|
|
510
|
+
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${m(2.5)} ${m(5)}; font: inherit; font-weight: ${_("semibold")}; color: ${c.onBrand}; text-decoration: none; background: ${c.brand}; border: 0; border-radius: ${c.radiusLg}; cursor: pointer; }
|
|
511
|
+
.btn:hover { background: ${c.brandHover}; }
|
|
512
|
+
.btn.quiet { color: ${c.link}; background: transparent; box-shadow: inset 0 0 0 ${c.borderThin} ${c.border}; }
|
|
513
|
+
.small { margin: 0; ${P("xs")} color: ${c.textMuted}; }
|
|
514
|
+
.visually-hidden { ${Qi} }
|
|
515
|
+
`,vt=(o,t="GBP",e=0)=>{try{return new Intl.NumberFormat(yi(),{style:"currency",currency:t,maximumFractionDigits:e,minimumFractionDigits:e}).format(o)}catch{return String(Math.round(o))}},wt=class extends K{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=[...K.styles,We,Vi,Me,_e,Le`
|
|
516
|
+
:host { display: block; container-type: inline-size; }
|
|
517
|
+
.h { margin-block-end: ${m(5)}; }
|
|
518
|
+
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${m(4)}; }
|
|
519
|
+
.plan { position: relative; display: flex; flex-direction: column; gap: ${m(3)}; padding: ${m(6)}; }
|
|
520
|
+
.plan.top { box-shadow: 0 0 0 2px ${c.brand}, ${c.shadowMd}; }
|
|
521
|
+
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${m(1)} ${m(3)}; border-radius: 999px; ${P("xs")} font-weight: ${_("bold")}; color: ${c.onBrand}; background: ${c.brand}; white-space: nowrap; }
|
|
522
|
+
.name { margin: 0; ${P("lg")} font-weight: ${_("bold")}; color: ${c.text}; }
|
|
523
|
+
.price { margin: 0; font-family: ${c.fontHeading}; ${P("3xl")} font-weight: ${_("bold")}; color: ${c.text}; }
|
|
524
|
+
.period { ${P("sm")} font-weight: ${_("regular")}; color: ${c.textMuted}; }
|
|
525
|
+
.note { margin: 0; ${P("sm")} color: ${c.textMuted}; }
|
|
526
|
+
ul { flex: 1; margin: 0; padding: ${m(3)} 0 0; list-style: none; display: grid; gap: ${m(2)}; border-block-start: 1px solid ${c.rule}; align-content: start; }
|
|
527
|
+
li { display: flex; gap: ${m(2)}; ${P("sm")} }
|
|
528
|
+
li[data-has='false'] { color: ${c.textMuted}; }
|
|
529
|
+
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${_("bold")}; text-align: center; }
|
|
530
|
+
li[data-has='true'] .mark { color: ${c.successText}; }
|
|
531
|
+
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${m(6)}; } }
|
|
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 f`
|
|
533
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:I}
|
|
534
|
+
<div class="grid" style=${`--cols: ${Math.max(1,this.plans.length)}`}>
|
|
535
|
+
${this.plans.map(t=>f`<section class="card plan ${t.badge?"top":""}" aria-labelledby=${this.id_(`n-${t.id}`)}>
|
|
536
|
+
${t.badge?f`<span class="badge">${t.badge}</span>`:I}
|
|
537
|
+
<h3 class="name" id=${this.id_(`n-${t.id}`)}>${t.name}</h3>
|
|
538
|
+
<p class="price">${t.price}${t.period?f` <span class="period">${t.period}</span>`:I}</p>
|
|
539
|
+
${t.note?f`<p class="note">${t.note}</p>`:I}
|
|
540
|
+
<ul>${this.rows.map(e=>{let i=this.has(t,e);return f`<li data-has=${String(i)}><span class="mark" aria-hidden="true">${i?"\u2713":"\u2013"}</span><span>${e.label}<span class="visually-hidden">: ${z(i?"included":"not included")}</span></span></li>`})}</ul>
|
|
541
|
+
${t.href?f`<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>`:f`<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
|
+
</section>`)}
|
|
543
|
+
</div>`}};function xi(o,t){let e=/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/.exec(o),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(o);return a?`https://player.vimeo.com/video/${a[1]}?autoplay=1&dnt=1`:null}var Oe=class extends K{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=[...K.styles,We,Me,_e,Le`
|
|
544
|
+
:host { display: block; }
|
|
545
|
+
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${c.radiusXl}; background: #111; }
|
|
546
|
+
:host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }
|
|
547
|
+
:host([ratio='1:1']) .frame { aspect-ratio: 1; }
|
|
548
|
+
:host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }
|
|
549
|
+
iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }
|
|
550
|
+
.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: ${c.brand}; box-shadow: ${c.shadowLg}; }
|
|
552
|
+
/* 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: ${m(5)}; inset-block-end: ${m(4)}; ${P("lg")} font-weight: ${_("semibold")}; text-align: start; }
|
|
554
|
+
.foot { margin: ${m(2)} 0 0; ${P("sm")} }
|
|
555
|
+
.foot a { color: ${c.link}; }
|
|
556
|
+
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
557
|
+
`]}render(){let t=xi(this.videoSrc,yi(this)),e;return this.videoSrc?t&&this.playing?e=f`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?e=f`${this.posterSrc?f`<img src=${this.posterSrc} alt="" />`:I}
|
|
558
|
+
<button class="play" type="button" @click=${()=>{this.playing=!0}}>
|
|
559
|
+
<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
|
+
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
561
|
+
</button>`:e=f`<video controls preload="metadata" poster=${this.posterSrc||I} aria-label=${this.label}>
|
|
562
|
+
<source src=${this.videoSrc} />
|
|
563
|
+
${this.captionsSrc?f`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:I}
|
|
564
|
+
</video>`:e=f`<div class="empty">${z("Add a video address")}</div>`,f`<div class="frame" part="frame">${e}</div>
|
|
565
|
+
${this.transcriptHref?f`<p class="foot"><a href=${this.transcriptHref}>${z("Read the transcript")}<span class="visually-hidden">${z(" of {video}",{video:this.label})}</span></a></p>`:I}`}},$i={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:""}},kt=class extends K{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=[...K.styles,Me,Le`
|
|
566
|
+
:host { display: block; }
|
|
567
|
+
.box { padding: ${m(5)}; border-inline-start: 6px solid ${c.warning}; border-radius: ${c.radiusLg}; background: ${c.warningSubtle}; }
|
|
568
|
+
:host([kind='insurance']) .box { border-color: ${c.info}; background: ${c.infoSubtle}; }
|
|
569
|
+
strong { display: block; margin-block-end: ${m(1)}; ${P("md")} color: ${c.text}; }
|
|
570
|
+
p { margin: 0; color: ${c.text}; }
|
|
571
|
+
/* 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: ${m(3)}; ${P("sm")} color: ${c.text}; }
|
|
573
|
+
`]}render(){let t=$i[this.kind]??$i.custom,e=this.heading||(t.heading?z(t.heading):""),i=this.text||(t.text?z(t.text):"");return f`<aside class="box" part="box" aria-label=${e||z("Important information")}>
|
|
574
|
+
${e?f`<strong>${e}</strong>`:I}
|
|
575
|
+
${i?f`<p>${i}</p>`:I}
|
|
576
|
+
${this.firm?f`<p class="firm">${this.firm}</p>`:I}
|
|
577
|
+
</aside>`}},ue={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 Xt(o,t,e=0){let i=0;return t.forEach((a,s)=>{let n=t[s+1]?.from??1/0;o>a.from&&(i+=(Math.min(o,n)-a.from)*(a.rate+e)/100)}),Math.round(i)}function vi(o,t){return o<=0?0:t==="first-time"&&o<=ue.firstTimeLimit?Xt(o,ue.firstTime):t==="additional"?o<4e4?0:Xt(o,ue.standard,ue.additionalSurcharge):Xt(o,ue.standard)}var wi=Le`
|
|
578
|
+
:host { display: block; container-type: inline-size; }
|
|
579
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }
|
|
580
|
+
.inputs { display: flex; flex-direction: column; gap: ${m(5)}; padding: ${m(8)}; }
|
|
581
|
+
label, legend { display: block; ${P("sm")} font-weight: ${_("semibold")}; margin-block-end: ${m(1.5)}; padding: 0; }
|
|
582
|
+
fieldset { margin: 0; padding: 0; border: 0; }
|
|
583
|
+
.choices { display: flex; flex-wrap: wrap; gap: ${m(2)}; }
|
|
584
|
+
.choices label { display: inline-flex; align-items: center; gap: ${m(2)}; margin: 0; padding: ${m(2)} ${m(3)}; font-weight: ${_("regular")}; border: ${c.borderThin} solid ${c.border}; border-radius: ${c.radiusLg}; cursor: pointer; }
|
|
585
|
+
.choices input { accent-color: ${c.brand}; }
|
|
586
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${m(2)} ${m(3)}; font: inherit; color: ${c.text}; background: ${c.surfaceCard}; border: ${c.borderThin} solid ${c.border}; border-radius: ${c.radiusLg}; }
|
|
587
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${m(2)}; padding: ${m(8)}; color: ${c.onBrand}; background: ${c.brand}; }
|
|
588
|
+
.caption { margin: 0; ${P("sm")} opacity: 0.85; }
|
|
589
|
+
output { display: block; font-family: ${c.fontHeading}; ${P("4xl")} font-weight: ${_("bold")}; }
|
|
590
|
+
.line { margin: 0; ${P("sm")} }
|
|
591
|
+
.foot { grid-column: 1 / -1; padding: ${m(4)} ${m(8)}; background: ${c.surfaceSubtle}; }
|
|
592
|
+
/* 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: ${c.text}; }
|
|
594
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${m(5)}; } .foot { padding: ${m(4)} ${m(5)}; } }
|
|
595
|
+
`,St=class extends K{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=[...K.styles,We,Me,_e,wi]}render(){let t=vi(this.price,this.buyer),e=this.price>0?t/this.price*100:0,i=[["first-time",z("First home")],["mover",z("Moving home")],["additional",z("Second home")]];return f`<div class="card wrap" part="wrap">
|
|
596
|
+
<div class="inputs">
|
|
597
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:I}
|
|
598
|
+
<div><label for=${this.id_("price")}>${z("Price of the home (\xA3)")}</label>
|
|
599
|
+
<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>${z("Are you buying")}</legend><div class="choices">
|
|
601
|
+
${i.map(([a,s])=>f`<label><input type="radio" name=${this.id_("buyer")} .checked=${this.buyer===a} @change=${()=>{this.buyer=a}} />${s}</label>`)}
|
|
602
|
+
</div></fieldset>
|
|
603
|
+
</div>
|
|
604
|
+
<div class="result" aria-live="polite">
|
|
605
|
+
<p class="caption">${z("Stamp duty to pay")}</p>
|
|
606
|
+
<output for=${this.id_("price")}>${vt(t)}</output>
|
|
607
|
+
<p class="line">${t?z("About {rate}% of the price",{rate:e.toFixed(1)}):z("Nothing to pay at this price")}</p>
|
|
608
|
+
${this.buyer==="first-time"&&this.price>ue.firstTimeLimit?f`<p class="line">${z("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:vt(ue.firstTimeLimit)})}</p>`:I}
|
|
609
|
+
</div>
|
|
610
|
+
${this.smallPrint?f`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:I}
|
|
611
|
+
</div>`}},zt=class extends K{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=[...K.styles,We,Me,_e,wi]}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)=>f`<div><label for=${this.id_(i)}>${a}</label>
|
|
612
|
+
<input id=${this.id_(i)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[i])} @input=${this.field(i)} /></div>`;return f`<div class="card wrap" part="wrap">
|
|
613
|
+
<div class="inputs">
|
|
614
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:I}
|
|
615
|
+
${e("income",z("Your yearly income before tax (\xA3)"))}
|
|
616
|
+
${e("secondIncome",z("A second person\u2019s income, if buying together (\xA3)"))}
|
|
617
|
+
${e("deposit",z("Your deposit (\xA3)"))}
|
|
618
|
+
</div>
|
|
619
|
+
<div class="result" aria-live="polite">
|
|
620
|
+
<p class="caption">${z("You could borrow about")}</p>
|
|
621
|
+
<output>${vt(t)}</output>
|
|
622
|
+
<p class="line">${z("With your deposit, that\u2019s a home of about {amount}.",{amount:vt(t+this.deposit)})}</p>
|
|
623
|
+
</div>
|
|
624
|
+
${this.smallPrint?f`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:I}
|
|
625
|
+
</div>`}},Fe=class extends K{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
|
|
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=[...K.styles,We,Me,_e,Le`
|
|
627
|
+
:host { display: block; container-type: inline-size; }
|
|
628
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${m(6)}; padding: ${m(8)}; }
|
|
629
|
+
.phone { display: inline-block; margin: ${m(3)} 0; font-family: ${c.fontHeading}; ${P("3xl")} font-weight: ${_("bold")}; color: ${c.link}; text-decoration: none; }
|
|
630
|
+
.hours { margin: 0; white-space: pre-line; color: ${c.textMuted}; }
|
|
631
|
+
.email { display: inline-flex; align-items: center; min-block-size: ${c.targetMin}; margin-block-start: ${m(3)}; color: ${c.link}; overflow-wrap: anywhere; }
|
|
632
|
+
form { display: grid; gap: ${m(3)}; padding: ${m(5)}; border-radius: ${c.radiusLg}; background: ${c.surfaceInset}; }
|
|
633
|
+
.sub { margin: 0; ${P("lg")} font-weight: ${_("bold")}; color: ${c.text}; }
|
|
634
|
+
label { display: block; ${P("sm")} font-weight: ${_("semibold")}; margin-block-end: ${m(1)}; }
|
|
635
|
+
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${m(2)} ${m(3)}; font: inherit; color: ${c.text}; background: ${c.surfaceCard}; border: ${c.borderThin} solid ${c.border}; border-radius: ${c.radiusLg}; }
|
|
636
|
+
.done { margin: 0; padding: ${m(5)}; border-radius: ${c.radiusLg}; background: ${c.successSubtle}; color: ${c.successText}; font-weight: ${_("semibold")}; }
|
|
637
|
+
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${m(5)}; } }
|
|
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 f`<div class="card wrap" part="wrap">
|
|
639
|
+
<div>
|
|
640
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:I}
|
|
641
|
+
${this.phone?f`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:I}
|
|
642
|
+
${this.hours?f`<p class="hours">${this.hours}</p>`:I}
|
|
643
|
+
${this.email?f`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:I}
|
|
644
|
+
</div>
|
|
645
|
+
${this.callbackHeading?this.sent?f`<p class="done" role="status">${this.doneText}</p>`:f`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
646
|
+
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
647
|
+
<div><label for=${this.id_("name")}>${z("Your name")}</label><input id=${this.id_("name")} name="name" autocomplete="name" required /></div>
|
|
648
|
+
<div><label for=${this.id_("tel")}>${z("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
649
|
+
<div><label for=${this.id_("when")}>${z("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${z("Morning")}</option><option value="Afternoon">${z("Afternoon")}</option><option value="Evening">${z("Evening")}</option></select></div>
|
|
650
|
+
<button class="btn" type="submit">${this.buttonText}</button>
|
|
651
|
+
</form>`:I}
|
|
652
|
+
</div>`}};Oe.createProperty("playing",{state:!0});Fe.createProperty("sent",{state:!0});customElements.define("impakt-plan-comparison",wt);customElements.define("impakt-video",Oe);customElements.define("impakt-regulatory-notice",kt);customElements.define("impakt-stamp-duty-calculator",St);customElements.define("impakt-affordability-calculator",zt);customElements.define("impakt-contact-block",Fe);import{css as Ki,html as N,nothing as ee,unsafeCSS as ki}from"./atomic-ui.js";import{ImpaktElement as Si,pageLocale as zi,say as O,focusRing as Zi,targetSize as Ti,visuallyHidden as Ai,fontSize as Vt,fontWeight as ke,space as k,spaceAround as Ji,t as $,type as Se,toneOf as Tt}from"./atomic-ui.js";var At=o=>o.reduce((t,e)=>t+e,0),Li=(o,t)=>o.find(e=>typeof e.below=="number"&&t<e.below)??o.at(-1);function Lt(o,t,e){let i=o.flatMap(l=>(t[l.id]??[]).flatMap(y=>l.choices.filter(x=>x.id===y))),a=At(i.map(l=>l.cost??0)),s=At(i.map(l=>l.weeks??0));for(let l of i)a*=l.costFactor??1,s*=l.weeksFactor??1;let n=(Li(e.teams,a)?.engineers??1)+At(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(s)),engineers:n,way:Li(e.ways,a)?.text??""}}function Mi(o,t){let e=o.map(a=>typeof a.share=="number"?Math.max(1,Math.round(t*a.share)):0),i=Math.max(1,t-At(e));return o.map((a,s)=>typeof a.share=="number"?e[s]:i)}var Mt=class extends Si{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=[...Si.styles,Ji,Zi,Ki`
|
|
653
|
+
:host { display: block; container-type: inline-size; }
|
|
654
|
+
[hidden] { display: none !important; }
|
|
655
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${k(10)}; align-items: start; }
|
|
656
|
+
.mono { font-family: ${$.fontMono}; font-size: ${Vt("xs")}; letter-spacing: 0.04em; text-transform: uppercase; color: ${$.textMuted}; margin: 0; }
|
|
657
|
+
.sr-only { ${Ai} }
|
|
658
|
+
|
|
659
|
+
.progress { display: grid; gap: ${k(2)}; margin-block-end: ${k(6)}; }
|
|
660
|
+
.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: ${$.brand}; transition: inline-size 300ms ease; }
|
|
662
|
+
|
|
663
|
+
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
|
|
664
|
+
legend { padding: 0; margin-block-end: ${k(2)}; }
|
|
665
|
+
.q { margin: 0; font-family: ${$.fontHeading}; font-weight: ${ke("bold")}; ${Se("3xl")} letter-spacing: ${$.trackingTight}; color: ${$.textHeading}; outline: none; }
|
|
666
|
+
.hint { margin: 0 0 ${k(6)}; color: ${$.textMuted}; }
|
|
667
|
+
|
|
668
|
+
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${k(3)}; }
|
|
669
|
+
.choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
670
|
+
.choice { position: relative; display: grid; gap: ${k(1)}; align-content: start; padding: ${k(4)}; border: ${$.borderThin} solid ${$.border}; border-radius: ${$.radiusLg}; background: ${$.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
|
|
671
|
+
.choice:hover { border-color: ${$.borderStrong}; }
|
|
672
|
+
.choice input { ${Ai} }
|
|
673
|
+
.choice:has(input:checked) { border-color: ${$.brand}; box-shadow: inset 0 0 0 1px ${$.brand}; background: ${$.brandSubtle}; }
|
|
674
|
+
.choice:has(input:focus-visible) { box-shadow: ${$.focusShadow}; }
|
|
675
|
+
.many .choice { padding: ${k(3)}; }
|
|
676
|
+
.label { font-weight: ${ke("semibold")}; }
|
|
677
|
+
.small { ${Se("sm")} color: ${$.textMuted}; }
|
|
678
|
+
/* A tick for a picked feature, drawn in the corner. */
|
|
679
|
+
.many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${k(2)}; inset-inline-end: ${k(3)}; color: ${$.brand}; font-weight: ${ke("bold")}; }
|
|
680
|
+
|
|
681
|
+
.scale { display: grid; gap: ${k(3)}; }
|
|
682
|
+
.scale input { inline-size: 100%; accent-color: ${$.brand}; ${Ti} }
|
|
683
|
+
.ticks { display: flex; justify-content: space-between; ${Se("sm")} color: ${$.textMuted}; }
|
|
684
|
+
.ticks span[aria-current] { color: ${$.text}; font-weight: ${ke("semibold")}; }
|
|
685
|
+
.now { margin: 0; }
|
|
686
|
+
|
|
687
|
+
.nav { display: flex; gap: ${k(3)}; margin-block-start: ${k(8)}; }
|
|
688
|
+
button, .send { ${Ti} display: inline-flex; align-items: center; justify-content: center; gap: ${k(2)}; padding: ${k(2.5)} ${k(5)}; border-radius: ${$.radiusLg}; font: inherit; font-weight: ${ke("semibold")}; cursor: pointer; text-decoration: none; border: ${$.borderThin} solid transparent; }
|
|
689
|
+
.primary, .send { background: ${$.brand}; color: ${$.onBrand}; }
|
|
690
|
+
.primary:hover, .send:hover { background: ${$.brandHover}; }
|
|
691
|
+
.secondary { background: transparent; color: ${$.text}; border-color: ${$.borderStrong}; }
|
|
692
|
+
.secondary:hover { background: ${$.surfaceSubtle}; }
|
|
693
|
+
|
|
694
|
+
.panel { position: sticky; inset-block-start: ${k(6)}; overflow: hidden; isolation: isolate; padding: ${k(8)}; border-radius: ${$.radiusXl}; background: ${$.surfaceCard}; box-shadow: ${$.shadowMd}; display: grid; gap: ${k(2)}; }
|
|
695
|
+
/* 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, ${ki(Tt(1,0))} 45%, transparent), color-mix(in srgb, ${ki(Tt(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; }
|
|
697
|
+
.range { margin: 0; font-family: ${$.fontHeading}; font-weight: ${ke("bold")}; font-size: ${Vt("5xl")}; line-height: 1; letter-spacing: ${$.trackingTight}; color: ${$.textHeading}; }
|
|
698
|
+
.weeks { margin: 0; ${Se("lg")} }
|
|
699
|
+
.tip { margin: ${k(4)} 0 0; padding-block-start: ${k(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${$.textMuted}; }
|
|
700
|
+
|
|
701
|
+
.result { display: grid; gap: ${k(6)}; }
|
|
702
|
+
.summary { margin: 0; ${Se("xl")} text-wrap: pretty; }
|
|
703
|
+
.phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }
|
|
704
|
+
.phases i { display: block; }
|
|
705
|
+
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${k(2)} ${k(5)}; }
|
|
706
|
+
.legend li { display: inline-flex; align-items: center; gap: ${k(2)}; }
|
|
707
|
+
.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: ${k(4)}; }
|
|
709
|
+
dt { margin: 0 0 ${k(1)}; }
|
|
710
|
+
dd { margin: 0; font-weight: ${ke("semibold")}; }
|
|
711
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${k(3)}; }
|
|
712
|
+
.note { margin: 0; ${Se("sm")} color: ${$.textMuted}; }
|
|
713
|
+
.status { margin: 0; ${Se("sm")} }
|
|
714
|
+
|
|
715
|
+
@container (max-width: 48rem) {
|
|
716
|
+
.wrap { grid-template-columns: minmax(0, 1fr); gap: ${k(8)}; }
|
|
717
|
+
/* Not sticky once the panel is under the questions, but still the glow's containing block, so the panel clips it
|
|
718
|
+
and it never widens the page (1.4.10). */
|
|
719
|
+
.panel { position: relative; inset-block-start: auto; }
|
|
720
|
+
.choices.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
721
|
+
}
|
|
722
|
+
@container (max-width: 30rem) {
|
|
723
|
+
.choices { grid-template-columns: minmax(0, 1fr); }
|
|
724
|
+
.range { font-size: ${Vt("4xl")}; }
|
|
725
|
+
}
|
|
726
|
+
@media (forced-colors: active) {
|
|
727
|
+
.choice:has(input:checked) { outline: 3px solid Highlight; }
|
|
728
|
+
.bar i, .phases i, .legend li::before { background: CanvasText !important; }
|
|
729
|
+
.glow { display: none; }
|
|
730
|
+
}
|
|
731
|
+
`]}reset(){this.answers=Object.fromEntries((this.questions??[]).map(e=>{let i=(e.start??[]).filter(a=>e.choices.some(s=>s.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(zi(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(zi(this),{type:"conjunction"}).format(e)}catch{return e.join(", ")}}weeksWord(e){return e===1?O("{n} week",{n:e}):O("{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(n=>n.id)];let s=[...a.choices].sort((n,l)=>(l.cost??0)*(l.costFactor??1)-(n.cost??0)*(n.costFactor??1))[0];return[a.id,s?[s.id]:[]]}));return Lt(e,i,this.rules).high||1}summaryOf(e){let i=this.questions??[],a=i.find(u=>u.kind==="one"),s=a?a.choices.find(u=>u.id===this.answers[a.id]?.[0]):void 0,n=i.filter(u=>u.kind==="many"&&u.inSummary!==!1).flatMap(u=>(this.answers[u.id]??[]).map(be=>{let de=u.choices.find(Ge=>Ge.id===be);return de?de.phrase||de.label:be})),l=s?s.phrase||s.label:"",y=l?n.length?O("You are building {thing} with {list}.",{thing:l,list:this.listOf(n)}):O("You are building {thing}.",{thing:l}):"",x=O("Expect {range} and about {weeks} to a first release.",{range:this.rangeOf(e),weeks:this.weeksWord(e.weeks)});return y?`${y} ${x}`:x}rangeOf(e){return O("{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 s=this.answers[e.id]??[];this.answers={...this.answers,[e.id]:e.kind==="many"?a?[...s.filter(n=>n!==i.id),i.id]:s.filter(n=>n!==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=Lt(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(n=>n.short&&n.kind!=="many").map(n=>{let l=n.choices.find(y=>y.id===this.answers[n.id]?.[0]);return l?`${n.short}: ${l.label}.`:""}).filter(Boolean),s=(this.questions??[]).filter(n=>n.short&&n.kind==="many"&&n.inSummary===!1).map(n=>{let l=(this.answers[n.id]??[]).map(y=>n.choices.find(x=>x.id===y)?.label??y);return l.length?`${n.short}: ${this.listOf(l)}.`:""}).filter(Boolean);return[...i,...s,...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=O("Summary copied.")}catch{this.copied=O("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 N`<div class="q" role="heading" aria-level=${i} tabindex="-1">${e}</div>`}renderQuestion(e,i){let a=this.answers[e.id]??[],s=i===this.at;if(e.kind==="scale"){let l=Math.max(0,e.choices.findIndex(x=>x.id===a[0])),y=e.choices[l];return N`<fieldset class=${s?"current":""} ?hidden=${!s}>
|
|
732
|
+
<legend>${this.heading(e.heading)}</legend>
|
|
733
|
+
${e.hint?N`<p class="hint">${e.hint}</p>`:ee}
|
|
734
|
+
<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=${y?.label??""}
|
|
736
|
+
@input=${x=>{let u=e.choices[Number(x.target.value)];u&&this.pick(e,u,!0)}}>
|
|
737
|
+
<div class="ticks" aria-hidden="true">${e.choices.map((x,u)=>N`<span aria-current=${u===l?"true":ee}>${x.label}</span>`)}</div>
|
|
738
|
+
${y?.hint?N`<p class="now">${y.hint}</p>`:ee}
|
|
739
|
+
</div>
|
|
740
|
+
</fieldset>`}let n=e.kind==="many";return N`<fieldset class=${s?"current":""} ?hidden=${!s}>
|
|
741
|
+
<legend>${this.heading(e.heading)}</legend>
|
|
742
|
+
${e.hint?N`<p class="hint">${e.hint}</p>`:ee}
|
|
743
|
+
<div class="choices ${n?"many":""}">
|
|
744
|
+
${e.choices.map(l=>N`<label class="choice">
|
|
745
|
+
<input type=${n?"checkbox":"radio"} name=${`${this.uid}-${e.id}`} value=${l.id} .checked=${a.includes(l.id)}
|
|
746
|
+
@change=${y=>this.pick(e,l,y.target.checked)}>
|
|
747
|
+
<span class="label">${l.label}</span>
|
|
748
|
+
${l.hint?N`<span class="small">${l.hint}</span>`:ee}
|
|
749
|
+
</label>`)}
|
|
750
|
+
</div>
|
|
751
|
+
</fieldset>`}renderResult(e){let i=Mi(this.phases??[],e.weeks),a=this.at===(this.questions??[]).length;return N`<div class="result ${a?"current":""}" ?hidden=${!a}>
|
|
752
|
+
${this.heading(this.resultHeading)}
|
|
753
|
+
<p class="summary">${this.summaryOf(e)}</p>
|
|
754
|
+
${(this.phases??[]).length?N`
|
|
755
|
+
<div class="phases" aria-hidden="true">${(this.phases??[]).map((s,n)=>N`<i style=${`flex-grow:${i[n]};background:${Tt(void 0,n)}`}></i>`)}</div>
|
|
756
|
+
<ul class="legend">${(this.phases??[]).map((s,n)=>N`<li style=${`--c:${Tt(void 0,n)}`}>${s.label} <b>${this.weeksWord(i[n])}</b></li>`)}</ul>`:ee}
|
|
757
|
+
<dl>
|
|
758
|
+
<div><dt class="mono">${O("Your team")}</dt><dd>${this.teamOf(e.engineers)}</dd></div>
|
|
759
|
+
${e.way?N`<div><dt class="mono">${O("Way of working")}</dt><dd>${e.way}</dd></div>`:ee}
|
|
760
|
+
</dl>
|
|
761
|
+
<div class="actions">
|
|
762
|
+
${this.contactHref?N`<a class="send" href=${this.contactHref} @click=${s=>this.send(s)}>${this.sendLabel} <span aria-hidden="true">→</span></a>`:ee}
|
|
763
|
+
<button type="button" class="secondary" @click=${()=>this.copy()}>${O("Copy summary")}</button>
|
|
764
|
+
<button type="button" class="secondary" @click=${()=>{this.reset(),this.go(0)}}>${O("Start again")}</button>
|
|
765
|
+
</div>
|
|
766
|
+
<p class="status" role="status">${this.copied}</p>
|
|
767
|
+
${this.note?N`<p class="note">${this.note}</p>`:ee}
|
|
768
|
+
</div>`}render(){let e=this.questions??[],i=e.length,a=Lt(e,this.answers,this.rules),s=this.at>=i,n=(.6+Math.min(1,a.high/this.most)*1.1).toFixed(2);return N`<div class="wrap">
|
|
769
|
+
<div>
|
|
770
|
+
<div class="progress">
|
|
771
|
+
<p class="mono">${s?this.resultHeading:O("Step {step} of {steps}",{step:this.at+1,steps:i})}</p>
|
|
772
|
+
<div class="bar" aria-hidden="true"><i style=${`inline-size:${i?s?100:(this.at+1)/(i+1)*100:0}%`}></i></div>
|
|
773
|
+
</div>
|
|
774
|
+
${e.map((l,y)=>this.renderQuestion(l,y))}
|
|
775
|
+
${this.renderResult(a)}
|
|
776
|
+
${s?ee:N`<div class="nav">
|
|
777
|
+
${this.at>0?N`<button type="button" class="secondary" @click=${()=>this.go(this.at-1)}>${O("Back")}</button>`:ee}
|
|
778
|
+
<button type="button" class="primary" @click=${()=>this.go(this.at+1)}>${this.at===i-1?O("See my estimate"):O("Next")} <span aria-hidden="true">→</span></button>
|
|
779
|
+
</div>`}
|
|
780
|
+
</div>
|
|
781
|
+
<aside class="panel" part="panel" style=${`--s:${n}`}>
|
|
782
|
+
<div class="glow" aria-hidden="true"></div>
|
|
783
|
+
<p class="mono">${this.budgetLabel}</p>
|
|
784
|
+
<p class="range" aria-live="polite" aria-atomic="true">${this.rangeOf(a)}</p>
|
|
785
|
+
<p class="weeks">${O("About {weeks} to a first release",{weeks:this.weeksWord(a.weeks)})}</p>
|
|
786
|
+
<p class="tip" aria-live="polite">${this.tip||this.intro}</p>
|
|
787
|
+
</aside>
|
|
788
|
+
</div>`}};customElements.define("impakt-estimator",Mt);import{css as Kt,html as T,nothing as X}from"./atomic-ui.js";import{ImpaktElement as Ce,focusRing as Zt,hideOn as ea,fontSize as Ee,fontWeight as De,space as R,t as Z,type as qe,toneOf as Qt}from"./atomic-ui.js";var ta=[0,1,2,3,4],Be=Z.fontMono,Et=class extends Ce{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=[...Ce.styles,Zt,Kt`
|
|
789
|
+
:host { display: block; container-type: inline-size; }
|
|
790
|
+
.bar { display: flex; align-items: center; gap: ${R(6)}; }
|
|
791
|
+
.start { display: flex; align-items: center; gap: ${R(3)}; flex: none; }
|
|
792
|
+
.middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
|
|
793
|
+
.middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
|
|
794
|
+
slot { display: contents; }
|
|
795
|
+
.brand { display: inline-flex; align-items: center; min-block-size: ${Z.targetMin}; color: inherit; text-decoration: none; font-family: ${Z.fontHeading}; font-weight: ${De("semibold")}; ${qe("2xl")} letter-spacing: -0.02em; line-height: 1; border-radius: ${Z.radiusSm}; }
|
|
796
|
+
.brand img { display: block; block-size: 32px; inline-size: auto; }
|
|
797
|
+
.chip { display: inline-flex; align-items: center; gap: ${R(1)}; padding: 2px ${R(2)}; border-radius: ${Z.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${Be}; font-size: ${Ee("xs")}; }
|
|
798
|
+
.chip svg { inline-size: 12px; block-size: 12px; }
|
|
799
|
+
.meta { font-family: ${Be}; font-size: ${Ee("xs")}; opacity: 0.72; }
|
|
800
|
+
.middle impakt-nav { flex: 1 1 8rem; }
|
|
801
|
+
.end { display: flex; align-items: center; gap: ${R(3)}; flex: none; }
|
|
802
|
+
.end:empty, .start:empty { display: none; }
|
|
803
|
+
.status { display: inline-flex; align-items: center; gap: ${R(2)}; padding: ${R(1)} ${R(3)}; border: ${Z.borderThin} solid ${Z.border}; border-radius: 999px; background: ${Z.surfaceCard}; font-family: ${Be}; font-size: ${Ee("xs")}; white-space: nowrap; }
|
|
804
|
+
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
805
|
+
.status .hash { opacity: 0.72; }
|
|
806
|
+
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${R(3)}; } }
|
|
807
|
+
`]}act(){this.dispatchEvent(new CustomEvent("impakt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?T`<img src=${this.logoSrc} alt=${this.logoAlt||this.brand} />`:T`${this.brand}`;return T`<div class="bar" part="bar">
|
|
808
|
+
<div class="start"><slot name="start">
|
|
809
|
+
${this.brand||this.logoSrc?T`<a class="brand" href=${this.home||"/"} part="brand">${t}</a>`:X}
|
|
810
|
+
${this.badge?T`<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>`:X}
|
|
811
|
+
${this.meta?T`<span class="meta" part="meta">${this.meta}</span>`:X}
|
|
812
|
+
</slot></div>
|
|
813
|
+
<div class="middle"><slot name="middle">${(this.links??[]).length?T`<impakt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impakt-nav>`:X}</slot></div>
|
|
814
|
+
<div class="end"><slot name="end">
|
|
815
|
+
${this.status?T`<span class="status" part="status" style=${`--tone:${Qt(this.statusTone,0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta?T` <span class="hash">${this.statusMeta}</span>`:X}</span>`:X}
|
|
816
|
+
${this.actionText?T`<impakt-button variant="primary" icon-after="arrow-right" href=${this.actionHref||X} @click=${this.act}>${this.actionText}</impakt-button>`:X}
|
|
817
|
+
</slot></div>
|
|
818
|
+
</div>`}},Bt=class extends Ce{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=[...Ce.styles,Zt,ea,Kt`
|
|
819
|
+
:host { display: inline-flex; align-items: center; flex: none; }
|
|
820
|
+
a { color: inherit; text-decoration: none; font-family: ${Z.fontHeading}; font-weight: ${De("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${Z.radiusSm}; }
|
|
821
|
+
:host([size='sm']) a { ${qe("xl")} } :host([size='md']) a { ${qe("2xl")} } :host([size='lg']) a { ${qe("3xl")} }
|
|
822
|
+
img { display: block; block-size: 32px; inline-size: auto; }
|
|
823
|
+
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${qe("xl")} } }
|
|
824
|
+
`]}render(){return T`<a href=${this.href||"/"} part="link">${this.src?T`<img src=${this.src} alt=${this.alt||this.text||this.textContent?.trim()||""} />`:T`<slot>${this.text}</slot>`}</a>`}},Ct=class extends Ce{static{this.properties={brand:{type:String},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.log=[],this.columns=[],this.columnsOnPhone="shown",this.legal="",this.stripe=!1,this.headingLevel=2}static{this.styles=[...Ce.styles,Zt,Kt`
|
|
825
|
+
/* 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: ${R(8)} ${R(4)}; margin-block-end: calc(-1 * ${R(8)}); }
|
|
827
|
+
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${R(10)}; }
|
|
828
|
+
.brand { margin: 0; font-family: ${Z.fontHeading}; font-weight: ${De("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
|
|
829
|
+
ul { list-style: none; margin: 0; padding: 0; }
|
|
830
|
+
.log { margin-block-start: ${R(8)}; display: grid; gap: ${R(3)}; font-family: ${Be}; font-size: ${Ee("sm")}; }
|
|
831
|
+
.log li { display: flex; align-items: center; gap: ${R(3)}; opacity: 0.72; }
|
|
832
|
+
.log li:first-child { opacity: 1; }
|
|
833
|
+
.log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
|
|
834
|
+
.log .code { margin-inline-end: ${R(3)}; }
|
|
835
|
+
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${R(8)}; }
|
|
836
|
+
.h { margin: 0 0 ${R(4)}; font-family: ${Be}; font-size: ${Ee("xs")}; font-weight: ${De("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
|
|
837
|
+
.columns ul { display: grid; gap: ${R(3)}; }
|
|
838
|
+
a { color: inherit; text-decoration: none; font-weight: ${De("medium")}; border-radius: ${Z.radiusSm}; }
|
|
839
|
+
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
840
|
+
.legal { margin: ${R(16)} 0 0; font-family: ${Be}; font-size: ${Ee("xs")}; opacity: 0.72; }
|
|
841
|
+
.stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
|
|
842
|
+
.stripe span { flex: 1; }
|
|
843
|
+
@container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
844
|
+
@container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
|
|
845
|
+
@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?T`<h3 class="h">${t}</h3>`:e===4?T`<h4 class="h">${t}</h4>`:T`<h2 class="h">${t}</h2>`}render(){let t=this.log??[];return T`<div part="footer">
|
|
847
|
+
<div class="top">
|
|
848
|
+
<div>
|
|
849
|
+
${this.brand?T`<p class="brand" part="brand">${this.brand}</p>`:X}
|
|
850
|
+
${t.length?T`<ul class="log" part="log">${t.map((e,i)=>T`<li style=${`--tone:${Qt(e.tone??(i===0?"success":"accent"),i)}`}><span class="dot" aria-hidden="true"></span><span>${e.meta?T`<span class="code">${e.meta}</span>`:X}${e.text}</span></li>`)}</ul>`:X}
|
|
851
|
+
</div>
|
|
852
|
+
<div class="columns" part="columns" style=${`--count:${Math.max(1,(this.columns??[]).length)}`}>
|
|
853
|
+
${(this.columns??[]).map(e=>T`<div>${this.heading(e.heading)}<ul>${(e.links??[]).map(i=>T`<li><a href=${i.href}>${i.label}</a></li>`)}</ul></div>`)}
|
|
854
|
+
</div>
|
|
855
|
+
</div>
|
|
856
|
+
${this.legal?T`<p class="legal" part="legal">${this.legal}</p>`:X}
|
|
857
|
+
${this.stripe?T`<div class="stripe" aria-hidden="true">${ta.map(e=>T`<span style=${`background:${Qt(void 0,e)}`}></span>`)}</div>`:X}
|
|
858
|
+
</div>`}};customElements.define("impakt-site-header",Et);customElements.define("impakt-wordmark",Bt);customElements.define("impakt-site-footer",Ct);import{html as Ie,css as ia,nothing as Jt}from"./atomic-ui.js";import{say as Ei,ImpaktElement as Bi,fontSize as aa,fontWeight as ra,space as ge,t as ei,token as It}from"./atomic-ui.js";var Rt=o=>Math.min(1,Math.max(0,o)),Ht=class extends Bi{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=Rt(-i.top/Math.max(1,i.height-a))}else if(this.drive==="page"){let i=document.documentElement;this.progress=Rt(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=[...Bi.styles,ia`
|
|
859
|
+
:host {
|
|
860
|
+
display: block;
|
|
861
|
+
position: relative;
|
|
862
|
+
}
|
|
863
|
+
:host([drive='view'][layout='stage']) {
|
|
864
|
+
min-height: calc(var(--impakt-scene-length, 3) * 100svh);
|
|
865
|
+
}
|
|
866
|
+
.frame {
|
|
867
|
+
display: grid;
|
|
868
|
+
grid-template-columns: minmax(0, 1fr);
|
|
869
|
+
}
|
|
870
|
+
:host([layout='split']) .frame {
|
|
871
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
872
|
+
gap: ${ge(8)};
|
|
873
|
+
}
|
|
874
|
+
.stage {
|
|
875
|
+
position: sticky;
|
|
876
|
+
top: 0;
|
|
877
|
+
height: 100svh;
|
|
878
|
+
display: grid;
|
|
879
|
+
place-items: center;
|
|
880
|
+
overflow: clip;
|
|
881
|
+
}
|
|
882
|
+
/* What is on the stage is layered, as in a motion tool: each thing sits
|
|
883
|
+
over the one before, so a later layer's timeline can reveal it over an
|
|
884
|
+
earlier one. */
|
|
885
|
+
.stage ::slotted(*) {
|
|
886
|
+
grid-area: 1 / 1;
|
|
887
|
+
max-width: 100%;
|
|
888
|
+
}
|
|
889
|
+
:host([drive='loop']) .stage,
|
|
890
|
+
:host([drive='scrubber']) .stage {
|
|
891
|
+
position: relative;
|
|
892
|
+
height: auto;
|
|
893
|
+
min-height: 60svh;
|
|
894
|
+
}
|
|
895
|
+
.controls {
|
|
896
|
+
display: flex;
|
|
897
|
+
gap: ${ge(3)};
|
|
898
|
+
align-items: center;
|
|
899
|
+
justify-content: center;
|
|
900
|
+
padding-block: ${ge(3)};
|
|
901
|
+
}
|
|
902
|
+
:host([bleed]) { margin-inline: calc(50% - 50vw); }
|
|
903
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
904
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
905
|
+
/* Over the stage, the controls float at its foot, above the layers and clear of its edges. */
|
|
906
|
+
.stage > .controls { position: absolute; inset-inline: ${ge(6)}; inset-block-end: ${ge(6)}; z-index: 2; padding: 0; }
|
|
907
|
+
.stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impakt-color-surface-card, #fff); }
|
|
908
|
+
/* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */
|
|
909
|
+
.controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }
|
|
910
|
+
.pause {
|
|
911
|
+
min-width: ${It("target.min","24px")};
|
|
912
|
+
min-height: ${It("target.min","24px")};
|
|
913
|
+
padding: ${ge(2)} ${ge(4)};
|
|
914
|
+
border-radius: ${It("radius.full","9999px")};
|
|
915
|
+
border: 1px solid ${ei.border};
|
|
916
|
+
background: ${ei.surfaceCard};
|
|
917
|
+
color: ${ei.text};
|
|
918
|
+
font-size: ${aa("sm")};
|
|
919
|
+
font-weight: ${ra("medium")};
|
|
920
|
+
cursor: pointer;
|
|
921
|
+
}
|
|
922
|
+
.pause:focus-visible {
|
|
923
|
+
outline: none;
|
|
924
|
+
box-shadow: ${It("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
925
|
+
}
|
|
926
|
+
@media (max-width: 48rem) {
|
|
927
|
+
:host([layout='split']) .frame {
|
|
928
|
+
grid-template-columns: minmax(0, 1fr);
|
|
929
|
+
}
|
|
930
|
+
:host([layout='split']) .stage {
|
|
931
|
+
height: 50svh;
|
|
932
|
+
z-index: 1;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
@media (prefers-reduced-motion: reduce) {
|
|
936
|
+
:host {
|
|
937
|
+
min-height: 0 !important;
|
|
938
|
+
}
|
|
939
|
+
.stage {
|
|
940
|
+
position: relative;
|
|
941
|
+
height: auto;
|
|
942
|
+
gap: ${ge(6)};
|
|
943
|
+
}
|
|
944
|
+
/* With less motion the layers are shown one after another, so every
|
|
945
|
+
state the scene would have moved through can still be seen. */
|
|
946
|
+
.stage ::slotted(*) {
|
|
947
|
+
grid-area: auto;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
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=Rt(e);return}this.seekFrom=this.progress,this.seekTo=Rt(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=Ie`<div class="controls" part="controls">
|
|
951
|
+
<slot name="controls"></slot>
|
|
952
|
+
${e&&!this.reduced?Ie`<button class="pause" type="button" aria-pressed=${this.paused?"true":"false"} @click=${this.togglePause}>
|
|
953
|
+
${this.paused?Ei("Play {name}",{name:this.label}):Ei("Pause {name}",{name:this.label})}
|
|
954
|
+
</button>`:Jt}
|
|
955
|
+
</div>`,s=Ie`<div class="stage" part="stage"><slot name="stage"></slot>${i?a:Jt}</div>`;return Ie`
|
|
956
|
+
<div class="frame" part="frame" role="region" aria-label=${this.label}>
|
|
957
|
+
${this.layout==="split"?Ie`<div class="content" part="content"><slot></slot></div>${s}`:Ie`${s}<div class="content" part="content"><slot></slot></div>`}
|
|
958
|
+
</div>
|
|
959
|
+
${i?Jt:a}
|
|
960
|
+
`}};customElements.define("impakt-scene",Ht);import{html as ne,css as sa}from"./atomic-ui.js";import{say as Ci,ImpaktElement as Ii,visuallyHidden as na,fontSize as ti,fontWeight as Ri,space as V,t as H,token as ce}from"./atomic-ui.js";var ii={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)"},Pt=class extends Ii{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=[...Ii.styles,sa`
|
|
961
|
+
:host {
|
|
962
|
+
display: block;
|
|
963
|
+
width: 100%;
|
|
964
|
+
max-width: 48rem;
|
|
965
|
+
margin-inline: auto;
|
|
966
|
+
}
|
|
967
|
+
.wrap {
|
|
968
|
+
display: grid;
|
|
969
|
+
gap: ${V(2)};
|
|
970
|
+
padding: ${V(3)} ${V(4)};
|
|
971
|
+
border-radius: ${ce("radius.xl","16px")};
|
|
972
|
+
background: ${H.surfaceCard};
|
|
973
|
+
box-shadow: ${ce("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")};
|
|
974
|
+
border: 1px solid ${H.border};
|
|
975
|
+
}
|
|
976
|
+
input {
|
|
977
|
+
width: 100%;
|
|
978
|
+
min-height: ${ce("target.min","24px")};
|
|
979
|
+
accent-color: ${H.brand};
|
|
980
|
+
margin: 0;
|
|
981
|
+
}
|
|
982
|
+
.stops {
|
|
983
|
+
position: relative;
|
|
984
|
+
display: flex;
|
|
985
|
+
flex-wrap: wrap;
|
|
986
|
+
gap: ${V(2)};
|
|
987
|
+
list-style: none;
|
|
988
|
+
margin: 0;
|
|
989
|
+
padding: 0;
|
|
990
|
+
}
|
|
991
|
+
button {
|
|
992
|
+
min-height: ${ce("target.min","24px")};
|
|
993
|
+
padding: ${V(1)} ${V(3)};
|
|
994
|
+
border-radius: ${ce("radius.full","9999px")};
|
|
995
|
+
border: 1px solid ${H.border};
|
|
996
|
+
background: transparent;
|
|
997
|
+
color: ${H.textMuted};
|
|
998
|
+
font-size: ${ti("xs")};
|
|
999
|
+
font-weight: ${Ri("medium")};
|
|
1000
|
+
cursor: pointer;
|
|
1001
|
+
}
|
|
1002
|
+
button[aria-current='true'] {
|
|
1003
|
+
color: ${H.text};
|
|
1004
|
+
border-color: ${H.text};
|
|
1005
|
+
}
|
|
1006
|
+
.sr-only {
|
|
1007
|
+
${na}
|
|
1008
|
+
}
|
|
1009
|
+
/* The graph look: the code of where you are, the line of stops, where you are. */
|
|
1010
|
+
:host([look='graph']) { max-width: none; }
|
|
1011
|
+
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${V(6)}; align-items: center; padding: ${V(4)} ${V(6)}; border-radius: ${ce("radius.xl","16px")}; background: ${H.surfaceCard}; box-shadow: ${ce("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${H.border}; }
|
|
1012
|
+
.mono { font-family: ${H.fontMono}; font-size: ${ti("xs")}; letter-spacing: 0.04em; }
|
|
1013
|
+
.head { display: grid; gap: 2px; }
|
|
1014
|
+
.head .k { color: ${H.textMuted}; text-transform: uppercase; }
|
|
1015
|
+
.head .code { font-size: ${ti("md")}; color: ${H.text}; }
|
|
1016
|
+
.head .note { color: ${H.textMuted}; }
|
|
1017
|
+
.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: ${H.border}; opacity: 0.5; }
|
|
1019
|
+
.fill { opacity: 1; background: none; display: flex; overflow: hidden; }
|
|
1020
|
+
.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: ${H.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
|
|
1022
|
+
.dot[data-passed] { background: var(--c); }
|
|
1023
|
+
.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: ${H.textMuted}; text-transform: uppercase; pointer-events: none; }
|
|
1025
|
+
.dot-label[data-current] { color: ${H.text}; font-weight: ${Ri("bold")}; }
|
|
1026
|
+
.line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
|
|
1027
|
+
.line input:focus-visible { opacity: 1; }
|
|
1028
|
+
.where { display: grid; gap: ${V(2)}; justify-items: end; }
|
|
1029
|
+
.chip { display: inline-flex; align-items: center; gap: ${V(2)}; padding: ${V(1)} ${V(3)}; border-radius: ${ce("radius.full","9999px")}; border: 1px solid ${H.border}; color: ${H.text}; text-transform: uppercase; }
|
|
1030
|
+
.chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
|
|
1031
|
+
.hint { color: ${H.textMuted}; text-transform: uppercase; }
|
|
1032
|
+
/* Muted by colour, not opacity, so the code keeps its contrast (1.4.3). */
|
|
1033
|
+
.chip .meta { color: ${H.textMuted}; }
|
|
1034
|
+
@media (max-width: 48rem) {
|
|
1035
|
+
.graph { grid-template-columns: minmax(0, 1fr); }
|
|
1036
|
+
.where { justify-items: start; }
|
|
1037
|
+
.dot-label:not([data-current]) { display: none; }
|
|
1038
|
+
}
|
|
1039
|
+
button:focus-visible,
|
|
1040
|
+
input:focus-visible {
|
|
1041
|
+
outline: none;
|
|
1042
|
+
box-shadow: ${ce("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1043
|
+
}
|
|
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,s)=>{let n=Math.abs(a.at-this.value);n<i&&(i=n,e=s)}),e}renderGraph(e,i){let a=e,s=[...this.stops??[]].sort((x,u)=>x.at-u.at);a=s.indexOf(this.stops[a]);let n=x=>{let u=x?.tone??"brand";return typeof u=="number"?`var(--impakt-color-chart-${u}, ${ii.brand})`:ii[u]??ii.brand},l=s[a]??s[0],y=s.map((x,u)=>{let be=u===0?0:s[u-1].at,de=Math.min(x.at,this.value);return{width:Math.round(Math.max(0,de-be)*1e4)/100,c:n(x)}});return ne`<div class="graph" part="wrap">
|
|
1045
|
+
<div class="head mono" aria-hidden="true">
|
|
1046
|
+
<span class="k">HEAD</span>
|
|
1047
|
+
<span class="code">${l?.meta??l?.label??""}</span>
|
|
1048
|
+
${l?.note?ne`<span class="note">${l.note}</span>`:null}
|
|
1049
|
+
</div>
|
|
1050
|
+
<div class="line">
|
|
1051
|
+
<div class="track"></div>
|
|
1052
|
+
<div class="fill" aria-hidden="true">${y.map(x=>ne`<span style=${`width:${x.width}%;background:${x.c}`}></span>`)}</div>
|
|
1053
|
+
${s.map((x,u)=>ne`
|
|
1054
|
+
<button type="button" class="dot" style=${`left:${x.at*100}%;--c:${n(x)}`} ?data-passed=${x.at<=this.value+1e-4} aria-current=${u===a?"true":"false"} @click=${()=>this.goTo(x)}>
|
|
1055
|
+
<span class="sr-only">${Ci("Go to {name}",{name:x.label})}</span>
|
|
1056
|
+
</button>
|
|
1057
|
+
<span class="dot-label mono" style=${`left:${x.at*100}%`} ?data-current=${u===a} aria-hidden="true">${x.label}</span>`)}
|
|
1058
|
+
<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
|
+
</div>
|
|
1060
|
+
<div class="where" aria-hidden="true">
|
|
1061
|
+
${l?ne`<span class="chip mono" style=${`--c:${n(l)}`}>${l.label}${l.meta?ne` <span class="meta">${l.meta}</span>`:null}</span>`:null}
|
|
1062
|
+
${this.hint?ne`<span class="hint mono">${this.hint}</span>`:null}
|
|
1063
|
+
</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):ne`
|
|
1065
|
+
<div class="wrap" part="wrap">
|
|
1066
|
+
<input
|
|
1067
|
+
type="range"
|
|
1068
|
+
min="0"
|
|
1069
|
+
max="1000"
|
|
1070
|
+
step="1"
|
|
1071
|
+
.value=${String(Math.round(this.value*1e3))}
|
|
1072
|
+
aria-label=${this.label}
|
|
1073
|
+
aria-valuetext=${i}
|
|
1074
|
+
@input=${this.onInput}
|
|
1075
|
+
/>
|
|
1076
|
+
${this.stops.length?ne`<ul class="stops" part="stops">
|
|
1077
|
+
${this.stops.map((a,s)=>ne`<li>
|
|
1078
|
+
<button type="button" aria-current=${s===e?"true":"false"} @click=${()=>this.goTo(a)}>
|
|
1079
|
+
<span aria-hidden="true">${a.label}</span><span class="sr-only">${Ci("Go to {name}",{name:a.label})}</span>
|
|
1080
|
+
</button>
|
|
1081
|
+
</li>`)}
|
|
1082
|
+
</ul>`:null}
|
|
1083
|
+
</div>
|
|
1084
|
+
`}};customElements.define("impakt-scrubber",Pt);import{css as ze,html as v,nothing as te,svg as Ue}from"./atomic-ui.js";import{say as J,ImpaktElement as oe,focusRing as oa,visuallyHidden as la,fontSize as Re,fontWeight as si,space as A,spaceAround as Ye,t as B,type as ca,iconSvg as da,toneOf as ri,TONE as Hi}from"./atomic-ui.js";function ni(o,t){let e=()=>{o.setAttribute("shown",""),t?.()};if(typeof IntersectionObserver!="function")return e(),()=>{};let i=new IntersectionObserver(a=>{a.some(s=>s.isIntersecting)&&(e(),i.disconnect())},{threshold:.25});return i.observe(o),()=>i.disconnect()}var Pi=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,_t=ze`.mono { font-family: ${B.fontMono}; font-size: ${Re("xs")}; letter-spacing: 0.04em; }`,pa=(o,t,e)=>{switch(Math.min(Math.max(o||3,2),6)){case 2:return v`<h2 class=${e}>${t}</h2>`;case 4:return v`<h4 class=${e}>${t}</h4>`;case 5:return v`<h5 class=${e}>${t}</h5>`;case 6:return v`<h6 class=${e}>${t}</h6>`;default:return v`<h3 class=${e}>${t}</h3>`}},qt=ze`
|
|
1085
|
+
.h { margin: 0; color: var(--impakt-heading, ${B.textHeading}); font-family: ${B.fontHeading}; font-weight: ${si("bold")}; letter-spacing: ${B.trackingTight}; text-wrap: balance; }
|
|
1086
|
+
.body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
|
|
1087
|
+
.meta { margin: 0; color: inherit; opacity: 0.72; text-transform: uppercase; }
|
|
1088
|
+
.sr-only { ${la} }
|
|
1089
|
+
`,Nt=class extends oe{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=[...oe.styles,Ye,_t,qt,ze`
|
|
1090
|
+
:host { display: block; }
|
|
1091
|
+
article { display: flex; flex-direction: column; gap: ${A(3)}; }
|
|
1092
|
+
.media { border-radius: ${B.radiusXl}; overflow: clip; background: ${B.surfaceInset}; }
|
|
1093
|
+
.media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
|
|
1094
|
+
impakt-before-after { display: block; }
|
|
1095
|
+
.h { font-size: ${Re("3xl")}; }
|
|
1096
|
+
.h a { color: inherit; text-decoration: none; }
|
|
1097
|
+
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1098
|
+
.h a:focus-visible { outline: none; box-shadow: ${B.focusShadow}; border-radius: ${B.radiusSm}; }
|
|
1099
|
+
ul { list-style: none; margin: ${A(1)} 0 0; padding: 0; display: grid; gap: ${A(1)}; }
|
|
1100
|
+
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${A(2)}; padding: ${A(1)} ${A(3)}; border-radius: ${B.radius}; }
|
|
1101
|
+
li[data-change='added'] { background: ${B.successSubtle}; color: ${B.successText}; }
|
|
1102
|
+
li[data-change='removed'] { background: ${B.dangerSubtle}; color: ${B.dangerText}; }
|
|
1103
|
+
li[data-change='same'] { color: ${B.textMuted}; }
|
|
1104
|
+
.sign { font-weight: ${si("bold")}; }
|
|
1105
|
+
`]}wipe(e){let i=this.renderRoot.querySelector("impakt-before-after");if(!i)return;if(cancelAnimationFrame(this.raf),Pi()){i.position=e;return}let a=i.position??ai,s=performance.now(),n=y=>y<.5?4*y*y*y:1-Math.pow(-2*y+2,3)/2,l=y=>{let x=Math.min(1,(y-s)/450);i.position=a+(e-a)*n(x),x<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?v`<a href=${this.href}>${this.heading}</a>`:this.heading,a={added:"+",removed:"\u2212",same:" "},s={added:J("Added"),removed:J("Removed"),same:J("Kept")};return v`<article part="card">
|
|
1106
|
+
${e?v`<div class="media" @pointerenter=${n=>n.pointerType==="mouse"&&this.wipe(0)} @pointerleave=${n=>n.pointerType==="mouse"&&this.wipe(ai)}><impakt-before-after .position=${ai} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${J("Before")} .afterLabel=${J("Shipped")} .label=${J("Compare {name} before and after",{name:this.heading})}></impakt-before-after></div>`:this.afterSrc||this.beforeSrc?v`<div class="media"><img src=${this.afterSrc||this.beforeSrc} alt=${this.afterSrc?this.afterAlt:this.beforeAlt} loading="lazy" /></div>`:te}
|
|
1107
|
+
${this.label?v`<p class="meta mono">${this.label}</p>`:te}
|
|
1108
|
+
${this.heading?ha(this.headingLevel,i):te}
|
|
1109
|
+
${this.text?v`<p class="body">${this.text}</p>`:te}
|
|
1110
|
+
${(this.items??[]).length?v`<ul class="mono" part="diff">${this.items.map(n=>v`<li data-change=${n.change}><span class="sign" aria-hidden="true">${a[n.change]??" "}</span><span><span class="sr-only">${s[n.change]??""}: </span>${n.text}</span></li>`)}</ul>`:te}
|
|
1111
|
+
</article>`}},jt=class extends oe{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=[...oe.styles,Ye,ze`
|
|
1112
|
+
: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: ${A(12)} ${A(10)}; }
|
|
1114
|
+
:host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
|
|
1115
|
+
:host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1116
|
+
@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 v`<ul part="list">${e.map(i=>{let a=i.heading??i.title??"";return v`<li><impakt-release-card
|
|
1118
|
+
.label=${i.label??""} .heading=${a} .text=${i.text??""} .href=${i.href??""}
|
|
1119
|
+
.beforeSrc=${i.beforeSrc??""} .beforeAlt=${i.beforeAlt||J("{name} as a wireframe",{name:a})}
|
|
1120
|
+
.afterSrc=${i.afterSrc??""} .afterAlt=${i.afterAlt||J("{name} as it shipped",{name:a})}
|
|
1121
|
+
.items=${i.items??[]} .headingLevel=${this.headingLevel}></impakt-release-card></li>`})}</ul>`}},ai=42;function ha(o,t){let e=Math.min(Math.max(o||3,2),6);return e===2?v`<h2 class="h">${t}</h2>`:e===4?v`<h4 class="h">${t}</h4>`:e===5?v`<h5 class="h">${t}</h5>`:e===6?v`<h6 class="h">${t}</h6>`:v`<h3 class="h">${t}</h3>`}var Ot=class extends oe{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=[...oe.styles,Ye,_t,qt,ze`
|
|
1122
|
+
:host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
|
|
1123
|
+
ul { list-style: none; margin: 0; padding: 0; position: relative; }
|
|
1124
|
+
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: ${A(6)}; }
|
|
1126
|
+
.graph { position: relative; }
|
|
1127
|
+
.graph svg { position: absolute; inset-block-start: -${A(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${A(12)}); overflow: visible; }
|
|
1128
|
+
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${A(4)} ${A(10)}; align-items: start; }
|
|
1129
|
+
.path { margin: 0 0 ${A(2)}; opacity: 0.72; }
|
|
1130
|
+
.h { font-size: ${Re("3xl")}; line-height: 1.05; }
|
|
1131
|
+
.h a { color: inherit; text-decoration: none; }
|
|
1132
|
+
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1133
|
+
.h a:focus-visible { outline: none; box-shadow: ${B.focusShadow}; border-radius: ${B.radiusSm}; }
|
|
1134
|
+
.detail { display: flex; flex-direction: column; gap: ${A(3)}; padding-block-start: ${A(1)}; }
|
|
1135
|
+
.tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
|
|
1136
|
+
.end { position: relative; display: flex; align-items: center; gap: ${A(3)}; padding-block-start: ${A(4)}; }
|
|
1137
|
+
.end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
|
|
1138
|
+
@container (max-width: 44rem) {
|
|
1139
|
+
li { grid-template-columns: 56px minmax(0, 1fr); }
|
|
1140
|
+
.graph svg { inline-size: 56px; }
|
|
1141
|
+
.row { grid-template-columns: minmax(0, 1fr); }
|
|
1142
|
+
.h { font-size: ${Re("2xl")}; }
|
|
1143
|
+
}
|
|
1144
|
+
/* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
|
|
1145
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1146
|
+
.graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
|
|
1147
|
+
.graph circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
|
|
1148
|
+
:host([shown]) .graph svg { clip-path: inset(0); }
|
|
1149
|
+
:host([shown]) .graph circle { transform: scale(1); }
|
|
1150
|
+
}
|
|
1151
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=ni(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let e=i=>Ue`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
1152
|
+
<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
|
+
<circle cx="60" cy="86" r="8" fill=${i} />
|
|
1154
|
+
</svg>`;return v`<ul part="list">${(this.items??[]).map((i,a)=>v`<li part="item" style=${`--i:${a}`}>
|
|
1155
|
+
<div class="graph">${e(ri(i.tone,a))}</div>
|
|
1156
|
+
<div>
|
|
1157
|
+
${i.path?v`<p class="path mono">${i.path}</p>`:te}
|
|
1158
|
+
<div class="row">
|
|
1159
|
+
${pa(this.headingLevel,i.href?v`<a href=${i.href}>${i.heading}</a>`:i.heading,"h")}
|
|
1160
|
+
<div class="detail">
|
|
1161
|
+
${i.text?v`<p class="body">${i.text}</p>`:te}
|
|
1162
|
+
${i.tags?.length?v`<p class="tags mono">${i.tags.join(" \xB7 ")}</p>`:te}
|
|
1163
|
+
</div>
|
|
1164
|
+
</div>
|
|
1165
|
+
</div>
|
|
1166
|
+
</li>`)}</ul>
|
|
1167
|
+
${this.trunk?v`<p class="end mono" part="trunk">${this.trunk}</p>`:te}`}},Ft=class extends oe{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=[...oe.styles,Ye,_t,qt,ze`
|
|
1168
|
+
:host { display: block; container-type: inline-size; }
|
|
1169
|
+
.summary { display: inline-flex; align-items: center; gap: ${A(2)}; margin: 0 0 ${A(6)}; padding: ${A(1)} ${A(3)}; border-radius: ${B.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
|
|
1170
|
+
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${B.success}; }
|
|
1171
|
+
/* 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: ${A(6)}; }
|
|
1173
|
+
li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${A(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
|
|
1174
|
+
/* Checks run: each tick pops in, 150 ms after the one above. */
|
|
1175
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1176
|
+
.tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
|
|
1177
|
+
:host([shown]) .tick { transform: scale(1); }
|
|
1178
|
+
}
|
|
1179
|
+
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1180
|
+
/* 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: ${B.success}; color: var(--impakt-color-status-success-on, #fff); }
|
|
1182
|
+
.figure { margin: 0; font-family: ${B.fontHeading}; font-weight: ${si("bold")}; font-size: ${Re("5xl")}; line-height: 1; letter-spacing: ${B.trackingTight}; white-space: nowrap; }
|
|
1183
|
+
.label { margin: 0; ${ca("xl")} }
|
|
1184
|
+
.status { margin: 0; opacity: 0.72; }
|
|
1185
|
+
@container (max-width: 40rem) {
|
|
1186
|
+
ul { grid-template-columns: 28px minmax(0, 1fr); }
|
|
1187
|
+
li { row-gap: ${A(1)}; }
|
|
1188
|
+
.label, .status { grid-column: 2; }
|
|
1189
|
+
.figure { font-size: ${Re("4xl")}; }
|
|
1190
|
+
}
|
|
1191
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=ni(this,()=>this.run())}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}run(){if(Pi())return;let e=this.items??[],i=performance.now(),a=s=>{this.counted=e.map((n,l)=>Math.min(1,Math.max(0,(s-i-l*150)/1200))),this.requestUpdate(),this.counted.some(n=>n<1)?requestAnimationFrame(a):this.counted=null};requestAnimationFrame(a)}render(){let e=(i,a)=>{let s=this.counted?.[a],n=/^(\d+)(.*)$/.exec(i);if(s===void 0||s>=1||!n)return v`${i}`;let l=1-Math.pow(1-s,3);return v`<span aria-hidden="true">${Math.round(Number(n[1])*l)}${n[2]}</span><span class="sr-only">${i}</span>`};return v`${this.summary?v`<p class="summary mono" part="summary">${this.summary}</p>`:te}
|
|
1192
|
+
<ul part="list">${(this.items??[]).map((i,a)=>v`<li part="item" style=${`--i:${a}`}>
|
|
1193
|
+
<span class="tick" aria-hidden="true">${da("check","16px")}</span>
|
|
1194
|
+
<p class="figure">${e(i.figure,a)}</p>
|
|
1195
|
+
<p class="label">${i.label}</p>
|
|
1196
|
+
${i.status?v`<p class="status mono">${i.status}</p>`:v`<span></span>`}
|
|
1197
|
+
</li>`)}</ul>`}},Wt=class extends oe{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=[...oe.styles,oa,Ye,_t,qt,ze`
|
|
1198
|
+
:host { display: block; }
|
|
1199
|
+
/* 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: ${B.radiusSm}; }
|
|
1201
|
+
svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
|
|
1202
|
+
text { font-family: ${B.fontMono}; font-size: 12px; fill: currentColor; }
|
|
1203
|
+
.faint { opacity: 0.5; }
|
|
1204
|
+
/* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
|
|
1205
|
+
.halo { paint-order: stroke; stroke: var(--impakt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
|
|
1206
|
+
/* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
|
|
1207
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1208
|
+
svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
|
|
1209
|
+
:host([shown]) svg { clip-path: inset(0 -40px 0 0); }
|
|
1210
|
+
}
|
|
1211
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=ni(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let s=this.span>0?this.span:20,n=S=>24+Math.min(Math.max(S,0),s)/s*1116,l=this.lanes??[],y=52,x=40+(l.length+1)*y+40,u=40,be=S=>u+(S+1)*y,de=[];for(let S=0;S<=s;S+=Math.max(1,this.every||2))de.push(S);let Ge=S=>l.findIndex(q=>S>=q.from&&S<=q.to),Ni=S=>(this.marks??[]).some(q=>Ge(q.at)===S),Dt=this.unit||J("wk"),ji=this.label||J("Project timeline"),Oi=l.map(S=>`${S.label}: ${J("{unit} {from} to {to}",{unit:Dt,from:S.from,to:S.to})}`).join("; ");return v`<figure part="figure" tabindex="0">
|
|
1212
|
+
<svg viewBox="0 0 ${1200} ${x}" role="img" aria-label=${`${ji}. ${Oi}${this.release?`. ${J("{name} at {unit} {at}",{name:this.release,unit:Dt,at:this.releaseAt})}`:""}`}>
|
|
1213
|
+
<line x1=${24} y1=${u} x2=${1180} y2=${u} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
1214
|
+
<path d="M${1168} ${u-7} L${1180} ${u} L${1168} ${u+7}" fill="none" stroke="currentColor" stroke-width="3" />
|
|
1215
|
+
${l.map((S,q)=>{let Te=ri(S.tone,q),ie=be(q),fe=n(S.from),He=n(S.to),Pe=Math.min(36,(He-fe)/3);return Ue`<g>
|
|
1216
|
+
<path d="M${fe} ${u} C${fe} ${(u+ie)/2} ${fe+Pe} ${ie} ${fe+Pe*1.6} ${ie} L${He-Pe*1.6} ${ie} C${He-Pe} ${ie} ${He} ${(u+ie)/2} ${He} ${u}" fill="none" stroke=${Te} stroke-width="3" />
|
|
1217
|
+
<circle cx=${fe} cy=${u} r="7" fill=${Te} />
|
|
1218
|
+
<text x=${fe+Pe*1.6} y=${Ni(q)?ie-10:ie+20} class="halo" style=${`fill:${Te}`}>${S.label}</text>
|
|
1219
|
+
</g>`})}
|
|
1220
|
+
${(this.marks??[]).map(S=>{let q=Ge(S.at),Te=q>=0?be(q):u,ie=q>=0?ri(l[q].tone,q):"currentColor";return Ue`<g><circle cx=${n(S.at)} cy=${Te} r="6" fill="var(--impakt-color-surface-card, #fff)" stroke=${ie} stroke-width="3" /><text x=${n(S.at)} y=${Te+22} text-anchor="middle" class="faint">${S.label}</text></g>`})}
|
|
1221
|
+
${this.release?Ue`<g>
|
|
1222
|
+
<circle cx=${n(this.releaseAt)} cy=${u} r="10" fill=${Hi.success} />
|
|
1223
|
+
<rect x=${n(this.releaseAt)-8} y=${u-36} rx="4" width=${this.release.length*7.6+16} height="22" fill=${Hi.success} />
|
|
1224
|
+
<text x=${n(this.releaseAt)} y=${u-21} style="fill:var(--impakt-color-surface-card, #fff)">${this.release}</text>
|
|
1225
|
+
</g>`:te}
|
|
1226
|
+
${de.map(S=>Ue`<text x=${n(S)} y=${x-10} text-anchor="middle" class="faint">${Dt} ${S}</text>`)}
|
|
1227
|
+
</svg>
|
|
1228
|
+
</figure>`}};customElements.define("impakt-release-card",Nt);customElements.define("impakt-release-list",jt);customElements.define("impakt-branch-list",Ot);customElements.define("impakt-check-list",Ft);customElements.define("impakt-branch-timeline",Wt);export{zt as ImpaktAffordabilityCalculator,et as ImpaktAnnouncement,ft as ImpaktBeforeAfter,Ot as ImpaktBranchList,Wt as ImpaktBranchTimeline,rt as ImpaktCardGrid,st as ImpaktCarousel,Ft as ImpaktCheckList,Fe as ImpaktContactBlock,dt as ImpaktCtaBanner,Mt as ImpaktEstimator,Ke as ImpaktFeatureList,nt as ImpaktGallery,Qe as ImpaktHero,yt as ImpaktLocationCard,ot as ImpaktLogoCloud,ct as ImpaktMediaSplit,bt as ImpaktMortgageCalculator,ht as ImpaktNewsletter,wt as ImpaktPlanComparison,Ze as ImpaktQuote,kt as ImpaktRegulatoryNotice,Nt as ImpaktReleaseCard,jt as ImpaktReleaseList,pt as ImpaktReviews,Ht as ImpaktScene,Pt as ImpaktScrubber,tt as ImpaktSearchBar,Ct as ImpaktSiteFooter,Et as ImpaktSiteHeader,gt as ImpaktSitePlan,St as ImpaktStampDutyCalculator,Je as ImpaktStat,lt as ImpaktSteps,$t as ImpaktStickyBar,Oe as ImpaktVideo,Bt as ImpaktWordmark,ue as SDLT,xi as embedOf,Lt as estimate,gi as gallerySpan,fi as monthlyPayment,Mi as phaseWeeks,vi as stampDuty};
|
|
1229
|
+
//# sourceMappingURL=atomic-ui-blocks.js.map
|