rettangoli-ui 0.0.10 → 0.1.0-rc1
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.
- package/README.md +28 -599
- package/dist/rettangoli-iife-layout.min.js +252 -245
- package/dist/rettangoli-iife-ui.min.js +517 -276
- package/package.json +10 -5
- package/LICENSE +0 -21
- package/dist/rettangoli-esm.min.js +0 -645
@@ -1,24 +1,24 @@
|
|
1
|
-
var rettangoli=(()=>{var{isArray:
|
2
|
-
:host([${
|
3
|
-
${
|
1
|
+
var rettangoli=(()=>{var{isArray:it}=Array,{getPrototypeOf:Rt,getOwnPropertyDescriptor:Wt}=Object,y=[],nt=()=>document.createRange(),E=(e,t,r)=>(e.set(t,r),r),Ot=(e,t)=>t.reduceRight(Et,e),Et=(e,t)=>e.childNodes[t],{setPrototypeOf:zt}=Object,k,at=(e,t,r)=>(k||(k=nt()),r?k.setStartAfter(e):k.setStartBefore(e),k.setEndAfter(t),k.deleteContents(),e),J=({firstChild:e,lastChild:t},r)=>at(e,t,r),lt=!1,Q=(e,t)=>lt&&e.nodeType===11?1/t<0?t?J(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,et=e=>document.createComment(e),X=class extends(t=>{function r(n){return zt(n,new.target.prototype)}return r.prototype=t.prototype,r})(DocumentFragment){#e=et("<>");#r=et("</>");#t=y;constructor(t){super(t),this.replaceChildren(this.#e,...t.childNodes,this.#r),lt=!0}get firstChild(){return this.#e}get lastChild(){return this.#r}get parentNode(){return this.#e.parentNode}remove(){J(this,!1)}replaceWith(t){J(this,!0).replaceWith(t)}valueOf(){let{parentNode:t}=this;if(t===this)this.#t===y&&(this.#t=[...this.childNodes]);else{if(t){let{firstChild:r,lastChild:n}=this;for(this.#t=[r];r!==n;)this.#t.push(r=r.nextSibling)}this.replaceChildren(...this.#t)}return this}},ht=(e,t,r)=>e.setAttribute(t,r),I=(e,t)=>e.removeAttribute(t),T,Nt=(e,t,r)=>{r=r.slice(1),T||(T=new WeakMap);let n=T.get(e)||E(T,e,{}),o=n[r];return o&&o[0]&&e.removeEventListener(r,...o),o=it(t)?t:[t,!1],n[r]=o,o[0]&&e.addEventListener(r,...o),t},z=(e,t)=>{let{t:r,n}=e,o=!1;switch(typeof t){case"object":if(t!==null){(n||r).replaceWith(e.n=t.valueOf());break}case"undefined":o=!0;default:r.data=o?"":t,n&&(e.n=null,n.replaceWith(r))}return t},L=(e,t,r)=>e[r]=t,Tt=(e,t,r)=>L(e,t,r.slice(1)),Y=(e,t,r)=>t==null?(I(e,r),t):L(e,t,r),ct=(e,t)=>(typeof t=="function"?t(e):t.current=e,t),G=(e,t,r)=>(t==null?I(e,r):ht(e,r,t),t),Bt=(e,t,r)=>(e.toggleAttribute(r.slice(1),t),t),V=(e,t,r)=>{let{length:n}=t;if(e.data=`[${n}]`,n)return((o,i,l,s,d)=>{let p=l.length,g=i.length,h=p,a=0,c=0,u=null;for(;a<g||c<h;)if(g===a){let m=h<p?c?s(l[c-1],-0).nextSibling:s(l[h],0):d;for(;c<h;)o.insertBefore(s(l[c++],1),m)}else if(h===c)for(;a<g;)u&&u.has(i[a])||o.removeChild(s(i[a],-1)),a++;else if(i[a]===l[c])a++,c++;else if(i[g-1]===l[h-1])g--,h--;else if(i[a]===l[h-1]&&l[c]===i[g-1]){let m=s(i[--g],-0).nextSibling;o.insertBefore(s(l[c++],1),s(i[a++],-0).nextSibling),o.insertBefore(s(l[--h],1),m),i[g]=l[h]}else{if(!u){u=new Map;let m=c;for(;m<h;)u.set(l[m],m++)}if(u.has(i[a])){let m=u.get(i[a]);if(c<m&&m<h){let w=a,R=1;for(;++w<g&&w<h&&u.get(i[w])===m+R;)R++;if(R>m-c){let F=s(i[a],0);for(;c<m;)o.insertBefore(s(l[c++],1),F)}else o.replaceChild(s(l[c++],1),s(i[a++],-1))}else a++}else o.removeChild(s(i[a++],-1))}return l})(e.parentNode,r,t,Q,e);switch(r.length){case 1:r[0].remove();case 0:break;default:at(Q(r[0],0),Q(r.at(-1),-0),!1)}return y},Vt=new Map([["aria",(e,t)=>{for(let r in t){let n=t[r],o=r==="role"?r:`aria-${r}`;n==null?I(e,o):ht(e,o,n)}return t}],["class",(e,t)=>Y(e,t,t==null?"class":"className")],["data",(e,t)=>{let{dataset:r}=e;for(let n in t)t[n]==null?delete r[n]:r[n]=t[n];return t}],["ref",ct],["style",(e,t)=>t==null?Y(e,t,"style"):L(e.style,t,"cssText")]]),It=(e,t,r)=>{switch(t[0]){case".":return Tt;case"?":return Bt;case"@":return Nt;default:return r||"ownerSVGElement"in e?t==="ref"?ct:G:Vt.get(t)||(t in e?t.startsWith("on")?L:((n,o)=>{let i;do i=Wt(n,o);while(!i&&(n=Rt(n)));return i})(e,t)?.set?Y:G:G)}},Lt=(e,t)=>(e.textContent=t??"",t),O=(e,t,r)=>({a:e,b:t,c:r}),C=()=>O(null,null,y),dt=e=>(t,r)=>{let{a:n,b:o,c:i}=e(t,r),l=document.importNode(n,!0),s=y;if(o!==y){s=[];for(let a,c,u=0;u<o.length;u++){let{a:m,b:w,c:R}=o[u],F=m===c?a:a=Ot(l,c=m);s[u]=(d=w,p=F,g=R,h=w===V?[]:w===z?C():null,{v:y,u:d,t:p,n:g,c:h})}}var d,p,g,h;return((a,c)=>({b:a,c}))(i?l.firstChild:new X(l),s)},Dt=/^(?:plaintext|script|style|textarea|title|xmp)$/i,Ht=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,Pt=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,Ut=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,Ft=/[\x01\x02]/g,K,Z,B=document.createElement("template"),Qt=(e,t)=>{if(t)return K||(K=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z=nt(),Z.selectNodeContents(K)),Z.createContextualFragment(e);B.innerHTML=e;let{content:r}=B;return B=B.cloneNode(!1),r},q=e=>{let t=[],r;for(;r=e.parentNode;)t.push(t.indexOf.call(r.childNodes,e)),e=r;return t},rt=()=>document.createTextNode(""),Gt=(e,t,r)=>{let n=Qt(((d,p,g)=>{let h=0;return d.join("").trim().replace(Pt,(a,c,u,m)=>`<${c}${u.replace(Ut,"=$2$1").trimEnd()}${m?g||Ht.test(c)?" /":`></${c}`:""}>`).replace(Ft,a=>a===""?`<!--${p+h++}-->`:p+h++)})(e,W,r),r),{length:o}=e,i=y;if(o>1){let d=[],p=document.createTreeWalker(n,129),g=0,h=`${W}${g++}`;for(i=[];g<o;){let a=p.nextNode();if(a.nodeType===8){if(a.data===h){let c=it(t[g-1])?V:z;c===z&&d.push(a),i.push(O(q(a),c,null)),h=`${W}${g++}`}}else{let c;for(;a.hasAttribute(h);){c||(c=q(a));let u=a.getAttribute(h);i.push(O(c,It(a,u,r),u)),I(a,h),h=`${W}${g++}`}!r&&Dt.test(a.localName)&&a.textContent.trim()===`<!--${h}-->`&&(i.push(O(c||q(a),Lt,null)),h=`${W}${g++}`)}}for(g=0;g<d.length;g++)d[g].replaceWith(rt())}let{childNodes:l}=n,{length:s}=l;return s<1?(s=1,n.appendChild(rt())):s===1&&o!==1&&l[0].nodeType!==1&&(s=0),E(gt,e,O(n,i,s===1))},gt=new WeakMap,W="is\xB5",pt=e=>(t,r)=>gt.get(t)||Gt(t,r,e),Kt=dt(pt(!1)),Zt=dt(pt(!0)),tt=(e,{s:t,t:r,v:n})=>{if(e.a!==r){let{b:o,c:i}=(t?Zt:Kt)(r,n);e.a=r,e.b=o,e.c=i}for(let{c:o}=e,i=0;i<o.length;i++){let l=n[i],s=o[i];switch(s.u){case V:s.v=V(s.t,qt(s.c,l),s.v);break;case z:let d=l instanceof $?tt(s.c||(s.c=C()),l):(s.c=null,l);d!==s.v&&(s.v=z(s,d));break;default:l!==s.v&&(s.v=s.u(s.t,l,s.n,s.v))}}return e.b},qt=(e,t)=>{let r=0,{length:n}=t;for(n<e.length&&e.splice(n);r<n;r++){let o=t[r];o instanceof $?t[r]=tt(e[r]||(e[r]=C()),o):e[r]=null}return t},$=class{constructor(t,r,n){this.s=t,this.t=r,this.v=n}toDOM(t=C()){return tt(t,this)}};var ft=e=>(t,...r)=>new $(e,t,r),A=ft(!1),ae=ft(!0),st=new WeakMap,_=(e,t)=>((r,n)=>{let o=st.get(r)||E(st,r,C()),{b:i}=o,l=typeof n=="function"?n():n,s=l instanceof $?l.toDOM(o):l;return i!==s&&r.replaceChildren((o.b=s).valueOf()),r})(e,t),ot=new WeakMap,ut=e=>(t,r)=>{let n=ot.get(t)||E(ot,t,new Map);return n.get(r)||E(n,r,function(o,...i){return new $(e,o,i).toDOM(this)}.bind(C()))},le=ut(!1),he=ut(!0);function v(e,...t){let r="";return e.forEach((n,o)=>{r+=n+(t[o]||"")}),r}var Jt=["xs","sm","md","lg","xl"],mt={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"},vt=Object.keys(mt),bt=e=>e.concat(Jt.flatMap(t=>e.map(r=>`${t}-${r}`))),xt={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)"},x=(e,t={})=>{let r="";for(let[n,o]of Object.entries(xt)){n!=="default"&&(r+=`${o} {`);for(let[i,l]of Object.entries(e)){let s=t[i]?` ${t[i]} `:" ";for(let[d,p]of Object.entries(l)){let g=mt[i],h=p.startsWith("--")?`var(${p})`:p,a=n==="default"?i:`${n}-${i}`,c=n==="default"?`h-${i}`:`${n}-h-${i}`;if(g){let m=g.split(" ").map(w=>`${w}: ${h};`).join(" ");r+=`
|
2
|
+
:host([${a}="${d}"])${s}{
|
3
|
+
${m}
|
4
4
|
}
|
5
|
-
:host([${
|
6
|
-
${
|
5
|
+
:host([${c}="${d}"]:hover)${s}{
|
6
|
+
${m}
|
7
7
|
}
|
8
|
-
`}else
|
9
|
-
:host([${
|
10
|
-
${
|
8
|
+
`}else r+=`
|
9
|
+
:host([${a}="${d}"])${s}{
|
10
|
+
${p}
|
11
11
|
}
|
12
|
-
:host([${
|
13
|
-
${
|
12
|
+
:host([${c}="${d}"]:hover)${s}{
|
13
|
+
${p}
|
14
14
|
}
|
15
|
-
`}}
|
16
|
-
`);let
|
15
|
+
`}}n!=="default"&&(r+="}")}return r};function Xt(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Yt=e=>/%$/.test(e),b=e=>{if(e!==void 0)return Yt(e)?e:Xt(e)?`${e}px`:Object.keys(f).includes(e)?`var(${f[e]})`:e},f={xs:"--spacing-xs",s:"--spacing-s",m:"--spacing-m",l:"--spacing-l",xl:"--spacing-xl"};function D(e){let t="";for(let[r,n]of Object.entries(xt)){r!=="default"&&(t+=`${n} {
|
16
|
+
`);let o="";for(let[i,l]of Object.entries(e[r]))l!=null&&(o+=`${i}: ${l};
|
17
17
|
`);t+=`:host {
|
18
|
-
${
|
18
|
+
${o.trim()}
|
19
19
|
}
|
20
|
-
`,
|
21
|
-
`)}return t}var
|
20
|
+
`,r!=="default"&&(t+=`}
|
21
|
+
`)}return t}var j=v`
|
22
22
|
:host([flex="0"]) {
|
23
23
|
flex: 0;
|
24
24
|
}
|
@@ -58,7 +58,53 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
58
58
|
:host([flex="12"]) {
|
59
59
|
flex: 12;
|
60
60
|
}
|
61
|
-
`;var
|
61
|
+
`;var te={mt:f,mr:f,mb:f,ml:f,m:f,mh:f,mv:f,s:{sm:`
|
62
|
+
height: 28px;
|
63
|
+
padding-left: 12px;
|
64
|
+
padding-right: 12px;
|
65
|
+
border-radius: 4px;
|
66
|
+
font-size: var(--xs-font-size);
|
67
|
+
font-weight: var(--xs-font-weight);
|
68
|
+
line-height: var(--xs-line-height);
|
69
|
+
letter-spacing: var(--xs-letter-spacing);
|
70
|
+
`,md:`
|
71
|
+
height: 32px;
|
72
|
+
padding-left: 16px;
|
73
|
+
padding-right: 16px;
|
74
|
+
border-radius: 4px;
|
75
|
+
font-size: var(--sm-font-size);
|
76
|
+
font-weight: var(--sm-font-weight);
|
77
|
+
line-height: var(--sm-line-height);
|
78
|
+
letter-spacing: var(--sm-letter-spacing);
|
79
|
+
`,lg:`
|
80
|
+
height: 40px;
|
81
|
+
padding-left: 20px;
|
82
|
+
padding-right: 20px;
|
83
|
+
border-radius: 4px;
|
84
|
+
font-size: var(--md-font-size);
|
85
|
+
font-weight: var(--md-font-weight);
|
86
|
+
line-height: var(--md-line-height);
|
87
|
+
letter-spacing: var(--md-letter-spacing);
|
88
|
+
`},v:{pr:`
|
89
|
+
background-color: var(--primary);
|
90
|
+
color: var(--primary-foreground);
|
91
|
+
`,se:`
|
92
|
+
background-color: var(--secondary);
|
93
|
+
color: var(--secondary-foreground);
|
94
|
+
`,de:`
|
95
|
+
background-color: var(--destructive);
|
96
|
+
color: var(--primary-foreground);
|
97
|
+
`,ol:`
|
98
|
+
background-color: transparent;
|
99
|
+
color: var(--foreground);
|
100
|
+
border-width: 1px;
|
101
|
+
`,gh:`
|
102
|
+
background-color: transparent;
|
103
|
+
color: var(--foreground);
|
104
|
+
`,lk:`
|
105
|
+
background-color: transparent;
|
106
|
+
color: var(--foreground);
|
107
|
+
`}},ee={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},wt=x(te,ee);var yt=({render:e,html:t})=>{let r=new CSSStyleSheet;return r.replaceSync(v`
|
62
108
|
:host {
|
63
109
|
display: contents;
|
64
110
|
}
|
@@ -67,160 +113,137 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
67
113
|
}
|
68
114
|
|
69
115
|
button {
|
116
|
+
display: flex;
|
117
|
+
flex-direction: row;
|
118
|
+
align-items: center;
|
119
|
+
justify-content: center;
|
120
|
+
gap: var(--spacing-s);
|
121
|
+
border-width: 0px;
|
70
122
|
border-style: solid;
|
123
|
+
border-color: var(--border);
|
71
124
|
padding: 0px;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
125
|
+
height: 32px;
|
126
|
+
padding-left: 16px;
|
127
|
+
padding-right: 16px;
|
128
|
+
border-radius: 4px;
|
77
129
|
|
78
|
-
|
79
|
-
|
80
|
-
|
130
|
+
font-size: var(--sm-font-size);
|
131
|
+
font-weight: var(--sm-font-weight);
|
132
|
+
line-height: var(--sm-line-height);
|
133
|
+
letter-spacing: var(--sm-letter-spacing);
|
81
134
|
|
82
|
-
|
83
|
-
|
84
|
-
:host([t="pl"]) button {
|
85
|
-
color: var(--color-on-primary);
|
86
|
-
border-color: var(--color-primary);
|
87
|
-
background-color: var(--color-primary);
|
135
|
+
background-color: var(--primary);
|
136
|
+
color: var(--primary-foreground);
|
88
137
|
}
|
89
138
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
:host([t="ps"]) button:active,
|
98
|
-
:host([t="p"]) button:active,
|
99
|
-
:host([t="pl"]) button:active {
|
100
|
-
border-color: var(--color-primary-active);
|
101
|
-
background-color: var(--color-primary-active);
|
139
|
+
button:hover {
|
140
|
+
cursor: pointer;
|
141
|
+
background-color: color-mix(
|
142
|
+
in srgb,
|
143
|
+
var(--primary) 85%,
|
144
|
+
white 15%
|
145
|
+
);
|
102
146
|
}
|
103
147
|
|
104
|
-
:
|
105
|
-
|
106
|
-
:host([t="sl"]) button {
|
107
|
-
color: var(--color-on-secondary);
|
108
|
-
border-color: var(--color-secondary);
|
109
|
-
background-color: var(--color-secondary);
|
148
|
+
button:disabled {
|
149
|
+
cursor: not-allowed;
|
110
150
|
}
|
111
151
|
|
112
|
-
:
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
152
|
+
button:active {
|
153
|
+
cursor: pointer;
|
154
|
+
background-color: color-mix(
|
155
|
+
in srgb,
|
156
|
+
var(--primary) 80%,
|
157
|
+
white 20%
|
158
|
+
);
|
117
159
|
}
|
118
160
|
|
119
|
-
:host([
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
161
|
+
:host([v="pr"]) button:hover {
|
162
|
+
background-color: color-mix(
|
163
|
+
in srgb,
|
164
|
+
var(--primary) 85%,
|
165
|
+
white 15%
|
166
|
+
);
|
124
167
|
}
|
125
168
|
|
126
|
-
:host([
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
169
|
+
:host([v="pr"]) button:active {
|
170
|
+
background-color: color-mix(
|
171
|
+
in srgb,
|
172
|
+
var(--primary) 80%,
|
173
|
+
white 20%
|
174
|
+
);
|
132
175
|
}
|
133
176
|
|
134
|
-
:host([
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
177
|
+
:host([v="se"]) button:hover {
|
178
|
+
background-color: color-mix(
|
179
|
+
in srgb,
|
180
|
+
var(--secondary) 85%,
|
181
|
+
white 15%
|
182
|
+
);
|
139
183
|
}
|
140
184
|
|
141
|
-
:host([
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
185
|
+
:host([v="se"]) button:active {
|
186
|
+
background-color: color-mix(
|
187
|
+
in srgb,
|
188
|
+
var(--secondary) 80%,
|
189
|
+
white 20%
|
190
|
+
);
|
146
191
|
}
|
147
192
|
|
148
|
-
:host([
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
193
|
+
:host([v="de"]) button:hover {
|
194
|
+
background-color: color-mix(
|
195
|
+
in srgb,
|
196
|
+
var(--destructive) 85%,
|
197
|
+
white 15%
|
198
|
+
);
|
154
199
|
}
|
155
200
|
|
156
|
-
:host([
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
201
|
+
:host([v="de"]) button:active {
|
202
|
+
background-color: color-mix(
|
203
|
+
in srgb,
|
204
|
+
var(--destructive) 80%,
|
205
|
+
white 20%
|
206
|
+
);
|
161
207
|
}
|
162
208
|
|
163
|
-
:host([
|
164
|
-
|
165
|
-
:host([t="nl"]) button:active {
|
166
|
-
background-color: var(--color-surface-container-high);
|
167
|
-
border-color: var(--color-surface-container-high);
|
209
|
+
:host([v="ol"]) button:hover {
|
210
|
+
background-color: var(--accent);
|
168
211
|
}
|
169
212
|
|
170
|
-
:host([
|
171
|
-
|
172
|
-
:host([t="es"]) button,
|
173
|
-
:host([t="ns"]) button {
|
174
|
-
height: var(--button-height-s);
|
175
|
-
padding-left: var(--button-padding-horizontal-s);
|
176
|
-
padding-right: var(--button-padding-horizontal-s);
|
177
|
-
border-radius: var(--button-border-radius-s);
|
213
|
+
:host([v="gh"]) button:hover {
|
214
|
+
background-color: var(--accent);
|
178
215
|
}
|
179
216
|
|
180
|
-
:host([
|
181
|
-
|
182
|
-
:host([t="e"]) button,
|
183
|
-
:host([t="n"]) button {
|
184
|
-
height: var(--button-height-m);
|
185
|
-
padding-left: var(--button-padding-horizontal-m);
|
186
|
-
padding-right: var(--button-padding-horizontal-m);
|
187
|
-
border-radius: var(--button-border-radius-m);
|
217
|
+
:host([v="lk"]) button:hover {
|
218
|
+
text-decoration: underline;
|
188
219
|
}
|
189
220
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
padding-left: var(--button-padding-horizontal-l);
|
196
|
-
padding-right: var(--button-padding-horizontal-l);
|
197
|
-
border-radius: var(--button-border-radius-l);
|
198
|
-
font-size: var(--typography-label-l-font-size);
|
199
|
-
font-weight: var(--typography-label-l-font-weight);
|
200
|
-
line-height: var(--typography-label-l-line-height);
|
201
|
-
letter-spacing: var(--typography-label-l-letter-spacing);
|
202
|
-
}
|
203
|
-
${vt}
|
204
|
-
${M}
|
205
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o],e(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t"]}_buttonRef={};_assingRef=s=>{this._buttonRef.current=s;let i=b(this.getAttribute("w"));i==="f"?this._buttonRef.current.style.width="100%":i!=null&&(this._buttonRef.current.style.width=i)};attributeChangedCallback(s,i,a){if(!this._buttonRef.current)return;let r=b(this.getAttribute("w"));r==="f"?this._buttonRef.current.style.width="100%":r!=null&&(this._buttonRef.current.style.width=r,this._buttonRef.current.style.minWidth=r,this._buttonRef.current.style.maxWidth=r),e(this.shadow,this.render)}render=()=>this.getAttribute("href")?t`
|
221
|
+
${wt}
|
222
|
+
${j}
|
223
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[r],e(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled"]}_buttonRef={};_assingRef=o=>{this._buttonRef.current=o;let i=b(this.getAttribute("w"));i==="f"?this._buttonRef.current.style.width="100%":i!=null&&(this._buttonRef.current.style.width=i)};attributeChangedCallback(o,i,l){if(!this._buttonRef.current)return;let s=b(this.getAttribute("w"));s==="f"?this._buttonRef.current.style.width="var(--width-stretch)":s!=null&&(this._buttonRef.current.style.width=s,this._buttonRef.current.style.minWidth=s,this._buttonRef.current.style.maxWidth=s),e(this.shadow,this.render)}renderIcon=()=>{let o=this.getAttribute("icon"),i={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},l={sm:14,md:18,lg:22},s=i[this.getAttribute("v")]||"pr-fg",d=l[this.getAttribute("t")]||18;return o?t`
|
224
|
+
<rtgl-svg svg="${o}" c="${s}" wh="${d}"></rtgl-svg>
|
225
|
+
`:t``};render=()=>{let o=this.hasAttribute("disabled");return this.getAttribute("href")?t`
|
206
226
|
<a
|
207
227
|
href=${this.getAttribute("href")}
|
208
228
|
target=${this.getAttribute("target")}
|
229
|
+
style="text-decoration: none; display: contents; color: inherit;"
|
209
230
|
>
|
210
|
-
<button>
|
231
|
+
<button disabled="${o}">
|
232
|
+
${this.renderIcon()}
|
211
233
|
<slot></slot>
|
212
234
|
</button>
|
213
235
|
</a>
|
214
236
|
`:t`
|
215
|
-
<button ref=${this._assingRef}>
|
237
|
+
<button ref=${this._assingRef} disabled="${o}">
|
238
|
+
${this.renderIcon()}
|
216
239
|
<slot></slot>
|
217
240
|
</button>
|
218
|
-
`}};var
|
241
|
+
`}}};var St=v`
|
219
242
|
|
220
243
|
:host([d="h"]) {
|
221
244
|
flex-direction: row;
|
222
245
|
}
|
223
|
-
:host(
|
246
|
+
:host([d="v"]) {
|
224
247
|
flex-direction: column;
|
225
248
|
}
|
226
249
|
:host([d="h"]:not([ah])) {
|
@@ -228,7 +251,6 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
228
251
|
}
|
229
252
|
:host([d="h"][ah="c"]) {
|
230
253
|
justify-content: center;
|
231
|
-
/* align-content: center; */
|
232
254
|
}
|
233
255
|
:host([d="h"][ah="e"]) {
|
234
256
|
justify-content: flex-end;
|
@@ -244,26 +266,34 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
244
266
|
align-items: flex-end;
|
245
267
|
align-content: flex-end;
|
246
268
|
}
|
247
|
-
|
269
|
+
|
270
|
+
/* Default/vertical direction - horizontal alignment */
|
271
|
+
:host(:not([d]):not([ah])),
|
272
|
+
:host([d="v"]:not([ah])) {
|
248
273
|
align-items: flex-start;
|
249
274
|
}
|
250
|
-
:host(:not([d])[ah="c"])
|
275
|
+
:host(:not([d])[ah="c"]),
|
276
|
+
:host([d="v"][ah="c"]) {
|
251
277
|
align-items: center;
|
252
|
-
align-content: center;
|
253
278
|
}
|
254
|
-
:host(:not([d])[ah="e"])
|
279
|
+
:host(:not([d])[ah="e"]),
|
280
|
+
:host([d="v"][ah="e"]) {
|
255
281
|
align-items: flex-end;
|
256
|
-
align-content: flex-end;
|
257
282
|
}
|
258
|
-
|
283
|
+
|
284
|
+
:host(:not([d]):not([av])),
|
285
|
+
:host([d="v"]:not([av])) {
|
259
286
|
justify-content: flex-start;
|
260
287
|
}
|
261
|
-
:host(:not([d])[av="c"])
|
288
|
+
:host(:not([d])[av="c"]),
|
289
|
+
:host([d="v"][av="c"]) {
|
262
290
|
justify-content: center;
|
263
291
|
}
|
264
|
-
:host(:not([d])[av="e"])
|
292
|
+
:host(:not([d])[av="e"]),
|
293
|
+
:host([d="v"][av="e"]) {
|
265
294
|
justify-content: flex-end;
|
266
295
|
}
|
296
|
+
|
267
297
|
@media screen and (max-width: 640px) {
|
268
298
|
:host([s-d="v"]) {
|
269
299
|
flex-direction: column;
|
@@ -279,7 +309,7 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
279
309
|
justify-content: center;
|
280
310
|
}
|
281
311
|
}
|
282
|
-
`;var
|
312
|
+
`;var re={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},S=x(re);var $t=v`
|
283
313
|
:host([sh]:not([sv])) {
|
284
314
|
overflow-x: scroll;
|
285
315
|
flex-wrap: nowrap;
|
@@ -297,43 +327,20 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
297
327
|
flex-wrap: nowrap;
|
298
328
|
}
|
299
329
|
|
300
|
-
`;var N={xs:"--border-width-xs",s:"--border-width-s",m:"--border-width-m",l:"--border-width-l",xl:"--border-width-xl"},
|
301
|
-
background-color: var(--
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
color: var(--
|
306
|
-
`,
|
307
|
-
background-color: var(--
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
color: var(--
|
312
|
-
`,
|
313
|
-
background-color: var(--
|
314
|
-
color: var(--color-on-error);
|
315
|
-
`,ec:`
|
316
|
-
background-color: var(--color-error-container);
|
317
|
-
color: var(--color-on-error-container);
|
318
|
-
`,su:`
|
319
|
-
background-color: var(--color-surface);
|
320
|
-
color: var(--color-on-surface);
|
321
|
-
`,sucl:`
|
322
|
-
background-color: var(--color-surface-container-low);
|
323
|
-
color: var(--color-on-surface);
|
324
|
-
`,suc:`
|
325
|
-
background-color: var(--color-surface-container);
|
326
|
-
color: var(--color-on-surface);
|
327
|
-
`,such:`
|
328
|
-
background-color: var(--color-surface-container-high);
|
329
|
-
color: var(--color-on-surface);
|
330
|
-
`,isu:`
|
331
|
-
background-color: var(--color-inverse-surface);
|
332
|
-
color: var(--color-inverse-on-surface);
|
333
|
-
`,o:`
|
334
|
-
background-color: var(--color-outline);
|
335
|
-
`,ov:`
|
336
|
-
background-color: var(--color-outline-variant);
|
330
|
+
`;var N={xs:"--border-width-xs",s:"--border-width-s",m:"--border-width-m",l:"--border-width-l",xl:"--border-width-xl"},se={bgc:{pr:`
|
331
|
+
background-color: var(--primary);
|
332
|
+
`,se:`
|
333
|
+
background-color: var(--secondary);
|
334
|
+
`,de:`
|
335
|
+
background-color: var(--destructive);
|
336
|
+
`,bg:`
|
337
|
+
background-color: var(--background);
|
338
|
+
`,mu:`
|
339
|
+
background-color: var(--muted);
|
340
|
+
`,ac:`
|
341
|
+
background-color: var(--accent);
|
342
|
+
`,bo:`
|
343
|
+
background-color: var(--border);
|
337
344
|
`},pos:{rel:"relative",abs:"absolute",fix:"fixed"},cor:{full:`
|
338
345
|
top: 0;
|
339
346
|
right: 0;
|
@@ -358,86 +365,83 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
358
365
|
left: 0;
|
359
366
|
top: 0;
|
360
367
|
height: 100%;
|
361
|
-
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:
|
368
|
+
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:f,pr:f,pb:f,pl:f,p:f,ph:f,pv:f,g:f,gv:f,gh:f,bw:N,bwt:N,bwr:N,bwb:N,bwl:N,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},br:{xs:"--border-radius-xs",s:"--border-radius-s",m:"--border-radius-m",l:"--border-radius-l",xl:"--border-radius-xl",f:"--border-radius-f"}},H=x(se);var oe={mt:f,mr:f,mb:f,ml:f,m:f,mh:f,mv:f},M=x(oe);var kt=({render:e,html:t})=>{let r=new CSSStyleSheet;return r.replaceSync(v`
|
362
369
|
slot {
|
363
370
|
display: contents;
|
364
371
|
}
|
365
372
|
:host {
|
366
373
|
display: flex;
|
374
|
+
flex-direction: column;
|
367
375
|
align-self: auto;
|
368
376
|
align-content: flex-start;
|
369
|
-
flex-wrap: wrap;
|
370
377
|
border-style: solid;
|
371
378
|
border-width: 0;
|
372
379
|
box-sizing: border-box;
|
380
|
+
border-color: var(--border);
|
373
381
|
}
|
374
|
-
|
375
|
-
|
382
|
+
|
383
|
+
:host([fw="w"]) {
|
384
|
+
flex-wrap: wrap;
|
376
385
|
}
|
377
|
-
|
378
|
-
${
|
379
|
-
|
380
|
-
${
|
386
|
+
|
387
|
+
${j}
|
388
|
+
${$t}
|
389
|
+
${St}
|
390
|
+
${M}
|
381
391
|
${S}
|
382
|
-
${
|
383
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[
|
392
|
+
${H}
|
393
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[r],e(this.shadow,this.render)}static get observedAttributes(){return bt([...vt,"wh","w","h","hidden","sh","sv"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(o,i,l){["default","sm","md","lg","xl"].forEach(s=>{let d=u=>`${s==="default"?"":`${s}-`}${u}`,p=this.getAttribute(d("wh")),g=b(p===null?this.getAttribute(d("w")):p),h=b(p===null?this.getAttribute(d("h")):p),a=this.getAttribute(d("o")),c=this.getAttribute(d("z"));c!==null&&(this._styles[s]["z-index"]=c),a!==null&&(this._styles[s].opacity=a),g==="f"?this._styles[s].width="var(--width-stretch)":g!==void 0&&(this._styles[s].width=g,this._styles[s]["min-width"]=g,this._styles[s]["max-width"]=g),h==="f"?this._styles[s].height="100%":h!==void 0&&(this._styles[s].height=h,this._styles[s]["min-height"]=h,this._styles[s]["max-height"]=h),this.hasAttribute(d("hidden"))&&(this._styles[s].display="none !important"),this.hasAttribute(d("visible"))&&(this._styles[s].display="flex !important")}),e(this.shadow,this.render)}render=()=>t`
|
384
394
|
<style>
|
385
395
|
${D(this._styles)}
|
386
396
|
</style>
|
387
397
|
<slot></slot>
|
388
|
-
`}};var
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
font-size: var(--typography-label-l-font-size);
|
430
|
-
font-weight: var(--typography-label-l-font-weight);
|
431
|
-
line-height: var(--typography-label-l-line-height);
|
432
|
-
letter-spacing: var(--typography-label-l-letter-spacing);
|
433
|
-
`,lm:`
|
434
|
-
font-size: var(--typography-label-m-font-size);
|
435
|
-
font-weight: var(--typography-label-m-font-weight);
|
436
|
-
line-height: var(--typography-label-m-line-height);
|
437
|
-
letter-spacing: var(--typography-label-m-letter-spacing);
|
438
|
-
`}},St=y(ne,ie);var ae={c:"color"},le={c:{"on-p":"--color-on-primary","on-pc":"--color-on-primary-container","on-s":"--color-on-secondary","on-sc":"--color-on-secondary-container","on-su":"--color-on-surface","on-su-v":"--color-on-surface-variant","i-on-su":"--color-inverse-on-surface","on-e":"--color-on-error","on-ec":"--color-on-error-container"}},P=y(ae,le);var $t=({render:e,html:t})=>{let o=new CSSStyleSheet;o.replaceSync(v`
|
398
|
+
`}};var ie={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
|
399
|
+
font-size: var(--h1-font-size);
|
400
|
+
font-weight: var(--h1-font-weight);
|
401
|
+
line-height: var(--h1-line-height);
|
402
|
+
letter-spacing: var(--h1-letter-spacing);
|
403
|
+
`,h2:`
|
404
|
+
font-size: var(--h2-font-size);
|
405
|
+
font-weight: var(--h2-font-weight);
|
406
|
+
line-height: var(--h2-line-height);
|
407
|
+
letter-spacing: var(--h2-letter-spacing);
|
408
|
+
`,h3:`
|
409
|
+
font-size: var(--h3-font-size);
|
410
|
+
font-weight: var(--h3-font-weight);
|
411
|
+
line-height: var(--h3-line-height);
|
412
|
+
letter-spacing: var(--h3-letter-spacing);
|
413
|
+
`,h4:`
|
414
|
+
font-size: var(--h4-font-size);
|
415
|
+
font-weight: var(--h4-font-weight);
|
416
|
+
line-height: var(--h4-line-height);
|
417
|
+
letter-spacing: var(--h4-letter-spacing);
|
418
|
+
`,lg:`
|
419
|
+
font-size: var(--lg-font-size);
|
420
|
+
font-weight: var(--lg-font-weight);
|
421
|
+
line-height: var(--lg-line-height);
|
422
|
+
letter-spacing: var(--lg-letter-spacing);
|
423
|
+
`,md:`
|
424
|
+
font-size: var(--md-font-size);
|
425
|
+
font-weight: var(--md-font-weight);
|
426
|
+
line-height: var(--md-line-height);
|
427
|
+
letter-spacing: var(--md-letter-spacing);
|
428
|
+
`,sm:`
|
429
|
+
font-size: var(--sm-font-size);
|
430
|
+
font-weight: var(--sm-font-weight);
|
431
|
+
line-height: var(--sm-line-height);
|
432
|
+
letter-spacing: var(--sm-letter-spacing);
|
433
|
+
`,xs:`
|
434
|
+
font-size: var(--xs-font-size);
|
435
|
+
font-weight: var(--xs-font-weight);
|
436
|
+
line-height: var(--xs-line-height);
|
437
|
+
letter-spacing: var(--xs-letter-spacing);
|
438
|
+
`}},Ct=x(ie);var ne={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},P=x(ne);var At=({render:e,html:t})=>{let r=new CSSStyleSheet;r.replaceSync(v`
|
439
439
|
:host {
|
440
440
|
display: block;
|
441
|
+
font-size: var(--md-font-size);
|
442
|
+
font-weight: var(--md-font-weight);
|
443
|
+
line-height: var(--md-line-height);
|
444
|
+
letter-spacing: var(--md-letter-spacing);
|
441
445
|
}
|
442
446
|
slot {
|
443
447
|
display: contents;
|
@@ -450,11 +454,11 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
450
454
|
text-decoration: var(--anchor-text-decoration-hover);
|
451
455
|
color: var(--anchor-color-hover);
|
452
456
|
}
|
453
|
-
${
|
457
|
+
${Ct}
|
454
458
|
${P}
|
455
|
-
${
|
459
|
+
${M}
|
456
460
|
${S}
|
457
|
-
`);class n extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[
|
461
|
+
`);class n extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[r]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){e(this.shadow,this.render)}attributeChangedCallback(i,l,s){let d=b(this.getAttribute("w"));this.hasAttribute("ellipsis")&&(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"),d==="f"?this.style.width="var(--width-stretch)":d!==void 0&&(this.style.width=d),e(this.shadow,this.render)}render=()=>t` <slot></slot> `}return n};var _t=({render:e,html:t})=>{let r=new CSSStyleSheet;return r.replaceSync(v`
|
458
462
|
:host {
|
459
463
|
border-style: solid;
|
460
464
|
box-sizing: border-box;
|
@@ -477,10 +481,10 @@ ${S}
|
|
477
481
|
height: 100%;
|
478
482
|
width: 100%;
|
479
483
|
}
|
480
|
-
${
|
481
|
-
${
|
484
|
+
${H}
|
485
|
+
${M}
|
482
486
|
${S}
|
483
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[
|
487
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[r]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};static get observedAttributes(){return["key","src","wh","w","h","hidden","height","width","s-wh","s-w","s-h"]}connectedCallback(){e(this.shadow,this.render)}attributeChangedCallback(o,i,l){["default","sm","md","lg","xl"].forEach(s=>{let d=u=>`${s==="default"?"":`${s}-`}${u}`,p=this.getAttribute(d("wh")),g=b(p===null?this.getAttribute(d("w")):p),h=b(p===null?this.getAttribute(d("h")):p),a=this.getAttribute(d("o")),c=this.getAttribute(d("z"));c!==null&&(this._styles[s].zIndex=c),a!==null&&(this._styles[s].opacity=a),g==="f"?this._styles[s].width="var(--width-stretch)":g!==void 0&&(this._styles[s].width=g,this._styles[s]["min-width"]=g,this._styles[s]["max-width"]=g),h==="f"?this._styles[s].height="100%":h!==void 0&&(this._styles[s].height=h,this._styles[s]["min-height"]=h,this._styles[s]["max-height"]=h)}),e(this.shadow,this.render)}render=()=>t`
|
484
488
|
<style>
|
485
489
|
${D(this._styles)}
|
486
490
|
</style>
|
@@ -489,7 +493,7 @@ ${S}
|
|
489
493
|
width="${this.getAttribute("width")}"
|
490
494
|
height="${this.getAttribute("height")}"
|
491
495
|
/>
|
492
|
-
`}};var
|
496
|
+
`}};var jt=v`
|
493
497
|
:host([pt="xs"]) svg {
|
494
498
|
padding-top: var(--spacing-xs);
|
495
499
|
}
|
@@ -605,10 +609,13 @@ ${S}
|
|
605
609
|
padding-top: var(--spacing-xl);
|
606
610
|
padding-bottom: var(--spacing-xl);
|
607
611
|
}
|
608
|
-
`;var
|
612
|
+
`;var Mt=({render:e,html:t})=>{let r=new CSSStyleSheet;return r.replaceSync(v`
|
613
|
+
:host {
|
614
|
+
color: var(--foreground);
|
615
|
+
}
|
609
616
|
${P}
|
610
|
-
${
|
611
|
-
${
|
617
|
+
${jt}
|
618
|
+
${j}
|
612
619
|
${S}
|
613
|
-
`),class U extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[
|
620
|
+
`),class U extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[r]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return U._icons}static addIcon(o,i){U._icons[o]=i}connectedCallback(){this.render()}attributeChangedCallback(o,i,l){let s=this.getAttribute("wh"),d=b(s===null?this.getAttribute("w"):s),p=b(s===null?this.getAttribute("h"):s);d&&(this.style.width=d),p&&(this.style.height=p),this.render()}render=()=>{try{let o=this.getAttribute("svg"),i=U._icons[o]||(window.rtglIcons||{})[o];if(i){this.shadow.innerHTML=i;return}}catch(o){console.log("error in rtgl-svg render",o)}this.shadow.innerHTML=""}}};customElements.define("rtgl-button",yt({render:_,html:A}));customElements.define("rtgl-view",kt({render:_,html:A}));customElements.define("rtgl-text",At({render:_,html:A}));customElements.define("rtgl-image",_t({render:_,html:A}));customElements.define("rtgl-svg",Mt({render:_,html:A}));})();
|
614
621
|
/*! (c) Andrea Giammarchi - MIT */
|