@atomic-ui/ui 0.5.0 → 0.7.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 +7 -7
- package/custom-elements.json +2641 -256
- package/dist/base/tone.d.ts +1 -1
- package/dist/{chunk-TAZZLOUY.js → chunk-2HWO5TFV.js} +2 -2
- package/dist/{chunk-FMSC7J7J.js → chunk-4ZQTXTPA.js} +1 -1
- package/dist/{chunk-FMSC7J7J.js.map → chunk-4ZQTXTPA.js.map} +1 -1
- package/dist/chunk-AMDTBUUL.js +299 -0
- package/dist/chunk-AMDTBUUL.js.map +1 -0
- package/dist/{chunk-EJD6LT7E.js → chunk-BNYILASW.js} +36 -4
- package/dist/chunk-BNYILASW.js.map +1 -0
- package/dist/{chunk-Q54FX3SY.js → chunk-INA53XXW.js} +2 -2
- package/dist/chunk-INA53XXW.js.map +1 -0
- package/dist/{chunk-ACQ4KYPR.js → chunk-KFAGXPIK.js} +2 -2
- package/dist/{chunk-ACQ4KYPR.js.map → chunk-KFAGXPIK.js.map} +1 -1
- package/dist/{chunk-SV77SN6P.js → chunk-MLRTPQQO.js} +39 -2
- package/dist/chunk-MLRTPQQO.js.map +1 -0
- package/dist/{chunk-ZS7RPXCT.js → chunk-NU34ZQFR.js} +4 -2
- package/dist/chunk-NU34ZQFR.js.map +1 -0
- package/dist/chunk-NUUX2SSN.js +263 -0
- package/dist/chunk-NUUX2SSN.js.map +1 -0
- package/dist/{chunk-HNZQ7LM4.js → chunk-OE6O3XQB.js} +78 -3
- package/dist/chunk-OE6O3XQB.js.map +1 -0
- package/dist/{chunk-WWYYNR3Z.js → chunk-RZWRAJCD.js} +7 -2
- package/dist/chunk-RZWRAJCD.js.map +1 -0
- package/dist/chunk-UF6KCRNT.js +316 -0
- package/dist/chunk-UF6KCRNT.js.map +1 -0
- package/dist/{chunk-Z45LY6BT.js → chunk-WH43U4IY.js} +37 -2
- package/dist/chunk-WH43U4IY.js.map +1 -0
- package/dist/{chunk-5Y3HYRCU.js → chunk-WS4AYRSL.js} +20 -2
- package/dist/chunk-WS4AYRSL.js.map +1 -0
- package/dist/{chunk-PANH23MF.js → chunk-XZQH2M5I.js} +2 -2
- package/dist/components/app-ui.d.ts +6 -1
- package/dist/components/app-ui.js +2 -2
- package/dist/components/badge.d.ts +7 -2
- package/dist/components/badge.js +2 -2
- package/dist/components/blocks.d.ts +27 -1
- package/dist/components/blocks.js +3 -1
- package/dist/components/button.d.ts +24 -3
- package/dist/components/button.js +2 -2
- package/dist/components/chip.js +1 -1
- package/dist/components/icon.d.ts +19 -1
- package/dist/components/icon.js +1 -1
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +2 -2
- package/dist/components/navigation.js +2 -2
- package/dist/components/progress.d.ts +11 -0
- package/dist/components/progress.js +1 -1
- package/dist/components/rows.d.ts +196 -0
- package/dist/components/rows.js +16 -0
- package/dist/components/rows.js.map +1 -0
- package/dist/components/shell.d.ts +166 -0
- package/dist/components/shell.js +17 -0
- package/dist/components/shell.js.map +1 -0
- package/dist/components/switch.d.ts +147 -0
- package/dist/components/switch.js +11 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +2 -2
- package/dist/components/text-input.d.ts +14 -1
- package/dist/components/text-input.js +2 -1
- package/dist/components/textarea.js +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +44 -16
- package/dist/standalone/atomic-ui.js +929 -285
- package/dist/standalone/atomic-ui.js.map +4 -4
- package/dist/standalone/index.html +1 -1
- package/package.json +2 -2
- package/specimen/index.html +1 -1
- package/dist/chunk-5Y3HYRCU.js.map +0 -1
- package/dist/chunk-EJD6LT7E.js.map +0 -1
- package/dist/chunk-HNZQ7LM4.js.map +0 -1
- package/dist/chunk-Q54FX3SY.js.map +0 -1
- package/dist/chunk-SV77SN6P.js.map +0 -1
- package/dist/chunk-WWYYNR3Z.js.map +0 -1
- package/dist/chunk-Z45LY6BT.js.map +0 -1
- package/dist/chunk-ZS7RPXCT.js.map +0 -1
- /package/dist/{chunk-TAZZLOUY.js.map → chunk-2HWO5TFV.js.map} +0 -0
- /package/dist/{chunk-PANH23MF.js.map → chunk-XZQH2M5I.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* @atomic-ui/ui version 0.
|
|
2
|
-
var
|
|
3
|
-
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
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`
|
|
1
|
+
/* @atomic-ui/ui version 0.7.0, standalone. */
|
|
2
|
+
var ce=globalThis,pe=ce.ShadowRoot&&(ce.ShadyCSS===void 0||ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),qt=new WeakMap,Y=class{constructor(e,i,r){if(this._$cssResult$=!0,r!==$t)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(pe&&e===void 0){let r=i!==void 0&&i.length===1;r&&(e=qt.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&qt.set(i,e))}return e}toString(){return this.cssText}},C=n=>new Y(typeof n=="string"?n:n+"",void 0,$t),p=(n,...e)=>{let i=n.length===1?n[0]:e.reduce((r,o,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.")})(o)+n[d+1],n[0]);return new Y(i,n,$t)},Pt=(n,e)=>{if(pe)n.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of e){let r=document.createElement("style"),o=ce.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=i.cssText,n.appendChild(r)}},yt=pe?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let i="";for(let r of e.cssRules)i+=r.cssText;return C(i)})(n):n;var{is:ni,defineProperty:li,getOwnPropertyDescriptor:di,getOwnPropertyNames:ci,getOwnPropertySymbols:pi,getPrototypeOf:hi}=Object,he=globalThis,Dt=he.trustedTypes,ui=Dt?Dt.emptyScript:"",mi=he.reactiveElementPolyfillSupport,G=(n,e)=>n,xt={toAttribute(n,e){switch(e){case Boolean:n=n?ui:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let i=n;switch(e){case Boolean:i=n!==null;break;case Number:i=n===null?null:Number(n);break;case Object:case Array:try{i=JSON.parse(n)}catch{i=null}}return i}},jt=(n,e)=>!ni(n,e),Ft={attribute:!0,type:String,converter:xt,reflect:!1,useDefault:!1,hasChanged:jt};Symbol.metadata??=Symbol("metadata"),he.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=Ft){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(),o=this.getPropertyDescriptor(e,r,i);o!==void 0&&li(this.prototype,e,o)}}static getPropertyDescriptor(e,i,r){let{get:o,set:d}=di(this.prototype,e)??{get(){return this[i]},set(h){this[i]=h}};return{get:o,set(h){let k=o?.call(this);d?.call(this,h),this.requestUpdate(e,k,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ft}static _$Ei(){if(this.hasOwnProperty(G("elementProperties")))return;let e=hi(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(G("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(G("properties"))){let i=this.properties,r=[...ci(i),...pi(i)];for(let o of r)this.createProperty(o,i[o])}let e=this[Symbol.metadata];if(e!==null){let i=litPropertyMetadata.get(e);if(i!==void 0)for(let[r,o]of i)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[i,r]of this.elementProperties){let o=this._$Eu(i,r);o!==void 0&&this._$Eh.set(o,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 o of r)i.unshift(yt(o))}else e!==void 0&&i.push(yt(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 Pt(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),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let d=(r.converter?.toAttribute!==void 0?r.converter:xt).toAttribute(i,r.type);this._$Em=e,d==null?this.removeAttribute(o):this.setAttribute(o,d),this._$Em=null}}_$AK(e,i){let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let d=r.getPropertyOptions(o),h=typeof d.converter=="function"?{fromAttribute:d.converter}:d.converter?.fromAttribute!==void 0?d.converter:xt;this._$Em=o;let k=h.fromAttribute(i,d.type);this[o]=k??this._$Ej?.get(o)??k,this._$Em=null}}requestUpdate(e,i,r,o=!1,d){if(e!==void 0){let h=this.constructor;if(o===!1&&(d=this[e]),r??=h.getPropertyOptions(e),!((r.hasChanged??jt)(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:o,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)),o===!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[o,d]of this._$Ep)this[o]=d;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,d]of r){let{wrapped:h}=d,k=this[o];h!==!0||this._$AL.has(o)||k===void 0||this.C(o,void 0,d,k)}}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[G("elementProperties")]=new Map,B[G("finalized")]=new Map,mi?.({ReactiveElement:B}),(he.reactiveElementVersions??=[]).push("2.1.2");var Mt=globalThis,Ut=n=>n,ue=Mt.trustedTypes,Wt=ue?ue.createPolicy("lit-html",{createHTML:n=>n}):void 0,Zt="$lit$",q=`lit$${Math.random().toFixed(9).slice(2)}$`,Jt="?"+q,gi=`<${Jt}>`,U=document,J=()=>U.createComment(""),Q=n=>n===null||typeof n!="object"&&typeof n!="function",Et=Array.isArray,bi=n=>Et(n)||typeof n?.[Symbol.iterator]=="function",kt=`[
|
|
3
|
+
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vt=/-->/g,Kt=/>/g,F=RegExp(`>|${kt}(?:([^\\s"'>=/]+)(${kt}*=${kt}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xt=/'/g,Yt=/"/g,Qt=/^(?:script|style|textarea|title)$/i,At=n=>(e,...i)=>({_$litType$:n,strings:e,values:i}),a=At(1),f=At(2),Pi=At(3),P=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Gt=new WeakMap,j=U.createTreeWalker(U,129);function ei(n,e){if(!Et(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wt!==void 0?Wt.createHTML(e):e}var fi=(n,e)=>{let i=n.length-1,r=[],o,d=e===2?"<svg>":e===3?"<math>":"",h=Z;for(let k=0;k<i;k++){let y=n[k],T,A,M=-1,H=0;for(;H<y.length&&(h.lastIndex=H,A=h.exec(y),A!==null);)H=h.lastIndex,h===Z?A[1]==="!--"?h=Vt:A[1]!==void 0?h=Kt:A[2]!==void 0?(Qt.test(A[2])&&(o=RegExp("</"+A[2],"g")),h=F):A[3]!==void 0&&(h=F):h===F?A[0]===">"?(h=o??Z,M=-1):A[1]===void 0?M=-2:(M=h.lastIndex-A[2].length,T=A[1],h=A[3]===void 0?F:A[3]==='"'?Yt:Xt):h===Yt||h===Xt?h=F:h===Vt||h===Kt?h=Z:(h=F,o=void 0);let O=h===F&&n[k+1].startsWith("/>")?" ":"";d+=h===Z?y+gi:M>=0?(r.push(T),y.slice(0,M)+Zt+y.slice(M)+q+O):y+q+(M===-2?k:O)}return[ei(n,d+(n[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ee=class n{constructor({strings:e,_$litType$:i},r){let o;this.parts=[];let d=0,h=0,k=e.length-1,y=this.parts,[T,A]=fi(e,i);if(this.el=n.createElement(T,r),j.currentNode=this.el.content,i===2||i===3){let M=this.el.content.firstChild;M.replaceWith(...M.childNodes)}for(;(o=j.nextNode())!==null&&y.length<k;){if(o.nodeType===1){if(o.hasAttributes())for(let M of o.getAttributeNames())if(M.endsWith(Zt)){let H=A[h++],O=o.getAttribute(M).split(q),de=/([.?@])?(.*)/.exec(H);y.push({type:1,index:d,name:de[2],strings:O,ctor:de[1]==="."?wt:de[1]==="?"?St:de[1]==="@"?Tt:X}),o.removeAttribute(M)}else M.startsWith(q)&&(y.push({type:6,index:d}),o.removeAttribute(M));if(Qt.test(o.tagName)){let M=o.textContent.split(q),H=M.length-1;if(H>0){o.textContent=ue?ue.emptyScript:"";for(let O=0;O<H;O++)o.append(M[O],J()),j.nextNode(),y.push({type:2,index:++d});o.append(M[H],J())}}}else if(o.nodeType===8)if(o.data===Jt)y.push({type:2,index:d});else{let M=-1;for(;(M=o.data.indexOf(q,M+1))!==-1;)y.push({type:7,index:d}),M+=q.length-1}d++}}static createElement(e,i){let r=U.createElement("template");return r.innerHTML=e,r}};function K(n,e,i=n,r){if(e===P)return e;let o=r!==void 0?i._$Co?.[r]:i._$Cl,d=Q(e)?void 0:e._$litDirective$;return o?.constructor!==d&&(o?._$AO?.(!1),d===void 0?o=void 0:(o=new d(n),o._$AT(n,i,r)),r!==void 0?(i._$Co??=[])[r]=o:i._$Cl=o),o!==void 0&&(e=K(n,o._$AS(n,e.values),o,r)),e}var vt=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,o=(e?.creationScope??U).importNode(i,!0);j.currentNode=o;let d=j.nextNode(),h=0,k=0,y=r[0];for(;y!==void 0;){if(h===y.index){let T;y.type===2?T=new te(d,d.nextSibling,this,e):y.type===1?T=new y.ctor(d,y.name,y.strings,this,e):y.type===6&&(T=new zt(d,this,e)),this._$AV.push(T),y=r[++k]}h!==y?.index&&(d=j.nextNode(),h++)}return j.currentNode=U,o}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 n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,i,r,o){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=r,this.options=o,this._$Cv=o?.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=K(this,e,i),Q(e)?e===l||e==null||e===""?(this._$AH!==l&&this._$AR(),this._$AH=l):e!==this._$AH&&e!==P&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bi(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,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ee.createElement(ei(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(i);else{let d=new vt(o,this),h=d.u(this.options);d.p(i),this.T(h),this._$AH=d}}_$AC(e){let i=Gt.get(e.strings);return i===void 0&&Gt.set(e.strings,i=new ee(e)),i}k(e){Et(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,r,o=0;for(let d of e)o===i.length?i.push(r=new n(this.O(J()),this.O(J()),this,this.options)):r=i[o],r._$AI(d),o++;o<i.length&&(this._$AR(r&&r._$AB.nextSibling,o),i.length=o)}_$AR(e=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);e!==this._$AB;){let r=Ut(e).nextSibling;Ut(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,o,d){this.type=1,this._$AH=l,this._$AN=void 0,this.element=e,this.name=i,this._$AM=o,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,o){let d=this.strings,h=!1;if(d===void 0)e=K(this,e,i,0),h=!Q(e)||e!==this._$AH&&e!==P,h&&(this._$AH=e);else{let k=e,y,T;for(e=d[0],y=0;y<d.length-1;y++)T=K(this,k[r+y],i,y),T===P&&(T=this._$AH[y]),h||=!Q(T)||T!==this._$AH[y],T===l?e=l:e!==l&&(e+=(T??"")+d[y+1]),this._$AH[y]=T}h&&!o&&this.j(e)}j(e){e===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},wt=class extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===l?void 0:e}},St=class extends X{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==l)}},Tt=class extends X{constructor(e,i,r,o,d){super(e,i,r,o,d),this.type=5}_$AI(e,i=this){if((e=K(this,e,i,0)??l)===P)return;let r=this._$AH,o=e===l&&r!==l||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,d=e!==l&&(r===l||o);o&&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)}},zt=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){K(this,e)}};var $i=Mt.litHtmlPolyfillSupport;$i?.(ee,te),(Mt.litHtmlVersions??=[]).push("3.3.3");var Ct=(n,e,i)=>{let r=i?.renderBefore??e,o=r._$litPart$;if(o===void 0){let d=i?.renderBefore??null;r._$litPart$=o=new te(e.insertBefore(J(),d),d,void 0,i??{})}return o._$AI(n),o};var Lt=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=Ct(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return P}};N._$litElement$=!0,N.finalized=!0,Lt.litElementHydrateSupport?.({LitElement:N});var yi=Lt.litElementPolyfillSupport;yi?.({LitElement:N});(Lt.litElementVersions??=[]).push("4.2.2");var u=(n,e)=>C(`var(--impakt-${n.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:C("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)"),rule:C("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)"),wash:C("color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)"),brandHalo:C("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")},$=n=>C(`font-size: var(--impakt-font-size-${n}, 1rem); line-height: var(--impakt-font-leading-${n}, 1.5);`),s=n=>u(`space.${String(n).replace(".","-")}`,`${n*4}px`),g=n=>u(`font.size.${n}`,"1rem"),R=n=>u(`font.line-height.${n}`,"1.5"),m=n=>u(`font.weight.${n}`,"400"),L=p`
|
|
5
5
|
:host([space-above='sm']) { margin-block-start: ${s(2)}; }
|
|
6
6
|
:host([space-above='md']) { margin-block-start: ${s(4)}; }
|
|
7
7
|
:host([space-above='lg']) { margin-block-start: ${s(6)}; }
|
|
@@ -12,17 +12,17 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
12
12
|
:host([space-below='lg']) { margin-block-end: ${s(6)}; }
|
|
13
13
|
:host([space-below='xl']) { margin-block-end: ${s(8)}; }
|
|
14
14
|
:host([space-below='2xl']) { margin-block-end: clamp(${s(14)}, 8vw, ${s(28)}); }
|
|
15
|
-
`;var
|
|
15
|
+
`;var x=p`
|
|
16
16
|
:host(:focus-visible),
|
|
17
17
|
:host(:not([disabled])) :focus-visible {
|
|
18
18
|
outline: 2px solid transparent;
|
|
19
19
|
outline-offset: ${t.focusOffset};
|
|
20
20
|
box-shadow: ${t.focusShadow};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,w=p`
|
|
23
23
|
min-block-size: ${t.targetMin};
|
|
24
24
|
min-inline-size: ${t.targetMin};
|
|
25
|
-
`,
|
|
25
|
+
`,z=p`
|
|
26
26
|
position: absolute;
|
|
27
27
|
inline-size: 1px;
|
|
28
28
|
block-size: 1px;
|
|
@@ -32,7 +32,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
32
32
|
clip-path: inset(50%);
|
|
33
33
|
white-space: nowrap;
|
|
34
34
|
border: 0;
|
|
35
|
-
`,
|
|
35
|
+
`,ti=p`
|
|
36
36
|
@media (prefers-reduced-motion: reduce) {
|
|
37
37
|
:host,
|
|
38
38
|
:host *,
|
|
@@ -44,7 +44,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
44
44
|
scroll-behavior: auto !important;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,ii=p`
|
|
48
48
|
:host {
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
font-family: ${t.fontBody};
|
|
@@ -58,15 +58,15 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
58
58
|
*::after {
|
|
59
59
|
box-sizing: inherit;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,E=n=>C(`@media (pointer: coarse) { :host :is(${n}) { min-block-size: 44px; min-inline-size: 44px; } }`),ri=p`
|
|
62
62
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }
|
|
63
63
|
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }
|
|
64
|
-
`;var
|
|
64
|
+
`;var xi=Symbol.for("strata.wording");function v(n,e){let r=globalThis[xi]?.words?.[n],o=typeof r=="string"&&r.trim()?r:n;return e?o.replace(/\{(\w+)\}/g,(d,h)=>h in e?String(e[h]):d):o}var ki=0,c=class extends N{constructor(){super(...arguments);this.uid=`impakt-${ki+=1}`}static{this.styles=[ii,ti,p``]}id_(i){return`${this.uid}-${i}`}connectedCallback(){super.connectedCallback(),this.sayDefaults()}sayDefaults(){let i=this.constructor.elementProperties,r=this;for(let o of i.keys()){let d=r[o];if(typeof d!="string"||!d)continue;let h=v(d);h!==d&&(r[o]=h)}}};var Rt={"arrow-right":f`<path d="M5 12h14M13 6l6 6-6 6"/>`,"arrow-left":f`<path d="M19 12H5M11 6l-6 6 6 6"/>`,"chevron-right":f`<path d="M9 6l6 6-6 6"/>`,"chevron-down":f`<path d="M6 9l6 6 6-6"/>`,check:f`<path d="M5 12.5l4.5 4.5L19 7"/>`,close:f`<path d="M6 6l12 12M18 6L6 18"/>`,menu:f`<path d="M4 7h16M4 12h16M4 17h16"/>`,"menu-two":f`<path d="M5 9.5h14M5 14.5h14"/>`,plus:f`<path d="M12 5v14M5 12h14"/>`,minus:f`<path d="M5 12h14"/>`,search:f`<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>`,external:f`<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:f`<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>`,home:f`<path d="M4 11l8-7 8 7M6 9.5V20h12V9.5"/><path d="M10 20v-6h4v6"/>`,phone:f`<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:f`<rect x="3.5" y="5.5" width="17" height="13" rx="1.5"/><path d="M4 7l8 6 8-6"/>`,"map-pin":f`<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:f`<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:f`<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>`,user:f`<circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/>`,star:f`<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:f`<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:f`<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:f`<path d="M5 19c0-8 5-13 14-14 0 9-5 14-13 14z"/><path d="M5 19l7-7"/>`,sun:f`<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:f`<path d="M13 3L5 13.5h6L10 21l8-10.5h-6z"/>`,key:f`<circle cx="8" cy="15" r="3.5"/><path d="M10.5 12.5L19 4M16 7l2.5 2.5M14 9l2 2"/>`,info:f`<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.5v.5"/>`,warning:f`<path d="M12 4l9 15.5H3z"/><path d="M12 10v4M12 16.5v.5"/>`,document:f`<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:f`<path d="M16 6.5a3.5 3.5 0 0 0-6.5 1.8V20M7 13h7M7 20h10"/>`,chat:f`<path d="M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z"/>`,grid:f`<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/>`,clipboard:f`<rect x="8" y="2" width="8" height="4" rx="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2M12 11h4M12 16h4M8 11h.01M8 16h.01"/>`,"map-pinned":f`<path d="M18 8c0 3.6-3.9 7.4-5.4 8.8a1 1 0 0 1-1.2 0C9.9 15.4 6 11.6 6 8a6 6 0 0 1 12 0"/><circle cx="12" cy="8" r="2"/><path d="M8.7 14H5a1 1 0 0 0-.9.7l-2 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .9-1.3l-2-6a1 1 0 0 0-.9-.7h-3.7"/>`,users:f`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8"/>`,radio:f`<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5M19.1 4.9C23 8.8 23 15.1 19.1 19"/><circle cx="12" cy="12" r="2"/>`,settings:f`<path d="M12.2 2h-.4a2 2 0 0 0-2 2v.2a2 2 0 0 1-1 1.7l-.4.3a2 2 0 0 1-2 0l-.2-.1a2 2 0 0 0-2.7.7l-.2.4a2 2 0 0 0 .7 2.7l.2.1a2 2 0 0 1 1 1.7v.5a2 2 0 0 1-1 1.8l-.2.1a2 2 0 0 0-.7 2.7l.2.4a2 2 0 0 0 2.7.7l.2-.1a2 2 0 0 1 2 0l.4.3a2 2 0 0 1 1 1.7v.2a2 2 0 0 0 2 2h.4a2 2 0 0 0 2-2v-.2a2 2 0 0 1 1-1.7l.4-.3a2 2 0 0 1 2 0l.2.1a2 2 0 0 0 2.7-.7l.2-.4a2 2 0 0 0-.7-2.7l-.2-.1a2 2 0 0 1-1-1.8v-.5a2 2 0 0 1 1-1.7l.2-.1a2 2 0 0 0 .7-2.7l-.2-.4a2 2 0 0 0-2.7-.7l-.2.1a2 2 0 0 1-2 0l-.4-.3a2 2 0 0 1-1-1.7V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,"log-out":f`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"/>`,"arrow-up-right":f`<path d="M7 7h10v10M7 17L17 7"/>`,more:f`<circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/>`,upload:f`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"/>`,image:f`<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="M21 15l-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/>`,lock:f`<rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,eye:f`<path d="M2.1 12.3a1 1 0 0 1 0-.7 10.8 10.8 0 0 1 19.8 0 1 1 0 0 1 0 .7 10.8 10.8 0 0 1-19.8 0"/><circle cx="12" cy="12" r="3"/>`,trash:f`<path d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2M10 11v6M14 11v6"/>`,pencil:f`<path d="M21.2 6.8a1 1 0 0 0-4-4L3.8 16.2a2 2 0 0 0-.5.8L2 21.4a.5.5 0 0 0 .6.6l4.4-1.3a2 2 0 0 0 .8-.5zM15 5l4 4"/>`,"qr-code":f`<rect x="3" y="3" width="5" height="5" rx="1"/><rect x="16" y="3" width="5" height="5" rx="1"/><rect x="3" y="16" width="5" height="5" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3M21 21v.01M12 7v3a2 2 0 0 1-2 2H7M3 12h.01M12 3h.01M12 16v.01M16 12h1M21 12v.01M12 21v-1"/>`,battery:f`<rect x="2" y="7" width="16" height="10" rx="2"/><path d="M22 11v2M6 11v2M10 11v2"/>`},vi=Object.keys(Rt);function S(n,e="1.25em"){let i=n?Rt[n]:void 0;return i?a`<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 me=class extends c{static{this.properties={name:{type:String,reflect:!0},label:{type:String},size:{type:String,reflect:!0},tone:{type:String,reflect:!0}}}constructor(){super(),this.name="star",this.label="",this.size="md",this.tone="inherit"}static{this.styles=[...c.styles,p`
|
|
65
65
|
:host { display: inline-flex; vertical-align: middle; line-height: 0; }
|
|
66
66
|
:host([tone='brand']) { color: ${t.brand}; }
|
|
67
67
|
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
68
68
|
@media (forced-colors: active) { :host { color: CanvasText; } }
|
|
69
|
-
`]}render(){let e={sm:"16px",md:"24px",lg:"32px",xl:"48px"}[this.size]??"24px",i=
|
|
69
|
+
`]}render(){let e={sm:"16px",md:"24px",lg:"32px",xl:"48px"}[this.size]??"24px",i=S(this.name,e);return this.label?a`<span role="img" aria-label=${this.label}>${i}</span>`:a`${i}`}};customElements.define("impakt-icon",me);var ge=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="",this.icon="none",this.label="";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},icon:{type:String},label:{type:String}}}static{this.styles=[...c.styles,x,E("button, a"),p`
|
|
70
70
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
71
71
|
:host {
|
|
72
72
|
display: inline-block;
|
|
@@ -76,7 +76,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
76
76
|
}
|
|
77
77
|
@media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }
|
|
78
78
|
button, a {
|
|
79
|
-
${
|
|
79
|
+
${w}
|
|
80
80
|
box-sizing: border-box;
|
|
81
81
|
text-decoration: none;
|
|
82
82
|
display: inline-flex;
|
|
@@ -87,15 +87,15 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
87
87
|
min-block-size: 40px;
|
|
88
88
|
padding: ${s(2)} ${s(4)};
|
|
89
89
|
font-family: inherit;
|
|
90
|
-
${
|
|
90
|
+
${$("sm")}
|
|
91
91
|
font-weight: ${m("semibold")};
|
|
92
92
|
border-radius: ${t.radiusLg};
|
|
93
93
|
border: ${t.borderThin} solid transparent;
|
|
94
94
|
cursor: pointer;
|
|
95
95
|
transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
96
96
|
}
|
|
97
|
-
:host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${s(1)} ${s(3)}; ${
|
|
98
|
-
:host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${s(3)} ${s(6)}; ${
|
|
97
|
+
:host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${s(1)} ${s(3)}; ${$("sm")} gap: ${s(1.5)}; }
|
|
98
|
+
:host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${s(3)} ${s(6)}; ${$("md")} }
|
|
99
99
|
.icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }
|
|
100
100
|
/* The cursor is the only thing that changes while busy. Moving or
|
|
101
101
|
recolouring a control the moment it is pressed is how a user loses it. */
|
|
@@ -146,8 +146,56 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
146
146
|
background: ${t.wash};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/* Dark: the text colour as a fill, the strong second choice on a light page. */
|
|
150
|
+
.dark {
|
|
151
|
+
background: ${t.text};
|
|
152
|
+
color: ${t.surfaceCard};
|
|
153
|
+
}
|
|
154
|
+
.dark:hover:not([aria-disabled='true']) {
|
|
155
|
+
background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 14%);
|
|
156
|
+
}
|
|
157
|
+
.dark:active:not([aria-disabled='true']) {
|
|
158
|
+
background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 24%);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Subtle: a quiet fill, for an action that sits beside the main one. */
|
|
162
|
+
.subtle {
|
|
163
|
+
background: ${t.surfaceInset};
|
|
164
|
+
color: ${t.text};
|
|
165
|
+
}
|
|
166
|
+
.subtle:hover:not([aria-disabled='true']) {
|
|
167
|
+
background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 6%);
|
|
168
|
+
}
|
|
169
|
+
.subtle:active:not([aria-disabled='true']) {
|
|
170
|
+
background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 12%);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Danger: the danger text colour as a fill, so white words on it keep 4.5:1. */
|
|
174
|
+
.danger {
|
|
175
|
+
background: ${t.dangerText};
|
|
176
|
+
color: ${t.surfaceCard};
|
|
177
|
+
}
|
|
178
|
+
.danger:hover:not([aria-disabled='true']) {
|
|
179
|
+
background: color-mix(in srgb, ${t.dangerText}, ${t.text} 15%);
|
|
180
|
+
}
|
|
181
|
+
.danger:active:not([aria-disabled='true']) {
|
|
182
|
+
background: color-mix(in srgb, ${t.dangerText}, ${t.text} 28%);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Icon only: a round button as tall as it is wide. */
|
|
186
|
+
.icon-only {
|
|
187
|
+
inline-size: 40px;
|
|
188
|
+
min-inline-size: 40px;
|
|
189
|
+
block-size: 40px;
|
|
190
|
+
min-block-size: 40px;
|
|
191
|
+
padding: 0;
|
|
192
|
+
border-radius: 999px;
|
|
193
|
+
}
|
|
194
|
+
:host([size='sm']) .icon-only { inline-size: 32px; min-inline-size: 32px; block-size: 32px; min-block-size: 32px; padding: 0; }
|
|
195
|
+
:host([size='lg']) .icon-only { inline-size: 48px; min-inline-size: 48px; block-size: 48px; min-block-size: 48px; padding: 0; }
|
|
196
|
+
|
|
149
197
|
.sr-only {
|
|
150
|
-
${
|
|
198
|
+
${z}
|
|
151
199
|
}
|
|
152
200
|
|
|
153
201
|
/* Windows High Contrast Mode drops background and border colours, so a
|
|
@@ -158,7 +206,21 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
158
206
|
border-color: ButtonBorder;
|
|
159
207
|
}
|
|
160
208
|
}
|
|
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
|
|
209
|
+
`]}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=!!(this.icon&&this.icon!=="none"&&this.label),r=i?`${this.variant} icon-only`:this.variant;if(i){let d=S(this.icon);return this.href&&!this.disabled?a`<a class=${r} href=${this.href} part="button" aria-label=${this.label}>${d}</a>`:a`
|
|
210
|
+
<button
|
|
211
|
+
class=${r}
|
|
212
|
+
type="button"
|
|
213
|
+
part="button"
|
|
214
|
+
aria-label=${this.label}
|
|
215
|
+
?disabled=${this.disabled}
|
|
216
|
+
aria-disabled=${this.busy?"true":l}
|
|
217
|
+
aria-busy=${this.busy?"true":l}
|
|
218
|
+
@click=${this.onClick}
|
|
219
|
+
>
|
|
220
|
+
${d}
|
|
221
|
+
${this.busy?a`<span class="sr-only">${this.busyLabel}</span>`:l}
|
|
222
|
+
</button>
|
|
223
|
+
`}let o=a`${S(this.iconBefore)}<slot></slot>${this.iconAfter&&this.iconAfter!=="none"?a`<span class="after" aria-hidden="true">${S(this.iconAfter)}</span>`:l}`;return this.href&&!this.disabled?a`<a class=${this.variant} href=${this.href} part="button">${o}</a>`:a`
|
|
162
224
|
<button
|
|
163
225
|
class=${this.variant}
|
|
164
226
|
type="button"
|
|
@@ -168,16 +230,16 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
168
230
|
aria-busy=${this.busy?"true":l}
|
|
169
231
|
@click=${this.onClick}
|
|
170
232
|
>
|
|
171
|
-
${
|
|
172
|
-
${this.busy?
|
|
233
|
+
${o}
|
|
234
|
+
${this.busy?a`<span class="sr-only">${this.busyLabel}</span>`:l}
|
|
173
235
|
</button>
|
|
174
|
-
`}};customElements.define("impakt-button",
|
|
236
|
+
`}};customElements.define("impakt-button",ge);var I=p`
|
|
175
237
|
:host { --impakt-field-width: 100%; }
|
|
176
238
|
:host([width='xs']) { --impakt-field-width: 8ch; }
|
|
177
239
|
:host([width='sm']) { --impakt-field-width: 14ch; }
|
|
178
240
|
:host([width='md']) { --impakt-field-width: 24ch; }
|
|
179
241
|
:host([width='lg']) { --impakt-field-width: 40ch; }
|
|
180
|
-
`,
|
|
242
|
+
`,b=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,x,p`
|
|
181
243
|
:host {
|
|
182
244
|
display: block;
|
|
183
245
|
margin-block-end: ${s(4)};
|
|
@@ -186,7 +248,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
186
248
|
display: block;
|
|
187
249
|
font-size: ${g("sm")};
|
|
188
250
|
font-weight: ${m("semibold")};
|
|
189
|
-
line-height: ${
|
|
251
|
+
line-height: ${R("normal")};
|
|
190
252
|
margin-block-end: ${s(1)};
|
|
191
253
|
color: ${t.text};
|
|
192
254
|
}
|
|
@@ -196,13 +258,13 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
196
258
|
}
|
|
197
259
|
.description {
|
|
198
260
|
font-size: ${g("sm")};
|
|
199
|
-
line-height: ${
|
|
261
|
+
line-height: ${R("normal")};
|
|
200
262
|
color: ${t.textMuted};
|
|
201
263
|
margin-block-end: ${s(2)};
|
|
202
264
|
}
|
|
203
265
|
.error {
|
|
204
266
|
font-size: ${g("sm")};
|
|
205
|
-
line-height: ${
|
|
267
|
+
line-height: ${R("normal")};
|
|
206
268
|
color: ${t.dangerText};
|
|
207
269
|
margin-block-start: ${s(1)};
|
|
208
270
|
display: flex;
|
|
@@ -212,7 +274,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
212
274
|
display: none;
|
|
213
275
|
}
|
|
214
276
|
.visually-hidden {
|
|
215
|
-
${
|
|
277
|
+
${z}
|
|
216
278
|
}
|
|
217
279
|
/*
|
|
218
280
|
* Only the control is dimmed. Dimming the whole host took the question,
|
|
@@ -224,13 +286,13 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
224
286
|
opacity: 0.6;
|
|
225
287
|
cursor: not-allowed;
|
|
226
288
|
}
|
|
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
|
|
289
|
+
`]}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 a`
|
|
228
290
|
<label class="label" for=${this.controlId} part="label">
|
|
229
|
-
${this.label}${this.required?
|
|
291
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
230
292
|
</label>
|
|
231
|
-
`}render(){return
|
|
293
|
+
`}render(){return a`
|
|
232
294
|
${this.renderLabel()}
|
|
233
|
-
${this.description?
|
|
295
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">
|
|
234
296
|
${this.description}
|
|
235
297
|
</div>`:l}
|
|
236
298
|
${this.renderControl()}
|
|
@@ -249,7 +311,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
249
311
|
>
|
|
250
312
|
${this.error||l}
|
|
251
313
|
</div>
|
|
252
|
-
`}setFormValue(i){this.value=i,this.internals?.setFormValue(i),this.dispatchEvent(new CustomEvent("impakt-change",{detail:{value:i},bubbles:!0,composed:!0}))}};var
|
|
314
|
+
`}setFormValue(i){this.value=i,this.internals?.setFormValue(i),this.dispatchEvent(new CustomEvent("impakt-change",{detail:{value:i},bubbles:!0,composed:!0}))}};var be=class extends b{static{this.properties={...b.properties,width:{type:String,reflect:!0},type:{type:String},placeholder:{type:String},autocomplete:{type:String},inputmode:{type:String},maxlength:{type:Number},hideLabel:{type:Boolean,attribute:"hide-label",reflect:!0}}}constructor(){super(),this.width="full",this.type="text",this.placeholder="",this.autocomplete="",this.inputmode="",this.maxlength=void 0,this.hideLabel=!1}static{this.styles=[...b.styles,I,p`
|
|
253
315
|
input {
|
|
254
316
|
inline-size: min(100%, var(--impakt-field-width));
|
|
255
317
|
min-block-size: 44px;
|
|
@@ -280,11 +342,37 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
280
342
|
}
|
|
281
343
|
/* The border thickens as well as reddening. Colour alone would carry the
|
|
282
344
|
error, which 1.4.1 forbids — and the message below says it in words. */
|
|
345
|
+
:host([hide-label]) .label {
|
|
346
|
+
position: absolute;
|
|
347
|
+
inline-size: 1px;
|
|
348
|
+
block-size: 1px;
|
|
349
|
+
overflow: hidden;
|
|
350
|
+
clip-path: inset(50%);
|
|
351
|
+
white-space: nowrap;
|
|
352
|
+
}
|
|
353
|
+
.search {
|
|
354
|
+
position: relative;
|
|
355
|
+
display: block;
|
|
356
|
+
inline-size: min(100%, var(--impakt-field-width));
|
|
357
|
+
}
|
|
358
|
+
.search input {
|
|
359
|
+
inline-size: 100%;
|
|
360
|
+
padding-inline-start: ${s(10)};
|
|
361
|
+
border-radius: 999px;
|
|
362
|
+
}
|
|
363
|
+
.search .icon {
|
|
364
|
+
position: absolute;
|
|
365
|
+
inset-inline-start: ${s(3.5)};
|
|
366
|
+
inset-block-start: 50%;
|
|
367
|
+
transform: translateY(-50%);
|
|
368
|
+
color: ${t.textMuted};
|
|
369
|
+
pointer-events: none;
|
|
370
|
+
}
|
|
283
371
|
:host([invalid]) input {
|
|
284
372
|
border-color: ${t.danger};
|
|
285
373
|
border-width: ${t.borderThick};
|
|
286
374
|
}
|
|
287
|
-
`]}renderControl(){return
|
|
375
|
+
`]}renderControl(){let e=this.renderInput();return this.type==="search"?a`<span class="search" part="search">${S("search","20px")}${e}</span>`:e}renderInput(){return a`
|
|
288
376
|
<input
|
|
289
377
|
id=${this.controlId}
|
|
290
378
|
part="input"
|
|
@@ -302,7 +390,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
302
390
|
aria-invalid=${this.error?"true":l}
|
|
303
391
|
@input=${e=>this.setFormValue(e.target.value)}
|
|
304
392
|
/>
|
|
305
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-text-input",
|
|
393
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-text-input",be);var fe=class extends b{static{this.properties={...b.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=[...b.styles,I,p`
|
|
306
394
|
select {
|
|
307
395
|
inline-size: min(100%, var(--impakt-field-width));
|
|
308
396
|
min-block-size: 44px;
|
|
@@ -332,7 +420,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
332
420
|
border-color: ${t.danger};
|
|
333
421
|
border-width: ${t.borderThick};
|
|
334
422
|
}
|
|
335
|
-
`]}renderControl(){return
|
|
423
|
+
`]}renderControl(){return a`
|
|
336
424
|
<select
|
|
337
425
|
id=${this.controlId}
|
|
338
426
|
part="select"
|
|
@@ -344,9 +432,9 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
344
432
|
@change=${e=>this.setFormValue(e.target.value)}
|
|
345
433
|
>
|
|
346
434
|
<option value="" ?selected=${!this.value}>${this.placeholder}</option>
|
|
347
|
-
${this.options.map(e=>
|
|
435
|
+
${this.options.map(e=>a`<option value=${e.value} ?selected=${this.value===e.value}>${e.label}</option>`)}
|
|
348
436
|
</select>
|
|
349
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-select",
|
|
437
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-select",fe);var $e=class extends b{static{this.properties={...b.properties,checked:{type:Boolean,reflect:!0}}}constructor(){super(),this.checked=!1}static{this.styles=[...b.styles,E(".row"),p`
|
|
350
438
|
.row {
|
|
351
439
|
display: flex;
|
|
352
440
|
align-items: flex-start;
|
|
@@ -354,7 +442,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
354
442
|
cursor: pointer;
|
|
355
443
|
}
|
|
356
444
|
input {
|
|
357
|
-
${
|
|
445
|
+
${w}
|
|
358
446
|
inline-size: 20px;
|
|
359
447
|
block-size: 20px;
|
|
360
448
|
margin: 0;
|
|
@@ -367,7 +455,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
367
455
|
:host([invalid]) .row {
|
|
368
456
|
color: ${t.dangerText};
|
|
369
457
|
}
|
|
370
|
-
`]}renderControl(){return
|
|
458
|
+
`]}renderControl(){return a`
|
|
371
459
|
<label class="row" part="row" for=${this.controlId}>
|
|
372
460
|
<input
|
|
373
461
|
type="checkbox"
|
|
@@ -382,10 +470,508 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
382
470
|
@change=${e=>{this.checked=e.target.checked,this.setFormValue(this.checked?"on":"")}}
|
|
383
471
|
/>
|
|
384
472
|
<span class="text">
|
|
385
|
-
${this.label}${this.required?
|
|
473
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
386
474
|
</span>
|
|
387
475
|
</label>
|
|
388
|
-
`}renderLabel(){return
|
|
476
|
+
`}renderLabel(){return a`${l}`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-checkbox",$e);var wi=C("48rem");function si(n){if(!n||n.startsWith("#"))return null;try{let e=typeof location>"u"?"http://localhost/":location.href;return new URL(n,e).pathname.replace(/\/$/,"")||"/"}catch{return null}}function _t(n,e){let i=si(n);if(!i)return!1;let r=si(e||(typeof location>"u"?"":location.pathname));return r?i===r?!0:i!=="/"&&r.startsWith(`${i}/`):!1}function ie(n,e,i){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let r=new CustomEvent("impakt-navigate",{detail:{href:i.href,id:i.id??i.href},bubbles:!0,composed:!0,cancelable:!0});n.dispatchEvent(r)||e.preventDefault()}var ye=class extends c{constructor(){super();this.footerFilled=!1;this.items=[],this.label="Main",this.current=""}static{this.properties={items:{type:Array},label:{type:String},current:{type:String}}}static{this.styles=[...c.styles,x,p`
|
|
477
|
+
:host { display: flex; flex-direction: column; gap: ${s(5)}; block-size: 100%; }
|
|
478
|
+
.card { padding: ${s(2)}; border-radius: ${t.radiusXl}; background: ${t.surfaceCard}; }
|
|
479
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${s(.5)}; }
|
|
480
|
+
a {
|
|
481
|
+
${w}
|
|
482
|
+
display: flex;
|
|
483
|
+
align-items: center;
|
|
484
|
+
gap: ${s(3)};
|
|
485
|
+
min-block-size: 44px;
|
|
486
|
+
padding: 0 ${s(3.5)};
|
|
487
|
+
border-radius: ${t.radiusLg};
|
|
488
|
+
color: ${t.text};
|
|
489
|
+
font-size: ${g("md")};
|
|
490
|
+
font-weight: ${m("medium")};
|
|
491
|
+
text-decoration: none;
|
|
492
|
+
transition: background-color 120ms ease-in-out, color 120ms ease-in-out;
|
|
493
|
+
}
|
|
494
|
+
a:hover { background: ${t.surfaceInset}; }
|
|
495
|
+
a[aria-current='page'] { background: ${t.text}; color: ${t.surfaceCard}; }
|
|
496
|
+
.icon { flex: none; }
|
|
497
|
+
.footer { margin-block-start: auto; }
|
|
498
|
+
.footer.empty { display: none; }
|
|
499
|
+
@media (prefers-reduced-motion: reduce) { a { transition: none; } }
|
|
500
|
+
@media (forced-colors: active) { a[aria-current='page'] { border: 2px solid Highlight; } }
|
|
501
|
+
`]}onFooter(i){let r=i.target;this.footerFilled=r.assignedNodes({flatten:!0}).some(o=>o.nodeType===Node.ELEMENT_NODE||(o.textContent??"").trim()!==""),this.requestUpdate()}render(){return a`
|
|
502
|
+
<nav class="card" aria-label=${this.label} part="nav">
|
|
503
|
+
<ul part="list">
|
|
504
|
+
${this.items.map(i=>a`
|
|
505
|
+
<li>
|
|
506
|
+
<a
|
|
507
|
+
href=${i.href}
|
|
508
|
+
part="link"
|
|
509
|
+
aria-current=${_t(i.href,this.current)?"page":l}
|
|
510
|
+
@click=${r=>ie(this,r,i)}
|
|
511
|
+
>${S(i.icon,"20px")}<span>${i.label}</span></a>
|
|
512
|
+
</li>
|
|
513
|
+
`)}
|
|
514
|
+
</ul>
|
|
515
|
+
</nav>
|
|
516
|
+
<div class="card footer ${this.footerFilled?"":"empty"}" part="footer"><slot name="footer" @slotchange=${this.onFooter}></slot></div>
|
|
517
|
+
`}},xe=class extends c{static{this.properties={items:{type:Array},label:{type:String},current:{type:String}}}constructor(){super(),this.items=[],this.label="Main",this.current=""}static{this.styles=[...c.styles,x,p`
|
|
518
|
+
:host { display: block; }
|
|
519
|
+
nav { padding: ${s(1.5)}; border-radius: ${t.radiusXl}; background: ${t.text}; box-shadow: ${t.shadowLg}; }
|
|
520
|
+
ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${s(1)}; }
|
|
521
|
+
li { flex: 1 1 0; min-inline-size: 0; }
|
|
522
|
+
a {
|
|
523
|
+
display: flex;
|
|
524
|
+
flex-direction: column;
|
|
525
|
+
align-items: center;
|
|
526
|
+
justify-content: center;
|
|
527
|
+
gap: ${s(1)};
|
|
528
|
+
min-block-size: 50px;
|
|
529
|
+
padding: ${s(1)};
|
|
530
|
+
border-radius: ${t.radiusLg};
|
|
531
|
+
/* The resting items are a blend of the card and text colours that keeps 4.5:1 on the bar. */
|
|
532
|
+
color: color-mix(in srgb, ${t.surfaceCard} 74%, ${t.text});
|
|
533
|
+
font-size: 11px;
|
|
534
|
+
font-weight: ${m("medium")};
|
|
535
|
+
line-height: 1.25;
|
|
536
|
+
text-decoration: none;
|
|
537
|
+
text-align: center;
|
|
538
|
+
}
|
|
539
|
+
a:hover { color: ${t.surfaceCard}; }
|
|
540
|
+
a[aria-current='page'] { background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 16%); color: ${t.surfaceCard}; }
|
|
541
|
+
span.word { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
542
|
+
@media (forced-colors: active) { a[aria-current='page'] { border: 2px solid Highlight; } }
|
|
543
|
+
`]}render(){return a`
|
|
544
|
+
<nav aria-label=${this.label} part="nav">
|
|
545
|
+
<ul part="list">
|
|
546
|
+
${this.items.map(e=>a`
|
|
547
|
+
<li>
|
|
548
|
+
<a
|
|
549
|
+
href=${e.href}
|
|
550
|
+
part="link"
|
|
551
|
+
aria-current=${_t(e.href,this.current)?"page":l}
|
|
552
|
+
@click=${i=>ie(this,i,e)}
|
|
553
|
+
>${S(e.icon,"22px")}<span class="word">${e.label}</span></a>
|
|
554
|
+
</li>
|
|
555
|
+
`)}
|
|
556
|
+
</ul>
|
|
557
|
+
</nav>
|
|
558
|
+
`}},ke=class extends c{static{this.properties={skipText:{type:String,attribute:"skip-text"},topBarLabel:{type:String,attribute:"top-bar-label"}}}constructor(){super(),this.skipText="Skip to content",this.topBarLabel=""}static{this.styles=[...c.styles,x,p`
|
|
559
|
+
:host {
|
|
560
|
+
display: block;
|
|
561
|
+
min-block-size: 100svh;
|
|
562
|
+
background: var(--impakt-shell-canvas, ${t.surfaceInset});
|
|
563
|
+
color: ${t.text};
|
|
564
|
+
/* The text and card colours, kept before the phone header turns them round. */
|
|
565
|
+
--impakt-shell-ink: ${t.text};
|
|
566
|
+
--impakt-shell-paper: ${t.surfaceCard};
|
|
567
|
+
}
|
|
568
|
+
.frame {
|
|
569
|
+
position: relative;
|
|
570
|
+
box-sizing: border-box;
|
|
571
|
+
display: grid;
|
|
572
|
+
grid-template-columns: var(--impakt-shell-side, 190px) minmax(0, 1fr);
|
|
573
|
+
grid-template-rows: auto 1fr;
|
|
574
|
+
grid-template-areas: 'brand top' 'side main';
|
|
575
|
+
gap: ${s(5)};
|
|
576
|
+
min-block-size: calc(100svh - 2 * ${s(5)});
|
|
577
|
+
margin: ${s(5)};
|
|
578
|
+
padding: ${s(5)};
|
|
579
|
+
border-radius: var(--impakt-shell-radius, 36px);
|
|
580
|
+
background: ${u("color.surface.page","#f2f5f4")};
|
|
581
|
+
}
|
|
582
|
+
.brand { grid-area: brand; display: flex; align-items: center; min-block-size: 52px; }
|
|
583
|
+
.side { grid-area: side; display: flex; flex-direction: column; min-block-size: 0; }
|
|
584
|
+
.side ::slotted(*) { flex: 1; }
|
|
585
|
+
header { grid-area: top; display: flex; align-items: center; gap: ${s(5)}; min-inline-size: 0; }
|
|
586
|
+
.workspace { flex: none; }
|
|
587
|
+
.search { flex: 1 1 auto; display: flex; justify-content: center; min-inline-size: 0; }
|
|
588
|
+
.search ::slotted(*) { inline-size: min(100%, 420px); }
|
|
589
|
+
.actions { flex: none; display: flex; align-items: center; gap: ${s(3)}; }
|
|
590
|
+
main { grid-area: main; min-inline-size: 0; }
|
|
591
|
+
main:focus { outline: none; }
|
|
592
|
+
.phone-header, .tab-bar { display: none; }
|
|
593
|
+
.skip {
|
|
594
|
+
position: absolute;
|
|
595
|
+
inset-inline-start: ${s(2)};
|
|
596
|
+
inset-block-start: ${s(2)};
|
|
597
|
+
z-index: 20;
|
|
598
|
+
padding: ${s(2)} ${s(4)};
|
|
599
|
+
background: ${t.surfaceCard};
|
|
600
|
+
color: ${t.link};
|
|
601
|
+
border-radius: ${t.radius};
|
|
602
|
+
transform: translateY(-200%);
|
|
603
|
+
}
|
|
604
|
+
.skip:not(:focus) { clip-path: inset(50%); }
|
|
605
|
+
.skip:focus { transform: none; }
|
|
606
|
+
|
|
607
|
+
@media (max-width: ${wi}) {
|
|
608
|
+
:host { background: ${t.text}; }
|
|
609
|
+
.frame {
|
|
610
|
+
display: flex;
|
|
611
|
+
flex-direction: column;
|
|
612
|
+
margin: 0;
|
|
613
|
+
padding: 0;
|
|
614
|
+
border-radius: 0;
|
|
615
|
+
min-block-size: 100svh;
|
|
616
|
+
background: transparent;
|
|
617
|
+
}
|
|
618
|
+
.brand, .side, header { display: none; }
|
|
619
|
+
/* The page's header sits on the dark band, so the elements slotted into it
|
|
620
|
+
are given the card colour as their text colour. Custom properties
|
|
621
|
+
inherit through the slot, so an impakt-heading or impakt-text there
|
|
622
|
+
reads light without being told. */
|
|
623
|
+
.phone-header {
|
|
624
|
+
display: block;
|
|
625
|
+
padding: calc(${s(4)} + env(safe-area-inset-top)) ${s(5)} ${s(10)};
|
|
626
|
+
color: var(--impakt-shell-paper);
|
|
627
|
+
--impakt-color-text-default: var(--impakt-shell-paper);
|
|
628
|
+
--impakt-color-text-heading: var(--impakt-shell-paper);
|
|
629
|
+
--impakt-color-text-muted: color-mix(in srgb, var(--impakt-shell-paper) 74%, var(--impakt-shell-ink));
|
|
630
|
+
--impakt-color-link: var(--impakt-shell-paper);
|
|
631
|
+
}
|
|
632
|
+
main {
|
|
633
|
+
position: relative;
|
|
634
|
+
flex: 1;
|
|
635
|
+
margin-block-start: calc(-1 * ${s(6)});
|
|
636
|
+
/* Room for the floating tab bar, so the last of the content can scroll clear of it. */
|
|
637
|
+
padding: ${s(4)} ${s(4)} calc(96px + env(safe-area-inset-bottom));
|
|
638
|
+
border-radius: 28px 28px 0 0;
|
|
639
|
+
background: ${u("color.surface.page","#f2f5f4")};
|
|
640
|
+
}
|
|
641
|
+
.tab-bar {
|
|
642
|
+
display: block;
|
|
643
|
+
position: fixed;
|
|
644
|
+
z-index: 10;
|
|
645
|
+
inset-inline: ${s(4)};
|
|
646
|
+
inset-block-end: calc(${s(3)} + env(safe-area-inset-bottom));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
`]}skip(e){e.preventDefault();let i=this.renderRoot.querySelector("main");i?.focus(),i?.scrollIntoView()}render(){return a`
|
|
650
|
+
<div class="frame" part="frame">
|
|
651
|
+
<a class="skip" href="#content" part="skip" @click=${this.skip}>${this.skipText}</a>
|
|
652
|
+
<div class="brand" part="brand"><slot name="brand"></slot></div>
|
|
653
|
+
<div class="side" part="side"><slot name="nav"></slot></div>
|
|
654
|
+
<header aria-label=${this.topBarLabel||l} part="top-bar">
|
|
655
|
+
<div class="workspace"><slot name="workspace"></slot></div>
|
|
656
|
+
<div class="search"><slot name="search"></slot></div>
|
|
657
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
658
|
+
</header>
|
|
659
|
+
<div class="phone-header" part="phone-header"><slot name="phone-header"></slot></div>
|
|
660
|
+
<main id="content" tabindex="-1" part="main"><slot></slot></main>
|
|
661
|
+
<div class="tab-bar" part="tab-bar"><slot name="tab-bar"></slot></div>
|
|
662
|
+
</div>
|
|
663
|
+
`}};customElements.define("impakt-side-nav",ye);customElements.define("impakt-tab-bar",xe);customElements.define("impakt-app-shell",ke);function _(n){let e=n?.closest?.("[lang]")?.getAttribute("lang"),i=!e&&n?n.getRootNode?.()?.host?.closest?.("[lang]")?.getAttribute("lang")??"":"",r=typeof document<"u"?document.documentElement.lang:"",o=(e||i||r||"").trim();return!o||o.toLowerCase()==="en"?"en-GB":o}var Si=u("font.weight.light","300"),ve=class extends c{static{this.properties={label:{type:String},value:{type:String},caption:{type:String},href:{type:String},tone:{type:String,reflect:!0},size:{type:String,reflect:!0}}}constructor(){super(),this.label="",this.value="",this.caption="",this.href="",this.tone="plain",this.size="md"}static{this.styles=[...c.styles,x,p`
|
|
664
|
+
:host { display: block; }
|
|
665
|
+
.tile {
|
|
666
|
+
box-sizing: border-box;
|
|
667
|
+
display: flex;
|
|
668
|
+
flex-direction: column;
|
|
669
|
+
gap: ${s(1)};
|
|
670
|
+
block-size: 100%;
|
|
671
|
+
min-block-size: 84px;
|
|
672
|
+
padding: ${s(3)} ${s(4)};
|
|
673
|
+
border-radius: ${t.radiusLg};
|
|
674
|
+
background: ${t.surfaceInset};
|
|
675
|
+
color: ${t.text};
|
|
676
|
+
text-decoration: none;
|
|
677
|
+
}
|
|
678
|
+
a.tile:hover { background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 5%); }
|
|
679
|
+
.label { font-size: 11px; font-weight: ${m("medium")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }
|
|
680
|
+
.value { margin-block-start: auto; font-size: 34px; line-height: 1.1; font-weight: ${Si}; font-variant-numeric: tabular-nums; }
|
|
681
|
+
.caption { font-size: ${g("sm")}; color: ${t.textMuted}; }
|
|
682
|
+
:host([size='lg']) .tile { min-block-size: 200px; padding: ${s(6)}; border-radius: ${t.radiusXl}; }
|
|
683
|
+
:host([size='lg']) .label { font-size: ${g("sm")}; letter-spacing: normal; text-transform: none; }
|
|
684
|
+
:host([size='lg']) .value { font-size: 64px; line-height: 1; }
|
|
685
|
+
:host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; }
|
|
686
|
+
:host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }
|
|
687
|
+
:host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }
|
|
688
|
+
@media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }
|
|
689
|
+
`]}render(){let e=a`
|
|
690
|
+
<span class="label" part="label">${this.label}</span>
|
|
691
|
+
<span class="value" part="value">${this.value}</span>
|
|
692
|
+
${this.caption?a`<span class="caption" part="caption">${this.caption}</span>`:l}
|
|
693
|
+
`;return this.href?a`<a class="tile" href=${this.href} part="tile">${e}</a>`:a`<div class="tile" part="tile">${e}</div>`}},we=class extends c{static{this.properties={date:{type:String},tone:{type:String,reflect:!0}}}constructor(){super(),this.date="",this.tone="brand"}static{this.styles=[...c.styles,p`
|
|
694
|
+
:host { display: inline-block; flex: none; }
|
|
695
|
+
time {
|
|
696
|
+
box-sizing: border-box;
|
|
697
|
+
display: flex;
|
|
698
|
+
flex-direction: column;
|
|
699
|
+
align-items: center;
|
|
700
|
+
justify-content: center;
|
|
701
|
+
inline-size: 48px;
|
|
702
|
+
block-size: 52px;
|
|
703
|
+
border-radius: ${t.radiusLg};
|
|
704
|
+
background: ${t.brand};
|
|
705
|
+
color: ${t.onBrand};
|
|
706
|
+
line-height: 1;
|
|
707
|
+
}
|
|
708
|
+
:host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }
|
|
709
|
+
.month { font-size: 10px; font-weight: ${m("medium")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }
|
|
710
|
+
.day { margin-block-start: ${s(1)}; font-size: 20px; font-weight: ${m("medium")}; font-variant-numeric: tabular-nums; }
|
|
711
|
+
.sr-only { ${z} }
|
|
712
|
+
@media (forced-colors: active) { time { border: 1px solid CanvasText; } }
|
|
713
|
+
`]}parts(){let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(this.date??"");if(!e)return null;let i=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3]),12));if(Number.isNaN(i.getTime()))return null;let r=_(this),o=d=>new Intl.DateTimeFormat(r,{...d,timeZone:"UTC"}).format(i);return{month:o({month:"short"}).replace(".",""),day:o({day:"numeric"}),full:o({day:"numeric",month:"long",year:"numeric"})}}render(){let e=this.parts();return e?a`<time datetime=${this.date} part="tile">
|
|
714
|
+
<span class="month" aria-hidden="true">${e.month}</span>
|
|
715
|
+
<span class="day" aria-hidden="true">${e.day}</span>
|
|
716
|
+
<span class="sr-only">${e.full}</span>
|
|
717
|
+
</time>`:a`${l}`}},Se=class extends c{constructor(){super();this.filled={start:!1,end:!1};this.heading="",this.meta="",this.href="",this.divided=!1,this.muted=!1}static{this.properties={heading:{type:String},meta:{type:String},href:{type:String},divided:{type:Boolean,reflect:!0},muted:{type:Boolean,reflect:!0}}}static{this.styles=[...c.styles,x,p`
|
|
718
|
+
:host { display: block; }
|
|
719
|
+
:host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }
|
|
720
|
+
.row { position: relative; display: flex; align-items: center; gap: ${s(3)}; padding-block: ${s(3)}; }
|
|
721
|
+
.text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${s(.5)}; }
|
|
722
|
+
.title { font-size: ${g("md")}; font-weight: ${m("medium")}; color: ${t.text}; }
|
|
723
|
+
:host([muted]) .title { color: ${t.textMuted}; font-weight: ${m("regular")}; }
|
|
724
|
+
.meta { font-size: ${g("sm")}; color: ${t.textMuted}; }
|
|
725
|
+
a { color: inherit; text-decoration: none; }
|
|
726
|
+
/* The link is stretched over the row, so the row is one target. */
|
|
727
|
+
a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }
|
|
728
|
+
a:focus-visible { outline: none; }
|
|
729
|
+
a:focus-visible::after { box-shadow: ${t.focusShadow}; }
|
|
730
|
+
.row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }
|
|
731
|
+
.start, .end { flex: none; display: flex; align-items: center; gap: ${s(2)}; }
|
|
732
|
+
.start.empty, .end.empty { display: none; }
|
|
733
|
+
/* Controls at the end stay pressable above the stretched link. */
|
|
734
|
+
.end { position: relative; z-index: 1; }
|
|
735
|
+
.chevron { flex: none; color: ${t.textMuted}; }
|
|
736
|
+
`]}onSlot(i){let r=i.target,o=r.name;this.filled={...this.filled,[o]:r.assignedNodes({flatten:!0}).some(d=>d.nodeType===Node.ELEMENT_NODE||(d.textContent??"").trim()!=="")},this.requestUpdate()}render(){let i=this.href?a`<a class="title" href=${this.href} part="link">${this.heading}</a>`:a`<span class="title" part="title">${this.heading}</span>`;return a`<div class="row" part="row">
|
|
737
|
+
<div class="start ${this.filled.start?"":"empty"}"><slot name="start" @slotchange=${this.onSlot}></slot></div>
|
|
738
|
+
<div class="text">${i}${this.meta?a`<span class="meta" part="meta">${this.meta}</span>`:l}</div>
|
|
739
|
+
<div class="end ${this.filled.end?"":"empty"}"><slot name="end" @slotchange=${this.onSlot}></slot></div>
|
|
740
|
+
${this.href?a`<span class="chevron" aria-hidden="true">${S("chevron-right","20px")}</span>`:l}
|
|
741
|
+
</div>`}},Te=class extends c{static{this.properties={label:{type:String},count:{type:Number},countLabel:{type:String,attribute:"count-label"},pressed:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}}}constructor(){super(),this.label="",this.count=void 0,this.countLabel="",this.pressed=!1,this.disabled=!1}static{this.styles=[...c.styles,x,E("button"),p`
|
|
742
|
+
:host { display: inline-block; }
|
|
743
|
+
button {
|
|
744
|
+
${w}
|
|
745
|
+
display: inline-flex;
|
|
746
|
+
align-items: center;
|
|
747
|
+
gap: ${s(2)};
|
|
748
|
+
min-block-size: 36px;
|
|
749
|
+
padding: 0 ${s(3.5)};
|
|
750
|
+
font: inherit;
|
|
751
|
+
font-size: ${g("sm")};
|
|
752
|
+
font-weight: ${m("medium")};
|
|
753
|
+
color: ${t.text};
|
|
754
|
+
background: ${t.surfaceCard};
|
|
755
|
+
border: ${t.borderThin} solid ${t.hairline};
|
|
756
|
+
border-radius: 999px;
|
|
757
|
+
cursor: pointer;
|
|
758
|
+
white-space: nowrap;
|
|
759
|
+
}
|
|
760
|
+
button:hover:not(:disabled) { background: ${t.surfaceInset}; }
|
|
761
|
+
button[aria-pressed='true'] { background: ${t.text}; color: ${t.surfaceCard}; border-color: ${t.text}; }
|
|
762
|
+
button:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
763
|
+
.count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }
|
|
764
|
+
button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }
|
|
765
|
+
.sr-only { ${z} }
|
|
766
|
+
@media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }
|
|
767
|
+
`]}toggle(){this.disabled||(this.pressed=!this.pressed,this.dispatchEvent(new CustomEvent("impakt-change",{detail:{pressed:this.pressed},bubbles:!0,composed:!0})))}render(){let e=typeof this.count=="number"&&!Number.isNaN(this.count);return a`<button type="button" part="button" aria-pressed=${this.pressed?"true":"false"} ?disabled=${this.disabled} @click=${this.toggle}>
|
|
768
|
+
<span>${this.label}</span>
|
|
769
|
+
${e?this.countLabel?a`<span class="count" aria-hidden="true">${this.count}</span><span class="sr-only">${this.countLabel}</span>`:a`<span class="count">${this.count}</span>`:l}
|
|
770
|
+
</button>`}};customElements.define("impakt-stat-tile",ve);customElements.define("impakt-date-tile",we);customElements.define("impakt-row",Se);customElements.define("impakt-filter-chip",Te);var ze=class extends b{static{this.properties={...b.properties,checked:{type:Boolean,reflect:!0}}}constructor(){super(),this.checked=!1}static{this.styles=[...b.styles,E(".row"),p`
|
|
771
|
+
.row {
|
|
772
|
+
display: flex;
|
|
773
|
+
align-items: center;
|
|
774
|
+
justify-content: space-between;
|
|
775
|
+
gap: ${s(3)};
|
|
776
|
+
cursor: pointer;
|
|
777
|
+
}
|
|
778
|
+
.text {
|
|
779
|
+
font-size: ${g("md")};
|
|
780
|
+
}
|
|
781
|
+
.control {
|
|
782
|
+
position: relative;
|
|
783
|
+
flex: none;
|
|
784
|
+
inline-size: 46px;
|
|
785
|
+
block-size: 28px;
|
|
786
|
+
}
|
|
787
|
+
input {
|
|
788
|
+
${w}
|
|
789
|
+
position: absolute;
|
|
790
|
+
inset: 0;
|
|
791
|
+
inline-size: 100%;
|
|
792
|
+
block-size: 100%;
|
|
793
|
+
margin: 0;
|
|
794
|
+
opacity: 0;
|
|
795
|
+
cursor: pointer;
|
|
796
|
+
}
|
|
797
|
+
.track {
|
|
798
|
+
position: absolute;
|
|
799
|
+
inset: 0;
|
|
800
|
+
border-radius: 999px;
|
|
801
|
+
background: ${t.borderStrong};
|
|
802
|
+
transition: background-color 120ms ease-in-out;
|
|
803
|
+
pointer-events: none;
|
|
804
|
+
}
|
|
805
|
+
.knob {
|
|
806
|
+
position: absolute;
|
|
807
|
+
inset-block-start: 3px;
|
|
808
|
+
inset-inline-start: 3px;
|
|
809
|
+
inline-size: 22px;
|
|
810
|
+
block-size: 22px;
|
|
811
|
+
border-radius: 999px;
|
|
812
|
+
background: ${t.surfaceCard};
|
|
813
|
+
box-shadow: ${t.shadowXs};
|
|
814
|
+
transition: transform 120ms ease-in-out;
|
|
815
|
+
}
|
|
816
|
+
:host([checked]) .track {
|
|
817
|
+
background: ${t.brand};
|
|
818
|
+
}
|
|
819
|
+
:host([checked]) .knob {
|
|
820
|
+
transform: translateX(18px);
|
|
821
|
+
}
|
|
822
|
+
:host(:dir(rtl)[checked]) .knob {
|
|
823
|
+
transform: translateX(-18px);
|
|
824
|
+
}
|
|
825
|
+
input:focus-visible + .track {
|
|
826
|
+
box-shadow: ${t.focusShadow};
|
|
827
|
+
}
|
|
828
|
+
input:disabled {
|
|
829
|
+
cursor: not-allowed;
|
|
830
|
+
}
|
|
831
|
+
:host([disabled]) .track {
|
|
832
|
+
opacity: 0.5;
|
|
833
|
+
}
|
|
834
|
+
@media (prefers-reduced-motion: reduce) {
|
|
835
|
+
.track, .knob { transition: none; }
|
|
836
|
+
}
|
|
837
|
+
@media (forced-colors: active) {
|
|
838
|
+
.track { border: 1px solid CanvasText; }
|
|
839
|
+
.knob { background: CanvasText; }
|
|
840
|
+
:host([checked]) .track { background: Highlight; }
|
|
841
|
+
}
|
|
842
|
+
`]}renderControl(){return a`
|
|
843
|
+
<label class="row" part="row" for=${this.controlId}>
|
|
844
|
+
<span class="text">
|
|
845
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
846
|
+
</span>
|
|
847
|
+
<span class="control">
|
|
848
|
+
<input
|
|
849
|
+
type="checkbox"
|
|
850
|
+
role="switch"
|
|
851
|
+
id=${this.controlId}
|
|
852
|
+
part="input"
|
|
853
|
+
name=${this.name||l}
|
|
854
|
+
.checked=${this.checked}
|
|
855
|
+
aria-checked=${this.checked?"true":"false"}
|
|
856
|
+
?disabled=${this.disabled}
|
|
857
|
+
?required=${this.required}
|
|
858
|
+
aria-describedby=${this.describedBy}
|
|
859
|
+
aria-invalid=${this.error?"true":l}
|
|
860
|
+
@change=${e=>{this.checked=e.target.checked,this.setFormValue(this.checked?"on":"")}}
|
|
861
|
+
/>
|
|
862
|
+
<span class="track" part="track"><span class="knob" part="knob"></span></span>
|
|
863
|
+
</span>
|
|
864
|
+
</label>
|
|
865
|
+
`}renderLabel(){return a`${l}`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},Me=class extends b{static{this.properties={...b.properties,options:{type:Array},hideLabel:{type:Boolean,attribute:"hide-label",reflect:!0},full:{type:Boolean,reflect:!0}}}constructor(){super(),this.options=[],this.hideLabel=!1,this.full=!1}static{this.styles=[...b.styles,p`
|
|
866
|
+
fieldset {
|
|
867
|
+
border: 0;
|
|
868
|
+
margin: 0;
|
|
869
|
+
padding: 0;
|
|
870
|
+
min-inline-size: 0;
|
|
871
|
+
}
|
|
872
|
+
legend {
|
|
873
|
+
padding: 0;
|
|
874
|
+
}
|
|
875
|
+
:host([hide-label]) legend {
|
|
876
|
+
${z}
|
|
877
|
+
}
|
|
878
|
+
.segments {
|
|
879
|
+
display: inline-flex;
|
|
880
|
+
gap: ${s(1)};
|
|
881
|
+
padding: ${s(1)};
|
|
882
|
+
border-radius: 999px;
|
|
883
|
+
background: ${t.surfaceInset};
|
|
884
|
+
}
|
|
885
|
+
:host([full]) .segments {
|
|
886
|
+
display: flex;
|
|
887
|
+
}
|
|
888
|
+
:host([full]) .segment {
|
|
889
|
+
flex: 1;
|
|
890
|
+
}
|
|
891
|
+
.segment {
|
|
892
|
+
position: relative;
|
|
893
|
+
display: inline-flex;
|
|
894
|
+
}
|
|
895
|
+
input {
|
|
896
|
+
${w}
|
|
897
|
+
position: absolute;
|
|
898
|
+
inset: 0;
|
|
899
|
+
inline-size: 100%;
|
|
900
|
+
block-size: 100%;
|
|
901
|
+
margin: 0;
|
|
902
|
+
opacity: 0;
|
|
903
|
+
cursor: pointer;
|
|
904
|
+
}
|
|
905
|
+
.face {
|
|
906
|
+
display: inline-flex;
|
|
907
|
+
align-items: center;
|
|
908
|
+
justify-content: center;
|
|
909
|
+
inline-size: 100%;
|
|
910
|
+
min-block-size: 32px;
|
|
911
|
+
padding: ${s(1.5)} ${s(4)};
|
|
912
|
+
border-radius: 999px;
|
|
913
|
+
font-size: ${g("sm")};
|
|
914
|
+
font-weight: ${m("medium")};
|
|
915
|
+
color: ${t.textMuted};
|
|
916
|
+
pointer-events: none;
|
|
917
|
+
transition: background-color 120ms ease-in-out, color 120ms ease-in-out;
|
|
918
|
+
}
|
|
919
|
+
.segment:hover .face {
|
|
920
|
+
color: ${t.text};
|
|
921
|
+
}
|
|
922
|
+
input:checked + .face {
|
|
923
|
+
background: ${t.surfaceCard};
|
|
924
|
+
color: ${t.text};
|
|
925
|
+
box-shadow: ${t.shadowXs};
|
|
926
|
+
}
|
|
927
|
+
input:focus-visible + .face {
|
|
928
|
+
box-shadow: ${t.focusShadow};
|
|
929
|
+
}
|
|
930
|
+
input:disabled {
|
|
931
|
+
cursor: not-allowed;
|
|
932
|
+
}
|
|
933
|
+
:host([disabled]) .segments {
|
|
934
|
+
opacity: 0.5;
|
|
935
|
+
}
|
|
936
|
+
@media (prefers-reduced-motion: reduce) {
|
|
937
|
+
.face { transition: none; }
|
|
938
|
+
}
|
|
939
|
+
@media (forced-colors: active) {
|
|
940
|
+
.segments { border: 1px solid CanvasText; }
|
|
941
|
+
input:checked + .face { border: 2px solid Highlight; }
|
|
942
|
+
}
|
|
943
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
944
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
945
|
+
</legend>`}renderControl(){return a`
|
|
946
|
+
<div class="segments" part="segments">
|
|
947
|
+
${this.options.map((e,i)=>{let r=this.id_(`seg-${i}`);return a`
|
|
948
|
+
<label class="segment" part="segment" for=${r}>
|
|
949
|
+
<input
|
|
950
|
+
type="radio"
|
|
951
|
+
id=${r}
|
|
952
|
+
name=${this.uid}
|
|
953
|
+
value=${e.value}
|
|
954
|
+
.checked=${this.value===e.value}
|
|
955
|
+
?disabled=${this.disabled}
|
|
956
|
+
?required=${this.required&&i===0}
|
|
957
|
+
@change=${()=>{this.value=e.value,this.setFormValue(e.value)}}
|
|
958
|
+
/>
|
|
959
|
+
<span class="face">${e.label}</span>
|
|
960
|
+
</label>
|
|
961
|
+
`})}
|
|
962
|
+
</div>
|
|
963
|
+
`}render(){return a`
|
|
964
|
+
<fieldset
|
|
965
|
+
part="fieldset"
|
|
966
|
+
aria-describedby=${this.describedBy}
|
|
967
|
+
aria-invalid=${this.error?"true":l}
|
|
968
|
+
>
|
|
969
|
+
${this.renderLabel()}
|
|
970
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
971
|
+
${this.renderControl()}
|
|
972
|
+
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
973
|
+
</fieldset>
|
|
974
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-switch",ze);customElements.define("impakt-segmented-control",Me);var Ee=class extends b{static{this.properties={...b.properties,options:{type:Array}}}constructor(){super(),this.options=[]}static{this.styles=[...b.styles,p`
|
|
389
975
|
fieldset {
|
|
390
976
|
border: 0;
|
|
391
977
|
margin: 0;
|
|
@@ -411,7 +997,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
411
997
|
/* The whole row is the target, not the 20px dot — 2.5.8 is a floor and
|
|
412
998
|
a comfortable target is the actual goal. */
|
|
413
999
|
.option input {
|
|
414
|
-
${
|
|
1000
|
+
${w}
|
|
415
1001
|
inline-size: 20px;
|
|
416
1002
|
block-size: 20px;
|
|
417
1003
|
margin: 0;
|
|
@@ -431,10 +1017,10 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
431
1017
|
:host([invalid]) .option {
|
|
432
1018
|
border-color: ${t.danger};
|
|
433
1019
|
}
|
|
434
|
-
`]}renderLabel(){return
|
|
435
|
-
${this.label}${this.required?
|
|
436
|
-
</legend>`}renderControl(){return
|
|
437
|
-
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),
|
|
1020
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
1021
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1022
|
+
</legend>`}renderControl(){return a`
|
|
1023
|
+
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),o=e.description?this.id_(`opt-${i}-desc`):void 0;return a`
|
|
438
1024
|
<label class="option" part="option" for=${r}>
|
|
439
1025
|
<input
|
|
440
1026
|
type="radio"
|
|
@@ -444,23 +1030,23 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
444
1030
|
.checked=${this.value===e.value}
|
|
445
1031
|
?disabled=${this.disabled}
|
|
446
1032
|
?required=${this.required&&i===0}
|
|
447
|
-
aria-describedby=${
|
|
1033
|
+
aria-describedby=${o??l}
|
|
448
1034
|
@change=${()=>this.setFormValue(e.value)}
|
|
449
1035
|
/>
|
|
450
1036
|
<span>
|
|
451
1037
|
<span class="option-text">${e.label}</span>
|
|
452
|
-
${e.description?
|
|
1038
|
+
${e.description?a`<span class="option-description" id=${o}>${e.description}</span>`:l}
|
|
453
1039
|
</span>
|
|
454
1040
|
</label>
|
|
455
1041
|
`})}
|
|
456
|
-
`}render(){return
|
|
1042
|
+
`}render(){return a`
|
|
457
1043
|
<fieldset
|
|
458
1044
|
part="fieldset"
|
|
459
1045
|
aria-describedby=${this.describedBy}
|
|
460
1046
|
aria-invalid=${this.error?"true":l}
|
|
461
1047
|
>
|
|
462
1048
|
${this.renderLabel()}
|
|
463
|
-
${this.description?
|
|
1049
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">
|
|
464
1050
|
${this.description}
|
|
465
1051
|
</div>`:l}
|
|
466
1052
|
${this.renderControl()}
|
|
@@ -468,7 +1054,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
468
1054
|
${this.error||l}
|
|
469
1055
|
</div>
|
|
470
1056
|
</fieldset>
|
|
471
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-radio-group"
|
|
1057
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-radio-group",Ee);var Ae=class n extends c{static{this.properties={tone:{type:String,reflect:!0},heading:{type:String},toneLabel:{type:String,attribute:"tone-label"}}}constructor(){super(),this.tone="info",this.heading="",this.toneLabel=""}static{this.TONE_WORDS={info:"Information",success:"Success",warning:"Warning",danger:"Error"}}static{this.styles=[...c.styles,p`
|
|
472
1058
|
:host {
|
|
473
1059
|
display: block;
|
|
474
1060
|
margin-block-end: ${s(4)};
|
|
@@ -514,19 +1100,19 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
514
1100
|
border-inline-start-width: 4px;
|
|
515
1101
|
}
|
|
516
1102
|
}
|
|
517
|
-
`]}render(){let e=this.toneLabel||
|
|
1103
|
+
`]}render(){let e=this.toneLabel||v(n.TONE_WORDS[this.tone]);return a`
|
|
518
1104
|
<div
|
|
519
1105
|
class="alert"
|
|
520
1106
|
part="alert"
|
|
521
1107
|
role=${this.tone==="danger"?"alert":"status"}
|
|
522
1108
|
aria-label=${this.heading?l:e}
|
|
523
1109
|
>
|
|
524
|
-
${this.heading?
|
|
1110
|
+
${this.heading?a`<div class="heading" part="heading">
|
|
525
1111
|
<span class="tone-word">${e}:</span> ${this.heading}
|
|
526
1112
|
</div>`:l}
|
|
527
1113
|
<slot></slot>
|
|
528
1114
|
</div>
|
|
529
|
-
`}};customElements.define("impakt-alert",
|
|
1115
|
+
`}};customElements.define("impakt-alert",Ae);var Ce=class extends c{static{this.properties={gap:{type:String,reflect:!0},align:{type:String,reflect:!0},direction:{type:String,reflect:!0},justify:{type:String,reflect:!0},spaceAbove:{type:String,reflect:!0,attribute:"space-above"},spaceBelow:{type:String,reflect:!0,attribute:"space-below"}}}constructor(){super(),this.gap="md",this.align="stretch",this.direction="vertical",this.justify="start",this.spaceAbove="none",this.spaceBelow="none"}static{this.styles=[...c.styles,L,p`
|
|
530
1116
|
:host {
|
|
531
1117
|
display: flex;
|
|
532
1118
|
flex-direction: column;
|
|
@@ -547,7 +1133,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
547
1133
|
:host([gap='md']) { gap: ${s(4)}; }
|
|
548
1134
|
:host([gap='lg']) { gap: ${s(6)}; }
|
|
549
1135
|
:host([gap='xl']) { gap: ${s(8)}; }
|
|
550
|
-
`]}render(){return
|
|
1136
|
+
`]}render(){return a`<slot></slot>`}},Le=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,L,p`
|
|
551
1137
|
:host {
|
|
552
1138
|
display: flex;
|
|
553
1139
|
flex-direction: column;
|
|
@@ -575,22 +1161,22 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
575
1161
|
.picture { position: relative; }
|
|
576
1162
|
.tag { position: absolute; inset-block-start: ${s(4)}; inset-inline-start: ${s(4)}; padding: ${s(1.5)} ${s(3)}; font-size: ${g("sm")}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: 999px; }
|
|
577
1163
|
@media (forced-colors: active) { :host { border-color: CanvasText; } }
|
|
578
|
-
`]}render(){return
|
|
1164
|
+
`]}render(){return a`${this.imageSrc?a`<div class="picture"><img src=${this.imageSrc} alt=${this.imageAlt} part="image" />${this.badge?a`<span class="tag">${this.badge}</span>`:l}</div>`:l}<div class="body" part="body"><slot></slot></div>`}},Re=class extends c{static{this.properties={level:{type:Number,reflect:!0},size:{type:String,reflect:!0},eyebrow:{type:String,reflect:!0},align:{type:String,reflect:!0},screenReaderOnly:{type:Boolean,reflect:!0,attribute:"screen-reader-only"}}}constructor(){super(),this.level=2,this.size="xl",this.eyebrow="",this.align="start",this.screenReaderOnly=!1}static{this.styles=[...c.styles,p`
|
|
579
1165
|
:host {
|
|
580
1166
|
display: block;
|
|
581
1167
|
color: ${t.textHeading};
|
|
582
1168
|
font-family: ${t.fontHeading};
|
|
583
1169
|
font-weight: ${m("bold")};
|
|
584
|
-
line-height: ${
|
|
585
|
-
}
|
|
586
|
-
:host([size='5xl']) { ${
|
|
587
|
-
:host([size='4xl']) { ${
|
|
588
|
-
:host([size='3xl']) { ${
|
|
589
|
-
:host([size='2xl']) { ${
|
|
590
|
-
:host([size='xl']) { ${
|
|
591
|
-
:host([size='lg']) { ${
|
|
592
|
-
:host([size='md']) { ${
|
|
593
|
-
:host([size='sm']) { ${
|
|
1170
|
+
line-height: ${R("tight")};
|
|
1171
|
+
}
|
|
1172
|
+
:host([size='5xl']) { ${$("5xl")} letter-spacing: ${t.trackingTight}; }
|
|
1173
|
+
:host([size='4xl']) { ${$("4xl")} letter-spacing: ${t.trackingTight}; }
|
|
1174
|
+
:host([size='3xl']) { ${$("3xl")} letter-spacing: ${t.trackingTight}; }
|
|
1175
|
+
:host([size='2xl']) { ${$("2xl")} letter-spacing: ${t.trackingTight}; }
|
|
1176
|
+
:host([size='xl']) { ${$("xl")} }
|
|
1177
|
+
:host([size='lg']) { ${$("lg")} }
|
|
1178
|
+
:host([size='md']) { ${$("md")} }
|
|
1179
|
+
:host([size='sm']) { ${$("sm")} }
|
|
594
1180
|
.h { text-wrap: balance; }
|
|
595
1181
|
.h {
|
|
596
1182
|
margin: 0;
|
|
@@ -599,8 +1185,8 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
599
1185
|
}
|
|
600
1186
|
:host([align='center']) { text-align: center; }
|
|
601
1187
|
/* Only the words go: an eyebrow over a heading drawn as a picture still shows. */
|
|
602
|
-
:host([screen-reader-only]) .words { ${
|
|
603
|
-
:host([screen-reader-only]:not([eyebrow])) { ${
|
|
1188
|
+
:host([screen-reader-only]) .words { ${z} }
|
|
1189
|
+
:host([screen-reader-only]:not([eyebrow])) { ${z} }
|
|
604
1190
|
.eyebrow {
|
|
605
1191
|
display: block;
|
|
606
1192
|
margin-block-end: ${s(2)};
|
|
@@ -611,31 +1197,31 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
611
1197
|
letter-spacing: 0.06em;
|
|
612
1198
|
text-transform: uppercase;
|
|
613
1199
|
}
|
|
614
|
-
`]}render(){return
|
|
615
|
-
${this.eyebrow?
|
|
616
|
-
</div>`}},
|
|
1200
|
+
`]}render(){return a`<div class="h" role="heading" aria-level=${this.level} part="heading">
|
|
1201
|
+
${this.eyebrow?a`<span class="eyebrow" part="eyebrow">${this.eyebrow}<span style="position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)">: </span></span>`:l}<span class="words"><slot></slot></span>
|
|
1202
|
+
</div>`}},_e=class extends c{static{this.properties={size:{type:String,reflect:!0},tone:{type:String,reflect:!0},align:{type:String,reflect:!0},look:{type:String,reflect:!0}}}constructor(){super(),this.size="md",this.tone="default",this.align="start",this.look="prose"}static{this.styles=[...c.styles,p`
|
|
617
1203
|
:host {
|
|
618
1204
|
display: block;
|
|
619
1205
|
/* 1.4.8 asks for 1.5 within a paragraph, and it is the default here
|
|
620
1206
|
rather than an option, because body text is what it is about. */
|
|
621
|
-
line-height: ${
|
|
1207
|
+
line-height: ${R("normal")};
|
|
622
1208
|
/* 1.4.12 Text Spacing: a user stylesheet must be able to widen this
|
|
623
1209
|
without clipping, which a max-width in ch units survives and a
|
|
624
1210
|
fixed pixel height does not. */
|
|
625
1211
|
max-inline-size: 70ch;
|
|
626
1212
|
}
|
|
627
|
-
:host([size='sm']) { ${
|
|
628
|
-
:host([size='md']) { ${
|
|
629
|
-
:host([size='lg']) { ${
|
|
630
|
-
:host([size='xl']) { ${
|
|
1213
|
+
:host([size='sm']) { ${$("sm")} }
|
|
1214
|
+
:host([size='md']) { ${$("md")} }
|
|
1215
|
+
:host([size='lg']) { ${$("lg")} }
|
|
1216
|
+
:host([size='xl']) { ${$("xl")} }
|
|
631
1217
|
p { text-wrap: pretty; }
|
|
632
1218
|
:host([tone='muted']) { color: ${t.textMuted}; }
|
|
633
1219
|
:host([align='center']) { text-align: center; margin-inline: auto; }
|
|
634
|
-
:host([look='code']) { font-family: ${t.fontMono}; ${
|
|
1220
|
+
:host([look='code']) { font-family: ${t.fontMono}; ${$("sm")} padding: ${s(2)} ${s(3)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 6%, transparent); max-inline-size: none; }
|
|
635
1221
|
p {
|
|
636
1222
|
margin: 0;
|
|
637
1223
|
}
|
|
638
|
-
`]}render(){return
|
|
1224
|
+
`]}render(){return a`<p part="text"><slot></slot></p>`}};customElements.define("impakt-stack",Ce);customElements.define("impakt-card",Le);customElements.define("impakt-heading",Re);customElements.define("impakt-text",_e);var Ie=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,x,p`
|
|
639
1225
|
:host {
|
|
640
1226
|
display: inline;
|
|
641
1227
|
}
|
|
@@ -653,18 +1239,18 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
653
1239
|
:host([variant='standalone']) a:hover .icon { transform: translateX(2px); }
|
|
654
1240
|
.icon { flex: none; transition: transform 120ms ease-in-out; }
|
|
655
1241
|
.sr-only {
|
|
656
|
-
${
|
|
1242
|
+
${z}
|
|
657
1243
|
}
|
|
658
|
-
`]}render(){return
|
|
1244
|
+
`]}render(){return a`
|
|
659
1245
|
<a
|
|
660
1246
|
part="link"
|
|
661
1247
|
href=${this.href||l}
|
|
662
1248
|
target=${this.external?"_blank":l}
|
|
663
1249
|
rel=${this.external?"noopener noreferrer":l}
|
|
664
1250
|
>
|
|
665
|
-
<slot></slot>${
|
|
1251
|
+
<slot></slot>${S(this.icon!=="none"?this.icon:this.variant==="standalone"?this.external?"external":"arrow-right":void 0,"1em")}${this.external?a`<span class="sr-only"> (${this.externalText})</span>`:l}
|
|
666
1252
|
</a>
|
|
667
|
-
`}};customElements.define("impakt-link",
|
|
1253
|
+
`}};customElements.define("impakt-link",Ie);var He=class extends c{static{this.properties={src:{type:String},alt:{type:String},decorative:{type:Boolean,reflect:!0},width:{type:Number},height:{type:Number},focalX:{type:Number,attribute:"focal-x"},focalY:{type:Number,attribute:"focal-y"},loading:{type:String},ratio:{type:String,reflect:!0},rounded:{type:String,reflect:!0},hideOn:{type:String,reflect:!0,attribute:"hide-on"}}}constructor(){super(),this.hideOn="never",this.ratio="natural",this.rounded="none",this.src="",this.alt="",this.decorative=!1,this.width=void 0,this.height=void 0,this.focalX=.5,this.focalY=.5,this.loading="lazy"}static{this.styles=[...c.styles,p`
|
|
668
1254
|
@media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }
|
|
669
1255
|
@media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none; } }
|
|
670
1256
|
:host {
|
|
@@ -684,7 +1270,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
684
1270
|
:host([rounded='sm']) img { border-radius: ${t.radius}; }
|
|
685
1271
|
:host([rounded='lg']) img { border-radius: ${t.radiusLg}; }
|
|
686
1272
|
:host([rounded='full']) img { border-radius: 50%; }
|
|
687
|
-
`]}render(){return
|
|
1273
|
+
`]}render(){return a`
|
|
688
1274
|
<img
|
|
689
1275
|
part="image"
|
|
690
1276
|
src=${this.src}
|
|
@@ -695,7 +1281,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
695
1281
|
loading=${this.loading}
|
|
696
1282
|
style="object-position: ${this.focalX*100}% ${this.focalY*100}%"
|
|
697
1283
|
/>
|
|
698
|
-
`}},
|
|
1284
|
+
`}},Be=class extends c{static{this.properties={src:{type:String},srcDark:{type:String,attribute:"src-dark"},alt:{type:String},onDark:{type:Boolean,attribute:"on-dark",reflect:!0},height:{type:Number}}}constructor(){super(),this.src="",this.srcDark="",this.alt="",this.onDark=!1,this.height=32}static{this.styles=[...c.styles,p`
|
|
699
1285
|
:host {
|
|
700
1286
|
display: inline-block;
|
|
701
1287
|
}
|
|
@@ -703,7 +1289,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
703
1289
|
display: block;
|
|
704
1290
|
inline-size: auto;
|
|
705
1291
|
}
|
|
706
|
-
`]}render(){let e=this.onDark&&this.srcDark?this.srcDark:this.src;return
|
|
1292
|
+
`]}render(){let e=this.onDark&&this.srcDark?this.srcDark:this.src;return a`<img part="logo" src=${e} alt=${this.alt} style="height: ${this.height}px" />`}},Ne=class extends c{static{this.properties={href:{type:String},label:{type:String},fileType:{type:String,attribute:"file-type"},byteSize:{type:Number,attribute:"byte-size"}}}constructor(){super(),this.href="",this.label="",this.fileType="",this.byteSize=void 0}static{this.styles=[...c.styles,p`
|
|
707
1293
|
:host {
|
|
708
1294
|
display: block;
|
|
709
1295
|
}
|
|
@@ -719,11 +1305,11 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
719
1305
|
.meta {
|
|
720
1306
|
color: ${t.textMuted};
|
|
721
1307
|
}
|
|
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
|
|
1308
|
+
`]}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 a`
|
|
723
1309
|
<a part="link" href=${this.href||l} download>
|
|
724
|
-
<span>${this.label}</span>${e?
|
|
1310
|
+
<span>${this.label}</span>${e?a`<span class="meta">(${e})</span>`:l}
|
|
725
1311
|
</a>
|
|
726
|
-
`}};customElements.define("impakt-image",
|
|
1312
|
+
`}};customElements.define("impakt-image",He);customElements.define("impakt-logo",Be);customElements.define("impakt-document-link",Ne);var Oe=class extends c{static{this.properties={amount:{type:Number},currency:{type:String},locale:{type:String},prefix:{type:String},period:{type:String},size:{type:String,reflect:!0},pending:{type:String}}}constructor(){super(),this.amount=void 0,this.currency="GBP",this.locale="",this.prefix="",this.period="",this.size="xl",this.pending="\u2014"}static{this.styles=[...c.styles,p`
|
|
727
1313
|
:host {
|
|
728
1314
|
display: inline-flex;
|
|
729
1315
|
align-items: baseline;
|
|
@@ -744,11 +1330,11 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
744
1330
|
font-size: ${g("sm")};
|
|
745
1331
|
color: ${t.textMuted};
|
|
746
1332
|
}
|
|
747
|
-
`]}get formatted(){if(this.amount===void 0||Number.isNaN(this.amount))return this.pending;try{return new Intl.NumberFormat(this.locale||
|
|
748
|
-
${this.prefix?
|
|
1333
|
+
`]}get formatted(){if(this.amount===void 0||Number.isNaN(this.amount))return this.pending;try{return new Intl.NumberFormat(this.locale||_(this),{style:"currency",currency:this.currency,...this.amount>=1e5&&this.amount%100===0?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}).format(this.amount/100)}catch{return(this.amount/100).toFixed(2)}}render(){return a`
|
|
1334
|
+
${this.prefix?a`<span class="period" part="prefix">${this.prefix}</span>`:l}
|
|
749
1335
|
<span class="amount" part="amount">${this.formatted}</span>
|
|
750
|
-
${this.period?
|
|
751
|
-
`}};customElements.define("impakt-price",
|
|
1336
|
+
${this.period?a`<span class="period" part="period">${this.period}</span>`:l}
|
|
1337
|
+
`}};customElements.define("impakt-price",Oe);var qe=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,x,E("dd a"),p`
|
|
752
1338
|
:host {
|
|
753
1339
|
display: block;
|
|
754
1340
|
}
|
|
@@ -813,21 +1399,21 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
813
1399
|
padding-block-start: 0;
|
|
814
1400
|
}
|
|
815
1401
|
}
|
|
816
|
-
`]}render(){return
|
|
1402
|
+
`]}render(){return a`
|
|
817
1403
|
<dl part="list">
|
|
818
|
-
${this.rows.map(e=>
|
|
1404
|
+
${this.rows.map(e=>a`
|
|
819
1405
|
<div class="row" part="row">
|
|
820
1406
|
<dt part="key">${e.key}</dt>
|
|
821
1407
|
<dd part="value">
|
|
822
1408
|
<span>${e.value}</span>
|
|
823
|
-
${e.changeHref?
|
|
1409
|
+
${e.changeHref?a`<a href=${e.changeHref} part="action"
|
|
824
1410
|
>${this.changeText}<span class="sr-only"> ${e.key}</span></a
|
|
825
1411
|
>`:l}
|
|
826
1412
|
</dd>
|
|
827
1413
|
</div>
|
|
828
1414
|
`)}
|
|
829
1415
|
</dl>
|
|
830
|
-
`}};customElements.define("impakt-summary-list",
|
|
1416
|
+
`}};customElements.define("impakt-summary-list",qe);var Pe=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,x,E(".sort, .pick label"),p`
|
|
831
1417
|
:host {
|
|
832
1418
|
display: block;
|
|
833
1419
|
}
|
|
@@ -934,7 +1520,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
934
1520
|
display: none;
|
|
935
1521
|
}
|
|
936
1522
|
.visually-hidden {
|
|
937
|
-
${
|
|
1523
|
+
${z}
|
|
938
1524
|
}
|
|
939
1525
|
/* Stacked: each row a card, each value under its column's name. */
|
|
940
1526
|
@container (max-width: 36rem) {
|
|
@@ -1012,31 +1598,31 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1012
1598
|
border: 0;
|
|
1013
1599
|
}
|
|
1014
1600
|
}
|
|
1015
|
-
`]}keyOf(e,i){let r=e?.[this.rowKey];return r==null||r===""?String(i):String(r)}ordered(){let e=(this.rows??[]).map((h,
|
|
1016
|
-
<button class="sort" type="button" part="sort" @click=${()=>this.sortBy(e.key)}>${e.label}<span class="arrow" aria-hidden="true">${
|
|
1017
|
-
</th>`:
|
|
1601
|
+
`]}keyOf(e,i){let r=e?.[this.rowKey];return r==null||r===""?String(i):String(r)}ordered(){let e=(this.rows??[]).map((h,k)=>({row:h,key:this.keyOf(h,k)})),i=(this.columns??[]).find(h=>h.key===this.sortKey&&h.sortable);if(!i||this.manualSort)return e;let r=this.sortDirection==="descending"?-1:1,o=_(this),d=h=>Number(String(h??"").replace(/[^\d.-]/g,""))||0;return e.sort((h,k)=>{let y=h.row[i.key]??"",T=k.row[i.key]??"";return(i.numeric?d(y)-d(T):String(y).localeCompare(String(T),o,{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 o of e)i?r.add(o):r.delete(o);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?a`<th scope="col" role="columnheader" class=${r} aria-sort=${i?this.sortDirection:l}>
|
|
1602
|
+
<button class="sort" type="button" part="sort" @click=${()=>this.sortBy(e.key)}>${e.label}<span class="arrow" aria-hidden="true">${S("chevron-down","16px")}</span></button>
|
|
1603
|
+
</th>`:a`<th scope="col" role="columnheader" class=${r}>${e.label}</th>`}render(){let e=this.columns??[],i=this.ordered(),r=new Set(this.selected??[]),o=i.length>0&&i.every(h=>r.has(h.key)),d=!o&&i.some(h=>r.has(h.key));return a`
|
|
1018
1604
|
<div class="scroller" part="scroller" tabindex="0" role="region" aria-label=${this.caption||l}>
|
|
1019
1605
|
<table part="table" role="table">
|
|
1020
|
-
${this.caption?
|
|
1606
|
+
${this.caption?a`<caption part="caption">${this.caption}</caption>`:l}
|
|
1021
1607
|
<thead role="rowgroup">
|
|
1022
1608
|
<tr role="row">
|
|
1023
|
-
${this.selectable?
|
|
1024
|
-
@change=${h=>this.choose(i.map(
|
|
1609
|
+
${this.selectable?a`<th scope="col" role="columnheader" class="pick"><label><input type="checkbox" aria-label=${this.selectAllText} .checked=${o} .indeterminate=${d} ?disabled=${!i.length}
|
|
1610
|
+
@change=${h=>this.choose(i.map(k=>k.key),h.target.checked)} /></label></th>`:l}
|
|
1025
1611
|
${e.map(h=>this.heading(h))}
|
|
1026
1612
|
</tr>
|
|
1027
1613
|
</thead>
|
|
1028
1614
|
<tbody role="rowgroup">
|
|
1029
|
-
${i.length?i.map(({row:h,key:y
|
|
1030
|
-
<tr role="row" class=${r.has(
|
|
1031
|
-
${this.selectable?
|
|
1032
|
-
@change=${
|
|
1033
|
-
${e.map((
|
|
1615
|
+
${i.length?i.map(({row:h,key:k},y)=>a`
|
|
1616
|
+
<tr role="row" class=${r.has(k)?"chosen":""} part="row">
|
|
1617
|
+
${this.selectable?a`<td role="cell" class="pick"><label><input type="checkbox" aria-label=${this.selectRowText.replace("{row}",String(h[e[0]?.key??""]??k))} .checked=${r.has(k)}
|
|
1618
|
+
@change=${T=>this.choose([k],T.target.checked)} /></label></td>`:l}
|
|
1619
|
+
${e.map((T,A)=>{let M=a`<span class="label" aria-hidden="true">${T.label}</span><span class="value"><slot name=${`cell:${k}:${T.key}`}>${h[T.key]??""}</slot></span>`;return A===0?a`<th scope="row" role="rowheader" id=${`${this.uid}-r${y}`}>${M}</th>`:a`<td role="cell" class=${T.numeric?"numeric":""}>${M}</td>`})}
|
|
1034
1620
|
</tr>
|
|
1035
|
-
`):
|
|
1621
|
+
`):a`<tr role="row"><td role="cell" class="empty" colspan=${e.length+(this.selectable?1:0)||1}><slot name="empty">${this.emptyText}</slot></td></tr>`}
|
|
1036
1622
|
</tbody>
|
|
1037
1623
|
</table>
|
|
1038
1624
|
</div>
|
|
1039
|
-
`}};customElements.define("impakt-table",
|
|
1625
|
+
`}};customElements.define("impakt-table",Pe);var De=class extends c{static{this.properties={items:{type:Array},headingLevel:{type:Number,attribute:"heading-level"},open:{type:Array},multiple:{type:Boolean}}}constructor(){super(),this.items=[],this.headingLevel=3,this.open=[],this.multiple=!0}static{this.styles=[...c.styles,x,p`
|
|
1040
1626
|
:host {
|
|
1041
1627
|
display: block;
|
|
1042
1628
|
}
|
|
@@ -1044,7 +1630,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1044
1630
|
border-block-end: ${t.borderThin} solid ${t.rule};
|
|
1045
1631
|
}
|
|
1046
1632
|
button {
|
|
1047
|
-
${
|
|
1633
|
+
${w}
|
|
1048
1634
|
display: flex;
|
|
1049
1635
|
align-items: center;
|
|
1050
1636
|
justify-content: space-between;
|
|
@@ -1074,12 +1660,12 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1074
1660
|
padding-block-end: ${s(4)};
|
|
1075
1661
|
font-size: ${g("md")};
|
|
1076
1662
|
}
|
|
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
|
|
1078
|
-
${this.items.map(e=>{let i=this.open.includes(e.id),r=this.id_(`panel-${e.id}`),
|
|
1663
|
+
`]}toggle(e){this.open.includes(e)?this.open=this.open.filter(r=>r!==e):this.open=this.multiple?[...this.open,e]:[e]}render(){return a`
|
|
1664
|
+
${this.items.map(e=>{let i=this.open.includes(e.id),r=this.id_(`panel-${e.id}`),o=this.id_(`button-${e.id}`);return a`
|
|
1079
1665
|
<div class="item" part="item">
|
|
1080
1666
|
<div role="heading" aria-level=${this.headingLevel}>
|
|
1081
1667
|
<button
|
|
1082
|
-
id=${
|
|
1668
|
+
id=${o}
|
|
1083
1669
|
part="header"
|
|
1084
1670
|
type="button"
|
|
1085
1671
|
aria-expanded=${i?"true":"false"}
|
|
@@ -1095,7 +1681,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1095
1681
|
class="panel"
|
|
1096
1682
|
part="panel"
|
|
1097
1683
|
role="region"
|
|
1098
|
-
aria-labelledby=${
|
|
1684
|
+
aria-labelledby=${o}
|
|
1099
1685
|
?hidden=${!i}
|
|
1100
1686
|
>
|
|
1101
1687
|
<slot name=${`panel-${e.id}`}>${e.body}</slot>
|
|
@@ -1103,7 +1689,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1103
1689
|
</div>
|
|
1104
1690
|
`})}
|
|
1105
1691
|
${this.items.length===0?l:l}
|
|
1106
|
-
`}};customElements.define("impakt-accordion",
|
|
1692
|
+
`}};customElements.define("impakt-accordion",De);var Fe=class extends c{static{this.properties={steps:{type:Array},current:{type:String},label:{type:String},look:{type:String,reflect:!0}}}constructor(){super(),this.steps=[],this.current="",this.label="Progress",this.look="steps"}static{this.styles=[...c.styles,p`
|
|
1107
1693
|
:host {
|
|
1108
1694
|
display: block;
|
|
1109
1695
|
margin-block-end: ${s(5)};
|
|
@@ -1132,30 +1718,65 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1132
1718
|
border-block-start-color: ${t.brand};
|
|
1133
1719
|
}
|
|
1134
1720
|
.sr-only {
|
|
1135
|
-
${
|
|
1721
|
+
${z}
|
|
1722
|
+
}
|
|
1723
|
+
:host([look='bars']) {
|
|
1724
|
+
margin-block-end: 0;
|
|
1725
|
+
}
|
|
1726
|
+
:host([look='bars']) ol {
|
|
1727
|
+
gap: ${s(1.5)};
|
|
1728
|
+
}
|
|
1729
|
+
:host([look='bars']) li {
|
|
1730
|
+
position: relative;
|
|
1731
|
+
padding-block-start: ${s(3)};
|
|
1732
|
+
border: 0;
|
|
1733
|
+
font-size: 12px;
|
|
1734
|
+
min-inline-size: 0;
|
|
1735
|
+
overflow: hidden;
|
|
1736
|
+
text-overflow: ellipsis;
|
|
1737
|
+
white-space: nowrap;
|
|
1738
|
+
}
|
|
1739
|
+
:host([look='bars']) li::before {
|
|
1740
|
+
content: '';
|
|
1741
|
+
position: absolute;
|
|
1742
|
+
inset-inline: 0;
|
|
1743
|
+
inset-block-start: 0;
|
|
1744
|
+
block-size: 5px;
|
|
1745
|
+
border-radius: 999px;
|
|
1746
|
+
background: ${t.border};
|
|
1747
|
+
}
|
|
1748
|
+
:host([look='bars']) li[data-state='done']::before {
|
|
1749
|
+
background: ${t.text};
|
|
1750
|
+
}
|
|
1751
|
+
:host([look='bars']) li[data-state='current']::before {
|
|
1752
|
+
background: ${t.brand};
|
|
1753
|
+
}
|
|
1754
|
+
@media (forced-colors: active) {
|
|
1755
|
+
:host([look='bars']) li::before { background: GrayText; }
|
|
1756
|
+
:host([look='bars']) li[data-state='done']::before, :host([look='bars']) li[data-state='current']::before { background: CanvasText; }
|
|
1136
1757
|
}
|
|
1137
1758
|
/* Below 30rem the labels stop fitting; the position in words is the part
|
|
1138
1759
|
that has to survive, so the list collapses to bars and the current
|
|
1139
1760
|
step's name. */
|
|
1140
1761
|
@media (max-width: 30rem) {
|
|
1141
1762
|
li:not([data-state='current']) span:not(.sr-only) {
|
|
1142
|
-
${
|
|
1763
|
+
${z}
|
|
1143
1764
|
}
|
|
1144
1765
|
}
|
|
1145
|
-
`]}render(){let e=this.steps.findIndex(i=>i.id===this.current);return
|
|
1766
|
+
`]}render(){let e=this.steps.findIndex(i=>i.id===this.current);return a`
|
|
1146
1767
|
<nav part="nav" aria-label=${this.label}>
|
|
1147
1768
|
<ol part="list">
|
|
1148
|
-
${this.steps.map((i,r)=>{let
|
|
1149
|
-
<li data-state=${
|
|
1150
|
-
${
|
|
1769
|
+
${this.steps.map((i,r)=>{let o=r<e?"done":r===e?"current":"todo";return a`
|
|
1770
|
+
<li data-state=${o} aria-current=${o==="current"?"step":l}>
|
|
1771
|
+
${o==="current"?a`<span class="sr-only">${v("Step {step} of {steps}:",{step:r+1,steps:this.steps.length})} </span>`:l}
|
|
1151
1772
|
<span>${i.label}</span>
|
|
1152
1773
|
</li>
|
|
1153
1774
|
`})}
|
|
1154
1775
|
</ol>
|
|
1155
1776
|
</nav>
|
|
1156
|
-
`}};customElements.define("impakt-progress",
|
|
1777
|
+
`}};customElements.define("impakt-progress",Fe);var re={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)"},se=["success","info","warning","accent","danger","brand"],It=(n,e)=>typeof n=="number"?`var(--impakt-color-chart-${n}, ${re[se[(n-1)%se.length]]})`:n&&n in re?re[n]:`var(--impakt-color-chart-${e%5+1}, ${re[se[e%se.length]]})`;var Ti=t.fontMono,je=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,ri,p`
|
|
1157
1778
|
:host { display: inline-flex; flex: none; }
|
|
1158
|
-
span.chip { display: inline-flex; align-items: center; gap: ${s(1.5)}; padding: 3px ${s(2.5)}; border-radius: 999px; font-family: ${
|
|
1779
|
+
span.chip { display: inline-flex; align-items: center; gap: ${s(1.5)}; padding: 3px ${s(2.5)}; border-radius: 999px; font-family: ${Ti}; font-size: ${g("xs")}; line-height: 1.2; white-space: nowrap; }
|
|
1159
1780
|
:host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }
|
|
1160
1781
|
:host([look='outlined']) span.chip { border: ${t.borderThin} solid ${t.border}; background: ${t.surfaceCard}; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
1161
1782
|
:host([look='plain']) span.chip { padding: 0; }
|
|
@@ -1163,16 +1784,18 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1163
1784
|
svg { inline-size: 12px; block-size: 12px; }
|
|
1164
1785
|
.meta { opacity: 0.72; text-transform: none; }
|
|
1165
1786
|
:host([look='plain']) .label { opacity: 0.72; }
|
|
1166
|
-
`]}render(){let e=this.icon==="dot"?
|
|
1787
|
+
`]}render(){let e=this.icon==="dot"?a`<span class="dot" aria-hidden="true"></span>`:this.icon==="branch"?a`<svg viewBox="0 0 14 14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="3.5" cy="3" r="1.5"/><circle cx="3.5" cy="11" r="1.5"/><circle cx="10.5" cy="4.5" r="1.5"/><path d="M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4"/></svg>`:l;return a`<span class="chip" part="chip" style=${`--tone:${It(this.tone,0)}`}>${e}<span class="label">${this.label}</span>${this.meta?a` <span class="meta">${this.meta}</span>`:l}</span>`}};customElements.define("impakt-chip",je);var Ue=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
1788
|
:host { display: inline-flex; }
|
|
1168
|
-
span { display: inline-flex; align-items: center; gap: ${s(1)}; padding: ${s(.5)} ${s(2)}; border-radius: ${t.radius}; ${
|
|
1789
|
+
span { display: inline-flex; align-items: center; gap: ${s(1)}; padding: ${s(.5)} ${s(2)}; border-radius: ${t.radius}; ${$("sm")} font-weight: ${m("medium")}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }
|
|
1169
1790
|
:host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }
|
|
1170
1791
|
:host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
1171
1792
|
:host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }
|
|
1172
1793
|
:host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
|
|
1173
1794
|
:host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }
|
|
1795
|
+
:host([tone='inverse']) span { background: ${t.text}; color: ${t.surfaceCard}; box-shadow: none; }
|
|
1796
|
+
:host([tone='solid']) span { background: ${t.brand}; color: ${t.onBrand}; box-shadow: none; }
|
|
1174
1797
|
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
1175
|
-
`]}render(){return
|
|
1798
|
+
`]}render(){return a`<span part="badge">${S(this.icon,"1em")}<slot></slot></span>`}};customElements.define("impakt-badge",Ue);var We=class extends b{constructor(){super();this.filled=!1;this.filledText="";this.width="full",this.rows=4,this.maxlength=void 0,this.fillFrom="none"}static{this.properties={...b.properties,width:{type:String,reflect:!0},rows:{type:Number},maxlength:{type:Number},fillFrom:{type:String,attribute:"fill-from"}}}static{this.styles=[...b.styles,I,p`
|
|
1176
1799
|
textarea {
|
|
1177
1800
|
inline-size: min(100%, var(--impakt-field-width));
|
|
1178
1801
|
padding: ${s(2.5)} ${s(3)};
|
|
@@ -1199,7 +1822,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1199
1822
|
border-color: ${t.danger};
|
|
1200
1823
|
border-width: ${t.borderThick};
|
|
1201
1824
|
}
|
|
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("
|
|
1825
|
+
`]}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 a`
|
|
1203
1826
|
<textarea
|
|
1204
1827
|
id=${this.controlId}
|
|
1205
1828
|
part="textarea"
|
|
@@ -1213,7 +1836,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1213
1836
|
aria-invalid=${this.error?"true":l}
|
|
1214
1837
|
@input=${i=>{this.filledText="",this.setFormValue(i.target.value)}}
|
|
1215
1838
|
>${this.value}</textarea>
|
|
1216
|
-
`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error),this.fill()}};customElements.define("impakt-textarea",
|
|
1839
|
+
`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error),this.fill()}};customElements.define("impakt-textarea",We);var Ve=class extends b{static{this.properties={...b.properties,options:{type:Array},values:{type:Array}}}constructor(){super(),this.options=[],this.values=[]}static{this.styles=[...b.styles,p`
|
|
1217
1840
|
fieldset {
|
|
1218
1841
|
border: 0;
|
|
1219
1842
|
margin: 0;
|
|
@@ -1237,7 +1860,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1237
1860
|
background: ${t.surfaceSubtle};
|
|
1238
1861
|
}
|
|
1239
1862
|
.option input {
|
|
1240
|
-
${
|
|
1863
|
+
${w}
|
|
1241
1864
|
inline-size: 20px;
|
|
1242
1865
|
block-size: 20px;
|
|
1243
1866
|
margin: 0;
|
|
@@ -1257,10 +1880,10 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1257
1880
|
:host([invalid]) .option {
|
|
1258
1881
|
border-color: ${t.danger};
|
|
1259
1882
|
}
|
|
1260
|
-
`]}renderLabel(){return
|
|
1261
|
-
${this.label}${this.required?
|
|
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
|
|
1263
|
-
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),
|
|
1883
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
1884
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1885
|
+
</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 a`
|
|
1886
|
+
${this.options.map((e,i)=>{let r=this.id_(`opt-${i}`),o=e.description?this.id_(`opt-${i}-desc`):void 0;return a`
|
|
1264
1887
|
<label class="option" part="option" for=${r}>
|
|
1265
1888
|
<input
|
|
1266
1889
|
type="checkbox"
|
|
@@ -1268,23 +1891,23 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1268
1891
|
value=${e.value}
|
|
1269
1892
|
.checked=${this.values.includes(e.value)}
|
|
1270
1893
|
?disabled=${this.disabled}
|
|
1271
|
-
aria-describedby=${
|
|
1894
|
+
aria-describedby=${o??l}
|
|
1272
1895
|
@change=${d=>this.onToggle(e.value,d.target.checked)}
|
|
1273
1896
|
/>
|
|
1274
1897
|
<span>
|
|
1275
1898
|
<span class="option-text">${e.label}</span>
|
|
1276
|
-
${e.description?
|
|
1899
|
+
${e.description?a`<span class="option-description" id=${o}>${e.description}</span>`:l}
|
|
1277
1900
|
</span>
|
|
1278
1901
|
</label>
|
|
1279
1902
|
`})}
|
|
1280
|
-
`}render(){return
|
|
1903
|
+
`}render(){return a`
|
|
1281
1904
|
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1282
1905
|
${this.renderLabel()}
|
|
1283
|
-
${this.description?
|
|
1906
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1284
1907
|
${this.renderControl()}
|
|
1285
1908
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1286
1909
|
</fieldset>
|
|
1287
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-checkbox-group",
|
|
1910
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-checkbox-group",Ve);var Ke=class extends b{static{this.properties={...b.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=[...b.styles,p`
|
|
1288
1911
|
fieldset {
|
|
1289
1912
|
border: 0;
|
|
1290
1913
|
margin: 0;
|
|
@@ -1326,9 +1949,9 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1326
1949
|
border-color: ${t.danger};
|
|
1327
1950
|
border-width: ${t.borderThick};
|
|
1328
1951
|
}
|
|
1329
|
-
`]}renderLabel(){return
|
|
1330
|
-
${this.label}${this.required?
|
|
1331
|
-
</legend>`}datePart(e,i,r,
|
|
1952
|
+
`]}renderLabel(){return a`<legend class="label" part="label">
|
|
1953
|
+
${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}
|
|
1954
|
+
</legend>`}datePart(e,i,r,o){let d=this.id_(e);return a`
|
|
1332
1955
|
<div class="part ${e}">
|
|
1333
1956
|
<label for=${d}>${i}</label>
|
|
1334
1957
|
<input
|
|
@@ -1337,25 +1960,25 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1337
1960
|
inputmode="numeric"
|
|
1338
1961
|
maxlength=${r}
|
|
1339
1962
|
.value=${this[e]}
|
|
1340
|
-
autocomplete=${this.autocompleteSection?`${this.autocompleteSection}-${
|
|
1963
|
+
autocomplete=${this.autocompleteSection?`${this.autocompleteSection}-${o}`:l}
|
|
1341
1964
|
?disabled=${this.disabled}
|
|
1342
1965
|
@input=${h=>{this[e]=h.target.value,this.emit()}}
|
|
1343
1966
|
/>
|
|
1344
1967
|
</div>
|
|
1345
|
-
`}emit(){let i=this.day&&this.month&&this.year.length===4?`${this.year}-${this.month.padStart(2,"0")}-${this.day.padStart(2,"0")}`:"";this.setFormValue(i)}renderControl(){return
|
|
1968
|
+
`}emit(){let i=this.day&&this.month&&this.year.length===4?`${this.year}-${this.month.padStart(2,"0")}-${this.day.padStart(2,"0")}`:"";this.setFormValue(i)}renderControl(){return a`
|
|
1346
1969
|
<div class="parts" part="parts">
|
|
1347
|
-
${this.datePart("day",
|
|
1348
|
-
${this.datePart("month",
|
|
1349
|
-
${this.datePart("year",
|
|
1970
|
+
${this.datePart("day",v("Day"),2,"day")}
|
|
1971
|
+
${this.datePart("month",v("Month"),2,"month")}
|
|
1972
|
+
${this.datePart("year",v("Year"),4,"year")}
|
|
1350
1973
|
</div>
|
|
1351
|
-
`}render(){return
|
|
1974
|
+
`}render(){return a`
|
|
1352
1975
|
<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1353
1976
|
${this.renderLabel()}
|
|
1354
|
-
${this.description?
|
|
1977
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1355
1978
|
${this.renderControl()}
|
|
1356
1979
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1357
1980
|
</fieldset>
|
|
1358
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-date-input",
|
|
1981
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-date-input",Ke);var oe=new Set,ae=null;function ne(n){if(typeof document>"u"||oe.has(n)||(oe.add(n),oe.size>1))return;let e=document.documentElement,i=window.innerWidth-e.clientWidth;ae={overflow:e.style.overflow,paddingRight:e.style.paddingRight},e.style.overflow="hidden",i>0&&(e.style.paddingRight=`${i}px`)}function W(n){if(typeof document>"u"||!oe.delete(n)||oe.size>0||!ae)return;let e=document.documentElement;e.style.overflow=ae.overflow,e.style.paddingRight=ae.paddingRight,ae=null}var Xe=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,x,E(".close"),p`
|
|
1359
1982
|
dialog {
|
|
1360
1983
|
padding: 0;
|
|
1361
1984
|
border: 0;
|
|
@@ -1401,7 +2024,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1401
2024
|
}
|
|
1402
2025
|
}
|
|
1403
2026
|
.close {
|
|
1404
|
-
${
|
|
2027
|
+
${w}
|
|
1405
2028
|
display: inline-flex;
|
|
1406
2029
|
align-items: center;
|
|
1407
2030
|
justify-content: center;
|
|
@@ -1414,7 +2037,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1414
2037
|
color: ${t.text};
|
|
1415
2038
|
cursor: pointer;
|
|
1416
2039
|
}
|
|
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
|
|
2040
|
+
`]}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 a`
|
|
1418
2041
|
<dialog
|
|
1419
2042
|
part="dialog"
|
|
1420
2043
|
aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
@@ -1422,25 +2045,25 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1422
2045
|
@close=${()=>{this.open&&this.close()}}
|
|
1423
2046
|
>
|
|
1424
2047
|
<div class="head">
|
|
1425
|
-
${this.heading?
|
|
1426
|
-
${this.dismissible?
|
|
2048
|
+
${this.heading?a`<h2 class="heading" id=${this.id_("heading")} part="heading">${this.heading}</h2>`:l}
|
|
2049
|
+
${this.dismissible?a`<button class="close" part="close" type="button" @click=${this.close}>
|
|
1427
2050
|
<span aria-hidden="true">×</span>
|
|
1428
2051
|
<span class="sr-only" style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">${this.closeLabel}</span>
|
|
1429
2052
|
</button>`:l}
|
|
1430
2053
|
</div>
|
|
1431
2054
|
<div class="body" part="body"><slot></slot></div>
|
|
1432
2055
|
</dialog>
|
|
1433
|
-
`}};customElements.define("impakt-dialog",
|
|
2056
|
+
`}};customElements.define("impakt-dialog",Xe);var Ye=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,L,p`
|
|
1434
2057
|
:host { display: block; }
|
|
1435
2058
|
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)}; ${
|
|
1437
|
-
:host([size='sm']) li { ${
|
|
1438
|
-
:host([size='lg']) li { ${
|
|
2059
|
+
li { position: relative; padding-inline-start: ${s(7)}; ${$("md")} text-wrap: pretty; counter-increment: point; }
|
|
2060
|
+
:host([size='sm']) li { ${$("sm")} }
|
|
2061
|
+
:host([size='lg']) li { ${$("lg")} }
|
|
1439
2062
|
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
2063
|
: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
2064
|
:host([look='number']) li::before { content: counter(point, decimal-leading-zero); inset-inline-start: 0; inset-block-start: 0.2em; inline-size: auto; block-size: auto; background: none; font-family: ${t.fontMono}; font-size: 0.75em; color: ${t.textMuted}; }
|
|
1442
2065
|
@media (forced-colors: active) { li::before { background: CanvasText; } :host([look='check']) li::before, :host([look='number']) li::before { background: none; color: CanvasText; } }
|
|
1443
|
-
`]}render(){let e=(this.items??[]).map(i=>
|
|
2066
|
+
`]}render(){let e=(this.items??[]).map(i=>a`<li part="item">${i}</li>`);return this.look==="number"?a`<ol part="list">${e}</ol>`:a`<ul part="list" role="list">${e}</ul>`}};customElements.define("impakt-list",Ye);var zi={"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"},Ge=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,L,p`
|
|
1444
2067
|
:host { display: block; min-inline-size: 0; container-type: inline-size; }
|
|
1445
2068
|
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${u("layout.gutter.md","16px")}; align-items: stretch; }
|
|
1446
2069
|
:host([gap='none']) .columns { gap: 0; }
|
|
@@ -1459,7 +2082,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1459
2082
|
::slotted(*) { max-inline-size: 100%; }
|
|
1460
2083
|
@container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
1461
2084
|
@container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }
|
|
1462
|
-
`]}render(){let e=this.columns==="one"?1:this.columns==="three"?3:this.columns==="four"?4:2,i=
|
|
2085
|
+
`]}render(){let e=this.columns==="one"?1:this.columns==="three"?3:this.columns==="four"?4:2,i=zi[this.widths]?.split(" "),r=i&&i.length===e?i.map(o=>`minmax(0, ${o})`).join(" "):"";return a`<div class="columns" part="row" style=${r?`grid-template-columns: ${r}`:""}>${Array.from({length:e},(o,d)=>a`<div class="column" part="column"><slot name=${`column-${d+1}`}></slot></div>`)}</div>`}};customElements.define("impakt-grid",Ge);var Ze=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,x,p`
|
|
1463
2086
|
:host { display: block; }
|
|
1464
2087
|
a { display: inline-flex; align-items: center; min-height: ${t.targetMin}; min-width: ${t.targetMin};
|
|
1465
2088
|
color: ${t.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }
|
|
@@ -1469,16 +2092,16 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1469
2092
|
/* An address is written one line at a time, and opening hours are often one
|
|
1470
2093
|
day to a line. Long unbroken values still wrap at 320px (1.4.10). */
|
|
1471
2094
|
.detail { white-space: pre-line; overflow-wrap: anywhere; }
|
|
1472
|
-
`]}render(){switch(this.kind){case"phone":case"email":case"address":case"hours":return this.renderContact();default:return this.renderLink()}}renderLink(){return
|
|
1473
|
-
><span class="detail" part="detail" id=${d}>${e}</span></a>`:
|
|
2095
|
+
`]}render(){switch(this.kind){case"phone":case"email":case"address":case"hours":return this.renderContact();default:return this.renderLink()}}renderLink(){return Ht(this.label)?a`<a part="link" href=${this.href}>${this.label}</a>`:l}renderContact(){let e=Ht(this.detail);if(!e)return l;let i=Ht(this.label),r=Mi(this.kind,e),o=this.id_("caption"),d=this.id_("detail"),h=i?a`<span class="caption" part="label" id=${o}>${i}</span>`:l,k=r?a`<a part="link" href=${r} aria-labelledby=${i?`${o} ${d}`:l}
|
|
2096
|
+
><span class="detail" part="detail" id=${d}>${e}</span></a>`:a`<span class="detail" part="detail">${e}</span>`;return a`<p class="contact" part="contact">${h}${k}</p>`}};function Ht(n){return typeof n=="string"?n.trim():""}function Mi(n,e){if(n==="phone"){let i=e.replace(/\(0\)/g,"").replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"");return/\d/.test(i)?`tel:${i}`:""}return n==="email"&&/^[^\s@]+@[^\s@]+$/.test(e)?`mailto:${e}`:""}customElements.define("impakt-help",Ze);var ai=p`
|
|
1474
2097
|
:host { --impakt-page-inner: ${u("layout.page-width","1200px")}; }
|
|
1475
2098
|
:host([width='narrow']) { --impakt-page-inner: 760px; }
|
|
1476
2099
|
:host([width='wide']) { --impakt-page-inner: 1440px; }
|
|
1477
|
-
`,
|
|
2100
|
+
`,Ei=p`
|
|
1478
2101
|
:host { --impakt-page-margin: ${u("layout.margin.phone","16px")}; }
|
|
1479
2102
|
@container impakt-page (min-width: 40rem) { .frame { --impakt-page-margin: ${u("layout.margin.tablet","32px")}; } }
|
|
1480
2103
|
@container impakt-page (min-width: 64rem) { .frame { --impakt-page-margin: ${u("layout.margin.desktop","64px")}; } }
|
|
1481
|
-
`,
|
|
2104
|
+
`,Je=class extends c{constructor(){super();this.place=()=>{let i=this.querySelector('impakt-hero[treatment="cover"]'),r=getComputedStyle(this).getPropertyValue("--impakt-bleed").trim()==="0",o=!!i&&!r&&this.opensOn(i);if(this.toggleAttribute("floating",o),!o)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,x,ai,Ei,p`
|
|
1482
2105
|
:host { display: block; container: impakt-page / inline-size; }
|
|
1483
2106
|
.frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }
|
|
1484
2107
|
.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); }
|
|
@@ -1498,12 +2121,12 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1498
2121
|
.skip:not(:focus) { clip-path: inset(50%); }
|
|
1499
2122
|
.skip:focus { transform: none; }
|
|
1500
2123
|
.empty { display: none; }
|
|
1501
|
-
`]}hasSlot(i){return Array.from(this.children).some(r=>r.getAttribute("slot")===i)}skip(i){i.preventDefault();let r=this.renderRoot.querySelector("main");r?.focus(),r?.scrollIntoView()}render(){let i=this.hasSlot("header"),r=this.hasSlot("footer");return
|
|
2124
|
+
`]}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 a`<div class="frame" part="frame">
|
|
1502
2125
|
<a class="skip" href="#content" part="skip" @click=${this.skip}>${this.skipText}</a>
|
|
1503
|
-
${i?
|
|
2126
|
+
${i?a`<header part="header"><div class="inner"><slot name="header"></slot></div></header>`:l}
|
|
1504
2127
|
<main id="content" tabindex="-1" part="main"><div class="inner"><slot></slot></div></main>
|
|
1505
|
-
${r?
|
|
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()}},
|
|
2128
|
+
${r?a`<footer part="footer"><div class="inner"><slot name="footer"></slot></div></footer>`:l}
|
|
2129
|
+
</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()}},Qe=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,L,ai,p`
|
|
1507
2130
|
:host { display: block; --impakt-page-margin: inherit; }
|
|
1508
2131
|
/* What a solid card on a brand band goes back to, since the band repaints these for its own text. */
|
|
1509
2132
|
: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}; }
|
|
@@ -1521,7 +2144,7 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1521
2144
|
:host([padding='xl']) .band { padding-block: ${s(16)}; }
|
|
1522
2145
|
:host([padding='2xl']) .band { padding-block: clamp(${s(14)}, 8vw, ${s(28)}); }
|
|
1523
2146
|
.content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }
|
|
1524
|
-
`]}render(){return
|
|
2147
|
+
`]}render(){return a`<section class="band" part="band" aria-label=${this.label||l} role=${this.label?l:"presentation"}><div class="content" part="content"><slot></slot></div></section>`}};customElements.define("impakt-page",Je);customElements.define("impakt-section",Qe);function Ai(n){if(typeof location>"u"||!n||n.startsWith("#"))return null;let e;try{e=new URL(n,location.href).pathname.replace(/\/$/,"")||"/"}catch{return null}let i=location.pathname.replace(/\/$/,"")||"/";return e===i?"page":e!=="/"&&i.startsWith(`${e}/`)?"section":null}var et=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,x,p`
|
|
1525
2148
|
/* It grows to fill a row it sits in, because it measures itself to decide when to fold. */
|
|
1526
2149
|
:host { display: block; flex: 1 1 8rem; min-inline-size: 0; }
|
|
1527
2150
|
nav { display: flex; flex-direction: column; position: relative; }
|
|
@@ -1529,10 +2152,10 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1529
2152
|
ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${s(1)} ${s(6)}; align-items: center; justify-content: flex-end; }
|
|
1530
2153
|
:host([align='start']) ul { justify-content: flex-start; }
|
|
1531
2154
|
:host([align='center']) ul { justify-content: center; }
|
|
1532
|
-
a { ${
|
|
2155
|
+
a { ${w} 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
2156
|
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
|
|
1534
2157
|
a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
|
|
1535
|
-
.toggle { display: none; ${
|
|
2158
|
+
.toggle { display: none; ${w} 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
2159
|
/* When they do not fit, the links fold behind a Menu button and open as a panel under it. */
|
|
1537
2160
|
:host([folded]) { flex: 0 0 auto; }
|
|
1538
2161
|
:host([folded]) .toggle { display: inline-flex; }
|
|
@@ -1545,12 +2168,12 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1545
2168
|
:host([folded]) ul.open { display: flex; }
|
|
1546
2169
|
:host([folded]) li { text-align: start; }
|
|
1547
2170
|
: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
|
|
1549
|
-
<button class="toggle" type="button" aria-expanded=${this.open?"true":"false"} aria-controls=${i} @click=${this.toggle}>${
|
|
2171
|
+
`]}fit(){let i=this.getBoundingClientRect().width;if(i<=0)return;if(!this.needs){this.removeAttribute("folded");let o=Array.from(this.renderRoot.querySelectorAll("li")),d=Number.parseFloat(getComputedStyle(this.renderRoot.querySelector("ul")).columnGap)||0;this.needs=o.reduce((h,k)=>h+k.getBoundingClientRect().width,0)+d*Math.max(0,o.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 a`<nav aria-label=${this.label||l} part="nav" @keydown=${this.onKey}>
|
|
2172
|
+
<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>
|
|
1550
2173
|
<ul id=${i} class=${this.open?"open":""} part="list">
|
|
1551
|
-
${(this.links??[]).map(r=>{let
|
|
2174
|
+
${(this.links??[]).map(r=>{let o=Ai(r.href);return a`<li><a href=${r.href} aria-current=${o==="page"?"page":o==="section"?"true":l} part="link">${r.label}</a></li>`})}
|
|
1552
2175
|
</ul>
|
|
1553
|
-
</nav>`}},
|
|
2176
|
+
</nav>`}},tt=class extends c{static{this.properties={items:{type:Array},label:{type:String}}}constructor(){super(),this.items=[],this.label="Breadcrumb"}static{this.styles=[...c.styles,x,p`
|
|
1554
2177
|
:host { display: block; font-size: ${g("sm")}; }
|
|
1555
2178
|
ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${s(1)}; }
|
|
1556
2179
|
li { display: inline-flex; align-items: center; gap: ${s(1)}; }
|
|
@@ -1558,31 +2181,31 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1558
2181
|
a { color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${t.radiusSm}; }
|
|
1559
2182
|
a:hover { color: ${t.linkHover}; }
|
|
1560
2183
|
[aria-current] { color: ${t.textMuted}; }
|
|
1561
|
-
.sr-only { ${
|
|
1562
|
-
`]}render(){let e=this.items??[];return
|
|
1563
|
-
${e.map((i,r)=>
|
|
1564
|
-
</ol></nav>`}};customElements.define("impakt-nav",
|
|
2184
|
+
.sr-only { ${z} }
|
|
2185
|
+
`]}render(){let e=this.items??[];return a`<nav aria-label=${this.label} part="nav"><ol>
|
|
2186
|
+
${e.map((i,r)=>a`<li>${r===e.length-1?a`<span aria-current="page">${i.label}</span>`:a`<a href=${i.href} part="link">${i.label}</a>`}</li>`)}
|
|
2187
|
+
</ol></nav>`}};customElements.define("impakt-nav",et);customElements.define("impakt-breadcrumbs",tt);var it=class extends c{static{this.properties={spacing:{type:String,reflect:!0},tone:{type:String,reflect:!0}}}constructor(){super(),this.spacing="md",this.tone="subtle"}static{this.styles=[...c.styles,p`
|
|
1565
2188
|
:host { display: block; }
|
|
1566
2189
|
hr { margin: ${s(4)} 0; border: 0; border-block-start: ${t.borderThin} solid ${t.border}; opacity: 0.5; }
|
|
1567
2190
|
:host([tone='strong']) hr { opacity: 1; border-block-start-width: ${t.borderThick}; }
|
|
1568
2191
|
:host([spacing='sm']) hr { margin-block: ${s(2)}; }
|
|
1569
2192
|
:host([spacing='lg']) hr { margin-block: ${s(8)}; }
|
|
1570
2193
|
:host([spacing='xl']) hr { margin-block: ${s(12)}; }
|
|
1571
|
-
`]}render(){return
|
|
2194
|
+
`]}render(){return a`<hr aria-hidden="true" part="line" />`}},rt=class extends c{static{this.properties={size:{type:String,reflect:!0}}}constructor(){super(),this.size="md"}static{this.styles=[...c.styles,p`
|
|
1572
2195
|
:host { display: block; block-size: ${s(4)}; }
|
|
1573
2196
|
:host([size='sm']) { block-size: ${s(2)}; }
|
|
1574
2197
|
:host([size='lg']) { block-size: ${s(8)}; }
|
|
1575
2198
|
:host([size='xl']) { block-size: ${s(12)}; }
|
|
1576
2199
|
:host([size='2xl']) { block-size: ${s(16)}; }
|
|
1577
|
-
`]}render(){return
|
|
2200
|
+
`]}render(){return a``}},st=class extends c{static{this.styles=[...c.styles,p`:host { ${z} }`]}render(){return a`<slot></slot>`}},at=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"},look:{type:String,reflect:!0}}}constructor(){super(),this.items=[],this.selected="",this.label="",this.twoRows=!1,this.look="line"}static{this.styles=[...c.styles,x,E("[role='tab']"),p`
|
|
1578
2201
|
:host { display: block; container-type: inline-size; }
|
|
1579
2202
|
[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'] { ${
|
|
2203
|
+
[role='tab'] { ${w} flex: none; padding: ${s(3)} ${s(4)}; font: inherit; font-weight: ${m("semibold")}; white-space: nowrap; color: ${t.textMuted}; background: transparent; border: 0; border-block-end: 3px solid transparent; margin-block-end: -1px; cursor: pointer; border-radius: ${t.radius} ${t.radius} 0 0; }
|
|
1581
2204
|
/* Inside a box that scrolls the ring would be clipped, so it is drawn inside the tab. */
|
|
1582
2205
|
[role='tab']:focus-visible { box-shadow: inset 0 0 0 2px ${t.text}, inset 0 0 0 4px ${t.surfaceCard}; }
|
|
1583
2206
|
[role='tab']:hover { color: ${t.text}; background: ${t.surfaceInset}; }
|
|
1584
2207
|
[role='tab'][aria-selected='true'] { color: ${t.link}; border-block-end-color: currentColor; }
|
|
1585
|
-
[role='tabpanel'] { padding-block: ${s(5)}; line-height: ${
|
|
2208
|
+
[role='tabpanel'] { padding-block: ${s(5)}; line-height: ${R("normal")}; }
|
|
1586
2209
|
.body { white-space: pre-line; }
|
|
1587
2210
|
@container (max-width: 40rem) {
|
|
1588
2211
|
: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)}; }
|
|
@@ -1590,49 +2213,70 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1590
2213
|
:host([two-rows]) .many [role='tab'][aria-selected='true'] { border-block-end-color: currentColor; background: ${t.brandSubtle}; }
|
|
1591
2214
|
}
|
|
1592
2215
|
@media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }
|
|
1593
|
-
|
|
1594
|
-
|
|
2216
|
+
.count { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 20px; block-size: 20px; margin-inline-start: ${s(2)}; padding: 0 ${s(1.5)}; border-radius: 999px; font-size: 12px; font-weight: ${m("semibold")}; background: ${t.brand}; color: ${t.onBrand}; font-variant-numeric: tabular-nums; }
|
|
2217
|
+
.sr-only { ${z} }
|
|
2218
|
+
/* Links drawn as tabs. */
|
|
2219
|
+
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${s(1)}; overflow-x: auto; scrollbar-width: thin; border-block-end: ${t.borderThin} solid ${t.border}; }
|
|
2220
|
+
nav a { ${w} display: inline-flex; align-items: center; flex: none; padding: ${s(3)} ${s(4)}; font-weight: ${m("semibold")}; white-space: nowrap; color: ${t.textMuted}; text-decoration: none; border-block-end: 3px solid transparent; margin-block-end: -1px; border-radius: ${t.radius} ${t.radius} 0 0; }
|
|
2221
|
+
nav a:hover { color: ${t.text}; background: ${t.surfaceInset}; }
|
|
2222
|
+
nav a[aria-current='page'] { color: ${t.link}; border-block-end-color: currentColor; }
|
|
2223
|
+
nav a:focus-visible { box-shadow: inset 0 0 0 2px ${t.text}, inset 0 0 0 4px ${t.surfaceCard}; outline: none; }
|
|
2224
|
+
/* The pill look, for either kind. */
|
|
2225
|
+
:host([look='pill']) :is([role='tablist'], nav ul) { padding: ${s(1)}; border: 0; border-radius: 999px; background: ${t.surfaceCard}; gap: ${s(.5)}; }
|
|
2226
|
+
:host([look='pill']) :is([role='tab'], nav a) { padding: ${s(2)} ${s(4)}; margin: 0; border: 0; border-radius: 999px; font-weight: ${m("medium")}; color: ${t.text}; }
|
|
2227
|
+
:host([look='pill']) :is([role='tab'], nav a):hover { background: ${t.surfaceInset}; }
|
|
2228
|
+
:host([look='pill']) :is([role='tab'][aria-selected='true'], nav a[aria-current='page']) { background: ${t.text}; color: ${t.surfaceCard}; }
|
|
2229
|
+
@media (forced-colors: active) { :host([look='pill']) :is([role='tab'][aria-selected='true'], nav a[aria-current='page']) { border: 2px solid Highlight; } }
|
|
2230
|
+
`]}countOf(e){return typeof e.count!="number"?l:e.countLabel?a`<span class="count" aria-hidden="true">${e.count}</span><span class="sr-only">, ${e.countLabel}</span>`:a`<span class="count">${e.count}</span>`}get linked(){let e=this.items??[];return e.length>0&&e.every(i=>!!i.href)}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()),o={ArrowRight:r+1,ArrowLeft:r-1,Home:0,End:i.length-1}[e.key];o===void 0||!i.length||(e.preventDefault(),this.choose(i[(o+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,o=r+i.offsetWidth;r<e.scrollLeft?e.scrollLeft=r-16:o>e.scrollLeft+e.clientWidth&&(e.scrollLeft=o-e.clientWidth+16)}updated(e){(e.has("selected")||e.has("items"))&&this.reveal()}render(){let e=this.items??[],i=this.current();if(this.linked)return a`<nav aria-label=${this.label||l} part="tabs"><ul>
|
|
2231
|
+
${e.map(o=>a`<li><a href=${o.href} part="tab" aria-current=${o.id===i?"page":l} @click=${d=>ie(this,d,{href:o.href,id:o.id})}>${o.label}${this.countOf(o)}</a></li>`)}
|
|
2232
|
+
</ul></nav>`;let r=e.length>4;return a`<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}>
|
|
2233
|
+
${e.map(o=>a`<button role="tab" type="button" id=${this.id_(`tab-${o.id}`)} aria-selected=${o.id===i?"true":"false"} aria-controls=${this.id_(`panel-${o.id}`)} tabindex=${o.id===i?"0":"-1"} @click=${()=>this.choose(o.id,!1)}>${o.label}${this.countOf(o)}</button>`)}
|
|
1595
2234
|
</div>
|
|
1596
|
-
${e.map(
|
|
2235
|
+
${e.map(o=>a`<div role="tabpanel" id=${this.id_(`panel-${o.id}`)} aria-labelledby=${this.id_(`tab-${o.id}`)} tabindex="0" ?hidden=${o.id!==i} part="panel"><slot name=${o.id}><span class="body">${o.body??""}</span></slot></div>`)}`}};customElements.define("impakt-divider",it);customElements.define("impakt-spacer",rt);customElements.define("impakt-visually-hidden",st);customElements.define("impakt-tabs",at);var ot=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
2236
|
:host { display: block; margin-block-end: ${s(6)}; }
|
|
1598
2237
|
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
1599
|
-
legend { padding: 0; margin-block-end: ${s(2)}; font-size: ${g("md")}; font-weight: ${m("bold")}; line-height: ${
|
|
2238
|
+
legend { padding: 0; margin-block-end: ${s(2)}; font-size: ${g("md")}; font-weight: ${m("bold")}; line-height: ${R("tight")}; color: ${t.text}; }
|
|
1600
2239
|
:host([size='lg']) legend { font-size: ${g("xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
|
|
1601
2240
|
: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: ${
|
|
2241
|
+
.description { margin-block-end: ${s(3)}; font-size: ${g("sm")}; color: ${t.textMuted}; line-height: ${R("normal")}; }
|
|
1603
2242
|
.error { margin-block-end: ${s(3)}; font-size: ${g("sm")}; color: ${t.dangerText}; font-weight: ${m("semibold")}; }
|
|
1604
2243
|
.error:empty { display: none; }
|
|
1605
2244
|
: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
|
|
2245
|
+
`]}render(){let e=[this.description?this.id_("description"):"",this.error?this.id_("error"):""].filter(Boolean).join(" ");return a`<fieldset part="fieldset" aria-describedby=${e||l}>
|
|
1607
2246
|
<legend part="legend">${this.legend}</legend>
|
|
1608
|
-
${this.description?
|
|
2247
|
+
${this.description?a`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
1609
2248
|
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
1610
2249
|
<div class="fields" part="fields"><slot></slot></div>
|
|
1611
|
-
</fieldset>`}};customElements.define("impakt-fieldset",
|
|
2250
|
+
</fieldset>`}};customElements.define("impakt-fieldset",ot);var nt=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,x,E(".close"),p`
|
|
1612
2251
|
dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
|
|
1613
2252
|
dialog[open] { display: flex; }
|
|
1614
2253
|
:host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
|
|
2254
|
+
:host([side='bottom']) dialog { inline-size: 100vw; block-size: fit-content; max-block-size: 90dvh; margin: auto 0 0 0; padding-block-end: env(safe-area-inset-bottom); border-radius: 28px 28px 0 0; animation-name: from-bottom; }
|
|
2255
|
+
:host([side='bottom']) .head { box-shadow: none; }
|
|
2256
|
+
:host([side='bottom']) .foot { box-shadow: none; }
|
|
2257
|
+
:host([side='bottom']) .foot ::slotted(*) { flex: 1; }
|
|
2258
|
+
@keyframes from-bottom { from { transform: translateY(100%); } }
|
|
1615
2259
|
dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
|
|
1616
2260
|
@keyframes from-right { from { transform: translateX(100%); } }
|
|
1617
2261
|
@keyframes from-left { from { transform: translateX(-100%); } }
|
|
1618
2262
|
.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}; ${
|
|
1620
|
-
.close { ${
|
|
2263
|
+
h2 { margin: 0; font-family: ${t.fontHeading}; ${$("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
2264
|
+
.close { ${w} 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
2265
|
.close:hover { background: ${t.surfaceSubtle}; }
|
|
1622
2266
|
.body { flex: 1; overflow: auto; padding: ${s(5)}; }
|
|
1623
2267
|
.foot { display: flex; gap: ${s(3)}; justify-content: flex-end; padding: ${s(4)} ${s(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
|
|
1624
2268
|
.foot[hidden] { display: none; }
|
|
1625
|
-
`]}get dialog(){return this.renderRoot.querySelector("dialog")}updated(i){if(!i.has("open"))return;let r=this.dialog;r&&(this.open?(typeof r.showModal=="function"?r.showModal():r.setAttribute("open",""),ne(this)):(typeof r.close=="function"&&r.open?r.close():r.removeAttribute("open"),W(this)))}disconnectedCallback(){super.disconnectedCallback(),W(this)}close(){this.open=!1,this.dispatchEvent(new CustomEvent("impakt-close",{bubbles:!0,composed:!0}))}footerChanged(i){this.hasFooter=i.target.assignedNodes().length>0,this.requestUpdate()}render(){return
|
|
2269
|
+
`]}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 a`<dialog part="dialog" aria-labelledby=${this.heading?this.id_("heading"):l}
|
|
1626
2270
|
@cancel=${()=>this.close()}
|
|
1627
2271
|
@close=${()=>{this.open&&this.close()}}
|
|
1628
2272
|
@click=${i=>{i.target===this.dialog&&this.close()}}>
|
|
1629
2273
|
<div class="head">
|
|
1630
|
-
${this.heading?
|
|
1631
|
-
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${
|
|
2274
|
+
${this.heading?a`<h2 id=${this.id_("heading")}>${this.heading}</h2>`:a`<span></span>`}
|
|
2275
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${S("close","20px")}</button>
|
|
1632
2276
|
</div>
|
|
1633
2277
|
<div class="body" part="body"><slot></slot></div>
|
|
1634
2278
|
<div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
|
|
1635
|
-
</dialog>`}},
|
|
2279
|
+
</dialog>`}},Ci={neutral:"info",success:"check",warning:"warning",danger:"warning"},lt=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,x,p`
|
|
1636
2280
|
.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
2281
|
@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
2282
|
.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); }
|
|
@@ -1642,21 +2286,21 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1642
2286
|
:host([tone='success']) .mark { color: ${t.success}; }
|
|
1643
2287
|
:host([tone='warning']) .mark { color: ${t.warning}; }
|
|
1644
2288
|
:host([tone='danger']) .mark { color: ${t.danger}; }
|
|
1645
|
-
.message { flex: 1; align-self: center; margin: 0; ${
|
|
1646
|
-
.action, .close { ${
|
|
2289
|
+
.message { flex: 1; align-self: center; margin: 0; ${$("sm")} font-weight: ${m("medium")}; }
|
|
2290
|
+
.action, .close { ${w} padding: 0 ${s(2)}; font: inherit; ${$("sm")} font-weight: ${m("semibold")}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
|
|
1647
2291
|
.close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }
|
|
1648
2292
|
.action:hover, .close:hover { background: ${t.surfaceSubtle}; }
|
|
1649
|
-
`,
|
|
1650
|
-
${this.open?
|
|
2293
|
+
`,E(".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 a`<div class="region" role="status" aria-live="polite">
|
|
2294
|
+
${this.open?a`<div class="toast" part="toast" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}
|
|
1651
2295
|
@keydown=${e=>{e.key==="Escape"&&(e.preventDefault(),this.close())}}>
|
|
1652
|
-
<span class="mark">${
|
|
2296
|
+
<span class="mark">${S(Ci[this.tone]??"info","20px")}</span>
|
|
1653
2297
|
<p class="message">${this.message}</p>
|
|
1654
|
-
${this.actionText?
|
|
1655
|
-
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${
|
|
2298
|
+
${this.actionText?a`<button class="action" type="button" @click=${this.action}>${this.actionText}</button>`:l}
|
|
2299
|
+
<button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${S("close","16px")}</button>
|
|
1656
2300
|
</div>`:l}
|
|
1657
|
-
</div>`}},
|
|
2301
|
+
</div>`}},dt=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,x,E(".trigger, .item"),p`
|
|
1658
2302
|
:host { position: relative; display: inline-block; }
|
|
1659
|
-
.trigger { ${
|
|
2303
|
+
.trigger { ${w} display: inline-flex; align-items: center; gap: ${s(2)}; padding: ${s(2)} ${s(3.5)}; font: inherit; ${$("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
2304
|
.trigger:hover { background: ${t.surfaceSubtle}; }
|
|
1661
2305
|
.chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }
|
|
1662
2306
|
:host([open]) .chev { transform: rotate(180deg); }
|
|
@@ -1664,64 +2308,64 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1664
2308
|
:host([edge='end']) .list, .list.flip-end { inset-inline: auto 0; }
|
|
1665
2309
|
:host([edge='end']) .list.flip-start { inset-inline: 0 auto; }
|
|
1666
2310
|
@keyframes pop { from { opacity: 0; transform: translateY(-${s(1)}); } }
|
|
1667
|
-
.item { ${
|
|
2311
|
+
.item { ${w} box-sizing: border-box; display: flex; align-items: center; gap: ${s(2.5)}; inline-size: 100%; padding: ${s(2)} ${s(2.5)}; font: inherit; ${$("sm")} text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
|
|
1668
2312
|
.item:hover, .item:focus { background: ${t.surfaceSubtle}; }
|
|
1669
2313
|
.item.danger { color: ${t.dangerText}; }
|
|
1670
2314
|
.item svg { flex: none; }
|
|
1671
|
-
`]}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.outside)}get entries(){return Array.from(this.renderRoot.querySelectorAll(".item"))}get trigger(){return this.renderRoot.querySelector(".trigger")}toggle(i,r){this.open=i,i?(document.addEventListener("click",this.outside),this.updateComplete.then(()=>{this.keepOnScreen(),this.entries[r==="last"?this.entries.length-1:0]?.focus()})):document.removeEventListener("click",this.outside)}keepOnScreen(){let i=this.renderRoot.querySelector(".list");if(!i)return;i.classList.remove("flip-start","flip-end");let r=i.getBoundingClientRect(),
|
|
1672
|
-
@click=${()=>this.toggle(!this.open)} @keydown=${this.triggerKey}>${
|
|
1673
|
-
${this.open?
|
|
1674
|
-
${this.items.map(r=>
|
|
1675
|
-
</ul>`:l}`}};function
|
|
2315
|
+
`]}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(),o=document.documentElement.clientWidth;r.right>o-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,o=r.indexOf(this.renderRoot.activeElement),d={ArrowDown:(o+1)%r.length,ArrowUp:(o-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(o+1),...r.slice(0,o+1)].find(y=>(y.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=>a`${S(r.icon,"18px")}<span>${r.text}</span>`;return a`<button class="trigger" part="trigger" type="button" aria-haspopup="menu" aria-expanded=${String(this.open)} aria-controls=${this.id_("list")}
|
|
2316
|
+
@click=${()=>this.toggle(!this.open)} @keydown=${this.triggerKey}>${S(this.icon,"18px")}${this.label}<span class="chev">${S("chevron-down","16px")}</span></button>
|
|
2317
|
+
${this.open?a`<ul class="list" part="list" id=${this.id_("list")} role="menu" aria-label=${this.label} @keydown=${this.listKey}>
|
|
2318
|
+
${this.items.map(r=>a`<li role="none">${r.href?a`<a class="item ${r.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" href=${r.href} @click=${()=>this.choose(r)}>${i(r)}</a>`:a`<button class="item ${r.tone==="danger"?"danger":""}" role="menuitem" tabindex="-1" type="button" @click=${()=>this.choose(r)}>${i(r)}</button>`}</li>`)}
|
|
2319
|
+
</ul>`:l}`}};function Li(n,e){let i=[...new Set([1,n-1,n,n+1,e])].filter(r=>r>=1&&r<=e).sort((r,o)=>r-o);return i.flatMap((r,o)=>{let d=i[o-1];return d===void 0||r===d+1?[r]:r===d+2?[d+1,r]:["gap",r]})}var ct=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,x,E(".n, .step"),p`
|
|
1676
2320
|
:host { display: block; container-type: inline-size; }
|
|
1677
2321
|
nav { display: flex; align-items: center; justify-content: space-between; gap: ${s(2)}; }
|
|
1678
2322
|
ul { display: flex; align-items: center; gap: ${s(1)}; margin: 0; padding: 0; list-style: none; }
|
|
1679
|
-
.n, .step { ${
|
|
2323
|
+
.n, .step { ${w} 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; ${$("sm")} font-weight: ${m("medium")}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
|
|
1680
2324
|
.n:hover, .step:hover { background: ${t.surfaceSubtle}; }
|
|
1681
2325
|
.n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${m("semibold")}; }
|
|
1682
2326
|
.step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }
|
|
1683
2327
|
.gap { color: ${t.textMuted}; padding: 0 ${s(1)}; }
|
|
1684
|
-
.count { display: none; ${
|
|
2328
|
+
.count { display: none; ${$("sm")} color: ${t.textMuted}; }
|
|
1685
2329
|
@container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
|
|
1686
|
-
`]}go(e,i){this.hrefPattern||(i.preventDefault(),this.page=e,this.dispatchEvent(new CustomEvent("impakt-page",{detail:{page:e},bubbles:!0,composed:!0})))}link(e,i,r,
|
|
2330
|
+
`]}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,o,d){return this.hrefPattern?a`<a class=${i} href=${this.hrefPattern.replace("{page}",String(e))} aria-label=${o} aria-current=${d?"page":l}>${r}</a>`:a`<button class=${i} type="button" aria-label=${o} aria-current=${d?"page":l} @click=${h=>this.go(e,h)}>${r}</button>`}step(e,i,r,o){let d=r==="arrow-left"?a`${S(r,"16px")}${i}`:a`${i}${S(r,"16px")}`;return o?a`<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 a`<nav aria-label=${this.label} part="nav">
|
|
1687
2331
|
${this.step(e-1,this.previousText,"arrow-left",e<=1)}
|
|
1688
|
-
<ul>${
|
|
1689
|
-
<span class="count">${
|
|
2332
|
+
<ul>${Li(e,this.pages).map(i=>a`<li>${i==="gap"?a`<span class="gap" aria-hidden="true">…</span>`:this.link(i,"n",i,v("Page {page}",{page:i}),i===e)}</li>`)}</ul>
|
|
2333
|
+
<span class="count">${v("Page {page} of {pages}",{page:e,pages:this.pages})}</span>
|
|
1690
2334
|
${this.step(e+1,this.nextText,"arrow-right",e>=this.pages)}
|
|
1691
|
-
</nav>`}}
|
|
2335
|
+
</nav>`}},Ri=n=>{let e=n.trim().split(/\s+/).filter(Boolean);return((e[0]?.[0]??"")+(e.length>1?e[e.length-1][0]:"")).toUpperCase()},pt=class extends c{constructor(){super();this.failed=!1;this.fullName="",this.src="",this.size="md"}static{this.properties={fullName:{type:String,attribute:"full-name"},src:{type:String},size:{type:String,reflect:!0}}}static{this.styles=[...c.styles,p`
|
|
1692
2336
|
:host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
|
|
1693
2337
|
:host([size='sm']) { --size: 32px; }
|
|
1694
2338
|
:host([size='lg']) { --size: 56px; }
|
|
1695
2339
|
:host([size='xl']) { --size: 80px; }
|
|
1696
2340
|
.face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${m("semibold")}; }
|
|
1697
2341
|
img { inline-size: 100%; block-size: 100%; object-fit: cover; }
|
|
1698
|
-
`]}willUpdate(i){i.has("src")&&(this.failed=!1)}render(){return this.src&&!this.failed?
|
|
2342
|
+
`]}willUpdate(i){i.has("src")&&(this.failed=!1)}render(){return this.src&&!this.failed?a`<div class="face"><img src=${this.src} alt=${this.fullName} @error=${()=>{this.failed=!0,this.requestUpdate()}} /></div>`:a`<div class="face" role="img" aria-label=${this.fullName||v("Person")}>${Ri(this.fullName)||S("user","55%")}</div>`}},ht=class extends c{static{this.properties={items:{type:Array},max:{type:Number},size:{type:String,reflect:!0},moreLabel:{type:String,attribute:"more-label"}}}constructor(){super(),this.items=[],this.max=4,this.size="md",this.moreLabel="more people"}static{this.styles=[...c.styles,p`
|
|
1699
2343
|
ul { display: flex; margin: 0; padding: 0; list-style: none; }
|
|
1700
2344
|
li { margin-inline-start: -${s(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }
|
|
1701
2345
|
li:first-child { margin-inline-start: 0; }
|
|
1702
|
-
.more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${
|
|
2346
|
+
.more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${$("xs")} line-height: 1; font-weight: ${m("semibold")}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }
|
|
1703
2347
|
:host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
|
|
1704
2348
|
:host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
|
|
1705
|
-
.sr { ${
|
|
1706
|
-
`]}render(){let e=this.items.slice(0,this.max),i=this.items.length-e.length;return
|
|
1707
|
-
${e.map(r=>
|
|
1708
|
-
${i>0?
|
|
1709
|
-
</ul>`}},
|
|
2349
|
+
.sr { ${z} }
|
|
2350
|
+
`]}render(){let e=this.items.slice(0,this.max),i=this.items.length-e.length;return a`<ul part="list">
|
|
2351
|
+
${e.map(r=>a`<li><impakt-avatar full-name=${r.name} src=${r.src??""} size=${this.size}></impakt-avatar></li>`)}
|
|
2352
|
+
${i>0?a`<li><span class="more"><span aria-hidden="true">+${i}</span><span class="sr">${i} ${this.moreLabel}</span></span></li>`:l}
|
|
2353
|
+
</ul>`}},ut=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,L,p`
|
|
1710
2354
|
.wrap { display: flex; flex-direction: column; align-items: center; gap: ${s(2)}; padding: ${s(12)} ${s(6)}; text-align: center; }
|
|
1711
2355
|
:host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }
|
|
1712
2356
|
.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}; ${
|
|
2357
|
+
.h { margin: 0; font-family: ${t.fontHeading}; ${$("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
1714
2358
|
p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }
|
|
1715
2359
|
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${s(3)}; margin-block-start: ${s(3)}; }
|
|
1716
|
-
`]}render(){return
|
|
1717
|
-
<span class="mark">${
|
|
1718
|
-
${this.heading?
|
|
1719
|
-
${this.lead?
|
|
2360
|
+
`]}render(){return a`<div class="wrap" part="wrap">
|
|
2361
|
+
<span class="mark">${S(this.icon,"26px")}</span>
|
|
2362
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2363
|
+
${this.lead?a`<p>${this.lead}</p>`:l}
|
|
1720
2364
|
<div class="actions"><slot name="actions"></slot></div>
|
|
1721
|
-
</div>`}},
|
|
2365
|
+
</div>`}},_i=n=>String(n?.times??"").split(",").map(e=>e.trim()).filter(Boolean);function Ii(n){let e=new Date(`${n}T00:00:00Z`);if(Number.isNaN(e.getTime()))return{weekday:"",day:n,month:""};let i=_(),r=o=>new Intl.DateTimeFormat(i,{timeZone:"UTC",...o}).format(e);return{weekday:r({weekday:"short"}),day:r({day:"numeric"}),month:r({month:"short"})}}var mt=class extends b{constructor(){super();this.day="";this.days=[],this.dayLabel="Day",this.timeLabel="Time",this.emptyText="No times are available at the moment."}static{this.properties={...b.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=[...b.styles,p`
|
|
1722
2366
|
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
|
1723
2367
|
legend { padding: 0; }
|
|
1724
|
-
.row-label { ${
|
|
2368
|
+
.row-label { ${$("sm")} color: ${t.textMuted}; margin-block: ${s(2)}; }
|
|
1725
2369
|
.days { display: flex; gap: ${s(2)}; overflow-x: auto; padding: ${s(1)}; margin: -${s(1)}; scrollbar-width: thin; }
|
|
1726
2370
|
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${s(2)}; }
|
|
1727
2371
|
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; }
|
|
@@ -1730,26 +2374,26 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1730
2374
|
label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }
|
|
1731
2375
|
input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
1732
2376
|
.day { flex: none; inline-size: 4.5rem; padding-block: ${s(2.5)}; }
|
|
1733
|
-
.weekday, .month { ${
|
|
1734
|
-
.num { ${
|
|
1735
|
-
.time { padding: ${s(2)}; ${
|
|
2377
|
+
.weekday, .month { ${$("xs")} }
|
|
2378
|
+
.num { ${$("xl")} font-weight: ${m("semibold")}; }
|
|
2379
|
+
.time { padding: ${s(2)}; ${$("sm")} font-weight: ${m("medium")}; }
|
|
1736
2380
|
.empty { margin: 0; color: ${t.textMuted}; }
|
|
1737
2381
|
: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
|
|
2382
|
+
`]}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 a`<legend class="label" part="label">${this.label}${this.required?a`<span class="required"> (${this.requiredText})</span>`:l}</legend>`}renderControl(){let i=this.currentDay;return i?a`
|
|
1739
2383
|
<div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
|
|
1740
2384
|
<div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
|
|
1741
|
-
${this.days.map(r=>{let
|
|
1742
|
-
<span class="weekday">${
|
|
2385
|
+
${this.days.map(r=>{let o=Ii(r.date);return a`<label class="day"><input type="radio" name=${`${this.uid}-day`} .checked=${r.date===i.date} ?disabled=${this.disabled} @change=${()=>this.chooseDay(r.date)} />
|
|
2386
|
+
<span class="weekday">${o.weekday}</span><span class="num">${o.day}</span><span class="month">${o.month}</span></label>`})}
|
|
1743
2387
|
</div>
|
|
1744
2388
|
<div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
|
|
1745
2389
|
<div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
|
|
1746
|
-
${
|
|
1747
|
-
</div>`:
|
|
2390
|
+
${_i(i).map((r,o)=>{let d=`${i.date}T${r}`;return a`<label class="time"><input type="radio" name=${`${this.uid}-time`} .checked=${this.value===d} ?required=${this.required&&o===0} ?disabled=${this.disabled} @change=${()=>this.setFormValue(d)} />${r}</label>`})}
|
|
2391
|
+
</div>`:a`<p class="empty">${this.emptyText}</p>`}render(){return a`<fieldset part="fieldset" ?disabled=${this.disabled} aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}>
|
|
1748
2392
|
${this.renderLabel()}
|
|
1749
|
-
${this.description?
|
|
2393
|
+
${this.description?a`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>`:l}
|
|
1750
2394
|
${this.renderControl()}
|
|
1751
2395
|
<div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error||l}</div>
|
|
1752
|
-
</fieldset>`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-drawer",
|
|
2396
|
+
</fieldset>`}updated(i){i.has("error")&&this.toggleAttribute("invalid",!!this.error)}};customElements.define("impakt-drawer",nt);customElements.define("impakt-toast",lt);customElements.define("impakt-menu",dt);customElements.define("impakt-pagination",ct);customElements.define("impakt-avatar",pt);customElements.define("impakt-avatar-group",ht);customElements.define("impakt-empty-state",ut);customElements.define("impakt-slot-picker",mt);var Ot=p`
|
|
1753
2397
|
input, select {
|
|
1754
2398
|
box-sizing: border-box;
|
|
1755
2399
|
inline-size: min(100%, var(--impakt-field-width));
|
|
@@ -1778,25 +2422,25 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1778
2422
|
}
|
|
1779
2423
|
.btn:hover { background: ${t.brandHover}; }
|
|
1780
2424
|
.quiet { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; padding: 0; font: inherit; color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }
|
|
1781
|
-
.visually-hidden { ${
|
|
1782
|
-
`,
|
|
2425
|
+
.visually-hidden { ${z} }
|
|
2426
|
+
`,D=class extends b{static{this.properties={...b.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=[...b.styles,I,Ot,p`
|
|
1783
2427
|
.row { display: flex; flex-wrap: wrap; gap: ${s(2)}; align-items: flex-end; }
|
|
1784
|
-
.row label { display: block; ${
|
|
2428
|
+
.row label { display: block; ${$("sm")} font-weight: ${m("semibold")}; margin-block-end: ${s(1)}; }
|
|
1785
2429
|
.postcode input { inline-size: 12ch; text-transform: uppercase; }
|
|
1786
2430
|
.choose { margin-block-start: ${s(4)}; }
|
|
1787
2431
|
.choose select { inline-size: 100%; }
|
|
1788
2432
|
.manual { display: grid; gap: ${s(3)}; margin-block-start: ${s(3)}; }
|
|
1789
|
-
.manual label { display: block; ${
|
|
2433
|
+
.manual label { display: block; ${$("sm")} margin-block-end: ${s(1)}; }
|
|
1790
2434
|
.manual input { inline-size: 100%; }
|
|
1791
|
-
.note { ${
|
|
2435
|
+
.note { ${$("sm")} color: ${t.textMuted}; margin: ${s(2)} 0 0; }
|
|
1792
2436
|
.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,
|
|
1794
|
-
${e("line1",
|
|
1795
|
-
${e("line2",
|
|
1796
|
-
${e("town",
|
|
1797
|
-
${e("mpostcode",
|
|
1798
|
-
<button class="quiet switch" type="button" @click=${()=>{this.manual=!1}}>${
|
|
1799
|
-
</div>`}return
|
|
2437
|
+
`]}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,o)=>a`<div><label for=${this.id_(i)}>${r}</label><input id=${this.id_(i)} autocomplete=${o} @input=${()=>this.setFormValue(this.manualLine())} /></div>`;return a`<div class="manual" role="group" aria-label=${this.label}>
|
|
2438
|
+
${e("line1",v("Building and street"),"address-line1")}
|
|
2439
|
+
${e("line2",v("Second line (optional)"),"address-line2")}
|
|
2440
|
+
${e("town",v("Town or city"),"address-level2")}
|
|
2441
|
+
${e("mpostcode",v("Postcode"),"postal-code")}
|
|
2442
|
+
<button class="quiet switch" type="button" @click=${()=>{this.manual=!1}}>${v("Find the address from the postcode")}</button>
|
|
2443
|
+
</div>`}return a`
|
|
1800
2444
|
<div class="row">
|
|
1801
2445
|
<div class="postcode"><label for=${this.controlId}>${this.postcodeLabel}</label>
|
|
1802
2446
|
<input id=${this.controlId} autocomplete="postal-code" .value=${this.postcode} aria-describedby=${this.describedBy}
|
|
@@ -1804,23 +2448,23 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1804
2448
|
@keydown=${e=>{e.key==="Enter"&&(e.preventDefault(),this.find())}} /></div>
|
|
1805
2449
|
<button class="btn" type="button" ?disabled=${this.busy} @click=${()=>this.find()}>${this.busy?"Finding\u2026":this.findText}</button>
|
|
1806
2450
|
</div>
|
|
1807
|
-
${this.addresses.length?
|
|
2451
|
+
${this.addresses.length?a`<div class="choose"><label class="label" for=${this.id_("choose")}>${this.chooseLabel}</label>
|
|
1808
2452
|
<select id=${this.id_("choose")} @change=${e=>this.setFormValue(e.target.value)}>
|
|
1809
2453
|
<option value="">${this.addresses.length} ${this.addresses.length===1?"address":"addresses"} found</option>
|
|
1810
|
-
${this.addresses.map(e=>
|
|
1811
|
-
</select></div>`:this.searched&&!this.busy?
|
|
2454
|
+
${this.addresses.map(e=>a`<option value=${e.line} ?selected=${e.line===this.value}>${e.line}</option>`)}
|
|
2455
|
+
</select></div>`:this.searched&&!this.busy?a`<p class="note" role="status">${this.notFoundText}</p>`:l}
|
|
1812
2456
|
<button class="quiet switch" type="button" @click=${()=>{this.manual=!0}}>${this.manualText}</button>
|
|
1813
|
-
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},
|
|
2457
|
+
`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},gt=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,x,L,E("a"),p`
|
|
1814
2458
|
:host { display: block; }
|
|
1815
2459
|
.box { padding: ${s(5)}; border: ${t.borderThick} solid ${t.danger}; border-inline-start-width: 6px; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }
|
|
1816
2460
|
.box:focus { outline: 3px solid ${t.danger}; outline-offset: 2px; }
|
|
1817
|
-
h2 { margin: 0 0 ${s(3)}; ${
|
|
2461
|
+
h2 { margin: 0 0 ${s(3)}; ${$("lg")} font-weight: ${m("bold")}; color: ${t.text}; }
|
|
1818
2462
|
ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${s(2)}; }
|
|
1819
2463
|
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?
|
|
2464
|
+
`]}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?a`<div class="box" role="alert" tabindex="-1" aria-labelledby=${this.id_("h")} part="box">
|
|
1821
2465
|
<h2 id=${this.id_("h")}>${this.heading}</h2>
|
|
1822
|
-
<ul>${this.items.map(e=>
|
|
1823
|
-
</div>`:l}},
|
|
2466
|
+
<ul>${this.items.map(e=>a`<li><a href=${e.href} @click=${i=>this.go(i,e.href)}>${e.text}</a></li>`)}</ul>
|
|
2467
|
+
</div>`:l}},Hi=n=>n>=1048576?v("{size} MB",{size:(n/1048576).toFixed(1)}):v("{size} KB",{size:Math.max(1,Math.round(n/1024))}),V=class extends b{static{this.properties={...b.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=[...b.styles,Ot,w,E("label.btn, .quiet"),p`
|
|
1824
2468
|
.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
2469
|
.zone.over { border-color: ${t.brand}; background: ${t.brandSubtle}; }
|
|
1826
2470
|
:host([invalid]) .zone { border-color: ${t.danger}; border-style: solid; }
|
|
@@ -1831,8 +2475,8 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1831
2475
|
input[type='file']:focus-visible + label.btn { box-shadow: ${t.focusShadow}; }
|
|
1832
2476
|
ul { margin: ${s(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${s(2)}; }
|
|
1833
2477
|
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}; ${
|
|
1835
|
-
`]}fits(e){if(this.maxSizeMb&&e.size>this.maxSizeMb*1048576)return
|
|
2478
|
+
.size { color: ${t.textMuted}; ${$("sm")} }
|
|
2479
|
+
`]}fits(e){if(this.maxSizeMb&&e.size>this.maxSizeMb*1048576)return v("{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)))?v("{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),o=i.filter(h=>!this.fits(h)),d=this.manyFiles?o:o.slice(0,1);this.files=this.manyFiles?[...this.files,...o]:d.length?d:this.files,this.error=r.join(". "),this.said=d.map(h=>v("{file} added",{file:h.name})).join(". "),this.sync()}removeFile(e){let i=this.files[e];this.files=this.files.filter((r,o)=>o!==e),this.said=i?v("{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 a`
|
|
1836
2480
|
<div class="zone ${this.over?"over":""}"
|
|
1837
2481
|
@dragover=${e=>{e.preventDefault(),this.over=!0}}
|
|
1838
2482
|
@dragleave=${()=>{this.over=!1}}
|
|
@@ -1843,51 +2487,51 @@ var de=globalThis,ce=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeSha
|
|
|
1843
2487
|
<span class="drop">${this.dropText}</span>
|
|
1844
2488
|
</div>
|
|
1845
2489
|
<p class="visually-hidden" role="status">${this.said}</p>
|
|
1846
|
-
${this.files.length?
|
|
1847
|
-
`}};function
|
|
2490
|
+
${this.files.length?a`<ul aria-label=${v("Files added")}>${this.files.map((e,i)=>a`<li><span>${e.name} <span class="size">${Hi(e.size)}</span></span><button class="quiet" type="button" @click=${()=>this.removeFile(i)}>${v("Remove")}<span class="visually-hidden"> ${e.name}</span></button></li>`)}</ul>`:l}
|
|
2491
|
+
`}};function Bt(n){try{return new Intl.NumberFormat(_(),{style:"currency",currency:n,maximumFractionDigits:0}).formatToParts(0).find(e=>e.type==="currency")?.value??""}catch{return""}}function Nt(n){let e=n.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 le=class extends b{static{this.properties={...b.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=[...b.styles,I,Ot,p`
|
|
1848
2492
|
.wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impakt-field-width)); }
|
|
1849
2493
|
.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
2494
|
.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=
|
|
1852
|
-
<span class="sign" id=${this.id_("sign")}>${
|
|
2495
|
+
`]}willUpdate(e){e.has("value")&&this.value!==this.shown.replace(/,/g,"")&&(this.shown=Nt(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=Nt(this.value);let e=Number(this.value);if(!this.value)return;let i=r=>`${Bt(this.currency)}${r.toLocaleString("en-GB")}`;this.lowest!==void 0&&e<this.lowest?this.error=v("Enter an amount of {amount} or more",{amount:i(this.lowest)}):this.highest!==void 0&&e>this.highest?this.error=v("Enter an amount of {amount} or less",{amount:i(this.highest)}):(this.error===v("Enter an amount of {amount} or more",{amount:i(this.lowest??0)})||this.error===v("Enter an amount of {amount} or less",{amount:i(this.highest??0)}))&&(this.error="")}get describedBy(){let e=[Bt(this.currency)?this.id_("sign"):"",super.describedBy===l?"":String(super.describedBy)].filter(Boolean);return e.length?e.join(" "):l}renderControl(){return a`<div class="wrap">
|
|
2496
|
+
<span class="sign" id=${this.id_("sign")}>${Bt(this.currency)}</span>
|
|
1853
2497
|
<input id=${this.controlId} inputmode=${this.pence?"decimal":"numeric"} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}
|
|
1854
2498
|
aria-describedby=${this.describedBy} aria-invalid=${this.error?"true":l}
|
|
1855
2499
|
@input=${e=>this.typed(e.target.value)} @blur=${()=>this.check()} />
|
|
1856
|
-
</div>`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},
|
|
2500
|
+
</div>`}updated(e){e.has("error")&&this.toggleAttribute("invalid",!!this.error)}},bt=class extends b{static{this.properties={...b.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=[...b.styles,p`
|
|
1857
2501
|
.top { display: flex; justify-content: space-between; gap: ${s(3)}; }
|
|
1858
2502
|
output { font-weight: ${m("semibold")}; color: ${t.text}; }
|
|
1859
2503
|
input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${t.brand}; }
|
|
1860
|
-
.ends { display: flex; justify-content: space-between; ${
|
|
1861
|
-
`]}shownAs(e){let i=
|
|
1862
|
-
<div class="top"><label class="label" for=${this.controlId}>${this.label}${this.required?
|
|
2504
|
+
.ends { display: flex; justify-content: space-between; ${$("sm")} color: ${t.textMuted}; }
|
|
2505
|
+
`]}shownAs(e){let 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 a`
|
|
2506
|
+
<div class="top"><label class="label" for=${this.controlId}>${this.label}${this.required?a` <span class="required">(${this.requiredText})</span>`:l}</label>
|
|
1863
2507
|
<output for=${this.controlId}>${this.shownAs(e)}</output></div>
|
|
1864
|
-
${this.description?
|
|
2508
|
+
${this.description?a`<div class="description" id=${this.id_("description")}>${this.description}</div>`:l}
|
|
1865
2509
|
${this.renderControl()}
|
|
1866
2510
|
<div class="ends" aria-hidden="true"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>
|
|
1867
2511
|
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error||l}</div>
|
|
1868
|
-
`}renderControl(){return
|
|
2512
|
+
`}renderControl(){return a`<input id=${this.controlId} type="range" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}
|
|
1869
2513
|
aria-valuetext=${this.shownAs(Number(this.value)||0)} aria-describedby=${this.describedBy}
|
|
1870
|
-
@input=${e=>this.setFormValue(e.target.value)} />`}},
|
|
2514
|
+
@input=${e=>this.setFormValue(e.target.value)} />`}},oi={done:"Completed","in-progress":"In progress","not-started":"Not started","cannot-start":"Cannot start yet"},ft=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,x,L,E("a"),p`
|
|
1871
2515
|
:host { display: block; }
|
|
1872
|
-
.h { margin: 0 0 ${s(2)}; ${
|
|
2516
|
+
.h { margin: 0 0 ${s(2)}; ${$("xl")} font-weight: ${m("bold")}; color: ${t.textHeading}; }
|
|
1873
2517
|
.count { margin: 0 0 ${s(4)}; color: ${t.textMuted}; }
|
|
1874
2518
|
ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${t.rule}; }
|
|
1875
2519
|
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
2520
|
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
2521
|
.title { font-weight: ${m("semibold")}; }
|
|
1878
|
-
.hint { display: block; ${
|
|
1879
|
-
.tag { flex-shrink: 0; padding: ${s(1)} ${s(2.5)}; border-radius: 999px; ${
|
|
2522
|
+
.hint { display: block; ${$("sm")} color: ${t.textMuted}; }
|
|
2523
|
+
.tag { flex-shrink: 0; padding: ${s(1)} ${s(2.5)}; border-radius: 999px; ${$("sm")} font-weight: ${m("semibold")}; background: ${t.surfaceInset}; color: ${t.text}; }
|
|
1880
2524
|
.tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
1881
2525
|
.tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }
|
|
1882
2526
|
.tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }
|
|
1883
|
-
`]}render(){let e=this.items.filter(i=>i.status==="done").length;return
|
|
1884
|
-
${this.heading?
|
|
1885
|
-
${this.items.length?
|
|
1886
|
-
<ul>${this.items.map(i=>
|
|
1887
|
-
<span>${i.href&&i.status!=="cannot-start"?
|
|
1888
|
-
${i.hint?
|
|
1889
|
-
<span class="tag" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${
|
|
1890
|
-
</li>`)}</ul>`}};
|
|
2527
|
+
`]}render(){let e=this.items.filter(i=>i.status==="done").length;return a`
|
|
2528
|
+
${this.heading?a`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>`:l}
|
|
2529
|
+
${this.items.length?a`<p class="count">${v(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}
|
|
2530
|
+
<ul>${this.items.map(i=>a`<li>
|
|
2531
|
+
<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>`}
|
|
2532
|
+
${i.hint?a`<span class="hint">${i.hint}</span>`:l}</span>
|
|
2533
|
+
<span class="tag" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${oi[i.status]?v(oi[i.status]):i.status}</span>
|
|
2534
|
+
</li>`)}</ul>`}};D.createProperty("manual",{state:!0});D.createProperty("postcode",{state:!0});D.createProperty("searched",{state:!0});D.createProperty("busy",{state:!0});V.createProperty("files",{state:!0});V.createProperty("over",{state:!0});V.createProperty("said",{state:!0});le.createProperty("shown",{state:!0});customElements.define("impakt-address-lookup",D);customElements.define("impakt-error-summary",gt);customElements.define("impakt-file-upload",V);customElements.define("impakt-money-input",le);customElements.define("impakt-range-input",bt);customElements.define("impakt-task-list",ft);export{se as CYCLE,b as FieldElement,Rt as ICONS,vi as ICON_NAMES,De as ImpaktAccordion,D as ImpaktAddressLookup,Ae as ImpaktAlert,ke as ImpaktAppShell,pt as ImpaktAvatar,ht as ImpaktAvatarGroup,Ue as ImpaktBadge,tt as ImpaktBreadcrumbs,ge as ImpaktButton,Le as ImpaktCard,$e as ImpaktCheckbox,Ve as ImpaktCheckboxGroup,je as ImpaktChip,Ke as ImpaktDateInput,we as ImpaktDateTile,Xe as ImpaktDialog,it as ImpaktDivider,Ne as ImpaktDocumentLink,nt as ImpaktDrawer,c as ImpaktElement,ut as ImpaktEmptyState,gt as ImpaktErrorSummary,ot as ImpaktFieldset,V as ImpaktFileUpload,Te as ImpaktFilterChip,Ge as ImpaktGrid,Re as ImpaktHeading,Ze as ImpaktHelp,me as ImpaktIcon,He as ImpaktImage,Ie as ImpaktLink,Ye as ImpaktList,Be as ImpaktLogo,dt as ImpaktMenu,le as ImpaktMoneyInput,et as ImpaktNav,Je as ImpaktPage,ct as ImpaktPagination,Oe as ImpaktPrice,Fe as ImpaktProgress,Ee as ImpaktRadioGroup,bt as ImpaktRangeInput,Se as ImpaktRow,Qe as ImpaktSection,Me as ImpaktSegmentedControl,fe as ImpaktSelect,ye as ImpaktSideNav,mt as ImpaktSlotPicker,rt as ImpaktSpacer,Ce as ImpaktStack,ve as ImpaktStatTile,qe as ImpaktSummaryList,ze as ImpaktSwitch,xe as ImpaktTabBar,Pe as ImpaktTable,at as ImpaktTabs,ft as ImpaktTaskList,_e as ImpaktText,be as ImpaktTextInput,We as ImpaktTextarea,lt as ImpaktToast,st as ImpaktVisuallyHidden,N as LitElement,re as TONE,ie as announceNavigate,ii as base,p as css,I as fieldWidths,x as focusRing,g as fontSize,m as fontWeight,Nt as groupDigits,ri as hideOn,a as html,S as iconSvg,_t as isCurrent,R as lineHeight,ne as lockScroll,P as noChange,l as nothing,_ as pageLocale,ti as reducedMotion,Ct as render,v as say,s as space,L as spaceAround,f as svg,t,w as targetSize,u as token,It as toneOf,E as touchTarget,$ as type,W as unlockScroll,C as unsafeCSS,z as visuallyHidden};
|
|
1891
2535
|
/*! Bundled license information:
|
|
1892
2536
|
|
|
1893
2537
|
@lit/reactive-element/css-tag.js:
|