@vanelsas/baredom 1.2.0 → 1.4.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 +29 -0
- package/README.md +7 -5
- package/dist/base.js +397 -362
- package/dist/x-alert.js +19 -19
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +6 -0
- package/dist/x-bento-item.js +5 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +16 -16
- package/dist/x-cancel-dialogue.js +17 -17
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +48 -48
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +12 -12
- package/dist/x-command-palette.js +31 -31
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +23 -23
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +41 -41
- package/dist/x-divider.js +13 -13
- package/dist/x-drawer.js +12 -12
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +19 -32
- package/dist/x-grid.js +6 -7
- package/dist/x-kinetic-font.js +29 -0
- package/dist/x-kinetic-typography.js +39 -61
- package/dist/x-liquid-dock.js +40 -0
- package/dist/x-liquid-fill.js +45 -0
- package/dist/x-liquid-glass.js +48 -0
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +11 -11
- package/dist/x-metaball-cursor.js +29 -0
- package/dist/x-modal.js +13 -13
- package/dist/x-morph-stack.js +41 -0
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +35 -0
- package/dist/x-notification-center.js +9 -10
- package/dist/x-organic-divider.js +19 -19
- package/dist/x-organic-progress.js +40 -0
- package/dist/x-organic-shape.js +14 -14
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +15 -15
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +10 -10
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +12 -13
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +36 -36
- package/dist/x-scroll-timeline.js +50 -50
- package/dist/x-scroll.js +41 -41
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +6 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +22 -0
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +15 -0
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +22 -23
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +16 -16
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-timeline-item.js +24 -24
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +24 -24
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +8 -8
- package/package.json +50 -2
package/dist/x-slider.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.N(h);h=$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
A,typeof y==="string"&&$APP.O("",y)?y:null,x,typeof
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$APP.S.g(h)):null}return null}
|
|
9
|
-
{value:c,min:d,max:e})}},
|
|
10
|
-
b.preventDefault():null}},
|
|
11
|
-
c,$APP.
|
|
12
|
-
"value","value");
|
|
13
|
-
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.
|
|
14
|
-
"input"),d=
|
|
15
|
-
null:customElements.define("x-slider",
|
|
16
|
-
$APP.
|
|
17
|
-
$APP.
|
|
2
|
+
var SD=function(a,b){return typeof a==="string"?(a=parseFloat(a),$APP.r(isNaN(a))?b:a):b},TD=function(a,b,c){return a.setAttribute(b,c)},UD=function(a,b,c){return $APP.r(c)?a.setAttribute(b,""):a.removeAttribute(b)},ZD=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.r(b)){var c=$APP.l(b,"base"),d=$APP.l(b,"header"),e=$APP.l(b,"label"),g=$APP.l(b,"value");b=$APP.l(b,"input");var h=$APP.Q([$APP.vj,$APP.gj,$APP.yj,$APP.Si,$APP.ui,$APP.Ti,$APP.sj,$APP.rh,$APP.Zj,$APP.T,$APP.Ol,$APP.Tk,VD],[a.getAttribute("min"),
|
|
3
|
+
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.N(h);h=$APP.G(k,$APP.Tk);var m=$APP.G(k,VD),p=$APP.G(k,$APP.vj),q=$APP.G(k,$APP.gj),w=$APP.G(k,$APP.yj),x=$APP.G(k,$APP.ui),y=$APP.G(k,$APP.Si),A=$APP.G(k,$APP.Ti),C=$APP.G(k,
|
|
4
|
+
$APP.sj),E=$APP.G(k,$APP.rh),H=$APP.G(k,$APP.T),F=$APP.G(k,$APP.Zj);k=$APP.G(k,$APP.Ol);p=SD(p,0);F=SD(F,100);x=$APP.Zg.i($APP.Yg.i(SD(x,0),p),F);$APP.D.i(m,"any")?m="any":(m=typeof m==="string"?parseFloat(m):NaN,m=$APP.t(isNaN(m))&&m>0?""+$APP.S.g(m):"1");E=typeof E==="string"&&$APP.J(WD,E)?E:"md";q=$APP.I(q);A=$APP.I(A);w=$APP.I(w);var K=F>p?$APP.Zg.i($APP.Yg.i((x-p)/(F-p)*100,0),100):0;h=$APP.Q([$APP.vj,$APP.Sl,$APP.Si,$APP.ui,$APP.sj,XD,$APP.rh,$APP.Zj,$APP.T,$APP.Ol,$APP.Tk,$APP.W,VD,YD],[p,
|
|
5
|
+
A,typeof y==="string"&&$APP.O("",y)?y:null,x,typeof C==="string"&&$APP.O("",C)?C:null,w,E,F,typeof H==="string"&&$APP.O("",H)?H:null,typeof k==="string"&&$APP.O("",k)?k:null,typeof h==="string"&&$APP.O("",h)?h:null,q,m,K]);m=$APP.N(h);y=$APP.G(m,$APP.Tk);C=$APP.G(m,$APP.W);H=$APP.G(m,VD);k=$APP.G(m,YD);w=$APP.G(m,$APP.vj);p=$APP.G(m,$APP.Sl);h=$APP.G(m,$APP.ui);A=$APP.G(m,$APP.sj);F=$APP.G(m,XD);q=$APP.G(m,$APP.rh);x=$APP.G(m,$APP.T);E=$APP.G(m,$APP.Zj);m=$APP.G(m,$APP.Ol);K=(K=x!=null)?K:F;c.setAttribute("data-size",
|
|
6
|
+
q);UD(a,"data-disabled",C);UD(a,"data-readonly",p);d.style.display=$APP.r(K)?"flex":"none";e.textContent=$APP.r(x)?x:"";e.style.display=x!=null?"":"none";g.textContent=$APP.r(F)?""+$APP.S.g(h):"";g.style.display=$APP.r(F)?"":"none";a.style.setProperty("--_x-slider-fill",""+$APP.S.g(k.toFixed(2))+"%");TD(b,"min",""+$APP.S.g(w));TD(b,"max",""+$APP.S.g(E));b.setAttribute("step",H);$APP.O(b.value,""+$APP.S.g(h))&&(b.value=""+$APP.S.g(h));TD(b,"aria-valuemin",""+$APP.S.g(w));TD(b,"aria-valuemax",""+$APP.S.g(E));
|
|
7
|
+
TD(b,"aria-valuenow",""+$APP.S.g(h));b.setAttribute("aria-readonly",$APP.r(p)?"true":"false");$APP.r(y)?b.setAttribute("aria-label",y):x!=null?b.setAttribute("aria-label",x):b.removeAttribute("aria-label");$APP.r(A)?b.setAttribute("aria-labelledby",A):b.removeAttribute("aria-labelledby");$APP.r(m)?b.setAttribute("aria-describedby",m):b.removeAttribute("aria-describedby");$APP.r(C)?b.setAttribute("disabled",""):b.removeAttribute("disabled");a=$APP.l(a,"__xSliderInternals");return $APP.r(a)?a.setFormValue(""+
|
|
8
|
+
$APP.S.g(h)):null}return null},$D=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},aE=function(a){return function(){if($APP.r(a.hasAttribute("disabled")))return null;var b=$APP.l($APP.l(a,"__xSliderRefs"),"input").value,c=parseFloat(b),d=parseFloat(function(){var g=a.getAttribute("min");return $APP.r(g)?g:"0"}()),e=parseFloat(function(){var g=a.getAttribute("max");return $APP.r(g)?g:"100"}());a.setAttribute("value",b);return $D(a,"x-slider-input",
|
|
9
|
+
{value:c,min:d,max:e})}},bE=function(a){return function(){if($APP.r(a.hasAttribute("disabled")))return null;var b=parseFloat($APP.l($APP.l(a,"__xSliderRefs"),"input").value),c=parseFloat(function(){var e=a.getAttribute("min");return $APP.r(e)?e:"0"}()),d=parseFloat(function(){var e=a.getAttribute("max");return $APP.r(e)?e:"100"}());return $D(a,"x-slider-change",{value:b,min:c,max:d})}},dE=function(a){return function(b){var c=a.hasAttribute("readonly");c=$APP.r(c)?$APP.J(cE,b.key):c;return $APP.r(c)?
|
|
10
|
+
b.preventDefault():null}},eE=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.r(b)){var c=$APP.l(a,"__xSliderHandlers");if($APP.r(c)){b=$APP.l(b,"input");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSliderHandlers=null;return}}return null},fE=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return UD(this,
|
|
11
|
+
c,$APP.I(d))}})},gE=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.r(d)?d:null},set:function(d){return d!=null&&$APP.O(d)?TD(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},iE=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return hE}});fE(b,"disabled","disabled");fE(b,"readOnly","readonly");fE(b,"showValue","show-value");gE(b,
|
|
12
|
+
"value","value");gE(b,"min","min");gE(b,"max","max");gE(b,"step","step");gE(b,"name","name");gE(b,"label","label");gE(b,"size","size");b.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSliderRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("input");d.textContent=":host{display:block;color-scheme:light dark;--x-slider-track-color:rgba(0,0,0,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-thumb-shadow:0 1px 4px rgba(0,0,0,0.20);--x-slider-focus-ring:#60a5fa;--x-slider-disabled-opacity:0.45;--x-slider-label-color:rgba(0,0,0,0.60);--x-slider-value-color:rgba(0,0,0,0.50);--x-slider-radius:9999px;}@media (prefers-color-scheme:dark){:host{--x-slider-track-color:rgba(255,255,255,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-focus-ring:#93c5fd;--x-slider-label-color:rgba(255,255,255,0.60);--x-slider-value-color:rgba(255,255,255,0.50);}}[part\x3dbase]{width:100%;box-sizing:border-box;}[part\x3dbase][data-size\x3dsm]{--_x-slider-track-h:4px;--_x-slider-thumb-sz:14px;}[part\x3dbase][data-size\x3dmd]{--_x-slider-track-h:6px;--_x-slider-thumb-sz:18px;}[part\x3dbase][data-size\x3dlg]{--_x-slider-track-h:8px;--_x-slider-thumb-sz:22px;}[part\x3dheader]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px;}[part\x3dlabel-text]{font-size:0.875rem;color:var(--x-slider-label-color);font-weight:500;}[part\x3dvalue-text]{font-size:0.8125rem;color:var(--x-slider-value-color);}[part\x3dinput]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:var(--_x-slider-thumb-sz,18px);cursor:pointer;margin:0;padding:0;background:transparent;outline:none;box-sizing:border-box;}[part\x3dinput]::-webkit-slider-runnable-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:linear-gradient(to right,var(--x-slider-fill-color) var(--_x-slider-fill,0%),var(--x-slider-track-color) var(--_x-slider-fill,0%));}[part\x3dinput]::-moz-range-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-track-color);border:none;}[part\x3dinput]::-moz-range-progress{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-fill-color);}[part\x3dinput]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);margin-top:calc(var(--_x-slider-track-h,6px)/2 - var(--_x-slider-thumb-sz,18px)/2);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]::-moz-range-thumb{width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]:focus-visible::-webkit-slider-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}[part\x3dinput]:focus-visible::-moz-range-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}:host([data-disabled]) [part\x3dinput]{opacity:var(--x-slider-disabled-opacity);cursor:default;pointer-events:none;}:host([data-readonly]) [part\x3dinput]{pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]::-webkit-slider-thumb{transition:none;}[part\x3dinput]::-moz-range-thumb{transition:none;}}";
|
|
13
|
+
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.r(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}eE(this);c=$APP.l(this,"__xSliderRefs");$APP.r(c)&&(c=$APP.l(c,
|
|
14
|
+
"input"),d=aE(this),e=bE(this),g=dE(this),h={input:d,change:e,keydown:g},c.addEventListener("input",d),c.addEventListener("change",e),c.addEventListener("keydown",g),this.__xSliderHandlers=h);return ZD(this)};b.disconnectedCallback=function(){return eE(this)};b.attributeChangedCallback=function(){return ZD(this)};b.formDisabledCallback=function(c){UD(this,"disabled",$APP.I(c));return ZD(this)};b.formResetCallback=function(){TD(this,"value",""+$APP.S.g(0));return ZD(this)};return a},jE=function(){return $APP.r(customElements.get("x-slider"))?
|
|
15
|
+
null:customElements.define("x-slider",iE())},XD=new $APP.M(null,"show-value?","show-value?",-1960833108),YD=new $APP.M(null,"fill-percent","fill-percent",-1813848228),VD=new $APP.M(null,"step","step",1288888124);var WD=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),hE="value min max step disabled readonly name label show-value size aria-label aria-labelledby aria-describedby".split(" ");
|
|
16
|
+
$APP.Q([$APP.vj,$APP.gj,$APP.th,$APP.Si,$APP.ui,$APP.rh,$APP.ml,$APP.Zj,$APP.T,VD],[new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"min"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"disabled"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"show-value"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"name"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"value"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"size"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"readonly"],null),new $APP.P(null,
|
|
17
|
+
2,[$APP.Z,$APP.Y,$APP.Oj,"max"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"label"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"step"],null)]);$APP.Sd(["x-slider-input",new $APP.P(null,1,[$APP.U,new $APP.P(null,3,[$APP.ui,$APP.V,$APP.vj,$APP.V,$APP.Zj,$APP.V],null)],null),"x-slider-change",new $APP.P(null,1,[$APP.U,new $APP.P(null,3,[$APP.ui,$APP.V,$APP.vj,$APP.V,$APP.Zj,$APP.V],null)],null)]);var cE=new $APP.R(null,new $APP.P(null,8,["PageDown",null,"ArrowUp",null,"ArrowDown",null,"End",null,"ArrowRight",null,"ArrowLeft",null,"PageUp",null,"Home",null],null),null);$APP.ka("baredom.exports.x_slider.init",jE);export const init=jE;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var vD=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.D.i(a,""))return b;a=parseFloat(a);return $APP.r(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},wD=function(a,b,c,d,e,g){b=c+(e*(b-a)-g*c)*d;return[a+b*d,b]},xD=function(a,b,c,d,e,g,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;g*=e*e*($APP.r(h)?50:20);return[a/d*g,b/d*g]},yD=function(){return $APP.I(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},zD=function(a,b){for(var c=0;;){if(c>=20)return!0;
|
|
3
|
+
if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},BD=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"),g=document.createElement("div"),h=document.createElement("slot");c.textContent=AD;d.setAttribute("part","svg");d.setAttribute("viewBox","0 0 300 200");d.setAttribute("preserveAspectRatio","none");d.setAttribute("aria-hidden","true");
|
|
4
|
+
e.setAttribute("part","shape");g.setAttribute("part","content");d.appendChild(e);g.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xSoftBodyRefs=new $APP.P(null,4,[$APP.bi,b,$APP.xj,d,$APP.ak,e,$APP.Vh,g],null)},ED=function(a){a=new $APP.P(null,6,[$APP.jl,a.getAttribute("stiffness"),$APP.Ml,a.getAttribute("damping"),$APP.$i,a.getAttribute("radius"),$APP.Mj,a.getAttribute("intensity"),CD,a.getAttribute("grab-radius"),$APP.Ai,a.getAttribute("disabled")],null);var b=$APP.N(a);a=
|
|
5
|
+
$APP.G(b,$APP.jl);var c=$APP.G(b,$APP.Ml),d=$APP.G(b,$APP.$i),e=$APP.G(b,$APP.Mj),g=$APP.G(b,CD);b=$APP.G(b,$APP.Ai);return new $APP.P(null,6,[$APP.Vk,vD(a,180,10,1E3),$APP.Vj,vD(c,12,1,100),$APP.Il,vD(d,16,6,200),$APP.Gj,vD(e,1,0,5),DD,vD(g,80,10,500),$APP.W,b!=null],null)},FD=function(a,b,c){var d=$APP.Il.g($APP.l(a,"__xSoftBodyModel"));d=Math.max(6,Math.min(d,Math.min(b,c)/2));var e=Math.cos(Math.PI/6),g=Math.sin(Math.PI/6),h=Math.cos(Math.PI/3),k=Math.sin(Math.PI/3),m=new Float64Array(20),p=new Float64Array(20);
|
|
6
|
+
m[0]=d;p[0]=0;m[1]=b*.5;p[1]=0;m[2]=b-d;p[2]=0;m[3]=b-d+d*g;p[3]=d-d*e;m[4]=b-d+d*k;p[4]=d-d*h;m[5]=b;p[5]=d;m[6]=b;p[6]=c*.5;m[7]=b;p[7]=c-d;m[8]=b-d+d*e;p[8]=c-d+d*g;m[9]=b-d+d*h;p[9]=c-d+d*k;m[10]=b-d;p[10]=c;m[11]=b*.5;p[11]=c;m[12]=d;p[12]=c;m[13]=d-d*g;p[13]=c-d+d*e;m[14]=d-d*k;p[14]=c-d+d*h;m[15]=0;p[15]=c-d;m[16]=0;p[16]=c*.5;m[17]=0;p[17]=d;m[18]=d-d*e;p[18]=d-d*g;m[19]=d-d*h;p[19]=d-d*k;c=[m,p];b=c[0];c=c[1];d=new Float64Array(20);e=new Float64Array(20);g=new Float64Array(20);h=new Float64Array(20);
|
|
7
|
+
for(k=0;;)if(k<20)d[k]=b[k],e[k]=c[k],g[k]=0,h[k]=0,k+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=g;a.__xSoftBodyVY=h},GD=function(a){var b=$APP.N($APP.l(a,"__xSoftBodyRefs"));b=$APP.G(b,$APP.ak);var c=$APP.l(a,"__xSoftBodyCX");a=$APP.l(a,"__xSoftBodyCY");var d=[];d.push("M"+$APP.S.g(c[0].toFixed(2))+","+$APP.S.g(a[0].toFixed(2)));for(var e=0;;)if(e<20){var g=$APP.hd(e+19,20),h=e,k=$APP.hd(e+1,20),m=$APP.hd(e+2,20),p=(c[k]-c[g])/6,q=(a[k]-
|
|
8
|
+
a[g])/6;g=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var w=c[k]-c[h],x=a[k]-a[h];x=Math.sqrt(w*w+x*x)*.4;w=Math.sqrt(p*p+q*q);w=w>x?x/(w+.001):1;q=a[h]+q*w;var y=Math.sqrt(g*g+m*m);x=y>x?x/(y+.001):1;g=c[k]-g*x;m=a[k]-m*x;d.push("C"+$APP.S.g((c[h]+p*w).toFixed(2))+","+$APP.S.g(q.toFixed(2))+" "+$APP.S.g(g.toFixed(2))+","+$APP.S.g(m.toFixed(2))+" "+$APP.S.g(c[k].toFixed(2))+","+$APP.S.g(a[k].toFixed(2)));e+=1}else break;d.push("Z");b.setAttribute("d",d.join(""))},HD=function(a){var b=$APP.N($APP.l(a,"__xSoftBodyRefs"));
|
|
9
|
+
b=$APP.G(b,$APP.ak);var c=$APP.l(a,"__xSoftBodyW"),d=$APP.l(a,"__xSoftBodyH");a=$APP.Il.g($APP.l(a,"__xSoftBodyModel"));a=Math.max(6,Math.min(a,Math.min(c,d)/2));var e=.5522847498*a;c="M"+$APP.S.g(a.toFixed(2))+",0L"+$APP.S.g((c-a).toFixed(2))+",0C"+$APP.S.g((c-a+e).toFixed(2))+",0 "+$APP.S.g(c.toFixed(2))+","+$APP.S.g((a-e).toFixed(2))+" "+$APP.S.g(c.toFixed(2))+","+$APP.S.g(a.toFixed(2))+"L"+$APP.S.g(c.toFixed(2))+","+$APP.S.g((d-a).toFixed(2))+"C"+$APP.S.g(c.toFixed(2))+","+$APP.S.g((d-a+e).toFixed(2))+
|
|
10
|
+
" "+$APP.S.g((c-a+e).toFixed(2))+","+$APP.S.g(d.toFixed(2))+" "+$APP.S.g((c-a).toFixed(2))+","+$APP.S.g(d.toFixed(2))+"L"+$APP.S.g(a.toFixed(2))+","+$APP.S.g(d.toFixed(2))+"C"+$APP.S.g((a-e).toFixed(2))+","+$APP.S.g(d.toFixed(2))+" 0,"+$APP.S.g((d-a+e).toFixed(2))+" 0,"+$APP.S.g((d-a).toFixed(2))+"L0,"+$APP.S.g(a.toFixed(2))+"C0,"+$APP.S.g((a-e).toFixed(2))+" "+$APP.S.g((a-e).toFixed(2))+",0 "+$APP.S.g(a.toFixed(2))+",0Z";b.setAttribute("d",c)},JD=function(a){$APP.r($APP.l(a,"__xSoftBodyRaf"))||($APP.n(a,
|
|
11
|
+
"__xSoftBodyLF",performance.now()),$APP.n(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return ID(a)})))},KD=function(a){var b=$APP.l(a,"__xSoftBodyRaf");$APP.r(b)&&(cancelAnimationFrame(b),a.__xSoftBodyRaf=null)},LD=function(a,b){var c=$APP.N($APP.l(a,"__xSoftBodyRefs"));c=$APP.G(c,$APP.xj).getBoundingClientRect();a.__xSoftBodyPX=b.clientX-c.left;a.__xSoftBodyPY=b.clientY-c.top;return null},MD=function(a){function b(){a.__xSoftBodyGrab=!1;a.dispatchEvent(new CustomEvent("x-soft-body-release",
|
|
12
|
+
{bubbles:!0,composed:!0,detail:{}}));return null}function c(h){a.__xSoftBodyGrab=!0;LD(a,h);a.dispatchEvent(new CustomEvent("x-soft-body-grab",{bubbles:!0,composed:!0,detail:{}}));return null}function d(){a.__xSoftBodyPA=!1;a.__xSoftBodyGrab=!1;return null}function e(){a.__xSoftBodyPA=!0;var h=$APP.W.g($APP.l(a,"__xSoftBodyModel"));h=$APP.r(h)?h:yD();$APP.r(h)||JD(a);return null}function g(h){return LD(a,h)}$APP.n(a,"__xSoftBodyHdl",{move:g,enter:e,leave:d,down:c,up:b});a.addEventListener("pointermove",
|
|
13
|
+
g,{passive:!0});a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("pointerdown",c);a.addEventListener("pointerup",b)},ND=function(a){var b=$APP.l(a,"__xSoftBodyHdl");$APP.r(b)&&(a.removeEventListener("pointermove",$APP.l(b,"move")),a.removeEventListener("pointerenter",$APP.l(b,"enter")),a.removeEventListener("pointerleave",$APP.l(b,"leave")),a.removeEventListener("pointerdown",$APP.l(b,"down")),a.removeEventListener("pointerup",$APP.l(b,"up")),a.__xSoftBodyHdl=
|
|
14
|
+
null)},OD=function(a){Object.defineProperty(a,"stiffness",{get:function(){var b=this.getAttribute("stiffness");return vD(b,180,10,1E3)},set:function(b){return b==null?this.removeAttribute("stiffness"):this.setAttribute("stiffness",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"damping",{get:function(){var b=this.getAttribute("damping");return vD(b,12,1,100)},set:function(b){return b==null?this.removeAttribute("damping"):this.setAttribute("damping",""+$APP.S.g(b))},enumerable:!0,
|
|
15
|
+
configurable:!0});Object.defineProperty(a,"radius",{get:function(){var b=this.getAttribute("radius");return vD(b,16,6,200)},set:function(b){return b==null?this.removeAttribute("radius"):this.setAttribute("radius",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"intensity",{get:function(){var b=this.getAttribute("intensity");return vD(b,1,0,5)},set:function(b){return b==null?this.removeAttribute("intensity"):this.setAttribute("intensity",""+$APP.S.g(b))},enumerable:!0,configurable:!0});
|
|
16
|
+
Object.defineProperty(a,"grabRadius",{get:function(){var b=this.getAttribute("grab-radius");return vD(b,80,10,500)},set:function(b){return b==null?this.removeAttribute("grab-radius"):this.setAttribute("grab-radius",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.r(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},QD=function(){var a=
|
|
17
|
+
class extends HTMLElement{};a.observedAttributes=PD;a.prototype.connectedCallback=function(){var b=this,c=ED(b);b.__xSoftBodyModel=c;$APP.r($APP.l(b,"__xSoftBodyRefs"))||BD(b);b.__xSoftBodyPA=!1;b.__xSoftBodyGrab=!1;b.__xSoftBodyPX=0;b.__xSoftBodyPY=0;c=new ResizeObserver(function(d){if(d.length>0){var e=d[0].contentRect;d=e.width;e=e.height;if(d>0&&e>0){b.__xSoftBodyW=d;b.__xSoftBodyH=e;var g=$APP.N($APP.l(b,"__xSoftBodyRefs"));$APP.G(g,$APP.xj).setAttribute("viewBox","0 0 "+$APP.S.g(d)+" "+$APP.S.g(e));
|
|
18
|
+
FD(b,d,e);d=$APP.W.g($APP.l(b,"__xSoftBodyModel"));d=$APP.r(d)?d:yD();$APP.r(d)?HD(b):(GD(b),JD(b))}}return null});b.__xSoftBodyRO=c;c.observe(b);ND(b);MD(b);return null};a.prototype.disconnectedCallback=function(){KD(this);ND(this);var b=$APP.l(this,"__xSoftBodyRO");$APP.r(b)&&(b.disconnect(),this.__xSoftBodyRO=null);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&$APP.r($APP.l(this,"__xSoftBodyRefs"))&&(this.__xSoftBodyModel=b=ED(this),c=$APP.l(this,"__xSoftBodyW"),
|
|
19
|
+
d=$APP.l(this,"__xSoftBodyH"),$APP.r($APP.r(c)?$APP.r(d)?c>0&&d>0:d:c)&&(FD(this,c,d),b=$APP.W.g(b),b=$APP.r(b)?b:yD(),$APP.r(b)?(KD(this),HD(this)):(GD(this),JD(this))));return null};OD(a.prototype);return a},RD=function(){$APP.r(customElements.get("x-soft-body"))||customElements.define("x-soft-body",QD());return null},DD=new $APP.M(null,"grab-radius","grab-radius",771838535),CD=new $APP.M(null,"grab-radius-raw","grab-radius-raw",-1019405976);var PD="stiffness damping radius intensity grab-radius disabled".split(" ");$APP.Sd(["x-soft-body-grab",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null),"x-soft-body-release",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null)]);var AD=":host{display:block;position:relative;background:none;overflow:visible;"+$APP.S.g("--x-soft-body-bg")+":#ffffff;"+$APP.S.g("--x-soft-body-border")+":#e2e8f0;"+$APP.S.g("--x-soft-body-border-width")+":1.5;"+$APP.S.g("--x-soft-body-shadow")+":0 1px 3px rgba(0,0,0,0.1);"+$APP.S.g("--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("+$APP.S.g("--x-soft-body-bg")+",#ffffff);stroke:var("+
|
|
20
|
+
$APP.S.g("--x-soft-body-border")+",#e2e8f0);stroke-width:var("+$APP.S.g("--x-soft-body-border-width")+",1.5);filter:drop-shadow(var("+$APP.S.g("--x-soft-body-shadow")+",0 1px 3px rgba(0,0,0,0.1)));}[part\x3dcontent]{position:relative;background:none;padding:var("+$APP.S.g("--x-soft-body-padding")+",1rem);z-index:1;}@media(prefers-color-scheme:dark){:host{"+$APP.S.g("--x-soft-body-bg")+":#1e293b;"+$APP.S.g("--x-soft-body-border")+":#475569;"+$APP.S.g("--x-soft-body-shadow")+":0 1px 3px rgba(0,0,0,0.3);}}@media(prefers-reduced-motion:reduce){[part\x3dshape]{transition:none!important;}}",
|
|
21
|
+
ID=function ID(a){if($APP.r(a.isConnected)){var c=$APP.l(a,"__xSoftBodyModel"),d=performance.now(),e=Math.min(d-$APP.l(a,"__xSoftBodyLF"),100)/1E3,g=$APP.Vk.g(c),h=$APP.Vj.g(c),k=$APP.Gj.g(c),m=DD.g(c);c=$APP.l(a,"__xSoftBodyRX");var p=$APP.l(a,"__xSoftBodyRY"),q=$APP.l(a,"__xSoftBodyCX"),w=$APP.l(a,"__xSoftBodyCY"),x=$APP.l(a,"__xSoftBodyVX"),y=$APP.l(a,"__xSoftBodyVY"),A=$APP.l(a,"__xSoftBodyPA"),C=$APP.l(a,"__xSoftBodyPX"),E=$APP.l(a,"__xSoftBodyPY"),H=$APP.l(a,"__xSoftBodyGrab");a.__xSoftBodyLF=
|
|
22
|
+
d;for(d=0;;)if(d<20){var F=c[d],K=p[d],X=$APP.r(A)?xD(F,K,C,E,m,k,H):[0,0];F=wD(q[d],F+X[0],x[d],e,g,h);K=wD(w[d],K+X[1],y[d],e,g,h);q[d]=F[0];x[d]=F[1];w[d]=K[0];y[d]=K[1];d+=1}else break;GD(a);if($APP.r($APP.r(A)?A:!zD(x,y)))$APP.n(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return ID.g?ID.g(a):ID.call(null,a)}));else{for(e=0;;)if(e<20)q[e]=c[e],w[e]=p[e],e+=1;else break;GD(a);a.__xSoftBodyRaf=null}}return null};$APP.ka("baredom.exports.x_soft_body.init",RD);export const init=RD;
|
package/dist/x-spacer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d=$APP.
|
|
4
|
-
"grow",{get:function(){return
|
|
5
|
-
b.appendChild(c);this.__xSpacerRefs={root:b}}
|
|
6
|
-
"grow-raw",441172903),
|
|
2
|
+
var DG=function(a){return a!=null&&$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},JG=function(a){var b=new $APP.P(null,3,[$APP.Yk,a.getAttribute("size"),EG,a.getAttribute("axis"),FG,a.getAttribute("grow")],null);b=$APP.N(b);var c=$APP.G(b,$APP.Yk),d=$APP.G(b,EG);b=$APP.G(b,FG);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.J(GG,d)?d:"vertical";b=new $APP.P(null,3,[$APP.rh,c,HG,d,IG,DG(b)],null);c=$APP.N(b);b=$APP.G(c,$APP.rh);
|
|
3
|
+
d=$APP.G(c,HG);c=$APP.G(c,IG);var e=a.style;a.setAttribute("data-axis",d);a.setAttribute("data-grow",$APP.r(c)?"true":"false");e.setProperty("--x-spacer-size",b);a.setAttribute("role","none");a.setAttribute("aria-hidden","true")},KG=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.r(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},LG=function(a){Object.defineProperty(a,
|
|
4
|
+
"grow",{get:function(){return DG(this.getAttribute("grow"))},set:function(b){return $APP.r(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},MG=function(a){KG(a,"size","1rem");KG(a,"axis","vertical");LG(a)},OG=function(){var a=class extends HTMLElement{};a.observedAttributes=NG;a.prototype.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSpacerRefs"))){var b=this.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;}";
|
|
5
|
+
b.appendChild(c);this.__xSpacerRefs={root:b}}JG(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.r(b?$APP.l(this,"__xSpacerRefs"):b)&&JG(this);return null};MG(a.prototype);return a},PG=function(){$APP.r(customElements.get("x-spacer"))||customElements.define("x-spacer",OG());return null},HG=new $APP.M(null,"axis","axis",-1215390822),IG=new $APP.M(null,"grow?","grow?",2124334580),FG=new $APP.M(null,"grow-raw",
|
|
6
|
+
"grow-raw",441172903),EG=new $APP.M(null,"axis-raw","axis-raw",291213231);var NG=["size","axis","grow"],GG=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null);$APP.ka("baredom.exports.x_spacer.init",PG);export const init=PG;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},
|
|
4
|
-
$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.
|
|
2
|
+
var wV=function(a){var b=new $APP.P(null,3,[$APP.rh,a.getAttribute("size"),$APP.Fh,a.getAttribute("variant"),$APP.T,a.getAttribute("label")],null);var c=$APP.N(b),d=$APP.G(c,$APP.rh);b=$APP.G(c,$APP.Fh);c=$APP.G(c,$APP.T);d=typeof d==="string"&&$APP.J(uV,d)?d:"md";b=typeof b==="string"&&$APP.J(vV,b)?b:"default";c=typeof c==="string"&&$APP.O("",c.trim())?c.trim():"Loading";d=$APP.N(new $APP.P(null,3,[$APP.rh,d,$APP.Fh,b,$APP.T,c],null));b=$APP.G(d,$APP.rh);c=$APP.G(d,$APP.Fh);d=$APP.G(d,$APP.T);a.setAttribute("data-size",
|
|
3
|
+
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},xV=function(a){Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.r(b)?b:"md"},set:function(b){return $APP.r(b)?this.setAttribute("size",""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.r(b)?b:"default"},set:function(b){return $APP.r(b)?this.setAttribute("variant",""+
|
|
4
|
+
$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.r(b)?b:"Loading"},set:function(b){return $APP.r(b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},zV=function(){var a=class extends HTMLElement{};a.observedAttributes=yV;a.prototype.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSpinnerInit"))){var b=this.attachShadow({mode:"open"}),
|
|
5
5
|
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:#3b82f6;}:host([data-variant\x3d'success']){--x-spinner-color:#22c55e;}:host([data-variant\x3d'warning']){--x-spinner-color:#f59e0b;}:host([data-variant\x3d'danger']){--x-spinner-color:#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;}}";
|
|
6
|
-
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}
|
|
7
|
-
customElements.define("x-spinner",
|
|
6
|
+
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}wV(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.r(b?$APP.l(this,"__xSpinnerInit"):b)&&wV(this);return null};xV(a.prototype);return a},AV=function(){$APP.r(customElements.get("x-spinner"))||
|
|
7
|
+
customElements.define("x-spinner",zV());return null};var yV=["size","variant","label"],uV=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),vV=new $APP.R(null,new $APP.P(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null);$APP.ka("baredom.exports.x_spinner.init",AV);export const init=AV;
|
package/dist/x-splash.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var CI=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.r(isNaN(a))?null:$APP.Yg.i(0,$APP.Zg.i(100,a))):null},DI=function(a){return a==null?!0:$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},II=function(a){var b=$APP.l(a,"__xSplashRefs");if($APP.r(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("div"),
|
|
3
|
+
m=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-splash-bg:#ffffff;--x-splash-color:#0f172a;--x-splash-z-index:9999;--x-splash-fade-duration:400ms;--x-splash-fade-ease:cubic-bezier(0.4,0,0.2,1);--x-splash-spinner-size:40px;--x-splash-spinner-color:currentColor;--x-splash-spinner-track-color: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:#3b82f6;--x-splash-progress-track-color:rgba(0,0,0,0.08);--x-splash-progress-radius:2px;--x-splash-gap:20px;--x-splash-blur-amount:8px;}@media (prefers-color-scheme:dark){:host{--x-splash-bg:#0f172a;--x-splash-color:#f8fafc;--x-splash-spinner-track-color:rgba(255,255,255,0.15);--x-splash-progress-track-color: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");k.setAttribute("part","progress");k.setAttribute("role","progressbar");k.setAttribute("aria-valuemin","0");k.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");k.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(k);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.P(null,6,[$APP.bi,b,EI,d,FI,e,GI,h,$APP.Ei,k,HI,
|
|
5
|
+
m],null);return $APP.l(a,"__xSplashRefs")},JI=function(a){a=typeof a==="string"?a.trim():"";return $APP.D.i(a,"")||$APP.D.i(a,"0")||$APP.D.i(a,"0ms")||$APP.D.i(a,"0s")?0:$APP.r(a.endsWith("ms"))?(a=parseFloat(a.slice(0,a.length-2)),$APP.r(isNaN(a))?0:Math.max(0,Math.round(a))):$APP.r(a.endsWith("s"))?(a=parseFloat(a.slice(0,a.length-1)),$APP.r(isNaN(a))?0:Math.max(0,Math.round(1E3*a))):0},KI=function(a){a=window.getComputedStyle(a);a=JI(a.getPropertyValue("--x-splash-fade-duration"));return a>0?a:
|
|
6
|
+
400},LI=function(a){var b=$APP.l(a,"__xSplashFadeTimer");$APP.r(b)&&(clearTimeout(b),a.__xSplashFadeTimer=null)},MI=function(a){LI(a);a.__xSplashFadingOut=!1;a.removeAttribute("data-fading-out");var b=II(a);b=$APP.N(b);$APP.G(b,EI).style.display="none";a.removeAttribute("aria-busy");b=new CustomEvent("x-splash-hidden",{detail:{},bubbles:!0,composed:!0,cancelable:!1});a.dispatchEvent(b);return null},NI=function(a){if(!$APP.r($APP.l(a,"__xSplashFadingOut")))if(a.__xSplashFadingOut=!0,$APP.I(window.matchMedia("(prefers-reduced-motion:reduce)").matches))MI(a);
|
|
7
|
+
else{var b=II(a);b=$APP.N(b);var c=$APP.G(b,EI),d=function h(g){return $APP.D.i(g.target,c)&&$APP.D.i(g.propertyName,"opacity")?(c.removeEventListener("transitionend",h),$APP.r($APP.l(a,"__xSplashFadingOut"))?MI(a):null):null};c.style.display="flex";c.style.opacity="1";a.setAttribute("data-fading-out","");c.addEventListener("transitionend",d);requestAnimationFrame(function(){return requestAnimationFrame(function(){return $APP.r($APP.l(a,"__xSplashFadingOut"))?c.style.opacity="0":null})});$APP.n(a,
|
|
8
|
+
"__xSplashFadeTimer",setTimeout(function(){return $APP.r($APP.l(a,"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),MI(a)):null},KI(a)+60))}},WI=function(a){var b=new $APP.P(null,5,[OI,a.hasAttribute("active"),$APP.Ak,a.getAttribute("variant"),$APP.tj,a.getAttribute("progress"),PI,a.getAttribute("spinner"),QI,a.getAttribute("overlay")],null);var c=$APP.N(b);b=$APP.G(c,OI);var d=$APP.G(c,$APP.Ak),e=$APP.G(c,$APP.tj),g=$APP.G(c,PI);c=$APP.G(c,QI);b=$APP.I(b);d=typeof d==="string"?d.trim().toLowerCase():
|
|
9
|
+
null;d=$APP.J(RI,d)?d:"default";e=CI(e);g=DI(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.J(SI,c)?c:"solid";b=new $APP.P(null,5,[TI,b,$APP.Fh,d,$APP.dl,e,UI,g,VI,c],null);if($APP.O($APP.l(a,"__xSplashModel"),b)){b=$APP.N(b);c=$APP.G(b,TI);e=$APP.G(b,$APP.Fh);d=$APP.G(b,$APP.dl);var h=$APP.G(b,UI),k=$APP.G(b,VI);g=II(a);var m=$APP.N(g);g=$APP.G(m,EI);var p=$APP.G(m,GI),q=$APP.G(m,$APP.Ei),w=$APP.G(m,HI);m=$APP.l(a,"__xSplashModel");var x=TI.g(m);a.setAttribute("data-variant",e);a.setAttribute("data-overlay",
|
|
10
|
+
k);p.style.display=$APP.r(h)?"block":"none";d!=null?(q.style.display="block",w.style.width=""+$APP.S.g(d)+"%",q.setAttribute("aria-valuenow",""+$APP.S.g(d))):(q.style.display="none",q.removeAttribute("aria-valuenow"));$APP.r($APP.r(c)?$APP.t(x):c)?($APP.r($APP.l(a,"__xSplashFadingOut"))&&(LI(a),a.__xSplashFadingOut=!1,a.removeAttribute("data-fading-out"),c=II(a),c=$APP.N(c),c=$APP.G(c,EI),c.style.display="",c.style.opacity=""),a.setAttribute("aria-busy","true"),a.setAttribute("aria-live","polite"),
|
|
11
|
+
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.t(c),$APP.r(e?x:e)?NI(a):$APP.t(c)&&m==null&&(g.style.display="none",a.removeAttribute("aria-busy")));$APP.r(a.hasAttribute("aria-label"))||a.setAttribute("aria-label","Loading");a.__xSplashModel=b}},XI=function(a){Object.defineProperty(a,"active",{get:function(){return this.hasAttribute("active")},set:function(b){return $APP.r(b)?this.setAttribute("active",""):this.removeAttribute("active")},enumerable:!0,configurable:!0});
|
|
12
|
+
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.r(b)?b:"default"},set:function(b){return $APP.r(b)?this.setAttribute("variant",""+$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"progress",{get:function(){return CI(this.getAttribute("progress"))},set:function(b){return b==null?this.removeAttribute("progress"):this.setAttribute("progress",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
13
|
+
"spinner",{get:function(){return DI(this.getAttribute("spinner"))},set:function(b){return $APP.r(b)?this.setAttribute("spinner",""):this.setAttribute("spinner","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"overlay",{get:function(){var b=this.getAttribute("overlay");return $APP.r(b)?b:"solid"},set:function(b){return $APP.r(b)?this.setAttribute("overlay",""+$APP.S.g(b)):this.removeAttribute("overlay")},enumerable:!0,configurable:!0})},ZI=function(){var a=class extends HTMLElement{};
|
|
14
|
+
a.observedAttributes=YI;a.prototype.connectedCallback=function(){II(this);LI(this);WI(this);return null};a.prototype.disconnectedCallback=function(){LI(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&WI(this);return null};XI(a.prototype);return a},$I=function(){$APP.r(customElements.get("x-splash"))||customElements.define("x-splash",ZI());return null},EI=new $APP.M(null,"overlay-el","overlay-el",-308547109),FI=new $APP.M(null,"content-el","content-el",-1423019925),
|
|
15
|
+
GI=new $APP.M(null,"spinner-el","spinner-el",-1536400516),HI=new $APP.M(null,"bar-el","bar-el",2050414242),UI=new $APP.M(null,"spinner?","spinner?",939139177),TI=new $APP.M(null,"active?","active?",459499776),OI=new $APP.M(null,"active-present?","active-present?",73064660),PI=new $APP.M(null,"spinner-attr","spinner-attr",-479327548),QI=new $APP.M(null,"overlay-raw","overlay-raw",1018775670),VI=new $APP.M(null,"overlay","overlay",-139131598);var YI=["active","variant","progress","spinner","overlay"];$APP.Sd(["x-splash-hidden",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null)]);var RI=new $APP.R(null,new $APP.P(null,3,["minimal",null,"branded",null,"default",null],null),null),SI=new $APP.R(null,new $APP.P(null,3,["transparent",null,"solid",null,"blur",null],null),null);$APP.ka("baredom.exports.x_splash.init",$I);export const init=$I;
|
package/dist/x-stat.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
[d,e,g,
|
|
4
|
-
$APP.
|
|
5
|
-
g=$APP.l(a,"__x_stat_hint");return $APP.
|
|
6
|
-
k=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),
|
|
7
|
-
d.setAttribute("part","base");e.setAttribute("part","icon");g.setAttribute("part","body");h.setAttribute("part","label");k.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");y.setAttribute("name","label");A.setAttribute("name","value");
|
|
8
|
-
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=
|
|
9
|
-
"trend");
|
|
10
|
-
|
|
2
|
+
var bK=function(a,b,c){return $APP.J(b,a)?a:c},cK=function(a){return $APP.r($APP.r(a)?$APP.O("",a):a)?a:null},lK=function(a){var b=$APP.N(a),c=$APP.G(b,dK),d=$APP.G(b,eK),e=$APP.G(b,$APP.Qi),g=$APP.G(b,$APP.Fh);a=$APP.G(b,$APP.ui);var h=$APP.G(b,$APP.$k),k=$APP.G(b,$APP.rh),m=$APP.G(b,$APP.Ck);b=$APP.G(b,$APP.T);g=bK(g,fK,"default");e=bK(e,gK,"start");k=bK(k,hK,"md");c=bK(c,iK,"normal");d=bK(d,jK,"neutral");m=$APP.I(m);return $APP.Q([eK,$APP.Qi,$APP.Fh,$APP.ui,$APP.$k,$APP.rh,$APP.Ck,$APP.T,kK,dK],
|
|
3
|
+
[d,e,g,cK(a),cK(h),k,m,cK(b),m?"true":null,c])},mK=function(a){return $APP.Q([eK,$APP.Qi,$APP.Fh,$APP.ui,$APP.$k,$APP.rh,$APP.Ck,$APP.T,dK],[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")])},nK=function(a,b){a.setAttribute("role","figure");var c=kK.g(b);$APP.r(c)?a.setAttribute("aria-busy",c):a.removeAttribute("aria-busy");b=
|
|
4
|
+
$APP.T.g(b);$APP.r(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},oK=function(a,b){a.setAttribute("data-variant",$APP.Fh.g(b));a.setAttribute("data-align",$APP.Qi.g(b));a.setAttribute("data-size",$APP.rh.g(b));a.setAttribute("data-emphasis",dK.g(b));a.setAttribute("data-trend",eK.g(b));$APP.r($APP.Ck.g(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},pK=function(a){var b=lK(mK(a)),c=$APP.l(a,"__x_stat_base"),d=$APP.l(a,"__x_stat_label"),e=$APP.l(a,"__x_stat_value"),
|
|
5
|
+
g=$APP.l(a,"__x_stat_hint");return $APP.r(c)?(nK(a,b),oK(c,b),d.textContent=function(){var h=$APP.T.g(b);return $APP.r(h)?h:""}(),e.textContent=function(){var h=$APP.ui.g(b);return $APP.r(h)?h:""}(),g.textContent=function(){var h=$APP.$k.g(b);return $APP.r(h)?h:""}()):null},qK=function(a){if($APP.l(a,"__x_stat_initialized")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),
|
|
6
|
+
k=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("span"),w=document.createElement("span"),x=document.createElement("slot"),y=document.createElement("slot"),A=document.createElement("slot"),C=document.createElement("slot"),E=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-stat-background:transparent;--x-stat-color:inherit;--x-stat-muted-color:rgba(0,0,0,0.55);--x-stat-border-color:transparent;--x-stat-radius: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:#16a34a;--x-stat-warning-color:#d97706;--x-stat-danger-color:#dc2626;--x-stat-transition-duration:120ms;--x-stat-transition-timing:ease;--x-stat-loading-opacity:0.6;}@media (prefers-color-scheme:dark){:host{--x-stat-muted-color:rgba(255,255,255,0.55);--x-stat-positive-color:#4ade80;--x-stat-warning-color:#fbbf24;--x-stat-danger-color:#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");g.setAttribute("part","body");h.setAttribute("part","label");k.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");y.setAttribute("name","label");A.setAttribute("name","value");C.setAttribute("name","hint");e.appendChild(x);h.appendChild(y);h.appendChild(p);k.appendChild(A);k.appendChild(q);m.appendChild(C);m.appendChild(w);g.appendChild(h);g.appendChild(k);g.appendChild(m);g.appendChild(E);d.appendChild(e);
|
|
8
|
+
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=q;a.__x_stat_hint=w;a.__x_stat_initialized=!0}pK(a);return a},rK=function(a,b){Object.defineProperty(a,b,{get:function(){var c=this.getAttribute(b);return $APP.r(c)?c:""},set:function(c){return $APP.r(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},sK=function(a){rK(a,"variant");rK(a,"align");rK(a,"size");rK(a,"emphasis");rK(a,
|
|
9
|
+
"trend");rK(a,"label");rK(a,"value");rK(a,"hint");Object.defineProperty(a,"loading",{get:function(){return this.hasAttribute("loading")},set:function(b){return $APP.r(b)?this.setAttribute("loading",""):this.removeAttribute("loading")},enumerable:!0,configurable:!0})},uK=function(){var a=class extends HTMLElement{};a.observedAttributes=tK;a.prototype.connectedCallback=function(){return qK(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_stat_initialized")===!0?pK(this):
|
|
10
|
+
qK(this)};sK(a.prototype);return a},vK=function(){return $APP.r(customElements.get("x-stat"))?null:customElements.define("x-stat",uK())},dK=new $APP.M(null,"emphasis","emphasis",293543451),kK=new $APP.M(null,"aria-busy","aria-busy",793864247),eK=new $APP.M(null,"trend","trend",54563841);var tK="variant align size emphasis trend loading label value hint".split(" "),fK=new $APP.R(null,new $APP.P(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),gK=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null),hK=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),iK=new $APP.R(null,new $APP.P(null,2,["high",null,"normal",null],null),null),jK=new $APP.R(null,new $APP.P(null,3,["neutral",null,
|
|
11
11
|
"up",null,"down",null],null),null);
|
|
12
|
-
$APP.
|
|
13
|
-
"size",$APP.Z,$APP.
|
|
12
|
+
$APP.Q([eK,$APP.Qi,$APP.Fh,$APP.ui,$APP.$k,$APP.rh,$APP.Ck,$APP.T,dK],[new $APP.P(null,4,[$APP.tk,"trend",$APP.Z,$APP.Y,$APP.Kh,"neutral",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"align",$APP.Z,$APP.Y,$APP.Kh,"start",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"variant",$APP.Z,$APP.Y,$APP.Kh,"default",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"value",$APP.Z,$APP.Y,$APP.Kh,"",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"hint",$APP.Z,$APP.Y,$APP.Kh,"",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,
|
|
13
|
+
"size",$APP.Z,$APP.Y,$APP.Kh,"md",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"loading",$APP.Z,$APP.qj,$APP.Kh,!1,$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"label",$APP.Z,$APP.Y,$APP.Kh,"",$APP.Mh,!0],null),new $APP.P(null,4,[$APP.tk,"emphasis",$APP.Z,$APP.Y,$APP.Kh,"normal",$APP.Mh,!0],null)]);$APP.ka("baredom.exports.x_stat.init",vK);export const init=vK;
|
package/dist/x-stepper.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
10),typeof a==="number"&&$APP.
|
|
4
|
-
2,[$APP.
|
|
5
|
-
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.
|
|
6
|
-
c=
|
|
7
|
-
$APP.
|
|
8
|
-
}}b=$APP.
|
|
9
|
-
"step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.
|
|
10
|
-
g.appendChild(
|
|
11
|
-
p,
|
|
12
|
-
typeof d==="number"&&$APP.
|
|
13
|
-
(c=$APP.
|
|
14
|
-
this.removeAttribute("current"):this.setAttribute("current",""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return
|
|
15
|
-
""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.
|
|
16
|
-
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&
|
|
17
|
-
"
|
|
2
|
+
var Jn=function(a,b){return new $APP.ud(null,function(){if(a>0){var c=$APP.u(b);return c?$APP.rd($APP.v(c),Jn(a-1,$APP.Zb(c))):null}return null},null)},Mn=function(a){a=$APP.G(Kn,typeof a==="string"?a.toLowerCase():null);return $APP.r(a)?a:Ln},On=function(a){a=$APP.G(Nn,a);return $APP.r(a)?a:"horizontal"},Rn=function(a){a=$APP.G(Pn,typeof a==="string"?a.toLowerCase():null);return $APP.r(a)?a:Qn},Tn=function(a){a=$APP.G(Sn,a);return $APP.r(a)?a:"md"},Un=function(a){return typeof a==="string"?(a=parseInt(a.trim(),
|
|
3
|
+
10),typeof a==="number"&&$APP.t(isNaN(a))&&a>=0?a:0):0},Vn=function(a){if(typeof a==="string"){var b=a.trim();if($APP.r($APP.lg(/^\d+$/,b)))return a=parseInt(b,10),a>0&&a<=200?$APP.je(function(g){return new $APP.P(null,2,[$APP.T,"Step "+$APP.S.g(g),$APP.Hj,null],null)},$APP.kg(1,a+1)):$APP.ie;if($APP.r(function(){var g=$APP.O("",b);return g?b.startsWith("["):g}()))try{var c=JSON.parse(b);if($APP.r(Array.isArray(c))){var d=$APP.wc(c),e=$APP.B(d)>200?Jn(200,d):d;return $APP.je(function(g){return new $APP.P(null,
|
|
4
|
+
2,[$APP.T,function(){var h=$APP.l(g,"label");return typeof h==="string"?h:""}(),$APP.Hj,function(){var h=$APP.l(g,"description");return typeof h==="string"?h:null}()],null)},e)}return $APP.ie}catch(g){return $APP.ie}else return $APP.ie}else return $APP.ie},Wn=function(a){var b=$APP.l(a,"__xStepperRefs");if($APP.r(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:0.875rem;--x-stepper-label-font-weight:500;--x-stepper-desc-font-size:0.75rem;--x-stepper-radius:999px;--x-stepper-motion:120ms;--x-stepper-press-scale:0.93;--x-stepper-focus-ring:rgba(0,0,0,0.55);--x-stepper-disabled-opacity:0.5;--x-stepper-complete-bg:rgba(16,140,72,1);--x-stepper-complete-color:#fff;--x-stepper-complete-connector:rgba(16,140,72,1);--x-stepper-current-bg:rgba(0,102,204,1);--x-stepper-current-color:#fff;--x-stepper-upcoming-bg:rgba(0,0,0,0.08);--x-stepper-upcoming-color:rgba(0,0,0,0.45);--x-stepper-idle-connector:rgba(0,0,0,0.12);--x-stepper-label-done-color:rgba(0,0,0,0.85);--x-stepper-label-current-color:rgba(0,0,0,0.85);--x-stepper-label-upcoming-color:rgba(0,0,0,0.4);--x-stepper-desc-color:rgba(0,0,0,0.4);}@media (prefers-color-scheme:dark){:host{--x-stepper-focus-ring:rgba(255,255,255,0.7);--x-stepper-complete-bg:rgba(60,210,120,1);--x-stepper-complete-color:#000;--x-stepper-complete-connector:rgba(60,210,120,1);--x-stepper-current-bg:rgba(80,160,255,1);--x-stepper-current-color:#000;--x-stepper-upcoming-bg:rgba(255,255,255,0.1);--x-stepper-upcoming-color:rgba(255,255,255,0.35);--x-stepper-idle-connector:rgba(255,255,255,0.12);--x-stepper-label-done-color:rgba(255,255,255,0.9);--x-stepper-label-current-color:rgba(255,255,255,0.9);--x-stepper-label-upcoming-color:rgba(255,255,255,0.3);--x-stepper-desc-color: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.P(null,2,[$APP.bi,b,$APP.Zi,d],null);return $APP.l(a,"__xStepperRefs")},$n=function(a){a=new $APP.P(null,5,[Xn,a.getAttribute("steps"),Yn,a.getAttribute("current"),$APP.Zk,a.getAttribute("orientation"),$APP.Yk,a.getAttribute("size"),$APP.W,a.hasAttribute("disabled")],null);var b=$APP.N(a),c=$APP.G(b,Xn);a=$APP.G(b,Yn);var d=$APP.G(b,$APP.Zk),e=$APP.G(b,$APP.Yk);b=$APP.G(b,$APP.W);
|
|
6
|
+
c=Vn(c);var g=$APP.B(c);return new $APP.P(null,5,[$APP.wl,c,Zn,g===0?0:$APP.Yg.i(0,$APP.Zg.i(Un(a),g-1)),$APP.xk,Mn(d),$APP.rh,Rn(e),$APP.W,$APP.I(b)],null)},ao=function(a,b,c){return"Step "+$APP.S.g(a+1)+": "+$APP.S.g(b)+" ("+$APP.S.g(function(){var d=c instanceof $APP.M?c.ra:null;switch(d){case "complete":return"completed";case "current":return"current";case "upcoming":return"upcoming";default:throw Error("No matching clause: "+$APP.S.g(d));}}())+")"},bo=function(a,b,c,d){var e=$APP.N(b);b=$APP.G(e,
|
|
7
|
+
$APP.T);e=$APP.G(e,$APP.Hj);var g=document.createElement("div"),h=document.createElement("div"),k=document.createElement("button"),m=document.createElement("span"),p=document.createElement("div"),q=document.createElement("div"),w=document.createElement("span"),x=document.createElement("span");a:{var y=c instanceof $APP.M?c.ra:null;switch(y){case "complete":y="complete";break a;case "current":y="current";break a;case "upcoming":y="upcoming";break a;default:throw Error("No matching clause: "+$APP.S.g(y));
|
|
8
|
+
}}b=$APP.r(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.S.g(a));g.setAttribute("data-state",y);h.setAttribute("part","step-track");k.setAttribute("part","step-indicator");k.setAttribute("type","button");k.setAttribute("aria-label",ao(a,b,c));$APP.D.i(c,Zn)?k.setAttribute("aria-current","step"):k.removeAttribute("aria-current");k.setAttribute("tabindex",$APP.r(d)?"-1":"0");$APP.r(d)&&k.setAttribute("aria-disabled","true");m.setAttribute("part",
|
|
9
|
+
"step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.D.i(c,$APP.El)?"✓":""+$APP.S.g(a+1);p.setAttribute("part","step-connector");p.setAttribute("aria-hidden","true");q.setAttribute("part","step-content");w.setAttribute("part","step-label");w.textContent=b;x.setAttribute("part","step-description");$APP.r($APP.r(e)?$APP.O(e,""):e)?(x.textContent=e,x.style.display="block"):x.style.display="none";k.appendChild(m);h.appendChild(k);h.appendChild(p);q.appendChild(w);q.appendChild(x);g.appendChild(h);
|
|
10
|
+
g.appendChild(q);return g},eo=function(a){var b=$n(a);if($APP.O($APP.l(a,"__xStepperModel"),b)){b=$APP.N(b);var c=$APP.G(b,$APP.wl),d=$APP.G(b,Zn),e=$APP.G(b,$APP.xk),g=$APP.G(b,$APP.rh),h=$APP.G(b,$APP.W),k=Wn(a);k=$APP.N(k);k=$APP.G(k,$APP.Zi);a.setAttribute("data-orientation",On(e));a.setAttribute("data-size",Tn(g));k.innerHTML="";c=$APP.u($APP.Zd($APP.ch,c));e=null;for(var m=g=0;;)if(m<g){var p=e.G(null,m),q=$APP.Cc(p,0,null);p=$APP.Cc(p,1,null);var w=q<d?$APP.El:$APP.D.i(q,d)?Zn:co;k.appendChild(bo(q,
|
|
11
|
+
p,w,h));m+=1}else if(c=$APP.u(c))$APP.Pc(c)?(g=$APP.yb(c),c=$APP.zb(c),e=g,g=$APP.B(g)):(g=$APP.v(c),e=$APP.Cc(g,0,null),g=$APP.Cc(g,1,null),m=e<d?$APP.El:$APP.D.i(e,d)?Zn:co,k.appendChild(bo(e,g,m,h)),c=$APP.z(c),e=null,g=0),m=0;else break;a.__xStepperModel=b}},fo=function(a){function b(d){var e=$APP.l(a,"__xStepperModel");e=$APP.r(e)?e:$n(a);$APP.r($APP.W.g(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.r(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),10),e=Zn.g(e),
|
|
12
|
+
typeof d==="number"&&$APP.t(isNaN(d))&&$APP.O(d,e)&&(e=$APP.nh(new $APP.P(null,2,[$APP.zh,e,$APP.el,d],null)),e=new CustomEvent("x-stepper-change",{detail:e,bubbles:!0,composed:!0,cancelable:!0}),e=a.dispatchEvent(e),$APP.r(e)&&a.setAttribute("current",""+$APP.S.g(d)))));return null}var c=Wn(a);c=$APP.N(c);$APP.G(c,$APP.Zi).addEventListener("click",b);$APP.n(a,"__xStepperHandlers",{click:b})},go=function(a){var b=$APP.l(a,"__xStepperHandlers");if($APP.r(b)){var c=$APP.l(a,"__xStepperRefs");$APP.r(c)&&
|
|
13
|
+
(c=$APP.Zi.g(c),b=$APP.l(b,"click"),$APP.r($APP.r(c)?b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},ho=function(a){Object.defineProperty(a,"steps",{get:function(){var b=this.getAttribute("steps");return $APP.r(b)?b:"[]"},set:function(b){return $APP.r(b)?this.setAttribute("steps",""+$APP.S.g(b)):this.removeAttribute("steps")},enumerable:!0,configurable:!0});Object.defineProperty(a,"current",{get:function(){return Un(this.getAttribute("current"))},set:function(b){return b==null?
|
|
14
|
+
this.removeAttribute("current"):this.setAttribute("current",""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return On(Mn(this.getAttribute("orientation")))},set:function(b){return $APP.r(b)?this.setAttribute("orientation",""+$APP.S.g(b)):this.removeAttribute("orientation")},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){return Tn(Rn(this.getAttribute("size")))},set:function(b){return $APP.r(b)?this.setAttribute("size",
|
|
15
|
+
""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.r(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},jo=function(){var a=class extends HTMLElement{};a.observedAttributes=io;a.prototype.connectedCallback=function(){Wn(this);go(this);fo(this);eo(this);return null};a.prototype.disconnectedCallback=function(){go(this);
|
|
16
|
+
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&eo(this);return null};ho(a.prototype);return a},ko=function(){$APP.r(customElements.get("x-stepper"))||customElements.define("x-stepper",jo());return null},Zn=new $APP.M(null,"current","current",-1088038603),lo=new $APP.M(null,"vertical","vertical",718696748),co=new $APP.M(null,"upcoming","upcoming",1873315471),Xn=new $APP.M(null,"steps-raw","steps-raw",1741812533),Qn=new $APP.M(null,"md","md",707286655),mo=new $APP.M(null,
|
|
17
|
+
"lg","lg",-80787836),Ln=new $APP.M(null,"horizontal","horizontal",2062109475),no=new $APP.M(null,"sm","sm",-1402575065),Yn=new $APP.M(null,"current-raw","current-raw",-1440665509);var io=["steps","current","orientation","size","disabled"];$APP.Sd(["x-stepper-change",new $APP.P(null,2,[$APP.U,new $APP.P(null,2,[$APP.zh,$APP.V,$APP.el,$APP.V],null),$APP.kl,!0],null)]);var Kn=new $APP.P(null,2,["horizontal",Ln,"vertical",lo],null),Nn=new $APP.P(null,2,[Ln,"horizontal",lo,"vertical"],null),Pn=new $APP.P(null,3,["sm",no,"md",Qn,"lg",mo],null),Sn=new $APP.P(null,3,[no,"sm",Qn,"md",mo,"lg"],null);$APP.ka("baredom.exports.x_stepper.init",ko);export const init=ko;
|
package/dist/x-switch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.
|
|
4
|
-
e=$APP.
|
|
5
|
-
c.tabIndex=$APP.
|
|
6
|
-
cancelable:!0});a.dispatchEvent(d);return $APP.
|
|
7
|
-
$APP.l(b,"control");b.removeEventListener("click",$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},
|
|
8
|
-
null&&$APP.O(d)?
|
|
2
|
+
var ZM=function(a,b,c){return a.setAttribute(b,c)},$M=function(a,b,c){return $APP.r(c)?a.setAttribute(b,""):a.removeAttribute(b)},aN=function(a){a=$APP.Q([$APP.Ek,$APP.Rk,$APP.sh,$APP.Dh,$APP.Mi,$APP.cj,$APP.vl,$APP.kj,$APP.Ui],[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.N(a);a=
|
|
3
|
+
$APP.G(b,$APP.kj);var c=$APP.G(b,$APP.Ui),d=$APP.G(b,$APP.Ek),e=$APP.G(b,$APP.Rk),g=$APP.G(b,$APP.sh),h=$APP.G(b,$APP.Dh),k=$APP.G(b,$APP.Mi),m=$APP.G(b,$APP.cj);b=$APP.G(b,$APP.vl);k=$APP.I(k);g=$APP.I(g);return $APP.Q([$APP.Lh,$APP.Gh,$APP.Sl,$APP.Wi,$APP.xh,$APP.Si,$APP.ui,$APP.sj,$APP.Ol,$APP.Tk,$APP.W],[g,k?"true":"false",$APP.I(m),k,$APP.r(g)?k:!0,d,b!=null?b:"on",h,c,a,$APP.I(e)])},bN=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.r(b)){var c=$APP.l(b,"control");b=aN(a);var d=$APP.W.g(b),
|
|
4
|
+
e=$APP.Wi.g(b);ZM(c,"aria-checked",$APP.Gh.g(b));c.setAttribute("aria-disabled",$APP.r(d)?"true":"false");ZM(c,"aria-required",$APP.r($APP.Lh.g(b))?"true":"false");ZM(c,"aria-readonly",$APP.r($APP.Sl.g(b))?"true":"false");var g=$APP.Tk.g(b);$APP.r(g)?c.setAttribute("aria-label",g):c.removeAttribute("aria-label");g=$APP.sj.g(b);$APP.r(g)?c.setAttribute("aria-labelledby",g):c.removeAttribute("aria-labelledby");g=$APP.Ol.g(b);$APP.r(g)?c.setAttribute("aria-describedby",g):c.removeAttribute("aria-describedby");
|
|
5
|
+
c.tabIndex=$APP.r(d)?-1:0;$APP.r(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");$M(a,"data-checked",e);$M(a,"data-disabled",d);a=$APP.l(a,"__xSwitchInternals");return $APP.r(a)?a.setFormValue($APP.r(e)?$APP.ui.g(b):null):null}return null},cN=function(a){var b=aN(a),c=$APP.W.g(b),d=$APP.Sl.g(b);if($APP.r($APP.r(c)?c:d))return null;d=$APP.Wi.g(b);c=$APP.t(d);b=$APP.ui.g(b);d=new CustomEvent("x-switch-change-request",{detail:{value:b,previousChecked:d,nextChecked:c},bubbles:!0,composed:!0,
|
|
6
|
+
cancelable:!0});a.dispatchEvent(d);return $APP.t(d.defaultPrevented)?($M(a,"checked",c),bN(a),a.dispatchEvent(new CustomEvent("x-switch-change",{detail:{value:b,checked:c},bubbles:!0,composed:!0,cancelable:!1}))):null},dN=function(a){return function(){return cN(a)}},eN=function(a){return function(b){var c=b.key;return $APP.D.i(c," ")||$APP.D.i(c,"Enter")?(b.preventDefault(),cN(a)):null}},fN=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.r(b)){var c=$APP.l(a,"__xSwitchHandlers");if($APP.r(c)){b=
|
|
7
|
+
$APP.l(b,"control");b.removeEventListener("click",$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},gN=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $M(this,c,$APP.I(d))}})},hN=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.r(d)?d:null},set:function(d){return d!=
|
|
8
|
+
null&&$APP.O(d)?ZM(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},jN=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return iN}});gN(b,"checked","checked");gN(b,"disabled","disabled");gN(b,"readOnly","readonly");gN(b,"required","required");hN(b,"name","name");hN(b,"value","value");b.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSwitchRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),
|
|
9
9
|
e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span");d.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:999px;--x-switch-track-bg:#d1d5db;--x-switch-track-bg-checked:#2563eb;--x-switch-thumb-bg:#ffffff;--x-switch-focus-ring:#60a5fa;--x-switch-disabled-opacity:0.45;--x-switch-transition:background 150ms ease,transform 150ms ease;}@media (prefers-color-scheme:dark){:host{--x-switch-track-bg:#4b5563;--x-switch-track-bg-checked:#3b82f6;--x-switch-thumb-bg:#f9fafb;--x-switch-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;}}";
|
|
10
|
-
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","switch");g.setAttribute("part","track");h.setAttribute("part","thumb");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xSwitchRefs={root:c,control:e,track:g,thumb:h};$APP.
|
|
11
|
-
d),c.addEventListener("keydown",e),this.__xSwitchHandlers=g);d=this.getAttribute("id");$APP.
|
|
12
|
-
function(c){
|
|
10
|
+
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","switch");g.setAttribute("part","track");h.setAttribute("part","thumb");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xSwitchRefs={root:c,control:e,track:g,thumb:h};$APP.r(this.attachInternals)&&(this.__xSwitchInternals=this.attachInternals())}fN(this);c=$APP.l(this,"__xSwitchRefs");$APP.r(c)&&(c=$APP.l(c,"control"),d=dN(this),e=eN(this),g={click:d,keydown:e},c.addEventListener("click",
|
|
11
|
+
d),c.addEventListener("keydown",e),this.__xSwitchHandlers=g);d=this.getAttribute("id");$APP.r(d)&&(c=document.querySelector("label[for\x3d'"+$APP.S.g(d)+"']"),$APP.r(c)&&(e=c.getAttribute("id"),$APP.r(e)?c=e:(d="x-sw-lbl-"+$APP.S.g(d),c.setAttribute("id",d),c=d),d=$APP.l(this,"__xSwitchRefs"),$APP.r(d)&&$APP.l(d,"control").setAttribute("aria-labelledby",c)));return bN(this)};b.disconnectedCallback=function(){return fN(this)};b.attributeChangedCallback=function(){return bN(this)};b.formDisabledCallback=
|
|
12
|
+
function(c){$M(this,"disabled",$APP.I(c));return bN(this)};b.formResetCallback=function(){this.removeAttribute("checked");return bN(this)};return a},kN=function(){return $APP.r(customElements.get("x-switch"))?null:customElements.define("x-switch",jN())};var iN="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.Sd(["x-switch-change-request",new $APP.P(null,2,[$APP.kl,!0,$APP.U,new $APP.P(null,3,[$APP.ui,$APP.Y,$APP.Ej,$APP.qj,$APP.Xk,$APP.qj],null)],null),"x-switch-change",new $APP.P(null,2,[$APP.kl,!1,$APP.U,new $APP.P(null,2,[$APP.ui,$APP.Y,$APP.Hl,$APP.qj],null)],null)]);$APP.ka("baredom.exports.x_switch.init",kN);export const init=kN;
|
package/dist/x-tab.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("selected"),$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
$APP.
|
|
2
|
+
var am=function(a,b,c){return $APP.J(b,a)?a:c},fm=function(a){var b=$APP.N(a),c=$APP.G(b,$APP.zj),d=$APP.G(b,$APP.gj);a=$APP.G(b,$APP.xk);var e=$APP.G(b,$APP.rh),g=$APP.G(b,$APP.Fh),h=$APP.G(b,$APP.T);b=$APP.G(b,bm);c=$APP.I(c);var k=(d=$APP.I(d))?"-1":c?"0":"-1";return new $APP.P(null,8,[$APP.zj,c,$APP.gj,d,$APP.xk,am(a,cm,"horizontal"),$APP.rh,am(e,dm,"md"),$APP.Fh,am(g,em,"default"),$APP.T,h,bm,b,$APP.Tj,k],null)},gm=function(a){return new $APP.P(null,8,[$APP.ui,a.getAttribute("value"),$APP.zj,
|
|
3
|
+
a.hasAttribute("selected"),$APP.gj,a.hasAttribute("disabled"),$APP.xk,a.getAttribute("orientation"),$APP.rh,a.getAttribute("size"),$APP.Fh,a.getAttribute("variant"),$APP.T,a.getAttribute("label"),bm,a.getAttribute("controls")],null)},hm=function(a){var b=fm(gm(a)),c=$APP.l(a,"__x_tab_base");if($APP.r(c)){a.setAttribute("role","tab");a.setAttribute("aria-selected",$APP.r($APP.zj.g(b))?"true":"false");$APP.r($APP.gj.g(b))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("tabindex",
|
|
4
|
+
$APP.Tj.g(b));var d=bm.g(b),e=$APP.T.g(b);$APP.r($APP.r(d)?$APP.O(d,""):d)?a.setAttribute("aria-controls",d):a.removeAttribute("aria-controls");$APP.r($APP.r(e)?$APP.O(e,""):e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");c.setAttribute("data-selected",$APP.r($APP.zj.g(b))?"true":"false");c.setAttribute("data-disabled",$APP.r($APP.gj.g(b))?"true":"false");c.setAttribute("data-size",$APP.rh.g(b));c.setAttribute("data-variant",$APP.Fh.g(b));return c.setAttribute("data-orientation",
|
|
5
|
+
$APP.xk.g(b))}return null},im=function(a){var b=fm(gm(a)),c=$APP.N(b);b=$APP.G(c,$APP.zj);c=$APP.G(c,$APP.gj);$APP.t(c)&&$APP.t(b)?(b=a.getAttribute("value"),a=a.dispatchEvent(new CustomEvent("tab-select",{detail:{value:$APP.r(b)?b:""},bubbles:!0,composed:!0}))):a=null;return a},jm=function(a){a.addEventListener("click",function(){return im(a)});a.addEventListener("keydown",function(b){var c=b.key;$APP.D.i(c,"Enter")||$APP.D.i(c," ")?(b.preventDefault(),b=im(a)):b=null;return b})},km=function(a){if($APP.l(a,
|
|
6
6
|
"__x_tab_initialized")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:inline-block;color-scheme:light dark;outline:none;--x-tab-color:#0f172a;--x-tab-hover-background:rgba(15,23,42,0.05);--x-tab-selected-color:#1d4ed8;--x-tab-selected-background:rgba(59,130,246,0.12);--x-tab-selected-border-color:transparent;}@media (prefers-color-scheme:dark){:host{--x-tab-color:#94a3b8;--x-tab-hover-background:rgba(248,250,252,0.06);--x-tab-selected-color:#60a5fa;--x-tab-selected-background:rgba(59,130,246,0.18);--x-tab-selected-border-color:#60a5fa;}}.base{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;padding:var(--x-tab-padding-md,10px 16px);border-radius:var(--x-tab-radius,8px);color:var(--x-tab-color);background:var(--x-tab-background,transparent);border:1px solid var(--x-tab-border-color,transparent);transition:background var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),border-color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease);}.base[data-size\x3d'sm']{padding:var(--x-tab-padding-sm,6px 12px);}.base[data-size\x3d'md']{padding:var(--x-tab-padding-md,10px 16px);}.base[data-size\x3d'lg']{padding:var(--x-tab-padding-lg,14px 20px);}.base:hover{background:var(--x-tab-hover-background);}.base[data-selected\x3d'true']{color:var(--x-tab-selected-color);background:var(--x-tab-selected-background);border-color:var(--x-tab-selected-border-color);}.base[data-variant\x3d'underline'][data-selected\x3d'true']{border-bottom:2px solid var(--x-tab-selected-color);background:transparent;}.base[data-variant\x3d'pill'][data-selected\x3d'true']{background:var(--x-tab-selected-background);}.base[data-disabled\x3d'true']{opacity:var(--x-tab-disabled-opacity,0.5);cursor:default;}:host(:focus-visible) .base{box-shadow:0 0 0 3px var(--x-tab-focus-ring,rgba(59,130,246,0.4));}@media (prefers-reduced-motion: reduce){.base{transition:none;}}";
|
|
7
|
-
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tab_root=b;a.__x_tab_base=d;
|
|
8
|
-
set:function(b){return $APP.
|
|
9
|
-
function(){return $APP.l(this,"__x_tab_initialized")===!0?
|
|
7
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tab_root=b;a.__x_tab_base=d;jm(a);a.__x_tab_initialized=!0}hm(a);return a},lm=function(a){Object.defineProperty(a.prototype,"selected",{get:function(){return this.hasAttribute("selected")},set:function(b){return $APP.r(b)?this.setAttribute("selected",""):this.removeAttribute("selected")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"disabled",{get:function(){return this.hasAttribute("disabled")},
|
|
8
|
+
set:function(b){return $APP.r(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.r(b)?this.setAttribute("value",b):this.removeAttribute("value")},configurable:!0,enumerable:!0})},nm=function(){var a=class extends HTMLElement{};a.observedAttributes=mm;a.prototype.connectedCallback=function(){return km(this)};a.prototype.attributeChangedCallback=
|
|
9
|
+
function(){return $APP.l(this,"__x_tab_initialized")===!0?hm(this):km(this)};lm(a);return a},om=function(){return $APP.r(customElements.get("x-tab"))?null:customElements.define("x-tab",nm())},bm=new $APP.M(null,"controls","controls",1340701452);var mm="value selected disabled orientation size variant label controls".split(" "),cm=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),dm=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),em=new $APP.R(null,new $APP.P(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.Sd(["tab-select",new $APP.P(null,1,[$APP.U,new $APP.P(null,1,[$APP.ui,$APP.Y],null)],null)]);$APP.ka("baredom.exports.x_tab.init",om);export const init=om;
|