@vanelsas/baredom 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/README.md +57 -5
- package/dist/base.js +212 -212
- package/dist/x-alert.js +16 -16
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +16 -16
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +9 -9
- package/dist/x-collapse.js +11 -11
- package/dist/x-command-palette.js +29 -29
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +20 -19
- package/dist/x-copy.js +23 -23
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +36 -36
- package/dist/x-divider.js +12 -12
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +10 -10
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +16 -16
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +18 -18
- package/dist/x-grid.js +6 -6
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.js +37 -37
- package/dist/x-liquid-fill.js +42 -42
- package/dist/x-liquid-glass.js +38 -38
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +11 -11
- package/dist/x-metaball-cursor.js +28 -28
- package/dist/x-modal.js +11 -11
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +31 -31
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-progress.js +38 -38
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +14 -14
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +9 -9
- package/dist/x-radio.js +12 -12
- package/dist/x-ripple-effect.js +11 -11
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +34 -35
- package/dist/x-scroll-timeline.js +46 -49
- package/dist/x-scroll.js +39 -39
- package/dist/x-search-field.js +15 -15
- package/dist/x-select.js +10 -10
- package/dist/x-sidebar.js +17 -17
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +21 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +6 -6
- package/dist/x-splash.js +14 -14
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +11 -11
- package/dist/x-tab.js +8 -8
- package/dist/x-table-cell.js +21 -21
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-theme.js +25 -0
- package/dist/x-timeline-item.js +21 -21
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +23 -23
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +11 -10
- package/package.json +6 -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)},
|
|
2
|
+
var Bw=function(a){a=$APP.G($APP.Zl,a);return $APP.r(a)?a:"info"},Cw=function(a){return a==null?!0:$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},Dw=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.t(isNaN(a))&&a>0?a:null):null},Ew=function(a){var b=$APP.N(a);a=$APP.G(b,$APP.hi);b=$APP.G(b,$APP.W);return $APP.r(a)?$APP.t(b):a},Fw=function(a,b){var c=$APP.N(a);a=$APP.G(c,$APP.Z);c=$APP.G(c,$APP.Hk);return new $APP.P(null,3,[$APP.Z,Bw(a),$APP.ji,b,$APP.Hk,
|
|
3
|
+
c],null)},Hw=function(a){var b=$APP.l(a,"__xAlertRefs");if($APP.r(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:var(--x-radius-md,10px);--x-alert-padding-y:10px;--x-alert-padding-x:12px;--x-alert-gap:10px;--x-alert-font-size:var(--x-font-size-sm,0.875rem);--x-alert-motion-fast:var(--x-transition-duration,120ms);--x-alert-motion-ease:var(--x-transition-easing,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:var(--x-color-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:var(--x-color-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
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.P(null,7,[$APP.bi,b,$APP.Zi,
|
|
5
|
-
d,$APP.uh,e,$APP.Pi,g,$APP.
|
|
6
|
-
b=$APP.G(b,$APP.Th);c=$APP.G($APP.
|
|
7
|
-
$APP.Z),d=$APP.G(b,$APP.
|
|
5
|
+
d,$APP.uh,e,$APP.Pi,g,$APP.Ml,h,Gw,k,$APP.Zj,m],null);return $APP.l(a,"__xAlertRefs")},Iw=function(a){a=new $APP.P(null,7,[$APP.Uh,a.getAttribute("type"),$APP.Hk,a.getAttribute("text"),$APP.yh,a.hasAttribute("icon"),$APP.Vi,a.getAttribute("icon"),$APP.Li,a.getAttribute("dismissible"),$APP.Sk,a.hasAttribute("disabled"),$APP.Th,a.getAttribute("timeout-ms")],null);var b=$APP.N(a),c=$APP.G(b,$APP.Uh);a=$APP.G(b,$APP.Hk);var d=$APP.G(b,$APP.yh),e=$APP.G(b,$APP.Vi),g=$APP.G(b,$APP.Li),h=$APP.G(b,$APP.Sk);
|
|
6
|
+
b=$APP.G(b,$APP.Th);c=$APP.G($APP.Yl,typeof c==="string"?c.toLowerCase():null);c=$APP.r(c)?c:$APP.wk;typeof e==="string"?(e=e.trim(),e=$APP.O(e,"")&&$APP.O(e.toLowerCase(),"none")?e:null):e=null;d=$APP.r($APP.r(d)?e==null:d)?$APP.Rl:e!=null?$APP.Jk:$APP.Kh;return new $APP.P(null,7,[$APP.Z,c,$APP.Hk,$APP.r(a)?a:"",$APP.Bj,d,$APP.Xj,$APP.D.i(d,$APP.Jk)?e:null,$APP.hi,Cw(g),$APP.W,$APP.I(h),$APP.ul,Dw(b)],null)},Jw=function(a){var b=Iw(a);if($APP.O($APP.l(a,"__xAlertModel"),b)){b=$APP.N(b);var c=$APP.G(b,
|
|
7
|
+
$APP.Z),d=$APP.G(b,$APP.Hk),e=$APP.G(b,$APP.Bj),g=$APP.G(b,$APP.Xj),h=$APP.G(b,$APP.hi),k=$APP.G(b,$APP.W),m=Hw(a),p=$APP.N(m);m=$APP.G(p,$APP.Zi);var q=$APP.G(p,$APP.uh),w=$APP.G(p,$APP.Pi),x=$APP.G(p,$APP.Ml),y=$APP.G(p,Gw);p=$APP.G(p,$APP.Zj);w=$APP.r(w)?w.assignedNodes().length>0:null;$APP.D.i(e,$APP.Jk)||(g=$APP.G($APP.$l,c),g=$APP.r(g)?g:$APP.G($APP.$l,$APP.wk));e=$APP.t(w)&&$APP.D.i(e,$APP.Rl);a.setAttribute("data-type",Bw(c));w=m.setAttribute;c=$APP.D.i(c,$APP.jl)||$APP.D.i(c,$APP.Zh)?"alert":
|
|
8
8
|
"status";w.call(m,"role",c);y.textContent=d;e?(x.textContent="",q.style.display="none"):(x.textContent=g,q.style.display="inline");$APP.r(h)?(p.disabled=$APP.I(k),p.style.display="inline-flex"):(p.disabled=!0,p.style.display="none");p.setAttribute("aria-label","Dismiss alert");d=$APP.r(h)?$APP.t(k):h;a.tabIndex=$APP.r(d)?0:-1;$APP.r(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");$APP.r(d)?a.setAttribute("aria-keyshortcuts","Escape"):a.removeAttribute("aria-keyshortcuts");
|
|
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.r(d)?d:
|
|
12
|
-
function g(e){return $APP.D.i(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering")):null})}},
|
|
13
|
-
$APP.r(h)&&(clearTimeout(h),a.__xAlertExitTimer=null),$APP.r(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);$APP.n(a,"__xAlertExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.r($APP.r(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.r(b)&&
|
|
15
|
-
"__xAlertExiting")):d}())&&(b.preventDefault(),
|
|
16
|
-
$APP.
|
|
9
|
+
a.__xAlertModel=b}},Kw=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},Lw=function(a){var b=window.getComputedStyle(a);a=Kw(b.getPropertyValue("--x-alert-exit-duration"));b=Kw(b.getPropertyValue("--x-motion-exit-duration"));
|
|
10
|
+
return a>0?a:b>0?b:160},Mw=function(a){var b=$APP.l(a,"__xAlertTimeout");$APP.r(b)&&(clearTimeout(b),a.__xAlertTimeout=null)},Ow=function(a){Mw(a);var b=function(){var c=$APP.l(a,"__xAlertModel");return $APP.r(c)?c:Iw(a)}();$APP.r(function(){var c=Ew(b);return $APP.r(c)?typeof $APP.ul.g(b)==="number"&&$APP.t($APP.l(a,"__xAlertExiting")):c}())&&$APP.n(a,"__xAlertTimeout",setTimeout(function(){a.__xAlertTimeout=null;if($APP.r(function(){var d=a.isConnected;return $APP.r(d)?$APP.t($APP.l(a,"__xAlertExiting")):
|
|
11
|
+
d}())){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.r(d)?d:Iw(a)}();if($APP.r(Ew(c)))return c=$APP.nh(Fw(c,"timeout")),c=new CustomEvent("x-alert-dismiss",{detail:c,bubbles:!0,composed:!0,cancelable:!0}),c=a.dispatchEvent(c),$APP.r(c)?Nw.g?Nw.g(a):Nw.call(null,a):null}return null},$APP.ul.g(b)))},Pw=function(a){if(!$APP.r($APP.l(a,"__xAlertEntered"))){a.__xAlertEntered=!0;a.setAttribute("data-entering","");var b=Hw(a);b=$APP.N(b);var c=$APP.G(b,$APP.Zi);c.addEventListener("animationend",
|
|
12
|
+
function g(e){return $APP.D.i(e.target,c)?(c.removeEventListener("animationend",g),a.removeAttribute("data-entering")):null})}},Nw=function(a){if(!$APP.r($APP.l(a,"__xAlertExiting"))){a.__xAlertExiting=!0;Mw(a);a.removeAttribute("data-entering");var b=Lw(a);if(b===0||$APP.I(window.matchMedia("(prefers-reduced-motion:reduce)").matches))a.remove();else{var c=Hw(a);c=$APP.N(c);var d=$APP.G(c,$APP.Zi),e=function k(h){return $APP.D.i(h.target,d)?(d.removeEventListener("animationend",k),h=$APP.l(a,"__xAlertExitTimer"),
|
|
13
|
+
$APP.r(h)&&(clearTimeout(h),a.__xAlertExitTimer=null),$APP.r(a.isConnected)?a.remove():null):null};a.setAttribute("data-exiting","");d.addEventListener("animationend",e);$APP.n(a,"__xAlertExitTimer",setTimeout(function(){var h=a.isConnected;return $APP.r($APP.r(h)?$APP.l(a,"__xAlertExiting"):h)?(d.removeEventListener("animationend",e),a.__xAlertExitTimer=null,a.remove()):null},b+60))}}return null},Qw=function(a,b){var c=$APP.l(a,"__xAlertModel");c=$APP.r(c)?c:Iw(a);b=$APP.nh(Fw(c,b));b=new CustomEvent("x-alert-dismiss",
|
|
14
|
+
{detail:b,bubbles:!0,composed:!0,cancelable:!0});b=a.dispatchEvent(b);$APP.r(b)&&Nw(a)},Rw=function(a,b){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.r(d)?d:Iw(a)}();$APP.r(function(){var d=Ew(c);return $APP.r(d)?$APP.t($APP.l(a,"__xAlertExiting")):d}())&&(b.preventDefault(),Qw(a,"button"));return null},Sw=function(a,b){if($APP.D.i(b.key,"Escape")){var c=function(){var d=$APP.l(a,"__xAlertModel");return $APP.r(d)?d:Iw(a)}();$APP.r(function(){var d=Ew(c);return $APP.r(d)?$APP.t($APP.l(a,
|
|
15
|
+
"__xAlertExiting")):d}())&&(b.preventDefault(),Qw(a,"keyboard"))}return null},Tw=function(a){function b(e){return Sw(a,e)}function c(e){return Rw(a,e)}var d=Hw(a);d=$APP.N(d);$APP.G(d,$APP.Zj).addEventListener("click",c);a.addEventListener("keydown",b);$APP.n(a,"__xAlertHandlers",{click:c,keydown:b})},Uw=function(a){Mw(a);var b=$APP.l(a,"__xAlertExitTimer");$APP.r(b)&&(clearTimeout(b),a.__xAlertExitTimer=null);b=$APP.l(a,"__xAlertHandlers");var c=$APP.l(a,"__xAlertRefs");if($APP.r($APP.r(b)?c:b)){c=
|
|
16
|
+
$APP.Zj.g(c);var d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.r(d)&&c.removeEventListener("click",d);$APP.r(b)&&a.removeEventListener("keydown",b)}a.__xAlertHandlers=null},Vw=function(a){Object.defineProperty(a,"type",{get:function(){var b=this.getAttribute("type");return $APP.r(b)?b:"info"},set:function(b){return $APP.r(b)?this.setAttribute("type",""+$APP.S.g(b)):this.removeAttribute("type")},enumerable:!0,configurable:!0});Object.defineProperty(a,"text",{get:function(){var b=this.getAttribute("text");
|
|
17
17
|
return $APP.r(b)?b:""},set:function(b){return $APP.r(b)?this.setAttribute("text",""+$APP.S.g(b)):this.removeAttribute("text")},enumerable:!0,configurable:!0});Object.defineProperty(a,"icon",{get:function(){return this.getAttribute("icon")},set:function(b){return $APP.r(b)?this.setAttribute("icon",""+$APP.S.g(b)):this.removeAttribute("icon")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.r(b)?this.setAttribute("disabled",
|
|
18
|
-
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"dismissible",{get:function(){return
|
|
19
|
-
""+$APP.S.g(b|0))},enumerable:!0,configurable:!0})},
|
|
20
|
-
customElements.define("x-alert",
|
|
18
|
+
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"dismissible",{get:function(){return Cw(this.getAttribute("dismissible"))},set:function(b){return $APP.r(b)?this.setAttribute("dismissible",""):this.setAttribute("dismissible","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"timeoutMs",{get:function(){return Dw(this.getAttribute("timeout-ms"))},set:function(b){return b==null?this.removeAttribute("timeout-ms"):this.setAttribute("timeout-ms",
|
|
19
|
+
""+$APP.S.g(b|0))},enumerable:!0,configurable:!0})},Xw=function(){var a=class extends HTMLElement{};a.observedAttributes=Ww;a.prototype.connectedCallback=function(){Hw(this);Uw(this);Tw(this);Jw(this);Pw(this);Ow(this);return null};a.prototype.disconnectedCallback=function(){Uw(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(Jw(this),$APP.r(this.isConnected)&&Ow(this));return null};Vw(a.prototype);return a},Yw=function(){$APP.r(customElements.get("x-alert"))||
|
|
20
|
+
customElements.define("x-alert",Xw());return null},Ww="type text icon dismissible disabled timeout-ms".split(" "),Gw=new $APP.K(null,"text-el","text-el",-1615414066);$APP.ka("baredom.exports.x_alert.init",Yw);export const init=Yw;
|
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.P(null,2,[$APP.
|
|
4
|
-
$APP.G(b,
|
|
5
|
-
m=$APP.G(m,
|
|
6
|
-
d=$APP.u($APP.de.o($APP.ch,q,$APP.kg(0,Number.MAX_VALUE)));g=null;for(q=k=0;;)if(q<k){var x=g.G(null,q),y=$APP.Cc(x,0,null);x=$APP.Cc(x,1,null);x<e?(y.style.display="",y.setAttribute("size",c),$APP.r(h)?y.setAttribute("disabled",""):y.removeAttribute("disabled"),y.style.marginInlineStart=x>0?w:"0px"):y.style.display="none";q+=1}else if(d=$APP.u(d))$APP.Pc(d)?(k=$APP.yb(d),d=$APP.zb(d),g=k,k=$APP.
|
|
7
|
-
c),$APP.r(h)?g.setAttribute("disabled",""):g.removeAttribute("disabled"),g.style.marginInlineStart=k>0?w:"0px"):g.style.display="none",d=$APP.z(d),g=null,k=0),q=0;else break;p>0?(m.textContent="+"+$APP.S.g(p),m.setAttribute("role","img"),m.setAttribute("aria-label",""+$APP.S.g(p)+" more"),m.style.display="inline-flex",m.style.marginInlineStart=w):(m.textContent="",m.style.display="none");a.__xAvatarGroupModel=b},
|
|
8
|
-
|
|
9
|
-
this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},
|
|
10
|
-
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},
|
|
11
|
-
function(){
|
|
12
|
-
"overflow",2058931880),
|
|
2
|
+
var hx=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.J(a,c)?c:b},ix=function(a){if(typeof a==="string"){a=parseInt(a,10);var b=isFinite(a);return $APP.r($APP.r(b)?a>0:b)?a:null}return null},kx=function(a){var b=$APP.l(a,"__xAvatarGroupRefs");if($APP.r(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:var(--x-color-surface, rgba(0,0,0,0.08));--x-avatar-group-overflow-color:var(--x-color-text-muted, rgba(0,0,0,0.70));--x-avatar-group-overflow-border:var(--x-color-border, rgba(0,0,0,0.14));--x-avatar-group-overflow-ring:var(--x-color-bg, #ffffff);--x-avatar-group-size:32px;--x-avatar-group-font-size:0.75rem;}@media (prefers-color-scheme:dark){:host{--x-avatar-group-overflow-bg:var(--x-color-surface, rgba(255,255,255,0.10));--x-avatar-group-overflow-color:var(--x-color-text-muted, rgba(255,255,255,0.75));--x-avatar-group-overflow-border:var(--x-color-border, rgba(255,255,255,0.18));--x-avatar-group-overflow-ring:var(--x-color-bg, #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.P(null,2,[$APP.Kk,d,jx,e],null);return $APP.l(a,"__xAvatarGroupRefs")},qx=function(a){a=new $APP.P(null,6,[$APP.Zk,a.getAttribute("size"),lx,a.getAttribute("overlap"),$APP.ck,a.getAttribute("max"),$APP.si,a.getAttribute("direction"),$APP.Sk,a.hasAttribute("disabled"),$APP.Oh,a.getAttribute("label")],null);var b=$APP.N(a);a=$APP.G(b,$APP.Zk);var c=
|
|
4
|
+
$APP.G(b,lx),d=$APP.G(b,$APP.ck),e=$APP.G(b,$APP.si),g=$APP.G(b,$APP.Sk);b=$APP.G(b,$APP.Oh);a=hx(mx,"md",a);c=hx(nx,"md",c);d=ix(d);e=hx(ox,"ltr",e);g=$APP.I(g);typeof b==="string"?(b=b.trim(),b=$APP.D.i(b,"")?null:b):b=null;return new $APP.P(null,6,[$APP.rh,a,px,c,$APP.ak,d,$APP.Ni,e,$APP.gj,g,$APP.T,b],null)},sx=function(a,b){b=$APP.N(b);var c=$APP.G(b,$APP.rh),d=$APP.G(b,px),e=$APP.G(b,$APP.ak),g=$APP.G(b,$APP.Ni),h=$APP.G(b,$APP.gj),k=$APP.G(b,$APP.T),m=kx(a);m=$APP.N(m);var p=$APP.G(m,$APP.Kk);
|
|
5
|
+
m=$APP.G(m,jx);var q=$APP.xc(p.assignedElements());p=$APP.C(q);p=$APP.r($APP.r(e)?p>e:e)?new $APP.ve(null,2,5,$APP.we,[e,p-e],null):new $APP.ve(null,2,5,$APP.we,[p,0],null);e=$APP.Cc(p,0,null);p=$APP.Cc(p,1,null);var w=$APP.Dc(rx,d,"0px");a.setAttribute("data-size",c);a.setAttribute("data-overlap",d);a.setAttribute("data-direction",g);a.setAttribute("role","group");$APP.r(k)?a.setAttribute("aria-label",k):a.removeAttribute("aria-label");$APP.r(h)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");
|
|
6
|
+
d=$APP.u($APP.de.o($APP.ch,q,$APP.kg(0,Number.MAX_VALUE)));g=null;for(q=k=0;;)if(q<k){var x=g.G(null,q),y=$APP.Cc(x,0,null);x=$APP.Cc(x,1,null);x<e?(y.style.display="",y.setAttribute("size",c),$APP.r(h)?y.setAttribute("disabled",""):y.removeAttribute("disabled"),y.style.marginInlineStart=x>0?w:"0px"):y.style.display="none";q+=1}else if(d=$APP.u(d))$APP.Pc(d)?(k=$APP.yb(d),d=$APP.zb(d),g=k,k=$APP.C(k)):(k=$APP.v(d),g=$APP.Cc(k,0,null),k=$APP.Cc(k,1,null),k<e?(g.style.display="",g.setAttribute("size",
|
|
7
|
+
c),$APP.r(h)?g.setAttribute("disabled",""):g.removeAttribute("disabled"),g.style.marginInlineStart=k>0?w:"0px"):g.style.display="none",d=$APP.z(d),g=null,k=0),q=0;else break;p>0?(m.textContent="+"+$APP.S.g(p),m.setAttribute("role","img"),m.setAttribute("aria-label",""+$APP.S.g(p)+" more"),m.style.display="inline-flex",m.style.marginInlineStart=w):(m.textContent="",m.style.display="none");a.__xAvatarGroupModel=b},tx=function(a){sx(a,qx(a));return null},ux=function(a){function b(){return tx(a)}var c=
|
|
8
|
+
kx(a);c=$APP.N(c);c=$APP.G(c,$APP.Kk);$APP.r(c)&&c.addEventListener("slotchange",b);$APP.n(a,"__xAvatarGroupHandlers",{slot:b})},vx=function(a){var b=$APP.l(a,"__xAvatarGroupHandlers");if($APP.r(b)){var c=$APP.l(a,"__xAvatarGroupRefs");$APP.r(c)&&(c=$APP.Kk.g(c),b=$APP.l(b,"slot"),$APP.r($APP.r(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xAvatarGroupHandlers=null},wx=function(a){Object.defineProperty(a,"label",{get:function(){return this.getAttribute("label")},set:function(b){return $APP.r(b)?
|
|
9
|
+
this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},xx=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 $APP.r(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},yx=function(a){Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.r(b)?this.setAttribute("disabled",
|
|
10
|
+
""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},zx=function(a){Object.defineProperty(a,"max",{get:function(){return ix(this.getAttribute("max"))},set:function(b){return b!=null?this.setAttribute("max",""+$APP.S.g(b)):this.removeAttribute("max")},enumerable:!0,configurable:!0})},Ax=function(a){xx(a,"size","md");xx(a,"overlap","md");xx(a,"direction","ltr");wx(a);yx(a);zx(a)},Cx=function(){var a=class extends HTMLElement{};a.observedAttributes=Bx;a.prototype.connectedCallback=
|
|
11
|
+
function(){kx(this);vx(this);ux(this);tx(this);return null};a.prototype.disconnectedCallback=function(){vx(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&(b=qx(this),$APP.O($APP.l(this,"__xAvatarGroupModel"),b)&&sx(this,b));return null};Ax(a.prototype);return a},Dx=function(){$APP.r(customElements.get("x-avatar-group"))||customElements.define("x-avatar-group",Cx());return null},lx=new $APP.K(null,"overlap-raw","overlap-raw",1202229114),jx=new $APP.K(null,"overflow",
|
|
12
|
+
"overflow",2058931880),px=new $APP.K(null,"overlap","overlap",-1673335644);var Bx="size overlap max direction disabled label".split(" "),mx=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),nx=new $APP.R(null,new $APP.P(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),ox=new $APP.R(null,new $APP.P(null,2,["ltr",null,"rtl",null],null),null),rx=new $APP.P(null,4,"none 0px sm -4px md -8px lg -12px".split(" "),null);$APP.ka("baredom.exports.x_avatar_group.init",Dx);export const init=Dx;
|
package/dist/x-avatar.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b=$APP.G(b,
|
|
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
|
|
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.P(null,7,[
|
|
6
|
-
m,
|
|
7
|
-
e);a.setAttribute("data-variant",g);$APP.r(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.r(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");c=$APP.r(c)?c:"";$APP.O(function(){var
|
|
8
|
-
p);q.style.display=E?"inline":"none";w.style.display=F?"inline":"none";$APP.r(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.r(A)?"block":"none";a.__xAvatarModel=b},
|
|
9
|
-
|
|
10
|
-
3):d:null;var q=d==null?
|
|
11
|
-
g=$APP.G(g,
|
|
12
|
-
b)}}a.__xAvatarHandlers=null},
|
|
13
|
-
"src");
|
|
14
|
-
return null};a.prototype.disconnectedCallback=function(){
|
|
15
|
-
new $APP.
|
|
16
|
-
-1423153400),
|
|
17
|
-
$APP.Q([
|
|
2
|
+
var BT=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.J(a,c)?c:b},CT=function(a){return typeof a==="string"?(a=a.trim(),$APP.D.i(a,"")?null:a):null},DT=function(a){a=CT(a);if($APP.r(a)){var b=$APP.Be($APP.he(function(c){return $APP.D.i(c,"")},a.split(/\s+/)));if($APP.u(b))return a=$APP.v(b)[0],b=$APP.C(b)>=2?$APP.v($APP.z(b))[0]:null,a=""+$APP.S.g(a)+$APP.S.g($APP.r(b)?b:""),$APP.D.i(a,"")?null:a.toUpperCase()}return null},GT=function(a){var b=$APP.N(a);a=$APP.G(b,ET);
|
|
3
|
+
b=$APP.G(b,FT);return $APP.r(a)?a:b},IT=function(a){var b=$APP.N(a);a=$APP.G(b,HT);b=$APP.G(b,$APP.Si);return $APP.r(a)?a:b},QT=function(a){var b=$APP.l(a,"__xAvatarRefs");if($APP.r(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
|
+
":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:var(--x-color-surface, rgba(0,0,0,0.06));--x-avatar-border:var(--x-color-border, rgba(0,0,0,0.14));--x-avatar-color:var(--x-color-text, rgba(0,0,0,0.86));--x-avatar-ring:var(--x-color-bg, #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-focus-ring:var(--x-color-focus-ring, rgba(59,130,246,0.55));--x-avatar-font-size:var(--x-font-size-sm, 0.875rem);--x-avatar-size:var(--x-avatar-size-md);}@media (prefers-color-scheme:dark){:host{--x-avatar-bg:var(--x-color-surface, rgba(255,255,255,0.10));--x-avatar-border:var(--x-color-border, rgba(255,255,255,0.18));--x-avatar-color:var(--x-color-text, rgba(255,255,255,0.88));--x-avatar-ring:var(--x-color-bg, #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.P(null,7,[JT,d,KT,e,LT,g,MT,h,NT,k,OT,
|
|
6
|
+
m,PT,p],null);return $APP.l(a,"__xAvatarRefs")},ST=function(a,b){b=$APP.N(b);var c=$APP.G(b,RT),d=$APP.G(b,$APP.rh),e=$APP.G(b,$APP.wj),g=$APP.G(b,$APP.Fh),h=$APP.G(b,$APP.Ij),k=$APP.G(b,$APP.gj),m=QT(a),p=$APP.N(m);m=$APP.G(p,KT);var q=$APP.G(p,LT),w=$APP.G(p,MT),x=$APP.G(p,NT),y=$APP.G(p,OT),A=$APP.G(p,PT),B=$APP.I($APP.l(a,"__xAvatarImgOk")),E=c!=null;p=GT(b);var H=IT(b);B=E&&B;E=!B&&p!=null;var F=!B&&!E;A=$APP.r(A)?A.assignedNodes().length>0:null;a.setAttribute("data-size",d);a.setAttribute("data-shape",
|
|
7
|
+
e);a.setAttribute("data-variant",g);$APP.r(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.r(k)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");c=$APP.r(c)?c:"";$APP.O(function(){var M=$APP.l(a,"__xAvatarLastSrc");return $APP.r(M)?M:""}(),c)&&(a.__xAvatarLastSrc=c,m.src=c);m.style.display=B?"block":"none";E&&(q.textContent=
|
|
8
|
+
p);q.style.display=E?"inline":"none";w.style.display=F?"inline":"none";$APP.r(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.r(A)?"block":"none";a.__xAvatarModel=b},aU=function(a){var b=$APP.Q([TT,$APP.Bk,$APP.Fk,
|
|
9
|
+
UT,$APP.mi,$APP.Sk,VT,WT,$APP.Zk],[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.G(c,TT),e=$APP.G(c,$APP.Bk),g=$APP.G(c,$APP.Fk);b=$APP.G(c,UT);var h=$APP.G(c,$APP.mi),k=$APP.G(c,VT),m=$APP.G(c,$APP.Sk),p=$APP.G(c,WT);c=$APP.G(c,$APP.Zk);p=CT(p);k=CT(k);g=CT(g);d=CT(d);d=$APP.r(d)?d.length>3?d.slice(0,
|
|
10
|
+
3):d:null;var q=d==null?DT(g):null,w=[ET,$APP.gj,$APP.Fh,HT,$APP.Si,RT,$APP.rh,$APP.Ij,FT,$APP.wj];m=$APP.I(m);e=BT(XT,"neutral",e);c=BT(YT,"md",c);h=typeof h==="string"?h.trim().toLowerCase():null;h=$APP.J(ZT,h)?h:null;b=$APP.Q(w,[d,m,e,k,g,p,c,h,q,BT($T,"circle",b)]);$APP.O($APP.l(a,"__xAvatarModel"),b)&&ST(a,b);return null},gU=function(a){function b(){return aU(a)}function c(){a.__xAvatarImgOk=!1;return aU(a)}function d(){a.__xAvatarImgOk=!0;return aU(a)}var e=QT(a),g=$APP.N(e);e=$APP.G(g,KT);
|
|
11
|
+
g=$APP.G(g,PT);e.addEventListener("load",d);e.addEventListener("error",c);$APP.r(g)&&g.addEventListener("slotchange",b);$APP.n(a,"__xAvatarHandlers",{load:d,error:c,slot:b})},BU=function(a){var b=$APP.l(a,"__xAvatarHandlers");if($APP.r(b)){var c=$APP.l(a,"__xAvatarRefs");if($APP.r(c)){var d=KT.g(c);c=PT.g(c);var e=$APP.l(b,"load"),g=$APP.l(b,"error");b=$APP.l(b,"slot");$APP.r(e)&&d.removeEventListener("load",e);$APP.r(g)&&d.removeEventListener("error",g);$APP.r($APP.r(c)?b:c)&&c.removeEventListener("slotchange",
|
|
12
|
+
b)}}a.__xAvatarHandlers=null},CU=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.r(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},DU=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 $APP.r(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},EU=function(a){CU(a,
|
|
13
|
+
"src");CU(a,"alt");CU(a,"name");CU(a,"initials");DU(a,"size","md");DU(a,"shape","circle");DU(a,"variant","neutral");CU(a,"status");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})},GU=function(){var a=class extends HTMLElement{};a.observedAttributes=FU;a.prototype.connectedCallback=function(){QT(this);BU(this);gU(this);aU(this);
|
|
14
|
+
return null};a.prototype.disconnectedCallback=function(){BU(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&($APP.D.i(b,"src")&&(this.__xAvatarImgOk=!1),aU(this));return null};EU(a.prototype);return a},HU=function(){$APP.r(customElements.get("x-avatar"))||customElements.define("x-avatar",GU());return null},HT=new $APP.K(null,"alt","alt",-3214426),UT=new $APP.K(null,"shape-raw","shape-raw",1588938757),LT=new $APP.K(null,"initials-el","initials-el",2044340724),KT=
|
|
15
|
+
new $APP.K(null,"img","img",1442687358),NT=new $APP.K(null,"status-el","status-el",2132204108),ET=new $APP.K(null,"initials","initials",-2130377215),RT=new $APP.K(null,"src","src",-1651076051),OT=new $APP.K(null,"badge-el","badge-el",1341875403),PT=new $APP.K(null,"badge-slot","badge-slot",2030670001),TT=new $APP.K(null,"initials-raw","initials-raw",1031756224),FT=new $APP.K(null,"derived","derived",1986040597),WT=new $APP.K(null,"src-raw","src-raw",-510472785),VT=new $APP.K(null,"alt-raw","alt-raw",
|
|
16
|
+
-1423153400),MT=new $APP.K(null,"fallback-el","fallback-el",-208030239),JT=new $APP.K(null,"root-el","root-el",1068654895);var FU="src alt name initials size shape variant status disabled".split(" "),YT=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),$T=new $APP.R(null,new $APP.P(null,3,["rounded",null,"square",null,"circle",null],null),null),XT=new $APP.R(null,new $APP.P(null,3,["neutral",null,"brand",null,"subtle",null],null),null),ZT=new $APP.R(null,new $APP.P(null,4,["online",null,"away",null,"offline",null,"busy",null],null),null);
|
|
17
|
+
$APP.Q([ET,$APP.gj,$APP.Fh,HT,$APP.Si,RT,$APP.rh,$APP.Ij,$APP.wj],[new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.qj],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null)]);$APP.ka("baredom.exports.x_avatar.init",HU);export const init=HU;
|
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.
|
|
4
|
-
$APP.
|
|
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.P(null,3,[
|
|
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.n(a,"__xBadgeHandlers",{slot:b})},
|
|
9
|
-
b,{get:function(){var d=this.getAttribute(b);return $APP.r(d)?d:c},set:function(d){return $APP.r(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},
|
|
10
|
-
null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},
|
|
11
|
-
|
|
12
|
-
"empty",767870958),
|
|
2
|
+
var $S=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.J(a,c)?c:b},aT=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.r($APP.r(c)?a>=0:c)?a:b}return b},eT=function(a){var b=$APP.N(a);a=$APP.G(b,bT);var c=$APP.G(b,$APP.vh),d=$APP.G(b,$APP.Hk);b=$APP.G(b,cT);return $APP.r(a)?$APP.Fi:c!=null?$APP.vh:d!=null?$APP.Hk:$APP.r(b)?cT:dT},fT=function(a){var b=$APP.N(a);a=$APP.G(b,$APP.vh);var c=$APP.G(b,$APP.ak),d=$APP.G(b,$APP.Hk);b=eT(b);
|
|
3
|
+
switch(b instanceof $APP.K?b.ra:null){case "count":return a>c?""+$APP.S.g(c)+"+":""+$APP.S.g(a);case "text":return d;default:return null}},mT=function(a){var b=$APP.N(a);a=$APP.G(b,$APP.kj);var c=$APP.G(b,gT),d=$APP.G(b,$APP.Ui),e=$APP.G(b,hT),g=$APP.G(b,$APP.Bk),h=$APP.G(b,$APP.qh),k=$APP.G(b,bT),m=$APP.G(b,$APP.ck),p=$APP.G(b,iT);b=$APP.G(b,$APP.Zk);m=aT(m,99);var q=$APP.r(p)?function(){var w=aT(p,null);return w!=null?w:null}():null;return $APP.Q([bT,$APP.Fh,jT,$APP.rh,$APP.ak,$APP.vh,$APP.Pl,cT,
|
|
4
|
+
$APP.Uk,$APP.Hk],[$APP.I(k),$S(kT,"neutral",g),e!=null&&$APP.O(e,"false"),$S(lT,"md",b),m,q,d,c!=null&&$APP.O(c,"false"),a,typeof h==="string"?function(){var w=h.trim();return $APP.D.i(w,"")?null:w}():null])},oT=function(a){var b=$APP.l(a,"__xBadgeRefs");if($APP.r(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:var(--x-color-text,rgba(0,0,0,0.80));--x-badge-border:var(--x-color-border,rgba(0,0,0,0.12));--x-badge-font-size:var(--x-font-size-sm,0.75rem);--x-badge-height:1.25rem;--x-badge-padding:0 0.375rem;--x-badge-radius:var(--x-radius-sm,0.25rem);}@media (prefers-color-scheme:dark){:host{--x-badge-bg:rgba(255,255,255,0.12);--x-badge-color:var(--x-color-text,rgba(255,255,255,0.88));--x-badge-border:var(--x-color-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.P(null,3,[nT,d,$APP.Kk,e,$APP.Hl,g],null);return $APP.l(a,"__xBadgeRefs")},pT=function(a){var b=oT(a);b=$APP.N(b);b=$APP.G(b,$APP.Kk);return mT($APP.Q([$APP.Bk,$APP.qh,bT,$APP.ck,$APP.Zk,iT,$APP.kj,gT,$APP.Ui,hT],[a.getAttribute("variant"),a.getAttribute("text"),$APP.r(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")]))},qT=function(a){var b=pT(a);if($APP.O($APP.l(a,"__xBadgeModel"),b)){b=$APP.N(b);var c=$APP.G(b,$APP.Fh),d=$APP.G(b,$APP.rh),e=$APP.G(b,jT),g=$APP.G(b,cT),h=$APP.G(b,$APP.Uk),k=$APP.G(b,$APP.Pl),m=oT(a),p=$APP.N(m);m=$APP.G(p,nT);p=$APP.G(p,$APP.Hl);var q=eT(b),w=fT(b);a.setAttribute("data-variant",c);a.setAttribute("data-size",d);a.setAttribute("data-mode",
|
|
7
|
+
$APP.bg(q));$APP.r(e)?a.setAttribute("data-pill",""):a.removeAttribute("data-pill");$APP.r(g)?a.setAttribute("data-dot",""):a.removeAttribute("data-dot");p.textContent=$APP.r(w)?w:"";$APP.r(h)?m.setAttribute("aria-label",h):m.removeAttribute("aria-label");$APP.r(k)?m.setAttribute("aria-describedby",k):m.removeAttribute("aria-describedby");a.__xBadgeModel=b}return null},rT=function(a){function b(){return qT(a)}var c=oT(a);c=$APP.N(c);c=$APP.G(c,$APP.Kk);$APP.r(c)&&c.addEventListener("slotchange",b);
|
|
8
|
+
$APP.n(a,"__xBadgeHandlers",{slot:b})},sT=function(a){var b=$APP.l(a,"__xBadgeHandlers");if($APP.r(b)){var c=$APP.l(a,"__xBadgeRefs");$APP.r(c)&&(c=$APP.Kk.g(c),b=$APP.l(b,"slot"),$APP.r($APP.r(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBadgeHandlers=null},tT=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.r(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},uT=function(a,b,c){Object.defineProperty(a,
|
|
9
|
+
b,{get:function(){var d=this.getAttribute(b);return $APP.r(d)?d:c},set:function(d){return $APP.r(d)?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},vT=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.r(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},wT=function(a,b,c){Object.defineProperty(a,b,{get:function(){return aT(this.getAttribute(b),c)},set:function(d){return d!=
|
|
10
|
+
null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},xT=function(a){uT(a,"variant","neutral");uT(a,"size","md");vT(a,"pill");vT(a,"dot");tT(a,"text");tT(a,"aria-label");tT(a,"aria-describedby");wT(a,"count",null);wT(a,"max",99);Object.defineProperty(a,"displayText",{get:function(){return fT(pT(this))},enumerable:!0,configurable:!0})},zT=function(){var a=class extends HTMLElement{};a.observedAttributes=yT;a.prototype.connectedCallback=function(){oT(this);
|
|
11
|
+
sT(this);rT(this);qT(this);return null};a.prototype.disconnectedCallback=function(){sT(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&qT(this);return null};xT(a.prototype);return a},AT=function(){$APP.r(customElements.get("x-badge"))||customElements.define("x-badge",zT());return null},jT=new $APP.K(null,"pill","pill",-37707E3),iT=new $APP.K(null,"count-raw","count-raw",-952861839),bT=new $APP.K(null,"has-slot?","has-slot?",181244965),dT=new $APP.K(null,"empty",
|
|
12
|
+
"empty",767870958),cT=new $APP.K(null,"dot","dot",1442709401),gT=new $APP.K(null,"dot-raw","dot-raw",1754908187),hT=new $APP.K(null,"pill-raw","pill-raw",-557846051),nT=new $APP.K(null,"base","base",185279322);var yT="variant size pill dot count max text aria-label aria-describedby".split(" "),kT=new $APP.R(null,new $APP.P(null,5,["success",null,"neutral",null,"warning",null,"info",null,"error",null],null),null),lT=new $APP.R(null,new $APP.P(null,2,["md",null,"sm",null],null),null);$APP.ka("baredom.exports.x_badge.init",AT);export const init=AT;
|
package/dist/x-bento-grid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.oj),d=$APP.G(a,$APP.
|
|
4
|
-
|
|
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}
|
|
6
|
-
return a},
|
|
2
|
+
var QA=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"}},SA=function(a){return $APP.J(RA,a)?a:"md"},TA=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),typeof a==="number"&&$APP.t(isNaN(a))?$APP.Zg.i($APP.Yg.i(a,1),12):4):4},UA=function(a){return typeof a==="string"&&$APP.O(a,"")?a:"auto"},XA=function(a){a=$APP.N(a);var b=$APP.G(a,$APP.Tj),c=$APP.G(a,
|
|
3
|
+
$APP.oj),d=$APP.G(a,$APP.pl),e=$APP.G(a,$APP.Ki);a=$APP.G(a,VA);b=TA(b);var g=SA(c);c=function(){var k=$APP.J(RA,d)?d:null;return $APP.r(k)?k:g}();var h=function(){var k=$APP.J(RA,e)?e:null;return $APP.r(k)?k:g}();a=UA(a);return new $APP.P(null,6,[$APP.Tj,b,WA,"repeat("+$APP.S.g(b)+",minmax(0,1fr))",$APP.oj,g,$APP.pl,QA(c),$APP.Ki,QA(h),VA,a],null)},YA=function(a){var b=new $APP.P(null,5,[$APP.Tj,a.getAttribute("columns"),$APP.oj,a.getAttribute("gap"),$APP.pl,a.getAttribute("row-gap"),$APP.Ki,a.getAttribute("column-gap"),
|
|
4
|
+
VA,a.getAttribute("row-height")],null);b=XA(b);a=$APP.l(a,"__xBentoGridBase");$APP.r(a)?(a=a.style,a.setProperty("--x-bento-grid-columns",WA.g(b)),a.setProperty("--x-bento-grid-row-height",VA.g(b)),a.setProperty("--x-bento-grid-row-gap",$APP.pl.g(b)),b=a.setProperty("--x-bento-grid-column-gap",$APP.Ki.g(b))):b=null;return b},ZA=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}YA(a);
|
|
6
|
+
return a},aB=function(){var a=class extends HTMLElement{};a.observedAttributes=$A;a.prototype.connectedCallback=function(){return ZA(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__xBentoGridInit")===!0?YA(this):ZA(this)};return a},bB=function(){return $APP.r(customElements.get("x-bento-grid"))?null:customElements.define("x-bento-grid",aB())},VA=new $APP.K(null,"row-height","row-height",527360749),WA=new $APP.K(null,"template","template",-702405684);var $A=["columns","gap","row-gap","column-gap","row-height"],RA=new $APP.R(null,new $APP.P(null,6,["none",null,"xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null);$APP.ka("baredom.exports.x_bento_grid.init",bB);export const init=bB;
|
package/dist/x-bento-item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
5,[$APP.
|
|
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}
|
|
5
|
-
|
|
2
|
+
var Zw=function(a){return typeof a==="string"&&$APP.O(a,"")?(a=parseInt(a,10),typeof a==="number"&&$APP.t(isNaN(a))?$APP.Zg.i($APP.Yg.i(a,1),6):1):1},cx=function(a){var b=new $APP.P(null,3,[$APP.vl,a.getAttribute("col-span"),$APP.Ch,a.getAttribute("row-span"),$w,a.getAttribute("order")],null);var c=$APP.N(b);b=$APP.G(c,$APP.vl);var d=$APP.G(c,$APP.Ch);c=$APP.G(c,$w);b=Zw(b);d=Zw(d);typeof c==="string"&&$APP.O(c,"")?(c=parseInt(c,10),c=typeof c==="number"&&$APP.t(isNaN(c))?c:null):c=null;b=new $APP.P(null,
|
|
3
|
+
5,[$APP.vl,b,$APP.Ch,d,ax,"span "+$APP.S.g(b),bx,"span "+$APP.S.g(d),$w,c],null);a=a.style;a.setProperty("grid-column",ax.g(b));a.setProperty("grid-row",bx.g(b));b=$w.g(b);return $APP.r(b)?a.setProperty("order",""+$APP.S.g(b)):a.removeProperty("order")},dx=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}cx(a);return a},fx=function(){var a=class extends HTMLElement{};a.observedAttributes=ex;a.prototype.connectedCallback=function(){return dx(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__xBentoItemInit")===!0?cx(this):dx(this)};return a},gx=function(){return $APP.r(customElements.get("x-bento-item"))?null:customElements.define("x-bento-item",
|
|
5
|
+
fx())},bx=new $APP.K(null,"row-span-css","row-span-css",956357389),$w=new $APP.K(null,"order","order",-1254677256),ax=new $APP.K(null,"col-span-css","col-span-css",-1306581329);var ex=["col-span","row-span","order"];$APP.ka("baredom.exports.x_bento_item.init",gx);export const init=gx;
|
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.P(null,3,[$APP.Xh,d,$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
|
-
$APP.G(c,
|
|
7
|
-
d=$APP.G(b,$APP.rh);e=$APP.G(b,$APP.Fh);q=$APP.G(b,
|
|
8
|
-
|
|
9
|
-
for(k=p=0;;)if(k<p){var y=h.G(null,k);x=$APP.Cc(y,0,null);y=$APP.Cc(y,1,null);y=$APP.Cc(c,y,null);var A=$APP.D.i(x,$APP.
|
|
10
|
-
h>0&&!$APP.D.i(h,g)&&q.appendChild(
|
|
11
|
-
$APP.r(c)&&(c=$APP.
|
|
12
|
-
""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},
|
|
13
|
-
function(a){
|
|
14
|
-
function(b,c,d){$APP.O(c,d)&&
|
|
15
|
-
"wrap-raw","wrap-raw",-1468030804),
|
|
2
|
+
var as=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.J(a,c)?c:b},bs=function(a,b){if(typeof a==="string"){a=parseInt(a,10);var c=isFinite(a);return $APP.r($APP.r(c)?a>0:c)?a:b}return b},cs=function(a){var b=$APP.l(a,"__xBreadcrumbsRefs");if($APP.r(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:var(--x-font-size-sm,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.P(null,3,[$APP.Xh,d,$APP.fk,e,$APP.Kk,g],null);return $APP.l(a,"__xBreadcrumbsRefs")},ds=function(a){var b=document.createElement("span");b.setAttribute("class","separator");b.setAttribute("aria-hidden","true");b.textContent=a;return b},es=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},fs=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.r(b)&&(c.setAttribute("data-current",
|
|
5
|
+
""),d.setAttribute("aria-current","page"));return c},vs=function(a){var b=$APP.Q([$APP.Bk,gs,$APP.Sk,hs,is,$APP.Zk,js,ks,$APP.kj,ls,$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.G(c,$APP.kj);var d=
|
|
6
|
+
$APP.G(c,ls),e=$APP.G(c,$APP.Ui),g=$APP.G(c,gs),h=$APP.G(c,$APP.Bk),k=$APP.G(c,$APP.Sk),m=$APP.G(c,is),p=$APP.G(c,hs),q=$APP.G(c,$APP.Zk),w=$APP.G(c,js);c=$APP.G(c,ks);w=$APP.I(w);m=bs(m,2);p=p!=null&&$APP.O(p,"false");k=$APP.I(k);h=as(ms,"default",h);if(typeof g==="string"){g=parseInt(g,10);var x=isFinite(g);g=$APP.r($APP.r(x)?g>0:x)?g:null}else g=null;b=$APP.Q([ns,os,ps,$APP.gj,$APP.Fh,qs,$APP.rh,$APP.Pl,rs,$APP.Uk,$APP.gk],[w,m,p,k,h,g,as(ss,"md",q),e,bs(c,1),b,typeof d==="string"?d:"/"]);b=$APP.N(b);
|
|
7
|
+
d=$APP.G(b,$APP.rh);e=$APP.G(b,$APP.Fh);q=$APP.G(b,ps);$APP.G(b,$APP.gj);c=$APP.G(b,$APP.Uk);w=$APP.G(b,$APP.Pl);g=cs(a);g=$APP.N(g);g=$APP.G(g,$APP.Xh);a.setAttribute("data-size",d);a.setAttribute("data-variant",e);a.setAttribute("data-wrap",""+$APP.S.g($APP.I(q)));$APP.r(c)?g.setAttribute("aria-label",c):g.setAttribute("aria-label","Breadcrumb");$APP.r(w)?g.setAttribute("aria-describedby",w):g.removeAttribute("aria-describedby");e=$APP.N(b);d=$APP.G(e,$APP.gk);m=$APP.G(e,qs);h=$APP.G(e,rs);g=$APP.G(e,
|
|
8
|
+
os);e=$APP.G(e,ns);q=cs(a);q=$APP.N(q);c=$APP.G(q,$APP.Kk);q=$APP.G(q,$APP.fk);c=$APP.xc(c.assignedElements());w=$APP.C(c);m==null||w<=m?g=new $APP.P(null,3,[$APP.Qk,$APP.Be($APP.kg(0,w)),ts,-1,us,w],null):(m=$APP.Zg.i(h,$APP.Yg.i(0,w-g)),g=$APP.Zg.i(g,$APP.Yg.i(0,w-m)),m=$APP.Zg.i(m,w-g),m=$APP.Yg.i(0,m),m=$APP.Be($APP.kg(0,m)),g=$APP.Be($APP.kg(w-g,w)),g=new $APP.P(null,3,[$APP.Qk,$APP.af.i(m,g),ts,$APP.C(m),us,w],null));w=$APP.Qk.g(g);g=ts.g(g);q.innerHTML="";m=$APP.u($APP.Zd($APP.ch,w));h=null;
|
|
9
|
+
for(k=p=0;;)if(k<p){var y=h.G(null,k);x=$APP.Cc(y,0,null);y=$APP.Cc(y,1,null);y=$APP.Cc(c,y,null);var A=$APP.D.i(x,$APP.C(w)-1)&&$APP.t(e);$APP.D.i(x,g)&&q.appendChild(es(d));x>0&&!$APP.D.i(x,g)&&q.appendChild(ds(d));$APP.D.i(x,g)&&q.appendChild(ds(d));$APP.r(y)&&q.appendChild(fs(y,A));k+=1}else if(m=$APP.u(m))$APP.Pc(m)?(p=$APP.yb(m),m=$APP.zb(m),h=p,p=$APP.C(p)):(p=$APP.v(m),h=$APP.Cc(p,0,null),p=$APP.Cc(p,1,null),p=$APP.Cc(c,p,null),k=$APP.D.i(h,$APP.C(w)-1)&&$APP.t(e),$APP.D.i(h,g)&&q.appendChild(es(d)),
|
|
10
|
+
h>0&&!$APP.D.i(h,g)&&q.appendChild(ds(d)),$APP.D.i(h,g)&&q.appendChild(ds(d)),$APP.r(p)&&q.appendChild(fs(p,k)),m=$APP.z(m),h=null,p=0),k=0;else break;$APP.D.i(g,$APP.C(w))&&q.appendChild(es(d));a.__xBreadcrumbsModel=b;return null},ws=function(a){function b(){return vs(a)}var c=cs(a);c=$APP.N(c);c=$APP.G(c,$APP.Kk);$APP.r(c)&&c.addEventListener("slotchange",b);$APP.n(a,"__xBreadcrumbsHandlers",{slot:b})},xs=function(a){var b=$APP.l(a,"__xBreadcrumbsHandlers");if($APP.r(b)){var c=$APP.l(a,"__xBreadcrumbsRefs");
|
|
11
|
+
$APP.r(c)&&(c=$APP.Kk.g(c),b=$APP.l(b,"slot"),$APP.r($APP.r(c)?b:c)&&c.removeEventListener("slotchange",b))}a.__xBreadcrumbsHandlers=null},ys=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return $APP.r(c)?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},zs=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 $APP.r(d)?this.setAttribute(b,
|
|
12
|
+
""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},As=function(a,b){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(b)},set:function(c){return $APP.r(c)?this.setAttribute(b,""):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Bs=function(a,b,c){Object.defineProperty(a,b,{get:function(){return bs(this.getAttribute(b),c)},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},Cs=
|
|
13
|
+
function(a){zs(a,"separator","/");zs(a,"size","md");zs(a,"variant","default");As(a,"wrap");As(a,"disabled");As(a,"preserve-aria-current");Bs(a,"max-items",null);Bs(a,"items-before",1);Bs(a,"items-after",2);ys(a,"aria-label");ys(a,"aria-describedby")},Es=function(){var a=class extends HTMLElement{};a.observedAttributes=Ds;a.prototype.connectedCallback=function(){cs(this);xs(this);ws(this);vs(this);return null};a.prototype.disconnectedCallback=function(){xs(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
+
function(b,c,d){$APP.O(c,d)&&vs(this);return null};Cs(a.prototype);return a},Fs=function(){$APP.r(customElements.get("x-breadcrumbs"))||customElements.define("x-breadcrumbs",Es());return null},os=new $APP.K(null,"items-after","items-after",358736705),ps=new $APP.K(null,"wrap","wrap",851669987),ls=new $APP.K(null,"separator-raw","separator-raw",1358337914),ks=new $APP.K(null,"items-before-raw","items-before-raw",1580997624),gs=new $APP.K(null,"max-items-raw","max-items-raw",-340487390),hs=new $APP.K(null,
|
|
15
|
+
"wrap-raw","wrap-raw",-1468030804),qs=new $APP.K(null,"max-items","max-items",-1969244147),ts=new $APP.K(null,"ellipsis-at","ellipsis-at",-628372349),js=new $APP.K(null,"preserve-aria-current-present?","preserve-aria-current-present?",729931506),is=new $APP.K(null,"items-after-raw","items-after-raw",-1677187220),rs=new $APP.K(null,"items-before","items-before",-1151895719),ns=new $APP.K(null,"preserve-aria-current","preserve-aria-current",682773185),us=new $APP.K(null,"total","total",1916810418);var Ds="separator size variant wrap max-items items-before items-after disabled preserve-aria-current aria-label aria-describedby".split(" "),ss=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),ms=new $APP.R(null,new $APP.P(null,3,["subtle",null,"text",null,"default",null],null),null);$APP.ka("baredom.exports.x_breadcrumbs.init",Fs);export const init=Fs;
|