Mats Bosson bf576905a7
Some checks are pending
CI / check (push) Waiting to run
All components, schemas, tests, MCP, and showcase
- 51 headless Web Components (45 core + 6 animation)
- Shared helpers: emit(), part(), listen(), wireLabel(), initialValue()
- Zero `new CustomEvent` or `static #counter` — all use shared utils
- Zod schemas for all 44 core components
- MCP package with discover, inspect, compose, validate tools
- Showcase with Aperture Science theme, M3 Expressive motion
- 81 tests passing, TypeScript strict mode clean
- Signals (~500B), SPA router (~400B), zero dependencies
2026-03-31 20:21:41 +07:00

19 lines
721 B
TypeScript

/** PettyComboboxOption — single option within a combobox listbox. */
export class PettyComboboxOption extends HTMLElement {
static observedAttributes = ["value", "disabled"];
get value(): string { return this.getAttribute("value") ?? this.textContent?.trim() ?? ""; }
get disabled(): boolean { return this.hasAttribute("disabled"); }
connectedCallback(): void {
this.setAttribute("role", "option");
this.setAttribute("tabindex", "-1");
this.setAttribute("aria-selected", "false");
if (this.disabled) this.setAttribute("aria-disabled", "true");
}
attributeChangedCallback(name: string): void {
if (name === "disabled") this.setAttribute("aria-disabled", String(this.disabled));
}
}