@vanelsas/baredom 2.2.0 → 2.3.1
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 +23 -0
- package/README.md +3 -3
- package/dist/base.js +408 -394
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +14 -14
- 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-carousel.js +29 -29
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +42 -42
- package/dist/x-combobox.js +28 -0
- package/dist/x-command-palette.js +25 -25
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +18 -20
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- 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-icon.js +7 -7
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.js +40 -40
- package/dist/x-liquid-glass.js +39 -39
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +27 -27
- package/dist/x-modal.js +12 -12
- 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 +10 -10
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-particle-button.js +47 -47
- package/dist/x-popover.js +24 -14
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- 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 -34
- package/dist/x-scroll-timeline.js +45 -45
- 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-group.js +15 -0
- package/dist/x-skeleton.js +1 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +15 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +19 -19
- 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 +17 -17
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +21 -21
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +14 -0
- package/dist/x-typography.js +8 -8
- package/package.json +13 -1
package/dist/x-sidebar.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
b)?b.focus():null},
|
|
2
|
+
var r1=function(a,b,c){a.dispatchEvent(new CustomEvent(b,$APP.Gh(new $APP.Q(null,3,[$APP.V,c,$APP.sm,!0,$APP.Fm,!0],null))))},t1=function(a,b){$APP.I(s1,b)&&r1(a,"dismiss",new $APP.Q(null,1,[$APP.Li,b],null))},u1=function(a){var b=window.getComputedStyle(a);return $APP.N("none",b.display)&&$APP.N("hidden",b.visibility)&&a.offsetWidth>0&&a.offsetHeight>0},v1=function(a){var b=$APP.k(a,"_panel");$APP.n(b.hasAttribute("tabindex"))||(b.setAttribute("tabindex","-1"),a._panelTabindexAdded=!0);return b.focus()},
|
|
3
|
+
w1=function(a){var b=$APP.k(a,"_restoreFocusTarget"),c=$APP.k(a,"_panel"),d=$APP.k(a,"_panelTabindexAdded")===!0,e=$APP.k(a,"_root");var g=$APP.k(a,"_sidebar");e=$APP.n(e)?e.activeElement:null;var h=document.activeElement;g=$APP.n($APP.n(e)?$APP.n(g)?g.contains(e):g:e)?e:$APP.n($APP.n(h)?$APP.n(g)?g.contains(h):g:h)?h:null;$APP.n(g)&&g.blur();a._tabbables=null;a._restoreFocusTarget=null;$APP.n($APP.n(c)?d:c)&&(c.removeAttribute("tabindex"),a._panelTabindexAdded=!1);return $APP.n($APP.n(b)?b.isConnected:
|
|
4
|
+
b)?b.focus():null},x1=function(a,b){var c=$APP.k(a,"_tabbables");c=$APP.n(c)?$APP.xe($APP.uc(c)):$APP.fe;var d=$APP.k(a,"_panel");if($APP.Hc(c))return b.preventDefault(),$APP.n(d)?v1(a):null;a=document.activeElement;d=$APP.u(c);c=$APP.xc(c);var e=b.shiftKey;return $APP.n($APP.n(e)?$APP.C.i(a,d):e)?(b.preventDefault(),c.focus()):$APP.r(e)&&$APP.C.i(a,c)?(b.preventDefault(),d.focus()):null},y1=function(a){if(!$APP.n($APP.k(a,"_root"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),
|
|
5
5
|
d=document.createElement("div"),e=document.createElement("aside"),g=document.createElement("div"),h=document.createElement("slot");c.textContent=":host { --x-sidebar-bg: var(--x-color-bg, Canvas); --x-sidebar-fg: var(--x-color-text, CanvasText); --x-sidebar-backdrop: rgb(0 0 0 / 0.4); --x-sidebar-shadow: var(--x-shadow-lg, 0 8px 24px rgb(0 0 0 / 0.18)); --x-sidebar-width: 18rem; --x-sidebar-collapsed-width: 4rem; --x-sidebar-duration: var(--x-transition-duration, 180ms); --x-sidebar-easing: var(--x-transition-easing, ease); display: block; position: relative;}:host([hidden]) { display: none; }.backdrop[hidden] { display: none; }.backdrop { position: fixed; inset: 0; background: var(--x-sidebar-backdrop); opacity: 0; z-index: 999; pointer-events: none; transition: opacity var(--x-sidebar-duration) var(--x-sidebar-easing);}.backdrop[data-active\x3d'true'] { opacity: 1; pointer-events: auto;}.sidebar { position: relative; color: var(--x-sidebar-fg); block-size: 100%;}.panel { background: var(--x-sidebar-bg); color: var(--x-sidebar-fg); inline-size: var(--x-sidebar-width); min-block-size: 100%; overflow: hidden; box-shadow: var(--x-sidebar-shadow); will-change: transform, inline-size; transition: transform var(--x-sidebar-duration) var(--x-sidebar-easing), inline-size var(--x-sidebar-duration) var(--x-sidebar-easing), opacity var(--x-sidebar-duration) var(--x-sidebar-easing);}:host([data-effective-variant\x3d'docked']) .panel[data-collapsed\x3d'true'] { inline-size: var(--x-sidebar-collapsed-width);}:host([data-effective-variant\x3d'overlay']) .sidebar,:host([data-effective-variant\x3d'modal']) .sidebar { position: fixed; inset-block: 0; z-index: 1000; pointer-events: none;}:host([data-effective-variant\x3d'overlay'][data-open\x3d'true']) .sidebar,:host([data-effective-variant\x3d'modal'][data-open\x3d'true']) .sidebar { pointer-events: auto;}:host([data-effective-variant\x3d'overlay'][data-placement\x3d'left']) .sidebar,:host([data-effective-variant\x3d'modal'][data-placement\x3d'left']) .sidebar { inset-inline-start: 0;}:host([data-effective-variant\x3d'overlay'][data-placement\x3d'right']) .sidebar,:host([data-effective-variant\x3d'modal'][data-placement\x3d'right']) .sidebar { inset-inline-end: 0;}:host([data-effective-variant\x3d'overlay'][data-placement\x3d'left']) .panel[data-open\x3d'false'],:host([data-effective-variant\x3d'modal'][data-placement\x3d'left']) .panel[data-open\x3d'false'] { transform: translateX(-100%); pointer-events: none;}:host([data-effective-variant\x3d'overlay'][data-placement\x3d'right']) .panel[data-open\x3d'false'],:host([data-effective-variant\x3d'modal'][data-placement\x3d'right']) .panel[data-open\x3d'false'] { transform: translateX(100%); pointer-events: none;}:host([data-effective-variant\x3d'overlay']) .panel[data-open\x3d'true'],:host([data-effective-variant\x3d'modal']) .panel[data-open\x3d'true'] { transform: translateX(0); pointer-events: auto;}:host([data-reduced-motion\x3d'true']) .panel,:host([data-reduced-motion\x3d'true']) .backdrop { transition: none;}@media (prefers-color-scheme: dark) { :host { --x-sidebar-bg: var(--x-color-bg, #1f2937); --x-sidebar-fg: var(--x-color-text, #f9fafb); --x-sidebar-shadow: var(--x-shadow-lg, 0 8px 24px rgb(0 0 0 / 0.4)); }}";
|
|
6
|
-
d.className="backdrop";d.setAttribute("part","backdrop");d.hidden=!0;e.className="sidebar";e.setAttribute("part","sidebar");g.className="panel";g.setAttribute("part","panel");g.appendChild(h);e.appendChild(g);b.appendChild(c);b.appendChild(d);b.appendChild(e);a._root=b;a._backdrop=d;a._sidebar=e;a._panel=g;a._slot=h}},
|
|
7
|
-
h=a.getAttribute("breakpoint"),l=a.getAttribute("label"),m=window.innerWidth,p=window.matchMedia("(prefers-reduced-motion: reduce)");c=$APP.M(new $APP.
|
|
8
|
-
m=$APP.n(Number.isFinite(m))?m:q):m=q;p=p!=null?(0,$APP.
|
|
9
|
-
a.setAttribute("data-effective-variant",d);a.setAttribute("data-placement",e);a.setAttribute("data-open",$APP.n(g)?"true":"false");a.setAttribute("data-collapsed",$APP.n(h)?"true":"false");a.setAttribute("data-reduced-motion",$APP.n(l)?"true":"false");d=
|
|
10
|
-
a._restoreFocusTarget=document.activeElement,e=$APP.
|
|
11
|
-
$APP.n(d)?"true":"false"),e.hidden=$APP.r(d),e.inert!=null&&(e.inert=$APP.r(d)));h=$APP.M(c);d=$APP.D(h,$APP.
|
|
12
|
-
|
|
13
|
-
$APP.n(e)?(c=$APP.
|
|
14
|
-
"collapsed",$APP.F(b))},enumerable:!0,configurable:!0})},
|
|
15
|
-
$APP.k(b,"onResize"));this._listening=!0}return
|
|
16
|
-
function(b,c,d){return $APP.N(c,d)?
|
|
17
|
-
-532209910),
|
|
18
|
-
"effective-variant",-829495195),
|
|
6
|
+
d.className="backdrop";d.setAttribute("part","backdrop");d.hidden=!0;e.className="sidebar";e.setAttribute("part","sidebar");g.className="panel";g.setAttribute("part","panel");g.appendChild(h);e.appendChild(g);b.appendChild(c);b.appendChild(d);b.appendChild(e);a._root=b;a._backdrop=d;a._sidebar=e;a._panel=g;a._slot=h}},U1=function(a){y1(a);var b=$APP.k(a,"_prevState");b=$APP.n(b)?b:$APP.Rd;var c=a.hasAttribute("open"),d=a.hasAttribute("collapsed"),e=a.getAttribute("placement"),g=a.getAttribute("variant"),
|
|
7
|
+
h=a.getAttribute("breakpoint"),l=a.getAttribute("label"),m=window.innerWidth,p=window.matchMedia("(prefers-reduced-motion: reduce)");c=$APP.M(new $APP.Q(null,8,[z1,c,A1,d,B1,e,C1,g,D1,h,E1,l,F1,m,G1,$APP.F(p.matches)],null));l=$APP.D(c,z1);h=$APP.D(c,A1);d=$APP.D(c,B1);e=$APP.D(c,C1);m=$APP.D(c,D1);p=$APP.D(c,E1);g=$APP.D(c,F1);c=$APP.D(c,G1);d=$APP.I(H1,d)?d:$APP.Oj.g(I1);e=$APP.I(J1,e)?e:$APP.Tg.g(I1);var q=$APP.dj.g(I1);m=m==null?null:""+$APP.T.g(m);m=m==null?null:(0,$APP.ih)(m);$APP.t(m)?(m=Number(m),
|
|
8
|
+
m=$APP.n(Number.isFinite(m))?m:q):m=q;p=p!=null?(0,$APP.ih)(p):null;p=$APP.t(p)?p:null;p=$APP.n(p)?p:$APP.U.g(I1);l=$APP.M(new $APP.Q(null,1,[z1,l],null));l=$APP.D(l,z1);l=$APP.F(l);h=$APP.F(h);g=g<m?"modal":e;q=$APP.C.i(g,"modal");var v=$APP.C.i(g,"overlay"),x=$APP.C.i(g,"docked");c=$APP.zf([$APP.Vl,K1,L1,M1,$APP.dj,N1,O1,P1,Q1,$APP.U,$APP.Oj,R1,S1,T1],[l,g,!l,x&&h,m,x,h,e,l&&(q||v),p,d,$APP.F(c),q,v]);l=$APP.M(c);d=$APP.D(l,K1);e=$APP.D(l,$APP.Oj);g=$APP.D(l,$APP.Vl);h=$APP.D(l,M1);l=$APP.D(l,R1);
|
|
9
|
+
a.setAttribute("data-effective-variant",d);a.setAttribute("data-placement",e);a.setAttribute("data-open",$APP.n(g)?"true":"false");a.setAttribute("data-collapsed",$APP.n(h)?"true":"false");a.setAttribute("data-reduced-motion",$APP.n(l)?"true":"false");d=S1.g(c);$APP.n(d)&&(d=$APP.Vl.g(c),$APP.n(d)&&(d=S1.g(b),d=$APP.n(d)?$APP.Vl.g(b):d,d=$APP.r(d)));$APP.n(d)?(d=$APP.xe($APP.de(u1,$APP.uc($APP.k(a,"_panel").querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex\x3d'-1'])")))),
|
|
10
|
+
a._restoreFocusTarget=document.activeElement,e=$APP.Gh(d),a._tabbables=e,$APP.t(d)?$APP.u(d).focus():v1(a)):(d=S1.g(b),$APP.n(d)&&(d=$APP.Vl.g(b),$APP.n(d)&&(d=S1.g(c),d=$APP.n(d)?$APP.Vl.g(c):d,d=$APP.r(d))),$APP.n(d)&&w1(a));e=$APP.M(c);d=$APP.D(e,$APP.U);e=$APP.D(e,L1);g=$APP.k(a,"_sidebar");$APP.n(g)&&(g.setAttribute("role","navigation"),g.setAttribute("aria-label",d),g.setAttribute("aria-hidden",$APP.n(e)?"true":"false"));d=$APP.M(c);d=$APP.D(d,Q1);e=$APP.k(a,"_backdrop");$APP.n(e)&&(e.setAttribute("data-active",
|
|
11
|
+
$APP.n(d)?"true":"false"),e.hidden=$APP.r(d),e.inert!=null&&(e.inert=$APP.r(d)));h=$APP.M(c);d=$APP.D(h,$APP.Vl);e=$APP.D(h,$APP.Oj);g=$APP.D(h,K1);h=$APP.D(h,M1);l=$APP.k(a,"_panel");$APP.n(l)&&(l.setAttribute("data-open",$APP.n(d)?"true":"false"),l.setAttribute("data-placement",e),l.setAttribute("data-variant",g),l.setAttribute("data-collapsed",$APP.n(h)?"true":"false"));$APP.N($APP.Vl.g(b),$APP.Vl.g(c))&&(b=$APP.Vl.g(c),r1(a,"toggle",new $APP.Q(null,1,[$APP.Vl,$APP.F(b)],null)));a._prevState=c},
|
|
12
|
+
V1=function(a,b){var c=$APP.k(a,"_prevState"),d=b.key;return $APP.n(function(){var e=S1.g(c);e=$APP.n(e)?e:T1.g(c);return $APP.n(e)?$APP.Vl.g(c):e}())?$APP.C.i(d,"Escape")?(b.preventDefault(),t1(a,"escape"),$APP.Eg(a,"open",!1)):$APP.n(function(){var e=S1.g(c);return $APP.n(e)?$APP.C.i(d,"Tab"):e}())?x1(a,b):null:null},W1=function(a){$APP.n($APP.k(a,"_handlers"))||$APP.ja(a,"_handlers",{onBackdropClick:function(b){var c=$APP.k(a,"_prevState"),d=$APP.k(a,"_backdrop");var e=S1.g(c);e=$APP.n(e)?e:T1.g(c);
|
|
13
|
+
$APP.n(e)?(c=$APP.Vl.g(c),b=$APP.n(c)?$APP.C.i(b.target,d):c):b=e;$APP.n(b)?(t1(a,"backdrop"),b=$APP.Eg(a,"open",!1)):b=null;return b},onKeydown:function(b){return V1(a,b)},onResize:function(){return U1(a)}})},X1=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.Eg(this,"open",$APP.F(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"collapsed",{get:function(){return this.hasAttribute("collapsed")},set:function(b){return $APP.Eg(this,
|
|
14
|
+
"collapsed",$APP.F(b))},enumerable:!0,configurable:!0})},Z1=function(){var a=class extends HTMLElement{};a.observedAttributes=Y1;a.prototype.connectedCallback=function(){y1(this);W1(this);if($APP.k(this,"_listening")!==!0){var b=$APP.k(this,"_handlers"),c=$APP.k(this,"_backdrop"),d=$APP.k(this,"_root");$APP.n($APP.n(c)?b:c)&&c.addEventListener("click",$APP.k(b,"onBackdropClick"));$APP.n($APP.n(d)?b:d)&&d.addEventListener("keydown",$APP.k(b,"onKeydown"));$APP.n(b)&&window.addEventListener("resize",
|
|
15
|
+
$APP.k(b,"onResize"));this._listening=!0}return U1(this)};a.prototype.disconnectedCallback=function(){if($APP.k(this,"_listening")===!0){var b=$APP.k(this,"_handlers"),c=$APP.k(this,"_backdrop"),d=$APP.k(this,"_root");$APP.n($APP.n(c)?b:c)&&c.removeEventListener("click",$APP.k(b,"onBackdropClick"));$APP.n($APP.n(d)?b:d)&&d.removeEventListener("keydown",$APP.k(b,"onKeydown"));$APP.n(b)&&window.removeEventListener("resize",$APP.k(b,"onResize"));this._listening=!1}return w1(this)};a.prototype.attributeChangedCallback=
|
|
16
|
+
function(b,c,d){return $APP.N(c,d)?U1(this):null};X1(a.prototype);return a},$1=function(){return $APP.n(customElements.get("x-sidebar"))?null:customElements.define("x-sidebar",Z1())},P1=new $APP.K(null,"declared-variant","declared-variant",-2054964950),F1=new $APP.K(null,"viewport-width","viewport-width",-1146235948),L1=new $APP.K(null,"aria-hidden","aria-hidden",399337029),O1=new $APP.K(null,"collapsed-requested","collapsed-requested",1573505800),Q1=new $APP.K(null,"show-backdrop","show-backdrop",
|
|
17
|
+
-532209910),A1=new $APP.K(null,"collapsed-attr","collapsed-attr",-1535396832),B1=new $APP.K(null,"placement-attr","placement-attr",-1321967286),z1=new $APP.K(null,"open-attr","open-attr",-1772289801),a2=new $APP.K(null,"collapsed","collapsed",-628494523),G1=new $APP.K(null,"prefers-reduced-motion","prefers-reduced-motion",-2023150975),D1=new $APP.K(null,"breakpoint-attr","breakpoint-attr",-250275627),C1=new $APP.K(null,"variant-attr","variant-attr",-1143729279),K1=new $APP.K(null,"effective-variant",
|
|
18
|
+
"effective-variant",-829495195),R1=new $APP.K(null,"reduced-motion","reduced-motion",79621277),N1=new $APP.K(null,"is-docked","is-docked",875310728),S1=new $APP.K(null,"is-modal","is-modal",1610761086),T1=new $APP.K(null,"is-overlay","is-overlay",1953921119),E1=new $APP.K(null,"label-attr","label-attr",-571749887),M1=new $APP.K(null,"collapsed-applied","collapsed-applied",-1696231706);var Y1="open collapsed placement variant breakpoint label".split(" "),H1=$APP.Uf(["right","left"]),J1=$APP.Uf(["overlay","docked","modal"]),s1=$APP.Uf(["backdrop","escape"]),I1=new $APP.Q(null,6,[$APP.Oj,"left",$APP.Tg,"docked",$APP.dj,768,$APP.U,"Sidebar",$APP.Vl,!1,a2,!1],null);$APP.Qd(["toggle",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Vl,$APP.Xj],null)],null),"dismiss",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Li,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_sidebar.init",$1);export const init=$1;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var DE=function(a){a=new $APP.Q(null,3,[zE,a.getAttribute("preset"),AE,a.getAttribute("animation"),$APP.bj,a.getAttribute("count")],null);var b=$APP.M(a);a=$APP.D(b,zE);var c=$APP.D(b,AE);b=$APP.D(b,$APP.bj);a=$APP.I(BE,a)?a:null;c=$APP.I(CE,c)?c:"pulse";b!=null?(b=parseInt(b,10),b=$APP.n(isNaN(b))?1:$APP.rh.i($APP.qh.i(b,1),20)):b=1;return new $APP.Q(null,3,[$APP.yk,a,$APP.Ug,c,$APP.Ph,b],null)},EE=function(a){var b=performance.now();return a.style.setProperty("--x-skeleton-delay",""+$APP.T.g(-$APP.fd(b,
|
|
3
|
+
1500))+"ms")},FE=function(a,b){a=$APP.k(a,"__xSkeletonGroupRefs");if($APP.n(a)){a=$APP.k(a,"slot").assignedElements({flatten:!0});a=$APP.t($APP.uc(a));for(var c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e);$APP.C.i("X-SKELETON",g.tagName)&&g.setAttribute("animation",b);e+=1}else if(a=$APP.t(a))c=a,$APP.Nc(c)?(a=$APP.yb(c),d=$APP.zb(c),c=a,g=$APP.z(a),a=d,d=g):(g=$APP.u(c),$APP.C.i("X-SKELETON",g.tagName)&&g.setAttribute("animation",b),a=$APP.w(c),c=null,d=0),e=0;else break}},IE=function(a){var b=$APP.k(a,
|
|
4
|
+
"__xSkeletonGroupRefs");if($APP.n(b)){var c=DE(a);b=$APP.k(b,"preset");if($APP.N(c,$APP.k(a,"__xSkeletonGroupModel"))){a.__xSkeletonGroupModel=c;var d=$APP.M(c),e=$APP.D(d,$APP.yk);c=$APP.D(d,$APP.Ug);d=$APP.D(d,$APP.Ph);if($APP.n(e))a:{if(b.textContent="",e=$APP.D(GE,e),$APP.n(e))for(var g=$APP.C.i($APP.ul,$APP.kk.g(e))?"sg-row":"sg-col",h=0;;)if(h<d){var l=document.createElement("div");l.className=g;l.style.gap=$APP.Wj.g(e);for(var m=$APP.t($APP.dk.g(e)),p=null,q=0,v=0;;)if(v<q){var x=p.F(null,
|
|
5
|
+
v);l.appendChild(HE(x,c));v+=1}else if(m=$APP.t(m))p=m,$APP.Nc(p)?(m=$APP.yb(p),v=$APP.zb(p),p=m,q=$APP.z(m),m=v):(m=$APP.u(p),l.appendChild(HE(m,c)),m=$APP.w(p),p=null,q=0),v=0;else break;b.appendChild(l);h+=1}else break a}else b.textContent="";FE(a,c);EE(a);return $APP.n(a.hasAttribute("aria-hidden"))?null:a.setAttribute("aria-hidden","true")}}return null},JE=function(a){return{slotchange:function(){var b=DE(a);b=$APP.M(b);b=$APP.D(b,$APP.Ug);FE(a,b);return EE(a)}}},KE=function(a){var b=$APP.k(a,
|
|
6
|
+
"__xSkeletonGroupRefs");return $APP.n(b)?(a=$APP.k(a,"__xSkeletonGroupHandlers"),$APP.n(a)?$APP.k(b,"slot").removeEventListener("slotchange",$APP.k(a,"slotchange")):null):null},LE=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d!=null&&$APP.N(d)&&$APP.N(d,"")?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},ME=function(a){Object.defineProperty(a,"count",{configurable:!0,
|
|
7
|
+
enumerable:!0,get:function(){var b=this.getAttribute("count");return b!=null?(b=parseInt(b,10),$APP.n(isNaN(b))?null:b):null},set:function(b){return b!=null&&$APP.N(b)?this.setAttribute("count",""+$APP.T.g(b)):this.removeAttribute("count")}})},OE=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return NE}});LE(b,"preset","preset");LE(b,"animation","animation");ME(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSkeletonGroupRefs"))){var c=
|
|
8
|
+
this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("slot");d.textContent=":host{display:block;box-sizing:border-box;}[part\x3dcontainer]{display:flex;flex-direction:column;gap:var(--x-skeleton-group-gap,12px);}[part\x3dpreset-container]:empty{display:none;}:host([preset]) slot{display:none;}.sg-row{display:flex;flex-direction:row;align-items:center;}.sg-col{display:flex;flex-direction:column;}";
|
|
9
|
+
e.setAttribute("part","container");g.setAttribute("part","preset-container");e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xSkeletonGroupRefs={container:e,preset:g,slot:h}}KE(this);this.__xSkeletonGroupHandlers=JE(this);c=$APP.k(this,"__xSkeletonGroupRefs");$APP.n(c)&&(d=$APP.k(this,"__xSkeletonGroupHandlers"),$APP.n(d)&&$APP.k(c,"slot").addEventListener("slotchange",$APP.k(d,"slotchange")));this.__xSkeletonGroupModel=null;return IE(this)};b.disconnectedCallback=function(){return KE(this)};
|
|
10
|
+
b.attributeChangedCallback=function(){return $APP.n($APP.k(this,"__xSkeletonGroupRefs"))?IE(this):null};return a},PE=function(){$APP.ch();return $APP.n(customElements.get("x-skeleton-group"))?null:customElements.define("x-skeleton-group",OE())},QE=new $APP.K(null,"flex","flex",-1425124628),AE=new $APP.K(null,"animation-raw","animation-raw",-576464154),zE=new $APP.K(null,"preset-raw","preset-raw",1216420442);var BE=new $APP.R(null,new $APP.Q(null,5,["profile",null,"paragraph",null,"list-item",null,"card",null,"table-row",null],null),null),CE=new $APP.R(null,new $APP.Q(null,3,["none",null,"pulse",null,"wave",null],null),null),NE=["preset","animation","count"],GE=new $APP.Q(null,5,["card",new $APP.Q(null,3,[$APP.kk,$APP.uj,$APP.Wj,"12px",$APP.dk,new $APP.O(null,4,5,$APP.P,[new $APP.Q(null,3,[$APP.Tg,"rect",$APP.Vg,"100%",$APP.Wg,"140px"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"80%"],null),new $APP.Q(null,
|
|
11
|
+
2,[$APP.Tg,"text",$APP.Vg,"60%"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"40%"],null)],null)],null),"list-item",new $APP.Q(null,3,[$APP.kk,$APP.ul,$APP.Wj,"12px",$APP.dk,new $APP.O(null,2,5,$APP.P,[new $APP.Q(null,3,[$APP.Tg,"circle",$APP.Vg,"40px",$APP.Wg,"40px"],null),new $APP.Q(null,4,[$APP.kk,$APP.uj,$APP.Wj,"8px",QE,"1",$APP.dk,new $APP.O(null,2,5,$APP.P,[new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"70%"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"50%"],null)],null)],null)],null)],
|
|
12
|
+
null),"paragraph",new $APP.Q(null,3,[$APP.kk,$APP.uj,$APP.Wj,"8px",$APP.dk,new $APP.O(null,4,5,$APP.P,[new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"100%"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"100%"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"100%"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"60%"],null)],null)],null),"table-row",new $APP.Q(null,3,[$APP.kk,$APP.ul,$APP.Wj,"16px",$APP.dk,new $APP.O(null,4,5,$APP.P,[new $APP.Q(null,2,[$APP.Tg,"text",QE,"1"],null),new $APP.Q(null,
|
|
13
|
+
2,[$APP.Tg,"text",QE,"1"],null),new $APP.Q(null,2,[$APP.Tg,"text",QE,"1"],null),new $APP.Q(null,2,[$APP.Tg,"text",QE,"1"],null)],null)],null),"profile",new $APP.Q(null,3,[$APP.kk,$APP.ul,$APP.Wj,"12px",$APP.dk,new $APP.O(null,2,5,$APP.P,[new $APP.Q(null,3,[$APP.Tg,"circle",$APP.Vg,"48px",$APP.Wg,"48px"],null),new $APP.Q(null,4,[$APP.kk,$APP.uj,$APP.Wj,"8px",QE,"1",$APP.dk,new $APP.O(null,2,5,$APP.P,[new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,"120px"],null),new $APP.Q(null,2,[$APP.Tg,"text",$APP.Vg,
|
|
14
|
+
"80px"],null)],null)],null)],null)],null)],null);var HE=function HE(a,b){if($APP.n($APP.kk.g(a))){var d=document.createElement("div"),e=$APP.C.i($APP.ul,$APP.kk.g(a))?"sg-row":"sg-col";d.className=e;d.style.gap=$APP.Wj.g(a);e=QE.g(a);$APP.n(e)&&(d.style.flex=e);a=$APP.t($APP.dk.g(a));e=null;for(var g=0,h=0;;)if(h<g){var l=e.F(null,h);d.appendChild(HE.i?HE.i(l,b):HE.call(null,l,b));h+=1}else if(a=$APP.t(a))e=a,$APP.Nc(e)?(a=$APP.yb(e),h=$APP.zb(e),e=a,g=$APP.z(a),a=h):(a=$APP.u(e),d.appendChild(HE.i?HE.i(a,b):HE.call(null,a,b)),a=$APP.w(e),e=null,
|
|
15
|
+
g=0),h=0;else break;return d}d=document.createElement("x-skeleton");e=$APP.Tg.g(a);$APP.n(e)&&d.setAttribute("variant",e);e=$APP.Vg.g(a);$APP.n(e)&&d.setAttribute("width",e);e=$APP.Wg.g(a);$APP.n(e)&&d.setAttribute("height",e);a=QE.g(a);$APP.n(a)&&(d.style.flex=a);d.setAttribute("animation",b);return d};$APP.ha("baredom.exports.x_skeleton_group.init",PE);export const init=PE;
|
package/dist/x-skeleton.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
null);d=$APP.M(b);b=$APP.D(d,$APP.Oh);e=$APP.D(d,$APP.Wi);c=$APP.D(d,$APP.ek);d=$APP.D(d,$APP.Ej);var g=$APP.k(a,"__xSkeletonBase");g.setAttribute("data-variant",b);g.setAttribute("data-animation",e);$APP.n(c)?g.style.setProperty("width",c):g.style.removeProperty("width");$APP.n(d)?g.style.setProperty("height",d):g.style.removeProperty("height");a.setAttribute("aria-hidden","true")},yO=function(a){Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?
|
|
4
|
-
b:"rect"},set:function(b){return typeof b==="string"&&$APP.N("",b)?this.setAttribute("variant",b):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"animation",{get:function(){var b=this.getAttribute("animation");return $APP.n(b)?b:"pulse"},set:function(b){return typeof b==="string"&&$APP.N("",b)?this.setAttribute("animation",b):this.removeAttribute("animation")},enumerable:!0,configurable:!0});Object.defineProperty(a,"width",{get:function(){var b=this.getAttribute("width");
|
|
5
|
-
return $APP.n(b)?b:""},set:function(b){return typeof b==="string"&&$APP.N("",b)?this.setAttribute("width",b):this.removeAttribute("width")},enumerable:!0,configurable:!0});Object.defineProperty(a,"height",{get:function(){var b=this.getAttribute("height");return $APP.n(b)?b:""},set:function(b){return typeof b==="string"&&$APP.N("",b)?this.setAttribute("height",b):this.removeAttribute("height")},enumerable:!0,configurable:!0})},AO=function(){var a=class extends HTMLElement{};a.observedAttributes=zO;
|
|
6
|
-
a.prototype.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSkeletonInit"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div");c.textContent=":host{display:block;box-sizing:border-box;color-scheme:light dark;--x-skeleton-color:var(--x-color-border,rgba(0,0,0,0.08));--x-skeleton-highlight:rgba(255,255,255,0.65);--x-skeleton-border-radius:var(--x-radius-sm,4px);--x-skeleton-duration:1.5s;}@media (prefers-color-scheme:dark){:host{--x-skeleton-color:var(--x-color-border,rgba(255,255,255,0.10));--x-skeleton-highlight:rgba(255,255,255,0.18);}}[part\x3dbase]{width:100%;height:1rem;position:relative;overflow:hidden;background:var(--x-skeleton-color);border-radius:var(--x-skeleton-border-radius);}[part\x3dbase][data-variant\x3d'text']{height:1em;border-radius:3px;}[part\x3dbase][data-variant\x3d'circle']{width:2.5rem;height:2.5rem;border-radius:50%;}[part\x3dshimmer]{position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,var(--x-skeleton-highlight) 50%,transparent 100%);transform:translateX(-100%);display:none;pointer-events:none;}@keyframes x-skeleton-pulse{0%,100%{opacity:1;}50%{opacity:0.4;}}@keyframes x-skeleton-wave{0%{transform:translateX(-100%);}100%{transform:translateX(200%);}}[part\x3dbase][data-animation\x3d'pulse']{animation:x-skeleton-pulse var(--x-skeleton-duration,1.5s) ease-in-out infinite;}[part\x3dbase][data-animation\x3d'wave'] [part\x3dshimmer]{display:block;animation:x-skeleton-wave var(--x-skeleton-duration,1.5s) linear infinite;}@media (prefers-reduced-motion:reduce){[part\x3dbase][data-animation\x3d'pulse']{animation:none;}[part\x3dbase][data-animation\x3d'wave'] [part\x3dshimmer]{animation:none;}}";
|
|
7
|
-
d.setAttribute("part","base");e.setAttribute("part","shimmer");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xSkeletonBase=d;this.__xSkeletonInit=!0}xO(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&$APP.n($APP.k(this,"__xSkeletonInit"))&&xO(this);return null};yO(a.prototype);return a},BO=function(){$APP.n(customElements.get("x-skeleton"))||customElements.define("x-skeleton",AO());return null};var vO=new $APP.S(null,new $APP.R(null,3,["text",null,"rect",null,"circle",null],null),null),wO=new $APP.S(null,new $APP.R(null,3,["none",null,"pulse",null,"wave",null],null),null),zO=["variant","animation","width","height"];$APP.fa("baredom.exports.x_skeleton.init",BO);export const init=BO;
|
|
2
|
+
var oQ=function(){return $APP.ch()};$APP.ha("baredom.exports.x_skeleton.init",oQ);export const init=oQ;
|
package/dist/x-slider.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var l=$APP.M(h);h=$APP.D(l,$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
A,typeof y==="string"&&$APP.N("",y)?y:null,x,typeof B==="string"&&$APP.N("",B)?B:null,v,E,
|
|
6
|
-
q);
|
|
7
|
-
|
|
8
|
-
$APP.T.g(h)):null}return null},
|
|
9
|
-
{value:c,min:d,max:e})}},
|
|
10
|
-
b.preventDefault():null}}
|
|
11
|
-
c,$APP.F(d))}})},
|
|
12
|
-
"value","value");
|
|
13
|
-
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");l.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(l);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:l,input:m};$APP.n(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}
|
|
14
|
-
"input"),d=
|
|
15
|
-
null:customElements.define("x-slider",
|
|
16
|
-
$APP.
|
|
17
|
-
2,[$APP.
|
|
2
|
+
var HI=function(a,b){return typeof a==="string"?(a=parseFloat(a),$APP.n(isNaN(a))?b:a):b},II=function(a,b,c){return a.setAttribute(b,c)},JI=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},OI=function(a){var b=$APP.k(a,"__xSliderRefs");if($APP.n(b)){var c=$APP.k(b,"base"),d=$APP.k(b,"header"),e=$APP.k(b,"label"),g=$APP.k(b,"value");b=$APP.k(b,"input");var h=$APP.zf([$APP.ek,$APP.Nj,$APP.hk,$APP.vj,$APP.Ti,$APP.wj,$APP.Zj,$APP.Kh,$APP.Mk,$APP.U,$APP.Lm,$APP.Cl,KI],[a.getAttribute("min"),
|
|
3
|
+
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var l=$APP.M(h);h=$APP.D(l,$APP.Cl);var m=$APP.D(l,KI),p=$APP.D(l,$APP.ek),q=$APP.D(l,$APP.Nj),v=$APP.D(l,$APP.hk),x=$APP.D(l,$APP.Ti),y=$APP.D(l,$APP.vj),A=$APP.D(l,$APP.wj),B=$APP.D(l,
|
|
4
|
+
$APP.Zj),E=$APP.D(l,$APP.Kh),G=$APP.D(l,$APP.U),H=$APP.D(l,$APP.Mk);l=$APP.D(l,$APP.Lm);p=HI(p,0);H=HI(H,100);x=$APP.rh.i($APP.qh.i(HI(x,0),p),H);$APP.C.i(m,"any")?m="any":(m=typeof m==="string"?parseFloat(m):NaN,m=$APP.r(isNaN(m))&&m>0?""+$APP.T.g(m):"1");E=typeof E==="string"&&$APP.I(LI,E)?E:"md";q=$APP.F(q);A=$APP.F(A);v=$APP.F(v);var J=H>p?$APP.rh.i($APP.qh.i((x-p)/(H-p)*100,0),100):0;h=$APP.zf([$APP.ek,$APP.Pm,$APP.vj,$APP.Ti,$APP.Zj,MI,$APP.Kh,$APP.Mk,$APP.U,$APP.Lm,$APP.Cl,$APP.X,KI,NI],[p,
|
|
5
|
+
A,typeof y==="string"&&$APP.N("",y)?y:null,x,typeof B==="string"&&$APP.N("",B)?B:null,v,E,H,typeof G==="string"&&$APP.N("",G)?G:null,typeof l==="string"&&$APP.N("",l)?l:null,typeof h==="string"&&$APP.N("",h)?h:null,q,m,J]);m=$APP.M(h);y=$APP.D(m,$APP.Cl);B=$APP.D(m,$APP.X);G=$APP.D(m,KI);l=$APP.D(m,NI);v=$APP.D(m,$APP.ek);p=$APP.D(m,$APP.Pm);h=$APP.D(m,$APP.Ti);A=$APP.D(m,$APP.Zj);H=$APP.D(m,MI);q=$APP.D(m,$APP.Kh);x=$APP.D(m,$APP.U);E=$APP.D(m,$APP.Mk);m=$APP.D(m,$APP.Lm);J=(J=x!=null)?J:H;c.setAttribute("data-size",
|
|
6
|
+
q);JI(a,"data-disabled",B);JI(a,"data-readonly",p);d.style.display=$APP.n(J)?"flex":"none";e.textContent=$APP.n(x)?x:"";e.style.display=x!=null?"":"none";g.textContent=$APP.n(H)?""+$APP.T.g(h):"";g.style.display=$APP.n(H)?"":"none";a.style.setProperty("--_x-slider-fill",""+$APP.T.g(l.toFixed(2))+"%");II(b,"min",""+$APP.T.g(v));II(b,"max",""+$APP.T.g(E));b.setAttribute("step",G);$APP.N(b.value,""+$APP.T.g(h))&&(b.value=""+$APP.T.g(h));II(b,"aria-valuemin",""+$APP.T.g(v));II(b,"aria-valuemax",""+$APP.T.g(E));
|
|
7
|
+
II(b,"aria-valuenow",""+$APP.T.g(h));b.setAttribute("aria-readonly",$APP.n(p)?"true":"false");$APP.n(y)?b.setAttribute("aria-label",y):x!=null?b.setAttribute("aria-label",x):b.removeAttribute("aria-label");$APP.n(A)?b.setAttribute("aria-labelledby",A):b.removeAttribute("aria-labelledby");$APP.n(m)?b.setAttribute("aria-describedby",m):b.removeAttribute("aria-describedby");$APP.n(B)?b.setAttribute("disabled",""):b.removeAttribute("disabled");a=$APP.k(a,"__xSliderInternals");return $APP.n(a)?a.setFormValue(""+
|
|
8
|
+
$APP.T.g(h)):null}return null},PI=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},QI=function(a){return function(){if($APP.n(a.hasAttribute("disabled")))return null;var b=$APP.k($APP.k(a,"__xSliderRefs"),"input").value,c=parseFloat(b),d=parseFloat(function(){var g=a.getAttribute("min");return $APP.n(g)?g:"0"}()),e=parseFloat(function(){var g=a.getAttribute("max");return $APP.n(g)?g:"100"}());a.setAttribute("value",b);return PI(a,"x-slider-input",
|
|
9
|
+
{value:c,min:d,max:e})}},RI=function(a){return function(){if($APP.n(a.hasAttribute("disabled")))return null;var b=parseFloat($APP.k($APP.k(a,"__xSliderRefs"),"input").value),c=parseFloat(function(){var e=a.getAttribute("min");return $APP.n(e)?e:"0"}()),d=parseFloat(function(){var e=a.getAttribute("max");return $APP.n(e)?e:"100"}());return PI(a,"x-slider-change",{value:b,min:c,max:d})}},TI=function(a){return function(b){var c=a.hasAttribute("readonly");c=$APP.n(c)?$APP.I(SI,b.key):c;return $APP.n(c)?
|
|
10
|
+
b.preventDefault():null}},UI=function(a){var b=$APP.k(a,"__xSliderRefs");if($APP.n(b)){var c=$APP.k(a,"__xSliderHandlers");if($APP.n(c)){b=$APP.k(b,"input");b.removeEventListener("input",$APP.k(c,"input"));b.removeEventListener("change",$APP.k(c,"change"));b.removeEventListener("keydown",$APP.k(c,"keydown"));a.__xSliderHandlers=null;return}}return null},VI=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return JI(this,
|
|
11
|
+
c,$APP.F(d))}})},WI=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?II(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},YI=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return XI}});VI(b,"disabled","disabled");VI(b,"readOnly","readonly");VI(b,"showValue","show-value");WI(b,
|
|
12
|
+
"value","value");WI(b,"min","min");WI(b,"max","max");WI(b,"step","step");WI(b,"name","name");WI(b,"label","label");WI(b,"size","size");b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSliderRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("span"),l=document.createElement("span"),m=document.createElement("input");d.textContent=":host{display:block;color-scheme:light dark;--x-slider-track-color:rgba(0,0,0,0.15);--x-slider-fill-color:var(--x-color-primary,#3b82f6);--x-slider-thumb-color:var(--x-color-surface,#ffffff);--x-slider-thumb-border:2px solid var(--x-color-primary,#3b82f6);--x-slider-thumb-shadow:0 1px 4px rgba(0,0,0,0.20);--x-slider-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-slider-disabled-opacity:0.45;--x-slider-label-color:rgba(0,0,0,0.60);--x-slider-value-color:rgba(0,0,0,0.50);--x-slider-radius:var(--x-radius-full,9999px);}@media (prefers-color-scheme:dark){:host{--x-slider-track-color:rgba(255,255,255,0.15);--x-slider-fill-color:var(--x-color-primary,#3b82f6);--x-slider-thumb-color:var(--x-color-surface,#ffffff);--x-slider-thumb-border:2px solid var(--x-color-primary,#3b82f6);--x-slider-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-slider-label-color:rgba(255,255,255,0.60);--x-slider-value-color:rgba(255,255,255,0.50);}}[part\x3dbase]{width:100%;box-sizing:border-box;}[part\x3dbase][data-size\x3dsm]{--_x-slider-track-h:4px;--_x-slider-thumb-sz:14px;}[part\x3dbase][data-size\x3dmd]{--_x-slider-track-h:6px;--_x-slider-thumb-sz:18px;}[part\x3dbase][data-size\x3dlg]{--_x-slider-track-h:8px;--_x-slider-thumb-sz:22px;}[part\x3dheader]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px;}[part\x3dlabel-text]{font-size:0.875rem;color:var(--x-slider-label-color);font-weight:500;}[part\x3dvalue-text]{font-size:0.8125rem;color:var(--x-slider-value-color);}[part\x3dinput]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:var(--_x-slider-thumb-sz,18px);cursor:pointer;margin:0;padding:0;background:transparent;outline:none;box-sizing:border-box;}[part\x3dinput]::-webkit-slider-runnable-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:linear-gradient(to right,var(--x-slider-fill-color) var(--_x-slider-fill,0%),var(--x-slider-track-color) var(--_x-slider-fill,0%));}[part\x3dinput]::-moz-range-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-track-color);border:none;}[part\x3dinput]::-moz-range-progress{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-fill-color);}[part\x3dinput]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);margin-top:calc(var(--_x-slider-track-h,6px)/2 - var(--_x-slider-thumb-sz,18px)/2);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]::-moz-range-thumb{width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]:focus-visible::-webkit-slider-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}[part\x3dinput]:focus-visible::-moz-range-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}:host([data-disabled]) [part\x3dinput]{opacity:var(--x-slider-disabled-opacity);cursor:default;pointer-events:none;}:host([data-readonly]) [part\x3dinput]{pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]::-webkit-slider-thumb{transition:none;}[part\x3dinput]::-moz-range-thumb{transition:none;}}@media (pointer:coarse){[part\x3dbase]{--_x-slider-thumb-sz:28px;}}";
|
|
13
|
+
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");l.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(l);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:l,input:m};$APP.n(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}UI(this);c=$APP.k(this,"__xSliderRefs");$APP.n(c)&&(c=$APP.k(c,
|
|
14
|
+
"input"),d=QI(this),e=RI(this),g=TI(this),h={input:d,change:e,keydown:g},c.addEventListener("input",d),c.addEventListener("change",e),c.addEventListener("keydown",g),this.__xSliderHandlers=h);return OI(this)};b.disconnectedCallback=function(){return UI(this)};b.attributeChangedCallback=function(){return OI(this)};b.formDisabledCallback=function(c){JI(this,"disabled",$APP.F(c));return OI(this)};b.formResetCallback=function(){II(this,"value",""+$APP.T.g(0));return OI(this)};return a},ZI=function(){return $APP.n(customElements.get("x-slider"))?
|
|
15
|
+
null:customElements.define("x-slider",YI())},MI=new $APP.K(null,"show-value?","show-value?",-1960833108),NI=new $APP.K(null,"fill-percent","fill-percent",-1813848228),KI=new $APP.K(null,"step","step",1288888124);var LI=new $APP.R(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),XI="value min max step disabled readonly name label show-value size aria-label aria-labelledby aria-describedby".split(" ");
|
|
16
|
+
$APP.zf([$APP.ek,$APP.Nj,$APP.Mh,$APP.vj,$APP.Ti,$APP.Kh,$APP.$l,$APP.Mk,$APP.U,KI],[new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"min"],null),new $APP.Q(null,2,[$APP.Z,$APP.Xj,$APP.Bk,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.Xj,$APP.Bk,"show-value"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"size"],null),new $APP.Q(null,2,[$APP.Z,$APP.Xj,$APP.Bk,"readonly"],null),new $APP.Q(null,
|
|
17
|
+
2,[$APP.Z,$APP.Y,$APP.Bk,"max"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bk,"step"],null)]);$APP.Qd(["x-slider-input",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,3,[$APP.Ti,$APP.W,$APP.ek,$APP.W,$APP.Mk,$APP.W],null)],null),"x-slider-change",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,3,[$APP.Ti,$APP.W,$APP.ek,$APP.W,$APP.Mk,$APP.W],null)],null)]);var SI=new $APP.R(null,new $APP.Q(null,8,["PageDown",null,"ArrowUp",null,"ArrowDown",null,"End",null,"ArrowRight",null,"ArrowLeft",null,"PageUp",null,"Home",null],null),null);$APP.ha("baredom.exports.x_slider.init",ZI);export const init=ZI;
|
package/dist/x-soft-body.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},
|
|
4
|
-
e.setAttribute("part","shape");g.setAttribute("part","content");d.appendChild(e);g.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xSoftBodyRefs=new $APP.
|
|
5
|
-
$APP.D(b,$APP.
|
|
2
|
+
var kI=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.C.i(a,""))return b;a=parseFloat(a);return $APP.n(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},lI=function(a,b,c,d,e,g){b=c+(e*(b-a)-g*c)*d;return[a+b*d,b]},mI=function(a,b,c,d,e,g,h){a=c-a;b=d-b;d=Math.sqrt(a*a+b*b);if(d<=.001||d>=e)return[0,0];e=1-d/e;g*=e*e*($APP.n(h)?50:20);return[a/d*g,b/d*g]},nI=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},oI=function(a,b){for(var c=0;;){if(c>=20)return!0;
|
|
3
|
+
if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},qI=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),e=document.createElementNS("http://www.w3.org/2000/svg","path"),g=document.createElement("div"),h=document.createElement("slot");c.textContent=pI;d.setAttribute("part","svg");d.setAttribute("viewBox","0 0 300 200");d.setAttribute("preserveAspectRatio","none");d.setAttribute("aria-hidden","true");
|
|
4
|
+
e.setAttribute("part","shape");g.setAttribute("part","content");d.appendChild(e);g.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xSoftBodyRefs=new $APP.Q(null,4,[$APP.Ci,b,$APP.gk,d,$APP.Ok,e,$APP.vi,g],null)},tI=function(a){a=new $APP.Q(null,6,[$APP.Xl,a.getAttribute("stiffness"),$APP.Jm,a.getAttribute("damping"),$APP.Dj,a.getAttribute("radius"),$APP.zk,a.getAttribute("intensity"),rI,a.getAttribute("grab-radius"),$APP.$i,a.getAttribute("disabled")],null);var b=$APP.M(a);a=
|
|
5
|
+
$APP.D(b,$APP.Xl);var c=$APP.D(b,$APP.Jm),d=$APP.D(b,$APP.Dj),e=$APP.D(b,$APP.zk),g=$APP.D(b,rI);b=$APP.D(b,$APP.$i);return new $APP.Q(null,6,[$APP.Fl,kI(a,180,10,1E3),$APP.Ik,kI(c,12,1,100),$APP.Em,kI(d,16,6,200),$APP.qk,kI(e,1,0,5),sI,kI(g,80,10,500),$APP.X,b!=null],null)},uI=function(a,b,c){var d=$APP.Em.g($APP.k(a,"__xSoftBodyModel"));d=Math.max(6,Math.min(d,Math.min(b,c)/2));var e=Math.cos(Math.PI/6),g=Math.sin(Math.PI/6),h=Math.cos(Math.PI/3),l=Math.sin(Math.PI/3),m=new Float64Array(20),p=new Float64Array(20);
|
|
6
6
|
m[0]=d;p[0]=0;m[1]=b*.5;p[1]=0;m[2]=b-d;p[2]=0;m[3]=b-d+d*g;p[3]=d-d*e;m[4]=b-d+d*l;p[4]=d-d*h;m[5]=b;p[5]=d;m[6]=b;p[6]=c*.5;m[7]=b;p[7]=c-d;m[8]=b-d+d*e;p[8]=c-d+d*g;m[9]=b-d+d*h;p[9]=c-d+d*l;m[10]=b-d;p[10]=c;m[11]=b*.5;p[11]=c;m[12]=d;p[12]=c;m[13]=d-d*g;p[13]=c-d+d*e;m[14]=d-d*l;p[14]=c-d+d*h;m[15]=0;p[15]=c-d;m[16]=0;p[16]=c*.5;m[17]=0;p[17]=d;m[18]=d-d*e;p[18]=d-d*g;m[19]=d-d*h;p[19]=d-d*l;c=[m,p];b=c[0];c=c[1];d=new Float64Array(20);e=new Float64Array(20);g=new Float64Array(20);h=new Float64Array(20);
|
|
7
|
-
for(l=0;;)if(l<20)d[l]=b[l],e[l]=c[l],g[l]=0,h[l]=0,l+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=g;a.__xSoftBodyVY=h},
|
|
8
|
-
a[g])/6;g=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var v=c[l]-c[h],x=a[l]-a[h];x=Math.sqrt(v*v+x*x)*.4;v=Math.sqrt(p*p+q*q);v=v>x?x/(v+.001):1;q=a[h]+q*v;var y=Math.sqrt(g*g+m*m);x=y>x?x/(y+.001):1;g=c[l]-g*x;m=a[l]-m*x;d.push("C"+$APP.T.g((c[h]+p*v).toFixed(2))+","+$APP.T.g(q.toFixed(2))+" "+$APP.T.g(g.toFixed(2))+","+$APP.T.g(m.toFixed(2))+" "+$APP.T.g(c[l].toFixed(2))+","+$APP.T.g(a[l].toFixed(2)));e+=1}else break;d.push("Z");b.setAttribute("d",d.join(""))},
|
|
9
|
-
b=$APP.D(b,$APP.
|
|
10
|
-
" "+$APP.T.g((c-a+e).toFixed(2))+","+$APP.T.g(d.toFixed(2))+" "+$APP.T.g((c-a).toFixed(2))+","+$APP.T.g(d.toFixed(2))+"L"+$APP.T.g(a.toFixed(2))+","+$APP.T.g(d.toFixed(2))+"C"+$APP.T.g((a-e).toFixed(2))+","+$APP.T.g(d.toFixed(2))+" 0,"+$APP.T.g((d-a+e).toFixed(2))+" 0,"+$APP.T.g((d-a).toFixed(2))+"L0,"+$APP.T.g(a.toFixed(2))+"C0,"+$APP.T.g((a-e).toFixed(2))+" "+$APP.T.g((a-e).toFixed(2))+",0 "+$APP.T.g(a.toFixed(2))+",0Z";b.setAttribute("d",c)},
|
|
11
|
-
"__xSoftBodyLF",performance.now()),$APP.
|
|
12
|
-
{bubbles:!0,composed:!0,detail:{}}));return null}function c(h){a.__xSoftBodyGrab=!0;
|
|
13
|
-
g,{passive:!0});a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("pointerdown",c);a.addEventListener("pointerup",b)},
|
|
14
|
-
null)},
|
|
15
|
-
configurable:!0});Object.defineProperty(a,"radius",{get:function(){var b=this.getAttribute("radius");return
|
|
16
|
-
Object.defineProperty(a,"grabRadius",{get:function(){var b=this.getAttribute("grab-radius");return
|
|
17
|
-
class extends HTMLElement{};a.observedAttributes=
|
|
18
|
-
|
|
19
|
-
d=$APP.k(this,"__xSoftBodyH"),$APP.n($APP.n(c)?$APP.n(d)?c>0&&d>0:d:c)&&(
|
|
7
|
+
for(l=0;;)if(l<20)d[l]=b[l],e[l]=c[l],g[l]=0,h[l]=0,l+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=g;a.__xSoftBodyVY=h},vI=function(a){var b=$APP.M($APP.k(a,"__xSoftBodyRefs"));b=$APP.D(b,$APP.Ok);var c=$APP.k(a,"__xSoftBodyCX");a=$APP.k(a,"__xSoftBodyCY");var d=[];d.push("M"+$APP.T.g(c[0].toFixed(2))+","+$APP.T.g(a[0].toFixed(2)));for(var e=0;;)if(e<20){var g=$APP.fd(e+19,20),h=e,l=$APP.fd(e+1,20),m=$APP.fd(e+2,20),p=(c[l]-c[g])/6,q=(a[l]-
|
|
8
|
+
a[g])/6;g=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var v=c[l]-c[h],x=a[l]-a[h];x=Math.sqrt(v*v+x*x)*.4;v=Math.sqrt(p*p+q*q);v=v>x?x/(v+.001):1;q=a[h]+q*v;var y=Math.sqrt(g*g+m*m);x=y>x?x/(y+.001):1;g=c[l]-g*x;m=a[l]-m*x;d.push("C"+$APP.T.g((c[h]+p*v).toFixed(2))+","+$APP.T.g(q.toFixed(2))+" "+$APP.T.g(g.toFixed(2))+","+$APP.T.g(m.toFixed(2))+" "+$APP.T.g(c[l].toFixed(2))+","+$APP.T.g(a[l].toFixed(2)));e+=1}else break;d.push("Z");b.setAttribute("d",d.join(""))},wI=function(a){var b=$APP.M($APP.k(a,"__xSoftBodyRefs"));
|
|
9
|
+
b=$APP.D(b,$APP.Ok);var c=$APP.k(a,"__xSoftBodyW"),d=$APP.k(a,"__xSoftBodyH");a=$APP.Em.g($APP.k(a,"__xSoftBodyModel"));a=Math.max(6,Math.min(a,Math.min(c,d)/2));var e=.5522847498*a;c="M"+$APP.T.g(a.toFixed(2))+",0L"+$APP.T.g((c-a).toFixed(2))+",0C"+$APP.T.g((c-a+e).toFixed(2))+",0 "+$APP.T.g(c.toFixed(2))+","+$APP.T.g((a-e).toFixed(2))+" "+$APP.T.g(c.toFixed(2))+","+$APP.T.g(a.toFixed(2))+"L"+$APP.T.g(c.toFixed(2))+","+$APP.T.g((d-a).toFixed(2))+"C"+$APP.T.g(c.toFixed(2))+","+$APP.T.g((d-a+e).toFixed(2))+
|
|
10
|
+
" "+$APP.T.g((c-a+e).toFixed(2))+","+$APP.T.g(d.toFixed(2))+" "+$APP.T.g((c-a).toFixed(2))+","+$APP.T.g(d.toFixed(2))+"L"+$APP.T.g(a.toFixed(2))+","+$APP.T.g(d.toFixed(2))+"C"+$APP.T.g((a-e).toFixed(2))+","+$APP.T.g(d.toFixed(2))+" 0,"+$APP.T.g((d-a+e).toFixed(2))+" 0,"+$APP.T.g((d-a).toFixed(2))+"L0,"+$APP.T.g(a.toFixed(2))+"C0,"+$APP.T.g((a-e).toFixed(2))+" "+$APP.T.g((a-e).toFixed(2))+",0 "+$APP.T.g(a.toFixed(2))+",0Z";b.setAttribute("d",c)},yI=function(a){$APP.n($APP.k(a,"__xSoftBodyRaf"))||($APP.ja(a,
|
|
11
|
+
"__xSoftBodyLF",performance.now()),$APP.ja(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return xI(a)})))},zI=function(a){var b=$APP.k(a,"__xSoftBodyRaf");$APP.n(b)&&(cancelAnimationFrame(b),a.__xSoftBodyRaf=null)},AI=function(a,b){var c=$APP.M($APP.k(a,"__xSoftBodyRefs"));c=$APP.D(c,$APP.gk).getBoundingClientRect();a.__xSoftBodyPX=b.clientX-c.left;a.__xSoftBodyPY=b.clientY-c.top;return null},BI=function(a){function b(){a.__xSoftBodyGrab=!1;a.dispatchEvent(new CustomEvent("x-soft-body-release",
|
|
12
|
+
{bubbles:!0,composed:!0,detail:{}}));return null}function c(h){a.__xSoftBodyGrab=!0;AI(a,h);a.dispatchEvent(new CustomEvent("x-soft-body-grab",{bubbles:!0,composed:!0,detail:{}}));return null}function d(){a.__xSoftBodyPA=!1;a.__xSoftBodyGrab=!1;return null}function e(){a.__xSoftBodyPA=!0;var h=$APP.X.g($APP.k(a,"__xSoftBodyModel"));h=$APP.n(h)?h:nI();$APP.n(h)||yI(a);return null}function g(h){return AI(a,h)}$APP.ja(a,"__xSoftBodyHdl",{move:g,enter:e,leave:d,down:c,up:b});a.addEventListener("pointermove",
|
|
13
|
+
g,{passive:!0});a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("pointerdown",c);a.addEventListener("pointerup",b)},CI=function(a){var b=$APP.k(a,"__xSoftBodyHdl");$APP.n(b)&&(a.removeEventListener("pointermove",$APP.k(b,"move")),a.removeEventListener("pointerenter",$APP.k(b,"enter")),a.removeEventListener("pointerleave",$APP.k(b,"leave")),a.removeEventListener("pointerdown",$APP.k(b,"down")),a.removeEventListener("pointerup",$APP.k(b,"up")),a.__xSoftBodyHdl=
|
|
14
|
+
null)},DI=function(a){Object.defineProperty(a,"stiffness",{get:function(){var b=this.getAttribute("stiffness");return kI(b,180,10,1E3)},set:function(b){return b==null?this.removeAttribute("stiffness"):this.setAttribute("stiffness",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"damping",{get:function(){var b=this.getAttribute("damping");return kI(b,12,1,100)},set:function(b){return b==null?this.removeAttribute("damping"):this.setAttribute("damping",""+$APP.T.g(b))},enumerable:!0,
|
|
15
|
+
configurable:!0});Object.defineProperty(a,"radius",{get:function(){var b=this.getAttribute("radius");return kI(b,16,6,200)},set:function(b){return b==null?this.removeAttribute("radius"):this.setAttribute("radius",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"intensity",{get:function(){var b=this.getAttribute("intensity");return kI(b,1,0,5)},set:function(b){return b==null?this.removeAttribute("intensity"):this.setAttribute("intensity",""+$APP.T.g(b))},enumerable:!0,configurable:!0});
|
|
16
|
+
Object.defineProperty(a,"grabRadius",{get:function(){var b=this.getAttribute("grab-radius");return kI(b,80,10,500)},set:function(b){return b==null?this.removeAttribute("grab-radius"):this.setAttribute("grab-radius",""+$APP.T.g(b))},enumerable:!0,configurable:!0});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})},FI=function(){var a=
|
|
17
|
+
class extends HTMLElement{};a.observedAttributes=EI;a.prototype.connectedCallback=function(){var b=this,c=tI(b);b.__xSoftBodyModel=c;$APP.n($APP.k(b,"__xSoftBodyRefs"))||qI(b);b.__xSoftBodyPA=!1;b.__xSoftBodyGrab=!1;b.__xSoftBodyPX=0;b.__xSoftBodyPY=0;c=new ResizeObserver(function(d){if(d.length>0){var e=d[0].contentRect;d=e.width;e=e.height;if(d>0&&e>0){b.__xSoftBodyW=d;b.__xSoftBodyH=e;var g=$APP.M($APP.k(b,"__xSoftBodyRefs"));$APP.D(g,$APP.gk).setAttribute("viewBox","0 0 "+$APP.T.g(d)+" "+$APP.T.g(e));
|
|
18
|
+
uI(b,d,e);d=$APP.X.g($APP.k(b,"__xSoftBodyModel"));d=$APP.n(d)?d:nI();$APP.n(d)?wI(b):(vI(b),yI(b))}}return null});b.__xSoftBodyRO=c;c.observe(b);CI(b);BI(b);return null};a.prototype.disconnectedCallback=function(){zI(this);CI(this);var b=$APP.k(this,"__xSoftBodyRO");$APP.n(b)&&(b.disconnect(),this.__xSoftBodyRO=null);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&$APP.n($APP.k(this,"__xSoftBodyRefs"))&&(this.__xSoftBodyModel=b=tI(this),c=$APP.k(this,"__xSoftBodyW"),
|
|
19
|
+
d=$APP.k(this,"__xSoftBodyH"),$APP.n($APP.n(c)?$APP.n(d)?c>0&&d>0:d:c)&&(uI(this,c,d),b=$APP.X.g(b),b=$APP.n(b)?b:nI(),$APP.n(b)?(zI(this),wI(this)):(vI(this),yI(this))));return null};DI(a.prototype);return a},GI=function(){$APP.n(customElements.get("x-soft-body"))||customElements.define("x-soft-body",FI());return null},sI=new $APP.K(null,"grab-radius","grab-radius",771838535),rI=new $APP.K(null,"grab-radius-raw","grab-radius-raw",-1019405976);var EI="stiffness damping radius intensity grab-radius disabled".split(" ");$APP.Qd(["x-soft-body-grab",new $APP.Q(null,2,[$APP.V,$APP.Rd,$APP.Yl,!1],null),"x-soft-body-release",new $APP.Q(null,2,[$APP.V,$APP.Rd,$APP.Yl,!1],null)]);var pI=":host{display:block;position:relative;background:none;overflow:visible;"+$APP.T.g("--x-soft-body-bg")+":var(--x-color-surface,#ffffff);"+$APP.T.g("--x-soft-body-border")+":var(--x-color-border,#e2e8f0);"+$APP.T.g("--x-soft-body-border-width")+":1.5;"+$APP.T.g("--x-soft-body-shadow")+":var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.1));"+$APP.T.g("--x-soft-body-padding")+":1rem;}[part\x3dsvg]{display:block;width:100%;height:100%;position:absolute;inset:0;overflow:visible;pointer-events:none;}[part\x3dshape]{fill:var("+
|
|
20
20
|
$APP.T.g("--x-soft-body-bg")+",#ffffff);stroke:var("+$APP.T.g("--x-soft-body-border")+",#e2e8f0);stroke-width:var("+$APP.T.g("--x-soft-body-border-width")+",1.5);filter:drop-shadow(var("+$APP.T.g("--x-soft-body-shadow")+",0 1px 3px rgba(0,0,0,0.1)));}[part\x3dcontent]{position:relative;background:none;padding:var("+$APP.T.g("--x-soft-body-padding")+",1rem);z-index:1;}@media(prefers-color-scheme:dark){:host{"+$APP.T.g("--x-soft-body-bg")+":var(--x-color-surface,#1e293b);"+$APP.T.g("--x-soft-body-border")+
|
|
21
|
-
":var(--x-color-border,#475569);"+$APP.T.g("--x-soft-body-shadow")+":var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.3));}}@media(prefers-reduced-motion:reduce){[part\x3dshape]{transition:none!important;}}",
|
|
22
|
-
"__xSoftBodyCY"),x=$APP.k(a,"__xSoftBodyVX"),y=$APP.k(a,"__xSoftBodyVY"),A=$APP.k(a,"__xSoftBodyPA"),B=$APP.k(a,"__xSoftBodyPX"),E=$APP.k(a,"__xSoftBodyPY"),
|
|
23
|
-
|
|
21
|
+
":var(--x-color-border,#475569);"+$APP.T.g("--x-soft-body-shadow")+":var(--x-shadow-sm,0 1px 3px rgba(0,0,0,0.3));}}@media(prefers-reduced-motion:reduce){[part\x3dshape]{transition:none!important;}}",xI=function xI(a){if($APP.n(a.isConnected)){var c=$APP.k(a,"__xSoftBodyModel"),d=performance.now(),e=Math.min(d-$APP.k(a,"__xSoftBodyLF"),100)/1E3,g=$APP.Fl.g(c),h=$APP.Ik.g(c),l=$APP.qk.g(c),m=sI.g(c);c=$APP.k(a,"__xSoftBodyRX");var p=$APP.k(a,"__xSoftBodyRY"),q=$APP.k(a,"__xSoftBodyCX"),v=$APP.k(a,
|
|
22
|
+
"__xSoftBodyCY"),x=$APP.k(a,"__xSoftBodyVX"),y=$APP.k(a,"__xSoftBodyVY"),A=$APP.k(a,"__xSoftBodyPA"),B=$APP.k(a,"__xSoftBodyPX"),E=$APP.k(a,"__xSoftBodyPY"),G=$APP.k(a,"__xSoftBodyGrab");a.__xSoftBodyLF=d;for(d=0;;)if(d<20){var H=c[d],J=p[d],S=$APP.n(A)?mI(H,J,B,E,m,l,G):[0,0];H=lI(q[d],H+S[0],x[d],e,g,h);J=lI(v[d],J+S[1],y[d],e,g,h);q[d]=H[0];x[d]=H[1];v[d]=J[0];y[d]=J[1];d+=1}else break;vI(a);if($APP.n($APP.n(A)?A:!oI(x,y)))$APP.ja(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return xI.g?
|
|
23
|
+
xI.g(a):xI.call(null,a)}));else{for(e=0;;)if(e<20)q[e]=c[e],v[e]=p[e],e+=1;else break;vI(a);a.__xSoftBodyRaf=null}}return null};$APP.ha("baredom.exports.x_soft_body.init",GI);export const init=GI;
|
package/dist/x-spacer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d=$APP.D(c,
|
|
4
|
-
"grow",{get:function(){return
|
|
5
|
-
b.appendChild(c);this.__xSpacerRefs={root:b}}
|
|
6
|
-
"grow-raw",441172903),
|
|
2
|
+
var SL=function(a){return a!=null&&$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},YL=function(a){var b=new $APP.Q(null,3,[$APP.Il,a.getAttribute("size"),TL,a.getAttribute("axis"),UL,a.getAttribute("grow")],null);b=$APP.M(b);var c=$APP.D(b,$APP.Il),d=$APP.D(b,TL);b=$APP.D(b,UL);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.I(VL,d)?d:"vertical";b=new $APP.Q(null,3,[$APP.Kh,c,WL,d,XL,SL(b)],null);c=$APP.M(b);b=$APP.D(c,$APP.Kh);
|
|
3
|
+
d=$APP.D(c,WL);c=$APP.D(c,XL);var e=a.style;a.setAttribute("data-axis",d);a.setAttribute("data-grow",$APP.n(c)?"true":"false");e.setProperty("--x-spacer-size",b);a.setAttribute("role","none");a.setAttribute("aria-hidden","true")},ZL=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 d!=null?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},$L=function(a){Object.defineProperty(a,
|
|
4
|
+
"grow",{get:function(){return SL(this.getAttribute("grow"))},set:function(b){return $APP.n(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},aM=function(a){ZL(a,"size","1rem");ZL(a,"axis","vertical");$L(a)},cM=function(){var a=class extends HTMLElement{};a.observedAttributes=bM;a.prototype.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSpacerRefs"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=":host{display:block;flex-shrink:0;height:var(--x-spacer-size,1rem);width:0;pointer-events:none;}:host([data-axis\x3d'horizontal']){height:0;width:var(--x-spacer-size,1rem);}:host([data-grow\x3d'true']){flex:1 0 var(--x-spacer-size,0px);height:0;width:0;}";
|
|
5
|
+
b.appendChild(c);this.__xSpacerRefs={root:b}}YL(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.N(c,d);$APP.n(b?$APP.k(this,"__xSpacerRefs"):b)&&YL(this);return null};aM(a.prototype);return a},dM=function(){$APP.n(customElements.get("x-spacer"))||customElements.define("x-spacer",cM());return null},WL=new $APP.K(null,"axis","axis",-1215390822),XL=new $APP.K(null,"grow?","grow?",2124334580),UL=new $APP.K(null,"grow-raw",
|
|
6
|
+
"grow-raw",441172903),TL=new $APP.K(null,"axis-raw","axis-raw",291213231);var bM=["size","axis","grow"],VL=new $APP.R(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null);$APP.ha("baredom.exports.x_spacer.init",dM);export const init=dM;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},
|
|
4
|
-
$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Loading"},set:function(b){return $APP.n(b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},
|
|
2
|
+
var m1=function(a){var b=new $APP.Q(null,3,[$APP.Kh,a.getAttribute("size"),$APP.Tg,a.getAttribute("variant"),$APP.U,a.getAttribute("label")],null);var c=$APP.M(b),d=$APP.D(c,$APP.Kh);b=$APP.D(c,$APP.Tg);c=$APP.D(c,$APP.U);d=typeof d==="string"&&$APP.I(k1,d)?d:"md";b=typeof b==="string"&&$APP.I(l1,b)?b:"default";c=typeof c==="string"&&$APP.N("",c.trim())?c.trim():"Loading";d=$APP.M(new $APP.Q(null,3,[$APP.Kh,d,$APP.Tg,b,$APP.U,c],null));b=$APP.D(d,$APP.Kh);c=$APP.D(d,$APP.Tg);d=$APP.D(d,$APP.U);a.setAttribute("data-size",
|
|
3
|
+
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},n1=function(a){Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.n(b)?b:"md"},set:function(b){return $APP.n(b)?this.setAttribute("size",""+$APP.T.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"default"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+
|
|
4
|
+
$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Loading"},set:function(b){return $APP.n(b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},p1=function(){var a=class extends HTMLElement{};a.observedAttributes=o1;a.prototype.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSpinnerInit"))){var b=this.attachShadow({mode:"open"}),
|
|
5
5
|
c=document.createElement("style"),d=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;justify-content:center;color-scheme:light dark;--x-spinner-size:24px;--x-spinner-color:currentColor;--x-spinner-track-color:rgba(0,0,0,0.12);--x-spinner-thickness:2px;--x-spinner-duration:0.75s;}@media (prefers-color-scheme:dark){:host{--x-spinner-track-color:rgba(255,255,255,0.15);}}:host([data-size\x3d'xs']){--x-spinner-size:16px;}:host([data-size\x3d'sm']){--x-spinner-size:20px;}:host([data-size\x3d'md']){--x-spinner-size:24px;}:host([data-size\x3d'lg']){--x-spinner-size:32px;}:host([data-size\x3d'xl']){--x-spinner-size:48px;}:host([data-variant\x3d'primary']){--x-spinner-color:var(--x-color-primary,#3b82f6);}:host([data-variant\x3d'success']){--x-spinner-color:var(--x-color-success,#22c55e);}:host([data-variant\x3d'warning']){--x-spinner-color:var(--x-color-warning,#f59e0b);}:host([data-variant\x3d'danger']){--x-spinner-color:var(--x-color-danger,#ef4444);}[part\x3dring]{display:block;width:var(--x-spinner-size);height:var(--x-spinner-size);border-radius:50%;border:var(--x-spinner-thickness) solid var(--x-spinner-track-color);border-top-color:var(--x-spinner-color);box-sizing:border-box;animation:x-spinner-spin var(--x-spinner-duration) linear infinite;}@keyframes x-spinner-spin{to{transform:rotate(360deg);}}@media (prefers-reduced-motion:reduce){[part\x3dring]{animation-play-state:paused;}}";
|
|
6
|
-
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}
|
|
7
|
-
customElements.define("x-spinner",
|
|
6
|
+
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}m1(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.N(c,d);$APP.n(b?$APP.k(this,"__xSpinnerInit"):b)&&m1(this);return null};n1(a.prototype);return a},q1=function(){$APP.n(customElements.get("x-spinner"))||
|
|
7
|
+
customElements.define("x-spinner",p1());return null};var o1=["size","variant","label"],k1=new $APP.R(null,new $APP.Q(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),l1=new $APP.R(null,new $APP.Q(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null);$APP.ha("baredom.exports.x_spinner.init",q1);export const init=q1;
|
package/dist/x-splash.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var kO=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?null:$APP.qh.i(0,$APP.rh.i(100,a))):null},lO=function(a){return a==null?!0:$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},qO=function(a){var b=$APP.k(a,"__xSplashRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot"),h=document.createElement("span"),l=document.createElement("div"),
|
|
3
3
|
m=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-splash-bg:var(--x-color-bg, #ffffff);--x-splash-color:var(--x-color-text, #0f172a);--x-splash-z-index:9999;--x-splash-fade-duration:var(--x-transition-duration, 400ms);--x-splash-fade-ease:cubic-bezier(0.4,0,0.2,1);--x-splash-spinner-size:40px;--x-splash-spinner-color:var(--x-color-text, currentColor);--x-splash-spinner-track-color:var(--x-color-border, rgba(0,0,0,0.12));--x-splash-spinner-thickness:3px;--x-splash-spinner-duration:0.75s;--x-splash-progress-height:4px;--x-splash-progress-color:var(--x-color-primary, #3b82f6);--x-splash-progress-track-color:var(--x-color-border, rgba(0,0,0,0.08));--x-splash-progress-radius:var(--x-radius-sm, 2px);--x-splash-gap:20px;--x-splash-blur-amount:8px;}@media (prefers-color-scheme:dark){:host{--x-splash-bg:var(--x-color-bg, #0f172a);--x-splash-color:var(--x-color-text, #f8fafc);--x-splash-spinner-track-color:var(--x-color-border, rgba(255,255,255,0.15));--x-splash-progress-track-color:var(--x-color-border, rgba(255,255,255,0.12));}}[part\x3doverlay]{position:fixed;inset:0;z-index:var(--x-splash-z-index);display:none;align-items:center;justify-content:center;background:var(--x-splash-bg);color:var(--x-splash-color);opacity:0;transition:opacity var(--x-splash-fade-duration) var(--x-splash-fade-ease);}:host([active]) [part\x3doverlay]{display:flex;opacity:1;}:host([data-fading-out]) [part\x3doverlay]{display:flex;opacity:0;}:host([data-variant\x3d'minimal']) [part\x3doverlay]{background:transparent;}:host([data-variant\x3d'branded']) [part\x3doverlay]{background:var(--x-splash-branded-bg,var(--x-splash-bg));}:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(255,255,255,0.7);backdrop-filter:blur(var(--x-splash-blur-amount));-webkit-backdrop-filter:blur(var(--x-splash-blur-amount));}@media (prefers-color-scheme:dark){:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(15,23,42,0.7);}}:host([data-overlay\x3d'transparent']) [part\x3doverlay]{background:transparent;}[part\x3dcontent]{display:flex;flex-direction:column;align-items:center;gap:var(--x-splash-gap);max-width:80vw;text-align:center;}[part\x3dspinner]{display:block;width:var(--x-splash-spinner-size);height:var(--x-splash-spinner-size);border:var(--x-splash-spinner-thickness) solid var(--x-splash-spinner-track-color);border-top-color:var(--x-splash-spinner-color);border-radius:50%;animation:x-splash-spin var(--x-splash-spinner-duration) linear infinite;box-sizing:border-box;}@keyframes x-splash-spin{to{transform:rotate(360deg);}}[part\x3dprogress]{display:none;width:min(300px,60vw);height:var(--x-splash-progress-height);background:var(--x-splash-progress-track-color);border-radius:var(--x-splash-progress-radius);overflow:hidden;}[part\x3dbar]{height:100%;background:var(--x-splash-progress-color);border-radius:var(--x-splash-progress-radius);transition:width 200ms ease;width:0%;}@media (prefers-reduced-motion:reduce){[part\x3doverlay]{transition:none !important;}[part\x3dspinner]{animation:none !important;}[part\x3dbar]{transition:none !important;}}";
|
|
4
|
-
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");l.setAttribute("part","progress");l.setAttribute("role","progressbar");l.setAttribute("aria-valuemin","0");l.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");l.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(l);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.
|
|
5
|
-
m],null);return $APP.k(a,"__xSplashRefs")},
|
|
6
|
-
400},
|
|
7
|
-
else{var b=
|
|
8
|
-
"__xSplashFadeTimer",setTimeout(function(){return $APP.n($APP.k(a,"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),
|
|
9
|
-
null;d=$APP.
|
|
10
|
-
l);p.style.display=$APP.n(h)?"block":"none";d!=null?(q.style.display="block",v.style.width=""+$APP.T.g(d)+"%",q.setAttribute("aria-valuenow",""+$APP.T.g(d))):(q.style.display="none",q.removeAttribute("aria-valuenow"));$APP.n($APP.n(c)?$APP.r(x):c)?($APP.n($APP.k(a,"__xSplashFadingOut"))&&(
|
|
11
|
-
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.r(c),$APP.n(e?x:e)?
|
|
12
|
-
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"default"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"progress",{get:function(){return
|
|
13
|
-
"spinner",{get:function(){return
|
|
14
|
-
a.observedAttributes=
|
|
15
|
-
|
|
4
|
+
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");l.setAttribute("part","progress");l.setAttribute("role","progressbar");l.setAttribute("aria-valuemin","0");l.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");l.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(l);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.Q(null,6,[$APP.Ci,b,mO,d,nO,e,oO,h,$APP.ej,l,pO,
|
|
5
|
+
m],null);return $APP.k(a,"__xSplashRefs")},rO=function(a){a=typeof a==="string"?a.trim():"";return $APP.C.i(a,"")||$APP.C.i(a,"0")||$APP.C.i(a,"0ms")||$APP.C.i(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},sO=function(a){a=window.getComputedStyle(a);a=rO(a.getPropertyValue("--x-splash-fade-duration"));return a>0?a:
|
|
6
|
+
400},tO=function(a){var b=$APP.k(a,"__xSplashFadeTimer");$APP.n(b)&&(clearTimeout(b),a.__xSplashFadeTimer=null)},uO=function(a){tO(a);a.__xSplashFadingOut=!1;a.removeAttribute("data-fading-out");var b=qO(a);b=$APP.M(b);$APP.D(b,mO).style.display="none";a.removeAttribute("aria-busy");b=new CustomEvent("x-splash-hidden",{detail:{},bubbles:!0,composed:!0,cancelable:!1});a.dispatchEvent(b);return null},vO=function(a){if(!$APP.n($APP.k(a,"__xSplashFadingOut")))if(a.__xSplashFadingOut=!0,$APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches))uO(a);
|
|
7
|
+
else{var b=qO(a);b=$APP.M(b);var c=$APP.D(b,mO),d=function h(g){return $APP.C.i(g.target,c)&&$APP.C.i(g.propertyName,"opacity")?(c.removeEventListener("transitionend",h),$APP.n($APP.k(a,"__xSplashFadingOut"))?uO(a):null):null};c.style.display="flex";c.style.opacity="1";a.setAttribute("data-fading-out","");c.addEventListener("transitionend",d);requestAnimationFrame(function(){return requestAnimationFrame(function(){return $APP.n($APP.k(a,"__xSplashFadingOut"))?c.style.opacity="0":null})});$APP.ja(a,
|
|
8
|
+
"__xSplashFadeTimer",setTimeout(function(){return $APP.n($APP.k(a,"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),uO(a)):null},sO(a)+60))}},EO=function(a){var b=new $APP.Q(null,5,[wO,a.hasAttribute("active"),$APP.hl,a.getAttribute("variant"),$APP.ak,a.getAttribute("progress"),xO,a.getAttribute("spinner"),yO,a.getAttribute("overlay")],null);var c=$APP.M(b);b=$APP.D(c,wO);var d=$APP.D(c,$APP.hl),e=$APP.D(c,$APP.ak),g=$APP.D(c,xO);c=$APP.D(c,yO);b=$APP.F(b);d=typeof d==="string"?d.trim().toLowerCase():
|
|
9
|
+
null;d=$APP.I(zO,d)?d:"default";e=kO(e);g=lO(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.I(AO,c)?c:"solid";b=new $APP.Q(null,5,[BO,b,$APP.Tg,d,$APP.Pl,e,CO,g,DO,c],null);if($APP.N($APP.k(a,"__xSplashModel"),b)){b=$APP.M(b);c=$APP.D(b,BO);e=$APP.D(b,$APP.Tg);d=$APP.D(b,$APP.Pl);var h=$APP.D(b,CO),l=$APP.D(b,DO);g=qO(a);var m=$APP.M(g);g=$APP.D(m,mO);var p=$APP.D(m,oO),q=$APP.D(m,$APP.ej),v=$APP.D(m,pO);m=$APP.k(a,"__xSplashModel");var x=BO.g(m);a.setAttribute("data-variant",e);a.setAttribute("data-overlay",
|
|
10
|
+
l);p.style.display=$APP.n(h)?"block":"none";d!=null?(q.style.display="block",v.style.width=""+$APP.T.g(d)+"%",q.setAttribute("aria-valuenow",""+$APP.T.g(d))):(q.style.display="none",q.removeAttribute("aria-valuenow"));$APP.n($APP.n(c)?$APP.r(x):c)?($APP.n($APP.k(a,"__xSplashFadingOut"))&&(tO(a),a.__xSplashFadingOut=!1,a.removeAttribute("data-fading-out"),c=qO(a),c=$APP.M(c),c=$APP.D(c,mO),c.style.display="",c.style.opacity=""),a.setAttribute("aria-busy","true"),a.setAttribute("aria-live","polite"),
|
|
11
|
+
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.r(c),$APP.n(e?x:e)?vO(a):$APP.r(c)&&m==null&&(g.style.display="none",a.removeAttribute("aria-busy")));$APP.n(a.hasAttribute("aria-label"))||a.setAttribute("aria-label","Loading");a.__xSplashModel=b}},FO=function(a){Object.defineProperty(a,"active",{get:function(){return this.hasAttribute("active")},set:function(b){return $APP.n(b)?this.setAttribute("active",""):this.removeAttribute("active")},enumerable:!0,configurable:!0});
|
|
12
|
+
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"default"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"progress",{get:function(){return kO(this.getAttribute("progress"))},set:function(b){return b==null?this.removeAttribute("progress"):this.setAttribute("progress",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
13
|
+
"spinner",{get:function(){return lO(this.getAttribute("spinner"))},set:function(b){return $APP.n(b)?this.setAttribute("spinner",""):this.setAttribute("spinner","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"overlay",{get:function(){var b=this.getAttribute("overlay");return $APP.n(b)?b:"solid"},set:function(b){return $APP.n(b)?this.setAttribute("overlay",""+$APP.T.g(b)):this.removeAttribute("overlay")},enumerable:!0,configurable:!0})},HO=function(){var a=class extends HTMLElement{};
|
|
14
|
+
a.observedAttributes=GO;a.prototype.connectedCallback=function(){qO(this);tO(this);EO(this);return null};a.prototype.disconnectedCallback=function(){tO(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&EO(this);return null};FO(a.prototype);return a},IO=function(){$APP.n(customElements.get("x-splash"))||customElements.define("x-splash",HO());return null},mO=new $APP.K(null,"overlay-el","overlay-el",-308547109),nO=new $APP.K(null,"content-el","content-el",-1423019925),
|
|
15
|
+
oO=new $APP.K(null,"spinner-el","spinner-el",-1536400516),pO=new $APP.K(null,"bar-el","bar-el",2050414242),CO=new $APP.K(null,"spinner?","spinner?",939139177),BO=new $APP.K(null,"active?","active?",459499776),wO=new $APP.K(null,"active-present?","active-present?",73064660),xO=new $APP.K(null,"spinner-attr","spinner-attr",-479327548),yO=new $APP.K(null,"overlay-raw","overlay-raw",1018775670),DO=new $APP.K(null,"overlay","overlay",-139131598);var GO=["active","variant","progress","spinner","overlay"];$APP.Qd(["x-splash-hidden",new $APP.Q(null,2,[$APP.V,$APP.Rd,$APP.Yl,!1],null)]);var zO=new $APP.R(null,new $APP.Q(null,3,["minimal",null,"branded",null,"default",null],null),null),AO=new $APP.R(null,new $APP.Q(null,3,["transparent",null,"solid",null,"blur",null],null),null);$APP.ha("baredom.exports.x_splash.init",IO);export const init=IO;
|
package/dist/x-stat.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
[d,e,g,
|
|
4
|
-
$APP.U.g(b);$APP.n(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},
|
|
5
|
-
g=$APP.k(a,"__x_stat_hint");return $APP.n(c)?(
|
|
2
|
+
var JP=function(a,b,c){return $APP.I(b,a)?a:c},KP=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:null},TP=function(a){var b=$APP.M(a),c=$APP.D(b,LP),d=$APP.D(b,MP),e=$APP.D(b,$APP.qj),g=$APP.D(b,$APP.Tg);a=$APP.D(b,$APP.Ti);var h=$APP.D(b,$APP.Ll),l=$APP.D(b,$APP.Kh),m=$APP.D(b,$APP.kl);b=$APP.D(b,$APP.U);g=JP(g,NP,"default");e=JP(e,OP,"start");l=JP(l,PP,"md");c=JP(c,QP,"normal");d=JP(d,RP,"neutral");m=$APP.F(m);return $APP.zf([MP,$APP.qj,$APP.Tg,$APP.Ti,$APP.Ll,$APP.Kh,$APP.kl,$APP.U,SP,LP],
|
|
3
|
+
[d,e,g,KP(a),KP(h),l,m,KP(b),m?"true":null,c])},UP=function(a){return $APP.zf([MP,$APP.qj,$APP.Tg,$APP.Ti,$APP.Ll,$APP.Kh,$APP.kl,$APP.U,LP],[a.getAttribute("trend"),a.getAttribute("align"),a.getAttribute("variant"),a.getAttribute("value"),a.getAttribute("hint"),a.getAttribute("size"),a.hasAttribute("loading"),a.getAttribute("label"),a.getAttribute("emphasis")])},VP=function(a,b){a.setAttribute("role","figure");var c=SP.g(b);$APP.n(c)?a.setAttribute("aria-busy",c):a.removeAttribute("aria-busy");b=
|
|
4
|
+
$APP.U.g(b);$APP.n(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},WP=function(a,b){a.setAttribute("data-variant",$APP.Tg.g(b));a.setAttribute("data-align",$APP.qj.g(b));a.setAttribute("data-size",$APP.Kh.g(b));a.setAttribute("data-emphasis",LP.g(b));a.setAttribute("data-trend",MP.g(b));$APP.n($APP.kl.g(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},XP=function(a){var b=TP(UP(a)),c=$APP.k(a,"__x_stat_base"),d=$APP.k(a,"__x_stat_label"),e=$APP.k(a,"__x_stat_value"),
|
|
5
|
+
g=$APP.k(a,"__x_stat_hint");return $APP.n(c)?(VP(a,b),WP(c,b),d.textContent=function(){var h=$APP.U.g(b);return $APP.n(h)?h:""}(),e.textContent=function(){var h=$APP.Ti.g(b);return $APP.n(h)?h:""}(),g.textContent=function(){var h=$APP.Ll.g(b);return $APP.n(h)?h:""}()):null},YP=function(a){if(!$APP.Dg(a,"__x_stat_initialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),
|
|
6
6
|
l=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("span"),v=document.createElement("span"),x=document.createElement("slot"),y=document.createElement("slot"),A=document.createElement("slot"),B=document.createElement("slot"),E=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-stat-background:transparent;--x-stat-color:var(--x-color-text,inherit);--x-stat-muted-color:var(--x-color-text-muted,rgba(0,0,0,0.55));--x-stat-border-color:var(--x-color-border,transparent);--x-stat-radius:var(--x-radius-md,12px);--x-stat-padding:16px;--x-stat-gap:6px;--x-stat-label-color:var(--x-stat-muted-color);--x-stat-label-size:12px;--x-stat-value-color:var(--x-stat-color);--x-stat-value-size:20px;--x-stat-hint-color:var(--x-stat-muted-color);--x-stat-hint-size:12px;--x-stat-icon-color:var(--x-stat-color);--x-stat-positive-color:var(--x-color-success,#16a34a);--x-stat-warning-color:var(--x-color-warning,#d97706);--x-stat-danger-color:var(--x-color-danger,#dc2626);--x-stat-transition-duration:var(--x-transition-duration,120ms);--x-stat-transition-timing:var(--x-transition-easing,ease);--x-stat-loading-opacity:0.6;}@media (prefers-color-scheme:dark){:host{--x-stat-muted-color:var(--x-color-text-muted,rgba(255,255,255,0.55));--x-stat-positive-color:var(--x-color-success,#4ade80);--x-stat-warning-color:var(--x-color-warning,#fbbf24);--x-stat-danger-color:var(--x-color-danger,#f87171);}}:host([variant\x3d'positive']){--x-stat-value-color:var(--x-stat-positive-color);}:host([variant\x3d'warning']){--x-stat-value-color:var(--x-stat-warning-color);}:host([variant\x3d'danger']){--x-stat-value-color:var(--x-stat-danger-color);}:host([variant\x3d'subtle']){--x-stat-value-color:var(--x-stat-muted-color);}[part\x3dbase]{display:grid;gap:var(--x-stat-gap);padding:var(--x-stat-padding);border-radius:var(--x-stat-radius);background:var(--x-stat-background);border:1px solid var(--x-stat-border-color);color:var(--x-stat-color);transition:background var(--x-stat-transition-duration) var(--x-stat-transition-timing),border-color var(--x-stat-transition-duration) var(--x-stat-transition-timing),color var(--x-stat-transition-duration) var(--x-stat-transition-timing),opacity var(--x-stat-transition-duration) var(--x-stat-transition-timing);}[part\x3dbase][data-align\x3d'center']{text-align:center;}[part\x3dbase][data-align\x3d'end']{text-align:end;}[part\x3dbase][data-size\x3d'sm'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 0.8);}[part\x3dbase][data-size\x3d'lg'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 1.6);}[part\x3dbase][data-emphasis\x3d'high'] [part\x3dvalue]{font-weight:800;}[part\x3dicon]{flex:0 0 auto;color:var(--x-stat-icon-color);line-height:1;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dlabel]{font-size:var(--x-stat-label-size);color:var(--x-stat-label-color);}[part\x3dvalue]{font-weight:600;font-size:var(--x-stat-value-size);color:var(--x-stat-value-color);}[part\x3dhint]{font-size:var(--x-stat-hint-size);color:var(--x-stat-hint-color);}[part\x3dbase][data-loading\x3d'true']{opacity:var(--x-stat-loading-opacity);}@media (prefers-reduced-motion:reduce){[part\x3dbase]{transition:none;}}";
|
|
7
7
|
d.setAttribute("part","base");e.setAttribute("part","icon");g.setAttribute("part","body");h.setAttribute("part","label");l.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");y.setAttribute("name","label");A.setAttribute("name","value");B.setAttribute("name","hint");e.appendChild(x);h.appendChild(y);h.appendChild(p);l.appendChild(A);l.appendChild(q);m.appendChild(B);m.appendChild(v);g.appendChild(h);g.appendChild(l);g.appendChild(m);g.appendChild(E);d.appendChild(e);
|
|
8
|
-
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=q;a.__x_stat_hint=v;a.__x_stat_initialized=!0}
|
|
9
|
-
"trend");
|
|
10
|
-
|
|
8
|
+
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=q;a.__x_stat_hint=v;a.__x_stat_initialized=!0}XP(a);return a},ZP=function(a,b){Object.defineProperty(a,b,{get:function(){var c=this.getAttribute(b);return $APP.n(c)?c:""},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},$P=function(a){ZP(a,"variant");ZP(a,"align");ZP(a,"size");ZP(a,"emphasis");ZP(a,
|
|
9
|
+
"trend");ZP(a,"label");ZP(a,"value");ZP(a,"hint");Object.defineProperty(a,"loading",{get:function(){return this.hasAttribute("loading")},set:function(b){return $APP.n(b)?this.setAttribute("loading",""):this.removeAttribute("loading")},enumerable:!0,configurable:!0})},bQ=function(){var a=class extends HTMLElement{};a.observedAttributes=aQ;a.prototype.connectedCallback=function(){return YP(this)};a.prototype.attributeChangedCallback=function(){return $APP.Dg(this,"__x_stat_initialized")?XP(this):YP(this)};
|
|
10
|
+
$P(a.prototype);return a},cQ=function(){return $APP.n(customElements.get("x-stat"))?null:customElements.define("x-stat",bQ())},LP=new $APP.K(null,"emphasis","emphasis",293543451),SP=new $APP.K(null,"aria-busy","aria-busy",793864247),MP=new $APP.K(null,"trend","trend",54563841);var aQ="variant align size emphasis trend loading label value hint".split(" "),NP=new $APP.R(null,new $APP.Q(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),OP=new $APP.R(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null),PP=new $APP.R(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),QP=new $APP.R(null,new $APP.Q(null,2,["high",null,"normal",null],null),null),RP=new $APP.R(null,new $APP.Q(null,3,["neutral",null,
|
|
11
11
|
"up",null,"down",null],null),null);
|
|
12
|
-
$APP.
|
|
13
|
-
"size",$APP.
|
|
12
|
+
$APP.zf([MP,$APP.qj,$APP.Tg,$APP.Ti,$APP.Ll,$APP.Kh,$APP.kl,$APP.U,LP],[new $APP.Q(null,4,[$APP.al,"trend",$APP.Z,$APP.Y,$APP.ji,"neutral",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"align",$APP.Z,$APP.Y,$APP.ji,"start",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"variant",$APP.Z,$APP.Y,$APP.ji,"default",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"value",$APP.Z,$APP.Y,$APP.ji,"",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"hint",$APP.Z,$APP.Y,$APP.ji,"",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,
|
|
13
|
+
"size",$APP.Z,$APP.Y,$APP.ji,"md",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"loading",$APP.Z,$APP.Xj,$APP.ji,!1,$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"label",$APP.Z,$APP.Y,$APP.ji,"",$APP.li,!0],null),new $APP.Q(null,4,[$APP.al,"emphasis",$APP.Z,$APP.Y,$APP.ji,"normal",$APP.li,!0],null)]);$APP.ha("baredom.exports.x_stat.init",cQ);export const init=cQ;
|