@atomic-ui/blocks 0.9.0 → 0.10.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/dist/{chunk-CPOCQURG.js → chunk-LJ6AQO26.js} +8 -1
- package/dist/chunk-LJ6AQO26.js.map +1 -0
- package/dist/components/site.js +1 -1
- package/dist/index.js +1 -1
- package/dist/standalone/atomic-ui-blocks.js +66 -59
- package/dist/standalone/atomic-ui-blocks.js.map +2 -2
- package/package.json +10 -7
- package/dist/chunk-CPOCQURG.js.map +0 -1
|
@@ -62,6 +62,13 @@ var ImpaktSiteHeader = class extends ImpaktElement {
|
|
|
62
62
|
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
63
63
|
.status .hash { opacity: 0.72; }
|
|
64
64
|
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }
|
|
65
|
+
/* With no script the links cannot fold behind a Menu button. On a narrow screen they take a
|
|
66
|
+
line of their own under the name and the action, and wrap there. */
|
|
67
|
+
@container (max-width: 40rem) {
|
|
68
|
+
:host(:not(:defined)) .bar { flex-wrap: wrap; row-gap: ${space(1)}; }
|
|
69
|
+
:host(:not(:defined)) .start { flex: 1 1 auto; }
|
|
70
|
+
:host(:not(:defined)) .middle { order: 3; flex: 1 1 100%; justify-content: flex-start; }
|
|
71
|
+
}
|
|
65
72
|
`
|
|
66
73
|
];
|
|
67
74
|
}
|
|
@@ -209,4 +216,4 @@ export {
|
|
|
209
216
|
ImpaktWordmark,
|
|
210
217
|
ImpaktSiteFooter
|
|
211
218
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
219
|
+
//# sourceMappingURL=chunk-LJ6AQO26.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/site.ts"],"sourcesContent":["/**\n * A site's own header and footer, drawn as one piece each, for the layout's\n * header and footer slots, and the wordmark that starts a header.\n *\n * The chip that sits beside a wordmark is a product component, `impakt-chip`,\n * and comes from `@atomic-ui/ui`.\n *\n * The page frame (`impakt-page`) gives them their landmarks, so neither draws a\n * `<header>` or `<footer>` of its own: a second banner would be one a screen\n * reader announces twice.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\n// The base, the tokens and the nav and button these draw come from @atomic-ui/ui, which defines its elements on import.\nimport { ImpaktElement, focusRing, hideOn, fontSize, fontWeight, space, t, type, toneOf, type NavLink, type Tone } from '@atomic-ui/ui';\n\n/** The footer stripe's colours, left to right. */\n/** The stripe's segments take the brand's chart colours in order. */\nconst STRIPE = [0, 1, 2, 3, 4];\n\n/** Code-like labels: a branch, a hash, a commit message. */\nconst MONO = t.fontMono;\n\n// Quieter words are faded to 0.72, no further: that keeps them at 4.5:1 on the page and card colours (1.4.3).\n\n/**\n * The site header: the brand, the main links and one call to action, with an\n * optional chip beside the brand and a status before the action.\n *\n * The links fold behind a Menu button when they do not fit, as `impakt-nav`\n * does. The chip and the status are labels, not controls, and they are left\n * out on a phone so the brand, the menu and the action keep the row.\n *\n * **Build your own.** Place components in its three slots, start, middle and\n * end, and each slot that holds something replaces what the props draw there:\n * a wordmark and chips at the start, a nav in the middle, a status and a\n * button at the end, in any order. Give a component `hideOn: 'phone'` to leave\n * it out on a phone, so the phone's header is built from the same pieces.\n *\n * @category layout\n * @icon header\n * @slot start - The brand: a wordmark or logo, and any chips beside it.\n * @slot middle - The links, usually one nav.\n * @slot end - A status and the call to action.\n * @fires {CustomEvent<null>} impakt-action - When the call to action is pressed.\n */\nexport class ImpaktSiteHeader extends ImpaktElement {\n static properties = {\n brand: { type: String },\n logoSrc: { type: String, attribute: 'logo-src' },\n logoAlt: { type: String, attribute: 'logo-alt' },\n home: { type: String },\n badge: { type: String },\n meta: { type: String },\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n status: { type: String },\n statusMeta: { type: String, attribute: 'status-meta' },\n statusTone: { type: String, attribute: 'status-tone' },\n actionText: { type: String, attribute: 'action-text' },\n actionHref: { type: String, attribute: 'action-href' },\n };\n /** The site's name, set as a wordmark when there is no logo picture. */\n declare brand: string;\n /** A logo picture, used instead of the wordmark. */\n declare logoSrc: string;\n /** What the logo says. Leave empty to use the brand name. */\n declare logoAlt: string;\n /** Where the brand links to. */\n declare home: string;\n /** A short chip beside the brand, such as \"main\". */\n declare badge: string;\n /** A code-like line after the chip, such as a commit hash. */\n declare meta: string;\n declare links: NavLink[];\n /** The name of the links' landmark. */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /** A status before the action, such as the stage the site is at. */\n declare status: string;\n /** A code-like line in the status, such as a hash. */\n declare statusMeta: string;\n declare statusTone: Tone;\n declare actionText: string;\n declare actionHref: string;\n\n constructor() {\n super();\n this.brand = '';\n this.logoSrc = '';\n this.logoAlt = '';\n this.home = '/';\n this.badge = '';\n this.meta = '';\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.status = '';\n this.statusMeta = '';\n this.statusTone = 'success';\n this.actionText = '';\n this.actionHref = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; container-type: inline-size; }\n .bar { display: flex; align-items: center; gap: ${space(6)}; }\n .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }\n .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }\n slot { display: contents; }\n .brand { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; ${type('2xl')} letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n .brand img { display: block; block-size: 32px; inline-size: auto; }\n .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize('xs')}; }\n .chip svg { inline-size: 12px; block-size: 12px; }\n .meta { font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .middle impakt-nav { flex: 1 1 8rem; }\n .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .end:empty, .start:empty { display: none; }\n .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: 999px; background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize('xs')}; white-space: nowrap; }\n .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }\n .status .hash { opacity: 0.72; }\n @container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }\n /* With no script the links cannot fold behind a Menu button. On a narrow screen they take a\n line of their own under the name and the action, and wrap there. */\n @container (max-width: 40rem) {\n :host(:not(:defined)) .bar { flex-wrap: wrap; row-gap: ${space(1)}; }\n :host(:not(:defined)) .start { flex: 1 1 auto; }\n :host(:not(:defined)) .middle { order: 3; flex: 1 1 100%; justify-content: flex-start; }\n }\n `,\n ];\n\n private act(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const wordmark = this.logoSrc ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />` : html`${this.brand}`;\n // Each region shows what is placed in its slot, or, when nothing is, what the props describe.\n return html`<div class=\"bar\" part=\"bar\">\n <div class=\"start\"><slot name=\"start\">\n ${this.brand || this.logoSrc ? html`<a class=\"brand\" href=${this.home || '/'} part=\"brand\">${wordmark}</a>` : nothing}\n ${this.badge ? html`<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>` : nothing}\n ${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}\n </slot></div>\n <div class=\"middle\"><slot name=\"middle\">${(this.links ?? []).length ? html`<impakt-nav align=\"center\" size=\"sm\" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impakt-nav>` : nothing}</slot></div>\n <div class=\"end\"><slot name=\"end\">\n ${this.status ? html`<span class=\"status\" part=\"status\" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class=\"dot\" aria-hidden=\"true\"></span>${this.status}${this.statusMeta ? html` <span class=\"hash\">${this.statusMeta}</span>` : nothing}</span>` : nothing}\n ${this.actionText ? html`<impakt-button variant=\"primary\" icon-after=\"arrow-right\" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impakt-button>` : nothing}\n </slot></div>\n </div>`;\n }\n}\n\n/**\n * The site's name as a wordmark, or its logo, linking home: the start of a\n * site header.\n *\n * @category layout\n * @icon logo\n */\nexport class ImpaktWordmark extends ImpaktElement {\n static properties = {\n text: { type: String },\n src: { type: String },\n alt: { type: String },\n href: { type: String },\n size: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n /** The name, set in the heading face. */\n declare text: string;\n /** A logo picture, used instead of the name. */\n declare src: string;\n /** What the logo says. Leave empty to use the name. */\n declare alt: string;\n declare href: string;\n /** Larger on a wide header, smaller on a phone's. */\n declare size: 'sm' | 'md' | 'lg';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.text = '';\n this.src = '';\n this.alt = '';\n this.href = '/';\n this.size = 'md';\n this.hideOn = 'never';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n hideOn,\n css`\n :host { display: inline-flex; align-items: center; flex: none; }\n a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n :host([size='sm']) a { ${type('xl')} } :host([size='md']) a { ${type('2xl')} } :host([size='lg']) a { ${type('3xl')} }\n img { display: block; block-size: 32px; inline-size: auto; }\n @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type('xl')} } }\n `,\n ];\n\n render(): TemplateResult {\n // The name arrives as the element's words when a page places it, or as `text` when it is set directly.\n return html`<a href=${this.href || '/'} part=\"link\">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ''} />` : html`<slot>${this.text}</slot>`}</a>`;\n }\n}\n\n/** One line of a footer's log: a code, what it says, and the colour of its dot. */\nexport interface FooterLogLine {\n meta?: string;\n text: string;\n tone?: Tone;\n}\n\n/** A column of footer links under a short heading. */\nexport interface FooterColumn {\n heading: string;\n links: NavLink[];\n}\n\n/**\n * The site footer: the footer band with the brand set large, an optional log of\n * lines beside it, columns of links, a legal line and a stripe of the brand's\n * colours along the foot.\n *\n * Each column is a list under its own heading, so a screen reader can move\n * from one to the next. The log is a list too; its dots are decoration.\n *\n * @category layout\n * @icon footer\n */\nexport class ImpaktSiteFooter extends ImpaktElement {\n static properties = {\n brand: { type: String },\n brandSize: { type: String, reflect: true, attribute: 'brand-size' },\n log: { type: Array },\n columns: { type: Array },\n columnsOnPhone: { type: String, attribute: 'columns-on-phone', reflect: true },\n legal: { type: String },\n stripe: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n };\n /** The site's name, set large. */\n declare brand: string;\n /**\n * How large the name is set. `display` runs it the full width of the footer,\n * under the columns, sized by the footer's own width so it never spills at\n * 320px.\n */\n declare brandSize: 'lg' | 'display';\n /** Lines set in code type under the brand, newest first. The first is bright. */\n declare log: FooterLogLine[];\n declare columns: FooterColumn[];\n /** `hidden` leaves the link columns out on a phone, so the footer there is the name, the lines and the legal line. */\n declare columnsOnPhone: 'shown' | 'hidden';\n /** The line at the foot, such as the copyright. */\n declare legal: string;\n /** A stripe of the brand's colours along the bottom edge. */\n declare stripe: boolean;\n /** The level of each column's heading. */\n declare headingLevel: 2 | 3 | 4;\n\n constructor() {\n super();\n this.brand = '';\n this.brandSize = 'lg';\n this.log = [];\n this.columns = [];\n this.columnsOnPhone = 'shown';\n this.legal = '';\n this.stripe = false;\n this.headingLevel = 2;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */\n :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }\n .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }\n .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }\n /* The name as a wordmark across the whole footer, under the columns. */\n :host([brand-size='display']) .top { grid-template-columns: 1fr; }\n :host([brand-size='display']) .top > div:first-child { order: 2; }\n :host([brand-size='display']) .brand { font-weight: ${fontWeight('semibold')}; font-size: clamp(3rem, 27cqi, 24rem); line-height: 0.9; letter-spacing: -0.06em; overflow-wrap: anywhere; }\n ul { list-style: none; margin: 0; padding: 0; }\n .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize('sm')}; }\n .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.72; }\n .log li:first-child { opacity: 1; }\n .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }\n .log .code { margin-inline-end: ${space(3)}; }\n .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }\n .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize('xs')}; font-weight: ${fontWeight('medium')}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }\n .columns ul { display: grid; gap: ${space(3)}; }\n a { color: inherit; text-decoration: none; font-weight: ${fontWeight('medium')}; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }\n .stripe span { flex: 1; }\n @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }\n @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }\n `,\n ];\n\n private heading(text: string): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);\n return level === 3 ? html`<h3 class=\"h\">${text}</h3>` : level === 4 ? html`<h4 class=\"h\">${text}</h4>` : html`<h2 class=\"h\">${text}</h2>`;\n }\n\n render(): TemplateResult {\n const log = this.log ?? [];\n return html`<div part=\"footer\">\n <div class=\"top\">\n <div>\n ${this.brand ? html`<p class=\"brand\" part=\"brand\">${this.brand}</p>` : nothing}\n ${log.length ? html`<ul class=\"log\" part=\"log\">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? 'success' : 'accent'), i)}`}><span class=\"dot\" aria-hidden=\"true\"></span><span>${line.meta ? html`<span class=\"code\">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}\n </div>\n <div class=\"columns\" part=\"columns\" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>\n ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}\n </div>\n </div>\n ${this.legal ? html`<p class=\"legal\" part=\"legal\">${this.legal}</p>` : nothing}\n ${this.stripe ? html`<div class=\"stripe\" aria-hidden=\"true\">${STRIPE.map((i) => html`<span style=${`background:${toneOf(undefined, i)}`}></span>`)}</div>` : nothing}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-site-header', ImpaktSiteHeader);\ncustomElements.define('impakt-wordmark', ImpaktWordmark);\ncustomElements.define('impakt-site-footer', ImpaktSiteFooter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-site-header': ImpaktSiteHeader;\n 'impakt-wordmark': ImpaktWordmark;\n 'impakt-site-footer': ImpaktSiteFooter;\n }\n}\n"],"mappings":";AAWA,SAAS,KAAK,MAAM,eAAoC;AAExD,SAAS,eAAe,WAAW,QAAQ,UAAU,YAAY,OAAO,GAAG,MAAM,cAAuC;AAIxH,IAAM,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAG7B,IAAM,OAAO,EAAE;AAyBR,IAAM,mBAAN,cAA+B,cAAc;AAAA,EAClD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,UAAU,EAAE,MAAM,QAAQ,WAAW,YAAY;AAAA,MACjD,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,IACvD;AAAA;AAAA,EA0BA,cAAc;AACZ,UAAM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Y,WAAW,CAAC,CAAC,EAAE,sDAAsD,KAAK,OAAO,0BAA0B,KAAK,IAAI,YAAY,OAAO,GAAG,KAAK,IAAI,cAAc,CAAC,UAAU,OAAO;AAAA;AAAA,oDAErR,WAAW,KAAK,IAAI,IAAI,KAAK,WAAW,CAAC,GAAG,MAAM,CAAC,EAAE;AAAA,aAC5F,KAAK,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,YAAY,KAAK,QAAQ,OAAO,OAAO,CAAC,QAAQ,OAAO,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,mBAAmB,KAAK,IAAI,IAAI,KAAK,KAAK,WAAW,CAAC,aAAa,CAAC;AAAA;AAAA;AAAA,QAG/L,KAAK,QAAQ,qCAAqC,KAAK,KAAK,SAAS,OAAO;AAAA,QAC5E,KAAK,SAAS,8CAA8C,OAAO,IAAI,CAAC,MAAM,mBAAmB,cAAc,OAAO,QAAW,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,OAAO;AAAA;AAAA,EAExK;AACF;AAEA,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,mBAAmB,cAAc;AACvD,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
|
package/dist/components/site.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @atomic-ui/blocks version 0.
|
|
1
|
+
/* @atomic-ui/blocks version 0.10.0, standalone. Load atomic-ui.js from @atomic-ui/ui first, from the same folder. */
|
|
2
2
|
import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.js";import{ImpaktElement as ae,fontSize as Te,fontWeight as be,lineHeight as ot,space as b,spaceAround as gt,t as S,type as ye,iconSvg as lt}from"./atomic-ui.js";var gi=(n,t,e)=>C`<div class=${e} role="heading" aria-level=${n}>${t}</div>`,Ii=Ae`
|
|
3
3
|
.h { margin: 0; color: ${S.textHeading}; font-family: ${S.fontHeading}; font-weight: ${be("bold")}; line-height: ${ot("tight")}; }
|
|
4
4
|
.eyebrow { margin: 0; color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${S.brand})); ${ye("sm")} font-size: var(--impakt-font-size-eyebrow, var(--impakt-font-size-sm, 0.875rem)); font-family: ${S.fontEyebrow}; font-weight: var(--impakt-font-weight-eyebrow, ${be("semibold")}); letter-spacing: ${S.trackingWide}; text-transform: uppercase; }
|
|
@@ -350,7 +350,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
350
350
|
.handle:nth-of-type(4) { inset-block-end: -4px; inset-inline-end: -4px; }
|
|
351
351
|
.label { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-start: 0; padding: 3px 7px; white-space: nowrap; font-family: ${d.fontMono}; font-size: 0.6875rem; font-weight: ${re("medium")}; line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: ${d.surfaceCard}; background: ${d.text}; border-radius: 3px; }
|
|
352
352
|
@media (forced-colors: active) { :host { forced-color-adjust: none; background: Highlight; color: HighlightText; outline-color: HighlightText; } .handle { border-color: HighlightText; background: Canvas; } .label { background: CanvasText; color: Canvas; } }
|
|
353
|
-
`]}render(){return k`<slot></slot><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span>${this.label?k`<span class="label" part="label" aria-hidden="true">${this.label}</span>`:U}`}};customElements.define("impakt-work-list",xt);customElements.define("impakt-stat-row",vt);customElements.define("impakt-faq",kt);customElements.define("impakt-site-menu",wt);customElements.define("impakt-offer",St);customElements.define("impakt-post-card",zt);customElements.define("impakt-highlight",Tt);import{css as he,html as f,nothing as
|
|
353
|
+
`]}render(){return k`<slot></slot><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span><span class="handle" aria-hidden="true"></span>${this.label?k`<span class="label" part="label" aria-hidden="true">${this.label}</span>`:U}`}};customElements.define("impakt-work-list",xt);customElements.define("impakt-stat-row",vt);customElements.define("impakt-faq",kt);customElements.define("impakt-site-menu",wt);customElements.define("impakt-offer",St);customElements.define("impakt-post-card",zt);customElements.define("impakt-highlight",Tt);import{css as he,html as f,nothing as P}from"./atomic-ui.js";import{say as ee,ImpaktElement as Y,focusRing as Nt,targetSize as yi,visuallyHidden as Ta,fontWeight as pe,lineHeight as _i,space as h,spaceAround as xe,t as p,token as Aa,type as B,iconSvg as Ce}from"./atomic-ui.js";var Ma=Aa("color.accent.default","#c8a15a"),Wi=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,Di=he`
|
|
354
354
|
.round { ${yi} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${p.text}; background: ${p.surfaceCard}; border: ${p.borderThin} solid ${p.rule}; border-radius: 50%; box-shadow: ${p.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
|
|
355
355
|
.round:hover:not(:disabled) { box-shadow: ${p.shadowMd}; }
|
|
356
356
|
.round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
|
@@ -382,9 +382,9 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
382
382
|
@mouseenter=${()=>this.hold(!0)} @mouseleave=${()=>this.hold(!1)} @focusin=${()=>this.hold(!0)} @focusout=${()=>this.hold(!1)}>
|
|
383
383
|
<div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
|
|
384
384
|
<div class="controls" part="controls">
|
|
385
|
-
<div class="dots">${e.length>1?e.map(i=>f`<button class="dot" type="button" aria-label=${ee("Go to slide {slide}",{slide:i+1})} aria-current=${i===this.index?"true":"false"} @click=${()=>this.go(i)}><span></span></button>`):
|
|
385
|
+
<div class="dots">${e.length>1?e.map(i=>f`<button class="dot" type="button" aria-label=${ee("Go to slide {slide}",{slide:i+1})} aria-current=${i===this.index?"true":"false"} @click=${()=>this.go(i)}><span></span></button>`):P}</div>
|
|
386
386
|
<div class="buttons">
|
|
387
|
-
${this.canPlay?f`<button class="round" type="button" aria-label=${ee(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?Ce("arrow-right","18px"):f`<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>`}</button>`:
|
|
387
|
+
${this.canPlay?f`<button class="round" type="button" aria-label=${ee(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?Ce("arrow-right","18px"):f`<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>`}</button>`:P}
|
|
388
388
|
<button class="round" type="button" aria-label=${ee("Previous slide")} ?disabled=${this.index===0} @click=${()=>this.go(this.index-1)}>${Ce("arrow-left","18px")}</button>
|
|
389
389
|
<button class="round" type="button" aria-label=${ee("Next slide")} ?disabled=${this.index>=this.last} @click=${()=>this.go(this.index+1)}>${Ce("arrow-right","18px")}</button>
|
|
390
390
|
</div>
|
|
@@ -420,7 +420,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
420
420
|
<button class="round" type="button" aria-label=${ee("Next picture")} @click=${()=>this.step(1)}>${Ce("arrow-right","18px")}</button>
|
|
421
421
|
</div>
|
|
422
422
|
<p class="caption">${i.caption??i.alt}</p>
|
|
423
|
-
</div>`:
|
|
423
|
+
</div>`:P}
|
|
424
424
|
</dialog>`}},Ct=class extends Y{static{this.properties={heading:{type:String},items:{type:Array},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.items=[],this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,Nt,xe,he`
|
|
425
425
|
:host { display: block; }
|
|
426
426
|
p { margin: 0 0 ${h(6)}; text-align: center; color: ${p.textMuted}; ${B("sm")} font-weight: ${pe("medium")}; }
|
|
@@ -428,7 +428,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
428
428
|
img { display: block; block-size: 40px; inline-size: auto; max-inline-size: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; }
|
|
429
429
|
li:hover img { filter: none; opacity: 1; }
|
|
430
430
|
a { display: block; border-radius: ${p.radiusSm}; }
|
|
431
|
-
`]}render(){return f`${this.heading?f`<p part="heading">${this.heading}</p>`:
|
|
431
|
+
`]}render(){return f`${this.heading?f`<p part="heading">${this.heading}</p>`:P}
|
|
432
432
|
<ul part="list">${(this.items??[]).map(t=>f`<li>${t.href?f`<a href=${t.href}><img src=${t.src} alt=${t.alt} /></a>`:f`<img src=${t.src} alt=${t.alt} />`}</li>`)}</ul>`}},Bt=class extends Y{static{this.properties={items:{type:Array},orientation:{type:String,reflect:!0},look:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.orientation="horizontal",this.look="numbered",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
433
433
|
:host { display: block; container-type: inline-size; }
|
|
434
434
|
ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${h(6)}; }
|
|
@@ -459,10 +459,10 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
459
459
|
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${h(3)}; inset-inline-start: 2px; inset-inline-end: auto; inline-size: 12px; block-size: auto; background: radial-gradient(circle at 100% 34px, var(--rule) 4px, transparent 4.5px); border: 2px solid var(--rule); border-inline-start: 0; border-radius: 0 14px 14px 0; }
|
|
460
460
|
}
|
|
461
461
|
@media (forced-colors: active) { li::before { border: 1px solid CanvasText; } li:not(:last-child)::after { background: CanvasText; } :host([look='ruled']) li { border-block-start-color: CanvasText; } }
|
|
462
|
-
`]}render(){return f`<ol part="list">${(this.items??[]).map((t,e)=>f`<li part="step" style=${this.look==="ruled"?`--rule:var(--impakt-color-chart-${e%5+1}, var(--impakt-color-brand-default, #1f4ed8))`:
|
|
463
|
-
${t.meta?f`<p class="meta">${t.meta}</p>`:
|
|
462
|
+
`]}render(){return f`<ol part="list">${(this.items??[]).map((t,e)=>f`<li part="step" style=${this.look==="ruled"?`--rule:var(--impakt-color-chart-${e%5+1}, var(--impakt-color-brand-default, #1f4ed8))`:P}>
|
|
463
|
+
${t.meta?f`<p class="meta">${t.meta}</p>`:P}
|
|
464
464
|
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.heading}</div>
|
|
465
|
-
${t.text?f`<p class="body">${t.text}</p>`:
|
|
465
|
+
${t.text?f`<p class="body">${t.text}</p>`:P}
|
|
466
466
|
</li>`)}</ol>`}},It=class extends Y{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},points:{type:Array},level:{type:Number,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},imageSide:{type:String,reflect:!0,attribute:"image-side"},insetSrc:{type:String,attribute:"inset-src"},insetAlt:{type:String,attribute:"inset-alt"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.points=[],this.level=2,this.imageSrc="",this.imageAlt="",this.imageSide="end",this.insetSrc="",this.insetAlt="",this.ratio="4:3",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
467
467
|
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
468
468
|
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
@@ -488,13 +488,13 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
488
488
|
}
|
|
489
489
|
`]}render(){return f`<div class="split" part="split">
|
|
490
490
|
<div class="words">
|
|
491
|
-
${this.eyebrow?f`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:
|
|
491
|
+
${this.eyebrow?f`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:P}
|
|
492
492
|
<div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
|
|
493
|
-
${this.lead?f`<p class="lead">${this.lead}</p>`:
|
|
494
|
-
${this.points?.length?f`<ul>${this.points.map(t=>f`<li><span class="tick">${Ce("check","14px")}</span><span>${t}</span></li>`)}</ul>`:
|
|
493
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:P}
|
|
494
|
+
${this.points?.length?f`<ul>${this.points.map(t=>f`<li><span class="tick">${Ce("check","14px")}</span><span>${t}</span></li>`)}</ul>`:P}
|
|
495
495
|
<div class="actions"><slot name="actions"></slot></div>
|
|
496
496
|
</div>
|
|
497
|
-
${this.imageSrc?f`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?f`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:
|
|
497
|
+
${this.imageSrc?f`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?f`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:P}</div>`:P}
|
|
498
498
|
</div>`}},Ht=class extends Y{static{this.properties={heading:{type:String},lead:{type:String},tone:{type:String,reflect:!0},align:{type:String,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.lead="",this.tone="brand",this.align="split",this.imageSrc="",this.imageAlt="",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,jt,he`
|
|
499
499
|
:host { display: block; container-type: inline-size; }
|
|
500
500
|
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${h(8)}; padding: ${h(16)}; border-radius: ${p.radius2xl}; background: ${p.surfaceCard}; box-shadow: ${p.shadowSm}, inset 0 0 0 1px ${p.hairline}; }
|
|
@@ -519,10 +519,10 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
519
519
|
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${h(8)} ${h(6)}; } .h { ${B("3xl")} } :host([align='center']) .panel { align-items: center; } }
|
|
520
520
|
@media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
|
|
521
521
|
`]}render(){return f`<div class="panel ${this.imageSrc?"pictured":""}" part="panel">
|
|
522
|
-
${this.imageSrc?f`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:
|
|
522
|
+
${this.imageSrc?f`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:P}
|
|
523
523
|
<div class="words">
|
|
524
524
|
<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
|
|
525
|
-
${this.lead?f`<p class="lead">${this.lead}</p>`:
|
|
525
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:P}
|
|
526
526
|
</div>
|
|
527
527
|
<div class="actions"><slot name="actions"></slot></div>
|
|
528
528
|
</div>`}},qi=n=>f`<span class="stars" role="img" aria-label=${ee("Rated {rating} out of 5",{rating:n})}>${[1,2,3,4,5].map(t=>f`<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true" fill=${t<=n?"currentColor":"none"} stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M12 3.5l2.6 5.4 5.9.7-4.4 4 1.2 5.8L12 16.5l-5.3 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>`)}</span>`,La=n=>n.split(/\s+/).filter(t=>/^[A-Za-z]/.test(t)&&t.toLowerCase()!=="and").slice(0,2).map(t=>t[0].toUpperCase()).join(""),Rt=class extends Y{static{this.properties={summary:{type:String},rating:{type:Number},items:{type:Array},columns:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.summary="",this.rating=void 0,this.items=[],this.columns="three",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...Y.styles,xe,he`
|
|
@@ -539,11 +539,11 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
539
539
|
.name { font-weight: ${pe("semibold")}; ${B("sm")} }
|
|
540
540
|
.about { color: ${p.textMuted}; ${B("sm")} }
|
|
541
541
|
@container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
542
|
-
`]}render(){return f`${this.summary||this.rating?f`<p class="top" part="summary" style="margin-block-start:0">${this.rating?qi(Math.round(this.rating)):
|
|
542
|
+
`]}render(){return f`${this.summary||this.rating?f`<p class="top" part="summary" style="margin-block-start:0">${this.rating?qi(Math.round(this.rating)):P}<span>${this.summary}</span></p>`:P}
|
|
543
543
|
<ul part="list">${(this.items??[]).map(t=>f`<li part="review">
|
|
544
|
-
${t.rating?qi(t.rating):
|
|
544
|
+
${t.rating?qi(t.rating):P}
|
|
545
545
|
<blockquote>${t.quote}</blockquote>
|
|
546
|
-
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?f`<img src=${t.avatarSrc} alt="" />`:La(t.person)}</span><span><span class="name">${t.person}</span>${t.about?f`<br /><span class="about">${t.about}</span>`:
|
|
546
|
+
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?f`<img src=${t.avatarSrc} alt="" />`:La(t.person)}</span><span><span class="name">${t.person}</span>${t.about?f`<br /><span class="about">${t.about}</span>`:P}</span></div>
|
|
547
547
|
</li>`)}</ul>`}},Pt=class extends Y{constructor(){super();this.done=!1;this.heading="",this.lead="",this.label="Email address",this.buttonText="Sign up",this.smallPrint="",this.doneText="Thank you. You\u2019re on the list.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={heading:{type:String},lead:{type:String},label:{type:String},buttonText:{type:String,attribute:"button-text"},smallPrint:{type:String,attribute:"small-print"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...Y.styles,Nt,xe,jt,he`
|
|
548
548
|
:host { display: block; container-type: inline-size; }
|
|
549
549
|
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${h(8)}; align-items: center; }
|
|
@@ -559,14 +559,14 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
559
559
|
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
560
560
|
`]}submit(e){e.preventDefault();let i=e.currentTarget;if(typeof i.reportValidity=="function"&&!i.reportValidity())return;let a=i.querySelector("input").value.trim();this.dispatchEvent(new CustomEvent("impakt-submit",{detail:{email:a},bubbles:!0,composed:!0})),this.done=!0,this.requestUpdate()}render(){let e=this.id_("email");return f`<div class="wrap" part="wrap">
|
|
561
561
|
<div class="words">
|
|
562
|
-
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:
|
|
563
|
-
${this.lead?f`<p class="lead">${this.lead}</p>`:
|
|
562
|
+
${this.heading?f`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:P}
|
|
563
|
+
${this.lead?f`<p class="lead">${this.lead}</p>`:P}
|
|
564
564
|
</div>
|
|
565
565
|
<div aria-live="polite">${this.done?f`<p class="done">${this.doneText}</p>`:f`<form @submit=${this.submit}>
|
|
566
566
|
<label for=${e}>${this.label}</label>
|
|
567
567
|
<input id=${e} type="email" name="email" autocomplete="email" required />
|
|
568
568
|
<button type="submit">${this.buttonText}</button>
|
|
569
|
-
${this.smallPrint?f`<p class="note">${this.smallPrint}</p>`:
|
|
569
|
+
${this.smallPrint?f`<p class="note">${this.smallPrint}</p>`:P}
|
|
570
570
|
</form>`}</div>
|
|
571
571
|
</div>`}};customElements.define("impakt-carousel",Lt);customElements.define("impakt-gallery",Et);customElements.define("impakt-logo-cloud",Ct);customElements.define("impakt-steps",Bt);customElements.define("impakt-media-split",It);customElements.define("impakt-cta-banner",Ht);customElements.define("impakt-reviews",Rt);customElements.define("impakt-newsletter",Pt);import{css as Je,html as I,nothing as K}from"./atomic-ui.js";import{say as ve,pageLocale as Ea,ImpaktElement as me,focusRing as Ke,targetSize as Yi,fontWeight as Z,space as m,spaceAround as Dt,t as s,type as W,iconSvg as Be}from"./atomic-ui.js";var Ot=class extends me{static{this.properties={imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},plots:{type:Array},hint:{type:String},selectedPlot:{type:String,attribute:"selected-plot"},panel:{type:String,reflect:!0},plotWord:{type:String,attribute:"plot-word"},actionText:{type:String,attribute:"action-text"},availableText:{type:String,attribute:"available-text"},reservedText:{type:String,attribute:"reserved-text"},soldText:{type:String,attribute:"sold-text"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.imageSrc="",this.imageAlt="",this.plots=[],this.hint="Choose a plot to see its price and availability.",this.selectedPlot="",this.panel="beside",this.plotWord="Plot",this.actionText="View this home",this.availableText="Available",this.reservedText="Reserved",this.soldText="Sold",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...me.styles,Ke,Dt,Je`
|
|
572
572
|
:host { display: block; container-type: inline-size; }
|
|
@@ -716,7 +716,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
716
716
|
${this.nearby.length?I`<ul>${this.nearby.map(e=>I`<li><span>${e.place}</span><span>${e.distance}</span></li>`)}</ul>`:K}
|
|
717
717
|
${t?I`<a class="go" href=${t}>${this.directionsText}${Be("arrow-right","16px")}</a>`:K}
|
|
718
718
|
</div>
|
|
719
|
-
</div>`}};customElements.define("impakt-site-plan",Ot);customElements.define("impakt-mortgage-calculator",Ft);customElements.define("impakt-before-after",Wt);customElements.define("impakt-sticky-bar",qt);customElements.define("impakt-location-card",_t);import{css as je,html as $,nothing as
|
|
719
|
+
</div>`}};customElements.define("impakt-site-plan",Ot);customElements.define("impakt-mortgage-calculator",Ft);customElements.define("impakt-before-after",Wt);customElements.define("impakt-sticky-bar",qt);customElements.define("impakt-location-card",_t);import{css as je,html as $,nothing as N}from"./atomic-ui.js";import{say as M,pageLocale as Vi,ImpaktElement as se,focusRing as tt,targetSize as Ca,visuallyHidden as Ba,fontWeight as X,space as u,spaceAround as Oe,t as c,type as O}from"./atomic-ui.js";var it=je`
|
|
720
720
|
.card { background: ${c.surfaceCard}; border-radius: ${c.radiusXl}; box-shadow: ${c.shadowSm}, 0 0 0 1px ${c.hairline}; }
|
|
721
721
|
.h { margin: 0; font-family: ${c.fontHeading}; ${O("2xl")} font-weight: ${X("bold")}; color: ${c.textHeading}; }
|
|
722
722
|
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${u(2.5)} ${u(5)}; font: inherit; font-weight: ${X("semibold")}; color: ${c.onBrand}; text-decoration: none; background: ${c.brand}; border: 0; border-radius: ${c.radiusLg}; cursor: pointer; }
|
|
@@ -742,13 +742,13 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
742
742
|
li[data-has='true'] .mark { color: ${c.successText}; }
|
|
743
743
|
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${u(6)}; } }
|
|
744
744
|
`]}has(t,e){return t.includes.split(",").map(i=>i.trim().toLowerCase()).includes(e.label.trim().toLowerCase())}choose(t,e){this.dispatchEvent(new CustomEvent("impakt-select",{detail:{plan:t},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()}render(){return $`
|
|
745
|
-
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:
|
|
745
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:N}
|
|
746
746
|
<div class="grid" style=${`--cols: ${Math.max(1,this.plans.length)}`}>
|
|
747
747
|
${this.plans.map(t=>$`<section class="card plan ${t.badge?"top":""}" aria-labelledby=${this.id_(`n-${t.id}`)}>
|
|
748
|
-
${t.badge?$`<span class="badge">${t.badge}</span>`:
|
|
748
|
+
${t.badge?$`<span class="badge">${t.badge}</span>`:N}
|
|
749
749
|
<h3 class="name" id=${this.id_(`n-${t.id}`)}>${t.name}</h3>
|
|
750
|
-
<p class="price">${t.price}${t.period?$` <span class="period">${t.period}</span>`:
|
|
751
|
-
${t.note?$`<p class="note">${t.note}</p>`:
|
|
750
|
+
<p class="price">${t.price}${t.period?$` <span class="period">${t.period}</span>`:N}</p>
|
|
751
|
+
${t.note?$`<p class="note">${t.note}</p>`:N}
|
|
752
752
|
<ul>${this.rows.map(e=>{let i=this.has(t,e);return $`<li data-has=${String(i)}><span class="mark" aria-hidden="true">${i?"\u2713":"\u2013"}</span><span>${e.label}<span class="visually-hidden">: ${M(i?"included":"not included")}</span></span></li>`})}</ul>
|
|
753
753
|
${t.href?$`<a class="btn ${t.badge?"":"quiet"}" href=${t.href} @click=${e=>this.choose(t,e)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></a>`:$`<button class="btn ${t.badge?"":"quiet"}" type="button" @click=${e=>this.choose(t,e)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></button>`}
|
|
754
754
|
</section>`)}
|
|
@@ -766,15 +766,15 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
766
766
|
.foot { margin: ${u(2)} 0 0; ${O("sm")} }
|
|
767
767
|
.foot a { color: ${c.link}; }
|
|
768
768
|
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
769
|
-
`]}render(){let t=Qi(this.videoSrc,Vi(this)),e;return this.videoSrc?t&&this.playing?e=$`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?e=$`${this.posterSrc?$`<img src=${this.posterSrc} alt="" />`:
|
|
769
|
+
`]}render(){let t=Qi(this.videoSrc,Vi(this)),e;return this.videoSrc?t&&this.playing?e=$`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?e=$`${this.posterSrc?$`<img src=${this.posterSrc} alt="" />`:N}
|
|
770
770
|
<button class="play" type="button" @click=${()=>{this.playing=!0}}>
|
|
771
771
|
<span class="disc" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></span>
|
|
772
772
|
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
773
|
-
</button>`:e=$`<video controls preload="metadata" poster=${this.posterSrc||
|
|
773
|
+
</button>`:e=$`<video controls preload="metadata" poster=${this.posterSrc||N} aria-label=${this.label}>
|
|
774
774
|
<source src=${this.videoSrc} />
|
|
775
|
-
${this.captionsSrc?$`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:
|
|
775
|
+
${this.captionsSrc?$`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:N}
|
|
776
776
|
</video>`:e=$`<div class="empty">${M("Add a video address")}</div>`,$`<div class="frame" part="frame">${e}</div>
|
|
777
|
-
${this.transcriptHref?$`<p class="foot"><a href=${this.transcriptHref}>${M("Read the transcript")}<span class="visually-hidden">${M(" of {video}",{video:this.label})}</span></a></p>`:
|
|
777
|
+
${this.transcriptHref?$`<p class="foot"><a href=${this.transcriptHref}>${M("Read the transcript")}<span class="visually-hidden">${M(" of {video}",{video:this.label})}</span></a></p>`:N}`}},Xi={mortgage:{heading:"Your home may be repossessed",text:"Your home may be repossessed if you do not keep up repayments on your mortgage."},"secured-loan":{heading:"Think carefully before securing other debts against your home",text:"Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it."},investment:{heading:"Capital at risk",text:"The value of investments can go down as well as up, and you may get back less than you put in."},insurance:{heading:"Important information",text:"Read the policy documents to check the cover suits your needs. Limits and exclusions apply."},custom:{heading:"",text:""}},Gt=class extends se{static{this.properties={kind:{type:String,reflect:!0},heading:{type:String},text:{type:String},firm:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.kind="mortgage",this.heading="",this.text="",this.firm="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,Oe,je`
|
|
778
778
|
:host { display: block; }
|
|
779
779
|
.box { padding: ${u(5)}; border-inline-start: 6px solid ${c.warning}; border-radius: ${c.radiusLg}; background: ${c.warningSubtle}; }
|
|
780
780
|
:host([kind='insurance']) .box { border-color: ${c.info}; background: ${c.infoSubtle}; }
|
|
@@ -783,9 +783,9 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
783
783
|
/* Muted text is proved against the card colour, not the notice's, so the firm's line is in the text colour (1.4.3). */
|
|
784
784
|
.firm { margin-block-start: ${u(3)}; ${O("sm")} color: ${c.text}; }
|
|
785
785
|
`]}render(){let t=Xi[this.kind]??Xi.custom,e=this.heading||(t.heading?M(t.heading):""),i=this.text||(t.text?M(t.text):"");return $`<aside class="box" part="box" aria-label=${e||M("Important information")}>
|
|
786
|
-
${e?$`<strong>${e}</strong>`:
|
|
787
|
-
${i?$`<p>${i}</p>`:
|
|
788
|
-
${this.firm?$`<p class="firm">${this.firm}</p>`:
|
|
786
|
+
${e?$`<strong>${e}</strong>`:N}
|
|
787
|
+
${i?$`<p>${i}</p>`:N}
|
|
788
|
+
${this.firm?$`<p class="firm">${this.firm}</p>`:N}
|
|
789
789
|
</aside>`}},ke={standard:[{from:0,rate:0},{from:125e3,rate:2},{from:25e4,rate:5},{from:925e3,rate:10},{from:15e5,rate:12}],firstTime:[{from:0,rate:0},{from:3e5,rate:5}],firstTimeLimit:5e5,additionalSurcharge:5};function xi(n,t,e=0){let i=0;return t.forEach((a,r)=>{let o=t[r+1]?.from??1/0;n>a.from&&(i+=(Math.min(n,o)-a.from)*(a.rate+e)/100)}),Math.round(i)}function Ji(n,t){return n<=0?0:t==="first-time"&&n<=ke.firstTimeLimit?xi(n,ke.firstTime):t==="additional"?n<4e4?0:xi(n,ke.standard,ke.additionalSurcharge):xi(n,ke.standard)}var Ki=je`
|
|
790
790
|
:host { display: block; container-type: inline-size; }
|
|
791
791
|
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }
|
|
@@ -806,7 +806,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
806
806
|
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${u(5)}; } .foot { padding: ${u(4)} ${u(5)}; } }
|
|
807
807
|
`,Xt=class extends se{static{this.properties={heading:{type:String},price:{type:Number},buyer:{type:String},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much stamp duty would you pay?",this.price=385e3,this.buyer="first-time",this.smallPrint="Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,Ki]}render(){let t=Ji(this.price,this.buyer),e=this.price>0?t/this.price*100:0,i=[["first-time",M("First home")],["mover",M("Moving home")],["additional",M("Second home")]];return $`<div class="card wrap" part="wrap">
|
|
808
808
|
<div class="inputs">
|
|
809
|
-
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:
|
|
809
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:N}
|
|
810
810
|
<div><label for=${this.id_("price")}>${M("Price of the home (\xA3)")}</label>
|
|
811
811
|
<input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${a=>{this.price=Number(a.target.value)||0}} /></div>
|
|
812
812
|
<fieldset><legend>${M("Are you buying")}</legend><div class="choices">
|
|
@@ -817,13 +817,13 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
817
817
|
<p class="caption">${M("Stamp duty to pay")}</p>
|
|
818
818
|
<output for=${this.id_("price")}>${Ut(t)}</output>
|
|
819
819
|
<p class="line">${t?M("About {rate}% of the price",{rate:e.toFixed(1)}):M("Nothing to pay at this price")}</p>
|
|
820
|
-
${this.buyer==="first-time"&&this.price>ke.firstTimeLimit?$`<p class="line">${M("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:Ut(ke.firstTimeLimit)})}</p>`:
|
|
820
|
+
${this.buyer==="first-time"&&this.price>ke.firstTimeLimit?$`<p class="line">${M("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:Ut(ke.firstTimeLimit)})}</p>`:N}
|
|
821
821
|
</div>
|
|
822
|
-
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:
|
|
822
|
+
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:N}
|
|
823
823
|
</div>`}},Vt=class extends se{static{this.properties={heading:{type:String},income:{type:Number},secondIncome:{type:Number,attribute:"second-income"},deposit:{type:Number},timesIncome:{type:Number,attribute:"times-income"},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much could you borrow?",this.income=45e3,this.secondIncome=0,this.deposit=3e4,this.timesIncome=4.5,this.smallPrint="This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,Ki]}field(t){return e=>{this[t]=Number(e.target.value)||0}}render(){let t=Math.max(0,(this.income+this.secondIncome)*this.timesIncome),e=(i,a)=>$`<div><label for=${this.id_(i)}>${a}</label>
|
|
824
824
|
<input id=${this.id_(i)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[i])} @input=${this.field(i)} /></div>`;return $`<div class="card wrap" part="wrap">
|
|
825
825
|
<div class="inputs">
|
|
826
|
-
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:
|
|
826
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:N}
|
|
827
827
|
${e("income",M("Your yearly income before tax (\xA3)"))}
|
|
828
828
|
${e("secondIncome",M("A second person\u2019s income, if buying together (\xA3)"))}
|
|
829
829
|
${e("deposit",M("Your deposit (\xA3)"))}
|
|
@@ -833,7 +833,7 @@ import"./atomic-ui.js";import{css as Ae,html as C,nothing as G}from"./atomic-ui.
|
|
|
833
833
|
<output>${Ut(t)}</output>
|
|
834
834
|
<p class="line">${M("With your deposit, that\u2019s a home of about {amount}.",{amount:Ut(t+this.deposit)})}</p>
|
|
835
835
|
</div>
|
|
836
|
-
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:
|
|
836
|
+
${this.smallPrint?$`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:N}
|
|
837
837
|
</div>`}},et=class extends se{static{this.properties={heading:{type:String},phone:{type:String},hours:{type:String},email:{type:String},callbackHeading:{type:String,attribute:"callback-heading"},buttonText:{type:String,attribute:"button-text"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="Talk to us",this.phone="0800 000 0000",this.hours=`Monday to Friday, 9am to 6pm
|
|
838
838
|
Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",this.buttonText="Ask for a call back",this.doneText="Thanks. We\u2019ll call you at the time you chose.",this.headingLevel=2,this.sent=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...se.styles,tt,Oe,it,je`
|
|
839
839
|
:host { display: block; container-type: inline-size; }
|
|
@@ -849,10 +849,10 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
849
849
|
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${u(5)}; } }
|
|
850
850
|
`]}submit(t){t.preventDefault();let e=new FormData(t.target),i={name:String(e.get("name")??""),phone:String(e.get("phone")??""),when:String(e.get("when")??"")};this.dispatchEvent(new CustomEvent("impakt-submit",{detail:i,bubbles:!0,composed:!0})),this.sent=!0}render(){return $`<div class="card wrap" part="wrap">
|
|
851
851
|
<div>
|
|
852
|
-
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:
|
|
853
|
-
${this.phone?$`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:
|
|
854
|
-
${this.hours?$`<p class="hours">${this.hours}</p>`:
|
|
855
|
-
${this.email?$`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:
|
|
852
|
+
${this.heading?$`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:N}
|
|
853
|
+
${this.phone?$`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:N}
|
|
854
|
+
${this.hours?$`<p class="hours">${this.hours}</p>`:N}
|
|
855
|
+
${this.email?$`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:N}
|
|
856
856
|
</div>
|
|
857
857
|
${this.callbackHeading?this.sent?$`<p class="done" role="status">${this.doneText}</p>`:$`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
858
858
|
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
@@ -860,7 +860,7 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
860
860
|
<div><label for=${this.id_("tel")}>${M("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
861
861
|
<div><label for=${this.id_("when")}>${M("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${M("Morning")}</option><option value="Afternoon">${M("Afternoon")}</option><option value="Evening">${M("Evening")}</option></select></div>
|
|
862
862
|
<button class="btn" type="submit">${this.buttonText}</button>
|
|
863
|
-
</form>`:
|
|
863
|
+
</form>`:N}
|
|
864
864
|
</div>`}};Ze.createProperty("playing",{state:!0});et.createProperty("sent",{state:!0});customElements.define("impakt-plan-comparison",Yt);customElements.define("impakt-video",Ze);customElements.define("impakt-regulatory-notice",Gt);customElements.define("impakt-stamp-duty-calculator",Xt);customElements.define("impakt-affordability-calculator",Vt);customElements.define("impakt-contact-block",et);import{css as Ia,html as F,nothing as le,unsafeCSS as Zi}from"./atomic-ui.js";import{ImpaktElement as ea,pageLocale as ta,say as D,focusRing as Ha,targetSize as ia,visuallyHidden as aa,fontSize as vi,fontWeight as Ie,space as T,spaceAround as Ra,t as y,type as He,toneOf as Qt}from"./atomic-ui.js";var Jt=n=>n.reduce((t,e)=>t+e,0),ra=(n,t)=>n.find(e=>typeof e.below=="number"&&t<e.below)??n.at(-1);function Kt(n,t,e){let i=n.flatMap(l=>(t[l.id]??[]).flatMap(x=>l.choices.filter(v=>v.id===x))),a=Jt(i.map(l=>l.cost??0)),r=Jt(i.map(l=>l.weeks??0));for(let l of i)a*=l.costFactor??1,r*=l.weeksFactor??1;let o=(ra(e.teams,a)?.engineers??1)+Jt(i.map(l=>l.engineers??0));return{cost:a,low:Math.round(a*e.low),high:Math.round(a*e.high),weeks:Math.max(e.minWeeks,Math.round(r)),engineers:o,way:ra(e.ways,a)?.text??""}}function sa(n,t){let e=n.map(a=>typeof a.share=="number"?Math.max(1,Math.round(t*a.share)):0),i=Math.max(1,t-Jt(e));return n.map((a,r)=>typeof a.share=="number"?e[r]:i)}var Zt=class extends ea{constructor(){super();this.at=0;this.answers={};this.tip="";this.copied="";this.started=!1;this.questions=[],this.teams=[],this.ways=[],this.phases=[],this.low=.85,this.high=1.25,this.minWeeks=1,this.currency="GBP",this.unit=1,this.intro="",this.budgetLabel="Indicative budget",this.resultHeading="Your estimate",this.teamText="{n} engineers",this.teamTextOne="1 engineer",this.note="",this.contactHref="",this.sendLabel="Send this to us",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={questions:{type:Array},teams:{type:Array},ways:{type:Array},phases:{type:Array},low:{type:Number},high:{type:Number},minWeeks:{type:Number,attribute:"min-weeks"},currency:{type:String},unit:{type:Number},intro:{type:String},budgetLabel:{type:String,attribute:"budget-label"},resultHeading:{type:String,attribute:"result-heading"},teamText:{type:String,attribute:"team-text"},teamTextOne:{type:String,attribute:"team-text-one"},note:{type:String},contactHref:{type:String,attribute:"contact-href"},sendLabel:{type:String,attribute:"send-label"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...ea.styles,Ra,Ha,Ia`
|
|
865
865
|
:host { display: block; container-type: inline-size; }
|
|
866
866
|
[hidden] { display: none !important; }
|
|
@@ -997,25 +997,32 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
997
997
|
<p class="weeks">${D("About {weeks} to a first release",{weeks:this.weeksWord(a.weeks)})}</p>
|
|
998
998
|
<p class="tip" aria-live="polite">${this.tip||this.intro}</p>
|
|
999
999
|
</aside>
|
|
1000
|
-
</div>`}};customElements.define("impakt-estimator",Zt);import{css as wi,html as L,nothing as te}from"./atomic-ui.js";import{ImpaktElement as _e,focusRing as Si,hideOn as Pa,fontSize as We,fontWeight as Fe,space as
|
|
1000
|
+
</div>`}};customElements.define("impakt-estimator",Zt);import{css as wi,html as L,nothing as te}from"./atomic-ui.js";import{ImpaktElement as _e,focusRing as Si,hideOn as Pa,fontSize as We,fontWeight as Fe,space as R,t as ne,type as at,toneOf as ki}from"./atomic-ui.js";var Na=[0,1,2,3,4],qe=ne.fontMono,ei=class extends _e{static{this.properties={brand:{type:String},logoSrc:{type:String,attribute:"logo-src"},logoAlt:{type:String,attribute:"logo-alt"},home:{type:String},badge:{type:String},meta:{type:String},links:{type:Array},label:{type:String},menuText:{type:String,attribute:"menu-text"},status:{type:String},statusMeta:{type:String,attribute:"status-meta"},statusTone:{type:String,attribute:"status-tone"},actionText:{type:String,attribute:"action-text"},actionHref:{type:String,attribute:"action-href"}}}constructor(){super(),this.brand="",this.logoSrc="",this.logoAlt="",this.home="/",this.badge="",this.meta="",this.links=[],this.label="Main",this.menuText="Menu",this.status="",this.statusMeta="",this.statusTone="success",this.actionText="",this.actionHref=""}static{this.styles=[..._e.styles,Si,wi`
|
|
1001
1001
|
:host { display: block; container-type: inline-size; }
|
|
1002
|
-
.bar { display: flex; align-items: center; gap: ${
|
|
1003
|
-
.start { display: flex; align-items: center; gap: ${
|
|
1002
|
+
.bar { display: flex; align-items: center; gap: ${R(6)}; }
|
|
1003
|
+
.start { display: flex; align-items: center; gap: ${R(3)}; flex: none; }
|
|
1004
1004
|
.middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
|
|
1005
1005
|
.middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
|
|
1006
1006
|
slot { display: contents; }
|
|
1007
1007
|
.brand { display: inline-flex; align-items: center; min-block-size: ${ne.targetMin}; color: inherit; text-decoration: none; font-family: ${ne.fontHeading}; font-weight: ${Fe("semibold")}; ${at("2xl")} letter-spacing: -0.02em; line-height: 1; border-radius: ${ne.radiusSm}; }
|
|
1008
1008
|
.brand img { display: block; block-size: 32px; inline-size: auto; }
|
|
1009
|
-
.chip { display: inline-flex; align-items: center; gap: ${
|
|
1009
|
+
.chip { display: inline-flex; align-items: center; gap: ${R(1)}; padding: 2px ${R(2)}; border-radius: ${ne.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${qe}; font-size: ${We("xs")}; }
|
|
1010
1010
|
.chip svg { inline-size: 12px; block-size: 12px; }
|
|
1011
1011
|
.meta { font-family: ${qe}; font-size: ${We("xs")}; opacity: 0.72; }
|
|
1012
1012
|
.middle impakt-nav { flex: 1 1 8rem; }
|
|
1013
|
-
.end { display: flex; align-items: center; gap: ${
|
|
1013
|
+
.end { display: flex; align-items: center; gap: ${R(3)}; flex: none; }
|
|
1014
1014
|
.end:empty, .start:empty { display: none; }
|
|
1015
|
-
.status { display: inline-flex; align-items: center; gap: ${
|
|
1015
|
+
.status { display: inline-flex; align-items: center; gap: ${R(2)}; padding: ${R(1)} ${R(3)}; border: ${ne.borderThin} solid ${ne.border}; border-radius: 999px; background: ${ne.surfaceCard}; font-family: ${qe}; font-size: ${We("xs")}; white-space: nowrap; }
|
|
1016
1016
|
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1017
1017
|
.status .hash { opacity: 0.72; }
|
|
1018
|
-
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${
|
|
1018
|
+
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${R(3)}; } }
|
|
1019
|
+
/* With no script the links cannot fold behind a Menu button. On a narrow screen they take a
|
|
1020
|
+
line of their own under the name and the action, and wrap there. */
|
|
1021
|
+
@container (max-width: 40rem) {
|
|
1022
|
+
:host(:not(:defined)) .bar { flex-wrap: wrap; row-gap: ${R(1)}; }
|
|
1023
|
+
:host(:not(:defined)) .start { flex: 1 1 auto; }
|
|
1024
|
+
:host(:not(:defined)) .middle { order: 3; flex: 1 1 100%; justify-content: flex-start; }
|
|
1025
|
+
}
|
|
1019
1026
|
`]}act(){this.dispatchEvent(new CustomEvent("impakt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?L`<img src=${this.logoSrc} alt=${this.logoAlt||this.brand} />`:L`${this.brand}`;return L`<div class="bar" part="bar">
|
|
1020
1027
|
<div class="start"><slot name="start">
|
|
1021
1028
|
${this.brand||this.logoSrc?L`<a class="brand" href=${this.home||"/"} part="brand">${t}</a>`:te}
|
|
@@ -1035,25 +1042,25 @@ Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",t
|
|
|
1035
1042
|
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${at("xl")} } }
|
|
1036
1043
|
`]}render(){return L`<a href=${this.href||"/"} part="link">${this.src?L`<img src=${this.src} alt=${this.alt||this.text||this.textContent?.trim()||""} />`:L`<slot>${this.text}</slot>`}</a>`}},ii=class extends _e{static{this.properties={brand:{type:String},brandSize:{type:String,reflect:!0,attribute:"brand-size"},log:{type:Array},columns:{type:Array},columnsOnPhone:{type:String,attribute:"columns-on-phone",reflect:!0},legal:{type:String},stripe:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}}}constructor(){super(),this.brand="",this.brandSize="lg",this.log=[],this.columns=[],this.columnsOnPhone="shown",this.legal="",this.stripe=!1,this.headingLevel=2}static{this.styles=[..._e.styles,Si,wi`
|
|
1037
1044
|
/* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */
|
|
1038
|
-
:host { display: block; container-type: inline-size; position: relative; padding-block: ${
|
|
1039
|
-
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${
|
|
1045
|
+
:host { display: block; container-type: inline-size; position: relative; padding-block: ${R(8)} ${R(4)}; margin-block-end: calc(-1 * ${R(8)}); }
|
|
1046
|
+
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${R(10)}; }
|
|
1040
1047
|
.brand { margin: 0; font-family: ${ne.fontHeading}; font-weight: ${Fe("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
|
|
1041
1048
|
/* The name as a wordmark across the whole footer, under the columns. */
|
|
1042
1049
|
:host([brand-size='display']) .top { grid-template-columns: 1fr; }
|
|
1043
1050
|
:host([brand-size='display']) .top > div:first-child { order: 2; }
|
|
1044
1051
|
:host([brand-size='display']) .brand { font-weight: ${Fe("semibold")}; font-size: clamp(3rem, 27cqi, 24rem); line-height: 0.9; letter-spacing: -0.06em; overflow-wrap: anywhere; }
|
|
1045
1052
|
ul { list-style: none; margin: 0; padding: 0; }
|
|
1046
|
-
.log { margin-block-start: ${
|
|
1047
|
-
.log li { display: flex; align-items: center; gap: ${
|
|
1053
|
+
.log { margin-block-start: ${R(8)}; display: grid; gap: ${R(3)}; font-family: ${qe}; font-size: ${We("sm")}; }
|
|
1054
|
+
.log li { display: flex; align-items: center; gap: ${R(3)}; opacity: 0.72; }
|
|
1048
1055
|
.log li:first-child { opacity: 1; }
|
|
1049
1056
|
.log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
|
|
1050
|
-
.log .code { margin-inline-end: ${
|
|
1051
|
-
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${
|
|
1052
|
-
.h { margin: 0 0 ${
|
|
1053
|
-
.columns ul { display: grid; gap: ${
|
|
1057
|
+
.log .code { margin-inline-end: ${R(3)}; }
|
|
1058
|
+
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${R(8)}; }
|
|
1059
|
+
.h { margin: 0 0 ${R(4)}; font-family: ${qe}; font-size: ${We("xs")}; font-weight: ${Fe("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
|
|
1060
|
+
.columns ul { display: grid; gap: ${R(3)}; }
|
|
1054
1061
|
a { color: inherit; text-decoration: none; font-weight: ${Fe("medium")}; border-radius: ${ne.radiusSm}; }
|
|
1055
1062
|
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1056
|
-
.legal { margin: ${
|
|
1063
|
+
.legal { margin: ${R(16)} 0 0; font-family: ${qe}; font-size: ${We("xs")}; opacity: 0.72; }
|
|
1057
1064
|
.stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
|
|
1058
1065
|
.stripe span { flex: 1; }
|
|
1059
1066
|
@container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|