@rettangoli/ui 0.1.2-rc2 → 0.1.2-rc20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/rettangoli-iife-layout.min.js +102 -32
  2. package/dist/rettangoli-iife-ui.min.js +182 -69
  3. package/package.json +5 -3
  4. package/src/cli/buildSvg.js +86 -0
  5. package/src/cli/index.js +1 -0
  6. package/src/components/breadcrumb/breadcrumb.handlers.js +9 -0
  7. package/src/components/breadcrumb/breadcrumb.store.js +29 -0
  8. package/src/components/breadcrumb/breadcrumb.view.yaml +64 -0
  9. package/src/components/dropdownMenu/dropdownMenu.handlers.js +4 -4
  10. package/src/components/dropdownMenu/dropdownMenu.store.js +5 -17
  11. package/src/components/dropdownMenu/dropdownMenu.view.yaml +15 -13
  12. package/src/components/form/form.handlers.js +133 -24
  13. package/src/components/form/form.store.js +123 -23
  14. package/src/components/form/form.view.yaml +137 -29
  15. package/src/components/pageOutline/pageOutline.handlers.js +1 -1
  16. package/src/components/popoverInput/popoverInput.handlers.js +99 -0
  17. package/src/components/popoverInput/popoverInput.store.js +48 -0
  18. package/src/components/popoverInput/popoverInput.view.yaml +55 -0
  19. package/src/components/select/select.handlers.js +2 -5
  20. package/src/components/select/select.view.yaml +3 -3
  21. package/src/components/sidebar/sidebar.view.yaml +1 -1
  22. package/src/components/sliderInput/sliderInput.handlers.js +24 -0
  23. package/src/components/sliderInput/sliderInput.store.js +17 -0
  24. package/src/components/sliderInput/sliderInput.view.yaml +42 -0
  25. package/src/components/table/table.handlers.js +1 -1
  26. package/src/components/tabs/tabs.handlers.js +10 -0
  27. package/src/components/tabs/tabs.store.js +29 -0
  28. package/src/components/tabs/tabs.view.yaml +64 -0
  29. package/src/components/waveform/waveform.handlers.js +92 -0
  30. package/src/components/waveform/waveform.store.js +17 -0
  31. package/src/components/waveform/waveform.view.yaml +38 -0
  32. package/src/entry-iife-layout.js +3 -0
  33. package/src/entry-iife-ui.js +4 -0
  34. package/src/index.js +5 -1
  35. package/src/primitives/dialog.js +208 -0
  36. package/src/primitives/input.js +32 -11
  37. package/src/primitives/popover.js +275 -0
  38. package/src/primitives/slider.js +8 -9
  39. package/src/styles/viewStyles.js +1 -0
  40. package/src/components/dialog/dialog.handlers.js +0 -5
  41. package/src/components/dialog/dialog.store.js +0 -25
  42. package/src/components/dialog/dialog.view.yaml +0 -44
  43. package/src/components/popover/popover.handlers.js +0 -5
  44. package/src/components/popover/popover.store.js +0 -12
  45. package/src/components/popover/popover.view.yaml +0 -57
@@ -1,24 +1,24 @@
1
- var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(t[g]||"")}),s}var X=["xs","sm","md","lg","xl"],I={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(I),x=e=>e.concat(X.flatMap(t=>e.map(s=>`${t}-${s}`))),V={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)"},p=(e,t={})=>{let s="";for(let[r,g]of Object.entries(V)){r!=="default"&&(s+=`${g} {`);for(let[i,o]of Object.entries(e)){let l=t[i]?` ${t[i]} `:" ";for(let[a,d]of Object.entries(o)){let u=I[i],f=d.startsWith("--")?`var(${d})`:d,v=r==="default"?i:`${r}-${i}`,T=r==="default"?`h-${i}`:`${r}-h-${i}`;if(u){let D=u.split(" ").map(J=>`${J}: ${f};`).join(" ");s+=`
2
- :host([${v}="${a}"])${l}{
3
- ${D}
1
+ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(t[a]||"")}),s}var Z=["xs","sm","md","lg","xl"],I={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(I),w=e=>e.concat(Z.flatMap(t=>e.map(s=>`${t}-${s}`))),V={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)"},p=(e,t={})=>{let s="";for(let[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {`);for(let[i,r]of Object.entries(e)){let h=t[i]?` ${t[i]} `:" ";for(let[d,c]of Object.entries(r)){let u=I[i],f=c.startsWith("--")?`var(${c})`:c,v=n==="default"?i:`${n}-${i}`,T=n==="default"?`h-${i}`:`${n}-h-${i}`;if(u){let L=u.split(" ").map(Y=>`${Y}: ${f};`).join(" ");s+=`
2
+ :host([${v}="${d}"])${h}{
3
+ ${L}
4
4
  }
5
- :host([${T}="${a}"]:hover)${l}{
6
- ${D}
5
+ :host([${T}="${d}"]:hover)${h}{
6
+ ${L}
7
7
  }
8
8
  `}else s+=`
9
- :host([${v}="${a}"])${l}{
10
- ${d}
9
+ :host([${v}="${d}"])${h}{
10
+ ${c}
11
11
  }
12
- :host([${T}="${a}"]:hover)${l}{
13
- ${d}
12
+ :host([${T}="${d}"]:hover)${h}{
13
+ ${c}
14
14
  }
15
- `}}r!=="default"&&(s+="}")}return s};function Y(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Z=e=>/%$/.test(e),c=e=>{if(e!==void 0)return Z(e)?e:Y(e)?`${e}px`:Object.keys(n).includes(e)?`var(${n[e]})`:e},n={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function w(e,t=":host"){let s="";for(let[r,g]of Object.entries(V)){r!=="default"&&(s+=`${g} {
16
- `);let i="";for(let[o,l]of Object.entries(e[r]))l!=null&&(i+=`${o}: ${l};
15
+ `}}n!=="default"&&(s+="}")}return s};function tt(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var et=e=>/%$/.test(e),g=e=>{if(e!==void 0)return et(e)?e:tt(e)?`${e}px`:Object.keys(o).includes(e)?`var(${o[e]})`:e},o={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(e,t=":host"){let s="";for(let[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {
16
+ `);let i="";for(let[r,h]of Object.entries(e[n]))h!=null&&(i+=`${r}: ${h};
17
17
  `);s+=`${t} {
18
18
  ${i.trim()}
19
19
  }
20
- `,r!=="default"&&(s+=`}
21
- `)}return s}var S=h`
20
+ `,n!=="default"&&(s+=`}
21
+ `)}return s}var S=l`
22
22
  :host([flex="0"]) {
23
23
  flex: 0;
24
24
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var tt={mt:n,mr:n,mb:n,ml:n,m:n,mh:n,mv:n,s:{sm:`
61
+ `;var it={mt:o,mr:o,mb:o,ml:o,m:o,mh:o,mv:o,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},et={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},L=p(tt,et);var _=h`
107
+ `}},st={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},H=p(it,st);var _=l`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -114,7 +114,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
114
114
  margin: 0;
115
115
  font: inherit;
116
116
  }
117
- `;var $=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
117
+ `;var C=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
118
118
  :host {
119
119
  display: contents;
120
120
  }
@@ -256,9 +256,9 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
256
256
  display: contents;
257
257
  }
258
258
 
259
- ${L}
259
+ ${H}
260
260
  ${S}
261
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,s,r){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 s=this.getAttribute("href");if(s){let r=document.createElement("a");r.setAttribute("href",s);let g=this.getAttribute("target");g&&r.setAttribute("target",g),r.appendChild(this._buttonElement),this.shadow.appendChild(r),this._containerElement=r}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 s={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},r={sm:14,md:18,lg:22},g=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let l={sm:14,lg:22},a=this.getAttribute("s");i=l[a]||18}else i=r[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",g),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=c(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="")}},B=({render:e,html:t})=>$;var H=h`
261
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,s,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 s=this.getAttribute("href");if(s){let n=document.createElement("a");n.setAttribute("href",s);let a=this.getAttribute("target");a&&n.setAttribute("target",a),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 s={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},a=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let h={sm:14,lg:22},d=this.getAttribute("s");i=h[d]||18}else i=n[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",a),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=g(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="")}},B=({render:e,html:t})=>C;var U=l`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
329
329
  justify-content: center;
330
330
  }
331
331
  }
332
- `;var it={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},m=p(it);var U=h`
332
+ `;var nt={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},m=p(nt);var q=l`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
347
347
  flex-wrap: nowrap;
348
348
  }
349
349
 
350
- `;var E={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},st={bgc:{pr:`
350
+ `;var E={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ot={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
387
387
  left: 0;
388
388
  top: 0;
389
389
  height: 100%;
390
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:n,pr:n,pb:n,pl:n,p:n,ph:n,pv:n,g:n,gv:n,gh:n,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"},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"}},k=p(st);var rt={mt:n,mr:n,mb:n,ml:n,m:n,mh:n,mv:n},b=p(rt);var C=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
390
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:o,pr:o,pb:o,pl:o,p:o,ph:o,pv:o,g:o,gv:o,gh:o,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"}},k=p(ot);var rt={mt:o,mr:o,mb:o,ml:o,m:o,mh:o,mv:o},b=p(rt);var $=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
391
391
  slot {
392
392
  display: contents;
393
393
  }
@@ -407,8 +407,8 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
407
407
  }
408
408
 
409
409
  ${S}
410
+ ${q}
410
411
  ${U}
411
- ${H}
412
412
  ${b}
413
413
  ${m}
414
414
  ${k}
@@ -427,7 +427,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
427
427
  bottom: 0;
428
428
  z-index: 1;
429
429
  }
430
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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",...x([...y,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=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,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),d=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),a==="f"?this._styles[i].width="var(--width-stretch)":a!==void 0&&(this._styles[i].width=a,this._styles[i]["min-width"]=a,this._styles[i]["max-width"]=a),d==="f"?this._styles[i].height="100%":d!==void 0&&(this._styles[i].height=d,this._styles[i]["min-height"]=d,this._styles[i]["max-height"]=d),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="flex !important")});let g=w(this._styles);g!==this._lastStyleString&&(this._styleElement.textContent=g,this._lastStyleString=g)}},q=({render:e,html:t})=>C;var nt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
430
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=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,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,s,n){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let r=v=>`${i==="default"?"":`${i}-`}${v}`,h=this.getAttribute(r("wh")),d=g(h===null?this.getAttribute(r("w")):h),c=g(h===null?this.getAttribute(r("h")):h),u=this.getAttribute(r("op")),f=this.getAttribute(r("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(r("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(r("visible"))&&(this._styles[i].display="flex !important")});let a=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}},N=({render:e,html:t})=>$;var lt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
431
431
  font-size: var(--h1-font-size);
432
432
  font-weight: var(--h1-font-weight);
433
433
  line-height: var(--h1-line-height);
@@ -467,7 +467,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
467
467
  font-weight: var(--xs-font-weight);
468
468
  line-height: var(--xs-line-height);
469
469
  letter-spacing: var(--xs-letter-spacing);
470
- `}},N=p(nt);var ot={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},A=p(ot);var z=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
470
+ `}},P=p(lt);var at={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},A=p(at);var z=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -498,11 +498,11 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
498
498
  bottom: 0;
499
499
  z-index: 1;
500
500
  }
501
- ${N}
501
+ ${P}
502
502
  ${A}
503
503
  ${b}
504
504
  ${m}
505
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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,s,r){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(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"),s=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,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},P=({render:e,html:t})=>z;var M=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
505
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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,s,n){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=g(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"),s=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,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},K=({render:e,html:t})=>z;var M=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
506
506
  :host {
507
507
  border-style: solid;
508
508
  box-sizing: border-box;
@@ -541,7 +541,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
541
541
  ${k}
542
542
  ${b}
543
543
  ${m}
544
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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 x([...y,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,s?this._linkElement.target=s: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,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),d=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("o")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),a==="f"?this._styles[i].width="var(--width-stretch)":a!==void 0&&(this._styles[i].width=a,this._styles[i]["min-width"]=a,this._styles[i]["max-width"]=a),d==="f"?this._styles[i].height="100%":d!==void 0&&(this._styles[i].height=d,this._styles[i]["min-height"]=d,this._styles[i]["max-height"]=d),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let g=w(this._styles);g!==this._lastStyleString&&(this._styleElement.textContent=g,this._lastStyleString=g),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),r=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),r!==null&&this._imgElement.setAttribute("height",r)}connectedCallback(){this._updateImageAttributes()}},K=({render:e,html:t})=>M;var Q=h`
544
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,s?this._linkElement.target=s: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,s,n){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let r=v=>`${i==="default"?"":`${i}-`}${v}`,h=this.getAttribute(r("wh")),d=g(h===null?this.getAttribute(r("w")):h),c=g(h===null?this.getAttribute(r("h")):h),u=this.getAttribute(r("o")),f=this.getAttribute(r("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(r("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(r("visible"))&&(this._styles[i].display="block !important")});let a=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),n=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),n!==null&&this._imgElement.setAttribute("height",n)}connectedCallback(){this._updateImageAttributes()}},Q=({render:e,html:t})=>M;var R=l`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -657,15 +657,15 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
657
657
  padding-top: var(--spacing-xl);
658
658
  padding-bottom: var(--spacing-xl);
659
659
  }
660
- `;var j=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
660
+ `;var j=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
661
661
  :host {
662
662
  color: var(--foreground);
663
663
  }
664
664
  ${A}
665
- ${Q}
665
+ ${R}
666
666
  ${S}
667
667
  ${m}
668
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,r){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=c(t===null?this.getAttribute("w"):t),r=c(t===null?this.getAttribute("h"):t);s&&(this.style.width=s),r&&(this.style.height=r)}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},R=({render:e,html:t})=>j;var O=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
668
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,n){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=g(t===null?this.getAttribute("w"):t),n=g(t===null?this.getAttribute("h"):t);s&&(this.style.width=s),n&&(this.style.height=n)}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},G=({render:e,html:t})=>j;var O=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
669
669
  :host {
670
670
  display: contents;
671
671
  }
@@ -700,7 +700,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
700
700
  }
701
701
  ${b}
702
702
  ${m}
703
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){if(["type","placeholder","disabled","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),d=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),a==="f"?this._styles[i].width="var(--width-stretch)":a!==void 0&&(this._styles[i].width=a,this._styles[i]["min-width"]=a,this._styles[i]["max-width"]=a),d==="f"?this._styles[i].height="100%":d!==void 0&&(this._styles[i].height=d,this._styles[i]["min-height"]=d,this._styles[i]["max-height"]=d),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let g=w(this._styles,"input");g!==this._lastStyleString&&(this._styleElement.textContent=g,this._lastStyleString=g)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},G=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
703
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.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","hidden","visible","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,s,n){if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let r=v=>`${i==="default"?"":`${i}-`}${v}`,h=this.getAttribute(r("wh")),d=g(h===null?this.getAttribute(r("w")):h),c=g(h===null?this.getAttribute(r("h")):h),u=this.getAttribute(r("op")),f=this.getAttribute(r("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(r("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(r("visible"))&&(this._styles[i].display="block !important")});let a=x(this._styles,"input");a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),n=this.getAttribute("value"),a=this.getAttribute("step"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),n!==null&&(this._inputElement.value=n),a!==null?this._inputElement.setAttribute("step",a):this._inputElement.removeAttribute("step"),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},F=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -725,4 +725,74 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
725
725
  }
726
726
  ${b}
727
727
  ${m}
728
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,s,r){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),s=this.getAttribute("rows"),r=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),s!==null?this._textareaElement.setAttribute("rows",s):this._textareaElement.removeAttribute("rows"),r!==null?this._textareaElement.setAttribute("placeholder",r):this._textareaElement.removeAttribute("placeholder")}},F=({render:e,html:t})=>W;customElements.define("rtgl-button",B({}));customElements.define("rtgl-view",q({}));customElements.define("rtgl-text",P({}));customElements.define("rtgl-image",K({}));customElements.define("rtgl-svg",R({}));customElements.define("rtgl-input",G({}));customElements.define("rtgl-textarea",F({}));})();
728
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,s,n){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),s=this.getAttribute("rows"),n=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),s!==null?this._textareaElement.setAttribute("rows",s):this._textareaElement.removeAttribute("rows"),n!==null?this._textareaElement.setAttribute("placeholder",n):this._textareaElement.removeAttribute("placeholder")}},J=({render:e,html:t})=>W;var D=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
729
+ :host {
730
+ display: contents;
731
+ }
732
+
733
+ dialog {
734
+ padding: 0;
735
+ border: none;
736
+ background: transparent;
737
+ margin: auto;
738
+ overflow-y: scroll;
739
+ color: inherit;
740
+ max-height: 100vh;
741
+ height: 100vh;
742
+ max-width: 100vw;
743
+ scrollbar-width: none;
744
+ outline: none;
745
+ }
746
+
747
+ dialog::backdrop {
748
+ background-color: rgba(0, 0, 0, 0.5);
749
+ }
750
+
751
+ slot[name="content"] {
752
+ background-color: var(--background) !important;
753
+ display: block;
754
+ padding: var(--spacing-lg);
755
+ border: 1px solid var(--border);
756
+ border-radius: var(--border-radius-md);
757
+ margin-top: 20vh;
758
+ margin-bottom: 20vh;
759
+ margin-left: var(--spacing-lg);
760
+ margin-right: var(--spacing-lg);
761
+ width: fit-content;
762
+ max-width: calc(100vw - 2 * var(--spacing-lg));
763
+ }
764
+
765
+ /* Size attribute styles */
766
+ :host([s="sm"]) slot[name="content"] {
767
+ width: 33vw;
768
+ }
769
+
770
+ :host([s="md"]) slot[name="content"] {
771
+ width: 50vw;
772
+ }
773
+
774
+ :host([s="lg"]) slot[name="content"] {
775
+ width: 80vw;
776
+ }
777
+
778
+ :host([s="f"]) slot[name="content"] {
779
+ width: 100vw;
780
+ margin-left: 0;
781
+ margin-right: 0;
782
+ }
783
+
784
+ @keyframes dialog-in {
785
+ from {
786
+ opacity: 0;
787
+ transform: scale(0.95);
788
+ }
789
+ to {
790
+ opacity: 1;
791
+ transform: scale(1);
792
+ }
793
+ }
794
+
795
+ dialog[open] slot[name="content"] {
796
+ animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
797
+ }
798
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),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,s,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)}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._dialogElement.removeChild(this._slotElement),this._slotElement=null))}get dialog(){return this._dialogElement}},X=({render:e,html:t})=>D;customElements.define("rtgl-button",B({}));customElements.define("rtgl-view",N({}));customElements.define("rtgl-text",K({}));customElements.define("rtgl-image",Q({}));customElements.define("rtgl-svg",G({}));customElements.define("rtgl-input",F({}));customElements.define("rtgl-textarea",J({}));customElements.define("rtgl-dialog",X({}));})();