@rettangoli/ui 0.1.16 → 0.1.18
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.
|
@@ -67,6 +67,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
|
|
|
67
67
|
font-weight: var(--xs-font-weight);
|
|
68
68
|
line-height: var(--xs-line-height);
|
|
69
69
|
letter-spacing: var(--xs-letter-spacing);
|
|
70
|
+
gap: var(--spacing-sm);
|
|
70
71
|
`,md:`
|
|
71
72
|
height: 32px;
|
|
72
73
|
padding-left: 16px;
|
|
@@ -76,6 +77,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
|
|
|
76
77
|
font-weight: var(--sm-font-weight);
|
|
77
78
|
line-height: var(--sm-line-height);
|
|
78
79
|
letter-spacing: var(--sm-letter-spacing);
|
|
80
|
+
gap: var(--spacing-md);
|
|
79
81
|
`,lg:`
|
|
80
82
|
height: 40px;
|
|
81
83
|
padding-left: 20px;
|
|
@@ -85,6 +87,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
|
|
|
85
87
|
font-weight: var(--md-font-weight);
|
|
86
88
|
line-height: var(--md-line-height);
|
|
87
89
|
letter-spacing: var(--md-letter-spacing);
|
|
90
|
+
gap: var(--spacing-md);
|
|
88
91
|
`},v:{pr:`
|
|
89
92
|
background-color: var(--primary);
|
|
90
93
|
color: var(--primary-foreground);
|
|
@@ -127,7 +130,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
|
|
|
127
130
|
flex-direction: row;
|
|
128
131
|
align-items: center;
|
|
129
132
|
justify-content: center;
|
|
130
|
-
gap: var(--spacing-
|
|
133
|
+
gap: var(--spacing-md);
|
|
131
134
|
border-width: 0px;
|
|
132
135
|
border-style: solid;
|
|
133
136
|
border-color: var(--border);
|
|
@@ -258,7 +261,7 @@ var rettangoli=(()=>{function a(i,...t){let e="";return i.forEach((s,o)=>{e+=s+(
|
|
|
258
261
|
|
|
259
262
|
${N}
|
|
260
263
|
${_}
|
|
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","
|
|
264
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,e,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let e=this.getAttribute("href");if(e){let s=document.createElement("a");s.setAttribute("href",e);let o=this.getAttribute("target");o&&s.setAttribute("target",o),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let e={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},o=e[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let c={sm:14,lg:22},h=this.getAttribute("s");n=c[h]||18}else n=s[this.getAttribute("s")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",o),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=p(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}getBoundingClientRect(){return this._buttonElement?this._buttonElement.getBoundingClientRect():super.getBoundingClientRect()}},P=({render:i,html:t})=>j;var R=a`
|
|
262
265
|
|
|
263
266
|
:host([d="h"]) {
|
|
264
267
|
flex-direction: row;
|