@vanelsas/baredom 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +6 -4
- package/dist/base.js +397 -373
- package/dist/x-alert.js +19 -19
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +16 -16
- package/dist/x-cancel-dialogue.js +17 -17
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +31 -31
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +23 -23
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +41 -41
- package/dist/x-divider.js +13 -13
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +18 -18
- package/dist/x-grid.js +6 -6
- package/dist/x-kinetic-font.js +29 -0
- package/dist/x-kinetic-typography.js +39 -61
- package/dist/x-liquid-dock.js +40 -0
- package/dist/x-liquid-fill.js +45 -0
- package/dist/x-liquid-glass.js +48 -0
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +11 -11
- package/dist/x-metaball-cursor.js +28 -27
- package/dist/x-modal.js +12 -12
- package/dist/x-morph-stack.js +41 -0
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +34 -34
- package/dist/x-notification-center.js +9 -10
- package/dist/x-organic-divider.js +19 -19
- package/dist/x-organic-progress.js +38 -38
- package/dist/x-organic-shape.js +14 -14
- 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 +10 -10
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +12 -13
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +36 -36
- package/dist/x-scroll-timeline.js +50 -50
- package/dist/x-scroll.js +41 -41
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +6 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +22 -0
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +22 -22
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +16 -16
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-timeline-item.js +24 -24
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +24 -24
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +10 -10
- package/package.json +25 -1
package/dist/x-search-field.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"input");b=$APP.l(b,"clear");var d=new $APP.
|
|
4
|
-
k:"";m=$APP.
|
|
5
|
-
$APP.l(a,"__xSearchFieldInternals");return $APP.
|
|
6
|
-
{name:e,value:d},!1)}return null}},
|
|
7
|
-
b=function(){var d=a.getAttribute("name");return $APP.
|
|
8
|
-
"__xSearchFieldInternals");$APP.
|
|
9
|
-
"click"));a.__xSearchFieldHandlers=null;return}}return null},
|
|
10
|
-
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xSearchFieldRefs");if($APP.
|
|
11
|
-
|
|
2
|
+
var oo=function(a,b,c){return $APP.r(c)?a.setAttribute(b,""):a.removeAttribute(b)},po=function(a,b,c){a=$APP.D.i("",a.value);c=c.hasAttribute("disabled");$APP.r(a?a:c)?b.classList.add("clear-hidden"):b.classList.remove("clear-hidden")},qo=function(a,b,c){a=a.hasAttribute("required");var d=c.value;return $APP.r($APP.r(a)?$APP.D.i(d,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},so=function(a){var b=$APP.l(a,"__xSearchFieldRefs");if($APP.r(b)){var c=$APP.l(b,
|
|
3
|
+
"input");b=$APP.l(b,"clear");var d=new $APP.P(null,7,[$APP.Ek,a.getAttribute("name"),$APP.vl,a.getAttribute("value"),$APP.ii,a.getAttribute("placeholder"),$APP.Oh,a.getAttribute("label"),$APP.Rk,a.hasAttribute("disabled"),$APP.sh,a.hasAttribute("required"),$APP.Nh,a.getAttribute("autocomplete")],null);var e=$APP.N(d),g=$APP.G(e,$APP.Ek),h=$APP.G(e,$APP.vl),k=$APP.G(e,$APP.ii),m=$APP.G(e,$APP.Oh),p=$APP.G(e,$APP.Rk);d=$APP.G(e,$APP.sh);e=$APP.G(e,$APP.Nh);g=$APP.r(g)?g:"";h=$APP.r(h)?h:"";k=$APP.r(k)?
|
|
4
|
+
k:"";m=$APP.r(m)?m:"";p=$APP.I(p);d=$APP.I(d);e=typeof e==="string"&&$APP.J(ro,e)?e:"off";d=new $APP.P(null,7,[$APP.Si,g,$APP.ui,h,$APP.rl,k,$APP.T,m,$APP.W,p,$APP.Lh,d,$APP.bl,e],null);c.name=$APP.Si.g(d);c.placeholder=$APP.rl.g(d);c.disabled=$APP.W.g(d);c.required=$APP.Lh.g(d);c.autocomplete=$APP.bl.g(d);e=$APP.T.g(d);$APP.r($APP.r(e)?$APP.O(e,""):e)?c.setAttribute("aria-label",e):c.removeAttribute("aria-label");d=$APP.r($APP.Lh.g(d))?"true":"false";c.setAttribute("aria-required",d);po(c,b,a);b=
|
|
5
|
+
$APP.l(a,"__xSearchFieldInternals");return $APP.r(b)?qo(a,b,c):null}return null},to=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:$APP.I(d)}))},uo=function(a){return function(){var b=$APP.l(a,"__xSearchFieldRefs");if($APP.r(b)){var c=$APP.l(b,"input");b=$APP.l(b,"clear");var d=c.value;var e=a.getAttribute("name");e=$APP.r(e)?e:"";var g=$APP.l(a,"__xSearchFieldInternals");$APP.r(g)&&(g.setFormValue(d),qo(a,g,c));po(c,b,a);return to(a,"x-search-field-input",
|
|
6
|
+
{name:e,value:d},!1)}return null}},vo=function(a){return function(){var b=$APP.l(a,"__xSearchFieldRefs");if($APP.r(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.r(d)?d:"";var e=$APP.l(a,"__xSearchFieldInternals");$APP.r(e)&&(e.setFormValue(c),qo(a,e,b));return to(a,"x-search-field-change",{name:d,value:c},!1)}return null}},wo=function(a){return function(b){if($APP.D.i("Enter",b.key)&&(b.preventDefault(),b=$APP.l(a,"__xSearchFieldRefs"),$APP.r(b))){var c=$APP.l(b,"input").value;
|
|
7
|
+
b=function(){var d=a.getAttribute("name");return $APP.r(d)?d:""}();return $APP.r(function(){var d=a.hasAttribute("required");return $APP.r(d)?$APP.D.i(c,""):d}())?(b=$APP.l(a,"__xSearchFieldInternals"),$APP.r(b)?b.reportValidity():null):to(a,"x-search-field-search",{name:b,value:c},!0)}return null}},xo=function(a){return function(){var b=$APP.l(a,"__xSearchFieldRefs");if($APP.r(b)){var c=$APP.l(b,"input");b=$APP.l(b,"clear");var d=a.getAttribute("name");d=$APP.r(d)?d:"";c.value="";var e=$APP.l(a,
|
|
8
|
+
"__xSearchFieldInternals");$APP.r(e)&&(e.setFormValue(""),qo(a,e,c));po(c,b,a);to(a,"x-search-field-clear",{name:d},!1);return c.focus()}return null}},yo=function(a){var b=$APP.l(a,"__xSearchFieldRefs");if($APP.r(b)){var c=$APP.l(a,"__xSearchFieldHandlers");if($APP.r(c)){var d=$APP.l(b,"input");b=$APP.l(b,"clear");d.removeEventListener("input",$APP.l(c,"input"));d.removeEventListener("change",$APP.l(c,"change"));d.removeEventListener("keydown",$APP.l(c,"keydown"));b.removeEventListener("click",$APP.l(c,
|
|
9
|
+
"click"));a.__xSearchFieldHandlers=null;return}}return null},zo=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.r(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},Ao=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return oo(this,c,$APP.I(d))}})},Bo=function(a){Object.defineProperty(a,
|
|
10
|
+
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xSearchFieldRefs");if($APP.r(b))return $APP.l(b,"input").value;b=this.getAttribute("value");return $APP.r(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.S.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xSearchFieldRefs");return $APP.r(c)?$APP.l(c,"input").value=b:null}})},Do=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return Co}});
|
|
11
|
+
Bo(b);zo(b,"name","name");zo(b,"placeholder","placeholder");zo(b,"label","label");zo(b,"autocomplete","autocomplete");Ao(b,"disabled","disabled");Ao(b,"required","required");b.checkValidity=function(){var c=$APP.l(this,"__xSearchFieldInternals");return $APP.r(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.l(this,"__xSearchFieldInternals");return $APP.r(c)?c.reportValidity():!0};b.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSearchFieldRefs"))){if(!$APP.r(this.shadowRoot)){var c=
|
|
12
12
|
this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("span"),h=document.createElement("input"),k=document.createElement("button");d.textContent=":host{display:block;color-scheme:light dark;--x-search-field-bg:#ffffff;--x-search-field-color:#111827;--x-search-field-border:1px solid #d1d5db;--x-search-field-border-radius:6px;--x-search-field-focus-ring-color:#2563eb;--x-search-field-icon-color:#9ca3af;--x-search-field-clear-color:#9ca3af;--x-search-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-search-field-bg:#1f2937;--x-search-field-color:#f9fafb;--x-search-field-border:1px solid #4b5563;--x-search-field-focus-ring-color:#3b82f6;--x-search-field-icon-color:#6b7280;--x-search-field-clear-color:#6b7280;}}[part\x3dwrapper]{display:flex;align-items:center;position:relative;background:var(--x-search-field-bg);border:var(--x-search-field-border);border-radius:var(--x-search-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dwrapper]:focus-within{border-color:var(--x-search-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-search-field-focus-ring-color) 20%,transparent);}[part\x3dicon]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;color:var(--x-search-field-icon-color);pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.25rem;background:transparent;color:var(--x-search-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]::-webkit-search-cancel-button{-webkit-appearance:none;}[part\x3dinput]::-webkit-search-decoration{-webkit-appearance:none;}[part\x3dclear]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;margin-right:2px;background:none;border:none;cursor:pointer;color:var(--x-search-field-clear-color);font-size:1.125rem;line-height:1;border-radius:4px;padding:0;}[part\x3dclear]:hover{color:var(--x-search-field-color);}.clear-hidden{display:none;}:host([disabled]) [part\x3dwrapper]{opacity:var(--x-search-field-disabled-opacity);cursor:not-allowed;}:host([disabled]) [part\x3dinput]{cursor:not-allowed;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","wrapper");g.setAttribute("part","icon");g.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 24 24" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3ccircle cx\x3d"11" cy\x3d"11" r\x3d"8"/\x3e\x3cline x1\x3d"21" y1\x3d"21" x2\x3d"16.65" y2\x3d"16.65"/\x3e\x3c/svg\x3e';h.setAttribute("part","input");h.setAttribute("type","search");h.setAttribute("spellcheck",
|
|
14
|
-
"false");k.setAttribute("part","clear");k.setAttribute("type","button");k.setAttribute("aria-label","Clear search");k.textContent="×";k.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(k);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:k}}$APP.
|
|
15
|
-
(c.value=d));c=$APP.l(this,"__xSearchFieldInternals");$APP.
|
|
16
|
-
b.attributeChangedCallback=function(c,d,e){$APP.
|
|
17
|
-
return a},
|
|
14
|
+
"false");k.setAttribute("part","clear");k.setAttribute("type","button");k.setAttribute("aria-label","Clear search");k.textContent="×";k.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(k);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:k}}$APP.r(this.attachInternals)&&(this.__xSearchFieldInternals=this.attachInternals())}yo(this);c=$APP.l(this,"__xSearchFieldRefs");$APP.r(c)&&(c=$APP.l(c,"input"),d=this.getAttribute("value"),$APP.r(d)&&
|
|
15
|
+
(c.value=d));c=$APP.l(this,"__xSearchFieldInternals");$APP.r(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.r(e)?e:""));d=$APP.l(this,"__xSearchFieldRefs");$APP.r(d)&&(c=$APP.l(d,"input"),d=$APP.l(d,"clear"),e=uo(this),g=vo(this),h=wo(this),k=xo(this),c.addEventListener("input",e),c.addEventListener("change",g),c.addEventListener("keydown",h),d.addEventListener("click",k),this.__xSearchFieldHandlers={input:e,change:g,keydown:h,click:k});return so(this)};b.disconnectedCallback=function(){return yo(this)};
|
|
16
|
+
b.attributeChangedCallback=function(c,d,e){$APP.D.i(c,"value")&&(c=$APP.l(this,"__xSearchFieldRefs"),$APP.r(c)&&(c=$APP.l(c,"input"),$APP.O(c.value,e)&&(c.value=$APP.r(e)?e:"")));return so(this)};b.formDisabledCallback=function(c){oo(this,"disabled",$APP.I(c));return so(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xSearchFieldRefs");$APP.r(c)&&($APP.l(c,"input").value="");c=$APP.l(this,"__xSearchFieldInternals");$APP.r(c)&&c.setFormValue("");return so(this)};
|
|
17
|
+
return a},Eo=function(){return $APP.r(customElements.get("x-search-field"))?null:customElements.define("x-search-field",Do())};var Co="name value placeholder label disabled required autocomplete".split(" "),ro=new $APP.R(null,new $APP.P(null,2,["off",null,"on",null],null),null);$APP.ka("baredom.exports.x_search_field.init",Eo);export const init=Eo;
|
package/dist/x-select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"md";c=new $APP.
|
|
4
|
-
$APP.O(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;k.value=$APP.
|
|
5
|
-
g=e;if($APP.
|
|
6
|
-
|
|
7
|
-
$APP.l(c,"change"));d.removeEventListener("slotchange",$APP.l(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},
|
|
8
|
-
null&&$APP.O(b)?(b=""+$APP.
|
|
2
|
+
var xK=function(a){var b=$APP.l(a,"__xSelectRefs");if($APP.r(b)){var c=new $APP.P(null,6,[$APP.Rk,a.hasAttribute("disabled"),$APP.sh,a.hasAttribute("required"),$APP.Yk,a.getAttribute("size"),$APP.ii,a.getAttribute("placeholder"),$APP.vl,a.getAttribute("value"),$APP.Ek,a.getAttribute("name")],null);var d=$APP.N(c),e=$APP.G(d,$APP.Rk),g=$APP.G(d,$APP.sh),h=$APP.G(d,$APP.Yk);c=$APP.G(d,$APP.ii);var k=$APP.G(d,$APP.vl);d=$APP.G(d,$APP.Ek);e=$APP.I(e);g=$APP.I(g);h=typeof h==="string"&&$APP.J(wK,h)?h:
|
|
3
|
+
"md";c=new $APP.P(null,6,[$APP.W,e,$APP.Lh,g,$APP.rh,h,$APP.rl,c,$APP.ui,k,$APP.Si,d],null);if($APP.O(c,$APP.l(a,"__xSelectModel"))){a.__xSelectModel=c;a=$APP.l(b,"wrapper");k=$APP.l(b,"select");b=$APP.l(b,"placeholder-opt");h=$APP.W.g(c);d=$APP.Lh.g(c);g=$APP.rh.g(c);e=$APP.rl.g(c);var m=$APP.ui.g(c);c=$APP.Si.g(c);k.disabled=h;$APP.r(d)?k.setAttribute("required",""):k.removeAttribute("required");typeof c==="string"&&$APP.O(c,"")?k.setAttribute("name",c):k.removeAttribute("name");typeof e==="string"&&
|
|
4
|
+
$APP.O(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;k.value=$APP.r(m)?m:"";a.setAttribute("data-size",g);$APP.r(h)?a.setAttribute("data-disabled",""):a.removeAttribute("data-disabled");return c==null||$APP.D.i(c,"")?k.setAttribute("aria-label",$APP.r(e)?e:"select"):k.removeAttribute("aria-label")}}return null},yK=function(a){var b=$APP.l(a,"__xSelectRefs");if($APP.r(b)){var c=$APP.l(b,"select"),d=$APP.l(b,"placeholder-opt");for(b=$APP.l(b,"slot").assignedElements({flatten:!0});;){var e=c.lastChild,
|
|
5
|
+
g=e;if($APP.r($APP.r(g)?e!==d:g))c.removeChild(e);else break}d=$APP.u($APP.wc(b));b=null;for(g=e=0;;)if(g<e){var h=b.G(null,g),k=h.tagName.toLowerCase();($APP.D.i(k,"option")||$APP.D.i(k,"optgroup"))&&c.appendChild(h.cloneNode(!0));g+=1}else if(d=$APP.u(d))$APP.Pc(d)?(e=$APP.yb(d),d=$APP.zb(d),b=e,e=$APP.B(e)):(b=$APP.v(d),e=b.tagName.toLowerCase(),($APP.D.i(e,"option")||$APP.D.i(e,"optgroup"))&&c.appendChild(b.cloneNode(!0)),d=$APP.z(d),b=null,e=0),g=0;else break;a.__xSelectModel=null;return xK(a)}return null},
|
|
6
|
+
zK=function(a){return function(){var b=$APP.l(a,"__xSelectRefs");return $APP.r(b)?(b=$APP.l(b,"select"),a.dispatchEvent(new CustomEvent("select-change",{detail:{value:b.value,label:b.selectedOptions.length>0?b.selectedOptions[0].text:""},bubbles:!0,composed:!0,cancelable:!1}))):null}},AK=function(a){return function(){return yK(a)}},BK=function(a){var b=$APP.l(a,"__xSelectRefs");if($APP.r(b)){var c=$APP.l(a,"__xSelectHandlers");if($APP.r(c)){var d=$APP.l(b,"slot");$APP.l(b,"select").removeEventListener("change",
|
|
7
|
+
$APP.l(c,"change"));d.removeEventListener("slotchange",$APP.l(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},CK=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.r($APP.I(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},DK=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.r(b)?b:null},set:function(b){b!=
|
|
8
|
+
null&&$APP.O(b)?(b=""+$APP.S.g(b),b=this.setAttribute("value",b)):b=this.removeAttribute("value");return b}})},FK=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return EK}});CK(b,"disabled","disabled");CK(b,"required","required");DK(b);b.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSelectRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("select"),
|
|
9
9
|
h=document.createElement("option"),k=document.createElement("span"),m=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-select-height-sm:2rem;--x-select-height-md:2.5rem;--x-select-height-lg:3rem;--x-select-radius:0.5rem;--x-select-font-size-sm:0.75rem;--x-select-font-size-md:0.875rem;--x-select-font-size-lg:1rem;--x-select-padding-inline:0.75rem;--x-select-bg:#ffffff;--x-select-bg-disabled:#f8fafc;--x-select-fg:#0f172a;--x-select-fg-disabled:#94a3b8;--x-select-placeholder-fg:#94a3b8;--x-select-border:#cbd5e1;--x-select-border-hover:#94a3b8;--x-select-border-focus:#3b82f6;--x-select-chevron:#64748b;--x-select-focus-ring:#93c5fd;--x-select-shadow:0 1px 2px rgba(15,23,42,0.06);--x-select-transition-duration:140ms;}@media (prefers-color-scheme:dark){:host{--x-select-bg:#1f2937;--x-select-bg-disabled:#111827;--x-select-fg:#f1f5f9;--x-select-border:#374151;--x-select-border-hover:#4b5563;--x-select-border-focus:#60a5fa;--x-select-chevron:#94a3b8;}}[part\x3dwrapper]{position:relative;display:flex;align-items:stretch;height:var(--x-select-height-md);border:1px solid var(--x-select-border);border-radius:var(--x-select-radius);background:var(--x-select-bg);box-shadow:var(--x-select-shadow);transition:border-color var(--x-select-transition-duration) ease,box-shadow var(--x-select-transition-duration) ease;overflow:hidden;font-size:var(--x-select-font-size-md);}[part\x3dwrapper][data-size\x3dsm]{height:var(--x-select-height-sm);font-size:var(--x-select-font-size-sm);}[part\x3dwrapper][data-size\x3dlg]{height:var(--x-select-height-lg);font-size:var(--x-select-font-size-lg);}[part\x3dwrapper][data-disabled]{background:var(--x-select-bg-disabled);opacity:0.6;pointer-events:none;}[part\x3dwrapper]:hover:not([data-disabled]){border-color:var(--x-select-border-hover);}[part\x3dwrapper]:focus-within:not([data-disabled]){border-color:var(--x-select-border-focus);box-shadow:0 0 0 3px var(--x-select-focus-ring);}[part\x3dselect]{appearance:none;-webkit-appearance:none;flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--x-select-fg);font-size:inherit;font-family:inherit;padding-inline:var(--x-select-padding-inline);padding-inline-end:calc(var(--x-select-padding-inline) + 1.75rem);cursor:pointer;width:100%;}[part\x3dselect]:disabled{color:var(--x-select-fg-disabled);cursor:default;}[part\x3dselect] option[data-placeholder]{color:var(--x-select-placeholder-fg);}[part\x3dchevron]{position:absolute;right:var(--x-select-padding-inline);top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;color:var(--x-select-chevron);width:1rem;height:1rem;}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
10
10
|
e.setAttribute("part","wrapper");g.setAttribute("part","select");k.setAttribute("part","chevron");k.setAttribute("aria-hidden","true");h.setAttribute("data-placeholder","");h.setAttribute("value","");h.hidden=!0;h.disabled=!0;h.selected=!0;k.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3cpolyline points\x3d"4 6 8 10 12 6"/\x3e\x3c/svg\x3e';
|
|
11
|
-
g.appendChild(h);e.appendChild(g);e.appendChild(k);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:k}}
|
|
12
|
-
function(c,d,e){return $APP.O(d,e)?
|
|
11
|
+
g.appendChild(h);e.appendChild(g);e.appendChild(k);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:k}}BK(this);c=$APP.l(this,"__xSelectRefs");$APP.r(c)&&(d=$APP.l(c,"slot"),e=zK(this),g=AK(this),h={change:e,slotchange:g},$APP.l(c,"select").addEventListener("change",e),d.addEventListener("slotchange",g),this.__xSelectHandlers=h);yK(this);return xK(this)};b.disconnectedCallback=function(){return BK(this)};b.attributeChangedCallback=
|
|
12
|
+
function(c,d,e){return $APP.O(d,e)?xK(this):null};return a},GK=function(){return $APP.r(customElements.get("x-select"))?null:customElements.define("x-select",FK())};var wK=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),EK="disabled required size placeholder value name".split(" ");$APP.Sd(["select-change",new $APP.P(null,2,[$APP.kl,!1,$APP.U,new $APP.P(null,2,[$APP.ui,$APP.Y,$APP.T,$APP.Y],null)],null)]);$APP.ka("baredom.exports.x_select.init",GK);export const init=GK;
|
package/dist/x-sidebar.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
(b.setAttribute("tabindex","-1"),a._panelTabindexAdded=!0);return b.focus()},
|
|
4
|
-
a._panelTabindexAdded=!1);return $APP.
|
|
2
|
+
var BV=function(a,b,c){return $APP.r(c)?a.setAttribute(b,""):a.removeAttribute(b)},CV=function(a,b,c){a.dispatchEvent(new CustomEvent(b,$APP.nh(new $APP.P(null,3,[$APP.U,c,$APP.xl,!0,$APP.Jl,!0],null))))},EV=function(a,b){$APP.J(DV,b)&&CV(a,"dismiss",new $APP.P(null,1,[$APP.ji,b],null))},FV=function(a){var b=window.getComputedStyle(a);return $APP.O("none",b.display)&&$APP.O("hidden",b.visibility)&&a.offsetWidth>0&&a.offsetHeight>0},GV=function(a){var b=$APP.l(a,"_panel");$APP.r(b.hasAttribute("tabindex"))||
|
|
3
|
+
(b.setAttribute("tabindex","-1"),a._panelTabindexAdded=!0);return b.focus()},HV=function(a){var b=$APP.l(a,"_restoreFocusTarget"),c=$APP.l(a,"_panel"),d=$APP.l(a,"_panelTabindexAdded")===!0,e=$APP.l(a,"_root");var g=$APP.l(a,"_sidebar");e=$APP.r(e)?e.activeElement:null;var h=document.activeElement;g=$APP.r($APP.r(e)?$APP.r(g)?g.contains(e):g:e)?e:$APP.r($APP.r(h)?$APP.r(g)?g.contains(h):g:h)?h:null;$APP.r(g)&&g.blur();a._tabbables=null;a._restoreFocusTarget=null;$APP.r($APP.r(c)?d:c)&&(c.removeAttribute("tabindex"),
|
|
4
|
+
a._panelTabindexAdded=!1);return $APP.r($APP.r(b)?b.isConnected:b)?b.focus():null},IV=function(a,b){var c=$APP.l(a,"_tabbables");c=$APP.r(c)?$APP.Be($APP.wc(c)):$APP.ie;var d=$APP.l(a,"_panel");if($APP.Jc(c))return b.preventDefault(),$APP.r(d)?GV(a):null;a=document.activeElement;d=$APP.v(c);c=$APP.zc(c);var e=b.shiftKey;return $APP.r($APP.r(e)?$APP.D.i(a,d):e)?(b.preventDefault(),c.focus()):$APP.t(e)&&$APP.D.i(a,c)?(b.preventDefault(),d.focus()):null},JV=function(a){if(!$APP.r($APP.l(a,"_root"))){var b=
|
|
5
5
|
a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("aside"),g=document.createElement("div"),h=document.createElement("slot");c.textContent=":host { --x-sidebar-bg: Canvas; --x-sidebar-fg: CanvasText; --x-sidebar-backdrop: rgb(0 0 0 / 0.4); --x-sidebar-shadow: 0 8px 24px rgb(0 0 0 / 0.18); --x-sidebar-width: 18rem; --x-sidebar-collapsed-width: 4rem; --x-sidebar-duration: 180ms; --x-sidebar-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-shadow: 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"),k=a.getAttribute("label"),m=window.innerWidth,p=window.matchMedia("(prefers-reduced-motion: reduce)");c=$APP.N(new $APP.
|
|
8
|
-
m=$APP.
|
|
9
|
-
a.setAttribute("data-effective-variant",d);a.setAttribute("data-placement",e);a.setAttribute("data-open",$APP.
|
|
10
|
-
a._restoreFocusTarget=document.activeElement,e=$APP.
|
|
11
|
-
$APP.
|
|
12
|
-
|
|
13
|
-
$APP.
|
|
14
|
-
"collapsed",$APP.
|
|
15
|
-
$APP.l(b,"onResize"));this._listening=!0}return
|
|
16
|
-
function(b,c,d){return $APP.O(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}},eW=function(a){JV(a);var b=$APP.l(a,"_prevState");b=$APP.r(b)?b:$APP.Td;var c=a.hasAttribute("open"),d=a.hasAttribute("collapsed"),e=a.getAttribute("placement"),g=a.getAttribute("variant"),
|
|
7
|
+
h=a.getAttribute("breakpoint"),k=a.getAttribute("label"),m=window.innerWidth,p=window.matchMedia("(prefers-reduced-motion: reduce)");c=$APP.N(new $APP.P(null,8,[KV,c,LV,d,MV,e,NV,g,OV,h,PV,k,QV,m,RV,$APP.I(p.matches)],null));k=$APP.G(c,KV);h=$APP.G(c,LV);d=$APP.G(c,MV);e=$APP.G(c,NV);m=$APP.G(c,OV);p=$APP.G(c,PV);g=$APP.G(c,QV);c=$APP.G(c,RV);d=$APP.J(SV,d)?d:$APP.hj.g(TV);e=$APP.J(UV,e)?e:$APP.Fh.g(TV);var q=$APP.Di.g(TV);m=m==null?null:""+$APP.S.g(m);m=m==null?null:(0,$APP.Qg)(m);$APP.u(m)?(m=Number(m),
|
|
8
|
+
m=$APP.r(Number.isFinite(m))?m:q):m=q;p=p!=null?(0,$APP.Qg)(p):null;p=$APP.u(p)?p:null;p=$APP.r(p)?p:$APP.T.g(TV);k=$APP.N(new $APP.P(null,1,[KV,k],null));k=$APP.G(k,KV);k=$APP.I(k);h=$APP.I(h);g=g<m?"modal":e;q=$APP.D.i(g,"modal");var w=$APP.D.i(g,"overlay"),x=$APP.D.i(g,"docked");c=$APP.Q([$APP.hl,VV,WV,XV,$APP.Di,YV,ZV,$V,aW,$APP.T,$APP.hj,bW,cW,dW],[k,g,!k,x&&h,m,x,h,e,k&&(q||w),p,d,$APP.I(c),q,w]);k=$APP.N(c);d=$APP.G(k,VV);e=$APP.G(k,$APP.hj);g=$APP.G(k,$APP.hl);h=$APP.G(k,XV);k=$APP.G(k,bW);
|
|
9
|
+
a.setAttribute("data-effective-variant",d);a.setAttribute("data-placement",e);a.setAttribute("data-open",$APP.r(g)?"true":"false");a.setAttribute("data-collapsed",$APP.r(h)?"true":"false");a.setAttribute("data-reduced-motion",$APP.r(k)?"true":"false");d=cW.g(c);$APP.r(d)&&(d=$APP.hl.g(c),$APP.r(d)&&(d=cW.g(b),d=$APP.r(d)?$APP.hl.g(b):d,d=$APP.t(d)));$APP.r(d)?(d=$APP.Be($APP.ge(FV,$APP.wc($APP.l(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.nh(d),a._tabbables=e,$APP.u(d)?$APP.v(d).focus():GV(a)):(d=cW.g(b),$APP.r(d)&&(d=$APP.hl.g(b),$APP.r(d)&&(d=cW.g(c),d=$APP.r(d)?$APP.hl.g(c):d,d=$APP.t(d))),$APP.r(d)&&HV(a));e=$APP.N(c);d=$APP.G(e,$APP.T);e=$APP.G(e,WV);g=$APP.l(a,"_sidebar");$APP.r(g)&&(g.setAttribute("role","navigation"),g.setAttribute("aria-label",d),g.setAttribute("aria-hidden",$APP.r(e)?"true":"false"));d=$APP.N(c);d=$APP.G(d,aW);e=$APP.l(a,"_backdrop");$APP.r(e)&&(e.setAttribute("data-active",
|
|
11
|
+
$APP.r(d)?"true":"false"),e.hidden=$APP.t(d),e.inert!=null&&(e.inert=$APP.t(d)));h=$APP.N(c);d=$APP.G(h,$APP.hl);e=$APP.G(h,$APP.hj);g=$APP.G(h,VV);h=$APP.G(h,XV);k=$APP.l(a,"_panel");$APP.r(k)&&(k.setAttribute("data-open",$APP.r(d)?"true":"false"),k.setAttribute("data-placement",e),k.setAttribute("data-variant",g),k.setAttribute("data-collapsed",$APP.r(h)?"true":"false"));$APP.O($APP.hl.g(b),$APP.hl.g(c))&&(b=$APP.hl.g(c),CV(a,"toggle",new $APP.P(null,1,[$APP.hl,$APP.I(b)],null)));a._prevState=c},
|
|
12
|
+
fW=function(a,b){var c=$APP.l(a,"_prevState"),d=b.key;return $APP.r(function(){var e=cW.g(c);e=$APP.r(e)?e:dW.g(c);return $APP.r(e)?$APP.hl.g(c):e}())?$APP.D.i(d,"Escape")?(b.preventDefault(),EV(a,"escape"),BV(a,"open",!1)):$APP.r(function(){var e=cW.g(c);return $APP.r(e)?$APP.D.i(d,"Tab"):e}())?IV(a,b):null:null},gW=function(a){$APP.r($APP.l(a,"_handlers"))||$APP.n(a,"_handlers",{onBackdropClick:function(b){var c=$APP.l(a,"_prevState"),d=$APP.l(a,"_backdrop");var e=cW.g(c);e=$APP.r(e)?e:dW.g(c);
|
|
13
|
+
$APP.r(e)?(c=$APP.hl.g(c),b=$APP.r(c)?$APP.D.i(b.target,d):c):b=e;$APP.r(b)?(EV(a,"backdrop"),b=BV(a,"open",!1)):b=null;return b},onKeydown:function(b){return fW(a,b)},onResize:function(){return eW(a)}})},hW=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return BV(this,"open",$APP.I(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"collapsed",{get:function(){return this.hasAttribute("collapsed")},set:function(b){return BV(this,
|
|
14
|
+
"collapsed",$APP.I(b))},enumerable:!0,configurable:!0})},jW=function(){var a=class extends HTMLElement{};a.observedAttributes=iW;a.prototype.connectedCallback=function(){JV(this);gW(this);if($APP.l(this,"_listening")!==!0){var b=$APP.l(this,"_handlers"),c=$APP.l(this,"_backdrop"),d=$APP.l(this,"_root");$APP.r($APP.r(c)?b:c)&&c.addEventListener("click",$APP.l(b,"onBackdropClick"));$APP.r($APP.r(d)?b:d)&&d.addEventListener("keydown",$APP.l(b,"onKeydown"));$APP.r(b)&&window.addEventListener("resize",
|
|
15
|
+
$APP.l(b,"onResize"));this._listening=!0}return eW(this)};a.prototype.disconnectedCallback=function(){if($APP.l(this,"_listening")===!0){var b=$APP.l(this,"_handlers"),c=$APP.l(this,"_backdrop"),d=$APP.l(this,"_root");$APP.r($APP.r(c)?b:c)&&c.removeEventListener("click",$APP.l(b,"onBackdropClick"));$APP.r($APP.r(d)?b:d)&&d.removeEventListener("keydown",$APP.l(b,"onKeydown"));$APP.r(b)&&window.removeEventListener("resize",$APP.l(b,"onResize"));this._listening=!1}return HV(this)};a.prototype.attributeChangedCallback=
|
|
16
|
+
function(b,c,d){return $APP.O(c,d)?eW(this):null};hW(a.prototype);return a},kW=function(){return $APP.r(customElements.get("x-sidebar"))?null:customElements.define("x-sidebar",jW())},$V=new $APP.M(null,"declared-variant","declared-variant",-2054964950),QV=new $APP.M(null,"viewport-width","viewport-width",-1146235948),WV=new $APP.M(null,"aria-hidden","aria-hidden",399337029),ZV=new $APP.M(null,"collapsed-requested","collapsed-requested",1573505800),aW=new $APP.M(null,"show-backdrop","show-backdrop",
|
|
17
|
+
-532209910),LV=new $APP.M(null,"collapsed-attr","collapsed-attr",-1535396832),MV=new $APP.M(null,"placement-attr","placement-attr",-1321967286),KV=new $APP.M(null,"open-attr","open-attr",-1772289801),lW=new $APP.M(null,"collapsed","collapsed",-628494523),RV=new $APP.M(null,"prefers-reduced-motion","prefers-reduced-motion",-2023150975),OV=new $APP.M(null,"breakpoint-attr","breakpoint-attr",-250275627),NV=new $APP.M(null,"variant-attr","variant-attr",-1143729279),VV=new $APP.M(null,"effective-variant",
|
|
18
|
+
"effective-variant",-829495195),bW=new $APP.M(null,"reduced-motion","reduced-motion",79621277),YV=new $APP.M(null,"is-docked","is-docked",875310728),cW=new $APP.M(null,"is-modal","is-modal",1610761086),dW=new $APP.M(null,"is-overlay","is-overlay",1953921119),PV=new $APP.M(null,"label-attr","label-attr",-571749887),XV=new $APP.M(null,"collapsed-applied","collapsed-applied",-1696231706);var iW="open collapsed placement variant breakpoint label".split(" "),SV=$APP.Yf(["right","left"]),UV=$APP.Yf(["overlay","docked","modal"]),DV=$APP.Yf(["backdrop","escape"]),TV=new $APP.P(null,6,[$APP.hj,"left",$APP.Fh,"docked",$APP.Di,768,$APP.T,"Sidebar",$APP.hl,!1,lW,!1],null);$APP.Sd(["toggle",new $APP.P(null,1,[$APP.U,new $APP.P(null,1,[$APP.hl,$APP.qj],null)],null),"dismiss",new $APP.P(null,1,[$APP.U,new $APP.P(null,1,[$APP.ji,$APP.Y],null)],null)]);$APP.ka("baredom.exports.x_sidebar.init",kW);export const init=kW;
|
package/dist/x-skeleton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
null);d=$APP.N(b);b=$APP.
|
|
4
|
-
b:"rect"},set:function(b){return typeof b==="string"&&$APP.O("",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.
|
|
5
|
-
return $APP.
|
|
6
|
-
a.prototype.connectedCallback=function(){if(!$APP.
|
|
7
|
-
d.setAttribute("part","base");e.setAttribute("part","shimmer");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xSkeletonBase=d;this.__xSkeletonInit=!0}
|
|
2
|
+
var HK=function(a){return typeof a==="string"&&$APP.O("",a)?a:null},KK=function(a){var b=new $APP.P(null,4,[$APP.Fh,a.getAttribute("variant"),$APP.Oi,a.getAttribute("animation"),$APP.Lj,a.getAttribute("width"),$APP.pj,a.getAttribute("height")],null);var c=$APP.N(b),d=$APP.G(c,$APP.Fh),e=$APP.G(c,$APP.Oi);b=$APP.G(c,$APP.Lj);c=$APP.G(c,$APP.pj);d=typeof d==="string"&&$APP.J(IK,d)?d:"rect";e=typeof e==="string"&&$APP.J(JK,e)?e:"pulse";b=new $APP.P(null,4,[$APP.Fh,d,$APP.Oi,e,$APP.Lj,HK(b),$APP.pj,HK(c)],
|
|
3
|
+
null);d=$APP.N(b);b=$APP.G(d,$APP.Fh);e=$APP.G(d,$APP.Oi);c=$APP.G(d,$APP.Lj);d=$APP.G(d,$APP.pj);var g=$APP.l(a,"__xSkeletonBase");g.setAttribute("data-variant",b);g.setAttribute("data-animation",e);$APP.r(c)?g.style.setProperty("width",c):g.style.removeProperty("width");$APP.r(d)?g.style.setProperty("height",d):g.style.removeProperty("height");a.setAttribute("aria-hidden","true")},LK=function(a){Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.r(b)?
|
|
4
|
+
b:"rect"},set:function(b){return typeof b==="string"&&$APP.O("",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.r(b)?b:"pulse"},set:function(b){return typeof b==="string"&&$APP.O("",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.r(b)?b:""},set:function(b){return typeof b==="string"&&$APP.O("",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.r(b)?b:""},set:function(b){return typeof b==="string"&&$APP.O("",b)?this.setAttribute("height",b):this.removeAttribute("height")},enumerable:!0,configurable:!0})},NK=function(){var a=class extends HTMLElement{};a.observedAttributes=MK;
|
|
6
|
+
a.prototype.connectedCallback=function(){if(!$APP.r($APP.l(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:rgba(0,0,0,0.08);--x-skeleton-highlight:rgba(255,255,255,0.65);--x-skeleton-border-radius:4px;--x-skeleton-duration:1.5s;}@media (prefers-color-scheme:dark){:host{--x-skeleton-color: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}KK(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&$APP.r($APP.l(this,"__xSkeletonInit"))&&KK(this);return null};LK(a.prototype);return a},OK=function(){$APP.r(customElements.get("x-skeleton"))||customElements.define("x-skeleton",NK());return null};var IK=new $APP.R(null,new $APP.P(null,3,["text",null,"rect",null,"circle",null],null),null),JK=new $APP.R(null,new $APP.P(null,3,["none",null,"pulse",null,"wave",null],null),null),MK=["variant","animation","width","height"];$APP.ka("baredom.exports.x_skeleton.init",OK);export const init=OK;
|
package/dist/x-slider.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.N(h);h=$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
A,typeof y==="string"&&$APP.O("",y)?y:null,x,typeof
|
|
6
|
-
q);
|
|
7
|
-
|
|
8
|
-
$APP.
|
|
9
|
-
{value:c,min:d,max:e})}},
|
|
10
|
-
b.preventDefault():null}},
|
|
11
|
-
c,$APP.
|
|
12
|
-
"value","value");
|
|
13
|
-
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.
|
|
14
|
-
"input"),d=
|
|
15
|
-
null:customElements.define("x-slider",
|
|
16
|
-
$APP.
|
|
17
|
-
2,[$APP.Z,$APP.Y,$APP.
|
|
2
|
+
var SD=function(a,b){return typeof a==="string"?(a=parseFloat(a),$APP.r(isNaN(a))?b:a):b},TD=function(a,b,c){return a.setAttribute(b,c)},UD=function(a,b,c){return $APP.r(c)?a.setAttribute(b,""):a.removeAttribute(b)},ZD=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.r(b)){var c=$APP.l(b,"base"),d=$APP.l(b,"header"),e=$APP.l(b,"label"),g=$APP.l(b,"value");b=$APP.l(b,"input");var h=$APP.Q([$APP.vj,$APP.gj,$APP.yj,$APP.Si,$APP.ui,$APP.Ti,$APP.sj,$APP.rh,$APP.Zj,$APP.T,$APP.Ol,$APP.Tk,VD],[a.getAttribute("min"),
|
|
3
|
+
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.N(h);h=$APP.G(k,$APP.Tk);var m=$APP.G(k,VD),p=$APP.G(k,$APP.vj),q=$APP.G(k,$APP.gj),w=$APP.G(k,$APP.yj),x=$APP.G(k,$APP.ui),y=$APP.G(k,$APP.Si),A=$APP.G(k,$APP.Ti),C=$APP.G(k,
|
|
4
|
+
$APP.sj),E=$APP.G(k,$APP.rh),H=$APP.G(k,$APP.T),F=$APP.G(k,$APP.Zj);k=$APP.G(k,$APP.Ol);p=SD(p,0);F=SD(F,100);x=$APP.Zg.i($APP.Yg.i(SD(x,0),p),F);$APP.D.i(m,"any")?m="any":(m=typeof m==="string"?parseFloat(m):NaN,m=$APP.t(isNaN(m))&&m>0?""+$APP.S.g(m):"1");E=typeof E==="string"&&$APP.J(WD,E)?E:"md";q=$APP.I(q);A=$APP.I(A);w=$APP.I(w);var K=F>p?$APP.Zg.i($APP.Yg.i((x-p)/(F-p)*100,0),100):0;h=$APP.Q([$APP.vj,$APP.Sl,$APP.Si,$APP.ui,$APP.sj,XD,$APP.rh,$APP.Zj,$APP.T,$APP.Ol,$APP.Tk,$APP.W,VD,YD],[p,
|
|
5
|
+
A,typeof y==="string"&&$APP.O("",y)?y:null,x,typeof C==="string"&&$APP.O("",C)?C:null,w,E,F,typeof H==="string"&&$APP.O("",H)?H:null,typeof k==="string"&&$APP.O("",k)?k:null,typeof h==="string"&&$APP.O("",h)?h:null,q,m,K]);m=$APP.N(h);y=$APP.G(m,$APP.Tk);C=$APP.G(m,$APP.W);H=$APP.G(m,VD);k=$APP.G(m,YD);w=$APP.G(m,$APP.vj);p=$APP.G(m,$APP.Sl);h=$APP.G(m,$APP.ui);A=$APP.G(m,$APP.sj);F=$APP.G(m,XD);q=$APP.G(m,$APP.rh);x=$APP.G(m,$APP.T);E=$APP.G(m,$APP.Zj);m=$APP.G(m,$APP.Ol);K=(K=x!=null)?K:F;c.setAttribute("data-size",
|
|
6
|
+
q);UD(a,"data-disabled",C);UD(a,"data-readonly",p);d.style.display=$APP.r(K)?"flex":"none";e.textContent=$APP.r(x)?x:"";e.style.display=x!=null?"":"none";g.textContent=$APP.r(F)?""+$APP.S.g(h):"";g.style.display=$APP.r(F)?"":"none";a.style.setProperty("--_x-slider-fill",""+$APP.S.g(k.toFixed(2))+"%");TD(b,"min",""+$APP.S.g(w));TD(b,"max",""+$APP.S.g(E));b.setAttribute("step",H);$APP.O(b.value,""+$APP.S.g(h))&&(b.value=""+$APP.S.g(h));TD(b,"aria-valuemin",""+$APP.S.g(w));TD(b,"aria-valuemax",""+$APP.S.g(E));
|
|
7
|
+
TD(b,"aria-valuenow",""+$APP.S.g(h));b.setAttribute("aria-readonly",$APP.r(p)?"true":"false");$APP.r(y)?b.setAttribute("aria-label",y):x!=null?b.setAttribute("aria-label",x):b.removeAttribute("aria-label");$APP.r(A)?b.setAttribute("aria-labelledby",A):b.removeAttribute("aria-labelledby");$APP.r(m)?b.setAttribute("aria-describedby",m):b.removeAttribute("aria-describedby");$APP.r(C)?b.setAttribute("disabled",""):b.removeAttribute("disabled");a=$APP.l(a,"__xSliderInternals");return $APP.r(a)?a.setFormValue(""+
|
|
8
|
+
$APP.S.g(h)):null}return null},$D=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},aE=function(a){return function(){if($APP.r(a.hasAttribute("disabled")))return null;var b=$APP.l($APP.l(a,"__xSliderRefs"),"input").value,c=parseFloat(b),d=parseFloat(function(){var g=a.getAttribute("min");return $APP.r(g)?g:"0"}()),e=parseFloat(function(){var g=a.getAttribute("max");return $APP.r(g)?g:"100"}());a.setAttribute("value",b);return $D(a,"x-slider-input",
|
|
9
|
+
{value:c,min:d,max:e})}},bE=function(a){return function(){if($APP.r(a.hasAttribute("disabled")))return null;var b=parseFloat($APP.l($APP.l(a,"__xSliderRefs"),"input").value),c=parseFloat(function(){var e=a.getAttribute("min");return $APP.r(e)?e:"0"}()),d=parseFloat(function(){var e=a.getAttribute("max");return $APP.r(e)?e:"100"}());return $D(a,"x-slider-change",{value:b,min:c,max:d})}},dE=function(a){return function(b){var c=a.hasAttribute("readonly");c=$APP.r(c)?$APP.J(cE,b.key):c;return $APP.r(c)?
|
|
10
|
+
b.preventDefault():null}},eE=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.r(b)){var c=$APP.l(a,"__xSliderHandlers");if($APP.r(c)){b=$APP.l(b,"input");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSliderHandlers=null;return}}return null},fE=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return UD(this,
|
|
11
|
+
c,$APP.I(d))}})},gE=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.r(d)?d:null},set:function(d){return d!=null&&$APP.O(d)?TD(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},iE=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return hE}});fE(b,"disabled","disabled");fE(b,"readOnly","readonly");fE(b,"showValue","show-value");gE(b,
|
|
12
|
+
"value","value");gE(b,"min","min");gE(b,"max","max");gE(b,"step","step");gE(b,"name","name");gE(b,"label","label");gE(b,"size","size");b.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSliderRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("input");d.textContent=":host{display:block;color-scheme:light dark;--x-slider-track-color:rgba(0,0,0,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-thumb-shadow:0 1px 4px rgba(0,0,0,0.20);--x-slider-focus-ring:#60a5fa;--x-slider-disabled-opacity:0.45;--x-slider-label-color:rgba(0,0,0,0.60);--x-slider-value-color:rgba(0,0,0,0.50);--x-slider-radius:9999px;}@media (prefers-color-scheme:dark){:host{--x-slider-track-color:rgba(255,255,255,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-focus-ring:#93c5fd;--x-slider-label-color:rgba(255,255,255,0.60);--x-slider-value-color:rgba(255,255,255,0.50);}}[part\x3dbase]{width:100%;box-sizing:border-box;}[part\x3dbase][data-size\x3dsm]{--_x-slider-track-h:4px;--_x-slider-thumb-sz:14px;}[part\x3dbase][data-size\x3dmd]{--_x-slider-track-h:6px;--_x-slider-thumb-sz:18px;}[part\x3dbase][data-size\x3dlg]{--_x-slider-track-h:8px;--_x-slider-thumb-sz:22px;}[part\x3dheader]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px;}[part\x3dlabel-text]{font-size:0.875rem;color:var(--x-slider-label-color);font-weight:500;}[part\x3dvalue-text]{font-size:0.8125rem;color:var(--x-slider-value-color);}[part\x3dinput]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:var(--_x-slider-thumb-sz,18px);cursor:pointer;margin:0;padding:0;background:transparent;outline:none;box-sizing:border-box;}[part\x3dinput]::-webkit-slider-runnable-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:linear-gradient(to right,var(--x-slider-fill-color) var(--_x-slider-fill,0%),var(--x-slider-track-color) var(--_x-slider-fill,0%));}[part\x3dinput]::-moz-range-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-track-color);border:none;}[part\x3dinput]::-moz-range-progress{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-fill-color);}[part\x3dinput]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);margin-top:calc(var(--_x-slider-track-h,6px)/2 - var(--_x-slider-thumb-sz,18px)/2);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]::-moz-range-thumb{width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]:focus-visible::-webkit-slider-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}[part\x3dinput]:focus-visible::-moz-range-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}:host([data-disabled]) [part\x3dinput]{opacity:var(--x-slider-disabled-opacity);cursor:default;pointer-events:none;}:host([data-readonly]) [part\x3dinput]{pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]::-webkit-slider-thumb{transition:none;}[part\x3dinput]::-moz-range-thumb{transition:none;}}";
|
|
13
|
+
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.r(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}eE(this);c=$APP.l(this,"__xSliderRefs");$APP.r(c)&&(c=$APP.l(c,
|
|
14
|
+
"input"),d=aE(this),e=bE(this),g=dE(this),h={input:d,change:e,keydown:g},c.addEventListener("input",d),c.addEventListener("change",e),c.addEventListener("keydown",g),this.__xSliderHandlers=h);return ZD(this)};b.disconnectedCallback=function(){return eE(this)};b.attributeChangedCallback=function(){return ZD(this)};b.formDisabledCallback=function(c){UD(this,"disabled",$APP.I(c));return ZD(this)};b.formResetCallback=function(){TD(this,"value",""+$APP.S.g(0));return ZD(this)};return a},jE=function(){return $APP.r(customElements.get("x-slider"))?
|
|
15
|
+
null:customElements.define("x-slider",iE())},XD=new $APP.M(null,"show-value?","show-value?",-1960833108),YD=new $APP.M(null,"fill-percent","fill-percent",-1813848228),VD=new $APP.M(null,"step","step",1288888124);var WD=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),hE="value min max step disabled readonly name label show-value size aria-label aria-labelledby aria-describedby".split(" ");
|
|
16
|
+
$APP.Q([$APP.vj,$APP.gj,$APP.th,$APP.Si,$APP.ui,$APP.rh,$APP.ml,$APP.Zj,$APP.T,VD],[new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"min"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"disabled"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"show-value"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"name"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"value"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"size"],null),new $APP.P(null,2,[$APP.Z,$APP.qj,$APP.Oj,"readonly"],null),new $APP.P(null,
|
|
17
|
+
2,[$APP.Z,$APP.Y,$APP.Oj,"max"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"label"],null),new $APP.P(null,2,[$APP.Z,$APP.Y,$APP.Oj,"step"],null)]);$APP.Sd(["x-slider-input",new $APP.P(null,1,[$APP.U,new $APP.P(null,3,[$APP.ui,$APP.V,$APP.vj,$APP.V,$APP.Zj,$APP.V],null)],null),"x-slider-change",new $APP.P(null,1,[$APP.U,new $APP.P(null,3,[$APP.ui,$APP.V,$APP.vj,$APP.V,$APP.Zj,$APP.V],null)],null)]);var cE=new $APP.R(null,new $APP.P(null,8,["PageDown",null,"ArrowUp",null,"ArrowDown",null,"End",null,"ArrowRight",null,"ArrowLeft",null,"PageUp",null,"Home",null],null),null);$APP.ka("baredom.exports.x_slider.init",jE);export const init=jE;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var vD=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.D.i(a,""))return b;a=parseFloat(a);return $APP.r(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},wD=function(a,b,c,d,e,g){b=c+(e*(b-a)-g*c)*d;return[a+b*d,b]},xD=function(a,b,c,d,e,g,h){a=c-a;b=d-b;d=Math.sqrt(a*a+b*b);if(d<=.001||d>=e)return[0,0];e=1-d/e;g*=e*e*($APP.r(h)?50:20);return[a/d*g,b/d*g]},yD=function(){return $APP.I(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},zD=function(a,b){for(var c=0;;){if(c>=20)return!0;
|
|
3
|
+
if(Math.abs(a[c])>.1||Math.abs(b[c])>.1)return!1;c+=1}},BD=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),e=document.createElementNS("http://www.w3.org/2000/svg","path"),g=document.createElement("div"),h=document.createElement("slot");c.textContent=AD;d.setAttribute("part","svg");d.setAttribute("viewBox","0 0 300 200");d.setAttribute("preserveAspectRatio","none");d.setAttribute("aria-hidden","true");
|
|
4
|
+
e.setAttribute("part","shape");g.setAttribute("part","content");d.appendChild(e);g.appendChild(h);b.appendChild(c);b.appendChild(d);b.appendChild(g);a.__xSoftBodyRefs=new $APP.P(null,4,[$APP.bi,b,$APP.xj,d,$APP.ak,e,$APP.Vh,g],null)},ED=function(a){a=new $APP.P(null,6,[$APP.jl,a.getAttribute("stiffness"),$APP.Ml,a.getAttribute("damping"),$APP.$i,a.getAttribute("radius"),$APP.Mj,a.getAttribute("intensity"),CD,a.getAttribute("grab-radius"),$APP.Ai,a.getAttribute("disabled")],null);var b=$APP.N(a);a=
|
|
5
|
+
$APP.G(b,$APP.jl);var c=$APP.G(b,$APP.Ml),d=$APP.G(b,$APP.$i),e=$APP.G(b,$APP.Mj),g=$APP.G(b,CD);b=$APP.G(b,$APP.Ai);return new $APP.P(null,6,[$APP.Vk,vD(a,180,10,1E3),$APP.Vj,vD(c,12,1,100),$APP.Il,vD(d,16,6,200),$APP.Gj,vD(e,1,0,5),DD,vD(g,80,10,500),$APP.W,b!=null],null)},FD=function(a,b,c){var d=$APP.Il.g($APP.l(a,"__xSoftBodyModel"));d=Math.max(6,Math.min(d,Math.min(b,c)/2));var e=Math.cos(Math.PI/6),g=Math.sin(Math.PI/6),h=Math.cos(Math.PI/3),k=Math.sin(Math.PI/3),m=new Float64Array(20),p=new Float64Array(20);
|
|
6
|
+
m[0]=d;p[0]=0;m[1]=b*.5;p[1]=0;m[2]=b-d;p[2]=0;m[3]=b-d+d*g;p[3]=d-d*e;m[4]=b-d+d*k;p[4]=d-d*h;m[5]=b;p[5]=d;m[6]=b;p[6]=c*.5;m[7]=b;p[7]=c-d;m[8]=b-d+d*e;p[8]=c-d+d*g;m[9]=b-d+d*h;p[9]=c-d+d*k;m[10]=b-d;p[10]=c;m[11]=b*.5;p[11]=c;m[12]=d;p[12]=c;m[13]=d-d*g;p[13]=c-d+d*e;m[14]=d-d*k;p[14]=c-d+d*h;m[15]=0;p[15]=c-d;m[16]=0;p[16]=c*.5;m[17]=0;p[17]=d;m[18]=d-d*e;p[18]=d-d*g;m[19]=d-d*h;p[19]=d-d*k;c=[m,p];b=c[0];c=c[1];d=new Float64Array(20);e=new Float64Array(20);g=new Float64Array(20);h=new Float64Array(20);
|
|
7
|
+
for(k=0;;)if(k<20)d[k]=b[k],e[k]=c[k],g[k]=0,h[k]=0,k+=1;else break;a.__xSoftBodyRX=b;a.__xSoftBodyRY=c;a.__xSoftBodyCX=d;a.__xSoftBodyCY=e;a.__xSoftBodyVX=g;a.__xSoftBodyVY=h},GD=function(a){var b=$APP.N($APP.l(a,"__xSoftBodyRefs"));b=$APP.G(b,$APP.ak);var c=$APP.l(a,"__xSoftBodyCX");a=$APP.l(a,"__xSoftBodyCY");var d=[];d.push("M"+$APP.S.g(c[0].toFixed(2))+","+$APP.S.g(a[0].toFixed(2)));for(var e=0;;)if(e<20){var g=$APP.hd(e+19,20),h=e,k=$APP.hd(e+1,20),m=$APP.hd(e+2,20),p=(c[k]-c[g])/6,q=(a[k]-
|
|
8
|
+
a[g])/6;g=(c[m]-c[h])/6;m=(a[m]-a[h])/6;var w=c[k]-c[h],x=a[k]-a[h];x=Math.sqrt(w*w+x*x)*.4;w=Math.sqrt(p*p+q*q);w=w>x?x/(w+.001):1;q=a[h]+q*w;var y=Math.sqrt(g*g+m*m);x=y>x?x/(y+.001):1;g=c[k]-g*x;m=a[k]-m*x;d.push("C"+$APP.S.g((c[h]+p*w).toFixed(2))+","+$APP.S.g(q.toFixed(2))+" "+$APP.S.g(g.toFixed(2))+","+$APP.S.g(m.toFixed(2))+" "+$APP.S.g(c[k].toFixed(2))+","+$APP.S.g(a[k].toFixed(2)));e+=1}else break;d.push("Z");b.setAttribute("d",d.join(""))},HD=function(a){var b=$APP.N($APP.l(a,"__xSoftBodyRefs"));
|
|
9
|
+
b=$APP.G(b,$APP.ak);var c=$APP.l(a,"__xSoftBodyW"),d=$APP.l(a,"__xSoftBodyH");a=$APP.Il.g($APP.l(a,"__xSoftBodyModel"));a=Math.max(6,Math.min(a,Math.min(c,d)/2));var e=.5522847498*a;c="M"+$APP.S.g(a.toFixed(2))+",0L"+$APP.S.g((c-a).toFixed(2))+",0C"+$APP.S.g((c-a+e).toFixed(2))+",0 "+$APP.S.g(c.toFixed(2))+","+$APP.S.g((a-e).toFixed(2))+" "+$APP.S.g(c.toFixed(2))+","+$APP.S.g(a.toFixed(2))+"L"+$APP.S.g(c.toFixed(2))+","+$APP.S.g((d-a).toFixed(2))+"C"+$APP.S.g(c.toFixed(2))+","+$APP.S.g((d-a+e).toFixed(2))+
|
|
10
|
+
" "+$APP.S.g((c-a+e).toFixed(2))+","+$APP.S.g(d.toFixed(2))+" "+$APP.S.g((c-a).toFixed(2))+","+$APP.S.g(d.toFixed(2))+"L"+$APP.S.g(a.toFixed(2))+","+$APP.S.g(d.toFixed(2))+"C"+$APP.S.g((a-e).toFixed(2))+","+$APP.S.g(d.toFixed(2))+" 0,"+$APP.S.g((d-a+e).toFixed(2))+" 0,"+$APP.S.g((d-a).toFixed(2))+"L0,"+$APP.S.g(a.toFixed(2))+"C0,"+$APP.S.g((a-e).toFixed(2))+" "+$APP.S.g((a-e).toFixed(2))+",0 "+$APP.S.g(a.toFixed(2))+",0Z";b.setAttribute("d",c)},JD=function(a){$APP.r($APP.l(a,"__xSoftBodyRaf"))||($APP.n(a,
|
|
11
|
+
"__xSoftBodyLF",performance.now()),$APP.n(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return ID(a)})))},KD=function(a){var b=$APP.l(a,"__xSoftBodyRaf");$APP.r(b)&&(cancelAnimationFrame(b),a.__xSoftBodyRaf=null)},LD=function(a,b){var c=$APP.N($APP.l(a,"__xSoftBodyRefs"));c=$APP.G(c,$APP.xj).getBoundingClientRect();a.__xSoftBodyPX=b.clientX-c.left;a.__xSoftBodyPY=b.clientY-c.top;return null},MD=function(a){function b(){a.__xSoftBodyGrab=!1;a.dispatchEvent(new CustomEvent("x-soft-body-release",
|
|
12
|
+
{bubbles:!0,composed:!0,detail:{}}));return null}function c(h){a.__xSoftBodyGrab=!0;LD(a,h);a.dispatchEvent(new CustomEvent("x-soft-body-grab",{bubbles:!0,composed:!0,detail:{}}));return null}function d(){a.__xSoftBodyPA=!1;a.__xSoftBodyGrab=!1;return null}function e(){a.__xSoftBodyPA=!0;var h=$APP.W.g($APP.l(a,"__xSoftBodyModel"));h=$APP.r(h)?h:yD();$APP.r(h)||JD(a);return null}function g(h){return LD(a,h)}$APP.n(a,"__xSoftBodyHdl",{move:g,enter:e,leave:d,down:c,up:b});a.addEventListener("pointermove",
|
|
13
|
+
g,{passive:!0});a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("pointerdown",c);a.addEventListener("pointerup",b)},ND=function(a){var b=$APP.l(a,"__xSoftBodyHdl");$APP.r(b)&&(a.removeEventListener("pointermove",$APP.l(b,"move")),a.removeEventListener("pointerenter",$APP.l(b,"enter")),a.removeEventListener("pointerleave",$APP.l(b,"leave")),a.removeEventListener("pointerdown",$APP.l(b,"down")),a.removeEventListener("pointerup",$APP.l(b,"up")),a.__xSoftBodyHdl=
|
|
14
|
+
null)},OD=function(a){Object.defineProperty(a,"stiffness",{get:function(){var b=this.getAttribute("stiffness");return vD(b,180,10,1E3)},set:function(b){return b==null?this.removeAttribute("stiffness"):this.setAttribute("stiffness",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"damping",{get:function(){var b=this.getAttribute("damping");return vD(b,12,1,100)},set:function(b){return b==null?this.removeAttribute("damping"):this.setAttribute("damping",""+$APP.S.g(b))},enumerable:!0,
|
|
15
|
+
configurable:!0});Object.defineProperty(a,"radius",{get:function(){var b=this.getAttribute("radius");return vD(b,16,6,200)},set:function(b){return b==null?this.removeAttribute("radius"):this.setAttribute("radius",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"intensity",{get:function(){var b=this.getAttribute("intensity");return vD(b,1,0,5)},set:function(b){return b==null?this.removeAttribute("intensity"):this.setAttribute("intensity",""+$APP.S.g(b))},enumerable:!0,configurable:!0});
|
|
16
|
+
Object.defineProperty(a,"grabRadius",{get:function(){var b=this.getAttribute("grab-radius");return vD(b,80,10,500)},set:function(b){return b==null?this.removeAttribute("grab-radius"):this.setAttribute("grab-radius",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.r(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},QD=function(){var a=
|
|
17
|
+
class extends HTMLElement{};a.observedAttributes=PD;a.prototype.connectedCallback=function(){var b=this,c=ED(b);b.__xSoftBodyModel=c;$APP.r($APP.l(b,"__xSoftBodyRefs"))||BD(b);b.__xSoftBodyPA=!1;b.__xSoftBodyGrab=!1;b.__xSoftBodyPX=0;b.__xSoftBodyPY=0;c=new ResizeObserver(function(d){if(d.length>0){var e=d[0].contentRect;d=e.width;e=e.height;if(d>0&&e>0){b.__xSoftBodyW=d;b.__xSoftBodyH=e;var g=$APP.N($APP.l(b,"__xSoftBodyRefs"));$APP.G(g,$APP.xj).setAttribute("viewBox","0 0 "+$APP.S.g(d)+" "+$APP.S.g(e));
|
|
18
|
+
FD(b,d,e);d=$APP.W.g($APP.l(b,"__xSoftBodyModel"));d=$APP.r(d)?d:yD();$APP.r(d)?HD(b):(GD(b),JD(b))}}return null});b.__xSoftBodyRO=c;c.observe(b);ND(b);MD(b);return null};a.prototype.disconnectedCallback=function(){KD(this);ND(this);var b=$APP.l(this,"__xSoftBodyRO");$APP.r(b)&&(b.disconnect(),this.__xSoftBodyRO=null);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&$APP.r($APP.l(this,"__xSoftBodyRefs"))&&(this.__xSoftBodyModel=b=ED(this),c=$APP.l(this,"__xSoftBodyW"),
|
|
19
|
+
d=$APP.l(this,"__xSoftBodyH"),$APP.r($APP.r(c)?$APP.r(d)?c>0&&d>0:d:c)&&(FD(this,c,d),b=$APP.W.g(b),b=$APP.r(b)?b:yD(),$APP.r(b)?(KD(this),HD(this)):(GD(this),JD(this))));return null};OD(a.prototype);return a},RD=function(){$APP.r(customElements.get("x-soft-body"))||customElements.define("x-soft-body",QD());return null},DD=new $APP.M(null,"grab-radius","grab-radius",771838535),CD=new $APP.M(null,"grab-radius-raw","grab-radius-raw",-1019405976);var PD="stiffness damping radius intensity grab-radius disabled".split(" ");$APP.Sd(["x-soft-body-grab",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null),"x-soft-body-release",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null)]);var AD=":host{display:block;position:relative;background:none;overflow:visible;"+$APP.S.g("--x-soft-body-bg")+":#ffffff;"+$APP.S.g("--x-soft-body-border")+":#e2e8f0;"+$APP.S.g("--x-soft-body-border-width")+":1.5;"+$APP.S.g("--x-soft-body-shadow")+":0 1px 3px rgba(0,0,0,0.1);"+$APP.S.g("--x-soft-body-padding")+":1rem;}[part\x3dsvg]{display:block;width:100%;height:100%;position:absolute;inset:0;overflow:visible;pointer-events:none;}[part\x3dshape]{fill:var("+$APP.S.g("--x-soft-body-bg")+",#ffffff);stroke:var("+
|
|
20
|
+
$APP.S.g("--x-soft-body-border")+",#e2e8f0);stroke-width:var("+$APP.S.g("--x-soft-body-border-width")+",1.5);filter:drop-shadow(var("+$APP.S.g("--x-soft-body-shadow")+",0 1px 3px rgba(0,0,0,0.1)));}[part\x3dcontent]{position:relative;background:none;padding:var("+$APP.S.g("--x-soft-body-padding")+",1rem);z-index:1;}@media(prefers-color-scheme:dark){:host{"+$APP.S.g("--x-soft-body-bg")+":#1e293b;"+$APP.S.g("--x-soft-body-border")+":#475569;"+$APP.S.g("--x-soft-body-shadow")+":0 1px 3px rgba(0,0,0,0.3);}}@media(prefers-reduced-motion:reduce){[part\x3dshape]{transition:none!important;}}",
|
|
21
|
+
ID=function ID(a){if($APP.r(a.isConnected)){var c=$APP.l(a,"__xSoftBodyModel"),d=performance.now(),e=Math.min(d-$APP.l(a,"__xSoftBodyLF"),100)/1E3,g=$APP.Vk.g(c),h=$APP.Vj.g(c),k=$APP.Gj.g(c),m=DD.g(c);c=$APP.l(a,"__xSoftBodyRX");var p=$APP.l(a,"__xSoftBodyRY"),q=$APP.l(a,"__xSoftBodyCX"),w=$APP.l(a,"__xSoftBodyCY"),x=$APP.l(a,"__xSoftBodyVX"),y=$APP.l(a,"__xSoftBodyVY"),A=$APP.l(a,"__xSoftBodyPA"),C=$APP.l(a,"__xSoftBodyPX"),E=$APP.l(a,"__xSoftBodyPY"),H=$APP.l(a,"__xSoftBodyGrab");a.__xSoftBodyLF=
|
|
22
|
+
d;for(d=0;;)if(d<20){var F=c[d],K=p[d],X=$APP.r(A)?xD(F,K,C,E,m,k,H):[0,0];F=wD(q[d],F+X[0],x[d],e,g,h);K=wD(w[d],K+X[1],y[d],e,g,h);q[d]=F[0];x[d]=F[1];w[d]=K[0];y[d]=K[1];d+=1}else break;GD(a);if($APP.r($APP.r(A)?A:!zD(x,y)))$APP.n(a,"__xSoftBodyRaf",requestAnimationFrame(function(){return ID.g?ID.g(a):ID.call(null,a)}));else{for(e=0;;)if(e<20)q[e]=c[e],w[e]=p[e],e+=1;else break;GD(a);a.__xSoftBodyRaf=null}}return null};$APP.ka("baredom.exports.x_soft_body.init",RD);export const init=RD;
|
package/dist/x-spacer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d=$APP.
|
|
4
|
-
"grow",{get:function(){return
|
|
5
|
-
b.appendChild(c);this.__xSpacerRefs={root:b}}
|
|
6
|
-
"grow-raw",441172903),
|
|
2
|
+
var DG=function(a){return a!=null&&$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},JG=function(a){var b=new $APP.P(null,3,[$APP.Yk,a.getAttribute("size"),EG,a.getAttribute("axis"),FG,a.getAttribute("grow")],null);b=$APP.N(b);var c=$APP.G(b,$APP.Yk),d=$APP.G(b,EG);b=$APP.G(b,FG);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.J(GG,d)?d:"vertical";b=new $APP.P(null,3,[$APP.rh,c,HG,d,IG,DG(b)],null);c=$APP.N(b);b=$APP.G(c,$APP.rh);
|
|
3
|
+
d=$APP.G(c,HG);c=$APP.G(c,IG);var e=a.style;a.setAttribute("data-axis",d);a.setAttribute("data-grow",$APP.r(c)?"true":"false");e.setProperty("--x-spacer-size",b);a.setAttribute("role","none");a.setAttribute("aria-hidden","true")},KG=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.r(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},LG=function(a){Object.defineProperty(a,
|
|
4
|
+
"grow",{get:function(){return DG(this.getAttribute("grow"))},set:function(b){return $APP.r(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},MG=function(a){KG(a,"size","1rem");KG(a,"axis","vertical");LG(a)},OG=function(){var a=class extends HTMLElement{};a.observedAttributes=NG;a.prototype.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSpacerRefs"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=":host{display:block;flex-shrink:0;height:var(--x-spacer-size,1rem);width:0;pointer-events:none;}:host([data-axis\x3d'horizontal']){height:0;width:var(--x-spacer-size,1rem);}:host([data-grow\x3d'true']){flex:1 0 var(--x-spacer-size,0px);height:0;width:0;}";
|
|
5
|
+
b.appendChild(c);this.__xSpacerRefs={root:b}}JG(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.r(b?$APP.l(this,"__xSpacerRefs"):b)&&JG(this);return null};MG(a.prototype);return a},PG=function(){$APP.r(customElements.get("x-spacer"))||customElements.define("x-spacer",OG());return null},HG=new $APP.M(null,"axis","axis",-1215390822),IG=new $APP.M(null,"grow?","grow?",2124334580),FG=new $APP.M(null,"grow-raw",
|
|
6
|
+
"grow-raw",441172903),EG=new $APP.M(null,"axis-raw","axis-raw",291213231);var NG=["size","axis","grow"],GG=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null);$APP.ka("baredom.exports.x_spacer.init",PG);export const init=PG;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},
|
|
4
|
-
$APP.
|
|
2
|
+
var wV=function(a){var b=new $APP.P(null,3,[$APP.rh,a.getAttribute("size"),$APP.Fh,a.getAttribute("variant"),$APP.T,a.getAttribute("label")],null);var c=$APP.N(b),d=$APP.G(c,$APP.rh);b=$APP.G(c,$APP.Fh);c=$APP.G(c,$APP.T);d=typeof d==="string"&&$APP.J(uV,d)?d:"md";b=typeof b==="string"&&$APP.J(vV,b)?b:"default";c=typeof c==="string"&&$APP.O("",c.trim())?c.trim():"Loading";d=$APP.N(new $APP.P(null,3,[$APP.rh,d,$APP.Fh,b,$APP.T,c],null));b=$APP.G(d,$APP.rh);c=$APP.G(d,$APP.Fh);d=$APP.G(d,$APP.T);a.setAttribute("data-size",
|
|
3
|
+
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},xV=function(a){Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.r(b)?b:"md"},set:function(b){return $APP.r(b)?this.setAttribute("size",""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.r(b)?b:"default"},set:function(b){return $APP.r(b)?this.setAttribute("variant",""+
|
|
4
|
+
$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.r(b)?b:"Loading"},set:function(b){return $APP.r(b)?this.setAttribute("label",""+$APP.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},zV=function(){var a=class extends HTMLElement{};a.observedAttributes=yV;a.prototype.connectedCallback=function(){if(!$APP.r($APP.l(this,"__xSpinnerInit"))){var b=this.attachShadow({mode:"open"}),
|
|
5
5
|
c=document.createElement("style"),d=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;justify-content:center;color-scheme:light dark;--x-spinner-size:24px;--x-spinner-color:currentColor;--x-spinner-track-color:rgba(0,0,0,0.12);--x-spinner-thickness:2px;--x-spinner-duration:0.75s;}@media (prefers-color-scheme:dark){:host{--x-spinner-track-color:rgba(255,255,255,0.15);}}:host([data-size\x3d'xs']){--x-spinner-size:16px;}:host([data-size\x3d'sm']){--x-spinner-size:20px;}:host([data-size\x3d'md']){--x-spinner-size:24px;}:host([data-size\x3d'lg']){--x-spinner-size:32px;}:host([data-size\x3d'xl']){--x-spinner-size:48px;}:host([data-variant\x3d'primary']){--x-spinner-color:#3b82f6;}:host([data-variant\x3d'success']){--x-spinner-color:#22c55e;}:host([data-variant\x3d'warning']){--x-spinner-color:#f59e0b;}:host([data-variant\x3d'danger']){--x-spinner-color:#ef4444;}[part\x3dring]{display:block;width:var(--x-spinner-size);height:var(--x-spinner-size);border-radius:50%;border:var(--x-spinner-thickness) solid var(--x-spinner-track-color);border-top-color:var(--x-spinner-color);box-sizing:border-box;animation:x-spinner-spin var(--x-spinner-duration) linear infinite;}@keyframes x-spinner-spin{to{transform:rotate(360deg);}}@media (prefers-reduced-motion:reduce){[part\x3dring]{animation-play-state:paused;}}";
|
|
6
|
-
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}
|
|
7
|
-
customElements.define("x-spinner",
|
|
6
|
+
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}wV(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.r(b?$APP.l(this,"__xSpinnerInit"):b)&&wV(this);return null};xV(a.prototype);return a},AV=function(){$APP.r(customElements.get("x-spinner"))||
|
|
7
|
+
customElements.define("x-spinner",zV());return null};var yV=["size","variant","label"],uV=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),vV=new $APP.R(null,new $APP.P(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null);$APP.ka("baredom.exports.x_spinner.init",AV);export const init=AV;
|
package/dist/x-splash.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var CI=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.r(isNaN(a))?null:$APP.Yg.i(0,$APP.Zg.i(100,a))):null},DI=function(a){return a==null?!0:$APP.O((""+$APP.S.g(a)).trim().toLowerCase(),"false")},II=function(a){var b=$APP.l(a,"__xSplashRefs");if($APP.r(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("div"),
|
|
3
3
|
m=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-splash-bg:#ffffff;--x-splash-color:#0f172a;--x-splash-z-index:9999;--x-splash-fade-duration:400ms;--x-splash-fade-ease:cubic-bezier(0.4,0,0.2,1);--x-splash-spinner-size:40px;--x-splash-spinner-color:currentColor;--x-splash-spinner-track-color:rgba(0,0,0,0.12);--x-splash-spinner-thickness:3px;--x-splash-spinner-duration:0.75s;--x-splash-progress-height:4px;--x-splash-progress-color:#3b82f6;--x-splash-progress-track-color:rgba(0,0,0,0.08);--x-splash-progress-radius:2px;--x-splash-gap:20px;--x-splash-blur-amount:8px;}@media (prefers-color-scheme:dark){:host{--x-splash-bg:#0f172a;--x-splash-color:#f8fafc;--x-splash-spinner-track-color:rgba(255,255,255,0.15);--x-splash-progress-track-color:rgba(255,255,255,0.12);}}[part\x3doverlay]{position:fixed;inset:0;z-index:var(--x-splash-z-index);display:none;align-items:center;justify-content:center;background:var(--x-splash-bg);color:var(--x-splash-color);opacity:0;transition:opacity var(--x-splash-fade-duration) var(--x-splash-fade-ease);}:host([active]) [part\x3doverlay]{display:flex;opacity:1;}:host([data-fading-out]) [part\x3doverlay]{display:flex;opacity:0;}:host([data-variant\x3d'minimal']) [part\x3doverlay]{background:transparent;}:host([data-variant\x3d'branded']) [part\x3doverlay]{background:var(--x-splash-branded-bg,var(--x-splash-bg));}:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(255,255,255,0.7);backdrop-filter:blur(var(--x-splash-blur-amount));-webkit-backdrop-filter:blur(var(--x-splash-blur-amount));}@media (prefers-color-scheme:dark){:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(15,23,42,0.7);}}:host([data-overlay\x3d'transparent']) [part\x3doverlay]{background:transparent;}[part\x3dcontent]{display:flex;flex-direction:column;align-items:center;gap:var(--x-splash-gap);max-width:80vw;text-align:center;}[part\x3dspinner]{display:block;width:var(--x-splash-spinner-size);height:var(--x-splash-spinner-size);border:var(--x-splash-spinner-thickness) solid var(--x-splash-spinner-track-color);border-top-color:var(--x-splash-spinner-color);border-radius:50%;animation:x-splash-spin var(--x-splash-spinner-duration) linear infinite;box-sizing:border-box;}@keyframes x-splash-spin{to{transform:rotate(360deg);}}[part\x3dprogress]{display:none;width:min(300px,60vw);height:var(--x-splash-progress-height);background:var(--x-splash-progress-track-color);border-radius:var(--x-splash-progress-radius);overflow:hidden;}[part\x3dbar]{height:100%;background:var(--x-splash-progress-color);border-radius:var(--x-splash-progress-radius);transition:width 200ms ease;width:0%;}@media (prefers-reduced-motion:reduce){[part\x3doverlay]{transition:none !important;}[part\x3dspinner]{animation:none !important;}[part\x3dbar]{transition:none !important;}}";
|
|
4
|
-
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");k.setAttribute("part","progress");k.setAttribute("role","progressbar");k.setAttribute("aria-valuemin","0");k.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");k.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(k);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.
|
|
5
|
-
m],null);return $APP.l(a,"__xSplashRefs")},
|
|
6
|
-
400},
|
|
7
|
-
else{var b=
|
|
8
|
-
"__xSplashFadeTimer",setTimeout(function(){return $APP.
|
|
9
|
-
null;d=$APP.
|
|
10
|
-
k);p.style.display=$APP.
|
|
11
|
-
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.
|
|
12
|
-
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.
|
|
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");k.setAttribute("part","progress");k.setAttribute("role","progressbar");k.setAttribute("aria-valuemin","0");k.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");k.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(k);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.P(null,6,[$APP.bi,b,EI,d,FI,e,GI,h,$APP.Ei,k,HI,
|
|
5
|
+
m],null);return $APP.l(a,"__xSplashRefs")},JI=function(a){a=typeof a==="string"?a.trim():"";return $APP.D.i(a,"")||$APP.D.i(a,"0")||$APP.D.i(a,"0ms")||$APP.D.i(a,"0s")?0:$APP.r(a.endsWith("ms"))?(a=parseFloat(a.slice(0,a.length-2)),$APP.r(isNaN(a))?0:Math.max(0,Math.round(a))):$APP.r(a.endsWith("s"))?(a=parseFloat(a.slice(0,a.length-1)),$APP.r(isNaN(a))?0:Math.max(0,Math.round(1E3*a))):0},KI=function(a){a=window.getComputedStyle(a);a=JI(a.getPropertyValue("--x-splash-fade-duration"));return a>0?a:
|
|
6
|
+
400},LI=function(a){var b=$APP.l(a,"__xSplashFadeTimer");$APP.r(b)&&(clearTimeout(b),a.__xSplashFadeTimer=null)},MI=function(a){LI(a);a.__xSplashFadingOut=!1;a.removeAttribute("data-fading-out");var b=II(a);b=$APP.N(b);$APP.G(b,EI).style.display="none";a.removeAttribute("aria-busy");b=new CustomEvent("x-splash-hidden",{detail:{},bubbles:!0,composed:!0,cancelable:!1});a.dispatchEvent(b);return null},NI=function(a){if(!$APP.r($APP.l(a,"__xSplashFadingOut")))if(a.__xSplashFadingOut=!0,$APP.I(window.matchMedia("(prefers-reduced-motion:reduce)").matches))MI(a);
|
|
7
|
+
else{var b=II(a);b=$APP.N(b);var c=$APP.G(b,EI),d=function h(g){return $APP.D.i(g.target,c)&&$APP.D.i(g.propertyName,"opacity")?(c.removeEventListener("transitionend",h),$APP.r($APP.l(a,"__xSplashFadingOut"))?MI(a):null):null};c.style.display="flex";c.style.opacity="1";a.setAttribute("data-fading-out","");c.addEventListener("transitionend",d);requestAnimationFrame(function(){return requestAnimationFrame(function(){return $APP.r($APP.l(a,"__xSplashFadingOut"))?c.style.opacity="0":null})});$APP.n(a,
|
|
8
|
+
"__xSplashFadeTimer",setTimeout(function(){return $APP.r($APP.l(a,"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),MI(a)):null},KI(a)+60))}},WI=function(a){var b=new $APP.P(null,5,[OI,a.hasAttribute("active"),$APP.Ak,a.getAttribute("variant"),$APP.tj,a.getAttribute("progress"),PI,a.getAttribute("spinner"),QI,a.getAttribute("overlay")],null);var c=$APP.N(b);b=$APP.G(c,OI);var d=$APP.G(c,$APP.Ak),e=$APP.G(c,$APP.tj),g=$APP.G(c,PI);c=$APP.G(c,QI);b=$APP.I(b);d=typeof d==="string"?d.trim().toLowerCase():
|
|
9
|
+
null;d=$APP.J(RI,d)?d:"default";e=CI(e);g=DI(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.J(SI,c)?c:"solid";b=new $APP.P(null,5,[TI,b,$APP.Fh,d,$APP.dl,e,UI,g,VI,c],null);if($APP.O($APP.l(a,"__xSplashModel"),b)){b=$APP.N(b);c=$APP.G(b,TI);e=$APP.G(b,$APP.Fh);d=$APP.G(b,$APP.dl);var h=$APP.G(b,UI),k=$APP.G(b,VI);g=II(a);var m=$APP.N(g);g=$APP.G(m,EI);var p=$APP.G(m,GI),q=$APP.G(m,$APP.Ei),w=$APP.G(m,HI);m=$APP.l(a,"__xSplashModel");var x=TI.g(m);a.setAttribute("data-variant",e);a.setAttribute("data-overlay",
|
|
10
|
+
k);p.style.display=$APP.r(h)?"block":"none";d!=null?(q.style.display="block",w.style.width=""+$APP.S.g(d)+"%",q.setAttribute("aria-valuenow",""+$APP.S.g(d))):(q.style.display="none",q.removeAttribute("aria-valuenow"));$APP.r($APP.r(c)?$APP.t(x):c)?($APP.r($APP.l(a,"__xSplashFadingOut"))&&(LI(a),a.__xSplashFadingOut=!1,a.removeAttribute("data-fading-out"),c=II(a),c=$APP.N(c),c=$APP.G(c,EI),c.style.display="",c.style.opacity=""),a.setAttribute("aria-busy","true"),a.setAttribute("aria-live","polite"),
|
|
11
|
+
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.t(c),$APP.r(e?x:e)?NI(a):$APP.t(c)&&m==null&&(g.style.display="none",a.removeAttribute("aria-busy")));$APP.r(a.hasAttribute("aria-label"))||a.setAttribute("aria-label","Loading");a.__xSplashModel=b}},XI=function(a){Object.defineProperty(a,"active",{get:function(){return this.hasAttribute("active")},set:function(b){return $APP.r(b)?this.setAttribute("active",""):this.removeAttribute("active")},enumerable:!0,configurable:!0});
|
|
12
|
+
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.r(b)?b:"default"},set:function(b){return $APP.r(b)?this.setAttribute("variant",""+$APP.S.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"progress",{get:function(){return CI(this.getAttribute("progress"))},set:function(b){return b==null?this.removeAttribute("progress"):this.setAttribute("progress",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
13
|
+
"spinner",{get:function(){return DI(this.getAttribute("spinner"))},set:function(b){return $APP.r(b)?this.setAttribute("spinner",""):this.setAttribute("spinner","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"overlay",{get:function(){var b=this.getAttribute("overlay");return $APP.r(b)?b:"solid"},set:function(b){return $APP.r(b)?this.setAttribute("overlay",""+$APP.S.g(b)):this.removeAttribute("overlay")},enumerable:!0,configurable:!0})},ZI=function(){var a=class extends HTMLElement{};
|
|
14
|
+
a.observedAttributes=YI;a.prototype.connectedCallback=function(){II(this);LI(this);WI(this);return null};a.prototype.disconnectedCallback=function(){LI(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&WI(this);return null};XI(a.prototype);return a},$I=function(){$APP.r(customElements.get("x-splash"))||customElements.define("x-splash",ZI());return null},EI=new $APP.M(null,"overlay-el","overlay-el",-308547109),FI=new $APP.M(null,"content-el","content-el",-1423019925),
|
|
15
|
+
GI=new $APP.M(null,"spinner-el","spinner-el",-1536400516),HI=new $APP.M(null,"bar-el","bar-el",2050414242),UI=new $APP.M(null,"spinner?","spinner?",939139177),TI=new $APP.M(null,"active?","active?",459499776),OI=new $APP.M(null,"active-present?","active-present?",73064660),PI=new $APP.M(null,"spinner-attr","spinner-attr",-479327548),QI=new $APP.M(null,"overlay-raw","overlay-raw",1018775670),VI=new $APP.M(null,"overlay","overlay",-139131598);var YI=["active","variant","progress","spinner","overlay"];$APP.Sd(["x-splash-hidden",new $APP.P(null,2,[$APP.U,$APP.Td,$APP.kl,!1],null)]);var RI=new $APP.R(null,new $APP.P(null,3,["minimal",null,"branded",null,"default",null],null),null),SI=new $APP.R(null,new $APP.P(null,3,["transparent",null,"solid",null,"blur",null],null),null);$APP.ka("baredom.exports.x_splash.init",$I);export const init=$I;
|