@vanelsas/baredom 2.8.0 → 3.0.0
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/CHANGELOG.md +45 -0
- package/README.md +1 -1
- package/custom-elements.json +467 -0
- package/dist/baredom.d.ts +25 -0
- package/dist/base.js +541 -452
- package/dist/integrity.json +103 -97
- package/dist/x-alert.js +16 -17
- package/dist/x-avatar-group.js +9 -9
- package/dist/x-avatar.js +14 -15
- package/dist/x-badge.js +9 -9
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -13
- package/dist/x-button.js +1 -16
- package/dist/x-cancel-dialogue.js +13 -13
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +31 -31
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +1 -11
- package/dist/x-chip.js +1 -1
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +45 -44
- package/dist/x-combobox.js +26 -26
- package/dist/x-command-palette.js +24 -24
- package/dist/x-confetti.d.ts +50 -0
- package/dist/x-confetti.js +25 -0
- package/dist/x-container.js +5 -4
- package/dist/x-context-menu.js +20 -20
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.js +23 -23
- package/dist/x-date-picker.js +40 -40
- package/dist/x-divider.js +9 -9
- package/dist/x-drawer.js +9 -9
- package/dist/x-dropdown.js +11 -11
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +12 -12
- package/dist/x-grid.js +7 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +6 -6
- package/dist/x-image.js +16 -17
- package/dist/x-kbd.d.ts +17 -0
- package/dist/x-kbd.js +17 -0
- package/dist/x-kinetic-canvas.js +25 -25
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +33 -33
- package/dist/x-liquid-dock.js +38 -39
- package/dist/x-liquid-fill.js +44 -44
- package/dist/x-liquid-glass.js +47 -47
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +10 -9
- package/dist/x-metaball-cursor.js +26 -27
- package/dist/x-modal.js +10 -10
- package/dist/x-morph-stack.js +36 -37
- package/dist/x-multi-combobox.js +36 -36
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.js +32 -32
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-progress.js +37 -37
- package/dist/x-organic-shape.js +13 -13
- package/dist/x-otp-input.d.ts +55 -0
- package/dist/x-otp-input.js +23 -0
- package/dist/x-pagination.js +15 -15
- package/dist/x-particle-button.js +51 -51
- package/dist/x-popover.js +25 -26
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +10 -10
- package/dist/x-proximity-list.d.ts +43 -0
- package/dist/x-proximity-list.js +21 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +10 -10
- package/dist/x-scroll-parallax.js +18 -18
- package/dist/x-scroll-stack.js +17 -17
- package/dist/x-scroll-story.js +34 -34
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +38 -38
- package/dist/x-search-field.js +1 -15
- package/dist/x-select.js +1 -11
- package/dist/x-sidebar.js +15 -15
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +15 -15
- package/dist/x-soft-body.js +22 -22
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +12 -12
- package/dist/x-spotlight-card.d.ts +19 -0
- package/dist/x-spotlight-card.js +13 -0
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +18 -18
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +12 -12
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +19 -19
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -21
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +21 -22
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +12 -12
- package/dist/x-trace-history.d.ts +242 -0
- package/dist/x-trace-history.js +118 -0
- package/dist/x-typography.js +9 -9
- package/dist/x-welcome-tour.js +60 -59
- package/package.json +32 -2
package/dist/x-soft-body.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},
|
|
4
|
-
e.setAttribute("part","shape");f.setAttribute("part","content");d.appendChild(e);f.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(f);a.__xSoftBodyRefs=new $APP.
|
|
5
|
-
|
|
6
|
-
m[0]=d;q[0]=0;m[1]=b*.5;q[1]=0;m[2]=b-d;q[2]=0;m[3]=b-d+d*f;q[3]=d-d*e;m[4]=b-d+d*l;q[4]=d-d*h;m[5]=b;q[5]=d;m[6]=b;q[6]=c*.5;m[7]=b;q[7]=c-d;m[8]=b-d+d*e;q[8]=c-d+d*f;m[9]=b-d+d*h;q[9]=c-d+d*l;m[10]=b-d;q[10]=c;m[11]=b*.5;q[11]=c;m[12]=d;q[12]=c;m[13]=d-d*f;q[13]=c-d+d*e;m[14]=d-d*l;q[14]=c-d+d*h;m[15]=0;q[15]=c-d;m[16]=0;q[16]=c*.5;m[17]=0;q[17]=d;m[18]=d-d*e;q[18]=d-d*f;m[19]=d-d*h;q[19]=d-d*l;c=[m,q];b=c[0];c=c[1];d=new Float64Array(20);e=new Float64Array(20);f=new Float64Array(20);
|
|
7
|
-
for(l=0;;)if(l<20)d[l]=b[l],e[l]=c[l],f[l]=0,h[l]=0,l+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=f;a.__xSoftBodyVY=h},
|
|
8
|
-
a[f])/6;f=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var v=c[l]-c[h],x=a[l]-a[h];x=Math.sqrt(v*v+x*x)*.4;v=Math.sqrt(q*q+r*r);v=v>x?x/(v+.001):1;r=a[h]+r*v;var
|
|
9
|
-
b=$APP.C(b,$APP.
|
|
10
|
-
" "+$APP.
|
|
11
|
-
"__xSoftBodyLF",performance.now()),$APP.
|
|
12
|
-
|
|
13
|
-
b)},
|
|
14
|
-
null?this.removeAttribute("stiffness"):this.setAttribute("stiffness",""+$APP.
|
|
15
|
-
this.removeAttribute("radius"):this.setAttribute("radius",""+$APP.
|
|
16
|
-
null?this.removeAttribute("grab-radius"):this.setAttribute("grab-radius",""+$APP.
|
|
17
|
-
0;b=new ResizeObserver(function(c){if(c.length>0){var d=c[0].contentRect;c=d.width;d=d.height;if(c>0&&d>0){a.__xSoftBodyW=c;a.__xSoftBodyH=d;var e=$APP.
|
|
18
|
-
(b.disconnect(),a.__xSoftBodyRO=null);return null},
|
|
19
|
-
"grab-radius",771838535),
|
|
20
|
-
$APP.
|
|
21
|
-
":var(--x-color-border,#475569);"+$APP.
|
|
22
|
-
"__xSoftBodyCY"),x=$APP.k(a,"__xSoftBodyVX"),
|
|
23
|
-
|
|
2
|
+
var KW=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.A.j(a,""))return b;a=parseFloat(a);return $APP.n(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},LW=function(a,b,c,d,e,f){b=c+(e*(b-a)-f*c)*d;return[a+b*d,b]},Aaa=function(a,b,c,d,e,f,h){a=c-a;b=d-b;d=Math.sqrt(a*a+b*b);if(d<=.001||d>=e)return[0,0];e=1-d/e;f*=e*e*($APP.n(h)?50:20);return[a/d*f,b/d*f]},MW=function(){return $APP.D(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},Baa=function(a,b){for(var c=0;;){if(c>=
|
|
3
|
+
20)return!0;if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},Daa=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),e=document.createElementNS("http://www.w3.org/2000/svg","path"),f=document.createElement("div"),h=document.createElement("slot");c.textContent=Caa;d.setAttribute("part","svg");d.setAttribute("viewBox","0 0 300 200");d.setAttribute("preserveAspectRatio","none");d.setAttribute("aria-hidden",
|
|
4
|
+
"true");e.setAttribute("part","shape");f.setAttribute("part","content");d.appendChild(e);f.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(f);a.__xSoftBodyRefs=new $APP.O(null,4,[$APP.jj,b,$APP.po,d,$APP.lp,e,$APP.Im,f],null)},PW=function(a){a=new $APP.O(null,6,[$APP.zq,a.getAttribute("stiffness"),$APP.ir,a.getAttribute("damping"),$APP.On,a.getAttribute("radius"),$APP.Ko,a.getAttribute("intensity"),NW,a.getAttribute("grab-radius"),$APP.nn,a.getAttribute("disabled")],null);var b=$APP.G(a);
|
|
5
|
+
a=$APP.C(b,$APP.zq);var c=$APP.C(b,$APP.ir),d=$APP.C(b,$APP.On),e=$APP.C(b,$APP.Ko),f=$APP.C(b,NW);b=$APP.C(b,$APP.nn);return new $APP.O(null,6,[$APP.hq,KW(a,180,10,1E3),$APP.Zo,KW(c,12,1,100),$APP.dr,KW(d,16,6,200),$APP.Bo,KW(e,1,0,5),OW,KW(f,80,10,500),$APP.Bi,b!=null],null)},QW=function(a,b,c){var d=$APP.dr.i($APP.k(a,"__xSoftBodyModel"));d=Math.max(6,Math.min(d,Math.min(b,c)/2));var e=Math.cos(Math.PI/6),f=Math.sin(Math.PI/6),h=Math.cos(Math.PI/3),l=Math.sin(Math.PI/3),m=new Float64Array(20),
|
|
6
|
+
q=new Float64Array(20);m[0]=d;q[0]=0;m[1]=b*.5;q[1]=0;m[2]=b-d;q[2]=0;m[3]=b-d+d*f;q[3]=d-d*e;m[4]=b-d+d*l;q[4]=d-d*h;m[5]=b;q[5]=d;m[6]=b;q[6]=c*.5;m[7]=b;q[7]=c-d;m[8]=b-d+d*e;q[8]=c-d+d*f;m[9]=b-d+d*h;q[9]=c-d+d*l;m[10]=b-d;q[10]=c;m[11]=b*.5;q[11]=c;m[12]=d;q[12]=c;m[13]=d-d*f;q[13]=c-d+d*e;m[14]=d-d*l;q[14]=c-d+d*h;m[15]=0;q[15]=c-d;m[16]=0;q[16]=c*.5;m[17]=0;q[17]=d;m[18]=d-d*e;q[18]=d-d*f;m[19]=d-d*h;q[19]=d-d*l;c=[m,q];b=c[0];c=c[1];d=new Float64Array(20);e=new Float64Array(20);f=new Float64Array(20);
|
|
7
|
+
h=new Float64Array(20);for(l=0;;)if(l<20)d[l]=b[l],e[l]=c[l],f[l]=0,h[l]=0,l+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=f;a.__xSoftBodyVY=h},RW=function(a){var b=$APP.G($APP.k(a,"__xSoftBodyRefs"));b=$APP.C(b,$APP.lp);var c=$APP.k(a,"__xSoftBodyCX");a=$APP.k(a,"__xSoftBodyCY");var d=[];d.push("M"+$APP.V.i(c[0].toFixed(2))+","+$APP.V.i(a[0].toFixed(2)));for(var e=0;;)if(e<20){var f=$APP.qd(e+19,20),h=e,l=$APP.qd(e+1,20),m=$APP.qd(e+2,20),q=
|
|
8
|
+
(c[l]-c[f])/6,r=(a[l]-a[f])/6;f=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var v=c[l]-c[h],x=a[l]-a[h];x=Math.sqrt(v*v+x*x)*.4;v=Math.sqrt(q*q+r*r);v=v>x?x/(v+.001):1;r=a[h]+r*v;var z=Math.sqrt(f*f+m*m);x=z>x?x/(z+.001):1;f=c[l]-f*x;m=a[l]-m*x;d.push("C"+$APP.V.i((c[h]+q*v).toFixed(2))+","+$APP.V.i(r.toFixed(2))+" "+$APP.V.i(f.toFixed(2))+","+$APP.V.i(m.toFixed(2))+" "+$APP.V.i(c[l].toFixed(2))+","+$APP.V.i(a[l].toFixed(2)));e+=1}else break;d.push("Z");b.setAttribute("d",d.join(""))},SW=function(a){var b=$APP.G($APP.k(a,
|
|
9
|
+
"__xSoftBodyRefs"));b=$APP.C(b,$APP.lp);var c=$APP.k(a,"__xSoftBodyW"),d=$APP.k(a,"__xSoftBodyH");a=$APP.dr.i($APP.k(a,"__xSoftBodyModel"));a=Math.max(6,Math.min(a,Math.min(c,d)/2));var e=.5522847498*a;c="M"+$APP.V.i(a.toFixed(2))+",0L"+$APP.V.i((c-a).toFixed(2))+",0C"+$APP.V.i((c-a+e).toFixed(2))+",0 "+$APP.V.i(c.toFixed(2))+","+$APP.V.i((a-e).toFixed(2))+" "+$APP.V.i(c.toFixed(2))+","+$APP.V.i(a.toFixed(2))+"L"+$APP.V.i(c.toFixed(2))+","+$APP.V.i((d-a).toFixed(2))+"C"+$APP.V.i(c.toFixed(2))+","+
|
|
10
|
+
$APP.V.i((d-a+e).toFixed(2))+" "+$APP.V.i((c-a+e).toFixed(2))+","+$APP.V.i(d.toFixed(2))+" "+$APP.V.i((c-a).toFixed(2))+","+$APP.V.i(d.toFixed(2))+"L"+$APP.V.i(a.toFixed(2))+","+$APP.V.i(d.toFixed(2))+"C"+$APP.V.i((a-e).toFixed(2))+","+$APP.V.i(d.toFixed(2))+" 0,"+$APP.V.i((d-a+e).toFixed(2))+" 0,"+$APP.V.i((d-a).toFixed(2))+"L0,"+$APP.V.i(a.toFixed(2))+"C0,"+$APP.V.i((a-e).toFixed(2))+" "+$APP.V.i((a-e).toFixed(2))+",0 "+$APP.V.i(a.toFixed(2))+",0Z";b.setAttribute("d",c)},UW=function(a){$APP.n($APP.k(a,
|
|
11
|
+
"__xSoftBodyRaf"))||($APP.ja(a,"__xSoftBodyLF",performance.now()),$APP.ja(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return TW(a)})))},VW=function(a){var b=$APP.k(a,"__xSoftBodyRaf");$APP.n(b)&&(cancelAnimationFrame(b),a.__xSoftBodyRaf=null)},WW=function(a,b){var c=$APP.G($APP.k(a,"__xSoftBodyRefs"));c=$APP.C(c,$APP.po).getBoundingClientRect();a.__xSoftBodyPX=b.clientX-c.left;a.__xSoftBodyPY=b.clientY-c.top;return null},Eaa=function(a){function b(){a.__xSoftBodyGrab=!1;$APP.Nh(a,"x-soft-body-release",
|
|
12
|
+
{});return null}function c(h){a.__xSoftBodyGrab=!0;WW(a,h);$APP.Nh(a,"x-soft-body-grab",{});return null}function d(){a.__xSoftBodyPA=!1;a.__xSoftBodyGrab=!1;return null}function e(){a.__xSoftBodyPA=!0;var h=$APP.Bi.i($APP.k(a,"__xSoftBodyModel"));h=$APP.n(h)?h:MW();$APP.n(h)||UW(a);return null}function f(h){return WW(a,h)}$APP.ja(a,"__xSoftBodyHdl",{move:f,enter:e,leave:d,down:c,up:b});a.addEventListener("pointermove",f,{passive:!0});a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",
|
|
13
|
+
d);a.addEventListener("pointerdown",c);a.addEventListener("pointerup",b)},XW=function(a){var b=$APP.k(a,"__xSoftBodyHdl");$APP.n(b)&&(a.removeEventListener("pointermove",$APP.k(b,"move")),a.removeEventListener("pointerenter",$APP.k(b,"enter")),a.removeEventListener("pointerleave",$APP.k(b,"leave")),a.removeEventListener("pointerdown",$APP.k(b,"down")),a.removeEventListener("pointerup",$APP.k(b,"up")),a.__xSoftBodyHdl=null)},Faa=function(a){Object.defineProperty(a,"stiffness",{get:function(){var b=
|
|
14
|
+
this.getAttribute("stiffness");return KW(b,180,10,1E3)},set:function(b){return b==null?this.removeAttribute("stiffness"):this.setAttribute("stiffness",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"damping",{get:function(){var b=this.getAttribute("damping");return KW(b,12,1,100)},set:function(b){return b==null?this.removeAttribute("damping"):this.setAttribute("damping",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"radius",{get:function(){var b=
|
|
15
|
+
this.getAttribute("radius");return KW(b,16,6,200)},set:function(b){return b==null?this.removeAttribute("radius"):this.setAttribute("radius",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"intensity",{get:function(){var b=this.getAttribute("intensity");return KW(b,1,0,5)},set:function(b){return b==null?this.removeAttribute("intensity"):this.setAttribute("intensity",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"grabRadius",{get:function(){var b=
|
|
16
|
+
this.getAttribute("grab-radius");return KW(b,80,10,500)},set:function(b){return b==null?this.removeAttribute("grab-radius"):this.setAttribute("grab-radius",""+$APP.V.i(b))},enumerable:!0,configurable:!0});return Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},Gaa=function(a){var b=PW(a);a.__xSoftBodyModel=b;$APP.n($APP.k(a,"__xSoftBodyRefs"))||
|
|
17
|
+
Daa(a);a.__xSoftBodyPA=!1;a.__xSoftBodyGrab=!1;a.__xSoftBodyPX=0;a.__xSoftBodyPY=0;b=new ResizeObserver(function(c){if(c.length>0){var d=c[0].contentRect;c=d.width;d=d.height;if(c>0&&d>0){a.__xSoftBodyW=c;a.__xSoftBodyH=d;var e=$APP.G($APP.k(a,"__xSoftBodyRefs"));$APP.C(e,$APP.po).setAttribute("viewBox","0 0 "+$APP.V.i(c)+" "+$APP.V.i(d));QW(a,c,d);c=$APP.Bi.i($APP.k(a,"__xSoftBodyModel"));c=$APP.n(c)?c:MW();$APP.n(c)?SW(a):(RW(a),UW(a))}}return null});a.__xSoftBodyRO=b;b.observe(a);XW(a);Eaa(a);
|
|
18
|
+
return null},Haa=function(a){VW(a);XW(a);var b=$APP.k(a,"__xSoftBodyRO");$APP.n(b)&&(b.disconnect(),a.__xSoftBodyRO=null);return null},Iaa=function(a,b,c,d){$APP.I(c,d)&&$APP.n($APP.k(a,"__xSoftBodyRefs"))&&(b=PW(a),a.__xSoftBodyModel=b,c=$APP.k(a,"__xSoftBodyW"),d=$APP.k(a,"__xSoftBodyH"),$APP.n($APP.n(c)?$APP.n(d)?c>0&&d>0:d:c)&&(QW(a,c,d),b=$APP.Bi.i(b),b=$APP.n(b)?b:MW(),$APP.n(b)?(VW(a),SW(a)):(RW(a),UW(a))));return null},YW=function(){return $APP.Ah("x-soft-body",new $APP.O(null,5,[$APP.qh,
|
|
19
|
+
Jaa,$APP.oh,Gaa,$APP.lh,Haa,$APP.kh,Iaa,$APP.ph,Faa],null))},OW=new $APP.F(null,"grab-radius","grab-radius",771838535),NW=new $APP.F(null,"grab-radius-raw","grab-radius-raw",-1019405976);var Jaa="stiffness damping radius intensity grab-radius disabled".split(" ");$APP.ce(["x-soft-body-grab",new $APP.O(null,2,[$APP.U,$APP.de,$APP.Aq,!1],null),"x-soft-body-release",new $APP.O(null,2,[$APP.U,$APP.de,$APP.Aq,!1],null)]);var Caa=":host{display:block;position:relative;background:none;overflow:visible;"+$APP.V.i("--x-soft-body-bg")+":var(--x-color-surface,#ffffff);"+$APP.V.i("--x-soft-body-border")+":var(--x-color-border,#e2e8f0);"+$APP.V.i("--x-soft-body-border-width")+":1.5;"+$APP.V.i("--x-soft-body-shadow")+":var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.1));"+$APP.V.i("--x-soft-body-padding")+":1rem;}[part\x3dsvg]{display:block;width:100%;height:100%;position:absolute;inset:0;overflow:visible;pointer-events:none;}[part\x3dshape]{fill:var("+
|
|
20
|
+
$APP.V.i("--x-soft-body-bg")+",#ffffff);stroke:var("+$APP.V.i("--x-soft-body-border")+",#e2e8f0);stroke-width:var("+$APP.V.i("--x-soft-body-border-width")+",1.5);filter:drop-shadow(var("+$APP.V.i("--x-soft-body-shadow")+",0 1px 3px rgba(0,0,0,0.1)));}[part\x3dcontent]{position:relative;background:none;padding:var("+$APP.V.i("--x-soft-body-padding")+",1rem);z-index:1;}@media(prefers-color-scheme:dark){:host{"+$APP.V.i("--x-soft-body-bg")+":var(--x-color-surface,#1e293b);"+$APP.V.i("--x-soft-body-border")+
|
|
21
|
+
":var(--x-color-border,#475569);"+$APP.V.i("--x-soft-body-shadow")+":var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.3));}}@media(prefers-reduced-motion:reduce){[part\x3dshape]{transition:none!important;}}",TW=function TW(a){if($APP.n(a.isConnected)){var c=$APP.k(a,"__xSoftBodyModel"),d=performance.now(),e=Math.min(d-$APP.k(a,"__xSoftBodyLF"),100)/1E3,f=$APP.hq.i(c),h=$APP.Zo.i(c),l=$APP.Bo.i(c),m=OW.i(c);c=$APP.k(a,"__xSoftBodyRX");var q=$APP.k(a,"__xSoftBodyRY"),r=$APP.k(a,"__xSoftBodyCX"),v=$APP.k(a,
|
|
22
|
+
"__xSoftBodyCY"),x=$APP.k(a,"__xSoftBodyVX"),z=$APP.k(a,"__xSoftBodyVY"),B=$APP.k(a,"__xSoftBodyPA"),E=$APP.k(a,"__xSoftBodyPX"),H=$APP.k(a,"__xSoftBodyPY"),K=$APP.k(a,"__xSoftBodyGrab");a.__xSoftBodyLF=d;for(d=0;;)if(d<20){var J=c[d],P=q[d],ea=$APP.n(B)?Aaa(J,P,E,H,m,l,K):[0,0];J=LW(r[d],J+ea[0],x[d],e,f,h);P=LW(v[d],P+ea[1],z[d],e,f,h);r[d]=J[0];x[d]=J[1];v[d]=P[0];z[d]=P[1];d+=1}else break;RW(a);if($APP.n($APP.n(B)?B:!Baa(x,z)))$APP.ja(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return TW.i?
|
|
23
|
+
TW.i(a):TW.call(null,a)}));else{for(e=0;;)if(e<20)r[e]=c[e],v[e]=q[e],e+=1;else break;RW(a);a.__xSoftBodyRaf=null}}return null};$APP.ha("baredom.exports.x_soft_body.init",YW);export const init=YW;
|
package/dist/x-spacer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d=$APP.C(c
|
|
4
|
-
b.appendChild(c);a.__xSpacerRefs={root:b}}return
|
|
5
|
-
|
|
2
|
+
var XY=function(a){return a!=null&&$APP.I((""+$APP.V.i(a)).trim().toLowerCase(),"false")},bZ=function(a){var b=new $APP.O(null,3,[$APP.Vk,a.getAttribute("size"),YY,a.getAttribute("axis"),ZY,a.getAttribute("grow")],null);b=$APP.G(b);var c=$APP.C(b,$APP.Vk),d=$APP.C(b,YY);b=$APP.C(b,ZY);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.$c(Tca,d)?d:"vertical";b=new $APP.O(null,3,[$APP.ok,c,$Y,d,aZ,XY(b)],null);c=$APP.G(b);b=$APP.C(c,$APP.ok);
|
|
3
|
+
d=$APP.C(c,$Y);c=$APP.C(c,aZ);var e=a.style;$APP.S(a,"data-axis",d);$APP.S(a,"data-grow",$APP.n(c)?"true":"false");e.setProperty("--x-spacer-size",b);$APP.S(a,"role","none");$APP.S(a,"aria-hidden","true");return null},Uca=function(a){if(!$APP.n($APP.k(a,"__xSpacerRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=":host{display:block;flex-shrink:0;height:var(--x-spacer-size,1rem);width:0;pointer-events:none;}:host([data-axis\x3d'horizontal']){height:0;width:var(--x-spacer-size,1rem);}:host([data-grow\x3d'true']){flex:1 0 var(--x-spacer-size,0px);height:0;width:0;}";
|
|
4
|
+
b.appendChild(c);a.__xSpacerRefs={root:b}}return bZ(a)},Vca=function(){return null},Wca=function(a,b,c,d){b=$APP.I(c,d);return $APP.n(b?$APP.k(a,"__xSpacerRefs"):b)?bZ(a):null},Xca=function(a){return Object.defineProperty(a,"grow",{get:function(){return XY(this.getAttribute("grow"))},set:function(b){return $APP.n(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},Yca=function(a){$APP.Th(a,"size","size","1rem");$APP.Th(a,"axis","axis","vertical");return Xca(a)},
|
|
5
|
+
cZ=function(){return $APP.Ah("x-spacer",new $APP.O(null,5,[$APP.qh,Zca,$APP.oh,Uca,$APP.lh,Vca,$APP.kh,Wca,$APP.ph,Yca],null))},$Y=new $APP.F(null,"axis","axis",-1215390822),aZ=new $APP.F(null,"grow?","grow?",2124334580),ZY=new $APP.F(null,"grow-raw","grow-raw",441172903),YY=new $APP.F(null,"axis-raw","axis-raw",291213231);var Zca=["size","axis","grow"],Tca=new $APP.pg(null,new $APP.O(null,2,["vertical",null,"horizontal",null],null),null);$APP.ha("baredom.exports.x_spacer.init",cZ);export const init=cZ;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var C7=function(a){var b=new $APP.
|
|
3
|
-
|
|
4
|
-
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d)
|
|
5
|
-
"Loading"],null)],null);$APP.
|
|
2
|
+
var C7=function(a){var b=new $APP.O(null,3,[$APP.ok,a.getAttribute("size"),$APP.nk,a.getAttribute("variant"),$APP.Z,a.getAttribute("label")],null);var c=$APP.G(b),d=$APP.C(c,$APP.ok);b=$APP.C(c,$APP.nk);c=$APP.C(c,$APP.Z);d=typeof d==="string"&&$APP.$c(bka,d)?d:"md";b=typeof b==="string"&&$APP.$c(cka,b)?b:"default";c=typeof c==="string"&&$APP.I("",c.trim())?c.trim():"Loading";d=$APP.G(new $APP.O(null,3,[$APP.ok,d,$APP.nk,b,$APP.Z,c],null));b=$APP.C(d,$APP.ok);c=$APP.C(d,$APP.nk);d=$APP.C(d,$APP.Z);
|
|
3
|
+
$APP.S(a,"data-size",b);$APP.S(a,"data-variant",c);$APP.S(a,"aria-label",d)},dka=function(a){if(!$APP.n($APP.k(a,"__xSpinnerInit"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;justify-content:center;color-scheme:light dark;--x-spinner-size:24px;--x-spinner-color:currentColor;--x-spinner-track-color:rgba(0,0,0,0.12);--x-spinner-thickness:2px;--x-spinner-duration:0.75s;}@media (prefers-color-scheme:dark){:host{--x-spinner-track-color:rgba(255,255,255,0.15);}}:host([data-size\x3d'xs']){--x-spinner-size:16px;}:host([data-size\x3d'sm']){--x-spinner-size:20px;}:host([data-size\x3d'md']){--x-spinner-size:24px;}:host([data-size\x3d'lg']){--x-spinner-size:32px;}:host([data-size\x3d'xl']){--x-spinner-size:48px;}:host([data-variant\x3d'primary']){--x-spinner-color:var(--x-color-primary,#3b82f6);}:host([data-variant\x3d'success']){--x-spinner-color:var(--x-color-success,#22c55e);}:host([data-variant\x3d'warning']){--x-spinner-color:var(--x-color-warning,#f59e0b);}:host([data-variant\x3d'danger']){--x-spinner-color:var(--x-color-danger,#ef4444);}[part\x3dring]{display:block;width:var(--x-spinner-size);height:var(--x-spinner-size);border-radius:50%;border:var(--x-spinner-thickness) solid var(--x-spinner-track-color);border-top-color:var(--x-spinner-color);box-sizing:border-box;animation:x-spinner-spin var(--x-spinner-duration) linear infinite;}@keyframes x-spinner-spin{to{transform:rotate(360deg);}}@media (prefers-reduced-motion:reduce){[part\x3dring]{animation-play-state:paused;}}";
|
|
4
|
+
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);$APP.S(a,"role","status");$APP.S(a,"aria-live","polite");a.__xSpinnerRing=d;a.__xSpinnerInit=!0}C7(a);return null},eka=function(a,b,c,d){b=$APP.I(c,d);$APP.n(b?$APP.k(a,"__xSpinnerInit"):b)&&C7(a);return null},gka=function(a){return $APP.Zh(a,fka)},D7=function(){return $APP.Ah("x-spinner",new $APP.O(null,4,[$APP.qh,hka,$APP.oh,dka,$APP.kh,eka,$APP.ph,gka],null))};var hka=["size","variant","label"],bka=new $APP.pg(null,new $APP.O(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),cka=new $APP.pg(null,new $APP.O(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null),fka=new $APP.O(null,3,[$APP.ok,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"size",$APP.Yh,"md"],null),$APP.nk,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"variant",$APP.Yh,"default"],null),$APP.Z,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"label",
|
|
5
|
+
$APP.Yh,"Loading"],null)],null);$APP.ha("baredom.exports.x_spinner.init",D7);export const init=D7;
|
package/dist/x-splash.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var r_=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?null:$APP.Gl.j(0,$APP.Hl.j(100,a))):null},s_=function(a){return a==null?!0:$APP.I((""+$APP.V.i(a)).trim().toLowerCase(),"false")},w_=function(a){var b=$APP.k(a,"__xSplashRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("slot"),h=document.createElement("span"),l=document.createElement("div"),
|
|
3
3
|
m=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-splash-bg:var(--x-color-bg, #ffffff);--x-splash-color:var(--x-color-text, #0f172a);--x-splash-z-index:9999;--x-splash-fade-duration:var(--x-transition-duration, 400ms);--x-splash-fade-ease:cubic-bezier(0.4,0,0.2,1);--x-splash-spinner-size:40px;--x-splash-spinner-color:var(--x-color-text, currentColor);--x-splash-spinner-track-color:var(--x-color-border, rgba(0,0,0,0.12));--x-splash-spinner-thickness:3px;--x-splash-spinner-duration:0.75s;--x-splash-progress-height:4px;--x-splash-progress-color:var(--x-color-primary, #3b82f6);--x-splash-progress-track-color:var(--x-color-border, rgba(0,0,0,0.08));--x-splash-progress-radius:var(--x-radius-sm, 2px);--x-splash-gap:20px;--x-splash-blur-amount:8px;}@media (prefers-color-scheme:dark){:host{--x-splash-bg:var(--x-color-bg, #0f172a);--x-splash-color:var(--x-color-text, #f8fafc);--x-splash-spinner-track-color:var(--x-color-border, rgba(255,255,255,0.15));--x-splash-progress-track-color:var(--x-color-border, rgba(255,255,255,0.12));}}[part\x3doverlay]{position:fixed;inset:0;z-index:var(--x-splash-z-index);display:none;align-items:center;justify-content:center;background:var(--x-splash-bg);color:var(--x-splash-color);opacity:0;transition:opacity var(--x-splash-fade-duration) var(--x-splash-fade-ease);}:host([active]) [part\x3doverlay]{display:flex;opacity:1;}:host([data-fading-out]) [part\x3doverlay]{display:flex;opacity:0;}:host([data-variant\x3d'minimal']) [part\x3doverlay]{background:transparent;}:host([data-variant\x3d'branded']) [part\x3doverlay]{background:var(--x-splash-branded-bg,var(--x-splash-bg));}:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(255,255,255,0.7);backdrop-filter:blur(var(--x-splash-blur-amount));-webkit-backdrop-filter:blur(var(--x-splash-blur-amount));}@media (prefers-color-scheme:dark){:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(15,23,42,0.7);}}:host([data-overlay\x3d'transparent']) [part\x3doverlay]{background:transparent;}[part\x3dcontent]{display:flex;flex-direction:column;align-items:center;gap:var(--x-splash-gap);max-width:80vw;text-align:center;}[part\x3dspinner]{display:block;width:var(--x-splash-spinner-size);height:var(--x-splash-spinner-size);border:var(--x-splash-spinner-thickness) solid var(--x-splash-spinner-track-color);border-top-color:var(--x-splash-spinner-color);border-radius:50%;animation:x-splash-spin var(--x-splash-spinner-duration) linear infinite;box-sizing:border-box;}@keyframes x-splash-spin{to{transform:rotate(360deg);}}[part\x3dprogress]{display:none;width:min(300px,60vw);height:var(--x-splash-progress-height);background:var(--x-splash-progress-track-color);border-radius:var(--x-splash-progress-radius);overflow:hidden;}[part\x3dbar]{height:100%;background:var(--x-splash-progress-color);border-radius:var(--x-splash-progress-radius);transition:width 200ms ease;width:0%;}@media (prefers-reduced-motion:reduce){[part\x3doverlay]{transition:none !important;}[part\x3dspinner]{animation:none !important;}[part\x3dbar]{transition:none !important;}}";
|
|
4
|
-
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");l.setAttribute("part","progress");l.setAttribute("role","progressbar");l.setAttribute("aria-valuemin","0");l.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");l.appendChild(m);e.appendChild(f);e.appendChild(h);e.appendChild(l);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.
|
|
5
|
-
m],null);return $APP.k(a,"__xSplashRefs")},
|
|
6
|
-
400},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");l.setAttribute("part","progress");l.setAttribute("role","progressbar");l.setAttribute("aria-valuemin","0");l.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");l.appendChild(m);e.appendChild(f);e.appendChild(h);e.appendChild(l);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.O(null,6,[$APP.jj,b,t_,d,dea,e,u_,h,$APP.tn,l,v_,
|
|
5
|
+
m],null);return $APP.k(a,"__xSplashRefs")},eea=function(a){a=typeof a==="string"?a.trim():"";return $APP.A.j(a,"")||$APP.A.j(a,"0")||$APP.A.j(a,"0ms")||$APP.A.j(a,"0s")?0:$APP.n(a.endsWith("ms"))?(a=parseFloat(a.slice(0,a.length-2)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(a))):$APP.n(a.endsWith("s"))?(a=parseFloat(a.slice(0,a.length-1)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(1E3*a))):0},fea=function(a){a=window.getComputedStyle(a);a=eea(a.getPropertyValue("--x-splash-fade-duration"));return a>
|
|
6
|
+
0?a:400},x_=function(a){var b=$APP.k(a,"__xSplashFadeTimer");$APP.n(b)&&(clearTimeout(b),a.__xSplashFadeTimer=null)},y_=function(a){x_(a);a.__xSplashFadingOut=!1;$APP.T(a,"data-fading-out");var b=w_(a);b=$APP.G(b);$APP.C(b,t_).style.display="none";$APP.T(a,"aria-busy");$APP.Nh(a,"x-splash-hidden",{});return null},gea=function(a){if(!$APP.n($APP.k(a,"__xSplashFadingOut")))if(a.__xSplashFadingOut=!0,$APP.D(window.matchMedia("(prefers-reduced-motion:reduce)").matches))y_(a);else{var b=w_(a);b=$APP.G(b);
|
|
7
|
+
var c=$APP.C(b,t_),d=function h(f){return $APP.A.j(f.target,c)&&$APP.A.j(f.propertyName,"opacity")?(c.removeEventListener("transitionend",h),$APP.n($APP.k(a,"__xSplashFadingOut"))?y_(a):null):null};c.style.display="flex";c.style.opacity="1";$APP.S(a,"data-fading-out","");c.addEventListener("transitionend",d);requestAnimationFrame(function(){return requestAnimationFrame(function(){return $APP.n($APP.k(a,"__xSplashFadingOut"))?c.style.opacity="0":null})});$APP.ja(a,"__xSplashFadeTimer",setTimeout(function(){return $APP.n($APP.k(a,
|
|
8
|
+
"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),y_(a)):null},fea(a)+60))}},E_=function(a){var b=new $APP.O(null,5,[z_,a.hasAttribute("active"),$APP.Lp,a.getAttribute("variant"),$APP.fo,a.getAttribute("progress"),A_,a.getAttribute("spinner"),B_,a.getAttribute("overlay")],null);var c=$APP.G(b);b=$APP.C(c,z_);var d=$APP.C(c,$APP.Lp),e=$APP.C(c,$APP.fo),f=$APP.C(c,A_);c=$APP.C(c,B_);b=$APP.D(b);d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.$c(hea,d)?d:"default";e=r_(e);f=s_(f);
|
|
9
|
+
c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.$c(iea,c)?c:"solid";b=new $APP.O(null,5,[$APP.yk,b,$APP.nk,d,$APP.qq,e,C_,f,D_,c],null);if($APP.I($APP.k(a,"__xSplashModel"),b)){b=$APP.G(b);c=$APP.C(b,$APP.yk);e=$APP.C(b,$APP.nk);d=$APP.C(b,$APP.qq);var h=$APP.C(b,C_),l=$APP.C(b,D_);f=w_(a);var m=$APP.G(f);f=$APP.C(m,t_);var q=$APP.C(m,u_),r=$APP.C(m,$APP.tn),v=$APP.C(m,v_);m=$APP.k(a,"__xSplashModel");var x=$APP.yk.i(m);$APP.S(a,"data-variant",e);$APP.S(a,"data-overlay",l);q.style.display=
|
|
10
|
+
$APP.n(h)?"block":"none";d!=null?(r.style.display="block",v.style.width=""+$APP.V.i(d)+"%",r.setAttribute("aria-valuenow",""+$APP.V.i(d))):(r.style.display="none",r.removeAttribute("aria-valuenow"));$APP.n($APP.n(c)?$APP.p(x):c)?($APP.n($APP.k(a,"__xSplashFadingOut"))&&(x_(a),a.__xSplashFadingOut=!1,$APP.T(a,"data-fading-out"),c=w_(a),c=$APP.G(c),c=$APP.C(c,t_),c.style.display="",c.style.opacity=""),$APP.S(a,"aria-busy","true"),$APP.S(a,"aria-live","polite"),$APP.S(a,"role","status"),f.style.display=
|
|
11
|
+
"",f.style.opacity=""):(e=$APP.p(c),$APP.n(e?x:e)?gea(a):$APP.p(c)&&m==null&&(f.style.display="none",$APP.T(a,"aria-busy")));$APP.n(a.hasAttribute("aria-label"))||$APP.S(a,"aria-label","Loading");a.__xSplashModel=b}},jea=function(a){$APP.Sh(a,"active","active");$APP.Th(a,"variant","variant","default");Object.defineProperty(a,"progress",{get:function(){return r_(this.getAttribute("progress"))},set:function(b){return b==null?this.removeAttribute("progress"):this.setAttribute("progress",""+$APP.V.i(b))},
|
|
12
|
+
enumerable:!0,configurable:!0});Object.defineProperty(a,"spinner",{get:function(){return s_(this.getAttribute("spinner"))},set:function(b){return $APP.n(b)?this.setAttribute("spinner",""):this.setAttribute("spinner","false")},enumerable:!0,configurable:!0});return $APP.Th(a,"overlay","overlay","solid")},kea=function(a){w_(a);x_(a);E_(a);return null},lea=function(a){x_(a);return null},mea=function(a,b,c,d){$APP.I(c,d)&&E_(a);return null},F_=function(){return $APP.Ah("x-splash",new $APP.O(null,5,[$APP.qh,
|
|
13
|
+
nea,$APP.oh,kea,$APP.lh,lea,$APP.kh,mea,$APP.ph,jea],null))},t_=new $APP.F(null,"overlay-el","overlay-el",-308547109),dea=new $APP.F(null,"content-el","content-el",-1423019925),u_=new $APP.F(null,"spinner-el","spinner-el",-1536400516),v_=new $APP.F(null,"bar-el","bar-el",2050414242),C_=new $APP.F(null,"spinner?","spinner?",939139177),z_=new $APP.F(null,"active-present?","active-present?",73064660),A_=new $APP.F(null,"spinner-attr","spinner-attr",-479327548),B_=new $APP.F(null,"overlay-raw","overlay-raw",
|
|
14
|
+
1018775670),D_=new $APP.F(null,"overlay","overlay",-139131598);var nea=["active","variant","progress","spinner","overlay"];$APP.ce(["x-splash-hidden",new $APP.O(null,2,[$APP.U,$APP.de,$APP.Aq,!1],null)]);var hea=new $APP.pg(null,new $APP.O(null,3,["minimal",null,"branded",null,"default",null],null),null),iea=new $APP.pg(null,new $APP.O(null,3,["transparent",null,"solid",null,"blur",null],null),null);$APP.ha("baredom.exports.x_splash.init",F_);export const init=F_;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// x-spotlight-card.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XSpotlightCard extends HTMLElement {
|
|
6
|
+
variant: string;
|
|
7
|
+
radius: string;
|
|
8
|
+
padding: string;
|
|
9
|
+
color: string;
|
|
10
|
+
intensity: string;
|
|
11
|
+
size: string;
|
|
12
|
+
static: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"x-spotlight-card": XSpotlightCard;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var QX=function(a,b,c){return $APP.$c(b,a)?a:c},zba=function(a){if($APP.k(a,"__xSpotlightCardHandlers")==null){var b=function(){var f=$APP.k(a,"__xSpotlightCardCard");$APP.n(f)&&f.setAttribute("data-active","true");return null},c=function(){var f=$APP.k(a,"__xSpotlightCardCard");$APP.n(f)&&f.removeAttribute("data-active");return null},d=function(f){var h=a.getBoundingClientRect(),l=h.width,m=h.height;if(l>0&&m>0){m=(f.clientY-h.top)/m*100;var q=a.style;q.setProperty("--x-spotlight-card-x",""+$APP.V.i((f.clientX-
|
|
3
|
+
h.left)/l*100)+"%");q.setProperty("--x-spotlight-card-y",""+$APP.V.i(m)+"%")}return null},e={enter:b,leave:c,move:d};a.addEventListener("pointerenter",b,{passive:!0});a.addEventListener("pointerleave",c,{passive:!0});a.addEventListener("pointermove",d,{passive:!0});$APP.R(a,"__xSpotlightCardHandlers",e)}},RX=function(a){var b=$APP.k(a,"__xSpotlightCardHandlers");if($APP.n(b)){var c=$APP.k(b,"enter");$APP.n(c)&&a.removeEventListener("pointerenter",c);c=$APP.k(b,"leave");$APP.n(c)&&a.removeEventListener("pointerleave",
|
|
4
|
+
c);b=$APP.k(b,"move");$APP.n(b)&&a.removeEventListener("pointermove",b);$APP.R(a,"__xSpotlightCardHandlers",null)}},YX=function(a){var b=new $APP.O(null,8,[$APP.nk,a.getAttribute("variant"),$APP.dr,a.getAttribute("radius"),$APP.Xq,a.getAttribute("padding"),$APP.Un,a.getAttribute("color"),$APP.Bo,a.getAttribute("intensity"),$APP.ok,a.getAttribute("size"),SX,a.hasAttribute("static"),TX,$APP.p(window.matchMedia("(prefers-reduced-motion: reduce)").matches)],null);var c=$APP.G(b),d=$APP.C(c,$APP.nk),e=
|
|
5
|
+
$APP.C(c,$APP.dr),f=$APP.C(c,$APP.Xq),h=$APP.C(c,$APP.Un),l=$APP.C(c,$APP.Bo),m=$APP.C(c,$APP.ok);b=$APP.C(c,SX);c=$APP.C(c,TX);d=QX(d,Aba,"elevated");e=QX(e,Bba,"lg");f=QX(f,Cba,"md");h=QX(h,Dba,"primary");l=QX(l,Eba,"medium");m=QX(m,Fba,"md");b=$APP.D(b)||!$APP.D(c);b=$APP.Wf([$APP.Un,$APP.nk,$APP.dr,$APP.Bo,$APP.ok,$APP.cm,UX,$APP.Xq,$APP.ip,SX],[h,d,e,l,m,$APP.Hc(VX,h,$APP.C(VX,"primary")),$APP.Hc(WX,l,$APP.C(WX,"medium")),f,$APP.Hc(XX,m,$APP.C(XX,"md")),b]);$APP.I($APP.k(a,"__xSpotlightCardModel"),
|
|
6
|
+
b)&&(m=$APP.k(a,"__xSpotlightCardCard"),$APP.n(m)&&(m.setAttribute("data-variant",$APP.nk.i(b)),m.setAttribute("data-radius",$APP.dr.i(b)),m.setAttribute("data-padding",$APP.Xq.i(b)),$APP.n(SX.i(b))?m.setAttribute("data-static","true"):m.removeAttribute("data-static")),m=a.style,m.setProperty("--x-spotlight-card-color",$APP.cm.i(b)),m.setProperty("--x-spotlight-card-intensity",UX.i(b)),m.setProperty("--x-spotlight-card-size",$APP.ip.i(b)),$APP.n(SX.i(b))?(RX(a),m=$APP.k(a,"__xSpotlightCardCard"),
|
|
7
|
+
$APP.n(m)&&m.removeAttribute("data-active")):zba(a),$APP.R(a,"__xSpotlightCardModel",b));return null},Gba=function(a){if(!$APP.n($APP.k(a,"__xSpotlightCardMq"))){var b=window.matchMedia("(prefers-reduced-motion: reduce)"),c=function(){return YX(a)};b.addEventListener("change",c);$APP.R(a,"__xSpotlightCardMq",b);$APP.R(a,"__xSpotlightCardMqL",c)}return null},Hba=function(a){if(!$APP.Fh(a,"__xSpotlightCardInit")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent="\n :host {\n display: block;\n color-scheme: light dark;\n\n --x-spotlight-card-background: var(--x-color-surface, rgba(255, 255, 255, 0.92));\n --x-spotlight-card-color-fg: var(--x-color-text, #111827);\n --x-spotlight-card-border-color: var(--x-color-border, rgba(17, 24, 39, 0.12));\n --x-spotlight-card-shadow: var(--x-shadow-md, 0 10px 24px rgba(15, 23, 42, 0.10));\n\n --x-spotlight-card-padding-none: 0;\n --x-spotlight-card-padding-sm: 0.5rem;\n --x-spotlight-card-padding-md: 1rem;\n --x-spotlight-card-padding-lg: 1.5rem;\n\n --x-spotlight-card-radius-none: 0;\n --x-spotlight-card-radius-sm: var(--x-radius-sm, 0.375rem);\n --x-spotlight-card-radius-md: var(--x-radius-md, 0.75rem);\n --x-spotlight-card-radius-lg: var(--x-radius-lg, 1rem);\n --x-spotlight-card-radius-xl: 1.5rem;\n\n --x-spotlight-card-transition-duration: var(--x-transition-duration, 200ms);\n --x-spotlight-card-transition-timing: ease;\n\n --x-spotlight-card-x: 50%;\n --x-spotlight-card-y: 50%;\n }\n\n @media (prefers-color-scheme: dark) {\n :host {\n --x-spotlight-card-background: var(--x-color-surface, rgba(15, 23, 42, 0.88));\n --x-spotlight-card-color-fg: var(--x-color-text, #e5e7eb);\n --x-spotlight-card-border-color: var(--x-color-border, rgba(148, 163, 184, 0.24));\n --x-spotlight-card-shadow: var(--x-shadow-md, 0 16px 32px rgba(0, 0, 0, 0.32));\n }\n }\n\n .card {\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n display: block;\n min-width: 0;\n width: 100%;\n max-width: 100%;\n background: var(--x-spotlight-card-background);\n color: var(--x-spotlight-card-color-fg);\n border: 1px solid transparent;\n border-radius: var(--x-spotlight-card-radius-lg);\n transition:\n background var(--x-spotlight-card-transition-duration) var(--x-spotlight-card-transition-timing),\n box-shadow var(--x-spotlight-card-transition-duration) var(--x-spotlight-card-transition-timing),\n border-color var(--x-spotlight-card-transition-duration) var(--x-spotlight-card-transition-timing);\n }\n\n .card[data-variant\x3d'elevated'] {\n box-shadow: var(--x-spotlight-card-shadow);\n }\n\n .card[data-variant\x3d'bordered'] {\n border-color: var(--x-spotlight-card-border-color);\n box-shadow: none;\n }\n\n .card[data-padding\x3d'none'] { padding: var(--x-spotlight-card-padding-none); }\n .card[data-padding\x3d'sm'] { padding: var(--x-spotlight-card-padding-sm); }\n .card[data-padding\x3d'md'] { padding: var(--x-spotlight-card-padding-md); }\n .card[data-padding\x3d'lg'] { padding: var(--x-spotlight-card-padding-lg); }\n\n .card[data-radius\x3d'none'] { border-radius: var(--x-spotlight-card-radius-none); }\n .card[data-radius\x3d'sm'] { border-radius: var(--x-spotlight-card-radius-sm); }\n .card[data-radius\x3d'md'] { border-radius: var(--x-spotlight-card-radius-md); }\n .card[data-radius\x3d'lg'] { border-radius: var(--x-spotlight-card-radius-lg); }\n .card[data-radius\x3d'xl'] { border-radius: var(--x-spotlight-card-radius-xl); }\n\n .spotlight {\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n opacity: 0;\n transition: opacity var(--x-spotlight-card-transition-duration) var(--x-spotlight-card-transition-timing);\n background: radial-gradient(\n var(--x-spotlight-card-size, 200px) circle at\n var(--x-spotlight-card-x) var(--x-spotlight-card-y),\n color-mix(in srgb,\n var(--x-spotlight-card-color, transparent)\n calc(var(--x-spotlight-card-intensity, 0.18) * 100%),\n transparent),\n transparent 70%);\n }\n\n .card[data-active\x3d'true'] \x3e .spotlight,\n .card[data-static\x3d'true'] \x3e .spotlight {\n opacity: 1;\n }\n\n .content {\n position: relative;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .card { transition: none; }\n .spotlight { transition: none; opacity: 1; }\n }\n ";
|
|
8
|
+
var d=document.createElement("div");d.setAttribute("part","card");d.className="card";var e=document.createElement("div");e.setAttribute("part","spotlight");e.setAttribute("aria-hidden","true");e.className="spotlight";var f=document.createElement("div");f.setAttribute("part","content");f.className="content";f.appendChild(document.createElement("slot"));d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);$APP.R(a,"__xSpotlightCardRoot",b);$APP.R(a,"__xSpotlightCardStyle",c);$APP.R(a,
|
|
9
|
+
"__xSpotlightCardCard",d);$APP.R(a,"__xSpotlightCardInit",!0)}YX(a);return Gba(a)},Iba=function(a){RX(a);var b=$APP.k(a,"__xSpotlightCardMq");if($APP.n(b)){var c=$APP.k(a,"__xSpotlightCardMqL");$APP.n(c)&&b.removeEventListener("change",c);$APP.R(a,"__xSpotlightCardMq",null);$APP.R(a,"__xSpotlightCardMqL",null)}a=$APP.k(a,"__xSpotlightCardCard");return $APP.n(a)?a.removeAttribute("data-active"):null},Jba=function(a,b,c,d){return $APP.Fh(a,"__xSpotlightCardInit")&&$APP.I(c,d)?YX(a):null},Lba=function(a){return $APP.Zh(a,
|
|
10
|
+
Kba)},ZX=function(){return $APP.Ah("x-spotlight-card",new $APP.O(null,5,[$APP.qh,Mba,$APP.oh,Hba,$APP.lh,Iba,$APP.kh,Jba,$APP.ph,Lba],null))},UX=new $APP.F(null,"intensity-css","intensity-css",-407582157),SX=new $APP.F(null,"static?","static?",-1639874822),TX=new $APP.F(null,"motion-ok?","motion-ok?",-672193679);var Mba="variant radius padding color intensity size static".split(" "),Aba=new $APP.pg(null,new $APP.O(null,2,["elevated",null,"bordered",null],null),null),Bba=new $APP.pg(null,new $APP.O(null,5,["none",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),Cba=new $APP.pg(null,new $APP.O(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),Dba=new $APP.pg(null,new $APP.O(null,8,["success",null,"neutral",null,"warning",null,"secondary",null,"info",null,"primary",null,"danger",null,"accent",
|
|
11
|
+
null],null),null),Eba=new $APP.pg(null,new $APP.O(null,3,["medium",null,"soft",null,"strong",null],null),null),Fba=new $APP.pg(null,new $APP.O(null,4,["md",null,"lg",null,"xl",null,"sm",null],null),null),WX=new $APP.O(null,3,"soft 0.10 medium 0.18 strong 0.28".split(" "),null),XX=new $APP.O(null,4,"sm 140px md 200px lg 280px xl 360px".split(" "),null),VX=new $APP.O(null,8,"primary;var(--x-color-primary, #2563eb);secondary;var(--x-color-secondary, #64748b);success;var(--x-color-success, #16a34a);warning;var(--x-color-warning, #f59e0b);danger;var(--x-color-danger, #dc2626);info;var(--x-color-info, #0ea5e9);accent;var(--x-color-accent, #8b5cf6);neutral;var(--x-color-text, #111827)".split(";"),
|
|
12
|
+
null),Kba=new $APP.O(null,7,[$APP.nk,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"variant",$APP.Yh,"elevated"],null),$APP.dr,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"radius",$APP.Yh,"lg"],null),$APP.Xq,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"padding",$APP.Yh,"md"],null),$APP.Un,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"color",$APP.Yh,"primary"],null),$APP.Bo,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"intensity",$APP.Yh,"medium"],null),$APP.ok,new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"size",$APP.Yh,"md"],
|
|
13
|
+
null),$APP.go,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"static"],null)],null);$APP.ha("baredom.exports.x_spotlight_card.init",ZX);export const init=ZX;
|
package/dist/x-stat.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
d.setAttribute("part","base");e.setAttribute("part","icon");f.setAttribute("part","body");h.setAttribute("part","label");l.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");
|
|
8
|
-
d.appendChild(f);b.appendChild(c);b.appendChild(d)
|
|
9
|
-
793864247),
|
|
10
|
-
"up",null,"down",null],null),null),
|
|
11
|
-
new $APP.
|
|
2
|
+
var i0=function(a,b,c){return $APP.$c(b,a)?a:c},j0=function(a){return $APP.n($APP.n(a)?$APP.I("",a):a)?a:null},Tea=function(a){var b=$APP.G(a),c=$APP.C(b,k0),d=$APP.C(b,l0),e=$APP.C(b,$APP.Fn),f=$APP.C(b,$APP.nk);a=$APP.C(b,$APP.Eh);var h=$APP.C(b,$APP.nq),l=$APP.C(b,$APP.ok),m=$APP.C(b,$APP.dk);b=$APP.C(b,$APP.Z);f=i0(f,Oea,"default");e=i0(e,Pea,"start");l=i0(l,Qea,"md");c=i0(c,Rea,"normal");d=i0(d,Sea,"neutral");m=$APP.D(m);return $APP.Wf([l0,$APP.Fn,$APP.nk,$APP.Eh,$APP.nq,$APP.ok,$APP.dk,$APP.Z,
|
|
3
|
+
m0,k0],[d,e,f,j0(a),j0(h),l,m,j0(b),m?"true":null,c])},Uea=function(a){return $APP.Wf([l0,$APP.Fn,$APP.nk,$APP.Eh,$APP.nq,$APP.ok,$APP.dk,$APP.Z,k0],[a.getAttribute("trend"),a.getAttribute("align"),a.getAttribute("variant"),a.getAttribute("value"),a.getAttribute("hint"),a.getAttribute("size"),a.hasAttribute("loading"),a.getAttribute("label"),a.getAttribute("emphasis")])},Vea=function(a,b){$APP.S(a,"role","figure");var c=m0.i(b);$APP.n(c)?$APP.S(a,"aria-busy",c):$APP.T(a,"aria-busy");b=$APP.Z.i(b);
|
|
4
|
+
$APP.n(b)?$APP.S(a,"aria-label",b):$APP.T(a,"aria-label")},Wea=function(a,b){a.setAttribute("data-variant",$APP.nk.i(b));a.setAttribute("data-align",$APP.Fn.i(b));a.setAttribute("data-size",$APP.ok.i(b));a.setAttribute("data-emphasis",k0.i(b));a.setAttribute("data-trend",l0.i(b));$APP.n($APP.dk.i(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},n0=function(a){var b=Tea(Uea(a)),c=$APP.k(a,"__xStatBase"),d=$APP.k(a,"__xStatLabel"),e=$APP.k(a,"__xStatValue"),f=$APP.k(a,"__xStatHint");
|
|
5
|
+
return $APP.n(c)?(Vea(a,b),Wea(c,b),d.textContent=function(){var h=$APP.Z.i(b);return $APP.n(h)?h:""}(),e.textContent=function(){var h=$APP.Eh.i(b);return $APP.n(h)?h:""}(),f.textContent=function(){var h=$APP.nq.i(b);return $APP.n(h)?h:""}()):null},o0=function(a){if(!$APP.Fh(a,"__xStatInitialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("div"),l=
|
|
6
|
+
document.createElement("div"),m=document.createElement("div"),q=document.createElement("span"),r=document.createElement("span"),v=document.createElement("span"),x=document.createElement("slot"),z=document.createElement("slot"),B=document.createElement("slot"),E=document.createElement("slot"),H=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-stat-background:transparent;--x-stat-color:var(--x-color-text,inherit);--x-stat-muted-color:var(--x-color-text-muted,rgba(0,0,0,0.55));--x-stat-border-color:var(--x-color-border,transparent);--x-stat-radius:var(--x-radius-md,12px);--x-stat-padding:16px;--x-stat-gap:6px;--x-stat-label-color:var(--x-stat-muted-color);--x-stat-label-size:12px;--x-stat-value-color:var(--x-stat-color);--x-stat-value-size:20px;--x-stat-hint-color:var(--x-stat-muted-color);--x-stat-hint-size:12px;--x-stat-icon-color:var(--x-stat-color);--x-stat-positive-color:var(--x-color-success,#16a34a);--x-stat-warning-color:var(--x-color-warning,#d97706);--x-stat-danger-color:var(--x-color-danger,#dc2626);--x-stat-transition-duration:var(--x-transition-duration,120ms);--x-stat-transition-timing:var(--x-transition-easing,ease);--x-stat-loading-opacity:0.6;}@media (prefers-color-scheme:dark){:host{--x-stat-muted-color:var(--x-color-text-muted,rgba(255,255,255,0.55));--x-stat-positive-color:var(--x-color-success,#4ade80);--x-stat-warning-color:var(--x-color-warning,#fbbf24);--x-stat-danger-color:var(--x-color-danger,#f87171);}}:host([variant\x3d'positive']){--x-stat-value-color:var(--x-stat-positive-color);}:host([variant\x3d'warning']){--x-stat-value-color:var(--x-stat-warning-color);}:host([variant\x3d'danger']){--x-stat-value-color:var(--x-stat-danger-color);}:host([variant\x3d'subtle']){--x-stat-value-color:var(--x-stat-muted-color);}[part\x3dbase]{display:grid;gap:var(--x-stat-gap);padding:var(--x-stat-padding);border-radius:var(--x-stat-radius);background:var(--x-stat-background);border:1px solid var(--x-stat-border-color);color:var(--x-stat-color);transition:background var(--x-stat-transition-duration) var(--x-stat-transition-timing),border-color var(--x-stat-transition-duration) var(--x-stat-transition-timing),color var(--x-stat-transition-duration) var(--x-stat-transition-timing),opacity var(--x-stat-transition-duration) var(--x-stat-transition-timing);}[part\x3dbase][data-align\x3d'center']{text-align:center;}[part\x3dbase][data-align\x3d'end']{text-align:end;}[part\x3dbase][data-size\x3d'sm'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 0.8);}[part\x3dbase][data-size\x3d'lg'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 1.6);}[part\x3dbase][data-emphasis\x3d'high'] [part\x3dvalue]{font-weight:800;}[part\x3dicon]{flex:0 0 auto;color:var(--x-stat-icon-color);line-height:1;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dlabel]{font-size:var(--x-stat-label-size);color:var(--x-stat-label-color);}[part\x3dvalue]{font-weight:600;font-size:var(--x-stat-value-size);color:var(--x-stat-value-color);}[part\x3dhint]{font-size:var(--x-stat-hint-size);color:var(--x-stat-hint-color);}[part\x3dbase][data-loading\x3d'true']{opacity:var(--x-stat-loading-opacity);}@media (prefers-reduced-motion:reduce){[part\x3dbase]{transition:none;}}";
|
|
7
|
+
d.setAttribute("part","base");e.setAttribute("part","icon");f.setAttribute("part","body");h.setAttribute("part","label");l.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");z.setAttribute("name","label");B.setAttribute("name","value");E.setAttribute("name","hint");e.appendChild(x);h.appendChild(z);h.appendChild(q);l.appendChild(B);l.appendChild(r);m.appendChild(E);m.appendChild(v);f.appendChild(h);f.appendChild(l);f.appendChild(m);f.appendChild(H);d.appendChild(e);
|
|
8
|
+
d.appendChild(f);b.appendChild(c);b.appendChild(d);$APP.R(a,"__xStatRoot",b);$APP.R(a,"__xStatBase",d);$APP.R(a,"__xStatLabel",q);$APP.R(a,"__xStatValue",r);$APP.R(a,"__xStatHint",v);$APP.R(a,"__xStatInitialized",!0)}n0(a);return a},Xea=function(a){return o0(a)},Yea=function(a){return $APP.Fh(a,"__xStatInitialized")?n0(a):o0(a)},$ea=function(a){return $APP.Zh(a,Zea)},p0=function(){return $APP.Ah("x-stat",new $APP.O(null,4,[$APP.qh,afa,$APP.oh,Xea,$APP.kh,Yea,$APP.ph,$ea],null))},k0=new $APP.F(null,
|
|
9
|
+
"emphasis","emphasis",293543451),m0=new $APP.F(null,"aria-busy","aria-busy",793864247),l0=new $APP.F(null,"trend","trend",54563841);var afa="variant align size emphasis trend loading label value hint".split(" "),Oea=new $APP.pg(null,new $APP.O(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),Pea=new $APP.pg(null,new $APP.O(null,3,["center",null,"start",null,"end",null],null),null),Qea=new $APP.pg(null,new $APP.O(null,3,["md",null,"lg",null,"sm",null],null),null),Rea=new $APP.pg(null,new $APP.O(null,2,["high",null,"normal",null],null),null),Sea=new $APP.pg(null,new $APP.O(null,3,["neutral",
|
|
10
|
+
null,"up",null,"down",null],null),null),Zea=$APP.Wf([l0,$APP.Fn,$APP.nk,$APP.Eh,$APP.nq,$APP.ok,$APP.dk,$APP.Z,k0],[new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"trend",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"align",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"variant",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"value",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"hint",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"size",$APP.Yh,
|
|
11
|
+
""],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"loading"],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"label",$APP.Yh,""],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,"emphasis",$APP.Yh,""],null)]);$APP.ha("baredom.exports.x_stat.init",p0);export const init=p0;
|
package/dist/x-stepper.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.
|
|
6
|
-
$APP.C(b,$APP.
|
|
7
|
-
$APP.
|
|
8
|
-
$APP.
|
|
9
|
-
m.setAttribute("part","step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.
|
|
10
|
-
r.appendChild(x);f.appendChild(h);f.appendChild(r);return f},
|
|
11
|
-
d
|
|
12
|
-
10),e=$APP.
|
|
13
|
-
b))}a.__xStepperHandlers=null},
|
|
14
|
-
enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){return
|
|
15
|
-
|
|
2
|
+
var It=function(a){a=$APP.C(Ht,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.Yp},Kt=function(a){a=$APP.C(Jt,a);return $APP.n(a)?a:"horizontal"},Nt=function(a){a=$APP.C(Lt,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Mt},Pt=function(a){a=$APP.C(Ot,a);return $APP.n(a)?a:"md"},Qt=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.p(isNaN(a))&&a>=0?a:0):0},Rt=function(a){if(typeof a==="string"){var b=a.trim();if($APP.n($APP.Gg(/^\d+$/,
|
|
3
|
+
b)))return a=parseInt(b,10),a>0&&a<=200?$APP.ze(function(f){return new $APP.O(null,2,[$APP.Z,"Step "+$APP.V.i(f),$APP.Co,null],null)},$APP.Eg(1,a+1)):$APP.ye;if($APP.n(function(){var f=$APP.I("",b);return f?b.startsWith("["):f}()))try{var c=JSON.parse(b);if($APP.n(Array.isArray(c))){var d=$APP.zc(c),e=$APP.y(d)>200?$APP.ne(200,d):d;return $APP.ze(function(f){return new $APP.O(null,2,[$APP.Z,function(){var h=$APP.k(f,"label");return typeof h==="string"?h:""}(),$APP.Co,function(){var h=$APP.k(f,"description");
|
|
4
|
+
return typeof h==="string"?h:null}()],null)},e)}return $APP.ye}catch(f){return $APP.ye}else return $APP.ye}else return $APP.ye},St=function(a){var b=$APP.k(a,"__xStepperRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-stepper-indicator-size:2rem;--x-stepper-connector-thickness:2px;--x-stepper-step-gap:0.75rem;--x-stepper-font-size:var(--x-font-size-sm,0.875rem);--x-stepper-label-font-weight:500;--x-stepper-desc-font-size:0.75rem;--x-stepper-radius:var(--x-radius-full,999px);--x-stepper-motion:var(--x-transition-duration,120ms);--x-stepper-press-scale:0.93;--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(0,0,0,0.55));--x-stepper-disabled-opacity:0.5;--x-stepper-complete-bg:var(--x-color-success,rgba(16,140,72,1));--x-stepper-complete-color:#fff;--x-stepper-complete-connector:var(--x-color-success,rgba(16,140,72,1));--x-stepper-current-bg:var(--x-color-primary,rgba(0,102,204,1));--x-stepper-current-color:#fff;--x-stepper-upcoming-bg:rgba(0,0,0,0.08);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.45));--x-stepper-idle-connector:var(--x-color-border,rgba(0,0,0,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-current-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.4));--x-stepper-desc-color:var(--x-color-text-muted,rgba(0,0,0,0.4));}@media (prefers-color-scheme:dark){:host{--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(255,255,255,0.7));--x-stepper-complete-bg:var(--x-color-success,rgba(60,210,120,1));--x-stepper-complete-color:#000;--x-stepper-complete-connector:var(--x-color-success,rgba(60,210,120,1));--x-stepper-current-bg:var(--x-color-primary,rgba(80,160,255,1));--x-stepper-current-color:#000;--x-stepper-upcoming-bg:rgba(255,255,255,0.1);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.35));--x-stepper-idle-connector:var(--x-color-border,rgba(255,255,255,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-current-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.3));--x-stepper-desc-color:var(--x-color-text-muted,rgba(255,255,255,0.35));}}[part\x3dcontainer]{display:flex;align-items:flex-start;margin:0;padding:0;list-style:none;}:host([data-orientation\x3dhorizontal]) [part\x3dcontainer]{flex-direction:row;}:host([data-orientation\x3dhorizontal]) [part\x3dstep]{display:flex;flex-direction:column;align-items:center;flex:1;min-width:0;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-track]{display:flex;align-items:center;width:100%;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-connector]{flex:1;height:var(--x-stepper-connector-thickness);min-width:8px;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-content]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--x-stepper-step-gap) 4px 0;width:100%;}:host([data-orientation\x3dvertical]) [part\x3dcontainer]{flex-direction:column;}:host([data-orientation\x3dvertical]) [part\x3dstep]{display:flex;flex-direction:row;gap:var(--x-stepper-step-gap);}:host([data-orientation\x3dvertical]) [part\x3dstep-track]{display:flex;flex-direction:column;align-items:center;flex-shrink:0;width:var(--x-stepper-indicator-size);}:host([data-orientation\x3dvertical]) [part\x3dstep-connector]{flex:1;width:var(--x-stepper-connector-thickness);min-height:16px;margin:4px 0;}:host([data-orientation\x3dvertical]) [part\x3dstep-content]{display:flex;flex-direction:column;flex:1;min-width:0;padding-bottom:var(--x-stepper-step-gap);}[part\x3dstep-indicator]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-stepper-indicator-size);height:var(--x-stepper-indicator-size);border-radius:var(--x-stepper-radius);border:none;padding:0;margin:0;cursor:pointer;font-size:0.875em;font-weight:600;font-family:inherit;flex-shrink:0;position:relative;z-index:1;transition:background var(--x-stepper-motion) ease,color var(--x-stepper-motion) ease,transform 80ms ease;}[part\x3dstep-indicator]:focus{outline:none;}[part\x3dstep-indicator]:focus-visible{outline:2px solid var(--x-stepper-focus-ring);outline-offset:3px;}[data-state\x3dcomplete] [part\x3dstep-indicator]{background:var(--x-stepper-complete-bg);color:var(--x-stepper-complete-color);}[data-state\x3dcurrent] [part\x3dstep-indicator]{background:var(--x-stepper-current-bg);color:var(--x-stepper-current-color);cursor:default;}[data-state\x3dupcoming] [part\x3dstep-indicator]{background:var(--x-stepper-upcoming-bg);color:var(--x-stepper-upcoming-color);}[data-state\x3dcomplete] [part\x3dstep-connector]{background:var(--x-stepper-complete-connector);}[data-state\x3dcurrent] [part\x3dstep-connector],[data-state\x3dupcoming] [part\x3dstep-connector]{background:var(--x-stepper-idle-connector);}[part\x3dstep]:last-child [part\x3dstep-connector]{display:none;}[part\x3dstep-label]{font-size:var(--x-stepper-font-size);line-height:1.3;font-family:inherit;}[data-state\x3dcomplete] [part\x3dstep-label]{color:var(--x-stepper-label-done-color);}[data-state\x3dcurrent] [part\x3dstep-label]{color:var(--x-stepper-label-current-color);font-weight:var(--x-stepper-label-font-weight);}[data-state\x3dupcoming] [part\x3dstep-label]{color:var(--x-stepper-label-upcoming-color);}[part\x3dstep-description]{font-size:var(--x-stepper-desc-font-size);color:var(--x-stepper-desc-color);line-height:1.3;margin-top:0.2em;}:host(:not([disabled])) [data-state\x3dcomplete] [part\x3dstep-indicator]:hover,:host(:not([disabled])) [data-state\x3dupcoming] [part\x3dstep-indicator]:hover{filter:brightness(0.88);}:host(:not([disabled])) [data-state\x3dcomplete] [part\x3dstep-indicator]:active,:host(:not([disabled])) [data-state\x3dupcoming] [part\x3dstep-indicator]:active{transform:scale(var(--x-stepper-press-scale));}:host([disabled]){opacity:var(--x-stepper-disabled-opacity);}:host([disabled]) [part\x3dstep-indicator]{cursor:default;pointer-events:none;}:host([data-size\x3dsm]){--x-stepper-indicator-size:1.5rem;--x-stepper-font-size:0.8125rem;--x-stepper-desc-font-size:0.6875rem;}:host([data-size\x3dlg]){--x-stepper-indicator-size:2.5rem;--x-stepper-font-size:1rem;--x-stepper-desc-font-size:0.875rem;}@media (prefers-reduced-motion:reduce){[part\x3dstep-indicator]{transition:none;}}";
|
|
5
|
+
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.O(null,2,[$APP.jj,b,$APP.kj,d],null);return $APP.k(a,"__xStepperRefs")},Ut=function(a){a=new $APP.O(null,5,[Tt,a.getAttribute("steps"),$APP.hr,a.getAttribute("current"),$APP.mq,a.getAttribute("orientation"),$APP.Vk,a.getAttribute("size"),$APP.Bi,a.hasAttribute("disabled")],null);var b=$APP.G(a),c=$APP.C(b,Tt);a=$APP.C(b,$APP.hr);var d=$APP.C(b,$APP.mq),e=$APP.C(b,$APP.Vk);b=
|
|
6
|
+
$APP.C(b,$APP.Bi);c=Rt(c);var f=$APP.y(c);return new $APP.O(null,5,[$APP.Oq,c,$APP.rm,f===0?0:$APP.Gl.j(0,$APP.Hl.j(Qt(a),f-1)),$APP.Hp,It(d),$APP.ok,Nt(e),$APP.Bi,$APP.D(b)],null)},Vt=function(a,b,c){return"Step "+$APP.V.i(a+1)+": "+$APP.V.i(b)+" ("+$APP.V.i(function(){var d=c instanceof $APP.F?c.ga:null;switch(d){case "complete":return"completed";case "current":return"current";case "upcoming":return"upcoming";default:throw Error("No matching clause: "+$APP.V.i(d));}}())+")"},Wt=function(a,b,c,d){var e=
|
|
7
|
+
$APP.G(b);b=$APP.C(e,$APP.Z);e=$APP.C(e,$APP.Co);var f=document.createElement("div"),h=document.createElement("div"),l=document.createElement("button"),m=document.createElement("span"),q=document.createElement("div"),r=document.createElement("div"),v=document.createElement("span"),x=document.createElement("span");a:{var z=c instanceof $APP.F?c.ga:null;switch(z){case "complete":z="complete";break a;case "current":z="current";break a;case "upcoming":z="upcoming";break a;default:throw Error("No matching clause: "+
|
|
8
|
+
$APP.V.i(z));}}b=$APP.n(b)?b:"";f.setAttribute("part","step");f.setAttribute("role","listitem");f.setAttribute("data-index",""+$APP.V.i(a));f.setAttribute("data-state",z);h.setAttribute("part","step-track");l.setAttribute("part","step-indicator");l.setAttribute("type","button");l.setAttribute("aria-label",Vt(a,b,c));$APP.A.j(c,$APP.rm)?l.setAttribute("aria-current","step"):l.removeAttribute("aria-current");l.setAttribute("tabindex",$APP.n(d)?"-1":"0");$APP.n(d)&&l.setAttribute("aria-disabled","true");
|
|
9
|
+
m.setAttribute("part","step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.A.j(c,$APP.$q)?"✓":""+$APP.V.i(a+1);q.setAttribute("part","step-connector");q.setAttribute("aria-hidden","true");r.setAttribute("part","step-content");v.setAttribute("part","step-label");v.textContent=b;x.setAttribute("part","step-description");$APP.n($APP.n(e)?$APP.I(e,""):e)?(x.textContent=e,x.style.display="block"):x.style.display="none";l.appendChild(m);h.appendChild(l);h.appendChild(q);r.appendChild(v);
|
|
10
|
+
r.appendChild(x);f.appendChild(h);f.appendChild(r);return f},Yt=function(a){var b=Ut(a);if($APP.I($APP.k(a,"__xStepperModel"),b)){b=$APP.G(b);var c=$APP.C(b,$APP.Oq),d=$APP.C(b,$APP.rm),e=$APP.C(b,$APP.Hp),f=$APP.C(b,$APP.ok),h=$APP.C(b,$APP.Bi),l=St(a);l=$APP.G(l);l=$APP.C(l,$APP.kj);$APP.S(a,"data-orientation",Kt(e));$APP.S(a,"data-size",Pt(f));l.innerHTML="";c=$APP.t($APP.je($APP.Ml,c));e=null;for(var m=f=0;;)if(m<f){var q=e.F(null,m),r=$APP.Gc(q,0,null);q=$APP.Gc(q,1,null);var v=r<d?$APP.$q:$APP.A.j(r,
|
|
11
|
+
d)?$APP.rm:Xt;l.appendChild(Wt(r,q,v,h));m+=1}else if(c=$APP.t(c))$APP.Wc(c)?(f=$APP.Ab(c),c=$APP.Bb(c),e=f,f=$APP.y(f)):(f=$APP.u(c),e=$APP.Gc(f,0,null),f=$APP.Gc(f,1,null),m=e<d?$APP.$q:$APP.A.j(e,d)?$APP.rm:Xt,l.appendChild(Wt(e,f,m,h)),c=$APP.w(c),e=null,f=0),m=0;else break;a.__xStepperModel=b}},Zt=function(a){function b(d){var e=$APP.k(a,"__xStepperModel");e=$APP.n(e)?e:Ut(a);$APP.n($APP.Bi.i(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.n(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),
|
|
12
|
+
10),e=$APP.rm.i(e),typeof d==="number"&&$APP.p(isNaN(d))&&$APP.I(d,e)&&(e=$APP.$l(new $APP.O(null,2,[$APP.nm,e,$APP.rq,d],null)),$APP.Ph(a,"x-stepper-change",e)&&$APP.S(a,"current",""+$APP.V.i(d)))));return null}var c=St(a);c=$APP.G(c);$APP.C(c,$APP.kj).addEventListener("click",b);$APP.ja(a,"__xStepperHandlers",{click:b})},$t=function(a){var b=$APP.k(a,"__xStepperHandlers");if($APP.n(b)){var c=$APP.k(a,"__xStepperRefs");$APP.n(c)&&(c=$APP.kj.i(c),b=$APP.k(b,"click"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("click",
|
|
13
|
+
b))}a.__xStepperHandlers=null},au=function(a){$APP.Th(a,"steps","steps","[]");Object.defineProperty(a,"current",{get:function(){return Qt(this.getAttribute("current"))},set:function(b){return b==null?this.removeAttribute("current"):this.setAttribute("current",""+$APP.V.i(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return Kt(It(this.getAttribute("orientation")))},set:function(b){return $APP.n(b)?this.setAttribute("orientation",""+$APP.V.i(b)):this.removeAttribute("orientation")},
|
|
14
|
+
enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){return Pt(Nt(this.getAttribute("size")))},set:function(b){return $APP.n(b)?this.setAttribute("size",""+$APP.V.i(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});return $APP.Sh(a,"disabled","disabled")},bu=function(a){St(a);$t(a);Zt(a);Yt(a);return null},cu=function(a){$t(a);return null},du=function(a,b,c,d){$APP.I(c,d)&&Yt(a);return null},fu=function(){return $APP.Ah("x-stepper",new $APP.O(null,5,[$APP.qh,
|
|
15
|
+
eu,$APP.oh,bu,$APP.lh,cu,$APP.kh,du,$APP.ph,au],null))},Xt=new $APP.F(null,"upcoming","upcoming",1873315471),Tt=new $APP.F(null,"steps-raw","steps-raw",1741812533),Mt=new $APP.F(null,"md","md",707286655),gu=new $APP.F(null,"lg","lg",-80787836),hu=new $APP.F(null,"sm","sm",-1402575065);var eu=["steps","current","orientation","size","disabled"];$APP.ce(["x-stepper-change",new $APP.O(null,2,[$APP.U,new $APP.O(null,2,[$APP.nm,$APP.Y,$APP.rq,$APP.Y],null),$APP.Aq,!0],null)]);var Ht=new $APP.O(null,2,["horizontal",$APP.Yp,"vertical",$APP.Jn],null),Jt=new $APP.O(null,2,[$APP.Yp,"horizontal",$APP.Jn,"vertical"],null),Lt=new $APP.O(null,3,["sm",hu,"md",Mt,"lg",gu],null),Ot=new $APP.O(null,3,[hu,"sm",Mt,"md",gu,"lg"],null);$APP.ha("baredom.exports.x_stepper.init",fu);export const init=fu;
|
package/dist/x-switch.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.
|
|
4
|
-
$APP.n($APP.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"value"],null)],null);$APP.
|
|
2
|
+
var O1=function(a){a=$APP.Wf([$APP.ri,$APP.vi,$APP.wi,$APP.uj,$APP.vj,$APP.xj,$APP.si,$APP.yj,$APP.zj],[a.getAttribute("name"),a.hasAttribute("disabled"),a.hasAttribute("required"),a.getAttribute("aria-labelledby"),a.hasAttribute("checked"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("aria-label"),a.getAttribute("aria-describedby")]);var b=$APP.G(a);a=$APP.C(b,$APP.yj);var c=$APP.C(b,$APP.zj),d=$APP.C(b,$APP.ri),e=$APP.C(b,$APP.vi),f=$APP.C(b,$APP.wi),h=$APP.C(b,$APP.uj),l=$APP.C(b,
|
|
3
|
+
$APP.vj),m=$APP.C(b,$APP.xj);b=$APP.C(b,$APP.si);l=$APP.D(l);f=$APP.D(f);return $APP.Wf([$APP.Ci,$APP.Bj,$APP.Cj,$APP.Dj,$APP.Ej,$APP.zi,$APP.Eh,$APP.Jj,$APP.Kj,$APP.Lj,$APP.Bi],[f,l?"true":"false",$APP.D(m),l,$APP.n(f)?l:!0,d,b!=null?b:"on",h,c,a,$APP.D(e)])},P1=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(b,"control");b=O1(a);var d=$APP.Bi.i(b),e=$APP.Dj.i(b);$APP.S(c,"aria-checked",$APP.Bj.i(b));$APP.S(c,"aria-disabled",$APP.n(d)?"true":"false");$APP.S(c,"aria-required",
|
|
4
|
+
$APP.n($APP.Ci.i(b))?"true":"false");$APP.S(c,"aria-readonly",$APP.n($APP.Cj.i(b))?"true":"false");var f=$APP.Lj.i(b);$APP.n(f)?$APP.S(c,"aria-label",f):$APP.T(c,"aria-label");f=$APP.Jj.i(b);$APP.n(f)?$APP.S(c,"aria-labelledby",f):$APP.T(c,"aria-labelledby");f=$APP.Kj.i(b);$APP.n(f)?$APP.S(c,"aria-describedby",f):$APP.T(c,"aria-describedby");c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?$APP.S(c,"disabled",""):$APP.T(c,"disabled");$APP.Ih(a,"data-checked",e);$APP.Ih(a,"data-disabled",d);a=$APP.k(a,"__xSwitchInternals");
|
|
5
|
+
return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.Eh.i(b):null):null}return null},Q1=function(a){var b=O1(a),c=$APP.Bi.i(b),d=$APP.Cj.i(b);if($APP.n($APP.n(c)?c:d))return null;c=$APP.Dj.i(b);d=$APP.p(c);b=$APP.Eh.i(b);return $APP.Ph(a,"x-switch-change-request",{value:b,previousChecked:c,nextChecked:d})?($APP.Ih(a,"checked",d),P1(a),$APP.Nh(a,"x-switch-change",{value:b,checked:d})):null},Nfa=function(a){return function(){return Q1(a)}},Ofa=function(a){return function(b){var c=b.key;return $APP.A.j(c,
|
|
6
|
+
" ")||$APP.A.j(c,"Enter")?(b.preventDefault(),Q1(a)):null}},R1=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(a,"__xSwitchHandlers");if($APP.n(c)){b=$APP.k(b,"control");b.removeEventListener("click",$APP.k(c,"click"));b.removeEventListener("keydown",$APP.k(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},Pfa=function(a,b){$APP.Ih(a,"disabled",$APP.D(b));return P1(a)},Qfa=function(a){$APP.T(a,"checked");return P1(a)},Rfa=function(a){if(!$APP.n($APP.k(a,"__xSwitchRefs"))){var b=
|
|
7
|
+
a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("button"),e=document.createElement("span"),f=document.createElement("span");c.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-switch-track-width:44px;--x-switch-track-height:24px;--x-switch-thumb-size:18px;--x-switch-thumb-offset:3px;--x-switch-track-radius:var(--x-radius-full,999px);--x-switch-track-bg:var(--x-color-border,#d1d5db);--x-switch-track-bg-checked:var(--x-color-primary,#2563eb);--x-switch-thumb-bg:var(--x-color-bg,#ffffff);--x-switch-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-switch-disabled-opacity:0.45;--x-switch-transition:background var(--x-transition-duration,150ms) var(--x-transition-easing,ease),transform var(--x-transition-duration,150ms) var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-switch-track-bg:var(--x-color-border,#4b5563);--x-switch-track-bg-checked:var(--x-color-primary,#3b82f6);--x-switch-thumb-bg:var(--x-color-bg,#f9fafb);--x-switch-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3dcontrol]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;padding:0;cursor:pointer;}[part\x3dcontrol][disabled]{cursor:default;opacity:var(--x-switch-disabled-opacity);}[part\x3dcontrol]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-switch-focus-ring);border-radius:calc(var(--x-switch-track-radius) + 2px);}[part\x3dtrack]{position:relative;display:inline-block;width:var(--x-switch-track-width);height:var(--x-switch-track-height);border-radius:var(--x-switch-track-radius);background:var(--x-switch-track-bg);transition:background 150ms ease;flex-shrink:0;}:host([data-checked]) [part\x3dtrack]{background:var(--x-switch-track-bg-checked);}[part\x3dthumb]{position:absolute;top:var(--x-switch-thumb-offset);left:var(--x-switch-thumb-offset);width:var(--x-switch-thumb-size);height:var(--x-switch-thumb-size);border-radius:50%;background:var(--x-switch-thumb-bg);box-shadow:0 1px 3px rgba(0,0,0,0.25);transition:transform 150ms ease;}:host([data-checked]) [part\x3dthumb]{transform:translateX(calc(var(--x-switch-track-width) - var(--x-switch-thumb-size) - calc(var(--x-switch-thumb-offset) * 2)));}@media (prefers-reduced-motion:reduce){[part\x3dtrack]{transition:none;}[part\x3dthumb]{transition:none;}}";
|
|
8
|
+
$APP.S(d,"part","control");$APP.S(d,"type","button");$APP.S(d,"role","switch");$APP.S(e,"part","track");$APP.S(f,"part","thumb");e.appendChild(f);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSwitchRefs={root:b,control:d,track:e,thumb:f};$APP.n(a.attachInternals)&&(b=a.attachInternals(),a.__xSwitchInternals=b)}R1(a);b=$APP.k(a,"__xSwitchRefs");$APP.n(b)&&(b=$APP.k(b,"control"),c=Nfa(a),d=Ofa(a),e={click:c,keydown:d},b.addEventListener("click",c),b.addEventListener("keydown",d),a.__xSwitchHandlers=
|
|
9
|
+
e);c=a.getAttribute("id");$APP.n(c)&&(b=document.querySelector("label[for\x3d'"+$APP.V.i(c)+"']"),$APP.n(b)&&(d=b.getAttribute("id"),$APP.n(d)?b=d:(c="x-sw-lbl-"+$APP.V.i(c),$APP.S(b,"id",c),b=c),c=$APP.k(a,"__xSwitchRefs"),$APP.n(c)&&$APP.S($APP.k(c,"control"),"aria-labelledby",b)));return P1(a)},Sfa=function(a){return R1(a)},Tfa=function(a){return P1(a)},Vfa=function(a){return $APP.Zh(a,Ufa)},S1=function(){return $APP.Ah("x-switch",new $APP.O(null,8,[$APP.qh,Wfa,$APP.oh,Rfa,$APP.lh,Sfa,$APP.kh,
|
|
10
|
+
Tfa,$APP.mh,!0,$APP.jh,Pfa,$APP.ih,Qfa,$APP.ph,Vfa],null))};var Wfa="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" "),Ufa=new $APP.O(null,6,[$APP.cr,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"checked"],null),$APP.ck,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"disabled"],null),$APP.Cq,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"readonly"],null),$APP.Ho,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"required"],null),$APP.zi,new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"name"],null),$APP.Eh,new $APP.O(null,2,[$APP.Q,$APP.X,
|
|
11
|
+
$APP.W,"value"],null)],null);$APP.ce(["x-switch-change-request",new $APP.O(null,2,[$APP.Aq,!0,$APP.U,new $APP.O(null,3,[$APP.Eh,$APP.X,$APP.zo,$APP.Xh,$APP.jq,$APP.Xh],null)],null),"x-switch-change",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,2,[$APP.Eh,$APP.X,$APP.cr,$APP.Xh],null)],null)]);$APP.ha("baredom.exports.x_switch.init",S1);export const init=S1;
|