@vanelsas/baredom 2.4.1 → 2.5.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 +11 -0
- package/README.md +83 -5
- package/custom-elements.json +7338 -0
- package/dist/baredom.d.ts +97 -0
- package/dist/base.js +53 -53
- package/dist/integrity.json +87 -87
- package/dist/x-alert.d.ts +43 -0
- package/dist/x-alert.js +16 -16
- package/dist/x-avatar-group.d.ts +18 -0
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.d.ts +21 -0
- package/dist/x-avatar.js +2 -2
- package/dist/x-badge.d.ts +19 -0
- package/dist/x-badge.js +7 -7
- package/dist/x-bento-grid.d.ts +12 -0
- package/dist/x-bento-grid.js +2 -2
- package/dist/x-bento-item.d.ts +12 -0
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.d.ts +20 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.d.ts +45 -0
- package/dist/x-button.js +4 -4
- package/dist/x-cancel-dialogue.d.ts +50 -0
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.d.ts +39 -0
- package/dist/x-card.js +3 -3
- package/dist/x-carousel.d.ts +48 -0
- package/dist/x-carousel.js +28 -28
- package/dist/x-chart.d.ts +23 -0
- package/dist/x-chart.js +28 -28
- package/dist/x-checkbox.d.ts +45 -0
- package/dist/x-checkbox.js +6 -6
- package/dist/x-chip.d.ts +41 -0
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.d.ts +42 -0
- package/dist/x-collapse.js +1 -1
- package/dist/x-color-picker.d.ts +47 -0
- package/dist/x-color-picker.js +40 -40
- package/dist/x-combobox.d.ts +46 -0
- package/dist/x-combobox.js +24 -24
- package/dist/x-command-palette.d.ts +46 -0
- package/dist/x-command-palette.js +24 -24
- package/dist/x-container.d.ts +14 -0
- package/dist/x-container.js +2 -2
- package/dist/x-context-menu.d.ts +17 -0
- package/dist/x-context-menu.js +9 -9
- package/dist/x-copy.d.ts +51 -0
- package/dist/x-copy.js +6 -6
- package/dist/x-currency-field.d.ts +51 -0
- package/dist/x-currency-field.js +9 -8
- package/dist/x-date-picker.d.ts +20 -0
- package/dist/x-date-picker.js +8 -8
- package/dist/x-divider.d.ts +20 -0
- package/dist/x-divider.js +3 -3
- package/dist/x-drawer.d.ts +44 -0
- package/dist/x-drawer.js +3 -3
- package/dist/x-dropdown.d.ts +42 -0
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.d.ts +14 -0
- package/dist/x-fieldset.js +2 -2
- package/dist/x-file-download.d.ts +40 -0
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.d.ts +46 -0
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.d.ts +47 -0
- package/dist/x-form-field.js +6 -6
- package/dist/x-form.d.ts +41 -0
- package/dist/x-form.js +3 -3
- package/dist/x-gaussian-blur.d.ts +20 -0
- package/dist/x-gaussian-blur.js +6 -6
- package/dist/x-grid.d.ts +12 -0
- package/dist/x-grid.js +3 -3
- package/dist/x-icon.d.ts +15 -0
- package/dist/x-icon.js +2 -2
- package/dist/x-image.d.ts +48 -0
- package/dist/x-image.js +6 -6
- package/dist/x-kinetic-font.d.ts +48 -0
- package/dist/x-kinetic-font.js +11 -11
- package/dist/x-kinetic-typography.d.ts +27 -0
- package/dist/x-kinetic-typography.js +20 -20
- package/dist/x-liquid-dock.d.ts +47 -0
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.d.ts +46 -0
- package/dist/x-liquid-fill.js +18 -18
- package/dist/x-liquid-glass.d.ts +25 -0
- package/dist/x-liquid-glass.js +10 -10
- package/dist/x-menu-item.d.ts +41 -0
- package/dist/x-menu.d.ts +42 -0
- package/dist/x-menu.js +1 -1
- package/dist/x-metaball-cursor.d.ts +21 -0
- package/dist/x-metaball-cursor.js +9 -9
- package/dist/x-modal.d.ts +44 -0
- package/dist/x-modal.js +2 -2
- package/dist/x-morph-stack.d.ts +46 -0
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.d.ts +46 -0
- package/dist/x-navbar.js +3 -3
- package/dist/x-neural-glow.d.ts +22 -0
- package/dist/x-neural-glow.js +2 -2
- package/dist/x-notification-center.d.ts +42 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.d.ts +19 -0
- package/dist/x-organic-progress.d.ts +45 -0
- package/dist/x-organic-progress.js +9 -9
- package/dist/x-organic-shape.d.ts +18 -0
- package/dist/x-pagination.d.ts +44 -0
- package/dist/x-pagination.js +1 -1
- package/dist/x-particle-button.d.ts +47 -0
- package/dist/x-particle-button.js +7 -7
- package/dist/x-popover.d.ts +45 -0
- package/dist/x-popover.js +23 -23
- package/dist/x-progress-circle.d.ts +41 -0
- package/dist/x-progress-circle.js +3 -3
- package/dist/x-progress.d.ts +44 -0
- package/dist/x-progress.js +3 -3
- package/dist/x-radio.d.ts +44 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.d.ts +42 -0
- package/dist/x-ripple-effect.js +5 -5
- package/dist/x-scroll-parallax.d.ts +45 -0
- package/dist/x-scroll-parallax.js +3 -3
- package/dist/x-scroll-stack.d.ts +46 -0
- package/dist/x-scroll-stack.js +6 -6
- package/dist/x-scroll-story.d.ts +56 -0
- package/dist/x-scroll-story.js +14 -14
- package/dist/x-scroll-timeline.d.ts +58 -0
- package/dist/x-scroll-timeline.js +43 -43
- package/dist/x-scroll.d.ts +51 -0
- package/dist/x-scroll.js +14 -14
- package/dist/x-search-field.d.ts +47 -0
- package/dist/x-search-field.js +15 -14
- package/dist/x-select.d.ts +40 -0
- package/dist/x-select.js +3 -3
- package/dist/x-sidebar.d.ts +40 -0
- package/dist/x-sidebar.js +8 -8
- package/dist/x-skeleton-group.d.ts +15 -0
- package/dist/x-skeleton-group.js +5 -5
- package/dist/x-skeleton.d.ts +16 -0
- package/dist/x-slider.d.ts +48 -0
- package/dist/x-slider.js +5 -5
- package/dist/x-soft-body.d.ts +44 -0
- package/dist/x-soft-body.js +5 -5
- package/dist/x-spacer.d.ts +15 -0
- package/dist/x-spacer.js +1 -1
- package/dist/x-spinner.d.ts +15 -0
- package/dist/x-splash.d.ts +42 -0
- package/dist/x-splash.js +3 -3
- package/dist/x-stat.d.ts +21 -0
- package/dist/x-stat.js +6 -6
- package/dist/x-stepper.d.ts +42 -0
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.d.ts +44 -0
- package/dist/x-switch.js +5 -5
- package/dist/x-tab.d.ts +40 -0
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.d.ts +50 -0
- package/dist/x-table-cell.js +5 -5
- package/dist/x-table-row.d.ts +43 -0
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.d.ts +124 -0
- package/dist/x-table.js +3 -3
- package/dist/x-tabs.d.ts +70 -0
- package/dist/x-tabs.js +2 -2
- package/dist/x-text-area.d.ts +47 -0
- package/dist/x-text-area.js +7 -7
- package/dist/x-theme.d.ts +15 -0
- package/dist/x-timeline-item.d.ts +46 -0
- package/dist/x-timeline-item.js +19 -19
- package/dist/x-timeline.d.ts +78 -0
- package/dist/x-timeline.js +3 -3
- package/dist/x-toast.d.ts +45 -0
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.d.ts +41 -0
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.d.ts +43 -0
- package/dist/x-tooltip.js +12 -12
- package/dist/x-typography.d.ts +16 -0
- package/dist/x-typography.js +1 -1
- package/dist/x-welcome-tour.d.ts +92 -0
- package/dist/x-welcome-tour.js +56 -56
- package/package.json +502 -392
package/dist/x-menu.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// x-menu.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XMenuEventMap {
|
|
6
|
+
"x-menu-open": CustomEvent<{}>;
|
|
7
|
+
"x-menu-close": CustomEvent<{}>;
|
|
8
|
+
"x-menu-select": CustomEvent<{ value: string }>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface XMenu extends HTMLElement {
|
|
12
|
+
open: boolean;
|
|
13
|
+
placement: string;
|
|
14
|
+
label: string;
|
|
15
|
+
|
|
16
|
+
addEventListener<K extends keyof XMenuEventMap>(
|
|
17
|
+
type: K,
|
|
18
|
+
listener: (this: XMenu, ev: XMenuEventMap[K]) => any,
|
|
19
|
+
options?: boolean | AddEventListenerOptions
|
|
20
|
+
): void;
|
|
21
|
+
addEventListener(
|
|
22
|
+
type: string,
|
|
23
|
+
listener: EventListenerOrEventListenerObject,
|
|
24
|
+
options?: boolean | AddEventListenerOptions
|
|
25
|
+
): void;
|
|
26
|
+
removeEventListener<K extends keyof XMenuEventMap>(
|
|
27
|
+
type: K,
|
|
28
|
+
listener: (this: XMenu, ev: XMenuEventMap[K]) => any,
|
|
29
|
+
options?: boolean | EventListenerOptions
|
|
30
|
+
): void;
|
|
31
|
+
removeEventListener(
|
|
32
|
+
type: string,
|
|
33
|
+
listener: EventListenerOrEventListenerObject,
|
|
34
|
+
options?: boolean | EventListenerOptions
|
|
35
|
+
): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
interface HTMLElementTagNameMap {
|
|
40
|
+
"x-menu": XMenu;
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/x-menu.js
CHANGED
|
@@ -2,7 +2,7 @@ import { $APP, shadow$provide } from "./base.js";
|
|
|
2
2
|
var dO=function(a){a=a.querySelectorAll("x-menu-item");for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d];$APP.r(e.hasAttribute("disabled"))&&$APP.N(e.getAttribute("type"),"divider")&&b.push(e);d+=1}else break;return b},eO=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0}))},hO=function(a){$APP.n(a.hasAttribute("open"))||(a.setAttribute("open",""),eO(a,"x-menu-open",{}));if($APP.n(null)){a=dO(a);var b=a.length;return b>0?$APP.B.i(null,fO)?a[0].focus():$APP.B.i(null,
|
|
3
3
|
gO)?a[b-1].focus():null:null}return null},iO=function(a,b){$APP.n(a.hasAttribute("open"))&&(a.removeAttribute("open"),eO(a,"x-menu-close",{}));return $APP.n(b)?(a=$APP.k(a,"__xMenuRefs"),a=$APP.n(a)?$APP.k(a,"trigger-slot"):null,a=$APP.n(a)?a.assignedElements():null,a=$APP.n($APP.n(a)?a.length>0:a)?a[0]:null,$APP.n(a)?a.focus():null):null},jO=function(a,b){var c=b.composedPath();a=$APP.vc(a.assignedElements());return $APP.F($APP.Td(function(d){return c.indexOf(d)>-1},a))},kO=function(a,b){var c=b.key,
|
|
4
4
|
d=a.hasAttribute("open");if($APP.B.i(c,"Escape"))return $APP.n(d)?(b.preventDefault(),iO(a,!0)):null;if($APP.B.i(c,"Tab"))return $APP.n(d)?iO(a,!1):null;if($APP.B.i(c,"ArrowDown")||$APP.B.i(c,"ArrowUp")){var e=dO(a),g=e.length;if(g>0){b.preventDefault();if($APP.n(d))return a=e.indexOf(document.activeElement),c=$APP.B.i(c,"ArrowDown")?a>=g-1?0:a<0?0:a+1:a<=0?g-1:a-1,e[c].focus();hO(a);return e[$APP.B.i(c,"ArrowDown")?0:g-1].focus()}}else if($APP.B.i(c,"Home")){if($APP.n(d)&&(e=dO(a),e.length>0))return b.preventDefault(),
|
|
5
|
-
e[0].focus()}else if($APP.B.i(c,"End")&&$APP.n(d)&&(e=dO(a),e.length>0))return b.preventDefault(),e[e.length-1].focus();return null},mO=function(a){var b=$APP.k(a,"__xMenuRefs");b=$APP.n(b)?$APP.k(b,"popup"):null;a=new $APP.R(null,3,[$APP.
|
|
5
|
+
e[0].focus()}else if($APP.B.i(c,"End")&&$APP.n(d)&&(e=dO(a),e.length>0))return b.preventDefault(),e[e.length-1].focus();return null},mO=function(a){var b=$APP.k(a,"__xMenuRefs");b=$APP.n(b)?$APP.k(b,"popup"):null;a=new $APP.R(null,3,[$APP.hm,a.hasAttribute("open"),$APP.Qj,a.getAttribute("placement"),$APP.U,a.getAttribute("label")],null);a=$APP.M(a);var c=$APP.D(a,$APP.hm),d=$APP.D(a,$APP.Qj);a=$APP.D(a,$APP.U);c=$APP.F(c);d=$APP.n(d)?d:"";d=$APP.I(lO,d)?d:"bottom-start";a=new $APP.R(null,3,[$APP.hm,
|
|
6
6
|
c,$APP.Qj,d,$APP.U,$APP.n(a)?a:""],null);return $APP.n(b)?(b.setAttribute("data-placement",$APP.Qj.g(a)),a=$APP.U.g(a),$APP.n($APP.n(a)?$APP.N(a,""):a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")):null},nO=function(a){function b(h){h.stopPropagation();h=h.detail.value;iO(a,!1);return eO(a,"x-menu-select",{value:$APP.n(h)?h:""})}function c(h){return kO(a,h)}function d(h){$APP.n(a.hasAttribute("open"))?(h=h.composedPath(),h=$APP.B.i(-1,h.indexOf(a))?iO(a,!1):null):h=null;return h}
|
|
7
7
|
function e(h){var l=$APP.k(a,"__xMenuRefs");l=$APP.n(l)?$APP.k(l,"trigger-slot"):null;return $APP.n($APP.n(l)?jO(l,h):l)?$APP.n(a.hasAttribute("open"))?iO(a,!0):hO(a):null}var g={};a.addEventListener("click",e);document.addEventListener("click",d,!0);a.addEventListener("keydown",c);a.addEventListener("x-menu-item-select",b);g.click=e;g["doc-click"]=d;g.keydown=c;g["item-select"]=b;a.__xMenuHandlers=g},oO=function(a){Object.defineProperty(a.prototype,"open",{get:function(){return this.hasAttribute("open")},
|
|
8
8
|
set:function(b){return $APP.n(b)?this.setAttribute("open",""):this.removeAttribute("open")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"placement",{get:function(){return this.getAttribute("placement")},set:function(b){return $APP.n(b)?this.setAttribute("placement",b):this.removeAttribute("placement")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"label",{get:function(){return this.getAttribute("label")},set:function(b){return $APP.n(b)?this.setAttribute("label",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// x-metaball-cursor.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XMetaballCursor extends HTMLElement {
|
|
6
|
+
color: string;
|
|
7
|
+
blobSize: number;
|
|
8
|
+
noiseIntensity: number;
|
|
9
|
+
palette: string;
|
|
10
|
+
noiseScale: number;
|
|
11
|
+
noise: boolean;
|
|
12
|
+
threshold: string;
|
|
13
|
+
noiseSpeed: number;
|
|
14
|
+
blobCount: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"x-metaball-cursor": XMetaballCursor;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -2,8 +2,8 @@ import { $APP, shadow$provide } from "./base.js";
|
|
|
2
2
|
var $J=function(a){if(typeof a==="string"){a=parseInt(a.trim(),10);var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?5:Math.min(10,Math.max(2,a))}return 5},aK=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?40:Math.min(200,Math.max(10,a))}return 40},bK=function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"#6366f1"},cK=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?
|
|
3
3
|
3:Math.min(20,Math.max(.5,a))}return 3},dK=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?.02:Math.min(.1,Math.max(.001,a))}return.02},eK=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?6:Math.min(30,Math.max(1,a))}return 6},fK=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?12:Math.min(40,Math.max(4,a))}return 12},gK=
|
|
4
4
|
function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10"},iK=function(a){if(typeof a==="string"&&a.trim().length>0){var b=$APP.D(hK,a.trim().toLowerCase());if($APP.n(b))return b;if(a.indexOf(",")>=0)return a=a.split(","),$APP.We.m($APP.fe,$APP.th.i($APP.ae.g(function(c){return c.trim()}),$APP.ce(function(c){return c.length>0})),a)}return null},jK=function(a){for(var b=[],c=0;;)if(c<a)b.push(Math.max(.01,.35*Math.pow(.45,c))),c+=1;else break;
|
|
5
|
-
return b},kK=function(a,b){for(var c=[],d=0;;)if(d<b)c.push(Math.max(a*.5,a*(1-d*.08))),d+=1;else break;return c},lK=function(a,b,c){return a+(b-a)*c},AK=function(a){a=$APP.zf([$APP.
|
|
6
|
-
var b=$APP.M(a),c=$APP.D(b,sK);a=$APP.D(b,$APP.
|
|
5
|
+
return b},kK=function(a,b){for(var c=[],d=0;;)if(d<b)c.push(Math.max(a*.5,a*(1-d*.08))),d+=1;else break;return c},lK=function(a,b,c){return a+(b-a)*c},AK=function(a){a=$APP.zf([$APP.pm,mK,nK,oK,pK,qK,$APP.Wh,$APP.fn,rK,sK],[a.getAttribute("blur"),a.getAttribute("noise-intensity"),a.getAttribute("blob-size"),a.getAttribute("palette"),a.getAttribute("noise-scale"),a.getAttribute("noise"),a.getAttribute("threshold"),a.getAttribute("color"),a.getAttribute("blob-count"),a.getAttribute("noise-speed")]);
|
|
6
|
+
var b=$APP.M(a),c=$APP.D(b,sK);a=$APP.D(b,$APP.pm);var d=$APP.D(b,mK),e=$APP.D(b,nK),g=$APP.D(b,oK),h=$APP.D(b,pK),l=$APP.D(b,qK),m=$APP.D(b,$APP.Wh),p=$APP.D(b,$APP.fn);b=$APP.D(b,rK);b=$J(b);p=bK(p);g=iK(g);c=dK(c);var q=[];if($APP.n($APP.n(g)?$APP.z(g)>0:g))for(var v=$APP.z(g),x=0;;)if(x<b)q.push($APP.pc(g,$APP.fd(x,v))),x+=1;else break;else for(v=0;;)if(v<b)q.push(p),v+=1;else break;return $APP.zf([$APP.Oj,tK,uK,$APP.qm,$APP.Tl,vK,wK,$APP.ki,xK,yK,zK],[p,g,c,q,gK(m),cK(h),b,fK(a),aK(e),l!=null,
|
|
7
7
|
eK(d)])},BK=function(a,b){b=$APP.M(b);b=$APP.D(b,$APP.Oj);return a.style.setProperty("--x-metaball-cursor-color",b)},DK=function(a){$APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)||(a.__xMetaballSeed=0,$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return CK(a)})))},EK=function(a){function b(c){var d=$APP.mj.g($APP.k(a,"__xMetaballRefs"));if($APP.n(d)){d=d.getBoundingClientRect();var e=$APP.k(a,"__xMetaballMouse");e.x=c.clientX-d.left;e.y=c.clientY-d.top}return null}
|
|
8
8
|
window.addEventListener("pointermove",b);a.__xMetaballHandler=b},FK=function(a){var b=$APP.k(a,"__xMetaballHandler");$APP.n(b)&&(window.removeEventListener("pointermove",b),a.__xMetaballHandler=null)},GK=function(a){Object.defineProperty(a,"blobCount",{get:function(){return $J(this.getAttribute("blob-count"))},set:function(b){return b==null?this.removeAttribute("blob-count"):this.setAttribute("blob-count",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blobSize",{get:function(){return aK(this.getAttribute("blob-size"))},
|
|
9
9
|
set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribute("blob-size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color",{get:function(){return bK(this.getAttribute("color"))},set:function(b){return b==null?this.removeAttribute("color"):this.setAttribute("color",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noise",{get:function(){return this.hasAttribute("noise")},set:function(b){return $APP.n(b)?this.setAttribute("noise",
|
|
@@ -11,18 +11,18 @@ set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribu
|
|
|
11
11
|
""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseIntensity",{get:function(){return eK(this.getAttribute("noise-intensity"))},set:function(b){return b==null?this.removeAttribute("noise-intensity"):this.setAttribute("noise-intensity",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blur",{get:function(){return fK(this.getAttribute("blur"))},set:function(b){return b==null?this.removeAttribute("blur"):this.setAttribute("blur",""+$APP.T.g(b))},enumerable:!0,
|
|
12
12
|
configurable:!0});Object.defineProperty(a,"threshold",{get:function(){return gK(this.getAttribute("threshold"))},set:function(b){return b==null?this.removeAttribute("threshold"):this.setAttribute("threshold",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"palette",{get:function(){return iK(this.getAttribute("palette"))},set:function(b){return b==null||$APP.B.i("",b)?this.removeAttribute("palette"):this.setAttribute("palette",""+$APP.T.g(b))},enumerable:!0,configurable:!0})},
|
|
13
13
|
KK=function(){var a=class extends HTMLElement{};a.observedAttributes=HK;a.prototype.connectedCallback=function(){var b=AK(this);this.__xMetaballModel=b;this.__xMetaballMouse={x:0,y:0};if(!$APP.n($APP.k(this,"__xMetaballRefs"))){var c=$APP.k(this,"__xMetaballModel"),d=IK[0];IK[0]=d+1;var e="mb-"+$APP.T.g(d),g=this.attachShadow({mode:"open"}),h=document.createElement("style"),l=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");this.__xMetaballUid=d;h.textContent=
|
|
14
|
-
JK;l.setAttribute("part","viewport");l.style.filter="url(#"+$APP.T.g(e)+")";m.style.position="absolute";m.style.width="0";m.style.height="0";m.style.overflow="hidden";var p=$APP.M(c);c=$APP.D(p,$APP.ki);d=$APP.D(p,$APP.
|
|
14
|
+
JK;l.setAttribute("part","viewport");l.style.filter="url(#"+$APP.T.g(e)+")";m.style.position="absolute";m.style.width="0";m.style.height="0";m.style.overflow="hidden";var p=$APP.M(c);c=$APP.D(p,$APP.ki);d=$APP.D(p,$APP.Tl);var q=$APP.D(p,yK),v=$APP.D(p,vK);p=$APP.D(p,zK);var x=document.createElementNS("http://www.w3.org/2000/svg","defs"),y=document.createElementNS("http://www.w3.org/2000/svg","filter"),A=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),C=document.createElementNS("http://www.w3.org/2000/svg",
|
|
15
15
|
"feColorMatrix"),E=document.createElementNS("http://www.w3.org/2000/svg","feTurbulence"),H=document.createElementNS("http://www.w3.org/2000/svg","feDisplacementMap");y.setAttribute("id",e);y.setAttribute("x","-20%");y.setAttribute("y","-20%");y.setAttribute("width","140%");y.setAttribute("height","140%");A.setAttribute("in","SourceGraphic");A.setAttribute("stdDeviation",""+$APP.T.g(c));A.setAttribute("result","blur");C.setAttribute("in","blur");C.setAttribute("type","matrix");C.setAttribute("values",
|
|
16
16
|
d);C.setAttribute("result","threshold");E.setAttribute("type","fractalNoise");E.setAttribute("baseFrequency",""+$APP.T.g(.01*v));E.setAttribute("numOctaves","3");E.setAttribute("seed","0");E.setAttribute("result","noise");H.setAttribute("in","threshold");H.setAttribute("in2","noise");H.setAttribute("scale",$APP.n(q)?""+$APP.T.g(p):"0");H.setAttribute("xChannelSelector","R");H.setAttribute("yChannelSelector","G");y.appendChild(A);y.appendChild(C);y.appendChild(E);y.appendChild(H);x.appendChild(y);
|
|
17
|
-
m.appendChild(x);e=new $APP.R(null,5,[$APP.
|
|
17
|
+
m.appendChild(x);e=new $APP.R(null,5,[$APP.jl,y,$APP.nj,A,$APP.Um,C,$APP.Ol,E,$APP.Mj,H],null);l.appendChild(m);g.appendChild(h);g.appendChild(l);this.__xMetaballRefs=$APP.Rf($APP.uc([e,new $APP.R(null,3,[$APP.Hi,g,$APP.mj,l,$APP.mk,m],null)]))}g=$APP.k(this,"__xMetaballBlobs");if($APP.n(g)){h=g.length;for(l=0;;)if(l<h)m=g[l],$APP.n(m.parentNode)&&m.parentNode.removeChild(m),l+=1;else break;this.__xMetaballBlobs=[];this.__xMetaballPos=[]}h=$APP.M(b);g=$APP.D(h,wK);m=$APP.D(h,xK);h=$APP.D(h,$APP.qm);
|
|
18
18
|
l=$APP.M($APP.k(this,"__xMetaballRefs"));l=$APP.D(l,$APP.mj);m=kK(m,g);e=[];c=[];for(d=0;;)if(d<g)q=document.createElement("div"),v=m[d],q.className="blob",q.style.width=""+$APP.T.g(v)+"px",q.style.height=""+$APP.T.g(v)+"px",q.style.background=h[d],l.appendChild(q),e.push(q),c.push({x:0,y:0}),d+=1;else break;this.__xMetaballBlobs=e;this.__xMetaballPos=c;this.__xMetaballSpeeds=jK(g);BK(this,b);this.setAttribute("aria-hidden","true");this.setAttribute("role","presentation");FK(this);EK(this);DK(this);
|
|
19
|
-
return null};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMetaballRaf");$APP.n(b)&&(cancelAnimationFrame(b),this.__xMetaballRaf=null);FK(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){if($APP.N(c,d)&&(this.__xMetaballModel=b=AK(this),$APP.n($APP.k(this,"__xMetaballRefs")))){d=$APP.M(b);c=$APP.D(d,wK);var e=$APP.D(d,xK);d=$APP.D(d,$APP.
|
|
20
|
-
"__xMetaballPos"),m=g.length;e=kK(e,c);for(var p=m;;)if(p<c){var q=document.createElement("div");q.className="blob";h.appendChild(q);g.push(q);l.push({x:0,y:0});p+=1}else break;for(h=m;;)if(h>c)m=g.pop(),l.pop(),$APP.n(m.parentNode)&&m.parentNode.removeChild(m),--h;else break;for(l=0;;)if(l<c)h=g[l],m=e[l],h.style.width=""+$APP.T.g(m)+"px",h.style.height=""+$APP.T.g(m)+"px",h.style.background=d[l],l+=1;else break;this.__xMetaballSpeeds=jK(c);g=$APP.M(b);h=$APP.D(g,$APP.ki);e=$APP.D(g,$APP.
|
|
21
|
-
yK);d=$APP.D(g,vK);g=$APP.D(g,zK);l=$APP.k(this,"__xMetaballRefs");m=$APP.nj.g(l);$APP.n(m)&&m.setAttribute("stdDeviation",""+$APP.T.g(h));h=$APP.
|
|
19
|
+
return null};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMetaballRaf");$APP.n(b)&&(cancelAnimationFrame(b),this.__xMetaballRaf=null);FK(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){if($APP.N(c,d)&&(this.__xMetaballModel=b=AK(this),$APP.n($APP.k(this,"__xMetaballRefs")))){d=$APP.M(b);c=$APP.D(d,wK);var e=$APP.D(d,xK);d=$APP.D(d,$APP.qm);var g=$APP.M($APP.k(this,"__xMetaballRefs")),h=$APP.D(g,$APP.mj);g=$APP.k(this,"__xMetaballBlobs");var l=$APP.k(this,
|
|
20
|
+
"__xMetaballPos"),m=g.length;e=kK(e,c);for(var p=m;;)if(p<c){var q=document.createElement("div");q.className="blob";h.appendChild(q);g.push(q);l.push({x:0,y:0});p+=1}else break;for(h=m;;)if(h>c)m=g.pop(),l.pop(),$APP.n(m.parentNode)&&m.parentNode.removeChild(m),--h;else break;for(l=0;;)if(l<c)h=g[l],m=e[l],h.style.width=""+$APP.T.g(m)+"px",h.style.height=""+$APP.T.g(m)+"px",h.style.background=d[l],l+=1;else break;this.__xMetaballSpeeds=jK(c);g=$APP.M(b);h=$APP.D(g,$APP.ki);e=$APP.D(g,$APP.Tl);c=$APP.D(g,
|
|
21
|
+
yK);d=$APP.D(g,vK);g=$APP.D(g,zK);l=$APP.k(this,"__xMetaballRefs");m=$APP.nj.g(l);$APP.n(m)&&m.setAttribute("stdDeviation",""+$APP.T.g(h));h=$APP.Um.g(l);$APP.n(h)&&h.setAttribute("values",e);e=$APP.Ol.g(l);$APP.n(e)&&e.setAttribute("baseFrequency",""+$APP.T.g(.01*d));d=$APP.Mj.g(l);$APP.n(d)&&d.setAttribute("scale",$APP.n(c)?""+$APP.T.g(g):"0");return BK(this,b)}return null};GK(a.prototype);return a},LK=function(){$APP.n(customElements.get("x-metaball-cursor"))||customElements.define("x-metaball-cursor",
|
|
22
22
|
KK());return null},pK=new $APP.K(null,"noise-scale-raw","noise-scale-raw",123215597),mK=new $APP.K(null,"noise-intensity-raw","noise-intensity-raw",-116633534),yK=new $APP.K(null,"noise?","noise?",-38350370),xK=new $APP.K(null,"blob-size","blob-size",-1862159046),vK=new $APP.K(null,"noise-scale","noise-scale",-2033475279),qK=new $APP.K(null,"noise-attr","noise-attr",-1534959409),oK=new $APP.K(null,"palette-raw","palette-raw",-1398782582),tK=new $APP.K(null,"palette","palette",-456203511),rK=new $APP.K(null,
|
|
23
23
|
"blob-count-raw","blob-count-raw",-1850938603),sK=new $APP.K(null,"noise-speed-raw","noise-speed-raw",1761342974),uK=new $APP.K(null,"noise-speed","noise-speed",866692139),wK=new $APP.K(null,"blob-count","blob-count",-248711053),zK=new $APP.K(null,"noise-intensity","noise-intensity",747731519),nK=new $APP.K(null,"blob-size-raw","blob-size-raw",530207878);var HK="blob-count blob-size color noise noise-scale noise-speed noise-intensity blur threshold palette".split(" ");
|
|
24
|
-
$APP.zf([$APP.Oj,new $APP.K(null,"blobSize","blobSize",-64083896),new $APP.K(null,"noiseIntensity","noiseIntensity",-792053623),tK,new $APP.K(null,"noiseScale","noiseScale",2003002730),new $APP.K(null,"noise","noise",-994696820),$APP.
|
|
24
|
+
$APP.zf([$APP.Oj,new $APP.K(null,"blobSize","blobSize",-64083896),new $APP.K(null,"noiseIntensity","noiseIntensity",-792053623),tK,new $APP.K(null,"noiseScale","noiseScale",2003002730),new $APP.K(null,"noise","noise",-994696820),$APP.Tl,$APP.ki,new $APP.K(null,"noiseSpeed","noiseSpeed",-959403627),new $APP.K(null,"blobCount","blobCount",-1279691625)],[new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Y],
|
|
25
25
|
null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.W],null)]);
|
|
26
26
|
var hK=new $APP.R(null,5,["rainbow",new $APP.O(null,5,5,$APP.P,["#ef4444","#f59e0b","#22c55e","#3b82f6","#a855f7"],null),"ocean",new $APP.O(null,5,5,$APP.P,["#06b6d4","#0ea5e9","#6366f1","#8b5cf6","#0d9488"],null),"sunset",new $APP.O(null,5,5,$APP.P,["#ef4444","#f97316","#eab308","#ec4899","#f43f5e"],null),"neon",new $APP.O(null,5,5,$APP.P,["#22d3ee","#a78bfa","#f472b6","#34d399","#facc15"],null),"ember",new $APP.O(null,5,5,$APP.P,["#dc2626","#ea580c","#d97706","#b91c1c","#f59e0b"],null)],null);var IK=[0],JK=":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:var("+$APP.T.g("--x-metaball-cursor-z-index")+",9999);}[part\x3dviewport]{position:absolute;inset:var("+$APP.T.g("--x-metaball-cursor-inset")+",0);pointer-events:none;opacity:var("+$APP.T.g("--x-metaball-cursor-opacity")+",1);mix-blend-mode:var("+$APP.T.g("--x-metaball-cursor-blend-mode")+",normal);}.blob{position:absolute;border-radius:50%;will-change:transform;pointer-events:none;top:0;left:0;background:var("+
|
|
27
27
|
$APP.T.g("--x-metaball-cursor-color")+",#6366f1);}@media(prefers-reduced-motion:reduce){.blob{transition:none!important;}}",CK=function CK(a){if($APP.n(a.isConnected)){var c=$APP.k(a,"__xMetaballMouse"),d=$APP.k(a,"__xMetaballBlobs"),e=$APP.k(a,"__xMetaballPos"),g=$APP.k(a,"__xMetaballSpeeds"),h=$APP.k(c,"x");c=$APP.k(c,"y");for(var l=$APP.k(a,"__xMetaballModel"),m=d.length,p=0;;)if(p<m){var q=e[p],v=g[p],x=lK($APP.k(q,"x"),h,v);v=lK($APP.k(q,"y"),c,v);var y=d[p];q.x=x;q.y=v;y.style.transform="translate("+
|
|
28
|
-
$APP.T.g(x)+"px,"+$APP.T.g(v)+"px) translate(-50%,-50%)";p+=1}else break;$APP.n(yK.g(l))&&(d=$APP.k(a,"__xMetaballSeed")+uK.g(l),e=$APP.k(a,"__xMetaballRefs"),a.__xMetaballSeed=d,e=$APP.
|
|
28
|
+
$APP.T.g(x)+"px,"+$APP.T.g(v)+"px) translate(-50%,-50%)";p+=1}else break;$APP.n(yK.g(l))&&(d=$APP.k(a,"__xMetaballSeed")+uK.g(l),e=$APP.k(a,"__xMetaballRefs"),a.__xMetaballSeed=d,e=$APP.Ol.g(e),$APP.n(e)&&e.setAttribute("seed",""+$APP.T.g(Math.floor(d))));$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return CK.g?CK.g(a):CK.call(null,a)}))}return null};$APP.ha("baredom.exports.x_metaball_cursor.init",LK);export const init=LK;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// x-modal.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XModalEventMap {
|
|
6
|
+
"x-modal-toggle": CustomEvent<{ open: boolean }>;
|
|
7
|
+
"x-modal-dismiss": CustomEvent<{ reason: string }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XModal extends HTMLElement {
|
|
11
|
+
open: boolean;
|
|
12
|
+
size: string;
|
|
13
|
+
label: string;
|
|
14
|
+
show(): void;
|
|
15
|
+
hide(): void;
|
|
16
|
+
toggle(): void;
|
|
17
|
+
|
|
18
|
+
addEventListener<K extends keyof XModalEventMap>(
|
|
19
|
+
type: K,
|
|
20
|
+
listener: (this: XModal, ev: XModalEventMap[K]) => any,
|
|
21
|
+
options?: boolean | AddEventListenerOptions
|
|
22
|
+
): void;
|
|
23
|
+
addEventListener(
|
|
24
|
+
type: string,
|
|
25
|
+
listener: EventListenerOrEventListenerObject,
|
|
26
|
+
options?: boolean | AddEventListenerOptions
|
|
27
|
+
): void;
|
|
28
|
+
removeEventListener<K extends keyof XModalEventMap>(
|
|
29
|
+
type: K,
|
|
30
|
+
listener: (this: XModal, ev: XModalEventMap[K]) => any,
|
|
31
|
+
options?: boolean | EventListenerOptions
|
|
32
|
+
): void;
|
|
33
|
+
removeEventListener(
|
|
34
|
+
type: string,
|
|
35
|
+
listener: EventListenerOrEventListenerObject,
|
|
36
|
+
options?: boolean | EventListenerOptions
|
|
37
|
+
): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
"x-modal": XModal;
|
|
43
|
+
}
|
|
44
|
+
}
|
package/dist/x-modal.js
CHANGED
|
@@ -5,10 +5,10 @@ footer:p};return $APP.k(a,"__xModalRefs")},hZ=function(a,b,c){a.dispatchEvent(ne
|
|
|
5
5
|
a=$APP.be(function(d){return $APP.de(b,$APP.be(function(e){var g=$APP.uc(e.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"));return $APP.n(e.matches("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))?$APP.od(e,g):g},$APP.uc([$APP.vc(d.assignedElements({flatten:!0}))])))},$APP.uc([$APP.uc($APP.k(a,"root").querySelectorAll("slot"))]));
|
|
6
6
|
return $APP.xe($APP.$d.i(c,a))},jZ=function(a){var b=$APP.k(a,"__xModalRefs");b=$APP.n(b)?$APP.k(b,"dialog"):null;var c=$APP.k(a,"__xModalRestore"),d=$APP.k(a,"__xModalDialogTab")===!0;a.__xModalTabbables=null;a.__xModalRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xModalDialogTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},kZ=function(a,b){hZ(a,"x-modal-dismiss",{reason:b});a.removeAttribute("open");return null},lZ=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open",
|
|
7
7
|
"");return null},mZ=function(a){a.removeAttribute("open");return null},nZ=function(a,b){$APP.N($APP.k(a,"__xModalPrevOpen"),b)&&(a.__xModalPrevOpen=b,hZ(a,"x-modal-toggle",{open:b}),$APP.n(b)?setTimeout(function(){var c=$APP.k(a,"__xModalRefs"),d=$APP.n(c)?$APP.k(c,"dialog"):null;c=$APP.n(c)?iZ(c):null;a.__xModalRestore=document.activeElement;var e=$APP.n(c)?$APP.Hh(c):null;a.__xModalTabbables=e;$APP.t(c)?$APP.u(c).focus():$APP.n(d)&&($APP.n(d.hasAttribute("tabindex"))||(d.setAttribute("tabindex",
|
|
8
|
-
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):jZ(a))},pZ=function(a){var b=gZ(a);b=$APP.k(b,"dialog");var c=new $APP.R(null,3,[$APP.Gi,a.hasAttribute("open"),$APP.
|
|
8
|
+
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):jZ(a))},pZ=function(a){var b=gZ(a);b=$APP.k(b,"dialog");var c=new $APP.R(null,3,[$APP.Gi,a.hasAttribute("open"),$APP.Vl,a.getAttribute("size"),$APP.pi,a.getAttribute("label")],null);var d=$APP.M(c),e=$APP.D(d,$APP.Gi);c=$APP.D(d,$APP.Vl);d=$APP.D(d,$APP.pi);e=$APP.F(e);c=typeof c==="string"&&$APP.I(oZ,c)?c:"md";d=typeof d==="string"&&$APP.N(d,"")?d:"Modal";c=new $APP.R(null,3,[$APP.Nm,e,$APP.Mh,c,$APP.U,d],null);d=$APP.Nm.g(c);a.setAttribute("data-open",
|
|
9
9
|
$APP.n(d)?"true":"false");a.setAttribute("data-size",$APP.Mh.g(c));b.setAttribute("aria-label",$APP.U.g(c));nZ(a,d)},qZ=function(a){function b(g){var h=g.key;if($APP.B.i(h,"Escape"))g.preventDefault(),kZ(a,"escape");else if($APP.B.i(h,"Tab")){h=$APP.k(a,"__xModalTabbables");h=$APP.n(h)?$APP.xe($APP.uc(h)):$APP.fe;var l=$APP.k(a,"__xModalRefs");l=$APP.n(l)?$APP.k(l,"dialog"):null;if($APP.Hc(h))g.preventDefault(),$APP.n(l)&&l.focus();else{l=document.activeElement;var m=$APP.u(h);h=$APP.xc(h);var p=
|
|
10
10
|
g.shiftKey;$APP.n($APP.n(p)?$APP.B.i(l,m):p)?(g.preventDefault(),h.focus()):$APP.r(p)&&$APP.B.i(l,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return kZ(a,"backdrop")}var d=gZ(a),e=$APP.k(d,"dialog");$APP.k(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.ja(a,"__xModalHandlers",{backdrop:c,keydown:b})},rZ=function(a){var b=$APP.k(a,"__xModalHandlers"),c=$APP.k(a,"__xModalRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"backdrop");c=$APP.k(c,"dialog");
|
|
11
11
|
var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xModalHandlers=null},sZ=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?lZ(this):mZ(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.n(b)?b:"md"},set:function(b){return b==null?this.removeAttribute("size"):
|
|
12
12
|
this.setAttribute("size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Modal"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return lZ(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",{value:function(){return mZ(this)},enumerable:!0,
|
|
13
13
|
configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?mZ(this):lZ(this);return null},enumerable:!0,configurable:!0,writable:!0})},uZ=function(){if(!$APP.n(customElements.get("x-modal"))){var a=class extends HTMLElement{};a.observedAttributes=tZ;a.prototype.connectedCallback=function(){gZ(this);rZ(this);qZ(this);pZ(this);return null};a.prototype.disconnectedCallback=function(){rZ(this);jZ(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
-
function(b,c,d){$APP.N(c,d)&&pZ(this);return null};sZ(a.prototype);customElements.define("x-modal",a)}return null},vZ=function(){return uZ()};var oZ=new $APP.S(null,new $APP.R(null,5,["md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),tZ=["open","size","label"];$APP.Pd(["x-modal-toggle",new $APP.R(null,2,[$APP.
|
|
14
|
+
function(b,c,d){$APP.N(c,d)&&pZ(this);return null};sZ(a.prototype);customElements.define("x-modal",a)}return null},vZ=function(){return uZ()};var oZ=new $APP.S(null,new $APP.R(null,5,["md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),tZ=["open","size","label"];$APP.Pd(["x-modal-toggle",new $APP.R(null,2,[$APP.km,!1,$APP.V,new $APP.R(null,1,[$APP.hm,$APP.Zj],null)],null),"x-modal-dismiss",new $APP.R(null,2,[$APP.km,!1,$APP.V,new $APP.R(null,1,[$APP.Qi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_modal.init",vZ);export const init=vZ;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// x-morph-stack.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XMorphStackEventMap {
|
|
6
|
+
"x-morph-stack-change": CustomEvent<{ from: string; to: string; reason: string }>;
|
|
7
|
+
"x-morph-stack-changed": CustomEvent<{ from: string; to: string }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XMorphStack extends HTMLElement {
|
|
11
|
+
activeState: string;
|
|
12
|
+
activeIndex: number;
|
|
13
|
+
stiffness: number;
|
|
14
|
+
damping: number;
|
|
15
|
+
mass: number;
|
|
16
|
+
variant: string;
|
|
17
|
+
duration: number;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
|
|
20
|
+
addEventListener<K extends keyof XMorphStackEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: XMorphStack, ev: XMorphStackEventMap[K]) => any,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | AddEventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener<K extends keyof XMorphStackEventMap>(
|
|
31
|
+
type: K,
|
|
32
|
+
listener: (this: XMorphStack, ev: XMorphStackEventMap[K]) => any,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
removeEventListener(
|
|
36
|
+
type: string,
|
|
37
|
+
listener: EventListenerOrEventListenerObject,
|
|
38
|
+
options?: boolean | EventListenerOptions
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"x-morph-stack": XMorphStack;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/x-morph-stack.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.n(b)?b:0);c=$APP.oh.i(1E-4,$APP.n(c)?c:0);d=$APP.oh.i(1E-4,$APP.n(d)?d:0);var e=Math.sqrt(b/d);a=1E3*(4/($APP.oh.i(.2,$APP.sh.i(5,c/(2*Math.sqrt(b*d))))*e)+Math.PI/e)/a}else a=1;return a},
|
|
4
|
-
1,$APP.n(b)?b:0));return $APP.pc(d,a)}return null},
|
|
5
|
-
$APP.T.g(Math.round(
|
|
6
|
-
b){return new $APP.R(null,2,[$APP.Vh,$APP.n(a)?a:"",$APP.
|
|
7
|
-
"true");c.setAttribute("data-x-morph-stack-ghost-layer","");d.style.position="absolute";d.style.width="0";d.style.height="0";d.style.overflow="hidden";d.setAttribute("aria-hidden","true");c.appendChild(d);document.body.appendChild(c);b=$APP.mh.C(b,
|
|
2
|
+
var kx=function(a){return typeof a==="string"?(a=a.trim().toLowerCase(),$APP.I(jx,a)?a:"clean"):"clean"},lx=function(a){return $APP.B.i(a,"organic")||$APP.B.i(a,"liquid")},mx=function(a){var b=(a-1)/17*-7;return"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 "+$APP.T.g(a)+" "+$APP.T.g(b)},nx=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.B.i(a,""))return b;a=parseFloat(a);return $APP.n(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},ox=function(a,b,c,d){if($APP.n($APP.n(a)?a>0:a)){b=$APP.oh.i(1E-4,
|
|
3
|
+
$APP.n(b)?b:0);c=$APP.oh.i(1E-4,$APP.n(c)?c:0);d=$APP.oh.i(1E-4,$APP.n(d)?d:0);var e=Math.sqrt(b/d);a=1E3*(4/($APP.oh.i(.2,$APP.sh.i(5,c/(2*Math.sqrt(b*d))))*e)+Math.PI/e)/a}else a=1;return a},px=function(a,b,c,d,e,g){b+=(e*(1-a)-g*b)/d*c;return[a+b*c,b]},rx=function(a,b){b=$APP.M(b);var c=$APP.D(b,qx);b=$APP.D(b,$APP.gk);var d=$APP.xe(a);a=$APP.z(d);if(a>0){var e=$APP.n(function(){return $APP.n(c)?$APP.Td(function(g){return $APP.B.i(g,c)},d):c}())?c:null;if($APP.n(e))return e;a=$APP.oh.i(0,$APP.sh.i(a-
|
|
4
|
+
1,$APP.n(b)?b:0));return $APP.pc(d,a)}return null},sx=function(a,b,c){return a+(b-a)*c},tx=function(a){if(typeof a==="string"){a=a.match(/rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d*(?:\.\d+)?))?\s*\)/);if($APP.n(a)){var b=parseFloat(a[1]),c=parseFloat(a[2]),d=parseFloat(a[3]);var e=a[4];e=$APP.n(e)?$APP.N("",a[4]):e;a=[b,c,d,$APP.n(e)?parseFloat(a[4]):1]}else a=null;return a}return null},ux=function(a,b,c){var d=tx(a),e=tx(b);return $APP.n($APP.n(d)?e:d)?"rgba("+
|
|
5
|
+
$APP.T.g(Math.round(sx(d[0],e[0],c)))+","+$APP.T.g(Math.round(sx(d[1],e[1],c)))+","+$APP.T.g(Math.round(sx(d[2],e[2],c)))+","+$APP.T.g(sx(d[3],e[3],c))+")":c<.5?a:b},vx=function(a){if(typeof a==="string")if(a=a.trim(),$APP.N(a,"")){a=a.split(/\s+/);for(var b=a.length,c=[],d=0;;){if(d>=b)return c.length>0?c:null;var e=a[d];if($APP.n(e.endsWith("px"))){e=parseFloat(e.slice(0,e.length-2));if($APP.n(isNaN(e)))return null;c.push(e);d+=1}else return null}}else return null;else return null},wx=function(a,
|
|
6
|
+
b){return new $APP.R(null,2,[$APP.Vh,$APP.n(a)?a:"",$APP.cm,$APP.n(b)?b:""],null)},yx=function(a){var b=$APP.k(a,"__xMorphStackRefs"),c=$APP.n(b)?xx.g(b):null;if($APP.n($APP.n(c)?c.isConnected:c))return b;c=document.createElement("div");var d=document.createElementNS("http://www.w3.org/2000/svg","svg");c.style.position="fixed";c.style.top="0";c.style.left="0";c.style.width="100%";c.style.height="100dvh";c.style.pointerEvents="none";c.style.overflow="visible";c.style.zIndex="2147483646";c.setAttribute("aria-hidden",
|
|
7
|
+
"true");c.setAttribute("data-x-morph-stack-ghost-layer","");d.style.position="absolute";d.style.width="0";d.style.height="0";d.style.overflow="hidden";d.setAttribute("aria-hidden","true");c.appendChild(d);document.body.appendChild(c);b=$APP.mh.C(b,xx,c,$APP.uc([$APP.mk,d]));return a.__xMorphStackRefs=b},zx=function(a){var b=$APP.k(a,"__xMorphStackRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");
|
|
8
8
|
c.textContent=":host{display:block;position:relative;color-scheme:light dark;--x-morph-stack-spring-stiffness:170;--x-morph-stack-spring-damping:26;--x-morph-stack-spring-mass:1;--x-morph-stack-fade-ms:160ms;--x-morph-stack-goo-blur:10;--x-morph-stack-goo-threshold:18;--x-morph-stack-bg:transparent;}:host([data-variant\x3d'clean']){--x-morph-stack-spring-stiffness:280;--x-morph-stack-spring-damping:30;--x-morph-stack-spring-mass:0.7;}:host([data-variant\x3d'organic']){--x-morph-stack-spring-stiffness:180;--x-morph-stack-spring-damping:5;--x-morph-stack-spring-mass:1.0;--x-morph-stack-goo-blur:6;--x-morph-stack-goo-threshold:14;}:host([data-variant\x3d'liquid']){--x-morph-stack-spring-stiffness:50;--x-morph-stack-spring-damping:14;--x-morph-stack-spring-mass:2.0;--x-morph-stack-goo-blur:26;--x-morph-stack-goo-threshold:26;}[part\x3dviewport]{position:relative;display:block;background:var(--x-morph-stack-bg);}:host([disabled]){opacity:0.7;}";
|
|
9
|
-
d.setAttribute("part","viewport");e.setAttribute("name","state");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xMorphStackRefs=new $APP.R(null,3,[$APP.Hi,b,$APP.mj,d,$APP.kj,e],null);return $APP.k(a,"__xMorphStackRefs")},
|
|
10
|
-
$APP.
|
|
11
|
-
$APP.N(l,""))){l=parseFloat(l);l=typeof l==="number"&&$APP.r(isNaN(l))&&l>0?l:null;break a}l=null}return new $APP.R(null,8,[
|
|
12
|
-
g=$APP.B.i(1,e.nodeType);$APP.n(g?e.hasAttribute("data-state"):g)&&b.push(e);d+=1}else break;return b},
|
|
13
|
-
"":g.style.display="none";e+=1}else break;$APP.n(b)?a.setAttribute("data-active-state",b):a.removeAttribute("data-active-state");a.__xMorphStackCurrent=b},
|
|
14
|
-
text:e.textContent,node:e};d+=1}else break}return b},
|
|
15
|
-
$APP.mk);var c=$APP.k(a,"__xMorphStackFilterId");if($APP.n(c))b=c;else{c=
|
|
16
|
-
"140%");e.setAttribute("height","140%");g.setAttribute("in","SourceGraphic");g.setAttribute("stdDeviation",""+$APP.T.g(10));g.setAttribute("result","blur");h.setAttribute("in","blur");h.setAttribute("type","matrix");h.setAttribute("values",
|
|
17
|
-
18);a.__xMorphStackGooBaseBlur=d;a.__xMorphStackGooBaseThreshold=e;
|
|
18
|
-
c.left)+"px";a.style.top=""+$APP.T.g(d)+"px";a.style.width=""+$APP.T.g(b.w)+"px";a.style.height=""+$APP.T.g(b.h)+"px"},
|
|
19
|
-
$APP.T.g(
|
|
20
|
-
C=g.cloneNode(!0);c=h.w;d=h.h;var E=l.w,H=l.h,G=c>0?E/c:1,J=d>0?H/d:1,Q=l.x-h.x,aa=l.y-h.y;
|
|
21
|
-
")";A.style.opacity=""+$APP.T.g($APP.oh.i(0,1-C));return null}var g=$APP.k(c,"rect");d=$APP.k(d,"rect");var h=g.w,l=g.h,m=d.w,p=d.h,q=d.x-g.x,v=d.y-g.y,x=h>0?m/h:1,y=l>0?p/l:1,A=$APP.k(c,"node").cloneNode(!0);
|
|
22
|
-
""+$APP.T.g($APP.oh.i(0,1-g));return null},finalize:function(){return $APP.n(e.parentNode)?e.parentNode.removeChild(e):null}}},
|
|
23
|
-
a=new $APP.R(null,3,[
|
|
24
|
-
e,m,p)),h=$APP.w(h),m=null,p=0),q=0;else break;l=$APP.t(l);h=null;for(p=m=0;;)if(p<m)q=h.F(null,p),a.push(
|
|
25
|
-
d=null,e=0),g=0;else break;return a},
|
|
26
|
-
"__xMorphStackTo"))),c=new CustomEvent("x-morph-stack-changed",{detail:c,bubbles:!0,composed:!0,cancelable:!1}),a.dispatchEvent(c),a.__xMorphStackFrom=null,a.__xMorphStackTo=null)}return null}
|
|
27
|
-
return $APP.n(m)?m:
|
|
28
|
-
return m?m:$APP.X.g(e)}();if($APP.n(c))
|
|
29
|
-
$APP.
|
|
30
|
-
$APP.n(c?b:c)&&(
|
|
31
|
-
c=$APP.k(a,"__xMorphStackRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.kj.g(c),b=$APP.k(b,"slot"),$APP.n(b)&&c.removeEventListener("slotchange",b));a.__xMorphStackHandlers=null},
|
|
32
|
-
null?null:parseFloat(d)},set:function(d){return d==null?this.removeAttribute(c):this.setAttribute(c,""+$APP.T.g(d))},enumerable:!0,configurable:!0})},
|
|
33
|
-
return b==null?null:parseInt(b,10)},set:function(b){return b==null?this.removeAttribute("active-index"):this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});
|
|
34
|
-
configurable:!0});
|
|
35
|
-
1}d=void 0}b=
|
|
36
|
-
$APP.n(b)&&(this.__xMorphStackRefs=
|
|
37
|
-
case 2:return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
y=
|
|
9
|
+
d.setAttribute("part","viewport");e.setAttribute("name","state");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xMorphStackRefs=new $APP.R(null,3,[$APP.Hi,b,$APP.mj,d,$APP.kj,e],null);return $APP.k(a,"__xMorphStackRefs")},Bx=function(a){a=new $APP.R(null,8,[Ax,a.getAttribute("active-state"),$APP.nl,a.getAttribute("active-index"),$APP.jm,a.getAttribute("stiffness"),$APP.Xm,a.getAttribute("damping"),$APP.Fj,a.getAttribute("mass"),$APP.tl,a.getAttribute("variant"),$APP.Vi,a.getAttribute("duration"),
|
|
10
|
+
$APP.Nl,a.hasAttribute("disabled")],null);a=$APP.M(a);var b=$APP.D(a,Ax),c=$APP.D(a,$APP.nl),d=$APP.D(a,$APP.jm),e=$APP.D(a,$APP.Xm),g=$APP.D(a,$APP.Fj),h=$APP.D(a,$APP.tl),l=$APP.D(a,$APP.Vi);a=$APP.D(a,$APP.Nl);b=typeof b==="string"&&$APP.N("",b.trim())?b.trim():null;a:{if(typeof c==="string"&&(c=c.trim(),$APP.N(c,""))){c=parseInt(c,10);c=typeof c==="number"&&$APP.r(isNaN(c))&&c>=0?c:null;break a}c=null}d=nx(d,170,10,500);e=nx(e,26,1,100);g=nx(g,1,.1,10);h=kx(h);a:{if(typeof l==="string"&&(l=l.trim(),
|
|
11
|
+
$APP.N(l,""))){l=parseFloat(l);l=typeof l==="number"&&$APP.r(isNaN(l))&&l>0?l:null;break a}l=null}return new $APP.R(null,8,[qx,b,$APP.gk,c,$APP.Sl,d,$APP.Pk,e,$APP.sm,g,$APP.Vg,h,$APP.el,l,$APP.X,$APP.F(a)],null)},Cx=function(a,b,c){a=window.getComputedStyle(a).getPropertyValue(b);return typeof a==="string"&&$APP.N("",a.trim())?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?c:a):c},Dx=function(a){a=zx(a);a=$APP.M(a);a=$APP.D(a,$APP.kj).assignedElements();for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d],
|
|
12
|
+
g=$APP.B.i(1,e.nodeType);$APP.n(g?e.hasAttribute("data-state"):g)&&b.push(e);d+=1}else break;return b},Ex=function(a){a=Dx(a);for(var b=[],c=a.length,d=0;;)if(d<c)b.push(a[d].getAttribute("data-state")),d+=1;else break;return b},Fx=function(a,b){a=Dx(a);for(var c=a.length,d=0;;)if(d<c){var e=a[d];if($APP.B.i(b,e.getAttribute("data-state")))return e;d+=1}else return null},Gx=function(a,b){for(var c=Dx(a),d=c.length,e=0;;)if(e<d){var g=c[e],h=g.getAttribute("data-state");$APP.B.i(h,b)?g.style.display=
|
|
13
|
+
"":g.style.display="none";e+=1}else break;$APP.n(b)?a.setAttribute("data-active-state",b):a.removeAttribute("data-active-state");a.__xMorphStackCurrent=b},Hx=function(a){var b={};if($APP.n(a)){a=a.querySelectorAll("["+$APP.T.g("data-morph-id")+"]");for(var c=a.length,d=0;;)if(d<c){var e=a[d],g=e.getAttribute("data-morph-id"),h=e.getBoundingClientRect(),l=window.getComputedStyle(e);b[g]={rect:{x:h.left,y:h.top,w:h.width,h:h.height},br:l.borderRadius,bg:l.backgroundColor,color:l.color,clip:l.clipPath,
|
|
14
|
+
text:e.textContent,node:e};d+=1}else break}return b},Ix=function(a,b,c){var d=$APP.k(a,"__xMorphStackFilterBlur");a=$APP.k(a,"__xMorphStackFilterMatrix");$APP.n(d)&&d.setAttribute("stdDeviation",""+$APP.T.g(b));$APP.n(a)&&a.setAttribute("values",mx(c))},Jx=function(a,b){var c=$APP.k(a,"__xMorphStackGooBaseBlur"),d=$APP.k(a,"__xMorphStackGooBaseThreshold");c!=null&&d!=null&&(b=b<=0?1:b<.18?1-b/.18:b<.7?0:b<1?(b-.7)/(1-.7):1,Ix(a,c*(1-b),sx(d,1,b)))},Lx=function(a){var b=yx(a);b=$APP.M(b);b=$APP.D(b,
|
|
15
|
+
$APP.mk);var c=$APP.k(a,"__xMorphStackFilterId");if($APP.n(c))b=c;else{c=Kx[0];Kx[0]=c+1;c="x-morph-stack-goo-"+$APP.T.g(c);var d=document.createElementNS("http://www.w3.org/2000/svg","defs"),e=document.createElementNS("http://www.w3.org/2000/svg","filter"),g=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),h=document.createElementNS("http://www.w3.org/2000/svg","feColorMatrix");e.setAttribute("id",c);e.setAttribute("x","-20%");e.setAttribute("y","-20%");e.setAttribute("width",
|
|
16
|
+
"140%");e.setAttribute("height","140%");g.setAttribute("in","SourceGraphic");g.setAttribute("stdDeviation",""+$APP.T.g(10));g.setAttribute("result","blur");h.setAttribute("in","blur");h.setAttribute("type","matrix");h.setAttribute("values",mx(18));e.appendChild(g);e.appendChild(h);d.appendChild(e);b.appendChild(d);a.__xMorphStackFilterId=c;a.__xMorphStackFilterBlur=g;a.__xMorphStackFilterMatrix=h;b=c}c=yx(a);c=$APP.M(c);c=$APP.D(c,xx);d=Cx(a,"--x-morph-stack-goo-blur",10);e=Cx(a,"--x-morph-stack-goo-threshold",
|
|
17
|
+
18);a.__xMorphStackGooBaseBlur=d;a.__xMorphStackGooBaseThreshold=e;Ix(a,d,e);c.style.filter="url(#"+$APP.T.g(b)+")";c.style.webkitFilter="url(#"+$APP.T.g(b)+")"},Mx=function(a){a=$APP.k(a,"__xMorphStackRefs");a=$APP.n(a)?xx.g(a):null;$APP.n(a)&&(a.style.filter="",a.style.webkitFilter="")},Nx=function(a){a.style.position="absolute";a.style.margin="0";a.style.boxSizing="border-box";a.style.transformOrigin="top left";a.style.pointerEvents="none"},Ox=function(a,b,c){var d=b.y-c.top;a.style.left=""+$APP.T.g(b.x-
|
|
18
|
+
c.left)+"px";a.style.top=""+$APP.T.g(d)+"px";a.style.width=""+$APP.T.g(b.w)+"px";a.style.height=""+$APP.T.g(b.h)+"px"},Px=function(a,b,c,d){function e(la){la=$APP.oh.i(0,$APP.sh.i(1,la));var Ca=sx(aa,0,la),Pa=sx(G,1,la),db=sx(J,1,la);C.style.transform="translate("+$APP.T.g(sx(Q,0,la))+"px,"+$APP.T.g(Ca)+"px) scale("+$APP.T.g(Pa)+","+$APP.T.g(db)+")";Ca=C.style;Pa=vx(m);db=vx(p);if($APP.n($APP.n(Pa)?$APP.n(db)?$APP.B.i(Pa.length,db.length):db:Pa)){for(var eb=[],pb=Pa.length,Nb=0;;)if(Nb<pb)eb.push(""+
|
|
19
|
+
$APP.T.g(sx(Pa[Nb],db[Nb],la))+"px"),Nb+=1;else break;Pa=eb.join(" ")}else Pa=la<.5?m:p;Ca.borderRadius=Pa;$APP.n($APP.n(q)?v:q)&&(C.style.backgroundColor=ux(q,v,la));$APP.n($APP.n(x)?y:x)&&(C.style.color=ux(x,y,la));A&&(C.style.opacity=""+$APP.T.g($APP.oh.i(0,$APP.sh.i(1,la))));return null}var g=$APP.k(d,"node"),h=$APP.k(d,"rect"),l=$APP.k(c,"rect"),m=$APP.k(c,"br"),p=$APP.k(d,"br"),q=$APP.k(c,"bg"),v=$APP.k(d,"bg"),x=$APP.k(c,"color"),y=$APP.k(d,"color"),A=$APP.N($APP.k(c,"text"),$APP.k(d,"text")),
|
|
20
|
+
C=g.cloneNode(!0);c=h.w;d=h.h;var E=l.w,H=l.h,G=c>0?E/c:1,J=d>0?H/d:1,Q=l.x-h.x,aa=l.y-h.y;Nx(C);Ox(C,h,b);a.appendChild(C);g.style.visibility="hidden";e(0);return{t:0,v:0,update:e,finalize:function(){g.style.visibility="";return $APP.n(C.parentNode)?C.parentNode.removeChild(C):null}}},Qx=function(a,b,c,d){function e(C){C=$APP.oh.i(0,$APP.sh.i(1,C));var E=sx(0,v,C),H=sx(1,x,C),G=sx(1,y,C);A.style.transform="translate("+$APP.T.g(sx(0,q,C))+"px,"+$APP.T.g(E)+"px) scale("+$APP.T.g(H)+","+$APP.T.g(G)+
|
|
21
|
+
")";A.style.opacity=""+$APP.T.g($APP.oh.i(0,1-C));return null}var g=$APP.k(c,"rect");d=$APP.k(d,"rect");var h=g.w,l=g.h,m=d.w,p=d.h,q=d.x-g.x,v=d.y-g.y,x=h>0?m/h:1,y=l>0?p/l:1,A=$APP.k(c,"node").cloneNode(!0);Nx(A);Ox(A,g,b);a.appendChild(A);e(0);return{t:0,v:0,update:e,finalize:function(){return $APP.n(A.parentNode)?A.parentNode.removeChild(A):null}}},Rx=function(a,b,c){var d=$APP.k(c,"rect"),e=$APP.k(c,"node").cloneNode(!0);Nx(e);Ox(e,d,b);a.appendChild(e);return{t:0,v:0,update:function(g){e.style.opacity=
|
|
22
|
+
""+$APP.T.g($APP.oh.i(0,1-g));return null},finalize:function(){return $APP.n(e.parentNode)?e.parentNode.removeChild(e):null}}},Sx=function(a){var b=$APP.k(a,"node");b.style.opacity="0";return{t:0,v:0,update:function(c){b.style.opacity=""+$APP.T.g($APP.oh.i(0,$APP.sh.i(1,c)));return null},finalize:function(){return b.style.opacity=""}}},Xx=function(a,b,c){a=yx(a);a=$APP.M(a);var d=$APP.D(a,xx),e=d.getBoundingClientRect(),g=Object.keys(b);a=Object.keys(c);g=$APP.xe(g);a=$APP.xe(a);g=$APP.Xf(g);a=$APP.Xf(a);
|
|
23
|
+
a=new $APP.R(null,3,[Tx,$APP.mn.i(g,a),Ux,Vx.i(g,a),Wx,Vx.i(a,g)],null);var h=Tx.g(a),l=Ux.g(a);g=Wx.g(a);a=[];h=$APP.t(h);for(var m=null,p=0,q=0;;)if(q<p){var v=m.F(null,q),x=$APP.k(b,v);v=$APP.k(c,v);var y=$APP.k(x,"text"),A=$APP.k(v,"text");a.push(Px(d,e,x,v));$APP.N(y,A)&&a.push(Qx(d,e,x,v));q+=1}else if(h=$APP.t(h))$APP.Nc(h)?(p=$APP.yb(h),h=$APP.zb(h),m=p,p=$APP.z(p)):(p=$APP.u(h),m=$APP.k(b,p),p=$APP.k(c,p),q=$APP.k(m,"text"),x=$APP.k(p,"text"),a.push(Px(d,e,m,p)),$APP.N(q,x)&&a.push(Qx(d,
|
|
24
|
+
e,m,p)),h=$APP.w(h),m=null,p=0),q=0;else break;l=$APP.t(l);h=null;for(p=m=0;;)if(p<m)q=h.F(null,p),a.push(Rx(d,e,$APP.k(b,q))),p+=1;else if(l=$APP.t(l))h=l,$APP.Nc(h)?(l=$APP.yb(h),p=$APP.zb(h),h=l,m=$APP.z(l),l=p):(l=$APP.u(h),a.push(Rx(d,e,$APP.k(b,l))),l=$APP.w(h),h=null,m=0),p=0;else break;b=$APP.t(g);d=null;for(g=e=0;;)if(g<e)l=d.F(null,g),a.push(Sx($APP.k(c,l))),g+=1;else if(b=$APP.t(b))d=b,$APP.Nc(d)?(b=$APP.yb(d),g=$APP.zb(d),d=b,e=$APP.z(b),b=g):(b=$APP.u(d),a.push(Sx($APP.k(c,b))),b=$APP.w(d),
|
|
25
|
+
d=null,e=0),g=0;else break;return a},Yx=function(a){if($APP.n(a))for(var b=a.length,c=0;;)if(c<b){var d=a[c].finalize;$APP.n(d)&&(d.H?d.H():d.call(null));c+=1}else break},Zx=function(a,b,c){if($APP.B.i(b,$APP.k(a,"__xMorphStackToken"))){b=$APP.k(a,"__xMorphStackEntries");var d=$APP.k(a,"__xMorphStackRaf");$APP.n(d)&&(window.cancelAnimationFrame(d),a.__xMorphStackRaf=null);Yx(b);a.__xMorphStackEntries=null;a.__xMorphStackLast=null;Mx(a);$APP.n(c)&&(c=$APP.Hh(wx($APP.k(a,"__xMorphStackFrom"),$APP.k(a,
|
|
26
|
+
"__xMorphStackTo"))),c=new CustomEvent("x-morph-stack-changed",{detail:c,bubbles:!0,composed:!0,cancelable:!1}),a.dispatchEvent(c),a.__xMorphStackFrom=null,a.__xMorphStackTo=null)}return null},$x=function(a){var b=$APP.k(a,"__xMorphStackRaf");$APP.n(b)&&(window.cancelAnimationFrame(b),a.__xMorphStackRaf=null);Yx($APP.k(a,"__xMorphStackEntries"));a.__xMorphStackEntries=null;a.__xMorphStackLast=null;Mx(a)},by=function(a,b,c){var d=$APP.k(a,"__xMorphStackCurrent"),e=function(){var m=$APP.k(a,"__xMorphStackModel");
|
|
27
|
+
return $APP.n(m)?m:Bx(a)}(),g=Ex(a);if(g.length===0||b==null||$APP.r($APP.Td(function(m){return $APP.B.i(m,b)},g)))return!1;if($APP.B.i(d,b))return!0;var h=$APP.n(d)?Fx(a,d):null;g=Fx(a,b);c=$APP.Hh(new $APP.R(null,3,[$APP.Vh,$APP.n(d)?d:"",$APP.cm,$APP.n(b)?b:"",$APP.Qi,$APP.n(c)?c:"method"],null));c=new CustomEvent("x-morph-stack-change",{detail:c,bubbles:!0,composed:!0,cancelable:!0});c=a.dispatchEvent(c);if($APP.r(c))return!1;$x(a);c=function(){var m=$APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches);
|
|
28
|
+
return m?m:$APP.X.g(e)}();if($APP.n(c))Gx(a,b),queueMicrotask(function(){var m=$APP.Hh(wx(d,b));m=new CustomEvent("x-morph-stack-changed",{detail:m,bubbles:!0,composed:!0});return a.dispatchEvent(m)});else{h=Hx(h);Gx(a,b);$APP.mj.g(zx(a));g=Hx(g);g=Xx(a,h,g);var l=function(){var m=$APP.k(a,"__xMorphStackToken");return $APP.n(m)?m:0}()+1;a.__xMorphStackToken=l;a.__xMorphStackEntries=g;a.__xMorphStackLast=null;a.__xMorphStackFrom=d;a.__xMorphStackTo=b;$APP.ja(a,"__xMorphStackTimeScale",ox($APP.el.g(e),
|
|
29
|
+
$APP.Sl.g(e),$APP.Pk.g(e),$APP.sm.g(e)));lx($APP.Vg.g(e))&&(Lx(a),Jx(a,0));g.length===0?Zx(a,l,!0):(g=window.requestAnimationFrame(function(m){return $APP.B.i(l,$APP.k(a,"__xMorphStackToken"))?ay(a,m):null}),a.__xMorphStackRaf=g)}return!0},cy=function(a){zx(a);var b=Bx(a);a.__xMorphStackModel=b;a.setAttribute("data-variant",$APP.Vg.g(b));var c=Ex(a);c=rx($APP.xe($APP.uc(c)),b);b=$APP.k(a,"__xMorphStackCurrent");b==null?$APP.n(c)&&Gx(a,c):$APP.n($APP.n(c)?$APP.N(c,b):c)?by(a,c,"attribute"):(c=c==null,
|
|
30
|
+
$APP.n(c?b:c)&&($x(a),Gx(a,null)))},dy=function(a){var b=Ex(a);var c=$APP.k(a,"__xMorphStackModel");c=$APP.n(c)?c:Bx(a);b=rx($APP.xe($APP.uc(b)),c);c=$APP.k(a,"__xMorphStackCurrent");b==null?($x(a),Gx(a,null)):$APP.n($APP.n(c)?Fx(a,c)==null:c)?($x(a),Gx(a,b)):c==null?Gx(a,b):Gx(a,c);return null},ey=function(a){function b(){return dy(a)}var c=zx(a);c=$APP.M(c);$APP.D(c,$APP.kj).addEventListener("slotchange",b);$APP.ja(a,"__xMorphStackHandlers",{slot:b})},fy=function(a){var b=$APP.k(a,"__xMorphStackHandlers"),
|
|
31
|
+
c=$APP.k(a,"__xMorphStackRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.kj.g(c),b=$APP.k(b,"slot"),$APP.n(b)&&c.removeEventListener("slotchange",b));a.__xMorphStackHandlers=null},gy=function(a){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})},hy=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(c);return d==
|
|
32
|
+
null?null:parseFloat(d)},set:function(d){return d==null?this.removeAttribute(c):this.setAttribute(c,""+$APP.T.g(d))},enumerable:!0,configurable:!0})},iy=function(a){Object.defineProperty(a,"activeState",{get:function(){return this.getAttribute("active-state")},set:function(b){return b==null?this.removeAttribute("active-state"):this.setAttribute("active-state",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");
|
|
33
|
+
return b==null?null:parseInt(b,10)},set:function(b){return b==null?this.removeAttribute("active-index"):this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});hy(a,"stiffness","stiffness");hy(a,"damping","damping");hy(a,"mass","mass");hy(a,"duration","duration");Object.defineProperty(a,"variant",{get:function(){return kx(this.getAttribute("variant"))},set:function(b){return b==null?this.removeAttribute("variant"):this.setAttribute("variant",""+$APP.T.g(b))},enumerable:!0,
|
|
34
|
+
configurable:!0});gy(a);a.goTo=function(b){b=b!=null?""+$APP.T.g(b):null;return by(this,b,"method")};a.next=function(){var b=Ex(this);var c=b.length,d=$APP.k(this,"__xMorphStackCurrent");if(c>0){b:{for(var e=0;;){if(e>=c){d=-1;break b}if($APP.B.i(b[e],d)){d=e;break b}e+=1}d=void 0}b=by(this,b[$APP.fd(d+1,c)],"method")}else b=null;return b};a.prev=function(){var b=Ex(this);var c=b.length,d=$APP.k(this,"__xMorphStackCurrent");if(c>0){b:{for(var e=0;;){if(e>=c){d=0;break b}if($APP.B.i(b[e],d)){d=e;break b}e+=
|
|
35
|
+
1}d=void 0}b=by(this,b[$APP.fd(d-1+c,c)],"method")}else b=null;return b};a.states=function(){return Ex(this)}},ly=function(){var a=class extends HTMLElement{};a.observedAttributes=jy;a.prototype.connectedCallback=function(){zx(this);fy(this);ey(this);cy(this);$APP.k(this,"__xMorphStackCurrent")==null&&dy(this);return null};a.prototype.disconnectedCallback=function(){$x(this);var b=$APP.k(this,"__xMorphStackRefs"),c=$APP.n(b)?xx.g(b):null;$APP.n($APP.n(c)?c.parentNode:c)&&c.parentNode.removeChild(c);
|
|
36
|
+
$APP.n(b)&&(this.__xMorphStackRefs=ky.i(ky.i(b,xx),$APP.mk));this.__xMorphStackGooBaseThreshold=this.__xMorphStackGooBaseBlur=this.__xMorphStackFilterMatrix=this.__xMorphStackFilterBlur=this.__xMorphStackFilterId=null;fy(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&cy(this);return null};iy(a.prototype);return a},my=function(){$APP.n(customElements.get("x-morph-stack"))||customElements.define("x-morph-stack",ly());return null},ky=function ky(a){switch(arguments.length){case 1:return ky.g(arguments[0]);
|
|
37
|
+
case 2:return ky.i(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ky.C(arguments[0],arguments[1],2<c.length?new $APP.Ub(c.slice(2),0,null):null)}};ky.g=function(a){return a};ky.i=function(a,b){return a==null?null:$APP.La(a,b)};ky.C=function(a,b,c){for(;;){if(a==null)return null;a=ky.i(a,b);if($APP.n(c))b=$APP.u(c),c=$APP.w(c);else return a}};
|
|
38
|
+
ky.J=function(a){var b=$APP.u(a),c=$APP.w(a);a=$APP.u(c);c=$APP.w(c);return this.C(b,a,c)};ky.N=2;var Vx=function Vx(a){switch(arguments.length){case 1:return Vx.g(arguments[0]);case 2:return Vx.i(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Vx.C(arguments[0],arguments[1],2<c.length?new $APP.Ub(c.slice(2),0,null):null)}};Vx.g=function(a){return a};
|
|
39
|
+
Vx.i=function(a,b){return $APP.z(a)<$APP.z(b)?$APP.Xc(function(c,d){return $APP.I(b,d)?$APP.nh.i(c,d):c},a,a):$APP.Xc($APP.nh,a,b)};Vx.C=function(a,b,c){return $APP.Xc(Vx,a,$APP.ld.i(c,b))};Vx.J=function(a){var b=$APP.u(a),c=$APP.w(a);a=$APP.u(c);c=$APP.w(c);return this.C(b,a,c)};Vx.N=2;
|
|
40
|
+
var Wx=new $APP.K(null,"entering","entering",-413471949),Ux=new $APP.K(null,"leaving","leaving",608616060),Tx=new $APP.K(null,"matched","matched",-975207164),Ax=new $APP.K(null,"active-state-raw","active-state-raw",-60607051),qx=new $APP.K(null,"active-state","active-state",-1185168001),xx=new $APP.K(null,"ghost-layer","ghost-layer",1707493707);var jy="active-state active-index stiffness damping mass variant duration disabled".split(" "),jx=$APP.Uf(["liquid","clean","organic"]);$APP.Pd(["x-morph-stack-change",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.Vh,$APP.Y,$APP.cm,$APP.Y,$APP.Qi,$APP.Y],null),$APP.km,!0],null),"x-morph-stack-changed",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.Vh,$APP.Y,$APP.cm,$APP.Y],null),$APP.km,!1],null)]);var Kx=[0],ay=function ay(a,b){var d=$APP.k(a,"__xMorphStackToken"),e=$APP.k(a,"__xMorphStackEntries"),g=$APP.k(a,"__xMorphStackLast"),h=function(){var C=$APP.k(a,"__xMorphStackModel");return $APP.n(C)?C:Bx(a)}(),l=$APP.sm.g(h),m=$APP.Sl.g(h);h=$APP.Pk.g(h);g=$APP.oh.i(0,$APP.sh.i(1/30,function(){var C=$APP.k(a,"__xMorphStackTimeScale");return $APP.n(C)?C:1}()*($APP.n(g)?(b-g)/1E3:1/60)));a.__xMorphStackLast=b;if($APP.n($APP.n(e)?e.length:e)){b=[!0];for(var p=[1],q=e.length,v=0;;)if(v<q){var x=e[v],
|
|
41
|
+
y=px(x.t,x.v,g,l,m,h),A=y[0];y=y[1];x.t=A;x.v=y;x=x.update;x.g?x.g(A):x.call(null,A);A<p[0]&&(p[0]=A);Math.abs(A-1)<.001&&Math.abs(y)<.01||(b[0]=!1);v+=1}else break;Jx(a,p[0]);$APP.n(b[0])?Zx.m?Zx.m(a,d,!0):Zx.call(null,a,d,!0):(e=window.requestAnimationFrame(function(C){return $APP.B.i(d,$APP.k(a,"__xMorphStackToken"))?ay.i?ay.i(a,C):ay.call(null,a,C):null}),a.__xMorphStackRaf=e)}return null};$APP.ha("baredom.exports.x_morph_stack.init",my);export const init=my;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// x-navbar.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XNavbarEventMap {
|
|
6
|
+
"focus-visible": CustomEvent<{}>;
|
|
7
|
+
"navigate": CustomEvent<{ href: string; source: string }>;
|
|
8
|
+
"brand-activate": CustomEvent<{ source: string }>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface XNavbar extends HTMLElement {
|
|
12
|
+
sticky: boolean;
|
|
13
|
+
elevated: boolean;
|
|
14
|
+
label: string;
|
|
15
|
+
variant: string;
|
|
16
|
+
orientation: string;
|
|
17
|
+
alignment: string;
|
|
18
|
+
breakpoint: string;
|
|
19
|
+
|
|
20
|
+
addEventListener<K extends keyof XNavbarEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: XNavbar, ev: XNavbarEventMap[K]) => any,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | AddEventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener<K extends keyof XNavbarEventMap>(
|
|
31
|
+
type: K,
|
|
32
|
+
listener: (this: XNavbar, ev: XNavbarEventMap[K]) => any,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
removeEventListener(
|
|
36
|
+
type: string,
|
|
37
|
+
listener: EventListenerOrEventListenerObject,
|
|
38
|
+
options?: boolean | EventListenerOptions
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"x-navbar": XNavbar;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/x-navbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
2
|
var OY=function(a,b,c){return typeof a==="string"&&$APP.I(b,a)?a:c},PY=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},QY=function(a){return a.assignedNodes({flatten:!0})},RY=function(a){return document.createElement(a)},YY=function(a,b){var c=$APP.k(b,"base"),d=$APP.k(b,"bar"),e=$APP.k(b,"brand"),g=$APP.k(b,"start"),h=$APP.k(b,"actions"),l=$APP.k(b,"toggle"),m=$APP.k(b,"end"),p=$APP.k(b,"brand-slot"),q=$APP.k(b,"start-slot"),v=$APP.k(b,
|
|
3
|
-
"actions-slot"),x=$APP.k(b,"toggle-slot");b=$APP.k(b,"end-slot");a=new $APP.R(null,7,[$APP.U,a.getAttribute("label"),$APP.
|
|
4
|
-
typeof a==="string"?a:null,$APP.
|
|
3
|
+
"actions-slot"),x=$APP.k(b,"toggle-slot");b=$APP.k(b,"end-slot");a=new $APP.R(null,7,[$APP.U,a.getAttribute("label"),$APP.ql,a.getAttribute("orientation"),$APP.Vg,a.getAttribute("variant"),$APP.Gl,a.hasAttribute("sticky"),SY,a.hasAttribute("elevated"),$APP.ij,a.getAttribute("breakpoint"),TY,a.getAttribute("alignment")],null);var y=$APP.M(a);a=$APP.D(y,$APP.U);var A=$APP.D(y,$APP.ql),C=$APP.D(y,$APP.Vg),E=$APP.D(y,$APP.Gl),H=$APP.D(y,SY),G=$APP.D(y,$APP.ij);y=$APP.D(y,TY);a=new $APP.R(null,7,[$APP.U,
|
|
4
|
+
typeof a==="string"?a:null,$APP.ql,OY(A,UY,"horizontal"),$APP.Vg,OY(C,VY,"default"),$APP.Gl,$APP.F(E),SY,$APP.F(H),$APP.ij,OY(G,WY,"md"),TY,OY(y,XY,"space-between")],null);p=QY(p).length>0;q=QY(q).length>0;v=QY(v).length>0;x=QY(x).length>0;b=QY(b).length>0;A=$APP.M(a);A=$APP.D(A,$APP.U);A=$APP.Lg(A)?A:null;$APP.n(A)?c.setAttribute("aria-label",A):c.removeAttribute("aria-label");c.setAttribute("data-variant",$APP.Vg.g(a));c.setAttribute("data-orientation",$APP.ql.g(a));c.setAttribute("data-breakpoint",
|
|
5
5
|
$APP.ij.g(a));d.setAttribute("data-alignment",TY.g(a));e.setAttribute("data-has-brand",p?"true":"false");g.setAttribute("data-has-start",q?"true":"false");h.setAttribute("data-has-actions",v?"true":"false");l.setAttribute("data-has-toggle",x?"true":"false");return m.setAttribute("data-has-end",b?"true":"false")},ZY=function(a,b){b.addEventListener("click",function(c){var d=$APP.k(a,"__xNavbarRefs"),e=c.target,g=$APP.n(e)?e.closest("a"):null;c=c instanceof PointerEvent?"pointer":c instanceof MouseEvent?
|
|
6
6
|
"pointer":c instanceof KeyboardEvent?"keyboard":"programmatic";$APP.n(g)&&(g=g.getAttribute("href"),PY(a,"navigate",{href:$APP.n(g)?g:"",source:c}));a:{d=QY($APP.k(d,"brand-slot"));for(g=0;;)if(g<d.length){var h=d[g];var l=$APP.B.i(h,e);h=l?l:(l=$APP.B.i(h.nodeType,Node.ELEMENT_NODE))?h.contains(e):l;if($APP.n(h)){e=!0;break a}g+=1}else{e=!1;break a}e=void 0}return e?PY(a,"brand-activate",{source:c}):null});b.addEventListener("focusin",function(c){c=c.target;if($APP.n($APP.n(c)?c.matches(":focus-visible"):
|
|
7
7
|
c)){if($APP.n($APP.k(a,"__xNavbarFocusVisible")))return null;a.__xNavbarFocusVisible=!0;a.setAttribute("data-focus-visible-within","true");return PY(a,"focus-visible",{})}return null});b.addEventListener("focusout",function(c){c=c.relatedTarget;if($APP.n($APP.n(c)?a.contains(c):c))return null;a.__xNavbarFocusVisible=!1;return a.removeAttribute("data-focus-visible-within")})},$Y=function(a,b){function c(){return YY(a,b)}$APP.k(b,"brand-slot").addEventListener("slotchange",c);$APP.k(b,"start-slot").addEventListener("slotchange",
|
|
@@ -11,4 +11,4 @@ $APP.k(this,"__xNavbarRefs")==null;var c=$APP.k(this,"__xNavbarRefs");if(!$APP.n
|
|
|
11
11
|
e.setAttribute("part","base");g.setAttribute("part","bar");h.setAttribute("part","brand");l.setAttribute("part","start");m.setAttribute("part","nav");p.setAttribute("part","actions");q.setAttribute("part","toggle");v.setAttribute("part","end");x.setAttribute("name","brand");y.setAttribute("name","start");C.setAttribute("name","actions");E.setAttribute("name","toggle");H.setAttribute("name","end");h.appendChild(x);l.appendChild(y);m.appendChild(A);p.appendChild(C);q.appendChild(E);v.appendChild(H);
|
|
12
12
|
g.appendChild(h);g.appendChild(l);g.appendChild(m);g.appendChild(p);g.appendChild(q);g.appendChild(v);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xNavbarRefs=c={"end-slot":H,bar:g,start:l,toggle:q,actions:p,brand:h,"default-slot":A,root:c,"brand-slot":x,"start-slot":y,"actions-slot":C,"toggle-slot":E,end:v,base:e,nav:m}}b&&(this.__xNavbarFocusVisible=!1,ZY(this,$APP.k(c,"base")),$Y(this,c));return YY(this,c)};a.prototype.disconnectedCallback=function(){this.__xNavbarFocusVisible=!1};
|
|
13
13
|
a.prototype.attributeChangedCallback=function(){var b=$APP.k(this,"__xNavbarRefs");return $APP.n(b)?YY(this,b):null};cZ(a.prototype);return a},fZ=function(){$APP.n(customElements.get("x-navbar"))||customElements.define("x-navbar",eZ());return null},SY=new $APP.K(null,"elevated","elevated",-7323953),TY=new $APP.K(null,"alignment","alignment",1040093386);var UY=new $APP.S(null,new $APP.R(null,2,["vertical",null,"horizontal",null],null),null),VY=new $APP.S(null,new $APP.R(null,4,["transparent",null,"inverted",null,"subtle",null,"default",null],null),null),WY=new $APP.S(null,new $APP.R(null,4,["md",null,"lg",null,"xl",null,"sm",null],null),null),XY=new $APP.S(null,new $APP.R(null,3,["center",null,"start",null,"space-between",null],null),null),dZ="label orientation variant sticky elevated breakpoint alignment".split(" ");
|
|
14
|
-
$APP.Pd(["focus-visible",new $APP.R(null,1,[$APP.V,$APP.Qd],null),"navigate",new $APP.R(null,1,[$APP.V,new $APP.R(null,2,[$APP
|
|
14
|
+
$APP.Pd(["focus-visible",new $APP.R(null,1,[$APP.V,$APP.Qd],null),"navigate",new $APP.R(null,1,[$APP.V,new $APP.R(null,2,[$APP.$m,$APP.Y,$APP.rl,$APP.Y],null)],null),"brand-activate",new $APP.R(null,1,[$APP.V,new $APP.R(null,1,[$APP.rl,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_navbar.init",fZ);export const init=fZ;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// x-neural-glow.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XNeuralGlow extends HTMLElement {
|
|
6
|
+
colorBackground: string;
|
|
7
|
+
interactive: boolean;
|
|
8
|
+
orbCount: number;
|
|
9
|
+
restRate: number;
|
|
10
|
+
colorPrimary: string;
|
|
11
|
+
orbSize: number;
|
|
12
|
+
opacity: number;
|
|
13
|
+
colorSecondary: string;
|
|
14
|
+
pulseSpeed: number;
|
|
15
|
+
connectionDistance: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
"x-neural-glow": XNeuralGlow;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/x-neural-glow.js
CHANGED
|
@@ -3,10 +3,10 @@ var fI=function(a){if(typeof a==="string"){a=parseInt(a.trim(),10);var b=isNaN(a
|
|
|
3
3
|
Math.max(1,a))}return 4},jI=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?.15:Math.min(.5,Math.max(.05,a))}return.15},kI=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?40:Math.min(200,Math.max(10,a))}return 40},lI=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?.8:Math.min(1,Math.max(0,a))):.8},mI=function(a){return a==null?!0:$APP.N("false",a.trim().toLowerCase())},
|
|
4
4
|
nI=function(a,b,c){return a+(b-a)*c},oI=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},qI=function(a,b){a=$APP.k(a,"__xNeuralColorCache");var c=$APP.k(a,b);if($APP.n(c))return c;pI.fillStyle="#000000";pI.fillStyle=b;c=pI.fillStyle;if(typeof c==="string"&&$APP.B.i(c[0],"#")){var d=c.substring(1);c=parseInt(d.substring(0,2),16);var e=parseInt(d.substring(2,4),16);d=parseInt(d.substring(4,6),16);c=[c/255,e/255,d/255]}else d=c.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/),
|
|
5
5
|
$APP.n(d)?(c=parseInt(d[1],10),e=parseInt(d[2],10),d=parseInt(d[3],10),c=[c/255,e/255,d/255]):c=[0,0,0];return a[b]=c},rI=function(a,b,c){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);if($APP.n(a.getShaderParameter(b,a.COMPILE_STATUS)))return b;console.warn("x-neural-glow shader error:",a.getShaderInfoLog(b));a.deleteShader(b);return null},KI=function(a){a=$APP.zf([sI,tI,uI,vI,wI,xI,yI,zI,AI,BI],[a.getAttribute("rest-rate"),a.getAttribute("pulse-speed"),a.getAttribute("color-secondary"),
|
|
6
|
-
a.getAttribute("opacity"),a.getAttribute("orb-count"),a.getAttribute("orb-size"),a.getAttribute("color-background"),a.getAttribute("interactive"),a.getAttribute("color-primary"),a.getAttribute("connection-distance")]);var b=$APP.M(a);a=$APP.D(b,AI);var c=$APP.D(b,BI),d=$APP.D(b,sI),e=$APP.D(b,tI),g=$APP.D(b,vI),h=$APP.D(b,uI),l=$APP.D(b,wI),m=$APP.D(b,xI),p=$APP.D(b,yI);b=$APP.D(b,zI);return $APP.zf([CI,DI,EI,FI,$APP.
|
|
6
|
+
a.getAttribute("opacity"),a.getAttribute("orb-count"),a.getAttribute("orb-size"),a.getAttribute("color-background"),a.getAttribute("interactive"),a.getAttribute("color-primary"),a.getAttribute("connection-distance")]);var b=$APP.M(a);a=$APP.D(b,AI);var c=$APP.D(b,BI),d=$APP.D(b,sI),e=$APP.D(b,tI),g=$APP.D(b,vI),h=$APP.D(b,uI),l=$APP.D(b,wI),m=$APP.D(b,xI),p=$APP.D(b,yI);b=$APP.D(b,zI);return $APP.zf([CI,DI,EI,FI,$APP.Il,GI,$APP.qi,HI,II,JI],[kI(m),fI(l),gI(a,"#4f8bff"),gI(h,"#00e5cc"),mI(b),jI(c),
|
|
7
7
|
lI(g),hI(e),gI(p,"#050a18"),iI(d)])},LI=function(a,b,c){return Math.sin(a*1.7+c*.3)*Math.cos(b*2.3+c*.5)*.5+Math.sin(a*3.1-c*.7)*Math.cos(b*1.3+c*.2)*.25+Math.sin(a*5.3+c*.4)*Math.cos(b*4.7-c*.6)*.125},NI=function(a,b,c){var d=$APP.k(a,"__xNeuralUniforms"),e=MI.g($APP.k(a,"__xNeuralRefs")),g=e.width,h=e.height,l=$APP.k(a,"__xNeuralTime"),m=$APP.k(a,"__xNeuralActivity");e=$APP.k(a,"__xNeuralOrbPos");var p=$APP.k(a,"__xNeuralOrbPhases"),q=DI.g(c),v=qI(a,EI.g(c)),x=qI(a,FI.g(c));a=qI(a,II.g(c));b.uniform2f($APP.k(d,
|
|
8
8
|
"u_resolution"),g,h);b.uniform1f($APP.k(d,"u_time"),l);b.uniform1f($APP.k(d,"u_activity"),m);b.uniform1f($APP.k(d,"u_pulse_speed"),HI.g(c));b.uniform1f($APP.k(d,"u_rest_rate"),JI.g(c));b.uniform1i($APP.k(d,"u_orb_count"),q);b.uniform1f($APP.k(d,"u_orb_size"),CI.g(c));b.uniform1f($APP.k(d,"u_connection_dist"),GI.g(c));b.uniform3f($APP.k(d,"u_color_primary"),v[0],v[1],v[2]);b.uniform3f($APP.k(d,"u_color_secondary"),x[0],x[1],x[2]);b.uniform3f($APP.k(d,"u_color_background"),a[0],a[1],a[2]);b.uniform1f($APP.k(d,
|
|
9
|
-
"u_opacity"),$APP.qi.g(c));for(c=0;;)if(c<q)g=e[c],b.uniform2f($APP.k(d,"u_orb_positions["+$APP.T.g(c)+"]"),g[0],g[1]),b.uniform1f($APP.k(d,"u_orb_phases["+$APP.T.g(c)+"]"),p[c]),c+=1;else break},PI=function(a){a.__xNeuralTime=0;$APP.ja(a,"__xNeuralLastFrame",performance.now());a.__xNeuralActivity=0;a.__xNeuralImpulse=0;$APP.ja(a,"__xNeuralRaf",requestAnimationFrame(function(){return OI(a)}))},QI=function(a){if($APP.n($APP.
|
|
9
|
+
"u_opacity"),$APP.qi.g(c));for(c=0;;)if(c<q)g=e[c],b.uniform2f($APP.k(d,"u_orb_positions["+$APP.T.g(c)+"]"),g[0],g[1]),b.uniform1f($APP.k(d,"u_orb_phases["+$APP.T.g(c)+"]"),p[c]),c+=1;else break},PI=function(a){a.__xNeuralTime=0;$APP.ja(a,"__xNeuralLastFrame",performance.now());a.__xNeuralActivity=0;a.__xNeuralImpulse=0;$APP.ja(a,"__xNeuralRaf",requestAnimationFrame(function(){return OI(a)}))},QI=function(a){if($APP.n($APP.Il.g($APP.k(a,"__xNeuralModel")))){var b=function(){var g=window.scrollY,h=
|
|
10
10
|
$APP.k(a,"__xNeuralLastScroll");a.__xNeuralLastScroll=g;h!=null&&(a.__xNeuralImpulse=Math.min(1,$APP.k(a,"__xNeuralImpulse")+Math.min(1,Math.abs(g-h)/100)));return null},c=function(g){var h=$APP.k(a,"__xNeuralLastPtr"),l=g.clientX;g=g.clientY;if($APP.n(h)){var m=l-$APP.k(h,"x"),p=g-$APP.k(h,"y");a.__xNeuralImpulse=Math.min(1,$APP.k(a,"__xNeuralImpulse")+Math.min(1,Math.sqrt(m*m+p*p)/50));h.x=l;h.y=g}else a.__xNeuralLastPtr={x:l,y:g};return null},d=function(){a.__xNeuralImpulse=Math.min(1,$APP.k(a,
|
|
11
11
|
"__xNeuralImpulse")+.3);return null},e={scroll:b,pointer:c,key:d};window.addEventListener("scroll",b,{passive:!0});window.addEventListener("pointermove",c,{passive:!0});window.addEventListener("keydown",d,{passive:!0});a.__xNeuralHandlers=e}return null},RI=function(a){var b=$APP.k(a,"__xNeuralHandlers");if($APP.n(b)){var c=$APP.k(b,"scroll");$APP.n(c)&&window.removeEventListener("scroll",c);c=$APP.k(b,"pointer");$APP.n(c)&&window.removeEventListener("pointermove",c);b=$APP.k(b,"key");$APP.n(b)&&window.removeEventListener("keydown",
|
|
12
12
|
b);a.__xNeuralHandlers=null}},SI=function(a){Object.defineProperty(a,"orbCount",{get:function(){return fI(this.getAttribute("orb-count"))},set:function(b){return b==null?this.removeAttribute("orb-count"):this.setAttribute("orb-count",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"colorPrimary",{get:function(){var b=this.getAttribute("color-primary");return gI(b,"#4f8bff")},set:function(b){return b==null?this.removeAttribute("color-primary"):this.setAttribute("color-primary",
|