@ahriknow/lux 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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/README_zh-CN.md +127 -0
  4. package/dist/components/lux-button/index.iife.min.js +292 -0
  5. package/dist/components/lux-button/index.min.js +292 -0
  6. package/dist/components/lux-code/index.iife.min.js +290 -0
  7. package/dist/components/lux-code/index.min.js +290 -0
  8. package/dist/components/lux-dropdown/index.iife.min.js +162 -0
  9. package/dist/components/lux-dropdown/index.min.js +162 -0
  10. package/dist/components/lux-example/index.iife.min.js +88 -0
  11. package/dist/components/lux-example/index.min.js +88 -0
  12. package/dist/components/lux-icon/index.iife.min.js +22 -0
  13. package/dist/components/lux-icon/index.min.js +22 -0
  14. package/dist/components/lux-input/index.iife.min.js +238 -0
  15. package/dist/components/lux-input/index.min.js +238 -0
  16. package/dist/components/lux-layout/index.iife.min.js +90 -0
  17. package/dist/components/lux-layout/index.min.js +90 -0
  18. package/dist/components/lux-menu/index.iife.min.js +193 -0
  19. package/dist/components/lux-menu/index.min.js +193 -0
  20. package/dist/components/lux-scroll/index.iife.min.js +137 -0
  21. package/dist/components/lux-scroll/index.min.js +137 -0
  22. package/dist/components/lux-switch/index.iife.min.js +116 -0
  23. package/dist/components/lux-switch/index.min.js +116 -0
  24. package/dist/components/lux-table/index.iife.min.js +67 -0
  25. package/dist/components/lux-table/index.min.js +67 -0
  26. package/dist/lux.core.min.js +1 -0
  27. package/dist/lux.i18n.min.js +1 -0
  28. package/dist/lux.iife.js +1822 -0
  29. package/dist/lux.iife.js.map +1 -0
  30. package/dist/lux.iife.min.js +1 -0
  31. package/dist/lux.js +1792 -0
  32. package/dist/lux.js.map +1 -0
  33. package/dist/lux.min.js +1 -0
  34. package/dist/lux.router.min.js +1 -0
  35. package/dist/lux.template.min.js +1 -0
  36. package/dist/lux.theme.min.js +1 -0
  37. package/dist/themes/dark.css +130 -0
  38. package/dist/themes/light.css +128 -0
  39. package/package.json +64 -0
  40. package/src/components/lux-button/index.js +319 -0
  41. package/src/components/lux-code/index.js +382 -0
  42. package/src/components/lux-dropdown/index.js +256 -0
  43. package/src/components/lux-example/index.js +117 -0
  44. package/src/components/lux-icon/index.js +180 -0
  45. package/src/components/lux-input/index.js +363 -0
  46. package/src/components/lux-layout/index.js +222 -0
  47. package/src/components/lux-menu/index.js +283 -0
  48. package/src/components/lux-scroll/index.js +349 -0
  49. package/src/components/lux-switch/index.js +203 -0
  50. package/src/components/lux-table/index.js +105 -0
  51. package/src/core.js +7 -0
  52. package/src/element.js +477 -0
  53. package/src/i18n/format.js +108 -0
  54. package/src/i18n/index.js +102 -0
  55. package/src/i18n/locale.js +26 -0
  56. package/src/index.js +22 -0
  57. package/src/router.js +330 -0
  58. package/src/template.js +402 -0
  59. package/src/theme/color.js +148 -0
  60. package/src/theme/create.js +97 -0
  61. package/src/theme/index.js +2 -0
  62. package/src/theme/tokens.js +128 -0
  63. package/src/themes/dark.css +130 -0
  64. package/src/themes/light.css +128 -0
@@ -0,0 +1,292 @@
1
+ const t=Symbol.for("lux-nothing");function e(t,...e){return{_$luxType$:1,strings:t,values:e}}function r(t,...e){return{_$luxType$:3,strings:t,values:e}}function o(t){return t&&void 0!==t._$luxType$}const n=/(?:([@.?][\w-]+)|(ref)|(class))=\s*$/;function s(e,r,n){if(r!==t&&null!=r)if(function(t){return t&&"repeat"===t._type}(r))!function(t,e){const{items:r,keyFn:n,renderFn:s}=e,i=t._repeatState;if(i)for(const t of i.entries)t.span&&t.span.parentNode&&t.span.parentNode.removeChild(t.span);const a=document.createDocumentFragment(),l=[];for(const t of r){const e=n(t),r=s(t),i=document.createElement("span");i.style.display="contents",o(r)?c(r,i):null!=r&&!1!==r&&i.appendChild(document.createTextNode(String(r))),a.appendChild(i),l.push({key:e,result:r,span:i})}t.appendChild(a),t._repeatState={entries:l}}(e,r);else if(o(r))c(r,e);else if(Array.isArray(r)){i(e);for(const t of r)if(o(t)){const r=document.createElement("span");r.style.display="contents",c(t,r),e.appendChild(r)}else t instanceof Node?e.appendChild(t):null!=t&&!1!==t&&e.appendChild(document.createTextNode(String(t)))}else{if(r instanceof Node)return i(e),void e.appendChild(r);1===e.childNodes.length&&e.firstChild.nodeType===Node.TEXT_NODE?e.firstChild.textContent=String(r):(i(e),e.appendChild(document.createTextNode(String(r))))}else i(e)}function i(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function a(e,r){const{element:o,name:n,prefix:s}=e;switch(s){case"@":{const s=e.committedValue,i=null==r||r===t,a=i&&null!=s||r?.capture!==s?.capture||r?.once!==s?.once||r?.passive!==s?.passive,c=!i&&(null==s||a);if(a&&o.removeEventListener(n,e._handler||s,s),c)if("function"==typeof r){const t=e._host||(e._host={handleEvent(t){const r=e.committedValue;if("function"==typeof r){const e=o.getRootNode().host||o;r.call(e,t)}}});e._handler=t,o.addEventListener(n,t)}else if("object"==typeof r&&r?.handleEvent){const t={handleEvent:t=>r.handleEvent.call(r,t)};e._handler=t,o.addEventListener(n,t,{capture:r.capture,once:r.once,passive:r.passive})}e.committedValue=r;break}case".":o[n]=r===t?void 0:r;break;case"?":o.toggleAttribute(n,!!r);break;case"ref":"function"==typeof r&&r(o);break;case"class":if("string"==typeof r)o.className=r;else if("object"==typeof r&&null!=r){const t=o.className||"",e=t?t.split(/\s+/):[];for(const[t,o]of Object.entries(r))if(o)e.includes(t)||e.push(t);else{const r=e.indexOf(t);-1!==r&&e.splice(r,1)}o.className=e.filter(Boolean).join(" ")}break;default:null==r||!1===r?o.removeAttribute(n):o.setAttribute(n,!0===r?"":String(r))}}function c(t,e,r){if(!o(t))return void(e.textContent=t??"");const{strings:i,values:c}=t;if(e._luxActiveParts&&e._luxStrings===i){for(const t of e._luxActiveParts)t.index<c.length&&("child"===t.type?s(t.span,c[t.index]):a(t,c[t.index]));return}const l=document.createElement("template"),h=function(t){const e=[];let r="";for(let o=0;o<t.length;o++)if(r+=t[o],o<t.length-1){const t=r.match(n);if(t){const n=t[1],s=!!t[2],i=!!t[3];let a="",c="";n?(a=n[0],c=n.slice(1)):s?(a="ref",c="ref"):i&&(a="class",c="class");const l=`lux-attr-${o}`;r=r.slice(0,-t[0].length)+`${l}="${c}" `,e.push({type:"attr",name:c,prefix:a,marker:l,index:o})}else{const t=`lux-${o}`;r+=`\x3c!--${t}--\x3e`,e.push({type:"child",marker:t,index:o})}}return{html:r,parts:e}}(i);l.innerHTML=h.html;const d=l.content.cloneNode(!0),p=[];for(const t of h.parts)if("child"===t.type){const e=document.createTreeWalker(d,NodeFilter.SHOW_COMMENT);let r;for(;r=e.nextNode();)if(r.data===t.marker){const e=document.createElement("span");e.style.display="contents",r.parentNode.replaceChild(e,r),s(e,c[t.index]),p.push({type:"child",span:e,index:t.index});break}}else{const e=d.querySelector(`[${t.marker}]`);if(e){e.removeAttribute(t.marker);const r={type:"attr",element:e,name:t.name,prefix:t.prefix,index:t.index,committedValue:void 0};a(r,c[t.index]),p.push(r)}}e.textContent="",e.appendChild(d),e._luxActiveParts=p,e._luxStrings=i}const l=new Set;let h=!1;function d(t){var e;l.add(t),h||(h=!0,e=()=>{h=!1;const t=[...l];l.clear();for(const e of t)e._$performUpdate()},Promise.resolve().then(e))}const p={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?null:JSON.stringify(t);default:return t}},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return Number(t);case Object:case Array:try{return JSON.parse(t)}catch{return null}default:return t}}};class u extends HTMLElement{static properties={};static styles=void 0;static finalized=!1;static elementProperties=new Map;static __prepare(){if(this.hasOwnProperty("elementProperties"))return;const t=Object.getPrototypeOf(this);t.finalize&&t.finalize(),this.elementProperties=new Map(t.elementProperties)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap?[...this.__attributeToPropertyMap.keys()]:[]}static finalize(){if(!this.hasOwnProperty("finalized")){if(this.finalized=!0,this.__prepare(),this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of e)this.createProperty(r,t[r])}this.__attributeToPropertyMap=new Map;for(const[t,e]of this.elementProperties){const r=this.__attributeNameForProperty(t,e);void 0!==r&&this.__attributeToPropertyMap.set(r,t)}this.elementStyles=this.styles}}static __attributeNameForProperty(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.replace(/([A-Z])/g,"-$1").toLowerCase():void 0}static createProperty(t,e={}){if(this.__prepare(),!this.elementProperties.has(t)&&(e.state&&(e={...e,attribute:!1}),this.elementProperties.set(t,e),!e.noAccessor)){const r=Symbol(),o=this.getPropertyDescriptor(t,r,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){const{type:o,reflect:n,converter:s}=r;return{get(){return this[e]},set(o){const n=this[e];this[e]=o,this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static _initializers=[];static addInitializer(t){this._initializers=[...this._initializers||[],t]}static shadowRootOptions={mode:"open"};constructor(){super(),this.__updatePending=!1,this.__hasUpdated=!1,this.__controllers=new Set,this.__reflectingProperty=null,this.constructor.hasOwnProperty("finalized")||this.constructor.finalize(),this.__saveInstanceProperties(),this.requestUpdate();for(const t of this.constructor._initializers||[])t(this)}__saveInstanceProperties(){const t=this.constructor.elementProperties;if(t)for(const[e,r]of t)if(!r.noAccessor&&this.hasOwnProperty(e)){const t=this[e];delete this[e],this.__instancePropertyValues=this.__instancePropertyValues||new Map,this.__instancePropertyValues.set(e,t)}}connectedCallback(){this.__controllers.forEach(t=>t.hostConnected?.()),this.constructor.hasOwnProperty("finalized")||this.constructor.finalize();const t=this.constructor.__attributeToPropertyMap;if(t)for(const[e,r]of t){const t=this.getAttribute(e);if(null!==t){const e=this.constructor.elementProperties.get(r);if(e){const o=e.converter?.fromAttribute??p.fromAttribute;this[r]=o(t,e.type)}}}if(this.__instancePropertyValues){for(const[t,e]of this.__instancePropertyValues)this[t]=e;this.__instancePropertyValues=void 0}this.renderRoot,this.__hasUpdated||this.requestUpdate()}disconnectedCallback(){this.__controllers.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){const o=this.constructor.__attributeToPropertyMap?.get(t);if(void 0!==o&&this.__reflectingProperty!==o){const t=this.constructor.elementProperties.get(o);if(t){const e="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:p;this.__reflectingProperty=o;const n=e.fromAttribute(r,t.type);this[o]=n,this.__reflectingProperty=null}}}get renderRoot(){return this._renderRoot||(this._renderRoot=this.createRenderRoot(),this.__adoptStyles()),this._renderRoot}createRenderRoot(){return this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions)}__adoptStyles(){const t=this.constructor.elementStyles;if(!t)return;const e=Array.isArray(t)?t:[t],r=[];for(const t of e)"string"==typeof t?r.push(t):o(t)&&r.push(t.strings.join(""));if(0!==r.length)if(void 0!==this._renderRoot.adoptedStyleSheets){const t=new CSSStyleSheet;t.replaceSync(r.join("\n")),this._renderRoot.adoptedStyleSheets=[...this._renderRoot.adoptedStyleSheets,t]}else{const t=document.createElement("style");t.textContent=r.join("\n"),this._renderRoot.appendChild(t)}}enableUpdating(t){}get updateComplete(){return this.__updateCompletePromise??Promise.resolve()}get hasUpdated(){return this.__hasUpdated}get isUpdatePending(){return this.__updatePending}requestUpdate(t,e,r){if(void 0!==t){if(!(r?.hasChanged??((t,e)=>!Object.is(t,e)))(this[t],e))return}this.__updatePending||(this.__updatePending=!0,d(this))}async performUpdate(){if(this.isUpdatePending){this.__updatePending=!1,this.willUpdate(new Map),this.__controllers.forEach(t=>t.hostUpdate?.()),this.update(new Map),this.__hasUpdated=!0;for(const[t,e]of this.constructor.elementProperties)if(e.reflect){const r=this[t],o=e.converter?.toAttribute??p.toAttribute,n=this.constructor.__attributeNameForProperty(t,e);if(void 0!==n){this.__reflectingProperty=t;const s=o(r,e.type);null==s?this.removeAttribute(n):this.setAttribute(n,String(s)),this.__reflectingProperty=null}}this.__controllers.forEach(t=>t.hostUpdated?.()),this.firstUpdated(new Map),this.updated(new Map)}}_$performUpdate(){this.performUpdate()}shouldUpdate(t){return!0}willUpdate(t){}update(t){const e=this.render();e&&c(e,this.renderRoot)}render(){return e``}firstUpdated(t){}updated(t){}propertyChangedCallback(t,e,r){}addController(t){this.__controllers.add(t),this.isConnected&&t.hostConnected?.()}removeController(t){this.__controllers.delete(t)}emit(t,e,r={}){return this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,...r}))}$(t){return this.renderRoot.querySelector(t)}$$(t){return this.renderRoot.querySelectorAll(t)}}function v(t,e){if(!t.includes("-"))throw new Error(`Component name must contain a hyphen: ${t}`);customElements.get(t)||customElements.define(t,e)}const b={check:'<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/>',content_copy:'<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>',close:'<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>',search:'<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>',menu:'<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>',arrow_back:'<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>',arrow_forward:'<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/>',add:'<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>',remove:'<path d="M19 13H5v-2h14v2z"/>',edit:'<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',delete:'<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>',home:'<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>',settings:'<path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/>',star:'<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>',heart:'<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>',share:'<path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/>',link:'<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.1 0-2-.9-2-2s.9-2 2-2h4v-1.9H7c-2.76 0-5 2.24-5 5zm7-3h4v1.9h-4V9zm3.9 6h-4v1.9h4c1.1 0 2-.9 2-2s-.9-2-2-2h-4v-1.9h4c2.76 0 5 2.24 5 5s-2.24 5-5 5z"/>',download:'<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>',upload:'<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/>',refresh:'<path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.73 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>',more_vert:'<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',more_horiz:'<path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',expand_more:'<path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/>',expand_less:'<path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/>',visibility:'<path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>',visibility_off:'<path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.12 2.12C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.21.53-2.76 0-5-2.24-5-5 0-.8.2-1.54.53-2.21zm4.21-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/>',info:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>',warning:'<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>',error_outline:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>',help_outline:'<path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 1-2.5 3-5V8c-1.1 0-2-.9-2-2zm0 10c-.59 0-1-.51-1-1s.41-1 1-1 1 .51 1 1-.41 1-1 1z"/>',light_mode:'<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"/>',dark_mode:'<path d="M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"/>',view_quilt:'<path d="M3 3v8h8V3H3zm6 6H5V5h4v4zm-6 4v8h8v-8H3zm6 6H5v-4h4v4zm4-16v8h8V3h-8zm6 6h-4V5h4v4zm-6 4v8h8v-8h-8zm6 6h-4v-4h4v4z"/>',code:'<path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>',toggle_on:'<path d="M6 7h12a5 5 0 010 10H6a5 5 0 010-10z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="18" cy="12" r="3"/>',swap_vert:'<path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"/>',arrow_down:'<path d="M3 8l9 9 9-9H3z"/>',language:'<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"/>',smart_button:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/>',table_chart:'<path d="M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z"/>',check_circle:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>',cancel:'<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>',pause:'<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>',play:'<path d="M8 5v14l11-7z"/>',stop:'<path d="M6 6h12v12H6z"/>',save:'<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>',folder:'<path d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/>',file:'<path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/>',email:'<path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>',person:'<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>',lock:'<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>',filter:'<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>',sort:'<path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>',calendar:'<path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z"/>',map:'<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"/>',camera:'<path d="M12 12m-3.2 0a3.2 3.2 0 1 0 6.4 0a3.2 3.2 0 1 0-6.4 0M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/>',bookmark:'<path d="M17 3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V5c0-1.1-.9-2-2-2z"/>',clock:'<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>',chat:'<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/>',phone:'<path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/>',notification:'<path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/>',cloud:'<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/>',download_done:'<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>',github:'<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>',npm:'<path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/>'},f=r`
2
+ :host {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: 1em;
7
+ height: 1em;
8
+ vertical-align: middle;
9
+ fill: currentColor;
10
+ flex-shrink: 0;
11
+ }
12
+
13
+ :host([size]) {
14
+ width: var(--icon-size);
15
+ height: var(--icon-size);
16
+ }
17
+
18
+ svg {
19
+ width: 100%;
20
+ height: 100%;
21
+ }
22
+ `;v("lux-icon",class extends u{static styles=f;static properties={name:{type:String,reflect:!0},size:{type:String,reflect:!0},color:{type:String,reflect:!0}};constructor(){super()}updated(){this.size&&this.style.setProperty("--icon-size",this._parseSize(this.size)),this.color&&(this.style.color=this.color);const t=this.renderRoot.querySelector(".icon-svg");t&&this.name&&b[this.name]&&(t.innerHTML=b[this.name])}_parseSize(t){return null==t?"":"number"==typeof t||/^\d+(\.\d+)?$/.test(t)?t+"px":t}render(){return this.childNodes.length>0?e`<slot></slot>`:this.name&&b[this.name]?e`<svg class="icon-svg" viewBox="0 0 24 24"></svg>`:e`<span style="font-size:0.75em;font-weight:600">${this.name||"?"}</span>`}});const g=r`
23
+ :host {
24
+ display: inline-flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+ vertical-align: middle;
29
+ user-select: none;
30
+ -webkit-tap-highlight-color: transparent;
31
+ font-family: inherit;
32
+ }
33
+ :host([block]) {
34
+ display: flex;
35
+ width: 100%;
36
+ }
37
+
38
+ /* ── Base ── */
39
+ .btn {
40
+ display: inline-flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ gap: var(--btn-gap, 8px);
44
+ padding: var(--btn-py, 6px) var(--btn-px, 16px);
45
+ border: 1px solid transparent;
46
+ border-radius: var(--btn-radius, 6px);
47
+ font-size: var(--btn-font, 13px);
48
+ font-weight: 500;
49
+ line-height: 1;
50
+ cursor: pointer;
51
+ transition: all var(--lux-transition, 150ms ease);
52
+ white-space: nowrap;
53
+ }
54
+ :host(:not([block])) .btn {
55
+ width: 100%;
56
+ box-sizing: border-box;
57
+ }
58
+ .btn:active {
59
+ transform: translateY(1px);
60
+ }
61
+
62
+ /* ── Default (primary solid) ── */
63
+ .btn {
64
+ background: rgb(var(--lux-primary-500));
65
+ color: #fff;
66
+ border-color: rgb(var(--lux-primary-500));
67
+ }
68
+ .btn:hover {
69
+ background: rgb(var(--lux-primary-600));
70
+ border-color: rgb(var(--lux-primary-600));
71
+ }
72
+ .btn:active {
73
+ background: rgb(var(--lux-primary-700));
74
+ }
75
+
76
+ /* ── Color variants (solid) ── */
77
+ :host([variant='secondary']) .btn {
78
+ background: rgb(var(--lux-card));
79
+ color: rgb(var(--lux-text));
80
+ border-color: rgb(var(--lux-border));
81
+ }
82
+ :host([variant='secondary']) .btn:hover {
83
+ background: rgb(var(--lux-hover));
84
+ border-color: rgb(var(--lux-border-hover));
85
+ }
86
+
87
+ :host([variant='success']) .btn {
88
+ background: rgb(var(--lux-success));
89
+ color: #fff;
90
+ border-color: rgb(var(--lux-success));
91
+ }
92
+ :host([variant='success']) .btn:hover {
93
+ background: rgb(22 163 74);
94
+ }
95
+
96
+ :host([variant='warning']) .btn {
97
+ background: rgb(var(--lux-warning));
98
+ color: #fff;
99
+ border-color: rgb(var(--lux-warning));
100
+ }
101
+ :host([variant='warning']) .btn:hover {
102
+ background: rgb(217 119 6);
103
+ }
104
+
105
+ :host([variant='error']) .btn,
106
+ :host([variant='danger']) .btn {
107
+ background: rgb(var(--lux-error));
108
+ color: #fff;
109
+ border-color: rgb(var(--lux-error));
110
+ }
111
+ :host([variant='error']) .btn:hover,
112
+ :host([variant='danger']) .btn:hover {
113
+ background: rgb(239 68 68);
114
+ }
115
+
116
+ :host([variant='info']) .btn {
117
+ background: rgb(var(--lux-info));
118
+ color: #fff;
119
+ border-color: rgb(var(--lux-info));
120
+ }
121
+ :host([variant='info']) .btn:hover {
122
+ background: rgb(37 99 235);
123
+ }
124
+
125
+ /* ── Outline (transparent bg, colored border/text) ── */
126
+ :host([outline]) .btn {
127
+ background: transparent;
128
+ color: rgb(var(--lux-primary-500));
129
+ border-color: rgb(var(--lux-primary-500));
130
+ }
131
+ :host([outline]) .btn:hover {
132
+ background: rgb(var(--lux-primary-500) / 10%);
133
+ }
134
+ :host([outline]) .btn:active {
135
+ background: rgb(var(--lux-primary-500) / 18%);
136
+ }
137
+
138
+ :host([outline][variant='secondary']) .btn {
139
+ color: rgb(var(--lux-text));
140
+ border-color: rgb(var(--lux-border));
141
+ }
142
+ :host([outline][variant='secondary']) .btn:hover {
143
+ background: rgb(var(--lux-hover));
144
+ }
145
+
146
+ :host([outline][variant='success']) .btn {
147
+ color: rgb(var(--lux-success));
148
+ border-color: rgb(var(--lux-success));
149
+ }
150
+ :host([outline][variant='success']) .btn:hover {
151
+ background: rgb(var(--lux-success) / 10%);
152
+ }
153
+
154
+ :host([outline][variant='warning']) .btn {
155
+ color: rgb(var(--lux-warning));
156
+ border-color: rgb(var(--lux-warning));
157
+ }
158
+ :host([outline][variant='warning']) .btn:hover {
159
+ background: rgb(var(--lux-warning) / 10%);
160
+ }
161
+
162
+ :host([outline][variant='error']) .btn,
163
+ :host([outline][variant='danger']) .btn {
164
+ color: rgb(var(--lux-error));
165
+ border-color: rgb(var(--lux-error));
166
+ }
167
+ :host([outline][variant='error']) .btn:hover,
168
+ :host([outline][variant='danger']) .btn:hover {
169
+ background: rgb(var(--lux-error) / 10%);
170
+ }
171
+
172
+ :host([outline][variant='info']) .btn {
173
+ color: rgb(var(--lux-info));
174
+ border-color: rgb(var(--lux-info));
175
+ }
176
+ :host([outline][variant='info']) .btn:hover {
177
+ background: rgb(var(--lux-info) / 10%);
178
+ }
179
+
180
+ /* ── Ghost (transparent, no border, colored text) ── */
181
+ :host([ghost]) .btn {
182
+ background: transparent;
183
+ border-color: transparent;
184
+ color: rgb(var(--lux-primary-500));
185
+ }
186
+ :host([ghost]) .btn:hover {
187
+ background: rgb(var(--lux-primary-500) / 10%);
188
+ }
189
+ :host([ghost]) .btn:active {
190
+ background: rgb(var(--lux-primary-500) / 18%);
191
+ }
192
+
193
+ :host([ghost][variant='secondary']) .btn {
194
+ color: rgb(var(--lux-text));
195
+ }
196
+ :host([ghost][variant='secondary']) .btn:hover {
197
+ background: rgb(var(--lux-hover));
198
+ }
199
+
200
+ :host([ghost][variant='success']) .btn {
201
+ color: rgb(var(--lux-success));
202
+ }
203
+ :host([ghost][variant='success']) .btn:hover {
204
+ background: rgb(var(--lux-success) / 10%);
205
+ }
206
+
207
+ :host([ghost][variant='warning']) .btn {
208
+ color: rgb(var(--lux-warning));
209
+ }
210
+ :host([ghost][variant='warning']) .btn:hover {
211
+ background: rgb(var(--lux-warning) / 10%);
212
+ }
213
+
214
+ :host([ghost][variant='error']) .btn,
215
+ :host([ghost][variant='danger']) .btn {
216
+ color: rgb(var(--lux-error));
217
+ }
218
+ :host([ghost][variant='error']) .btn:hover,
219
+ :host([ghost][variant='danger']) .btn:hover {
220
+ background: rgb(var(--lux-error) / 10%);
221
+ }
222
+
223
+ :host([ghost][variant='info']) .btn {
224
+ color: rgb(var(--lux-info));
225
+ }
226
+ :host([ghost][variant='info']) .btn:hover {
227
+ background: rgb(var(--lux-info) / 10%);
228
+ }
229
+
230
+ /* ── Size ── */
231
+ :host([size='sm']) .btn {
232
+ --btn-py: 4px;
233
+ --btn-px: 12px;
234
+ --btn-font: 12px;
235
+ --btn-gap: 4px;
236
+ }
237
+ :host([size='lg']) .btn {
238
+ --btn-py: 10px;
239
+ --btn-px: 20px;
240
+ --btn-font: 15px;
241
+ --btn-gap: 10px;
242
+ }
243
+
244
+ /* ── Shape: circle ── */
245
+ :host([shape='circle']) .btn {
246
+ border-radius: 50%;
247
+ --btn-px: 0;
248
+ width: var(--icon-size, 36px);
249
+ height: var(--icon-size, 36px);
250
+ padding: 0;
251
+ }
252
+ :host([shape='circle'][size='sm']) .btn {
253
+ --icon-size: 32px;
254
+ }
255
+ :host([shape='circle'][size='lg']) .btn {
256
+ --icon-size: 44px;
257
+ }
258
+
259
+ /* ── Shape: square ── */
260
+ :host([shape='square']) .btn {
261
+ --btn-px: 0;
262
+ width: var(--icon-size, 36px);
263
+ height: var(--icon-size, 36px);
264
+ padding: 0;
265
+ }
266
+ :host([shape='square'][size='sm']) .btn {
267
+ --icon-size: 32px;
268
+ }
269
+ :host([shape='square'][size='lg']) .btn {
270
+ --icon-size: 44px;
271
+ }
272
+
273
+ /* ── Loading ── */
274
+ .spinner {
275
+ width: 1em;
276
+ height: 1em;
277
+ border: 2px solid currentColor;
278
+ border-top-color: transparent;
279
+ border-radius: 50%;
280
+ animation: lux-spin 0.6s linear infinite;
281
+ }
282
+ @keyframes lux-spin {
283
+ to {
284
+ transform: rotate(360deg);
285
+ }
286
+ }
287
+ `;class m extends u{static styles=g;static properties={variant:{type:String,reflect:!0},size:{type:String,reflect:!0},shape:{type:String,reflect:!0},icon:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},block:{type:Boolean,reflect:!0},outline:{type:Boolean,reflect:!0},ghost:{type:Boolean,reflect:!0}};constructor(){super(),this.variant="primary",this.size="md"}render(){const t=!!this.icon;return e`
288
+ <div class="btn">
289
+ ${this.loading?e`<span class="spinner"></span>`:t?e`<lux-icon name=${this.icon}></lux-icon>`:""}
290
+ ${t?"":e`<slot></slot>`}
291
+ </div>
292
+ `}}v("lux-button",m);export{m as default};
@@ -0,0 +1,290 @@
1
+ var LuxCode=function(){"use strict";const e=Symbol.for("lux-nothing");function t(e,...t){return{_$luxType$:1,strings:e,values:t}}function r(e){return e&&void 0!==e._$luxType$}const o=/(?:([@.?][\w-]+)|(ref)|(class))=\s*$/;function s(t,o,s){if(o!==e&&null!=o)if(function(e){return e&&"repeat"===e._type}(o))!function(e,t){const{items:o,keyFn:s,renderFn:i}=t,n=e._repeatState;if(n)for(const e of n.entries)e.span&&e.span.parentNode&&e.span.parentNode.removeChild(e.span);const l=document.createDocumentFragment(),c=[];for(const e of o){const t=s(e),o=i(e),n=document.createElement("span");n.style.display="contents",r(o)?a(o,n):null!=o&&!1!==o&&n.appendChild(document.createTextNode(String(o))),l.appendChild(n),c.push({key:t,result:o,span:n})}e.appendChild(l),e._repeatState={entries:c}}(t,o);else if(r(o))a(o,t);else if(Array.isArray(o)){i(t);for(const e of o)if(r(e)){const r=document.createElement("span");r.style.display="contents",a(e,r),t.appendChild(r)}else e instanceof Node?t.appendChild(e):null!=e&&!1!==e&&t.appendChild(document.createTextNode(String(e)))}else{if(o instanceof Node)return i(t),void t.appendChild(o);1===t.childNodes.length&&t.firstChild.nodeType===Node.TEXT_NODE?t.firstChild.textContent=String(o):(i(t),t.appendChild(document.createTextNode(String(o))))}else i(t)}function i(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function n(t,r){const{element:o,name:s,prefix:i}=t;switch(i){case"@":{const i=t.committedValue,n=null==r||r===e,a=n&&null!=i||r?.capture!==i?.capture||r?.once!==i?.once||r?.passive!==i?.passive,l=!n&&(null==i||a);if(a&&o.removeEventListener(s,t._handler||i,i),l)if("function"==typeof r){const e=t._host||(t._host={handleEvent(e){const r=t.committedValue;if("function"==typeof r){const t=o.getRootNode().host||o;r.call(t,e)}}});t._handler=e,o.addEventListener(s,e)}else if("object"==typeof r&&r?.handleEvent){const e={handleEvent:e=>r.handleEvent.call(r,e)};t._handler=e,o.addEventListener(s,e,{capture:r.capture,once:r.once,passive:r.passive})}t.committedValue=r;break}case".":o[s]=r===e?void 0:r;break;case"?":o.toggleAttribute(s,!!r);break;case"ref":"function"==typeof r&&r(o);break;case"class":if("string"==typeof r)o.className=r;else if("object"==typeof r&&null!=r){const e=o.className||"",t=e?e.split(/\s+/):[];for(const[e,o]of Object.entries(r))if(o)t.includes(e)||t.push(e);else{const r=t.indexOf(e);-1!==r&&t.splice(r,1)}o.className=t.filter(Boolean).join(" ")}break;default:null==r||!1===r?o.removeAttribute(s):o.setAttribute(s,!0===r?"":String(r))}}function a(e,t,i){if(!r(e))return void(t.textContent=e??"");const{strings:a,values:l}=e;if(t._luxActiveParts&&t._luxStrings===a){for(const e of t._luxActiveParts)e.index<l.length&&("child"===e.type?s(e.span,l[e.index]):n(e,l[e.index]));return}const c=document.createElement("template"),d=function(e){const t=[];let r="";for(let s=0;s<e.length;s++)if(r+=e[s],s<e.length-1){const e=r.match(o);if(e){const o=e[1],i=!!e[2],n=!!e[3];let a="",l="";o?(a=o[0],l=o.slice(1)):i?(a="ref",l="ref"):n&&(a="class",l="class");const c=`lux-attr-${s}`;r=r.slice(0,-e[0].length)+`${c}="${l}" `,t.push({type:"attr",name:l,prefix:a,marker:c,index:s})}else{const e=`lux-${s}`;r+=`\x3c!--${e}--\x3e`,t.push({type:"child",marker:e,index:s})}}return{html:r,parts:t}}(a);c.innerHTML=d.html;const h=c.content.cloneNode(!0),p=[];for(const e of d.parts)if("child"===e.type){const t=document.createTreeWalker(h,NodeFilter.SHOW_COMMENT);let r;for(;r=t.nextNode();)if(r.data===e.marker){const t=document.createElement("span");t.style.display="contents",r.parentNode.replaceChild(t,r),s(t,l[e.index]),p.push({type:"child",span:t,index:e.index});break}}else{const t=h.querySelector(`[${e.marker}]`);if(t){t.removeAttribute(e.marker);const r={type:"attr",element:t,name:e.name,prefix:e.prefix,index:e.index,committedValue:void 0};n(r,l[e.index]),p.push(r)}}t.textContent="",t.appendChild(h),t._luxActiveParts=p,t._luxStrings=a}const l=new Set;let c=!1;function d(e){var t;l.add(e),c||(c=!0,t=()=>{c=!1;const e=[...l];l.clear();for(const t of e)t._$performUpdate()},Promise.resolve().then(t))}const h={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?null:JSON.stringify(e);default:return e}},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return Number(e);case Object:case Array:try{return JSON.parse(e)}catch{return null}default:return e}}};class p extends HTMLElement{static properties={};static styles=void 0;static finalized=!1;static elementProperties=new Map;static __prepare(){if(this.hasOwnProperty("elementProperties"))return;const e=Object.getPrototypeOf(this);e.finalize&&e.finalize(),this.elementProperties=new Map(e.elementProperties)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap?[...this.__attributeToPropertyMap.keys()]:[]}static finalize(){if(!this.hasOwnProperty("finalized")){if(this.finalized=!0,this.__prepare(),this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const r of t)this.createProperty(r,e[r])}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const r=this.__attributeNameForProperty(e,t);void 0!==r&&this.__attributeToPropertyMap.set(r,e)}this.elementStyles=this.styles}}static __attributeNameForProperty(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.replace(/([A-Z])/g,"-$1").toLowerCase():void 0}static createProperty(e,t={}){if(this.__prepare(),!this.elementProperties.has(e)&&(t.state&&(t={...t,attribute:!1}),this.elementProperties.set(e,t),!t.noAccessor)){const r=Symbol(),o=this.getPropertyDescriptor(e,r,t);void 0!==o&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){const{type:o,reflect:s,converter:i}=r;return{get(){return this[t]},set(o){const s=this[t];this[t]=o,this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static _initializers=[];static addInitializer(e){this._initializers=[...this._initializers||[],e]}static shadowRootOptions={mode:"open"};constructor(){super(),this.__updatePending=!1,this.__hasUpdated=!1,this.__controllers=new Set,this.__reflectingProperty=null,this.constructor.hasOwnProperty("finalized")||this.constructor.finalize(),this.__saveInstanceProperties(),this.requestUpdate();for(const e of this.constructor._initializers||[])e(this)}__saveInstanceProperties(){const e=this.constructor.elementProperties;if(e)for(const[t,r]of e)if(!r.noAccessor&&this.hasOwnProperty(t)){const e=this[t];delete this[t],this.__instancePropertyValues=this.__instancePropertyValues||new Map,this.__instancePropertyValues.set(t,e)}}connectedCallback(){this.__controllers.forEach(e=>e.hostConnected?.()),this.constructor.hasOwnProperty("finalized")||this.constructor.finalize();const e=this.constructor.__attributeToPropertyMap;if(e)for(const[t,r]of e){const e=this.getAttribute(t);if(null!==e){const t=this.constructor.elementProperties.get(r);if(t){const o=t.converter?.fromAttribute??h.fromAttribute;this[r]=o(e,t.type)}}}if(this.__instancePropertyValues){for(const[e,t]of this.__instancePropertyValues)this[e]=t;this.__instancePropertyValues=void 0}this.renderRoot,this.__hasUpdated||this.requestUpdate()}disconnectedCallback(){this.__controllers.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){const o=this.constructor.__attributeToPropertyMap?.get(e);if(void 0!==o&&this.__reflectingProperty!==o){const e=this.constructor.elementProperties.get(o);if(e){const t="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:h;this.__reflectingProperty=o;const s=t.fromAttribute(r,e.type);this[o]=s,this.__reflectingProperty=null}}}get renderRoot(){return this._renderRoot||(this._renderRoot=this.createRenderRoot(),this.__adoptStyles()),this._renderRoot}createRenderRoot(){return this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions)}__adoptStyles(){const e=this.constructor.elementStyles;if(!e)return;const t=Array.isArray(e)?e:[e],o=[];for(const e of t)"string"==typeof e?o.push(e):r(e)&&o.push(e.strings.join(""));if(0!==o.length)if(void 0!==this._renderRoot.adoptedStyleSheets){const e=new CSSStyleSheet;e.replaceSync(o.join("\n")),this._renderRoot.adoptedStyleSheets=[...this._renderRoot.adoptedStyleSheets,e]}else{const e=document.createElement("style");e.textContent=o.join("\n"),this._renderRoot.appendChild(e)}}enableUpdating(e){}get updateComplete(){return this.__updateCompletePromise??Promise.resolve()}get hasUpdated(){return this.__hasUpdated}get isUpdatePending(){return this.__updatePending}requestUpdate(e,t,r){if(void 0!==e){if(!(r?.hasChanged??((e,t)=>!Object.is(e,t)))(this[e],t))return}this.__updatePending||(this.__updatePending=!0,d(this))}async performUpdate(){if(this.isUpdatePending){this.__updatePending=!1,this.willUpdate(new Map),this.__controllers.forEach(e=>e.hostUpdate?.()),this.update(new Map),this.__hasUpdated=!0;for(const[e,t]of this.constructor.elementProperties)if(t.reflect){const r=this[e],o=t.converter?.toAttribute??h.toAttribute,s=this.constructor.__attributeNameForProperty(e,t);if(void 0!==s){this.__reflectingProperty=e;const i=o(r,t.type);null==i?this.removeAttribute(s):this.setAttribute(s,String(i)),this.__reflectingProperty=null}}this.__controllers.forEach(e=>e.hostUpdated?.()),this.firstUpdated(new Map),this.updated(new Map)}}_$performUpdate(){this.performUpdate()}shouldUpdate(e){return!0}willUpdate(e){}update(e){const t=this.render();t&&a(t,this.renderRoot)}render(){return t``}firstUpdated(e){}updated(e){}propertyChangedCallback(e,t,r){}addController(e){this.__controllers.add(e),this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers.delete(e)}emit(e,t,r={}){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,...r}))}$(e){return this.renderRoot.querySelector(e)}$$(e){return this.renderRoot.querySelectorAll(e)}}const u=(function(e,...t){return{_$luxType$:3,strings:e,values:t}})`
2
+ :host {
3
+ display: block;
4
+ position: relative;
5
+ margin: 12px 0;
6
+ border-radius: var(--lux-radius, 6px);
7
+ border: 1px solid rgb(var(--lux-code-border, 226 232 240));
8
+ }
9
+
10
+ :host(.has-fixed-height) {
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ :host(.has-fixed-height) .code-body {
16
+ flex: 1;
17
+ min-height: 0;
18
+ overflow: auto;
19
+ display: flex;
20
+ flex-direction: column;
21
+ }
22
+
23
+ :host(.has-fixed-height) pre {
24
+ flex: 1;
25
+ min-height: 0;
26
+ }
27
+
28
+ /* ── Header ── */
29
+ .header {
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: space-between;
33
+ padding: 4px 14px;
34
+ background: rgb(var(--lux-code-header, 241 245 249));
35
+ border-bottom: 1px solid rgb(var(--lux-code-border, 226 232 240));
36
+ font-size: 12px;
37
+ color: rgb(var(--lux-text-muted, 100 116 139));
38
+ }
39
+ .header.hidden {
40
+ display: none;
41
+ }
42
+
43
+ .dots {
44
+ display: flex;
45
+ gap: 8px;
46
+ }
47
+ .dot {
48
+ width: 12px;
49
+ height: 12px;
50
+ border-radius: 50%;
51
+ }
52
+ .dot-red {
53
+ background: #ff5f57;
54
+ }
55
+ .dot-yellow {
56
+ background: #ffbd2e;
57
+ }
58
+ .dot-green {
59
+ background: #28c840;
60
+ }
61
+
62
+ .header-right {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: 8px;
66
+ }
67
+
68
+ .lang-label {
69
+ font-size: 11px;
70
+ color: rgb(var(--lux-text-muted, 100 116 139));
71
+ opacity: 0.7;
72
+ }
73
+
74
+ .copy-btn {
75
+ display: inline-flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ padding: 4px;
79
+ border: none;
80
+ border-radius: 4px;
81
+ background: transparent;
82
+ color: rgb(var(--lux-text-secondary, 148 163 184));
83
+ cursor: pointer;
84
+ transition: all 0.15s;
85
+ }
86
+ .copy-btn:hover {
87
+ background: rgb(var(--lux-hover, 0 0 0 / 5%));
88
+ color: rgb(var(--lux-text, 15 23 42));
89
+ }
90
+
91
+ /* ── Floating copy (no header) ── */
92
+ .copy-float {
93
+ position: absolute;
94
+ top: 8px;
95
+ right: 8px;
96
+ display: none;
97
+ align-items: center;
98
+ justify-content: center;
99
+ width: 32px;
100
+ height: 32px;
101
+ border-radius: 6px;
102
+ background: rgb(var(--lux-code-header, 241 245 249));
103
+ border: 1px solid rgb(var(--lux-code-border, 226 232 240));
104
+ color: rgb(var(--lux-text-secondary, 148 163 184));
105
+ cursor: pointer;
106
+ transition: all 0.15s;
107
+ z-index: 1;
108
+ }
109
+ .copy-float:hover {
110
+ background: rgb(var(--lux-hover, 0 0 0 / 5%));
111
+ color: rgb(var(--lux-text, 15 23 42));
112
+ }
113
+ :host(:not([show-header]):hover) .copy-float {
114
+ display: flex;
115
+ }
116
+
117
+ /* ── Code block ── */
118
+ .code-body {
119
+ padding: 14px 18px;
120
+ position: relative;
121
+ background: rgb(var(--lux-code-bg, 248 250 252));
122
+ border-radius: 0 0 var(--lux-radius, 6px) var(--lux-radius, 6px);
123
+ overflow: auto;
124
+ }
125
+ :host([show-header]) .code-body {
126
+ border-radius: 0;
127
+ }
128
+
129
+ pre {
130
+ margin: 0;
131
+ padding: 0;
132
+ font-size: 13px;
133
+ line-height: 1.7;
134
+ font-family: var(--lux-font-mono, 'SF Mono', Consolas, monospace);
135
+ color: rgb(var(--lux-code-text, 51 65 85));
136
+ }
137
+
138
+ pre code {
139
+ display: block;
140
+ padding: 0;
141
+ }
142
+
143
+ .code-body::-webkit-scrollbar {
144
+ width: 8px;
145
+ height: 8px;
146
+ }
147
+ .code-body::-webkit-scrollbar-track {
148
+ background: transparent;
149
+ }
150
+ .code-body::-webkit-scrollbar-thumb {
151
+ background: rgb(var(--lux-scrollbar, 180 196 214));
152
+ border-radius: 4px;
153
+ }
154
+ .code-body::-webkit-scrollbar-thumb:hover {
155
+ background: rgb(var(--lux-text-muted, 100 116 139));
156
+ }
157
+ .code-body {
158
+ scrollbar-width: thin;
159
+ scrollbar-color: rgb(var(--lux-scrollbar, 180 196 214)) transparent;
160
+ }
161
+
162
+ pre code {
163
+ display: block;
164
+ font-family: inherit;
165
+ font-size: inherit;
166
+ line-height: inherit;
167
+ background: transparent;
168
+ padding: 0;
169
+ white-space: pre;
170
+ }
171
+
172
+ /* ── highlight.js token styles via CSS variables ── */
173
+ .hljs-keyword,
174
+ .hljs-doctag,
175
+ .hljs-template-tag,
176
+ .hljs-template-variable,
177
+ .hljs-type,
178
+ .hljs-variable.language_ {
179
+ color: rgb(var(--lux-code-keyword));
180
+ }
181
+ .hljs-string,
182
+ .hljs-meta .hljs-string,
183
+ .hljs-regexp {
184
+ color: rgb(var(--lux-code-string));
185
+ }
186
+ .hljs-number,
187
+ .hljs-literal,
188
+ .hljs-attr,
189
+ .hljs-attribute,
190
+ .hljs-selector-attr,
191
+ .hljs-selector-class,
192
+ .hljs-selector-id,
193
+ .hljs-variable {
194
+ color: rgb(var(--lux-code-number));
195
+ }
196
+ .hljs-comment,
197
+ .hljs-quote,
198
+ .hljs-formula,
199
+ .hljs-code {
200
+ color: rgb(var(--lux-code-comment));
201
+ font-style: italic;
202
+ }
203
+ .hljs-title.class_,
204
+ .hljs-title.class_.inherited__ {
205
+ color: rgb(var(--lux-code-class));
206
+ }
207
+ .hljs-title.function_ {
208
+ color: rgb(var(--lux-code-function));
209
+ }
210
+ .hljs-variable {
211
+ color: rgb(var(--lux-code-variable));
212
+ }
213
+ .hljs-tag,
214
+ .hljs-name,
215
+ .hljs-selector-pseudo,
216
+ .hljs-selector-tag {
217
+ color: rgb(var(--lux-code-tag));
218
+ }
219
+ .hljs-attr {
220
+ color: rgb(var(--lux-code-attr));
221
+ }
222
+ .hljs-selector-class {
223
+ color: rgb(var(--lux-code-selector));
224
+ }
225
+ .hljs-literal {
226
+ color: rgb(var(--lux-code-literal));
227
+ }
228
+ .hljs-symbol {
229
+ color: rgb(var(--lux-code-symbol));
230
+ }
231
+ .hljs-built_in {
232
+ color: rgb(var(--lux-code-built-in));
233
+ }
234
+ .hljs-meta {
235
+ color: rgb(var(--lux-code-meta));
236
+ }
237
+ .hljs-section {
238
+ color: rgb(var(--lux-code-section));
239
+ font-weight: 700;
240
+ }
241
+ .hljs-bullet {
242
+ color: rgb(var(--lux-code-bullet));
243
+ }
244
+ .hljs-operator {
245
+ color: rgb(var(--lux-code-operator));
246
+ }
247
+ .hljs-punctuation {
248
+ color: rgb(var(--lux-code-punctuation));
249
+ }
250
+ .hljs-subst {
251
+ color: rgb(var(--lux-code-text));
252
+ }
253
+ .hljs-addition {
254
+ color: rgb(var(--lux-code-addition));
255
+ }
256
+ .hljs-deletion {
257
+ color: rgb(var(--lux-code-deletion));
258
+ }
259
+ .hljs-emphasis {
260
+ font-style: italic;
261
+ }
262
+ .hljs-strong {
263
+ font-weight: 700;
264
+ }
265
+
266
+ .copied {
267
+ color: rgb(var(--lux-success, 34 197 94)) !important;
268
+ }
269
+ `,f=t`<span class="icon-svg" style="width:14px;height:14px;fill:currentColor"
270
+ ><svg viewBox="0 0 24 24">
271
+ <path
272
+ d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"
273
+ /></svg
274
+ ></span>`;class g extends p{static styles=u;static properties={code:{type:String},language:{type:String,reflect:!0},showHeader:{type:Boolean,attribute:"show-header",reflect:!0},showLanguage:{type:Boolean,attribute:"show-language",reflect:!0},showCopy:{type:Boolean,attribute:"show-copy",reflect:!0}};constructor(){super(),this.code=this.code||"",this.language=this.language||"",this.showHeader=this.showHeader??!1,this.showLanguage=this.showLanguage??!0,this.showCopy=this.showCopy??!0}updated(){this._highlight(),this._checkHeight()}_checkHeight(){const e=this.shadowRoot.host,t=e.getAttribute("style")||"",r=/height\s*:/i.test(t);e.classList.toggle("has-fixed-height",r)}_highlight(){const e=this.renderRoot.querySelector("code");if(!e||!this.code)return;e.textContent=this.code;const t=window.hljs;if(t){const r=String(this.language||"");r&&(e.className=`language-${r}`);try{t.highlightElement(e)}catch(e){}}}async _copy(){try{await navigator.clipboard.writeText(this.code);this.renderRoot.querySelectorAll(".copy-btn, .copy-float").forEach(e=>{e.classList.add("copied"),setTimeout(()=>e.classList.remove("copied"),2e3)}),this.emit("copy",{code:this.code})}catch{}}render(){return t`
275
+ <div class=${{header:!0,hidden:!this.showHeader}}>
276
+ <div class="dots">
277
+ <span class="dot dot-red"></span>
278
+ <span class="dot dot-yellow"></span>
279
+ <span class="dot dot-green"></span>
280
+ </div>
281
+ <div class="header-right">
282
+ ${this.showLanguage?t`<span class="lang-label">${this.language||"text"}</span>`:""}
283
+ ${this.showCopy?t`<button class="copy-btn" @click=${()=>this._copy()}>${f}</button>`:""}
284
+ </div>
285
+ </div>
286
+ ${!this.showHeader&&this.showCopy?t`<button class="copy-float" @click=${()=>this._copy()}>${f}</button>`:""}
287
+ <div class="code-body">
288
+ <pre><code></code></pre>
289
+ </div>
290
+ `}}return function(e,t){if(!e.includes("-"))throw new Error(`Component name must contain a hyphen: ${e}`);customElements.get(e)||customElements.define(e,t)}("lux-code",g),g}();