@atomic-ui/ui 0.1.7 → 0.3.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 +82 -95
- package/custom-elements.json +25364 -0
- package/dist/base/FieldElement.d.ts +11 -0
- package/dist/base/ImpktElement.d.ts +14 -0
- package/dist/base/locale.d.ts +8 -0
- package/dist/base/say.d.ts +1 -0
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +25 -6
- package/dist/base/tokens.d.ts +5 -1
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-X7IPZPTG.js → chunk-37PA72FC.js} +34 -19
- package/dist/chunk-37PA72FC.js.map +1 -0
- package/dist/chunk-3IGNZTJU.js +14 -0
- package/dist/chunk-3IGNZTJU.js.map +1 -0
- package/dist/{chunk-NTNXHLTM.js → chunk-3KO55PZK.js} +47 -2
- package/dist/chunk-3KO55PZK.js.map +1 -0
- package/dist/chunk-3RE4H2XO.js +53 -0
- package/dist/chunk-3RE4H2XO.js.map +1 -0
- package/dist/{chunk-5EA4IDUD.js → chunk-46BYUQ5A.js} +2 -2
- package/dist/{chunk-WECSVHIM.js → chunk-4OYHT4BN.js} +7 -3
- package/dist/chunk-4OYHT4BN.js.map +1 -0
- package/dist/{chunk-4HU4Y23Q.js → chunk-55DK75QF.js} +6 -4
- package/dist/chunk-55DK75QF.js.map +1 -0
- package/dist/{chunk-XVKEM5JY.js → chunk-5QSTXIPG.js} +2 -2
- package/dist/{chunk-QCNT7D5V.js → chunk-7P4Z4CLK.js} +63 -20
- package/dist/chunk-7P4Z4CLK.js.map +1 -0
- package/dist/{chunk-GSCVG2ER.js → chunk-APJ5JGRW.js} +3 -3
- package/dist/chunk-AUVIOU5G.js +522 -0
- package/dist/chunk-AUVIOU5G.js.map +1 -0
- package/dist/{chunk-6ICOJPMD.js → chunk-CUUBAETM.js} +4 -3
- package/dist/chunk-CUUBAETM.js.map +1 -0
- package/dist/{chunk-NQKYHILD.js → chunk-DAH7RLW3.js} +3 -3
- package/dist/{chunk-OB7LC6NJ.js → chunk-DJEZW7AC.js} +2 -2
- package/dist/{chunk-XJP45LFA.js → chunk-DKZ425AM.js} +15 -5
- package/dist/chunk-DKZ425AM.js.map +1 -0
- package/dist/{chunk-GO2IBRFP.js → chunk-F4YQWKK2.js} +7 -4
- package/dist/chunk-F4YQWKK2.js.map +1 -0
- package/dist/chunk-FVCM4WHD.js +328 -0
- package/dist/chunk-FVCM4WHD.js.map +1 -0
- package/dist/chunk-GBRML4RF.js +264 -0
- package/dist/chunk-GBRML4RF.js.map +1 -0
- package/dist/{chunk-ZQJD4YEJ.js → chunk-HXINWP3V.js} +42 -13
- package/dist/chunk-HXINWP3V.js.map +1 -0
- package/dist/{chunk-T6L3USBZ.js → chunk-IOBSIAHB.js} +23 -11
- package/dist/chunk-IOBSIAHB.js.map +1 -0
- package/dist/{chunk-7Y6UCSUS.js → chunk-IZOTGWWI.js} +5 -5
- package/dist/chunk-IZOTGWWI.js.map +1 -0
- package/dist/{chunk-MLVUMCQ2.js → chunk-J2FACXYI.js} +14 -5
- package/dist/chunk-J2FACXYI.js.map +1 -0
- package/dist/{chunk-VTFCTWSX.js → chunk-KKJEEKL2.js} +33 -7
- package/dist/chunk-KKJEEKL2.js.map +1 -0
- package/dist/{chunk-HWWA27DN.js → chunk-KMCGX76Y.js} +2 -2
- package/dist/{chunk-2YQA3VBY.js → chunk-NKMVICB5.js} +4 -2
- package/dist/chunk-NKMVICB5.js.map +1 -0
- package/dist/{chunk-ZBLTU67D.js → chunk-OFLMG6RN.js} +15 -11
- package/dist/chunk-OFLMG6RN.js.map +1 -0
- package/dist/{chunk-CMAU4DSB.js → chunk-P6GDMZK4.js} +5 -5
- package/dist/chunk-P6GDMZK4.js.map +1 -0
- package/dist/{chunk-MOEMFL4K.js → chunk-PO6FCAIS.js} +5 -5
- package/dist/chunk-PO6FCAIS.js.map +1 -0
- package/dist/chunk-PWLZFGS3.js +494 -0
- package/dist/chunk-PWLZFGS3.js.map +1 -0
- package/dist/chunk-QJIB36DM.js +249 -0
- package/dist/chunk-QJIB36DM.js.map +1 -0
- package/dist/{chunk-TPF4MOMF.js → chunk-R7FKGFW6.js} +7 -4
- package/dist/chunk-R7FKGFW6.js.map +1 -0
- package/dist/{chunk-ZGAOMRYD.js → chunk-RWWRTURA.js} +3 -3
- package/dist/{chunk-QDNI54ON.js → chunk-RYBY35QE.js} +10 -8
- package/dist/chunk-RYBY35QE.js.map +1 -0
- package/dist/chunk-S7F5VKWU.js +453 -0
- package/dist/chunk-S7F5VKWU.js.map +1 -0
- package/dist/chunk-T5W3FDSF.js +396 -0
- package/dist/chunk-T5W3FDSF.js.map +1 -0
- package/dist/{chunk-BTGCUONV.js → chunk-TCXKZDMR.js} +2 -2
- package/dist/{chunk-C36CZRHK.js → chunk-WGPB3QQU.js} +43 -13
- package/dist/chunk-WGPB3QQU.js.map +1 -0
- package/dist/{chunk-G6OVKNL7.js → chunk-XPCU4KUY.js} +5 -4
- package/dist/chunk-XPCU4KUY.js.map +1 -0
- package/dist/chunk-YRYZUYY7.js +236 -0
- package/dist/chunk-YRYZUYY7.js.map +1 -0
- package/dist/{chunk-7BIQ3K6H.js → chunk-ZOTAAYO5.js} +12 -2
- package/dist/chunk-ZOTAAYO5.js.map +1 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.js +2 -2
- package/dist/components/app-ui.d.ts +28 -12
- package/dist/components/app-ui.js +6 -4
- package/dist/components/blocks.d.ts +28 -2
- package/dist/components/blocks.js +3 -3
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +3 -3
- package/dist/components/changelog.d.ts +386 -0
- package/dist/components/changelog.js +25 -0
- package/dist/components/changelog.js.map +1 -0
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +3 -3
- package/dist/components/date-input.js +3 -3
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +3 -2
- package/dist/components/estimator.d.ts +246 -0
- package/dist/components/estimator.js +16 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/fieldset.js +2 -2
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/icon.js +2 -2
- package/dist/components/journey.d.ts +447 -0
- package/dist/components/journey.js +22 -0
- package/dist/components/journey.js.map +1 -0
- package/dist/components/layout.d.ts +24 -0
- package/dist/components/layout.js +2 -2
- package/dist/components/link.js +3 -3
- package/dist/components/list.d.ts +50 -0
- package/dist/components/list.js +8 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/marketing.d.ts +1 -1
- package/dist/components/marketing.js +3 -3
- package/dist/components/media.d.ts +10 -0
- package/dist/components/media.js +2 -2
- package/dist/components/navigation.d.ts +16 -0
- package/dist/components/navigation.js +3 -3
- package/dist/components/organisms.d.ts +13 -1
- package/dist/components/organisms.js +3 -3
- package/dist/components/page.js +2 -2
- package/dist/components/price.d.ts +1 -1
- package/dist/components/price.js +3 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/property.d.ts +1 -1
- package/dist/components/property.js +4 -3
- package/dist/components/radio-group.js +3 -3
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +8 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +8 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/select.js +3 -3
- package/dist/components/selling.d.ts +409 -0
- package/dist/components/selling.js +25 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +283 -0
- package/dist/components/site.js +20 -0
- package/dist/components/site.js.map +1 -0
- package/dist/components/summary-list.js +2 -2
- package/dist/components/table.d.ts +94 -2
- package/dist/components/table.js +4 -2
- package/dist/components/text-input.js +3 -3
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +3 -3
- package/dist/index.d.ts +10 -2
- package/dist/index.js +135 -55
- package/dist/standalone/atomic-ui.js +3134 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +174 -0
- package/package.json +26 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +174 -0
- package/dist/chunk-2YQA3VBY.js.map +0 -1
- package/dist/chunk-4HU4Y23Q.js.map +0 -1
- package/dist/chunk-6ICOJPMD.js.map +0 -1
- package/dist/chunk-7BIQ3K6H.js.map +0 -1
- package/dist/chunk-7Y6UCSUS.js.map +0 -1
- package/dist/chunk-C36CZRHK.js.map +0 -1
- package/dist/chunk-CMAU4DSB.js.map +0 -1
- package/dist/chunk-G6OVKNL7.js.map +0 -1
- package/dist/chunk-GO2IBRFP.js.map +0 -1
- package/dist/chunk-MLVUMCQ2.js.map +0 -1
- package/dist/chunk-MOEMFL4K.js.map +0 -1
- package/dist/chunk-NTNXHLTM.js.map +0 -1
- package/dist/chunk-QCNT7D5V.js.map +0 -1
- package/dist/chunk-QDNI54ON.js.map +0 -1
- package/dist/chunk-T6L3USBZ.js.map +0 -1
- package/dist/chunk-TPF4MOMF.js.map +0 -1
- package/dist/chunk-VTFCTWSX.js.map +0 -1
- package/dist/chunk-VWNBB7FW.js +0 -104
- package/dist/chunk-VWNBB7FW.js.map +0 -1
- package/dist/chunk-WECSVHIM.js.map +0 -1
- package/dist/chunk-X7IPZPTG.js.map +0 -1
- package/dist/chunk-XJP45LFA.js.map +0 -1
- package/dist/chunk-ZBLTU67D.js.map +0 -1
- package/dist/chunk-ZQJD4YEJ.js.map +0 -1
- /package/dist/{chunk-5EA4IDUD.js.map → chunk-46BYUQ5A.js.map} +0 -0
- /package/dist/{chunk-XVKEM5JY.js.map → chunk-5QSTXIPG.js.map} +0 -0
- /package/dist/{chunk-GSCVG2ER.js.map → chunk-APJ5JGRW.js.map} +0 -0
- /package/dist/{chunk-NQKYHILD.js.map → chunk-DAH7RLW3.js.map} +0 -0
- /package/dist/{chunk-OB7LC6NJ.js.map → chunk-DJEZW7AC.js.map} +0 -0
- /package/dist/{chunk-HWWA27DN.js.map → chunk-KMCGX76Y.js.map} +0 -0
- /package/dist/{chunk-ZGAOMRYD.js.map → chunk-RWWRTURA.js.map} +0 -0
- /package/dist/{chunk-BTGCUONV.js.map → chunk-TCXKZDMR.js.map} +0 -0
|
@@ -0,0 +1,3134 @@
|
|
|
1
|
+
/* @atomic-ui/ui version 0.3.0, standalone. */
|
|
2
|
+
var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ci=Symbol(),Ii=new WeakMap,oe=class{constructor(t,i,s){if(this._$cssResult$=!0,s!==ci)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(ve&&t===void 0){let s=i!==void 0&&i.length===1;s&&(t=Ii.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Ii.set(i,t))}return t}toString(){return this.cssText}},H=o=>new oe(typeof o=="string"?o:o+"",void 0,ci),h=(o,...t)=>{let i=o.length===1?o[0]:t.reduce((s,n,d)=>s+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[d+1],o[0]);return new oe(i,o,ci)},Bi=(o,t)=>{if(ve)o.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of t){let s=document.createElement("style"),n=xe.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=i.cssText,o.appendChild(s)}},pi=ve?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let i="";for(let s of t.cssRules)i+=s.cssText;return H(i)})(o):o;var{is:gr,defineProperty:br,getOwnPropertyDescriptor:fr,getOwnPropertyNames:$r,getOwnPropertySymbols:yr,getPrototypeOf:xr}=Object,ke=globalThis,_i=ke.trustedTypes,vr=_i?_i.emptyScript:"",kr=ke.reactiveElementPolyfillSupport,le=(o,t)=>o,hi={toAttribute(o,t){switch(t){case Boolean:o=o?vr:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let i=o;switch(t){case Boolean:i=o!==null;break;case Number:i=o===null?null:Number(o);break;case Object:case Array:try{i=JSON.parse(o)}catch{i=null}}return i}},Ni=(o,t)=>!gr(o,t),Hi={attribute:!0,type:String,converter:hi,reflect:!1,useDefault:!1,hasChanged:Ni};Symbol.metadata??=Symbol("metadata"),ke.litPropertyMetadata??=new WeakMap;var j=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Hi){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,i);n!==void 0&&br(this.prototype,t,n)}}static getPropertyDescriptor(t,i,s){let{get:n,set:d}=fr(this.prototype,t)??{get(){return this[i]},set(p){this[i]=p}};return{get:n,set(p){let b=n?.call(this);d?.call(this,p),this.requestUpdate(t,b,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Hi}static _$Ei(){if(this.hasOwnProperty(le("elementProperties")))return;let t=xr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(le("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(le("properties"))){let i=this.properties,s=[...$r(i),...yr(i)];for(let n of s)this.createProperty(n,i[n])}let t=this[Symbol.metadata];if(t!==null){let i=litPropertyMetadata.get(t);if(i!==void 0)for(let[s,n]of i)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[i,s]of this.elementProperties){let n=this._$Eu(i,s);n!==void 0&&this._$Eh.set(n,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let i=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)i.unshift(pi(n))}else t!==void 0&&i.push(pi(t));return i}static _$Eu(t,i){let s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,i=this.constructor.elementProperties;for(let s of i.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bi(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$ET(t,i){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let d=(s.converter?.toAttribute!==void 0?s.converter:hi).toAttribute(i,s.type);this._$Em=t,d==null?this.removeAttribute(n):this.setAttribute(n,d),this._$Em=null}}_$AK(t,i){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let d=s.getPropertyOptions(n),p=typeof d.converter=="function"?{fromAttribute:d.converter}:d.converter?.fromAttribute!==void 0?d.converter:hi;this._$Em=n;let b=p.fromAttribute(i,d.type);this[n]=b??this._$Ej?.get(n)??b,this._$Em=null}}requestUpdate(t,i,s,n=!1,d){if(t!==void 0){let p=this.constructor;if(n===!1&&(d=this[t]),s??=p.getPropertyOptions(t),!((s.hasChanged??Ni)(d,i)||s.useDefault&&s.reflect&&d===this._$Ej?.get(t)&&!this.hasAttribute(p._$Eu(t,s))))return;this.C(t,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:s,reflect:n,wrapped:d},p){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,p??i??this[t]),d!==!0||p!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(i=void 0),this._$AL.set(t,i)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,d]of this._$Ep)this[n]=d;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,d]of s){let{wrapped:p}=d,b=this[n];p!==!0||this._$AL.has(n)||b===void 0||this.C(n,void 0,d,b)}}let t=!1,i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(i)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(t){}firstUpdated(t){}};j.elementStyles=[],j.shadowRootOptions={mode:"open"},j[le("elementProperties")]=new Map,j[le("finalized")]=new Map,kr?.({ReactiveElement:j}),(ke.reactiveElementVersions??=[]).push("2.1.2");var yi=globalThis,Pi=o=>o,we=yi.trustedTypes,Oi=we?we.createPolicy("lit-html",{createHTML:o=>o}):void 0,Ui="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,Vi="?"+D,wr=`<${Vi}>`,G=document,ce=()=>G.createComment(""),pe=o=>o===null||typeof o!="object"&&typeof o!="function",xi=Array.isArray,Sr=o=>xi(o)||typeof o?.[Symbol.iterator]=="function",ui=`[
|
|
3
|
+
\f\r]`,de=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ji=/-->/g,Fi=/>/g,K=RegExp(`>|${ui}(?:([^\\s"'>=/]+)(${ui}*=${ui}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Di=/'/g,qi=/"/g,Ki=/^(?:script|style|textarea|title)$/i,vi=o=>(t,...i)=>({_$litType$:o,strings:t,values:i}),a=vi(1),z=vi(2),Qr=vi(3),Y=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Wi=new WeakMap,X=G.createTreeWalker(G,129);function Xi(o,t){if(!xi(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Oi!==void 0?Oi.createHTML(t):t}var Tr=(o,t)=>{let i=o.length-1,s=[],n,d=t===2?"<svg>":t===3?"<math>":"",p=de;for(let b=0;b<i;b++){let y=o[b],x,v,M=-1,I=0;for(;I<y.length&&(p.lastIndex=I,v=p.exec(y),v!==null);)I=p.lastIndex,p===de?v[1]==="!--"?p=ji:v[1]!==void 0?p=Fi:v[2]!==void 0?(Ki.test(v[2])&&(n=RegExp("</"+v[2],"g")),p=K):v[3]!==void 0&&(p=K):p===K?v[0]===">"?(p=n??de,M=-1):v[1]===void 0?M=-2:(M=p.lastIndex-v[2].length,x=v[1],p=v[3]===void 0?K:v[3]==='"'?qi:Di):p===qi||p===Di?p=K:p===ji||p===Fi?p=de:(p=K,n=void 0);let N=p===K&&o[b+1].startsWith("/>")?" ":"";d+=p===de?y+wr:M>=0?(s.push(x),y.slice(0,M)+Ui+y.slice(M)+D+N):y+D+(M===-2?b:N)}return[Xi(o,d+(o[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},he=class o{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let d=0,p=0,b=t.length-1,y=this.parts,[x,v]=Tr(t,i);if(this.el=o.createElement(x,s),X.currentNode=this.el.content,i===2||i===3){let M=this.el.content.firstChild;M.replaceWith(...M.childNodes)}for(;(n=X.nextNode())!==null&&y.length<b;){if(n.nodeType===1){if(n.hasAttributes())for(let M of n.getAttributeNames())if(M.endsWith(Ui)){let I=v[p++],N=n.getAttribute(M).split(D),J=/([.?@])?(.*)/.exec(I);y.push({type:1,index:d,name:J[2],strings:N,ctor:J[1]==="."?gi:J[1]==="?"?bi:J[1]==="@"?fi:ie}),n.removeAttribute(M)}else M.startsWith(D)&&(y.push({type:6,index:d}),n.removeAttribute(M));if(Ki.test(n.tagName)){let M=n.textContent.split(D),I=M.length-1;if(I>0){n.textContent=we?we.emptyScript:"";for(let N=0;N<I;N++)n.append(M[N],ce()),X.nextNode(),y.push({type:2,index:++d});n.append(M[I],ce())}}}else if(n.nodeType===8)if(n.data===Vi)y.push({type:2,index:d});else{let M=-1;for(;(M=n.data.indexOf(D,M+1))!==-1;)y.push({type:7,index:d}),M+=D.length-1}d++}}static createElement(t,i){let s=G.createElement("template");return s.innerHTML=t,s}};function te(o,t,i=o,s){if(t===Y)return t;let n=s!==void 0?i._$Co?.[s]:i._$Cl,d=pe(t)?void 0:t._$litDirective$;return n?.constructor!==d&&(n?._$AO?.(!1),d===void 0?n=void 0:(n=new d(o),n._$AT(o,i,s)),s!==void 0?(i._$Co??=[])[s]=n:i._$Cl=n),n!==void 0&&(t=te(o,n._$AS(o,t.values),n,s)),t}var mi=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:s}=this._$AD,n=(t?.creationScope??G).importNode(i,!0);X.currentNode=n;let d=X.nextNode(),p=0,b=0,y=s[0];for(;y!==void 0;){if(p===y.index){let x;y.type===2?x=new ue(d,d.nextSibling,this,t):y.type===1?x=new y.ctor(d,y.name,y.strings,this,t):y.type===6&&(x=new $i(d,this,t)),this._$AV.push(x),y=s[++b]}p!==y?.index&&(d=X.nextNode(),p++)}return X.currentNode=G,n}p(t){let i=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}},ue=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,n){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=te(this,t,i),pe(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==Y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Sr(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&pe(this._$AH)?this._$AA.nextSibling.data=t:this.T(G.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=he.createElement(Xi(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(i);else{let d=new mi(n,this),p=d.u(this.options);d.p(i),this.T(p),this._$AH=d}}_$AC(t){let i=Wi.get(t.strings);return i===void 0&&Wi.set(t.strings,i=new he(t)),i}k(t){xi(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,n=0;for(let d of t)n===i.length?i.push(s=new o(this.O(ce()),this.O(ce()),this,this.options)):s=i[n],s._$AI(d),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let s=Pi(t).nextSibling;Pi(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,n,d){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=d,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=l}_$AI(t,i=this,s,n){let d=this.strings,p=!1;if(d===void 0)t=te(this,t,i,0),p=!pe(t)||t!==this._$AH&&t!==Y,p&&(this._$AH=t);else{let b=t,y,x;for(t=d[0],y=0;y<d.length-1;y++)x=te(this,b[s+y],i,y),x===Y&&(x=this._$AH[y]),p||=!pe(x)||x!==this._$AH[y],x===l?t=l:t!==l&&(t+=(x??"")+d[y+1]),this._$AH[y]=x}p&&!n&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},gi=class extends ie{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},bi=class extends ie{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},fi=class extends ie{constructor(t,i,s,n,d){super(t,i,s,n,d),this.type=5}_$AI(t,i=this){if((t=te(this,t,i,0)??l)===Y)return;let s=this._$AH,n=t===l&&s!==l||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,d=t!==l&&(s===l||n);n&&this.element.removeEventListener(this.name,this,s),d&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},$i=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){te(this,t)}};var zr=yi.litHtmlPolyfillSupport;zr?.(he,ue),(yi.litHtmlVersions??=[]).push("3.3.3");var Gi=(o,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(n===void 0){let d=i?.renderBefore??null;s._$litPart$=n=new ue(t.insertBefore(ce(),d),d,void 0,i??{})}return n._$AI(o),n};var ki=globalThis,q=class extends j{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Gi(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}};q._$litElement$=!0,q.finalized=!0,ki.litElementHydrateSupport?.({LitElement:q});var Ar=ki.litElementPolyfillSupport;Ar?.({LitElement:q});(ki.litElementVersions??=[]).push("4.2.2");var f=(o,t)=>H(`var(--impkt-${o.replace(/\./g,"-")}, ${t})`),e={brand:f("color.brand.default","#1f4ed8"),brandHover:f("color.brand.hover","#1b45be"),brandActive:f("color.brand.active","#183ba4"),brandSubtle:f("color.brand.subtle","#e4eafa"),onBrand:f("color.text.on-brand","#ffffff"),surfaceCard:f("color.surface.card","#ffffff"),surfaceInset:f("color.surface.inset","#f4f4f4"),surfaceSubtle:f("color.surface.subtle","#e4eafa"),text:f("color.text.default","#1a1a1a"),textMuted:f("color.text.muted","#717171"),textPlaceholder:f("color.text.placeholder","#767676"),textHeading:f("color.text.heading","#1f4ed8"),link:f("color.text.link","#1f4ed8"),linkHover:f("color.text.link-hover","#193ead"),border:f("color.border.default","#929292"),borderStrong:f("color.border.strong","#818181"),danger:f("color.status.danger.default","#c8102e"),dangerText:f("color.status.danger.text","#c8102e"),dangerSubtle:f("color.status.danger.subtle","#f8e2e6"),warning:f("color.status.warning.default","#b45309"),warningText:f("color.status.warning.text","#b45309"),warningSubtle:f("color.status.warning.subtle","#f6eae1"),success:f("color.status.success.default","#047857"),successText:f("color.status.success.text","#047857"),successSubtle:f("color.status.success.subtle","#e0f0ea"),info:f("color.status.info.default","#1f4ed8"),infoText:f("color.status.info.text","#1f4ed8"),infoSubtle:f("color.status.info.subtle","#e4eafa"),fontBody:f("font.family.body","system-ui, sans-serif"),fontHeading:f("font.family.heading","system-ui, sans-serif"),fontMono:f("font.family.mono","ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"),fontEyebrow:f("font.family.eyebrow","inherit"),focusShadow:f("focus.ring.shadow","0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a"),focusOffset:f("focus.ring.offset","2px"),targetMin:f("target.min","24px"),radiusSm:f("radius.sm","2px"),radius:f("radius.md","4px"),radiusLg:f("radius.lg","8px"),borderThin:f("border.width.thin","1px"),borderThick:f("border.width.thick","2px"),radiusXs:f("radius.xs","2px"),radiusXl:f("radius.xl","12px"),radius2xl:f("radius.2xl","16px"),hairline:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 10%, transparent)"),rule:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 15%, transparent)"),wash:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 5%, transparent)"),brandHalo:H("color-mix(in srgb, var(--impkt-color-brand-default, #1f4ed8) 22%, transparent)"),shadowXs:f("shadow.xs","0 1px 2px 0 rgb(0 0 0 / 0.05)"),shadowSm:f("shadow.sm","0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"),shadowMd:f("shadow.md","0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"),shadowLg:f("shadow.lg","0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"),shadowXl:f("shadow.xl","0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"),trackingTight:f("font.tracking.tight","-0.02em"),trackingWide:f("font.tracking.wide","0.06em")},m=o=>H(`font-size: var(--impkt-font-size-${o}, 1rem); line-height: var(--impkt-font-leading-${o}, 1.5);`),r=o=>f(`space.${String(o).replace(".","-")}`,`${o*4}px`),$=o=>f(`font.size.${o}`,"1rem"),C=o=>f(`font.line-height.${o}`,"1.5"),u=o=>f(`font.weight.${o}`,"400"),w=h`
|
|
5
|
+
:host([space-above='sm']) { margin-block-start: ${r(2)}; }
|
|
6
|
+
:host([space-above='md']) { margin-block-start: ${r(4)}; }
|
|
7
|
+
:host([space-above='lg']) { margin-block-start: ${r(6)}; }
|
|
8
|
+
:host([space-above='xl']) { margin-block-start: ${r(8)}; }
|
|
9
|
+
:host([space-above='2xl']) { margin-block-start: clamp(${r(14)}, 8vw, ${r(28)}); }
|
|
10
|
+
:host([space-below='sm']) { margin-block-end: ${r(2)}; }
|
|
11
|
+
:host([space-below='md']) { margin-block-end: ${r(4)}; }
|
|
12
|
+
:host([space-below='lg']) { margin-block-end: ${r(6)}; }
|
|
13
|
+
:host([space-below='xl']) { margin-block-end: ${r(8)}; }
|
|
14
|
+
:host([space-below='2xl']) { margin-block-end: clamp(${r(14)}, 8vw, ${r(28)}); }
|
|
15
|
+
`;var k=h`
|
|
16
|
+
:host(:focus-visible),
|
|
17
|
+
:host(:not([disabled])) :focus-visible {
|
|
18
|
+
outline: 2px solid transparent;
|
|
19
|
+
outline-offset: ${e.focusOffset};
|
|
20
|
+
box-shadow: ${e.focusShadow};
|
|
21
|
+
}
|
|
22
|
+
`,A=h`
|
|
23
|
+
min-block-size: ${e.targetMin};
|
|
24
|
+
min-inline-size: ${e.targetMin};
|
|
25
|
+
`,E=h`
|
|
26
|
+
position: absolute;
|
|
27
|
+
inline-size: 1px;
|
|
28
|
+
block-size: 1px;
|
|
29
|
+
margin: -1px;
|
|
30
|
+
padding: 0;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
clip-path: inset(50%);
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
border: 0;
|
|
35
|
+
`,Yi=h`
|
|
36
|
+
@media (prefers-reduced-motion: reduce) {
|
|
37
|
+
:host,
|
|
38
|
+
:host *,
|
|
39
|
+
:host *::before,
|
|
40
|
+
:host *::after {
|
|
41
|
+
animation-duration: 0.01ms !important;
|
|
42
|
+
animation-iteration-count: 1 !important;
|
|
43
|
+
transition-duration: 0.01ms !important;
|
|
44
|
+
scroll-behavior: auto !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,Qi=h`
|
|
48
|
+
:host {
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
font-family: ${e.fontBody};
|
|
51
|
+
color: ${e.text};
|
|
52
|
+
}
|
|
53
|
+
:host([hidden]) {
|
|
54
|
+
display: none !important;
|
|
55
|
+
}
|
|
56
|
+
*,
|
|
57
|
+
*::before,
|
|
58
|
+
*::after {
|
|
59
|
+
box-sizing: inherit;
|
|
60
|
+
}
|
|
61
|
+
`,R=o=>H(`@media (pointer: coarse) { :host :is(${o}) { min-block-size: 44px; min-inline-size: 44px; } }`);var Mr=Symbol.for("strata.wording");function g(o,t){let s=globalThis[Mr]?.words?.[o],n=typeof s=="string"&&s.trim()?s:o;return t?n.replace(/\{(\w+)\}/g,(d,p)=>p in t?String(t[p]):d):n}var Er=0,c=class extends q{constructor(){super(...arguments);this.uid=`impkt-${Er+=1}`}static{this.styles=[Qi,Yi,h``]}id_(i){return`${this.uid}-${i}`}connectedCallback(){super.connectedCallback(),this.sayDefaults()}sayDefaults(){let i=this.constructor.elementProperties,s=this;for(let n of i.keys()){let d=s[n];if(typeof d!="string"||!d)continue;let p=g(d);p!==d&&(s[n]=p)}}};var wi={"arrow-right":z`<path d="M5 12h14M13 6l6 6-6 6"/>`,"arrow-left":z`<path d="M19 12H5M11 6l-6 6 6 6"/>`,"chevron-right":z`<path d="M9 6l6 6-6 6"/>`,"chevron-down":z`<path d="M6 9l6 6 6-6"/>`,check:z`<path d="M5 12.5l4.5 4.5L19 7"/>`,close:z`<path d="M6 6l12 12M18 6L6 18"/>`,menu:z`<path d="M4 7h16M4 12h16M4 17h16"/>`,"menu-two":z`<path d="M5 9.5h14M5 14.5h14"/>`,plus:z`<path d="M12 5v14M5 12h14"/>`,minus:z`<path d="M5 12h14"/>`,search:z`<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>`,external:z`<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>`,download:z`<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>`,home:z`<path d="M4 11l8-7 8 7M6 9.5V20h12V9.5"/><path d="M10 20v-6h4v6"/>`,phone:z`<path d="M7 3.5h3l1.5 4-2 1.5a11 11 0 0 0 5.5 5.5l1.5-2 4 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 5 5.5a2 2 0 0 1 2-2z"/>`,mail:z`<rect x="3.5" y="5.5" width="17" height="13" rx="1.5"/><path d="M4 7l8 6 8-6"/>`,"map-pin":z`<path d="M12 21s-6.5-6-6.5-11a6.5 6.5 0 0 1 13 0c0 5-6.5 11-6.5 11z"/><circle cx="12" cy="10" r="2.5"/>`,calendar:z`<rect x="4" y="5.5" width="16" height="14.5" rx="1.5"/><path d="M4 10h16M8.5 3.5v4M15.5 3.5v4"/>`,clock:z`<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>`,user:z`<circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/>`,star:z`<path d="M12 4l2.4 5 5.4.6-4 3.7 1.1 5.4L12 16l-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z"/>`,heart:z`<path d="M12 19.5s-7.5-4.6-7.5-10A4 4 0 0 1 12 7a4 4 0 0 1 7.5 2.5c0 5.4-7.5 10-7.5 10z"/>`,shield:z`<path d="M12 3.5l7 2.5v5.5c0 4.5-3 7.8-7 9-4-1.2-7-4.5-7-9V6z"/><path d="M9 12l2 2 4-4"/>`,leaf:z`<path d="M5 19c0-8 5-13 14-14 0 9-5 14-13 14z"/><path d="M5 19l7-7"/>`,sun:z`<circle cx="12" cy="12" r="3.5"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6L7 7M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4"/>`,bolt:z`<path d="M13 3L5 13.5h6L10 21l8-10.5h-6z"/>`,key:z`<circle cx="8" cy="15" r="3.5"/><path d="M10.5 12.5L19 4M16 7l2.5 2.5M14 9l2 2"/>`,info:z`<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.5v.5"/>`,warning:z`<path d="M12 4l9 15.5H3z"/><path d="M12 10v4M12 16.5v.5"/>`,document:z`<path d="M6 3.5h8l4 4V20a.5.5 0 0 1-.5.5h-11A.5.5 0 0 1 6 20z"/><path d="M14 3.5V8h4M9 13h6M9 16.5h6"/>`,pound:z`<path d="M16 6.5a3.5 3.5 0 0 0-6.5 1.8V20M7 13h7M7 20h10"/>`,chat:z`<path d="M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z"/>`},Lr=Object.keys(wi);function S(o,t="1.25em"){let i=o?wi[o]:void 0;return i?a`<svg class="icon" viewBox="0 0 24 24" width=${t} height=${t} fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${i}</svg>`:l}var Se=class extends c{static{this.properties={name:{type:String,reflect:!0},label:{type:String},size:{type:String,reflect:!0},tone:{type:String,reflect:!0}}}constructor(){super(),this.name="star",this.label="",this.size="md",this.tone="inherit"}static{this.styles=[...c.styles,h`
|
|
62
|
+
:host { display: inline-flex; vertical-align: middle; line-height: 0; }
|
|
63
|
+
:host([tone='brand']) { color: ${e.brand}; }
|
|
64
|
+
:host([tone='muted']) { color: ${e.textMuted}; }
|
|
65
|
+
@media (forced-colors: active) { :host { color: CanvasText; } }
|
|
66
|
+
`]}render(){let t={sm:"16px",md:"24px",lg:"32px",xl:"48px"}[this.size]??"24px",i=S(this.name,t);return this.label?a`<span role="img" aria-label=${this.label}>${i}</span>`:a`${i}`}};customElements.define("impkt-icon",Se);var Te=class extends c{constructor(){super();this.internals=null;this.hideOn="never",this.variant="primary",this.type="button",this.disabled=!1,this.busy=!1,this.busyLabel="Working",this.full=!1,this.fullOnPhone=!1,this.size="md",this.iconBefore="none",this.iconAfter="none",this.href="";try{this.internals=this.attachInternals()}catch{this.internals=null}}static{this.formAssociated=!0}static{this.properties={hideOn:{type:String,reflect:!0,attribute:"hide-on"},variant:{type:String,reflect:!0},type:{type:String},disabled:{type:Boolean,reflect:!0},busy:{type:Boolean,reflect:!0},busyLabel:{type:String,attribute:"busy-label"},full:{type:Boolean,reflect:!0},fullOnPhone:{type:Boolean,attribute:"full-on-phone",reflect:!0},size:{type:String,reflect:!0},iconBefore:{type:String,attribute:"icon-before"},iconAfter:{type:String,attribute:"icon-after"},href:{type:String}}}static{this.styles=[...c.styles,k,R("button, a"),h`
|
|
67
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
68
|
+
:host {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
}
|
|
71
|
+
:host([full]) {
|
|
72
|
+
display: block;
|
|
73
|
+
}
|
|
74
|
+
@media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }
|
|
75
|
+
button, a {
|
|
76
|
+
${A}
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
gap: ${r(2)};
|
|
83
|
+
inline-size: 100%;
|
|
84
|
+
min-block-size: 40px;
|
|
85
|
+
padding: ${r(2)} ${r(4)};
|
|
86
|
+
font-family: inherit;
|
|
87
|
+
${m("sm")}
|
|
88
|
+
font-weight: ${u("semibold")};
|
|
89
|
+
border-radius: ${e.radiusLg};
|
|
90
|
+
border: ${e.borderThin} solid transparent;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
93
|
+
}
|
|
94
|
+
:host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${r(1)} ${r(3)}; ${m("sm")} gap: ${r(1.5)}; }
|
|
95
|
+
:host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${r(3)} ${r(6)}; ${m("md")} }
|
|
96
|
+
.icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }
|
|
97
|
+
/* The cursor is the only thing that changes while busy. Moving or
|
|
98
|
+
recolouring a control the moment it is pressed is how a user loses it. */
|
|
99
|
+
button[aria-disabled='true'] {
|
|
100
|
+
cursor: progress;
|
|
101
|
+
}
|
|
102
|
+
:host([disabled]) button {
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
opacity: 0.5;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Solid: the brand, with a hairline highlight along the top edge. */
|
|
108
|
+
.primary {
|
|
109
|
+
background: ${e.brand};
|
|
110
|
+
color: ${e.onBrand};
|
|
111
|
+
box-shadow: ${e.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);
|
|
112
|
+
}
|
|
113
|
+
.primary:hover:not([aria-disabled='true']) {
|
|
114
|
+
background: var(--impkt-color-action-hover, ${e.brandHover});
|
|
115
|
+
color: var(--impkt-color-action-on-hover, ${e.onBrand});
|
|
116
|
+
}
|
|
117
|
+
/* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */
|
|
118
|
+
.after { transition: transform 160ms ease-out; }
|
|
119
|
+
:is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impkt-motion-button-turn, 0deg)); }
|
|
120
|
+
@media (prefers-reduced-motion: reduce) { .after { transition: none; } }
|
|
121
|
+
.primary:active:not([aria-disabled='true']) {
|
|
122
|
+
background: ${e.brandActive};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Outline: the card, a hairline border and the text colour, for the second choice. */
|
|
126
|
+
.secondary {
|
|
127
|
+
background: ${e.surfaceCard};
|
|
128
|
+
color: ${e.text};
|
|
129
|
+
border-color: ${e.rule};
|
|
130
|
+
box-shadow: ${e.shadowXs};
|
|
131
|
+
}
|
|
132
|
+
.secondary:hover:not([aria-disabled='true']) {
|
|
133
|
+
background: color-mix(in srgb, ${e.surfaceCard}, ${e.text} 4%);
|
|
134
|
+
border-color: color-mix(in srgb, ${e.text} 25%, transparent);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Plain: words only until it is pointed at. */
|
|
138
|
+
.ghost {
|
|
139
|
+
background: transparent;
|
|
140
|
+
color: ${e.link};
|
|
141
|
+
}
|
|
142
|
+
.ghost:hover:not([aria-disabled='true']) {
|
|
143
|
+
background: ${e.wash};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.sr-only {
|
|
147
|
+
${E}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Windows High Contrast Mode drops background and border colours, so a
|
|
151
|
+
button styled only by background becomes invisible. A forced-colors
|
|
152
|
+
border puts the boundary back. */
|
|
153
|
+
@media (forced-colors: active) {
|
|
154
|
+
button, a {
|
|
155
|
+
border-color: ButtonBorder;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
`]}onClick(i){if(this.disabled||this.busy){i.preventDefault(),i.stopImmediatePropagation();return}this.type==="submit"&&this.internals?.form?.requestSubmit(),this.type==="reset"&&this.internals?.form?.reset()}render(){let i=a`${S(this.iconBefore)}<slot></slot>${this.iconAfter&&this.iconAfter!=="none"?a`<span class="after" aria-hidden="true">${S(this.iconAfter)}</span>`:l}`;return this.href&&!this.disabled?a`<a class=${this.variant} href=${this.href} part="button">${i}</a>`:a`
|
|
159
|
+
<button
|
|
160
|
+
class=${this.variant}
|
|
161
|
+
type="button"
|
|
162
|
+
part="button"
|
|
163
|
+
?disabled=${this.disabled}
|
|
164
|
+
aria-disabled=${this.busy?"true":l}
|
|
165
|
+
aria-busy=${this.busy?"true":l}
|
|
166
|
+
@click=${this.onClick}
|
|
167
|
+
>
|
|
168
|
+
${i}
|
|
169
|
+
${this.busy?a`<span class="sr-only">${this.busyLabel}</span>`:l}
|
|
170
|
+
</button>
|
|
171
|
+
`}};customElements.define("impkt-button",Te);var F=h`
|
|
172
|
+
:host { --impkt-field-width: 100%; }
|
|
173
|
+
:host([width='xs']) { --impkt-field-width: 8ch; }
|
|
174
|
+
:host([width='sm']) { --impkt-field-width: 14ch; }
|
|
175
|
+
:host([width='md']) { --impkt-field-width: 24ch; }
|
|
176
|
+
:host([width='lg']) { --impkt-field-width: 40ch; }
|
|
177
|
+
`,T=class extends c{constructor(){super();this.internals=null;this.label="",this.name="",this.value="",this.description="",this.error="",this.required=!1,this.disabled=!1,this.readonly=!1,this.requiredText="required";try{this.internals=this.attachInternals()}catch{this.internals=null}}static{this.formAssociated=!0}static{this.properties={label:{type:String},name:{type:String},value:{type:String},description:{type:String},error:{type:String},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},requiredText:{type:String,attribute:"required-text"}}}static{this.styles=[...c.styles,k,h`
|
|
178
|
+
:host {
|
|
179
|
+
display: block;
|
|
180
|
+
margin-block-end: ${r(4)};
|
|
181
|
+
}
|
|
182
|
+
.label {
|
|
183
|
+
display: block;
|
|
184
|
+
font-size: ${$("sm")};
|
|
185
|
+
font-weight: ${u("semibold")};
|
|
186
|
+
line-height: ${C("normal")};
|
|
187
|
+
margin-block-end: ${r(1)};
|
|
188
|
+
color: ${e.text};
|
|
189
|
+
}
|
|
190
|
+
.required {
|
|
191
|
+
font-weight: ${u("regular")};
|
|
192
|
+
color: ${e.textMuted};
|
|
193
|
+
}
|
|
194
|
+
.description {
|
|
195
|
+
font-size: ${$("sm")};
|
|
196
|
+
line-height: ${C("normal")};
|
|
197
|
+
color: ${e.textMuted};
|
|
198
|
+
margin-block-end: ${r(2)};
|
|
199
|
+
}
|
|
200
|
+
.error {
|
|
201
|
+
font-size: ${$("sm")};
|
|
202
|
+
line-height: ${C("normal")};
|
|
203
|
+
color: ${e.dangerText};
|
|
204
|
+
margin-block-start: ${r(1)};
|
|
205
|
+
display: flex;
|
|
206
|
+
gap: ${r(1)};
|
|
207
|
+
}
|
|
208
|
+
.error:empty {
|
|
209
|
+
display: none;
|
|
210
|
+
}
|
|
211
|
+
.visually-hidden {
|
|
212
|
+
${E}
|
|
213
|
+
}
|
|
214
|
+
:host([disabled]) {
|
|
215
|
+
opacity: 0.6;
|
|
216
|
+
}
|
|
217
|
+
`]}get controlId(){return this.id_("control")}get describedBy(){let i=[this.description?this.id_("description"):"",this.error?this.id_("error"):""].filter(Boolean);return i.length?i.join(" "):l}focus(i){let s=this.renderRoot?.querySelector(`#${this.controlId}`)??this.renderRoot?.querySelector("input, select, textarea, button");s?s.focus(i):super.focus(i)}renderLabel(){return a`
|
|
218
|
+
<label class="label" for=${this.controlId} part="label">
|
|
219
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
220
|
+
</label>
|
|
221
|
+
`}render(){return a`
|
|
222
|
+
${this.renderLabel()}
|
|
223
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">
|
|
224
|
+
${this.description}
|
|
225
|
+
</div>`:l}
|
|
226
|
+
${this.renderControl()}
|
|
227
|
+
<!--
|
|
228
|
+
The error region is always present, even when empty. A live region
|
|
229
|
+
inserted at the same moment as its content is announced unreliably
|
|
230
|
+
across screen readers; one that already exists and is then filled is
|
|
231
|
+
announced consistently. "polite" rather than "assertive" because a
|
|
232
|
+
validation message should not interrupt what is being read.
|
|
233
|
+
-->
|
|
234
|
+
<div
|
|
235
|
+
class="error"
|
|
236
|
+
id=${this.id_("error")}
|
|
237
|
+
part="error"
|
|
238
|
+
aria-live="polite"
|
|
239
|
+
>
|
|
240
|
+
${this.error||l}
|
|
241
|
+
</div>
|
|
242
|
+
`}setFormValue(i){this.value=i,this.internals?.setFormValue(i),this.dispatchEvent(new CustomEvent("impkt-change",{detail:{value:i},bubbles:!0,composed:!0}))}};var ze=class extends T{static{this.properties={...T.properties,width:{type:String,reflect:!0},type:{type:String},placeholder:{type:String},autocomplete:{type:String},inputmode:{type:String},maxlength:{type:Number}}}constructor(){super(),this.width="full",this.type="text",this.placeholder="",this.autocomplete="",this.inputmode="",this.maxlength=void 0}static{this.styles=[...T.styles,F,h`
|
|
243
|
+
input {
|
|
244
|
+
inline-size: min(100%, var(--impkt-field-width));
|
|
245
|
+
min-block-size: 44px;
|
|
246
|
+
padding: ${r(2.5)} ${r(3)};
|
|
247
|
+
font-family: inherit;
|
|
248
|
+
font-size: ${$("md")};
|
|
249
|
+
color: ${e.text};
|
|
250
|
+
background: var(--impkt-color-field-surface, ${e.surfaceCard});
|
|
251
|
+
border: ${e.borderThin} solid ${e.border};
|
|
252
|
+
border-radius: ${e.radiusLg};
|
|
253
|
+
box-shadow: var(--impkt-shadow-field, ${e.shadowXs});
|
|
254
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
255
|
+
}
|
|
256
|
+
input:hover:not(:disabled) {
|
|
257
|
+
border-color: ${e.borderStrong};
|
|
258
|
+
}
|
|
259
|
+
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
260
|
+
input:focus-visible {
|
|
261
|
+
border-color: ${e.brand};
|
|
262
|
+
box-shadow: ${e.focusShadow}, 0 0 0 6px ${e.brandHalo};
|
|
263
|
+
}
|
|
264
|
+
input::placeholder {
|
|
265
|
+
color: ${e.textPlaceholder};
|
|
266
|
+
}
|
|
267
|
+
input:disabled {
|
|
268
|
+
background: ${e.surfaceInset};
|
|
269
|
+
cursor: not-allowed;
|
|
270
|
+
}
|
|
271
|
+
/* The border thickens as well as reddening. Colour alone would carry the
|
|
272
|
+
error, which 1.4.1 forbids — and the message below says it in words. */
|
|
273
|
+
:host([invalid]) input {
|
|
274
|
+
border-color: ${e.danger};
|
|
275
|
+
border-width: ${e.borderThick};
|
|
276
|
+
}
|
|
277
|
+
`]}renderControl(){return a`
|
|
278
|
+
<input
|
|
279
|
+
id=${this.controlId}
|
|
280
|
+
part="input"
|
|
281
|
+
type=${this.type}
|
|
282
|
+
name=${this.name||l}
|
|
283
|
+
.value=${this.value}
|
|
284
|
+
placeholder=${this.placeholder||l}
|
|
285
|
+
autocomplete=${this.autocomplete||l}
|
|
286
|
+
inputmode=${this.inputmode||l}
|
|
287
|
+
maxlength=${this.maxlength??l}
|
|
288
|
+
?disabled=${this.disabled}
|
|
289
|
+
?readonly=${this.readonly}
|
|
290
|
+
?required=${this.required}
|
|
291
|
+
aria-describedby=${this.describedBy}
|
|
292
|
+
aria-invalid=${this.error?"true":l}
|
|
293
|
+
@input=${t=>this.setFormValue(t.target.value)}
|
|
294
|
+
/>
|
|
295
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-text-input",ze);var Ae=class extends T{static{this.properties={...T.properties,width:{type:String,reflect:!0},options:{type:Array},placeholder:{type:String}}}constructor(){super(),this.width="full",this.options=[],this.placeholder="Choose an option"}static{this.styles=[...T.styles,F,h`
|
|
296
|
+
select {
|
|
297
|
+
inline-size: min(100%, var(--impkt-field-width));
|
|
298
|
+
min-block-size: 44px;
|
|
299
|
+
padding: ${r(2.5)} ${r(3)};
|
|
300
|
+
font-family: inherit;
|
|
301
|
+
font-size: ${$("md")};
|
|
302
|
+
color: ${e.text};
|
|
303
|
+
background: var(--impkt-color-field-surface, ${e.surfaceCard});
|
|
304
|
+
border: ${e.borderThin} solid ${e.border};
|
|
305
|
+
border-radius: ${e.radiusLg};
|
|
306
|
+
box-shadow: var(--impkt-shadow-field, ${e.shadowXs});
|
|
307
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
308
|
+
}
|
|
309
|
+
select:hover:not(:disabled) {
|
|
310
|
+
border-color: ${e.borderStrong};
|
|
311
|
+
}
|
|
312
|
+
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
313
|
+
select:focus-visible {
|
|
314
|
+
border-color: ${e.brand};
|
|
315
|
+
box-shadow: ${e.focusShadow}, 0 0 0 6px ${e.brandHalo};
|
|
316
|
+
}
|
|
317
|
+
select:disabled {
|
|
318
|
+
background: ${e.surfaceInset};
|
|
319
|
+
cursor: not-allowed;
|
|
320
|
+
}
|
|
321
|
+
:host([invalid]) select {
|
|
322
|
+
border-color: ${e.danger};
|
|
323
|
+
border-width: ${e.borderThick};
|
|
324
|
+
}
|
|
325
|
+
`]}renderControl(){return a`
|
|
326
|
+
<select
|
|
327
|
+
id=${this.controlId}
|
|
328
|
+
part="select"
|
|
329
|
+
name=${this.name||l}
|
|
330
|
+
?disabled=${this.disabled}
|
|
331
|
+
?required=${this.required}
|
|
332
|
+
aria-describedby=${this.describedBy}
|
|
333
|
+
aria-invalid=${this.error?"true":l}
|
|
334
|
+
@change=${t=>this.setFormValue(t.target.value)}
|
|
335
|
+
>
|
|
336
|
+
<option value="" ?selected=${!this.value}>${this.placeholder}</option>
|
|
337
|
+
${this.options.map(t=>a`<option value=${t.value} ?selected=${this.value===t.value}>${t.label}</option>`)}
|
|
338
|
+
</select>
|
|
339
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-select",Ae);var Me=class extends T{static{this.properties={...T.properties,checked:{type:Boolean,reflect:!0}}}constructor(){super(),this.checked=!1}static{this.styles=[...T.styles,R(".row"),h`
|
|
340
|
+
.row {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: flex-start;
|
|
343
|
+
gap: ${r(3)};
|
|
344
|
+
cursor: pointer;
|
|
345
|
+
}
|
|
346
|
+
input {
|
|
347
|
+
${A}
|
|
348
|
+
inline-size: 20px;
|
|
349
|
+
block-size: 20px;
|
|
350
|
+
margin: 0;
|
|
351
|
+
flex: none;
|
|
352
|
+
accent-color: ${e.brand};
|
|
353
|
+
}
|
|
354
|
+
.text {
|
|
355
|
+
font-size: ${$("md")};
|
|
356
|
+
}
|
|
357
|
+
:host([invalid]) .row {
|
|
358
|
+
color: ${e.dangerText};
|
|
359
|
+
}
|
|
360
|
+
`]}renderControl(){return a`
|
|
361
|
+
<label class="row" part="row" for=${this.controlId}>
|
|
362
|
+
<input
|
|
363
|
+
type="checkbox"
|
|
364
|
+
id=${this.controlId}
|
|
365
|
+
part="input"
|
|
366
|
+
name=${this.name||l}
|
|
367
|
+
.checked=${this.checked}
|
|
368
|
+
?disabled=${this.disabled}
|
|
369
|
+
?required=${this.required}
|
|
370
|
+
aria-describedby=${this.describedBy}
|
|
371
|
+
aria-invalid=${this.error?"true":l}
|
|
372
|
+
@change=${t=>{this.checked=t.target.checked,this.setFormValue(this.checked?"on":"")}}
|
|
373
|
+
/>
|
|
374
|
+
<span class="text">
|
|
375
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
376
|
+
</span>
|
|
377
|
+
</label>
|
|
378
|
+
`}renderLabel(){return a`${l}`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-checkbox",Me);var Ee=class extends T{static{this.properties={...T.properties,options:{type:Array}}}constructor(){super(),this.options=[]}static{this.styles=[...T.styles,h`
|
|
379
|
+
fieldset {
|
|
380
|
+
border: 0;
|
|
381
|
+
margin: 0;
|
|
382
|
+
padding: 0;
|
|
383
|
+
min-inline-size: 0;
|
|
384
|
+
}
|
|
385
|
+
legend {
|
|
386
|
+
padding: 0;
|
|
387
|
+
}
|
|
388
|
+
.option {
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: flex-start;
|
|
391
|
+
gap: ${r(3)};
|
|
392
|
+
padding: ${r(3)};
|
|
393
|
+
border: ${e.borderThin} solid ${e.border};
|
|
394
|
+
border-radius: ${e.radius};
|
|
395
|
+
margin-block-end: ${r(2)};
|
|
396
|
+
cursor: pointer;
|
|
397
|
+
}
|
|
398
|
+
.option:hover {
|
|
399
|
+
background: ${e.surfaceSubtle};
|
|
400
|
+
}
|
|
401
|
+
/* The whole row is the target, not the 20px dot — 2.5.8 is a floor and
|
|
402
|
+
a comfortable target is the actual goal. */
|
|
403
|
+
.option input {
|
|
404
|
+
${A}
|
|
405
|
+
inline-size: 20px;
|
|
406
|
+
block-size: 20px;
|
|
407
|
+
margin: 0;
|
|
408
|
+
flex: none;
|
|
409
|
+
accent-color: ${e.brand};
|
|
410
|
+
}
|
|
411
|
+
.option-text {
|
|
412
|
+
display: block;
|
|
413
|
+
font-size: ${$("md")};
|
|
414
|
+
}
|
|
415
|
+
.option-description {
|
|
416
|
+
display: block;
|
|
417
|
+
font-size: ${$("sm")};
|
|
418
|
+
color: ${e.textMuted};
|
|
419
|
+
margin-block-start: ${r(1)};
|
|
420
|
+
}
|
|
421
|
+
:host([invalid]) .option {
|
|
422
|
+
border-color: ${e.danger};
|
|
423
|
+
}
|
|
424
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
425
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
426
|
+
</legend>`}renderControl(){return a`
|
|
427
|
+
${this.options.map((t,i)=>{let s=this.id_(`opt-${i}`),n=t.description?this.id_(`opt-${i}-desc`):void 0;return a`
|
|
428
|
+
<label class="option" part="option" for=${s}>
|
|
429
|
+
<input
|
|
430
|
+
type="radio"
|
|
431
|
+
id=${s}
|
|
432
|
+
name=${this.uid}
|
|
433
|
+
value=${t.value}
|
|
434
|
+
.checked=${this.value===t.value}
|
|
435
|
+
?disabled=${this.disabled}
|
|
436
|
+
?required=${this.required&&i===0}
|
|
437
|
+
aria-describedby=${n??l}
|
|
438
|
+
@change=${()=>this.setFormValue(t.value)}
|
|
439
|
+
/>
|
|
440
|
+
<span>
|
|
441
|
+
<span class="option-text">${t.label}</span>
|
|
442
|
+
${t.description?a`<span class="option-description" id=${n}>${t.description}</span>`:l}
|
|
443
|
+
</span>
|
|
444
|
+
</label>
|
|
445
|
+
`})}
|
|
446
|
+
`}render(){return a`
|
|
447
|
+
<fieldset
|
|
448
|
+
part="fieldset"
|
|
449
|
+
aria-describedby=${this.describedBy}
|
|
450
|
+
aria-invalid=${this.error?"true":l}
|
|
451
|
+
>
|
|
452
|
+
${this.renderLabel()}
|
|
453
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">
|
|
454
|
+
${this.description}
|
|
455
|
+
</div>`:l}
|
|
456
|
+
${this.renderControl()}
|
|
457
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">
|
|
458
|
+
${this.error||l}
|
|
459
|
+
</div>
|
|
460
|
+
</fieldset>
|
|
461
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-radio-group",Ee);var Le=class o extends c{static{this.properties={tone:{type:String,reflect:!0},heading:{type:String},toneLabel:{type:String,attribute:"tone-label"}}}constructor(){super(),this.tone="info",this.heading="",this.toneLabel=""}static{this.TONE_WORDS={info:"Information",success:"Success",warning:"Warning",danger:"Error"}}static{this.styles=[...c.styles,h`
|
|
462
|
+
:host {
|
|
463
|
+
display: block;
|
|
464
|
+
margin-block-end: ${r(4)};
|
|
465
|
+
}
|
|
466
|
+
.alert {
|
|
467
|
+
padding: ${r(4)} ${r(5)};
|
|
468
|
+
border-radius: ${e.radiusLg};
|
|
469
|
+
border-inline-start: 4px solid;
|
|
470
|
+
box-shadow: inset 0 0 0 1px ${e.hairline};
|
|
471
|
+
font-size: ${$("sm")};
|
|
472
|
+
line-height: 1.5;
|
|
473
|
+
}
|
|
474
|
+
.heading {
|
|
475
|
+
font-weight: ${u("semibold")};
|
|
476
|
+
margin-block-end: ${r(1)};
|
|
477
|
+
}
|
|
478
|
+
:host([tone='info']) .alert {
|
|
479
|
+
background: ${e.infoSubtle};
|
|
480
|
+
border-color: ${e.info};
|
|
481
|
+
color: ${e.text};
|
|
482
|
+
}
|
|
483
|
+
:host([tone='success']) .alert {
|
|
484
|
+
background: ${e.successSubtle};
|
|
485
|
+
border-color: ${e.success};
|
|
486
|
+
color: ${e.text};
|
|
487
|
+
}
|
|
488
|
+
:host([tone='warning']) .alert {
|
|
489
|
+
background: ${e.warningSubtle};
|
|
490
|
+
border-color: ${e.warning};
|
|
491
|
+
color: ${e.text};
|
|
492
|
+
}
|
|
493
|
+
:host([tone='danger']) .alert {
|
|
494
|
+
background: ${e.dangerSubtle};
|
|
495
|
+
border-color: ${e.danger};
|
|
496
|
+
color: ${e.text};
|
|
497
|
+
}
|
|
498
|
+
/* Colour is the only signal left in forced-colours mode, and it is gone.
|
|
499
|
+
The border keeps the boundary; the tone word in the label carries the
|
|
500
|
+
meaning. */
|
|
501
|
+
@media (forced-colors: active) {
|
|
502
|
+
.alert {
|
|
503
|
+
border: 1px solid CanvasText;
|
|
504
|
+
border-inline-start-width: 4px;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
`]}render(){let t=this.toneLabel||g(o.TONE_WORDS[this.tone]);return a`
|
|
508
|
+
<div
|
|
509
|
+
class="alert"
|
|
510
|
+
part="alert"
|
|
511
|
+
role=${this.tone==="danger"?"alert":"status"}
|
|
512
|
+
aria-label=${this.heading?l:t}
|
|
513
|
+
>
|
|
514
|
+
${this.heading?a`<div class="heading" part="heading">
|
|
515
|
+
<span class="tone-word">${t}:</span> ${this.heading}
|
|
516
|
+
</div>`:l}
|
|
517
|
+
<slot></slot>
|
|
518
|
+
</div>
|
|
519
|
+
`}};customElements.define("impkt-alert",Le);var Ce=class extends c{static{this.properties={gap:{type:String,reflect:!0},align:{type:String,reflect:!0},direction:{type:String,reflect:!0},justify:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.gap="md",this.align="stretch",this.direction="vertical",this.justify="start",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
520
|
+
:host {
|
|
521
|
+
display: flex;
|
|
522
|
+
flex-direction: column;
|
|
523
|
+
}
|
|
524
|
+
:host([gap='none']) { gap: 0; }
|
|
525
|
+
:host([gap='xs']) { gap: ${r(1)}; }
|
|
526
|
+
:host([align='start']) { align-items: flex-start; }
|
|
527
|
+
:host([align='center']) { align-items: center; text-align: center; }
|
|
528
|
+
:host([align='end']) { align-items: flex-end; }
|
|
529
|
+
:host([direction='horizontal']) { flex-direction: row; flex-wrap: wrap; align-items: center; }
|
|
530
|
+
:host([direction='horizontal'][align='start']) { align-items: flex-start; }
|
|
531
|
+
:host([direction='horizontal'][align='end']) { align-items: flex-end; }
|
|
532
|
+
:host([direction='horizontal'][align='center']) { text-align: start; }
|
|
533
|
+
:host([justify='center']) { justify-content: center; }
|
|
534
|
+
:host([justify='end']) { justify-content: flex-end; }
|
|
535
|
+
:host([justify='between']) { justify-content: space-between; }
|
|
536
|
+
:host([gap='sm']) { gap: ${r(2)}; }
|
|
537
|
+
:host([gap='md']) { gap: ${r(4)}; }
|
|
538
|
+
:host([gap='lg']) { gap: ${r(6)}; }
|
|
539
|
+
:host([gap='xl']) { gap: ${r(8)}; }
|
|
540
|
+
`]}render(){return a`<slot></slot>`}},Re=class extends c{static{this.properties={tone:{type:String,reflect:!0},padding:{type:String,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},ratio:{type:String,reflect:!0},badge:{type:String},raised:{type:Boolean,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.tone="default",this.padding="lg",this.imageSrc="",this.imageAlt="",this.ratio="16:9",this.badge="",this.raised=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
541
|
+
:host {
|
|
542
|
+
display: flex;
|
|
543
|
+
flex-direction: column;
|
|
544
|
+
background: ${e.surfaceCard};
|
|
545
|
+
border: ${e.borderThin} solid ${e.hairline};
|
|
546
|
+
border-radius: ${e.radiusXl};
|
|
547
|
+
box-shadow: ${e.shadowSm};
|
|
548
|
+
overflow: hidden;
|
|
549
|
+
--ratio: 16 / 9;
|
|
550
|
+
}
|
|
551
|
+
:host([tone='subtle']) { background: ${e.surfaceSubtle}; border-color: transparent; box-shadow: none; }
|
|
552
|
+
:host([tone='brand']) { background: ${e.brand}; border-color: transparent; color: ${e.onBrand}; --impkt-eyebrow: ${e.onBrand}; --impkt-color-surface-card: color-mix(in srgb, ${e.onBrand} 10%, transparent); --impkt-color-text-heading: ${e.onBrand}; --impkt-color-text-default: ${e.onBrand}; --impkt-color-text-muted: ${e.onBrand}; --impkt-color-text-link: ${e.onBrand}; }
|
|
553
|
+
:host([tone='outline']) { background: transparent; box-shadow: none; border-color: ${e.rule}; }
|
|
554
|
+
:host([raised]) { border-color: transparent; box-shadow: 0 24px 60px rgb(16 19 23 / 12%), 0 2px 6px rgb(16 19 23 / 6%); border-radius: ${e.radius2xl}; }
|
|
555
|
+
:host([tone='plain']) { background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; }
|
|
556
|
+
:host([ratio='4:3']) { --ratio: 4 / 3; }
|
|
557
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
558
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
559
|
+
.body { padding: ${r(6)}; flex: 1; display: flex; flex-direction: column; }
|
|
560
|
+
:host([padding='none']) .body { padding: 0; }
|
|
561
|
+
:host([padding='sm']) .body { padding: ${r(3)}; }
|
|
562
|
+
:host([padding='md']) .body { padding: ${r(4)}; }
|
|
563
|
+
:host([tone='plain']) .body { padding-inline: 0; }
|
|
564
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
565
|
+
.picture { position: relative; }
|
|
566
|
+
.tag { position: absolute; inset-block-start: ${r(4)}; inset-inline-start: ${r(4)}; padding: ${r(1.5)} ${r(3)}; font-size: ${$("sm")}; color: ${e.text}; background: ${e.surfaceCard}; border-radius: 999px; }
|
|
567
|
+
@media (forced-colors: active) { :host { border-color: CanvasText; } }
|
|
568
|
+
`]}render(){return a`${this.imageSrc?a`<div class="picture"><img src=${this.imageSrc} alt=${this.imageAlt} part="image" />${this.badge?a`<span class="tag">${this.badge}</span>`:l}</div>`:l}<div class="body" part="body"><slot></slot></div>`}},Ie=class extends c{static{this.properties={level:{type:Number,reflect:!0},size:{type:String,reflect:!0},eyebrow:{type:String,reflect:!0},align:{type:String,reflect:!0},screenReaderOnly:{type:Boolean,reflect:!0,attribute:"screen-reader-only"}}}constructor(){super(),this.level=2,this.size="xl",this.eyebrow="",this.align="start",this.screenReaderOnly=!1}static{this.styles=[...c.styles,h`
|
|
569
|
+
:host {
|
|
570
|
+
display: block;
|
|
571
|
+
color: ${e.textHeading};
|
|
572
|
+
font-family: ${e.fontHeading};
|
|
573
|
+
font-weight: ${u("bold")};
|
|
574
|
+
line-height: ${C("tight")};
|
|
575
|
+
}
|
|
576
|
+
:host([size='5xl']) { ${m("5xl")} letter-spacing: ${e.trackingTight}; }
|
|
577
|
+
:host([size='4xl']) { ${m("4xl")} letter-spacing: ${e.trackingTight}; }
|
|
578
|
+
:host([size='3xl']) { ${m("3xl")} letter-spacing: ${e.trackingTight}; }
|
|
579
|
+
:host([size='2xl']) { ${m("2xl")} letter-spacing: ${e.trackingTight}; }
|
|
580
|
+
:host([size='xl']) { ${m("xl")} }
|
|
581
|
+
:host([size='lg']) { ${m("lg")} }
|
|
582
|
+
:host([size='md']) { ${m("md")} }
|
|
583
|
+
:host([size='sm']) { ${m("sm")} }
|
|
584
|
+
.h { text-wrap: balance; }
|
|
585
|
+
.h {
|
|
586
|
+
margin: 0;
|
|
587
|
+
font: inherit;
|
|
588
|
+
color: inherit;
|
|
589
|
+
}
|
|
590
|
+
:host([align='center']) { text-align: center; }
|
|
591
|
+
/* Only the words go: an eyebrow over a heading drawn as a picture still shows. */
|
|
592
|
+
:host([screen-reader-only]) .words { ${E} }
|
|
593
|
+
:host([screen-reader-only]:not([eyebrow])) { ${E} }
|
|
594
|
+
.eyebrow {
|
|
595
|
+
display: block;
|
|
596
|
+
margin-block-end: ${r(2)};
|
|
597
|
+
color: var(--impkt-eyebrow, var(--impkt-color-text-eyebrow, ${e.brand}));
|
|
598
|
+
font-family: var(--impkt-font-family-eyebrow, ${e.fontBody});
|
|
599
|
+
font-size: var(--impkt-font-size-eyebrow, ${$("sm")});
|
|
600
|
+
font-weight: var(--impkt-font-weight-eyebrow, ${u("semibold")});
|
|
601
|
+
letter-spacing: 0.06em;
|
|
602
|
+
text-transform: uppercase;
|
|
603
|
+
}
|
|
604
|
+
`]}render(){return a`<div class="h" role="heading" aria-level=${this.level} part="heading">
|
|
605
|
+
${this.eyebrow?a`<span class="eyebrow" part="eyebrow">${this.eyebrow}<span style="position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)">: </span></span>`:l}<span class="words"><slot></slot></span>
|
|
606
|
+
</div>`}},Be=class extends c{static{this.properties={size:{type:String,reflect:!0},tone:{type:String,reflect:!0},align:{type:String,reflect:!0},look:{type:String,reflect:!0}}}constructor(){super(),this.size="md",this.tone="default",this.align="start",this.look="prose"}static{this.styles=[...c.styles,h`
|
|
607
|
+
:host {
|
|
608
|
+
display: block;
|
|
609
|
+
/* 1.4.8 asks for 1.5 within a paragraph, and it is the default here
|
|
610
|
+
rather than an option, because body text is what it is about. */
|
|
611
|
+
line-height: ${C("normal")};
|
|
612
|
+
/* 1.4.12 Text Spacing: a user stylesheet must be able to widen this
|
|
613
|
+
without clipping, which a max-width in ch units survives and a
|
|
614
|
+
fixed pixel height does not. */
|
|
615
|
+
max-inline-size: 70ch;
|
|
616
|
+
}
|
|
617
|
+
:host([size='sm']) { ${m("sm")} }
|
|
618
|
+
:host([size='md']) { ${m("md")} }
|
|
619
|
+
:host([size='lg']) { ${m("lg")} }
|
|
620
|
+
:host([size='xl']) { ${m("xl")} }
|
|
621
|
+
p { text-wrap: pretty; }
|
|
622
|
+
:host([tone='muted']) { color: ${e.textMuted}; }
|
|
623
|
+
:host([align='center']) { text-align: center; margin-inline: auto; }
|
|
624
|
+
:host([look='code']) { font-family: ${e.fontMono}; ${m("sm")} padding: ${r(2)} ${r(3)}; border-radius: ${e.radius}; background: color-mix(in srgb, currentColor 6%, transparent); max-inline-size: none; }
|
|
625
|
+
p {
|
|
626
|
+
margin: 0;
|
|
627
|
+
}
|
|
628
|
+
`]}render(){return a`<p part="text"><slot></slot></p>`}};customElements.define("impkt-stack",Ce);customElements.define("impkt-card",Re);customElements.define("impkt-heading",Ie);customElements.define("impkt-text",Be);var _e=class extends c{static{this.properties={href:{type:String},external:{type:Boolean,reflect:!0},externalText:{type:String,attribute:"external-text"},variant:{type:String,reflect:!0},icon:{type:String}}}constructor(){super(),this.href="",this.external=!1,this.externalText="opens in a new tab",this.variant="inline",this.icon="none"}static{this.styles=[...c.styles,k,h`
|
|
629
|
+
:host {
|
|
630
|
+
display: inline;
|
|
631
|
+
}
|
|
632
|
+
a {
|
|
633
|
+
color: ${e.link};
|
|
634
|
+
text-decoration: underline;
|
|
635
|
+
text-underline-offset: 0.2em;
|
|
636
|
+
border-radius: ${e.radiusSm};
|
|
637
|
+
}
|
|
638
|
+
a:hover {
|
|
639
|
+
color: ${e.linkHover};
|
|
640
|
+
}
|
|
641
|
+
:host([variant='standalone']) { display: inline-block; }
|
|
642
|
+
:host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${r(1)}; font-weight: ${u("semibold")}; text-decoration-thickness: 1px; }
|
|
643
|
+
:host([variant='standalone']) a:hover .icon { transform: translateX(2px); }
|
|
644
|
+
.icon { flex: none; transition: transform 120ms ease-in-out; }
|
|
645
|
+
.sr-only {
|
|
646
|
+
${E}
|
|
647
|
+
}
|
|
648
|
+
`]}render(){return a`
|
|
649
|
+
<a
|
|
650
|
+
part="link"
|
|
651
|
+
href=${this.href||l}
|
|
652
|
+
target=${this.external?"_blank":l}
|
|
653
|
+
rel=${this.external?"noopener noreferrer":l}
|
|
654
|
+
>
|
|
655
|
+
<slot></slot>${S(this.icon!=="none"?this.icon:this.variant==="standalone"?this.external?"external":"arrow-right":void 0,"1em")}${this.external?a`<span class="sr-only"> (${this.externalText})</span>`:l}
|
|
656
|
+
</a>
|
|
657
|
+
`}};customElements.define("impkt-link",_e);var He=class extends c{static{this.properties={src:{type:String},alt:{type:String},decorative:{type:Boolean,reflect:!0},width:{type:Number},height:{type:Number},focalX:{type:Number,attribute:"focal-x"},focalY:{type:Number,attribute:"focal-y"},loading:{type:String},ratio:{type:String,reflect:!0},rounded:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.hideOn="never",this.ratio="natural",this.rounded="none",this.src="",this.alt="",this.decorative=!1,this.width=void 0,this.height=void 0,this.focalX=.5,this.focalY=.5,this.loading="lazy"}static{this.styles=[...c.styles,h`
|
|
658
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
659
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
660
|
+
:host {
|
|
661
|
+
display: block;
|
|
662
|
+
}
|
|
663
|
+
img {
|
|
664
|
+
display: block;
|
|
665
|
+
max-inline-size: 100%;
|
|
666
|
+
block-size: auto;
|
|
667
|
+
object-fit: cover;
|
|
668
|
+
}
|
|
669
|
+
:host(:not([ratio='natural'])) img { inline-size: 100%; }
|
|
670
|
+
:host([ratio='16:9']) img { aspect-ratio: 16 / 9; }
|
|
671
|
+
:host([ratio='4:3']) img { aspect-ratio: 4 / 3; }
|
|
672
|
+
:host([ratio='3:2']) img { aspect-ratio: 3 / 2; }
|
|
673
|
+
:host([ratio='1:1']) img { aspect-ratio: 1 / 1; }
|
|
674
|
+
:host([rounded='sm']) img { border-radius: ${e.radius}; }
|
|
675
|
+
:host([rounded='lg']) img { border-radius: ${e.radiusLg}; }
|
|
676
|
+
:host([rounded='full']) img { border-radius: 50%; }
|
|
677
|
+
`]}render(){return a`
|
|
678
|
+
<img
|
|
679
|
+
part="image"
|
|
680
|
+
src=${this.src}
|
|
681
|
+
alt=${this.decorative?"":this.alt}
|
|
682
|
+
role=${this.decorative?"presentation":l}
|
|
683
|
+
width=${this.width??l}
|
|
684
|
+
height=${this.height??l}
|
|
685
|
+
loading=${this.loading}
|
|
686
|
+
style="object-position: ${this.focalX*100}% ${this.focalY*100}%"
|
|
687
|
+
/>
|
|
688
|
+
`}},Ne=class extends c{static{this.properties={src:{type:String},srcDark:{type:String,attribute:"src-dark"},alt:{type:String},onDark:{type:Boolean,attribute:"on-dark",reflect:!0},height:{type:Number}}}constructor(){super(),this.src="",this.srcDark="",this.alt="",this.onDark=!1,this.height=32}static{this.styles=[...c.styles,h`
|
|
689
|
+
:host {
|
|
690
|
+
display: inline-block;
|
|
691
|
+
}
|
|
692
|
+
img {
|
|
693
|
+
display: block;
|
|
694
|
+
inline-size: auto;
|
|
695
|
+
}
|
|
696
|
+
`]}render(){let t=this.onDark&&this.srcDark?this.srcDark:this.src;return a`<img part="logo" src=${t} alt=${this.alt} style="height: ${this.height}px" />`}},Pe=class extends c{static{this.properties={href:{type:String},label:{type:String},fileType:{type:String,attribute:"file-type"},byteSize:{type:Number,attribute:"byte-size"}}}constructor(){super(),this.href="",this.label="",this.fileType="",this.byteSize=void 0}static{this.styles=[...c.styles,h`
|
|
697
|
+
:host {
|
|
698
|
+
display: block;
|
|
699
|
+
}
|
|
700
|
+
a {
|
|
701
|
+
color: ${e.link};
|
|
702
|
+
text-decoration: underline;
|
|
703
|
+
text-underline-offset: 0.2em;
|
|
704
|
+
display: inline-flex;
|
|
705
|
+
gap: 0.5ch;
|
|
706
|
+
align-items: baseline;
|
|
707
|
+
min-block-size: ${e.targetMin};
|
|
708
|
+
}
|
|
709
|
+
.meta {
|
|
710
|
+
color: ${e.textMuted};
|
|
711
|
+
}
|
|
712
|
+
`]}get size(){if(!this.byteSize)return"";let t=this.byteSize/1024;return t>=1024?`${(t/1024).toFixed(1)} MB`:`${Math.round(t)} KB`}render(){let t=[this.fileType,this.size].filter(Boolean).join(", ");return a`
|
|
713
|
+
<a part="link" href=${this.href||l} download>
|
|
714
|
+
<span>${this.label}</span>${t?a`<span class="meta">(${t})</span>`:l}
|
|
715
|
+
</a>
|
|
716
|
+
`}};customElements.define("impkt-image",He);customElements.define("impkt-logo",Ne);customElements.define("impkt-document-link",Pe);function B(o){let t=o?.closest?.("[lang]")?.getAttribute("lang"),i=!t&&o?o.getRootNode?.()?.host?.closest?.("[lang]")?.getAttribute("lang")??"":"",s=typeof document<"u"?document.documentElement.lang:"",n=(t||i||s||"").trim();return!n||n.toLowerCase()==="en"?"en-GB":n}var Oe=class extends c{static{this.properties={amount:{type:Number},currency:{type:String},locale:{type:String},prefix:{type:String},period:{type:String},size:{type:String,reflect:!0},pending:{type:String}}}constructor(){super(),this.amount=void 0,this.currency="GBP",this.locale="",this.prefix="",this.period="",this.size="xl",this.pending="\u2014"}static{this.styles=[...c.styles,h`
|
|
717
|
+
:host {
|
|
718
|
+
display: inline-flex;
|
|
719
|
+
align-items: baseline;
|
|
720
|
+
gap: ${r(1)};
|
|
721
|
+
color: ${e.text};
|
|
722
|
+
}
|
|
723
|
+
.amount {
|
|
724
|
+
font-family: ${e.fontHeading};
|
|
725
|
+
font-weight: ${u("bold")};
|
|
726
|
+
/* Tabular figures so a price does not reflow as the digits change,
|
|
727
|
+
which otherwise makes a recalculating price jitter. */
|
|
728
|
+
font-variant-numeric: tabular-nums;
|
|
729
|
+
}
|
|
730
|
+
:host([size='md']) .amount { font-size: ${$("lg")}; }
|
|
731
|
+
:host([size='lg']) .amount { font-size: ${$("2xl")}; }
|
|
732
|
+
:host([size='xl']) .amount { font-size: ${$("3xl")}; }
|
|
733
|
+
.period {
|
|
734
|
+
font-size: ${$("sm")};
|
|
735
|
+
color: ${e.textMuted};
|
|
736
|
+
}
|
|
737
|
+
`]}get formatted(){if(this.amount===void 0||Number.isNaN(this.amount))return this.pending;try{return new Intl.NumberFormat(this.locale||B(this),{style:"currency",currency:this.currency,...this.amount>=1e5&&this.amount%100===0?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}).format(this.amount/100)}catch{return(this.amount/100).toFixed(2)}}render(){return a`
|
|
738
|
+
${this.prefix?a`<span class="period" part="prefix">${this.prefix}</span>`:l}
|
|
739
|
+
<span class="amount" part="amount">${this.formatted}</span>
|
|
740
|
+
${this.period?a`<span class="period" part="period">${this.period}</span>`:l}
|
|
741
|
+
`}};customElements.define("impkt-price",Oe);var je=class extends c{static{this.properties={rows:{type:Array},changeText:{type:String,attribute:"change-text"}}}constructor(){super(),this.rows=[],this.changeText="Change"}static{this.styles=[...c.styles,k,R("dd a"),h`
|
|
742
|
+
:host {
|
|
743
|
+
display: block;
|
|
744
|
+
}
|
|
745
|
+
dl {
|
|
746
|
+
margin: 0;
|
|
747
|
+
display: grid;
|
|
748
|
+
grid-template-columns: minmax(8rem, 1fr) 2fr;
|
|
749
|
+
}
|
|
750
|
+
/* A <dl> group may hold only dt and dd — not a third sibling — so the
|
|
751
|
+
action lives inside the value it changes, which is also where it
|
|
752
|
+
belongs semantically. The row uses display:contents so both cells stay
|
|
753
|
+
in the parent grid. */
|
|
754
|
+
.row {
|
|
755
|
+
display: contents;
|
|
756
|
+
}
|
|
757
|
+
dt,
|
|
758
|
+
dd {
|
|
759
|
+
padding: ${r(3)} 0;
|
|
760
|
+
border-block-end: ${e.borderThin} solid ${e.rule};
|
|
761
|
+
}
|
|
762
|
+
dt {
|
|
763
|
+
font-weight: ${u("semibold")};
|
|
764
|
+
font-size: ${$("sm")};
|
|
765
|
+
}
|
|
766
|
+
dd {
|
|
767
|
+
margin: 0;
|
|
768
|
+
display: flex;
|
|
769
|
+
align-items: baseline;
|
|
770
|
+
justify-content: space-between;
|
|
771
|
+
gap: ${r(3)};
|
|
772
|
+
}
|
|
773
|
+
dd a {
|
|
774
|
+
flex: none;
|
|
775
|
+
color: ${e.link};
|
|
776
|
+
text-decoration: underline;
|
|
777
|
+
text-underline-offset: 0.2em;
|
|
778
|
+
display: inline-flex;
|
|
779
|
+
align-items: center;
|
|
780
|
+
min-block-size: ${e.targetMin};
|
|
781
|
+
}
|
|
782
|
+
.sr-only {
|
|
783
|
+
position: absolute;
|
|
784
|
+
inline-size: 1px;
|
|
785
|
+
block-size: 1px;
|
|
786
|
+
margin: -1px;
|
|
787
|
+
overflow: hidden;
|
|
788
|
+
clip-path: inset(50%);
|
|
789
|
+
white-space: nowrap;
|
|
790
|
+
}
|
|
791
|
+
/* One column on a narrow screen. 1.4.10 Reflow: two columns at 320px
|
|
792
|
+
forces horizontal scrolling, and a summary is read, not scanned
|
|
793
|
+
across. */
|
|
794
|
+
@media (max-width: 30rem) {
|
|
795
|
+
dl {
|
|
796
|
+
grid-template-columns: 1fr;
|
|
797
|
+
}
|
|
798
|
+
dt {
|
|
799
|
+
border-block-end: 0;
|
|
800
|
+
padding-block-end: 0;
|
|
801
|
+
}
|
|
802
|
+
dd {
|
|
803
|
+
padding-block-start: 0;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
`]}render(){return a`
|
|
807
|
+
<dl part="list">
|
|
808
|
+
${this.rows.map(t=>a`
|
|
809
|
+
<div class="row" part="row">
|
|
810
|
+
<dt part="key">${t.key}</dt>
|
|
811
|
+
<dd part="value">
|
|
812
|
+
<span>${t.value}</span>
|
|
813
|
+
${t.changeHref?a`<a href=${t.changeHref} part="action"
|
|
814
|
+
>${this.changeText}<span class="sr-only"> ${t.key}</span></a
|
|
815
|
+
>`:l}
|
|
816
|
+
</dd>
|
|
817
|
+
</div>
|
|
818
|
+
`)}
|
|
819
|
+
</dl>
|
|
820
|
+
`}};customElements.define("impkt-summary-list",je);var Fe=class extends c{static{this.properties={caption:{type:String},columns:{type:Array},rows:{type:Array},sortKey:{type:String,attribute:"sort-key",reflect:!0},sortDirection:{type:String,attribute:"sort-direction",reflect:!0},manualSort:{type:Boolean,attribute:"manual-sort"},selectable:{type:Boolean,reflect:!0},selected:{type:Array},rowKey:{type:String,attribute:"row-key"},stack:{type:Boolean,reflect:!0},emptyText:{type:String,attribute:"empty-text"},selectAllText:{type:String,attribute:"select-all-text"},selectRowText:{type:String,attribute:"select-row-text"}}}constructor(){super(),this.caption="",this.columns=[],this.rows=[],this.sortKey="",this.sortDirection="ascending",this.manualSort=!1,this.selectable=!1,this.selected=[],this.rowKey="id",this.stack=!1,this.emptyText="Nothing to show",this.selectAllText="Select all rows",this.selectRowText="Select {row}"}static{this.styles=[...c.styles,k,R(".sort, .pick label"),h`
|
|
821
|
+
:host {
|
|
822
|
+
display: block;
|
|
823
|
+
}
|
|
824
|
+
:host([stack]) {
|
|
825
|
+
container-type: inline-size;
|
|
826
|
+
}
|
|
827
|
+
.scroller {
|
|
828
|
+
overflow-x: auto;
|
|
829
|
+
}
|
|
830
|
+
table {
|
|
831
|
+
inline-size: 100%;
|
|
832
|
+
border-collapse: collapse;
|
|
833
|
+
font-size: ${$("md")};
|
|
834
|
+
}
|
|
835
|
+
caption {
|
|
836
|
+
text-align: start;
|
|
837
|
+
font-weight: ${u("semibold")};
|
|
838
|
+
padding-block-end: ${r(2)};
|
|
839
|
+
}
|
|
840
|
+
th,
|
|
841
|
+
td {
|
|
842
|
+
text-align: start;
|
|
843
|
+
padding: ${r(3)};
|
|
844
|
+
border-block-end: ${e.borderThin} solid ${e.rule};
|
|
845
|
+
}
|
|
846
|
+
thead th {
|
|
847
|
+
font-weight: ${u("semibold")};
|
|
848
|
+
background: ${e.surfaceInset};
|
|
849
|
+
}
|
|
850
|
+
tbody th {
|
|
851
|
+
font-weight: ${u("semibold")};
|
|
852
|
+
}
|
|
853
|
+
.numeric {
|
|
854
|
+
/* A figure read across a line break is a different figure. */
|
|
855
|
+
white-space: nowrap;
|
|
856
|
+
text-align: end;
|
|
857
|
+
font-variant-numeric: tabular-nums;
|
|
858
|
+
}
|
|
859
|
+
th.sortable {
|
|
860
|
+
padding: ${r(1)};
|
|
861
|
+
}
|
|
862
|
+
.sort {
|
|
863
|
+
display: inline-flex;
|
|
864
|
+
align-items: center;
|
|
865
|
+
gap: ${r(1)};
|
|
866
|
+
min-block-size: ${e.targetMin};
|
|
867
|
+
padding: ${r(2)};
|
|
868
|
+
font: inherit;
|
|
869
|
+
color: inherit;
|
|
870
|
+
background: none;
|
|
871
|
+
border: 0;
|
|
872
|
+
border-radius: ${e.radius};
|
|
873
|
+
cursor: pointer;
|
|
874
|
+
}
|
|
875
|
+
.sort:hover {
|
|
876
|
+
background: ${e.wash};
|
|
877
|
+
}
|
|
878
|
+
.numeric .sort {
|
|
879
|
+
flex-direction: row-reverse;
|
|
880
|
+
}
|
|
881
|
+
.arrow {
|
|
882
|
+
display: inline-flex;
|
|
883
|
+
color: ${e.textMuted};
|
|
884
|
+
transition: transform 140ms ease-in-out;
|
|
885
|
+
}
|
|
886
|
+
[aria-sort] .arrow {
|
|
887
|
+
color: inherit;
|
|
888
|
+
}
|
|
889
|
+
[aria-sort='ascending'] .arrow {
|
|
890
|
+
transform: rotate(180deg);
|
|
891
|
+
}
|
|
892
|
+
:not([aria-sort]) > .sort .arrow {
|
|
893
|
+
opacity: 0.45;
|
|
894
|
+
}
|
|
895
|
+
.pick {
|
|
896
|
+
inline-size: 1%;
|
|
897
|
+
padding-block: 0;
|
|
898
|
+
padding-inline-end: 0;
|
|
899
|
+
}
|
|
900
|
+
.pick label {
|
|
901
|
+
display: inline-flex;
|
|
902
|
+
align-items: center;
|
|
903
|
+
justify-content: center;
|
|
904
|
+
min-block-size: ${e.targetMin};
|
|
905
|
+
min-inline-size: ${e.targetMin};
|
|
906
|
+
cursor: pointer;
|
|
907
|
+
}
|
|
908
|
+
.pick input {
|
|
909
|
+
inline-size: 20px;
|
|
910
|
+
block-size: 20px;
|
|
911
|
+
margin: 0;
|
|
912
|
+
accent-color: ${e.brand};
|
|
913
|
+
cursor: pointer;
|
|
914
|
+
}
|
|
915
|
+
tr.chosen > * {
|
|
916
|
+
background: ${e.brandSubtle};
|
|
917
|
+
}
|
|
918
|
+
.empty {
|
|
919
|
+
padding-block: ${r(6)};
|
|
920
|
+
text-align: center;
|
|
921
|
+
color: ${e.textMuted};
|
|
922
|
+
}
|
|
923
|
+
.label {
|
|
924
|
+
display: none;
|
|
925
|
+
}
|
|
926
|
+
.visually-hidden {
|
|
927
|
+
${E}
|
|
928
|
+
}
|
|
929
|
+
/* Stacked: each row a card, each value under its column's name. */
|
|
930
|
+
@container (max-width: 36rem) {
|
|
931
|
+
table, tbody, tr, tbody th, tbody td {
|
|
932
|
+
display: block;
|
|
933
|
+
}
|
|
934
|
+
thead tr {
|
|
935
|
+
display: flex;
|
|
936
|
+
flex-wrap: wrap;
|
|
937
|
+
align-items: center;
|
|
938
|
+
gap: ${r(1)};
|
|
939
|
+
margin-block-end: ${r(3)};
|
|
940
|
+
}
|
|
941
|
+
thead th {
|
|
942
|
+
display: none;
|
|
943
|
+
padding: 0;
|
|
944
|
+
border: 0;
|
|
945
|
+
background: none;
|
|
946
|
+
}
|
|
947
|
+
thead th.sortable, thead th.pick {
|
|
948
|
+
display: block;
|
|
949
|
+
inline-size: auto;
|
|
950
|
+
}
|
|
951
|
+
thead .sort {
|
|
952
|
+
border: ${e.borderThin} solid ${e.rule};
|
|
953
|
+
border-radius: 999px;
|
|
954
|
+
padding-inline: ${r(3)};
|
|
955
|
+
background: ${e.surfaceCard};
|
|
956
|
+
}
|
|
957
|
+
tbody tr {
|
|
958
|
+
position: relative;
|
|
959
|
+
margin-block-end: ${r(3)};
|
|
960
|
+
padding: ${r(3)} ${r(4)};
|
|
961
|
+
border: ${e.borderThin} solid ${e.rule};
|
|
962
|
+
border-radius: ${e.radiusXl};
|
|
963
|
+
background: ${e.surfaceCard};
|
|
964
|
+
}
|
|
965
|
+
tbody tr.chosen {
|
|
966
|
+
background: ${e.brandSubtle};
|
|
967
|
+
}
|
|
968
|
+
tr.chosen > * {
|
|
969
|
+
background: none;
|
|
970
|
+
}
|
|
971
|
+
tbody th, tbody td {
|
|
972
|
+
display: grid;
|
|
973
|
+
grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
|
|
974
|
+
gap: ${r(3)};
|
|
975
|
+
padding: ${r(1.5)} 0;
|
|
976
|
+
border: 0;
|
|
977
|
+
text-align: start;
|
|
978
|
+
white-space: normal;
|
|
979
|
+
}
|
|
980
|
+
tbody td.numeric {
|
|
981
|
+
text-align: start;
|
|
982
|
+
}
|
|
983
|
+
tbody .pick {
|
|
984
|
+
display: block;
|
|
985
|
+
position: absolute;
|
|
986
|
+
inset-block-start: ${r(1)};
|
|
987
|
+
inset-inline-end: ${r(1)};
|
|
988
|
+
inline-size: auto;
|
|
989
|
+
padding: 0;
|
|
990
|
+
}
|
|
991
|
+
tbody tr:has(.pick) > th {
|
|
992
|
+
padding-inline-end: ${r(10)};
|
|
993
|
+
}
|
|
994
|
+
.label {
|
|
995
|
+
display: block;
|
|
996
|
+
font-size: ${$("sm")};
|
|
997
|
+
font-weight: ${u("semibold")};
|
|
998
|
+
color: ${e.textMuted};
|
|
999
|
+
}
|
|
1000
|
+
.empty {
|
|
1001
|
+
display: block;
|
|
1002
|
+
border: 0;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
`]}keyOf(t,i){let s=t?.[this.rowKey];return s==null||s===""?String(i):String(s)}ordered(){let t=(this.rows??[]).map((p,b)=>({row:p,key:this.keyOf(p,b)})),i=(this.columns??[]).find(p=>p.key===this.sortKey&&p.sortable);if(!i||this.manualSort)return t;let s=this.sortDirection==="descending"?-1:1,n=B(this),d=p=>Number(String(p??"").replace(/[^\d.-]/g,""))||0;return t.sort((p,b)=>{let y=p.row[i.key]??"",x=b.row[i.key]??"";return(i.numeric?d(y)-d(x):String(y).localeCompare(String(x),n,{numeric:!0,sensitivity:"base"}))*s})}sortBy(t){let i=this.sortKey===t&&this.sortDirection==="ascending"?"descending":"ascending";this.sortKey=t,this.sortDirection=i,this.dispatchEvent(new CustomEvent("impkt-sort",{detail:{key:t,direction:i},bubbles:!0,composed:!0}))}choose(t,i){let s=new Set(this.selected??[]);for(let n of t)i?s.add(n):s.delete(n);this.selected=[...s],this.dispatchEvent(new CustomEvent("impkt-selection",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}heading(t){let i=t.sortable&&t.key===this.sortKey,s=[t.numeric?"numeric":"",t.sortable?"sortable":""].filter(Boolean).join(" ");return t.sortable?a`<th scope="col" role="columnheader" class=${s} aria-sort=${i?this.sortDirection:l}>
|
|
1006
|
+
<button class="sort" type="button" part="sort" @click=${()=>this.sortBy(t.key)}>${t.label}<span class="arrow" aria-hidden="true">${S("chevron-down","16px")}</span></button>
|
|
1007
|
+
</th>`:a`<th scope="col" role="columnheader" class=${s}>${t.label}</th>`}render(){let t=this.columns??[],i=this.ordered(),s=new Set(this.selected??[]),n=i.length>0&&i.every(p=>s.has(p.key)),d=!n&&i.some(p=>s.has(p.key));return a`
|
|
1008
|
+
<div class="scroller" part="scroller" tabindex="0" role="region" aria-label=${this.caption||l}>
|
|
1009
|
+
<table part="table" role="table">
|
|
1010
|
+
${this.caption?a`<caption part="caption">${this.caption}</caption>`:l}
|
|
1011
|
+
<thead role="rowgroup">
|
|
1012
|
+
<tr role="row">
|
|
1013
|
+
${this.selectable?a`<th scope="col" role="columnheader" class="pick"><label><input type="checkbox" aria-label=${this.selectAllText} .checked=${n} .indeterminate=${d} ?disabled=${!i.length}
|
|
1014
|
+
@change=${p=>this.choose(i.map(b=>b.key),p.target.checked)} /></label></th>`:l}
|
|
1015
|
+
${t.map(p=>this.heading(p))}
|
|
1016
|
+
</tr>
|
|
1017
|
+
</thead>
|
|
1018
|
+
<tbody role="rowgroup">
|
|
1019
|
+
${i.length?i.map(({row:p,key:b},y)=>a`
|
|
1020
|
+
<tr role="row" class=${s.has(b)?"chosen":""} part="row">
|
|
1021
|
+
${this.selectable?a`<td role="cell" class="pick"><label><input type="checkbox" aria-label=${this.selectRowText.replace("{row}",String(p[t[0]?.key??""]??b))} .checked=${s.has(b)}
|
|
1022
|
+
@change=${x=>this.choose([b],x.target.checked)} /></label></td>`:l}
|
|
1023
|
+
${t.map((x,v)=>{let M=a`<span class="label" aria-hidden="true">${x.label}</span><span class="value"><slot name=${`cell:${b}:${x.key}`}>${p[x.key]??""}</slot></span>`;return v===0?a`<th scope="row" role="rowheader" id=${`${this.uid}-r${y}`}>${M}</th>`:a`<td role="cell" class=${x.numeric?"numeric":""}>${M}</td>`})}
|
|
1024
|
+
</tr>
|
|
1025
|
+
`):a`<tr role="row"><td role="cell" class="empty" colspan=${t.length+(this.selectable?1:0)||1}><slot name="empty">${this.emptyText}</slot></td></tr>`}
|
|
1026
|
+
</tbody>
|
|
1027
|
+
</table>
|
|
1028
|
+
</div>
|
|
1029
|
+
`}};customElements.define("impkt-table",Fe);var De=class extends c{static{this.properties={items:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},open:{type:Array},multiple:{type:Boolean}}}constructor(){super(),this.items=[],this.headingLevel=3,this.open=[],this.multiple=!0}static{this.styles=[...c.styles,k,h`
|
|
1030
|
+
:host {
|
|
1031
|
+
display: block;
|
|
1032
|
+
}
|
|
1033
|
+
.item {
|
|
1034
|
+
border-block-end: ${e.borderThin} solid ${e.rule};
|
|
1035
|
+
}
|
|
1036
|
+
button {
|
|
1037
|
+
${A}
|
|
1038
|
+
display: flex;
|
|
1039
|
+
align-items: center;
|
|
1040
|
+
justify-content: space-between;
|
|
1041
|
+
gap: ${r(3)};
|
|
1042
|
+
inline-size: 100%;
|
|
1043
|
+
padding: ${r(3)} 0;
|
|
1044
|
+
background: none;
|
|
1045
|
+
border: 0;
|
|
1046
|
+
font: inherit;
|
|
1047
|
+
font-size: ${$("md")};
|
|
1048
|
+
font-weight: ${u("semibold")};
|
|
1049
|
+
color: ${e.text};
|
|
1050
|
+
text-align: start;
|
|
1051
|
+
cursor: pointer;
|
|
1052
|
+
}
|
|
1053
|
+
button:hover {
|
|
1054
|
+
color: ${e.link};
|
|
1055
|
+
}
|
|
1056
|
+
.marker {
|
|
1057
|
+
flex: none;
|
|
1058
|
+
transition: transform 120ms ease-in-out;
|
|
1059
|
+
}
|
|
1060
|
+
button[aria-expanded='true'] .marker {
|
|
1061
|
+
transform: rotate(90deg);
|
|
1062
|
+
}
|
|
1063
|
+
.panel {
|
|
1064
|
+
padding-block-end: ${r(4)};
|
|
1065
|
+
font-size: ${$("md")};
|
|
1066
|
+
}
|
|
1067
|
+
`]}toggle(t){this.open.includes(t)?this.open=this.open.filter(s=>s!==t):this.open=this.multiple?[...this.open,t]:[t]}render(){return a`
|
|
1068
|
+
${this.items.map(t=>{let i=this.open.includes(t.id),s=this.id_(`panel-${t.id}`),n=this.id_(`button-${t.id}`);return a`
|
|
1069
|
+
<div class="item" part="item">
|
|
1070
|
+
<div role="heading" aria-level=${this.headingLevel}>
|
|
1071
|
+
<button
|
|
1072
|
+
id=${n}
|
|
1073
|
+
part="header"
|
|
1074
|
+
type="button"
|
|
1075
|
+
aria-expanded=${i?"true":"false"}
|
|
1076
|
+
aria-controls=${s}
|
|
1077
|
+
@click=${()=>this.toggle(t.id)}
|
|
1078
|
+
>
|
|
1079
|
+
<span>${t.heading}</span>
|
|
1080
|
+
<span class="marker" aria-hidden="true">›</span>
|
|
1081
|
+
</button>
|
|
1082
|
+
</div>
|
|
1083
|
+
<div
|
|
1084
|
+
id=${s}
|
|
1085
|
+
class="panel"
|
|
1086
|
+
part="panel"
|
|
1087
|
+
role="region"
|
|
1088
|
+
aria-labelledby=${n}
|
|
1089
|
+
?hidden=${!i}
|
|
1090
|
+
>
|
|
1091
|
+
<slot name=${`panel-${t.id}`}>${t.body}</slot>
|
|
1092
|
+
</div>
|
|
1093
|
+
</div>
|
|
1094
|
+
`})}
|
|
1095
|
+
${this.items.length===0?l:l}
|
|
1096
|
+
`}};customElements.define("impkt-accordion",De);var qe=class extends c{static{this.properties={steps:{type:Array},current:{type:String},label:{type:String}}}constructor(){super(),this.steps=[],this.current="",this.label="Progress"}static{this.styles=[...c.styles,h`
|
|
1097
|
+
:host {
|
|
1098
|
+
display: block;
|
|
1099
|
+
margin-block-end: ${r(5)};
|
|
1100
|
+
}
|
|
1101
|
+
ol {
|
|
1102
|
+
display: flex;
|
|
1103
|
+
gap: ${r(2)};
|
|
1104
|
+
list-style: none;
|
|
1105
|
+
margin: 0;
|
|
1106
|
+
padding: 0;
|
|
1107
|
+
}
|
|
1108
|
+
li {
|
|
1109
|
+
flex: 1;
|
|
1110
|
+
font-size: ${$("sm")};
|
|
1111
|
+
color: ${e.textMuted};
|
|
1112
|
+
padding-block-start: ${r(2)};
|
|
1113
|
+
border-block-start: 4px solid ${e.border};
|
|
1114
|
+
}
|
|
1115
|
+
li[data-state='done'] {
|
|
1116
|
+
color: ${e.text};
|
|
1117
|
+
border-block-start-color: ${e.brand};
|
|
1118
|
+
}
|
|
1119
|
+
li[data-state='current'] {
|
|
1120
|
+
color: ${e.text};
|
|
1121
|
+
font-weight: ${u("semibold")};
|
|
1122
|
+
border-block-start-color: ${e.brand};
|
|
1123
|
+
}
|
|
1124
|
+
.sr-only {
|
|
1125
|
+
${E}
|
|
1126
|
+
}
|
|
1127
|
+
/* Below 30rem the labels stop fitting; the position in words is the part
|
|
1128
|
+
that has to survive, so the list collapses to bars and the current
|
|
1129
|
+
step's name. */
|
|
1130
|
+
@media (max-width: 30rem) {
|
|
1131
|
+
li:not([data-state='current']) span:not(.sr-only) {
|
|
1132
|
+
${E}
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
`]}render(){let t=this.steps.findIndex(i=>i.id===this.current);return a`
|
|
1136
|
+
<nav part="nav" aria-label=${this.label}>
|
|
1137
|
+
<ol part="list">
|
|
1138
|
+
${this.steps.map((i,s)=>{let n=s<t?"done":s===t?"current":"todo";return a`
|
|
1139
|
+
<li data-state=${n} aria-current=${n==="current"?"step":l}>
|
|
1140
|
+
${n==="current"?a`<span class="sr-only">${g("Step {step} of {steps}:",{step:s+1,steps:this.steps.length})} </span>`:l}
|
|
1141
|
+
<span>${i.label}</span>
|
|
1142
|
+
</li>
|
|
1143
|
+
`})}
|
|
1144
|
+
</ol>
|
|
1145
|
+
</nav>
|
|
1146
|
+
`}};customElements.define("impkt-progress",qe);var We=o=>Math.min(1,Math.max(0,o)),Ue=class extends c{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=i=>{if(this.frame=0,this.seekMs){this.seekStart||(this.seekStart=i);let s=Math.min(1,(i-this.seekStart)/this.seekMs),n=s<.5?4*s*s*s:1-Math.pow(-2*s+2,3)/2;this.progress=this.seekFrom+(this.seekTo-this.seekFrom)*n,s<1?this.schedule():this.seekMs=0;return}if(this.drive==="view"){let s=this.getBoundingClientRect(),n=window.innerHeight||1;this.progress=We(-s.top/Math.max(1,s.height-n))}else if(this.drive==="page"){let s=document.documentElement;this.progress=We(window.scrollY/Math.max(1,s.scrollHeight-(window.innerHeight||0)))}else this.drive==="loop"&&!this.paused&&!this.reduced&&(this.started||(this.started=i-this.progress*this.duration*1e3),this.progress=(i-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=[...c.styles,h`
|
|
1147
|
+
:host {
|
|
1148
|
+
display: block;
|
|
1149
|
+
position: relative;
|
|
1150
|
+
}
|
|
1151
|
+
:host([drive='view'][layout='stage']) {
|
|
1152
|
+
min-height: calc(var(--impkt-scene-length, 3) * 100svh);
|
|
1153
|
+
}
|
|
1154
|
+
.frame {
|
|
1155
|
+
display: grid;
|
|
1156
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1157
|
+
}
|
|
1158
|
+
:host([layout='split']) .frame {
|
|
1159
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
1160
|
+
gap: ${r(8)};
|
|
1161
|
+
}
|
|
1162
|
+
.stage {
|
|
1163
|
+
position: sticky;
|
|
1164
|
+
top: 0;
|
|
1165
|
+
height: 100svh;
|
|
1166
|
+
display: grid;
|
|
1167
|
+
place-items: center;
|
|
1168
|
+
overflow: clip;
|
|
1169
|
+
}
|
|
1170
|
+
/* What is on the stage is layered, as in a motion tool: each thing sits
|
|
1171
|
+
over the one before, so a later layer's timeline can reveal it over an
|
|
1172
|
+
earlier one. */
|
|
1173
|
+
.stage ::slotted(*) {
|
|
1174
|
+
grid-area: 1 / 1;
|
|
1175
|
+
max-width: 100%;
|
|
1176
|
+
}
|
|
1177
|
+
:host([drive='loop']) .stage,
|
|
1178
|
+
:host([drive='scrubber']) .stage {
|
|
1179
|
+
position: relative;
|
|
1180
|
+
height: auto;
|
|
1181
|
+
min-height: 60svh;
|
|
1182
|
+
}
|
|
1183
|
+
.controls {
|
|
1184
|
+
display: flex;
|
|
1185
|
+
gap: ${r(3)};
|
|
1186
|
+
align-items: center;
|
|
1187
|
+
justify-content: center;
|
|
1188
|
+
padding-block: ${r(3)};
|
|
1189
|
+
}
|
|
1190
|
+
:host([bleed]) { margin-inline: calc(50% - 50vw); }
|
|
1191
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
1192
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
1193
|
+
/* Over the stage, the controls float at its foot, above the layers and clear of its edges. */
|
|
1194
|
+
.stage > .controls { position: absolute; inset-inline: ${r(6)}; inset-block-end: ${r(6)}; z-index: 2; padding: 0; }
|
|
1195
|
+
.stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impkt-color-surface-card, #fff); }
|
|
1196
|
+
/* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */
|
|
1197
|
+
.controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }
|
|
1198
|
+
.pause {
|
|
1199
|
+
min-width: ${f("target.min","24px")};
|
|
1200
|
+
min-height: ${f("target.min","24px")};
|
|
1201
|
+
padding: ${r(2)} ${r(4)};
|
|
1202
|
+
border-radius: ${f("radius.full","9999px")};
|
|
1203
|
+
border: 1px solid ${e.border};
|
|
1204
|
+
background: ${e.surfaceCard};
|
|
1205
|
+
color: ${e.text};
|
|
1206
|
+
font-size: ${$("sm")};
|
|
1207
|
+
font-weight: ${u("medium")};
|
|
1208
|
+
cursor: pointer;
|
|
1209
|
+
}
|
|
1210
|
+
.pause:focus-visible {
|
|
1211
|
+
outline: none;
|
|
1212
|
+
box-shadow: ${f("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1213
|
+
}
|
|
1214
|
+
@media (max-width: 48rem) {
|
|
1215
|
+
:host([layout='split']) .frame {
|
|
1216
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1217
|
+
}
|
|
1218
|
+
:host([layout='split']) .stage {
|
|
1219
|
+
height: 50svh;
|
|
1220
|
+
z-index: 1;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1224
|
+
:host {
|
|
1225
|
+
min-height: 0 !important;
|
|
1226
|
+
}
|
|
1227
|
+
.stage {
|
|
1228
|
+
position: relative;
|
|
1229
|
+
height: auto;
|
|
1230
|
+
gap: ${r(6)};
|
|
1231
|
+
}
|
|
1232
|
+
/* With less motion the layers are shown one after another, so every
|
|
1233
|
+
state the scene would have moved through can still be seen. */
|
|
1234
|
+
.stage ::slotted(*) {
|
|
1235
|
+
grid-area: auto;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
`]}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(i){i.has("length")&&this.style.setProperty("--impkt-scene-length",String(this.length)),i.has("progress")&&this.publish(),i.has("drive")&&(this.started=0,this.schedule())}seek(i,s=0){if(s<=0||this.reduced){this.progress=We(i);return}this.seekFrom=this.progress,this.seekTo=We(i),this.seekStart=0,this.seekMs=s,this.schedule()}schedule(){!this.frame&&typeof requestAnimationFrame=="function"&&(this.frame=requestAnimationFrame(this.tick))}publish(){this.style.setProperty("--impkt-scene-progress",this.progress.toFixed(4)),this.dispatchEvent(new CustomEvent("impkt-scene-progress",{detail:{progress:this.progress},bubbles:!0,composed:!0}))}setPaused(i){this.paused!==i&&(this.paused=i,this.started=0,this.schedule(),this.requestUpdate())}pause(){this.setPaused(!0)}render(){let i=this.drive==="loop",s=this.controls==="over"&&!this.reduced,n=a`<div class="controls" part="controls">
|
|
1239
|
+
<slot name="controls"></slot>
|
|
1240
|
+
${i&&!this.reduced?a`<button class="pause" type="button" aria-pressed=${this.paused?"true":"false"} @click=${this.togglePause}>
|
|
1241
|
+
${this.paused?g("Play {name}",{name:this.label}):g("Pause {name}",{name:this.label})}
|
|
1242
|
+
</button>`:l}
|
|
1243
|
+
</div>`,d=a`<div class="stage" part="stage"><slot name="stage"></slot>${s?n:l}</div>`;return a`
|
|
1244
|
+
<div class="frame" part="frame" role="region" aria-label=${this.label}>
|
|
1245
|
+
${this.layout==="split"?a`<div class="content" part="content"><slot></slot></div>${d}`:a`${d}<div class="content" part="content"><slot></slot></div>`}
|
|
1246
|
+
</div>
|
|
1247
|
+
${s?l:n}
|
|
1248
|
+
`}};customElements.define("impkt-scene",Ue);var Si={brand:"var(--impkt-color-brand-default, #1f4ed8)",accent:"var(--impkt-color-accent-default, #c8a15a)",info:"var(--impkt-color-status-info-default, #1f4ed8)",success:"var(--impkt-color-status-success-default, #047857)",warning:"var(--impkt-color-status-warning-default, #b45309)",danger:"var(--impkt-color-status-danger-default, #c8102e)"},Ve=class extends c{constructor(){super();this.scene=null;this.onProgress=i=>{this.value=i.detail.progress};this.onInput=i=>{let s=Number(i.target.value)/1e3;this.value=s,this.scene?.seek(s)};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=[...c.styles,h`
|
|
1249
|
+
:host {
|
|
1250
|
+
display: block;
|
|
1251
|
+
width: 100%;
|
|
1252
|
+
max-width: 48rem;
|
|
1253
|
+
margin-inline: auto;
|
|
1254
|
+
}
|
|
1255
|
+
.wrap {
|
|
1256
|
+
display: grid;
|
|
1257
|
+
gap: ${r(2)};
|
|
1258
|
+
padding: ${r(3)} ${r(4)};
|
|
1259
|
+
border-radius: ${f("radius.xl","16px")};
|
|
1260
|
+
background: ${e.surfaceCard};
|
|
1261
|
+
box-shadow: ${f("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")};
|
|
1262
|
+
border: 1px solid ${e.border};
|
|
1263
|
+
}
|
|
1264
|
+
input {
|
|
1265
|
+
width: 100%;
|
|
1266
|
+
min-height: ${f("target.min","24px")};
|
|
1267
|
+
accent-color: ${e.brand};
|
|
1268
|
+
margin: 0;
|
|
1269
|
+
}
|
|
1270
|
+
.stops {
|
|
1271
|
+
position: relative;
|
|
1272
|
+
display: flex;
|
|
1273
|
+
flex-wrap: wrap;
|
|
1274
|
+
gap: ${r(2)};
|
|
1275
|
+
list-style: none;
|
|
1276
|
+
margin: 0;
|
|
1277
|
+
padding: 0;
|
|
1278
|
+
}
|
|
1279
|
+
button {
|
|
1280
|
+
min-height: ${f("target.min","24px")};
|
|
1281
|
+
padding: ${r(1)} ${r(3)};
|
|
1282
|
+
border-radius: ${f("radius.full","9999px")};
|
|
1283
|
+
border: 1px solid ${e.border};
|
|
1284
|
+
background: transparent;
|
|
1285
|
+
color: ${e.textMuted};
|
|
1286
|
+
font-size: ${$("xs")};
|
|
1287
|
+
font-weight: ${u("medium")};
|
|
1288
|
+
cursor: pointer;
|
|
1289
|
+
}
|
|
1290
|
+
button[aria-current='true'] {
|
|
1291
|
+
color: ${e.text};
|
|
1292
|
+
border-color: ${e.text};
|
|
1293
|
+
}
|
|
1294
|
+
.sr-only {
|
|
1295
|
+
${E}
|
|
1296
|
+
}
|
|
1297
|
+
/* The graph look: the code of where you are, the line of stops, where you are. */
|
|
1298
|
+
:host([look='graph']) { max-width: none; }
|
|
1299
|
+
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${r(6)}; align-items: center; padding: ${r(4)} ${r(6)}; border-radius: ${f("radius.xl","16px")}; background: ${e.surfaceCard}; box-shadow: ${f("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${e.border}; }
|
|
1300
|
+
.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; }
|
|
1301
|
+
.head { display: grid; gap: 2px; }
|
|
1302
|
+
.head .k { color: ${e.textMuted}; text-transform: uppercase; }
|
|
1303
|
+
.head .code { font-size: ${$("md")}; color: ${e.text}; }
|
|
1304
|
+
.head .note { color: ${e.textMuted}; }
|
|
1305
|
+
.line { position: relative; block-size: 48px; }
|
|
1306
|
+
.track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${e.border}; opacity: 0.5; }
|
|
1307
|
+
.fill { opacity: 1; background: none; display: flex; overflow: hidden; }
|
|
1308
|
+
.fill span { block-size: 100%; }
|
|
1309
|
+
.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: ${e.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
|
|
1310
|
+
.dot[data-passed] { background: var(--c); }
|
|
1311
|
+
.dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
|
|
1312
|
+
.dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${e.textMuted}; text-transform: uppercase; pointer-events: none; }
|
|
1313
|
+
.dot-label[data-current] { color: ${e.text}; font-weight: ${u("bold")}; }
|
|
1314
|
+
.line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
|
|
1315
|
+
.line input:focus-visible { opacity: 1; }
|
|
1316
|
+
.where { display: grid; gap: ${r(2)}; justify-items: end; }
|
|
1317
|
+
.chip { display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border-radius: ${f("radius.full","9999px")}; border: 1px solid ${e.border}; color: ${e.text}; text-transform: uppercase; }
|
|
1318
|
+
.chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
|
|
1319
|
+
.hint { color: ${e.textMuted}; text-transform: uppercase; }
|
|
1320
|
+
@media (max-width: 48rem) {
|
|
1321
|
+
.graph { grid-template-columns: minmax(0, 1fr); }
|
|
1322
|
+
.where { justify-items: start; }
|
|
1323
|
+
.dot-label:not([data-current]) { display: none; }
|
|
1324
|
+
}
|
|
1325
|
+
button:focus-visible,
|
|
1326
|
+
input:focus-visible {
|
|
1327
|
+
outline: none;
|
|
1328
|
+
box-shadow: ${f("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1329
|
+
}
|
|
1330
|
+
`]}connectedCallback(){super.connectedCallback(),this.scene=this.closest("impkt-scene"),this.scene?.addEventListener("impkt-scene-progress",this.onProgress),this.scene&&(this.value=this.scene.progress)}disconnectedCallback(){super.disconnectedCallback(),this.scene?.removeEventListener("impkt-scene-progress",this.onProgress),this.scene=null}goTo(i){this.scene?.seek(i.at,600)}nearest(){let i=-1,s=1/0;return this.stops.forEach((n,d)=>{let p=Math.abs(n.at-this.value);p<s&&(s=p,i=d)}),i}renderGraph(i,s){let n=i,d=[...this.stops??[]].sort((x,v)=>x.at-v.at);n=d.indexOf(this.stops[n]);let p=x=>{let v=x?.tone??"brand";return typeof v=="number"?`var(--impkt-color-chart-${v}, ${Si.brand})`:Si[v]??Si.brand},b=d[n]??d[0],y=d.map((x,v)=>{let M=v===0?0:d[v-1].at,I=Math.min(x.at,this.value);return{width:Math.round(Math.max(0,I-M)*1e4)/100,c:p(x)}});return a`<div class="graph" part="wrap">
|
|
1331
|
+
<div class="head mono" aria-hidden="true">
|
|
1332
|
+
<span class="k">HEAD</span>
|
|
1333
|
+
<span class="code">${b?.meta??b?.label??""}</span>
|
|
1334
|
+
${b?.note?a`<span class="note">${b.note}</span>`:null}
|
|
1335
|
+
</div>
|
|
1336
|
+
<div class="line">
|
|
1337
|
+
<div class="track"></div>
|
|
1338
|
+
<div class="fill" aria-hidden="true">${y.map(x=>a`<span style=${`width:${x.width}%;background:${x.c}`}></span>`)}</div>
|
|
1339
|
+
${d.map((x,v)=>a`
|
|
1340
|
+
<button type="button" class="dot" style=${`left:${x.at*100}%;--c:${p(x)}`} ?data-passed=${x.at<=this.value+1e-4} aria-current=${v===n?"true":"false"} @click=${()=>this.goTo(x)}>
|
|
1341
|
+
<span class="sr-only">${g("Go to {name}",{name:x.label})}</span>
|
|
1342
|
+
</button>
|
|
1343
|
+
<span class="dot-label mono" style=${`left:${x.at*100}%`} ?data-current=${v===n} aria-hidden="true">${x.label}</span>`)}
|
|
1344
|
+
<input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value*1e3))} aria-label=${this.label} aria-valuetext=${s} @input=${this.onInput} />
|
|
1345
|
+
</div>
|
|
1346
|
+
<div class="where" aria-hidden="true">
|
|
1347
|
+
${b?a`<span class="chip mono" style=${`--c:${p(b)}`}>${b.label}${b.meta?a` <span style="opacity:.6">${b.meta}</span>`:null}</span>`:null}
|
|
1348
|
+
${this.hint?a`<span class="hint mono">${this.hint}</span>`:null}
|
|
1349
|
+
</div>
|
|
1350
|
+
</div>`}render(){let i=this.nearest(),s=i>=0?this.stops[i].label:`${Math.round(this.value*100)}%`;return this.look==="graph"?this.renderGraph(i,s):a`
|
|
1351
|
+
<div class="wrap" part="wrap">
|
|
1352
|
+
<input
|
|
1353
|
+
type="range"
|
|
1354
|
+
min="0"
|
|
1355
|
+
max="1000"
|
|
1356
|
+
step="1"
|
|
1357
|
+
.value=${String(Math.round(this.value*1e3))}
|
|
1358
|
+
aria-label=${this.label}
|
|
1359
|
+
aria-valuetext=${s}
|
|
1360
|
+
@input=${this.onInput}
|
|
1361
|
+
/>
|
|
1362
|
+
${this.stops.length?a`<ul class="stops" part="stops">
|
|
1363
|
+
${this.stops.map((n,d)=>a`<li>
|
|
1364
|
+
<button type="button" aria-current=${d===i?"true":"false"} @click=${()=>this.goTo(n)}>
|
|
1365
|
+
<span aria-hidden="true">${n.label}</span><span class="sr-only">${g("Go to {name}",{name:n.label})}</span>
|
|
1366
|
+
</button>
|
|
1367
|
+
</li>`)}
|
|
1368
|
+
</ul>`:null}
|
|
1369
|
+
</div>
|
|
1370
|
+
`}};customElements.define("impkt-scrubber",Ve);var Ke=class extends c{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=[...c.styles,k,w,h`
|
|
1371
|
+
:host { display: block; container-type: inline-size; }
|
|
1372
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: ${r(6)}; align-items: start; }
|
|
1373
|
+
.plan { position: relative; overflow: hidden; border-radius: ${e.radius2xl}; background: ${e.surfaceSubtle}; box-shadow: ${e.shadowMd}; line-height: 0; }
|
|
1374
|
+
.plan img { inline-size: 100%; block-size: auto; }
|
|
1375
|
+
.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; ${m("xs")} line-height: 1; font-weight: ${u("bold")}; color: ${e.onBrand}; background: ${e.brand}; border: 2px solid ${e.surfaceCard}; border-radius: 50%; box-shadow: ${e.shadowMd}; cursor: pointer; transition: transform 120ms ease-in-out; }
|
|
1376
|
+
.pin:hover { transform: scale(1.12); }
|
|
1377
|
+
.pin.reserved { color: ${e.text}; background: ${e.warningSubtle}; border-color: ${e.warning}; border-style: dashed; }
|
|
1378
|
+
.pin.sold { color: ${e.textMuted}; background: ${e.surfaceCard}; border-color: ${e.border}; border-radius: ${e.radius}; }
|
|
1379
|
+
.pin[aria-pressed='true'] { transform: scale(1.22); box-shadow: ${e.shadowLg}, 0 0 0 3px ${e.brand}; }
|
|
1380
|
+
.panel { display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(6)}; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowSm}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1381
|
+
.hint { margin: 0; color: ${e.textMuted}; }
|
|
1382
|
+
.name { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1383
|
+
.sub { margin: 0; color: ${e.textMuted}; }
|
|
1384
|
+
.price { margin: 0; ${m("xl")} font-weight: ${u("semibold")}; }
|
|
1385
|
+
.status { align-self: flex-start; padding: ${r(.5)} ${r(2.5)}; ${m("xs")} font-weight: ${u("semibold")}; color: ${e.successText}; background: ${e.successSubtle}; border-radius: 999px; }
|
|
1386
|
+
.status.reserved { color: ${e.warningText}; background: ${e.warningSubtle}; }
|
|
1387
|
+
.status.sold { color: ${e.textMuted}; background: ${e.surfaceSubtle}; }
|
|
1388
|
+
.go { ${A} display: inline-flex; align-items: center; justify-content: center; gap: ${r(2)}; padding: ${r(2)} ${r(4)}; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border-radius: ${e.radiusLg}; }
|
|
1389
|
+
.go:hover { background: ${e.brandHover}; }
|
|
1390
|
+
.legend { display: flex; flex-wrap: wrap; gap: ${r(4)}; margin: ${r(3)} 0 0; padding: 0; list-style: none; ${m("sm")} color: ${e.textMuted}; }
|
|
1391
|
+
.legend li { display: inline-flex; align-items: center; gap: ${r(2)}; }
|
|
1392
|
+
.key { box-sizing: border-box; inline-size: 14px; block-size: 14px; background: ${e.brand}; border: 2px solid ${e.surfaceCard}; border-radius: 50%; outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
|
|
1393
|
+
.key.reserved { background: ${e.warningSubtle}; border: 2px dashed ${e.warning}; }
|
|
1394
|
+
.key.sold { background: ${e.surfaceCard}; border: 2px solid ${e.border}; border-radius: 3px; }
|
|
1395
|
+
:host { --plan-card: var(--impkt-solid-card, ${e.surfaceCard}); --plan-text: var(--impkt-solid-text, ${e.text}); --plan-heading: var(--impkt-solid-heading, ${e.text}); --plan-muted: var(--impkt-solid-muted, ${e.textMuted}); }
|
|
1396
|
+
:host([panel='over']) .panel { background: var(--plan-card); color: var(--plan-text); --impkt-color-surface-card: var(--plan-card); --impkt-color-text-default: var(--plan-text); --impkt-color-text-heading: var(--plan-heading); --impkt-color-text-muted: var(--plan-muted); }
|
|
1397
|
+
@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: ${r(8)}; inline-size: 22.5rem; box-sizing: border-box; box-shadow: ${e.shadowXl}; } }
|
|
1398
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
1399
|
+
`]}willUpdate(t){(t.has("selectedPlot")||t.has("plots"))&&this.selectedPlot&&!this.chosen&&(this.chosen=this.plots.find(i=>String(i.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("impkt-select",{detail:{plot:t},bubbles:!0,composed:!0}))}renderPanel(){let t=this.chosen;if(!t)return a`<p class="hint">${this.hint}</p>`;let i=t.status??"available";return a`<span class="status ${i}">${this.word(i)}</span>
|
|
1400
|
+
<p class="name">${this.plotWord} ${t.number}</p>
|
|
1401
|
+
${t.name||t.beds?a`<p class="sub">${[t.name,t.beds].filter(Boolean).join(" \xB7 ")}</p>`:l}
|
|
1402
|
+
${t.price?a`<p class="price">${t.price}</p>`:l}
|
|
1403
|
+
${t.href&&i!=="sold"?a`<a class="go" href=${t.href}>${this.actionText}${S("arrow-right","16px")}</a>`:l}`}render(){return a`<div class="wrap" part="wrap">
|
|
1404
|
+
<div>
|
|
1405
|
+
<div class="plan" part="plan">
|
|
1406
|
+
<img src=${this.imageSrc} alt=${this.imageAlt} />
|
|
1407
|
+
${this.plots.map(t=>{let i=t.status??"available",s=[`${this.plotWord} ${t.number}`,t.name,this.word(i),t.price].filter(Boolean).join(", ");return a`<button class="pin ${i}" type="button" style="left:${Number(t.x)}%;top:${Number(t.y)}%" aria-label=${s} aria-pressed=${String(this.chosen===t)} @click=${()=>this.choose(t)}>${t.number}</button>`})}
|
|
1408
|
+
</div>
|
|
1409
|
+
<ul class="legend">
|
|
1410
|
+
<li><span class="key"></span>${this.availableText}</li>
|
|
1411
|
+
<li><span class="key reserved"></span>${this.reservedText}</li>
|
|
1412
|
+
<li><span class="key sold"></span>${this.soldText}</li>
|
|
1413
|
+
</ul>
|
|
1414
|
+
</div>
|
|
1415
|
+
<div class="panel" part="panel" aria-live="polite">${this.renderPanel()}</div>
|
|
1416
|
+
</div>`}};function Zi(o,t,i){let s=i*12;if(o<=0||s<=0)return 0;let n=t/100/12;return n===0?o/s:o*n/(1-(1+n)**-s)}var Xe=class extends c{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=[...c.styles,k,w,h`
|
|
1417
|
+
:host { display: block; container-type: inline-size; }
|
|
1418
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowMd}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1419
|
+
.inputs { display: flex; flex-direction: column; gap: ${r(5)}; padding: ${r(8)}; }
|
|
1420
|
+
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1421
|
+
label { display: flex; justify-content: space-between; gap: ${r(3)}; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1.5)}; }
|
|
1422
|
+
.read { font-weight: ${u("regular")}; color: ${e.textMuted}; }
|
|
1423
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${r(2)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; }
|
|
1424
|
+
input[type='range'] { inline-size: 100%; min-block-size: 24px; margin: 0; accent-color: ${e.brand}; }
|
|
1425
|
+
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(4)}; }
|
|
1426
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${r(2)}; padding: ${r(8)}; color: ${e.onBrand}; background: ${e.brand}; }
|
|
1427
|
+
.caption { margin: 0; ${m("sm")} opacity: 0.85; }
|
|
1428
|
+
output { display: block; font-family: ${e.fontHeading}; ${m("4xl")} font-weight: ${u("bold")}; }
|
|
1429
|
+
dl { display: grid; gap: ${r(2)}; margin: ${r(4)} 0 0; padding-block-start: ${r(4)}; border-block-start: 1px solid color-mix(in srgb, ${e.onBrand} 25%, transparent); ${m("sm")} }
|
|
1430
|
+
dl div { display: flex; justify-content: space-between; gap: ${r(3)}; }
|
|
1431
|
+
dt { opacity: 0.85; }
|
|
1432
|
+
dd { margin: 0; font-weight: ${u("semibold")}; }
|
|
1433
|
+
.small { grid-column: 1 / -1; margin: 0; padding: ${r(4)} ${r(8)}; ${m("xs")} color: ${e.textMuted}; background: ${e.surfaceSubtle}; }
|
|
1434
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${r(5)}; } .small { padding: ${r(4)} ${r(5)}; } }
|
|
1435
|
+
`]}money(t){try{return new Intl.NumberFormat(B(this),{style:"currency",currency:this.currency,maximumFractionDigits:0}).format(t)}catch{return String(Math.round(t))}}field(t){return i=>{this[t]=Number(i.target.value)||0}}render(){let t=this.price*this.depositPercent/100,i=Math.max(this.price-t,0),s=Zi(i,this.rate,this.years);return a`<div class="wrap" part="wrap">
|
|
1436
|
+
<div class="inputs">
|
|
1437
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1438
|
+
<div><label for=${this.id_("price")}>${g("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>
|
|
1439
|
+
<div><label for=${this.id_("deposit")}>${g("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>
|
|
1440
|
+
<div class="two">
|
|
1441
|
+
<div><label for=${this.id_("years")}>${g("Term")} <span class="read">${g("{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>
|
|
1442
|
+
<div><label for=${this.id_("rate")}>${g("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>
|
|
1443
|
+
</div>
|
|
1444
|
+
</div>
|
|
1445
|
+
<div class="result">
|
|
1446
|
+
<p class="caption">${g("Estimated monthly repayment")}</p>
|
|
1447
|
+
<output for=${`${this.id_("price")} ${this.id_("deposit")} ${this.id_("years")} ${this.id_("rate")}`}>${this.money(s)}</output>
|
|
1448
|
+
<dl>
|
|
1449
|
+
<div><dt>${g("You would borrow")}</dt><dd>${this.money(i)}</dd></div>
|
|
1450
|
+
<div><dt>${g("Total repayable")}</dt><dd>${this.money(s*this.years*12)}</dd></div>
|
|
1451
|
+
</dl>
|
|
1452
|
+
</div>
|
|
1453
|
+
${this.smallPrint?a`<p class="small">${this.smallPrint}</p>`:l}
|
|
1454
|
+
</div>`}},Ge=class extends c{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=[...c.styles,k,w,h`
|
|
1455
|
+
.frame { position: relative; overflow: hidden; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowLg}; line-height: 0; --at: 50%; }
|
|
1456
|
+
img { display: block; inline-size: 100%; block-size: auto; }
|
|
1457
|
+
.after { position: absolute; inset: 0; block-size: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--at)); }
|
|
1458
|
+
.tag { position: absolute; inset-block-start: ${r(3)}; padding: ${r(1)} ${r(3)}; ${m("xs")} line-height: 1.4; font-weight: ${u("semibold")}; color: ${e.text}; background: ${e.surfaceCard}; border-radius: 999px; box-shadow: ${e.shadowSm}; }
|
|
1459
|
+
.tag.b { inset-inline-start: ${r(3)}; }
|
|
1460
|
+
.tag.a { inset-inline-end: ${r(3)}; }
|
|
1461
|
+
.line { position: absolute; inset-block: 0; inset-inline-start: var(--at); inline-size: 2px; margin-inline-start: -1px; background: ${e.surfaceCard}; pointer-events: none; }
|
|
1462
|
+
.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: ${e.text}; background: ${e.surfaceCard}; border-radius: 50%; box-shadow: ${e.shadowMd}; }
|
|
1463
|
+
input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
|
|
1464
|
+
.frame:has(input:focus-visible) .grip { box-shadow: ${e.focusShadow}; }
|
|
1465
|
+
`]}render(){return a`<div class="frame" part="frame" style="--at:${this.position}%">
|
|
1466
|
+
<img src=${this.beforeSrc} alt=${this.beforeAlt} />
|
|
1467
|
+
<img class="after" src=${this.afterSrc} alt=${this.afterAlt} />
|
|
1468
|
+
<span class="tag b" aria-hidden="true">${this.beforeLabel}</span>
|
|
1469
|
+
<span class="tag a" aria-hidden="true">${this.afterLabel}</span>
|
|
1470
|
+
<span class="line"><span class="grip">${S("arrow-left","14px")}${S("arrow-right","14px")}</span></span>
|
|
1471
|
+
<input type="range" min="0" max="100" aria-label=${this.label} .value=${String(this.position)} @input=${t=>{this.position=Number(t.target.value)}} />
|
|
1472
|
+
</div>`}},Ye=class extends c{constructor(){super();this.shown=!1;this.check=()=>{let i=window.scrollY>=this.revealAfter;i!==this.shown&&(this.shown=i,this.requestUpdate(),this.clearance(i))};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=[...c.styles,k,h`
|
|
1473
|
+
:host { display: block; }
|
|
1474
|
+
.bar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: ${r(4)}; padding: ${r(3)} ${r(4)} calc(${r(3)} + env(safe-area-inset-bottom)); background: ${e.surfaceCard}; box-shadow: ${e.shadowXl}, 0 -1px 0 color-mix(in srgb, ${e.text} 8%, transparent); transform: translateY(110%); visibility: hidden; transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms; }
|
|
1475
|
+
.bar.on { transform: none; visibility: visible; }
|
|
1476
|
+
.spacer { block-size: 5rem; }
|
|
1477
|
+
.h { font-family: ${e.fontHeading}; ${m("md")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1478
|
+
.t { ${m("xs")} color: ${e.textMuted}; }
|
|
1479
|
+
.words { min-inline-size: 0; }
|
|
1480
|
+
.actions { display: flex; flex: none; gap: ${r(2)}; }
|
|
1481
|
+
@media (min-width: 48rem) { :host([show-on='phones']) { display: none; } }
|
|
1482
|
+
`]}clearance(i){let n=i&&getComputedStyle(this).display!=="none"?`${this.renderRoot.querySelector(".bar")?.getBoundingClientRect().height??80}px`:"",d=document.documentElement.style;d.scrollPaddingBlockEnd=n,n?d.setProperty("--impkt-bottom-bar",n):d.removeProperty("--impkt-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 a`<div class="spacer"></div>
|
|
1483
|
+
<section class="bar ${this.shown?"on":""}" part="bar" aria-label=${this.label}>
|
|
1484
|
+
<div class="words">
|
|
1485
|
+
${this.heading?a`<div class="h">${this.heading}</div>`:l}
|
|
1486
|
+
${this.lead?a`<div class="t">${this.lead}</div>`:l}
|
|
1487
|
+
</div>
|
|
1488
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
1489
|
+
</section>`}},Qe=class extends c{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=[...c.styles,k,w,h`
|
|
1490
|
+
:host { display: block; container-type: inline-size; }
|
|
1491
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowMd}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1492
|
+
.wrap.solo { grid-template-columns: minmax(0, 1fr); }
|
|
1493
|
+
.map { min-block-size: 16rem; background: ${e.surfaceSubtle}; }
|
|
1494
|
+
.map img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
1495
|
+
.info { display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(8)}; }
|
|
1496
|
+
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1497
|
+
.row { display: flex; gap: ${r(3)}; margin: 0; white-space: pre-line; }
|
|
1498
|
+
.row svg { flex: none; margin-block-start: ${r(.5)}; color: ${e.brand}; }
|
|
1499
|
+
a { color: ${e.link}; }
|
|
1500
|
+
ul { display: grid; gap: ${r(1.5)}; margin: ${r(1)} 0; padding: ${r(3)} 0 0; list-style: none; border-block-start: 1px solid color-mix(in srgb, ${e.text} 10%, transparent); ${m("sm")} }
|
|
1501
|
+
li { display: flex; justify-content: space-between; gap: ${r(3)}; }
|
|
1502
|
+
li span:last-child { color: ${e.textMuted}; text-align: end; }
|
|
1503
|
+
.go { ${A} align-self: flex-start; display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(2)} ${r(4)}; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border-radius: ${e.radiusLg}; }
|
|
1504
|
+
.go:hover { background: ${e.brandHover}; }
|
|
1505
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .info { padding: ${r(5)}; } }
|
|
1506
|
+
`]}render(){let t=this.directionsHref||(this.address?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(this.address)}`:"");return a`<div class="wrap ${this.mapSrc?"":"solo"}" part="wrap">
|
|
1507
|
+
${this.mapSrc?a`<div class="map"><img src=${this.mapSrc} alt=${this.mapAlt} /></div>`:l}
|
|
1508
|
+
<div class="info">
|
|
1509
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1510
|
+
${this.address?a`<p class="row">${S("map-pin","20px")}<span>${this.address}</span></p>`:l}
|
|
1511
|
+
${this.hours?a`<p class="row">${S("clock","20px")}<span>${this.hours}</span></p>`:l}
|
|
1512
|
+
${this.phone?a`<p class="row">${S("phone","20px")}<a href=${`tel:${this.phone.replace(/\s+/g,"")}`}>${this.phone}</a></p>`:l}
|
|
1513
|
+
${this.nearby.length?a`<ul>${this.nearby.map(i=>a`<li><span>${i.place}</span><span>${i.distance}</span></li>`)}</ul>`:l}
|
|
1514
|
+
${t?a`<a class="go" href=${t}>${this.directionsText}${S("arrow-right","16px")}</a>`:l}
|
|
1515
|
+
</div>
|
|
1516
|
+
</div>`}};customElements.define("impkt-site-plan",Ke);customElements.define("impkt-mortgage-calculator",Xe);customElements.define("impkt-before-after",Ge);customElements.define("impkt-sticky-bar",Ye);customElements.define("impkt-location-card",Qe);var re={brand:"var(--impkt-color-brand-default, #1f4ed8)",accent:"var(--impkt-color-accent-default, #c8a15a)",info:"var(--impkt-color-status-info-default, #1f4ed8)",success:"var(--impkt-color-status-success-default, #047857)",warning:"var(--impkt-color-status-warning-default, #b45309)",danger:"var(--impkt-color-status-danger-default, #c8102e)"},Ze=["success","info","warning","accent","danger","brand"],P=(o,t)=>typeof o=="number"?`var(--impkt-color-chart-${o}, ${re[Ze[(o-1)%Ze.length]]})`:o&&o in re?re[o]:`var(--impkt-color-chart-${t%5+1}, ${re[Ze[t%Ze.length]]})`;function zi(o,t){let i=()=>{o.setAttribute("shown",""),t?.()};if(typeof IntersectionObserver!="function")return i(),()=>{};let s=new IntersectionObserver(n=>{n.some(d=>d.isIntersecting)&&(i(),s.disconnect())},{threshold:.25});return s.observe(o),()=>s.disconnect()}var Ji=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,st=h`.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; }`,Cr=(o,t,i)=>{switch(Math.min(Math.max(o||3,2),6)){case 2:return a`<h2 class=${i}>${t}</h2>`;case 4:return a`<h4 class=${i}>${t}</h4>`;case 5:return a`<h5 class=${i}>${t}</h5>`;case 6:return a`<h6 class=${i}>${t}</h6>`;default:return a`<h3 class=${i}>${t}</h3>`}},at=h`
|
|
1517
|
+
.h { margin: 0; color: var(--impkt-heading, ${e.textHeading}); font-family: ${e.fontHeading}; font-weight: ${u("bold")}; letter-spacing: ${e.trackingTight}; text-wrap: balance; }
|
|
1518
|
+
.body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
|
|
1519
|
+
.meta { margin: 0; color: inherit; opacity: 0.6; text-transform: uppercase; }
|
|
1520
|
+
.sr-only { ${E} }
|
|
1521
|
+
`,Je=class extends c{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=[...c.styles,w,st,at,h`
|
|
1522
|
+
:host { display: block; }
|
|
1523
|
+
article { display: flex; flex-direction: column; gap: ${r(3)}; }
|
|
1524
|
+
.media { border-radius: ${e.radiusXl}; overflow: clip; background: ${e.surfaceInset}; }
|
|
1525
|
+
.media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
|
|
1526
|
+
impkt-before-after { display: block; }
|
|
1527
|
+
.h { font-size: ${$("3xl")}; }
|
|
1528
|
+
.h a { color: inherit; text-decoration: none; }
|
|
1529
|
+
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1530
|
+
.h a:focus-visible { outline: none; box-shadow: ${e.focusShadow}; border-radius: ${e.radiusSm}; }
|
|
1531
|
+
ul { list-style: none; margin: ${r(1)} 0 0; padding: 0; display: grid; gap: ${r(1)}; }
|
|
1532
|
+
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border-radius: ${e.radius}; }
|
|
1533
|
+
li[data-change='added'] { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
1534
|
+
li[data-change='removed'] { background: ${e.dangerSubtle}; color: ${e.dangerText}; }
|
|
1535
|
+
li[data-change='same'] { color: ${e.textMuted}; }
|
|
1536
|
+
.sign { font-weight: ${u("bold")}; }
|
|
1537
|
+
`]}wipe(i){let s=this.renderRoot.querySelector("impkt-before-after");if(!s)return;if(cancelAnimationFrame(this.raf),Ji()){s.position=i;return}let n=s.position??Ti,d=performance.now(),p=y=>y<.5?4*y*y*y:1-Math.pow(-2*y+2,3)/2,b=y=>{let x=Math.min(1,(y-d)/450);s.position=n+(i-n)*p(x),x<1&&(this.raf=requestAnimationFrame(b))};this.raf=requestAnimationFrame(b)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf)}render(){let i=this.beforeSrc&&this.afterSrc,s=this.href?a`<a href=${this.href}>${this.heading}</a>`:this.heading,n={added:"+",removed:"\u2212",same:" "},d={added:g("Added"),removed:g("Removed"),same:g("Kept")};return a`<article part="card">
|
|
1538
|
+
${i?a`<div class="media" @pointerenter=${p=>p.pointerType==="mouse"&&this.wipe(0)} @pointerleave=${p=>p.pointerType==="mouse"&&this.wipe(Ti)}><impkt-before-after .position=${Ti} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${g("Before")} .afterLabel=${g("Shipped")} .label=${g("Compare {name} before and after",{name:this.heading})}></impkt-before-after></div>`:this.afterSrc||this.beforeSrc?a`<div class="media"><img src=${this.afterSrc||this.beforeSrc} alt=${this.afterSrc?this.afterAlt:this.beforeAlt} loading="lazy" /></div>`:l}
|
|
1539
|
+
${this.label?a`<p class="meta mono">${this.label}</p>`:l}
|
|
1540
|
+
${this.heading?Rr(this.headingLevel,s):l}
|
|
1541
|
+
${this.text?a`<p class="body">${this.text}</p>`:l}
|
|
1542
|
+
${(this.items??[]).length?a`<ul class="mono" part="diff">${this.items.map(p=>a`<li data-change=${p.change}><span class="sign" aria-hidden="true">${n[p.change]??" "}</span><span><span class="sr-only">${d[p.change]??""}: </span>${p.text}</span></li>`)}</ul>`:l}
|
|
1543
|
+
</article>`}},et=class extends c{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=[...c.styles,w,h`
|
|
1544
|
+
:host { display: block; container-type: inline-size; }
|
|
1545
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(12)} ${r(10)}; }
|
|
1546
|
+
:host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
|
|
1547
|
+
:host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1548
|
+
@container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
1549
|
+
`]}render(){let t=typeof location>"u"?"":location.pathname.replace(/\/$/,""),i=(this.items??[]).filter(s=>!s.href||s.href.replace(/\/$/,"")!==t);return a`<ul part="list">${i.map(s=>{let n=s.heading??s.title??"";return a`<li><impkt-release-card
|
|
1550
|
+
.label=${s.label??""} .heading=${n} .text=${s.text??""} .href=${s.href??""}
|
|
1551
|
+
.beforeSrc=${s.beforeSrc??""} .beforeAlt=${s.beforeAlt||g("{name} as a wireframe",{name:n})}
|
|
1552
|
+
.afterSrc=${s.afterSrc??""} .afterAlt=${s.afterAlt||g("{name} as it shipped",{name:n})}
|
|
1553
|
+
.items=${s.items??[]} .headingLevel=${this.headingLevel}></impkt-release-card></li>`})}</ul>`}},Ti=42;function Rr(o,t){let i=Math.min(Math.max(o||3,2),6);return i===2?a`<h2 class="h">${t}</h2>`:i===4?a`<h4 class="h">${t}</h4>`:i===5?a`<h5 class="h">${t}</h5>`:i===6?a`<h6 class="h">${t}</h6>`:a`<h3 class="h">${t}</h3>`}var tt=class extends c{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=[...c.styles,w,st,at,h`
|
|
1554
|
+
:host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
|
|
1555
|
+
ul { list-style: none; margin: 0; padding: 0; position: relative; }
|
|
1556
|
+
ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
|
|
1557
|
+
li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${r(6)}; }
|
|
1558
|
+
.graph { position: relative; }
|
|
1559
|
+
.graph svg { position: absolute; inset-block-start: -${r(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${r(12)}); overflow: visible; }
|
|
1560
|
+
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${r(4)} ${r(10)}; align-items: start; }
|
|
1561
|
+
.path { margin: 0 0 ${r(2)}; opacity: 0.6; }
|
|
1562
|
+
.h { font-size: ${$("3xl")}; line-height: 1.05; }
|
|
1563
|
+
.h a { color: inherit; text-decoration: none; }
|
|
1564
|
+
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1565
|
+
.h a:focus-visible { outline: none; box-shadow: ${e.focusShadow}; border-radius: ${e.radiusSm}; }
|
|
1566
|
+
.detail { display: flex; flex-direction: column; gap: ${r(3)}; padding-block-start: ${r(1)}; }
|
|
1567
|
+
.tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
|
|
1568
|
+
.end { position: relative; display: flex; align-items: center; gap: ${r(3)}; padding-block-start: ${r(4)}; }
|
|
1569
|
+
.end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
|
|
1570
|
+
@container (max-width: 44rem) {
|
|
1571
|
+
li { grid-template-columns: 56px minmax(0, 1fr); }
|
|
1572
|
+
.graph svg { inline-size: 56px; }
|
|
1573
|
+
.row { grid-template-columns: minmax(0, 1fr); }
|
|
1574
|
+
.h { font-size: ${$("2xl")}; }
|
|
1575
|
+
}
|
|
1576
|
+
/* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
|
|
1577
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1578
|
+
.graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
|
|
1579
|
+
.graph circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
|
|
1580
|
+
:host([shown]) .graph svg { clip-path: inset(0); }
|
|
1581
|
+
:host([shown]) .graph circle { transform: scale(1); }
|
|
1582
|
+
}
|
|
1583
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let i=s=>z`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
1584
|
+
<path d="M12 0 C12 40 60 30 60 70 L60 120 C60 160 12 160 12 200" fill="none" stroke=${s} stroke-width="3" vector-effect="non-scaling-stroke" />
|
|
1585
|
+
<circle cx="60" cy="86" r="8" fill=${s} />
|
|
1586
|
+
</svg>`;return a`<ul part="list">${(this.items??[]).map((s,n)=>a`<li part="item" style=${`--i:${n}`}>
|
|
1587
|
+
<div class="graph">${i(P(s.tone,n))}</div>
|
|
1588
|
+
<div>
|
|
1589
|
+
${s.path?a`<p class="path mono">${s.path}</p>`:l}
|
|
1590
|
+
<div class="row">
|
|
1591
|
+
${Cr(this.headingLevel,s.href?a`<a href=${s.href}>${s.heading}</a>`:s.heading,"h")}
|
|
1592
|
+
<div class="detail">
|
|
1593
|
+
${s.text?a`<p class="body">${s.text}</p>`:l}
|
|
1594
|
+
${s.tags?.length?a`<p class="tags mono">${s.tags.join(" \xB7 ")}</p>`:l}
|
|
1595
|
+
</div>
|
|
1596
|
+
</div>
|
|
1597
|
+
</div>
|
|
1598
|
+
</li>`)}</ul>
|
|
1599
|
+
${this.trunk?a`<p class="end mono" part="trunk">${this.trunk}</p>`:l}`}},it=class extends c{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=[...c.styles,w,st,at,h`
|
|
1600
|
+
:host { display: block; container-type: inline-size; }
|
|
1601
|
+
.summary { display: inline-flex; align-items: center; gap: ${r(2)}; margin: 0 0 ${r(6)}; padding: ${r(1)} ${r(3)}; border-radius: ${e.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
|
|
1602
|
+
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${e.success}; }
|
|
1603
|
+
/* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
|
|
1604
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${r(6)}; }
|
|
1605
|
+
li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${r(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
|
|
1606
|
+
/* Checks run: each tick pops in, 150 ms after the one above. */
|
|
1607
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1608
|
+
.tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
|
|
1609
|
+
:host([shown]) .tick { transform: scale(1); }
|
|
1610
|
+
}
|
|
1611
|
+
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1612
|
+
/* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
|
|
1613
|
+
.tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${e.success}; color: var(--impkt-color-status-success-on, #fff); }
|
|
1614
|
+
.figure { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; font-size: ${$("5xl")}; line-height: 1; letter-spacing: ${e.trackingTight}; white-space: nowrap; }
|
|
1615
|
+
.label { margin: 0; ${m("xl")} }
|
|
1616
|
+
.status { margin: 0; opacity: 0.6; }
|
|
1617
|
+
@container (max-width: 40rem) {
|
|
1618
|
+
ul { grid-template-columns: 28px minmax(0, 1fr); }
|
|
1619
|
+
li { row-gap: ${r(1)}; }
|
|
1620
|
+
.label, .status { grid-column: 2; }
|
|
1621
|
+
.figure { font-size: ${$("4xl")}; }
|
|
1622
|
+
}
|
|
1623
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this,()=>this.run())}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}run(){if(Ji())return;let i=this.items??[],s=performance.now(),n=d=>{this.counted=i.map((p,b)=>Math.min(1,Math.max(0,(d-s-b*150)/1200))),this.requestUpdate(),this.counted.some(p=>p<1)?requestAnimationFrame(n):this.counted=null};requestAnimationFrame(n)}render(){let i=(s,n)=>{let d=this.counted?.[n],p=/^(\d+)(.*)$/.exec(s);if(d===void 0||d>=1||!p)return a`${s}`;let b=1-Math.pow(1-d,3);return a`<span aria-hidden="true">${Math.round(Number(p[1])*b)}${p[2]}</span><span class="sr-only">${s}</span>`};return a`${this.summary?a`<p class="summary mono" part="summary">${this.summary}</p>`:l}
|
|
1624
|
+
<ul part="list">${(this.items??[]).map((s,n)=>a`<li part="item" style=${`--i:${n}`}>
|
|
1625
|
+
<span class="tick" aria-hidden="true">${S("check","16px")}</span>
|
|
1626
|
+
<p class="figure">${i(s.figure,n)}</p>
|
|
1627
|
+
<p class="label">${s.label}</p>
|
|
1628
|
+
${s.status?a`<p class="status mono">${s.status}</p>`:a`<span></span>`}
|
|
1629
|
+
</li>`)}</ul>`}},rt=class extends c{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=[...c.styles,w,st,at,h`
|
|
1630
|
+
:host { display: block; overflow-x: auto; }
|
|
1631
|
+
svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
|
|
1632
|
+
text { font-family: ${e.fontMono}; font-size: 12px; fill: currentColor; }
|
|
1633
|
+
.faint { opacity: 0.5; }
|
|
1634
|
+
/* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
|
|
1635
|
+
.halo { paint-order: stroke; stroke: var(--impkt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
|
|
1636
|
+
/* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
|
|
1637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
+
svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
|
|
1639
|
+
:host([shown]) svg { clip-path: inset(0 -40px 0 0); }
|
|
1640
|
+
}
|
|
1641
|
+
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let d=this.span>0?this.span:20,p=L=>24+Math.min(Math.max(L,0),d)/d*1116,b=this.lanes??[],y=52,x=40+(b.length+1)*y+40,v=40,M=L=>v+(L+1)*y,I=[];for(let L=0;L<=d;L+=Math.max(1,this.every||2))I.push(L);let N=L=>b.findIndex(_=>L>=_.from&&L<=_.to),J=L=>(this.marks??[]).some(_=>N(_.at)===L),di=this.unit||g("wk"),ur=this.label||g("Project timeline"),mr=b.map(L=>`${L.label}: ${g("{unit} {from} to {to}",{unit:di,from:L.from,to:L.to})}`).join("; ");return a`<figure part="figure" style="margin:0">
|
|
1642
|
+
<svg viewBox="0 0 ${1200} ${x}" role="img" aria-label=${`${ur}. ${mr}${this.release?`. ${g("{name} at {unit} {at}",{name:this.release,unit:di,at:this.releaseAt})}`:""}`}>
|
|
1643
|
+
<line x1=${24} y1=${v} x2=${1180} y2=${v} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
1644
|
+
<path d="M${1168} ${v-7} L${1180} ${v} L${1168} ${v+7}" fill="none" stroke="currentColor" stroke-width="3" />
|
|
1645
|
+
${b.map((L,_)=>{let ee=P(L.tone,_),O=M(_),V=p(L.from),ae=p(L.to),ne=Math.min(36,(ae-V)/3);return z`<g>
|
|
1646
|
+
<path d="M${V} ${v} C${V} ${(v+O)/2} ${V+ne} ${O} ${V+ne*1.6} ${O} L${ae-ne*1.6} ${O} C${ae-ne} ${O} ${ae} ${(v+O)/2} ${ae} ${v}" fill="none" stroke=${ee} stroke-width="3" />
|
|
1647
|
+
<circle cx=${V} cy=${v} r="7" fill=${ee} />
|
|
1648
|
+
<text x=${V+ne*1.6} y=${J(_)?O-10:O+20} class="halo" style=${`fill:${ee}`}>${L.label}</text>
|
|
1649
|
+
</g>`})}
|
|
1650
|
+
${(this.marks??[]).map(L=>{let _=N(L.at),ee=_>=0?M(_):v,O=_>=0?P(b[_].tone,_):"currentColor";return z`<g><circle cx=${p(L.at)} cy=${ee} r="6" fill="var(--impkt-color-surface-card, #fff)" stroke=${O} stroke-width="3" /><text x=${p(L.at)} y=${ee+22} text-anchor="middle" class="faint">${L.label}</text></g>`})}
|
|
1651
|
+
${this.release?z`<g>
|
|
1652
|
+
<circle cx=${p(this.releaseAt)} cy=${v} r="10" fill=${re.success} />
|
|
1653
|
+
<rect x=${p(this.releaseAt)-8} y=${v-36} rx="4" width=${this.release.length*7.6+16} height="22" fill=${re.success} />
|
|
1654
|
+
<text x=${p(this.releaseAt)} y=${v-21} style="fill:var(--impkt-color-surface-card, #fff)">${this.release}</text>
|
|
1655
|
+
</g>`:l}
|
|
1656
|
+
${I.map(L=>z`<text x=${p(L)} y=${x-10} text-anchor="middle" class="faint">${di} ${L}</text>`)}
|
|
1657
|
+
</svg>
|
|
1658
|
+
</figure>`}};customElements.define("impkt-release-card",Je);customElements.define("impkt-release-list",et);customElements.define("impkt-branch-list",tt);customElements.define("impkt-check-list",it);customElements.define("impkt-branch-timeline",rt);function Ir(o){if(typeof location>"u"||!o||o.startsWith("#"))return null;let t;try{t=new URL(o,location.href).pathname.replace(/\/$/,"")||"/"}catch{return null}let i=location.pathname.replace(/\/$/,"")||"/";return t===i?"page":t!=="/"&&i.startsWith(`${t}/`)?"section":null}var nt=class extends c{constructor(){super();this.menuOpen=!1;this.needs=0;this.links=[],this.label="Main",this.menuText="Menu",this.menuLook="button",this.size="md",this.align="end"}static{this.properties={links:{type:Array},label:{type:String},menuText:{type:String,attribute:"menu-text"},menuLook:{type:String,reflect:!0,attribute:"menu-look"},size:{type:String,reflect:!0},align:{type:String,reflect:!0}}}get open(){return this.menuOpen}set open(i){this.menuOpen=i,this.requestUpdate()}static{this.styles=[...c.styles,k,h`
|
|
1659
|
+
/* It grows to fill a row it sits in, because it measures itself to decide when to fold. */
|
|
1660
|
+
:host { display: block; flex: 1 1 8rem; min-inline-size: 0; }
|
|
1661
|
+
nav { display: flex; flex-direction: column; position: relative; }
|
|
1662
|
+
li { flex: none; }
|
|
1663
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${r(1)} ${r(6)}; align-items: center; justify-content: flex-end; }
|
|
1664
|
+
:host([align='start']) ul { justify-content: flex-start; }
|
|
1665
|
+
:host([align='center']) ul { justify-content: center; }
|
|
1666
|
+
a { ${A} display: inline-flex; align-items: center; padding: ${r(2)} ${r(1)}; color: inherit; font-weight: ${u("semibold")}; text-decoration: none; border-radius: ${e.radiusSm}; }
|
|
1667
|
+
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1668
|
+
a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
|
|
1669
|
+
.toggle { display: none; ${A} align-items: center; gap: ${r(2)}; align-self: flex-end; padding: ${r(2)} ${r(3)}; font: inherit; font-weight: ${u("semibold")}; color: inherit; background: transparent; border: ${e.borderThin} solid currentColor; border-radius: ${e.radius}; cursor: pointer; }
|
|
1670
|
+
/* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
|
|
1671
|
+
:host([folded]) { flex: 0 0 auto; }
|
|
1672
|
+
:host([folded]) .toggle { display: inline-flex; }
|
|
1673
|
+
:host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${e.brand}; color: ${e.onBrand}; }
|
|
1674
|
+
:host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1675
|
+
:host([size='sm']) ul { column-gap: ${r(6)}; }
|
|
1676
|
+
:host([size='sm']) a { padding-inline: 0; font-size: ${$("sm")}; font-weight: ${u("medium")}; }
|
|
1677
|
+
:host([size='sm'][folded]) a { padding-inline: ${r(3)}; }
|
|
1678
|
+
:host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${r(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${r(2)}; background: ${e.surfaceCard}; color: ${e.text}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
|
|
1679
|
+
:host([folded]) ul.open { display: flex; }
|
|
1680
|
+
:host([folded]) li { text-align: start; }
|
|
1681
|
+
:host([folded]) a { display: flex; padding: ${r(3)} ${r(3)}; }
|
|
1682
|
+
`]}fit(){let i=this.getBoundingClientRect().width;if(i<=0)return;if(!this.needs){this.removeAttribute("folded");let n=Array.from(this.renderRoot.querySelectorAll("li")),d=Number.parseFloat(getComputedStyle(this.renderRoot.querySelector("ul")).columnGap)||0;this.needs=n.reduce((p,b)=>p+b.getBoundingClientRect().width,0)+d*Math.max(0,n.length-1)}let s=this.needs>i;this.toggleAttribute("folded",s),!s&&this.menuOpen&&(this.open=!1)}updated(i){i.has("links")&&(this.needs=0,this.fit())}connectedCallback(){super.connectedCallback(),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>this.fit()),this.resize.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resize?.disconnect()}toggle(){this.open=!this.open}onKey(i){i.key!=="Escape"||!this.open||(this.open=!1,this.renderRoot.querySelector(".toggle")?.focus())}render(){let i=this.id_("links");return a`<nav aria-label=${this.label||l} part="nav" @keydown=${this.onKey}>
|
|
1683
|
+
<button class="toggle" type="button" aria-expanded=${this.open?"true":"false"} aria-controls=${i} @click=${this.toggle}>${S(this.open?"close":this.menuLook==="icon"?"menu-two":"menu")}<span class="words">${this.menuText}</span></button>
|
|
1684
|
+
<ul id=${i} class=${this.open?"open":""} part="list">
|
|
1685
|
+
${(this.links??[]).map(s=>{let n=Ir(s.href);return a`<li><a href=${s.href} aria-current=${n==="page"?"page":n==="section"?"true":l} part="link">${s.label}</a></li>`})}
|
|
1686
|
+
</ul>
|
|
1687
|
+
</nav>`}},ot=class extends c{static{this.properties={items:{type:Array},label:{type:String}}}constructor(){super(),this.items=[],this.label="Breadcrumb"}static{this.styles=[...c.styles,k,h`
|
|
1688
|
+
:host { display: block; font-size: ${$("sm")}; }
|
|
1689
|
+
ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${r(1)}; }
|
|
1690
|
+
li { display: inline-flex; align-items: center; gap: ${r(1)}; }
|
|
1691
|
+
li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${e.textMuted}; border-inline-end: 1.5px solid ${e.textMuted}; transform: rotate(45deg); margin-inline: ${r(1)} ${r(2)}; }
|
|
1692
|
+
a { color: ${e.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${e.radiusSm}; }
|
|
1693
|
+
a:hover { color: ${e.linkHover}; }
|
|
1694
|
+
[aria-current] { color: ${e.textMuted}; }
|
|
1695
|
+
.sr-only { ${E} }
|
|
1696
|
+
`]}render(){let t=this.items??[];return a`<nav aria-label=${this.label} part="nav"><ol>
|
|
1697
|
+
${t.map((i,s)=>a`<li>${s===t.length-1?a`<span aria-current="page">${i.label}</span>`:a`<a href=${i.href} part="link">${i.label}</a>`}</li>`)}
|
|
1698
|
+
</ol></nav>`}};customElements.define("impkt-nav",nt);customElements.define("impkt-breadcrumbs",ot);var Br=[0,1,2,3,4],Q=e.fontMono,er=h`
|
|
1699
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
|
|
1700
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
|
|
1701
|
+
`,lt=class extends c{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=[...c.styles,k,h`
|
|
1702
|
+
:host { display: block; container-type: inline-size; }
|
|
1703
|
+
.bar { display: flex; align-items: center; gap: ${r(6)}; }
|
|
1704
|
+
.start { display: flex; align-items: center; gap: ${r(3)}; flex: none; }
|
|
1705
|
+
.middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
|
|
1706
|
+
.middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
|
|
1707
|
+
slot { display: contents; }
|
|
1708
|
+
.brand { color: inherit; text-decoration: none; font-family: ${e.fontHeading}; font-weight: ${u("semibold")}; ${m("2xl")} letter-spacing: -0.02em; line-height: 1; }
|
|
1709
|
+
.brand img { display: block; block-size: 32px; inline-size: auto; }
|
|
1710
|
+
.chip { display: inline-flex; align-items: center; gap: ${r(1)}; padding: 2px ${r(2)}; border-radius: ${e.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${Q}; font-size: ${$("xs")}; }
|
|
1711
|
+
.chip svg { inline-size: 12px; block-size: 12px; }
|
|
1712
|
+
.meta { font-family: ${Q}; font-size: ${$("xs")}; opacity: 0.55; }
|
|
1713
|
+
.middle impkt-nav { flex: 1 1 8rem; }
|
|
1714
|
+
.end { display: flex; align-items: center; gap: ${r(3)}; flex: none; }
|
|
1715
|
+
.end:empty, .start:empty { display: none; }
|
|
1716
|
+
.status { display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border: ${e.borderThin} solid ${e.border}; border-radius: 999px; background: ${e.surfaceCard}; font-family: ${Q}; font-size: ${$("xs")}; white-space: nowrap; }
|
|
1717
|
+
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1718
|
+
.status .hash { opacity: 0.55; }
|
|
1719
|
+
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${r(3)}; } }
|
|
1720
|
+
`]}act(){this.dispatchEvent(new CustomEvent("impkt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?a`<img src=${this.logoSrc} alt=${this.logoAlt||this.brand} />`:a`${this.brand}`;return a`<div class="bar" part="bar">
|
|
1721
|
+
<div class="start"><slot name="start">
|
|
1722
|
+
${this.brand||this.logoSrc?a`<a class="brand" href=${this.home||"/"} part="brand">${t}</a>`:l}
|
|
1723
|
+
${this.badge?a`<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>`:l}
|
|
1724
|
+
${this.meta?a`<span class="meta" part="meta">${this.meta}</span>`:l}
|
|
1725
|
+
</slot></div>
|
|
1726
|
+
<div class="middle"><slot name="middle">${(this.links??[]).length?a`<impkt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impkt-nav>`:l}</slot></div>
|
|
1727
|
+
<div class="end"><slot name="end">
|
|
1728
|
+
${this.status?a`<span class="status" part="status" style=${`--tone:${P(this.statusTone,0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta?a` <span class="hash">${this.statusMeta}</span>`:l}</span>`:l}
|
|
1729
|
+
${this.actionText?a`<impkt-button variant="primary" icon-after="arrow-right" href=${this.actionHref||l} @click=${this.act}>${this.actionText}</impkt-button>`:l}
|
|
1730
|
+
</slot></div>
|
|
1731
|
+
</div>`}},dt=class extends c{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=[...c.styles,k,er,h`
|
|
1732
|
+
:host { display: inline-flex; align-items: center; flex: none; }
|
|
1733
|
+
a { color: inherit; text-decoration: none; font-family: ${e.fontHeading}; font-weight: ${u("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${e.radiusSm}; }
|
|
1734
|
+
:host([size='sm']) a { ${m("xl")} } :host([size='md']) a { ${m("2xl")} } :host([size='lg']) a { ${m("3xl")} }
|
|
1735
|
+
img { display: block; block-size: 32px; inline-size: auto; }
|
|
1736
|
+
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${m("xl")} } }
|
|
1737
|
+
`]}render(){return a`<a href=${this.href||"/"} part="link">${this.src?a`<img src=${this.src} alt=${this.alt||this.text||this.textContent?.trim()||""} />`:a`<slot>${this.text}</slot>`}</a>`}},ct=class extends c{static{this.properties={label:{type:String},meta:{type:String},icon:{type:String,reflect:!0},tone:{type:String},look:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.label="",this.meta="",this.icon="none",this.tone="success",this.look="filled",this.hideOn="never"}static{this.styles=[...c.styles,er,h`
|
|
1738
|
+
:host { display: inline-flex; flex: none; }
|
|
1739
|
+
span.chip { display: inline-flex; align-items: center; gap: ${r(1.5)}; padding: 3px ${r(2.5)}; border-radius: 999px; font-family: ${Q}; font-size: ${$("xs")}; line-height: 1.2; white-space: nowrap; }
|
|
1740
|
+
:host([look='filled']) span.chip { border-radius: ${e.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }
|
|
1741
|
+
:host([look='outlined']) span.chip { border: ${e.borderThin} solid ${e.border}; background: ${e.surfaceCard}; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
1742
|
+
:host([look='plain']) span.chip { padding: 0; }
|
|
1743
|
+
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1744
|
+
svg { inline-size: 12px; block-size: 12px; }
|
|
1745
|
+
.meta { opacity: 0.55; text-transform: none; }
|
|
1746
|
+
:host([look='plain']) .label { opacity: 0.55; }
|
|
1747
|
+
`]}render(){let t=this.icon==="dot"?a`<span class="dot" aria-hidden="true"></span>`:this.icon==="branch"?a`<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>`:l;return a`<span class="chip" part="chip" style=${`--tone:${P(this.tone,0)}`}>${t}<span class="label">${this.label}</span>${this.meta?a` <span class="meta">${this.meta}</span>`:l}</span>`}},pt=class extends c{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=[...c.styles,k,h`
|
|
1748
|
+
/* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */
|
|
1749
|
+
:host { display: block; container-type: inline-size; position: relative; padding-block: ${r(8)} ${r(4)}; margin-block-end: calc(-1 * ${r(8)}); }
|
|
1750
|
+
.top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${r(10)}; }
|
|
1751
|
+
.brand { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
|
|
1752
|
+
ul { list-style: none; margin: 0; padding: 0; }
|
|
1753
|
+
.log { margin-block-start: ${r(8)}; display: grid; gap: ${r(3)}; font-family: ${Q}; font-size: ${$("sm")}; }
|
|
1754
|
+
.log li { display: flex; align-items: center; gap: ${r(3)}; opacity: 0.55; }
|
|
1755
|
+
.log li:first-child { opacity: 1; }
|
|
1756
|
+
.log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
|
|
1757
|
+
.log .code { margin-inline-end: ${r(3)}; }
|
|
1758
|
+
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${r(8)}; }
|
|
1759
|
+
.h { margin: 0 0 ${r(4)}; font-family: ${Q}; font-size: ${$("xs")}; font-weight: ${u("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }
|
|
1760
|
+
.columns ul { display: grid; gap: ${r(3)}; }
|
|
1761
|
+
a { color: inherit; text-decoration: none; font-weight: ${u("medium")}; border-radius: ${e.radiusSm}; }
|
|
1762
|
+
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1763
|
+
.legal { margin: ${r(16)} 0 0; font-family: ${Q}; font-size: ${$("xs")}; opacity: 0.55; }
|
|
1764
|
+
.stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
|
|
1765
|
+
.stripe span { flex: 1; }
|
|
1766
|
+
@container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
1767
|
+
@container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
|
|
1768
|
+
@media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }
|
|
1769
|
+
`]}heading(t){let i=Math.min(Math.max(this.headingLevel||2,2),4);return i===3?a`<h3 class="h">${t}</h3>`:i===4?a`<h4 class="h">${t}</h4>`:a`<h2 class="h">${t}</h2>`}render(){let t=this.log??[];return a`<div part="footer">
|
|
1770
|
+
<div class="top">
|
|
1771
|
+
<div>
|
|
1772
|
+
${this.brand?a`<p class="brand" part="brand">${this.brand}</p>`:l}
|
|
1773
|
+
${t.length?a`<ul class="log" part="log">${t.map((i,s)=>a`<li style=${`--tone:${P(i.tone??(s===0?"success":"accent"),s)}`}><span class="dot" aria-hidden="true"></span><span>${i.meta?a`<span class="code">${i.meta}</span>`:l}${i.text}</span></li>`)}</ul>`:l}
|
|
1774
|
+
</div>
|
|
1775
|
+
<div class="columns" part="columns" style=${`--count:${Math.max(1,(this.columns??[]).length)}`}>
|
|
1776
|
+
${(this.columns??[]).map(i=>a`<div>${this.heading(i.heading)}<ul>${(i.links??[]).map(s=>a`<li><a href=${s.href}>${s.label}</a></li>`)}</ul></div>`)}
|
|
1777
|
+
</div>
|
|
1778
|
+
</div>
|
|
1779
|
+
${this.legal?a`<p class="legal" part="legal">${this.legal}</p>`:l}
|
|
1780
|
+
${this.stripe?a`<div class="stripe" aria-hidden="true">${Br.map(i=>a`<span style=${`background:${P(void 0,i)}`}></span>`)}</div>`:l}
|
|
1781
|
+
</div>`}};customElements.define("impkt-site-header",lt);customElements.define("impkt-wordmark",dt);customElements.define("impkt-chip",ct);customElements.define("impkt-site-footer",pt);var ht=class extends T{constructor(){super();this.filled=!1;this.filledText="";this.width="full",this.rows=4,this.maxlength=void 0,this.fillFrom="none"}static{this.properties={...T.properties,width:{type:String,reflect:!0},rows:{type:Number},maxlength:{type:Number},fillFrom:{type:String,attribute:"fill-from"}}}static{this.styles=[...T.styles,F,h`
|
|
1782
|
+
textarea {
|
|
1783
|
+
inline-size: min(100%, var(--impkt-field-width));
|
|
1784
|
+
padding: ${r(2.5)} ${r(3)};
|
|
1785
|
+
font-family: inherit;
|
|
1786
|
+
font-size: ${$("md")};
|
|
1787
|
+
color: ${e.text};
|
|
1788
|
+
background: var(--impkt-color-field-surface, ${e.surfaceCard});
|
|
1789
|
+
border: ${e.borderThin} solid ${e.border};
|
|
1790
|
+
border-radius: ${e.radiusLg};
|
|
1791
|
+
box-shadow: var(--impkt-shadow-field, ${e.shadowXs});
|
|
1792
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
1793
|
+
/* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text
|
|
1794
|
+
can be made bigger, and a fixed box is where that stops working. */
|
|
1795
|
+
resize: vertical;
|
|
1796
|
+
}
|
|
1797
|
+
textarea:hover:not(:disabled) {
|
|
1798
|
+
border-color: ${e.borderStrong};
|
|
1799
|
+
}
|
|
1800
|
+
textarea:focus-visible {
|
|
1801
|
+
border-color: ${e.brand};
|
|
1802
|
+
box-shadow: ${e.focusShadow}, 0 0 0 6px ${e.brandHalo};
|
|
1803
|
+
}
|
|
1804
|
+
:host([invalid]) textarea {
|
|
1805
|
+
border-color: ${e.danger};
|
|
1806
|
+
border-width: ${e.borderThick};
|
|
1807
|
+
}
|
|
1808
|
+
`]}willUpdate(i){super.willUpdate?.(i),this.filledText&&i.has("value")&&!this.value&&(this.value=this.filledText)}fill(){if(this.filled||this.fillFrom!=="estimate"||(this.filled=!0,this.value))return;let i=null;try{i=sessionStorage.getItem("strata.estimate")}catch{i=null}i&&(this.filledText=i,this.setFormValue(i))}renderControl(){return a`
|
|
1809
|
+
<textarea
|
|
1810
|
+
id=${this.controlId}
|
|
1811
|
+
part="textarea"
|
|
1812
|
+
name=${this.name||l}
|
|
1813
|
+
rows=${this.rows}
|
|
1814
|
+
maxlength=${this.maxlength??l}
|
|
1815
|
+
?disabled=${this.disabled}
|
|
1816
|
+
?readonly=${this.readonly}
|
|
1817
|
+
?required=${this.required}
|
|
1818
|
+
aria-describedby=${this.describedBy}
|
|
1819
|
+
aria-invalid=${this.error?"true":l}
|
|
1820
|
+
@input=${i=>{this.filledText="",this.setFormValue(i.target.value)}}
|
|
1821
|
+
>${this.value}</textarea>
|
|
1822
|
+
`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error),this.fill()}};customElements.define("impkt-textarea",ht);var ut=class extends T{static{this.properties={...T.properties,options:{type:Array},values:{type:Array}}}constructor(){super(),this.options=[],this.values=[]}static{this.styles=[...T.styles,h`
|
|
1823
|
+
fieldset {
|
|
1824
|
+
border: 0;
|
|
1825
|
+
margin: 0;
|
|
1826
|
+
padding: 0;
|
|
1827
|
+
min-inline-size: 0;
|
|
1828
|
+
}
|
|
1829
|
+
legend {
|
|
1830
|
+
padding: 0;
|
|
1831
|
+
}
|
|
1832
|
+
.option {
|
|
1833
|
+
display: flex;
|
|
1834
|
+
align-items: flex-start;
|
|
1835
|
+
gap: ${r(3)};
|
|
1836
|
+
padding: ${r(3)};
|
|
1837
|
+
border: ${e.borderThin} solid ${e.border};
|
|
1838
|
+
border-radius: ${e.radius};
|
|
1839
|
+
margin-block-end: ${r(2)};
|
|
1840
|
+
cursor: pointer;
|
|
1841
|
+
}
|
|
1842
|
+
.option:hover {
|
|
1843
|
+
background: ${e.surfaceSubtle};
|
|
1844
|
+
}
|
|
1845
|
+
.option input {
|
|
1846
|
+
${A}
|
|
1847
|
+
inline-size: 20px;
|
|
1848
|
+
block-size: 20px;
|
|
1849
|
+
margin: 0;
|
|
1850
|
+
flex: none;
|
|
1851
|
+
accent-color: ${e.brand};
|
|
1852
|
+
}
|
|
1853
|
+
.option-text {
|
|
1854
|
+
display: block;
|
|
1855
|
+
font-size: ${$("md")};
|
|
1856
|
+
}
|
|
1857
|
+
.option-description {
|
|
1858
|
+
display: block;
|
|
1859
|
+
font-size: ${$("sm")};
|
|
1860
|
+
color: ${e.textMuted};
|
|
1861
|
+
margin-block-start: ${r(1)};
|
|
1862
|
+
}
|
|
1863
|
+
:host([invalid]) .option {
|
|
1864
|
+
border-color: ${e.danger};
|
|
1865
|
+
}
|
|
1866
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
1867
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1868
|
+
</legend>`}onToggle(t,i){this.values=i?[...this.values,t]:this.values.filter(s=>s!==t),this.setFormValue(this.options.filter(s=>this.values.includes(s.value)).map(s=>s.value).join(","))}renderControl(){return a`
|
|
1869
|
+
${this.options.map((t,i)=>{let s=this.id_(`opt-${i}`),n=t.description?this.id_(`opt-${i}-desc`):void 0;return a`
|
|
1870
|
+
<label class="option" part="option" for=${s}>
|
|
1871
|
+
<input
|
|
1872
|
+
type="checkbox"
|
|
1873
|
+
id=${s}
|
|
1874
|
+
value=${t.value}
|
|
1875
|
+
.checked=${this.values.includes(t.value)}
|
|
1876
|
+
?disabled=${this.disabled}
|
|
1877
|
+
aria-describedby=${n??l}
|
|
1878
|
+
@change=${d=>this.onToggle(t.value,d.target.checked)}
|
|
1879
|
+
/>
|
|
1880
|
+
<span>
|
|
1881
|
+
<span class="option-text">${t.label}</span>
|
|
1882
|
+
${t.description?a`<span class="option-description" id=${n}>${t.description}</span>`:l}
|
|
1883
|
+
</span>
|
|
1884
|
+
</label>
|
|
1885
|
+
`})}
|
|
1886
|
+
`}render(){return a`
|
|
1887
|
+
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1888
|
+
${this.renderLabel()}
|
|
1889
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1890
|
+
${this.renderControl()}
|
|
1891
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1892
|
+
</fieldset>
|
|
1893
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-checkbox-group",ut);var mt=class extends T{static{this.properties={...T.properties,day:{type:String},month:{type:String},year:{type:String},autocompleteSection:{type:String,attribute:"autocomplete-section"}}}constructor(){super(),this.day="",this.month="",this.year="",this.autocompleteSection="bday"}static{this.styles=[...T.styles,h`
|
|
1894
|
+
fieldset {
|
|
1895
|
+
border: 0;
|
|
1896
|
+
margin: 0;
|
|
1897
|
+
padding: 0;
|
|
1898
|
+
min-inline-size: 0;
|
|
1899
|
+
}
|
|
1900
|
+
legend {
|
|
1901
|
+
padding: 0;
|
|
1902
|
+
}
|
|
1903
|
+
.parts {
|
|
1904
|
+
display: flex;
|
|
1905
|
+
gap: ${r(3)};
|
|
1906
|
+
}
|
|
1907
|
+
.part {
|
|
1908
|
+
display: flex;
|
|
1909
|
+
flex-direction: column;
|
|
1910
|
+
gap: ${r(1)};
|
|
1911
|
+
}
|
|
1912
|
+
.part label {
|
|
1913
|
+
font-size: ${$("sm")};
|
|
1914
|
+
color: ${e.textMuted};
|
|
1915
|
+
}
|
|
1916
|
+
input {
|
|
1917
|
+
min-block-size: 44px;
|
|
1918
|
+
padding: ${r(3)};
|
|
1919
|
+
font-family: inherit;
|
|
1920
|
+
font-size: ${$("md")};
|
|
1921
|
+
color: ${e.text};
|
|
1922
|
+
background: ${e.surfaceCard};
|
|
1923
|
+
border: ${e.borderThin} solid ${e.border};
|
|
1924
|
+
border-radius: ${e.radius};
|
|
1925
|
+
/* Room for the digits plus the padding and border, so the box is never narrower than a finger. */
|
|
1926
|
+
inline-size: calc(3ch + ${r(6)} + 2px);
|
|
1927
|
+
}
|
|
1928
|
+
.year input {
|
|
1929
|
+
inline-size: calc(5ch + ${r(6)} + 2px);
|
|
1930
|
+
}
|
|
1931
|
+
:host([invalid]) input {
|
|
1932
|
+
border-color: ${e.danger};
|
|
1933
|
+
border-width: ${e.borderThick};
|
|
1934
|
+
}
|
|
1935
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
1936
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1937
|
+
</legend>`}datePart(t,i,s,n){let d=this.id_(t);return a`
|
|
1938
|
+
<div class="part ${t}">
|
|
1939
|
+
<label for=${d}>${i}</label>
|
|
1940
|
+
<input
|
|
1941
|
+
id=${d}
|
|
1942
|
+
type="text"
|
|
1943
|
+
inputmode="numeric"
|
|
1944
|
+
maxlength=${s}
|
|
1945
|
+
.value=${this[t]}
|
|
1946
|
+
autocomplete=${this.autocompleteSection?`${this.autocompleteSection}-${n}`:l}
|
|
1947
|
+
?disabled=${this.disabled}
|
|
1948
|
+
@input=${p=>{this[t]=p.target.value,this.emit()}}
|
|
1949
|
+
/>
|
|
1950
|
+
</div>
|
|
1951
|
+
`}emit(){let i=this.day&&this.month&&this.year.length===4?`${this.year}-${this.month.padStart(2,"0")}-${this.day.padStart(2,"0")}`:"";this.setFormValue(i)}renderControl(){return a`
|
|
1952
|
+
<div class="parts" part="parts">
|
|
1953
|
+
${this.datePart("day",g("Day"),2,"day")}
|
|
1954
|
+
${this.datePart("month",g("Month"),2,"month")}
|
|
1955
|
+
${this.datePart("year",g("Year"),4,"year")}
|
|
1956
|
+
</div>
|
|
1957
|
+
`}render(){return a`
|
|
1958
|
+
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1959
|
+
${this.renderLabel()}
|
|
1960
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1961
|
+
${this.renderControl()}
|
|
1962
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1963
|
+
</fieldset>
|
|
1964
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-date-input",mt);var ge=new Set,me=null;function gt(o){if(typeof document>"u"||ge.has(o)||(ge.add(o),ge.size>1))return;let t=document.documentElement,i=window.innerWidth-t.clientWidth;me={overflow:t.style.overflow,paddingRight:t.style.paddingRight},t.style.overflow="hidden",i>0&&(t.style.paddingRight=`${i}px`)}function se(o){if(typeof document>"u"||!ge.delete(o)||ge.size>0||!me)return;let t=document.documentElement;t.style.overflow=me.overflow,t.style.paddingRight=me.paddingRight,me=null}var bt=class extends c{static{this.properties={open:{type:Boolean,reflect:!0},heading:{type:String},closeLabel:{type:String,attribute:"close-label"},dismissible:{type:Boolean},phoneFullScreen:{type:Boolean,reflect:!0,attribute:"phone-full-screen"}}}constructor(){super(),this.open=!1,this.heading="",this.closeLabel="Close",this.dismissible=!0,this.phoneFullScreen=!1}static{this.styles=[...c.styles,k,R(".close"),h`
|
|
1965
|
+
dialog {
|
|
1966
|
+
padding: 0;
|
|
1967
|
+
border: 0;
|
|
1968
|
+
border-radius: ${e.radius2xl};
|
|
1969
|
+
background: ${e.surfaceCard};
|
|
1970
|
+
color: ${e.text};
|
|
1971
|
+
box-shadow: ${e.shadowXl}, 0 0 0 1px ${e.hairline};
|
|
1972
|
+
max-inline-size: min(32rem, calc(100vw - 2rem));
|
|
1973
|
+
/* 1.4.10 Reflow: a dialog taller than the viewport must scroll inside
|
|
1974
|
+
itself rather than clipping, at 320px and at 400% zoom alike. */
|
|
1975
|
+
max-block-size: calc(100vh - 2rem);
|
|
1976
|
+
overflow: auto;
|
|
1977
|
+
}
|
|
1978
|
+
dialog::backdrop {
|
|
1979
|
+
background: color-mix(in srgb, ${e.text} 30%, transparent);
|
|
1980
|
+
backdrop-filter: blur(2px);
|
|
1981
|
+
}
|
|
1982
|
+
.head {
|
|
1983
|
+
display: flex;
|
|
1984
|
+
align-items: flex-start;
|
|
1985
|
+
justify-content: space-between;
|
|
1986
|
+
gap: ${r(3)};
|
|
1987
|
+
padding: ${r(5)} ${r(5)} 0;
|
|
1988
|
+
}
|
|
1989
|
+
.heading {
|
|
1990
|
+
margin: 0;
|
|
1991
|
+
font-family: ${e.fontHeading};
|
|
1992
|
+
font-size: ${$("xl")};
|
|
1993
|
+
font-weight: ${u("bold")};
|
|
1994
|
+
color: ${e.textHeading};
|
|
1995
|
+
}
|
|
1996
|
+
.body {
|
|
1997
|
+
padding: ${r(4)} ${r(5)} ${r(5)};
|
|
1998
|
+
}
|
|
1999
|
+
@media (max-width: 40rem) {
|
|
2000
|
+
:host([phone-full-screen]) dialog {
|
|
2001
|
+
inline-size: 100vw;
|
|
2002
|
+
max-inline-size: 100vw;
|
|
2003
|
+
block-size: 100dvh;
|
|
2004
|
+
max-block-size: 100dvh;
|
|
2005
|
+
margin: 0;
|
|
2006
|
+
border-radius: 0;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
.close {
|
|
2010
|
+
${A}
|
|
2011
|
+
display: inline-flex;
|
|
2012
|
+
align-items: center;
|
|
2013
|
+
justify-content: center;
|
|
2014
|
+
flex: none;
|
|
2015
|
+
background: none;
|
|
2016
|
+
border: 0;
|
|
2017
|
+
border-radius: ${e.radius};
|
|
2018
|
+
font: inherit;
|
|
2019
|
+
font-size: ${$("lg")};
|
|
2020
|
+
color: ${e.text};
|
|
2021
|
+
cursor: pointer;
|
|
2022
|
+
}
|
|
2023
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(t){if(!t.has("open"))return;let i=this.dialog;i&&(this.open?(typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),gt(this)):(typeof i.close=="function"&&i.open?i.close():i.removeAttribute("open"),se(this)))}disconnectedCallback(){super.disconnectedCallback(),se(this)}close(){this.open=!1,this.dispatchEvent(new CustomEvent("impkt-close",{bubbles:!0,composed:!0}))}render(){return a`
|
|
2024
|
+
<dialog
|
|
2025
|
+
part="dialog"
|
|
2026
|
+
aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
2027
|
+
@cancel=${t=>{this.dismissible?this.close():t.preventDefault()}}
|
|
2028
|
+
@close=${()=>{this.open&&this.close()}}
|
|
2029
|
+
>
|
|
2030
|
+
<div class="head">
|
|
2031
|
+
${this.heading?a`<h2 class="heading" id=${this.id_("heading")} part="heading">${this.heading}</h2>`:l}
|
|
2032
|
+
${this.dismissible?a`<button class="close" part="close" type="button" @click=${this.close}>
|
|
2033
|
+
<span aria-hidden="true">×</span>
|
|
2034
|
+
<span class="sr-only" style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">${this.closeLabel}</span>
|
|
2035
|
+
</button>`:l}
|
|
2036
|
+
</div>
|
|
2037
|
+
<div class="body" part="body"><slot></slot></div>
|
|
2038
|
+
</dialog>
|
|
2039
|
+
`}};customElements.define("impkt-dialog",bt);var ft=class extends c{static{this.properties={items:{type:Array},look:{type:String,reflect:!0},size:{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.look="bullet",this.size="md",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2040
|
+
:host { display: block; }
|
|
2041
|
+
ul, ol { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(3)}; counter-reset: point; }
|
|
2042
|
+
li { position: relative; padding-inline-start: ${r(7)}; ${m("md")} text-wrap: pretty; counter-increment: point; }
|
|
2043
|
+
:host([size='sm']) li { ${m("sm")} }
|
|
2044
|
+
:host([size='lg']) li { ${m("lg")} }
|
|
2045
|
+
li::before { content: ''; position: absolute; inset-inline-start: 4px; inset-block-start: 0.6em; inline-size: 7px; block-size: 7px; border-radius: 2px; background: ${e.brand}; }
|
|
2046
|
+
:host([look='check']) li::before { content: '✓'; inset-inline-start: 0; inset-block-start: 0; inline-size: auto; block-size: auto; background: none; color: ${e.success}; font-weight: ${u("bold")}; }
|
|
2047
|
+
:host([look='number']) li::before { content: counter(point, decimal-leading-zero); inset-inline-start: 0; inset-block-start: 0.2em; inline-size: auto; block-size: auto; background: none; font-family: ${e.fontMono}; font-size: 0.75em; color: ${e.textMuted}; }
|
|
2048
|
+
@media (forced-colors: active) { li::before { background: CanvasText; } :host([look='check']) li::before, :host([look='number']) li::before { background: none; color: CanvasText; } }
|
|
2049
|
+
`]}render(){let t=(this.items??[]).map(i=>a`<li part="item">${i}</li>`);return this.look==="number"?a`<ol part="list">${t}</ol>`:a`<ul part="list" role="list">${t}</ul>`}};customElements.define("impkt-list",ft);var $t=o=>o.reduce((t,i)=>t+i,0),tr=(o,t)=>o.find(i=>typeof i.below=="number"&&t<i.below)??o.at(-1);function yt(o,t,i){let s=o.flatMap(b=>(t[b.id]??[]).flatMap(y=>b.choices.filter(x=>x.id===y))),n=$t(s.map(b=>b.cost??0)),d=$t(s.map(b=>b.weeks??0));for(let b of s)n*=b.costFactor??1,d*=b.weeksFactor??1;let p=(tr(i.teams,n)?.engineers??1)+$t(s.map(b=>b.engineers??0));return{cost:n,low:Math.round(n*i.low),high:Math.round(n*i.high),weeks:Math.max(i.minWeeks,Math.round(d)),engineers:p,way:tr(i.ways,n)?.text??""}}function ir(o,t){let i=o.map(n=>typeof n.share=="number"?Math.max(1,Math.round(t*n.share)):0),s=Math.max(1,t-$t(i));return o.map((n,d)=>typeof n.share=="number"?i[d]:s)}var xt=class extends c{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=[...c.styles,w,k,h`
|
|
2050
|
+
:host { display: block; container-type: inline-size; }
|
|
2051
|
+
[hidden] { display: none !important; }
|
|
2052
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${r(10)}; align-items: start; }
|
|
2053
|
+
.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; text-transform: uppercase; color: ${e.textMuted}; margin: 0; }
|
|
2054
|
+
.sr-only { ${E} }
|
|
2055
|
+
|
|
2056
|
+
.progress { display: grid; gap: ${r(2)}; margin-block-end: ${r(6)}; }
|
|
2057
|
+
.bar { block-size: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }
|
|
2058
|
+
.bar i { display: block; block-size: 100%; background: ${e.brand}; transition: inline-size 300ms ease; }
|
|
2059
|
+
|
|
2060
|
+
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
|
|
2061
|
+
legend { padding: 0; margin-block-end: ${r(2)}; }
|
|
2062
|
+
.q { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; ${m("3xl")} letter-spacing: ${e.trackingTight}; color: ${e.textHeading}; outline: none; }
|
|
2063
|
+
.hint { margin: 0 0 ${r(6)}; color: ${e.textMuted}; }
|
|
2064
|
+
|
|
2065
|
+
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(3)}; }
|
|
2066
|
+
.choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2067
|
+
.choice { position: relative; display: grid; gap: ${r(1)}; align-content: start; padding: ${r(4)}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; background: ${e.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
|
|
2068
|
+
.choice:hover { border-color: ${e.borderStrong}; }
|
|
2069
|
+
.choice input { ${E} }
|
|
2070
|
+
.choice:has(input:checked) { border-color: ${e.brand}; box-shadow: inset 0 0 0 1px ${e.brand}; background: ${e.brandSubtle}; }
|
|
2071
|
+
.choice:has(input:focus-visible) { box-shadow: ${e.focusShadow}; }
|
|
2072
|
+
.many .choice { padding: ${r(3)}; }
|
|
2073
|
+
.label { font-weight: ${u("semibold")}; }
|
|
2074
|
+
.small { ${m("sm")} color: ${e.textMuted}; }
|
|
2075
|
+
/* A tick for a picked feature, drawn in the corner. */
|
|
2076
|
+
.many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${r(2)}; inset-inline-end: ${r(3)}; color: ${e.brand}; font-weight: ${u("bold")}; }
|
|
2077
|
+
|
|
2078
|
+
.scale { display: grid; gap: ${r(3)}; }
|
|
2079
|
+
.scale input { inline-size: 100%; accent-color: ${e.brand}; ${A} }
|
|
2080
|
+
.ticks { display: flex; justify-content: space-between; ${m("sm")} color: ${e.textMuted}; }
|
|
2081
|
+
.ticks span[aria-current] { color: ${e.text}; font-weight: ${u("semibold")}; }
|
|
2082
|
+
.now { margin: 0; }
|
|
2083
|
+
|
|
2084
|
+
.nav { display: flex; gap: ${r(3)}; margin-block-start: ${r(8)}; }
|
|
2085
|
+
button, .send { ${A} display: inline-flex; align-items: center; justify-content: center; gap: ${r(2)}; padding: ${r(2.5)} ${r(5)}; border-radius: ${e.radiusLg}; font: inherit; font-weight: ${u("semibold")}; cursor: pointer; text-decoration: none; border: ${e.borderThin} solid transparent; }
|
|
2086
|
+
.primary, .send { background: ${e.brand}; color: ${e.onBrand}; }
|
|
2087
|
+
.primary:hover, .send:hover { background: ${e.brandHover}; }
|
|
2088
|
+
.secondary { background: transparent; color: ${e.text}; border-color: ${e.borderStrong}; }
|
|
2089
|
+
.secondary:hover { background: ${e.surfaceSubtle}; }
|
|
2090
|
+
|
|
2091
|
+
.panel { position: sticky; inset-block-start: ${r(6)}; overflow: hidden; isolation: isolate; padding: ${r(8)}; border-radius: ${e.radiusXl}; background: ${e.surfaceCard}; box-shadow: ${e.shadowMd}; display: grid; gap: ${r(2)}; }
|
|
2092
|
+
/* The glow behind the budget grows as the product does. */
|
|
2093
|
+
.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, ${H(P(1,0))} 45%, transparent), color-mix(in srgb, ${H(P(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; }
|
|
2094
|
+
.range { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; font-size: ${$("5xl")}; line-height: 1; letter-spacing: ${e.trackingTight}; color: ${e.textHeading}; }
|
|
2095
|
+
.weeks { margin: 0; ${m("lg")} }
|
|
2096
|
+
.tip { margin: ${r(4)} 0 0; padding-block-start: ${r(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${e.textMuted}; }
|
|
2097
|
+
|
|
2098
|
+
.result { display: grid; gap: ${r(6)}; }
|
|
2099
|
+
.summary { margin: 0; ${m("xl")} text-wrap: pretty; }
|
|
2100
|
+
.phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }
|
|
2101
|
+
.phases i { display: block; }
|
|
2102
|
+
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${r(2)} ${r(5)}; }
|
|
2103
|
+
.legend li { display: inline-flex; align-items: center; gap: ${r(2)}; }
|
|
2104
|
+
.legend li::before { content: ''; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c); }
|
|
2105
|
+
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(4)}; }
|
|
2106
|
+
dt { margin: 0 0 ${r(1)}; }
|
|
2107
|
+
dd { margin: 0; font-weight: ${u("semibold")}; }
|
|
2108
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${r(3)}; }
|
|
2109
|
+
.note { margin: 0; ${m("sm")} color: ${e.textMuted}; }
|
|
2110
|
+
.status { margin: 0; ${m("sm")} }
|
|
2111
|
+
|
|
2112
|
+
@container (max-width: 48rem) {
|
|
2113
|
+
.wrap { grid-template-columns: minmax(0, 1fr); gap: ${r(8)}; }
|
|
2114
|
+
.panel { position: static; }
|
|
2115
|
+
.choices.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2116
|
+
}
|
|
2117
|
+
@container (max-width: 30rem) {
|
|
2118
|
+
.choices { grid-template-columns: minmax(0, 1fr); }
|
|
2119
|
+
.range { font-size: ${$("4xl")}; }
|
|
2120
|
+
}
|
|
2121
|
+
@media (forced-colors: active) {
|
|
2122
|
+
.choice:has(input:checked) { outline: 3px solid Highlight; }
|
|
2123
|
+
.bar i, .phases i, .legend li::before { background: CanvasText !important; }
|
|
2124
|
+
.glow { display: none; }
|
|
2125
|
+
}
|
|
2126
|
+
`]}reset(){this.answers=Object.fromEntries((this.questions??[]).map(i=>{let s=(i.start??[]).filter(n=>i.choices.some(d=>d.id===n));return i.kind==="many"?[i.id,s]:[i.id,[s[0]??i.choices[0]?.id].filter(n=>!!n)]})),this.at=0,this.tip="",this.copied=""}willUpdate(i){(i.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(i){try{return new Intl.NumberFormat(B(this),{style:"currency",currency:this.currency||"GBP",notation:"compact",maximumFractionDigits:0}).format(i*(this.unit||1))}catch{return String(i*(this.unit||1))}}listOf(i){try{return new Intl.ListFormat(B(this),{type:"conjunction"}).format(i)}catch{return i.join(", ")}}weeksWord(i){return i===1?g("{n} week",{n:i}):g("{n} weeks",{n:i})}get most(){let i=this.questions??[],s=Object.fromEntries(i.map(n=>{if(n.kind==="many")return[n.id,n.choices.map(p=>p.id)];let d=[...n.choices].sort((p,b)=>(b.cost??0)*(b.costFactor??1)-(p.cost??0)*(p.costFactor??1))[0];return[n.id,d?[d.id]:[]]}));return yt(i,s,this.rules).high||1}summaryOf(i){let s=this.questions??[],n=s.find(v=>v.kind==="one"),d=n?n.choices.find(v=>v.id===this.answers[n.id]?.[0]):void 0,p=s.filter(v=>v.kind==="many"&&v.inSummary!==!1).flatMap(v=>(this.answers[v.id]??[]).map(M=>{let I=v.choices.find(N=>N.id===M);return I?I.phrase||I.label:M})),b=d?d.phrase||d.label:"",y=b?p.length?g("You are building {thing} with {list}.",{thing:b,list:this.listOf(p)}):g("You are building {thing}.",{thing:b}):"",x=g("Expect {range} and about {weeks} to a first release.",{range:this.rangeOf(i),weeks:this.weeksWord(i.weeks)});return y?`${y} ${x}`:x}rangeOf(i){return g("{low} to {high}",{low:this.money(i.low),high:this.money(i.high)})}teamOf(i){return i===1?this.teamTextOne:this.teamText.replace("{n}",String(i))}pick(i,s,n){let d=this.answers[i.id]??[];this.answers={...this.answers,[i.id]:i.kind==="many"?n?[...d.filter(p=>p!==s.id),s.id]:d.filter(p=>p!==s.id):[s.id]},n&&s.tip&&(this.tip=s.tip),this.requestUpdate()}go(i){let s=(this.questions??[]).length;this.at=Math.max(0,Math.min(s,i)),this.copied="",this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(".current .q")?.focus({preventScroll:!0}))}result(){let i=yt(this.questions??[],this.answers,this.rules);return{low:i.low*(this.unit||1),high:i.high*(this.unit||1),weeks:i.weeks,engineers:i.engineers,way:i.way,summary:this.textOf(i),answers:this.answers}}textOf(i){let s=[this.summaryOf(i),`${this.teamOf(i.engineers)}.`];i.way&&s.push(`${i.way}.`);let n=(this.questions??[]).filter(p=>p.short&&p.kind!=="many").map(p=>{let b=p.choices.find(y=>y.id===this.answers[p.id]?.[0]);return b?`${p.short}: ${b.label}.`:""}).filter(Boolean),d=(this.questions??[]).filter(p=>p.short&&p.kind==="many"&&p.inSummary===!1).map(p=>{let b=(this.answers[p.id]??[]).map(y=>p.choices.find(x=>x.id===y)?.label??y);return b.length?`${p.short}: ${this.listOf(b)}.`:""}).filter(Boolean);return[...s,...d,...n].join(" ")}send(i){let s=this.result();try{sessionStorage.setItem("strata.estimate",s.summary)}catch{}this.dispatchEvent(new CustomEvent("impkt-estimate",{detail:s,bubbles:!0,composed:!0,cancelable:!0}))||i.preventDefault()}async copy(){let i=this.result().summary;try{await navigator.clipboard.writeText(i),this.copied=g("Summary copied.")}catch{this.copied=g("Copying is blocked here. Select the summary above instead.")}this.requestUpdate()}heading(i){let s=Math.min(Math.max(this.headingLevel||2,2),6);return a`<div class="q" role="heading" aria-level=${s} tabindex="-1">${i}</div>`}renderQuestion(i,s){let n=this.answers[i.id]??[],d=s===this.at;if(i.kind==="scale"){let b=Math.max(0,i.choices.findIndex(x=>x.id===n[0])),y=i.choices[b];return a`<fieldset class=${d?"current":""} ?hidden=${!d}>
|
|
2127
|
+
<legend>${this.heading(i.heading)}</legend>
|
|
2128
|
+
${i.hint?a`<p class="hint">${i.hint}</p>`:l}
|
|
2129
|
+
<div class="scale">
|
|
2130
|
+
<input type="range" min="0" max=${Math.max(0,i.choices.length-1)} step="1" .value=${String(b)} aria-label=${i.heading} aria-valuetext=${y?.label??""}
|
|
2131
|
+
@input=${x=>{let v=i.choices[Number(x.target.value)];v&&this.pick(i,v,!0)}}>
|
|
2132
|
+
<div class="ticks" aria-hidden="true">${i.choices.map((x,v)=>a`<span aria-current=${v===b?"true":l}>${x.label}</span>`)}</div>
|
|
2133
|
+
${y?.hint?a`<p class="now">${y.hint}</p>`:l}
|
|
2134
|
+
</div>
|
|
2135
|
+
</fieldset>`}let p=i.kind==="many";return a`<fieldset class=${d?"current":""} ?hidden=${!d}>
|
|
2136
|
+
<legend>${this.heading(i.heading)}</legend>
|
|
2137
|
+
${i.hint?a`<p class="hint">${i.hint}</p>`:l}
|
|
2138
|
+
<div class="choices ${p?"many":""}">
|
|
2139
|
+
${i.choices.map(b=>a`<label class="choice">
|
|
2140
|
+
<input type=${p?"checkbox":"radio"} name=${`${this.uid}-${i.id}`} value=${b.id} .checked=${n.includes(b.id)}
|
|
2141
|
+
@change=${y=>this.pick(i,b,y.target.checked)}>
|
|
2142
|
+
<span class="label">${b.label}</span>
|
|
2143
|
+
${b.hint?a`<span class="small">${b.hint}</span>`:l}
|
|
2144
|
+
</label>`)}
|
|
2145
|
+
</div>
|
|
2146
|
+
</fieldset>`}renderResult(i){let s=ir(this.phases??[],i.weeks),n=this.at===(this.questions??[]).length;return a`<div class="result ${n?"current":""}" ?hidden=${!n}>
|
|
2147
|
+
${this.heading(this.resultHeading)}
|
|
2148
|
+
<p class="summary">${this.summaryOf(i)}</p>
|
|
2149
|
+
${(this.phases??[]).length?a`
|
|
2150
|
+
<div class="phases" aria-hidden="true">${(this.phases??[]).map((d,p)=>a`<i style=${`flex-grow:${s[p]};background:${P(void 0,p)}`}></i>`)}</div>
|
|
2151
|
+
<ul class="legend">${(this.phases??[]).map((d,p)=>a`<li style=${`--c:${P(void 0,p)}`}>${d.label} <b>${this.weeksWord(s[p])}</b></li>`)}</ul>`:l}
|
|
2152
|
+
<dl>
|
|
2153
|
+
<div><dt class="mono">${g("Your team")}</dt><dd>${this.teamOf(i.engineers)}</dd></div>
|
|
2154
|
+
${i.way?a`<div><dt class="mono">${g("Way of working")}</dt><dd>${i.way}</dd></div>`:l}
|
|
2155
|
+
</dl>
|
|
2156
|
+
<div class="actions">
|
|
2157
|
+
${this.contactHref?a`<a class="send" href=${this.contactHref} @click=${d=>this.send(d)}>${this.sendLabel} <span aria-hidden="true">→</span></a>`:l}
|
|
2158
|
+
<button type="button" class="secondary" @click=${()=>this.copy()}>${g("Copy summary")}</button>
|
|
2159
|
+
<button type="button" class="secondary" @click=${()=>{this.reset(),this.go(0)}}>${g("Start again")}</button>
|
|
2160
|
+
</div>
|
|
2161
|
+
<p class="status" role="status">${this.copied}</p>
|
|
2162
|
+
${this.note?a`<p class="note">${this.note}</p>`:l}
|
|
2163
|
+
</div>`}render(){let i=this.questions??[],s=i.length,n=yt(i,this.answers,this.rules),d=this.at>=s,p=(.6+Math.min(1,n.high/this.most)*1.1).toFixed(2);return a`<div class="wrap">
|
|
2164
|
+
<div>
|
|
2165
|
+
<div class="progress">
|
|
2166
|
+
<p class="mono">${d?this.resultHeading:g("Step {step} of {steps}",{step:this.at+1,steps:s})}</p>
|
|
2167
|
+
<div class="bar" aria-hidden="true"><i style=${`inline-size:${s?d?100:(this.at+1)/(s+1)*100:0}%`}></i></div>
|
|
2168
|
+
</div>
|
|
2169
|
+
${i.map((b,y)=>this.renderQuestion(b,y))}
|
|
2170
|
+
${this.renderResult(n)}
|
|
2171
|
+
${d?l:a`<div class="nav">
|
|
2172
|
+
${this.at>0?a`<button type="button" class="secondary" @click=${()=>this.go(this.at-1)}>${g("Back")}</button>`:l}
|
|
2173
|
+
<button type="button" class="primary" @click=${()=>this.go(this.at+1)}>${this.at===s-1?g("See my estimate"):g("Next")} <span aria-hidden="true">→</span></button>
|
|
2174
|
+
</div>`}
|
|
2175
|
+
</div>
|
|
2176
|
+
<aside class="panel" part="panel" style=${`--s:${p}`}>
|
|
2177
|
+
<div class="glow" aria-hidden="true"></div>
|
|
2178
|
+
<p class="mono">${this.budgetLabel}</p>
|
|
2179
|
+
<p class="range" aria-live="polite" aria-atomic="true">${this.rangeOf(n)}</p>
|
|
2180
|
+
<p class="weeks">${g("About {weeks} to a first release",{weeks:this.weeksWord(n.weeks)})}</p>
|
|
2181
|
+
<p class="tip" aria-live="polite">${this.tip||this.intro}</p>
|
|
2182
|
+
</aside>
|
|
2183
|
+
</div>`}};customElements.define("impkt-estimator",xt);var _r={"2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr","1:2:1":"1fr 2fr 1fr","2:1:1":"2fr 1fr 1fr","1:1:2":"1fr 1fr 2fr"},vt=class extends c{static{this.properties={columns:{type:String,reflect:!0},widths:{type:String,reflect:!0},gap:{type:String,reflect:!0},stackOn:{type:String,reflect:!0,attribute:"stack-on"},align:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.columns="two",this.widths="equal",this.gap="md",this.stackOn="phone",this.align="stretch",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2184
|
+
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
2185
|
+
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${f("layout.gutter.md","16px")}; align-items: stretch; }
|
|
2186
|
+
:host([gap='none']) .columns { gap: 0; }
|
|
2187
|
+
:host([gap='sm']) .columns { gap: ${f("layout.gutter.sm","8px")}; }
|
|
2188
|
+
:host([gap='lg']) .columns { gap: ${f("layout.gutter.lg","32px")}; }
|
|
2189
|
+
:host([gap='xl']) .columns { gap: ${f("layout.gutter.xl","48px")}; }
|
|
2190
|
+
:host([align='start']) .columns { align-items: start; }
|
|
2191
|
+
:host([align='center']) .columns { align-items: center; }
|
|
2192
|
+
:host([align='end']) .columns { align-items: end; }
|
|
2193
|
+
:host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }
|
|
2194
|
+
:host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2195
|
+
:host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
2196
|
+
:host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
|
|
2197
|
+
:host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
|
|
2198
|
+
.column { min-inline-size: 0; overflow-wrap: anywhere; }
|
|
2199
|
+
::slotted(*) { max-inline-size: 100%; }
|
|
2200
|
+
@container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
2201
|
+
@container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
2202
|
+
`]}render(){let t=this.columns==="one"?1:this.columns==="three"?3:this.columns==="four"?4:2,i=_r[this.widths]?.split(" "),s=i&&i.length===t?i.map(n=>`minmax(0, ${n})`).join(" "):"";return a`<div class="columns" part="row" style=${s?`grid-template-columns: ${s}`:""}>${Array.from({length:t},(n,d)=>a`<div class="column" part="column"><slot name=${`column-${d+1}`}></slot></div>`)}</div>`}};customElements.define("impkt-grid",vt);var kt=class extends c{static{this.properties={mechanismId:{type:String,attribute:"mechanism-id"},kind:{type:String,reflect:!0},href:{type:String},label:{type:String},detail:{type:String}}}constructor(){super(),this.kind="link",this.href="",this.label="",this.detail=""}static{this.styles=[...c.styles,k,h`
|
|
2203
|
+
:host { display: block; }
|
|
2204
|
+
a { display: inline-flex; align-items: center; min-height: ${e.targetMin}; min-width: ${e.targetMin};
|
|
2205
|
+
color: ${e.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }
|
|
2206
|
+
a:hover { color: ${e.linkHover}; }
|
|
2207
|
+
.contact { margin: 0; }
|
|
2208
|
+
.caption { display: block; font-weight: ${u("semibold")}; }
|
|
2209
|
+
/* An address is written one line at a time, and opening hours are often one
|
|
2210
|
+
day to a line. Long unbroken values still wrap at 320px (1.4.10). */
|
|
2211
|
+
.detail { white-space: pre-line; overflow-wrap: anywhere; }
|
|
2212
|
+
`]}render(){switch(this.kind){case"phone":case"email":case"address":case"hours":return this.renderContact();default:return this.renderLink()}}renderLink(){return Ai(this.label)?a`<a part="link" href=${this.href}>${this.label}</a>`:l}renderContact(){let t=Ai(this.detail);if(!t)return l;let i=Ai(this.label),s=Hr(this.kind,t),n=this.id_("caption"),d=this.id_("detail"),p=i?a`<span class="caption" part="label" id=${n}>${i}</span>`:l,b=s?a`<a part="link" href=${s} aria-labelledby=${i?`${n} ${d}`:l}
|
|
2213
|
+
><span class="detail" part="detail" id=${d}>${t}</span></a>`:a`<span class="detail" part="detail">${t}</span>`;return a`<p class="contact" part="contact">${p}${b}</p>`}};function Ai(o){return typeof o=="string"?o.trim():""}function Hr(o,t){if(o==="phone"){let i=t.replace(/\(0\)/g,"").replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"");return/\d/.test(i)?`tel:${i}`:""}return o==="email"&&/^[^\s@]+@[^\s@]+$/.test(t)?`mailto:${t}`:""}customElements.define("impkt-help",kt);var rr=h`
|
|
2214
|
+
:host { --impkt-page-inner: ${f("layout.page-width","1200px")}; }
|
|
2215
|
+
:host([width='narrow']) { --impkt-page-inner: 760px; }
|
|
2216
|
+
:host([width='wide']) { --impkt-page-inner: 1440px; }
|
|
2217
|
+
`,Nr=h`
|
|
2218
|
+
:host { --impkt-page-margin: ${f("layout.margin.phone","16px")}; }
|
|
2219
|
+
@container impkt-page (min-width: 40rem) { .frame { --impkt-page-margin: ${f("layout.margin.tablet","32px")}; } }
|
|
2220
|
+
@container impkt-page (min-width: 64rem) { .frame { --impkt-page-margin: ${f("layout.margin.desktop","64px")}; } }
|
|
2221
|
+
`,wt=class extends c{constructor(){super();this.place=()=>{let i=this.querySelector('impkt-hero[treatment="cover"]'),s=getComputedStyle(this).getPropertyValue("--impkt-bleed").trim()==="0",n=!!i&&!s&&this.opensOn(i);if(this.toggleAttribute("floating",n),!n)return;let d=this.renderRoot.querySelector(".frame");d&&this.style.setProperty("--impkt-header-top",`${Math.round(i.getBoundingClientRect().top-d.getBoundingClientRect().top)}px`)};this.width="standard",this.stickyHeader=!1,this.skipText="Skip to content"}static{this.properties={width:{type:String,reflect:!0},stickyHeader:{type:Boolean,reflect:!0,attribute:"sticky-header"},skipText:{type:String,attribute:"skip-text"}}}static{this.styles=[...c.styles,k,rr,Nr,h`
|
|
2222
|
+
:host { display: block; container: impkt-page / inline-size; }
|
|
2223
|
+
.frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
|
|
2224
|
+
.inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impkt-page-inner) + 2 * var(--impkt-page-margin)); margin-inline: auto; padding-inline: var(--impkt-page-margin); }
|
|
2225
|
+
header { background: ${f("color.surface.header","transparent")}; color: ${f("color.text.on-header","inherit")}; padding-block: ${r(4)}; }
|
|
2226
|
+
/* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */
|
|
2227
|
+
header { --impkt-color-text-default: ${f("color.text.on-header","inherit")}; --impkt-color-text-heading: ${f("color.text.on-header","inherit")}; }
|
|
2228
|
+
footer { --impkt-color-text-default: ${f("color.text.on-footer","inherit")}; --impkt-color-text-heading: ${f("color.text.on-footer","inherit")}; --impkt-color-text-muted: ${f("color.text.on-footer","inherit")}; --impkt-color-text-link: ${f("color.text.on-footer","inherit")}; --impkt-color-text-link-hover: ${f("color.text.on-footer","inherit")}; }
|
|
2229
|
+
:host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }
|
|
2230
|
+
main { flex: 1; padding-block: ${r(6)} ${r(10)}; }
|
|
2231
|
+
main:focus { outline: none; }
|
|
2232
|
+
/* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */
|
|
2233
|
+
:host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impkt-header-top, 0px); padding-block: ${r(6)} 0; background: transparent; border: 0; }
|
|
2234
|
+
:host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impkt-page-margin)); max-inline-size: var(--impkt-page-inner); padding: ${r(3)} ${r(4)} ${r(3)} ${r(6)}; background: ${f("color.surface.header","#fff")}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowLg}; }
|
|
2235
|
+
:host([floating]) main { padding-block-start: 0; }
|
|
2236
|
+
footer { background: ${f("color.surface.footer","transparent")}; color: ${f("color.text.on-footer","inherit")}; padding-block: ${r(8)}; border-block-start: ${e.borderThin} solid ${f("color.border.subtle","transparent")}; }
|
|
2237
|
+
.skip { position: absolute; inset-inline-start: ${r(2)}; inset-block-start: ${r(2)}; z-index: 20; padding: ${r(2)} ${r(4)}; background: ${e.surfaceCard}; color: ${e.link}; border-radius: ${e.radius}; transform: translateY(-200%); }
|
|
2238
|
+
.skip:not(:focus) { clip-path: inset(50%); }
|
|
2239
|
+
.skip:focus { transform: none; }
|
|
2240
|
+
.empty { display: none; }
|
|
2241
|
+
`]}hasSlot(i){return Array.from(this.children).some(s=>s.getAttribute("slot")===i)}skip(i){i.preventDefault();let s=this.renderRoot.querySelector("main");s?.focus(),s?.scrollIntoView()}render(){let i=this.hasSlot("header"),s=this.hasSlot("footer");return a`<div class="frame" part="frame">
|
|
2242
|
+
<a class="skip" href="#content" part="skip" @click=${this.skip}>${this.skipText}</a>
|
|
2243
|
+
${i?a`<header part="header"><div class="inner"><slot name="header"></slot></div></header>`:l}
|
|
2244
|
+
<main id="content" tabindex="-1" part="main"><div class="inner"><slot></slot></div></main>
|
|
2245
|
+
${s?a`<footer part="footer"><div class="inner"><slot name="footer"></slot></div></footer>`:l}
|
|
2246
|
+
</div>`}opensOn(i){for(let s of Array.from(this.querySelectorAll("*"))){if(s===i)return!0;if(!s.closest('[slot="header"],[slot="footer"]')&&s.tagName.startsWith("IMPKT-")&&!/^IMPKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(s.tagName))return!1}return!1}connectedCallback(){super.connectedCallback(),this.observer=new MutationObserver(()=>this.requestUpdate()),this.observer.observe(this,{childList:!0,attributes:!0,subtree:!1,attributeFilter:["slot"]}),this.watcher=new MutationObserver(this.place),this.watcher.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["treatment"]}),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(this.place),this.resize.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect(),this.watcher?.disconnect(),this.resize?.disconnect()}firstUpdated(){this.place()}},St=class extends c{static{this.properties={tone:{type:String,reflect:!0},padding:{type:String,reflect:!0},width:{type:String,reflect:!0},bleed:{type:Boolean,reflect:!0},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.tone="none",this.padding="lg",this.width="standard",this.bleed=!0,this.label="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,rr,h`
|
|
2247
|
+
:host { display: block; --impkt-page-margin: inherit; }
|
|
2248
|
+
/* What a solid card on a brand band goes back to, since the band repaints these for its own text. */
|
|
2249
|
+
:host([tone='brand']) { --impkt-solid-card: ${e.surfaceCard}; --impkt-solid-text: ${e.text}; --impkt-solid-heading: var(--impkt-color-text-heading, ${e.text}); --impkt-solid-muted: ${e.textMuted}; }
|
|
2250
|
+
.band { box-sizing: border-box; border-radius: ${e.radiusLg}; }
|
|
2251
|
+
/* --impkt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */
|
|
2252
|
+
:host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding-inline: max(${r(4)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))); }
|
|
2253
|
+
:host([tone='subtle']) .band { background: ${e.surfaceSubtle}; }
|
|
2254
|
+
:host([tone='inset']) .band { background: ${e.surfaceInset}; }
|
|
2255
|
+
:host([tone='card']) .band { background: ${e.surfaceCard}; }
|
|
2256
|
+
:host([tone='brand']) .band { background: ${e.brand}; color: ${e.onBrand}; --impkt-eyebrow: ${e.onBrand}; --impkt-color-surface-card: color-mix(in srgb, ${e.onBrand} 10%, transparent); --impkt-color-text-heading: ${e.onBrand}; --impkt-color-text-default: ${e.onBrand}; --impkt-color-text-muted: ${e.onBrand}; --impkt-color-text-link: ${e.onBrand}; --impkt-color-text-link-hover: ${e.onBrand}; }
|
|
2257
|
+
:host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${r(6)}; }
|
|
2258
|
+
:host([padding='sm']) .band { padding-block: ${r(4)}; }
|
|
2259
|
+
:host([padding='md']) .band { padding-block: ${r(8)}; }
|
|
2260
|
+
:host([padding='lg']) .band { padding-block: ${r(12)}; }
|
|
2261
|
+
:host([padding='xl']) .band { padding-block: ${r(16)}; }
|
|
2262
|
+
:host([padding='2xl']) .band { padding-block: clamp(${r(14)}, 8vw, ${r(28)}); }
|
|
2263
|
+
.content { max-inline-size: var(--impkt-page-inner); margin-inline: auto; }
|
|
2264
|
+
`]}render(){return a`<section class="band" part="band" aria-label=${this.label||l} role=${this.label?l:"presentation"}><div class="content" part="content"><slot></slot></div></section>`}};customElements.define("impkt-page",wt);customElements.define("impkt-section",St);var Mi=(o,t,i)=>a`<div class=${i} role="heading" aria-level=${o}>${t}</div>`,sr=h`
|
|
2265
|
+
.h { margin: 0; color: ${e.textHeading}; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; line-height: ${C("tight")}; }
|
|
2266
|
+
.eyebrow { margin: 0; color: var(--impkt-eyebrow, var(--impkt-color-text-eyebrow, ${e.brand})); ${m("sm")} font-size: var(--impkt-font-size-eyebrow, var(--impkt-font-size-sm, 0.875rem)); font-family: ${e.fontEyebrow}; font-weight: var(--impkt-font-weight-eyebrow, ${u("semibold")}); letter-spacing: ${e.trackingWide}; text-transform: uppercase; }
|
|
2267
|
+
.body { margin: 0; line-height: ${C("normal")}; max-inline-size: 65ch; }
|
|
2268
|
+
`,Tt=class extends c{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=[...c.styles,w,sr,h`
|
|
2269
|
+
:host { display: block; container-type: inline-size; }
|
|
2270
|
+
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${r(8)}; align-items: center; }
|
|
2271
|
+
.hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
|
|
2272
|
+
.words { display: flex; flex-direction: column; gap: ${r(4)}; }
|
|
2273
|
+
:host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
|
|
2274
|
+
.h { ${m("5xl")} letter-spacing: ${e.trackingTight}; text-wrap: balance; }
|
|
2275
|
+
.body { ${m("lg")} color: ${e.textMuted}; text-wrap: pretty; }
|
|
2276
|
+
@container (max-width: 40rem) { .h { ${m("4xl")} } }
|
|
2277
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${r(3)} ${r(4)}; align-items: center; margin-block-start: ${r(2)}; }
|
|
2278
|
+
:host([align='center']) .actions { justify-content: center; }
|
|
2279
|
+
img { display: block; inline-size: 100%; block-size: auto; border-radius: ${e.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${e.shadowLg}; }
|
|
2280
|
+
@container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
|
|
2281
|
+
/* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */
|
|
2282
|
+
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding: ${r(32)} max(${r(8)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))) ${r(24)}; overflow: hidden; color: #fff; --impkt-color-text-heading: #fff; }
|
|
2283
|
+
.cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
|
|
2284
|
+
.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%); }
|
|
2285
|
+
.cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }
|
|
2286
|
+
.cover .eyebrow { display: inline-flex; align-items: center; gap: ${r(2)}; align-self: flex-start; padding: ${r(2)} ${r(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }
|
|
2287
|
+
.chip-line { position: relative; z-index: 1; block-size: 0; }
|
|
2288
|
+
.chip { position: absolute; inset-block-start: ${r(14)}; inset-inline-end: ${r(9)}; display: inline-flex; align-items: center; gap: ${r(2.5)}; padding: ${r(3)} ${r(4.5)}; ${m("sm")} font-weight: ${u("semibold")}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${e.radiusXl}; }
|
|
2289
|
+
.finder { position: relative; z-index: 1; margin-block-start: ${r(12)}; }
|
|
2290
|
+
.cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }
|
|
2291
|
+
.cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }
|
|
2292
|
+
@container (max-width: 64rem) { .chip { display: none; } }
|
|
2293
|
+
@container (max-width: 30rem) { .finder { display: none; } }
|
|
2294
|
+
@container (max-width: 48rem) { .finder { margin-block-start: ${r(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${r(32)} ${r(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; } }
|
|
2295
|
+
`]}render(){if(this.treatment==="cover"&&this.imageSrc)return a`<div class="cover" part="hero">
|
|
2296
|
+
${this.ratingText?a`<div class="chip-line"><div class="chip">${S("star","20px")}${this.ratingText}</div></div>`:l}
|
|
2297
|
+
<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />
|
|
2298
|
+
<div class="words">
|
|
2299
|
+
${this.eyebrow?a`<p class="eyebrow" part="eyebrow">${this.eyebrowIcon!=="none"?S(this.eyebrowIcon,"16px"):l}${this.eyebrow}</p>`:l}
|
|
2300
|
+
${Mi(this.level,this.heading,"h")}
|
|
2301
|
+
${this.lead?a`<p class="body">${this.lead}</p>`:l}
|
|
2302
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
2303
|
+
</div>
|
|
2304
|
+
<div class="finder"><slot name="search"></slot></div>
|
|
2305
|
+
</div>`;let t=!!this.imageSrc&&this.align!=="center";return a`<div class="hero ${t?"pictured":""}" part="hero">
|
|
2306
|
+
<div class="words">
|
|
2307
|
+
${this.eyebrow?a`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:l}
|
|
2308
|
+
${Mi(this.level,this.heading,"h")}
|
|
2309
|
+
${this.lead?a`<p class="body">${this.lead}</p>`:l}
|
|
2310
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
2311
|
+
</div>
|
|
2312
|
+
${t?a`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />`:l}
|
|
2313
|
+
</div>`}},zt=class extends c{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=[...c.styles,w,sr,h`
|
|
2314
|
+
:host { display: block; container-type: inline-size; }
|
|
2315
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(8)} ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2316
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2317
|
+
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
2318
|
+
li { display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2319
|
+
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${r(4)}; align-items: start; }
|
|
2320
|
+
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${r(1)}; }
|
|
2321
|
+
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${e.radiusLg}; background: ${e.brandSubtle}; color: ${e.brand}; margin-block-end: ${r(2)}; }
|
|
2322
|
+
:host([layout='inline']) .icon { margin: 0; }
|
|
2323
|
+
.h { font-size: ${$("lg")}; }
|
|
2324
|
+
.body { color: ${e.text}; }
|
|
2325
|
+
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
2326
|
+
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2327
|
+
`]}render(){return a`<ul part="list">${(this.items??[]).map(t=>a`<li part="item">
|
|
2328
|
+
${t.icon?a`<span class="icon">${S(t.icon,"24px")}</span>`:l}
|
|
2329
|
+
<div class="words">${Mi(this.headingLevel,t.heading,"h")}${t.text?a`<p class="body">${t.text}</p>`:l}</div>
|
|
2330
|
+
</li>`)}</ul>`}},At=class extends c{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=[...c.styles,w,h`
|
|
2331
|
+
:host { display: block; }
|
|
2332
|
+
figure { margin: 0; display: flex; flex-direction: column; gap: ${r(4)}; max-inline-size: 48rem; }
|
|
2333
|
+
:host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
|
|
2334
|
+
blockquote { margin: 0; font-family: ${e.fontHeading}; font-size: ${$("lg")}; line-height: ${C("normal")}; color: inherit; }
|
|
2335
|
+
:host([size='lg']) blockquote { font-size: ${$("2xl")}; line-height: ${C("tight")}; }
|
|
2336
|
+
blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
|
|
2337
|
+
figcaption { display: flex; align-items: center; gap: ${r(3)}; }
|
|
2338
|
+
img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
|
|
2339
|
+
.name { font-weight: ${u("semibold")}; }
|
|
2340
|
+
.detail { color: ${e.textMuted}; font-size: ${$("sm")}; }
|
|
2341
|
+
`]}render(){return a`<figure part="figure">
|
|
2342
|
+
<blockquote part="quote">${this.quote}</blockquote>
|
|
2343
|
+
${this.person?a`<figcaption>${this.imageSrc?a`<img src=${this.imageSrc} alt="" />`:l}<span><span class="name">${this.person}</span>${this.about?a`<br /><span class="detail">${this.about}</span>`:l}</span></figcaption>`:l}
|
|
2344
|
+
</figure>`}},Mt=class extends c{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=[...c.styles,h`
|
|
2345
|
+
:host { display: block; }
|
|
2346
|
+
.stat { display: flex; flex-direction: column; gap: ${r(1)}; }
|
|
2347
|
+
:host([align='center']) .stat { align-items: center; text-align: center; }
|
|
2348
|
+
.value { font-family: ${e.fontHeading}; font-size: ${$("3xl")}; font-weight: ${u("bold")}; line-height: 1; color: ${e.textHeading}; }
|
|
2349
|
+
:host([size='lg']) .value { font-size: ${$("5xl")}; }
|
|
2350
|
+
:host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
|
|
2351
|
+
.label { font-weight: ${u("semibold")}; }
|
|
2352
|
+
.detail { color: ${e.textMuted}; font-size: ${$("sm")}; }
|
|
2353
|
+
`]}render(){return a`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note?a` <span class="detail">${this.note}</span>`:l}</p>`}},Et=class extends c{static{this.properties={tone:{type:String,reflect:!0},icon:{type:String}}}constructor(){super(),this.tone="neutral",this.icon="none"}static{this.styles=[...c.styles,h`
|
|
2354
|
+
:host { display: inline-flex; }
|
|
2355
|
+
span { display: inline-flex; align-items: center; gap: ${r(1)}; padding: ${r(.5)} ${r(2)}; border-radius: ${e.radius}; ${m("sm")} font-weight: ${u("medium")}; background: ${e.surfaceInset}; color: ${e.text}; box-shadow: inset 0 0 0 1px ${e.hairline}; }
|
|
2356
|
+
:host([tone='brand']) span { background: ${e.brandSubtle}; color: ${e.brand}; }
|
|
2357
|
+
:host([tone='success']) span { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
2358
|
+
:host([tone='warning']) span { background: ${e.warningSubtle}; color: ${e.warningText}; }
|
|
2359
|
+
:host([tone='danger']) span { background: ${e.dangerSubtle}; color: ${e.dangerText}; }
|
|
2360
|
+
:host([tone='info']) span { background: ${e.infoSubtle}; color: ${e.infoText}; }
|
|
2361
|
+
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
2362
|
+
`]}render(){return a`<span part="badge">${S(this.icon,"1em")}<slot></slot></span>`}},Lt=class extends c{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=[...c.styles,h`
|
|
2363
|
+
:host { display: block; }
|
|
2364
|
+
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${r(2)} ${r(3)}; padding: ${r(2.5)} ${r(5)}; ${m("sm")} text-align: center; color: ${e.onBrand}; background: ${e.brand}; }
|
|
2365
|
+
:host { margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); }
|
|
2366
|
+
a { display: inline-flex; align-items: center; gap: ${r(1)}; color: inherit; font-weight: ${u("semibold")}; }
|
|
2367
|
+
`]}render(){return a`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText&&this.href?a`<a href=${this.href}>${this.linkText}${S("arrow-right","14px")}</a>`:l}</div>`}},Ct=class extends c{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=[...c.styles,w,h`
|
|
2368
|
+
:host { display: block; container-type: inline-size; }
|
|
2369
|
+
form { display: flex; align-items: center; padding: ${r(3)}; background: ${e.surfaceCard}; color: ${e.text}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowXl}; }
|
|
2370
|
+
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${r(1)}; padding: ${r(1.5)} ${r(5)}; }
|
|
2371
|
+
label { ${m("sm")} color: ${e.textMuted}; }
|
|
2372
|
+
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.text}; background: transparent; border: 0; border-radius: ${e.radiusSm}; cursor: pointer; }
|
|
2373
|
+
select:focus-visible, button:focus-visible { outline: 2px solid ${e.brand}; outline-offset: 2px; }
|
|
2374
|
+
button { flex: none; min-block-size: 48px; padding: ${r(3)} ${r(6)}; font: inherit; font-weight: ${u("semibold")}; color: ${e.onBrand}; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
2375
|
+
button:hover { background: ${e.brandHover}; }
|
|
2376
|
+
@container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }
|
|
2377
|
+
@container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${r(2)}; } .field { flex: none; } }
|
|
2378
|
+
`]}submit(t){let i=new FormData(t.currentTarget),s={};i.forEach((n,d)=>{n!==""&&(s[d]=String(n))}),this.dispatchEvent(new CustomEvent("impkt-submit",{detail:{values:s},bubbles:!0,composed:!0})),this.action||t.preventDefault()}render(){return a`<form role="search" aria-label=${this.label} method="get" action=${this.action||l} @submit=${this.submit} part="form">
|
|
2379
|
+
${(this.items??[]).map((t,i)=>{let s=this.id_(`field-${i}`),n=String(t.options??"").split(",").map(d=>d.trim()).filter(Boolean);return a`<div class="field"><label for=${s}>${t.label}</label><select id=${s} name=${t.name||t.label.toLowerCase().replace(/[^a-z0-9]+/g,"-")}>
|
|
2380
|
+
<option value="">${t.placeholder||"Any"}</option>${n.map(d=>a`<option value=${d}>${d}</option>`)}
|
|
2381
|
+
</select></div>`})}
|
|
2382
|
+
<button type="submit">${this.buttonText}</button>
|
|
2383
|
+
</form>`}};customElements.define("impkt-search-bar",Ct);customElements.define("impkt-announcement",Lt);customElements.define("impkt-hero",Tt);customElements.define("impkt-feature-list",zt);customElements.define("impkt-quote",At);customElements.define("impkt-stat",Mt);customElements.define("impkt-badge",Et);var Rt=class extends c{static{this.properties={spacing:{type:String,reflect:!0},tone:{type:String,reflect:!0}}}constructor(){super(),this.spacing="md",this.tone="subtle"}static{this.styles=[...c.styles,h`
|
|
2384
|
+
:host { display: block; }
|
|
2385
|
+
hr { margin: ${r(4)} 0; border: 0; border-block-start: ${e.borderThin} solid ${e.border}; opacity: 0.5; }
|
|
2386
|
+
:host([tone='strong']) hr { opacity: 1; border-block-start-width: ${e.borderThick}; }
|
|
2387
|
+
:host([spacing='sm']) hr { margin-block: ${r(2)}; }
|
|
2388
|
+
:host([spacing='lg']) hr { margin-block: ${r(8)}; }
|
|
2389
|
+
:host([spacing='xl']) hr { margin-block: ${r(12)}; }
|
|
2390
|
+
`]}render(){return a`<hr aria-hidden="true" part="line" />`}},It=class extends c{static{this.properties={size:{type:String,reflect:!0}}}constructor(){super(),this.size="md"}static{this.styles=[...c.styles,h`
|
|
2391
|
+
:host { display: block; block-size: ${r(4)}; }
|
|
2392
|
+
:host([size='sm']) { block-size: ${r(2)}; }
|
|
2393
|
+
:host([size='lg']) { block-size: ${r(8)}; }
|
|
2394
|
+
:host([size='xl']) { block-size: ${r(12)}; }
|
|
2395
|
+
:host([size='2xl']) { block-size: ${r(16)}; }
|
|
2396
|
+
`]}render(){return a``}},Bt=class extends c{static{this.styles=[...c.styles,h`:host { ${E} }`]}render(){return a`<slot></slot>`}},_t=class extends c{static{this.properties={items:{type:Array},selected:{type:String,reflect:!0},label:{type:String},twoRows:{type:Boolean,reflect:!0,attribute:"two-rows"}}}constructor(){super(),this.items=[],this.selected="",this.label="",this.twoRows=!1}static{this.styles=[...c.styles,k,R("[role='tab']"),h`
|
|
2397
|
+
:host { display: block; container-type: inline-size; }
|
|
2398
|
+
[role='tablist'] { display: flex; gap: ${r(1)}; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-block-end: ${e.borderThin} solid ${e.border}; }
|
|
2399
|
+
[role='tab'] { ${A} flex: none; padding: ${r(3)} ${r(4)}; font: inherit; font-weight: ${u("semibold")}; white-space: nowrap; color: ${e.textMuted}; background: transparent; border: 0; border-block-end: 3px solid transparent; margin-block-end: -1px; cursor: pointer; border-radius: ${e.radius} ${e.radius} 0 0; }
|
|
2400
|
+
/* Inside a box that scrolls the ring would be clipped, so it is drawn inside the tab. */
|
|
2401
|
+
[role='tab']:focus-visible { box-shadow: inset 0 0 0 2px ${e.text}, inset 0 0 0 4px ${e.surfaceCard}; }
|
|
2402
|
+
[role='tab']:hover { color: ${e.text}; background: ${e.surfaceInset}; }
|
|
2403
|
+
[role='tab'][aria-selected='true'] { color: ${e.link}; border-block-end-color: currentColor; }
|
|
2404
|
+
[role='tabpanel'] { padding-block: ${r(5)}; line-height: ${C("normal")}; }
|
|
2405
|
+
.body { white-space: pre-line; }
|
|
2406
|
+
@container (max-width: 40rem) {
|
|
2407
|
+
:host([two-rows]) [role='tablist'].many { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); overflow: visible; border-block-end: 0; gap: ${r(1)}; }
|
|
2408
|
+
:host([two-rows]) .many [role='tab'] { white-space: normal; padding-inline: ${r(2)}; margin: 0; border-block-end-width: 3px; border-block-end-color: ${e.rule}; border-radius: ${e.radius}; }
|
|
2409
|
+
:host([two-rows]) .many [role='tab'][aria-selected='true'] { border-block-end-color: currentColor; background: ${e.brandSubtle}; }
|
|
2410
|
+
}
|
|
2411
|
+
@media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }
|
|
2412
|
+
`]}current(){let t=this.items??[];return t.some(i=>i.id===this.selected)?this.selected:t[0]?.id??""}choose(t,i){t!==this.current()&&(this.selected=t,this.dispatchEvent(new CustomEvent("impkt-change",{detail:{value:t},bubbles:!0,composed:!0})),i&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${this.id_(`tab-${t}`)}`)?.focus({preventScroll:!0})))}onKey(t){let i=this.items??[],s=i.findIndex(d=>d.id===this.current()),n={ArrowRight:s+1,ArrowLeft:s-1,Home:0,End:i.length-1}[t.key];n===void 0||!i.length||(t.preventDefault(),this.choose(i[(n+i.length)%i.length].id,!0))}reveal(){let t=this.renderRoot.querySelector("[role='tablist']"),i=this.renderRoot.querySelector("[role='tab'][aria-selected='true']");if(!t||!i||t.scrollWidth<=t.clientWidth)return;let s=i.offsetLeft-t.offsetLeft,n=s+i.offsetWidth;s<t.scrollLeft?t.scrollLeft=s-16:n>t.scrollLeft+t.clientWidth&&(t.scrollLeft=n-t.clientWidth+16)}updated(t){(t.has("selected")||t.has("items"))&&this.reveal()}render(){let t=this.items??[],i=this.current(),s=t.length>4;return a`<div role="tablist" aria-label=${this.label||l} part="tabs" class=${s?"many":""} style=${s?`--columns:${Math.ceil(t.length/2)}`:l} @keydown=${this.onKey}>
|
|
2413
|
+
${t.map(n=>a`<button role="tab" type="button" id=${this.id_(`tab-${n.id}`)} aria-selected=${n.id===i?"true":"false"} aria-controls=${this.id_(`panel-${n.id}`)} tabindex=${n.id===i?"0":"-1"} @click=${()=>this.choose(n.id,!1)}>${n.label}</button>`)}
|
|
2414
|
+
</div>
|
|
2415
|
+
${t.map(n=>a`<div role="tabpanel" id=${this.id_(`panel-${n.id}`)} aria-labelledby=${this.id_(`tab-${n.id}`)} tabindex="0" ?hidden=${n.id!==i} part="panel"><slot name=${n.id}><span class="body">${n.body}</span></slot></div>`)}`}},Ht=class extends c{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=[...c.styles,k,w,h`
|
|
2416
|
+
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
2417
|
+
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
2418
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
2419
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
2420
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2421
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2422
|
+
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
2423
|
+
li { position: relative; display: flex; flex-direction: column; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.hairline}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }
|
|
2424
|
+
li.linked:hover { box-shadow: ${e.shadowLg}; transform: translateY(-2px); }
|
|
2425
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
2426
|
+
.words { display: flex; flex-direction: column; gap: ${r(2)}; padding: ${r(5)}; flex: 1; }
|
|
2427
|
+
.h { margin: 0; color: ${e.textHeading}; font-family: ${e.fontHeading}; font-size: ${$("lg")}; font-weight: ${u("bold")}; line-height: ${C("tight")}; }
|
|
2428
|
+
.h a { color: inherit; text-decoration: none; border-radius: ${e.radiusSm}; }
|
|
2429
|
+
.h a::after { content: ''; position: absolute; inset: 0; }
|
|
2430
|
+
li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
2431
|
+
.body { margin: 0; line-height: ${C("normal")}; }
|
|
2432
|
+
.badge { align-self: flex-start; padding: ${r(.5)} ${r(2)}; border-radius: ${e.radius}; font-size: ${$("sm")}; font-weight: ${u("medium")}; background: ${e.brandSubtle}; color: ${e.brand}; box-shadow: inset 0 0 0 1px ${e.hairline}; }
|
|
2433
|
+
.more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${r(1)}; color: ${e.link}; font-weight: ${u("semibold")}; }
|
|
2434
|
+
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
2435
|
+
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2436
|
+
`]}render(){return a`<ul part="list">${(this.items??[]).map(t=>a`<li class=${t.href?"linked":""} part="card">
|
|
2437
|
+
${t.imageSrc?a`<img src=${t.imageSrc} alt=${t.imageAlt??""} loading="lazy" />`:l}
|
|
2438
|
+
<div class="words">
|
|
2439
|
+
${t.badge?a`<span class="badge">${t.badge}</span>`:l}
|
|
2440
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.href?a`<a href=${t.href}>${t.heading}</a>`:t.heading}</div>
|
|
2441
|
+
${t.text?a`<p class="body">${t.text}</p>`:l}
|
|
2442
|
+
${t.href?a`<span class="more" aria-hidden="true">${S("arrow-right","1em")}</span>`:l}
|
|
2443
|
+
</div>
|
|
2444
|
+
</li>`)}</ul>`}};customElements.define("impkt-divider",Rt);customElements.define("impkt-spacer",It);customElements.define("impkt-visually-hidden",Bt);customElements.define("impkt-tabs",_t);customElements.define("impkt-card-grid",Ht);var Nt=class extends c{static{this.properties={legend:{type:String},description:{type:String},error:{type:String,reflect:!0},size:{type:String,reflect:!0}}}constructor(){super(),this.legend="",this.description="",this.error="",this.size="md"}static{this.styles=[...c.styles,h`
|
|
2445
|
+
:host { display: block; margin-block-end: ${r(6)}; }
|
|
2446
|
+
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
2447
|
+
legend { padding: 0; margin-block-end: ${r(2)}; font-size: ${$("md")}; font-weight: ${u("bold")}; line-height: ${C("tight")}; color: ${e.text}; }
|
|
2448
|
+
:host([size='lg']) legend { font-size: ${$("xl")}; font-family: ${e.fontHeading}; color: ${e.textHeading}; }
|
|
2449
|
+
:host([size='xl']) legend { font-size: ${$("2xl")}; font-family: ${e.fontHeading}; color: ${e.textHeading}; }
|
|
2450
|
+
.description { margin-block-end: ${r(3)}; font-size: ${$("sm")}; color: ${e.textMuted}; line-height: ${C("normal")}; }
|
|
2451
|
+
.error { margin-block-end: ${r(3)}; font-size: ${$("sm")}; color: ${e.dangerText}; font-weight: ${u("semibold")}; }
|
|
2452
|
+
.error:empty { display: none; }
|
|
2453
|
+
:host([error]:not([error=''])) .fields { padding-inline-start: ${r(4)}; border-inline-start: 4px solid ${e.danger}; }
|
|
2454
|
+
`]}render(){let t=[this.description?this.id_("description"):"",this.error?this.id_("error"):""].filter(Boolean).join(" ");return a`<fieldset part="fieldset" aria-describedby=${t||l}>
|
|
2455
|
+
<legend part="legend">${this.legend}</legend>
|
|
2456
|
+
${this.description?a`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
2457
|
+
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
2458
|
+
<div class="fields" part="fields"><slot></slot></div>
|
|
2459
|
+
</fieldset>`}};customElements.define("impkt-fieldset",Nt);var Pt=class extends c{constructor(){super();this.hasFooter=!1;this.open=!1,this.heading="",this.side="right",this.closeLabel="Close"}static{this.properties={open:{type:Boolean,reflect:!0},heading:{type:String},side:{type:String,reflect:!0},closeLabel:{type:String,attribute:"close-label"}}}static{this.styles=[...c.styles,k,R(".close"),h`
|
|
2460
|
+
dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${e.text}; background: ${e.surfaceCard}; box-shadow: ${e.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
|
|
2461
|
+
dialog[open] { display: flex; }
|
|
2462
|
+
:host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
|
|
2463
|
+
dialog::backdrop { background: color-mix(in srgb, ${e.text} 30%, transparent); backdrop-filter: blur(2px); }
|
|
2464
|
+
@keyframes from-right { from { transform: translateX(100%); } }
|
|
2465
|
+
@keyframes from-left { from { transform: translateX(-100%); } }
|
|
2466
|
+
.head { display: flex; align-items: center; justify-content: space-between; gap: ${r(3)}; padding: ${r(4)} ${r(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${e.text} 8%, transparent); }
|
|
2467
|
+
h2 { margin: 0; font-family: ${e.fontHeading}; ${m("xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2468
|
+
.close { ${A} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${e.text}; background: none; border: 0; border-radius: ${e.radius}; cursor: pointer; }
|
|
2469
|
+
.close:hover { background: ${e.surfaceSubtle}; }
|
|
2470
|
+
.body { flex: 1; overflow: auto; padding: ${r(5)}; }
|
|
2471
|
+
.foot { display: flex; gap: ${r(3)}; justify-content: flex-end; padding: ${r(4)} ${r(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${e.text} 8%, transparent); }
|
|
2472
|
+
.foot[hidden] { display: none; }
|
|
2473
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(i){if(!i.has("open"))return;let s=this.dialog;s&&(this.open?(typeof s.showModal=="function"?s.showModal():s.setAttribute("open",""),gt(this)):(typeof s.close=="function"&&s.open?s.close():s.removeAttribute("open"),se(this)))}disconnectedCallback(){super.disconnectedCallback(),se(this)}close(){this.open=!1,this.dispatchEvent(new CustomEvent("impkt-close",{bubbles:!0,composed:!0}))}footerChanged(i){this.hasFooter=i.target.assignedNodes().length>0,this.requestUpdate()}render(){return a`<dialog part="dialog" aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
2474
|
+
@cancel=${()=>this.close()}
|
|
2475
|
+
@close=${()=>{this.open&&this.close()}}
|
|
2476
|
+
@click=${i=>{i.target===this.dialog&&this.close()}}>
|
|
2477
|
+
<div class="head">
|
|
2478
|
+
${this.heading?a`<h2 id=${this.id_("heading")}>${this.heading}</h2>`:a`<span></span>`}
|
|
2479
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${S("close","20px")}</button>
|
|
2480
|
+
</div>
|
|
2481
|
+
<div class="body" part="body"><slot></slot></div>
|
|
2482
|
+
<div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
|
|
2483
|
+
</dialog>`}},Pr={neutral:"info",success:"check",warning:"warning",danger:"warning"},Ot=class extends c{static{this.properties={open:{type:Boolean,reflect:!0},message:{type:String},tone:{type:String,reflect:!0},duration:{type:Number},actionText:{type:String,attribute:"action-text"},closeLabel:{type:String,attribute:"close-label"}}}constructor(){super(),this.open=!1,this.message="",this.tone="neutral",this.duration=6,this.actionText="",this.closeLabel="Dismiss"}static{this.styles=[...c.styles,k,h`
|
|
2484
|
+
.region { position: fixed; inset-block-end: calc(${r(4)} + env(safe-area-inset-bottom, 0px) + var(--impkt-bottom-bar, 0px)); inset-inline-end: ${r(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${r(8)})); pointer-events: none; }
|
|
2485
|
+
@media (max-width: 40rem) { .region { inset-inline: ${r(3)}; inline-size: auto; inset-block-end: calc(${r(3)} + env(safe-area-inset-bottom, 0px) + var(--impkt-bottom-bar, 0px)); } }
|
|
2486
|
+
.toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${r(3)}; padding: ${r(3)} ${r(3)} ${r(3)} ${r(4)}; color: ${e.text}; background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowXl}, 0 0 0 1px color-mix(in srgb, ${e.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }
|
|
2487
|
+
@keyframes rise { from { opacity: 0; transform: translateY(${r(3)}); } }
|
|
2488
|
+
.mark { display: inline-flex; flex: none; margin-block-start: ${r(.5)}; color: ${e.info}; }
|
|
2489
|
+
:host([tone='success']) .mark { color: ${e.success}; }
|
|
2490
|
+
:host([tone='warning']) .mark { color: ${e.warning}; }
|
|
2491
|
+
:host([tone='danger']) .mark { color: ${e.danger}; }
|
|
2492
|
+
.message { flex: 1; align-self: center; margin: 0; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2493
|
+
.action, .close { ${A} padding: 0 ${r(2)}; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.link}; background: none; border: 0; border-radius: ${e.radius}; cursor: pointer; }
|
|
2494
|
+
.close { display: inline-flex; align-items: center; justify-content: center; color: ${e.textMuted}; }
|
|
2495
|
+
.action:hover, .close:hover { background: ${e.surfaceSubtle}; }
|
|
2496
|
+
`,R(".action, .close")]}disconnectedCallback(){super.disconnectedCallback(),this.stop()}updated(t){(t.has("open")||t.has("duration"))&&(this.stop(),this.open&&this.start())}start(){this.stop(),this.duration>0&&!this.actionText&&(this.timer=setTimeout(()=>this.close(),this.duration*1e3))}stop(){this.timer&&clearTimeout(this.timer),this.timer=void 0}close(){this.stop(),this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("impkt-close",{bubbles:!0,composed:!0})))}action(){this.dispatchEvent(new CustomEvent("impkt-action",{bubbles:!0,composed:!0})),this.close()}render(){return a`<div class="region" role="status" aria-live="polite">
|
|
2497
|
+
${this.open?a`<div class="toast" part="toast" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}
|
|
2498
|
+
@keydown=${t=>{t.key==="Escape"&&(t.preventDefault(),this.close())}}>
|
|
2499
|
+
<span class="mark">${S(Pr[this.tone]??"info","20px")}</span>
|
|
2500
|
+
<p class="message">${this.message}</p>
|
|
2501
|
+
${this.actionText?a`<button class="action" type="button" @click=${this.action}>${this.actionText}</button>`:l}
|
|
2502
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${S("close","16px")}</button>
|
|
2503
|
+
</div>`:l}
|
|
2504
|
+
</div>`}},jt=class extends c{constructor(){super();this.outside=i=>{i.composedPath().includes(this)||this.toggle(!1)};this.label="Menu",this.icon="",this.items=[],this.edge="start",this.open=!1}static{this.properties={label:{type:String},icon:{type:String},items:{type:Array},edge:{type:String,reflect:!0},open:{type:Boolean,reflect:!0}}}static{this.styles=[...c.styles,k,R(".trigger, .item"),h`
|
|
2505
|
+
:host { position: relative; display: inline-block; }
|
|
2506
|
+
.trigger { ${A} display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(2)} ${r(3.5)}; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; box-shadow: ${e.shadowXs}; cursor: pointer; }
|
|
2507
|
+
.trigger:hover { background: ${e.surfaceSubtle}; }
|
|
2508
|
+
.chev { display: inline-flex; color: ${e.textMuted}; transition: transform 120ms ease-in-out; }
|
|
2509
|
+
:host([open]) .chev { transform: rotate(180deg); }
|
|
2510
|
+
.list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${r(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); margin: 0; padding: ${r(1.5)}; list-style: none; background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowLg}, 0 0 0 1px color-mix(in srgb, ${e.text} 8%, transparent); animation: pop 120ms ease-out; }
|
|
2511
|
+
:host([edge='end']) .list, .list.flip-end { inset-inline: auto 0; }
|
|
2512
|
+
:host([edge='end']) .list.flip-start { inset-inline: 0 auto; }
|
|
2513
|
+
@keyframes pop { from { opacity: 0; transform: translateY(-${r(1)}); } }
|
|
2514
|
+
.item { ${A} box-sizing: border-box; display: flex; align-items: center; gap: ${r(2.5)}; inline-size: 100%; padding: ${r(2)} ${r(2.5)}; font: inherit; ${m("sm")} text-align: start; color: ${e.text}; text-decoration: none; background: none; border: 0; border-radius: ${e.radius}; cursor: pointer; }
|
|
2515
|
+
.item:hover, .item:focus { background: ${e.surfaceSubtle}; }
|
|
2516
|
+
.item.danger { color: ${e.dangerText}; }
|
|
2517
|
+
.item svg { flex: none; }
|
|
2518
|
+
`]}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.outside)}get entries(){return Array.from(this.renderRoot.querySelectorAll(".item"))}get trigger(){return this.renderRoot.querySelector(".trigger")}toggle(i,s){this.open=i,i?(document.addEventListener("click",this.outside),this.updateComplete.then(()=>{this.keepOnScreen(),this.entries[s==="last"?this.entries.length-1:0]?.focus()})):document.removeEventListener("click",this.outside)}keepOnScreen(){let i=this.renderRoot.querySelector(".list");if(!i)return;i.classList.remove("flip-start","flip-end");let s=i.getBoundingClientRect(),n=document.documentElement.clientWidth;s.right>n-8?i.classList.add("flip-end"):s.left<8&&i.classList.add("flip-start")}triggerKey(i){(i.key==="ArrowDown"||i.key==="ArrowUp")&&(i.preventDefault(),this.toggle(!0,i.key==="ArrowUp"?"last":"first"))}listKey(i){let s=this.entries,n=s.indexOf(this.renderRoot.activeElement),d={ArrowDown:(n+1)%s.length,ArrowUp:(n-1+s.length)%s.length,Home:0,End:s.length-1};if(i.key in d)i.preventDefault(),s[d[i.key]]?.focus();else if(i.key.length===1&&/\S/.test(i.key)&&!i.ctrlKey&&!i.metaKey&&!i.altKey){let p=i.key.toLowerCase();[...s.slice(n+1),...s.slice(0,n+1)].find(y=>(y.textContent??"").trim().toLowerCase().startsWith(p))?.focus()}else i.key==="Escape"?(i.preventDefault(),this.toggle(!1),this.trigger?.focus()):i.key==="Tab"&&this.toggle(!1)}choose(i){this.toggle(!1),this.trigger?.focus(),i.href||this.dispatchEvent(new CustomEvent("impkt-select",{detail:{value:i.value??i.text},bubbles:!0,composed:!0}))}render(){let i=s=>a`${S(s.icon,"18px")}<span>${s.text}</span>`;return a`<button class="trigger" part="trigger" type="button" aria-haspopup="menu" aria-expanded=${String(this.open)} aria-controls=${this.id_("list")}
|
|
2519
|
+
@click=${()=>this.toggle(!this.open)} @keydown=${this.triggerKey}>${S(this.icon,"18px")}${this.label}<span class="chev">${S("chevron-down","16px")}</span></button>
|
|
2520
|
+
${this.open?a`<ul class="list" part="list" id=${this.id_("list")} role="menu" aria-label=${this.label} @keydown=${this.listKey}>
|
|
2521
|
+
${this.items.map(s=>a`<li role="none">${s.href?a`<a class="item ${s.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" href=${s.href} @click=${()=>this.choose(s)}>${i(s)}</a>`:a`<button class="item ${s.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" type="button" @click=${()=>this.choose(s)}>${i(s)}</button>`}</li>`)}
|
|
2522
|
+
</ul>`:l}`}};function Or(o,t){let i=[...new Set([1,o-1,o,o+1,t])].filter(s=>s>=1&&s<=t).sort((s,n)=>s-n);return i.flatMap((s,n)=>{let d=i[n-1];return d===void 0||s===d+1?[s]:s===d+2?[d+1,s]:["gap",s]})}var Ft=class extends c{static{this.properties={page:{type:Number},pages:{type:Number},hrefPattern:{type:String,attribute:"href-pattern"},label:{type:String},previousText:{type:String,attribute:"previous-text"},nextText:{type:String,attribute:"next-text"}}}constructor(){super(),this.page=1,this.pages=1,this.hrefPattern="",this.label="Pages",this.previousText="Previous",this.nextText="Next"}static{this.styles=[...c.styles,k,R(".n, .step"),h`
|
|
2523
|
+
:host { display: block; container-type: inline-size; }
|
|
2524
|
+
nav { display: flex; align-items: center; justify-content: space-between; gap: ${r(2)}; }
|
|
2525
|
+
ul { display: flex; align-items: center; gap: ${r(1)}; margin: 0; padding: 0; list-style: none; }
|
|
2526
|
+
.n, .step { ${A} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${r(1.5)}; min-inline-size: 44px; padding: 0 ${r(2.5)}; font: inherit; ${m("sm")} font-weight: ${u("medium")}; color: ${e.text}; text-decoration: none; background: none; border: 0; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
2527
|
+
.n:hover, .step:hover { background: ${e.surfaceSubtle}; }
|
|
2528
|
+
.n[aria-current] { color: ${e.onBrand}; background: ${e.brand}; font-weight: ${u("semibold")}; }
|
|
2529
|
+
.step[aria-disabled='true'] { color: ${e.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }
|
|
2530
|
+
.gap { color: ${e.textMuted}; padding: 0 ${r(1)}; }
|
|
2531
|
+
.count { display: none; ${m("sm")} color: ${e.textMuted}; }
|
|
2532
|
+
@container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
|
|
2533
|
+
`]}go(t,i){this.hrefPattern||(i.preventDefault(),this.page=t,this.dispatchEvent(new CustomEvent("impkt-page",{detail:{page:t},bubbles:!0,composed:!0})))}link(t,i,s,n,d){return this.hrefPattern?a`<a class=${i} href=${this.hrefPattern.replace("{page}",String(t))} aria-label=${n} aria-current=${d?"page":l}>${s}</a>`:a`<button class=${i} type="button" aria-label=${n} aria-current=${d?"page":l} @click=${p=>this.go(t,p)}>${s}</button>`}step(t,i,s,n){let d=s==="arrow-left"?a`${S(s,"16px")}${i}`:a`${i}${S(s,"16px")}`;return n?a`<span class="step" aria-disabled="true">${d}</span>`:this.link(t,"step",d,i,!1)}render(){let t=Math.min(Math.max(this.page,1),Math.max(this.pages,1));return a`<nav aria-label=${this.label} part="nav">
|
|
2534
|
+
${this.step(t-1,this.previousText,"arrow-left",t<=1)}
|
|
2535
|
+
<ul>${Or(t,this.pages).map(i=>a`<li>${i==="gap"?a`<span class="gap" aria-hidden="true">…</span>`:this.link(i,"n",i,g("Page {page}",{page:i}),i===t)}</li>`)}</ul>
|
|
2536
|
+
<span class="count">${g("Page {page} of {pages}",{page:t,pages:this.pages})}</span>
|
|
2537
|
+
${this.step(t+1,this.nextText,"arrow-right",t>=this.pages)}
|
|
2538
|
+
</nav>`}},jr=o=>{let t=o.trim().split(/\s+/).filter(Boolean);return((t[0]?.[0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()},Dt=class extends c{constructor(){super();this.failed=!1;this.fullName="",this.src="",this.size="md"}static{this.properties={fullName:{type:String,attribute:"full-name"},src:{type:String},size:{type:String,reflect:!0}}}static{this.styles=[...c.styles,h`
|
|
2539
|
+
:host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
|
|
2540
|
+
:host([size='sm']) { --size: 32px; }
|
|
2541
|
+
:host([size='lg']) { --size: 56px; }
|
|
2542
|
+
:host([size='xl']) { --size: 80px; }
|
|
2543
|
+
.face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${e.brand}; background: ${e.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${u("semibold")}; }
|
|
2544
|
+
img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2545
|
+
`]}willUpdate(i){i.has("src")&&(this.failed=!1)}render(){return this.src&&!this.failed?a`<div class="face"><img src=${this.src} alt=${this.fullName} @error=${()=>{this.failed=!0,this.requestUpdate()}} /></div>`:a`<div class="face" role="img" aria-label=${this.fullName||g("Person")}>${jr(this.fullName)||S("user","55%")}</div>`}},qt=class extends c{static{this.properties={items:{type:Array},max:{type:Number},size:{type:String,reflect:!0},moreLabel:{type:String,attribute:"more-label"}}}constructor(){super(),this.items=[],this.max=4,this.size="md",this.moreLabel="more people"}static{this.styles=[...c.styles,h`
|
|
2546
|
+
ul { display: flex; margin: 0; padding: 0; list-style: none; }
|
|
2547
|
+
li { margin-inline-start: -${r(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${e.surfaceCard}; line-height: 0; }
|
|
2548
|
+
li:first-child { margin-inline-start: 0; }
|
|
2549
|
+
.more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${m("xs")} line-height: 1; font-weight: ${u("semibold")}; color: ${e.text}; background: ${e.surfaceSubtle}; border-radius: 50%; }
|
|
2550
|
+
:host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
|
|
2551
|
+
:host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
|
|
2552
|
+
.sr { ${E} }
|
|
2553
|
+
`]}render(){let t=this.items.slice(0,this.max),i=this.items.length-t.length;return a`<ul part="list">
|
|
2554
|
+
${t.map(s=>a`<li><impkt-avatar full-name=${s.name} src=${s.src??""} size=${this.size}></impkt-avatar></li>`)}
|
|
2555
|
+
${i>0?a`<li><span class="more"><span aria-hidden="true">+${i}</span><span class="sr">${i} ${this.moreLabel}</span></span></li>`:l}
|
|
2556
|
+
</ul>`}},Wt=class extends c{static{this.properties={icon:{type:String},heading:{type:String},lead:{type:String},framed:{type:Boolean,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.icon="search",this.heading="",this.lead="",this.framed=!1,this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2557
|
+
.wrap { display: flex; flex-direction: column; align-items: center; gap: ${r(2)}; padding: ${r(12)} ${r(6)}; text-align: center; }
|
|
2558
|
+
:host([framed]) .wrap { border: ${e.borderThin} dashed ${e.border}; border-radius: ${e.radiusXl}; }
|
|
2559
|
+
.mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${r(2)}; color: ${e.brand}; background: ${e.brandSubtle}; border-radius: 50%; }
|
|
2560
|
+
.h { margin: 0; font-family: ${e.fontHeading}; ${m("xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2561
|
+
p { margin: 0; max-inline-size: 42ch; color: ${e.textMuted}; text-wrap: pretty; }
|
|
2562
|
+
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${r(3)}; margin-block-start: ${r(3)}; }
|
|
2563
|
+
`]}render(){return a`<div class="wrap" part="wrap">
|
|
2564
|
+
<span class="mark">${S(this.icon,"26px")}</span>
|
|
2565
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2566
|
+
${this.lead?a`<p>${this.lead}</p>`:l}
|
|
2567
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
2568
|
+
</div>`}},Fr=o=>String(o?.times??"").split(",").map(t=>t.trim()).filter(Boolean);function Dr(o){let t=new Date(`${o}T00:00:00Z`);if(Number.isNaN(t.getTime()))return{weekday:"",day:o,month:""};let i=B(),s=n=>new Intl.DateTimeFormat(i,{timeZone:"UTC",...n}).format(t);return{weekday:s({weekday:"short"}),day:s({day:"numeric"}),month:s({month:"short"})}}var Ut=class extends T{constructor(){super();this.day="";this.days=[],this.dayLabel="Day",this.timeLabel="Time",this.emptyText="No times are available at the moment."}static{this.properties={...T.properties,days:{type:Array},dayLabel:{type:String,attribute:"day-label"},timeLabel:{type:String,attribute:"time-label"},emptyText:{type:String,attribute:"empty-text"}}}static{this.styles=[...T.styles,h`
|
|
2569
|
+
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
2570
|
+
legend { padding: 0; }
|
|
2571
|
+
.row-label { ${m("sm")} color: ${e.textMuted}; margin-block: ${r(2)}; }
|
|
2572
|
+
.days { display: flex; gap: ${r(2)}; overflow-x: auto; padding: ${r(1)}; margin: -${r(1)}; scrollbar-width: thin; }
|
|
2573
|
+
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${r(2)}; }
|
|
2574
|
+
label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${e.text}; background: ${e.surfaceCard}; border-radius: ${e.radiusLg}; box-shadow: inset 0 0 0 1px ${e.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }
|
|
2575
|
+
label:hover { background: ${e.surfaceSubtle}; }
|
|
2576
|
+
label:has(input:checked) { color: ${e.onBrand}; background: ${e.brand}; box-shadow: none; }
|
|
2577
|
+
label:has(input:focus-visible) { box-shadow: ${e.focusShadow}; }
|
|
2578
|
+
input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
2579
|
+
.day { flex: none; inline-size: 4.5rem; padding-block: ${r(2.5)}; }
|
|
2580
|
+
.weekday, .month { ${m("xs")} }
|
|
2581
|
+
.num { ${m("xl")} font-weight: ${u("semibold")}; }
|
|
2582
|
+
.time { padding: ${r(2)}; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2583
|
+
.empty { margin: 0; color: ${e.textMuted}; }
|
|
2584
|
+
:host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${e.danger}; }
|
|
2585
|
+
`]}get currentDay(){let i=this.day||this.value.split("T")[0];return this.days.find(s=>s.date===i)??this.days[0]}chooseDay(i){this.day=i,this.value&&!this.value.startsWith(`${i}T`)&&this.setFormValue(""),this.requestUpdate()}renderLabel(){return a`<legend class="label" part="label">${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}</legend>`}renderControl(){let i=this.currentDay;return i?a`
|
|
2586
|
+
<div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
|
|
2587
|
+
<div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
|
|
2588
|
+
${this.days.map(s=>{let n=Dr(s.date);return a`<label class="day"><input type="radio" name=${`${this.uid}-day`} .checked=${s.date===i.date} ?disabled=${this.disabled} @change=${()=>this.chooseDay(s.date)} />
|
|
2589
|
+
<span class="weekday">${n.weekday}</span><span class="num">${n.day}</span><span class="month">${n.month}</span></label>`})}
|
|
2590
|
+
</div>
|
|
2591
|
+
<div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
|
|
2592
|
+
<div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
|
|
2593
|
+
${Fr(i).map((s,n)=>{let d=`${i.date}T${s}`;return a`<label class="time"><input type="radio" name=${`${this.uid}-time`} .checked=${this.value===d} ?required=${this.required&&n===0} ?disabled=${this.disabled} @change=${()=>this.setFormValue(d)} />${s}</label>`})}
|
|
2594
|
+
</div>`:a`<p class="empty">${this.emptyText}</p>`}render(){return a`<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
2595
|
+
${this.renderLabel()}
|
|
2596
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
2597
|
+
${this.renderControl()}
|
|
2598
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
2599
|
+
</fieldset>`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impkt-drawer",Pt);customElements.define("impkt-toast",Ot);customElements.define("impkt-menu",jt);customElements.define("impkt-pagination",Ft);customElements.define("impkt-avatar",Dt);customElements.define("impkt-avatar-group",qt);customElements.define("impkt-empty-state",Wt);customElements.define("impkt-slot-picker",Ut);var qr=f("color.accent.default","#c8a15a"),ar=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,or=h`
|
|
2600
|
+
.round { ${A} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.rule}; border-radius: 50%; box-shadow: ${e.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
|
|
2601
|
+
.round:hover:not(:disabled) { box-shadow: ${e.shadowMd}; }
|
|
2602
|
+
.round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
|
2603
|
+
`,ei=h`
|
|
2604
|
+
.eyebrow { margin: 0; color: var(--impkt-eyebrow, var(--impkt-color-text-eyebrow, ${e.brand})); ${m("sm")} font-size: var(--impkt-font-size-eyebrow, var(--impkt-font-size-sm, 0.875rem)); font-family: ${e.fontEyebrow}; font-weight: var(--impkt-font-weight-eyebrow, ${u("semibold")}); letter-spacing: ${e.trackingWide}; text-transform: uppercase; }
|
|
2605
|
+
.h { margin: 0; color: ${e.textHeading}; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; letter-spacing: ${e.trackingTight}; text-wrap: balance; }
|
|
2606
|
+
.lead { margin: 0; color: ${e.textMuted}; text-wrap: pretty; }
|
|
2607
|
+
`,Vt=class extends c{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=[...c.styles,k,w,or,h`
|
|
2608
|
+
:host { display: block; container-type: inline-size; --most: 1; --gap: ${r(6)}; }
|
|
2609
|
+
:host([per-view='2']) { --most: 2; }
|
|
2610
|
+
:host([per-view='3']) { --most: 3; }
|
|
2611
|
+
.track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${r(1)} ${r(2)}; border-radius: ${e.radiusLg}; }
|
|
2612
|
+
.track::-webkit-scrollbar { display: none; }
|
|
2613
|
+
::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; }
|
|
2614
|
+
/* Whole slides only: a slice of the next one reads as content spilling out of the page. */
|
|
2615
|
+
@container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }
|
|
2616
|
+
@container (max-width: 40rem) { .track { --per: 1; --gap: ${r(4)}; } }
|
|
2617
|
+
.controls { display: flex; align-items: center; justify-content: space-between; gap: ${r(4)}; margin-block-start: ${r(4)}; }
|
|
2618
|
+
.dots { display: flex; flex-wrap: wrap; gap: ${r(1)}; }
|
|
2619
|
+
.dot { ${A} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${e.radiusSm}; }
|
|
2620
|
+
.dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${e.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }
|
|
2621
|
+
.dot[aria-current='true'] span { inline-size: 24px; background: ${e.brand}; }
|
|
2622
|
+
.buttons { display: flex; gap: ${r(2)}; }
|
|
2623
|
+
section { position: relative; }
|
|
2624
|
+
@container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${r(4)}); inset-inline-end: 0; } }
|
|
2625
|
+
.sr-only { ${E} }
|
|
2626
|
+
@media (forced-colors: active) { .dot span { background: CanvasText; } .dot[aria-current='true'] span { background: Highlight; } }
|
|
2627
|
+
`]}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 i=this.track,s=this.slides[0];if(!i||!s)return;let n=s.getBoundingClientRect().width;if(n<=0)return;let d=Number.parseFloat(getComputedStyle(i).columnGap)||0,p=Math.max(1,Math.round((i.clientWidth+d)/(n+d)));if(p===this.visible)return;this.visible=p,this.index=Math.min(this.index,this.last);let b=this.slides[this.index];b&&typeof i.scrollTo=="function"&&i.scrollTo({left:b.offsetLeft-i.offsetLeft,behavior:"auto"}),this.requestUpdate()}onSlots(){let i=this.slides;this.count=i.length,i.forEach((s,n)=>{s.setAttribute("role","group"),s.setAttribute("aria-roledescription",g("slide")),s.setAttribute("aria-label",g("{slide} of {slides}",{slide:n+1,slides:i.length}))}),this.measure(),this.requestUpdate()}go(i){let s=Math.min(this.last,Math.max(0,i));this.index=s,this.heading=s,clearTimeout(this.settle),this.settle=setTimeout(()=>{let p=this.heading===null;this.heading=null;let b=this.track,y=this.slides[this.index];!p&&b&&y&&typeof b.scrollTo=="function"&&b.scrollTo({left:y.offsetLeft-b.offsetLeft,behavior:"auto"})},900),this.requestUpdate();let n=this.track,d=this.slides[s];n&&d&&typeof n.scrollTo=="function"&&n.scrollTo({left:d.offsetLeft-n.offsetLeft,behavior:ar()?"auto":"smooth"})}onScroll(){let i=this.track,s=this.slides;if(!i||!s.length)return;let n=0,d=1/0;if(s.forEach((p,b)=>{let y=Math.abs(p.offsetLeft-i.offsetLeft-i.scrollLeft);y<d&&(d=y,n=b)}),this.heading!==null){n===this.heading&&d<2&&(this.heading=null,clearTimeout(this.settle));return}n!==this.index&&(this.index=Math.min(n,this.last),this.requestUpdate())}onKey(i){i.key==="ArrowRight"&&(i.preventDefault(),this.go(this.index+1)),i.key==="ArrowLeft"&&(i.preventDefault(),this.go(this.index-1))}get canPlay(){return this.autoplay&&!ar()}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(i){this.held=i,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(i){(i.has("autoplay")||i.has("seconds"))&&this.restart(),i.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 i=Array.from({length:this.last+1},(s,n)=>n);return a`<section aria-roledescription=${g("carousel")} aria-label=${this.label} part="carousel" @keydown=${this.onKey}
|
|
2628
|
+
@mouseenter=${()=>this.hold(!0)} @mouseleave=${()=>this.hold(!1)} @focusin=${()=>this.hold(!0)} @focusout=${()=>this.hold(!1)}>
|
|
2629
|
+
<div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
|
|
2630
|
+
<div class="controls" part="controls">
|
|
2631
|
+
<div class="dots">${i.length>1?i.map(s=>a`<button class="dot" type="button" aria-label=${g("Go to slide {slide}",{slide:s+1})} aria-current=${s===this.index?"true":"false"} @click=${()=>this.go(s)}><span></span></button>`):l}</div>
|
|
2632
|
+
<div class="buttons">
|
|
2633
|
+
${this.canPlay?a`<button class="round" type="button" aria-label=${g(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?S("arrow-right","18px"):a`<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>`:l}
|
|
2634
|
+
<button class="round" type="button" aria-label=${g("Previous slide")} ?disabled=${this.index===0} @click=${()=>this.go(this.index-1)}>${S("arrow-left","18px")}</button>
|
|
2635
|
+
<button class="round" type="button" aria-label=${g("Next slide")} ?disabled=${this.index>=this.last} @click=${()=>this.go(this.index+1)}>${S("arrow-right","18px")}</button>
|
|
2636
|
+
</div>
|
|
2637
|
+
</div>
|
|
2638
|
+
<p class="sr-only" aria-live="polite">${g("Slide {slide} of {slides}",{slide:this.index+1,slides:this.count})}</p>
|
|
2639
|
+
</section>`}};function Wr(o,t,i){let s=o===t-1,n={wide:1,narrow:1,rows:1};if(i==="grid")return s&&(n.wide=t%3?4-t%3:1,n.narrow=t%2?2:1),n;if(o===0)return n;if(t===2)return{wide:2,narrow:2,rows:2};if(t===3)return{...n,wide:2};if(s){let d=(t-5)%4;n.wide=t===4?2:t>5&&d?5-d:1,n.narrow=t%2?1:2}return n}var Kt=class extends c{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=[...c.styles,k,w,or,h`
|
|
2640
|
+
:host { display: block; container-type: inline-size; }
|
|
2641
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
|
|
2642
|
+
:host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
|
|
2643
|
+
li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }
|
|
2644
|
+
:host([layout='feature']) li:first-child { grid-column: span 2; grid-row: span 2; }
|
|
2645
|
+
.open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${e.surfaceInset}; border-radius: ${e.radiusXl}; overflow: hidden; cursor: zoom-in; }
|
|
2646
|
+
.open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }
|
|
2647
|
+
.open:hover img { transform: scale(1.03); }
|
|
2648
|
+
@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); } }
|
|
2649
|
+
dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }
|
|
2650
|
+
dialog::backdrop { background: rgb(10 14 12 / 0.9); }
|
|
2651
|
+
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${r(4)}; gap: ${r(3)}; color: #fff; }
|
|
2652
|
+
.bar { display: flex; align-items: center; justify-content: space-between; ${m("sm")} }
|
|
2653
|
+
.middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${r(3)}; min-block-size: 0; }
|
|
2654
|
+
.middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${e.radiusLg}; }
|
|
2655
|
+
figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }
|
|
2656
|
+
.caption { margin: 0; text-align: center; ${m("sm")} }
|
|
2657
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}open(i,s){this.opener=s.currentTarget,this.shown=i,this.requestUpdate(),this.updateComplete.then(()=>{let n=this.dialog;n&&!n.open&&(typeof n.showModal=="function"?n.showModal():n.setAttribute("open",""))})}close(){let i=this.dialog;i?.open&&(typeof i.close=="function"?i.close():i.removeAttribute("open")),this.onClosed()}onClosed(){this.shown!==-1&&(this.shown=-1,this.requestUpdate(),this.opener?.focus())}step(i){let s=(this.items??[]).length;!s||this.shown<0||(this.shown=(this.shown+i+s)%s,this.requestUpdate())}onKey(i){i.key==="ArrowRight"&&(i.preventDefault(),this.step(1)),i.key==="ArrowLeft"&&(i.preventDefault(),this.step(-1))}render(){let i=this.items??[],s=this.shown>=0?i[this.shown]:void 0;return a`<ul aria-label=${this.label} part="list">${i.map((n,d)=>{let p=Wr(d,i.length,this.layout);return a`<li style=${`--span-wide:${p.wide};--span-narrow:${p.narrow};--span-rows:${p.rows}`}>
|
|
2658
|
+
<button class="open" type="button" aria-label=${g("View larger: {picture}",{picture:n.alt})} @click=${b=>this.open(d,b)}><img src=${n.src} alt=${n.alt} loading="lazy" /></button>
|
|
2659
|
+
</li>`})}</ul>
|
|
2660
|
+
<dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>
|
|
2661
|
+
${s?a`<div class="stage">
|
|
2662
|
+
<div class="bar"><span>${this.shown+1} of ${i.length}</span><button class="round" type="button" aria-label=${g("Close")} @click=${this.close}>${S("close","18px")}</button></div>
|
|
2663
|
+
<div class="middle">
|
|
2664
|
+
<button class="round" type="button" aria-label=${g("Previous picture")} @click=${()=>this.step(-1)}>${S("arrow-left","18px")}</button>
|
|
2665
|
+
<figure><img src=${s.src} alt=${s.alt} /></figure>
|
|
2666
|
+
<button class="round" type="button" aria-label=${g("Next picture")} @click=${()=>this.step(1)}>${S("arrow-right","18px")}</button>
|
|
2667
|
+
</div>
|
|
2668
|
+
<p class="caption">${s.caption??s.alt}</p>
|
|
2669
|
+
</div>`:l}
|
|
2670
|
+
</dialog>`}},Xt=class extends c{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=[...c.styles,k,w,h`
|
|
2671
|
+
:host { display: block; }
|
|
2672
|
+
p { margin: 0 0 ${r(6)}; text-align: center; color: ${e.textMuted}; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2673
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${r(8)} ${r(12)}; }
|
|
2674
|
+
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; }
|
|
2675
|
+
li:hover img { filter: none; opacity: 1; }
|
|
2676
|
+
a { display: block; border-radius: ${e.radiusSm}; }
|
|
2677
|
+
`]}render(){return a`${this.heading?a`<p part="heading">${this.heading}</p>`:l}
|
|
2678
|
+
<ul part="list">${(this.items??[]).map(t=>a`<li>${t.href?a`<a href=${t.href}><img src=${t.src} alt=${t.alt} /></a>`:a`<img src=${t.src} alt=${t.alt} />`}</li>`)}</ul>`}},Gt=class extends c{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=[...c.styles,w,ei,h`
|
|
2679
|
+
:host { display: block; container-type: inline-size; }
|
|
2680
|
+
ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${r(6)}; }
|
|
2681
|
+
li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2682
|
+
li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${e.brand}; color: ${e.onBrand}; ${m("sm")} font-weight: ${u("bold")}; position: relative; z-index: 1; margin-block-end: ${r(2)}; }
|
|
2683
|
+
li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${r(6)} + 8px); block-size: 2px; background: ${e.rule}; }
|
|
2684
|
+
.h { ${m("lg")} letter-spacing: 0; }
|
|
2685
|
+
.meta { margin: 0; ${m("sm")} color: ${e.textMuted}; font-family: ${e.fontMono}; letter-spacing: 0.02em; }
|
|
2686
|
+
.body { margin: 0; color: ${e.textMuted}; line-height: ${C("normal")}; text-wrap: pretty; }
|
|
2687
|
+
:host([orientation='vertical']) ol { grid-auto-flow: row; }
|
|
2688
|
+
:host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
2689
|
+
:host([orientation='vertical']) li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
2690
|
+
:host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${r(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
2691
|
+
@container (max-width: 40rem) {
|
|
2692
|
+
ol { grid-auto-flow: row; }
|
|
2693
|
+
li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
2694
|
+
li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
2695
|
+
li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${r(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
2696
|
+
}
|
|
2697
|
+
:host([look='ruled']) li { padding-block-start: ${r(5)}; border-block-start: 3px solid var(--rule); }
|
|
2698
|
+
:host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }
|
|
2699
|
+
:host([look='ruled']) ol { gap: ${r(5)}; }
|
|
2700
|
+
/* 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. */
|
|
2701
|
+
@container (max-width: 40rem) {
|
|
2702
|
+
:host([look='ruled']) ol { gap: 0; }
|
|
2703
|
+
:host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${r(6)}; min-block-size: 0; border-block-start: 0; }
|
|
2704
|
+
: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: ${e.text}; }
|
|
2705
|
+
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${r(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; }
|
|
2706
|
+
}
|
|
2707
|
+
@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; } }
|
|
2708
|
+
`]}render(){return a`<ol part="list">${(this.items??[]).map((t,i)=>a`<li part="step" style=${this.look==="ruled"?`--rule:var(--impkt-color-chart-${i%5+1}, var(--impkt-color-brand-default, #1f4ed8))`:l}>
|
|
2709
|
+
${t.meta?a`<p class="meta">${t.meta}</p>`:l}
|
|
2710
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.heading}</div>
|
|
2711
|
+
${t.text?a`<p class="body">${t.text}</p>`:l}
|
|
2712
|
+
</li>`)}</ol>`}},Yt=class extends c{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=[...c.styles,w,ei,h`
|
|
2713
|
+
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
2714
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
2715
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
2716
|
+
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
2717
|
+
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(16)}; align-items: center; }
|
|
2718
|
+
:host([image-side='start']) .picture { order: -1; }
|
|
2719
|
+
.words { display: flex; flex-direction: column; gap: ${r(4)}; }
|
|
2720
|
+
.h { ${m("4xl")} }
|
|
2721
|
+
.lead { ${m("lg")} }
|
|
2722
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${r(3)}; }
|
|
2723
|
+
li { display: flex; gap: ${r(3)}; align-items: flex-start; line-height: ${C("normal")}; }
|
|
2724
|
+
.tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${e.brandSubtle}; color: ${e.brand}; }
|
|
2725
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${r(3)} ${r(4)}; align-items: center; margin-block-start: ${r(2)}; }
|
|
2726
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowXl}; }
|
|
2727
|
+
.picture { position: relative; }
|
|
2728
|
+
.picture.has-inset { padding-block-end: 8%; padding-inline-end: 4%; }
|
|
2729
|
+
.inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-sizing: border-box; }
|
|
2730
|
+
@container (max-width: 48rem) {
|
|
2731
|
+
.split { grid-template-columns: minmax(0, 1fr); gap: ${r(8)}; }
|
|
2732
|
+
:host([image-side='start']) .picture { order: 0; }
|
|
2733
|
+
.h { ${m("3xl")} }
|
|
2734
|
+
}
|
|
2735
|
+
`]}render(){return a`<div class="split" part="split">
|
|
2736
|
+
<div class="words">
|
|
2737
|
+
${this.eyebrow?a`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:l}
|
|
2738
|
+
<div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
|
|
2739
|
+
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2740
|
+
${this.points?.length?a`<ul>${this.points.map(t=>a`<li><span class="tick">${S("check","14px")}</span><span>${t}</span></li>`)}</ul>`:l}
|
|
2741
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
2742
|
+
</div>
|
|
2743
|
+
${this.imageSrc?a`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?a`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:l}</div>`:l}
|
|
2744
|
+
</div>`}},Qt=class extends c{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=[...c.styles,w,ei,h`
|
|
2745
|
+
:host { display: block; container-type: inline-size; }
|
|
2746
|
+
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${r(8)}; padding: ${r(16)}; border-radius: ${e.radius2xl}; background: ${e.surfaceCard}; box-shadow: ${e.shadowSm}, inset 0 0 0 1px ${e.hairline}; }
|
|
2747
|
+
:host([tone='subtle']) .panel { background: ${e.surfaceSubtle}; box-shadow: none; }
|
|
2748
|
+
:host([tone='brand']) .panel { background: ${e.brand}; color: ${e.onBrand}; box-shadow: ${e.shadowLg}; }
|
|
2749
|
+
/* Only the words take the light colours: a button in the actions keeps its own. */
|
|
2750
|
+
:host([tone='brand']) .words { --impkt-color-text-heading: ${e.onBrand}; --impkt-color-text-default: ${e.onBrand}; --impkt-color-text-muted: ${e.onBrand}; --impkt-color-text-link: ${e.onBrand}; }
|
|
2751
|
+
/* A soft glow in the corner, so a flat colour has some depth. Decoration only. */
|
|
2752
|
+
: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, ${e.onBrand} 18%, transparent), transparent); pointer-events: none; }
|
|
2753
|
+
.photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2754
|
+
.panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impkt-color-text-heading: #fff; }
|
|
2755
|
+
.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%); }
|
|
2756
|
+
.panel.pictured .words, .panel.pictured .actions { z-index: 1; }
|
|
2757
|
+
@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%); } }
|
|
2758
|
+
.words { position: relative; display: flex; flex-direction: column; gap: ${r(3)}; max-inline-size: 40rem; }
|
|
2759
|
+
.h { ${m("4xl")} }
|
|
2760
|
+
.lead { ${m("lg")} }
|
|
2761
|
+
.actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${r(3)}; }
|
|
2762
|
+
:host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }
|
|
2763
|
+
:host([align='center']) .panel { flex-direction: column; text-align: center; }
|
|
2764
|
+
:host([align='center']) .words { align-items: center; }
|
|
2765
|
+
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${r(8)} ${r(6)}; } .h { ${m("3xl")} } :host([align='center']) .panel { align-items: center; } }
|
|
2766
|
+
@media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
|
|
2767
|
+
`]}render(){return a`<div class="panel ${this.imageSrc?"pictured":""}" part="panel">
|
|
2768
|
+
${this.imageSrc?a`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:l}
|
|
2769
|
+
<div class="words">
|
|
2770
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
|
|
2771
|
+
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2772
|
+
</div>
|
|
2773
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
2774
|
+
</div>`}},nr=o=>a`<span class="stars" role="img" aria-label=${g("Rated {rating} out of 5",{rating:o})}>${[1,2,3,4,5].map(t=>a`<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>`,Ur=o=>o.split(/\s+/).filter(t=>/^[A-Za-z]/.test(t)&&t.toLowerCase()!=="and").slice(0,2).map(t=>t[0].toUpperCase()).join(""),Zt=class extends c{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=[...c.styles,w,h`
|
|
2775
|
+
:host { display: block; container-type: inline-size; }
|
|
2776
|
+
.top { display: flex; align-items: center; gap: ${r(3)}; margin-block-end: ${r(6)}; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2777
|
+
.stars { display: inline-flex; gap: 2px; color: ${qr}; }
|
|
2778
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2779
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2780
|
+
li { display: flex; flex-direction: column; gap: ${r(4)}; padding: ${r(6)}; background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}, inset 0 0 0 1px ${e.hairline}; }
|
|
2781
|
+
blockquote { margin: 0; flex: 1; ${m("md")} text-wrap: pretty; }
|
|
2782
|
+
.who { display: flex; align-items: center; gap: ${r(3)}; }
|
|
2783
|
+
.face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${e.brandSubtle}; color: ${e.brand}; ${m("sm")} font-weight: ${u("bold")}; }
|
|
2784
|
+
.face img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2785
|
+
.name { font-weight: ${u("semibold")}; ${m("sm")} }
|
|
2786
|
+
.about { color: ${e.textMuted}; ${m("sm")} }
|
|
2787
|
+
@container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2788
|
+
`]}render(){return a`${this.summary||this.rating?a`<p class="top" part="summary" style="margin-block-start:0">${this.rating?nr(Math.round(this.rating)):l}<span>${this.summary}</span></p>`:l}
|
|
2789
|
+
<ul part="list">${(this.items??[]).map(t=>a`<li part="review">
|
|
2790
|
+
${t.rating?nr(t.rating):l}
|
|
2791
|
+
<blockquote>${t.quote}</blockquote>
|
|
2792
|
+
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?a`<img src=${t.avatarSrc} alt="" />`:Ur(t.person)}</span><span><span class="name">${t.person}</span>${t.about?a`<br /><span class="about">${t.about}</span>`:l}</span></div>
|
|
2793
|
+
</li>`)}</ul>`}},Jt=class extends c{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=[...c.styles,k,w,ei,h`
|
|
2794
|
+
:host { display: block; container-type: inline-size; }
|
|
2795
|
+
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(8)}; align-items: center; }
|
|
2796
|
+
.words { display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2797
|
+
.h { ${m("2xl")} }
|
|
2798
|
+
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${r(1)} ${r(3)}; }
|
|
2799
|
+
label { grid-column: 1 / -1; ${m("sm")} font-weight: ${u("semibold")}; }
|
|
2800
|
+
input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${r(2.5)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; box-shadow: ${e.shadowXs}; }
|
|
2801
|
+
button { ${A} min-block-size: 44px; padding: ${r(2)} ${r(5)}; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; box-shadow: ${e.shadowXs}; cursor: pointer; }
|
|
2802
|
+
button:hover { background: ${e.brandHover}; }
|
|
2803
|
+
.note { grid-column: 1 / -1; margin: ${r(1)} 0 0; color: ${e.textMuted}; ${m("sm")} }
|
|
2804
|
+
.done { margin: 0; ${m("md")} font-weight: ${u("semibold")}; }
|
|
2805
|
+
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
2806
|
+
`]}submit(i){i.preventDefault();let s=i.currentTarget;if(typeof s.reportValidity=="function"&&!s.reportValidity())return;let n=s.querySelector("input").value.trim();this.dispatchEvent(new CustomEvent("impkt-submit",{detail:{email:n},bubbles:!0,composed:!0})),this.done=!0,this.requestUpdate()}render(){let i=this.id_("email");return a`<div class="wrap" part="wrap">
|
|
2807
|
+
<div class="words">
|
|
2808
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2809
|
+
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2810
|
+
</div>
|
|
2811
|
+
<div aria-live="polite">${this.done?a`<p class="done">${this.doneText}</p>`:a`<form @submit=${this.submit}>
|
|
2812
|
+
<label for=${i}>${this.label}</label>
|
|
2813
|
+
<input id=${i} type="email" name="email" autocomplete="email" required />
|
|
2814
|
+
<button type="submit">${this.buttonText}</button>
|
|
2815
|
+
${this.smallPrint?a`<p class="note">${this.smallPrint}</p>`:l}
|
|
2816
|
+
</form>`}</div>
|
|
2817
|
+
</div>`}};customElements.define("impkt-carousel",Vt);customElements.define("impkt-gallery",Kt);customElements.define("impkt-logo-cloud",Xt);customElements.define("impkt-steps",Gt);customElements.define("impkt-media-split",Yt);customElements.define("impkt-cta-banner",Qt);customElements.define("impkt-reviews",Zt);customElements.define("impkt-newsletter",Jt);var Ci=h`
|
|
2818
|
+
input, select {
|
|
2819
|
+
box-sizing: border-box;
|
|
2820
|
+
inline-size: min(100%, var(--impkt-field-width));
|
|
2821
|
+
min-block-size: 44px;
|
|
2822
|
+
padding: ${r(2.5)} ${r(3)};
|
|
2823
|
+
font: inherit;
|
|
2824
|
+
/* 16px whatever the page around it sets, so a phone does not zoom in on focus. */
|
|
2825
|
+
font-size: max(${$("md")}, 16px);
|
|
2826
|
+
color: ${e.text};
|
|
2827
|
+
background: ${e.surfaceCard};
|
|
2828
|
+
border: ${e.borderThin} solid ${e.border};
|
|
2829
|
+
border-radius: ${e.radiusLg};
|
|
2830
|
+
}
|
|
2831
|
+
input:focus-visible, select:focus-visible { border-color: ${e.brand}; box-shadow: ${e.focusShadow}, 0 0 0 6px ${e.brandHalo}; outline: none; }
|
|
2832
|
+
:host([invalid]) input, :host([invalid]) select { border-color: ${e.danger}; border-width: ${e.borderThick}; }
|
|
2833
|
+
.btn {
|
|
2834
|
+
min-block-size: 44px;
|
|
2835
|
+
padding: ${r(2.5)} ${r(4)};
|
|
2836
|
+
font: inherit;
|
|
2837
|
+
font-weight: ${u("semibold")};
|
|
2838
|
+
color: ${e.onBrand};
|
|
2839
|
+
background: ${e.brand};
|
|
2840
|
+
border: 0;
|
|
2841
|
+
border-radius: ${e.radiusLg};
|
|
2842
|
+
cursor: pointer;
|
|
2843
|
+
}
|
|
2844
|
+
.btn:hover { background: ${e.brandHover}; }
|
|
2845
|
+
.quiet { display: inline-flex; align-items: center; min-block-size: ${e.targetMin}; padding: 0; font: inherit; color: ${e.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }
|
|
2846
|
+
.visually-hidden { ${E} }
|
|
2847
|
+
`,W=class extends T{static{this.properties={...T.properties,postcodeLabel:{type:String,attribute:"postcode-label"},findText:{type:String,attribute:"find-text"},chooseLabel:{type:String,attribute:"choose-label"},manualText:{type:String,attribute:"manual-text"},notFoundText:{type:String,attribute:"not-found-text"},lookupUrl:{type:String,attribute:"lookup-url"},addresses:{type:Array}}}constructor(){super(),this.label="Your address",this.postcodeLabel="Postcode",this.findText="Find address",this.chooseLabel="Choose your address",this.manualText="Enter the address yourself",this.notFoundText="No addresses found for that postcode. Check it, or enter the address yourself.",this.lookupUrl="",this.addresses=[],this.manual=!1,this.postcode="",this.searched=!1,this.busy=!1}static{this.styles=[...T.styles,F,Ci,h`
|
|
2848
|
+
.row { display: flex; flex-wrap: wrap; gap: ${r(2)}; align-items: flex-end; }
|
|
2849
|
+
.row label { display: block; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1)}; }
|
|
2850
|
+
.postcode input { inline-size: 12ch; text-transform: uppercase; }
|
|
2851
|
+
.choose { margin-block-start: ${r(4)}; }
|
|
2852
|
+
.choose select { inline-size: 100%; }
|
|
2853
|
+
.manual { display: grid; gap: ${r(3)}; margin-block-start: ${r(3)}; }
|
|
2854
|
+
.manual label { display: block; ${m("sm")} margin-block-end: ${r(1)}; }
|
|
2855
|
+
.manual input { inline-size: 100%; }
|
|
2856
|
+
.note { ${m("sm")} color: ${e.textMuted}; margin: ${r(2)} 0 0; }
|
|
2857
|
+
.switch { margin-block-start: ${r(3)}; }
|
|
2858
|
+
`]}async find(){let t=this.postcode.trim().toUpperCase();if(t){if(this.dispatchEvent(new CustomEvent("impkt-lookup",{detail:{postcode:t},bubbles:!0,composed:!0})),!this.lookupUrl){this.searched=!0;return}this.busy=!0;try{let i=new URL(this.lookupUrl,globalThis.location?.href);i.searchParams.set("postcode",t);let s=await(await fetch(i)).json();this.addresses=Array.isArray(s)?s:[]}catch{this.addresses=[]}finally{this.busy=!1,this.searched=!0}}}manualLine(){return["line1","line2","town","mpostcode"].map(i=>(this.renderRoot.querySelector(`#${this.id_(i)}`)?.value??"").trim()).filter(Boolean).join(", ")}renderControl(){if(this.manual){let t=(i,s,n)=>a`<div><label for=${this.id_(i)}>${s}</label><input id=${this.id_(i)} autocomplete=${n} @input=${()=>this.setFormValue(this.manualLine())} /></div>`;return a`<div class="manual" role="group" aria-label=${this.label}>
|
|
2859
|
+
${t("line1",g("Building and street"),"address-line1")}
|
|
2860
|
+
${t("line2",g("Second line (optional)"),"address-line2")}
|
|
2861
|
+
${t("town",g("Town or city"),"address-level2")}
|
|
2862
|
+
${t("mpostcode",g("Postcode"),"postal-code")}
|
|
2863
|
+
<button class="quiet switch" type="button" @click=${()=>{this.manual=!1}}>${g("Find the address from the postcode")}</button>
|
|
2864
|
+
</div>`}return a`
|
|
2865
|
+
<div class="row">
|
|
2866
|
+
<div class="postcode"><label for=${this.controlId}>${this.postcodeLabel}</label>
|
|
2867
|
+
<input id=${this.controlId} autocomplete="postal-code" .value=${this.postcode} aria-describedby=${this.describedBy}
|
|
2868
|
+
@input=${t=>{this.postcode=t.target.value}}
|
|
2869
|
+
@keydown=${t=>{t.key==="Enter"&&(t.preventDefault(),this.find())}} /></div>
|
|
2870
|
+
<button class="btn" type="button" ?disabled=${this.busy} @click=${()=>this.find()}>${this.busy?"Finding\u2026":this.findText}</button>
|
|
2871
|
+
</div>
|
|
2872
|
+
${this.addresses.length?a`<div class="choose"><label class="label" for=${this.id_("choose")}>${this.chooseLabel}</label>
|
|
2873
|
+
<select id=${this.id_("choose")} @change=${t=>this.setFormValue(t.target.value)}>
|
|
2874
|
+
<option value="">${this.addresses.length} ${this.addresses.length===1?"address":"addresses"} found</option>
|
|
2875
|
+
${this.addresses.map(t=>a`<option value=${t.line} ?selected=${t.line===this.value}>${t.line}</option>`)}
|
|
2876
|
+
</select></div>`:this.searched&&!this.busy?a`<p class="note" role="status">${this.notFoundText}</p>`:l}
|
|
2877
|
+
<button class="quiet switch" type="button" @click=${()=>{this.manual=!0}}>${this.manualText}</button>
|
|
2878
|
+
`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}},ti=class extends c{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="There is a problem",this.items=[],this.spaceAbove="none",this.spaceBelow="md"}static{this.styles=[...c.styles,k,w,R("a"),h`
|
|
2879
|
+
:host { display: block; }
|
|
2880
|
+
.box { padding: ${r(5)}; border: ${e.borderThick} solid ${e.danger}; border-inline-start-width: 6px; border-radius: ${e.radiusLg}; background: ${e.surfaceCard}; }
|
|
2881
|
+
.box:focus { outline: 3px solid ${e.danger}; outline-offset: 2px; }
|
|
2882
|
+
h2 { margin: 0 0 ${r(3)}; ${m("lg")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
2883
|
+
ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${r(2)}; }
|
|
2884
|
+
a { display: inline-flex; align-items: center; min-block-size: ${e.targetMin}; color: ${e.dangerText}; font-weight: ${u("semibold")}; text-underline-offset: 0.2em; }
|
|
2885
|
+
`]}go(t,i){let s=i.replace(/^#/,""),d=this.getRootNode().querySelector?.(`#${CSS.escape(s)}`)??document.getElementById(s);d&&(t.preventDefault(),d.scrollIntoView({block:"center"}),d.focus())}updated(t){let i=t.get("items");t.has("items")&&this.items.length&&!i?.length&&this.renderRoot.querySelector(".box")?.focus()}render(){return this.items.length?a`<div class="box" role="alert" tabindex="-1" aria-labelledby=${this.id_("h")} part="box">
|
|
2886
|
+
<h2 id=${this.id_("h")}>${this.heading}</h2>
|
|
2887
|
+
<ul>${this.items.map(t=>a`<li><a href=${t.href} @click=${i=>this.go(i,t.href)}>${t.text}</a></li>`)}</ul>
|
|
2888
|
+
</div>`:l}},Vr=o=>o>=1048576?g("{size} MB",{size:(o/1048576).toFixed(1)}):g("{size} KB",{size:Math.max(1,Math.round(o/1024))}),Z=class extends T{static{this.properties={...T.properties,accept:{type:String},manyFiles:{type:Boolean,attribute:"many-files"},maxSizeMb:{type:Number,attribute:"max-size-mb"},chooseText:{type:String,attribute:"choose-text"},dropText:{type:String,attribute:"drop-text"}}}constructor(){super(),this.label="Upload a file",this.accept=".pdf,.jpg,.jpeg,.png",this.manyFiles=!1,this.maxSizeMb=10,this.chooseText="Choose file",this.dropText="or drop it here",this.files=[],this.over=!1,this.said=""}static{this.styles=[...T.styles,Ci,A,R("label.btn, .quiet"),h`
|
|
2889
|
+
.zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${r(3)}; padding: ${r(5)}; border: 2px dashed ${e.border}; border-radius: ${e.radiusLg}; background: ${e.surfaceCard}; }
|
|
2890
|
+
.zone.over { border-color: ${e.brand}; background: ${e.brandSubtle}; }
|
|
2891
|
+
:host([invalid]) .zone { border-color: ${e.danger}; border-style: solid; }
|
|
2892
|
+
:host([disabled]) label.btn { cursor: not-allowed; }
|
|
2893
|
+
.drop { color: ${e.textMuted}; }
|
|
2894
|
+
input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
|
|
2895
|
+
label.btn { display: inline-flex; align-items: center; }
|
|
2896
|
+
input[type='file']:focus-visible + label.btn { box-shadow: ${e.focusShadow}; }
|
|
2897
|
+
ul { margin: ${r(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${r(2)}; }
|
|
2898
|
+
li { display: flex; justify-content: space-between; gap: ${r(3)}; align-items: center; padding: ${r(2)} ${r(3)}; border-radius: ${e.radius}; background: ${e.surfaceInset}; }
|
|
2899
|
+
.size { color: ${e.textMuted}; ${m("sm")} }
|
|
2900
|
+
`]}fits(t){if(this.maxSizeMb&&t.size>this.maxSizeMb*1048576)return g("{file} is bigger than {size} MB",{file:t.name,size:this.maxSizeMb});let i=this.accept.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);return i.length&&!i.some(s=>s.startsWith(".")?t.name.toLowerCase().endsWith(s):t.type===s||s.endsWith("/*")&&t.type.startsWith(s.slice(0,-1)))?g("{file} must be {kinds}",{file:t.name,kinds:i.map(s=>s.replace(".","").toUpperCase()).join(", ")}):null}add(t){let i=Array.from(t),s=i.map(p=>this.fits(p)).filter(p=>!!p),n=i.filter(p=>!this.fits(p)),d=this.manyFiles?n:n.slice(0,1);this.files=this.manyFiles?[...this.files,...n]:d.length?d:this.files,this.error=s.join(". "),this.said=d.map(p=>g("{file} added",{file:p.name})).join(". "),this.sync()}removeFile(t){let i=this.files[t];this.files=this.files.filter((s,n)=>n!==t),this.said=i?g("{file} removed",{file:i.name}):"",this.sync(),this.updateComplete.then(()=>this.renderRoot.querySelector('input[type="file"]')?.focus())}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}sync(){this.setFormValue(this.files.map(t=>t.name).join(", ")),this.dispatchEvent(new CustomEvent("impkt-files",{detail:{files:this.files},bubbles:!0,composed:!0}))}renderControl(){return a`
|
|
2901
|
+
<div class="zone ${this.over?"over":""}"
|
|
2902
|
+
@dragover=${t=>{t.preventDefault(),this.over=!0}}
|
|
2903
|
+
@dragleave=${()=>{this.over=!1}}
|
|
2904
|
+
@drop=${t=>{t.preventDefault(),this.over=!1,t.dataTransfer?.files&&this.add(t.dataTransfer.files)}}>
|
|
2905
|
+
<input id=${this.controlId} type="file" accept=${this.accept||l} ?multiple=${this.manyFiles} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}
|
|
2906
|
+
@change=${t=>{let i=t.target.files;i&&this.add(i),t.target.value=""}} />
|
|
2907
|
+
<label class="btn" for=${this.controlId}>${this.chooseText}</label>
|
|
2908
|
+
<span class="drop">${this.dropText}</span>
|
|
2909
|
+
</div>
|
|
2910
|
+
<p class="visually-hidden" role="status">${this.said}</p>
|
|
2911
|
+
${this.files.length?a`<ul aria-label=${g("Files added")}>${this.files.map((t,i)=>a`<li><span>${t.name} <span class="size">${Vr(t.size)}</span></span><button class="quiet" type="button" @click=${()=>this.removeFile(i)}>${g("Remove")}<span class="visually-hidden"> ${t.name}</span></button></li>`)}</ul>`:l}
|
|
2912
|
+
`}};function Ei(o){try{return new Intl.NumberFormat(B(),{style:"currency",currency:o,maximumFractionDigits:0}).formatToParts(0).find(t=>t.type==="currency")?.value??""}catch{return""}}function Li(o){let t=o.replace(/[^\d.]/g,"");if(!t)return"";let[i,s]=t.split(".");return`${Number(i).toLocaleString("en-GB")}${s!==void 0?`.${s.slice(0,2)}`:""}`}var be=class extends T{static{this.properties={...T.properties,currency:{type:String},lowest:{type:Number},highest:{type:Number},pence:{type:Boolean},width:{type:String,reflect:!0}}}constructor(){super(),this.currency="GBP",this.lowest=void 0,this.highest=void 0,this.pence=!1,this.width="md",this.shown=""}static{this.styles=[...T.styles,F,Ci,h`
|
|
2913
|
+
.wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impkt-field-width)); }
|
|
2914
|
+
.sign { display: flex; align-items: center; padding: 0 ${r(3)}; font-weight: ${u("semibold")}; background: ${e.surfaceInset}; border: ${e.borderThin} solid ${e.border}; border-inline-end: 0; border-radius: ${e.radiusLg} 0 0 ${e.radiusLg}; }
|
|
2915
|
+
.wrap input { inline-size: 100%; border-radius: 0 ${e.radiusLg} ${e.radiusLg} 0; }
|
|
2916
|
+
`]}willUpdate(t){t.has("value")&&this.value!==this.shown.replace(/,/g,"")&&(this.shown=Li(this.value))}typed(t){let i=t.replace(/[^\d.]/g,""),s=this.pence?i:i.split(".")[0];this.shown=t,this.setFormValue(s)}check(){this.shown=Li(this.value);let t=Number(this.value);if(!this.value)return;let i=s=>`${Ei(this.currency)}${s.toLocaleString("en-GB")}`;this.lowest!==void 0&&t<this.lowest?this.error=g("Enter an amount of {amount} or more",{amount:i(this.lowest)}):this.highest!==void 0&&t>this.highest?this.error=g("Enter an amount of {amount} or less",{amount:i(this.highest)}):(this.error===g("Enter an amount of {amount} or more",{amount:i(this.lowest??0)})||this.error===g("Enter an amount of {amount} or less",{amount:i(this.highest??0)}))&&(this.error="")}get describedBy(){let t=[Ei(this.currency)?this.id_("sign"):"",super.describedBy===l?"":String(super.describedBy)].filter(Boolean);return t.length?t.join(" "):l}renderControl(){return a`<div class="wrap">
|
|
2917
|
+
<span class="sign" id=${this.id_("sign")}>${Ei(this.currency)}</span>
|
|
2918
|
+
<input id=${this.controlId} inputmode=${this.pence?"decimal":"numeric"} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}
|
|
2919
|
+
aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}
|
|
2920
|
+
@input=${t=>this.typed(t.target.value)} @blur=${()=>this.check()} />
|
|
2921
|
+
</div>`}updated(t){t.has("error")&&this.toggleAttribute("invalid",!!this.error)}},ii=class extends T{static{this.properties={...T.properties,lowest:{type:Number},highest:{type:Number},step:{type:Number},currency:{type:String},unit:{type:String}}}constructor(){super(),this.label="How much",this.lowest=0,this.highest=100,this.step=1,this.currency="",this.unit="",this.value="50"}static{this.styles=[...T.styles,h`
|
|
2922
|
+
.top { display: flex; justify-content: space-between; gap: ${r(3)}; }
|
|
2923
|
+
output { font-weight: ${u("semibold")}; color: ${e.text}; }
|
|
2924
|
+
input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${e.brand}; }
|
|
2925
|
+
.ends { display: flex; justify-content: space-between; ${m("sm")} color: ${e.textMuted}; }
|
|
2926
|
+
`]}shownAs(t){let i=B(this),s=t.toLocaleString(i);if(this.currency)try{s=new Intl.NumberFormat(i,{style:"currency",currency:this.currency,maximumFractionDigits:0}).format(t)}catch{}return this.unit?`${s} ${this.unit}`:s}render(){let t=Number(this.value)||0;return a`
|
|
2927
|
+
<div class="top"><label class="label" for=${this.controlId}>${this.label}${this.required?a` <span class="required">(${this.requiredText})</span>`:l}</label>
|
|
2928
|
+
<output for=${this.controlId}>${this.shownAs(t)}</output></div>
|
|
2929
|
+
${this.description?a`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
2930
|
+
${this.renderControl()}
|
|
2931
|
+
<div class="ends" aria-hidden="true"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>
|
|
2932
|
+
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
2933
|
+
`}renderControl(){return a`<input id=${this.controlId} type="range" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}
|
|
2934
|
+
aria-valuetext=${this.shownAs(Number(this.value)||0)} aria-describedby=${this.describedBy}
|
|
2935
|
+
@input=${t=>this.setFormValue(t.target.value)} />`}},lr={done:"Completed","in-progress":"In progress","not-started":"Not started","cannot-start":"Cannot start yet"},ri=class extends c{static{this.properties={heading:{type:String},items:{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="Your application",this.items=[],this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,R("a"),h`
|
|
2936
|
+
:host { display: block; }
|
|
2937
|
+
.h { margin: 0 0 ${r(2)}; ${m("xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2938
|
+
.count { margin: 0 0 ${r(4)}; color: ${e.textMuted}; }
|
|
2939
|
+
ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${e.rule}; }
|
|
2940
|
+
li { display: flex; justify-content: space-between; align-items: center; gap: ${r(4)}; padding: ${r(4)} 0; border-block-end: 1px solid ${e.rule}; }
|
|
2941
|
+
a { display: inline-flex; align-items: center; min-block-size: ${e.targetMin}; color: ${e.link}; font-weight: ${u("semibold")}; text-underline-offset: 0.2em; }
|
|
2942
|
+
.title { font-weight: ${u("semibold")}; }
|
|
2943
|
+
.hint { display: block; ${m("sm")} color: ${e.textMuted}; }
|
|
2944
|
+
.tag { flex-shrink: 0; padding: ${r(1)} ${r(2.5)}; border-radius: 999px; ${m("sm")} font-weight: ${u("semibold")}; background: ${e.surfaceInset}; color: ${e.text}; }
|
|
2945
|
+
.tag[data-status='done'] { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
2946
|
+
.tag[data-status='in-progress'] { background: ${e.brandSubtle}; color: ${e.link}; }
|
|
2947
|
+
.tag[data-status='cannot-start'] { background: transparent; color: ${e.textMuted}; }
|
|
2948
|
+
`]}render(){let t=this.items.filter(i=>i.status==="done").length;return a`
|
|
2949
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2950
|
+
${this.items.length?a`<p class="count">${g(this.items.length===1?"You have completed {done} of {total} part.":"You have completed {done} of {total} parts.",{done:t,total:this.items.length})}</p>`:l}
|
|
2951
|
+
<ul>${this.items.map(i=>a`<li>
|
|
2952
|
+
<span>${i.href&&i.status!=="cannot-start"?a`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>`:a`<span class="title">${i.title}</span>`}
|
|
2953
|
+
${i.hint?a`<span class="hint">${i.hint}</span>`:l}</span>
|
|
2954
|
+
<span class="tag" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${lr[i.status]?g(lr[i.status]):i.status}</span>
|
|
2955
|
+
</li>`)}</ul>`}};W.createProperty("manual",{state:!0});W.createProperty("postcode",{state:!0});W.createProperty("searched",{state:!0});W.createProperty("busy",{state:!0});Z.createProperty("files",{state:!0});Z.createProperty("over",{state:!0});Z.createProperty("said",{state:!0});be.createProperty("shown",{state:!0});customElements.define("impkt-address-lookup",W);customElements.define("impkt-error-summary",ti);customElements.define("impkt-file-upload",Z);customElements.define("impkt-money-input",be);customElements.define("impkt-range-input",ii);customElements.define("impkt-task-list",ri);var ye=h`
|
|
2956
|
+
.card { background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}, 0 0 0 1px ${e.hairline}; }
|
|
2957
|
+
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2958
|
+
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${r(2.5)} ${r(5)}; font: inherit; font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
2959
|
+
.btn:hover { background: ${e.brandHover}; }
|
|
2960
|
+
.btn.quiet { color: ${e.link}; background: transparent; box-shadow: inset 0 0 0 ${e.borderThin} ${e.border}; }
|
|
2961
|
+
.small { margin: 0; ${m("xs")} color: ${e.textMuted}; }
|
|
2962
|
+
.visually-hidden { ${E} }
|
|
2963
|
+
`,si=(o,t="GBP",i=0)=>{try{return new Intl.NumberFormat(B(),{style:"currency",currency:t,maximumFractionDigits:i,minimumFractionDigits:i}).format(o)}catch{return String(Math.round(o))}},ai=class extends c{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=[...c.styles,k,A,w,ye,h`
|
|
2964
|
+
:host { display: block; container-type: inline-size; }
|
|
2965
|
+
.h { margin-block-end: ${r(5)}; }
|
|
2966
|
+
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${r(4)}; }
|
|
2967
|
+
.plan { position: relative; display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(6)}; }
|
|
2968
|
+
.plan.top { box-shadow: 0 0 0 2px ${e.brand}, ${e.shadowMd}; }
|
|
2969
|
+
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${r(1)} ${r(3)}; border-radius: 999px; ${m("xs")} font-weight: ${u("bold")}; color: ${e.onBrand}; background: ${e.brand}; white-space: nowrap; }
|
|
2970
|
+
.name { margin: 0; ${m("lg")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
2971
|
+
.price { margin: 0; font-family: ${e.fontHeading}; ${m("3xl")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
2972
|
+
.period { ${m("sm")} font-weight: ${u("regular")}; color: ${e.textMuted}; }
|
|
2973
|
+
.note { margin: 0; ${m("sm")} color: ${e.textMuted}; }
|
|
2974
|
+
ul { flex: 1; margin: 0; padding: ${r(3)} 0 0; list-style: none; display: grid; gap: ${r(2)}; border-block-start: 1px solid ${e.rule}; align-content: start; }
|
|
2975
|
+
li { display: flex; gap: ${r(2)}; ${m("sm")} }
|
|
2976
|
+
li[data-has='false'] { color: ${e.textMuted}; }
|
|
2977
|
+
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${u("bold")}; text-align: center; }
|
|
2978
|
+
li[data-has='true'] .mark { color: ${e.successText}; }
|
|
2979
|
+
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${r(6)}; } }
|
|
2980
|
+
`]}has(t,i){return t.includes.split(",").map(s=>s.trim().toLowerCase()).includes(i.label.trim().toLowerCase())}choose(t,i){this.dispatchEvent(new CustomEvent("impkt-select",{detail:{plan:t},bubbles:!0,composed:!0,cancelable:!0}))||i.preventDefault()}render(){return a`
|
|
2981
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2982
|
+
<div class="grid" style=${`--cols: ${Math.max(1,this.plans.length)}`}>
|
|
2983
|
+
${this.plans.map(t=>a`<section class="card plan ${t.badge?"top":""}" aria-labelledby=${this.id_(`n-${t.id}`)}>
|
|
2984
|
+
${t.badge?a`<span class="badge">${t.badge}</span>`:l}
|
|
2985
|
+
<h3 class="name" id=${this.id_(`n-${t.id}`)}>${t.name}</h3>
|
|
2986
|
+
<p class="price">${t.price}${t.period?a` <span class="period">${t.period}</span>`:l}</p>
|
|
2987
|
+
${t.note?a`<p class="note">${t.note}</p>`:l}
|
|
2988
|
+
<ul>${this.rows.map(i=>{let s=this.has(t,i);return a`<li data-has=${String(s)}><span class="mark" aria-hidden="true">${s?"\u2713":"\u2013"}</span><span>${i.label}<span class="visually-hidden">: ${g(s?"included":"not included")}</span></span></li>`})}</ul>
|
|
2989
|
+
${t.href?a`<a class="btn ${t.badge?"":"quiet"}" href=${t.href} @click=${i=>this.choose(t,i)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></a>`:a`<button class="btn ${t.badge?"":"quiet"}" type="button" @click=${i=>this.choose(t,i)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></button>`}
|
|
2990
|
+
</section>`)}
|
|
2991
|
+
</div>`}};function cr(o,t){let i=/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/.exec(o),s=t&&!/^en\b/i.test(t)?`&hl=${encodeURIComponent(t.split("-")[0])}&cc_lang_pref=${encodeURIComponent(t.split("-")[0])}`:"";if(i)return`https://www.youtube-nocookie.com/embed/${i[1]}?autoplay=1&rel=0${s}`;let n=/vimeo\.com\/(?:video\/)?(\d+)/.exec(o);return n?`https://player.vimeo.com/video/${n[1]}?autoplay=1&dnt=1`:null}var fe=class extends c{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=[...c.styles,k,w,ye,h`
|
|
2992
|
+
:host { display: block; }
|
|
2993
|
+
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${e.radiusXl}; background: #111; }
|
|
2994
|
+
:host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }
|
|
2995
|
+
:host([ratio='1:1']) .frame { aspect-ratio: 1; }
|
|
2996
|
+
:host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }
|
|
2997
|
+
iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }
|
|
2998
|
+
.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; }
|
|
2999
|
+
.disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${e.brand}; box-shadow: ${e.shadowLg}; }
|
|
3000
|
+
.label { position: absolute; inset-inline-start: ${r(5)}; inset-block-end: ${r(4)}; ${m("lg")} font-weight: ${u("semibold")}; text-align: start; }
|
|
3001
|
+
.foot { margin: ${r(2)} 0 0; ${m("sm")} }
|
|
3002
|
+
.foot a { color: ${e.link}; }
|
|
3003
|
+
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
3004
|
+
`]}render(){let t=cr(this.videoSrc,B(this)),i;return this.videoSrc?t&&this.playing?i=a`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?i=a`${this.posterSrc?a`<img src=${this.posterSrc} alt="" />`:l}
|
|
3005
|
+
<button class="play" type="button" @click=${()=>{this.playing=!0}}>
|
|
3006
|
+
<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>
|
|
3007
|
+
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
3008
|
+
</button>`:i=a`<video controls preload="metadata" poster=${this.posterSrc||l} aria-label=${this.label}>
|
|
3009
|
+
<source src=${this.videoSrc} />
|
|
3010
|
+
${this.captionsSrc?a`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:l}
|
|
3011
|
+
</video>`:i=a`<div class="empty">${g("Add a video address")}</div>`,a`<div class="frame" part="frame">${i}</div>
|
|
3012
|
+
${this.transcriptHref?a`<p class="foot"><a href=${this.transcriptHref}>${g("Read the transcript")}<span class="visually-hidden">${g(" of {video}",{video:this.label})}</span></a></p>`:l}`}},dr={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:""}},ni=class extends c{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=[...c.styles,w,h`
|
|
3013
|
+
:host { display: block; }
|
|
3014
|
+
.box { padding: ${r(5)}; border-inline-start: 6px solid ${e.warning}; border-radius: ${e.radiusLg}; background: ${e.warningSubtle}; }
|
|
3015
|
+
:host([kind='insurance']) .box { border-color: ${e.info}; background: ${e.infoSubtle}; }
|
|
3016
|
+
strong { display: block; margin-block-end: ${r(1)}; ${m("md")} color: ${e.text}; }
|
|
3017
|
+
p { margin: 0; color: ${e.text}; }
|
|
3018
|
+
.firm { margin-block-start: ${r(3)}; ${m("sm")} color: ${e.textMuted}; }
|
|
3019
|
+
`]}render(){let t=dr[this.kind]??dr.custom,i=this.heading||(t.heading?g(t.heading):""),s=this.text||(t.text?g(t.text):"");return a`<aside class="box" part="box" aria-label=${i||g("Important information")}>
|
|
3020
|
+
${i?a`<strong>${i}</strong>`:l}
|
|
3021
|
+
${s?a`<p>${s}</p>`:l}
|
|
3022
|
+
${this.firm?a`<p class="firm">${this.firm}</p>`:l}
|
|
3023
|
+
</aside>`}},U={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 Ri(o,t,i=0){let s=0;return t.forEach((n,d)=>{let p=t[d+1]?.from??1/0;o>n.from&&(s+=(Math.min(o,p)-n.from)*(n.rate+i)/100)}),Math.round(s)}function pr(o,t){return o<=0?0:t==="first-time"&&o<=U.firstTimeLimit?Ri(o,U.firstTime):t==="additional"?o<4e4?0:Ri(o,U.standard,U.additionalSurcharge):Ri(o,U.standard)}var hr=h`
|
|
3024
|
+
:host { display: block; container-type: inline-size; }
|
|
3025
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }
|
|
3026
|
+
.inputs { display: flex; flex-direction: column; gap: ${r(5)}; padding: ${r(8)}; }
|
|
3027
|
+
label, legend { display: block; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1.5)}; padding: 0; }
|
|
3028
|
+
fieldset { margin: 0; padding: 0; border: 0; }
|
|
3029
|
+
.choices { display: flex; flex-wrap: wrap; gap: ${r(2)}; }
|
|
3030
|
+
.choices label { display: inline-flex; align-items: center; gap: ${r(2)}; margin: 0; padding: ${r(2)} ${r(3)}; font-weight: ${u("regular")}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
3031
|
+
.choices input { accent-color: ${e.brand}; }
|
|
3032
|
+
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${r(2)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; }
|
|
3033
|
+
.result { display: flex; flex-direction: column; justify-content: center; gap: ${r(2)}; padding: ${r(8)}; color: ${e.onBrand}; background: ${e.brand}; }
|
|
3034
|
+
.caption { margin: 0; ${m("sm")} opacity: 0.85; }
|
|
3035
|
+
output { display: block; font-family: ${e.fontHeading}; ${m("4xl")} font-weight: ${u("bold")}; }
|
|
3036
|
+
.line { margin: 0; ${m("sm")} }
|
|
3037
|
+
.foot { grid-column: 1 / -1; padding: ${r(4)} ${r(8)}; background: ${e.surfaceSubtle}; }
|
|
3038
|
+
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${r(5)}; } .foot { padding: ${r(4)} ${r(5)}; } }
|
|
3039
|
+
`,oi=class extends c{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=[...c.styles,k,w,ye,hr]}render(){let t=pr(this.price,this.buyer),i=this.price>0?t/this.price*100:0,s=[["first-time",g("First home")],["mover",g("Moving home")],["additional",g("Second home")]];return a`<div class="card wrap" part="wrap">
|
|
3040
|
+
<div class="inputs">
|
|
3041
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3042
|
+
<div><label for=${this.id_("price")}>${g("Price of the home (\xA3)")}</label>
|
|
3043
|
+
<input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${n=>{this.price=Number(n.target.value)||0}} /></div>
|
|
3044
|
+
<fieldset><legend>${g("Are you buying")}</legend><div class="choices">
|
|
3045
|
+
${s.map(([n,d])=>a`<label><input type="radio" name=${this.id_("buyer")} .checked=${this.buyer===n} @change=${()=>{this.buyer=n}} />${d}</label>`)}
|
|
3046
|
+
</div></fieldset>
|
|
3047
|
+
</div>
|
|
3048
|
+
<div class="result" aria-live="polite">
|
|
3049
|
+
<p class="caption">${g("Stamp duty to pay")}</p>
|
|
3050
|
+
<output for=${this.id_("price")}>${si(t)}</output>
|
|
3051
|
+
<p class="line">${t?g("About {rate}% of the price",{rate:i.toFixed(1)}):g("Nothing to pay at this price")}</p>
|
|
3052
|
+
${this.buyer==="first-time"&&this.price>U.firstTimeLimit?a`<p class="line">${g("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:si(U.firstTimeLimit)})}</p>`:l}
|
|
3053
|
+
</div>
|
|
3054
|
+
${this.smallPrint?a`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:l}
|
|
3055
|
+
</div>`}},li=class extends c{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=[...c.styles,k,w,ye,hr]}field(t){return i=>{this[t]=Number(i.target.value)||0}}render(){let t=Math.max(0,(this.income+this.secondIncome)*this.timesIncome),i=(s,n)=>a`<div><label for=${this.id_(s)}>${n}</label>
|
|
3056
|
+
<input id=${this.id_(s)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[s])} @input=${this.field(s)} /></div>`;return a`<div class="card wrap" part="wrap">
|
|
3057
|
+
<div class="inputs">
|
|
3058
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3059
|
+
${i("income",g("Your yearly income before tax (\xA3)"))}
|
|
3060
|
+
${i("secondIncome",g("A second person\u2019s income, if buying together (\xA3)"))}
|
|
3061
|
+
${i("deposit",g("Your deposit (\xA3)"))}
|
|
3062
|
+
</div>
|
|
3063
|
+
<div class="result" aria-live="polite">
|
|
3064
|
+
<p class="caption">${g("You could borrow about")}</p>
|
|
3065
|
+
<output>${si(t)}</output>
|
|
3066
|
+
<p class="line">${g("With your deposit, that\u2019s a home of about {amount}.",{amount:si(t+this.deposit)})}</p>
|
|
3067
|
+
</div>
|
|
3068
|
+
${this.smallPrint?a`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:l}
|
|
3069
|
+
</div>`}},$e=class extends c{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
|
|
3070
|
+
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=[...c.styles,k,w,ye,h`
|
|
3071
|
+
:host { display: block; container-type: inline-size; }
|
|
3072
|
+
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${r(6)}; padding: ${r(8)}; }
|
|
3073
|
+
.phone { display: inline-block; margin: ${r(3)} 0; font-family: ${e.fontHeading}; ${m("3xl")} font-weight: ${u("bold")}; color: ${e.link}; text-decoration: none; }
|
|
3074
|
+
.hours { margin: 0; white-space: pre-line; color: ${e.textMuted}; }
|
|
3075
|
+
.email { display: inline-block; margin-block-start: ${r(3)}; color: ${e.link}; }
|
|
3076
|
+
form { display: grid; gap: ${r(3)}; padding: ${r(5)}; border-radius: ${e.radiusLg}; background: ${e.surfaceInset}; }
|
|
3077
|
+
.sub { margin: 0; ${m("lg")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
3078
|
+
label { display: block; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1)}; }
|
|
3079
|
+
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${r(2)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; }
|
|
3080
|
+
.done { margin: 0; padding: ${r(5)}; border-radius: ${e.radiusLg}; background: ${e.successSubtle}; color: ${e.successText}; font-weight: ${u("semibold")}; }
|
|
3081
|
+
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${r(5)}; } }
|
|
3082
|
+
`]}submit(t){t.preventDefault();let i=new FormData(t.target),s={name:String(i.get("name")??""),phone:String(i.get("phone")??""),when:String(i.get("when")??"")};this.dispatchEvent(new CustomEvent("impkt-submit",{detail:s,bubbles:!0,composed:!0})),this.sent=!0}render(){return a`<div class="card wrap" part="wrap">
|
|
3083
|
+
<div>
|
|
3084
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3085
|
+
${this.phone?a`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:l}
|
|
3086
|
+
${this.hours?a`<p class="hours">${this.hours}</p>`:l}
|
|
3087
|
+
${this.email?a`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:l}
|
|
3088
|
+
</div>
|
|
3089
|
+
${this.callbackHeading?this.sent?a`<p class="done" role="status">${this.doneText}</p>`:a`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
3090
|
+
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
3091
|
+
<div><label for=${this.id_("name")}>${g("Your name")}</label><input id=${this.id_("name")} name="name" autocomplete="name" required /></div>
|
|
3092
|
+
<div><label for=${this.id_("tel")}>${g("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
3093
|
+
<div><label for=${this.id_("when")}>${g("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${g("Morning")}</option><option value="Afternoon">${g("Afternoon")}</option><option value="Evening">${g("Evening")}</option></select></div>
|
|
3094
|
+
<button class="btn" type="submit">${this.buttonText}</button>
|
|
3095
|
+
</form>`:l}
|
|
3096
|
+
</div>`}};fe.createProperty("playing",{state:!0});$e.createProperty("sent",{state:!0});customElements.define("impkt-plan-comparison",ai);customElements.define("impkt-video",fe);customElements.define("impkt-regulatory-notice",ni);customElements.define("impkt-stamp-duty-calculator",oi);customElements.define("impkt-affordability-calculator",li);customElements.define("impkt-contact-block",$e);export{T as FieldElement,wi as ICONS,Lr as ICON_NAMES,De as ImpktAccordion,W as ImpktAddressLookup,li as ImpktAffordabilityCalculator,Le as ImpktAlert,Lt as ImpktAnnouncement,Dt as ImpktAvatar,qt as ImpktAvatarGroup,Et as ImpktBadge,Ge as ImpktBeforeAfter,tt as ImpktBranchList,rt as ImpktBranchTimeline,ot as ImpktBreadcrumbs,Te as ImpktButton,Re as ImpktCard,Ht as ImpktCardGrid,Vt as ImpktCarousel,it as ImpktCheckList,Me as ImpktCheckbox,ut as ImpktCheckboxGroup,ct as ImpktChip,$e as ImpktContactBlock,Qt as ImpktCtaBanner,mt as ImpktDateInput,bt as ImpktDialog,Rt as ImpktDivider,Pe as ImpktDocumentLink,Pt as ImpktDrawer,c as ImpktElement,Wt as ImpktEmptyState,ti as ImpktErrorSummary,xt as ImpktEstimator,zt as ImpktFeatureList,Nt as ImpktFieldset,Z as ImpktFileUpload,Kt as ImpktGallery,vt as ImpktGrid,Ie as ImpktHeading,kt as ImpktHelp,Tt as ImpktHero,Se as ImpktIcon,He as ImpktImage,_e as ImpktLink,ft as ImpktList,Qe as ImpktLocationCard,Ne as ImpktLogo,Xt as ImpktLogoCloud,Yt as ImpktMediaSplit,jt as ImpktMenu,be as ImpktMoneyInput,Xe as ImpktMortgageCalculator,nt as ImpktNav,Jt as ImpktNewsletter,wt as ImpktPage,Ft as ImpktPagination,ai as ImpktPlanComparison,Oe as ImpktPrice,qe as ImpktProgress,At as ImpktQuote,Ee as ImpktRadioGroup,ii as ImpktRangeInput,ni as ImpktRegulatoryNotice,Je as ImpktReleaseCard,et as ImpktReleaseList,Zt as ImpktReviews,Ue as ImpktScene,Ve as ImpktScrubber,Ct as ImpktSearchBar,St as ImpktSection,Ae as ImpktSelect,pt as ImpktSiteFooter,lt as ImpktSiteHeader,Ke as ImpktSitePlan,Ut as ImpktSlotPicker,It as ImpktSpacer,Ce as ImpktStack,oi as ImpktStampDutyCalculator,Mt as ImpktStat,Gt as ImpktSteps,Ye as ImpktStickyBar,je as ImpktSummaryList,Fe as ImpktTable,_t as ImpktTabs,ri as ImpktTaskList,Be as ImpktText,ze as ImpktTextInput,ht as ImpktTextarea,Ot as ImpktToast,fe as ImpktVideo,Bt as ImpktVisuallyHidden,dt as ImpktWordmark,U as SDLT,cr as embedOf,yt as estimate,$ as fontSize,u as fontWeight,Li as groupDigits,S as iconSvg,C as lineHeight,Zi as monthlyPayment,ir as phaseWeeks,r as space,pr as stampDuty,e as t,f as token};
|
|
3097
|
+
/*! Bundled license information:
|
|
3098
|
+
|
|
3099
|
+
@lit/reactive-element/css-tag.js:
|
|
3100
|
+
(**
|
|
3101
|
+
* @license
|
|
3102
|
+
* Copyright 2019 Google LLC
|
|
3103
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3104
|
+
*)
|
|
3105
|
+
|
|
3106
|
+
@lit/reactive-element/reactive-element.js:
|
|
3107
|
+
(**
|
|
3108
|
+
* @license
|
|
3109
|
+
* Copyright 2017 Google LLC
|
|
3110
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3111
|
+
*)
|
|
3112
|
+
|
|
3113
|
+
lit-html/lit-html.js:
|
|
3114
|
+
(**
|
|
3115
|
+
* @license
|
|
3116
|
+
* Copyright 2017 Google LLC
|
|
3117
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3118
|
+
*)
|
|
3119
|
+
|
|
3120
|
+
lit-element/lit-element.js:
|
|
3121
|
+
(**
|
|
3122
|
+
* @license
|
|
3123
|
+
* Copyright 2017 Google LLC
|
|
3124
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3125
|
+
*)
|
|
3126
|
+
|
|
3127
|
+
lit-html/is-server.js:
|
|
3128
|
+
(**
|
|
3129
|
+
* @license
|
|
3130
|
+
* Copyright 2022 Google LLC
|
|
3131
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3132
|
+
*)
|
|
3133
|
+
*/
|
|
3134
|
+
//# sourceMappingURL=atomic-ui.js.map
|