@rettangoli/ui 0.1.2-rc8 → 0.1.3

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 (68) hide show
  1. package/dist/rettangoli-iife-layout.min.js +128 -56
  2. package/dist/rettangoli-iife-ui.min.js +187 -66
  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/common.js +30 -2
  7. package/src/components/breadcrumb/breadcrumb.handlers.js +9 -0
  8. package/src/components/breadcrumb/breadcrumb.store.js +29 -0
  9. package/src/components/breadcrumb/breadcrumb.view.yaml +64 -0
  10. package/src/components/dropdownMenu/dropdownMenu.handlers.js +6 -6
  11. package/src/components/dropdownMenu/dropdownMenu.store.js +6 -18
  12. package/src/components/dropdownMenu/dropdownMenu.view.yaml +15 -13
  13. package/src/components/form/form.handlers.js +170 -33
  14. package/src/components/form/form.store.js +175 -21
  15. package/src/components/form/form.view.yaml +182 -27
  16. package/src/components/globalUi/globalUi.handlers.js +51 -0
  17. package/src/components/globalUi/globalUi.store.js +57 -0
  18. package/src/components/globalUi/globalUi.view.yaml +50 -0
  19. package/src/components/navbar/navbar.handlers.js +1 -1
  20. package/src/components/navbar/navbar.store.js +2 -2
  21. package/src/components/pageOutline/pageOutline.handlers.js +57 -17
  22. package/src/components/pageOutline/pageOutline.store.js +48 -3
  23. package/src/components/pageOutline/pageOutline.view.yaml +7 -5
  24. package/src/components/popoverInput/popoverInput.handlers.js +99 -0
  25. package/src/components/popoverInput/popoverInput.store.js +48 -0
  26. package/src/components/popoverInput/popoverInput.view.yaml +55 -0
  27. package/src/components/select/select.handlers.js +120 -12
  28. package/src/components/select/select.store.js +86 -20
  29. package/src/components/select/select.view.yaml +40 -10
  30. package/src/components/sidebar/sidebar.handlers.js +6 -6
  31. package/src/components/sidebar/sidebar.store.js +6 -6
  32. package/src/components/sidebar/sidebar.view.yaml +1 -1
  33. package/src/components/sliderInput/sliderInput.handlers.js +23 -6
  34. package/src/components/sliderInput/sliderInput.store.js +3 -2
  35. package/src/components/sliderInput/sliderInput.view.yaml +3 -2
  36. package/src/components/table/table.handlers.js +10 -10
  37. package/src/components/table/table.store.js +4 -4
  38. package/src/components/tabs/tabs.handlers.js +10 -0
  39. package/src/components/tabs/tabs.store.js +29 -0
  40. package/src/components/tabs/tabs.view.yaml +64 -0
  41. package/src/components/tooltip/tooltip.handlers.js +0 -0
  42. package/src/components/tooltip/tooltip.store.js +12 -0
  43. package/src/components/tooltip/tooltip.view.yaml +27 -0
  44. package/src/components/waveform/waveform.handlers.js +92 -0
  45. package/src/components/waveform/waveform.store.js +17 -0
  46. package/src/components/waveform/waveform.view.yaml +38 -0
  47. package/src/deps/createGlobalUI.js +39 -0
  48. package/src/entry-iife-layout.js +3 -0
  49. package/src/entry-iife-ui.js +4 -0
  50. package/src/index.js +7 -1
  51. package/src/primitives/button.js +10 -0
  52. package/src/primitives/colorPicker.js +13 -4
  53. package/src/primitives/dialog.js +254 -0
  54. package/src/primitives/image.js +4 -3
  55. package/src/primitives/input.js +17 -4
  56. package/src/primitives/popover.js +280 -0
  57. package/src/primitives/slider.js +14 -4
  58. package/src/primitives/svg.js +2 -0
  59. package/src/primitives/textarea.js +25 -1
  60. package/src/primitives/view.js +132 -13
  61. package/src/setup.js +7 -2
  62. package/src/styles/cursorStyles.js +38 -2
  63. package/src/components/dialog/dialog.handlers.js +0 -5
  64. package/src/components/dialog/dialog.store.js +0 -25
  65. package/src/components/dialog/dialog.view.yaml +0 -48
  66. package/src/components/popover/popover.handlers.js +0 -5
  67. package/src/components/popover/popover.store.js +0 -12
  68. package/src/components/popover/popover.view.yaml +0 -57
@@ -1,24 +1,24 @@
1
- var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(t[l]||"")}),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,l]of Object.entries(V)){r!=="default"&&(s+=`${l} {`);for(let[i,o]of Object.entries(e)){let a=t[i]?` ${t[i]} `:" ";for(let[h,g]of Object.entries(o)){let u=I[i],f=g.startsWith("--")?`var(${g})`:g,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}="${h}"])${a}{
3
- ${D}
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}`,k=s==="default"?`h-${n}`:`${s}-h-${n}`;if(g){let M=g.split(" ").map(A=>`${A}: ${m};`).join(" ");e+=`
2
+ :host([${b}="${h}"])${c}{
3
+ ${M}
4
4
  }
5
- :host([${T}="${h}"]:hover)${a}{
6
- ${D}
5
+ :host([${k}="${h}"]:hover)${c}{
6
+ ${M}
7
7
  }
8
- `}else s+=`
9
- :host([${v}="${h}"])${a}{
10
- ${g}
8
+ `}else e+=`
9
+ :host([${b}="${h}"])${c}{
10
+ ${d}
11
11
  }
12
- :host([${T}="${h}"]:hover)${a}{
13
- ${g}
12
+ :host([${k}="${h}"]:hover)${c}{
13
+ ${d}
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,l]of Object.entries(V)){r!=="default"&&(s+=`${l} {
16
- `);let i="";for(let[o,a]of Object.entries(e[r]))a!=null&&(i+=`${o}: ${a};
17
- `);s+=`${t} {
18
- ${i.trim()}
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;
17
+ `);e+=`${t} {
18
+ ${l.trim()}
19
19
  }
20
- `,r!=="default"&&(s+=`}
21
- `)}return s}var S=d`
20
+ `,o!=="default"&&(e+=`}
21
+ `)}return e}var _=a`
22
22
  :host([flex="0"]) {
23
23
  flex: 0;
24
24
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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 lt={mt:r,mr:r,mb:r,ml:r,m:r,mh:r,mv:r,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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 _=d`
107
+ `}},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`
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 d(e,...t){let s="";return e.forEach((r,l)=>{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(d`
117
+ `;var j=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
118
118
  :host {
119
119
  display: contents;
120
120
  }
@@ -250,15 +250,15 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
250
250
  gap: 0;
251
251
  }
252
252
 
253
- ${_}
253
+ ${S}
254
254
 
255
255
  a {
256
256
  display: contents;
257
257
  }
258
258
 
259
- ${L}
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 l=this.getAttribute("target");l&&r.setAttribute("target",l),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},l=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let a={sm:14,lg:22},h=this.getAttribute("s");i=a[h]||18}else i=r[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",l),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=d`
259
+ ${N}
260
+ ${_}
261
+ `))}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","t","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("t")]||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`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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=d`
332
+ `;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 K=a`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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"},dt={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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",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(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(d`
390
+ `},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 W=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
391
391
  slot {
392
392
  display: contents;
393
393
  }
@@ -406,13 +406,13 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
406
406
  flex-wrap: wrap;
407
407
  }
408
408
 
409
- ${S}
410
- ${U}
411
- ${H}
412
- ${b}
413
- ${m}
414
- ${k}
415
409
  ${_}
410
+ ${K}
411
+ ${R}
412
+ ${v}
413
+ ${f}
414
+ ${C}
415
+ ${S}
416
416
 
417
417
  :host([href]) {
418
418
  cursor: pointer;
@@ -427,7 +427,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),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),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="flex !important")});let l=w(this._styles);l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l)}},q=({render:e,html:t})=>C;var nt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
430
+ `))}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",k=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")),k&&(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 A=this.hasAttribute(s("sh")),I=this.hasAttribute(s("sv")),it=this.getAttribute(s("overflow"));A&&I?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):A?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):I&&(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()}},F=({render:i,html:t})=>W;var gt={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 d(e,...t){let s="";return e.forEach((r,l)=>{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(d`
470
+ `}},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 D=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -498,11 +498,11 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
498
498
  bottom: 0;
499
499
  z-index: 1;
500
500
  }
501
- ${N}
502
- ${A}
503
- ${b}
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(d`
501
+ ${Q}
502
+ ${$}
503
+ ${v}
504
+ ${f}
505
+ `))}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})=>D;var O=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
506
506
  :host {
507
507
  border-style: solid;
508
508
  box-sizing: border-box;
@@ -526,7 +526,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
526
526
  width: 100%;
527
527
  }
528
528
 
529
- ${_}
529
+ ${S}
530
530
 
531
531
  a {
532
532
  display: block;
@@ -538,10 +538,10 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
538
538
  cursor: pointer;
539
539
  }
540
540
 
541
- ${k}
542
- ${b}
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}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),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),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let l=w(this._styles);l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l),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=d`
541
+ ${C}
542
+ ${v}
543
+ ${f}
544
+ `))}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`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -657,15 +657,16 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{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(d`
660
+ `;var T=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
661
661
  :host {
662
662
  color: var(--foreground);
663
663
  }
664
- ${A}
665
- ${Q}
666
- ${S}
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(d`
664
+ ${$}
665
+ ${X}
666
+ ${v}
667
+ ${_}
668
+ ${f}
669
+ `))}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 H=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
669
670
  :host {
670
671
  display: contents;
671
672
  }
@@ -698,9 +699,9 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
698
699
  input:disabled {
699
700
  cursor: not-allowed;
700
701
  }
701
- ${b}
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","value","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){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 o=v=>`${i==="default"?"":`${i}-`}${v}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),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),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let l=w(this._styles,"input");l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.getAttribute("value"),l=this.getAttribute("step"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r!==null&&(this._inputElement.value=r),l!==null?this._inputElement.setAttribute("step",l):this._inputElement.removeAttribute("step"),i?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(d`
702
+ ${v}
703
+ ${f}
704
+ `))}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==="key"&&e!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._inputElement.value=n??""});return}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(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("placeholder"),s=this.getAttribute("value"),o=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),e!==null?this._inputElement.setAttribute("placeholder",e):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),o!==null?this._inputElement.setAttribute("step",o):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Z=({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`
704
705
  :host {
705
706
  display: contents;
706
707
  }
@@ -723,6 +724,77 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(
723
724
  textarea:focus {
724
725
  border-color: var(--foreground);
725
726
  }
726
- ${b}
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({}));})();
727
+ ${v}
728
+ ${f}
729
+ `))}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})=>B;var L=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(a`
730
+ :host {
731
+ display: contents;
732
+ }
733
+
734
+ dialog {
735
+ padding: 0;
736
+ border: none;
737
+ background: transparent;
738
+ margin: auto;
739
+ overflow-y: scroll;
740
+ color: inherit;
741
+ max-height: 100vh;
742
+ height: 100vh;
743
+ max-width: 100vw;
744
+ scrollbar-width: none;
745
+ outline: none;
746
+ }
747
+
748
+ dialog::backdrop {
749
+ background-color: rgba(0, 0, 0, 0.5);
750
+ }
751
+
752
+ slot[name="content"] {
753
+ background-color: var(--background) !important;
754
+ display: block;
755
+ padding: var(--spacing-lg);
756
+ border: 1px solid var(--border);
757
+ border-radius: var(--border-radius-md);
758
+ margin-left: var(--spacing-lg);
759
+ margin-right: var(--spacing-lg);
760
+ width: fit-content;
761
+ max-width: calc(100vw - 2 * var(--spacing-lg));
762
+ /* Default margins will be set dynamically via JavaScript for adaptive centering */
763
+ margin-top: 40px;
764
+ margin-bottom: 40px;
765
+ }
766
+
767
+ /* Size attribute styles */
768
+ :host([s="sm"]) slot[name="content"] {
769
+ width: 33vw;
770
+ }
771
+
772
+ :host([s="md"]) slot[name="content"] {
773
+ width: 50vw;
774
+ }
775
+
776
+ :host([s="lg"]) slot[name="content"] {
777
+ width: 80vw;
778
+ }
779
+
780
+ :host([s="f"]) slot[name="content"] {
781
+ width: 100vw;
782
+ margin-left: 0;
783
+ margin-right: 0;
784
+ }
785
+
786
+ @keyframes dialog-in {
787
+ from {
788
+ opacity: 0;
789
+ transform: scale(0.95);
790
+ }
791
+ to {
792
+ opacity: 1;
793
+ transform: scale(1);
794
+ }
795
+ }
796
+
797
+ dialog[open] slot[name="content"] {
798
+ animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
799
+ }
800
+ `))}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._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,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})=>L;customElements.define("rtgl-button",P({}));customElements.define("rtgl-view",F({}));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({}));})();