Files
WRNexusJS/packages/ui/components/Footer.wrn
T
ClintchizandClaude Opus 5 5e65627305
Quality / quality (ubuntu-latest) (push) Failing after 13m39s
Quality / quality (windows-latest) (push) Canceled after 0s
fix(csr,ui): deliver component outputs to parent bindings
An output only reaches a parent @binding when the component calls
output.<name>(). Two separate faults meant most of the library never got
there, and both failed silently at each end.

HTML lowercases attribute names, so a parent's @sizeChange registered under
"sizechange" while the component emitted "sizeChange". The lookup missed, fell
through to a DOM dispatch, and the binding was never invoked. That made all 17
camelCase outputs undeliverable -- DataTable.pageChange and .rowClick,
Map.markerClick, ChatBubble.messageClick, LayoutSplitter.sizeChange and the
rest. invokeComponentOutput now falls back to a case-insensitive lookup, and a
csr test fails without it.

Separately, 18 components dispatched hand-built CustomEvents rather than
calling output.*. A bubbling event on the component's own root never reaches a
binding, because parent handlers live in a registry only the output proxy
reads. Card, Footer, Breadcrumb, Accordion, alert, Badge, AnnouncementBar,
AvatarGroup, ToggleCount and InputNumber now emit properly; Marquee, Map,
Timeline, List and SearchBox additionally declare the outputs they were
already firing. Dispatches on window are left alone -- that is how Toaster,
Modal and DataTable signal across component boundaries.

Verified in a browser both ways before and after: an AnnouncementBar
dispatching its own bubbling "dismiss" never reached a page-level @dismiss,
and reached it immediately once it called output.dismiss().

This corrects the audit, which called the LayoutSplitter failure "narrow and
unexplained" and read 32 dead outputs as 16 components needing a rebuild.
"Outputs work elsewhere" was an assumption; the components that worked
happened to use lowercase names and output.*. The dead-output ratchet drops
from 32 to 22, and a new test forbids the raw-CustomEvent pattern outright.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 01:40:39 +05:30

289 lines
9.3 KiB
Plaintext

component Footer {
outputs {
select(payload: { value?: string | number | boolean | null; values?: Array<string | number | boolean | null | object>; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null)
action(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
}
props {
size: string = "default"
color: string = "primary"
label: string = "Footer navigation"
items: unknown[] = []
columns: number = 3
maxWidth: string = "compact"
copyright: string = ""
class: string = ""
}
view {
<footer
{...attrs}
data-ui-component="Footer"
data-size='{size}'
data-color='{color}'
class='wire-footer {maxWidth === "full" ? "wire-footer--width-full" : ""} {class}'
>
<div
class="wire-footer__grid"
>
<div
class="wire-footer__pre"
>
<slot
name="pre-footer"
>
</slot>
</div>
{#if items.length > 0}
<nav
class='wire-footer__links wire-footer--columns-{columns}'
aria-label='{label}'
>
{#each items as item, itemIndex}
{#if item.type === "header"}
<section
class="wire-footer__column"
aria-labelledby='footer-heading-{itemIndex}'
>
{#if item.icon}
<span
class='{item.icon}'
aria-hidden="true"
>
</span>
{/if}
<h2
id='footer-heading-{itemIndex}'
class="wire-footer__heading"
>
{item.label || item.title}
</h2>
{#if item.description}
<p>
{item.description}
</p>
{/if}
{#if (item.items || item.links || []).length > 0}
<div
class="wire-footer__column-links"
>
{#each item.items || item.links || [] as child, childIndex}
<a
href='{child.href || "#"}'
target='{child.target || ""}'
rel='{child.external ? "noopener noreferrer" : (child.rel || "")}'
aria-current='{child.active ? "page" : ""}'
class="wire-footer__link"
@click='output.select({ item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex }); child.action && output.action({ item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex })'
>
{#if child.icon}
<span
class='{child.icon}'
aria-hidden="true"
>
</span>
{/if}
<span>
{child.label || child.title}
</span>
{#if child.badge}
<span
class="wire-badge wire-badge--default"
>
{child.badge}
</span>
{/if}
{#if child.external}
<span
class="icon-[lucide--arrow-up-right]"
aria-hidden="true"
>
</span>
{/if}
</a>
{/each}
</div>
{/if}
</section>
{:else if item.type === "link" || item.href}
<section
class="wire-footer__column"
>
<div
class="wire-footer__column-links"
>
<a
href='{item.href || "#"}'
target='{item.target || ""}'
rel='{item.external ? "noopener noreferrer" : (item.rel || "")}'
aria-current='{item.active ? "page" : ""}'
class="wire-footer__link"
@click='output.select({ item: item, itemIndex: itemIndex }); item.action && output.action({ item: item, itemIndex: itemIndex })'
>
{#if item.icon}
<span
class='{item.icon}'
aria-hidden="true"
>
</span>
{/if}
<span>
{item.label || item.title}
</span>
{#if item.badge}
<span
class="wire-badge wire-badge--default"
>
{item.badge}
</span>
{/if}
{#if item.external}
<span
class="icon-[lucide--arrow-up-right]"
aria-hidden="true"
>
</span>
{/if}
</a>
</div>
</section>
{:else}
<section
class="wire-footer__column"
aria-labelledby='footer-heading-{itemIndex}'
>
{#if item.icon}
<span
class='{item.icon}'
aria-hidden="true"
>
</span>
{/if}
{#if item.title || item.label}
<h2
id='footer-heading-{itemIndex}'
class="wire-footer__heading"
>
{item.title || item.label}
</h2>
{/if}
{#if item.description}
<p>
{item.description}
</p>
{/if}
{#if (item.items || item.links || []).length > 0}
<div
class="wire-footer__column-links"
>
{#each item.items || item.links || [] as child, childIndex}
<a
href='{child.href || "#"}'
target='{child.target || ""}'
rel='{child.external ? "noopener noreferrer" : (child.rel || "")}'
aria-current='{child.active ? "page" : ""}'
class="wire-footer__link"
@click='output.select({ item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex }); child.action && output.action({ item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex })'
>
{#if child.icon}
<span
class='{child.icon}'
aria-hidden="true"
>
</span>
{/if}
<span>
{child.label || child.title}
</span>
{#if child.badge}
<span
class="wire-badge wire-badge--default"
>
{child.badge}
</span>
{/if}
{#if child.external}
<span
class="icon-[lucide--arrow-up-right]"
aria-hidden="true"
>
</span>
{/if}
</a>
{/each}
</div>
{/if}
</section>
{/if}
{/each}
</nav>
{/if}
<div
class="wire-footer__post"
>
<slot
name="post-footer"
>
</slot>
</div>
</div>
<div
class="wire-footer__bottom wire-footer__bottom--slots"
>
<div
class="wire-footer__copyright-left"
>
<slot
name="copyright-left"
>
</slot>
</div>
{#if copyright}
<div
class="wire-footer__bottom"
>
<div></div>
<p
class="wire-footer__copyright"
>
{copyright}
</p>
<div></div>
</div>
{/if}
<div
class="wire-footer__copyright-right"
>
<slot
name="copyright-right"
>
</slot>
</div>
</div>
</footer>
}
}