@vpuska/vx-components 0.0.0-stage → 0.0.1

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 CHANGED
@@ -1,3 +1,47 @@
1
- # Temporary Holding Version
1
+ # VX-COMPONENTS
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A custom component library built with TypeScript, [Lit](https://lit.dev/) and Web Components.
4
+
5
+ The build produces two distributions. The test application (`index.html`, `src/test` and `public`) is used by `npm run dev` only and is not included in either distribution.
6
+
7
+ ## Build
8
+
9
+ ```shell
10
+ npm run build
11
+ ```
12
+
13
+ - `dist/library` contains the developer package: ES module, TypeScript declarations, and package metadata points to those outputs. Runtime dependencies are left external.
14
+ - `dist/standalone/vx-components.js` is a self-contained browser bundle with Lit and runtime dependencies included. It registers the custom elements when loaded.
15
+ - `npm run build:library` and `npm run build:standalone` build either distribution independently.
16
+
17
+ ## Use as a component library
18
+
19
+ Install the published package in an application:
20
+
21
+ ```shell
22
+ npm install vx-components
23
+ ```
24
+
25
+ Import the components to register their custom elements and use their TypeScript classes:
26
+
27
+ ```ts
28
+ import {VxButton, VxPanel, VxRoute, VxRouter, VxSvg} from 'vx-components'
29
+ ```
30
+
31
+ The package also exports SVG helpers: `registerSvgLibrary`, `getSvgLibrary`, `hasSvgLibrary`, `svg`, `systemIcons`, and the `SVGLibrary` type.
32
+
33
+ ## Use in a documentation site
34
+
35
+ Copy `dist/standalone/vx-components.js` into the separate documentation project's static assets, then load it on pages that show the examples:
36
+
37
+ ```html
38
+ <script defer src="./assets/vx-components.js"></script>
39
+
40
+ <vx-panel>
41
+ <vx-button></vx-button>
42
+ </vx-panel>
43
+ ```
44
+
45
+ Adjust the script URL to match the documentation site's GitHub Pages base path. No Vite app, test sources, or public assets need to be copied.
46
+
47
+ Component documentation: [vx-docs](https://vpuska.github.io/vx-docs/).
@@ -0,0 +1,137 @@
1
+ var VXComponents=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},r=globalThis,i=r.ShadowRoot&&(r.ShadyCSS===void 0||r.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap,s=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=o.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&o.set(t,e))}return e}toString(){return this.cssText}},c=e=>new s(typeof e==`string`?e:e+``,void 0,a),l=(e,...t)=>new s(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,a),u=(e,t)=>{if(i)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),i=r.litNonce;i!==void 0&&t.setAttribute(`nonce`,i),t.textContent=n.cssText,e.appendChild(t)}},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:ee,defineProperty:te,getOwnPropertyDescriptor:ne,getOwnPropertyNames:re,getOwnPropertySymbols:ie,getPrototypeOf:ae}=Object,f=globalThis,oe=f.trustedTypes,se=oe?oe.emptyScript:``,ce=f.reactiveElementPolyfillSupport,p=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?se:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},le=(e,t)=>!ee(e,t),ue={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:le};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var h=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,t=ue){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&te(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=ne(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ue}static _$Ei(){if(this.hasOwnProperty(p(`elementProperties`)))return;let e=ae(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(p(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p(`properties`))){let e=this.properties,t=[...re(e),...ie(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(d(e))}else e!==void 0&&t.push(d(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n: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,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(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,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?m:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?m:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??le)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}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[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.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(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};h.elementStyles=[],h.shadowRootOptions={mode:`open`},h[p(`elementProperties`)]=new Map,h[p(`finalized`)]=new Map,ce?.({ReactiveElement:h}),(f.reactiveElementVersions??=[]).push(`2.1.2`);var g=globalThis,de=e=>e,_=g.trustedTypes,fe=_?_.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,v=`$lit$`,y=`lit$${Math.random().toFixed(9).slice(2)}$`,b=`?`+y,pe=`<${b}>`,x=document,S=()=>x.createComment(``),C=e=>e===null||typeof e!=`object`&&typeof e!=`function`,me=Array.isArray,he=e=>me(e)||typeof e?.[Symbol.iterator]==`function`,w=`[
2
+ \f\r]`,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ge=/-->/g,_e=/>/g,E=RegExp(`>|${w}(?:([^\\s"'>=/]+)(${w}*=${w}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ve=/'/g,ye=/"/g,be=/^(?:script|style|textarea|title)$/i,D=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),O=Symbol.for(`lit-noChange`),k=Symbol.for(`lit-nothing`),xe=new WeakMap,A=x.createTreeWalker(x,129);function Se(e,t){if(!me(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return fe===void 0?t:fe.createHTML(t)}var Ce=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=T;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===T?c[1]===`!--`?o=ge:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=E):(be.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=E):o=_e:o===E?c[0]===`>`?(o=i??T,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?E:c[3]===`"`?ye:ve):o===ye||o===ve?o=E:o===ge||o===_e?o=T:(o=E,i=void 0);let d=o===E&&e[t+1].startsWith(`/>`)?` `:``;a+=o===T?n+pe:l>=0?(r.push(s),n.slice(0,l)+v+n.slice(l)+y+d):n+y+(l===-2?t:d)}return[Se(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},j=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Ce(t,n);if(this.el=e.createElement(l,r),A.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=A.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(v)){let t=u[o++],n=i.getAttribute(e).split(y),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Te:r[1]===`?`?Ee:r[1]===`@`?De:P}),i.removeAttribute(e)}else e.startsWith(y)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(be.test(i.tagName)){let e=i.textContent.split(y),t=e.length-1;if(t>0){i.textContent=_?_.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],S()),A.nextNode(),c.push({type:2,index:++a});i.append(e[t],S())}}}else if(i.nodeType===8){if(i.data===b)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(y,e+1))!==-1;)c.push({type:7,index:a}),e+=y.length-1}}a++}}static createElement(e,t){let n=x.createElement(`template`);return n.innerHTML=e,n}};function M(e,t,n=e,r){if(t===O)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=C(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=M(e,i._$AS(e,t.values),i,r)),t}var we=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??x).importNode(t,!0);A.currentNode=r;let i=A.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new N(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Oe(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=A.nextNode(),a++)}return A.currentNode=x,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},N=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=M(this,e,t),C(e)?e===k||e==null||e===``?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==O&&this._(e):e._$litType$===void 0?e.nodeType===void 0?he(e)?this.k(e):this._(e):this.T(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!==k&&C(this._$AH)?this._$AA.nextSibling.data=e:this.T(x.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=j.createElement(Se(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new we(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=xe.get(e.strings);return t===void 0&&xe.set(e.strings,t=new j(e)),t}k(t){me(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(S()),this.O(S()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=de(e).nextSibling;de(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=k}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=M(this,e,t,0),a=!C(e)||e!==this._$AH&&e!==O,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=M(this,r[n+o],t,o),s===O&&(s=this._$AH[o]),a||=!C(s)||s!==this._$AH[o],s===k?e=k:e!==k&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Te=class extends P{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Ee=class extends P{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},De=class extends P{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=M(this,e,t,0)??k)===O)return;let n=this._$AH,r=e===k&&n!==k||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==k&&(n===k||r);r&&this.element.removeEventListener(this.name,this,n),i&&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)}},Oe=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){M(this,e)}},ke={M:v,P:y,A:b,C:1,L:Ce,R:we,D:he,V:M,I:N,H:P,N:Ee,U:De,B:Te,F:Oe},Ae=g.litHtmlPolyfillSupport;Ae?.(j,N),(g.litHtmlVersions??=[]).push(`3.3.3`);var je=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new N(t.insertBefore(S(),e),e,void 0,n??{})}return i._$AI(e),i},F=globalThis,I=class extends h{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 t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=je(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};I._$litElement$=!0,I.finalized=!0,F.litElementHydrateSupport?.({LitElement:I});var Me=F.litElementPolyfillSupport;Me?.({LitElement:I}),(F.litElementVersions??=[]).push(`4.2.2`);var L=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},Ne={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:le},Pe=(e=Ne,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function R(e){return(t,n)=>typeof n==`object`?Pe(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Fe(e){return R({...e,state:!0,attribute:!1})}var Ie=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function Le(e){return(t,n)=>{let{slot:r,selector:i}=e??{},a=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){let t=(this.renderRoot?.querySelector(a))?.assignedElements(e)??[];return i===void 0?t:t.filter(e=>e.matches(i))}})}}function Re(e){return(t,n)=>{let{slot:r}=e??{},i=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){return(this.renderRoot?.querySelector(i))?.assignedNodes(e)??[]}})}}var ze={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Be=e=>(...t)=>({_$litDirective$:e,values:t}),Ve=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},He=Be(class extends Ve{constructor(e){if(super(e),e.type!==ze.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return O}});function z(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var B=class extends I{constructor(...e){super(...e),this.level=0}static{this.styles=l`
3
+ :host {
4
+ --level-adjustment: 0%;
5
+ --border-adjustment: 25%;
6
+ --header-adjustment: 0%;
7
+ --footer-adjustment: 0%;
8
+
9
+ --background-color: var(--vx-background-color, light-dark(black, white));
10
+ --color: contrast-color(var(--background-color));
11
+ --border-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--border-adjustment)), var(--background-color));
12
+ --border-radius: 0.5em;
13
+
14
+ color: contrast-color(color-mix(in oklch, var(--color) var(--level-adjustment), var(--background-color)));
15
+ background-color: color-mix(in oklch, var(--color) var(--level-adjustment), var(--background-color));
16
+ display: block;
17
+ padding: 0;
18
+ margin: 1em;
19
+ border: 1px solid;
20
+ border-radius: var(--border-radius);
21
+ border-color: var(--border-color);
22
+ }
23
+
24
+ :host([level="1"]) {
25
+ --level-adjustment: 10%
26
+ }
27
+ :host([level="2"]) {
28
+ --level-adjustment: 20%
29
+ }
30
+ :host([level="3"]) {
31
+ --level-adjustment: 30%
32
+ }
33
+ :host([level="4"]) {
34
+ --level-adjustment: 40%
35
+ }
36
+ :host([level="5"]) {
37
+ --level-adjustment: 50%
38
+ }
39
+ :host([level="6"]) {
40
+ --level-adjustment: 60%
41
+ }
42
+
43
+ div {
44
+ padding: 0.5em;
45
+ }
46
+
47
+ div#header {
48
+ background-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--header-adjustment)), var(--background-color));
49
+ color: contrast-color(color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--header-adjustment)), var(--background-color)));
50
+ border: none;
51
+ border-radius: var(--border-radius) var(--border-radius) 0 0;
52
+ }
53
+
54
+ div#footer {
55
+ background-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--footer-adjustment)), var(--background-color));
56
+ color: contrast-color(color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--footer-adjustment)), var(--background-color)));
57
+ border: none;
58
+ border-radius: 0 0 var(--border-radius) var(--border-radius);
59
+ }
60
+
61
+ div#body.has-header {
62
+ border-top: 1px solid;
63
+ border-color: var(--border-color);
64
+ }
65
+ div#body.has-footer {
66
+ border-bottom: 1px solid;
67
+ border-color: var(--border-color);
68
+ }
69
+
70
+ `}render(){return D`
71
+ <div part="header" id="header">
72
+ <slot name="header" @slotchange=${()=>this.requestUpdate()}></slot>
73
+ </div>
74
+ <div part="body" id="body" class=${He({"has-header":this.headerNodes.length>0,"has-footer":this.footerNodes.length>0})}>
75
+ <slot></slot>
76
+ </div>
77
+ <div part="footer" id="footer">
78
+ <slot name="footer" @slotchange=${()=>this.requestUpdate()}></slot>
79
+ </div>
80
+ `}};z([R({type:Number})],B.prototype,`level`,void 0),z([Re({slot:`header`,flatten:!0})],B.prototype,`headerNodes`,void 0),z([Re({slot:`footer`,flatten:!0})],B.prototype,`footerNodes`,void 0),B=z([L(`vx-panel`)],B);var{I:Ue}=ke,We=e=>e.strings===void 0,V=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),V(e,t);return!0},H=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Ge=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Je(t)}};function Ke(e){this._$AN===void 0?this._$AM=e:(H(this),this._$AM=e,Ge(this))}function qe(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0){if(t){if(Array.isArray(r))for(let e=n;e<r.length;e++)V(r[e],!1),H(r[e]);else r!=null&&(V(r,!1),H(r))}else V(this,e)}}var Je=e=>{e.type==ze.CHILD&&(e._$AP??=qe,e._$AQ??=Ke)},Ye=class extends Ve{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Ge(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(V(this,e),H(this))}setValue(e){if(We(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Xe=()=>new Ze,Ze=class{},U=new WeakMap,Qe=Be(class extends Ye{render(e){return k}update(e,[t]){let n=t!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),k}rt(e){if(this.G!==void 0){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=U.get(t);n===void 0&&(n=new WeakMap,U.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}}get lt(){return typeof this.G==`function`?U.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),$e=`/`,et=e=>e,tt=/^[$_\p{ID_Start}]$/u,nt=/^[$\u200c\u200d\p{ID_Continue}]$/u;function W(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,`\\$&`)}var G=class extends TypeError{originalPath;constructor(e,t){super(e+(t?`: ${t}`:``)+`; visit https://git.new/pathToRegexpError for info`),this.originalPath=t}};function rt(e,t={}){let{encodePath:n=et}=t,r=[...e],i=0;function a(t){let o=[],s=``;function c(){s&&=(o.push({type:`text`,value:n(s)}),``)}for(;i<r.length;){let n=r[i++];if(n===t)return c(),o;if(n===`\\`){if(i===r.length)throw new G(`Unexpected end after \\ at index ${i}`,e);s+=r[i++]}else if(n===`:`||n===`*`){let t=n===`:`?`param`:`wildcard`,a=``;if(tt.test(r[i]))do a+=r[i++];while(nt.test(r[i]));else if(r[i]===`"`){let t=i;for(;i<r.length;){if(r[++i]===`"`){i++,t=0;break}r[i]===`\\`&&i++,a+=r[i]}if(t)throw new G(`Unterminated quote at index ${t}`,e)}if(!a)throw new G(`Missing parameter name at index ${i}`,e);c(),o.push({type:t,name:a})}else if(n===`{`)c(),o.push({type:`group`,tokens:a(`}`)});else{if(`}()[]+?!`.includes(n))throw new G(`Unexpected ${n} at index ${i-1}`,e);s+=n}}if(t)throw new G(`Unexpected end at index ${i}, expected ${t}`,e);return c(),o}return{tokens:a(``),originalPath:e}}function it(e,t={}){let{decode:n=decodeURIComponent,delimiter:r=$e}=t,{regexp:i,keys:a}=at(e,t),o=a.map(e=>n===!1?et:e.type===`param`?n:e=>e.split(r).map(n));return function(e){let t=i.exec(e);if(!t)return!1;let n=t[0],r=Object.create(null);for(let e=1;e<t.length;e++){if(t[e]===void 0)continue;let n=a[e-1],i=o[e-1];r[n.name]=i(t[e])}return{path:n,params:r}}}function at(e,t={}){let{delimiter:n=$e,end:r=!0,sensitive:i=!1,trailing:a=!0}=t,o=[],s=``,c=0;function l(e){if(Array.isArray(e)){for(let t of e)l(t);return}let r=typeof e==`object`?e:rt(e,t);ot(r.tokens,0,[],e=>{if(c>=256)throw new G(`Too many path combinations`,r.originalPath);c>0&&(s+=`|`),s+=st(e,n,o,r.originalPath,a),c++})}l(e);let u=`^(?:${s})`;return u+=r?`$`:`(?=`+W(n)+`|$)`,{regexp:new RegExp(u,i?``:`i`),keys:o}}function ot(e,t,n,r){for(;t<e.length;){let i=e[t++];if(i.type===`group`){let a=n.length;ot(i.tokens,0,n,n=>ot(e,t,n,r)),n.length=a}else n.push(i)}r(n)}function st(e,t,n,r,i){let a=``,o=``,s=!1,c=!1,l=``,u=0;function d(t){for(;t<e.length;)if(e[t++].type===`wildcard`)return!0;return!1}function ee(n){let r=``;for(;n<e.length;){let i=e[n++];if(i.type!==`text`)return r;if(i.value.includes(t))break;r+=i.value}}for(;u<e.length;){let i=e[u++];if(i.type===`text`){let e=W(i.value);a+=e,l+=e,o+=i.value,i.value.includes(t)&&(c=!1)}else if(i.type===`param`||i.type===`wildcard`){if(a&&!o)throw new G(`Missing text before "${i.name}" ${i.type}`,r);if(n.push(i),i.type===`param`){if(c){let e=K(t,o);a+=`(${e}+?|${e}*${W(o)})`}else{let e=ee(u);a+=e?`(?=(${K(t,``)}+?)${W(e)})(?:\\${n.length})`:`(${K(t,``)}+)`}}else s&&(a+=`)${l}`),s=d(u),a+=s?`(?=([^]+?)`:`([^]+)`,c=!0,l=``;l+=`(?:\\${n.length})`,o=``}else throw TypeError(`Unknown token type: ${i.type}`)}return i&&!o.endsWith(t)&&(a+=`(?:`+W(t)+`$)?`),a}function K(e,t){return t.length>e.length?K(t,e):(e===t&&(t=``),t.length>1?`(?:(?!${W(e)}|${W(t)})[^])`:e.length>1?`(?:(?!${W(e)})[^${W(t)}])`:`[^${W(e+t)}]`)}var q=class extends I{constructor(...e){super(...e),this.path=``,this.subroute=!1,this.active=!1,this.customTemplate=D`<slot></slot>`,this.parameters={},this.containerRef=Xe()}static{this.styles=l`
81
+ :host {
82
+ display: block;
83
+ }
84
+ `}activateIfMatches(e){try{let t=it(this.path,{end:!this.subroute})(e);if(t)return this.parameters=t.params,this.active=!0,!0}catch(e){console.error(`Error matching path`,this.path),console.error(e)}return this.parameters={},this.active=!1,!1}newEvent(e){return new CustomEvent(e,{bubbles:!0,composed:!0,detail:{}})}connectedCallback(){super.connectedCallback(),this.dispatchEvent(this.newEvent(`vx-connected`))}willUpdate(e){if(e.has(`active`)&&(e.get(`active`)||!1)!==this.active){let e=this.active?`vx-activate`:`vx-deactivate`;this.dispatchEvent(this.newEvent(e))}}updated(e){if(e.has(`active`)&&(e.get(`active`)||!1)!==this.active){let e=this.active?`vx-activated`:`vx-deactivated`;this.dispatchEvent(this.newEvent(e))}this.active&&this.component&&(this.componentRef||=document.createElement(this.component),this.componentRef&&this.containerRef.value?.appendChild(this.componentRef)),!this.active&&this.componentRef&&(this.componentRef?.remove(),this.componentRef=void 0),this.parameters={}}renderTemplate(e){return typeof e==`function`?e():e}render(){let e=this.customTemplate;return this.component&&(e=D`<div id="container" ${Qe(this.containerRef)}></div>`),this.active?this.renderTemplate(e):k}};z([R()],q.prototype,`path`,void 0),z([R({type:Boolean})],q.prototype,`subroute`,void 0),z([R({type:Boolean})],q.prototype,`active`,void 0),z([R()],q.prototype,`component`,void 0),q=z([L(`vx-route`)],q);function ct(e){if(!e)return null;if(e.assignedSlot)return e.assignedSlot;if(e.parentNode)return e.parentNode;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function J(e){let t=[],n=e;for(;n;)t.push(n),n=ct(n);return t}var Y=class extends I{static{this.styles=l`
85
+ `}constructor(){super(),this.reversed=!1,this.currentURL=new URL(window.location.href),this.navigateEventHandler=this.navigateEventHandler.bind(this)}connectedCallback(){super.connectedCallback(),navigation.addEventListener(`navigate`,this.navigateEventHandler)}disconnectedCallback(){navigation.removeEventListener(`navigate`,this.navigateEventHandler),super.disconnectedCallback()}firstUpdated(){this.activateMatchingRoute()}navigateEventHandler(e){this.currentURL=new URL(e.destination.url),e.canIntercept&&(e.intercept(),this.activateMatchingRoute())}activateMatchingRoute(){if(!J(this).filter(e=>e instanceof q).map(e=>e.active).concat(!0)[0]){this.routes.forEach(e=>{e.active=!1});return}let e=J(this).filter(e=>e instanceof q).map(e=>e.path).reverse().join(``),t=this.currentURL.pathname+(this.currentURL.hash||``);t.startsWith(e)&&(t=t.substring(e.length));let n=this.reversed?this.routes.toReversed():this.routes,r=!1;for(let e of n)r?e.active=!1:r=e.activateIfMatches(t)}render(){return D`<slot></slot>`}};z([R({type:Boolean})],Y.prototype,`reversed`,void 0),z([Fe()],Y.prototype,`currentURL`,void 0),z([Le({selector:`vx-route`})],Y.prototype,`routes`,void 0),Y=z([L(`vx-router`)],Y);var lt=new Map;function ut(e,t){lt.set(e,t)}function X(e){return lt.get(e)}function Z(e){return lt.has(e)}function dt(e){let t=e.split(`.`);if(t.length===1&&t.unshift(`default`),t.length===2){let[e,n]=t;if(Z(e)){let t=X(e);if(n in t)return t[n]}}return k}var ft={favicon:D`
86
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
87
+ <rect width="512" height="512" style="fill: rgba(71, 87, 91, 0.300);"/>
88
+ <path d="M 155.559 415.826 L 13.786 87.123 L 100.519 87.167 L 200.898 330.441 L 297.737 87.267 L 382.572 87.31 L 240.947 415.87 L 155.559 415.826 Z" style="fill: rgb(248, 148, 7); text-wrap-mode: nowrap;"/>
89
+ <path d="M 187.712 415.87 L 321.421 294.77 L 203.511 183.491 L 257.982 183.491 L 320.714 243.096 C 333.766 255.455 343.039 264.966 348.536 271.628 C 356.24 263.173 365.359 254.346 375.892 245.148 L 445.455 183.491 L 495.217 183.491 L 373.77 293.019 L 504.652 415.87 L 448.059 415.87 L 361.041 332.973 C 356.166 328.211 351.135 323.033 345.949 317.436 C 338.244 325.892 332.742 331.705 329.442 334.874 L 242.665 415.87 L 187.712 415.87 Z" style="text-wrap-mode: nowrap; fill: rgb(81, 119, 144);"/>
90
+ </svg>
91
+ `,bootstrap:D`
92
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-bootstrap"
93
+ viewBox="0 0 16 16">
94
+ <path d="M5.062 12h3.475c1.804 0 2.888-.908 2.888-2.396 0-1.102-.761-1.916-1.904-2.034v-.1c.832-.14 1.482-.93 1.482-1.816 0-1.3-.955-2.11-2.542-2.11H5.062zm1.313-4.875V4.658h1.78c.973 0 1.542.457 1.542 1.237 0 .802-.604 1.23-1.764 1.23zm0 3.762V8.162h1.822c1.236 0 1.887.463 1.887 1.348 0 .896-.627 1.377-1.811 1.377z"/>
95
+ <path d="M0 4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4zm4-3a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V4a3 3 0 0 0-3-3z"/>
96
+ </svg>
97
+ `,"bootstrap-fill":D`
98
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-boombox-fill"
99
+ viewBox="0 0 16 16">
100
+ <path d="M14 0a.5.5 0 0 1 .5.5V2h.5a1 1 0 0 1 1 1v2H0V3a1 1 0 0 1 1-1h12.5V.5A.5.5 0 0 1 14 0M2 3.5a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0m2 0a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0m7.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m1.5-.5a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0M9.5 3h-3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1M6 10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m-1.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m7 1a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3m.5-1.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0"/>
101
+ <path d="M0 6h16v8a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1zm2 4.5a2.5 2.5 0 1 0 5 0 2.5 2.5 0 0 0-5 0m7 0a2.5 2.5 0 1 0 5 0 2.5 2.5 0 0 0-5 0"/>
102
+ </svg>
103
+ `,bicycle:D`
104
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-bicycle"
105
+ viewBox="0 0 16 16">
106
+ <path d="M4 4.5a.5.5 0 0 1 .5-.5H6a.5.5 0 0 1 0 1v.5h4.14l.386-1.158A.5.5 0 0 1 11 4h1a.5.5 0 0 1 0 1h-.64l-.311.935.807 1.29a3 3 0 1 1-.848.53l-.508-.812-2.076 3.322A.5.5 0 0 1 8 10.5H5.959a3 3 0 1 1-1.815-3.274L5 5.856V5h-.5a.5.5 0 0 1-.5-.5m1.5 2.443-.508.814c.5.444.85 1.054.967 1.743h1.139zM8 9.057 9.598 6.5H6.402zM4.937 9.5a2 2 0 0 0-.487-.877l-.548.877zM3.603 8.092A2 2 0 1 0 4.937 10.5H3a.5.5 0 0 1-.424-.765zm7.947.53a2 2 0 1 0 .848-.53l1.026 1.643a.5.5 0 1 1-.848.53z"/>
107
+ </svg>
108
+ `,home:D`
109
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 -960 960 960" fill="currentColor">
110
+ <path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/>
111
+ </svg>
112
+ `,motion:D`
113
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
114
+ fill="currentColor" viewBox="0 0 24 24" >
115
+ <!--Boxicons v3.0.8 https://boxicons.com | License https://docs.boxicons.com/free-->
116
+ <path d="M17 7c-1.18 0-2.29.41-3.19 1.15-.69-.42-1.48-.65-2.31-.65-1.19 0-2.31.48-3.13 1.28A3.999 3.999 0 0 0 2 12a3.999 3.999 0 0 0 6.37 3.22c.83.81 1.95 1.28 3.13 1.28.83 0 1.63-.23 2.31-.65A5.002 5.002 0 0 0 22 12c0-2.76-2.24-5-5-5M6 14c-1.1 0-2-.9-2-2s.9-2 2-2c.47 0 .92.17 1.27.46l-.03.12c-.06.17-.1.34-.14.51-.01.07-.03.13-.04.2-.04.23-.06.47-.06.71s.03.48.06.71c.01.06.02.13.04.19.04.18.08.36.14.53.01.04.02.08.03.11-.35.29-.8.46-1.27.46m5.5.5c-.89 0-1.73-.49-2.18-1.29C9.11 12.85 9 12.43 9 12s.11-.85.33-1.23c.44-.78 1.28-1.27 2.17-1.27.37 0 .73.08 1.05.23-.09.19-.18.38-.25.57l-.03.1c-.07.21-.13.42-.17.64-.01.07-.03.13-.04.2-.04.25-.07.5-.07.76a5 5 0 0 0 .11.96c.04.22.1.44.17.65l.03.09c.07.2.15.39.25.58-.32.15-.68.23-1.05.23Zm5.5.5c-.9 0-1.75-.4-2.32-1.1a3.01 3.01 0 0 1-.01-3.8A3.005 3.005 0 0 1 20 12c0 1.65-1.35 3-3 3"></path>
117
+ </svg>
118
+ `},Q,$=class extends I{static{Q=this}constructor(...e){super(...e),this.library=null,this.name=``,this.button=!1}static{ut(`$system`,ft)}static{this.styles=l`
119
+ :host {
120
+ display: inline-block;
121
+ justify-content: center;
122
+ align-items: center;
123
+ }
124
+ svg {
125
+ width: inherit;
126
+ height: inherit;
127
+ }
128
+ :host([button]) svg:hover {
129
+ background: rgba(255, 255, 255, 0.5);
130
+ cursor: pointer;
131
+ }
132
+ `}static{this.notFoundIcon=D`
133
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16">
134
+ <path d="M4.978.855a.5.5 0 1 0-.956.29l.41 1.352A5 5 0 0 0 3 6h10a5 5 0 0 0-1.432-3.503l.41-1.352a.5.5 0 1 0-.956-.29l-.291.956A5 5 0 0 0 8 1a5 5 0 0 0-2.731.811l-.29-.956z"/>
135
+ <path d="M13 6v1H8.5v8.975A5 5 0 0 0 13 11h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 1 0 1 0v-.5a1.5 1.5 0 0 0-1.5-1.5H13V9h1.5a.5.5 0 0 0 0-1H13V7h.5A1.5 1.5 0 0 0 15 5.5V5a.5.5 0 0 0-1 0v.5a.5.5 0 0 1-.5.5zm-5.5 9.975V7H3V6h-.5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 0-1 0v.5A1.5 1.5 0 0 0 2.5 7H3v1H1.5a.5.5 0 0 0 0 1H3v1h-.5A1.5 1.5 0 0 0 1 11.5v.5a.5.5 0 1 0 1 0v-.5a.5.5 0 0 1 .5-.5H3a5 5 0 0 0 4.5 4.975"/>
136
+ </svg>
137
+ `}render(){let e=this.name.split(`.`);if(e.length===1&&e.unshift(`default`),e.length===2){let[t,n]=e;if(this.library&&(t=this.library),Z(t)){let e=X(t);if(n in e)return e[n]}}return Q.notFoundIcon}};return z([R({type:String})],$.prototype,`library`,void 0),z([R({type:String})],$.prototype,`name`,void 0),z([R({type:Boolean})],$.prototype,`button`,void 0),$=Q=z([L(`vx-svg`)],$),class e{static{this.functions=new Map}static init(){e.loadTheme(),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.loadTheme()}),window.addEventListener(`storage`,t=>{(t.key===`theme`||t.key===`themeColor`)&&e.loadTheme()})}static loadTheme(){let e=document.documentElement,t=localStorage.getItem(`vx-theme`)||`system`;t===`system`&&(t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`),t===`dark`?(e.classList.add(`vx-theme-dark`),e.classList.remove(`vx-theme-light`)):(e.classList.add(`vx-theme-light`),e.classList.remove(`vx-theme-dark`))}static registerFunction(t,n){e.functions.set(t,n)}static getFunction(t){return e.functions.get(t)}}.init(),window.VXComponents=n({composedParent:()=>ct,composedPath:()=>J,getSvgLibrary:()=>X,hasSvgLibrary:()=>Z,registerSvgLibrary:()=>ut,svg:()=>dt,systemIcons:()=>ft}),e.composedParent=ct,e.composedPath=J,e.getSvgLibrary=X,e.hasSvgLibrary=Z,e.registerSvgLibrary=ut,e.svg=dt,e.systemIcons=ft,e})({});
@@ -0,0 +1,258 @@
1
+ import { i as e, n as t, r as n, s as r, t as i } from "./svg-YrZ3m-FZ.js";
2
+ import { LitElement as a, css as o, html as s, nothing as c } from "lit";
3
+ import { customElement as l, property as u, queryAssignedElements as d, queryAssignedNodes as f, state as p } from "lit/decorators.js";
4
+ import { classMap as m } from "lit/directives/class-map.js";
5
+ import { createRef as h, ref as g } from "lit/directives/ref.js";
6
+ import { match as _ } from "path-to-regexp";
7
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
8
+ function v(e, t, n, r) {
9
+ var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
10
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
11
+ else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
12
+ return i > 3 && a && Object.defineProperty(t, n, a), a;
13
+ }
14
+ //#endregion
15
+ //#region src/components/vx-panel/vx-panel.component.ts
16
+ var y = class extends a {
17
+ constructor(...e) {
18
+ super(...e), this.level = 0;
19
+ }
20
+ static {
21
+ this.styles = o`
22
+ :host {
23
+ --level-adjustment: 0%;
24
+ --border-adjustment: 25%;
25
+ --header-adjustment: 0%;
26
+ --footer-adjustment: 0%;
27
+
28
+ --background-color: var(--vx-background-color, light-dark(black, white));
29
+ --color: contrast-color(var(--background-color));
30
+ --border-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--border-adjustment)), var(--background-color));
31
+ --border-radius: 0.5em;
32
+
33
+ color: contrast-color(color-mix(in oklch, var(--color) var(--level-adjustment), var(--background-color)));
34
+ background-color: color-mix(in oklch, var(--color) var(--level-adjustment), var(--background-color));
35
+ display: block;
36
+ padding: 0;
37
+ margin: 1em;
38
+ border: 1px solid;
39
+ border-radius: var(--border-radius);
40
+ border-color: var(--border-color);
41
+ }
42
+
43
+ :host([level="1"]) {
44
+ --level-adjustment: 10%
45
+ }
46
+ :host([level="2"]) {
47
+ --level-adjustment: 20%
48
+ }
49
+ :host([level="3"]) {
50
+ --level-adjustment: 30%
51
+ }
52
+ :host([level="4"]) {
53
+ --level-adjustment: 40%
54
+ }
55
+ :host([level="5"]) {
56
+ --level-adjustment: 50%
57
+ }
58
+ :host([level="6"]) {
59
+ --level-adjustment: 60%
60
+ }
61
+
62
+ div {
63
+ padding: 0.5em;
64
+ }
65
+
66
+ div#header {
67
+ background-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--header-adjustment)), var(--background-color));
68
+ color: contrast-color(color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--header-adjustment)), var(--background-color)));
69
+ border: none;
70
+ border-radius: var(--border-radius) var(--border-radius) 0 0;
71
+ }
72
+
73
+ div#footer {
74
+ background-color: color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--footer-adjustment)), var(--background-color));
75
+ color: contrast-color(color-mix(in oklch, var(--color) calc(var(--level-adjustment) + var(--footer-adjustment)), var(--background-color)));
76
+ border: none;
77
+ border-radius: 0 0 var(--border-radius) var(--border-radius);
78
+ }
79
+
80
+ div#body.has-header {
81
+ border-top: 1px solid;
82
+ border-color: var(--border-color);
83
+ }
84
+ div#body.has-footer {
85
+ border-bottom: 1px solid;
86
+ border-color: var(--border-color);
87
+ }
88
+
89
+ `;
90
+ }
91
+ render() {
92
+ return s`
93
+ <div part="header" id="header">
94
+ <slot name="header" @slotchange=${() => this.requestUpdate()}></slot>
95
+ </div>
96
+ <div part="body" id="body" class=${m({
97
+ "has-header": this.headerNodes.length > 0,
98
+ "has-footer": this.footerNodes.length > 0
99
+ })}>
100
+ <slot></slot>
101
+ </div>
102
+ <div part="footer" id="footer">
103
+ <slot name="footer" @slotchange=${() => this.requestUpdate()}></slot>
104
+ </div>
105
+ `;
106
+ }
107
+ };
108
+ v([u({ type: Number })], y.prototype, "level", void 0), v([f({
109
+ slot: "header",
110
+ flatten: !0
111
+ })], y.prototype, "headerNodes", void 0), v([f({
112
+ slot: "footer",
113
+ flatten: !0
114
+ })], y.prototype, "footerNodes", void 0), y = v([l("vx-panel")], y);
115
+ //#endregion
116
+ //#region src/components/vx-route/vx-route.component.ts
117
+ var b = class extends a {
118
+ constructor(...e) {
119
+ super(...e), this.path = "", this.subroute = !1, this.active = !1, this.customTemplate = s`<slot></slot>`, this.parameters = {}, this.containerRef = h();
120
+ }
121
+ static {
122
+ this.styles = o`
123
+ :host {
124
+ display: block;
125
+ }
126
+ `;
127
+ }
128
+ activateIfMatches(e) {
129
+ try {
130
+ let t = _(this.path, { end: !this.subroute })(e);
131
+ if (t) return this.parameters = t.params, this.active = !0, !0;
132
+ } catch (e) {
133
+ console.error("Error matching path", this.path), console.error(e);
134
+ }
135
+ return this.parameters = {}, this.active = !1, !1;
136
+ }
137
+ newEvent(e) {
138
+ return new CustomEvent(e, {
139
+ bubbles: !0,
140
+ composed: !0,
141
+ detail: {}
142
+ });
143
+ }
144
+ connectedCallback() {
145
+ super.connectedCallback(), this.dispatchEvent(this.newEvent("vx-connected"));
146
+ }
147
+ willUpdate(e) {
148
+ if (e.has("active") && (e.get("active") || !1) !== this.active) {
149
+ let e = this.active ? "vx-activate" : "vx-deactivate";
150
+ this.dispatchEvent(this.newEvent(e));
151
+ }
152
+ }
153
+ updated(e) {
154
+ if (e.has("active") && (e.get("active") || !1) !== this.active) {
155
+ let e = this.active ? "vx-activated" : "vx-deactivated";
156
+ this.dispatchEvent(this.newEvent(e));
157
+ }
158
+ this.active && this.component && (this.componentRef ||= document.createElement(this.component), this.componentRef && this.containerRef.value?.appendChild(this.componentRef)), !this.active && this.componentRef && (this.componentRef?.remove(), this.componentRef = void 0), this.parameters = {};
159
+ }
160
+ renderTemplate(e) {
161
+ return typeof e == "function" ? e() : e;
162
+ }
163
+ render() {
164
+ let e = this.customTemplate;
165
+ return this.component && (e = s`<div id="container" ${g(this.containerRef)}></div>`), this.active ? this.renderTemplate(e) : c;
166
+ }
167
+ };
168
+ v([u()], b.prototype, "path", void 0), v([u({ type: Boolean })], b.prototype, "subroute", void 0), v([u({ type: Boolean })], b.prototype, "active", void 0), v([u()], b.prototype, "component", void 0), b = v([l("vx-route")], b);
169
+ //#endregion
170
+ //#region src/components/vx-router/vx-router.component.ts
171
+ var x = class extends a {
172
+ static {
173
+ this.styles = o`
174
+ `;
175
+ }
176
+ constructor() {
177
+ super(), this.reversed = !1, this.currentURL = new URL(window.location.href), this.navigateEventHandler = this.navigateEventHandler.bind(this);
178
+ }
179
+ connectedCallback() {
180
+ super.connectedCallback(), navigation.addEventListener("navigate", this.navigateEventHandler);
181
+ }
182
+ disconnectedCallback() {
183
+ navigation.removeEventListener("navigate", this.navigateEventHandler), super.disconnectedCallback();
184
+ }
185
+ firstUpdated() {
186
+ this.activateMatchingRoute();
187
+ }
188
+ navigateEventHandler(e) {
189
+ this.currentURL = new URL(e.destination.url), e.canIntercept && (e.intercept(), this.activateMatchingRoute());
190
+ }
191
+ activateMatchingRoute() {
192
+ if (!r(this).filter((e) => e instanceof b).map((e) => e.active).concat(!0)[0]) {
193
+ this.routes.forEach((e) => {
194
+ e.active = !1;
195
+ });
196
+ return;
197
+ }
198
+ let e = r(this).filter((e) => e instanceof b).map((e) => e.path).reverse().join(""), t = this.currentURL.pathname + (this.currentURL.hash || "");
199
+ t.startsWith(e) && (t = t.substring(e.length));
200
+ let n = this.reversed ? this.routes.toReversed() : this.routes, i = !1;
201
+ for (let e of n) i ? e.active = !1 : i = e.activateIfMatches(t);
202
+ }
203
+ render() {
204
+ return s`<slot></slot>`;
205
+ }
206
+ };
207
+ v([u({ type: Boolean })], x.prototype, "reversed", void 0), v([p()], x.prototype, "currentURL", void 0), v([d({ selector: "vx-route" })], x.prototype, "routes", void 0), x = v([l("vx-router")], x);
208
+ //#endregion
209
+ //#region src/components/vx-svg/vx-svg.component.ts
210
+ var S, C = class extends a {
211
+ static {
212
+ S = this;
213
+ }
214
+ constructor(...e) {
215
+ super(...e), this.library = null, this.name = "", this.button = !1;
216
+ }
217
+ static {
218
+ e("$system", i);
219
+ }
220
+ static {
221
+ this.styles = o`
222
+ :host {
223
+ display: inline-block;
224
+ justify-content: center;
225
+ align-items: center;
226
+ }
227
+ svg {
228
+ width: inherit;
229
+ height: inherit;
230
+ }
231
+ :host([button]) svg:hover {
232
+ background: rgba(255, 255, 255, 0.5);
233
+ cursor: pointer;
234
+ }
235
+ `;
236
+ }
237
+ static {
238
+ this.notFoundIcon = s`
239
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16">
240
+ <path d="M4.978.855a.5.5 0 1 0-.956.29l.41 1.352A5 5 0 0 0 3 6h10a5 5 0 0 0-1.432-3.503l.41-1.352a.5.5 0 1 0-.956-.29l-.291.956A5 5 0 0 0 8 1a5 5 0 0 0-2.731.811l-.29-.956z"/>
241
+ <path d="M13 6v1H8.5v8.975A5 5 0 0 0 13 11h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 1 0 1 0v-.5a1.5 1.5 0 0 0-1.5-1.5H13V9h1.5a.5.5 0 0 0 0-1H13V7h.5A1.5 1.5 0 0 0 15 5.5V5a.5.5 0 0 0-1 0v.5a.5.5 0 0 1-.5.5zm-5.5 9.975V7H3V6h-.5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 0-1 0v.5A1.5 1.5 0 0 0 2.5 7H3v1H1.5a.5.5 0 0 0 0 1H3v1h-.5A1.5 1.5 0 0 0 1 11.5v.5a.5.5 0 1 0 1 0v-.5a.5.5 0 0 1 .5-.5H3a5 5 0 0 0 4.5 4.975"/>
242
+ </svg>
243
+ `;
244
+ }
245
+ render() {
246
+ let e = this.name.split(".");
247
+ if (e.length === 1 && e.unshift("default"), e.length === 2) {
248
+ let [r, i] = e;
249
+ if (this.library && (r = this.library), n(r)) {
250
+ let e = t(r);
251
+ if (i in e) return e[i];
252
+ }
253
+ }
254
+ return S.notFoundIcon;
255
+ }
256
+ };
257
+ v([u({ type: String })], C.prototype, "library", void 0), v([u({ type: String })], C.prototype, "name", void 0), v([u({ type: Boolean })], C.prototype, "button", void 0), C = S = v([l("vx-svg")], C);
258
+ //#endregion
@@ -0,0 +1,24 @@
1
+ import "./svg-YrZ3m-FZ.js";
2
+ (class e {
3
+ static {
4
+ this.functions = /* @__PURE__ */ new Map();
5
+ }
6
+ static init() {
7
+ e.loadTheme(), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
8
+ e.loadTheme();
9
+ }), window.addEventListener("storage", (t) => {
10
+ (t.key === "theme" || t.key === "themeColor") && e.loadTheme();
11
+ });
12
+ }
13
+ static loadTheme() {
14
+ let e = document.documentElement, t = localStorage.getItem("vx-theme") || "system";
15
+ t === "system" && (t = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), t === "dark" ? (e.classList.add("vx-theme-dark"), e.classList.remove("vx-theme-light")) : (e.classList.add("vx-theme-light"), e.classList.remove("vx-theme-dark"));
16
+ }
17
+ static registerFunction(t, n) {
18
+ e.functions.set(t, n);
19
+ }
20
+ static getFunction(t) {
21
+ return e.functions.get(t);
22
+ }
23
+ }).init();
24
+ //#endregion
@@ -0,0 +1,82 @@
1
+ import { html as e, nothing as t } from "lit";
2
+ //#region src/lib/dom.ts
3
+ function n(e) {
4
+ if (!e) return null;
5
+ if (e.assignedSlot) return e.assignedSlot;
6
+ if (e.parentNode) return e.parentNode;
7
+ let t = e.getRootNode();
8
+ return t instanceof ShadowRoot ? t.host : null;
9
+ }
10
+ function r(e) {
11
+ let t = [], r = e;
12
+ for (; r;) t.push(r), r = n(r);
13
+ return t;
14
+ }
15
+ //#endregion
16
+ //#region src/lib/svg/svg-register.ts
17
+ var i = /* @__PURE__ */ new Map();
18
+ function a(e, t) {
19
+ i.set(e, t);
20
+ }
21
+ function o(e) {
22
+ return i.get(e);
23
+ }
24
+ function s(e) {
25
+ return i.has(e);
26
+ }
27
+ function c(e) {
28
+ let n = e.split(".");
29
+ if (n.length === 1 && n.unshift("default"), n.length === 2) {
30
+ let [e, t] = n;
31
+ if (s(e)) {
32
+ let n = o(e);
33
+ if (t in n) return n[t];
34
+ }
35
+ }
36
+ return t;
37
+ }
38
+ //#endregion
39
+ //#region src/lib/svg/system-icons.ts
40
+ var l = {
41
+ favicon: e`
42
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
43
+ <rect width="512" height="512" style="fill: rgba(71, 87, 91, 0.300);"/>
44
+ <path d="M 155.559 415.826 L 13.786 87.123 L 100.519 87.167 L 200.898 330.441 L 297.737 87.267 L 382.572 87.31 L 240.947 415.87 L 155.559 415.826 Z" style="fill: rgb(248, 148, 7); text-wrap-mode: nowrap;"/>
45
+ <path d="M 187.712 415.87 L 321.421 294.77 L 203.511 183.491 L 257.982 183.491 L 320.714 243.096 C 333.766 255.455 343.039 264.966 348.536 271.628 C 356.24 263.173 365.359 254.346 375.892 245.148 L 445.455 183.491 L 495.217 183.491 L 373.77 293.019 L 504.652 415.87 L 448.059 415.87 L 361.041 332.973 C 356.166 328.211 351.135 323.033 345.949 317.436 C 338.244 325.892 332.742 331.705 329.442 334.874 L 242.665 415.87 L 187.712 415.87 Z" style="text-wrap-mode: nowrap; fill: rgb(81, 119, 144);"/>
46
+ </svg>
47
+ `,
48
+ bootstrap: e`
49
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-bootstrap"
50
+ viewBox="0 0 16 16">
51
+ <path d="M5.062 12h3.475c1.804 0 2.888-.908 2.888-2.396 0-1.102-.761-1.916-1.904-2.034v-.1c.832-.14 1.482-.93 1.482-1.816 0-1.3-.955-2.11-2.542-2.11H5.062zm1.313-4.875V4.658h1.78c.973 0 1.542.457 1.542 1.237 0 .802-.604 1.23-1.764 1.23zm0 3.762V8.162h1.822c1.236 0 1.887.463 1.887 1.348 0 .896-.627 1.377-1.811 1.377z"/>
52
+ <path d="M0 4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4zm4-3a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V4a3 3 0 0 0-3-3z"/>
53
+ </svg>
54
+ `,
55
+ "bootstrap-fill": e`
56
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-boombox-fill"
57
+ viewBox="0 0 16 16">
58
+ <path d="M14 0a.5.5 0 0 1 .5.5V2h.5a1 1 0 0 1 1 1v2H0V3a1 1 0 0 1 1-1h12.5V.5A.5.5 0 0 1 14 0M2 3.5a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0m2 0a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0m7.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m1.5-.5a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0M9.5 3h-3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1M6 10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m-1.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m7 1a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3m.5-1.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0"/>
59
+ <path d="M0 6h16v8a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1zm2 4.5a2.5 2.5 0 1 0 5 0 2.5 2.5 0 0 0-5 0m7 0a2.5 2.5 0 1 0 5 0 2.5 2.5 0 0 0-5 0"/>
60
+ </svg>
61
+ `,
62
+ bicycle: e`
63
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-bicycle"
64
+ viewBox="0 0 16 16">
65
+ <path d="M4 4.5a.5.5 0 0 1 .5-.5H6a.5.5 0 0 1 0 1v.5h4.14l.386-1.158A.5.5 0 0 1 11 4h1a.5.5 0 0 1 0 1h-.64l-.311.935.807 1.29a3 3 0 1 1-.848.53l-.508-.812-2.076 3.322A.5.5 0 0 1 8 10.5H5.959a3 3 0 1 1-1.815-3.274L5 5.856V5h-.5a.5.5 0 0 1-.5-.5m1.5 2.443-.508.814c.5.444.85 1.054.967 1.743h1.139zM8 9.057 9.598 6.5H6.402zM4.937 9.5a2 2 0 0 0-.487-.877l-.548.877zM3.603 8.092A2 2 0 1 0 4.937 10.5H3a.5.5 0 0 1-.424-.765zm7.947.53a2 2 0 1 0 .848-.53l1.026 1.643a.5.5 0 1 1-.848.53z"/>
66
+ </svg>
67
+ `,
68
+ home: e`
69
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 -960 960 960" fill="currentColor">
70
+ <path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/>
71
+ </svg>
72
+ `,
73
+ motion: e`
74
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
75
+ fill="currentColor" viewBox="0 0 24 24" >
76
+ <!--Boxicons v3.0.8 https://boxicons.com | License https://docs.boxicons.com/free-->
77
+ <path d="M17 7c-1.18 0-2.29.41-3.19 1.15-.69-.42-1.48-.65-2.31-.65-1.19 0-2.31.48-3.13 1.28A3.999 3.999 0 0 0 2 12a3.999 3.999 0 0 0 6.37 3.22c.83.81 1.95 1.28 3.13 1.28.83 0 1.63-.23 2.31-.65A5.002 5.002 0 0 0 22 12c0-2.76-2.24-5-5-5M6 14c-1.1 0-2-.9-2-2s.9-2 2-2c.47 0 .92.17 1.27.46l-.03.12c-.06.17-.1.34-.14.51-.01.07-.03.13-.04.2-.04.23-.06.47-.06.71s.03.48.06.71c.01.06.02.13.04.19.04.18.08.36.14.53.01.04.02.08.03.11-.35.29-.8.46-1.27.46m5.5.5c-.89 0-1.73-.49-2.18-1.29C9.11 12.85 9 12.43 9 12s.11-.85.33-1.23c.44-.78 1.28-1.27 2.17-1.27.37 0 .73.08 1.05.23-.09.19-.18.38-.25.57l-.03.1c-.07.21-.13.42-.17.64-.01.07-.03.13-.04.2-.04.25-.07.5-.07.76a5 5 0 0 0 .11.96c.04.22.1.44.17.65l.03.09c.07.2.15.39.25.58-.32.15-.68.23-1.05.23Zm5.5.5c-.9 0-1.75-.4-2.32-1.1a3.01 3.01 0 0 1-.01-3.8A3.005 3.005 0 0 1 20 12c0 1.65-1.35 3-3 3"></path>
78
+ </svg>
79
+ `
80
+ };
81
+ //#endregion
82
+ export { c as a, a as i, o as n, n as o, s as r, r as s, l as t };
@@ -0,0 +1 @@
1
+ import "../chunks/components-CpfyYVMT.js";
@@ -0,0 +1,3 @@
1
+ import "./chunks/components-CpfyYVMT.js";
2
+ export { o as composedParent, s as composedPath, n as getSvgLibrary, r as hasSvgLibrary, i as registerSvgLibrary, a as svg, t as systemIcons } from "./chunks/svg-YrZ3m-FZ.js";
3
+ import "./chunks/lib-DrxW6cQY.js";
@@ -0,0 +1,2 @@
1
+ export { o as composedParent, s as composedPath, n as getSvgLibrary, r as hasSvgLibrary, i as registerSvgLibrary, a as svg, t as systemIcons } from "../chunks/svg-YrZ3m-FZ.js";
2
+ import "../chunks/lib-DrxW6cQY.js";
@@ -0,0 +1,4 @@
1
+ export * from "./vx-panel/vx-panel.js";
2
+ export * from "./vx-route/vx-route.js";
3
+ export * from "./vx-router/vx-router.js";
4
+ export * from "./vx-svg/vx-svg.js";
@@ -0,0 +1,26 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * A nestable container for a logical grouping of content. When nested, the panel's colors
4
+ * can be adjusted using the level attribute. 0 is the bottom-most level. Higher levels
5
+ * lighten or darken the panel depending on the color scheme.
6
+ * <br><a href="https://vpuska.github.io/vx-docs/components/vx-panel/">Documentation</a>
7
+ */
8
+ export declare class VxPanel extends LitElement {
9
+ static styles: import("lit").CSSResult;
10
+ /**
11
+ * The attribute `level` represents the panel's hierarchy level on the page. The base level `0` (default) is
12
+ * the bottom-most level.
13
+ *
14
+ * CSS calculations for text, background and border colors are used to give each level a slightly adjusted appearance, giving a
15
+ * visual hierarchy when panels are nested.
16
+ */
17
+ level: 0 | 1 | 2 | 3 | 4 | 5 | 6;
18
+ headerNodes: Array<Node>;
19
+ footerNodes: Array<Node>;
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'vx-panel': VxPanel;
25
+ }
26
+ }
@@ -0,0 +1,7 @@
1
+ import { VxPanel } from "./vx-panel.component.js";
2
+ export default VxPanel;
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'vx-panel': VxPanel;
6
+ }
7
+ }
@@ -0,0 +1,62 @@
1
+ import { LitElement, nothing, type TemplateResult, type PropertyValues } from 'lit';
2
+ /**
3
+ * A route is a container for a set of content that is displayed when a specific URL fragment is
4
+ * matched by the parent `vx-router` element.
5
+ * <br><a href="https://vpuska.github.io/vx-docs/Components/vx-route/">Documentation</a>
6
+ * @see VxRouter
7
+ */
8
+ export declare class VxRoute extends LitElement {
9
+ static styles: import("lit").CSSResult;
10
+ /**
11
+ * The URL path of this route.
12
+ */
13
+ path: string;
14
+ /**
15
+ * Indicates whether this route is a subroute of another route. When the path is a subroute,
16
+ * a match is made when the path is a prefix of the URL. For example, if the path is `/customers`,
17
+ * this will match `/customers` and `/customers/123`. The subroute is expected to handle
18
+ * the remaining URL fragment.
19
+ * Defaults to false.
20
+ */
21
+ subroute: boolean;
22
+ /**
23
+ * Indicates whether the item is currently active.
24
+ * This property is updated by the parent {@link VxRouter} element.
25
+ * Defaults to false.
26
+ */
27
+ active: boolean;
28
+ /**
29
+ * Optional component element tag. When specified, any slotted content will be ignored. The component
30
+ * will be created and attached to the DOM.
31
+ */
32
+ component: string | undefined;
33
+ /**
34
+ * The HTML content to be rendered when this route is active. This can be {@link TemplateResult}
35
+ * or function returning a {@link TemplateResult}<br>
36
+ * Default is `<slot></slot>`.
37
+ */
38
+ customTemplate: TemplateResult | (() => TemplateResult);
39
+ /**
40
+ * Reference to the optional {@link component} element. This reference is set after the route is
41
+ * activated and destroyed when the route is deactivated.
42
+ */
43
+ componentRef: HTMLElement | undefined;
44
+ /**
45
+ * Parameters extracted from the URL when the route is activated.
46
+ */
47
+ parameters: Partial<Record<string, string | string[]>>;
48
+ private containerRef;
49
+ /**
50
+ * Activate the route the route's path matches the URL. Returns true if the route is activated, false otherwise.
51
+ * @param url The URL to match against the route's path. This URL is expected to be a full URL, including the
52
+ * protocol, host, and port. The URL is matched against the route's path using the same syntax as
53
+ * the `path-to-regexp` library.
54
+ */
55
+ activateIfMatches(url: string): boolean;
56
+ private newEvent;
57
+ connectedCallback(): void;
58
+ protected willUpdate(changedProperties: PropertyValues): void;
59
+ protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
60
+ private renderTemplate;
61
+ render(): TemplateResult | typeof nothing;
62
+ }
@@ -0,0 +1,7 @@
1
+ import { VxRoute } from "./vx-route.component.js";
2
+ export default VxRoute;
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'vx-route': VxRoute;
6
+ }
7
+ }
@@ -0,0 +1,29 @@
1
+ import { LitElement } from 'lit';
2
+ import { VxRoute } from "../vx-route/vx-route.component.js";
3
+ /**
4
+ * A simple application router to render routes conditionally based on the current URL.
5
+ * Each route is declared as a slotted `vx-route` element.
6
+ * <br><a href="https://vpuska.github.io/vx-docs/Components/vx-router/">Documentation</a>
7
+ * @see VxRoute
8
+ */
9
+ export declare class VxRouter extends LitElement {
10
+ static styles: import("lit").CSSResult;
11
+ /**
12
+ * Indicates that routes are matched in reverse order. When set, routes should be listed with
13
+ * from least specific to most specific.
14
+ */
15
+ reversed: boolean;
16
+ currentURL: URL;
17
+ routes: Array<VxRoute>;
18
+ constructor();
19
+ connectedCallback(): void;
20
+ disconnectedCallback(): void;
21
+ firstUpdated(): void;
22
+ navigateEventHandler(evt: NavigateEvent): void;
23
+ /**
24
+ * Called by `navigateEventHandler()` to set/change the current route when a navigation event
25
+ * occurs.
26
+ */
27
+ activateMatchingRoute(): void;
28
+ render(): import("lit-html").TemplateResult<1>;
29
+ }
@@ -0,0 +1,7 @@
1
+ import { VxRouter } from "./vx-router.component.js";
2
+ export default VxRouter;
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'vx-router': VxRouter;
6
+ }
7
+ }
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * vx-svg is a component that renders an SVG icon from the vx-svg library.
4
+ * <br><a href="https://vpuska.github.io/vx-docs/Components/vx-svg/">Documentation</a>
5
+ */
6
+ export declare class VxSvg extends LitElement {
7
+ static styles: import("lit").CSSResult;
8
+ static notFoundIcon: import("lit-html").TemplateResult<1>;
9
+ library: null;
10
+ name: string;
11
+ button: boolean;
12
+ render(): import("lit-html").TemplateResult;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { VxSvg } from "./vx-svg.component.js";
2
+ export default VxSvg;
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'vx-svg': VxSvg;
6
+ }
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./components/index.js";
2
+ export * from "./lib/index.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns the composed parent of the given node. Works for across slots, shadow and light DOM.
3
+ */
4
+ export declare function composedParent(node: Node): ParentNode | null;
5
+ /**
6
+ * Returns the composed path of the given node. The path is an array of nodes from the
7
+ * given node to the root.
8
+ * @param node
9
+ */
10
+ export declare function composedPath(node: Node): Array<Node>;
@@ -0,0 +1,3 @@
1
+ export * from "./dom.js";
2
+ export * from "./svg.js";
3
+ export * from "./theming.js";
@@ -0,0 +1,29 @@
1
+ import { nothing, type TemplateResult } from "lit";
2
+ /**
3
+ * Object type mapping svg icon identifiers/keys to SVG template results.
4
+ */
5
+ export type SVGLibrary = Record<string, TemplateResult>;
6
+ /**
7
+ * Registers a new {@link SVGLibrary} with the given name. The library is used to
8
+ * store SVG icons that can be referenced by their identifiers/keys.
9
+ * @param name The name of the library.
10
+ * @param library The SVG library object.
11
+ * @see {@link VxSvg}
12
+ */
13
+ export declare function registerSvgLibrary(name: string, library: SVGLibrary): void;
14
+ /**
15
+ * Returns the {@link SVGLibrary} with the given name.
16
+ * @param name - The name of the SVG library.
17
+ */
18
+ export declare function getSvgLibrary(name: string): SVGLibrary | undefined;
19
+ /**
20
+ * Returns true if the SVG library with the given name exists.
21
+ * @param name - The name of the SVG library.
22
+ */
23
+ export declare function hasSvgLibrary(name: string): boolean;
24
+ /**
25
+ * Returns the SVG template result for the given icon name.
26
+ * @param name - The name of the icon in the format `library.icon`. If library is not specified,
27
+ * the default library is used.
28
+ */
29
+ export declare function svg(name: string): TemplateResult | typeof nothing;
@@ -0,0 +1,2 @@
1
+ import { type SVGLibrary } from "./svg-register.js";
2
+ export declare const systemIcons: SVGLibrary;
@@ -0,0 +1,4 @@
1
+ import type { SVGLibrary } from "./svg/svg-register.js";
2
+ import { registerSvgLibrary, getSvgLibrary, hasSvgLibrary, svg } from "./svg/svg-register.js";
3
+ import { systemIcons } from "./svg/system-icons.js";
4
+ export { registerSvgLibrary, getSvgLibrary, hasSvgLibrary, systemIcons, svg, type SVGLibrary };
@@ -0,0 +1,16 @@
1
+ import type { CSSResult } from "lit";
2
+ type StyleFunction = (params: Object) => CSSResult;
3
+ export default class VxThemeManager {
4
+ static functions: Map<string, StyleFunction>;
5
+ /**
6
+ * Initialise Theme module and load preferred theme.
7
+ */
8
+ static init(): void;
9
+ /**
10
+ * Load the current theme (light/dark) and theme color based on saved preference or system settings.
11
+ */
12
+ static loadTheme(): void;
13
+ static registerFunction(name: string, func: StyleFunction): void;
14
+ static getFunction(name: string): StyleFunction | undefined;
15
+ }
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@vpuska/vx-components",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/library/index.js",
6
+ "module": "./dist/library/index.js",
7
+ "types": "./dist/library/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/library/types/index.d.ts",
11
+ "import": "./dist/library/index.js"
12
+ },
13
+ "./components": {
14
+ "types": "./dist/library/types/components/index.d.ts",
15
+ "import": "./dist/library/components/index.js"
16
+ },
17
+ "./lib": {
18
+ "types": "./dist/library/types/lib/index.d.ts",
19
+ "import": "./dist/library/lib/index.js"
20
+ },
21
+ "./browser": {
22
+ "default": "./dist/browser/vx-components.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist/library",
27
+ "dist/browser"
28
+ ],
29
+ "web-types": [
30
+ "./vx-webtypes.json"
31
+ ],
32
+ "scripts": {
33
+ "dev": "vite",
34
+ "build": "npm run build:library && npm run build:browser",
35
+ "build:library": "vite build --mode library && tsc -p tsconfig.build.json && node scripts/rewrite-type-imports.mjs",
36
+ "build:browser": "vite build --mode browser",
37
+ "preview": "vite preview",
38
+ "webtypes": "wca-webtypes analyse src/components/**/*.component.ts --format webtypes --outFile vx-webtypes.json"
39
+ },
40
+ "dependencies": {
41
+ "color2k": "^2.0.4",
42
+ "lit": "^3.3.3",
43
+ "path-to-regexp": "^9.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@web-types/lit": "^2.0.0-3",
47
+ "typescript": "~6.0.2",
48
+ "vite": "^8.3.0"
49
+ },
50
+ "wca": {
51
+ "webtypesConfig": {
52
+ "name": "vx-components",
53
+ "version": "0.0.1",
54
+ "framework": "lit",
55
+ "description-markup": "markdown",
56
+ "formats": ["es"]
57
+ }
58
+ }
59
+ }