@atomic-ui/ui 0.2.0 → 0.5.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 +88 -105
- package/custom-elements.json +6370 -15469
- package/dist/base/FieldElement.d.ts +14 -3
- package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +31 -5
- package/dist/base/tokens.d.ts +1 -1
- package/dist/base/tone.d.ts +20 -0
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-7BSZPUE3.js → chunk-3EF4T242.js} +7 -7
- package/dist/chunk-3EF4T242.js.map +1 -0
- package/dist/{chunk-KFD4O7VA.js → chunk-5Y3HYRCU.js} +7 -7
- package/dist/chunk-5Y3HYRCU.js.map +1 -0
- package/dist/{chunk-7AJN2TIS.js → chunk-5ZQVL3V2.js} +29 -12
- package/dist/chunk-5ZQVL3V2.js.map +1 -0
- package/dist/{chunk-NCASAXQT.js → chunk-A7YBFS4H.js} +15 -15
- package/dist/chunk-A7YBFS4H.js.map +1 -0
- package/dist/{chunk-E2VBUWJ4.js → chunk-ACQ4KYPR.js} +9 -9
- package/dist/chunk-ACQ4KYPR.js.map +1 -0
- package/dist/{chunk-OMJMUFOW.js → chunk-DE3INTHZ.js} +6 -6
- package/dist/chunk-DE3INTHZ.js.map +1 -0
- package/dist/chunk-EJD6LT7E.js +161 -0
- package/dist/chunk-EJD6LT7E.js.map +1 -0
- package/dist/{chunk-XJXCTGDR.js → chunk-EJSX4WCD.js} +9 -9
- package/dist/chunk-EJSX4WCD.js.map +1 -0
- package/dist/chunk-FMSC7J7J.js +76 -0
- package/dist/chunk-FMSC7J7J.js.map +1 -0
- package/dist/{chunk-R67PDFKE.js → chunk-FWR6SEIA.js} +33 -33
- package/dist/chunk-FWR6SEIA.js.map +1 -0
- package/dist/{chunk-FFCIY7NM.js → chunk-GJPHQLLN.js} +8 -8
- package/dist/chunk-GJPHQLLN.js.map +1 -0
- package/dist/{chunk-OLLZFNO6.js → chunk-HNBG2POR.js} +7 -7
- package/dist/chunk-HNBG2POR.js.map +1 -0
- package/dist/{chunk-E3XJK7MY.js → chunk-HNZQ7LM4.js} +13 -11
- package/dist/chunk-HNZQ7LM4.js.map +1 -0
- package/dist/{chunk-3IQ73WNW.js → chunk-I54DOEZB.js} +9 -7
- package/dist/chunk-I54DOEZB.js.map +1 -0
- package/dist/{chunk-QB2KMV6S.js → chunk-PANH23MF.js} +12 -12
- package/dist/chunk-PANH23MF.js.map +1 -0
- package/dist/{chunk-UCHJCUYI.js → chunk-PYVUQNFQ.js} +39 -13
- package/dist/chunk-PYVUQNFQ.js.map +1 -0
- package/dist/{chunk-GQDUHZE3.js → chunk-Q54FX3SY.js} +8 -8
- package/dist/chunk-Q54FX3SY.js.map +1 -0
- package/dist/{chunk-WFKSOM6O.js → chunk-QBORJTS4.js} +68 -44
- package/dist/chunk-QBORJTS4.js.map +1 -0
- package/dist/{chunk-TGT7J4EG.js → chunk-RXX4CN5J.js} +7 -7
- package/dist/chunk-RXX4CN5J.js.map +1 -0
- package/dist/{chunk-XEJMFFIM.js → chunk-SV77SN6P.js} +8 -8
- package/dist/chunk-SV77SN6P.js.map +1 -0
- package/dist/chunk-TAZZLOUY.js +328 -0
- package/dist/chunk-TAZZLOUY.js.map +1 -0
- package/dist/{chunk-7OXTZJR4.js → chunk-TRZO5CHU.js} +7 -7
- package/dist/chunk-TRZO5CHU.js.map +1 -0
- package/dist/{chunk-EDSZI227.js → chunk-UPOTBKKK.js} +12 -9
- package/dist/chunk-UPOTBKKK.js.map +1 -0
- package/dist/{chunk-26O27BQS.js → chunk-WP5WJ4V5.js} +6 -6
- package/dist/chunk-WP5WJ4V5.js.map +1 -0
- package/dist/{chunk-YD6IZ2C5.js → chunk-WS5AUJ35.js} +7 -7
- package/dist/chunk-WS5AUJ35.js.map +1 -0
- package/dist/{chunk-HYPPG4NF.js → chunk-WWYYNR3Z.js} +93 -53
- package/dist/chunk-WWYYNR3Z.js.map +1 -0
- package/dist/{chunk-NKTMMJYD.js → chunk-XU2XODVH.js} +9 -8
- package/dist/chunk-XU2XODVH.js.map +1 -0
- package/dist/{chunk-D6C7XEY4.js → chunk-YR6T73GY.js} +24 -12
- package/dist/chunk-YR6T73GY.js.map +1 -0
- package/dist/{chunk-OB7WULFK.js → chunk-YYYQPKQ7.js} +24 -24
- package/dist/chunk-YYYQPKQ7.js.map +1 -0
- package/dist/{chunk-FJRHZA3C.js → chunk-Z45LY6BT.js} +9 -9
- package/dist/chunk-Z45LY6BT.js.map +1 -0
- package/dist/{chunk-6YYAOKNI.js → chunk-ZQBEFP2O.js} +7 -7
- package/dist/chunk-ZQBEFP2O.js.map +1 -0
- package/dist/chunk-ZS7RPXCT.js +47 -0
- package/dist/chunk-ZS7RPXCT.js.map +1 -0
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +4 -4
- package/dist/components/alert.d.ts +3 -3
- package/dist/components/alert.js +4 -4
- package/dist/components/app-ui.d.ts +47 -31
- package/dist/components/app-ui.js +21 -20
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.js +9 -0
- package/dist/components/blocks.d.ts +37 -74
- package/dist/components/blocks.js +10 -13
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +5 -5
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +5 -5
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +5 -5
- package/dist/components/chip.d.ts +58 -0
- package/dist/components/chip.js +8 -0
- package/dist/components/date-input.d.ts +2 -2
- package/dist/components/date-input.js +5 -5
- package/dist/components/dialog.d.ts +18 -3
- package/dist/components/dialog.js +5 -4
- package/dist/components/fieldset.d.ts +3 -3
- package/dist/components/fieldset.js +4 -4
- package/dist/components/grid.d.ts +3 -3
- package/dist/components/grid.js +4 -4
- package/dist/components/help.d.ts +3 -3
- package/dist/components/help.js +4 -4
- package/dist/components/icon.d.ts +3 -3
- package/dist/components/icon.js +4 -4
- package/dist/components/journey.d.ts +30 -16
- package/dist/components/journey.js +15 -15
- package/dist/components/layout.d.ts +9 -9
- package/dist/components/layout.js +10 -10
- package/dist/components/link.d.ts +3 -3
- package/dist/components/link.js +5 -5
- package/dist/components/list.d.ts +3 -3
- package/dist/components/list.js +4 -4
- package/dist/components/media.d.ts +8 -8
- package/dist/components/media.js +8 -8
- package/dist/components/navigation.d.ts +5 -5
- package/dist/components/navigation.js +7 -7
- package/dist/components/page.d.ts +5 -5
- package/dist/components/page.js +6 -6
- package/dist/components/price.d.ts +3 -3
- package/dist/components/price.js +4 -4
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +5 -5
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +5 -5
- package/dist/components/summary-list.d.ts +3 -3
- package/dist/components/summary-list.js +4 -4
- package/dist/components/table.d.ts +97 -5
- package/dist/components/table.js +6 -4
- package/dist/components/text-input.d.ts +2 -2
- package/dist/components/text-input.js +5 -5
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +5 -5
- package/dist/index.d.ts +47 -40
- package/dist/index.js +206 -269
- package/dist/standalone/atomic-ui.js +1928 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +173 -0
- package/package.json +19 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +173 -0
- package/dist/chunk-26O27BQS.js.map +0 -1
- package/dist/chunk-2CFVV2NZ.js +0 -494
- package/dist/chunk-2CFVV2NZ.js.map +0 -1
- package/dist/chunk-3IQ73WNW.js.map +0 -1
- package/dist/chunk-4X723QBD.js +0 -361
- package/dist/chunk-4X723QBD.js.map +0 -1
- package/dist/chunk-6YYAOKNI.js.map +0 -1
- package/dist/chunk-7AJN2TIS.js.map +0 -1
- package/dist/chunk-7BSZPUE3.js.map +0 -1
- package/dist/chunk-7OXTZJR4.js.map +0 -1
- package/dist/chunk-7XEPNEVQ.js +0 -264
- package/dist/chunk-7XEPNEVQ.js.map +0 -1
- package/dist/chunk-D6C7XEY4.js.map +0 -1
- package/dist/chunk-E2VBUWJ4.js.map +0 -1
- package/dist/chunk-E3XJK7MY.js.map +0 -1
- package/dist/chunk-EDSZI227.js.map +0 -1
- package/dist/chunk-FFCIY7NM.js.map +0 -1
- package/dist/chunk-FJRHZA3C.js.map +0 -1
- package/dist/chunk-GQDUHZE3.js.map +0 -1
- package/dist/chunk-HYPPG4NF.js.map +0 -1
- package/dist/chunk-J4JULXUG.js +0 -249
- package/dist/chunk-J4JULXUG.js.map +0 -1
- package/dist/chunk-KFD4O7VA.js.map +0 -1
- package/dist/chunk-MVEFM5QI.js +0 -195
- package/dist/chunk-MVEFM5QI.js.map +0 -1
- package/dist/chunk-NCASAXQT.js.map +0 -1
- package/dist/chunk-NKTMMJYD.js.map +0 -1
- package/dist/chunk-OB7WULFK.js.map +0 -1
- package/dist/chunk-OHDPGIJ3.js +0 -428
- package/dist/chunk-OHDPGIJ3.js.map +0 -1
- package/dist/chunk-OLLZFNO6.js.map +0 -1
- package/dist/chunk-OMJMUFOW.js.map +0 -1
- package/dist/chunk-QB2KMV6S.js.map +0 -1
- package/dist/chunk-R67PDFKE.js.map +0 -1
- package/dist/chunk-RZSZQMSE.js +0 -236
- package/dist/chunk-RZSZQMSE.js.map +0 -1
- package/dist/chunk-TGT7J4EG.js.map +0 -1
- package/dist/chunk-UCHJCUYI.js.map +0 -1
- package/dist/chunk-UHLRXI6J.js +0 -453
- package/dist/chunk-UHLRXI6J.js.map +0 -1
- package/dist/chunk-UNVL3CNM.js +0 -725
- package/dist/chunk-UNVL3CNM.js.map +0 -1
- package/dist/chunk-WDDWWCHN.js +0 -104
- package/dist/chunk-WDDWWCHN.js.map +0 -1
- package/dist/chunk-WFKSOM6O.js.map +0 -1
- package/dist/chunk-XEJMFFIM.js.map +0 -1
- package/dist/chunk-XJXCTGDR.js.map +0 -1
- package/dist/chunk-YD6IZ2C5.js.map +0 -1
- package/dist/chunk-YK5QI57J.js +0 -396
- package/dist/chunk-YK5QI57J.js.map +0 -1
- package/dist/components/changelog.d.ts +0 -386
- package/dist/components/changelog.js +0 -25
- package/dist/components/estimator.d.ts +0 -246
- package/dist/components/estimator.js +0 -16
- package/dist/components/marketing.d.ts +0 -370
- package/dist/components/marketing.js +0 -21
- package/dist/components/marketing.js.map +0 -1
- package/dist/components/organisms.d.ts +0 -559
- package/dist/components/organisms.js +0 -25
- package/dist/components/organisms.js.map +0 -1
- package/dist/components/property.d.ts +0 -389
- package/dist/components/property.js +0 -20
- package/dist/components/property.js.map +0 -1
- package/dist/components/scene.d.ts +0 -138
- package/dist/components/scene.js +0 -8
- package/dist/components/scene.js.map +0 -1
- package/dist/components/scrubber.d.ts +0 -86
- package/dist/components/scrubber.js +0 -8
- package/dist/components/scrubber.js.map +0 -1
- package/dist/components/selling.d.ts +0 -407
- package/dist/components/selling.js +0 -25
- package/dist/components/selling.js.map +0 -1
- package/dist/components/site.d.ts +0 -283
- package/dist/components/site.js +0 -20
- package/dist/components/site.js.map +0 -1
- /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
- /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
|
@@ -0,0 +1,1928 @@
|
|
|
1
|
+
/* @atomic-ui/ui version 0.5.0, standalone. */
|
|
2
|
+
var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lt=Symbol(),Mt=new WeakMap,G=class{constructor(e,i,r){if(this._$cssResult$=!0,r!==lt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i}get styleSheet(){let e=this.o,i=this.t;if(ce&&e===void 0){let r=i!==void 0&&i.length===1;r&&(e=Mt.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Mt.set(i,e))}return e}toString(){return this.cssText}},_=a=>new G(typeof a=="string"?a:a+"",void 0,lt),p=(a,...e)=>{let i=a.length===1?a[0]:e.reduce((r,n,d)=>r+(h=>{if(h._$cssResult$===!0)return h.cssText;if(typeof h=="number")return h;throw Error("Value passed to 'css' function must be a 'css' function result: "+h+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+a[d+1],a[0]);return new G(i,a,lt)},At=(a,e)=>{if(ce)a.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of e){let r=document.createElement("style"),n=de.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=i.cssText,a.appendChild(r)}},dt=ce?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let i="";for(let r of e.cssRules)i+=r.cssText;return _(i)})(a):a;var{is:Gt,defineProperty:Yt,getOwnPropertyDescriptor:Zt,getOwnPropertyNames:Jt,getOwnPropertySymbols:Qt,getPrototypeOf:ei}=Object,pe=globalThis,Rt=pe.trustedTypes,ti=Rt?Rt.emptyScript:"",ii=pe.reactiveElementPolyfillSupport,Y=(a,e)=>a,ct={toAttribute(a,e){switch(e){case Boolean:a=a?ti:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let i=a;switch(e){case Boolean:i=a!==null;break;case Number:i=a===null?null:Number(a);break;case Object:case Array:try{i=JSON.parse(a)}catch{i=null}}return i}},Ct=(a,e)=>!Gt(a,e),_t={attribute:!0,type:String,converter:ct,reflect:!1,useDefault:!1,hasChanged:Ct};Symbol.metadata??=Symbol("metadata"),pe.litPropertyMetadata??=new WeakMap;var B=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=_t){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(e,i),!i.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,i);n!==void 0&&Yt(this.prototype,e,n)}}static getPropertyDescriptor(e,i,r){let{get:n,set:d}=Zt(this.prototype,e)??{get(){return this[i]},set(h){this[i]=h}};return{get:n,set(h){let y=n?.call(this);d?.call(this,h),this.requestUpdate(e,y,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_t}static _$Ei(){if(this.hasOwnProperty(Y("elementProperties")))return;let e=ei(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Y("properties"))){let i=this.properties,r=[...Jt(i),...Qt(i)];for(let n of r)this.createProperty(n,i[n])}let e=this[Symbol.metadata];if(e!==null){let i=litPropertyMetadata.get(e);if(i!==void 0)for(let[r,n]of i)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[i,r]of this.elementProperties){let n=this._$Eu(i,r);n!==void 0&&this._$Eh.set(n,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let i=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)i.unshift(dt(n))}else e!==void 0&&i.push(dt(e));return i}static _$Eu(e,i){let r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,i=this.constructor.elementProperties;for(let r of i.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return At(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,i,r){this._$AK(e,r)}_$ET(e,i){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let d=(r.converter?.toAttribute!==void 0?r.converter:ct).toAttribute(i,r.type);this._$Em=e,d==null?this.removeAttribute(n):this.setAttribute(n,d),this._$Em=null}}_$AK(e,i){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let d=r.getPropertyOptions(n),h=typeof d.converter=="function"?{fromAttribute:d.converter}:d.converter?.fromAttribute!==void 0?d.converter:ct;this._$Em=n;let y=h.fromAttribute(i,d.type);this[n]=y??this._$Ej?.get(n)??y,this._$Em=null}}requestUpdate(e,i,r,n=!1,d){if(e!==void 0){let h=this.constructor;if(n===!1&&(d=this[e]),r??=h.getPropertyOptions(e),!((r.hasChanged??Ct)(d,i)||r.useDefault&&r.reflect&&d===this._$Ej?.get(e)&&!this.hasAttribute(h._$Eu(e,r))))return;this.C(e,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,i,{useDefault:r,reflect:n,wrapped:d},h){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,h??i??this[e]),d!==!0||h!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(i=void 0),this._$AL.set(e,i)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let e=this.scheduleUpdate();return e!=null&&await e,!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 r=this.constructor.elementProperties;if(r.size>0)for(let[n,d]of r){let{wrapped:h}=d,y=this[n];h!==!0||this._$AL.has(n)||y===void 0||this.C(n,void 0,d,y)}}let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(i)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(i)}willUpdate(e){}_$AE(e){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(e){}firstUpdated(e){}};B.elementStyles=[],B.shadowRootOptions={mode:"open"},B[Y("elementProperties")]=new Map,B[Y("finalized")]=new Map,ii?.({ReactiveElement:B}),(pe.reactiveElementVersions??=[]).push("2.1.2");var ft=globalThis,Lt=a=>a,he=ft.trustedTypes,It=he?he.createPolicy("lit-html",{createHTML:a=>a}):void 0,Dt="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,qt="?"+P,ri=`<${qt}>`,U=document,J=()=>U.createComment(""),Q=a=>a===null||typeof a!="object"&&typeof a!="function",$t=Array.isArray,si=a=>$t(a)||typeof a?.[Symbol.iterator]=="function",pt=`[
|
|
3
|
+
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ht=/-->/g,Bt=/>/g,F=RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Nt=/'/g,Ot=/"/g,Ft=/^(?:script|style|textarea|title)$/i,yt=a=>(e,...i)=>({_$litType$:a,strings:e,values:i}),o=yt(1),k=yt(2),zi=yt(3),D=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Pt=new WeakMap,j=U.createTreeWalker(U,129);function jt(a,e){if(!$t(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return It!==void 0?It.createHTML(e):e}var oi=(a,e)=>{let i=a.length-1,r=[],n,d=e===2?"<svg>":e===3?"<math>":"",h=Z;for(let y=0;y<i;y++){let $=a[y],w,A,S=-1,H=0;for(;H<$.length&&(h.lastIndex=H,A=h.exec($),A!==null);)H=h.lastIndex,h===Z?A[1]==="!--"?h=Ht:A[1]!==void 0?h=Bt:A[2]!==void 0?(Ft.test(A[2])&&(n=RegExp("</"+A[2],"g")),h=F):A[3]!==void 0&&(h=F):h===F?A[0]===">"?(h=n??Z,S=-1):A[1]===void 0?S=-2:(S=h.lastIndex-A[2].length,w=A[1],h=A[3]===void 0?F:A[3]==='"'?Ot:Nt):h===Ot||h===Nt?h=F:h===Ht||h===Bt?h=Z:(h=F,n=void 0);let O=h===F&&a[y+1].startsWith("/>")?" ":"";d+=h===Z?$+ri:S>=0?(r.push(w),$.slice(0,S)+Dt+$.slice(S)+P+O):$+P+(S===-2?y:O)}return[jt(a,d+(a[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ee=class a{constructor({strings:e,_$litType$:i},r){let n;this.parts=[];let d=0,h=0,y=e.length-1,$=this.parts,[w,A]=oi(e,i);if(this.el=a.createElement(w,r),j.currentNode=this.el.content,i===2||i===3){let S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(n=j.nextNode())!==null&&$.length<y;){if(n.nodeType===1){if(n.hasAttributes())for(let S of n.getAttributeNames())if(S.endsWith(Dt)){let H=A[h++],O=n.getAttribute(S).split(P),le=/([.?@])?(.*)/.exec(H);$.push({type:1,index:d,name:le[2],strings:O,ctor:le[1]==="."?ut:le[1]==="?"?mt:le[1]==="@"?gt:X}),n.removeAttribute(S)}else S.startsWith(P)&&($.push({type:6,index:d}),n.removeAttribute(S));if(Ft.test(n.tagName)){let S=n.textContent.split(P),H=S.length-1;if(H>0){n.textContent=he?he.emptyScript:"";for(let O=0;O<H;O++)n.append(S[O],J()),j.nextNode(),$.push({type:2,index:++d});n.append(S[H],J())}}}else if(n.nodeType===8)if(n.data===qt)$.push({type:2,index:d});else{let S=-1;for(;(S=n.data.indexOf(P,S+1))!==-1;)$.push({type:7,index:d}),S+=P.length-1}d++}}static createElement(e,i){let r=U.createElement("template");return r.innerHTML=e,r}};function V(a,e,i=a,r){if(e===D)return e;let n=r!==void 0?i._$Co?.[r]:i._$Cl,d=Q(e)?void 0:e._$litDirective$;return n?.constructor!==d&&(n?._$AO?.(!1),d===void 0?n=void 0:(n=new d(a),n._$AT(a,i,r)),r!==void 0?(i._$Co??=[])[r]=n:i._$Cl=n),n!==void 0&&(e=V(a,n._$AS(a,e.values),n,r)),e}var ht=class{constructor(e,i){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:i},parts:r}=this._$AD,n=(e?.creationScope??U).importNode(i,!0);j.currentNode=n;let d=j.nextNode(),h=0,y=0,$=r[0];for(;$!==void 0;){if(h===$.index){let w;$.type===2?w=new te(d,d.nextSibling,this,e):$.type===1?w=new $.ctor(d,$.name,$.strings,this,e):$.type===6&&(w=new bt(d,this,e)),this._$AV.push(w),$=r[++y]}h!==$?.index&&(d=j.nextNode(),h++)}return j.currentNode=U,n}p(e){let i=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,i),i+=r.strings.length-2):r._$AI(e[i])),i++}},te=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,i,r,n){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,i=this._$AM;return i!==void 0&&e?.nodeType===11&&(e=i.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,i=this){e=V(this,e,i),Q(e)?e===l||e==null||e===""?(this._$AH!==l&&this._$AR(),this._$AH=l):e!==this._$AH&&e!==D&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):si(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==l&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){let{values:i,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ee.createElement(jt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(i);else{let d=new ht(n,this),h=d.u(this.options);d.p(i),this.T(h),this._$AH=d}}_$AC(e){let i=Pt.get(e.strings);return i===void 0&&Pt.set(e.strings,i=new ee(e)),i}k(e){$t(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,r,n=0;for(let d of e)n===i.length?i.push(r=new a(this.O(J()),this.O(J()),this,this.options)):r=i[n],r._$AI(d),n++;n<i.length&&(this._$AR(r&&r._$AB.nextSibling,n),i.length=n)}_$AR(e=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);e!==this._$AB;){let r=Lt(e).nextSibling;Lt(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,i,r,n,d){this.type=1,this._$AH=l,this._$AN=void 0,this.element=e,this.name=i,this._$AM=n,this.options=d,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=l}_$AI(e,i=this,r,n){let d=this.strings,h=!1;if(d===void 0)e=V(this,e,i,0),h=!Q(e)||e!==this._$AH&&e!==D,h&&(this._$AH=e);else{let y=e,$,w;for(e=d[0],$=0;$<d.length-1;$++)w=V(this,y[r+$],i,$),w===D&&(w=this._$AH[$]),h||=!Q(w)||w!==this._$AH[$],w===l?e=l:e!==l&&(e+=(w??"")+d[$+1]),this._$AH[$]=w}h&&!n&&this.j(e)}j(e){e===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ut=class extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===l?void 0:e}},mt=class extends X{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==l)}},gt=class extends X{constructor(e,i,r,n,d){super(e,i,r,n,d),this.type=5}_$AI(e,i=this){if((e=V(this,e,i,0)??l)===D)return;let r=this._$AH,n=e===l&&r!==l||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,d=e!==l&&(r===l||n);n&&this.element.removeEventListener(this.name,this,r),d&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},bt=class{constructor(e,i,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var ni=ft.litHtmlPolyfillSupport;ni?.(ee,te),(ft.litHtmlVersions??=[]).push("3.3.3");var xt=(a,e,i)=>{let r=i?.renderBefore??e,n=r._$litPart$;if(n===void 0){let d=i?.renderBefore??null;r._$litPart$=n=new te(e.insertBefore(J(),d),d,void 0,i??{})}return n._$AI(a),n};var kt=globalThis,N=class extends B{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=xt(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};N._$litElement$=!0,N.finalized=!0,kt.litElementHydrateSupport?.({LitElement:N});var ai=kt.litElementPolyfillSupport;ai?.({LitElement:N});(kt.litElementVersions??=[]).push("4.2.2");var u=(a,e)=>_(`var(--impakt-${a.replace(/\./g,"-")}, ${e})`),t={brand:u("color.brand.default","#1f4ed8"),brandHover:u("color.brand.hover","#1b45be"),brandActive:u("color.brand.active","#183ba4"),brandSubtle:u("color.brand.subtle","#e4eafa"),onBrand:u("color.text.on-brand","#ffffff"),surfaceCard:u("color.surface.card","#ffffff"),surfaceInset:u("color.surface.inset","#f4f4f4"),surfaceSubtle:u("color.surface.subtle","#e4eafa"),text:u("color.text.default","#1a1a1a"),textMuted:u("color.text.muted","#717171"),textPlaceholder:u("color.text.placeholder","#767676"),textHeading:u("color.text.heading","#1f4ed8"),link:u("color.text.link","#1f4ed8"),linkHover:u("color.text.link-hover","#193ead"),border:u("color.border.default","#929292"),borderStrong:u("color.border.strong","#818181"),danger:u("color.status.danger.default","#c8102e"),dangerText:u("color.status.danger.text","#c8102e"),dangerSubtle:u("color.status.danger.subtle","#f8e2e6"),warning:u("color.status.warning.default","#b45309"),warningText:u("color.status.warning.text","#b45309"),warningSubtle:u("color.status.warning.subtle","#f6eae1"),success:u("color.status.success.default","#047857"),successText:u("color.status.success.text","#047857"),successSubtle:u("color.status.success.subtle","#e0f0ea"),info:u("color.status.info.default","#1f4ed8"),infoText:u("color.status.info.text","#1f4ed8"),infoSubtle:u("color.status.info.subtle","#e4eafa"),fontBody:u("font.family.body","system-ui, sans-serif"),fontHeading:u("font.family.heading","system-ui, sans-serif"),fontMono:u("font.family.mono","ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"),fontEyebrow:u("font.family.eyebrow","inherit"),focusShadow:u("focus.ring.shadow","0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a"),focusOffset:u("focus.ring.offset","2px"),targetMin:u("target.min","24px"),radiusSm:u("radius.sm","2px"),radius:u("radius.md","4px"),radiusLg:u("radius.lg","8px"),borderThin:u("border.width.thin","1px"),borderThick:u("border.width.thick","2px"),radiusXs:u("radius.xs","2px"),radiusXl:u("radius.xl","12px"),radius2xl:u("radius.2xl","16px"),hairline:_("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)"),rule:_("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)"),wash:_("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)"),brandHalo:_("color-mix(in srgb, var(--impakt-color-brand-default, #1f4ed8) 22%, transparent)"),shadowXs:u("shadow.xs","0 1px 2px 0 rgb(0 0 0 / 0.05)"),shadowSm:u("shadow.sm","0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"),shadowMd:u("shadow.md","0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"),shadowLg:u("shadow.lg","0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"),shadowXl:u("shadow.xl","0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"),trackingTight:u("font.tracking.tight","-0.02em"),trackingWide:u("font.tracking.wide","0.06em")},b=a=>_(`font-size: var(--impakt-font-size-${a}, 1rem); line-height: var(--impakt-font-leading-${a}, 1.5);`),s=a=>u(`space.${String(a).replace(".","-")}`,`${a*4}px`),g=a=>u(`font.size.${a}`,"1rem"),C=a=>u(`font.line-height.${a}`,"1.5"),m=a=>u(`font.weight.${a}`,"400"),R=p`
|
|
5
|
+
:host([space-above='sm']) { margin-block-start: ${s(2)}; }
|
|
6
|
+
:host([space-above='md']) { margin-block-start: ${s(4)}; }
|
|
7
|
+
:host([space-above='lg']) { margin-block-start: ${s(6)}; }
|
|
8
|
+
:host([space-above='xl']) { margin-block-start: ${s(8)}; }
|
|
9
|
+
:host([space-above='2xl']) { margin-block-start: clamp(${s(14)}, 8vw, ${s(28)}); }
|
|
10
|
+
:host([space-below='sm']) { margin-block-end: ${s(2)}; }
|
|
11
|
+
:host([space-below='md']) { margin-block-end: ${s(4)}; }
|
|
12
|
+
:host([space-below='lg']) { margin-block-end: ${s(6)}; }
|
|
13
|
+
:host([space-below='xl']) { margin-block-end: ${s(8)}; }
|
|
14
|
+
:host([space-below='2xl']) { margin-block-end: clamp(${s(14)}, 8vw, ${s(28)}); }
|
|
15
|
+
`;var v=p`
|
|
16
|
+
:host(:focus-visible),
|
|
17
|
+
:host(:not([disabled])) :focus-visible {
|
|
18
|
+
outline: 2px solid transparent;
|
|
19
|
+
outline-offset: ${t.focusOffset};
|
|
20
|
+
box-shadow: ${t.focusShadow};
|
|
21
|
+
}
|
|
22
|
+
`,T=p`
|
|
23
|
+
min-block-size: ${t.targetMin};
|
|
24
|
+
min-inline-size: ${t.targetMin};
|
|
25
|
+
`,E=p`
|
|
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
|
+
`,Ut=p`
|
|
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
|
+
`,Wt=p`
|
|
48
|
+
:host {
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
font-family: ${t.fontBody};
|
|
51
|
+
color: ${t.text};
|
|
52
|
+
}
|
|
53
|
+
:host([hidden]) {
|
|
54
|
+
display: none !important;
|
|
55
|
+
}
|
|
56
|
+
*,
|
|
57
|
+
*::before,
|
|
58
|
+
*::after {
|
|
59
|
+
box-sizing: inherit;
|
|
60
|
+
}
|
|
61
|
+
`,M=a=>_(`@media (pointer: coarse) { :host :is(${a}) { min-block-size: 44px; min-inline-size: 44px; } }`),Kt=p`
|
|
62
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
|
|
63
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
|
|
64
|
+
`;var li=Symbol.for("strata.wording");function x(a,e){let r=globalThis[li]?.words?.[a],n=typeof r=="string"&&r.trim()?r:a;return e?n.replace(/\{(\w+)\}/g,(d,h)=>h in e?String(e[h]):d):n}var di=0,c=class extends N{constructor(){super(...arguments);this.uid=`impakt-${di+=1}`}static{this.styles=[Wt,Ut,p``]}id_(i){return`${this.uid}-${i}`}connectedCallback(){super.connectedCallback(),this.sayDefaults()}sayDefaults(){let i=this.constructor.elementProperties,r=this;for(let n of i.keys()){let d=r[n];if(typeof d!="string"||!d)continue;let h=x(d);h!==d&&(r[n]=h)}}};var vt={"arrow-right":k`<path d="M5 12h14M13 6l6 6-6 6"/>`,"arrow-left":k`<path d="M19 12H5M11 6l-6 6 6 6"/>`,"chevron-right":k`<path d="M9 6l6 6-6 6"/>`,"chevron-down":k`<path d="M6 9l6 6 6-6"/>`,check:k`<path d="M5 12.5l4.5 4.5L19 7"/>`,close:k`<path d="M6 6l12 12M18 6L6 18"/>`,menu:k`<path d="M4 7h16M4 12h16M4 17h16"/>`,"menu-two":k`<path d="M5 9.5h14M5 14.5h14"/>`,plus:k`<path d="M12 5v14M5 12h14"/>`,minus:k`<path d="M5 12h14"/>`,search:k`<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>`,external:k`<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:k`<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>`,home:k`<path d="M4 11l8-7 8 7M6 9.5V20h12V9.5"/><path d="M10 20v-6h4v6"/>`,phone:k`<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:k`<rect x="3.5" y="5.5" width="17" height="13" rx="1.5"/><path d="M4 7l8 6 8-6"/>`,"map-pin":k`<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:k`<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:k`<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>`,user:k`<circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/>`,star:k`<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:k`<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:k`<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:k`<path d="M5 19c0-8 5-13 14-14 0 9-5 14-13 14z"/><path d="M5 19l7-7"/>`,sun:k`<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:k`<path d="M13 3L5 13.5h6L10 21l8-10.5h-6z"/>`,key:k`<circle cx="8" cy="15" r="3.5"/><path d="M10.5 12.5L19 4M16 7l2.5 2.5M14 9l2 2"/>`,info:k`<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.5v.5"/>`,warning:k`<path d="M12 4l9 15.5H3z"/><path d="M12 10v4M12 16.5v.5"/>`,document:k`<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:k`<path d="M16 6.5a3.5 3.5 0 0 0-6.5 1.8V20M7 13h7M7 20h10"/>`,chat:k`<path d="M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z"/>`},ci=Object.keys(vt);function z(a,e="1.25em"){let i=a?vt[a]:void 0;return i?o`<svg class="icon" viewBox="0 0 24 24" width=${e} height=${e} fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${i}</svg>`:l}var ue=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,p`
|
|
65
|
+
:host { display: inline-flex; vertical-align: middle; line-height: 0; }
|
|
66
|
+
:host([tone='brand']) { color: ${t.brand}; }
|
|
67
|
+
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
68
|
+
@media (forced-colors: active) { :host { color: CanvasText; } }
|
|
69
|
+
`]}render(){let e={sm:"16px",md:"24px",lg:"32px",xl:"48px"}[this.size]??"24px",i=z(this.name,e);return this.label?o`<span role="img" aria-label=${this.label}>${i}</span>`:o`${i}`}};customElements.define("impakt-icon",ue);var me=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,v,M("button, a"),p`
|
|
70
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
71
|
+
:host {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
}
|
|
74
|
+
:host([full]) {
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
|
+
@media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }
|
|
78
|
+
button, a {
|
|
79
|
+
${T}
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
gap: ${s(2)};
|
|
86
|
+
inline-size: 100%;
|
|
87
|
+
min-block-size: 40px;
|
|
88
|
+
padding: ${s(2)} ${s(4)};
|
|
89
|
+
font-family: inherit;
|
|
90
|
+
${b("sm")}
|
|
91
|
+
font-weight: ${m("semibold")};
|
|
92
|
+
border-radius: ${t.radiusLg};
|
|
93
|
+
border: ${t.borderThin} solid transparent;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
96
|
+
}
|
|
97
|
+
:host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${s(1)} ${s(3)}; ${b("sm")} gap: ${s(1.5)}; }
|
|
98
|
+
:host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${s(3)} ${s(6)}; ${b("md")} }
|
|
99
|
+
.icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }
|
|
100
|
+
/* The cursor is the only thing that changes while busy. Moving or
|
|
101
|
+
recolouring a control the moment it is pressed is how a user loses it. */
|
|
102
|
+
button[aria-disabled='true'] {
|
|
103
|
+
cursor: progress;
|
|
104
|
+
}
|
|
105
|
+
:host([disabled]) button {
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
opacity: 0.5;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Solid: the brand, with a hairline highlight along the top edge. */
|
|
111
|
+
.primary {
|
|
112
|
+
background: ${t.brand};
|
|
113
|
+
color: ${t.onBrand};
|
|
114
|
+
box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);
|
|
115
|
+
}
|
|
116
|
+
.primary:hover:not([aria-disabled='true']) {
|
|
117
|
+
background: var(--impakt-color-action-hover, ${t.brandHover});
|
|
118
|
+
color: var(--impakt-color-action-on-hover, ${t.onBrand});
|
|
119
|
+
}
|
|
120
|
+
/* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */
|
|
121
|
+
.after { transition: transform 160ms ease-out; }
|
|
122
|
+
:is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impakt-motion-button-turn, 0deg)); }
|
|
123
|
+
@media (prefers-reduced-motion: reduce) { .after { transition: none; } }
|
|
124
|
+
.primary:active:not([aria-disabled='true']) {
|
|
125
|
+
background: ${t.brandActive};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Outline: the card, a hairline border and the text colour, for the second choice. */
|
|
129
|
+
.secondary {
|
|
130
|
+
background: ${t.surfaceCard};
|
|
131
|
+
color: ${t.text};
|
|
132
|
+
border-color: ${t.rule};
|
|
133
|
+
box-shadow: ${t.shadowXs};
|
|
134
|
+
}
|
|
135
|
+
.secondary:hover:not([aria-disabled='true']) {
|
|
136
|
+
background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%);
|
|
137
|
+
border-color: color-mix(in srgb, ${t.text} 25%, transparent);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Plain: words only until it is pointed at. */
|
|
141
|
+
.ghost {
|
|
142
|
+
background: transparent;
|
|
143
|
+
color: ${t.link};
|
|
144
|
+
}
|
|
145
|
+
.ghost:hover:not([aria-disabled='true']) {
|
|
146
|
+
background: ${t.wash};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.sr-only {
|
|
150
|
+
${E}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Windows High Contrast Mode drops background and border colours, so a
|
|
154
|
+
button styled only by background becomes invisible. A forced-colors
|
|
155
|
+
border puts the boundary back. */
|
|
156
|
+
@media (forced-colors: active) {
|
|
157
|
+
button, a {
|
|
158
|
+
border-color: ButtonBorder;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`]}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=o`${z(this.iconBefore)}<slot></slot>${this.iconAfter&&this.iconAfter!=="none"?o`<span class="after" aria-hidden="true">${z(this.iconAfter)}</span>`:l}`;return this.href&&!this.disabled?o`<a class=${this.variant} href=${this.href} part="button">${i}</a>`:o`
|
|
162
|
+
<button
|
|
163
|
+
class=${this.variant}
|
|
164
|
+
type="button"
|
|
165
|
+
part="button"
|
|
166
|
+
?disabled=${this.disabled}
|
|
167
|
+
aria-disabled=${this.busy?"true":l}
|
|
168
|
+
aria-busy=${this.busy?"true":l}
|
|
169
|
+
@click=${this.onClick}
|
|
170
|
+
>
|
|
171
|
+
${i}
|
|
172
|
+
${this.busy?o`<span class="sr-only">${this.busyLabel}</span>`:l}
|
|
173
|
+
</button>
|
|
174
|
+
`}};customElements.define("impakt-button",me);var L=p`
|
|
175
|
+
:host { --impakt-field-width: 100%; }
|
|
176
|
+
:host([width='xs']) { --impakt-field-width: 8ch; }
|
|
177
|
+
:host([width='sm']) { --impakt-field-width: 14ch; }
|
|
178
|
+
:host([width='md']) { --impakt-field-width: 24ch; }
|
|
179
|
+
:host([width='lg']) { --impakt-field-width: 40ch; }
|
|
180
|
+
`,f=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,v,p`
|
|
181
|
+
:host {
|
|
182
|
+
display: block;
|
|
183
|
+
margin-block-end: ${s(4)};
|
|
184
|
+
}
|
|
185
|
+
.label {
|
|
186
|
+
display: block;
|
|
187
|
+
font-size: ${g("sm")};
|
|
188
|
+
font-weight: ${m("semibold")};
|
|
189
|
+
line-height: ${C("normal")};
|
|
190
|
+
margin-block-end: ${s(1)};
|
|
191
|
+
color: ${t.text};
|
|
192
|
+
}
|
|
193
|
+
.required {
|
|
194
|
+
font-weight: ${m("regular")};
|
|
195
|
+
color: ${t.textMuted};
|
|
196
|
+
}
|
|
197
|
+
.description {
|
|
198
|
+
font-size: ${g("sm")};
|
|
199
|
+
line-height: ${C("normal")};
|
|
200
|
+
color: ${t.textMuted};
|
|
201
|
+
margin-block-end: ${s(2)};
|
|
202
|
+
}
|
|
203
|
+
.error {
|
|
204
|
+
font-size: ${g("sm")};
|
|
205
|
+
line-height: ${C("normal")};
|
|
206
|
+
color: ${t.dangerText};
|
|
207
|
+
margin-block-start: ${s(1)};
|
|
208
|
+
display: flex;
|
|
209
|
+
gap: ${s(1)};
|
|
210
|
+
}
|
|
211
|
+
.error:empty {
|
|
212
|
+
display: none;
|
|
213
|
+
}
|
|
214
|
+
.visually-hidden {
|
|
215
|
+
${E}
|
|
216
|
+
}
|
|
217
|
+
/*
|
|
218
|
+
* Only the control is dimmed. Dimming the whole host took the question,
|
|
219
|
+
* the hint and the error below 4.5:1, and a disabled field still has to
|
|
220
|
+
* say what it is and why it cannot be changed. The native disabled
|
|
221
|
+
* control itself is exempt from the contrast criterion.
|
|
222
|
+
*/
|
|
223
|
+
:host([disabled]) :is(input, select, textarea, button) {
|
|
224
|
+
opacity: 0.6;
|
|
225
|
+
cursor: not-allowed;
|
|
226
|
+
}
|
|
227
|
+
`]}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 r=this.renderRoot?.querySelector(`#${this.controlId}`)??this.renderRoot?.querySelector("input, select, textarea, button");r?r.focus(i):super.focus(i)}renderLabel(){return o`
|
|
228
|
+
<label class="label" for=${this.controlId} part="label">
|
|
229
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
230
|
+
</label>
|
|
231
|
+
`}render(){return o`
|
|
232
|
+
${this.renderLabel()}
|
|
233
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">
|
|
234
|
+
${this.description}
|
|
235
|
+
</div>`:l}
|
|
236
|
+
${this.renderControl()}
|
|
237
|
+
<!--
|
|
238
|
+
The error region is always present, even when empty. A live region
|
|
239
|
+
inserted at the same moment as its content is announced unreliably
|
|
240
|
+
across screen readers; one that already exists and is then filled is
|
|
241
|
+
announced consistently. "polite" rather than "assertive" because a
|
|
242
|
+
validation message should not interrupt what is being read.
|
|
243
|
+
-->
|
|
244
|
+
<div
|
|
245
|
+
class="error"
|
|
246
|
+
id=${this.id_("error")}
|
|
247
|
+
part="error"
|
|
248
|
+
aria-live="polite"
|
|
249
|
+
>
|
|
250
|
+
${this.error||l}
|
|
251
|
+
</div>
|
|
252
|
+
`}setFormValue(i){this.value=i,this.internals?.setFormValue(i),this.dispatchEvent(new CustomEvent("impakt-change",{detail:{value:i},bubbles:!0,composed:!0}))}};var ge=class extends f{static{this.properties={...f.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=[...f.styles,L,p`
|
|
253
|
+
input {
|
|
254
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
255
|
+
min-block-size: 44px;
|
|
256
|
+
padding: ${s(2.5)} ${s(3)};
|
|
257
|
+
font-family: inherit;
|
|
258
|
+
font-size: ${g("md")};
|
|
259
|
+
color: ${t.text};
|
|
260
|
+
background: var(--impakt-color-field-surface, ${t.surfaceCard});
|
|
261
|
+
border: ${t.borderThin} solid ${t.border};
|
|
262
|
+
border-radius: ${t.radiusLg};
|
|
263
|
+
box-shadow: var(--impakt-shadow-field, ${t.shadowXs});
|
|
264
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
265
|
+
}
|
|
266
|
+
input:hover:not(:disabled) {
|
|
267
|
+
border-color: ${t.borderStrong};
|
|
268
|
+
}
|
|
269
|
+
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
270
|
+
input:focus-visible {
|
|
271
|
+
border-color: ${t.brand};
|
|
272
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
273
|
+
}
|
|
274
|
+
input::placeholder {
|
|
275
|
+
color: ${t.textPlaceholder};
|
|
276
|
+
}
|
|
277
|
+
input:disabled {
|
|
278
|
+
background: ${t.surfaceInset};
|
|
279
|
+
cursor: not-allowed;
|
|
280
|
+
}
|
|
281
|
+
/* The border thickens as well as reddening. Colour alone would carry the
|
|
282
|
+
error, which 1.4.1 forbids — and the message below says it in words. */
|
|
283
|
+
:host([invalid]) input {
|
|
284
|
+
border-color: ${t.danger};
|
|
285
|
+
border-width: ${t.borderThick};
|
|
286
|
+
}
|
|
287
|
+
`]}renderControl(){return o`
|
|
288
|
+
<input
|
|
289
|
+
id=${this.controlId}
|
|
290
|
+
part="input"
|
|
291
|
+
type=${this.type}
|
|
292
|
+
name=${this.name||l}
|
|
293
|
+
.value=${this.value}
|
|
294
|
+
placeholder=${this.placeholder||l}
|
|
295
|
+
autocomplete=${this.autocomplete||l}
|
|
296
|
+
inputmode=${this.inputmode||l}
|
|
297
|
+
maxlength=${this.maxlength??l}
|
|
298
|
+
?disabled=${this.disabled}
|
|
299
|
+
?readonly=${this.readonly}
|
|
300
|
+
?required=${this.required}
|
|
301
|
+
aria-describedby=${this.describedBy}
|
|
302
|
+
aria-invalid=${this.error?"true":l}
|
|
303
|
+
@input=${e=>this.setFormValue(e.target.value)}
|
|
304
|
+
/>
|
|
305
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-text-input",ge);var be=class extends f{static{this.properties={...f.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=[...f.styles,L,p`
|
|
306
|
+
select {
|
|
307
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
308
|
+
min-block-size: 44px;
|
|
309
|
+
padding: ${s(2.5)} ${s(3)};
|
|
310
|
+
font-family: inherit;
|
|
311
|
+
font-size: ${g("md")};
|
|
312
|
+
color: ${t.text};
|
|
313
|
+
background: var(--impakt-color-field-surface, ${t.surfaceCard});
|
|
314
|
+
border: ${t.borderThin} solid ${t.border};
|
|
315
|
+
border-radius: ${t.radiusLg};
|
|
316
|
+
box-shadow: var(--impakt-shadow-field, ${t.shadowXs});
|
|
317
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
318
|
+
}
|
|
319
|
+
select:hover:not(:disabled) {
|
|
320
|
+
border-color: ${t.borderStrong};
|
|
321
|
+
}
|
|
322
|
+
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
323
|
+
select:focus-visible {
|
|
324
|
+
border-color: ${t.brand};
|
|
325
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
326
|
+
}
|
|
327
|
+
select:disabled {
|
|
328
|
+
background: ${t.surfaceInset};
|
|
329
|
+
cursor: not-allowed;
|
|
330
|
+
}
|
|
331
|
+
:host([invalid]) select {
|
|
332
|
+
border-color: ${t.danger};
|
|
333
|
+
border-width: ${t.borderThick};
|
|
334
|
+
}
|
|
335
|
+
`]}renderControl(){return o`
|
|
336
|
+
<select
|
|
337
|
+
id=${this.controlId}
|
|
338
|
+
part="select"
|
|
339
|
+
name=${this.name||l}
|
|
340
|
+
?disabled=${this.disabled}
|
|
341
|
+
?required=${this.required}
|
|
342
|
+
aria-describedby=${this.describedBy}
|
|
343
|
+
aria-invalid=${this.error?"true":l}
|
|
344
|
+
@change=${e=>this.setFormValue(e.target.value)}
|
|
345
|
+
>
|
|
346
|
+
<option value="" ?selected=${!this.value}>${this.placeholder}</option>
|
|
347
|
+
${this.options.map(e=>o`<option value=${e.value} ?selected=${this.value===e.value}>${e.label}</option>`)}
|
|
348
|
+
</select>
|
|
349
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-select",be);var fe=class extends f{static{this.properties={...f.properties,checked:{type:Boolean,reflect:!0}}}constructor(){super(),this.checked=!1}static{this.styles=[...f.styles,M(".row"),p`
|
|
350
|
+
.row {
|
|
351
|
+
display: flex;
|
|
352
|
+
align-items: flex-start;
|
|
353
|
+
gap: ${s(3)};
|
|
354
|
+
cursor: pointer;
|
|
355
|
+
}
|
|
356
|
+
input {
|
|
357
|
+
${T}
|
|
358
|
+
inline-size: 20px;
|
|
359
|
+
block-size: 20px;
|
|
360
|
+
margin: 0;
|
|
361
|
+
flex: none;
|
|
362
|
+
accent-color: ${t.brand};
|
|
363
|
+
}
|
|
364
|
+
.text {
|
|
365
|
+
font-size: ${g("md")};
|
|
366
|
+
}
|
|
367
|
+
:host([invalid]) .row {
|
|
368
|
+
color: ${t.dangerText};
|
|
369
|
+
}
|
|
370
|
+
`]}renderControl(){return o`
|
|
371
|
+
<label class="row" part="row" for=${this.controlId}>
|
|
372
|
+
<input
|
|
373
|
+
type="checkbox"
|
|
374
|
+
id=${this.controlId}
|
|
375
|
+
part="input"
|
|
376
|
+
name=${this.name||l}
|
|
377
|
+
.checked=${this.checked}
|
|
378
|
+
?disabled=${this.disabled}
|
|
379
|
+
?required=${this.required}
|
|
380
|
+
aria-describedby=${this.describedBy}
|
|
381
|
+
aria-invalid=${this.error?"true":l}
|
|
382
|
+
@change=${e=>{this.checked=e.target.checked,this.setFormValue(this.checked?"on":"")}}
|
|
383
|
+
/>
|
|
384
|
+
<span class="text">
|
|
385
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
386
|
+
</span>
|
|
387
|
+
</label>
|
|
388
|
+
`}renderLabel(){return o`${l}`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-checkbox",fe);var $e=class extends f{static{this.properties={...f.properties,options:{type:Array}}}constructor(){super(),this.options=[]}static{this.styles=[...f.styles,p`
|
|
389
|
+
fieldset {
|
|
390
|
+
border: 0;
|
|
391
|
+
margin: 0;
|
|
392
|
+
padding: 0;
|
|
393
|
+
min-inline-size: 0;
|
|
394
|
+
}
|
|
395
|
+
legend {
|
|
396
|
+
padding: 0;
|
|
397
|
+
}
|
|
398
|
+
.option {
|
|
399
|
+
display: flex;
|
|
400
|
+
align-items: flex-start;
|
|
401
|
+
gap: ${s(3)};
|
|
402
|
+
padding: ${s(3)};
|
|
403
|
+
border: ${t.borderThin} solid ${t.border};
|
|
404
|
+
border-radius: ${t.radius};
|
|
405
|
+
margin-block-end: ${s(2)};
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
}
|
|
408
|
+
.option:hover {
|
|
409
|
+
background: ${t.surfaceSubtle};
|
|
410
|
+
}
|
|
411
|
+
/* The whole row is the target, not the 20px dot — 2.5.8 is a floor and
|
|
412
|
+
a comfortable target is the actual goal. */
|
|
413
|
+
.option input {
|
|
414
|
+
${T}
|
|
415
|
+
inline-size: 20px;
|
|
416
|
+
block-size: 20px;
|
|
417
|
+
margin: 0;
|
|
418
|
+
flex: none;
|
|
419
|
+
accent-color: ${t.brand};
|
|
420
|
+
}
|
|
421
|
+
.option-text {
|
|
422
|
+
display: block;
|
|
423
|
+
font-size: ${g("md")};
|
|
424
|
+
}
|
|
425
|
+
.option-description {
|
|
426
|
+
display: block;
|
|
427
|
+
font-size: ${g("sm")};
|
|
428
|
+
color: ${t.textMuted};
|
|
429
|
+
margin-block-start: ${s(1)};
|
|
430
|
+
}
|
|
431
|
+
:host([invalid]) .option {
|
|
432
|
+
border-color: ${t.danger};
|
|
433
|
+
}
|
|
434
|
+
`]}renderLabel(){return o`<legend class="label" part="label">
|
|
435
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
436
|
+
</legend>`}renderControl(){return o`
|
|
437
|
+
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),n=e.description?this.id_(`opt-${i}-desc`):void 0;return o`
|
|
438
|
+
<label class="option" part="option" for=${r}>
|
|
439
|
+
<input
|
|
440
|
+
type="radio"
|
|
441
|
+
id=${r}
|
|
442
|
+
name=${this.uid}
|
|
443
|
+
value=${e.value}
|
|
444
|
+
.checked=${this.value===e.value}
|
|
445
|
+
?disabled=${this.disabled}
|
|
446
|
+
?required=${this.required&&i===0}
|
|
447
|
+
aria-describedby=${n??l}
|
|
448
|
+
@change=${()=>this.setFormValue(e.value)}
|
|
449
|
+
/>
|
|
450
|
+
<span>
|
|
451
|
+
<span class="option-text">${e.label}</span>
|
|
452
|
+
${e.description?o`<span class="option-description" id=${n}>${e.description}</span>`:l}
|
|
453
|
+
</span>
|
|
454
|
+
</label>
|
|
455
|
+
`})}
|
|
456
|
+
`}render(){return o`
|
|
457
|
+
<fieldset
|
|
458
|
+
part="fieldset"
|
|
459
|
+
aria-describedby=${this.describedBy}
|
|
460
|
+
aria-invalid=${this.error?"true":l}
|
|
461
|
+
>
|
|
462
|
+
${this.renderLabel()}
|
|
463
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">
|
|
464
|
+
${this.description}
|
|
465
|
+
</div>`:l}
|
|
466
|
+
${this.renderControl()}
|
|
467
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">
|
|
468
|
+
${this.error||l}
|
|
469
|
+
</div>
|
|
470
|
+
</fieldset>
|
|
471
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-radio-group",$e);var ye=class a 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,p`
|
|
472
|
+
:host {
|
|
473
|
+
display: block;
|
|
474
|
+
margin-block-end: ${s(4)};
|
|
475
|
+
}
|
|
476
|
+
.alert {
|
|
477
|
+
padding: ${s(4)} ${s(5)};
|
|
478
|
+
border-radius: ${t.radiusLg};
|
|
479
|
+
border-inline-start: 4px solid;
|
|
480
|
+
box-shadow: inset 0 0 0 1px ${t.hairline};
|
|
481
|
+
font-size: ${g("sm")};
|
|
482
|
+
line-height: 1.5;
|
|
483
|
+
}
|
|
484
|
+
.heading {
|
|
485
|
+
font-weight: ${m("semibold")};
|
|
486
|
+
margin-block-end: ${s(1)};
|
|
487
|
+
}
|
|
488
|
+
:host([tone='info']) .alert {
|
|
489
|
+
background: ${t.infoSubtle};
|
|
490
|
+
border-color: ${t.info};
|
|
491
|
+
color: ${t.text};
|
|
492
|
+
}
|
|
493
|
+
:host([tone='success']) .alert {
|
|
494
|
+
background: ${t.successSubtle};
|
|
495
|
+
border-color: ${t.success};
|
|
496
|
+
color: ${t.text};
|
|
497
|
+
}
|
|
498
|
+
:host([tone='warning']) .alert {
|
|
499
|
+
background: ${t.warningSubtle};
|
|
500
|
+
border-color: ${t.warning};
|
|
501
|
+
color: ${t.text};
|
|
502
|
+
}
|
|
503
|
+
:host([tone='danger']) .alert {
|
|
504
|
+
background: ${t.dangerSubtle};
|
|
505
|
+
border-color: ${t.danger};
|
|
506
|
+
color: ${t.text};
|
|
507
|
+
}
|
|
508
|
+
/* Colour is the only signal left in forced-colours mode, and it is gone.
|
|
509
|
+
The border keeps the boundary; the tone word in the label carries the
|
|
510
|
+
meaning. */
|
|
511
|
+
@media (forced-colors: active) {
|
|
512
|
+
.alert {
|
|
513
|
+
border: 1px solid CanvasText;
|
|
514
|
+
border-inline-start-width: 4px;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
`]}render(){let e=this.toneLabel||x(a.TONE_WORDS[this.tone]);return o`
|
|
518
|
+
<div
|
|
519
|
+
class="alert"
|
|
520
|
+
part="alert"
|
|
521
|
+
role=${this.tone==="danger"?"alert":"status"}
|
|
522
|
+
aria-label=${this.heading?l:e}
|
|
523
|
+
>
|
|
524
|
+
${this.heading?o`<div class="heading" part="heading">
|
|
525
|
+
<span class="tone-word">${e}:</span> ${this.heading}
|
|
526
|
+
</div>`:l}
|
|
527
|
+
<slot></slot>
|
|
528
|
+
</div>
|
|
529
|
+
`}};customElements.define("impakt-alert",ye);var xe=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,R,p`
|
|
530
|
+
:host {
|
|
531
|
+
display: flex;
|
|
532
|
+
flex-direction: column;
|
|
533
|
+
}
|
|
534
|
+
:host([gap='none']) { gap: 0; }
|
|
535
|
+
:host([gap='xs']) { gap: ${s(1)}; }
|
|
536
|
+
:host([align='start']) { align-items: flex-start; }
|
|
537
|
+
:host([align='center']) { align-items: center; text-align: center; }
|
|
538
|
+
:host([align='end']) { align-items: flex-end; }
|
|
539
|
+
:host([direction='horizontal']) { flex-direction: row; flex-wrap: wrap; align-items: center; }
|
|
540
|
+
:host([direction='horizontal'][align='start']) { align-items: flex-start; }
|
|
541
|
+
:host([direction='horizontal'][align='end']) { align-items: flex-end; }
|
|
542
|
+
:host([direction='horizontal'][align='center']) { text-align: start; }
|
|
543
|
+
:host([justify='center']) { justify-content: center; }
|
|
544
|
+
:host([justify='end']) { justify-content: flex-end; }
|
|
545
|
+
:host([justify='between']) { justify-content: space-between; }
|
|
546
|
+
:host([gap='sm']) { gap: ${s(2)}; }
|
|
547
|
+
:host([gap='md']) { gap: ${s(4)}; }
|
|
548
|
+
:host([gap='lg']) { gap: ${s(6)}; }
|
|
549
|
+
:host([gap='xl']) { gap: ${s(8)}; }
|
|
550
|
+
`]}render(){return o`<slot></slot>`}},ke=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,R,p`
|
|
551
|
+
:host {
|
|
552
|
+
display: flex;
|
|
553
|
+
flex-direction: column;
|
|
554
|
+
background: ${t.surfaceCard};
|
|
555
|
+
border: ${t.borderThin} solid ${t.hairline};
|
|
556
|
+
border-radius: ${t.radiusXl};
|
|
557
|
+
box-shadow: ${t.shadowSm};
|
|
558
|
+
overflow: hidden;
|
|
559
|
+
--ratio: 16 / 9;
|
|
560
|
+
}
|
|
561
|
+
:host([tone='subtle']) { background: ${t.surfaceSubtle}; border-color: transparent; box-shadow: none; }
|
|
562
|
+
:host([tone='brand']) { background: ${t.brand}; border-color: transparent; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; }
|
|
563
|
+
:host([tone='outline']) { background: transparent; box-shadow: none; border-color: ${t.rule}; }
|
|
564
|
+
: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: ${t.radius2xl}; }
|
|
565
|
+
:host([tone='plain']) { background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; }
|
|
566
|
+
:host([ratio='4:3']) { --ratio: 4 / 3; }
|
|
567
|
+
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
568
|
+
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
569
|
+
.body { padding: ${s(6)}; flex: 1; display: flex; flex-direction: column; }
|
|
570
|
+
:host([padding='none']) .body { padding: 0; }
|
|
571
|
+
:host([padding='sm']) .body { padding: ${s(3)}; }
|
|
572
|
+
:host([padding='md']) .body { padding: ${s(4)}; }
|
|
573
|
+
:host([tone='plain']) .body { padding-inline: 0; }
|
|
574
|
+
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
575
|
+
.picture { position: relative; }
|
|
576
|
+
.tag { position: absolute; inset-block-start: ${s(4)}; inset-inline-start: ${s(4)}; padding: ${s(1.5)} ${s(3)}; font-size: ${g("sm")}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: 999px; }
|
|
577
|
+
@media (forced-colors: active) { :host { border-color: CanvasText; } }
|
|
578
|
+
`]}render(){return o`${this.imageSrc?o`<div class="picture"><img src=${this.imageSrc} alt=${this.imageAlt} part="image" />${this.badge?o`<span class="tag">${this.badge}</span>`:l}</div>`:l}<div class="body" part="body"><slot></slot></div>`}},ve=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,p`
|
|
579
|
+
:host {
|
|
580
|
+
display: block;
|
|
581
|
+
color: ${t.textHeading};
|
|
582
|
+
font-family: ${t.fontHeading};
|
|
583
|
+
font-weight: ${m("bold")};
|
|
584
|
+
line-height: ${C("tight")};
|
|
585
|
+
}
|
|
586
|
+
:host([size='5xl']) { ${b("5xl")} letter-spacing: ${t.trackingTight}; }
|
|
587
|
+
:host([size='4xl']) { ${b("4xl")} letter-spacing: ${t.trackingTight}; }
|
|
588
|
+
:host([size='3xl']) { ${b("3xl")} letter-spacing: ${t.trackingTight}; }
|
|
589
|
+
:host([size='2xl']) { ${b("2xl")} letter-spacing: ${t.trackingTight}; }
|
|
590
|
+
:host([size='xl']) { ${b("xl")} }
|
|
591
|
+
:host([size='lg']) { ${b("lg")} }
|
|
592
|
+
:host([size='md']) { ${b("md")} }
|
|
593
|
+
:host([size='sm']) { ${b("sm")} }
|
|
594
|
+
.h { text-wrap: balance; }
|
|
595
|
+
.h {
|
|
596
|
+
margin: 0;
|
|
597
|
+
font: inherit;
|
|
598
|
+
color: inherit;
|
|
599
|
+
}
|
|
600
|
+
:host([align='center']) { text-align: center; }
|
|
601
|
+
/* Only the words go: an eyebrow over a heading drawn as a picture still shows. */
|
|
602
|
+
:host([screen-reader-only]) .words { ${E} }
|
|
603
|
+
:host([screen-reader-only]:not([eyebrow])) { ${E} }
|
|
604
|
+
.eyebrow {
|
|
605
|
+
display: block;
|
|
606
|
+
margin-block-end: ${s(2)};
|
|
607
|
+
color: var(--impakt-eyebrow, var(--impakt-color-text-eyebrow, ${t.brand}));
|
|
608
|
+
font-family: var(--impakt-font-family-eyebrow, ${t.fontBody});
|
|
609
|
+
font-size: var(--impakt-font-size-eyebrow, ${g("sm")});
|
|
610
|
+
font-weight: var(--impakt-font-weight-eyebrow, ${m("semibold")});
|
|
611
|
+
letter-spacing: 0.06em;
|
|
612
|
+
text-transform: uppercase;
|
|
613
|
+
}
|
|
614
|
+
`]}render(){return o`<div class="h" role="heading" aria-level=${this.level} part="heading">
|
|
615
|
+
${this.eyebrow?o`<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>
|
|
616
|
+
</div>`}},we=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,p`
|
|
617
|
+
:host {
|
|
618
|
+
display: block;
|
|
619
|
+
/* 1.4.8 asks for 1.5 within a paragraph, and it is the default here
|
|
620
|
+
rather than an option, because body text is what it is about. */
|
|
621
|
+
line-height: ${C("normal")};
|
|
622
|
+
/* 1.4.12 Text Spacing: a user stylesheet must be able to widen this
|
|
623
|
+
without clipping, which a max-width in ch units survives and a
|
|
624
|
+
fixed pixel height does not. */
|
|
625
|
+
max-inline-size: 70ch;
|
|
626
|
+
}
|
|
627
|
+
:host([size='sm']) { ${b("sm")} }
|
|
628
|
+
:host([size='md']) { ${b("md")} }
|
|
629
|
+
:host([size='lg']) { ${b("lg")} }
|
|
630
|
+
:host([size='xl']) { ${b("xl")} }
|
|
631
|
+
p { text-wrap: pretty; }
|
|
632
|
+
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
633
|
+
:host([align='center']) { text-align: center; margin-inline: auto; }
|
|
634
|
+
:host([look='code']) { font-family: ${t.fontMono}; ${b("sm")} padding: ${s(2)} ${s(3)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 6%, transparent); max-inline-size: none; }
|
|
635
|
+
p {
|
|
636
|
+
margin: 0;
|
|
637
|
+
}
|
|
638
|
+
`]}render(){return o`<p part="text"><slot></slot></p>`}};customElements.define("impakt-stack",xe);customElements.define("impakt-card",ke);customElements.define("impakt-heading",ve);customElements.define("impakt-text",we);var Se=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,v,p`
|
|
639
|
+
:host {
|
|
640
|
+
display: inline;
|
|
641
|
+
}
|
|
642
|
+
a {
|
|
643
|
+
color: ${t.link};
|
|
644
|
+
text-decoration: underline;
|
|
645
|
+
text-underline-offset: 0.2em;
|
|
646
|
+
border-radius: ${t.radiusSm};
|
|
647
|
+
}
|
|
648
|
+
a:hover {
|
|
649
|
+
color: ${t.linkHover};
|
|
650
|
+
}
|
|
651
|
+
:host([variant='standalone']) { display: inline-block; }
|
|
652
|
+
:host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${s(1)}; font-weight: ${m("semibold")}; text-decoration-thickness: 1px; }
|
|
653
|
+
:host([variant='standalone']) a:hover .icon { transform: translateX(2px); }
|
|
654
|
+
.icon { flex: none; transition: transform 120ms ease-in-out; }
|
|
655
|
+
.sr-only {
|
|
656
|
+
${E}
|
|
657
|
+
}
|
|
658
|
+
`]}render(){return o`
|
|
659
|
+
<a
|
|
660
|
+
part="link"
|
|
661
|
+
href=${this.href||l}
|
|
662
|
+
target=${this.external?"_blank":l}
|
|
663
|
+
rel=${this.external?"noopener noreferrer":l}
|
|
664
|
+
>
|
|
665
|
+
<slot></slot>${z(this.icon!=="none"?this.icon:this.variant==="standalone"?this.external?"external":"arrow-right":void 0,"1em")}${this.external?o`<span class="sr-only"> (${this.externalText})</span>`:l}
|
|
666
|
+
</a>
|
|
667
|
+
`}};customElements.define("impakt-link",Se);var Te=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,p`
|
|
668
|
+
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
669
|
+
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
670
|
+
:host {
|
|
671
|
+
display: block;
|
|
672
|
+
}
|
|
673
|
+
img {
|
|
674
|
+
display: block;
|
|
675
|
+
max-inline-size: 100%;
|
|
676
|
+
block-size: auto;
|
|
677
|
+
object-fit: cover;
|
|
678
|
+
}
|
|
679
|
+
:host(:not([ratio='natural'])) img { inline-size: 100%; }
|
|
680
|
+
:host([ratio='16:9']) img { aspect-ratio: 16 / 9; }
|
|
681
|
+
:host([ratio='4:3']) img { aspect-ratio: 4 / 3; }
|
|
682
|
+
:host([ratio='3:2']) img { aspect-ratio: 3 / 2; }
|
|
683
|
+
:host([ratio='1:1']) img { aspect-ratio: 1 / 1; }
|
|
684
|
+
:host([rounded='sm']) img { border-radius: ${t.radius}; }
|
|
685
|
+
:host([rounded='lg']) img { border-radius: ${t.radiusLg}; }
|
|
686
|
+
:host([rounded='full']) img { border-radius: 50%; }
|
|
687
|
+
`]}render(){return o`
|
|
688
|
+
<img
|
|
689
|
+
part="image"
|
|
690
|
+
src=${this.src}
|
|
691
|
+
alt=${this.decorative?"":this.alt}
|
|
692
|
+
role=${this.decorative?"presentation":l}
|
|
693
|
+
width=${this.width??l}
|
|
694
|
+
height=${this.height??l}
|
|
695
|
+
loading=${this.loading}
|
|
696
|
+
style="object-position: ${this.focalX*100}% ${this.focalY*100}%"
|
|
697
|
+
/>
|
|
698
|
+
`}},ze=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,p`
|
|
699
|
+
:host {
|
|
700
|
+
display: inline-block;
|
|
701
|
+
}
|
|
702
|
+
img {
|
|
703
|
+
display: block;
|
|
704
|
+
inline-size: auto;
|
|
705
|
+
}
|
|
706
|
+
`]}render(){let e=this.onDark&&this.srcDark?this.srcDark:this.src;return o`<img part="logo" src=${e} alt=${this.alt} style="height: ${this.height}px" />`}},Ee=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,p`
|
|
707
|
+
:host {
|
|
708
|
+
display: block;
|
|
709
|
+
}
|
|
710
|
+
a {
|
|
711
|
+
color: ${t.link};
|
|
712
|
+
text-decoration: underline;
|
|
713
|
+
text-underline-offset: 0.2em;
|
|
714
|
+
display: inline-flex;
|
|
715
|
+
gap: 0.5ch;
|
|
716
|
+
align-items: baseline;
|
|
717
|
+
min-block-size: ${t.targetMin};
|
|
718
|
+
}
|
|
719
|
+
.meta {
|
|
720
|
+
color: ${t.textMuted};
|
|
721
|
+
}
|
|
722
|
+
`]}get size(){if(!this.byteSize)return"";let e=this.byteSize/1024;return e>=1024?`${(e/1024).toFixed(1)} MB`:`${Math.round(e)} KB`}render(){let e=[this.fileType,this.size].filter(Boolean).join(", ");return o`
|
|
723
|
+
<a part="link" href=${this.href||l} download>
|
|
724
|
+
<span>${this.label}</span>${e?o`<span class="meta">(${e})</span>`:l}
|
|
725
|
+
</a>
|
|
726
|
+
`}};customElements.define("impakt-image",Te);customElements.define("impakt-logo",ze);customElements.define("impakt-document-link",Ee);function I(a){let e=a?.closest?.("[lang]")?.getAttribute("lang"),i=!e&&a?a.getRootNode?.()?.host?.closest?.("[lang]")?.getAttribute("lang")??"":"",r=typeof document<"u"?document.documentElement.lang:"",n=(e||i||r||"").trim();return!n||n.toLowerCase()==="en"?"en-GB":n}var Me=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,p`
|
|
727
|
+
:host {
|
|
728
|
+
display: inline-flex;
|
|
729
|
+
align-items: baseline;
|
|
730
|
+
gap: ${s(1)};
|
|
731
|
+
color: ${t.text};
|
|
732
|
+
}
|
|
733
|
+
.amount {
|
|
734
|
+
font-family: ${t.fontHeading};
|
|
735
|
+
font-weight: ${m("bold")};
|
|
736
|
+
/* Tabular figures so a price does not reflow as the digits change,
|
|
737
|
+
which otherwise makes a recalculating price jitter. */
|
|
738
|
+
font-variant-numeric: tabular-nums;
|
|
739
|
+
}
|
|
740
|
+
:host([size='md']) .amount { font-size: ${g("lg")}; }
|
|
741
|
+
:host([size='lg']) .amount { font-size: ${g("2xl")}; }
|
|
742
|
+
:host([size='xl']) .amount { font-size: ${g("3xl")}; }
|
|
743
|
+
.period {
|
|
744
|
+
font-size: ${g("sm")};
|
|
745
|
+
color: ${t.textMuted};
|
|
746
|
+
}
|
|
747
|
+
`]}get formatted(){if(this.amount===void 0||Number.isNaN(this.amount))return this.pending;try{return new Intl.NumberFormat(this.locale||I(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 o`
|
|
748
|
+
${this.prefix?o`<span class="period" part="prefix">${this.prefix}</span>`:l}
|
|
749
|
+
<span class="amount" part="amount">${this.formatted}</span>
|
|
750
|
+
${this.period?o`<span class="period" part="period">${this.period}</span>`:l}
|
|
751
|
+
`}};customElements.define("impakt-price",Me);var Ae=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,v,M("dd a"),p`
|
|
752
|
+
:host {
|
|
753
|
+
display: block;
|
|
754
|
+
}
|
|
755
|
+
dl {
|
|
756
|
+
margin: 0;
|
|
757
|
+
display: grid;
|
|
758
|
+
grid-template-columns: minmax(8rem, 1fr) 2fr;
|
|
759
|
+
}
|
|
760
|
+
/* A <dl> group may hold only dt and dd — not a third sibling — so the
|
|
761
|
+
action lives inside the value it changes, which is also where it
|
|
762
|
+
belongs semantically. The row uses display:contents so both cells stay
|
|
763
|
+
in the parent grid. */
|
|
764
|
+
.row {
|
|
765
|
+
display: contents;
|
|
766
|
+
}
|
|
767
|
+
dt,
|
|
768
|
+
dd {
|
|
769
|
+
padding: ${s(3)} 0;
|
|
770
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
771
|
+
}
|
|
772
|
+
dt {
|
|
773
|
+
font-weight: ${m("semibold")};
|
|
774
|
+
font-size: ${g("sm")};
|
|
775
|
+
}
|
|
776
|
+
dd {
|
|
777
|
+
margin: 0;
|
|
778
|
+
display: flex;
|
|
779
|
+
align-items: baseline;
|
|
780
|
+
justify-content: space-between;
|
|
781
|
+
gap: ${s(3)};
|
|
782
|
+
}
|
|
783
|
+
dd a {
|
|
784
|
+
flex: none;
|
|
785
|
+
color: ${t.link};
|
|
786
|
+
text-decoration: underline;
|
|
787
|
+
text-underline-offset: 0.2em;
|
|
788
|
+
display: inline-flex;
|
|
789
|
+
align-items: center;
|
|
790
|
+
min-block-size: ${t.targetMin};
|
|
791
|
+
}
|
|
792
|
+
.sr-only {
|
|
793
|
+
position: absolute;
|
|
794
|
+
inline-size: 1px;
|
|
795
|
+
block-size: 1px;
|
|
796
|
+
margin: -1px;
|
|
797
|
+
overflow: hidden;
|
|
798
|
+
clip-path: inset(50%);
|
|
799
|
+
white-space: nowrap;
|
|
800
|
+
}
|
|
801
|
+
/* One column on a narrow screen. 1.4.10 Reflow: two columns at 320px
|
|
802
|
+
forces horizontal scrolling, and a summary is read, not scanned
|
|
803
|
+
across. */
|
|
804
|
+
@media (max-width: 30rem) {
|
|
805
|
+
dl {
|
|
806
|
+
grid-template-columns: 1fr;
|
|
807
|
+
}
|
|
808
|
+
dt {
|
|
809
|
+
border-block-end: 0;
|
|
810
|
+
padding-block-end: 0;
|
|
811
|
+
}
|
|
812
|
+
dd {
|
|
813
|
+
padding-block-start: 0;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
`]}render(){return o`
|
|
817
|
+
<dl part="list">
|
|
818
|
+
${this.rows.map(e=>o`
|
|
819
|
+
<div class="row" part="row">
|
|
820
|
+
<dt part="key">${e.key}</dt>
|
|
821
|
+
<dd part="value">
|
|
822
|
+
<span>${e.value}</span>
|
|
823
|
+
${e.changeHref?o`<a href=${e.changeHref} part="action"
|
|
824
|
+
>${this.changeText}<span class="sr-only"> ${e.key}</span></a
|
|
825
|
+
>`:l}
|
|
826
|
+
</dd>
|
|
827
|
+
</div>
|
|
828
|
+
`)}
|
|
829
|
+
</dl>
|
|
830
|
+
`}};customElements.define("impakt-summary-list",Ae);var Re=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,v,M(".sort, .pick label"),p`
|
|
831
|
+
:host {
|
|
832
|
+
display: block;
|
|
833
|
+
}
|
|
834
|
+
:host([stack]) {
|
|
835
|
+
container-type: inline-size;
|
|
836
|
+
}
|
|
837
|
+
.scroller {
|
|
838
|
+
overflow-x: auto;
|
|
839
|
+
}
|
|
840
|
+
table {
|
|
841
|
+
inline-size: 100%;
|
|
842
|
+
border-collapse: collapse;
|
|
843
|
+
font-size: ${g("md")};
|
|
844
|
+
}
|
|
845
|
+
caption {
|
|
846
|
+
text-align: start;
|
|
847
|
+
font-weight: ${m("semibold")};
|
|
848
|
+
padding-block-end: ${s(2)};
|
|
849
|
+
}
|
|
850
|
+
th,
|
|
851
|
+
td {
|
|
852
|
+
text-align: start;
|
|
853
|
+
padding: ${s(3)};
|
|
854
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
855
|
+
}
|
|
856
|
+
thead th {
|
|
857
|
+
font-weight: ${m("semibold")};
|
|
858
|
+
background: ${t.surfaceInset};
|
|
859
|
+
}
|
|
860
|
+
tbody th {
|
|
861
|
+
font-weight: ${m("semibold")};
|
|
862
|
+
}
|
|
863
|
+
.numeric {
|
|
864
|
+
/* A figure read across a line break is a different figure. */
|
|
865
|
+
white-space: nowrap;
|
|
866
|
+
text-align: end;
|
|
867
|
+
font-variant-numeric: tabular-nums;
|
|
868
|
+
}
|
|
869
|
+
th.sortable {
|
|
870
|
+
padding: ${s(1)};
|
|
871
|
+
}
|
|
872
|
+
.sort {
|
|
873
|
+
display: inline-flex;
|
|
874
|
+
align-items: center;
|
|
875
|
+
gap: ${s(1)};
|
|
876
|
+
min-block-size: ${t.targetMin};
|
|
877
|
+
padding: ${s(2)};
|
|
878
|
+
font: inherit;
|
|
879
|
+
color: inherit;
|
|
880
|
+
background: none;
|
|
881
|
+
border: 0;
|
|
882
|
+
border-radius: ${t.radius};
|
|
883
|
+
cursor: pointer;
|
|
884
|
+
}
|
|
885
|
+
.sort:hover {
|
|
886
|
+
background: ${t.wash};
|
|
887
|
+
}
|
|
888
|
+
.numeric .sort {
|
|
889
|
+
flex-direction: row-reverse;
|
|
890
|
+
}
|
|
891
|
+
.arrow {
|
|
892
|
+
display: inline-flex;
|
|
893
|
+
color: ${t.textMuted};
|
|
894
|
+
transition: transform 140ms ease-in-out;
|
|
895
|
+
}
|
|
896
|
+
[aria-sort] .arrow {
|
|
897
|
+
color: inherit;
|
|
898
|
+
}
|
|
899
|
+
[aria-sort='ascending'] .arrow {
|
|
900
|
+
transform: rotate(180deg);
|
|
901
|
+
}
|
|
902
|
+
:not([aria-sort]) > .sort .arrow {
|
|
903
|
+
opacity: 0.45;
|
|
904
|
+
}
|
|
905
|
+
.pick {
|
|
906
|
+
inline-size: 1%;
|
|
907
|
+
padding-block: 0;
|
|
908
|
+
padding-inline-end: 0;
|
|
909
|
+
}
|
|
910
|
+
.pick label {
|
|
911
|
+
display: inline-flex;
|
|
912
|
+
align-items: center;
|
|
913
|
+
justify-content: center;
|
|
914
|
+
min-block-size: ${t.targetMin};
|
|
915
|
+
min-inline-size: ${t.targetMin};
|
|
916
|
+
cursor: pointer;
|
|
917
|
+
}
|
|
918
|
+
.pick input {
|
|
919
|
+
inline-size: 20px;
|
|
920
|
+
block-size: 20px;
|
|
921
|
+
margin: 0;
|
|
922
|
+
accent-color: ${t.brand};
|
|
923
|
+
cursor: pointer;
|
|
924
|
+
}
|
|
925
|
+
tr.chosen > * {
|
|
926
|
+
background: ${t.brandSubtle};
|
|
927
|
+
}
|
|
928
|
+
.empty {
|
|
929
|
+
padding-block: ${s(6)};
|
|
930
|
+
text-align: center;
|
|
931
|
+
color: ${t.textMuted};
|
|
932
|
+
}
|
|
933
|
+
.label {
|
|
934
|
+
display: none;
|
|
935
|
+
}
|
|
936
|
+
.visually-hidden {
|
|
937
|
+
${E}
|
|
938
|
+
}
|
|
939
|
+
/* Stacked: each row a card, each value under its column's name. */
|
|
940
|
+
@container (max-width: 36rem) {
|
|
941
|
+
table, tbody, tr, tbody th, tbody td {
|
|
942
|
+
display: block;
|
|
943
|
+
}
|
|
944
|
+
thead tr {
|
|
945
|
+
display: flex;
|
|
946
|
+
flex-wrap: wrap;
|
|
947
|
+
align-items: center;
|
|
948
|
+
gap: ${s(1)};
|
|
949
|
+
margin-block-end: ${s(3)};
|
|
950
|
+
}
|
|
951
|
+
thead th {
|
|
952
|
+
display: none;
|
|
953
|
+
padding: 0;
|
|
954
|
+
border: 0;
|
|
955
|
+
background: none;
|
|
956
|
+
}
|
|
957
|
+
thead th.sortable, thead th.pick {
|
|
958
|
+
display: block;
|
|
959
|
+
inline-size: auto;
|
|
960
|
+
}
|
|
961
|
+
thead .sort {
|
|
962
|
+
border: ${t.borderThin} solid ${t.rule};
|
|
963
|
+
border-radius: 999px;
|
|
964
|
+
padding-inline: ${s(3)};
|
|
965
|
+
background: ${t.surfaceCard};
|
|
966
|
+
}
|
|
967
|
+
tbody tr {
|
|
968
|
+
position: relative;
|
|
969
|
+
margin-block-end: ${s(3)};
|
|
970
|
+
padding: ${s(3)} ${s(4)};
|
|
971
|
+
border: ${t.borderThin} solid ${t.rule};
|
|
972
|
+
border-radius: ${t.radiusXl};
|
|
973
|
+
background: ${t.surfaceCard};
|
|
974
|
+
}
|
|
975
|
+
tbody tr.chosen {
|
|
976
|
+
background: ${t.brandSubtle};
|
|
977
|
+
}
|
|
978
|
+
tr.chosen > * {
|
|
979
|
+
background: none;
|
|
980
|
+
}
|
|
981
|
+
tbody th, tbody td {
|
|
982
|
+
display: grid;
|
|
983
|
+
grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
|
|
984
|
+
gap: ${s(3)};
|
|
985
|
+
padding: ${s(1.5)} 0;
|
|
986
|
+
border: 0;
|
|
987
|
+
text-align: start;
|
|
988
|
+
white-space: normal;
|
|
989
|
+
}
|
|
990
|
+
tbody td.numeric {
|
|
991
|
+
text-align: start;
|
|
992
|
+
}
|
|
993
|
+
tbody .pick {
|
|
994
|
+
display: block;
|
|
995
|
+
position: absolute;
|
|
996
|
+
inset-block-start: ${s(1)};
|
|
997
|
+
inset-inline-end: ${s(1)};
|
|
998
|
+
inline-size: auto;
|
|
999
|
+
padding: 0;
|
|
1000
|
+
}
|
|
1001
|
+
tbody tr:has(.pick) > th {
|
|
1002
|
+
padding-inline-end: ${s(10)};
|
|
1003
|
+
}
|
|
1004
|
+
.label {
|
|
1005
|
+
display: block;
|
|
1006
|
+
font-size: ${g("sm")};
|
|
1007
|
+
font-weight: ${m("semibold")};
|
|
1008
|
+
color: ${t.textMuted};
|
|
1009
|
+
}
|
|
1010
|
+
.empty {
|
|
1011
|
+
display: block;
|
|
1012
|
+
border: 0;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
`]}keyOf(e,i){let r=e?.[this.rowKey];return r==null||r===""?String(i):String(r)}ordered(){let e=(this.rows??[]).map((h,y)=>({row:h,key:this.keyOf(h,y)})),i=(this.columns??[]).find(h=>h.key===this.sortKey&&h.sortable);if(!i||this.manualSort)return e;let r=this.sortDirection==="descending"?-1:1,n=I(this),d=h=>Number(String(h??"").replace(/[^\d.-]/g,""))||0;return e.sort((h,y)=>{let $=h.row[i.key]??"",w=y.row[i.key]??"";return(i.numeric?d($)-d(w):String($).localeCompare(String(w),n,{numeric:!0,sensitivity:"base"}))*r})}sortBy(e){let i=this.sortKey===e&&this.sortDirection==="ascending"?"descending":"ascending";this.sortKey=e,this.sortDirection=i,this.dispatchEvent(new CustomEvent("impakt-sort",{detail:{key:e,direction:i},bubbles:!0,composed:!0}))}choose(e,i){let r=new Set(this.selected??[]);for(let n of e)i?r.add(n):r.delete(n);this.selected=[...r],this.dispatchEvent(new CustomEvent("impakt-selection",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}heading(e){let i=e.sortable&&e.key===this.sortKey,r=[e.numeric?"numeric":"",e.sortable?"sortable":""].filter(Boolean).join(" ");return e.sortable?o`<th scope="col" role="columnheader" class=${r} aria-sort=${i?this.sortDirection:l}>
|
|
1016
|
+
<button class="sort" type="button" part="sort" @click=${()=>this.sortBy(e.key)}>${e.label}<span class="arrow" aria-hidden="true">${z("chevron-down","16px")}</span></button>
|
|
1017
|
+
</th>`:o`<th scope="col" role="columnheader" class=${r}>${e.label}</th>`}render(){let e=this.columns??[],i=this.ordered(),r=new Set(this.selected??[]),n=i.length>0&&i.every(h=>r.has(h.key)),d=!n&&i.some(h=>r.has(h.key));return o`
|
|
1018
|
+
<div class="scroller" part="scroller" tabindex="0" role="region" aria-label=${this.caption||l}>
|
|
1019
|
+
<table part="table" role="table">
|
|
1020
|
+
${this.caption?o`<caption part="caption">${this.caption}</caption>`:l}
|
|
1021
|
+
<thead role="rowgroup">
|
|
1022
|
+
<tr role="row">
|
|
1023
|
+
${this.selectable?o`<th scope="col" role="columnheader" class="pick"><label><input type="checkbox" aria-label=${this.selectAllText} .checked=${n} .indeterminate=${d} ?disabled=${!i.length}
|
|
1024
|
+
@change=${h=>this.choose(i.map(y=>y.key),h.target.checked)} /></label></th>`:l}
|
|
1025
|
+
${e.map(h=>this.heading(h))}
|
|
1026
|
+
</tr>
|
|
1027
|
+
</thead>
|
|
1028
|
+
<tbody role="rowgroup">
|
|
1029
|
+
${i.length?i.map(({row:h,key:y},$)=>o`
|
|
1030
|
+
<tr role="row" class=${r.has(y)?"chosen":""} part="row">
|
|
1031
|
+
${this.selectable?o`<td role="cell" class="pick"><label><input type="checkbox" aria-label=${this.selectRowText.replace("{row}",String(h[e[0]?.key??""]??y))} .checked=${r.has(y)}
|
|
1032
|
+
@change=${w=>this.choose([y],w.target.checked)} /></label></td>`:l}
|
|
1033
|
+
${e.map((w,A)=>{let S=o`<span class="label" aria-hidden="true">${w.label}</span><span class="value"><slot name=${`cell:${y}:${w.key}`}>${h[w.key]??""}</slot></span>`;return A===0?o`<th scope="row" role="rowheader" id=${`${this.uid}-r${$}`}>${S}</th>`:o`<td role="cell" class=${w.numeric?"numeric":""}>${S}</td>`})}
|
|
1034
|
+
</tr>
|
|
1035
|
+
`):o`<tr role="row"><td role="cell" class="empty" colspan=${e.length+(this.selectable?1:0)||1}><slot name="empty">${this.emptyText}</slot></td></tr>`}
|
|
1036
|
+
</tbody>
|
|
1037
|
+
</table>
|
|
1038
|
+
</div>
|
|
1039
|
+
`}};customElements.define("impakt-table",Re);var _e=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,v,p`
|
|
1040
|
+
:host {
|
|
1041
|
+
display: block;
|
|
1042
|
+
}
|
|
1043
|
+
.item {
|
|
1044
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
1045
|
+
}
|
|
1046
|
+
button {
|
|
1047
|
+
${T}
|
|
1048
|
+
display: flex;
|
|
1049
|
+
align-items: center;
|
|
1050
|
+
justify-content: space-between;
|
|
1051
|
+
gap: ${s(3)};
|
|
1052
|
+
inline-size: 100%;
|
|
1053
|
+
padding: ${s(3)} 0;
|
|
1054
|
+
background: none;
|
|
1055
|
+
border: 0;
|
|
1056
|
+
font: inherit;
|
|
1057
|
+
font-size: ${g("md")};
|
|
1058
|
+
font-weight: ${m("semibold")};
|
|
1059
|
+
color: ${t.text};
|
|
1060
|
+
text-align: start;
|
|
1061
|
+
cursor: pointer;
|
|
1062
|
+
}
|
|
1063
|
+
button:hover {
|
|
1064
|
+
color: ${t.link};
|
|
1065
|
+
}
|
|
1066
|
+
.marker {
|
|
1067
|
+
flex: none;
|
|
1068
|
+
transition: transform 120ms ease-in-out;
|
|
1069
|
+
}
|
|
1070
|
+
button[aria-expanded='true'] .marker {
|
|
1071
|
+
transform: rotate(90deg);
|
|
1072
|
+
}
|
|
1073
|
+
.panel {
|
|
1074
|
+
padding-block-end: ${s(4)};
|
|
1075
|
+
font-size: ${g("md")};
|
|
1076
|
+
}
|
|
1077
|
+
`]}toggle(e){this.open.includes(e)?this.open=this.open.filter(r=>r!==e):this.open=this.multiple?[...this.open,e]:[e]}render(){return o`
|
|
1078
|
+
${this.items.map(e=>{let i=this.open.includes(e.id),r=this.id_(`panel-${e.id}`),n=this.id_(`button-${e.id}`);return o`
|
|
1079
|
+
<div class="item" part="item">
|
|
1080
|
+
<div role="heading" aria-level=${this.headingLevel}>
|
|
1081
|
+
<button
|
|
1082
|
+
id=${n}
|
|
1083
|
+
part="header"
|
|
1084
|
+
type="button"
|
|
1085
|
+
aria-expanded=${i?"true":"false"}
|
|
1086
|
+
aria-controls=${r}
|
|
1087
|
+
@click=${()=>this.toggle(e.id)}
|
|
1088
|
+
>
|
|
1089
|
+
<span>${e.heading}</span>
|
|
1090
|
+
<span class="marker" aria-hidden="true">›</span>
|
|
1091
|
+
</button>
|
|
1092
|
+
</div>
|
|
1093
|
+
<div
|
|
1094
|
+
id=${r}
|
|
1095
|
+
class="panel"
|
|
1096
|
+
part="panel"
|
|
1097
|
+
role="region"
|
|
1098
|
+
aria-labelledby=${n}
|
|
1099
|
+
?hidden=${!i}
|
|
1100
|
+
>
|
|
1101
|
+
<slot name=${`panel-${e.id}`}>${e.body}</slot>
|
|
1102
|
+
</div>
|
|
1103
|
+
</div>
|
|
1104
|
+
`})}
|
|
1105
|
+
${this.items.length===0?l:l}
|
|
1106
|
+
`}};customElements.define("impakt-accordion",_e);var Ce=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,p`
|
|
1107
|
+
:host {
|
|
1108
|
+
display: block;
|
|
1109
|
+
margin-block-end: ${s(5)};
|
|
1110
|
+
}
|
|
1111
|
+
ol {
|
|
1112
|
+
display: flex;
|
|
1113
|
+
gap: ${s(2)};
|
|
1114
|
+
list-style: none;
|
|
1115
|
+
margin: 0;
|
|
1116
|
+
padding: 0;
|
|
1117
|
+
}
|
|
1118
|
+
li {
|
|
1119
|
+
flex: 1;
|
|
1120
|
+
font-size: ${g("sm")};
|
|
1121
|
+
color: ${t.textMuted};
|
|
1122
|
+
padding-block-start: ${s(2)};
|
|
1123
|
+
border-block-start: 4px solid ${t.border};
|
|
1124
|
+
}
|
|
1125
|
+
li[data-state='done'] {
|
|
1126
|
+
color: ${t.text};
|
|
1127
|
+
border-block-start-color: ${t.brand};
|
|
1128
|
+
}
|
|
1129
|
+
li[data-state='current'] {
|
|
1130
|
+
color: ${t.text};
|
|
1131
|
+
font-weight: ${m("semibold")};
|
|
1132
|
+
border-block-start-color: ${t.brand};
|
|
1133
|
+
}
|
|
1134
|
+
.sr-only {
|
|
1135
|
+
${E}
|
|
1136
|
+
}
|
|
1137
|
+
/* Below 30rem the labels stop fitting; the position in words is the part
|
|
1138
|
+
that has to survive, so the list collapses to bars and the current
|
|
1139
|
+
step's name. */
|
|
1140
|
+
@media (max-width: 30rem) {
|
|
1141
|
+
li:not([data-state='current']) span:not(.sr-only) {
|
|
1142
|
+
${E}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
`]}render(){let e=this.steps.findIndex(i=>i.id===this.current);return o`
|
|
1146
|
+
<nav part="nav" aria-label=${this.label}>
|
|
1147
|
+
<ol part="list">
|
|
1148
|
+
${this.steps.map((i,r)=>{let n=r<e?"done":r===e?"current":"todo";return o`
|
|
1149
|
+
<li data-state=${n} aria-current=${n==="current"?"step":l}>
|
|
1150
|
+
${n==="current"?o`<span class="sr-only">${x("Step {step} of {steps}:",{step:r+1,steps:this.steps.length})} </span>`:l}
|
|
1151
|
+
<span>${i.label}</span>
|
|
1152
|
+
</li>
|
|
1153
|
+
`})}
|
|
1154
|
+
</ol>
|
|
1155
|
+
</nav>
|
|
1156
|
+
`}};customElements.define("impakt-progress",Ce);var ie={brand:"var(--impakt-color-brand-default, #1f4ed8)",accent:"var(--impakt-color-accent-default, #c8a15a)",info:"var(--impakt-color-status-info-default, #1f4ed8)",success:"var(--impakt-color-status-success-default, #047857)",warning:"var(--impakt-color-status-warning-default, #b45309)",danger:"var(--impakt-color-status-danger-default, #c8102e)"},re=["success","info","warning","accent","danger","brand"],wt=(a,e)=>typeof a=="number"?`var(--impakt-color-chart-${a}, ${ie[re[(a-1)%re.length]]})`:a&&a in ie?ie[a]:`var(--impakt-color-chart-${e%5+1}, ${ie[re[e%re.length]]})`;var pi=t.fontMono,Le=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,Kt,p`
|
|
1157
|
+
:host { display: inline-flex; flex: none; }
|
|
1158
|
+
span.chip { display: inline-flex; align-items: center; gap: ${s(1.5)}; padding: 3px ${s(2.5)}; border-radius: 999px; font-family: ${pi}; font-size: ${g("xs")}; line-height: 1.2; white-space: nowrap; }
|
|
1159
|
+
:host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }
|
|
1160
|
+
:host([look='outlined']) span.chip { border: ${t.borderThin} solid ${t.border}; background: ${t.surfaceCard}; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
1161
|
+
:host([look='plain']) span.chip { padding: 0; }
|
|
1162
|
+
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1163
|
+
svg { inline-size: 12px; block-size: 12px; }
|
|
1164
|
+
.meta { opacity: 0.72; text-transform: none; }
|
|
1165
|
+
:host([look='plain']) .label { opacity: 0.72; }
|
|
1166
|
+
`]}render(){let e=this.icon==="dot"?o`<span class="dot" aria-hidden="true"></span>`:this.icon==="branch"?o`<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 o`<span class="chip" part="chip" style=${`--tone:${wt(this.tone,0)}`}>${e}<span class="label">${this.label}</span>${this.meta?o` <span class="meta">${this.meta}</span>`:l}</span>`}};customElements.define("impakt-chip",Le);var Ie=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,p`
|
|
1167
|
+
:host { display: inline-flex; }
|
|
1168
|
+
span { display: inline-flex; align-items: center; gap: ${s(1)}; padding: ${s(.5)} ${s(2)}; border-radius: ${t.radius}; ${b("sm")} font-weight: ${m("medium")}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }
|
|
1169
|
+
:host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }
|
|
1170
|
+
:host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
1171
|
+
:host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }
|
|
1172
|
+
:host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
|
|
1173
|
+
:host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }
|
|
1174
|
+
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
1175
|
+
`]}render(){return o`<span part="badge">${z(this.icon,"1em")}<slot></slot></span>`}};customElements.define("impakt-badge",Ie);var He=class extends f{constructor(){super();this.filled=!1;this.filledText="";this.width="full",this.rows=4,this.maxlength=void 0,this.fillFrom="none"}static{this.properties={...f.properties,width:{type:String,reflect:!0},rows:{type:Number},maxlength:{type:Number},fillFrom:{type:String,attribute:"fill-from"}}}static{this.styles=[...f.styles,L,p`
|
|
1176
|
+
textarea {
|
|
1177
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
1178
|
+
padding: ${s(2.5)} ${s(3)};
|
|
1179
|
+
font-family: inherit;
|
|
1180
|
+
font-size: ${g("md")};
|
|
1181
|
+
color: ${t.text};
|
|
1182
|
+
background: var(--impakt-color-field-surface, ${t.surfaceCard});
|
|
1183
|
+
border: ${t.borderThin} solid ${t.border};
|
|
1184
|
+
border-radius: ${t.radiusLg};
|
|
1185
|
+
box-shadow: var(--impakt-shadow-field, ${t.shadowXs});
|
|
1186
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
1187
|
+
/* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text
|
|
1188
|
+
can be made bigger, and a fixed box is where that stops working. */
|
|
1189
|
+
resize: vertical;
|
|
1190
|
+
}
|
|
1191
|
+
textarea:hover:not(:disabled) {
|
|
1192
|
+
border-color: ${t.borderStrong};
|
|
1193
|
+
}
|
|
1194
|
+
textarea:focus-visible {
|
|
1195
|
+
border-color: ${t.brand};
|
|
1196
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
1197
|
+
}
|
|
1198
|
+
:host([invalid]) textarea {
|
|
1199
|
+
border-color: ${t.danger};
|
|
1200
|
+
border-width: ${t.borderThick};
|
|
1201
|
+
}
|
|
1202
|
+
`]}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 o`
|
|
1203
|
+
<textarea
|
|
1204
|
+
id=${this.controlId}
|
|
1205
|
+
part="textarea"
|
|
1206
|
+
name=${this.name||l}
|
|
1207
|
+
rows=${this.rows}
|
|
1208
|
+
maxlength=${this.maxlength??l}
|
|
1209
|
+
?disabled=${this.disabled}
|
|
1210
|
+
?readonly=${this.readonly}
|
|
1211
|
+
?required=${this.required}
|
|
1212
|
+
aria-describedby=${this.describedBy}
|
|
1213
|
+
aria-invalid=${this.error?"true":l}
|
|
1214
|
+
@input=${i=>{this.filledText="",this.setFormValue(i.target.value)}}
|
|
1215
|
+
>${this.value}</textarea>
|
|
1216
|
+
`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error),this.fill()}};customElements.define("impakt-textarea",He);var Be=class extends f{static{this.properties={...f.properties,options:{type:Array},values:{type:Array}}}constructor(){super(),this.options=[],this.values=[]}static{this.styles=[...f.styles,p`
|
|
1217
|
+
fieldset {
|
|
1218
|
+
border: 0;
|
|
1219
|
+
margin: 0;
|
|
1220
|
+
padding: 0;
|
|
1221
|
+
min-inline-size: 0;
|
|
1222
|
+
}
|
|
1223
|
+
legend {
|
|
1224
|
+
padding: 0;
|
|
1225
|
+
}
|
|
1226
|
+
.option {
|
|
1227
|
+
display: flex;
|
|
1228
|
+
align-items: flex-start;
|
|
1229
|
+
gap: ${s(3)};
|
|
1230
|
+
padding: ${s(3)};
|
|
1231
|
+
border: ${t.borderThin} solid ${t.border};
|
|
1232
|
+
border-radius: ${t.radius};
|
|
1233
|
+
margin-block-end: ${s(2)};
|
|
1234
|
+
cursor: pointer;
|
|
1235
|
+
}
|
|
1236
|
+
.option:hover {
|
|
1237
|
+
background: ${t.surfaceSubtle};
|
|
1238
|
+
}
|
|
1239
|
+
.option input {
|
|
1240
|
+
${T}
|
|
1241
|
+
inline-size: 20px;
|
|
1242
|
+
block-size: 20px;
|
|
1243
|
+
margin: 0;
|
|
1244
|
+
flex: none;
|
|
1245
|
+
accent-color: ${t.brand};
|
|
1246
|
+
}
|
|
1247
|
+
.option-text {
|
|
1248
|
+
display: block;
|
|
1249
|
+
font-size: ${g("md")};
|
|
1250
|
+
}
|
|
1251
|
+
.option-description {
|
|
1252
|
+
display: block;
|
|
1253
|
+
font-size: ${g("sm")};
|
|
1254
|
+
color: ${t.textMuted};
|
|
1255
|
+
margin-block-start: ${s(1)};
|
|
1256
|
+
}
|
|
1257
|
+
:host([invalid]) .option {
|
|
1258
|
+
border-color: ${t.danger};
|
|
1259
|
+
}
|
|
1260
|
+
`]}renderLabel(){return o`<legend class="label" part="label">
|
|
1261
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1262
|
+
</legend>`}onToggle(e,i){this.values=i?[...this.values,e]:this.values.filter(r=>r!==e),this.setFormValue(this.options.filter(r=>this.values.includes(r.value)).map(r=>r.value).join(","))}renderControl(){return o`
|
|
1263
|
+
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),n=e.description?this.id_(`opt-${i}-desc`):void 0;return o`
|
|
1264
|
+
<label class="option" part="option" for=${r}>
|
|
1265
|
+
<input
|
|
1266
|
+
type="checkbox"
|
|
1267
|
+
id=${r}
|
|
1268
|
+
value=${e.value}
|
|
1269
|
+
.checked=${this.values.includes(e.value)}
|
|
1270
|
+
?disabled=${this.disabled}
|
|
1271
|
+
aria-describedby=${n??l}
|
|
1272
|
+
@change=${d=>this.onToggle(e.value,d.target.checked)}
|
|
1273
|
+
/>
|
|
1274
|
+
<span>
|
|
1275
|
+
<span class="option-text">${e.label}</span>
|
|
1276
|
+
${e.description?o`<span class="option-description" id=${n}>${e.description}</span>`:l}
|
|
1277
|
+
</span>
|
|
1278
|
+
</label>
|
|
1279
|
+
`})}
|
|
1280
|
+
`}render(){return o`
|
|
1281
|
+
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1282
|
+
${this.renderLabel()}
|
|
1283
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1284
|
+
${this.renderControl()}
|
|
1285
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1286
|
+
</fieldset>
|
|
1287
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-checkbox-group",Be);var Ne=class extends f{static{this.properties={...f.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=[...f.styles,p`
|
|
1288
|
+
fieldset {
|
|
1289
|
+
border: 0;
|
|
1290
|
+
margin: 0;
|
|
1291
|
+
padding: 0;
|
|
1292
|
+
min-inline-size: 0;
|
|
1293
|
+
}
|
|
1294
|
+
legend {
|
|
1295
|
+
padding: 0;
|
|
1296
|
+
}
|
|
1297
|
+
.parts {
|
|
1298
|
+
display: flex;
|
|
1299
|
+
gap: ${s(3)};
|
|
1300
|
+
}
|
|
1301
|
+
.part {
|
|
1302
|
+
display: flex;
|
|
1303
|
+
flex-direction: column;
|
|
1304
|
+
gap: ${s(1)};
|
|
1305
|
+
}
|
|
1306
|
+
.part label {
|
|
1307
|
+
font-size: ${g("sm")};
|
|
1308
|
+
color: ${t.textMuted};
|
|
1309
|
+
}
|
|
1310
|
+
input {
|
|
1311
|
+
min-block-size: 44px;
|
|
1312
|
+
padding: ${s(3)};
|
|
1313
|
+
font-family: inherit;
|
|
1314
|
+
font-size: ${g("md")};
|
|
1315
|
+
color: ${t.text};
|
|
1316
|
+
background: ${t.surfaceCard};
|
|
1317
|
+
border: ${t.borderThin} solid ${t.border};
|
|
1318
|
+
border-radius: ${t.radius};
|
|
1319
|
+
/* Room for the digits plus the padding and border, so the box is never narrower than a finger. */
|
|
1320
|
+
inline-size: calc(3ch + ${s(6)} + 2px);
|
|
1321
|
+
}
|
|
1322
|
+
.year input {
|
|
1323
|
+
inline-size: calc(5ch + ${s(6)} + 2px);
|
|
1324
|
+
}
|
|
1325
|
+
:host([invalid]) input {
|
|
1326
|
+
border-color: ${t.danger};
|
|
1327
|
+
border-width: ${t.borderThick};
|
|
1328
|
+
}
|
|
1329
|
+
`]}renderLabel(){return o`<legend class="label" part="label">
|
|
1330
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1331
|
+
</legend>`}datePart(e,i,r,n){let d=this.id_(e);return o`
|
|
1332
|
+
<div class="part ${e}">
|
|
1333
|
+
<label for=${d}>${i}</label>
|
|
1334
|
+
<input
|
|
1335
|
+
id=${d}
|
|
1336
|
+
type="text"
|
|
1337
|
+
inputmode="numeric"
|
|
1338
|
+
maxlength=${r}
|
|
1339
|
+
.value=${this[e]}
|
|
1340
|
+
autocomplete=${this.autocompleteSection?`${this.autocompleteSection}-${n}`:l}
|
|
1341
|
+
?disabled=${this.disabled}
|
|
1342
|
+
@input=${h=>{this[e]=h.target.value,this.emit()}}
|
|
1343
|
+
/>
|
|
1344
|
+
</div>
|
|
1345
|
+
`}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 o`
|
|
1346
|
+
<div class="parts" part="parts">
|
|
1347
|
+
${this.datePart("day",x("Day"),2,"day")}
|
|
1348
|
+
${this.datePart("month",x("Month"),2,"month")}
|
|
1349
|
+
${this.datePart("year",x("Year"),4,"year")}
|
|
1350
|
+
</div>
|
|
1351
|
+
`}render(){return o`
|
|
1352
|
+
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1353
|
+
${this.renderLabel()}
|
|
1354
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1355
|
+
${this.renderControl()}
|
|
1356
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1357
|
+
</fieldset>
|
|
1358
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-date-input",Ne);var oe=new Set,se=null;function ne(a){if(typeof document>"u"||oe.has(a)||(oe.add(a),oe.size>1))return;let e=document.documentElement,i=window.innerWidth-e.clientWidth;se={overflow:e.style.overflow,paddingRight:e.style.paddingRight},e.style.overflow="hidden",i>0&&(e.style.paddingRight=`${i}px`)}function W(a){if(typeof document>"u"||!oe.delete(a)||oe.size>0||!se)return;let e=document.documentElement;e.style.overflow=se.overflow,e.style.paddingRight=se.paddingRight,se=null}var Oe=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,v,M(".close"),p`
|
|
1359
|
+
dialog {
|
|
1360
|
+
padding: 0;
|
|
1361
|
+
border: 0;
|
|
1362
|
+
border-radius: ${t.radius2xl};
|
|
1363
|
+
background: ${t.surfaceCard};
|
|
1364
|
+
color: ${t.text};
|
|
1365
|
+
box-shadow: ${t.shadowXl}, 0 0 0 1px ${t.hairline};
|
|
1366
|
+
max-inline-size: min(32rem, calc(100vw - 2rem));
|
|
1367
|
+
/* 1.4.10 Reflow: a dialog taller than the viewport must scroll inside
|
|
1368
|
+
itself rather than clipping, at 320px and at 400% zoom alike. */
|
|
1369
|
+
max-block-size: calc(100vh - 2rem);
|
|
1370
|
+
overflow: auto;
|
|
1371
|
+
}
|
|
1372
|
+
dialog::backdrop {
|
|
1373
|
+
background: color-mix(in srgb, ${t.text} 30%, transparent);
|
|
1374
|
+
backdrop-filter: blur(2px);
|
|
1375
|
+
}
|
|
1376
|
+
.head {
|
|
1377
|
+
display: flex;
|
|
1378
|
+
align-items: flex-start;
|
|
1379
|
+
justify-content: space-between;
|
|
1380
|
+
gap: ${s(3)};
|
|
1381
|
+
padding: ${s(5)} ${s(5)} 0;
|
|
1382
|
+
}
|
|
1383
|
+
.heading {
|
|
1384
|
+
margin: 0;
|
|
1385
|
+
font-family: ${t.fontHeading};
|
|
1386
|
+
font-size: ${g("xl")};
|
|
1387
|
+
font-weight: ${m("bold")};
|
|
1388
|
+
color: ${t.textHeading};
|
|
1389
|
+
}
|
|
1390
|
+
.body {
|
|
1391
|
+
padding: ${s(4)} ${s(5)} ${s(5)};
|
|
1392
|
+
}
|
|
1393
|
+
@media (max-width: 40rem) {
|
|
1394
|
+
:host([phone-full-screen]) dialog {
|
|
1395
|
+
inline-size: 100vw;
|
|
1396
|
+
max-inline-size: 100vw;
|
|
1397
|
+
block-size: 100dvh;
|
|
1398
|
+
max-block-size: 100dvh;
|
|
1399
|
+
margin: 0;
|
|
1400
|
+
border-radius: 0;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
.close {
|
|
1404
|
+
${T}
|
|
1405
|
+
display: inline-flex;
|
|
1406
|
+
align-items: center;
|
|
1407
|
+
justify-content: center;
|
|
1408
|
+
flex: none;
|
|
1409
|
+
background: none;
|
|
1410
|
+
border: 0;
|
|
1411
|
+
border-radius: ${t.radius};
|
|
1412
|
+
font: inherit;
|
|
1413
|
+
font-size: ${g("lg")};
|
|
1414
|
+
color: ${t.text};
|
|
1415
|
+
cursor: pointer;
|
|
1416
|
+
}
|
|
1417
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(e){if(!e.has("open"))return;let i=this.dialog;i&&(this.open?(typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),ne(this)):(typeof i.close=="function"&&i.open?i.close():i.removeAttribute("open"),W(this)))}disconnectedCallback(){super.disconnectedCallback(),W(this)}close(){this.open=!1,this.dispatchEvent(new CustomEvent("impakt-close",{bubbles:!0,composed:!0}))}render(){return o`
|
|
1418
|
+
<dialog
|
|
1419
|
+
part="dialog"
|
|
1420
|
+
aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
1421
|
+
@cancel=${e=>{this.dismissible?this.close():e.preventDefault()}}
|
|
1422
|
+
@close=${()=>{this.open&&this.close()}}
|
|
1423
|
+
>
|
|
1424
|
+
<div class="head">
|
|
1425
|
+
${this.heading?o`<h2 class="heading" id=${this.id_("heading")} part="heading">${this.heading}</h2>`:l}
|
|
1426
|
+
${this.dismissible?o`<button class="close" part="close" type="button" @click=${this.close}>
|
|
1427
|
+
<span aria-hidden="true">×</span>
|
|
1428
|
+
<span class="sr-only" style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">${this.closeLabel}</span>
|
|
1429
|
+
</button>`:l}
|
|
1430
|
+
</div>
|
|
1431
|
+
<div class="body" part="body"><slot></slot></div>
|
|
1432
|
+
</dialog>
|
|
1433
|
+
`}};customElements.define("impakt-dialog",Oe);var Pe=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,R,p`
|
|
1434
|
+
:host { display: block; }
|
|
1435
|
+
ul, ol { list-style: none; margin: 0; padding: 0; display: grid; gap: ${s(3)}; counter-reset: point; }
|
|
1436
|
+
li { position: relative; padding-inline-start: ${s(7)}; ${b("md")} text-wrap: pretty; counter-increment: point; }
|
|
1437
|
+
:host([size='sm']) li { ${b("sm")} }
|
|
1438
|
+
:host([size='lg']) li { ${b("lg")} }
|
|
1439
|
+
li::before { content: ''; position: absolute; inset-inline-start: 4px; inset-block-start: 0.6em; inline-size: 7px; block-size: 7px; border-radius: 2px; background: ${t.brand}; }
|
|
1440
|
+
:host([look='check']) li::before { content: '✓'; inset-inline-start: 0; inset-block-start: 0; inline-size: auto; block-size: auto; background: none; color: ${t.success}; font-weight: ${m("bold")}; }
|
|
1441
|
+
: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: ${t.fontMono}; font-size: 0.75em; color: ${t.textMuted}; }
|
|
1442
|
+
@media (forced-colors: active) { li::before { background: CanvasText; } :host([look='check']) li::before, :host([look='number']) li::before { background: none; color: CanvasText; } }
|
|
1443
|
+
`]}render(){let e=(this.items??[]).map(i=>o`<li part="item">${i}</li>`);return this.look==="number"?o`<ol part="list">${e}</ol>`:o`<ul part="list" role="list">${e}</ul>`}};customElements.define("impakt-list",Pe);var hi={"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"},De=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,R,p`
|
|
1444
|
+
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
1445
|
+
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${u("layout.gutter.md","16px")}; align-items: stretch; }
|
|
1446
|
+
:host([gap='none']) .columns { gap: 0; }
|
|
1447
|
+
:host([gap='sm']) .columns { gap: ${u("layout.gutter.sm","8px")}; }
|
|
1448
|
+
:host([gap='lg']) .columns { gap: ${u("layout.gutter.lg","32px")}; }
|
|
1449
|
+
:host([gap='xl']) .columns { gap: ${u("layout.gutter.xl","48px")}; }
|
|
1450
|
+
:host([align='start']) .columns { align-items: start; }
|
|
1451
|
+
:host([align='center']) .columns { align-items: center; }
|
|
1452
|
+
:host([align='end']) .columns { align-items: end; }
|
|
1453
|
+
:host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }
|
|
1454
|
+
:host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1455
|
+
:host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
1456
|
+
:host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
|
|
1457
|
+
:host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
|
|
1458
|
+
.column { min-inline-size: 0; overflow-wrap: anywhere; }
|
|
1459
|
+
::slotted(*) { max-inline-size: 100%; }
|
|
1460
|
+
@container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
1461
|
+
@container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
1462
|
+
`]}render(){let e=this.columns==="one"?1:this.columns==="three"?3:this.columns==="four"?4:2,i=hi[this.widths]?.split(" "),r=i&&i.length===e?i.map(n=>`minmax(0, ${n})`).join(" "):"";return o`<div class="columns" part="row" style=${r?`grid-template-columns: ${r}`:""}>${Array.from({length:e},(n,d)=>o`<div class="column" part="column"><slot name=${`column-${d+1}`}></slot></div>`)}</div>`}};customElements.define("impakt-grid",De);var qe=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,v,p`
|
|
1463
|
+
:host { display: block; }
|
|
1464
|
+
a { display: inline-flex; align-items: center; min-height: ${t.targetMin}; min-width: ${t.targetMin};
|
|
1465
|
+
color: ${t.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }
|
|
1466
|
+
a:hover { color: ${t.linkHover}; }
|
|
1467
|
+
.contact { margin: 0; }
|
|
1468
|
+
.caption { display: block; font-weight: ${m("semibold")}; }
|
|
1469
|
+
/* An address is written one line at a time, and opening hours are often one
|
|
1470
|
+
day to a line. Long unbroken values still wrap at 320px (1.4.10). */
|
|
1471
|
+
.detail { white-space: pre-line; overflow-wrap: anywhere; }
|
|
1472
|
+
`]}render(){switch(this.kind){case"phone":case"email":case"address":case"hours":return this.renderContact();default:return this.renderLink()}}renderLink(){return St(this.label)?o`<a part="link" href=${this.href}>${this.label}</a>`:l}renderContact(){let e=St(this.detail);if(!e)return l;let i=St(this.label),r=ui(this.kind,e),n=this.id_("caption"),d=this.id_("detail"),h=i?o`<span class="caption" part="label" id=${n}>${i}</span>`:l,y=r?o`<a part="link" href=${r} aria-labelledby=${i?`${n} ${d}`:l}
|
|
1473
|
+
><span class="detail" part="detail" id=${d}>${e}</span></a>`:o`<span class="detail" part="detail">${e}</span>`;return o`<p class="contact" part="contact">${h}${y}</p>`}};function St(a){return typeof a=="string"?a.trim():""}function ui(a,e){if(a==="phone"){let i=e.replace(/\(0\)/g,"").replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"");return/\d/.test(i)?`tel:${i}`:""}return a==="email"&&/^[^\s@]+@[^\s@]+$/.test(e)?`mailto:${e}`:""}customElements.define("impakt-help",qe);var Vt=p`
|
|
1474
|
+
:host { --impakt-page-inner: ${u("layout.page-width","1200px")}; }
|
|
1475
|
+
:host([width='narrow']) { --impakt-page-inner: 760px; }
|
|
1476
|
+
:host([width='wide']) { --impakt-page-inner: 1440px; }
|
|
1477
|
+
`,mi=p`
|
|
1478
|
+
:host { --impakt-page-margin: ${u("layout.margin.phone","16px")}; }
|
|
1479
|
+
@container impakt-page (min-width: 40rem) { .frame { --impakt-page-margin: ${u("layout.margin.tablet","32px")}; } }
|
|
1480
|
+
@container impakt-page (min-width: 64rem) { .frame { --impakt-page-margin: ${u("layout.margin.desktop","64px")}; } }
|
|
1481
|
+
`,Fe=class extends c{constructor(){super();this.place=()=>{let i=this.querySelector('impakt-hero[treatment="cover"]'),r=getComputedStyle(this).getPropertyValue("--impakt-bleed").trim()==="0",n=!!i&&!r&&this.opensOn(i);if(this.toggleAttribute("floating",n),!n)return;let d=this.renderRoot.querySelector(".frame");d&&this.style.setProperty("--impakt-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,v,Vt,mi,p`
|
|
1482
|
+
:host { display: block; container: impakt-page / inline-size; }
|
|
1483
|
+
.frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
|
|
1484
|
+
.inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impakt-page-inner) + 2 * var(--impakt-page-margin)); margin-inline: auto; padding-inline: var(--impakt-page-margin); }
|
|
1485
|
+
header { background: ${u("color.surface.header","transparent")}; color: ${u("color.text.on-header","inherit")}; padding-block: ${s(4)}; }
|
|
1486
|
+
/* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */
|
|
1487
|
+
header { --impakt-color-text-default: ${u("color.text.on-header","inherit")}; --impakt-color-text-heading: ${u("color.text.on-header","inherit")}; --impakt-color-text-link: ${u("color.text.on-header","inherit")}; --impakt-color-text-link-hover: ${u("color.text.on-header","inherit")}; }
|
|
1488
|
+
footer { --impakt-color-text-default: ${u("color.text.on-footer","inherit")}; --impakt-color-text-heading: ${u("color.text.on-footer","inherit")}; --impakt-color-text-muted: ${u("color.text.on-footer","inherit")}; --impakt-color-text-link: ${u("color.text.on-footer","inherit")}; --impakt-color-text-link-hover: ${u("color.text.on-footer","inherit")}; }
|
|
1489
|
+
:host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }
|
|
1490
|
+
main { flex: 1; padding-block: ${s(6)} ${s(10)}; }
|
|
1491
|
+
main:focus { outline: none; }
|
|
1492
|
+
/* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */
|
|
1493
|
+
:host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impakt-header-top, 0px); padding-block: ${s(6)} 0; background: transparent; border: 0; }
|
|
1494
|
+
:host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impakt-page-margin)); max-inline-size: var(--impakt-page-inner); padding: ${s(3)} ${s(4)} ${s(3)} ${s(6)}; background: ${u("color.surface.header","#fff")}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }
|
|
1495
|
+
:host([floating]) main { padding-block-start: 0; }
|
|
1496
|
+
footer { background: ${u("color.surface.footer","transparent")}; color: ${u("color.text.on-footer","inherit")}; padding-block: ${s(8)}; border-block-start: ${t.borderThin} solid ${u("color.border.subtle","transparent")}; }
|
|
1497
|
+
.skip { position: absolute; inset-inline-start: ${s(2)}; inset-block-start: ${s(2)}; z-index: 20; padding: ${s(2)} ${s(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }
|
|
1498
|
+
.skip:not(:focus) { clip-path: inset(50%); }
|
|
1499
|
+
.skip:focus { transform: none; }
|
|
1500
|
+
.empty { display: none; }
|
|
1501
|
+
`]}hasSlot(i){return Array.from(this.children).some(r=>r.getAttribute("slot")===i)}skip(i){i.preventDefault();let r=this.renderRoot.querySelector("main");r?.focus(),r?.scrollIntoView()}render(){let i=this.hasSlot("header"),r=this.hasSlot("footer");return o`<div class="frame" part="frame">
|
|
1502
|
+
<a class="skip" href="#content" part="skip" @click=${this.skip}>${this.skipText}</a>
|
|
1503
|
+
${i?o`<header part="header"><div class="inner"><slot name="header"></slot></div></header>`:l}
|
|
1504
|
+
<main id="content" tabindex="-1" part="main"><div class="inner"><slot></slot></div></main>
|
|
1505
|
+
${r?o`<footer part="footer"><div class="inner"><slot name="footer"></slot></div></footer>`:l}
|
|
1506
|
+
</div>`}opensOn(i){for(let r of Array.from(this.querySelectorAll("*"))){if(r===i)return!0;if(!r.closest('[slot="header"],[slot="footer"]')&&r.tagName.startsWith("IMPAKT-")&&!/^IMPAKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(r.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()}},je=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,R,Vt,p`
|
|
1507
|
+
:host { display: block; --impakt-page-margin: inherit; }
|
|
1508
|
+
/* What a solid card on a brand band goes back to, since the band repaints these for its own text. */
|
|
1509
|
+
:host([tone='brand']) { --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }
|
|
1510
|
+
.band { box-sizing: border-box; border-radius: ${t.radiusLg}; }
|
|
1511
|
+
/* --impakt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */
|
|
1512
|
+
:host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding-inline: max(${s(4)}, calc(var(--impakt-bleed, 1) * (50vw - 50%))); }
|
|
1513
|
+
:host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }
|
|
1514
|
+
:host([tone='inset']) .band { background: ${t.surfaceInset}; }
|
|
1515
|
+
:host([tone='card']) .band { background: ${t.surfaceCard}; }
|
|
1516
|
+
:host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; --impakt-color-text-link-hover: ${t.onBrand}; }
|
|
1517
|
+
:host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${s(6)}; }
|
|
1518
|
+
:host([padding='sm']) .band { padding-block: ${s(4)}; }
|
|
1519
|
+
:host([padding='md']) .band { padding-block: ${s(8)}; }
|
|
1520
|
+
:host([padding='lg']) .band { padding-block: ${s(12)}; }
|
|
1521
|
+
:host([padding='xl']) .band { padding-block: ${s(16)}; }
|
|
1522
|
+
:host([padding='2xl']) .band { padding-block: clamp(${s(14)}, 8vw, ${s(28)}); }
|
|
1523
|
+
.content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }
|
|
1524
|
+
`]}render(){return o`<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("impakt-page",Fe);customElements.define("impakt-section",je);function gi(a){if(typeof location>"u"||!a||a.startsWith("#"))return null;let e;try{e=new URL(a,location.href).pathname.replace(/\/$/,"")||"/"}catch{return null}let i=location.pathname.replace(/\/$/,"")||"/";return e===i?"page":e!=="/"&&i.startsWith(`${e}/`)?"section":null}var Ue=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,v,p`
|
|
1525
|
+
/* It grows to fill a row it sits in, because it measures itself to decide when to fold. */
|
|
1526
|
+
:host { display: block; flex: 1 1 8rem; min-inline-size: 0; }
|
|
1527
|
+
nav { display: flex; flex-direction: column; position: relative; }
|
|
1528
|
+
li { flex: none; }
|
|
1529
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${s(1)} ${s(6)}; align-items: center; justify-content: flex-end; }
|
|
1530
|
+
:host([align='start']) ul { justify-content: flex-start; }
|
|
1531
|
+
:host([align='center']) ul { justify-content: center; }
|
|
1532
|
+
a { ${T} display: inline-flex; align-items: center; padding: ${s(2)} ${s(1)}; color: inherit; font-weight: ${m("semibold")}; text-decoration: none; border-radius: ${t.radiusSm}; }
|
|
1533
|
+
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1534
|
+
a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
|
|
1535
|
+
.toggle { display: none; ${T} align-items: center; gap: ${s(2)}; align-self: flex-end; padding: ${s(2)} ${s(3)}; font: inherit; font-weight: ${m("semibold")}; color: inherit; background: transparent; border: ${t.borderThin} solid currentColor; border-radius: ${t.radius}; cursor: pointer; }
|
|
1536
|
+
/* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
|
|
1537
|
+
:host([folded]) { flex: 0 0 auto; }
|
|
1538
|
+
:host([folded]) .toggle { display: inline-flex; }
|
|
1539
|
+
:host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }
|
|
1540
|
+
:host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1541
|
+
:host([size='sm']) ul { column-gap: ${s(6)}; }
|
|
1542
|
+
:host([size='sm']) a { padding-inline: 0; font-size: ${g("sm")}; font-weight: ${m("medium")}; }
|
|
1543
|
+
:host([size='sm'][folded]) a { padding-inline: ${s(3)}; }
|
|
1544
|
+
:host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${s(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${s(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
|
|
1545
|
+
:host([folded]) ul.open { display: flex; }
|
|
1546
|
+
:host([folded]) li { text-align: start; }
|
|
1547
|
+
:host([folded]) a { display: flex; padding: ${s(3)} ${s(3)}; }
|
|
1548
|
+
`]}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((h,y)=>h+y.getBoundingClientRect().width,0)+d*Math.max(0,n.length-1)}let r=this.needs>i;this.toggleAttribute("folded",r),!r&&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 o`<nav aria-label=${this.label||l} part="nav" @keydown=${this.onKey}>
|
|
1549
|
+
<button class="toggle" type="button" aria-expanded=${this.open?"true":"false"} aria-controls=${i} @click=${this.toggle}>${z(this.open?"close":this.menuLook==="icon"?"menu-two":"menu")}<span class="words">${this.menuText}</span></button>
|
|
1550
|
+
<ul id=${i} class=${this.open?"open":""} part="list">
|
|
1551
|
+
${(this.links??[]).map(r=>{let n=gi(r.href);return o`<li><a href=${r.href} aria-current=${n==="page"?"page":n==="section"?"true":l} part="link">${r.label}</a></li>`})}
|
|
1552
|
+
</ul>
|
|
1553
|
+
</nav>`}},We=class extends c{static{this.properties={items:{type:Array},label:{type:String}}}constructor(){super(),this.items=[],this.label="Breadcrumb"}static{this.styles=[...c.styles,v,p`
|
|
1554
|
+
:host { display: block; font-size: ${g("sm")}; }
|
|
1555
|
+
ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${s(1)}; }
|
|
1556
|
+
li { display: inline-flex; align-items: center; gap: ${s(1)}; }
|
|
1557
|
+
li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${t.textMuted}; border-inline-end: 1.5px solid ${t.textMuted}; transform: rotate(45deg); margin-inline: ${s(1)} ${s(2)}; }
|
|
1558
|
+
a { color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${t.radiusSm}; }
|
|
1559
|
+
a:hover { color: ${t.linkHover}; }
|
|
1560
|
+
[aria-current] { color: ${t.textMuted}; }
|
|
1561
|
+
.sr-only { ${E} }
|
|
1562
|
+
`]}render(){let e=this.items??[];return o`<nav aria-label=${this.label} part="nav"><ol>
|
|
1563
|
+
${e.map((i,r)=>o`<li>${r===e.length-1?o`<span aria-current="page">${i.label}</span>`:o`<a href=${i.href} part="link">${i.label}</a>`}</li>`)}
|
|
1564
|
+
</ol></nav>`}};customElements.define("impakt-nav",Ue);customElements.define("impakt-breadcrumbs",We);var Ke=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,p`
|
|
1565
|
+
:host { display: block; }
|
|
1566
|
+
hr { margin: ${s(4)} 0; border: 0; border-block-start: ${t.borderThin} solid ${t.border}; opacity: 0.5; }
|
|
1567
|
+
:host([tone='strong']) hr { opacity: 1; border-block-start-width: ${t.borderThick}; }
|
|
1568
|
+
:host([spacing='sm']) hr { margin-block: ${s(2)}; }
|
|
1569
|
+
:host([spacing='lg']) hr { margin-block: ${s(8)}; }
|
|
1570
|
+
:host([spacing='xl']) hr { margin-block: ${s(12)}; }
|
|
1571
|
+
`]}render(){return o`<hr aria-hidden="true" part="line" />`}},Ve=class extends c{static{this.properties={size:{type:String,reflect:!0}}}constructor(){super(),this.size="md"}static{this.styles=[...c.styles,p`
|
|
1572
|
+
:host { display: block; block-size: ${s(4)}; }
|
|
1573
|
+
:host([size='sm']) { block-size: ${s(2)}; }
|
|
1574
|
+
:host([size='lg']) { block-size: ${s(8)}; }
|
|
1575
|
+
:host([size='xl']) { block-size: ${s(12)}; }
|
|
1576
|
+
:host([size='2xl']) { block-size: ${s(16)}; }
|
|
1577
|
+
`]}render(){return o``}},Xe=class extends c{static{this.styles=[...c.styles,p`:host { ${E} }`]}render(){return o`<slot></slot>`}},Ge=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,v,M("[role='tab']"),p`
|
|
1578
|
+
:host { display: block; container-type: inline-size; }
|
|
1579
|
+
[role='tablist'] { display: flex; gap: ${s(1)}; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-block-end: ${t.borderThin} solid ${t.border}; }
|
|
1580
|
+
[role='tab'] { ${T} flex: none; padding: ${s(3)} ${s(4)}; font: inherit; font-weight: ${m("semibold")}; white-space: nowrap; color: ${t.textMuted}; background: transparent; border: 0; border-block-end: 3px solid transparent; margin-block-end: -1px; cursor: pointer; border-radius: ${t.radius} ${t.radius} 0 0; }
|
|
1581
|
+
/* Inside a box that scrolls the ring would be clipped, so it is drawn inside the tab. */
|
|
1582
|
+
[role='tab']:focus-visible { box-shadow: inset 0 0 0 2px ${t.text}, inset 0 0 0 4px ${t.surfaceCard}; }
|
|
1583
|
+
[role='tab']:hover { color: ${t.text}; background: ${t.surfaceInset}; }
|
|
1584
|
+
[role='tab'][aria-selected='true'] { color: ${t.link}; border-block-end-color: currentColor; }
|
|
1585
|
+
[role='tabpanel'] { padding-block: ${s(5)}; line-height: ${C("normal")}; }
|
|
1586
|
+
.body { white-space: pre-line; }
|
|
1587
|
+
@container (max-width: 40rem) {
|
|
1588
|
+
:host([two-rows]) [role='tablist'].many { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); overflow: visible; border-block-end: 0; gap: ${s(1)}; }
|
|
1589
|
+
:host([two-rows]) .many [role='tab'] { white-space: normal; padding-inline: ${s(2)}; margin: 0; border-block-end-width: 3px; border-block-end-color: ${t.rule}; border-radius: ${t.radius}; }
|
|
1590
|
+
:host([two-rows]) .many [role='tab'][aria-selected='true'] { border-block-end-color: currentColor; background: ${t.brandSubtle}; }
|
|
1591
|
+
}
|
|
1592
|
+
@media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }
|
|
1593
|
+
`]}current(){let e=this.items??[];return e.some(i=>i.id===this.selected)?this.selected:e[0]?.id??""}choose(e,i){e!==this.current()&&(this.selected=e,this.dispatchEvent(new CustomEvent("impakt-change",{detail:{value:e},bubbles:!0,composed:!0})),i&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${this.id_(`tab-${e}`)}`)?.focus({preventScroll:!0})))}onKey(e){let i=this.items??[],r=i.findIndex(d=>d.id===this.current()),n={ArrowRight:r+1,ArrowLeft:r-1,Home:0,End:i.length-1}[e.key];n===void 0||!i.length||(e.preventDefault(),this.choose(i[(n+i.length)%i.length].id,!0))}reveal(){let e=this.renderRoot.querySelector("[role='tablist']"),i=this.renderRoot.querySelector("[role='tab'][aria-selected='true']");if(!e||!i||e.scrollWidth<=e.clientWidth)return;let r=i.offsetLeft-e.offsetLeft,n=r+i.offsetWidth;r<e.scrollLeft?e.scrollLeft=r-16:n>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n-e.clientWidth+16)}updated(e){(e.has("selected")||e.has("items"))&&this.reveal()}render(){let e=this.items??[],i=this.current(),r=e.length>4;return o`<div role="tablist" aria-label=${this.label||l} part="tabs" class=${r?"many":""} style=${r?`--columns:${Math.ceil(e.length/2)}`:l} @keydown=${this.onKey}>
|
|
1594
|
+
${e.map(n=>o`<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>`)}
|
|
1595
|
+
</div>
|
|
1596
|
+
${e.map(n=>o`<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>`)}`}};customElements.define("impakt-divider",Ke);customElements.define("impakt-spacer",Ve);customElements.define("impakt-visually-hidden",Xe);customElements.define("impakt-tabs",Ge);var Ye=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,p`
|
|
1597
|
+
:host { display: block; margin-block-end: ${s(6)}; }
|
|
1598
|
+
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
1599
|
+
legend { padding: 0; margin-block-end: ${s(2)}; font-size: ${g("md")}; font-weight: ${m("bold")}; line-height: ${C("tight")}; color: ${t.text}; }
|
|
1600
|
+
:host([size='lg']) legend { font-size: ${g("xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
|
|
1601
|
+
:host([size='xl']) legend { font-size: ${g("2xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
|
|
1602
|
+
.description { margin-block-end: ${s(3)}; font-size: ${g("sm")}; color: ${t.textMuted}; line-height: ${C("normal")}; }
|
|
1603
|
+
.error { margin-block-end: ${s(3)}; font-size: ${g("sm")}; color: ${t.dangerText}; font-weight: ${m("semibold")}; }
|
|
1604
|
+
.error:empty { display: none; }
|
|
1605
|
+
:host([error]:not([error=''])) .fields { padding-inline-start: ${s(4)}; border-inline-start: 4px solid ${t.danger}; }
|
|
1606
|
+
`]}render(){let e=[this.description?this.id_("description"):"",this.error?this.id_("error"):""].filter(Boolean).join(" ");return o`<fieldset part="fieldset" aria-describedby=${e||l}>
|
|
1607
|
+
<legend part="legend">${this.legend}</legend>
|
|
1608
|
+
${this.description?o`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
1609
|
+
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
1610
|
+
<div class="fields" part="fields"><slot></slot></div>
|
|
1611
|
+
</fieldset>`}};customElements.define("impakt-fieldset",Ye);var Ze=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,v,M(".close"),p`
|
|
1612
|
+
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: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
|
|
1613
|
+
dialog[open] { display: flex; }
|
|
1614
|
+
:host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
|
|
1615
|
+
dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
|
|
1616
|
+
@keyframes from-right { from { transform: translateX(100%); } }
|
|
1617
|
+
@keyframes from-left { from { transform: translateX(-100%); } }
|
|
1618
|
+
.head { display: flex; align-items: center; justify-content: space-between; gap: ${s(3)}; padding: ${s(4)} ${s(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
|
|
1619
|
+
h2 { margin: 0; font-family: ${t.fontHeading}; ${b("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
1620
|
+
.close { ${T} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
|
|
1621
|
+
.close:hover { background: ${t.surfaceSubtle}; }
|
|
1622
|
+
.body { flex: 1; overflow: auto; padding: ${s(5)}; }
|
|
1623
|
+
.foot { display: flex; gap: ${s(3)}; justify-content: flex-end; padding: ${s(4)} ${s(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
|
|
1624
|
+
.foot[hidden] { display: none; }
|
|
1625
|
+
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(i){if(!i.has("open"))return;let r=this.dialog;r&&(this.open?(typeof r.showModal=="function"?r.showModal():r.setAttribute("open",""),ne(this)):(typeof r.close=="function"&&r.open?r.close():r.removeAttribute("open"),W(this)))}disconnectedCallback(){super.disconnectedCallback(),W(this)}close(){this.open=!1,this.dispatchEvent(new CustomEvent("impakt-close",{bubbles:!0,composed:!0}))}footerChanged(i){this.hasFooter=i.target.assignedNodes().length>0,this.requestUpdate()}render(){return o`<dialog part="dialog" aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
1626
|
+
@cancel=${()=>this.close()}
|
|
1627
|
+
@close=${()=>{this.open&&this.close()}}
|
|
1628
|
+
@click=${i=>{i.target===this.dialog&&this.close()}}>
|
|
1629
|
+
<div class="head">
|
|
1630
|
+
${this.heading?o`<h2 id=${this.id_("heading")}>${this.heading}</h2>`:o`<span></span>`}
|
|
1631
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${z("close","20px")}</button>
|
|
1632
|
+
</div>
|
|
1633
|
+
<div class="body" part="body"><slot></slot></div>
|
|
1634
|
+
<div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
|
|
1635
|
+
</dialog>`}},bi={neutral:"info",success:"check",warning:"warning",danger:"warning"},Je=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,v,p`
|
|
1636
|
+
.region { position: fixed; inset-block-end: calc(${s(4)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); inset-inline-end: ${s(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${s(8)})); pointer-events: none; }
|
|
1637
|
+
@media (max-width: 40rem) { .region { inset-inline: ${s(3)}; inline-size: auto; inset-block-end: calc(${s(3)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); } }
|
|
1638
|
+
.toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${s(3)}; padding: ${s(3)} ${s(3)} ${s(3)} ${s(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }
|
|
1639
|
+
/* It rises without fading in, so its words are at full contrast from the first frame they are read in (1.4.3). */
|
|
1640
|
+
@keyframes rise { from { transform: translateY(${s(3)}); } }
|
|
1641
|
+
.mark { display: inline-flex; flex: none; margin-block-start: ${s(.5)}; color: ${t.info}; }
|
|
1642
|
+
:host([tone='success']) .mark { color: ${t.success}; }
|
|
1643
|
+
:host([tone='warning']) .mark { color: ${t.warning}; }
|
|
1644
|
+
:host([tone='danger']) .mark { color: ${t.danger}; }
|
|
1645
|
+
.message { flex: 1; align-self: center; margin: 0; ${b("sm")} font-weight: ${m("medium")}; }
|
|
1646
|
+
.action, .close { ${T} padding: 0 ${s(2)}; font: inherit; ${b("sm")} font-weight: ${m("semibold")}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
|
|
1647
|
+
.close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }
|
|
1648
|
+
.action:hover, .close:hover { background: ${t.surfaceSubtle}; }
|
|
1649
|
+
`,M(".action, .close")]}disconnectedCallback(){super.disconnectedCallback(),this.stop()}updated(e){(e.has("open")||e.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("impakt-close",{bubbles:!0,composed:!0})))}action(){this.dispatchEvent(new CustomEvent("impakt-action",{bubbles:!0,composed:!0})),this.close()}render(){return o`<div class="region" role="status" aria-live="polite">
|
|
1650
|
+
${this.open?o`<div class="toast" part="toast" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}
|
|
1651
|
+
@keydown=${e=>{e.key==="Escape"&&(e.preventDefault(),this.close())}}>
|
|
1652
|
+
<span class="mark">${z(bi[this.tone]??"info","20px")}</span>
|
|
1653
|
+
<p class="message">${this.message}</p>
|
|
1654
|
+
${this.actionText?o`<button class="action" type="button" @click=${this.action}>${this.actionText}</button>`:l}
|
|
1655
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${z("close","16px")}</button>
|
|
1656
|
+
</div>`:l}
|
|
1657
|
+
</div>`}},Qe=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,v,M(".trigger, .item"),p`
|
|
1658
|
+
:host { position: relative; display: inline-block; }
|
|
1659
|
+
.trigger { ${T} display: inline-flex; align-items: center; gap: ${s(2)}; padding: ${s(2)} ${s(3.5)}; font: inherit; ${b("sm")} font-weight: ${m("semibold")}; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }
|
|
1660
|
+
.trigger:hover { background: ${t.surfaceSubtle}; }
|
|
1661
|
+
.chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }
|
|
1662
|
+
:host([open]) .chev { transform: rotate(180deg); }
|
|
1663
|
+
.list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${s(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); margin: 0; padding: ${s(1.5)}; list-style: none; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowLg}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: pop 120ms ease-out; }
|
|
1664
|
+
:host([edge='end']) .list, .list.flip-end { inset-inline: auto 0; }
|
|
1665
|
+
:host([edge='end']) .list.flip-start { inset-inline: 0 auto; }
|
|
1666
|
+
@keyframes pop { from { opacity: 0; transform: translateY(-${s(1)}); } }
|
|
1667
|
+
.item { ${T} box-sizing: border-box; display: flex; align-items: center; gap: ${s(2.5)}; inline-size: 100%; padding: ${s(2)} ${s(2.5)}; font: inherit; ${b("sm")} text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
|
|
1668
|
+
.item:hover, .item:focus { background: ${t.surfaceSubtle}; }
|
|
1669
|
+
.item.danger { color: ${t.dangerText}; }
|
|
1670
|
+
.item svg { flex: none; }
|
|
1671
|
+
`]}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,r){this.open=i,i?(document.addEventListener("click",this.outside),this.updateComplete.then(()=>{this.keepOnScreen(),this.entries[r==="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 r=i.getBoundingClientRect(),n=document.documentElement.clientWidth;r.right>n-8?i.classList.add("flip-end"):r.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 r=this.entries,n=r.indexOf(this.renderRoot.activeElement),d={ArrowDown:(n+1)%r.length,ArrowUp:(n-1+r.length)%r.length,Home:0,End:r.length-1};if(i.key in d)i.preventDefault(),r[d[i.key]]?.focus();else if(i.key.length===1&&/\S/.test(i.key)&&!i.ctrlKey&&!i.metaKey&&!i.altKey){let h=i.key.toLowerCase();[...r.slice(n+1),...r.slice(0,n+1)].find($=>($.textContent??"").trim().toLowerCase().startsWith(h))?.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("impakt-select",{detail:{value:i.value??i.text},bubbles:!0,composed:!0}))}render(){let i=r=>o`${z(r.icon,"18px")}<span>${r.text}</span>`;return o`<button class="trigger" part="trigger" type="button" aria-haspopup="menu" aria-expanded=${String(this.open)} aria-controls=${this.id_("list")}
|
|
1672
|
+
@click=${()=>this.toggle(!this.open)} @keydown=${this.triggerKey}>${z(this.icon,"18px")}${this.label}<span class="chev">${z("chevron-down","16px")}</span></button>
|
|
1673
|
+
${this.open?o`<ul class="list" part="list" id=${this.id_("list")} role="menu" aria-label=${this.label} @keydown=${this.listKey}>
|
|
1674
|
+
${this.items.map(r=>o`<li role="none">${r.href?o`<a class="item ${r.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" href=${r.href} @click=${()=>this.choose(r)}>${i(r)}</a>`:o`<button class="item ${r.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" type="button" @click=${()=>this.choose(r)}>${i(r)}</button>`}</li>`)}
|
|
1675
|
+
</ul>`:l}`}};function fi(a,e){let i=[...new Set([1,a-1,a,a+1,e])].filter(r=>r>=1&&r<=e).sort((r,n)=>r-n);return i.flatMap((r,n)=>{let d=i[n-1];return d===void 0||r===d+1?[r]:r===d+2?[d+1,r]:["gap",r]})}var et=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,v,M(".n, .step"),p`
|
|
1676
|
+
:host { display: block; container-type: inline-size; }
|
|
1677
|
+
nav { display: flex; align-items: center; justify-content: space-between; gap: ${s(2)}; }
|
|
1678
|
+
ul { display: flex; align-items: center; gap: ${s(1)}; margin: 0; padding: 0; list-style: none; }
|
|
1679
|
+
.n, .step { ${T} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${s(1.5)}; min-inline-size: 44px; padding: 0 ${s(2.5)}; font: inherit; ${b("sm")} font-weight: ${m("medium")}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
|
|
1680
|
+
.n:hover, .step:hover { background: ${t.surfaceSubtle}; }
|
|
1681
|
+
.n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${m("semibold")}; }
|
|
1682
|
+
.step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }
|
|
1683
|
+
.gap { color: ${t.textMuted}; padding: 0 ${s(1)}; }
|
|
1684
|
+
.count { display: none; ${b("sm")} color: ${t.textMuted}; }
|
|
1685
|
+
@container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
|
|
1686
|
+
`]}go(e,i){this.hrefPattern||(i.preventDefault(),this.page=e,this.dispatchEvent(new CustomEvent("impakt-page",{detail:{page:e},bubbles:!0,composed:!0})))}link(e,i,r,n,d){return this.hrefPattern?o`<a class=${i} href=${this.hrefPattern.replace("{page}",String(e))} aria-label=${n} aria-current=${d?"page":l}>${r}</a>`:o`<button class=${i} type="button" aria-label=${n} aria-current=${d?"page":l} @click=${h=>this.go(e,h)}>${r}</button>`}step(e,i,r,n){let d=r==="arrow-left"?o`${z(r,"16px")}${i}`:o`${i}${z(r,"16px")}`;return n?o`<span class="step" aria-disabled="true">${d}</span>`:this.link(e,"step",d,i,!1)}render(){let e=Math.min(Math.max(this.page,1),Math.max(this.pages,1));return o`<nav aria-label=${this.label} part="nav">
|
|
1687
|
+
${this.step(e-1,this.previousText,"arrow-left",e<=1)}
|
|
1688
|
+
<ul>${fi(e,this.pages).map(i=>o`<li>${i==="gap"?o`<span class="gap" aria-hidden="true">…</span>`:this.link(i,"n",i,x("Page {page}",{page:i}),i===e)}</li>`)}</ul>
|
|
1689
|
+
<span class="count">${x("Page {page} of {pages}",{page:e,pages:this.pages})}</span>
|
|
1690
|
+
${this.step(e+1,this.nextText,"arrow-right",e>=this.pages)}
|
|
1691
|
+
</nav>`}},$i=a=>{let e=a.trim().split(/\s+/).filter(Boolean);return((e[0]?.[0]??"")+(e.length>1?e[e.length-1][0]:"")).toUpperCase()},tt=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,p`
|
|
1692
|
+
:host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
|
|
1693
|
+
:host([size='sm']) { --size: 32px; }
|
|
1694
|
+
:host([size='lg']) { --size: 56px; }
|
|
1695
|
+
:host([size='xl']) { --size: 80px; }
|
|
1696
|
+
.face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${m("semibold")}; }
|
|
1697
|
+
img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
1698
|
+
`]}willUpdate(i){i.has("src")&&(this.failed=!1)}render(){return this.src&&!this.failed?o`<div class="face"><img src=${this.src} alt=${this.fullName} @error=${()=>{this.failed=!0,this.requestUpdate()}} /></div>`:o`<div class="face" role="img" aria-label=${this.fullName||x("Person")}>${$i(this.fullName)||z("user","55%")}</div>`}},it=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,p`
|
|
1699
|
+
ul { display: flex; margin: 0; padding: 0; list-style: none; }
|
|
1700
|
+
li { margin-inline-start: -${s(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }
|
|
1701
|
+
li:first-child { margin-inline-start: 0; }
|
|
1702
|
+
.more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${b("xs")} line-height: 1; font-weight: ${m("semibold")}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }
|
|
1703
|
+
:host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
|
|
1704
|
+
:host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
|
|
1705
|
+
.sr { ${E} }
|
|
1706
|
+
`]}render(){let e=this.items.slice(0,this.max),i=this.items.length-e.length;return o`<ul part="list">
|
|
1707
|
+
${e.map(r=>o`<li><impakt-avatar full-name=${r.name} src=${r.src??""} size=${this.size}></impakt-avatar></li>`)}
|
|
1708
|
+
${i>0?o`<li><span class="more"><span aria-hidden="true">+${i}</span><span class="sr">${i} ${this.moreLabel}</span></span></li>`:l}
|
|
1709
|
+
</ul>`}},rt=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,R,p`
|
|
1710
|
+
.wrap { display: flex; flex-direction: column; align-items: center; gap: ${s(2)}; padding: ${s(12)} ${s(6)}; text-align: center; }
|
|
1711
|
+
:host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }
|
|
1712
|
+
.mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${s(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }
|
|
1713
|
+
.h { margin: 0; font-family: ${t.fontHeading}; ${b("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
1714
|
+
p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }
|
|
1715
|
+
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${s(3)}; margin-block-start: ${s(3)}; }
|
|
1716
|
+
`]}render(){return o`<div class="wrap" part="wrap">
|
|
1717
|
+
<span class="mark">${z(this.icon,"26px")}</span>
|
|
1718
|
+
${this.heading?o`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1719
|
+
${this.lead?o`<p>${this.lead}</p>`:l}
|
|
1720
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
1721
|
+
</div>`}},yi=a=>String(a?.times??"").split(",").map(e=>e.trim()).filter(Boolean);function xi(a){let e=new Date(`${a}T00:00:00Z`);if(Number.isNaN(e.getTime()))return{weekday:"",day:a,month:""};let i=I(),r=n=>new Intl.DateTimeFormat(i,{timeZone:"UTC",...n}).format(e);return{weekday:r({weekday:"short"}),day:r({day:"numeric"}),month:r({month:"short"})}}var st=class extends f{constructor(){super();this.day="";this.days=[],this.dayLabel="Day",this.timeLabel="Time",this.emptyText="No times are available at the moment."}static{this.properties={...f.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=[...f.styles,p`
|
|
1722
|
+
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
1723
|
+
legend { padding: 0; }
|
|
1724
|
+
.row-label { ${b("sm")} color: ${t.textMuted}; margin-block: ${s(2)}; }
|
|
1725
|
+
.days { display: flex; gap: ${s(2)}; overflow-x: auto; padding: ${s(1)}; margin: -${s(1)}; scrollbar-width: thin; }
|
|
1726
|
+
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${s(2)}; }
|
|
1727
|
+
label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }
|
|
1728
|
+
label:hover { background: ${t.surfaceSubtle}; }
|
|
1729
|
+
label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }
|
|
1730
|
+
label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }
|
|
1731
|
+
input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
1732
|
+
.day { flex: none; inline-size: 4.5rem; padding-block: ${s(2.5)}; }
|
|
1733
|
+
.weekday, .month { ${b("xs")} }
|
|
1734
|
+
.num { ${b("xl")} font-weight: ${m("semibold")}; }
|
|
1735
|
+
.time { padding: ${s(2)}; ${b("sm")} font-weight: ${m("medium")}; }
|
|
1736
|
+
.empty { margin: 0; color: ${t.textMuted}; }
|
|
1737
|
+
:host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }
|
|
1738
|
+
`]}get currentDay(){let i=this.day||this.value.split("T")[0];return this.days.find(r=>r.date===i)??this.days[0]}chooseDay(i){this.day=i,this.value&&!this.value.startsWith(`${i}T`)&&this.setFormValue(""),this.requestUpdate()}renderLabel(){return o`<legend class="label" part="label">${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}</legend>`}renderControl(){let i=this.currentDay;return i?o`
|
|
1739
|
+
<div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
|
|
1740
|
+
<div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
|
|
1741
|
+
${this.days.map(r=>{let n=xi(r.date);return o`<label class="day"><input type="radio" name=${`${this.uid}-day`} .checked=${r.date===i.date} ?disabled=${this.disabled} @change=${()=>this.chooseDay(r.date)} />
|
|
1742
|
+
<span class="weekday">${n.weekday}</span><span class="num">${n.day}</span><span class="month">${n.month}</span></label>`})}
|
|
1743
|
+
</div>
|
|
1744
|
+
<div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
|
|
1745
|
+
<div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
|
|
1746
|
+
${yi(i).map((r,n)=>{let d=`${i.date}T${r}`;return o`<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)} />${r}</label>`})}
|
|
1747
|
+
</div>`:o`<p class="empty">${this.emptyText}</p>`}render(){return o`<fieldset part="fieldset" ?disabled=${this.disabled} aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1748
|
+
${this.renderLabel()}
|
|
1749
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1750
|
+
${this.renderControl()}
|
|
1751
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1752
|
+
</fieldset>`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-drawer",Ze);customElements.define("impakt-toast",Je);customElements.define("impakt-menu",Qe);customElements.define("impakt-pagination",et);customElements.define("impakt-avatar",tt);customElements.define("impakt-avatar-group",it);customElements.define("impakt-empty-state",rt);customElements.define("impakt-slot-picker",st);var Et=p`
|
|
1753
|
+
input, select {
|
|
1754
|
+
box-sizing: border-box;
|
|
1755
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
1756
|
+
min-block-size: 44px;
|
|
1757
|
+
padding: ${s(2.5)} ${s(3)};
|
|
1758
|
+
font: inherit;
|
|
1759
|
+
/* 16px whatever the page around it sets, so a phone does not zoom in on focus. */
|
|
1760
|
+
font-size: max(${g("md")}, 16px);
|
|
1761
|
+
color: ${t.text};
|
|
1762
|
+
background: ${t.surfaceCard};
|
|
1763
|
+
border: ${t.borderThin} solid ${t.border};
|
|
1764
|
+
border-radius: ${t.radiusLg};
|
|
1765
|
+
}
|
|
1766
|
+
input:focus-visible, select:focus-visible { border-color: ${t.brand}; box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo}; outline: none; }
|
|
1767
|
+
:host([invalid]) input, :host([invalid]) select { border-color: ${t.danger}; border-width: ${t.borderThick}; }
|
|
1768
|
+
.btn {
|
|
1769
|
+
min-block-size: 44px;
|
|
1770
|
+
padding: ${s(2.5)} ${s(4)};
|
|
1771
|
+
font: inherit;
|
|
1772
|
+
font-weight: ${m("semibold")};
|
|
1773
|
+
color: ${t.onBrand};
|
|
1774
|
+
background: ${t.brand};
|
|
1775
|
+
border: 0;
|
|
1776
|
+
border-radius: ${t.radiusLg};
|
|
1777
|
+
cursor: pointer;
|
|
1778
|
+
}
|
|
1779
|
+
.btn:hover { background: ${t.brandHover}; }
|
|
1780
|
+
.quiet { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; padding: 0; font: inherit; color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }
|
|
1781
|
+
.visually-hidden { ${E} }
|
|
1782
|
+
`,q=class extends f{static{this.properties={...f.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=[...f.styles,L,Et,p`
|
|
1783
|
+
.row { display: flex; flex-wrap: wrap; gap: ${s(2)}; align-items: flex-end; }
|
|
1784
|
+
.row label { display: block; ${b("sm")} font-weight: ${m("semibold")}; margin-block-end: ${s(1)}; }
|
|
1785
|
+
.postcode input { inline-size: 12ch; text-transform: uppercase; }
|
|
1786
|
+
.choose { margin-block-start: ${s(4)}; }
|
|
1787
|
+
.choose select { inline-size: 100%; }
|
|
1788
|
+
.manual { display: grid; gap: ${s(3)}; margin-block-start: ${s(3)}; }
|
|
1789
|
+
.manual label { display: block; ${b("sm")} margin-block-end: ${s(1)}; }
|
|
1790
|
+
.manual input { inline-size: 100%; }
|
|
1791
|
+
.note { ${b("sm")} color: ${t.textMuted}; margin: ${s(2)} 0 0; }
|
|
1792
|
+
.switch { margin-block-start: ${s(3)}; }
|
|
1793
|
+
`]}async find(){let e=this.postcode.trim().toUpperCase();if(e){if(this.dispatchEvent(new CustomEvent("impakt-lookup",{detail:{postcode:e},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",e);let r=await(await fetch(i)).json();this.addresses=Array.isArray(r)?r:[]}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 e=(i,r,n)=>o`<div><label for=${this.id_(i)}>${r}</label><input id=${this.id_(i)} autocomplete=${n} @input=${()=>this.setFormValue(this.manualLine())} /></div>`;return o`<div class="manual" role="group" aria-label=${this.label}>
|
|
1794
|
+
${e("line1",x("Building and street"),"address-line1")}
|
|
1795
|
+
${e("line2",x("Second line (optional)"),"address-line2")}
|
|
1796
|
+
${e("town",x("Town or city"),"address-level2")}
|
|
1797
|
+
${e("mpostcode",x("Postcode"),"postal-code")}
|
|
1798
|
+
<button class="quiet switch" type="button" @click=${()=>{this.manual=!1}}>${x("Find the address from the postcode")}</button>
|
|
1799
|
+
</div>`}return o`
|
|
1800
|
+
<div class="row">
|
|
1801
|
+
<div class="postcode"><label for=${this.controlId}>${this.postcodeLabel}</label>
|
|
1802
|
+
<input id=${this.controlId} autocomplete="postal-code" .value=${this.postcode} aria-describedby=${this.describedBy}
|
|
1803
|
+
@input=${e=>{this.postcode=e.target.value}}
|
|
1804
|
+
@keydown=${e=>{e.key==="Enter"&&(e.preventDefault(),this.find())}} /></div>
|
|
1805
|
+
<button class="btn" type="button" ?disabled=${this.busy} @click=${()=>this.find()}>${this.busy?"Finding\u2026":this.findText}</button>
|
|
1806
|
+
</div>
|
|
1807
|
+
${this.addresses.length?o`<div class="choose"><label class="label" for=${this.id_("choose")}>${this.chooseLabel}</label>
|
|
1808
|
+
<select id=${this.id_("choose")} @change=${e=>this.setFormValue(e.target.value)}>
|
|
1809
|
+
<option value="">${this.addresses.length} ${this.addresses.length===1?"address":"addresses"} found</option>
|
|
1810
|
+
${this.addresses.map(e=>o`<option value=${e.line} ?selected=${e.line===this.value}>${e.line}</option>`)}
|
|
1811
|
+
</select></div>`:this.searched&&!this.busy?o`<p class="note" role="status">${this.notFoundText}</p>`:l}
|
|
1812
|
+
<button class="quiet switch" type="button" @click=${()=>{this.manual=!0}}>${this.manualText}</button>
|
|
1813
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},ot=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,v,R,M("a"),p`
|
|
1814
|
+
:host { display: block; }
|
|
1815
|
+
.box { padding: ${s(5)}; border: ${t.borderThick} solid ${t.danger}; border-inline-start-width: 6px; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }
|
|
1816
|
+
.box:focus { outline: 3px solid ${t.danger}; outline-offset: 2px; }
|
|
1817
|
+
h2 { margin: 0 0 ${s(3)}; ${b("lg")} font-weight: ${m("bold")}; color: ${t.text}; }
|
|
1818
|
+
ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${s(2)}; }
|
|
1819
|
+
a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.dangerText}; font-weight: ${m("semibold")}; text-underline-offset: 0.2em; }
|
|
1820
|
+
`]}go(e,i){let r=i.replace(/^#/,""),d=this.getRootNode().querySelector?.(`#${CSS.escape(r)}`)??document.getElementById(r);d&&(e.preventDefault(),d.scrollIntoView({block:"center"}),d.focus())}updated(e){let i=e.get("items");e.has("items")&&this.items.length&&!i?.length&&this.renderRoot.querySelector(".box")?.focus()}render(){return this.items.length?o`<div class="box" role="alert" tabindex="-1" aria-labelledby=${this.id_("h")} part="box">
|
|
1821
|
+
<h2 id=${this.id_("h")}>${this.heading}</h2>
|
|
1822
|
+
<ul>${this.items.map(e=>o`<li><a href=${e.href} @click=${i=>this.go(i,e.href)}>${e.text}</a></li>`)}</ul>
|
|
1823
|
+
</div>`:l}},ki=a=>a>=1048576?x("{size} MB",{size:(a/1048576).toFixed(1)}):x("{size} KB",{size:Math.max(1,Math.round(a/1024))}),K=class extends f{static{this.properties={...f.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=[...f.styles,Et,T,M("label.btn, .quiet"),p`
|
|
1824
|
+
.zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${s(3)}; padding: ${s(5)}; border: 2px dashed ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }
|
|
1825
|
+
.zone.over { border-color: ${t.brand}; background: ${t.brandSubtle}; }
|
|
1826
|
+
:host([invalid]) .zone { border-color: ${t.danger}; border-style: solid; }
|
|
1827
|
+
:host([disabled]) label.btn { cursor: not-allowed; }
|
|
1828
|
+
.drop { color: ${t.textMuted}; }
|
|
1829
|
+
input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
|
|
1830
|
+
label.btn { display: inline-flex; align-items: center; }
|
|
1831
|
+
input[type='file']:focus-visible + label.btn { box-shadow: ${t.focusShadow}; }
|
|
1832
|
+
ul { margin: ${s(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${s(2)}; }
|
|
1833
|
+
li { display: flex; justify-content: space-between; gap: ${s(3)}; align-items: center; padding: ${s(2)} ${s(3)}; border-radius: ${t.radius}; background: ${t.surfaceInset}; }
|
|
1834
|
+
.size { color: ${t.textMuted}; ${b("sm")} }
|
|
1835
|
+
`]}fits(e){if(this.maxSizeMb&&e.size>this.maxSizeMb*1048576)return x("{file} is bigger than {size} MB",{file:e.name,size:this.maxSizeMb});let i=this.accept.split(",").map(r=>r.trim().toLowerCase()).filter(Boolean);return i.length&&!i.some(r=>r.startsWith(".")?e.name.toLowerCase().endsWith(r):e.type===r||r.endsWith("/*")&&e.type.startsWith(r.slice(0,-1)))?x("{file} must be {kinds}",{file:e.name,kinds:i.map(r=>r.replace(".","").toUpperCase()).join(", ")}):null}add(e){let i=Array.from(e),r=i.map(h=>this.fits(h)).filter(h=>!!h),n=i.filter(h=>!this.fits(h)),d=this.manyFiles?n:n.slice(0,1);this.files=this.manyFiles?[...this.files,...n]:d.length?d:this.files,this.error=r.join(". "),this.said=d.map(h=>x("{file} added",{file:h.name})).join(". "),this.sync()}removeFile(e){let i=this.files[e];this.files=this.files.filter((r,n)=>n!==e),this.said=i?x("{file} removed",{file:i.name}):"",this.sync(),this.updateComplete.then(()=>this.renderRoot.querySelector('input[type="file"]')?.focus())}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}sync(){this.setFormValue(this.files.map(e=>e.name).join(", ")),this.dispatchEvent(new CustomEvent("impakt-files",{detail:{files:this.files},bubbles:!0,composed:!0}))}renderControl(){return o`
|
|
1836
|
+
<div class="zone ${this.over?"over":""}"
|
|
1837
|
+
@dragover=${e=>{e.preventDefault(),this.over=!0}}
|
|
1838
|
+
@dragleave=${()=>{this.over=!1}}
|
|
1839
|
+
@drop=${e=>{e.preventDefault(),this.over=!1,e.dataTransfer?.files&&this.add(e.dataTransfer.files)}}>
|
|
1840
|
+
<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}
|
|
1841
|
+
@change=${e=>{let i=e.target.files;i&&this.add(i),e.target.value=""}} />
|
|
1842
|
+
<label class="btn" for=${this.controlId}>${this.chooseText}</label>
|
|
1843
|
+
<span class="drop">${this.dropText}</span>
|
|
1844
|
+
</div>
|
|
1845
|
+
<p class="visually-hidden" role="status">${this.said}</p>
|
|
1846
|
+
${this.files.length?o`<ul aria-label=${x("Files added")}>${this.files.map((e,i)=>o`<li><span>${e.name} <span class="size">${ki(e.size)}</span></span><button class="quiet" type="button" @click=${()=>this.removeFile(i)}>${x("Remove")}<span class="visually-hidden"> ${e.name}</span></button></li>`)}</ul>`:l}
|
|
1847
|
+
`}};function Tt(a){try{return new Intl.NumberFormat(I(),{style:"currency",currency:a,maximumFractionDigits:0}).formatToParts(0).find(e=>e.type==="currency")?.value??""}catch{return""}}function zt(a){let e=a.replace(/[^\d.]/g,"");if(!e)return"";let[i,r]=e.split(".");return`${Number(i).toLocaleString("en-GB")}${r!==void 0?`.${r.slice(0,2)}`:""}`}var ae=class extends f{static{this.properties={...f.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=[...f.styles,L,Et,p`
|
|
1848
|
+
.wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impakt-field-width)); }
|
|
1849
|
+
.sign { display: flex; align-items: center; padding: 0 ${s(3)}; font-weight: ${m("semibold")}; background: ${t.surfaceInset}; border: ${t.borderThin} solid ${t.border}; border-inline-end: 0; border-radius: ${t.radiusLg} 0 0 ${t.radiusLg}; }
|
|
1850
|
+
.wrap input { inline-size: 100%; border-radius: 0 ${t.radiusLg} ${t.radiusLg} 0; }
|
|
1851
|
+
`]}willUpdate(e){e.has("value")&&this.value!==this.shown.replace(/,/g,"")&&(this.shown=zt(this.value))}typed(e){let i=e.replace(/[^\d.]/g,""),r=this.pence?i:i.split(".")[0];this.shown=e,this.setFormValue(r)}check(){this.shown=zt(this.value);let e=Number(this.value);if(!this.value)return;let i=r=>`${Tt(this.currency)}${r.toLocaleString("en-GB")}`;this.lowest!==void 0&&e<this.lowest?this.error=x("Enter an amount of {amount} or more",{amount:i(this.lowest)}):this.highest!==void 0&&e>this.highest?this.error=x("Enter an amount of {amount} or less",{amount:i(this.highest)}):(this.error===x("Enter an amount of {amount} or more",{amount:i(this.lowest??0)})||this.error===x("Enter an amount of {amount} or less",{amount:i(this.highest??0)}))&&(this.error="")}get describedBy(){let e=[Tt(this.currency)?this.id_("sign"):"",super.describedBy===l?"":String(super.describedBy)].filter(Boolean);return e.length?e.join(" "):l}renderControl(){return o`<div class="wrap">
|
|
1852
|
+
<span class="sign" id=${this.id_("sign")}>${Tt(this.currency)}</span>
|
|
1853
|
+
<input id=${this.controlId} inputmode=${this.pence?"decimal":"numeric"} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}
|
|
1854
|
+
aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}
|
|
1855
|
+
@input=${e=>this.typed(e.target.value)} @blur=${()=>this.check()} />
|
|
1856
|
+
</div>`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},nt=class extends f{static{this.properties={...f.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=[...f.styles,p`
|
|
1857
|
+
.top { display: flex; justify-content: space-between; gap: ${s(3)}; }
|
|
1858
|
+
output { font-weight: ${m("semibold")}; color: ${t.text}; }
|
|
1859
|
+
input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${t.brand}; }
|
|
1860
|
+
.ends { display: flex; justify-content: space-between; ${b("sm")} color: ${t.textMuted}; }
|
|
1861
|
+
`]}shownAs(e){let i=I(this),r=e.toLocaleString(i);if(this.currency)try{r=new Intl.NumberFormat(i,{style:"currency",currency:this.currency,maximumFractionDigits:0}).format(e)}catch{}return this.unit?`${r} ${this.unit}`:r}render(){let e=Number(this.value)||0;return o`
|
|
1862
|
+
<div class="top"><label class="label" for=${this.controlId}>${this.label}${this.required?o` <span class="required">(${this.requiredText})</span>`:l}</label>
|
|
1863
|
+
<output for=${this.controlId}>${this.shownAs(e)}</output></div>
|
|
1864
|
+
${this.description?o`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
1865
|
+
${this.renderControl()}
|
|
1866
|
+
<div class="ends" aria-hidden="true"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>
|
|
1867
|
+
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
1868
|
+
`}renderControl(){return o`<input id=${this.controlId} type="range" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}
|
|
1869
|
+
aria-valuetext=${this.shownAs(Number(this.value)||0)} aria-describedby=${this.describedBy}
|
|
1870
|
+
@input=${e=>this.setFormValue(e.target.value)} />`}},Xt={done:"Completed","in-progress":"In progress","not-started":"Not started","cannot-start":"Cannot start yet"},at=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,v,R,M("a"),p`
|
|
1871
|
+
:host { display: block; }
|
|
1872
|
+
.h { margin: 0 0 ${s(2)}; ${b("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
1873
|
+
.count { margin: 0 0 ${s(4)}; color: ${t.textMuted}; }
|
|
1874
|
+
ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${t.rule}; }
|
|
1875
|
+
li { display: flex; justify-content: space-between; align-items: center; gap: ${s(4)}; padding: ${s(4)} 0; border-block-end: 1px solid ${t.rule}; }
|
|
1876
|
+
a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.link}; font-weight: ${m("semibold")}; text-underline-offset: 0.2em; }
|
|
1877
|
+
.title { font-weight: ${m("semibold")}; }
|
|
1878
|
+
.hint { display: block; ${b("sm")} color: ${t.textMuted}; }
|
|
1879
|
+
.tag { flex-shrink: 0; padding: ${s(1)} ${s(2.5)}; border-radius: 999px; ${b("sm")} font-weight: ${m("semibold")}; background: ${t.surfaceInset}; color: ${t.text}; }
|
|
1880
|
+
.tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
1881
|
+
.tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }
|
|
1882
|
+
.tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }
|
|
1883
|
+
`]}render(){let e=this.items.filter(i=>i.status==="done").length;return o`
|
|
1884
|
+
${this.heading?o`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1885
|
+
${this.items.length?o`<p class="count">${x(this.items.length===1?"You have completed {done} of {total} part.":"You have completed {done} of {total} parts.",{done:e,total:this.items.length})}</p>`:l}
|
|
1886
|
+
<ul>${this.items.map(i=>o`<li>
|
|
1887
|
+
<span>${i.href&&i.status!=="cannot-start"?o`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>`:o`<span class="title">${i.title}</span>`}
|
|
1888
|
+
${i.hint?o`<span class="hint">${i.hint}</span>`:l}</span>
|
|
1889
|
+
<span class="tag" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${Xt[i.status]?x(Xt[i.status]):i.status}</span>
|
|
1890
|
+
</li>`)}</ul>`}};q.createProperty("manual",{state:!0});q.createProperty("postcode",{state:!0});q.createProperty("searched",{state:!0});q.createProperty("busy",{state:!0});K.createProperty("files",{state:!0});K.createProperty("over",{state:!0});K.createProperty("said",{state:!0});ae.createProperty("shown",{state:!0});customElements.define("impakt-address-lookup",q);customElements.define("impakt-error-summary",ot);customElements.define("impakt-file-upload",K);customElements.define("impakt-money-input",ae);customElements.define("impakt-range-input",nt);customElements.define("impakt-task-list",at);export{re as CYCLE,f as FieldElement,vt as ICONS,ci as ICON_NAMES,_e as ImpaktAccordion,q as ImpaktAddressLookup,ye as ImpaktAlert,tt as ImpaktAvatar,it as ImpaktAvatarGroup,Ie as ImpaktBadge,We as ImpaktBreadcrumbs,me as ImpaktButton,ke as ImpaktCard,fe as ImpaktCheckbox,Be as ImpaktCheckboxGroup,Le as ImpaktChip,Ne as ImpaktDateInput,Oe as ImpaktDialog,Ke as ImpaktDivider,Ee as ImpaktDocumentLink,Ze as ImpaktDrawer,c as ImpaktElement,rt as ImpaktEmptyState,ot as ImpaktErrorSummary,Ye as ImpaktFieldset,K as ImpaktFileUpload,De as ImpaktGrid,ve as ImpaktHeading,qe as ImpaktHelp,ue as ImpaktIcon,Te as ImpaktImage,Se as ImpaktLink,Pe as ImpaktList,ze as ImpaktLogo,Qe as ImpaktMenu,ae as ImpaktMoneyInput,Ue as ImpaktNav,Fe as ImpaktPage,et as ImpaktPagination,Me as ImpaktPrice,Ce as ImpaktProgress,$e as ImpaktRadioGroup,nt as ImpaktRangeInput,je as ImpaktSection,be as ImpaktSelect,st as ImpaktSlotPicker,Ve as ImpaktSpacer,xe as ImpaktStack,Ae as ImpaktSummaryList,Re as ImpaktTable,Ge as ImpaktTabs,at as ImpaktTaskList,we as ImpaktText,ge as ImpaktTextInput,He as ImpaktTextarea,Je as ImpaktToast,Xe as ImpaktVisuallyHidden,N as LitElement,ie as TONE,Wt as base,p as css,L as fieldWidths,v as focusRing,g as fontSize,m as fontWeight,zt as groupDigits,Kt as hideOn,o as html,z as iconSvg,C as lineHeight,ne as lockScroll,D as noChange,l as nothing,I as pageLocale,Ut as reducedMotion,xt as render,x as say,s as space,R as spaceAround,k as svg,t,T as targetSize,u as token,wt as toneOf,M as touchTarget,b as type,W as unlockScroll,_ as unsafeCSS,E as visuallyHidden};
|
|
1891
|
+
/*! Bundled license information:
|
|
1892
|
+
|
|
1893
|
+
@lit/reactive-element/css-tag.js:
|
|
1894
|
+
(**
|
|
1895
|
+
* @license
|
|
1896
|
+
* Copyright 2019 Google LLC
|
|
1897
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1898
|
+
*)
|
|
1899
|
+
|
|
1900
|
+
@lit/reactive-element/reactive-element.js:
|
|
1901
|
+
(**
|
|
1902
|
+
* @license
|
|
1903
|
+
* Copyright 2017 Google LLC
|
|
1904
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1905
|
+
*)
|
|
1906
|
+
|
|
1907
|
+
lit-html/lit-html.js:
|
|
1908
|
+
(**
|
|
1909
|
+
* @license
|
|
1910
|
+
* Copyright 2017 Google LLC
|
|
1911
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1912
|
+
*)
|
|
1913
|
+
|
|
1914
|
+
lit-element/lit-element.js:
|
|
1915
|
+
(**
|
|
1916
|
+
* @license
|
|
1917
|
+
* Copyright 2017 Google LLC
|
|
1918
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1919
|
+
*)
|
|
1920
|
+
|
|
1921
|
+
lit-html/is-server.js:
|
|
1922
|
+
(**
|
|
1923
|
+
* @license
|
|
1924
|
+
* Copyright 2022 Google LLC
|
|
1925
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1926
|
+
*)
|
|
1927
|
+
*/
|
|
1928
|
+
//# sourceMappingURL=atomic-ui.js.map
|