@atomic-ui/ui 0.3.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -33
- package/custom-elements.json +5986 -15880
- package/dist/base/FieldElement.d.ts +4 -4
- package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
- package/dist/base/styles.d.ts +7 -0
- package/dist/base/tokens.d.ts +1 -1
- package/dist/base/tone.d.ts +20 -0
- package/dist/{chunk-3RE4H2XO.js → chunk-3EF4T242.js} +7 -7
- package/dist/chunk-3EF4T242.js.map +1 -0
- package/dist/chunk-4ZQTXTPA.js +76 -0
- package/dist/chunk-4ZQTXTPA.js.map +1 -0
- package/dist/{chunk-NKMVICB5.js → chunk-5Y3HYRCU.js} +7 -7
- package/dist/chunk-5Y3HYRCU.js.map +1 -0
- package/dist/{chunk-ZOTAAYO5.js → chunk-5ZQVL3V2.js} +19 -12
- package/dist/chunk-5ZQVL3V2.js.map +1 -0
- package/dist/{chunk-4OYHT4BN.js → chunk-A7YBFS4H.js} +15 -15
- package/dist/chunk-A7YBFS4H.js.map +1 -0
- package/dist/{chunk-DAH7RLW3.js → chunk-DE3INTHZ.js} +6 -6
- package/dist/chunk-DE3INTHZ.js.map +1 -0
- package/dist/{chunk-HXINWP3V.js → chunk-EJD6LT7E.js} +20 -83
- package/dist/chunk-EJD6LT7E.js.map +1 -0
- package/dist/{chunk-P6GDMZK4.js → chunk-EJSX4WCD.js} +9 -9
- package/dist/chunk-EJSX4WCD.js.map +1 -0
- package/dist/{chunk-46BYUQ5A.js → chunk-FWR6SEIA.js} +33 -33
- package/dist/chunk-FWR6SEIA.js.map +1 -0
- package/dist/{chunk-CUUBAETM.js → chunk-GJPHQLLN.js} +8 -8
- package/dist/chunk-GJPHQLLN.js.map +1 -0
- package/dist/{chunk-R7FKGFW6.js → chunk-HNBG2POR.js} +7 -7
- package/dist/chunk-HNBG2POR.js.map +1 -0
- package/dist/{chunk-DKZ425AM.js → chunk-HNZQ7LM4.js} +11 -11
- package/dist/chunk-HNZQ7LM4.js.map +1 -0
- package/dist/{chunk-55DK75QF.js → chunk-I54DOEZB.js} +6 -6
- package/dist/chunk-I54DOEZB.js.map +1 -0
- package/dist/{chunk-WGPB3QQU.js → chunk-KFAGXPIK.js} +10 -10
- package/dist/chunk-KFAGXPIK.js.map +1 -0
- package/dist/{chunk-J2FACXYI.js → chunk-PANH23MF.js} +12 -12
- package/dist/chunk-PANH23MF.js.map +1 -0
- package/dist/{chunk-KKJEEKL2.js → chunk-PYVUQNFQ.js} +8 -8
- package/dist/chunk-PYVUQNFQ.js.map +1 -0
- package/dist/{chunk-RWWRTURA.js → chunk-Q54FX3SY.js} +8 -8
- package/dist/chunk-Q54FX3SY.js.map +1 -0
- package/dist/{chunk-AUVIOU5G.js → chunk-QBORJTS4.js} +36 -36
- package/dist/chunk-QBORJTS4.js.map +1 -0
- package/dist/{chunk-5QSTXIPG.js → chunk-RXX4CN5J.js} +7 -7
- package/dist/chunk-RXX4CN5J.js.map +1 -0
- package/dist/{chunk-XPCU4KUY.js → chunk-SV77SN6P.js} +7 -7
- package/dist/chunk-SV77SN6P.js.map +1 -0
- package/dist/{chunk-FVCM4WHD.js → chunk-TAZZLOUY.js} +10 -10
- package/dist/chunk-TAZZLOUY.js.map +1 -0
- package/dist/{chunk-KMCGX76Y.js → chunk-TRZO5CHU.js} +7 -7
- package/dist/chunk-TRZO5CHU.js.map +1 -0
- package/dist/{chunk-F4YQWKK2.js → chunk-UPOTBKKK.js} +7 -7
- package/dist/chunk-UPOTBKKK.js.map +1 -0
- package/dist/{chunk-APJ5JGRW.js → chunk-WP5WJ4V5.js} +6 -6
- package/dist/chunk-WP5WJ4V5.js.map +1 -0
- package/dist/{chunk-TCXKZDMR.js → chunk-WS5AUJ35.js} +7 -7
- package/dist/chunk-WS5AUJ35.js.map +1 -0
- package/dist/{chunk-7P4Z4CLK.js → chunk-WWYYNR3Z.js} +50 -49
- package/dist/chunk-WWYYNR3Z.js.map +1 -0
- package/dist/{chunk-RYBY35QE.js → chunk-XU2XODVH.js} +6 -6
- package/dist/chunk-XU2XODVH.js.map +1 -0
- package/dist/{chunk-3KO55PZK.js → chunk-YR6T73GY.js} +18 -11
- package/dist/chunk-YR6T73GY.js.map +1 -0
- package/dist/{chunk-IOBSIAHB.js → chunk-YYYQPKQ7.js} +24 -24
- package/dist/chunk-YYYQPKQ7.js.map +1 -0
- package/dist/{chunk-PO6FCAIS.js → chunk-Z45LY6BT.js} +9 -9
- package/dist/chunk-Z45LY6BT.js.map +1 -0
- package/dist/{chunk-DJEZW7AC.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 +25 -25
- package/dist/components/app-ui.js +21 -21
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.js +9 -0
- package/dist/components/blocks.d.ts +10 -73
- 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 +4 -4
- package/dist/components/dialog.js +4 -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 +18 -18
- 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 +6 -6
- package/dist/components/table.js +5 -5
- 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 -270
- package/dist/standalone/atomic-ui.js +796 -2002
- package/dist/standalone/atomic-ui.js.map +4 -4
- package/dist/standalone/index.html +51 -52
- package/package.json +4 -4
- package/specimen/index.html +51 -52
- package/dist/chunk-37PA72FC.js +0 -725
- package/dist/chunk-37PA72FC.js.map +0 -1
- package/dist/chunk-3KO55PZK.js.map +0 -1
- package/dist/chunk-3RE4H2XO.js.map +0 -1
- package/dist/chunk-46BYUQ5A.js.map +0 -1
- package/dist/chunk-4OYHT4BN.js.map +0 -1
- package/dist/chunk-55DK75QF.js.map +0 -1
- package/dist/chunk-5QSTXIPG.js.map +0 -1
- package/dist/chunk-7P4Z4CLK.js.map +0 -1
- package/dist/chunk-APJ5JGRW.js.map +0 -1
- package/dist/chunk-AUVIOU5G.js.map +0 -1
- package/dist/chunk-CUUBAETM.js.map +0 -1
- package/dist/chunk-DAH7RLW3.js.map +0 -1
- package/dist/chunk-DJEZW7AC.js.map +0 -1
- package/dist/chunk-DKZ425AM.js.map +0 -1
- package/dist/chunk-F4YQWKK2.js.map +0 -1
- package/dist/chunk-FVCM4WHD.js.map +0 -1
- package/dist/chunk-GBRML4RF.js +0 -264
- package/dist/chunk-GBRML4RF.js.map +0 -1
- package/dist/chunk-HXINWP3V.js.map +0 -1
- package/dist/chunk-IOBSIAHB.js.map +0 -1
- package/dist/chunk-IZOTGWWI.js +0 -361
- package/dist/chunk-IZOTGWWI.js.map +0 -1
- package/dist/chunk-J2FACXYI.js.map +0 -1
- package/dist/chunk-KKJEEKL2.js.map +0 -1
- package/dist/chunk-KMCGX76Y.js.map +0 -1
- package/dist/chunk-NKMVICB5.js.map +0 -1
- package/dist/chunk-OFLMG6RN.js +0 -428
- package/dist/chunk-OFLMG6RN.js.map +0 -1
- package/dist/chunk-P6GDMZK4.js.map +0 -1
- package/dist/chunk-PO6FCAIS.js.map +0 -1
- package/dist/chunk-PWLZFGS3.js +0 -494
- package/dist/chunk-PWLZFGS3.js.map +0 -1
- package/dist/chunk-QJIB36DM.js +0 -249
- package/dist/chunk-QJIB36DM.js.map +0 -1
- package/dist/chunk-R7FKGFW6.js.map +0 -1
- package/dist/chunk-RWWRTURA.js.map +0 -1
- package/dist/chunk-RYBY35QE.js.map +0 -1
- package/dist/chunk-S7F5VKWU.js +0 -453
- package/dist/chunk-S7F5VKWU.js.map +0 -1
- package/dist/chunk-T5W3FDSF.js +0 -396
- package/dist/chunk-T5W3FDSF.js.map +0 -1
- package/dist/chunk-TCXKZDMR.js.map +0 -1
- package/dist/chunk-WGPB3QQU.js.map +0 -1
- package/dist/chunk-XPCU4KUY.js.map +0 -1
- package/dist/chunk-YRYZUYY7.js +0 -236
- package/dist/chunk-YRYZUYY7.js.map +0 -1
- package/dist/chunk-ZOTAAYO5.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 -409
- 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
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/* @atomic-ui/ui version 0.
|
|
2
|
-
var
|
|
3
|
-
\f\r]`,
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Di=/'/g,qi=/"/g,Ki=/^(?:script|style|textarea|title)$/i,vi=o=>(t,...i)=>({_$litType$:o,strings:t,values:i}),a=vi(1),z=vi(2),Qr=vi(3),Y=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Wi=new WeakMap,X=G.createTreeWalker(G,129);function Xi(o,t){if(!xi(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Oi!==void 0?Oi.createHTML(t):t}var Tr=(o,t)=>{let i=o.length-1,s=[],n,d=t===2?"<svg>":t===3?"<math>":"",p=de;for(let b=0;b<i;b++){let y=o[b],x,v,M=-1,I=0;for(;I<y.length&&(p.lastIndex=I,v=p.exec(y),v!==null);)I=p.lastIndex,p===de?v[1]==="!--"?p=ji:v[1]!==void 0?p=Fi:v[2]!==void 0?(Ki.test(v[2])&&(n=RegExp("</"+v[2],"g")),p=K):v[3]!==void 0&&(p=K):p===K?v[0]===">"?(p=n??de,M=-1):v[1]===void 0?M=-2:(M=p.lastIndex-v[2].length,x=v[1],p=v[3]===void 0?K:v[3]==='"'?qi:Di):p===qi||p===Di?p=K:p===ji||p===Fi?p=de:(p=K,n=void 0);let N=p===K&&o[b+1].startsWith("/>")?" ":"";d+=p===de?y+wr:M>=0?(s.push(x),y.slice(0,M)+Ui+y.slice(M)+D+N):y+D+(M===-2?b:N)}return[Xi(o,d+(o[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},he=class o{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let d=0,p=0,b=t.length-1,y=this.parts,[x,v]=Tr(t,i);if(this.el=o.createElement(x,s),X.currentNode=this.el.content,i===2||i===3){let M=this.el.content.firstChild;M.replaceWith(...M.childNodes)}for(;(n=X.nextNode())!==null&&y.length<b;){if(n.nodeType===1){if(n.hasAttributes())for(let M of n.getAttributeNames())if(M.endsWith(Ui)){let I=v[p++],N=n.getAttribute(M).split(D),J=/([.?@])?(.*)/.exec(I);y.push({type:1,index:d,name:J[2],strings:N,ctor:J[1]==="."?gi:J[1]==="?"?bi:J[1]==="@"?fi:ie}),n.removeAttribute(M)}else M.startsWith(D)&&(y.push({type:6,index:d}),n.removeAttribute(M));if(Ki.test(n.tagName)){let M=n.textContent.split(D),I=M.length-1;if(I>0){n.textContent=we?we.emptyScript:"";for(let N=0;N<I;N++)n.append(M[N],ce()),X.nextNode(),y.push({type:2,index:++d});n.append(M[I],ce())}}}else if(n.nodeType===8)if(n.data===Vi)y.push({type:2,index:d});else{let M=-1;for(;(M=n.data.indexOf(D,M+1))!==-1;)y.push({type:7,index:d}),M+=D.length-1}d++}}static createElement(t,i){let s=G.createElement("template");return s.innerHTML=t,s}};function te(o,t,i=o,s){if(t===Y)return t;let n=s!==void 0?i._$Co?.[s]:i._$Cl,d=pe(t)?void 0:t._$litDirective$;return n?.constructor!==d&&(n?._$AO?.(!1),d===void 0?n=void 0:(n=new d(o),n._$AT(o,i,s)),s!==void 0?(i._$Co??=[])[s]=n:i._$Cl=n),n!==void 0&&(t=te(o,n._$AS(o,t.values),n,s)),t}var mi=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:s}=this._$AD,n=(t?.creationScope??G).importNode(i,!0);X.currentNode=n;let d=X.nextNode(),p=0,b=0,y=s[0];for(;y!==void 0;){if(p===y.index){let x;y.type===2?x=new ue(d,d.nextSibling,this,t):y.type===1?x=new y.ctor(d,y.name,y.strings,this,t):y.type===6&&(x=new $i(d,this,t)),this._$AV.push(x),y=s[++b]}p!==y?.index&&(d=X.nextNode(),p++)}return X.currentNode=G,n}p(t){let i=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}},ue=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,n){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=te(this,t,i),pe(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==Y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Sr(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&pe(this._$AH)?this._$AA.nextSibling.data=t:this.T(G.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=he.createElement(Xi(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(i);else{let d=new mi(n,this),p=d.u(this.options);d.p(i),this.T(p),this._$AH=d}}_$AC(t){let i=Wi.get(t.strings);return i===void 0&&Wi.set(t.strings,i=new he(t)),i}k(t){xi(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,n=0;for(let d of t)n===i.length?i.push(s=new o(this.O(ce()),this.O(ce()),this,this.options)):s=i[n],s._$AI(d),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let s=Pi(t).nextSibling;Pi(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,n,d){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=d,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=l}_$AI(t,i=this,s,n){let d=this.strings,p=!1;if(d===void 0)t=te(this,t,i,0),p=!pe(t)||t!==this._$AH&&t!==Y,p&&(this._$AH=t);else{let b=t,y,x;for(t=d[0],y=0;y<d.length-1;y++)x=te(this,b[s+y],i,y),x===Y&&(x=this._$AH[y]),p||=!pe(x)||x!==this._$AH[y],x===l?t=l:t!==l&&(t+=(x??"")+d[y+1]),this._$AH[y]=x}p&&!n&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},gi=class extends ie{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},bi=class extends ie{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},fi=class extends ie{constructor(t,i,s,n,d){super(t,i,s,n,d),this.type=5}_$AI(t,i=this){if((t=te(this,t,i,0)??l)===Y)return;let s=this._$AH,n=t===l&&s!==l||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,d=t!==l&&(s===l||n);n&&this.element.removeEventListener(this.name,this,s),d&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},$i=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){te(this,t)}};var zr=yi.litHtmlPolyfillSupport;zr?.(he,ue),(yi.litHtmlVersions??=[]).push("3.3.3");var Gi=(o,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(n===void 0){let d=i?.renderBefore??null;s._$litPart$=n=new ue(t.insertBefore(ce(),d),d,void 0,i??{})}return n._$AI(o),n};var ki=globalThis,q=class extends j{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Gi(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}};q._$litElement$=!0,q.finalized=!0,ki.litElementHydrateSupport?.({LitElement:q});var Ar=ki.litElementPolyfillSupport;Ar?.({LitElement:q});(ki.litElementVersions??=[]).push("4.2.2");var f=(o,t)=>H(`var(--impkt-${o.replace(/\./g,"-")}, ${t})`),e={brand:f("color.brand.default","#1f4ed8"),brandHover:f("color.brand.hover","#1b45be"),brandActive:f("color.brand.active","#183ba4"),brandSubtle:f("color.brand.subtle","#e4eafa"),onBrand:f("color.text.on-brand","#ffffff"),surfaceCard:f("color.surface.card","#ffffff"),surfaceInset:f("color.surface.inset","#f4f4f4"),surfaceSubtle:f("color.surface.subtle","#e4eafa"),text:f("color.text.default","#1a1a1a"),textMuted:f("color.text.muted","#717171"),textPlaceholder:f("color.text.placeholder","#767676"),textHeading:f("color.text.heading","#1f4ed8"),link:f("color.text.link","#1f4ed8"),linkHover:f("color.text.link-hover","#193ead"),border:f("color.border.default","#929292"),borderStrong:f("color.border.strong","#818181"),danger:f("color.status.danger.default","#c8102e"),dangerText:f("color.status.danger.text","#c8102e"),dangerSubtle:f("color.status.danger.subtle","#f8e2e6"),warning:f("color.status.warning.default","#b45309"),warningText:f("color.status.warning.text","#b45309"),warningSubtle:f("color.status.warning.subtle","#f6eae1"),success:f("color.status.success.default","#047857"),successText:f("color.status.success.text","#047857"),successSubtle:f("color.status.success.subtle","#e0f0ea"),info:f("color.status.info.default","#1f4ed8"),infoText:f("color.status.info.text","#1f4ed8"),infoSubtle:f("color.status.info.subtle","#e4eafa"),fontBody:f("font.family.body","system-ui, sans-serif"),fontHeading:f("font.family.heading","system-ui, sans-serif"),fontMono:f("font.family.mono","ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"),fontEyebrow:f("font.family.eyebrow","inherit"),focusShadow:f("focus.ring.shadow","0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a"),focusOffset:f("focus.ring.offset","2px"),targetMin:f("target.min","24px"),radiusSm:f("radius.sm","2px"),radius:f("radius.md","4px"),radiusLg:f("radius.lg","8px"),borderThin:f("border.width.thin","1px"),borderThick:f("border.width.thick","2px"),radiusXs:f("radius.xs","2px"),radiusXl:f("radius.xl","12px"),radius2xl:f("radius.2xl","16px"),hairline:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 10%, transparent)"),rule:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 15%, transparent)"),wash:H("color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 5%, transparent)"),brandHalo:H("color-mix(in srgb, var(--impkt-color-brand-default, #1f4ed8) 22%, transparent)"),shadowXs:f("shadow.xs","0 1px 2px 0 rgb(0 0 0 / 0.05)"),shadowSm:f("shadow.sm","0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"),shadowMd:f("shadow.md","0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"),shadowLg:f("shadow.lg","0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"),shadowXl:f("shadow.xl","0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"),trackingTight:f("font.tracking.tight","-0.02em"),trackingWide:f("font.tracking.wide","0.06em")},m=o=>H(`font-size: var(--impkt-font-size-${o}, 1rem); line-height: var(--impkt-font-leading-${o}, 1.5);`),r=o=>f(`space.${String(o).replace(".","-")}`,`${o*4}px`),$=o=>f(`font.size.${o}`,"1rem"),C=o=>f(`font.line-height.${o}`,"1.5"),u=o=>f(`font.weight.${o}`,"400"),w=h`
|
|
5
|
-
:host([space-above='sm']) { margin-block-start: ${
|
|
6
|
-
:host([space-above='md']) { margin-block-start: ${
|
|
7
|
-
:host([space-above='lg']) { margin-block-start: ${
|
|
8
|
-
:host([space-above='xl']) { margin-block-start: ${
|
|
9
|
-
:host([space-above='2xl']) { margin-block-start: clamp(${
|
|
10
|
-
:host([space-below='sm']) { margin-block-end: ${
|
|
11
|
-
:host([space-below='md']) { margin-block-end: ${
|
|
12
|
-
:host([space-below='lg']) { margin-block-end: ${
|
|
13
|
-
:host([space-below='xl']) { margin-block-end: ${
|
|
14
|
-
:host([space-below='2xl']) { margin-block-end: clamp(${
|
|
15
|
-
`;var
|
|
1
|
+
/* @atomic-ui/ui version 0.6.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
16
|
:host(:focus-visible),
|
|
17
17
|
:host(:not([disabled])) :focus-visible {
|
|
18
18
|
outline: 2px solid transparent;
|
|
19
|
-
outline-offset: ${
|
|
20
|
-
box-shadow: ${
|
|
19
|
+
outline-offset: ${t.focusOffset};
|
|
20
|
+
box-shadow: ${t.focusShadow};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
23
|
-
min-block-size: ${
|
|
24
|
-
min-inline-size: ${
|
|
25
|
-
`,E=
|
|
22
|
+
`,T=p`
|
|
23
|
+
min-block-size: ${t.targetMin};
|
|
24
|
+
min-inline-size: ${t.targetMin};
|
|
25
|
+
`,E=p`
|
|
26
26
|
position: absolute;
|
|
27
27
|
inline-size: 1px;
|
|
28
28
|
block-size: 1px;
|
|
@@ -32,7 +32,7 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
32
32
|
clip-path: inset(50%);
|
|
33
33
|
white-space: nowrap;
|
|
34
34
|
border: 0;
|
|
35
|
-
`,
|
|
35
|
+
`,Ut=p`
|
|
36
36
|
@media (prefers-reduced-motion: reduce) {
|
|
37
37
|
:host,
|
|
38
38
|
:host *,
|
|
@@ -44,11 +44,11 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
44
44
|
scroll-behavior: auto !important;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,Wt=p`
|
|
48
48
|
:host {
|
|
49
49
|
box-sizing: border-box;
|
|
50
|
-
font-family: ${
|
|
51
|
-
color: ${
|
|
50
|
+
font-family: ${t.fontBody};
|
|
51
|
+
color: ${t.text};
|
|
52
52
|
}
|
|
53
53
|
:host([hidden]) {
|
|
54
54
|
display: none !important;
|
|
@@ -58,12 +58,15 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
58
58
|
*::after {
|
|
59
59
|
box-sizing: inherit;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
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`
|
|
62
65
|
:host { display: inline-flex; vertical-align: middle; line-height: 0; }
|
|
63
|
-
:host([tone='brand']) { color: ${
|
|
64
|
-
:host([tone='muted']) { color: ${
|
|
66
|
+
:host([tone='brand']) { color: ${t.brand}; }
|
|
67
|
+
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
65
68
|
@media (forced-colors: active) { :host { color: CanvasText; } }
|
|
66
|
-
`]}render(){let
|
|
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`
|
|
67
70
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
68
71
|
:host {
|
|
69
72
|
display: inline-block;
|
|
@@ -73,26 +76,26 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
73
76
|
}
|
|
74
77
|
@media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }
|
|
75
78
|
button, a {
|
|
76
|
-
${
|
|
79
|
+
${T}
|
|
77
80
|
box-sizing: border-box;
|
|
78
81
|
text-decoration: none;
|
|
79
82
|
display: inline-flex;
|
|
80
83
|
align-items: center;
|
|
81
84
|
justify-content: center;
|
|
82
|
-
gap: ${
|
|
85
|
+
gap: ${s(2)};
|
|
83
86
|
inline-size: 100%;
|
|
84
87
|
min-block-size: 40px;
|
|
85
|
-
padding: ${
|
|
88
|
+
padding: ${s(2)} ${s(4)};
|
|
86
89
|
font-family: inherit;
|
|
87
|
-
${
|
|
88
|
-
font-weight: ${
|
|
89
|
-
border-radius: ${
|
|
90
|
-
border: ${
|
|
90
|
+
${b("sm")}
|
|
91
|
+
font-weight: ${m("semibold")};
|
|
92
|
+
border-radius: ${t.radiusLg};
|
|
93
|
+
border: ${t.borderThin} solid transparent;
|
|
91
94
|
cursor: pointer;
|
|
92
95
|
transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
93
96
|
}
|
|
94
|
-
:host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${
|
|
95
|
-
:host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${
|
|
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")} }
|
|
96
99
|
.icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }
|
|
97
100
|
/* The cursor is the only thing that changes while busy. Moving or
|
|
98
101
|
recolouring a control the moment it is pressed is how a user loses it. */
|
|
@@ -106,41 +109,41 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
106
109
|
|
|
107
110
|
/* Solid: the brand, with a hairline highlight along the top edge. */
|
|
108
111
|
.primary {
|
|
109
|
-
background: ${
|
|
110
|
-
color: ${
|
|
111
|
-
box-shadow: ${
|
|
112
|
+
background: ${t.brand};
|
|
113
|
+
color: ${t.onBrand};
|
|
114
|
+
box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);
|
|
112
115
|
}
|
|
113
116
|
.primary:hover:not([aria-disabled='true']) {
|
|
114
|
-
background: var(--
|
|
115
|
-
color: var(--
|
|
117
|
+
background: var(--impakt-color-action-hover, ${t.brandHover});
|
|
118
|
+
color: var(--impakt-color-action-on-hover, ${t.onBrand});
|
|
116
119
|
}
|
|
117
120
|
/* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */
|
|
118
121
|
.after { transition: transform 160ms ease-out; }
|
|
119
|
-
:is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--
|
|
122
|
+
:is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impakt-motion-button-turn, 0deg)); }
|
|
120
123
|
@media (prefers-reduced-motion: reduce) { .after { transition: none; } }
|
|
121
124
|
.primary:active:not([aria-disabled='true']) {
|
|
122
|
-
background: ${
|
|
125
|
+
background: ${t.brandActive};
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/* Outline: the card, a hairline border and the text colour, for the second choice. */
|
|
126
129
|
.secondary {
|
|
127
|
-
background: ${
|
|
128
|
-
color: ${
|
|
129
|
-
border-color: ${
|
|
130
|
-
box-shadow: ${
|
|
130
|
+
background: ${t.surfaceCard};
|
|
131
|
+
color: ${t.text};
|
|
132
|
+
border-color: ${t.rule};
|
|
133
|
+
box-shadow: ${t.shadowXs};
|
|
131
134
|
}
|
|
132
135
|
.secondary:hover:not([aria-disabled='true']) {
|
|
133
|
-
background: color-mix(in srgb, ${
|
|
134
|
-
border-color: color-mix(in srgb, ${
|
|
136
|
+
background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%);
|
|
137
|
+
border-color: color-mix(in srgb, ${t.text} 25%, transparent);
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
/* Plain: words only until it is pointed at. */
|
|
138
141
|
.ghost {
|
|
139
142
|
background: transparent;
|
|
140
|
-
color: ${
|
|
143
|
+
color: ${t.link};
|
|
141
144
|
}
|
|
142
145
|
.ghost:hover:not([aria-disabled='true']) {
|
|
143
|
-
background: ${
|
|
146
|
+
background: ${t.wash};
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
.sr-only {
|
|
@@ -155,7 +158,7 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
155
158
|
border-color: ButtonBorder;
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
|
-
`]}onClick(i){if(this.disabled||this.busy){i.preventDefault(),i.stopImmediatePropagation();return}this.type==="submit"&&this.internals?.form?.requestSubmit(),this.type==="reset"&&this.internals?.form?.reset()}render(){let i=
|
|
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`
|
|
159
162
|
<button
|
|
160
163
|
class=${this.variant}
|
|
161
164
|
type="button"
|
|
@@ -166,44 +169,44 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
166
169
|
@click=${this.onClick}
|
|
167
170
|
>
|
|
168
171
|
${i}
|
|
169
|
-
${this.busy?
|
|
172
|
+
${this.busy?o`<span class="sr-only">${this.busyLabel}</span>`:l}
|
|
170
173
|
</button>
|
|
171
|
-
`}};customElements.define("
|
|
172
|
-
:host { --
|
|
173
|
-
:host([width='xs']) { --
|
|
174
|
-
:host([width='sm']) { --
|
|
175
|
-
:host([width='md']) { --
|
|
176
|
-
:host([width='lg']) { --
|
|
177
|
-
`,
|
|
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`
|
|
178
181
|
:host {
|
|
179
182
|
display: block;
|
|
180
|
-
margin-block-end: ${
|
|
183
|
+
margin-block-end: ${s(4)};
|
|
181
184
|
}
|
|
182
185
|
.label {
|
|
183
186
|
display: block;
|
|
184
|
-
font-size: ${
|
|
185
|
-
font-weight: ${
|
|
187
|
+
font-size: ${g("sm")};
|
|
188
|
+
font-weight: ${m("semibold")};
|
|
186
189
|
line-height: ${C("normal")};
|
|
187
|
-
margin-block-end: ${
|
|
188
|
-
color: ${
|
|
190
|
+
margin-block-end: ${s(1)};
|
|
191
|
+
color: ${t.text};
|
|
189
192
|
}
|
|
190
193
|
.required {
|
|
191
|
-
font-weight: ${
|
|
192
|
-
color: ${
|
|
194
|
+
font-weight: ${m("regular")};
|
|
195
|
+
color: ${t.textMuted};
|
|
193
196
|
}
|
|
194
197
|
.description {
|
|
195
|
-
font-size: ${
|
|
198
|
+
font-size: ${g("sm")};
|
|
196
199
|
line-height: ${C("normal")};
|
|
197
|
-
color: ${
|
|
198
|
-
margin-block-end: ${
|
|
200
|
+
color: ${t.textMuted};
|
|
201
|
+
margin-block-end: ${s(2)};
|
|
199
202
|
}
|
|
200
203
|
.error {
|
|
201
|
-
font-size: ${
|
|
204
|
+
font-size: ${g("sm")};
|
|
202
205
|
line-height: ${C("normal")};
|
|
203
|
-
color: ${
|
|
204
|
-
margin-block-start: ${
|
|
206
|
+
color: ${t.dangerText};
|
|
207
|
+
margin-block-start: ${s(1)};
|
|
205
208
|
display: flex;
|
|
206
|
-
gap: ${
|
|
209
|
+
gap: ${s(1)};
|
|
207
210
|
}
|
|
208
211
|
.error:empty {
|
|
209
212
|
display: none;
|
|
@@ -211,16 +214,23 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
211
214
|
.visually-hidden {
|
|
212
215
|
${E}
|
|
213
216
|
}
|
|
214
|
-
|
|
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) {
|
|
215
224
|
opacity: 0.6;
|
|
225
|
+
cursor: not-allowed;
|
|
216
226
|
}
|
|
217
|
-
`]}get controlId(){return this.id_("control")}get describedBy(){let i=[this.description?this.id_("description"):"",this.error?this.id_("error"):""].filter(Boolean);return i.length?i.join(" "):l}focus(i){let
|
|
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`
|
|
218
228
|
<label class="label" for=${this.controlId} part="label">
|
|
219
|
-
${this.label}${this.required?
|
|
229
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
220
230
|
</label>
|
|
221
|
-
`}render(){return
|
|
231
|
+
`}render(){return o`
|
|
222
232
|
${this.renderLabel()}
|
|
223
|
-
${this.description?
|
|
233
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">
|
|
224
234
|
${this.description}
|
|
225
235
|
</div>`:l}
|
|
226
236
|
${this.renderControl()}
|
|
@@ -239,42 +249,42 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
239
249
|
>
|
|
240
250
|
${this.error||l}
|
|
241
251
|
</div>
|
|
242
|
-
`}setFormValue(i){this.value=i,this.internals?.setFormValue(i),this.dispatchEvent(new CustomEvent("
|
|
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`
|
|
243
253
|
input {
|
|
244
|
-
inline-size: min(100%, var(--
|
|
254
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
245
255
|
min-block-size: 44px;
|
|
246
|
-
padding: ${
|
|
256
|
+
padding: ${s(2.5)} ${s(3)};
|
|
247
257
|
font-family: inherit;
|
|
248
|
-
font-size: ${
|
|
249
|
-
color: ${
|
|
250
|
-
background: var(--
|
|
251
|
-
border: ${
|
|
252
|
-
border-radius: ${
|
|
253
|
-
box-shadow: var(--
|
|
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});
|
|
254
264
|
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
255
265
|
}
|
|
256
266
|
input:hover:not(:disabled) {
|
|
257
|
-
border-color: ${
|
|
267
|
+
border-color: ${t.borderStrong};
|
|
258
268
|
}
|
|
259
269
|
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
260
270
|
input:focus-visible {
|
|
261
|
-
border-color: ${
|
|
262
|
-
box-shadow: ${
|
|
271
|
+
border-color: ${t.brand};
|
|
272
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
263
273
|
}
|
|
264
274
|
input::placeholder {
|
|
265
|
-
color: ${
|
|
275
|
+
color: ${t.textPlaceholder};
|
|
266
276
|
}
|
|
267
277
|
input:disabled {
|
|
268
|
-
background: ${
|
|
278
|
+
background: ${t.surfaceInset};
|
|
269
279
|
cursor: not-allowed;
|
|
270
280
|
}
|
|
271
281
|
/* The border thickens as well as reddening. Colour alone would carry the
|
|
272
282
|
error, which 1.4.1 forbids — and the message below says it in words. */
|
|
273
283
|
:host([invalid]) input {
|
|
274
|
-
border-color: ${
|
|
275
|
-
border-width: ${
|
|
284
|
+
border-color: ${t.danger};
|
|
285
|
+
border-width: ${t.borderThick};
|
|
276
286
|
}
|
|
277
|
-
`]}renderControl(){return
|
|
287
|
+
`]}renderControl(){return o`
|
|
278
288
|
<input
|
|
279
289
|
id=${this.controlId}
|
|
280
290
|
part="input"
|
|
@@ -290,39 +300,39 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
290
300
|
?required=${this.required}
|
|
291
301
|
aria-describedby=${this.describedBy}
|
|
292
302
|
aria-invalid=${this.error?"true":l}
|
|
293
|
-
@input=${
|
|
303
|
+
@input=${e=>this.setFormValue(e.target.value)}
|
|
294
304
|
/>
|
|
295
|
-
`}updated(
|
|
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`
|
|
296
306
|
select {
|
|
297
|
-
inline-size: min(100%, var(--
|
|
307
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
298
308
|
min-block-size: 44px;
|
|
299
|
-
padding: ${
|
|
309
|
+
padding: ${s(2.5)} ${s(3)};
|
|
300
310
|
font-family: inherit;
|
|
301
|
-
font-size: ${
|
|
302
|
-
color: ${
|
|
303
|
-
background: var(--
|
|
304
|
-
border: ${
|
|
305
|
-
border-radius: ${
|
|
306
|
-
box-shadow: var(--
|
|
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});
|
|
307
317
|
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
308
318
|
}
|
|
309
319
|
select:hover:not(:disabled) {
|
|
310
|
-
border-color: ${
|
|
320
|
+
border-color: ${t.borderStrong};
|
|
311
321
|
}
|
|
312
322
|
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
313
323
|
select:focus-visible {
|
|
314
|
-
border-color: ${
|
|
315
|
-
box-shadow: ${
|
|
324
|
+
border-color: ${t.brand};
|
|
325
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
316
326
|
}
|
|
317
327
|
select:disabled {
|
|
318
|
-
background: ${
|
|
328
|
+
background: ${t.surfaceInset};
|
|
319
329
|
cursor: not-allowed;
|
|
320
330
|
}
|
|
321
331
|
:host([invalid]) select {
|
|
322
|
-
border-color: ${
|
|
323
|
-
border-width: ${
|
|
332
|
+
border-color: ${t.danger};
|
|
333
|
+
border-width: ${t.borderThick};
|
|
324
334
|
}
|
|
325
|
-
`]}renderControl(){return
|
|
335
|
+
`]}renderControl(){return o`
|
|
326
336
|
<select
|
|
327
337
|
id=${this.controlId}
|
|
328
338
|
part="select"
|
|
@@ -331,33 +341,33 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
331
341
|
?required=${this.required}
|
|
332
342
|
aria-describedby=${this.describedBy}
|
|
333
343
|
aria-invalid=${this.error?"true":l}
|
|
334
|
-
@change=${
|
|
344
|
+
@change=${e=>this.setFormValue(e.target.value)}
|
|
335
345
|
>
|
|
336
346
|
<option value="" ?selected=${!this.value}>${this.placeholder}</option>
|
|
337
|
-
${this.options.map(
|
|
347
|
+
${this.options.map(e=>o`<option value=${e.value} ?selected=${this.value===e.value}>${e.label}</option>`)}
|
|
338
348
|
</select>
|
|
339
|
-
`}updated(
|
|
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`
|
|
340
350
|
.row {
|
|
341
351
|
display: flex;
|
|
342
352
|
align-items: flex-start;
|
|
343
|
-
gap: ${
|
|
353
|
+
gap: ${s(3)};
|
|
344
354
|
cursor: pointer;
|
|
345
355
|
}
|
|
346
356
|
input {
|
|
347
|
-
${
|
|
357
|
+
${T}
|
|
348
358
|
inline-size: 20px;
|
|
349
359
|
block-size: 20px;
|
|
350
360
|
margin: 0;
|
|
351
361
|
flex: none;
|
|
352
|
-
accent-color: ${
|
|
362
|
+
accent-color: ${t.brand};
|
|
353
363
|
}
|
|
354
364
|
.text {
|
|
355
|
-
font-size: ${
|
|
365
|
+
font-size: ${g("md")};
|
|
356
366
|
}
|
|
357
367
|
:host([invalid]) .row {
|
|
358
|
-
color: ${
|
|
368
|
+
color: ${t.dangerText};
|
|
359
369
|
}
|
|
360
|
-
`]}renderControl(){return
|
|
370
|
+
`]}renderControl(){return o`
|
|
361
371
|
<label class="row" part="row" for=${this.controlId}>
|
|
362
372
|
<input
|
|
363
373
|
type="checkbox"
|
|
@@ -369,13 +379,13 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
369
379
|
?required=${this.required}
|
|
370
380
|
aria-describedby=${this.describedBy}
|
|
371
381
|
aria-invalid=${this.error?"true":l}
|
|
372
|
-
@change=${
|
|
382
|
+
@change=${e=>{this.checked=e.target.checked,this.setFormValue(this.checked?"on":"")}}
|
|
373
383
|
/>
|
|
374
384
|
<span class="text">
|
|
375
|
-
${this.label}${this.required?
|
|
385
|
+
${this.label}${this.required?o`<span class="required"> (${this.requiredText})</span>`:l}
|
|
376
386
|
</span>
|
|
377
387
|
</label>
|
|
378
|
-
`}renderLabel(){return
|
|
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`
|
|
379
389
|
fieldset {
|
|
380
390
|
border: 0;
|
|
381
391
|
margin: 0;
|
|
@@ -388,69 +398,69 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
388
398
|
.option {
|
|
389
399
|
display: flex;
|
|
390
400
|
align-items: flex-start;
|
|
391
|
-
gap: ${
|
|
392
|
-
padding: ${
|
|
393
|
-
border: ${
|
|
394
|
-
border-radius: ${
|
|
395
|
-
margin-block-end: ${
|
|
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)};
|
|
396
406
|
cursor: pointer;
|
|
397
407
|
}
|
|
398
408
|
.option:hover {
|
|
399
|
-
background: ${
|
|
409
|
+
background: ${t.surfaceSubtle};
|
|
400
410
|
}
|
|
401
411
|
/* The whole row is the target, not the 20px dot — 2.5.8 is a floor and
|
|
402
412
|
a comfortable target is the actual goal. */
|
|
403
413
|
.option input {
|
|
404
|
-
${
|
|
414
|
+
${T}
|
|
405
415
|
inline-size: 20px;
|
|
406
416
|
block-size: 20px;
|
|
407
417
|
margin: 0;
|
|
408
418
|
flex: none;
|
|
409
|
-
accent-color: ${
|
|
419
|
+
accent-color: ${t.brand};
|
|
410
420
|
}
|
|
411
421
|
.option-text {
|
|
412
422
|
display: block;
|
|
413
|
-
font-size: ${
|
|
423
|
+
font-size: ${g("md")};
|
|
414
424
|
}
|
|
415
425
|
.option-description {
|
|
416
426
|
display: block;
|
|
417
|
-
font-size: ${
|
|
418
|
-
color: ${
|
|
419
|
-
margin-block-start: ${
|
|
427
|
+
font-size: ${g("sm")};
|
|
428
|
+
color: ${t.textMuted};
|
|
429
|
+
margin-block-start: ${s(1)};
|
|
420
430
|
}
|
|
421
431
|
:host([invalid]) .option {
|
|
422
|
-
border-color: ${
|
|
432
|
+
border-color: ${t.danger};
|
|
423
433
|
}
|
|
424
|
-
`]}renderLabel(){return
|
|
425
|
-
${this.label}${this.required?
|
|
426
|
-
</legend>`}renderControl(){return
|
|
427
|
-
${this.options.map((
|
|
428
|
-
<label class="option" part="option" for=${
|
|
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}>
|
|
429
439
|
<input
|
|
430
440
|
type="radio"
|
|
431
|
-
id=${
|
|
441
|
+
id=${r}
|
|
432
442
|
name=${this.uid}
|
|
433
|
-
value=${
|
|
434
|
-
.checked=${this.value===
|
|
443
|
+
value=${e.value}
|
|
444
|
+
.checked=${this.value===e.value}
|
|
435
445
|
?disabled=${this.disabled}
|
|
436
446
|
?required=${this.required&&i===0}
|
|
437
447
|
aria-describedby=${n??l}
|
|
438
|
-
@change=${()=>this.setFormValue(
|
|
448
|
+
@change=${()=>this.setFormValue(e.value)}
|
|
439
449
|
/>
|
|
440
450
|
<span>
|
|
441
|
-
<span class="option-text">${
|
|
442
|
-
${
|
|
451
|
+
<span class="option-text">${e.label}</span>
|
|
452
|
+
${e.description?o`<span class="option-description" id=${n}>${e.description}</span>`:l}
|
|
443
453
|
</span>
|
|
444
454
|
</label>
|
|
445
455
|
`})}
|
|
446
|
-
`}render(){return
|
|
456
|
+
`}render(){return o`
|
|
447
457
|
<fieldset
|
|
448
458
|
part="fieldset"
|
|
449
459
|
aria-describedby=${this.describedBy}
|
|
450
460
|
aria-invalid=${this.error?"true":l}
|
|
451
461
|
>
|
|
452
462
|
${this.renderLabel()}
|
|
453
|
-
${this.description?
|
|
463
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">
|
|
454
464
|
${this.description}
|
|
455
465
|
</div>`:l}
|
|
456
466
|
${this.renderControl()}
|
|
@@ -458,42 +468,42 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
458
468
|
${this.error||l}
|
|
459
469
|
</div>
|
|
460
470
|
</fieldset>
|
|
461
|
-
`}updated(
|
|
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`
|
|
462
472
|
:host {
|
|
463
473
|
display: block;
|
|
464
|
-
margin-block-end: ${
|
|
474
|
+
margin-block-end: ${s(4)};
|
|
465
475
|
}
|
|
466
476
|
.alert {
|
|
467
|
-
padding: ${
|
|
468
|
-
border-radius: ${
|
|
477
|
+
padding: ${s(4)} ${s(5)};
|
|
478
|
+
border-radius: ${t.radiusLg};
|
|
469
479
|
border-inline-start: 4px solid;
|
|
470
|
-
box-shadow: inset 0 0 0 1px ${
|
|
471
|
-
font-size: ${
|
|
480
|
+
box-shadow: inset 0 0 0 1px ${t.hairline};
|
|
481
|
+
font-size: ${g("sm")};
|
|
472
482
|
line-height: 1.5;
|
|
473
483
|
}
|
|
474
484
|
.heading {
|
|
475
|
-
font-weight: ${
|
|
476
|
-
margin-block-end: ${
|
|
485
|
+
font-weight: ${m("semibold")};
|
|
486
|
+
margin-block-end: ${s(1)};
|
|
477
487
|
}
|
|
478
488
|
:host([tone='info']) .alert {
|
|
479
|
-
background: ${
|
|
480
|
-
border-color: ${
|
|
481
|
-
color: ${
|
|
489
|
+
background: ${t.infoSubtle};
|
|
490
|
+
border-color: ${t.info};
|
|
491
|
+
color: ${t.text};
|
|
482
492
|
}
|
|
483
493
|
:host([tone='success']) .alert {
|
|
484
|
-
background: ${
|
|
485
|
-
border-color: ${
|
|
486
|
-
color: ${
|
|
494
|
+
background: ${t.successSubtle};
|
|
495
|
+
border-color: ${t.success};
|
|
496
|
+
color: ${t.text};
|
|
487
497
|
}
|
|
488
498
|
:host([tone='warning']) .alert {
|
|
489
|
-
background: ${
|
|
490
|
-
border-color: ${
|
|
491
|
-
color: ${
|
|
499
|
+
background: ${t.warningSubtle};
|
|
500
|
+
border-color: ${t.warning};
|
|
501
|
+
color: ${t.text};
|
|
492
502
|
}
|
|
493
503
|
:host([tone='danger']) .alert {
|
|
494
|
-
background: ${
|
|
495
|
-
border-color: ${
|
|
496
|
-
color: ${
|
|
504
|
+
background: ${t.dangerSubtle};
|
|
505
|
+
border-color: ${t.danger};
|
|
506
|
+
color: ${t.text};
|
|
497
507
|
}
|
|
498
508
|
/* Colour is the only signal left in forced-colours mode, and it is gone.
|
|
499
509
|
The border keeps the boundary; the tone word in the label carries the
|
|
@@ -504,25 +514,25 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
504
514
|
border-inline-start-width: 4px;
|
|
505
515
|
}
|
|
506
516
|
}
|
|
507
|
-
`]}render(){let
|
|
517
|
+
`]}render(){let e=this.toneLabel||x(a.TONE_WORDS[this.tone]);return o`
|
|
508
518
|
<div
|
|
509
519
|
class="alert"
|
|
510
520
|
part="alert"
|
|
511
521
|
role=${this.tone==="danger"?"alert":"status"}
|
|
512
|
-
aria-label=${this.heading?l:
|
|
522
|
+
aria-label=${this.heading?l:e}
|
|
513
523
|
>
|
|
514
|
-
${this.heading?
|
|
515
|
-
<span class="tone-word">${
|
|
524
|
+
${this.heading?o`<div class="heading" part="heading">
|
|
525
|
+
<span class="tone-word">${e}:</span> ${this.heading}
|
|
516
526
|
</div>`:l}
|
|
517
527
|
<slot></slot>
|
|
518
528
|
</div>
|
|
519
|
-
`}};customElements.define("
|
|
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`
|
|
520
530
|
:host {
|
|
521
531
|
display: flex;
|
|
522
532
|
flex-direction: column;
|
|
523
533
|
}
|
|
524
534
|
:host([gap='none']) { gap: 0; }
|
|
525
|
-
:host([gap='xs']) { gap: ${
|
|
535
|
+
:host([gap='xs']) { gap: ${s(1)}; }
|
|
526
536
|
:host([align='start']) { align-items: flex-start; }
|
|
527
537
|
:host([align='center']) { align-items: center; text-align: center; }
|
|
528
538
|
:host([align='end']) { align-items: flex-end; }
|
|
@@ -533,54 +543,54 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
533
543
|
:host([justify='center']) { justify-content: center; }
|
|
534
544
|
:host([justify='end']) { justify-content: flex-end; }
|
|
535
545
|
:host([justify='between']) { justify-content: space-between; }
|
|
536
|
-
:host([gap='sm']) { gap: ${
|
|
537
|
-
:host([gap='md']) { gap: ${
|
|
538
|
-
:host([gap='lg']) { gap: ${
|
|
539
|
-
:host([gap='xl']) { gap: ${
|
|
540
|
-
`]}render(){return
|
|
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`
|
|
541
551
|
:host {
|
|
542
552
|
display: flex;
|
|
543
553
|
flex-direction: column;
|
|
544
|
-
background: ${
|
|
545
|
-
border: ${
|
|
546
|
-
border-radius: ${
|
|
547
|
-
box-shadow: ${
|
|
554
|
+
background: ${t.surfaceCard};
|
|
555
|
+
border: ${t.borderThin} solid ${t.hairline};
|
|
556
|
+
border-radius: ${t.radiusXl};
|
|
557
|
+
box-shadow: ${t.shadowSm};
|
|
548
558
|
overflow: hidden;
|
|
549
559
|
--ratio: 16 / 9;
|
|
550
560
|
}
|
|
551
|
-
:host([tone='subtle']) { background: ${
|
|
552
|
-
:host([tone='brand']) { background: ${
|
|
553
|
-
:host([tone='outline']) { background: transparent; box-shadow: none; border-color: ${
|
|
554
|
-
:host([raised]) { border-color: transparent; box-shadow: 0 24px 60px rgb(16 19 23 / 12%), 0 2px 6px rgb(16 19 23 / 6%); border-radius: ${
|
|
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}; }
|
|
555
565
|
:host([tone='plain']) { background: transparent; border-color: transparent; border-radius: 0; box-shadow: none; }
|
|
556
566
|
:host([ratio='4:3']) { --ratio: 4 / 3; }
|
|
557
567
|
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
558
568
|
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
559
|
-
.body { padding: ${
|
|
569
|
+
.body { padding: ${s(6)}; flex: 1; display: flex; flex-direction: column; }
|
|
560
570
|
:host([padding='none']) .body { padding: 0; }
|
|
561
|
-
:host([padding='sm']) .body { padding: ${
|
|
562
|
-
:host([padding='md']) .body { padding: ${
|
|
571
|
+
:host([padding='sm']) .body { padding: ${s(3)}; }
|
|
572
|
+
:host([padding='md']) .body { padding: ${s(4)}; }
|
|
563
573
|
:host([tone='plain']) .body { padding-inline: 0; }
|
|
564
574
|
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
565
575
|
.picture { position: relative; }
|
|
566
|
-
.tag { position: absolute; inset-block-start: ${
|
|
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; }
|
|
567
577
|
@media (forced-colors: active) { :host { border-color: CanvasText; } }
|
|
568
|
-
`]}render(){return
|
|
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`
|
|
569
579
|
:host {
|
|
570
580
|
display: block;
|
|
571
|
-
color: ${
|
|
572
|
-
font-family: ${
|
|
573
|
-
font-weight: ${
|
|
581
|
+
color: ${t.textHeading};
|
|
582
|
+
font-family: ${t.fontHeading};
|
|
583
|
+
font-weight: ${m("bold")};
|
|
574
584
|
line-height: ${C("tight")};
|
|
575
585
|
}
|
|
576
|
-
:host([size='5xl']) { ${
|
|
577
|
-
:host([size='4xl']) { ${
|
|
578
|
-
:host([size='3xl']) { ${
|
|
579
|
-
:host([size='2xl']) { ${
|
|
580
|
-
:host([size='xl']) { ${
|
|
581
|
-
:host([size='lg']) { ${
|
|
582
|
-
:host([size='md']) { ${
|
|
583
|
-
:host([size='sm']) { ${
|
|
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")} }
|
|
584
594
|
.h { text-wrap: balance; }
|
|
585
595
|
.h {
|
|
586
596
|
margin: 0;
|
|
@@ -593,17 +603,17 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
593
603
|
:host([screen-reader-only]:not([eyebrow])) { ${E} }
|
|
594
604
|
.eyebrow {
|
|
595
605
|
display: block;
|
|
596
|
-
margin-block-end: ${
|
|
597
|
-
color: var(--
|
|
598
|
-
font-family: var(--
|
|
599
|
-
font-size: var(--
|
|
600
|
-
font-weight: var(--
|
|
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")});
|
|
601
611
|
letter-spacing: 0.06em;
|
|
602
612
|
text-transform: uppercase;
|
|
603
613
|
}
|
|
604
|
-
`]}render(){return
|
|
605
|
-
${this.eyebrow?
|
|
606
|
-
</div>`}},
|
|
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`
|
|
607
617
|
:host {
|
|
608
618
|
display: block;
|
|
609
619
|
/* 1.4.8 asks for 1.5 within a paragraph, and it is the default here
|
|
@@ -614,47 +624,47 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
614
624
|
fixed pixel height does not. */
|
|
615
625
|
max-inline-size: 70ch;
|
|
616
626
|
}
|
|
617
|
-
:host([size='sm']) { ${
|
|
618
|
-
:host([size='md']) { ${
|
|
619
|
-
:host([size='lg']) { ${
|
|
620
|
-
:host([size='xl']) { ${
|
|
627
|
+
:host([size='sm']) { ${b("sm")} }
|
|
628
|
+
:host([size='md']) { ${b("md")} }
|
|
629
|
+
:host([size='lg']) { ${b("lg")} }
|
|
630
|
+
:host([size='xl']) { ${b("xl")} }
|
|
621
631
|
p { text-wrap: pretty; }
|
|
622
|
-
:host([tone='muted']) { color: ${
|
|
632
|
+
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
623
633
|
:host([align='center']) { text-align: center; margin-inline: auto; }
|
|
624
|
-
:host([look='code']) { font-family: ${
|
|
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; }
|
|
625
635
|
p {
|
|
626
636
|
margin: 0;
|
|
627
637
|
}
|
|
628
|
-
`]}render(){return
|
|
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`
|
|
629
639
|
:host {
|
|
630
640
|
display: inline;
|
|
631
641
|
}
|
|
632
642
|
a {
|
|
633
|
-
color: ${
|
|
643
|
+
color: ${t.link};
|
|
634
644
|
text-decoration: underline;
|
|
635
645
|
text-underline-offset: 0.2em;
|
|
636
|
-
border-radius: ${
|
|
646
|
+
border-radius: ${t.radiusSm};
|
|
637
647
|
}
|
|
638
648
|
a:hover {
|
|
639
|
-
color: ${
|
|
649
|
+
color: ${t.linkHover};
|
|
640
650
|
}
|
|
641
651
|
:host([variant='standalone']) { display: inline-block; }
|
|
642
|
-
:host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${
|
|
652
|
+
:host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${s(1)}; font-weight: ${m("semibold")}; text-decoration-thickness: 1px; }
|
|
643
653
|
:host([variant='standalone']) a:hover .icon { transform: translateX(2px); }
|
|
644
654
|
.icon { flex: none; transition: transform 120ms ease-in-out; }
|
|
645
655
|
.sr-only {
|
|
646
656
|
${E}
|
|
647
657
|
}
|
|
648
|
-
`]}render(){return
|
|
658
|
+
`]}render(){return o`
|
|
649
659
|
<a
|
|
650
660
|
part="link"
|
|
651
661
|
href=${this.href||l}
|
|
652
662
|
target=${this.external?"_blank":l}
|
|
653
663
|
rel=${this.external?"noopener noreferrer":l}
|
|
654
664
|
>
|
|
655
|
-
<slot></slot>${
|
|
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}
|
|
656
666
|
</a>
|
|
657
|
-
`}};customElements.define("
|
|
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`
|
|
658
668
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
659
669
|
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
660
670
|
:host {
|
|
@@ -671,10 +681,10 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
671
681
|
:host([ratio='4:3']) img { aspect-ratio: 4 / 3; }
|
|
672
682
|
:host([ratio='3:2']) img { aspect-ratio: 3 / 2; }
|
|
673
683
|
:host([ratio='1:1']) img { aspect-ratio: 1 / 1; }
|
|
674
|
-
:host([rounded='sm']) img { border-radius: ${
|
|
675
|
-
:host([rounded='lg']) img { border-radius: ${
|
|
684
|
+
:host([rounded='sm']) img { border-radius: ${t.radius}; }
|
|
685
|
+
:host([rounded='lg']) img { border-radius: ${t.radiusLg}; }
|
|
676
686
|
:host([rounded='full']) img { border-radius: 50%; }
|
|
677
|
-
`]}render(){return
|
|
687
|
+
`]}render(){return o`
|
|
678
688
|
<img
|
|
679
689
|
part="image"
|
|
680
690
|
src=${this.src}
|
|
@@ -685,7 +695,7 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
685
695
|
loading=${this.loading}
|
|
686
696
|
style="object-position: ${this.focalX*100}% ${this.focalY*100}%"
|
|
687
697
|
/>
|
|
688
|
-
`}},
|
|
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`
|
|
689
699
|
:host {
|
|
690
700
|
display: inline-block;
|
|
691
701
|
}
|
|
@@ -693,52 +703,52 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
693
703
|
display: block;
|
|
694
704
|
inline-size: auto;
|
|
695
705
|
}
|
|
696
|
-
`]}render(){let
|
|
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`
|
|
697
707
|
:host {
|
|
698
708
|
display: block;
|
|
699
709
|
}
|
|
700
710
|
a {
|
|
701
|
-
color: ${
|
|
711
|
+
color: ${t.link};
|
|
702
712
|
text-decoration: underline;
|
|
703
713
|
text-underline-offset: 0.2em;
|
|
704
714
|
display: inline-flex;
|
|
705
715
|
gap: 0.5ch;
|
|
706
716
|
align-items: baseline;
|
|
707
|
-
min-block-size: ${
|
|
717
|
+
min-block-size: ${t.targetMin};
|
|
708
718
|
}
|
|
709
719
|
.meta {
|
|
710
|
-
color: ${
|
|
720
|
+
color: ${t.textMuted};
|
|
711
721
|
}
|
|
712
|
-
`]}get size(){if(!this.byteSize)return"";let
|
|
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`
|
|
713
723
|
<a part="link" href=${this.href||l} download>
|
|
714
|
-
<span>${this.label}</span>${
|
|
724
|
+
<span>${this.label}</span>${e?o`<span class="meta">(${e})</span>`:l}
|
|
715
725
|
</a>
|
|
716
|
-
`}};customElements.define("
|
|
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`
|
|
717
727
|
:host {
|
|
718
728
|
display: inline-flex;
|
|
719
729
|
align-items: baseline;
|
|
720
|
-
gap: ${
|
|
721
|
-
color: ${
|
|
730
|
+
gap: ${s(1)};
|
|
731
|
+
color: ${t.text};
|
|
722
732
|
}
|
|
723
733
|
.amount {
|
|
724
|
-
font-family: ${
|
|
725
|
-
font-weight: ${
|
|
734
|
+
font-family: ${t.fontHeading};
|
|
735
|
+
font-weight: ${m("bold")};
|
|
726
736
|
/* Tabular figures so a price does not reflow as the digits change,
|
|
727
737
|
which otherwise makes a recalculating price jitter. */
|
|
728
738
|
font-variant-numeric: tabular-nums;
|
|
729
739
|
}
|
|
730
|
-
:host([size='md']) .amount { font-size: ${
|
|
731
|
-
:host([size='lg']) .amount { font-size: ${
|
|
732
|
-
:host([size='xl']) .amount { font-size: ${
|
|
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")}; }
|
|
733
743
|
.period {
|
|
734
|
-
font-size: ${
|
|
735
|
-
color: ${
|
|
744
|
+
font-size: ${g("sm")};
|
|
745
|
+
color: ${t.textMuted};
|
|
736
746
|
}
|
|
737
|
-
`]}get formatted(){if(this.amount===void 0||Number.isNaN(this.amount))return this.pending;try{return new Intl.NumberFormat(this.locale||
|
|
738
|
-
${this.prefix?
|
|
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}
|
|
739
749
|
<span class="amount" part="amount">${this.formatted}</span>
|
|
740
|
-
${this.period?
|
|
741
|
-
`}};customElements.define("
|
|
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`
|
|
742
752
|
:host {
|
|
743
753
|
display: block;
|
|
744
754
|
}
|
|
@@ -756,28 +766,28 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
756
766
|
}
|
|
757
767
|
dt,
|
|
758
768
|
dd {
|
|
759
|
-
padding: ${
|
|
760
|
-
border-block-end: ${
|
|
769
|
+
padding: ${s(3)} 0;
|
|
770
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
761
771
|
}
|
|
762
772
|
dt {
|
|
763
|
-
font-weight: ${
|
|
764
|
-
font-size: ${
|
|
773
|
+
font-weight: ${m("semibold")};
|
|
774
|
+
font-size: ${g("sm")};
|
|
765
775
|
}
|
|
766
776
|
dd {
|
|
767
777
|
margin: 0;
|
|
768
778
|
display: flex;
|
|
769
779
|
align-items: baseline;
|
|
770
780
|
justify-content: space-between;
|
|
771
|
-
gap: ${
|
|
781
|
+
gap: ${s(3)};
|
|
772
782
|
}
|
|
773
783
|
dd a {
|
|
774
784
|
flex: none;
|
|
775
|
-
color: ${
|
|
785
|
+
color: ${t.link};
|
|
776
786
|
text-decoration: underline;
|
|
777
787
|
text-underline-offset: 0.2em;
|
|
778
788
|
display: inline-flex;
|
|
779
789
|
align-items: center;
|
|
780
|
-
min-block-size: ${
|
|
790
|
+
min-block-size: ${t.targetMin};
|
|
781
791
|
}
|
|
782
792
|
.sr-only {
|
|
783
793
|
position: absolute;
|
|
@@ -803,21 +813,21 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
803
813
|
padding-block-start: 0;
|
|
804
814
|
}
|
|
805
815
|
}
|
|
806
|
-
`]}render(){return
|
|
816
|
+
`]}render(){return o`
|
|
807
817
|
<dl part="list">
|
|
808
|
-
${this.rows.map(
|
|
818
|
+
${this.rows.map(e=>o`
|
|
809
819
|
<div class="row" part="row">
|
|
810
|
-
<dt part="key">${
|
|
820
|
+
<dt part="key">${e.key}</dt>
|
|
811
821
|
<dd part="value">
|
|
812
|
-
<span>${
|
|
813
|
-
${
|
|
814
|
-
>${this.changeText}<span class="sr-only"> ${
|
|
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
|
|
815
825
|
>`:l}
|
|
816
826
|
</dd>
|
|
817
827
|
</div>
|
|
818
828
|
`)}
|
|
819
829
|
</dl>
|
|
820
|
-
`}};customElements.define("
|
|
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`
|
|
821
831
|
:host {
|
|
822
832
|
display: block;
|
|
823
833
|
}
|
|
@@ -830,25 +840,25 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
830
840
|
table {
|
|
831
841
|
inline-size: 100%;
|
|
832
842
|
border-collapse: collapse;
|
|
833
|
-
font-size: ${
|
|
843
|
+
font-size: ${g("md")};
|
|
834
844
|
}
|
|
835
845
|
caption {
|
|
836
846
|
text-align: start;
|
|
837
|
-
font-weight: ${
|
|
838
|
-
padding-block-end: ${
|
|
847
|
+
font-weight: ${m("semibold")};
|
|
848
|
+
padding-block-end: ${s(2)};
|
|
839
849
|
}
|
|
840
850
|
th,
|
|
841
851
|
td {
|
|
842
852
|
text-align: start;
|
|
843
|
-
padding: ${
|
|
844
|
-
border-block-end: ${
|
|
853
|
+
padding: ${s(3)};
|
|
854
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
845
855
|
}
|
|
846
856
|
thead th {
|
|
847
|
-
font-weight: ${
|
|
848
|
-
background: ${
|
|
857
|
+
font-weight: ${m("semibold")};
|
|
858
|
+
background: ${t.surfaceInset};
|
|
849
859
|
}
|
|
850
860
|
tbody th {
|
|
851
|
-
font-weight: ${
|
|
861
|
+
font-weight: ${m("semibold")};
|
|
852
862
|
}
|
|
853
863
|
.numeric {
|
|
854
864
|
/* A figure read across a line break is a different figure. */
|
|
@@ -857,30 +867,30 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
857
867
|
font-variant-numeric: tabular-nums;
|
|
858
868
|
}
|
|
859
869
|
th.sortable {
|
|
860
|
-
padding: ${
|
|
870
|
+
padding: ${s(1)};
|
|
861
871
|
}
|
|
862
872
|
.sort {
|
|
863
873
|
display: inline-flex;
|
|
864
874
|
align-items: center;
|
|
865
|
-
gap: ${
|
|
866
|
-
min-block-size: ${
|
|
867
|
-
padding: ${
|
|
875
|
+
gap: ${s(1)};
|
|
876
|
+
min-block-size: ${t.targetMin};
|
|
877
|
+
padding: ${s(2)};
|
|
868
878
|
font: inherit;
|
|
869
879
|
color: inherit;
|
|
870
880
|
background: none;
|
|
871
881
|
border: 0;
|
|
872
|
-
border-radius: ${
|
|
882
|
+
border-radius: ${t.radius};
|
|
873
883
|
cursor: pointer;
|
|
874
884
|
}
|
|
875
885
|
.sort:hover {
|
|
876
|
-
background: ${
|
|
886
|
+
background: ${t.wash};
|
|
877
887
|
}
|
|
878
888
|
.numeric .sort {
|
|
879
889
|
flex-direction: row-reverse;
|
|
880
890
|
}
|
|
881
891
|
.arrow {
|
|
882
892
|
display: inline-flex;
|
|
883
|
-
color: ${
|
|
893
|
+
color: ${t.textMuted};
|
|
884
894
|
transition: transform 140ms ease-in-out;
|
|
885
895
|
}
|
|
886
896
|
[aria-sort] .arrow {
|
|
@@ -901,24 +911,24 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
901
911
|
display: inline-flex;
|
|
902
912
|
align-items: center;
|
|
903
913
|
justify-content: center;
|
|
904
|
-
min-block-size: ${
|
|
905
|
-
min-inline-size: ${
|
|
914
|
+
min-block-size: ${t.targetMin};
|
|
915
|
+
min-inline-size: ${t.targetMin};
|
|
906
916
|
cursor: pointer;
|
|
907
917
|
}
|
|
908
918
|
.pick input {
|
|
909
919
|
inline-size: 20px;
|
|
910
920
|
block-size: 20px;
|
|
911
921
|
margin: 0;
|
|
912
|
-
accent-color: ${
|
|
922
|
+
accent-color: ${t.brand};
|
|
913
923
|
cursor: pointer;
|
|
914
924
|
}
|
|
915
925
|
tr.chosen > * {
|
|
916
|
-
background: ${
|
|
926
|
+
background: ${t.brandSubtle};
|
|
917
927
|
}
|
|
918
928
|
.empty {
|
|
919
|
-
padding-block: ${
|
|
929
|
+
padding-block: ${s(6)};
|
|
920
930
|
text-align: center;
|
|
921
|
-
color: ${
|
|
931
|
+
color: ${t.textMuted};
|
|
922
932
|
}
|
|
923
933
|
.label {
|
|
924
934
|
display: none;
|
|
@@ -935,8 +945,8 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
935
945
|
display: flex;
|
|
936
946
|
flex-wrap: wrap;
|
|
937
947
|
align-items: center;
|
|
938
|
-
gap: ${
|
|
939
|
-
margin-block-end: ${
|
|
948
|
+
gap: ${s(1)};
|
|
949
|
+
margin-block-end: ${s(3)};
|
|
940
950
|
}
|
|
941
951
|
thead th {
|
|
942
952
|
display: none;
|
|
@@ -949,21 +959,21 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
949
959
|
inline-size: auto;
|
|
950
960
|
}
|
|
951
961
|
thead .sort {
|
|
952
|
-
border: ${
|
|
962
|
+
border: ${t.borderThin} solid ${t.rule};
|
|
953
963
|
border-radius: 999px;
|
|
954
|
-
padding-inline: ${
|
|
955
|
-
background: ${
|
|
964
|
+
padding-inline: ${s(3)};
|
|
965
|
+
background: ${t.surfaceCard};
|
|
956
966
|
}
|
|
957
967
|
tbody tr {
|
|
958
968
|
position: relative;
|
|
959
|
-
margin-block-end: ${
|
|
960
|
-
padding: ${
|
|
961
|
-
border: ${
|
|
962
|
-
border-radius: ${
|
|
963
|
-
background: ${
|
|
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};
|
|
964
974
|
}
|
|
965
975
|
tbody tr.chosen {
|
|
966
|
-
background: ${
|
|
976
|
+
background: ${t.brandSubtle};
|
|
967
977
|
}
|
|
968
978
|
tr.chosen > * {
|
|
969
979
|
background: none;
|
|
@@ -971,8 +981,8 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
971
981
|
tbody th, tbody td {
|
|
972
982
|
display: grid;
|
|
973
983
|
grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
|
|
974
|
-
gap: ${
|
|
975
|
-
padding: ${
|
|
984
|
+
gap: ${s(3)};
|
|
985
|
+
padding: ${s(1.5)} 0;
|
|
976
986
|
border: 0;
|
|
977
987
|
text-align: start;
|
|
978
988
|
white-space: normal;
|
|
@@ -983,75 +993,75 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
983
993
|
tbody .pick {
|
|
984
994
|
display: block;
|
|
985
995
|
position: absolute;
|
|
986
|
-
inset-block-start: ${
|
|
987
|
-
inset-inline-end: ${
|
|
996
|
+
inset-block-start: ${s(1)};
|
|
997
|
+
inset-inline-end: ${s(1)};
|
|
988
998
|
inline-size: auto;
|
|
989
999
|
padding: 0;
|
|
990
1000
|
}
|
|
991
1001
|
tbody tr:has(.pick) > th {
|
|
992
|
-
padding-inline-end: ${
|
|
1002
|
+
padding-inline-end: ${s(10)};
|
|
993
1003
|
}
|
|
994
1004
|
.label {
|
|
995
1005
|
display: block;
|
|
996
|
-
font-size: ${
|
|
997
|
-
font-weight: ${
|
|
998
|
-
color: ${
|
|
1006
|
+
font-size: ${g("sm")};
|
|
1007
|
+
font-weight: ${m("semibold")};
|
|
1008
|
+
color: ${t.textMuted};
|
|
999
1009
|
}
|
|
1000
1010
|
.empty {
|
|
1001
1011
|
display: block;
|
|
1002
1012
|
border: 0;
|
|
1003
1013
|
}
|
|
1004
1014
|
}
|
|
1005
|
-
`]}keyOf(
|
|
1006
|
-
<button class="sort" type="button" part="sort" @click=${()=>this.sortBy(
|
|
1007
|
-
</th>`:
|
|
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`
|
|
1008
1018
|
<div class="scroller" part="scroller" tabindex="0" role="region" aria-label=${this.caption||l}>
|
|
1009
1019
|
<table part="table" role="table">
|
|
1010
|
-
${this.caption?
|
|
1020
|
+
${this.caption?o`<caption part="caption">${this.caption}</caption>`:l}
|
|
1011
1021
|
<thead role="rowgroup">
|
|
1012
1022
|
<tr role="row">
|
|
1013
|
-
${this.selectable?
|
|
1014
|
-
@change=${
|
|
1015
|
-
${
|
|
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))}
|
|
1016
1026
|
</tr>
|
|
1017
1027
|
</thead>
|
|
1018
1028
|
<tbody role="rowgroup">
|
|
1019
|
-
${i.length?i.map(({row:
|
|
1020
|
-
<tr role="row" class=${
|
|
1021
|
-
${this.selectable?
|
|
1022
|
-
@change=${
|
|
1023
|
-
${
|
|
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>`})}
|
|
1024
1034
|
</tr>
|
|
1025
|
-
`):
|
|
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>`}
|
|
1026
1036
|
</tbody>
|
|
1027
1037
|
</table>
|
|
1028
1038
|
</div>
|
|
1029
|
-
`}};customElements.define("
|
|
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`
|
|
1030
1040
|
:host {
|
|
1031
1041
|
display: block;
|
|
1032
1042
|
}
|
|
1033
1043
|
.item {
|
|
1034
|
-
border-block-end: ${
|
|
1044
|
+
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
1035
1045
|
}
|
|
1036
1046
|
button {
|
|
1037
|
-
${
|
|
1047
|
+
${T}
|
|
1038
1048
|
display: flex;
|
|
1039
1049
|
align-items: center;
|
|
1040
1050
|
justify-content: space-between;
|
|
1041
|
-
gap: ${
|
|
1051
|
+
gap: ${s(3)};
|
|
1042
1052
|
inline-size: 100%;
|
|
1043
|
-
padding: ${
|
|
1053
|
+
padding: ${s(3)} 0;
|
|
1044
1054
|
background: none;
|
|
1045
1055
|
border: 0;
|
|
1046
1056
|
font: inherit;
|
|
1047
|
-
font-size: ${
|
|
1048
|
-
font-weight: ${
|
|
1049
|
-
color: ${
|
|
1057
|
+
font-size: ${g("md")};
|
|
1058
|
+
font-weight: ${m("semibold")};
|
|
1059
|
+
color: ${t.text};
|
|
1050
1060
|
text-align: start;
|
|
1051
1061
|
cursor: pointer;
|
|
1052
1062
|
}
|
|
1053
1063
|
button:hover {
|
|
1054
|
-
color: ${
|
|
1064
|
+
color: ${t.link};
|
|
1055
1065
|
}
|
|
1056
1066
|
.marker {
|
|
1057
1067
|
flex: none;
|
|
@@ -1061,11 +1071,11 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1061
1071
|
transform: rotate(90deg);
|
|
1062
1072
|
}
|
|
1063
1073
|
.panel {
|
|
1064
|
-
padding-block-end: ${
|
|
1065
|
-
font-size: ${
|
|
1074
|
+
padding-block-end: ${s(4)};
|
|
1075
|
+
font-size: ${g("md")};
|
|
1066
1076
|
}
|
|
1067
|
-
`]}toggle(
|
|
1068
|
-
${this.items.map(
|
|
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`
|
|
1069
1079
|
<div class="item" part="item">
|
|
1070
1080
|
<div role="heading" aria-level=${this.headingLevel}>
|
|
1071
1081
|
<button
|
|
@@ -1073,53 +1083,53 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1073
1083
|
part="header"
|
|
1074
1084
|
type="button"
|
|
1075
1085
|
aria-expanded=${i?"true":"false"}
|
|
1076
|
-
aria-controls=${
|
|
1077
|
-
@click=${()=>this.toggle(
|
|
1086
|
+
aria-controls=${r}
|
|
1087
|
+
@click=${()=>this.toggle(e.id)}
|
|
1078
1088
|
>
|
|
1079
|
-
<span>${
|
|
1089
|
+
<span>${e.heading}</span>
|
|
1080
1090
|
<span class="marker" aria-hidden="true">›</span>
|
|
1081
1091
|
</button>
|
|
1082
1092
|
</div>
|
|
1083
1093
|
<div
|
|
1084
|
-
id=${
|
|
1094
|
+
id=${r}
|
|
1085
1095
|
class="panel"
|
|
1086
1096
|
part="panel"
|
|
1087
1097
|
role="region"
|
|
1088
1098
|
aria-labelledby=${n}
|
|
1089
1099
|
?hidden=${!i}
|
|
1090
1100
|
>
|
|
1091
|
-
<slot name=${`panel-${
|
|
1101
|
+
<slot name=${`panel-${e.id}`}>${e.body}</slot>
|
|
1092
1102
|
</div>
|
|
1093
1103
|
</div>
|
|
1094
1104
|
`})}
|
|
1095
1105
|
${this.items.length===0?l:l}
|
|
1096
|
-
`}};customElements.define("
|
|
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`
|
|
1097
1107
|
:host {
|
|
1098
1108
|
display: block;
|
|
1099
|
-
margin-block-end: ${
|
|
1109
|
+
margin-block-end: ${s(5)};
|
|
1100
1110
|
}
|
|
1101
1111
|
ol {
|
|
1102
1112
|
display: flex;
|
|
1103
|
-
gap: ${
|
|
1113
|
+
gap: ${s(2)};
|
|
1104
1114
|
list-style: none;
|
|
1105
1115
|
margin: 0;
|
|
1106
1116
|
padding: 0;
|
|
1107
1117
|
}
|
|
1108
1118
|
li {
|
|
1109
1119
|
flex: 1;
|
|
1110
|
-
font-size: ${
|
|
1111
|
-
color: ${
|
|
1112
|
-
padding-block-start: ${
|
|
1113
|
-
border-block-start: 4px solid ${
|
|
1120
|
+
font-size: ${g("sm")};
|
|
1121
|
+
color: ${t.textMuted};
|
|
1122
|
+
padding-block-start: ${s(2)};
|
|
1123
|
+
border-block-start: 4px solid ${t.border};
|
|
1114
1124
|
}
|
|
1115
1125
|
li[data-state='done'] {
|
|
1116
|
-
color: ${
|
|
1117
|
-
border-block-start-color: ${
|
|
1126
|
+
color: ${t.text};
|
|
1127
|
+
border-block-start-color: ${t.brand};
|
|
1118
1128
|
}
|
|
1119
1129
|
li[data-state='current'] {
|
|
1120
|
-
color: ${
|
|
1121
|
-
font-weight: ${
|
|
1122
|
-
border-block-start-color: ${
|
|
1130
|
+
color: ${t.text};
|
|
1131
|
+
font-weight: ${m("semibold")};
|
|
1132
|
+
border-block-start-color: ${t.brand};
|
|
1123
1133
|
}
|
|
1124
1134
|
.sr-only {
|
|
1125
1135
|
${E}
|
|
@@ -1132,680 +1142,64 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1132
1142
|
${E}
|
|
1133
1143
|
}
|
|
1134
1144
|
}
|
|
1135
|
-
`]}render(){let
|
|
1145
|
+
`]}render(){let e=this.steps.findIndex(i=>i.id===this.current);return o`
|
|
1136
1146
|
<nav part="nav" aria-label=${this.label}>
|
|
1137
1147
|
<ol part="list">
|
|
1138
|
-
${this.steps.map((i,
|
|
1148
|
+
${this.steps.map((i,r)=>{let n=r<e?"done":r===e?"current":"todo";return o`
|
|
1139
1149
|
<li data-state=${n} aria-current=${n==="current"?"step":l}>
|
|
1140
|
-
${n==="current"?
|
|
1150
|
+
${n==="current"?o`<span class="sr-only">${x("Step {step} of {steps}:",{step:r+1,steps:this.steps.length})} </span>`:l}
|
|
1141
1151
|
<span>${i.label}</span>
|
|
1142
1152
|
</li>
|
|
1143
1153
|
`})}
|
|
1144
1154
|
</ol>
|
|
1145
1155
|
</nav>
|
|
1146
|
-
`}};customElements.define("
|
|
1147
|
-
:host {
|
|
1148
|
-
display: block;
|
|
1149
|
-
position: relative;
|
|
1150
|
-
}
|
|
1151
|
-
:host([drive='view'][layout='stage']) {
|
|
1152
|
-
min-height: calc(var(--impkt-scene-length, 3) * 100svh);
|
|
1153
|
-
}
|
|
1154
|
-
.frame {
|
|
1155
|
-
display: grid;
|
|
1156
|
-
grid-template-columns: minmax(0, 1fr);
|
|
1157
|
-
}
|
|
1158
|
-
:host([layout='split']) .frame {
|
|
1159
|
-
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
1160
|
-
gap: ${r(8)};
|
|
1161
|
-
}
|
|
1162
|
-
.stage {
|
|
1163
|
-
position: sticky;
|
|
1164
|
-
top: 0;
|
|
1165
|
-
height: 100svh;
|
|
1166
|
-
display: grid;
|
|
1167
|
-
place-items: center;
|
|
1168
|
-
overflow: clip;
|
|
1169
|
-
}
|
|
1170
|
-
/* What is on the stage is layered, as in a motion tool: each thing sits
|
|
1171
|
-
over the one before, so a later layer's timeline can reveal it over an
|
|
1172
|
-
earlier one. */
|
|
1173
|
-
.stage ::slotted(*) {
|
|
1174
|
-
grid-area: 1 / 1;
|
|
1175
|
-
max-width: 100%;
|
|
1176
|
-
}
|
|
1177
|
-
:host([drive='loop']) .stage,
|
|
1178
|
-
:host([drive='scrubber']) .stage {
|
|
1179
|
-
position: relative;
|
|
1180
|
-
height: auto;
|
|
1181
|
-
min-height: 60svh;
|
|
1182
|
-
}
|
|
1183
|
-
.controls {
|
|
1184
|
-
display: flex;
|
|
1185
|
-
gap: ${r(3)};
|
|
1186
|
-
align-items: center;
|
|
1187
|
-
justify-content: center;
|
|
1188
|
-
padding-block: ${r(3)};
|
|
1189
|
-
}
|
|
1190
|
-
:host([bleed]) { margin-inline: calc(50% - 50vw); }
|
|
1191
|
-
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
1192
|
-
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
1193
|
-
/* Over the stage, the controls float at its foot, above the layers and clear of its edges. */
|
|
1194
|
-
.stage > .controls { position: absolute; inset-inline: ${r(6)}; inset-block-end: ${r(6)}; z-index: 2; padding: 0; }
|
|
1195
|
-
.stage > .controls ::slotted(*) { box-shadow: 0 12px 32px rgb(16 19 23 / 14%); border-radius: 16px; background: var(--impkt-color-surface-card, #fff); }
|
|
1196
|
-
/* A control takes the row, so a graph scrubber spans the stage; a narrower one centres itself. */
|
|
1197
|
-
.controls ::slotted(*) { flex: 1 1 auto; min-width: 0; }
|
|
1198
|
-
.pause {
|
|
1199
|
-
min-width: ${f("target.min","24px")};
|
|
1200
|
-
min-height: ${f("target.min","24px")};
|
|
1201
|
-
padding: ${r(2)} ${r(4)};
|
|
1202
|
-
border-radius: ${f("radius.full","9999px")};
|
|
1203
|
-
border: 1px solid ${e.border};
|
|
1204
|
-
background: ${e.surfaceCard};
|
|
1205
|
-
color: ${e.text};
|
|
1206
|
-
font-size: ${$("sm")};
|
|
1207
|
-
font-weight: ${u("medium")};
|
|
1208
|
-
cursor: pointer;
|
|
1209
|
-
}
|
|
1210
|
-
.pause:focus-visible {
|
|
1211
|
-
outline: none;
|
|
1212
|
-
box-shadow: ${f("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1213
|
-
}
|
|
1214
|
-
@media (max-width: 48rem) {
|
|
1215
|
-
:host([layout='split']) .frame {
|
|
1216
|
-
grid-template-columns: minmax(0, 1fr);
|
|
1217
|
-
}
|
|
1218
|
-
:host([layout='split']) .stage {
|
|
1219
|
-
height: 50svh;
|
|
1220
|
-
z-index: 1;
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
@media (prefers-reduced-motion: reduce) {
|
|
1224
|
-
:host {
|
|
1225
|
-
min-height: 0 !important;
|
|
1226
|
-
}
|
|
1227
|
-
.stage {
|
|
1228
|
-
position: relative;
|
|
1229
|
-
height: auto;
|
|
1230
|
-
gap: ${r(6)};
|
|
1231
|
-
}
|
|
1232
|
-
/* With less motion the layers are shown one after another, so every
|
|
1233
|
-
state the scene would have moved through can still be seen. */
|
|
1234
|
-
.stage ::slotted(*) {
|
|
1235
|
-
grid-area: auto;
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
`]}connectedCallback(){super.connectedCallback();try{this.reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{this.reduced=!1}window.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}),window.addEventListener("resize",this.onScroll),this.schedule()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.onScroll,{capture:!0}),window.removeEventListener("resize",this.onScroll),this.frame&&cancelAnimationFrame(this.frame),this.frame=0}updated(i){i.has("length")&&this.style.setProperty("--impkt-scene-length",String(this.length)),i.has("progress")&&this.publish(),i.has("drive")&&(this.started=0,this.schedule())}seek(i,s=0){if(s<=0||this.reduced){this.progress=We(i);return}this.seekFrom=this.progress,this.seekTo=We(i),this.seekStart=0,this.seekMs=s,this.schedule()}schedule(){!this.frame&&typeof requestAnimationFrame=="function"&&(this.frame=requestAnimationFrame(this.tick))}publish(){this.style.setProperty("--impkt-scene-progress",this.progress.toFixed(4)),this.dispatchEvent(new CustomEvent("impkt-scene-progress",{detail:{progress:this.progress},bubbles:!0,composed:!0}))}setPaused(i){this.paused!==i&&(this.paused=i,this.started=0,this.schedule(),this.requestUpdate())}pause(){this.setPaused(!0)}render(){let i=this.drive==="loop",s=this.controls==="over"&&!this.reduced,n=a`<div class="controls" part="controls">
|
|
1239
|
-
<slot name="controls"></slot>
|
|
1240
|
-
${i&&!this.reduced?a`<button class="pause" type="button" aria-pressed=${this.paused?"true":"false"} @click=${this.togglePause}>
|
|
1241
|
-
${this.paused?g("Play {name}",{name:this.label}):g("Pause {name}",{name:this.label})}
|
|
1242
|
-
</button>`:l}
|
|
1243
|
-
</div>`,d=a`<div class="stage" part="stage"><slot name="stage"></slot>${s?n:l}</div>`;return a`
|
|
1244
|
-
<div class="frame" part="frame" role="region" aria-label=${this.label}>
|
|
1245
|
-
${this.layout==="split"?a`<div class="content" part="content"><slot></slot></div>${d}`:a`${d}<div class="content" part="content"><slot></slot></div>`}
|
|
1246
|
-
</div>
|
|
1247
|
-
${s?l:n}
|
|
1248
|
-
`}};customElements.define("impkt-scene",Ue);var Si={brand:"var(--impkt-color-brand-default, #1f4ed8)",accent:"var(--impkt-color-accent-default, #c8a15a)",info:"var(--impkt-color-status-info-default, #1f4ed8)",success:"var(--impkt-color-status-success-default, #047857)",warning:"var(--impkt-color-status-warning-default, #b45309)",danger:"var(--impkt-color-status-danger-default, #c8102e)"},Ve=class extends c{constructor(){super();this.scene=null;this.onProgress=i=>{this.value=i.detail.progress};this.onInput=i=>{let s=Number(i.target.value)/1e3;this.value=s,this.scene?.seek(s)};this.label="Scene progress",this.stops=[],this.look="buttons",this.hint="",this.value=0}static{this.properties={label:{type:String},stops:{type:Array},look:{type:String,reflect:!0},hint:{type:String},value:{type:Number,state:!0}}}static{this.styles=[...c.styles,h`
|
|
1249
|
-
:host {
|
|
1250
|
-
display: block;
|
|
1251
|
-
width: 100%;
|
|
1252
|
-
max-width: 48rem;
|
|
1253
|
-
margin-inline: auto;
|
|
1254
|
-
}
|
|
1255
|
-
.wrap {
|
|
1256
|
-
display: grid;
|
|
1257
|
-
gap: ${r(2)};
|
|
1258
|
-
padding: ${r(3)} ${r(4)};
|
|
1259
|
-
border-radius: ${f("radius.xl","16px")};
|
|
1260
|
-
background: ${e.surfaceCard};
|
|
1261
|
-
box-shadow: ${f("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")};
|
|
1262
|
-
border: 1px solid ${e.border};
|
|
1263
|
-
}
|
|
1264
|
-
input {
|
|
1265
|
-
width: 100%;
|
|
1266
|
-
min-height: ${f("target.min","24px")};
|
|
1267
|
-
accent-color: ${e.brand};
|
|
1268
|
-
margin: 0;
|
|
1269
|
-
}
|
|
1270
|
-
.stops {
|
|
1271
|
-
position: relative;
|
|
1272
|
-
display: flex;
|
|
1273
|
-
flex-wrap: wrap;
|
|
1274
|
-
gap: ${r(2)};
|
|
1275
|
-
list-style: none;
|
|
1276
|
-
margin: 0;
|
|
1277
|
-
padding: 0;
|
|
1278
|
-
}
|
|
1279
|
-
button {
|
|
1280
|
-
min-height: ${f("target.min","24px")};
|
|
1281
|
-
padding: ${r(1)} ${r(3)};
|
|
1282
|
-
border-radius: ${f("radius.full","9999px")};
|
|
1283
|
-
border: 1px solid ${e.border};
|
|
1284
|
-
background: transparent;
|
|
1285
|
-
color: ${e.textMuted};
|
|
1286
|
-
font-size: ${$("xs")};
|
|
1287
|
-
font-weight: ${u("medium")};
|
|
1288
|
-
cursor: pointer;
|
|
1289
|
-
}
|
|
1290
|
-
button[aria-current='true'] {
|
|
1291
|
-
color: ${e.text};
|
|
1292
|
-
border-color: ${e.text};
|
|
1293
|
-
}
|
|
1294
|
-
.sr-only {
|
|
1295
|
-
${E}
|
|
1296
|
-
}
|
|
1297
|
-
/* The graph look: the code of where you are, the line of stops, where you are. */
|
|
1298
|
-
:host([look='graph']) { max-width: none; }
|
|
1299
|
-
.graph { display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto; gap: ${r(6)}; align-items: center; padding: ${r(4)} ${r(6)}; border-radius: ${f("radius.xl","16px")}; background: ${e.surfaceCard}; box-shadow: ${f("shadow.lg","0 10px 15px -3px rgba(0,0,0,.1)")}; border: 1px solid ${e.border}; }
|
|
1300
|
-
.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; }
|
|
1301
|
-
.head { display: grid; gap: 2px; }
|
|
1302
|
-
.head .k { color: ${e.textMuted}; text-transform: uppercase; }
|
|
1303
|
-
.head .code { font-size: ${$("md")}; color: ${e.text}; }
|
|
1304
|
-
.head .note { color: ${e.textMuted}; }
|
|
1305
|
-
.line { position: relative; block-size: 48px; }
|
|
1306
|
-
.track, .fill { position: absolute; inset-inline: 0; inset-block-start: 14px; block-size: 3px; border-radius: 3px; background: ${e.border}; opacity: 0.5; }
|
|
1307
|
-
.fill { opacity: 1; background: none; display: flex; overflow: hidden; }
|
|
1308
|
-
.fill span { block-size: 100%; }
|
|
1309
|
-
.dot { position: absolute; inset-block-start: 15px; inline-size: 14px; block-size: 14px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--c); background: ${e.surfaceCard}; padding: 0; min-height: 0; cursor: pointer; }
|
|
1310
|
-
.dot[data-passed] { background: var(--c); }
|
|
1311
|
-
.dot[aria-current='true'] { inline-size: 24px; block-size: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
|
|
1312
|
-
.dot-label { position: absolute; inset-block-start: 30px; translate: -50% 0; white-space: nowrap; color: ${e.textMuted}; text-transform: uppercase; pointer-events: none; }
|
|
1313
|
-
.dot-label[data-current] { color: ${e.text}; font-weight: ${u("bold")}; }
|
|
1314
|
-
.line input { position: absolute; inset: 0 0 auto; block-size: 30px; opacity: 0; cursor: grab; }
|
|
1315
|
-
.line input:focus-visible { opacity: 1; }
|
|
1316
|
-
.where { display: grid; gap: ${r(2)}; justify-items: end; }
|
|
1317
|
-
.chip { display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border-radius: ${f("radius.full","9999px")}; border: 1px solid ${e.border}; color: ${e.text}; text-transform: uppercase; }
|
|
1318
|
-
.chip::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--c); }
|
|
1319
|
-
.hint { color: ${e.textMuted}; text-transform: uppercase; }
|
|
1320
|
-
@media (max-width: 48rem) {
|
|
1321
|
-
.graph { grid-template-columns: minmax(0, 1fr); }
|
|
1322
|
-
.where { justify-items: start; }
|
|
1323
|
-
.dot-label:not([data-current]) { display: none; }
|
|
1324
|
-
}
|
|
1325
|
-
button:focus-visible,
|
|
1326
|
-
input:focus-visible {
|
|
1327
|
-
outline: none;
|
|
1328
|
-
box-shadow: ${f("focus.ring.shadow","0 0 0 2px #fff, 0 0 0 4px #1a1a1a")};
|
|
1329
|
-
}
|
|
1330
|
-
`]}connectedCallback(){super.connectedCallback(),this.scene=this.closest("impkt-scene"),this.scene?.addEventListener("impkt-scene-progress",this.onProgress),this.scene&&(this.value=this.scene.progress)}disconnectedCallback(){super.disconnectedCallback(),this.scene?.removeEventListener("impkt-scene-progress",this.onProgress),this.scene=null}goTo(i){this.scene?.seek(i.at,600)}nearest(){let i=-1,s=1/0;return this.stops.forEach((n,d)=>{let p=Math.abs(n.at-this.value);p<s&&(s=p,i=d)}),i}renderGraph(i,s){let n=i,d=[...this.stops??[]].sort((x,v)=>x.at-v.at);n=d.indexOf(this.stops[n]);let p=x=>{let v=x?.tone??"brand";return typeof v=="number"?`var(--impkt-color-chart-${v}, ${Si.brand})`:Si[v]??Si.brand},b=d[n]??d[0],y=d.map((x,v)=>{let M=v===0?0:d[v-1].at,I=Math.min(x.at,this.value);return{width:Math.round(Math.max(0,I-M)*1e4)/100,c:p(x)}});return a`<div class="graph" part="wrap">
|
|
1331
|
-
<div class="head mono" aria-hidden="true">
|
|
1332
|
-
<span class="k">HEAD</span>
|
|
1333
|
-
<span class="code">${b?.meta??b?.label??""}</span>
|
|
1334
|
-
${b?.note?a`<span class="note">${b.note}</span>`:null}
|
|
1335
|
-
</div>
|
|
1336
|
-
<div class="line">
|
|
1337
|
-
<div class="track"></div>
|
|
1338
|
-
<div class="fill" aria-hidden="true">${y.map(x=>a`<span style=${`width:${x.width}%;background:${x.c}`}></span>`)}</div>
|
|
1339
|
-
${d.map((x,v)=>a`
|
|
1340
|
-
<button type="button" class="dot" style=${`left:${x.at*100}%;--c:${p(x)}`} ?data-passed=${x.at<=this.value+1e-4} aria-current=${v===n?"true":"false"} @click=${()=>this.goTo(x)}>
|
|
1341
|
-
<span class="sr-only">${g("Go to {name}",{name:x.label})}</span>
|
|
1342
|
-
</button>
|
|
1343
|
-
<span class="dot-label mono" style=${`left:${x.at*100}%`} ?data-current=${v===n} aria-hidden="true">${x.label}</span>`)}
|
|
1344
|
-
<input type="range" min="0" max="1000" step="1" .value=${String(Math.round(this.value*1e3))} aria-label=${this.label} aria-valuetext=${s} @input=${this.onInput} />
|
|
1345
|
-
</div>
|
|
1346
|
-
<div class="where" aria-hidden="true">
|
|
1347
|
-
${b?a`<span class="chip mono" style=${`--c:${p(b)}`}>${b.label}${b.meta?a` <span style="opacity:.6">${b.meta}</span>`:null}</span>`:null}
|
|
1348
|
-
${this.hint?a`<span class="hint mono">${this.hint}</span>`:null}
|
|
1349
|
-
</div>
|
|
1350
|
-
</div>`}render(){let i=this.nearest(),s=i>=0?this.stops[i].label:`${Math.round(this.value*100)}%`;return this.look==="graph"?this.renderGraph(i,s):a`
|
|
1351
|
-
<div class="wrap" part="wrap">
|
|
1352
|
-
<input
|
|
1353
|
-
type="range"
|
|
1354
|
-
min="0"
|
|
1355
|
-
max="1000"
|
|
1356
|
-
step="1"
|
|
1357
|
-
.value=${String(Math.round(this.value*1e3))}
|
|
1358
|
-
aria-label=${this.label}
|
|
1359
|
-
aria-valuetext=${s}
|
|
1360
|
-
@input=${this.onInput}
|
|
1361
|
-
/>
|
|
1362
|
-
${this.stops.length?a`<ul class="stops" part="stops">
|
|
1363
|
-
${this.stops.map((n,d)=>a`<li>
|
|
1364
|
-
<button type="button" aria-current=${d===i?"true":"false"} @click=${()=>this.goTo(n)}>
|
|
1365
|
-
<span aria-hidden="true">${n.label}</span><span class="sr-only">${g("Go to {name}",{name:n.label})}</span>
|
|
1366
|
-
</button>
|
|
1367
|
-
</li>`)}
|
|
1368
|
-
</ul>`:null}
|
|
1369
|
-
</div>
|
|
1370
|
-
`}};customElements.define("impkt-scrubber",Ve);var Ke=class extends c{static{this.properties={imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},plots:{type:Array},hint:{type:String},selectedPlot:{type:String,attribute:"selected-plot"},panel:{type:String,reflect:!0},plotWord:{type:String,attribute:"plot-word"},actionText:{type:String,attribute:"action-text"},availableText:{type:String,attribute:"available-text"},reservedText:{type:String,attribute:"reserved-text"},soldText:{type:String,attribute:"sold-text"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.imageSrc="",this.imageAlt="",this.plots=[],this.hint="Choose a plot to see its price and availability.",this.selectedPlot="",this.panel="beside",this.plotWord="Plot",this.actionText="View this home",this.availableText="Available",this.reservedText="Reserved",this.soldText="Sold",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,h`
|
|
1371
|
-
:host { display: block; container-type: inline-size; }
|
|
1372
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: ${r(6)}; align-items: start; }
|
|
1373
|
-
.plan { position: relative; overflow: hidden; border-radius: ${e.radius2xl}; background: ${e.surfaceSubtle}; box-shadow: ${e.shadowMd}; line-height: 0; }
|
|
1374
|
-
.plan img { inline-size: 100%; block-size: auto; }
|
|
1375
|
-
.pin { position: absolute; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; inline-size: 34px; block-size: 34px; margin: -17px 0 0 -17px; padding: 0; font: inherit; ${m("xs")} line-height: 1; font-weight: ${u("bold")}; color: ${e.onBrand}; background: ${e.brand}; border: 2px solid ${e.surfaceCard}; border-radius: 50%; box-shadow: ${e.shadowMd}; cursor: pointer; transition: transform 120ms ease-in-out; }
|
|
1376
|
-
.pin:hover { transform: scale(1.12); }
|
|
1377
|
-
.pin.reserved { color: ${e.text}; background: ${e.warningSubtle}; border-color: ${e.warning}; border-style: dashed; }
|
|
1378
|
-
.pin.sold { color: ${e.textMuted}; background: ${e.surfaceCard}; border-color: ${e.border}; border-radius: ${e.radius}; }
|
|
1379
|
-
.pin[aria-pressed='true'] { transform: scale(1.22); box-shadow: ${e.shadowLg}, 0 0 0 3px ${e.brand}; }
|
|
1380
|
-
.panel { display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(6)}; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowSm}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1381
|
-
.hint { margin: 0; color: ${e.textMuted}; }
|
|
1382
|
-
.name { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1383
|
-
.sub { margin: 0; color: ${e.textMuted}; }
|
|
1384
|
-
.price { margin: 0; ${m("xl")} font-weight: ${u("semibold")}; }
|
|
1385
|
-
.status { align-self: flex-start; padding: ${r(.5)} ${r(2.5)}; ${m("xs")} font-weight: ${u("semibold")}; color: ${e.successText}; background: ${e.successSubtle}; border-radius: 999px; }
|
|
1386
|
-
.status.reserved { color: ${e.warningText}; background: ${e.warningSubtle}; }
|
|
1387
|
-
.status.sold { color: ${e.textMuted}; background: ${e.surfaceSubtle}; }
|
|
1388
|
-
.go { ${A} display: inline-flex; align-items: center; justify-content: center; gap: ${r(2)}; padding: ${r(2)} ${r(4)}; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border-radius: ${e.radiusLg}; }
|
|
1389
|
-
.go:hover { background: ${e.brandHover}; }
|
|
1390
|
-
.legend { display: flex; flex-wrap: wrap; gap: ${r(4)}; margin: ${r(3)} 0 0; padding: 0; list-style: none; ${m("sm")} color: ${e.textMuted}; }
|
|
1391
|
-
.legend li { display: inline-flex; align-items: center; gap: ${r(2)}; }
|
|
1392
|
-
.key { box-sizing: border-box; inline-size: 14px; block-size: 14px; background: ${e.brand}; border: 2px solid ${e.surfaceCard}; border-radius: 50%; outline: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
|
|
1393
|
-
.key.reserved { background: ${e.warningSubtle}; border: 2px dashed ${e.warning}; }
|
|
1394
|
-
.key.sold { background: ${e.surfaceCard}; border: 2px solid ${e.border}; border-radius: 3px; }
|
|
1395
|
-
:host { --plan-card: var(--impkt-solid-card, ${e.surfaceCard}); --plan-text: var(--impkt-solid-text, ${e.text}); --plan-heading: var(--impkt-solid-heading, ${e.text}); --plan-muted: var(--impkt-solid-muted, ${e.textMuted}); }
|
|
1396
|
-
:host([panel='over']) .panel { background: var(--plan-card); color: var(--plan-text); --impkt-color-surface-card: var(--plan-card); --impkt-color-text-default: var(--plan-text); --impkt-color-text-heading: var(--plan-heading); --impkt-color-text-muted: var(--plan-muted); }
|
|
1397
|
-
@container (min-width: 44.01rem) { :host([panel='over']) .wrap { position: relative; grid-template-columns: minmax(0, 1fr); } :host([panel='over']) .panel { position: absolute; inset-block-start: 32%; inset-inline-end: ${r(8)}; inline-size: 22.5rem; box-sizing: border-box; box-shadow: ${e.shadowXl}; } }
|
|
1398
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
1399
|
-
`]}willUpdate(t){(t.has("selectedPlot")||t.has("plots"))&&this.selectedPlot&&!this.chosen&&(this.chosen=this.plots.find(i=>String(i.number)===this.selectedPlot))}word(t){return t==="sold"?this.soldText:t==="reserved"?this.reservedText:this.availableText}choose(t){this.chosen=t,this.requestUpdate(),this.dispatchEvent(new CustomEvent("impkt-select",{detail:{plot:t},bubbles:!0,composed:!0}))}renderPanel(){let t=this.chosen;if(!t)return a`<p class="hint">${this.hint}</p>`;let i=t.status??"available";return a`<span class="status ${i}">${this.word(i)}</span>
|
|
1400
|
-
<p class="name">${this.plotWord} ${t.number}</p>
|
|
1401
|
-
${t.name||t.beds?a`<p class="sub">${[t.name,t.beds].filter(Boolean).join(" \xB7 ")}</p>`:l}
|
|
1402
|
-
${t.price?a`<p class="price">${t.price}</p>`:l}
|
|
1403
|
-
${t.href&&i!=="sold"?a`<a class="go" href=${t.href}>${this.actionText}${S("arrow-right","16px")}</a>`:l}`}render(){return a`<div class="wrap" part="wrap">
|
|
1404
|
-
<div>
|
|
1405
|
-
<div class="plan" part="plan">
|
|
1406
|
-
<img src=${this.imageSrc} alt=${this.imageAlt} />
|
|
1407
|
-
${this.plots.map(t=>{let i=t.status??"available",s=[`${this.plotWord} ${t.number}`,t.name,this.word(i),t.price].filter(Boolean).join(", ");return a`<button class="pin ${i}" type="button" style="left:${Number(t.x)}%;top:${Number(t.y)}%" aria-label=${s} aria-pressed=${String(this.chosen===t)} @click=${()=>this.choose(t)}>${t.number}</button>`})}
|
|
1408
|
-
</div>
|
|
1409
|
-
<ul class="legend">
|
|
1410
|
-
<li><span class="key"></span>${this.availableText}</li>
|
|
1411
|
-
<li><span class="key reserved"></span>${this.reservedText}</li>
|
|
1412
|
-
<li><span class="key sold"></span>${this.soldText}</li>
|
|
1413
|
-
</ul>
|
|
1414
|
-
</div>
|
|
1415
|
-
<div class="panel" part="panel" aria-live="polite">${this.renderPanel()}</div>
|
|
1416
|
-
</div>`}};function Zi(o,t,i){let s=i*12;if(o<=0||s<=0)return 0;let n=t/100/12;return n===0?o/s:o*n/(1-(1+n)**-s)}var Xe=class extends c{static{this.properties={heading:{type:String},price:{type:Number},depositPercent:{type:Number,attribute:"deposit-percent"},rate:{type:Number},years:{type:Number},currency:{type:String},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="What would it cost each month?",this.price=385e3,this.depositPercent=10,this.rate=4.5,this.years=30,this.currency="GBP",this.smallPrint="This is an estimate, not a mortgage offer. Your home may be repossessed if you do not keep up repayments on your mortgage.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,h`
|
|
1417
|
-
:host { display: block; container-type: inline-size; }
|
|
1418
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowMd}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1419
|
-
.inputs { display: flex; flex-direction: column; gap: ${r(5)}; padding: ${r(8)}; }
|
|
1420
|
-
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1421
|
-
label { display: flex; justify-content: space-between; gap: ${r(3)}; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1.5)}; }
|
|
1422
|
-
.read { font-weight: ${u("regular")}; color: ${e.textMuted}; }
|
|
1423
|
-
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${r(2)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; }
|
|
1424
|
-
input[type='range'] { inline-size: 100%; min-block-size: 24px; margin: 0; accent-color: ${e.brand}; }
|
|
1425
|
-
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(4)}; }
|
|
1426
|
-
.result { display: flex; flex-direction: column; justify-content: center; gap: ${r(2)}; padding: ${r(8)}; color: ${e.onBrand}; background: ${e.brand}; }
|
|
1427
|
-
.caption { margin: 0; ${m("sm")} opacity: 0.85; }
|
|
1428
|
-
output { display: block; font-family: ${e.fontHeading}; ${m("4xl")} font-weight: ${u("bold")}; }
|
|
1429
|
-
dl { display: grid; gap: ${r(2)}; margin: ${r(4)} 0 0; padding-block-start: ${r(4)}; border-block-start: 1px solid color-mix(in srgb, ${e.onBrand} 25%, transparent); ${m("sm")} }
|
|
1430
|
-
dl div { display: flex; justify-content: space-between; gap: ${r(3)}; }
|
|
1431
|
-
dt { opacity: 0.85; }
|
|
1432
|
-
dd { margin: 0; font-weight: ${u("semibold")}; }
|
|
1433
|
-
.small { grid-column: 1 / -1; margin: 0; padding: ${r(4)} ${r(8)}; ${m("xs")} color: ${e.textMuted}; background: ${e.surfaceSubtle}; }
|
|
1434
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${r(5)}; } .small { padding: ${r(4)} ${r(5)}; } }
|
|
1435
|
-
`]}money(t){try{return new Intl.NumberFormat(B(this),{style:"currency",currency:this.currency,maximumFractionDigits:0}).format(t)}catch{return String(Math.round(t))}}field(t){return i=>{this[t]=Number(i.target.value)||0}}render(){let t=this.price*this.depositPercent/100,i=Math.max(this.price-t,0),s=Zi(i,this.rate,this.years);return a`<div class="wrap" part="wrap">
|
|
1436
|
-
<div class="inputs">
|
|
1437
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1438
|
-
<div><label for=${this.id_("price")}>${g("Home price")}</label><input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${this.field("price")} /></div>
|
|
1439
|
-
<div><label for=${this.id_("deposit")}>${g("Deposit")} <span class="read">${this.depositPercent}% · ${this.money(t)}</span></label><input id=${this.id_("deposit")} type="range" min="5" max="60" step="1" .value=${String(this.depositPercent)} @input=${this.field("depositPercent")} /></div>
|
|
1440
|
-
<div class="two">
|
|
1441
|
-
<div><label for=${this.id_("years")}>${g("Term")} <span class="read">${g("{years} years",{years:this.years})}</span></label><input id=${this.id_("years")} type="range" min="5" max="40" step="1" .value=${String(this.years)} @input=${this.field("years")} /></div>
|
|
1442
|
-
<div><label for=${this.id_("rate")}>${g("Interest rate (%)")}</label><input id=${this.id_("rate")} type="number" min="0" max="20" step="0.05" inputmode="decimal" .value=${String(this.rate)} @input=${this.field("rate")} /></div>
|
|
1443
|
-
</div>
|
|
1444
|
-
</div>
|
|
1445
|
-
<div class="result">
|
|
1446
|
-
<p class="caption">${g("Estimated monthly repayment")}</p>
|
|
1447
|
-
<output for=${`${this.id_("price")} ${this.id_("deposit")} ${this.id_("years")} ${this.id_("rate")}`}>${this.money(s)}</output>
|
|
1448
|
-
<dl>
|
|
1449
|
-
<div><dt>${g("You would borrow")}</dt><dd>${this.money(i)}</dd></div>
|
|
1450
|
-
<div><dt>${g("Total repayable")}</dt><dd>${this.money(s*this.years*12)}</dd></div>
|
|
1451
|
-
</dl>
|
|
1452
|
-
</div>
|
|
1453
|
-
${this.smallPrint?a`<p class="small">${this.smallPrint}</p>`:l}
|
|
1454
|
-
</div>`}},Ge=class extends c{static{this.properties={beforeSrc:{type:String,attribute:"before-src"},beforeAlt:{type:String,attribute:"before-alt"},afterSrc:{type:String,attribute:"after-src"},afterAlt:{type:String,attribute:"after-alt"},beforeLabel:{type:String,attribute:"before-label"},afterLabel:{type:String,attribute:"after-label"},label:{type:String},position:{type:Number},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.beforeSrc="",this.beforeAlt="",this.afterSrc="",this.afterAlt="",this.beforeLabel="Before",this.afterLabel="After",this.label="Compare the two pictures",this.position=50,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,h`
|
|
1455
|
-
.frame { position: relative; overflow: hidden; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowLg}; line-height: 0; --at: 50%; }
|
|
1456
|
-
img { display: block; inline-size: 100%; block-size: auto; }
|
|
1457
|
-
.after { position: absolute; inset: 0; block-size: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--at)); }
|
|
1458
|
-
.tag { position: absolute; inset-block-start: ${r(3)}; padding: ${r(1)} ${r(3)}; ${m("xs")} line-height: 1.4; font-weight: ${u("semibold")}; color: ${e.text}; background: ${e.surfaceCard}; border-radius: 999px; box-shadow: ${e.shadowSm}; }
|
|
1459
|
-
.tag.b { inset-inline-start: ${r(3)}; }
|
|
1460
|
-
.tag.a { inset-inline-end: ${r(3)}; }
|
|
1461
|
-
.line { position: absolute; inset-block: 0; inset-inline-start: var(--at); inline-size: 2px; margin-inline-start: -1px; background: ${e.surfaceCard}; pointer-events: none; }
|
|
1462
|
-
.grip { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; display: flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; margin: -22px 0 0 -22px; color: ${e.text}; background: ${e.surfaceCard}; border-radius: 50%; box-shadow: ${e.shadowMd}; }
|
|
1463
|
-
input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
|
|
1464
|
-
.frame:has(input:focus-visible) .grip { box-shadow: ${e.focusShadow}; }
|
|
1465
|
-
`]}render(){return a`<div class="frame" part="frame" style="--at:${this.position}%">
|
|
1466
|
-
<img src=${this.beforeSrc} alt=${this.beforeAlt} />
|
|
1467
|
-
<img class="after" src=${this.afterSrc} alt=${this.afterAlt} />
|
|
1468
|
-
<span class="tag b" aria-hidden="true">${this.beforeLabel}</span>
|
|
1469
|
-
<span class="tag a" aria-hidden="true">${this.afterLabel}</span>
|
|
1470
|
-
<span class="line"><span class="grip">${S("arrow-left","14px")}${S("arrow-right","14px")}</span></span>
|
|
1471
|
-
<input type="range" min="0" max="100" aria-label=${this.label} .value=${String(this.position)} @input=${t=>{this.position=Number(t.target.value)}} />
|
|
1472
|
-
</div>`}},Ye=class extends c{constructor(){super();this.shown=!1;this.check=()=>{let i=window.scrollY>=this.revealAfter;i!==this.shown&&(this.shown=i,this.requestUpdate(),this.clearance(i))};this.label="Quick actions",this.heading="",this.lead="",this.showOn="phones",this.revealAfter=400}static{this.properties={label:{type:String},heading:{type:String},lead:{type:String},showOn:{type:String,reflect:!0,attribute:"show-on"},revealAfter:{type:Number,attribute:"reveal-after"}}}static{this.styles=[...c.styles,k,h`
|
|
1473
|
-
:host { display: block; }
|
|
1474
|
-
.bar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: ${r(4)}; padding: ${r(3)} ${r(4)} calc(${r(3)} + env(safe-area-inset-bottom)); background: ${e.surfaceCard}; box-shadow: ${e.shadowXl}, 0 -1px 0 color-mix(in srgb, ${e.text} 8%, transparent); transform: translateY(110%); visibility: hidden; transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms; }
|
|
1475
|
-
.bar.on { transform: none; visibility: visible; }
|
|
1476
|
-
.spacer { block-size: 5rem; }
|
|
1477
|
-
.h { font-family: ${e.fontHeading}; ${m("md")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1478
|
-
.t { ${m("xs")} color: ${e.textMuted}; }
|
|
1479
|
-
.words { min-inline-size: 0; }
|
|
1480
|
-
.actions { display: flex; flex: none; gap: ${r(2)}; }
|
|
1481
|
-
@media (min-width: 48rem) { :host([show-on='phones']) { display: none; } }
|
|
1482
|
-
`]}clearance(i){let n=i&&getComputedStyle(this).display!=="none"?`${this.renderRoot.querySelector(".bar")?.getBoundingClientRect().height??80}px`:"",d=document.documentElement.style;d.scrollPaddingBlockEnd=n,n?d.setProperty("--impkt-bottom-bar",n):d.removeProperty("--impkt-bottom-bar")}connectedCallback(){super.connectedCallback(),window.addEventListener("scroll",this.check,{passive:!0}),this.check()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.check),this.clearance(!1)}render(){return a`<div class="spacer"></div>
|
|
1483
|
-
<section class="bar ${this.shown?"on":""}" part="bar" aria-label=${this.label}>
|
|
1484
|
-
<div class="words">
|
|
1485
|
-
${this.heading?a`<div class="h">${this.heading}</div>`:l}
|
|
1486
|
-
${this.lead?a`<div class="t">${this.lead}</div>`:l}
|
|
1487
|
-
</div>
|
|
1488
|
-
<div class="actions"><slot name="actions"></slot></div>
|
|
1489
|
-
</section>`}},Qe=class extends c{static{this.properties={heading:{type:String},address:{type:String},hours:{type:String},phone:{type:String},mapSrc:{type:String,attribute:"map-src"},mapAlt:{type:String,attribute:"map-alt"},directionsText:{type:String,attribute:"directions-text"},directionsHref:{type:String,attribute:"directions-href"},nearby:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.address="",this.hours="",this.phone="",this.mapSrc="",this.mapAlt="",this.directionsText="Get directions",this.directionsHref="",this.nearby=[],this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,h`
|
|
1490
|
-
:host { display: block; container-type: inline-size; }
|
|
1491
|
-
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: ${e.surfaceCard}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowMd}, 0 0 0 1px color-mix(in srgb, ${e.text} 6%, transparent); }
|
|
1492
|
-
.wrap.solo { grid-template-columns: minmax(0, 1fr); }
|
|
1493
|
-
.map { min-block-size: 16rem; background: ${e.surfaceSubtle}; }
|
|
1494
|
-
.map img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
1495
|
-
.info { display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(8)}; }
|
|
1496
|
-
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
1497
|
-
.row { display: flex; gap: ${r(3)}; margin: 0; white-space: pre-line; }
|
|
1498
|
-
.row svg { flex: none; margin-block-start: ${r(.5)}; color: ${e.brand}; }
|
|
1499
|
-
a { color: ${e.link}; }
|
|
1500
|
-
ul { display: grid; gap: ${r(1.5)}; margin: ${r(1)} 0; padding: ${r(3)} 0 0; list-style: none; border-block-start: 1px solid color-mix(in srgb, ${e.text} 10%, transparent); ${m("sm")} }
|
|
1501
|
-
li { display: flex; justify-content: space-between; gap: ${r(3)}; }
|
|
1502
|
-
li span:last-child { color: ${e.textMuted}; text-align: end; }
|
|
1503
|
-
.go { ${A} align-self: flex-start; display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(2)} ${r(4)}; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border-radius: ${e.radiusLg}; }
|
|
1504
|
-
.go:hover { background: ${e.brandHover}; }
|
|
1505
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .info { padding: ${r(5)}; } }
|
|
1506
|
-
`]}render(){let t=this.directionsHref||(this.address?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(this.address)}`:"");return a`<div class="wrap ${this.mapSrc?"":"solo"}" part="wrap">
|
|
1507
|
-
${this.mapSrc?a`<div class="map"><img src=${this.mapSrc} alt=${this.mapAlt} /></div>`:l}
|
|
1508
|
-
<div class="info">
|
|
1509
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
1510
|
-
${this.address?a`<p class="row">${S("map-pin","20px")}<span>${this.address}</span></p>`:l}
|
|
1511
|
-
${this.hours?a`<p class="row">${S("clock","20px")}<span>${this.hours}</span></p>`:l}
|
|
1512
|
-
${this.phone?a`<p class="row">${S("phone","20px")}<a href=${`tel:${this.phone.replace(/\s+/g,"")}`}>${this.phone}</a></p>`:l}
|
|
1513
|
-
${this.nearby.length?a`<ul>${this.nearby.map(i=>a`<li><span>${i.place}</span><span>${i.distance}</span></li>`)}</ul>`:l}
|
|
1514
|
-
${t?a`<a class="go" href=${t}>${this.directionsText}${S("arrow-right","16px")}</a>`:l}
|
|
1515
|
-
</div>
|
|
1516
|
-
</div>`}};customElements.define("impkt-site-plan",Ke);customElements.define("impkt-mortgage-calculator",Xe);customElements.define("impkt-before-after",Ge);customElements.define("impkt-sticky-bar",Ye);customElements.define("impkt-location-card",Qe);var re={brand:"var(--impkt-color-brand-default, #1f4ed8)",accent:"var(--impkt-color-accent-default, #c8a15a)",info:"var(--impkt-color-status-info-default, #1f4ed8)",success:"var(--impkt-color-status-success-default, #047857)",warning:"var(--impkt-color-status-warning-default, #b45309)",danger:"var(--impkt-color-status-danger-default, #c8102e)"},Ze=["success","info","warning","accent","danger","brand"],P=(o,t)=>typeof o=="number"?`var(--impkt-color-chart-${o}, ${re[Ze[(o-1)%Ze.length]]})`:o&&o in re?re[o]:`var(--impkt-color-chart-${t%5+1}, ${re[Ze[t%Ze.length]]})`;function zi(o,t){let i=()=>{o.setAttribute("shown",""),t?.()};if(typeof IntersectionObserver!="function")return i(),()=>{};let s=new IntersectionObserver(n=>{n.some(d=>d.isIntersecting)&&(i(),s.disconnect())},{threshold:.25});return s.observe(o),()=>s.disconnect()}var Ji=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,st=h`.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; }`,Cr=(o,t,i)=>{switch(Math.min(Math.max(o||3,2),6)){case 2:return a`<h2 class=${i}>${t}</h2>`;case 4:return a`<h4 class=${i}>${t}</h4>`;case 5:return a`<h5 class=${i}>${t}</h5>`;case 6:return a`<h6 class=${i}>${t}</h6>`;default:return a`<h3 class=${i}>${t}</h3>`}},at=h`
|
|
1517
|
-
.h { margin: 0; color: var(--impkt-heading, ${e.textHeading}); font-family: ${e.fontHeading}; font-weight: ${u("bold")}; letter-spacing: ${e.trackingTight}; text-wrap: balance; }
|
|
1518
|
-
.body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
|
|
1519
|
-
.meta { margin: 0; color: inherit; opacity: 0.6; text-transform: uppercase; }
|
|
1520
|
-
.sr-only { ${E} }
|
|
1521
|
-
`,Je=class extends c{constructor(){super();this.raf=0;this.label="",this.heading="",this.text="",this.beforeSrc="",this.beforeAlt="",this.afterSrc="",this.afterAlt="",this.items=[],this.href="",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={label:{type:String},heading:{type:String},text:{type:String},beforeSrc:{type:String,attribute:"before-src"},beforeAlt:{type:String,attribute:"before-alt"},afterSrc:{type:String,attribute:"after-src"},afterAlt:{type:String,attribute:"after-alt"},items:{type:Array},href:{type:String},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,w,st,at,h`
|
|
1522
|
-
:host { display: block; }
|
|
1523
|
-
article { display: flex; flex-direction: column; gap: ${r(3)}; }
|
|
1524
|
-
.media { border-radius: ${e.radiusXl}; overflow: clip; background: ${e.surfaceInset}; }
|
|
1525
|
-
.media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
|
|
1526
|
-
impkt-before-after { display: block; }
|
|
1527
|
-
.h { font-size: ${$("3xl")}; }
|
|
1528
|
-
.h a { color: inherit; text-decoration: none; }
|
|
1529
|
-
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1530
|
-
.h a:focus-visible { outline: none; box-shadow: ${e.focusShadow}; border-radius: ${e.radiusSm}; }
|
|
1531
|
-
ul { list-style: none; margin: ${r(1)} 0 0; padding: 0; display: grid; gap: ${r(1)}; }
|
|
1532
|
-
li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border-radius: ${e.radius}; }
|
|
1533
|
-
li[data-change='added'] { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
1534
|
-
li[data-change='removed'] { background: ${e.dangerSubtle}; color: ${e.dangerText}; }
|
|
1535
|
-
li[data-change='same'] { color: ${e.textMuted}; }
|
|
1536
|
-
.sign { font-weight: ${u("bold")}; }
|
|
1537
|
-
`]}wipe(i){let s=this.renderRoot.querySelector("impkt-before-after");if(!s)return;if(cancelAnimationFrame(this.raf),Ji()){s.position=i;return}let n=s.position??Ti,d=performance.now(),p=y=>y<.5?4*y*y*y:1-Math.pow(-2*y+2,3)/2,b=y=>{let x=Math.min(1,(y-d)/450);s.position=n+(i-n)*p(x),x<1&&(this.raf=requestAnimationFrame(b))};this.raf=requestAnimationFrame(b)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf)}render(){let i=this.beforeSrc&&this.afterSrc,s=this.href?a`<a href=${this.href}>${this.heading}</a>`:this.heading,n={added:"+",removed:"\u2212",same:" "},d={added:g("Added"),removed:g("Removed"),same:g("Kept")};return a`<article part="card">
|
|
1538
|
-
${i?a`<div class="media" @pointerenter=${p=>p.pointerType==="mouse"&&this.wipe(0)} @pointerleave=${p=>p.pointerType==="mouse"&&this.wipe(Ti)}><impkt-before-after .position=${Ti} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${g("Before")} .afterLabel=${g("Shipped")} .label=${g("Compare {name} before and after",{name:this.heading})}></impkt-before-after></div>`:this.afterSrc||this.beforeSrc?a`<div class="media"><img src=${this.afterSrc||this.beforeSrc} alt=${this.afterSrc?this.afterAlt:this.beforeAlt} loading="lazy" /></div>`:l}
|
|
1539
|
-
${this.label?a`<p class="meta mono">${this.label}</p>`:l}
|
|
1540
|
-
${this.heading?Rr(this.headingLevel,s):l}
|
|
1541
|
-
${this.text?a`<p class="body">${this.text}</p>`:l}
|
|
1542
|
-
${(this.items??[]).length?a`<ul class="mono" part="diff">${this.items.map(p=>a`<li data-change=${p.change}><span class="sign" aria-hidden="true">${n[p.change]??" "}</span><span><span class="sr-only">${d[p.change]??""}: </span>${p.text}</span></li>`)}</ul>`:l}
|
|
1543
|
-
</article>`}},et=class extends c{static{this.properties={items:{type:Array},columns:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.columns="two",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
1544
|
-
:host { display: block; container-type: inline-size; }
|
|
1545
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(12)} ${r(10)}; }
|
|
1546
|
-
:host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
|
|
1547
|
-
:host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1548
|
-
@container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
1549
|
-
`]}render(){let t=typeof location>"u"?"":location.pathname.replace(/\/$/,""),i=(this.items??[]).filter(s=>!s.href||s.href.replace(/\/$/,"")!==t);return a`<ul part="list">${i.map(s=>{let n=s.heading??s.title??"";return a`<li><impkt-release-card
|
|
1550
|
-
.label=${s.label??""} .heading=${n} .text=${s.text??""} .href=${s.href??""}
|
|
1551
|
-
.beforeSrc=${s.beforeSrc??""} .beforeAlt=${s.beforeAlt||g("{name} as a wireframe",{name:n})}
|
|
1552
|
-
.afterSrc=${s.afterSrc??""} .afterAlt=${s.afterAlt||g("{name} as it shipped",{name:n})}
|
|
1553
|
-
.items=${s.items??[]} .headingLevel=${this.headingLevel}></impkt-release-card></li>`})}</ul>`}},Ti=42;function Rr(o,t){let i=Math.min(Math.max(o||3,2),6);return i===2?a`<h2 class="h">${t}</h2>`:i===4?a`<h4 class="h">${t}</h4>`:i===5?a`<h5 class="h">${t}</h5>`:i===6?a`<h6 class="h">${t}</h6>`:a`<h3 class="h">${t}</h3>`}var tt=class extends c{constructor(){super();this.unwatch=()=>{};this.items=[],this.trunk="",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},trunk:{type:String},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,w,st,at,h`
|
|
1554
|
-
:host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
|
|
1555
|
-
ul { list-style: none; margin: 0; padding: 0; position: relative; }
|
|
1556
|
-
ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
|
|
1557
|
-
li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${r(6)}; }
|
|
1558
|
-
.graph { position: relative; }
|
|
1559
|
-
.graph svg { position: absolute; inset-block-start: -${r(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${r(12)}); overflow: visible; }
|
|
1560
|
-
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${r(4)} ${r(10)}; align-items: start; }
|
|
1561
|
-
.path { margin: 0 0 ${r(2)}; opacity: 0.6; }
|
|
1562
|
-
.h { font-size: ${$("3xl")}; line-height: 1.05; }
|
|
1563
|
-
.h a { color: inherit; text-decoration: none; }
|
|
1564
|
-
.h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
|
|
1565
|
-
.h a:focus-visible { outline: none; box-shadow: ${e.focusShadow}; border-radius: ${e.radiusSm}; }
|
|
1566
|
-
.detail { display: flex; flex-direction: column; gap: ${r(3)}; padding-block-start: ${r(1)}; }
|
|
1567
|
-
.tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
|
|
1568
|
-
.end { position: relative; display: flex; align-items: center; gap: ${r(3)}; padding-block-start: ${r(4)}; }
|
|
1569
|
-
.end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
|
|
1570
|
-
@container (max-width: 44rem) {
|
|
1571
|
-
li { grid-template-columns: 56px minmax(0, 1fr); }
|
|
1572
|
-
.graph svg { inline-size: 56px; }
|
|
1573
|
-
.row { grid-template-columns: minmax(0, 1fr); }
|
|
1574
|
-
.h { font-size: ${$("2xl")}; }
|
|
1575
|
-
}
|
|
1576
|
-
/* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
|
|
1577
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1578
|
-
.graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
|
|
1579
|
-
.graph circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
|
|
1580
|
-
:host([shown]) .graph svg { clip-path: inset(0); }
|
|
1581
|
-
:host([shown]) .graph circle { transform: scale(1); }
|
|
1582
|
-
}
|
|
1583
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let i=s=>z`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
1584
|
-
<path d="M12 0 C12 40 60 30 60 70 L60 120 C60 160 12 160 12 200" fill="none" stroke=${s} stroke-width="3" vector-effect="non-scaling-stroke" />
|
|
1585
|
-
<circle cx="60" cy="86" r="8" fill=${s} />
|
|
1586
|
-
</svg>`;return a`<ul part="list">${(this.items??[]).map((s,n)=>a`<li part="item" style=${`--i:${n}`}>
|
|
1587
|
-
<div class="graph">${i(P(s.tone,n))}</div>
|
|
1588
|
-
<div>
|
|
1589
|
-
${s.path?a`<p class="path mono">${s.path}</p>`:l}
|
|
1590
|
-
<div class="row">
|
|
1591
|
-
${Cr(this.headingLevel,s.href?a`<a href=${s.href}>${s.heading}</a>`:s.heading,"h")}
|
|
1592
|
-
<div class="detail">
|
|
1593
|
-
${s.text?a`<p class="body">${s.text}</p>`:l}
|
|
1594
|
-
${s.tags?.length?a`<p class="tags mono">${s.tags.join(" \xB7 ")}</p>`:l}
|
|
1595
|
-
</div>
|
|
1596
|
-
</div>
|
|
1597
|
-
</div>
|
|
1598
|
-
</li>`)}</ul>
|
|
1599
|
-
${this.trunk?a`<p class="end mono" part="trunk">${this.trunk}</p>`:l}`}},it=class extends c{constructor(){super();this.unwatch=()=>{};this.counted=null;this.items=[],this.summary="",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},summary:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,w,st,at,h`
|
|
1600
|
-
:host { display: block; container-type: inline-size; }
|
|
1601
|
-
.summary { display: inline-flex; align-items: center; gap: ${r(2)}; margin: 0 0 ${r(6)}; padding: ${r(1)} ${r(3)}; border-radius: ${e.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
|
|
1602
|
-
.summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${e.success}; }
|
|
1603
|
-
/* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
|
|
1604
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${r(6)}; }
|
|
1605
|
-
li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${r(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
|
|
1606
|
-
/* Checks run: each tick pops in, 150 ms after the one above. */
|
|
1607
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1608
|
-
.tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
|
|
1609
|
-
:host([shown]) .tick { transform: scale(1); }
|
|
1610
|
-
}
|
|
1611
|
-
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1612
|
-
/* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
|
|
1613
|
-
.tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${e.success}; color: var(--impkt-color-status-success-on, #fff); }
|
|
1614
|
-
.figure { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; font-size: ${$("5xl")}; line-height: 1; letter-spacing: ${e.trackingTight}; white-space: nowrap; }
|
|
1615
|
-
.label { margin: 0; ${m("xl")} }
|
|
1616
|
-
.status { margin: 0; opacity: 0.6; }
|
|
1617
|
-
@container (max-width: 40rem) {
|
|
1618
|
-
ul { grid-template-columns: 28px minmax(0, 1fr); }
|
|
1619
|
-
li { row-gap: ${r(1)}; }
|
|
1620
|
-
.label, .status { grid-column: 2; }
|
|
1621
|
-
.figure { font-size: ${$("4xl")}; }
|
|
1622
|
-
}
|
|
1623
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this,()=>this.run())}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}run(){if(Ji())return;let i=this.items??[],s=performance.now(),n=d=>{this.counted=i.map((p,b)=>Math.min(1,Math.max(0,(d-s-b*150)/1200))),this.requestUpdate(),this.counted.some(p=>p<1)?requestAnimationFrame(n):this.counted=null};requestAnimationFrame(n)}render(){let i=(s,n)=>{let d=this.counted?.[n],p=/^(\d+)(.*)$/.exec(s);if(d===void 0||d>=1||!p)return a`${s}`;let b=1-Math.pow(1-d,3);return a`<span aria-hidden="true">${Math.round(Number(p[1])*b)}${p[2]}</span><span class="sr-only">${s}</span>`};return a`${this.summary?a`<p class="summary mono" part="summary">${this.summary}</p>`:l}
|
|
1624
|
-
<ul part="list">${(this.items??[]).map((s,n)=>a`<li part="item" style=${`--i:${n}`}>
|
|
1625
|
-
<span class="tick" aria-hidden="true">${S("check","16px")}</span>
|
|
1626
|
-
<p class="figure">${i(s.figure,n)}</p>
|
|
1627
|
-
<p class="label">${s.label}</p>
|
|
1628
|
-
${s.status?a`<p class="status mono">${s.status}</p>`:a`<span></span>`}
|
|
1629
|
-
</li>`)}</ul>`}},rt=class extends c{constructor(){super();this.unwatch=()=>{};this.lanes=[],this.marks=[],this.span=20,this.unit="",this.every=2,this.release="",this.releaseAt=0,this.label="",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={lanes:{type:Array},marks:{type:Array},span:{type:Number},unit:{type:String},every:{type:Number},release:{type:String},releaseAt:{type:Number,attribute:"release-at"},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,w,st,at,h`
|
|
1630
|
-
:host { display: block; overflow-x: auto; }
|
|
1631
|
-
svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
|
|
1632
|
-
text { font-family: ${e.fontMono}; font-size: 12px; fill: currentColor; }
|
|
1633
|
-
.faint { opacity: 0.5; }
|
|
1634
|
-
/* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
|
|
1635
|
-
.halo { paint-order: stroke; stroke: var(--impkt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
|
|
1636
|
-
/* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
|
|
1637
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
1638
|
-
svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
|
|
1639
|
-
:host([shown]) svg { clip-path: inset(0 -40px 0 0); }
|
|
1640
|
-
}
|
|
1641
|
-
`]}connectedCallback(){super.connectedCallback(),this.unwatch=zi(this)}disconnectedCallback(){super.disconnectedCallback(),this.unwatch()}render(){let d=this.span>0?this.span:20,p=L=>24+Math.min(Math.max(L,0),d)/d*1116,b=this.lanes??[],y=52,x=40+(b.length+1)*y+40,v=40,M=L=>v+(L+1)*y,I=[];for(let L=0;L<=d;L+=Math.max(1,this.every||2))I.push(L);let N=L=>b.findIndex(_=>L>=_.from&&L<=_.to),J=L=>(this.marks??[]).some(_=>N(_.at)===L),di=this.unit||g("wk"),ur=this.label||g("Project timeline"),mr=b.map(L=>`${L.label}: ${g("{unit} {from} to {to}",{unit:di,from:L.from,to:L.to})}`).join("; ");return a`<figure part="figure" style="margin:0">
|
|
1642
|
-
<svg viewBox="0 0 ${1200} ${x}" role="img" aria-label=${`${ur}. ${mr}${this.release?`. ${g("{name} at {unit} {at}",{name:this.release,unit:di,at:this.releaseAt})}`:""}`}>
|
|
1643
|
-
<line x1=${24} y1=${v} x2=${1180} y2=${v} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
|
|
1644
|
-
<path d="M${1168} ${v-7} L${1180} ${v} L${1168} ${v+7}" fill="none" stroke="currentColor" stroke-width="3" />
|
|
1645
|
-
${b.map((L,_)=>{let ee=P(L.tone,_),O=M(_),V=p(L.from),ae=p(L.to),ne=Math.min(36,(ae-V)/3);return z`<g>
|
|
1646
|
-
<path d="M${V} ${v} C${V} ${(v+O)/2} ${V+ne} ${O} ${V+ne*1.6} ${O} L${ae-ne*1.6} ${O} C${ae-ne} ${O} ${ae} ${(v+O)/2} ${ae} ${v}" fill="none" stroke=${ee} stroke-width="3" />
|
|
1647
|
-
<circle cx=${V} cy=${v} r="7" fill=${ee} />
|
|
1648
|
-
<text x=${V+ne*1.6} y=${J(_)?O-10:O+20} class="halo" style=${`fill:${ee}`}>${L.label}</text>
|
|
1649
|
-
</g>`})}
|
|
1650
|
-
${(this.marks??[]).map(L=>{let _=N(L.at),ee=_>=0?M(_):v,O=_>=0?P(b[_].tone,_):"currentColor";return z`<g><circle cx=${p(L.at)} cy=${ee} r="6" fill="var(--impkt-color-surface-card, #fff)" stroke=${O} stroke-width="3" /><text x=${p(L.at)} y=${ee+22} text-anchor="middle" class="faint">${L.label}</text></g>`})}
|
|
1651
|
-
${this.release?z`<g>
|
|
1652
|
-
<circle cx=${p(this.releaseAt)} cy=${v} r="10" fill=${re.success} />
|
|
1653
|
-
<rect x=${p(this.releaseAt)-8} y=${v-36} rx="4" width=${this.release.length*7.6+16} height="22" fill=${re.success} />
|
|
1654
|
-
<text x=${p(this.releaseAt)} y=${v-21} style="fill:var(--impkt-color-surface-card, #fff)">${this.release}</text>
|
|
1655
|
-
</g>`:l}
|
|
1656
|
-
${I.map(L=>z`<text x=${p(L)} y=${x-10} text-anchor="middle" class="faint">${di} ${L}</text>`)}
|
|
1657
|
-
</svg>
|
|
1658
|
-
</figure>`}};customElements.define("impkt-release-card",Je);customElements.define("impkt-release-list",et);customElements.define("impkt-branch-list",tt);customElements.define("impkt-check-list",it);customElements.define("impkt-branch-timeline",rt);function Ir(o){if(typeof location>"u"||!o||o.startsWith("#"))return null;let t;try{t=new URL(o,location.href).pathname.replace(/\/$/,"")||"/"}catch{return null}let i=location.pathname.replace(/\/$/,"")||"/";return t===i?"page":t!=="/"&&i.startsWith(`${t}/`)?"section":null}var nt=class extends c{constructor(){super();this.menuOpen=!1;this.needs=0;this.links=[],this.label="Main",this.menuText="Menu",this.menuLook="button",this.size="md",this.align="end"}static{this.properties={links:{type:Array},label:{type:String},menuText:{type:String,attribute:"menu-text"},menuLook:{type:String,reflect:!0,attribute:"menu-look"},size:{type:String,reflect:!0},align:{type:String,reflect:!0}}}get open(){return this.menuOpen}set open(i){this.menuOpen=i,this.requestUpdate()}static{this.styles=[...c.styles,k,h`
|
|
1659
|
-
/* It grows to fill a row it sits in, because it measures itself to decide when to fold. */
|
|
1660
|
-
:host { display: block; flex: 1 1 8rem; min-inline-size: 0; }
|
|
1661
|
-
nav { display: flex; flex-direction: column; position: relative; }
|
|
1662
|
-
li { flex: none; }
|
|
1663
|
-
ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${r(1)} ${r(6)}; align-items: center; justify-content: flex-end; }
|
|
1664
|
-
:host([align='start']) ul { justify-content: flex-start; }
|
|
1665
|
-
:host([align='center']) ul { justify-content: center; }
|
|
1666
|
-
a { ${A} display: inline-flex; align-items: center; padding: ${r(2)} ${r(1)}; color: inherit; font-weight: ${u("semibold")}; text-decoration: none; border-radius: ${e.radiusSm}; }
|
|
1667
|
-
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1668
|
-
a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
|
|
1669
|
-
.toggle { display: none; ${A} align-items: center; gap: ${r(2)}; align-self: flex-end; padding: ${r(2)} ${r(3)}; font: inherit; font-weight: ${u("semibold")}; color: inherit; background: transparent; border: ${e.borderThin} solid currentColor; border-radius: ${e.radius}; cursor: pointer; }
|
|
1670
|
-
/* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
|
|
1671
|
-
:host([folded]) { flex: 0 0 auto; }
|
|
1672
|
-
:host([folded]) .toggle { display: inline-flex; }
|
|
1673
|
-
:host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${e.brand}; color: ${e.onBrand}; }
|
|
1674
|
-
:host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
1675
|
-
:host([size='sm']) ul { column-gap: ${r(6)}; }
|
|
1676
|
-
:host([size='sm']) a { padding-inline: 0; font-size: ${$("sm")}; font-weight: ${u("medium")}; }
|
|
1677
|
-
:host([size='sm'][folded]) a { padding-inline: ${r(3)}; }
|
|
1678
|
-
:host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${r(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${r(2)}; background: ${e.surfaceCard}; color: ${e.text}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }
|
|
1679
|
-
:host([folded]) ul.open { display: flex; }
|
|
1680
|
-
:host([folded]) li { text-align: start; }
|
|
1681
|
-
:host([folded]) a { display: flex; padding: ${r(3)} ${r(3)}; }
|
|
1682
|
-
`]}fit(){let i=this.getBoundingClientRect().width;if(i<=0)return;if(!this.needs){this.removeAttribute("folded");let n=Array.from(this.renderRoot.querySelectorAll("li")),d=Number.parseFloat(getComputedStyle(this.renderRoot.querySelector("ul")).columnGap)||0;this.needs=n.reduce((p,b)=>p+b.getBoundingClientRect().width,0)+d*Math.max(0,n.length-1)}let s=this.needs>i;this.toggleAttribute("folded",s),!s&&this.menuOpen&&(this.open=!1)}updated(i){i.has("links")&&(this.needs=0,this.fit())}connectedCallback(){super.connectedCallback(),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>this.fit()),this.resize.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resize?.disconnect()}toggle(){this.open=!this.open}onKey(i){i.key!=="Escape"||!this.open||(this.open=!1,this.renderRoot.querySelector(".toggle")?.focus())}render(){let i=this.id_("links");return a`<nav aria-label=${this.label||l} part="nav" @keydown=${this.onKey}>
|
|
1683
|
-
<button class="toggle" type="button" aria-expanded=${this.open?"true":"false"} aria-controls=${i} @click=${this.toggle}>${S(this.open?"close":this.menuLook==="icon"?"menu-two":"menu")}<span class="words">${this.menuText}</span></button>
|
|
1684
|
-
<ul id=${i} class=${this.open?"open":""} part="list">
|
|
1685
|
-
${(this.links??[]).map(s=>{let n=Ir(s.href);return a`<li><a href=${s.href} aria-current=${n==="page"?"page":n==="section"?"true":l} part="link">${s.label}</a></li>`})}
|
|
1686
|
-
</ul>
|
|
1687
|
-
</nav>`}},ot=class extends c{static{this.properties={items:{type:Array},label:{type:String}}}constructor(){super(),this.items=[],this.label="Breadcrumb"}static{this.styles=[...c.styles,k,h`
|
|
1688
|
-
:host { display: block; font-size: ${$("sm")}; }
|
|
1689
|
-
ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${r(1)}; }
|
|
1690
|
-
li { display: inline-flex; align-items: center; gap: ${r(1)}; }
|
|
1691
|
-
li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${e.textMuted}; border-inline-end: 1.5px solid ${e.textMuted}; transform: rotate(45deg); margin-inline: ${r(1)} ${r(2)}; }
|
|
1692
|
-
a { color: ${e.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${e.radiusSm}; }
|
|
1693
|
-
a:hover { color: ${e.linkHover}; }
|
|
1694
|
-
[aria-current] { color: ${e.textMuted}; }
|
|
1695
|
-
.sr-only { ${E} }
|
|
1696
|
-
`]}render(){let t=this.items??[];return a`<nav aria-label=${this.label} part="nav"><ol>
|
|
1697
|
-
${t.map((i,s)=>a`<li>${s===t.length-1?a`<span aria-current="page">${i.label}</span>`:a`<a href=${i.href} part="link">${i.label}</a>`}</li>`)}
|
|
1698
|
-
</ol></nav>`}};customElements.define("impkt-nav",nt);customElements.define("impkt-breadcrumbs",ot);var Br=[0,1,2,3,4],Q=e.fontMono,er=h`
|
|
1699
|
-
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
|
|
1700
|
-
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
|
|
1701
|
-
`,lt=class extends c{static{this.properties={brand:{type:String},logoSrc:{type:String,attribute:"logo-src"},logoAlt:{type:String,attribute:"logo-alt"},home:{type:String},badge:{type:String},meta:{type:String},links:{type:Array},label:{type:String},menuText:{type:String,attribute:"menu-text"},status:{type:String},statusMeta:{type:String,attribute:"status-meta"},statusTone:{type:String,attribute:"status-tone"},actionText:{type:String,attribute:"action-text"},actionHref:{type:String,attribute:"action-href"}}}constructor(){super(),this.brand="",this.logoSrc="",this.logoAlt="",this.home="/",this.badge="",this.meta="",this.links=[],this.label="Main",this.menuText="Menu",this.status="",this.statusMeta="",this.statusTone="success",this.actionText="",this.actionHref=""}static{this.styles=[...c.styles,k,h`
|
|
1702
|
-
:host { display: block; container-type: inline-size; }
|
|
1703
|
-
.bar { display: flex; align-items: center; gap: ${r(6)}; }
|
|
1704
|
-
.start { display: flex; align-items: center; gap: ${r(3)}; flex: none; }
|
|
1705
|
-
.middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
|
|
1706
|
-
.middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
|
|
1707
|
-
slot { display: contents; }
|
|
1708
|
-
.brand { color: inherit; text-decoration: none; font-family: ${e.fontHeading}; font-weight: ${u("semibold")}; ${m("2xl")} letter-spacing: -0.02em; line-height: 1; }
|
|
1709
|
-
.brand img { display: block; block-size: 32px; inline-size: auto; }
|
|
1710
|
-
.chip { display: inline-flex; align-items: center; gap: ${r(1)}; padding: 2px ${r(2)}; border-radius: ${e.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${Q}; font-size: ${$("xs")}; }
|
|
1711
|
-
.chip svg { inline-size: 12px; block-size: 12px; }
|
|
1712
|
-
.meta { font-family: ${Q}; font-size: ${$("xs")}; opacity: 0.55; }
|
|
1713
|
-
.middle impkt-nav { flex: 1 1 8rem; }
|
|
1714
|
-
.end { display: flex; align-items: center; gap: ${r(3)}; flex: none; }
|
|
1715
|
-
.end:empty, .start:empty { display: none; }
|
|
1716
|
-
.status { display: inline-flex; align-items: center; gap: ${r(2)}; padding: ${r(1)} ${r(3)}; border: ${e.borderThin} solid ${e.border}; border-radius: 999px; background: ${e.surfaceCard}; font-family: ${Q}; font-size: ${$("xs")}; white-space: nowrap; }
|
|
1717
|
-
.status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1718
|
-
.status .hash { opacity: 0.55; }
|
|
1719
|
-
@container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${r(3)}; } }
|
|
1720
|
-
`]}act(){this.dispatchEvent(new CustomEvent("impkt-action",{bubbles:!0,composed:!0}))}render(){let t=this.logoSrc?a`<img src=${this.logoSrc} alt=${this.logoAlt||this.brand} />`:a`${this.brand}`;return a`<div class="bar" part="bar">
|
|
1721
|
-
<div class="start"><slot name="start">
|
|
1722
|
-
${this.brand||this.logoSrc?a`<a class="brand" href=${this.home||"/"} part="brand">${t}</a>`:l}
|
|
1723
|
-
${this.badge?a`<span class="chip" part="badge"><svg viewBox="0 0 14 14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="3.5" cy="3" r="1.5"/><circle cx="3.5" cy="11" r="1.5"/><circle cx="10.5" cy="4.5" r="1.5"/><path d="M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4"/></svg>${this.badge}</span>`:l}
|
|
1724
|
-
${this.meta?a`<span class="meta" part="meta">${this.meta}</span>`:l}
|
|
1725
|
-
</slot></div>
|
|
1726
|
-
<div class="middle"><slot name="middle">${(this.links??[]).length?a`<impkt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impkt-nav>`:l}</slot></div>
|
|
1727
|
-
<div class="end"><slot name="end">
|
|
1728
|
-
${this.status?a`<span class="status" part="status" style=${`--tone:${P(this.statusTone,0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta?a` <span class="hash">${this.statusMeta}</span>`:l}</span>`:l}
|
|
1729
|
-
${this.actionText?a`<impkt-button variant="primary" icon-after="arrow-right" href=${this.actionHref||l} @click=${this.act}>${this.actionText}</impkt-button>`:l}
|
|
1730
|
-
</slot></div>
|
|
1731
|
-
</div>`}},dt=class extends c{static{this.properties={text:{type:String},src:{type:String},alt:{type:String},href:{type:String},size:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.text="",this.src="",this.alt="",this.href="/",this.size="md",this.hideOn="never"}static{this.styles=[...c.styles,k,er,h`
|
|
1732
|
-
:host { display: inline-flex; align-items: center; flex: none; }
|
|
1733
|
-
a { color: inherit; text-decoration: none; font-family: ${e.fontHeading}; font-weight: ${u("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${e.radiusSm}; }
|
|
1734
|
-
:host([size='sm']) a { ${m("xl")} } :host([size='md']) a { ${m("2xl")} } :host([size='lg']) a { ${m("3xl")} }
|
|
1735
|
-
img { display: block; block-size: 32px; inline-size: auto; }
|
|
1736
|
-
@media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${m("xl")} } }
|
|
1737
|
-
`]}render(){return a`<a href=${this.href||"/"} part="link">${this.src?a`<img src=${this.src} alt=${this.alt||this.text||this.textContent?.trim()||""} />`:a`<slot>${this.text}</slot>`}</a>`}},ct=class extends c{static{this.properties={label:{type:String},meta:{type:String},icon:{type:String,reflect:!0},tone:{type:String},look:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.label="",this.meta="",this.icon="none",this.tone="success",this.look="filled",this.hideOn="never"}static{this.styles=[...c.styles,er,h`
|
|
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`
|
|
1738
1157
|
:host { display: inline-flex; flex: none; }
|
|
1739
|
-
span.chip { display: inline-flex; align-items: center; gap: ${
|
|
1740
|
-
:host([look='filled']) span.chip { border-radius: ${
|
|
1741
|
-
:host([look='outlined']) span.chip { border: ${
|
|
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; }
|
|
1742
1161
|
:host([look='plain']) span.chip { padding: 0; }
|
|
1743
1162
|
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
|
|
1744
1163
|
svg { inline-size: 12px; block-size: 12px; }
|
|
1745
|
-
.meta { opacity: 0.
|
|
1746
|
-
:host([look='plain']) .label { opacity: 0.
|
|
1747
|
-
`]}render(){let
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
.log .code { margin-inline-end: ${r(3)}; }
|
|
1758
|
-
.columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${r(8)}; }
|
|
1759
|
-
.h { margin: 0 0 ${r(4)}; font-family: ${Q}; font-size: ${$("xs")}; font-weight: ${u("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }
|
|
1760
|
-
.columns ul { display: grid; gap: ${r(3)}; }
|
|
1761
|
-
a { color: inherit; text-decoration: none; font-weight: ${u("medium")}; border-radius: ${e.radiusSm}; }
|
|
1762
|
-
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1763
|
-
.legal { margin: ${r(16)} 0 0; font-family: ${Q}; font-size: ${$("xs")}; opacity: 0.55; }
|
|
1764
|
-
.stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
|
|
1765
|
-
.stripe span { flex: 1; }
|
|
1766
|
-
@container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
1767
|
-
@container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
|
|
1768
|
-
@media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }
|
|
1769
|
-
`]}heading(t){let i=Math.min(Math.max(this.headingLevel||2,2),4);return i===3?a`<h3 class="h">${t}</h3>`:i===4?a`<h4 class="h">${t}</h4>`:a`<h2 class="h">${t}</h2>`}render(){let t=this.log??[];return a`<div part="footer">
|
|
1770
|
-
<div class="top">
|
|
1771
|
-
<div>
|
|
1772
|
-
${this.brand?a`<p class="brand" part="brand">${this.brand}</p>`:l}
|
|
1773
|
-
${t.length?a`<ul class="log" part="log">${t.map((i,s)=>a`<li style=${`--tone:${P(i.tone??(s===0?"success":"accent"),s)}`}><span class="dot" aria-hidden="true"></span><span>${i.meta?a`<span class="code">${i.meta}</span>`:l}${i.text}</span></li>`)}</ul>`:l}
|
|
1774
|
-
</div>
|
|
1775
|
-
<div class="columns" part="columns" style=${`--count:${Math.max(1,(this.columns??[]).length)}`}>
|
|
1776
|
-
${(this.columns??[]).map(i=>a`<div>${this.heading(i.heading)}<ul>${(i.links??[]).map(s=>a`<li><a href=${s.href}>${s.label}</a></li>`)}</ul></div>`)}
|
|
1777
|
-
</div>
|
|
1778
|
-
</div>
|
|
1779
|
-
${this.legal?a`<p class="legal" part="legal">${this.legal}</p>`:l}
|
|
1780
|
-
${this.stripe?a`<div class="stripe" aria-hidden="true">${Br.map(i=>a`<span style=${`background:${P(void 0,i)}`}></span>`)}</div>`:l}
|
|
1781
|
-
</div>`}};customElements.define("impkt-site-header",lt);customElements.define("impkt-wordmark",dt);customElements.define("impkt-chip",ct);customElements.define("impkt-site-footer",pt);var ht=class extends T{constructor(){super();this.filled=!1;this.filledText="";this.width="full",this.rows=4,this.maxlength=void 0,this.fillFrom="none"}static{this.properties={...T.properties,width:{type:String,reflect:!0},rows:{type:Number},maxlength:{type:Number},fillFrom:{type:String,attribute:"fill-from"}}}static{this.styles=[...T.styles,F,h`
|
|
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`
|
|
1782
1176
|
textarea {
|
|
1783
|
-
inline-size: min(100%, var(--
|
|
1784
|
-
padding: ${
|
|
1177
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
1178
|
+
padding: ${s(2.5)} ${s(3)};
|
|
1785
1179
|
font-family: inherit;
|
|
1786
|
-
font-size: ${
|
|
1787
|
-
color: ${
|
|
1788
|
-
background: var(--
|
|
1789
|
-
border: ${
|
|
1790
|
-
border-radius: ${
|
|
1791
|
-
box-shadow: var(--
|
|
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});
|
|
1792
1186
|
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
1793
1187
|
/* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text
|
|
1794
1188
|
can be made bigger, and a fixed box is where that stops working. */
|
|
1795
1189
|
resize: vertical;
|
|
1796
1190
|
}
|
|
1797
1191
|
textarea:hover:not(:disabled) {
|
|
1798
|
-
border-color: ${
|
|
1192
|
+
border-color: ${t.borderStrong};
|
|
1799
1193
|
}
|
|
1800
1194
|
textarea:focus-visible {
|
|
1801
|
-
border-color: ${
|
|
1802
|
-
box-shadow: ${
|
|
1195
|
+
border-color: ${t.brand};
|
|
1196
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
1803
1197
|
}
|
|
1804
1198
|
:host([invalid]) textarea {
|
|
1805
|
-
border-color: ${
|
|
1806
|
-
border-width: ${
|
|
1199
|
+
border-color: ${t.danger};
|
|
1200
|
+
border-width: ${t.borderThick};
|
|
1807
1201
|
}
|
|
1808
|
-
`]}willUpdate(i){super.willUpdate?.(i),this.filledText&&i.has("value")&&!this.value&&(this.value=this.filledText)}fill(){if(this.filled||this.fillFrom!=="estimate"||(this.filled=!0,this.value))return;let i=null;try{i=sessionStorage.getItem("
|
|
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("impakt.estimate")}catch{i=null}i&&(this.filledText=i,this.setFormValue(i))}renderControl(){return o`
|
|
1809
1203
|
<textarea
|
|
1810
1204
|
id=${this.controlId}
|
|
1811
1205
|
part="textarea"
|
|
@@ -1819,7 +1213,7 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1819
1213
|
aria-invalid=${this.error?"true":l}
|
|
1820
1214
|
@input=${i=>{this.filledText="",this.setFormValue(i.target.value)}}
|
|
1821
1215
|
>${this.value}</textarea>
|
|
1822
|
-
`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error),this.fill()}};customElements.define("
|
|
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`
|
|
1823
1217
|
fieldset {
|
|
1824
1218
|
border: 0;
|
|
1825
1219
|
margin: 0;
|
|
@@ -1832,65 +1226,65 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1832
1226
|
.option {
|
|
1833
1227
|
display: flex;
|
|
1834
1228
|
align-items: flex-start;
|
|
1835
|
-
gap: ${
|
|
1836
|
-
padding: ${
|
|
1837
|
-
border: ${
|
|
1838
|
-
border-radius: ${
|
|
1839
|
-
margin-block-end: ${
|
|
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)};
|
|
1840
1234
|
cursor: pointer;
|
|
1841
1235
|
}
|
|
1842
1236
|
.option:hover {
|
|
1843
|
-
background: ${
|
|
1237
|
+
background: ${t.surfaceSubtle};
|
|
1844
1238
|
}
|
|
1845
1239
|
.option input {
|
|
1846
|
-
${
|
|
1240
|
+
${T}
|
|
1847
1241
|
inline-size: 20px;
|
|
1848
1242
|
block-size: 20px;
|
|
1849
1243
|
margin: 0;
|
|
1850
1244
|
flex: none;
|
|
1851
|
-
accent-color: ${
|
|
1245
|
+
accent-color: ${t.brand};
|
|
1852
1246
|
}
|
|
1853
1247
|
.option-text {
|
|
1854
1248
|
display: block;
|
|
1855
|
-
font-size: ${
|
|
1249
|
+
font-size: ${g("md")};
|
|
1856
1250
|
}
|
|
1857
1251
|
.option-description {
|
|
1858
1252
|
display: block;
|
|
1859
|
-
font-size: ${
|
|
1860
|
-
color: ${
|
|
1861
|
-
margin-block-start: ${
|
|
1253
|
+
font-size: ${g("sm")};
|
|
1254
|
+
color: ${t.textMuted};
|
|
1255
|
+
margin-block-start: ${s(1)};
|
|
1862
1256
|
}
|
|
1863
1257
|
:host([invalid]) .option {
|
|
1864
|
-
border-color: ${
|
|
1258
|
+
border-color: ${t.danger};
|
|
1865
1259
|
}
|
|
1866
|
-
`]}renderLabel(){return
|
|
1867
|
-
${this.label}${this.required?
|
|
1868
|
-
</legend>`}onToggle(
|
|
1869
|
-
${this.options.map((
|
|
1870
|
-
<label class="option" part="option" for=${
|
|
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}>
|
|
1871
1265
|
<input
|
|
1872
1266
|
type="checkbox"
|
|
1873
|
-
id=${
|
|
1874
|
-
value=${
|
|
1875
|
-
.checked=${this.values.includes(
|
|
1267
|
+
id=${r}
|
|
1268
|
+
value=${e.value}
|
|
1269
|
+
.checked=${this.values.includes(e.value)}
|
|
1876
1270
|
?disabled=${this.disabled}
|
|
1877
1271
|
aria-describedby=${n??l}
|
|
1878
|
-
@change=${d=>this.onToggle(
|
|
1272
|
+
@change=${d=>this.onToggle(e.value,d.target.checked)}
|
|
1879
1273
|
/>
|
|
1880
1274
|
<span>
|
|
1881
|
-
<span class="option-text">${
|
|
1882
|
-
${
|
|
1275
|
+
<span class="option-text">${e.label}</span>
|
|
1276
|
+
${e.description?o`<span class="option-description" id=${n}>${e.description}</span>`:l}
|
|
1883
1277
|
</span>
|
|
1884
1278
|
</label>
|
|
1885
1279
|
`})}
|
|
1886
|
-
`}render(){return
|
|
1280
|
+
`}render(){return o`
|
|
1887
1281
|
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1888
1282
|
${this.renderLabel()}
|
|
1889
|
-
${this.description?
|
|
1283
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1890
1284
|
${this.renderControl()}
|
|
1891
1285
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1892
1286
|
</fieldset>
|
|
1893
|
-
`}updated(
|
|
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`
|
|
1894
1288
|
fieldset {
|
|
1895
1289
|
border: 0;
|
|
1896
1290
|
margin: 0;
|
|
@@ -1902,73 +1296,73 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1902
1296
|
}
|
|
1903
1297
|
.parts {
|
|
1904
1298
|
display: flex;
|
|
1905
|
-
gap: ${
|
|
1299
|
+
gap: ${s(3)};
|
|
1906
1300
|
}
|
|
1907
1301
|
.part {
|
|
1908
1302
|
display: flex;
|
|
1909
1303
|
flex-direction: column;
|
|
1910
|
-
gap: ${
|
|
1304
|
+
gap: ${s(1)};
|
|
1911
1305
|
}
|
|
1912
1306
|
.part label {
|
|
1913
|
-
font-size: ${
|
|
1914
|
-
color: ${
|
|
1307
|
+
font-size: ${g("sm")};
|
|
1308
|
+
color: ${t.textMuted};
|
|
1915
1309
|
}
|
|
1916
1310
|
input {
|
|
1917
1311
|
min-block-size: 44px;
|
|
1918
|
-
padding: ${
|
|
1312
|
+
padding: ${s(3)};
|
|
1919
1313
|
font-family: inherit;
|
|
1920
|
-
font-size: ${
|
|
1921
|
-
color: ${
|
|
1922
|
-
background: ${
|
|
1923
|
-
border: ${
|
|
1924
|
-
border-radius: ${
|
|
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};
|
|
1925
1319
|
/* Room for the digits plus the padding and border, so the box is never narrower than a finger. */
|
|
1926
|
-
inline-size: calc(3ch + ${
|
|
1320
|
+
inline-size: calc(3ch + ${s(6)} + 2px);
|
|
1927
1321
|
}
|
|
1928
1322
|
.year input {
|
|
1929
|
-
inline-size: calc(5ch + ${
|
|
1323
|
+
inline-size: calc(5ch + ${s(6)} + 2px);
|
|
1930
1324
|
}
|
|
1931
1325
|
:host([invalid]) input {
|
|
1932
|
-
border-color: ${
|
|
1933
|
-
border-width: ${
|
|
1326
|
+
border-color: ${t.danger};
|
|
1327
|
+
border-width: ${t.borderThick};
|
|
1934
1328
|
}
|
|
1935
|
-
`]}renderLabel(){return
|
|
1936
|
-
${this.label}${this.required?
|
|
1937
|
-
</legend>`}datePart(
|
|
1938
|
-
<div class="part ${
|
|
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}">
|
|
1939
1333
|
<label for=${d}>${i}</label>
|
|
1940
1334
|
<input
|
|
1941
1335
|
id=${d}
|
|
1942
1336
|
type="text"
|
|
1943
1337
|
inputmode="numeric"
|
|
1944
|
-
maxlength=${
|
|
1945
|
-
.value=${this[
|
|
1338
|
+
maxlength=${r}
|
|
1339
|
+
.value=${this[e]}
|
|
1946
1340
|
autocomplete=${this.autocompleteSection?`${this.autocompleteSection}-${n}`:l}
|
|
1947
1341
|
?disabled=${this.disabled}
|
|
1948
|
-
@input=${
|
|
1342
|
+
@input=${h=>{this[e]=h.target.value,this.emit()}}
|
|
1949
1343
|
/>
|
|
1950
1344
|
</div>
|
|
1951
|
-
`}emit(){let i=this.day&&this.month&&this.year.length===4?`${this.year}-${this.month.padStart(2,"0")}-${this.day.padStart(2,"0")}`:"";this.setFormValue(i)}renderControl(){return
|
|
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`
|
|
1952
1346
|
<div class="parts" part="parts">
|
|
1953
|
-
${this.datePart("day",
|
|
1954
|
-
${this.datePart("month",
|
|
1955
|
-
${this.datePart("year",
|
|
1347
|
+
${this.datePart("day",x("Day"),2,"day")}
|
|
1348
|
+
${this.datePart("month",x("Month"),2,"month")}
|
|
1349
|
+
${this.datePart("year",x("Year"),4,"year")}
|
|
1956
1350
|
</div>
|
|
1957
|
-
`}render(){return
|
|
1351
|
+
`}render(){return o`
|
|
1958
1352
|
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1959
1353
|
${this.renderLabel()}
|
|
1960
|
-
${this.description?
|
|
1354
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1961
1355
|
${this.renderControl()}
|
|
1962
1356
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1963
1357
|
</fieldset>
|
|
1964
|
-
`}updated(
|
|
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`
|
|
1965
1359
|
dialog {
|
|
1966
1360
|
padding: 0;
|
|
1967
1361
|
border: 0;
|
|
1968
|
-
border-radius: ${
|
|
1969
|
-
background: ${
|
|
1970
|
-
color: ${
|
|
1971
|
-
box-shadow: ${
|
|
1362
|
+
border-radius: ${t.radius2xl};
|
|
1363
|
+
background: ${t.surfaceCard};
|
|
1364
|
+
color: ${t.text};
|
|
1365
|
+
box-shadow: ${t.shadowXl}, 0 0 0 1px ${t.hairline};
|
|
1972
1366
|
max-inline-size: min(32rem, calc(100vw - 2rem));
|
|
1973
1367
|
/* 1.4.10 Reflow: a dialog taller than the viewport must scroll inside
|
|
1974
1368
|
itself rather than clipping, at 320px and at 400% zoom alike. */
|
|
@@ -1976,25 +1370,25 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
1976
1370
|
overflow: auto;
|
|
1977
1371
|
}
|
|
1978
1372
|
dialog::backdrop {
|
|
1979
|
-
background: color-mix(in srgb, ${
|
|
1373
|
+
background: color-mix(in srgb, ${t.text} 30%, transparent);
|
|
1980
1374
|
backdrop-filter: blur(2px);
|
|
1981
1375
|
}
|
|
1982
1376
|
.head {
|
|
1983
1377
|
display: flex;
|
|
1984
1378
|
align-items: flex-start;
|
|
1985
1379
|
justify-content: space-between;
|
|
1986
|
-
gap: ${
|
|
1987
|
-
padding: ${
|
|
1380
|
+
gap: ${s(3)};
|
|
1381
|
+
padding: ${s(5)} ${s(5)} 0;
|
|
1988
1382
|
}
|
|
1989
1383
|
.heading {
|
|
1990
1384
|
margin: 0;
|
|
1991
|
-
font-family: ${
|
|
1992
|
-
font-size: ${
|
|
1993
|
-
font-weight: ${
|
|
1994
|
-
color: ${
|
|
1385
|
+
font-family: ${t.fontHeading};
|
|
1386
|
+
font-size: ${g("xl")};
|
|
1387
|
+
font-weight: ${m("bold")};
|
|
1388
|
+
color: ${t.textHeading};
|
|
1995
1389
|
}
|
|
1996
1390
|
.body {
|
|
1997
|
-
padding: ${
|
|
1391
|
+
padding: ${s(4)} ${s(5)} ${s(5)};
|
|
1998
1392
|
}
|
|
1999
1393
|
@media (max-width: 40rem) {
|
|
2000
1394
|
:host([phone-full-screen]) dialog {
|
|
@@ -2007,186 +1401,52 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
2007
1401
|
}
|
|
2008
1402
|
}
|
|
2009
1403
|
.close {
|
|
2010
|
-
${
|
|
1404
|
+
${T}
|
|
2011
1405
|
display: inline-flex;
|
|
2012
1406
|
align-items: center;
|
|
2013
1407
|
justify-content: center;
|
|
2014
1408
|
flex: none;
|
|
2015
1409
|
background: none;
|
|
2016
1410
|
border: 0;
|
|
2017
|
-
border-radius: ${
|
|
1411
|
+
border-radius: ${t.radius};
|
|
2018
1412
|
font: inherit;
|
|
2019
|
-
font-size: ${
|
|
2020
|
-
color: ${
|
|
1413
|
+
font-size: ${g("lg")};
|
|
1414
|
+
color: ${t.text};
|
|
2021
1415
|
cursor: pointer;
|
|
2022
1416
|
}
|
|
2023
|
-
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(
|
|
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`
|
|
2024
1418
|
<dialog
|
|
2025
1419
|
part="dialog"
|
|
2026
1420
|
aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
2027
|
-
@cancel=${
|
|
1421
|
+
@cancel=${e=>{this.dismissible?this.close():e.preventDefault()}}
|
|
2028
1422
|
@close=${()=>{this.open&&this.close()}}
|
|
2029
1423
|
>
|
|
2030
1424
|
<div class="head">
|
|
2031
|
-
${this.heading?
|
|
2032
|
-
${this.dismissible?
|
|
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}>
|
|
2033
1427
|
<span aria-hidden="true">×</span>
|
|
2034
1428
|
<span class="sr-only" style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">${this.closeLabel}</span>
|
|
2035
1429
|
</button>`:l}
|
|
2036
1430
|
</div>
|
|
2037
1431
|
<div class="body" part="body"><slot></slot></div>
|
|
2038
1432
|
</dialog>
|
|
2039
|
-
`}};customElements.define("
|
|
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`
|
|
2040
1434
|
:host { display: block; }
|
|
2041
|
-
ul, ol { list-style: none; margin: 0; padding: 0; display: grid; gap: ${
|
|
2042
|
-
li { position: relative; padding-inline-start: ${
|
|
2043
|
-
:host([size='sm']) li { ${
|
|
2044
|
-
:host([size='lg']) li { ${
|
|
2045
|
-
li::before { content: ''; position: absolute; inset-inline-start: 4px; inset-block-start: 0.6em; inline-size: 7px; block-size: 7px; border-radius: 2px; background: ${
|
|
2046
|
-
:host([look='check']) li::before { content: '✓'; inset-inline-start: 0; inset-block-start: 0; inline-size: auto; block-size: auto; background: none; color: ${
|
|
2047
|
-
:host([look='number']) li::before { content: counter(point, decimal-leading-zero); inset-inline-start: 0; inset-block-start: 0.2em; inline-size: auto; block-size: auto; background: none; font-family: ${
|
|
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}; }
|
|
2048
1442
|
@media (forced-colors: active) { li::before { background: CanvasText; } :host([look='check']) li::before, :host([look='number']) li::before { background: none; color: CanvasText; } }
|
|
2049
|
-
`]}render(){let
|
|
2050
|
-
:host { display: block; container-type: inline-size; }
|
|
2051
|
-
[hidden] { display: none !important; }
|
|
2052
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${r(10)}; align-items: start; }
|
|
2053
|
-
.mono { font-family: ${e.fontMono}; font-size: ${$("xs")}; letter-spacing: 0.04em; text-transform: uppercase; color: ${e.textMuted}; margin: 0; }
|
|
2054
|
-
.sr-only { ${E} }
|
|
2055
|
-
|
|
2056
|
-
.progress { display: grid; gap: ${r(2)}; margin-block-end: ${r(6)}; }
|
|
2057
|
-
.bar { block-size: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }
|
|
2058
|
-
.bar i { display: block; block-size: 100%; background: ${e.brand}; transition: inline-size 300ms ease; }
|
|
2059
|
-
|
|
2060
|
-
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
|
|
2061
|
-
legend { padding: 0; margin-block-end: ${r(2)}; }
|
|
2062
|
-
.q { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; ${m("3xl")} letter-spacing: ${e.trackingTight}; color: ${e.textHeading}; outline: none; }
|
|
2063
|
-
.hint { margin: 0 0 ${r(6)}; color: ${e.textMuted}; }
|
|
2064
|
-
|
|
2065
|
-
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(3)}; }
|
|
2066
|
-
.choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2067
|
-
.choice { position: relative; display: grid; gap: ${r(1)}; align-content: start; padding: ${r(4)}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; background: ${e.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
|
|
2068
|
-
.choice:hover { border-color: ${e.borderStrong}; }
|
|
2069
|
-
.choice input { ${E} }
|
|
2070
|
-
.choice:has(input:checked) { border-color: ${e.brand}; box-shadow: inset 0 0 0 1px ${e.brand}; background: ${e.brandSubtle}; }
|
|
2071
|
-
.choice:has(input:focus-visible) { box-shadow: ${e.focusShadow}; }
|
|
2072
|
-
.many .choice { padding: ${r(3)}; }
|
|
2073
|
-
.label { font-weight: ${u("semibold")}; }
|
|
2074
|
-
.small { ${m("sm")} color: ${e.textMuted}; }
|
|
2075
|
-
/* A tick for a picked feature, drawn in the corner. */
|
|
2076
|
-
.many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${r(2)}; inset-inline-end: ${r(3)}; color: ${e.brand}; font-weight: ${u("bold")}; }
|
|
2077
|
-
|
|
2078
|
-
.scale { display: grid; gap: ${r(3)}; }
|
|
2079
|
-
.scale input { inline-size: 100%; accent-color: ${e.brand}; ${A} }
|
|
2080
|
-
.ticks { display: flex; justify-content: space-between; ${m("sm")} color: ${e.textMuted}; }
|
|
2081
|
-
.ticks span[aria-current] { color: ${e.text}; font-weight: ${u("semibold")}; }
|
|
2082
|
-
.now { margin: 0; }
|
|
2083
|
-
|
|
2084
|
-
.nav { display: flex; gap: ${r(3)}; margin-block-start: ${r(8)}; }
|
|
2085
|
-
button, .send { ${A} display: inline-flex; align-items: center; justify-content: center; gap: ${r(2)}; padding: ${r(2.5)} ${r(5)}; border-radius: ${e.radiusLg}; font: inherit; font-weight: ${u("semibold")}; cursor: pointer; text-decoration: none; border: ${e.borderThin} solid transparent; }
|
|
2086
|
-
.primary, .send { background: ${e.brand}; color: ${e.onBrand}; }
|
|
2087
|
-
.primary:hover, .send:hover { background: ${e.brandHover}; }
|
|
2088
|
-
.secondary { background: transparent; color: ${e.text}; border-color: ${e.borderStrong}; }
|
|
2089
|
-
.secondary:hover { background: ${e.surfaceSubtle}; }
|
|
2090
|
-
|
|
2091
|
-
.panel { position: sticky; inset-block-start: ${r(6)}; overflow: hidden; isolation: isolate; padding: ${r(8)}; border-radius: ${e.radiusXl}; background: ${e.surfaceCard}; box-shadow: ${e.shadowMd}; display: grid; gap: ${r(2)}; }
|
|
2092
|
-
/* The glow behind the budget grows as the product does. */
|
|
2093
|
-
.glow { position: absolute; z-index: -1; inset-block-start: -40%; inset-inline-end: -30%; inline-size: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, ${H(P(1,0))} 45%, transparent), color-mix(in srgb, ${H(P(2,1))} 25%, transparent) 45%, transparent 70%); transform: scale(var(--s, 0.7)); transform-origin: 70% 30%; transition: transform 500ms cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
|
|
2094
|
-
.range { margin: 0; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; font-size: ${$("5xl")}; line-height: 1; letter-spacing: ${e.trackingTight}; color: ${e.textHeading}; }
|
|
2095
|
-
.weeks { margin: 0; ${m("lg")} }
|
|
2096
|
-
.tip { margin: ${r(4)} 0 0; padding-block-start: ${r(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${e.textMuted}; }
|
|
2097
|
-
|
|
2098
|
-
.result { display: grid; gap: ${r(6)}; }
|
|
2099
|
-
.summary { margin: 0; ${m("xl")} text-wrap: pretty; }
|
|
2100
|
-
.phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }
|
|
2101
|
-
.phases i { display: block; }
|
|
2102
|
-
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${r(2)} ${r(5)}; }
|
|
2103
|
-
.legend li { display: inline-flex; align-items: center; gap: ${r(2)}; }
|
|
2104
|
-
.legend li::before { content: ''; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c); }
|
|
2105
|
-
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(4)}; }
|
|
2106
|
-
dt { margin: 0 0 ${r(1)}; }
|
|
2107
|
-
dd { margin: 0; font-weight: ${u("semibold")}; }
|
|
2108
|
-
.actions { display: flex; flex-wrap: wrap; gap: ${r(3)}; }
|
|
2109
|
-
.note { margin: 0; ${m("sm")} color: ${e.textMuted}; }
|
|
2110
|
-
.status { margin: 0; ${m("sm")} }
|
|
2111
|
-
|
|
2112
|
-
@container (max-width: 48rem) {
|
|
2113
|
-
.wrap { grid-template-columns: minmax(0, 1fr); gap: ${r(8)}; }
|
|
2114
|
-
.panel { position: static; }
|
|
2115
|
-
.choices.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2116
|
-
}
|
|
2117
|
-
@container (max-width: 30rem) {
|
|
2118
|
-
.choices { grid-template-columns: minmax(0, 1fr); }
|
|
2119
|
-
.range { font-size: ${$("4xl")}; }
|
|
2120
|
-
}
|
|
2121
|
-
@media (forced-colors: active) {
|
|
2122
|
-
.choice:has(input:checked) { outline: 3px solid Highlight; }
|
|
2123
|
-
.bar i, .phases i, .legend li::before { background: CanvasText !important; }
|
|
2124
|
-
.glow { display: none; }
|
|
2125
|
-
}
|
|
2126
|
-
`]}reset(){this.answers=Object.fromEntries((this.questions??[]).map(i=>{let s=(i.start??[]).filter(n=>i.choices.some(d=>d.id===n));return i.kind==="many"?[i.id,s]:[i.id,[s[0]??i.choices[0]?.id].filter(n=>!!n)]})),this.at=0,this.tip="",this.copied=""}willUpdate(i){(i.has("questions")||!this.started)&&(this.reset(),this.started=!0)}get rules(){return{low:this.low,high:this.high,minWeeks:this.minWeeks,teams:this.teams??[],ways:this.ways??[]}}money(i){try{return new Intl.NumberFormat(B(this),{style:"currency",currency:this.currency||"GBP",notation:"compact",maximumFractionDigits:0}).format(i*(this.unit||1))}catch{return String(i*(this.unit||1))}}listOf(i){try{return new Intl.ListFormat(B(this),{type:"conjunction"}).format(i)}catch{return i.join(", ")}}weeksWord(i){return i===1?g("{n} week",{n:i}):g("{n} weeks",{n:i})}get most(){let i=this.questions??[],s=Object.fromEntries(i.map(n=>{if(n.kind==="many")return[n.id,n.choices.map(p=>p.id)];let d=[...n.choices].sort((p,b)=>(b.cost??0)*(b.costFactor??1)-(p.cost??0)*(p.costFactor??1))[0];return[n.id,d?[d.id]:[]]}));return yt(i,s,this.rules).high||1}summaryOf(i){let s=this.questions??[],n=s.find(v=>v.kind==="one"),d=n?n.choices.find(v=>v.id===this.answers[n.id]?.[0]):void 0,p=s.filter(v=>v.kind==="many"&&v.inSummary!==!1).flatMap(v=>(this.answers[v.id]??[]).map(M=>{let I=v.choices.find(N=>N.id===M);return I?I.phrase||I.label:M})),b=d?d.phrase||d.label:"",y=b?p.length?g("You are building {thing} with {list}.",{thing:b,list:this.listOf(p)}):g("You are building {thing}.",{thing:b}):"",x=g("Expect {range} and about {weeks} to a first release.",{range:this.rangeOf(i),weeks:this.weeksWord(i.weeks)});return y?`${y} ${x}`:x}rangeOf(i){return g("{low} to {high}",{low:this.money(i.low),high:this.money(i.high)})}teamOf(i){return i===1?this.teamTextOne:this.teamText.replace("{n}",String(i))}pick(i,s,n){let d=this.answers[i.id]??[];this.answers={...this.answers,[i.id]:i.kind==="many"?n?[...d.filter(p=>p!==s.id),s.id]:d.filter(p=>p!==s.id):[s.id]},n&&s.tip&&(this.tip=s.tip),this.requestUpdate()}go(i){let s=(this.questions??[]).length;this.at=Math.max(0,Math.min(s,i)),this.copied="",this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(".current .q")?.focus({preventScroll:!0}))}result(){let i=yt(this.questions??[],this.answers,this.rules);return{low:i.low*(this.unit||1),high:i.high*(this.unit||1),weeks:i.weeks,engineers:i.engineers,way:i.way,summary:this.textOf(i),answers:this.answers}}textOf(i){let s=[this.summaryOf(i),`${this.teamOf(i.engineers)}.`];i.way&&s.push(`${i.way}.`);let n=(this.questions??[]).filter(p=>p.short&&p.kind!=="many").map(p=>{let b=p.choices.find(y=>y.id===this.answers[p.id]?.[0]);return b?`${p.short}: ${b.label}.`:""}).filter(Boolean),d=(this.questions??[]).filter(p=>p.short&&p.kind==="many"&&p.inSummary===!1).map(p=>{let b=(this.answers[p.id]??[]).map(y=>p.choices.find(x=>x.id===y)?.label??y);return b.length?`${p.short}: ${this.listOf(b)}.`:""}).filter(Boolean);return[...s,...d,...n].join(" ")}send(i){let s=this.result();try{sessionStorage.setItem("strata.estimate",s.summary)}catch{}this.dispatchEvent(new CustomEvent("impkt-estimate",{detail:s,bubbles:!0,composed:!0,cancelable:!0}))||i.preventDefault()}async copy(){let i=this.result().summary;try{await navigator.clipboard.writeText(i),this.copied=g("Summary copied.")}catch{this.copied=g("Copying is blocked here. Select the summary above instead.")}this.requestUpdate()}heading(i){let s=Math.min(Math.max(this.headingLevel||2,2),6);return a`<div class="q" role="heading" aria-level=${s} tabindex="-1">${i}</div>`}renderQuestion(i,s){let n=this.answers[i.id]??[],d=s===this.at;if(i.kind==="scale"){let b=Math.max(0,i.choices.findIndex(x=>x.id===n[0])),y=i.choices[b];return a`<fieldset class=${d?"current":""} ?hidden=${!d}>
|
|
2127
|
-
<legend>${this.heading(i.heading)}</legend>
|
|
2128
|
-
${i.hint?a`<p class="hint">${i.hint}</p>`:l}
|
|
2129
|
-
<div class="scale">
|
|
2130
|
-
<input type="range" min="0" max=${Math.max(0,i.choices.length-1)} step="1" .value=${String(b)} aria-label=${i.heading} aria-valuetext=${y?.label??""}
|
|
2131
|
-
@input=${x=>{let v=i.choices[Number(x.target.value)];v&&this.pick(i,v,!0)}}>
|
|
2132
|
-
<div class="ticks" aria-hidden="true">${i.choices.map((x,v)=>a`<span aria-current=${v===b?"true":l}>${x.label}</span>`)}</div>
|
|
2133
|
-
${y?.hint?a`<p class="now">${y.hint}</p>`:l}
|
|
2134
|
-
</div>
|
|
2135
|
-
</fieldset>`}let p=i.kind==="many";return a`<fieldset class=${d?"current":""} ?hidden=${!d}>
|
|
2136
|
-
<legend>${this.heading(i.heading)}</legend>
|
|
2137
|
-
${i.hint?a`<p class="hint">${i.hint}</p>`:l}
|
|
2138
|
-
<div class="choices ${p?"many":""}">
|
|
2139
|
-
${i.choices.map(b=>a`<label class="choice">
|
|
2140
|
-
<input type=${p?"checkbox":"radio"} name=${`${this.uid}-${i.id}`} value=${b.id} .checked=${n.includes(b.id)}
|
|
2141
|
-
@change=${y=>this.pick(i,b,y.target.checked)}>
|
|
2142
|
-
<span class="label">${b.label}</span>
|
|
2143
|
-
${b.hint?a`<span class="small">${b.hint}</span>`:l}
|
|
2144
|
-
</label>`)}
|
|
2145
|
-
</div>
|
|
2146
|
-
</fieldset>`}renderResult(i){let s=ir(this.phases??[],i.weeks),n=this.at===(this.questions??[]).length;return a`<div class="result ${n?"current":""}" ?hidden=${!n}>
|
|
2147
|
-
${this.heading(this.resultHeading)}
|
|
2148
|
-
<p class="summary">${this.summaryOf(i)}</p>
|
|
2149
|
-
${(this.phases??[]).length?a`
|
|
2150
|
-
<div class="phases" aria-hidden="true">${(this.phases??[]).map((d,p)=>a`<i style=${`flex-grow:${s[p]};background:${P(void 0,p)}`}></i>`)}</div>
|
|
2151
|
-
<ul class="legend">${(this.phases??[]).map((d,p)=>a`<li style=${`--c:${P(void 0,p)}`}>${d.label} <b>${this.weeksWord(s[p])}</b></li>`)}</ul>`:l}
|
|
2152
|
-
<dl>
|
|
2153
|
-
<div><dt class="mono">${g("Your team")}</dt><dd>${this.teamOf(i.engineers)}</dd></div>
|
|
2154
|
-
${i.way?a`<div><dt class="mono">${g("Way of working")}</dt><dd>${i.way}</dd></div>`:l}
|
|
2155
|
-
</dl>
|
|
2156
|
-
<div class="actions">
|
|
2157
|
-
${this.contactHref?a`<a class="send" href=${this.contactHref} @click=${d=>this.send(d)}>${this.sendLabel} <span aria-hidden="true">→</span></a>`:l}
|
|
2158
|
-
<button type="button" class="secondary" @click=${()=>this.copy()}>${g("Copy summary")}</button>
|
|
2159
|
-
<button type="button" class="secondary" @click=${()=>{this.reset(),this.go(0)}}>${g("Start again")}</button>
|
|
2160
|
-
</div>
|
|
2161
|
-
<p class="status" role="status">${this.copied}</p>
|
|
2162
|
-
${this.note?a`<p class="note">${this.note}</p>`:l}
|
|
2163
|
-
</div>`}render(){let i=this.questions??[],s=i.length,n=yt(i,this.answers,this.rules),d=this.at>=s,p=(.6+Math.min(1,n.high/this.most)*1.1).toFixed(2);return a`<div class="wrap">
|
|
2164
|
-
<div>
|
|
2165
|
-
<div class="progress">
|
|
2166
|
-
<p class="mono">${d?this.resultHeading:g("Step {step} of {steps}",{step:this.at+1,steps:s})}</p>
|
|
2167
|
-
<div class="bar" aria-hidden="true"><i style=${`inline-size:${s?d?100:(this.at+1)/(s+1)*100:0}%`}></i></div>
|
|
2168
|
-
</div>
|
|
2169
|
-
${i.map((b,y)=>this.renderQuestion(b,y))}
|
|
2170
|
-
${this.renderResult(n)}
|
|
2171
|
-
${d?l:a`<div class="nav">
|
|
2172
|
-
${this.at>0?a`<button type="button" class="secondary" @click=${()=>this.go(this.at-1)}>${g("Back")}</button>`:l}
|
|
2173
|
-
<button type="button" class="primary" @click=${()=>this.go(this.at+1)}>${this.at===s-1?g("See my estimate"):g("Next")} <span aria-hidden="true">→</span></button>
|
|
2174
|
-
</div>`}
|
|
2175
|
-
</div>
|
|
2176
|
-
<aside class="panel" part="panel" style=${`--s:${p}`}>
|
|
2177
|
-
<div class="glow" aria-hidden="true"></div>
|
|
2178
|
-
<p class="mono">${this.budgetLabel}</p>
|
|
2179
|
-
<p class="range" aria-live="polite" aria-atomic="true">${this.rangeOf(n)}</p>
|
|
2180
|
-
<p class="weeks">${g("About {weeks} to a first release",{weeks:this.weeksWord(n.weeks)})}</p>
|
|
2181
|
-
<p class="tip" aria-live="polite">${this.tip||this.intro}</p>
|
|
2182
|
-
</aside>
|
|
2183
|
-
</div>`}};customElements.define("impkt-estimator",xt);var _r={"2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr","1:2:1":"1fr 2fr 1fr","2:1:1":"2fr 1fr 1fr","1:1:2":"1fr 1fr 2fr"},vt=class extends c{static{this.properties={columns:{type:String,reflect:!0},widths:{type:String,reflect:!0},gap:{type:String,reflect:!0},stackOn:{type:String,reflect:!0,attribute:"stack-on"},align:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.columns="two",this.widths="equal",this.gap="md",this.stackOn="phone",this.align="stretch",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
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`
|
|
2184
1444
|
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
2185
|
-
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${
|
|
1445
|
+
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${u("layout.gutter.md","16px")}; align-items: stretch; }
|
|
2186
1446
|
:host([gap='none']) .columns { gap: 0; }
|
|
2187
|
-
:host([gap='sm']) .columns { gap: ${
|
|
2188
|
-
:host([gap='lg']) .columns { gap: ${
|
|
2189
|
-
:host([gap='xl']) .columns { gap: ${
|
|
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")}; }
|
|
2190
1450
|
:host([align='start']) .columns { align-items: start; }
|
|
2191
1451
|
:host([align='center']) .columns { align-items: center; }
|
|
2192
1452
|
:host([align='end']) .columns { align-items: end; }
|
|
@@ -2199,901 +1459,435 @@ var xe=globalThis,ve=xe.ShadowRoot&&(xe.ShadyCSS===void 0||xe.ShadyCSS.nativeSha
|
|
|
2199
1459
|
::slotted(*) { max-inline-size: 100%; }
|
|
2200
1460
|
@container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
2201
1461
|
@container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
2202
|
-
`]}render(){let
|
|
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`
|
|
2203
1463
|
:host { display: block; }
|
|
2204
|
-
a { display: inline-flex; align-items: center; min-height: ${
|
|
2205
|
-
color: ${
|
|
2206
|
-
a:hover { color: ${
|
|
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}; }
|
|
2207
1467
|
.contact { margin: 0; }
|
|
2208
|
-
.caption { display: block; font-weight: ${
|
|
1468
|
+
.caption { display: block; font-weight: ${m("semibold")}; }
|
|
2209
1469
|
/* An address is written one line at a time, and opening hours are often one
|
|
2210
1470
|
day to a line. Long unbroken values still wrap at 320px (1.4.10). */
|
|
2211
1471
|
.detail { white-space: pre-line; overflow-wrap: anywhere; }
|
|
2212
|
-
`]}render(){switch(this.kind){case"phone":case"email":case"address":case"hours":return this.renderContact();default:return this.renderLink()}}renderLink(){return
|
|
2213
|
-
><span class="detail" part="detail" id=${d}>${
|
|
2214
|
-
:host { --
|
|
2215
|
-
:host([width='narrow']) { --
|
|
2216
|
-
:host([width='wide']) { --
|
|
2217
|
-
`,
|
|
2218
|
-
:host { --
|
|
2219
|
-
@container
|
|
2220
|
-
@container
|
|
2221
|
-
`,
|
|
2222
|
-
:host { display: block; container:
|
|
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; }
|
|
2223
1483
|
.frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
|
|
2224
|
-
.inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--
|
|
2225
|
-
header { background: ${
|
|
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)}; }
|
|
2226
1486
|
/* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */
|
|
2227
|
-
header { --
|
|
2228
|
-
footer { --
|
|
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")}; }
|
|
2229
1489
|
:host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }
|
|
2230
|
-
main { flex: 1; padding-block: ${
|
|
1490
|
+
main { flex: 1; padding-block: ${s(6)} ${s(10)}; }
|
|
2231
1491
|
main:focus { outline: none; }
|
|
2232
1492
|
/* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */
|
|
2233
|
-
:host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--
|
|
2234
|
-
:host([floating]) header .inner { inline-size: calc(100% - 2 * var(--
|
|
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}; }
|
|
2235
1495
|
:host([floating]) main { padding-block-start: 0; }
|
|
2236
|
-
footer { background: ${
|
|
2237
|
-
.skip { position: absolute; inset-inline-start: ${
|
|
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%); }
|
|
2238
1498
|
.skip:not(:focus) { clip-path: inset(50%); }
|
|
2239
1499
|
.skip:focus { transform: none; }
|
|
2240
1500
|
.empty { display: none; }
|
|
2241
|
-
`]}hasSlot(i){return Array.from(this.children).some(
|
|
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">
|
|
2242
1502
|
<a class="skip" href="#content" part="skip" @click=${this.skip}>${this.skipText}</a>
|
|
2243
|
-
${i?
|
|
1503
|
+
${i?o`<header part="header"><div class="inner"><slot name="header"></slot></div></header>`:l}
|
|
2244
1504
|
<main id="content" tabindex="-1" part="main"><div class="inner"><slot></slot></div></main>
|
|
2245
|
-
${
|
|
2246
|
-
</div>`}opensOn(i){for(let
|
|
2247
|
-
:host { display: block; --
|
|
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; }
|
|
2248
1508
|
/* What a solid card on a brand band goes back to, since the band repaints these for its own text. */
|
|
2249
|
-
:host([tone='brand']) { --
|
|
2250
|
-
.band { box-sizing: border-box; border-radius: ${
|
|
2251
|
-
/* --
|
|
2252
|
-
:host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--
|
|
2253
|
-
:host([tone='subtle']) .band { background: ${
|
|
2254
|
-
:host([tone='inset']) .band { background: ${
|
|
2255
|
-
:host([tone='card']) .band { background: ${
|
|
2256
|
-
:host([tone='brand']) .band { background: ${
|
|
2257
|
-
:host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${
|
|
2258
|
-
:host([padding='sm']) .band { padding-block: ${
|
|
2259
|
-
:host([padding='md']) .band { padding-block: ${
|
|
2260
|
-
:host([padding='lg']) .band { padding-block: ${
|
|
2261
|
-
:host([padding='xl']) .band { padding-block: ${
|
|
2262
|
-
:host([padding='2xl']) .band { padding-block: clamp(${
|
|
2263
|
-
.content { max-inline-size: var(--
|
|
2264
|
-
`]}render(){return
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
:
|
|
2274
|
-
|
|
2275
|
-
.
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
:host([
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
</div>`;let t=!!this.imageSrc&&this.align!=="center";return a`<div class="hero ${t?"pictured":""}" part="hero">
|
|
2306
|
-
<div class="words">
|
|
2307
|
-
${this.eyebrow?a`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:l}
|
|
2308
|
-
${Mi(this.level,this.heading,"h")}
|
|
2309
|
-
${this.lead?a`<p class="body">${this.lead}</p>`:l}
|
|
2310
|
-
<div class="actions"><slot name="actions"></slot></div>
|
|
2311
|
-
</div>
|
|
2312
|
-
${t?a`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />`:l}
|
|
2313
|
-
</div>`}},zt=class extends c{static{this.properties={items:{type:Array},columns:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},layout:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.columns="three",this.headingLevel=3,this.layout="stacked",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,sr,h`
|
|
2314
|
-
:host { display: block; container-type: inline-size; }
|
|
2315
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(8)} ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2316
|
-
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2317
|
-
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
2318
|
-
li { display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2319
|
-
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${r(4)}; align-items: start; }
|
|
2320
|
-
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${r(1)}; }
|
|
2321
|
-
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${e.radiusLg}; background: ${e.brandSubtle}; color: ${e.brand}; margin-block-end: ${r(2)}; }
|
|
2322
|
-
:host([layout='inline']) .icon { margin: 0; }
|
|
2323
|
-
.h { font-size: ${$("lg")}; }
|
|
2324
|
-
.body { color: ${e.text}; }
|
|
2325
|
-
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
2326
|
-
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2327
|
-
`]}render(){return a`<ul part="list">${(this.items??[]).map(t=>a`<li part="item">
|
|
2328
|
-
${t.icon?a`<span class="icon">${S(t.icon,"24px")}</span>`:l}
|
|
2329
|
-
<div class="words">${Mi(this.headingLevel,t.heading,"h")}${t.text?a`<p class="body">${t.text}</p>`:l}</div>
|
|
2330
|
-
</li>`)}</ul>`}},At=class extends c{static{this.properties={quote:{type:String},person:{type:String},about:{type:String},imageSrc:{type:String,attribute:"image-src"},size:{type:String,reflect:!0},align:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.quote="",this.person="",this.about="",this.imageSrc="",this.size="md",this.align="start",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2331
|
-
:host { display: block; }
|
|
2332
|
-
figure { margin: 0; display: flex; flex-direction: column; gap: ${r(4)}; max-inline-size: 48rem; }
|
|
2333
|
-
:host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
|
|
2334
|
-
blockquote { margin: 0; font-family: ${e.fontHeading}; font-size: ${$("lg")}; line-height: ${C("normal")}; color: inherit; }
|
|
2335
|
-
:host([size='lg']) blockquote { font-size: ${$("2xl")}; line-height: ${C("tight")}; }
|
|
2336
|
-
blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
|
|
2337
|
-
figcaption { display: flex; align-items: center; gap: ${r(3)}; }
|
|
2338
|
-
img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
|
|
2339
|
-
.name { font-weight: ${u("semibold")}; }
|
|
2340
|
-
.detail { color: ${e.textMuted}; font-size: ${$("sm")}; }
|
|
2341
|
-
`]}render(){return a`<figure part="figure">
|
|
2342
|
-
<blockquote part="quote">${this.quote}</blockquote>
|
|
2343
|
-
${this.person?a`<figcaption>${this.imageSrc?a`<img src=${this.imageSrc} alt="" />`:l}<span><span class="name">${this.person}</span>${this.about?a`<br /><span class="detail">${this.about}</span>`:l}</span></figcaption>`:l}
|
|
2344
|
-
</figure>`}},Mt=class extends c{static{this.properties={figure:{type:String},label:{type:String},note:{type:String},size:{type:String,reflect:!0},align:{type:String,reflect:!0}}}constructor(){super(),this.figure="",this.label="",this.note="",this.size="md",this.align="start"}static{this.styles=[...c.styles,h`
|
|
2345
|
-
:host { display: block; }
|
|
2346
|
-
.stat { display: flex; flex-direction: column; gap: ${r(1)}; }
|
|
2347
|
-
:host([align='center']) .stat { align-items: center; text-align: center; }
|
|
2348
|
-
.value { font-family: ${e.fontHeading}; font-size: ${$("3xl")}; font-weight: ${u("bold")}; line-height: 1; color: ${e.textHeading}; }
|
|
2349
|
-
:host([size='lg']) .value { font-size: ${$("5xl")}; }
|
|
2350
|
-
:host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
|
|
2351
|
-
.label { font-weight: ${u("semibold")}; }
|
|
2352
|
-
.detail { color: ${e.textMuted}; font-size: ${$("sm")}; }
|
|
2353
|
-
`]}render(){return a`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note?a` <span class="detail">${this.note}</span>`:l}</p>`}},Et=class extends c{static{this.properties={tone:{type:String,reflect:!0},icon:{type:String}}}constructor(){super(),this.tone="neutral",this.icon="none"}static{this.styles=[...c.styles,h`
|
|
2354
|
-
:host { display: inline-flex; }
|
|
2355
|
-
span { display: inline-flex; align-items: center; gap: ${r(1)}; padding: ${r(.5)} ${r(2)}; border-radius: ${e.radius}; ${m("sm")} font-weight: ${u("medium")}; background: ${e.surfaceInset}; color: ${e.text}; box-shadow: inset 0 0 0 1px ${e.hairline}; }
|
|
2356
|
-
:host([tone='brand']) span { background: ${e.brandSubtle}; color: ${e.brand}; }
|
|
2357
|
-
:host([tone='success']) span { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
2358
|
-
:host([tone='warning']) span { background: ${e.warningSubtle}; color: ${e.warningText}; }
|
|
2359
|
-
:host([tone='danger']) span { background: ${e.dangerSubtle}; color: ${e.dangerText}; }
|
|
2360
|
-
:host([tone='info']) span { background: ${e.infoSubtle}; color: ${e.infoText}; }
|
|
2361
|
-
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
2362
|
-
`]}render(){return a`<span part="badge">${S(this.icon,"1em")}<slot></slot></span>`}},Lt=class extends c{static{this.properties={message:{type:String},linkText:{type:String,attribute:"link-text"},href:{type:String}}}constructor(){super(),this.message="",this.linkText="",this.href=""}static{this.styles=[...c.styles,h`
|
|
2363
|
-
:host { display: block; }
|
|
2364
|
-
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${r(2)} ${r(3)}; padding: ${r(2.5)} ${r(5)}; ${m("sm")} text-align: center; color: ${e.onBrand}; background: ${e.brand}; }
|
|
2365
|
-
:host { margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); }
|
|
2366
|
-
a { display: inline-flex; align-items: center; gap: ${r(1)}; color: inherit; font-weight: ${u("semibold")}; }
|
|
2367
|
-
`]}render(){return a`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText&&this.href?a`<a href=${this.href}>${this.linkText}${S("arrow-right","14px")}</a>`:l}</div>`}},Ct=class extends c{static{this.properties={items:{type:Array},buttonText:{type:String,attribute:"button-text"},action:{type:String},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.buttonText="Search",this.action="",this.label="Search",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2368
|
-
:host { display: block; container-type: inline-size; }
|
|
2369
|
-
form { display: flex; align-items: center; padding: ${r(3)}; background: ${e.surfaceCard}; color: ${e.text}; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowXl}; }
|
|
2370
|
-
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${r(1)}; padding: ${r(1.5)} ${r(5)}; }
|
|
2371
|
-
label { ${m("sm")} color: ${e.textMuted}; }
|
|
2372
|
-
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.text}; background: transparent; border: 0; border-radius: ${e.radiusSm}; cursor: pointer; }
|
|
2373
|
-
select:focus-visible, button:focus-visible { outline: 2px solid ${e.brand}; outline-offset: 2px; }
|
|
2374
|
-
button { flex: none; min-block-size: 48px; padding: ${r(3)} ${r(6)}; font: inherit; font-weight: ${u("semibold")}; color: ${e.onBrand}; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
2375
|
-
button:hover { background: ${e.brandHover}; }
|
|
2376
|
-
@container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }
|
|
2377
|
-
@container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${r(2)}; } .field { flex: none; } }
|
|
2378
|
-
`]}submit(t){let i=new FormData(t.currentTarget),s={};i.forEach((n,d)=>{n!==""&&(s[d]=String(n))}),this.dispatchEvent(new CustomEvent("impkt-submit",{detail:{values:s},bubbles:!0,composed:!0})),this.action||t.preventDefault()}render(){return a`<form role="search" aria-label=${this.label} method="get" action=${this.action||l} @submit=${this.submit} part="form">
|
|
2379
|
-
${(this.items??[]).map((t,i)=>{let s=this.id_(`field-${i}`),n=String(t.options??"").split(",").map(d=>d.trim()).filter(Boolean);return a`<div class="field"><label for=${s}>${t.label}</label><select id=${s} name=${t.name||t.label.toLowerCase().replace(/[^a-z0-9]+/g,"-")}>
|
|
2380
|
-
<option value="">${t.placeholder||"Any"}</option>${n.map(d=>a`<option value=${d}>${d}</option>`)}
|
|
2381
|
-
</select></div>`})}
|
|
2382
|
-
<button type="submit">${this.buttonText}</button>
|
|
2383
|
-
</form>`}};customElements.define("impkt-search-bar",Ct);customElements.define("impkt-announcement",Lt);customElements.define("impkt-hero",Tt);customElements.define("impkt-feature-list",zt);customElements.define("impkt-quote",At);customElements.define("impkt-stat",Mt);customElements.define("impkt-badge",Et);var Rt=class extends c{static{this.properties={spacing:{type:String,reflect:!0},tone:{type:String,reflect:!0}}}constructor(){super(),this.spacing="md",this.tone="subtle"}static{this.styles=[...c.styles,h`
|
|
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`
|
|
2384
1565
|
:host { display: block; }
|
|
2385
|
-
hr { margin: ${
|
|
2386
|
-
:host([tone='strong']) hr { opacity: 1; border-block-start-width: ${
|
|
2387
|
-
:host([spacing='sm']) hr { margin-block: ${
|
|
2388
|
-
:host([spacing='lg']) hr { margin-block: ${
|
|
2389
|
-
:host([spacing='xl']) hr { margin-block: ${
|
|
2390
|
-
`]}render(){return
|
|
2391
|
-
:host { display: block; block-size: ${
|
|
2392
|
-
:host([size='sm']) { block-size: ${
|
|
2393
|
-
:host([size='lg']) { block-size: ${
|
|
2394
|
-
:host([size='xl']) { block-size: ${
|
|
2395
|
-
:host([size='2xl']) { block-size: ${
|
|
2396
|
-
`]}render(){return
|
|
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`
|
|
2397
1578
|
:host { display: block; container-type: inline-size; }
|
|
2398
|
-
[role='tablist'] { display: flex; gap: ${
|
|
2399
|
-
[role='tab'] { ${
|
|
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; }
|
|
2400
1581
|
/* Inside a box that scrolls the ring would be clipped, so it is drawn inside the tab. */
|
|
2401
|
-
[role='tab']:focus-visible { box-shadow: inset 0 0 0 2px ${
|
|
2402
|
-
[role='tab']:hover { color: ${
|
|
2403
|
-
[role='tab'][aria-selected='true'] { color: ${
|
|
2404
|
-
[role='tabpanel'] { padding-block: ${
|
|
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")}; }
|
|
2405
1586
|
.body { white-space: pre-line; }
|
|
2406
1587
|
@container (max-width: 40rem) {
|
|
2407
|
-
:host([two-rows]) [role='tablist'].many { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); overflow: visible; border-block-end: 0; gap: ${
|
|
2408
|
-
:host([two-rows]) .many [role='tab'] { white-space: normal; padding-inline: ${
|
|
2409
|
-
:host([two-rows]) .many [role='tab'][aria-selected='true'] { border-block-end-color: currentColor; background: ${
|
|
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}; }
|
|
2410
1591
|
}
|
|
2411
1592
|
@media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }
|
|
2412
|
-
`]}current(){let
|
|
2413
|
-
${
|
|
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>`)}
|
|
2414
1595
|
</div>
|
|
2415
|
-
${
|
|
2416
|
-
:host { display: block;
|
|
2417
|
-
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
2418
|
-
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
2419
|
-
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
2420
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2421
|
-
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2422
|
-
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
2423
|
-
li { position: relative; display: flex; flex-direction: column; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.hairline}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }
|
|
2424
|
-
li.linked:hover { box-shadow: ${e.shadowLg}; transform: translateY(-2px); }
|
|
2425
|
-
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
|
|
2426
|
-
.words { display: flex; flex-direction: column; gap: ${r(2)}; padding: ${r(5)}; flex: 1; }
|
|
2427
|
-
.h { margin: 0; color: ${e.textHeading}; font-family: ${e.fontHeading}; font-size: ${$("lg")}; font-weight: ${u("bold")}; line-height: ${C("tight")}; }
|
|
2428
|
-
.h a { color: inherit; text-decoration: none; border-radius: ${e.radiusSm}; }
|
|
2429
|
-
.h a::after { content: ''; position: absolute; inset: 0; }
|
|
2430
|
-
li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
2431
|
-
.body { margin: 0; line-height: ${C("normal")}; }
|
|
2432
|
-
.badge { align-self: flex-start; padding: ${r(.5)} ${r(2)}; border-radius: ${e.radius}; font-size: ${$("sm")}; font-weight: ${u("medium")}; background: ${e.brandSubtle}; color: ${e.brand}; box-shadow: inset 0 0 0 1px ${e.hairline}; }
|
|
2433
|
-
.more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${r(1)}; color: ${e.link}; font-weight: ${u("semibold")}; }
|
|
2434
|
-
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
2435
|
-
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2436
|
-
`]}render(){return a`<ul part="list">${(this.items??[]).map(t=>a`<li class=${t.href?"linked":""} part="card">
|
|
2437
|
-
${t.imageSrc?a`<img src=${t.imageSrc} alt=${t.imageAlt??""} loading="lazy" />`:l}
|
|
2438
|
-
<div class="words">
|
|
2439
|
-
${t.badge?a`<span class="badge">${t.badge}</span>`:l}
|
|
2440
|
-
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.href?a`<a href=${t.href}>${t.heading}</a>`:t.heading}</div>
|
|
2441
|
-
${t.text?a`<p class="body">${t.text}</p>`:l}
|
|
2442
|
-
${t.href?a`<span class="more" aria-hidden="true">${S("arrow-right","1em")}</span>`:l}
|
|
2443
|
-
</div>
|
|
2444
|
-
</li>`)}</ul>`}};customElements.define("impkt-divider",Rt);customElements.define("impkt-spacer",It);customElements.define("impkt-visually-hidden",Bt);customElements.define("impkt-tabs",_t);customElements.define("impkt-card-grid",Ht);var Nt=class extends c{static{this.properties={legend:{type:String},description:{type:String},error:{type:String,reflect:!0},size:{type:String,reflect:!0}}}constructor(){super(),this.legend="",this.description="",this.error="",this.size="md"}static{this.styles=[...c.styles,h`
|
|
2445
|
-
:host { display: block; margin-block-end: ${r(6)}; }
|
|
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)}; }
|
|
2446
1598
|
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
2447
|
-
legend { padding: 0; margin-block-end: ${
|
|
2448
|
-
:host([size='lg']) legend { font-size: ${
|
|
2449
|
-
:host([size='xl']) legend { font-size: ${
|
|
2450
|
-
.description { margin-block-end: ${
|
|
2451
|
-
.error { margin-block-end: ${
|
|
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")}; }
|
|
2452
1604
|
.error:empty { display: none; }
|
|
2453
|
-
:host([error]:not([error=''])) .fields { padding-inline-start: ${
|
|
2454
|
-
`]}render(){let
|
|
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}>
|
|
2455
1607
|
<legend part="legend">${this.legend}</legend>
|
|
2456
|
-
${this.description?
|
|
1608
|
+
${this.description?o`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
2457
1609
|
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
2458
1610
|
<div class="fields" part="fields"><slot></slot></div>
|
|
2459
|
-
</fieldset>`}};customElements.define("
|
|
2460
|
-
dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${
|
|
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); }
|
|
2461
1613
|
dialog[open] { display: flex; }
|
|
2462
1614
|
:host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
|
|
2463
|
-
dialog::backdrop { background: color-mix(in srgb, ${
|
|
1615
|
+
dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
|
|
2464
1616
|
@keyframes from-right { from { transform: translateX(100%); } }
|
|
2465
1617
|
@keyframes from-left { from { transform: translateX(-100%); } }
|
|
2466
|
-
.head { display: flex; align-items: center; justify-content: space-between; gap: ${
|
|
2467
|
-
h2 { margin: 0; font-family: ${
|
|
2468
|
-
.close { ${
|
|
2469
|
-
.close:hover { background: ${
|
|
2470
|
-
.body { flex: 1; overflow: auto; padding: ${
|
|
2471
|
-
.foot { display: flex; gap: ${
|
|
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); }
|
|
2472
1624
|
.foot[hidden] { display: none; }
|
|
2473
|
-
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(i){if(!i.has("open"))return;let
|
|
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}
|
|
2474
1626
|
@cancel=${()=>this.close()}
|
|
2475
1627
|
@close=${()=>{this.open&&this.close()}}
|
|
2476
1628
|
@click=${i=>{i.target===this.dialog&&this.close()}}>
|
|
2477
1629
|
<div class="head">
|
|
2478
|
-
${this.heading?
|
|
2479
|
-
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${
|
|
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>
|
|
2480
1632
|
</div>
|
|
2481
1633
|
<div class="body" part="body"><slot></slot></div>
|
|
2482
1634
|
<div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
|
|
2483
|
-
</dialog>`}},
|
|
2484
|
-
.region { position: fixed; inset-block-end: calc(${
|
|
2485
|
-
@media (max-width: 40rem) { .region { inset-inline: ${
|
|
2486
|
-
.toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
:host([tone='
|
|
2491
|
-
:host([tone='
|
|
2492
|
-
|
|
2493
|
-
.
|
|
2494
|
-
.close {
|
|
2495
|
-
.
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
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>
|
|
2500
1653
|
<p class="message">${this.message}</p>
|
|
2501
|
-
${this.actionText?
|
|
2502
|
-
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${
|
|
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>
|
|
2503
1656
|
</div>`:l}
|
|
2504
|
-
</div>`}},
|
|
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`
|
|
2505
1658
|
:host { position: relative; display: inline-block; }
|
|
2506
|
-
.trigger { ${
|
|
2507
|
-
.trigger:hover { background: ${
|
|
2508
|
-
.chev { display: inline-flex; color: ${
|
|
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; }
|
|
2509
1662
|
:host([open]) .chev { transform: rotate(180deg); }
|
|
2510
|
-
.list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${
|
|
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; }
|
|
2511
1664
|
:host([edge='end']) .list, .list.flip-end { inset-inline: auto 0; }
|
|
2512
1665
|
:host([edge='end']) .list.flip-start { inset-inline: 0 auto; }
|
|
2513
|
-
@keyframes pop { from { opacity: 0; transform: translateY(-${
|
|
2514
|
-
.item { ${
|
|
2515
|
-
.item:hover, .item:focus { background: ${
|
|
2516
|
-
.item.danger { color: ${
|
|
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}; }
|
|
2517
1670
|
.item svg { flex: none; }
|
|
2518
|
-
`]}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.outside)}get entries(){return Array.from(this.renderRoot.querySelectorAll(".item"))}get trigger(){return this.renderRoot.querySelector(".trigger")}toggle(i,
|
|
2519
|
-
@click=${()=>this.toggle(!this.open)} @keydown=${this.triggerKey}>${
|
|
2520
|
-
${this.open?
|
|
2521
|
-
${this.items.map(
|
|
2522
|
-
</ul>`:l}`}};function
|
|
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`
|
|
2523
1676
|
:host { display: block; container-type: inline-size; }
|
|
2524
|
-
nav { display: flex; align-items: center; justify-content: space-between; gap: ${
|
|
2525
|
-
ul { display: flex; align-items: center; gap: ${
|
|
2526
|
-
.n, .step { ${
|
|
2527
|
-
.n:hover, .step:hover { background: ${
|
|
2528
|
-
.n[aria-current] { color: ${
|
|
2529
|
-
.step[aria-disabled='true'] { color: ${
|
|
2530
|
-
.gap { color: ${
|
|
2531
|
-
.count { display: none; ${
|
|
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}; }
|
|
2532
1685
|
@container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
|
|
2533
|
-
`]}go(
|
|
2534
|
-
${this.step(
|
|
2535
|
-
<ul>${
|
|
2536
|
-
<span class="count">${
|
|
2537
|
-
${this.step(
|
|
2538
|
-
</nav>`}}
|
|
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`
|
|
2539
1692
|
:host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
|
|
2540
1693
|
:host([size='sm']) { --size: 32px; }
|
|
2541
1694
|
:host([size='lg']) { --size: 56px; }
|
|
2542
1695
|
:host([size='xl']) { --size: 80px; }
|
|
2543
|
-
.face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${
|
|
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")}; }
|
|
2544
1697
|
img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2545
|
-
`]}willUpdate(i){i.has("src")&&(this.failed=!1)}render(){return this.src&&!this.failed?
|
|
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`
|
|
2546
1699
|
ul { display: flex; margin: 0; padding: 0; list-style: none; }
|
|
2547
|
-
li { margin-inline-start: -${
|
|
1700
|
+
li { margin-inline-start: -${s(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }
|
|
2548
1701
|
li:first-child { margin-inline-start: 0; }
|
|
2549
|
-
.more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${
|
|
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%; }
|
|
2550
1703
|
:host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
|
|
2551
1704
|
:host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
|
|
2552
1705
|
.sr { ${E} }
|
|
2553
|
-
`]}render(){let
|
|
2554
|
-
${
|
|
2555
|
-
${i>0?
|
|
2556
|
-
</ul>`}},
|
|
2557
|
-
.wrap { display: flex; flex-direction: column; align-items: center; gap: ${
|
|
2558
|
-
:host([framed]) .wrap { border: ${
|
|
2559
|
-
.mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${
|
|
2560
|
-
.h { margin: 0; font-family: ${
|
|
2561
|
-
p { margin: 0; max-inline-size: 42ch; color: ${
|
|
2562
|
-
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${
|
|
2563
|
-
`]}render(){return
|
|
2564
|
-
<span class="mark">${
|
|
2565
|
-
${this.heading?
|
|
2566
|
-
${this.lead?
|
|
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}
|
|
2567
1720
|
<div class="actions"><slot name="actions"></slot></div>
|
|
2568
|
-
</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`
|
|
2569
1722
|
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
2570
1723
|
legend { padding: 0; }
|
|
2571
|
-
.row-label { ${
|
|
2572
|
-
.days { display: flex; gap: ${
|
|
2573
|
-
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${
|
|
2574
|
-
label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${
|
|
2575
|
-
label:hover { background: ${
|
|
2576
|
-
label:has(input:checked) { color: ${
|
|
2577
|
-
label:has(input:focus-visible) { box-shadow: ${
|
|
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}; }
|
|
2578
1731
|
input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
2579
|
-
.day { flex: none; inline-size: 4.5rem; padding-block: ${
|
|
2580
|
-
.weekday, .month { ${
|
|
2581
|
-
.num { ${
|
|
2582
|
-
.time { padding: ${
|
|
2583
|
-
.empty { margin: 0; color: ${
|
|
2584
|
-
:host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${
|
|
2585
|
-
`]}get currentDay(){let i=this.day||this.value.split("T")[0];return this.days.find(
|
|
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`
|
|
2586
1739
|
<div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
|
|
2587
1740
|
<div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
|
|
2588
|
-
${this.days.map(
|
|
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)} />
|
|
2589
1742
|
<span class="weekday">${n.weekday}</span><span class="num">${n.day}</span><span class="month">${n.month}</span></label>`})}
|
|
2590
1743
|
</div>
|
|
2591
1744
|
<div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
|
|
2592
1745
|
<div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
|
|
2593
|
-
${
|
|
2594
|
-
</div>`:
|
|
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}>
|
|
2595
1748
|
${this.renderLabel()}
|
|
2596
|
-
${this.description?
|
|
1749
|
+
${this.description?o`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
2597
1750
|
${this.renderControl()}
|
|
2598
1751
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
2599
|
-
</fieldset>`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("
|
|
2600
|
-
.round { ${A} display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.rule}; border-radius: 50%; box-shadow: ${e.shadowSm}; cursor: pointer; transition: box-shadow 120ms ease-in-out, background-color 120ms ease-in-out; }
|
|
2601
|
-
.round:hover:not(:disabled) { box-shadow: ${e.shadowMd}; }
|
|
2602
|
-
.round:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
|
2603
|
-
`,ei=h`
|
|
2604
|
-
.eyebrow { margin: 0; color: var(--impkt-eyebrow, var(--impkt-color-text-eyebrow, ${e.brand})); ${m("sm")} font-size: var(--impkt-font-size-eyebrow, var(--impkt-font-size-sm, 0.875rem)); font-family: ${e.fontEyebrow}; font-weight: var(--impkt-font-weight-eyebrow, ${u("semibold")}); letter-spacing: ${e.trackingWide}; text-transform: uppercase; }
|
|
2605
|
-
.h { margin: 0; color: ${e.textHeading}; font-family: ${e.fontHeading}; font-weight: ${u("bold")}; letter-spacing: ${e.trackingTight}; text-wrap: balance; }
|
|
2606
|
-
.lead { margin: 0; color: ${e.textMuted}; text-wrap: pretty; }
|
|
2607
|
-
`,Vt=class extends c{constructor(){super();this.index=0;this.count=0;this.visible=null;this.heading=null;this.paused=!1;this.held=!1;this.label="Slides",this.perView="1",this.arrows="below",this.autoplay=!1,this.seconds=6,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={label:{type:String},perView:{type:String,reflect:!0,attribute:"per-view"},arrows:{type:String,reflect:!0},autoplay:{type:Boolean,reflect:!0},seconds:{type:Number},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,k,w,or,h`
|
|
2608
|
-
:host { display: block; container-type: inline-size; --most: 1; --gap: ${r(6)}; }
|
|
2609
|
-
:host([per-view='2']) { --most: 2; }
|
|
2610
|
-
:host([per-view='3']) { --most: 3; }
|
|
2611
|
-
.track { --per: var(--most); display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: ${r(1)} ${r(2)}; border-radius: ${e.radiusLg}; }
|
|
2612
|
-
.track::-webkit-scrollbar { display: none; }
|
|
2613
|
-
::slotted(*) { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-inline-size: 0; scroll-snap-align: start; box-sizing: border-box; }
|
|
2614
|
-
/* Whole slides only: a slice of the next one reads as content spilling out of the page. */
|
|
2615
|
-
@container (max-width: 60rem) { .track { --per: min(var(--most), 2); } }
|
|
2616
|
-
@container (max-width: 40rem) { .track { --per: 1; --gap: ${r(4)}; } }
|
|
2617
|
-
.controls { display: flex; align-items: center; justify-content: space-between; gap: ${r(4)}; margin-block-start: ${r(4)}; }
|
|
2618
|
-
.dots { display: flex; flex-wrap: wrap; gap: ${r(1)}; }
|
|
2619
|
-
.dot { ${A} display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: ${e.radiusSm}; }
|
|
2620
|
-
.dot span { display: block; inline-size: 8px; block-size: 8px; border-radius: 999px; background: ${e.rule}; transition: inline-size 150ms ease-in-out, background-color 150ms ease-in-out; }
|
|
2621
|
-
.dot[aria-current='true'] span { inline-size: 24px; background: ${e.brand}; }
|
|
2622
|
-
.buttons { display: flex; gap: ${r(2)}; }
|
|
2623
|
-
section { position: relative; }
|
|
2624
|
-
@container (min-width: 40.01rem) { :host([arrows='top']) .buttons { position: absolute; inset-block-end: calc(100% + ${r(4)}); inset-inline-end: 0; } }
|
|
2625
|
-
.sr-only { ${E} }
|
|
2626
|
-
@media (forced-colors: active) { .dot span { background: CanvasText; } .dot[aria-current='true'] span { background: Highlight; } }
|
|
2627
|
-
`]}get track(){return this.renderRoot.querySelector(".track")}get slides(){return Array.from(this.children)}get last(){return Math.max(0,this.count-(this.visible??Number(this.perView||1)))}measure(){let i=this.track,s=this.slides[0];if(!i||!s)return;let n=s.getBoundingClientRect().width;if(n<=0)return;let d=Number.parseFloat(getComputedStyle(i).columnGap)||0,p=Math.max(1,Math.round((i.clientWidth+d)/(n+d)));if(p===this.visible)return;this.visible=p,this.index=Math.min(this.index,this.last);let b=this.slides[this.index];b&&typeof i.scrollTo=="function"&&i.scrollTo({left:b.offsetLeft-i.offsetLeft,behavior:"auto"}),this.requestUpdate()}onSlots(){let i=this.slides;this.count=i.length,i.forEach((s,n)=>{s.setAttribute("role","group"),s.setAttribute("aria-roledescription",g("slide")),s.setAttribute("aria-label",g("{slide} of {slides}",{slide:n+1,slides:i.length}))}),this.measure(),this.requestUpdate()}go(i){let s=Math.min(this.last,Math.max(0,i));this.index=s,this.heading=s,clearTimeout(this.settle),this.settle=setTimeout(()=>{let p=this.heading===null;this.heading=null;let b=this.track,y=this.slides[this.index];!p&&b&&y&&typeof b.scrollTo=="function"&&b.scrollTo({left:y.offsetLeft-b.offsetLeft,behavior:"auto"})},900),this.requestUpdate();let n=this.track,d=this.slides[s];n&&d&&typeof n.scrollTo=="function"&&n.scrollTo({left:d.offsetLeft-n.offsetLeft,behavior:ar()?"auto":"smooth"})}onScroll(){let i=this.track,s=this.slides;if(!i||!s.length)return;let n=0,d=1/0;if(s.forEach((p,b)=>{let y=Math.abs(p.offsetLeft-i.offsetLeft-i.scrollLeft);y<d&&(d=y,n=b)}),this.heading!==null){n===this.heading&&d<2&&(this.heading=null,clearTimeout(this.settle));return}n!==this.index&&(this.index=Math.min(n,this.last),this.requestUpdate())}onKey(i){i.key==="ArrowRight"&&(i.preventDefault(),this.go(this.index+1)),i.key==="ArrowLeft"&&(i.preventDefault(),this.go(this.index-1))}get canPlay(){return this.autoplay&&!ar()}restart(){clearInterval(this.timer),this.timer=void 0,!(!this.canPlay||this.paused||this.held)&&(this.timer=setInterval(()=>this.go(this.index>=this.last?0:this.index+1),Math.max(2,this.seconds)*1e3))}hold(i){this.held=i,this.restart()}togglePause(){this.paused=!this.paused,this.restart(),this.requestUpdate()}firstUpdated(){typeof ResizeObserver=="function"&&this.track&&(this.observer=new ResizeObserver(()=>this.measure()),this.observer.observe(this.track))}updated(i){(i.has("autoplay")||i.has("seconds"))&&this.restart(),i.has("perView")&&this.measure()}connectedCallback(){super.connectedCallback(),this.track&&this.observer?.observe(this.track),this.restart()}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect(),clearInterval(this.timer),clearTimeout(this.settle)}render(){let i=Array.from({length:this.last+1},(s,n)=>n);return a`<section aria-roledescription=${g("carousel")} aria-label=${this.label} part="carousel" @keydown=${this.onKey}
|
|
2628
|
-
@mouseenter=${()=>this.hold(!0)} @mouseleave=${()=>this.hold(!1)} @focusin=${()=>this.hold(!0)} @focusout=${()=>this.hold(!1)}>
|
|
2629
|
-
<div class="track" part="track" tabindex="0" @scroll=${this.onScroll}><slot @slotchange=${this.onSlots}></slot></div>
|
|
2630
|
-
<div class="controls" part="controls">
|
|
2631
|
-
<div class="dots">${i.length>1?i.map(s=>a`<button class="dot" type="button" aria-label=${g("Go to slide {slide}",{slide:s+1})} aria-current=${s===this.index?"true":"false"} @click=${()=>this.go(s)}><span></span></button>`):l}</div>
|
|
2632
|
-
<div class="buttons">
|
|
2633
|
-
${this.canPlay?a`<button class="round" type="button" aria-label=${g(this.paused?"Play the slides":"Pause the slides")} @click=${this.togglePause}>${this.paused?S("arrow-right","18px"):a`<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>`}</button>`:l}
|
|
2634
|
-
<button class="round" type="button" aria-label=${g("Previous slide")} ?disabled=${this.index===0} @click=${()=>this.go(this.index-1)}>${S("arrow-left","18px")}</button>
|
|
2635
|
-
<button class="round" type="button" aria-label=${g("Next slide")} ?disabled=${this.index>=this.last} @click=${()=>this.go(this.index+1)}>${S("arrow-right","18px")}</button>
|
|
2636
|
-
</div>
|
|
2637
|
-
</div>
|
|
2638
|
-
<p class="sr-only" aria-live="polite">${g("Slide {slide} of {slides}",{slide:this.index+1,slides:this.count})}</p>
|
|
2639
|
-
</section>`}};function Wr(o,t,i){let s=o===t-1,n={wide:1,narrow:1,rows:1};if(i==="grid")return s&&(n.wide=t%3?4-t%3:1,n.narrow=t%2?2:1),n;if(o===0)return n;if(t===2)return{wide:2,narrow:2,rows:2};if(t===3)return{...n,wide:2};if(s){let d=(t-5)%4;n.wide=t===4?2:t>5&&d?5-d:1,n.narrow=t%2?1:2}return n}var Kt=class extends c{constructor(){super();this.shown=-1;this.opener=null;this.items=[],this.layout="feature",this.label="Gallery",this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={items:{type:Array},layout:{type:String,reflect:!0},label:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,k,w,or,h`
|
|
2640
|
-
:host { display: block; container-type: inline-size; }
|
|
2641
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(3)}; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; }
|
|
2642
|
-
:host([layout='grid']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 220px; }
|
|
2643
|
-
li { grid-column: span var(--span-wide, 1); grid-row: span var(--span-rows, 1); }
|
|
2644
|
-
:host([layout='feature']) li:first-child { grid-column: span 2; grid-row: span 2; }
|
|
2645
|
-
.open { position: relative; display: block; inline-size: 100%; block-size: 100%; padding: 0; border: 0; background: ${e.surfaceInset}; border-radius: ${e.radiusXl}; overflow: hidden; cursor: zoom-in; }
|
|
2646
|
-
.open img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 300ms ease-out; }
|
|
2647
|
-
.open:hover img { transform: scale(1.03); }
|
|
2648
|
-
@container (max-width: 40rem) { ul, :host([layout='grid']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 130px; } li { grid-column: span var(--span-narrow, 1); } }
|
|
2649
|
-
dialog { padding: 0; border: 0; background: transparent; max-inline-size: none; max-block-size: none; inline-size: 100vw; block-size: 100dvh; }
|
|
2650
|
-
dialog::backdrop { background: rgb(10 14 12 / 0.9); }
|
|
2651
|
-
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; block-size: 100%; box-sizing: border-box; padding: ${r(4)}; gap: ${r(3)}; color: #fff; }
|
|
2652
|
-
.bar { display: flex; align-items: center; justify-content: space-between; ${m("sm")} }
|
|
2653
|
-
.middle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: ${r(3)}; min-block-size: 0; }
|
|
2654
|
-
.middle img { display: block; margin: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: ${e.radiusLg}; }
|
|
2655
|
-
figure { margin: 0; display: flex; min-block-size: 0; block-size: 100%; }
|
|
2656
|
-
.caption { margin: 0; text-align: center; ${m("sm")} }
|
|
2657
|
-
`]}get dialog(){return this.renderRoot.querySelector("dialog")}open(i,s){this.opener=s.currentTarget,this.shown=i,this.requestUpdate(),this.updateComplete.then(()=>{let n=this.dialog;n&&!n.open&&(typeof n.showModal=="function"?n.showModal():n.setAttribute("open",""))})}close(){let i=this.dialog;i?.open&&(typeof i.close=="function"?i.close():i.removeAttribute("open")),this.onClosed()}onClosed(){this.shown!==-1&&(this.shown=-1,this.requestUpdate(),this.opener?.focus())}step(i){let s=(this.items??[]).length;!s||this.shown<0||(this.shown=(this.shown+i+s)%s,this.requestUpdate())}onKey(i){i.key==="ArrowRight"&&(i.preventDefault(),this.step(1)),i.key==="ArrowLeft"&&(i.preventDefault(),this.step(-1))}render(){let i=this.items??[],s=this.shown>=0?i[this.shown]:void 0;return a`<ul aria-label=${this.label} part="list">${i.map((n,d)=>{let p=Wr(d,i.length,this.layout);return a`<li style=${`--span-wide:${p.wide};--span-narrow:${p.narrow};--span-rows:${p.rows}`}>
|
|
2658
|
-
<button class="open" type="button" aria-label=${g("View larger: {picture}",{picture:n.alt})} @click=${b=>this.open(d,b)}><img src=${n.src} alt=${n.alt} loading="lazy" /></button>
|
|
2659
|
-
</li>`})}</ul>
|
|
2660
|
-
<dialog aria-label=${this.label} @keydown=${this.onKey} @close=${this.onClosed}>
|
|
2661
|
-
${s?a`<div class="stage">
|
|
2662
|
-
<div class="bar"><span>${this.shown+1} of ${i.length}</span><button class="round" type="button" aria-label=${g("Close")} @click=${this.close}>${S("close","18px")}</button></div>
|
|
2663
|
-
<div class="middle">
|
|
2664
|
-
<button class="round" type="button" aria-label=${g("Previous picture")} @click=${()=>this.step(-1)}>${S("arrow-left","18px")}</button>
|
|
2665
|
-
<figure><img src=${s.src} alt=${s.alt} /></figure>
|
|
2666
|
-
<button class="round" type="button" aria-label=${g("Next picture")} @click=${()=>this.step(1)}>${S("arrow-right","18px")}</button>
|
|
2667
|
-
</div>
|
|
2668
|
-
<p class="caption">${s.caption??s.alt}</p>
|
|
2669
|
-
</div>`:l}
|
|
2670
|
-
</dialog>`}},Xt=class extends c{static{this.properties={heading:{type:String},items:{type:Array},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.items=[],this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,h`
|
|
2671
|
-
:host { display: block; }
|
|
2672
|
-
p { margin: 0 0 ${r(6)}; text-align: center; color: ${e.textMuted}; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2673
|
-
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: ${r(8)} ${r(12)}; }
|
|
2674
|
-
img { display: block; block-size: 40px; inline-size: auto; max-inline-size: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; }
|
|
2675
|
-
li:hover img { filter: none; opacity: 1; }
|
|
2676
|
-
a { display: block; border-radius: ${e.radiusSm}; }
|
|
2677
|
-
`]}render(){return a`${this.heading?a`<p part="heading">${this.heading}</p>`:l}
|
|
2678
|
-
<ul part="list">${(this.items??[]).map(t=>a`<li>${t.href?a`<a href=${t.href}><img src=${t.src} alt=${t.alt} /></a>`:a`<img src=${t.src} alt=${t.alt} />`}</li>`)}</ul>`}},Gt=class extends c{static{this.properties={items:{type:Array},orientation:{type:String,reflect:!0},look:{type:String,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.items=[],this.orientation="horizontal",this.look="numbered",this.headingLevel=3,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,ei,h`
|
|
2679
|
-
:host { display: block; container-type: inline-size; }
|
|
2680
|
-
ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: ${r(6)}; }
|
|
2681
|
-
li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2682
|
-
li::before { content: counter(step); display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: ${e.brand}; color: ${e.onBrand}; ${m("sm")} font-weight: ${u("bold")}; position: relative; z-index: 1; margin-block-end: ${r(2)}; }
|
|
2683
|
-
li:not(:last-child)::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 48px; inset-inline-end: calc(-1 * ${r(6)} + 8px); block-size: 2px; background: ${e.rule}; }
|
|
2684
|
-
.h { ${m("lg")} letter-spacing: 0; }
|
|
2685
|
-
.meta { margin: 0; ${m("sm")} color: ${e.textMuted}; font-family: ${e.fontMono}; letter-spacing: 0.02em; }
|
|
2686
|
-
.body { margin: 0; color: ${e.textMuted}; line-height: ${C("normal")}; text-wrap: pretty; }
|
|
2687
|
-
:host([orientation='vertical']) ol { grid-auto-flow: row; }
|
|
2688
|
-
:host([orientation='vertical']) li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
2689
|
-
:host([orientation='vertical']) li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
2690
|
-
:host([orientation='vertical']) li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${r(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
2691
|
-
@container (max-width: 40rem) {
|
|
2692
|
-
ol { grid-auto-flow: row; }
|
|
2693
|
-
li { padding-inline-start: 56px; min-block-size: 56px; }
|
|
2694
|
-
li::before { position: absolute; inset-inline-start: 0; inset-block-start: 0; margin: 0; }
|
|
2695
|
-
li:not(:last-child)::after { inset-block-start: 48px; inset-block-end: calc(-1 * ${r(6)} + 8px); inset-inline-start: 19px; inset-inline-end: auto; inline-size: 2px; block-size: auto; }
|
|
2696
|
-
}
|
|
2697
|
-
:host([look='ruled']) li { padding-block-start: ${r(5)}; border-block-start: 3px solid var(--rule); }
|
|
2698
|
-
:host([look='ruled']) li::before, :host([look='ruled']) li::after { display: none; }
|
|
2699
|
-
:host([look='ruled']) ol { gap: ${r(5)}; }
|
|
2700
|
-
/* On a phone the ruled steps become a branch graph: one trunk down the left, and each step a coloured branch off it with a dot. */
|
|
2701
|
-
@container (max-width: 40rem) {
|
|
2702
|
-
:host([look='ruled']) ol { gap: 0; }
|
|
2703
|
-
:host([look='ruled']) li { padding-inline-start: 40px; padding-block: ${r(6)}; min-block-size: 0; border-block-start: 0; }
|
|
2704
|
-
:host([look='ruled']) li::before { display: block; content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 2px; block-size: auto; border-radius: 0; margin: 0; background: ${e.text}; }
|
|
2705
|
-
:host([look='ruled']) li::after { display: block; content: ''; position: absolute; inset-block: ${r(3)}; inset-inline-start: 2px; inset-inline-end: auto; inline-size: 12px; block-size: auto; background: radial-gradient(circle at 100% 34px, var(--rule) 4px, transparent 4.5px); border: 2px solid var(--rule); border-inline-start: 0; border-radius: 0 14px 14px 0; }
|
|
2706
|
-
}
|
|
2707
|
-
@media (forced-colors: active) { li::before { border: 1px solid CanvasText; } li:not(:last-child)::after { background: CanvasText; } :host([look='ruled']) li { border-block-start-color: CanvasText; } }
|
|
2708
|
-
`]}render(){return a`<ol part="list">${(this.items??[]).map((t,i)=>a`<li part="step" style=${this.look==="ruled"?`--rule:var(--impkt-color-chart-${i%5+1}, var(--impkt-color-brand-default, #1f4ed8))`:l}>
|
|
2709
|
-
${t.meta?a`<p class="meta">${t.meta}</p>`:l}
|
|
2710
|
-
<div class="h" role="heading" aria-level=${this.headingLevel}>${t.heading}</div>
|
|
2711
|
-
${t.text?a`<p class="body">${t.text}</p>`:l}
|
|
2712
|
-
</li>`)}</ol>`}},Yt=class extends c{static{this.properties={eyebrow:{type:String},heading:{type:String},lead:{type:String},points:{type:Array},level:{type:Number,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},imageSide:{type:String,reflect:!0,attribute:"image-side"},insetSrc:{type:String,attribute:"inset-src"},insetAlt:{type:String,attribute:"inset-alt"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.eyebrow="",this.heading="",this.lead="",this.points=[],this.level=2,this.imageSrc="",this.imageAlt="",this.imageSide="end",this.insetSrc="",this.insetAlt="",this.ratio="4:3",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,ei,h`
|
|
2713
|
-
:host { display: block; container-type: inline-size; --ratio: 4 / 3; }
|
|
2714
|
-
:host([ratio='1:1']) { --ratio: 1 / 1; }
|
|
2715
|
-
:host([ratio='3:2']) { --ratio: 3 / 2; }
|
|
2716
|
-
:host([ratio='16:9']) { --ratio: 16 / 9; }
|
|
2717
|
-
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(16)}; align-items: center; }
|
|
2718
|
-
:host([image-side='start']) .picture { order: -1; }
|
|
2719
|
-
.words { display: flex; flex-direction: column; gap: ${r(4)}; }
|
|
2720
|
-
.h { ${m("4xl")} }
|
|
2721
|
-
.lead { ${m("lg")} }
|
|
2722
|
-
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: ${r(3)}; }
|
|
2723
|
-
li { display: flex; gap: ${r(3)}; align-items: flex-start; line-height: ${C("normal")}; }
|
|
2724
|
-
.tick { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: ${e.brandSubtle}; color: ${e.brand}; }
|
|
2725
|
-
.actions { display: flex; flex-wrap: wrap; gap: ${r(3)} ${r(4)}; align-items: center; margin-block-start: ${r(2)}; }
|
|
2726
|
-
img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; border-radius: ${e.radius2xl}; box-shadow: ${e.shadowXl}; }
|
|
2727
|
-
.picture { position: relative; }
|
|
2728
|
-
.picture.has-inset { padding-block-end: 8%; padding-inline-end: 4%; }
|
|
2729
|
-
.inset { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 42%; aspect-ratio: 10 / 7; border: 6px solid ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-sizing: border-box; }
|
|
2730
|
-
@container (max-width: 48rem) {
|
|
2731
|
-
.split { grid-template-columns: minmax(0, 1fr); gap: ${r(8)}; }
|
|
2732
|
-
:host([image-side='start']) .picture { order: 0; }
|
|
2733
|
-
.h { ${m("3xl")} }
|
|
2734
|
-
}
|
|
2735
|
-
`]}render(){return a`<div class="split" part="split">
|
|
2736
|
-
<div class="words">
|
|
2737
|
-
${this.eyebrow?a`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>`:l}
|
|
2738
|
-
<div class="h" role="heading" aria-level=${this.level}>${this.heading}</div>
|
|
2739
|
-
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2740
|
-
${this.points?.length?a`<ul>${this.points.map(t=>a`<li><span class="tick">${S("check","14px")}</span><span>${t}</span></li>`)}</ul>`:l}
|
|
2741
|
-
<div class="actions"><slot name="actions"></slot></div>
|
|
2742
|
-
</div>
|
|
2743
|
-
${this.imageSrc?a`<div class="picture ${this.insetSrc?"has-inset":""}"><img src=${this.imageSrc} alt=${this.imageAlt} loading="lazy" part="image" />${this.insetSrc?a`<img class="inset" src=${this.insetSrc} alt=${this.insetAlt} loading="lazy" />`:l}</div>`:l}
|
|
2744
|
-
</div>`}},Qt=class extends c{static{this.properties={heading:{type:String},lead:{type:String},tone:{type:String,reflect:!0},align:{type:String,reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageAlt:{type:String,attribute:"image-alt"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="",this.lead="",this.tone="brand",this.align="split",this.imageSrc="",this.imageAlt="",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,ei,h`
|
|
2745
|
-
:host { display: block; container-type: inline-size; }
|
|
2746
|
-
.panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: ${r(8)}; padding: ${r(16)}; border-radius: ${e.radius2xl}; background: ${e.surfaceCard}; box-shadow: ${e.shadowSm}, inset 0 0 0 1px ${e.hairline}; }
|
|
2747
|
-
:host([tone='subtle']) .panel { background: ${e.surfaceSubtle}; box-shadow: none; }
|
|
2748
|
-
:host([tone='brand']) .panel { background: ${e.brand}; color: ${e.onBrand}; box-shadow: ${e.shadowLg}; }
|
|
2749
|
-
/* Only the words take the light colours: a button in the actions keeps its own. */
|
|
2750
|
-
:host([tone='brand']) .words { --impkt-color-text-heading: ${e.onBrand}; --impkt-color-text-default: ${e.onBrand}; --impkt-color-text-muted: ${e.onBrand}; --impkt-color-text-link: ${e.onBrand}; }
|
|
2751
|
-
/* A soft glow in the corner, so a flat colour has some depth. Decoration only. */
|
|
2752
|
-
:host([tone='brand']) .panel::before { content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; inline-size: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, ${e.onBrand} 18%, transparent), transparent); pointer-events: none; }
|
|
2753
|
-
.photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2754
|
-
.panel.pictured { min-block-size: 26rem; color: #fff; background: #12211a; --impkt-color-text-heading: #fff; }
|
|
2755
|
-
.panel.pictured::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.8) 0%, rgb(18 31 26 / 0.1) 75%); }
|
|
2756
|
-
.panel.pictured .words, .panel.pictured .actions { z-index: 1; }
|
|
2757
|
-
@container (max-width: 48rem) { .panel.pictured { justify-content: flex-end; } .panel.pictured::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.15) 0%, rgb(18 31 26 / 0.85) 100%); } }
|
|
2758
|
-
.words { position: relative; display: flex; flex-direction: column; gap: ${r(3)}; max-inline-size: 40rem; }
|
|
2759
|
-
.h { ${m("4xl")} }
|
|
2760
|
-
.lead { ${m("lg")} }
|
|
2761
|
-
.actions { position: relative; flex: none; display: flex; flex-wrap: wrap; gap: ${r(3)}; }
|
|
2762
|
-
:host([align='stacked']) .panel { flex-direction: column; align-items: flex-start; justify-content: center; }
|
|
2763
|
-
:host([align='center']) .panel { flex-direction: column; text-align: center; }
|
|
2764
|
-
:host([align='center']) .words { align-items: center; }
|
|
2765
|
-
@container (max-width: 48rem) { .panel { flex-direction: column; align-items: flex-start; padding: ${r(8)} ${r(6)}; } .h { ${m("3xl")} } :host([align='center']) .panel { align-items: center; } }
|
|
2766
|
-
@media (forced-colors: active) { .panel { border: 1px solid CanvasText; } }
|
|
2767
|
-
`]}render(){return a`<div class="panel ${this.imageSrc?"pictured":""}" part="panel">
|
|
2768
|
-
${this.imageSrc?a`<img class="photo" src=${this.imageSrc} alt=${this.imageAlt} />`:l}
|
|
2769
|
-
<div class="words">
|
|
2770
|
-
<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>
|
|
2771
|
-
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2772
|
-
</div>
|
|
2773
|
-
<div class="actions"><slot name="actions"></slot></div>
|
|
2774
|
-
</div>`}},nr=o=>a`<span class="stars" role="img" aria-label=${g("Rated {rating} out of 5",{rating:o})}>${[1,2,3,4,5].map(t=>a`<svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true" fill=${t<=o?"currentColor":"none"} stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M12 3.5l2.6 5.4 5.9.7-4.4 4 1.2 5.8L12 16.5l-5.3 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>`)}</span>`,Ur=o=>o.split(/\s+/).filter(t=>/^[A-Za-z]/.test(t)&&t.toLowerCase()!=="and").slice(0,2).map(t=>t[0].toUpperCase()).join(""),Zt=class extends c{static{this.properties={summary:{type:String},rating:{type:Number},items:{type:Array},columns:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.summary="",this.rating=void 0,this.items=[],this.columns="three",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
2775
|
-
:host { display: block; container-type: inline-size; }
|
|
2776
|
-
.top { display: flex; align-items: center; gap: ${r(3)}; margin-block-end: ${r(6)}; ${m("sm")} font-weight: ${u("medium")}; }
|
|
2777
|
-
.stars { display: inline-flex; gap: 2px; color: ${qr}; }
|
|
2778
|
-
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${r(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
2779
|
-
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
2780
|
-
li { display: flex; flex-direction: column; gap: ${r(4)}; padding: ${r(6)}; background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}, inset 0 0 0 1px ${e.hairline}; }
|
|
2781
|
-
blockquote { margin: 0; flex: 1; ${m("md")} text-wrap: pretty; }
|
|
2782
|
-
.who { display: flex; align-items: center; gap: ${r(3)}; }
|
|
2783
|
-
.face { flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border-radius: 50%; overflow: hidden; background: ${e.brandSubtle}; color: ${e.brand}; ${m("sm")} font-weight: ${u("bold")}; }
|
|
2784
|
-
.face img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
2785
|
-
.name { font-weight: ${u("semibold")}; ${m("sm")} }
|
|
2786
|
-
.about { color: ${e.textMuted}; ${m("sm")} }
|
|
2787
|
-
@container (max-width: 56rem) { ul, :host([columns='two']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
2788
|
-
`]}render(){return a`${this.summary||this.rating?a`<p class="top" part="summary" style="margin-block-start:0">${this.rating?nr(Math.round(this.rating)):l}<span>${this.summary}</span></p>`:l}
|
|
2789
|
-
<ul part="list">${(this.items??[]).map(t=>a`<li part="review">
|
|
2790
|
-
${t.rating?nr(t.rating):l}
|
|
2791
|
-
<blockquote>${t.quote}</blockquote>
|
|
2792
|
-
<div class="who"><span class="face" aria-hidden="true">${t.avatarSrc?a`<img src=${t.avatarSrc} alt="" />`:Ur(t.person)}</span><span><span class="name">${t.person}</span>${t.about?a`<br /><span class="about">${t.about}</span>`:l}</span></div>
|
|
2793
|
-
</li>`)}</ul>`}},Jt=class extends c{constructor(){super();this.done=!1;this.heading="",this.lead="",this.label="Email address",this.buttonText="Sign up",this.smallPrint="",this.doneText="Thank you. You\u2019re on the list.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.properties={heading:{type:String},lead:{type:String},label:{type:String},buttonText:{type:String,attribute:"button-text"},smallPrint:{type:String,attribute:"small-print"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}static{this.styles=[...c.styles,k,w,ei,h`
|
|
2794
|
-
:host { display: block; container-type: inline-size; }
|
|
2795
|
-
.wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${r(8)}; align-items: center; }
|
|
2796
|
-
.words { display: flex; flex-direction: column; gap: ${r(2)}; }
|
|
2797
|
-
.h { ${m("2xl")} }
|
|
2798
|
-
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: ${r(1)} ${r(3)}; }
|
|
2799
|
-
label { grid-column: 1 / -1; ${m("sm")} font-weight: ${u("semibold")}; }
|
|
2800
|
-
input { min-block-size: 44px; box-sizing: border-box; inline-size: 100%; padding: ${r(2.5)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; box-shadow: ${e.shadowXs}; }
|
|
2801
|
-
button { ${A} min-block-size: 44px; padding: ${r(2)} ${r(5)}; font: inherit; ${m("sm")} font-weight: ${u("semibold")}; color: ${e.onBrand}; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; box-shadow: ${e.shadowXs}; cursor: pointer; }
|
|
2802
|
-
button:hover { background: ${e.brandHover}; }
|
|
2803
|
-
.note { grid-column: 1 / -1; margin: ${r(1)} 0 0; color: ${e.textMuted}; ${m("sm")} }
|
|
2804
|
-
.done { margin: 0; ${m("md")} font-weight: ${u("semibold")}; }
|
|
2805
|
-
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); } }
|
|
2806
|
-
`]}submit(i){i.preventDefault();let s=i.currentTarget;if(typeof s.reportValidity=="function"&&!s.reportValidity())return;let n=s.querySelector("input").value.trim();this.dispatchEvent(new CustomEvent("impkt-submit",{detail:{email:n},bubbles:!0,composed:!0})),this.done=!0,this.requestUpdate()}render(){let i=this.id_("email");return a`<div class="wrap" part="wrap">
|
|
2807
|
-
<div class="words">
|
|
2808
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2809
|
-
${this.lead?a`<p class="lead">${this.lead}</p>`:l}
|
|
2810
|
-
</div>
|
|
2811
|
-
<div aria-live="polite">${this.done?a`<p class="done">${this.doneText}</p>`:a`<form @submit=${this.submit}>
|
|
2812
|
-
<label for=${i}>${this.label}</label>
|
|
2813
|
-
<input id=${i} type="email" name="email" autocomplete="email" required />
|
|
2814
|
-
<button type="submit">${this.buttonText}</button>
|
|
2815
|
-
${this.smallPrint?a`<p class="note">${this.smallPrint}</p>`:l}
|
|
2816
|
-
</form>`}</div>
|
|
2817
|
-
</div>`}};customElements.define("impkt-carousel",Vt);customElements.define("impkt-gallery",Kt);customElements.define("impkt-logo-cloud",Xt);customElements.define("impkt-steps",Gt);customElements.define("impkt-media-split",Yt);customElements.define("impkt-cta-banner",Qt);customElements.define("impkt-reviews",Zt);customElements.define("impkt-newsletter",Jt);var Ci=h`
|
|
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`
|
|
2818
1753
|
input, select {
|
|
2819
1754
|
box-sizing: border-box;
|
|
2820
|
-
inline-size: min(100%, var(--
|
|
1755
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
2821
1756
|
min-block-size: 44px;
|
|
2822
|
-
padding: ${
|
|
1757
|
+
padding: ${s(2.5)} ${s(3)};
|
|
2823
1758
|
font: inherit;
|
|
2824
1759
|
/* 16px whatever the page around it sets, so a phone does not zoom in on focus. */
|
|
2825
|
-
font-size: max(${
|
|
2826
|
-
color: ${
|
|
2827
|
-
background: ${
|
|
2828
|
-
border: ${
|
|
2829
|
-
border-radius: ${
|
|
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};
|
|
2830
1765
|
}
|
|
2831
|
-
input:focus-visible, select:focus-visible { border-color: ${
|
|
2832
|
-
:host([invalid]) input, :host([invalid]) select { border-color: ${
|
|
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}; }
|
|
2833
1768
|
.btn {
|
|
2834
1769
|
min-block-size: 44px;
|
|
2835
|
-
padding: ${
|
|
1770
|
+
padding: ${s(2.5)} ${s(4)};
|
|
2836
1771
|
font: inherit;
|
|
2837
|
-
font-weight: ${
|
|
2838
|
-
color: ${
|
|
2839
|
-
background: ${
|
|
1772
|
+
font-weight: ${m("semibold")};
|
|
1773
|
+
color: ${t.onBrand};
|
|
1774
|
+
background: ${t.brand};
|
|
2840
1775
|
border: 0;
|
|
2841
|
-
border-radius: ${
|
|
1776
|
+
border-radius: ${t.radiusLg};
|
|
2842
1777
|
cursor: pointer;
|
|
2843
1778
|
}
|
|
2844
|
-
.btn:hover { background: ${
|
|
2845
|
-
.quiet { display: inline-flex; align-items: center; min-block-size: ${
|
|
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; }
|
|
2846
1781
|
.visually-hidden { ${E} }
|
|
2847
|
-
`,
|
|
2848
|
-
.row { display: flex; flex-wrap: wrap; gap: ${
|
|
2849
|
-
.row label { display: block; ${
|
|
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)}; }
|
|
2850
1785
|
.postcode input { inline-size: 12ch; text-transform: uppercase; }
|
|
2851
|
-
.choose { margin-block-start: ${
|
|
1786
|
+
.choose { margin-block-start: ${s(4)}; }
|
|
2852
1787
|
.choose select { inline-size: 100%; }
|
|
2853
|
-
.manual { display: grid; gap: ${
|
|
2854
|
-
.manual label { display: block; ${
|
|
1788
|
+
.manual { display: grid; gap: ${s(3)}; margin-block-start: ${s(3)}; }
|
|
1789
|
+
.manual label { display: block; ${b("sm")} margin-block-end: ${s(1)}; }
|
|
2855
1790
|
.manual input { inline-size: 100%; }
|
|
2856
|
-
.note { ${
|
|
2857
|
-
.switch { margin-block-start: ${
|
|
2858
|
-
`]}async find(){let
|
|
2859
|
-
${
|
|
2860
|
-
${
|
|
2861
|
-
${
|
|
2862
|
-
${
|
|
2863
|
-
<button class="quiet switch" type="button" @click=${()=>{this.manual=!1}}>${
|
|
2864
|
-
</div>`}return
|
|
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`
|
|
2865
1800
|
<div class="row">
|
|
2866
1801
|
<div class="postcode"><label for=${this.controlId}>${this.postcodeLabel}</label>
|
|
2867
1802
|
<input id=${this.controlId} autocomplete="postal-code" .value=${this.postcode} aria-describedby=${this.describedBy}
|
|
2868
|
-
@input=${
|
|
2869
|
-
@keydown=${
|
|
1803
|
+
@input=${e=>{this.postcode=e.target.value}}
|
|
1804
|
+
@keydown=${e=>{e.key==="Enter"&&(e.preventDefault(),this.find())}} /></div>
|
|
2870
1805
|
<button class="btn" type="button" ?disabled=${this.busy} @click=${()=>this.find()}>${this.busy?"Finding\u2026":this.findText}</button>
|
|
2871
1806
|
</div>
|
|
2872
|
-
${this.addresses.length?
|
|
2873
|
-
<select id=${this.id_("choose")} @change=${
|
|
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)}>
|
|
2874
1809
|
<option value="">${this.addresses.length} ${this.addresses.length===1?"address":"addresses"} found</option>
|
|
2875
|
-
${this.addresses.map(
|
|
2876
|
-
</select></div>`:this.searched&&!this.busy?
|
|
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}
|
|
2877
1812
|
<button class="quiet switch" type="button" @click=${()=>{this.manual=!0}}>${this.manualText}</button>
|
|
2878
|
-
`}updated(
|
|
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`
|
|
2879
1814
|
:host { display: block; }
|
|
2880
|
-
.box { padding: ${
|
|
2881
|
-
.box:focus { outline: 3px solid ${
|
|
2882
|
-
h2 { margin: 0 0 ${
|
|
2883
|
-
ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${
|
|
2884
|
-
a { display: inline-flex; align-items: center; min-block-size: ${
|
|
2885
|
-
`]}go(
|
|
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">
|
|
2886
1821
|
<h2 id=${this.id_("h")}>${this.heading}</h2>
|
|
2887
|
-
<ul>${this.items.map(
|
|
2888
|
-
</div>`:l}},
|
|
2889
|
-
.zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${
|
|
2890
|
-
.zone.over { border-color: ${
|
|
2891
|
-
:host([invalid]) .zone { border-color: ${
|
|
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; }
|
|
2892
1827
|
:host([disabled]) label.btn { cursor: not-allowed; }
|
|
2893
|
-
.drop { color: ${
|
|
1828
|
+
.drop { color: ${t.textMuted}; }
|
|
2894
1829
|
input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
|
|
2895
1830
|
label.btn { display: inline-flex; align-items: center; }
|
|
2896
|
-
input[type='file']:focus-visible + label.btn { box-shadow: ${
|
|
2897
|
-
ul { margin: ${
|
|
2898
|
-
li { display: flex; justify-content: space-between; gap: ${
|
|
2899
|
-
.size { color: ${
|
|
2900
|
-
`]}fits(
|
|
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`
|
|
2901
1836
|
<div class="zone ${this.over?"over":""}"
|
|
2902
|
-
@dragover=${
|
|
1837
|
+
@dragover=${e=>{e.preventDefault(),this.over=!0}}
|
|
2903
1838
|
@dragleave=${()=>{this.over=!1}}
|
|
2904
|
-
@drop=${
|
|
1839
|
+
@drop=${e=>{e.preventDefault(),this.over=!1,e.dataTransfer?.files&&this.add(e.dataTransfer.files)}}>
|
|
2905
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}
|
|
2906
|
-
@change=${
|
|
1841
|
+
@change=${e=>{let i=e.target.files;i&&this.add(i),e.target.value=""}} />
|
|
2907
1842
|
<label class="btn" for=${this.controlId}>${this.chooseText}</label>
|
|
2908
1843
|
<span class="drop">${this.dropText}</span>
|
|
2909
1844
|
</div>
|
|
2910
1845
|
<p class="visually-hidden" role="status">${this.said}</p>
|
|
2911
|
-
${this.files.length?
|
|
2912
|
-
`}};function
|
|
2913
|
-
.wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--
|
|
2914
|
-
.sign { display: flex; align-items: center; padding: 0 ${
|
|
2915
|
-
.wrap input { inline-size: 100%; border-radius: 0 ${
|
|
2916
|
-
`]}willUpdate(
|
|
2917
|
-
<span class="sign" id=${this.id_("sign")}>${
|
|
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>
|
|
2918
1853
|
<input id=${this.controlId} inputmode=${this.pence?"decimal":"numeric"} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}
|
|
2919
1854
|
aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}
|
|
2920
|
-
@input=${
|
|
2921
|
-
</div>`}updated(
|
|
2922
|
-
.top { display: flex; justify-content: space-between; gap: ${
|
|
2923
|
-
output { font-weight: ${
|
|
2924
|
-
input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${
|
|
2925
|
-
.ends { display: flex; justify-content: space-between; ${
|
|
2926
|
-
`]}shownAs(
|
|
2927
|
-
<div class="top"><label class="label" for=${this.controlId}>${this.label}${this.required?
|
|
2928
|
-
<output for=${this.controlId}>${this.shownAs(
|
|
2929
|
-
${this.description?
|
|
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}
|
|
2930
1865
|
${this.renderControl()}
|
|
2931
1866
|
<div class="ends" aria-hidden="true"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>
|
|
2932
1867
|
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
2933
|
-
`}renderControl(){return
|
|
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}
|
|
2934
1869
|
aria-valuetext=${this.shownAs(Number(this.value)||0)} aria-describedby=${this.describedBy}
|
|
2935
|
-
@input=${
|
|
2936
|
-
:host { display: block; }
|
|
2937
|
-
.h { margin: 0 0 ${r(2)}; ${m("xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2938
|
-
.count { margin: 0 0 ${r(4)}; color: ${e.textMuted}; }
|
|
2939
|
-
ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${e.rule}; }
|
|
2940
|
-
li { display: flex; justify-content: space-between; align-items: center; gap: ${r(4)}; padding: ${r(4)} 0; border-block-end: 1px solid ${e.rule}; }
|
|
2941
|
-
a { display: inline-flex; align-items: center; min-block-size: ${e.targetMin}; color: ${e.link}; font-weight: ${u("semibold")}; text-underline-offset: 0.2em; }
|
|
2942
|
-
.title { font-weight: ${u("semibold")}; }
|
|
2943
|
-
.hint { display: block; ${m("sm")} color: ${e.textMuted}; }
|
|
2944
|
-
.tag { flex-shrink: 0; padding: ${r(1)} ${r(2.5)}; border-radius: 999px; ${m("sm")} font-weight: ${u("semibold")}; background: ${e.surfaceInset}; color: ${e.text}; }
|
|
2945
|
-
.tag[data-status='done'] { background: ${e.successSubtle}; color: ${e.successText}; }
|
|
2946
|
-
.tag[data-status='in-progress'] { background: ${e.brandSubtle}; color: ${e.link}; }
|
|
2947
|
-
.tag[data-status='cannot-start'] { background: transparent; color: ${e.textMuted}; }
|
|
2948
|
-
`]}render(){let t=this.items.filter(i=>i.status==="done").length;return a`
|
|
2949
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2950
|
-
${this.items.length?a`<p class="count">${g(this.items.length===1?"You have completed {done} of {total} part.":"You have completed {done} of {total} parts.",{done:t,total:this.items.length})}</p>`:l}
|
|
2951
|
-
<ul>${this.items.map(i=>a`<li>
|
|
2952
|
-
<span>${i.href&&i.status!=="cannot-start"?a`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>`:a`<span class="title">${i.title}</span>`}
|
|
2953
|
-
${i.hint?a`<span class="hint">${i.hint}</span>`:l}</span>
|
|
2954
|
-
<span class="tag" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${lr[i.status]?g(lr[i.status]):i.status}</span>
|
|
2955
|
-
</li>`)}</ul>`}};W.createProperty("manual",{state:!0});W.createProperty("postcode",{state:!0});W.createProperty("searched",{state:!0});W.createProperty("busy",{state:!0});Z.createProperty("files",{state:!0});Z.createProperty("over",{state:!0});Z.createProperty("said",{state:!0});be.createProperty("shown",{state:!0});customElements.define("impkt-address-lookup",W);customElements.define("impkt-error-summary",ti);customElements.define("impkt-file-upload",Z);customElements.define("impkt-money-input",be);customElements.define("impkt-range-input",ii);customElements.define("impkt-task-list",ri);var ye=h`
|
|
2956
|
-
.card { background: ${e.surfaceCard}; border-radius: ${e.radiusXl}; box-shadow: ${e.shadowSm}, 0 0 0 1px ${e.hairline}; }
|
|
2957
|
-
.h { margin: 0; font-family: ${e.fontHeading}; ${m("2xl")} font-weight: ${u("bold")}; color: ${e.textHeading}; }
|
|
2958
|
-
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${r(2.5)} ${r(5)}; font: inherit; font-weight: ${u("semibold")}; color: ${e.onBrand}; text-decoration: none; background: ${e.brand}; border: 0; border-radius: ${e.radiusLg}; cursor: pointer; }
|
|
2959
|
-
.btn:hover { background: ${e.brandHover}; }
|
|
2960
|
-
.btn.quiet { color: ${e.link}; background: transparent; box-shadow: inset 0 0 0 ${e.borderThin} ${e.border}; }
|
|
2961
|
-
.small { margin: 0; ${m("xs")} color: ${e.textMuted}; }
|
|
2962
|
-
.visually-hidden { ${E} }
|
|
2963
|
-
`,si=(o,t="GBP",i=0)=>{try{return new Intl.NumberFormat(B(),{style:"currency",currency:t,maximumFractionDigits:i,minimumFractionDigits:i}).format(o)}catch{return String(Math.round(o))}},ai=class extends c{static{this.properties={heading:{type:String},plans:{type:Array},rows:{type:Array},buttonText:{type:String,attribute:"button-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="Compare cover",this.plans=[],this.rows=[],this.buttonText="Choose",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,A,w,ye,h`
|
|
2964
|
-
:host { display: block; container-type: inline-size; }
|
|
2965
|
-
.h { margin-block-end: ${r(5)}; }
|
|
2966
|
-
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${r(4)}; }
|
|
2967
|
-
.plan { position: relative; display: flex; flex-direction: column; gap: ${r(3)}; padding: ${r(6)}; }
|
|
2968
|
-
.plan.top { box-shadow: 0 0 0 2px ${e.brand}, ${e.shadowMd}; }
|
|
2969
|
-
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${r(1)} ${r(3)}; border-radius: 999px; ${m("xs")} font-weight: ${u("bold")}; color: ${e.onBrand}; background: ${e.brand}; white-space: nowrap; }
|
|
2970
|
-
.name { margin: 0; ${m("lg")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
2971
|
-
.price { margin: 0; font-family: ${e.fontHeading}; ${m("3xl")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
2972
|
-
.period { ${m("sm")} font-weight: ${u("regular")}; color: ${e.textMuted}; }
|
|
2973
|
-
.note { margin: 0; ${m("sm")} color: ${e.textMuted}; }
|
|
2974
|
-
ul { flex: 1; margin: 0; padding: ${r(3)} 0 0; list-style: none; display: grid; gap: ${r(2)}; border-block-start: 1px solid ${e.rule}; align-content: start; }
|
|
2975
|
-
li { display: flex; gap: ${r(2)}; ${m("sm")} }
|
|
2976
|
-
li[data-has='false'] { color: ${e.textMuted}; }
|
|
2977
|
-
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${u("bold")}; text-align: center; }
|
|
2978
|
-
li[data-has='true'] .mark { color: ${e.successText}; }
|
|
2979
|
-
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${r(6)}; } }
|
|
2980
|
-
`]}has(t,i){return t.includes.split(",").map(s=>s.trim().toLowerCase()).includes(i.label.trim().toLowerCase())}choose(t,i){this.dispatchEvent(new CustomEvent("impkt-select",{detail:{plan:t},bubbles:!0,composed:!0,cancelable:!0}))||i.preventDefault()}render(){return a`
|
|
2981
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2982
|
-
<div class="grid" style=${`--cols: ${Math.max(1,this.plans.length)}`}>
|
|
2983
|
-
${this.plans.map(t=>a`<section class="card plan ${t.badge?"top":""}" aria-labelledby=${this.id_(`n-${t.id}`)}>
|
|
2984
|
-
${t.badge?a`<span class="badge">${t.badge}</span>`:l}
|
|
2985
|
-
<h3 class="name" id=${this.id_(`n-${t.id}`)}>${t.name}</h3>
|
|
2986
|
-
<p class="price">${t.price}${t.period?a` <span class="period">${t.period}</span>`:l}</p>
|
|
2987
|
-
${t.note?a`<p class="note">${t.note}</p>`:l}
|
|
2988
|
-
<ul>${this.rows.map(i=>{let s=this.has(t,i);return a`<li data-has=${String(s)}><span class="mark" aria-hidden="true">${s?"\u2713":"\u2013"}</span><span>${i.label}<span class="visually-hidden">: ${g(s?"included":"not included")}</span></span></li>`})}</ul>
|
|
2989
|
-
${t.href?a`<a class="btn ${t.badge?"":"quiet"}" href=${t.href} @click=${i=>this.choose(t,i)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></a>`:a`<button class="btn ${t.badge?"":"quiet"}" type="button" @click=${i=>this.choose(t,i)}>${this.buttonText}<span class="visually-hidden"> ${t.name}</span></button>`}
|
|
2990
|
-
</section>`)}
|
|
2991
|
-
</div>`}};function cr(o,t){let i=/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/.exec(o),s=t&&!/^en\b/i.test(t)?`&hl=${encodeURIComponent(t.split("-")[0])}&cc_lang_pref=${encodeURIComponent(t.split("-")[0])}`:"";if(i)return`https://www.youtube-nocookie.com/embed/${i[1]}?autoplay=1&rel=0${s}`;let n=/vimeo\.com\/(?:video\/)?(\d+)/.exec(o);return n?`https://player.vimeo.com/video/${n[1]}?autoplay=1&dnt=1`:null}var fe=class extends c{static{this.properties={videoSrc:{type:String,attribute:"video-src"},label:{type:String},posterSrc:{type:String,attribute:"poster-src"},captionsSrc:{type:String,attribute:"captions-src"},transcriptHref:{type:String,attribute:"transcript-href"},playText:{type:String,attribute:"play-text"},ratio:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.videoSrc="",this.label="Video",this.posterSrc="",this.captionsSrc="",this.transcriptHref="",this.playText="Play video",this.ratio="16:9",this.playing=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,ye,h`
|
|
2992
|
-
:host { display: block; }
|
|
2993
|
-
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${e.radiusXl}; background: #111; }
|
|
2994
|
-
:host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }
|
|
2995
|
-
:host([ratio='1:1']) .frame { aspect-ratio: 1; }
|
|
2996
|
-
:host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }
|
|
2997
|
-
iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }
|
|
2998
|
-
.play { position: absolute; inset: 0; display: grid; place-items: center; inline-size: 100%; padding: 0; color: #fff; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); border: 0; cursor: pointer; }
|
|
2999
|
-
.disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${e.brand}; box-shadow: ${e.shadowLg}; }
|
|
3000
|
-
.label { position: absolute; inset-inline-start: ${r(5)}; inset-block-end: ${r(4)}; ${m("lg")} font-weight: ${u("semibold")}; text-align: start; }
|
|
3001
|
-
.foot { margin: ${r(2)} 0 0; ${m("sm")} }
|
|
3002
|
-
.foot a { color: ${e.link}; }
|
|
3003
|
-
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
3004
|
-
`]}render(){let t=cr(this.videoSrc,B(this)),i;return this.videoSrc?t&&this.playing?i=a`<iframe src=${t} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`:t?i=a`${this.posterSrc?a`<img src=${this.posterSrc} alt="" />`:l}
|
|
3005
|
-
<button class="play" type="button" @click=${()=>{this.playing=!0}}>
|
|
3006
|
-
<span class="disc" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></span>
|
|
3007
|
-
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
3008
|
-
</button>`:i=a`<video controls preload="metadata" poster=${this.posterSrc||l} aria-label=${this.label}>
|
|
3009
|
-
<source src=${this.videoSrc} />
|
|
3010
|
-
${this.captionsSrc?a`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />`:l}
|
|
3011
|
-
</video>`:i=a`<div class="empty">${g("Add a video address")}</div>`,a`<div class="frame" part="frame">${i}</div>
|
|
3012
|
-
${this.transcriptHref?a`<p class="foot"><a href=${this.transcriptHref}>${g("Read the transcript")}<span class="visually-hidden">${g(" of {video}",{video:this.label})}</span></a></p>`:l}`}},dr={mortgage:{heading:"Your home may be repossessed",text:"Your home may be repossessed if you do not keep up repayments on your mortgage."},"secured-loan":{heading:"Think carefully before securing other debts against your home",text:"Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it."},investment:{heading:"Capital at risk",text:"The value of investments can go down as well as up, and you may get back less than you put in."},insurance:{heading:"Important information",text:"Read the policy documents to check the cover suits your needs. Limits and exclusions apply."},custom:{heading:"",text:""}},ni=class extends c{static{this.properties={kind:{type:String,reflect:!0},heading:{type:String},text:{type:String},firm:{type:String},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.kind="mortgage",this.heading="",this.text="",this.firm="",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,w,h`
|
|
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`
|
|
3013
1871
|
:host { display: block; }
|
|
3014
|
-
.
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
.result { display: flex; flex-direction: column; justify-content: center; gap: ${r(2)}; padding: ${r(8)}; color: ${e.onBrand}; background: ${e.brand}; }
|
|
3034
|
-
.caption { margin: 0; ${m("sm")} opacity: 0.85; }
|
|
3035
|
-
output { display: block; font-family: ${e.fontHeading}; ${m("4xl")} font-weight: ${u("bold")}; }
|
|
3036
|
-
.line { margin: 0; ${m("sm")} }
|
|
3037
|
-
.foot { grid-column: 1 / -1; padding: ${r(4)} ${r(8)}; background: ${e.surfaceSubtle}; }
|
|
3038
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${r(5)}; } .foot { padding: ${r(4)} ${r(5)}; } }
|
|
3039
|
-
`,oi=class extends c{static{this.properties={heading:{type:String},price:{type:Number},buyer:{type:String},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much stamp duty would you pay?",this.price=385e3,this.buyer="first-time",this.smallPrint="Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,ye,hr]}render(){let t=pr(this.price,this.buyer),i=this.price>0?t/this.price*100:0,s=[["first-time",g("First home")],["mover",g("Moving home")],["additional",g("Second home")]];return a`<div class="card wrap" part="wrap">
|
|
3040
|
-
<div class="inputs">
|
|
3041
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3042
|
-
<div><label for=${this.id_("price")}>${g("Price of the home (\xA3)")}</label>
|
|
3043
|
-
<input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${n=>{this.price=Number(n.target.value)||0}} /></div>
|
|
3044
|
-
<fieldset><legend>${g("Are you buying")}</legend><div class="choices">
|
|
3045
|
-
${s.map(([n,d])=>a`<label><input type="radio" name=${this.id_("buyer")} .checked=${this.buyer===n} @change=${()=>{this.buyer=n}} />${d}</label>`)}
|
|
3046
|
-
</div></fieldset>
|
|
3047
|
-
</div>
|
|
3048
|
-
<div class="result" aria-live="polite">
|
|
3049
|
-
<p class="caption">${g("Stamp duty to pay")}</p>
|
|
3050
|
-
<output for=${this.id_("price")}>${si(t)}</output>
|
|
3051
|
-
<p class="line">${t?g("About {rate}% of the price",{rate:i.toFixed(1)}):g("Nothing to pay at this price")}</p>
|
|
3052
|
-
${this.buyer==="first-time"&&this.price>U.firstTimeLimit?a`<p class="line">${g("First-time buyer relief stops above {limit}, so the usual rates apply.",{limit:si(U.firstTimeLimit)})}</p>`:l}
|
|
3053
|
-
</div>
|
|
3054
|
-
${this.smallPrint?a`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:l}
|
|
3055
|
-
</div>`}},li=class extends c{static{this.properties={heading:{type:String},income:{type:Number},secondIncome:{type:Number,attribute:"second-income"},deposit:{type:Number},timesIncome:{type:Number,attribute:"times-income"},smallPrint:{type:String,attribute:"small-print"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="How much could you borrow?",this.income=45e3,this.secondIncome=0,this.deposit=3e4,this.timesIncome=4.5,this.smallPrint="This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.",this.headingLevel=2,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,ye,hr]}field(t){return i=>{this[t]=Number(i.target.value)||0}}render(){let t=Math.max(0,(this.income+this.secondIncome)*this.timesIncome),i=(s,n)=>a`<div><label for=${this.id_(s)}>${n}</label>
|
|
3056
|
-
<input id=${this.id_(s)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[s])} @input=${this.field(s)} /></div>`;return a`<div class="card wrap" part="wrap">
|
|
3057
|
-
<div class="inputs">
|
|
3058
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3059
|
-
${i("income",g("Your yearly income before tax (\xA3)"))}
|
|
3060
|
-
${i("secondIncome",g("A second person\u2019s income, if buying together (\xA3)"))}
|
|
3061
|
-
${i("deposit",g("Your deposit (\xA3)"))}
|
|
3062
|
-
</div>
|
|
3063
|
-
<div class="result" aria-live="polite">
|
|
3064
|
-
<p class="caption">${g("You could borrow about")}</p>
|
|
3065
|
-
<output>${si(t)}</output>
|
|
3066
|
-
<p class="line">${g("With your deposit, that\u2019s a home of about {amount}.",{amount:si(t+this.deposit)})}</p>
|
|
3067
|
-
</div>
|
|
3068
|
-
${this.smallPrint?a`<div class="foot"><p class="small">${this.smallPrint}</p></div>`:l}
|
|
3069
|
-
</div>`}},$e=class extends c{static{this.properties={heading:{type:String},phone:{type:String},hours:{type:String},email:{type:String},callbackHeading:{type:String,attribute:"callback-heading"},buttonText:{type:String,attribute:"button-text"},doneText:{type:String,attribute:"done-text"},headingLevel:{type:Number,attribute:"heading-level"},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.heading="Talk to us",this.phone="0800 000 0000",this.hours=`Monday to Friday, 9am to 6pm
|
|
3070
|
-
Saturday, 10am to 2pm`,this.email="",this.callbackHeading="Or we can call you",this.buttonText="Ask for a call back",this.doneText="Thanks. We\u2019ll call you at the time you chose.",this.headingLevel=2,this.sent=!1,this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,k,w,ye,h`
|
|
3071
|
-
:host { display: block; container-type: inline-size; }
|
|
3072
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${r(6)}; padding: ${r(8)}; }
|
|
3073
|
-
.phone { display: inline-block; margin: ${r(3)} 0; font-family: ${e.fontHeading}; ${m("3xl")} font-weight: ${u("bold")}; color: ${e.link}; text-decoration: none; }
|
|
3074
|
-
.hours { margin: 0; white-space: pre-line; color: ${e.textMuted}; }
|
|
3075
|
-
.email { display: inline-block; margin-block-start: ${r(3)}; color: ${e.link}; }
|
|
3076
|
-
form { display: grid; gap: ${r(3)}; padding: ${r(5)}; border-radius: ${e.radiusLg}; background: ${e.surfaceInset}; }
|
|
3077
|
-
.sub { margin: 0; ${m("lg")} font-weight: ${u("bold")}; color: ${e.text}; }
|
|
3078
|
-
label { display: block; ${m("sm")} font-weight: ${u("semibold")}; margin-block-end: ${r(1)}; }
|
|
3079
|
-
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${r(2)} ${r(3)}; font: inherit; color: ${e.text}; background: ${e.surfaceCard}; border: ${e.borderThin} solid ${e.border}; border-radius: ${e.radiusLg}; }
|
|
3080
|
-
.done { margin: 0; padding: ${r(5)}; border-radius: ${e.radiusLg}; background: ${e.successSubtle}; color: ${e.successText}; font-weight: ${u("semibold")}; }
|
|
3081
|
-
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${r(5)}; } }
|
|
3082
|
-
`]}submit(t){t.preventDefault();let i=new FormData(t.target),s={name:String(i.get("name")??""),phone:String(i.get("phone")??""),when:String(i.get("when")??"")};this.dispatchEvent(new CustomEvent("impkt-submit",{detail:s,bubbles:!0,composed:!0})),this.sent=!0}render(){return a`<div class="card wrap" part="wrap">
|
|
3083
|
-
<div>
|
|
3084
|
-
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
3085
|
-
${this.phone?a`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g,"")}`}>${this.phone}</a>`:l}
|
|
3086
|
-
${this.hours?a`<p class="hours">${this.hours}</p>`:l}
|
|
3087
|
-
${this.email?a`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>`:l}
|
|
3088
|
-
</div>
|
|
3089
|
-
${this.callbackHeading?this.sent?a`<p class="done" role="status">${this.doneText}</p>`:a`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
3090
|
-
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
3091
|
-
<div><label for=${this.id_("name")}>${g("Your name")}</label><input id=${this.id_("name")} name="name" autocomplete="name" required /></div>
|
|
3092
|
-
<div><label for=${this.id_("tel")}>${g("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
3093
|
-
<div><label for=${this.id_("when")}>${g("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${g("Morning")}</option><option value="Afternoon">${g("Afternoon")}</option><option value="Evening">${g("Evening")}</option></select></div>
|
|
3094
|
-
<button class="btn" type="submit">${this.buttonText}</button>
|
|
3095
|
-
</form>`:l}
|
|
3096
|
-
</div>`}};fe.createProperty("playing",{state:!0});$e.createProperty("sent",{state:!0});customElements.define("impkt-plan-comparison",ai);customElements.define("impkt-video",fe);customElements.define("impkt-regulatory-notice",ni);customElements.define("impkt-stamp-duty-calculator",oi);customElements.define("impkt-affordability-calculator",li);customElements.define("impkt-contact-block",$e);export{T as FieldElement,wi as ICONS,Lr as ICON_NAMES,De as ImpktAccordion,W as ImpktAddressLookup,li as ImpktAffordabilityCalculator,Le as ImpktAlert,Lt as ImpktAnnouncement,Dt as ImpktAvatar,qt as ImpktAvatarGroup,Et as ImpktBadge,Ge as ImpktBeforeAfter,tt as ImpktBranchList,rt as ImpktBranchTimeline,ot as ImpktBreadcrumbs,Te as ImpktButton,Re as ImpktCard,Ht as ImpktCardGrid,Vt as ImpktCarousel,it as ImpktCheckList,Me as ImpktCheckbox,ut as ImpktCheckboxGroup,ct as ImpktChip,$e as ImpktContactBlock,Qt as ImpktCtaBanner,mt as ImpktDateInput,bt as ImpktDialog,Rt as ImpktDivider,Pe as ImpktDocumentLink,Pt as ImpktDrawer,c as ImpktElement,Wt as ImpktEmptyState,ti as ImpktErrorSummary,xt as ImpktEstimator,zt as ImpktFeatureList,Nt as ImpktFieldset,Z as ImpktFileUpload,Kt as ImpktGallery,vt as ImpktGrid,Ie as ImpktHeading,kt as ImpktHelp,Tt as ImpktHero,Se as ImpktIcon,He as ImpktImage,_e as ImpktLink,ft as ImpktList,Qe as ImpktLocationCard,Ne as ImpktLogo,Xt as ImpktLogoCloud,Yt as ImpktMediaSplit,jt as ImpktMenu,be as ImpktMoneyInput,Xe as ImpktMortgageCalculator,nt as ImpktNav,Jt as ImpktNewsletter,wt as ImpktPage,Ft as ImpktPagination,ai as ImpktPlanComparison,Oe as ImpktPrice,qe as ImpktProgress,At as ImpktQuote,Ee as ImpktRadioGroup,ii as ImpktRangeInput,ni as ImpktRegulatoryNotice,Je as ImpktReleaseCard,et as ImpktReleaseList,Zt as ImpktReviews,Ue as ImpktScene,Ve as ImpktScrubber,Ct as ImpktSearchBar,St as ImpktSection,Ae as ImpktSelect,pt as ImpktSiteFooter,lt as ImpktSiteHeader,Ke as ImpktSitePlan,Ut as ImpktSlotPicker,It as ImpktSpacer,Ce as ImpktStack,oi as ImpktStampDutyCalculator,Mt as ImpktStat,Gt as ImpktSteps,Ye as ImpktStickyBar,je as ImpktSummaryList,Fe as ImpktTable,_t as ImpktTabs,ri as ImpktTaskList,Be as ImpktText,ze as ImpktTextInput,ht as ImpktTextarea,Ot as ImpktToast,fe as ImpktVideo,Bt as ImpktVisuallyHidden,dt as ImpktWordmark,U as SDLT,cr as embedOf,yt as estimate,$ as fontSize,u as fontWeight,Li as groupDigits,S as iconSvg,C as lineHeight,Zi as monthlyPayment,ir as phaseWeeks,r as space,pr as stampDuty,e as t,f as token};
|
|
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};
|
|
3097
1891
|
/*! Bundled license information:
|
|
3098
1892
|
|
|
3099
1893
|
@lit/reactive-element/css-tag.js:
|