@rettangoli/ui 0.1.20 → 0.1.21

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.
@@ -1,24 +1,24 @@
1
- var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(t[o]||"")}),e}var nt=["xs","sm","md","lg","xl"],V={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},y=Object.keys(V),w=i=>i.concat(nt.flatMap(t=>i.map(e=>`${t}-${e}`))),U={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},u=(i,t={})=>{let e="";for(let[s,o]of Object.entries(U)){s!=="default"&&(e+=`${o} {`);for(let[n,l]of Object.entries(i)){let c=t[n]?` ${t[n]} `:" ";for(let[h,d]of Object.entries(l)){let g=V[n],m=d.startsWith("--")?`var(${d})`:d,b=s==="default"?n:`${s}-${n}`,A=s==="default"?`h-${n}`:`${s}-h-${n}`;if(g){let M=g.split(" ").map(k=>`${k}: ${m};`).join(" ");e+=`
2
- :host([${b}="${h}"])${c}{
3
- ${M}
1
+ var rettangoli=(()=>{function c(s,...t){let e="";return s.forEach((n,r)=>{e+=n+(t[r]||"")}),e}var rt=["xs","sm","md","lg","xl"],N={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},y=Object.keys(N),w=s=>s.concat(rt.flatMap(t=>s.map(e=>`${t}-${e}`))),F={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},v=(s,t={})=>{let e="";for(let[n,r]of Object.entries(F)){n!=="default"&&(e+=`${r} {`);for(let[i,l]of Object.entries(s)){let h=t[i]?` ${t[i]} `:" ";for(let[o,a]of Object.entries(l)){let g=N[i],p=a.startsWith("--")?`var(${a})`:a,b=n==="default"?i:`${n}-${i}`,A=n==="default"?`h-${i}`:`${n}-h-${i}`;if(g){let z=g.split(" ").map(k=>`${k}: ${p};`).join(" ");e+=`
2
+ :host([${b}="${o}"])${h}{
3
+ ${z}
4
4
  }
5
- :host([${A}="${h}"]:hover)${c}{
6
- ${M}
5
+ :host([${A}="${o}"]:hover)${h}{
6
+ ${z}
7
7
  }
8
8
  `}else e+=`
9
- :host([${b}="${h}"])${c}{
10
- ${d}
9
+ :host([${b}="${o}"])${h}{
10
+ ${a}
11
11
  }
12
- :host([${A}="${h}"]:hover)${c}{
13
- ${d}
12
+ :host([${A}="${o}"]:hover)${h}{
13
+ ${a}
14
14
  }
15
- `}}s!=="default"&&(e+="}")}return e};function ot(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var rt=i=>/%$/.test(i),p=i=>{if(i!==void 0)return rt(i)?i:ot(i)?`${i}px`:Object.keys(r).includes(i)?`var(${r[i]})`:i},r={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let o of s){let n=U[o];if(!i[o]||Object.keys(i[o]).length===0)continue;o!=="default"&&(e+=`${n} {
16
- `);let l="";for(let[c,h]of Object.entries(i[o]))h!=null&&(l+=`${c}: ${h} !important;
15
+ `}}n!=="default"&&(e+="}")}return e};function ot(s){if(s===null||s.includes("/"))return!1;let t=String(s);return/[0-9]$/.test(t)}var at=s=>/%$/.test(s),m=s=>{if(s!==void 0)return at(s)?s:ot(s)?`${s}px`:Object.keys(d).includes(s)?`var(${d[s]})`:s},d={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(s,t=":host"){let e="",n=["default","xl","lg","md","sm"];for(let r of n){let i=F[r];if(!s[r]||Object.keys(s[r]).length===0)continue;r!=="default"&&(e+=`${i} {
16
+ `);let l="";for(let[h,o]of Object.entries(s[r]))o!=null&&(l+=`${h}: ${o} !important;
17
17
  `);e+=`${t} {
18
18
  ${l.trim()}
19
19
  }
20
- `,o!=="default"&&(e+=`}
21
- `)}return e}var _=a`
20
+ `,r!=="default"&&(e+=`}
21
+ `)}return e}var _=c`
22
22
  :host([flex="0"]) {
23
23
  flex: 0;
24
24
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var lt={mt:r,mr:r,mb:r,ml:r,m:r,mh:r,mv:r,s:{sm:`
61
+ `;var ht={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -107,7 +107,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
107
107
  `,lk:`
108
108
  background-color: transparent;
109
109
  color: var(--foreground);
110
- `}},at={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},N=u(lt,at);var S=a`
110
+ `}},dt={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},P=v(ht,dt);var S=c`
111
111
  a, a:link, a:visited, a:hover, a:active {
112
112
  color: inherit;
113
113
  text-decoration: none;
@@ -117,7 +117,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
117
117
  margin: 0;
118
118
  font: inherit;
119
119
  }
120
- `;var j=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
120
+ `;var j=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
121
121
  :host {
122
122
  display: contents;
123
123
  }
@@ -259,9 +259,9 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
259
259
  display: contents;
260
260
  }
261
261
 
262
- ${N}
262
+ ${P}
263
263
  ${_}
264
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,e,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let e=this.getAttribute("href");if(e){let s=document.createElement("a");s.setAttribute("href",e);let o=this.getAttribute("target");o&&s.setAttribute("target",o),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let e={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},o=e[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let c={sm:14,lg:22},h=this.getAttribute("s");n=c[h]||18}else n=s[this.getAttribute("s")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",o),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=p(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}getBoundingClientRect(){return this._buttonElement?this._buttonElement.getBoundingClientRect():super.getBoundingClientRect()}},P=({render:i,html:t})=>j;var R=a`
264
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,e,n){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let e=this.getAttribute("href");if(e){let n=document.createElement("a");n.setAttribute("href",e);let r=this.getAttribute("target");r&&n.setAttribute("target",r),n.appendChild(this._buttonElement),this.shadow.appendChild(n),this._containerElement=n}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let e={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},n={sm:14,md:18,lg:22},r=e[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let h={sm:14,lg:22},o=this.getAttribute("s");i=h[o]||18}else i=n[this.getAttribute("s")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",r),this._iconElement.setAttribute("wh",i.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=m(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}getBoundingClientRect(){return this._buttonElement?this._buttonElement.getBoundingClientRect():super.getBoundingClientRect()}},U=({render:s,html:t})=>j;var R=c`
265
265
 
266
266
  :host([d="h"]) {
267
267
  flex-direction: row;
@@ -332,7 +332,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
332
332
  justify-content: center;
333
333
  }
334
334
  }
335
- `;var ht={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out",p:"pointer",m:"move"}},f=u(ht);var F=a`
335
+ `;var ct={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out",p:"pointer",m:"move"}},u=v(ct);var K=c`
336
336
  :host([sh]:not([sv])) {
337
337
  overflow-x: scroll;
338
338
  flex-wrap: nowrap;
@@ -354,7 +354,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
354
354
  flex-wrap: nowrap;
355
355
  }
356
356
 
357
- `;var E={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},dt={bgc:{pr:`
357
+ `;var E={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},gt={bgc:{pr:`
358
358
  background-color: var(--primary);
359
359
  `,se:`
360
360
  background-color: var(--secondary);
@@ -394,7 +394,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
394
394
  left: 0;
395
395
  top: 0;
396
396
  height: 100%;
397
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:r,pr:r,pb:r,pl:r,p:r,ph:r,pv:r,g:r,gv:r,gh:r,bw:E,bwt:E,bwr:E,bwb:E,bwl:E,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},C=u(dt);var ct={mt:r,mr:r,mb:r,ml:r,m:r,mh:r,mv:r},v=u(ct);var D=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
397
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:E,bwt:E,bwr:E,bwb:E,bwl:E,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},C=v(gt);var mt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},f=v(mt);var D=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
398
398
  slot {
399
399
  display: contents;
400
400
  }
@@ -414,10 +414,10 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
414
414
  }
415
415
 
416
416
  ${_}
417
- ${F}
417
+ ${K}
418
418
  ${R}
419
- ${v}
420
419
  ${f}
420
+ ${u}
421
421
  ${C}
422
422
  ${S}
423
423
 
@@ -434,7 +434,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
434
434
  bottom: 0;
435
435
  z-index: 1;
436
436
  }
437
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...w([...y,"wh","w","h","hide","show","sh","sv","z","d","ah","av","flex","fw","overflow"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}connectedCallback(){this.updateStyles()}updateStyles(){this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(e=>{let s=q=>`${e==="default"?"":`${e}-`}${q}`,o=this.getAttribute(s("wh")),n=p(o===null?this.getAttribute(s("w")):o),l=p(o===null?this.getAttribute(s("h")):o),c=this.getAttribute(s("op")),h=this.getAttribute(s("z"));h!==null&&(this._styles[e]["z-index"]=h),c!==null&&(this._styles[e].opacity=c),n==="f"?this._styles[e].width="var(--width-stretch)":n!==void 0&&(this._styles[e].width=n,this._styles[e]["min-width"]=n,this._styles[e]["max-width"]=n),l==="f"?this._styles[e].height="100%":l!==void 0&&(this._styles[e].height=l,this._styles[e]["min-height"]=l,this._styles[e]["max-height"]=l),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let d=this.getAttribute(s("d")),g=this.getAttribute(s("ah")),m=this.getAttribute(s("av"));d==="h"?this._styles[e]["flex-direction"]="row":d==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!d&&["sm","md","lg","xl"].some(st=>this.hasAttribute(`${st}-d`))&&(this._styles[e]["flex-direction"]="column");let b=d==="h",A=d==="v"||!d;b&&(g==="c"?this._styles[e]["justify-content"]="center":g==="e"?this._styles[e]["justify-content"]="flex-end":g==="s"&&(this._styles[e]["justify-content"]="flex-start"),m==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):m==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):m==="s"&&(this._styles[e]["align-items"]="flex-start")),A&&(g!==null||m!==null)&&(g==="c"?this._styles[e]["align-items"]="center":g==="e"?this._styles[e]["align-items"]="flex-end":g==="s"&&(this._styles[e]["align-items"]="flex-start"),m==="c"?this._styles[e]["justify-content"]="center":m==="e"?this._styles[e]["justify-content"]="flex-end":m==="s"&&(this._styles[e]["justify-content"]="flex-start"));let z=this.getAttribute(s("flex"));z!==null&&(this._styles[e].flex=z),this.getAttribute(s("fw"))==="w"&&(this._styles[e]["flex-wrap"]="wrap");let k=this.hasAttribute(s("sh")),L=this.hasAttribute(s("sv")),it=this.getAttribute(s("overflow"));k&&L?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):k?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):L&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),it==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="target"){this._updateDOM();return}e!==s&&this.updateStyles()}},K=({render:i,html:t})=>D;var gt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
437
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...w([...y,"wh","w","h","hide","show","sh","sv","z","d","ah","av","flex","fw","overflow"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}connectedCallback(){this.updateStyles()}updateStyles(){this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(e=>{let n=q=>`${e==="default"?"":`${e}-`}${q}`,r=this.getAttribute(n("wh")),i=m(r===null?this.getAttribute(n("w")):r),l=m(r===null?this.getAttribute(n("h")):r),h=this.getAttribute(n("op")),o=this.getAttribute(n("z"));o!==null&&(this._styles[e]["z-index"]=o),h!==null&&(this._styles[e].opacity=h),i==="f"?this._styles[e].width="var(--width-stretch)":i!==void 0&&(this._styles[e].width=i,this._styles[e]["min-width"]=i,this._styles[e]["max-width"]=i),l==="f"?this._styles[e].height="100%":l!==void 0&&(this._styles[e].height=l,this._styles[e]["min-height"]=l,this._styles[e]["max-height"]=l),this.hasAttribute(n("hide"))&&(this._styles[e].display="none"),this.hasAttribute(n("show"))&&(this._styles[e].display="flex");let a=this.getAttribute(n("d")),g=this.getAttribute(n("ah")),p=this.getAttribute(n("av"));a==="h"?this._styles[e]["flex-direction"]="row":a==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!a&&["sm","md","lg","xl"].some(lt=>this.hasAttribute(`${lt}-d`))&&(this._styles[e]["flex-direction"]="column");let b=a==="h",A=a==="v"||!a;b&&(g==="c"?this._styles[e]["justify-content"]="center":g==="e"?this._styles[e]["justify-content"]="flex-end":g==="s"&&(this._styles[e]["justify-content"]="flex-start"),p==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):p==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):p==="s"&&(this._styles[e]["align-items"]="flex-start")),A&&(g!==null||p!==null)&&(g==="c"?this._styles[e]["align-items"]="center":g==="e"?this._styles[e]["align-items"]="flex-end":g==="s"&&(this._styles[e]["align-items"]="flex-start"),p==="c"?this._styles[e]["justify-content"]="center":p==="e"?this._styles[e]["justify-content"]="flex-end":p==="s"&&(this._styles[e]["justify-content"]="flex-start"));let M=this.getAttribute(n("flex"));M!==null&&(this._styles[e].flex=M),this.getAttribute(n("fw"))==="w"&&(this._styles[e]["flex-wrap"]="wrap");let k=this.hasAttribute(n("sh")),V=this.hasAttribute(n("sv")),nt=this.getAttribute(n("overflow"));k&&V?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):k?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):V&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),nt==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,n){if(t==="href"||t==="target"){this._updateDOM();return}e!==n&&this.updateStyles()}},Q=({render:s,html:t})=>D;var pt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
438
438
  font-size: var(--h1-font-size);
439
439
  font-weight: var(--h1-font-weight);
440
440
  line-height: var(--h1-line-height);
@@ -474,7 +474,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
474
474
  font-weight: var(--xs-font-weight);
475
475
  line-height: var(--xs-line-height);
476
476
  letter-spacing: var(--xs-letter-spacing);
477
- `}},Q=u(gt);var pt={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},$=u(pt);var W=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
477
+ `}},G=v(pt);var ut={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},$=v(ut);var O=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
478
478
  :host {
479
479
  display: block;
480
480
  font-size: var(--md-font-size);
@@ -505,11 +505,11 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
505
505
  bottom: 0;
506
506
  z-index: 1;
507
507
  }
508
- ${Q}
508
+ ${G}
509
509
  ${$}
510
- ${v}
511
510
  ${f}
512
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=p(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},G=({render:i,html:t})=>W;var O=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
511
+ ${u}
512
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,n){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=m(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},J=({render:s,html:t})=>O;var W=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
513
513
  :host {
514
514
  border-style: solid;
515
515
  box-sizing: border-box;
@@ -546,9 +546,9 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
546
546
  }
547
547
 
548
548
  ${C}
549
- ${v}
550
549
  ${f}
551
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return w([...y,"key","src","href","target","wh","w","h","hide","show","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,e,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let l=b=>`${n==="default"?"":`${n}-`}${b}`,c=this.getAttribute(l("wh")),h=p(c===null?this.getAttribute(l("w")):c),d=p(c===null?this.getAttribute(l("h")):c),g=this.getAttribute(l("o")),m=this.getAttribute(l("z"));m!==null&&(this._styles[n]["z-index"]=m),g!==null&&(this._styles[n].opacity=g),h==="f"?this._styles[n].width="var(--width-stretch)":h!==void 0&&(this._styles[n].width=h,this._styles[n]["min-width"]=h,this._styles[n]["max-width"]=h),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(l("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[n].display="block !important")});let o=x(this._styles);o!==this._lastStyleString&&(this._styleElement.textContent=o,this._lastStyleString=o),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),e!==null&&this._imgElement.setAttribute("width",e),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},J=({render:i,html:t})=>O;var X=a`
550
+ ${u}
551
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return w([...y,"key","src","href","target","wh","w","h","hide","show","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,e?this._linkElement.target=e:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,e,n){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let l=b=>`${i==="default"?"":`${i}-`}${b}`,h=this.getAttribute(l("wh")),o=m(h===null?this.getAttribute(l("w")):h),a=m(h===null?this.getAttribute(l("h")):h),g=this.getAttribute(l("o")),p=this.getAttribute(l("z"));p!==null&&(this._styles[i]["z-index"]=p),g!==null&&(this._styles[i].opacity=g),o==="f"?this._styles[i].width="var(--width-stretch)":o!==void 0&&(this._styles[i].width=o,this._styles[i]["min-width"]=o,this._styles[i]["max-width"]=o),a==="f"?this._styles[i].height="100%":a!==void 0&&(this._styles[i].height=a,this._styles[i]["min-height"]=a,this._styles[i]["max-height"]=a),this.hasAttribute(l("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[i].display="block !important")});let r=x(this._styles);r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("width"),n=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),e!==null&&this._imgElement.setAttribute("width",e),n!==null&&this._imgElement.setAttribute("height",n)}connectedCallback(){this._updateImageAttributes()}},X=({render:s,html:t})=>W;var Y=c`
552
552
  :host([pt="xs"]) svg {
553
553
  padding-top: var(--spacing-xs);
554
554
  }
@@ -664,16 +664,51 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
664
664
  padding-top: var(--spacing-xl);
665
665
  padding-bottom: var(--spacing-xl);
666
666
  }
667
- `;var T=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
667
+ `;var T=class s extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
668
668
  :host {
669
669
  color: var(--foreground);
670
670
  }
671
671
  ${$}
672
- ${X}
673
- ${v}
672
+ ${Y}
673
+ ${f}
674
674
  ${_}
675
+ ${u}
676
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return s._icons}static addIcon(t,e){s._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,n){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=m(t===null?this.getAttribute("w"):t),n=m(t===null?this.getAttribute("h"):t);e&&(this.style.width=e),n&&(this.style.height=n)}_render(){try{let t=this.getAttribute("svg"),e=s._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Z=({render:s,html:t})=>T;var I=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
677
+ :host {
678
+ display: contents;
679
+ }
680
+ input {
681
+ background-color: var(--background);
682
+ font-size: var(--sm-font-size);
683
+ font-weight: var(--sm-font-weight);
684
+ line-height: var(--sm-line-height);
685
+ letter-spacing: var(--sm-letter-spacing);
686
+ border: 1px solid var(--ring);
687
+ border-radius: var(--border-radius-lg);
688
+ padding-left: var(--spacing-md);
689
+ padding-right: var(--spacing-md);
690
+ height: 32px;
691
+ color: var(--foreground);
692
+ outline: none;
693
+ }
694
+ :host([s="sm"]) input {
695
+ font-size: var(--xs-font-size);
696
+ font-weight: var(--xs-font-weight);
697
+ line-height: var(--xs-line-height);
698
+ letter-spacing: var(--xs-letter-spacing);
699
+ padding-left: var(--spacing-md);
700
+ padding-right: var(--spacing-md);
701
+ height: 24px;
702
+ }
703
+ input:focus {
704
+ border-color: var(--foreground);
705
+ }
706
+ input:disabled {
707
+ cursor: not-allowed;
708
+ }
675
709
  ${f}
676
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=p(t===null?this.getAttribute("w"):t),s=p(t===null?this.getAttribute("h"):t);e&&(this.style.width=e),s&&(this.style.height=s)}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Y=({render:i,html:t})=>T;var I=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
710
+ ${u}
711
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...w([...y,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,e,n){if(t==="value"&&requestAnimationFrame(()=>{let i=this.getAttribute("value");this._inputElement.value=i??""}),t==="placeholder"&&requestAnimationFrame(()=>{let i=this.getAttribute("placeholder");i===void 0||i==="null"?this._inputElement.removeAttribute("placeholder"):this._inputElement.setAttribute("placeholder",i??"")}),["type","disabled","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let l=b=>`${i==="default"?"":`${i}-`}${b}`,h=this.getAttribute(l("wh")),o=m(h===null?this.getAttribute(l("w")):h),a=m(h===null?this.getAttribute(l("h")):h),g=this.getAttribute(l("op")),p=this.getAttribute(l("z"));p!==null&&(this._styles[i]["z-index"]=p),g!==null&&(this._styles[i].opacity=g),o==="f"?this._styles[i].width="var(--width-stretch)":o!==void 0&&(this._styles[i].width=o,this._styles[i]["min-width"]=o,this._styles[i]["max-width"]=o),a==="f"?this._styles[i].height="100%":a!==void 0&&(this._styles[i].height=a,this._styles[i]["min-height"]=a,this._styles[i]["max-height"]=a),this.hasAttribute(l("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[i].display="block !important")});let r=x(this._styles,"input");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",e=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),e!==null?this._inputElement.setAttribute("step",e):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},tt=({render:s,html:t})=>I;var B=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
677
712
  :host {
678
713
  display: contents;
679
714
  }
@@ -706,9 +741,9 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
706
741
  input:disabled {
707
742
  cursor: not-allowed;
708
743
  }
709
- ${v}
710
744
  ${f}
711
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...w([...y,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,e,s){if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._inputElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._inputElement.removeAttribute("placeholder"):this._inputElement.setAttribute("placeholder",n??"")}),["type","disabled","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let l=b=>`${n==="default"?"":`${n}-`}${b}`,c=this.getAttribute(l("wh")),h=p(c===null?this.getAttribute(l("w")):c),d=p(c===null?this.getAttribute(l("h")):c),g=this.getAttribute(l("op")),m=this.getAttribute(l("z"));m!==null&&(this._styles[n]["z-index"]=m),g!==null&&(this._styles[n].opacity=g),h==="f"?this._styles[n].width="var(--width-stretch)":h!==void 0&&(this._styles[n].width=h,this._styles[n]["min-width"]=h,this._styles[n]["max-width"]=h),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(l("hide"))&&(this._styles[n].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[n].display="block !important")});let o=x(this._styles,"input");o!==this._lastStyleString&&(this._styleElement.textContent=o,this._lastStyleString=o)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",e=this.getAttribute("step"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),e!==null?this._inputElement.setAttribute("step",e):this._inputElement.removeAttribute("step"),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Z=({render:i,html:t})=>I;var H=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
745
+ ${u}
746
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","step","min","max","s",...w([...y,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onChange=t=>{let e=this._inputElement.value,n=parseFloat(e);if(!isNaN(n)){let r=this.getAttribute("min");if(r!==null){let l=parseFloat(r);!isNaN(l)&&n<l&&(n=l,this._inputElement.value=l.toString())}let i=this.getAttribute("max");if(i!==null){let l=parseFloat(i);!isNaN(l)&&n>l&&(n=l,this._inputElement.value=l.toString())}this.dispatchEvent(new CustomEvent("input-change",{detail:{value:n}}))}};attributeChangedCallback(t,e,n){if(t==="value"&&requestAnimationFrame(()=>{let i=this.getAttribute("value");this._inputElement.value=i??""}),t==="placeholder"&&requestAnimationFrame(()=>{let i=this.getAttribute("placeholder");i===void 0||i==="null"?this._inputElement.removeAttribute("placeholder"):this._inputElement.setAttribute("placeholder",i??"")}),["type","disabled","step","min","max","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let l=b=>`${i==="default"?"":`${i}-`}${b}`,h=this.getAttribute(l("wh")),o=m(h===null?this.getAttribute(l("w")):h),a=m(h===null?this.getAttribute(l("h")):h),g=this.getAttribute(l("op")),p=this.getAttribute(l("z"));p!==null&&(this._styles[i]["z-index"]=p),g!==null&&(this._styles[i].opacity=g),o==="f"?this._styles[i].width="var(--width-stretch)":o!==void 0&&(this._styles[i].width=o,this._styles[i]["min-width"]=o,this._styles[i]["max-width"]=o),a==="f"?this._styles[i].height="100%":a!==void 0&&(this._styles[i].height=a,this._styles[i]["min-height"]=a,this._styles[i]["max-height"]=a),this.hasAttribute(l("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[i].display="block !important")});let r=x(this._styles,"input");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("type")||"number",e=this.getAttribute("step"),n=this.getAttribute("min"),r=this.getAttribute("max"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),e!==null?this._inputElement.setAttribute("step",e):this._inputElement.removeAttribute("step"),n!==null?this._inputElement.setAttribute("min",n):this._inputElement.removeAttribute("min"),r!==null?this._inputElement.setAttribute("max",r):this._inputElement.removeAttribute("max"),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},et=({render:s,html:t})=>B;var H=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
712
747
  :host {
713
748
  display: contents;
714
749
  }
@@ -731,9 +766,9 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
731
766
  textarea:focus {
732
767
  border-color: var(--foreground);
733
768
  }
734
- ${v}
735
769
  ${f}
736
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onChange)}_onChange=t=>{this.dispatchEvent(new CustomEvent("textarea-change",{detail:{value:this._textareaElement.value}}))};static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder","value"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let o=this.getAttribute("value");this._textareaElement.value=o??""});return}this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.getAttribute("placeholder"),o=this.getAttribute("value");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder"),o!==null&&(this._textareaElement.value=o)}},tt=({render:i,html:t})=>H;var B=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
770
+ ${u}
771
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onChange)}_onChange=t=>{this.dispatchEvent(new CustomEvent("textarea-change",{detail:{value:this._textareaElement.value}}))};static get observedAttributes(){return["key","type","placeholder","disabled","value","cols","rows","ellipsis",...w([...y,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,e,n){if(t==="value"&&requestAnimationFrame(()=>{let i=this.getAttribute("value");this._textareaElement.value=i??""}),t==="placeholder"&&requestAnimationFrame(()=>{let i=this.getAttribute("placeholder");i===void 0||i==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",i??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let l=b=>`${i==="default"?"":`${i}-`}${b}`,h=this.getAttribute(l("wh")),o=m(h===null?this.getAttribute(l("w")):h),a=m(h===null?this.getAttribute(l("h")):h),g=this.getAttribute(l("op")),p=this.getAttribute(l("z"));p!==null&&(this._styles[i]["z-index"]=p),g!==null&&(this._styles[i].opacity=g),o==="f"?this._styles[i].width="var(--width-stretch)":o!==void 0&&(this._styles[i].width=o,this._styles[i]["min-width"]=o,this._styles[i]["max-width"]=o),a==="f"?this._styles[i].height="100%":a!==void 0&&(this._styles[i].height=a,this._styles[i]["min-height"]=a,this._styles[i]["max-height"]=a),this.hasAttribute(l("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(l("show"))&&(this._styles[i].display="block !important")});let r=x(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),n=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),n?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},it=({render:s,html:t})=>H;var L=class s extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){s.styleSheet||(s.styleSheet=new CSSStyleSheet,s.styleSheet.replaceSync(c`
737
772
  :host {
738
773
  display: contents;
739
774
  }
@@ -804,4 +839,4 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
804
839
  dialog[open] slot[name="content"] {
805
840
  animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
806
841
  }
807
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{}}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_applyAdaptiveCentering(){this._slotElement&&requestAnimationFrame(()=>{if(!this._slotElement)return;let t=this._slotElement.offsetHeight,e=window.innerHeight,s=40;if(t>=e-2*s)this._slotElement.style.marginTop=`${s}px`,this._slotElement.style.marginBottom=`${s}px`,this._dialogElement.style.height="100vh";else{let o=e-t,n=Math.floor(o/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}})}get dialog(){return this._dialogElement}},et=({render:i,html:t})=>B;customElements.define("rtgl-button",P({}));customElements.define("rtgl-view",K({}));customElements.define("rtgl-text",G({}));customElements.define("rtgl-image",J({}));customElements.define("rtgl-svg",Y({}));customElements.define("rtgl-input",Z({}));customElements.define("rtgl-textarea",tt({}));customElements.define("rtgl-dialog",et({}));})();
842
+ `))}constructor(){super(),s.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[s.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{}}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,e,n){t==="open"?n!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():n===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_applyAdaptiveCentering(){this._slotElement&&requestAnimationFrame(()=>{if(!this._slotElement)return;let t=this._slotElement.offsetHeight,e=window.innerHeight,n=40;if(t>=e-2*n)this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="100vh";else{let r=e-t,i=Math.floor(r/2);this._slotElement.style.marginTop=`${i}px`,this._slotElement.style.marginBottom=`${i}px`,this._dialogElement.style.height="auto"}})}get dialog(){return this._dialogElement}},st=({render:s,html:t})=>L;customElements.define("rtgl-button",U({}));customElements.define("rtgl-view",Q({}));customElements.define("rtgl-text",J({}));customElements.define("rtgl-image",X({}));customElements.define("rtgl-svg",Z({}));customElements.define("rtgl-input",tt({}));customElements.define("rtgl-input-number",et({}));customElements.define("rtgl-textarea",it({}));customElements.define("rtgl-dialog",st({}));})();