@aura-group/aura-design
Advanced tools
Comparing version 0.3.16 to 0.3.17
@@ -1,3 +0,3 @@ | ||
(function(b,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):(b=typeof globalThis<"u"?globalThis:b||self,G(b["aura-design"]={}))})(this,function(b){"use strict";const G=(e,n)=>e===n,Ue=Symbol("solid-track"),Y={equals:G};let ce=he;const N=1,J=2,ue={owned:null,cleanups:null,context:null,owner:null};var x=null;let re=null,_=null,k=null,j=null,W=0;function Q(e,n){const t=_,o=x,r=e.length===0,i=r?ue:{owned:null,cleanups:null,context:null,owner:n===void 0?o:n},l=r?e:()=>e(()=>B(()=>te(i)));x=i,_=null;try{return q(l,!0)}finally{_=t,x=o}}function S(e,n){n=n?Object.assign({},Y,n):Y;const t={value:e,observers:null,observerSlots:null,comparator:n.equals||void 0},o=r=>(typeof r=="function"&&(r=r(t.value)),fe(t,r));return[de.bind(t),o]}function p(e,n,t){const o=oe(e,n,!1,N);V(o)}function Ve(e,n,t){ce=Je;const o=oe(e,n,!1,N);o.user=!0,j?j.push(o):V(o)}function F(e,n,t){t=t?Object.assign({},Y,t):Y;const o=oe(e,n,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=t.equals||void 0,V(o),de.bind(o)}function B(e){if(_===null)return e();const n=_;_=null;try{return e()}finally{_=n}}function U(e){Ve(()=>B(e))}function qe(e){return x===null||(x.cleanups===null?x.cleanups=[e]:x.cleanups.push(e)),e}function h(){return x}function de(){if(this.sources&&this.state)if(this.state===N)V(this);else{const e=k;k=null,q(()=>ee(this),!1),k=e}if(_){const e=this.observers?this.observers.length:0;_.sources?(_.sources.push(this),_.sourceSlots.push(e)):(_.sources=[this],_.sourceSlots=[e]),this.observers?(this.observers.push(_),this.observerSlots.push(_.sources.length-1)):(this.observers=[_],this.observerSlots=[_.sources.length-1])}return this.value}function fe(e,n,t){let o=e.value;return(!e.comparator||!e.comparator(o,n))&&(e.value=n,e.observers&&e.observers.length&&q(()=>{for(let r=0;r<e.observers.length;r+=1){const i=e.observers[r],l=re&&re.running;l&&re.disposed.has(i),(l?!i.tState:!i.state)&&(i.pure?k.push(i):j.push(i),i.observers&&ge(i)),l||(i.state=N)}if(k.length>1e6)throw k=[],new Error},!1)),n}function V(e){if(!e.fn)return;te(e);const n=x,t=_,o=W;_=x=e,Xe(e,e.value,o),_=t,x=n}function Xe(e,n,t){let o;try{o=e.fn(n)}catch(r){return e.pure&&(e.state=N,e.owned&&e.owned.forEach(te),e.owned=null),e.updatedAt=t+1,be(r)}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?fe(e,o):e.value=o,e.updatedAt=t)}function oe(e,n,t,o=N,r){const i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:x,context:null,pure:t};return x===null||x!==ue&&(x.owned?x.owned.push(i):x.owned=[i]),i}function Z(e){if(e.state===0)return;if(e.state===J)return ee(e);if(e.suspense&&B(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<W);)e.state&&n.push(e);for(let t=n.length-1;t>=0;t--)if(e=n[t],e.state===N)V(e);else if(e.state===J){const o=k;k=null,q(()=>ee(e,n[0]),!1),k=o}}function q(e,n){if(k)return e();let t=!1;n||(k=[]),j?t=!0:j=[],W++;try{const o=e();return Ye(t),o}catch(o){t||(j=null),k=null,be(o)}}function Ye(e){if(k&&(he(k),k=null),e)return;const n=j;j=null,n.length&&q(()=>ce(n),!1)}function he(e){for(let n=0;n<e.length;n++)Z(e[n])}function Je(e){let n,t=0;for(n=0;n<e.length;n++){const o=e[n];o.user?e[t++]=o:Z(o)}for(n=0;n<t;n++)Z(e[n])}function ee(e,n){e.state=0;for(let t=0;t<e.sources.length;t+=1){const o=e.sources[t];if(o.sources){const r=o.state;r===N?o!==n&&(!o.updatedAt||o.updatedAt<W)&&Z(o):r===J&&ee(o,n)}}}function ge(e){for(let n=0;n<e.observers.length;n+=1){const t=e.observers[n];t.state||(t.state=J,t.pure?k.push(t):j.push(t),t.observers&&ge(t))}}function te(e){let n;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),o=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const i=r.pop(),l=t.observerSlots.pop();o<r.length&&(i.sourceSlots[l]=o,r[o]=i,t.observerSlots[o]=l)}}if(e.owned){for(n=e.owned.length-1;n>=0;n--)te(e.owned[n]);e.owned=null}if(e.cleanups){for(n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}e.state=0,e.context=null}function be(e){throw e}const We=Symbol("fallback");function pe(e){for(let n=0;n<e.length;n++)e[n]()}function Qe(e,n,t={}){let o=[],r=[],i=[],l=0,s=n.length>1?[]:null;return qe(()=>pe(i)),()=>{let d=e()||[],u,a;return d[Ue],B(()=>{let $=d.length,A,I,y,w,R,O,P,L,M;if($===0)l!==0&&(pe(i),i=[],o=[],r=[],l=0,s&&(s=[])),t.fallback&&(o=[We],r[0]=Q(fr=>(i[0]=fr,t.fallback())),l=1);else if(l===0){for(r=new Array($),a=0;a<$;a++)o[a]=d[a],r[a]=Q(g);l=$}else{for(y=new Array($),w=new Array($),s&&(R=new Array($)),O=0,P=Math.min(l,$);O<P&&o[O]===d[O];O++);for(P=l-1,L=$-1;P>=O&&L>=O&&o[P]===d[L];P--,L--)y[L]=r[P],w[L]=i[P],s&&(R[L]=s[P]);for(A=new Map,I=new Array(L+1),a=L;a>=O;a--)M=d[a],u=A.get(M),I[a]=u===void 0?-1:u,A.set(M,a);for(u=O;u<=P;u++)M=o[u],a=A.get(M),a!==void 0&&a!==-1?(y[a]=r[u],w[a]=i[u],s&&(R[a]=s[u]),a=I[a],A.set(M,a)):i[u]();for(a=O;a<$;a++)a in y?(r[a]=y[a],i[a]=w[a],s&&(s[a]=R[a],s[a](a))):r[a]=Q(g);r=r.slice(0,l=$),o=d.slice(0)}return r});function g($){if(i[a]=$,s){const[A,I]=S(a);return s[a]=I,n(d[a],A)}return n(d[a])}}}function C(e,n){return B(()=>e(n||{}))}const Ze=e=>`Stale read from <${e}>.`;function H(e){const n="fallback"in e&&{fallback:()=>e.fallback};return F(Qe(()=>e.each,e.children,n||void 0))}function T(e){const n=e.keyed,t=F(()=>e.when,void 0,{equals:(o,r)=>n?o===r:!o==!r});return F(()=>{const o=t();if(o){const r=e.children;return typeof r=="function"&&r.length>0?B(()=>r(n?o:()=>{if(!B(t))throw Ze("Show");return e.when})):r}return e.fallback},void 0,void 0)}function et(e,n,t){let o=t.length,r=n.length,i=o,l=0,s=0,d=n[r-1].nextSibling,u=null;for(;l<r||s<i;){if(n[l]===t[s]){l++,s++;continue}for(;n[r-1]===t[i-1];)r--,i--;if(r===l){const a=i<o?s?t[s-1].nextSibling:t[i-s]:d;for(;s<i;)e.insertBefore(t[s++],a)}else if(i===s)for(;l<r;)(!u||!u.has(n[l]))&&n[l].remove(),l++;else if(n[l]===t[i-1]&&t[s]===n[r-1]){const a=n[--r].nextSibling;e.insertBefore(t[s++],n[l++].nextSibling),e.insertBefore(t[--i],a),n[r]=t[i]}else{if(!u){u=new Map;let g=s;for(;g<i;)u.set(t[g],g++)}const a=u.get(n[l]);if(a!=null)if(s<a&&a<i){let g=l,$=1,A;for(;++g<r&&g<i&&!((A=u.get(n[g]))==null||A!==a+$);)$++;if($>a-s){const I=n[l];for(;s<a;)e.insertBefore(t[s++],I)}else e.replaceChild(t[s++],n[l++])}else l++;else n[l++].remove()}}}const $e="_$DX_DELEGATE";function c(e,n,t){let o;const r=()=>{const l=document.createElement("template");return l.innerHTML=e,t?l.content.firstChild.firstChild:l.content.firstChild},i=n?()=>(o||(o=r())).cloneNode(!0):()=>B(()=>document.importNode(o||(o=r()),!0));return i.cloneNode=i,i}function X(e,n=window.document){const t=n[$e]||(n[$e]=new Set);for(let o=0,r=e.length;o<r;o++){const i=e[o];t.has(i)||(t.add(i),n.addEventListener(i,nt))}}function z(e,n,t){t==null?e.removeAttribute(n):e.setAttribute(n,t)}function K(e,n){n==null?e.removeAttribute("class"):e.className=n}function tt(e,n,t){return B(()=>e(n,t))}function f(e,n,t,o){if(t!==void 0&&!o&&(o=[]),typeof n!="function")return ne(e,n,o,t);p(r=>ne(e,n(),r,t),o)}function nt(e){const n=`$$${e.type}`;let t=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==t&&Object.defineProperty(e,"target",{configurable:!0,value:t}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}});t;){const o=t[n];if(o&&!t.disabled){const r=t[`${n}Data`];if(r!==void 0?o.call(t,r,e):o.call(t,e),e.cancelBubble)return}t=t._$host||t.parentNode||t.host}}function ne(e,n,t,o,r){for(;typeof t=="function";)t=t();if(n===t)return t;const i=typeof n,l=o!==void 0;if(e=l&&t[0]&&t[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(n=n.toString()),l){let s=t[0];s&&s.nodeType===3?s.data=n:s=document.createTextNode(n),t=D(e,t,o,s)}else t!==""&&typeof t=="string"?t=e.firstChild.data=n:t=e.textContent=n;else if(n==null||i==="boolean")t=D(e,t,o);else{if(i==="function")return p(()=>{let s=n();for(;typeof s=="function";)s=s();t=ne(e,s,t,o)}),()=>t;if(Array.isArray(n)){const s=[],d=t&&Array.isArray(t);if(ie(s,n,t,r))return p(()=>t=ne(e,s,t,o,!0)),()=>t;if(s.length===0){if(t=D(e,t,o),l)return t}else d?t.length===0?me(e,s,o):et(e,t,s):(t&&D(e),me(e,s));t=s}else if(n instanceof Node){if(Array.isArray(t)){if(l)return t=D(e,t,o,n);D(e,t,null,n)}else t==null||t===""||!e.firstChild?e.appendChild(n):e.replaceChild(n,e.firstChild);t=n}else console.warn("Unrecognized value. Skipped inserting",n)}return t}function ie(e,n,t,o){let r=!1;for(let i=0,l=n.length;i<l;i++){let s=n[i],d=t&&t[i];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))r=ie(e,s,d)||r;else if(typeof s=="function")if(o){for(;typeof s=="function";)s=s();r=ie(e,Array.isArray(s)?s:[s],Array.isArray(d)?d:[d])||r}else e.push(s),r=!0;else{const u=String(s);d&&d.nodeType===3?(d.data=u,e.push(d)):e.push(document.createTextNode(u))}}return r}function me(e,n,t=null){for(let o=0,r=n.length;o<r;o++)e.insertBefore(n[o],t)}function D(e,n,t,o){if(t===void 0)return e.textContent="";const r=o||document.createTextNode("");if(n.length){let i=!1;for(let l=n.length-1;l>=0;l--){const s=n[l];if(r!==s){const d=s.parentNode===e;!i&&!l?d?e.replaceChild(r,s):e.insertBefore(r,t):d&&s.remove()}else i=!0}}else e.insertBefore(r,t);return[r]}function rt(e){return Object.keys(e).reduce((t,o)=>{const r=e[o];return t[o]=Object.assign({},r),_e(r.value)&&!at(r.value)&&!Array.isArray(r.value)&&(t[o].value=Object.assign({},r.value)),Array.isArray(r.value)&&(t[o].value=r.value.slice(0)),t},{})}function ot(e){return e?Object.keys(e).reduce((t,o)=>{const r=e[o];return t[o]=_e(r)&&"value"in r?r:{value:r},t[o].attribute||(t[o].attribute=st(o)),t[o].parse="parse"in t[o]?t[o].parse:typeof t[o].value!="string",t},{}):{}}function it(e){return Object.keys(e).reduce((t,o)=>(t[o]=e[o].value,t),{})}function lt(e,n){const t=rt(n);return Object.keys(n).forEach(r=>{const i=t[r],l=e.getAttribute(i.attribute),s=e[r];l&&(i.value=i.parse?ve(l):l),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&ye(e,i.attribute,i.value),Object.defineProperty(e,r,{get(){return i.value},set(d){const u=i.value;i.value=d,i.reflect&&ye(this,i.attribute,i.value);for(let a=0,g=this.__propertyChangedCallbacks.length;a<g;a++)this.__propertyChangedCallbacks[a](r,d,u)},enumerable:!0,configurable:!0})}),t}function ve(e){if(e)try{return JSON.parse(e)}catch{return e}}function ye(e,n,t){if(t==null||t===!1)return e.removeAttribute(n);let o=JSON.stringify(t);e.__updating[n]=!0,o==="true"&&(o=""),e.setAttribute(n,o),Promise.resolve().then(()=>delete e.__updating[n])}function st(e){return e.replace(/\.?([A-Z]+)/g,(n,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")}function _e(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function at(e){return Object.prototype.toString.call(e)==="[object Function]"}function ct(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let le;function ut(e,n){const t=Object.keys(n);return class extends e{static get observedAttributes(){return t.map(r=>n[r].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=lt(this,n);const r=it(this.props),i=this.Component,l=le;try{le=this,this.__initialized=!0,ct(i)?new i(r,{element:this}):i(r,{element:this})}finally{le=l}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let r=null;for(;r=this.__releaseCallbacks.pop();)r(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(r,i,l){if(this.__initialized&&!this.__updating[r]&&(r=this.lookupProp(r),r in n)){if(l==null&&!this[r])return;this[r]=n[r].parse?ve(l):l}}lookupProp(r){if(n)return t.find(i=>r===i||r===n[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(r){this.__releaseCallbacks.push(r)}addPropertyChangedCallback(r){this.__propertyChangedCallbacks.push(r)}}}function dt(e,n={},t={}){const{BaseElement:o=HTMLElement,extension:r}=t;return i=>{if(!e)throw new Error("tag is required to register a Component");let l=customElements.get(e);return l?(l.prototype.Component=i,l):(l=ut(o,ot(n)),l.prototype.Component=i,l.prototype.registeredTag=e,customElements.define(e,l,r),l)}}function ft(e){const n=Object.keys(e),t={};for(let o=0;o<n.length;o++){const[r,i]=S(e[n[o]]);Object.defineProperty(t,n[o],{get:r,set(l){i(()=>l)}})}return t}function ht(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let n=e.parentNode;for(;n&&!n._$owner&&!(n.assignedSlot&&n.assignedSlot._$owner);)n=n.parentNode;return n&&n.assignedSlot?n.assignedSlot._$owner:e._$owner}function gt(e){return(n,t)=>{const{element:o}=t;return Q(r=>{const i=ft(n);o.addPropertyChangedCallback((s,d)=>i[s]=d),o.addReleaseCallback(()=>{o.renderRoot.textContent="",r()});const l=e(i,t);return f(o.renderRoot,l)},ht(o))}}function m(e,n,t){return arguments.length===2&&(t=n,n={}),dt(e,n)(gt(t))}const v="ar",bt=`:host{align-items:center;border-radius:var(--border-radius);display:inline-flex;height:var(--input-height)}button{align-items:center;background:inherit;border:none;border-radius:inherit;box-sizing:border-box;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:var(--gap);height:inherit;justify-content:center;min-width:4rem;outline:none;padding:0 12px;width:inherit}button:hover{filter:brightness(1.1)}.primary{background-image:var(--accent-gradient);color:var(--accent-color)}.primary.text{background-image:none;color:var(--primary-color)}.primary.outline{background-image:none;border:1px solid var(--primary-color);color:var(--primary-color)}.primary:hover{filter:brightness(1.2)}.info{background:var(--info-color)}.info.text{background:none;color:var(--text-color)}.info.outline{background:none;border:1px solid var(--info-color);color:var(--text-color)}.info:hover{filter:brightness(.95)}.warning{background:var(--warning-color);color:var(--accent-color)}.warning.text{background:none;color:var(--warning-color)}.warning.outline{background:none;border:1px solid var(--warning-color);color:var(--warning-color)}.danger{background:var(--danger-color);color:var(--accent-color)}.danger.text{background:none;color:var(--danger-color)}.danger.outline{background:none;border:1px solid var(--danger-color);color:var(--danger-color)}.success{background:var(--success-color);color:var(--accent-color)}.success.text{background:none;color:var(--success-color)}.success.outline{background:none;border:1px solid var(--success-color);color:var(--success-color)}.circle{border-radius:50%;min-width:auto;padding:0 2px;width:var(--input-height)}.round{border-radius:var(--round-radius)} | ||
`,pt=c("<style>"),we=c('<ar-icon name="loading" spin>',!0,!1),$t=c("<button>"),mt=c('<button><slot></slot><slot name="suffix">'),vt=c('<slot name="prefix">'),yt=c("<slot>"),_t=e=>[(()=>{const n=pt();return f(n,bt),n})(),C(T,{get when(){return e.shape==="circle"},get fallback(){return(()=>{const n=mt(),t=n.firstChild,o=t.nextSibling;return f(n,C(T,{get when(){return e.loading},get fallback(){return(()=>{const r=vt();return r._$owner=h(),r})()},get children(){const r=we();return r._$owner=h(),r}}),t),t._$owner=h(),o._$owner=h(),p(()=>K(n,`${e.status} ${e.type} ${e.shape}`)),n})()},get children(){const n=$t();return f(n,C(T,{get when(){return e.loading},get fallback(){return(()=>{const t=yt();return t._$owner=h(),t})()},get children(){const t=we();return t._$owner=h(),t}})),p(()=>K(n,`${e.status} ${e.type} ${e.shape}`)),n}})],xe=()=>{m(`${v}-button`,{type:"default",status:"primary",shape:"default",loading:!1},_t)},E=(e,...n)=>e.reduce((o,r,i)=>o+r+(n[i]||""),""),wt=c('<ar-icon size="5rem">',!0,!1),xt=c('<div class="flex flex-col justify-center gap-2 h-20"><div class="font-bold"></div><div class="font-size-3">'),kt=c('<img class="w-20 rd-2" alt="logo">'),Ct=c('<img class="w-6" alt="avatar">'),Et=c("<div>"),St=c(`<style>/* layer: preflights */ | ||
(function(p,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(p=typeof globalThis<"u"?globalThis:p||self,X(p["aura-design"]={}))})(this,function(p){"use strict";const X=(e,n)=>e===n,Ze=Symbol("solid-track"),q={equals:X};let fe=pe;const I=1,J=2,he={owned:null,cleanups:null,context:null,owner:null};var C=null;let ie=null,k=null,T=null,j=null,Q=0;function Y(e,n){const t=k,o=C,r=e.length===0,i=r?he:{owned:null,cleanups:null,context:null,owner:n===void 0?o:n},l=r?e:()=>e(()=>R(()=>ne(i)));C=i,k=null;try{return K(l,!0)}finally{k=t,C=o}}function S(e,n){n=n?Object.assign({},q,n):q;const t={value:e,observers:null,observerSlots:null,comparator:n.equals||void 0},o=r=>(typeof r=="function"&&(r=r(t.value)),$e(t,r));return[be.bind(t),o]}function v(e,n,t){const o=le(e,n,!1,I);W(o)}function ge(e,n,t){fe=rt;const o=le(e,n,!1,I);o.user=!0,j?j.push(o):W(o)}function M(e,n,t){t=t?Object.assign({},q,t):q;const o=le(e,n,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=t.equals||void 0,W(o),be.bind(o)}function R(e){if(k===null)return e();const n=k;k=null;try{return e()}finally{k=n}}function H(e){ge(()=>R(e))}function Z(e){return C===null||(C.cleanups===null?C.cleanups=[e]:C.cleanups.push(e)),e}function b(){return C}function et(e,n){const t=C,o=k;C=e,k=null;try{return K(n,!0)}catch(r){se(r)}finally{C=t,k=o}}function be(){if(this.sources&&this.state)if(this.state===I)W(this);else{const e=T;T=null,K(()=>te(this),!1),T=e}if(k){const e=this.observers?this.observers.length:0;k.sources?(k.sources.push(this),k.sourceSlots.push(e)):(k.sources=[this],k.sourceSlots=[e]),this.observers?(this.observers.push(k),this.observerSlots.push(k.sources.length-1)):(this.observers=[k],this.observerSlots=[k.sources.length-1])}return this.value}function $e(e,n,t){let o=e.value;return(!e.comparator||!e.comparator(o,n))&&(e.value=n,e.observers&&e.observers.length&&K(()=>{for(let r=0;r<e.observers.length;r+=1){const i=e.observers[r],l=ie&&ie.running;l&&ie.disposed.has(i),(l?!i.tState:!i.state)&&(i.pure?T.push(i):j.push(i),i.observers&&me(i)),l||(i.state=I)}if(T.length>1e6)throw T=[],new Error},!1)),n}function W(e){if(!e.fn)return;ne(e);const n=C,t=k,o=Q;k=C=e,tt(e,e.value,o),k=t,C=n}function tt(e,n,t){let o;try{o=e.fn(n)}catch(r){return e.pure&&(e.state=I,e.owned&&e.owned.forEach(ne),e.owned=null),e.updatedAt=t+1,se(r)}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?$e(e,o):e.value=o,e.updatedAt=t)}function le(e,n,t,o=I,r){const i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:C,context:null,pure:t};return C===null||C!==he&&(C.owned?C.owned.push(i):C.owned=[i]),i}function ee(e){if(e.state===0)return;if(e.state===J)return te(e);if(e.suspense&&R(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Q);)e.state&&n.push(e);for(let t=n.length-1;t>=0;t--)if(e=n[t],e.state===I)W(e);else if(e.state===J){const o=T;T=null,K(()=>te(e,n[0]),!1),T=o}}function K(e,n){if(T)return e();let t=!1;n||(T=[]),j?t=!0:j=[],Q++;try{const o=e();return nt(t),o}catch(o){t||(j=null),T=null,se(o)}}function nt(e){if(T&&(pe(T),T=null),e)return;const n=j;j=null,n.length&&K(()=>fe(n),!1)}function pe(e){for(let n=0;n<e.length;n++)ee(e[n])}function rt(e){let n,t=0;for(n=0;n<e.length;n++){const o=e[n];o.user?e[t++]=o:ee(o)}for(n=0;n<t;n++)ee(e[n])}function te(e,n){e.state=0;for(let t=0;t<e.sources.length;t+=1){const o=e.sources[t];if(o.sources){const r=o.state;r===I?o!==n&&(!o.updatedAt||o.updatedAt<Q)&&ee(o):r===J&&te(o,n)}}}function me(e){for(let n=0;n<e.observers.length;n+=1){const t=e.observers[n];t.state||(t.state=J,t.pure?T.push(t):j.push(t),t.observers&&me(t))}}function ne(e){let n;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),o=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const i=r.pop(),l=t.observerSlots.pop();o<r.length&&(i.sourceSlots[l]=o,r[o]=i,t.observerSlots[o]=l)}}if(e.owned){for(n=e.owned.length-1;n>=0;n--)ne(e.owned[n]);e.owned=null}if(e.cleanups){for(n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}e.state=0,e.context=null}function se(e){throw e}const ot=Symbol("fallback");function ve(e){for(let n=0;n<e.length;n++)e[n]()}function it(e,n,t={}){let o=[],r=[],i=[],l=0,s=n.length>1?[]:null;return Z(()=>ve(i)),()=>{let d=e()||[],u,a;return d[Ze],R(()=>{let m=d.length,E,z,$,_,g,x,O,F,U;if(m===0)l!==0&&(ve(i),i=[],o=[],r=[],l=0,s&&(s=[])),t.fallback&&(o=[ot],r[0]=Y(Ar=>(i[0]=Ar,t.fallback())),l=1);else if(l===0){for(r=new Array(m),a=0;a<m;a++)o[a]=d[a],r[a]=Y(h);l=m}else{for($=new Array(m),_=new Array(m),s&&(g=new Array(m)),x=0,O=Math.min(l,m);x<O&&o[x]===d[x];x++);for(O=l-1,F=m-1;O>=x&&F>=x&&o[O]===d[F];O--,F--)$[F]=r[O],_[F]=i[O],s&&(g[F]=s[O]);for(E=new Map,z=new Array(F+1),a=F;a>=x;a--)U=d[a],u=E.get(U),z[a]=u===void 0?-1:u,E.set(U,a);for(u=x;u<=O;u++)U=o[u],a=E.get(U),a!==void 0&&a!==-1?($[a]=r[u],_[a]=i[u],s&&(g[a]=s[u]),a=z[a],E.set(U,a)):i[u]();for(a=x;a<m;a++)a in $?(r[a]=$[a],i[a]=_[a],s&&(s[a]=g[a],s[a](a))):r[a]=Y(h);r=r.slice(0,l=m),o=d.slice(0)}return r});function h(m){if(i[a]=m,s){const[E,z]=S(a);return s[a]=z,n(d[a],E)}return n(d[a])}}}function A(e,n){return R(()=>e(n||{}))}const lt=e=>`Stale read from <${e}>.`;function G(e){const n="fallback"in e&&{fallback:()=>e.fallback};return M(it(()=>e.each,e.children,n||void 0))}function B(e){const n=e.keyed,t=M(()=>e.when,void 0,{equals:(o,r)=>n?o===r:!o==!r});return M(()=>{const o=t();if(o){const r=e.children;return typeof r=="function"&&r.length>0?R(()=>r(n?o:()=>{if(!R(t))throw lt("Show");return e.when})):r}return e.fallback},void 0,void 0)}function st(e,n,t){let o=t.length,r=n.length,i=o,l=0,s=0,d=n[r-1].nextSibling,u=null;for(;l<r||s<i;){if(n[l]===t[s]){l++,s++;continue}for(;n[r-1]===t[i-1];)r--,i--;if(r===l){const a=i<o?s?t[s-1].nextSibling:t[i-s]:d;for(;s<i;)e.insertBefore(t[s++],a)}else if(i===s)for(;l<r;)(!u||!u.has(n[l]))&&n[l].remove(),l++;else if(n[l]===t[i-1]&&t[s]===n[r-1]){const a=n[--r].nextSibling;e.insertBefore(t[s++],n[l++].nextSibling),e.insertBefore(t[--i],a),n[r]=t[i]}else{if(!u){u=new Map;let h=s;for(;h<i;)u.set(t[h],h++)}const a=u.get(n[l]);if(a!=null)if(s<a&&a<i){let h=l,m=1,E;for(;++h<r&&h<i&&!((E=u.get(n[h]))==null||E!==a+m);)m++;if(m>a-s){const z=n[l];for(;s<a;)e.insertBefore(t[s++],z)}else e.replaceChild(t[s++],n[l++])}else l++;else n[l++].remove()}}}const _e="_$DX_DELEGATE";function c(e,n,t){let o;const r=()=>{const l=document.createElement("template");return l.innerHTML=e,t?l.content.firstChild.firstChild:l.content.firstChild},i=n?()=>(o||(o=r())).cloneNode(!0):()=>R(()=>document.importNode(o||(o=r()),!0));return i.cloneNode=i,i}function D(e,n=window.document){const t=n[_e]||(n[_e]=new Set);for(let o=0,r=e.length;o<r;o++){const i=e[o];t.has(i)||(t.add(i),n.addEventListener(i,ct))}}function L(e,n,t){t==null?e.removeAttribute(n):e.setAttribute(n,t)}function N(e,n){n==null?e.removeAttribute("class"):e.className=n}function at(e,n,t){if(!n)return t?L(e,"style"):n;const o=e.style;if(typeof n=="string")return o.cssText=n;typeof t=="string"&&(o.cssText=t=void 0),t||(t={}),n||(n={});let r,i;for(i in t)n[i]==null&&o.removeProperty(i),delete t[i];for(i in n)r=n[i],r!==t[i]&&(o.setProperty(i,r),t[i]=r);return t}function ye(e,n,t){return R(()=>e(n,t))}function f(e,n,t,o){if(t!==void 0&&!o&&(o=[]),typeof n!="function")return re(e,n,o,t);v(r=>re(e,n(),r,t),o)}function ct(e){const n=`$$${e.type}`;let t=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==t&&Object.defineProperty(e,"target",{configurable:!0,value:t}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}});t;){const o=t[n];if(o&&!t.disabled){const r=t[`${n}Data`];if(r!==void 0?o.call(t,r,e):o.call(t,e),e.cancelBubble)return}t=t._$host||t.parentNode||t.host}}function re(e,n,t,o,r){for(;typeof t=="function";)t=t();if(n===t)return t;const i=typeof n,l=o!==void 0;if(e=l&&t[0]&&t[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(n=n.toString()),l){let s=t[0];s&&s.nodeType===3?s.data=n:s=document.createTextNode(n),t=V(e,t,o,s)}else t!==""&&typeof t=="string"?t=e.firstChild.data=n:t=e.textContent=n;else if(n==null||i==="boolean")t=V(e,t,o);else{if(i==="function")return v(()=>{let s=n();for(;typeof s=="function";)s=s();t=re(e,s,t,o)}),()=>t;if(Array.isArray(n)){const s=[],d=t&&Array.isArray(t);if(ae(s,n,t,r))return v(()=>t=re(e,s,t,o,!0)),()=>t;if(s.length===0){if(t=V(e,t,o),l)return t}else d?t.length===0?we(e,s,o):st(e,t,s):(t&&V(e),we(e,s));t=s}else if(n instanceof Node){if(Array.isArray(t)){if(l)return t=V(e,t,o,n);V(e,t,null,n)}else t==null||t===""||!e.firstChild?e.appendChild(n):e.replaceChild(n,e.firstChild);t=n}else console.warn("Unrecognized value. Skipped inserting",n)}return t}function ae(e,n,t,o){let r=!1;for(let i=0,l=n.length;i<l;i++){let s=n[i],d=t&&t[i];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))r=ae(e,s,d)||r;else if(typeof s=="function")if(o){for(;typeof s=="function";)s=s();r=ae(e,Array.isArray(s)?s:[s],Array.isArray(d)?d:[d])||r}else e.push(s),r=!0;else{const u=String(s);d&&d.nodeType===3?(d.data=u,e.push(d)):e.push(document.createTextNode(u))}}return r}function we(e,n,t=null){for(let o=0,r=n.length;o<r;o++)e.insertBefore(n[o],t)}function V(e,n,t,o){if(t===void 0)return e.textContent="";const r=o||document.createTextNode("");if(n.length){let i=!1;for(let l=n.length-1;l>=0;l--){const s=n[l];if(r!==s){const d=s.parentNode===e;!i&&!l?d?e.replaceChild(r,s):e.insertBefore(r,t):d&&s.remove()}else i=!0}}else e.insertBefore(r,t);return[r]}const ut="http://www.w3.org/2000/svg";function dt(e,n=!1){return n?document.createElementNS(ut,e):document.createElement(e)}function xe(e){const{useShadow:n}=e,t=document.createTextNode(""),o=()=>e.mount||document.body,r=b();let i;return ge(()=>{i||(i=et(r,()=>e.children));const l=o();if(l instanceof HTMLHeadElement){const[s,d]=S(!1),u=()=>d(!0);Y(a=>f(l,()=>s()?a():i,null)),Z(u)}else{const s=dt(e.isSVG?"g":"div",e.isSVG),d=n&&s.attachShadow?s.attachShadow({mode:"open"}):s;Object.defineProperty(s,"_$host",{get(){return t.parentNode},configurable:!0}),f(d,i),l.appendChild(s),e.ref&&e.ref(s),Z(()=>l.removeChild(s))}}),t}function ft(e){return Object.keys(e).reduce((t,o)=>{const r=e[o];return t[o]=Object.assign({},r),Ee(r.value)&&!pt(r.value)&&!Array.isArray(r.value)&&(t[o].value=Object.assign({},r.value)),Array.isArray(r.value)&&(t[o].value=r.value.slice(0)),t},{})}function ht(e){return e?Object.keys(e).reduce((t,o)=>{const r=e[o];return t[o]=Ee(r)&&"value"in r?r:{value:r},t[o].attribute||(t[o].attribute=$t(o)),t[o].parse="parse"in t[o]?t[o].parse:typeof t[o].value!="string",t},{}):{}}function gt(e){return Object.keys(e).reduce((t,o)=>(t[o]=e[o].value,t),{})}function bt(e,n){const t=ft(n);return Object.keys(n).forEach(r=>{const i=t[r],l=e.getAttribute(i.attribute),s=e[r];l&&(i.value=i.parse?ke(l):l),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&Ce(e,i.attribute,i.value),Object.defineProperty(e,r,{get(){return i.value},set(d){const u=i.value;i.value=d,i.reflect&&Ce(this,i.attribute,i.value);for(let a=0,h=this.__propertyChangedCallbacks.length;a<h;a++)this.__propertyChangedCallbacks[a](r,d,u)},enumerable:!0,configurable:!0})}),t}function ke(e){if(e)try{return JSON.parse(e)}catch{return e}}function Ce(e,n,t){if(t==null||t===!1)return e.removeAttribute(n);let o=JSON.stringify(t);e.__updating[n]=!0,o==="true"&&(o=""),e.setAttribute(n,o),Promise.resolve().then(()=>delete e.__updating[n])}function $t(e){return e.replace(/\.?([A-Z]+)/g,(n,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")}function Ee(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function pt(e){return Object.prototype.toString.call(e)==="[object Function]"}function mt(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let ce;function vt(e,n){const t=Object.keys(n);return class extends e{static get observedAttributes(){return t.map(r=>n[r].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=bt(this,n);const r=gt(this.props),i=this.Component,l=ce;try{ce=this,this.__initialized=!0,mt(i)?new i(r,{element:this}):i(r,{element:this})}finally{ce=l}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let r=null;for(;r=this.__releaseCallbacks.pop();)r(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(r,i,l){if(this.__initialized&&!this.__updating[r]&&(r=this.lookupProp(r),r in n)){if(l==null&&!this[r])return;this[r]=n[r].parse?ke(l):l}}lookupProp(r){if(n)return t.find(i=>r===i||r===n[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(r){this.__releaseCallbacks.push(r)}addPropertyChangedCallback(r){this.__propertyChangedCallbacks.push(r)}}}function _t(e,n={},t={}){const{BaseElement:o=HTMLElement,extension:r}=t;return i=>{if(!e)throw new Error("tag is required to register a Component");let l=customElements.get(e);return l?(l.prototype.Component=i,l):(l=vt(o,ht(n)),l.prototype.Component=i,l.prototype.registeredTag=e,customElements.define(e,l,r),l)}}function yt(e){const n=Object.keys(e),t={};for(let o=0;o<n.length;o++){const[r,i]=S(e[n[o]]);Object.defineProperty(t,n[o],{get:r,set(l){i(()=>l)}})}return t}function wt(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let n=e.parentNode;for(;n&&!n._$owner&&!(n.assignedSlot&&n.assignedSlot._$owner);)n=n.parentNode;return n&&n.assignedSlot?n.assignedSlot._$owner:e._$owner}function xt(e){return(n,t)=>{const{element:o}=t;return Y(r=>{const i=yt(n);o.addPropertyChangedCallback((s,d)=>i[s]=d),o.addReleaseCallback(()=>{o.renderRoot.textContent="",r()});const l=e(i,t);return f(o.renderRoot,l)},wt(o))}}function y(e,n,t){return arguments.length===2&&(t=n,n={}),_t(e,n)(xt(t))}const w="ar",kt=`:host{align-items:center;border-radius:var(--ar-size-3);display:inline-flex;height:var(--ar-size-m)}button{align-items:center;background:inherit;border:none;border-radius:inherit;box-sizing:border-box;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:var(--ar-size-6);height:inherit;justify-content:center;min-width:4rem;outline:none;padding:0 12px;width:inherit}button:hover{filter:brightness(1.1)}.primary{background:var(--ar-color-primary-gradient);color:var(--ar-color-white)}.primary.text{background:none;color:var(--ar-color-primary)}.primary.outline{background:none;border:1px solid var(--ar-color-primary);color:var(--ar-color-primary)}.primary:hover{filter:brightness(1.2)}.info{background:var(--ar-color-info);color:var(--ar-color-white)}.info.text{background:none;color:var(--ar-color-text)}.info.outline{background:none;border:1px solid var(--ar-color-info);color:var(--ar-color-text)}.info:hover{filter:brightness(.95)}.warning{background:var(--ar-color-warning);color:var(--ar-color-white)}.warning.text{background:none;color:var(--ar-color-warning)}.warning.outline{background:none;border:1px solid var(--ar-color-warning);color:var(--ar-color-warning)}.danger{background:var(--ar-color-danger);color:var(--ar-color-white)}.danger.text{background:none;color:var(--ar-color-danger)}.danger.outline{background:none;border:1px solid var(--ar-color-danger);color:var(--ar-color-danger)}.success{background:var(--ar-color-success);color:var(--ar-color-white)}.success.text{background:none;color:var(--ar-color-success)}.success.outline{background:none;border:1px solid var(--ar-color-success);color:var(--ar-color-success)}.circle{aspect-ratio:1 / 1;border-radius:50%;min-width:auto;padding:0 2px}.round{border-radius:var(--ar-size-21)} | ||
`,Ct=c("<style>"),ze=c('<ar-icon name="loading" spin>',!0,!1),Et=c("<button>"),zt=c('<button><slot></slot><slot name="suffix">'),St=c('<slot name="prefix">'),At=c("<slot>"),Tt=e=>[(()=>{const n=Ct();return f(n,kt),n})(),A(B,{get when(){return e.shape==="circle"},get fallback(){return(()=>{const n=zt(),t=n.firstChild,o=t.nextSibling;return f(n,A(B,{get when(){return e.loading},get fallback(){return(()=>{const r=St();return r._$owner=b(),r})()},get children(){const r=ze();return r._$owner=b(),r}}),t),t._$owner=b(),o._$owner=b(),v(()=>N(n,`${e.status} ${e.type} ${e.shape}`)),n})()},get children(){const n=Et();return f(n,A(B,{get when(){return e.loading},get fallback(){return(()=>{const t=At();return t._$owner=b(),t})()},get children(){const t=ze();return t._$owner=b(),t}})),v(()=>N(n,`${e.status} ${e.type} ${e.shape}`)),n}})],Se=()=>{y(`${w}-button`,{type:"default",status:"primary",shape:"default",loading:!1},Tt)},P=(e,...n)=>e.reduce((o,r,i)=>o+r+(n[i]||""),""),Pt=c('<ar-icon size="5rem">',!0,!1),Lt=c('<div class="flex flex-col justify-center gap-2 h-20"><div class="font-bold"></div><div class="font-size-3">'),Ot=c('<img class="w-20 rd-2" alt="logo">'),Bt=c('<img class="w-6" alt="avatar">'),jt=c("<div>"),Rt=c(`<style>/* layer: preflights */ | ||
*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;} | ||
@@ -21,3 +21,3 @@ /* layer: default */ | ||
.font-bold{font-weight:700;} | ||
.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);};`),zt=c('<slot class="flex items-center p-3 gap-3" style="border-bottom:1px solid var(--gray-2)" name="header">'),At=c('<slot name="footer" class="flex items-center p-3 gap-3" style="border-top:1px solid var(--gray-2)">'),Tt=c('<div class="bg-1 rd-3 cursor-pointer"><slot class="flex items-center p-3 gap-3">'),Ot=e=>{const n=E` | ||
.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);};`),Ft=c('<slot class="flex items-center p-3 gap-3" style="border-bottom:1px solid var( --ar-color-info-2)" name="header">'),It=c('<slot name="footer" class="flex items-center p-3 gap-3" style="border-top:1px solid var( --ar-color-info-2)">'),Nt=c('<div class="bg-1 rd-3 cursor-pointer"><slot class="flex items-center p-3 gap-3">'),Mt=e=>{const n=P` | ||
:host { | ||
@@ -27,9 +27,9 @@ display: block; | ||
.bg-1 { | ||
background-color: var(--bg-1); | ||
box-shadow: ${e.shadow==="always"?"var(--box-shadow)":"none"}; | ||
background-color: var(--ar-color-bg-1); | ||
box-shadow: ${e.shadow==="always"?"var(--ar-shadow)":"none"}; | ||
&:hover { | ||
box-shadow: ${e.shadow==="never"?"none":"var(--box-shadow)"}; | ||
box-shadow: ${e.shadow==="never"?"none":"var(--ar-shadow)"}; | ||
} | ||
} | ||
`,t=()=>[C(T,{get when(){return e.icon},get fallback(){return(()=>{const r=kt();return p(()=>z(r,"src",e.logo)),r})()},get children(){const r=wt();return r._$owner=h(),p(()=>r.name=e.logo),r}}),(()=>{const r=xt(),i=r.firstChild,l=i.nextSibling;return f(i,()=>e.title),f(l,()=>e.description),r})()],o=()=>[(()=>{const r=Ct();return p(()=>z(r,"src",e.avatar||"/apple-touch-icon.png")),r})(),(()=>{const r=Et();return f(r,()=>e.creator||"A-M"),r})()];return[(()=>{const r=St(),i=r.firstChild;return f(r,n,i),r})(),(()=>{const r=Tt(),i=r.firstChild;return f(r,C(T,{get when(){return e.header},get children(){const l=zt();return l._$owner=h(),l}}),i),i._$owner=h(),f(i,t),f(r,C(T,{get when(){return e.footer},get children(){const l=At();return l._$owner=h(),f(l,o),l}}),null),r})()]},ke=()=>{m(`${v}-card`,{header:!1,footer:!0,icon:!1,logo:"ai-chat",title:"",description:"",avatar:"",creator:"",shadow:"never"},Ot)},Pt=c(`<style>/* layer: preflights */ | ||
`,t=()=>[A(B,{get when(){return e.icon},get fallback(){return(()=>{const r=Ot();return v(()=>L(r,"src",e.logo)),r})()},get children(){const r=Pt();return r._$owner=b(),v(()=>r.name=e.logo),r}}),(()=>{const r=Lt(),i=r.firstChild,l=i.nextSibling;return f(i,()=>e.title),f(l,()=>e.description),r})()],o=()=>[(()=>{const r=Bt();return v(()=>L(r,"src",e.avatar||"/apple-touch-icon.png")),r})(),(()=>{const r=jt();return f(r,()=>e.creator||"A-M"),r})()];return[(()=>{const r=Rt(),i=r.firstChild;return f(r,n,i),r})(),(()=>{const r=Nt(),i=r.firstChild;return f(r,A(B,{get when(){return e.header},get children(){const l=Ft();return l._$owner=b(),l}}),i),i._$owner=b(),f(i,t),f(r,A(B,{get when(){return e.footer},get children(){const l=It();return l._$owner=b(),f(l,o),l}}),null),r})()]},Ae=()=>{y(`${w}-card`,{header:!1,footer:!0,icon:!1,logo:"ai-chat",title:"",description:"",avatar:"",creator:"",shadow:"never"},Mt)},Dt=c(`<style>/* layer: preflights */ | ||
*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;} | ||
@@ -46,3 +46,3 @@ /* layer: default */ | ||
.rd-3{border-radius:0.75rem;} | ||
.p-x-3{padding-left:0.75rem;padding-right:0.75rem;};`),jt=c('<ar-icon size="2.75rem">',!0,!1),Bt=c('<div class="chat-avatar flex items-center">'),It=c('<div class="flex items-center gap-3"><p></p><ar-icon name="loading" spin>',!0,!1),Rt=c('<div><div class="chat-content p-x-3 rd-3">'),Lt=c('<img class="w-11 rd-2 self-start" alt="avatar">'),Nt=c("<ar-rich-text>",!0,!1),Ft=(e,{element:n})=>{const t=E` | ||
.p-x-3{padding-left:0.75rem;padding-right:0.75rem;};`),Ht=c('<ar-icon size="2.75rem">',!0,!1),Kt=c('<div class="chat-avatar flex items-center">'),Gt=c('<div class="flex items-center gap-3"><p></p><ar-icon name="loading" spin>',!0,!1),Vt=c('<div><div class="chat-content p-x-3 rd-3">'),Ut=c('<img class="w-11 rd-2 self-start" alt="avatar">'),Xt=c("<ar-rich-text>",!0,!1),Yt=(e,{element:n})=>{const t=P` | ||
:host { | ||
@@ -68,3 +68,3 @@ display: block; | ||
.chat-bubble.right .chat-content { | ||
background-image: var(--accent-gradient); | ||
background: var(--ar-color-primary-gradient); | ||
color: #fff; | ||
@@ -81,3 +81,3 @@ border-top-right-radius: 0; | ||
border-top-left-radius: 0; | ||
background-color: var(--bg-2); | ||
background-color: var(--ar-color-bg-2); | ||
align-self: ${e.direction==="row"?"center":"flex-start"}; | ||
@@ -89,3 +89,3 @@ } | ||
} | ||
`,o=r=>{const i=new CustomEvent("browser",{detail:{value:r.detail.value},bubbles:!0});n.dispatchEvent(i)};return[(()=>{const r=Pt(),i=r.firstChild;return f(r,t,i),r})(),(()=>{const r=Rt(),i=r.firstChild;return f(r,C(T,{get when(){return e.showAvatar},get children(){const l=Bt();return f(l,C(T,{get when(){return e.avatarType==="icon"},get fallback(){return(()=>{const s=Lt();return p(()=>z(s,"src",e.avatar)),s})()},get children(){const s=jt();return s._$owner=h(),p(()=>s.name=e.role==="user"?e.avatar||"avatar-01":e.avatar||"ai-chat"),s}})),l}}),i),f(i,C(T,{get when(){return e.loading},get fallback(){return(()=>{const l=Nt();return l.addEventListener("browser",o),l._$owner=h(),p(()=>l.text=e.content),l})()},get children(){const l=It(),s=l.firstChild,d=s.nextSibling;return f(s,()=>e.loadingText),d._$owner=h(),l}})),p(()=>K(r,`chat-bubble ${e.role==="user"?"right":"left"} m-3`)),r})()]},Ce=()=>{m(`${v}-chat-bubble`,{role:"",content:"",loading:!1,loadingText:"",showAvatar:!0,avatar:"",avatarType:"icon",direction:"row"},Ft)},Ht=c("<style>"),Kt=c('<label class="container"><input type="checkbox"><div class="checkmark"></div><slot>'),Dt=(e,{element:n})=>{const t=E` | ||
`,o=r=>{const i=new CustomEvent("browser",{detail:{value:r.detail.value},bubbles:!0});n.dispatchEvent(i)};return[(()=>{const r=Dt(),i=r.firstChild;return f(r,t,i),r})(),(()=>{const r=Vt(),i=r.firstChild;return f(r,A(B,{get when(){return e.showAvatar},get children(){const l=Kt();return f(l,A(B,{get when(){return e.avatarType==="icon"},get fallback(){return(()=>{const s=Ut();return v(()=>L(s,"src",e.avatar)),s})()},get children(){const s=Ht();return s._$owner=b(),v(()=>s.name=e.role==="user"?e.avatar||"avatar-01":e.avatar||"ai-chat"),s}})),l}}),i),f(i,A(B,{get when(){return e.loading},get fallback(){return(()=>{const l=Xt();return l.addEventListener("browser",o),l._$owner=b(),v(()=>l.text=e.content),l})()},get children(){const l=Gt(),s=l.firstChild,d=s.nextSibling;return f(s,()=>e.loadingText),d._$owner=b(),l}})),v(()=>N(r,`chat-bubble ${e.role==="user"?"right":"left"} m-3`)),r})()]},Te=()=>{y(`${w}-chat-bubble`,{role:"",content:"",loading:!1,loadingText:"",showAvatar:!0,avatar:"",avatarType:"icon",direction:"row"},Yt)},Wt=c("<style>"),qt=c('<label class="container"><input type="checkbox"><div class="checkmark"></div><slot>'),Jt=(e,{element:n})=>{const t=P` | ||
:host { | ||
@@ -117,7 +117,8 @@ display: inline-block; | ||
left: 0; | ||
height: var(--checkbox-size); | ||
width: var(--checkbox-size); | ||
background-color: var(--bg-2); | ||
height: var(--ar-size-18); | ||
width: var(--ar-size-18); | ||
background-color: var(--ar-color-info-2); | ||
transition: all 0.3s; | ||
border-radius: 5px; | ||
box-sizing: border-box; | ||
} | ||
@@ -127,3 +128,3 @@ | ||
.container input:checked ~ .checkmark { | ||
background-color: var(--primary-color); | ||
background: var(--ar-color-primary-gradient); | ||
animation: pop 0.5s; | ||
@@ -169,3 +170,3 @@ animation-direction: alternate; | ||
} | ||
`,[o,r]=S(e.value),i=()=>{r(!o());const l=new CustomEvent("change",{detail:{value:o()},bubbles:!0});n.dispatchEvent(l)};return[(()=>{const l=Ht();return f(l,t),l})(),(()=>{const l=Kt(),s=l.firstChild,d=s.nextSibling,u=d.nextSibling;return s.addEventListener("change",i),u._$owner=h(),p(()=>s.checked=o()),l})()]},Ee=()=>{m(`${v}-checkbox`,{value:!1},Dt)},Mt=c("<style>"),Gt=c('<div class="box"><div class="nums-chip"><div class="number">0</div><div class="number">1</div><div class="number">2</div><div class="number">3</div><div class="number">4</div><div class="number">5</div><div class="number">6</div><div class="number">7</div><div class="number">8</div><div class="number">9'),Ut=(e,{element:n})=>{const t=E` | ||
`,[o,r]=S(e.value),i=()=>{r(!o());const l=new CustomEvent("change",{detail:{value:o()},bubbles:!0});n.dispatchEvent(l)};return[(()=>{const l=Wt();return f(l,t),l})(),(()=>{const l=qt(),s=l.firstChild,d=s.nextSibling,u=d.nextSibling;return s.addEventListener("change",i),u._$owner=b(),v(()=>s.checked=o()),l})()]},Pe=()=>{y(`${w}-checkbox`,{value:!1},Jt)},Qt=c("<style>"),Zt=c('<div class="box"><div class="nums-chip"><div class="number">0</div><div class="number">1</div><div class="number">2</div><div class="number">3</div><div class="number">4</div><div class="number">5</div><div class="number">6</div><div class="number">7</div><div class="number">8</div><div class="number">9'),en=(e,{element:n})=>{const t=P` | ||
:host { | ||
@@ -189,6 +190,6 @@ display: inline-block; | ||
} | ||
`;return U(()=>{setTimeout(()=>{const o=n.shadowRoot.querySelector(".nums-chip");o.style.transform=`translate(0, -${e.number*10}%)`},10)}),[(()=>{const o=Mt();return f(o,t),o})(),Gt()]},se=()=>{m(`${v}-dance-number`,{number:0,size:12},Ut)},Vt=c("<style>"),qt=c("<span>,"),Xt=c("<div><ar-dance-number>",!0,!1);se();const Yt=e=>{const n=E` | ||
`;return H(()=>{setTimeout(()=>{const o=n.shadowRoot.querySelector(".nums-chip");o.style.transform=`translate(0, -${e.number*10}%)`},10)}),[(()=>{const o=Qt();return f(o,t),o})(),Zt()]},ue=()=>{y(`${w}-dance-number`,{number:0,size:12},en)},tn=c("<style>"),nn=c("<span>,"),rn=c("<div><ar-dance-number>",!0,!1);ue();const on=e=>{const n=P` | ||
:host { | ||
display: inline-flex; | ||
--dance-count-bg: var(--primary-color); | ||
--dance-count-bg: var(--ar-color-primary); | ||
--dance-count-height: 82px; | ||
@@ -207,5 +208,5 @@ --dance-count-width: 65px; | ||
font-size: ${e.size}px; | ||
color: var(--accent-color); | ||
color: var(--ar-color-white); | ||
} | ||
`,t=`${e.count}`.split("").map(o=>o===","?",":parseInt(o));return[(()=>{const o=Vt();return f(o,n),o})(),C(H,{each:t,children:o=>o===","?qt():(()=>{const r=Xt(),i=r.firstChild;return i.number=o,i._$owner=h(),p(l=>{const s=e.type==="card"?"card":"",d=e.size;return s!==l._v$&&K(r,l._v$=s),d!==l._v$2&&(i.size=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),r})()})]},Se=()=>{m(`${v}-dance-count`,{count:0,size:12,type:"default"},Yt)},Jt=c("<style>"),Wt=c("<slot>"),Qt=e=>{const n=E` | ||
`,t=`${e.count}`.split("").map(o=>o===","?",":parseInt(o));return[(()=>{const o=tn();return f(o,n),o})(),A(G,{each:t,children:o=>o===","?nn():(()=>{const r=rn(),i=r.firstChild;return i.number=o,i._$owner=b(),v(l=>{const s=e.type==="card"?"card":"",d=e.size;return s!==l._v$&&N(r,l._v$=s),d!==l._v$2&&(i.size=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),r})()})]},Le=()=>{y(`${w}-dance-count`,{count:0,size:12,type:"default"},on)},ln=c("<style>"),sn=c("<slot>"),an=e=>{const n=P` | ||
:host { | ||
@@ -220,3 +221,3 @@ display: flex; | ||
} | ||
`;return[(()=>{const t=Jt();return f(t,n),t})(),(()=>{const t=Wt();return t._$owner=h(),t})()]},ze=()=>{m(`${v}-flex-box`,{gap:"1rem",direction:"row",wrap:"wrap",items:"stretch",justify:"flex-start"},Qt)},Zt=c("<style>"),en=c("<slot>"),tn=e=>{const n=E` | ||
`;return[(()=>{const t=ln();return f(t,n),t})(),(()=>{const t=sn();return t._$owner=b(),t})()]},Oe=()=>{y(`${w}-flex-box`,{gap:"1rem",direction:"row",wrap:"wrap",items:"stretch",justify:"flex-start"},an)},cn=c("<style>"),un=c("<slot>"),dn=e=>{const n=P` | ||
:host { | ||
@@ -227,5 +228,14 @@ order: ${e.order}; | ||
} | ||
`;return[(()=>{const t=Zt();return f(t,n),t})(),(()=>{const t=en();return t._$owner=h(),t})()]},Ae=()=>{m(`${v}-flex-item`,{order:0,flex:"0 1 auto",self:"auto"},tn)},nn=`:host{display:inline-flex;font-size:inherit;transition:.3s}:host([spin]){animation:rotate 1.4s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}} | ||
`,rn=c("<style>"),on=c('<svg aria-hidden="true"><use>');let ae="";const ln=e=>{ae=e},sn=e=>{const n=`icon icon-${e.name}`;return ae||console.warn("You need use registerIcon first"),[(()=>{const t=rn();return f(t,nn),t})(),(()=>{const t=on(),o=t.firstChild;return z(t,"class",n),p(r=>{const i=e.size,l=e.size,s=e.color,d=`${ae}#icon-${e.name}`;return i!==r._v$&&z(t,"width",r._v$=i),l!==r._v$2&&z(t,"height",r._v$2=l),s!==r._v$3&&z(t,"fill",r._v$3=s),d!==r._v$4&&z(o,"href",r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]},Te=()=>{m(`${v}-icon`,{name:"date",size:"1em",color:"currentColor"},sn)},an=`:host{--border-radius: 9px;display:inline-block}.card{border-radius:var(--border-radius);cursor:pointer;height:100%;overflow:hidden;position:relative;width:100%}.card-image{border-radius:var(--border-radius);height:100%;object-fit:cover;position:absolute;right:0;top:0;transition:all .4s ease-in-out;width:100%}.card-info{background-color:#0000007f;border-radius:var(--border-radius);bottom:0;box-sizing:border-box;color:#fff;left:0;position:absolute;transform:translateY(calc(100% - 50px));transition:all .4s ease-in-out;width:100%}.card:hover .card-image{transform:scale(1.1)}.card:hover .card-info{transform:translateY(0)}.card-title{align-items:center;display:flex;height:50px;padding:0 15px}.card-description{font-size:12px;padding:0 15px 15px} | ||
`,cn=c("<style>"),un=c('<div class="card"><div class="card-info"><div class="card-title"></div><div class="card-description">'),dn=c('<img class="card-image">'),fn=e=>[(()=>{const n=cn();return f(n,an),n})(),(()=>{const n=un(),t=n.firstChild,o=t.firstChild,r=o.nextSibling;return f(n,(()=>{const i=F(()=>!!e.imageUrl);return()=>i()&&(()=>{const l=dn();return p(()=>z(l,"src",e.imageUrl)),l})()})(),t),f(o,()=>e.title),f(r,()=>e.description),n})()],Oe=()=>{m(`${v}-image-card`,{title:"",description:"",imageUrl:""},fn)},hn=c("<style>"),gn=c('<div class="grid-layout"><slot>'),bn=e=>{const n=E` | ||
`;return[(()=>{const t=cn();return f(t,n),t})(),(()=>{const t=un();return t._$owner=b(),t})()]},Be=()=>{y(`${w}-flex-item`,{order:0,flex:"0 1 auto",self:"auto"},dn)},fn=c('<div><ar-float-wrapper><ar-button shape="circle" style="height:auto">',!0,!1),hn=e=>A(xe,{get mount(){return document.body},get children(){const n=fn(),t=n.firstChild,o=t.firstChild;return n.style.setProperty("position","fixed"),n.style.setProperty("left","0"),n.style.setProperty("top","0"),t._$owner=b(),o._$owner=b(),f(o,()=>e.text),v(r=>{const i=e.left,l=e.top,s=e.right,d=e.bottom;return i!==r._v$&&(t.left=r._v$=i),l!==r._v$2&&(t.top=r._v$2=l),s!==r._v$3&&(t.right=r._v$3=s),d!==r._v$4&&(t.bottom=r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n}}),je=()=>{y(`${w}-float-button`,{left:"",top:"",right:"",bottom:"",icon:"",text:"Button"},hn)},oe={root:"_root_128u1_1","chat-card":"_chat-card_128u1_10",open:"_open_128u1_25","chat-logo":"_chat-logo_128u1_30"},gn=c("<style>"),bn=c('<div><ar-float-wrapper><ar-flex-box gap="1rem" direction="column" wrap="nowrap" items="flex-end"><div><iframe width="100%" height="100%" style="border:none"></iframe></div><ar-button shape="circle" style="height:auto"><ar-icon size="2rem" name="ai-chat">',!0,!1),$n=e=>{const[n,t]=S(!1),o=()=>{t(!n())};return[(()=>{const r=gn();return f(r,oe),r})(),A(xe,{get mount(){return document.body},get children(){const r=bn(),i=r.firstChild,l=i.firstChild,s=l.firstChild,d=s.firstChild,u=s.nextSibling,a=u.firstChild;return r.style.setProperty("position","fixed"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),i._$owner=b(),l._$owner=b(),u.$$click=o,u._$owner=b(),a._$owner=b(),v(h=>{const m=e.left,E=e.top,z=e.right,$=e.bottom,_=[oe["chat-card"],n()?oe.open:""].join(" "),g=e.src,x=oe["chat-logo"];return m!==h._v$&&(i.left=h._v$=m),E!==h._v$2&&(i.top=h._v$2=E),z!==h._v$3&&(i.right=h._v$3=z),$!==h._v$4&&(i.bottom=h._v$4=$),_!==h._v$5&&N(s,h._v$5=_),g!==h._v$6&&L(d,"src",h._v$6=g),x!==h._v$7&&N(u,h._v$7=x),h},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),r}})]},Re=()=>{y(`${w}-float-chat-frame`,{left:"",top:"",right:"",bottom:"",src:""},$n)};D(["click"]);const pn=c("<style>"),mn=c('<div class="root"><slot>'),vn=(e,{element:n})=>{const[t,o]=S(0),[r,i]=S(0),[l,s]=S(!1),[d,u]=S(),a=P` | ||
.root { | ||
position: fixed; | ||
user-select: none; | ||
height: auto; | ||
border-radius: 50%; | ||
filter: drop-shadow(rgba(0, 0, 0, 0.06) 0px 1px 6px) | ||
drop-shadow(rgba(0, 0, 0, 0.16) 0px 2px 32px); | ||
} | ||
`;let h=0,m=0,E=!1;H(()=>{var x;const g=(x=d())==null?void 0:x.getBoundingClientRect();console.log(g),o((g==null?void 0:g.x)||0),i((g==null?void 0:g.y)||0),n.shadowRoot.addEventListener("mousedown",z),n.shadowRoot.addEventListener("mousemove",$)});const z=g=>{if(g instanceof MouseEvent)E=!0,h=g.clientX-t(),m=g.clientY-r(),console.log(h);else if(g instanceof TouchEvent){const x=g.touches[0];E=!0,h=x.clientX-t(),m=x.clientY-r()}window.addEventListener("mouseup",_),window.addEventListener("touchstart",z),window.addEventListener("touchmove",$),window.addEventListener("touchend",_)},$=g=>{if(E){if(g instanceof MouseEvent)console.log(g.clientX-h),o(g.clientX-h),i(g.clientY-m);else if(g instanceof TouchEvent){const x=g.touches[0];o(x.clientX-h),i(x.clientY-m)}s(!0)}},_=()=>{E=!1,window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",z),window.removeEventListener("touchmove",$),window.removeEventListener("touchend",_)};return Z(()=>{n.shadowRoot.removeEventListener("mousedown",z),n.shadowRoot.removeEventListener("mousemove",$),window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",z),window.removeEventListener("touchmove",$),window.removeEventListener("touchend",_)}),[(()=>{const g=pn();return f(g,a),g})(),(()=>{const g=mn(),x=g.firstChild;return g.$$touchend=_,g.$$touchmove=$,g.$$touchstart=z,g.$$mouseup=_,g.$$mousemove=$,g.$$mousedown=z,ye(u,g),x._$owner=b(),v(O=>at(g,l()?{transform:`translate(${t()}px, ${r()}px)`}:{left:e.left?`${e.left}`:"auto",top:e.top?`${e.top}`:"auto",right:e.right?`${e.right}`:"auto",bottom:e.bottom?`${e.bottom}`:"auto"},O)),g})()]},Fe=()=>{y(`${w}-float-wrapper`,{left:null,top:null,right:null,bottom:null},vn)};D(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"]);const _n=`:host{display:inline-flex;font-size:inherit;transition:.3s}:host([spin]){animation:rotate 1.4s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}} | ||
`,yn=c("<style>"),wn=c('<svg aria-hidden="true"><use>');let de="";const xn=e=>{de=e},kn=e=>{const n=`icon icon-${e.name}`;return de||console.warn("You need use registerIcon first"),[(()=>{const t=yn();return f(t,_n),t})(),(()=>{const t=wn(),o=t.firstChild;return L(t,"class",n),v(r=>{const i=e.size,l=e.size,s=e.color,d=`${de}#icon-${e.name}`;return i!==r._v$&&L(t,"width",r._v$=i),l!==r._v$2&&L(t,"height",r._v$2=l),s!==r._v$3&&L(t,"fill",r._v$3=s),d!==r._v$4&&L(o,"href",r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]},Ie=()=>{y(`${w}-icon`,{name:"date",size:"1em",color:"currentColor"},kn)},Cn=`:host{--ar-size-3: 9px;display:inline-block}.card{border-radius:var(--ar-size-3);cursor:pointer;height:100%;overflow:hidden;position:relative;width:100%}.card-image{border-radius:var(--ar-size-3);height:100%;object-fit:cover;position:absolute;right:0;top:0;transition:all .4s ease-in-out;width:100%}.card-info{background-color:#0000007f;border-radius:var(--ar-size-3);bottom:0;box-sizing:border-box;color:#fff;left:0;position:absolute;transform:translateY(calc(100% - 50px));transition:all .4s ease-in-out;width:100%}.card:hover .card-image{transform:scale(1.1)}.card:hover .card-info{transform:translateY(0)}.card-title{align-items:center;display:flex;height:50px;padding:0 15px}.card-description{font-size:12px;padding:0 15px 15px} | ||
`,En=c("<style>"),zn=c('<div class="card"><div class="card-info"><div class="card-title"></div><div class="card-description">'),Sn=c('<img class="card-image">'),An=e=>[(()=>{const n=En();return f(n,Cn),n})(),(()=>{const n=zn(),t=n.firstChild,o=t.firstChild,r=o.nextSibling;return f(n,(()=>{const i=M(()=>!!e.imageUrl);return()=>i()&&(()=>{const l=Sn();return v(()=>L(l,"src",e.imageUrl)),l})()})(),t),f(o,()=>e.title),f(r,()=>e.description),n})()],Ne=()=>{y(`${w}-image-card`,{title:"",description:"",imageUrl:""},An)},Tn=c("<style>"),Pn=c('<div class="grid-layout"><slot>'),Ln=e=>{const n=P` | ||
.grid-layout { | ||
@@ -262,4 +272,4 @@ --cols: ${e.cols}; | ||
} | ||
`;return[(()=>{const t=hn();return f(t,n),t})(),(()=>{const t=gn(),o=t.firstChild;return o._$owner=h(),t})()]},Pe=()=>{m(`${v}-layout-grid`,{gap:"1rem",cols:"auto-fit",xs:void 0,sm:void 0,md:void 0,lg:void 0,xl:void 0,min:"0"},bn)},pn=`:host{display:grid;grid-template:auto 1fr auto / auto 1fr auto;height:100%}::slotted([slot="header"]){grid-column:1 / 4}::slotted([slot="left-sider"]){grid-column:1 / 2;overflow:auto}::slotted([slot="content"]){grid-column:2 / 3;overflow:auto}::slotted([slot="right-sider"]){grid-column:3 / 4;overflow:auto}::slotted([slot="footer"]){grid-column:1 / 4} | ||
`,$n=c("<style>"),mn=c('<slot name="header">'),vn=c('<slot name="left-sider">'),yn=c('<slot name="content">'),_n=c('<slot name="right-sider">'),wn=c('<slot name="footer">'),xn=()=>[(()=>{const e=$n();return f(e,pn),e})(),(()=>{const e=mn();return e._$owner=h(),e})(),(()=>{const e=vn();return e._$owner=h(),e})(),(()=>{const e=yn();return e._$owner=h(),e})(),(()=>{const e=_n();return e._$owner=h(),e})(),(()=>{const e=wn();return e._$owner=h(),e})()],je=()=>{m(`${v}-layout-holy`,xn)},kn=c("<style>"),Cn=c('<div class="root"><slot>'),En=e=>{const n=E` | ||
`;return[(()=>{const t=Tn();return f(t,n),t})(),(()=>{const t=Pn(),o=t.firstChild;return o._$owner=b(),t})()]},Me=()=>{y(`${w}-layout-grid`,{gap:"1rem",cols:"auto-fit",xs:void 0,sm:void 0,md:void 0,lg:void 0,xl:void 0,min:"0"},Ln)},On=`:host{display:grid;grid-template:auto 1fr auto / auto 1fr auto;height:100%}::slotted([slot="header"]){grid-column:1 / 4}::slotted([slot="left-sider"]){grid-column:1 / 2;overflow:auto}::slotted([slot="content"]){grid-column:2 / 3;overflow:auto}::slotted([slot="right-sider"]){grid-column:3 / 4;overflow:auto}::slotted([slot="footer"]){grid-column:1 / 4} | ||
`,Bn=c("<style>"),jn=c('<slot name="header">'),Rn=c('<slot name="left-sider">'),Fn=c('<slot name="content">'),In=c('<slot name="right-sider">'),Nn=c('<slot name="footer">'),Mn=()=>[(()=>{const e=Bn();return f(e,On),e})(),(()=>{const e=jn();return e._$owner=b(),e})(),(()=>{const e=Rn();return e._$owner=b(),e})(),(()=>{const e=Fn();return e._$owner=b(),e})(),(()=>{const e=In();return e._$owner=b(),e})(),(()=>{const e=Nn();return e._$owner=b(),e})()],De=()=>{y(`${w}-layout-holy`,Mn)},Dn=c("<style>"),Hn=c('<div class="root"><slot>'),Kn=e=>{const n=P` | ||
.root { | ||
@@ -274,6 +284,6 @@ column-width: ${e.width}; | ||
} | ||
`;return[(()=>{const t=kn();return f(t,n),t})(),(()=>{const t=Cn(),o=t.firstChild;return o._$owner=h(),t})()]},Be=()=>{m(`${v}-layout-masonry`,{width:"20rem",count:"auto",gap:"10px"},En)},Sn=c("<style>"),zn=c('<div class="place-holder"><slot>'),An=()=>{const e=E` | ||
`;return[(()=>{const t=Dn();return f(t,n),t})(),(()=>{const t=Hn(),o=t.firstChild;return o._$owner=b(),t})()]},He=()=>{y(`${w}-layout-masonry`,{width:"20rem",count:"auto",gap:"10px"},Kn)},Gn=c("<style>"),Vn=c('<div class="place-holder"><slot>'),Un=()=>{const e=P` | ||
:host { | ||
display: block; | ||
background: var(--gray-3); | ||
background: var(--ar-color-info-3); | ||
} | ||
@@ -288,3 +298,3 @@ .place-holder { | ||
} | ||
`;return[(()=>{const n=Sn();return f(n,e),n})(),(()=>{const n=zn(),t=n.firstChild;return t._$owner=h(),n})()]},Ie=()=>{m(`${v}-place-holder`,An)},Tn=c("<style>"),On=c('<div class="root"><slot name="reference"></slot><div><slot>'),Pn=(e,{element:n})=>{const t=E` | ||
`;return[(()=>{const n=Gn();return f(n,e),n})(),(()=>{const n=Vn(),t=n.firstChild;return t._$owner=b(),n})()]},Ke=()=>{y(`${w}-place-holder`,Un)},Xn=c("<style>"),Yn=c('<div class="root"><slot name="reference"></slot><div><slot>'),Wn=(e,{element:n})=>{const t=P` | ||
:host { | ||
@@ -308,3 +318,3 @@ display: flex; | ||
transition: all 0.3s ease; | ||
background-color: var(--bg-2); | ||
background-color: var(--ar-color-bg-2); | ||
} | ||
@@ -316,3 +326,3 @@ .popover.show { | ||
} | ||
`,[o,r]=S(!1);return U(()=>{e.trigger==="hover"?(n.shadowRoot.addEventListener("mouseover",()=>{r(!0)}),n.shadowRoot.addEventListener("mouseout",()=>{r(!1)})):e.trigger==="click"&&n.shadowRoot.addEventListener("click",i=>{i.target.matches("[slot=reference]")&&r(!o())})}),[(()=>{const i=Tn();return f(i,t),i})(),(()=>{const i=On(),l=i.firstChild,s=l.nextSibling,d=s.firstChild;return l._$owner=h(),d._$owner=h(),p(()=>K(s,`popover ${o()?"show":""}`)),i})()]},Re=()=>{m(`${v}-popover`,{trigger:"click",placement:"bottom"},Pn)},jn=c("<style>"),Bn=c('<iframe id="iframe">'),In=({content:e,src:n},{element:t})=>{const o=E` | ||
`,[o,r]=S(!1);return H(()=>{e.trigger==="hover"?(n.shadowRoot.addEventListener("mouseover",()=>{r(!0)}),n.shadowRoot.addEventListener("mouseout",()=>{r(!1)})):e.trigger==="click"&&n.shadowRoot.addEventListener("click",i=>{i.target.matches("[slot=reference]")&&r(!o())})}),[(()=>{const i=Xn();return f(i,t),i})(),(()=>{const i=Yn(),l=i.firstChild,s=l.nextSibling,d=s.firstChild;return l._$owner=b(),d._$owner=b(),v(()=>N(s,`popover ${o()?"show":""}`)),i})()]},Ge=()=>{y(`${w}-popover`,{trigger:"click",placement:"bottom"},Wn)},qn=c("<style>"),Jn=c('<iframe id="iframe">'),Qn=({content:e,src:n},{element:t})=>{const o=P` | ||
:host { | ||
@@ -329,6 +339,6 @@ display: block; | ||
} | ||
`;return U(()=>{const r=t.shadowRoot.getElementById("iframe");e&&(r.contentDocument.write(e),t.removeAttribute("content"))}),[(()=>{const r=jn();return f(r,o),r})(),(()=>{const r=Bn();return z(r,"src",n),r})()]},Le=()=>{m(`${v}-portal`,{src:"",content:""},In)},Rn=c("<style>"),Ln=c('<div class="root">'),Nn=c('<div class="label"><input type="radio" name="radio"><span>'),Fn=(e,{element:n})=>{const t=E` | ||
`;return H(()=>{const r=t.shadowRoot.getElementById("iframe");e&&(r.contentDocument.write(e),t.removeAttribute("content"))}),[(()=>{const r=qn();return f(r,o),r})(),(()=>{const r=Jn();return L(r,"src",n),r})()]},Ve=()=>{y(`${w}-portal`,{src:"",content:""},Qn)},Zn=c("<style>"),er=c('<div class="root">'),tr=c('<div class="label"><input type="radio" name="radio"><span>'),nr=(e,{element:n})=>{const t=P` | ||
:host { | ||
display: inline-block; | ||
font-size: var(--font-size); | ||
font-size: var(--ar-size-font); | ||
} | ||
@@ -358,5 +368,6 @@ | ||
.root input[type='radio']:checked + span { | ||
background-color: var(--primary-color); | ||
box-shadow: 0 0 0 1px var(--ar-color-primary); | ||
background: var(--ar-color-primary-gradient); | ||
z-index: 1; | ||
color: var(--accent-color); | ||
color: var(--ar-color-white); | ||
} | ||
@@ -366,10 +377,10 @@ | ||
display: flex; | ||
height: var(--input-height); | ||
height: var(--ar-size-m); | ||
align-items: center; | ||
cursor: pointer; | ||
background-color: var(--bg-1); | ||
background-color: var(--ar-color-bg-1); | ||
padding: 0 0.75em; | ||
position: relative; | ||
box-shadow: 0 0 0 0.0625em var(--primary-color); | ||
color: var(--text-color); | ||
box-shadow: 0 0 0 1px var(--ar-color-border); | ||
color: var(--ar-color-text); | ||
text-align: center; | ||
@@ -380,9 +391,9 @@ transition: background-color 0.5s ease; | ||
.label:first-child span { | ||
border-radius: var(--border-radius) 0 0 var(--border-radius); | ||
border-radius: var(--ar-size-3) 0 0 var(--ar-size-3); | ||
} | ||
.label:last-child span { | ||
border-radius: 0 var(--border-radius) var(--border-radius) 0; | ||
border-radius: 0 var(--ar-size-3) var(--ar-size-3) 0; | ||
} | ||
`,[o,r]=S(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});n.dispatchEvent(s)};return[(()=>{const l=Rn();return f(l,t),l})(),(()=>{const l=Ln();return f(l,C(H,{get each(){return e.options},children:s=>(()=>{const d=Nn(),u=d.firstChild,a=u.nextSibling;return d.$$click=()=>i(s.value),f(a,()=>s.label),p(()=>u.value=s.value),p(()=>u.checked=o()===s.value),d})()})),l})()]},Ne=()=>{m(`${v}-radio-button`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},Fn)};X(["click"]);const Hn=c("<style>"),Kn=c('<div class="root">'),Dn=c('<div class="radio-button"><input name="radio-group" class="radio-button__input" type="radio"><div class="radio-button__label"><span class="radio-button__custom">'),Mn=(e,{element:n})=>{const t=E` | ||
`,[o,r]=S(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});n.dispatchEvent(s)};return[(()=>{const l=Zn();return f(l,t),l})(),(()=>{const l=er();return f(l,A(G,{get each(){return e.options},children:s=>(()=>{const d=tr(),u=d.firstChild,a=u.nextSibling;return d.$$click=()=>i(s.value),f(a,()=>s.label),v(()=>u.value=s.value),v(()=>u.checked=o()===s.value),d})()})),l})()]},Ue=()=>{y(`${w}-radio-button`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},nr)};D(["click"]);const rr=c("<style>"),or=c('<div class="root">'),ir=c('<div class="radio-button"><input name="radio-group" class="radio-button__input" type="radio"><div class="radio-button__label"><span class="radio-button__custom">'),lr=(e,{element:n})=>{const t=P` | ||
:host { | ||
@@ -397,4 +408,4 @@ display: inline-block; | ||
gap: 16px; | ||
font-size: var(--font-size); | ||
color: var(--text-color); | ||
font-size: var(--ar-size-font); | ||
color: var(--ar-color-text); | ||
} | ||
@@ -419,3 +430,3 @@ | ||
align-items: center; | ||
gap: var(--gap); | ||
gap: var(--ar-size-6); | ||
position: relative; | ||
@@ -427,11 +438,13 @@ cursor: pointer; | ||
.radio-button__custom { | ||
width: var(--radio-size); | ||
height: var(--radio-size); | ||
width: var(--ar-size-18); | ||
height: var(--ar-size-18); | ||
border-radius: 50%; | ||
border: 2px solid var(--bg-2); | ||
border: 2px solid var(--ar-color-border); | ||
background: var(--ar-color-info-2); | ||
transition: all 0.3s ease; | ||
box-sizing: border-box; | ||
} | ||
.radio-button__input:checked + .radio-button__label .radio-button__custom { | ||
background-color: var(--primary-color); | ||
background: var(--ar-color-primary-gradient); | ||
border-color: transparent; | ||
@@ -442,3 +455,3 @@ transform: scale(0.9); | ||
.radio-button__input:checked + .radio-button__label { | ||
color: var(--primary-color); | ||
color: var(--ar-color-primary); | ||
} | ||
@@ -448,13 +461,13 @@ | ||
transform: scale(1); | ||
border-color: var(--primary-color); | ||
border-color: var(--ar-color-primary); | ||
} | ||
`,[o,r]=S(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});n.dispatchEvent(s)};return[(()=>{const l=Hn();return f(l,t),l})(),(()=>{const l=Kn();return f(l,C(H,{get each(){return e.options},children:s=>(()=>{const d=Dn(),u=d.firstChild,a=u.nextSibling;return a.firstChild,d.$$click=()=>i(s.value),f(a,()=>s.label,null),p(()=>u.value=s.value),p(()=>u.checked=o()===s.value),d})()})),l})()]},Fe=()=>{m(`${v}-radio-group`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},Mn)};X(["click"]);const Gn=c("<style>"),Un=c('<div><div><select></select></div><div class="arrow"></div><ul>'),Vn=c("<ar-textfield>",!0,!1),qn=c('<div class="label-chip"><span>'),Xn=c("<option>"),Yn=c("<li>"),Jn=(e,{element:n})=>{const t=E` | ||
`,[o,r]=S(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});n.dispatchEvent(s)};return[(()=>{const l=rr();return f(l,t),l})(),(()=>{const l=or();return f(l,A(G,{get each(){return e.options},children:s=>(()=>{const d=ir(),u=d.firstChild,a=u.nextSibling;return a.firstChild,d.$$click=()=>i(s.value),f(a,()=>s.label,null),v(()=>u.value=s.value),v(()=>u.checked=o()===s.value),d})()})),l})()]},Xe=()=>{y(`${w}-radio-group`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},lr)};D(["click"]);const sr=c("<style>"),ar=c('<div><div><select></select></div><div class="arrow"></div><ul>'),cr=c("<ar-textfield>",!0,!1),ur=c('<div class="label-chip"><span>'),dr=c("<option>"),fr=c("<li>"),hr=(e,{element:n})=>{const t=P` | ||
:host { | ||
align-items: center; | ||
background-color: var(--bg-2); | ||
border-radius: var(--border-radius); | ||
background-color: var(--ar-color-info-2); | ||
border-radius: var(--ar-size-3); | ||
box-sizing: border-box; | ||
display: inline-flex; | ||
gap: var(--gap); | ||
height: var(--input-height); | ||
gap: var(--ar-size-6); | ||
height: var(--ar-size-m); | ||
width: 100%; | ||
@@ -501,3 +514,3 @@ } | ||
.root > ul li { | ||
color: var(--text-color); | ||
color: var(--ar-color-text); | ||
background: #fff; | ||
@@ -511,12 +524,12 @@ padding: 6px 12px; | ||
.root > ul li:first-child { | ||
border-radius: var(--border-radius) var(--border-radius) 0 0; | ||
border-radius: var(--ar-size-3) var(--ar-size-3) 0 0; | ||
} | ||
.root > ul li:last-child { | ||
border-radius: 0 0 var(--border-radius) var(--border-radius); | ||
border-radius: 0 0 var(--ar-size-3) var(--ar-size-3); | ||
} | ||
.root > ul li:hover { | ||
background: var(--primary-color); | ||
color: var(--accent-color); | ||
background: var(--ar-color-primary); | ||
color: var(--ar-color-white); | ||
} | ||
@@ -530,4 +543,4 @@ | ||
} | ||
`,[o,r]=S(!1),[i,l]=S(e.value||""),s=F(()=>{var a;return((a=e.options)==null?void 0:a.filter(g=>g.value===i()))||[]}),d=()=>{r(!o())},u=a=>{l(a.value);const g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});n.dispatchEvent(g)};return[(()=>{const a=Gn();return f(a,t),a})(),(()=>{const a=Un(),g=a.firstChild,$=g.firstChild,A=g.nextSibling,I=A.nextSibling;return a.$$click=d,f(g,C(T,{get when(){return s().length>0},get fallback(){return(()=>{const y=Vn();return y._$owner=h(),y})()},get children(){return C(H,{get each(){return s()},children:y=>(()=>{const w=qn(),R=w.firstChild;return f(R,()=>y.label),w})()})}}),$),f($,C(H,{get each(){return e.options},children:y=>(()=>{const w=Xn();return f(w,()=>y.label),p(()=>w.selected=i()===y.value),w})()})),f(I,C(H,{get each(){return e.options},children:y=>(()=>{const w=Yn();return w.$$click=()=>u(y),f(w,()=>y.label),w})()})),p(y=>{const w=`root ${o()?"open":""}`,R=e.multiple;return w!==y._v$&&K(a,y._v$=w),R!==y._v$2&&($.multiple=y._v$2=R),y},{_v$:void 0,_v$2:void 0}),a})()]},He=()=>{m(`${v}-select`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",placement:"bottom"},Jn)};X(["click"]);const Wn=`:host{align-items:center;background-color:var(--bg-2);border-radius:var(--border-radius);box-sizing:border-box;display:flex;gap:var(--gap);padding:0 10px}.textarea{background:none;border:none;box-sizing:border-box;flex:1;font:inherit;margin:0;outline:none;overflow:auto;padding:6px 0;resize:none;width:100%} | ||
`,Qn=c("<style>"),Zn=c('<slot name="prefix">'),er=c('<textarea class="textarea">'),tr=c('<slot name="suffix">'),nr=(e,{element:n})=>{const[t,o]=S(),[r,i]=S(e.height);U(()=>{setTimeout(()=>{var a;const u=(a=t())==null?void 0:a.scrollHeight;u&&i(`${u}px`)},0)});const l=u=>{const a=u.target;i(e.height),i(`${a.scrollHeight}px`)},s=u=>{const a=u.target,g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});n.dispatchEvent(g)},d=u=>{if((u.metaKey||u.ctrlKey)&&u.key==="Enter"&&(u.preventDefault(),u.target)){const a=u.target,g=new CustomEvent("enter",{detail:{value:a.value}});n.dispatchEvent(g)}};return[(()=>{const u=Qn();return f(u,Wn),u})(),(()=>{const u=Zn();return u._$owner=h(),u})(),(()=>{const u=er();return u.$$keydown=d,u.addEventListener("change",s),u.$$input=l,tt(o,u),p(a=>{const g=r(),$=e.placeholder;return g!==a._v$&&((a._v$=g)!=null?u.style.setProperty("height",g):u.style.removeProperty("height")),$!==a._v$2&&z(u,"placeholder",a._v$2=$),a},{_v$:void 0,_v$2:void 0}),p(()=>u.value=e.value),u})(),(()=>{const u=tr();return u._$owner=h(),u})()]},Ke=()=>{m(`${v}-textarea`,{value:"",placeholder:"",height:"32px"},nr)};X(["input","keydown"]);const rr=`:host{align-items:center;background-color:var(--bg-2);border-radius:var(--border-radius);box-sizing:border-box;display:inline-flex;gap:var(--gap);height:var(--input-height);padding:0 12px;width:100%}input{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;outline:none;padding:0;width:inherit} | ||
`,or=c("<style>"),ir=c('<slot name="prefix">'),lr=c('<input class="textarea">'),sr=c('<slot name="suffix">'),ar=(e,{element:n})=>{const t=r=>{const i=r.target,l=new CustomEvent("change",{detail:{value:i.value},bubbles:!0});n.dispatchEvent(l)},o=r=>{if(r.key==="Enter"&&(r.preventDefault(),r.target)){const i=r.target,l=new CustomEvent("enter",{detail:{value:i.value},bubbles:!0});n.dispatchEvent(l)}};return[(()=>{const r=or();return f(r,rr),r})(),(()=>{const r=ir();return r._$owner=h(),r})(),(()=>{const r=lr();return r.$$keydown=o,r.addEventListener("change",t),p(i=>{const l=e.placeholder,s=e.type;return l!==i._v$&&z(r,"placeholder",i._v$=l),s!==i._v$2&&z(r,"type",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),p(()=>r.value=e.value),r})(),(()=>{const r=sr();return r._$owner=h(),r})()]},De=()=>{m(`${v}-textfield`,{value:"",placeholder:"",type:"text"},ar)};X(["keydown"]);const Me=c("<span>"),cr=e=>{const[n,t]=S(""),[o,r]=S(0),[i,l]=S(!0),{text:s,speed:d=100,cursor:u="|"}=e;return U(()=>{const a=setInterval(()=>{t(s.substr(0,o())),r(o()+1),o()>=s.length&&(l(!1),clearInterval(a))},d)}),[(()=>{const a=Me();return f(a,n),a})(),F((()=>{const a=F(()=>!!i());return()=>a()&&(()=>{const g=Me();return f(g,u),g})()})())]},Ge=()=>{m(`${v}-typewriter`,{text:"",speed:100,cursor:"|"},cr)},ur=Object.freeze(Object.defineProperty({__proto__:null,Button:xe,Card:ke,ChatBubble:Ce,CheckBox:Ee,DanceCount:Se,DanceNumber:se,FlexBox:ze,FlexItem:Ae,Icon:Te,ImageCard:Oe,LayoutGrid:Pe,LayoutHoly:je,LayoutMasonry:Be,PlaceHolder:Ie,Popover:Re,Portal:Le,RadioButton:Ne,RadioGroup:Fe,Select:He,Textarea:Ke,Textfield:De,Typewriter:Ge},Symbol.toStringTag,{value:"Module"})),hr="",gr="",br="",dr=(e=ur)=>{for(const n in e){const t=e[n];t()}};b.Button=xe,b.Card=ke,b.ChatBubble=Ce,b.CheckBox=Ee,b.DanceCount=Se,b.DanceNumber=se,b.FlexBox=ze,b.FlexItem=Ae,b.Icon=Te,b.ImageCard=Oe,b.LayoutGrid=Pe,b.LayoutHoly=je,b.LayoutMasonry=Be,b.PlaceHolder=Ie,b.Popover=Re,b.Portal=Le,b.RadioButton=Ne,b.RadioGroup=Fe,b.Select=He,b.Textarea=Ke,b.Textfield=De,b.Typewriter=Ge,b.defineCustomElements=dr,b.registerIcon=ln,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); | ||
`,[o,r]=S(!1),[i,l]=S(e.value||""),s=M(()=>{var a;return((a=e.options)==null?void 0:a.filter(h=>h.value===i()))||[]}),d=()=>{r(!o())},u=a=>{l(a.value);const h=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});n.dispatchEvent(h)};return[(()=>{const a=sr();return f(a,t),a})(),(()=>{const a=ar(),h=a.firstChild,m=h.firstChild,E=h.nextSibling,z=E.nextSibling;return a.$$click=d,f(h,A(B,{get when(){return s().length>0},get fallback(){return(()=>{const $=cr();return $._$owner=b(),$})()},get children(){return A(G,{get each(){return s()},children:$=>(()=>{const _=ur(),g=_.firstChild;return f(g,()=>$.label),_})()})}}),m),f(m,A(G,{get each(){return e.options},children:$=>(()=>{const _=dr();return f(_,()=>$.label),v(()=>_.selected=i()===$.value),_})()})),f(z,A(G,{get each(){return e.options},children:$=>(()=>{const _=fr();return _.$$click=()=>u($),f(_,()=>$.label),_})()})),v($=>{const _=`root ${o()?"open":""}`,g=e.multiple;return _!==$._v$&&N(a,$._v$=_),g!==$._v$2&&(m.multiple=$._v$2=g),$},{_v$:void 0,_v$2:void 0}),a})()]},Ye=()=>{y(`${w}-select`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",placement:"bottom"},hr)};D(["click"]);const gr=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:flex;gap:var(--ar-size-6);padding:0 10px}.textarea{background:none;border:none;box-sizing:border-box;flex:1;font:inherit;margin:0;outline:none;overflow:auto;padding:6px 0;resize:none;width:100%} | ||
`,br=c("<style>"),$r=c('<slot name="prefix">'),pr=c('<textarea class="textarea">'),mr=c('<slot name="suffix">'),vr=(e,{element:n})=>{const[t,o]=S(),[r,i]=S(e.height);H(()=>{setTimeout(()=>{var a;const u=(a=t())==null?void 0:a.scrollHeight;u&&i(`${u}px`)},0)});const l=u=>{const a=u.target;i(e.height),i(`${a.scrollHeight}px`)},s=u=>{const a=u.target,h=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});n.dispatchEvent(h)},d=u=>{if((u.metaKey||u.ctrlKey)&&u.key==="Enter"&&(u.preventDefault(),u.target)){const a=u.target,h=new CustomEvent("enter",{detail:{value:a.value}});n.dispatchEvent(h)}};return[(()=>{const u=br();return f(u,gr),u})(),(()=>{const u=$r();return u._$owner=b(),u})(),(()=>{const u=pr();return u.$$keydown=d,u.addEventListener("change",s),u.$$input=l,ye(o,u),v(a=>{const h=r(),m=e.placeholder;return h!==a._v$&&((a._v$=h)!=null?u.style.setProperty("height",h):u.style.removeProperty("height")),m!==a._v$2&&L(u,"placeholder",a._v$2=m),a},{_v$:void 0,_v$2:void 0}),v(()=>u.value=e.value),u})(),(()=>{const u=mr();return u._$owner=b(),u})()]},We=()=>{y(`${w}-textarea`,{value:"",placeholder:"",height:"32px"},vr)};D(["input","keydown"]);const _r=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:inline-flex;gap:var(--ar-size-6);height:var(--ar-size-m);padding:0 12px;width:100%}input{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;outline:none;padding:0;width:inherit} | ||
`,yr=c("<style>"),wr=c('<slot name="prefix">'),xr=c('<input class="textarea">'),kr=c('<slot name="suffix">'),Cr=(e,{element:n})=>{const t=r=>{const i=r.target,l=new CustomEvent("change",{detail:{value:i.value},bubbles:!0});n.dispatchEvent(l)},o=r=>{if(r.key==="Enter"&&(r.preventDefault(),r.target)){const i=r.target,l=new CustomEvent("enter",{detail:{value:i.value},bubbles:!0});n.dispatchEvent(l)}};return[(()=>{const r=yr();return f(r,_r),r})(),(()=>{const r=wr();return r._$owner=b(),r})(),(()=>{const r=xr();return r.$$keydown=o,r.addEventListener("change",t),v(i=>{const l=e.placeholder,s=e.type;return l!==i._v$&&L(r,"placeholder",i._v$=l),s!==i._v$2&&L(r,"type",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),v(()=>r.value=e.value),r})(),(()=>{const r=kr();return r._$owner=b(),r})()]},qe=()=>{y(`${w}-textfield`,{value:"",placeholder:"",type:"text"},Cr)};D(["keydown"]);const Je=c("<span>"),Er=e=>{const[n,t]=S(""),[o,r]=S(0),[i,l]=S(!0),{text:s,speed:d=100,cursor:u="|"}=e;return H(()=>{const a=setInterval(()=>{t(s.substr(0,o())),r(o()+1),o()>=s.length&&(l(!1),clearInterval(a))},d)}),[(()=>{const a=Je();return f(a,n),a})(),M((()=>{const a=M(()=>!!i());return()=>a()&&(()=>{const h=Je();return f(h,u),h})()})())]},Qe=()=>{y(`${w}-typewriter`,{text:"",speed:100,cursor:"|"},Er)},zr=Object.freeze(Object.defineProperty({__proto__:null,Button:Se,Card:Ae,ChatBubble:Te,CheckBox:Pe,DanceCount:Le,DanceNumber:ue,FlexBox:Oe,FlexItem:Be,FloatButton:je,FloatChatFrame:Re,FloatWrapper:Fe,Icon:Ie,ImageCard:Ne,LayoutGrid:Me,LayoutHoly:De,LayoutMasonry:He,PlaceHolder:Ke,Popover:Ge,Portal:Ve,RadioButton:Ue,RadioGroup:Xe,Select:Ye,Textarea:We,Textfield:qe,Typewriter:Qe},Symbol.toStringTag,{value:"Module"})),Lr="",Or="",Br="",Sr=(e=zr)=>{for(const n in e){const t=e[n];t()}};p.Button=Se,p.Card=Ae,p.ChatBubble=Te,p.CheckBox=Pe,p.DanceCount=Le,p.DanceNumber=ue,p.FlexBox=Oe,p.FlexItem=Be,p.FloatButton=je,p.FloatChatFrame=Re,p.FloatWrapper=Fe,p.Icon=Ie,p.ImageCard=Ne,p.LayoutGrid=Me,p.LayoutHoly=De,p.LayoutMasonry=He,p.PlaceHolder=Ke,p.Popover=Ge,p.Portal=Ve,p.RadioButton=Ue,p.RadioGroup=Xe,p.Select=Ye,p.Textarea=We,p.Textfield=qe,p.Typewriter=Qe,p.defineCustomElements=Sr,p.registerIcon=xn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); |
@@ -9,2 +9,5 @@ import Button from './Button'; | ||
import FlexItem from './FlexItem'; | ||
import FloatButton from './FloatButton'; | ||
import FloatChatFrame from './FloatChatFrame'; | ||
import FloatWrapper from './FloatWrapper'; | ||
import Icon from './Icon'; | ||
@@ -24,2 +27,2 @@ import ImageCard from './ImageCard'; | ||
import Typewriter from './Typewriter'; | ||
export { Button, Card, ChatBubble, CheckBox, DanceCount, DanceNumber, FlexBox, FlexItem, Icon, ImageCard, LayoutGrid, LayoutHoly, LayoutMasonry, PlaceHolder, Popover, Portal, RadioButton, RadioGroup, Select, Textarea, Textfield, Typewriter, }; | ||
export { Button, Card, ChatBubble, CheckBox, DanceCount, DanceNumber, FlexBox, FlexItem, FloatButton, FloatChatFrame, FloatWrapper, Icon, ImageCard, LayoutGrid, LayoutHoly, LayoutMasonry, PlaceHolder, Popover, Portal, RadioButton, RadioGroup, Select, Textarea, Textfield, Typewriter, }; |
{ | ||
"name": "@aura-group/aura-design", | ||
"version": "0.3.16", | ||
"version": "0.3.17", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/aura-design.umd.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
141793
34
3024