@vanelsas/baredom 2.4.1 → 2.6.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 +25 -0
- package/README.md +63 -270
- package/custom-elements.json +7373 -0
- package/dist/baredom.d.ts +97 -0
- package/dist/base.js +74 -74
- package/dist/integrity.json +93 -93
- package/dist/x-alert.d.ts +43 -0
- package/dist/x-alert.js +17 -17
- 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 +13 -13
- package/dist/x-badge.d.ts +19 -0
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.d.ts +12 -0
- package/dist/x-bento-grid.js +5 -5
- 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 +15 -15
- 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 +7 -7
- 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 +46 -46
- package/dist/x-checkbox.d.ts +45 -0
- package/dist/x-checkbox.js +11 -11
- 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 +10 -10
- package/dist/x-color-picker.d.ts +47 -0
- package/dist/x-color-picker.js +41 -41
- package/dist/x-combobox.d.ts +47 -0
- package/dist/x-combobox.js +25 -25
- 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 +6 -6
- package/dist/x-context-menu.d.ts +17 -0
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.d.ts +51 -0
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.d.ts +52 -0
- package/dist/x-currency-field.js +23 -21
- package/dist/x-date-picker.d.ts +20 -0
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.d.ts +20 -0
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.d.ts +44 -0
- package/dist/x-drawer.js +11 -11
- 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 +5 -5
- 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 +15 -15
- package/dist/x-form.d.ts +41 -0
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.d.ts +20 -0
- package/dist/x-gaussian-blur.js +16 -16
- package/dist/x-grid.d.ts +12 -0
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.d.ts +15 -0
- package/dist/x-icon.js +7 -7
- package/dist/x-image.d.ts +48 -0
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.d.ts +48 -0
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.d.ts +27 -0
- package/dist/x-kinetic-typography.js +37 -37
- 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 +40 -40
- package/dist/x-liquid-glass.d.ts +25 -0
- package/dist/x-liquid-glass.js +35 -35
- package/dist/x-menu-item.d.ts +41 -0
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.d.ts +42 -0
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.d.ts +21 -0
- package/dist/x-metaball-cursor.js +25 -25
- package/dist/x-modal.d.ts +44 -0
- package/dist/x-modal.js +11 -11
- 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 +12 -12
- package/dist/x-neural-glow.d.ts +22 -0
- package/dist/x-neural-glow.js +30 -30
- 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-divider.js +15 -15
- package/dist/x-organic-progress.d.ts +45 -0
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.d.ts +18 -0
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.d.ts +45 -0
- package/dist/x-pagination.js +17 -16
- package/dist/x-particle-button.d.ts +47 -0
- package/dist/x-particle-button.js +46 -46
- 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 +7 -7
- package/dist/x-progress.d.ts +44 -0
- package/dist/x-progress.js +7 -7
- 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 +11 -11
- package/dist/x-scroll-parallax.d.ts +45 -0
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.d.ts +46 -0
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.d.ts +56 -0
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.d.ts +58 -0
- package/dist/x-scroll-timeline.js +44 -44
- package/dist/x-scroll.d.ts +51 -0
- package/dist/x-scroll.js +39 -39
- package/dist/x-search-field.d.ts +47 -0
- package/dist/x-search-field.js +15 -14
- package/dist/x-select.d.ts +41 -0
- package/dist/x-select.js +10 -10
- package/dist/x-sidebar.d.ts +40 -0
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.d.ts +15 -0
- package/dist/x-skeleton-group.js +13 -13
- package/dist/x-skeleton.d.ts +16 -0
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.d.ts +49 -0
- package/dist/x-slider.js +18 -16
- package/dist/x-soft-body.d.ts +44 -0
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.d.ts +15 -0
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.d.ts +15 -0
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.d.ts +42 -0
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.d.ts +21 -0
- package/dist/x-stat.js +9 -9
- 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 +10 -10
- 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 +19 -19
- 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 +13 -13
- package/dist/x-tabs.d.ts +71 -0
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.d.ts +48 -0
- package/dist/x-text-area.js +20 -18
- package/dist/x-theme.d.ts +15 -0
- package/dist/x-theme.js +24 -24
- 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 +9 -9
- 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 +8 -8
- package/dist/x-welcome-tour.d.ts +92 -0
- package/dist/x-welcome-tour.js +58 -58
- package/package.json +506 -392
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// x-form-field.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XFormFieldEventMap {
|
|
6
|
+
"x-form-field-input": CustomEvent<{ name: string; value: string }>;
|
|
7
|
+
"x-form-field-change": CustomEvent<{ name: string; value: string }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XFormField extends HTMLElement {
|
|
11
|
+
placeholder: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
readonly: boolean;
|
|
16
|
+
type: string;
|
|
17
|
+
label: string;
|
|
18
|
+
autocomplete: string;
|
|
19
|
+
required: boolean;
|
|
20
|
+
|
|
21
|
+
addEventListener<K extends keyof XFormFieldEventMap>(
|
|
22
|
+
type: K,
|
|
23
|
+
listener: (this: XFormField, ev: XFormFieldEventMap[K]) => any,
|
|
24
|
+
options?: boolean | AddEventListenerOptions
|
|
25
|
+
): void;
|
|
26
|
+
addEventListener(
|
|
27
|
+
type: string,
|
|
28
|
+
listener: EventListenerOrEventListenerObject,
|
|
29
|
+
options?: boolean | AddEventListenerOptions
|
|
30
|
+
): void;
|
|
31
|
+
removeEventListener<K extends keyof XFormFieldEventMap>(
|
|
32
|
+
type: K,
|
|
33
|
+
listener: (this: XFormField, ev: XFormFieldEventMap[K]) => any,
|
|
34
|
+
options?: boolean | EventListenerOptions
|
|
35
|
+
): void;
|
|
36
|
+
removeEventListener(
|
|
37
|
+
type: string,
|
|
38
|
+
listener: EventListenerOrEventListenerObject,
|
|
39
|
+
options?: boolean | EventListenerOptions
|
|
40
|
+
): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
"x-form-field": XFormField;
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/x-form-field.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e=$APP.k(b,"hint");b=$APP.k(b,"error");var g=$APP.zf([$APP.pi,$APP.
|
|
4
|
-
g=$APP.D(h,$APP.Ji);var q=$APP.D(h,$APP.$i),v=$APP.D(h,$APP.
|
|
5
|
-
"string"&&$APP.I(
|
|
6
|
-
$APP.n(C)?"hint":$APP.n(v)?"error":null;$APP.n(H)?d.setAttribute("aria-describedby",H):d.removeAttribute("aria-describedby");c.textContent=$APP.U.g(g);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.
|
|
7
|
-
|
|
8
|
-
if($APP.n(b)){b=$APP.k(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.k(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
9
|
-
null;return}}return null},
|
|
10
|
-
enumerable:!0,get:function(){var b=$APP.k(this,"__xFormFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xFormFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})},
|
|
11
|
-
"label","label");
|
|
2
|
+
var HV=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},IV=function(a,b,c){var d=a.hasAttribute("error");var e=a.getAttribute("error");e=$APP.n(e)?e:"";a=a.hasAttribute("required");var g=c.value;return $APP.n(d)?b.setValidity({customError:!0},e,c):$APP.n($APP.n(a)?$APP.B.i(g,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},KV=function(a){var b=$APP.k(a,"__xFormFieldRefs");if($APP.n(b)){var c=$APP.k(b,"label"),d=$APP.k(b,"input"),
|
|
3
|
+
e=$APP.k(b,"hint");b=$APP.k(b,"error");var g=$APP.zf([$APP.pi,$APP.Al,$APP.Ji,$APP.$i,$APP.Ol,$APP.Nh,$APP.Lj,$APP.Em,$APP.oi,$APP.yi,$APP.Pi],[a.getAttribute("label"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.hasAttribute("required"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("autocomplete"),a.getAttribute("type"),a.getAttribute("placeholder")]);var h=$APP.M(g),l=$APP.D(h,$APP.Pi),m=$APP.D(h,$APP.pi),p=$APP.D(h,$APP.Al);
|
|
4
|
+
g=$APP.D(h,$APP.Ji);var q=$APP.D(h,$APP.$i),v=$APP.D(h,$APP.Ol),x=$APP.D(h,$APP.Nh),y=$APP.D(h,$APP.Lj),A=$APP.D(h,$APP.Em),C=$APP.D(h,$APP.oi),E=$APP.D(h,$APP.yi);h=$APP.n(g)?g:"";var H=$APP.n(q)?q:"",G=$APP.n(m)?m:"",J=[$APP.mi,$APP.dn,$APP.sm,$APP.ui,$APP.Aj,$APP.Yi,$APP.Dl,$APP.Z,$APP.al,$APP.Zl,$APP.U,$APP.Ei,$APP.am,$APP.X];x=$APP.F(x);y=$APP.F(y);l=$APP.n(l)?l:"";q=typeof q==="string"&&$APP.N(q,"")&&q!=null;p=$APP.n(p)?p:"";A=$APP.n(A)?A:"";m=typeof m==="string"&&$APP.N(m,"")&&m!=null;E=typeof E===
|
|
5
|
+
"string"&&$APP.I(JV,E)?E:"text";g=$APP.zf(J,[x,y,l,q,p,A,m,E,typeof g==="string"&&$APP.N(g,"")&&g!=null,H,G,h,$APP.n(C)?C:"",$APP.F(v)]);v=$APP.al.g(g);C=$APP.ui.g(g);h=$APP.Dl.g(g);d.type=$APP.Z.g(g);d.name=$APP.Aj.g(g);d.placeholder=$APP.sm.g(g);d.disabled=$APP.X.g(g);d.readOnly=$APP.dn.g(g);d.required=$APP.mi.g(g);d.autocomplete=$APP.am.g(g);H=$APP.n($APP.mi.g(g))?"true":"false";d.setAttribute("aria-required",H);d.setAttribute("aria-invalid",$APP.n(v)?"true":"false");H=$APP.n($APP.n(C)?v:C)?"hint error":
|
|
6
|
+
$APP.n(C)?"hint":$APP.n(v)?"error":null;$APP.n(H)?d.setAttribute("aria-describedby",H):d.removeAttribute("aria-describedby");c.textContent=$APP.U.g(g);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.Zl.g(g);$APP.n(C)?e.classList.remove("hint-hidden"):e.classList.add("hint-hidden");b.textContent=$APP.Ei.g(g);$APP.n(v)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");HV(a,"data-invalid",v);c=$APP.k(a,"__xFormFieldInternals");return $APP.n(c)?
|
|
7
|
+
IV(a,c,d):null}return null},LV=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},MV=function(a){return function(){var b=$APP.k(a,"__xFormFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.k(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),IV(a,e,b));return LV(a,"x-form-field-input",{name:d,value:c})}return null}},NV=function(a){return function(){var b=$APP.k(a,"__xFormFieldRefs");
|
|
8
|
+
if($APP.n(b)){b=$APP.k(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.k(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),IV(a,e,b));return LV(a,"x-form-field-change",{name:d,value:c})}return null}},OV=function(a){var b=$APP.k(a,"__xFormFieldRefs");if($APP.n(b)){var c=$APP.k(a,"__xFormFieldHandlers");if($APP.n(c)){b=$APP.k(b,"input");b.removeEventListener("input",$APP.k(c,"input"));b.removeEventListener("change",$APP.k(c,"change"));a.__xFormFieldHandlers=
|
|
9
|
+
null;return}}return null},PV=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},QV=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return HV(this,c,$APP.F(d))}})},RV=function(a){Object.defineProperty(a,"value",{configurable:!0,
|
|
10
|
+
enumerable:!0,get:function(){var b=$APP.k(this,"__xFormFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xFormFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})},TV=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return SV}});RV(b);PV(b,
|
|
11
|
+
"label","label");PV(b,"type","type");PV(b,"name","name");PV(b,"placeholder","placeholder");PV(b,"autocomplete","autocomplete");QV(b,"disabled","disabled");QV(b,"readOnly","readonly");QV(b,"required","required");b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xFormFieldRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("label"),h=document.createElement("div"),l=document.createElement("input"),m=document.createElement("span"),
|
|
12
12
|
p=document.createElement("span");d.textContent=":host{display:block;color-scheme:light dark;--x-form-field-label-color:var(--x-color-text-muted,#374151);--x-form-field-label-font-size:var(--x-font-size-sm,0.875rem);--x-form-field-input-bg:var(--x-color-surface,#ffffff);--x-form-field-input-color:var(--x-color-text,#111827);--x-form-field-input-border:1px solid var(--x-color-border,#d1d5db);--x-form-field-input-border-radius:var(--x-radius-md,6px);--x-form-field-input-padding:0.5rem 0.75rem;--x-form-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-form-field-error-color:var(--x-color-danger,#dc2626);--x-form-field-hint-color:var(--x-color-text-muted,#6b7280);--x-form-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-form-field-label-color:var(--x-color-text-muted,#d1d5db);--x-form-field-input-bg:var(--x-color-surface-hover,#1f2937);--x-form-field-input-color:var(--x-color-text,#f9fafb);--x-form-field-input-border:1px solid var(--x-color-border,#4b5563);--x-form-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-form-field-error-color:var(--x-color-danger,#f87171);--x-form-field-hint-color:var(--x-color-text-muted,#9ca3af);}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:var(--x-form-field-label-font-size);font-weight:500;color:var(--x-form-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:block;}[part\x3dinput]{display:block;width:100%;box-sizing:border-box;padding:var(--x-form-field-input-padding);background:var(--x-form-field-input-bg);color:var(--x-form-field-input-color);border:var(--x-form-field-input-border);border-radius:var(--x-form-field-input-border-radius);font-size:1rem;line-height:1.5;font-family:inherit;outline:none;transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput]:focus{border-color:var(--x-form-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput]{border-color:var(--x-form-field-error-color);}:host([data-invalid]) [part\x3dinput]:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-error-color) 20%,transparent);}[part\x3dinput]:disabled{opacity:var(--x-form-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-form-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-form-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","field");g.setAttribute("part","label");g.setAttribute("id","label");g.setAttribute("for","input");h.setAttribute("part","input-wrapper");l.setAttribute("part","input");l.setAttribute("id","input");l.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");p.setAttribute("part","error");p.setAttribute("id","error");p.setAttribute("role","alert");p.setAttribute("aria-live","assertive");h.appendChild(l);
|
|
14
|
-
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(p);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:l,hint:m,error:p};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}
|
|
15
|
-
"__xFormFieldRefs");$APP.n(c)&&(c=$APP.k(c,"input"),d=
|
|
16
|
-
return
|
|
17
|
-
$APP.zf([$APP.
|
|
18
|
-
2,[$APP.Z,$APP.Y,$APP.Ik,"autocomplete"],null),new $APP.
|
|
14
|
+
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(p);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:l,hint:m,error:p};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}OV(this);c=$APP.k(this,"__xFormFieldRefs");$APP.n(c)&&(c=$APP.k(c,"input"),d=this.getAttribute("value"),$APP.n(d)&&(c.value=d));c=$APP.k(this,"__xFormFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));c=$APP.k(this,
|
|
15
|
+
"__xFormFieldRefs");$APP.n(c)&&(c=$APP.k(c,"input"),d=MV(this),e=NV(this),c.addEventListener("input",d),c.addEventListener("change",e),this.__xFormFieldHandlers={input:d,change:e});return KV(this)};b.disconnectedCallback=function(){return OV(this)};b.attributeChangedCallback=function(c,d,e){$APP.B.i(c,"value")&&(c=$APP.k(this,"__xFormFieldRefs"),$APP.n(c)&&(c=$APP.k(c,"input"),$APP.N(c.value,e)&&(c.value=$APP.n(e)?e:"")));return KV(this)};b.formDisabledCallback=function(c){HV(this,"disabled",$APP.F(c));
|
|
16
|
+
return KV(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.k(this,"__xFormFieldRefs");$APP.n(c)&&($APP.k(c,"input").value="");c=$APP.k(this,"__xFormFieldInternals");$APP.n(c)&&c.setFormValue("");return KV(this)};return a},UV=function(){return $APP.n(customElements.get("x-form-field"))?null:customElements.define("x-form-field",TV())};var SV="label type name value placeholder hint error disabled readonly required autocomplete".split(" "),JV=new $APP.S(null,new $APP.Q(null,6,["url",null,"tel",null,"email",null,"text",null,"number",null,"password",null],null),null);
|
|
17
|
+
$APP.zf([$APP.sm,$APP.Pj,$APP.Aj,$APP.Yi,$APP.Bj,$APP.Z,$APP.U,$APP.am,$APP.Dk],[new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"placeholder"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"readonly"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"type"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"label"],null),new $APP.Q(null,
|
|
18
|
+
2,[$APP.Z,$APP.Y,$APP.Ik,"autocomplete"],null),new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"required"],null)]);$APP.Pd(["x-form-field-input",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[$APP.Aj,$APP.Y,$APP.Yi,$APP.Y],null)],null),"x-form-field-change",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[$APP.Aj,$APP.Y,$APP.Yi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_form_field.init",UV);export const init=UV;
|
package/dist/x-form.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// x-form.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XFormEventMap {
|
|
6
|
+
"x-form-submit": CustomEvent<{ values: Record<string, any> }>;
|
|
7
|
+
"x-form-reset": CustomEvent<{}>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XForm extends HTMLElement {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
novalidate: boolean;
|
|
13
|
+
autocomplete: string;
|
|
14
|
+
|
|
15
|
+
addEventListener<K extends keyof XFormEventMap>(
|
|
16
|
+
type: K,
|
|
17
|
+
listener: (this: XForm, ev: XFormEventMap[K]) => any,
|
|
18
|
+
options?: boolean | AddEventListenerOptions
|
|
19
|
+
): void;
|
|
20
|
+
addEventListener(
|
|
21
|
+
type: string,
|
|
22
|
+
listener: EventListenerOrEventListenerObject,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
removeEventListener<K extends keyof XFormEventMap>(
|
|
26
|
+
type: K,
|
|
27
|
+
listener: (this: XForm, ev: XFormEventMap[K]) => any,
|
|
28
|
+
options?: boolean | EventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener(
|
|
31
|
+
type: string,
|
|
32
|
+
listener: EventListenerOrEventListenerObject,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
"x-form": XForm;
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/x-form.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.
|
|
4
|
-
$APP.n(e.checked)&&(b[g]=function(){var m=e.value;return $APP.n(m)?m:"on"}()):b[g]=function(){var m=e.value;return $APP.n(m)?m:""}()}d+=1}else break;return b},
|
|
5
|
-
for(var h={ok:!0},l=g.length,m=0;;)if(m<l){var p=g[m];$APP.n(p.reportValidity)&&($APP.n(p.reportValidity())||(h.ok=!1));m+=1}else break;g=h.ok}$APP.n(g)?(g=
|
|
6
|
-
g.type;var h=$APP.k(a,"__xFormRefs");if($APP.n(h)){h=$APP.k(h,"form");g=$APP.B.i(g,"submit")||$APP.B.i(g,"")?h.requestSubmit():$APP.B.i(g,"reset")?h.reset():null;break a}}g=null}return g};b.addEventListener("submit",c);b.addEventListener("reset",d);a.addEventListener("click",e);$APP.ja(a,"__xFormHandlers",{submit:c,reset:d,click:e})}},
|
|
7
|
-
"submit"));b.removeEventListener("reset",$APP.k(c,"reset"));a.removeEventListener("click",$APP.k(c,"click"));a.__xFormHandlers=null;return}}return null},
|
|
8
|
-
b:""},set:function(b){return b!=null&&$APP.N(b)?
|
|
9
|
-
d.textContent=":host{display:block;}[part\x3droot]{display:flex;flex-direction:column;gap:var(--x-form-gap,1rem);width:var(--x-form-width,100%);}:host([loading]){pointer-events:none;opacity:0.6;}";e.setAttribute("part","root");e.setAttribute("novalidate","");e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xFormRefs={form:e}}
|
|
2
|
+
var ZR=function(a,b){return a.setAttribute("autocomplete",b)},cS=function(a){a=new $APP.Q(null,3,[$APP.Dm,a.getAttribute("loading"),$R,$APP.n(a.hasAttribute("novalidate"))?"":null,$APP.oi,a.getAttribute("autocomplete")],null);var b=$APP.M(a),c=$APP.D(b,$APP.Dm);a=$APP.D(b,$R);b=$APP.D(b,$APP.oi);c=c!=null&&$APP.N(c,"false");b=$APP.I(aS,b)?b:"on";return new $APP.Q(null,3,[$APP.Ci,c,bS,a!=null,$APP.am,b],null)},dS=function(a){var b=$APP.k(a,"__xFormRefs");if($APP.n(b)){b=$APP.k(b,"form");a=cS(a);ZR(b,
|
|
3
|
+
$APP.am.g(a));if($APP.n($APP.Ci.g(a)))return b.setAttribute("aria-busy","true"),b.setAttribute("data-loading","");b.removeAttribute("aria-busy");return b.removeAttribute("data-loading")}return null},eS=function(a){a=a.querySelectorAll("[name]:not([disabled])");for(var b={},c=a.length,d=0;;)if(d<c){var e=a[d],g=e.name;if($APP.n(function(){var m=g;return $APP.n(m)?$APP.N(g,""):m}())){var h=e.tagName.toLowerCase(),l=e.getAttribute("type");$APP.B.i(l,"checkbox")||$APP.B.i(l,"radio")||$APP.B.i(h,"x-checkbox")?
|
|
4
|
+
$APP.n(e.checked)&&(b[g]=function(){var m=e.value;return $APP.n(m)?m:"on"}()):b[g]=function(){var m=e.value;return $APP.n(m)?m:""}()}d+=1}else break;return b},fS=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:d}))},gS=function(a){var b=$APP.k(a,"__xFormRefs");if($APP.n(b)){b=$APP.k(b,"form");var c=function(g){g.preventDefault();g=cS(a);if($APP.n($APP.Ci.g(g)))g=null;else{g=bS.g(g);if(!$APP.n(g)){g=a.querySelectorAll("[name]:not([disabled])");
|
|
5
|
+
for(var h={ok:!0},l=g.length,m=0;;)if(m<l){var p=g[m];$APP.n(p.reportValidity)&&($APP.n(p.reportValidity())||(h.ok=!1));m+=1}else break;g=h.ok}$APP.n(g)?(g=eS(a),g=fS(a,"x-form-submit",{values:g},!0)):g=null}return g},d=function(){for(var g=a.querySelectorAll("[name]"),h=g.length,l=0;;)if(l<h){var m=g[l];$APP.n(m.formResetCallback)&&m.formResetCallback();l+=1}else break;return fS(a,"x-form-reset",{},!1)},e=function(g){a:{g=g.target.closest("button,input[type\x3dsubmit],input[type\x3dreset]");if($APP.n(g)){g=
|
|
6
|
+
g.type;var h=$APP.k(a,"__xFormRefs");if($APP.n(h)){h=$APP.k(h,"form");g=$APP.B.i(g,"submit")||$APP.B.i(g,"")?h.requestSubmit():$APP.B.i(g,"reset")?h.reset():null;break a}}g=null}return g};b.addEventListener("submit",c);b.addEventListener("reset",d);a.addEventListener("click",e);$APP.ja(a,"__xFormHandlers",{submit:c,reset:d,click:e})}},hS=function(a){var b=$APP.k(a,"__xFormRefs");if($APP.n(b)){var c=$APP.k(a,"__xFormHandlers");if($APP.n(c)){b=$APP.k(b,"form");b.removeEventListener("submit",$APP.k(c,
|
|
7
|
+
"submit"));b.removeEventListener("reset",$APP.k(c,"reset"));a.removeEventListener("click",$APP.k(c,"click"));a.__xFormHandlers=null;return}}return null},iS=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.F(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},jS=function(a){Object.defineProperty(a,"autocomplete",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("autocomplete");return $APP.n(b)?
|
|
8
|
+
b:""},set:function(b){return b!=null&&$APP.N(b)?ZR(this,""+$APP.T.g(b)):this.removeAttribute("autocomplete")}})},lS=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return kS}});iS(b,"loading","loading");iS(b,"novalidate","novalidate");jS(b);b.connectedCallback=function(){if(!$APP.n(this.shadowRoot)){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("form"),g=document.createElement("slot");
|
|
9
|
+
d.textContent=":host{display:block;}[part\x3droot]{display:flex;flex-direction:column;gap:var(--x-form-gap,1rem);width:var(--x-form-width,100%);}:host([loading]){pointer-events:none;opacity:0.6;}";e.setAttribute("part","root");e.setAttribute("novalidate","");e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xFormRefs={form:e}}hS(this);gS(this);return dS(this)};b.disconnectedCallback=function(){return hS(this)};b.attributeChangedCallback=function(){return dS(this)};b.submit=function(){var c=
|
|
10
10
|
$APP.k(this,"__xFormRefs");return $APP.n(c)?$APP.k(c,"form").requestSubmit():null};b.reset=function(){var c=$APP.k(this,"__xFormRefs");return $APP.n(c)?$APP.k(c,"form").reset():null};b.setFieldError=function(c,d){c=this.querySelector('[name\x3d"'+$APP.T.g(c)+'"]');return $APP.n(c)?d==null||$APP.B.i(d,"")||$APP.B.i(d,void 0)?c.removeAttribute("error"):c.setAttribute("error",d):null};b.clearErrors=function(){for(var c=this.querySelectorAll("[error]"),d=c.length,e=0;;)if(e<d)c[e].removeAttribute("error"),
|
|
11
|
-
e+=1;else return null};return a},
|
|
11
|
+
e+=1;else return null};return a},mS=function(){return $APP.n(customElements.get("x-form"))?null:customElements.define("x-form",lS())},$R=new $APP.K(null,"novalidate-raw","novalidate-raw",1783236714),bS=new $APP.K(null,"novalidate?","novalidate?",491529885);var kS=["loading","novalidate","autocomplete"],aS=new $APP.S(null,new $APP.Q(null,2,["off",null,"on",null],null),null);$APP.Pd(["x-form-submit",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,1,[new $APP.K(null,"values","values",372645556),$APP.jl],null)],null),"x-form-reset",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,$APP.Qd],null)]);$APP.ha("baredom.exports.x_form.init",mS);export const init=mS;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// x-gaussian-blur.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XGaussianBlur extends HTMLElement {
|
|
6
|
+
paused: boolean;
|
|
7
|
+
animation: string;
|
|
8
|
+
speed: string;
|
|
9
|
+
colors: string;
|
|
10
|
+
size: string;
|
|
11
|
+
opacity: string;
|
|
12
|
+
count: string;
|
|
13
|
+
blend: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"x-gaussian-blur": XGaussianBlur;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/x-gaussian-blur.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var wX=function(a,b,c){var d=$APP.z(a);return $APP.We.m($APP.fe,$APP.ae.g(function(e){var g=e*2.39996323,h=50+30*Math.cos(g);g=50+30*Math.sin(g);var l=10*Math.sin(e*2.39996323),m=10*Math.cos(e*Math.PI),p=Math.sin(e*1.618);p=.7+p*p*.6;var q=.8+.4*Math.sin(e*1.3),v=-(e/$APP.oh.i(b,1));return new $APP.Q(null,7,[$APP.Oj,$APP.pc(a,$APP.fd(e,d)),$APP.Ll,h+l,$APP.Kl,g+m,$APP.Mh,c*p,tX,$APP.fd(e,4),uX,q,vX,v],null)}),$APP.dg(0,b))},xX=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),
|
|
3
3
|
d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot");c.textContent=":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;box-sizing:border-box;color-scheme:light dark;--x-gaussian-blur-bg:transparent;--x-gaussian-blur-z-index:0;--x-gaussian-blur-border-radius:0;}:host{border-radius:var(--x-gaussian-blur-border-radius);}[part\x3dbackdrop]{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:var(--x-gaussian-blur-z-index);background:var(--x-gaussian-blur-bg);}[part\x3dcontent]{position:relative;z-index:1;width:100%;height:100%;}.blob{position:absolute;border-radius:50%;will-change:transform;pointer-events:none;}@keyframes x-gb-float-0{0%,100%{transform:translate(-50%,-50%) translate(0,0);}25%{transform:translate(-50%,-50%) translate(12%,-18%);}50%{transform:translate(-50%,-50%) translate(-10%,15%);}75%{transform:translate(-50%,-50%) translate(15%,6%);}}@keyframes x-gb-float-1{0%,100%{transform:translate(-50%,-50%) translate(0,0);}25%{transform:translate(-50%,-50%) translate(-15%,10%);}50%{transform:translate(-50%,-50%) translate(18%,-12%);}75%{transform:translate(-50%,-50%) translate(-8%,-16%);}}@keyframes x-gb-float-2{0%,100%{transform:translate(-50%,-50%) translate(0,0);}25%{transform:translate(-50%,-50%) translate(10%,16%);}50%{transform:translate(-50%,-50%) translate(-18%,-8%);}75%{transform:translate(-50%,-50%) translate(14%,-12%);}}@keyframes x-gb-float-3{0%,100%{transform:translate(-50%,-50%) translate(0,0);}25%{transform:translate(-50%,-50%) translate(-12%,-10%);}50%{transform:translate(-50%,-50%) translate(16%,18%);}75%{transform:translate(-50%,-50%) translate(-10%,14%);}}@keyframes x-gb-pulse-0{0%,100%{transform:translate(-50%,-50%) scale(1) translate(0,0);}33%{transform:translate(-50%,-50%) scale(1.2) translate(10%,-14%);}66%{transform:translate(-50%,-50%) scale(0.85) translate(-10%,10%);}}@keyframes x-gb-pulse-1{0%,100%{transform:translate(-50%,-50%) scale(1) translate(0,0);}33%{transform:translate(-50%,-50%) scale(0.85) translate(-14%,10%);}66%{transform:translate(-50%,-50%) scale(1.2) translate(12%,-8%);}}@keyframes x-gb-pulse-2{0%,100%{transform:translate(-50%,-50%) scale(1) translate(0,0);}33%{transform:translate(-50%,-50%) scale(1.18) translate(8%,16%);}66%{transform:translate(-50%,-50%) scale(0.82) translate(-16%,-10%);}}@keyframes x-gb-pulse-3{0%,100%{transform:translate(-50%,-50%) scale(1) translate(0,0);}33%{transform:translate(-50%,-50%) scale(0.88) translate(-10%,-14%);}66%{transform:translate(-50%,-50%) scale(1.15) translate(10%,16%);}}:host([data-paused]) .blob{animation-play-state:paused;}@media (prefers-reduced-motion:reduce){.blob{animation:none!important;}}";
|
|
4
|
-
d.setAttribute("part","backdrop");d.setAttribute("aria-hidden","true");e.setAttribute("part","content");e.appendChild(g);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xGaussianBlurBackdrop=d;a.__xGaussianBlurSlot=g;a.__xGaussianBlurBlobs=[];a.__xGaussianBlurInit=!0},
|
|
5
|
-
$APP.zf([
|
|
6
|
-
typeof c==="string"&&$APP.N("",c.trim())?(c=parseInt(c.trim(),10),c=$APP.n(isFinite(c))?$APP.
|
|
7
|
-
e:"float";d=d!=null;typeof m==="string"&&$APP.N("",m.trim())?(m=parseFloat(m.trim()),q=isFinite(m),m=$APP.n($APP.n(q)?m>0:q)?m:60):m=60;q=
|
|
8
|
-
d=$APP.D(b,
|
|
9
|
-
e=m.length;l=$APP.z(h);for(g=e;;)if(g<l)q=document.createElement("div"),q.className="blob",d.appendChild(q),m.push(q),g+=1;else break;for(;;)if(e>l)g=m.pop(),d.removeChild(g),--e;else break;for(d=0;;)if(d<l){var v=m[d];q=$APP.pc(h,d);g=p;e=c;var x=$APP.M(q),y=$APP.D(x,$APP.Oj),A=$APP.D(x,$APP.
|
|
10
|
-
E);v.setProperty("height",E);v.setProperty("background","radial-gradient(circle,"+$APP.T.g(y)+" 0%,transparent 70%)");v.setProperty("transform","translate(-50%,-50%)");b:switch(y=H,g){case "float":g="x-gb-float-"+$APP.T.g(y);break b;case "pulse":g="x-gb-pulse-"+$APP.T.g(y);break b;default:g=null}$APP.n(g)?(q*=e,e*=x,v.setProperty("animation",""+$APP.T.g(g)+" "+$APP.T.g(q)+"s ease-in-out "+$APP.T.g(e)+"s infinite")):v.removeProperty("animation");d+=1}else break a}
|
|
11
|
-
c)}$APP.n($APP.k(a,"__xGaussianBlurInit"))||
|
|
4
|
+
d.setAttribute("part","backdrop");d.setAttribute("aria-hidden","true");e.setAttribute("part","content");e.appendChild(g);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xGaussianBlurBackdrop=d;a.__xGaussianBlurSlot=g;a.__xGaussianBlurBlobs=[];a.__xGaussianBlurInit=!0},yX=function(a,b){if($APP.n($APP.n(b)?b.assignedNodes().length>0:null))return a.removeAttribute("role"),a.removeAttribute("aria-hidden");a.setAttribute("role","presentation");return a.setAttribute("aria-hidden","true")},IX=function(a){var b=
|
|
5
|
+
$APP.zf([zX,$APP.Wg,$APP.Gj,$APP.rm,$APP.Mh,$APP.ki,$APP.qi,$APP.Rh,AX],[a.getAttribute("paused"),a.getAttribute("animation"),a.getAttribute("speed"),a.getAttribute("colors"),a.getAttribute("size"),a.getAttribute("blur"),a.getAttribute("opacity"),a.getAttribute("count"),a.getAttribute("blend")]);var c=$APP.M(b);b=$APP.D(c,AX);var d=$APP.D(c,zX),e=$APP.D(c,$APP.Wg),g=$APP.D(c,$APP.Gj);var h=$APP.D(c,$APP.rm);var l=$APP.D(c,$APP.Mh),m=$APP.D(c,$APP.ki),p=$APP.D(c,$APP.qi);c=$APP.D(c,$APP.Rh);h=BX(h);
|
|
6
|
+
typeof c==="string"&&$APP.N("",c.trim())?(c=parseInt(c.trim(),10),c=$APP.n(isFinite(c))?$APP.ph.i(12,$APP.oh.i(1,c)):5):c=5;if(typeof l==="string"&&$APP.N("",l.trim())){l=l.trim();var q=$APP.D(CX,l);$APP.n(q)?l=q:(l=parseFloat(l),q=isFinite(l),l=$APP.n($APP.n(q)?l>0:q)?$APP.ph.i(100,$APP.oh.i(10,l)):50)}else l=50;typeof g==="string"&&$APP.N("",g.trim())?(g=g.trim(),q=$APP.D(DX,g),$APP.n(q)?g=q:(g=parseFloat(g),q=isFinite(g),g=$APP.n($APP.n(q)?g>0:q)?g:10)):g=10;e=typeof e==="string"&&$APP.I(EX,e)?
|
|
7
|
+
e:"float";d=d!=null;typeof m==="string"&&$APP.N("",m.trim())?(m=parseFloat(m.trim()),q=isFinite(m),m=$APP.n($APP.n(q)?m>0:q)?m:60):m=60;q=wX(h,c,l);typeof p==="string"&&$APP.N("",p.trim())?(p=parseFloat(p.trim()),p=$APP.n(isFinite(p))?$APP.ph.i(1,$APP.oh.i(0,p)):.7):p=.7;b=typeof b==="string"&&$APP.I(FX,b)?b:"normal";h=$APP.zf([zX,$APP.Wg,$APP.rm,GX,$APP.ki,$APP.Qm,$APP.qi,$APP.Rh,AX,HX],[d,e,h,g,m,q,p,c,b,l]);b=$APP.M(h);p=$APP.D(b,$APP.ki);c=$APP.D(b,$APP.qi);m=$APP.D(b,AX);l=$APP.D(b,$APP.Wg);
|
|
8
|
+
d=$APP.D(b,zX);e=$APP.k(a,"__xGaussianBlurBackdrop");b=$APP.k(a,"__xGaussianBlurSlot");e.style.setProperty("filter","blur("+$APP.T.g(p)+"px)");e.style.setProperty("opacity",""+$APP.T.g(c));e.style.setProperty("mix-blend-mode",m);$APP.n(d)?a.setAttribute("data-paused",""):a.removeAttribute("data-paused");a.setAttribute("data-animation",l);a:{m=$APP.M(h);h=$APP.D(m,$APP.Qm);p=$APP.D(m,$APP.Wg);c=$APP.D(m,GX);$APP.D(m,$APP.ki);d=$APP.k(a,"__xGaussianBlurBackdrop");m=$APP.k(a,"__xGaussianBlurBlobs");
|
|
9
|
+
e=m.length;l=$APP.z(h);for(g=e;;)if(g<l)q=document.createElement("div"),q.className="blob",d.appendChild(q),m.push(q),g+=1;else break;for(;;)if(e>l)g=m.pop(),d.removeChild(g),--e;else break;for(d=0;;)if(d<l){var v=m[d];q=$APP.pc(h,d);g=p;e=c;var x=$APP.M(q),y=$APP.D(x,$APP.Oj),A=$APP.D(x,$APP.Ll),C=$APP.D(x,$APP.Kl),E=$APP.D(x,$APP.Mh),H=$APP.D(x,tX);q=$APP.D(x,uX);x=$APP.D(x,vX);v=v.style;E=""+$APP.T.g(E)+"%";v.setProperty("left",""+$APP.T.g(A)+"%");v.setProperty("top",""+$APP.T.g(C)+"%");v.setProperty("width",
|
|
10
|
+
E);v.setProperty("height",E);v.setProperty("background","radial-gradient(circle,"+$APP.T.g(y)+" 0%,transparent 70%)");v.setProperty("transform","translate(-50%,-50%)");b:switch(y=H,g){case "float":g="x-gb-float-"+$APP.T.g(y);break b;case "pulse":g="x-gb-pulse-"+$APP.T.g(y);break b;default:g=null}$APP.n(g)?(q*=e,e*=x,v.setProperty("animation",""+$APP.T.g(g)+" "+$APP.T.g(q)+"s ease-in-out "+$APP.T.g(e)+"s infinite")):v.removeProperty("animation");d+=1}else break a}yX(a,b)},JX=function(a){function b(){return yX(a,
|
|
11
|
+
c)}$APP.n($APP.k(a,"__xGaussianBlurInit"))||xX(a);var c=$APP.k(a,"__xGaussianBlurSlot");a.__xGaussianBlurSlotHandler=b;c.addEventListener("slotchange",b);IX(a)},KX=function(a){for(var b=$APP.t(new $APP.O(null,8,5,$APP.P,[new $APP.O(null,3,5,$APP.P,["colors","colors","#6366f1, #ec4899, #14b8a6, #f59e0b"],null),new $APP.O(null,3,5,$APP.P,["blur","blur","60"],null),new $APP.O(null,3,5,$APP.P,["speed","speed","medium"],null),new $APP.O(null,3,5,$APP.P,["count","count","5"],null),new $APP.O(null,3,5,$APP.P,
|
|
12
12
|
["size","size","medium"],null),new $APP.O(null,3,5,$APP.P,["opacity","opacity","0.7"],null),new $APP.O(null,3,5,$APP.P,["animation","animation","float"],null),new $APP.O(null,3,5,$APP.P,["blend","blend","normal"],null)],null)),c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e),h=$APP.Ac(g,0,null),l=$APP.Ac(g,1,null),m=$APP.Ac(g,2,null);Object.defineProperty(a,h,{get:function(v,x,y,A,C,E,H,G){return function(){var J=this.getAttribute(H);return $APP.n(J)?J:G}}(b,c,d,e,g,h,l,m),set:function(v,x,y,A,C,E,H){return function(G){return typeof G===
|
|
13
13
|
"string"&&$APP.N("",G)?this.setAttribute(H,G):this.removeAttribute(H)}}(b,c,d,e,g,h,l,m),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.t(b)){g=h;if($APP.Nc(g))b=$APP.yb(g),e=$APP.zb(g),c=b,d=$APP.z(b),b=e;else{l=$APP.u(g);m=$APP.Ac(l,0,null);var p=$APP.Ac(l,1,null),q=$APP.Ac(l,2,null);Object.defineProperty(a,m,{get:function(v,x,y,A,C,E,H,G){return function(){var J=this.getAttribute(H);return $APP.n(J)?J:G}}(b,c,d,e,l,m,p,q,g,h),set:function(v,x,y,A,C,E,H){return function(G){return typeof G===
|
|
14
|
-
"string"&&$APP.N("",G)?this.setAttribute(H,G):this.removeAttribute(H)}}(b,c,d,e,l,m,p,q,g,h),enumerable:!0,configurable:!0});b=$APP.w(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"paused",{get:function(){return this.hasAttribute("paused")},set:function(v){return $APP.n(v)?this.setAttribute("paused",""):this.removeAttribute("paused")},enumerable:!0,configurable:!0})},
|
|
15
|
-
a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xGaussianBlurSlot"),c=$APP.k(this,"__xGaussianBlurSlotHandler");$APP.n($APP.n(b)?c:b)&&b.removeEventListener("slotchange",c);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&$APP.n($APP.k(this,"__xGaussianBlurInit"))&&
|
|
16
|
-
"speed-s",-1018350546),
|
|
17
|
-
$APP.zf([
|
|
18
|
-
$APP.Ik,"count"],null),new $APP.
|
|
19
|
-
var
|
|
20
|
-
$APP.ce(function(c){return $APP.N("",c)})),a)):
|
|
14
|
+
"string"&&$APP.N("",G)?this.setAttribute(H,G):this.removeAttribute(H)}}(b,c,d,e,l,m,p,q,g,h),enumerable:!0,configurable:!0});b=$APP.w(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"paused",{get:function(){return this.hasAttribute("paused")},set:function(v){return $APP.n(v)?this.setAttribute("paused",""):this.removeAttribute("paused")},enumerable:!0,configurable:!0})},MX=function(){var a=class extends HTMLElement{};a.observedAttributes=LX;a.prototype.connectedCallback=function(){JX(this);return null};
|
|
15
|
+
a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xGaussianBlurSlot"),c=$APP.k(this,"__xGaussianBlurSlotHandler");$APP.n($APP.n(b)?c:b)&&b.removeEventListener("slotchange",c);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&$APP.n($APP.k(this,"__xGaussianBlurInit"))&&IX(this);return null};KX(a.prototype);return a},NX=function(){$APP.n(customElements.get("x-gaussian-blur"))||customElements.define("x-gaussian-blur",MX());return null},GX=new $APP.K(null,"speed-s",
|
|
16
|
+
"speed-s",-1018350546),AX=new $APP.K(null,"blend","blend",249565561),zX=new $APP.K(null,"paused","paused",-1710376127),HX=new $APP.K(null,"size-pct","size-pct",-741809955),tX=new $APP.K(null,"anim-index","anim-index",-1563021855),vX=new $APP.K(null,"delay-factor","delay-factor",-751650178),uX=new $APP.K(null,"duration-factor","duration-factor",-409465019);var LX="colors blur speed count size opacity animation blend paused".split(" ");
|
|
17
|
+
$APP.zf([zX,$APP.Wg,$APP.Gj,$APP.rm,$APP.Mh,$APP.ki,$APP.qi,$APP.Rh,AX],[new $APP.Q(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"paused"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"animation"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"speed"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"colors"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"size"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"blur"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"opacity"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,
|
|
18
|
+
$APP.Ik,"count"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Ik,"blend"],null)]);
|
|
19
|
+
var EX=new $APP.S(null,new $APP.Q(null,3,["float",null,"none",null,"pulse",null],null),null),FX=new $APP.S(null,new $APP.Q(null,5,["soft-light",null,"multiply",null,"screen",null,"normal",null,"overlay",null],null),null),DX=new $APP.Q(null,3,["slow",18,"medium",10,"fast",5],null),CX=new $APP.Q(null,3,["small",30,"medium",50,"large",70],null),BX=function BX(a){return typeof a==="string"&&$APP.N("",a.trim())?(a=a.trim().split(/,/),$APP.We.m($APP.fe,$APP.th.i($APP.ae.g(function(c){return c.trim()}),
|
|
20
|
+
$APP.ce(function(c){return $APP.N("",c)})),a)):BX.g?BX.g("#6366f1, #ec4899, #14b8a6, #f59e0b"):BX.call(null,"#6366f1, #ec4899, #14b8a6, #f59e0b")};$APP.ha("baredom.exports.x_gaussian_blur.init",NX);export const init=NX;
|
package/dist/x-grid.d.ts
ADDED
package/dist/x-grid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a=$APP.D(b
|
|
4
|
-
|
|
5
|
-
$APP.Mk.g(b));c.setProperty("--x-grid-row-gap",$APP.
|
|
6
|
-
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_grid_root=b;a.__x_grid_base=d;a.__x_grid_initialized=!0}
|
|
7
|
-
|
|
2
|
+
var VP=function(a){switch(a){case "none":return"0";case "xs":return"4px";case "sm":return"8px";case "md":return"16px";case "lg":return"24px";case "xl":return"32px";default:return"16px"}},WP=function(a,b,c){return $APP.I(b,a)?a:c},XP=function(a){switch(a){case "row-dense":return"row dense";case "column-dense":return"column dense";default:return a}},YP=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:null},ZP=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:"16rem"},jQ=function(a){var b=$APP.M(a);
|
|
3
|
+
a=$APP.D(b,$P);var c=$APP.D(b,aQ),d=$APP.D(b,$APP.pm),e=$APP.D(b,bQ),g=$APP.D(b,cQ),h=$APP.D(b,$APP.Mk),l=$APP.D(b,dQ),m=$APP.D(b,$APP.qj);b=$APP.D(b,$APP.Yj);h=YP(h);l=ZP(l);var p=WP(b,eQ,"md");b=function(){var v=$APP.I(eQ,d)?d:null;return $APP.n(v)?v:p}();var q=function(){var v=$APP.I(eQ,m)?m:null;return $APP.n(v)?v:p}();g=WP(g,fQ,"stretch");c=WP(c,fQ,"stretch");e=XP(WP(e,gQ,"row"));h=$APP.n(h)?h:"repeat(auto-fit,minmax("+$APP.T.g(l)+",1fr))";return $APP.zf([bQ,cQ,$APP.Mk,$APP.qj,$APP.Yj,hQ,$P,
|
|
4
|
+
iQ,$APP.pm,aQ],[e,g,h,VP(q),p,b,$APP.F(a),q,VP(b),c])},kQ=function(a){var b=$APP.zf([bQ,cQ,$APP.Mk,dQ,$APP.qj,$APP.Yj,$P,$APP.pm,aQ],[a.getAttribute("auto-flow"),a.getAttribute("align-items"),a.getAttribute("columns"),a.getAttribute("min-column-size"),a.getAttribute("column-gap"),a.getAttribute("gap"),a.hasAttribute("inline"),a.getAttribute("row-gap"),a.getAttribute("justify-items")]);b=jQ(b);a=$APP.k(a,"__x_grid_base");if($APP.n(a)){var c=a.style;a.setAttribute("data-gap",$APP.Yj.g(b));c.setProperty("--x-grid-columns",
|
|
5
|
+
$APP.Mk.g(b));c.setProperty("--x-grid-row-gap",$APP.pm.g(b));c.setProperty("--x-grid-column-gap",$APP.qj.g(b));c.setProperty("--x-grid-align-items",cQ.g(b));c.setProperty("--x-grid-justify-items",aQ.g(b));b=c.setProperty("--x-grid-auto-flow",bQ.g(b))}else b=null;return b},lQ=function(a){if(!$APP.Dg(a,"__x_grid_initialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent="\n :host {\n display:block;\n }\n\n :host([inline]) {\n display:inline-block;\n }\n\n .base {\n display:grid;\n box-sizing:border-box;\n grid-template-columns:var(--x-grid-columns);\n row-gap:var(--x-grid-row-gap);\n column-gap:var(--x-grid-column-gap);\n align-items:var(--x-grid-align-items);\n justify-items:var(--x-grid-justify-items);\n grid-auto-flow:var(--x-grid-auto-flow);\n }\n ";
|
|
6
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_grid_root=b;a.__x_grid_base=d;a.__x_grid_initialized=!0}kQ(a);return a},nQ=function(){var a=class extends HTMLElement{};a.observedAttributes=mQ;a.prototype.connectedCallback=function(){return lQ(this)};a.prototype.attributeChangedCallback=function(){return $APP.Dg(this,"__x_grid_initialized")?kQ(this):lQ(this)};return a},oQ=function(){return $APP.n(customElements.get("x-grid"))?null:customElements.define("x-grid",
|
|
7
|
+
nQ())},dQ=new $APP.K(null,"min-column-size","min-column-size",-1066019378),$P=new $APP.K(null,"inline","inline",1399884222),iQ=new $APP.K(null,"column-gap-token","column-gap-token",-10192833),cQ=new $APP.K(null,"align-items","align-items",-267946462),hQ=new $APP.K(null,"row-gap-token","row-gap-token",-219143816),bQ=new $APP.K(null,"auto-flow","auto-flow",-1524521728),aQ=new $APP.K(null,"justify-items","justify-items",1638310783);var mQ="columns min-column-size gap row-gap column-gap align-items justify-items auto-flow inline".split(" "),eQ=new $APP.S(null,new $APP.Q(null,6,["none",null,"xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),fQ=new $APP.S(null,new $APP.Q(null,4,["center",null,"start",null,"stretch",null,"end",null],null),null),gQ=new $APP.S(null,new $APP.Q(null,5,["column-dense",null,"row-dense",null,"dense",null,"column",null,"row",null],null),null);$APP.ha("baredom.exports.x_grid.init",oQ);export const init=oQ;
|
package/dist/x-icon.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// x-icon.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XIcon extends HTMLElement {
|
|
6
|
+
size: string;
|
|
7
|
+
color: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"x-icon": XIcon;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/x-icon.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var DP=function(){return new $APP.Q(null,3,[$APP.Qh,""+$APP.T.g(BP)+"px",CP,"md",$APP.il,BP],null)},FP=function(a){if(typeof a==="string"){a=a.trim();var b=a.toLowerCase();if($APP.B.i("",a))return DP();if($APP.I(EP,b))return a=$APP.D(EP,b),new $APP.Q(null,3,[$APP.Qh,""+$APP.T.g(a)+"px",CP,b,$APP.il,a],null);b=parseInt(a,10);return typeof b==="number"&&$APP.r(isNaN(b))&&b>0&&$APP.B.i(""+$APP.T.g(b),a)?new $APP.Q(null,3,[$APP.Qh,""+$APP.T.g(b)+"px",CP,null,$APP.il,b],null):DP()}return DP()},HP=function(a){if(!$APP.n($APP.k(a,
|
|
3
3
|
"__xIconRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("slot");c.textContent=':host{display:inline-flex;align-items:center;justify-content:center;line-height:0;vertical-align:middle;color:var(--x-icon-color,currentColor);--x-icon-size:20px;}[part\x3dbox]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-icon-size);height:var(--x-icon-size);}::slotted(svg){display:block;width:100%;height:100%;}::slotted(svg[fill\x3d"currentColor"]),::slotted(svg[stroke\x3d"currentColor"]){color:inherit;}';
|
|
4
|
-
d.setAttribute("part","box");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xIconRefs=new $APP.
|
|
5
|
-
typeof e==="string":b)?e:"";c=$APP.Qh.g(c);var g=d;$APP.B.i(g,"inherit")?d="inherit":(d=$APP.D(
|
|
6
|
-
d),a.removeAttribute("aria-hidden")):(a.setAttribute("aria-hidden","true"),a.removeAttribute("role"),a.removeAttribute("aria-label"));a.__xIconModel=b}},
|
|
7
|
-
class extends HTMLElement{};a.observedAttributes=
|
|
8
|
-
|
|
9
|
-
null),
|
|
4
|
+
d.setAttribute("part","box");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xIconRefs=new $APP.Q(null,2,[$APP.Hi,b,GP,d],null)}},PP=function(a){var b=new $APP.Q(null,4,[$APP.Wl,a.getAttribute("size"),$APP.gn,a.getAttribute("color"),$APP.pi,a.getAttribute("label"),IP,a.hasAttribute("label")],null);b=$APP.M(b);var c=$APP.D(b,$APP.Wl),d=$APP.D(b,$APP.gn),e=$APP.D(b,$APP.pi);b=$APP.D(b,IP);c=FP(c);typeof d==="string"?(d=d.trim().toLowerCase(),d=$APP.I(JP,d)?d:"inherit"):d="inherit";e=$APP.n($APP.n(b)?
|
|
5
|
+
typeof e==="string":b)?e:"";c=$APP.Qh.g(c);var g=d;$APP.B.i(g,"inherit")?d="inherit":(d=$APP.D(KP,g),g=$APP.D(LP,g),d="var("+$APP.T.g(d)+","+$APP.T.g(g)+")");b=new $APP.Q(null,4,[MP,c,NP,d,$APP.U,e,OP,$APP.F(b)&&$APP.N("",e)],null);if($APP.N($APP.k(a,"__xIconModel"),b)){b=$APP.M(b);e=$APP.D(b,MP);c=$APP.D(b,NP);d=$APP.D(b,$APP.U);g=$APP.D(b,OP);HP(a);var h=a.style;h.setProperty("--x-icon-size",e);h.setProperty("--x-icon-color",c);$APP.n(g)?(a.setAttribute("role","img"),a.setAttribute("aria-label",
|
|
6
|
+
d),a.removeAttribute("aria-hidden")):(a.setAttribute("aria-hidden","true"),a.removeAttribute("role"),a.removeAttribute("aria-label"));a.__xIconModel=b}},QP=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d==null||$APP.B.i(d,"")?this.removeAttribute(c):this.setAttribute(c,""+$APP.T.g(d))},enumerable:!0,configurable:!0})},RP=function(a){QP(a,"size","size");QP(a,"color","color");QP(a,"label","label")},TP=function(){var a=
|
|
7
|
+
class extends HTMLElement{};a.observedAttributes=SP;a.prototype.connectedCallback=function(){HP(this);PP(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&PP(this);return null};RP(a.prototype);return a},UP=function(){$APP.n(customElements.get("x-icon"))||customElements.define("x-icon",TP());return null},CP=new $APP.K(null,"token","token",-1211463215),NP=new $APP.K(null,"color-css","color-css",-1998870384),
|
|
8
|
+
GP=new $APP.K(null,"box","box",1530920394),MP=new $APP.K(null,"size-css","size-css",-1292915783),IP=new $APP.K(null,"label-present?","label-present?",-367749525),OP=new $APP.K(null,"labelled?","labelled?",-1907816908);var SP=["size","color","label"],EP=new $APP.Q(null,4,["sm",16,"md",20,"lg",24,"xl",32],null),JP=new $APP.S(null,new $APP.Q(null,8,["success",null,"warning",null,"muted",null,"secondary",null,"tertiary",null,"primary",null,"danger",null,"inherit",null],null),null),LP=new $APP.Q(null,7,"primary #2563eb secondary #64748b tertiary #94a3b8 success #16a34a warning #d97706 danger #dc2626 muted #64748b".split(" "),null),KP=new $APP.Q(null,7,"primary --x-color-primary secondary --x-color-secondary tertiary --x-color-tertiary success --x-color-success warning --x-color-warning danger --x-color-danger muted --x-color-text-muted".split(" "),
|
|
9
|
+
null),BP=$APP.D(EP,"md");$APP.ha("baredom.exports.x_icon.init",UP);export const init=UP;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// x-image.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XImageEventMap {
|
|
6
|
+
"x-image-load": CustomEvent<{ src: string; naturalWidth: number; naturalHeight: number }>;
|
|
7
|
+
"x-image-error": CustomEvent<{ src: string }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XImage extends HTMLElement {
|
|
11
|
+
alt: string;
|
|
12
|
+
fit: string;
|
|
13
|
+
src: string;
|
|
14
|
+
readonly state: string;
|
|
15
|
+
decorative: boolean;
|
|
16
|
+
loading: string;
|
|
17
|
+
ratio: string;
|
|
18
|
+
readonly naturalHeight: number;
|
|
19
|
+
readonly naturalWidth: number;
|
|
20
|
+
position: string;
|
|
21
|
+
|
|
22
|
+
addEventListener<K extends keyof XImageEventMap>(
|
|
23
|
+
type: K,
|
|
24
|
+
listener: (this: XImage, ev: XImageEventMap[K]) => any,
|
|
25
|
+
options?: boolean | AddEventListenerOptions
|
|
26
|
+
): void;
|
|
27
|
+
addEventListener(
|
|
28
|
+
type: string,
|
|
29
|
+
listener: EventListenerOrEventListenerObject,
|
|
30
|
+
options?: boolean | AddEventListenerOptions
|
|
31
|
+
): void;
|
|
32
|
+
removeEventListener<K extends keyof XImageEventMap>(
|
|
33
|
+
type: K,
|
|
34
|
+
listener: (this: XImage, ev: XImageEventMap[K]) => any,
|
|
35
|
+
options?: boolean | EventListenerOptions
|
|
36
|
+
): void;
|
|
37
|
+
removeEventListener(
|
|
38
|
+
type: string,
|
|
39
|
+
listener: EventListenerOrEventListenerObject,
|
|
40
|
+
options?: boolean | EventListenerOptions
|
|
41
|
+
): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
"x-image": XImage;
|
|
47
|
+
}
|
|
48
|
+
}
|
package/dist/x-image.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
!1],null)):new $APP.
|
|
2
|
+
var PM=function(a){if(a==null)return new $APP.Q(null,2,[$APP.Qh,null,$APP.Th,!0],null);if(typeof a!=="string")return new $APP.Q(null,2,[$APP.Qh,null,$APP.Th,!1],null);a=a.trim().toLowerCase();if($APP.B.i(a,"")||$APP.B.i(a,"auto"))return new $APP.Q(null,2,[$APP.Qh,null,$APP.Th,!0],null);var b=$APP.eg(OM,a);return $APP.n(b)?(a=parseFloat($APP.pc(b,1)),b=parseFloat($APP.pc(b,2)),a>0&&b>0?new $APP.Q(null,2,[$APP.Qh,""+$APP.T.g(a)+" / "+$APP.T.g(b),$APP.Th,!0],null):new $APP.Q(null,2,[$APP.Qh,null,$APP.Th,
|
|
3
|
+
!1],null)):new $APP.Q(null,2,[$APP.Qh,null,$APP.Th,!1],null)},UM=function(a){var b=$APP.k(a,"__xImageRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("img"),h=document.createElement("div"),l=document.createElement("slot"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("span");c.textContent=":host{display:block;max-width:100%;box-sizing:border-box;color-scheme:light dark;--x-image-radius:var(--x-radius-md,8px);--x-image-bg:var(--x-color-surface,#f3f4f6);--x-image-border:0;--x-image-shimmer-color:var(--x-color-border,rgba(0,0,0,0.08));--x-image-shimmer-highlight:rgba(255,255,255,0.65);--x-image-shimmer-duration:1.5s;--x-image-fade-duration:var(--x-transition-duration,200ms);--x-image-fade-easing:var(--x-transition-easing,ease);--x-image-text:var(--x-color-text-muted,rgba(0,0,0,0.55));--x-image-error-gap:var(--x-space-xs,6px);--x-image-font-family:var(--x-font-family,system-ui,sans-serif);--x-image-font-size:var(--x-font-size-sm,0.875rem);}@media (prefers-color-scheme:dark){:host{--x-image-bg:var(--x-color-surface,#1f2937);--x-image-shimmer-color:var(--x-color-border,rgba(255,255,255,0.08));--x-image-shimmer-highlight:rgba(255,255,255,0.10);--x-image-text:var(--x-color-text-muted,rgba(255,255,255,0.65));}}[part\x3dframe]{position:relative;width:100%;height:100%;min-height:1em;background:var(--x-image-bg);border-radius:var(--x-image-radius);border:var(--x-image-border);overflow:hidden;}[part\x3dimage]{display:block;width:100%;height:100%;opacity:0;transition:opacity var(--x-image-fade-duration) var(--x-image-fade-easing);}:host([data-state\x3dloaded]) [part\x3dimage]{opacity:1;}[part\x3dshimmer]{position:absolute;inset:0;background-color:var(--x-image-shimmer-color);background-image:linear-gradient(90deg,transparent 0%,var(--x-image-shimmer-highlight) 50%,transparent 100%);background-size:200% 100%;background-repeat:no-repeat;background-position:-100% 0;animation:x-image-shimmer var(--x-image-shimmer-duration) linear infinite;}@keyframes x-image-shimmer{0%{background-position:-100% 0;}100%{background-position:100% 0;}}:host([data-state\x3dloaded]) [part\x3dshimmer],:host([data-state\x3derror]) [part\x3dshimmer]{display:none;}[part\x3derror]{position:absolute;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;gap:var(--x-image-error-gap);padding:8px;text-align:center;color:var(--x-image-text);font-family:var(--x-image-font-family);font-size:var(--x-image-font-size);}:host([data-state\x3derror]) [part\x3derror]{display:flex;}:host([data-state\x3derror]) [part\x3dimage]{visibility:hidden;}[part\x3derror-glyph]{font-size:1.5em;line-height:1;}[part\x3derror-text]{line-height:1.25;}@media (prefers-reduced-motion:reduce){[part\x3dshimmer]{animation:none;}[part\x3dimage]{transition:none;}}";
|
|
4
4
|
d.setAttribute("part","frame");e.setAttribute("part","shimmer");e.setAttribute("aria-hidden","true");g.setAttribute("part","image");g.alt="";g.decoding="async";g.loading="lazy";h.setAttribute("part","error");h.setAttribute("role","img");h.setAttribute("aria-label","Image failed to load");l.setAttribute("name","error");m.setAttribute("part","error-default");p.setAttribute("part","error-glyph");p.setAttribute("aria-hidden","true");p.textContent="⚠";q.setAttribute("part","error-text");q.textContent=
|
|
5
|
-
"Image unavailable";m.appendChild(p);m.appendChild(q);l.appendChild(m);h.appendChild(l);d.appendChild(e);d.appendChild(g);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xImageRefs=new $APP.
|
|
6
|
-
|
|
7
|
-
"string"?(d=$APP.Og(d),d=typeof d==="string"&&$APP.N("",d)?d:null):d=null;typeof p==="string"?(p=p.trim().toLowerCase(),p=$APP.I(
|
|
8
|
-
$APP.n(
|
|
9
|
-
"img"),$APP.n(
|
|
10
|
-
h)):(l.removeAttribute("src"),
|
|
11
|
-
"__xImageRefs")),g=$APP.D(e,$APP.yj);e=$APP.k(a,"__xImageCurrentSrc");if($APP.n($APP.n(g)?typeof e==="string"&&$APP.N("",e):g)){var h=g.getAttribute("src");$APP.B.i(h,e)&&(
|
|
12
|
-
d.addEventListener("error",b);$APP.Cg(a,"__xImageHandlers",new $APP.
|
|
13
|
-
$APP.B.i(d,"")?this.removeAttribute(c):this.setAttribute(c,""+$APP.T.g(d))},enumerable:!0,configurable:!0})},
|
|
14
|
-
"naturalWidth",{get:function(){var b=$APP.k(this,"__xImageRefs");return $APP.n(b)?$APP.yj.g(b).naturalWidth:0},enumerable:!0,configurable:!0});Object.defineProperty(a,"naturalHeight",{get:function(){var b=$APP.k(this,"__xImageRefs");return $APP.n(b)?$APP.yj.g(b).naturalHeight:0},enumerable:!0,configurable:!0});Object.defineProperty(a,"state",{get:function(){var b=$APP.k(this,"__xImageState");return $APP.n(b)?b:"loading"},enumerable:!0,configurable:!0})},
|
|
15
|
-
a.observedAttributes=
|
|
16
|
-
|
|
17
|
-
"decorative-present?","decorative-present?",2067744841)
|
|
18
|
-
$APP.zf([$APP.
|
|
19
|
-
new $APP.
|
|
20
|
-
var
|
|
5
|
+
"Image unavailable";m.appendChild(p);m.appendChild(q);l.appendChild(m);h.appendChild(l);d.appendChild(e);d.appendChild(g);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xImageRefs=new $APP.Q(null,6,[$APP.Hi,b,QM,d,RM,e,$APP.yj,g,SM,h,TM,l],null);return $APP.k(a,"__xImageRefs")},VM=function(a,b){a.__xImageState=b;a.setAttribute("data-state",b)},gN=function(a){var b=new $APP.Q(null,8,[$APP.gm,a.getAttribute("src"),$APP.Lm,a.getAttribute("alt"),WM,a.hasAttribute("alt"),XM,a.hasAttribute("decorative"),
|
|
6
|
+
YM,a.getAttribute("ratio"),ZM,a.getAttribute("fit"),$APP.Xj,a.getAttribute("position"),$APP.Dm,a.getAttribute("loading")],null);var c=$APP.M(b),d=$APP.D(c,$APP.gm),e=$APP.D(c,$APP.Lm),g=$APP.D(c,WM),h=$APP.D(c,XM),l=$APP.D(c,YM),m=$APP.D(c,ZM);b=$APP.D(c,$APP.Xj);var p=$APP.D(c,$APP.Dm);h=$APP.F(h);l=PM(l);c=$APP.M(l);l=$APP.D(c,$APP.Qh);c=$APP.D(c,$APP.Th);var q=!h&&$APP.r(g);e=h?"":$APP.n(g)?$APP.n(e)?e:"":"";typeof m==="string"?(m=m.trim().toLowerCase(),m=$APP.I($M,m)?m:"cover"):m="cover";typeof d===
|
|
7
|
+
"string"?(d=$APP.Og(d),d=typeof d==="string"&&$APP.N("",d)?d:null):d=null;typeof p==="string"?(p=p.trim().toLowerCase(),p=$APP.I(aN,p)?p:"lazy"):p="lazy";typeof b==="string"?(b=b.trim(),b=$APP.B.i(b,"")?"center":b):b="center";b=$APP.zf([$APP.ei,bN,$APP.Ak,cN,$APP.yl,dN,eN,$APP.cn,fN],[e,m,d,h,p,c,q,b,l]);$APP.N($APP.k(a,"__xImageModel"),b)&&(h=UM(a),c=$APP.M(h),h=$APP.D(c,QM),l=$APP.D(c,$APP.yj),c=$APP.D(c,SM),q=$APP.k(a,"__xImageModel"),p=$APP.n(q)?$APP.Ak.g(q):null,q=q==null||$APP.N(p,$APP.Ak.g(b)),
|
|
8
|
+
$APP.n(fN.g(b))?h.style.aspectRatio=fN.g(b):h.style.aspectRatio="",$APP.n(dN.g(b))||$APP.n($APP.k(a,"__xImageWarnedRatio"))||(a.__xImageWarnedRatio=!0,console.warn('[x-image] Invalid ratio attribute; expected "W:H" (e.g. "16:9").')),l.style.objectFit=bN.g(b),l.style.objectPosition=$APP.cn.g(b),l.loading=$APP.yl.g(b),l.decoding="async",$APP.n(cN.g(b))?(l.alt="",a.setAttribute("aria-hidden","true"),a.removeAttribute("role")):(l.alt=$APP.ei.g(b),a.removeAttribute("aria-hidden"),a.setAttribute("role",
|
|
9
|
+
"img"),$APP.n(eN.g(b))&&!$APP.n($APP.k(a,"__xImageWarnedAlt"))&&(a.__xImageWarnedAlt=!0,console.warn('[x-image] Missing alt attribute. Set alt\x3d"…" or add the `decorative` attribute.'))),c.setAttribute("aria-label",$APP.r(cN.g(b))&&$APP.N("",$APP.ei.g(b))?$APP.ei.g(b):"Image failed to load"),q&&(h=$APP.Ak.g(b),l=$APP.M($APP.k(a,"__xImageRefs")),l=$APP.D(l,$APP.yj),$APP.N($APP.k(a,"__xImageCurrentSrc"),h)&&(a.__xImageCurrentSrc=h,typeof h==="string"&&$APP.N("",h)?(VM(a,"loading"),l.setAttribute("src",
|
|
10
|
+
h)):(l.removeAttribute("src"),VM(a,"loading")))),a.__xImageModel=b)},kN=function(a){function b(){var e=$APP.M($APP.k(a,"__xImageRefs")),g=$APP.D(e,$APP.yj);e=$APP.k(a,"__xImageCurrentSrc");$APP.n($APP.n(g)?typeof e==="string"&&$APP.N("",e):g)&&(g=g.getAttribute("src"),$APP.B.i(g,e)&&(VM(a,"error"),e=$APP.Hh(new $APP.Q(null,1,[$APP.Ak,$APP.n(e)?e:""],null)),e=new CustomEvent("x-image-error",{detail:e,bubbles:!0,composed:!0,cancelable:!1}),a.dispatchEvent(e)));return null}function c(){var e=$APP.M($APP.k(a,
|
|
11
|
+
"__xImageRefs")),g=$APP.D(e,$APP.yj);e=$APP.k(a,"__xImageCurrentSrc");if($APP.n($APP.n(g)?typeof e==="string"&&$APP.N("",e):g)){var h=g.getAttribute("src");$APP.B.i(h,e)&&(VM(a,"loaded"),h=g.naturalWidth,g=g.naturalHeight,e=$APP.Hh(new $APP.Q(null,3,[$APP.Ak,$APP.n(e)?e:"",hN,$APP.n(h)?h:0,iN,$APP.n(g)?g:0],null)),e=new CustomEvent("x-image-load",{detail:e,bubbles:!0,composed:!0,cancelable:!1}),a.dispatchEvent(e))}return null}var d=UM(a);d=$APP.M(d);d=$APP.D(d,$APP.yj);d.addEventListener("load",c);
|
|
12
|
+
d.addEventListener("error",b);$APP.Cg(a,"__xImageHandlers",new $APP.Q(null,2,[jN,c,$APP.Ei,b],null))},lN=function(a){var b=$APP.k(a,"__xImageHandlers"),c=$APP.k(a,"__xImageRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.yj.g(c);var d=jN.g(b);b=$APP.Ei.g(b);$APP.n(d)&&c.removeEventListener("load",d);$APP.n(b)&&c.removeEventListener("error",b)}a.__xImageHandlers=null},mN=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d==null||
|
|
13
|
+
$APP.B.i(d,"")?this.removeAttribute(c):this.setAttribute(c,""+$APP.T.g(d))},enumerable:!0,configurable:!0})},nN=function(a){mN(a,"src","src");mN(a,"alt","alt");mN(a,"ratio","ratio");mN(a,"fit","fit");mN(a,"position","position");mN(a,"loading","loading");Object.defineProperty(a,"decorative",{get:function(){return this.hasAttribute("decorative")},set:function(b){return $APP.n(b)?this.setAttribute("decorative",""):this.removeAttribute("decorative")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
14
|
+
"naturalWidth",{get:function(){var b=$APP.k(this,"__xImageRefs");return $APP.n(b)?$APP.yj.g(b).naturalWidth:0},enumerable:!0,configurable:!0});Object.defineProperty(a,"naturalHeight",{get:function(){var b=$APP.k(this,"__xImageRefs");return $APP.n(b)?$APP.yj.g(b).naturalHeight:0},enumerable:!0,configurable:!0});Object.defineProperty(a,"state",{get:function(){var b=$APP.k(this,"__xImageState");return $APP.n(b)?b:"loading"},enumerable:!0,configurable:!0})},pN=function(){var a=class extends HTMLElement{};
|
|
15
|
+
a.observedAttributes=oN;a.prototype.connectedCallback=function(){UM(this);lN(this);kN(this);$APP.k(this,"__xImageState")==null&&VM(this,"loading");gN(this);return null};a.prototype.disconnectedCallback=function(){lN(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&gN(this);return null};nN(a.prototype);return a},qN=function(){$APP.n(customElements.get("x-image"))||customElements.define("x-image",pN());return null},QM=new $APP.K(null,"frame","frame",-1711082588),
|
|
16
|
+
ZM=new $APP.K(null,"fit-raw","fit-raw",792829585),cN=new $APP.K(null,"decorative?","decorative?",131461581),SM=new $APP.K(null,"error-box","error-box",1060106676),fN=new $APP.K(null,"ratio-css","ratio-css",1208951932),RM=new $APP.K(null,"shimmer","shimmer",2123148747),TM=new $APP.K(null,"error-slot","error-slot",493821239),YM=new $APP.K(null,"ratio-raw","ratio-raw",-1076891672),eN=new $APP.K(null,"warn-alt?","warn-alt?",-638898603),jN=new $APP.K(null,"load","load",-1318641184),XM=new $APP.K(null,
|
|
17
|
+
"decorative-present?","decorative-present?",2067744841),bN=new $APP.K(null,"fit","fit",869444807),WM=new $APP.K(null,"alt-present?","alt-present?",-707038767),hN=new $APP.K(null,"naturalWidth","naturalWidth",-1890093257),iN=new $APP.K(null,"naturalHeight","naturalHeight",227028566),dN=new $APP.K(null,"ratio-valid?","ratio-valid?",-713026893);var oN="src alt decorative ratio fit position loading".split(" ");
|
|
18
|
+
$APP.zf([$APP.ei,bN,$APP.Ak,new $APP.K(null,"state","state",-1988618099),new $APP.K(null,"decorative","decorative",-238973678),$APP.yl,$APP.xj,iN,hN,$APP.cn],[new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.Bj,!0],null),new $APP.Q(null,1,[$APP.Z,$APP.Zj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,2,[$APP.Z,$APP.W,$APP.Bj,!0],null),
|
|
19
|
+
new $APP.Q(null,2,[$APP.Z,$APP.W,$APP.Bj,!0],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null)]);$APP.Pd(["x-image-load",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.Ak,$APP.Y,hN,$APP.W,iN,$APP.W],null),$APP.lm,!1],null),"x-image-error",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,1,[$APP.Ak,$APP.Y],null),$APP.lm,!1],null)]);
|
|
20
|
+
var $M=new $APP.S(null,new $APP.Q(null,5,["cover",null,"none",null,"fill",null,"scale-down",null,"contain",null],null),null),aN=new $APP.S(null,new $APP.Q(null,2,["eager",null,"lazy",null],null),null),OM=/^\s*(\d+(?:\.\d+)?)\s*[:\/]\s*(\d+(?:\.\d+)?)\s*$/;$APP.ha("baredom.exports.x_image.init",qN);export const init=qN;
|