@vanelsas/baredom 1.2.0 → 1.3.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 +13 -0
- package/README.md +2 -2
- package/dist/base.js +364 -353
- 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 +47 -47
- 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 +40 -40
- package/dist/x-divider.js +12 -12
- 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-typography.js +61 -61
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +28 -0
- package/dist/x-modal.js +13 -13
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +35 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +16 -16
- package/dist/x-organic-progress.js +40 -0
- package/dist/x-organic-shape.js +12 -12
- 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 -12
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +35 -35
- package/dist/x-scroll-timeline.js +47 -47
- package/dist/x-scroll.js +40 -40
- 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 +4 -4
- package/dist/x-slider.js +16 -16
- 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 +15 -15
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- 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 +10 -10
- package/package.json +26 -2
package/dist/x-alert.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
c],null)},
|
|
4
|
-
d.setAttribute("part","container");e.setAttribute("part","icon");e.setAttribute("aria-hidden","true");g.setAttribute("name","icon");h.setAttribute("part","default-icon");g.appendChild(h);e.appendChild(g);k.setAttribute("part","text");m.setAttribute("part","dismiss");m.setAttribute("type","button");p.setAttribute("aria-hidden","true");p.textContent="×";m.appendChild(p);d.appendChild(e);d.appendChild(k);d.appendChild(m);b.appendChild(c);b.appendChild(d);a.__xAlertRefs=new $APP.
|
|
5
|
-
d,$APP.
|
|
6
|
-
b=$APP.
|
|
7
|
-
$APP.Z),d=$APP.
|
|
8
|
-
"status";v.call(m,"role",c);y.textContent=d;e?(x.textContent="",
|
|
9
|
-
a.__xAlertModel=b}},
|
|
10
|
-
return a>0?a:b>0?b:160},
|
|
11
|
-
d}())){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:
|
|
12
|
-
function g(e){return $APP.C.h(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering")):null})}},
|
|
13
|
-
$APP.n(h)&&(clearTimeout(h),a.__xAlertExitTimer=null),$APP.n(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);$APP.ma(a,"__xAlertExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.l(a,"__xAlertExiting"):h)?(d.removeEventListener("animationend",e),a.__xAlertExitTimer=null,a.remove()):null},b+60))}}return null},
|
|
14
|
-
{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.n(b)&&
|
|
15
|
-
"__xAlertExiting")):d}())&&(b.preventDefault(),
|
|
16
|
-
$APP.
|
|
17
|
-
return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("text",""+$APP.
|
|
18
|
-
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"dismissible",{get:function(){return
|
|
19
|
-
""+$APP.
|
|
20
|
-
customElements.define("x-alert",
|
|
2
|
+
var ut=function(a){a=$APP.I($APP.$k,a);return $APP.n(a)?a:"info"},vt=function(a){return a==null?!0:$APP.O((""+$APP.T.g(a)).trim().toLowerCase(),"false")},wt=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.r(isNaN(a))&&a>0?a:null):null},xt=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.Ph);b=$APP.I(b,$APP.X);return $APP.n(a)?$APP.r(b):a},yt=function(a,b){var c=$APP.N(a);a=$APP.I(c,$APP.Z);c=$APP.I(c,$APP.Rj);return new $APP.R(null,3,[$APP.Z,ut(a),$APP.Rh,b,$APP.Rj,
|
|
3
|
+
c],null)},At=function(a){var b=$APP.l(a,"__xAlertRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("span"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("button"),p=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-alert-radius:10px;--x-alert-padding-y:10px;--x-alert-padding-x:12px;--x-alert-gap:10px;--x-alert-font-size:0.875rem;--x-alert-motion-fast:120ms;--x-alert-motion-ease:cubic-bezier(0.2,0,0,1);--x-alert-enter-duration:140ms;--x-alert-exit-duration:160ms;--x-alert-press-scale:0.98;--x-alert-disabled-opacity:0.55;--x-alert-focus-ring:rgba(0,0,0,0.6);--x-alert-dismiss-color:rgba(0,0,0,0.62);--x-alert-dismiss-hover-bg:rgba(0,0,0,0.06);--x-alert-info-bg:rgba(0,102,204,0.08);--x-alert-info-border:rgba(0,102,204,0.35);--x-alert-info-color:rgba(0,60,120,0.95);--x-alert-success-bg:rgba(16,140,72,0.10);--x-alert-success-border:rgba(16,140,72,0.35);--x-alert-success-color:rgba(10,90,46,0.95);--x-alert-warning-bg:rgba(204,120,0,0.12);--x-alert-warning-border:rgba(204,120,0,0.45);--x-alert-warning-color:rgba(120,70,0,0.95);--x-alert-error-bg:rgba(190,20,40,0.10);--x-alert-error-border:rgba(190,20,40,0.45);--x-alert-error-color:rgba(120,10,20,0.95);--x-alert-bg:transparent;--x-alert-border-color:transparent;--x-alert-color:inherit;}@media (prefers-color-scheme:dark){:host{--x-alert-focus-ring:rgba(255,255,255,0.75);--x-alert-dismiss-color:rgba(255,255,255,0.75);--x-alert-dismiss-hover-bg:rgba(255,255,255,0.14);--x-alert-info-bg:rgba(80,160,255,0.18);--x-alert-info-border:rgba(80,160,255,0.42);--x-alert-info-color:rgba(230,245,255,0.92);--x-alert-success-bg:rgba(60,210,120,0.18);--x-alert-success-border:rgba(60,210,120,0.42);--x-alert-success-color:rgba(235,255,245,0.92);--x-alert-warning-bg:rgba(255,190,90,0.20);--x-alert-warning-border:rgba(255,190,90,0.46);--x-alert-warning-color:rgba(255,248,235,0.92);--x-alert-error-bg:rgba(255,90,110,0.18);--x-alert-error-border:rgba(255,90,110,0.46);--x-alert-error-color:rgba(255,235,238,0.92);}}:host([data-type\x3d'info']){--x-alert-bg:var(--x-alert-info-bg);--x-alert-border-color:var(--x-alert-info-border);--x-alert-color:var(--x-alert-info-color);}:host([data-type\x3d'success']){--x-alert-bg:var(--x-alert-success-bg);--x-alert-border-color:var(--x-alert-success-border);--x-alert-color:var(--x-alert-success-color);}:host([data-type\x3d'warning']){--x-alert-bg:var(--x-alert-warning-bg);--x-alert-border-color:var(--x-alert-warning-border);--x-alert-color:var(--x-alert-warning-color);}:host([data-type\x3d'error']){--x-alert-bg:var(--x-alert-error-bg);--x-alert-border-color:var(--x-alert-error-border);--x-alert-color:var(--x-alert-error-color);}[part\x3dcontainer]{display:flex;align-items:flex-start;gap:var(--x-alert-gap);padding:var(--x-alert-padding-y) var(--x-alert-padding-x);border:1px solid var(--x-alert-border-color);border-radius:var(--x-alert-radius);background:var(--x-alert-bg);color:var(--x-alert-color);font-size:var(--x-alert-font-size);transition:background var(--x-alert-motion-fast) var(--x-alert-motion-ease),border-color var(--x-alert-motion-fast) var(--x-alert-motion-ease),color var(--x-alert-motion-fast) var(--x-alert-motion-ease),opacity var(--x-alert-motion-fast) var(--x-alert-motion-ease),transform var(--x-alert-motion-fast) var(--x-alert-motion-ease);}[part\x3dicon]{flex:0 0 auto;line-height:1;margin-top:0.05em;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dtext]{flex:1 1 auto;line-height:1.25;min-width:0;overflow-wrap:anywhere;}[part\x3ddismiss]{flex:0 0 auto;appearance:none;border:0;background:transparent;color:var(--x-alert-dismiss-color);width:1.5em;height:1.5em;padding:0;margin:0;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background var(--x-alert-motion-fast) var(--x-alert-motion-ease),transform var(--x-alert-motion-fast) var(--x-alert-motion-ease);}:host(:not([disabled])) [part\x3ddismiss]:hover{background:var(--x-alert-dismiss-hover-bg);}:host(:not([disabled])) [part\x3ddismiss]:active{transform:scale(var(--x-alert-press-scale));}[part\x3ddismiss]:focus{outline:none;}:host(:not([disabled])) [part\x3ddismiss]:focus-visible{outline:2px solid var(--x-alert-focus-ring);outline-offset:2px;}:host([disabled]){opacity:var(--x-alert-disabled-opacity);}:host([disabled]) [part\x3ddismiss]{cursor:default;pointer-events:none;}:host([data-entering]) [part\x3dcontainer]{animation:x-alert-enter var(--x-alert-enter-duration) var(--x-alert-motion-ease) both;}@keyframes x-alert-enter{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}:host([data-exiting]) [part\x3dcontainer]{animation:x-alert-exit var(--x-alert-exit-duration) var(--x-alert-motion-ease) forwards;}@keyframes x-alert-exit{from{opacity:1;transform:translateY(0);}to{opacity:0;transform:translateY(4px);}}@media (prefers-reduced-motion:reduce){[part\x3dcontainer],[part\x3ddismiss]{transition:none !important;}:host([data-entering]) [part\x3dcontainer],:host([data-exiting]) [part\x3dcontainer]{animation:none !important;}}";
|
|
4
|
+
d.setAttribute("part","container");e.setAttribute("part","icon");e.setAttribute("aria-hidden","true");g.setAttribute("name","icon");h.setAttribute("part","default-icon");g.appendChild(h);e.appendChild(g);k.setAttribute("part","text");m.setAttribute("part","dismiss");m.setAttribute("type","button");p.setAttribute("aria-hidden","true");p.textContent="×";m.appendChild(p);d.appendChild(e);d.appendChild(k);d.appendChild(m);b.appendChild(c);b.appendChild(d);a.__xAlertRefs=new $APP.R(null,7,[$APP.Jh,b,$APP.yi,
|
|
5
|
+
d,$APP.Zg,e,$APP.pi,g,$APP.Ok,h,zt,k,$APP.vj,m],null);return $APP.l(a,"__xAlertRefs")},Bt=function(a){a=new $APP.R(null,7,[$APP.yh,a.getAttribute("type"),$APP.Rj,a.getAttribute("text"),$APP.ch,a.hasAttribute("icon"),$APP.vi,a.getAttribute("icon"),$APP.li,a.getAttribute("dismissible"),$APP.ck,a.hasAttribute("disabled"),$APP.xh,a.getAttribute("timeout-ms")],null);var b=$APP.N(a),c=$APP.I(b,$APP.yh);a=$APP.I(b,$APP.Rj);var d=$APP.I(b,$APP.ch),e=$APP.I(b,$APP.vi),g=$APP.I(b,$APP.li),h=$APP.I(b,$APP.ck);
|
|
6
|
+
b=$APP.I(b,$APP.xh);c=$APP.I($APP.Zk,typeof c==="string"?c.toLowerCase():null);c=$APP.n(c)?c:$APP.Hj;typeof e==="string"?(e=e.trim(),e=$APP.O(e,"")&&$APP.O(e.toLowerCase(),"none")?e:null):e=null;d=$APP.n($APP.n(d)?e==null:d)?$APP.Sk:e!=null?$APP.Tj:$APP.oh;return new $APP.R(null,7,[$APP.Z,c,$APP.Rj,$APP.n(a)?a:"",$APP.Xi,d,$APP.tj,$APP.C.h(d,$APP.Tj)?e:null,$APP.Ph,vt(g),$APP.X,$APP.J(h),$APP.yk,wt(b)],null)},Ct=function(a){var b=Bt(a);if($APP.O($APP.l(a,"__xAlertModel"),b)){b=$APP.N(b);var c=$APP.I(b,
|
|
7
|
+
$APP.Z),d=$APP.I(b,$APP.Rj),e=$APP.I(b,$APP.Xi),g=$APP.I(b,$APP.tj),h=$APP.I(b,$APP.Ph),k=$APP.I(b,$APP.X),m=At(a),p=$APP.N(m);m=$APP.I(p,$APP.yi);var q=$APP.I(p,$APP.Zg),v=$APP.I(p,$APP.pi),x=$APP.I(p,$APP.Ok),y=$APP.I(p,zt);p=$APP.I(p,$APP.vj);v=$APP.n(v)?v.assignedNodes().length>0:null;$APP.C.h(e,$APP.Tj)||(g=$APP.I($APP.al,c),g=$APP.n(g)?g:$APP.I($APP.al,$APP.Hj));e=$APP.r(v)&&$APP.C.h(e,$APP.Sk);a.setAttribute("data-type",ut(c));v=m.setAttribute;c=$APP.C.h(c,$APP.qk)||$APP.C.h(c,$APP.Gh)?"alert":
|
|
8
|
+
"status";v.call(m,"role",c);y.textContent=d;e?(x.textContent="",q.style.display="none"):(x.textContent=g,q.style.display="inline");$APP.n(h)?(p.disabled=$APP.J(k),p.style.display="inline-flex"):(p.disabled=!0,p.style.display="none");p.setAttribute("aria-label","Dismiss alert");d=$APP.n(h)?$APP.r(k):h;a.tabIndex=$APP.n(d)?0:-1;$APP.n(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");$APP.n(d)?a.setAttribute("aria-keyshortcuts","Escape"):a.removeAttribute("aria-keyshortcuts");
|
|
9
|
+
a.__xAlertModel=b}},Dt=function(a){a=typeof a==="string"?a.trim():"";return $APP.C.h(a,"")||$APP.C.h(a,"0")||$APP.C.h(a,"0ms")||$APP.C.h(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},Et=function(a){var b=window.getComputedStyle(a);a=Dt(b.getPropertyValue("--x-alert-exit-duration"));b=Dt(b.getPropertyValue("--x-motion-exit-duration"));
|
|
10
|
+
return a>0?a:b>0?b:160},Ft=function(a){var b=$APP.l(a,"__xAlertTimeout");$APP.n(b)&&(clearTimeout(b),a.__xAlertTimeout=null)},Ht=function(a){Ft(a);var b=function(){var c=$APP.l(a,"__xAlertModel");return $APP.n(c)?c:Bt(a)}();$APP.n(function(){var c=xt(b);return $APP.n(c)?typeof $APP.yk.g(b)==="number"&&$APP.r($APP.l(a,"__xAlertExiting")):c}())&&$APP.ma(a,"__xAlertTimeout",setTimeout(function(){a.__xAlertTimeout=null;if($APP.n(function(){var d=a.isConnected;return $APP.n(d)?$APP.r($APP.l(a,"__xAlertExiting")):
|
|
11
|
+
d}())){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:Bt(a)}();if($APP.n(xt(c)))return c=$APP.Sg(yt(c,"timeout")),c=new CustomEvent("x-alert-dismiss",{detail:c,bubbles:!0,composed:!0,cancelable:!0}),c=a.dispatchEvent(c),$APP.n(c)?Gt.g?Gt.g(a):Gt.call(null,a):null}return null},$APP.yk.g(b)))},It=function(a){if(!$APP.n($APP.l(a,"__xAlertEntered"))){a.__xAlertEntered=!0;a.setAttribute("data-entering","");var b=At(a);b=$APP.N(b);var c=$APP.I(b,$APP.yi);c.addEventListener("animationend",
|
|
12
|
+
function g(e){return $APP.C.h(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering")):null})}},Gt=function(a){if(!$APP.n($APP.l(a,"__xAlertExiting"))){a.__xAlertExiting=!0;Ft(a);a.removeAttribute("data-entering");var b=Et(a);if(b===0||$APP.J(window.matchMedia("(prefers-reduced-motion:reduce)").matches))a.remove();else{var c=At(a);c=$APP.N(c);var d=$APP.I(c,$APP.yi),e=function k(h){return $APP.C.h(h.target,d)?(d.removeEventListener("animationend",k),h=$APP.l(a,"__xAlertExitTimer"),
|
|
13
|
+
$APP.n(h)&&(clearTimeout(h),a.__xAlertExitTimer=null),$APP.n(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);$APP.ma(a,"__xAlertExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.n($APP.n(h)?$APP.l(a,"__xAlertExiting"):h)?(d.removeEventListener("animationend",e),a.__xAlertExitTimer=null,a.remove()):null},b+60))}}return null},Jt=function(a,b){var c=$APP.l(a,"__xAlertModel");c=$APP.n(c)?c:Bt(a);b=$APP.Sg(yt(c,b));b=new CustomEvent("x-alert-dismiss",
|
|
14
|
+
{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.n(b)&&Gt(a)},Kt=function(a,b){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:Bt(a)}();$APP.n(function(){var d=xt(c);return $APP.n(d)?$APP.r($APP.l(a,"__xAlertExiting")):d}())&&(b.preventDefault(),Jt(a,"button"));return null},Lt=function(a,b){if($APP.C.h(b.key,"Escape")){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.n(d)?d:Bt(a)}();$APP.n(function(){var d=xt(c);return $APP.n(d)?$APP.r($APP.l(a,
|
|
15
|
+
"__xAlertExiting")):d}())&&(b.preventDefault(),Jt(a,"keyboard"))}return null},Mt=function(a){function b(e){return Lt(a,e)}function c(e){return Kt(a,e)}var d=At(a);d=$APP.N(d);$APP.I(d,$APP.vj).addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xAlertHandlers",{click:c,keydown:b})},Nt=function(a){Ft(a);var b=$APP.l(a,"__xAlertExitTimer");$APP.n(b)&&(clearTimeout(b),a.__xAlertExitTimer=null);b=$APP.l(a,"__xAlertHandlers");var c=$APP.l(a,"__xAlertRefs");if($APP.n($APP.n(b)?c:b)){c=
|
|
16
|
+
$APP.vj.g(c);var d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xAlertHandlers=null},Ot=function(a){Object.defineProperty(a,"type",{get:function(){var b=this.getAttribute("type");return $APP.n(b)?b:"info"},set:function(b){return $APP.n(b)?this.setAttribute("type",""+$APP.T.g(b)):this.removeAttribute("type")},enumerable:!0,configurable:!0});Object.defineProperty(a,"text",{get:function(){var b=this.getAttribute("text");
|
|
17
|
+
return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("text",""+$APP.T.g(b)):this.removeAttribute("text")},enumerable:!0,configurable:!0});Object.defineProperty(a,"icon",{get:function(){return this.getAttribute("icon")},set:function(b){return $APP.n(b)?this.setAttribute("icon",""+$APP.T.g(b)):this.removeAttribute("icon")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",
|
|
18
|
+
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"dismissible",{get:function(){return vt(this.getAttribute("dismissible"))},set:function(b){return $APP.n(b)?this.setAttribute("dismissible",""):this.setAttribute("dismissible","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"timeoutMs",{get:function(){return wt(this.getAttribute("timeout-ms"))},set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",
|
|
19
|
+
""+$APP.T.g(b|0))},enumerable:!0,configurable:!0})},Qt=function(){var a=class extends HTMLElement{};a.observedAttributes=Pt;a.prototype.connectedCallback=function(){At(this);Nt(this);Mt(this);Ct(this);It(this);Ht(this);return null};a.prototype.disconnectedCallback=function(){Nt(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(Ct(this),$APP.n(this.isConnected)&&Ht(this));return null};Ot(a.prototype);return a},Rt=function(){$APP.n(customElements.get("x-alert"))||
|
|
20
|
+
customElements.define("x-alert",Qt());return null},Pt="type text icon dismissible disabled timeout-ms".split(" "),zt=new $APP.M(null,"text-el","text-el",-1615414066);$APP.ja("baredom.exports.x_alert.init",Rt);export const init=Rt;
|
package/dist/x-avatar-group.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e.setAttribute("part","overflow");e.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xAvatarGroupRefs=new $APP.
|
|
4
|
-
$APP.
|
|
5
|
-
m=$APP.
|
|
6
|
-
d=$APP.u($APP.
|
|
7
|
-
$APP.n(h)?g.setAttribute("disabled",""):g.removeAttribute("disabled"),g.style.marginInlineStart=k>0?v:"0px"):g.style.display="none",d=$APP.z(d),g=null,k=0),
|
|
8
|
-
c=$APP.N(c);c=$APP.
|
|
9
|
-
this.setAttribute("label",""+$APP.
|
|
10
|
-
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},
|
|
11
|
-
function(){
|
|
12
|
-
"overflow",2058931880),
|
|
2
|
+
var au=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.K(a,c)?c:b},bu=function(a){if(typeof a==="string"){a=parseInt(a,10);var b=isFinite(a);return $APP.n($APP.n(b)?a>0:b)?a:null}return null},du=function(a){var b=$APP.l(a,"__xAvatarGroupRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("slot"),e=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;flex-direction:row;color-scheme:light dark;--x-avatar-group-overflow-bg:rgba(0,0,0,0.08);--x-avatar-group-overflow-color:rgba(0,0,0,0.70);--x-avatar-group-overflow-border:rgba(0,0,0,0.14);--x-avatar-group-overflow-ring:#ffffff;--x-avatar-group-size:32px;--x-avatar-group-font-size:0.75rem;}@media (prefers-color-scheme:dark){:host{--x-avatar-group-overflow-bg:rgba(255,255,255,0.10);--x-avatar-group-overflow-color:rgba(255,255,255,0.75);--x-avatar-group-overflow-border:rgba(255,255,255,0.18);--x-avatar-group-overflow-ring:#0b0c0f;}}:host([data-size\x3d'xs']){--x-avatar-group-size:20px;--x-avatar-group-font-size:0.625rem;}:host([data-size\x3d'sm']){--x-avatar-group-size:24px;--x-avatar-group-font-size:0.6875rem;}:host([data-size\x3d'md']){--x-avatar-group-size:32px;--x-avatar-group-font-size:0.75rem;}:host([data-size\x3d'lg']){--x-avatar-group-size:40px;--x-avatar-group-font-size:0.875rem;}:host([data-size\x3d'xl']){--x-avatar-group-size:48px;--x-avatar-group-font-size:1rem;}:host([data-direction\x3d'rtl']){flex-direction:row-reverse;}[part\x3doverflow]{display:none;flex-shrink:0;width:var(--x-avatar-group-size);height:var(--x-avatar-group-size);border-radius:999px;background:var(--x-avatar-group-overflow-bg);color:var(--x-avatar-group-overflow-color);border:1px solid var(--x-avatar-group-overflow-border);box-shadow:0 0 0 2px var(--x-avatar-group-overflow-ring);font-size:var(--x-avatar-group-font-size);font-weight:600;line-height:1;align-items:center;justify-content:center;user-select:none;box-sizing:border-box;white-space:nowrap;}::slotted(x-avatar){flex-shrink:0;}@media (prefers-reduced-motion:reduce){::slotted(x-avatar){transition:none !important;}}";
|
|
3
|
+
e.setAttribute("part","overflow");e.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xAvatarGroupRefs=new $APP.R(null,2,[$APP.Uj,d,cu,e],null);return $APP.l(a,"__xAvatarGroupRefs")},ju=function(a){a=new $APP.R(null,6,[$APP.hk,a.getAttribute("size"),eu,a.getAttribute("overlap"),$APP.yj,a.getAttribute("max"),$APP.Yh,a.getAttribute("direction"),$APP.ck,a.hasAttribute("disabled"),$APP.sh,a.getAttribute("label")],null);var b=$APP.N(a);a=$APP.I(b,$APP.hk);var c=
|
|
4
|
+
$APP.I(b,eu),d=$APP.I(b,$APP.yj),e=$APP.I(b,$APP.Yh),g=$APP.I(b,$APP.ck);b=$APP.I(b,$APP.sh);a=au(fu,"md",a);c=au(gu,"md",c);d=bu(d);e=au(hu,"ltr",e);g=$APP.J(g);typeof b==="string"?(b=b.trim(),b=$APP.C.h(b,"")?null:b):b=null;return new $APP.R(null,6,[$APP.Wg,a,iu,c,$APP.wj,d,$APP.ni,e,$APP.Di,g,$APP.U,b],null)},lu=function(a,b){b=$APP.N(b);var c=$APP.I(b,$APP.Wg),d=$APP.I(b,iu),e=$APP.I(b,$APP.wj),g=$APP.I(b,$APP.ni),h=$APP.I(b,$APP.Di),k=$APP.I(b,$APP.U),m=du(a);m=$APP.N(m);var p=$APP.I(m,$APP.Uj);
|
|
5
|
+
m=$APP.I(m,cu);var q=$APP.lc(p.assignedElements());p=$APP.B(q);p=$APP.n($APP.n(e)?p>e:e)?new $APP.Q(null,2,5,$APP.fe,[e,p-e],null):new $APP.Q(null,2,5,$APP.fe,[p,0],null);e=$APP.E(p,0,null);p=$APP.E(p,1,null);var v=$APP.qc(ku,d,"0px");a.setAttribute("data-size",c);a.setAttribute("data-overlap",d);a.setAttribute("data-direction",g);a.setAttribute("role","group");$APP.n(k)?a.setAttribute("aria-label",k):a.removeAttribute("aria-label");$APP.n(h)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");
|
|
6
|
+
d=$APP.u($APP.Od.m($APP.Kg,q,$APP.Uf(0,Number.MAX_VALUE)));g=null;for(q=k=0;;)if(q<k){var x=g.G(null,q),y=$APP.E(x,0,null);x=$APP.E(x,1,null);x<e?(y.style.display="",y.setAttribute("size",c),$APP.n(h)?y.setAttribute("disabled",""):y.removeAttribute("disabled"),y.style.marginInlineStart=x>0?v:"0px"):y.style.display="none";q+=1}else if(d=$APP.u(d))$APP.Cc(d)?(k=$APP.qb(d),d=$APP.rb(d),g=k,k=$APP.B(k)):(k=$APP.w(d),g=$APP.E(k,0,null),k=$APP.E(k,1,null),k<e?(g.style.display="",g.setAttribute("size",c),
|
|
7
|
+
$APP.n(h)?g.setAttribute("disabled",""):g.removeAttribute("disabled"),g.style.marginInlineStart=k>0?v:"0px"):g.style.display="none",d=$APP.z(d),g=null,k=0),q=0;else break;p>0?(m.textContent="+"+$APP.T.g(p),m.setAttribute("role","img"),m.setAttribute("aria-label",""+$APP.T.g(p)+" more"),m.style.display="inline-flex",m.style.marginInlineStart=v):(m.textContent="",m.style.display="none");a.__xAvatarGroupModel=b},mu=function(a){lu(a,ju(a));return null},nu=function(a){function b(){return mu(a)}var c=du(a);
|
|
8
|
+
c=$APP.N(c);c=$APP.I(c,$APP.Uj);$APP.n(c)&&c.addEventListener("slotchange",b);$APP.ma(a,"__xAvatarGroupHandlers",{slot:b})},ou=function(a){var b=$APP.l(a,"__xAvatarGroupHandlers");if($APP.n(b)){var c=$APP.l(a,"__xAvatarGroupRefs");$APP.n(c)&&(c=$APP.Uj.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xAvatarGroupHandlers=null},pu=function(a){Object.defineProperty(a,"label",{get:function(){return this.getAttribute("label")},set:function(b){return $APP.n(b)?
|
|
9
|
+
this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},qu=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},ru=function(a){Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",
|
|
10
|
+
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},su=function(a){Object.defineProperty(a,"max",{get:function(){return bu(this.getAttribute("max"))},set:function(b){return b!=null?this.setAttribute("max",""+$APP.T.g(b)):this.removeAttribute("max")},enumerable:!0,configurable:!0})},tu=function(a){qu(a,"size","md");qu(a,"overlap","md");qu(a,"direction","ltr");pu(a);ru(a);su(a)},vu=function(){var a=class extends HTMLElement{};a.observedAttributes=uu;a.prototype.connectedCallback=
|
|
11
|
+
function(){du(this);ou(this);nu(this);mu(this);return null};a.prototype.disconnectedCallback=function(){ou(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(b=ju(this),$APP.O($APP.l(this,"__xAvatarGroupModel"),b)&&lu(this,b));return null};tu(a.prototype);return a},wu=function(){$APP.n(customElements.get("x-avatar-group"))||customElements.define("x-avatar-group",vu());return null},eu=new $APP.M(null,"overlap-raw","overlap-raw",1202229114),cu=new $APP.M(null,"overflow",
|
|
12
|
+
"overflow",2058931880),iu=new $APP.M(null,"overlap","overlap",-1673335644);var uu="size overlap max direction disabled label".split(" "),fu=new $APP.S(null,new $APP.R(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),gu=new $APP.S(null,new $APP.R(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),hu=new $APP.S(null,new $APP.R(null,2,["ltr",null,"rtl",null],null),null),ku=new $APP.R(null,4,"none 0px sm -4px md -8px lg -12px".split(" "),null);$APP.ja("baredom.exports.x_avatar_group.init",wu);export const init=wu;
|
package/dist/x-avatar.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b=$APP.
|
|
2
|
+
var DP=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.K(a,c)?c:b},EP=function(a){return typeof a==="string"?(a=a.trim(),$APP.C.h(a,"")?null:a):null},FP=function(a){a=EP(a);if($APP.n(a)){var b=$APP.ke($APP.Sd(function(c){return $APP.C.h(c,"")},a.split(/\s+/)));if($APP.u(b))return a=$APP.w(b)[0],b=$APP.B(b)>=2?$APP.w($APP.z(b))[0]:null,a=""+$APP.T.g(a)+$APP.T.g($APP.n(b)?b:""),$APP.C.h(a,"")?null:a.toUpperCase()}return null},IP=function(a){var b=$APP.N(a);a=$APP.I(b,GP);
|
|
3
|
+
b=$APP.I(b,HP);return $APP.n(a)?a:b},KP=function(a){var b=$APP.N(a);a=$APP.I(b,JP);b=$APP.I(b,$APP.si);return $APP.n(a)?a:b},SP=function(a){var b=$APP.l(a,"__xAvatarRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("img"),g=document.createElement("span"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("span"),p=document.createElement("slot");c.textContent=
|
|
4
4
|
":host{display:inline-block;vertical-align:middle;position:relative;color-scheme:light dark;--x-avatar-size-xs:20px;--x-avatar-size-sm:24px;--x-avatar-size-md:32px;--x-avatar-size-lg:40px;--x-avatar-size-xl:48px;--x-avatar-radius:10px;--x-avatar-disabled-opacity:0.55;--x-avatar-bg:rgba(0,0,0,0.06);--x-avatar-border:rgba(0,0,0,0.14);--x-avatar-color:rgba(0,0,0,0.86);--x-avatar-ring:#ffffff;--x-avatar-status-online:rgba(16,140,72,0.95);--x-avatar-status-offline:rgba(0,0,0,0.45);--x-avatar-status-busy:rgba(190,20,40,0.95);--x-avatar-status-away:rgba(204,120,0,0.95);--x-avatar-status-color:transparent;--x-avatar-font-size:0.875rem;--x-avatar-size:var(--x-avatar-size-md);}@media (prefers-color-scheme:dark){:host{--x-avatar-bg:rgba(255,255,255,0.10);--x-avatar-border:rgba(255,255,255,0.18);--x-avatar-color:rgba(255,255,255,0.88);--x-avatar-ring:#0b0c0f;--x-avatar-status-online:rgba(60,210,120,0.95);--x-avatar-status-offline:rgba(255,255,255,0.45);--x-avatar-status-busy:rgba(255,90,110,0.95);--x-avatar-status-away:rgba(255,190,90,0.95);}}:host([data-size\x3d'xs']){--x-avatar-size:var(--x-avatar-size-xs);--x-avatar-font-size:0.625rem;}:host([data-size\x3d'sm']){--x-avatar-size:var(--x-avatar-size-sm);--x-avatar-font-size:0.75rem;}:host([data-size\x3d'md']){--x-avatar-size:var(--x-avatar-size-md);}:host([data-size\x3d'lg']){--x-avatar-size:var(--x-avatar-size-lg);--x-avatar-font-size:1rem;}:host([data-size\x3d'xl']){--x-avatar-size:var(--x-avatar-size-xl);--x-avatar-font-size:1.125rem;}:host([data-variant\x3d'brand']){--x-avatar-bg:rgba(0,102,204,0.10);--x-avatar-border:rgba(0,102,204,0.30);--x-avatar-color:rgba(0,60,120,0.90);}:host([data-variant\x3d'subtle']){--x-avatar-bg:rgba(0,0,0,0.03);--x-avatar-border:rgba(0,0,0,0.08);--x-avatar-color:rgba(0,0,0,0.55);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'brand']){--x-avatar-bg:rgba(80,160,255,0.18);--x-avatar-border:rgba(80,160,255,0.40);--x-avatar-color:rgba(210,235,255,0.92);}:host([data-variant\x3d'subtle']){--x-avatar-bg:rgba(255,255,255,0.04);--x-avatar-border:rgba(255,255,255,0.08);--x-avatar-color:rgba(255,255,255,0.50);}}[part\x3droot]{width:var(--x-avatar-size);height:var(--x-avatar-size);display:inline-flex;align-items:center;justify-content:center;overflow:hidden;background:var(--x-avatar-bg);color:var(--x-avatar-color);border:1px solid var(--x-avatar-border);box-shadow:0 0 0 2px var(--x-avatar-ring);font-size:var(--x-avatar-font-size);font-weight:600;line-height:1;user-select:none;border-radius:999px;}:host([data-shape\x3d'square']) [part\x3droot]{border-radius:0;}:host([data-shape\x3d'rounded']) [part\x3droot]{border-radius:var(--x-avatar-radius);}:host([disabled]){opacity:var(--x-avatar-disabled-opacity);}[part\x3dimage]{width:100%;height:100%;object-fit:cover;display:none;}[part\x3dinitials],[part\x3dfallback]{display:none;padding:0 0.25em;}[part\x3dstatus]{position:absolute;right:-1px;bottom:-1px;width:0.34em;height:0.34em;min-width:10px;min-height:10px;border-radius:999px;border:2px solid var(--x-avatar-ring);background:var(--x-avatar-status-color);display:none;}[part\x3dbadge]{position:absolute;top:-4px;right:-4px;display:none;}slot[name\x3dbadge]::slotted(*){display:block;}@media (prefers-reduced-motion:reduce){[part\x3droot]{transition:none !important;}}";
|
|
5
|
-
d.setAttribute("part","root");e.setAttribute("part","image");e.setAttribute("alt","");g.setAttribute("part","initials");h.setAttribute("part","fallback");h.textContent="?";k.setAttribute("part","status");k.setAttribute("aria-hidden","true");m.setAttribute("part","badge");p.setAttribute("name","badge");m.appendChild(p);d.appendChild(e);d.appendChild(g);d.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(k);b.appendChild(m);a.__xAvatarRefs=new $APP.
|
|
6
|
-
m,
|
|
7
|
-
e);a.setAttribute("data-variant",g);$APP.n(
|
|
8
|
-
p);
|
|
9
|
-
|
|
10
|
-
3):d:null;var
|
|
11
|
-
g=$APP.
|
|
12
|
-
b)}}a.__xAvatarHandlers=null},
|
|
13
|
-
"src");
|
|
14
|
-
return null};a.prototype.disconnectedCallback=function(){
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
$APP.
|
|
5
|
+
d.setAttribute("part","root");e.setAttribute("part","image");e.setAttribute("alt","");g.setAttribute("part","initials");h.setAttribute("part","fallback");h.textContent="?";k.setAttribute("part","status");k.setAttribute("aria-hidden","true");m.setAttribute("part","badge");p.setAttribute("name","badge");m.appendChild(p);d.appendChild(e);d.appendChild(g);d.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(k);b.appendChild(m);a.__xAvatarRefs=new $APP.R(null,7,[LP,d,MP,e,NP,g,OP,h,PP,k,QP,
|
|
6
|
+
m,RP,p],null);return $APP.l(a,"__xAvatarRefs")},UP=function(a,b){b=$APP.N(b);var c=$APP.I(b,TP),d=$APP.I(b,$APP.Wg),e=$APP.I(b,$APP.Si),g=$APP.I(b,$APP.jh),h=$APP.I(b,$APP.ij),k=$APP.I(b,$APP.Di),m=SP(a),p=$APP.N(m);m=$APP.I(p,MP);var q=$APP.I(p,NP),v=$APP.I(p,OP),x=$APP.I(p,PP),y=$APP.I(p,QP),A=$APP.I(p,RP),D=$APP.J($APP.l(a,"__xAvatarImgOk")),G=c!=null;p=IP(b);var H=KP(b);D=G&&D;G=!D&&p!=null;var F=!D&&!G;A=$APP.n(A)?A.assignedNodes().length>0:null;a.setAttribute("data-size",d);a.setAttribute("data-shape",
|
|
7
|
+
e);a.setAttribute("data-variant",g);$APP.n(H)?(a.setAttribute("role","img"),a.setAttribute("aria-label",H),a.removeAttribute("aria-hidden")):(a.removeAttribute("role"),a.removeAttribute("aria-label"),a.setAttribute("aria-hidden","true"));$APP.n(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");c=$APP.n(c)?c:"";$APP.O(function(){var P=$APP.l(a,"__xAvatarLastSrc");return $APP.n(P)?P:""}(),c)&&(a.__xAvatarLastSrc=c,m.src=c);m.style.display=D?"block":"none";G&&(q.textContent=
|
|
8
|
+
p);q.style.display=G?"inline":"none";v.style.display=F?"inline":"none";$APP.n(h)?(a.style.setProperty("--x-avatar-status-color",function(){switch(h){case "online":return"var(--x-avatar-status-online)";case "busy":return"var(--x-avatar-status-busy)";case "away":return"var(--x-avatar-status-away)";default:return"var(--x-avatar-status-offline)"}}()),x.style.display="block"):x.style.display="none";y.style.display=$APP.n(A)?"block":"none";a.__xAvatarModel=b},cQ=function(a){var b=$APP.mf([VP,$APP.Lj,$APP.Pj,
|
|
9
|
+
WP,$APP.Uh,$APP.ck,XP,YP,$APP.hk],[a.getAttribute("initials"),a.getAttribute("variant"),a.getAttribute("name"),a.getAttribute("shape"),a.getAttribute("status"),a.hasAttribute("disabled"),a.getAttribute("alt"),a.getAttribute("src"),a.getAttribute("size")]);var c=$APP.N(b),d=$APP.I(c,VP),e=$APP.I(c,$APP.Lj),g=$APP.I(c,$APP.Pj);b=$APP.I(c,WP);var h=$APP.I(c,$APP.Uh),k=$APP.I(c,XP),m=$APP.I(c,$APP.ck),p=$APP.I(c,YP);c=$APP.I(c,$APP.hk);p=EP(p);k=EP(k);g=EP(g);d=EP(d);d=$APP.n(d)?d.length>3?d.slice(0,
|
|
10
|
+
3):d:null;var q=d==null?FP(g):null,v=[GP,$APP.Di,$APP.jh,JP,$APP.si,TP,$APP.Wg,$APP.ij,HP,$APP.Si];m=$APP.J(m);e=DP(ZP,"neutral",e);c=DP($P,"md",c);h=typeof h==="string"?h.trim().toLowerCase():null;h=$APP.K(aQ,h)?h:null;b=$APP.mf(v,[d,m,e,k,g,p,c,h,q,DP(bQ,"circle",b)]);$APP.O($APP.l(a,"__xAvatarModel"),b)&&UP(a,b);return null},dQ=function(a){function b(){return cQ(a)}function c(){a.__xAvatarImgOk=!1;return cQ(a)}function d(){a.__xAvatarImgOk=!0;return cQ(a)}var e=SP(a),g=$APP.N(e);e=$APP.I(g,MP);
|
|
11
|
+
g=$APP.I(g,RP);e.addEventListener("load",d);e.addEventListener("error",c);$APP.n(g)&&g.addEventListener("slotchange",b);$APP.ma(a,"__xAvatarHandlers",{load:d,error:c,slot:b})},eQ=function(a){var b=$APP.l(a,"__xAvatarHandlers");if($APP.n(b)){var c=$APP.l(a,"__xAvatarRefs");if($APP.n(c)){var d=MP.g(c);c=RP.g(c);var e=$APP.l(b,"load"),g=$APP.l(b,"error");b=$APP.l(b,"slot");$APP.n(e)&&d.removeEventListener("load",e);$APP.n(g)&&d.removeEventListener("error",g);$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",
|
|
12
|
+
b)}}a.__xAvatarHandlers=null},fQ=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},gQ=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},hQ=function(a){fQ(a,
|
|
13
|
+
"src");fQ(a,"alt");fQ(a,"name");fQ(a,"initials");gQ(a,"size","md");gQ(a,"shape","circle");gQ(a,"variant","neutral");fQ(a,"status");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})},jQ=function(){var a=class extends HTMLElement{};a.observedAttributes=iQ;a.prototype.connectedCallback=function(){SP(this);eQ(this);dQ(this);cQ(this);
|
|
14
|
+
return null};a.prototype.disconnectedCallback=function(){eQ(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&($APP.C.h(b,"src")&&(this.__xAvatarImgOk=!1),cQ(this));return null};hQ(a.prototype);return a},kQ=function(){$APP.n(customElements.get("x-avatar"))||customElements.define("x-avatar",jQ());return null},JP=new $APP.M(null,"alt","alt",-3214426),WP=new $APP.M(null,"shape-raw","shape-raw",1588938757),NP=new $APP.M(null,"initials-el","initials-el",2044340724),MP=
|
|
15
|
+
new $APP.M(null,"img","img",1442687358),PP=new $APP.M(null,"status-el","status-el",2132204108),GP=new $APP.M(null,"initials","initials",-2130377215),TP=new $APP.M(null,"src","src",-1651076051),QP=new $APP.M(null,"badge-el","badge-el",1341875403),RP=new $APP.M(null,"badge-slot","badge-slot",2030670001),VP=new $APP.M(null,"initials-raw","initials-raw",1031756224),HP=new $APP.M(null,"derived","derived",1986040597),YP=new $APP.M(null,"src-raw","src-raw",-510472785),XP=new $APP.M(null,"alt-raw","alt-raw",
|
|
16
|
+
-1423153400),OP=new $APP.M(null,"fallback-el","fallback-el",-208030239),LP=new $APP.M(null,"root-el","root-el",1068654895);var iQ="src alt name initials size shape variant status disabled".split(" "),$P=new $APP.S(null,new $APP.R(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),bQ=new $APP.S(null,new $APP.R(null,3,["rounded",null,"square",null,"circle",null],null),null),ZP=new $APP.S(null,new $APP.R(null,3,["neutral",null,"brand",null,"subtle",null],null),null),aQ=new $APP.S(null,new $APP.R(null,4,["online",null,"away",null,"offline",null,"busy",null],null),null);
|
|
17
|
+
$APP.mf([GP,$APP.Di,$APP.jh,JP,$APP.si,TP,$APP.Wg,$APP.ij,$APP.Si],[new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Ni],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null)]);$APP.ja("baredom.exports.x_avatar.init",kQ);export const init=kQ;
|
package/dist/x-badge.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
switch(b instanceof $APP.M?b.
|
|
4
|
-
|
|
5
|
-
d.setAttribute("part","base");d.setAttribute("role","status");g.setAttribute("part","label");d.appendChild(e);d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__xBadgeRefs=new $APP.
|
|
6
|
-
a.getAttribute("size"),a.getAttribute("count"),a.getAttribute("aria-label"),a.getAttribute("dot"),a.getAttribute("aria-describedby"),a.getAttribute("pill")]))},
|
|
7
|
-
$APP.
|
|
8
|
-
$APP.ma(a,"__xBadgeHandlers",{slot:b})},
|
|
9
|
-
b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.
|
|
10
|
-
null?this.setAttribute(b,""+$APP.
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
var bP=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.K(a,c)?c:b},cP=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.n($APP.n(c)?a>=0:c)?a:b}return b},gP=function(a){var b=$APP.N(a);a=$APP.I(b,dP);var c=$APP.I(b,$APP.$g),d=$APP.I(b,$APP.Rj);b=$APP.I(b,eP);return $APP.n(a)?$APP.fi:c!=null?$APP.$g:d!=null?$APP.Rj:$APP.n(b)?eP:fP},hP=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.$g);var c=$APP.I(b,$APP.wj),d=$APP.I(b,$APP.Rj);b=gP(b);
|
|
3
|
+
switch(b instanceof $APP.M?b.qa:null){case "count":return a>c?""+$APP.T.g(c)+"+":""+$APP.T.g(a);case "text":return d;default:return null}},oP=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.Hi);var c=$APP.I(b,iP),d=$APP.I(b,$APP.ui),e=$APP.I(b,jP),g=$APP.I(b,$APP.Lj),h=$APP.I(b,$APP.Vg),k=$APP.I(b,dP),m=$APP.I(b,$APP.yj),p=$APP.I(b,kP);b=$APP.I(b,$APP.hk);m=cP(m,99);var q=$APP.n(p)?function(){var v=cP(p,null);return v!=null?v:null}():null;return $APP.mf([dP,$APP.jh,lP,$APP.Wg,$APP.wj,$APP.$g,$APP.Qk,
|
|
4
|
+
eP,$APP.dk,$APP.Rj],[$APP.J(k),bP(mP,"neutral",g),e!=null&&$APP.O(e,"false"),bP(nP,"md",b),m,q,d,c!=null&&$APP.O(c,"false"),a,typeof h==="string"?function(){var v=h.trim();return $APP.C.h(v,"")?null:v}():null])},qP=function(a){var b=$APP.l(a,"__xBadgeRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot"),g=document.createElement("span");c.textContent=":host{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;color-scheme:light dark;--x-badge-bg:rgba(0,0,0,0.08);--x-badge-color:rgba(0,0,0,0.80);--x-badge-border:rgba(0,0,0,0.12);--x-badge-font-size:0.75rem;--x-badge-height:1.25rem;--x-badge-padding:0 0.375rem;--x-badge-radius:0.25rem;}@media (prefers-color-scheme:dark){:host{--x-badge-bg:rgba(255,255,255,0.12);--x-badge-color:rgba(255,255,255,0.88);--x-badge-border:rgba(255,255,255,0.14);}}:host([data-variant\x3d'info']){--x-badge-bg:rgba(0,102,204,0.12);--x-badge-color:rgba(0,60,140,0.90);--x-badge-border:rgba(0,102,204,0.25);}:host([data-variant\x3d'success']){--x-badge-bg:rgba(16,140,72,0.12);--x-badge-color:rgba(0,90,45,0.90);--x-badge-border:rgba(16,140,72,0.25);}:host([data-variant\x3d'warning']){--x-badge-bg:rgba(204,120,0,0.12);--x-badge-color:rgba(140,70,0,0.90);--x-badge-border:rgba(204,120,0,0.25);}:host([data-variant\x3d'error']){--x-badge-bg:rgba(190,20,40,0.12);--x-badge-color:rgba(140,0,20,0.90);--x-badge-border:rgba(190,20,40,0.25);}@media (prefers-color-scheme:dark){:host([data-variant\x3d'info']){--x-badge-bg:rgba(80,160,255,0.18);--x-badge-color:rgba(210,235,255,0.95);--x-badge-border:rgba(80,160,255,0.35);}:host([data-variant\x3d'success']){--x-badge-bg:rgba(60,210,120,0.18);--x-badge-color:rgba(200,255,230,0.95);--x-badge-border:rgba(60,210,120,0.35);}:host([data-variant\x3d'warning']){--x-badge-bg:rgba(255,190,90,0.18);--x-badge-color:rgba(255,235,180,0.95);--x-badge-border:rgba(255,190,90,0.35);}:host([data-variant\x3d'error']){--x-badge-bg:rgba(255,90,110,0.18);--x-badge-color:rgba(255,210,215,0.95);--x-badge-border:rgba(255,90,110,0.35);}}:host([data-size\x3d'sm']){--x-badge-font-size:0.6875rem;--x-badge-height:1rem;--x-badge-padding:0 0.25rem;--x-badge-radius:0.1875rem;}[part\x3dbase]{display:inline-flex;align-items:center;justify-content:center;min-height:var(--x-badge-height);padding:var(--x-badge-padding);border-radius:var(--x-badge-radius);border:1px solid var(--x-badge-border);background:var(--x-badge-bg);color:var(--x-badge-color);font-size:var(--x-badge-font-size);font-weight:600;line-height:1;white-space:nowrap;user-select:none;box-sizing:border-box;}:host([data-pill]) [part\x3dbase]{border-radius:999px;}:host([data-dot]) [part\x3dbase]{min-width:var(--x-badge-height);padding:0;}:host([data-mode\x3d'dot']) [part\x3dlabel],:host([data-mode\x3d'empty']) [part\x3dbase]{display:none;}slot{display:none;}:host([data-mode\x3d'slot']) slot{display:contents;}:host([data-mode\x3d'slot']) [part\x3dlabel]{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dbase]{transition:none !important;}}";
|
|
5
|
+
d.setAttribute("part","base");d.setAttribute("role","status");g.setAttribute("part","label");d.appendChild(e);d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__xBadgeRefs=new $APP.R(null,3,[pP,d,$APP.Uj,e,$APP.Kk,g],null);return $APP.l(a,"__xBadgeRefs")},rP=function(a){var b=qP(a);b=$APP.N(b);b=$APP.I(b,$APP.Uj);return oP($APP.mf([$APP.Lj,$APP.Vg,dP,$APP.yj,$APP.hk,kP,$APP.Hi,iP,$APP.ui,jP],[a.getAttribute("variant"),a.getAttribute("text"),$APP.n(b)?b.assignedNodes().length>0:null,a.getAttribute("max"),
|
|
6
|
+
a.getAttribute("size"),a.getAttribute("count"),a.getAttribute("aria-label"),a.getAttribute("dot"),a.getAttribute("aria-describedby"),a.getAttribute("pill")]))},sP=function(a){var b=rP(a);if($APP.O($APP.l(a,"__xBadgeModel"),b)){b=$APP.N(b);var c=$APP.I(b,$APP.jh),d=$APP.I(b,$APP.Wg),e=$APP.I(b,lP),g=$APP.I(b,eP),h=$APP.I(b,$APP.dk),k=$APP.I(b,$APP.Qk),m=qP(a),p=$APP.N(m);m=$APP.I(p,pP);p=$APP.I(p,$APP.Kk);var q=gP(b),v=hP(b);a.setAttribute("data-variant",c);a.setAttribute("data-size",d);a.setAttribute("data-mode",
|
|
7
|
+
$APP.Of(q));$APP.n(e)?a.setAttribute("data-pill",""):a.removeAttribute("data-pill");$APP.n(g)?a.setAttribute("data-dot",""):a.removeAttribute("data-dot");p.textContent=$APP.n(v)?v:"";$APP.n(h)?m.setAttribute("aria-label",h):m.removeAttribute("aria-label");$APP.n(k)?m.setAttribute("aria-describedby",k):m.removeAttribute("aria-describedby");a.__xBadgeModel=b}return null},tP=function(a){function b(){return sP(a)}var c=qP(a);c=$APP.N(c);c=$APP.I(c,$APP.Uj);$APP.n(c)&&c.addEventListener("slotchange",b);
|
|
8
|
+
$APP.ma(a,"__xBadgeHandlers",{slot:b})},uP=function(a){var b=$APP.l(a,"__xBadgeHandlers");if($APP.n(b)){var c=$APP.l(a,"__xBadgeRefs");$APP.n(c)&&(c=$APP.Uj.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBadgeHandlers=null},vP=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},wP=function(a,b,c){Object.defineProperty(a,
|
|
9
|
+
b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},xP=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},yP=function(a,b,c){Object.defineProperty(a,b,{get:function(){return cP(this.getAttribute(b),c)},set:function(d){return d!=
|
|
10
|
+
null?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},zP=function(a){wP(a,"variant","neutral");wP(a,"size","md");xP(a,"pill");xP(a,"dot");vP(a,"text");vP(a,"aria-label");vP(a,"aria-describedby");yP(a,"count",null);yP(a,"max",99);Object.defineProperty(a,"displayText",{get:function(){return hP(rP(this))},enumerable:!0,configurable:!0})},BP=function(){var a=class extends HTMLElement{};a.observedAttributes=AP;a.prototype.connectedCallback=function(){qP(this);
|
|
11
|
+
uP(this);tP(this);sP(this);return null};a.prototype.disconnectedCallback=function(){uP(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&sP(this);return null};zP(a.prototype);return a},CP=function(){$APP.n(customElements.get("x-badge"))||customElements.define("x-badge",BP());return null},lP=new $APP.M(null,"pill","pill",-37707E3),kP=new $APP.M(null,"count-raw","count-raw",-952861839),dP=new $APP.M(null,"has-slot?","has-slot?",181244965),fP=new $APP.M(null,"empty",
|
|
12
|
+
"empty",767870958),eP=new $APP.M(null,"dot","dot",1442709401),iP=new $APP.M(null,"dot-raw","dot-raw",1754908187),jP=new $APP.M(null,"pill-raw","pill-raw",-557846051),pP=new $APP.M(null,"base","base",185279322);var AP="variant size pill dot count max text aria-label aria-describedby".split(" "),mP=new $APP.S(null,new $APP.R(null,5,["success",null,"neutral",null,"warning",null,"info",null,"error",null],null),null),nP=new $APP.S(null,new $APP.R(null,2,["md",null,"sm",null],null),null);$APP.ja("baredom.exports.x_badge.init",CP);export const init=CP;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var kx=function(a){switch(a){case "none":return"0";case "xs":return"4px";case "sm":return"8px";case "md":return"16px";case "lg":return"24px";case "xl":return"32px";default:return"16px"}},mx=function(a){return $APP.K(lx,a)?a:"md"},nx=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),typeof a==="number"&&$APP.r(isNaN(a))?$APP.Gg.h($APP.Fg.h(a,1),12):4):4},ox=function(a){return typeof a==="string"&&$APP.O(a,"")?a:"auto"},rx=function(a){a=$APP.N(a);var b=$APP.I(a,$APP.qj),c=$APP.I(a,
|
|
3
|
+
$APP.Li),d=$APP.I(a,$APP.vk),e=$APP.I(a,$APP.ki);a=$APP.I(a,px);b=nx(b);var g=mx(c);c=function(){var k=$APP.K(lx,d)?d:null;return $APP.n(k)?k:g}();var h=function(){var k=$APP.K(lx,e)?e:null;return $APP.n(k)?k:g}();a=ox(a);return new $APP.R(null,6,[$APP.qj,b,qx,"repeat("+$APP.T.g(b)+",minmax(0,1fr))",$APP.Li,g,$APP.vk,kx(c),$APP.ki,kx(h),px,a],null)},sx=function(a){var b=new $APP.R(null,5,[$APP.qj,a.getAttribute("columns"),$APP.Li,a.getAttribute("gap"),$APP.vk,a.getAttribute("row-gap"),$APP.ki,a.getAttribute("column-gap"),
|
|
4
|
+
px,a.getAttribute("row-height")],null);b=rx(b);a=$APP.l(a,"__xBentoGridBase");$APP.n(a)?(a=a.style,a.setProperty("--x-bento-grid-columns",qx.g(b)),a.setProperty("--x-bento-grid-row-height",px.g(b)),a.setProperty("--x-bento-grid-row-gap",$APP.vk.g(b)),b=a.setProperty("--x-bento-grid-column-gap",$APP.ki.g(b))):b=null;return b},tx=function(a){if($APP.l(a,"__xBentoGridInit")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");
|
|
5
|
+
c.textContent="\n :host {\n display:block;\n }\n\n .base {\n display:grid;\n box-sizing:border-box;\n grid-template-columns:var(--x-bento-grid-columns);\n grid-auto-rows:var(--x-bento-grid-row-height);\n grid-auto-flow:dense;\n row-gap:var(--x-bento-grid-row-gap);\n column-gap:var(--x-bento-grid-column-gap);\n }\n ";d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xBentoGridRoot=b;a.__xBentoGridBase=d;a.__xBentoGridInit=!0}sx(a);
|
|
6
|
+
return a},vx=function(){var a=class extends HTMLElement{};a.observedAttributes=ux;a.prototype.connectedCallback=function(){return tx(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__xBentoGridInit")===!0?sx(this):tx(this)};return a},wx=function(){return $APP.n(customElements.get("x-bento-grid"))?null:customElements.define("x-bento-grid",vx())},px=new $APP.M(null,"row-height","row-height",527360749),qx=new $APP.M(null,"template","template",-702405684);var ux=["columns","gap","row-gap","column-gap","row-height"],lx=new $APP.S(null,new $APP.R(null,6,["none",null,"xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null);$APP.ja("baredom.exports.x_bento_grid.init",wx);export const init=wx;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var St=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),typeof a==="number"&&$APP.r(isNaN(a))?$APP.Gg.h($APP.Fg.h(a,1),6):1):1},Wt=function(a){var b=new $APP.R(null,3,[$APP.zk,a.getAttribute("col-span"),$APP.gh,a.getAttribute("row-span"),Tt,a.getAttribute("order")],null);var c=$APP.N(b);b=$APP.I(c,$APP.zk);var d=$APP.I(c,$APP.gh);c=$APP.I(c,Tt);b=St(b);d=St(d);typeof c==="string"&&$APP.O(c,"")?(c=parseInt(c,10),c=typeof c==="number"&&$APP.r(isNaN(c))?c:null):c=null;b=new $APP.R(null,
|
|
3
|
+
5,[$APP.zk,b,$APP.gh,d,Ut,"span "+$APP.T.g(b),Vt,"span "+$APP.T.g(d),Tt,c],null);a=a.style;a.setProperty("grid-column",Ut.g(b));a.setProperty("grid-row",Vt.g(b));b=Tt.g(b);return $APP.n(b)?a.setProperty("order",""+$APP.T.g(b)):a.removeProperty("order")},Xt=function(a){if($APP.l(a,"__xBentoItemInit")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent="\n :host {\n display:block;\n min-width:0;\n min-height:0;\n }\n\n .base {\n width:100%;\n height:100%;\n box-sizing:border-box;\n }\n ";
|
|
4
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xBentoItemRoot=b;a.__xBentoItemBase=d;a.__xBentoItemInit=!0}Wt(a);return a},Zt=function(){var a=class extends HTMLElement{};a.observedAttributes=Yt;a.prototype.connectedCallback=function(){return Xt(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__xBentoItemInit")===!0?Wt(this):Xt(this)};return a},$t=function(){return $APP.n(customElements.get("x-bento-item"))?null:customElements.define("x-bento-item",
|
|
5
|
+
Zt())},Vt=new $APP.M(null,"row-span-css","row-span-css",956357389),Tt=new $APP.M(null,"order","order",-1254677256),Ut=new $APP.M(null,"col-span-css","col-span-css",-1306581329);var Yt=["col-span","row-span","order"];$APP.ja("baredom.exports.x_bento_item.init",$t);export const init=$t;
|
package/dist/x-breadcrumbs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d.setAttribute("part","root");e.setAttribute("part","list");d.appendChild(e);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xBreadcrumbsRefs=new $APP.
|
|
4
|
-
b.setAttribute("class","ellipsis");c.setAttribute("class","separator");c.setAttribute("aria-hidden","true");c.textContent=a;d.setAttribute("class","ellipsis-btn");d.setAttribute("aria-label","Show hidden breadcrumbs");d.textContent="…";b.appendChild(c);b.appendChild(d);return b},
|
|
5
|
-
""),d.setAttribute("aria-current","page"));return c},
|
|
6
|
-
var d=$APP.
|
|
7
|
-
b=$APP.N(b);d=$APP.
|
|
8
|
-
|
|
9
|
-
v));h=null;for(k=p=0;;)if(k<p){var y=h.
|
|
10
|
-
h>0&&!$APP.C.h(h,g)&&
|
|
11
|
-
$APP.n(c)&&(c=$APP.
|
|
12
|
-
""+$APP.
|
|
13
|
-
function(a){
|
|
14
|
-
function(b,c,d){$APP.O(c,d)&&
|
|
15
|
-
"
|
|
2
|
+
var Np=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.K(a,c)?c:b},Op=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.n($APP.n(c)?a>0:c)?a:b}return b},Pp=function(a){var b=$APP.l(a,"__xBreadcrumbsRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("nav"),e=document.createElement("ol"),g=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-breadcrumbs-color:rgba(0,0,0,0.55);--x-breadcrumbs-color-current:rgba(0,0,0,0.88);--x-breadcrumbs-color-hover:rgba(0,0,0,0.80);--x-breadcrumbs-separator-color:rgba(0,0,0,0.35);--x-breadcrumbs-font-size:0.875rem;--x-breadcrumbs-gap:0.25rem;--x-breadcrumbs-disabled-opacity:0.55;}@media (prefers-color-scheme:dark){:host{--x-breadcrumbs-color:rgba(255,255,255,0.50);--x-breadcrumbs-color-current:rgba(255,255,255,0.90);--x-breadcrumbs-color-hover:rgba(255,255,255,0.75);--x-breadcrumbs-separator-color:rgba(255,255,255,0.30);}}:host([data-size\x3d'sm']){--x-breadcrumbs-font-size:0.75rem;}:host([data-size\x3d'lg']){--x-breadcrumbs-font-size:1rem;}:host([disabled]){opacity:var(--x-breadcrumbs-disabled-opacity);pointer-events:none;}[part\x3droot]{display:block;font-size:var(--x-breadcrumbs-font-size);}[part\x3dlist]{display:flex;flex-wrap:wrap;align-items:center;list-style:none;margin:0;padding:0;gap:var(--x-breadcrumbs-gap);}:host([data-wrap\x3d'false']) [part\x3dlist]{flex-wrap:nowrap;}.crumb{display:inline-flex;align-items:center;gap:var(--x-breadcrumbs-gap);}.crumb-content{color:var(--x-breadcrumbs-color);text-decoration:none;cursor:pointer;}.crumb-content:hover{color:var(--x-breadcrumbs-color-hover);}.crumb[data-current] .crumb-content{color:var(--x-breadcrumbs-color-current);font-weight:500;}:host([data-variant\x3d'subtle']) .crumb-content{opacity:0.75;}:host([data-variant\x3d'text']) .crumb-content{text-decoration:none;border-bottom:none;}.separator{color:var(--x-breadcrumbs-separator-color);user-select:none;aria-hidden:true;flex-shrink:0;}.ellipsis{display:inline-flex;align-items:center;gap:var(--x-breadcrumbs-gap);}.ellipsis-btn{color:var(--x-breadcrumbs-color);background:none;border:none;padding:0;cursor:pointer;font:inherit;line-height:1;}.ellipsis-btn:hover{color:var(--x-breadcrumbs-color-hover);}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dlist]{transition:none !important;}}";
|
|
3
|
+
d.setAttribute("part","root");e.setAttribute("part","list");d.appendChild(e);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xBreadcrumbsRefs=new $APP.R(null,3,[$APP.Eh,d,$APP.Bj,e,$APP.Uj,g],null);return $APP.l(a,"__xBreadcrumbsRefs")},Qp=function(a){var b=document.createElement("span");b.setAttribute("class","separator");b.setAttribute("aria-hidden","true");b.textContent=a;return b},Rp=function(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("button");
|
|
4
|
+
b.setAttribute("class","ellipsis");c.setAttribute("class","separator");c.setAttribute("aria-hidden","true");c.textContent=a;d.setAttribute("class","ellipsis-btn");d.setAttribute("aria-label","Show hidden breadcrumbs");d.textContent="…";b.appendChild(c);b.appendChild(d);return b},Sp=function(a,b){var c=document.createElement("li"),d=document.createElement("span");a=a.cloneNode(!0);c.setAttribute("class","crumb");d.setAttribute("class","crumb-content");d.appendChild(a);c.appendChild(d);$APP.n(b)&&(c.setAttribute("data-current",
|
|
5
|
+
""),d.setAttribute("aria-current","page"));return c},wq=function(a){var b=$APP.mf([$APP.Lj,Tp,$APP.ck,Up,Vp,$APP.hk,kq,lq,$APP.Hi,mq,$APP.ui],[a.getAttribute("variant"),a.getAttribute("max-items"),a.hasAttribute("disabled"),a.getAttribute("wrap"),a.getAttribute("items-after"),a.getAttribute("size"),a.hasAttribute("preserve-aria-current"),a.getAttribute("items-before"),a.getAttribute("aria-label"),a.getAttribute("separator"),a.getAttribute("aria-describedby")]);var c=$APP.N(b);b=$APP.I(c,$APP.Hi);
|
|
6
|
+
var d=$APP.I(c,mq),e=$APP.I(c,$APP.ui),g=$APP.I(c,Tp),h=$APP.I(c,$APP.Lj),k=$APP.I(c,$APP.ck),m=$APP.I(c,Vp),p=$APP.I(c,Up),q=$APP.I(c,$APP.hk),v=$APP.I(c,kq);c=$APP.I(c,lq);v=$APP.J(v);m=Op(m,2);p=p!=null&&$APP.O(p,"false");k=$APP.J(k);h=Np(nq,"default",h);if(typeof g==="string"){g=parseInt(g,10);var x=isFinite(g);g=$APP.n($APP.n(x)?g>0:x)?g:null}else g=null;b=$APP.mf([oq,pq,qq,$APP.Di,$APP.jh,rq,$APP.Wg,$APP.Qk,sq,$APP.dk,$APP.Cj],[v,m,p,k,h,g,Np(tq,"md",q),e,Op(c,1),b,typeof d==="string"?d:"/"]);
|
|
7
|
+
b=$APP.N(b);d=$APP.I(b,$APP.Wg);e=$APP.I(b,$APP.jh);q=$APP.I(b,qq);$APP.I(b,$APP.Di);c=$APP.I(b,$APP.dk);v=$APP.I(b,$APP.Qk);g=Pp(a);g=$APP.N(g);g=$APP.I(g,$APP.Eh);a.setAttribute("data-size",d);a.setAttribute("data-variant",e);a.setAttribute("data-wrap",""+$APP.T.g($APP.J(q)));$APP.n(c)?g.setAttribute("aria-label",c):g.setAttribute("aria-label","Breadcrumb");$APP.n(v)?g.setAttribute("aria-describedby",v):g.removeAttribute("aria-describedby");e=$APP.N(b);d=$APP.I(e,$APP.Cj);m=$APP.I(e,rq);h=$APP.I(e,
|
|
8
|
+
sq);g=$APP.I(e,pq);e=$APP.I(e,oq);q=Pp(a);q=$APP.N(q);c=$APP.I(q,$APP.Uj);q=$APP.I(q,$APP.Bj);c=$APP.lc(c.assignedElements());v=$APP.B(c);m==null||v<=m?g=new $APP.R(null,3,[$APP.ak,$APP.ke($APP.Uf(0,v)),uq,-1,vq,v],null):(m=$APP.Gg.h(h,$APP.Fg.h(0,v-g)),g=$APP.Gg.h(g,$APP.Fg.h(0,v-m)),m=$APP.Gg.h(m,v-g),m=$APP.Fg.h(0,m),m=$APP.ke($APP.Uf(0,m)),g=$APP.ke($APP.Uf(v-g,v)),g=new $APP.R(null,3,[$APP.ak,$APP.Je.h(m,g),uq,$APP.B(m),vq,v],null));v=$APP.ak.g(g);g=uq.g(g);q.innerHTML="";m=$APP.u($APP.Kd($APP.Kg,
|
|
9
|
+
v));h=null;for(k=p=0;;)if(k<p){var y=h.G(null,k);x=$APP.E(y,0,null);y=$APP.E(y,1,null);y=$APP.E(c,y,null);var A=$APP.C.h(x,$APP.B(v)-1)&&$APP.r(e);$APP.C.h(x,g)&&q.appendChild(Rp(d));x>0&&!$APP.C.h(x,g)&&q.appendChild(Qp(d));$APP.C.h(x,g)&&q.appendChild(Qp(d));$APP.n(y)&&q.appendChild(Sp(y,A));k+=1}else if(m=$APP.u(m))$APP.Cc(m)?(p=$APP.qb(m),m=$APP.rb(m),h=p,p=$APP.B(p)):(p=$APP.w(m),h=$APP.E(p,0,null),p=$APP.E(p,1,null),p=$APP.E(c,p,null),k=$APP.C.h(h,$APP.B(v)-1)&&$APP.r(e),$APP.C.h(h,g)&&q.appendChild(Rp(d)),
|
|
10
|
+
h>0&&!$APP.C.h(h,g)&&q.appendChild(Qp(d)),$APP.C.h(h,g)&&q.appendChild(Qp(d)),$APP.n(p)&&q.appendChild(Sp(p,k)),m=$APP.z(m),h=null,p=0),k=0;else break;$APP.C.h(g,$APP.B(v))&&q.appendChild(Rp(d));a.__xBreadcrumbsModel=b;return null},xq=function(a){function b(){return wq(a)}var c=Pp(a);c=$APP.N(c);c=$APP.I(c,$APP.Uj);$APP.n(c)&&c.addEventListener("slotchange",b);$APP.ma(a,"__xBreadcrumbsHandlers",{slot:b})},yq=function(a){var b=$APP.l(a,"__xBreadcrumbsHandlers");if($APP.n(b)){var c=$APP.l(a,"__xBreadcrumbsRefs");
|
|
11
|
+
$APP.n(c)&&(c=$APP.Uj.g(c),b=$APP.l(b,"slot"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBreadcrumbsHandlers=null},zq=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Aq=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return $APP.n(d)?this.setAttribute(b,
|
|
12
|
+
""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Bq=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.n(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Cq=function(a,b,c){Object.defineProperty(a,b,{get:function(){return Op(this.getAttribute(b),c)},set:function(d){return d!=null?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Dq=
|
|
13
|
+
function(a){Aq(a,"separator","/");Aq(a,"size","md");Aq(a,"variant","default");Bq(a,"wrap");Bq(a,"disabled");Bq(a,"preserve-aria-current");Cq(a,"max-items",null);Cq(a,"items-before",1);Cq(a,"items-after",2);zq(a,"aria-label");zq(a,"aria-describedby")},Fq=function(){var a=class extends HTMLElement{};a.observedAttributes=Eq;a.prototype.connectedCallback=function(){Pp(this);yq(this);xq(this);wq(this);return null};a.prototype.disconnectedCallback=function(){yq(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
+
function(b,c,d){$APP.O(c,d)&&wq(this);return null};Dq(a.prototype);return a},Gq=function(){$APP.n(customElements.get("x-breadcrumbs"))||customElements.define("x-breadcrumbs",Fq());return null},pq=new $APP.M(null,"items-after","items-after",358736705),qq=new $APP.M(null,"wrap","wrap",851669987),mq=new $APP.M(null,"separator-raw","separator-raw",1358337914),lq=new $APP.M(null,"items-before-raw","items-before-raw",1580997624),Tp=new $APP.M(null,"max-items-raw","max-items-raw",-340487390),Up=new $APP.M(null,
|
|
15
|
+
"wrap-raw","wrap-raw",-1468030804),rq=new $APP.M(null,"max-items","max-items",-1969244147),uq=new $APP.M(null,"ellipsis-at","ellipsis-at",-628372349),kq=new $APP.M(null,"preserve-aria-current-present?","preserve-aria-current-present?",729931506),Vp=new $APP.M(null,"items-after-raw","items-after-raw",-1677187220),sq=new $APP.M(null,"items-before","items-before",-1151895719),oq=new $APP.M(null,"preserve-aria-current","preserve-aria-current",682773185),vq=new $APP.M(null,"total","total",1916810418);var Eq="separator size variant wrap max-items items-before items-after disabled preserve-aria-current aria-label aria-describedby".split(" "),tq=new $APP.S(null,new $APP.R(null,3,["md",null,"lg",null,"sm",null],null),null),nq=new $APP.S(null,new $APP.R(null,3,["subtle",null,"text",null,"default",null],null),null);$APP.ja("baredom.exports.x_breadcrumbs.init",Gq);export const init=Gq;
|
package/dist/x-button.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b},
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
$APP.Z.g(b));
|
|
7
|
-
c.setAttribute("data-disabled",$APP.n($APP.
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
{source:"keyboard"})}return null});b.addEventListener("keyup",function(c){c=c.key;return $APP.C.h("keyboard",
|
|
11
|
-
return $APP.n(d)?$APP.C.h(c,"submit")?d.requestSubmit():$APP.C.h(c,"reset")?d.reset():null:null}return null})},
|
|
12
|
-
c);b["spinner-slot"].addEventListener("slotchange",c)},
|
|
13
|
-
g=
|
|
14
|
-
d.setAttribute("part","button");e.setAttribute("part","inner");g.setAttribute("part","icon-start");h.setAttribute("part","label");k.setAttribute("part","spinner");y.setAttribute("part","spinner-slot");m.setAttribute("part","spinner-fallback");p.setAttribute("part","icon-end");v.setAttribute("name","icon-start");x.setAttribute("name","icon-end");y.setAttribute("name","spinner");k.setAttribute("aria-hidden","true");m.setAttribute("aria-hidden","true");g.appendChild(v);h.appendChild(
|
|
15
|
-
k.appendChild(m);p.appendChild(x);e.appendChild(g);e.appendChild(h);e.appendChild(k);e.appendChild(p);d.appendChild(e);b.appendChild(c);b.appendChild(d);b={root:b,style:c,button:d,inner:e,"label-slot":
|
|
16
|
-
return
|
|
17
|
-
$APP.
|
|
2
|
+
var hB=function(a,b,c){return typeof a==="string"&&$APP.K(b,a)?a:c},iB=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.Di);b=$APP.I(b,$APP.Nj);return $APP.r($APP.n(a)?a:b)},jB=function(a){return a.__xButtonState},kB=function(a){return $APP.C.h(!0,a.__xButtonHover)},lB=function(a,b){a.__xButtonHover=$APP.J(b)},mB=function(a,b){a.__xButtonFocusVisible=$APP.J(b)},nB=function(a){return a.__xButtonActiveSource},oB=function(a,b){a.__xButtonActiveSource=b},pB=function(a,b){return a.__xButtonLastActivationSource=
|
|
3
|
+
b},yB=function(a){a=new $APP.R(null,7,[$APP.Di,a.hasAttribute("disabled"),$APP.Nj,a.hasAttribute("loading"),qB,a.hasAttribute("pressed"),$APP.Z,a.getAttribute("type"),$APP.jh,a.getAttribute("variant"),$APP.Wg,a.getAttribute("size"),$APP.U,a.getAttribute("label")],null);var b=$APP.N(a);a=$APP.I(b,$APP.Di);var c=$APP.I(b,$APP.Nj),d=$APP.I(b,qB),e=$APP.I(b,$APP.Z),g=$APP.I(b,$APP.jh),h=$APP.I(b,$APP.Wg);b=$APP.I(b,$APP.U);return new $APP.R(null,7,[$APP.Di,$APP.J(a),$APP.Nj,$APP.J(c),qB,$APP.J(d),$APP.Z,
|
|
4
|
+
hB(e,rB,"button"),$APP.jh,hB(g,sB,"primary"),$APP.Wg,hB(h,xB,"md"),$APP.U,typeof b==="string"?b:null],null)},zB=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},UB=function(a){return a.assignedNodes({flatten:!0})},VB=function(a){return document.createElement(a)},XB=function(a,b){var c=b.button,d=b["label-slot"],e=b["icon-start-slot"],g=b["icon-end-slot"],h=b["spinner-slot"];b=yB(a);var k;a:{d=UB(d);for(var m=0;;)if(m<d.length){var p=d[m],
|
|
5
|
+
q=p;if(k=$APP.C.h(q.nodeType,Node.TEXT_NODE))k=q.textContent,k=$APP.O("",($APP.n(k)?k:"").trim());if(!k){k=p;if(p=$APP.C.h(k.nodeType,Node.ELEMENT_NODE))p=k.textContent,p=$APP.O("",($APP.n(p)?p:"").trim());k=p}if(k){k=!0;break a}m+=1}else{k=!1;break a}k=void 0}e=UB(e).length>0;g=UB(g).length>0;h=UB(h).length>0;d=kB(a);m=nB(a)!=null;p=$APP.C.h(!0,a.__xButtonFocusVisible);k=$APP.Eg.m(b,WB,k);q=$APP.N(k);k=$APP.I(q,$APP.U);q=$APP.I(q,WB);k=$APP.r(q)&&typeof k==="string"&&$APP.O("",k)?k:null;c.setAttribute("type",
|
|
6
|
+
$APP.Z.g(b));q=$APP.Di.g(b);q=$APP.n(q)?q:$APP.Nj.g(b);c.disabled=q;q=$APP.N(b);q=$APP.I(q,$APP.Nj);q=$APP.n(q)?"true":null;$APP.n(q)?c.setAttribute("aria-busy",q):c.removeAttribute("aria-busy");$APP.n(qB.g(b))?c.setAttribute("aria-pressed","true"):c.removeAttribute("aria-pressed");$APP.n(k)?c.setAttribute("aria-label",k):c.removeAttribute("aria-label");c.setAttribute("data-variant",$APP.jh.g(b));c.setAttribute("data-size",$APP.Wg.g(b));c.setAttribute("data-loading",$APP.n($APP.Nj.g(b))?"true":"false");
|
|
7
|
+
c.setAttribute("data-disabled",$APP.n($APP.Di.g(b))?"true":"false");c.setAttribute("data-hover",d?"true":"false");c.setAttribute("data-active",m?"true":"false");c.setAttribute("data-focus-visible",p?"true":"false");c.setAttribute("data-has-icon-start",e?"true":"false");c.setAttribute("data-has-icon-end",g?"true":"false");c.setAttribute("data-has-spinner",h?"true":"false");a.setAttribute("data-variant",$APP.jh.g(b));return a.setAttribute("data-size",$APP.Wg.g(b))},YB=function(a){var b=nB(a);return $APP.n(b)?
|
|
8
|
+
(oB(a,null),zB(a,"press-end",{source:b}),b=jB(a),$APP.n(b)?XB(a,b):null):null},ZB=function(a){iB(yB(a))||(lB(a,!1),oB(a,null))},$B=function(a,b){b.addEventListener("pointerenter",function(){if(iB(yB(a))){if(kB(a))return null;lB(a,!0);XB(a,jB(a));return zB(a,"hover-start",{})}return null});b.addEventListener("pointerleave",function(){kB(a)&&(lB(a,!1),XB(a,jB(a)),iB(yB(a))&&zB(a,"hover-end",{}));return $APP.C.h("pointer",nB(a))?YB(a):null})},aC=function(a,b){b.addEventListener("pointerdown",function(){if(iB(yB(a))){if($APP.n(nB(a)))return null;
|
|
9
|
+
pB(a,"pointer");oB(a,"pointer");XB(a,jB(a));return zB(a,"press-start",{source:"pointer"})}return null});b.addEventListener("pointerup",function(){return $APP.C.h("pointer",nB(a))?YB(a):null});b.addEventListener("pointercancel",function(){return $APP.C.h("pointer",nB(a))?YB(a):null});b.addEventListener("keydown",function(c){c=c.key;if(iB(yB(a))&&($APP.C.h(c,"Enter")||$APP.C.h(c," "))){if($APP.C.h("keyboard",nB(a)))return null;pB(a,"keyboard");oB(a,"keyboard");XB(a,jB(a));return zB(a,"press-start",
|
|
10
|
+
{source:"keyboard"})}return null});b.addEventListener("keyup",function(c){c=c.key;return $APP.C.h("keyboard",nB(a))&&($APP.C.h(c,"Enter")||$APP.C.h(c," "))?YB(a):null});b.addEventListener("blur",function(){return $APP.n(nB(a))?YB(a):null});b.addEventListener("click",function(){if(iB(yB(a))){var c=a.__xButtonLastActivationSource;zB(a,"press",{source:$APP.n(c)?c:"programmatic"});pB(a,null);c=$APP.Z.g(yB(a));var d=a.getAttribute("form");d=$APP.n(d)?document.getElementById(d):null;d=$APP.n(d)?d:a.closest("form");
|
|
11
|
+
return $APP.n(d)?$APP.C.h(c,"submit")?d.requestSubmit():$APP.C.h(c,"reset")?d.reset():null:null}return null})},bC=function(a,b){b.addEventListener("focus",function(){var c=b.matches(":focus-visible");mB(a,c);XB(a,jB(a));return $APP.n(c)?zB(a,"focus-visible",{}):null});b.addEventListener("blur",function(){mB(a,!1);return XB(a,jB(a))})},cC=function(a,b){function c(){return XB(a,b)}b["label-slot"].addEventListener("slotchange",c);b["icon-start-slot"].addEventListener("slotchange",c);b["icon-end-slot"].addEventListener("slotchange",
|
|
12
|
+
c);b["spinner-slot"].addEventListener("slotchange",c)},dC=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.J(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},fC=function(){var a=class extends HTMLElement{};a.formAssociated=!0;a.observedAttributes=eC;a.prototype.connectedCallback=function(){if(!$APP.n(jB(this))){var b=this.attachShadow({mode:"open"});var c=VB("style"),d=VB("button"),e=VB("span"),
|
|
13
|
+
g=VB("span"),h=VB("span"),k=VB("span"),m=VB("span"),p=VB("span"),q=VB("slot"),v=VB("slot"),x=VB("slot"),y=VB("slot");c.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-button-radius:0.75rem;--x-button-gap:0.5rem;--x-button-padding-inline:0.95rem;--x-button-height-sm:2rem;--x-button-height-md:2.5rem;--x-button-height-lg:3rem;--x-button-font-size-sm:0.875rem;--x-button-font-size-md:0.9375rem;--x-button-font-size-lg:1rem;--x-button-font-weight:600;--x-button-icon-size-sm:0.875rem;--x-button-icon-size-md:1rem;--x-button-icon-size-lg:1.125rem;--x-button-spinner-size:1em;--x-button-spinner-stroke:2px;--x-button-shadow:0 1px 2px rgba(15,23,42,0.08),0 1px 1px rgba(15,23,42,0.04);--x-button-shadow-hover:0 4px 10px rgba(15,23,42,0.10),0 2px 4px rgba(15,23,42,0.06);--x-button-shadow-active:0 1px 2px rgba(15,23,42,0.08);--x-button-bg:#2563eb;--x-button-bg-hover:#1d4ed8;--x-button-bg-active:#1e40af;--x-button-bg-disabled:#cbd5e1;--x-button-fg:#ffffff;--x-button-fg-disabled:#ffffff;--x-button-border:transparent;--x-button-border-hover:transparent;--x-button-border-active:transparent;--x-button-secondary-bg:#ffffff;--x-button-secondary-bg-hover:#f8fafc;--x-button-secondary-bg-active:#f1f5f9;--x-button-secondary-fg:#0f172a;--x-button-secondary-border:#cbd5e1;--x-button-tertiary-bg:#f1f5f9;--x-button-tertiary-bg-hover:#e2e8f0;--x-button-tertiary-bg-active:#cbd5e1;--x-button-tertiary-fg:#0f172a;--x-button-ghost-bg:transparent;--x-button-ghost-bg-hover:#f8fafc;--x-button-ghost-bg-active:#f1f5f9;--x-button-ghost-fg:#334155;--x-button-danger-bg:#dc2626;--x-button-danger-bg-hover:#b91c1c;--x-button-danger-bg-active:#991b1b;--x-button-danger-fg:#ffffff;--x-button-focus-ring:#60a5fa;--x-button-transition-duration:140ms;--x-button-transition-easing:cubic-bezier(0.2,0,0,1);}@media (prefers-color-scheme: dark){:host{--x-button-shadow:0 1px 2px rgba(0,0,0,0.35),0 1px 1px rgba(0,0,0,0.2);--x-button-shadow-hover:0 6px 14px rgba(0,0,0,0.35),0 2px 6px rgba(0,0,0,0.24);--x-button-shadow-active:0 1px 2px rgba(0,0,0,0.3);--x-button-bg:#3b82f6;--x-button-bg-hover:#2563eb;--x-button-bg-active:#1d4ed8;--x-button-bg-disabled:#334155;--x-button-fg:#eff6ff;--x-button-fg-disabled:#94a3b8;--x-button-secondary-bg:#111827;--x-button-secondary-bg-hover:#1f2937;--x-button-secondary-bg-active:#273449;--x-button-secondary-fg:#e5e7eb;--x-button-secondary-border:#374151;--x-button-tertiary-bg:#1e293b;--x-button-tertiary-bg-hover:#273449;--x-button-tertiary-bg-active:#334155;--x-button-tertiary-fg:#e5e7eb;--x-button-ghost-bg:transparent;--x-button-ghost-bg-hover:#0f172a;--x-button-ghost-bg-active:#172033;--x-button-ghost-fg:#cbd5e1;--x-button-danger-bg:#ef4444;--x-button-danger-bg-hover:#dc2626;--x-button-danger-bg-active:#b91c1c;--x-button-danger-fg:#ffffff;--x-button-focus-ring:#93c5fd;}}@keyframes x-button-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;inline-size:100%;min-inline-size:0;min-block-size:var(--x-button-height-md);padding-inline:var(--x-button-padding-inline);border-radius:var(--x-button-radius);border:1px solid var(--x-button-border);background:var(--x-button-bg);color:var(--x-button-fg);font-size:var(--x-button-font-size-md);font-weight:var(--x-button-font-weight);line-height:1;cursor:pointer;user-select:none;box-shadow:var(--x-button-shadow);transition:background var(--x-button-transition-duration) var(--x-button-transition-easing),border-color var(--x-button-transition-duration) var(--x-button-transition-easing),color var(--x-button-transition-duration) var(--x-button-transition-easing),transform var(--x-button-transition-duration) var(--x-button-transition-easing),box-shadow var(--x-button-transition-duration) var(--x-button-transition-easing),opacity var(--x-button-transition-duration) var(--x-button-transition-easing);}button[disabled]{cursor:default;box-shadow:none;}button:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-button-focus-ring),var(--x-button-shadow);}button[data-size\x3d'sm']{min-block-size:var(--x-button-height-sm);font-size:var(--x-button-font-size-sm);}button[data-size\x3d'md']{min-block-size:var(--x-button-height-md);font-size:var(--x-button-font-size-md);}button[data-size\x3d'lg']{min-block-size:var(--x-button-height-lg);font-size:var(--x-button-font-size-lg);}button[data-variant\x3d'primary']{background:var(--x-button-bg);color:var(--x-button-fg);border-color:var(--x-button-border);}button[data-variant\x3d'primary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-bg-hover);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'primary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-variant\x3d'secondary']{background:var(--x-button-secondary-bg);color:var(--x-button-secondary-fg);border-color:var(--x-button-secondary-border);}button[data-variant\x3d'secondary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-secondary-bg-hover);border-color:var(--x-button-secondary-border);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'secondary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-secondary-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-variant\x3d'tertiary']{background:var(--x-button-tertiary-bg);color:var(--x-button-tertiary-fg);border-color:transparent;box-shadow:none;}button[data-variant\x3d'tertiary'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-tertiary-bg-hover);}button[data-variant\x3d'tertiary'][data-active\x3d'true']:not([disabled]){background:var(--x-button-tertiary-bg-active);transform:translateY(1px);}button[data-variant\x3d'ghost']{background:var(--x-button-ghost-bg);color:var(--x-button-ghost-fg);border-color:transparent;box-shadow:none;}button[data-variant\x3d'ghost'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-ghost-bg-hover);}button[data-variant\x3d'ghost'][data-active\x3d'true']:not([disabled]){background:var(--x-button-ghost-bg-active);transform:translateY(1px);}button[data-variant\x3d'danger']{background:var(--x-button-danger-bg);color:var(--x-button-danger-fg);border-color:transparent;}button[data-variant\x3d'danger'][data-hover\x3d'true']:not([disabled]){background:var(--x-button-danger-bg-hover);box-shadow:var(--x-button-shadow-hover);}button[data-variant\x3d'danger'][data-active\x3d'true']:not([disabled]){background:var(--x-button-danger-bg-active);transform:translateY(1px);box-shadow:var(--x-button-shadow-active);}button[data-loading\x3d'true']{cursor:progress;}button[data-disabled\x3d'true']{background:var(--x-button-bg-disabled);color:var(--x-button-fg-disabled);border-color:transparent;opacity:0.72;}[part\x3d'inner']{display:inline-flex;align-items:center;justify-content:center;gap:var(--x-button-gap);min-inline-size:0;}[part\x3d'label']{display:inline-flex;align-items:center;justify-content:center;min-inline-size:0;white-space:nowrap;}[part\x3d'icon-start'],[part\x3d'icon-end'],[part\x3d'spinner']{display:inline-flex;align-items:center;justify-content:center;flex:none;}button[data-size\x3d'sm'] [part\x3d'icon-start'],button[data-size\x3d'sm'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-sm);block-size:var(--x-button-icon-size-sm);}button[data-size\x3d'md'] [part\x3d'icon-start'],button[data-size\x3d'md'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-md);block-size:var(--x-button-icon-size-md);}button[data-size\x3d'lg'] [part\x3d'icon-start'],button[data-size\x3d'lg'] [part\x3d'icon-end']{inline-size:var(--x-button-icon-size-lg);block-size:var(--x-button-icon-size-lg);}[part\x3d'spinner']{inline-size:var(--x-button-spinner-size);block-size:var(--x-button-spinner-size);position:relative;}[part\x3d'spinner-slot']{display:inline-flex;align-items:center;justify-content:center;}[part\x3d'spinner-fallback']{display:none;inline-size:100%;block-size:100%;box-sizing:border-box;border-radius:999px;border:var(--x-button-spinner-stroke) solid currentColor;border-inline-end-color:transparent;animation:x-button-spin 0.7s linear infinite;opacity:0.9;}button[data-has-icon-start\x3d'false'] [part\x3d'icon-start']{display:none;}button[data-has-icon-end\x3d'false'] [part\x3d'icon-end']{display:none;}button[data-loading\x3d'false'] [part\x3d'spinner']{display:none;}button[data-loading\x3d'true'][data-has-spinner\x3d'false'] [part\x3d'spinner-fallback']{display:inline-block;}button[data-loading\x3d'true'][data-has-spinner\x3d'true'] [part\x3d'spinner-fallback']{display:none;}@media (prefers-reduced-motion: reduce){button{transition:none;}[part\x3d'spinner-fallback']{animation:none;}}";
|
|
14
|
+
d.setAttribute("part","button");e.setAttribute("part","inner");g.setAttribute("part","icon-start");h.setAttribute("part","label");k.setAttribute("part","spinner");y.setAttribute("part","spinner-slot");m.setAttribute("part","spinner-fallback");p.setAttribute("part","icon-end");v.setAttribute("name","icon-start");x.setAttribute("name","icon-end");y.setAttribute("name","spinner");k.setAttribute("aria-hidden","true");m.setAttribute("aria-hidden","true");g.appendChild(v);h.appendChild(q);k.appendChild(y);
|
|
15
|
+
k.appendChild(m);p.appendChild(x);e.appendChild(g);e.appendChild(h);e.appendChild(k);e.appendChild(p);d.appendChild(e);b.appendChild(c);b.appendChild(d);b={root:b,style:c,button:d,inner:e,"label-slot":q,"icon-start-slot":v,"icon-end-slot":x,"spinner-slot":y};c=b.button;lB(this,!1);mB(this,!1);oB(this,null);pB(this,null);$B(this,c);aC(this,c);bC(this,c);cC(this,b);this.__xButtonState=b}ZB(this);return XB(this,jB(this))};a.prototype.disconnectedCallback=function(){lB(this,!1);mB(this,!1);oB(this,null);
|
|
16
|
+
return pB(this,null)};a.prototype.attributeChangedCallback=function(){var b=jB(this);$APP.n(b)?(ZB(this),b=XB(this,b)):b=null;return b};dC(a.prototype,"disabled","disabled");dC(a.prototype,"loading","loading");dC(a.prototype,"pressed","pressed");return a},gC=function(){return $APP.n(customElements.get("x-button"))?null:customElements.define("x-button",fC())},WB=new $APP.M(null,"has-default-text?","has-default-text?",2021837624),qB=new $APP.M(null,"pressed","pressed",1100937946);var rB=new $APP.S(null,new $APP.R(null,3,["reset",null,"submit",null,"button",null],null),null),sB=new $APP.S(null,new $APP.R(null,5,["secondary",null,"tertiary",null,"primary",null,"danger",null,"ghost",null],null),null),xB=new $APP.S(null,new $APP.R(null,3,["md",null,"lg",null,"sm",null],null),null),eC="disabled loading pressed type variant size label".split(" ");
|
|
17
|
+
$APP.Ed(["press",new $APP.R(null,1,[$APP.V,new $APP.R(null,1,[$APP.Jj,$APP.Y],null)],null),"press-start",new $APP.R(null,1,[$APP.V,new $APP.R(null,1,[$APP.Jj,$APP.Y],null)],null),"press-end",new $APP.R(null,1,[$APP.V,new $APP.R(null,1,[$APP.Jj,$APP.Y],null)],null),"hover-start",new $APP.R(null,1,[$APP.V,$APP.Fd],null),"hover-end",new $APP.R(null,1,[$APP.V,$APP.Fd],null),"focus-visible",new $APP.R(null,1,[$APP.V,$APP.Fd],null)]);$APP.ja("baredom.exports.x_button.init",gC);export const init=gC;
|