@ui-organized/angular 0.0.0-stage → 6.0.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/LICENSE +201 -0
- package/README.md +166 -2
- package/dist/LICENSE +201 -0
- package/dist/README.md +167 -0
- package/dist/fesm2022/ui-organized-angular-icons-heroicons.mjs +179 -0
- package/dist/fesm2022/ui-organized-angular-icons-heroicons.mjs.map +1 -0
- package/dist/fesm2022/ui-organized-angular-icons-lucide.mjs +130 -0
- package/dist/fesm2022/ui-organized-angular-icons-lucide.mjs.map +1 -0
- package/dist/fesm2022/ui-organized-angular-icons-tabler.mjs +159 -0
- package/dist/fesm2022/ui-organized-angular-icons-tabler.mjs.map +1 -0
- package/dist/fesm2022/ui-organized-angular.mjs +32267 -0
- package/dist/fesm2022/ui-organized-angular.mjs.map +1 -0
- package/dist/overlay.css +23 -0
- package/dist/styles.css +6045 -0
- package/dist/types/ui-organized-angular-icons-heroicons.d.ts +53 -0
- package/dist/types/ui-organized-angular-icons-lucide.d.ts +53 -0
- package/dist/types/ui-organized-angular-icons-tabler.d.ts +53 -0
- package/dist/types/ui-organized-angular.d.ts +10359 -0
- package/overlay.css +23 -0
- package/package.json +114 -3
- package/styles.css +6045 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-organized-angular.mjs","sources":["../../src/lib/part.ts","../../src/lib/host-presence.ts","../../src/lib/icons/glyph.ts","../../src/lib/icons/icon-config.ts","../../src/lib/icons/registry.ts","../../src/lib/icons/warn-missing-icon-set.ts","../../src/lib/icons/icon.ts","../../src/lib/alert/alert.ts","../../src/lib/button/button.ts","../../src/lib/part-ids.ts","../../src/lib/field/field-context.ts","../../src/lib/field-error/field-error.ts","../../src/lib/interaction-state.ts","../../src/lib/switch/switch.ts","../../src/lib/checkbox/checkbox.ts","../../src/lib/field/fieldset.ts","../../src/lib/field/field.ts","../../src/lib/input/input.ts","../../src/lib/text-area/text-area.ts","../../src/lib/radio/radio.ts","../../src/lib/card/card.ts","../../src/lib/divider/divider.ts","../../src/lib/tag/tag.ts","../../src/lib/chip/chip.ts","../../src/lib/skeleton/skeleton.ts","../../src/lib/overlay/stacking.ts","../../src/lib/overlay/surface.ts","../../src/lib/overlay/anchor.ts","../../src/lib/overlay/dismiss.ts","../../src/lib/overlay/aria-hidden.ts","../../src/lib/overlay/focus.ts","../../src/lib/dialog/dialog-context.ts","../../src/lib/overlay/flush.ts","../../src/lib/dialog/dialog.ts","../../src/lib/overlay/anchored.ts","../../src/lib/popover/popover-context.ts","../../src/lib/popover/popover.ts","../../src/lib/tooltip/tooltip.ts","../../src/lib/overlay/roving.ts","../../src/lib/menubar/menubar-context.ts","../../src/lib/menu/menu.ts","../../src/lib/select/select.ts","../../src/lib/tabs/tabs.ts","../../src/lib/accordion/accordion.ts","../../src/lib/toast/toast.ts","../../src/lib/breadcrumb/breadcrumb.ts","../../src/lib/menubar/menubar.ts","../../src/lib/toolbar/toolbar.ts","../../src/lib/meter/meter.ts","../../src/lib/pagination/pagination.ts","../../src/lib/navigation/nav-context.ts","../../src/lib/navigation/navigation.ts","../../src/lib/collapsible/collapsible-context.ts","../../src/lib/collapsible/collapsible.ts","../../src/lib/toggle/toggle-group-context.ts","../../src/lib/toggle/toggle.ts","../../src/lib/number-field/number-field.ts","../../src/lib/password-input/password-input.ts","../../src/lib/search-input/search-input.ts","../../src/lib/segmented-control/segmented-control.ts","../../src/lib/avatar/avatar.ts","../../src/lib/progress/progress.ts","../../src/lib/clipboard/clipboard.ts","../../src/lib/listbox/listbox.ts","../../src/lib/scroll-area/scroll-area.ts","../../src/lib/combobox/combobox.ts","../../src/lib/alert-dialog/alert-dialog.ts","../../src/lib/sheet/sheet.ts","../../src/lib/hover-card/hover-card.ts","../../src/lib/context-menu/pointer-surface.ts","../../src/lib/context-menu/context-menu.ts","../../src/lib/splitter/splitter.ts","../../src/lib/tree-view/tree-view.ts","../../src/lib/pin-input/pin-input.ts","../../src/lib/tags-input/tags-input.ts","../../src/lib/rating-group/rating-group.ts","../../src/lib/editable/editable.ts","../../src/lib/file-upload/file-upload.ts","../../src/lib/steps/steps.ts","../../src/lib/range/range.ts","../../src/lib/angle-slider/angle-slider.ts","../../src/lib/timer/timer.ts","../../src/lib/qr-code/qr-encoder.ts","../../src/lib/qr-code/qr-code.ts","../../src/lib/calendar/calendar-keys.ts","../../src/lib/calendar/calendar.ts","../../src/lib/date-field/coarse-pointer.ts","../../src/lib/date-field/open-date-picker.ts","../../src/lib/date-field/date-popover.ts","../../src/lib/date-field/date-field-base.ts","../../src/lib/date-input/date-input.ts","../../src/lib/date-time-input/date-time-input.ts","../../src/lib/date-range-input/date-range-input.ts","../../src/lib/date-picker/date-picker-grid.ts","../../src/lib/date-picker/date-picker.ts","../../src/lib/carousel/carousel.ts","../../src/lib/marquee/marquee.ts","../../src/lib/signature-pad/signature-stroke.ts","../../src/lib/signature-pad/signature-pad.ts","../../src/lib/image-cropper/crop-geometry.ts","../../src/lib/image-cropper/image-cropper.ts","../../src/lib/floating-panel/floating-panel.ts","../../src/lib/tour/tour.ts","../../src/lib/color-picker/color.ts","../../src/lib/color-picker/channel-fields.ts","../../src/lib/color-picker/color-picker.ts","../../src/ui-organized-angular.ts"],"sourcesContent":["import { Directive, signal, type Signal } from \"@angular/core\";\n\n/**\n * The base every Angular part extends, and the reason the Angular library can\n * share a stylesheet with three libraries that do not exist in Angular.\n *\n * ── What it is for ──────────────────────────────────────────────────────────\n *\n * Almost all of the interactive styling in `@ui-organized/core` keys off\n * attributes a Zag state machine writes — `[data-state=\"open\"]`,\n * `[data-highlighted]`, `[data-disabled]`, `[data-invalid]`. React, Svelte and\n * Vue get them free: Zag emits them and the component spreads its props. Angular\n * has no Zag, so every one of them is hand-written, and a missed attribute is\n * not an error. It is a control that renders perfectly and never shows that it\n * is disabled.\n *\n * So the whole vocabulary is declared once, here, and bound on every part. A\n * part that never reports `hover` emits nothing — `null` removes the attribute —\n * but the binding exists, which turns \"nobody thought about hover\" into a\n * visible omission rather than an absence with no shape.\n *\n * The names and the *shape* of the values are Zag's, not ours: a boolean is\n * written as presence (`data-disabled=\"\"`), never `=\"true\"`, because the\n * stylesheet selects on `[data-disabled]`. `stateFlag` is the only correct way\n * to produce one. See `state-contract.json` in `@ui-organized/core` for the\n * derived list of what the CSS actually reads.\n *\n * ── How a part uses it ──────────────────────────────────────────────────────\n *\n * Subclasses declare `scope` and `part`, and *replace* whichever signals they\n * can report — usually with an `input()` or a `computed()`:\n *\n * ```ts\n * @Component({ selector: \"uio-switch\", ... })\n * export class UioSwitch extends UioPart {\n * readonly scope = \"switch\";\n * readonly part = \"root\";\n * override readonly disabled = input(false);\n * override readonly state = computed(() => (this.checked() ? \"checked\" : \"unchecked\"));\n * }\n * ```\n *\n * Replacing a base field only works because this package compiles with\n * `useDefineForClassFields: false`. With the flag on, a subclass field\n * initialiser runs *after* the base constructor and overwrites the base's value\n * with `undefined` at the moment the host binding reads it.\n */\n\n/**\n * A boolean state attribute, in Zag's spelling: present and empty when true,\n * absent when false.\n *\n * `=\"true\"`/`=\"false\"` would be the natural Angular thing to write and is wrong\n * both ways round — `[data-disabled]` matches `=\"false\"` too, so a disabled\n * style would apply to every enabled control.\n */\nexport function stateFlag(value: boolean | undefined | null): \"\" | null {\n return value ? \"\" : null;\n}\n\n/**\n * Every attribute `UioPart` can emit.\n *\n * Exported so `part.spec.ts` can hold it against what the base actually renders,\n * and against the state contract derived from the stylesheets — an attribute\n * bound here that no CSS reads is dead weight, and one the CSS reads that is not\n * bound here is a gap with a name.\n */\nexport const UIO_PART_ATTRIBUTES = [\n \"data-scope\",\n \"data-part\",\n \"data-state\",\n \"data-disabled\",\n \"data-invalid\",\n \"data-readonly\",\n \"data-focus\",\n \"data-focus-visible\",\n \"data-hover\",\n \"data-highlighted\",\n \"data-selected\",\n \"data-orientation\",\n] as const;\n\n@Directive({\n host: {\n \"[attr.data-scope]\": \"scope\",\n \"[attr.data-part]\": \"part\",\n \"[attr.data-state]\": \"state()\",\n \"[attr.data-disabled]\": \"flag(disabled())\",\n \"[attr.data-invalid]\": \"flag(invalid())\",\n \"[attr.data-readonly]\": \"flag(readOnly())\",\n \"[attr.data-focus]\": \"flag(focus())\",\n \"[attr.data-focus-visible]\": \"flag(focusVisible())\",\n \"[attr.data-hover]\": \"flag(hover())\",\n \"[attr.data-highlighted]\": \"flag(highlighted())\",\n \"[attr.data-selected]\": \"flag(selected())\",\n \"[attr.data-orientation]\": \"orientation()\",\n },\n})\nexport abstract class UioPart {\n /** Zag's machine name — `\"dialog\"`, `\"select\"`. Fixed per component. */\n abstract readonly scope: string;\n /** Zag's part name — `\"root\"`, `\"trigger\"`, `\"content\"`. Fixed per element. */\n abstract readonly part: string;\n\n /** The machine's own state word: `\"open\"`, `\"closed\"`, `\"checked\"`, … */\n readonly state: Signal<string | null> = signal(null);\n readonly disabled: Signal<boolean> = signal(false);\n readonly invalid: Signal<boolean> = signal(false);\n readonly readOnly: Signal<boolean> = signal(false);\n readonly focus: Signal<boolean> = signal(false);\n readonly focusVisible: Signal<boolean> = signal(false);\n readonly hover: Signal<boolean> = signal(false);\n readonly highlighted: Signal<boolean> = signal(false);\n readonly selected: Signal<boolean> = signal(false);\n readonly orientation: Signal<\"horizontal\" | \"vertical\" | null> = signal(null);\n\n /** Template-visible so the host bindings above can use it. */\n protected readonly flag = stateFlag;\n}\n","import { ElementRef, inject } from \"@angular/core\";\n\n/**\n * Take a component's own host element out of the DOM, and put it back.\n *\n * Several components in this library render **nothing** in some state — `Icon`\n * with a name its set does not have, `FieldError` with an empty message. In the\n * other three libraries that is a `return null` and no element exists. An\n * Angular directive cannot decline to render the element the caller wrote, so it\n * removes it instead.\n *\n * That has to be reversible. A one-way removal makes\n * `<span uioFieldError [message]=\"error()\">` permanently dead the first time\n * `error()` is empty — which is its *initial* state on every form. So the\n * position is remembered rather than the element merely detached, and `show()`\n * puts it back where it was rather than at the end of its parent.\n *\n * Leaving an empty element behind is not an option: `.icon` and `.field-error`\n * both carry layout, and an empty one holds space in a row that has none in the\n * other three libraries.\n */\nexport class HostPresence {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private removed: { parent: Node; before: Node | null } | null = null;\n\n hide(): void {\n const element = this.host.nativeElement;\n const parent = element.parentNode;\n if (!parent || this.removed) return;\n this.removed = { parent, before: element.nextSibling };\n parent.removeChild(element);\n }\n\n show(): void {\n if (!this.removed) return;\n const { parent, before } = this.removed;\n this.removed = null;\n parent.insertBefore(this.host.nativeElement, before);\n }\n\n set(present: boolean): void {\n if (present) this.show();\n else this.hide();\n }\n}\n","/**\n * The components' own glyphs — Alert's dismiss, Select's chevron — as values\n * that can go anywhere an icon name can.\n *\n * @internal Users name icons the way their library does; see `SystemGlyph` in\n * @ui-organized/core for why the components alone need a library-neutral key.\n *\n * Angular passes icons around as strings (`[icon]` on a button ends up as\n * `[name]` on `uioIcon`), and a string is read as a native name. So a glyph is\n * a branded object instead: no string can be mistaken for one, and `UioIcon`\n * resolves it against whichever library the provider has active.\n */\n\nimport type { SystemGlyph } from \"@ui-organized/core\";\n\nconst BRAND = Symbol.for(\"@ui-organized/angular.glyph\");\n\n/** One of the components' own glyphs. Only `glyph()` makes one. */\nexport interface IconGlyph {\n readonly [BRAND]: SystemGlyph;\n}\n\nconst GLYPHS = new Map<SystemGlyph, IconGlyph>();\n\nexport function glyph(name: SystemGlyph): IconGlyph {\n let value = GLYPHS.get(name);\n if (!value) {\n value = Object.freeze({ [BRAND]: name });\n GLYPHS.set(name, value);\n }\n return value;\n}\n\n/** The glyph a value stands for, or undefined for a native name. */\nexport function glyphOf(value: unknown): SystemGlyph | undefined {\n return typeof value === \"object\" && value !== null && BRAND in value\n ? (value as IconGlyph)[BRAND]\n : undefined;\n}\n","import {\n InjectionToken,\n computed,\n inject,\n isSignal,\n signal,\n type Provider,\n type Signal,\n} from \"@angular/core\";\nimport { DEFAULT_ICON_CONFIG, type IconConfig } from \"@ui-organized/core\";\nimport type { IconMarkup } from \"./registry.js\";\n\nexport type UioIconConfig = IconConfig<IconMarkup>;\n\n/**\n * The icon configuration for a part of the application.\n *\n * The other three libraries express this as a context provider component. In\n * Angular the same idea is a DI provider, so it is a function rather than a\n * component — `provideIconConfig()` at the application, or on a route or a\n * component's own `providers` to override a subtree. That is the framework's own\n * idiom for exactly this, and wrapping the app in a component to carry\n * configuration would be a React shape written in Angular.\n *\n * Note the prop is `style`, spelled the same as React and Svelte. Vue is the odd\n * one out and cannot be — see the note in its `IconProvider.vue`.\n */\nexport const UIO_ICON_CONFIG = new InjectionToken<Signal<UioIconConfig>>(\"uio icon config\", {\n providedIn: \"root\",\n factory: () => signal({ ...DEFAULT_ICON_CONFIG } as UioIconConfig),\n});\n\n/**\n * `config` may be a signal, and usually should be for anything a user can\n * change.\n *\n * The other three libraries carry this on a provider *component*, so a theme\n * switcher flipping `style` to \"solid\" re-renders every icon below it for free.\n * A plain object frozen into a `useValue` cannot do that — the icons on the page\n * would keep the weight they were born with. Accepting a signal keeps the same\n * behaviour available in the idiom Angular actually uses.\n */\nexport function provideIconConfig(\n config: Partial<UioIconConfig> | Signal<Partial<UioIconConfig>>,\n): Provider {\n const resolved = isSignal(config)\n ? computed(() => ({ ...DEFAULT_ICON_CONFIG, ...config() }) as UioIconConfig)\n : signal({ ...DEFAULT_ICON_CONFIG, ...config } as UioIconConfig);\n return { provide: UIO_ICON_CONFIG, useValue: resolved };\n}\n\nexport function injectIconConfig(): Signal<UioIconConfig> {\n return inject(UIO_ICON_CONFIG);\n}\n","import {\n createIconRegistry,\n type IconNameMap as CoreIconNameMap,\n type IconSet as CoreIconSet,\n type SystemGlyphMap as CoreSystemGlyphMap,\n} from \"@ui-organized/core\";\n\nexport type { IconLibrary, RegisterIconsOptions } from \"@ui-organized/core\";\n\n/**\n * This package's icon-set registry: the shared mechanism from\n * `@ui-organized/core`, bound to **SVG markup** rather than to components.\n *\n * The registry itself — why it exists, why it is keyed on `globalThis`, and why\n * each framework gets its own — is documented in core. All that happens here is\n * fixing the stored type, and choosing a key distinct from the other three\n * packages' so none of them can read another's icons.\n *\n * ── Why an Angular icon is a string ─────────────────────────────────────────\n *\n * The other three libraries store components, and Angular could too — but\n * Angular instantiates a component onto an element of its own, so an icon\n * rendered that way comes out as\n * `<span class=\"icon\"><ng-icon><svg/></ng-icon></span>` where the others render\n * `<span class=\"icon\"><svg/></span>`. `.icon` is `display: inline-flex` with\n * centring, so the intermediate element becomes the flex item and the SVG stops\n * being what is laid out. One element deeper is a different DOM, and this whole\n * package exists to produce the same one.\n *\n * Core's registry is generic over the stored type precisely so a framework can\n * answer this differently. Storing markup lets `Icon` create the `<svg>` itself\n * and put it directly inside the span.\n *\n * It also turns out to be the *better* contract for stroke. Every\n * `@ng-icons/*` pack ships its icons with\n * `style=\"stroke-width:var(--ng-icon__stroke-width, 2)\"`, so a single custom\n * property drives the weight for lucide, tabler and heroicons alike — where the\n * React adapters need three different prop shapes because lucide takes\n * `strokeWidth`, tabler takes `stroke` and heroicons takes `width`/`height`.\n */\nexport type IconMarkup = string;\nexport type IconNameMap = CoreIconNameMap<IconMarkup>;\nexport type IconSet = CoreIconSet<IconMarkup>;\n\n/** The components' own glyphs, for one library in one style. */\nexport type SystemGlyphMap = CoreSystemGlyphMap<IconMarkup>;\n\nconst { registerIconSet, getIconSet, registeredLibraries, registerIcons, getIcon, registeredNames } = createIconRegistry<IconMarkup>(\n Symbol.for(\"@ui-organized/angular.iconRegistry\"),\n);\n\nexport {\n registerIconSet,\n getIconSet,\n registeredLibraries,\n registerIcons,\n getIcon,\n registeredNames,\n};\n\n/**\n * The prop mapping every `@ng-icons`-sourced set uses.\n *\n * The three React adapters each need their own, because lucide takes\n * `strokeWidth`, tabler takes `stroke` and heroicons takes `width`/`height`.\n * Here there is one, because every `@ng-icons` pack ships its icons carrying\n * `style=\"stroke-width:var(--ng-icon__stroke-width, 2)\"` — so the weight is set\n * by one custom property regardless of which library drew the glyph.\n *\n * The property name belongs to another project and stays as written: it is that\n * project's published contract, it never reaches a consumer's code, and\n * rewriting it per icon at registration would buy nothing.\n *\n * Exported because a consumer assembling their own set out of `@ng-icons`\n * markup needs exactly this.\n */\nexport function ngIconsSvgProps(\n size: number,\n stroke: number | undefined,\n): Record<string, unknown> {\n return {\n width: size,\n height: size,\n // Omitted rather than passed as undefined — a solid icon has no stroke, and\n // the property must not be written at all. See `applySvgProps`.\n ...(stroke !== undefined ? { \"--ng-icon__stroke-width\": stroke } : {}),\n };\n}\n","import type { IconLibrary } from \"./registry.js\";\n\n/**\n * Warn, once per library, that no icon set is registered.\n *\n * This is the upgrade hazard in moving the icon libraries behind subpaths: an\n * app that never adds the import renders no icons, and without this gets no\n * explanation. So the message says exactly which line to add.\n *\n * **Fires in production too, deliberately.** It was dev-only, on the reasoning\n * that a production build should have caught the problem in development first.\n * That reasoning was wrong in the one case that mattered: a `sideEffects` field\n * that omitted the icon modules let bundlers tree-shake the registration out of\n * *production builds only*. Dev rendered icons; `vite build` rendered none, with\n * no warning — because the only warning was suppressed exactly where the failure\n * lived. A warning that can't reach the environment its bug occurs in is not a\n * warning. The detailed guidance stays dev-only; production gets one short line.\n */\n/**\n * Global-keyed for the same reason the registry is: this module can be\n * instantiated more than once (the CJS build can't code-split, and a dev server\n * may serve both a pre-bundled and a source copy). A module-local Set then gives\n * each copy its own memory and the \"once per library\" promise quietly becomes\n * \"once per copy\" — which is exactly what it did before this change.\n */\nconst WARNED_KEY = Symbol.for(\"@ui-organized/angular.iconSetWarnings\");\ntype GlobalWithWarned = typeof globalThis & { [WARNED_KEY]?: Set<string> };\nconst warned: Set<string> = ((globalThis as GlobalWithWarned)[WARNED_KEY] ??= new Set());\n\nexport function warnMissingIconSet(library: IconLibrary, registered: IconLibrary[]): void {\n if (warned.has(library)) return;\n warned.add(library);\n\n const headline =\n `[@ui-organized/angular] <Icon> can't render: no icon set registered for \"${library}\". ` +\n `Add \\`import \"@ui-organized/angular/icons/${library}\";\\` near your app entry.`;\n\n if (process.env.NODE_ENV === \"production\") {\n // Short, because it ships. Long enough to be actionable on its own — someone\n // reading a production console should not have to go and reproduce in dev.\n console.warn(headline);\n return;\n }\n\n const detail = registered.length\n ? `Registered: ${registered.join(\", \")}.`\n : \"No icon sets are registered.\";\n\n console.warn(\n `${headline}\\n\\n${detail}\\n\\n` +\n `Icon libraries are optional peers, so the package imports none of them itself — ` +\n `that is what keeps the ones you don't use out of your install and your bundle. ` +\n `Make sure \"${PACKAGE_FOR[library]}\" is installed too.\\n\\n` +\n `If icons render in dev but not in a production build, the registration import ` +\n `was tree-shaken: check that your bundler honours this package's \"sideEffects\" field.`,\n );\n}\n\nconst PACKAGE_FOR: Record<IconLibrary, string> = {\n lucide: \"@ng-icons/lucide\",\n tabler: \"@ng-icons/tabler-icons\",\n heroicons: \"@ng-icons/heroicons\",\n};\n\n/** Test seam — lets a test observe the first-warning behaviour more than once. */\nexport function resetIconSetWarnings(): void {\n warned.clear();\n warnedNames.clear();\n}\n\nconst NAME_WARNED_KEY = Symbol.for(\"@ui-organized/angular.iconNameWarnings\");\ntype GlobalWithNameWarned = typeof globalThis & { [NAME_WARNED_KEY]?: Set<string> };\nconst warnedNames: Set<string> = ((globalThis as GlobalWithNameWarned)[NAME_WARNED_KEY] ??=\n new Set());\n\n/**\n * Warn, once per library and name, that an icon name matches nothing\n * registered. Names are the library's own, so the usual causes are a name from\n * a different library (`x-mark` is Heroicons; Lucide calls it `x`) or a\n * forgotten `registerIcons` call. Dev-only: unlike a missing set, this cannot be\n * caused by a production-only bundling difference.\n */\nexport function warnMissingIcon(library: IconLibrary, name: string, registered: string[]): void {\n if (process.env.NODE_ENV === \"production\") return;\n const key = `${library}:${name}`;\n if (warnedNames.has(key)) return;\n warnedNames.add(key);\n\n const known = registered.length\n ? `Registered for ${library}: ${registered.join(\", \")}.`\n : `No icons are registered for ${library} yet.`;\n console.warn(\n `[@ui-organized/angular] <uioIcon name=\"${name}\"> renders nothing: no \"${library}\" icon is ` +\n `registered under that name.\\n\\n${known}\\n\\n` +\n `Names are ${library}'s own, not translated between libraries. Register the icon once:\\n` +\n ` import { registerIcons } from \"@ui-organized/angular/icons/${library}\";\\n` +\n ` registerIcons({ <the icon's export> });\\n` +\n `or pass the icon itself: [svg]=\"theIconMarkup\".`,\n );\n}\n","import { Directive, ElementRef, computed, effect, inject, input } from \"@angular/core\";\nimport { HostPresence } from \"../host-presence.js\";\nimport {\n resolveIconStroke,\n resolveIconSvgProps,\n resolveSystemGlyph,\n} from \"@ui-organized/core\";\nimport { glyphOf, type IconGlyph } from \"./glyph.js\";\nimport { injectIconConfig } from \"./icon-config.js\";\nimport {\n getIcon,\n getIconSet,\n registeredLibraries,\n registeredNames,\n type IconMarkup,\n type IconSet,\n} from \"./registry.js\";\nimport { warnMissingIcon, warnMissingIconSet } from \"./warn-missing-icon-set.js\";\n\n/**\n * An icon's name as its library publishes it: `\"x\"` or `\"chevron-down\"` in\n * Lucide and Tabler, `\"x-mark\"` in Heroicons. Nothing is renamed, so a name\n * belongs to one library. Register the icon first with `registerIcons` from\n * that library's subpath.\n */\nexport type IconName = string;\n\n/**\n * Parse SVG markup into a real element.\n *\n * A detached `<template>` rather than `[innerHTML]`, because Angular's HTML\n * sanitizer does not know SVG and strips it to nothing. No `DomSanitizer`\n * bypass is involved and none is needed: nothing here is bound, the markup is\n * parsed into a document fragment and the resulting node is appended. This is\n * the same technique `@ng-icons/core` uses for the same reason.\n */\nexport function parseIconMarkup(document: Document, markup: string): SVGElement | null {\n const template = document.createElement(\"template\");\n template.innerHTML = markup.trim();\n const element = template.content.firstElementChild;\n return element && element.tagName.toLowerCase() === \"svg\" ? (element as SVGElement) : null;\n}\n\n/**\n * Put an adapter's resolved props onto the rendered `<svg>`.\n *\n * Angular has no spread, so where the other three libraries write\n * `<IconComponent {...svgProps} />` this has to set them one at a time. Two\n * kinds: a `--`-prefixed key is a CSS custom property (which is how every\n * `@ng-icons` pack takes its stroke width), anything else is an attribute.\n *\n * `previous` is what makes this correct rather than merely working. Adapters\n * omit a prop entirely rather than passing `undefined` — a solid icon has no\n * stroke, so the key is simply absent — so iterating the new props can never\n * clear one that has gone away. Switching a provider from outline to solid\n * would otherwise leave the last outline's stroke behind.\n */\nexport function applySvgProps(\n svg: SVGElement,\n props: Record<string, unknown>,\n previous: ReadonlySet<string>,\n): Set<string> {\n for (const key of previous) {\n if (key in props) continue;\n if (key.startsWith(\"--\")) svg.style.removeProperty(key);\n else svg.removeAttribute(key);\n }\n\n const applied = new Set<string>();\n for (const [key, value] of Object.entries(props)) {\n // Never stringify a missing value: `stroke-width=\"undefined\"` is invalid and\n // renders nothing, which is worse than the attribute being absent.\n if (value === undefined || value === null) continue;\n if (key.startsWith(\"--\")) svg.style.setProperty(key, String(value));\n else svg.setAttribute(key, String(value));\n applied.add(key);\n }\n return applied;\n}\n\n/**\n * The single interface for rendering an icon.\n *\n * Everything decided before anything is drawn — which glyph, how thick the\n * stroke, which props the library wants those numbers under — is shared code in\n * `@ui-organized/core`, so an icon comes out the same weight here as it does in\n * React. What is Angular's own is only how the SVG gets into the DOM.\n *\n * ```html\n * <span uioIcon name=\"check\" [size]=\"16\"></span>\n * <span uioIcon name=\"trash\" label=\"Delete\"></span>\n * <span uioIcon [svg]=\"myMarkup\"></span>\n * ```\n *\n * There is no `class` input, unlike the other three libraries: the caller owns\n * the element, so their own `class` is already on it and Angular merges the\n * static `icon` from the host binding with it.\n *\n * ── Why it removes its own host ─────────────────────────────────────────────\n *\n * `Icon` renders **nothing** when it cannot resolve a name — no set registered,\n * or a name the set does not have. In React that is a `return null` and no\n * element exists. A directive cannot decline to render the element the caller\n * wrote, so `HostPresence` takes the element out instead, reversibly: a name\n * bound to a signal can become resolvable later, and the span has to come back\n * where it was. An empty `<span class=\"icon\">` is not a substitute — `.icon` is\n * `display: inline-flex` with its own layout, and it would hold space in a flex\n * row that has no icon in the other three libraries.\n */\n@Directive({\n selector: \"span[uioIcon]\",\n standalone: true,\n providers: [HostPresence],\n host: {\n class: \"icon\",\n \"[attr.aria-label]\": \"label() ?? null\",\n \"[attr.aria-hidden]\": \"label() ? null : true\",\n \"[attr.role]\": \"label() ? 'img' : null\",\n },\n})\nexport class UioIcon {\n /** The icon's native name in the active library, registered with `registerIcons`. */\n readonly name = input<IconName | IconGlyph | undefined>(undefined);\n /**\n * SVG markup supplied directly, which needs no registration and no\n * registered set.\n *\n * A separate input rather than an overload of `name`, which is how React\n * spells it (`typeof name !== \"string\"`). With markup *being* a string that\n * test is unavailable, and sniffing for a leading `<` would be guesswork.\n */\n readonly svg = input<IconMarkup | undefined>(undefined);\n readonly size = input(24);\n /**\n * An accessible label for a meaningful icon. Without one the icon is\n * decorative and hidden from assistive technology — the right default, since\n * most icons sit beside a label that already says the same thing.\n */\n readonly label = input<string | undefined>(undefined);\n\n private readonly config = injectIconConfig();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly presence = inject(HostPresence);\n\n private readonly set = computed<IconSet | undefined>(() => {\n if (this.svg()) return undefined;\n return this.config().icons ?? getIconSet(this.config().library);\n });\n\n private readonly markup = computed<IconMarkup | undefined>(() => {\n const svg = this.svg();\n if (svg) return svg;\n const set = this.set();\n const name = this.name();\n if (!set || name === undefined) return undefined;\n const glyph = glyphOf(name);\n if (glyph) return resolveSystemGlyph(set, glyph, this.config().style);\n return getIcon(set.library, name as string, this.config().style);\n });\n\n private readonly stroke = computed(() =>\n resolveIconStroke({\n style: this.config().style,\n strokeAdjustment: this.config().strokeAdjustment,\n size: this.size(),\n baseStroke: this.config().baseStroke,\n baseSize: this.config().baseSize,\n }),\n );\n\n private readonly svgProps = computed<Record<string, unknown>>(() => {\n const stroke = this.stroke();\n if (this.svg()) {\n // No adapter to ask. The caller's markup is arbitrary, so the numbers go\n // on as plain SVG attributes rather than through a custom property only\n // the @ng-icons packs are written to read.\n return {\n width: this.size(),\n height: this.size(),\n ...(stroke !== undefined ? { \"stroke-width\": stroke } : {}),\n };\n }\n return resolveIconSvgProps(this.set(), this.size(), stroke);\n });\n\n private drawn?: { markup: string; element: SVGElement };\n private applied: ReadonlySet<string> = new Set();\n\n constructor() {\n effect(() => {\n const markup = this.markup();\n const props = this.svgProps();\n this.presence.set(!!markup);\n if (!markup) {\n // Once per library, globally — see the warning's own note on why it\n // fires in production too.\n const set = this.set();\n const name = this.name();\n if (!this.svg() && !set) {\n warnMissingIconSet(this.config().library, registeredLibraries());\n } else if (set && typeof name === \"string\") {\n warnMissingIcon(set.library, name, registeredNames(set.library));\n }\n return;\n }\n this.draw(markup, props);\n });\n }\n\n private draw(markup: string, props: Record<string, unknown>): void {\n const host = this.host.nativeElement;\n if (this.drawn?.markup !== markup) {\n this.drawn?.element.remove();\n const element = parseIconMarkup(host.ownerDocument, markup);\n if (!element) return;\n host.appendChild(element);\n this.drawn = { markup, element };\n this.applied = new Set();\n }\n this.applied = applySvgProps(this.drawn.element, props, this.applied);\n }\n}\n","import { Component, computed, input, output } from \"@angular/core\";\nimport { alertStyles, type AlertVariants } from \"@ui-organized/core\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport type { SystemGlyph } from \"@ui-organized/core\";\n\nexport type AlertVariant = NonNullable<AlertVariants[\"variant\"]>;\n\n/** Each variant announces itself with its own glyph before anyone reads the text. */\nconst VARIANT_ICONS: Record<AlertVariant, SystemGlyph> = {\n info: \"info\",\n success: \"check-circle\",\n warning: \"alert-triangle\",\n error: \"alert-circle\",\n};\n\n/**\n * A prominent message about the state of something.\n *\n * `role=\"alert\"` is a static host attribute rather than the caller's job: an\n * alert that assistive technology does not announce is a colored box.\n *\n * ── One API difference ──────────────────────────────────────────────────────\n *\n * The other three render the dismiss button when an `onDismiss` callback is\n * passed — the presence of the prop *is* the switch. Angular has no equivalent\n * question to ask: an `output()` exists whether or not anyone subscribed, and\n * there is no supported way to find out. So the switch is explicit: set\n * `dismissible`, and listen to `(dismiss)`.\n *\n * ```html\n * <div uioAlert variant=\"error\" title=\"Upload failed\" dismissible (dismiss)=\"hide()\">\n * The file was larger than 10 MB.\n * </div>\n * ```\n */\n@Component({\n selector: \"div[uioAlert]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n <span class=\"alert__icon\">\n <span uioIcon [name]=\"iconName()\" [size]=\"ICON_SIZE\"></span>\n </span>\n <div class=\"alert__body\">\n @if (title(); as text) {\n <div class=\"alert__title text-strong-body-medium\">{{ text }}</div>\n }\n <div class=\"alert__message text-default-body-medium\"><ng-content /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"alert__dismiss\"\n aria-label=\"Dismiss alert\"\n (click)=\"dismiss.emit()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"ICON_SIZE\"></span>\n </button>\n }\n `,\n host: {\n role: \"alert\",\n \"[class]\": \"hostClass()\",\n },\n})\nexport class UioAlert {\n protected readonly glyph = glyph;\n readonly variant = input<AlertVariant>(\"info\");\n readonly title = input<string | undefined>(undefined);\n /** Renders the dismiss button. See the note above for why this is not implied. */\n readonly dismissible = input(false);\n readonly dismiss = output<void>();\n\n protected readonly ICON_SIZE = 20;\n protected readonly hostClass = computed(() => alertStyles({ variant: this.variant() }));\n protected readonly iconName = computed(() => glyph(VARIANT_ICONS[this.variant()]));\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n computed,\n inject,\n input,\n signal,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n CONTROL_TEXT_CLASS,\n buttonStyles,\n type ButtonVariants,\n type ControlSize,\n} from \"@ui-organized/core\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\nexport type ButtonIntent = NonNullable<ButtonVariants[\"intent\"]>;\n\n/**\n * The design system's button.\n *\n * ── Why it is an attribute, not an element ──────────────────────────────────\n *\n * `<uio-button>` would render a wrapper around the real `<button>`, and the\n * whole premise of this package is that it produces the same DOM as the other\n * three libraries against one shared stylesheet — an extra element is a\n * different DOM. Selecting on the attribute means the consumer's own element is\n * the button:\n *\n * ```html\n * <button uioButton intent=\"secondary\" size=\"lg\">Save</button>\n * <a uioButton href=\"/docs\">Read the docs</a>\n * ```\n *\n * It also settles polymorphism for free. React needs a `render` prop and a\n * `cloneElement` to turn a Button into an anchor; here the caller just writes an\n * anchor. That is the same capability, expressed in the idiom of the framework.\n *\n * This deliberately does **not** extend `UioPart`: Ark has no button primitive,\n * so a React button carries no `data-scope`/`data-part` and neither may this one.\n */\n@Component({\n selector: \"button[uioButton], a[uioButton]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n @if (iconPosition() === \"left\") {\n <span uioIcon [name]=\"name\" [size]=\"iconSize()\"></span>\n }\n }\n <ng-content />\n @if (icon(); as name) {\n @if (iconPosition() === \"right\") {\n <span uioIcon [name]=\"name\" [size]=\"iconSize()\"></span>\n }\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[attr.type]\": \"typeAttribute()\",\n },\n})\nexport class UioButton implements AfterViewInit {\n readonly intent = input<ButtonIntent>(\"primary\");\n readonly size = input<ControlSize>(\"md\");\n /**\n * Only meaningful on a `<button>`, and defaulted to `button` there for the\n * same reason the React component does it: a bare `<button>` inside a form\n * submits it, which is almost never what a design-system button is for.\n */\n readonly type = input<\"button\" | \"submit\" | \"reset\">(\"button\");\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n readonly iconPosition = input<\"left\" | \"right\">(\"left\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Icons scale with the control size, from the shared table. */\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n\n /**\n * An icon with no label collapses to a square whose side matches the labelled\n * height for the size, so icon buttons line up with text buttons instead of\n * rendering short and wide.\n *\n * React derives this from its `children` prop. Angular projects content rather\n * than receiving it, so the equivalent question is whether anything the caller\n * put inside the button renders text — which the host's own `textContent`\n * answers, the icon contributing none. Read once after the view exists: a\n * button that starts as an icon and later grows a label is not a case any of\n * the four libraries supports.\n */\n private readonly iconOnly = signal(false);\n\n protected readonly hostClass = computed(() =>\n clsx(\n CONTROL_TEXT_CLASS[this.size()],\n buttonStyles({ intent: this.intent(), size: this.size() }),\n this.iconOnly() && \"btn--icon-only\",\n ),\n );\n\n ngAfterViewInit(): void {\n this.iconOnly.set(!!this.icon() && !this.host.nativeElement.textContent?.trim());\n }\n\n /** An anchor has no `type`, and stamping one on it would be invalid HTML. */\n protected readonly typeAttribute = computed(() =>\n this.host.nativeElement.tagName === \"BUTTON\" ? this.type() : null,\n );\n}\n","/**\n * The two things every hand-written part needs that the shared stylesheet does\n * not provide.\n */\n\n/**\n * A per-instance machine id, in the shape Ark's ids are built from.\n *\n * Ark composes every id as `<scope>:<machine>:<part>`, and the root as\n * `<scope>:<machine>`. The literal value is not the contract and never could be\n * — React 18 produces `:r0:`, Svelte `c1`, Vue `v-0` — but the *shape* is, both\n * because the parity gate normalises ids by recovering the machine from it, and\n * because a consumer debugging a form should see the same structure whichever\n * library rendered it.\n *\n * A module counter rather than a random value, so a page renders the same ids\n * twice running; that matters for snapshot tests and for anyone diffing DOM.\n */\nlet machines = 0;\nexport function nextMachineId(): string {\n return `a${machines++}`;\n}\n\n/**\n * The inline style Ark puts on the hidden input behind a switch, checkbox or\n * radio — reproduced rather than replaced with a class, because the shared\n * stylesheet does not hide it and a new class would be a rule the other three\n * libraries do not have.\n *\n * The input is what takes focus and what a form submits; the visible track is\n * `aria-hidden` decoration.\n */\nexport const VISUALLY_HIDDEN_INPUT =\n \"border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; \" +\n \"overflow: hidden; padding: 0px; position: absolute; width: 1px; \" +\n \"white-space: nowrap; overflow-wrap: normal;\";\n","import { Injectable, computed, signal, type Signal } from \"@angular/core\";\nimport { nextMachineId } from \"../part-ids.js\";\n\n/**\n * The two parts a field's control describes itself by, in the order Ark lists\n * them: the error first, because it is the thing a screen reader should reach\n * before the advice that is still on screen behind it.\n */\nexport type FieldDescribedPart = \"error-text\" | \"helper-text\";\n\n/**\n * The identity and state every part of a field reads.\n *\n * ── Why this exists at all ──────────────────────────────────────────────────\n *\n * Ark's Field is a machine that several sibling elements read from: the label\n * points its `for` at the control, the control describes itself by whichever of\n * the helper text and the error text is on screen, and validity, disabled and\n * read-only spread from the root to every part. React gets that through\n * context. Angular's equivalent is a provider on the element injector, so the\n * component that *owns* the field provides one of these and every part below it\n * injects it.\n *\n * Three components own one: `UioField`, whose parts the caller writes; and\n * `UioInput` and `UioTextArea`, which write their own parts but are the same\n * field underneath and so get the same ids, the same `aria-describedby` and the\n * same error pill for free.\n *\n * ── The one invariant ───────────────────────────────────────────────────────\n *\n * `describedBy` reads whichever parts have called {@link describe}, and those\n * calls happen once, when the part is constructed. That is correct because a\n * field's parts *remove themselves* from the DOM when they have nothing to show\n * — `HostPresence`, the same mechanism `Icon` and `FieldError` use — rather than\n * being created and destroyed by a surrounding `@if`. Visibility is a signal;\n * existence is not. A part wrapped in an `@if` by a caller would register too\n * late to be described, which is why the parts that can vanish take a message\n * rather than projected content.\n */\n@Injectable()\nexport class UioFieldContext {\n /**\n * Ark builds every field id as `field:<machine>:<part>`. The literal value is\n * not the contract — React 18 produces `field:::r0:::label` — but the shape\n * is, and so is every relationship built out of it.\n */\n private readonly machine = nextMachineId();\n\n /**\n * Replaced wholesale by the owning component in its constructor, via\n * {@link bind}. Plain properties rather than writable signals kept in sync,\n * because a `set()` driven by an effect lands one change-detection pass late\n * and the field would render valid before it rendered invalid.\n */\n invalid: Signal<boolean> = signal(false);\n disabled: Signal<boolean> = signal(false);\n required: Signal<boolean> = signal(false);\n readOnly: Signal<boolean> = signal(false);\n\n private readonly present: Partial<Record<FieldDescribedPart, Signal<boolean>>> = {};\n\n /** Ark's root id has no part suffix. */\n get rootId(): string {\n return `field:${this.machine}`;\n }\n\n partId(part: string): string {\n return `field:${this.machine}:${part}`;\n }\n\n /**\n * The control's id, whether it is rendered as an `input` or a `textarea`.\n *\n * One id for both, so the label's `for` does not have to know which. Ark does\n * the same thing — its control carries the bare field id whatever tag it is —\n * and it is what lets `UioFieldLabel` serve a text box and a text area alike.\n */\n get controlId(): string {\n return this.partId(\"control\");\n }\n\n /** Called by the owning component before any part of the field exists. */\n bind(state: {\n invalid: Signal<boolean>;\n disabled: Signal<boolean>;\n required: Signal<boolean>;\n readOnly: Signal<boolean>;\n }): void {\n this.invalid = state.invalid;\n this.disabled = state.disabled;\n this.required = state.required;\n this.readOnly = state.readOnly;\n }\n\n /** Told once per part, at construction. See the invariant above. */\n describe(part: FieldDescribedPart, present: Signal<boolean>): void {\n this.present[part] = present;\n }\n\n /**\n * `null` rather than an empty string when nothing is on screen: an\n * `aria-describedby=\"\"` is a reference to nothing, and the gate compares the\n * attribute's presence.\n */\n readonly describedBy = computed(() => {\n const ids = ([\"error-text\", \"helper-text\"] as const)\n .filter((part) => this.present[part]?.())\n .map((part) => this.partId(part));\n return ids.length ? ids.join(\" \") : null;\n });\n}\n","import { Component, computed, effect, inject, input } from \"@angular/core\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/**\n * The inline error pill that sits under a form control.\n *\n * ── Why the message is an input, not projected content ──────────────────────\n *\n * React takes it as children and returns `null` when it is empty. Svelte and Vue\n * take a `message` prop instead, because a snippet or a slot is opaque — an\n * always-present one that happens to render nothing still reads as \"I have\n * content\", and that produced an empty pill. Angular has the same problem with\n * `<ng-content>`, so it takes the same answer.\n *\n * ```html\n * <span uioFieldError [message]=\"form.controls.email.errors?.['required']\"></span>\n * ```\n *\n * ── Inside a field it becomes a part of one ─────────────────────────────────\n *\n * React composes this by handing Ark's `Field.ErrorText` an `asChild` and\n * letting it merge its part identity onto this element. Angular has no\n * `asChild` and cannot put two components on one host element, so the merge\n * happens the other way round: this component asks for a `UioFieldContext`, and\n * when there is one it takes the field's `error-text` id, announces itself\n * politely, and shows only while the field is invalid — exactly what Ark's\n * ErrorText does. Outside a field none of that is bound and it is the plain\n * pill it was before.\n */\n@Component({\n selector: \"span[uioFieldError]\",\n providers: [HostPresence],\n standalone: true,\n imports: [UioIcon],\n template: `<span uioIcon class=\"field-error__icon\" [name]=\"glyph('alert-circle')\" [size]=\"ICON_SIZE\"></span\n >{{ message() }}`,\n host: {\n class: \"field-error text-emphasis-caption\",\n \"[attr.id]\": \"field ? field.partId('error-text') : null\",\n \"[attr.data-scope]\": \"field ? 'field' : null\",\n \"[attr.data-part]\": \"field ? 'error-text' : null\",\n \"[attr.aria-live]\": \"field ? 'polite' : null\",\n },\n})\nexport class UioFieldError {\n protected readonly glyph = glyph;\n readonly message = input<string | undefined | null>(undefined);\n\n protected readonly ICON_SIZE = 12;\n protected readonly field = inject(UioFieldContext, { optional: true });\n private readonly presence = inject(HostPresence);\n\n /** A valid field has no error to show, whatever message it is holding. */\n private readonly present = computed(() => !!this.message() && (this.field?.invalid() ?? true));\n\n constructor() {\n this.field?.describe(\"error-text\", this.present);\n // An empty message renders nothing at all — not an empty pill, which would\n // hold space and a background color. See HostPresence.\n effect(() => this.presence.set(this.present()));\n }\n}\n","import { Directive, signal, type Signal } from \"@angular/core\";\n\n/**\n * Hover and focus, reported the way the shared stylesheets read them.\n *\n * ── Why this exists ─────────────────────────────────────────────────────────\n *\n * `Checkbox.css`, `Radio.css`, `Switch.css` and `SegmentedControl.css` all draw\n * their focus ring from `[data-focus-visible]`, because the element that takes\n * the focus is a visually-hidden `<input>` and the element that shows it is a\n * `<span>` beside it — so `:focus-visible` on the control itself never matches\n * and the attribute is the only way across.\n *\n * Zag emits it in the other three libraries. Angular has no Zag, so three\n * controls emitted nothing and **drew no focus ring at all** for keyboard users.\n * Nothing caught it: the a11y gate is React-only, and every Checkbox parity\n * scenario was static — nobody had ever compared one that had been touched.\n * A `Checkbox` scenario that clicks is what finally failed.\n *\n * ── Why a host directive ────────────────────────────────────────────────────\n *\n * The three components already extend `UioPart`, which is the obvious place to\n * put this — and the wrong one: `UioPart` is the base for every part in the\n * package, and four DOM listeners on all of them to serve three is a real cost\n * for no benefit. `hostDirectives` composes it onto exactly the parts that need\n * it, and a part that adds it is declaring \"I am something you can point at\".\n *\n * ── `focusin`, not `focus` ──────────────────────────────────────────────────\n *\n * The focus lands on a descendant — the hidden input — and `focus` does not\n * bubble. `focusin` does, which is what lets one listener on the root see it.\n *\n * `:focus-visible` is asked of the browser rather than reimplemented. Zag ships\n * a heuristic because it has to work in engines that lacked the pseudo-class;\n * this package targets Angular 21, where it is everywhere, and the native answer\n * is the one the user's own settings feed into.\n */\n@Directive({\n standalone: true,\n host: {\n \"(mouseenter)\": \"hovering.set(true)\",\n \"(mouseleave)\": \"hovering.set(false)\",\n \"(focusin)\": \"onFocusIn($event)\",\n \"(focusout)\": \"onFocusOut()\",\n },\n})\nexport class UioInteractionState {\n protected readonly hovering = signal(false);\n private readonly focused = signal(false);\n private readonly focusedVisible = signal(false);\n\n readonly hover: Signal<boolean> = this.hovering.asReadonly();\n readonly focus: Signal<boolean> = this.focused.asReadonly();\n readonly focusVisible: Signal<boolean> = this.focusedVisible.asReadonly();\n\n protected onFocusIn(event: FocusEvent): void {\n this.focused.set(true);\n const target = event.target as Element | null;\n // Guarded: `matches` throws on an unsupported selector in older engines, and\n // a control that reports no focus ring is better than one that throws.\n try {\n this.focusedVisible.set(!!target?.matches(\":focus-visible\"));\n } catch {\n this.focusedVisible.set(false);\n }\n }\n\n protected onFocusOut(): void {\n this.focused.set(false);\n this.focusedVisible.set(false);\n }\n}\n","import {\n Component,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { UioInteractionState } from \"../interaction-state.js\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\n\n/**\n * A two-state toggle.\n *\n * ── What this is a proof of ─────────────────────────────────────────────────\n *\n * The first control in this package with a state machine behind it in the other\n * three libraries, and therefore the first to reproduce Ark's rendered contract\n * by hand: the root `<label>` that *is* the control, the `aria-hidden` track and\n * thumb, the visually-hidden input that actually takes focus, and a\n * `data-state` of `checked`/`unchecked` on every part of it. The root extends\n * `UioPart` so its identity and state are declared rather than typed out; the\n * inner parts are written in the template, where they are visible together and\n * the browser parity gate compares every attribute of each.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it:\n *\n * ```html\n * <label uioSwitch label=\"Wifi\" formControlName=\"wifi\"></label>\n * <label uioSwitch label=\"Wifi\" [(checked)]=\"enabled\"></label>\n * ```\n *\n * That is a capability the React library does not have, not parity debt. Note\n * there is no `defaultChecked`: `model()` is uncontrolled until something binds\n * it, so `[checked]=\"true\"` is an initial value *and* a bound one, and the\n * controlled/uncontrolled fork React implements by hand does not arise.\n */\n@Component({\n selector: \"label[uioSwitch]\",\n standalone: true,\n // Reports hover and focus so the shared stylesheet can draw a focus ring —\n // see UioInteractionState.\n hostDirectives: [UioInteractionState],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioSwitch), multi: true },\n ],\n template: `\n <span\n class=\"switch__track\"\n data-scope=\"switch\"\n data-part=\"control\"\n aria-hidden=\"true\"\n [id]=\"partId('control')\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n >\n <span\n class=\"switch__thumb\"\n data-scope=\"switch\"\n data-part=\"thumb\"\n aria-hidden=\"true\"\n [id]=\"partId('thumb')\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n ></span>\n </span>\n @if (label(); as text) {\n <span\n class=\"switch__label text-default-body-large\"\n data-scope=\"switch\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n >{{ text }}</span\n >\n }\n <!--\n The input is what actually takes focus and what a form submits; the track\n is decorative. Without a label part there is nothing for aria-labelledby\n to name, so it is dropped rather than left dangling — a dangling IDREF\n outranks aria-label, which is the whole reason OMIT_ARIA exists in the\n other three.\n -->\n <input\n type=\"checkbox\"\n value=\"on\"\n [id]=\"partId('input')\"\n [attr.style]=\"HIDDEN\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.name]=\"name()\"\n [attr.aria-labelledby]=\"label() ? partId('label') : null\"\n [attr.aria-label]=\"label() ? null : ariaLabel()\"\n (change)=\"toggle($event)\"\n (blur)=\"onTouched()\"\n />\n `,\n host: {\n class: \"switch\",\n // The root carries an id too — Ark's is `<scope>:<machine>`, with no part\n // suffix — and the label's `for` names the input, which is what actually\n // takes focus.\n \"[id]\": \"rootId\",\n \"[attr.for]\": \"partId('input')\",\n /**\n * Not on `UioPart`, deliberately. That base declares the vocabulary the\n * *stylesheet* reads, and its spec fails an attribute no CSS selects on —\n * `data-required` is one. Ark emits it anyway, on every part, and the\n * rendered contract is what this package reproduces.\n */\n \"[attr.data-required]\": \"flag(required())\",\n },\n})\nexport class UioSwitch extends UioPart implements ControlValueAccessor {\n private readonly interaction = inject(UioInteractionState);\n override readonly hover: Signal<boolean> = this.interaction.hover;\n override readonly focus: Signal<boolean> = this.interaction.focus;\n override readonly focusVisible: Signal<boolean> = this.interaction.focusVisible;\n\n readonly scope = \"switch\";\n readonly part = \"root\";\n\n readonly checked = model(false);\n readonly label = input<string | undefined>(undefined);\n readonly required = input(false);\n readonly name = input<string | undefined>(undefined);\n /**\n * Declared as `ariaLabel`, written `aria-label` in a template. Only used when\n * there is no visible label — with one, the label element names the control.\n */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n readonly checkedChange = output<boolean>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, { alias: \"disabled\" });\n private readonly formDisabled = signal(false);\n override readonly disabled: Signal<boolean> = computed(\n () => this.disabledInput() || this.formDisabled(),\n );\n override readonly state = computed(() => (this.checked() ? \"checked\" : \"unchecked\"));\n\n /**\n * Ark builds every id as `<scope>:<machine>:<part>`, with the root as\n * `<scope>:<machine>`. The literal values differ per framework and are not the\n * contract — what is, is that the label's `for` names the input and\n * `aria-labelledby` names the label. Same shape, so the same relationships.\n */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n\n protected onTouched: () => void = () => {};\n private onChange: (value: boolean) => void = () => {};\n\n protected toggle(event: Event): void {\n const next = (event.target as HTMLInputElement).checked;\n this.checked.set(next);\n this.checkedChange.emit(next);\n this.onChange(next);\n }\n\n writeValue(value: boolean): void {\n this.checked.set(!!value);\n }\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { clsx } from \"clsx\";\nimport { UioInteractionState } from \"../interaction-state.js\";\nimport { UioPart } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/**\n * A box that is ticked, empty, or neither.\n *\n * Built the way Switch is — the root `<label>` *is* the control, the box and\n * its indicator are `aria-hidden` decoration, and a visually-hidden input takes\n * the focus and carries the value into a form. What Switch does not have is the\n * third state.\n *\n * ── Indeterminate ──────────────────────────────────────────────────────────\n *\n * Ark folds it into the checked value (`checked=\"indeterminate\"`); the facade\n * across all four libraries keeps it a separate boolean, because \"some of the\n * children are ticked\" is a different question from \"is this ticked\" and a\n * caller answering the first should not have to widen the type of the second.\n * So `indeterminate` wins over `checked` throughout — the state word, the\n * indicator's dash, and the hidden input, which comes out unchecked with its\n * `indeterminate` *property* set. A property and not an attribute because\n * there is no such attribute, which is also why the parity gate cannot see it.\n *\n * The indicator carries `hidden` while the box is unchecked, as Ark's does when\n * its Indicator is given `indeterminate` (the other three libraries pass it).\n * `base.css` enforces `[hidden]`, so an indicator hidden in the indeterminate\n * state would lose its dash.\n *\n * ```html\n * <label uioCheckbox label=\"Accept\" formControlName=\"accept\"></label>\n * <label uioCheckbox label=\"All\" [indeterminate]=\"some()\" [(checked)]=\"all\"></label>\n * ```\n */\n@Component({\n selector: \"label[uioCheckbox]\",\n standalone: true,\n imports: [UioIcon],\n // Reports hover and focus so the shared stylesheet can draw a focus ring —\n // see UioInteractionState for why it is a host directive rather than a base.\n hostDirectives: [UioInteractionState],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioCheckbox), multi: true },\n ],\n template: `\n <div\n class=\"checkbox__control\"\n data-scope=\"checkbox\"\n data-part=\"control\"\n aria-hidden=\"true\"\n [id]=\"partId('control')\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n >\n <div\n class=\"checkbox__indicator\"\n data-scope=\"checkbox\"\n data-part=\"indicator\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n [attr.hidden]=\"state() === 'unchecked' ? '' : null\"\n >\n @if (indeterminate()) {\n <span class=\"checkbox__indicator--indeterminate\"></span>\n } @else {\n <span uioIcon class=\"checkbox__check\" [name]=\"glyph('check')\" [size]=\"ICON_SIZE\"></span>\n }\n </div>\n </div>\n @if (label(); as text) {\n <span\n class=\"checkbox__label text-default-body-large\"\n data-scope=\"checkbox\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-hover]=\"flag(hover())\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.data-focus-visible]=\"flag(focusVisible())\"\n >{{ text }}</span\n >\n }\n <!--\n Ark points the input at the Label part unconditionally. With no label\n there is no such element, so the reference would dangle — and a dangling\n aria-labelledby outranks aria-label, leaving the box nameless. That is\n what OMIT_ARIA guards in the other three; here the reference is simply not\n written.\n -->\n <input\n type=\"checkbox\"\n value=\"on\"\n [id]=\"partId('input')\"\n [attr.style]=\"HIDDEN\"\n [checked]=\"checked() && !indeterminate()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabled()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.name]=\"name()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"label() ? partId('label') : null\"\n [attr.aria-label]=\"label() ? null : ariaLabel()\"\n (change)=\"toggle($event)\"\n (blur)=\"onTouched()\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.for]\": \"partId('input')\",\n /** Not on `UioPart`: no stylesheet selects on it. See UioSwitch. */\n \"[attr.data-required]\": \"flag(required())\",\n },\n})\nexport class UioCheckbox extends UioPart implements ControlValueAccessor {\n protected readonly glyph = glyph;\n readonly scope = \"checkbox\";\n readonly part = \"root\";\n\n private readonly interaction = inject(UioInteractionState);\n override readonly hover: Signal<boolean> = this.interaction.hover;\n override readonly focus: Signal<boolean> = this.interaction.focus;\n override readonly focusVisible: Signal<boolean> = this.interaction.focusVisible;\n\n readonly checked = model(false);\n readonly indeterminate = input(false, { transform: booleanAttribute });\n readonly label = input<string | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n /** Only used when there is no visible label — with one, the label names the box. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n readonly checkedChange = output<boolean>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n override readonly disabled: Signal<boolean> = computed(\n () => this.disabledInput() || this.formDisabled(),\n );\n override readonly state = computed(() => {\n if (this.indeterminate()) return \"indeterminate\";\n return this.checked() ? \"checked\" : \"unchecked\";\n });\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected readonly ICON_SIZE = 16;\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly hostClass = computed(() =>\n clsx(\"checkbox\", this.disabled() && \"checkbox--disabled\"),\n );\n\n protected onTouched: () => void = () => {};\n private onChange: (value: boolean) => void = () => {};\n\n protected toggle(event: Event): void {\n const next = (event.target as HTMLInputElement).checked;\n this.checked.set(next);\n this.checkedChange.emit(next);\n this.onChange(next);\n }\n\n writeValue(value: boolean): void {\n this.checked.set(!!value);\n }\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { Directive, booleanAttribute, computed, inject, input, type Signal } from \"@angular/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\n\n/**\n * Groups related fields under a shared legend.\n *\n * ```html\n * <fieldset uioFieldset [disabled]=\"!editing()\">\n * <legend uioFieldsetLegend>Contact</legend>\n * <div uioField>…</div>\n * <div uioField>…</div>\n * </fieldset>\n * ```\n *\n * ── Why it is a directive on a real `fieldset` ──────────────────────────────\n *\n * `<fieldset disabled>` is one of the few genuinely useful native behaviours\n * left in HTML: it disables every form control below it, and it does so in the\n * browser rather than in any framework. A `<uio-fieldset>` wrapper would throw\n * that away and have to re-implement it — so the caller writes the element and\n * this decorates it, which is also what makes `[disabled]` here a real\n * attribute rather than only a styling hook.\n *\n * ── The legend's id is always referenced, present or not ────────────────────\n *\n * Ark names the legend from the root unconditionally — `aria-labelledby` is\n * built from the id it *would* have — so a fieldset written without a legend\n * carries a reference to nothing. That is upstream behaviour and this\n * reproduces it, because the parity gate compares Angular against React and a\n * fieldset is not much use without its legend anyway. Write the legend.\n */\n@Directive({\n selector: \"fieldset[uioFieldset]\",\n standalone: true,\n exportAs: \"uioFieldset\",\n host: {\n class: \"fieldset\",\n // The property, not `attr.disabled`: `disabled` reflects, and binding the\n // property is what gives the descendant controls the native behaviour.\n \"[disabled]\": \"disabled()\",\n \"[attr.aria-labelledby]\": \"legendId\",\n },\n})\nexport class UioFieldset extends UioPart {\n readonly scope = \"fieldset\";\n readonly part = \"root\";\n\n override readonly disabled = input(false, { transform: booleanAttribute });\n override readonly invalid = input(false, { transform: booleanAttribute });\n\n /**\n * `<scope>:<machine>:<part>`, this package's shape for every hand-written id.\n *\n * Ark spells this one `fieldset::<id>::legend` rather than the single-colon\n * form its Field uses, which is a wrinkle in Ark and not a contract: the\n * parity gate numbers ids positionally, so what is compared is that the\n * root's `aria-labelledby` names *this legend* and nothing else.\n */\n readonly legendId = `fieldset:${nextMachineId()}:legend`;\n}\n\n/**\n * Names the fieldset, and greys along with it.\n *\n * Both state attributes are repeated here rather than left to the root, because\n * that is what Ark emits and the shared stylesheet is free to select on either.\n */\n@Directive({\n selector: \"legend[uioFieldsetLegend]\",\n standalone: true,\n host: {\n class: \"fieldset__legend\",\n \"[id]\": \"fieldset.legendId\",\n },\n})\nexport class UioFieldsetLegend extends UioPart {\n readonly scope = \"fieldset\";\n readonly part = \"legend\";\n\n protected readonly fieldset = inject(UioFieldset);\n override readonly disabled: Signal<boolean> = this.fieldset.disabled;\n override readonly invalid: Signal<boolean> = this.fieldset.invalid;\n}\n\n/**\n * A component's own `disabled`, OR'd with any enclosing fieldset's.\n *\n * The behaviour Ark gives React and Svelte for free — `disabled ??\n * Boolean(fieldset?.disabled)` in their `useField` — and which Angular has to\n * write, because it has no Zag. It matters more here than it looks: the native\n * `<fieldset disabled>` already makes every descendant control dead, so a\n * component that does not inherit the flag renders an *ungreyed* control that\n * cannot be used, which is worse than either state on its own.\n *\n * Call it from an injection context — a field initialiser or a constructor.\n * Returns the signal it was given, unchanged, when there is no fieldset above,\n * so nothing outside one pays for it.\n */\nexport function withFieldsetDisabled(own: Signal<boolean>): Signal<boolean> {\n const fieldset = inject(UioFieldset, { optional: true });\n return fieldset ? computed(() => own() || fieldset.disabled()) : own;\n}\n","import {\n Component,\n Directive,\n ElementRef,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { fieldStyles, type FieldVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioFieldContext } from \"./field-context.js\";\nimport { withFieldsetDisabled } from \"./fieldset.js\";\n\nexport type FieldLayout = NonNullable<FieldVariants[\"layout\"]>;\n\n/**\n * A label, a control, its helper text and its error, wired together.\n *\n * ── What the wiring is ──────────────────────────────────────────────────────\n *\n * Four sibling elements that have to agree about five things: the label's `for`\n * and the control's `id`; the control's `aria-describedby` and whichever of the\n * helper and error text is actually on screen; and `[data-invalid]`,\n * `[data-disabled]` and `[data-readonly]`, which the shared stylesheet reads on\n * every one of them. Ark spreads that from a machine through React context.\n * Here the root provides a `UioFieldContext` and each part injects it, which is\n * the same arrangement in Angular's spelling.\n *\n * ```html\n * <div uioField [invalid]=\"email.invalid\" required>\n * <label uioFieldLabel>Email</label>\n * <input uioFieldControl [formControl]=\"email\" />\n * <span uioFieldDescription>We never share it</span>\n * <span uioFieldError [message]=\"emailError()\"></span>\n * </div>\n * ```\n *\n * `UioInput` is this composition prepackaged. Reach for `UioField` when the\n * control is not a plain text box — a native `select`, a date picker, anything\n * the packaged component does not wrap.\n */\n@Component({\n selector: \"div[uioField]\",\n standalone: true,\n providers: [UioFieldContext],\n template: `<ng-content />`,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioField extends UioPart {\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly layout = input<FieldLayout>(\"stacked\");\n override readonly invalid = input(false, { transform: booleanAttribute });\n override readonly readOnly = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n\n /**\n * Disabled if the caller says so, **or** if an enclosing `UioFieldset` is.\n *\n * Declared before `disabled` because field initialisers run in order and the\n * computed below reads this one. See `withFieldsetDisabled` for why the\n * inheritance matters rather than merely being tidy.\n */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n override readonly disabled: Signal<boolean> = withFieldsetDisabled(this.disabledInput);\n\n protected readonly field = inject(UioFieldContext);\n protected readonly hostClass = computed(() => fieldStyles({ layout: this.layout() }));\n\n constructor() {\n super();\n // Before any part of the field exists, which is what makes plain property\n // assignment safe. See `UioFieldContext.bind`.\n this.field.bind({\n invalid: this.invalid,\n disabled: this.disabled,\n required: this.required,\n readOnly: this.readOnly,\n });\n }\n}\n\n/**\n * Names the field's control, and reports the field's state so the stylesheet\n * can grey the label along with it.\n *\n * `data-required` is bound here rather than on `UioPart`, for the reason Switch\n * gives: that base declares the vocabulary the *stylesheet* reads, and its spec\n * fails an attribute no CSS selects on. Ark emits `data-required` anyway, and\n * the rendered contract is what this package reproduces.\n */\n@Component({\n selector: \"label[uioFieldLabel]\",\n standalone: true,\n template: `<ng-content />`,\n host: {\n class: \"field__label\",\n \"[id]\": \"field.partId('label')\",\n \"[attr.for]\": \"field.controlId\",\n \"[attr.data-required]\": \"flag(field.required())\",\n },\n})\nexport class UioFieldLabel extends UioPart {\n readonly scope = \"field\";\n readonly part = \"label\";\n\n protected readonly field = inject(UioFieldContext);\n override readonly invalid: Signal<boolean> = this.field.invalid;\n override readonly disabled: Signal<boolean> = this.field.disabled;\n override readonly readOnly: Signal<boolean> = this.field.readOnly;\n}\n\n/** The three tags `uioFieldControl` may decorate. */\ntype FieldControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\n/**\n * The field's control.\n *\n * ── Three things worth knowing ──────────────────────────────────────────────\n *\n * The selector takes all three native form controls, not `input` alone. React's\n * `FieldControl` is Ark's `Field.Input`, which is polymorphic through `asChild`\n * — a `select` or a `textarea` can stand in and still be the field's control —\n * and the parts of this that matter are the same for all three: one id for the\n * label to point at, one `aria-describedby`, and a value the accessor reads off\n * `.value`. `data-part` stays `\"input\"` whichever tag it lands on, because that\n * is what Ark writes and what the shared stylesheet reads.\n *\n * A bare `[uioFieldControl]` would be the fuller translation of `asChild` and is\n * deliberately not the selector: on a `div` the value accessor has nothing to\n * read and `[disabled]` nothing to set, so the failure would be silent.\n *\n * It reports `data-invalid`, `data-readonly` and `data-required` but **never**\n * `data-disabled` — Ark does not put one on the control either, because a real\n * `disabled` attribute is already there and `.field__control:disabled` sits in\n * the stylesheet beside `.field__control[data-disabled]`. Nothing is lost, and\n * the attribute the gate would otherwise flag as missing is missing on purpose.\n *\n * The `ControlValueAccessor` is the Angular-specific win rather than parity\n * debt. `setDisabledState` feeds the same expression the field's own `disabled`\n * does, so `control.disable()` greys the control instead of only keeping its\n * value out of the form.\n */\n@Directive({\n selector: \"input[uioFieldControl], select[uioFieldControl], textarea[uioFieldControl]\",\n standalone: true,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioFieldControl), multi: true },\n ],\n host: {\n class: \"field__control\",\n \"[id]\": \"field.controlId\",\n \"[attr.aria-describedby]\": \"field.describedBy()\",\n \"[attr.aria-invalid]\": \"field.invalid() ? 'true' : null\",\n \"[attr.data-required]\": \"flag(field.required())\",\n \"[disabled]\": \"isDisabled()\",\n \"[attr.required]\": \"field.required() || requiredInput() ? '' : null\",\n \"[attr.readonly]\": \"field.readOnly() || readOnlyInput() ? '' : null\",\n // `input` rather than `change`, and it covers a `select` too: picking an\n // option fires `input` before `change` in every current browser.\n \"(input)\": \"write($event)\",\n \"(blur)\": \"onTouched()\",\n },\n})\nexport class UioFieldControl extends UioPart implements ControlValueAccessor {\n readonly scope = \"field\";\n readonly part = \"input\";\n\n protected readonly field = inject(UioFieldContext);\n override readonly invalid: Signal<boolean> = this.field.invalid;\n override readonly readOnly: Signal<boolean> = this.field.readOnly;\n\n /**\n * The control's own copies of the three form states, OR'd with the field's.\n *\n * A control can be disabled without its field being disabled, and — more to\n * the point — a plain `disabled` written on the element would otherwise be\n * wiped by the host binding above on the first change-detection pass.\n */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n protected readonly requiredInput = input(false, {\n alias: \"required\",\n transform: booleanAttribute,\n });\n protected readonly readOnlyInput = input(false, {\n alias: \"readOnly\",\n transform: booleanAttribute,\n });\n\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(\n () => this.field.disabled() || this.disabledInput() || this.formDisabled(),\n );\n\n private readonly host = inject<ElementRef<FieldControlElement>>(ElementRef);\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected write(event: Event): void {\n this.onChange((event.target as FieldControlElement).value);\n }\n\n /**\n * Written straight onto the element, the way Angular's own\n * `DefaultValueAccessor` does. A `[value]` host binding would fight the one\n * the caller may have written on the same element, and the host binding wins\n * every pass — so a form-driven value and a template-driven one could not\n * coexist.\n */\n writeValue(value: string | null): void {\n this.host.nativeElement.value = value ?? \"\";\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n\n/**\n * Advice under the control, named by the control's `aria-describedby`.\n *\n * Takes either projected content or a `message`. The input is not redundant:\n * `<ng-content>` cannot be tested for emptiness, so a component that always\n * projects \"whatever the caller gave us\" believes it has content and renders an\n * empty line of layout. Anything that can vanish therefore has to be told so in\n * a value — the same reason `FieldError` takes a message rather than children.\n */\n@Component({\n selector: \"span[uioFieldDescription]\",\n standalone: true,\n providers: [HostPresence],\n template: `{{ message() }}<ng-content />`,\n host: {\n class: \"field__description\",\n \"[id]\": \"field.partId('helper-text')\",\n },\n})\nexport class UioFieldDescription extends UioPart {\n readonly scope = \"field\";\n readonly part = \"helper-text\";\n\n readonly message = input<string | undefined>(undefined);\n\n protected readonly field = inject(UioFieldContext);\n override readonly disabled: Signal<boolean> = this.field.disabled;\n\n private readonly presence = inject(HostPresence);\n /** No message *given* means the caller projected content; an empty one means no helper. */\n private readonly present = computed(() => this.message() === undefined || !!this.message());\n\n constructor() {\n super();\n this.field.describe(\"helper-text\", this.present);\n effect(() => this.presence.set(this.present()));\n }\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { inputFieldStyles, type InputVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type InputSize = NonNullable<InputVariants[\"size\"]>;\n\n/**\n * A single-line text field, with its label, helper text and error already wired\n * to it.\n *\n * ── Why the parts are written out here ──────────────────────────────────────\n *\n * This is `UioField` prepackaged, and it could have been assembled from\n * `UioFieldControl` and `UioFieldDescription`. It is not, for the reason Switch\n * writes its track and thumb into a template: the control's whole attribute\n * surface is then visible in one place, next to the states that drive it, and\n * the browser parity gate compares every one of them. Assembling it from\n * directives would also mean this component's `[disabled]` and the directive's\n * own host binding both writing `disabled` on the same element every pass, with\n * the host binding winning.\n *\n * The two parts that *are* reused are the ones with nothing to fight over: the\n * label, which only projects content, and the error pill, which takes its\n * identity from the field context this component provides.\n *\n * ── What is deliberately absent ─────────────────────────────────────────────\n *\n * `data-disabled`, on every part. React does not emit one either: `disabled`\n * here is a native attribute on the control rather than a state of the field,\n * and `.field__control:disabled` is in the stylesheet beside\n * `.field__control[data-disabled]`. Disable the whole field instead — label and\n * helper text included — with `<div uioField disabled>`.\n *\n * Angular has no prop spread, so the native attributes worth having are\n * declared. Anything beyond them is a `UioField` away.\n */\n@Component({\n selector: \"div[uioInput]\",\n standalone: true,\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioInput), multi: true },\n ],\n imports: [UioFieldLabel, UioFieldError],\n template: `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <input\n class=\"field__control\"\n data-scope=\"field\"\n data-part=\"input\"\n [id]=\"field.controlId\"\n [attr.type]=\"type()\"\n [attr.name]=\"name()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.spellcheck]=\"spellcheck()\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [attr.step]=\"step()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnlyInput() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"write($event)\"\n (blur)=\"onTouched()\"\n />\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span>\n }\n <!--\n Shows only while the field is invalid and holding a message, which is\n what Ark's ErrorText does — see UioFieldError. That is also why the\n helper text above is hidden by an error rather than merely covered:\n two lines of guidance under one control is one too many.\n -->\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioInput extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /**\n * A string shows an error message; `true` marks the field invalid without\n * one. Same fork the other three take, and the reason `invalid` below is\n * derived rather than an input of its own.\n */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<InputSize>(\"md\");\n readonly required = input(false, { transform: booleanAttribute });\n /**\n * Read-only, on the control rather than on the field — so the root reports no\n * `data-readonly`, for the reason the note above gives for `data-disabled`:\n * Ark's `Field.Root` is never told about a read-only *input* either, and the\n * `readonly` attribute is already on the element the stylesheet selects.\n * Mark the whole field read-only with `<div uioField readOnly>`.\n */\n protected readonly readOnlyInput = input(false, {\n alias: \"readOnly\",\n transform: booleanAttribute,\n });\n readonly type = input<string | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly autocomplete = input<string | undefined>(undefined);\n /**\n * The control's text.\n *\n * A `model()`, so it is uncontrolled until something binds it — the\n * arrangement `UioSwitch` describes — and a reactive form can keep driving it\n * through the value accessor either way. React, Svelte and Vue reach the same\n * place by spreading `value` onto their `Field.Input`; Angular has no spread,\n * so it is declared.\n */\n readonly value = model<string>(\"\");\n /**\n * A name for a control the design does not print a label above — a channel\n * field inside the color picker, say. Prefer `label`: a visible one names\n * the control for everyone rather than only for a screen reader.\n */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n readonly inputMode = input<string | undefined>(undefined);\n readonly spellcheck = input<boolean | undefined>(undefined);\n /* The numeric attributes. Declared rather than spread, for the reason above. */\n readonly min = input<number | undefined>(undefined);\n readonly max = input<number | undefined>(undefined);\n readonly step = input<number | undefined>(undefined);\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n protected readonly hostClass = computed(() => inputFieldStyles({ size: this.size() }));\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // Not the field's state: see the note above about `data-disabled`.\n disabled: signal(false),\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected write(event: Event): void {\n const next = (event.target as HTMLInputElement).value;\n // Kept in step with the element so the binding above never has to fight the\n // user for the caret: the signal only ever differs from the DOM when\n // something *else* wrote the value.\n this.value.set(next);\n this.onChange(next);\n }\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n numberAttribute,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { textAreaFieldStyles, type InputVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type TextAreaSize = NonNullable<InputVariants[\"size\"]>;\nexport type TextAreaResize = \"none\" | \"vertical\" | \"horizontal\" | \"both\";\n\n/**\n * A multi-line text field.\n *\n * The same field as `UioInput` with a `textarea` where the `input` is — which\n * is exactly how the other three libraries write it too, as a near-copy rather\n * than a shared abstraction. The two diverge on more than the tag: the control\n * is a different Ark part, it carries `data-resize` for the affordance the\n * stylesheet turns into a `resize` rule, and its height comes from\n * `.textarea-field__control`, which opts out of the shared single-line control\n * height. A wrapper parameterised over the tag would hide all three.\n *\n * ```html\n * <div uioTextArea label=\"Bio\" resize=\"vertical\" [rows]=\"6\" [formControl]=\"bio\"></div>\n * ```\n */\n@Component({\n selector: \"div[uioTextArea]\",\n standalone: true,\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioTextArea), multi: true },\n ],\n imports: [UioFieldLabel, UioFieldError],\n template: `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <textarea\n class=\"field__control textarea-field__control\"\n data-scope=\"field\"\n data-part=\"textarea\"\n [id]=\"field.controlId\"\n [attr.name]=\"name()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.rows]=\"rows()\"\n [attr.data-resize]=\"resize()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"write($event)\"\n (blur)=\"onTouched()\"\n ></textarea>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioTextArea extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows an error message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<TextAreaSize>(\"md\");\n /**\n * The native resize affordance. `both` by default, with horizontal dragging\n * capped at the field's width by the stylesheet.\n */\n readonly resize = input<TextAreaResize>(\"both\");\n readonly rows = input<number | undefined>(undefined, { transform: optionalNumber });\n readonly required = input(false, { transform: booleanAttribute });\n readonly readOnly = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n protected readonly hostClass = computed(() => textAreaFieldStyles({ size: this.size() }));\n protected readonly value = signal(\"\");\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // `disabled` is a native attribute on the control here, not a state of\n // the field — see the note on UioInput.\n disabled: signal(false),\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected write(event: Event): void {\n const next = (event.target as HTMLTextAreaElement).value;\n this.value.set(next);\n this.onChange(next);\n }\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n\n/**\n * `numberAttribute` turns an absent value into `NaN`, which renders as\n * `rows=\"NaN\"`. A textarea with no `rows` has to have no attribute at all.\n */\nfunction optionalNumber(value: unknown): number | undefined {\n if (value === undefined || value === null || value === \"\") return undefined;\n const parsed = numberAttribute(value as string | number);\n return Number.isNaN(parsed) ? undefined : parsed;\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { clsx } from \"clsx\";\nimport { radioGroupStyles, type RadioGroupVariants } from \"@ui-organized/core\";\nimport { stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type RadioOrientation = NonNullable<RadioGroupVariants[\"orientation\"]>;\n\nexport interface RadioOption {\n value: string;\n label: string;\n disabled?: boolean;\n /** Shown beneath the option, and puts that one control in its error state. */\n error?: string;\n}\n\n/**\n * One choice out of several.\n *\n * ── Why the group is one component and not a root plus items ────────────────\n *\n * A radio group is the one control in this family where the parts are not\n * independent: exactly one item may be checked, every item shares a `name`, and\n * arrow keys move between them. Handing a caller a `UioRadioItem` to place\n * himself would mean each item finding its group, agreeing on the name, and\n * reporting back — for no gain, since the options are data. So the group takes\n * them as data, exactly as the other three do.\n *\n * ── The host is not an Ark part ─────────────────────────────────────────────\n *\n * This is the one component here that does not extend `UioPart`. The element\n * the caller writes is the `.radio-group` wrapper, which holds the group's own\n * heading *outside* the `radiogroup` — Ark's root is the inner `.radio-group__items`.\n * Extending the base would put `data-scope`/`data-part` on the wrapper, which is\n * one element too high, and every state attribute with it.\n *\n * That heading is also why the group's accessible name is wired by hand: it is\n * a sibling of the radiogroup rather than a part of it, so `aria-labelledby`\n * names it explicitly, and with no heading the reference is dropped rather than\n * left dangling — a dangling IDREF outranks `aria-label`.\n *\n * ```html\n * <div uioRadioGroup label=\"Fruit\" [options]=\"fruit\" formControlName=\"fruit\"></div>\n * ```\n */\n@Component({\n selector: \"div[uioRadioGroup]\",\n standalone: true,\n imports: [UioIcon],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioRadioGroup), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <div class=\"radio-group__label\" [id]=\"partId('label')\">{{ text }}</div>\n }\n <div\n class=\"radio-group__items\"\n data-scope=\"radio-group\"\n data-part=\"root\"\n role=\"radiogroup\"\n [id]=\"rootId\"\n [attr.aria-labelledby]=\"label() ? partId('label') : null\"\n [attr.aria-label]=\"label() ? null : ariaLabel()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-orientation]=\"orientation()\"\n >\n @for (option of options(); track option.value) {\n <div class=\"radio-item-wrap\">\n <!--\n Ark's Item *is* the <label>; the dot inside the control is a plain\n child shown by [data-state=\"checked\"] in CSS rather than an\n element that comes and goes.\n -->\n <!--\n Hover and focus are tracked per item rather than per group: a group\n has N of each, so the shared UioInteractionState host directive —\n which reports one — cannot serve it. Same attributes, same reason:\n Radio.css draws its focus ring from [data-focus-visible], and the\n element that takes the focus is the visually-hidden input beside it.\n -->\n <label\n [class]=\"itemClass(option)\"\n data-scope=\"radio-group\"\n data-part=\"item\"\n [id]=\"itemId(option.value)\"\n [attr.for]=\"inputId(option.value)\"\n [attr.data-state]=\"itemState(option.value)\"\n [attr.data-disabled]=\"flag(isDisabled(option))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-hover]=\"flag(hovered() === option.value)\"\n [attr.data-focus]=\"flag(focused() === option.value)\"\n [attr.data-focus-visible]=\"flag(focusVisible() === option.value)\"\n (mouseenter)=\"hovered.set(option.value)\"\n (mouseleave)=\"hovered.set(null)\"\n >\n <div\n class=\"radio-item__control\"\n data-scope=\"radio-group\"\n data-part=\"item-control\"\n aria-hidden=\"true\"\n [id]=\"itemControlId(option.value)\"\n [attr.data-state]=\"itemState(option.value)\"\n [attr.data-disabled]=\"flag(isDisabled(option))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-hover]=\"flag(hovered() === option.value)\"\n [attr.data-focus]=\"flag(focused() === option.value)\"\n [attr.data-focus-visible]=\"flag(focusVisible() === option.value)\"\n >\n <span class=\"radio-item__indicator\"></span>\n </div>\n <span\n class=\"radio-item__label text-default-body-large\"\n data-scope=\"radio-group\"\n data-part=\"item-text\"\n [id]=\"itemTextId(option.value)\"\n [attr.data-state]=\"itemState(option.value)\"\n [attr.data-disabled]=\"flag(isDisabled(option))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-hover]=\"flag(hovered() === option.value)\"\n [attr.data-focus]=\"flag(focused() === option.value)\"\n [attr.data-focus-visible]=\"flag(focusVisible() === option.value)\"\n >{{ option.label }}</span\n >\n <input\n type=\"radio\"\n [id]=\"inputId(option.value)\"\n [attr.style]=\"HIDDEN\"\n [attr.data-ownedby]=\"rootId\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"option.value\"\n [attr.aria-labelledby]=\"itemTextId(option.value)\"\n [checked]=\"value() === option.value\"\n [disabled]=\"isDisabled(option)\"\n (change)=\"select(option.value)\"\n (focus)=\"onItemFocus(option.value, $event)\"\n (blur)=\"onItemBlur()\"\n />\n </label>\n @if (option.error; as message) {\n <div class=\"radio-item__error-message\">\n <span uioIcon [name]=\"glyph('alert-circle')\" [size]=\"ERROR_ICON_SIZE\"></span>\n <span class=\"radio-item__error-text text-emphasis-body-small\">{{ message }}</span>\n </div>\n }\n </div>\n }\n </div>\n `,\n host: { \"[class]\": \"hostClass()\" },\n})\nexport class UioRadioGroup implements ControlValueAccessor {\n protected readonly glyph = glyph;\n /** Which item the pointer is over, and which one holds focus. */\n protected readonly hovered = signal<string | null>(null);\n protected readonly focused = signal<string | null>(null);\n protected readonly focusVisible = signal<string | null>(null);\n\n readonly options = input<readonly RadioOption[]>([]);\n readonly value = model<string | undefined>(undefined);\n readonly label = input<string | undefined>(undefined);\n readonly orientation = input<RadioOrientation>(\"vertical\");\n readonly name = input<string | undefined>(undefined);\n /** Only used when the group has no visible `label`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n readonly valueChange = output<string>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly disabled = computed(() => this.disabledInput() || this.formDisabled());\n\n /**\n * Ark builds every id as `<scope>:<machine>:<part>`, and an item's parts carry\n * the option's value on the end so two groups on a page cannot collide.\n */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `radio-group:${this.machine}`;\n }\n protected partId(part: string): string {\n return `radio-group:${this.machine}:${part}`;\n }\n protected itemId(value: string): string {\n return this.partId(`radio:${value}`);\n }\n protected itemControlId(value: string): string {\n return this.partId(`radio:control:${value}`);\n }\n protected itemTextId(value: string): string {\n return this.partId(`radio:label:${value}`);\n }\n protected onItemFocus(value: string, event: FocusEvent): void {\n this.focused.set(value);\n const target = event.target as Element | null;\n // Guarded exactly as UioInteractionState is, and for the same reason.\n try {\n this.focusVisible.set(target?.matches(\":focus-visible\") ? value : null);\n } catch {\n this.focusVisible.set(null);\n }\n }\n\n protected onItemBlur(): void {\n this.focused.set(null);\n this.focusVisible.set(null);\n this.onTouched();\n }\n\n protected inputId(value: string): string {\n return this.partId(`radio:input:${value}`);\n }\n\n /**\n * Radios in one group share a name — that is what makes the browser treat\n * them as one choice — so an unnamed group still needs one, and its own id is\n * the only value guaranteed unique on the page.\n */\n protected readonly groupName = computed(() => this.name() ?? this.rootId);\n\n protected readonly ERROR_ICON_SIZE = 16;\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n protected readonly hostClass = computed(() =>\n radioGroupStyles({ orientation: this.orientation() }),\n );\n\n protected isDisabled(option: RadioOption): boolean {\n return !!option.disabled || this.disabled();\n }\n protected itemState(value: string): string {\n return this.value() === value ? \"checked\" : \"unchecked\";\n }\n /**\n * The option's own state, not the group's. A group-level `disabled` reports\n * itself through `[data-disabled]` on every part instead, and the split is\n * load-bearing rather than cosmetic: `.radio-item--disabled` is what carries\n * the dimming, so adding it for a group-level disable would fade a whole\n * group that the other three leave at full strength.\n */\n protected itemClass(option: RadioOption): string {\n return clsx(\n \"radio-item\",\n option.disabled && \"radio-item--disabled\",\n option.error && \"radio-item--error\",\n );\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected select(next: string): void {\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n writeValue(value: string | null): void {\n this.value.set(value ?? undefined);\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { Directive, computed, input } from \"@angular/core\";\nimport { cardStyles, type CardVariants } from \"@ui-organized/core\";\n\nexport type CardVariant = NonNullable<CardVariants[\"variant\"]>;\nexport type CardPadding = NonNullable<CardVariants[\"padding\"]>;\n\n/**\n * A surface with the design system's padding and elevation.\n *\n * A directive rather than a component, and an attribute rather than an element,\n * for the same reason as the button: `<uio-card>` would wrap the consumer's\n * content in an element the other three libraries do not render. There is\n * nothing to project — the caller's own children are already in the right place\n * — so there is no template either.\n *\n * ```html\n * <div uioCard variant=\"elevated\" padding=\"lg\">\n * <div uioCardHeader>Title</div>\n * <div uioCardBody>…</div>\n * </div>\n * ```\n */\n@Directive({\n selector: \"[uioCard]\",\n standalone: true,\n host: { \"[class]\": \"hostClass()\" },\n})\nexport class UioCard {\n readonly variant = input<CardVariant>(\"default\");\n readonly padding = input<CardPadding>(\"md\");\n\n protected readonly hostClass = computed(() =>\n cardStyles({ variant: this.variant(), padding: this.padding() }),\n );\n}\n\n@Directive({ selector: \"[uioCardHeader]\", standalone: true, host: { class: \"card__header\" } })\nexport class UioCardHeader {}\n\n@Directive({ selector: \"[uioCardBody]\", standalone: true, host: { class: \"card__body\" } })\nexport class UioCardBody {}\n\n@Directive({ selector: \"[uioCardFooter]\", standalone: true, host: { class: \"card__footer\" } })\nexport class UioCardFooter {}\n","import { Directive, computed, input } from \"@angular/core\";\nimport { dividerStyles, type DividerVariants } from \"@ui-organized/core\";\n\nexport type DividerOrientation = NonNullable<DividerVariants[\"orientation\"]>;\nexport type DividerSpacing = NonNullable<DividerVariants[\"spacing\"]>;\n\n/**\n * A thin rule between content or controls.\n *\n * `role=\"separator\"` is a static host attribute rather than something the caller\n * writes, because a divider that does not announce itself as one is not a\n * divider — it is a styled div. The orientation is bound because assistive\n * technology needs to know which way the rule runs, and it is the one thing here\n * that can change.\n */\n@Directive({\n selector: \"[uioDivider]\",\n standalone: true,\n host: {\n role: \"separator\",\n \"[attr.aria-orientation]\": \"orientation()\",\n \"[class]\": \"hostClass()\",\n },\n})\nexport class UioDivider {\n readonly orientation = input<DividerOrientation>(\"horizontal\");\n readonly spacing = input<DividerSpacing>(\"none\");\n\n protected readonly hostClass = computed(() =>\n dividerStyles({ orientation: this.orientation(), spacing: this.spacing() }),\n );\n}\n","import { Component, computed, input } from \"@angular/core\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { clsx } from \"clsx\";\nimport { tagStyles, type TagVariants } from \"@ui-organized/core\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\nexport type TagVariant = NonNullable<TagVariants[\"variant\"]>;\nexport type TagSize = NonNullable<TagVariants[\"size\"]>;\n\n/**\n * A small status label.\n *\n * A component rather than a directive, because the label is wrapped:\n * `.tag__label` is a real element the stylesheet lays out beside the icon, and\n * only a template can put the caller's content inside it.\n *\n * The icon goes either side of the label according to `iconPosition`, which is\n * the other reason the content is projected rather than left where the caller\n * wrote it. It renders at 16px in every tag size, as the other three do.\n */\n@Component({\n selector: \"span[uioTag]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n @if (iconPosition() === \"left\") {\n <span uioIcon class=\"tag__icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n }<span class=\"tag__label\"><ng-content /></span>@if (icon(); as name) {\n @if (iconPosition() === \"right\") {\n <span uioIcon class=\"tag__icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n }\n `,\n host: { \"[class]\": \"hostClass()\" },\n})\nexport class UioTag {\n readonly variant = input<TagVariant>(\"success\");\n readonly size = input<TagSize>(\"md\");\n /** Subdued tags drop the filled treatment; the default is the filled one. */\n readonly emphasized = input(true);\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n readonly iconPosition = input<\"left\" | \"right\">(\"left\");\n\n /** Icons render at 16px across every tag size. */\n protected readonly ICON_SIZE = 16;\n\n protected readonly hostClass = computed(() =>\n clsx(\n tagStyles({ variant: this.variant(), size: this.size() }),\n !this.emphasized() && \"tag--subdued\",\n ),\n );\n}\n","import { Component, Directive, ElementRef, computed, inject, input, output } from \"@angular/core\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { clsx } from \"clsx\";\nimport { chipSegmentStyles, chipStyles, type ChipSegmentPart } from \"@ui-organized/core\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/**\n * A compact token standing for something the user added — a filter, a facet, a\n * recipient — which they can then edit or remove.\n *\n * Segmented (Figma 2462:2636): \"Name | is greater than | Value\" is three\n * controls, each opening the menu for the one parameter it shows. Every segment\n * and the dismiss control are **siblings** inside the host: a button nested in\n * a button is invalid HTML and an axe `nested-interactive` violation.\n *\n * `label`/`operator`/`value` are shorthand for static segments. For a chip\n * whose parts each open something, project `uioChipSegment` buttons instead —\n * each one can then carry its own `uioMenuTrigger` or `uioPopoverTrigger`,\n * which is how the table's filter chip is built.\n */\n@Component({\n selector: \"span[uioChip]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n <!-- Static shorthand segments. A segment that opens nothing is a span, or\n every token in a list puts empty stops in the tab order — except when\n disabled, where a real disabled control is what exempts the dimmed text\n from axe's contrast rule. Same rule as React's ChipSegment. -->\n @for (segment of segments(); track segment.part) {\n @if (disabled()) {\n <button type=\"button\" [class]=\"segment.className\" disabled>{{ segment.text }}</button>\n } @else {\n <span [class]=\"segment.className\">{{ segment.text }}</span>\n }\n }\n <ng-content />\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"chip__remove\"\n [attr.aria-label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (click)=\"remove.emit($event)\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"ICON_SIZE\"></span>\n </button>\n }\n `,\n host: { role: \"group\", \"[class]\": \"hostClass()\" },\n})\nexport class UioChip {\n protected readonly glyph = glyph;\n /** Shorthand for a static label segment — what the chip is *about*. Never truncated. */\n readonly label = input<string | null | undefined>(undefined);\n /** Shorthand for a static operator segment: \"is any of\", \"is before\". Always spelled. */\n readonly operator = input<string | null | undefined>(undefined);\n /** Shorthand for a static value segment. The only part that truncates. */\n readonly value = input<string | null | undefined>(undefined);\n /** One of its menus is open, or it is toggled on. Fills the chip with brand. */\n readonly selected = input(false);\n /** The chip exists but does not yet stand for anything. */\n readonly incomplete = input(false);\n /** Disables every segment and the dismiss control. */\n readonly disabled = input(false);\n /** Renders the dismiss button. `removeLabel` is its whole accessible name. */\n readonly removable = input(false);\n readonly removeLabel = input<string | undefined>(undefined);\n readonly remove = output<MouseEvent>();\n\n /** The dismiss icon, at the size `UioTag`'s icons render. */\n protected readonly ICON_SIZE = 16;\n\n protected readonly segments = computed(() =>\n (\n [\n [\"label\", this.label()],\n [\"operator\", this.operator()],\n [\"value\", this.value()],\n ] as const\n )\n .filter(([, text]) => text !== undefined && text !== null)\n .map(([part, text]) => ({ part, text, className: chipSegmentStyles({ part }) })),\n );\n\n protected readonly hostClass = computed(() =>\n clsx(\n chipStyles(),\n this.selected() && \"chip--selected\",\n this.incomplete() && \"chip--incomplete\",\n this.disabled() && \"chip--disabled\",\n ),\n );\n}\n\n/**\n * One part of a chip's sentence, projected into a `uioChip`.\n *\n * A directive, not a component, so it adds no element: segments have to be\n * direct children of `.chip` for the dividers and the pill's end padding to\n * land. Put it on a `<button>` when the segment opens something and on a\n * `<span>` when it does not — Angular cannot swap the element the way React's\n * `ChipSegment` does, so the consumer chooses.\n */\n@Directive({\n selector: \"button[uioChipSegment], span[uioChipSegment]\",\n standalone: true,\n host: {\n \"[class]\": \"segmentClass()\",\n \"[attr.type]\": \"isButton ? 'button' : null\",\n \"[attr.disabled]\": \"isButton && isDisabled() ? '' : null\",\n },\n})\nexport class UioChipSegment {\n /** Which part of the chip's sentence this is. Decides its padding and ink. */\n readonly part = input<ChipSegmentPart>(\"value\");\n readonly disabled = input(false);\n\n private readonly chip = inject(UioChip, { optional: true });\n protected readonly isButton =\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.tagName === \"BUTTON\";\n\n protected readonly isDisabled = computed(() => this.disabled() || !!this.chip?.disabled());\n protected readonly segmentClass = computed(() => chipSegmentStyles({ part: this.part() }));\n}\n","import { Component, Directive, computed, input } from \"@angular/core\";\nimport { skeletonStyles, type SkeletonVariants } from \"@ui-organized/core\";\n\nexport type SkeletonVariant = NonNullable<SkeletonVariants[\"variant\"]>;\n\n/** A number is treated as pixels; a string passes through as written. */\nexport function toCssSize(value: number | string | undefined): string | undefined {\n if (value == null) return undefined;\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\n/**\n * A loading placeholder, sized to the content it stands in for.\n *\n * ── One API difference, and why ─────────────────────────────────────────────\n *\n * The other three libraries take a `lines` prop and switch their own root\n * element: one line renders a `<span>`, several render a `<div\n * class=\"skeleton-group\">` wrapping one `<span>` per line. An Angular directive\n * cannot change the element it is on — the caller wrote it — so the two shapes\n * are two directives, and the caller picks the tag that matches what they want.\n *\n * The rendered DOM is identical either way, which is the part that has to be\n * true. Hiding the difference behind one selector would mean an element wrapper\n * this design system does not have.\n *\n * ```html\n * <span uioSkeleton variant=\"circle\" [width]=\"40\" [height]=\"40\"></span>\n * <div uioSkeletonGroup [lines]=\"3\" [width]=\"200\"></div>\n * ```\n */\n@Directive({\n selector: \"[uioSkeleton]\",\n standalone: true,\n host: {\n \"aria-hidden\": \"true\",\n \"[class]\": \"hostClass()\",\n \"[style.width]\": \"toCss(width())\",\n \"[style.height]\": \"toCss(height())\",\n },\n})\nexport class UioSkeleton {\n readonly variant = input<SkeletonVariant>(\"text\");\n readonly animated = input(true);\n readonly width = input<number | string | undefined>(undefined);\n readonly height = input<number | string | undefined>(undefined);\n\n protected readonly toCss = toCssSize;\n protected readonly hostClass = computed(() =>\n skeletonStyles({ variant: this.variant(), animated: this.animated() }),\n );\n}\n\n/**\n * A stack of placeholder lines, with a shortened last row.\n *\n * The 60% on the final line is what makes a block of skeleton text read as text\n * rather than as a rectangle, and it belongs here rather than in the stylesheet\n * because only the component knows which line is last.\n */\n@Component({\n selector: \"[uioSkeletonGroup]\",\n standalone: true,\n template: `\n @for (index of indices(); track index) {\n <span\n [class]=\"itemClass()\"\n [style.width]=\"widthFor(index)\"\n [style.height]=\"toCss(height())\"\n ></span>\n }\n `,\n host: { class: \"skeleton-group\", \"aria-hidden\": \"true\" },\n})\nexport class UioSkeletonGroup {\n readonly variant = input<SkeletonVariant>(\"text\");\n readonly animated = input(true);\n readonly width = input<number | string | undefined>(undefined);\n readonly height = input<number | string | undefined>(undefined);\n readonly lines = input(1);\n\n protected readonly toCss = toCssSize;\n protected readonly indices = computed(() =>\n Array.from({ length: Math.max(1, this.lines()) }, (_, index) => index),\n );\n protected readonly itemClass = computed(() =>\n skeletonStyles({ variant: this.variant(), animated: this.animated() }),\n );\n\n protected widthFor(index: number): string {\n return index === this.indices().length - 1 ? \"60%\" : (toCssSize(this.width()) ?? \"100%\");\n }\n}\n","import { AfterViewInit, Directive, ElementRef, inject } from \"@angular/core\";\n\n/**\n * Gives a CDK overlay the stacking level its own content declares.\n *\n * ── The problem ─────────────────────────────────────────────────────────────\n *\n * The shared stylesheet declares stacking on the **popup**, never on the thing\n * that positions it:\n *\n * ```css\n * .popover__popup { z-index: var(--z-index-popover, 1200); }\n * .dialog__popup { z-index: var(--z-index-dialog, 1100); }\n * ```\n *\n * That is not a style choice, it is `@zag-js/popper`'s contract. Zag writes an\n * inline `z-index: var(--z-index)` onto the positioner and then fills that\n * variable by reading the popup back:\n *\n * ```js\n * floating.style.setProperty(\"--z-index\", getComputedStyle(contentEl).zIndex)\n * ```\n *\n * So in the other three libraries the positioner inherits its level from the\n * popup, and a popover opened inside a dialog paints over it because 1200 beats\n * 1100. Getting that backwards is not subtle in effect and completely silent in\n * the code — the rule sits right there in devtools, applying to an element whose\n * stacking nobody consults.\n *\n * ── Why Angular needs its own answer ────────────────────────────────────────\n *\n * The CDK has no positioner. It parents every overlay to a single\n * `.cdk-overlay-container` and positions a `.cdk-overlay-pane` — which is the\n * element the browser actually stacks, and which knows nothing about what is\n * inside it. Every CDK pane therefore stacks identically, on DOM order alone,\n * and a select opened from inside a dialog renders *behind* its host.\n *\n * This reproduces zag's mechanism rather than replacing it: put the directive on\n * the popup, and the pane takes the level the popup's own rule computed. Nothing\n * is hardcoded, nothing is duplicated from the stylesheet, and a change to\n * `--z-index-popover` moves both this and React on the next render.\n *\n * Put it on the positioner; it finds the level wherever the stylesheet declares\n * it.\n *\n * ```html\n * <div class=\"popover__positioner\" uioOverlayStacking>\n * <div class=\"popover__popup\">…</div>\n * </div>\n * ```\n *\n * The library's own five overlays call {@link applyOverlayStacking} directly\n * instead, through `applySurfaceStacking` — they already hold the `OverlayRef`,\n * and a directive would leave a `uiooverlaystacking` attribute in every\n * consumer's DOM for nothing. The directive is for anyone building their own CDK\n * overlay against this stylesheet.\n *\n * ── One thing it is *not* responsible for ───────────────────────────────────\n *\n * CDK 21 shows every overlay in the browser's **top layer** (`popover=\"manual\"`),\n * where stacking is by the order surfaces were shown and `z-index` between them\n * does not apply at all. So in the common case — a popover opened from inside a\n * dialog — the popover is on top because it opened last, not because of this.\n * What this still governs is the pane's level against everything that is *not*\n * in the top layer, and it keeps the rendered contract honest: the same surfaces\n * carry the same levels they do in the other three libraries.\n */\nexport function applyOverlayStacking(pane: HTMLElement, positioner: HTMLElement): string | null {\n const view = pane.ownerDocument.defaultView;\n if (!view) return null;\n\n /**\n * Two shapes, one lookup — the same one zag does.\n *\n * A popper-positioned surface declares its level on the *popup*\n * (`.popover__popup`, `.select-popup`), because zag reads it back from\n * `positioner.firstElementChild`. A modal one is not popper-positioned at all\n * and declares it on the positioner itself (`.dialog__positioner`). Looking at\n * the positioner and then falling through to its first child covers both, and\n * means a component author places this in one place and never has to know\n * which kind of surface they are building.\n */\n const declared = [positioner, positioner.firstElementChild]\n .filter((element): element is HTMLElement => element instanceof view.HTMLElement)\n .map((element) => view.getComputedStyle(element).zIndex)\n .find((zIndex) => zIndex && zIndex !== \"auto\");\n\n // `auto` everywhere means no rule applies, and writing it onto the pane would\n // clear CDK's own value for no reason.\n if (!declared) return null;\n\n /**\n * Both elements, because they answer two different questions.\n *\n * The **pane** is what the browser stacks, so it is what makes a popover\n * actually paint over a dialog. The **positioner** is where the other three\n * libraries carry the level — zag writes an inline `z-index` onto it — and so\n * it is what anything comparing the four reads back. Writing only the pane\n * leaves `.select-positioner` computing `auto` where React reports 1200, and\n * the four would differ on the one property this exists to keep in step.\n *\n * Idempotent: a second run reads back the value it wrote and writes it again.\n */\n pane.style.zIndex = declared;\n positioner.style.zIndex = declared;\n return declared;\n}\n\n@Directive({ selector: \"[uioOverlayStacking]\", standalone: true })\nexport class UioOverlayStacking implements AfterViewInit {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n ngAfterViewInit(): void {\n const positioner = this.host.nativeElement;\n // After view init rather than on construction: the pane exists only once the\n // overlay has attached, and a computed style is only meaningful once the\n // element is in the document with the stylesheet applied.\n const pane = positioner.closest<HTMLElement>(\".cdk-overlay-pane\");\n if (pane) applyOverlayStacking(pane, positioner);\n }\n}\n","import type { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { applyOverlayStacking } from \"./stacking.js\";\n\n/**\n * The CDK plumbing all five overlays share, and the three places the CDK's\n * defaults are wrong for this design system.\n *\n * ── 1. The pane's id ────────────────────────────────────────────────────────\n *\n * The CDK stamps `id=\"cdk-overlay-3\"` on every pane it creates, for its own\n * debugging. No other library in this system renders that element at all — Ark\n * portals the positioner straight into `document.body` — and the parity gate\n * numbers **every id in the document in order** so that a reference can be\n * compared across four libraries that all generate different literals. One\n * extra id shifts every placeholder after it, and reports markup that is\n * identical as different. Nothing in the CDK reads the id back, so it goes.\n *\n * ── 2. The backdrop ─────────────────────────────────────────────────────────\n *\n * `hasBackdrop` gives a `.cdk-overlay-dark-backdrop`, which is a second dimming\n * layer over the `.dialog__backdrop` the shared stylesheet already defines.\n * Every surface here is created without one and renders its own where the\n * design calls for it.\n *\n * ── 3. The top layer ────────────────────────────────────────────────────────\n *\n * CDK 21 shows each overlay's host with `popover=\"manual\"`, which puts it in the\n * browser's **top layer** — where stacking is by the order surfaces were shown\n * and `z-index` between them does not apply. Every surface here is attached when\n * its component initialises (Ark renders its portal whether the popup is open or\n * not, and a closed dialog is still laid out — see `UioDialog`), so show order\n * is *mount* order rather than *open* order, and a popover opened from inside a\n * dialog would sit under the dialog that has been showing since page load.\n * {@link raiseSurface} re-shows the host at the moment a surface opens, which is\n * the only lever the top layer offers.\n */\nexport function createSurface(overlay: Overlay, config: OverlayConfig): OverlayRef {\n const ref = overlay.create({ ...config, hasBackdrop: false });\n ref.overlayElement.removeAttribute(\"id\");\n return ref;\n}\n\n/**\n * Give the pane, and the positioner inside it, the stacking level the popup's\n * own rule computed.\n *\n * Called after the portal is attached, never before: `applyOverlayStacking`\n * reads a *computed* style, which is only meaningful once the element is in the\n * document with the stylesheet applied.\n */\nexport function applySurfaceStacking(ref: OverlayRef): void {\n for (const positioner of ref.overlayElement.querySelectorAll<HTMLElement>(\n '[data-part=\"positioner\"]',\n )) {\n applyOverlayStacking(ref.overlayElement, positioner);\n }\n}\n\n/**\n * Move an already-showing surface to the top of the browser's top layer.\n *\n * There is no API for reordering it: the position is fixed when the popover is\n * shown, so the only way up is to hide and show again. Guarded on\n * `:popover-open` because `showPopover()` on an element that is not showing is\n * fine, and `hidePopover()` on one that is not showing is a no-op — but the pair\n * is only *needed* when it is already up there.\n *\n * A no-op when the CDK is not using the popover API (an older browser, or\n * `usePopover: false`), where `z-index` governs and `UioOverlayStacking` has\n * already done the work.\n */\nexport function raiseSurface(ref: OverlayRef): void {\n const host = ref.hostElement as HTMLElement & {\n hidePopover?: () => void;\n showPopover?: () => void;\n };\n if (!host?.showPopover || !host.matches(\":popover-open\")) return;\n try {\n host.hidePopover();\n host.showPopover();\n } catch {\n // Both calls throw if the element left the document between them. A surface\n // that is gone does not need raising.\n }\n}\n\n/**\n * Whether the pane takes pointer events.\n *\n * A closed surface stays attached — Ark keeps its portal rendered — and\n * `.cdk-overlay-pane` is `pointer-events: auto`, so a closed dialog's\n * full-viewport positioner would swallow every click on the page. Zag writes the\n * same thing onto its positioner; this writes it one level up, on the element\n * the CDK owns.\n */\nexport function setSurfaceInteractive(ref: OverlayRef, interactive: boolean): void {\n ref.overlayElement.style.pointerEvents = interactive ? \"\" : \"none\";\n}\n","import type { ConnectedPosition } from \"@angular/cdk/overlay\";\n\n/**\n * Where an anchored surface sits relative to its trigger, in the two spellings\n * the system uses.\n *\n * ── Two vocabularies, and why both are here ─────────────────────────────────\n *\n * The facade takes `side` + `align` — the pair Base UI used and the one every\n * component in this design system still exposes. Zag takes a single\n * *placement* (`\"bottom-start\"`), and Ark reflects the **resolved** one back\n * onto the trigger and the content as `data-placement` / `data-side`. Those two\n * attributes are part of the rendered contract the parity gate compares, so\n * Angular has to produce them from whatever the CDK actually chose.\n *\n * The CDK speaks a third vocabulary — four corner keywords per position — and\n * has no name for the result at all. It reports the `ConnectedPosition` object\n * it settled on, by identity. So each candidate is built here *paired with* the\n * placement name it stands for, and the resolved name is recovered by finding\n * the object in the list. Nothing is inferred from geometry, which is the only\n * way this stays correct when the CDK flips a surface for lack of room.\n */\n\nexport type OverlaySide = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type OverlayAlign = \"start\" | \"center\" | \"end\";\n/** Zag's spelling: a bare side means centre-aligned. */\nexport type OverlayPlacement = OverlaySide | `${OverlaySide}-start` | `${OverlaySide}-end`;\n\nexport function toPlacement(side: OverlaySide, align: OverlayAlign): OverlayPlacement {\n return align === \"center\" ? side : (`${side}-${align}` as OverlayPlacement);\n}\n\nexport function sideOf(placement: OverlayPlacement): OverlaySide {\n return placement.split(\"-\")[0] as OverlaySide;\n}\n\nconst OPPOSITE: Record<OverlaySide, OverlaySide> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n};\n\n/** A CDK position and the placement name it stands for. */\nexport interface AnchoredPosition {\n placement: OverlayPlacement;\n position: ConnectedPosition;\n}\n\nconst isVertical = (side: OverlaySide) => side === \"top\" || side === \"bottom\";\n\n/**\n * One candidate position.\n *\n * `sideOffset` is the gap along the axis the surface is on — zag calls it\n * `gutter` — and it flips sign with the side, because \"8px below\" and \"8px\n * above\" are opposite directions in the CDK's single offset. `alignOffset` runs\n * along the *cross* axis, so which of `offsetX`/`offsetY` it lands in swaps with\n * the orientation.\n */\nfunction positionFor(\n side: OverlaySide,\n align: OverlayAlign,\n sideOffset: number,\n alignOffset: number,\n): ConnectedPosition {\n if (isVertical(side)) {\n const x = align === \"center\" ? \"center\" : align;\n return {\n originX: x,\n originY: side === \"bottom\" ? \"bottom\" : \"top\",\n overlayX: x,\n overlayY: side === \"bottom\" ? \"top\" : \"bottom\",\n offsetY: side === \"bottom\" ? sideOffset : -sideOffset,\n offsetX: alignOffset,\n };\n }\n const y = align === \"center\" ? \"center\" : align === \"start\" ? \"top\" : \"bottom\";\n return {\n originX: side === \"right\" ? \"end\" : \"start\",\n originY: y,\n overlayX: side === \"right\" ? \"start\" : \"end\",\n overlayY: y,\n offsetX: side === \"right\" ? sideOffset : -sideOffset,\n offsetY: alignOffset,\n };\n}\n\n/**\n * The candidate list the CDK picks from, best first.\n *\n * The preferred placement, then the same alignment on the opposite side, then\n * the two perpendicular sides. That is floating-ui's `flip()` followed by its\n * fallback axis, which is what Ark runs — and it is not academic: the parity\n * harness renders its trigger at the top of the viewport, so a tooltip asking\n * for `top` has nowhere to go and Ark reports `data-placement=\"bottom\"`. Without\n * a fallback here the CDK would leave the surface off-screen and Angular would\n * report a placement it never used.\n */\nexport function anchoredPositions(\n side: OverlaySide,\n align: OverlayAlign,\n sideOffset: number,\n alignOffset = 0,\n): AnchoredPosition[] {\n const perpendicular: OverlaySide[] = isVertical(side) ? [\"right\", \"left\"] : [\"bottom\", \"top\"];\n return [side, OPPOSITE[side], ...perpendicular].map((candidate) => ({\n placement: toPlacement(candidate, align),\n position: positionFor(candidate, align, sideOffset, alignOffset),\n }));\n}\n","/**\n * Which open surface an Escape or a click outside belongs to.\n *\n * ── Why the CDK's own answer is the wrong one here ──────────────────────────\n *\n * `OverlayRef.keydownEvents()` routes a keypress to the **most recently\n * attached** overlay, and `outsidePointerEvents()` fires for every attached\n * overlay at once. Both are correct for the CDK's model, where an overlay is\n * attached when it opens. This library's overlays are attached when their\n * component initialises and stay attached while closed, because that is what Ark\n * does and what the shared stylesheet's exit transitions need — so \"most\n * recently attached\" is page order, and Escape inside a select that was declared\n * before its dialog would close the dialog.\n *\n * So openness is tracked here instead, as a stack, which is also how zag does it\n * (`--layer-index` / `--nested-layer-count` are that stack, rendered). The top of\n * the stack — the surface opened last — is the only one an Escape or an outside\n * click can reach. A select opened inside a dialog therefore closes itself and\n * leaves the dialog alone, and a second Escape closes the dialog.\n */\nexport interface DismissibleLayer {\n /** The surface a pointer may land in without dismissing it. */\n surface(): HTMLElement | null;\n /**\n * The element that opens it, which is *also* not \"outside\".\n *\n * Without this a click on an open surface's trigger dismisses it here and\n * re-opens it in the trigger's own click handler, so the surface never closes.\n */\n trigger(): HTMLElement | null;\n dismiss(reason: \"escape\" | \"interact-outside\"): void;\n}\n\nconst stack: DismissibleLayer[] = [];\nlet listening: Document | null = null;\n\nfunction top(): DismissibleLayer | undefined {\n return stack[stack.length - 1];\n}\n\nfunction contains(element: HTMLElement | null, target: EventTarget | null): boolean {\n return !!element && target instanceof Node && element.contains(target);\n}\n\nfunction onKeydown(event: KeyboardEvent): void {\n // Not `event.key === \"Esc\"`: that is IE's spelling and nothing this library\n // supports emits it. `defaultPrevented` lets a surface handle its own Escape\n // first — a combobox clearing its query, say — without also closing.\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const layer = top();\n if (!layer) return;\n event.preventDefault();\n layer.dismiss(\"escape\");\n}\n\n/**\n * Capture phase, unlike the keydown above.\n *\n * A pointer that lands outside has to be recognised before whatever it landed\n * on gets to stop the event — a `pointerdown` handler on a card that calls\n * `stopPropagation()` would otherwise leave every menu on the page open.\n */\nfunction onPointerDown(event: PointerEvent): void {\n const layer = top();\n if (!layer) return;\n const target = event.target;\n if (contains(layer.surface(), target) || contains(layer.trigger(), target)) return;\n layer.dismiss(\"interact-outside\");\n}\n\nfunction listen(document: Document): void {\n if (listening) return;\n listening = document;\n document.addEventListener(\"keydown\", onKeydown);\n document.addEventListener(\"pointerdown\", onPointerDown, true);\n}\n\nfunction stopListening(): void {\n if (!listening) return;\n listening.removeEventListener(\"keydown\", onKeydown);\n listening.removeEventListener(\"pointerdown\", onPointerDown, true);\n listening = null;\n}\n\n/** Called when a surface opens. Idempotent, so a re-open cannot stack twice. */\nexport function pushLayer(document: Document, layer: DismissibleLayer): void {\n removeLayer(layer);\n stack.push(layer);\n listen(document);\n}\n\n/** Called when a surface closes *or is destroyed*, so a leak cannot outlive it. */\nexport function removeLayer(layer: DismissibleLayer): void {\n const index = stack.indexOf(layer);\n if (index !== -1) stack.splice(index, 1);\n if (!stack.length) stopListening();\n}\n\n/** Exported for `overlay.spec.ts`: nothing else should need to know the depth. */\nexport function openLayerCount(): number {\n return stack.length;\n}\n","/**\n * Hiding the rest of the page from assistive technology while a modal dialog is\n * open, and putting it back.\n *\n * ── What has to be reproduced ───────────────────────────────────────────────\n *\n * `aria-modal=\"true\"` on the dialog is not enough on its own — support for it is\n * uneven, and every headless library still marks the siblings. Zag does it with\n * `@zag-js/aria-hidden`, which walks up from the dialog and marks the siblings\n * at every level, leaving `aria-hidden=\"true\"` and its own `data-aria-hidden`\n * marker on each. Both attributes are part of the rendered contract: the parity\n * gate compares `#mount` itself, and a Select rendered inside a dialog is\n * compared *with* the marks a dialog left on its positioner.\n *\n * ── Why it is not a straight port of that walk ──────────────────────────────\n *\n * In the other three libraries a portalled surface is a child of `document.body`,\n * so walking up from the dialog reaches its siblings directly. The CDK puts two\n * elements in between — one `.cdk-overlay-container` for every overlay on the\n * page, and inside it a `popover` host and a `.cdk-overlay-pane` per surface —\n * so the same walk would mark a *pane*, and the positioner inside it would carry\n * no marks at all. The subtree would be hidden either way; the rendered contract\n * would not match, and the gate compares the positioner.\n *\n * So the set is named directly instead: everything in the body except the\n * overlay container, plus every surface inside the container that is not this\n * dialog's own. That is exactly the set zag's walk produces, addressed by what\n * the elements *are* rather than by where the CDK happened to put them.\n */\n\nconst MARKER = \"data-aria-hidden\";\n\n/** What an element's `aria-hidden` was before, so it can be given back. */\ninterface Mark {\n element: HTMLElement;\n previous: string | null;\n}\n\nfunction markable(element: Element): element is HTMLElement {\n return element instanceof element.ownerDocument.defaultView!.HTMLElement;\n}\n\nfunction hide(element: HTMLElement, marks: Mark[]): void {\n // Already marked by an outer dialog: leave it, and leave its saved value\n // alone. Restoring the inner dialog first would otherwise un-hide the page\n // while the outer one is still open.\n if (element.hasAttribute(MARKER)) return;\n marks.push({ element, previous: element.getAttribute(\"aria-hidden\") });\n element.setAttribute(\"aria-hidden\", \"true\");\n element.setAttribute(MARKER, \"\");\n}\n\n/**\n * Hide everything that is not `keep` — the dialog's own positioner — and return\n * the undo.\n *\n * The dialog's backdrop is deliberately *not* excluded: it is a sibling of the\n * positioner inside the same pane, it is decoration, and Ark marks it too.\n */\nexport function hideOthersFrom(keep: HTMLElement): () => void {\n const document = keep.ownerDocument;\n const marks: Mark[] = [];\n\n for (const child of Array.from(document.body.children)) {\n // The overlay container holds the dialog itself; it is handled surface by\n // surface below. Scripts and styles are not in the accessibility tree.\n if (!markable(child) || child.contains(keep)) continue;\n if (child.tagName === \"SCRIPT\" || child.tagName === \"STYLE\") continue;\n hide(child, marks);\n }\n\n /**\n * The elements that *are* body children in the other three libraries: the\n * positioner of every other overlay, and this dialog's own backdrop. Named by\n * their part rather than by depth, because the CDK's scaffolding is not always\n * the same depth — a surface rendered from a component portal has its own host\n * element between the pane and the positioner.\n */\n const SURFACES = '[data-part=\"positioner\"], [data-part=\"backdrop\"]';\n for (const surface of Array.from(\n document.querySelectorAll(`.cdk-overlay-container ${SURFACES}`),\n )) {\n if (!markable(surface) || surface === keep || surface.contains(keep)) continue;\n hide(surface, marks);\n }\n\n return () => {\n for (const { element, previous } of marks) {\n element.removeAttribute(MARKER);\n if (previous === null) element.removeAttribute(\"aria-hidden\");\n else element.setAttribute(\"aria-hidden\", previous);\n }\n marks.length = 0;\n };\n}\n","/**\n * Where focus goes when a surface opens, and where it comes back to.\n *\n * ── Why the CDK's `FocusTrap` is not asked this ─────────────────────────────\n *\n * `FocusTrap.focusInitialElement()` finds the first tabbable element through\n * `InteractivityChecker`, which asks the element whether it is *visible* —\n * `offsetWidth`, `offsetHeight`, `getClientRects()`. That is the right question\n * in a browser and unanswerable in jsdom, where every element measures zero, so\n * a trap consulted in a unit test reports that a dialog full of buttons has\n * nothing to focus. The trap is still what holds Tab inside the surface; this is\n * only the opening move, and it is deliberately structural so that the behaviour\n * a spec asserts is the behaviour a browser performs.\n */\n\n/**\n * Elements that take focus by default, in DOM order.\n *\n * `[tabindex]:not([tabindex=\"-1\"])` rather than every `[tabindex]`, because\n * `-1` means \"focusable by script, not by Tab\" — the popup itself carries one,\n * and landing on it would skip the close button a user expects.\n */\nconst FOCUSABLE = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n]\n .map((selector) => `${selector}:not([aria-hidden=\"true\"])`)\n .join(\",\");\n\nexport function firstFocusable(root: HTMLElement): HTMLElement | null {\n return root.querySelector<HTMLElement>(FOCUSABLE);\n}\n\n/**\n * Focus the first thing inside `root`, falling back to `root` itself.\n *\n * The fallback is why every popup in this library carries `tabindex=\"-1\"`: a\n * dialog with nothing focusable in it still has to take focus, or the next Tab\n * starts from the top of the page and walks straight past the dialog.\n */\nexport function focusInside(root: HTMLElement): void {\n (firstFocusable(root) ?? root).focus({ preventScroll: true });\n}\n\n/**\n * Give focus back to whatever opened the surface.\n *\n * Guarded on the element still being in the document: a menu item that removes\n * its own trigger would otherwise focus a detached node, which silently sends\n * focus to `<body>` and loses the user's place entirely.\n */\nexport function restoreFocus(trigger: HTMLElement | null): void {\n if (trigger?.isConnected) trigger.focus({ preventScroll: true });\n}\n","import { Injectable, computed, signal } from \"@angular/core\";\nimport { nextMachineId } from \"../part-ids.js\";\n\n/**\n * The identity a dialog's parts share, and the two references its content\n * cannot make up.\n *\n * Ark names the popup after whichever of Title and Description are rendered, and\n * *omits* the reference when the part is absent — a Select-in-a-Dialog has a\n * title and no description, and Ark emits `aria-labelledby` alone. A dangling\n * IDREF is not a cosmetic difference: it outranks any `aria-label` beside it, so\n * a popup naming a title that does not exist reaches a screen reader unnamed.\n *\n * The parts are content children of `<uio-dialog>`, so they are constructed with\n * the caller's view — before any binding in this component is evaluated — and\n * registering in a constructor is therefore early enough to be read in the same\n * pass. Same arrangement as `UioFieldContext`, and for the same reason.\n */\n@Injectable()\nexport class UioDialogContext {\n private readonly machine = nextMachineId();\n\n private readonly titled = signal(false);\n private readonly described = signal(false);\n\n partId(part: string): string {\n return `dialog:${this.machine}:${part}`;\n }\n\n /** Ark's machine reference, which the trigger reports as `data-ownedby`. */\n get machineId(): string {\n return this.machine;\n }\n\n registerTitle(): void {\n this.titled.set(true);\n }\n registerDescription(): void {\n this.described.set(true);\n }\n\n readonly labelledBy = computed(() => (this.titled() ? this.partId(\"title\") : null));\n readonly describedBy = computed(() => (this.described() ? this.partId(\"description\") : null));\n}\n","import type { ApplicationRef } from \"@angular/core\";\n\n/**\n * Bring the DOM up to date *now*, the way React does when a discrete event\n * changes state.\n *\n * ── Why an overlay needs this and a checkbox does not ───────────────────────\n *\n * React 18 flushes a state update from a discrete event — a click, a keypress —\n * synchronously, before the event handler returns. Angular's zoneless scheduler\n * does not: a signal write notifies the scheduler, which runs change detection\n * on the next task. Around 5ms later, in practice.\n *\n * For a checkbox nobody can tell. For an overlay it is the difference between\n * two libraries agreeing and not, because an overlay's state is spread across\n * elements that are refreshed by *different* views: the trigger's\n * `aria-expanded` belongs to the caller's view, the popup's `data-state` to a\n * portalled embedded view, and the `aria-hidden` marks on the rest of the page\n * are written by hand. Anything that reads the DOM straight after the keypress —\n * the parity gate does exactly that, and so does any test a consumer writes —\n * sees them mid-flight.\n *\n * So a user interaction flushes. The declarative path (`[open]=\"editing()\"`)\n * does not need to: it is already inside a change-detection pass, and the\n * `catch` below is what makes calling this from one harmless — Angular refuses a\n * recursive `tick()`, and a caller who is already in a pass has one coming\n * anyway.\n */\nexport function flushNow(appRef: ApplicationRef): void {\n try {\n appRef.tick();\n } catch {\n // Recursive tick: the change is already scheduled to land in the pass that\n // is running. Nothing is lost, only the immediacy.\n }\n}\n","import { Overlay, type OverlayRef, type BlockScrollStrategy } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { FocusTrapFactory, type FocusTrap } from \"@angular/cdk/a11y\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { dialogStyles, type DialogVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { hideOthersFrom } from \"../overlay/aria-hidden.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport { applySurfaceStacking, createSurface, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { UioDialogContext } from \"./dialog-context.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type DialogSize = NonNullable<DialogVariants[\"size\"]>;\n\n/**\n * A modal surface that takes the page over until it is answered.\n *\n * ```html\n * <button uioButton uioDialogTrigger [dialog]=\"confirm\">Delete</button>\n * <uio-dialog #confirm=\"uioDialog\">\n * <h2 uioDialogTitle>Delete this?</h2>\n * <div uioDialogDescription>This cannot be undone.</div>\n * <div uioDialogFooter>\n * <button uioButton uioDialogClose>Cancel</button>\n * </div>\n * </uio-dialog>\n * ```\n *\n * ── Why the element disappears ──────────────────────────────────────────────\n *\n * Ark's Dialog root renders no element at all — a React dialog leaves nothing\n * behind where it was written, and everything it does render is portalled. An\n * Angular component cannot decline to render the element the caller wrote, so\n * `HostPresence` takes `<uio-dialog>` out of the DOM once its surface has been\n * handed to the overlay. Without that, every dialog on a page would leave an\n * empty element in the middle of its parent's layout.\n *\n * ── Why the surface is attached before it is opened ─────────────────────────\n *\n * The CDK's habit is to attach an overlay when it opens and detach it when it\n * closes. This one attaches on init and stays attached, because Ark does: a\n * React dialog's backdrop and popup are in the document from first render,\n * carrying `data-state=\"closed\"` and `hidden`. Two things depend on it. The\n * shared stylesheet's exit transition (`opacity 150ms` on `[data-state=\"closed\"]`)\n * needs an element to still be there to fade, and `hideOthersFrom` marks the\n * *other* surfaces on the page — a select declared inside this dialog has to\n * already exist when the dialog opens, or it is never marked and reaches a\n * screen reader through a modal that is supposed to have hidden it.\n *\n * It also means a closed dialog's full-viewport positioner is laid out over the\n * page, which is why `setSurfaceInteractive` exists.\n */\n@Component({\n selector: \"uio-dialog\",\n standalone: true,\n exportAs: \"uioDialog\",\n imports: [UioIcon],\n providers: [UioDialogContext, HostPresence],\n template: `\n <!--\n The portal's view container is anchored *here*, inside the component's\n own template, and never on the host element.\n\n A view container anchored on the host is re-homed when the host is\n projected somewhere else — Angular's projection re-appends a projected\n node's container views along with it — and the surface of a popover\n declared inside a dialog was dragged back out of its own overlay pane and\n into the dialog's the moment the dialog attached. The two surfaces then\n shared a pane, so they shared a stacking level, and the popover-inside-a-\n dialog case this port exists to get right was silently broken. A\n container one level down is invisible to projection.\n -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"dialog__backdrop\"\n data-scope=\"dialog\"\n data-part=\"backdrop\"\n [id]=\"dialogContext.partId('backdrop')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n ></div>\n <!--\n The positioner centres the popup and, while the dialog is closed, has to\n stop taking clicks: it is a fixed, full-viewport layer and it is still\n there. Zag writes the same thing inline, for the same reason.\n -->\n <div\n class=\"dialog__positioner\"\n data-scope=\"dialog\"\n data-part=\"positioner\"\n [id]=\"dialogContext.partId('positioner')\"\n [style.pointer-events]=\"open() ? null : 'none'\"\n >\n <!--\n aria-modal is written as both words and never dropped: zag takes it\n straight from the prop, so a non-modal surface reports\n aria-modal=\"false\". Dropping it when non-modal is the tidier-looking of\n the two and is what this component did until the AlertDialog and Sheet\n work found it — nothing covered a non-modal dialog, so nothing said so.\n -->\n <div\n [class]=\"popupClass()\"\n data-scope=\"dialog\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [id]=\"dialogContext.partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.aria-modal]=\"modal() ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"dialogContext.labelledBy()\"\n [attr.aria-describedby]=\"dialogContext.describedBy()\"\n >\n @if (showClose()) {\n <button\n class=\"dialog__close\"\n data-scope=\"dialog\"\n data-part=\"close-trigger\"\n type=\"button\"\n aria-label=\"Close\"\n [id]=\"dialogContext.partId('close')\"\n (click)=\"hide()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"CLOSE_ICON_SIZE\"></span>\n </button>\n }\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioDialog implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly open = model(false);\n readonly size = input<DialogSize>(\"md\");\n readonly showClose = input(true, { transform: booleanAttribute });\n readonly modal = input(true, { transform: booleanAttribute });\n\n readonly dialogContext = inject(UioDialogContext);\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly popupClass = computed(() => dialogStyles({ size: this.size() }));\n protected readonly CLOSE_ICON_SIZE = 20;\n\n /**\n * `@ViewChild` rather than `viewChild()`: this package's own specs are\n * JIT-compiled, and JIT never registers initializer-based queries — the read\n * resolves to nothing and NG0951 is thrown on the first access. ng-packagr\n * compiles the shipped library ahead of time, where both work; the decorator\n * is the spelling that works in both.\n */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly overlay = inject(Overlay);\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly appRef = inject(ApplicationRef);\n\n private overlayRef?: OverlayRef;\n private surfaceView?: EmbeddedViewRef<unknown>;\n private scrollBlock?: BlockScrollStrategy;\n private trap?: FocusTrap;\n private restoreAria?: () => void;\n private opener: HTMLElement | null = null;\n /** What the DOM has actually been told, so the effect can see a transition. */\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n /**\n * Catches `[open]=\"editing()\"` — a caller driving the dialog declaratively,\n * where nothing called `show()`. The imperative path does not wait for this:\n * see {@link sync}.\n *\n * `untracked` because the work below reads signals that have no business\n * becoming dependencies of this effect, and because it runs `detectChanges()`\n * on another view.\n */\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, and the queries are static because of it.\n *\n * `ngAfterViewInit` runs bottom-up: a select declared inside a dialog attaches\n * its overlay *before* the dialog attaches its own, so the CDK's single\n * container ends up holding the inner surface first. The other three libraries\n * portal each surface straight into `document.body`, where a dialog's backdrop\n * and popup land before anything declared inside them — and anything reading\n * the document in order sees a different tree for the same page.\n *\n * It is also the right order on its own terms: an inner surface should not\n * exist before the surface that contains it, because `hideOthersFrom` and the\n * browser's top layer both work from what is already there.\n */\n ngOnInit(): void {\n this.overlayRef = createSurface(this.overlay, {\n // Not `scrollStrategies.block()`: a scroll strategy is enabled when the\n // overlay attaches, and this one attaches while closed — the page would be\n // unscrollable from the moment a dialog was declared. Blocking is done by\n // hand in `applyOpen` instead.\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.scrollBlock = this.overlay.scrollStrategies.block();\n this.surfaceView = this.overlayRef.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(this.overlayRef);\n setSurfaceInteractive(this.overlayRef, false);\n // After the portal, never before: the portal creates its view *next to* this\n // element before moving it into the pane, so removing the element first\n // leaves the view with nowhere to be born.\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.restoreAria?.();\n this.trap?.destroy();\n this.scrollBlock?.disable();\n this.overlayRef?.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /**\n * Two halves, on purpose, and the split is the whole timing story.\n *\n * **Dismissibility is registered now.** The effect below runs on the next\n * change-detection cycle, and the surface's own bindings run in that same\n * cycle — so between the click that opened the dialog and the effect there is\n * a window where the popup already reads `data-state=\"open\"` and nothing has\n * registered it as dismissible. An Escape in that window is silently lost.\n * The stack is not DOM, so registering it here costs nothing.\n *\n * **Everything that writes to the DOM waits for the flush.** Focus, the\n * aria-hidden marks and the scroll block land in the effect, which runs after\n * this component's *parent* view has been refreshed — that is, after the\n * trigger's own `aria-expanded` and `data-state` have been updated. Doing it\n * before would hide the page from assistive technology while the button that\n * opened it still claimed to be closed. `flushNow` makes that whole sequence\n * happen inside the call, the way React handles a discrete event.\n */\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n /** Remembered on open so focus can be given back to it on close. */\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n }\n\n private contentElement(): HTMLElement | null {\n return this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null;\n }\n private positionerElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"positioner\"]') ?? null\n );\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n // The browser's top layer stacks by show order, and this surface has been\n // showing since the page loaded. See `raiseSurface`.\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n\n const positioner = this.positionerElement();\n const content = this.contentElement();\n if (this.modal() && positioner) {\n this.restoreAria = hideOthersFrom(positioner);\n this.scrollBlock?.enable();\n }\n if (positioner) {\n // The trap goes on the positioner, not the popup: its two focus anchors\n // are inserted as *siblings* of whatever it guards, and siblings of the\n // popup would be inside the positioner — which is a compared region.\n this.trap = this.focusTraps.create(positioner);\n }\n if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.restoreAria?.();\n this.restoreAria = undefined;\n this.trap?.destroy();\n this.trap = undefined;\n this.scrollBlock?.disable();\n this.surfaceView?.detectChanges();\n if (this.overlayRef) setSurfaceInteractive(this.overlayRef, false);\n restoreFocus(this.opener);\n }\n}\n\n/**\n * Opens a dialog, and reports its state the way Ark's trigger does.\n *\n * `aria-controls` is dropped while the dialog is closed even though the content\n * is still in the document — Ark drops it because *its* content is unmounted,\n * and `popupControls` in `@ui-organized/core` explains why a dangling reference\n * is worse than no reference. Keeping the two libraries' triggers identical\n * matters more than the fact that this one could get away with it.\n */\n@Directive({\n selector: \"button[uioDialogTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"[id]\": \"dialog ? dialog.dialogContext.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"dialog ? dialog.dialogContext.machineId : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? dialog!.dialogContext.partId('content') : null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioDialogTrigger extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"trigger\";\n\n /**\n * A decorator input, deliberately, where the rest of this library writes\n * `input()`.\n *\n * JIT never registers an initializer-based input, and this package's own specs\n * are JIT-compiled — so with `input()` no spec could ever wire a trigger to a\n * dialog, and the two behaviours worth testing here (focus returning to the\n * opener, and the trigger reporting the dialog's state) would have no way to be\n * exercised. Decorator inputs are registered by both compilers. Every other\n * input in this file stays on `input()`, because none of them has to be bound\n * for a spec to be meaningful.\n */\n @Input(\"dialog\") dialog?: UioDialog;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.dialog?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n protected activate(): void {\n const dialog = this.dialog;\n if (!dialog) return;\n // Remembered *before* the state flips, so the element focus returns to is\n // the one the user actually pressed rather than whatever has it by then.\n dialog.rememberOpener(this.host.nativeElement);\n dialog.toggle();\n }\n}\n\n/** Names the dialog. Ark's Title is an `h2`; the caller writes their own. */\n@Directive({\n selector: \"[uioDialogTitle]\",\n standalone: true,\n host: {\n class: \"dialog__title text-strong-heading-small\",\n \"[id]\": \"dialogContext.partId('title')\",\n },\n})\nexport class UioDialogTitle extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"title\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerTitle();\n }\n}\n\n/** Describes the dialog. Absent, and the popup carries no `aria-describedby`. */\n@Directive({\n selector: \"[uioDialogDescription]\",\n standalone: true,\n host: {\n class: \"dialog__description text-default-body-medium\",\n \"[id]\": \"dialogContext.partId('description')\",\n },\n})\nexport class UioDialogDescription extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"description\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerDescription();\n }\n}\n\n/**\n * The right-aligned action row. Not an Ark part — the facade adds it, so it\n * carries a class and nothing else, in all four libraries.\n */\n@Directive({\n selector: \"[uioDialogFooter]\",\n standalone: true,\n host: { class: \"dialog__footer\" },\n})\nexport class UioDialogFooter {}\n\n/**\n * Closes the dialog from inside it.\n *\n * No `id`, unlike the close button the dialog renders for itself: two elements\n * claiming `dialog:<machine>:close` would be a duplicate id on the page, and\n * this one is reached by content rather than by reference.\n */\n@Directive({\n selector: \"[uioDialogClose]\",\n standalone: true,\n host: { \"(click)\": \"dialog.hide()\" },\n})\nexport class UioDialogClose extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"close-trigger\";\n protected readonly dialog = inject(UioDialog);\n}\n","import type { FlexibleConnectedPositionStrategy, Overlay, OverlayRef } from \"@angular/cdk/overlay\";\nimport { signal, type WritableSignal } from \"@angular/core\";\nimport type { Subscription } from \"rxjs\";\nimport type { AnchoredPosition, OverlayPlacement } from \"./anchor.js\";\nimport { sideOf } from \"./anchor.js\";\nimport { createSurface } from \"./surface.js\";\n\n/**\n * A surface pinned to a trigger, and the one thing the CDK will not tell you:\n * *which* placement it settled on.\n *\n * Ark reflects the resolved placement onto both the trigger and the content\n * (`data-placement`, `data-side`), and the parity gate compares them — they are\n * how a flip is observable at all. The CDK reports the `ConnectedPosition` object\n * it chose, by identity, and has no name for it. So the candidate list is built\n * with its names attached (see `anchor.ts`) and the name is recovered by finding\n * the object. Nothing is derived from geometry, which is what keeps this honest\n * when the surface flips for lack of room.\n *\n * Both attributes are **sticky**: once a surface has been positioned they stay\n * on the trigger and the content after it closes, exactly as Ark leaves them.\n * That is why `placement` starts as `null` rather than as the requested side —\n * a popover that has never been opened carries neither attribute in any library.\n */\nexport class AnchoredSurface {\n /** `null` until the surface has actually been placed. */\n readonly placement: WritableSignal<OverlayPlacement | null> = signal(null);\n\n private ref?: OverlayRef;\n private strategy?: FlexibleConnectedPositionStrategy;\n private candidates: AnchoredPosition[] = [];\n private changes?: Subscription;\n /**\n * The placement the CDK has chosen, held back until the surface is first\n * opened.\n *\n * The overlay is attached while closed, so the CDK positions it immediately\n * and would report a placement for a surface that has never been shown. Ark\n * reports none — `data-placement` appears on a trigger the first time its\n * popup opens and is sticky from then on — and a trigger claiming a side\n * before anything has been placed is a difference a user could see, because\n * the stylesheet can select on it.\n */\n private latest: OverlayPlacement | null = null;\n private positioned = false;\n\n constructor(private readonly overlay: Overlay) {}\n\n get overlayRef(): OverlayRef | undefined {\n return this.ref;\n }\n\n /** The side half of the resolved placement, which Ark emits separately. */\n side(): string | null {\n const placement = this.placement();\n return placement ? sideOf(placement) : null;\n }\n\n create(anchor: HTMLElement, candidates: AnchoredPosition[]): OverlayRef {\n this.candidates = candidates;\n this.strategy = this.overlay\n .position()\n .flexibleConnectedTo(anchor)\n .withPositions(candidates.map((candidate) => candidate.position))\n /**\n * Push, but do not shrink. `withPush` nudges a surface back inside the\n * viewport, which is floating-ui's `shift()` and what Ark does.\n * `withFlexibleDimensions` instead makes the surface *narrower* to fit,\n * which no other library in this system does and which would silently\n * reflow a menu's items.\n */\n .withFlexibleDimensions(false)\n .withPush(true)\n .withGrowAfterOpen(true);\n\n this.changes = this.strategy.positionChanges.subscribe((change) => {\n const match = this.candidates.find(\n (candidate) => candidate.position === change.connectionPair,\n );\n if (!match) return;\n this.latest = match.placement;\n if (this.positioned) this.placement.set(this.latest);\n });\n\n this.ref = createSurface(this.overlay, {\n positionStrategy: this.strategy,\n // Reposition rather than block: an anchored surface follows its trigger,\n // and the trigger is part of the page the user is still scrolling.\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n return this.ref;\n }\n\n /**\n * Re-point the surface at a different element.\n *\n * The overlay is created when the component initialises, which is before a\n * trigger declared *after* it in the template has had a chance to introduce\n * itself. Creating against a placeholder and re-anchoring costs one call and\n * removes an ordering rule nobody would remember.\n */\n setAnchor(anchor: HTMLElement): void {\n this.strategy?.setOrigin(anchor);\n if (this.ref?.hasAttached()) this.ref.updatePosition();\n }\n\n /** Called when `side`, `align` or either offset changes. */\n setCandidates(candidates: AnchoredPosition[]): void {\n this.candidates = candidates;\n if (!this.strategy) return;\n this.strategy.withPositions(candidates.map((candidate) => candidate.position));\n if (this.ref?.hasAttached()) this.ref.updatePosition();\n }\n\n /**\n * Re-measure, which an always-attached surface needs on every open.\n *\n * The CDK positions on attach, and this attaches while closed — at which\n * point the popup is `hidden`, has no size, and lands wherever a zero-height\n * box would go.\n */\n reposition(): void {\n this.positioned = true;\n this.ref?.updatePosition();\n // Published even when `updatePosition` had nothing to say: the CDK only\n // emits when the chosen position *changes*, and the very first open usually\n // keeps the one picked at attach time.\n this.placement.set(this.latest);\n }\n\n dispose(): void {\n this.changes?.unsubscribe();\n this.ref?.dispose();\n }\n}\n","import { Injectable, computed, signal } from \"@angular/core\";\nimport { nextMachineId } from \"../part-ids.js\";\n\n/**\n * A popover's identity, and the two references its content earns by existing.\n *\n * Ark gives the popup `role=\"dialog\"`, which needs an accessible name, and\n * points `aria-labelledby` at the Title part when one is rendered. Without a\n * title *and* without an `aria-label`, a popover reaches a screen reader as an\n * unnamed dialog — so the reference is dropped rather than left dangling, for\n * the reason `OMIT_ARIA` in `@ui-organized/core` sets out: a dangling IDREF\n * outranks any `aria-label` beside it.\n *\n * Ark spells the description part's id `desc`, not `description`. The literal is\n * not the contract — every library generates its own — but keeping the shape\n * costs nothing and makes two DOM trees readable side by side.\n */\n@Injectable()\nexport class UioPopoverContext {\n private readonly machine = nextMachineId();\n\n private readonly titled = signal(false);\n private readonly described = signal(false);\n\n get machineId(): string {\n return this.machine;\n }\n\n partId(part: string): string {\n return `popover:${this.machine}:${part}`;\n }\n\n registerTitle(): void {\n this.titled.set(true);\n }\n registerDescription(): void {\n this.described.set(true);\n }\n\n readonly labelledBy = computed(() => (this.titled() ? this.partId(\"title\") : null));\n readonly describedBy = computed(() => (this.described() ? this.partId(\"desc\") : null));\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { FocusTrapFactory, type FocusTrap } from \"@angular/cdk/a11y\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions, type OverlayAlign, type OverlaySide } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { UioPopoverContext } from \"./popover-context.js\";\n\n/**\n * A small anchored surface with its own heading, body and dismiss.\n *\n * ```html\n * <button uioButton uioPopoverTrigger [popover]=\"details\">Details</button>\n * <uio-popover #details=\"uioPopover\" side=\"right\" align=\"start\">\n * <div uioPopoverTitle>Shipping</div>\n * <div uioPopoverDescription>Arrives in 2 days.</div>\n * <button uioButton uioPopoverClose>Got it</button>\n * </uio-popover>\n * ```\n *\n * Everything structural is the Dialog's story told again — the host element is\n * removed because Ark's root renders nothing, the surface is attached on init\n * because Ark keeps its portal rendered, and a user interaction flushes change\n * detection so the trigger and the popup never disagree. What is new here is\n * *placement*: `side`/`align` are the facade's vocabulary, the CDK's is four\n * corner keywords, and Ark reports the resolved answer as `data-placement`. See\n * `overlay/anchored.ts` for how the three are reconciled.\n *\n * ── One difference from the Dialog, and it is not cosmetic ──────────────────\n *\n * A closed popover really is hidden. `.popover__popup` declares no `display`, so\n * the `hidden` attribute does what it says — where `.dialog__popup` sets\n * `display: flex` and stays in the accessibility tree even when closed. That is\n * the shared stylesheet's behaviour rather than this port's, and it is why the\n * parity gate can assert this one is invisible and can only compare the other.\n */\n@Component({\n selector: \"uio-popover\",\n standalone: true,\n exportAs: \"uioPopover\",\n providers: [UioPopoverContext, HostPresence],\n template: `\n <!--\n The portal's view container is anchored *here*, inside the component's\n own template, and never on the host element.\n\n A view container anchored on the host is re-homed when the host is\n projected somewhere else — Angular's projection re-appends a projected\n node's container views along with it — and the surface of a popover\n declared inside a dialog was dragged back out of its own overlay pane and\n into the dialog's the moment the dialog attached. The two surfaces then\n shared a pane, so they shared a stacking level, and the popover-inside-a-\n dialog case this port exists to get right was silently broken. A\n container one level down is invisible to projection.\n -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"popover__positioner\"\n data-scope=\"popover\"\n data-part=\"positioner\"\n [id]=\"popoverContext.partId('popper')\"\n >\n <div\n class=\"popover__popup text-default-body-medium\"\n data-scope=\"popover\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [id]=\"popoverContext.partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.data-expanded]=\"flag(open())\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.aria-labelledby]=\"popoverContext.labelledBy()\"\n [attr.aria-describedby]=\"popoverContext.describedBy()\"\n >\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioPopover implements OnInit, OnDestroy {\n readonly open = model(false);\n readonly side = input<OverlaySide>(\"bottom\");\n readonly align = input<OverlayAlign>(\"center\");\n readonly sideOffset = input(8);\n readonly alignOffset = input(0);\n /** Traps Tab inside the popover and blocks the page behind it. */\n readonly modal = input(false, { transform: booleanAttribute });\n\n readonly popoverContext = inject(UioPopoverContext);\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly flag = stateFlag;\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private trap?: FocusTrap;\n private opener: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n // Placement is configuration rather than state: recomputing the candidate\n // list is all that is needed, and the CDK re-measures on the next open.\n effect(() => {\n const candidates = anchoredPositions(\n this.side(),\n this.align(),\n this.sideOffset(),\n this.alignOffset(),\n );\n untracked(() => this.anchored.setCandidates(candidates));\n });\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, and the queries are static because of it.\n *\n * `ngAfterViewInit` runs bottom-up: a select declared inside a dialog attaches\n * its overlay *before* the dialog attaches its own, so the CDK's single\n * container ends up holding the inner surface first. The other three libraries\n * portal each surface straight into `document.body`, where a dialog's backdrop\n * and popup land before anything declared inside them — and anything reading\n * the document in order sees a different tree for the same page.\n *\n * It is also the right order on its own terms: an inner surface should not\n * exist before the surface that contains it, because `hideOthersFrom` and the\n * browser's top layer both work from what is already there.\n */\n ngOnInit(): void {\n const anchor = this.opener ?? this.document.body;\n const ref = this.anchored.create(\n anchor,\n anchoredPositions(this.side(), this.align(), this.sideOffset(), this.alignOffset()),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.trap?.destroy();\n this.anchored.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /**\n * Told by the trigger, before the state flips.\n *\n * It is both the element focus returns to and the element the surface is\n * anchored against, so a popover whose trigger registers after this component\n * initialises re-anchors rather than staying pinned to `document.body`.\n */\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n if (element) this.anchored.setAnchor(element);\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n // Measured only now: while it was closed the popup was `hidden`, had no\n // size, and the CDK placed a zero-height box.\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n\n const content = this.contentElement();\n if (this.modal() && content?.parentElement) {\n // On the positioner, so the trap's two focus anchors land outside the\n // popup rather than inside the subtree the parity gate compares.\n this.trap = this.focusTraps.create(content.parentElement);\n }\n if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.trap?.destroy();\n this.trap = undefined;\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n restoreFocus(this.opener);\n }\n}\n\n/** Opens and closes a popover, and reports its state the way Ark's trigger does. */\n@Directive({\n selector: \"button[uioPopoverTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"[id]\": \"popover ? popover.popoverContext.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"popover ? popover.popoverContext.machineId : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? popover!.popoverContext.partId('content') : null\",\n // Sticky, exactly as Ark leaves them: a trigger that has opened once keeps\n // reporting where its surface went.\n \"[attr.data-placement]\": \"popover?.anchored?.placement() ?? null\",\n \"[attr.data-side]\": \"popover?.anchored?.side() ?? null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioPopoverTrigger extends UioPart {\n readonly scope = \"popover\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"popover\") popover?: UioPopover;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.popover?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n // Before the surface's own `ngAfterViewInit`, which is where the overlay is\n // anchored — so the popover is pinned to this element rather than to the\n // document body.\n this.popover?.rememberOpener(this.host.nativeElement);\n }\n\n protected activate(): void {\n const popover = this.popover;\n if (!popover) return;\n popover.rememberOpener(this.host.nativeElement);\n popover.toggle();\n }\n}\n\n/** Names the popover. Without one its `role=\"dialog\"` has no accessible name. */\n@Directive({\n selector: \"[uioPopoverTitle]\",\n standalone: true,\n host: {\n class: \"popover__title text-strong-body-large\",\n \"[id]\": \"popoverContext.partId('title')\",\n },\n})\nexport class UioPopoverTitle extends UioPart {\n readonly scope = \"popover\";\n readonly part = \"title\";\n protected readonly popoverContext = inject(UioPopoverContext);\n constructor() {\n super();\n this.popoverContext.registerTitle();\n }\n}\n\n/** Supporting copy under the title; becomes the popover's description. */\n@Directive({\n selector: \"[uioPopoverDescription]\",\n standalone: true,\n host: {\n class: \"popover__description text-default-body-medium\",\n \"[id]\": \"popoverContext.partId('desc')\",\n },\n})\nexport class UioPopoverDescription extends UioPart {\n readonly scope = \"popover\";\n readonly part = \"description\";\n protected readonly popoverContext = inject(UioPopoverContext);\n constructor() {\n super();\n this.popoverContext.registerDescription();\n }\n}\n\n/**\n * Closes the popover from inside it.\n *\n * `aria-label=\"close\"` in Ark's own lower-case spelling, because Ark's\n * CloseTrigger supplies it and the popover facade does not override it — unlike\n * the Dialog's, which does and is therefore capitalised. Reproduced rather than\n * tidied: the two libraries render the same element.\n */\n@Directive({\n selector: \"button[uioPopoverClose]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-label\": \"close\",\n \"[id]\": \"popover.popoverContext.partId('close')\",\n \"(click)\": \"popover.hide()\",\n },\n})\nexport class UioPopoverClose extends UioPart {\n readonly scope = \"popover\";\n readonly part = \"close-trigger\";\n protected readonly popover = inject(UioPopover);\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n ComponentRef,\n DOCUMENT,\n Directive,\n ElementRef,\n Injectable,\n Injector,\n OnDestroy,\n OnInit,\n type Provider,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n} from \"@angular/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions, type OverlayAlign, type OverlaySide } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\n\n/**\n * Shared open/close delays for every tooltip below a provider.\n *\n * Ark has no app-level delay provider — its delays are per-Root props — and the\n * React facade preserves the older API with a React context. This is that\n * context in Angular's spelling; {@link provideTooltipDelays} is how an app\n * sets it, and a `delay` on an individual tooltip still wins.\n */\n@Injectable()\nexport class UioTooltipDelays {\n delay?: number;\n closeDelay?: number;\n}\n\n/**\n * ```ts\n * bootstrapApplication(App, { providers: [provideTooltipDelays({ delay: 400 })] });\n * ```\n */\nexport function provideTooltipDelays(delays: {\n delay?: number;\n closeDelay?: number;\n}): Provider {\n return { provide: UioTooltipDelays, useValue: Object.assign(new UioTooltipDelays(), delays) };\n}\n\n/**\n * The state the portalled surface reads.\n *\n * The tooltip is a **directive**, because its host is whatever element the\n * caller decorated — very often a `button[uioButton]`, and two components\n * cannot share one element. A directive has no template, so the surface is a\n * component of its own, attached as a component portal and handed this state\n * through an injector rather than through inputs: `ComponentRef.setInput` on an\n * initializer-based input does nothing under the JIT compiler, and this\n * package's specs are JIT-compiled.\n */\nexport interface TooltipSurfaceState {\n partId(part: string): string;\n open(): boolean;\n content(): string | undefined;\n /** The placement the surface *ended up* at, which is what Ark reflects. */\n placement(): string | null;\n resolvedSide(): string | null;\n}\n\n@Component({\n selector: \"uio-tooltip-surface\",\n standalone: true,\n // Transparent to layout: the CDK pane is a flex container, and this host is\n // scaffolding that the other three libraries do not render at all.\n host: { style: \"display: contents\" },\n template: `\n <div\n class=\"tooltip__positioner\"\n data-scope=\"tooltip\"\n data-part=\"positioner\"\n [id]=\"tooltip.partId('popper')\"\n >\n <div\n class=\"tooltip__popup text-default-body-small\"\n data-scope=\"tooltip\"\n data-part=\"content\"\n role=\"tooltip\"\n [id]=\"tooltip.partId('content')\"\n [attr.data-state]=\"tooltip.open() ? 'open' : 'closed'\"\n [attr.hidden]=\"tooltip.open() ? null : ''\"\n [attr.data-placement]=\"tooltip.placement()\"\n [attr.data-side]=\"tooltip.resolvedSide()\"\n >{{ tooltip.content() }}</div>\n </div>\n `,\n})\nexport class UioTooltipSurface {\n protected readonly tooltip: TooltipSurfaceState = inject(UioTooltip);\n}\n\n/**\n * A small label that appears beside a control on hover or focus.\n *\n * ```html\n * <button uioButton uioTooltip=\"Copy\" icon=\"copy\"></button>\n * ```\n *\n * ── Why the content is a string ─────────────────────────────────────────────\n *\n * Every library in this system takes it as one. A tooltip's whole contract is\n * that it is a short label — `role=\"tooltip\"` names a control, it does not hold\n * interactive content — and taking projected content would invite a popover to\n * be built out of it, which has different focus and dismissal rules.\n *\n * ── The trigger class ───────────────────────────────────────────────────────\n *\n * `tooltip__trigger` is on the host unconditionally. React renders its own\n * button when the child is not an element and adds the class there; here the\n * caller's element always *is* the trigger, so the class always applies. It is\n * `display: inline-flex` and nothing else.\n */\n@Directive({\n selector: \"[uioTooltip]\",\n standalone: true,\n exportAs: \"uioTooltip\",\n host: {\n class: \"tooltip__trigger\",\n \"[id]\": \"partId('trigger')\",\n \"[attr.data-ownedby]\": \"machine\",\n \"[attr.data-expanded]\": \"flag(open())\",\n \"[attr.aria-describedby]\": \"open() ? partId('content') : null\",\n \"(pointerenter)\": \"openSoon()\",\n \"(pointerleave)\": \"closeSoon()\",\n \"(focus)\": \"openNow()\",\n \"(blur)\": \"closeNow()\",\n // Ark closes on press: a tooltip hanging over the thing the user just\n // clicked is in the way of the result.\n \"(pointerdown)\": \"closeNow()\",\n },\n})\nexport class UioTooltip extends UioPart implements OnInit, OnDestroy, TooltipSurfaceState {\n readonly scope = \"tooltip\";\n readonly part = \"trigger\";\n\n readonly content = input<string | undefined>(undefined, { alias: \"uioTooltip\" });\n readonly open = model(false);\n readonly side = input<OverlaySide>(\"top\");\n readonly align = input<OverlayAlign>(\"center\");\n readonly sideOffset = input(6);\n /**\n * No tooltip is attached and nothing opens.\n *\n * The trigger keeps its part identity, where React's `disabled` returns the\n * child untouched and renders no trigger at all. Angular cannot un-declare the\n * element the caller decorated, and a `data-scope` on a control that shows\n * nothing is inert — where dropping the attributes would mean a control whose\n * identity appeared and disappeared with a boolean.\n */\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Zag's own defaults, so a tooltip feels the same in all four libraries. */\n readonly delay = input<number | undefined>(undefined);\n readonly closeDelay = input<number | undefined>(undefined);\n\n private readonly shared = inject(UioTooltipDelays, { optional: true });\n private readonly openDelay = computed(() => this.delay() ?? this.shared?.delay ?? 1000);\n private readonly hideDelay = computed(() => this.closeDelay() ?? this.shared?.closeDelay ?? 500);\n\n override readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly flag = stateFlag;\n protected readonly machine = nextMachineId();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(Injector);\n private readonly anchored = new AnchoredSurface(inject(Overlay));\n\n private timer?: ReturnType<typeof setTimeout>;\n private surfaceRef?: ComponentRef<UioTooltipSurface>;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n // A tooltip is never pointed at, so nothing is \"inside\" it for dismissal\n // purposes — an outside click closes it, and so does Escape.\n surface: () => null,\n trigger: () => this.host.nativeElement,\n dismiss: () => this.closeNow(),\n };\n\n constructor() {\n super();\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n effect(() => {\n const candidates = anchoredPositions(this.side(), this.align(), this.sideOffset());\n untracked(() => this.anchored.setCandidates(candidates));\n });\n }\n\n partId(part: string): string {\n return `tooltip:${this.machine}:${part}`;\n }\n placement(): string | null {\n return this.anchored.placement();\n }\n /**\n * The side the surface ended up on, which is not the `side` input: that is the\n * request, and a tooltip asked for `top` at the top of the viewport comes out\n * `bottom` in every library.\n */\n resolvedSide(): string | null {\n return this.anchored.side();\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, for the reason the other four surfaces\n * give: `ngAfterViewInit` runs bottom-up, so a tooltip inside a dialog would\n * put its surface into the shared overlay container before the dialog's, and\n * the container would not read in the order the other three libraries' body\n * children do.\n */\n ngOnInit(): void {\n if (this.disabled()) return;\n const ref = this.anchored.create(\n this.host.nativeElement,\n anchoredPositions(this.side(), this.align(), this.sideOffset()),\n );\n this.surfaceRef = ref.attach(\n new ComponentPortal(\n UioTooltipSurface,\n // No view container, deliberately: the CDK then creates the component\n // against the ApplicationRef, and the surface belongs to no container in\n // the caller's tree that a projection could re-home. See `UioPopover`.\n null,\n Injector.create({ providers: [{ provide: UioTooltip, useValue: this }], parent: this.injector }),\n ),\n );\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.timer);\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n protected openSoon(): void {\n this.after(this.openDelay(), true);\n }\n protected closeSoon(): void {\n this.after(this.hideDelay(), false);\n }\n protected openNow(): void {\n this.after(0, true);\n }\n protected closeNow(): void {\n this.after(0, false);\n }\n\n private after(delay: number, next: boolean): void {\n if (this.disabled()) return;\n clearTimeout(this.timer);\n if (delay === 0) {\n this.setOpen(next);\n return;\n }\n this.timer = setTimeout(() => this.setOpen(next), delay);\n }\n\n private setOpen(next: boolean): void {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n this.applied = open;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n if (open) {\n /**\n * Refresh the surface before measuring it.\n *\n * The popup is `hidden` while closed, so it has no height — and the CDK\n * chooses a placement by asking which candidate fits. A zero-height popup\n * fits *above* a trigger sitting at the top of the viewport, so the\n * tooltip would report `data-placement=\"top\"` where every other library\n * flips it to `bottom`. Its view belongs to the ApplicationRef and is\n * refreshed after this effect, so it is refreshed by hand here.\n */\n this.surfaceRef?.changeDetectorRef.detectChanges();\n this.anchored.reposition();\n raiseSurface(ref);\n }\n // The popup never takes pointer events even when open — the shared\n // stylesheet's `.tooltip__popup` is decoration, and zag writes\n // `pointer-events: none` on it for the same reason: a tooltip that swallowed\n // the pointer would close itself the moment it appeared.\n setSurfaceInteractive(ref, false);\n }\n}\n","/**\n * Moving a highlight over a list of options with the keyboard.\n *\n * ── Why this is not `ActiveDescendantKeyManager` ────────────────────────────\n *\n * The CDK ships exactly the right manager for this pattern, and it does not fit\n * either of the two lists in this library.\n *\n * `ListKeyManager` and its subclasses take a `QueryList`, an array, or a signal\n * of **objects implementing `Highlightable`** — `setActiveStyles()` and\n * `setInactiveStyles()`, imperative methods each item uses to style itself.\n * Select's options are not objects at all: they are the `options` input, plain\n * data rendered by a `@for`, and there is nothing to call a method on. Menu's\n * items *are* directives, but they report their highlight through a\n * `data-highlighted` binding read off the parent's state — which is how Ark does\n * it, and which the shared stylesheet requires — so `setActiveStyles` would have\n * to write the attribute a binding already owns, and the two would fight on\n * every change-detection pass.\n *\n * What is left of the manager once those are removed is the index arithmetic,\n * which is this file. It is small, it is the same in both components, and it\n * skips disabled options — the one piece of that arithmetic that is easy to get\n * wrong and invisible when it is: a menu that highlights a disabled item looks\n * fine and does nothing when Enter is pressed.\n */\n\nexport interface Navigable {\n disabled: boolean;\n}\n\n/**\n * The first selectable index at or after `from`, walking in `step`'s direction.\n *\n * Returns -1 when every option is disabled, which is a real state — a menu whose\n * actions are all unavailable — and has to leave the highlight where it was\n * rather than land on something that cannot be chosen.\n */\nexport function firstEnabled(items: readonly Navigable[], from: number, step: number): number {\n for (let index = from; index >= 0 && index < items.length; index += step) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n}\n\n/**\n * The next selectable index from `current`, wrapping at the ends.\n *\n * `current` of -1 means nothing is highlighted yet, which is the state a menu\n * opens in: the first ArrowDown lands on the first option and the first ArrowUp\n * on the last, in every library here.\n */\nexport function moveHighlight(\n items: readonly Navigable[],\n current: number,\n step: number,\n): number {\n if (!items.length) return -1;\n if (current === -1) {\n return step > 0 ? firstEnabled(items, 0, 1) : firstEnabled(items, items.length - 1, -1);\n }\n const forward = firstEnabled(items, current + step, step);\n if (forward !== -1) return forward;\n // Wrapped: start again from the far end. A list with one enabled option\n // therefore stays on it rather than losing the highlight.\n return step > 0 ? firstEnabled(items, 0, 1) : firstEnabled(items, items.length - 1, -1);\n}\n\n/**\n * Sort by where the elements actually are.\n *\n * Items register themselves as they are constructed, and construction order is\n * template order only until something conditional appears above them. Arrow keys\n * that move in registration order rather than reading order are the kind of bug\n * that survives every test written against a static list.\n */\nexport function inDomOrder<T extends { element: HTMLElement }>(items: readonly T[]): T[] {\n return [...items].sort((a, b) =>\n a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n}\n","import { Injectable } from \"@angular/core\";\n\n/**\n * Announces that everything below it is inside a `<div uioMenubar>`.\n *\n * A `role=\"menubar\"` may only contain menuitems, so the menu triggers placed in\n * one have to say they are menuitems rather than buttons. A trigger cannot tell\n * where it sits on its own — `UioMenu` is an independent overlay that knows\n * nothing about the bar around it — so the bar provides this and the trigger\n * injects it optionally.\n *\n * Empty on purpose: the *presence* of the provider is the whole signal, and\n * there is no state to keep current. A bar does not appear or disappear around a\n * trigger that is already mounted.\n *\n * Its own module so that `menu.ts` and `menubar.ts` do not import each other —\n * the same split React makes with `MenubarContext.ts`, for the same reason.\n */\n@Injectable()\nexport class UioMenubarContext {}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Injectable,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport { dividerStyles } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioMenubarContext } from \"../menubar/menubar-context.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions, type OverlayAlign, type OverlaySide } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { restoreFocus } from \"../overlay/focus.js\";\nimport { inDomOrder, moveHighlight } from \"../overlay/roving.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\n/**\n * What the menu needs to know about one of its items.\n *\n * Functions rather than values, so the menu always reads the item's *current*\n * state: an item registers once, and its `value` and `disabled` are signals that\n * can change under it afterwards.\n */\n/** The check glyph matches the standalone Checkbox. */\nconst CHECK_ICON_SIZE = 16;\n\ninterface MenuItemHandle {\n readonly element: HTMLElement;\n value(): string;\n disabled(): boolean;\n choose(): void;\n}\n\n/**\n * A list of actions, anchored to the control that opened it.\n *\n * ```html\n * <button uioButton uioMenuTrigger [menu]=\"actions\">Actions</button>\n * <uio-menu #actions=\"uioMenu\">\n * <div uioMenuItem value=\"rename\" icon=\"pencil\">Rename</div>\n * <div uioMenuSeparator></div>\n * <div uioMenuItem value=\"delete\" destructive>Delete</div>\n * </uio-menu>\n * ```\n *\n * ── Focus goes to the menu, not to the item ─────────────────────────────────\n *\n * Ark drives a menu with `aria-activedescendant`: DOM focus stays on the\n * `role=\"menu\"` element — which is why it carries `tabindex=\"0\"` — and the\n * highlighted item is *named* rather than focused. That is what the shared\n * stylesheet reads (`.menu__item[data-highlighted]` is the hover treatment), and\n * it is why `@angular/cdk/menu`, which implements the APG pattern by moving real\n * focus between items, could not be used underneath this: the two disagree about\n * which element is focused, so every `:focus-visible` rule and every\n * `[data-highlighted]` rule in the stylesheet would apply to the wrong element.\n *\n * The pointer highlights too, for the same reason: `[data-highlighted]` *is* the\n * hover state in this system, so a mouse and a keyboard have to write the same\n * attribute or a menu looks dead under the pointer.\n */\n@Component({\n selector: \"uio-menu\",\n standalone: true,\n exportAs: \"uioMenu\",\n providers: [HostPresence],\n template: `\n <!-- See UioPopover: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"menu__positioner\"\n data-scope=\"menu\"\n data-part=\"positioner\"\n [id]=\"partId('popper')\"\n >\n <div\n [class]=\"popupClass()\"\n data-scope=\"menu\"\n data-part=\"content\"\n role=\"menu\"\n tabindex=\"0\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.aria-labelledby]=\"triggerId()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioMenu implements OnInit, OnDestroy {\n readonly open = model(false);\n readonly side = input<OverlaySide>(\"bottom\");\n readonly align = input<OverlayAlign>(\"start\");\n readonly sideOffset = input(4);\n readonly alignOffset = input(0);\n /**\n * Extra classes for the popup surface.\n *\n * The surface is portalled, so a `class` written on `<uio-menu>` would land on\n * a host element that is removed from the DOM before anything is painted (see\n * `HostPresence` below) — it cannot reach the popup the way React's\n * `<MenuContent className>` does. This is the input that can. `UioPagination`\n * is the caller that needs it: its jump menus carry\n * `pagination__ellipsis-menu`, which is what caps a long hidden range to a\n * scrollable height.\n */\n readonly contentClass = input<string | undefined>(undefined);\n /** The value of the item that was chosen. */\n readonly select = output<string>();\n\n readonly machine = nextMachineId();\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n /** `null` until something is highlighted, which is how a menu opens. */\n readonly highlighted = signal<string | null>(null);\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly popupClass = computed(() => clsx(\"menu__popup\", this.contentClass()));\n protected readonly activeDescendant = computed(() => {\n const value = this.highlighted();\n return value === null ? null : this.itemId(value);\n });\n\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private items: MenuItemHandle[] = [];\n private opener: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n effect(() => {\n const candidates = anchoredPositions(\n this.side(),\n this.align(),\n this.sideOffset(),\n this.alignOffset(),\n );\n untracked(() => this.anchored.setCandidates(candidates));\n });\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, and the queries are static because of it.\n *\n * `ngAfterViewInit` runs bottom-up: a select declared inside a dialog attaches\n * its overlay *before* the dialog attaches its own, so the CDK's single\n * container ends up holding the inner surface first. The other three libraries\n * portal each surface straight into `document.body`, where a dialog's backdrop\n * and popup land before anything declared inside them — and anything reading\n * the document in order sees a different tree for the same page.\n *\n * It is also the right order on its own terms: an inner surface should not\n * exist before the surface that contains it, because `hideOthersFrom` and the\n * browser's top layer both work from what is already there.\n */\n ngOnInit(): void {\n const ref = this.anchored.create(\n this.opener ?? this.document.body,\n anchoredPositions(this.side(), this.align(), this.sideOffset(), this.alignOffset()),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n partId(part: string): string {\n return `menu:${this.machine}:${part}`;\n }\n /**\n * Ark's item ids are `<machine>/<value>` rather than `<scope>:<machine>:<part>`\n * — the collection's own key, not a part name. Reproduced, so two menus on a\n * page cannot collide and a reference reads the same way it does in React.\n */\n itemId(value: string): string {\n return `${this.machine}/${value}`;\n }\n triggerId(): string | null {\n return this.opener ? this.partId(\"trigger\") : null;\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n if (element) this.anchored.setAnchor(element);\n }\n\n register(item: MenuItemHandle): void {\n this.items.push(item);\n }\n unregister(item: MenuItemHandle): void {\n this.items = this.items.filter((candidate) => candidate !== item);\n }\n\n /** The pointer highlights exactly as the keyboard does — see the class note. */\n highlight(value: string | null): void {\n this.highlighted.set(value);\n }\n\n choose(value: string): void {\n this.select.emit(value);\n this.hide();\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"content\"]',\n ) ?? null\n );\n }\n\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n // Ark opens a menu with nothing highlighted; the first arrow key chooses.\n this.highlighted.set(null);\n this.contentElement()?.focus({ preventScroll: true });\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.highlighted.set(null);\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n restoreFocus(this.opener);\n }\n\n private ordered(): MenuItemHandle[] {\n return inDomOrder(this.items);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const items = this.ordered();\n const navigable = items.map((item) => ({ disabled: item.disabled() }));\n const current = items.findIndex((item) => item.value() === this.highlighted());\n\n const move = (step: number) => {\n const next = items[moveHighlight(navigable, current, step)];\n if (next) this.highlighted.set(next.value());\n event.preventDefault();\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return move(1);\n case \"ArrowUp\":\n return move(-1);\n case \"Home\":\n this.highlighted.set(null);\n return move(1);\n case \"End\":\n this.highlighted.set(null);\n return move(-1);\n case \"Enter\":\n case \" \": {\n const item = items[current];\n if (!item) return;\n event.preventDefault();\n item.choose();\n return;\n }\n case \"Tab\":\n // A menu is a modal-ish surface: Tab closes it rather than walking into\n // the page behind. Not prevented, so focus still moves on from the\n // trigger the way a user expects.\n this.hide();\n return;\n default:\n return;\n }\n }\n}\n\n/**\n * Opens a menu.\n *\n * `data-controls` is on the trigger whether the menu is open or not, and\n * `aria-controls` only while it is. That asymmetry is Ark's: the data attribute\n * is how a menubar finds the content belonging to each of its triggers, and the\n * ARIA one is a reference that must not dangle. Both are reproduced.\n */\n@Directive({\n selector: \"button[uioMenuTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"menu\",\n \"[id]\": \"menu ? menu.partId('trigger') : null\",\n \"[attr.data-uid]\": \"menu ? menu.machine : null\",\n \"[attr.data-controls]\": \"menu ? menu.partId('content') : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? menu!.partId('content') : null\",\n \"[attr.data-placement]\": \"menu?.anchored?.placement() ?? null\",\n \"[attr.data-side]\": \"menu?.anchored?.side() ?? null\",\n \"[attr.role]\": \"inMenubar ? 'menuitem' : null\",\n \"[attr.data-menubar-item]\": \"flag(inMenubar)\",\n \"(click)\": \"activate()\",\n \"(keydown)\": \"onKeydown($event)\",\n },\n})\nexport class UioMenuTrigger extends UioPart implements OnInit {\n readonly scope = \"menu\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"menu\") menu?: UioMenu;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Inside a menubar the trigger stops being a button and becomes one of the\n * bar's menuitems — `role=\"menubar\"` admits no other children — and the data\n * attribute is how the bar finds its own triggers for the roving tabindex.\n *\n * Read from an optional provider rather than passed down: `UioMenu` is an\n * independent overlay and the bar has no handle on the triggers inside it, so\n * the bar announces itself and the trigger asks. Outside a bar both attributes\n * are absent, which is what React renders for a plain menu trigger.\n *\n * A plain field, not a signal: a bar does not appear or disappear around a\n * trigger that is already mounted.\n */\n protected readonly inMenubar = !!inject(UioMenubarContext, { optional: true });\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.menu?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n this.menu?.rememberOpener(this.host.nativeElement);\n }\n\n protected activate(): void {\n this.menu?.rememberOpener(this.host.nativeElement);\n this.menu?.toggle();\n }\n\n /**\n * Arrow keys open the menu, which is the APG behaviour and the one thing a\n * click handler alone cannot give a keyboard user.\n */\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key !== \"ArrowDown\" && event.key !== \"ArrowUp\") return;\n event.preventDefault();\n this.menu?.rememberOpener(this.host.nativeElement);\n this.menu?.show();\n }\n}\n\n/**\n * One action in a menu.\n *\n * A `div` with `role=\"menuitem\"` rather than a `button`, because that is what\n * Ark renders and because `role=\"menu\"` admits no other children — a real button\n * would bring its own focus behaviour into a surface whose focus lives on the\n * menu itself.\n */\n@Component({\n selector: \"[uioMenuItem]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n <span uioIcon class=\"menu__item-icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n <span class=\"menu__item-label\"><ng-content /></span>\n `,\n host: {\n role: \"menuitem\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"menu.itemId(itemValue())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"itemValue()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"choose()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : itemValue())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioMenuItem extends UioPart implements OnInit, OnDestroy {\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n /**\n * The value reported when the item is chosen.\n *\n * Optional, and falls back to a generated id — the same fork React takes.\n * Ark requires a stable value per item where Base UI did not, and a menu of\n * one-off actions has nothing meaningful to put there.\n */\n readonly value = input<string | undefined>(undefined);\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n /** Red text at rest, filling solid on highlight — the destructive-ghost button. */\n readonly destructive = input(false, { transform: booleanAttribute });\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioMenu);\n protected readonly ICON_SIZE = 20;\n protected readonly hostClass = computed(() =>\n clsx(\"menu__item\", this.destructive() && \"menu__item--destructive\"),\n );\n\n private readonly generated = nextMachineId();\n /** Falls back to a generated id, so every item has a stable identity. */\n protected readonly itemValue = computed(() => this.value() ?? this.generated);\n\n override readonly highlighted = computed(() => this.menu.highlighted() === this.itemValue());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Registration rather than a query.\n *\n * `contentChildren()` would be the obvious way for the menu to find its items,\n * and initializer-based queries are not registered by the JIT compiler this\n * package's specs run under — so the keyboard navigation, which is the whole\n * reason the menu needs the list, could not be tested. Items telling the menu\n * they exist works in both compilers, and the menu sorts them by document\n * position anyway (see `inDomOrder`), so registration order is never relied on.\n */\n private readonly handle: MenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.itemValue(),\n disabled: () => this.disabled(),\n choose: () => this.choose(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected choose(): void {\n if (this.disabled()) return;\n this.menu.choose(this.itemValue());\n }\n}\n\n/**\n * The rule between groups of actions.\n *\n * The surface is the design system's Divider — same height, color and full\n * width as everywhere else — with Ark's separator identity merged onto it. React\n * does that with `asChild`; Angular has no such thing and cannot put two\n * components on one element, so the class is composed from `dividerStyles`\n * directly. Same rendered element, one fewer indirection.\n */\n@Directive({\n selector: \"[uioMenuSeparator]\",\n standalone: true,\n host: {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n \"[class]\": \"hostClass\",\n },\n})\nexport class UioMenuSeparator extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"separator\";\n protected readonly hostClass = clsx(\n dividerStyles({ orientation: \"horizontal\", spacing: \"none\" }),\n \"menu__separator\",\n );\n}\n\n/**\n * The ids a group and its label share.\n *\n * Provided per group so each one gets its own pair. Note the label id is\n * emitted whether or not a label exists — that is Ark's own behaviour rather\n * than an oversight copied here: zag builds both ids from the same key and never\n * checks that the label is there, so a group with no label ships a dangling\n * reference in all four libraries alike, and the fix belongs upstream.\n */\n@Injectable()\nexport class UioMenuGroupContext {\n private readonly menu = inject(UioMenu);\n private readonly key = nextMachineId();\n\n get groupId(): string {\n return this.menu.partId(`group:${this.key}`);\n }\n get labelId(): string {\n return this.menu.partId(`group-label:${this.key}`);\n }\n}\n\n/** A named set of related items. */\n@Directive({\n selector: \"[uioMenuGroup]\",\n standalone: true,\n providers: [UioMenuGroupContext],\n host: {\n class: \"menu__group\",\n role: \"group\",\n \"[id]\": \"group.groupId\",\n \"[attr.aria-labelledby]\": \"group.labelId\",\n },\n})\nexport class UioMenuGroup extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group\";\n protected readonly group = inject(UioMenuGroupContext);\n}\n\n/** Names the group above it. */\n@Directive({\n selector: \"[uioMenuGroupLabel]\",\n standalone: true,\n host: {\n class: \"menu__group-label text-strong-body-small\",\n \"[id]\": \"group.labelId\",\n },\n})\nexport class UioMenuGroupLabel extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group-label\";\n protected readonly group = inject(UioMenuGroupContext);\n}\n\n/**\n * A togglable action, drawn with the design system's checkbox control.\n *\n * The check is driven by the *item's* `data-state`, not by the control's own —\n * `.menu__item--check[data-state=\"checked\"] .checkbox__indicator` is the rule,\n * which is why the control below is inert markup rather than a `UioCheckbox`. A\n * real checkbox inside a `role=\"menu\"` would bring an input, its own focus, and\n * a second thing to tab to.\n */\n@Component({\n selector: \"[uioMenuCheckboxItem]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n <span class=\"checkbox__control menu__control\">\n <span class=\"checkbox__indicator\">\n <span uioIcon class=\"checkbox__check\" [name]=\"glyph('check')\" [size]=\"CHECK_SIZE\"></span>\n </span>\n </span>\n <span class=\"menu__item-label\"><ng-content /></span>\n `,\n host: {\n class: \"menu__item menu__item--check\",\n \"data-type\": \"checkbox\",\n role: \"menuitemcheckbox\",\n \"[id]\": \"menu.itemId(itemValue())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"itemValue()\",\n \"[attr.data-valuetext]\": \"itemValue()\",\n \"[attr.aria-checked]\": \"checked()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"toggle()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : itemValue())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioMenuCheckboxItem extends UioPart implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n readonly value = input<string | undefined>(undefined);\n readonly checked = model(false);\n readonly checkedChange = output<boolean>();\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioMenu);\n protected readonly CHECK_SIZE = CHECK_ICON_SIZE;\n\n private readonly generated = nextMachineId();\n protected readonly itemValue = computed(() => this.value() ?? this.generated);\n\n /** `checked`/`unchecked` rather than `open`/`closed` — zag's spelling for an option item. */\n override readonly state = computed(() => (this.checked() ? \"checked\" : \"unchecked\"));\n override readonly highlighted = computed(() => this.menu.highlighted() === this.itemValue());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly handle: MenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.itemValue(),\n disabled: () => this.disabled(),\n choose: () => this.toggle(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected toggle(): void {\n if (this.disabled()) return;\n const next = !this.checked();\n this.checked.set(next);\n this.checkedChange.emit(next);\n // Closes, like every other item. Toggling several columns without the menu\n // shutting each time is the better behaviour and the one this originally\n // had — but Ark's menu has no `closeOnSelect` (only Combobox and DatePicker\n // do), so React, Svelte and Vue cannot reproduce it. A menu that stays open\n // in one library of four is a divergence, not a feature; the place to fix\n // this is upstream, and all four move together when it lands.\n this.menu.choose(this.itemValue());\n }\n}\n\n/** One choice at a time, shared by the radio items inside it. */\n@Injectable()\nexport class UioMenuRadioContext {\n readonly value = signal<string | null>(null);\n choose: (value: string) => void = () => {};\n}\n\n/**\n * A set of mutually exclusive choices.\n *\n * Not an Ark part in its own right — `RadioItemGroup` renders the same\n * `item-group` element a plain group does — so this carries the group's identity\n * and, additionally, the selected value its items read.\n */\n@Directive({\n selector: \"[uioMenuRadioGroup]\",\n standalone: true,\n providers: [UioMenuGroupContext, UioMenuRadioContext],\n host: {\n // No `menu__group`, matching React — where `MenuGroup` adds the class and\n // `MenuRadioGroup` renders the bare part. The class styles nothing in the\n // shared sheet (only `.menu__group-label` has a rule), so the asymmetry is\n // cosmetic in the markup and invisible on the page.\n role: \"group\",\n \"[id]\": \"group.groupId\",\n \"[attr.aria-labelledby]\": \"group.labelId\",\n },\n})\nexport class UioMenuRadioGroup extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group\";\n\n readonly value = model<string | null>(null);\n readonly valueChange = output<string>();\n\n protected readonly group = inject(UioMenuGroupContext);\n private readonly radio = inject(UioMenuRadioContext);\n\n constructor() {\n super();\n this.radio.choose = (value) => {\n this.value.set(value);\n this.valueChange.emit(value);\n };\n // The context holds a plain signal rather than the model itself, so that a\n // spec replacing the input after construction — which is the only way a JIT\n // fixture can set one — still reaches the items.\n effect(() => this.radio.value.set(this.value()));\n }\n}\n\n/** One choice, drawn with the design system's radio control. */\n@Component({\n selector: \"[uioMenuRadioItem]\",\n standalone: true,\n template: `\n <span class=\"radio-item__control menu__control\">\n <span class=\"radio-item__indicator\"></span>\n </span>\n <span class=\"menu__item-label\"><ng-content /></span>\n `,\n host: {\n class: \"menu__item menu__item--check\",\n \"data-type\": \"radio\",\n role: \"menuitemradio\",\n \"[id]\": \"menu.itemId(value())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"value()\",\n \"[attr.data-valuetext]\": \"value()\",\n \"[attr.aria-checked]\": \"isChecked()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"choose()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : value())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioMenuRadioItem extends UioPart implements OnInit, OnDestroy {\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n /** Required: a radio item is identified by the value it selects. */\n readonly value = input.required<string>();\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioMenu);\n private readonly radio = inject(UioMenuRadioContext);\n\n protected readonly isChecked = computed(() => this.radio.value() === this.value());\n override readonly state = computed(() => (this.isChecked() ? \"checked\" : \"unchecked\"));\n override readonly highlighted = computed(() => this.menu.highlighted() === this.value());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly handle: MenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.value(),\n disabled: () => this.disabled(),\n choose: () => this.choose(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected choose(): void {\n if (this.disabled()) return;\n this.radio.choose(this.value());\n this.menu.choose(this.value());\n }\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n AfterViewInit,\n ApplicationRef,\n Component,\n DOCUMENT,\n ElementRef,\n EmbeddedViewRef,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n selectFieldStyles,\n type ControlSize,\n type SelectVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { restoreFocus } from \"../overlay/focus.js\";\nimport { moveHighlight } from \"../overlay/roving.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type SelectSize = NonNullable<SelectVariants[\"size\"]>;\nexport type SelectVariant = NonNullable<SelectVariants[\"variant\"]>;\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\n/**\n * A single-choice dropdown, with its label, helper text and error already wired\n * to it.\n *\n * ```html\n * <div uioSelect label=\"Fruit\" [options]=\"fruit\" formControlName=\"fruit\"></div>\n * ```\n *\n * ── Three things that look like details and are not ─────────────────────────\n *\n * **The label is a Select part, not a Field part.** Ark's Select renders its own\n * Label — `data-scope=\"select\"` — but gives it the *field's* id, because three\n * separate references point at it: the trigger's `aria-labelledby`, the\n * listbox's, and the hidden native select's. That is also why the ghost variant\n * hides the label instead of dropping it: with no Label element all three\n * references dangle, and a dangling IDREF outranks any `aria-label` beside it,\n * so the field ends up with no accessible name at all.\n *\n * **The hidden `<select>` is the form control.** It is what carries `name`,\n * `required`, `disabled` and `aria-describedby`, and what a plain HTML form\n * submits. The visible trigger is a `role=\"combobox\"` button.\n *\n * **The listbox keeps focus; the option is only named.** Ark drives the popup\n * with `aria-activedescendant`, so `[data-highlighted]` — which is the whole\n * hover treatment in the shared stylesheet — sits on an option that does not\n * have DOM focus. See `overlay/roving.ts` for why the CDK's\n * `ActiveDescendantKeyManager` could not supply it.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it,\n * including `control.disable()` reaching every part's `data-disabled`. React has\n * no equivalent; this is capability rather than parity debt.\n */\n@Component({\n selector: \"div[uioSelect]\",\n standalone: true,\n exportAs: \"uioSelect\",\n imports: [UioIcon, UioFieldError],\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioSelect), multi: true },\n ],\n template: `\n <div\n class=\"select-field__control\"\n data-scope=\"select\"\n data-part=\"root\"\n [id]=\"selectId\"\n [attr.data-invalid]=\"flag(invalid())\"\n >\n @if (label(); as text) {\n <label\n [class]=\"labelClass()\"\n data-scope=\"select\"\n data-part=\"label\"\n [id]=\"field.partId('label')\"\n [attr.for]=\"field.controlId\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-required]=\"flag(required())\"\n >{{ text }}@if (required() && !isGhost()) {<span\n class=\"field__required\"\n aria-hidden=\"true\"\n ></span>}</label\n >\n }\n <button\n class=\"select-field__trigger text-default-body-large\"\n data-scope=\"select\"\n data-part=\"trigger\"\n type=\"button\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [id]=\"partId('trigger')\"\n [attr.data-state]=\"openState()\"\n [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\n [attr.aria-invalid]=\"invalid() ? 'true' : 'false'\"\n [attr.aria-required]=\"required() ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"label() ? field.partId('label') : null\"\n [attr.aria-controls]=\"open() ? partId('content') : null\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.data-placeholder-shown]=\"flag(!chosen())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false); onTouched()\"\n >\n <span\n class=\"select-field__value\"\n data-scope=\"select\"\n data-part=\"value-text\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >{{ valueText() }}</span\n >\n <div\n class=\"select-field__icon\"\n data-scope=\"select\"\n data-part=\"indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"openState()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >\n <span uioIcon [name]=\"glyph('chevron-down')\" [size]=\"iconSize()\"></span>\n </div>\n </button>\n <!--\n The control a form actually submits. Ark calls it HiddenSelect; it takes\n the name, the validation attributes and the field's description, and the\n visible trigger takes none of them.\n -->\n <select\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [id]=\"field.controlId\"\n [attr.style]=\"HIDDEN\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [disabled]=\"isDisabled()\"\n [attr.aria-labelledby]=\"label() ? field.partId('label') : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [value]=\"value() ?? ''\"\n >\n <!--\n The placeholder option, and only while nothing is chosen. Ark drops it\n the moment there is a value — leaving it would offer \"no answer\" as a\n choice in a native form long after one had been made.\n -->\n @if (!chosen()) {\n <option value=\"\"></option>\n }\n @for (option of options(); track option.value) {\n <option [value]=\"option.value\" [disabled]=\"!!option.disabled\">{{ option.label }}</option>\n }\n </select>\n </div>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span\n >\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n\n <!-- See UioPopover: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"select-positioner\"\n data-scope=\"select\"\n data-part=\"positioner\"\n [id]=\"partId('positioner')\"\n >\n <div\n [class]=\"popupClass()\"\n data-scope=\"select\"\n data-part=\"content\"\n role=\"listbox\"\n tabindex=\"0\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"openState()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.aria-labelledby]=\"label() ? field.partId('label') : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.data-activedescendant]=\"activeDescendant()\"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (option of options(); track option.value) {\n <div\n class=\"select-popup__item text-default-body-large\"\n data-scope=\"select\"\n data-part=\"item\"\n role=\"option\"\n [id]=\"optionId(option.value)\"\n [attr.data-value]=\"option.value\"\n [attr.aria-selected]=\"value() === option.value ? 'true' : 'false'\"\n [attr.data-state]=\"value() === option.value ? 'checked' : 'unchecked'\"\n [attr.data-disabled]=\"flag(!!option.disabled)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n [attr.data-highlighted]=\"flag(highlightedValue() === option.value)\"\n (click)=\"choose(option)\"\n (pointermove)=\"highlight(option)\"\n >\n <span\n data-scope=\"select\"\n data-part=\"item-text\"\n [attr.data-state]=\"value() === option.value ? 'checked' : 'unchecked'\"\n [attr.data-disabled]=\"flag(!!option.disabled)\"\n [attr.data-highlighted]=\"flag(highlightedValue() === option.value)\"\n >{{ option.label }}</span\n >\n <div\n class=\"select-popup__item-indicator\"\n aria-hidden=\"true\"\n data-scope=\"select\"\n data-part=\"item-indicator\"\n [attr.data-state]=\"value() === option.value ? 'checked' : 'unchecked'\"\n [attr.hidden]=\"value() === option.value ? null : ''\"\n >\n <span uioIcon [name]=\"glyph('check')\" [size]=\"iconSize()\"></span>\n </div>\n </div>\n }\n </div>\n </div>\n </ng-template>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioSelect extends UioPart implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor {\n protected readonly glyph = glyph;\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly options = input<readonly SelectOption[]>([]);\n readonly value = model<string | undefined>(undefined);\n readonly open = model(false);\n readonly label = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<SelectSize>(\"md\");\n readonly variant = input<SelectVariant>(\"default\");\n readonly name = input<string | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly valueChange = output<string>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n /**\n * Deliberately *not* `UioPart.state`.\n *\n * This component's host is the field root, and Ark puts no `data-state` on it\n * — the open/closed state belongs to the trigger, the indicator and the\n * listbox, which are three elements further in. Overriding the base's `state`\n * would stamp `data-state=\"open\"` on a `role=\"group\"` that has no such state.\n */\n protected readonly openState = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n readonly machine = nextMachineId();\n readonly anchored = new AnchoredSurface(inject(Overlay));\n protected readonly field = inject(UioFieldContext);\n /** Named `highlightedValue` because `UioPart.highlighted` is this element's own state. */\n protected readonly highlightedValue = signal<string | null>(null);\n /**\n * Whether the *trigger* has DOM focus.\n *\n * Ark marks it on the value-text part alone — not on the trigger, and not\n * while the popup is open, when focus has moved to the listbox. It is the\n * state a user is left in after choosing an option, so it shows up the moment\n * anything drives this control by keyboard.\n */\n protected readonly focused = signal(false);\n\n protected readonly isGhost = computed(() => this.variant() === \"ghost\");\n protected readonly hostClass = computed(() =>\n selectFieldStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly labelClass = computed(() =>\n this.isGhost() ? \"select-field__label--hidden\" : \"field__label\",\n );\n protected readonly popupClass = computed(() =>\n clsx(\"select-popup\", this.isGhost() && \"select-popup--ghost\"),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n /** Named `chosen` because `UioPart.selected` is this element's own state. */\n protected readonly chosen = computed(() =>\n this.options().find((option) => option.value === this.value()),\n );\n protected readonly valueText = computed(() => this.chosen()?.label ?? this.placeholder() ?? \"\");\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n protected readonly activeDescendant = computed(() => {\n const value = this.highlightedValue();\n return value === null ? null : this.optionId(value);\n });\n\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.triggerElement(),\n dismiss: () => this.close(),\n };\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n disabled: this.isDisabled,\n required: this.required,\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n get selectId(): string {\n return `select:${this.machine}`;\n }\n partId(part: string): string {\n return `select:${this.machine}:${part}`;\n }\n /** Ark's option ids carry the value, so two selects on a page cannot collide. */\n optionId(value: string): string {\n return this.partId(`option:${value}`);\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, and the queries are static because of it.\n *\n * `ngAfterViewInit` runs bottom-up: a select declared inside a dialog attaches\n * its overlay *before* the dialog attaches its own, so the CDK's single\n * container ends up holding the inner surface first. The other three libraries\n * portal each surface straight into `document.body`, where a dialog's backdrop\n * and popup land before anything declared inside them — and anything reading\n * the document in order sees a different tree for the same page.\n *\n * It is also the right order on its own terms: an inner surface should not\n * exist before the surface that contains it, because `hideOthersFrom` and the\n * browser's top layer both work from what is already there.\n */\n ngOnInit(): void {\n const trigger = this.triggerElement();\n const ref = this.anchored.create(\n trigger ?? this.host.nativeElement,\n // Ark's Select positions itself bottom-start with a 4px gutter; the popup\n // is as wide as the trigger, so there is no centring to do.\n anchoredPositions(\"bottom\", \"start\", 4),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n }\n\n /**\n * The trigger exists by now for certain, where `ngOnInit` only creates the\n * overlay early enough to keep the container in document order.\n */\n ngAfterViewInit(): void {\n const trigger = this.triggerElement();\n if (trigger) this.anchored.setAnchor(trigger);\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n toggle(): void {\n this.setOpen(!this.open());\n }\n show(): void {\n this.setOpen(true);\n }\n close(): void {\n this.setOpen(false);\n }\n\n protected highlight(option: SelectOption): void {\n this.highlightedValue.set(option.disabled ? null : option.value);\n }\n\n protected choose(option: SelectOption): void {\n if (option.disabled) return;\n this.value.set(option.value);\n this.valueChange.emit(option.value);\n this.onChange(option.value);\n this.close();\n }\n\n /** Space, Enter and the arrows open a closed select — the APG combobox keys. */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.open()) return;\n if (event.key !== \"ArrowDown\" && event.key !== \"ArrowUp\" && event.key !== \"Enter\" && event.key !== \" \") {\n return;\n }\n event.preventDefault();\n this.show();\n }\n\n protected onListKeydown(event: KeyboardEvent): void {\n const options = this.options();\n const navigable = options.map((option) => ({ disabled: !!option.disabled }));\n const current = options.findIndex((option) => option.value === this.highlightedValue());\n\n const move = (step: number) => {\n const next = options[moveHighlight(navigable, current, step)];\n if (next) this.highlightedValue.set(next.value);\n event.preventDefault();\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return move(1);\n case \"ArrowUp\":\n return move(-1);\n case \"Home\":\n this.highlightedValue.set(null);\n return move(1);\n case \"End\":\n this.highlightedValue.set(null);\n return move(-1);\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[current];\n if (option) this.choose(option);\n return;\n }\n case \"Tab\":\n this.close();\n return;\n default:\n return;\n }\n }\n\n private triggerElement(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"trigger\"]');\n }\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private setOpen(next: boolean): void {\n if (next && this.isDisabled()) return;\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n this.sizeToTrigger();\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n // Ark opens on the current selection when there is one, and on nothing when\n // there is not — which is why a fresh select reports no `aria-activedescendant`.\n this.highlightedValue.set(this.chosen()?.value ?? null);\n this.contentElement()?.focus({ preventScroll: true });\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.highlightedValue.set(null);\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n restoreFocus(this.triggerElement());\n }\n\n /**\n * `.select-popup` is `width: var(--reference-width)` — zag measures the trigger\n * and publishes it on the positioner. Nothing in the CDK does, so the popup\n * would be `width: auto` and narrower than the control it belongs to.\n */\n private sizeToTrigger(): void {\n const trigger = this.triggerElement();\n const positioner = this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"positioner\"]',\n );\n if (trigger && positioner) {\n positioner.style.setProperty(\"--reference-width\", `${trigger.offsetWidth}px`);\n }\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? undefined);\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ApplicationRef,\n Component,\n ElementRef,\n TemplateRef,\n afterRenderEffect,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { tabsStyles, type TabsVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { firstFocusable } from \"../overlay/focus.js\";\nimport { moveHighlight } from \"../overlay/roving.js\";\n\nexport type TabsOrientation = NonNullable<TabsVariants[\"orientation\"]>;\nexport type TabsSize = NonNullable<TabsVariants[\"size\"]>;\n\nexport interface TabItem {\n /** Identifies the tab. Coerced to a string at the boundary, as Zag does. */\n value: string | number;\n label: string;\n /**\n * A string, or a template for anything richer.\n *\n * The other three libraries take a node here, which Angular has no equivalent\n * of inside a data array — the tabs are *data*, and an `<ng-content>` per tab\n * would mean the caller placing panels the component then has to go and find.\n * A `TemplateRef` is the Angular way to hand a component markup it will render\n * itself, and it costs the string case nothing.\n */\n content?: string | TemplateRef<unknown>;\n disabled?: boolean;\n}\n\n/**\n * One panel at a time, chosen from a row of tabs.\n *\n * ```html\n * <div uioTabs [tabs]=\"views\" [(value)]=\"view\"></div>\n * ```\n *\n * ── Real focus, not `aria-activedescendant` ─────────────────────────────────\n *\n * Menu and Select in this library keep DOM focus on the popup and *name* the\n * highlighted option. Tabs is the opposite, and it is worth being explicit\n * about, because the two patterns look alike from the outside: Ark's tab list\n * moves **real focus** between triggers — `tabIndex` is 0 on the selected tab\n * and -1 on the rest, and `focusNextTab` calls `.focus()` — so the roving\n * highlight and the browser's focus are the same thing. Reproducing it with\n * `aria-activedescendant` instead would leave `:focus-visible` on the tab the\n * user arrowed *away* from, and `.tabs__tab:focus-visible` is the entire focus\n * ring in the shared stylesheet.\n *\n * `overlay/roving.ts` still supplies the arithmetic — wrapping, and skipping\n * disabled tabs — because that part is the same wherever the highlight lives.\n *\n * ── Automatic activation ────────────────────────────────────────────────────\n *\n * Zag's default `activationMode` is `\"automatic\"`: arrowing to a tab selects it.\n * Zag defers that selection by a frame (`selectFocusedTab` runs inside a `raf`)\n * so the focus lands first; here focus is moved by hand and the selection\n * follows in the same handler, which reaches the same end state without a frame\n * in which the DOM disagrees with itself.\n */\n@Component({\n selector: \"div[uioTabs]\",\n standalone: true,\n exportAs: \"uioTabs\",\n imports: [NgTemplateOutlet],\n template: `\n <div\n class=\"tabs__list\"\n data-scope=\"tabs\"\n data-part=\"list\"\n role=\"tablist\"\n [id]=\"listId\"\n [attr.data-focus]=\"flag(focus())\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.data-orientation]=\"orientation()\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (tab of tabs(); track keyOf(tab)) {\n <!--\n aria-controls is bound only while the tab is selected: every other\n panel is hidden, and a reference to something no user can reach is the\n dangling-IDREF failure in a different disguise. Ark drops it too.\n -->\n <button\n class=\"tabs__tab text-emphasis-body-large\"\n data-scope=\"tabs\"\n data-part=\"trigger\"\n role=\"tab\"\n type=\"button\"\n [id]=\"triggerId(keyOf(tab))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"keyOf(tab)\"\n [attr.data-disabled]=\"flag(tab.disabled)\"\n [attr.aria-disabled]=\"tab.disabled ? 'true' : null\"\n [attr.aria-selected]=\"isSelected(keyOf(tab))\"\n [attr.data-selected]=\"flag(isSelected(keyOf(tab)))\"\n [attr.data-focus]=\"flag(focusedValue() === keyOf(tab))\"\n [attr.aria-controls]=\"isSelected(keyOf(tab)) ? contentId(keyOf(tab)) : null\"\n [attr.data-ownedby]=\"listId\"\n [disabled]=\"!!tab.disabled\"\n [tabIndex]=\"isSelected(keyOf(tab)) ? 0 : -1\"\n (click)=\"choose(keyOf(tab))\"\n (focus)=\"onTriggerFocus(keyOf(tab))\"\n (blur)=\"onTriggerBlur($event)\"\n >{{ tab.label }}</button>\n }\n </div>\n <!--\n Not an Ark part: Ark renders each Content straight into the root, and this\n wrapper is the design system's own — .tabs__panels is what takes the space\n beside a vertical list. It carries no scope or part, so none of the shared\n stylesheet's state vocabulary applies to it.\n -->\n <div class=\"tabs__panels\">\n @for (tab of tabs(); track keyOf(tab)) {\n <div\n class=\"tabs__panel\"\n data-scope=\"tabs\"\n data-part=\"content\"\n role=\"tabpanel\"\n [id]=\"contentId(keyOf(tab))\"\n [attr.tabindex]=\"panelTabIndex(keyOf(tab))\"\n [attr.aria-labelledby]=\"triggerId(keyOf(tab))\"\n [attr.data-ownedby]=\"listId\"\n [attr.data-selected]=\"flag(isSelected(keyOf(tab)))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-state]=\"isSelected(keyOf(tab)) ? 'open' : 'closed'\"\n [attr.hidden]=\"isSelected(keyOf(tab)) ? null : ''\"\n >\n @if (asTemplate(tab.content); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ tab.content }}\n }\n </div>\n }\n </div>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioTabs extends UioPart {\n readonly scope = \"tabs\";\n readonly part = \"root\";\n\n readonly tabs = input<readonly TabItem[]>([]);\n /**\n * Uncontrolled until something binds it, which is what makes React's\n * `value`/`defaultValue` fork unnecessary — see `UioSwitch` for the same note.\n * Unset means the first tab, exactly as React's `resolvedDefault` does.\n */\n readonly value = model<string | number | undefined>(undefined);\n readonly size = input<TabsSize>(\"default\");\n override readonly orientation = input<TabsOrientation>(\"horizontal\");\n readonly valueChange = output<string>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly flag = stateFlag;\n protected readonly hostClass = computed(() =>\n tabsStyles({ orientation: this.orientation(), size: this.size() }),\n );\n\n /**\n * The selected tab's key, falling back to the first tab.\n *\n * Not `selected`: `UioPart` already owns that name for the boolean behind\n * `data-selected`, and the tabs *root* reports no such attribute — only its\n * triggers and panels do.\n */\n protected readonly selectedValue = computed<string | null>(() => {\n const value = this.value();\n if (value != null) return String(value);\n const first = this.tabs()[0];\n return first ? this.keyOf(first) : null;\n });\n\n /**\n * Which tab reports `data-focus`, which is not the same as which is selected.\n *\n * Zag seeds `focusedValue` from the initial selection and only starts tracking\n * focus once a trigger has been focused or clicked — so a tab strip nobody has\n * touched still marks its selected tab, and one that has been tabbed away from\n * marks none. `touched` is that \"the machine owns this now\" flip; without it\n * the initial render would report no focused tab where all three other\n * libraries report one.\n */\n private readonly touched = signal(false);\n private readonly focusedTab = signal<string | null>(null);\n readonly focusedValue = computed<string | null>(() =>\n this.touched() ? this.focusedTab() : this.selectedValue(),\n );\n /** The root and the list report focus only while it is really inside them. */\n override readonly focus: Signal<boolean> = computed(\n () => this.touched() && this.focusedTab() !== null,\n );\n\n /**\n * Ark builds every id as `<scope>:<machine>:<part>`, and a tab's parts carry\n * the tab's own value on the end so two strips on a page cannot collide.\n */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `tabs:${this.machine}`;\n }\n protected get listId(): string {\n return `tabs:${this.machine}:list`;\n }\n protected triggerId(value: string): string {\n return `tabs:${this.machine}:trigger-${value}`;\n }\n protected contentId(value: string): string {\n return `tabs:${this.machine}:content-${value}`;\n }\n\n protected keyOf(tab: TabItem): string {\n return String(tab.value);\n }\n protected isSelected(value: string): boolean {\n return this.selectedValue() === value;\n }\n protected asTemplate(content: TabItem[\"content\"]): TemplateRef<unknown> | null {\n return content instanceof TemplateRef ? content : null;\n }\n\n /**\n * The selected panel stops being a tab stop of its own once it holds something\n * focusable.\n *\n * The APG's rule, and zag's `syncTabIndex`: a panel of text has to be reachable\n * by Tab or its content is unreachable to a keyboard, while a panel that\n * already contains a button is reachable through it. Both write this *after*\n * render because both have to look at the panel — which is why it starts at\n * `0`: if the render hook never runs (a server render, a test that never\n * flushes) the markup is still what Ark emits before its own `raf` fires,\n * rather than something neither library ever shows.\n */\n private readonly panelIsFocusable = signal(false);\n protected panelTabIndex(value: string): \"0\" | null {\n return this.isSelected(value) && this.panelIsFocusable() ? null : \"0\";\n }\n\n constructor() {\n super();\n afterRenderEffect(() => {\n // Read through the signal so the hook re-runs when the selection moves.\n this.selectedValue();\n const panel = this.host.nativeElement.querySelector<HTMLElement>(\n '[data-part=\"content\"][data-selected]',\n );\n this.panelIsFocusable.set(!!panel && !!firstFocusable(panel));\n });\n }\n\n /** Clicking a tab both focuses and selects it — Zag's `TAB_CLICK`. */\n protected choose(value: string): void {\n this.touched.set(true);\n this.focusedTab.set(value);\n this.select(value);\n }\n\n protected onTriggerFocus(value: string): void {\n this.touched.set(true);\n this.focusedTab.set(value);\n flushNow(this.appRef);\n }\n\n /**\n * Only a blur that leaves the tab list clears the focused tab.\n *\n * Moving between two triggers fires blur on the old one *before* focus on the\n * new one; clearing unconditionally would drop `data-focus` off the whole\n * strip for a tick, and anything reading the DOM in between — the parity gate\n * does exactly that — sees a strip nobody is in. Zag makes the same test on\n * `relatedTarget`.\n */\n protected onTriggerBlur(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof HTMLElement && next.getAttribute(\"role\") === \"tab\") return;\n this.touched.set(true);\n this.focusedTab.set(null);\n flushNow(this.appRef);\n }\n\n private select(value: string): void {\n if (this.selectedValue() === value) return;\n this.value.set(value);\n this.valueChange.emit(value);\n flushNow(this.appRef);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const horizontal = this.orientation() === \"horizontal\";\n const move = ((): number | \"home\" | \"end\" | null => {\n switch (event.key) {\n case \"ArrowRight\":\n return horizontal ? 1 : null;\n case \"ArrowLeft\":\n return horizontal ? -1 : null;\n case \"ArrowDown\":\n return horizontal ? null : 1;\n case \"ArrowUp\":\n return horizontal ? null : -1;\n case \"Home\":\n return \"home\";\n case \"End\":\n return \"end\";\n default:\n return null;\n }\n })();\n // An ArrowDown in a horizontal strip is the page's to scroll with, so it is\n // left alone rather than swallowed.\n if (move === null) return;\n event.preventDefault();\n\n const navigable = this.tabs().map((tab) => ({ disabled: !!tab.disabled }));\n // -1 is `moveHighlight`'s \"nothing highlighted yet\", which is exactly what\n // Home and End want: start from the far end and walk to the first enabled.\n const from = move === \"home\" || move === \"end\" ? -1 : this.indexOfFocused();\n const step = move === \"home\" ? 1 : move === \"end\" ? -1 : move;\n const next = moveHighlight(navigable, from, step);\n if (next === -1) return;\n\n // Focus first: the trigger's own focus handler is what records the move, so\n // a keyboard and a mouse arrive at the state through one path.\n this.triggerElements()[next]?.focus();\n // Automatic activation. The focus handler has already recorded the tab, so\n // this reads it back rather than trusting the same index twice.\n const value = this.focusedValue();\n if (value !== null) this.select(value);\n }\n\n private indexOfFocused(): number {\n const focused = this.focusedValue();\n return this.tabs().findIndex((tab) => this.keyOf(tab) === focused);\n }\n\n /**\n * The triggers as rendered, in DOM order.\n *\n * Index-aligned with `tabs()` because one `@for` produces both, so the\n * arithmetic above happens on the data and is applied to the elements.\n */\n private triggerElements(): HTMLElement[] {\n return [...this.host.nativeElement.querySelectorAll<HTMLElement>('[data-part=\"trigger\"]')];\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ApplicationRef,\n Component,\n ElementRef,\n TemplateRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { accordionStyles, type AccordionVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { moveHighlight } from \"../overlay/roving.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type AccordionVariant = NonNullable<AccordionVariants[\"variant\"]>;\nexport type AccordionSize = NonNullable<AccordionVariants[\"size\"]>;\n\nexport interface AccordionItem {\n /** Identifies the item. Coerced to a string at the boundary, as Zag does. */\n value: string | number;\n title: string;\n /** A string, or a template for anything richer — see `TabItem.content`. */\n content?: string | TemplateRef<unknown>;\n disabled?: boolean;\n}\n\n/** The chevron, at the size the other three libraries ask Icon for. */\nconst ICON_SIZE = 20;\n\n/**\n * A stack of sections that open and close.\n *\n * ```html\n * <div uioAccordion [items]=\"sections\" [(value)]=\"open\"></div>\n * ```\n *\n * ── Three things Ark renders that the JSX does not show ─────────────────────\n *\n * **The item's id is prefixed `collapsible:`.** Ark builds each accordion item\n * out of a Collapsible root and hands it the accordion's item id as its\n * *machine* id, so the element comes out as\n * `collapsible:accordion:<machine>:item:<value>`. It looks like a typo and it is\n * the contract — reproduced here rather than tidied, because ids are compared\n * across all four libraries by shape.\n *\n * **The trigger names its panel twice.** `aria-controls` is the reference;\n * `data-controls` is how a sibling finds the panel without reading ARIA. Both\n * are present whether the item is open or closed.\n *\n * **An open panel reports no `data-state` at all.** Zag's collapsible drops it\n * once the enter transition has finished (`skip = !initial && open`), so a\n * settled open panel carries `data-collapsible` and nothing else, while a closed\n * one carries `data-state=\"closed\"` and `hidden`. `.accordion__panel` styles\n * neither, so nothing renders differently — but the parity gate compares\n * attributes, not appearance, and emitting a helpful `data-state=\"open\"` here\n * would be a difference from all three other libraries.\n *\n * ── What is not reproduced ──────────────────────────────────────────────────\n *\n * Zag measures the panel and writes `--height`/`--width` onto it for a height\n * transition. The shared stylesheet defines no such transition for Accordion —\n * `.accordion__panel` is `overflow: hidden` and nothing else — so the\n * measurement would be a `ResizeObserver` per item feeding two custom properties\n * no rule reads. It is left out; `Collapsible`, when it is ported, is where that\n * measurement actually earns its keep.\n */\n@Component({\n selector: \"div[uioAccordion]\",\n standalone: true,\n exportAs: \"uioAccordion\",\n imports: [NgTemplateOutlet, UioIcon],\n template: `\n @for (item of items(); track keyOf(item)) {\n <div\n class=\"accordion__item\"\n data-scope=\"accordion\"\n data-part=\"item\"\n [id]=\"itemId(keyOf(item))\"\n [attr.data-state]=\"stateOf(keyOf(item))\"\n [attr.data-disabled]=\"flag(isDisabled(item))\"\n [attr.data-focus]=\"flag(focusedValue() === keyOf(item))\"\n [attr.data-orientation]=\"orientation()\"\n >\n <!--\n Ark has no Header part, and a trigger that is not inside a heading is\n invisible to a screen reader's heading list — so the other three wrap\n it themselves and so does this. It carries no scope or part, because\n it is not one of Ark's.\n -->\n <h3 class=\"accordion__header\">\n <button\n class=\"accordion__trigger\"\n data-scope=\"accordion\"\n data-part=\"item-trigger\"\n type=\"button\"\n [id]=\"triggerId(keyOf(item))\"\n [attr.aria-controls]=\"contentId(keyOf(item))\"\n [attr.data-controls]=\"contentId(keyOf(item))\"\n [attr.aria-expanded]=\"isOpen(keyOf(item))\"\n [attr.data-state]=\"stateOf(keyOf(item))\"\n [attr.data-focus]=\"flag(focusedValue() === keyOf(item))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-ownedby]=\"rootId\"\n [disabled]=\"isDisabled(item)\"\n (click)=\"toggle(item)\"\n (focus)=\"onTriggerFocus(keyOf(item))\"\n (blur)=\"onTriggerBlur()\"\n (keydown)=\"onKeydown($event, keyOf(item))\"\n >\n <span class=\"accordion__title\">{{ item.title }}</span>\n <span uioIcon class=\"accordion__icon\" [name]=\"glyph('chevron-down')\" [size]=\"ICON_SIZE\"></span>\n </button>\n </h3>\n <div\n class=\"accordion__panel text-default-body-medium\"\n data-scope=\"accordion\"\n data-part=\"item-content\"\n data-collapsible\n role=\"region\"\n [id]=\"contentId(keyOf(item))\"\n [attr.aria-labelledby]=\"triggerId(keyOf(item))\"\n [attr.data-state]=\"isOpen(keyOf(item)) ? null : 'closed'\"\n [attr.data-disabled]=\"flag(isDisabled(item))\"\n [attr.data-focus]=\"flag(focusedValue() === keyOf(item))\"\n [attr.data-orientation]=\"orientation()\"\n [attr.hidden]=\"isOpen(keyOf(item)) ? null : ''\"\n >\n <div class=\"accordion__content\">\n @if (asTemplate(item.content); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ item.content }}\n }\n </div>\n </div>\n </div>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioAccordion extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"accordion\";\n readonly part = \"root\";\n\n readonly items = input<readonly AccordionItem[]>([]);\n /** The open items. Uncontrolled until something binds it — see `UioSwitch`. */\n readonly value = model<readonly (string | number)[] | undefined>(undefined);\n readonly multiple = input(true, { transform: booleanAttribute });\n readonly variant = input<AccordionVariant>(\"default\");\n readonly size = input<AccordionSize>(\"md\");\n /**\n * Not an override of the base's `disabled`, deliberately.\n *\n * `UioPart` binds `data-disabled` from that signal, and Ark's accordion **root**\n * reports no such attribute — only the items and their parts do. Overriding it\n * would put `data-disabled` on the root of every disabled accordion, which no\n * other library emits and which `.accordion--*` rules would then be free to\n * pick up. Same split, for the same reason, as `UioSwitch`'s `disabledInput`.\n */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n readonly valueChange = output<string[]>();\n\n /**\n * Fixed, not an input: the shared stylesheet lays an accordion out in one\n * direction only, and Ark's horizontal orientation would need rules none of\n * the four libraries ship. Declared anyway because every part reports it.\n */\n override readonly orientation: Signal<\"vertical\"> = signal(\"vertical\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly ICON_SIZE = ICON_SIZE;\n protected readonly flag = stateFlag;\n protected readonly hostClass = computed(() =>\n accordionStyles({ variant: this.variant(), size: this.size() }),\n );\n\n private readonly open = computed(\n () => new Set((this.value() ?? []).map((entry) => String(entry))),\n );\n\n /** Cleared on blur, unlike Tabs — Zag's accordion does not test `relatedTarget`. */\n private readonly focusedTab = signal<string | null>(null);\n readonly focusedValue: Signal<string | null> = this.focusedTab;\n\n /** Ark builds every id as `<scope>:<machine>:<part>` — see the class note. */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `accordion:${this.machine}`;\n }\n protected itemId(value: string): string {\n return `collapsible:accordion:${this.machine}:item:${value}`;\n }\n protected triggerId(value: string): string {\n return `accordion:${this.machine}:trigger:${value}`;\n }\n protected contentId(value: string): string {\n return `accordion:${this.machine}:content:${value}`;\n }\n\n protected keyOf(item: AccordionItem): string {\n return String(item.value);\n }\n protected isOpen(value: string): boolean {\n return this.open().has(value);\n }\n protected stateOf(value: string): \"open\" | \"closed\" {\n return this.isOpen(value) ? \"open\" : \"closed\";\n }\n /**\n * `??`, not `||`. Zag reads `props.disabled ?? prop(\"disabled\")`, so an item\n * that says `disabled: false` stays enabled inside a disabled accordion — and\n * an item that says nothing inherits. `||` would collapse the two.\n */\n protected isDisabled(item: AccordionItem): boolean {\n return item.disabled ?? this.disabledInput();\n }\n protected asTemplate(content: AccordionItem[\"content\"]): TemplateRef<unknown> | null {\n return content instanceof TemplateRef ? content : null;\n }\n\n protected toggle(item: AccordionItem): void {\n if (this.isDisabled(item)) return;\n const value = this.keyOf(item);\n const open = this.open();\n let next: string[];\n if (open.has(value)) {\n // Closing is always allowed. React passes `collapsible: !multiple` so that\n // single mode keeps the \"click the open one to close it\" behaviour Zag\n // implies for multiple mode; with both branches written out there is no\n // flag to get backwards.\n next = this.multiple() ? [...open].filter((entry) => entry !== value) : [];\n } else {\n next = this.multiple() ? [...open, value] : [value];\n }\n this.value.set(next);\n this.valueChange.emit(next);\n flushNow(this.appRef);\n }\n\n protected onTriggerFocus(value: string): void {\n this.focusedTab.set(value);\n flushNow(this.appRef);\n }\n protected onTriggerBlur(): void {\n this.focusedTab.set(null);\n flushNow(this.appRef);\n }\n\n /**\n * Arrow keys move focus between triggers, wrapping and skipping disabled ones.\n *\n * On the trigger rather than on the root, which is where Zag binds it: the\n * panel of an open item is inside the root too, and a root-level handler would\n * swallow an ArrowDown a user pressed inside the panel's own content.\n */\n protected onKeydown(event: KeyboardEvent, value: string): void {\n const move = ((): number | \"home\" | \"end\" | null => {\n switch (event.key) {\n case \"ArrowDown\":\n return 1;\n case \"ArrowUp\":\n return -1;\n case \"Home\":\n return \"home\";\n case \"End\":\n return \"end\";\n default:\n return null;\n }\n })();\n if (move === null) return;\n event.preventDefault();\n\n const items = this.items();\n const navigable = items.map((item) => ({ disabled: this.isDisabled(item) }));\n // -1 is `moveHighlight`'s \"nothing highlighted yet\": Home and End start from\n // the far end and walk to the first enabled trigger.\n const from = move === \"home\" || move === \"end\" ? -1 : this.indexOf(value);\n const step = move === \"home\" ? 1 : move === \"end\" ? -1 : move;\n const next = moveHighlight(navigable, from, step);\n if (next === -1) return;\n // Focus only. Zag's accordion has no automatic activation — arrowing moves\n // between headers and Enter opens the one you land on, which is the APG's\n // rule and the opposite of Tabs.\n this.triggerElements()[next]?.focus();\n }\n\n private indexOf(value: string): number {\n return this.items().findIndex((item) => this.keyOf(item) === value);\n }\n\n /** Index-aligned with `items()`, because one `@for` renders both. */\n private triggerElements(): HTMLElement[] {\n return [\n ...this.host.nativeElement.querySelectorAll<HTMLElement>('[data-part=\"item-trigger\"]'),\n ];\n }\n}\n","import { Overlay, type OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n EnvironmentInjector,\n Injectable,\n OnDestroy,\n inject,\n signal,\n type ComponentRef,\n type Signal,\n} from \"@angular/core\";\nimport { toastStyles } from \"@ui-organized/core\";\nimport { stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { applyOverlayStacking } from \"../overlay/stacking.js\";\nimport { createSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph, type IconGlyph } from \"../icons/glyph.js\";\nimport type { SystemGlyph } from \"@ui-organized/core\";\n\n/** Drives the accent color and the icon. Set through `add({ type })`. */\nexport type ToastStatus = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface ToastAction {\n label: string;\n onClick?: () => void;\n}\n\nexport interface ToastOptions {\n title?: string;\n description?: string;\n /**\n * Free-form, and reported verbatim as `data-type`.\n *\n * Only the four statuses pick an accent and an icon; anything else falls back\n * to `info` for the styling while keeping its own word on the attribute. That\n * split is Zag's and it is deliberate — an application may key its own CSS off\n * `[data-type=\"deploy-finished\"]` without the library having to know about it.\n */\n type?: string;\n /** Auto-dismiss after this many ms. `Infinity` keeps it until it is closed. */\n duration?: number;\n /** An inline button, e.g. \"Undo\". Dismisses the toast when pressed. */\n action?: ToastAction;\n /** Supply one to update an existing toast rather than adding another. */\n id?: string;\n}\n\n/**\n * The toaster's own settings, fixed rather than injected.\n *\n * The React library builds its module-level toaster with exactly these, and a\n * toast that appeared bottom-right in three libraries and top-left in the fourth\n * would be a difference no test in this repo is looking for. When there is a\n * reason to vary them it should be varied in all four at once.\n */\nconst PLACEMENT = \"bottom-end\";\nconst SIDE = \"bottom\";\nconst ALIGN = \"end\";\nconst DEFAULT_DURATION = 5000;\n/** How long a dismissed toast stays in the DOM so its exit transition can run. */\nconst REMOVE_DELAY = 200;\nconst ICON_SIZE = 20;\n\n/**\n * The hotkey Zag names in the region's accessible label.\n *\n * Reproduced as a string rather than implemented: the label is part of the\n * rendered contract and the parity gate compares it, while the shortcut itself\n * is a document-level listener that would be the fourth library on a page\n * fighting for alt+T. Named here so that whoever adds the listener finds the\n * label already waiting for it.\n */\nconst REGION_LABEL = `Notifications, ${PLACEMENT} (alt+T)`;\n\nconst STATUS_ICON: Record<ToastStatus, SystemGlyph> = {\n info: \"info\",\n success: \"check-circle\",\n warning: \"alert-triangle\",\n error: \"alert-circle\",\n};\n\nfunction resolveStatus(type: string | undefined): ToastStatus {\n return type === \"success\" || type === \"warning\" || type === \"error\" ? type : \"info\";\n}\n\n/** One live toast, as the region renders it. */\nexport interface ToastRecord {\n id: string;\n title?: string;\n description?: string;\n type: string;\n status: ToastStatus;\n action?: ToastAction;\n duration: number;\n /** `open` until it is dismissed; `closed` for the exit transition. */\n state: \"open\" | \"closed\";\n /** Lands a frame after the element exists — see `UioToaster.add`. */\n mounted: boolean;\n paused: boolean;\n}\n\ninterface Timer {\n handle: ReturnType<typeof setTimeout>;\n startedAt: number;\n remaining: number;\n}\n\n/**\n * Toasts, from anywhere, with no markup to place.\n *\n * ```ts\n * const toaster = inject(UioToaster);\n * toaster.add({ title: \"Saved\", description: \"Your changes are live.\", type: \"success\" });\n * ```\n *\n * ── Why this is a root service and not a `<uio-toast-provider>` ─────────────\n *\n * The other three libraries build one `createToaster()` at module scope and hand\n * it to a `<Toaster>` the application places in its tree. Two things have to be\n * true for that: the imperative handle must be reachable from any file, and the\n * region must have somewhere to render.\n *\n * A module-level singleton would satisfy the first here too, and it is the wrong\n * answer in Angular — it is a global that no test can replace, that survives\n * between test cases in the same process, and that is invisible to the injector\n * everything else in this library is reached through. `providedIn: \"root\"` *is*\n * Angular's module-level singleton, with an injector around it: one instance per\n * application, swappable in a `TestBed`, and disposed with the application.\n *\n * The second — somewhere to render — is what the CDK overlay is for, and it is\n * why this needs no provider component at all. The region is created into an\n * overlay the first time a toast is added, so an application that never toasts\n * renders nothing and an application that does needs no markup. That is a real\n * difference from React, where `<ToastProvider>` renders an empty region from\n * first paint; it is the same difference `MatSnackBar` has, and it is the reason\n * this API is one import instead of an import plus a wrapper component.\n *\n * ── What it does *not* take from the overlay layer ──────────────────────────\n *\n * `pushLayer` from `overlay/dismiss.ts` is deliberately not used. That stack\n * routes Escape and outside clicks to the *topmost* surface, which is right for\n * a menu and wrong for a toast: a toast is not modal, it does not take focus,\n * and an Escape meant for the dialog underneath it must not be swallowed. Zag\n * puts the Escape handler on the toast's own root, where it fires only when the\n * toast itself has focus, and so does this.\n */\n@Injectable({ providedIn: \"root\" })\nexport class UioToaster implements OnDestroy {\n private readonly overlay = inject(Overlay);\n private readonly injector = inject(EnvironmentInjector);\n private readonly appRef = inject(ApplicationRef);\n\n /** Newest first, as Zag's store unshifts. The region renders them in order. */\n private readonly records = signal<readonly ToastRecord[]>([]);\n readonly toasts: Signal<readonly ToastRecord[]> = this.records.asReadonly();\n\n private overlayRef?: OverlayRef;\n private region?: ComponentRef<UioToastRegion>;\n private readonly timers = new Map<string, Timer>();\n private readonly frames = new Map<string, number>();\n\n /**\n * Show a toast. Returns its id, for `close` and `update`.\n *\n * The manager surface is React's — `add`/`close`/`update` — rather than Ark's\n * `create`/`dismiss`/`update`, because the React library already chose those\n * names when it wrapped Base UI and four libraries with three spellings would\n * be worse than one shared spelling that happens to be nobody's default.\n */\n add(options: ToastOptions): string {\n const id = options.id ?? `toast:${nextMachineId()}`;\n if (this.records().some((toast) => toast.id === id)) {\n this.update(id, options);\n return id;\n }\n\n this.ensureRegion();\n const record = this.toRecord(id, options);\n this.records.update((toasts) => [record, ...toasts]);\n this.startTimer(record);\n\n /**\n * `data-mounted` a frame later, exactly as Zag's `setMounted` does.\n *\n * It is what an entrance transition keys off: the element has to exist at its\n * \"before\" state for one frame or the browser has nothing to animate from.\n * Anything reading the DOM the instant a toast opens therefore sees\n * `data-state=\"open\"` without it — which is a real race the browser parity\n * gate had to learn to wait for, not a detail.\n */\n this.frames.set(\n id,\n requestAnimationFrame(() => {\n this.frames.delete(id);\n this.patch(id, { mounted: true });\n this.sync();\n }),\n );\n\n this.sync();\n return id;\n }\n\n /** Begin dismissing a toast. It leaves the DOM after its exit transition. */\n close(id: string): void {\n if (!this.records().some((toast) => toast.id === id)) return;\n this.clearTimer(id);\n this.patch(id, { state: \"closed\" });\n setTimeout(() => this.remove(id), REMOVE_DELAY);\n this.sync();\n }\n\n /** Dismiss every toast at once. */\n closeAll(): void {\n for (const toast of this.records()) this.close(toast.id);\n }\n\n /**\n * Replace a live toast's content in place.\n *\n * The auto-dismiss timer restarts, which is Zag's behaviour (`UPDATE` runs\n * `resetCloseTimer`) and the only sensible one: an update is new information,\n * and leaving the old countdown running would hide it after the time the\n * *previous* message had already spent on screen.\n */\n update(id: string, options: ToastOptions): void {\n const current = this.records().find((toast) => toast.id === id);\n if (!current) return;\n const next = this.toRecord(id, { ...this.toOptions(current), ...options });\n // Neither is content: a toast being updated has already appeared, and\n // re-arming `mounted` would replay its entrance animation.\n next.mounted = current.mounted;\n next.paused = current.paused;\n this.records.update((toasts) => toasts.map((toast) => (toast.id === id ? next : toast)));\n this.clearTimer(id);\n if (!next.paused) this.startTimer(next);\n this.sync();\n }\n\n /**\n * Hold every countdown while the pointer or focus is inside the region.\n *\n * A toast that disappears mid-sentence is the complaint this prevents, and it\n * is the one piece of a toaster that cannot be expressed as markup: the\n * remaining time has to be banked when the timer is cleared, or resuming would\n * restart every toast at its full duration.\n */\n pause(): void {\n const now = Date.now();\n for (const toast of this.records()) {\n // Already paused is not a no-op by accident: the region pauses on pointer\n // *and* on focus, and both fire when a user tabs into a toast they are\n // already hovering. Without this the second call would bank the same\n // elapsed time twice and swallow the rest of the countdown.\n if (toast.paused) continue;\n const timer = this.timers.get(toast.id);\n if (!timer) continue;\n clearTimeout(timer.handle);\n this.timers.set(toast.id, {\n ...timer,\n remaining: Math.max(0, timer.remaining - (now - timer.startedAt)),\n });\n this.patch(toast.id, { paused: true });\n }\n this.sync();\n }\n\n resume(): void {\n for (const toast of this.records()) {\n if (!toast.paused) continue;\n const timer = this.timers.get(toast.id);\n if (!timer) continue;\n this.timers.delete(toast.id);\n this.startTimer({ ...toast, duration: timer.remaining });\n this.patch(toast.id, { paused: false });\n }\n this.sync();\n }\n\n ngOnDestroy(): void {\n for (const timer of this.timers.values()) clearTimeout(timer.handle);\n this.timers.clear();\n for (const frame of this.frames.values()) cancelAnimationFrame(frame);\n this.frames.clear();\n this.region?.destroy();\n this.overlayRef?.dispose();\n }\n\n private toRecord(id: string, options: ToastOptions): ToastRecord {\n return {\n id,\n title: options.title,\n description: options.description,\n type: options.type ?? \"info\",\n status: resolveStatus(options.type),\n action: options.action,\n duration: options.duration ?? DEFAULT_DURATION,\n state: \"open\",\n mounted: false,\n paused: false,\n };\n }\n\n private toOptions(record: ToastRecord): ToastOptions {\n return {\n title: record.title,\n description: record.description,\n type: record.type,\n duration: record.duration,\n action: record.action,\n };\n }\n\n /** Changes one record. Callers `sync()` once, after however many they make. */\n private patch(id: string, changes: Partial<ToastRecord>): void {\n this.records.update((toasts) =>\n toasts.map((toast) => (toast.id === id ? { ...toast, ...changes } : toast)),\n );\n }\n\n private remove(id: string): void {\n this.records.update((toasts) => toasts.filter((toast) => toast.id !== id));\n this.sync();\n }\n\n private startTimer(record: ToastRecord): void {\n if (!Number.isFinite(record.duration)) return;\n this.timers.set(record.id, {\n handle: setTimeout(() => this.close(record.id), record.duration),\n startedAt: Date.now(),\n remaining: record.duration,\n });\n }\n\n private clearTimer(id: string): void {\n const timer = this.timers.get(id);\n if (!timer) return;\n clearTimeout(timer.handle);\n this.timers.delete(id);\n }\n\n /**\n * Push the change into the DOM now.\n *\n * `add` is called from wherever the application happens to be — an HTTP error\n * handler, a form submit — which is React's \"discrete event\" case, where the\n * update lands before the handler returns. Zoneless Angular would otherwise\n * schedule it for the next task, and anything that reads the DOM straight\n * after adding a toast (the parity gate does) would find nothing there.\n */\n private sync(): void {\n if (this.overlayRef) setSurfaceInteractive(this.overlayRef, this.records().length > 0);\n flushNow(this.appRef);\n }\n\n private ensureRegion(): void {\n if (this.overlayRef) return;\n /**\n * `createSurface`, not `overlay.create`: the CDK stamps an `id` on every pane\n * it makes, and the parity gate numbers every id in the document in order —\n * one extra shifts every placeholder after it and reports identical markup as\n * different. See `overlay/surface.ts`.\n */\n this.overlayRef = createSurface(this.overlay, {\n positionStrategy: this.overlay.position().global(),\n // Never `block()`: a toast is not modal, and the page stays scrollable\n // under it. `reposition()` would be wasted work on a fixed region.\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.region = this.overlayRef.attach(\n new ComponentPortal(UioToastRegion, null, this.injector),\n );\n // The portal creates the component but does not render it, and the stacking\n // level below is read off a *computed* style — so the group has to exist and\n // have the stylesheet applied before it is asked.\n this.region.changeDetectorRef.detectChanges();\n\n const group = this.overlayRef.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"group\"]',\n );\n /**\n * Zag writes `z-index: 2147483647` inline on the region. This takes the level\n * `.toast__viewport` itself declares instead — the same mechanism every other\n * surface in this package uses, and the one that keeps the design system's\n * scale the single source of the answer. `--z-index-toast` is already above\n * `--z-index-dialog`, so a toast still paints over a modal; what it no longer\n * does is paint over a consumer's own top-level chrome by claiming the\n * largest number there is.\n */\n if (group) applyOverlayStacking(this.overlayRef.overlayElement, group);\n // A region with no toasts in it must not swallow clicks on the page beneath.\n setSurfaceInteractive(this.overlayRef, false);\n }\n}\n\n/**\n * The region every toast is rendered into.\n *\n * Created by `UioToaster` into a CDK overlay; never placed by hand, which is why\n * it takes no inputs — it reads the service directly. That also sidesteps the\n * JIT limitation the rest of this package works around, since there is no input\n * for a JIT-compiled template to fail to bind.\n *\n * ── Why the host element is not the group ───────────────────────────────────\n *\n * Ark renders the region as a `<div>`, and the parity gate compares tag names.\n * An Angular component's host element is named by its selector, so making the\n * host *be* the group would render `<uio-toast-region data-part=\"group\">` and\n * differ from all three other libraries on the one attribute-free property they\n * all agree on. The host stays an empty wrapper inside the overlay pane, where\n * it is outside the compared region and carries no id to renumber.\n */\n@Component({\n selector: \"uio-toast-region\",\n standalone: true,\n imports: [UioIcon],\n template: `\n <div\n class=\"toast__viewport\"\n data-scope=\"toast\"\n data-part=\"group\"\n role=\"region\"\n tabindex=\"-1\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n aria-atomic=\"false\"\n [id]=\"GROUP_ID\"\n [attr.aria-label]=\"REGION_LABEL\"\n [attr.data-placement]=\"PLACEMENT\"\n [attr.data-side]=\"SIDE\"\n [attr.data-align]=\"ALIGN\"\n [attr.style]=\"GROUP_STYLE\"\n (pointerenter)=\"toaster.pause()\"\n (pointerleave)=\"toaster.resume()\"\n (focusin)=\"toaster.pause()\"\n (focusout)=\"toaster.resume()\"\n >\n @for (toast of toaster.toasts(); track toast.id; let index = $index) {\n <div\n [class]=\"rootClass(toast)\"\n data-scope=\"toast\"\n data-part=\"root\"\n role=\"status\"\n aria-atomic=\"true\"\n tabindex=\"0\"\n data-stack\n [id]=\"rootId(toast)\"\n [attr.data-state]=\"toast.state\"\n [attr.data-type]=\"toast.type\"\n [attr.data-placement]=\"PLACEMENT\"\n [attr.data-side]=\"SIDE\"\n [attr.data-align]=\"ALIGN\"\n [attr.data-mounted]=\"flag(toast.mounted)\"\n [attr.data-paused]=\"flag(toast.paused)\"\n [attr.data-first]=\"flag(index === 0)\"\n [attr.data-sibling]=\"flag(index !== 0)\"\n [attr.aria-labelledby]=\"toast.title ? titleId(toast) : null\"\n [attr.aria-describedby]=\"toast.description ? descriptionId(toast) : null\"\n [attr.style]=\"ROOT_STYLE\"\n (keydown)=\"onKeydown($event, toast)\"\n >\n <!--\n The two ghosts are Zag's, and they are not decoration: the one behind\n the toast keeps the pointer \"inside\" while the toast transitions out,\n and the one above it bridges the gap to the next toast so that moving\n between two of them never reads as leaving the stack. Both are part of\n the rendered contract, so both are here.\n -->\n <div data-ghost=\"before\" [attr.style]=\"GHOST_BEFORE\"></div>\n <span class=\"toast__icon\">\n <span uioIcon [name]=\"iconFor(toast)\" [size]=\"ICON_SIZE\"></span>\n </span>\n <div class=\"toast__content\">\n <div\n class=\"toast__title text-strong-body-medium\"\n data-scope=\"toast\"\n data-part=\"title\"\n [id]=\"titleId(toast)\"\n >{{ toast.title }}</div>\n <div\n class=\"toast__description text-default-body-medium\"\n data-scope=\"toast\"\n data-part=\"description\"\n [id]=\"descriptionId(toast)\"\n >{{ toast.description }}</div>\n </div>\n @if (toast.action; as action) {\n <button\n class=\"toast__action text-emphasis-body-small\"\n data-scope=\"toast\"\n data-part=\"action-trigger\"\n type=\"button\"\n (click)=\"act(toast, action)\"\n >{{ action.label }}</button>\n }\n <button\n class=\"toast__close\"\n data-scope=\"toast\"\n data-part=\"close-trigger\"\n type=\"button\"\n aria-label=\"Dismiss\"\n [id]=\"closeId(toast)\"\n (click)=\"toaster.close(toast.id)\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"ICON_SIZE\"></span>\n </button>\n <div data-ghost=\"after\" [attr.style]=\"GHOST_AFTER\"></div>\n </div>\n }\n </div>\n `,\n})\nexport class UioToastRegion {\n protected readonly glyph = glyph;\n protected readonly toaster = inject(UioToaster);\n\n protected readonly PLACEMENT = PLACEMENT;\n protected readonly SIDE = SIDE;\n protected readonly ALIGN = ALIGN;\n protected readonly REGION_LABEL = REGION_LABEL;\n protected readonly ICON_SIZE = ICON_SIZE;\n /** Placement-derived, like Zag's, so two regions could never collide. */\n protected readonly GROUP_ID = `toast-group:${PLACEMENT}`;\n\n /**\n * The layout Zag writes inline, reduced to what this design system's rules\n * actually need.\n *\n * `.toast__viewport` sets `bottom`, `right` and `z-index` but no `position`, so\n * without at least `position: fixed` here the region would sit wherever the\n * overlay pane put it — top-left — with three correct offsets doing nothing.\n *\n * What is *not* reproduced is Zag's stacking choreography: it positions every\n * toast absolutely and drives `--y`, `--offset` and `--index` from measured\n * heights, and none of those variables appear anywhere in `Toast.css`. A flex\n * column with the stylesheet's own `--gap` puts the toasts in the same corner\n * out of the layout engine instead of out of a `ResizeObserver`.\n * `column-reverse` because the list is newest-first, and the newest toast\n * belongs nearest the corner.\n *\n * It is the same *placement*, not the same *picture*, and this comment used to\n * claim otherwise. The parity harness's visual gate measured it: with two\n * toasts up, React collapses the stack — both at the same `y`, the front one\n * covering the rest — and this lays them out in flow, 187px apart. Reproducing\n * the collapse means reproducing the measured-height choreography, which is\n * real work and is recorded as accepted drift in\n * `tooling/parity/browser/visual.browser.spec.ts` rather than pretended away.\n */\n protected readonly GROUP_STYLE =\n \"position: fixed; display: flex; flex-direction: column-reverse; \" +\n \"align-items: flex-end; gap: var(--gap);\";\n /** Only so the two absolutely-positioned ghosts are measured against it. */\n protected readonly ROOT_STYLE = \"position: relative;\";\n protected readonly GHOST_BEFORE =\n \"position: absolute; inset: 0px; scale: 1 2; pointer-events: none;\";\n protected readonly GHOST_AFTER =\n \"position: absolute; left: 0px; height: calc(var(--gap) + 2px); bottom: 100%; width: 100%;\";\n\n /**\n * The same presence-only encoding every other part in this library uses:\n * `[data-mounted]` matches `=\"false\"` too, so the natural Angular spelling\n * would mark every unmounted toast as mounted.\n */\n protected readonly flag = stateFlag;\n\n protected rootClass(toast: ToastRecord): string {\n return toastStyles({ status: toast.status });\n }\n protected iconFor(toast: ToastRecord): IconGlyph {\n return glyph(STATUS_ICON[toast.status]);\n }\n\n /**\n * Zag's ids, including the one that is missing a colon.\n *\n * `getCloseTriggerId` is `toast${id}:close` where every sibling is\n * `toast:${id}:…`. It is upstream's typo and it is upstream's contract;\n * \"fixing\" it here would be the fourth library rendering a different id from\n * the other three for no gain.\n */\n protected rootId(toast: ToastRecord): string {\n return `toast:${toast.id}`;\n }\n protected titleId(toast: ToastRecord): string {\n return `toast:${toast.id}:title`;\n }\n protected descriptionId(toast: ToastRecord): string {\n return `toast:${toast.id}:description`;\n }\n protected closeId(toast: ToastRecord): string {\n return `toast${toast.id}:close`;\n }\n\n protected act(toast: ToastRecord, action: ToastAction): void {\n action.onClick?.();\n this.toaster.close(toast.id);\n }\n\n /**\n * Escape closes the toast that has focus, and only that one.\n *\n * On the root rather than on the document: `overlay/dismiss.ts` would route\n * every Escape on the page to the newest toast, including one a user pressed to\n * close the dialog the toast happens to be sitting over.\n */\n protected onKeydown(event: KeyboardEvent, toast: ToastRecord): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n event.preventDefault();\n this.toaster.close(toast.id);\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport { Component, TemplateRef, computed, input } from \"@angular/core\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\n/** The icon size every library asks `Icon` for inside a crumb. */\nconst ICON_SIZE = 16;\n\nexport interface BreadcrumbItem {\n /** Visible label for the crumb. */\n label: string;\n /** Link target. Omit on the current (last) crumb. */\n href?: string;\n /** Optional leading icon. */\n icon?: IconName | IconGlyph;\n}\n\n/**\n * A trail of links showing the current page's location in a hierarchy.\n *\n * ```html\n * <nav uioBreadcrumb [items]=\"trail\"></nav>\n * ```\n *\n * Ark UI has no Breadcrumb primitive, so there is no machine behind this in any\n * of the four libraries and the markup *is* the contract — compared element for\n * element against React by the browser parity gate. It therefore does not extend\n * `UioPart`, for the same reason `UioToolbar` does not: a React breadcrumb\n * carries no `data-scope`/`data-part`, so neither may this one.\n *\n * ── The last crumb is the current page even when it has an href ─────────────\n *\n * The one branch where the two conditions disagree, and the one worth stating:\n * a trailing crumb that carries a link still renders as text, because it is the\n * page the user is already on and nobody would follow it. `aria-current=\"page\"`\n * goes on that crumb alone — a crumb with no href in the *middle* of the trail\n * is neither a link nor the current page, and carries neither.\n */\n@Component({\n selector: \"nav[uioBreadcrumb]\",\n standalone: true,\n imports: [NgTemplateOutlet, UioIcon],\n template: `\n <ol class=\"breadcrumb__list\">\n @for (item of items(); track $index; let index = $index) {\n <li class=\"breadcrumb__item\">\n @if (item.href && !isLast(index)) {\n <a [href]=\"item.href\" class=\"breadcrumb__link\">\n @if (item.icon; as name) {\n <span uioIcon class=\"breadcrumb__icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n {{ item.label }}\n </a>\n } @else {\n <span\n class=\"breadcrumb__current\"\n [attr.aria-current]=\"isLast(index) ? 'page' : null\"\n >\n @if (item.icon; as name) {\n <span uioIcon class=\"breadcrumb__icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n {{ item.label }}\n </span>\n }\n @if (!isLast(index)) {\n <span class=\"breadcrumb__separator\" aria-hidden=\"true\">\n @if (separatorTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else if (separator() !== undefined) {\n {{ separator() }}\n } @else {\n <span uioIcon [name]=\"glyph('chevron-right')\" [size]=\"ICON_SIZE\"></span>\n }\n </span>\n }\n </li>\n }\n </ol>\n `,\n host: {\n class: \"breadcrumb text-default-body-medium\",\n \"aria-label\": \"Breadcrumb\",\n },\n})\nexport class UioBreadcrumb {\n protected readonly glyph = glyph;\n /** The crumb trail, ordered from root to current page. */\n readonly items = input<readonly BreadcrumbItem[]>([]);\n /**\n * Custom separator between crumbs. Defaults to a chevron icon.\n *\n * A string, or a template for anything richer — the same fork `TabItem.content`\n * takes, and the Angular answer to React's `separator?: ReactNode` and Vue's\n * `#separator` slot.\n */\n readonly separator = input<string | TemplateRef<unknown> | undefined>(undefined);\n\n protected readonly ICON_SIZE = ICON_SIZE;\n\n protected readonly separatorTemplate = computed(() => {\n const separator = this.separator();\n return separator instanceof TemplateRef ? separator : null;\n });\n\n protected isLast(index: number): boolean {\n return index === this.items().length - 1;\n }\n}\n","import {\n DOCUMENT,\n Directive,\n ElementRef,\n afterEveryRender,\n inject,\n input,\n} from \"@angular/core\";\nimport { UioMenubarContext } from \"./menubar-context.js\";\n\nexport type MenubarOrientation = \"horizontal\" | \"vertical\";\n\n/** How the bar finds its own triggers. Written by `UioMenuTrigger` when it finds this bar. */\nconst ITEM = \"[data-menubar-item]\";\n\n/**\n * A row of menus that behaves as one control.\n *\n * ```html\n * <div uioMenubar>\n * <button uioMenuTrigger [menu]=\"file\" class=\"menubar__trigger\">File</button>\n * <uio-menu #file=\"uioMenu\">\n * <div uioMenuItem value=\"new\">New</div>\n * </uio-menu>\n *\n * <button uioMenuTrigger [menu]=\"edit\" class=\"menubar__trigger\">Edit</button>\n * <uio-menu #edit=\"uioMenu\">\n * <div uioMenuItem value=\"undo\">Undo</div>\n * </uio-menu>\n * </div>\n * ```\n *\n * Ark UI has no Menubar primitive and the menus inside are independent overlays,\n * so the bar supplies the part a menubar owns and a lone menu cannot: its\n * triggers are menuitems (see {@link UioMenubarContext}) and arrow keys move\n * between them as one tab stop. Opening a menu and navigating within it is still\n * each menu's own business.\n *\n * Like `UioToolbar` it does **not** extend `UioPart` — no library has a machine\n * behind the bar itself, so no `data-scope`/`data-part` belongs on it — while\n * `data-orientation` is bound directly because `Menubar.css` switches the flex\n * direction on it.\n *\n * ── Why the roving tabindex is written onto the DOM ─────────────────────────\n *\n * A menubar is a single tab stop: exactly one trigger is `tabindex=\"0\"` and the\n * rest are `-1`, and the arrow keys move both the focus and that zero. The\n * triggers belong to separate `UioMenu`s that the bar has no handle on, and they\n * are the caller's own elements rather than anything this directive renders, so\n * there is no binding to drive — the attribute is set imperatively, exactly as\n * React does it from an effect and Vue from `onMounted`/`onUpdated`.\n *\n * `[data-menubar-item]`, not `[role=\"menuitem\"]`: a menu whose content is\n * rendered *into* the bar — a docs preview containing its own overlays — would\n * otherwise put that menu's own items in range, and Home would jump into a\n * dropdown.\n */\n@Directive({\n selector: \"div[uioMenubar]\",\n standalone: true,\n providers: [UioMenubarContext],\n host: {\n class: \"menubar\",\n role: \"menubar\",\n \"[attr.aria-orientation]\": \"orientation()\",\n \"[attr.data-orientation]\": \"orientation()\",\n \"(keydown)\": \"onKeydown($event)\",\n \"(focusin)\": \"onFocusin($event)\",\n },\n})\nexport class UioMenubar {\n readonly orientation = input<MenubarOrientation>(\"horizontal\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Injected rather than global, like every other part of this library. */\n private readonly document = inject(DOCUMENT);\n\n constructor() {\n /**\n * `afterEveryRender`, not a one-shot hook: a menu added to the bar arrives\n * with the browser's default tabindex and would become a second tab stop.\n * React re-runs its effect on `children` and Vue re-roves in `onUpdated` for\n * the same reason. The work is a `querySelectorAll` over a handful of\n * triggers, and it writes DOM properties that no binding owns, so it cannot\n * loop change detection.\n */\n afterEveryRender(() => this.rove());\n }\n\n private triggers(): HTMLElement[] {\n return [...this.host.nativeElement.querySelectorAll<HTMLElement>(ITEM)];\n }\n\n /**\n * Make `focused` the bar's single tab stop, defaulting to whichever trigger\n * already holds it and falling back to the first.\n *\n * Keeping the existing zero matters: re-roving on every render would otherwise\n * drag the tab stop back to \"File\" every time anything in the bar re-rendered,\n * including the menu the user had just arrowed to and opened.\n */\n private rove(focused?: HTMLElement): void {\n const items = this.triggers();\n const active = focused ?? items.find((item) => item.tabIndex === 0) ?? items[0];\n for (const item of items) item.tabIndex = item === active ? 0 : -1;\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n // A caller's own handler is bound on their element and runs first; if it\n // handled the key itself, the bar leaves it alone.\n if (event.defaultPrevented) return;\n\n const [back, forward] =\n this.orientation() === \"vertical\"\n ? [\"ArrowUp\", \"ArrowDown\"]\n : [\"ArrowLeft\", \"ArrowRight\"];\n const items = this.triggers();\n const from = items.indexOf(this.document.activeElement as HTMLElement);\n // -1 means focus is inside an *open menu* rather than on a trigger, where\n // the arrow keys belong to that menu. Swallowing them here would break\n // navigation within every dropdown in the bar.\n if (from === -1 || items.length === 0) return;\n\n let to: number;\n if (event.key === forward) to = (from + 1) % items.length;\n else if (event.key === back) to = (from - 1 + items.length) % items.length;\n else if (event.key === \"Home\") to = 0;\n else if (event.key === \"End\") to = items.length - 1;\n else return;\n\n event.preventDefault();\n const next = items[to];\n if (!next) return;\n this.rove(next);\n next.focus();\n }\n\n /**\n * `focusin`, not `focus`.\n *\n * React's `onFocus` is its own synthetic event and *does* bubble, so the DOM\n * equivalent of the handler being ported is the bubbling one. A `focus`\n * listener on the bar fires only when the bar itself is focused and would\n * never see a trigger — the tab stop would then stay wherever it was last put,\n * and tabbing into the bar would leave the wrong trigger as the tab stop.\n */\n protected onFocusin(event: FocusEvent): void {\n const item = (event.target as HTMLElement | null)?.closest<HTMLElement>(ITEM);\n if (item) this.rove(item);\n }\n}\n","import { Directive, input } from \"@angular/core\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\n/**\n * A container grouping a set of design-system controls.\n *\n * ```html\n * <div uioToolbar>\n * <div uioToolbarGroup>\n * <button uioButton intent=\"ghost\" size=\"sm\">Bold</button>\n * <button uioButton intent=\"ghost\" size=\"sm\">Italic</button>\n * </div>\n * <div uioDivider orientation=\"vertical\"></div>\n * <button uioButton intent=\"ghost\" size=\"sm\">Link</button>\n * </div>\n * ```\n *\n * Compose it with the library's own controls — `UioButton` (use\n * `intent=\"ghost\"`), `UioInput`, and `UioDivider` (use `orientation=\"vertical\"`).\n * Match the control `size` across the children to size the toolbar.\n *\n * ── Why it does not extend `UioPart` ────────────────────────────────────────\n *\n * Ark UI has no Toolbar primitive — none of the four libraries has a machine\n * behind this — so a React toolbar carries no `data-scope`/`data-part`, and\n * neither may this one. Extending the base would stamp an identity on the\n * element that the other three do not render, and the browser parity gate\n * compares every attribute. Same reasoning as `UioButton`; the reason\n * `UioRadioGroup` opts out is a different one (its host is a wrapper *outside*\n * the ARIA role).\n *\n * `data-orientation` is emitted alongside `aria-orientation` because\n * `Toolbar.css` switches the flex direction on the data attribute; dropping it\n * leaves a vertical toolbar laid out horizontally with perfectly correct ARIA.\n * It is bound here rather than inherited from `UioPart` for the reason above.\n *\n * A directive rather than a component, and an attribute rather than an element:\n * there is nothing to project — the caller's own children are already in the\n * right place — so an `<uio-toolbar>` element would be a wrapper the other\n * three libraries do not render.\n */\n@Directive({\n selector: \"div[uioToolbar]\",\n standalone: true,\n host: {\n class: \"toolbar\",\n role: \"toolbar\",\n \"[attr.aria-orientation]\": \"orientation()\",\n \"[attr.data-orientation]\": \"orientation()\",\n },\n})\nexport class UioToolbar {\n readonly orientation = input<ToolbarOrientation>(\"horizontal\");\n}\n\n/**\n * Optional wrapper to visually cluster a subset of toolbar controls.\n *\n * `role=\"group\"` rather than nothing: a toolbar's children are announced as one\n * list, and a cluster that is a visual unit has to be one to assistive tech too.\n */\n@Directive({\n selector: \"div[uioToolbarGroup]\",\n standalone: true,\n host: { class: \"toolbar__group\", role: \"group\" },\n})\nexport class UioToolbarGroup {}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n TemplateRef,\n booleanAttribute,\n computed,\n input,\n} from \"@angular/core\";\nimport { meterStyles, type MeterVariants } from \"@ui-organized/core\";\nimport { nextMachineId } from \"../part-ids.js\";\n\nexport type MeterVariant = NonNullable<MeterVariants[\"variant\"]>;\nexport type MeterSize = NonNullable<MeterVariants[\"size\"]>;\n\n/**\n * A static measurement inside a known range — disk usage, a score, a quota.\n *\n * ```html\n * <div uioMeter [value]=\"72\" label=\"Disk usage\" showValue></div>\n * ```\n *\n * Distinct from Progress, which tracks a task and can be indeterminate; a meter\n * never can. Ark UI has no Meter primitive and none is needed — everything here\n * is `role=\"meter\"` plus the ARIA value attributes — so, like `UioToolbar`, this\n * does **not** extend `UioPart`: there is no machine behind it in any of the four\n * libraries, so no `data-scope`/`data-part` may appear on the element.\n *\n * ── The two numbers are not the same number ─────────────────────────────────\n *\n * The fill *clamps* to the range and the ARIA value does not. A meter told 140\n * out of 100 paints a full bar and still reports `aria-valuenow=\"140\"`, because\n * clamping the announced value would silently tell a screen-reader user the\n * quota is exactly full when it has been blown through. All four libraries do\n * this; it is the pair of cases most likely to be \"tidied\" into agreement.\n */\n@Component({\n selector: \"div[uioMeter]\",\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n @if (showHeader()) {\n <div class=\"meter__header text-default-body-small\">\n @if (hasLabel()) {\n <span class=\"meter__label\" [id]=\"labelId\">\n @if (labelTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ label() }}\n }\n </span>\n }\n @if (showValue()) {\n <span class=\"meter__value\">{{ formatted() }}</span>\n }\n </div>\n }\n <div class=\"meter__track\">\n <div class=\"meter__indicator\" [style.width.%]=\"percent()\"></div>\n </div>\n `,\n host: {\n role: \"meter\",\n \"[class]\": \"hostClass()\",\n \"[attr.aria-valuenow]\": \"value()\",\n \"[attr.aria-valuemin]\": \"min()\",\n \"[attr.aria-valuemax]\": \"max()\",\n \"[attr.aria-valuetext]\": \"formatted()\",\n /**\n * A caption wins over the caller's name rather than both being emitted, and\n * with no caption the reference is dropped rather than left dangling — a\n * dangling IDREF outranks `aria-label`, so a meter naming a label that does\n * not exist reaches a screen reader unnamed.\n */\n \"[attr.aria-labelledby]\": \"hasLabel() ? labelId : null\",\n \"[attr.aria-label]\": \"hasLabel() ? null : ariaLabel()\",\n },\n})\nexport class UioMeter {\n /**\n * The current value.\n *\n * Defaulted rather than `input.required`, which is what React's type says:\n * a required initializer-based input cannot be set at all under the JIT\n * compiler the specs in this package run under, so it would make the component\n * untestable here to express something a caller already gets from the types.\n * Zero is the honest reading of \"nothing was measured\".\n */\n readonly value = input(0);\n readonly min = input(0);\n readonly max = input(100);\n /** A string, or a template for anything richer — see `AccordionItem.content`. */\n readonly label = input<string | TemplateRef<unknown> | undefined>(undefined);\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Passed straight to `Intl.NumberFormat`, e.g. `{ style: \"percent\" }`. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n readonly variant = input<MeterVariant>(\"default\");\n readonly size = input<MeterSize>(\"md\");\n /** Only used when the meter has no visible `label`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n\n /**\n * `role=\"meter\"` needs an accessible name, and the caption is a sibling of\n * nothing — it lives inside the meter, so `aria-labelledby` has to name it by\n * id. The literal is not the contract; the parity gate numbers ids positionally.\n */\n protected readonly labelId = `meter:${nextMachineId()}:label`;\n\n protected readonly hasLabel = computed(() => this.label() != null);\n protected readonly showHeader = computed(() => this.hasLabel() || this.showValue());\n protected readonly labelTemplate = computed(() => {\n const label = this.label();\n return label instanceof TemplateRef ? label : null;\n });\n\n private readonly clamped = computed(() =>\n Math.min(Math.max(this.value(), this.min()), this.max()),\n );\n /** A zero-width range would divide by zero, so it reads as empty rather than NaN. */\n protected readonly percent = computed(() =>\n this.max() > this.min()\n ? ((this.clamped() - this.min()) / (this.max() - this.min())) * 100\n : 0,\n );\n protected readonly formatted = computed(() =>\n new Intl.NumberFormat(undefined, this.format()).format(this.value()),\n );\n\n protected readonly hostClass = computed(() =>\n meterStyles({ variant: this.variant(), size: this.size() }),\n );\n}\n","import { Component, computed, input, model, output } from \"@angular/core\";\nimport { getPageItems, withEllipsisPages } from \"@ui-organized/core\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioMenu, UioMenuItem, UioMenuTrigger } from \"../menu/menu.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/**\n * The page window, flattened into one uniform shape before it reaches the\n * template.\n *\n * A discriminated union rather than `number | Ellipsis`: `@if` compiles to a\n * real `if` in Angular's type-check block, so a `kind` field narrows the two\n * branches properly under `strictTemplates`, where narrowing an optional\n * property across a template boundary does not reliably survive a compiler\n * release.\n */\ntype PageEntry =\n | { kind: \"page\"; key: string; page: number; label: string }\n | { kind: \"gap\"; key: string; pages: number[]; label: string };\n\n/**\n * Numbered page navigation with previous/next controls, and a jump menu behind\n * each ellipsis.\n *\n * ```html\n * <nav uioPagination [(page)]=\"page\" [count]=\"20\"></nav>\n * ```\n *\n * Ark UI has no Pagination primitive, so the markup is this library's own — and\n * so, like `UioBreadcrumb`, the root carries no `data-scope`/`data-part` and\n * does not extend `UioPart`. The *window* is not ours: which numbers show and\n * where the gaps fall is pure arithmetic in `@ui-organized/core`\n * (`getPageItems` / `withEllipsisPages`), shared with every other ui-organized\n * library precisely so the four cannot drift on the edge cases — a short range\n * with no gaps, a gap exactly one page wide, the window pinned at either end.\n *\n * ── The ellipsis is a control, not decoration ───────────────────────────────\n *\n * Each gap is the only way to reach the pages it hides, so it is a real menu\n * trigger with a `UioMenu` behind it, one per gap. The menu's host element is\n * taken out of the DOM by `HostPresence` the moment it initialises, so the\n * `<li>` ends up holding the trigger alone — which is what React renders, where\n * `<Menu>` is a context provider with no element of its own.\n *\n * Where React takes an `onPageChange` callback, this is a `model()`: `[(page)]`\n * for two-way binding, `(pageChange)` for the one-way notification.\n */\n@Component({\n selector: \"nav[uioPagination]\",\n standalone: true,\n imports: [UioButton, UioMenu, UioMenuTrigger, UioMenuItem],\n template: `\n <ul class=\"pagination__list\">\n @if (showPrevNext()) {\n <li>\n <button\n uioButton\n intent=\"ghost\"\n [icon]=\"glyph('chevron-left')\"\n aria-label=\"Previous page\"\n [disabled]=\"page() <= 1\"\n (click)=\"goTo(page() - 1)\"\n ></button>\n </li>\n }\n @for (entry of entries(); track entry.key) {\n <li>\n @if (entry.kind === \"page\") {\n <button\n type=\"button\"\n class=\"pagination__page text-default-body-medium\"\n [attr.aria-current]=\"entry.page === page() ? 'page' : null\"\n [attr.aria-label]=\"entry.label\"\n (click)=\"goTo(entry.page)\"\n >{{ entry.page }}</button>\n } @else {\n <button\n uioMenuTrigger\n type=\"button\"\n class=\"pagination__ellipsis\"\n [menu]=\"jump\"\n [attr.aria-label]=\"entry.label\"\n >\n <span aria-hidden=\"true\">…</span>\n </button>\n <uio-menu\n #jump=\"uioMenu\"\n contentClass=\"pagination__ellipsis-menu\"\n (select)=\"goTo(+$event)\"\n >\n @for (hidden of entry.pages; track hidden) {\n <div uioMenuItem [value]=\"pageValue(hidden)\">{{ hidden }}</div>\n }\n </uio-menu>\n }\n </li>\n }\n @if (showPrevNext()) {\n <li>\n <button\n uioButton\n intent=\"ghost\"\n [icon]=\"glyph('chevron-right')\"\n aria-label=\"Next page\"\n [disabled]=\"page() >= count()\"\n (click)=\"goTo(page() + 1)\"\n ></button>\n </li>\n }\n </ul>\n `,\n host: {\n class: \"pagination\",\n \"aria-label\": \"Pagination\",\n },\n})\nexport class UioPagination {\n protected readonly glyph = glyph;\n /** The current page (1-based). Uncontrolled until something binds it. */\n readonly page = model(1);\n /** Total number of pages. Defaulted rather than required — see `UioMeter.value`. */\n readonly count = input(1);\n /** Pages shown on each side of the current page. */\n readonly siblingCount = input(1);\n /** Pages always shown at the start and end. */\n readonly boundaryCount = input(1);\n /** Render the previous/next arrow controls. */\n readonly showPrevNext = input(true);\n readonly pageChange = output<number>();\n\n protected readonly entries = computed<PageEntry[]>(() =>\n withEllipsisPages(\n getPageItems(this.page(), this.count(), this.siblingCount(), this.boundaryCount()),\n ).map((item, index) => {\n if (typeof item === \"number\") {\n return {\n kind: \"page\",\n key: `page-${item}`,\n page: item,\n label: `Go to page ${item}`,\n };\n }\n const first = item.pages[0];\n const last = item.pages[item.pages.length - 1];\n return {\n kind: \"gap\",\n key: `ellipsis-${index}`,\n pages: item.pages,\n label: `Jump to a page between ${first} and ${last}`,\n };\n }),\n );\n\n /** A menu item's value is a string; the page it names is a number. */\n protected pageValue(page: number): string {\n return String(page);\n }\n\n protected goTo(page: number): void {\n this.page.set(page);\n this.pageChange.emit(page);\n }\n}\n","import { Injectable, computed, signal, type Signal } from \"@angular/core\";\n\n/**\n * Sidebar-level state shared with every `UioNavItem` below it, so one toggle\n * drives the whole rail without a `collapsed` on each item.\n *\n * ── Why it holds a *source* signal rather than a value ──────────────────────\n *\n * The obvious shape — a `WritableSignal<boolean>` the sidebar pushes into from\n * an effect — is wrong by one frame. Effects run *after* change detection, so\n * the items would render with the previous rail state and correct themselves on\n * the following pass: a collapse toggle that visibly lags a frame behind the\n * container it collapses.\n *\n * Connecting the sidebar's own signal instead makes the items read the same\n * signal the sidebar does, so there is no propagation step to be late. The\n * default source is what an item rendered outside any sidebar gets — the\n * uncollapsed shape rather than a crash.\n */\n@Injectable()\nexport class UioNavContext {\n private readonly source = signal<Signal<boolean>>(signal(false));\n\n /** Read by every `UioNavItem`. */\n readonly collapsed = computed(() => this.source()());\n\n /** Called by the container that owns the rail, from its constructor. */\n connect(source: Signal<boolean>): void {\n this.source.set(source);\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n Directive,\n TemplateRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport { navItemStyles, navSubItemStyles } from \"@ui-organized/core\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioNavContext } from \"./nav-context.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/** The sizes every library asks `Icon` for in each position. */\nconst ITEM_ICON_SIZE = 18;\nconst CARET_SIZE = 20;\nconst SUB_ICON_SIZE = 20;\nconst TOGGLE_ICON_SIZE = 20;\n\n/**\n * One sub-page in an expandable `UioNavItem`'s list.\n *\n * Data rather than a component the caller places *inside the item*, which is the\n * one shape difference from the other three libraries and is deliberate.\n * `UioNavItem` has to know whether it has sub-items *before* it renders — that\n * is what decides the caret, `aria-expanded`, `aria-controls` and the panel —\n * and a content query cannot answer that: the query populates from\n * `<ng-content>`, which lives inside the very `@if` the answer controls. Every\n * other collection in this package resolves the same problem the same way\n * (`TabItem`, `AccordionItem`, `RadioOption`, `SelectOption`).\n *\n * The button itself is still a component — {@link UioNavSubItem} — and the item\n * renders this data through it, so there is one implementation rather than two.\n * Reach for it directly to place a sub-page outside an item's list.\n */\nexport interface NavSubItem {\n /** Text label for the sub-page. */\n label: string;\n /** Optional leading icon. */\n icon?: IconName | IconGlyph;\n /** Marks this sub-page as the current page. */\n selected?: boolean;\n disabled?: boolean;\n}\n\n/**\n * A sub-page button, on its own.\n *\n * ```html\n * <button uioNavSubItem label=\"Weekly\" icon=\"chart\" selected></button>\n * ```\n *\n * `UioNavItem` renders each of its `subItems` through this, so the two spellings\n * cannot drift. Written directly it also reaches the one state the list form\n * cannot: an item suppresses its whole sub-list on a collapsed rail, so\n * `nav-sub-item--collapsed` and the `title` that replaces the hidden label are\n * only ever visible on a sub-item placed by hand.\n */\n@Component({\n selector: \"button[uioNavSubItem]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n <span uioIcon class=\"nav-sub-item__icon\" [name]=\"name\" [size]=\"SUB_ICON_SIZE\"></span>\n }\n <span class=\"nav-sub-item__label\">{{ label() }}</span>\n `,\n host: {\n type: \"button\",\n \"[class]\": \"hostClass()\",\n \"[disabled]\": \"disabled()\",\n \"[attr.aria-current]\": \"selected() ? 'page' : null\",\n // The label is out of sight on a rail, so the accessible name has to come\n // from somewhere the pointer can reach. Same trick `UioNavItem` uses.\n \"[attr.title]\": \"isCollapsed() ? label() : null\",\n },\n})\nexport class UioNavSubItem {\n /** Text label for the sub-page. */\n readonly label = input(\"\");\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n /** Marks this sub-page as the current page. */\n readonly selected = input(false, { transform: booleanAttribute });\n /**\n * Render as an icon-only rail. Tri-state: left unset it inherits the\n * surrounding `UioNavProvider`'s rail — see `UioNavItem.collapsed`.\n */\n readonly collapsed = input<boolean | undefined>(undefined);\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Optional, so a sub-item outside any sidebar renders uncollapsed. */\n private readonly nav = inject(UioNavContext, { optional: true });\n\n protected readonly SUB_ICON_SIZE = SUB_ICON_SIZE;\n\n protected readonly isCollapsed = computed(\n () => this.collapsed() ?? this.nav?.collapsed() ?? false,\n );\n\n protected readonly hostClass = computed(() =>\n clsx(\n \"text-default-body-medium\",\n navSubItemStyles({ selected: this.selected() }),\n this.isCollapsed() && \"nav-sub-item--collapsed\",\n ),\n );\n}\n\n/**\n * Shares a rail with every `UioNavItem` below it.\n *\n * `UioSidebar` provides this itself; reach for the bare provider only when\n * building a container of your own.\n *\n * ```html\n * <div uioNavProvider [collapsed]=\"rail()\">…</div>\n * ```\n *\n * A directive on the caller's own element rather than a wrapper component,\n * because React's `NavProvider` renders no element and an `<uio-nav-provider>`\n * would be one the other three libraries do not have.\n */\n@Directive({\n selector: \"[uioNavProvider]\",\n standalone: true,\n providers: [UioNavContext],\n})\nexport class UioNavProvider {\n /** Collapse all descendant nav items to an icon-only rail. */\n readonly collapsed = input(false, { transform: booleanAttribute });\n\n constructor() {\n inject(UioNavContext).connect(this.collapsed);\n }\n}\n\n/**\n * The sidebar shell: a logo region, a scrollable nav landmark, and a footer that\n * can carry the collapse toggle.\n *\n * ```html\n * <div uioSidebar collapsible logo=\"Acme\">\n * <div uioNavItem label=\"Home\" icon=\"home\" selected></div>\n * <div uioNavItem label=\"Reports\" icon=\"chart\" [subItems]=\"reports\"></div>\n * </div>\n * ```\n *\n * Ark UI has no Navigation primitive, so everything here — the landmark, the\n * collapse, the rail shared with descendants — is this library's own, and the\n * root carries no `data-scope`/`data-part`. It therefore does not extend\n * `UioPart`, for the same reason `UioToolbar` does not.\n *\n * There is no `defaultCollapsed`: `model()` is uncontrolled until something\n * binds it, so `[collapsed]=\"true\"` is both an initial value and a bound one and\n * the controlled/uncontrolled fork React implements by hand does not arise —\n * the same note `UioSwitch` carries.\n */\n@Component({\n selector: \"div[uioSidebar]\",\n standalone: true,\n exportAs: \"uioSidebar\",\n imports: [NgTemplateOutlet, UioIcon],\n providers: [UioNavContext],\n template: `\n @if (hasLogo()) {\n <div class=\"sidebar__logo\">\n @if (asTemplate(logoNode()); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ logoNode() }}\n }\n </div>\n }\n\n <nav class=\"sidebar__nav\" [attr.aria-label]=\"navLabel()\"><ng-content /></nav>\n\n @if (showFooter()) {\n <div class=\"sidebar__footer\">\n @if (footer() != null) {\n <div class=\"sidebar__footer-content\">\n @if (asTemplate(footer()); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ footer() }}\n }\n </div>\n }\n @if (collapsible()) {\n <button\n type=\"button\"\n class=\"sidebar__toggle text-default-body-medium\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-label]=\"collapsed() ? 'Expand sidebar' : 'Collapse sidebar'\"\n [attr.title]=\"collapsed() ? 'Expand' : 'Collapse'\"\n (click)=\"toggle()\"\n >\n <span\n uioIcon\n class=\"sidebar__toggle-icon\"\n [name]=\"glyph(collapsed() ? 'chevron-right' : 'chevron-left')\"\n [size]=\"TOGGLE_ICON_SIZE\"\n ></span>\n <span class=\"sidebar__toggle-label\">{{ collapsed() ? \"Expand\" : \"Collapse\" }}</span>\n </button>\n }\n </div>\n }\n `,\n host: { \"[class]\": \"hostClass()\" },\n})\nexport class UioSidebar {\n protected readonly glyph = glyph;\n /** Logo / wordmark pinned to the top. A string, or a template for markup. */\n readonly logo = input<string | TemplateRef<unknown> | undefined>(undefined);\n /** Compact mark shown when collapsed. Falls back to `logo` when omitted. */\n readonly logoCollapsed = input<string | TemplateRef<unknown> | undefined>(undefined);\n /** Footer region pinned to the bottom, above the collapse toggle. */\n readonly footer = input<string | TemplateRef<unknown> | undefined>(undefined);\n /** Accessible label for the inner nav landmark. */\n readonly navLabel = input(\"Primary\");\n /**\n * Allow collapsing to an icon-only rail. When true, a working expand/collapse\n * toggle is rendered in the footer automatically — which is why the footer\n * region can appear with no footer content in it at all.\n */\n readonly collapsible = input(false, { transform: booleanAttribute });\n readonly collapsed = model(false);\n readonly collapsedChange = output<boolean>();\n\n private readonly nav = inject(UioNavContext);\n\n protected readonly TOGGLE_ICON_SIZE = TOGGLE_ICON_SIZE;\n\n constructor() {\n // Connected rather than pushed, so descendants read this very signal and\n // never render a frame behind it — see `UioNavContext`.\n this.nav.connect(this.collapsed);\n }\n\n /** A rail has room for a mark but not a wordmark; fall back when there is no compact one. */\n protected readonly logoNode = computed(() =>\n this.collapsed() ? (this.logoCollapsed() ?? this.logo()) : this.logo(),\n );\n protected readonly hasLogo = computed(() => this.logo() != null || this.logoCollapsed() != null);\n protected readonly showFooter = computed(() => this.footer() != null || this.collapsible());\n protected readonly hostClass = computed(() =>\n clsx(\"sidebar\", this.collapsed() && \"sidebar--collapsed\"),\n );\n\n protected asTemplate(\n node: string | TemplateRef<unknown> | undefined,\n ): TemplateRef<unknown> | null {\n return node instanceof TemplateRef ? node : null;\n }\n\n protected toggle(): void {\n const next = !this.collapsed();\n this.collapsed.set(next);\n this.collapsedChange.emit(next);\n }\n}\n\n/**\n * One page in a sidebar. Give it `subItems` to make it expandable.\n *\n * ```html\n * <div uioNavItem label=\"Reports\" icon=\"chart\" [subItems]=\"reports\"></div>\n * ```\n *\n * An icon-only rail has no room for an inline sub-list, so a collapsed item\n * loses its caret, its `aria-expanded`/`aria-controls` and its panel — the state\n * most likely to be got wrong, because an item that ignored the rail renders a\n * full-width label inside a 56px column with nothing else visibly amiss.\n */\n@Component({\n selector: \"div[uioNavItem]\",\n standalone: true,\n exportAs: \"uioNavItem\",\n imports: [UioIcon, UioNavSubItem],\n template: `\n <button\n type=\"button\"\n [class]=\"triggerClass()\"\n [disabled]=\"disabled()\"\n [attr.aria-current]=\"selected() ? 'page' : null\"\n [attr.aria-expanded]=\"showSubList() ? expanded() : null\"\n [attr.aria-controls]=\"showSubList() ? subListId : null\"\n [attr.title]=\"isCollapsed() ? label() : null\"\n (click)=\"toggle()\"\n >\n <span class=\"nav-item__content\">\n @if (icon(); as name) {\n <span uioIcon class=\"nav-item__icon\" [name]=\"name\" [size]=\"ITEM_ICON_SIZE\"></span>\n }\n <span class=\"nav-item__label\">{{ label() }}</span>\n </span>\n @if (showSubList()) {\n <span\n uioIcon\n class=\"nav-item__caret\"\n [name]=\"glyph(expanded() ? 'chevron-up' : 'chevron-down')\"\n [size]=\"CARET_SIZE\"\n ></span>\n }\n </button>\n @if (showSubList()) {\n <!--\n role=\"group\", not list: the sub-items are buttons, and a list may only\n contain listitems — the mismatch is an ARIA error. What the panel\n actually is here is the disclosure the button above expands.\n -->\n <div [id]=\"subListId\" class=\"nav-item__sub-list\" role=\"group\">\n <div class=\"nav-item__sub-list-inner\">\n @for (sub of subItems(); track $index) {\n <!--\n Through the component rather than repeating its markup, so the\n placed spelling and the data one cannot drift. \"collapsed\" is\n passed explicitly rather than inherited: this item's own rail may\n differ from the provider's, and the sub-item would otherwise read\n the wrong one.\n -->\n <button\n uioNavSubItem\n [label]=\"sub.label\"\n [icon]=\"sub.icon\"\n [selected]=\"!!sub.selected\"\n [disabled]=\"!!sub.disabled\"\n [collapsed]=\"isCollapsed()\"\n ></button>\n }\n </div>\n </div>\n }\n `,\n host: { \"[class]\": \"hostClass()\" },\n})\nexport class UioNavItem {\n protected readonly glyph = glyph;\n /** Text label for the page. */\n readonly label = input(\"\");\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n /** Marks this page as the current page — the filled, emphasized appearance. */\n readonly selected = input(false, { transform: booleanAttribute });\n /**\n * Render as an icon-only rail. Tri-state: left unset it inherits the\n * surrounding `UioSidebar`'s rail, which is the whole point of the context —\n * a `false` default would pin every item open inside a collapsed sidebar.\n */\n readonly collapsed = input<boolean | undefined>(undefined);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Sub-pages shown beneath the item when expanded. Providing any makes it expandable. */\n readonly subItems = input<readonly NavSubItem[]>([]);\n /** Uncontrolled until something binds it — see `UioSidebar.collapsed`. */\n readonly expanded = model(false);\n readonly expandedChange = output<boolean>();\n\n /**\n * Optional, so an item used outside any sidebar renders uncollapsed rather\n * than throwing a `NullInjectorError` — the fallback React's `useContext`\n * default gives it for free.\n */\n private readonly nav = inject(UioNavContext, { optional: true });\n\n protected readonly ITEM_ICON_SIZE = ITEM_ICON_SIZE;\n protected readonly CARET_SIZE = CARET_SIZE;\n\n /**\n * React uses `useId()` here; the literal is not the contract, since the parity\n * gate numbers every id positionally. What is, is that the trigger's\n * `aria-controls` names the panel it opens and names nothing when there is\n * none — a dangling IDREF is the failure this drops the attribute to avoid.\n */\n protected readonly subListId = `nav-item:${nextMachineId()}:sub-list`;\n\n protected readonly isCollapsed = computed(\n () => this.collapsed() ?? this.nav?.collapsed() ?? false,\n );\n /** An icon-only rail has no room for an inline sub-list, so suppress it. */\n protected readonly showSubList = computed(\n () => this.subItems().length > 0 && !this.isCollapsed(),\n );\n\n protected readonly hostClass = computed(() =>\n clsx(\n \"nav-item\",\n this.isCollapsed() && \"nav-item--collapsed\",\n this.showSubList() && this.expanded() && \"nav-item--expanded\",\n ),\n );\n protected readonly triggerClass = computed(() =>\n clsx(\n \"text-default-body-medium\",\n navItemStyles({ selected: this.selected(), expandable: this.showSubList() }),\n ),\n );\n\n /**\n * A sub-item never carries the collapsed treatment, and that is not an\n * omission: a collapsed rail suppresses the sub-list entirely, so a collapsed\n * sub-item cannot be on screen to be styled.\n */\n protected toggle(): void {\n if (!this.showSubList()) return;\n const next = !this.expanded();\n this.expanded.set(next);\n this.expandedChange.emit(next);\n }\n}\n","import {\n ApplicationRef,\n DestroyRef,\n Injectable,\n computed,\n inject,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\n\n/** Zag's three collapsible states. `closing` is open-but-on-its-way-out. */\nexport type CollapsiblePhase = \"open\" | \"closing\" | \"closed\";\n\n/**\n * The identity and the animation state every part of a collapsible reads.\n *\n * ── Why there is a phase at all ─────────────────────────────────────────────\n *\n * A disclosure that merely toggled `hidden` would need none of this. This one\n * animates, and `Collapsible.css` animates it with **keyframes** rather than a\n * transition — `.collapsible__panel[data-state=\"open\"] { animation:\n * collapsible-down }` — because a transition cannot interpolate to `auto`. So\n * the panel has to stay in the DOM, unhidden, for the whole of its exit\n * animation, and that is a third state between open and closed.\n *\n * The keyframes interpolate to `var(--height)`, which nothing computes for\n * free: it is the panel's own measured height, written inline before the\n * animation starts. `Accordion` left that measurement out because its panel has\n * no transition to feed; here it is the whole mechanism.\n *\n * ── The attribute that is absent on purpose ─────────────────────────────────\n *\n * A **settled open** panel reports no `data-state` at all. Zag computes\n * `skip = !initial && open` and drops the attribute when it holds, so\n * `data-state=\"open\"` exists only while the enter animation is running — which\n * is exactly as long as the rule that reads it needs to apply. A port that\n * emitted a helpful permanent `data-state=\"open\"` would restart the animation on\n * every re-render and differ from all three other libraries at rest.\n *\n * `initial` is that flag: false on mount (so an `open` collapsible shows no\n * animation and no state), true from the moment something toggles it, false\n * again once the animation ends.\n */\n@Injectable()\nexport class UioCollapsibleContext {\n /** Ark builds every id as `<scope>:<machine>:<part>`, the root without a part. */\n private readonly machine = nextMachineId();\n\n get rootId(): string {\n return `collapsible:${this.machine}`;\n }\n partId(part: string): string {\n return `collapsible:${this.machine}:${part}`;\n }\n\n /**\n * Replaced wholesale by the root in its constructor. Plain properties rather\n * than signals kept in sync, for the reason `UioFieldContext.bind` gives.\n */\n disabled: Signal<boolean> = signal(false);\n\n private readonly phase = signal<CollapsiblePhase>(\"closed\");\n private readonly initial = signal(false);\n\n /** What the root and the trigger report — the target state, not the animation's. */\n readonly open = computed(() => this.phase() === \"open\");\n /** The panel is in the DOM for the whole of its exit animation. */\n readonly visible = computed(() => this.phase() !== \"closed\");\n /**\n * What the root and the trigger report.\n *\n * Always one of the two words, unlike the panel's below: only the panel drops\n * `data-state` once it has settled open, and a root that did the same would\n * take `.collapsible[data-state]` rules with it.\n */\n readonly state = computed<\"open\" | \"closed\">(() => (this.open() ? \"open\" : \"closed\"));\n /** See the class note: `null` is the settled-open case, and it is deliberate. */\n readonly contentState = computed<\"open\" | \"closed\" | null>(() => {\n const open = this.open();\n if (open && !this.initial()) return null;\n return open ? \"open\" : \"closed\";\n });\n\n private readonly appRef = inject(ApplicationRef);\n private content: HTMLElement | null = null;\n private stopTracking: (() => void) | null = null;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.stopTracking?.());\n }\n\n /**\n * Asks the root to change the open state, so a `[(open)]` binding and a click\n * on the trigger take the same path.\n *\n * A callback rather than the trigger injecting the root directly: the root's\n * `open` is a `model()` it owns, and a part reaching in to write another\n * component's model is how two sources of truth start.\n */\n request: (open: boolean) => void = () => {};\n\n /** Called by the root once, before anything can toggle. */\n bind(state: { disabled: Signal<boolean>; request: (open: boolean) => void }): void {\n this.disabled = state.disabled;\n this.request = state.request;\n }\n\n /**\n * The panel hands over its own element, because measuring it is the context's\n * job and a component cannot measure a sibling it does not know about.\n */\n bindContent(element: HTMLElement): void {\n this.content = element;\n // The keyframes read these from the first frame. Zag writes `0px` before it\n // has measured anything too, so an animation that somehow starts early\n // collapses rather than interpolating to an undefined length.\n element.style.setProperty(\"--height\", \"0px\");\n element.style.setProperty(\"--width\", \"0px\");\n }\n\n /** The mount state. No transition, so no `initial` and no animation. */\n seed(open: boolean): void {\n this.phase.set(open ? \"open\" : \"closed\");\n }\n\n setOpen(open: boolean): void {\n if (open === this.open()) return;\n this.stopTracking?.();\n this.initial.set(true);\n // Before the phase flips, so `--height` is right at the frame the keyframes\n // start rather than one frame into them. Zag measures inside a `raf` and\n // lives with that; there is no reason to reproduce the lateness.\n this.measure();\n this.phase.set(open ? \"open\" : \"closing\");\n this.trackAnimation(() => {\n if (!open) this.phase.set(\"closed\");\n this.initial.set(false);\n });\n }\n\n /**\n * The panel's laid-out size, read with the two things that would falsify it\n * turned off: it is `hidden` while closed, and it may already be mid-animation.\n * Both are restored in the same synchronous block, so the bindings that own\n * them never see the difference.\n */\n private measure(): void {\n const element = this.content;\n if (!element) return;\n const hidden = element.hidden;\n const animation = element.style.animationName;\n element.style.animationName = \"none\";\n element.hidden = false;\n const rect = element.getBoundingClientRect();\n element.hidden = hidden;\n element.style.animationName = animation;\n element.style.setProperty(\"--height\", `${rect.height}px`);\n element.style.setProperty(\"--width\", `${rect.width}px`);\n }\n\n /**\n * Run `done` when the panel's animation finishes — or immediately when there\n * is none.\n *\n * \"None\" is the case that matters: `Collapsible.css` sets `animation: none`\n * under `prefers-reduced-motion`, and a closing panel that waited for an\n * `animationend` that never comes would stay in the DOM forever. Zag makes the\n * same test, and for the same reason.\n *\n * The read has to happen after the phase has been written to the DOM, since\n * the rule that supplies the animation selects on the attribute the phase\n * produces — hence the flush and the frame.\n */\n private trackAnimation(done: () => void): void {\n const element = this.content;\n if (!element) {\n done();\n return;\n }\n flushNow(this.appRef);\n const frame = requestAnimationFrame(() => {\n const name = getComputedStyle(element).animationName;\n if (!name || name === \"none\") {\n this.stopTracking = null;\n done();\n flushNow(this.appRef);\n return;\n }\n const onEnd = (event: AnimationEvent) => {\n if (event.target !== element) return;\n this.stopTracking?.();\n done();\n flushNow(this.appRef);\n };\n element.addEventListener(\"animationend\", onEnd);\n this.stopTracking = () => {\n element.removeEventListener(\"animationend\", onEnd);\n this.stopTracking = null;\n };\n });\n this.stopTracking = () => {\n cancelAnimationFrame(frame);\n this.stopTracking = null;\n };\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n untracked,\n type OnInit,\n type Signal,\n} from \"@angular/core\";\nimport { UioPart } from \"../part.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { UioCollapsibleContext } from \"./collapsible-context.js\";\n\n/**\n * One section that opens and closes.\n *\n * ```html\n * <div uioCollapsible [(open)]=\"showing\">\n * <button uioCollapsibleTrigger>Details</button>\n * <div uioCollapsibleContent>…</div>\n * </div>\n * ```\n *\n * A compound rather than `Accordion`'s data-driven shape, because the panel\n * holds arbitrary content and an accordion's holds a row of items: handing a\n * caller `content: TemplateRef` for a single disclosure would be a wrapper\n * around `<ng-content>` and nothing else.\n *\n * `open` is a `model()`, so it is uncontrolled until something binds it and\n * React's `open`/`defaultOpen` fork does not arise — see `UioSwitch`.\n *\n * The animation, and the panel attribute that is deliberately absent while it is\n * settled open, are in `UioCollapsibleContext`.\n */\n@Component({\n selector: \"div[uioCollapsible]\",\n standalone: true,\n exportAs: \"uioCollapsible\",\n providers: [UioCollapsibleContext],\n template: `<ng-content />`,\n host: {\n class: \"collapsible\",\n \"[id]\": \"ctx.rootId\",\n },\n})\nexport class UioCollapsible extends UioPart implements OnInit {\n readonly scope = \"collapsible\";\n readonly part = \"root\";\n\n readonly open = model(false);\n readonly openChange = output<boolean>();\n\n /**\n * Not an override of the base's `disabled`, deliberately.\n *\n * `UioPart` binds `data-disabled` from that signal, and Ark's collapsible\n * **root** reports no such attribute — only the trigger and the panel do.\n * Same split, for the same reason, as `UioAccordion`'s.\n */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n\n protected readonly ctx = inject(UioCollapsibleContext);\n private readonly appRef = inject(ApplicationRef);\n\n /**\n * Wrapped rather than handed to the context directly, so the parts read *the\n * input* rather than the signal object that happened to exist when the root\n * was constructed.\n *\n * A captured reference is a live bug in one place and a dead spec in another:\n * JIT registers no initializer-based input, so every TestBed spec in this\n * package replaces an input wholesale after construction — and a trigger\n * holding the original would report a disabled state the root does not have.\n * The wrapper is lazy, so its first read is the first render.\n */\n private readonly disabledState = computed(() => this.disabledInput());\n\n /**\n * The root reports the *machine's* state, not the model's: a panel on its way\n * out is already `closed` here while it is still on screen animating.\n */\n override readonly state: Signal<\"open\" | \"closed\"> = this.ctx.state;\n\n /**\n * What the model was last seen holding, so the effect below can tell an\n * external change from its own write. `null` until `ngOnInit` seeds it.\n */\n private lastOpen: boolean | null = null;\n\n constructor() {\n super();\n this.ctx.bind({ disabled: this.disabledState, request: (open) => this.set(open) });\n effect(() => {\n const open = this.open();\n if (this.lastOpen === null || open === this.lastOpen) return;\n this.lastOpen = open;\n untracked(() => this.ctx.setOpen(open));\n });\n }\n\n /**\n * `ngOnInit` rather than the effect's first run, because an effect lands after\n * the first change-detection pass: a collapsible that starts open would render\n * closed for one frame and then animate itself open on mount, which is a flash\n * no other library has.\n */\n ngOnInit(): void {\n this.lastOpen = this.open();\n this.ctx.seed(this.lastOpen);\n }\n\n private set(open: boolean): void {\n if (open === this.open()) return;\n this.lastOpen = open;\n this.open.set(open);\n this.openChange.emit(open);\n this.ctx.setOpen(open);\n flushNow(this.appRef);\n }\n}\n\n/**\n * The button that opens and closes the panel.\n *\n * ── No native `disabled` ────────────────────────────────────────────────────\n *\n * A disabled collapsible's trigger carries `data-disabled` and stays focusable:\n * Zag's connect puts no `disabled` on it and refuses the click in the handler\n * instead. That is the rendered contract in all three other libraries, so it is\n * the one reproduced here — adding the native attribute would look like an\n * improvement and would take the trigger out of the tab order in one library\n * only.\n */\n@Component({\n selector: \"button[uioCollapsibleTrigger]\",\n standalone: true,\n template: `<ng-content />`,\n host: {\n class: \"collapsible__trigger text-emphasis-body-large\",\n type: \"button\",\n \"[id]\": \"ctx.partId('trigger')\",\n \"[attr.aria-controls]\": \"ctx.partId('content')\",\n \"[attr.aria-expanded]\": \"ctx.visible()\",\n \"(click)\": \"toggle()\",\n },\n})\nexport class UioCollapsibleTrigger extends UioPart {\n readonly scope = \"collapsible\";\n readonly part = \"trigger\";\n\n protected readonly ctx = inject(UioCollapsibleContext);\n override readonly state: Signal<\"open\" | \"closed\"> = this.ctx.state;\n override readonly disabled: Signal<boolean> = this.ctx.disabled;\n\n protected toggle(): void {\n if (this.ctx.disabled()) return;\n this.ctx.request(!this.ctx.open());\n }\n}\n\n/**\n * The region the trigger reveals.\n *\n * Two elements, not one: the panel is the animating box and has to keep\n * `overflow: hidden` and no padding of its own, so `.collapsible__content`\n * inside it is what carries the spacing. The other three libraries nest the\n * same pair.\n *\n * `data-collapsible` is Ark's marker for \"this is a collapsible panel\" and is\n * present open or closed.\n */\n@Component({\n selector: \"div[uioCollapsibleContent]\",\n standalone: true,\n template: `<div class=\"collapsible__content\"><ng-content /></div>`,\n host: {\n class: \"collapsible__panel\",\n \"data-collapsible\": \"\",\n \"[id]\": \"ctx.partId('content')\",\n \"[attr.hidden]\": \"ctx.visible() ? null : ''\",\n },\n})\nexport class UioCollapsibleContent extends UioPart {\n readonly scope = \"collapsible\";\n readonly part = \"content\";\n\n protected readonly ctx = inject(UioCollapsibleContext);\n /** `null` while settled open — see `UioCollapsibleContext`. */\n override readonly state: Signal<\"open\" | \"closed\" | null> = this.ctx.contentState;\n override readonly disabled: Signal<boolean> = this.ctx.disabled;\n\n constructor() {\n super();\n this.ctx.bindContent(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n","import { Injectable, computed, signal, type Signal } from \"@angular/core\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { inDomOrder, moveHighlight } from \"../overlay/roving.js\";\n\n/** What a `UioToggle` inside a group has to tell the group about itself. */\nexport interface ToggleGroupItem {\n readonly element: HTMLElement;\n readonly itemValue: Signal<string | undefined>;\n readonly isDisabled: Signal<boolean>;\n}\n\n/**\n * The state a row of toggles shares.\n *\n * ── Why a `UioToggle` needs one at all ──────────────────────────────────────\n *\n * Ark splits the standalone toggle (`Toggle.Root`) from the group item\n * (`ToggleGroup.Item`), and the two render different elements: `data-scope`\n * changes, the group item gains an id, a `data-ownedby`, a roving `tabindex`\n * and either `role=\"radio\"`/`aria-checked` or `aria-pressed`. React tells them\n * apart by whether a `value` was passed. In Angular the presence of this\n * provider is the better discriminator: it is decided at construction rather\n * than on an input that has not landed yet, and a toggle inside a group *is* a\n * group item whatever it was given.\n *\n * ── Roving focus, and why the group holds it ────────────────────────────────\n *\n * Arrow keys move **real focus** between the buttons — `tabindex` is 0 on the\n * focused one and -1 on the rest, and the group itself is the tab stop that\n * hands focus to the first item. That is Zag's arrangement, and it has to be the\n * group's business because no item can see its siblings.\n */\n@Injectable()\nexport class UioToggleGroupContext {\n /** Ark builds every id as `<scope>:<machine>:<part>`; an item's part is its value. */\n private readonly machine = nextMachineId();\n\n get rootId(): string {\n return `toggle-group:${this.machine}`;\n }\n itemId(value: string | undefined): string {\n return `toggle-group:${this.machine}:${value}`;\n }\n\n /** Replaced wholesale by the root — see `UioFieldContext.bind`. */\n value: Signal<readonly string[]> = signal([]);\n multiple: Signal<boolean> = signal(false);\n disabled: Signal<boolean> = signal(false);\n orientation: Signal<\"horizontal\" | \"vertical\"> = signal(\"horizontal\");\n private commit: (value: string[]) => void = () => {};\n\n private readonly focused = signal<string | null>(null);\n readonly focusedId: Signal<string | null> = this.focused;\n readonly hasFocus = computed(() => this.focused() !== null);\n\n /**\n * Whether a Shift+Tab is on its way out of the group.\n *\n * The root is a tab stop, so without this a backwards Tab out of the first\n * item would land straight back on the root and trap the user. Zag drops the\n * root's `tabindex` for exactly the one keystroke.\n */\n private readonly tabbingBackward = signal(false);\n readonly rootTabIndex = computed(() => (this.tabbingBackward() ? -1 : 0));\n\n private items: ToggleGroupItem[] = [];\n\n bind(state: {\n value: Signal<readonly string[]>;\n multiple: Signal<boolean>;\n disabled: Signal<boolean>;\n orientation: Signal<\"horizontal\" | \"vertical\">;\n commit: (value: string[]) => void;\n }): void {\n this.value = state.value;\n this.multiple = state.multiple;\n this.disabled = state.disabled;\n this.orientation = state.orientation;\n this.commit = state.commit;\n }\n\n register(item: ToggleGroupItem): void {\n this.items.push(item);\n }\n unregister(item: ToggleGroupItem): void {\n this.items = this.items.filter((entry) => entry !== item);\n }\n\n isPressed(value: string | undefined): boolean {\n return value !== undefined && this.value().includes(value);\n }\n\n /**\n * Zag's `setValue`, both branches written out.\n *\n * Single mode is *deselectable*: clicking the pressed toggle clears the group\n * rather than doing nothing, which is what makes it a toggle row and not a\n * radio group. `deselectable` defaults to true and neither React nor this\n * exposes it.\n */\n toggle(value: string | undefined): void {\n if (value === undefined) return;\n const current = this.value();\n let next: string[];\n if (this.multiple()) {\n next = current.includes(value)\n ? current.filter((entry) => entry !== value)\n : [...current, value];\n } else {\n next = current.length === 1 && current[0] === value ? [] : [value];\n }\n this.commit(next);\n }\n\n setFocused(id: string | null): void {\n this.focused.set(id);\n if (id !== null) this.tabbingBackward.set(false);\n }\n /** Called when focus leaves the group entirely — see `UioToggleGroup`. */\n clearFocus(): void {\n this.focused.set(null);\n this.tabbingBackward.set(false);\n }\n shiftTabbing(): void {\n this.tabbingBackward.set(true);\n }\n\n /** Zag's `ROOT.FOCUS`: the group is the tab stop, the first item takes focus. */\n focusFirst(): void {\n this.ordered()[0]?.element.focus({ preventScroll: true });\n }\n\n /**\n * `step` of ±1 moves one item, `\"home\"`/`\"end\"` jump to an end.\n *\n * The arithmetic is `moveHighlight`'s, so a disabled toggle is stepped over\n * here exactly as a disabled option is in Menu and Select.\n */\n move(step: 1 | -1 | \"home\" | \"end\"): void {\n const items = this.ordered();\n if (!items.length) return;\n const navigable = items.map((item) => ({ disabled: item.isDisabled() }));\n const from =\n step === \"home\" || step === \"end\"\n ? -1\n : items.findIndex((item) => this.itemId(item.itemValue()) === this.focused());\n const direction = step === \"home\" ? 1 : step === \"end\" ? -1 : step;\n const next = moveHighlight(navigable, from, direction);\n if (next === -1) return;\n items[next]?.element.focus({ preventScroll: true });\n }\n\n /** Registration order is template order only until something conditional appears. */\n private ordered(): ToggleGroupItem[] {\n return inDomOrder(this.items);\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n type OnDestroy,\n type OnInit,\n type Signal,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n CONTROL_TEXT_CLASS,\n toggleStyles,\n type ToggleVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { UioToggleGroupContext } from \"./toggle-group-context.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\nexport type ToggleSize = NonNullable<ToggleVariants[\"size\"]>;\nexport type ToggleOrientation = \"horizontal\" | \"vertical\";\n\n/**\n * A button that is either on or off.\n *\n * ```html\n * <button uioToggle label=\"Bold\" icon=\"bold\" [(pressed)]=\"bold\"></button>\n *\n * <div uioToggleGroup [(value)]=\"alignment\">\n * <button uioToggle value=\"left\" label=\"Left\"></button>\n * <button uioToggle value=\"center\" label=\"Center\"></button>\n * </div>\n * ```\n *\n * ── One component, two Ark parts ────────────────────────────────────────────\n *\n * Inside a group this is `ToggleGroup.Item` and outside it is `Toggle.Root`, and\n * the two render different elements — different `data-scope`, and the group item\n * additionally carries an id, `data-ownedby`, a roving `tabindex`, and either\n * `role=\"radio\"`/`aria-checked` or `aria-pressed` depending on `multiple`. So\n * `scope` and `part` are decided from whether a `UioToggleGroupContext` was\n * found, which is settled at construction. React makes the same split on whether\n * a `value` was passed.\n *\n * ── The label is an input, not projected content ────────────────────────────\n *\n * An icon with no label collapses to a square (`.toggle--icon-only`), and\n * `<ng-content>` cannot be tested for emptiness — a component that always\n * projects \"whatever the caller gave us\" believes it has content. Same answer as\n * `UioFieldError`'s and `UioSwitch`'s: anything whose absence changes the\n * rendering has to be told so in a value.\n */\n@Component({\n selector: \"button[uioToggle]\",\n standalone: true,\n exportAs: \"uioToggle\",\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n <span uioIcon [name]=\"name\" [size]=\"iconSize()\"></span>\n }\n @if (label(); as text) {\n {{ text }}\n }\n `,\n host: {\n type: \"button\",\n \"[class]\": \"hostClass()\",\n \"[disabled]\": \"isDisabled()\",\n \"[attr.id]\": \"group ? group.itemId(value()) : null\",\n \"[attr.data-ownedby]\": \"group ? group.rootId : null\",\n \"[attr.tabindex]\": \"group ? (isFocused() ? 0 : -1) : null\",\n \"[attr.role]\": \"asRadio() ? 'radio' : null\",\n \"[attr.aria-checked]\": \"asRadio() ? isPressed() : null\",\n \"[attr.aria-pressed]\": \"asRadio() ? null : isPressed()\",\n /**\n * Standalone only. Zag's `getItemProps` emits no `data-pressed` — the group\n * item reports itself through `data-state` alone — and adding one would be a\n * difference from all three other libraries on every item of every group.\n */\n \"[attr.data-pressed]\": \"group ? null : flag(isPressed())\",\n \"(click)\": \"onClick()\",\n \"(focus)\": \"onFocus()\",\n \"(keydown)\": \"onKeydown($event)\",\n },\n})\nexport class UioToggle extends UioPart implements OnInit, OnDestroy {\n /** Read before `scope`/`part` below, which is why it is declared first. */\n protected readonly group = inject(UioToggleGroupContext, { optional: true });\n\n readonly scope = this.group ? \"toggle-group\" : \"toggle\";\n readonly part = this.group ? \"item\" : \"root\";\n\n /** Standalone only: a group item's pressed state belongs to the group. */\n readonly pressed = model(false);\n readonly pressedChange = output<boolean>();\n /** Identifies this toggle within a group. */\n readonly value = input<string | undefined>(undefined);\n readonly label = input<string | undefined>(undefined);\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n readonly size = input<ToggleSize>(\"md\");\n\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly isPressed = computed(() =>\n this.group ? this.group.isPressed(this.value()) : this.pressed(),\n );\n /**\n * A single-select group is a `radiogroup` of `radio`s and reports\n * `aria-checked`; a multi-select one and a standalone toggle report\n * `aria-pressed`. Zag emits exactly one of the two, never both.\n */\n protected readonly asRadio = computed(() => !!this.group && !this.group.multiple());\n readonly isDisabled = computed(\n () => this.disabledInput() || (this.group?.disabled() ?? false),\n );\n protected readonly isFocused = computed(\n () => !!this.group && this.group.focusedId() === this.group.itemId(this.value()),\n );\n\n override readonly state = computed<\"on\" | \"off\">(() => (this.isPressed() ? \"on\" : \"off\"));\n override readonly disabled: Signal<boolean> = this.isDisabled;\n override readonly focus: Signal<boolean> = this.isFocused;\n override readonly orientation: Signal<ToggleOrientation | null> = computed(\n () => this.group?.orientation() ?? null,\n );\n\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n /**\n * An icon with no label is a square whose side matches the labelled height for\n * the size — the same treatment `Button` gives an icon-only button, so the two\n * line up in a row instead of one rendering short and wide.\n */\n protected readonly hostClass = computed(() =>\n clsx(\n CONTROL_TEXT_CLASS[this.size()],\n toggleStyles({ size: this.size() }),\n !!this.icon() && !this.label() && \"toggle--icon-only\",\n ),\n );\n protected readonly flag = stateFlag;\n\n /** The element and the two signals the group needs; see `ToggleGroupItem`. */\n readonly element = this.host.nativeElement;\n readonly itemValue: Signal<string | undefined> = this.value;\n\n ngOnInit(): void {\n this.group?.register(this);\n }\n ngOnDestroy(): void {\n this.group?.unregister(this);\n }\n\n protected onClick(): void {\n if (this.isDisabled()) return;\n if (this.group) {\n this.group.toggle(this.value());\n return;\n }\n const next = !this.pressed();\n this.pressed.set(next);\n this.pressedChange.emit(next);\n flushNow(this.appRef);\n }\n\n protected onFocus(): void {\n if (!this.group || this.isDisabled()) return;\n this.group.setFocused(this.group.itemId(this.value()));\n flushNow(this.appRef);\n }\n\n /**\n * Arrow keys move focus, and which arrows do so depends on the group's\n * orientation: an ArrowDown in a horizontal row is the page's to scroll with\n * and is left alone rather than swallowed.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const group = this.group;\n if (!group || this.isDisabled()) return;\n if (event.key === \"Tab\") {\n if (event.shiftKey) group.shiftTabbing();\n return;\n }\n const horizontal = group.orientation() === \"horizontal\";\n const move = ((): 1 | -1 | \"home\" | \"end\" | null => {\n switch (event.key) {\n case \"ArrowRight\":\n return horizontal ? 1 : null;\n case \"ArrowLeft\":\n return horizontal ? -1 : null;\n case \"ArrowDown\":\n return horizontal ? null : 1;\n case \"ArrowUp\":\n return horizontal ? null : -1;\n case \"Home\":\n return \"home\";\n case \"End\":\n return \"end\";\n default:\n return null;\n }\n })();\n if (move === null) return;\n event.preventDefault();\n group.move(move);\n flushNow(this.appRef);\n }\n}\n\n/**\n * A row of toggles that share a value.\n *\n * The group is the tab stop — `tabindex=\"0\"` on the container, -1 on every\n * button — and arrow keys move focus between the buttons from there. That is\n * Zag's arrangement and it is why the roving state lives in\n * `UioToggleGroupContext` rather than in any one toggle.\n *\n * `multiple` decides both the ARIA and the semantics: a single-select group is a\n * `radiogroup` of `radio`s, a multi-select one is a plain `group` of pressed\n * buttons. Single mode is still deselectable — clicking the pressed toggle\n * clears the group — which is what keeps it a row of toggles rather than a radio\n * group that cannot be unset.\n */\n@Component({\n selector: \"div[uioToggleGroup]\",\n standalone: true,\n exportAs: \"uioToggleGroup\",\n providers: [UioToggleGroupContext],\n template: `<ng-content />`,\n host: {\n class: \"toggle-group\",\n \"[id]\": \"ctx.rootId\",\n \"[attr.role]\": \"multiple() ? 'group' : 'radiogroup'\",\n \"[attr.tabindex]\": \"ctx.rootTabIndex()\",\n /**\n * The container takes focus so it can hand it to the first toggle, and a\n * focus ring on a container nobody sees as focusable would be noise. Zag\n * writes the same inline style; there is no class for it in the shared\n * stylesheet to reach for instead.\n */\n \"[style.outline]\": \"'none'\",\n \"(focus)\": \"ctx.focusFirst()\",\n \"(focusout)\": \"onFocusOut($event)\",\n },\n})\nexport class UioToggleGroup extends UioPart {\n readonly scope = \"toggle-group\";\n readonly part = \"root\";\n\n /** Uncontrolled until something binds it — see `UioSwitch`. */\n readonly value = model<readonly string[]>([]);\n readonly multiple = input(false, { transform: booleanAttribute });\n override readonly orientation = input<ToggleOrientation>(\"horizontal\");\n readonly valueChange = output<string[]>();\n\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly ctx = inject(UioToggleGroupContext);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n override readonly focus: Signal<boolean> = this.ctx.hasFocus;\n\n constructor() {\n super();\n this.ctx.bind({\n value: this.value,\n multiple: this.multiple,\n disabled: this.disabled,\n orientation: this.orientation,\n commit: (next) => this.commit(next),\n });\n }\n\n /**\n * Only a blur that leaves the group clears the focused toggle.\n *\n * `focusout` rather than `blur`, because the event has to be heard from a\n * descendant and `blur` does not bubble. Moving between two toggles fires it\n * with the next one as `relatedTarget`; clearing unconditionally would drop\n * `data-focus` off the whole group for a tick, and anything reading the DOM in\n * between — the parity gate does exactly that — sees a group nobody is in.\n */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.nativeElement.contains(next)) return;\n this.ctx.clearFocus();\n flushNow(this.appRef);\n }\n\n private commit(next: string[]): void {\n this.value.set(next);\n this.valueChange.emit(next);\n flushNow(this.appRef);\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { CONTROL_ICON_SIZE, numberFieldStyles, type NumberFieldVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type NumberFieldSize = NonNullable<NumberFieldVariants[\"size\"]>;\n\n/**\n * Zag's defaults, and the two numbers that show up in the rendered ARIA.\n *\n * A number field always reports a range even when the caller gave none, so\n * `aria-valuemin`/`aria-valuemax` are never absent — and the steppers' at-a-bound\n * arithmetic always has two numbers to work with.\n */\nconst MIN = Number.MIN_SAFE_INTEGER;\nconst MAX = Number.MAX_SAFE_INTEGER;\n\n/** `NaN` counts as zero for every range test. Zag's `nan()`, which is load-bearing:\n * an empty field with `min: 0` reports its decrement stepper disabled. */\nconst orZero = (value: number) => (Number.isNaN(value) ? 0 : value);\n\n/**\n * Add or subtract without the binary-floating-point residue.\n *\n * `0.1 + 0.2` is 0.30000000000000004, and a number field stepping by 0.1 would\n * show it. Zag's `decimalOp`: scale both operands to integers by the wider of\n * their decimal places, operate, scale back.\n */\nexport function stepValue(value: number, step: number, direction: 1 | -1): number {\n const a = orZero(value);\n const b = step * direction;\n if (a % 1 === 0 && b % 1 === 0) return a + b;\n const decimals = (n: number) => {\n const text = String(n);\n const point = text.indexOf(\".\");\n return point === -1 ? 0 : text.length - point - 1;\n };\n const scale = 10 ** Math.max(decimals(a), decimals(b));\n return (Math.round(a * scale) + Math.round(b * scale)) / scale;\n}\n\n/**\n * A number with steppers, its label, helper text and error already wired to it.\n *\n * ```html\n * <div uioNumberField label=\"Quantity\" [min]=\"0\" [max]=\"10\" [(value)]=\"qty\"></div>\n * ```\n *\n * ── Two machines, one control ───────────────────────────────────────────────\n *\n * The rendered element is a `field` root holding a `number-input` root, because\n * that is what the other three libraries compose: Ark's Field supplies the\n * label, the helper text, the error and the `aria-describedby` that names them;\n * Ark's NumberInput supplies the spinbutton and its two triggers. Both scopes\n * are written out here rather than assembled from directives, for the reason\n * `UioInput` gives — the whole attribute surface is then visible in one place\n * next to the state that drives it.\n *\n * Unlike `UioInput`, the field root here **does** report `data-disabled`: React\n * passes `disabled` to `Field.Root`, so the label greys with the control.\n * `readOnly` and `required` are not passed on, so no part of the field reports\n * them — only the input itself does, as native attributes.\n *\n * ── What the steppers actually mean ─────────────────────────────────────────\n *\n * A stepper is disabled when the field is disabled, when it is read-only, or\n * when the value is already at that bound. The last one is the interesting case\n * and the one a DOM diff at rest can see: `min: 0` with a value of `0` disables\n * decrement and leaves increment live. An **empty** field with `min: 0` disables\n * it too, because an empty value counts as zero for the comparison.\n */\n@Component({\n selector: \"div[uioNumberField]\",\n standalone: true,\n exportAs: \"uioNumberField\",\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioNumberField), multi: true },\n ],\n imports: [UioIcon, UioFieldLabel, UioFieldError],\n template: `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <div\n data-scope=\"number-input\"\n data-part=\"root\"\n [id]=\"rootId\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.data-invalid]=\"flag(invalid())\"\n >\n <div\n class=\"number-field__group\"\n data-scope=\"number-input\"\n data-part=\"control\"\n role=\"group\"\n [attr.aria-disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.data-invalid]=\"flag(invalid())\"\n >\n <button\n class=\"number-field__stepper\"\n data-scope=\"number-input\"\n data-part=\"decrement-trigger\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease\"\n [id]=\"partId('dec')\"\n [attr.aria-controls]=\"field.controlId\"\n [attr.data-disabled]=\"flag(decrementDisabled())\"\n [disabled]=\"decrementDisabled()\"\n (pointerdown)=\"press($event, -1)\"\n >\n <span uioIcon [name]=\"glyph('minus')\" [size]=\"iconSize()\"></span>\n </button>\n <!--\n type=\"text\" with role=\"spinbutton\", not type=\"number\". A native\n number input cannot hold a partially-typed or formatted value — \"$12.0\"\n is not parseable and the browser silently blanks it — so every library\n here spells the value itself and reports the range through ARIA.\n -->\n <input\n class=\"field__control number-field__input\"\n data-scope=\"number-input\"\n data-part=\"input\"\n type=\"text\"\n role=\"spinbutton\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n aria-roledescription=\"numberfield\"\n [id]=\"field.controlId\"\n [attr.name]=\"name()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.pattern]=\"format() ? null : PATTERN\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnlyInput() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.aria-valuemin]=\"minValue()\"\n [attr.aria-valuemax]=\"maxValue()\"\n [attr.aria-valuenow]=\"valueNow()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [disabled]=\"isDisabled()\"\n [value]=\"text()\"\n (input)=\"write($event)\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"onBlur()\"\n />\n <button\n class=\"number-field__stepper\"\n data-scope=\"number-input\"\n data-part=\"increment-trigger\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase\"\n [id]=\"partId('inc')\"\n [attr.aria-controls]=\"field.controlId\"\n [attr.data-disabled]=\"flag(incrementDisabled())\"\n [disabled]=\"incrementDisabled()\"\n (pointerdown)=\"press($event, 1)\"\n >\n <span uioIcon [name]=\"glyph('plus')\" [size]=\"iconSize()\"></span>\n </button>\n </div>\n </div>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioNumberField extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly scope = \"field\";\n readonly part = \"root\";\n\n /** `null` is an empty field, which is not the same as `0`. */\n readonly value = model<number | null | undefined>(undefined);\n readonly valueChange = output<number | null>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<NumberFieldSize>(\"md\");\n /**\n * Undefined rather than the safe-integer bounds, so a caller can bind\n * `[min]=\"maybeUndefined\"` without the transform turning it into `NaN`. The\n * bounds the arithmetic and the ARIA actually use are `minValue`/`maxValue`.\n */\n readonly min = input<number | undefined>(undefined);\n readonly max = input<number | undefined>(undefined);\n readonly step = input<number | undefined>(undefined);\n /** `Intl.NumberFormat` options — a currency or percent field formats its value. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n /**\n * Not an override of the base's `readOnly`, deliberately.\n *\n * `UioPart` binds `data-readonly` from that signal and the field root reports\n * none: React passes only `disabled` and `invalid` to `Field.Root`, so\n * read-only stays the input's own native attribute. Same split, for the same\n * reason, as `disabledInput` on `UioAccordion`.\n */\n protected readonly readOnlyInput = input(false, {\n alias: \"readOnly\",\n transform: booleanAttribute,\n });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly hostClass = computed(() => numberFieldStyles({ size: this.size() }));\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n protected readonly focused = signal(false);\n protected readonly minValue = computed(() => this.min() ?? MIN);\n protected readonly maxValue = computed(() => this.max() ?? MAX);\n protected readonly stepAmount = computed(() => this.step() ?? 1);\n protected readonly flag = stateFlag;\n /** Zag's default: digits, an optional sign, an optional decimal tail. */\n protected readonly PATTERN = \"-?[0-9]*(.[0-9]+)?\";\n\n /** Ark's ids: `number-input:<machine>` for the root, `:dec`/`:inc` for the triggers. */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `number-input:${this.machine}`;\n }\n protected partId(part: string): string {\n return `number-input:${this.machine}:${part}`;\n }\n\n /**\n * What the input is showing, which is not `value()` and cannot be derived from\n * it.\n *\n * A half-typed number — `\"1.\"`, `\"-\"`, `\"$1,2\"` — parses to something whose\n * formatting is not the text the user has in front of them, so reformatting on\n * every keystroke would fight the caret. Zag keeps the string as the machine's\n * context and derives the number from it; this is the same arrangement, with\n * the effect below re-deriving the text only when the *value* is changed from\n * outside.\n */\n protected readonly text = signal(\"\");\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // React passes `disabled` to Field.Root and nothing else, so the label\n // greys with the control while `required` and `readOnly` stay the input's\n // own native attributes. See the class note.\n disabled: this.isDisabled,\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n\n effect(() => {\n const next = this.value();\n untracked(() => {\n const shown = this.parse(this.text());\n const wanted = next ?? Number.NaN;\n // `Number.isNaN` on both sides, because `NaN !== NaN` would reformat an\n // empty field on every pass and blank a \"-\" the user is halfway through.\n if (Number.isNaN(shown) && Number.isNaN(wanted)) return;\n if (shown === wanted) return;\n this.text.set(this.formatNumber(wanted));\n });\n });\n }\n\n // ── The value, in both directions ─────────────────────────────────────────\n\n private get formatter(): Intl.NumberFormat | null {\n const options = this.format();\n return options ? new Intl.NumberFormat(undefined, options) : null;\n }\n\n protected formatNumber(value: number): string {\n if (Number.isNaN(value)) return \"\";\n return this.formatter?.format(value) ?? String(value);\n }\n\n /**\n * Text to number.\n *\n * Without `format` this is `parseFloat`, exactly as Zag does. With it, Zag\n * reaches for `@internationalized/number`'s locale-aware parser; this strips\n * the characters a formatted number carries — currency symbols, group\n * separators, whitespace — and parses what is left. That is the one place this\n * component is a reimplementation rather than a reproduction: it handles the\n * formats this library's own `Intl` output produces, and would not survive a\n * locale whose decimal separator is a comma. Nothing renders differently; a\n * caller formatting in `de-DE` would.\n */\n protected parse(text: string): number {\n if (!this.format()) return Number.parseFloat(text);\n if (text === \"\") return Number.NaN;\n return Number.parseFloat(text.replace(/[^\\d.\\-eE+]/g, \"\"));\n }\n\n protected readonly valueAsNumber = computed(() => this.parse(this.text()));\n protected readonly valueNow = computed(() => {\n const value = this.valueAsNumber();\n return Number.isNaN(value) ? null : value;\n });\n\n private clamp(value: number): number {\n return Math.min(Math.max(orZero(value), this.minValue()), this.maxValue());\n }\n\n // ── Steppers ──────────────────────────────────────────────────────────────\n\n protected readonly incrementDisabled = computed(\n () =>\n this.isDisabled() || this.readOnlyInput() || orZero(this.valueAsNumber()) >= this.maxValue(),\n );\n protected readonly decrementDisabled = computed(\n () =>\n this.isDisabled() || this.readOnlyInput() || orZero(this.valueAsNumber()) <= this.minValue(),\n );\n\n /**\n * `pointerdown` rather than `click`, and the default is prevented.\n *\n * Zag binds the same event for the same reason: a stepper must not take focus\n * away from the input, so the press is handled before the browser moves it and\n * the input is focused explicitly instead. That is also why the number-input\n * root and control report `data-focus` after a stepper is clicked.\n */\n protected press(event: PointerEvent, direction: 1 | -1): void {\n if (direction === 1 ? this.incrementDisabled() : this.decrementDisabled()) return;\n if (event.button !== 0) return;\n event.preventDefault();\n this.stepBy(direction);\n this.host.nativeElement.querySelector(\"input\")?.focus({ preventScroll: true });\n this.focused.set(true);\n flushNow(this.appRef);\n }\n\n protected stepBy(direction: 1 | -1): void {\n const next = this.clamp(stepValue(this.valueAsNumber(), this.stepAmount(), direction));\n this.text.set(this.formatNumber(next));\n this.commit(next);\n }\n\n // ── Typing ────────────────────────────────────────────────────────────────\n\n protected write(event: Event): void {\n const next = (event.target as HTMLInputElement).value;\n // Kept in step with the element so the `[value]` binding never has to fight\n // the user for the caret — the same rule `UioInput` follows.\n this.text.set(next);\n this.commit(this.parse(next));\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.readOnlyInput()) return;\n if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!this.incrementDisabled()) this.stepBy(1);\n } else if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (!this.decrementDisabled()) this.stepBy(-1);\n } else if (event.key === \"Home\" && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n this.setTo(this.minValue());\n } else if (event.key === \"End\" && !event.metaKey && !event.ctrlKey) {\n event.preventDefault();\n this.setTo(this.maxValue());\n }\n }\n\n /**\n * Blur is when a half-typed value becomes a number.\n *\n * Clamping on every keystroke would make `15` unreachable in a field whose max\n * is 20, because the `1` would clamp itself the moment it was typed. Zag\n * clamps on blur and so does this.\n */\n protected onBlur(): void {\n this.focused.set(false);\n this.onTouched();\n if (this.text() === \"\") {\n this.commit(Number.NaN);\n return;\n }\n this.setTo(this.clamp(this.valueAsNumber()));\n }\n\n private setTo(value: number): void {\n this.text.set(this.formatNumber(value));\n this.commit(value);\n }\n\n private commit(next: number): void {\n const value = Number.isNaN(next) ? null : next;\n if (value === (this.value() ?? null)) return;\n this.value.set(value);\n this.valueChange.emit(value);\n this.onChange(value);\n }\n\n // ── Forms ─────────────────────────────────────────────────────────────────\n\n protected onTouched: () => void = () => {};\n private onChange: (value: number | null) => void = () => {};\n\n writeValue(value: number | null): void {\n this.value.set(value ?? null);\n }\n registerOnChange(fn: (value: number | null) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport {\n CONTROL_ICON_SIZE,\n passwordInputFieldStyles,\n type InputVariants,\n} from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type PasswordInputSize = NonNullable<InputVariants[\"size\"]>;\n\n/**\n * A password box with a show/hide toggle.\n *\n * ```html\n * <div uioPasswordInput label=\"Password\" formControlName=\"password\"></div>\n * ```\n *\n * ── Why this is a component and not `UioInput type=\"password\"` ──────────────\n *\n * The toggle. It is a real button inside the control's box — `.input-affix`\n * positions it over the field's trailing padding — and the control has to know\n * about it twice over: `field__control--affix-end` is what reserves that\n * padding, so a field whose toggle is turned off must not carry the class. Both\n * facts live here rather than in a caller's template.\n *\n * ── No Ark machine, but still Ark parts ─────────────────────────────────────\n *\n * There is no `password-input` scope anywhere in Zag: React builds this out of\n * `Field.Root` and `Field.Input` plus a plain `<button>`, so the rendered\n * identity is a *field's* — `data-scope=\"field\"`, `data-part=\"root\"` and\n * `\"input\"` — and the toggle carries none at all. That is why this extends\n * `UioPart` where the six components of the previous wave did not: the identity\n * is real, it comes from Field, and the shared stylesheet reads it.\n *\n * `data-disabled` is absent from every part, exactly as in `UioInput`: React\n * passes only `invalid` to `Field.Root`, and `.field__control:disabled` sits in\n * the stylesheet beside `.field__control[data-disabled]`.\n */\n@Component({\n selector: \"div[uioPasswordInput]\",\n standalone: true,\n exportAs: \"uioPasswordInput\",\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioPasswordInput), multi: true },\n ],\n imports: [UioIcon, UioFieldLabel, UioFieldError],\n template: `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <div class=\"input-affix\">\n <input\n [class]=\"controlClass()\"\n data-scope=\"field\"\n data-part=\"input\"\n [id]=\"field.controlId\"\n [attr.type]=\"visible() ? 'text' : 'password'\"\n [attr.name]=\"name()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"write($event)\"\n (blur)=\"onTouched()\"\n />\n @if (showToggle()) {\n <!--\n Labelled by state rather than by function: \"Show password\" is what the\n button will *do*, which is what a screen reader should hear, and\n aria-pressed carries the state it is in. Both flip together.\n -->\n <button\n type=\"button\"\n class=\"input-affix__adornment input-affix__adornment--end input-affix__action\"\n [attr.aria-label]=\"visible() ? 'Hide password' : 'Show password'\"\n [attr.aria-pressed]=\"visible()\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\"\n >\n <span uioIcon [name]=\"glyph(visible() ? 'eye-off' : 'eye')\" [size]=\"iconSize()\"></span>\n </button>\n }\n </div>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioPasswordInput extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<PasswordInputSize>(\"md\");\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly autocomplete = input<string | undefined>(undefined);\n readonly showToggle = input(true, { transform: booleanAttribute });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n protected readonly hostClass = computed(() => passwordInputFieldStyles({ size: this.size() }));\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n /** Without the toggle the control loses its trailing padding along with it. */\n protected readonly controlClass = computed(() =>\n this.showToggle() ? \"field__control field__control--affix-end\" : \"field__control\",\n );\n protected readonly value = signal(\"\");\n /** Never bound from the outside: a caller cannot reveal a user's password for them. */\n protected readonly visible = signal(false);\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // Not the field's state: see the note above about `data-disabled`.\n disabled: signal(false),\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n }\n\n protected toggle(): void {\n this.visible.update((shown) => !shown);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected write(event: Event): void {\n const next = (event.target as HTMLInputElement).value;\n // Kept in step with the element so the binding never fights the caret.\n this.value.set(next);\n this.onChange(next);\n }\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { CONTROL_ICON_SIZE, searchInputFieldStyles, type InputVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type SearchInputSize = NonNullable<InputVariants[\"size\"]>;\n\n/**\n * A search box with a leading icon and a clear button.\n *\n * ```html\n * <div uioSearchInput label=\"Search\" [(value)]=\"query\"></div>\n * ```\n *\n * ── The clear button is the whole component ─────────────────────────────────\n *\n * Everything else is `UioInput` with `type=\"search\"`. What is not is the button\n * that appears only while the field holds something, and the class that comes\n * and goes with it: `field__control--affix-end` is what reserves the trailing\n * padding, so an empty field must not carry it or its text sits in a gap. Three\n * pieces of state — the value, the button's presence, the control's class — that\n * have to move together.\n *\n * ── No Ark machine, but still Ark parts ─────────────────────────────────────\n *\n * There is no `search-input` scope in Zag. React builds this from `Field.Root`\n * and `Field.Input`, so the identity is a *field's* and this extends `UioPart`\n * for the same reason `UioPasswordInput` does. The adornments carry none: they\n * are the design system's own elements, not Ark parts.\n *\n * The clear button is `tabindex=\"-1\"` and the leading icon is `aria-hidden` —\n * both deliberate. Clearing a search box is what Escape and the keyboard are\n * for; a tab stop between the field and whatever follows it would be in the way\n * of every keyboard user for the sake of one they help.\n */\n@Component({\n selector: \"div[uioSearchInput]\",\n standalone: true,\n exportAs: \"uioSearchInput\",\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioSearchInput), multi: true },\n ],\n imports: [UioIcon, UioFieldLabel, UioFieldError],\n template: `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}\n @if (required()) {\n <span class=\"field__required\" aria-hidden=\"true\"></span>\n }\n </label>\n }\n <div class=\"input-affix\">\n <span class=\"input-affix__adornment input-affix__adornment--start\" aria-hidden=\"true\">\n <span uioIcon [name]=\"glyph('search')\" [size]=\"iconSize()\"></span>\n </span>\n <input\n [class]=\"controlClass()\"\n data-scope=\"field\"\n data-part=\"input\"\n type=\"search\"\n [id]=\"field.controlId\"\n [attr.name]=\"name()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"write($event)\"\n (blur)=\"onTouched()\"\n />\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"input-affix__adornment input-affix__adornment--end input-affix__action\"\n aria-label=\"Clear search\"\n tabindex=\"-1\"\n (click)=\"clear()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"iconSize()\"></span>\n </button>\n }\n </div>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span\n >\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioSearchInput extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly scope = \"field\";\n readonly part = \"root\";\n\n /** Uncontrolled until something binds it — see `UioSwitch`. */\n readonly value = model(\"\");\n readonly valueChange = output<string>();\n /** Fired after the clear button empties the field, in addition to `valueChange`. */\n readonly cleared = output<void>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<SearchInputSize>(\"md\");\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n /**\n * Names the control when there is no visible `label`.\n *\n * Aliased to `aria-label` and bound to the **input**, not the root: the field\n * root is a `role=\"group\"`, and a name on the group leaves the search box\n * itself unnamed. React, Svelte and Vue all forward it to the input through\n * their rest props; Angular has to say so.\n */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n readonly clearable = input(true, { transform: booleanAttribute });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly hostClass = computed(() => searchInputFieldStyles({ size: this.size() }));\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n\n /**\n * A disabled field shows no clear button, even holding a value.\n *\n * Not because it would be pressable — it would not — but because the trailing\n * padding it reserves is layout, and a control nobody can reach should not\n * carry a gap where a button used to be.\n */\n protected readonly showClear = computed(\n () => this.clearable() && this.value().length > 0 && !this.isDisabled(),\n );\n protected readonly controlClass = computed(() =>\n this.showClear()\n ? \"field__control field__control--affix-start field__control--affix-end\"\n : \"field__control field__control--affix-start\",\n );\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // Not the field's state: React passes only `invalid` to Field.Root, so a\n // disabled search box reports itself through the control's native\n // attribute alone. Same as `UioInput`.\n disabled: signal(false),\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n protected write(event: Event): void {\n this.commit((event.target as HTMLInputElement).value);\n }\n\n /**\n * Clearing focuses the field, which is the point: a user who clears a search\n * is about to type another one, and leaving focus on a button that has just\n * removed itself would drop it on `document.body`.\n */\n protected clear(): void {\n this.commit(\"\");\n this.host.nativeElement.querySelector(\"input\")?.focus();\n this.cleared.emit();\n flushNow(this.appRef);\n }\n\n /**\n * The model *is* what the element shows, so the `[value]` binding above never\n * has to be reconciled against a second copy: by the time this returns, the\n * signal and the DOM already agree and Angular writes the same string back.\n * `UioInput` keeps the same invariant with its own internal signal.\n */\n private commit(next: string): void {\n if (next === this.value()) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { segmentedControlStyles, type SegmentedControlVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\nexport type SegmentedControlSize = NonNullable<SegmentedControlVariants[\"size\"]>;\n\nexport interface SegmentedControlItem {\n /** Unique value reported — and submitted — when this segment is selected. */\n value: string;\n label: string;\n icon?: IconName | IconGlyph;\n /** Disable just this segment. */\n disabled?: boolean;\n}\n\n/** Leading icons render at 16px across every size, as in the other three libraries. */\nconst ICON_SIZE = 16;\n\n/** The pill's measured box, in the coordinates the stylesheet reads it in. */\ninterface IndicatorRect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/**\n * One choice out of a row, shown as a segmented pill.\n *\n * ```html\n * <div uioSegmentedControl [items]=\"ranges\" [(value)]=\"range\" aria-label=\"Range\"></div>\n * ```\n *\n * ── It is a radio group, and that is not cosmetic ───────────────────────────\n *\n * Every segment is a `<label>` wrapping a visually-hidden `<input type=\"radio\">`,\n * all sharing one `name`. That is Ark's anatomy — its `segment-group` is Zag's\n * radio-group machine under a different name, which is why the ids read\n * `radio-group:<machine>:radio:<value>` — and reproducing it is what makes the\n * keyboard work: **roving focus here is the browser's own**. A native radio\n * group is a single tab stop that lands on the checked control, and the arrow\n * keys move and select within it. Nothing in this file implements that, and\n * nothing should: a hand-rolled `keydown` would be a second, subtly different\n * implementation shadowing the one every user already knows.\n *\n * What the group *does* need is a shared `name`, which is why an unnamed control\n * still gets one — its own machine id, the only string guaranteed unique on the\n * page. Without it two segmented controls on one page would be one radio group.\n *\n * ── The indicator is measured, not laid out ─────────────────────────────────\n *\n * The sliding pill is a single absolutely-positioned element, and CSS has no way\n * to size it to \"whichever segment is checked\". Zag measures the checked item\n * and writes `--left`/`--top`/`--width`/`--height` inline; `.segmented__indicator`\n * reads all four. Reproduced here in an after-render hook, because the numbers\n * only exist once the row has been laid out.\n *\n * It is `hidden` until it has been measured — Zag's rule, and the one thing\n * about the pill a DOM comparison can see. An unmeasured pill would otherwise\n * paint a full-size block over the whole control on first frame.\n */\n@Component({\n selector: \"div[uioSegmentedControl]\",\n standalone: true,\n exportAs: \"uioSegmentedControl\",\n imports: [UioIcon],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioSegmentedControl), multi: true },\n ],\n template: `\n <div\n class=\"segmented__indicator\"\n data-scope=\"segment-group\"\n data-part=\"indicator\"\n [id]=\"partId('indicator')\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-orientation]=\"orientation()\"\n [attr.hidden]=\"rect() ? null : ''\"\n ></div>\n @for (item of items(); track item.value) {\n <!--\n Ark's Item *is* the <label>, and the radio it names is inside it. The\n label is what carries the segment's state; the input carries only what a\n form needs.\n -->\n <label\n class=\"segmented__item\"\n data-scope=\"segment-group\"\n data-part=\"item\"\n [id]=\"itemId(item.value)\"\n [attr.for]=\"inputId(item.value)\"\n [attr.data-state]=\"stateOf(item.value)\"\n [attr.data-disabled]=\"flag(isItemDisabled(item))\"\n [attr.data-focus]=\"flag(focusedValue() === item.value)\"\n [attr.data-focus-visible]=\"flag(focusVisibleValue() === item.value)\"\n [attr.data-hover]=\"flag(hoveredValue() === item.value)\"\n [attr.data-orientation]=\"orientation()\"\n (pointerenter)=\"onHover(item)\"\n (pointerleave)=\"hoveredItem.set(null)\"\n >\n @if (item.icon; as name) {\n <span uioIcon class=\"segmented__item-icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n <!--\n The text reports the *same* state as the label around it — Zag builds\n both out of one getItemDataAttrs, so a hovered segment marks its text\n too. Nothing in the stylesheet reads it there today; the contract does.\n -->\n <span\n class=\"segmented__item-text\"\n data-scope=\"segment-group\"\n data-part=\"item-text\"\n [id]=\"itemTextId(item.value)\"\n [attr.data-state]=\"stateOf(item.value)\"\n [attr.data-disabled]=\"flag(isItemDisabled(item))\"\n [attr.data-focus]=\"flag(focusedValue() === item.value)\"\n [attr.data-focus-visible]=\"flag(focusVisibleValue() === item.value)\"\n [attr.data-hover]=\"flag(hoveredValue() === item.value)\"\n [attr.data-orientation]=\"orientation()\"\n >{{ item.label }}</span>\n <input\n type=\"radio\"\n [id]=\"inputId(item.value)\"\n [attr.style]=\"HIDDEN\"\n [attr.data-ownedby]=\"rootId\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"item.value\"\n [attr.aria-labelledby]=\"itemTextId(item.value)\"\n [checked]=\"selectedValue() === item.value\"\n [disabled]=\"isItemDisabled(item)\"\n (change)=\"select(item.value)\"\n (focus)=\"onFocus($event, item.value)\"\n (blur)=\"onBlur()\"\n />\n </label>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n role: \"radiogroup\",\n \"[attr.aria-disabled]\": \"isDisabled() ? 'true' : null\",\n \"[attr.aria-orientation]\": \"orientation()\",\n \"[attr.aria-label]\": \"ariaLabel()\",\n },\n})\nexport class UioSegmentedControl extends UioPart implements ControlValueAccessor {\n readonly scope = \"segment-group\";\n readonly part = \"root\";\n\n readonly items = input<readonly SegmentedControlItem[]>([]);\n /** Uncontrolled until something binds it — see `UioSwitch`. Unset means the first item. */\n readonly value = model<string | undefined>(undefined);\n readonly valueChange = output<string>();\n readonly size = input<SegmentedControlSize>(\"md\");\n readonly name = input<string | undefined>(undefined);\n /**\n * The control renders no Label part, so this is the only thing that can name\n * it. Ark's own `aria-labelledby` would point at an element that never exists\n * — the dangling-IDREF failure `OMIT_ARIA` exists for in the other three — so\n * nothing is bound in its place.\n */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n override readonly disabled: Signal<boolean> = computed(\n () => this.disabledInput() || this.formDisabled(),\n );\n protected readonly isDisabled: Signal<boolean> = this.disabled;\n\n /**\n * Fixed, not an input. Ark's segment group takes an orientation and the shared\n * stylesheet lays the control out in one direction only — `.segmented` is an\n * `inline-grid` with `grid-auto-flow: column`. Declared because every part\n * reports it.\n */\n override readonly orientation: Signal<\"horizontal\"> = signal(\"horizontal\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly ICON_SIZE = ICON_SIZE;\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n protected readonly hostClass = computed(() => segmentedControlStyles({ size: this.size() }));\n\n /**\n * Ark builds every id as `<scope>:<machine>:<part>` — and this scope's ids say\n * `radio-group`, not `segment-group`, because the machine underneath is the\n * radio group's. It looks like a typo and it is the contract.\n */\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `radio-group:${this.machine}`;\n }\n protected partId(part: string): string {\n return `radio-group:${this.machine}:${part}`;\n }\n protected itemId(value: string): string {\n return this.partId(`radio:${value}`);\n }\n protected itemTextId(value: string): string {\n return this.partId(`radio:label:${value}`);\n }\n protected inputId(value: string): string {\n return this.partId(`radio:input:${value}`);\n }\n\n /** Radios in one group share a name; an unnamed control uses its own id. */\n protected readonly groupName = computed(() => this.name() ?? this.rootId);\n\n /**\n * The selected value, falling back to the first item.\n *\n * An uncontrolled control defaults to its first segment so the indicator has\n * somewhere to be — the same fallback React makes, and the reason there is no\n * \"nothing selected\" state to render.\n */\n protected readonly selectedValue = computed<string | undefined>(\n () => this.value() ?? this.items()[0]?.value,\n );\n\n /**\n * Which segment is focused, focused *visibly*, and hovered — three separate\n * questions, and none of them the root's own state.\n *\n * Named for the item rather than the state, because `UioPart` already owns\n * `focus`, `focusVisible` and `hover` as the *root's* booleans and a subclass\n * field of the same name would replace them: a control with one hovered\n * segment would report `data-hover` on the whole row, which Zag's\n * `getRootProps` never does.\n */\n private readonly focusedItem = signal<string | null>(null);\n private readonly focusVisibleItem = signal<string | null>(null);\n protected readonly hoveredItem = signal<string | null>(null);\n protected readonly focusedValue: Signal<string | null> = this.focusedItem;\n protected readonly focusVisibleValue: Signal<string | null> = this.focusVisibleItem;\n protected readonly hoveredValue: Signal<string | null> = this.hoveredItem;\n\n /** `null` until the row has been laid out, which is what keeps the pill hidden. */\n protected readonly rect = signal<IndicatorRect | null>(null);\n\n constructor() {\n super();\n afterRenderEffect({\n // Read through the signals so the pill re-measures when the selection\n // moves or the items change.\n earlyRead: () => {\n this.items();\n return this.measure(this.selectedValue());\n },\n write: (measured) => this.apply(measured()),\n });\n }\n\n protected stateOf(value: string): \"checked\" | \"unchecked\" {\n return this.selectedValue() === value ? \"checked\" : \"unchecked\";\n }\n /** A whole-control disable reaches every segment, and each may disable itself. */\n protected isItemDisabled(item: SegmentedControlItem): boolean {\n return !!item.disabled || this.isDisabled();\n }\n\n protected onHover(item: SegmentedControlItem): void {\n if (this.isItemDisabled(item)) return;\n this.hoveredItem.set(item.value);\n }\n\n /**\n * `:focus-visible` rather than a guess at whether the keyboard was used.\n *\n * Zag runs a focus-visible polyfill; the browser has the real answer, and\n * `.segmented__item[data-focus-visible]` is the entire focus ring in the\n * shared stylesheet. `matches` throws on browsers without the selector, which\n * is why it is guarded rather than trusted.\n */\n protected onFocus(event: FocusEvent, value: string): void {\n this.focusedItem.set(value);\n const input = event.target as HTMLInputElement;\n let visible = false;\n try {\n visible = input.matches(\":focus-visible\");\n } catch {\n visible = false;\n }\n this.focusVisibleItem.set(visible ? value : null);\n flushNow(this.appRef);\n }\n\n protected onBlur(): void {\n this.focusedItem.set(null);\n this.focusVisibleItem.set(null);\n this.onTouched();\n flushNow(this.appRef);\n }\n\n protected select(next: string): void {\n if (next === this.selectedValue()) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n flushNow(this.appRef);\n }\n\n /**\n * The checked segment's box, relative to the control.\n *\n * `offsetLeft`/`offsetTop` rather than two `getBoundingClientRect` calls\n * subtracted: `.segmented` is `position: relative`, so the segments' offset\n * parent *is* the control, and the numbers come out already in the coordinate\n * system `--left`/`--top` are read in — padding included, which is why the\n * first segment measures `4px` rather than `0`.\n */\n private measure(value: string | undefined): IndicatorRect | null {\n const index = this.items().findIndex((item) => item.value === value);\n if (index === -1) return null;\n // Index-aligned with `items()`, because one `@for` renders both — the same\n // arrangement `UioTabs` and `UioAccordion` use to reach their own elements.\n const item = this.host.nativeElement.querySelectorAll<HTMLElement>('[data-part=\"item\"]')[index];\n if (!item) return null;\n const rect = {\n left: item.offsetLeft,\n top: item.offsetTop,\n width: item.offsetWidth,\n height: item.offsetHeight,\n };\n // An unlaid-out row measures zero, and a zero-size pill is Zag's \"not ready\n // yet\" — reported as `null` so the element stays hidden rather than\n // painting a collapsed sliver.\n return rect.width === 0 && rect.height === 0 ? null : rect;\n }\n\n /**\n * Written straight onto the element rather than through a binding.\n *\n * This runs in an after-render hook, where setting a signal would schedule\n * another whole change-detection pass to move four custom properties. The\n * `hidden` attribute *is* bound, off `rect()`, because it is part of the\n * rendered contract and a stale one would be a real difference.\n */\n private apply(rect: IndicatorRect | null): void {\n const element = this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"indicator\"]');\n if (!element) return;\n this.rect.set(rect);\n if (!rect) return;\n element.style.setProperty(\"--left\", `${rect.left}px`);\n element.style.setProperty(\"--top\", `${rect.top}px`);\n element.style.setProperty(\"--width\", `${rect.width}px`);\n element.style.setProperty(\"--height\", `${rect.height}px`);\n // `left` is what actually moves the pill; the custom property is only where\n // the number is kept. Zag writes the same pair, and the stylesheet's\n // `--transition-duration` is what animates between them.\n element.style.setProperty(\"left\", \"var(--left)\");\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? undefined);\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n computed,\n effect,\n inject,\n input,\n signal,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport { avatarStyles, initials, type AvatarVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type AvatarSize = NonNullable<AvatarVariants[\"size\"]>;\nexport type AvatarShape = NonNullable<AvatarVariants[\"shape\"]>;\n\n/** Ark sizes the placeholder glyph by the avatar, not by the control scale. */\nconst ICON_SIZE: Record<AvatarSize, number> = { xs: 14, sm: 16, md: 20, lg: 24, xl: 32 };\n\n/**\n * A person, as a picture with a spoken-for fallback.\n *\n * ```html\n * <div uioAvatar name=\"Ada Lovelace\" src=\"/ada.png\"></div>\n * ```\n *\n * ── The whole component is the load state ───────────────────────────────────\n *\n * Everything else here is a class name. What Ark's machine actually does is\n * decide, at every moment, whether the image or the fallback is the one on\n * screen — and it renders **both**, swapping `hidden` and `data-state` between\n * them rather than mounting one or the other. That matters: a fallback that only\n * exists after the image has failed flashes empty on every slow connection, and\n * an image that is removed on error cannot recover when a later `src` works.\n *\n * So the image starts hidden even though it is in the DOM, and only a `load`\n * event promotes it. The `error` path goes back to the fallback rather than to\n * nothing.\n *\n * ── The case a `load` event never fires for ─────────────────────────────────\n *\n * A cached image is already `complete` before this component's view exists, so\n * its `load` fired before anything was listening and the avatar would sit on the\n * fallback forever. {@link checkImageStatus} is the same catch-up zag does: ask\n * the element whether it finished while nobody was watching. `naturalWidth` is\n * part of the question — a broken image is `complete` too.\n */\n@Component({\n selector: \"div[uioAvatar]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (src(); as source) {\n <img\n class=\"avatar__image\"\n data-scope=\"avatar\"\n data-part=\"image\"\n [id]=\"partId('image')\"\n [src]=\"source\"\n [attr.alt]=\"alt() ?? name()\"\n [attr.hidden]=\"loaded() ? null : ''\"\n [attr.data-state]=\"loaded() ? 'visible' : 'hidden'\"\n (load)=\"loaded.set(true)\"\n (error)=\"loaded.set(false)\"\n />\n }\n <span\n class=\"avatar__fallback\"\n data-scope=\"avatar\"\n data-part=\"fallback\"\n [id]=\"partId('fallback')\"\n [attr.hidden]=\"loaded() ? '' : null\"\n [attr.data-state]=\"loaded() ? 'hidden' : 'visible'\"\n >\n @if (fallback(); as text) {\n {{ text }}\n } @else if (name(); as person) {\n {{ toInitials(person) }}\n } @else {\n <span uioIcon [name]=\"glyph('user')\" [size]=\"iconSize()\"></span>\n }\n </span>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioAvatar extends UioPart implements AfterViewInit {\n protected readonly glyph = glyph;\n readonly scope = \"avatar\";\n readonly part = \"root\";\n\n readonly src = input<string | undefined>(undefined);\n /** Falls back to `name`, which is what a reader would have said anyway. */\n readonly alt = input<string | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n /** Overrides the derived initials. A string, because the fallback is text. */\n readonly fallback = input<string | undefined>(undefined);\n readonly size = input<AvatarSize>(\"md\");\n readonly shape = input<AvatarShape | undefined>(undefined);\n\n private readonly machine = nextMachineId();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** `false` covers both \"still loading\" and \"failed\" — Ark shows the fallback for both. */\n protected readonly loaded = signal(false);\n\n protected readonly toInitials = initials;\n protected readonly iconSize = computed(() => ICON_SIZE[this.size()]);\n protected readonly hostClass = computed(() =>\n clsx(avatarStyles({ size: this.size(), shape: this.shape() })),\n );\n\n get rootId(): string {\n return `avatar:${this.machine}`;\n }\n protected partId(part: string): string {\n return `avatar:${this.machine}:${part}`;\n }\n\n constructor() {\n super();\n // A new `src` is a new load. Without this an avatar that swapped a good\n // image for a broken one would keep showing the old one's success.\n effect(() => {\n this.src();\n this.loaded.set(false);\n queueMicrotask(() => this.checkImageStatus());\n });\n }\n\n ngAfterViewInit(): void {\n this.checkImageStatus();\n }\n\n /** The catch-up for an image that finished before anything was listening. */\n private checkImageStatus(): void {\n const image = this.host.nativeElement.querySelector<HTMLImageElement>('[data-part=\"image\"]');\n if (!image?.complete) return;\n this.loaded.set(image.naturalWidth !== 0 && image.naturalHeight !== 0);\n }\n}\n","import { Component, computed, input, type Signal } from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport { progressStyles, type ProgressVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\n\nexport type ProgressVariant = NonNullable<ProgressVariants[\"variant\"]>;\nexport type ProgressSize = NonNullable<ProgressVariants[\"size\"]>;\nexport type ProgressShape = NonNullable<ProgressVariants[\"shape\"]>;\n\n/**\n * The geometry Ark writes onto both circles, as an inline style string.\n *\n * Every value is a CSS custom property or a geometry property the ring's own\n * rule fills in, so this is layout the component owns rather than theming — a\n * class would put half of a single calculation in the stylesheet and leave the\n * other half here.\n */\nconst CIRCLE_GEOMETRY =\n \"--radius: calc(var(--size) / 2 - var(--thickness) / 2); cx: calc(var(--size) / 2); \" +\n \"cy: calc(var(--size) / 2); r: var(--radius); fill: transparent; \" +\n \"stroke-width: var(--thickness);\";\n\n/**\n * A task in flight, as a bar or a ring.\n *\n * ```html\n * <div uioProgress [value]=\"40\" label=\"Uploading\" showValue></div>\n * <div uioProgress [value]=\"null\"></div>\n * ```\n *\n * Distinct from `UioMeter`, which reports a static measurement and can never be\n * indeterminate. This can, and that fork is the component: a `null` value drops\n * `data-value`, drops `aria-valuenow`, drops the width entirely so the CSS\n * animation owns it, and reports `data-state=\"indeterminate\"` — which is the one\n * attribute `Progress.css` selects on. A port that treated `null` as zero would\n * render a bar that is merely empty, and pass every static check.\n *\n * ── The three numbers ───────────────────────────────────────────────────────\n *\n * `value` is the caller's, `data-max` and `aria-valuemax` are the range, and\n * everything a human reads — the value text, and the `aria-label` on the\n * progressbar — is the **percentage**, formatted. Ark does not announce \"3 of\n * 5\"; it announces \"60%\". Reproducing that means the formatter, not string\n * concatenation, because a locale decides where the sign goes.\n */\n@Component({\n selector: \"div[uioProgress]\",\n standalone: true,\n template: `\n @if (showHeader()) {\n <div class=\"progress__header text-default-body-small\">\n @if (label(); as text) {\n <span\n class=\"progress__label\"\n data-scope=\"progress\"\n data-part=\"label\"\n data-orientation=\"horizontal\"\n [id]=\"partId('label')\"\n >{{ text }}</span\n >\n }\n <!--\n A ring has room inside it, so the value sits in the middle rather than\n in the header — see the circular branch below. The header itself still\n renders, empty, exactly as it does in the other three: showValue\n alone is enough to ask for one.\n -->\n @if (showValue() && !isCircular()) {\n <span\n class=\"progress__value\"\n data-scope=\"progress\"\n data-part=\"value-text\"\n aria-live=\"polite\"\n >{{ percentText() }}</span\n >\n }\n </div>\n }\n @if (isCircular()) {\n <div class=\"progress__circle-wrap\">\n <svg\n class=\"progress__circle\"\n data-scope=\"progress\"\n data-part=\"circle\"\n role=\"progressbar\"\n data-orientation=\"horizontal\"\n style=\"width: var(--size); height: var(--size);\"\n [id]=\"partId('circle')\"\n [attr.aria-label]=\"valueText()\"\n [attr.data-max]=\"max()\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.data-state]=\"state()\"\n >\n <circle\n class=\"progress__circle-track\"\n data-scope=\"progress\"\n data-part=\"circle-track\"\n data-orientation=\"horizontal\"\n [attr.style]=\"CIRCLE_GEOMETRY\"\n ></circle>\n <circle\n class=\"progress__circle-range\"\n data-scope=\"progress\"\n data-part=\"circle-range\"\n [attr.data-state]=\"state()\"\n [attr.style]=\"rangeGeometry()\"\n ></circle>\n </svg>\n @if (showValue()) {\n <span\n class=\"progress__circle-value text-emphasis-body-medium\"\n data-scope=\"progress\"\n data-part=\"value-text\"\n aria-live=\"polite\"\n >{{ percentText() }}</span\n >\n }\n </div>\n } @else {\n <div\n class=\"progress__track\"\n data-scope=\"progress\"\n data-part=\"track\"\n role=\"progressbar\"\n data-orientation=\"horizontal\"\n [id]=\"partId('track')\"\n [attr.aria-label]=\"valueText()\"\n [attr.data-max]=\"max()\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.data-state]=\"state()\"\n >\n <div\n class=\"progress__indicator\"\n data-scope=\"progress\"\n data-part=\"range\"\n data-orientation=\"horizontal\"\n [attr.data-state]=\"state()\"\n [style.width]=\"indeterminate() ? null : percent() + '%'\"\n ></div>\n </div>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.data-max]\": \"max()\",\n /** Dropped entirely when indeterminate, not written as an empty string. */\n \"[attr.data-value]\": \"value()\",\n /**\n * Written as the whole `style` attribute rather than through\n * `[style.--percent]`, so the custom property reaches the element the same\n * way in a JIT-compiled spec as it does in the built package. `Progress.css`\n * reads `--percent`; nothing else on this host is styled inline.\n */\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioProgress extends UioPart {\n readonly scope = \"progress\";\n readonly part = \"root\";\n\n /** `null` is the indeterminate case, and is the default in every library here. */\n readonly value = input<number | null>(null);\n readonly max = input(100);\n readonly label = input<string | undefined>(undefined);\n readonly showValue = input(false);\n readonly variant = input<ProgressVariant>(\"default\");\n readonly size = input<ProgressSize>(\"md\");\n readonly shape = input<ProgressShape>(\"linear\");\n\n /** Ark's Progress has no `min` prop; the floor of the range is always zero. */\n protected readonly min = 0;\n protected readonly CIRCLE_GEOMETRY = CIRCLE_GEOMETRY;\n\n private readonly machine = nextMachineId();\n\n protected readonly indeterminate = computed(() => this.value() === null);\n protected readonly isCircular = computed(() => this.shape() === \"circular\");\n protected readonly showHeader = computed(() => this.label() != null || this.showValue());\n\n /**\n * Zag's three words, and the reason `complete` exists separately from\n * `loading`: a bar that has finished is a different thing from one that is\n * nearly there, and the stylesheet is free to say so.\n */\n override readonly state: Signal<string> = computed(() => {\n const value = this.value();\n if (value === null) return \"indeterminate\";\n return value === this.max() ? \"complete\" : \"loading\";\n });\n override readonly orientation: Signal<\"horizontal\"> = computed(() => \"horizontal\");\n\n protected readonly percent = computed(() => {\n const value = this.value();\n if (value === null) return -1;\n const max = this.max();\n // A zero-width range would divide by zero; an empty bar is the honest read.\n return max > 0 ? (value / max) * 100 : 0;\n });\n\n private readonly formatter = computed(\n () => new Intl.NumberFormat(undefined, { style: \"percent\" }),\n );\n\n /** What `ValueText` shows: the percentage, never the raw value. */\n protected readonly percentText = computed(() =>\n this.indeterminate() ? \"\" : this.formatter().format(this.percent() / 100),\n );\n\n /**\n * The progressbar's accessible name.\n *\n * Ark names the bar after its own reading rather than after the label beside\n * it, and says \"loading...\" while there is no reading to give. Both are what a\n * screen reader announces, so both are contract.\n */\n protected readonly valueText = computed(() =>\n this.indeterminate() ? \"loading...\" : this.percentText(),\n );\n\n protected readonly hostClass = computed(() =>\n clsx(progressStyles({ variant: this.variant(), size: this.size(), shape: this.shape() })),\n );\n\n /** No `--percent` at all while indeterminate: the animation owns the fill. */\n protected readonly rootStyle = computed(() =>\n this.indeterminate() ? null : `--percent: ${this.percent()};`,\n );\n\n /**\n * The ring's stroke, expressed the way zag does: as custom properties the\n * dash offset is computed from, so the arc animates in CSS rather than being\n * re-measured on every value change.\n */\n protected readonly rangeGeometry = computed(() => {\n const dashArray = this.indeterminate() ? \"\" : \"stroke-dasharray: var(--circumference);\";\n return (\n `${CIRCLE_GEOMETRY} --percent: ${this.percent()}; ` +\n \"--circumference: calc(2 * 3.14159 * var(--radius)); \" +\n \"--offset: calc(var(--circumference) * (100 - var(--percent)) / 100); \" +\n \"stroke-dashoffset: calc(var(--circumference) * ((100 - var(--percent)) / 100)); \" +\n `${dashArray} transform-origin: center center; transform: rotate(-90deg);`\n );\n });\n\n /**\n * Dashes, not colons — Progress is the one machine in this package whose zag\n * ids are `progress-<id>-<part>` rather than `<scope>:<id>:<part>`.\n *\n * Worth copying rather than tidying. The parity harness recovers a machine id\n * by stripping `<scope>:` and `:<part>` off an element's id, and only then can\n * it compare a reference that names the machine rather than an element. A\n * colon-shaped id here would give Angular a machine placeholder React does not\n * have, which is a difference invented by the port.\n */\n get rootId(): string {\n return `progress-${this.machine}`;\n }\n protected partId(part: string): string {\n return `progress-${this.machine}-${part}`;\n }\n}\n","import {\n Component,\n DOCUMENT,\n OnDestroy,\n computed,\n inject,\n input,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n clipboardStyles,\n type ClipboardVariants,\n type ControlSize,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioIcon } from \"../icons/icon.js\";\n\nexport type ClipboardSize = NonNullable<ClipboardVariants[\"size\"]>;\nexport type ClipboardVariant = NonNullable<ClipboardVariants[\"variant\"]>;\n\n/**\n * A value with a copy button attached.\n *\n * ```html\n * <div uioClipboard value=\"https://ui-organized.dev\" label=\"Share link\"></div>\n * ```\n *\n * ── `data-copied`, on four elements at once ─────────────────────────────────\n *\n * The state is one boolean and Ark writes it onto the root, the label, the\n * control, the input **and** the trigger, so a stylesheet can react at whichever\n * level it needs to. None of those is `UioPart` vocabulary — `data-copied` is\n * this machine's own word — so each one is written here, where they are visible\n * together.\n *\n * ── Two things Ark spells oddly, and both are reproduced ────────────────────\n *\n * The input reports `data-readonly=\"true\"`, not the presence-only `\"\"` that\n * every other boolean state attribute in this system uses. That is zag's own\n * inconsistency rather than a decision, and it is not this port's to correct:\n * the gate compares attribute *values*, so `stateFlag` here would be a\n * difference invented by Angular. It is safe because no stylesheet selects on\n * it — see `state-contract.json`, where Clipboard reads no attributes at all.\n *\n * The trigger's accessible name changes with the state (\"Copy to clipboard\" →\n * \"Copied to clipboard\") independently of its visible label, which is what makes\n * the swap announced rather than merely seen.\n *\n * ── The copy itself ─────────────────────────────────────────────────────────\n *\n * The copied state is entered whether or not the write succeeds, exactly as the\n * machine does — a clipboard permission the page does not have is not something\n * the user can act on, and a button that appears to do nothing is worse than one\n * that lies. The rejection is *caught* here where React lets it reject\n * unhandled; that changes no DOM, and an unhandled rejection in a consumer's app\n * is noise they cannot silence.\n */\n@Component({\n selector: \"div[uioClipboard]\",\n standalone: true,\n imports: [UioButton, UioIcon],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"clipboard\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-copied]=\"flag(copied())\"\n >{{ text }}</label\n >\n }\n <div\n class=\"clipboard__control\"\n data-scope=\"clipboard\"\n data-part=\"control\"\n [attr.data-copied]=\"flag(copied())\"\n >\n @if (variant() === \"input\") {\n <!--\n Read-only rather than disabled: the value still has to be selectable\n with a pointer, and a disabled input is not.\n -->\n <input\n class=\"clipboard__input\"\n data-scope=\"clipboard\"\n data-part=\"input\"\n readonly\n data-readonly=\"true\"\n [id]=\"partId('input')\"\n [attr.value]=\"value()\"\n [attr.data-copied]=\"flag(copied())\"\n (focus)=\"selectAll($event)\"\n />\n }\n <!--\n The trigger *is* the library button, so the copy control inherits every\n interactive token instead of restating them. React reaches the same place\n through Ark's asChild; Angular just puts both on one element.\n -->\n <button\n uioButton\n intent=\"secondary\"\n type=\"button\"\n data-scope=\"clipboard\"\n data-part=\"trigger\"\n [size]=\"size()\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.data-copied]=\"flag(copied())\"\n (click)=\"copy()\"\n >\n <!--\n Both the glyph and the word swap, and each sits in its own Indicator —\n the same two elements Ark renders, so the shared stylesheet's\n .clipboard__indicator still selects the icon alone.\n -->\n <div class=\"clipboard__indicator\" data-scope=\"clipboard\" data-part=\"indicator\">\n <span uioIcon [name]=\"copied() ? 'check' : 'copy'\" [size]=\"iconSize()\"></span>\n </div>\n <div data-scope=\"clipboard\" data-part=\"indicator\">\n {{ copied() ? copiedLabel() : copyLabel() }}\n </div>\n </button>\n </div>\n @if (helperText(); as text) {\n <span class=\"field__description\">{{ text }}</span>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.data-copied]\": \"flag(copied())\",\n },\n})\nexport class UioClipboard extends UioPart implements OnDestroy {\n readonly scope = \"clipboard\";\n readonly part = \"root\";\n\n readonly value = input(\"\");\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n readonly variant = input<ClipboardVariant>(\"input\");\n readonly size = input<ClipboardSize>(\"md\");\n readonly copyLabel = input(\"Copy\");\n readonly copiedLabel = input(\"Copied\");\n /** Milliseconds the copied state stays visible. Ark's default is 3000. */\n readonly timeout = input(3000);\n readonly statusChange = output<boolean>();\n\n private readonly machine = nextMachineId();\n private readonly document = inject(DOCUMENT);\n private revert?: ReturnType<typeof setTimeout>;\n\n protected readonly copied = signal(false);\n protected readonly flag = stateFlag;\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n\n /**\n * Deliberately *not* `UioPart.readOnly`.\n *\n * The base writes a presence-only `data-readonly=\"\"`, which is right for every\n * other control in this library and wrong here: zag's clipboard input carries\n * the literal `\"true\"`. The root, which is what this class is, reports no\n * read-only state at all — only the input does, and it does it in the\n * template.\n */\n override readonly readOnly: Signal<boolean> = signal(false);\n\n protected readonly triggerLabel = computed(() =>\n this.copied() ? \"Copied to clipboard\" : \"Copy to clipboard\",\n );\n protected readonly hostClass = computed(() =>\n clsx(clipboardStyles({ size: this.size(), variant: this.variant() })),\n );\n\n get rootId(): string {\n return `clip:${this.machine}`;\n }\n protected partId(part: string): string {\n return `clip:${this.machine}:${part}`;\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.revert);\n }\n\n /** Focusing the value box selects it, so a keyboard user can copy manually. */\n protected selectAll(event: Event): void {\n (event.target as HTMLInputElement | null)?.select();\n }\n\n copy(): void {\n void this.write(this.value());\n this.copied.set(true);\n this.statusChange.emit(true);\n // Restarted rather than stacked: a second copy while the first is still\n // showing must extend the state, not revert it early.\n clearTimeout(this.revert);\n this.revert = setTimeout(() => this.copied.set(false), this.timeout());\n }\n\n /**\n * The async clipboard where it exists, and a selected off-screen node where it\n * does not — the same two paths zag takes, in the same order.\n */\n private async write(text: string): Promise<void> {\n const view = this.document.defaultView;\n try {\n if (view?.navigator.clipboard?.writeText) {\n await view.navigator.clipboard.writeText(text);\n return;\n }\n const node = this.document.createElement(\"pre\");\n Object.assign(node.style, { width: \"1px\", height: \"1px\", position: \"fixed\", top: \"5px\" });\n node.textContent = text;\n this.document.body.appendChild(node);\n const selection = view?.getSelection();\n if (selection) {\n selection.removeAllRanges();\n const range = this.document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n this.document.execCommand(\"copy\");\n selection.removeAllRanges();\n }\n node.remove();\n } catch {\n // A page without clipboard permission cannot be given one from here, and\n // the state has already flipped — see the class comment.\n }\n }\n}\n","import {\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport { NgTemplateOutlet } from \"@angular/common\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n listboxStyles,\n type ControlSize,\n type ListboxVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { firstEnabled } from \"../overlay/roving.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type ListboxSize = NonNullable<ListboxVariants[\"size\"]>;\nexport type ListboxVariant = NonNullable<ListboxVariants[\"variant\"]>;\nexport type ListboxSelectionMode = \"single\" | \"multiple\" | \"extended\";\n\nexport interface ListboxOption {\n /** Form value submitted when the option is selected. */\n value: string;\n /** Display text. */\n label: string;\n /** Prevents selection while keeping the option visible. */\n disabled?: boolean;\n /** Group heading this option belongs under. Options sharing a group render together. */\n group?: string;\n}\n\n/** One rendered bucket: a group heading with its options, or `null` for the ungrouped ones. */\ninterface OptionGroup {\n key: string | null;\n /** Stable per bucket, so the group and its label can name each other by id. */\n id: string;\n options: ListboxOption[];\n}\n\n/**\n * An always-visible list of choices — the popup half of a Select, standing on\n * its own.\n *\n * ```html\n * <div uioListbox [options]=\"fruit\" label=\"Fruit\" [(value)]=\"picked\"></div>\n * ```\n *\n * ── The list keeps focus; the option is only named ──────────────────────────\n *\n * One tab stop, on the content, and the option a user is on is named by\n * `aria-activedescendant` rather than focused. That is why `[data-highlighted]`\n * — which is the whole hover-and-arrow treatment in `Listbox.css` — sits on an\n * element that does not have DOM focus.\n *\n * ── The trap: a highlight is not the same as an active descendant ───────────\n *\n * They look like one state and are two, and the difference is visible the moment\n * anyone clicks. Zag reports an option as highlighted only when the *modality is\n * keyboard*:\n *\n * ```js\n * highlighted: highlighted && (inputState.focused ? focused : focusVisible)\n * ```\n *\n * So clicking an option sets `aria-activedescendant` to it and paints no\n * highlight; pressing ArrowDown next paints one. A port that drove\n * `data-highlighted` straight off the highlighted value would light up an option\n * under the mouse pointer that Ark leaves alone, on every click, in a component\n * whose entire visual state is that attribute.\n *\n * {@link keyboardModality} is the local stand-in for zag's document-wide focus\n * modality: a pointer press inside the list clears it and a keypress sets it,\n * which is the same answer for everything this component can observe.\n *\n * ── Two behaviours worth not \"fixing\" ───────────────────────────────────────\n *\n * Arrow keys do **not** wrap — `loopFocus` is off — so ArrowDown at the end of\n * the list stays put rather than jumping to the top. And arrowing does not\n * select: `selectOnHighlight` is off, so the selection only moves on click,\n * Enter or Space. Both differ from `UioMenu`, and both are Ark's.\n */\n@Component({\n selector: \"div[uioListbox]\",\n standalone: true,\n imports: [NgTemplateOutlet, UioIcon],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioListbox), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <span\n class=\"listbox__label\"\n data-scope=\"listbox\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.data-disabled]=\"flag(disabled())\"\n >{{ text }}</span\n >\n }\n <!--\n aria-labelledby names the label part whether or not one was rendered —\n Ark emits it unconditionally, and the reference dangles in a listbox with\n no label. Reproduced rather than corrected: the harness compares the\n reference, and \"Angular alone drops it\" is a difference this port would\n have invented.\n -->\n <div\n class=\"listbox__content\"\n data-scope=\"listbox\"\n data-part=\"content\"\n role=\"listbox\"\n tabindex=\"0\"\n data-layout=\"list\"\n style=\"--column-count: 1;\"\n [id]=\"partId('content')\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-labelledby]=\"partId('label')\"\n [attr.aria-multiselectable]=\"multiple() ? 'true' : null\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.data-activedescendant]=\"activeDescendant()\"\n [attr.data-empty]=\"flag(!options().length)\"\n (focus)=\"onFocus()\"\n (blur)=\"focused.set(false)\"\n (keydown)=\"onKeydown($event)\"\n (pointerdown)=\"keyboardModality.set(false)\"\n >\n @for (group of groups(); track group.id) {\n @if (group.key === null) {\n @for (option of group.options; track option.value) {\n <ng-container\n [ngTemplateOutlet]=\"item\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n />\n }\n } @else {\n <div\n class=\"listbox__group\"\n data-scope=\"listbox\"\n data-part=\"item-group\"\n role=\"group\"\n [id]=\"groupId(group.id)\"\n [attr.aria-labelledby]=\"groupLabelId(group.id)\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-disabled]=\"flag(disabled())\"\n >\n <div\n class=\"listbox__group-label\"\n data-scope=\"listbox\"\n data-part=\"item-group-label\"\n role=\"presentation\"\n [id]=\"groupLabelId(group.id)\"\n >\n {{ group.key }}\n </div>\n @for (option of group.options; track option.value) {\n <ng-container\n [ngTemplateOutlet]=\"item\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n />\n }\n </div>\n }\n }\n <!-- Ark renders the Empty part only when the collection has no items. -->\n @if (!options().length) {\n <!--\n A listbox must own \"option\" or \"group\" children, and with no items it\n has neither — axe rates that critical, because a screen reader entering\n the list is told it is a listbox and then finds nothing in it. A\n disabled option is the conventional answer: the list is never\n childless, and what the user hears (\"No results, dimmed\") is true.\n Same markup as the other three libraries.\n -->\n <div class=\"listbox__empty\" role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {{ emptyMessage() }}\n </div>\n }\n </div>\n\n <ng-template #item let-option>\n <div\n class=\"listbox__item\"\n data-scope=\"listbox\"\n data-part=\"item\"\n role=\"option\"\n data-layout=\"list\"\n [id]=\"optionId(option.value)\"\n [attr.data-value]=\"option.value\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-selected]=\"isSelected(option.value) ? 'true' : 'false'\"\n [attr.data-selected]=\"flag(isSelected(option.value))\"\n [attr.data-state]=\"isSelected(option.value) ? 'checked' : 'unchecked'\"\n [attr.data-highlighted]=\"flag(isHighlighted(option.value))\"\n [attr.data-disabled]=\"flag(isDisabled(option))\"\n [attr.aria-disabled]=\"isDisabled(option) ? 'true' : null\"\n (mousedown)=\"onItemMouseDown($event)\"\n (click)=\"choose(option, $event)\"\n >\n <div\n class=\"listbox__item-text\"\n data-scope=\"listbox\"\n data-part=\"item-text\"\n [attr.data-state]=\"isSelected(option.value) ? 'checked' : 'unchecked'\"\n [attr.data-highlighted]=\"flag(isHighlighted(option.value))\"\n [attr.data-disabled]=\"flag(isDisabled(option))\"\n >\n {{ option.label }}\n </div>\n <div\n class=\"listbox__item-indicator\"\n data-scope=\"listbox\"\n data-part=\"item-indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"isSelected(option.value) ? 'checked' : 'unchecked'\"\n [attr.hidden]=\"isSelected(option.value) ? null : ''\"\n >\n <span uioIcon [name]=\"glyph('check')\" [size]=\"iconSize()\"></span>\n </div>\n </div>\n </ng-template>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioListbox extends UioPart implements ControlValueAccessor {\n protected readonly glyph = glyph;\n readonly scope = \"listbox\";\n readonly part = \"root\";\n\n readonly options = input<readonly ListboxOption[]>([]);\n readonly label = input<string | undefined>(undefined);\n /** Uncontrolled until something binds it — see `UioSwitch` on the same fork. */\n readonly value = model<string[]>([]);\n readonly selectionMode = input<ListboxSelectionMode>(\"single\");\n readonly size = input<ListboxSize>(\"md\");\n readonly variant = input<ListboxVariant>(\"default\");\n readonly emptyMessage = input(\"No options\");\n readonly valueChange = output<string[]>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n override readonly disabled: Signal<boolean> = computed(\n () => this.disabledInput() || this.formDisabled(),\n );\n override readonly orientation: Signal<\"vertical\"> = computed(() => \"vertical\");\n\n private readonly machine = nextMachineId();\n\n /** Whether the content has DOM focus. Half of what makes a highlight visible. */\n protected readonly focused = signal(false);\n /**\n * Whether the user is driving this by keyboard.\n *\n * Zag reads a document-wide focus modality; this is the same question narrowed\n * to what one component can see. Cleared by a pointer press inside the list,\n * set by a keypress in it.\n *\n * Named for the modality rather than `focusVisible`, which is `UioPart`\n * vocabulary: overriding that would put `data-focus-visible` on the root the\n * moment a key was pressed, and Ark puts none there.\n */\n protected readonly keyboardModality = signal(false);\n private readonly highlightedValue = signal<string | null>(null);\n\n protected readonly flag = stateFlag;\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n protected readonly hostClass = computed(() =>\n clsx(listboxStyles({ size: this.size(), variant: this.variant() })),\n );\n\n /** `extended` is multi-select too — it only adds shift-ranges on top. */\n protected readonly multiple = computed(() => this.selectionMode() !== \"single\");\n\n protected readonly activeDescendant = computed(() => {\n const value = this.highlightedValue();\n return value === null ? null : this.optionId(value);\n });\n\n /**\n * Options bucketed by `group`, in declaration order, with the ungrouped ones\n * keeping a bucket of their own.\n *\n * The `null` bucket must render its options *unwrapped*: an `ItemGroup` with\n * no heading announces a group with no name, which is worse than no group.\n */\n protected readonly groups = computed<OptionGroup[]>(() => {\n const buckets = new Map<string | null, OptionGroup>();\n for (const option of this.options()) {\n const key = option.group ?? null;\n const bucket = buckets.get(key);\n if (bucket) bucket.options.push(option);\n else buckets.set(key, { key, id: `g${buckets.size}`, options: [option] });\n }\n return [...buckets.values()];\n });\n\n get rootId(): string {\n return `listbox:${this.machine}`;\n }\n protected partId(part: string): string {\n return `listbox:${this.machine}:${part}`;\n }\n /** Ark's option ids carry the value, so two listboxes on a page cannot collide. */\n optionId(value: string): string {\n return this.partId(`item:${value}`);\n }\n protected groupId(key: string): string {\n return this.partId(`item-group:${key}`);\n }\n protected groupLabelId(key: string): string {\n return this.partId(`item-group-label:${key}`);\n }\n\n protected isSelected(value: string): boolean {\n return this.value().includes(value);\n }\n protected isDisabled(option: ListboxOption): boolean {\n return this.disabled() || !!option.disabled;\n }\n protected isHighlighted(value: string): boolean {\n return this.highlightedValue() === value && this.focused() && this.keyboardModality();\n }\n\n /**\n * Ark focuses the content on mousedown rather than letting the click land\n * where it may — without it a click on an option's text leaves focus on the\n * body and the next arrow key goes nowhere.\n */\n protected onItemMouseDown(event: MouseEvent): void {\n event.preventDefault();\n (event.currentTarget as HTMLElement).closest<HTMLElement>('[data-part=\"content\"]')?.focus();\n }\n\n protected onFocus(): void {\n this.focused.set(true);\n // A list arrived at with nothing chosen opens on its first option, so the\n // first arrow key moves from somewhere rather than from nothing.\n if (this.value().length || this.highlightedValue() !== null) return;\n const first = this.enabledIndex(0, 1);\n if (first !== -1) this.highlightedValue.set(this.options()[first]!.value);\n }\n\n protected choose(option: ListboxOption, event: MouseEvent): void {\n if (this.isDisabled(option)) return;\n this.highlightedValue.set(option.value);\n this.select(option.value, event.shiftKey, event.ctrlKey || event.metaKey);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const options = this.options();\n const current = options.findIndex((option) => option.value === this.highlightedValue());\n\n const moveTo = (index: number) => {\n // Set before the guard: the modality changed even if the highlight had\n // nowhere to go, and it is what makes the *current* highlight visible.\n this.keyboardModality.set(true);\n const next = options[index];\n // No `preventDefault` when nothing moves, so a listbox at the end of its\n // list still scrolls the page — which is what Ark leaves the browser to do.\n if (!next) return;\n event.preventDefault();\n this.highlightedValue.set(next.value);\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n // No wrap: `loopFocus` is off, so the end of the list is the end.\n return moveTo(current === -1 ? this.enabledIndex(0, 1) : this.enabledIndex(current + 1, 1));\n case \"ArrowUp\":\n return moveTo(\n current === -1\n ? this.enabledIndex(options.length - 1, -1)\n : this.enabledIndex(current - 1, -1),\n );\n case \"Home\":\n return moveTo(this.enabledIndex(0, 1));\n case \"End\":\n return moveTo(this.enabledIndex(options.length - 1, -1));\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n this.keyboardModality.set(true);\n const option = options[current];\n if (option && !this.isDisabled(option)) {\n this.select(option.value, event.shiftKey, event.ctrlKey || event.metaKey);\n }\n return;\n }\n default:\n return;\n }\n }\n\n private enabledIndex(from: number, step: number): number {\n return firstEnabled(\n this.options().map((option) => ({ disabled: this.isDisabled(option) })),\n from,\n step,\n );\n }\n\n /**\n * Ark's three selection modes, which differ only in what a plain click means.\n *\n * `single` replaces — and does *not* deselect, because `deselectable` is off,\n * so clicking the chosen option again leaves it chosen. `multiple` always\n * toggles. `extended` replaces on a plain click, toggles with a modifier, and\n * takes a range with Shift.\n */\n private select(value: string, shiftKey: boolean, metaKey: boolean): void {\n const mode = this.selectionMode();\n const current = this.value();\n let next: string[];\n\n if (mode === \"single\") {\n next = [value];\n } else if (shiftKey && current.length) {\n next = this.range(current[current.length - 1]!, value);\n } else if (mode === \"multiple\" || metaKey) {\n next = current.includes(value)\n ? current.filter((entry) => entry !== value)\n : [...current, value];\n } else {\n next = [value];\n }\n\n if (next.length === current.length && next.every((entry, index) => entry === current[index])) {\n return;\n }\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n /** Every selectable option between two values, inclusive, in list order. */\n private range(from: string, to: string): string[] {\n const options = this.options();\n const start = options.findIndex((option) => option.value === from);\n const end = options.findIndex((option) => option.value === to);\n if (start === -1 || end === -1) return [to];\n const [low, high] = start <= end ? [start, end] : [end, start];\n return options\n .slice(low, high + 1)\n .filter((option) => !this.isDisabled(option))\n .map((option) => option.value);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string[]) => void = () => {};\n\n writeValue(value: string[] | null): void {\n this.value.set(value ?? []);\n }\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n OnDestroy,\n computed,\n inject,\n input,\n signal,\n} from \"@angular/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\n\nexport type ScrollAreaOrientation = \"vertical\" | \"horizontal\" | \"both\";\ntype Axis = \"vertical\" | \"horizontal\";\n\n/** Ark never draws a thumb smaller than this, however long the content is. */\nconst MIN_THUMB_SIZE = 20;\n/** How long after the last scroll event the scrollbar stays lit. Zag's number. */\nconst SCROLL_TIMEOUT = 1000;\n/** Zag's tolerance for \"the scroll is resting on that edge\", in pixels. */\nconst EDGE_THRESHOLD = 1;\n\ninterface Sides {\n top: boolean;\n right: boolean;\n bottom: boolean;\n left: boolean;\n}\n\n/**\n * A scrollable box with a themed scrollbar instead of the platform one.\n *\n * ```html\n * <div uioScrollArea [style.height.px]=\"200\">…</div>\n * ```\n *\n * ── This component is a measurement ─────────────────────────────────────────\n *\n * Everything that makes a scroll area look like one is written *after* the\n * browser has laid it out. `data-overflow-x` / `data-overflow-y` say whether\n * there is anything to scroll, `--thumb-height` sizes the thumb to the\n * proportion of content on screen, and `--corner-width` reserves the square\n * where two scrollbars meet. None of them can exist in static markup, which is\n * why the parity gate waits for `[data-overflow-y]` before it compares anything:\n * a port that rendered the whole anatomy and never measured would produce a\n * scroll area with an invisible scrollbar and pass every static check.\n *\n * There are three things to re-measure on, and all three are needed:\n *\n * - the content resizing (`ResizeObserver`), which is the common case;\n * - the viewport becoming visible (`IntersectionObserver`), because an area\n * inside a closed accordion measures zero and would keep that answer;\n * - scrolling, which moves the thumb and changes which edge is reached.\n *\n * ── The bit that is not measurement ─────────────────────────────────────────\n *\n * `data-hover` and `data-scrolling` are what `ScrollArea.css` fades the\n * scrollbar in on, and `data-scrolling` is a *decaying* state — it turns itself\n * off a second after the last scroll rather than on any event. A port that only\n * ever set it would leave every scrollbar permanently visible.\n *\n * `data-ownedby` is on every part but the root, naming the root by id. Ark emits\n * it so a scrollbar rendered outside the root's subtree is still findable;\n * nothing in this system reads it, and it is reproduced because the gate\n * compares it.\n */\n@Component({\n selector: \"div[uioScrollArea]\",\n standalone: true,\n template: `\n <!--\n The viewport is the element that scrolls, and a pointer drag is the only\n way to reach content below the fold unless the content itself can take\n focus. Prose and tables depend on this tab stop; links and inputs make it\n redundant but harmless.\n -->\n <div\n class=\"scroll-area__viewport\"\n data-scope=\"scroll-area\"\n data-part=\"viewport\"\n role=\"presentation\"\n tabindex=\"0\"\n style=\"overflow: auto;\"\n [id]=\"partId('viewport')\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-at-top]=\"flag(sides().top)\"\n [attr.data-at-bottom]=\"flag(sides().bottom)\"\n [attr.data-at-left]=\"flag(sides().left)\"\n [attr.data-at-right]=\"flag(sides().right)\"\n [attr.data-overflow-x]=\"flag(overflowX())\"\n [attr.data-overflow-y]=\"flag(overflowY())\"\n (scroll)=\"onScroll()\"\n >\n <div\n class=\"scroll-area__content\"\n data-scope=\"scroll-area\"\n data-part=\"content\"\n role=\"presentation\"\n style=\"min-width: fit-content;\"\n [id]=\"partId('content')\"\n [attr.data-overflow-x]=\"flag(overflowX())\"\n [attr.data-overflow-y]=\"flag(overflowY())\"\n >\n <ng-content />\n </div>\n </div>\n @if (showVertical()) {\n <div\n class=\"scroll-area__scrollbar\"\n data-scope=\"scroll-area\"\n data-part=\"scrollbar\"\n data-orientation=\"vertical\"\n style=\"position: absolute; touch-action: none; user-select: none; top: 0px; bottom: var(--corner-height); inset-inline-end: 0px;\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-scrolling]=\"flag(scrollingY())\"\n [attr.data-hover]=\"flag(hovering())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-overflow-x]=\"flag(overflowX())\"\n [attr.data-overflow-y]=\"flag(overflowY())\"\n >\n <div\n class=\"scroll-area__thumb\"\n data-scope=\"scroll-area\"\n data-part=\"thumb\"\n data-orientation=\"vertical\"\n style=\"height: var(--thumb-height);\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-hover]=\"flag(hovering())\"\n [attr.data-dragging]=\"flag(dragging())\"\n (pointerdown)=\"startDrag($event, 'vertical')\"\n ></div>\n </div>\n }\n @if (showHorizontal()) {\n <div\n class=\"scroll-area__scrollbar\"\n data-scope=\"scroll-area\"\n data-part=\"scrollbar\"\n data-orientation=\"horizontal\"\n style=\"position: absolute; touch-action: none; user-select: none; inset-inline-start: 0px; inset-inline-end: var(--corner-width); bottom: 0px;\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-scrolling]=\"flag(scrollingX())\"\n [attr.data-hover]=\"flag(hovering())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-overflow-x]=\"flag(overflowX())\"\n [attr.data-overflow-y]=\"flag(overflowY())\"\n >\n <div\n class=\"scroll-area__thumb\"\n data-scope=\"scroll-area\"\n data-part=\"thumb\"\n data-orientation=\"horizontal\"\n style=\"width: var(--thumb-width);\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-hover]=\"flag(hovering())\"\n [attr.data-dragging]=\"flag(dragging())\"\n (pointerdown)=\"startDrag($event, 'horizontal')\"\n ></div>\n </div>\n }\n @if (showBoth()) {\n <div\n class=\"scroll-area__corner\"\n data-scope=\"scroll-area\"\n data-part=\"corner\"\n style=\"position: absolute; bottom: 0px; inset-inline-end: 0px; width: var(--corner-width); height: var(--corner-height);\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-hover]=\"flag(hovering())\"\n [attr.data-state]=\"cornerHidden() ? 'hidden' : 'visible'\"\n [attr.data-overflow-x]=\"flag(overflowX())\"\n [attr.data-overflow-y]=\"flag(overflowY())\"\n ></div>\n }\n `,\n host: {\n class: \"scroll-area\",\n role: \"presentation\",\n \"[id]\": \"rootId\",\n \"[attr.data-overflow-x]\": \"flag(overflowX())\",\n \"[attr.data-overflow-y]\": \"flag(overflowY())\",\n \"(pointerenter)\": \"hovering.set(true)\",\n \"(pointerleave)\": \"hovering.set(false)\",\n },\n})\nexport class UioScrollArea extends UioPart implements AfterViewInit, OnDestroy {\n readonly scope = \"scroll-area\";\n readonly part = \"root\";\n\n /**\n * Which scrollbars to draw, under a property name that is not `orientation`.\n *\n * `UioPart.orientation` is *this element's own* orientation, and Ark puts none\n * on a scroll area's root — only on its scrollbars and thumbs, one each. The\n * same `xInput`-aliased-to-`x` split `UioSwitch` and `UioTabs` use, and for\n * the same reason: the two meanings collide on one name.\n */\n protected readonly orientationInput = input<ScrollAreaOrientation>(\"vertical\", {\n alias: \"orientation\",\n });\n\n private readonly machine = nextMachineId();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly overflowX = signal(false);\n protected readonly overflowY = signal(false);\n protected readonly cornerHidden = signal(true);\n protected readonly sides = signal<Sides>({ top: false, right: false, bottom: false, left: false });\n protected readonly hovering = signal(false);\n protected readonly dragging = signal(false);\n protected readonly scrollingX = signal(false);\n protected readonly scrollingY = signal(false);\n\n protected readonly flag = stateFlag;\n protected readonly showVertical = computed(\n () => this.orientationInput() === \"vertical\" || this.orientationInput() === \"both\",\n );\n protected readonly showHorizontal = computed(\n () => this.orientationInput() === \"horizontal\" || this.orientationInput() === \"both\",\n );\n protected readonly showBoth = computed(() => this.orientationInput() === \"both\");\n\n private resize?: ResizeObserver;\n private intersection?: IntersectionObserver;\n private scrollXTimer?: ReturnType<typeof setTimeout>;\n private scrollYTimer?: ReturnType<typeof setTimeout>;\n private lastScroll = { x: 0, y: 0 };\n private drag?: { axis: Axis; start: number; from: number };\n\n get rootId(): string {\n return `scroll-area-${this.machine}`;\n }\n /** Zag's scroll-area ids are `scroll-area-<id>:<part>` — a dash, then a colon. */\n protected partId(part: string): string {\n return `scroll-area-${this.machine}:${part}`;\n }\n\n ngAfterViewInit(): void {\n const view = this.host.nativeElement.ownerDocument.defaultView;\n const viewport = this.viewport();\n if (!view || !viewport) return;\n\n // Guarded: jsdom implements neither observer, and a spec that only asserts\n // the rendered anatomy must not be the thing that throws.\n if (typeof view.ResizeObserver === \"function\") {\n this.resize = new view.ResizeObserver(() => this.measure());\n this.resize.observe(viewport);\n this.resize.observe(this.host.nativeElement);\n }\n if (typeof view.IntersectionObserver === \"function\") {\n this.intersection = new view.IntersectionObserver((entries) => {\n if (entries.some((entry) => entry.intersectionRatio > 0)) this.measure();\n });\n this.intersection.observe(viewport);\n }\n this.measure();\n }\n\n ngOnDestroy(): void {\n this.resize?.disconnect();\n this.intersection?.disconnect();\n clearTimeout(this.scrollXTimer);\n clearTimeout(this.scrollYTimer);\n this.stopDrag();\n }\n\n protected onScroll(): void {\n const viewport = this.viewport();\n if (!viewport) return;\n const moved = {\n x: viewport.scrollLeft - this.lastScroll.x,\n y: viewport.scrollTop - this.lastScroll.y,\n };\n this.lastScroll = { x: viewport.scrollLeft, y: viewport.scrollTop };\n this.measure();\n\n // Per axis, and decaying rather than sticky: the scrollbar fades out again a\n // second after the last scroll, which is what `[data-scrolling]` is for.\n if (moved.y !== 0) {\n this.scrollingY.set(true);\n clearTimeout(this.scrollYTimer);\n this.scrollYTimer = setTimeout(() => this.scrollingY.set(false), SCROLL_TIMEOUT);\n }\n if (moved.x !== 0) {\n this.scrollingX.set(true);\n clearTimeout(this.scrollXTimer);\n this.scrollXTimer = setTimeout(() => this.scrollingX.set(false), SCROLL_TIMEOUT);\n }\n }\n\n /**\n * Everything the browser has to be asked rather than told.\n *\n * The whole viewport box is read once, up front, so the thumb is sized from\n * the same layout the overflow flags came from — measuring again after writing\n * a custom property would read the frame in between.\n */\n private measure(): void {\n const viewport = this.viewport();\n const root = this.host.nativeElement;\n if (!viewport) return;\n\n const { clientHeight, clientWidth, scrollHeight, scrollWidth, scrollTop, scrollLeft } = viewport;\n // Nothing has been laid out yet; a zero here would report \"no overflow\" for\n // content that has simply not been measured.\n if (scrollHeight === 0 || scrollWidth === 0) return;\n\n const yHidden = clientHeight >= scrollHeight;\n const xHidden = clientWidth >= scrollWidth;\n this.overflowY.set(!yHidden);\n this.overflowX.set(!xHidden);\n this.cornerHidden.set(yHidden || xHidden);\n this.sides.set(sidesOf(viewport));\n\n const scrollbarY = this.find('[data-part=\"scrollbar\"][data-orientation=\"vertical\"]');\n const scrollbarX = this.find('[data-part=\"scrollbar\"][data-orientation=\"horizontal\"]');\n const thumbY = this.find('[data-part=\"thumb\"][data-orientation=\"vertical\"]');\n const thumbX = this.find('[data-part=\"thumb\"][data-orientation=\"horizontal\"]');\n\n const roomY = (yHidden ? 0 : clientHeight) - edges(scrollbarY, \"y\", \"padding\") - edges(thumbY, \"y\", \"margin\");\n const roomX = (xHidden ? 0 : clientWidth) - edges(scrollbarX, \"x\", \"padding\") - edges(thumbX, \"x\", \"margin\");\n const height = Math.max(\n MIN_THUMB_SIZE,\n Math.min(scrollbarY?.offsetHeight ?? roomY, roomY) * (clientHeight / scrollHeight),\n );\n const width = Math.max(\n MIN_THUMB_SIZE,\n Math.min(scrollbarX?.offsetWidth ?? roomX, roomX) * (clientWidth / scrollWidth),\n );\n root.style.setProperty(\"--thumb-height\", `${height}px`);\n root.style.setProperty(\"--thumb-width\", `${width}px`);\n\n // The square where the two scrollbars meet, and zero unless both are drawn.\n const noCorner = yHidden || xHidden;\n root.style.setProperty(\"--corner-width\", noCorner ? \"0px\" : `${scrollbarY?.offsetWidth ?? 0}px`);\n root.style.setProperty(\n \"--corner-height\",\n noCorner ? \"0px\" : `${scrollbarX?.offsetHeight ?? 0}px`,\n );\n\n if (scrollbarY && thumbY) {\n const travel = scrollbarY.offsetHeight - height - edges(scrollbarY, \"y\", \"padding\") - edges(thumbY, \"y\", \"margin\");\n const ratio = scrollTop / Math.max(1, scrollHeight - clientHeight);\n thumbY.style.transform = `translate3d(0px, ${clamp(ratio * travel, 0, travel)}px, 0px)`;\n }\n if (scrollbarX && thumbX) {\n const travel = scrollbarX.offsetWidth - width - edges(scrollbarX, \"x\", \"padding\") - edges(thumbX, \"x\", \"margin\");\n const ratio = scrollLeft / Math.max(1, scrollWidth - clientWidth);\n thumbX.style.transform = `translate3d(${clamp(ratio * travel, 0, travel)}px, 0px, 0px)`;\n }\n\n // Four properties the shared stylesheet can hang an overscroll shadow on.\n // Zero on an axis that does not scroll, rather than absent, so a rule can\n // read them unconditionally.\n const maxTop = Math.max(0, scrollHeight - clientHeight);\n const maxLeft = Math.max(0, scrollWidth - clientWidth);\n const fromTop = yHidden ? 0 : clamp(scrollTop, 0, maxTop);\n const fromLeft = xHidden ? 0 : clamp(scrollLeft, 0, maxLeft);\n viewport.style.setProperty(\"--scroll-area-overflow-y-start\", `${fromTop}px`);\n viewport.style.setProperty(\"--scroll-area-overflow-y-end\", `${yHidden ? 0 : maxTop - fromTop}px`);\n viewport.style.setProperty(\"--scroll-area-overflow-x-start\", `${fromLeft}px`);\n viewport.style.setProperty(\n \"--scroll-area-overflow-x-end\",\n `${xHidden ? 0 : maxLeft - fromLeft}px`,\n );\n }\n\n protected startDrag(event: PointerEvent, axis: Axis): void {\n const viewport = this.viewport();\n if (!viewport || event.button !== 0) return;\n event.preventDefault();\n this.dragging.set(true);\n this.drag = {\n axis,\n start: axis === \"vertical\" ? event.clientY : event.clientX,\n from: axis === \"vertical\" ? viewport.scrollTop : viewport.scrollLeft,\n };\n const view = viewport.ownerDocument.defaultView;\n view?.addEventListener(\"pointermove\", this.onDragMove);\n view?.addEventListener(\"pointerup\", this.onDragEnd);\n }\n\n /**\n * Arrow properties, not methods.\n *\n * Each is handed to `addEventListener` and taken back off it, so both calls\n * have to name the same function — a `.bind(this)` at each site produces a new\n * one and leaks a listener per drag.\n */\n private readonly onDragMove = (event: PointerEvent): void => {\n const viewport = this.viewport();\n const drag = this.drag;\n if (!viewport || !drag) return;\n const vertical = drag.axis === \"vertical\";\n const scrollbar = this.find(`[data-part=\"scrollbar\"][data-orientation=\"${drag.axis}\"]`);\n if (!scrollbar) return;\n // The thumb travels the track; the content travels the viewport. The ratio\n // between the two is what turns pixels of drag into pixels of scroll.\n const track = vertical ? scrollbar.offsetHeight : scrollbar.offsetWidth;\n const content = vertical ? viewport.scrollHeight : viewport.scrollWidth;\n const visible = vertical ? viewport.clientHeight : viewport.clientWidth;\n const moved = (vertical ? event.clientY : event.clientX) - drag.start;\n const next = clamp(drag.from + (moved / Math.max(1, track)) * content, 0, content - visible);\n if (vertical) viewport.scrollTop = next;\n else viewport.scrollLeft = next;\n };\n\n private readonly onDragEnd = (): void => this.stopDrag();\n\n private stopDrag(): void {\n if (!this.drag) return;\n this.drag = undefined;\n this.dragging.set(false);\n const view = this.host.nativeElement.ownerDocument.defaultView;\n view?.removeEventListener(\"pointermove\", this.onDragMove);\n view?.removeEventListener(\"pointerup\", this.onDragEnd);\n }\n\n private viewport(): HTMLElement | null {\n return this.find('[data-part=\"viewport\"]');\n }\n private find(selector: string): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>(selector);\n }\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/** Which edges the scroll rests against — false on an axis that cannot scroll. */\nfunction sidesOf(viewport: HTMLElement): Sides {\n const maxTop = viewport.scrollHeight - viewport.clientHeight;\n const maxLeft = viewport.scrollWidth - viewport.clientWidth;\n const canScrollY = maxTop > EDGE_THRESHOLD;\n const canScrollX = maxLeft > EDGE_THRESHOLD;\n return {\n top: canScrollY && viewport.scrollTop <= EDGE_THRESHOLD,\n bottom: canScrollY && viewport.scrollTop >= maxTop - EDGE_THRESHOLD,\n left: canScrollX && viewport.scrollLeft <= EDGE_THRESHOLD,\n right: canScrollX && viewport.scrollLeft >= maxLeft - EDGE_THRESHOLD,\n };\n}\n\n/** The two `padding` or `margin` edges on one axis, in pixels. */\nfunction edges(element: HTMLElement | null, axis: \"x\" | \"y\", box: \"padding\" | \"margin\"): number {\n const view = element?.ownerDocument.defaultView;\n if (!element || !view) return 0;\n const style = view.getComputedStyle(element);\n const sides = axis === \"x\" ? [\"left\", \"right\"] : [\"top\", \"bottom\"];\n return sides.reduce(\n (total, side) => total + (Number.parseFloat(style.getPropertyValue(`${box}-${side}`)) || 0),\n 0,\n );\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n AfterViewInit,\n ApplicationRef,\n Component,\n DOCUMENT,\n ElementRef,\n EmbeddedViewRef,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { clsx } from \"clsx\";\nimport { CONTROL_ICON_SIZE, comboboxFieldStyles, type ControlSize } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type ComboboxSize = ControlSize;\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\n/**\n * A text box that filters a list, and the list it filters.\n *\n * ```html\n * <div uioCombobox label=\"Fruit\" [options]=\"fruit\" formControlName=\"fruit\"></div>\n * ```\n *\n * ── Three things this is not ────────────────────────────────────────────────\n *\n * **Not a Select with a text box.** The input is the control: it takes focus, it\n * takes the field's id, and it is what `aria-activedescendant` is written on.\n * The popup never takes focus at all — which is why its `pointerdown` is\n * cancelled, so that clicking an option cannot blur the input and close the\n * thing being clicked.\n *\n * **Not filtered by Ark.** Zag's combobox machine holds a collection and does\n * not narrow it; every library here mirrors the input text and rebuilds the\n * list itself. The comparison is a locale-aware substring match — a\n * `search`-usage `Intl.Collator` at base sensitivity — so \"cafe\" finds \"Café\"\n * and \"APPLE\" finds \"Apple\" in every locale, which `toLowerCase().includes()`\n * does in none of them.\n *\n * **Not the same navigation as `UioListbox`.** `loopFocus` is on here, so\n * ArrowDown past the last option wraps to the first. The listbox's does not.\n * They look like the same list and Ark configures them differently.\n *\n * ── The one that will surprise you ──────────────────────────────────────────\n *\n * Choosing an option writes its label into the input, and the input's text *is*\n * the filter — so a combobox reopened after a choice shows only the chosen\n * option. That is Ark's behaviour in all three other libraries, verified in the\n * browser, and it is not a bug in this port. Anything that \"fixed\" it here would\n * make Angular the odd one out.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it,\n * including `control.disable()` reaching every part's `data-disabled`.\n */\n@Component({\n selector: \"div[uioCombobox]\",\n standalone: true,\n exportAs: \"uioCombobox\",\n imports: [UioIcon, UioFieldError],\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioCombobox), multi: true },\n ],\n template: `\n <!--\n Ark's Combobox.Root renders a wrapping <div>; display: contents on\n .combobox-field__root keeps the label, control and helper as direct flex\n children of the field.\n -->\n <div\n class=\"combobox-field__root\"\n data-scope=\"combobox\"\n data-part=\"root\"\n [id]=\"comboboxId\"\n [attr.data-invalid]=\"flag(invalid())\"\n >\n @if (label(); as text) {\n <!--\n The label is a Combobox part carrying the *field's* id, because that is\n what the input's for and the listbox's aria-labelledby both name.\n -->\n <label\n class=\"field__label\"\n data-scope=\"combobox\"\n data-part=\"label\"\n [id]=\"field.partId('label')\"\n [attr.for]=\"field.controlId\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-required]=\"flag(required())\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <div\n class=\"combobox-field__control\"\n data-scope=\"combobox\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n [attr.data-state]=\"openState()\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >\n <input\n class=\"field__control combobox-field__input\"\n data-scope=\"combobox\"\n data-part=\"input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"none\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [id]=\"field.controlId\"\n [value]=\"inputValue()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [disabled]=\"isDisabled()\"\n [attr.aria-controls]=\"partId('content')\"\n [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-state]=\"openState()\"\n [attr.data-invalid]=\"flag(invalid())\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"onInputBlur()\"\n />\n <!--\n tabindex=\"-1\": the input is the tab stop, and a second one beside it\n would make every combobox in a form take two Tabs to leave.\n -->\n <button\n class=\"combobox-field__trigger\"\n data-scope=\"combobox\"\n data-part=\"trigger\"\n type=\"button\"\n tabindex=\"-1\"\n aria-haspopup=\"listbox\"\n aria-label=\"Toggle options\"\n [id]=\"partId('toggle-btn')\"\n [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\n [attr.aria-controls]=\"open() ? partId('content') : null\"\n [attr.data-state]=\"openState()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [disabled]=\"isDisabled()\"\n (pointerdown)=\"onTriggerPointerDown($event)\"\n (click)=\"toggle()\"\n >\n <span uioIcon [name]=\"glyph('chevron-down')\" [size]=\"iconSize()\"></span>\n </button>\n </div>\n </div>\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span\n >\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n\n <!-- See UioPopover: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"combobox-positioner\"\n data-scope=\"combobox\"\n data-part=\"positioner\"\n [id]=\"partId('popper')\"\n >\n <div\n class=\"combobox-popup\"\n data-scope=\"combobox\"\n data-part=\"content\"\n role=\"listbox\"\n tabindex=\"-1\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"openState()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.aria-labelledby]=\"field.partId('label')\"\n [attr.data-empty]=\"flag(!matches().length)\"\n (pointerdown)=\"$event.preventDefault()\"\n >\n <!--\n Ark renders the Empty part only when nothing matched, and renders it\n before the items — so the two can never be on screen together.\n -->\n @if (!matches().length) {\n <div\n class=\"combobox-popup__empty text-default-body-medium\"\n data-scope=\"combobox\"\n data-part=\"empty\"\n role=\"presentation\"\n >\n {{ emptyMessage() }}\n </div>\n }\n @for (option of matches(); track option.value) {\n <div\n class=\"combobox-popup__item text-default-body-large\"\n data-scope=\"combobox\"\n data-part=\"item\"\n role=\"option\"\n tabindex=\"-1\"\n [id]=\"optionId(option.value)\"\n [attr.data-value]=\"option.value\"\n [attr.data-state]=\"isChosen(option.value) ? 'checked' : 'unchecked'\"\n [attr.aria-selected]=\"isChosen(option.value) ? 'true' : null\"\n [attr.data-highlighted]=\"flag(highlightedValue() === option.value)\"\n [attr.data-disabled]=\"flag(!!option.disabled)\"\n [attr.aria-disabled]=\"option.disabled ? 'true' : null\"\n (click)=\"choose(option)\"\n (pointermove)=\"highlight(option)\"\n >\n <span class=\"combobox-popup__item-label\">{{ option.label }}</span>\n <div\n class=\"combobox-popup__item-indicator\"\n data-scope=\"combobox\"\n data-part=\"item-indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"isChosen(option.value) ? 'checked' : 'unchecked'\"\n [attr.hidden]=\"isChosen(option.value) ? null : ''\"\n >\n <span uioIcon [name]=\"glyph('check')\" [size]=\"iconSize()\"></span>\n </div>\n </div>\n }\n </div>\n </div>\n </ng-template>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioCombobox\n extends UioPart\n implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor\n{\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly options = input<readonly ComboboxOption[]>([]);\n readonly value = model<string | undefined>(undefined);\n readonly open = model(false);\n readonly label = input<string | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<ComboboxSize>(\"md\");\n readonly name = input<string | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly emptyMessage = input(\"No results found.\");\n readonly valueChange = output<string>();\n readonly openChange = output<boolean>();\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n\n /**\n * Deliberately *not* `UioPart.state`.\n *\n * This component's host is the field root, and Ark puts no `data-state` on it\n * — open and closed belong to the control, the input, the trigger and the\n * popup, which are four elements further in.\n */\n protected readonly openState = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n readonly machine = nextMachineId();\n readonly anchored = new AnchoredSurface(inject(Overlay));\n protected readonly field = inject(UioFieldContext);\n\n /** The text in the box, which is also the filter. See the class comment. */\n protected readonly inputValue = signal(\"\");\n /** Named `highlightedValue` because `UioPart.highlighted` is this element's own state. */\n protected readonly highlightedValue = signal<string | null>(null);\n protected readonly focused = signal(false);\n\n protected readonly flag = stateFlag;\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n protected readonly hostClass = computed(() => clsx(comboboxFieldStyles({ size: this.size() })));\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n /**\n * A `search`-usage collator, built once.\n *\n * `usage: \"search\"` is what makes `compare` answer \"are these the same word\"\n * rather than \"which sorts first\", and base sensitivity is what makes it\n * ignore case and accents. Rebuilding it per keystroke is the expensive part\n * of this comparison, which is why it is a field.\n */\n private readonly collator = new Intl.Collator(undefined, {\n usage: \"search\",\n sensitivity: \"base\",\n });\n\n /** The options on screen. An empty query shows everything, unfiltered. */\n protected readonly matches = computed(() => {\n const query = this.inputValue().trim();\n if (!query.length) return [...this.options()];\n return this.options().filter((option) => this.contains(option.label, query));\n });\n\n protected readonly activeDescendant = computed(() => {\n const value = this.highlightedValue();\n return value === null ? null : this.optionId(value);\n });\n\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.controlElement(),\n dismiss: () => this.close(),\n };\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n disabled: this.isDisabled,\n required: this.required,\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n /**\n * The box shows the chosen option's label — including when a form writes the\n * value, which is the path `writeValue` takes.\n *\n * Tracks `value` alone. Reading `options` here as well would re-run on every\n * list change and wipe whatever the user was halfway through typing, which\n * is exactly what happens to a combobox whose options are loaded as you\n * type.\n */\n effect(() => {\n const value = this.value();\n untracked(() => {\n const chosen = this.options().find((option) => option.value === value);\n this.inputValue.set(chosen?.label ?? \"\");\n });\n });\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n get comboboxId(): string {\n return `combobox:${this.machine}`;\n }\n partId(part: string): string {\n return `combobox:${this.machine}:${part}`;\n }\n /** Ark's option ids carry the value, so two comboboxes on a page cannot collide. */\n optionId(value: string): string {\n return this.partId(`option:${value}`);\n }\n\n /** See `UioSelect.ngOnInit` for why the overlay is created this early. */\n ngOnInit(): void {\n const ref = this.anchored.create(\n this.controlElement() ?? this.host.nativeElement,\n // Ark positions the popup bottom-start with a 4px gutter, against the\n // *control* rather than the trigger — the popup is as wide as the whole\n // field, not as wide as the chevron.\n anchoredPositions(\"bottom\", \"start\", 4),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n }\n\n ngAfterViewInit(): void {\n const control = this.controlElement();\n if (control) this.anchored.setAnchor(control);\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n toggle(): void {\n this.setOpen(!this.open());\n }\n show(): void {\n this.setOpen(true);\n }\n close(): void {\n this.setOpen(false);\n }\n\n protected isChosen(value: string): boolean {\n return this.value() === value;\n }\n\n protected highlight(option: ComboboxOption): void {\n if (option.disabled) return;\n this.highlightedValue.set(option.value);\n }\n\n protected choose(option: ComboboxOption): void {\n if (option.disabled) return;\n this.value.set(option.value);\n this.inputValue.set(option.label);\n this.valueChange.emit(option.value);\n this.onChange(option.value);\n this.close();\n }\n\n /**\n * Focus the input *instead of* the trigger.\n *\n * The trigger is not a tab stop, so a click on it would otherwise leave focus\n * wherever it was — and every keystroke after opening the popup would go\n * somewhere else. Cancelling the pointerdown is what stops the browser giving\n * the button focus in the first place.\n */\n protected onTriggerPointerDown(event: PointerEvent): void {\n if (this.isDisabled()) return;\n event.preventDefault();\n this.inputElement()?.focus({ preventScroll: true });\n }\n\n protected onInput(event: Event): void {\n this.inputValue.set((event.target as HTMLInputElement).value);\n // Typing opens: `openOnChange` is on, and a filtered list nobody can see is\n // the one state this control must never be in.\n if (!this.open()) this.show();\n else this.refresh();\n // A highlight on an option that has just been filtered out would name an\n // element that is no longer there.\n if (!this.matches().some((option) => option.value === this.highlightedValue())) {\n this.highlightedValue.set(null);\n }\n }\n\n protected onInputBlur(): void {\n this.focused.set(false);\n this.close();\n }\n\n protected onInputKeydown(event: KeyboardEvent): void {\n const options = this.matches();\n const current = options.findIndex((option) => option.value === this.highlightedValue());\n\n const move = (step: number) => {\n event.preventDefault();\n if (!this.open()) {\n // `openOnKeyPress` — an arrow on a closed combobox opens it rather than\n // moving a highlight nobody can see.\n this.show();\n return;\n }\n const next = this.step(options, current, step);\n if (next) this.highlightedValue.set(next.value);\n this.refresh();\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return move(1);\n case \"ArrowUp\":\n return move(-1);\n case \"Home\":\n case \"End\": {\n if (!this.open()) return;\n event.preventDefault();\n // From \"nothing highlighted\", one step forward is the first option and\n // one step back is the last — so both ends come out of the same walk.\n const edge = this.step(options, -1, event.key === \"Home\" ? 1 : -1);\n if (edge) this.highlightedValue.set(edge.value);\n return this.refresh();\n }\n case \"Enter\": {\n const option = options[current];\n if (!this.open() || !option) return;\n event.preventDefault();\n return this.choose(option);\n }\n case \"Escape\": {\n if (!this.open()) return;\n event.preventDefault();\n return this.close();\n }\n default:\n return;\n }\n }\n\n /**\n * The next selectable option, wrapping at both ends.\n *\n * `loopFocus` is on for a combobox and off for a listbox — see the class\n * comment. `current` of -1 means nothing is highlighted, which is the state\n * the popup opens in, so the first ArrowDown lands on the first option and the\n * first ArrowUp on the last.\n */\n private step(\n options: readonly ComboboxOption[],\n current: number,\n step: number,\n ): ComboboxOption | undefined {\n if (!options.length) return undefined;\n // Nothing highlighted starts the walk *outside* the list, on the side the\n // step is coming from, so +1 lands on the first option and -1 on the last.\n let index = current === -1 ? (step > 0 ? -1 : 0) : current;\n for (let attempt = 0; attempt < options.length; attempt++) {\n index = (index + step + options.length) % options.length;\n const option = options[index];\n if (option && !option.disabled) return option;\n }\n return undefined;\n }\n\n /**\n * Zag's `contains`, which is a collator scan rather than a substring test.\n *\n * `String.includes` after `toLowerCase` gets the common cases right and the\n * ones that matter wrong: it does not fold accents, and its idea of \"lower\n * case\" is the invariant one, so a Turkish user typing \"i\" fails to find\n * \"İstanbul\".\n */\n private contains(text: string, query: string): boolean {\n const haystack = text.normalize(\"NFC\");\n const needle = query.normalize(\"NFC\");\n for (let start = 0; start + needle.length <= haystack.length; start++) {\n if (this.collator.compare(needle, haystack.slice(start, start + needle.length)) === 0) {\n return true;\n }\n }\n return false;\n }\n\n private inputElement(): HTMLInputElement | null {\n return this.host.nativeElement.querySelector<HTMLInputElement>('[data-part=\"input\"]');\n }\n private controlElement(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"control\"]');\n }\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private setOpen(next: boolean): void {\n if (next && this.isDisabled()) return;\n if (next === this.open()) return;\n this.open.set(next);\n this.openChange.emit(next);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n // Ark opens on the current selection when there is one, and on nothing when\n // there is not — which is why a fresh combobox reports no active descendant.\n this.highlightedValue.set(this.value() ?? null);\n this.surfaceView?.detectChanges();\n this.sizeToControl();\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.highlightedValue.set(null);\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n }\n\n /** Re-render the portalled view and re-place it, which filtering both needs. */\n private refresh(): void {\n this.surfaceView?.detectChanges();\n this.anchored.reposition();\n }\n\n /**\n * `.combobox-popup` is `width: var(--reference-width)` — zag measures the\n * control and publishes it on the positioner. Nothing in the CDK does, so the\n * popup would be `width: auto` and narrower than the field it belongs to.\n */\n private sizeToControl(): void {\n const control = this.controlElement();\n const positioner = this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"positioner\"]',\n );\n if (control && positioner) {\n positioner.style.setProperty(\"--reference-width\", `${control.offsetWidth}px`);\n }\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? undefined);\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { Overlay, type OverlayRef, type BlockScrollStrategy } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { FocusTrapFactory, type FocusTrap } from \"@angular/cdk/a11y\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { buttonStyles, dialogStyles, type ButtonVariants, type DialogVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioDialogContext } from \"../dialog/dialog-context.js\";\nimport { hideOthersFrom } from \"../overlay/aria-hidden.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport {\n applySurfaceStacking,\n createSurface,\n raiseSurface,\n setSurfaceInteractive,\n} from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type AlertDialogSize = NonNullable<DialogVariants[\"size\"]>;\n/** The two intents a confirm action is ever given. Destructive for deletes. */\nexport type AlertDialogIntent = Extract<NonNullable<ButtonVariants[\"intent\"]>, \"primary\" | \"destructive\">;\n\n/**\n * A modal that asks a question and will not take silence for an answer.\n *\n * ```html\n * <button uioButton uioAlertDialogTrigger [alertDialog]=\"confirm\">Delete</button>\n * <uio-alert-dialog #confirm=\"uioAlertDialog\">\n * <h2 uioAlertDialogTitle>Delete this?</h2>\n * <p uioAlertDialogDescription>This cannot be undone.</p>\n * <div uioAlertDialogFooter>\n * <button uioAlertDialogCancel>Cancel</button>\n * <button uioAlertDialogConfirm intent=\"destructive\" (click)=\"remove()\">Delete</button>\n * </div>\n * </uio-alert-dialog>\n * ```\n *\n * ── Why this is not `UioDialog` with a different role ───────────────────────\n *\n * It renders the Dialog's chrome — same scope, same backdrop, same popup recipe,\n * same title/description/footer — and it is still a component of its own, for\n * the same reason React's is: `role=\"alertdialog\"` changes the machine, not just\n * the attribute. Zag reads the role in `props()` and turns **outside-click\n * dismissal off** (`closeOnInteractOutside: modal && !alertDialog`), because an\n * alert is a question and a stray click is not an answer. It also aims initial\n * focus at the close trigger rather than at whatever happens to be first.\n *\n * Everything structural is the Dialog's story told again — the host element is\n * removed because Ark's root renders nothing, the surface is attached on init\n * because Ark keeps its portal rendered, and a user interaction flushes change\n * detection so the trigger and the popup never disagree. Those notes live in\n * `UioDialog`; what is written up here is only what differs.\n *\n * The parts below share `UioDialogContext`, so the ids read\n * `dialog:<machine>:title` exactly as they do in React — an AlertDialog *is* a\n * dialog machine, and giving it a scope of its own would put a `data-scope` in\n * the DOM that no stylesheet and no other library has.\n */\n@Component({\n selector: \"uio-alert-dialog\",\n standalone: true,\n exportAs: \"uioAlertDialog\",\n imports: [UioIcon],\n providers: [UioDialogContext, HostPresence],\n template: `\n <!-- See UioDialog: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"dialog__backdrop\"\n data-scope=\"dialog\"\n data-part=\"backdrop\"\n [id]=\"dialogContext.partId('backdrop')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n ></div>\n <div\n class=\"dialog__positioner\"\n data-scope=\"dialog\"\n data-part=\"positioner\"\n [id]=\"dialogContext.partId('positioner')\"\n [style.pointer-events]=\"open() ? null : 'none'\"\n >\n <!--\n aria-modal is written as both words and never dropped: zag takes it\n straight from the prop, so a non-modal surface reports\n aria-modal=\"false\". Dropping it is the tidier-looking of the two and\n would differ from every other library here.\n -->\n <div\n [class]=\"popupClass()\"\n data-scope=\"dialog\"\n data-part=\"content\"\n role=\"alertdialog\"\n tabindex=\"-1\"\n [id]=\"dialogContext.partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.aria-modal]=\"modal() ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"dialogContext.labelledBy()\"\n [attr.aria-describedby]=\"dialogContext.describedBy()\"\n >\n @if (showClose()) {\n <button\n class=\"dialog__close\"\n data-scope=\"dialog\"\n data-part=\"close-trigger\"\n type=\"button\"\n aria-label=\"Close\"\n [id]=\"dialogContext.partId('close')\"\n (click)=\"hide()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"CLOSE_ICON_SIZE\"></span>\n </button>\n }\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioAlertDialog implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly open = model(false);\n /** Narrower than a Dialog by default: an alert is one question, not a form. */\n readonly size = input<AlertDialogSize>(\"sm\");\n /** Off by default — an alert is answered with its actions, not dismissed. */\n readonly showClose = input(false, { transform: booleanAttribute });\n readonly modal = input(true, { transform: booleanAttribute });\n\n readonly dialogContext = inject(UioDialogContext);\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly popupClass = computed(() => dialogStyles({ size: this.size() }));\n protected readonly CLOSE_ICON_SIZE = 20;\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly overlay = inject(Overlay);\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly appRef = inject(ApplicationRef);\n\n private overlayRef?: OverlayRef;\n private surfaceView?: EmbeddedViewRef<unknown>;\n private scrollBlock?: BlockScrollStrategy;\n private trap?: FocusTrap;\n private restoreAria?: () => void;\n private opener: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n /**\n * Escape only. A click outside an alert is not an answer to it, and zag\n * says so in one line — `closeOnInteractOutside: modal && !alertDialog`.\n * Registering the layer anyway is what keeps *Escape* working and, just as\n * importantly, keeps this dialog on top of the dismissal stack so a click\n * outside it cannot reach whatever is underneath.\n */\n dismiss: (reason) => {\n if (reason === \"escape\") this.hide();\n },\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see `UioDialog` for the ordering. */\n ngOnInit(): void {\n this.overlayRef = createSurface(this.overlay, {\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.scrollBlock = this.overlay.scrollStrategies.block();\n this.surfaceView = this.overlayRef.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(this.overlayRef);\n setSurfaceInteractive(this.overlayRef, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.restoreAria?.();\n this.trap?.destroy();\n this.scrollBlock?.disable();\n this.overlayRef?.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /** Remembered on open so focus can be given back to it on close. */\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null\n );\n }\n private positionerElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"positioner\"]') ?? null\n );\n }\n\n /** Two halves on purpose — see `UioDialog.setOpen` for the timing. */\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n\n const positioner = this.positionerElement();\n const content = this.contentElement();\n if (this.modal() && positioner) {\n this.restoreAria = hideOthersFrom(positioner);\n this.scrollBlock?.enable();\n }\n if (positioner) this.trap = this.focusTraps.create(positioner);\n /**\n * The first focusable inside the popup, which for an alert is its close\n * trigger — the × when one is shown, otherwise Cancel. That is not a\n * coincidence dressed up as agreement: zag aims an alertdialog's initial\n * focus at `dialog:<machine>:close`, every close trigger in this component\n * carries that id, and the first one in the DOM is the first focusable.\n */\n if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.restoreAria?.();\n this.restoreAria = undefined;\n this.trap?.destroy();\n this.trap = undefined;\n this.scrollBlock?.disable();\n this.surfaceView?.detectChanges();\n if (this.overlayRef) setSurfaceInteractive(this.overlayRef, false);\n restoreFocus(this.opener);\n }\n}\n\n/**\n * Opens the alert, and reports its state the way Ark's trigger does.\n *\n * `aria-controls` is dropped while the dialog is closed even though the content\n * is still in the document — see `UioDialogTrigger`, which explains why keeping\n * the two libraries' triggers identical outranks the fact that this one could\n * get away with it.\n */\n@Directive({\n selector: \"button[uioAlertDialogTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"[id]\": \"alertDialog ? alertDialog.dialogContext.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"alertDialog ? alertDialog.dialogContext.machineId : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? alertDialog!.dialogContext.partId('content') : null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioAlertDialogTrigger extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"alertDialog\") alertDialog?: UioAlertDialog;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.alertDialog?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n protected activate(): void {\n const dialog = this.alertDialog;\n if (!dialog) return;\n // Remembered *before* the state flips, so the element focus returns to is\n // the one the user actually pressed rather than whatever has it by then.\n dialog.rememberOpener(this.host.nativeElement);\n dialog.toggle();\n }\n}\n\n/** Names the alert. Ark's Title is an `h2`; the caller writes their own. */\n@Directive({\n selector: \"[uioAlertDialogTitle]\",\n standalone: true,\n host: {\n class: \"dialog__title text-strong-heading-small\",\n \"[id]\": \"dialogContext.partId('title')\",\n },\n})\nexport class UioAlertDialogTitle extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"title\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerTitle();\n }\n}\n\n/** Describes the consequence. Absent, and the popup carries no `aria-describedby`. */\n@Directive({\n selector: \"[uioAlertDialogDescription]\",\n standalone: true,\n host: {\n class: \"dialog__description text-default-body-medium\",\n \"[id]\": \"dialogContext.partId('description')\",\n },\n})\nexport class UioAlertDialogDescription extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"description\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerDescription();\n }\n}\n\n/**\n * The right-aligned action row holding Cancel and Confirm.\n *\n * Not an Ark part — the facade adds it, so it carries a class and nothing else,\n * in all four libraries.\n */\n@Directive({\n selector: \"[uioAlertDialogFooter]\",\n standalone: true,\n host: { class: \"dialog__footer\" },\n})\nexport class UioAlertDialogFooter {}\n\n/**\n * Dismisses the alert without acting, styled as the secondary button.\n *\n * It carries `dialog:<machine>:close`, the same id the × does — which makes two\n * elements on the page with one id whenever `showClose` is on. Reproduced rather\n * than tidied: Ark stamps every CloseTrigger with the part id, the duplicate is\n * in React's own output, and the difference this gate exists to catch is the one\n * where the two libraries disagree.\n */\n@Directive({\n selector: \"button[uioAlertDialogCancel]\",\n standalone: true,\n host: {\n type: \"button\",\n \"[class]\": \"hostClass\",\n \"[id]\": \"alertDialog.dialogContext.partId('close')\",\n \"(click)\": \"alertDialog.hide()\",\n },\n})\nexport class UioAlertDialogCancel extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"close-trigger\";\n protected readonly alertDialog = inject(UioAlertDialog);\n protected readonly hostClass = buttonStyles({ intent: \"secondary\" });\n}\n\n/**\n * Confirms and closes. The action itself is the caller's own `(click)`, which\n * runs alongside this one — order does not matter, because closing is a signal\n * write rather than anything that unmounts the handler.\n */\n@Directive({\n selector: \"button[uioAlertDialogConfirm]\",\n standalone: true,\n host: {\n type: \"button\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"alertDialog.dialogContext.partId('close')\",\n \"(click)\": \"alertDialog.hide()\",\n },\n})\nexport class UioAlertDialogConfirm extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"close-trigger\";\n\n /** `destructive` for anything the user cannot undo. */\n readonly intent = input<AlertDialogIntent>(\"primary\");\n\n protected readonly alertDialog = inject(UioAlertDialog);\n protected readonly hostClass = computed(() => buttonStyles({ intent: this.intent() }));\n}\n","import { Overlay, type OverlayRef, type BlockScrollStrategy } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { FocusTrapFactory, type FocusTrap } from \"@angular/cdk/a11y\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { sheetStyles, type SheetVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioDialogContext } from \"../dialog/dialog-context.js\";\nimport { hideOthersFrom } from \"../overlay/aria-hidden.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport {\n applySurfaceStacking,\n createSurface,\n raiseSurface,\n setSurfaceInteractive,\n} from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type SheetSide = NonNullable<SheetVariants[\"side\"]>;\nexport type SheetSize = NonNullable<SheetVariants[\"size\"]>;\n\n/**\n * A panel that slides in from an edge of the viewport.\n *\n * ```html\n * <button uioButton uioSheetTrigger [sheet]=\"filters\">Filters</button>\n * <uio-sheet #filters=\"uioSheet\" side=\"left\" size=\"lg\">\n * <h2 uioSheetTitle>Filters</h2>\n * <div uioSheetDescription>Narrow the results.</div>\n * <div uioSheetFooter><button uioSheetClose>Done</button></div>\n * </uio-sheet>\n * ```\n *\n * ── What makes it a Sheet rather than a Dialog ──────────────────────────────\n *\n * The machine: none of it. Ark builds a Sheet out of the same Dialog primitive,\n * so the scope, the backdrop, the ids and the whole focus and dismissal story\n * are the Dialog's — which is why the parts below share `UioDialogContext` and\n * emit `data-scope=\"dialog\"`. What is new is the *positioning*, and it happens\n * entirely in CSS: `.sheet__positioner` is `display: contents` and the panel\n * pins itself to an edge with `inset`. There is no centring layer to fight, and\n * the backdrop alone owns outside-click.\n *\n * That is why `side` and `size` are inputs on this component and not on some\n * content part: they are two class names on the popup, chosen by `sheetStyles`.\n *\n * The structural notes — why the host element disappears, why the surface is\n * attached before it is opened, why a user interaction flushes change detection\n * — are written up once in `UioDialog` and are the same here.\n */\n@Component({\n selector: \"uio-sheet\",\n standalone: true,\n exportAs: \"uioSheet\",\n imports: [UioIcon],\n providers: [UioDialogContext, HostPresence],\n template: `\n <!-- See UioDialog: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"dialog__backdrop\"\n data-scope=\"dialog\"\n data-part=\"backdrop\"\n [id]=\"dialogContext.partId('backdrop')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n ></div>\n <!--\n \"display: contents\", so unlike the Dialog's this positioner is not a\n full-viewport layer over the page — but the CDK pane around it still is,\n which is why setSurfaceInteractive is called on close exactly as it is\n for a Dialog.\n -->\n <div\n class=\"dialog__positioner sheet__positioner\"\n data-scope=\"dialog\"\n data-part=\"positioner\"\n [id]=\"dialogContext.partId('positioner')\"\n >\n <!--\n aria-modal is written as both words and never dropped: zag takes it\n straight from the prop, so a non-modal surface reports\n aria-modal=\"false\". Dropping it is the tidier-looking of the two and\n would differ from every other library here.\n -->\n <div\n [class]=\"popupClass()\"\n data-scope=\"dialog\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [id]=\"dialogContext.partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.aria-modal]=\"modal() ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"dialogContext.labelledBy()\"\n [attr.aria-describedby]=\"dialogContext.describedBy()\"\n >\n @if (showClose()) {\n <button\n class=\"dialog__close\"\n data-scope=\"dialog\"\n data-part=\"close-trigger\"\n type=\"button\"\n aria-label=\"Close\"\n [id]=\"dialogContext.partId('close')\"\n (click)=\"hide()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"CLOSE_ICON_SIZE\"></span>\n </button>\n }\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioSheet implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly open = model(false);\n /** The edge the panel slides in from. */\n readonly side = input<SheetSide>(\"right\");\n /** Width for a left/right sheet, height for a top/bottom one. */\n readonly size = input<SheetSize>(\"md\");\n /** On by default: a sheet is a place, and a place needs a way out. */\n readonly showClose = input(true, { transform: booleanAttribute });\n readonly modal = input(true, { transform: booleanAttribute });\n\n readonly dialogContext = inject(UioDialogContext);\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly popupClass = computed(() =>\n sheetStyles({ side: this.side(), size: this.size() }),\n );\n protected readonly CLOSE_ICON_SIZE = 20;\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly overlay = inject(Overlay);\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly appRef = inject(ApplicationRef);\n\n private overlayRef?: OverlayRef;\n private surfaceView?: EmbeddedViewRef<unknown>;\n private scrollBlock?: BlockScrollStrategy;\n private trap?: FocusTrap;\n private restoreAria?: () => void;\n private opener: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n /**\n * A non-modal sheet is a panel beside the page rather than in front of it,\n * so a click on the page is work rather than a dismissal — which is zag's\n * `closeOnInteractOutside: modal && !alertDialog`. Escape closes either way.\n */\n dismiss: (reason) => {\n if (reason === \"escape\" || this.modal()) this.hide();\n },\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see `UioDialog` for the ordering. */\n ngOnInit(): void {\n this.overlayRef = createSurface(this.overlay, {\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.scrollBlock = this.overlay.scrollStrategies.block();\n this.surfaceView = this.overlayRef.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(this.overlayRef);\n setSurfaceInteractive(this.overlayRef, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.restoreAria?.();\n this.trap?.destroy();\n this.scrollBlock?.disable();\n this.overlayRef?.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /** Remembered on open so focus can be given back to it on close. */\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null\n );\n }\n private positionerElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"positioner\"]') ?? null\n );\n }\n\n /** Two halves on purpose — see `UioDialog.setOpen` for the timing. */\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n // The browser's top layer stacks by show order, and this surface has been\n // showing since the page loaded. See `raiseSurface`.\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n\n const positioner = this.positionerElement();\n const content = this.contentElement();\n if (this.modal() && positioner) {\n this.restoreAria = hideOthersFrom(positioner);\n this.scrollBlock?.enable();\n /**\n * Only when modal, which is zag's `trapFocus: modal`. A non-modal sheet\n * is meant to be worked *beside*: trapping Tab inside it would make the\n * page it sits next to unreachable by keyboard while leaving it perfectly\n * usable with a mouse.\n *\n * The trap goes on the positioner, not the popup: its two focus anchors\n * are inserted as *siblings* of whatever it guards, and siblings of the\n * popup would be inside a region the parity gate compares.\n */\n this.trap = this.focusTraps.create(positioner);\n }\n if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.restoreAria?.();\n this.restoreAria = undefined;\n this.trap?.destroy();\n this.trap = undefined;\n this.scrollBlock?.disable();\n this.surfaceView?.detectChanges();\n if (this.overlayRef) setSurfaceInteractive(this.overlayRef, false);\n restoreFocus(this.opener);\n }\n}\n\n/** Opens the sheet, and reports its state the way Ark's dialog trigger does. */\n@Directive({\n selector: \"button[uioSheetTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"[id]\": \"sheet ? sheet.dialogContext.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"sheet ? sheet.dialogContext.machineId : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? sheet!.dialogContext.partId('content') : null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioSheetTrigger extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"sheet\") sheet?: UioSheet;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.sheet?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n protected activate(): void {\n const sheet = this.sheet;\n if (!sheet) return;\n // Remembered *before* the state flips, so the element focus returns to is\n // the one the user actually pressed rather than whatever has it by then.\n sheet.rememberOpener(this.host.nativeElement);\n sheet.toggle();\n }\n}\n\n/** Names the sheet. Ark's Title is an `h2`; the caller writes their own. */\n@Directive({\n selector: \"[uioSheetTitle]\",\n standalone: true,\n host: {\n class: \"dialog__title text-strong-heading-small\",\n \"[id]\": \"dialogContext.partId('title')\",\n },\n})\nexport class UioSheetTitle extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"title\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerTitle();\n }\n}\n\n/** Describes the sheet. Absent, and the popup carries no `aria-describedby`. */\n@Directive({\n selector: \"[uioSheetDescription]\",\n standalone: true,\n host: {\n class: \"dialog__description text-default-body-medium\",\n \"[id]\": \"dialogContext.partId('description')\",\n },\n})\nexport class UioSheetDescription extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"description\";\n protected readonly dialogContext = inject(UioDialogContext);\n constructor() {\n super();\n this.dialogContext.registerDescription();\n }\n}\n\n/**\n * The action row, pinned to the bottom of the panel.\n *\n * Two classes: `.dialog__footer` for the gap and the alignment, and\n * `.sheet__footer` for `margin-top: auto`, which is what pushes it to the\n * bottom of a full-height panel rather than leaving it under the body copy.\n * Not an Ark part in any library — the facade adds it.\n */\n@Directive({\n selector: \"[uioSheetFooter]\",\n standalone: true,\n host: { class: \"dialog__footer sheet__footer\" },\n})\nexport class UioSheetFooter {}\n\n/**\n * Closes the sheet from inside it.\n *\n * No class of its own, matching React's `SheetClose`: the caller styles it —\n * usually with `uioButton` — and a footer of two of them splits the row because\n * `.sheet__footer > *` is `flex: 1` on a narrow sheet.\n */\n@Directive({\n selector: \"button[uioSheetClose]\",\n standalone: true,\n host: {\n type: \"button\",\n \"[id]\": \"sheet.dialogContext.partId('close')\",\n \"(click)\": \"sheet.hide()\",\n },\n})\nexport class UioSheetClose extends UioPart {\n readonly scope = \"dialog\";\n readonly part = \"close-trigger\";\n protected readonly sheet = inject(UioSheet);\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions, type OverlayAlign, type OverlaySide } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\n\n/** Zag's own delays, so a card feels the same in all four libraries. */\nconst OPEN_DELAY = 600;\nconst CLOSE_DELAY = 300;\n\n/**\n * A rich preview that appears when a control is hovered or focused.\n *\n * ```html\n * <a uioHoverCardTrigger [hoverCard]=\"profile\" href=\"/u/ada\">@ada</a>\n * <uio-hover-card #profile=\"uioHoverCard\">\n * <strong>Ada Lovelace</strong>\n * <p>Wrote the first algorithm.</p>\n * </uio-hover-card>\n * ```\n *\n * ── Not a Tooltip, and not a Popover ────────────────────────────────────────\n *\n * It looks like both and behaves like neither, and the differences are all in\n * what the surface is *for*:\n *\n * - A tooltip is a label. Its popup is `pointer-events: none` decoration and it\n * carries `role=\"tooltip\"`. A hover card holds content a user reaches into —\n * a link, a follow button — so the popup takes the pointer, and hovering it\n * is what keeps it open. That is why the content below has its own\n * pointer handlers: leaving the trigger starts a close, entering the card\n * cancels it, and without that pair the card vanishes as you travel to it.\n * - A popover is opened by a click and holds focus. A hover card is never\n * focused on open — Ark moves no focus into it and gives its trigger no\n * `aria-expanded`, `aria-controls` or `aria-haspopup` at all. Reproduced\n * exactly: a hover-triggered surface that announced itself as an expandable\n * control would promise a keyboard user something hover cannot deliver.\n *\n * The structural notes — why the host element disappears, why the surface is\n * attached before it is opened, how a resolved placement is recovered from the\n * CDK — are written up in `UioPopover` and `overlay/anchored.ts`.\n */\n@Component({\n selector: \"uio-hover-card\",\n standalone: true,\n exportAs: \"uioHoverCard\",\n providers: [HostPresence],\n template: `\n <!-- See UioPopover: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"hover-card__positioner\"\n data-scope=\"hover-card\"\n data-part=\"positioner\"\n [id]=\"partId('popper')\"\n >\n <div\n class=\"hover-card__popup text-default-body-medium\"\n data-scope=\"hover-card\"\n data-part=\"content\"\n tabindex=\"-1\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n (pointerenter)=\"onContentEnter($event)\"\n (pointerleave)=\"onContentLeave($event)\"\n >\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioHoverCard implements OnInit, OnDestroy {\n readonly open = model(false);\n readonly side = input<OverlaySide>(\"bottom\");\n readonly align = input<OverlayAlign>(\"center\");\n readonly sideOffset = input(8);\n readonly alignOffset = input(0);\n /** Hover this long before the card appears. Zag's default is 600ms. */\n readonly openDelay = input(OPEN_DELAY);\n /** Grace period after the pointer leaves, so a card can be travelled to. */\n readonly closeDelay = input(CLOSE_DELAY);\n /** Nothing opens, and the trigger keeps its identity — see `UioTooltip`. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly machine = nextMachineId();\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private timer?: ReturnType<typeof setTimeout>;\n private trigger: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.trigger,\n dismiss: () => this.closeNow(),\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n effect(() => {\n const candidates = anchoredPositions(\n this.side(),\n this.align(),\n this.sideOffset(),\n this.alignOffset(),\n );\n untracked(() => this.anchored.setCandidates(candidates));\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see `UioPopover` for the ordering. */\n ngOnInit(): void {\n const ref = this.anchored.create(\n this.trigger ?? this.document.body,\n anchoredPositions(this.side(), this.align(), this.sideOffset(), this.alignOffset()),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.timer);\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n partId(part: string): string {\n return `hover-card:${this.machine}:${part}`;\n }\n\n /** Told by the trigger, so the surface is anchored to it rather than to the body. */\n rememberTrigger(element: HTMLElement | null): void {\n this.trigger = element;\n if (element) this.anchored.setAnchor(element);\n }\n\n /** Hover: delayed both ways. Focus: immediate, because focus is deliberate. */\n openSoon(): void {\n this.after(this.openDelay(), true);\n }\n closeSoon(): void {\n this.after(this.closeDelay(), false);\n }\n openNow(): void {\n this.after(0, true);\n }\n closeNow(): void {\n this.after(0, false);\n }\n\n /**\n * A pointer moving between the trigger and the card must not close it.\n *\n * `pointerleave` on the trigger fires before `pointerenter` on the content,\n * so the travel is a close *scheduled* and then cancelled — which is what the\n * single shared timer gives for free. Without the content's own handlers the\n * card would disappear the moment the pointer left the trigger, and every\n * link inside it would be unreachable.\n */\n protected onContentEnter(event: PointerEvent): void {\n if (event.pointerType === \"touch\") return;\n this.after(0, true);\n }\n protected onContentLeave(event: PointerEvent): void {\n if (event.pointerType === \"touch\") return;\n this.closeSoon();\n }\n\n private after(delay: number, next: boolean): void {\n if (this.disabled()) return;\n clearTimeout(this.timer);\n if (delay === 0) {\n this.setOpen(next);\n return;\n }\n this.timer = setTimeout(() => this.setOpen(next), delay);\n }\n\n private setOpen(next: boolean): void {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n this.applied = open;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n // Refreshed before it is measured: while closed the popup is `hidden` and\n // has no size, so the CDK would place a zero-height box and report a side\n // the card never used. Same reason `UioTooltip` does it.\n this.surfaceView?.detectChanges();\n if (open) {\n this.anchored.reposition();\n raiseSurface(ref);\n }\n // The popup takes the pointer only while it is open — a closed card's pane\n // would otherwise sit over the page swallowing clicks.\n setSurfaceInteractive(ref, open);\n }\n}\n\n/**\n * The control that reveals the card.\n *\n * An attribute rather than a component, so the caller's own element — very often\n * an `<a>` — is the trigger. React needs a `render` prop and a `cloneElement`\n * for the same thing.\n *\n * `focus` is listened for on the host, where it does not have to bubble.\n */\n@Directive({\n selector: \"[uioHoverCardTrigger]\",\n standalone: true,\n host: {\n \"[id]\": \"hoverCard ? hoverCard.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"hoverCard ? hoverCard.machine : null\",\n // Sticky, exactly as Ark leaves them: a trigger that has opened once keeps\n // reporting where its card went.\n \"[attr.data-placement]\": \"hoverCard?.anchored?.placement() ?? null\",\n \"[attr.data-side]\": \"hoverCard?.anchored?.side() ?? null\",\n \"(pointerenter)\": \"onEnter($event)\",\n \"(pointerleave)\": \"onLeave($event)\",\n \"(focus)\": \"hoverCard?.openNow()\",\n \"(blur)\": \"hoverCard?.closeNow()\",\n },\n})\nexport class UioHoverCardTrigger extends UioPart implements OnInit {\n readonly scope = \"hover-card\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"hoverCard\") hoverCard?: UioHoverCard;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.hoverCard?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n // Before the card's own `ngOnInit` runs its anchoring, so the surface is\n // pinned to this element rather than to the document body.\n this.hoverCard?.rememberTrigger(this.host.nativeElement);\n }\n\n /**\n * Touch is ignored, as it is in zag.\n *\n * A tap fires `pointerenter` and never `pointerleave`, so a card opened by\n * touch would stay open until something else dismissed it — and on a phone\n * there is no hover to express the intent in the first place.\n */\n protected onEnter(event: PointerEvent): void {\n if (event.pointerType === \"touch\") return;\n this.hoverCard?.rememberTrigger(this.host.nativeElement);\n this.hoverCard?.openSoon();\n }\n protected onLeave(event: PointerEvent): void {\n if (event.pointerType === \"touch\") return;\n this.hoverCard?.closeSoon();\n }\n}\n","import type { FlexibleConnectedPositionStrategy, Overlay, OverlayRef } from \"@angular/cdk/overlay\";\nimport { signal, type WritableSignal } from \"@angular/core\";\nimport type { Subscription } from \"rxjs\";\nimport type { AnchoredPosition, OverlayPlacement } from \"../overlay/anchor.js\";\nimport { sideOf } from \"../overlay/anchor.js\";\nimport { createSurface } from \"../overlay/surface.js\";\n\n/** Where a right-click landed, in viewport coordinates. */\nexport interface AnchorPoint {\n x: number;\n y: number;\n}\n\n/**\n * `AnchoredSurface`'s sibling, for a surface pinned to a **cursor** rather than\n * to a trigger.\n *\n * ── Why this is not `AnchoredSurface` with a different argument ─────────────\n *\n * Two reasons, and the second is the one that shows up in a DOM diff.\n *\n * The CDK anchors a `FlexibleConnectedPositionStrategy` to an element *or* to a\n * point — `flexibleConnectedTo` takes both — but `AnchoredSurface` narrows the\n * type to `HTMLElement`, because every other overlay in this library hangs off\n * a trigger it can point at. A context menu has no such element: the trigger is\n * an area, and the menu appears where the pointer was.\n *\n * More importantly, a context menu that has never been right-clicked has **no\n * placement at all**. Zag positions this surface against a virtual element at\n * `anchorPoint`, so a menu opened declaratively (`[open]=\"true\"`, no pointer)\n * is never measured and reports neither `data-placement` nor `data-side` — the\n * parity gate's own `defaultOpen` case shows React emitting neither. The CDK\n * would happily position against *something* and report a side the menu never\n * used, so placement here is published only once a point has been given.\n *\n * Everything else — the candidate list, how a resolved placement is recovered\n * from the object the CDK chose rather than guessed from geometry — is the same\n * mechanism, imported from the same place.\n *\n * ── One difference, measured and deliberately not reproduced ────────────────\n *\n * Ark's context menu lands **4px to the left** of the pointer; this one lands on\n * it. The 4px is `@zag-js/popper`'s `arrowPadding`, and it applies even though\n * no arrow is rendered: `getArrowMiddleware` installs floating-ui's `arrow()`\n * unconditionally, handing it a throwaway `<div>` when there is none, and\n * against a zero-size anchor that padding pushes the surface a whole\n * `arrowPadding` along the cross axis. It is constant — four pixels whatever\n * `sideOffset` is — and it is an artefact of a middleware that is otherwise\n * doing nothing. The CDK has no arrow middleware to reproduce it with, and the\n * DOM contract compares attributes rather than geometry, so the two differ by\n * four pixels here and agree on everything the gate reads.\n */\nexport class PointerSurface {\n /** `null` until a pointer has actually placed the surface. */\n readonly placement: WritableSignal<OverlayPlacement | null> = signal(null);\n\n private ref?: OverlayRef;\n private strategy?: FlexibleConnectedPositionStrategy;\n private candidates: AnchoredPosition[] = [];\n private changes?: Subscription;\n private latest: OverlayPlacement | null = null;\n private point: AnchorPoint | null = null;\n\n constructor(private readonly overlay: Overlay) {}\n\n get overlayRef(): OverlayRef | undefined {\n return this.ref;\n }\n\n /** Whether a right-click has ever placed this surface. */\n get anchored(): boolean {\n return this.point !== null;\n }\n\n /**\n * Where the surface was last placed, or `null`.\n *\n * Exposed because it is the only way to check *where* a context menu went\n * without a layout engine: jsdom measures every element as zero, so the CDK\n * has nothing to position against and a spec asserting coordinates would be\n * asserting zeroes. This is the input to that positioning, and it is what a\n * wrong pointer handler gets wrong.\n */\n get anchorPoint(): AnchorPoint | null {\n return this.point;\n }\n\n /** The side half of the resolved placement, which Ark emits separately. */\n side(): string | null {\n const placement = this.placement();\n return placement ? sideOf(placement) : null;\n }\n\n create(candidates: AnchoredPosition[]): OverlayRef {\n this.candidates = candidates;\n this.strategy = this.overlay\n .position()\n // A zero-size origin: the cursor is a point, and giving it width would\n // offset the menu by half a phantom box. Replaced on every right-click.\n .flexibleConnectedTo({ x: 0, y: 0, width: 0, height: 0 })\n .withPositions(candidates.map((candidate) => candidate.position))\n // Push, but do not shrink — see `AnchoredSurface` for why narrowing a\n // menu to fit is the wrong kind of accommodation.\n .withFlexibleDimensions(false)\n .withPush(true)\n .withGrowAfterOpen(true);\n\n this.changes = this.strategy.positionChanges.subscribe((change) => {\n const match = this.candidates.find((candidate) => candidate.position === change.connectionPair);\n if (!match) return;\n this.latest = match.placement;\n if (this.point) this.placement.set(this.latest);\n });\n\n this.ref = createSurface(this.overlay, {\n positionStrategy: this.strategy,\n // Reposition rather than block: the menu belongs to a point in the page,\n // and the page is still the user's to scroll.\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n return this.ref;\n }\n\n /** Called when `sideOffset` or `alignOffset` changes. */\n setCandidates(candidates: AnchoredPosition[]): void {\n this.candidates = candidates;\n if (!this.strategy) return;\n this.strategy.withPositions(candidates.map((candidate) => candidate.position));\n if (this.point && this.ref?.hasAttached()) this.ref.updatePosition();\n }\n\n /**\n * Put the surface where the pointer was, and start reporting a placement.\n *\n * Called after the popup has been refreshed for the open state, never before:\n * a `hidden` popup has no height, and the CDK picks a candidate by asking\n * which one fits.\n */\n placeAt(point: AnchorPoint): void {\n this.point = point;\n this.strategy?.setOrigin({ ...point, width: 0, height: 0 });\n this.ref?.updatePosition();\n // Published even when `updatePosition` had nothing to say: the CDK only\n // emits when the chosen position *changes*.\n this.placement.set(this.latest);\n }\n\n dispose(): void {\n this.changes?.unsubscribe();\n this.ref?.dispose();\n }\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Injectable,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport { dividerStyles } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { restoreFocus } from \"../overlay/focus.js\";\nimport { inDomOrder, moveHighlight } from \"../overlay/roving.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { PointerSurface, type AnchorPoint } from \"./pointer-surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\n/** Zag's own long-press threshold, for the touch equivalent of a right-click. */\nconst LONG_PRESS = 700;\nconst ITEM_ICON_SIZE = 20;\nconst CHECK_ICON_SIZE = 16;\n\n/**\n * What the menu needs to know about one of its items. Functions rather than\n * values, so the menu always reads the item's *current* state.\n */\ninterface ContextMenuItemHandle {\n readonly element: HTMLElement;\n value(): string;\n disabled(): boolean;\n choose(): void;\n}\n\n/**\n * A menu opened by right-clicking an area of the page.\n *\n * ```html\n * <div uioContextMenuTrigger [contextMenu]=\"actions\">Right-click here</div>\n * <uio-context-menu #actions=\"uioContextMenu\">\n * <div uioContextMenuItem value=\"cut\" icon=\"scissors\">Cut</div>\n * <div uioContextMenuSeparator></div>\n * <div uioContextMenuItem value=\"delete\" destructive>Delete</div>\n * </uio-context-menu>\n * ```\n *\n * ── It is a Menu anchored to a point ────────────────────────────────────────\n *\n * Ark has no context-menu primitive: it is the Menu machine with a\n * `ContextTrigger`, so the scope stays `menu` and every part below carries the\n * ids and roles `UioMenu`'s do. What differs is the anchor. A `UioMenu` hangs\n * off a button; this hangs off wherever the pointer was, and that has a\n * consequence in the rendered DOM which is easy to get wrong in the other\n * direction: **a context menu that has never been right-clicked reports no\n * placement at all.** Opened declaratively it is `data-state=\"open\"` with no\n * `data-placement` and no `data-side`, because zag never measured it. See\n * `PointerSurface`.\n *\n * The same fork governs the content's accessible name. Zag names it after the\n * *context* trigger once a point exists, and after the plain trigger — an\n * element this component never renders — before then. That dangling reference\n * is Ark's, reproduced rather than tidied, because the two libraries have to\n * render the same thing and a difference here would be a difference in what a\n * screen reader announces.\n *\n * Focus, dismissal and the highlight are `UioMenu`'s story, written up there:\n * DOM focus stays on the `role=\"menu\"` element and the highlighted item is\n * *named* with `aria-activedescendant`, which is what the shared stylesheet's\n * `[data-highlighted]` rules read.\n */\n@Component({\n selector: \"uio-context-menu\",\n standalone: true,\n exportAs: \"uioContextMenu\",\n providers: [HostPresence],\n template: `\n <!-- See UioPopover: a container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"context-menu__positioner\"\n data-scope=\"menu\"\n data-part=\"positioner\"\n [id]=\"partId('popper')\"\n >\n <div\n class=\"context-menu__popup\"\n data-scope=\"menu\"\n data-part=\"content\"\n role=\"menu\"\n tabindex=\"0\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"pointer.placement()\"\n [attr.data-side]=\"pointer.side()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioContextMenu implements OnInit, OnDestroy {\n readonly open = model(false);\n /** Gap between the cursor and the menu, in px. */\n readonly sideOffset = input(4);\n readonly alignOffset = input(0);\n /** The value of the item that was chosen. */\n readonly select = output<string>();\n\n readonly machine = nextMachineId();\n readonly pointer = new PointerSurface(inject(Overlay));\n\n /** `null` until something is highlighted, which is how a menu opens. */\n readonly highlighted = signal<string | null>(null);\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly activeDescendant = computed(() => {\n const value = this.highlighted();\n return value === null ? null : this.itemId(value);\n });\n\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private items: ContextMenuItemHandle[] = [];\n private trigger: HTMLElement | null = null;\n /** Where the next open should place the surface, set by the right-click. */\n private pending: AnchorPoint | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n /**\n * `null`, not the trigger area.\n *\n * For every other overlay the trigger is excluded from \"outside\" so a click\n * on it cannot dismiss and re-open in one gesture. A context menu is opened\n * by a *right*-click, so a left-click anywhere — the trigger area very much\n * included — is a dismissal, which is what every desktop context menu does.\n */\n trigger: () => null,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n effect(() => {\n // `bottom-start` is zag's placement for a context menu: the menu hangs\n // down and to the right of the cursor, and flips when there is no room.\n const candidates = anchoredPositions(\"bottom\", \"start\", this.sideOffset(), this.alignOffset());\n untracked(() => this.pointer.setCandidates(candidates));\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see `UioMenu` for the ordering. */\n ngOnInit(): void {\n const ref = this.pointer.create(\n anchoredPositions(\"bottom\", \"start\", this.sideOffset(), this.alignOffset()),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.pointer.dispose();\n }\n\n partId(part: string): string {\n return `menu:${this.machine}:${part}`;\n }\n /**\n * Ark's item ids are `<machine>/<value>` rather than `<scope>:<machine>:<part>`\n * — the collection's own key, not a part name.\n */\n itemId(value: string): string {\n return `${this.machine}/${value}`;\n }\n\n /**\n * The trigger the content is named after — the *context* trigger once a\n * right-click has placed the menu, and the id of a plain trigger this\n * component never renders before that. Both halves are Ark's; see the class\n * note.\n */\n protected labelledBy(): string {\n return this.pointer.anchored ? this.partId(\"ctx-trigger\") : this.partId(\"trigger\");\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n\n /** Called by the trigger on right-click (or long-press). */\n openAt(point: AnchorPoint, trigger: HTMLElement): void {\n this.trigger = trigger;\n this.pending = point;\n // A second right-click while open has to move the menu, and `sync` only\n // runs on a *change* of state — so re-place it here as well.\n if (this.open()) this.place();\n this.setOpen(true);\n }\n\n rememberTrigger(element: HTMLElement | null): void {\n this.trigger = element;\n }\n\n register(item: ContextMenuItemHandle): void {\n this.items.push(item);\n }\n unregister(item: ContextMenuItemHandle): void {\n this.items = this.items.filter((candidate) => candidate !== item);\n }\n\n /** The pointer highlights exactly as the keyboard does — see `UioMenu`. */\n highlight(value: string | null): void {\n this.highlighted.set(value);\n }\n\n choose(value: string): void {\n this.select.emit(value);\n this.hide();\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.pointer.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private setOpen(next: boolean): void {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private place(): void {\n if (!this.pending) return;\n // Refreshed first: while closed the popup is `hidden` and has no size, and\n // the CDK chooses a candidate by asking which one fits.\n this.surfaceView?.detectChanges();\n this.pointer.placeAt(this.pending);\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.pointer.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n this.place();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n // Ark opens a menu with nothing highlighted; the first arrow key chooses.\n this.highlighted.set(null);\n this.contentElement()?.focus({ preventScroll: true });\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.highlighted.set(null);\n this.surfaceView?.detectChanges();\n const ref = this.pointer.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n restoreFocus(this.trigger);\n }\n\n private ordered(): ContextMenuItemHandle[] {\n return inDomOrder(this.items);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const items = this.ordered();\n const navigable = items.map((item) => ({ disabled: item.disabled() }));\n const current = items.findIndex((item) => item.value() === this.highlighted());\n\n const move = (step: number) => {\n const next = items[moveHighlight(navigable, current, step)];\n if (next) this.highlighted.set(next.value());\n event.preventDefault();\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return move(1);\n case \"ArrowUp\":\n return move(-1);\n case \"Home\":\n this.highlighted.set(null);\n return move(1);\n case \"End\":\n this.highlighted.set(null);\n return move(-1);\n case \"Enter\":\n case \" \": {\n const item = items[current];\n if (!item) return;\n event.preventDefault();\n item.choose();\n return;\n }\n case \"Tab\":\n // A menu is a modal-ish surface: Tab closes it rather than walking into\n // the page behind.\n this.hide();\n return;\n default:\n return;\n }\n }\n}\n\n/**\n * The area a right-click opens the menu over.\n *\n * A directive on the caller's own element rather than a component, because the\n * target is arbitrary content — a row, a canvas, a card — and Ark projects its\n * own `ContextTrigger` onto a plain `div` for exactly that reason. The\n * `user-select` inline style is Ark's too: without it a long-press on touch\n * starts a text selection instead of opening the menu.\n */\n@Directive({\n selector: \"[uioContextMenuTrigger]\",\n standalone: true,\n host: {\n style: \"user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;\",\n \"[id]\": \"contextMenu ? contextMenu.partId('ctx-trigger') : null\",\n \"[attr.data-ownedby]\": \"contextMenu ? contextMenu.machine : null\",\n \"(contextmenu)\": \"onContextMenu($event)\",\n \"(pointerdown)\": \"onPointerDown($event)\",\n \"(pointermove)\": \"cancelLongPress()\",\n \"(pointerup)\": \"cancelLongPress()\",\n \"(pointercancel)\": \"cancelLongPress()\",\n },\n})\nexport class UioContextMenuTrigger extends UioPart implements OnInit, OnDestroy {\n readonly scope = \"menu\";\n readonly part = \"context-trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"contextMenu\") contextMenu?: UioContextMenu;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private timer?: ReturnType<typeof setTimeout>;\n\n override readonly state = computed(() => (this.contextMenu?.open() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n this.contextMenu?.rememberTrigger(this.host.nativeElement);\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.timer);\n }\n\n protected onContextMenu(event: MouseEvent): void {\n if (!this.contextMenu) return;\n // Prevented, or the browser's own menu opens on top of this one.\n event.preventDefault();\n this.contextMenu.openAt({ x: event.clientX, y: event.clientY }, this.host.nativeElement);\n }\n\n /**\n * The touch equivalent of a right-click: press and hold.\n *\n * Mouse pointers are ignored — they have `contextmenu` — and any movement\n * cancels, so a scroll that starts on the trigger is a scroll rather than a\n * menu appearing under the user's thumb.\n */\n protected onPointerDown(event: PointerEvent): void {\n if (event.pointerType === \"mouse\" || !this.contextMenu) return;\n const point = { x: event.clientX, y: event.clientY };\n clearTimeout(this.timer);\n this.timer = setTimeout(\n () => this.contextMenu?.openAt(point, this.host.nativeElement),\n LONG_PRESS,\n );\n }\n\n protected cancelLongPress(): void {\n clearTimeout(this.timer);\n }\n}\n\n/**\n * One action in a context menu.\n *\n * A `div` with `role=\"menuitem\"` rather than a `button`, because that is what\n * Ark renders and because `role=\"menu\"` admits no other children.\n */\n@Component({\n selector: \"[uioContextMenuItem]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n @if (icon(); as name) {\n <span uioIcon class=\"context-menu__item-icon\" [name]=\"name\" [size]=\"ICON_SIZE\"></span>\n }\n <span class=\"context-menu__item-label\"><ng-content /></span>\n `,\n host: {\n role: \"menuitem\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"menu.itemId(itemValue())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"itemValue()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"choose()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : itemValue())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioContextMenuItem extends UioPart implements OnInit, OnDestroy {\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n /** Optional, and falls back to a generated id — the same fork React takes. */\n readonly value = input<string | undefined>(undefined);\n readonly icon = input<IconName | IconGlyph | undefined>(undefined);\n /** Red text at rest, filling solid on highlight — the destructive-ghost button. */\n readonly destructive = input(false, { transform: booleanAttribute });\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioContextMenu);\n protected readonly ICON_SIZE = ITEM_ICON_SIZE;\n protected readonly hostClass = computed(() =>\n clsx(\"context-menu__item\", this.destructive() && \"context-menu__item--destructive\"),\n );\n\n private readonly generated = nextMachineId();\n protected readonly itemValue = computed(() => this.value() ?? this.generated);\n\n override readonly highlighted = computed(() => this.menu.highlighted() === this.itemValue());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Registration rather than a content query — see `UioMenuItem` for why. */\n private readonly handle: ContextMenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.itemValue(),\n disabled: () => this.disabled(),\n choose: () => this.choose(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected choose(): void {\n if (this.disabled()) return;\n this.menu.choose(this.itemValue());\n }\n}\n\n/**\n * The rule between groups of actions.\n *\n * The surface is the design system's Divider with Ark's separator identity\n * merged onto it. React does that with `asChild`; Angular has no such thing and\n * cannot put two components on one element, so the class is composed from\n * `dividerStyles` directly. Same rendered element, one fewer indirection.\n */\n@Directive({\n selector: \"[uioContextMenuSeparator]\",\n standalone: true,\n host: {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n \"[class]\": \"hostClass\",\n },\n})\nexport class UioContextMenuSeparator extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"separator\";\n protected readonly hostClass = clsx(\n dividerStyles({ orientation: \"horizontal\", spacing: \"none\" }),\n \"context-menu__separator\",\n );\n}\n\n/** The id a group and its label share, so the one can name the other. */\n@Injectable()\nexport class UioContextMenuGroupContext {\n private readonly menu = inject(UioContextMenu);\n private readonly key = nextMachineId();\n\n get groupId(): string {\n return this.menu.partId(`group:${this.key}`);\n }\n get labelId(): string {\n return this.menu.partId(`group-label:${this.key}`);\n }\n}\n\n/**\n * A titled block of related actions.\n *\n * `aria-labelledby` points at the label whether or not one was written, which\n * is Ark's own behaviour rather than an oversight copied — zag builds both ids\n * from the same key and never checks that the label exists. A group with no\n * label therefore ships a dangling reference in all four libraries alike, and\n * the fix belongs upstream.\n */\n@Directive({\n selector: \"[uioContextMenuGroup]\",\n standalone: true,\n providers: [UioContextMenuGroupContext],\n host: {\n class: \"context-menu__group\",\n role: \"group\",\n \"[id]\": \"group.groupId\",\n \"[attr.aria-labelledby]\": \"group.labelId\",\n },\n})\nexport class UioContextMenuGroup extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group\";\n protected readonly group = inject(UioContextMenuGroupContext);\n}\n\n/** Names the group above it. */\n@Directive({\n selector: \"[uioContextMenuGroupLabel]\",\n standalone: true,\n host: {\n class: \"context-menu__group-label text-strong-body-small\",\n \"[id]\": \"group.labelId\",\n },\n})\nexport class UioContextMenuGroupLabel extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group-label\";\n protected readonly group = inject(UioContextMenuGroupContext);\n}\n\n/**\n * A togglable action, drawn with the design system's checkbox control.\n *\n * The check is driven by the *item's* `data-state`, not by the control's own —\n * `.context-menu__item--check[data-state=\"checked\"] .checkbox__indicator` is the\n * rule, which is why the control below is inert markup rather than a\n * `UioCheckbox`. A real checkbox inside a `role=\"menu\"` would bring an input,\n * its own focus, and a second thing to tab to.\n */\n@Component({\n selector: \"[uioContextMenuCheckboxItem]\",\n standalone: true,\n imports: [UioIcon],\n template: `\n <span class=\"checkbox__control context-menu__control\">\n <span class=\"checkbox__indicator\">\n <span uioIcon class=\"checkbox__check\" [name]=\"glyph('check')\" [size]=\"CHECK_SIZE\"></span>\n </span>\n </span>\n <span class=\"context-menu__item-label\"><ng-content /></span>\n `,\n host: {\n class: \"context-menu__item context-menu__item--check\",\n \"data-type\": \"checkbox\",\n role: \"menuitemcheckbox\",\n \"[id]\": \"menu.itemId(itemValue())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"itemValue()\",\n \"[attr.aria-checked]\": \"checked()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"toggle()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : itemValue())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioContextMenuCheckboxItem extends UioPart implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n readonly value = input<string | undefined>(undefined);\n readonly checked = model(false);\n readonly checkedChange = output<boolean>();\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioContextMenu);\n protected readonly CHECK_SIZE = CHECK_ICON_SIZE;\n\n private readonly generated = nextMachineId();\n protected readonly itemValue = computed(() => this.value() ?? this.generated);\n\n /** `checked`/`unchecked` rather than `open`/`closed` — zag's spelling for an option item. */\n override readonly state = computed(() => (this.checked() ? \"checked\" : \"unchecked\"));\n override readonly highlighted = computed(() => this.menu.highlighted() === this.itemValue());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly handle: ContextMenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.itemValue(),\n disabled: () => this.disabled(),\n choose: () => this.toggle(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected toggle(): void {\n if (this.disabled()) return;\n const next = !this.checked();\n this.checked.set(next);\n this.checkedChange.emit(next);\n // A checkbox item does not close the menu: toggling several in a row is the\n // whole reason it is a checkbox rather than an action.\n }\n}\n\n/** One choice at a time, shared by the radio items inside it. */\n@Injectable()\nexport class UioContextMenuRadioContext {\n readonly value = signal<string | null>(null);\n choose: (value: string) => void = () => {};\n}\n\n/**\n * A set of mutually exclusive choices.\n *\n * Not an Ark part in its own right — `RadioItemGroup` renders the same\n * `item-group` element a plain group does — so this carries the group's\n * identity and, additionally, the selected value its items read.\n */\n@Directive({\n selector: \"[uioContextMenuRadioGroup]\",\n standalone: true,\n providers: [UioContextMenuGroupContext, UioContextMenuRadioContext],\n host: {\n class: \"context-menu__group\",\n role: \"group\",\n \"[id]\": \"group.groupId\",\n \"[attr.aria-labelledby]\": \"group.labelId\",\n },\n})\nexport class UioContextMenuRadioGroup extends UioPart {\n readonly scope = \"menu\";\n readonly part = \"item-group\";\n\n readonly value = model<string | null>(null);\n readonly valueChange = output<string>();\n\n protected readonly group = inject(UioContextMenuGroupContext);\n private readonly radio = inject(UioContextMenuRadioContext);\n\n constructor() {\n super();\n this.radio.choose = (value) => {\n this.value.set(value);\n this.valueChange.emit(value);\n };\n // The context holds a plain signal rather than the model itself, so that a\n // spec replacing the input after construction — which is the only way a JIT\n // fixture can set one — still reaches the items. Same reason\n // `UioCollapsible` wraps its `disabled`.\n effect(() => this.radio.value.set(this.value()));\n }\n}\n\n/** One choice, drawn with the design system's radio control. */\n@Component({\n selector: \"[uioContextMenuRadioItem]\",\n standalone: true,\n template: `\n <span class=\"radio-item__control context-menu__control\">\n <span class=\"radio-item__indicator\"></span>\n </span>\n <span class=\"context-menu__item-label\"><ng-content /></span>\n `,\n host: {\n class: \"context-menu__item context-menu__item--check\",\n \"data-type\": \"radio\",\n role: \"menuitemradio\",\n \"[id]\": \"menu.itemId(value())\",\n \"[attr.data-ownedby]\": \"menu.partId('content')\",\n \"[attr.data-value]\": \"value()\",\n \"[attr.aria-checked]\": \"isChecked()\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"(click)\": \"choose()\",\n \"(pointermove)\": \"menu.highlight(disabled() ? null : value())\",\n \"(pointerleave)\": \"menu.highlight(null)\",\n },\n})\nexport class UioContextMenuRadioItem extends UioPart implements OnInit, OnDestroy {\n readonly scope = \"menu\";\n readonly part = \"item\";\n\n /** Required: a radio item is identified by the value it selects. */\n readonly value = input.required<string>();\n override readonly disabled = input(false, { transform: booleanAttribute });\n\n protected readonly menu = inject(UioContextMenu);\n private readonly radio = inject(UioContextMenuRadioContext);\n\n protected readonly isChecked = computed(() => this.radio.value() === this.value());\n override readonly state = computed(() => (this.isChecked() ? \"checked\" : \"unchecked\"));\n override readonly highlighted = computed(() => this.menu.highlighted() === this.value());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly handle: ContextMenuItemHandle = {\n element: this.host.nativeElement,\n value: () => this.value(),\n disabled: () => this.disabled(),\n choose: () => this.choose(),\n };\n\n ngOnInit(): void {\n this.menu.register(this.handle);\n }\n ngOnDestroy(): void {\n this.menu.unregister(this.handle);\n }\n\n protected choose(): void {\n if (this.disabled()) return;\n this.radio.choose(this.value());\n this.menu.choose(this.value());\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ApplicationRef,\n Component,\n ElementRef,\n TemplateRef,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { splitterStyles, type SplitterVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\n\nexport type SplitterOrientation = NonNullable<SplitterVariants[\"orientation\"]>;\nexport type SplitterVariant = NonNullable<SplitterVariants[\"variant\"]>;\n\nexport interface SplitterPanelDef {\n /** Unique across the splitter. Handle ids are derived from adjacent pairs. */\n id: string;\n /**\n * Human name for the panel, used to label the resize handles beside it\n * (\"Resize sidebar and main\"). Defaults to `id`, which is fine when ids read\n * as words and worth setting when they don't.\n */\n label?: string;\n /**\n * A string, or a template for anything richer.\n *\n * The other three libraries take a node here, which Angular has no equivalent\n * of inside a data array. A `TemplateRef` is the Angular way to hand a\n * component markup it will render itself, and it costs the string case\n * nothing. Same shape as `TabItem.content`.\n */\n content?: string | TemplateRef<unknown>;\n /** Smallest size, as a percentage of the group. */\n minSize?: number;\n /** Largest size, as a percentage of the group. */\n maxSize?: number;\n /** Allows the panel to collapse to `collapsedSize`. */\n collapsible?: boolean;\n /** Size the panel collapses to, as a percentage. Defaults to 0. */\n collapsedSize?: number;\n}\n\n/** What a handle reports to assistive technology about the panel before it. */\nexport interface SplitterAriaValues {\n valueNow: number;\n valueMin: number;\n valueMax: number;\n}\n\n/**\n * How many decimal places two sizes have to agree on to count as equal, and the\n * number every constrained size is rounded to.\n *\n * Zag's, and it has to be shared rather than \"close enough\": a splitter divides\n * 100 by three and then adds the parts back up, so a comparison against a bare\n * `===` decides that 33.333333333333336 is not 33.333333333333336 and the\n * layout is redistributed on every render.\n */\nconst PRECISION = 10;\n\nconst nearlyEqual = (a: number, b: number) => a.toFixed(PRECISION) === b.toFixed(PRECISION);\n\n/**\n * Clamp one panel to its own constraints.\n *\n * Collapsing is a snap rather than a clamp: a collapsible panel pushed below\n * its minimum goes the rest of the way to `collapsedSize` once it is past the\n * halfway mark between the two, and stops at the minimum before that. A clamp\n * would leave a panel that can be collapsed permanently stuck one pixel above\n * being collapsed.\n */\nfunction clampPanel(panel: SplitterPanelDef, size: number): number {\n const min = panel.minSize ?? 0;\n const max = panel.maxSize ?? 100;\n const collapsed = panel.collapsedSize ?? 0;\n let next = size;\n if (next < min) {\n next = panel.collapsible && next < (collapsed + min) / 2 ? collapsed : min;\n }\n return Number.parseFloat(Math.min(max, next).toFixed(PRECISION));\n}\n\n/**\n * Fill in the sizes the caller did not give, then make the layout legal.\n *\n * Two passes, and the second is the one that is easy to leave out. Panels with a\n * stated size keep it and the rest split what is left evenly — but an even split\n * ignores every `minSize` and `maxSize`, so a panel pinned to 30% would render\n * at 50 and report `aria-valuenow=\"50\"` on a handle that cannot move. So each\n * panel is clamped, what it could not take is collected, and the surplus is\n * offered to the others in turn until it is gone. That is zag's `validateSizes`,\n * and reproducing it is what makes a pinned panel actually pinned.\n *\n * Exported because it is the whole of \"what size is each panel\", and the one\n * part of this component worth asserting without a DOM.\n */\nexport function resolveSplitterSizes(\n panels: readonly SplitterPanelDef[],\n sizes: readonly number[] | undefined,\n): number[] {\n const next: number[] = Array(panels.length);\n let unassigned = 100;\n let assigned = 0;\n panels.forEach((_, index) => {\n const size = sizes?.[index];\n if (size == null || !Number.isFinite(size)) return;\n assigned++;\n next[index] = size;\n unassigned -= size;\n });\n panels.forEach((_, index) => {\n if (next[index] != null) return;\n const left = panels.length - assigned;\n assigned++;\n next[index] = left > 0 ? unassigned / left : 0;\n unassigned -= next[index]!;\n });\n\n // A caller's sizes need not add up; scale them so they do before anything is\n // clamped, or the surplus below would be measuring the caller's arithmetic.\n const total = next.reduce((sum, size) => sum + size, 0);\n if (next.length && !nearlyEqual(total, 100)) {\n for (let index = 0; index < next.length; index++) next[index] = (100 / total) * next[index]!;\n }\n\n let surplus = 0;\n panels.forEach((panel, index) => {\n const safe = clampPanel(panel, next[index]!);\n if (safe === next[index]) return;\n surplus += next[index]! - safe;\n next[index] = safe;\n });\n if (nearlyEqual(surplus, 0)) return next;\n\n for (let index = 0; index < panels.length; index++) {\n const safe = clampPanel(panels[index]!, next[index]! + surplus);\n if (safe === next[index]) continue;\n surplus -= safe - next[index]!;\n next[index] = safe;\n if (nearlyEqual(surplus, 0)) break;\n }\n return next;\n}\n\n/**\n * What a handle reports, which is *not* simply the panel's own min and max.\n *\n * A handle can only move as far as the rest of the group allows: a panel with\n * no maximum of its own still cannot grow past what every other panel's minimum\n * leaves free. Zag computes both bounds that way and rounds them, and a screen\n * reader announcing a range the handle cannot reach is a promise the component\n * does not keep.\n */\nexport function splitterAriaValues(\n panels: readonly SplitterPanelDef[],\n sizes: readonly number[],\n index: number,\n): SplitterAriaValues {\n let currentMin = 0;\n let currentMax = 100;\n let othersMin = 0;\n let othersMax = 0;\n panels.forEach((panel, panelIndex) => {\n const min = panel.minSize ?? 0;\n const max = panel.maxSize ?? 100;\n if (panelIndex === index) {\n currentMin = min;\n currentMax = max;\n } else {\n othersMin += min;\n othersMax += max;\n }\n });\n return {\n valueNow: Math.round(sizes[index] ?? 0),\n valueMin: Math.round(Math.max(currentMin, 100 - othersMax)),\n valueMax: Math.round(Math.min(currentMax, 100 - othersMin)),\n };\n}\n\n/**\n * Move a handle by `delta` percentage points, and hand back the new layout.\n *\n * Only the two panels either side of the handle move — everything else in the\n * group keeps its size, which is what makes a drag feel local. A panel that\n * cannot give up the whole delta gives what it can, and the pair stays summing\n * to what it summed to before: taking from one without giving to the other is\n * how a splitter silently loses a percent per drag until the last panel has\n * eaten the group.\n *\n * Both panels are held to their own constraints by the same `clampPanel` the\n * initial layout uses, so a drag cannot reach a size the layout would refuse.\n */\nexport function applySplitterDelta(\n panels: readonly SplitterPanelDef[],\n sizes: readonly number[],\n index: number,\n delta: number,\n): number[] {\n const next = [...sizes];\n const before = panels[index];\n const after = panels[index + 1];\n if (!before || !after) return next;\n\n const total = (next[index] ?? 0) + (next[index + 1] ?? 0);\n const wanted = clampPanel(before, (next[index] ?? 0) + delta);\n const paired = clampPanel(after, total - wanted);\n // Re-derived from what the *second* panel could actually accept, so the pair\n // always sums to `total`.\n next[index] = total - paired;\n next[index + 1] = paired;\n return next;\n}\n\n/**\n * Keep every pointer event of a drag arriving at the handle, even once the\n * pointer has left the four pixels it started on.\n *\n * Guarded rather than called outright, and the guard is load-bearing in two\n * places: `setPointerCapture` throws `NotFoundError` for a pointer id that is\n * not currently down, which is every id a synthesised event in a spec carries,\n * and the whole API is missing in older engines. Capture is an improvement to\n * the drag rather than a requirement of it — without it a move that leaves the\n * handle simply stops arriving — so a failure here must not take the drag with\n * it.\n */\nfunction capturePointer(element: HTMLElement, pointerId: number): void {\n try {\n element.setPointerCapture?.(pointerId);\n } catch {\n // No live pointer to capture.\n }\n}\n\nfunction releasePointer(element: HTMLElement, pointerId: number): void {\n try {\n if (element.hasPointerCapture?.(pointerId)) element.releasePointerCapture(pointerId);\n } catch {\n // Nothing was captured.\n }\n}\n\n/**\n * Resizable panes with a draggable handle between each adjacent pair.\n *\n * ```html\n * <div uioSplitter [panels]=\"panes\" [(size)]=\"sizes\" orientation=\"vertical\"></div>\n * ```\n *\n * ── Panels are data, and the handles are not the caller's to place ──────────\n *\n * A handle belongs *between* two panels, and there is no way to interleave\n * elements the component owns with content the caller projected — `<ng-content>`\n * is one slot and everything lands in it in order. So `panels` is data and the\n * component renders the whole strip, which is also how React, Svelte and Vue\n * spell it: all three take a `panels` array and derive each handle's id from the\n * pair it sits between (`\"a:b\"`).\n *\n * There is deliberately no `disabled` input: the machine has none in any\n * library. Resizing is constrained per panel instead — give a panel equal\n * `minSize` and `maxSize` and the handles beside it can no longer move, which is\n * what `aria-valuemin === aria-valuemax` reports.\n *\n * ── Sizes are percentages, and they live here ───────────────────────────────\n *\n * Every size in this component is a percentage of the group, never a pixel\n * count, because that is the only unit that survives the container changing\n * size. The flex basis is written inline for the same reason zag writes it:\n * `flex-grow: <size>` on a `flex-basis: 0` child *is* the layout, and no\n * stylesheet can know the numbers.\n */\n@Component({\n selector: \"div[uioSplitter]\",\n standalone: true,\n exportAs: \"uioSplitter\",\n imports: [NgTemplateOutlet],\n template: `\n @for (panel of panels(); track panel.id; let index = $index) {\n <div\n class=\"splitter__panel\"\n data-scope=\"splitter\"\n data-part=\"panel\"\n [id]=\"panelId(panel.id)\"\n [attr.data-id]=\"panel.id\"\n [attr.data-index]=\"index\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging() !== null ? '' : null\"\n [style.flex-grow]=\"sizes()[index]\"\n [style.flex-shrink]=\"1\"\n [style.flex-basis]=\"'0'\"\n [style.overflow]=\"'hidden'\"\n [style.min-width]=\"panel.minSize != null && horizontal() ? panel.minSize + '%' : null\"\n [style.max-width]=\"panel.maxSize != null && horizontal() ? panel.maxSize + '%' : null\"\n [style.min-height]=\"panel.minSize != null && !horizontal() ? panel.minSize + '%' : null\"\n [style.max-height]=\"panel.maxSize != null && !horizontal() ? panel.maxSize + '%' : null\"\n [style.pointer-events]=\"dragging() !== null ? 'none' : null\"\n >\n @if (asTemplate(panel.content); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ panel.content }}\n }\n </div>\n <!--\n A handle sits between adjacent panels, so the last panel has none. It is\n a button element with role=\"separator\" and no type attribute, which is\n what Ark renders — the missing type is reproduced rather than corrected,\n because the four libraries have to render the same element and a\n splitter is not inside a form.\n -->\n @if (index < panels().length - 1) {\n <button\n class=\"splitter__trigger\"\n data-scope=\"splitter\"\n data-part=\"resize-trigger\"\n role=\"separator\"\n tabindex=\"0\"\n [id]=\"triggerId(index)\"\n [attr.data-id]=\"handleId(index)\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-valuenow]=\"aria(index).valueNow\"\n [attr.aria-valuemin]=\"aria(index).valueMin\"\n [attr.aria-valuemax]=\"aria(index).valueMax\"\n [attr.aria-controls]=\"controls(index)\"\n [attr.aria-label]=\"handleLabel(index)\"\n [attr.data-focus]=\"focused() === index ? '' : null\"\n [attr.data-dragging]=\"dragging() === index ? '' : null\"\n [style.touch-action]=\"'none'\"\n [style.user-select]=\"'none'\"\n [style.flex]=\"'0 0 auto'\"\n [style.cursor]=\"horizontal() ? 'col-resize' : 'row-resize'\"\n [style.min-height]=\"horizontal() ? '0' : null\"\n [style.min-width]=\"horizontal() ? null : '0'\"\n (pointerdown)=\"onPointerDown($event, index)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event, index)\"\n (focus)=\"focused.set(index)\"\n (blur)=\"focused.set(null)\"\n >\n <span class=\"splitter__grip\" aria-hidden=\"true\"></span>\n </button>\n }\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n // Not a `UioPart` attribute: `data-dragging` is read by `.splitter__trigger`\n // alone, and adding it to the base would put a binding on every element in\n // the library for one component's benefit. See `part.spec.ts`.\n \"[attr.data-dragging]\": \"dragging() !== null ? '' : null\",\n \"[style.display]\": \"'flex'\",\n \"[style.flex-direction]\": \"horizontal() ? 'row' : 'column'\",\n \"[style.height]\": \"'100%'\",\n \"[style.width]\": \"'100%'\",\n \"[style.overflow]\": \"'hidden'\",\n },\n})\nexport class UioSplitter extends UioPart {\n readonly scope = \"splitter\";\n readonly part = \"root\";\n\n /** The panels, in order. A handle is placed between each adjacent pair. */\n readonly panels = input<readonly SplitterPanelDef[]>([]);\n /**\n * The sizes, as percentages. Uncontrolled until something binds it, which is\n * why there is no separate `defaultSize` — see `UioSwitch` for the note.\n */\n readonly size = model<readonly number[] | undefined>(undefined);\n override readonly orientation = input<SplitterOrientation>(\"horizontal\");\n /** `subtle` shows the rule only on hover or focus. */\n readonly variant = input<SplitterVariant>(\"default\");\n\n /** Fired continuously while a handle moves. */\n readonly resize = output<number[]>();\n /** Fired once, when the drag or the keypress ends. */\n readonly resizeEnd = output<number[]>();\n\n /**\n * Ark spells the root id `splitter:<machine>` with no part suffix, and every\n * panel's `data-ownedby` points at it.\n */\n protected readonly rootId = `splitter:${nextMachineId()}`;\n\n private readonly appRef = inject(ApplicationRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The index of the handle being dragged, or `null`. Also drives `data-dragging`. */\n protected readonly dragging = signal<number | null>(null);\n protected readonly focused = signal<number | null>(null);\n\n /** Where the pointer was, and what the layout was, when the drag started. */\n private origin = 0;\n private startSizes: number[] = [];\n\n protected readonly horizontal = computed(() => this.orientation() === \"horizontal\");\n protected readonly hostClass = computed(() =>\n splitterStyles({ orientation: this.orientation(), variant: this.variant() }),\n );\n protected readonly sizes = computed(() => resolveSplitterSizes(this.panels(), this.size()));\n\n protected panelId(id: string): string {\n return `${this.rootId}:panel:${id}`;\n }\n /** Zag identifies a handle by the literal `before:after` pair of panel ids. */\n protected handleId(index: number): string {\n return `${this.panels()[index]?.id}:${this.panels()[index + 1]?.id}`;\n }\n /**\n * The handle is a `<button role=\"separator\">` whose only child is a decorative\n * grip, so it had no accessible name — a keyboard user landed on an unnamed\n * control with arrow keys that did something unexplained. Naming it after the\n * two panels it sits between says what moving it will do. Same name as the\n * other three libraries render.\n */\n protected handleLabel(index: number): string {\n const before = this.panels()[index];\n const after = this.panels()[index + 1];\n return `Resize ${before?.label ?? before?.id} and ${after?.label ?? after?.id}`;\n }\n protected triggerId(index: number): string {\n return `${this.rootId}:splitter:${this.handleId(index)}`;\n }\n protected controls(index: number): string | null {\n const before = this.panels()[index];\n const after = this.panels()[index + 1];\n return before && after ? `${this.panelId(before.id)} ${this.panelId(after.id)}` : null;\n }\n protected aria(index: number): SplitterAriaValues {\n return splitterAriaValues(this.panels(), this.sizes(), index);\n }\n\n protected asTemplate(content: SplitterPanelDef[\"content\"]): TemplateRef<unknown> | null {\n return content instanceof TemplateRef ? content : null;\n }\n\n protected onPointerDown(event: PointerEvent, index: number): void {\n if (event.button !== 0) return;\n const handle = event.currentTarget as HTMLElement;\n // `currentTarget`, never `target`: the pointer usually lands on the grip\n // inside the handle, and focusing that focuses nothing — which leaves the\n // arrow keys doing nothing after a click, silently.\n handle.focus({ preventScroll: true });\n capturePointer(handle, event.pointerId);\n this.origin = this.horizontal() ? event.clientX : event.clientY;\n this.startSizes = this.sizes();\n this.dragging.set(index);\n event.preventDefault();\n event.stopPropagation();\n }\n\n protected onPointerMove(event: PointerEvent): void {\n const index = this.dragging();\n if (index === null) return;\n const box = this.host.nativeElement.getBoundingClientRect();\n const extent = this.horizontal() ? box.width : box.height;\n if (!extent) return;\n // Pixels to percent of the *group*, which is the unit every size is in.\n const moved = (this.horizontal() ? event.clientX : event.clientY) - this.origin;\n this.commit(applySplitterDelta(this.panels(), this.startSizes, index, (moved / extent) * 100));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (this.dragging() === null) return;\n releasePointer(event.currentTarget as HTMLElement, event.pointerId);\n this.dragging.set(null);\n this.resizeEnd.emit(this.sizes());\n flushNow(this.appRef);\n }\n\n /**\n * The keyboard equivalent of a drag, and the only way a handle is usable\n * without a pointer at all.\n *\n * The arrow keys that move a handle are the ones that run *along* its axis —\n * left/right for a vertical rule, up/down for a horizontal one — so the two\n * that would move it sideways are left alone rather than silently swallowed.\n * Shift multiplies the step by ten, which is zag's, and Home/End run the\n * handle to its limits by asking for a delta no constraint can grant.\n */\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const step = event.shiftKey ? 10 : 1;\n const horizontal = this.horizontal();\n let delta: number | null = null;\n switch (event.key) {\n case \"ArrowLeft\":\n delta = horizontal ? -step : null;\n break;\n case \"ArrowRight\":\n delta = horizontal ? step : null;\n break;\n case \"ArrowUp\":\n delta = horizontal ? null : -step;\n break;\n case \"ArrowDown\":\n delta = horizontal ? null : step;\n break;\n case \"Home\":\n delta = -100;\n break;\n case \"End\":\n delta = 100;\n break;\n default:\n return;\n }\n if (delta === null) return;\n event.preventDefault();\n this.commit(applySplitterDelta(this.panels(), this.sizes(), index, delta));\n // A keypress is a complete gesture, so the end fires with it — unlike a\n // drag, where it waits for the pointer to come up.\n this.resizeEnd.emit(this.sizes());\n flushNow(this.appRef);\n }\n\n private commit(next: number[]): void {\n this.size.set(next);\n this.resize.emit(next);\n flushNow(this.appRef);\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport {\n CONTROL_ICON_SIZE,\n treeViewStyles,\n type ControlSize,\n type TreeViewVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport type { IconGlyph } from \"../icons/glyph.js\";\nimport type { IconName } from \"../icons/icon.js\";\n\nexport type TreeViewSize = NonNullable<TreeViewVariants[\"size\"]>;\nexport type TreeViewVariant = NonNullable<TreeViewVariants[\"variant\"]>;\nexport type TreeViewSelectionMode = \"single\" | \"multiple\";\n\n/**\n * The chevron and the node icons stay one step below the text: they mark the\n * row rather than compete with it.\n */\nconst INDICATOR_SIZE = 16;\n\nexport interface TreeViewNode {\n /** Unique across the whole tree. Selection and expansion are keyed on this. */\n id: string;\n /** Display text. */\n label: string;\n /** A node with children renders as a branch, one without as a leaf. */\n children?: TreeViewNode[];\n /** Icon before the label. Branches default to a folder, leaves to none. */\n icon?: IconName | IconGlyph;\n /** Prevents selection and focus while keeping the node visible. */\n disabled?: boolean;\n}\n\n/** One node paired with where it sits, which is what every part below reads. */\ninterface FlatNode {\n node: TreeViewNode;\n /** The child index at each level, which is zag's `data-path`. */\n indexPath: number[];\n /** 1-based, and both `aria-level` and the `--depth` the indentation uses. */\n depth: number;\n isBranch: boolean;\n /** Whether every ancestor is expanded, i.e. whether the row is on screen. */\n visible: boolean;\n}\n\n/**\n * A disclosure tree.\n *\n * ```html\n * <div uioTreeView [items]=\"files\" label=\"Files\" [(selectedValue)]=\"picked\"></div>\n * ```\n *\n * ── The tree is data, and it has to be ──────────────────────────────────────\n *\n * Every other framework in this system takes `items` too, so the shape is not\n * an Angular concession — but Angular is the one where it is *forced*. The node\n * decides whether it renders as a branch or a leaf, and a branch renders a\n * panel that holds its children. A content query cannot answer that question:\n * the query populates from `<ng-content>`, which lives inside the very `@if`\n * the answer controls. `UioNavItem`'s `[subItems]` is the same constraint one\n * level shallower, and every collection in this package resolves it the same\n * way.\n *\n * The recursion is a `<ng-template>` that renders itself. A component per node\n * would work too and would mean a second class, a second registration list and\n * a second place for selection state to live; the template keeps every decision\n * in this one component, where the selection and expansion actually are.\n *\n * ── Focus is real, and it roves ─────────────────────────────────────────────\n *\n * Menu and Select in this library keep DOM focus on the popup and *name* the\n * highlighted option. A tree is the opposite, and Ark is explicit about it: the\n * tree itself is `tabindex=\"-1\"`, the focused node is `tabindex=\"0\"`, and arrow\n * keys move real focus between rows. That matters for the stylesheet as much as\n * for the user — `.tree-view__item[data-focus]` is the keyboard highlight, and\n * it has to be the row the browser has actually focused or a `:focus-visible`\n * ring would appear on a different row than the fill.\n *\n * One node always carries `data-focus`, from first render, before anything has\n * been clicked: the first node that is not disabled. That is zag's\n * `focusedValue` default, and dropping it would leave a tree whose first Tab\n * lands nowhere.\n *\n * ── A collapsed branch still renders its children ───────────────────────────\n *\n * The panel is `hidden`, not absent, in all four libraries — so expanding\n * changes attributes rather than the element list. Ark builds each branch out of\n * a Collapsible, which is why the branch and its content carry\n * `collapsible:<machine>` ids rather than tree ones, and why a **settled open**\n * panel reports no `data-state` at all. See `UioCollapsibleContext` for the\n * whole of that rule; here there is no animation to feed, so the attribute is\n * simply absent while open and `\"closed\"` while closed.\n */\n@Component({\n selector: \"div[uioTreeView]\",\n standalone: true,\n exportAs: \"uioTreeView\",\n imports: [NgTemplateOutlet, UioIcon],\n template: `\n @if (label(); as text) {\n <h3 class=\"tree-view__label\" data-scope=\"tree-view\" data-part=\"label\" [id]=\"partId('label')\">\n {{ text }}\n </h3>\n }\n <!--\n aria-label is the literal string zag ships as its default translation, and\n aria-labelledby points at the label part whether or not one was rendered.\n Both are Ark's: an unlabelled tree ships a dangling reference in every\n library, and correcting it here would be the one difference this gate\n could not tell from a port bug.\n -->\n <div\n class=\"tree-view__tree\"\n data-scope=\"tree-view\"\n data-part=\"tree\"\n role=\"tree\"\n aria-label=\"Tree View\"\n tabindex=\"-1\"\n [id]=\"partId('tree')\"\n [attr.aria-labelledby]=\"partId('label')\"\n [attr.aria-multiselectable]=\"selectionMode() === 'multiple' ? 'true' : null\"\n (keydown)=\"onKeydown($event)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"nodes\"\n [ngTemplateOutletContext]=\"{ $implicit: items(), path: [] }\"\n />\n </div>\n\n <!--\n The recursion. \"path\" is the index path of the *parent*, so each level\n appends its own index and a child never has to be told where it sits.\n -->\n <ng-template #nodes let-list let-path=\"path\">\n @for (node of list; track node.id; let index = $index) {\n @let indexPath = path.concat(index);\n @let depth = indexPath.length;\n @if (node.children && node.children.length) {\n <div\n class=\"tree-view__branch\"\n data-scope=\"tree-view\"\n data-part=\"branch\"\n role=\"treeitem\"\n [id]=\"branchId(node.id)\"\n [attr.data-branch]=\"node.id\"\n [attr.data-value]=\"node.id\"\n [attr.data-ownedby]=\"partId('tree')\"\n [attr.data-path]=\"indexPath.join('/')\"\n [attr.data-depth]=\"depth\"\n [attr.aria-level]=\"depth\"\n [attr.data-state]=\"expandedState(node.id)\"\n [attr.aria-expanded]=\"isExpanded(node.id)\"\n [attr.aria-selected]=\"node.disabled ? null : isSelected(node.id)\"\n [attr.data-selected]=\"flag(isSelected(node.id))\"\n [attr.aria-disabled]=\"node.disabled ? 'true' : null\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n [attr.style]=\"depthStyle(depth)\"\n >\n <div\n class=\"tree-view__branch-control\"\n data-scope=\"tree-view\"\n data-part=\"branch-control\"\n role=\"button\"\n [id]=\"nodeId(node.id)\"\n [attr.tabindex]=\"isFocused(node.id) ? 0 : -1\"\n [attr.data-path]=\"indexPath.join('/')\"\n [attr.data-value]=\"node.id\"\n [attr.data-depth]=\"depth\"\n [attr.data-state]=\"expandedState(node.id)\"\n [attr.data-selected]=\"flag(isSelected(node.id))\"\n [attr.data-focus]=\"flag(isFocused(node.id))\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n (click)=\"onBranchClick(node)\"\n (focus)=\"focusNode(node.id)\"\n >\n <div\n class=\"tree-view__branch-indicator\"\n data-scope=\"tree-view\"\n data-part=\"branch-indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"expandedState(node.id)\"\n [attr.data-selected]=\"flag(isSelected(node.id))\"\n [attr.data-focus]=\"flag(isFocused(node.id))\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n >\n <span uioIcon [name]=\"glyph('chevron-right')\" [size]=\"INDICATOR_SIZE\"></span>\n </div>\n <!-- A branch always asks for an icon; a leaf only when it has one. -->\n <span\n uioIcon\n class=\"tree-view__node-icon\"\n [name]=\"node.icon ?? glyph('folder')\"\n [size]=\"iconSize()\"\n ></span>\n <span\n class=\"tree-view__node-text\"\n data-scope=\"tree-view\"\n data-part=\"branch-text\"\n [attr.data-state]=\"expandedState(node.id)\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n >{{ node.label }}</span>\n </div>\n <div\n class=\"tree-view__branch-content\"\n data-scope=\"tree-view\"\n data-part=\"branch-content\"\n data-collapsible=\"\"\n role=\"group\"\n [id]=\"branchContentId(node.id)\"\n [attr.data-value]=\"node.id\"\n [attr.data-path]=\"indexPath.join('/')\"\n [attr.data-depth]=\"depth\"\n [attr.data-state]=\"isExpanded(node.id) ? null : 'closed'\"\n [attr.hidden]=\"isExpanded(node.id) ? null : ''\"\n >\n @if (showIndentGuides()) {\n <div\n class=\"tree-view__indent-guide\"\n data-scope=\"tree-view\"\n data-part=\"branch-indent-guide\"\n [attr.data-depth]=\"depth\"\n ></div>\n }\n <ng-container\n [ngTemplateOutlet]=\"nodes\"\n [ngTemplateOutletContext]=\"{ $implicit: node.children, path: indexPath }\"\n />\n </div>\n </div>\n } @else {\n <div\n class=\"tree-view__item\"\n data-scope=\"tree-view\"\n data-part=\"item\"\n role=\"treeitem\"\n [id]=\"nodeId(node.id)\"\n [attr.data-ownedby]=\"partId('tree')\"\n [attr.data-path]=\"indexPath.join('/')\"\n [attr.data-value]=\"node.id\"\n [attr.data-depth]=\"depth\"\n [attr.aria-level]=\"depth\"\n [attr.tabindex]=\"isFocused(node.id) ? 0 : -1\"\n [attr.data-focus]=\"flag(isFocused(node.id))\"\n [attr.aria-current]=\"isSelected(node.id) ? 'true' : null\"\n [attr.aria-selected]=\"node.disabled ? null : isSelected(node.id)\"\n [attr.data-selected]=\"flag(isSelected(node.id))\"\n [attr.aria-disabled]=\"node.disabled ? 'true' : null\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n [attr.style]=\"depthStyle(depth)\"\n (click)=\"onItemClick(node)\"\n (focus)=\"focusNode(node.id)\"\n >\n @if (node.icon; as name) {\n <span uioIcon class=\"tree-view__node-icon\" [name]=\"name\" [size]=\"iconSize()\"></span>\n }\n <span\n class=\"tree-view__node-text\"\n data-scope=\"tree-view\"\n data-part=\"item-text\"\n [attr.data-selected]=\"flag(isSelected(node.id))\"\n [attr.data-focus]=\"flag(isFocused(node.id))\"\n [attr.data-disabled]=\"flag(node.disabled)\"\n >{{ node.label }}</span>\n </div>\n }\n }\n </ng-template>\n `,\n host: { \"[class]\": \"hostClass()\", \"[id]\": \"partId('root')\" },\n})\nexport class UioTreeView extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"tree-view\";\n readonly part = \"root\";\n\n /** The tree to render, in display order. */\n readonly items = input<readonly TreeViewNode[]>([]);\n /** Accessible label rendered above the tree. */\n readonly label = input<string | undefined>(undefined);\n /** Uncontrolled until something binds it — see `UioSwitch` on the same fork. */\n readonly selectedValue = model<string[]>([]);\n /** Which branches are open, by node id. */\n readonly expandedValue = model<string[]>([]);\n readonly selectionMode = input<TreeViewSelectionMode>(\"single\");\n readonly size = input<TreeViewSize>(\"md\");\n readonly variant = input<TreeViewVariant>(\"default\");\n /** The vertical rules connecting a branch to its children. */\n readonly showIndentGuides = input(true, { transform: booleanAttribute });\n\n readonly selectionChange = output<string[]>();\n readonly expandedChange = output<string[]>();\n\n /**\n * Ark spells this machine's ids `tree:<machine>:…` — the *machine* name, not\n * the scope, which is `tree-view`. Reproduced, because a consumer reading two\n * DOM trees side by side should find the same shape in both.\n */\n private readonly machine = nextMachineId();\n /**\n * Each branch is a Collapsible in Ark, with an id from that machine's own\n * counter. Cached per node so a branch keeps its id across re-renders — an id\n * that changed when the list re-rendered would break every reference to it.\n */\n private readonly branchIds = new Map<string, string>();\n\n private readonly appRef = inject(ApplicationRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** `null` until something has been focused, when it means \"the first node\". */\n private readonly focusedValue = signal<string | null>(null);\n\n protected readonly flag = stateFlag;\n protected readonly INDICATOR_SIZE = INDICATOR_SIZE;\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n protected readonly hostClass = computed(() =>\n treeViewStyles({ size: this.size(), variant: this.variant() }),\n );\n\n /**\n * Every node in reading order, with whether its ancestors are all expanded.\n *\n * Arrow keys move between *visible* rows, so the walk has to know about\n * collapsed ancestors — moving to a node inside a closed branch would focus\n * an element the browser cannot focus, and focus would silently fall to the\n * body.\n */\n private readonly flat = computed<FlatNode[]>(() => {\n const out: FlatNode[] = [];\n const walk = (nodes: readonly TreeViewNode[], path: number[], visible: boolean) => {\n nodes.forEach((node, index) => {\n const indexPath = [...path, index];\n const isBranch = !!node.children?.length;\n out.push({ node, indexPath, depth: indexPath.length, isBranch, visible });\n if (isBranch) {\n walk(node.children!, indexPath, visible && this.isExpanded(node.id));\n }\n });\n };\n walk(this.items(), [], true);\n return out;\n });\n\n /** The rows a keyboard can reach, which excludes disabled ones. */\n private readonly navigable = computed(() =>\n this.flat().filter((entry) => entry.visible && !entry.node.disabled),\n );\n\n /** Zag's default: the first node that is not disabled, before anything is clicked. */\n private readonly focused = computed(\n () => this.focusedValue() ?? this.navigable()[0]?.node.id ?? null,\n );\n\n protected partId(part: string): string {\n return `tree:${this.machine}:${part}`;\n }\n protected nodeId(value: string): string {\n return `tree:${this.machine}:node:${value}`;\n }\n protected branchId(value: string): string {\n let id = this.branchIds.get(value);\n if (!id) {\n id = `collapsible:${nextMachineId()}`;\n this.branchIds.set(value, id);\n }\n return id;\n }\n protected branchContentId(value: string): string {\n return `${this.branchId(value)}:content`;\n }\n\n /**\n * The indentation, written as the whole `style` attribute rather than through\n * `[style.--depth]`.\n *\n * A custom property does not reach the element through a style binding in a\n * JIT-compiled spec the way it does in the built package, and\n * `.tree-view__item` computes its `padding-inline-start` from `--depth`. Same\n * reason `UioProgress` writes `--percent` this way; nothing else on these rows\n * is styled inline.\n */\n protected depthStyle(depth: number): string {\n return `--depth: ${depth}`;\n }\n\n isExpanded(value: string): boolean {\n return this.expandedValue().includes(value);\n }\n isSelected(value: string): boolean {\n return this.selectedValue().includes(value);\n }\n protected isFocused(value: string): boolean {\n return this.focused() === value;\n }\n /** The branch reports both words; only its *content* drops one. */\n protected expandedState(value: string): \"open\" | \"closed\" {\n return this.isExpanded(value) ? \"open\" : \"closed\";\n }\n\n /**\n * Moves the roving tabindex. Called from the row's own `focus` handler.\n *\n * Not named `focus`: `UioPart` already declares one, and it is the *signal*\n * behind `data-focus` on the host rather than an action.\n */\n protected focusNode(value: string): void {\n this.focusedValue.set(value);\n }\n\n toggleExpanded(value: string): void {\n const next = this.isExpanded(value)\n ? this.expandedValue().filter((id) => id !== value)\n : [...this.expandedValue(), value];\n this.expandedValue.set(next);\n this.expandedChange.emit(next);\n flushNow(this.appRef);\n }\n\n select(value: string): void {\n const current = this.selectedValue();\n const next =\n this.selectionMode() === \"multiple\"\n ? current.includes(value)\n ? current.filter((id) => id !== value)\n : [...current, value]\n : [value];\n this.selectedValue.set(next);\n this.selectionChange.emit(next);\n flushNow(this.appRef);\n }\n\n /** A branch row both selects and toggles, which is what Ark's control does. */\n protected onBranchClick(node: TreeViewNode): void {\n if (node.disabled) return;\n this.focusedValue.set(node.id);\n this.select(node.id);\n this.toggleExpanded(node.id);\n }\n\n protected onItemClick(node: TreeViewNode): void {\n if (node.disabled) return;\n this.focusedValue.set(node.id);\n this.select(node.id);\n }\n\n /**\n * The APG tree keyboard, on the tree rather than on each row.\n *\n * One listener instead of one per node, which is what zag does and which also\n * means a row added while a key is held is navigable immediately. Arrow\n * left/right are the disclosure keys: right opens a closed branch and steps\n * into an open one, left closes an open branch and steps out of anything else.\n */\n protected onKeydown(event: KeyboardEvent): void {\n const rows = this.navigable();\n if (!rows.length) return;\n const value = this.focused();\n const index = rows.findIndex((row) => row.node.id === value);\n const current = rows[index];\n\n const moveTo = (next: FlatNode | undefined) => {\n if (!next) return;\n event.preventDefault();\n this.focusedValue.set(next.node.id);\n flushNow(this.appRef);\n // The element, not just the state: the roving tabindex is half of it, and\n // a row that reports `data-focus` without holding focus leaves the next\n // Tab starting from the top of the page.\n //\n // Found by walking the rows rather than by id selector, because a node id\n // is the caller's string and may hold anything a CSS selector would have\n // to be escaped for.\n const rows = this.host.nativeElement.querySelectorAll<HTMLElement>(\n '[data-part=\"branch-control\"], [data-part=\"item\"]',\n );\n for (const row of Array.from(rows)) {\n if (row.dataset[\"value\"] === next.node.id) {\n row.focus();\n return;\n }\n }\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return moveTo(rows[index + 1]);\n case \"ArrowUp\":\n return moveTo(rows[index - 1]);\n case \"Home\":\n return moveTo(rows[0]);\n case \"End\":\n return moveTo(rows[rows.length - 1]);\n case \"ArrowRight\": {\n if (!current?.isBranch) return;\n event.preventDefault();\n if (!this.isExpanded(current.node.id)) this.toggleExpanded(current.node.id);\n else moveTo(this.navigable()[index + 1]);\n return;\n }\n case \"ArrowLeft\": {\n if (!current) return;\n event.preventDefault();\n if (current.isBranch && this.isExpanded(current.node.id)) {\n this.toggleExpanded(current.node.id);\n return;\n }\n // Out to the parent, found by index path rather than by a back-pointer\n // — the flat walk already knows where every row sits.\n const parentPath = current.indexPath.slice(0, -1).join(\"/\");\n if (!parentPath) return;\n moveTo(rows.find((row) => row.indexPath.join(\"/\") === parentPath));\n return;\n }\n case \"Enter\":\n case \" \": {\n if (!current) return;\n event.preventDefault();\n this.select(current.node.id);\n if (current.isBranch) this.toggleExpanded(current.node.id);\n return;\n }\n default:\n return;\n }\n }\n}\n","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { pinInputStyles, type ControlSize, type PinInputVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type PinInputSize = ControlSize;\nexport type PinInputVariant = NonNullable<PinInputVariants[\"variant\"]>;\n/** Which characters a cell accepts. Drives both the filter and `inputmode`. */\nexport type PinInputType = \"numeric\" | \"alphanumeric\" | \"alphabetic\";\n\nconst DEFAULT_LENGTH = 4;\n\n/** Zag's default, and the character an empty cell shows. */\nconst DEFAULT_PLACEHOLDER = \"○\";\n\n/** What each `type` will accept, one character at a time or pasted whole. */\nconst ALLOWED: Record<PinInputType, RegExp> = {\n numeric: /^[0-9]+$/,\n alphabetic: /^[A-Za-z]+$/,\n alphanumeric: /^[a-zA-Z0-9]+$/,\n};\n\n/**\n * Split the public string into one character per cell.\n *\n * The machine models the value as an array and the public API is the whole code\n * as a single string — the same boundary coercion `UioSelect` does for\n * `string ↔ string[]`, and for the same reason: the array is an implementation\n * detail of the cells, not something a caller should have to assemble. A short\n * string leaves the remaining cells empty rather than shrinking the control, and\n * a long one is truncated.\n */\nexport function toCells(code: string, length: number): string[] {\n return Array.from({ length }, (_, index) => code[index] ?? \"\");\n}\n\n/**\n * A one-character-per-cell code entry.\n *\n * ```html\n * <div uioPinInput label=\"Code\" [length]=\"6\" formControlName=\"otp\"></div>\n * ```\n *\n * ── What the cells are, and what they are not ───────────────────────────────\n *\n * Six inputs, one value. Every cell carries `data-ownedby` naming the root, and\n * exactly one of them is in the tab order at a time — the first empty one, or\n * the last if the code is complete. That is the whole of the roving tab index:\n * a user Tabs into the control once and types, and Tab again leaves it, rather\n * than stepping through six separate stops.\n *\n * The value is **not** stored per cell. The cells are derived from one string,\n * so a caller never assembles or splits anything, and the hidden input a form\n * submits carries the same string.\n *\n * ── Backspace shifts, it does not blank ─────────────────────────────────────\n *\n * Clearing a cell splices it out and pushes an empty one onto the end, so\n * backspacing the middle of `1234` gives `134` and not `1_34`. That is Zag's\n * behaviour in the other three libraries and it is what makes correcting a\n * mistyped code feel like editing one field rather than six.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it,\n * including `control.disable()` reaching every cell's `data-disabled`. As with\n * `UioSwitch` there is no `defaultValue`: a `model()` is uncontrolled until\n * something binds it, so `[value]` is both the initial value and the bound one.\n */\n@Component({\n selector: \"div[uioPinInput]\",\n standalone: true,\n exportAs: \"uioPinInput\",\n imports: [UioFieldError],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioPinInput), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <!--\n The label names the *hidden* input rather than any one cell: a for\n attribute has to point at a single element and no cell is more the\n control than another, so Ark points it at the one a form submits.\n Clicking it focuses the first cell instead, which is what a pointer\n expects.\n -->\n <label\n class=\"field__label\"\n data-scope=\"pin-input\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('hidden')\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-complete]=\"flag(complete())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n (click)=\"focusFirst($event)\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <div\n class=\"pin-input__control\"\n data-scope=\"pin-input\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n >\n @for (index of indexes(); track index) {\n <input\n class=\"pin-input__cell\"\n data-scope=\"pin-input\"\n data-part=\"input\"\n autocapitalize=\"none\"\n [id]=\"partId(index)\"\n [attr.data-index]=\"index\"\n [attr.data-ownedby]=\"rootId\"\n [attr.aria-label]=\"'pin code ' + (index + 1) + ' of ' + length()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.enterkeyhint]=\"index === length() - 1 ? 'done' : 'next'\"\n [attr.autocomplete]=\"otp() ? 'one-time-code' : 'off'\"\n [attr.placeholder]=\"focusedIndex() === index ? '' : placeholder()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-complete]=\"flag(complete())\"\n [attr.data-filled]=\"flag(cells()[index] !== '')\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [type]=\"cellType()\"\n [tabIndex]=\"index === tabbableIndex() ? 0 : -1\"\n [disabled]=\"isDisabled()\"\n [value]=\"cells()[index]\"\n (input)=\"onInput($event, index)\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus(index)\"\n (blur)=\"onBlur($event)\"\n />\n }\n </div>\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <!--\n The one element a form sees. Hidden from assistive tech, because the cells\n above are the accessible interface and a screen reader announcing the code\n twice is worse than not announcing it at all.\n -->\n <input\n aria-hidden=\"true\"\n type=\"text\"\n tabindex=\"-1\"\n [id]=\"partId('hidden')\"\n [attr.style]=\"HIDDEN\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [attr.maxlength]=\"length()\"\n [disabled]=\"isDisabled()\"\n [value]=\"value() ?? ''\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n /**\n * Not on `UioPart`. That base declares the vocabulary the *stylesheet*\n * reads and its spec fails an attribute no CSS selects on; `data-complete`\n * is one, and Ark emits it on the root, the label and every cell.\n */\n \"[attr.data-complete]\": \"flag(complete())\",\n },\n})\nexport class UioPinInput extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n readonly scope = \"pin-input\";\n readonly part = \"root\";\n\n /** The whole code as one string. Characters past `length` are dropped. */\n readonly value = model<string>(\"\");\n readonly valueChange = output<string>();\n /** Fires once every cell is filled — the moment a code is worth submitting. */\n readonly valueComplete = output<string>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly length = input(DEFAULT_LENGTH);\n readonly size = input<PinInputSize>(\"md\");\n readonly variant = input<PinInputVariant>(\"default\");\n readonly type = input<PinInputType>(\"numeric\");\n /** Renders entered characters as dots, like a password field. */\n readonly mask = input(false, { transform: booleanAttribute });\n /** Marks the cells as a one-time code so a browser offers to autofill it. */\n readonly otp = input(false, { transform: booleanAttribute });\n readonly placeholder = input(DEFAULT_PLACEHOLDER);\n /** Blurs the focused cell once the code is complete. */\n readonly blurOnComplete = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n override readonly readOnly = input(false, { transform: booleanAttribute });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly hostClass = computed(() =>\n pinInputStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly indexes = computed(() =>\n Array.from({ length: this.length() }, (_, index) => index),\n );\n protected readonly cells = computed(() => toCells(this.value() ?? \"\", this.length()));\n protected readonly complete = computed(() => this.cells().every((cell) => cell !== \"\"));\n private readonly filledLength = computed(\n () => this.cells().filter((cell) => cell.trim() !== \"\").length,\n );\n\n /**\n * -1 when nothing in the control has focus, which is also what decides where\n * the single tab stop sits — see `tabbableIndex`.\n */\n protected readonly focusedIndex = signal(-1);\n\n /**\n * The one cell in the tab order: whichever has focus, or the first empty one,\n * or the last when the code is complete.\n *\n * Six tab stops would make a six-digit code cost seven Tab presses to skip.\n */\n protected readonly tabbableIndex = computed(() => {\n const focused = this.focusedIndex();\n if (focused !== -1) return focused;\n return Math.min(this.filledLength(), this.length() - 1);\n });\n\n protected readonly cellType = computed(() => {\n if (this.mask()) return \"password\";\n return this.type() === \"numeric\" ? \"tel\" : \"text\";\n });\n /** `otp` implies digits whatever `type` says, because an SMS code is digits. */\n protected readonly inputMode = computed(() =>\n this.otp() || this.type() === \"numeric\" ? \"numeric\" : \"text\",\n );\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string | number): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n\n // ── Typing ────────────────────────────────────────────────────────────────\n\n private inputAt(index: number): HTMLInputElement | null {\n return this.host.nativeElement\n .querySelectorAll<HTMLInputElement>('input[data-part=\"input\"]')\n .item(index);\n }\n\n private focusAt(index: number): void {\n // A microtask, not synchronously: the cell being focused may only exist\n // after the `[value]` bindings above have been flushed.\n queueMicrotask(() => this.inputAt(index)?.focus({ preventScroll: true }));\n }\n\n protected focusFirst(event: Event): void {\n event.preventDefault();\n if (this.isDisabled()) return;\n this.focusAt(0);\n }\n\n private accepts(text: string): boolean {\n return ALLOWED[this.type()].test(text);\n }\n\n /**\n * A cell holds one character, so a keystroke into a full cell replaces it.\n *\n * Zag's `getNextValue`: the browser hands over the whole field text, which may\n * be the old character plus the new one in either order depending on where the\n * caret was. Taking the last character of whichever half is new is what makes\n * retyping over a filled cell feel like overwriting it.\n */\n protected onInput(event: Event, index: number): void {\n const element = event.target as HTMLInputElement;\n const typed = element.value;\n const current = this.cells()[index] ?? \"\";\n\n let next = typed;\n if (current[0] === typed[0]) next = typed[1] ?? \"\";\n else if (current[0] === typed[1]) next = typed[0] ?? \"\";\n next = next.slice(-1);\n\n // A rejected character must not survive on the element: the `[value]`\n // binding would not fire again for an unchanged model value.\n if (next !== \"\" && !this.accepts(next)) {\n element.value = current;\n return;\n }\n\n this.setCell(index, next);\n element.value = next;\n if (next !== \"\") this.moveTo(Math.min(index + 1, this.length() - 1));\n }\n\n /**\n * Pasting fills forward from the caret, not just the cell under it.\n *\n * The whole point of a pin input is that a code copied from an email lands in\n * one gesture, so this is the interaction most worth getting right and the one\n * a DOM comparison cannot see at all.\n */\n protected onPaste(event: ClipboardEvent): void {\n const pasted = event.clipboardData?.getData(\"text/plain\");\n if (!pasted) return;\n event.preventDefault();\n if (!this.accepts(pasted)) return;\n\n const length = this.length();\n const focused = this.focusedIndex();\n const start = Math.min(focused === -1 ? 0 : focused, this.filledLength());\n const left = start > 0 ? (this.value() ?? \"\").substring(0, focused) : \"\";\n const right = pasted.substring(0, length - start);\n this.commit(toCells(`${left}${right}`, length));\n this.moveTo(Math.min(this.filledLength(), length - 1));\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.metaKey || event.ctrlKey || event.altKey) return;\n const index = this.focusedIndex();\n if (index === -1) return;\n\n switch (event.key) {\n case \"Backspace\": {\n event.preventDefault();\n if (this.readOnly()) return;\n // With a value: clear this cell and step back. Without one: step back\n // *first*, then clear — so backspacing an empty cell eats the one\n // before it rather than doing nothing.\n if (this.cells()[index] !== \"\") {\n this.clearAt(index);\n this.moveTo(Math.max(index - 1, 0));\n } else {\n const previous = Math.max(index - 1, 0);\n this.moveTo(previous);\n this.clearAt(previous);\n }\n return;\n }\n case \"Delete\":\n event.preventDefault();\n if (this.readOnly()) return;\n this.clearAt(index);\n return;\n case \"ArrowLeft\":\n event.preventDefault();\n this.moveTo(Math.max(index - 1, 0));\n return;\n case \"ArrowRight\":\n event.preventDefault();\n this.moveTo(Math.min(index + 1, Math.min(this.filledLength(), this.length() - 1)));\n return;\n case \"Home\":\n event.preventDefault();\n this.moveTo(0);\n return;\n case \"End\":\n event.preventDefault();\n this.moveTo(Math.max(this.filledLength() - 1, 0));\n return;\n default:\n return;\n }\n }\n\n protected onFocus(index: number): void {\n // Focusing the fifth cell of an empty code lands on the first: the machine\n // never lets the caret get ahead of the value.\n const max = Math.min(this.filledLength(), this.length() - 1);\n const next = Math.min(index, max);\n this.focusedIndex.set(next);\n if (next !== index) this.focusAt(next);\n }\n\n /**\n * Focus moving between two cells of the same control is not a blur.\n *\n * `data-ownedby` is what says so, which is the reason every cell carries it.\n */\n protected onBlur(event: FocusEvent): void {\n const next = event.relatedTarget as HTMLElement | null;\n if (next?.dataset?.[\"ownedby\"] === this.rootId) return;\n this.focusedIndex.set(-1);\n this.onTouched();\n }\n\n private moveTo(index: number): void {\n this.focusedIndex.set(index);\n this.focusAt(index);\n }\n\n private setCell(index: number, character: string): void {\n const next = [...this.cells()];\n next[index] = character;\n this.commit(next);\n }\n\n /**\n * Clearing splices rather than blanks, so the code closes up behind the caret.\n *\n * Zag's `clearFocusedValue`. Blanking in place would leave a hole a user has\n * to navigate back into.\n */\n private clearAt(index: number): void {\n const next = [...this.cells()];\n next.splice(index, 1);\n next.push(\"\");\n this.commit(next);\n }\n\n private commit(cells: string[]): void {\n const next = cells.join(\"\");\n if (next === (this.value() ?? \"\")) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n if (cells.every((cell) => cell !== \"\")) {\n this.valueComplete.emit(next);\n if (this.blurOnComplete()) {\n queueMicrotask(() => this.inputAt(this.focusedIndex())?.blur());\n }\n }\n }\n\n // ── Forms ─────────────────────────────────────────────────────────────────\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { tagsInputStyles, type ControlSize } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type TagsInputSize = ControlSize;\n\n/** Delete affordance inside a tag — always the small edge, at every control\n * size, because it sits inside the chip rather than beside it. */\nconst DELETE_ICON_SIZE = 12;\n\n/**\n * A text box that turns what you type into removable chips.\n *\n * ```html\n * <div uioTagsInput label=\"Tags\" formControlName=\"tags\"></div>\n * ```\n *\n * ── The chips are state, not children ───────────────────────────────────────\n *\n * Every tag is rendered from the component's own value, and each one mounts\n * *two* elements: the chip a user sees and a hidden input that replaces it\n * during an in-place edit. `hidden` is what picks between them, so editing a tag\n * never remounts the row and never loses the caret. A port that mapped over the\n * `value` input and rendered chips alone would look right and have no way to\n * edit one.\n *\n * ── Backspace is two presses, not one ───────────────────────────────────────\n *\n * With the caret at the start of an empty entry field, Backspace *highlights*\n * the last tag; a second Backspace removes it. One-press deletion is how tag\n * inputs lose data — the user is one key away from destroying a chip they cannot\n * see the caret near — and the highlight is what makes it recoverable.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive the\n * list, including `control.disable()` reaching every chip's `data-disabled`.\n */\n@Component({\n selector: \"div[uioTagsInput]\",\n standalone: true,\n exportAs: \"uioTagsInput\",\n imports: [UioIcon, UioFieldError],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioTagsInput), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"tags-input\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-required]=\"flag(required())\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <!--\n tabindex on a read-only control, and only then: the entry field is\n disabled in that state, so without a tab stop here the chips would be\n unreachable by keyboard entirely.\n -->\n <div\n class=\"tags-input__control\"\n data-scope=\"tags-input\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n [attr.tabindex]=\"readOnly() ? 0 : null\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-focus]=\"flag(focused())\"\n (pointerdown)=\"onControlPointerDown($event)\"\n >\n @for (tag of tags(); track $index) {\n <div\n data-scope=\"tags-input\"\n data-part=\"item\"\n [attr.data-value]=\"tag\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >\n <div\n class=\"tags-input__tag\"\n data-scope=\"tags-input\"\n data-part=\"item-preview\"\n [id]=\"itemId(tag, $index)\"\n [attr.hidden]=\"editingIndex() === $index ? '' : null\"\n [attr.data-value]=\"tag\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-highlighted]=\"flag(highlightedIndex() === $index)\"\n (dblclick)=\"startEdit($index)\"\n >\n <span\n class=\"tags-input__tag-label\"\n data-scope=\"tags-input\"\n data-part=\"item-text\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-highlighted]=\"flag(highlightedIndex() === $index)\"\n >{{ tag }}</span\n >\n <button\n class=\"tags-input__tag-delete\"\n data-scope=\"tags-input\"\n data-part=\"item-delete-trigger\"\n type=\"button\"\n tabindex=\"-1\"\n [id]=\"itemId(tag, $index) + ':delete-btn'\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : 'false'\"\n [attr.data-highlighted]=\"flag(highlightedIndex() === $index)\"\n [attr.aria-label]=\"'Delete tag ' + tag\"\n [disabled]=\"isDisabled()\"\n (click)=\"removeAt($index)\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"DELETE_ICON_SIZE\"></span>\n </button>\n </div>\n <!--\n Mounted next to the chip rather than instead of it, so an edit\n swaps two hidden attributes and remounts nothing.\n -->\n <input\n class=\"tags-input__tag-input\"\n data-scope=\"tags-input\"\n data-part=\"item-input\"\n tabindex=\"-1\"\n [id]=\"itemId(tag, $index) + ':input'\"\n [attr.aria-label]=\"\n 'Editing tag ' + tag + '. Press enter to save or escape to cancel.'\n \"\n [attr.hidden]=\"editingIndex() === $index ? null : ''\"\n [disabled]=\"isDisabled()\"\n [value]=\"editingIndex() === $index ? editingValue() : ''\"\n (input)=\"editingValue.set($any($event.target).value)\"\n (keydown)=\"onEditKeydown($event)\"\n (blur)=\"cancelEdit()\"\n />\n </div>\n }\n <input\n class=\"tags-input__entry\"\n data-scope=\"tags-input\"\n data-part=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"none\"\n enterkeyhint=\"done\"\n [id]=\"partId('input')\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-empty]=\"flag(empty())\"\n [attr.placeholder]=\"empty() ? placeholder() : null\"\n [disabled]=\"isDisabled() || readOnly()\"\n [value]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (paste)=\"onPaste($event)\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onEntryFocus()\"\n (blur)=\"onEntryBlur($event)\"\n />\n </div>\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <!--\n One field, comma-joined, because that is the shape a form submits and the\n shape Ark's hidden input carries in the other three libraries.\n -->\n <input\n type=\"text\"\n hidden\n [id]=\"partId('hidden-input')\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [disabled]=\"isDisabled()\"\n [value]=\"valueAsString()\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n /**\n * Not on `UioPart`, which declares only the vocabulary the stylesheet reads.\n * Ark emits `data-empty` on the root and the entry field, and the rendered\n * contract is what this package reproduces.\n */\n \"[attr.data-empty]\": \"flag(empty())\",\n },\n})\nexport class UioTagsInput extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly scope = \"tags-input\";\n readonly part = \"root\";\n\n readonly value = model<string[]>([]);\n readonly valueChange = output<string[]>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly size = input<TagsInputSize>(\"md\");\n /** Further entries are rejected once reached. Unbounded by default. */\n readonly max = input(Number.POSITIVE_INFINITY);\n /** Allows a double-click to edit an existing tag in place. */\n readonly editable = input(true, { transform: booleanAttribute });\n /** Splits typed or pasted text into several tags. */\n readonly delimiter = input(\",\");\n /** Creates tags from pasted text. */\n readonly addOnPaste = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n override readonly readOnly = input(false, { transform: booleanAttribute });\n\n /** `disabled` comes from the caller *or* from a reactive form's disabled state. */\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n\n /**\n * Overflowing counts as invalid even without an `error`.\n *\n * Zag folds the two together, so a list pushed past `max` from outside reports\n * the same state as one the caller marked bad — which is what the stylesheet\n * reads.\n */\n override readonly invalid: Signal<boolean> = computed(\n () => !!this.error() || this.tags().length > this.max(),\n );\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly hostClass = computed(() => tagsInputStyles({ size: this.size() }));\n protected readonly tags = computed(() => this.value() ?? []);\n protected readonly empty = computed(() => this.tags().length === 0);\n protected readonly valueAsString = computed(() => this.tags().join(\", \"));\n\n protected readonly inputValue = signal(\"\");\n protected readonly focused = signal(false);\n /** Which chip Backspace/Delete would act on. `null` when the caret owns the field. */\n protected readonly highlightedIndex = signal<number | null>(null);\n protected readonly editingIndex = signal<number | null>(null);\n protected readonly editingValue = signal(\"\");\n\n override readonly focus: Signal<boolean> = this.focused;\n protected readonly DELETE_ICON_SIZE = DELETE_ICON_SIZE;\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n /** Ark's shape: the root id, then the tag's own value and index. */\n protected itemId(value: string, index: number): string {\n return `${this.rootId}:tag:${value}:${index}`;\n }\n\n protected readonly flag = stateFlag;\n\n private get interactive(): boolean {\n return !this.isDisabled() && !this.readOnly();\n }\n\n // ── The entry field ───────────────────────────────────────────────────────\n\n protected onInput(event: Event): void {\n const text = (event.target as HTMLInputElement).value;\n const delimiter = this.delimiter();\n // A typed delimiter ends a tag rather than becoming part of one.\n if (delimiter && text.endsWith(delimiter)) {\n this.inputValue.set(text.slice(0, -delimiter.length));\n this.addFromInput();\n return;\n }\n this.inputValue.set(text);\n this.highlightedIndex.set(null);\n }\n\n protected onPaste(event: ClipboardEvent): void {\n if (!this.addOnPaste() || !this.interactive) return;\n const pasted = event.clipboardData?.getData(\"text/plain\");\n if (!pasted) return;\n event.preventDefault();\n const delimiter = this.delimiter();\n const parts = (delimiter ? pasted.split(delimiter) : [pasted])\n .map((part) => part.trim())\n .filter(Boolean);\n this.addMany(parts);\n this.inputValue.set(\"\");\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive) return;\n const element = event.target as HTMLInputElement;\n const atStart = element.selectionStart === 0 && element.selectionEnd === 0;\n\n if (event.key === \"Enter\") {\n event.preventDefault();\n // Enter means two different things depending on where the caret is: with\n // a chip highlighted it opens that chip for editing, which is the only\n // keyboard route into an in-place edit.\n const highlighted = this.highlightedIndex();\n if (highlighted != null && this.editable()) this.startEdit(highlighted);\n else this.addFromInput();\n return;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n this.highlightedIndex.set(null);\n return;\n }\n if (event.key === \"Backspace\") {\n if (!atStart || this.empty()) return;\n event.preventDefault();\n // First press highlights, second removes — see the class note.\n const highlighted = this.highlightedIndex();\n if (highlighted == null) this.highlightedIndex.set(this.tags().length - 1);\n else this.removeAt(highlighted);\n return;\n }\n if (event.key === \"Delete\") {\n const highlighted = this.highlightedIndex();\n if (highlighted == null) return;\n event.preventDefault();\n this.removeAt(highlighted);\n return;\n }\n if (event.key === \"ArrowLeft\" && atStart && !this.empty()) {\n event.preventDefault();\n const highlighted = this.highlightedIndex();\n this.highlightedIndex.set(\n highlighted == null ? this.tags().length - 1 : Math.max(highlighted - 1, 0),\n );\n return;\n }\n if (event.key === \"ArrowRight\") {\n const highlighted = this.highlightedIndex();\n if (highlighted == null) return;\n event.preventDefault();\n const next = highlighted + 1;\n this.highlightedIndex.set(next > this.tags().length - 1 ? null : next);\n return;\n }\n if (event.key.length === 1) this.highlightedIndex.set(null);\n }\n\n protected onEntryFocus(): void {\n this.focused.set(true);\n }\n\n /**\n * Focus moving from the entry field into a chip's own input is not a blur.\n *\n * Opening an edit does exactly that, and clearing the highlight there would\n * unstyle the chip being edited — the one the user is looking at. Same rule,\n * for the same reason, as the `data-ownedby` check in `UioPinInput`.\n */\n protected onEntryBlur(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.host.nativeElement.contains(next)) return;\n this.focused.set(false);\n this.highlightedIndex.set(null);\n this.onTouched();\n }\n\n /** Clicking the well anywhere but on a chip puts the caret in the entry field. */\n protected onControlPointerDown(event: PointerEvent): void {\n if (!this.interactive) return;\n const target = event.target as HTMLElement;\n if (target.closest('[data-part=\"item\"]')) return;\n if (target.matches('[data-part=\"input\"]')) return;\n event.preventDefault();\n this.entryEl()?.focus();\n }\n\n private entryEl(): HTMLInputElement | null {\n return this.host.nativeElement.querySelector<HTMLInputElement>('[data-part=\"input\"]');\n }\n\n // ── Adding and removing ───────────────────────────────────────────────────\n\n private addFromInput(): void {\n const entry = this.inputValue().trim();\n if (!entry) return;\n this.addMany([entry]);\n this.inputValue.set(\"\");\n }\n\n private addMany(entries: string[]): void {\n if (!this.interactive) return;\n const next = [...this.tags()];\n for (const entry of entries) {\n // `max` is a hard stop, and duplicates are dropped rather than appended —\n // both are Zag's defaults, and both are silent by design: a rejected tag\n // that cleared the field would look like the control had eaten it.\n if (next.length >= this.max()) break;\n if (next.includes(entry)) continue;\n next.push(entry);\n }\n this.commit(next);\n }\n\n protected removeAt(index: number): void {\n if (!this.interactive) return;\n const next = [...this.tags()];\n next.splice(index, 1);\n this.highlightedIndex.set(null);\n this.commit(next);\n this.entryEl()?.focus();\n }\n\n // ── Editing in place ──────────────────────────────────────────────────────\n\n protected startEdit(index: number): void {\n if (!this.interactive || !this.editable()) return;\n this.editingValue.set(this.tags()[index] ?? \"\");\n this.editingIndex.set(index);\n // An animation frame, not a microtask: the chip's input is still `hidden`\n // until change detection has run, and a hidden input cannot take focus.\n requestAnimationFrame(() => {\n const input = this.host.nativeElement.querySelectorAll<HTMLInputElement>(\n '[data-part=\"item-input\"]',\n )[index];\n input?.select();\n });\n }\n\n protected onEditKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this.commitEdit();\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n this.cancelEdit();\n }\n }\n\n private commitEdit(): void {\n const index = this.editingIndex();\n if (index == null) return;\n const edited = this.editingValue().trim();\n const next = [...this.tags()];\n // An emptied tag is a deletion, which is the only way to remove one without\n // reaching for the mouse once an edit has started.\n if (!edited) next.splice(index, 1);\n else if (!next.some((tag, at) => at !== index && tag === edited)) next[index] = edited;\n this.editingIndex.set(null);\n this.editingValue.set(\"\");\n this.commit(next);\n this.entryEl()?.focus();\n }\n\n protected cancelEdit(): void {\n if (this.editingIndex() == null) return;\n this.editingIndex.set(null);\n this.editingValue.set(\"\");\n }\n\n private commit(next: string[]): void {\n const current = this.tags();\n if (next.length === current.length && next.every((tag, i) => tag === current[i])) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n // ── Forms ─────────────────────────────────────────────────────────────────\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string[]) => void = () => {};\n\n writeValue(value: string[] | null): void {\n this.value.set(value ?? []);\n }\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport {\n CONTROL_ICON_SIZE,\n ratingGroupStyles,\n type ControlSize,\n type RatingGroupVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type RatingGroupSize = ControlSize;\nexport type RatingGroupVariant = NonNullable<RatingGroupVariants[\"variant\"]>;\n\nconst DEFAULT_COUNT = 5;\n\n/** Zag's \"no rating yet\", which is not the same as zero and not the same as 1. */\nconst EMPTY = -1;\n\n/**\n * A row of stars that reads and writes one number.\n *\n * ```html\n * <div uioRatingGroup label=\"Rating\" [count]=\"5\" formControlName=\"score\"></div>\n * ```\n *\n * ── Why the items are radios ────────────────────────────────────────────────\n *\n * The control is a `radiogroup` and each star a `radio`, so a screen reader\n * announces \"3 stars, 3 of 5\" rather than a row of anonymous images, and the\n * arrow keys move the rating rather than the page. Exactly one star is in the\n * tab order — the checked one — which is the roving tab index every radio group\n * in the library uses.\n *\n * ── Two attributes that mean different things ───────────────────────────────\n *\n * `data-checked` marks the *one* star the value names. `data-highlighted` marks\n * every star up to it, and it is what the fill is styled off — so a rating of 3\n * has three highlighted stars and one checked. Hovering rewrites the highlight\n * without touching the value, which is how the preview works, and is why hover\n * is state here rather than a CSS `:hover` rule.\n *\n * ── Half stars ─────────────────────────────────────────────────────────────\n *\n * `data-half` lands on the checked star when the value has a fractional part,\n * and the clipped copy laid over it is what draws the half. Pointer position\n * inside the star decides which half a click means, so `allowHalf` changes what\n * a click *is* rather than only what can be displayed.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it.\n */\n@Component({\n selector: \"div[uioRatingGroup]\",\n standalone: true,\n exportAs: \"uioRatingGroup\",\n imports: [UioIcon, UioFieldError],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioRatingGroup), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <!--\n The for attribute names the hidden input, and clicking the label focuses\n the checked star instead — a label cannot point at a radio group, and\n pointing it at one arbitrary star would name the wrong value.\n -->\n <label\n class=\"field__label\"\n data-scope=\"rating-group\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-required]=\"flag(required())\"\n (click)=\"focusActive($event)\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <!--\n aria-labelledby names the label id whether or not a label is rendered,\n exactly as Ark does. Unlabelled, it is a reference to nothing rather than\n a wrong name, and every item still carries its own aria-label.\n -->\n <div\n class=\"rating-group__control\"\n data-scope=\"rating-group\"\n data-part=\"control\"\n role=\"radiogroup\"\n aria-orientation=\"horizontal\"\n [id]=\"partId('control')\"\n [attr.aria-labelledby]=\"partId('label')\"\n [attr.aria-readonly]=\"readOnlyInput() ? 'true' : null\"\n [attr.data-readonly]=\"flag(readOnlyInput())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n (pointerleave)=\"clearHover()\"\n >\n @for (index of items(); track index) {\n <span\n class=\"rating-group__item\"\n data-scope=\"rating-group\"\n data-part=\"item\"\n role=\"radio\"\n aria-roledescription=\"rating\"\n [id]=\"partId('item:' + index)\"\n [attr.aria-label]=\"index + ' stars'\"\n [attr.aria-disabled]=\"isDisabled()\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-readonly]=\"flag(readOnlyInput())\"\n [attr.aria-setsize]=\"count()\"\n [attr.aria-posinset]=\"index\"\n [attr.aria-checked]=\"isChecked(index)\"\n [attr.data-checked]=\"flag(isChecked(index))\"\n [attr.data-highlighted]=\"flag(isHighlighted(index))\"\n [attr.data-half]=\"flag(halfIndex() === index)\"\n [attr.tabindex]=\"tabIndexFor(index)\"\n (pointermove)=\"onItemPointerMove($event, index)\"\n (pointerdown)=\"onItemPointerDown($event)\"\n (click)=\"select(index)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <span uioIcon [name]=\"glyph('star')\" class=\"rating-group__star\" [size]=\"iconSize()\"></span>\n @if (allowHalf()) {\n <!--\n A clipped copy of the same star laid over the empty one. The width\n does the clipping, so the two stay pixel-aligned at every size.\n -->\n <span class=\"rating-group__half\" aria-hidden=\"true\">\n <span uioIcon [name]=\"glyph('star')\" class=\"rating-group__star\" [size]=\"iconSize()\"></span>\n </span>\n }\n </span>\n }\n </div>\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <input\n type=\"text\"\n hidden\n [id]=\"partId('input')\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnlyInput() ? '' : null\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioRatingGroup extends UioPart implements ControlValueAccessor {\n protected readonly glyph = glyph;\n readonly scope = \"rating-group\";\n readonly part = \"root\";\n\n /** `-1` is \"no rating\", which is not zero and not one. */\n readonly value = model<number>(EMPTY);\n readonly valueChange = output<number>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly count = input(DEFAULT_COUNT);\n readonly allowHalf = input(false, { transform: booleanAttribute });\n readonly size = input<RatingGroupSize>(\"md\");\n readonly variant = input<RatingGroupVariant>(\"default\");\n readonly required = input(false, { transform: booleanAttribute });\n /** Ark's default, so an unnamed rating still submits under a sensible key. */\n readonly name = input(\"rating\");\n\n /**\n * Neither of these overrides its `UioPart` field, deliberately.\n *\n * The base binds `data-disabled` and `data-readonly` on the host, and Ark's\n * rating root reports *neither*: the state lives on the control and on each\n * item instead. Overriding would put two attributes on the root that no other\n * library emits. Same split, for the same reason, as `readOnlyInput` on\n * `UioNumberField`.\n */\n protected readonly readOnlyInput = input(false, {\n alias: \"readOnly\",\n transform: booleanAttribute,\n });\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n private readonly isInvalid = computed(() => !!this.error());\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.isInvalid());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly hostClass = computed(() =>\n ratingGroupStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n protected readonly items = computed(() =>\n Array.from({ length: this.count() }, (_, index) => index + 1),\n );\n\n /** `-1` when the pointer is not over the row. Overrides the value while set. */\n private readonly hoveredValue = signal(EMPTY);\n private readonly hovering = computed(() => this.hoveredValue() > EMPTY);\n /** What the stars are drawn from: the hover preview if there is one. */\n private readonly shownValue = computed(() =>\n this.hovering() ? this.hoveredValue() : this.value(),\n );\n\n /**\n * The star the value names — and, with no value at all, the first, so the\n * group still has a tab stop.\n *\n * Both halves of Zag's test, not one or the other: an *empty* rating being\n * hovered reports two checked stars, the hovered one and the first. That\n * reads wrong and is what the other three libraries render, so reproducing it\n * is the point.\n */\n protected isChecked(index: number): boolean {\n return Math.ceil(this.shownValue()) === index || (this.value() <= 0 && index === 1);\n }\n /** Everything up to and including the checked star is filled. */\n protected isHighlighted(index: number): boolean {\n const shown = this.shownValue();\n return index <= shown || Math.ceil(shown) === index;\n }\n protected readonly halfIndex = computed(() => {\n const shown = this.shownValue();\n const equal = Math.ceil(shown);\n return Math.abs(shown - equal) === 0.5 ? equal : -1;\n });\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n /** Ark's ids are `rating:<machine>`, not `rating-group:` — the scope and the\n * id prefix differ for this one machine, and the ids are what a label names. */\n protected get rootId(): string {\n return `rating:${this.machine}`;\n }\n protected partId(part: string): string {\n return `rating:${this.machine}:${part}`;\n }\n\n private get interactive(): boolean {\n return !this.isDisabled() && !this.readOnlyInput();\n }\n\n /**\n * Read-only keeps one tab stop so the rating can still be read; disabled has\n * none at all.\n */\n protected tabIndexFor(index: number): number | null {\n if (this.isDisabled()) return null;\n const checked = this.isChecked(index);\n if (this.readOnlyInput()) return checked ? 0 : null;\n return checked ? 0 : -1;\n }\n\n // ── Pointer ───────────────────────────────────────────────────────────────\n\n /** Which half of the star the pointer is in decides half versus whole. */\n protected onItemPointerMove(event: PointerEvent, index: number): void {\n if (!this.interactive || event.pointerType === \"touch\") return;\n const box = (event.currentTarget as HTMLElement).getBoundingClientRect();\n const midway = box.width > 0 && (event.clientX - box.left) / box.width < 0.5;\n this.hoveredValue.set(this.allowHalf() && midway ? index - 0.5 : index);\n }\n\n protected clearHover(): void {\n this.hoveredValue.set(EMPTY);\n }\n\n /**\n * The press is cancelled so the star does not take focus from under the click;\n * focus is moved explicitly once the value has settled.\n */\n protected onItemPointerDown(event: PointerEvent): void {\n if (!this.interactive || event.button !== 0) return;\n event.preventDefault();\n }\n\n protected select(index: number): void {\n if (!this.interactive) return;\n // A click while hovering takes the *hovered* value, which is the half-star\n // the pointer is actually over rather than the whole star it belongs to.\n const hovered = this.hoveredValue();\n this.commit(hovered === EMPTY ? index : hovered);\n this.focusActiveRadio();\n }\n\n // ── Keyboard ──────────────────────────────────────────────────────────────\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive) return;\n const step = this.allowHalf() ? 0.5 : 1;\n const current = this.value();\n\n switch (event.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n event.preventDefault();\n this.commit(Math.max(0, current - step));\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n event.preventDefault();\n this.commit(Math.min(this.count(), (current === EMPTY ? 0 : current) + step));\n break;\n case \"Home\":\n event.preventDefault();\n this.commit(1);\n break;\n case \"End\":\n event.preventDefault();\n this.commit(this.count());\n break;\n case \" \":\n // Space only sets a rating that has none — it is not a toggle.\n if (current > 0) return;\n event.preventDefault();\n this.commit(1);\n break;\n default:\n return;\n }\n this.focusActiveRadio();\n }\n\n protected focusActive(event: Event): void {\n event.preventDefault();\n if (!this.interactive) return;\n this.focusActiveRadio();\n }\n\n protected onBlur(): void {\n this.onTouched();\n }\n\n private focusActiveRadio(): void {\n queueMicrotask(() => {\n const index = Math.max(1, Math.ceil(this.value()));\n this.host.nativeElement\n .querySelector<HTMLElement>(`[role=\"radio\"][aria-posinset=\"${index}\"]`)\n ?.focus();\n });\n }\n\n private commit(next: number): void {\n if (next === this.value()) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n // ── Forms ─────────────────────────────────────────────────────────────────\n\n protected onTouched: () => void = () => {};\n private onChange: (value: number) => void = () => {};\n\n writeValue(value: number | null): void {\n this.value.set(value ?? EMPTY);\n }\n registerOnChange(fn: (value: number) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { editableStyles, type ControlSize } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type EditableSize = ControlSize;\n/** What turns the preview into an input. */\nexport type EditableActivationMode = \"focus\" | \"dblclick\" | \"click\" | \"none\";\n/** What turns it back, keeping the edit. */\nexport type EditableSubmitMode = \"blur\" | \"enter\" | \"both\" | \"none\";\n\n/**\n * Text that becomes an input when you go to change it.\n *\n * ```html\n * <div uioEditable label=\"Name\" formControlName=\"displayName\"></div>\n * ```\n *\n * ── Both halves are always mounted ──────────────────────────────────────────\n *\n * The preview and the input exist together and `hidden` picks between them, so\n * starting an edit never remounts anything and the caret survives the swap. The\n * same is true of the three control buttons: Edit is hidden while editing, Save\n * and Cancel are hidden while not, and the row changes without any local state.\n *\n * ── Commit and cancel are not the same exit ─────────────────────────────────\n *\n * Escape reverts to the value the edit started from; Enter and (in `blur` or\n * `both` mode) clicking away keep it. The revert target is captured when the\n * edit *begins*, not derived from the last committed value — an edit started,\n * abandoned, and started again must go back to where the second one began.\n *\n * ── The Angular-specific win ────────────────────────────────────────────────\n *\n * `ControlValueAccessor`, so `[(ngModel)]` and Reactive Forms both drive it. A\n * form's `disable()` reaches the preview's `aria-disabled` as well as the input.\n */\n@Component({\n selector: \"div[uioEditable]\",\n standalone: true,\n exportAs: \"uioEditable\",\n imports: [UioButton, UioFieldError],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioEditable), multi: true },\n ],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"editable\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-focus]=\"flag(editing())\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [attr.data-required]=\"flag(required())\"\n (click)=\"focusPreview()\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n <div\n class=\"editable__area\"\n data-scope=\"editable\"\n data-part=\"area\"\n [id]=\"partId('area')\"\n [attr.data-focus]=\"flag(editing())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-placeholder-shown]=\"flag(empty())\"\n [style.display]=\"autoResize() ? 'inline-grid' : null\"\n >\n <!--\n data-readonly on the preview reports *disabled*, not read-only. That is\n Zag's own wiring and every other library in the system renders it, so\n the stylesheet is written against it; correcting it here would make\n Angular the odd one out.\n -->\n <span\n class=\"editable__preview\"\n data-scope=\"editable\"\n data-part=\"preview\"\n aria-label=\"edit\"\n [id]=\"partId('preview')\"\n [attr.data-placeholder-shown]=\"flag(empty())\"\n [attr.aria-readonly]=\"readOnlyInput() ? 'true' : null\"\n [attr.data-readonly]=\"flag(isDisabled())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.aria-disabled]=\"isDisabled() ? 'true' : null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [attr.data-autoresize]=\"flag(autoResize())\"\n [attr.hidden]=\"previewHidden()\"\n [attr.tabindex]=\"interactive ? 0 : null\"\n [style.white-space]=\"autoResize() ? 'pre' : null\"\n [style.grid-area]=\"autoResize() ? '1 / 1' : null\"\n [style.visibility]=\"autoResize() && editing() ? 'hidden' : null\"\n [style.overflow]=\"autoResize() ? 'hidden' : null\"\n [style.text-overflow]=\"autoResize() ? 'ellipsis' : null\"\n (click)=\"onPreviewClick()\"\n (dblclick)=\"onPreviewDoubleClick()\"\n (focus)=\"onPreviewFocus()\"\n >{{ previewText() }}</span\n >\n <input\n class=\"editable__input\"\n data-scope=\"editable\"\n data-part=\"input\"\n aria-label=\"editable input\"\n [id]=\"partId('input')\"\n [attr.name]=\"name()\"\n [attr.hidden]=\"inputHidden()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.maxlength]=\"maxLength()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.readonly]=\"readOnlyInput() ? '' : null\"\n [attr.data-readonly]=\"flag(readOnlyInput())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [attr.data-autoresize]=\"flag(autoResize())\"\n [attr.size]=\"autoResize() ? 1 : null\"\n [style.grid-area]=\"autoResize() ? '1 / 1' : null\"\n [style.visibility]=\"autoResize() && !editing() ? 'hidden' : null\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onInputBlur($event)\"\n />\n </div>\n @if (showControls()) {\n <div\n class=\"editable__control\"\n data-scope=\"editable\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n >\n <button\n uioButton\n intent=\"ghost\"\n data-scope=\"editable\"\n data-part=\"edit-trigger\"\n aria-label=\"edit\"\n [size]=\"size()\"\n [id]=\"partId('edit')\"\n [attr.hidden]=\"editing() ? '' : null\"\n [disabled]=\"isDisabled()\"\n (click)=\"edit()\"\n >\n Edit\n </button>\n <button\n uioButton\n intent=\"secondary\"\n data-scope=\"editable\"\n data-part=\"submit-trigger\"\n aria-label=\"submit\"\n [size]=\"size()\"\n [id]=\"partId('submit')\"\n [attr.hidden]=\"editing() ? null : ''\"\n [disabled]=\"isDisabled()\"\n (click)=\"submit()\"\n >\n Save\n </button>\n <button\n uioButton\n intent=\"ghost\"\n data-scope=\"editable\"\n data-part=\"cancel-trigger\"\n aria-label=\"cancel\"\n [size]=\"size()\"\n [id]=\"partId('cancel')\"\n [attr.hidden]=\"editing() ? null : ''\"\n [disabled]=\"isDisabled()\"\n (click)=\"cancel()\"\n >\n Cancel\n </button>\n </div>\n }\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioEditable extends UioPart implements ControlValueAccessor {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n readonly scope = \"editable\";\n readonly part = \"root\";\n\n readonly value = model<string>(\"\");\n readonly valueChange = output<string>();\n /** Fires only on a *kept* edit — never on cancel. */\n readonly valueCommit = output<string>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly placeholder = input<string | undefined>(undefined);\n readonly size = input<EditableSize>(\"md\");\n readonly activationMode = input<EditableActivationMode>(\"focus\");\n readonly submitMode = input<EditableSubmitMode>(\"both\");\n readonly showControls = input(false, { transform: booleanAttribute });\n /** Grows the input to fit its content instead of filling the width. */\n readonly autoResize = input(false, { transform: booleanAttribute });\n readonly maxLength = input<number | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n\n /**\n * Neither of these overrides its `UioPart` field, deliberately.\n *\n * Ark's editable *root* reports no state at all — it is the area, the preview\n * and the input that carry `data-disabled` and the read-only pair — so\n * overriding the base signals would put attributes on the root that no other\n * library emits. Same split as `readOnlyInput` on `UioNumberField`.\n */\n protected readonly readOnlyInput = input(false, {\n alias: \"readOnly\",\n transform: booleanAttribute,\n });\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n protected readonly isInvalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.isInvalid());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly hostClass = computed(() => editableStyles({ size: this.size() }));\n protected readonly editing = signal(false);\n protected readonly empty = computed(() => this.value().trim() === \"\");\n /**\n * `hidden` is what swaps the two halves — except with `autoResize`, where they\n * are stacked in one grid cell and `visibility` does it instead, so the\n * preview keeps reserving the width the input has to grow into.\n */\n protected readonly previewHidden = computed(() =>\n !this.autoResize() && this.editing() ? \"\" : null,\n );\n protected readonly inputHidden = computed(() =>\n !this.autoResize() && !this.editing() ? \"\" : null,\n );\n /** The placeholder is the preview's own text when there is no value — not a\n * `::placeholder`, because a span has none. */\n protected readonly previewText = computed(() =>\n this.empty() ? (this.placeholder() ?? \"\") : this.value(),\n );\n\n /** Where Escape goes back to: captured when the edit began. */\n private previousValue = \"\";\n\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected get interactive(): boolean {\n return !this.isDisabled() && !this.readOnlyInput();\n }\n\n private el<T extends HTMLElement>(part: string): T | null {\n return this.host.nativeElement.querySelector<T>(`[data-part=\"${part}\"]`);\n }\n\n // ── Starting an edit ──────────────────────────────────────────────────────\n\n protected onPreviewClick(): void {\n if (this.activationMode() !== \"click\") return;\n this.edit();\n }\n\n protected onPreviewDoubleClick(): void {\n if (this.activationMode() !== \"dblclick\") return;\n this.edit();\n }\n\n protected onPreviewFocus(): void {\n if (this.activationMode() !== \"focus\") return;\n this.edit();\n }\n\n protected focusPreview(): void {\n if (this.editing()) return;\n this.el<HTMLElement>(\"preview\")?.focus({ preventScroll: true });\n }\n\n /** Public so a caller can start an edit from their own affordance. */\n edit(): void {\n if (!this.interactive || this.editing()) return;\n this.previousValue = this.value();\n this.editing.set(true);\n // An animation frame, not a microtask: change detection has to have removed\n // the input's `hidden` before focus is asked for, and a hidden input cannot\n // take focus — the request is dropped silently and the caret is lost. Zag\n // reaches for a frame here for the same reason.\n requestAnimationFrame(() => this.el<HTMLInputElement>(\"input\")?.select());\n }\n\n // ── Leaving one ───────────────────────────────────────────────────────────\n\n protected onInput(event: Event): void {\n const text = (event.target as HTMLInputElement).value;\n const max = this.maxLength();\n this.write(max != null ? text.slice(0, max) : text);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") {\n event.preventDefault();\n this.cancel();\n return;\n }\n if (event.key !== \"Enter\") return;\n const mode = this.submitMode();\n if (mode !== \"enter\" && mode !== \"both\") return;\n if (event.shiftKey || event.metaKey) return;\n event.preventDefault();\n this.submit();\n }\n\n /**\n * Clicking Save or Cancel blurs the input first, so a blur that lands on one\n * of them must do nothing and let the button's own click decide.\n */\n protected onInputBlur(event: FocusEvent): void {\n if (!this.editing()) return;\n const next = event.relatedTarget as HTMLElement | null;\n if (next?.closest('[data-part=\"control\"]')) return;\n this.onTouched();\n const mode = this.submitMode();\n if (mode === \"blur\" || mode === \"both\") this.submit();\n else this.cancel();\n }\n\n /** Public so a caller can keep an edit from their own affordance. */\n submit(): void {\n if (!this.editing()) return;\n this.previousValue = this.value();\n this.editing.set(false);\n this.valueCommit.emit(this.value());\n this.restoreFocus();\n }\n\n /** Public so a caller can abandon an edit from their own affordance. */\n cancel(): void {\n if (!this.editing()) return;\n this.editing.set(false);\n // Zag reverts only to a non-empty previous value: cancelling an edit that\n // started from nothing leaves what was typed rather than blanking it.\n if (this.previousValue) this.write(this.previousValue);\n this.restoreFocus();\n }\n\n /**\n * The edit trigger, and nothing else.\n *\n * Falling back to the preview would be worse than leaving focus where it is:\n * in the default `focus` activation mode, focusing the preview starts the\n * edit again, and submitting would be unescapable.\n */\n private restoreFocus(): void {\n requestAnimationFrame(() =>\n this.el<HTMLElement>(\"edit-trigger\")?.focus({ preventScroll: true }),\n );\n }\n\n private write(next: string): void {\n if (next === this.value()) return;\n this.value.set(next);\n this.valueChange.emit(next);\n this.onChange(next);\n }\n\n // ── Forms ─────────────────────────────────────────────────────────────────\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n type Signal,\n} from \"@angular/core\";\nimport {\n CONTROL_ICON_SIZE,\n fileUploadStyles,\n type ControlSize,\n type FileUploadVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { VISUALLY_HIDDEN_INPUT, nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type FileUploadSize = ControlSize;\nexport type FileUploadVariant = NonNullable<FileUploadVariants[\"variant\"]>;\n\n/** Why a file was turned away. Zag's codes, so a caller's copy can match. */\nexport type FileRejectionReason =\n | \"FILE_INVALID_TYPE\"\n | \"FILE_TOO_LARGE\"\n | \"FILE_TOO_SMALL\"\n | \"FILE_EXISTS\"\n | \"TOO_MANY_FILES\";\n\nexport interface FileRejection {\n file: File;\n errors: FileRejectionReason[];\n}\n\n/** Delete affordance inside a file row — always the small edge, because it sits\n * inside the row rather than beside it. */\nconst DELETE_ICON_SIZE = 16;\n\n/** Zag's ladder, and the reason 1500 bytes reads as `1.5 kB` and not `1.46 kB`. */\nconst BYTE_PREFIXES = [\"\", \"kilo\", \"mega\", \"giga\", \"tera\", \"peta\"];\n\n/**\n * A file size in the shape Zag renders it, so the row reads the same in every\n * library.\n *\n * Decimal rather than binary — 1000 to the kilobyte — and three significant\n * figures, which is what turns 1536 into `1.54 kB`. `Intl` supplies the unit\n * name, so the string is localised rather than hand-assembled.\n */\nexport function formatFileSize(bytes: number, locale = \"en-US\"): string {\n if (Number.isNaN(bytes)) return \"\";\n if (bytes === 0) return \"0 B\";\n let value = Math.abs(bytes);\n let index = 0;\n while (value >= 1000 && index < BYTE_PREFIXES.length - 1) {\n value /= 1000;\n index++;\n }\n const rounded = Number.parseFloat(value.toPrecision(3));\n return new Intl.NumberFormat(locale, {\n style: \"unit\",\n unit: `${BYTE_PREFIXES[index]}byte`,\n unitDisplay: \"short\",\n }).format(bytes < 0 ? -rounded : rounded);\n}\n\n/**\n * Does a file match an `accept` list? The same test the browser's own file\n * picker applies, so a file dropped past the picker is judged identically.\n */\nexport function acceptsFile(file: File, accept: string | undefined): boolean {\n if (!accept) return true;\n const types = accept.split(\",\").filter(Boolean);\n if (!types.length) return true;\n const name = (file.name || \"\").toLowerCase();\n const mime = (file.type || \"\").toLowerCase();\n const base = mime.replace(/\\/.*$/, \"\");\n return types.some((entry) => {\n const type = entry.trim().toLowerCase();\n if (type.startsWith(\".\")) return name.endsWith(type);\n if (type.endsWith(\"/*\")) return base === type.replace(/\\/.*$/, \"\");\n return mime === type;\n });\n}\n\n/**\n * A dropzone, a file picker and the list of what has been chosen.\n *\n * ```html\n * <div uioFileUpload label=\"Attachments\" accept=\"image/*\" [maxFiles]=\"3\"></div>\n * ```\n *\n * ── The list is state, not a prop ───────────────────────────────────────────\n *\n * Rows are rendered from the component's own accepted list, so the uncontrolled\n * case works without the caller holding anything — which matters more here than\n * elsewhere, because a `File` cannot be constructed from markup and a list bound\n * from outside would be empty on first paint in every real app.\n *\n * ── Validation happens twice, on purpose ────────────────────────────────────\n *\n * `accept` is put on the hidden input so the operating system's picker filters,\n * *and* checked again on every file that arrives. The picker's filter is\n * advisory — a drop bypasses it entirely, and on some platforms so does \"All\n * files\" — so a component that trusted it would accept a `.exe` dropped onto a\n * dropzone declaring `image/*`.\n *\n * ── One preview element per filter ──────────────────────────────────────────\n *\n * An image row renders a thumbnail preview *and* the fallback preview; anything\n * else renders only the fallback. That is Ark's arrangement — two `ItemPreview`\n * parts with different filters, of which only the matching ones render — and the\n * stylesheet is written against both being present for an image.\n *\n * There is no `ControlValueAccessor` here, unlike the other controls in this\n * wave: a form posts files through `<input type=\"file\">` and its `FileList`,\n * which is exactly what the hidden input below already is. Wrapping it in a\n * value accessor would give Angular's forms a `File[]` it cannot serialise.\n */\n@Component({\n selector: \"div[uioFileUpload]\",\n standalone: true,\n exportAs: \"uioFileUpload\",\n imports: [NgTemplateOutlet, UioButton, UioIcon, UioFieldError],\n template: `\n @if (label(); as text) {\n <!--\n No data-invalid here, deliberately: zag 1.43 adds one and the machine\n Ark React bundles does not, so Svelte and Vue strip it. One library\n carrying it is how an invalid rule in FileUpload.css comes to apply to\n one library in three.\n -->\n <label\n class=\"field__label\"\n data-scope=\"file-upload\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-required]=\"flag(required())\"\n >{{ text }}\n @if (required()) {\n <span class=\"field__required\" aria-hidden=\"true\"></span>\n }\n </label>\n }\n\n @if (variant() === \"button\") {\n <ng-container [ngTemplateOutlet]=\"triggerTemplate\"></ng-container>\n } @else {\n <!--\n Not a control. Making the dropzone a focusable role=\"button\" puts the\n real \"Choose files\" button inside another one — two nested controls, so a\n screen reader cannot say which one focus is on, and a keyboard user hits\n an unnamed outer button before the named inner one.\n\n The drop area keeps working: dropping is a pointer gesture, and the\n button inside is the keyboard and click path. Same decision as the other\n three libraries.\n -->\n <div\n class=\"file-upload__dropzone\"\n data-scope=\"file-upload\"\n data-part=\"dropzone\"\n [id]=\"partId('dropzone')\"\n [attr.aria-disabled]=\"interactive() ? null : 'true'\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n (click)=\"onDropzoneClick($event)\"\n (keydown)=\"onDropzoneKeydown($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n >\n <span uioIcon [name]=\"glyph('upload')\" class=\"file-upload__dropzone-icon\" [size]=\"iconSize()\"></span>\n <span class=\"file-upload__dropzone-text\">{{ dropzoneLabel() }}</span>\n <ng-container [ngTemplateOutlet]=\"triggerTemplate\"></ng-container>\n </div>\n }\n\n <ng-template #triggerTemplate>\n <button\n uioButton\n intent=\"secondary\"\n data-scope=\"file-upload\"\n data-part=\"trigger\"\n [size]=\"size()\"\n [id]=\"partId('trigger')\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker($event)\"\n >\n {{ triggerLabel() }}\n </button>\n </ng-template>\n\n <ul\n class=\"file-upload__items\"\n data-scope=\"file-upload\"\n data-part=\"item-group\"\n data-type=\"accepted\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >\n @for (file of acceptedFiles(); track $index) {\n <li\n class=\"file-upload__item\"\n data-scope=\"file-upload\"\n data-part=\"item\"\n data-type=\"accepted\"\n [id]=\"partId('item:' + $index)\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n >\n @if (showPreview() && isImage(file)) {\n <div\n class=\"file-upload__item-preview\"\n data-scope=\"file-upload\"\n data-part=\"item-preview\"\n data-type=\"accepted\"\n [id]=\"partId('item-preview:' + $index)\"\n >\n <img\n class=\"file-upload__item-image\"\n data-scope=\"file-upload\"\n data-part=\"item-preview-image\"\n data-type=\"accepted\"\n [alt]=\"'preview of ' + file.name\"\n [src]=\"urlFor(file)\"\n />\n </div>\n }\n <!--\n Shown for every file, image or not — Ark renders one preview per\n matching filter, and the fallback filter matches everything.\n -->\n <div\n class=\"file-upload__item-preview\"\n data-scope=\"file-upload\"\n data-part=\"item-preview\"\n data-type=\"accepted\"\n [id]=\"partId('item-preview:' + $index)\"\n >\n <span uioIcon [name]=\"glyph('file')\" [size]=\"iconSize()\"></span>\n </div>\n <span class=\"file-upload__item-meta\">\n <div\n class=\"file-upload__item-name\"\n data-scope=\"file-upload\"\n data-part=\"item-name\"\n data-type=\"accepted\"\n [id]=\"partId('item-name:' + $index)\"\n >\n {{ file.name }}\n </div>\n <div\n class=\"file-upload__item-size\"\n data-scope=\"file-upload\"\n data-part=\"item-size-text\"\n data-type=\"accepted\"\n [id]=\"partId('item-size:' + $index)\"\n >\n {{ sizeOf(file) }}\n </div>\n </span>\n <button\n class=\"file-upload__item-delete\"\n data-scope=\"file-upload\"\n data-part=\"item-delete-trigger\"\n type=\"button\"\n data-type=\"accepted\"\n [id]=\"partId('item-delete:' + $index)\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [attr.data-disabled]=\"flag(isDisabled())\"\n [disabled]=\"isDisabled()\"\n (click)=\"removeAt($index)\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"DELETE_ICON_SIZE\"></span>\n </button>\n </li>\n }\n </ul>\n\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <!--\n The real control. Hidden from assistive tech, because the dropzone and the\n trigger are the accessible interface and a second announced file input is\n noise.\n -->\n <input\n type=\"file\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [id]=\"partId('input')\"\n [attr.style]=\"HIDDEN\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.accept]=\"acceptAttr()\"\n [attr.webkitdirectory]=\"directory() ? '' : null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"isDisabled()\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onPicked($event)\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n /**\n * Not on `UioPart`. `data-dragging` is what the dropzone's highlight is\n * styled off, and Ark puts it on the root as well as the dropzone.\n */\n \"[attr.data-dragging]\": \"flag(dragging())\",\n },\n})\nexport class UioFileUpload extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"file-upload\";\n readonly part = \"root\";\n\n /** The chosen files. Two-way, so a caller can clear the list. */\n readonly acceptedFiles = model<File[]>([]);\n readonly fileChange = output<{ acceptedFiles: File[]; rejectedFiles: FileRejection[] }>();\n readonly fileReject = output<FileRejection[]>();\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n /** MIME types or extensions — `\"image/*\"`, `[\"image/png\", \".pdf\"]`. */\n readonly accept = input<string | string[] | undefined>(undefined);\n readonly maxFiles = input(1);\n readonly maxFileSize = input<number | undefined>(undefined);\n readonly minFileSize = input<number | undefined>(undefined);\n readonly allowDrop = input(true, { transform: booleanAttribute });\n readonly directory = input(false, { transform: booleanAttribute });\n readonly dropzoneLabel = input(\"Drag files here, or\");\n readonly triggerLabel = input(\"Choose files\");\n readonly variant = input<FileUploadVariant>(\"dropzone\");\n readonly size = input<FileUploadSize>(\"md\");\n readonly showPreview = input(true, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n override readonly disabled: Signal<boolean> = this.isDisabled;\n\n /**\n * Reported by the dropzone and the trigger, not by the root.\n *\n * Ark's file-upload root carries no `data-invalid` — only the two things a\n * user aims at do — so the base's binding is left at its default rather than\n * overridden.\n */\n protected readonly isInvalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.isInvalid());\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly hostClass = computed(() =>\n fileUploadStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n protected readonly dragging = signal(false);\n protected readonly interactive = computed(() => !this.isDisabled());\n /** More than one file allowed is what `multiple` means to the picker. */\n protected readonly multiple = computed(() => this.maxFiles() > 1);\n protected readonly acceptAttr = computed(() => {\n const accept = this.accept();\n if (accept == null) return null;\n return Array.isArray(accept) ? accept.join(\",\") : accept;\n });\n\n protected readonly DELETE_ICON_SIZE = DELETE_ICON_SIZE;\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n /** Ark's ids are `file:<machine>`, not `file-upload:` — the scope and the id\n * prefix differ for this one machine. */\n protected get rootId(): string {\n return `file:${this.machine}`;\n }\n protected partId(part: string): string {\n return `file:${this.machine}:${part}`;\n }\n\n // ── Rows ──────────────────────────────────────────────────────────────────\n\n protected isImage(file: File): boolean {\n return file.type.startsWith(\"image/\");\n }\n\n protected sizeOf(file: File): string {\n return formatFileSize(file.size);\n }\n\n /**\n * Object URLs are cached per file and revoked when the row goes, because a\n * URL created during change detection would be a new one on every pass and\n * the browser would hold every image ever previewed.\n */\n private readonly urls = new Map<File, string>();\n protected urlFor(file: File): string {\n let url = this.urls.get(file);\n if (url == null) {\n // jsdom has no object URLs, and a spec asserting on a file row should not\n // have to stub one in. An empty src renders no image and breaks nothing.\n url = typeof URL.createObjectURL === \"function\" ? URL.createObjectURL(file) : \"\";\n this.urls.set(file, url);\n }\n return url;\n }\n\n protected removeAt(index: number): void {\n if (!this.interactive()) return;\n const next = [...this.acceptedFiles()];\n const [removed] = next.splice(index, 1);\n if (removed) this.release(removed);\n this.setFiles(next, []);\n }\n\n private release(file: File): void {\n const url = this.urls.get(file);\n if (url == null) return;\n if (url && typeof URL.revokeObjectURL === \"function\") URL.revokeObjectURL(url);\n this.urls.delete(file);\n }\n\n // ── Choosing ──────────────────────────────────────────────────────────────\n\n private inputEl(): HTMLInputElement | null {\n return this.host.nativeElement.querySelector<HTMLInputElement>('input[type=\"file\"]');\n }\n\n protected openPicker(event: Event): void {\n if (!this.interactive()) return;\n // Inside the dropzone the trigger's click would open the picker twice.\n event.stopPropagation();\n this.inputEl()?.click();\n }\n\n protected onDropzoneClick(event: MouseEvent): void {\n if (!this.interactive()) return;\n const target = event.target as HTMLElement;\n // Anything focusable inside the dropzone owns its own click.\n if (target.closest(\"button, a[href], input:not([type='file'])\")) return;\n this.inputEl()?.click();\n }\n\n protected onDropzoneKeydown(event: KeyboardEvent): void {\n if (!this.interactive()) return;\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n event.preventDefault();\n this.inputEl()?.click();\n }\n\n protected onPicked(event: Event): void {\n const element = event.target as HTMLInputElement;\n this.add(Array.from(element.files ?? []));\n // Cleared so that re-picking the same file fires `change` again.\n element.value = \"\";\n }\n\n // ── Dropping ──────────────────────────────────────────────────────────────\n\n protected onDragOver(event: DragEvent): void {\n if (!this.interactive() || !this.allowDrop()) return;\n event.preventDefault();\n event.stopPropagation();\n if (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n this.dragging.set(true);\n }\n\n protected onDragLeave(event: DragEvent): void {\n if (!this.interactive() || !this.allowDrop()) return;\n // Moving onto a child fires `dragleave` on the dropzone; only a pointer\n // that has actually left it ends the drag.\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.dragging.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n if (!this.interactive()) return;\n if (this.allowDrop()) {\n event.preventDefault();\n event.stopPropagation();\n }\n this.dragging.set(false);\n if (!this.allowDrop()) return;\n this.add(Array.from(event.dataTransfer?.files ?? []));\n }\n\n // ── Validation ────────────────────────────────────────────────────────────\n\n /**\n * Every arriving file is judged here, whichever way it arrived.\n *\n * The picker's own `accept` filter is advisory and a drop skips it entirely,\n * so this is the only place the rules are actually enforced.\n */\n private add(incoming: File[]): void {\n if (!this.interactive() || !incoming.length) return;\n const current = this.acceptedFiles();\n const accepted: File[] = [];\n const rejected: FileRejection[] = [];\n\n for (const file of incoming) {\n const errors: FileRejectionReason[] = [];\n if (!acceptsFile(file, this.acceptAttr() ?? undefined)) errors.push(\"FILE_INVALID_TYPE\");\n const max = this.maxFileSize();\n const min = this.minFileSize();\n if (max != null && file.size > max) errors.push(\"FILE_TOO_LARGE\");\n if (min != null && file.size < min) errors.push(\"FILE_TOO_SMALL\");\n const duplicate = [...current, ...accepted].some(\n (existing) => existing.name === file.name && existing.size === file.size,\n );\n if (duplicate) errors.push(\"FILE_EXISTS\");\n if (errors.length) rejected.push({ file, errors });\n else accepted.push(file);\n }\n\n // All or nothing past the cap, exactly as Zag does: a partial accept would\n // leave the user guessing which of their files got in.\n if (!this.withinRange(accepted.length, current.length)) {\n for (const file of accepted) rejected.push({ file, errors: [\"TOO_MANY_FILES\"] });\n accepted.length = 0;\n }\n\n // Single-file mode replaces rather than appends, so the one row a caller\n // asked for stays one row.\n const next = this.multiple()\n ? [...current, ...accepted]\n : accepted.length\n ? [accepted[0]!]\n : current;\n this.setFiles(next, rejected);\n }\n\n /**\n * Zag's range test, including the rule that looks like an off-by-one.\n *\n * A single-file control with one file already chosen accepts a second — that\n * is what makes choosing again *replace* rather than silently do nothing. The\n * cap only rejects when the total would exceed `maxFiles` and the control is\n * not in that replacement case.\n */\n private withinRange(incoming: number, current: number): boolean {\n if (!this.multiple() && incoming > 1) return false;\n if (!this.multiple() && incoming + current === 2) return true;\n return incoming + current <= this.maxFiles();\n }\n\n private setFiles(accepted: File[], rejected: FileRejection[]): void {\n this.acceptedFiles.set(accepted);\n this.fileChange.emit({ acceptedFiles: accepted, rejectedFiles: rejected });\n if (rejected.length) this.fileReject.emit(rejected);\n }\n}\n","import { Component, booleanAttribute, computed, input, model, output } from \"@angular/core\";\nimport { stepsStyles, type ControlSize, type StepsVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type StepsSize = ControlSize;\nexport type StepsOrientation = NonNullable<StepsVariants[\"orientation\"]>;\nexport type StepsVariant = NonNullable<StepsVariants[\"variant\"]>;\n\nexport interface StepItem {\n /** Step heading. */\n title: string;\n /** Optional supporting line under the title. */\n description?: string;\n /** Panel shown while this step is current. */\n content?: string;\n}\n\n/** The completed tick sits inside the indicator circle at every size — it marks\n * the step rather than scaling with the surrounding text. */\nconst COMPLETE_ICON_SIZE = 16;\n\n/**\n * A numbered or dotted progression with a panel per step.\n *\n * ```html\n * <div uioSteps [steps]=\"steps\" [(step)]=\"current\"></div>\n * ```\n *\n * ── There is one more panel than there are steps ────────────────────────────\n *\n * The current step index runs from `0` to `count` *inclusive*: `count` means\n * every step is done, which is why the completed panel is a content part with\n * index `count` rather than something rendered instead of the list. `Next` is\n * disabled at that point and `Back` at zero, and both fall out of the same\n * range rather than from a separate \"finished\" flag.\n *\n * ── Three states, not two ───────────────────────────────────────────────────\n *\n * Each step is exactly one of `data-complete`, `data-current` and\n * `data-incomplete`, and the trigger, the indicator and the separator all carry\n * it. Two would not be enough: the separator after a finished step is drawn\n * differently from the one after the step being worked on.\n *\n * ── `linear` is a guard, not a disabled attribute ───────────────────────────\n *\n * A linear flow ignores clicks on any step other than the current one and drops\n * the rest out of the tab order, but does **not** disable the buttons. A\n * disabled step would stop announcing its own state to a screen reader, and the\n * whole point of the list is that a user can see where they are in it.\n *\n * ── `type=\"button\"`, deliberately ───────────────────────────────────────────\n *\n * zag 1.43 adds it to the step trigger and the machine Ark React bundles does\n * not. Ours keeps it: `Steps.css` selects on nothing derived from `type`, so\n * nothing renders differently, and stripping it would delete a real guard\n * against a step trigger submitting the form it sits in.\n */\n@Component({\n selector: \"div[uioSteps]\",\n standalone: true,\n exportAs: \"uioSteps\",\n imports: [UioButton, UioIcon],\n template: `\n <div\n class=\"steps__list\"\n data-scope=\"steps\"\n data-part=\"list\"\n role=\"tablist\"\n [id]=\"partId('list')\"\n [attr.aria-owns]=\"triggerIds()\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.data-orientation]=\"orientation()\"\n >\n @for (item of steps(); track $index) {\n <!--\n A \"tablist\" may own only tabs, and each item is a direct child div that\n is neither. \"role=\"presentation\"\" is what stops the rule firing — but\n presentation is *ignored* on an element carrying a global ARIA\n attribute, so \"aria-current\" cannot be here as well. Nothing is lost:\n the trigger inside already reports \"aria-selected\", which is what a tab\n is supposed to say. Same decision as the other three libraries.\n -->\n <div\n class=\"steps__item\"\n data-scope=\"steps\"\n data-part=\"item\"\n role=\"presentation\"\n [attr.data-orientation]=\"orientation()\"\n >\n <!--\n The panel a trigger names only exists while \"showContent\" is on.\n Left in place the reference dangles, which is an ARIA error\n (axe's \"aria-valid-attr-value\") and costs the trigger its accessible\n name — the broken IDREF wins over the text inside it.\n -->\n <button\n class=\"steps__trigger\"\n data-scope=\"steps\"\n data-part=\"trigger\"\n type=\"button\"\n role=\"tab\"\n [id]=\"partId('trigger:' + $index)\"\n [attr.tabindex]=\"!linear() || $index === step() ? 0 : -1\"\n [attr.aria-selected]=\"$index === step()\"\n [attr.aria-controls]=\"showContent() ? partId('content:' + $index) : null\"\n [attr.data-state]=\"$index === step() ? 'open' : 'closed'\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-complete]=\"flag($index < step())\"\n [attr.data-current]=\"flag($index === step())\"\n [attr.data-incomplete]=\"flag($index > step())\"\n (click)=\"goTo($index)\"\n >\n <div\n class=\"steps__indicator\"\n data-scope=\"steps\"\n data-part=\"indicator\"\n aria-hidden=\"true\"\n [attr.data-complete]=\"flag($index < step())\"\n [attr.data-current]=\"flag($index === step())\"\n [attr.data-incomplete]=\"flag($index > step())\"\n >\n <!--\n Both the number and the tick are always mounted; CSS hides\n whichever does not apply, so a step completing does not remount\n its indicator mid-transition.\n -->\n <span class=\"steps__indicator-number\">{{\n variant() === \"numbered\" ? $index + 1 : \"\"\n }}</span>\n <span\n uioIcon\n [name]=\"glyph('check')\"\n class=\"steps__indicator-check\"\n [size]=\"COMPLETE_ICON_SIZE\"\n ></span>\n </div>\n <span class=\"steps__text\">\n <span class=\"steps__title\">{{ item.title }}</span>\n @if (item.description) {\n <span class=\"steps__description\">{{ item.description }}</span>\n }\n </span>\n </button>\n <div\n class=\"steps__separator\"\n data-scope=\"steps\"\n data-part=\"separator\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-complete]=\"flag($index < step())\"\n [attr.data-current]=\"flag($index === step())\"\n [attr.data-incomplete]=\"flag($index > step())\"\n ></div>\n </div>\n }\n </div>\n\n @if (showContent()) {\n @for (panel of panels(); track $index) {\n <div\n class=\"steps__content\"\n data-scope=\"steps\"\n data-part=\"content\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [id]=\"partId('content:' + $index)\"\n [attr.hidden]=\"$index === step() ? null : ''\"\n [attr.data-state]=\"$index === step() ? 'open' : 'closed'\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-labelledby]=\"partId('trigger:' + $index)\"\n >\n {{ panel }}\n </div>\n }\n <div class=\"steps__actions\">\n <button\n uioButton\n intent=\"secondary\"\n data-scope=\"steps\"\n data-part=\"prev-trigger\"\n [size]=\"size()\"\n [disabled]=\"step() <= 0\"\n (click)=\"previous()\"\n >\n Back\n </button>\n <button\n uioButton\n intent=\"primary\"\n data-scope=\"steps\"\n data-part=\"next-trigger\"\n [size]=\"size()\"\n [disabled]=\"step() >= steps().length\"\n (click)=\"next()\"\n >\n Next\n </button>\n </div>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n /**\n * Written as the whole `style` attribute rather than through\n * `[style.--percent]`, so the custom property reaches the element the same\n * way in a JIT-compiled spec as it does in the built package — the same\n * arrangement `UioProgress` uses. `Steps.css` reads `--percent`.\n */\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioSteps extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"steps\";\n readonly part = \"root\";\n\n readonly steps = input<StepItem[]>([]);\n /** `0` to `steps.length` inclusive — the last value means \"all done\". */\n readonly step = model(0);\n readonly stepChange = output<number>();\n /** Fires once the last step is completed. */\n readonly stepComplete = output<void>();\n\n override readonly orientation = input<StepsOrientation>(\"horizontal\");\n readonly size = input<StepsSize>(\"md\");\n readonly variant = input<StepsVariant>(\"numbered\");\n /** Prevents jumping ahead past the current step. */\n readonly linear = input(false, { transform: booleanAttribute });\n /** Renders the step panels and the Back/Next pair. */\n readonly showContent = input(true, { transform: booleanAttribute });\n /** Panel shown once every step is complete. */\n readonly completedContent = input<string | undefined>(undefined);\n\n protected readonly hostClass = computed(() =>\n stepsStyles({\n orientation: this.orientation(),\n size: this.size(),\n variant: this.variant(),\n }),\n );\n\n /**\n * One panel per step, plus the completed one at the end.\n *\n * Rendering the completed panel as the `count`-th content part rather than as\n * a separate element is what keeps `hidden` and `data-state` deciding which\n * panel shows, with no branch anywhere for \"finished\".\n */\n protected readonly panels = computed(() => [\n ...this.steps().map((item) => item.content ?? \"\"),\n this.completedContent() ?? \"\",\n ]);\n\n private readonly percent = computed(() => {\n const count = this.steps().length;\n return count === 0 ? 0 : (this.step() / count) * 100;\n });\n protected readonly rootStyle = computed(() => `--percent: ${this.percent()}%;`);\n\n /**\n * The list `aria-owns` every trigger.\n *\n * The triggers are already descendants, so this looks redundant — it is what\n * Ark emits, and it is load-bearing for the one case where a step's content\n * is portalled away from its tab.\n */\n protected readonly triggerIds = computed(() =>\n this.steps()\n .map((_, index) => this.partId(`trigger:${index}`))\n .join(\" \"),\n );\n\n protected readonly COMPLETE_ICON_SIZE = COMPLETE_ICON_SIZE;\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n /**\n * A linear flow ignores the click rather than refusing it loudly, which is\n * what makes the list read as a progress indicator instead of a broken menu.\n */\n protected goTo(index: number): void {\n if (this.linear()) return;\n this.commit(index);\n }\n\n protected next(): void {\n this.commit(Math.min(this.step() + 1, this.steps().length));\n }\n\n protected previous(): void {\n this.commit(Math.max(this.step() - 1, 0));\n }\n\n private commit(next: number): void {\n if (next === this.step()) return;\n this.step.set(next);\n this.stepChange.emit(next);\n if (next === this.steps().length) this.stepComplete.emit();\n }\n}\n","import {\n AfterViewInit,\n ApplicationRef,\n Component,\n DestroyRef,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { rangeStyles, type RangeVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\n\nexport type RangeSize = NonNullable<RangeVariants[\"size\"]>;\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n/** Index of the value in `sorted` (ascending) closest to `target`. */\nexport function nearestSnapIndex(sorted: readonly number[], target: number): number {\n let best = 0;\n let bestDistance = Infinity;\n for (let index = 0; index < sorted.length; index += 1) {\n const value = sorted[index];\n if (value === undefined) continue;\n const distance = Math.abs(value - target);\n if (distance < bestDistance) {\n bestDistance = distance;\n best = index;\n }\n }\n return best;\n}\n\n/**\n * Zag's `snapValueToStep`, which is not `Math.round(v / step) * step`.\n *\n * Two things the naive version gets wrong and this does not: a step that does\n * not divide the range evenly leaves a last stop *below* `max`, and floating\n * point turns `0.1 + 0.2` into a value no step ever lands on. Both are why the\n * remainder is taken against `min` and the result re-rounded to the step's own\n * decimal precision.\n */\nexport function snapToStep(value: number, min: number, max: number, step: number): number {\n const remainder = (value - min) % step;\n let snapped =\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder;\n snapped = roundToStepPrecision(snapped, step);\n if (snapped < min) {\n snapped = min;\n } else if (snapped > max) {\n const stepsInRange = Math.floor((max - min) / step);\n const largest = min + stepsInRange * step;\n snapped = stepsInRange <= 0 || largest < min ? max : largest;\n }\n return roundToStepPrecision(snapped, step);\n}\n\nfunction roundToStepPrecision(value: number, step: number): number {\n const text = step.toString();\n const point = text.indexOf(\".\");\n const places = point >= 0 ? text.length - point : 0;\n if (places <= 0) return value;\n const scale = Math.pow(10, places);\n return Math.round(value * scale) / scale;\n}\n\n/**\n * A labelled slider with one thumb.\n *\n * ```html\n * <div uioRange label=\"Volume\" [(value)]=\"volume\" [min]=\"0\" [max]=\"100\"></div>\n * ```\n *\n * ── Two kinds of snapping, and why one of them is driven by index ───────────\n *\n * `step` snaps at regular intervals between `min` and `max`. `snapValues` snaps\n * to a fixed *set* — `[1, 2, 4, 8]` — and those are not evenly spaced, so the\n * underlying slider is driven by the value's **index** and the bounds become\n * `0..n-1`. That is what makes one arrow press move to the adjacent allowed\n * value rather than 1/7th of the way across a gap, and it is why\n * `aria-valuenow` reports an index while the readout above reports the real\n * number. All four libraries do it this way.\n *\n * ── The root is a Field, and the thumb is what the caption names ────────────\n *\n * The caption is a `field/label` part, not a `slider/label` — this component\n * never renders one — so the thumb's `aria-labelledby` is pointed at the\n * caption by hand. Left to the machine it would name a `slider:…:label` that\n * does not exist, and the thumb would have no accessible name at all. With no\n * caption the attribute is dropped rather than left dangling, which is the\n * failure `OMIT_ARIA` exists to prevent on the React side.\n */\n@Component({\n selector: \"div[uioRange]\",\n standalone: true,\n exportAs: \"uioRange\",\n providers: [UioFieldContext],\n imports: [UioFieldError],\n template: `\n <div class=\"range__header\">\n @if (label(); as text) {\n <!--\n \"for\" names the field's control id, which is what Ark's Field.Label\n emits. It resolves to nothing here — the control is a slider thumb\n rather than an input — and it is reproduced because the four libraries\n render the same element. Clicking the caption focuses the thumb, which\n is the behaviour the attribute would otherwise have provided.\n -->\n <label\n class=\"range__label text-default-body-small\"\n data-scope=\"field\"\n data-part=\"label\"\n [id]=\"field.partId('label')\"\n [attr.for]=\"field.controlId\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-disabled]=\"flag(disabled())\"\n (click)=\"focusThumb($event)\"\n >{{ text }}</label\n >\n }\n @if (!hideValue()) {\n <span class=\"range__value text-default-body-large\">{{ display() }}</span>\n }\n </div>\n\n <div\n class=\"range__slider\"\n data-scope=\"slider\"\n data-part=\"root\"\n data-orientation=\"horizontal\"\n [id]=\"sliderId\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-focus]=\"flag(focused())\"\n [style]=\"rootStyle()\"\n >\n <div class=\"range__row\">\n @if (rangeLabels()) {\n <span class=\"range__range-label range__range-label--start text-default-body-small\">{{\n startLabel() ?? resolvedMin()\n }}</span>\n }\n <div\n class=\"range__control\"\n data-scope=\"slider\"\n data-part=\"control\"\n data-orientation=\"horizontal\"\n [id]=\"sliderPartId('control')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-focus]=\"flag(focused())\"\n [style.touch-action]=\"'none'\"\n [style.user-select]=\"'none'\"\n [style.position]=\"'relative'\"\n (pointerdown)=\"onControlPointerDown($event)\"\n >\n <div\n class=\"range__track\"\n data-scope=\"slider\"\n data-part=\"track\"\n data-orientation=\"horizontal\"\n [id]=\"sliderPartId('track')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-focus]=\"flag(focused())\"\n [style.position]=\"'relative'\"\n >\n <div\n class=\"range__indicator\"\n data-scope=\"slider\"\n data-part=\"range\"\n data-orientation=\"horizontal\"\n [id]=\"sliderPartId('range')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-focus]=\"flag(focused())\"\n [style.position]=\"'absolute'\"\n [style.left]=\"'var(--slider-range-start)'\"\n [style.right]=\"'var(--slider-range-end)'\"\n ></div>\n <div\n #thumb\n class=\"range__thumb\"\n data-scope=\"slider\"\n data-part=\"thumb\"\n data-index=\"0\"\n data-orientation=\"horizontal\"\n role=\"slider\"\n draggable=\"false\"\n aria-orientation=\"horizontal\"\n [id]=\"sliderPartId('thumb:0')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabelAttr()\"\n [attr.aria-labelledby]=\"labelledByAttr()\"\n [attr.aria-valuemin]=\"sliderMin()\"\n [attr.aria-valuemax]=\"sliderMax()\"\n [attr.aria-valuenow]=\"sliderValue()\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [style]=\"thumbStyle()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n (pointerdown)=\"onThumbPointerDown($event)\"\n >\n <input\n type=\"text\"\n hidden\n [id]=\"sliderPartId('input:0')\"\n [attr.name]=\"name()\"\n [value]=\"sliderValue()\"\n />\n </div>\n </div>\n </div>\n @if (rangeLabels()) {\n <span class=\"range__range-label range__range-label--end text-default-body-small\">{{\n endLabel() ?? resolvedMax()\n }}</span>\n }\n </div>\n </div>\n\n <span uioFieldError [message]=\"errorMessage()\"></span>\n `,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioRange extends UioPart implements AfterViewInit {\n readonly scope = \"field\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n /**\n * Uncontrolled until something binds it, which is why there is no separate\n * `defaultValue` — see `UioSwitch`. `undefined` means \"start at the minimum\",\n * which for a snapping slider is the first allowed value rather than `min`.\n */\n readonly value = model<number | undefined>(undefined);\n readonly min = input(0);\n readonly max = input(100);\n readonly step = input(1);\n /** A fixed set of allowed values. Takes precedence over min/max/step. */\n readonly snapValues = input<readonly number[] | undefined>(undefined);\n readonly rangeLabels = input(false, { transform: booleanAttribute });\n readonly startLabel = input<string | number | undefined>(undefined);\n readonly endLabel = input<string | number | undefined>(undefined);\n readonly size = input<RangeSize>(\"md\");\n /** A string shows a message below the track; `true` marks it invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n override readonly disabled = input(false, { transform: booleanAttribute });\n readonly hideValue = input(false, { transform: booleanAttribute });\n /** Formats the readout above the track. */\n readonly formatValue = input<((value: number) => string) | undefined>(undefined);\n readonly name = input<string | undefined>(undefined);\n /** Accessible name for the thumb when there is no visible caption. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: \"aria-label\" });\n\n /**\n * Fired once, when the drag or the keypress ends.\n *\n * The continuous half is `model()`'s own `valueChange`, which fires on every\n * step — there is no second output for it, and adding one would give the same\n * event two names.\n */\n readonly valueCommitted = output<number>();\n\n protected readonly field = inject(UioFieldContext);\n private readonly appRef = inject(ApplicationRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly machine = nextMachineId();\n protected readonly sliderId = `slider:${this.machine}`;\n protected sliderPartId(part: string): string {\n return `slider:${this.machine}:${part}`;\n }\n\n protected readonly flag = stateFlag;\n protected readonly dragging = signal(false);\n protected readonly focused = signal(false);\n /** Measured, because the thumb's own width is half of where it sits. */\n private readonly thumbSize = signal<{ width: number; height: number } | null>(null);\n\n override readonly invalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n\n protected readonly hostClass = computed(() => rangeStyles({ size: this.size() }));\n\n /** Sorted ascending, or `null` when the slider is a plain range. */\n private readonly snapPoints = computed(() => {\n const values = this.snapValues();\n return values && values.length > 0 ? [...values].sort((a, b) => a - b) : null;\n });\n\n protected readonly resolvedMin = computed(() => this.snapPoints()?.[0] ?? this.min());\n protected readonly resolvedMax = computed(() => {\n const points = this.snapPoints();\n return points ? (points[points.length - 1] ?? this.max()) : this.max();\n });\n\n /** The value in the caller's units, snapped and clamped. */\n protected readonly current = computed(() => {\n const raw = this.value();\n const points = this.snapPoints();\n if (raw == null) return this.resolvedMin();\n if (points) return points[nearestSnapIndex(points, raw)] ?? this.resolvedMin();\n return clamp(raw, this.min(), this.max());\n });\n\n /** What the *machine* is driving: an index when snapping, the value otherwise. */\n protected readonly sliderValue = computed(() => {\n const points = this.snapPoints();\n return points ? nearestSnapIndex(points, this.current()) : this.current();\n });\n protected readonly sliderMin = computed(() => (this.snapPoints() ? 0 : this.min()));\n protected readonly sliderMax = computed(() => {\n const points = this.snapPoints();\n return points ? points.length - 1 : this.max();\n });\n private readonly sliderStep = computed(() => (this.snapPoints() ? 1 : this.step()));\n\n protected readonly display = computed(() => {\n const format = this.formatValue();\n return format ? format(this.current()) : String(this.current());\n });\n\n /**\n * Exactly one of the two, never both and never a dangling reference.\n *\n * With a caption the thumb points at it; without one it takes the supplied\n * `aria-label`; with neither it carries no name at all rather than an\n * `aria-labelledby` naming an element that was never rendered.\n */\n protected readonly labelledByAttr = computed(() =>\n this.label() ? this.field.partId(\"label\") : null,\n );\n protected readonly ariaLabelAttr = computed(() => (this.label() ? null : (this.ariaLabel() ?? null)));\n\n private readonly percent = computed(() => {\n const min = this.sliderMin();\n const max = this.sliderMax();\n return max === min ? 0 : (this.sliderValue() - min) / (max - min);\n });\n\n /**\n * The custom properties the shared stylesheet positions everything from.\n *\n * Zag writes these on the slider root and the CSS reads them, so they are not\n * decoration: without `--slider-range-end` the filled part of the track is the\n * whole track at every value. The thumb offset subtracts half the thumb's own\n * width so the thumb stays *inside* the track at both ends instead of hanging\n * half-way off, which is why it has to be measured rather than assumed.\n */\n protected readonly rootStyle = computed(() => {\n const size = this.thumbSize();\n const percent = this.percent() * 100;\n const offset = size ? Number((-size.width / 2 + this.percent() * size.width).toFixed(2)) : 0;\n return {\n \"--slider-thumb-offset-0\": `calc(${percent}% - ${offset}px)`,\n \"--slider-thumb-transform\": \"translateX(-50%)\",\n \"--slider-range-start\": \"0%\",\n \"--slider-range-end\": `${100 - percent}%`,\n \"--slider-thumb-width\": size ? `${size.width}px` : \"\",\n \"--slider-thumb-height\": size ? `${size.height}px` : \"\",\n };\n });\n\n protected readonly thumbStyle = computed(() => ({\n // Hidden until measured: an unmeasured thumb would be painted half a thumb\n // out of place on the first frame and jump once the measurement lands.\n visibility: this.thumbSize() ? \"visible\" : \"hidden\",\n position: \"absolute\",\n transform: \"var(--slider-thumb-transform)\",\n \"inset-inline-start\": \"var(--slider-thumb-offset-0)\",\n }));\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n disabled: this.disabled,\n required: signal(false),\n readOnly: signal(false),\n });\n }\n\n ngAfterViewInit(): void {\n const thumb = this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"thumb\"]');\n if (!thumb) return;\n const measure = () =>\n this.thumbSize.set({ width: thumb.offsetWidth, height: thumb.offsetHeight });\n measure();\n // Kept measured, because the thumb's size is a token and a theme swap or a\n // font load changes it after the first frame.\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n measure();\n flushNow(this.appRef);\n });\n observer.observe(thumb);\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n\n // ── Interaction ───────────────────────────────────────────────────────────\n\n private get interactive(): boolean {\n return !this.disabled();\n }\n\n protected focusThumb(event: Event): void {\n if (!this.interactive) return;\n event.preventDefault();\n this.host.nativeElement.querySelector<HTMLElement>('[role=\"slider\"]')?.focus();\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive) return;\n const multiplier =\n event.ctrlKey || event.metaKey\n ? 0.1\n : event.key === \"PageUp\" ||\n event.key === \"PageDown\" ||\n (event.shiftKey && event.key.startsWith(\"Arrow\"))\n ? 10\n : 1;\n const step = multiplier * this.sliderStep();\n const value = this.sliderValue();\n let next: number | null = null;\n switch (event.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n case \"PageUp\":\n next = value + step;\n break;\n case \"ArrowLeft\":\n case \"ArrowDown\":\n case \"PageDown\":\n next = value - step;\n break;\n case \"Home\":\n next = this.sliderMin();\n break;\n case \"End\":\n next = this.sliderMax();\n break;\n default:\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.commit(next, true);\n }\n\n protected onThumbPointerDown(event: PointerEvent): void {\n if (!this.interactive || event.button !== 0) return;\n // Handled here so the control below does not *also* jump the thumb to the\n // press point: a drag that starts on the thumb keeps the value it started\n // with until the pointer moves.\n event.stopPropagation();\n (event.currentTarget as HTMLElement).focus({ preventScroll: true });\n this.beginDrag(event);\n }\n\n protected onControlPointerDown(event: PointerEvent): void {\n if (!this.interactive || event.button !== 0) return;\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n this.host.nativeElement.querySelector<HTMLElement>('[role=\"slider\"]')?.focus({\n preventScroll: true,\n });\n this.commit(this.valueAtPoint(event.clientX), false);\n this.beginDrag(event);\n }\n\n /**\n * The drag is followed on the *document*, not on the thumb.\n *\n * A slider is a few pixels tall and a drag leaves it immediately; listening on\n * the element would stop the value moving the moment the pointer strayed\n * vertically. Pointer capture would also work and is not available in every\n * engine this package supports.\n */\n private beginDrag(event: PointerEvent): void {\n this.dragging.set(true);\n const document = (event.target as HTMLElement).ownerDocument;\n const move = (moved: PointerEvent) => this.commit(this.valueAtPoint(moved.clientX), false);\n const stop = () => {\n document.removeEventListener(\"pointermove\", move);\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n this.dragging.set(false);\n this.valueCommitted.emit(this.current());\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointermove\", move);\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n }\n\n private valueAtPoint(clientX: number): number {\n const control = this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"control\"]');\n if (!control) return this.sliderValue();\n const rect = control.getBoundingClientRect();\n if (rect.width <= 0) return this.sliderValue();\n const percent = clamp((clientX - rect.left) / rect.width, 0, 1);\n const min = this.sliderMin();\n const max = this.sliderMax();\n const step = this.sliderStep();\n return clamp(Math.round((percent * (max - min)) / step) * step + min, min, max);\n }\n\n /** `next` is in *machine* units — an index when snapping. */\n private commit(next: number, ends: boolean): void {\n const min = this.sliderMin();\n const max = this.sliderMax();\n const snapped = clamp(snapToStep(next, min, max, this.sliderStep()), min, max);\n const points = this.snapPoints();\n const published = points ? (points[Math.round(snapped)] ?? this.resolvedMin()) : snapped;\n if (published !== this.current()) {\n this.value.set(published);\n }\n // A keypress is a whole gesture, so the commit fires with it; a drag waits\n // for the pointer to come up.\n if (ends) this.valueCommitted.emit(published);\n flushNow(this.appRef);\n }\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { angleSliderStyles, type AngleSliderVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\n\nexport type AngleSliderSize = NonNullable<AngleSliderVariants[\"size\"]>;\n\n/** The dial's fixed bounds. 359, not 360 — 360° *is* 0°. */\nexport const ANGLE_MIN = 0;\nexport const ANGLE_MAX = 359;\n\nexport const clampAngle = (degree: number) => Math.min(Math.max(degree, ANGLE_MIN), ANGLE_MAX);\n\n/**\n * Snap a dragged angle to the nearest step, with one asymmetry that is zag's\n * and worth keeping: a value that rounds *up* onto 359 wraps to 0 instead, so a\n * dial with `step={1}` passes through the top of the circle rather than sticking\n * one degree short of it.\n */\nexport function constrainAngle(degree: number, step: number): number {\n const clamped = clampAngle(degree);\n const upper = Math.ceil(clamped / step);\n const nearest = Math.round(clamped / step);\n if (upper < clamped / step) return nearest * step;\n return upper * step === ANGLE_MAX ? ANGLE_MIN : upper * step;\n}\n\n/**\n * The angle of `point` around the centre of `rect`, measured clockwise from\n * twelve o'clock. Zag's `getPointAngle`.\n *\n * `atan2(x, y)` rather than the usual `atan2(y, x)`: swapping the arguments\n * rotates the frame so that zero is *up* rather than to the right, which is\n * where a dial's zero is. The `360 - deg` then turns the result clockwise,\n * because screen coordinates run down the page while angles run up it.\n */\nexport function angleAtPoint(\n rect: { left: number; top: number; width: number; height: number },\n point: { x: number; y: number },\n): number {\n const x = point.x - (rect.left + rect.width / 2);\n const y = point.y - (rect.top + rect.height / 2);\n const degrees = Math.atan2(x, y) * (180 / Math.PI) + 180;\n return 360 - degrees;\n}\n\n/** Zag's `snapValueToStep` against the dial's own bounds. */\nexport function snapAngleToStep(value: number, step: number): number {\n const remainder = (value - ANGLE_MIN) % step;\n const snapped =\n Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder;\n if (snapped < ANGLE_MIN) return ANGLE_MIN;\n if (snapped > ANGLE_MAX) {\n const steps = Math.floor((ANGLE_MAX - ANGLE_MIN) / step);\n return steps <= 0 ? ANGLE_MAX : ANGLE_MIN + steps * step;\n }\n return snapped;\n}\n\n/**\n * A circular dial for picking an angle.\n *\n * ```html\n * <div uioAngleSlider label=\"Rotation\" [(value)]=\"angle\" [markers]=\"[0, 90, 180, 270]\"></div>\n * ```\n *\n * ── The readout is a plain div, deliberately ────────────────────────────────\n *\n * Zag's `valueText` part has an id and part attributes, and Ark's React\n * `ValueText` **does not spread them** — it renders a bare `ark.div` whose only\n * job is to hold the text. That is upstream behaviour rather than a choice, and\n * it is reproduced here rather than corrected, because the four libraries have\n * to render the same element. Rendering the part properly would give Angular an\n * id nobody else has and shift every id placeholder after it in the gate.\n *\n * ── The thumb names a label that may not exist ──────────────────────────────\n *\n * `aria-labelledby` always points at `…:label`, whether or not a caption was\n * given — again zag's, again reproduced. Because the label id is built from the\n * root id, the dangling reference normalises to the same placeholder in all four\n * libraries, which is why the *shape* of an id is part of the contract even when\n * the literal is not.\n */\n@Component({\n selector: \"div[uioAngleSlider]\",\n standalone: true,\n exportAs: \"uioAngleSlider\",\n imports: [UioFieldError],\n template: `\n <div\n class=\"angle-slider__control\"\n data-scope=\"angle-slider\"\n data-part=\"control\"\n role=\"presentation\"\n [id]=\"partId('control')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [style.touch-action]=\"'none'\"\n [style.user-select]=\"'none'\"\n (pointerdown)=\"onControlPointerDown($event)\"\n >\n @if (markers().length) {\n <div class=\"angle-slider__markers\" data-scope=\"angle-slider\" data-part=\"marker-group\">\n @for (marker of markers(); track $index) {\n <div\n class=\"angle-slider__marker\"\n data-scope=\"angle-slider\"\n data-part=\"marker\"\n [attr.data-value]=\"marker\"\n [attr.data-state]=\"markerState(marker)\"\n [attr.data-disabled]=\"flag(disabled())\"\n [style.--marker-value]=\"marker\"\n [style.--marker-display-value]=\"marker\"\n [style.rotate]=\"'calc(var(--marker-display-value) * 1deg)'\"\n ></div>\n }\n </div>\n }\n <!--\n The readout sits in the hollow of the ring. It stays inside the control\n so it is centred on the dial rather than on the field column, and CSS\n makes it click-through so the dial still tracks a press on it. Same\n placement as the other three libraries — \".angle-slider__readout\" is the\n shared rule that positions it, and the header this used to render had no\n rule at all.\n -->\n @if (showValue() || label()) {\n <div class=\"angle-slider__readout\">\n @if (showValue()) {\n <div class=\"angle-slider__value\">{{ current() }}°</div>\n }\n @if (label(); as text) {\n <label\n class=\"angle-slider__label\"\n data-scope=\"angle-slider\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n (click)=\"focusThumb($event)\"\n >{{ text }}</label\n >\n }\n </div>\n }\n <div\n class=\"angle-slider__thumb\"\n data-scope=\"angle-slider\"\n data-part=\"thumb\"\n role=\"slider\"\n aria-valuemax=\"360\"\n aria-valuemin=\"0\"\n [id]=\"partId('thumb')\"\n [attr.aria-labelledby]=\"partId('label')\"\n [attr.aria-valuenow]=\"current()\"\n [attr.tabindex]=\"thumbTabIndex()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [style.rotate]=\"'var(--angle)'\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n </div>\n\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <input type=\"hidden\" [id]=\"partId('input')\" [attr.name]=\"name()\" [value]=\"current()\" />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[style.--value]\": \"current()\",\n \"[style.--angle]\": \"current() + 'deg'\",\n },\n})\nexport class UioAngleSlider extends UioPart {\n readonly scope = \"angle-slider\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the dial invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n /** Uncontrolled until something binds it — see `UioSwitch`. */\n readonly value = model(0);\n readonly step = input(1);\n readonly markers = input<readonly number[]>([]);\n /**\n * Shown by default, as in the other three libraries: the dial's whole readout\n * is the angle, and a ring with no number in it says nothing.\n */\n readonly showValue = input<boolean, unknown>(true, {\n // Angular applies an `input()` default only when the input is *unbound*, so\n // `[showValue]=\"undefined\"` would set undefined where the other three\n // libraries' parameter default applies. This makes an explicit undefined\n // mean the same thing, and leaves every other value to `booleanAttribute`.\n transform: (value) => (value === undefined ? true : booleanAttribute(value)),\n });\n readonly size = input<AngleSliderSize>(\"md\");\n override readonly disabled = input(false, { transform: booleanAttribute });\n override readonly readOnly = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n\n /** Fired once, when the drag or the keypress ends. */\n readonly valueChangeEnd = output<number>();\n\n private readonly machine = nextMachineId();\n protected readonly rootId = `angle-slider:${this.machine}`;\n protected partId(part: string): string {\n return `${this.rootId}:${part}`;\n }\n\n private readonly appRef = inject(ApplicationRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly flag = stateFlag;\n private readonly dragging = signal(false);\n\n override readonly invalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly hostClass = computed(() => angleSliderStyles({ size: this.size() }));\n protected readonly current = computed(() => clampAngle(this.value()));\n\n private readonly interactive = computed(() => !this.disabled() && !this.readOnly());\n\n /**\n * Zag's rule, which is not \"focusable unless disabled\".\n *\n * A read-only dial keeps its tab stop so the angle can still be read, and a\n * disabled one has none — but the test is `readOnly || interactive`, so a\n * control that is *both* disabled and read-only stays focusable. Odd, and\n * reproduced rather than tidied: the four libraries render the same element.\n */\n protected readonly thumbTabIndex = computed(() =>\n this.readOnly() || this.interactive() ? 0 : null,\n );\n\n protected markerState(marker: number): string {\n const value = this.current();\n if (marker < value) return \"under-value\";\n if (marker > value) return \"over-value\";\n return \"at-value\";\n }\n\n protected focusThumb(event: Event): void {\n if (!this.interactive()) return;\n event.preventDefault();\n this.thumbElement()?.focus();\n }\n\n private thumbElement(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"thumb\"]');\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive()) return;\n const multiplier = event.ctrlKey || event.metaKey ? 0.1 : event.shiftKey ? 10 : 1;\n const step = multiplier * this.step();\n let next: number | null = null;\n switch (event.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n next = snapAngleToStep(this.current() - step, step);\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n next = snapAngleToStep(this.current() + step, step);\n break;\n case \"Home\":\n next = ANGLE_MIN;\n break;\n case \"End\":\n next = ANGLE_MAX;\n break;\n default:\n return;\n }\n event.preventDefault();\n this.set(next);\n this.valueChangeEnd.emit(this.current());\n flushNow(this.appRef);\n }\n\n protected onControlPointerDown(event: PointerEvent): void {\n if (!this.interactive() || event.button !== 0) return;\n event.stopPropagation();\n this.thumbElement()?.focus({ preventScroll: true });\n this.setFromPoint(event.clientX, event.clientY);\n\n // Followed on the document: a dial is small and a drag leaves it at once,\n // and the whole point of the gesture is that the pointer can circle it from\n // well outside.\n const document = (event.target as HTMLElement).ownerDocument;\n this.dragging.set(true);\n const move = (moved: PointerEvent) => this.setFromPoint(moved.clientX, moved.clientY);\n const stop = () => {\n document.removeEventListener(\"pointermove\", move);\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n this.dragging.set(false);\n this.valueChangeEnd.emit(this.current());\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointermove\", move);\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n }\n\n private setFromPoint(clientX: number, clientY: number): void {\n const control = this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"control\"]');\n if (!control) return;\n const angle = angleAtPoint(control.getBoundingClientRect(), { x: clientX, y: clientY });\n this.set(constrainAngle(angle, this.step()));\n flushNow(this.appRef);\n }\n\n private set(next: number): void {\n const clamped = clampAngle(next);\n if (clamped === this.current()) return;\n this.value.set(clamped);\n }\n}\n","import {\n ApplicationRef,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { timerStyles, type TimerVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type TimerPart = \"days\" | \"hours\" | \"minutes\" | \"seconds\" | \"milliseconds\";\nexport type TimerSize = NonNullable<TimerVariants[\"size\"]>;\nexport type TimerVariant = NonNullable<TimerVariants[\"variant\"]>;\nexport type TimerAction = \"start\" | \"pause\" | \"resume\" | \"reset\";\n\nconst DEFAULT_PARTS: TimerPart[] = [\"hours\", \"minutes\", \"seconds\"];\nconst DEFAULT_INTERVAL = 1000;\n\n/** The five units, broken out of a millisecond count. Zag's `msToTime`. */\nexport interface TimerTime {\n days: number;\n hours: number;\n minutes: number;\n seconds: number;\n milliseconds: number;\n}\n\nexport function msToTime(ms: number): TimerTime {\n const time = Math.max(0, ms);\n return {\n days: Math.floor(time / (1000 * 60 * 60 * 24)),\n hours: Math.floor(time / (1000 * 60 * 60)) % 24,\n minutes: Math.floor(time / (1000 * 60)) % 60,\n seconds: Math.floor(time / 1000) % 60,\n milliseconds: time % 1000,\n };\n}\n\nconst pad = (value: number, width = 2) => value.toString().padStart(width, \"0\");\n\n/** What each unit is *printed* as — two digits, or three for milliseconds. */\nexport function formatTimerTime(time: TimerTime): Record<TimerPart, string> {\n return {\n days: pad(time.days),\n hours: pad(time.hours),\n minutes: pad(time.minutes),\n seconds: pad(time.seconds),\n milliseconds: pad(time.milliseconds, 3),\n };\n}\n\n/**\n * Where a tick lands, given how long actually elapsed.\n *\n * `deltaMs` is floored to a whole number of intervals rather than added raw,\n * which is zag's `roundToInterval` and the reason a timer with a 1000ms interval\n * shows whole seconds even though the callback fires at 1003ms. Adding the raw\n * delta would drift the displayed value away from the interval within a minute.\n *\n * The target is a floor when counting down and a ceiling when counting up, so a\n * timer cannot overshoot the value that completes it.\n */\nexport function nextTimerValue(options: {\n currentMs: number;\n deltaMs: number;\n interval: number;\n countdown: boolean;\n targetMs: number | undefined;\n}): number {\n const { currentMs, deltaMs, interval, countdown } = options;\n const step = Math.floor(deltaMs / interval) * interval;\n const next = currentMs + (countdown ? -step : step);\n let targetMs = options.targetMs;\n if (targetMs == null && countdown) targetMs = 0;\n if (targetMs == null) return next;\n return countdown ? Math.max(next, targetMs) : Math.min(next, targetMs);\n}\n\n/** Whether the timer has arrived at the value that ends it. */\nexport function hasReachedTarget(options: {\n currentMs: number;\n countdown: boolean;\n targetMs: number | undefined;\n}): boolean {\n let targetMs = options.targetMs;\n if (targetMs == null && options.countdown) targetMs = 0;\n if (targetMs == null) return false;\n return options.countdown ? options.currentMs <= targetMs : options.currentMs >= targetMs;\n}\n\n/**\n * A countdown or a stopwatch, with optional controls.\n *\n * ```html\n * <div uioTimer countdown [startMs]=\"60000\" showControls></div>\n * ```\n *\n * ── The four triggers are always rendered ───────────────────────────────────\n *\n * Start, Pause, Resume and Reset all exist in the DOM at once, and whichever\n * does not apply to the current state carries `hidden`. That is zag's, not a\n * simplification: a button that is removed and re-added loses focus, so a user\n * who pauses with the keyboard would be dropped back to the top of the page\n * rather than left on the Resume button that replaced Pause. Rendering all four\n * and hiding three keeps the tab order stable across every transition.\n *\n * ── Why the tick is `setInterval` and not `requestAnimationFrame` ───────────\n *\n * Zag ticks on a rAF loop, which is smoother for a millisecond readout and\n * unusable in a spec: jsdom's rAF is tied to a timer this package cannot drive.\n * The arithmetic is what matters and it is identical — `deltaMs` is measured\n * against the clock rather than assumed, then floored to whole intervals — so a\n * background tab that throttles the callback resumes at the right value instead\n * of losing the time it was away.\n */\n@Component({\n selector: \"div[uioTimer]\",\n standalone: true,\n exportAs: \"uioTimer\",\n imports: [UioButton],\n template: `\n <div\n class=\"timer__area\"\n role=\"timer\"\n aria-atomic=\"true\"\n data-scope=\"timer\"\n data-part=\"area\"\n [id]=\"partId('area')\"\n [attr.aria-label]=\"areaLabel()\"\n >\n @for (unit of parts(); track unit; let index = $index) {\n @if (index > 0) {\n <div\n class=\"timer__separator\"\n aria-hidden=\"true\"\n data-scope=\"timer\"\n data-part=\"separator\"\n >\n :\n </div>\n }\n <div class=\"timer__segment\">\n <div\n class=\"timer__value\"\n data-scope=\"timer\"\n data-part=\"item\"\n [attr.data-type]=\"unit\"\n [style.--value]=\"time()[unit]\"\n >\n {{ formatted()[unit] }}\n </div>\n @if (showLabels()) {\n <span class=\"timer__label\">{{ unit }}</span>\n }\n </div>\n }\n </div>\n\n @if (showControls()) {\n <div class=\"timer__control\" data-scope=\"timer\" data-part=\"control\">\n <button\n uioButton\n intent=\"primary\"\n [icon]=\"glyph('play')\"\n data-scope=\"timer\"\n data-part=\"action-trigger\"\n [size]=\"size()\"\n [attr.hidden]=\"isHidden('start')\"\n (click)=\"act('start')\"\n >\n Start\n </button>\n <button\n uioButton\n intent=\"secondary\"\n [icon]=\"glyph('pause')\"\n data-scope=\"timer\"\n data-part=\"action-trigger\"\n [size]=\"size()\"\n [attr.hidden]=\"isHidden('pause')\"\n (click)=\"act('pause')\"\n >\n Pause\n </button>\n <button\n uioButton\n intent=\"secondary\"\n [icon]=\"glyph('play')\"\n data-scope=\"timer\"\n data-part=\"action-trigger\"\n [size]=\"size()\"\n [attr.hidden]=\"isHidden('resume')\"\n (click)=\"act('resume')\"\n >\n Resume\n </button>\n <button\n uioButton\n intent=\"ghost\"\n [icon]=\"glyph('refresh')\"\n data-scope=\"timer\"\n data-part=\"action-trigger\"\n [size]=\"size()\"\n [attr.hidden]=\"isHidden('reset')\"\n (click)=\"act('reset')\"\n >\n Reset\n </button>\n </div>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n },\n})\nexport class UioTimer extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"timer\";\n readonly part = \"root\";\n\n /** Which units to show, in order. */\n readonly parts = input<readonly TimerPart[]>(DEFAULT_PARTS);\n /** Counts down to `targetMs` rather than up from `startMs`. */\n readonly countdown = input(false);\n readonly startMs = input(0);\n readonly targetMs = input<number | undefined>(undefined);\n /** Starts as soon as it mounts. */\n readonly autoStart = input(false);\n readonly interval = input(DEFAULT_INTERVAL);\n readonly showControls = input(false);\n readonly showLabels = input(false);\n readonly size = input<TimerSize>(\"md\");\n readonly variant = input<TimerVariant>(\"default\");\n\n /** Fired once the target is reached. */\n readonly complete = output<void>();\n /** Fired on every tick, with the new value in milliseconds. */\n readonly tick = output<number>();\n\n private readonly machine = nextMachineId();\n /** Ark's timer root carries a `:root` suffix, unlike most machines. */\n protected readonly rootId = `timer:${this.machine}:root`;\n protected partId(part: string): string {\n return `timer:${this.machine}:${part}`;\n }\n\n private readonly appRef = inject(ApplicationRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly status = signal<\"idle\" | \"running\" | \"paused\">(\"idle\");\n private readonly currentMs = signal(0);\n\n protected readonly time = computed(() => msToTime(this.currentMs()));\n protected readonly formatted = computed(() => formatTimerTime(this.time()));\n /**\n * Zag's default `areaLabel`, which always spells out days and always shows\n * three fields — it does not follow `parts`. A timer showing only seconds\n * still announces \"0 days 00:00:09\".\n */\n protected readonly areaLabel = computed(() => {\n const formatted = this.formatted();\n return `${this.time().days} days ${formatted.hours}:${formatted.minutes}:${formatted.seconds}`;\n });\n\n protected readonly hostClass = computed(() =>\n timerStyles({ size: this.size(), variant: this.variant() }),\n );\n\n private handle: ReturnType<typeof setInterval> | null = null;\n private lastTick = 0;\n\n /** False until the first effect run, which is the earliest inputs are bound. */\n private seeded = false;\n\n constructor() {\n super();\n /**\n * The first run seeds; every later one restarts.\n *\n * An effect rather than the constructor because a constructor runs before\n * Angular has set a single input — `startMs()` there is the declared\n * default, not what the caller passed. The first run is therefore the\n * mount, where `autoStart` decides the state, and any run after it is the\n * caller handing the timer a new duration, which zag treats as a RESTART:\n * a new duration starts counting rather than sitting idle at the new value.\n */\n effect(() => {\n const start = this.startMs();\n if (!this.seeded) {\n this.seeded = true;\n this.currentMs.set(start);\n this.status.set(untracked(this.autoStart) ? \"running\" : \"idle\");\n return;\n }\n untracked(() => this.restart());\n });\n effect(() => {\n if (this.status() === \"running\") untracked(() => this.startTicking(this.interval()));\n else untracked(() => this.stopTicking());\n });\n this.destroyRef.onDestroy(() => this.stopTicking());\n }\n\n // ── Public API ────────────────────────────────────────────────────────────\n\n start(): void {\n if (this.status() === \"idle\") this.status.set(\"running\");\n }\n pause(): void {\n if (this.status() === \"running\") this.status.set(\"paused\");\n }\n resume(): void {\n if (this.status() === \"paused\") this.status.set(\"running\");\n }\n reset(): void {\n this.currentMs.set(this.startMs());\n if (this.status() === \"paused\") this.status.set(\"idle\");\n }\n restart(): void {\n this.currentMs.set(this.startMs());\n this.status.set(\"running\");\n }\n\n // ── Triggers ──────────────────────────────────────────────────────────────\n\n /**\n * Zag's table, reproduced exactly. Note `reset` is hidden while *idle* as well\n * as while stopped — there is nothing to reset until the timer has run.\n */\n protected isHidden(action: TimerAction): \"\" | null {\n const running = this.status() === \"running\";\n const paused = this.status() === \"paused\";\n const hidden = {\n start: running || paused,\n pause: !running,\n resume: !paused,\n reset: !running && !paused,\n }[action];\n return hidden ? \"\" : null;\n }\n\n protected act(action: TimerAction): void {\n this[action]();\n flushNow(this.appRef);\n }\n\n // ── Ticking ───────────────────────────────────────────────────────────────\n\n private startTicking(interval: number): void {\n this.stopTicking();\n this.lastTick = Date.now();\n this.handle = setInterval(() => this.onTick(interval), interval);\n }\n\n private stopTicking(): void {\n if (this.handle === null) return;\n clearInterval(this.handle);\n this.handle = null;\n }\n\n private onTick(interval: number): void {\n const now = Date.now();\n const deltaMs = now - this.lastTick;\n // Only the whole intervals are consumed; the remainder stays on the clock so\n // a callback that fires 3ms late does not lose those 3ms forever.\n const consumed = Math.floor(deltaMs / interval) * interval;\n if (consumed <= 0) return;\n this.lastTick += consumed;\n\n const countdown = this.countdown();\n const targetMs = this.targetMs();\n // Checked *before* the value moves, which is zag's order: a timer that has\n // reached its target spends one more interval running and completes on the\n // tick after it. Completing the moment the value lands would hide Pause a\n // whole interval earlier than the other three libraries do.\n if (hasReachedTarget({ currentMs: this.currentMs(), countdown, targetMs })) {\n this.finish();\n return;\n }\n const next = nextTimerValue({\n currentMs: this.currentMs(),\n deltaMs,\n interval,\n countdown,\n targetMs,\n });\n this.currentMs.set(next);\n this.tick.emit(next);\n flushNow(this.appRef);\n }\n\n private finish(): void {\n // Back to `idle` rather than `paused`: the run is over, so Start is the\n // trigger that applies, not Resume.\n this.status.set(\"idle\");\n this.complete.emit();\n flushNow(this.appRef);\n }\n}\n","/**\n * A QR encoder, written out by hand.\n *\n * ── Why this file exists ────────────────────────────────────────────────────\n *\n * React, Svelte and Vue get their code from `@zag-js/qr-code`, which bundles\n * `uqr`, and the note in every one of those components says the same thing:\n * nothing there computes a single module, because three libraries hand-rolling\n * an encoder would produce three codes. This package has no zag and may take no\n * third-party dependency beyond the CDK, so the choice is between an encoder and\n * a `QRCode` that renders a frame around nothing. An encoder it is — and a\n * fourth answer to the question is only acceptable because it is *checked*\n * against the other three's, module for module, in `qr-encoder.spec.ts`.\n *\n * ── Sources ─────────────────────────────────────────────────────────────────\n *\n * The algorithm is ISO/IEC 18004 (QR Code 2005). Where a table is reproduced\n * here it names the clause it comes from, and the structure follows Project\n * Nayuki's reference implementation (\"QR Code generator library\", MIT), which is\n * what `uqr` is a TypeScript port of. Following the same reference is deliberate:\n * the ambiguous parts of the spec — automatic mask choice, the interleaving of\n * short and long blocks — have to be resolved the same way as `uqr` or the four\n * libraries would render *valid but different* codes for the same string.\n *\n * ── What is checked, and how ────────────────────────────────────────────────\n *\n * `qr-encoder.spec.ts` holds four independent proofs:\n *\n * 1. Published tables — the Reed-Solomon generator polynomials from ISO/IEC\n * 18004 Annex A, the alignment-pattern centres from Annex E, the format and\n * version information bit strings from Annex C and D — asserted against\n * values written into the spec by hand, so a transcription error here cannot\n * agree with itself.\n * 2. A decoder, written in the spec, that reads a finished matrix back to the\n * original string. It reverses the mask, un-interleaves the blocks, and\n * confirms every Reed-Solomon syndrome is zero, which is what proves the\n * error-correction codewords are a valid codeword rather than merely\n * present.\n * 3. Structural invariants — three finder patterns, the timing rows, the always\n * dark module.\n * 4. Fixtures generated from `uqr` itself at authoring time and checked in, so\n * the path data this produces is compared byte for byte with what the other\n * three libraries render. `uqr` is read to make the table and never imported\n * by anything that ships or runs.\n */\n\n/** The four levels, in the spelling the component's `errorCorrection` prop uses. */\nexport type QrErrorCorrection = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QrMatrix {\n /** 1-40. */\n version: number;\n /** Edge length in modules, including the quiet-zone border. */\n size: number;\n /** The mask pattern chosen, 0-7. */\n mask: number;\n /** Row-major, `true` for a dark module. */\n modules: boolean[][];\n}\n\nexport interface QrEncodeOptions {\n /** Defaults to `\"L\"` — uqr's default, and therefore the machine's. */\n ecc?: QrErrorCorrection;\n /**\n * Quiet zone in modules on every side. Defaults to 1, which is uqr's default\n * and so what the other three libraries render.\n *\n * The spec asks for 4. The design system supplies the rest as padding on\n * `.qr-code__frame` — see the note in `QRCode.css` — so widening it here would\n * double the margin rather than fix anything.\n */\n border?: number;\n}\n\n/**\n * Each level's two numbers: the row it occupies in the tables below, and the\n * two-bit indicator it contributes to the format information.\n *\n * They are deliberately not the same and not in the same order — ISO/IEC 18004\n * §8.9 numbers the levels M=00, L=01, H=10, Q=11 for the format bits, while the\n * capacity tables are ordered L, M, Q, H. Collapsing the two into one number is\n * the classic way to produce a code that scans as the wrong error level.\n */\nconst ECC_LEVELS: Record<QrErrorCorrection, { row: number; formatBits: number }> = {\n L: { row: 0, formatBits: 1 },\n M: { row: 1, formatBits: 0 },\n Q: { row: 2, formatBits: 3 },\n H: { row: 3, formatBits: 2 },\n};\n\n/**\n * Error-correction codewords per block, by level and version.\n * ISO/IEC 18004 Table 13-22. Index 0 is padding — there is no version 0.\n */\nconst ECC_CODEWORDS_PER_BLOCK: readonly (readonly number[])[] = [\n // L\n [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n // M\n [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n // Q\n [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n // H\n [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n];\n\n/**\n * Number of error-correction blocks, by level and version.\n * ISO/IEC 18004 Table 13-22, same layout as above.\n */\nconst ECC_BLOCKS: readonly (readonly number[])[] = [\n // L\n [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n // M\n [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n // Q\n [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n // H\n [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81],\n];\n\n/** ISO/IEC 18004 §7.4.1-7.4.4. `[indicator, ccBitsSmall, ccBitsMedium, ccBitsLarge]`. */\nconst MODE_NUMERIC = [1, 10, 12, 14] as const;\nconst MODE_ALPHANUMERIC = [2, 9, 11, 13] as const;\nconst MODE_BYTE = [4, 8, 16, 16] as const;\ntype Mode = typeof MODE_NUMERIC | typeof MODE_ALPHANUMERIC | typeof MODE_BYTE;\n\n/** ISO/IEC 18004 Table 5. Position in this string *is* the value. */\nconst ALPHANUMERIC_CHARSET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n\nconst NUMERIC_PATTERN = /^\\d*$/;\nconst ALPHANUMERIC_PATTERN = /^[A-Z0-9 $%*+./:-]*$/;\n\n/** ISO/IEC 18004 §8.8.2, Table 24. */\nconst PENALTY_ADJACENT = 3;\nconst PENALTY_BLOCK = 3;\nconst PENALTY_FINDER_LIKE = 40;\nconst PENALTY_BALANCE = 10;\n\nconst MIN_VERSION = 1;\nconst MAX_VERSION = 40;\n\n// ── Bits ─────────────────────────────────────────────────────────────────────\n\n/** Append the low `length` bits of `value`, most significant first. */\nfunction appendBits(bits: number[], value: number, length: number): void {\n for (let i = length - 1; i >= 0; i--) bits.push((value >>> i) & 1);\n}\n\nconst bitAt = (value: number, index: number) => ((value >>> index) & 1) !== 0;\n\n// ── Segments ─────────────────────────────────────────────────────────────────\n\ninterface Segment {\n mode: Mode;\n /** Characters for numeric and alphanumeric, *bytes* for byte mode. */\n count: number;\n bits: number[];\n}\n\n/**\n * How many bits the character count takes, which depends on both mode and\n * version. ISO/IEC 18004 Table 3: the three bands are versions 1-9, 10-26 and\n * 27-40.\n */\nfunction charCountBits(mode: Mode, version: number): number {\n return mode[Math.floor((version + 7) / 17) + 1]!;\n}\n\n/**\n * UTF-8 bytes for a string.\n *\n * QR has no notion of UTF-8 — byte mode is ISO-8859-1 by the letter of the spec\n * — but every scanner in use treats a byte segment that parses as UTF-8 as UTF-8,\n * and that is what `uqr` produces (it round-trips through `encodeURI`, which is\n * UTF-8 percent-encoding). This is written out directly instead, because\n * `encodeURI` throws on a lone surrogate where `TextEncoder` substitutes U+FFFD,\n * and a QR code is not the place to raise an exception about someone's display\n * name. Well-formed input produces identical bytes either way, which is what the\n * fixture comparison in the spec covers.\n */\nfunction toUtf8(text: string): number[] {\n return Array.from(new TextEncoder().encode(text));\n}\n\n/**\n * The single segment a string is encoded as.\n *\n * One segment for the whole string, not the optimal mixed-mode split ISO/IEC\n * 18004 Annex J allows. That is `uqr`'s choice, and matching it is the point:\n * a smarter segmentation here would produce a smaller, perfectly valid code that\n * is not the code the other three libraries render.\n */\nfunction makeSegment(text: string): Segment[] {\n if (text === \"\") return [];\n\n if (NUMERIC_PATTERN.test(text)) {\n const bits: number[] = [];\n // Three digits to ten bits, two to seven, one to four. §7.4.3.\n for (let i = 0; i < text.length; ) {\n const take = Math.min(text.length - i, 3);\n appendBits(bits, Number.parseInt(text.substring(i, i + take), 10), take * 3 + 1);\n i += take;\n }\n return [{ mode: MODE_NUMERIC, count: text.length, bits }];\n }\n\n if (ALPHANUMERIC_PATTERN.test(text)) {\n const bits: number[] = [];\n // Pairs to eleven bits, a trailing odd character to six. §7.4.4.\n let i = 0;\n for (; i + 2 <= text.length; i += 2) {\n const pair =\n ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45 +\n ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n appendBits(bits, pair, 11);\n }\n if (i < text.length) appendBits(bits, ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6);\n return [{ mode: MODE_ALPHANUMERIC, count: text.length, bits }];\n }\n\n const bytes = toUtf8(text);\n const bits: number[] = [];\n for (const byte of bytes) appendBits(bits, byte, 8);\n return [{ mode: MODE_BYTE, count: bytes.length, bits }];\n}\n\nfunction totalBits(segments: readonly Segment[], version: number): number {\n let total = 0;\n for (const segment of segments) {\n const ccBits = charCountBits(segment.mode, version);\n // A count that will not fit its field means this version cannot hold the\n // segment at all, whatever the capacity says.\n if (segment.count >= 1 << ccBits) return Number.POSITIVE_INFINITY;\n total += 4 + ccBits + segment.bits.length;\n }\n return total;\n}\n\n// ── Capacity ─────────────────────────────────────────────────────────────────\n\n/**\n * Modules available to data and error correction, before the format and version\n * information is subtracted. ISO/IEC 18004 §7.3.\n *\n * The closed form is Nayuki's: the whole grid minus the function patterns, with\n * the alignment patterns' overlap with the timing rows already accounted for.\n */\nfunction rawDataModules(version: number): number {\n let result = (16 * version + 128) * version + 64;\n if (version >= 2) {\n const alignCount = Math.floor(version / 7) + 2;\n result -= (25 * alignCount - 10) * alignCount - 55;\n // Version information: two 3x6 blocks, from version 7 on.\n if (version >= 7) result -= 36;\n }\n return result;\n}\n\nfunction dataCodewords(version: number, ecc: QrErrorCorrection): number {\n const { row } = ECC_LEVELS[ecc];\n return (\n Math.floor(rawDataModules(version) / 8) -\n ECC_CODEWORDS_PER_BLOCK[row]![version]! * ECC_BLOCKS[row]![version]!\n );\n}\n\n// ── Reed-Solomon over GF(2^8) ────────────────────────────────────────────────\n\n/**\n * Multiply in GF(2^8) modulo the QR field polynomial x^8 + x^4 + x^3 + x^2 + 1\n * (0x11D). ISO/IEC 18004 §8.5.2.\n *\n * Russian-peasant multiplication with the reduction folded in, so no log/antilog\n * tables are needed and there is no table to get wrong.\n */\nexport function gfMultiply(x: number, y: number): number {\n let result = 0;\n for (let i = 7; i >= 0; i--) {\n // Double, reducing when the top bit falls off. 0x11D without its top bit.\n result = (result << 1) ^ ((result >>> 7) * 0x11d);\n result ^= ((y >>> i) & 1) * x;\n }\n return result & 0xff;\n}\n\n/**\n * The generator polynomial for `degree` error-correction codewords, as\n * coefficients from x^(degree-1) down to x^0. The leading 1 is implicit.\n *\n * This is the product (x - α^0)(x - α^1)…(x - α^(degree-1)). ISO/IEC 18004\n * Annex A publishes the results as α-exponents; `qr-encoder.spec.ts` holds two\n * rows of that table verbatim and checks them against what this computes, which\n * is what makes the field arithmetic above independently verified rather than\n * merely self-consistent.\n */\nexport function reedSolomonDivisor(degree: number): number[] {\n // Annotated, not inferred: the initialiser's `1 : 0` narrows to `(1 | 0)[]`,\n // and the Galois-field arithmetic below assigns arbitrary bytes into it.\n const divisor: number[] = Array.from({ length: degree }, (_, index) =>\n index === degree - 1 ? 1 : 0,\n );\n let root = 1;\n for (let i = 0; i < degree; i++) {\n for (let j = 0; j < divisor.length; j++) {\n divisor[j] = gfMultiply(divisor[j]!, root);\n if (j + 1 < divisor.length) divisor[j] = divisor[j]! ^ divisor[j + 1]!;\n }\n root = gfMultiply(root, 2);\n }\n return divisor;\n}\n\n/** The remainder of `data` divided by `divisor` — the error-correction codewords. */\nexport function reedSolomonRemainder(data: readonly number[], divisor: readonly number[]): number[] {\n const result = divisor.map(() => 0);\n for (const byte of data) {\n const factor = byte ^ result.shift()!;\n result.push(0);\n divisor.forEach((coefficient, index) => {\n result[index] = result[index]! ^ gfMultiply(coefficient, factor);\n });\n }\n return result;\n}\n\n// ── The grid ─────────────────────────────────────────────────────────────────\n\ninterface Grid {\n size: number;\n dark: boolean[][];\n /**\n * Which modules belong to a function pattern.\n *\n * The mask is applied to data modules only, and the codewords are laid into\n * the gaps between function patterns — so getting this wrong does not produce\n * a corrupt code, it produces one that a scanner reads as a *different*\n * string. Every `set` that draws a pattern marks it here.\n */\n reserved: boolean[][];\n}\n\nfunction makeGrid(size: number): Grid {\n return {\n size,\n dark: Array.from({ length: size }, () => Array<boolean>(size).fill(false)),\n reserved: Array.from({ length: size }, () => Array<boolean>(size).fill(false)),\n };\n}\n\nfunction setFunctionModule(grid: Grid, x: number, y: number, dark: boolean): void {\n grid.dark[y]![x] = dark;\n grid.reserved[y]![x] = true;\n}\n\n/**\n * Alignment-pattern centre coordinates for a version. ISO/IEC 18004 Annex E,\n * Table E.1.\n *\n * Computed rather than tabulated, which is Nayuki's approach and reproduces\n * every row of the table: the first centre is always 6, the last is always\n * size-7, and the rest are spaced evenly backwards from the last in an even\n * step. Version 32 is the one row the formula misses, and the spec's own table\n * is the authority there.\n */\nexport function alignmentPatternPositions(version: number): number[] {\n if (version === 1) return [];\n const count = Math.floor(version / 7) + 2;\n const step = version === 32 ? 26 : Math.ceil((version * 4 + 4) / (count * 2 - 2)) * 2;\n const positions = [6];\n for (let pos = version * 4 + 17 - 7; positions.length < count; pos -= step) {\n positions.splice(1, 0, pos);\n }\n return positions;\n}\n\n/**\n * The 15-bit format information for a level and mask. ISO/IEC 18004 §8.9.\n *\n * Five data bits, ten BCH(15,5) check bits over the generator 0b10100110111,\n * then XOR with 0b101010000010010 so that an all-zero format never produces an\n * all-zero pattern.\n */\nexport function formatInformation(ecc: QrErrorCorrection, mask: number): number {\n const data = (ECC_LEVELS[ecc].formatBits << 3) | mask;\n let remainder = data;\n for (let i = 0; i < 10; i++) remainder = (remainder << 1) ^ ((remainder >>> 9) * 0b10100110111);\n return ((data << 10) | remainder) ^ 0b101010000010010;\n}\n\n/**\n * The 18-bit version information for versions 7 and above. ISO/IEC 18004 §8.10.\n * Six data bits and twelve Golay(18,6) check bits over 0b1111100100101.\n */\nexport function versionInformation(version: number): number {\n let remainder = version;\n for (let i = 0; i < 12; i++) remainder = (remainder << 1) ^ ((remainder >>> 11) * 0b1111100100101);\n return (version << 12) | remainder;\n}\n\nfunction drawFormatBits(grid: Grid, ecc: QrErrorCorrection, mask: number): void {\n const bits = formatInformation(ecc, mask);\n // First copy, around the top-left finder.\n for (let i = 0; i <= 5; i++) setFunctionModule(grid, 8, i, bitAt(bits, i));\n setFunctionModule(grid, 8, 7, bitAt(bits, 6));\n setFunctionModule(grid, 8, 8, bitAt(bits, 7));\n setFunctionModule(grid, 7, 8, bitAt(bits, 8));\n for (let i = 9; i < 15; i++) setFunctionModule(grid, 14 - i, 8, bitAt(bits, i));\n // Second copy, split between the other two finders.\n for (let i = 0; i < 8; i++) setFunctionModule(grid, grid.size - 1 - i, 8, bitAt(bits, i));\n for (let i = 8; i < 15; i++) setFunctionModule(grid, 8, grid.size - 15 + i, bitAt(bits, i));\n // The module that is dark in every valid code. §8.9.\n setFunctionModule(grid, 8, grid.size - 8, true);\n}\n\nfunction drawVersionBits(grid: Grid, version: number): void {\n if (version < 7) return;\n const bits = versionInformation(version);\n for (let i = 0; i < 18; i++) {\n const dark = bitAt(bits, i);\n const along = grid.size - 11 + (i % 3);\n const across = Math.floor(i / 3);\n setFunctionModule(grid, along, across, dark);\n setFunctionModule(grid, across, along, dark);\n }\n}\n\n/** A finder pattern and its separator, centred on (x, y). §6.3.3. */\nfunction drawFinder(grid: Grid, x: number, y: number): void {\n for (let dy = -4; dy <= 4; dy++) {\n for (let dx = -4; dx <= 4; dx++) {\n const distance = Math.max(Math.abs(dx), Math.abs(dy));\n const px = x + dx;\n const py = y + dy;\n if (px < 0 || px >= grid.size || py < 0 || py >= grid.size) continue;\n // Rings at distance 0, 1 and 3 are dark; 2 is the light ring and 4 the\n // separator.\n setFunctionModule(grid, px, py, distance !== 2 && distance !== 4);\n }\n }\n}\n\n/** A 5x5 alignment pattern centred on (x, y). §6.3.6. */\nfunction drawAlignment(grid: Grid, x: number, y: number): void {\n for (let dy = -2; dy <= 2; dy++) {\n for (let dx = -2; dx <= 2; dx++) {\n setFunctionModule(grid, x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) !== 1);\n }\n }\n}\n\nfunction drawFunctionPatterns(grid: Grid, version: number, ecc: QrErrorCorrection): void {\n // Timing patterns first: the finders overwrite their own ends, which is what\n // the spec describes and what makes row and column 6 alternate cleanly\n // between the separators.\n for (let i = 0; i < grid.size; i++) {\n setFunctionModule(grid, 6, i, i % 2 === 0);\n setFunctionModule(grid, i, 6, i % 2 === 0);\n }\n\n drawFinder(grid, 3, 3);\n drawFinder(grid, grid.size - 4, 3);\n drawFinder(grid, 3, grid.size - 4);\n\n const positions = alignmentPatternPositions(version);\n const last = positions.length - 1;\n for (let i = 0; i <= last; i++) {\n for (let j = 0; j <= last; j++) {\n // The three corners already carry finder patterns.\n const isFinderCorner =\n (i === 0 && j === 0) || (i === 0 && j === last) || (i === last && j === 0);\n if (!isFinderCorner) drawAlignment(grid, positions[i]!, positions[j]!);\n }\n }\n\n // Drawn with mask 0 only to *reserve* the modules; the real bits are written\n // once a mask has been chosen.\n drawFormatBits(grid, ecc, 0);\n drawVersionBits(grid, version);\n}\n\n/**\n * Interleave the data codewords with their error correction. ISO/IEC 18004 §8.6.\n *\n * The blocks are not all the same length — the short ones are one codeword\n * shorter than the long ones — and the interleave takes one codeword from each\n * block in turn, skipping the short blocks' missing column. Nayuki's trick of\n * padding each short block with a zero and then skipping exactly that index is\n * reproduced here, because writing it as two loops instead is where an\n * off-by-one silently produces a code that only fails to scan for some inputs.\n */\nfunction addEccAndInterleave(\n data: readonly number[],\n version: number,\n ecc: QrErrorCorrection,\n): number[] {\n const { row } = ECC_LEVELS[ecc];\n const blockCount = ECC_BLOCKS[row]![version]!;\n const eccPerBlock = ECC_CODEWORDS_PER_BLOCK[row]![version]!;\n const rawCodewords = Math.floor(rawDataModules(version) / 8);\n const shortBlockCount = blockCount - (rawCodewords % blockCount);\n const shortBlockLength = Math.floor(rawCodewords / blockCount);\n\n const divisor = reedSolomonDivisor(eccPerBlock);\n const blocks: number[][] = [];\n for (let i = 0, taken = 0; i < blockCount; i++) {\n const length = shortBlockLength - eccPerBlock + (i < shortBlockCount ? 0 : 1);\n const block = data.slice(taken, taken + length);\n taken += block.length;\n const remainder = reedSolomonRemainder(block, divisor);\n // The placeholder that keeps every block the same length for the loop below.\n if (i < shortBlockCount) block.push(0);\n blocks.push(block.concat(remainder));\n }\n\n const result: number[] = [];\n for (let i = 0; i < blocks[0]!.length; i++) {\n blocks.forEach((block, index) => {\n if (i === shortBlockLength - eccPerBlock && index < shortBlockCount) return;\n result.push(block[i]!);\n });\n }\n return result;\n}\n\n/**\n * Lay the codeword stream into the grid. ISO/IEC 18004 §8.7.\n *\n * Two-module-wide columns, right to left, snaking up and down, skipping the\n * vertical timing column entirely.\n */\nfunction drawCodewords(grid: Grid, codewords: readonly number[]): void {\n let bit = 0;\n for (let right = grid.size - 1; right >= 1; right -= 2) {\n // Column 6 is the vertical timing pattern; the pairs shift left past it.\n if (right === 6) right = 5;\n for (let vertical = 0; vertical < grid.size; vertical++) {\n for (let column = 0; column < 2; column++) {\n const x = right - column;\n const upward = ((right + 1) & 2) === 0;\n const y = upward ? grid.size - 1 - vertical : vertical;\n if (grid.reserved[y]![x] || bit >= codewords.length * 8) continue;\n grid.dark[y]![x] = bitAt(codewords[bit >>> 3]!, 7 - (bit & 7));\n bit++;\n }\n }\n }\n}\n\n/**\n * Whether module (x, y) is inverted by mask `pattern`. ISO/IEC 18004 Table 23.\n *\n * Exported so the spec can reverse it: unmasking is how a matrix is read back.\n */\nexport function maskInverts(pattern: number, x: number, y: number): boolean {\n switch (pattern) {\n case 0:\n return (x + y) % 2 === 0;\n case 1:\n return y % 2 === 0;\n case 2:\n return x % 3 === 0;\n case 3:\n return (x + y) % 3 === 0;\n case 4:\n return (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0;\n case 5:\n return (((x * y) % 2) + ((x * y) % 3)) === 0;\n case 6:\n return ((((x * y) % 2) + ((x * y) % 3)) % 2) === 0;\n case 7:\n return ((((x + y) % 2) + ((x * y) % 3)) % 2) === 0;\n default:\n throw new RangeError(`qr: mask pattern ${pattern} is out of range`);\n }\n}\n\n/** XOR the mask over the data modules. Applying it twice undoes it. */\nfunction applyMask(grid: Grid, pattern: number): void {\n for (let y = 0; y < grid.size; y++) {\n for (let x = 0; x < grid.size; x++) {\n if (grid.reserved[y]![x]) continue;\n if (maskInverts(pattern, x, y)) grid.dark[y]![x] = !grid.dark[y]![x];\n }\n }\n}\n\n/**\n * Push a run length onto the finder-pattern history, and note whether the run\n * started at the edge of the symbol.\n *\n * The edge case is the subtle half of §8.8.2: the 1:1:3:1:1 pattern also counts\n * when it is bounded by the quiet zone rather than by a light run, so the first\n * run of every line is inflated by the symbol size to stand in for that.\n */\nfunction pushRun(history: number[], run: number, size: number): void {\n if (history[0] === 0) run += size;\n history.pop();\n history.unshift(run);\n}\n\n/** Whether the run history holds one or two finder-lookalikes. §8.8.2. */\nfunction finderLikeCount(history: readonly number[]): number {\n const n = history[1]!;\n const core =\n n > 0 && history[2] === n && history[3] === n * 3 && history[4] === n && history[5] === n;\n return (\n (core && history[0]! >= n * 4 && history[6]! >= n ? 1 : 0) +\n (core && history[6]! >= n * 4 && history[0]! >= n ? 1 : 0)\n );\n}\n\nfunction terminateRun(history: number[], runDark: boolean, run: number, size: number): number {\n if (runDark) {\n pushRun(history, run, size);\n run = 0;\n }\n run += size;\n pushRun(history, run, size);\n return finderLikeCount(history);\n}\n\n/**\n * The penalty score used to choose a mask. ISO/IEC 18004 §8.8.2.\n *\n * Four rules: runs of five or more, 2x2 blocks of one color, finder-lookalikes,\n * and the overall dark/light balance. The mask with the lowest total wins.\n */\nfunction penaltyScore(grid: Grid): number {\n const { size, dark } = grid;\n let score = 0;\n\n // Rule 1 and rule 3, along rows.\n for (let y = 0; y < size; y++) {\n let runDark = false;\n let run = 0;\n const history = [0, 0, 0, 0, 0, 0, 0];\n for (let x = 0; x < size; x++) {\n if (dark[y]![x] === runDark) {\n run++;\n if (run === 5) score += PENALTY_ADJACENT;\n else if (run > 5) score++;\n } else {\n pushRun(history, run, size);\n if (!runDark) score += finderLikeCount(history) * PENALTY_FINDER_LIKE;\n runDark = dark[y]![x]!;\n run = 1;\n }\n }\n score += terminateRun(history, runDark, run, size) * PENALTY_FINDER_LIKE;\n }\n\n // The same, down columns.\n for (let x = 0; x < size; x++) {\n let runDark = false;\n let run = 0;\n const history = [0, 0, 0, 0, 0, 0, 0];\n for (let y = 0; y < size; y++) {\n if (dark[y]![x] === runDark) {\n run++;\n if (run === 5) score += PENALTY_ADJACENT;\n else if (run > 5) score++;\n } else {\n pushRun(history, run, size);\n if (!runDark) score += finderLikeCount(history) * PENALTY_FINDER_LIKE;\n runDark = dark[y]![x]!;\n run = 1;\n }\n }\n score += terminateRun(history, runDark, run, size) * PENALTY_FINDER_LIKE;\n }\n\n // Rule 2: every 2x2 block of one color.\n for (let y = 0; y < size - 1; y++) {\n for (let x = 0; x < size - 1; x++) {\n const colour = dark[y]![x];\n if (\n colour === dark[y]![x + 1] &&\n colour === dark[y + 1]![x] &&\n colour === dark[y + 1]![x + 1]\n ) {\n score += PENALTY_BLOCK;\n }\n }\n }\n\n // Rule 4: how far the proportion of dark modules strays from 50%.\n let darkCount = 0;\n for (const row of dark) for (const module of row) if (module) darkCount++;\n const total = size * size;\n score += (Math.ceil(Math.abs(darkCount * 20 - total * 10) / total) - 1) * PENALTY_BALANCE;\n return score;\n}\n\n// ── Encoding ─────────────────────────────────────────────────────────────────\n\n/**\n * Encode a string into a module matrix.\n *\n * Deliberately *not* boosting the error-correction level to fill spare capacity.\n * ISO/IEC 18004 allows it and Nayuki's reference does it by default; `uqr`\n * disables it, and `@zag-js/qr-code` takes that default — so a code that quietly\n * upgraded itself from L to Q would be more robust, differently masked, and not\n * the code the other three libraries render.\n */\nexport function encodeQr(value: string, options: QrEncodeOptions = {}): QrMatrix {\n const ecc = options.ecc ?? \"L\";\n const border = options.border ?? 1;\n const segments = makeSegment(value);\n\n // The smallest version the data fits in.\n let version = MIN_VERSION;\n for (; ; version++) {\n if (totalBits(segments, version) <= dataCodewords(version, ecc) * 8) break;\n if (version >= MAX_VERSION) {\n throw new RangeError(`qr: ${value.length} characters do not fit at error correction ${ecc}`);\n }\n }\n\n // Mode indicator, character count and payload, then the terminator and pad.\n const bits: number[] = [];\n for (const segment of segments) {\n appendBits(bits, segment.mode[0], 4);\n appendBits(bits, segment.count, charCountBits(segment.mode, version));\n for (const bit of segment.bits) bits.push(bit);\n }\n const capacityBits = dataCodewords(version, ecc) * 8;\n // Up to four zero bits of terminator, then zeros to the next byte boundary.\n appendBits(bits, 0, Math.min(4, capacityBits - bits.length));\n appendBits(bits, 0, (8 - (bits.length % 8)) % 8);\n // §7.4.10's alternating pad bytes, 11101100 and 00010001.\n for (let pad = 0xec; bits.length < capacityBits; pad ^= 0xec ^ 0x11) appendBits(bits, pad, 8);\n\n const codewords = Array.from({ length: Math.ceil(bits.length / 8) }, () => 0);\n bits.forEach((bit, index) => {\n codewords[index >>> 3]! |= bit << (7 - (index & 7));\n });\n\n const grid = makeGrid(version * 4 + 17);\n drawFunctionPatterns(grid, version, ecc);\n drawCodewords(grid, addEccAndInterleave(codewords, version, ecc));\n\n // Every mask is tried and scored, because the spec says to and because the\n // other three libraries do: picking a fixed mask produces a valid code that\n // differs from theirs for the same string.\n let mask = 0;\n let best = Number.POSITIVE_INFINITY;\n for (let candidate = 0; candidate < 8; candidate++) {\n applyMask(grid, candidate);\n drawFormatBits(grid, ecc, candidate);\n const score = penaltyScore(grid);\n if (score < best) {\n best = score;\n mask = candidate;\n }\n applyMask(grid, candidate);\n }\n applyMask(grid, mask);\n drawFormatBits(grid, ecc, mask);\n\n return withBorder({ version, size: grid.size, mask, modules: grid.dark }, border);\n}\n\n/** Surround the symbol with `border` modules of quiet zone. */\nfunction withBorder(matrix: QrMatrix, border: number): QrMatrix {\n if (!border) return matrix;\n const size = matrix.size + border * 2;\n const blank = () => Array<boolean>(size).fill(false);\n const modules = matrix.modules.map((row) => [\n ...Array<boolean>(border).fill(false),\n ...row,\n ...Array<boolean>(border).fill(false),\n ]);\n for (let i = 0; i < border; i++) {\n modules.unshift(blank());\n modules.push(blank());\n }\n return { ...matrix, size, modules };\n}\n\n/**\n * The matrix as one SVG path, one square per dark module.\n *\n * The shape of each subpath — `M<x>,<y>h<n>v<n>h-<n>z` — and the row-major order\n * are the machine's, not a choice: the other three libraries publish exactly\n * this string, and `qr-encoder.spec.ts` compares it against theirs character for\n * character. A path built any other way would render the same code and fail that\n * comparison, which is the point of having it.\n */\nexport function qrPathData(matrix: QrMatrix, pixelSize: number): string {\n const parts: string[] = [];\n for (let row = 0; row < matrix.size; row++) {\n for (let column = 0; column < matrix.size; column++) {\n if (!matrix.modules[row]![column]) continue;\n const x = column * pixelSize;\n const y = row * pixelSize;\n parts.push(`M${x},${y}h${pixelSize}v${pixelSize}h-${pixelSize}z`);\n }\n }\n return parts.join(\"\");\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n DOCUMENT,\n ElementRef,\n TemplateRef,\n booleanAttribute,\n computed,\n inject,\n input,\n numberAttribute,\n} from \"@angular/core\";\nimport { qrCodeStyles, type QRCodeVariants } from \"@ui-organized/core\";\nimport { UioPart } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { encodeQr, qrPathData, type QrErrorCorrection } from \"./qr-encoder.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type QRCodeSize = NonNullable<QRCodeVariants[\"size\"]>;\nexport type QRCodeVariant = NonNullable<QRCodeVariants[\"variant\"]>;\n\nconst DEFAULT_PIXEL_SIZE = 10;\n\n/**\n * A scannable code for a string.\n *\n * ```html\n * <div uioQrCode value=\"https://ui-organized.dev\" [showDownload]=\"true\"></div>\n * ```\n *\n * ── The encoder is this package's own, and that is the whole story here ─────\n *\n * React, Svelte and Vue get their modules from `@zag-js/qr-code`, which bundles\n * `uqr`. Angular has no zag and takes no dependency beyond the CDK, so the\n * encoder is written out in `qr-encoder.ts` — including Reed-Solomon, automatic\n * mask selection and every function pattern. It is held to `uqr`'s output module\n * for module in `qr-encoder.spec.ts`, because a QR code that is merely *valid*\n * is not good enough: four libraries rendering four different valid codes for\n * the same string would be a worse failure than an unstyled one, and a silent\n * one.\n *\n * ── Which default the level actually is ─────────────────────────────────────\n *\n * `errorCorrection` is documented as defaulting to 'M' and does not: the other\n * three pass `encoding: undefined` when the prop is absent, and `uqr`'s own\n * default is 'L'. That is reproduced rather than corrected — the four libraries\n * have to render the same code — so the input's default is left undefined and\n * the encoder falls back to 'L'.\n *\n * ── The overlay is a template, not projected content ────────────────────────\n *\n * React takes a node, Svelte a snippet, Vue a slot. Angular's `<ng-content>`\n * cannot answer \"did the caller give me anything?\", and an always-rendered\n * overlay wrapper would put a bordered white box over the middle of every code.\n * A `TemplateRef` is the Angular way to hand a component markup it renders\n * itself, and its absence is a real answer. Same shape as `SplitterPanelDef`.\n */\n@Component({\n selector: \"div[uioQrCode]\",\n standalone: true,\n exportAs: \"uioQrCode\",\n imports: [NgTemplateOutlet, UioButton],\n template: `\n <!--\n The name lives on the frame, not the host. \"aria-label\" on an element with\n no role is prohibited — ARIA ignores it, so the code is announced as\n nothing at all — and the img role is what makes it legal. But it has to go\n on the element that *is* the image: the host also holds the download\n button, and an \"img\" may not contain a control. Same placement as the\n other three libraries.\n -->\n <svg\n data-scope=\"qr-code\"\n data-part=\"frame\"\n class=\"qr-code__frame\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n [id]=\"partId('frame')\"\n [attr.aria-label]=\"label() ?? value()\"\n [attr.viewBox]=\"viewBox()\"\n >\n <path data-scope=\"qr-code\" data-part=\"pattern\" class=\"qr-code__pattern\" [attr.d]=\"path()\" />\n </svg>\n @if (overlay(); as template) {\n <!--\n No id, matching Ark React. zag 1.43.3 gives this part one so that its\n getDataUrl can composite the logo into the exported PNG, and the older\n machine React bundles does not — see the allowance in the parity case.\n The download below rasterises the frame alone in every library.\n -->\n <div\n data-scope=\"qr-code\"\n data-part=\"overlay\"\n class=\"qr-code__overlay\"\n [attr.style]=\"OVERLAY_STYLE\"\n >\n <ng-container [ngTemplateOutlet]=\"template\" />\n </div>\n }\n @if (showDownload()) {\n <button\n uioButton\n intent=\"secondary\"\n type=\"button\"\n [icon]=\"glyph('download')\"\n data-scope=\"qr-code\"\n data-part=\"download-trigger\"\n [size]=\"size()\"\n (click)=\"download()\"\n >\n {{ downloadLabel() }}\n </button>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioQrCode extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"qr-code\";\n readonly part = \"root\";\n\n /** The string encoded into the code — a URL, an id, anything scannable. */\n readonly value = input(\"\");\n /** Accessible label for the code. Defaults to the encoded value. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Edge length of one module in pixels. A fractional module produces visible\n * moiré and can make the code unreadable, so it is rounded rather than\n * trusted.\n */\n readonly pixelSize = input(DEFAULT_PIXEL_SIZE, { transform: numberAttribute });\n /** Higher levels survive more damage, at the cost of a denser code. */\n readonly errorCorrection = input<QrErrorCorrection | undefined>(undefined);\n /** A logo or badge drawn over the centre. Only safe at high error correction. */\n readonly overlay = input<TemplateRef<unknown> | undefined>(undefined);\n readonly showDownload = input(false, { transform: booleanAttribute });\n readonly downloadLabel = input(\"Download\");\n /** File name for the download, without an extension. */\n readonly downloadFileName = input(\"qr-code\");\n readonly size = input<QRCodeSize>(\"md\");\n readonly variant = input<QRCodeVariant>(\"default\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n\n /**\n * Ark spells this machine's ids `qrcode:<machine>:<part>` — one word, where\n * the scope attribute is hyphenated. Reproduced rather than tidied: two DOM\n * trees are easier to read side by side when the literals have the same shape.\n */\n private readonly machine = nextMachineId();\n protected readonly rootId = `qrcode:${this.machine}:root`;\n protected partId(part: string): string {\n return `qrcode:${this.machine}:${part}`;\n }\n\n protected readonly hostClass = computed(() =>\n qrCodeStyles({ size: this.size(), variant: this.variant() }),\n );\n\n /** Ark's inline style on the overlay, reproduced so the logo centres itself. */\n protected readonly OVERLAY_STYLE =\n \"position: absolute; top: 50%; left: 50%; translate: -50% -50%;\";\n\n private readonly modules = computed(() =>\n encodeQr(this.value(), { ecc: this.errorCorrection() ?? \"L\" }),\n );\n private readonly moduleSize = computed(() => Math.max(1, Math.round(this.pixelSize())));\n private readonly extent = computed(() => this.modules().size * this.moduleSize());\n\n protected readonly path = computed(() => qrPathData(this.modules(), this.moduleSize()));\n protected readonly viewBox = computed(() => `0 0 ${this.extent()} ${this.extent()}`);\n\n /**\n * The geometry the machine publishes to CSS, and `position: relative` so the\n * overlay has something to centre against.\n *\n * `QRCode.css` reads none of these — it sizes the frame from its own\n * `--qr-size` — but they are part of what the component publishes in the other\n * three libraries, and a consumer positioning something over the code has\n * nothing else to measure from.\n */\n protected readonly rootStyle = computed(\n () =>\n `--qrcode-pixel-size: ${this.moduleSize()}px; --qrcode-width: ${this.extent()}px; ` +\n `--qrcode-height: ${this.extent()}px; position: relative;`,\n );\n\n /**\n * Rasterise the frame and hand it to the browser as a download.\n *\n * The SVG is serialised, drawn into a canvas at device-pixel resolution and\n * exported as a PNG — the same route `@zag-js/dom-query`'s `getDataUrl` takes,\n * including the white fill, without which a PNG of a code whose ink is a theme\n * token comes out as dark-on-transparent and renders black-on-black wherever\n * it is pasted.\n *\n * Everything after `image.onload` is one frame later, which is why this is not\n * a signal: there is no rendered state to hold, only a side effect.\n */\n download(): void {\n const frame = this.host.nativeElement.querySelector(\"svg\");\n if (!frame) return;\n const box = frame.getBoundingClientRect();\n const source = new XMLSerializer().serializeToString(frame);\n const svgUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`;\n\n const ratio = this.document.defaultView?.devicePixelRatio || 1;\n const canvas = this.document.createElement(\"canvas\");\n canvas.width = Math.max(1, box.width * ratio);\n canvas.height = Math.max(1, box.height * ratio);\n const context = canvas.getContext(\"2d\");\n if (!context) return;\n\n const image = new Image();\n image.onload = () => {\n context.fillStyle = \"white\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.drawImage(image, 0, 0, canvas.width, canvas.height);\n const anchor = this.document.createElement(\"a\");\n anchor.href = canvas.toDataURL(\"image/png\");\n anchor.rel = \"noopener\";\n anchor.download = `${this.downloadFileName()}.png`;\n anchor.click();\n anchor.remove();\n };\n image.src = svgUrl;\n }\n}\n","import { addDays, addMonths, ymdToDate, type YMD } from \"@ui-organized/core\";\n\n/**\n * Where a key press moves the calendar's roving focus, before any clamping.\n *\n * Split out of the component because the grid is the one part of `UioCalendar`\n * the parity gate is blind to: `tabindex` is not a contract attribute, so a port\n * whose arrows moved by the wrong amount would render an identical DOM and fail\n * nothing. `input()` is invisible to the JIT compiler the specs run under, so a\n * TestBed fixture cannot drive `min`/`max` either — a pure function can be\n * driven by anything.\n *\n * `null` means \"not a navigation key\", which the caller must pass through rather\n * than swallow; Enter and Space are handled separately because they select\n * rather than move.\n *\n * ── PageUp/PageDown land on the 1st, and that is not a bug here ─────────────\n *\n * Both reuse `addMonths`, whose documented contract is \"add whole months,\n * landing on the first of the resulting month\" — so paging from the 15th of\n * March reaches April 1st rather than April 15th. React, Svelte and Vue all do\n * exactly this, from the same helper. Reproduced deliberately: a port that\n * \"fixed\" it would be the only one of four that moved focus somewhere else, and\n * the gate cannot see focus. If it is ever changed it has to change in\n * `@ui-organized/core` for all four at once.\n */\nexport function calendarKeyTarget(\n key: string,\n focused: YMD,\n weekStartsOn: number,\n): YMD | null {\n // The focused day's column, counted from whichever day the week starts on —\n // which is what makes Home/End land on the ends of *this* week rather than on\n // Sunday and Saturday.\n const weekday = (ymdToDate(focused).getDay() - weekStartsOn + 7) % 7;\n switch (key) {\n case \"ArrowLeft\":\n return addDays(focused, -1);\n case \"ArrowRight\":\n return addDays(focused, 1);\n case \"ArrowUp\":\n return addDays(focused, -7);\n case \"ArrowDown\":\n return addDays(focused, 7);\n case \"Home\":\n return addDays(focused, -weekday);\n case \"End\":\n return addDays(focused, 6 - weekday);\n case \"PageUp\":\n return addMonths(focused, -1);\n case \"PageDown\":\n return addMonths(focused, 1);\n default:\n return null;\n }\n}\n","import {\n ApplicationRef,\n Component,\n DOCUMENT,\n ElementRef,\n OnDestroy,\n OnInit,\n computed,\n inject,\n input,\n output,\n signal,\n} from \"@angular/core\";\nimport {\n clampYMD,\n compareYMD,\n isSameMonth,\n isSameYMD,\n isWithin,\n monthGrid,\n monthLabel,\n monthName,\n addMonths,\n startOfMonth,\n toISODate,\n todayYMD,\n weekdayLabels,\n ymdToDate,\n selectFieldStyles,\n type YMD,\n} from \"@ui-organized/core\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { nextMachineId, VISUALLY_HIDDEN_INPUT } from \"../part-ids.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { restoreFocus } from \"../overlay/focus.js\";\nimport { moveHighlight } from \"../overlay/roving.js\";\nimport { applyOverlayStacking } from \"../overlay/stacking.js\";\nimport { stateFlag } from \"../part.js\";\nimport { calendarKeyTarget } from \"./calendar-keys.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\n/** The start and end of a range selection; either end may be missing. */\nexport interface CalendarRange {\n start: YMD | null;\n end: YMD | null;\n}\n\n/**\n * A day cell, fully resolved.\n *\n * Every attribute is decided here rather than in the template, because each one\n * is a small expression over five signals and the template would evaluate all of\n * them again on every change-detection pass, for 42 cells per month. Resolving\n * into a memoised `computed()` means the grid is rebuilt when a signal it reads\n * changes and not otherwise.\n *\n * The flags are `\"true\"` or `null`, not `\"\"` or `null`. That is the one place in\n * this package where {@link stateFlag} is the wrong encoding: `Calendar` is\n * hand-written in all four libraries rather than emitted by a Zag machine, and\n * the other three write `data-selected={selected || undefined}` — which React,\n * Svelte and Vue all render as the string `\"true\"`. The stylesheet only tests\n * presence, but the parity gate compares the value.\n */\ninterface DayCell {\n ymd: YMD;\n iso: string;\n day: number;\n ariaLabel: string;\n disabled: boolean;\n tabIndex: number;\n outside: \"true\" | null;\n today: \"true\" | null;\n selected: \"true\" | null;\n rangeLo: \"true\" | null;\n rangeHi: \"true\" | null;\n inRange: \"true\" | null;\n ariaSelected: \"true\" | null;\n ariaCurrent: \"date\" | null;\n}\n\n/** The ids one year `Select` in the header needs, allocated once per pane. */\ninterface YearIds {\n field: string;\n select: string;\n label: string;\n control: string;\n trigger: string;\n positioner: string;\n content: string;\n}\n\ninterface MonthPane {\n key: string;\n index: number;\n anchor: YMD;\n name: string;\n label: string;\n /** The visible year as text — a `<select>`'s `value` is a string, not a number. */\n year: string;\n weeks: DayCell[][];\n ids: YearIds;\n}\n\n/** One entry in the year dropdown, with the string form both bindings need. */\ninterface YearOption {\n year: number;\n text: string;\n}\n\n/** `monthGrid`'s flat run of days, split into the weeks it already represents. */\nfunction weeksOf<T>(cells: T[]): T[][] {\n const weeks: T[][] = [];\n for (let i = 0; i < cells.length; i += 7) weeks.push(cells.slice(i, i + 7));\n return weeks;\n}\n\nfunction orderedPair(a: YMD, b: YMD): [YMD, YMD] {\n return compareYMD(a, b) <= 0 ? [a, b] : [b, a];\n}\n\nconst flagged = (on: boolean): \"true\" | null => (on ? \"true\" : null);\n\n/** Icons in the header follow the small control size, as the ghost Select does. */\nconst HEADER_ICON_SIZE = 16;\n\n/** The gap Ark's Select leaves between its trigger and its popup. */\nconst YEAR_POPUP_GUTTER = 4;\n\n/**\n * Parked off-screen rather than merely `hidden`.\n *\n * `.select-popup` declares `display: flex`, which overrides the `hidden`\n * attribute — a closed listbox stays laid out, keeps its size, and swallows\n * clicks over the grid behind it. Zag moves the positioner a viewport out of the\n * way for exactly this reason; the same two properties do it here.\n */\nconst PARKED = \"translate3d(0px, -100vh, 0px)\";\n\n/**\n * The design-system calendar grid, shared by the date fields' popover.\n *\n * Internal: it is not exported from the package barrel and has no parity case,\n * because it has no public DOM contract of its own — every pixel of it reaches a\n * user through DateInput, DateTimeInput or DateRangeInput.\n *\n * ── The year Select is written out here, and that is the notable difference ──\n *\n * React, Svelte and Vue all render the design system's own `Select` in the\n * header and hand it `portalContainer={calendarRoot}`, so its popup lands inside\n * the calendar's subtree rather than in `document.body`. That is not cosmetic: a\n * popup in the body is *outside* the enclosing date popover, so clicking an\n * option reads as an outside interaction and dismisses the whole calendar under\n * the user's cursor.\n *\n * `UioSelect` has no equivalent input, and it could not simply grow one: it\n * builds a CDK overlay, and a CDK overlay carries a container and a pane —\n * two elements the other three libraries do not render, sitting inside the\n * subtree the parity gate compares cell by cell. So the header's Select is\n * written out here instead, as the same DOM `UioSelect` produces, with its\n * positioner as a plain child of the calendar root. The behaviour it keeps is\n * the behaviour this component needs: open, choose, dismiss, and roving\n * highlight. Anything richer belongs in `UioSelect`, and a caller who wants that\n * is not inside a calendar.\n */\n@Component({\n selector: \"div[uioCalendar]\",\n standalone: true,\n exportAs: \"uioCalendar\",\n imports: [UioButton, UioIcon],\n host: {\n class: \"calendar\",\n // The containing block the header's year popup is positioned against. The\n // grid is all in-flow, so nothing else in the calendar is affected.\n \"[style.position]\": \"'relative'\",\n \"(mouseleave)\": \"hover.set(null)\",\n },\n template: `\n <div class=\"calendar__header\">\n <button\n uioButton\n intent=\"ghost\"\n size=\"sm\"\n [icon]=\"glyph('chevron-left')\"\n class=\"calendar__nav\"\n aria-label=\"Previous month\"\n [disabled]=\"prevDisabled()\"\n (click)=\"page(-1)\"\n ></button>\n <div class=\"calendar__labels\">\n @for (pane of panes(); track pane.key) {\n <div class=\"calendar__label\">\n <span class=\"calendar__month-name text-emphasis-body-large\">{{ pane.name }}</span>\n <div\n role=\"group\"\n data-scope=\"field\"\n data-part=\"root\"\n [class]=\"yearFieldClass\"\n [id]=\"pane.ids.field\"\n >\n <div\n class=\"select-field__control\"\n data-scope=\"select\"\n data-part=\"root\"\n [id]=\"pane.ids.select\"\n >\n <label\n class=\"select-field__label--hidden\"\n data-scope=\"select\"\n data-part=\"label\"\n [id]=\"pane.ids.label\"\n [attr.for]=\"pane.ids.control\"\n >Year, {{ pane.name }}</label\n >\n <button\n class=\"select-field__trigger text-default-body-large\"\n data-scope=\"select\"\n data-part=\"trigger\"\n type=\"button\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-invalid=\"false\"\n aria-required=\"false\"\n [id]=\"pane.ids.trigger\"\n [attr.data-state]=\"yearState(pane.index)\"\n [attr.aria-expanded]=\"openYear() === pane.index ? 'true' : 'false'\"\n [attr.aria-labelledby]=\"pane.ids.label\"\n [attr.aria-controls]=\"openYear() === pane.index ? pane.ids.content : null\"\n [attr.data-placement]=\"yearPlacement(pane.key)\"\n [attr.data-side]=\"yearSide(pane.key)\"\n (click)=\"toggleYear(pane)\"\n >\n <span class=\"select-field__value\" data-scope=\"select\" data-part=\"value-text\">{{\n pane.anchor.year\n }}</span>\n <div\n class=\"select-field__icon\"\n data-scope=\"select\"\n data-part=\"indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"yearState(pane.index)\"\n >\n <span uioIcon [name]=\"glyph('chevron-down')\" [size]=\"HEADER_ICON_SIZE\"></span>\n </div>\n </button>\n <!--\n The control a form would submit, and what the label names. The\n calendar never submits anything, but Ark's Select renders one\n and the four libraries render the same tree.\n -->\n <select\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [id]=\"pane.ids.control\"\n [attr.style]=\"HIDDEN\"\n [attr.aria-labelledby]=\"pane.ids.label\"\n [value]=\"pane.year\"\n >\n @for (option of yearOptions(); track option.year) {\n <option [value]=\"option.text\">{{ option.text }}</option>\n }\n </select>\n </div>\n </div>\n </div>\n }\n </div>\n <button\n uioButton\n intent=\"ghost\"\n size=\"sm\"\n [icon]=\"glyph('chevron-right')\"\n class=\"calendar__nav\"\n aria-label=\"Next month\"\n [disabled]=\"nextDisabled()\"\n (click)=\"page(1)\"\n ></button>\n </div>\n\n <div class=\"calendar__months\">\n @for (pane of panes(); track pane.key) {\n <div class=\"calendar__month\">\n <div class=\"calendar__weekdays\" aria-hidden=\"true\">\n @for (weekday of weekdays(); track $index) {\n <span class=\"calendar__weekday text-default-body-small\">{{ weekday }}</span>\n }\n </div>\n <!--\n Weeks are real rows. A grid may only own rows, and a gridcell may\n only sit in one — a flat run of 42 day buttons under role=\"grid\" is\n neither. 'monthGrid' always returns six whole weeks, so the chunking\n is exact.\n\n The grid itself is not a tab stop: focus lives on the day buttons,\n one of which always carries tabindex=0 (roving focus).\n -->\n <div\n class=\"calendar__grid\"\n role=\"grid\"\n [attr.aria-label]=\"pane.label\"\n (keydown)=\"onGridKeydown($event)\"\n >\n @for (week of pane.weeks; track week[0]!.iso) {\n <div class=\"calendar__week\" role=\"row\">\n @for (cell of week; track cell.iso) {\n <button\n class=\"calendar__day\"\n type=\"button\"\n role=\"gridcell\"\n [attr.tabindex]=\"cell.tabIndex\"\n [disabled]=\"cell.disabled\"\n [attr.aria-label]=\"cell.ariaLabel\"\n [attr.aria-selected]=\"cell.ariaSelected\"\n [attr.aria-current]=\"cell.ariaCurrent\"\n [attr.data-outside]=\"cell.outside\"\n [attr.data-today]=\"cell.today\"\n [attr.data-selected]=\"cell.selected\"\n [attr.data-range-lo]=\"cell.rangeLo\"\n [attr.data-range-hi]=\"cell.rangeHi\"\n [attr.data-in-range]=\"cell.inRange\"\n (click)=\"onDayClick(cell.ymd)\"\n (mouseenter)=\"onDayHover(cell.ymd)\"\n (focus)=\"focused.set(cell.ymd)\"\n >\n <span class=\"calendar__day-label text-default-body-large\">{{ cell.day }}</span>\n </button>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <!--\n The year popups, as plain children of the calendar root — which is where\n the other three libraries portal theirs. See the class comment.\n -->\n @for (pane of panes(); track pane.key) {\n <div\n class=\"select-positioner\"\n data-scope=\"select\"\n data-part=\"positioner\"\n style=\"position: absolute; top: 0; left: 0; min-width: max-content; pointer-events: none; transform: translate3d(0px, -100vh, 0px);\"\n [id]=\"pane.ids.positioner\"\n >\n <div\n class=\"select-popup select-popup--ghost\"\n data-scope=\"select\"\n data-part=\"content\"\n role=\"listbox\"\n tabindex=\"0\"\n [id]=\"pane.ids.content\"\n [attr.data-state]=\"yearState(pane.index)\"\n [attr.hidden]=\"openYear() === pane.index ? null : ''\"\n [attr.aria-labelledby]=\"pane.ids.label\"\n [attr.data-placement]=\"yearPlacement(pane.key)\"\n [attr.data-side]=\"yearSide(pane.key)\"\n [attr.aria-activedescendant]=\"activeYearOption(pane)\"\n [attr.data-activedescendant]=\"activeYearOption(pane)\"\n (keydown)=\"onYearKeydown($event, pane.index)\"\n >\n @for (option of yearOptions(); track option.year) {\n <div\n class=\"select-popup__item text-default-body-large\"\n data-scope=\"select\"\n data-part=\"item\"\n role=\"option\"\n [id]=\"yearOptionId(pane, option.year)\"\n [attr.data-value]=\"option.text\"\n [attr.aria-selected]=\"option.year === pane.anchor.year ? 'true' : 'false'\"\n [attr.data-state]=\"option.year === pane.anchor.year ? 'checked' : 'unchecked'\"\n [attr.data-highlighted]=\"highlightedFlag(pane.index, option.year)\"\n (click)=\"chooseYear(pane.index, option.year)\"\n (pointermove)=\"highlightedYear.set(option.year)\"\n >\n <span\n data-scope=\"select\"\n data-part=\"item-text\"\n [attr.data-state]=\"option.year === pane.anchor.year ? 'checked' : 'unchecked'\"\n [attr.data-highlighted]=\"highlightedFlag(pane.index, option.year)\"\n >{{ option.text }}</span\n >\n <div\n class=\"select-popup__item-indicator\"\n data-scope=\"select\"\n data-part=\"item-indicator\"\n aria-hidden=\"true\"\n [attr.data-state]=\"option.year === pane.anchor.year ? 'checked' : 'unchecked'\"\n [attr.hidden]=\"option.year === pane.anchor.year ? null : ''\"\n >\n <span uioIcon [name]=\"glyph('check')\" [size]=\"HEADER_ICON_SIZE\"></span>\n </div>\n </div>\n }\n </div>\n </div>\n }\n `,\n})\nexport class UioCalendar implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n /** \"single\" selects one day; \"range\" selects a start-to-end pair. */\n readonly mode = input<\"single\" | \"range\">(\"single\");\n /** Selected day in single mode. */\n readonly value = input<YMD | null>(null);\n /** Selected range in range mode. */\n readonly rangeValue = input<CalendarRange | null>(null);\n readonly min = input<YMD | null>(null);\n readonly max = input<YMD | null>(null);\n /** Number of months shown side by side. */\n readonly numMonths = input(1);\n /** First day of the week: 0 = Sunday (default), 1 = Monday. */\n readonly weekStartsOn = input(0);\n\n /** The chosen day, in single mode. */\n readonly daySelect = output<YMD>();\n /** The updated range, in range mode. */\n readonly rangeChange = output<CalendarRange>();\n /** Both ends of a range have been chosen; the caller may close. */\n readonly rangeComplete = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n\n private readonly today = todayYMD();\n\n /**\n * Where the calendar opens. Seeded in `ngOnInit` and never again.\n *\n * `ngOnInit` rather than a field initialiser because that is the first moment\n * the inputs are bound — a signal input read in the constructor answers with\n * its default, so a calendar opened on a selected day would always open on\n * today. And *once* rather than reactively, because recomputing would drag the\n * view back to the selected month every time the value changed under a user\n * who had paged away — which is exactly what happens when a range's first end\n * is chosen.\n */\n private readonly viewMonth = signal<YMD>(startOfMonth(this.today));\n protected readonly focused = signal<YMD>(this.today);\n protected readonly hover = signal<YMD | null>(null);\n\n protected readonly openYear = signal<number | null>(null);\n protected readonly highlightedYear = signal<number | null>(null);\n /**\n * Which panes' popups have been positioned at least once.\n *\n * `data-placement` and `data-side` are sticky in Ark — they appear the first\n * time a popup opens and stay after it closes — and a trigger claiming a side\n * before anything has been placed is a difference the stylesheet can see.\n *\n * Keyed by the *month*, not by the pane's position. Choosing a year moves the\n * view, which changes every pane's key, and the other three libraries key\n * their `Select` the same way — so the replacement Select has never been\n * opened and reports no placement. Tracking by index would leave the attribute\n * on a control that had just been remounted.\n */\n private readonly placed = signal<ReadonlySet<string>>(new Set());\n\n protected readonly HIDDEN = VISUALLY_HIDDEN_INPUT;\n protected readonly HEADER_ICON_SIZE = HEADER_ICON_SIZE;\n protected readonly yearFieldClass = selectFieldStyles({ size: \"sm\", variant: \"ghost\" });\n\n /** Allocated lazily and kept, so a pane's ids survive paging and re-render. */\n private readonly yearIdCache: YearIds[] = [];\n\n protected readonly months = computed(() =>\n Array.from({ length: this.numMonths() }, (_, i) => addMonths(this.viewMonth(), i)),\n );\n\n private readonly lastVisible = computed(() => addMonths(this.viewMonth(), this.numMonths() - 1));\n\n protected readonly weekdays = computed(() => weekdayLabels(this.weekStartsOn()));\n\n /** Can't page earlier than the month containing `min`, nor later than `max`. */\n protected readonly prevDisabled = computed(() => {\n const min = this.min();\n return min ? compareYMD(this.viewMonth(), startOfMonth(min)) <= 0 : false;\n });\n protected readonly nextDisabled = computed(() => {\n const max = this.max();\n return max ? compareYMD(startOfMonth(this.lastVisible()), startOfMonth(max)) >= 0 : false;\n });\n\n /**\n * Year options: bounded by min/max when set, else a wide default window,\n * always widened to include every visible year.\n */\n protected readonly years = computed(() => {\n const min = this.min();\n const max = this.max();\n const base = this.today.year;\n const lo = Math.min(min ? min.year : base - 100, this.viewMonth().year);\n const hi = Math.max(max ? max.year : base + 10, this.lastVisible().year);\n const out: number[] = [];\n for (let year = lo; year <= hi; year++) out.push(year);\n return out;\n });\n\n protected readonly yearOptions = computed((): YearOption[] =>\n this.years().map((year) => ({ year, text: String(year) })),\n );\n\n /**\n * The active range endpoints, resolved from *either* the committed range or\n * the start-to-hover preview, so the in-range band renders the same either way.\n */\n private readonly band = computed((): { lo: YMD | null; hi: YMD | null } => {\n if (this.mode() !== \"range\") return { lo: null, hi: null };\n const start = this.rangeValue()?.start ?? null;\n if (!start) return { lo: null, hi: null };\n const other = (this.rangeValue()?.end ?? null) ?? this.hover();\n if (!other) return { lo: null, hi: null };\n const [lo, hi] = orderedPair(start, other);\n return { lo, hi };\n });\n\n protected readonly panes = computed((): MonthPane[] => {\n const mode = this.mode();\n const value = this.value();\n const start = this.rangeValue()?.start ?? null;\n const end = this.rangeValue()?.end ?? null;\n const { lo, hi } = this.band();\n const min = this.min();\n const max = this.max();\n const focused = this.focused();\n const weekStartsOn = this.weekStartsOn();\n\n return this.months().map((anchor, index) => {\n const cells = monthGrid(anchor.year, anchor.month, weekStartsOn).map((d): DayCell => {\n const isLo = !!lo && isSameYMD(d, lo);\n const isHi = !!hi && isSameYMD(d, hi);\n const endpoint =\n mode === \"range\" && (isSameYMD(d, start) || isSameYMD(d, end) || isLo || isHi);\n const selected = (mode === \"single\" && isSameYMD(d, value)) || endpoint;\n const banded = !!lo && !!hi && !isSameYMD(lo, hi);\n return {\n ymd: d,\n iso: toISODate(d),\n day: d.day,\n ariaLabel: ymdToDate(d).toLocaleDateString(undefined, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n }),\n disabled: !isWithin(d, min, max),\n tabIndex: isSameYMD(d, focused) ? 0 : -1,\n outside: flagged(!isSameMonth(d, anchor)),\n today: flagged(isSameYMD(d, this.today)),\n selected: flagged(selected),\n rangeLo: flagged(isLo && banded),\n rangeHi: flagged(isHi && banded),\n inRange:\n flagged(!!lo && !!hi && compareYMD(d, lo) > 0 && compareYMD(d, hi) < 0),\n ariaSelected: flagged(selected),\n ariaCurrent: isSameYMD(d, this.today) ? \"date\" : null,\n };\n });\n\n return {\n key: `${anchor.year}-${anchor.month}`,\n index,\n anchor,\n name: monthName(anchor.year, anchor.month),\n label: monthLabel(anchor.year, anchor.month),\n year: String(anchor.year),\n weeks: weeksOf(cells),\n ids: this.yearIds(index),\n };\n });\n });\n\n private readonly yearLayer: DismissibleLayer = {\n surface: () => this.yearPositioner(this.openYear()),\n trigger: () => this.yearTrigger(this.openYear()),\n dismiss: () => this.closeYear(),\n };\n\n ngOnInit(): void {\n const anchor =\n (this.mode() === \"single\" ? this.value() : (this.rangeValue()?.start ?? null)) ??\n clampYMD(this.today, this.min(), this.max());\n this.viewMonth.set(startOfMonth(anchor));\n this.focused.set(anchor);\n }\n\n ngOnDestroy(): void {\n // A calendar torn down with its year list open would otherwise leave a layer\n // on the dismissal stack, and every later Escape would reach it first.\n removeLayer(this.yearLayer);\n }\n\n /**\n * The day the popover should focus when it opens.\n *\n * Read off the DOM rather than tracked, because the element the roving\n * `tabindex` is on *is* the answer, and it is the same one the caller would\n * have to look up anyway.\n */\n activeDayElement(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('.calendar__day[tabindex=\"0\"]');\n }\n\n protected page(delta: number): void {\n this.viewMonth.set(addMonths(this.viewMonth(), delta));\n // A discrete interaction, so the grid catches up before the click returns —\n // see `flushNow`, and `write` in `UioDateFieldBase` for the same reason.\n flushNow(this.appRef);\n }\n\n protected onDayClick(day: YMD): void {\n this.focused.set(day);\n this.selectDay(day);\n }\n\n protected onDayHover(day: YMD): void {\n const range = this.rangeValue();\n if (this.mode() === \"range\" && range?.start && !range.end) this.hover.set(day);\n }\n\n protected onGridKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.selectDay(this.focused());\n return;\n }\n const target = calendarKeyTarget(event.key, this.focused(), this.weekStartsOn());\n if (!target) return;\n event.preventDefault();\n this.moveFocus(clampYMD(target, this.min(), this.max()));\n }\n\n private selectDay(day: YMD): void {\n if (!isWithin(day, this.min(), this.max())) return;\n if (this.mode() === \"single\") {\n this.daySelect.emit(day);\n return;\n }\n const start = this.rangeValue()?.start ?? null;\n const end = this.rangeValue()?.end ?? null;\n if (!start || end || compareYMD(day, start) < 0) {\n this.rangeChange.emit({ start: day, end: null });\n } else {\n this.rangeChange.emit({ start, end: day });\n this.rangeComplete.emit();\n }\n }\n\n /**\n * Roving focus, moved only by the keyboard.\n *\n * The view may page here, which re-renders every button, so the DOM has to\n * catch up before the new node can be focused — hence the flush. Hover and\n * render never call this: opening the popup must not yank focus around.\n */\n private moveFocus(next: YMD): void {\n this.focused.set(next);\n this.ensureVisible(next);\n flushNow(this.appRef);\n this.activeDayElement()?.focus({ preventScroll: true });\n }\n\n private ensureVisible(day: YMD): void {\n const view = this.viewMonth();\n const last = this.lastVisible();\n if (compareYMD(day, view) < 0) {\n this.viewMonth.set(startOfMonth(day));\n } else if (compareYMD(day, { ...last, day: 31 }) > 0) {\n this.viewMonth.set(startOfMonth(addMonths(day, -(this.numMonths() - 1))));\n }\n }\n\n // ── The header's year Select ───────────────────────────────────────────────\n\n /**\n * Allocated on first use and kept, so a pane's ids survive paging.\n *\n * Called from `panes()`, which is a computed — the cache write is the only\n * side effect in it, and it is idempotent, so a recompute cannot renumber a\n * control that is already on screen.\n */\n private yearIds(index: number): YearIds {\n while (this.yearIdCache.length <= index) {\n const field = nextMachineId();\n const select = nextMachineId();\n this.yearIdCache.push({\n field: `field:${field}`,\n select: `select:${select}`,\n label: `field:${field}:label`,\n control: `field:${field}:control`,\n trigger: `select:${select}:trigger`,\n positioner: `select:${select}:positioner`,\n content: `select:${select}:content`,\n });\n }\n return this.yearIdCache[index]!;\n }\n\n protected yearOptionId(pane: MonthPane, year: number): string {\n return `${pane.ids.select}:option:${year}`;\n }\n\n protected yearState(index: number): \"open\" | \"closed\" {\n return this.openYear() === index ? \"open\" : \"closed\";\n }\n\n protected yearPlacement(key: string): string | null {\n return this.placed().has(key) ? \"bottom-start\" : null;\n }\n\n protected yearSide(key: string): string | null {\n return this.placed().has(key) ? \"bottom\" : null;\n }\n\n protected highlightedFlag(index: number, year: number): \"\" | null {\n return stateFlag(this.openYear() === index && this.highlightedYear() === year);\n }\n\n protected activeYearOption(pane: MonthPane): string | null {\n if (this.openYear() !== pane.index) return null;\n const year = this.highlightedYear();\n return year === null ? null : this.yearOptionId(pane, year);\n }\n\n protected toggleYear(pane: MonthPane): void {\n const index = pane.index;\n if (this.openYear() === index) {\n this.closeYear();\n return;\n }\n this.openYear.set(index);\n this.highlightedYear.set(pane.anchor.year);\n this.placed.update((current) => new Set(current).add(pane.key));\n // Before measuring: while it was parked the popup carried a transform, and\n // the attributes that say it is open have not reached the DOM yet.\n flushNow(this.appRef);\n this.positionYear(index);\n pushLayer(this.document, this.yearLayer);\n this.yearContent(index)?.focus({ preventScroll: true });\n }\n\n protected chooseYear(index: number, year: number): void {\n const targetMonth = addMonths(this.viewMonth(), index).month;\n const view = addMonths({ year, month: targetMonth, day: 1 }, -index);\n this.viewMonth.set(view);\n this.focused.set(clampYMD(startOfMonth(view), this.min(), this.max()));\n this.closeYear();\n }\n\n protected onYearKeydown(event: KeyboardEvent, index: number): void {\n const years = this.years();\n const navigable = years.map(() => ({ disabled: false }));\n const current = years.indexOf(this.highlightedYear() ?? Number.NaN);\n\n const move = (step: number) => {\n const next = years[moveHighlight(navigable, current, step)];\n if (next !== undefined) this.highlightedYear.set(next);\n event.preventDefault();\n };\n\n switch (event.key) {\n case \"ArrowDown\":\n return move(1);\n case \"ArrowUp\":\n return move(-1);\n case \"Home\":\n this.highlightedYear.set(null);\n return move(1);\n case \"End\":\n this.highlightedYear.set(null);\n return move(-1);\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const year = years[current];\n if (year !== undefined) this.chooseYear(index, year);\n return;\n }\n case \"Tab\":\n this.closeYear();\n return;\n default:\n return;\n }\n }\n\n private closeYear(): void {\n const index = this.openYear();\n if (index === null) return;\n this.openYear.set(null);\n this.highlightedYear.set(null);\n removeLayer(this.yearLayer);\n flushNow(this.appRef);\n this.parkYear(index);\n restoreFocus(this.yearTrigger(index));\n }\n\n /**\n * The header trigger and the popup are in two different places in the tree —\n * the trigger inside its month label, the popup a direct child of the root —\n * so they are found by their own position rather than by a shared ancestor.\n */\n private yearTrigger(index: number | null): HTMLElement | null {\n if (index === null) return null;\n const label = this.host.nativeElement.querySelectorAll<HTMLElement>(\".calendar__label\")[index];\n return label?.querySelector<HTMLElement>('[data-part=\"trigger\"]') ?? null;\n }\n\n private yearPositioner(index: number | null): HTMLElement | null {\n if (index === null) return null;\n return (\n this.host.nativeElement.querySelectorAll<HTMLElement>(\":scope > .select-positioner\")[index] ??\n null\n );\n }\n\n private yearContent(index: number | null): HTMLElement | null {\n return this.yearPositioner(index)?.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null;\n }\n\n /**\n * Place the popup under its trigger, in the calendar's own coordinates.\n *\n * The other three libraries get this from zag's popper, which writes a fixed\n * position onto the positioner. A fixed position is wrong here: the calendar\n * sits inside a CDK overlay pane that carries a transform, which becomes the\n * containing block for any fixed descendant. Measuring against the calendar\n * root and positioning absolutely inside it is the same placement and follows\n * the popover if it ever moves.\n */\n private positionYear(index: number): void {\n const positioner = this.yearPositioner(index);\n const trigger = this.yearTrigger(index);\n if (!positioner || !trigger) return;\n const root = this.host.nativeElement.getBoundingClientRect();\n const box = trigger.getBoundingClientRect();\n positioner.style.transform = \"\";\n positioner.style.pointerEvents = \"\";\n positioner.style.left = `${box.left - root.left}px`;\n positioner.style.top = `${box.bottom - root.top + YEAR_POPUP_GUTTER}px`;\n // `.select-popup` is `width: var(--reference-width)` — zag measures the\n // trigger and publishes it on the positioner; nothing else does.\n positioner.style.setProperty(\"--reference-width\", `${box.width}px`);\n // There is no CDK pane here, so the positioner is both the thing that is\n // stacked and the thing that declares the level — see `applyOverlayStacking`.\n applyOverlayStacking(positioner, positioner);\n }\n\n private parkYear(index: number): void {\n const positioner = this.yearPositioner(index);\n if (!positioner) return;\n positioner.style.transform = PARKED;\n positioner.style.pointerEvents = \"none\";\n }\n}\n","import { DOCUMENT, DestroyRef, inject, signal, type Signal } from \"@angular/core\";\n\n/**\n * Whether the primary pointer is coarse (touch).\n *\n * The date fields show the DS-styled calendar popover on fine pointers\n * (mouse/trackpad) and defer to the OS-native picker on touch devices, where the\n * native wheel/calendar is the better experience — and where a popover the size\n * of a month grid is not.\n *\n * Starts `false`, so the first render is the desktop path and corrects itself if\n * the query says otherwise. That matches the other three libraries, whose hook\n * starts `false` for SSR and updates on mount, and it is the safer default: the\n * popover path is the one that works on every device.\n *\n * `matchMedia` is guarded rather than assumed. It is missing in jsdom unless a\n * test provides it, and an unguarded call would make every field that uses this\n * un-instantiable in a spec.\n */\nexport function coarsePointer(): Signal<boolean> {\n const view = inject(DOCUMENT).defaultView;\n const coarse = signal(false);\n if (typeof view?.matchMedia !== \"function\") return coarse.asReadonly();\n\n const query = view.matchMedia(\"(pointer: coarse)\");\n const update = () => coarse.set(query.matches);\n update();\n query.addEventListener?.(\"change\", update);\n inject(DestroyRef).onDestroy(() => query.removeEventListener?.(\"change\", update));\n return coarse.asReadonly();\n}\n","/**\n * Open the browser's native date/time picker for an input.\n *\n * `showPicker()` must run inside a user gesture and throws if it is unsupported\n * or blocked — both cases are swallowed, so this stays a pure enhancement: the\n * input remains fully typeable and the native on-focus picker keeps working.\n */\nexport function openDatePicker(input: HTMLInputElement | null): void {\n if (!input || input.disabled) return;\n try {\n input.showPicker();\n } catch {\n /* no-op — unsupported or blocked; typed entry still works. */\n }\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n model,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioPopoverContext } from \"../popover/popover-context.js\";\n\n/** Ark's Popover gutter for the date fields — the popup clears the field by 6px. */\nconst DATE_POPOVER_GUTTER = 6;\n\n/**\n * The calendar surface the date fields share.\n *\n * Internal, and deliberately not `UioPopover`: the two render the same Ark\n * popover parts but not the same classes — `.date-popover` declares no\n * `display`, `.popover__popup` does — and the class names are baked into\n * `UioPopover`'s template. Everything else here is that component's story told\n * again, so read it for why the surface is attached on init, why the view\n * container is one level down, and why a user interaction flushes.\n *\n * Two things are its own:\n *\n * - It is anchored to the **field row**, not to the small calendar button, so\n * the popup lines up with the control rather than with a 32px icon. The field\n * tells it which element that is.\n * - It opens onto the calendar's active day rather than onto the first\n * focusable thing in it, which would be the \"Previous month\" button. The\n * field supplies {@link initialFocus} for the same reason React passes\n * `initialFocusEl`.\n */\n@Component({\n selector: \"uio-date-popover\",\n standalone: true,\n exportAs: \"uioDatePopover\",\n providers: [UioPopoverContext, HostPresence],\n template: `\n <!-- See UioPopover: a view container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"date-popover-positioner\"\n data-scope=\"popover\"\n data-part=\"positioner\"\n [id]=\"popoverContext.partId('popper')\"\n >\n <div\n class=\"date-popover\"\n data-scope=\"popover\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [id]=\"popoverContext.partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.data-expanded]=\"flag(open())\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.aria-label]=\"label()\"\n >\n <ng-content />\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioDatePopover implements OnInit, OnDestroy {\n readonly open = model(false);\n /**\n * The popup's accessible name.\n *\n * `role=\"dialog\"` needs one, and the calendar inside is not it — that is the\n * content. The trigger's own phrase is reused, as in the other three.\n */\n readonly label = input<string>(\"\");\n\n /** Where focus lands when the popup opens. Replaced by the owning field. */\n initialFocus: () => HTMLElement | null = () => null;\n\n readonly popoverContext = inject(UioPopoverContext);\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n protected readonly flag = stateFlag;\n\n /** Decorator queries — the spelling both compilers register. See `UioDialog`. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private anchorElement: HTMLElement | null = null;\n private opener: HTMLElement | null = null;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.opener,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n ngOnInit(): void {\n const ref = this.anchored.create(\n this.anchorElement ?? this.document.body,\n anchoredPositions(\"bottom\", \"start\", DATE_POPOVER_GUTTER),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /**\n * The row the popup is measured against, and the button focus returns to.\n *\n * Two elements rather than one, unlike `UioPopover`: the trigger is a 32px\n * icon inside a full-width field, and a popup aligned to it would hang off the\n * left of the control it belongs to.\n */\n anchorTo(row: HTMLElement | null, opener: HTMLElement | null): void {\n if (opener) this.opener = opener;\n if (row) {\n this.anchorElement = row;\n this.anchored.setAnchor(row);\n }\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n\n private setOpen(next: boolean): void {\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n // Measured only now: while it was closed the popup was `hidden`, had no\n // size, and the CDK placed a zero-height box.\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n\n const content = this.contentElement();\n const active = this.initialFocus();\n if (active) active.focus({ preventScroll: true });\n else if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n restoreFocus(this.opener);\n }\n}\n\n/**\n * Opens and closes a date popover, and reports its state the way Ark's trigger\n * does.\n *\n * A separate directive rather than `UioPopoverTrigger` only because that one is\n * typed to `UioPopover`. The rendered contract is identical, down to\n * `aria-controls` being dropped while the popup is closed — a reference to\n * unmounted content costs the button its accessible name.\n */\n@Directive({\n selector: \"button[uioDatePopoverTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"[id]\": \"popover ? popover.popoverContext.partId('trigger') : null\",\n \"[attr.data-ownedby]\": \"popover ? popover.popoverContext.machineId : null\",\n \"[attr.aria-expanded]\": \"isOpen() ? 'true' : 'false'\",\n \"[attr.aria-controls]\": \"isOpen() ? popover!.popoverContext.partId('content') : null\",\n // Sticky, exactly as Ark leaves them: a trigger that has opened once keeps\n // reporting where its surface went.\n \"[attr.data-placement]\": \"popover?.anchored?.placement() ?? null\",\n \"[attr.data-side]\": \"popover?.anchored?.side() ?? null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioDatePopoverTrigger extends UioPart {\n readonly scope = \"popover\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"datePopover\") popover?: UioDatePopover;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.popover?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n // Before the surface's own `ngOnInit`, so focus returns here rather than to\n // the document body. The row it is anchored *to* is supplied by the field.\n this.popover?.anchorTo(null, this.host.nativeElement);\n }\n\n protected activate(): void {\n this.popover?.anchorTo(null, this.host.nativeElement);\n this.popover?.toggle();\n }\n}\n","import {\n AfterViewInit,\n ApplicationRef,\n Directive,\n ElementRef,\n ViewChild,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n type Signal,\n afterNextRender,\n} from \"@angular/core\";\nimport { ControlValueAccessor } from \"@angular/forms\";\nimport {\n CONTROL_ICON_SIZE,\n inputFieldStyles,\n parseISODate,\n toISODate,\n todayYMD,\n type ControlSize,\n type InputVariants,\n type YMD,\n} from \"@ui-organized/core\";\nimport { UioCalendar } from \"../calendar/calendar.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { coarsePointer } from \"./coarse-pointer.js\";\nimport { openDatePicker } from \"./open-date-picker.js\";\nimport { UioDatePopover } from \"./date-popover.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type DateFieldSize = NonNullable<InputVariants[\"size\"]>;\n\n/** Split `2024-03-15T09:30` into its two halves; either may be empty. */\nexport function splitDateTime(value: string): { date: string; time: string } {\n const [date = \"\", time = \"\"] = value.split(\"T\");\n return { date, time };\n}\n\n/**\n * Everything DateInput and DateTimeInput have in common, which is all of it but\n * two constants.\n *\n * The two components differ only in the native `type` they render and the\n * phrase their picker button is labelled with — the same fourteen-line split\n * React makes. Angular has no way to inherit a template, so the markup is a\n * shared constant below and each component pairs it with its own decorator; the\n * behaviour is inherited from here.\n *\n * ── What is deliberately *not* here ─────────────────────────────────────────\n *\n * React needs `setNativeInputValue` — a call through the native value setter\n * plus a synthetic `input` event — because assigning `.value` on a React-\n * controlled input is silently reverted. Angular writes the value through the\n * same signal the template binds, so the calendar's write-back and a user's\n * typing are the same path and there is nothing to work around.\n *\n * `@Directive()` with no selector, like `UioPart`: a base class that declares\n * inputs, queries and lifecycle hooks is using Angular features, and the\n * compiler refuses to inherit them from an undecorated class.\n */\n@Directive()\nexport abstract class UioDateFieldBase\n extends UioPart\n implements AfterViewInit, ControlValueAccessor\n{\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n readonly scope = \"field\";\n readonly part = \"root\";\n\n /** The native input type. Fixed per component. */\n protected abstract readonly type: \"date\" | \"datetime-local\";\n /** The accessible name of the leading picker button, and of the popup. */\n protected abstract readonly pickerLabel: string;\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows an error message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<DateFieldSize>(\"md\");\n readonly required = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n /** Earliest selectable value, in the native input's own format. */\n readonly min = input<string | undefined>(undefined);\n /** Latest selectable value, in the native input's own format. */\n readonly max = input<string | undefined>(undefined);\n /** Native `step`, which only datetime-local has a use for. */\n readonly step = input<string | number | undefined>(undefined);\n\n /**\n * The field's value. Uncontrolled until something binds it, which is the same\n * fork `UioSwitch` describes — so React's `defaultValue` and `value` are one\n * input here.\n */\n readonly value = model(\"\");\n\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n private readonly formDisabled = signal(false);\n protected readonly isDisabled = computed(() => this.disabledInput() || this.formDisabled());\n\n override readonly invalid: Signal<boolean> = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n /** An error replaces the helper text rather than stacking under it. */\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly field = inject(UioFieldContext);\n private readonly appRef = inject(ApplicationRef);\n protected readonly coarse = coarsePointer();\n protected readonly hostClass = computed(() => inputFieldStyles({ size: this.size() }));\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n protected readonly flag = stateFlag;\n\n private readonly parts = computed(() => splitDateTime(this.value()));\n protected readonly datePart = computed(() => this.parts().date);\n protected readonly timePart = computed(() => this.parts().time);\n\n protected readonly calendarValue = computed(() => parseISODate(this.datePart()));\n protected readonly calendarMin = computed(() => parseISODate(this.min()));\n protected readonly calendarMax = computed(() => parseISODate(this.max()));\n\n /** True for DateTimeInput, which adds a time field and a Done button. */\n protected get isDateTime(): boolean {\n return this.type === \"datetime-local\";\n }\n\n @ViewChild(\"row\") private row?: ElementRef<HTMLElement>;\n @ViewChild(\"control\") private control?: ElementRef<HTMLInputElement>;\n @ViewChild(UioCalendar) private calendar?: UioCalendar;\n @ViewChild(UioDatePopover) protected popover?: UioDatePopover;\n\n constructor() {\n super();\n this.field.bind({\n invalid: this.invalid,\n // Not the field's state: `disabled` is a native attribute on the control,\n // and `.field__control:disabled` is what the stylesheet reads. Ark puts no\n // `data-disabled` on a field's label either. See `UioInput`.\n disabled: signal(false),\n required: signal(false),\n readOnly: signal(false),\n });\n this.field.describe(\"helper-text\", this.helperVisible);\n }\n\n ngAfterViewInit(): void {\n // Anchored to the whole field row rather than to the 32px picker button, so\n // the popup lines up with the control. And opened onto the calendar's active\n // day rather than onto the \"Previous month\" button `focusInside` would find.\n this.popover?.anchorTo(this.row?.nativeElement ?? null, null);\n if (this.popover) {\n this.popover.initialFocus = () => this.calendar?.activeDayElement() ?? null;\n }\n }\n\n protected onInput(event: Event): void {\n this.write((event.target as HTMLInputElement).value);\n }\n\n /** The OS-native picker, on touch devices. Must run inside the gesture. */\n protected openNativePicker(): void {\n openDatePicker(this.control?.nativeElement ?? null);\n }\n\n protected onDaySelect(day: YMD): void {\n const iso = toISODate(day);\n if (this.isDateTime) {\n // The popup stays open, so the time can still be set.\n this.write(`${iso}T${this.timePart() || \"00:00\"}`);\n return;\n }\n this.write(iso);\n this.popover?.hide();\n }\n\n protected onTimeInput(event: Event): void {\n const time = (event.target as HTMLInputElement).value;\n this.write(`${this.datePart() || toISODate(todayYMD())}T${time}`);\n }\n\n private write(next: string): void {\n this.value.set(next);\n this.onChange(next);\n /**\n * The value has to reach the DOM before the handler returns.\n *\n * Every write here comes from a discrete interaction — a day clicked in the\n * calendar, a time typed in the footer — and the state it changes is spread\n * across two views: the field's own input, and the calendar inside a\n * portalled surface. React flushes those together inside the event; a\n * zoneless Angular schedules them for the next task, so anything reading the\n * DOM straight after the click sees the old selection under a popup that has\n * already been told about the new one. See `flushNow`.\n */\n flushNow(this.appRef);\n }\n\n protected onTouched: () => void = () => {};\n private onChange: (value: string) => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? \"\");\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n\n/**\n * The markup both single date fields render.\n *\n * A shared constant rather than two copies: the whole point of the pair is that\n * they are the same field, and a divergence between two hand-kept templates\n * would show up as a parity failure in one component and not the other.\n *\n * Two things in here are load-bearing:\n *\n * - **The coarse-pointer fork renders a plain button.** On touch there is no\n * popover at all, so the button is not a popover trigger and reports none of\n * its state — which is what the other three do, and why `data-scope=\"popover\"`\n * is absent from the whole field on a phone.\n * - **The popover element itself is removed from the DOM.** Ark's Popover.Root\n * renders nothing; `HostPresence` inside `UioDatePopover` does the same here,\n * so the field root holds the label, the row, the helper text and the error\n * and nothing else.\n */\nexport const DATE_FIELD_TEMPLATE = `\n @if (label(); as text) {\n <label uioFieldLabel\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n\n @if (coarse()) {\n <div class=\"input-affix\" #row>\n <button\n type=\"button\"\n class=\"input-affix__adornment input-affix__adornment--start input-affix__action\"\n [attr.aria-label]=\"pickerLabel\"\n [disabled]=\"isDisabled()\"\n (click)=\"openNativePicker()\"\n >\n <span uioIcon name=\"calendar\" [size]=\"iconSize()\"></span>\n </button>\n <input\n #control\n class=\"field__control field__control--affix-start\"\n data-scope=\"field\"\n data-part=\"input\"\n [id]=\"field.controlId\"\n [attr.type]=\"type\"\n [attr.name]=\"name()\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [attr.step]=\"step()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-empty]=\"value() ? null : 'true'\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n } @else {\n <div class=\"input-affix\" #row>\n <button\n uioDatePopoverTrigger\n [datePopover]=\"surface\"\n class=\"input-affix__adornment input-affix__adornment--start input-affix__action\"\n [attr.aria-label]=\"pickerLabel\"\n [disabled]=\"isDisabled()\"\n >\n <span uioIcon name=\"calendar\" [size]=\"iconSize()\"></span>\n </button>\n <input\n #control\n class=\"field__control field__control--affix-start\"\n data-scope=\"field\"\n data-part=\"input\"\n [id]=\"field.controlId\"\n [attr.type]=\"type\"\n [attr.name]=\"name()\"\n [attr.min]=\"min()\"\n [attr.max]=\"max()\"\n [attr.step]=\"step()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"field.describedBy()\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-empty]=\"value() ? null : 'true'\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onTouched()\"\n />\n </div>\n\n <uio-date-popover #surface=\"uioDatePopover\" [label]=\"pickerLabel\">\n <div\n uioCalendar\n mode=\"single\"\n [value]=\"calendarValue()\"\n [min]=\"calendarMin()\"\n [max]=\"calendarMax()\"\n (daySelect)=\"onDaySelect($event)\"\n ></div>\n @if (isDateTime) {\n <div class=\"date-popover__footer\">\n <input\n type=\"time\"\n class=\"field__control date-popover__time\"\n aria-label=\"Time\"\n [attr.data-empty]=\"timePart() ? null : 'true'\"\n [value]=\"timePart()\"\n (input)=\"onTimeInput($event)\"\n />\n <button\n uioButton\n intent=\"primary\"\n size=\"md\"\n class=\"date-popover__done\"\n (click)=\"surface.hide()\"\n >\n Done\n </button>\n </div>\n }\n </uio-date-popover>\n }\n\n @if (helperVisible()) {\n <span\n class=\"field__description\"\n data-scope=\"field\"\n data-part=\"helper-text\"\n [id]=\"field.partId('helper-text')\"\n >{{ helperText() }}</span\n >\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n`;\n","import { Component, forwardRef } from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioCalendar } from \"../calendar/calendar.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport {\n DATE_FIELD_TEMPLATE,\n UioDateFieldBase,\n type DateFieldSize,\n} from \"../date-field/date-field-base.js\";\nimport { UioDatePopover, UioDatePopoverTrigger } from \"../date-field/date-popover.js\";\n\n/** The size variants both single date fields share with `UioInput`. */\nexport type DateInputSize = DateFieldSize;\n\n/**\n * A single-line date field — a native `<input type=\"date\">` on the Input field\n * surface, with a leading calendar button.\n *\n * ```html\n * <div uioDateInput label=\"Start date\" min=\"2024-01-01\" formControlName=\"start\"></div>\n * ```\n *\n * On a fine pointer the button opens the design system's own calendar popover;\n * on a touch device it opens the OS-native picker instead, where the native\n * wheel is the better experience. Either way the input itself stays fully\n * typeable, keeps its `min`/`max`, and is what a form submits.\n *\n * Everything but the native `type` and the button's label is shared with\n * `UioDateTimeInput` — see `UioDateFieldBase`.\n */\n@Component({\n selector: \"div[uioDateInput]\",\n standalone: true,\n exportAs: \"uioDateInput\",\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioDateInput), multi: true },\n ],\n imports: [\n UioButton,\n UioCalendar,\n UioDatePopover,\n UioDatePopoverTrigger,\n UioFieldError,\n UioFieldLabel,\n UioIcon,\n ],\n template: DATE_FIELD_TEMPLATE,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioDateInput extends UioDateFieldBase {\n protected override readonly type = \"date\" as const;\n protected override readonly pickerLabel = \"Choose date\";\n}\n","import { Component, forwardRef } from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioCalendar } from \"../calendar/calendar.js\";\nimport { UioFieldContext } from \"../field/field-context.js\";\nimport { UioFieldLabel } from \"../field/field.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport {\n DATE_FIELD_TEMPLATE,\n UioDateFieldBase,\n type DateFieldSize,\n} from \"../date-field/date-field-base.js\";\nimport { UioDatePopover, UioDatePopoverTrigger } from \"../date-field/date-popover.js\";\n\n/** The size variants both single date fields share with `UioInput`. */\nexport type DateTimeInputSize = DateFieldSize;\n\n/**\n * A single-line date-and-time field — a native `<input type=\"datetime-local\">`\n * on the Input field surface, with a leading calendar button.\n *\n * ```html\n * <div uioDateTimeInput label=\"Starts at\" [(value)]=\"startsAt\"></div>\n * ```\n *\n * The same field as `UioDateInput`, with the one branch that only a datetime\n * has: the popover grows a time field and a Done button under the grid, and\n * choosing a day therefore leaves it *open* so the time can still be set. That\n * is why the Done button exists at all.\n */\n@Component({\n selector: \"div[uioDateTimeInput]\",\n standalone: true,\n exportAs: \"uioDateTimeInput\",\n providers: [\n UioFieldContext,\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UioDateTimeInput), multi: true },\n ],\n imports: [\n UioButton,\n UioCalendar,\n UioDatePopover,\n UioDatePopoverTrigger,\n UioFieldError,\n UioFieldLabel,\n UioIcon,\n ],\n template: DATE_FIELD_TEMPLATE,\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[id]\": \"field.rootId\",\n },\n})\nexport class UioDateTimeInput extends UioDateFieldBase {\n protected override readonly type = \"datetime-local\" as const;\n protected override readonly pickerLabel = \"Choose date and time\";\n}\n","import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n AfterViewInit,\n ApplicationRef,\n Component,\n ElementRef,\n ViewChild,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n afterNextRender,\n} from \"@angular/core\";\nimport { clsx } from \"clsx\";\nimport {\n CONTROL_ICON_SIZE,\n inputFieldStyles,\n parseISODate,\n toISODate,\n type ControlSize,\n type DateRangeInputVariants,\n} from \"@ui-organized/core\";\nimport { UioCalendar, type CalendarRange } from \"../calendar/calendar.js\";\nimport { UioDatePopover, UioDatePopoverTrigger } from \"../date-field/date-popover.js\";\nimport { coarsePointer } from \"../date-field/coarse-pointer.js\";\nimport { openDatePicker } from \"../date-field/open-date-picker.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { glyph } from \"../icons/glyph.js\";\nimport { trackFocusModality } from \"@ui-organized/core/focus-modality\";\n\nexport type DateRangeInputSize = NonNullable<DateRangeInputVariants[\"size\"]>;\n\n/** The paired ends of a range, as ISO `YYYY-MM-DD` strings; `\"\"` when empty. */\nexport interface DateRangeValue {\n start: string;\n end: string;\n}\n\nconst EMPTY_RANGE: DateRangeValue = { start: \"\", end: \"\" };\n\n/** The icon pill in front of each control, which both ends share. */\nconst ADORNMENT =\n \"input-affix__adornment input-affix__adornment--start input-affix__action\";\n\n/**\n * A from–to date range built from two native `<input type=\"date\">` controls on\n * the Input field surface, under one shared label, helper text and error.\n *\n * ```html\n * <div uioDateRangeInput label=\"Stay\" [(value)]=\"stay\" min=\"2024-01-01\"></div>\n * ```\n *\n * On a fine pointer the leading calendar buttons open one shared two-month range\n * calendar; on touch they defer to the OS-native picker. The two ends\n * auto-constrain each other — the end cannot precede the start — on top of the\n * optional `min`/`max`.\n *\n * ── Three things that look like details and are not ─────────────────────────\n *\n * **The root is not a `Field`.** It is a plain `role=\"group\"` naming itself with\n * `aria-labelledby`, because two controls under one label is a group and not a\n * field: a `<label for>` may only name one of them. That is also why the label\n * is a `<span>`, the helper text a `<p>`, and the error pill is written out here\n * rather than being `UioFieldError` — outside a field that component renders no\n * id, and this group needs one to describe itself by.\n *\n * **Only the start button is a popover trigger.** One popover may have one\n * trigger and the range shares a single calendar, so the end button sets the\n * open state by hand. It is the one control in the date family whose behaviour\n * is written rather than delegated.\n *\n * **The row is split across two templates.** The coarse-pointer fork has to\n * bracket the popover as well as the button — a touch device renders no calendar\n * at all — and a template reference cannot cross an `@if`. The two inputs and\n * the separator, which is where all the attributes live, are shared between the\n * branches rather than written twice.\n */\n@Component({\n selector: \"div[uioDateRangeInput]\",\n standalone: true,\n exportAs: \"uioDateRangeInput\",\n imports: [NgTemplateOutlet, UioCalendar, UioDatePopover, UioDatePopoverTrigger, UioIcon],\n host: {\n role: \"group\",\n \"[class]\": \"hostClass()\",\n \"[attr.aria-labelledby]\": \"label() ? labelId : null\",\n \"[attr.aria-describedby]\": \"describedBy()\",\n \"[attr.data-disabled]\": \"disabled() ? 'true' : null\",\n },\n template: `\n @if (label(); as text) {\n <span class=\"field__label\" [id]=\"labelId\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</span\n >\n }\n\n @if (coarse()) {\n <div class=\"date-range__row\" #row>\n <div class=\"input-affix date-range__field\">\n <button\n type=\"button\"\n [class]=\"ADORNMENT\"\n [attr.aria-label]=\"startPickerLabel()\"\n [disabled]=\"disabled()\"\n (click)=\"onStartPicker()\"\n >\n <span uioIcon [name]=\"glyph('calendar')\" [size]=\"iconSize()\"></span>\n </button>\n <ng-container [ngTemplateOutlet]=\"startInput\" />\n </div>\n <ng-container [ngTemplateOutlet]=\"tail\" />\n </div>\n } @else {\n <div class=\"date-range__row\" #row>\n <div class=\"input-affix date-range__field\">\n <button\n uioDatePopoverTrigger\n [datePopover]=\"surface\"\n [class]=\"ADORNMENT\"\n [attr.aria-label]=\"startPickerLabel()\"\n [disabled]=\"disabled()\"\n >\n <span uioIcon [name]=\"glyph('calendar')\" [size]=\"iconSize()\"></span>\n </button>\n <ng-container [ngTemplateOutlet]=\"startInput\" />\n </div>\n <ng-container [ngTemplateOutlet]=\"tail\" />\n </div>\n\n <uio-date-popover #surface=\"uioDatePopover\" [label]=\"popupLabel()\">\n <div\n uioCalendar\n mode=\"range\"\n [numMonths]=\"2\"\n [rangeValue]=\"calendarRange()\"\n [min]=\"calendarMin()\"\n [max]=\"calendarMax()\"\n (rangeChange)=\"onRangeChange($event)\"\n (rangeComplete)=\"surface.hide()\"\n ></div>\n </uio-date-popover>\n }\n\n @if (helperVisible()) {\n <p class=\"field__description\" [id]=\"helperId\">{{ helperText() }}</p>\n }\n @if (errorVisible()) {\n <!--\n The pill UioFieldError renders, written out because this group is not an\n Ark Field: outside one that component emits no id, and no \"data-scope\"\n or \"aria-live\" either — which is what React renders here too.\n -->\n <span class=\"field-error text-emphasis-caption\" [id]=\"errorId\"\n ><span uioIcon class=\"field-error__icon\" [name]=\"glyph('alert-circle')\" [size]=\"ERROR_ICON_SIZE\"></span\n >{{ errorMessage() }}</span\n >\n }\n\n <ng-template #startInput>\n <input\n #startControl\n type=\"date\"\n class=\"field__control field__control--affix-start\"\n [attr.data-empty]=\"current().start ? null : 'true'\"\n [attr.min]=\"min()\"\n [attr.max]=\"current().end || max()\"\n [attr.name]=\"startName()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-label]=\"startLabel()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled()\"\n [value]=\"current().start\"\n (input)=\"onEndpointInput($event, true)\"\n />\n </ng-template>\n\n <ng-template #tail>\n <span class=\"date-range__separator text-default-body-large\" aria-hidden=\"true\">{{\n separator()\n }}</span>\n <div class=\"input-affix date-range__field\">\n <button\n type=\"button\"\n [class]=\"ADORNMENT\"\n [attr.aria-label]=\"endPickerLabel()\"\n [disabled]=\"disabled()\"\n (click)=\"onEndPicker()\"\n >\n <span uioIcon [name]=\"glyph('calendar')\" [size]=\"iconSize()\"></span>\n </button>\n <input\n #endControl\n type=\"date\"\n class=\"field__control field__control--affix-start\"\n [attr.data-empty]=\"current().end ? null : 'true'\"\n [attr.min]=\"current().start || min()\"\n [attr.max]=\"max()\"\n [attr.name]=\"endName()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-label]=\"endLabel()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [disabled]=\"disabled()\"\n [value]=\"current().end\"\n (input)=\"onEndpointInput($event, false)\"\n />\n </div>\n </ng-template>\n `,\n})\nexport class UioDateRangeInput implements AfterViewInit {\n /** Pointer vs keyboard, read by the field CSS for a quiet focus state on click. */\n protected readonly focusModalityTracker = afterNextRender(() => trackFocusModality());\n\n protected readonly glyph = glyph;\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows an error message; `true` marks the range invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n readonly size = input<DateRangeInputSize>(\"md\");\n readonly required = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Uncontrolled until something binds it — the fork `UioSwitch` describes. */\n readonly value = model<DateRangeValue>(EMPTY_RANGE);\n\n /** Earliest selectable date for both controls (ISO `YYYY-MM-DD`). */\n readonly min = input<string | undefined>(undefined);\n /** Latest selectable date for both controls (ISO `YYYY-MM-DD`). */\n readonly max = input<string | undefined>(undefined);\n\n readonly startName = input<string | undefined>(undefined);\n readonly endName = input<string | undefined>(undefined);\n readonly startLabel = input(\"Start date\");\n readonly endLabel = input(\"End date\");\n /** Rendered between the two controls. Defaults to an en dash. */\n readonly separator = input(\"–\");\n\n private readonly machine = nextMachineId();\n protected readonly labelId = `${this.machine}-label`;\n protected readonly helperId = `${this.machine}-helper`;\n protected readonly errorId = `${this.machine}-error`;\n\n protected readonly ADORNMENT = ADORNMENT;\n protected readonly ERROR_ICON_SIZE = 12;\n\n private readonly appRef = inject(ApplicationRef);\n protected readonly coarse = coarsePointer();\n\n protected readonly invalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n protected readonly errorVisible = computed(() => this.invalid() && !!this.errorMessage());\n protected readonly describedBy = computed(() => {\n const ids = [\n this.helperVisible() ? this.helperId : null,\n this.errorVisible() ? this.errorId : null,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : null;\n });\n\n protected readonly hostClass = computed(() =>\n clsx(inputFieldStyles({ size: this.size() }), \"date-range\"),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n\n protected readonly current = computed(\n (): DateRangeValue => ({ start: this.value().start ?? \"\", end: this.value().end ?? \"\" }),\n );\n protected readonly calendarRange = computed(\n (): CalendarRange => ({\n start: parseISODate(this.current().start),\n end: parseISODate(this.current().end),\n }),\n );\n protected readonly calendarMin = computed(() => parseISODate(this.min()));\n protected readonly calendarMax = computed(() => parseISODate(this.max()));\n\n protected readonly startPickerLabel = computed(() => `${this.startLabel()} — choose date`);\n protected readonly endPickerLabel = computed(() => `${this.endLabel()} — choose date`);\n protected readonly popupLabel = computed(\n () => `${this.startLabel()} — ${this.endLabel()}, choose dates`,\n );\n\n @ViewChild(\"row\") private row?: ElementRef<HTMLElement>;\n @ViewChild(\"startControl\") private startControl?: ElementRef<HTMLInputElement>;\n @ViewChild(\"endControl\") private endControl?: ElementRef<HTMLInputElement>;\n @ViewChild(UioCalendar) private calendar?: UioCalendar;\n @ViewChild(UioDatePopover) private popover?: UioDatePopover;\n\n ngAfterViewInit(): void {\n // The whole row, not the 32px button — the popup belongs to the pair. And\n // opened onto the calendar's active day rather than the \"Previous month\"\n // button, which is what `focusInside` would otherwise find first.\n this.popover?.anchorTo(this.row?.nativeElement ?? null, null);\n if (this.popover) {\n this.popover.initialFocus = () => this.calendar?.activeDayElement() ?? null;\n }\n }\n\n protected onStartPicker(): void {\n openDatePicker(this.startControl?.nativeElement ?? null);\n }\n\n /**\n * The end button, which is a plain button in both modes.\n *\n * On touch it opens the OS picker for its own control; on a fine pointer it\n * opens the shared calendar, because a popover may only have one trigger and\n * the start button already is it.\n */\n protected onEndPicker(): void {\n if (this.coarse()) {\n openDatePicker(this.endControl?.nativeElement ?? null);\n return;\n }\n this.popover?.show();\n }\n\n protected onEndpointInput(event: Event, isStart: boolean): void {\n const next = (event.target as HTMLInputElement).value;\n const current = this.current();\n this.update(isStart ? { start: next, end: current.end } : { start: current.start, end: next });\n }\n\n protected onRangeChange(range: CalendarRange): void {\n this.update({\n start: range.start ? toISODate(range.start) : \"\",\n end: range.end ? toISODate(range.end) : \"\",\n });\n }\n\n private update(next: DateRangeValue): void {\n this.value.set(next);\n // Both ends and the calendar's band are refreshed by different views; see\n // `write` in `UioDateFieldBase` for why a discrete interaction flushes.\n flushNow(this.appRef);\n }\n}\n","import { dateToYMD, type YMD } from \"@ui-organized/core\";\n\n/**\n * Add whole months, keeping the day of the month.\n *\n * Deliberately *not* `addMonths` from `@ui-organized/core`, whose contract is\n * \"land on the first\" — that is what the hand-written `Calendar` uses and why\n * its PageUp/PageDown lose the day. Ark's DatePicker is a different machine with\n * a different answer: `@internationalized/date` keeps the day and clamps it into\n * the target month, so paging forward from the 15th shows the 15th and paging\n * from the 31st of March shows the 30th of April.\n */\nexport function shiftMonths(day: YMD, delta: number): YMD {\n const target = new Date(day.year, day.month + delta, 1);\n const year = target.getFullYear();\n const month = target.getMonth();\n // Day 0 of the next month is the last day of this one.\n const lastDay = new Date(year, month + 1, 0).getDate();\n return { year, month, day: Math.min(day.day, lastDay) };\n}\n\n/**\n * The weeks a month's grid actually needs, padded to whole weeks at both ends.\n *\n * Between four and six rows, never a fixed six. That is the one structural place\n * this grid differs from the hand-written `Calendar`, whose `monthGrid` always\n * returns 42 cells: zag renders `ceil((lead + days) / 7)` rows, so April 2024 —\n * which starts on a Monday and has thirty days — is five rows ending on May 4th,\n * and a sixth row of May would be six cells the reference library does not have.\n */\nexport function datePickerWeeks(view: YMD, weekStartsOn = 0): YMD[][] {\n const first = new Date(view.year, view.month, 1);\n const lead = (first.getDay() - weekStartsOn + 7) % 7;\n const daysInMonth = new Date(view.year, view.month + 1, 0).getDate();\n const rows = Math.ceil((lead + daysInMonth) / 7);\n\n const weeks: YMD[][] = [];\n for (let row = 0; row < rows; row++) {\n const week: YMD[] = [];\n for (let column = 0; column < 7; column++) {\n week.push(dateToYMD(new Date(view.year, view.month, 1 - lead + row * 7 + column)));\n }\n weeks.push(week);\n }\n return weeks;\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n ElementRef,\n EmbeddedViewRef,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport {\n CONTROL_ICON_SIZE,\n compareYMD,\n datePickerStyles,\n isSameMonth,\n isSameYMD,\n isWithin,\n monthLabel,\n parseISODate,\n startOfMonth,\n toISODate,\n todayYMD,\n ymdToDate,\n type ControlSize,\n type DatePickerVariants,\n type YMD,\n} from \"@ui-organized/core\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { restoreFocus } from \"../overlay/focus.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { datePickerWeeks, shiftMonths } from \"./date-picker-grid.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type DatePickerSize = NonNullable<DatePickerVariants[\"size\"]>;\nexport type DatePickerVariant = NonNullable<DatePickerVariants[\"variant\"]>;\nexport type DatePickerSelectionMode = \"single\" | \"multiple\" | \"range\";\n\n/** Weekday header and navigation glyphs stay one step below the cell text. */\nconst NAV_ICON_SIZE = 16;\n\n/** Ark's DatePicker anchors its popup bottom-start with a 4px gutter. */\nconst POPUP_GUTTER = 4;\n\n/** Parked off-screen while closed, exactly as zag parks its positioner. */\nconst PARKED = \"translate3d(0px, -100vh, 0px)\";\n\n/** One day in the grid, with every attribute already decided. See `DayCell`. */\ninterface DayCell {\n ymd: YMD;\n value: string;\n day: number;\n ariaLabel: string;\n ariaDisabled: \"true\" | null;\n ariaSelected: \"true\" | \"false\";\n ariaInvalid: \"true\" | null;\n disabled: \"\" | null;\n selectable: \"\" | null;\n selected: \"\" | null;\n unavailable: \"\" | null;\n outsideRange: \"\" | null;\n weekend: \"\" | null;\n today: \"\" | null;\n focus: \"\" | null;\n rangeStart: \"\" | null;\n rangeEnd: \"\" | null;\n inRange: \"\" | null;\n tabIndex: number;\n}\n\ninterface Weekday {\n long: string;\n narrow: string;\n}\n\n/** 2024-01-07 is a Sunday — a stable anchor for deriving localised names. */\nfunction weekdayHeaders(locale: string | undefined, weekStartsOn: number): Weekday[] {\n return Array.from({ length: 7 }, (_, index) => {\n const date = new Date(2024, 0, 7 + ((weekStartsOn + index) % 7));\n return {\n long: date.toLocaleDateString(locale, { weekday: \"long\" }),\n narrow: date.toLocaleDateString(locale, { weekday: \"narrow\" }),\n };\n });\n}\n\nfunction longDate(day: YMD, locale: string | undefined): string {\n return ymdToDate(day).toLocaleDateString(locale, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n}\n\n/**\n * A date field with its own calendar grid — the other date component, and the\n * only one of the four that is a `<table>`.\n *\n * ```html\n * <div uioDatePicker label=\"Date\" [(value)]=\"dates\" selectionMode=\"range\"></div>\n * ```\n *\n * ── Why this is written out rather than composed ────────────────────────────\n *\n * The other three libraries delegate the whole of this to Ark's DatePicker\n * machine, so its DOM is zag's rather than the design system's: `data-selectable`\n * beside `data-unavailable` beside `data-outside-range`, three different reasons\n * a cell cannot be chosen, each with its own rule in `DatePicker.css`. Angular\n * has no machine, so every one of those is decided in {@link cells} — which is\n * also where the difference from the hand-written `Calendar` lives: this grid\n * carries zag's vocabulary and zag's presence-only encoding (`data-selected=\"\"`),\n * where `Calendar` carries our own and writes `\"true\"`.\n *\n * ── The one thing it deliberately does not do ───────────────────────────────\n *\n * The view trigger — the month label in the header — is inert. All four\n * libraries render only the *day* view, so there is no year view to switch to;\n * in React, clicking it hides the day view and leaves an empty popup, which is\n * behaviour worth not reproducing. The button stays because its id is part of\n * the rendered contract, and because the day the year view is built it is\n * already in the right place.\n *\n * @deprecated Use DateInput for a single date or DateRangeInput for a range. DatePicker is no longer documented and will be removed in the next major release.\n */\n@Component({\n selector: \"div[uioDatePicker]\",\n standalone: true,\n exportAs: \"uioDatePicker\",\n imports: [UioFieldError, UioIcon],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"date-picker\"\n data-part=\"label\"\n data-index=\"0\"\n [id]=\"partId('label:0')\"\n [attr.for]=\"inputId(0)\"\n [attr.data-state]=\"state()\"\n [attr.data-disabled]=\"flag(disabledInput())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n\n <div\n class=\"date-picker__control\"\n data-scope=\"date-picker\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n [attr.data-disabled]=\"flag(disabledInput())\"\n [attr.data-placeholder-shown]=\"flag(isEmpty())\"\n >\n @for (index of inputIndexes(); track index) {\n <input\n class=\"date-picker__input\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n placeholder=\"mm/dd/yyyy\"\n [id]=\"inputId(index)\"\n [attr.name]=\"name()\"\n [attr.data-index]=\"index\"\n [attr.data-state]=\"state()\"\n [attr.data-placeholder-shown]=\"flag(isEmpty())\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [attr.required]=\"required() ? '' : null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n [attr.data-invalid]=\"flag(isInvalid())\"\n [disabled]=\"disabledInput()\"\n [value]=\"displayValue(index)\"\n (change)=\"onInputChange($event, index)\"\n />\n }\n <button\n class=\"date-picker__trigger\"\n data-scope=\"date-picker\"\n data-part=\"trigger\"\n type=\"button\"\n aria-haspopup=\"grid\"\n [id]=\"partId('trigger')\"\n [attr.aria-label]=\"open() ? 'Close calendar' : 'Open calendar'\"\n [attr.aria-controls]=\"partId('content')\"\n [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\n [attr.data-state]=\"state()\"\n [attr.data-placeholder-shown]=\"flag(isEmpty())\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [disabled]=\"disabledInput()\"\n (click)=\"toggle()\"\n >\n <span uioIcon [name]=\"glyph('calendar')\" [size]=\"iconSize()\"></span>\n </button>\n </div>\n\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n\n <!-- See UioPopover: a view container anchored on the host is re-homed by projection. -->\n <ng-container #anchor />\n <ng-template #surface>\n <!--\n The positioner class must stay a plain string literal — the\n overlay-stacking test scans for it.\n -->\n <div\n class=\"date-picker__positioner\"\n data-scope=\"date-picker\"\n data-part=\"positioner\"\n [id]=\"partId('positioner')\"\n >\n <div\n class=\"date-picker__popup\"\n data-scope=\"date-picker\"\n data-part=\"content\"\n role=\"application\"\n aria-roledescription=\"datepicker\"\n aria-label=\"calendar\"\n tabindex=\"-1\"\n [id]=\"partId('content')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n >\n <div data-scope=\"date-picker\" data-part=\"view\">\n <div\n class=\"date-picker__view-control\"\n data-scope=\"date-picker\"\n data-part=\"view-control\"\n data-view=\"day\"\n >\n <button\n class=\"date-picker__nav\"\n data-scope=\"date-picker\"\n data-part=\"prev-trigger\"\n type=\"button\"\n aria-label=\"Switch to previous month\"\n [id]=\"partId('prev:day')\"\n [disabled]=\"prevDisabled()\"\n [attr.data-disabled]=\"flag(prevDisabled())\"\n (click)=\"page(-1)\"\n >\n <span uioIcon [name]=\"glyph('chevron-left')\" [size]=\"NAV_ICON_SIZE\"></span>\n </button>\n <button\n class=\"date-picker__view-trigger\"\n data-scope=\"date-picker\"\n data-part=\"view-trigger\"\n data-view=\"day\"\n type=\"button\"\n aria-label=\"Switch to year view\"\n [id]=\"partId('view:day')\"\n >\n <div data-scope=\"date-picker\" data-part=\"range-text\">{{ rangeText() }}</div>\n </button>\n <button\n class=\"date-picker__nav\"\n data-scope=\"date-picker\"\n data-part=\"next-trigger\"\n type=\"button\"\n aria-label=\"Switch to next month\"\n [id]=\"partId('next:day')\"\n [disabled]=\"nextDisabled()\"\n [attr.data-disabled]=\"flag(nextDisabled())\"\n (click)=\"page(1)\"\n >\n <span uioIcon [name]=\"glyph('chevron-right')\" [size]=\"NAV_ICON_SIZE\"></span>\n </button>\n </div>\n\n <table\n class=\"date-picker__table\"\n data-scope=\"date-picker\"\n data-part=\"table\"\n role=\"grid\"\n data-columns=\"7\"\n aria-roledescription=\"calendar month\"\n data-view=\"day\"\n tabindex=\"-1\"\n [id]=\"partId('table:day')\"\n [attr.aria-multiselectable]=\"multiSelectable()\"\n (keydown)=\"onGridKeydown($event)\"\n >\n <thead\n data-scope=\"date-picker\"\n data-part=\"table-head\"\n aria-hidden=\"true\"\n data-view=\"day\"\n >\n <tr data-scope=\"date-picker\" data-part=\"table-row\" data-view=\"day\">\n @for (weekday of weekdays(); track weekday.long) {\n <th\n class=\"date-picker__weekday\"\n data-scope=\"date-picker\"\n data-part=\"table-header\"\n data-view=\"day\"\n [attr.aria-label]=\"weekday.long\"\n >\n {{ weekday.narrow }}\n </th>\n }\n </tr>\n </thead>\n <tbody data-scope=\"date-picker\" data-part=\"table-body\" data-view=\"day\">\n @for (week of cells(); track week[0]!.value) {\n <tr data-scope=\"date-picker\" data-part=\"table-row\" data-view=\"day\">\n @for (cell of week; track cell.value) {\n <td\n class=\"date-picker__cell\"\n data-scope=\"date-picker\"\n data-part=\"table-cell\"\n role=\"gridcell\"\n [attr.aria-disabled]=\"cell.ariaDisabled\"\n [attr.aria-selected]=\"cell.ariaSelected\"\n [attr.aria-invalid]=\"cell.ariaInvalid\"\n [attr.data-value]=\"cell.value\"\n >\n <div\n class=\"date-picker__day\"\n data-scope=\"date-picker\"\n data-part=\"table-cell-trigger\"\n role=\"button\"\n data-view=\"day\"\n [id]=\"partId('cell-trigger:' + cell.value)\"\n [attr.tabindex]=\"cell.tabIndex\"\n [attr.aria-label]=\"cell.ariaLabel\"\n [attr.aria-disabled]=\"cell.ariaDisabled\"\n [attr.aria-invalid]=\"cell.ariaInvalid\"\n [attr.data-disabled]=\"cell.disabled\"\n [attr.data-selectable]=\"cell.selectable\"\n [attr.data-selected]=\"cell.selected\"\n [attr.data-value]=\"cell.value\"\n [attr.data-unavailable]=\"cell.unavailable\"\n [attr.data-outside-range]=\"cell.outsideRange\"\n [attr.data-weekend]=\"cell.weekend\"\n [attr.data-today]=\"cell.today\"\n [attr.data-focus]=\"cell.focus\"\n [attr.data-range-start]=\"cell.rangeStart\"\n [attr.data-range-end]=\"cell.rangeEnd\"\n [attr.data-in-range]=\"cell.inRange\"\n (click)=\"choose(cell)\"\n >\n {{ cell.day }}\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </ng-template>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.data-empty]\": \"flag(isEmpty())\",\n },\n})\nexport class UioDatePicker extends UioPart implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly scope = \"date-picker\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows an error message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n /** ISO dates. An array even in single mode, because `range` selects two. */\n readonly value = model<string[]>([]);\n readonly selectionMode = input<DatePickerSelectionMode>(\"single\");\n readonly min = input<string | undefined>(undefined);\n readonly max = input<string | undefined>(undefined);\n /**\n * Months shown side by side. Accepted for API parity and currently rendered as\n * one: the facade maps a single month's weeks in all four libraries.\n */\n readonly numOfMonths = input(1);\n /** BCP-47 locale driving month names, weekday order and formatting. */\n readonly locale = input<string | undefined>(undefined);\n readonly open = model(false);\n readonly size = input<DatePickerSize>(\"md\");\n readonly variant = input<DatePickerVariant>(\"default\");\n readonly required = input(false, { transform: booleanAttribute });\n readonly readOnlyInput = input(false, { alias: \"readOnly\", transform: booleanAttribute });\n protected readonly disabledInput = input(false, {\n alias: \"disabled\",\n transform: booleanAttribute,\n });\n readonly name = input<string | undefined>(undefined);\n\n override readonly disabled: Signal<boolean> = this.disabledInput;\n override readonly readOnly: Signal<boolean> = this.readOnlyInput;\n /**\n * The open state, and deliberately *not* `data-invalid`.\n *\n * Ark reflects `invalid` onto the input alone — the root, the label and the\n * control carry none — so the base's `invalid` is left at its default here and\n * the two attributes that do belong on the root are bound above.\n */\n override readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n protected readonly machine = nextMachineId();\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n protected readonly NAV_ICON_SIZE = NAV_ICON_SIZE;\n protected readonly flag = stateFlag;\n\n private readonly today = todayYMD();\n\n /** Derived from `error`, and bound only where Ark puts it: on the input. */\n protected readonly isInvalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.isInvalid());\n protected readonly hostClass = computed(() =>\n datePickerStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size() as ControlSize]);\n\n protected readonly selectedDays = computed(() =>\n this.value()\n .map((iso) => parseISODate(iso))\n .filter((day): day is YMD => !!day),\n );\n protected readonly isEmpty = computed(() => this.selectedDays().length === 0);\n private readonly minDay = computed(() => parseISODate(this.min()));\n private readonly maxDay = computed(() => parseISODate(this.max()));\n\n /**\n * The day the grid's roving focus is on, which is also what decides the month\n * on screen. Seeded in `ngOnInit`, where the inputs are first bound.\n */\n private readonly focused = signal<YMD>(this.today);\n private readonly view = computed(() => startOfMonth(this.focused()));\n\n protected readonly rangeText = computed(() =>\n monthLabel(this.view().year, this.view().month, this.locale()),\n );\n protected readonly weekdays = computed(() => weekdayHeaders(this.locale(), 0));\n protected readonly inputIndexes = computed(() =>\n this.selectionMode() === \"range\" ? [0, 1] : [0],\n );\n /** Ark marks the grid multi-selectable for any mode that takes more than one day. */\n protected readonly multiSelectable = computed(() =>\n this.selectionMode() === \"single\" ? null : \"true\",\n );\n\n /**\n * Paging stops at the month holding the bound, not at the bound itself.\n *\n * Zag asks whether the *adjacent visible range* is still valid, which for a\n * single month is the same question: the month before this one is out of\n * bounds exactly when this month already contains `min`.\n */\n protected readonly prevDisabled = computed(() => {\n const min = this.minDay();\n return min ? compareYMD(this.view(), startOfMonth(min)) <= 0 : false;\n });\n protected readonly nextDisabled = computed(() => {\n const max = this.maxDay();\n return max ? compareYMD(this.view(), startOfMonth(max)) >= 0 : false;\n });\n\n protected readonly cells = computed((): DayCell[][] => {\n const mode = this.selectionMode();\n const view = this.view();\n const selected = this.selectedDays();\n const min = this.minDay();\n const max = this.maxDay();\n const focused = this.focused();\n const locale = this.locale();\n const [start, end] = mode === \"range\" ? selected : [];\n\n return datePickerWeeks(view).map((week) =>\n week.map((day): DayCell => {\n const outsideRange = !isSameMonth(day, view);\n const unavailable = !isWithin(day, min, max);\n const selectable = !outsideRange && !unavailable;\n const isSelected = selected.some((value) => isSameYMD(value, day));\n const rangeStart = mode === \"range\" && !!start && !!end && isSameYMD(day, start);\n const rangeEnd = mode === \"range\" && !!start && !!end && isSameYMD(day, end);\n const inRange =\n mode === \"range\" &&\n !!start &&\n !!end &&\n compareYMD(day, start) >= 0 &&\n compareYMD(day, end) <= 0;\n const weekday = ymdToDate(day).getDay();\n\n const text = longDate(day, locale);\n const ariaLabel = unavailable\n ? `Not available. ${text}`\n : rangeStart\n ? `Starting range from ${text}`\n : rangeEnd\n ? `Range ending at ${text}`\n : isSelected && mode !== \"range\"\n ? `Selected date. ${text}`\n : `Choose ${text}`;\n\n return {\n ymd: day,\n value: toISODate(day),\n day: day.day,\n ariaLabel,\n ariaDisabled: selectable ? null : \"true\",\n ariaSelected: isSelected || inRange ? \"true\" : \"false\",\n ariaInvalid: unavailable ? \"true\" : null,\n disabled: stateFlag(!selectable),\n selectable: stateFlag(selectable),\n selected: stateFlag(isSelected),\n unavailable: stateFlag(unavailable),\n outsideRange: stateFlag(outsideRange),\n weekend: stateFlag(weekday === 0 || weekday === 6),\n today: stateFlag(isSameYMD(day, this.today)),\n focus: stateFlag(isSameYMD(day, focused)),\n rangeStart: stateFlag(rangeStart),\n rangeEnd: stateFlag(rangeEnd),\n inRange: stateFlag(inRange),\n tabIndex: isSameYMD(day, focused) ? 0 : -1,\n };\n }),\n );\n });\n\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.triggerElement(),\n dismiss: () => this.close(),\n };\n\n constructor() {\n super();\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /** Ark spells the DatePicker's id prefix without the hyphen its scope has. */\n get rootId(): string {\n return `datepicker:${this.machine}`;\n }\n partId(part: string): string {\n return `datepicker:${this.machine}:${part}`;\n }\n protected inputId(index: number): string {\n return this.partId(`input:${index}`);\n }\n\n /**\n * `ngOnInit`, not `ngAfterViewInit`, and the queries are static because of it —\n * see `UioSelect` for why an inner surface has to be created first.\n */\n ngOnInit(): void {\n const first = this.selectedDays()[0];\n if (first) this.focused.set(first);\n\n const ref = this.anchored.create(\n this.host.nativeElement,\n anchoredPositions(\"bottom\", \"start\", POPUP_GUTTER),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n this.park();\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n close(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /** The formatted text one input shows. Ark renders `mm/dd/yyyy` zero-padded. */\n protected displayValue(index: number): string {\n const day = this.selectedDays()[index];\n if (!day) return \"\";\n return ymdToDate(day).toLocaleDateString(this.locale(), {\n month: \"2-digit\",\n day: \"2-digit\",\n year: \"numeric\",\n });\n }\n\n protected onInputChange(event: Event, index: number): void {\n const typed = (event.target as HTMLInputElement).value.trim();\n const parsed = typed ? new Date(typed) : null;\n const next = [...this.value()];\n if (!parsed || Number.isNaN(parsed.getTime())) {\n next.splice(index, 1);\n } else {\n next[index] = toISODate({\n year: parsed.getFullYear(),\n month: parsed.getMonth(),\n day: parsed.getDate(),\n });\n }\n this.commit(next.filter(Boolean));\n }\n\n protected page(delta: number): void {\n this.focused.set(shiftMonths(this.focused(), delta));\n flushNow(this.appRef);\n }\n\n protected choose(cell: DayCell): void {\n if (!cell.selectable || this.readOnly()) return;\n this.focused.set(cell.ymd);\n\n const mode = this.selectionMode();\n if (mode === \"multiple\") {\n const current = this.value();\n const next = current.includes(cell.value)\n ? current.filter((iso) => iso !== cell.value)\n : [...current, cell.value].sort();\n this.commit(next);\n return;\n }\n\n if (mode === \"range\") {\n const current = this.value();\n // A complete range starts a new one; a half-open one closes.\n if (current.length !== 1) {\n this.commit([cell.value]);\n return;\n }\n this.commit([current[0]!, cell.value].sort());\n this.close();\n return;\n }\n\n this.commit([cell.value]);\n this.close();\n }\n\n protected onGridKeydown(event: KeyboardEvent): void {\n const focused = this.focused();\n const shift = (days: number) => {\n const next = new Date(focused.year, focused.month, focused.day + days);\n return { year: next.getFullYear(), month: next.getMonth(), day: next.getDate() };\n };\n let next: YMD | null = null;\n switch (event.key) {\n case \"ArrowLeft\":\n next = shift(-1);\n break;\n case \"ArrowRight\":\n next = shift(1);\n break;\n case \"ArrowUp\":\n next = shift(-7);\n break;\n case \"ArrowDown\":\n next = shift(7);\n break;\n case \"Home\":\n next = shift(-ymdToDate(focused).getDay());\n break;\n case \"End\":\n next = shift(6 - ymdToDate(focused).getDay());\n break;\n case \"PageUp\":\n next = shiftMonths(focused, -1);\n break;\n case \"PageDown\":\n next = shiftMonths(focused, 1);\n break;\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const cell = this.cells()\n .flat()\n .find((candidate) => isSameYMD(candidate.ymd, focused));\n if (cell) this.choose(cell);\n return;\n }\n default:\n return;\n }\n event.preventDefault();\n this.focused.set(next);\n flushNow(this.appRef);\n this.focusedCell()?.focus({ preventScroll: true });\n }\n\n private commit(next: string[]): void {\n this.value.set(next);\n flushNow(this.appRef);\n }\n\n private triggerElement(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"trigger\"]');\n }\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ??\n null\n );\n }\n private positionerElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"positioner\"]',\n ) ?? null\n );\n }\n private focusedCell(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"table-cell-trigger\"][data-focus]',\n ) ?? null\n );\n }\n\n private setOpen(next: boolean): void {\n if (next && this.disabledInput()) return;\n this.open.set(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n if (open) this.applyOpen();\n else this.applyClose();\n }\n\n private applyOpen(): void {\n this.applied = true;\n const ref = this.anchored.overlayRef;\n if (!ref) return;\n this.surfaceView?.detectChanges();\n this.unpark();\n // Measured only now: while it was parked the popup was off-screen and the\n // CDK had placed a box with no size.\n this.anchored.reposition();\n raiseSurface(ref);\n setSurfaceInteractive(ref, true);\n this.focusedCell()?.focus({ preventScroll: true });\n pushLayer(this.document, this.layer);\n }\n\n private applyClose(): void {\n this.applied = false;\n removeLayer(this.layer);\n this.surfaceView?.detectChanges();\n const ref = this.anchored.overlayRef;\n if (ref) setSurfaceInteractive(ref, false);\n this.park();\n restoreFocus(this.triggerElement());\n }\n\n /**\n * `.date-picker__popup` declares `display`, which overrides the `hidden`\n * attribute — so a closed popup stays laid out and swallows clicks unless it\n * is moved out of the way. Zag parks its positioner a viewport up for exactly\n * this reason.\n */\n private park(): void {\n const positioner = this.positionerElement();\n if (!positioner) return;\n positioner.style.transform = PARKED;\n positioner.style.pointerEvents = \"none\";\n }\n\n private unpark(): void {\n const positioner = this.positionerElement();\n if (!positioner) return;\n positioner.style.transform = \"\";\n positioner.style.pointerEvents = \"\";\n }\n}\n","import {\n ApplicationRef,\n Component,\n DestroyRef,\n ElementRef,\n TemplateRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { NgTemplateOutlet } from \"@angular/common\";\nimport { carouselStyles, type CarouselVariants, type ControlSize } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type CarouselSize = ControlSize;\nexport type CarouselVariant = NonNullable<CarouselVariants[\"variant\"]>;\nexport type CarouselOrientation = \"horizontal\" | \"vertical\";\n\nexport interface CarouselSlide {\n /** Unique across the carousel. */\n id: string;\n /**\n * A string, or a template for anything richer.\n *\n * The other three libraries take a node here, which Angular has no equivalent\n * of inside a data array — the same shape as `SplitterPanelDef.content`.\n */\n content?: string | TemplateRef<unknown>;\n}\n\n/** zag's default when `autoplay` is `true` rather than `{ delay }`. */\nconst DEFAULT_AUTOPLAY_DELAY = 4000;\n\n/**\n * The fraction of a slide that has to be inside the viewport for it to count as\n * in view. zag's `inViewThreshold`, handed to the same `IntersectionObserver`\n * zag uses, so both libraries answer `data-inview` from the same measurement.\n */\nconst IN_VIEW_THRESHOLD = 0.6;\n\n/**\n * How far the track may sit from its page's snap point before a refresh drags it\n * back. zag's `DRIFT_THRESHOLD`, in pixels.\n */\nconst DRIFT_THRESHOLD = 1;\n\n/** Authored default gap, matching the React component's. */\nconst DEFAULT_SPACING = \"var(--spacing-space-04)\";\n\n/**\n * The pages of a carousel, from the laid-out geometry — zag's page count,\n * reproduced.\n *\n * ── Why this is measured rather than counted ────────────────────────────────\n *\n * The obvious arithmetic is wrong, and it is wrong in a way that only a browser\n * can show. zag lays the track out with CSS scroll snapping and reads the snap\n * positions back (`@zag-js/scroll-snap` `getScrollSnapPositions`): every item's\n * scroll offset, clamped into `[0, scrollWidth − offsetWidth]`, de-duplicated.\n * The pages are those positions.\n *\n * Clamping is what makes the count un-derivable. With `slidesPerPage: 3` in a\n * 1280px viewport a slide is 426.65625px wide, `scrollWidth` and `offsetWidth`\n * are integers, and whether the second-to-last offset lands above or below the\n * clamp is decided by sub-pixel rounding. Four slides at three per page measure\n * **three** pages, not the two that `ceil(4 / 3)` predicts, because\n * `maxScroll` rounds to 427 and the third item's offset is 853.31 — over the\n * line, so it collapses onto the end while the second does not. Five slides at\n * three per page measure three; six measure five. No closed form reproduces\n * that sequence, and one that agreed on the easy cases would put Angular's\n * `disabled` arrows and `data-current` dot out of step with React's on the hard\n * ones without ever failing a unit test.\n *\n * So this is zag's computation on zag's inputs. Every whole slide snaps —\n * `Carousel.css` sets `scroll-snap-align: start` on `.carousel__item`, which is\n * why the offsets are *all* the items' and not only the ones zag also writes it\n * on inline.\n *\n * Checked, not merely ported: `carousel.spec.ts` holds geometry captured from a\n * running `@ark-ui/react` Carousel in Chromium — offsets, `maxScroll`, and the\n * page count the machine arrived at — for twenty-odd shapes, and asserts this\n * function reproduces the count from the same numbers.\n *\n * @param offsets Each item's scroll offset from the start of the track.\n * @param maxScroll `scrollWidth − offsetWidth` along the scroll axis.\n */\nexport function carouselSnapPoints(offsets: readonly number[], maxScroll: number): number[] {\n const limit = Math.max(maxScroll, 0);\n const points: number[] = [];\n for (const offset of offsets) {\n const clamped = Math.min(Math.max(offset, 0), limit);\n if (!points.includes(clamped)) points.push(clamped);\n }\n return points;\n}\n\n/**\n * The page count before anything has been laid out.\n *\n * zag seeds `pageSnapPoints` with this and replaces it the moment the track has\n * a width, so it is what the first frame renders and never what a user sees. It\n * is reproduced rather than left at zero because the alternative first frame —\n * no pages, both arrows `disabled` — is the one a screenshot test would catch.\n *\n * zag's `getPageSnapPoints`, transcribed: a page starts at every `perMove`-th\n * slide, and the walk stops as soon as a page would run off the end.\n */\nexport function carouselSeedPageCount(slideCount: number, slidesPerPage: number): number {\n const perMove = Math.floor(slidesPerPage);\n if (slideCount <= 0 || slidesPerPage <= 0 || perMove <= 0) return 0;\n let pages = 0;\n for (let i = 0; i < slideCount; i += perMove) {\n if (i + slidesPerPage > slideCount) break;\n pages++;\n }\n return pages;\n}\n\n/**\n * A scroll-snap slide track with page controls and dot indicators.\n *\n * ```html\n * <div uioCarousel [slides]=\"slides\" [(page)]=\"page\"></div>\n * ```\n *\n * ── What is measured, and why all of it has to be ───────────────────────────\n *\n * Two things here read the laid-out DOM rather than deriving anything:\n * `carouselSnapPoints` above, and `data-inview`. Both because the alternative\n * silently disagrees with the other three libraries.\n *\n * `data-inview` is an `IntersectionObserver` at threshold 0.6 rooted on the item\n * group — zag's own mechanism, and a browser API rather than a dependency. A\n * whole-slide count would be exact for an integer `slidesPerPage` and wrong for\n * a fractional one: at `slidesPerPage: 1.8` the second slide is 80% visible,\n * which clears the threshold, and no count of whole slides predicts that.\n *\n * The cost is that `data-inview` — and the `aria-hidden` derived from it — is\n * empty for a frame after mount, exactly as it is in the other three libraries,\n * which seed `slidesInView: []` and fill it from the observer.\n *\n * ── `loop` is derived from `autoplay` ───────────────────────────────────────\n *\n * The machine defaults `loop` to `!!autoplay`, so an autoplaying carousel wraps\n * unless the caller says otherwise, and a *playing* carousel wraps even when\n * `loop` is false — but stops at the end rather than wrapping forever, because\n * the tick pauses instead of advancing once `canScrollNext` is false. Both\n * halves are reproduced; defaulting the input to `false` instead would replace a\n * derivation with a decision the caller never made, and the symptom is the\n * previous arrow rendering `disabled` on the first slide.\n *\n * ── Reduced motion ─────────────────────────────────────────────────────────\n *\n * There is deliberately no policy here. zag's carousel does not consult\n * `prefers-reduced-motion`, so neither does this; `Carousel.css` drops the\n * indicator transition under the media query, which is where the design system\n * expresses it. Inventing an autoplay policy would make Angular the one library\n * whose carousel stops moving.\n */\n@Component({\n selector: \"div[uioCarousel]\",\n standalone: true,\n exportAs: \"uioCarousel\",\n imports: [UioButton, NgTemplateOutlet],\n template: `\n <div\n class=\"carousel__items\"\n data-scope=\"carousel\"\n data-part=\"item-group\"\n tabindex=\"0\"\n [id]=\"partId('item-group')\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-live]=\"playing() ? 'off' : 'polite'\"\n [attr.style]=\"itemGroupStyle()\"\n (keydown)=\"onItemGroupKeydown($event)\"\n >\n @for (slide of slides(); track slide.id; let index = $index) {\n <div\n class=\"carousel__item\"\n data-scope=\"carousel\"\n data-part=\"item\"\n role=\"group\"\n aria-roledescription=\"slide\"\n [id]=\"partId('item:' + index)\"\n [attr.data-index]=\"index\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-inview]=\"flag(inView().includes(index))\"\n [attr.aria-hidden]=\"inView().includes(index) ? null : 'true'\"\n [attr.aria-label]=\"index + 1 + ' of ' + slides().length\"\n [attr.style]=\"itemStyle(index)\"\n >\n @if (asTemplate(slide.content); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ slide.content }}\n }\n </div>\n }\n </div>\n\n <div\n class=\"carousel__control\"\n data-scope=\"carousel\"\n data-part=\"control\"\n [attr.data-orientation]=\"orientation()\"\n >\n @if (variant() !== \"minimal\") {\n <button\n uioButton\n intent=\"ghost\"\n [icon]=\"glyph('chevron-left')\"\n aria-label=\"Previous slide\"\n data-scope=\"carousel\"\n data-part=\"prev-trigger\"\n [id]=\"partId('prev-trigger')\"\n [size]=\"size()\"\n [disabled]=\"!canScrollPrev()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-controls]=\"partId('item-group')\"\n (click)=\"previous()\"\n ></button>\n }\n\n @if (showIndicators()) {\n <div\n class=\"carousel__indicators\"\n data-scope=\"carousel\"\n data-part=\"indicator-group\"\n [id]=\"partId('indicator-group')\"\n [attr.data-orientation]=\"orientation()\"\n (keydown)=\"onIndicatorKeydown($event)\"\n >\n <!--\n One indicator per *slide*, not per page. That is what the other three\n libraries render, because the component maps its own slide list here\n and hands each entry an index. With more than one slide per page the\n trailing dots therefore name pages that do not exist; zag clamps such\n an index on arrival rather than refusing it, and so does \"commit\".\n -->\n @for (slide of slides(); track slide.id; let index = $index) {\n <button\n class=\"carousel__indicator\"\n data-scope=\"carousel\"\n data-part=\"indicator\"\n type=\"button\"\n [id]=\"partId('indicator:' + index)\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-index]=\"index\"\n [attr.data-current]=\"flag(index === activePage())\"\n [attr.aria-label]=\"'Go to slide ' + (index + 1)\"\n (click)=\"goTo(index)\"\n ></button>\n }\n </div>\n }\n\n @if (variant() !== \"minimal\") {\n <button\n uioButton\n intent=\"ghost\"\n [icon]=\"glyph('chevron-right')\"\n aria-label=\"Next slide\"\n data-scope=\"carousel\"\n data-part=\"next-trigger\"\n [id]=\"partId('next-trigger')\"\n [size]=\"size()\"\n [disabled]=\"!canScrollNext()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.aria-controls]=\"partId('item-group')\"\n (click)=\"next()\"\n ></button>\n }\n </div>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n role: \"region\",\n \"aria-roledescription\": \"carousel\",\n \"[attr.aria-label]\": \"label() ?? null\",\n /**\n * The whole `style` attribute rather than `[style.--slide-spacing]`, so the\n * custom properties reach the element the same way in a JIT-compiled spec as\n * in the built package — the arrangement `UioSteps` and `UioProgress` use.\n * `Carousel.css` reads all three, and the item-size expression is zag's own:\n * a hardcoded width here would put the layout and the snap points — which\n * are measured off that layout — out of step.\n */\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioCarousel extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"carousel\";\n readonly part = \"root\";\n\n readonly slides = input<CarouselSlide[]>([]);\n /** Accessible label for the carousel region. */\n readonly label = input<string | undefined>(undefined);\n /** The visible page. Uncontrolled until something binds it. */\n readonly page = model(0);\n readonly pageChange = output<number>();\n /** How many slides are visible at once. */\n readonly slidesPerPage = input(1);\n /** Gap between slides, as a CSS length. */\n readonly spacing = input(DEFAULT_SPACING);\n /**\n * Wraps from the last page back to the first. Left `undefined` on purpose —\n * see the class note; the resolved value is `loop ?? !!autoplay`.\n */\n readonly loop = input<boolean | undefined>(undefined);\n /** `true` for zag's 4s interval, or `{ delay }` in milliseconds. */\n readonly autoplay = input<boolean | { delay: number } | undefined>(undefined);\n override readonly orientation = input<CarouselOrientation>(\"horizontal\");\n readonly size = input<CarouselSize>(\"md\");\n readonly variant = input<CarouselVariant>(\"default\");\n readonly showIndicators = input(true, { transform: booleanAttribute });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly hostClass = computed(() =>\n carouselStyles({ size: this.size(), variant: this.variant() }),\n );\n\n protected readonly horizontal = computed(() => this.orientation() === \"horizontal\");\n\n /**\n * Slides moved per page.\n *\n * `Math.floor`, because zag's `slidesPerMove` defaults to `\"auto\"` and resolves\n * to `Math.floor(slidesPerPage)` — a carousel showing 2.5 slides moves two.\n */\n private readonly perMove = computed(() => Math.max(1, Math.floor(this.slidesPerPage())));\n\n /** Measured snap positions; `null` until the track has been laid out. */\n private readonly snapPoints = signal<number[] | null>(null);\n\n protected readonly pageCount = computed(\n () =>\n this.snapPoints()?.length ??\n carouselSeedPageCount(this.slides().length, this.slidesPerPage()),\n );\n\n /**\n * The page actually shown, clamped into range.\n *\n * zag clamps in `connect` rather than in the machine, so a caller who binds\n * `page` past the end sees the last page while keeping their own value. The\n * same split is reproduced, which is what lets an indicator name a page that\n * does not exist without the component rewriting the caller's signal.\n */\n protected readonly activePage = computed(() => {\n const pages = this.pageCount();\n if (pages === 0) return 0;\n return Math.min(Math.max(this.page(), 0), pages - 1);\n });\n\n private readonly resolvedLoop = computed(() => this.loop() ?? !!this.autoplay());\n\n protected readonly playing = signal(false);\n\n protected readonly canScrollPrev = computed(() => this.resolvedLoop() || this.activePage() > 0);\n protected readonly canScrollNext = computed(\n () => this.resolvedLoop() || this.activePage() < this.pageCount() - 1,\n );\n\n private readonly inViewSet = signal<number[]>([]);\n protected readonly inView = this.inViewSet.asReadonly();\n\n protected readonly rootStyle = computed(\n () =>\n `--slides-per-page: ${this.slidesPerPage()}; --slide-spacing: ${this.spacing()}; ` +\n \"--slide-item-size: calc(100% / var(--slides-per-page) - var(--slide-spacing) * \" +\n \"(var(--slides-per-page) - 1) / var(--slides-per-page));\",\n );\n\n protected readonly itemGroupStyle = computed(() => {\n const horizontal = this.horizontal();\n return (\n \"display: grid; gap: var(--slide-spacing); \" +\n `scroll-snap-type: ${horizontal ? \"x\" : \"y\"} mandatory; ` +\n `grid-auto-flow: ${horizontal ? \"column\" : \"row\"}; ` +\n \"scrollbar-width: none; overscroll-behavior-x: contain; \" +\n `${horizontal ? \"grid-auto-columns\" : \"grid-auto-rows\"}: var(--slide-item-size); ` +\n `${horizontal ? \"overflow-x\" : \"overflow-y\"}: auto;`\n );\n });\n\n protected itemStyle(index: number): string {\n const horizontal = this.horizontal();\n // zag writes `scroll-snap-align` inline on the items a page starts at, and\n // leaves the rest to `.carousel__item`, which sets it on every slide anyway.\n // Reproduced as written rather than tidied: the stylesheet is shared, so the\n // rendered behaviour is identical either way, and matching the inline styles\n // keeps a DOM diff between the two libraries readable.\n const snaps = index % this.perMove() === 0;\n return (\n `flex: 0 0 auto; ${horizontal ? \"max-width\" : \"max-height\"}: 100%;` +\n (snaps ? \" scroll-snap-align: start;\" : \"\")\n );\n }\n\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected asTemplate(content: CarouselSlide[\"content\"]): TemplateRef<unknown> | null {\n return content instanceof TemplateRef ? content : null;\n }\n\n private observer: IntersectionObserver | null = null;\n private resize: ResizeObserver | null = null;\n private observed: Element[] = [];\n private timer: ReturnType<typeof setInterval> | null = null;\n\n constructor() {\n super();\n\n /**\n * Re-measure whenever the shape of the track changes.\n *\n * zag watches the DOM with a `MutationObserver` because it cannot know when\n * its consumer re-renders. Angular can: reading the inputs that decide the\n * layout is the same trigger, without a second observer. `afterRenderEffect`\n * rather than `effect`, because all of this reads geometry and has to run\n * after the view it is measuring exists.\n */\n afterRenderEffect(() => {\n this.slides();\n this.slidesPerPage();\n this.spacing();\n this.orientation();\n untracked(() => {\n this.observeItems();\n this.refresh();\n });\n });\n\n // The scroll position is the machine's only real output — CSS snapping does\n // the rest — so it is written whenever the resolved page moves.\n afterRenderEffect(() => {\n const page = this.activePage();\n untracked(() => this.scrollToPage(page));\n });\n\n afterRenderEffect(() => {\n const autoplay = this.autoplay();\n untracked(() => this.playing.set(!!autoplay));\n });\n\n afterRenderEffect(() => {\n const delay = this.autoplayInterval();\n const playing = this.playing();\n untracked(() => this.runAutoplay(playing, delay));\n });\n\n this.host.nativeElement.ownerDocument.addEventListener(\n \"visibilitychange\",\n this.onVisibilityChange,\n );\n\n inject(DestroyRef).onDestroy(() => {\n this.observer?.disconnect();\n this.resize?.disconnect();\n this.stopAutoplay();\n this.host.nativeElement.ownerDocument.removeEventListener(\n \"visibilitychange\",\n this.onVisibilityChange,\n );\n });\n }\n\n private readonly autoplayInterval = computed(() => {\n const autoplay = this.autoplay();\n return typeof autoplay === \"object\" && autoplay !== null\n ? autoplay.delay\n : DEFAULT_AUTOPLAY_DELAY;\n });\n\n private itemGroupEl(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"item-group\"]');\n }\n\n private itemEls(): HTMLElement[] {\n const root = this.itemGroupEl();\n return root ? [...root.querySelectorAll<HTMLElement>('[data-part=\"item\"]')] : [];\n }\n\n private observeItems(): void {\n const root = this.itemGroupEl();\n if (!root || typeof IntersectionObserver === \"undefined\") return;\n const items = this.itemEls();\n // Re-observing the same elements replays every entry and rewrites the set\n // with the values it already holds, so an unrelated re-render would make\n // `data-inview` flicker.\n const unchanged =\n !!this.observer &&\n items.length === this.observed.length &&\n items.every((item, index) => item === this.observed[index]);\n if (unchanged) return;\n\n this.observer?.disconnect();\n this.resize?.disconnect();\n this.observed = items;\n\n this.observer = new IntersectionObserver(\n (entries) => {\n const next = new Set(this.inViewSet());\n for (const entry of entries) {\n const index = Number((entry.target as HTMLElement).dataset[\"index\"] ?? \"-1\");\n if (Number.isNaN(index) || index === -1) continue;\n if (entry.isIntersecting) next.add(index);\n else next.delete(index);\n }\n this.inViewSet.set([...next].sort((a, b) => a - b));\n flushNow(this.appRef);\n },\n { root, threshold: IN_VIEW_THRESHOLD },\n );\n for (const item of items) this.observer.observe(item);\n\n if (typeof ResizeObserver === \"undefined\") return;\n // The snap points are pixel positions, so anything that changes the track's\n // width changes the page count — a window resize as much as a new slide.\n this.resize = new ResizeObserver(() => this.refresh());\n this.resize.observe(root);\n for (const item of items) this.resize.observe(item);\n }\n\n /** Re-measure the snap points, and drag the track back if it has drifted. */\n private refresh(): void {\n const el = this.itemGroupEl();\n if (!el) return;\n const horizontal = this.horizontal();\n /**\n * A track with no extent has not been laid out, and its geometry is not\n * evidence: every item measures at offset 0, the clamp collapses them onto\n * each other, and the carousel reports one page with both arrows disabled.\n * That is the state a `display: none` ancestor, a detached element and a\n * jsdom test all produce, and in every one of them the seed count is closer\n * to the truth than the measurement.\n */\n if ((horizontal ? el.offsetWidth : el.offsetHeight) === 0) return;\n const groupBox = el.getBoundingClientRect();\n const scrolled = horizontal ? el.scrollLeft : el.scrollTop;\n const offsets = this.itemEls().map((item) => {\n const box = item.getBoundingClientRect();\n return horizontal ? box.left - groupBox.left + scrolled : box.top - groupBox.top + scrolled;\n });\n const maxScroll = horizontal\n ? el.scrollWidth - el.offsetWidth\n : el.scrollHeight - el.offsetHeight;\n const points = carouselSnapPoints(offsets, maxScroll);\n\n const previous = this.snapPoints();\n const same =\n !!previous &&\n previous.length === points.length &&\n previous.every((value, index) => value === points[index]);\n if (!same) {\n this.snapPoints.set(points);\n flushNow(this.appRef);\n }\n\n // zag's `scrollToPageIfDrifted`: a re-measure that leaves the track between\n // two pages puts it back on one, instantly, without animating a correction\n // nobody asked for.\n const target = points[this.activePage()];\n if (target == null || Math.abs(scrolled - target) <= DRIFT_THRESHOLD) return;\n el.scrollTo(horizontal ? { left: target } : { top: target });\n }\n\n private scrollToPage(page: number): void {\n const el = this.itemGroupEl();\n const target = this.snapPoints()?.[page];\n if (!el || target == null) return;\n const horizontal = this.horizontal();\n if (Math.abs((horizontal ? el.scrollLeft : el.scrollTop) - target) <= DRIFT_THRESHOLD) return;\n el.scrollTo(horizontal ? { left: target } : { top: target });\n }\n\n private runAutoplay(playing: boolean, delay: number): void {\n this.stopAutoplay();\n if (!playing) return;\n this.timer = setInterval(() => {\n // zag's `autoUpdateSlide`: a tick that cannot advance pauses rather than\n // wrapping, so `autoplay` with `loop: false` stops on the last page —\n // which is also what flips `aria-live` back to \"polite\".\n if (!this.canScrollNext()) {\n this.playing.set(false);\n flushNow(this.appRef);\n return;\n }\n this.advance(1);\n flushNow(this.appRef);\n }, delay);\n }\n\n private stopAutoplay(): void {\n if (this.timer === null) return;\n clearInterval(this.timer);\n this.timer = null;\n }\n\n /** A carousel nobody can see does not advance. zag's `trackDocumentVisibility`. */\n private readonly onVisibilityChange = (): void => {\n if (this.host.nativeElement.ownerDocument.visibilityState === \"visible\") return;\n this.playing.set(false);\n };\n\n protected next(): void {\n this.advance(1);\n flushNow(this.appRef);\n }\n\n protected previous(): void {\n this.advance(-1);\n flushNow(this.appRef);\n }\n\n protected goTo(page: number): void {\n this.commit(page);\n flushNow(this.appRef);\n }\n\n /**\n * One step in either direction.\n *\n * A *running* carousel wraps whatever `loop` says — zag reads\n * `state.matches(\"autoplay\") || prop(\"loop\")` here — so pausing is the only\n * thing that makes autoplay stop at the end.\n */\n private advance(step: number): void {\n const pages = this.pageCount();\n if (pages === 0) return;\n const loop = this.playing() || this.resolvedLoop();\n const next = this.activePage() + step;\n if (next < 0) this.commit(loop ? pages - 1 : 0);\n else if (next > pages - 1) this.commit(loop ? 0 : pages - 1);\n else this.commit(next);\n }\n\n private commit(page: number): void {\n if (page === this.page()) return;\n this.page.set(page);\n this.pageChange.emit(page);\n }\n\n /** The arrow keys move the track while the viewport itself has focus. */\n protected onItemGroupKeydown(event: KeyboardEvent): void {\n const step = this.stepForKey(event.key);\n if (step === null) return;\n event.preventDefault();\n this.advance(step);\n flushNow(this.appRef);\n }\n\n /**\n * The indicator strip takes Home and End as well as the arrows, and moves\n * focus with the selection — a dot that changes the page without moving focus\n * leaves a keyboard user pressing an arrow that no longer does anything.\n */\n protected onIndicatorKeydown(event: KeyboardEvent): void {\n const pages = this.pageCount();\n const jump = event.key === \"Home\" ? 0 : event.key === \"End\" ? pages - 1 : null;\n if (jump !== null) {\n event.preventDefault();\n this.commit(jump);\n this.focusIndicator();\n flushNow(this.appRef);\n return;\n }\n const step = this.stepForKey(event.key);\n if (step === null) return;\n event.preventDefault();\n this.advance(step);\n this.focusIndicator();\n flushNow(this.appRef);\n }\n\n private stepForKey(key: string): number | null {\n const horizontal = this.horizontal();\n if (key === \"ArrowRight\") return horizontal ? 1 : null;\n if (key === \"ArrowLeft\") return horizontal ? -1 : null;\n if (key === \"ArrowDown\") return horizontal ? null : 1;\n if (key === \"ArrowUp\") return horizontal ? null : -1;\n return null;\n }\n\n private focusIndicator(): void {\n queueMicrotask(() => {\n this.host.nativeElement\n .querySelector<HTMLElement>(`[data-part=\"indicator\"][data-index=\"${this.activePage()}\"]`)\n ?.focus({ preventScroll: true });\n });\n }\n}\n","import {\n ApplicationRef,\n Component,\n DestroyRef,\n ElementRef,\n TemplateRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { NgTemplateOutlet } from \"@angular/common\";\nimport { marqueeStyles } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\n\nexport type MarqueeOrientation = \"horizontal\" | \"vertical\";\n\nexport interface MarqueeItem {\n /** Unique across the marquee. */\n id: string;\n /** A string, or a template for anything richer — see `CarouselSlide.content`. */\n content?: string | TemplateRef<unknown>;\n}\n\n/** Authored default gap, matching the React component's. */\nconst DEFAULT_SPACING = \"var(--spacing-space-04)\";\n\n/**\n * The duration the machine uses before it has measured anything, in seconds:\n * `2000 / speed`. zag's `duration` bindable default, and what the first frame\n * animates at.\n */\nconst UNMEASURED_TRAVEL = 2000;\n\n/** zag clamps `speed` off zero before dividing by it. */\nconst MIN_SPEED = 0.001;\n\n/**\n * How many copies of the content fill the track.\n *\n * ── This is measured in every library, and has to be ────────────────────────\n *\n * `autoFill` promises there is never a gap, which means enough copies of the\n * content to cover the viewport — and how many that is depends on how wide the\n * content turned out to be, which depends on the caller's items, the font, and\n * the `spacing` gap they chose. zag measures `root.clientWidth` and\n * `content[0].clientWidth` with a `ResizeObserver` and divides. There is no\n * arithmetic that gets there from the props.\n *\n * It is not a detail the gate can miss, either: each copy is a `content` part\n * carrying `data-index`, `data-clone`, `role=\"presentation\"` and\n * `aria-hidden=\"true\"`, so a library that guessed the count wrong renders a\n * different number of elements from React and fails on the first case.\n *\n * @param rootSize The viewport's extent along the scroll axis.\n * @param contentSize The first copy's extent along the same axis.\n */\nexport function marqueeMultiplier(\n rootSize: number,\n contentSize: number,\n autoFill: boolean,\n): number {\n if (!autoFill) return 1;\n if (contentSize === 0) return 1;\n return contentSize < rootSize ? Math.ceil(rootSize / contentSize) : 1;\n}\n\n/**\n * Seconds for one pass, from the measured geometry and the caller's `speed`.\n *\n * zag's `calculateDuration`. Without `autoFill` a pass covers whichever is\n * longer — the content or the viewport — so short content still crosses the\n * whole track; with it, the copies are what travel, so the distance is the\n * content times the multiplier.\n */\nexport function marqueeDuration(options: {\n rootSize: number;\n contentSize: number;\n speed: number;\n multiplier: number;\n autoFill: boolean;\n}): number {\n const { rootSize, contentSize, multiplier, autoFill } = options;\n const speed = Math.max(MIN_SPEED, options.speed);\n if (autoFill) return (contentSize * multiplier) / speed;\n return contentSize < rootSize ? rootSize / speed : contentSize / speed;\n}\n\n/**\n * Which way the content travels, as the end offset the keyframes animate to.\n *\n * zag's `getMarqueeTranslate`. `dir` is a parameter rather than a constant\n * because the sign flips with it for the inline sides and not for the block\n * ones — the library is `ltr` throughout today, and hardcoding that here would\n * put the bug somewhere nobody would look for it.\n */\nexport function marqueeTranslate(\n side: \"start\" | \"end\" | \"top\" | \"bottom\",\n dir: \"ltr\" | \"rtl\" = \"ltr\",\n): string {\n if (side === \"top\") return \"-100%\";\n if (side === \"bottom\") return \"100%\";\n const negative = (side === \"start\" && dir === \"ltr\") || (side === \"end\" && dir === \"rtl\");\n return negative ? \"-100%\" : \"100%\";\n}\n\n/**\n * Continuously scrolling content.\n *\n * ```html\n * <div uioMarquee [items]=\"items\"></div>\n * ```\n *\n * ── The animation is the stylesheet's, and so is reduced motion ─────────────\n *\n * This is the one component whose animation is authored in\n * `@ui-organized/core` rather than driven from here: the machine measures the\n * content, derives the timing, and publishes duration, delay, loop count,\n * translate and spacing as custom properties, and `Marquee.css` owns the\n * `@keyframes`.\n *\n * That is also where `prefers-reduced-motion` is handled — the stylesheet drops\n * the animation entirely under the media query, because continuous motion with\n * no way to stop it is a WCAG 2.2.2 failure. Forcing `paused` here instead\n * would make the component disagree with its own stylesheet, render a\n * `data-paused` the other three libraries do not, and fail the parity gate on a\n * machine with the preference set.\n *\n * ── `reverse` only names the direction ──────────────────────────────────────\n *\n * The public prop reaches the DOM as `data-reverse` on every content copy and\n * changes nothing else, because the direction of travel comes from `side`,\n * which is chosen from `orientation` alone. That is what the other three\n * libraries do, and reproducing it is deliberate: making `reverse` flip `side`\n * here would leave Angular scrolling the other way from React for the same\n * props.\n */\n@Component({\n selector: \"div[uioMarquee]\",\n standalone: true,\n exportAs: \"uioMarquee\",\n imports: [NgTemplateOutlet],\n template: `\n @if (showEdges()) {\n <!--\n Both edges are named \"start\" and \"end\" whatever the orientation. zag's\n edge part also understands \"top\" and \"bottom\"; the component never asks\n for them, and \"Marquee.css\" selects on [data-side=\"end\"] under\n .marquee--vertical to turn the fade round instead.\n -->\n <div\n class=\"marquee__edge\"\n data-scope=\"marquee\"\n data-part=\"edge\"\n data-side=\"start\"\n [attr.data-orientation]=\"orientation()\"\n [attr.style]=\"edgeStyle('start')\"\n ></div>\n <div\n class=\"marquee__edge\"\n data-scope=\"marquee\"\n data-part=\"edge\"\n data-side=\"end\"\n [attr.data-orientation]=\"orientation()\"\n [attr.style]=\"edgeStyle('end')\"\n ></div>\n }\n\n <div\n class=\"marquee__viewport\"\n data-scope=\"marquee\"\n data-part=\"viewport\"\n [id]=\"partId('viewport')\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-side]=\"side()\"\n [attr.style]=\"viewportStyle()\"\n >\n @for (copy of copies(); track copy) {\n <div\n class=\"marquee__content\"\n data-scope=\"marquee\"\n data-part=\"content\"\n [id]=\"partId('content:' + copy)\"\n [attr.data-index]=\"copy\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-side]=\"side()\"\n [attr.data-reverse]=\"flag(reverse())\"\n [attr.data-clone]=\"flag(copy > 0)\"\n [attr.role]=\"copy > 0 ? 'presentation' : null\"\n [attr.aria-hidden]=\"copy > 0 ? 'true' : null\"\n [attr.style]=\"contentStyle()\"\n >\n @for (item of items(); track item.id) {\n <div\n class=\"marquee__item\"\n data-scope=\"marquee\"\n data-part=\"item\"\n [attr.style]=\"itemStyle()\"\n >\n @if (asTemplate(item.content); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n {{ item.content }}\n }\n </div>\n }\n </div>\n }\n </div>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n role: \"region\",\n \"aria-roledescription\": \"marquee\",\n \"aria-live\": \"off\",\n \"aria-label\": \"Marquee content\",\n \"[attr.data-paused]\": \"flag(paused())\",\n \"[attr.style]\": \"rootStyle()\",\n \"(mouseenter)\": \"onInteraction(true)\",\n \"(mouseleave)\": \"onInteraction(false)\",\n \"(focusin)\": \"onFocusIn($event)\",\n \"(focusout)\": \"onFocusOut($event)\",\n },\n})\nexport class UioMarquee extends UioPart {\n readonly scope = \"marquee\";\n readonly part = \"root\";\n\n readonly items = input<MarqueeItem[]>([]);\n /** Pixels travelled per second. */\n readonly speed = input(50);\n /** Seconds before the first pass. */\n readonly delay = input(0);\n override readonly orientation = input<MarqueeOrientation>(\"horizontal\");\n /** Names the direction on every content copy. See the class note. */\n readonly reverse = input(false, { transform: booleanAttribute });\n /** Gap between items, as a CSS length. */\n readonly spacing = input(DEFAULT_SPACING);\n /** Repeats the content until the track is full. */\n readonly autoFill = input(true, { transform: booleanAttribute });\n /** Pauses while hovered or focused. */\n readonly pauseOnInteraction = input(false, { transform: booleanAttribute });\n /** Whether it is stopped. Uncontrolled until something binds it. */\n readonly paused = model(false);\n readonly pausedChange = output<boolean>();\n /** Passes before stopping. 0 scrolls forever. */\n readonly loopCount = input(0);\n /** Fades the leading and trailing edges into the background. */\n readonly showEdges = input(true, { transform: booleanAttribute });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly hostClass = computed(() =>\n marqueeStyles({ orientation: this.orientation() }),\n );\n\n override readonly state = computed(() => (this.paused() ? \"paused\" : \"idle\"));\n\n private readonly vertical = computed(() => this.orientation() === \"vertical\");\n\n /**\n * The machine has no `orientation`; it has `side`, the direction of travel,\n * which implies the axis. The component keeps the library's spelling and\n * picks the default side for each axis here — the same mapping the other\n * three libraries make.\n */\n protected readonly side = computed<\"start\" | \"top\">(() =>\n this.vertical() ? \"top\" : \"start\",\n );\n\n /**\n * The last measurement — a plain field, and that is the whole point.\n *\n * ── Why the count does not chase itself ─────────────────────────────────\n *\n * zag keeps this in a *ref*, which does not notify: the `ResizeObserver`\n * writes to it and nothing re-renders. The multiplier is a `computed` that\n * reads it, so it is re-derived on whatever render happens next, from\n * whichever measurement was most recent.\n *\n * That is not a detail. A **vertical** marquee has no height of its own — it\n * is as tall as the copies inside it — so a measurement that triggered a\n * render would measure a taller root, ask for more copies, and grow again.\n * With this in a signal, three items became fourteen hundred copies before\n * the browser gave up. React renders four, from the single measurement taken\n * while the first two copies were on screen (`root 284px / content 134px`\n * → multiplier 3 → four copies, and `--marquee-duration: 8.04s` computed from\n * the same numbers). This field, and the methods below that read it without\n * subscribing to it, are what reproduce that.\n */\n private dimensionsRef: { rootSize: number; contentSize: number } | null = null;\n\n /**\n * Bumped exactly once, when the first measurement lands.\n *\n * zag's `initialDurationSet`: the first measurement sets `duration`, which is\n * context rather than a ref and so *does* render. Every later measurement is\n * silent. Reading this signal in the methods below is what gives them the same\n * single, deliberate re-render.\n */\n private readonly measured = signal(0);\n\n private multiplier(): number {\n this.measured();\n const dimensions = this.dimensionsRef;\n if (!dimensions) return 1;\n return marqueeMultiplier(dimensions.rootSize, dimensions.contentSize, this.autoFill());\n }\n\n /**\n * One entry per rendered copy — the original, then the clones.\n *\n * A method rather than a `computed`, so that it is re-evaluated with every\n * change-detection pass over this view, exactly as zag's `computed` is\n * re-derived with every React render. A `computed` would memoise on a field\n * that never notifies and freeze the count at one copy.\n */\n protected copies(): number[] {\n return Array.from({ length: this.multiplier() + 1 }, (_, index) => index);\n }\n\n private duration(): number {\n this.measured();\n const dimensions = this.dimensionsRef;\n // Before anything has a width the machine animates at `2000 / speed`, and\n // replaces it the moment the observer fires. Reproduced rather than left at\n // zero, so the first frame is a slow pass rather than an instant one.\n if (!dimensions) return UNMEASURED_TRAVEL / Math.max(MIN_SPEED, this.speed());\n return marqueeDuration({\n rootSize: dimensions.rootSize,\n contentSize: dimensions.contentSize,\n speed: this.speed(),\n multiplier: this.multiplier(),\n autoFill: this.autoFill(),\n });\n }\n\n protected rootStyle(): string {\n const vertical = this.vertical();\n const loops = this.loopCount();\n return (\n `display: flex; flex-direction: ${vertical ? \"column\" : \"row\"}; position: relative; ` +\n // Clipping is what makes the track a window rather than a long row, and\n // the containment keeps an animation that never stops from invalidating\n // the whole page's layout.\n \"overflow: hidden; contain: layout style paint; \" +\n `--marquee-duration: ${this.duration()}s; ` +\n `--marquee-spacing: ${this.spacing()}; ` +\n `--marquee-delay: ${this.delay()}s; ` +\n `--marquee-loop-count: ${loops === 0 ? \"infinite\" : loops}; ` +\n `--marquee-translate: ${marqueeTranslate(this.side())};`\n );\n }\n\n protected readonly viewportStyle = computed(() => {\n const vertical = this.vertical();\n return (\n `display: flex; ${vertical ? \"height\" : \"width\"}: 100%; ` +\n `flex-direction: ${vertical ? \"column\" : \"row\"};`\n );\n });\n\n protected readonly contentStyle = computed(() => {\n const vertical = this.vertical();\n return (\n `display: flex; flex-direction: ${vertical ? \"column\" : \"row\"}; flex-shrink: 0; ` +\n \"backface-visibility: hidden; -webkit-backface-visibility: hidden; \" +\n `will-change: ${this.paused() ? \"auto\" : \"transform\"}; transform: translateZ(0); ` +\n `${vertical ? \"min-width\" : \"min-height\"}: auto; contain: paint;`\n );\n });\n\n protected readonly itemStyle = computed(\n () =>\n `${this.vertical() ? \"margin-block\" : \"margin-inline\"}: ` +\n \"calc(var(--marquee-spacing) / 2);\",\n );\n\n protected edgeStyle(side: \"start\" | \"end\"): string {\n const base = \"pointer-events: none; position: absolute; \";\n // zag's `getEdgePositionStyles`, for the two sides the component asks for.\n return side === \"start\"\n ? `${base}top: 0px; inset-inline-start: 0px; height: 100%;`\n : `${base}top: 0px; inset-inline-end: 0px; height: 100%;`;\n }\n\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n protected get rootId(): string {\n return `${this.scope}:${this.machine}`;\n }\n protected partId(part: string): string {\n return `${this.scope}:${this.machine}:${part}`;\n }\n\n protected asTemplate(content: MarqueeItem[\"content\"]): TemplateRef<unknown> | null {\n return content instanceof TemplateRef ? content : null;\n }\n\n private resize: ResizeObserver | null = null;\n private observed: Element[] = [];\n\n constructor() {\n super();\n\n afterRenderEffect(() => {\n // Anything that changes how wide a copy is changes how many are needed.\n this.items();\n this.spacing();\n this.orientation();\n this.autoFill();\n untracked(() => this.measure());\n });\n\n inject(DestroyRef).onDestroy(() => this.resize?.disconnect());\n }\n\n private contentEl(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"content\"]');\n }\n\n /**\n * Measure the track, and keep measuring it.\n *\n * zag observes the root and the first copy with a `ResizeObserver`, and so\n * does this: the count has to survive a window resize and a webfont landing\n * after the first paint, neither of which re-renders anything.\n */\n private measure(): void {\n const root = this.host.nativeElement;\n const content = this.contentEl();\n if (!content) return;\n\n const vertical = this.vertical();\n const rootSize = vertical ? root.clientHeight : root.clientWidth;\n const contentSize = vertical ? content.clientHeight : content.clientWidth;\n // A track with no extent has not been laid out; measuring it would report a\n // single copy and never correct itself, because nothing re-renders.\n if (rootSize > 0 && contentSize > 0) {\n this.dimensionsRef = { rootSize, contentSize };\n // Only the first measurement renders — see `measured`. Every later one is\n // read by whatever render happens next, which is what keeps a vertical\n // marquee from growing itself a copy at a time.\n if (this.measured() === 0) {\n this.measured.set(1);\n flushNow(this.appRef);\n }\n }\n\n if (typeof ResizeObserver === \"undefined\") return;\n const watched = [root, content];\n const unchanged =\n !!this.resize &&\n watched.length === this.observed.length &&\n watched.every((el, index) => el === this.observed[index]);\n if (unchanged) return;\n this.resize?.disconnect();\n this.observed = watched;\n this.resize = new ResizeObserver(() => this.measure());\n for (const el of watched) this.resize.observe(el);\n }\n\n protected onInteraction(entering: boolean): void {\n if (!this.pauseOnInteraction()) return;\n this.setPaused(entering);\n }\n\n /**\n * `focus` does not bubble and `focusin` does, which is why this is not a\n * `focus` listener. zag reaches the same place with React's `onFocusCapture`;\n * both of them ignore the root taking focus itself, so tabbing *to* the region\n * does not stop it — only reaching something inside it does.\n */\n protected onFocusIn(event: FocusEvent): void {\n if (!this.pauseOnInteraction()) return;\n if (event.target === this.host.nativeElement) return;\n this.setPaused(true);\n }\n\n protected onFocusOut(event: FocusEvent): void {\n if (!this.pauseOnInteraction()) return;\n const next = event.relatedTarget;\n // Moving between two items inside the marquee is not leaving it.\n if (next instanceof Node && this.host.nativeElement.contains(next)) return;\n this.setPaused(false);\n }\n\n /** Stop or start the marquee from outside it. */\n pause(): void {\n this.setPaused(true);\n }\n\n resume(): void {\n this.setPaused(false);\n }\n\n togglePause(): void {\n this.setPaused(!this.paused());\n }\n\n private setPaused(paused: boolean): void {\n if (paused === this.paused()) return;\n this.paused.set(paused);\n this.pausedChange.emit(paused);\n flushNow(this.appRef);\n }\n}\n","/**\n * Turning pointer samples into a signature stroke, written out by hand.\n *\n * ── Why this file exists ────────────────────────────────────────────────────\n *\n * React, Svelte and Vue get their stroke geometry from `@zag-js/signature-pad`,\n * which bundles **perfect-freehand** — a published algorithm for pressure-aware\n * freehand outlines. This package has no zag and may take no third-party\n * dependency beyond the CDK, so the choice is between writing the geometry and\n * shipping a pad that records nothing.\n *\n * ── What this is NOT ────────────────────────────────────────────────────────\n *\n * It is **not** perfect-freehand, and it does not try to be. That algorithm's\n * look comes from a specific set of choices — a tapered start and end, a\n * velocity model when pressure is simulated, corner detection that inserts extra\n * points on sharp turns — and reproducing it from the outside would be guessing\n * at a shape rather than porting a spec. A signature drawn here will not be\n * pixel-identical to one drawn in the React component.\n *\n * That is stated rather than hidden because it is *checkable* how much it\n * matters: the `d` attribute is not part of the DOM contract the parity gate\n * compares (`isContractAttribute` in `tooling/parity/src/contract.ts` covers\n * `id`, `role`, `type`, `disabled`, `hidden`, `aria-*` and `data-*`, and `d` is\n * none of them). What *is* contract — one `segment-path` per stroke, the paths\n * the hidden input submits, `data-part` on each — is identical, and the parity\n * gate holds it to that. The ink's shape is a rendering difference between two\n * hand-drawing algorithms, not a difference in what either library promises.\n *\n * ── The algorithm, and where each part comes from ───────────────────────────\n *\n * The model is the standard one for variable-width digital ink, and every\n * constant below is named rather than tuned by eye:\n *\n * 1. **Streamline** — raw pointer samples are noisy and arrive unevenly. Each\n * sample is folded into the previous accepted point with an exponential\n * filter, `p = prev + (raw − prev)·t`. This is a one-pole IIR low-pass, the\n * same filter every drawing tool uses for this; `streamline` names how much\n * of the previous point survives.\n * 2. **Radius** — the half-width at a point, from the stylus pressure:\n * `r = (size / 2)·(1 − thinning + thinning·pressure)`. At `thinning: 0` the\n * stroke is a constant-width ribbon; at `thinning: 1` its width is\n * proportional to pressure. Both endpoints are exact, which is what the spec\n * asserts.\n * 3. **Outline** — the stroke is a *filled* shape, not a stroked line, because\n * `SignaturePad.css` colors it with `fill`. Each point contributes two\n * offset points, `±r` along the normal of the local tangent; the tangent at\n * an interior point is the sum of its two neighbouring segment directions,\n * which is the standard miter-free join and cannot fold the ribbon inside\n * out on a sharp corner the way a per-segment normal does.\n * 4. **Caps** — a semicircular fan at each end, so a stroke ends in a round nib\n * rather than a chisel. A single sample with nowhere to go is a full circle,\n * which is what a dot on the page is.\n * 5. **Path** — the outline is emitted as quadratic curves through the\n * midpoints of consecutive vertices, the standard way to draw a smooth\n * closed polygon without solving for control points, and closed with `Z` so\n * `fill` has something to fill. `smoothing: 0` emits straight segments\n * instead.\n *\n * The spec proves it against values computed by hand rather than against\n * itself: a straight horizontal line at constant pressure has to produce a\n * ribbon whose extreme ordinates are exactly `±r`, a single point has to produce\n * a circle of radius `r`, and the two thinning endpoints have to produce\n * radii `(size/2)(1 − thinning)` and `size/2`.\n */\n\nexport interface SignaturePoint {\n x: number;\n y: number;\n /** 0–1, as `PointerEvent.pressure` reports it. */\n pressure?: number;\n}\n\nexport interface SignatureStrokeOptions {\n /** Full stroke width in pixels at full pressure. zag's `drawing.size`. */\n size?: number;\n /** How much of the width follows the pressure, 0–1. zag's `drawing.thinning`. */\n thinning?: number;\n /** How rounded the outline is, 0–1. zag's `drawing.smoothing`. */\n smoothing?: number;\n /** How much of the previous point survives each sample, 0–1. */\n streamline?: number;\n /**\n * Derive the pressure from the pointer's speed rather than reading it.\n *\n * zag defaults this to `false`, which is the opposite of perfect-freehand's\n * own default, and the reason a mouse-drawn signature is an even ribbon: a\n * mouse reports `pressure: 0.5` throughout.\n */\n simulatePressure?: boolean;\n}\n\n/** zag's `drawing` defaults, which are the machine's rather than this file's. */\nexport const SIGNATURE_STROKE_DEFAULTS: Required<SignatureStrokeOptions> = {\n size: 2,\n thinning: 0.7,\n smoothing: 0.4,\n streamline: 0.6,\n simulatePressure: false,\n};\n\n/** Pressure a device that does not measure it reports while the tip is down. */\nconst UNMEASURED_PRESSURE = 0.5;\n\n/**\n * Pointer speed, in pixels per sample, at which a simulated pressure reaches\n * zero. A fast flick thins to nothing; anything slower tapers proportionally.\n */\nconst MAX_SIMULATED_SPEED = 24;\n\n/** Segments in each end cap's semicircle. Eight reads as round at ink sizes. */\nconst CAP_SEGMENTS = 8;\n\n/** Coordinates are rounded to this many places before being written into `d`. */\nconst PATH_PRECISION = 2;\n\nconst clamp01 = (value: number) => Math.min(Math.max(value, 0), 1);\n\n/**\n * Fold raw samples through a one-pole low-pass filter.\n *\n * `streamline` is the fraction of the previous point that survives, so 0 passes\n * the input through untouched and 1 would never move at all — hence the floor:\n * a filter that never reaches the pointer draws a stroke that lags behind the\n * hand and never catches up.\n */\nexport function smoothSignaturePoints(\n points: readonly SignaturePoint[],\n streamline: number,\n): SignaturePoint[] {\n if (points.length === 0) return [];\n const t = Math.max(1 - clamp01(streamline), 0.15);\n const out: SignaturePoint[] = [{ ...points[0]! }];\n for (let i = 1; i < points.length; i++) {\n const raw = points[i]!;\n const prev = out[out.length - 1]!;\n out.push({\n x: prev.x + (raw.x - prev.x) * t,\n y: prev.y + (raw.y - prev.y) * t,\n pressure: raw.pressure,\n });\n }\n return out;\n}\n\n/**\n * The half-width at each point.\n *\n * Exported so the spec can hold the two thinning endpoints against numbers\n * worked out by hand rather than against the outline they end up in.\n */\nexport function signatureRadii(\n points: readonly SignaturePoint[],\n options: Required<SignatureStrokeOptions>,\n): number[] {\n const half = options.size / 2;\n const thinning = clamp01(options.thinning);\n return points.map((point, index) => {\n const pressure = options.simulatePressure\n ? simulatedPressure(points, index)\n : clamp01(point.pressure ?? UNMEASURED_PRESSURE);\n return half * (1 - thinning + thinning * pressure);\n });\n}\n\n/** Fast strokes are light, slow ones heavy — the usual velocity model. */\nfunction simulatedPressure(points: readonly SignaturePoint[], index: number): number {\n const previous = points[index - 1];\n if (!previous) return UNMEASURED_PRESSURE;\n const point = points[index]!;\n const speed = Math.hypot(point.x - previous.x, point.y - previous.y);\n return clamp01(1 - speed / MAX_SIMULATED_SPEED);\n}\n\n/**\n * The closed polygon around a stroke: one side out, a cap, the other side back,\n * and a cap.\n *\n * Duplicate consecutive samples are dropped first. They arrive whenever a\n * pointer reports without moving, and a zero-length segment has no direction, so\n * leaving them in puts a `NaN` normal into the outline and the whole path\n * disappears.\n */\nexport function signatureOutline(\n points: readonly SignaturePoint[],\n options: SignatureStrokeOptions = {},\n): { x: number; y: number }[] {\n const resolved = { ...SIGNATURE_STROKE_DEFAULTS, ...options };\n const smoothed = dedupe(smoothSignaturePoints(points, resolved.streamline));\n if (smoothed.length === 0) return [];\n const radii = signatureRadii(smoothed, resolved);\n\n if (smoothed.length === 1) {\n return circle(smoothed[0]!, radii[0]!);\n }\n\n const normals = tangentNormals(smoothed);\n const left: { x: number; y: number }[] = [];\n const right: { x: number; y: number }[] = [];\n for (let i = 0; i < smoothed.length; i++) {\n const point = smoothed[i]!;\n const normal = normals[i]!;\n const radius = radii[i]!;\n left.push({ x: point.x + normal.x * radius, y: point.y + normal.y * radius });\n right.push({ x: point.x - normal.x * radius, y: point.y - normal.y * radius });\n }\n\n const last = smoothed.length - 1;\n return [\n ...left,\n // Round the far end, turning from the left side onto the right one.\n ...cap(smoothed[last]!, normals[last]!, radii[last]!, false),\n ...right.reverse(),\n // …and the near end, closing the shape back onto the first left point.\n ...cap(smoothed[0]!, normals[0]!, radii[0]!, true),\n ];\n}\n\n/** The signed unit normal at each point, from the average of its two tangents. */\nfunction tangentNormals(points: readonly SignaturePoint[]): { x: number; y: number }[] {\n const normals: { x: number; y: number }[] = [];\n for (let i = 0; i < points.length; i++) {\n const before = points[i - 1] ?? points[i]!;\n const after = points[i + 1] ?? points[i]!;\n const dx = after.x - before.x;\n const dy = after.y - before.y;\n const length = Math.hypot(dx, dy) || 1;\n // Rotate the tangent a quarter turn: (dx, dy) -> (-dy, dx).\n normals.push({ x: -dy / length, y: dx / length });\n }\n return normals;\n}\n\n/**\n * A semicircle around one end, joining the two sides of the ribbon.\n *\n * The offsets sit at the normal's angle `n` (left) and `n + π` (right), and the\n * direction of travel is at `n − π/2` — the normal is the tangent turned a\n * quarter turn, so the tangent is the normal turned back. Sweeping by **−π**\n * therefore passes through the travel direction rather than back over the\n * stroke, which is the difference between a round nib and a cap folded inside\n * the ink. The far cap starts at `n`; the near one starts half a turn round, at\n * `n + π`, because the loop arrives there from the returning side.\n */\nfunction cap(\n point: SignaturePoint,\n normal: { x: number; y: number },\n radius: number,\n atStart: boolean,\n): { x: number; y: number }[] {\n const from = Math.atan2(normal.y, normal.x) + (atStart ? Math.PI : 0);\n const out: { x: number; y: number }[] = [];\n for (let step = 1; step < CAP_SEGMENTS; step++) {\n const angle = from - Math.PI * (step / CAP_SEGMENTS);\n out.push({ x: point.x + Math.cos(angle) * radius, y: point.y + Math.sin(angle) * radius });\n }\n return out;\n}\n\n/** A dot: a stroke that never moved is a full circle, not an empty path. */\nfunction circle(point: SignaturePoint, radius: number): { x: number; y: number }[] {\n const steps = CAP_SEGMENTS * 2;\n return Array.from({ length: steps }, (_, index) => {\n const angle = (index / steps) * Math.PI * 2;\n return { x: point.x + Math.cos(angle) * radius, y: point.y + Math.sin(angle) * radius };\n });\n}\n\nfunction dedupe(points: readonly SignaturePoint[]): SignaturePoint[] {\n const out: SignaturePoint[] = [];\n for (const point of points) {\n const previous = out[out.length - 1];\n if (previous && previous.x === point.x && previous.y === point.y) continue;\n out.push(point);\n }\n return out;\n}\n\nconst round = (value: number) => Number(value.toFixed(PATH_PRECISION));\n\n/**\n * The closed outline as SVG path data.\n *\n * Quadratic curves through the midpoints of consecutive vertices: each vertex\n * becomes a control point and each midpoint an on-curve point, which is the\n * cheapest way to draw a smooth closed polygon and needs no control-point\n * solving. `smoothing: 0` emits straight segments instead, for a caller who\n * wants the polygon itself.\n */\nexport function signaturePathData(\n outline: readonly { x: number; y: number }[],\n smoothing = SIGNATURE_STROKE_DEFAULTS.smoothing,\n): string {\n if (outline.length === 0) return \"\";\n if (outline.length < 3) {\n return `M ${round(outline[0]!.x)} ${round(outline[0]!.y)} Z`;\n }\n if (smoothing <= 0) {\n const [first, ...rest] = outline;\n return (\n `M ${round(first!.x)} ${round(first!.y)} ` +\n rest.map((point) => `L ${round(point.x)} ${round(point.y)}`).join(\" \") +\n \" Z\"\n );\n }\n\n const mid = (a: { x: number; y: number }, b: { x: number; y: number }) => ({\n x: (a.x + b.x) / 2,\n y: (a.y + b.y) / 2,\n });\n const start = mid(outline[outline.length - 1]!, outline[0]!);\n let d = `M ${round(start.x)} ${round(start.y)}`;\n for (let i = 0; i < outline.length; i++) {\n const control = outline[i]!;\n const end = mid(control, outline[(i + 1) % outline.length]!);\n d += ` Q ${round(control.x)} ${round(control.y)} ${round(end.x)} ${round(end.y)}`;\n }\n return `${d} Z`;\n}\n\n/** The whole pipeline: samples in, one stroke's path data out. */\nexport function signatureStroke(\n points: readonly SignaturePoint[],\n options: SignatureStrokeOptions = {},\n): string {\n const resolved = { ...SIGNATURE_STROKE_DEFAULTS, ...options };\n return signaturePathData(signatureOutline(points, resolved), resolved.smoothing);\n}\n","import {\n ApplicationRef,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from \"@angular/core\";\nimport { signaturePadStyles, type ControlSize, type SignaturePadVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport {\n SIGNATURE_STROKE_DEFAULTS,\n signatureStroke,\n type SignaturePoint,\n} from \"./signature-stroke.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type SignaturePadSize = ControlSize;\nexport type SignaturePadVariant = NonNullable<SignaturePadVariants[\"variant\"]>;\n\nexport type SignatureImageType = \"image/png\" | \"image/jpeg\" | \"image/svg+xml\";\n\n/** What `drawEnd` hands back alongside the paths. */\nexport interface SignatureDrawEnd {\n paths: string[];\n getDataUrl: (type: SignatureImageType, quality?: number) => Promise<string>;\n}\n\n/**\n * Rasterise a segment `<svg>`, the way zag's `getDataUrl` does.\n *\n * Reproduced rather than reinvented because the *shape* of the promise is part\n * of the component's API: an empty pad resolves to an empty string rather than\n * to a blank image, a JPEG gets a white ground because JPEG has no alpha, and\n * the canvas is sized in device pixels so a signature is not resampled down on\n * a retina screen. All browser APIs — `XMLSerializer`, `Image`, `canvas` — and\n * no dependency.\n */\nexport function signatureDataUrl(\n svg: SVGSVGElement,\n options: { type: SignatureImageType; quality?: number; background?: string },\n): Promise<string> {\n const { type, quality = 0.92, background } = options;\n const win = svg.ownerDocument.defaultView;\n if (!win) return Promise.resolve(\"\");\n const bounds = svg.getBoundingClientRect();\n const clone = svg.cloneNode(true) as SVGSVGElement;\n // Without a viewBox the clone has no intrinsic size once it leaves the\n // document, and the raster comes out empty.\n if (!clone.hasAttribute(\"viewBox\")) {\n clone.setAttribute(\"viewBox\", `0 0 ${bounds.width} ${bounds.height}`);\n }\n const source =\n '<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n' + new win.XMLSerializer().serializeToString(clone);\n const svgString = \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(source);\n if (type === \"image/svg+xml\") return Promise.resolve(svgString);\n\n const ratio = win.devicePixelRatio || 1;\n const canvas = svg.ownerDocument.createElement(\"canvas\");\n canvas.width = bounds.width * ratio;\n canvas.height = bounds.height * ratio;\n const context = canvas.getContext(\"2d\");\n if (type === \"image/jpeg\" || background) {\n if (context) {\n context.fillStyle = background || \"white\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n }\n const image = new win.Image();\n return new Promise<string>((resolve) => {\n image.onload = () => {\n context?.drawImage(image, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(type, quality));\n };\n image.onerror = () => resolve(\"\");\n image.src = svgString;\n });\n}\n\n/**\n * A drawing surface that records strokes as SVG paths.\n *\n * ```html\n * <div uioSignaturePad label=\"Signature\" name=\"sig\" [(paths)]=\"paths\"></div>\n * ```\n *\n * ── The ink is this package's own geometry ──────────────────────────────────\n *\n * The other three libraries get their stroke shape from `perfect-freehand`,\n * bundled inside `@zag-js/signature-pad`. This package takes no dependency\n * beyond the CDK, so the outline is written out in `signature-stroke.ts` — a\n * different algorithm in the same family, named and derived there rather than\n * guessed at from screenshots.\n *\n * A signature drawn here will therefore not be pixel-identical to one drawn in\n * the React component, and that is said out loud rather than papered over. What\n * *is* identical is everything the libraries promise each other: one\n * `segment-path` per stroke, the paths the hidden input submits, the parts, the\n * states, and the `<title>` that names the drawing to a screen reader. The `d`\n * attribute is not part of the DOM contract the parity gate compares.\n *\n * ── The odd attributes are zag's ────────────────────────────────────────────\n *\n * `aria-disabled` is written on the control **always**, `\"false\"` and all, and\n * the control carries `data-disabled` but never `data-invalid` or\n * `data-readonly` — even though `SignaturePad.css` has rules for both. That is a\n * gap between the machine and the stylesheet rather than something this port may\n * fix: emitting the attributes the CSS wants would give Angular an invalid state\n * the other three libraries do not render, and fail the parity gate for being\n * right.\n */\n@Component({\n selector: \"div[uioSignaturePad]\",\n standalone: true,\n exportAs: \"uioSignaturePad\",\n imports: [UioButton, UioFieldError],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"signature-pad\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('input')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-required]=\"flag(required())\"\n (click)=\"focusControl($event)\"\n >{{ text }}@if (required()) {<span class=\"field__required\" aria-hidden=\"true\"></span>}</label\n >\n }\n\n <div\n class=\"signature-pad__control\"\n data-scope=\"signature-pad\"\n data-part=\"control\"\n role=\"application\"\n aria-roledescription=\"signature pad\"\n aria-label=\"signature pad\"\n [id]=\"partId('control')\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.style]=\"controlStyle\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n >\n <svg\n class=\"signature-pad__segment\"\n data-scope=\"signature-pad\"\n data-part=\"segment\"\n [attr.style]=\"segmentStyle\"\n >\n <!--\n Named for assistive technology, and the text is compared: an svg with\n no accessible name is an unlabelled graphic, and the other three\n libraries put exactly this title here.\n -->\n <title>Signature</title>\n @for (path of drawnPaths(); track $index) {\n <path data-scope=\"signature-pad\" data-part=\"segment-path\" [attr.d]=\"path\"></path>\n }\n </svg>\n @if (showGuide()) {\n <div\n class=\"signature-pad__guide\"\n data-scope=\"signature-pad\"\n data-part=\"guide\"\n [attr.data-disabled]=\"flag(disabled())\"\n ></div>\n }\n </div>\n\n @if (showClear()) {\n <button\n uioButton\n intent=\"ghost\"\n type=\"button\"\n [icon]=\"glyph('refresh')\"\n data-scope=\"signature-pad\"\n data-part=\"clear-trigger\"\n aria-label=\"clear signature\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [attr.hidden]=\"clearHidden() ? '' : null\"\n (click)=\"clear()\"\n >{{ clearLabel() }}</button>\n }\n\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n <!--\n The paths, not a raster. They are lossless, resolution independent and\n deterministic; reach for the PNG through \"drawEnd\", whose details carry\n \"getDataUrl\". Not a hidden input in the CSS sense — \"hidden\" is the real\n attribute, which is what the other three render.\n -->\n <input\n type=\"text\"\n hidden\n readonly\n [id]=\"partId('input')\"\n [attr.name]=\"name()\"\n [attr.required]=\"required() ? '' : null\"\n [attr.disabled]=\"disabled() ? '' : null\"\n [value]=\"paths().join(' ')\"\n />\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n /**\n * The root carries `data-disabled` and nothing else.\n *\n * `UioPart` binds the whole state vocabulary on every part, which is what\n * turns \"nobody thought about this state\" into a visible omission. Here the\n * machine genuinely emits neither: a read-only or invalid signature pad\n * renders exactly the same root as a valid one, so the two bindings are\n * cleared rather than left to report inputs this component does have. Adding\n * them would give Angular attributes the other three libraries do not, and\n * `SignaturePad.css` would then style an invalid state only one library\n * could ever reach.\n */\n \"[attr.data-readonly]\": \"null\",\n \"[attr.data-invalid]\": \"null\",\n },\n})\nexport class UioSignaturePad extends UioPart {\n protected readonly glyph = glyph;\n readonly scope = \"signature-pad\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n /** The strokes, as SVG path data. Uncontrolled until something binds it. */\n readonly paths = model<string[]>([]);\n /** Ink width in device pixels — geometry, not type. */\n readonly strokeWidth = input(SIGNATURE_STROKE_DEFAULTS.size);\n readonly showGuide = input(true, { transform: booleanAttribute });\n readonly showClear = input(true, { transform: booleanAttribute });\n readonly clearLabel = input(\"Clear\");\n readonly size = input<SignaturePadSize>(\"md\");\n readonly variant = input<SignaturePadVariant>(\"default\");\n readonly required = input(false, { transform: booleanAttribute });\n override readonly disabled = input(false, { transform: booleanAttribute });\n override readonly readOnly = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n\n /** Fires continuously while a stroke is being drawn. */\n readonly draw = output<string[]>();\n /** Fires when a stroke finishes, and when the pad is cleared. */\n readonly drawEnd = output<SignatureDrawEnd>();\n\n private readonly appRef = inject(ApplicationRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n protected readonly rootId = `signature-pad:${this.machine}`;\n protected partId(part: string): string {\n return `${this.rootId}:${part}`;\n }\n\n override readonly invalid = computed(() => !!this.error());\n\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n\n protected readonly hostClass = computed(() =>\n signaturePadStyles({ size: this.size(), variant: this.variant() }),\n );\n\n private readonly interactive = computed(() => !this.disabled() && !this.readOnly());\n\n /** The stroke under the pointer, if there is one. */\n private readonly currentPath = signal<string | null>(null);\n private readonly drawing = computed(() => this.currentPath() !== null);\n\n /**\n * Every finished stroke, plus the one in progress.\n *\n * One `<path>` each — Ark's `Segment` renders the machine's `paths` and\n * appends `currentPath`, so the element count is what a caller sees change and\n * is part of the contract.\n */\n protected readonly drawnPaths = computed(() => {\n const current = this.currentPath();\n return current === null ? this.paths() : [...this.paths(), current];\n });\n\n /** zag hides the trigger while there is nothing to clear, and mid-stroke. */\n protected readonly clearHidden = computed(() => !this.paths().length || this.drawing());\n\n /** Written whole, so the custom properties survive a JIT-compiled spec. */\n protected readonly controlStyle =\n \"position: relative; touch-action: none; user-select: none; -webkit-user-select: none;\";\n protected readonly segmentStyle =\n \"position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; pointer-events: none;\";\n\n private points: SignaturePoint[] = [];\n private pointerId: number | null = null;\n\n private controlEl(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"control\"]');\n }\n\n private segmentEl(): SVGSVGElement | null {\n return this.host.nativeElement.querySelector<SVGSVGElement>('[data-part=\"segment\"]');\n }\n\n protected focusControl(event: Event): void {\n if (!this.interactive()) return;\n event.preventDefault();\n this.controlEl()?.focus({ preventScroll: true });\n }\n\n protected onPointerDown(event: PointerEvent): void {\n if (!this.interactive()) return;\n if (event.button !== 0) return;\n // A modified click is the platform's, not the pad's — ⌘-drag is a system\n // gesture on macOS and swallowing it draws a stroke nobody asked for.\n if (event.metaKey || event.ctrlKey || event.altKey) return;\n const target = event.target as HTMLElement | null;\n if (target?.closest('[data-part=\"clear-trigger\"]')) return;\n\n const control = this.controlEl();\n if (!control) return;\n control.setPointerCapture(event.pointerId);\n this.pointerId = event.pointerId;\n this.points = [this.pointFrom(event, control)];\n this.currentPath.set(this.strokeFrom(this.points));\n\n const document = control.ownerDocument;\n document.addEventListener(\"pointermove\", this.onPointerMove);\n document.addEventListener(\"pointerup\", this.onPointerFinish);\n document.addEventListener(\"pointercancel\", this.onPointerFinish);\n flushNow(this.appRef);\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const control = this.controlEl();\n if (control?.hasPointerCapture(event.pointerId)) {\n control.releasePointerCapture(event.pointerId);\n }\n }\n\n /**\n * Followed on the document, not the pad.\n *\n * A signature runs off the edge of the surface constantly, and a listener on\n * the control alone would drop the stroke the moment it did — leaving the pad\n * drawing forever, because the pointer-up would never arrive either.\n */\n private readonly onPointerMove = (event: PointerEvent): void => {\n const control = this.controlEl();\n if (!control || this.pointerId === null) return;\n this.points = [...this.points, this.pointFrom(event, control)];\n this.currentPath.set(this.strokeFrom(this.points));\n this.draw.emit(this.drawnPaths());\n flushNow(this.appRef);\n };\n\n private readonly onPointerFinish = (): void => {\n const control = this.controlEl();\n const document = control?.ownerDocument ?? this.host.nativeElement.ownerDocument;\n document.removeEventListener(\"pointermove\", this.onPointerMove);\n document.removeEventListener(\"pointerup\", this.onPointerFinish);\n document.removeEventListener(\"pointercancel\", this.onPointerFinish);\n this.pointerId = null;\n\n const finished = this.currentPath();\n this.points = [];\n this.currentPath.set(null);\n if (finished === null) return;\n this.commit([...this.paths(), finished]);\n this.emitDrawEnd();\n flushNow(this.appRef);\n };\n\n /** Wipes the pad and reports it, exactly as a finished stroke does. */\n clear(): void {\n this.points = [];\n this.currentPath.set(null);\n this.commit([]);\n this.emitDrawEnd();\n // zag re-focuses whatever was active, which after a click is the trigger\n // that has just been hidden — so focus is put back on the pad instead.\n this.controlEl()?.focus({ preventScroll: true });\n flushNow(this.appRef);\n }\n\n /** Rasterise the signature. Resolves to `\"\"` when there is nothing drawn. */\n getDataUrl(type: SignatureImageType, quality?: number): Promise<string> {\n if (!this.paths().length) return Promise.resolve(\"\");\n const svg = this.segmentEl();\n if (!svg) return Promise.resolve(\"\");\n return signatureDataUrl(svg, { type, quality });\n }\n\n private emitDrawEnd(): void {\n this.drawEnd.emit({\n paths: [...this.paths()],\n getDataUrl: (type, quality) => this.getDataUrl(type, quality),\n });\n }\n\n private commit(paths: string[]): void {\n this.paths.set(paths);\n this.draw.emit(paths);\n }\n\n private pointFrom(event: PointerEvent, control: HTMLElement): SignaturePoint {\n const box = control.getBoundingClientRect();\n return {\n x: event.clientX - box.left,\n y: event.clientY - box.top,\n pressure: event.pressure,\n };\n }\n\n private strokeFrom(points: readonly SignaturePoint[]): string {\n return signatureStroke(points, { size: this.strokeWidth() });\n }\n}\n","/**\n * The crop box's arithmetic, ported from `@zag-js/image-cropper` 1.41.2.\n *\n * ── Why it is a port rather than an invention ───────────────────────────────\n *\n * Everything a caller can see about an ImageCropper is a *number*: the crop\n * rectangle reaches the DOM as `--crop-x`/`--crop-y`/`--crop-width`/\n * `--crop-height`, and it reaches assistive technology as `aria-valuenow`,\n * `aria-valuemax` and an `aria-valuetext` that reads the rectangle out loud.\n * The parity gate compares those aria attributes, so \"a sensible crop box\" is\n * not good enough — Angular has to arrive at the *same* rectangle React does,\n * to the pixel, from the same viewport.\n *\n * There is no way to get there by re-deriving it. The rules are not a formula\n * but a sequence of clamps applied in a particular order, and the order is\n * load-bearing: a crop is fitted to the viewport, then to the min/max size,\n * then to the aspect ratio, then re-clamped into the viewport, and doing the\n * last two the other way round produces a box that is a few pixels different\n * and reads differently. So this is a transcription, function for function,\n * with zag's names kept so the two can be diffed when it is next upgraded.\n *\n * It is checked rather than trusted: `crop-geometry.spec.ts` holds crop\n * rectangles captured from a **running** `@ark-ui/react` ImageCropper in\n * Chromium — the viewport it measured and the rectangle it settled on — and\n * asserts this file reproduces them.\n *\n * ── What is deliberately left out ───────────────────────────────────────────\n *\n * Rotation, flipping, pinch-zoom and the offset panning maths. The library's\n * public `ImageCropper` exposes none of them (no `rotation`, `flip` or\n * `onRotationChange` prop in any of the four packages), so the machine's values\n * are fixed at `0` and `false` and every path through `clampOffset` and\n * `computeAABB` is unreachable. Porting dead code would be four hundred lines\n * nothing could ever check.\n */\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface Rect extends Point, Size {}\n\n/** How much of the viewport a crop fills when nothing else decides. zag's. */\nexport const DEFAULT_VIEWPORT_FILL = 0.8;\n\n/** Two aspect ratios closer than this are the same one. zag's tolerance. */\nconst ASPECT_RATIO_TOLERANCE = 1e-3;\n\nconst { min, max, abs, round } = Math;\n\nconst clamp = (value: number, low: number, high: number) => min(max(value, low), high);\n\nexport const isVisibleRect = (rect: Size) => rect.width > 0 && rect.height > 0;\n\nexport const roundRect = (rect: Rect): Rect => ({\n x: round(rect.x),\n y: round(rect.y),\n width: round(rect.width),\n height: round(rect.height),\n});\n\nexport const clampPoint = (point: Point, low: Point, high: Point): Point => ({\n x: clamp(point.x, low.x, high.x),\n y: clamp(point.y, low.y, high.y),\n});\n\nexport const getCenterPoint = (rect: Rect): Point => ({\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n});\n\n/** How far a crop of this size may be moved before it leaves the viewport. */\nexport const getMaxBounds = (crop: Size, viewport: Size): Point => ({\n x: max(0, viewport.width - crop.width),\n y: max(0, viewport.height - crop.height),\n});\n\nexport const centerRect = (size: Size, viewport: Size): Point => ({\n x: max(0, (viewport.width - size.width) / 2),\n y: max(0, (viewport.height - size.height) / 2),\n});\n\nexport const centerCropOnPoint = (crop: Size, center: Point, viewport: Size): Point =>\n clampPoint(\n { x: center.x - crop.width / 2, y: center.y - crop.height / 2 },\n { x: 0, y: 0 },\n getMaxBounds(crop, viewport),\n );\n\n/** A circular crop is a square one that the stylesheet rounds off. */\nexport const resolveCropAspectRatio = (\n shape: \"rectangle\" | \"circle\",\n aspectRatio: number | undefined,\n): number | undefined => (shape === \"circle\" ? 1 : aspectRatio);\n\nconst isLeftHandle = (v: HandlePosition) => v === \"w\" || v === \"nw\" || v === \"sw\";\nconst isRightHandle = (v: HandlePosition) => v === \"e\" || v === \"ne\" || v === \"se\";\nconst isTopHandle = (v: HandlePosition) => v === \"n\" || v === \"nw\" || v === \"ne\";\nconst isBottomHandle = (v: HandlePosition) => v === \"s\" || v === \"sw\" || v === \"se\";\nconst isCornerHandle = (v: HandlePosition) =>\n (isLeftHandle(v) || isRightHandle(v)) && (isTopHandle(v) || isBottomHandle(v));\nconst isHorizontalEdgeHandle = (v: HandlePosition) =>\n (isLeftHandle(v) || isRightHandle(v)) && !(isTopHandle(v) || isBottomHandle(v));\nconst isVerticalEdgeHandle = (v: HandlePosition) =>\n (isTopHandle(v) || isBottomHandle(v)) && !(isLeftHandle(v) || isRightHandle(v));\n\nexport type HandlePosition = \"n\" | \"e\" | \"s\" | \"w\" | \"ne\" | \"se\" | \"sw\" | \"nw\";\n\n/** Every corner and edge, in the order zag names them. */\nexport const CROP_HANDLES: readonly HandlePosition[] = [\n \"nw\",\n \"n\",\n \"ne\",\n \"e\",\n \"se\",\n \"s\",\n \"sw\",\n \"w\",\n];\n\nconst hasAspectRatio = (value: number | undefined): value is number =>\n typeof value === \"number\" && value > 0;\n\ninterface SizeLimits {\n minWidth: number;\n minHeight: number;\n maxWidth: number;\n maxHeight: number;\n hasAspect: boolean;\n}\n\ninterface Bounds {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\n/**\n * The size a crop is allowed to be, in this viewport, at this aspect ratio.\n *\n * The viewport is a hard ceiling on both axes — a crop bigger than what it is\n * cropping is meaningless — and with an aspect ratio the two axes constrain each\n * other, so the pass below runs twice: once to fit the width and once to check\n * the height that implies.\n */\nexport function resolveSizeLimits(options: {\n minSize: Size;\n maxSize: Size;\n viewportSize: Size;\n aspectRatio?: number;\n}): SizeLimits {\n const { minSize, maxSize, viewportSize, aspectRatio } = options;\n let minWidth = min(minSize.width, viewportSize.width);\n let minHeight = min(minSize.height, viewportSize.height);\n\n let maxWidth = maxSize?.width ?? viewportSize.width;\n if (!Number.isFinite(maxWidth)) maxWidth = viewportSize.width;\n maxWidth = min(maxWidth, viewportSize.width);\n let maxHeight = maxSize?.height ?? viewportSize.height;\n if (!Number.isFinite(maxHeight)) maxHeight = viewportSize.height;\n maxHeight = min(maxHeight, viewportSize.height);\n maxWidth = max(minWidth, maxWidth);\n maxHeight = max(minHeight, maxHeight);\n\n const hasAspect = hasAspectRatio(aspectRatio);\n if (hasAspect) {\n const minWidthWithAspect = max(minWidth, minHeight * aspectRatio);\n const minHeightWithAspect = minWidthWithAspect / aspectRatio;\n minWidth = min(minWidthWithAspect, viewportSize.width);\n minHeight = min(minHeightWithAspect, viewportSize.height);\n let constrainedMaxWidth = min(maxWidth, maxHeight * aspectRatio, viewportSize.width);\n let constrainedMaxHeight = constrainedMaxWidth / aspectRatio;\n if (constrainedMaxHeight > maxHeight || constrainedMaxHeight > viewportSize.height) {\n constrainedMaxHeight = min(maxHeight, viewportSize.height);\n constrainedMaxWidth = constrainedMaxHeight * aspectRatio;\n }\n maxWidth = max(minWidth, min(constrainedMaxWidth, viewportSize.width));\n maxHeight = max(minHeight, min(constrainedMaxHeight, viewportSize.height));\n } else {\n maxWidth = max(minWidth, min(maxWidth, viewportSize.width));\n maxHeight = max(minHeight, min(maxHeight, viewportSize.height));\n }\n return { minWidth, minHeight, maxWidth, maxHeight, hasAspect };\n}\n\n/**\n * Fit a width and a height to the aspect ratio and the limits, both ways round,\n * and keep whichever moved less.\n *\n * The two-way trial is zag's, and it is what stops a crop from collapsing: fixing\n * the width can drive the height under its minimum, fixing the height can drive\n * the width over the viewport, and only one of the two will be legal at the\n * extremes.\n */\nfunction clampAspectSize(params: {\n widthValue: number;\n heightValue: number;\n limits: SizeLimits;\n viewportRect: Size;\n aspectRatio: number;\n}): Size {\n const { widthValue, heightValue, limits, viewportRect, aspectRatio } = params;\n const { minWidth, minHeight, maxWidth, maxHeight } = limits;\n\n const constrainWidthFromHeight = (height: number): Size => {\n let width = clamp(height * aspectRatio, minWidth, maxWidth);\n width = min(width, viewportRect.width);\n return { width, height: width / aspectRatio };\n };\n\n const clampByWidth = (value: number): Size => {\n let width = clamp(value, minWidth, maxWidth);\n width = min(width, viewportRect.width);\n let height = width / aspectRatio;\n if (height < minHeight) ({ width, height } = constrainWidthFromHeight(minHeight));\n if (height > maxHeight) {\n ({ width, height } = constrainWidthFromHeight(min(maxHeight, viewportRect.height)));\n }\n if (height > viewportRect.height) {\n ({ width, height } = constrainWidthFromHeight(viewportRect.height));\n if (height < minHeight) ({ width, height } = constrainWidthFromHeight(minHeight));\n }\n return { width, height };\n };\n\n const clampByHeight = (value: number): Size => {\n let height = clamp(value, minHeight, maxHeight);\n height = min(height, viewportRect.height);\n let width = height * aspectRatio;\n width = clamp(width, minWidth, maxWidth);\n width = min(width, viewportRect.width);\n let adjustedHeight = width / aspectRatio;\n if (adjustedHeight < minHeight) {\n ({ width, height: adjustedHeight } = constrainWidthFromHeight(minHeight));\n }\n if (adjustedHeight > maxHeight) {\n ({ width, height: adjustedHeight } = constrainWidthFromHeight(\n min(maxHeight, viewportRect.height),\n ));\n }\n if (width > viewportRect.width) {\n width = viewportRect.width;\n adjustedHeight = width / aspectRatio;\n if (adjustedHeight > maxHeight) {\n ({ width, height: adjustedHeight } = constrainWidthFromHeight(\n min(maxHeight, viewportRect.height),\n ));\n }\n if (adjustedHeight < minHeight) {\n ({ width, height: adjustedHeight } = constrainWidthFromHeight(minHeight));\n }\n }\n return { width, height: adjustedHeight };\n };\n\n const byWidth = clampByWidth(widthValue);\n const byHeight = clampByHeight(heightValue);\n const deltaWidth = abs(byWidth.width - widthValue) + abs(byWidth.height - heightValue);\n const deltaHeight = abs(byHeight.width - widthValue) + abs(byHeight.height - heightValue);\n return deltaHeight < deltaWidth ? byHeight : byWidth;\n}\n\n/** Move only the edges the dragged handle owns. */\nfunction applyDeltaToEdges(params: {\n bounds: Bounds;\n delta: Point;\n handlePosition: HandlePosition;\n viewportRect: Size;\n minSize: Size;\n maxSize: Size;\n}): Bounds {\n const { bounds, delta, handlePosition, viewportRect, minSize, maxSize } = params;\n let { left, top, right, bottom } = bounds;\n if (isLeftHandle(handlePosition)) {\n left = clamp(left + delta.x, max(0, right - maxSize.width), right - minSize.width);\n }\n if (isRightHandle(handlePosition)) {\n right = clamp(\n right + delta.x,\n left + minSize.width,\n min(viewportRect.width, left + maxSize.width),\n );\n }\n if (isTopHandle(handlePosition)) {\n top = clamp(top + delta.y, max(0, bottom - maxSize.height), bottom - minSize.height);\n }\n if (isBottomHandle(handlePosition)) {\n bottom = clamp(\n bottom + delta.y,\n top + minSize.height,\n min(viewportRect.height, top + maxSize.height),\n );\n }\n return { left, top, right, bottom };\n}\n\n/** Dragging a left or right edge with a locked ratio grows the box about its middle. */\nfunction applyAspectToHorizontalResize(params: {\n bounds: Bounds;\n limits: SizeLimits;\n viewportRect: Size;\n aspectRatio: number;\n handlePosition: HandlePosition;\n}): Bounds {\n const { bounds, limits, viewportRect, aspectRatio, handlePosition } = params;\n const { left, top, right, bottom } = bounds;\n const centerY = (top + bottom) / 2;\n const constrained = clampAspectSize({\n widthValue: right - left,\n heightValue: (right - left) / aspectRatio,\n limits,\n viewportRect,\n aspectRatio,\n });\n const halfH = constrained.height / 2;\n let newTop = centerY - halfH;\n let newBottom = centerY + halfH;\n if (newTop < 0) {\n newTop = 0;\n newBottom = constrained.height;\n }\n if (newBottom > viewportRect.height) {\n newBottom = viewportRect.height;\n newTop = newBottom - constrained.height;\n }\n return {\n left: isRightHandle(handlePosition) ? left : right - constrained.width,\n top: newTop,\n right: isRightHandle(handlePosition) ? left + constrained.width : right,\n bottom: newBottom,\n };\n}\n\n/** The same, for a top or bottom edge. */\nfunction applyAspectToVerticalResize(params: {\n bounds: Bounds;\n limits: SizeLimits;\n viewportRect: Size;\n aspectRatio: number;\n handlePosition: HandlePosition;\n}): Bounds {\n const { bounds, limits, viewportRect, aspectRatio, handlePosition } = params;\n const { left, top, right, bottom } = bounds;\n const centerX = (left + right) / 2;\n const constrained = clampAspectSize({\n widthValue: (bottom - top) * aspectRatio,\n heightValue: bottom - top,\n limits,\n viewportRect,\n aspectRatio,\n });\n const halfW = constrained.width / 2;\n let newLeft = centerX - halfW;\n let newRight = centerX + halfW;\n if (newLeft < 0) {\n newLeft = 0;\n newRight = constrained.width;\n }\n if (newRight > viewportRect.width) {\n newRight = viewportRect.width;\n newLeft = newRight - constrained.width;\n }\n return {\n left: newLeft,\n top: isBottomHandle(handlePosition) ? top : bottom - constrained.height,\n right: newRight,\n bottom: isBottomHandle(handlePosition) ? top + constrained.height : bottom,\n };\n}\n\n/** A corner drag pins the opposite corner. */\nfunction applyCornerResize(params: {\n bounds: Bounds;\n width: number;\n height: number;\n handlePosition: HandlePosition;\n}): Bounds {\n const { bounds, width, height, handlePosition } = params;\n const { left, top, right, bottom } = bounds;\n if (isRightHandle(handlePosition) && isBottomHandle(handlePosition)) {\n return { left, top, right: left + width, bottom: top + height };\n }\n if (isRightHandle(handlePosition) && isTopHandle(handlePosition)) {\n return { left, top: bottom - height, right: left + width, bottom };\n }\n if (isBottomHandle(handlePosition)) {\n return { left: right - width, top, right, bottom: top + height };\n }\n return { left: right - width, top: bottom - height, right, bottom };\n}\n\n/**\n * The whole resize pipeline, and the one function that has to be exact.\n *\n * It is also how a crop is *validated*: `setDefaultCrop` calls it with a zero\n * delta purely to run a candidate rectangle through every clamp. That is why the\n * initial crop, the aspect-ratio adjustment and the viewport-resize path all go\n * through here rather than each fitting the box their own way.\n */\nexport function computeResizeCrop(options: {\n cropStart: Rect;\n handlePosition: HandlePosition;\n delta: Point;\n viewportRect: Size;\n minSize: Size;\n maxSize: Size;\n aspectRatio?: number;\n}): Rect {\n const { cropStart, handlePosition, delta, viewportRect, minSize, maxSize, aspectRatio } = options;\n const limits = resolveSizeLimits({ minSize, maxSize, viewportSize: viewportRect, aspectRatio });\n const { minWidth, minHeight, maxWidth, maxHeight, hasAspect } = limits;\n\n let { left, top, right, bottom } = applyDeltaToEdges({\n bounds: {\n left: cropStart.x,\n top: cropStart.y,\n right: cropStart.x + cropStart.width,\n bottom: cropStart.y + cropStart.height,\n },\n delta,\n handlePosition,\n viewportRect,\n minSize,\n maxSize,\n });\n\n if (hasAspect && aspectRatio) {\n if (isCornerHandle(handlePosition)) {\n let tempW = right - left;\n let tempH = tempW / aspectRatio;\n if (\n tempH > bottom - top ||\n top + tempH > viewportRect.height ||\n left + tempW > viewportRect.width\n ) {\n tempH = bottom - top;\n tempW = tempH * aspectRatio;\n }\n const constrained = clampAspectSize({\n widthValue: tempW,\n heightValue: tempH,\n limits,\n viewportRect,\n aspectRatio,\n });\n ({ left, top, right, bottom } = applyCornerResize({\n bounds: { left, top, right, bottom },\n width: constrained.width,\n height: constrained.height,\n handlePosition,\n }));\n } else if (isHorizontalEdgeHandle(handlePosition)) {\n ({ left, top, right, bottom } = applyAspectToHorizontalResize({\n bounds: { left, top, right, bottom },\n limits,\n viewportRect,\n aspectRatio,\n handlePosition,\n }));\n } else if (isVerticalEdgeHandle(handlePosition)) {\n ({ left, top, right, bottom } = applyAspectToVerticalResize({\n bounds: { left, top, right, bottom },\n limits,\n viewportRect,\n aspectRatio,\n handlePosition,\n }));\n }\n }\n\n // The final fit into the viewport, after the ratio has had its say. Doing this\n // before the aspect branch instead produces a box a few pixels different, and\n // `aria-valuetext` reads it out.\n left = clamp(left, 0, max(0, viewportRect.width - minWidth));\n top = clamp(top, 0, max(0, viewportRect.height - minHeight));\n right = clamp(right, left + minWidth, min(viewportRect.width, left + maxWidth));\n bottom = clamp(bottom, top + minHeight, min(viewportRect.height, top + maxHeight));\n\n return { x: left, y: top, width: right - left, height: bottom - top };\n}\n\n/** Dragging the box itself: the size never changes, only where it sits. */\nexport function computeMoveCrop(cropStart: Rect, delta: Point, viewportRect: Size): Rect {\n return {\n x: clamp(cropStart.x + delta.x, 0, viewportRect.width - cropStart.width),\n y: clamp(cropStart.y + delta.y, 0, viewportRect.height - cropStart.height),\n width: cropStart.width,\n height: cropStart.height,\n };\n}\n\n/** The crop a cropper opens with, before anything has been dragged. */\nexport function computeDefaultCropDimensions(\n viewportRect: Size,\n aspectRatio: number | undefined,\n fixedCropArea: boolean,\n): Size {\n const targetWidth = viewportRect.width * DEFAULT_VIEWPORT_FILL;\n const targetHeight = viewportRect.height * DEFAULT_VIEWPORT_FILL;\n if (hasAspectRatio(aspectRatio)) {\n if (fixedCropArea) {\n let height = viewportRect.height;\n let width = height * aspectRatio;\n if (width > viewportRect.width) {\n width = viewportRect.width;\n height = width / aspectRatio;\n }\n return { width, height };\n }\n const targetAspect = targetWidth / targetHeight;\n if (aspectRatio > targetAspect) {\n const width = targetWidth;\n return { width, height: width / aspectRatio };\n }\n const height = targetHeight;\n return { width: height * aspectRatio, height };\n }\n if (fixedCropArea) {\n const size = min(viewportRect.width, viewportRect.height);\n return { width: size, height: size };\n }\n return { width: targetWidth, height: targetHeight };\n}\n\n/**\n * The rectangle a cropper settles on for a given viewport and set of props.\n *\n * zag spreads this across `setDefaultCrop` and `adjustCropAspectRatio`; it is one\n * function here because the two say the same thing and having them apart is what\n * makes the order easy to get wrong.\n */\nexport function computeInitialCrop(options: {\n viewportRect: Size;\n aspectRatio?: number;\n cropShape: \"rectangle\" | \"circle\";\n fixedCropArea: boolean;\n initialCrop?: Rect;\n minSize: Size;\n maxSize: Size;\n}): Rect {\n const { viewportRect, cropShape, fixedCropArea, initialCrop, minSize, maxSize } = options;\n const aspectRatio = resolveCropAspectRatio(cropShape, options.aspectRatio);\n const fit = (rect: Rect): Rect =>\n computeResizeCrop({\n cropStart: rect,\n handlePosition: \"se\",\n delta: { x: 0, y: 0 },\n viewportRect,\n minSize,\n maxSize,\n aspectRatio,\n });\n\n if (initialCrop) {\n const { width, height } = fit({ x: 0, y: 0, width: initialCrop.width, height: initialCrop.height });\n const bounds = getMaxBounds({ width, height }, viewportRect);\n const { x, y } = clampPoint(initialCrop, { x: 0, y: 0 }, bounds);\n return { x, y, width, height };\n }\n\n const defaultSize = computeDefaultCropDimensions(viewportRect, aspectRatio, fixedCropArea);\n const { width, height } = fit({ x: 0, y: 0, ...defaultSize });\n const { x, y } = centerRect({ width, height }, viewportRect);\n return { x, y, width, height };\n}\n\n/**\n * Re-fit an existing crop after the aspect ratio or shape changed.\n *\n * Keeps the box where it was — centred on the same point — rather than jumping\n * it back to the middle, which is what makes switching from square to 16:9 feel\n * like a change of shape rather than a reset.\n */\nexport function adjustCropAspectRatio(options: {\n crop: Rect;\n viewportRect: Size;\n aspectRatio?: number;\n cropShape: \"rectangle\" | \"circle\";\n minSize: Size;\n maxSize: Size;\n}): Rect {\n const { crop, viewportRect, cropShape, minSize, maxSize } = options;\n const aspectRatio = resolveCropAspectRatio(cropShape, options.aspectRatio);\n if (!isVisibleRect(viewportRect) || !isVisibleRect(crop) || aspectRatio === undefined) {\n return crop;\n }\n if (abs(crop.width / crop.height - aspectRatio) < ASPECT_RATIO_TOLERANCE) return crop;\n const constrained = computeResizeCrop({\n cropStart: crop,\n handlePosition: \"se\",\n delta: { x: 0, y: 0 },\n viewportRect,\n minSize,\n maxSize,\n aspectRatio,\n });\n if (crop.width === constrained.width && crop.height === constrained.height) return crop;\n const position = centerCropOnPoint(constrained, getCenterPoint(crop), viewportRect);\n return { x: position.x, y: position.y, width: constrained.width, height: constrained.height };\n}\n\n/** Arrow keys move the box; the modifier decides how far. zag's three steps. */\nexport function getKeyboardMoveDelta(key: string, step: number): Point {\n switch (key) {\n case \"ArrowLeft\":\n return { x: -step, y: 0 };\n case \"ArrowRight\":\n return { x: step, y: 0 };\n case \"ArrowUp\":\n return { x: 0, y: -step };\n case \"ArrowDown\":\n return { x: 0, y: step };\n default:\n return { x: 0, y: 0 };\n }\n}\n\nconst expandLeft = (crop: Rect, step: number, maxWidth: number) => {\n const newX = max(0, crop.x - step);\n const newWidth = crop.width + (crop.x - newX);\n if (newWidth <= maxWidth) return { x: newX, width: newWidth };\n return { x: crop.x + crop.width - maxWidth, width: maxWidth };\n};\n\nconst expandTop = (crop: Rect, step: number, maxHeight: number) => {\n const newY = max(0, crop.y - step);\n const newHeight = crop.height + (crop.y - newY);\n if (newHeight <= maxHeight) return { y: newY, height: newHeight };\n return { y: crop.y + crop.height - maxHeight, height: maxHeight };\n};\n\nconst shrinkFromLeft = (crop: Rect, step: number, minWidth: number) => {\n const newX = min(crop.x + step, crop.x + crop.width - minWidth);\n return { x: newX, width: crop.width - (newX - crop.x) };\n};\n\nconst shrinkFromTop = (crop: Rect, step: number, minHeight: number) => {\n const newY = min(crop.y + step, crop.y + crop.height - minHeight);\n return { y: newY, height: crop.height - (newY - crop.y) };\n};\n\n/**\n * Alt+arrow resizes rather than moves, from a nominated handle.\n *\n * Note what this does *not* do: it ignores the aspect ratio. That is zag's —\n * `computeKeyboardCrop` calls `resolveSizeLimits` without one — and it is\n * reproduced rather than corrected, because a keyboard resize that respected the\n * ratio in Angular alone would drift from the other three libraries by a few\n * pixels per keypress and read differently in `aria-valuetext`.\n */\nexport function computeKeyboardCrop(\n key: string,\n handlePosition: HandlePosition,\n step: number,\n crop: Rect,\n viewportRect: Size,\n minSize: Size,\n maxSize: Size,\n): Rect {\n const nextCrop: Rect = { ...crop };\n const { minWidth, minHeight, maxWidth, maxHeight } = resolveSizeLimits({\n minSize,\n maxSize,\n viewportSize: viewportRect,\n });\n const isCorner = isCornerHandle(handlePosition);\n\n if (key === \"ArrowLeft\") {\n if (isLeftHandle(handlePosition)) {\n const expanded = expandLeft(crop, step, maxWidth);\n nextCrop.x = expanded.x;\n nextCrop.width = expanded.width;\n if (isCorner && isTopHandle(handlePosition)) {\n const expandedY = expandTop(crop, step, maxHeight);\n nextCrop.y = expandedY.y;\n nextCrop.height = expandedY.height;\n } else if (isCorner && isBottomHandle(handlePosition)) {\n nextCrop.height = min(viewportRect.height - nextCrop.y, min(maxHeight, nextCrop.height + step));\n }\n } else if (isRightHandle(handlePosition)) {\n nextCrop.width = max(minWidth, nextCrop.width - step);\n if (isCorner && isTopHandle(handlePosition)) {\n const shrunk = shrinkFromTop(crop, step, minHeight);\n nextCrop.y = shrunk.y;\n nextCrop.height = shrunk.height;\n } else if (isCorner && isBottomHandle(handlePosition)) {\n nextCrop.height = max(minHeight, nextCrop.height - step);\n }\n }\n } else if (key === \"ArrowRight\") {\n if (isLeftHandle(handlePosition)) {\n const shrunk = shrinkFromLeft(crop, step, minWidth);\n nextCrop.x = shrunk.x;\n nextCrop.width = shrunk.width;\n if (isCorner && isTopHandle(handlePosition)) {\n const shrunkY = shrinkFromTop(crop, step, minHeight);\n nextCrop.y = shrunkY.y;\n nextCrop.height = shrunkY.height;\n } else if (isCorner && isBottomHandle(handlePosition)) {\n nextCrop.height = max(minHeight, nextCrop.height - step);\n }\n } else if (isRightHandle(handlePosition)) {\n nextCrop.width = min(viewportRect.width - nextCrop.x, min(maxWidth, nextCrop.width + step));\n if (isCorner && isTopHandle(handlePosition)) {\n const expanded = expandTop(crop, step, maxHeight);\n nextCrop.y = expanded.y;\n nextCrop.height = expanded.height;\n } else if (isCorner && isBottomHandle(handlePosition)) {\n nextCrop.height = min(viewportRect.height - nextCrop.y, min(maxHeight, nextCrop.height + step));\n }\n }\n }\n\n if (key === \"ArrowUp\") {\n if (isTopHandle(handlePosition)) {\n const expanded = expandTop(crop, step, maxHeight);\n nextCrop.y = expanded.y;\n nextCrop.height = expanded.height;\n if (isCorner && isLeftHandle(handlePosition)) {\n const expandedX = expandLeft(crop, step, maxWidth);\n nextCrop.x = expandedX.x;\n nextCrop.width = expandedX.width;\n } else if (isCorner && isRightHandle(handlePosition)) {\n nextCrop.width = min(viewportRect.width - nextCrop.x, min(maxWidth, nextCrop.width + step));\n }\n } else if (isBottomHandle(handlePosition)) {\n nextCrop.height = max(minHeight, nextCrop.height - step);\n if (isCorner && isLeftHandle(handlePosition)) {\n const shrunk = shrinkFromLeft(crop, step, minWidth);\n nextCrop.x = shrunk.x;\n nextCrop.width = shrunk.width;\n } else if (isCorner && isRightHandle(handlePosition)) {\n nextCrop.width = max(minWidth, nextCrop.width - step);\n }\n }\n } else if (key === \"ArrowDown\") {\n if (isTopHandle(handlePosition)) {\n const shrunk = shrinkFromTop(crop, step, minHeight);\n nextCrop.y = shrunk.y;\n nextCrop.height = shrunk.height;\n if (isCorner && isLeftHandle(handlePosition)) {\n const shrunkX = shrinkFromLeft(crop, step, minWidth);\n nextCrop.x = shrunkX.x;\n nextCrop.width = shrunkX.width;\n } else if (isCorner && isRightHandle(handlePosition)) {\n nextCrop.width = max(minWidth, nextCrop.width - step);\n }\n } else if (isBottomHandle(handlePosition)) {\n nextCrop.height = min(viewportRect.height - nextCrop.y, min(maxHeight, nextCrop.height + step));\n if (isCorner && isLeftHandle(handlePosition)) {\n const expanded = expandLeft(crop, step, maxWidth);\n nextCrop.x = expanded.x;\n nextCrop.width = expanded.width;\n } else if (isCorner && isRightHandle(handlePosition)) {\n nextCrop.width = min(viewportRect.width - nextCrop.x, min(maxWidth, nextCrop.width + step));\n }\n }\n }\n\n return nextCrop;\n}\n","import {\n ApplicationRef,\n Component,\n DestroyRef,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { imageCropperStyles, type ControlSize, type ImageCropperVariants } from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport {\n CROP_HANDLES,\n adjustCropAspectRatio,\n computeInitialCrop,\n computeKeyboardCrop,\n computeMoveCrop,\n computeResizeCrop,\n getKeyboardMoveDelta,\n isVisibleRect,\n roundRect,\n type HandlePosition,\n type Rect,\n type Size,\n} from \"./crop-geometry.js\";\n\nexport type ImageCropperSize = ControlSize;\nexport type CropShape = NonNullable<ImageCropperVariants[\"cropShape\"]>;\nexport type CropRect = Rect;\n\n/** zag's crop bounds, none of which the library exposes as props. */\nconst MIN_SIZE: Size = { width: 40, height: 40 };\nconst MAX_SIZE: Size = { width: Number.POSITIVE_INFINITY, height: Number.POSITIVE_INFINITY };\n\n/** zag's nudge ladder: plain, with Shift, with Ctrl or Cmd. */\nconst NUDGE_STEP = 1;\nconst NUDGE_STEP_SHIFT = 10;\nconst NUDGE_STEP_CTRL = 50;\n\nconst DEFAULT_MIN_ZOOM = 1;\nconst DEFAULT_MAX_ZOOM = 5;\nconst ZOOM_STEP = 0.1;\n\n/** The instructions the selection carries, verbatim from the machine. */\nconst SELECTION_INSTRUCTIONS =\n \"Use arrow keys to move the crop. Hold Alt with arrow keys to resize width or height. \" +\n \"Press plus or minus to zoom.\";\n\nconst toPx = (value: number) => `${value}px`;\n\n/** zag's `getHandlePositionStyles`, which places each handle on its own edge. */\nconst HANDLE_STYLES: Record<HandlePosition, string> = {\n n: \"position: absolute; cursor: n-resize; width: 96%; top: 0px; left: 50%; translate: -50% -50%;\",\n e: \"position: absolute; cursor: e-resize; height: 96%; right: 0px; top: 50%; translate: 50% -50%;\",\n s: \"position: absolute; cursor: s-resize; width: 96%; bottom: 0px; left: 50%; translate: -50% 50%;\",\n w: \"position: absolute; cursor: w-resize; height: 96%; left: 0px; top: 50%; translate: -50% -50%;\",\n ne: \"position: absolute; cursor: ne-resize; top: 0px; right: 0px; translate: 50% -50%;\",\n se: \"position: absolute; cursor: se-resize; bottom: 0px; right: 0px; translate: 50% 50%;\",\n sw: \"position: absolute; cursor: sw-resize; bottom: 0px; left: 0px; translate: -50% 50%;\",\n nw: \"position: absolute; cursor: nw-resize; top: 0px; left: 0px; translate: -50% -50%;\",\n};\n\n/**\n * A crop box over an image, draggable and resizable.\n *\n * ```html\n * <div uioImageCropper src=\"/photo.png\" [aspectRatio]=\"1\" (cropChange)=\"crop = $event\"></div>\n * ```\n *\n * ── Nothing here is true until the viewport has a width ─────────────────────\n *\n * The crop rectangle is derived from the *laid-out* viewport — 80% of it,\n * centred, then fitted to the aspect ratio and the size bounds — and it reaches\n * assistive technology as `aria-valuenow`, `aria-valuemax` and an\n * `aria-valuetext` that reads the rectangle out in pixels. So the arithmetic has\n * to land on the same numbers React does rather than on a sensible box of its\n * own, which is why `crop-geometry.ts` is a transcription of zag's rather than a\n * re-derivation, and why it is checked against rectangles captured from a\n * running React cropper.\n *\n * Before the measurement lands the crop is zero-sized, `data-measured` is absent\n * and the selection is `visibility: hidden` — the same first frame the other\n * three libraries render, and the reason a browser scenario has to wait for\n * `[data-measured]` before comparing anything.\n *\n * ── `fixedCropArea` disables, it does not remove ────────────────────────────\n *\n * The handles stay in the DOM and take `data-disabled`, so the box keeps its\n * shape and its outline. The selection loses its tab stop and gains\n * `aria-disabled=\"true\"` — which is zag 1.41.2's behaviour, the machine Ark React\n * bundles. Newer zag drops the `aria-disabled` and keeps the tab stop, on the\n * grounds that a fixed crop area is still pannable; Angular follows React here\n * because React is what this library is compared against.\n */\n@Component({\n selector: \"div[uioImageCropper]\",\n standalone: true,\n exportAs: \"uioImageCropper\",\n template: `\n @if (label(); as text) {\n <span class=\"field__label\">{{ text }}</span>\n }\n\n <div\n class=\"image-cropper__viewport\"\n data-scope=\"image-cropper\"\n data-part=\"viewport\"\n role=\"presentation\"\n [id]=\"partId('viewport')\"\n [attr.data-ownedby]=\"rootId\"\n [attr.data-disabled]=\"flag(fixedCropArea())\"\n [attr.style]=\"viewportStyle\"\n (pointerdown)=\"onViewportPointerDown($event)\"\n >\n <img\n class=\"image-cropper__image\"\n data-scope=\"image-cropper\"\n data-part=\"image\"\n draggable=\"false\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [id]=\"partId('image')\"\n [attr.alt]=\"alt()\"\n [attr.src]=\"src()\"\n [attr.data-ownedby]=\"partId('viewport')\"\n [attr.data-ready]=\"flag(imageReady())\"\n [attr.style]=\"imageStyle()\"\n (load)=\"onImageLoad($event)\"\n />\n\n <div\n class=\"image-cropper__selection\"\n data-scope=\"image-cropper\"\n data-part=\"selection\"\n role=\"slider\"\n aria-roledescription=\"2d slider\"\n aria-valuemin=\"0\"\n [id]=\"partId('selection')\"\n [attr.tabindex]=\"fixedCropArea() ? null : 0\"\n [attr.aria-label]=\"selectionLabel()\"\n [attr.aria-disabled]=\"fixedCropArea() ? 'true' : null\"\n [attr.aria-valuemax]=\"valueMax()\"\n [attr.aria-valuenow]=\"rounded().x\"\n [attr.aria-valuetext]=\"valueText()\"\n [attr.aria-description]=\"SELECTION_INSTRUCTIONS\"\n [attr.data-disabled]=\"flag(fixedCropArea())\"\n [attr.data-shape]=\"cropShape()\"\n [attr.data-measured]=\"flag(measured())\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.style]=\"selectionStyle()\"\n (pointerdown)=\"onSelectionPointerDown($event)\"\n (keydown)=\"onSelectionKeydown($event)\"\n >\n @if (showGrid()) {\n <div\n class=\"image-cropper__grid\"\n data-scope=\"image-cropper\"\n data-part=\"grid\"\n aria-hidden=\"true\"\n data-axis=\"horizontal\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.style]=\"gridStyle('horizontal')\"\n ></div>\n <div\n class=\"image-cropper__grid\"\n data-scope=\"image-cropper\"\n data-part=\"grid\"\n aria-hidden=\"true\"\n data-axis=\"vertical\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.style]=\"gridStyle('vertical')\"\n ></div>\n }\n <!--\n Rendered even when the crop area is fixed: zag disables the handles\n rather than removing them, so the box keeps its outline.\n -->\n @for (position of HANDLES; track position) {\n <div\n data-scope=\"image-cropper\"\n data-part=\"handle\"\n aria-hidden=\"true\"\n role=\"presentation\"\n [class]=\"handleClass(position)\"\n [id]=\"partId('handle:' + position)\"\n [attr.data-position]=\"position\"\n [attr.data-disabled]=\"flag(fixedCropArea())\"\n [attr.style]=\"handleStyle(position)\"\n (pointerdown)=\"onHandlePointerDown($event, position)\"\n ></div>\n }\n </div>\n </div>\n\n @if (helperText(); as text) {\n <span class=\"field__description\">{{ text }}</span>\n }\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n role: \"group\",\n \"aria-roledescription\": \"Image cropper\",\n \"aria-label\": \"Image cropper\",\n \"aria-live\": \"polite\",\n \"[attr.aria-description]\": \"description()\",\n \"[attr.aria-controls]\": \"controls()\",\n \"[attr.aria-busy]\": \"imageReady() ? null : 'true'\",\n \"[attr.data-fixed]\": \"flag(fixedCropArea())\",\n \"[attr.data-shape]\": \"cropShape()\",\n \"[attr.data-dragging]\": \"flag(dragging())\",\n \"[attr.data-panning]\": \"flag(panning())\",\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioImageCropper extends UioPart {\n readonly scope = \"image-cropper\";\n readonly part = \"root\";\n\n readonly src = input(\"\");\n readonly alt = input(\"\");\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** The box the editor opens with. Defaults to the largest centred one. */\n readonly initialCrop = input<CropRect | undefined>(undefined);\n /** Locks the box to a ratio, e.g. `1` for square. */\n readonly aspectRatio = input<number | undefined>(undefined);\n readonly cropShape = input<CropShape>(\"rectangle\");\n readonly cropChange = output<CropRect>();\n /** Uncontrolled until something binds it — see `UioSwitch`. */\n readonly zoom = model(1);\n readonly zoomChange = output<number>();\n readonly minZoom = input<number | undefined>(undefined);\n readonly maxZoom = input<number | undefined>(undefined);\n readonly showGrid = input(true, { transform: booleanAttribute });\n readonly fixedCropArea = input(false, { transform: booleanAttribute });\n readonly size = input<ImageCropperSize>(\"md\");\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly appRef = inject(ApplicationRef);\n\n protected readonly flag = stateFlag;\n protected readonly HANDLES = CROP_HANDLES;\n protected readonly SELECTION_INSTRUCTIONS = SELECTION_INSTRUCTIONS;\n\n private readonly machine = nextMachineId();\n protected readonly rootId = `image-cropper:${this.machine}`;\n protected partId(part: string): string {\n return `${this.rootId}:${part}`;\n }\n\n protected readonly hostClass = computed(() =>\n imageCropperStyles({ size: this.size(), cropShape: this.cropShape() }),\n );\n\n private readonly viewportRect = signal<Size>({ width: 0, height: 0 });\n private readonly naturalSize = signal<Size>({ width: 0, height: 0 });\n private readonly crop = signal<CropRect>({ x: 0, y: 0, width: 0, height: 0 });\n protected readonly dragging = signal(false);\n protected readonly panning = signal(false);\n\n protected readonly imageReady = computed(() => isVisibleRect(this.naturalSize()));\n protected readonly measured = computed(\n () => isVisibleRect(this.viewportRect()) && isVisibleRect(this.crop()),\n );\n protected readonly rounded = computed(() => roundRect(this.crop()));\n\n private readonly resolvedZoom = computed(() =>\n Math.min(\n Math.max(this.zoom(), this.minZoom() ?? DEFAULT_MIN_ZOOM),\n this.maxZoom() ?? DEFAULT_MAX_ZOOM,\n ),\n );\n\n protected readonly controls = computed(\n () => `${this.partId(\"viewport\")} ${this.partId(\"selection\")}`,\n );\n\n /**\n * The live region's text, and the only place `zoom` is readable at all.\n *\n * Two branches, both the machine's: an image that has not loaded reports that\n * it is loading, and one that has reports the crop in whole pixels. The zoom\n * is written to two decimal places and the rotation is always zero — the\n * library exposes no rotation prop in any of the four packages.\n */\n protected readonly description = computed(() => {\n if (!this.imageReady()) return \"Image cropper preview loading\";\n const crop = this.rounded();\n const zoom = this.resolvedZoom();\n const zoomText = Number.isFinite(zoom) ? `${zoom.toFixed(2)}x zoom` : \"default zoom\";\n return (\n `Image cropper preview, ${zoomText}, 0 degrees rotation. ` +\n `Crop positioned at ${crop.x}px from the left and ${crop.y}px from the top ` +\n `with a size of ${crop.width}px by ${crop.height}px.`\n );\n });\n\n protected readonly selectionLabel = computed(\n () => `Crop selection area (${this.cropShape() === \"circle\" ? \"circle\" : \"rectangle\"})`,\n );\n\n protected readonly valueText = computed(() => {\n const { x, y, width, height } = this.rounded();\n return this.cropShape() === \"circle\"\n ? `Position X ${x}px, Y ${y}px. Diameter ${width}px.`\n : `Position X ${x}px, Y ${y}px. Size ${width}px by ${height}px.`;\n });\n\n /**\n * How far the box can travel, not how big it is.\n *\n * Before the viewport has been measured there is nothing to subtract from, so\n * the machine falls back to the box's own position — which is zero — rather\n * than to a negative number.\n */\n protected readonly valueMax = computed(() => {\n const viewport = this.viewportRect();\n const crop = this.crop();\n return isVisibleRect(viewport)\n ? Math.max(0, Math.round(viewport.width - crop.width))\n : Math.max(this.rounded().x, 0);\n });\n\n protected readonly rootStyle = computed(() => {\n const crop = this.crop();\n return (\n `--crop-width: ${toPx(crop.width)}; --crop-height: ${toPx(crop.height)}; ` +\n `--crop-x: ${toPx(crop.x)}; --crop-y: ${toPx(crop.y)}; ` +\n `--image-zoom: ${this.resolvedZoom()}; --image-rotation: 0; ` +\n \"--image-offset-x: 0px; --image-offset-y: 0px;\"\n );\n });\n\n protected readonly viewportStyle =\n \"position: relative; overflow: hidden; touch-action: none; user-select: none;\";\n\n protected readonly imageStyle = computed(\n () =>\n \"pointer-events: none; user-select: none; \" +\n `transform: translate(0px, 0px) rotate(0deg) scale(${this.resolvedZoom()}, ${this.resolvedZoom()}); ` +\n \"will-change: transform;\",\n );\n\n protected readonly selectionStyle = computed(\n () =>\n \"position: absolute; top: var(--crop-y); left: var(--crop-x); \" +\n \"width: var(--crop-width); height: var(--crop-height); touch-action: none;\" +\n (this.measured() ? \"\" : \" visibility: hidden;\"),\n );\n\n protected gridStyle(axis: \"horizontal\" | \"vertical\"): string {\n return (\n \"position: absolute; \" +\n `inset: ${axis === \"horizontal\" ? \"33.33% 0px\" : \"0px 33.33%\"}; ` +\n \"pointer-events: none;\" +\n (this.measured() ? \"\" : \" visibility: hidden;\")\n );\n }\n\n protected handleClass(position: HandlePosition): string {\n return `image-cropper__handle image-cropper__handle--${position}`;\n }\n\n protected handleStyle(position: HandlePosition): string {\n return HANDLE_STYLES[position];\n }\n\n private resize: ResizeObserver | null = null;\n private observed: Element | null = null;\n\n constructor() {\n super();\n\n /**\n * Re-fit whenever anything the crop is derived from changes.\n *\n * `afterRenderEffect`, because all of it reads a laid-out viewport. The\n * measurement writes signals, which schedules another pass; the guards in\n * `measureViewport` are what stop it from running for ever.\n */\n afterRenderEffect(() => {\n this.aspectRatio();\n this.cropShape();\n this.fixedCropArea();\n this.initialCrop();\n untracked(() => this.measureViewport());\n });\n\n inject(DestroyRef).onDestroy(() => this.resize?.disconnect());\n }\n\n private viewportEl(): HTMLElement | null {\n return this.host.nativeElement.querySelector<HTMLElement>('[data-part=\"viewport\"]');\n }\n\n private measureViewport(): void {\n const el = this.viewportEl();\n if (!el) return;\n\n if (typeof ResizeObserver !== \"undefined\" && this.observed !== el) {\n this.resize?.disconnect();\n this.observed = el;\n // The crop is a pixel rectangle inside the viewport, so a viewport that\n // changes width invalidates it — a window resize as much as a new image.\n this.resize = new ResizeObserver(() => this.measureViewport());\n this.resize.observe(el);\n }\n\n const box = el.getBoundingClientRect();\n const next: Size = { width: box.width, height: box.height };\n if (!isVisibleRect(next)) return;\n\n const previous = this.viewportRect();\n const sameViewport = previous.width === next.width && previous.height === next.height;\n if (!sameViewport) this.viewportRect.set(next);\n\n const crop = this.crop();\n if (!isVisibleRect(crop)) {\n this.setCrop(\n computeInitialCrop({\n viewportRect: next,\n aspectRatio: this.aspectRatio(),\n cropShape: this.cropShape(),\n fixedCropArea: this.fixedCropArea(),\n initialCrop: this.initialCrop(),\n minSize: MIN_SIZE,\n maxSize: MAX_SIZE,\n }),\n );\n return;\n }\n\n // A ratio the box no longer matches — the caller changed `aspectRatio` or\n // `cropShape` after the fact — re-fits it about its own centre rather than\n // resetting it to the middle of the viewport.\n const adjusted = adjustCropAspectRatio({\n crop,\n viewportRect: next,\n aspectRatio: this.aspectRatio(),\n cropShape: this.cropShape(),\n minSize: MIN_SIZE,\n maxSize: MAX_SIZE,\n });\n if (adjusted !== crop) this.setCrop(adjusted);\n }\n\n private setCrop(crop: CropRect): void {\n const previous = this.crop();\n if (\n previous.x === crop.x &&\n previous.y === crop.y &&\n previous.width === crop.width &&\n previous.height === crop.height\n ) {\n return;\n }\n this.crop.set(crop);\n this.cropChange.emit(crop);\n flushNow(this.appRef);\n }\n\n protected onImageLoad(event: Event): void {\n const image = event.currentTarget as HTMLImageElement;\n if (!image.complete) return;\n const size = { width: image.naturalWidth, height: image.naturalHeight };\n if (!isVisibleRect(size)) return;\n this.naturalSize.set(size);\n // A loaded image is the machine's cue to lay the default crop out, which is\n // usually a no-op here because the viewport already had a width.\n this.measureViewport();\n flushNow(this.appRef);\n }\n\n private origin: { pointer: { x: number; y: number }; crop: CropRect } | null = null;\n private handle: HandlePosition | null = null;\n\n protected onSelectionPointerDown(event: PointerEvent): void {\n if (this.fixedCropArea()) {\n event.preventDefault();\n return;\n }\n this.startDrag(event, null);\n }\n\n protected onHandlePointerDown(event: PointerEvent, position: HandlePosition): void {\n if (this.fixedCropArea()) {\n event.preventDefault();\n return;\n }\n // The handle sits on the selection's edge, so its own pointerdown would also\n // start a move. Stopping here is what makes a corner resize rather than drag.\n event.stopPropagation();\n this.startDrag(event, position);\n }\n\n /**\n * Panning the image under a fixed crop.\n *\n * There is nothing to pan while the image is at zoom 1 — it exactly fills the\n * viewport — so this only ever sets `data-panning`, which is the attribute the\n * other three libraries also set for the same gesture.\n */\n protected onViewportPointerDown(event: PointerEvent): void {\n if (event.pointerType === \"mouse\" && event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (!this.fixedCropArea() && target?.closest('[data-part=\"selection\"]')) return;\n if (target?.closest('[data-part=\"handle\"]')) return;\n this.panning.set(true);\n const document = this.host.nativeElement.ownerDocument;\n const stop = () => {\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n this.panning.set(false);\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n flushNow(this.appRef);\n }\n\n private startDrag(event: PointerEvent, handle: HandlePosition | null): void {\n if (event.pointerType === \"mouse\" && event.button !== 0) return;\n this.origin = { pointer: { x: event.clientX, y: event.clientY }, crop: this.crop() };\n this.handle = handle;\n this.dragging.set(true);\n\n // Followed on the document: a crop box is dragged to the edge of its\n // viewport constantly, and a listener on the box alone would drop the\n // gesture the moment the pointer left it.\n const document = this.host.nativeElement.ownerDocument;\n const move = (moved: PointerEvent) => this.onDragMove(moved);\n const stop = () => {\n document.removeEventListener(\"pointermove\", move);\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n this.origin = null;\n this.handle = null;\n this.dragging.set(false);\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointermove\", move);\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n flushNow(this.appRef);\n }\n\n private onDragMove(event: PointerEvent): void {\n const origin = this.origin;\n if (!origin) return;\n const delta = {\n x: event.clientX - origin.pointer.x,\n y: event.clientY - origin.pointer.y,\n };\n const viewportRect = this.viewportRect();\n const handle = this.handle;\n this.setCrop(\n handle\n ? computeResizeCrop({\n cropStart: origin.crop,\n handlePosition: handle,\n delta,\n viewportRect,\n minSize: MIN_SIZE,\n maxSize: MAX_SIZE,\n aspectRatio: this.cropShape() === \"circle\" ? 1 : this.aspectRatio(),\n })\n : computeMoveCrop(origin.crop, delta, viewportRect),\n );\n }\n\n protected onSelectionKeydown(event: KeyboardEvent): void {\n if (this.fixedCropArea()) {\n event.preventDefault();\n return;\n }\n if (event.defaultPrevented) return;\n\n const { key, shiftKey, ctrlKey, metaKey, altKey } = event;\n if (key === \"+\" || key === \"=\") {\n event.preventDefault();\n this.zoomBy(ZOOM_STEP);\n return;\n }\n if (key === \"-\" || key === \"_\") {\n event.preventDefault();\n this.zoomBy(-ZOOM_STEP);\n return;\n }\n\n const arrows = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"];\n if (!arrows.includes(key)) return;\n event.preventDefault();\n\n const step = ctrlKey || metaKey ? NUDGE_STEP_CTRL : shiftKey ? NUDGE_STEP_SHIFT : NUDGE_STEP;\n const viewportRect = this.viewportRect();\n if (!isVisibleRect(viewportRect)) return;\n\n if (altKey) {\n // Alt resizes instead of moving, from the south or east edge — zag picks\n // the handle from the axis rather than from where the pointer last was.\n const handle: HandlePosition = key === \"ArrowUp\" || key === \"ArrowDown\" ? \"s\" : \"e\";\n this.setCrop(\n computeKeyboardCrop(key, handle, step, this.crop(), viewportRect, MIN_SIZE, MAX_SIZE),\n );\n } else {\n this.setCrop(computeMoveCrop(this.crop(), getKeyboardMoveDelta(key, step), viewportRect));\n }\n flushNow(this.appRef);\n }\n\n /** Step the zoom, clamped into `minZoom`…`maxZoom`. */\n zoomBy(delta: number): void {\n this.setZoom(this.zoom() + delta);\n }\n\n setZoom(value: number): void {\n const next = Math.min(\n Math.max(value, this.minZoom() ?? DEFAULT_MIN_ZOOM),\n this.maxZoom() ?? DEFAULT_MAX_ZOOM,\n );\n if (next === this.zoom()) return;\n this.zoom.set(next);\n this.zoomChange.emit(next);\n flushNow(this.appRef);\n }\n}\n","import { Overlay, type OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n untracked,\n type Signal,\n} from \"@angular/core\";\nimport {\n floatingPanelStyles,\n type ControlSize,\n type FloatingPanelVariants,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { createSurface, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type FloatingPanelSize = ControlSize;\nexport type FloatingPanelVariant = NonNullable<FloatingPanelVariants[\"variant\"]>;\n\nexport interface PanelSize {\n width: number;\n height: number;\n}\n\nexport interface PanelPosition {\n x: number;\n y: number;\n}\n\n/** zag's fallbacks, used when the caller gives neither a size nor a position. */\nconst FALLBACK_SIZE: PanelSize = { width: 320, height: 240 };\nconst FALLBACK_POSITION: PanelPosition = { x: 300, y: 100 };\n\n/** Header affordances stay a fixed small edge, as they do in the React panel. */\nconst HEADER_ICON_SIZE = 16;\n\n/** Every edge and corner, in the order the React panel renders them. */\nconst RESIZE_AXES = [\"n\", \"e\", \"s\", \"w\", \"ne\", \"se\", \"sw\", \"nw\"] as const;\ntype ResizeAxis = (typeof RESIZE_AXES)[number];\n\n/** zag's `getResizeAxisStyle`, which places each grab area on its own edge. */\nconst RESIZE_STYLES: Record<ResizeAxis, string> = {\n n: \"position: absolute; touch-action: none; cursor: n-resize; width: 100%; top: 0px; left: 50%; translate: -50%;\",\n e: \"position: absolute; touch-action: none; cursor: e-resize; height: 100%; right: 0px; top: 50%; translate: 0px -50%;\",\n s: \"position: absolute; touch-action: none; cursor: s-resize; width: 100%; bottom: 0px; left: 50%; translate: -50%;\",\n w: \"position: absolute; touch-action: none; cursor: w-resize; height: 100%; left: 0px; top: 50%; translate: 0px -50%;\",\n ne: \"position: absolute; touch-action: none; cursor: ne-resize; top: 0px; right: 0px;\",\n se: \"position: absolute; touch-action: none; cursor: se-resize; bottom: 0px; right: 0px;\",\n sw: \"position: absolute; touch-action: none; cursor: sw-resize; bottom: 0px; left: 0px;\",\n nw: \"position: absolute; touch-action: none; cursor: nw-resize; top: 0px; left: 0px;\",\n};\n\nconst clamp = (value: number, low: number, high: number) => Math.min(Math.max(value, low), high);\n\n/**\n * Closes the panel.\n *\n * ```html\n * <button uioFloatingPanelClose>Done</button>\n * ```\n *\n * The panel renders one of these in its own header — see `showClose` — and this\n * is the same button, so a second one placed in the body is not a lookalike. It\n * exists because React's `FloatingPanelClose` can be written anywhere inside the\n * content, and a \"Done\" button at the foot of a panel is the ordinary reason to\n * want that.\n *\n * Declared above `UioFloatingPanel` because the component imports it for its own\n * header; the `inject` below still resolves, since it runs at construction and\n * both classes exist by then.\n */\n@Directive({\n selector: \"button[uioFloatingPanelClose]\",\n standalone: true,\n host: {\n type: \"button\",\n class: \"floating-panel__close\",\n \"aria-label\": \"Close panel\",\n \"[disabled]\": \"panel.disabled()\",\n \"(click)\": \"panel.hide()\",\n },\n})\nexport class UioFloatingPanelClose extends UioPart {\n readonly scope = \"floating-panel\";\n readonly part = \"close-trigger\";\n protected readonly panel = inject(UioFloatingPanel);\n}\n\n/**\n * A draggable, resizable panel that floats over the page.\n *\n * ```html\n * <button uioFloatingPanelTrigger [panel]=\"layers\">Layers</button>\n * <uio-floating-panel #layers=\"uioFloatingPanel\">\n * <h2 uioFloatingPanelTitle>Layers</h2>\n * <div uioFloatingPanelBody>…</div>\n * </uio-floating-panel>\n * ```\n *\n * Structurally this is the Dialog's story told again — the host element is\n * removed because Ark's root renders nothing, the surface is attached on init\n * because Ark keeps its portal rendered, and a user interaction flushes change\n * detection so the trigger and the panel never disagree.\n *\n * ── The one overlay here that is not anchored ───────────────────────────────\n *\n * Unlike every other surface in this package, a floating panel is not\n * popper-positioned: it sits at an absolute `--x`/`--y` the *user* moved it to,\n * and the positioner carries no inline `z-index` at all. So it uses the CDK's\n * global position strategy and lets its own `position: fixed` inline style do the\n * placing — the same style zag writes — rather than asking the CDK to anchor it\n * to anything.\n *\n * ── `data-topmost` and `data-behind` are one fact, written twice ────────────\n *\n * zag keeps a stack of open panels so several can overlap, and reports the top\n * one on the content *and* the header. With one panel that reduces to \"open\",\n * and both attributes are emitted rather than only the true one, because\n * `dataAttr(!isTopmost)` is what the other three libraries render and the\n * stylesheet is shared.\n *\n * ── The panel's geometry is not part of the compared contract ───────────────\n *\n * Size and position reach the DOM as `--width`, `--height`, `--x` and `--y`, and\n * `style` is not compared by the parity gate. So the drag and resize arithmetic\n * here is this package's own rather than a transcription of zag's rect maths:\n * it clamps to `minSize`/`maxSize` and keeps the panel's top-left where the\n * pointer left it, which is what a user can see. What *is* compared — the parts,\n * the states, the ids and the `aria-labelledby` — is exact.\n */\n@Component({\n selector: \"uio-floating-panel\",\n standalone: true,\n exportAs: \"uioFloatingPanel\",\n providers: [HostPresence],\n imports: [UioIcon, UioFloatingPanelClose],\n template: `\n <!--\n The portal's view container is anchored here, inside the component's own\n template, and never on the host element — see the note in \"UioPopover\" for\n the projection bug that causes.\n -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"floating-panel__positioner\"\n data-scope=\"floating-panel\"\n data-part=\"positioner\"\n [id]=\"partId('positioner')\"\n [attr.style]=\"positionerStyle()\"\n >\n <div\n [class]=\"contentClass()\"\n data-scope=\"floating-panel\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"0\"\n [id]=\"partId('content')\"\n [attr.aria-labelledby]=\"partId('title')\"\n [attr.data-state]=\"state()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-topmost]=\"flag(topmost())\"\n [attr.data-behind]=\"flag(!topmost())\"\n [attr.style]=\"contentStyle\"\n (keydown)=\"onContentKeydown($event)\"\n >\n <div\n class=\"floating-panel__header\"\n data-scope=\"floating-panel\"\n data-part=\"header\"\n [id]=\"partId('header')\"\n [attr.data-dragging]=\"flag(dragging())\"\n [attr.data-topmost]=\"flag(topmost())\"\n [attr.data-behind]=\"flag(!topmost())\"\n >\n <!--\n The drag handle wraps the header's contents rather than sitting\n beside them, which is why grabbing the title bar is what moves the\n panel. Same nesting as the other three libraries.\n -->\n <div\n class=\"floating-panel__drag\"\n data-scope=\"floating-panel\"\n data-part=\"drag-trigger\"\n [attr.data-disabled]=\"flag(!canDrag())\"\n [attr.style]=\"dragStyle\"\n (pointerdown)=\"onDragStart($event)\"\n >\n <ng-content select=\"[uioFloatingPanelTitle]\" />\n @if (showClose()) {\n <!--\n Through the directive rather than repeating its attributes, so\n the header's close button and one the caller places in the body\n cannot drift apart.\n -->\n <button uioFloatingPanelClose>\n <span uioIcon [name]=\"glyph('close')\" [size]=\"HEADER_ICON_SIZE\"></span>\n </button>\n }\n </div>\n </div>\n\n <ng-content />\n\n @for (axis of AXES; track axis) {\n <div\n data-scope=\"floating-panel\"\n data-part=\"resize-trigger\"\n [class]=\"resizeClass(axis)\"\n [attr.data-axis]=\"axis\"\n [attr.data-disabled]=\"flag(!canResize())\"\n [attr.style]=\"resizeStyle(axis)\"\n (pointerdown)=\"onResizeStart($event, axis)\"\n ></div>\n }\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioFloatingPanel implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly open = model(false);\n readonly size = input<FloatingPanelSize>(\"md\");\n readonly variant = input<FloatingPanelVariant>(\"default\");\n readonly showClose = input(true, { transform: booleanAttribute });\n readonly draggable = input(true, { transform: booleanAttribute });\n readonly resizable = input(true, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Panel size in pixels. Uncontrolled until something binds it. */\n readonly panelSize = model<PanelSize>(FALLBACK_SIZE);\n /** Panel position in pixels. Uncontrolled until something binds it. */\n readonly position = model<PanelPosition>(FALLBACK_POSITION);\n readonly minSize = input<PanelSize | undefined>(undefined);\n readonly maxSize = input<PanelSize | undefined>(undefined);\n /** Use `absolute` when the panel must stay inside a scrolling container. */\n readonly strategy = input<\"absolute\" | \"fixed\">(\"fixed\");\n /** How far an arrow key moves the panel. zag's `gridSize`. */\n readonly gridSize = input(1);\n /**\n * Whether Escape closes the panel. **Defaults to false**, which is the\n * machine's own default and therefore what every other library in this system\n * does: zag guards its ESCAPE transition on `closeOnEsc`, and the React\n * facade passes no `closeOnEscape`, so a floating panel does not close on\n * Escape unless it is asked to. Defaulting this to `true` would be the more\n * obvious choice and would make Angular the one library whose panels vanish.\n */\n readonly closeOnEscape = input(false, { transform: booleanAttribute });\n\n protected readonly AXES = RESIZE_AXES;\n protected readonly HEADER_ICON_SIZE = HEADER_ICON_SIZE;\n protected readonly flag = stateFlag;\n private readonly draggingNow = signal(false);\n protected readonly dragging = this.draggingNow.asReadonly();\n /** Read by the projected body, which zag also marks while a drag is running. */\n readonly isDragging = this.dragging;\n\n protected readonly state = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n /**\n * Whether this is the panel on top, and why it is a latch rather than `open()`.\n *\n * zag keeps a stack of panels so several can overlap, pushes onto it when one\n * opens, and never recomputes `isTopmost` on the way down — so a panel that has\n * been opened once keeps `data-topmost` after it closes, and one that never has\n * carries `data-behind` instead. With a single panel that reduces to \"has this\n * ever been open\", which is what this is. Both attributes are emitted rather\n * than only the true one, because `dataAttr(!isTopmost)` is what the other\n * three libraries render.\n */\n private readonly opened = signal(false);\n protected readonly topmost = this.opened.asReadonly();\n\n /** zag's `canDrag` / `canResize`, which the two grab areas report as `data-disabled`. */\n protected readonly canDrag = computed(() => this.draggable() && !this.disabled());\n protected readonly canResize = computed(() => this.resizable() && !this.disabled());\n\n protected readonly contentClass = computed(() =>\n floatingPanelStyles({ size: this.size(), variant: this.variant() }),\n );\n\n private readonly machine = nextMachineId();\n /**\n * `float`, not `floating-panel`.\n *\n * zag's id prefix for this component is not its scope, which is unique in the\n * library and is why the SSR gate needs an `aria-controls` allowance for it.\n * Reproduced so the four libraries render ids of the same shape.\n */\n readonly rootId = `float:${this.machine}`;\n partId(part: string): string {\n return `${this.rootId}:${part}`;\n }\n\n protected readonly positionerStyle = computed(() => {\n const { width, height } = this.panelSize();\n const { x, y } = this.position();\n return (\n `--width: ${width}px; --height: ${height}px; --x: ${x}px; --y: ${y}px; ` +\n `position: ${this.strategy()}; top: var(--y); left: var(--x);`\n );\n });\n\n protected readonly contentStyle = \"width: var(--width); height: var(--height);\";\n protected readonly dragStyle = \"user-select: none; touch-action: none; cursor: move;\";\n\n protected resizeClass(axis: ResizeAxis): string {\n return `floating-panel__resize floating-panel__resize--${axis}`;\n }\n protected resizeStyle(axis: ResizeAxis): string {\n return RESIZE_STYLES[axis];\n }\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly overlay = inject(Overlay);\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private overlayRef?: OverlayRef;\n private surfaceView?: EmbeddedViewRef<unknown>;\n private opener: HTMLElement | null = null;\n private applied = false;\n\n constructor() {\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see the note in `UioDialog`. */\n ngOnInit(): void {\n this.overlayRef = createSurface(this.overlay, {\n // Global rather than connected: a floating panel is not anchored to\n // anything. Its own `position: fixed` inline style — the one zag writes —\n // is what places it, from `--x` and `--y`.\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.surfaceView = this.overlayRef.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n setSurfaceInteractive(this.overlayRef, false);\n this.presence.hide();\n }\n\n ngOnDestroy(): void {\n this.overlayRef?.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n this.setOpen(!this.open());\n }\n\n /** Told by the trigger, so focus can go back where it came from. */\n rememberOpener(element: HTMLElement | null): void {\n this.opener = element;\n }\n\n private setOpen(next: boolean): void {\n if (next === this.open()) return;\n this.open.set(next);\n flushNow(this.appRef);\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null\n );\n }\n\n /**\n * Whether the panel has been through a transition yet.\n *\n * The focus moves belong to the *transition*, not to the state: zag hangs\n * `setInitialFocus` off the closed→open edge and `setFinalFocus` off the way\n * back, and a panel that starts open — `defaultOpen` — never crosses either.\n * So a panel rendered open leaves focus wherever it was, which is what the\n * other three libraries do and what a page with a panel already on it should\n * do rather than stealing focus on load.\n */\n private settled = false;\n\n private sync(): void {\n const open = this.open();\n // Recorded before the early return, not after it: a panel that starts\n // *closed* changes nothing on its first pass, and a flag set only on the way\n // through would still be unset when the user's first click arrived — so the\n // click would be treated as the initial render and focus would not move.\n const first = !this.settled;\n this.settled = true;\n if (open === this.applied) return;\n const transition = !first;\n this.applied = open;\n if (open) this.opened.set(true);\n this.surfaceView?.detectChanges();\n const ref = this.overlayRef;\n if (!ref) return;\n setSurfaceInteractive(ref, open);\n if (!open) {\n if (transition) this.opener?.focus({ preventScroll: true });\n return;\n }\n raiseSurface(ref);\n if (transition) this.contentElement()?.focus({ preventScroll: true });\n }\n\n /**\n * Escape closes, and the arrows move the panel.\n *\n * The arrow keys are only the panel's while the content itself has focus —\n * once focus is inside the body they belong to whatever is there, which is why\n * this checks the target rather than only the key.\n */\n protected onContentKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n if (this.closeOnEscape()) this.hide();\n return;\n }\n if (event.currentTarget !== event.target) return;\n const step = (event.shiftKey ? 10 : 1) * this.gridSize();\n const delta =\n event.key === \"ArrowLeft\"\n ? { x: -step, y: 0 }\n : event.key === \"ArrowRight\"\n ? { x: step, y: 0 }\n : event.key === \"ArrowUp\"\n ? { x: 0, y: -step }\n : event.key === \"ArrowDown\"\n ? { x: 0, y: step }\n : null;\n if (!delta) return;\n event.preventDefault();\n const { x, y } = this.position();\n this.setPosition({ x: x + delta.x, y: y + delta.y });\n }\n\n setPosition(position: PanelPosition): void {\n this.position.set(position);\n flushNow(this.appRef);\n }\n\n setSize(size: PanelSize): void {\n const min = this.minSize() ?? { width: 0, height: 0 };\n const max = this.maxSize() ?? {\n width: Number.POSITIVE_INFINITY,\n height: Number.POSITIVE_INFINITY,\n };\n this.panelSize.set({\n width: clamp(size.width, min.width, max.width),\n height: clamp(size.height, min.height, max.height),\n });\n flushNow(this.appRef);\n }\n\n protected onDragStart(event: PointerEvent): void {\n if (!this.draggable() || this.disabled() || event.button !== 0) return;\n // Not from the close button: a click that starts a drag never fires a click.\n if ((event.target as HTMLElement | null)?.closest('[data-part=\"close-trigger\"]')) return;\n event.preventDefault();\n const origin = { x: event.clientX, y: event.clientY };\n const start = this.position();\n this.track((moved) => {\n this.setPosition({\n x: start.x + (moved.clientX - origin.x),\n y: start.y + (moved.clientY - origin.y),\n });\n });\n }\n\n protected onResizeStart(event: PointerEvent, axis: ResizeAxis): void {\n if (!this.resizable() || this.disabled() || event.button !== 0) return;\n event.preventDefault();\n event.stopPropagation();\n const origin = { x: event.clientX, y: event.clientY };\n const startSize = this.panelSize();\n const startPosition = this.position();\n this.track((moved) => {\n const dx = moved.clientX - origin.x;\n const dy = moved.clientY - origin.y;\n const west = axis.includes(\"w\");\n const north = axis.includes(\"n\");\n const east = axis.includes(\"e\");\n const south = axis.includes(\"s\");\n const width = startSize.width + (east ? dx : west ? -dx : 0);\n const height = startSize.height + (south ? dy : north ? -dy : 0);\n this.setSize({ width, height });\n // Dragging a north or west edge moves the panel as well as sizing it, and\n // by exactly what the size actually changed by — so a panel that hits its\n // minimum stops moving rather than sliding out from under the pointer.\n const applied = this.panelSize();\n this.setPosition({\n x: west ? startPosition.x + (startSize.width - applied.width) : startPosition.x,\n y: north ? startPosition.y + (startSize.height - applied.height) : startPosition.y,\n });\n });\n }\n\n /**\n * Follow a pointer on the document until it is released.\n *\n * On the document rather than the grabbed element, because a drag leaves the\n * eight-pixel resize strip immediately and a panel that stopped following\n * would be unusable.\n */\n private track(move: (moved: PointerEvent) => void): void {\n const document = this.document;\n this.draggingNow.set(true);\n const onMove = (moved: PointerEvent) => move(moved);\n const stop = () => {\n document.removeEventListener(\"pointermove\", onMove);\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n this.draggingNow.set(false);\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointermove\", onMove);\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n flushNow(this.appRef);\n }\n}\n\n/** Opens and closes a panel, and reports its state the way Ark's trigger does. */\n@Directive({\n selector: \"button[uioFloatingPanelTrigger]\",\n standalone: true,\n host: {\n type: \"button\",\n \"[id]\": \"panel ? panel.partId('trigger') : null\",\n \"[attr.aria-controls]\": \"panel ? panel.partId('content') : null\",\n \"(click)\": \"activate()\",\n },\n})\nexport class UioFloatingPanelTrigger extends UioPart {\n readonly scope = \"floating-panel\";\n readonly part = \"trigger\";\n\n /** A decorator input — see `UioDialogTrigger` for why this one is not `input()`. */\n @Input(\"panel\") panel?: UioFloatingPanel;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly isOpen: Signal<boolean> = computed(() => !!this.panel?.open());\n override readonly state = computed(() => (this.isOpen() ? \"open\" : \"closed\"));\n\n ngOnInit(): void {\n this.panel?.rememberOpener(this.host.nativeElement);\n }\n\n protected activate(): void {\n const panel = this.panel;\n if (!panel) return;\n panel.rememberOpener(this.host.nativeElement);\n panel.toggle();\n }\n}\n\n/** Names the panel. Its `role=\"dialog\"` has no accessible name without one. */\n@Directive({\n selector: \"[uioFloatingPanelTitle]\",\n standalone: true,\n host: {\n class: \"floating-panel__title text-strong-body-large\",\n \"[id]\": \"panel.partId('title')\",\n },\n})\nexport class UioFloatingPanelTitle extends UioPart {\n readonly scope = \"floating-panel\";\n readonly part = \"title\";\n protected readonly panel = inject(UioFloatingPanel);\n}\n\n/** The scrolling area below the header. */\n@Directive({\n selector: \"[uioFloatingPanelBody]\",\n standalone: true,\n host: {\n class: \"floating-panel__body text-default-body-medium\",\n \"[attr.data-dragging]\": \"flag(panel.isDragging())\",\n },\n})\nexport class UioFloatingPanelBody extends UioPart {\n readonly scope = \"floating-panel\";\n readonly part = \"body\";\n protected readonly panel = inject(UioFloatingPanel);\n protected readonly flag = stateFlag;\n}\n","import { Overlay, type OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n EmbeddedViewRef,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { tourStyles, type ControlSize, type TourVariants } from \"@ui-organized/core\";\nimport { stateFlag } from \"../part.js\";\nimport { HostPresence } from \"../host-presence.js\";\nimport { UioButton } from \"../button/button.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { nextMachineId } from \"../part-ids.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { createSurface, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type TourSize = ControlSize;\nexport type TourVariant = NonNullable<TourVariants[\"variant\"]>;\nexport type TourStepType = \"tooltip\" | \"dialog\" | \"wait\" | \"floating\";\nexport type TourActionKind = \"next\" | \"prev\" | \"dismiss\" | \"skip\";\n\nexport interface TourStepAction {\n /** Button text. */\n label: string;\n /** What the button does. Defaults to `next`. */\n action?: TourActionKind;\n}\n\nexport interface TourStep {\n /** Unique across the tour. This is what `stepId` names. */\n id: string;\n title: string;\n description: string;\n /** Returns the element to highlight. Omit for a centred, modal step. */\n target?: () => HTMLElement | null;\n /** Inferred from `target` when omitted — see `normalizeTourStep`. */\n type?: TourStepType;\n placement?: string;\n actions?: TourStepAction[];\n /** Dims the rest of the page. Defaulted by the normaliser, not here. */\n backdrop?: boolean;\n /** Points an arrow at the target. Defaulted by the normaliser. */\n arrow?: boolean;\n}\n\nconst CLOSE_ICON_SIZE = 16;\n\nconst DEFAULT_ACTIONS: TourStepAction[] = [\n { label: \"Back\", action: \"prev\" },\n { label: \"Next\", action: \"next\" },\n];\n\n/**\n * Fill in a step's implied fields, exactly as zag's `normalizeStep` does.\n *\n * The order of the branches is the whole of it, and it is not intuitive: a step\n * with `type: \"wait\"` and **no target** falls into the *dialog* branch, because\n * `target == null` is tested before the type is — so it keeps its own `type` (the\n * spread comes last) while picking up `backdrop: true` from a branch it does not\n * belong to. That is why a waiting step with no target renders an *un*-hidden\n * backdrop, which is the sort of thing no amount of reading the prop types\n * predicts and which the browser cases pin.\n *\n * Exported so `tour.spec.ts` can hold every branch against the values a running\n * `@ark-ui/react` Tour rendered.\n */\nexport function normalizeTourStep(step: TourStep): TourStep {\n if (step.type === \"floating\") {\n return { backdrop: false, arrow: false, placement: \"bottom-end\", ...step };\n }\n if (step.target == null || step.type === \"dialog\") {\n return { type: \"dialog\", placement: \"center\", backdrop: true, ...step };\n }\n if (!step.type || step.type === \"tooltip\") {\n return { type: \"tooltip\", arrow: true, backdrop: true, ...step };\n }\n return step;\n}\n\n/** A `wait` step is a pause for the app, not a card, so it is not counted. */\nexport const effectiveTourSteps = (steps: readonly TourStep[]): TourStep[] =>\n steps.filter((step) => step.type !== \"wait\");\n\n/**\n * The \"N of M\" a tour reads out.\n *\n * Both halves come from the *effective* steps, so a waiting step reads \"0 of 1\"\n * rather than \"1 of 2\" — it is not one of the cards being counted, and its own\n * index among them is -1.\n */\nexport function tourProgressText(steps: readonly TourStep[], stepId: string | null): string {\n const effective = effectiveTourSteps(steps);\n const index = stepId == null ? -1 : effective.findIndex((step) => step.id === stepId);\n return `${index + 1} of ${effective.length}`;\n}\n\n/**\n * A guided walkthrough: a card per step, over a dimmed page.\n *\n * ```html\n * <uio-tour [steps]=\"steps\" [(stepId)]=\"stepId\" />\n * ```\n *\n * ── Opening is a *change* to `stepId`, never its initial value ──────────────\n *\n * This is the component's one genuine surprise, it is shared by all four\n * libraries, and it is worth stating rather than smoothing over. zag seeds its\n * `stepId` from the prop and moves the tour into its running state from a\n * **watch** on that value — so a tour rendered with `stepId` already set has\n * nothing to watch, and `start()` sets the id it already holds. It stays closed.\n * The card, the backdrop and the spotlight are all rendered; the card is\n * `hidden` and `data-state=\"closed\"`.\n *\n * Reproduced rather than fixed, because \"fixed\" here means Angular alone opening\n * a tour on page load where React, Svelte and Vue do not. Open it from an\n * interaction — a click that sets `stepId`, or `start(id)` — which is what the\n * React component's own documentation says.\n *\n * ── Where the numbers come from ────────────────────────────────────────────\n *\n * `hasNextStep` and `hasPrevStep` — which decide the Back and Next buttons'\n * `disabled` — count **all** the steps, while the progress text counts only the\n * effective ones. The two disagree for a tour containing a `wait` step, and the\n * disagreement is zag's rather than a slip: a waiting step is a real place in the\n * sequence and not a card to be numbered.\n */\n@Component({\n selector: \"uio-tour\",\n standalone: true,\n exportAs: \"uioTour\",\n providers: [HostPresence],\n imports: [UioButton, UioIcon],\n template: `\n <!-- See the note in \"UioPopover\" for why the container is not on the host. -->\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"tour__backdrop\"\n data-scope=\"tour\"\n data-part=\"backdrop\"\n [id]=\"partId('backdrop')\"\n [attr.hidden]=\"backdropHidden() ? '' : null\"\n [attr.data-state]=\"state()\"\n [attr.data-type]=\"step()?.type ?? null\"\n [attr.style]=\"backdropStyle()\"\n ></div>\n\n <!--\n The cut-out over the highlighted element. Hidden until a step both is\n showing and has a target to point at, which is why a dialog step never\n shows one.\n -->\n <div\n class=\"tour__spotlight\"\n data-scope=\"tour\"\n data-part=\"spotlight\"\n [attr.hidden]=\"spotlightHidden() ? '' : null\"\n [attr.data-state]=\"state()\"\n [attr.style]=\"spotlightStyle()\"\n ></div>\n\n <div\n class=\"tour__positioner\"\n data-scope=\"tour\"\n data-part=\"positioner\"\n [id]=\"partId('positioner')\"\n [attr.data-type]=\"step()?.type ?? null\"\n [attr.style]=\"positionerStyle\"\n >\n <div\n [class]=\"contentClass()\"\n data-scope=\"tour\"\n data-part=\"content\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n tabindex=\"-1\"\n [id]=\"partId('content')\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-state]=\"state()\"\n [attr.data-type]=\"step()?.type ?? null\"\n [attr.data-step]=\"step()?.id ?? null\"\n [attr.aria-labelledby]=\"partId('title')\"\n [attr.aria-describedby]=\"partId('desc')\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (step()?.arrow) {\n <div class=\"tour__arrow\" data-scope=\"tour\" data-part=\"arrow\" [id]=\"partId('arrow')\">\n <div class=\"tour__arrow-tip\" data-scope=\"tour\" data-part=\"arrow-tip\"></div>\n </div>\n }\n\n <div class=\"tour__header\">\n <h2\n class=\"tour__title text-strong-body-large\"\n data-scope=\"tour\"\n data-part=\"title\"\n [id]=\"partId('title')\"\n [attr.data-placement]=\"placement()\"\n >{{ step()?.title ?? \"\" }}</h2\n >\n <!--\n No \"type\" attribute, deliberately: zag normalises this part with\n \"normalize.element\" rather than \"normalize.button\", so none of the\n four libraries renders one. Adding it would be the safer HTML and\n would put Angular out of step on an element the gate compares.\n -->\n <button\n class=\"tour__close\"\n data-scope=\"tour\"\n data-part=\"close-trigger\"\n aria-label=\"End tour\"\n [attr.data-type]=\"step()?.type ?? null\"\n (click)=\"dismiss()\"\n >\n <span uioIcon [name]=\"glyph('close')\" [size]=\"CLOSE_ICON_SIZE\"></span>\n </button>\n </div>\n\n <div\n class=\"tour__description text-default-body-medium\"\n data-scope=\"tour\"\n data-part=\"description\"\n [id]=\"partId('desc')\"\n [attr.data-placement]=\"placement()\"\n >{{ step()?.description ?? \"\" }}</div\n >\n\n <div class=\"tour__footer\">\n @if (showProgress()) {\n <div class=\"tour__progress\" data-scope=\"tour\" data-part=\"progress-text\">{{\n progressText()\n }}</div>\n }\n <div class=\"tour__actions\">\n @for (action of actions(); track $index) {\n <button\n uioButton\n type=\"button\"\n data-scope=\"tour\"\n data-part=\"action-trigger\"\n [intent]=\"action.action === 'next' ? 'primary' : 'secondary'\"\n [size]=\"size()\"\n [attr.data-type]=\"actionType(action)\"\n [attr.aria-label]=\"actionLabel(action)\"\n [disabled]=\"actionDisabled(action)\"\n [attr.data-disabled]=\"flag(actionDisabled(action))\"\n (click)=\"run(action)\"\n >{{ action.label }}</button>\n }\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n `,\n})\nexport class UioTour implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly steps = input<TourStep[]>([]);\n /**\n * The step to show, by id.\n *\n * Setting it to another id *after mount* opens the tour there — see the class\n * note for why its initial value does not.\n */\n readonly stepId = model<string | null>(null);\n readonly stepIdChange = output<string | null>();\n readonly size = input<TourSize>(\"md\");\n readonly variant = input<TourVariant>(\"default\");\n readonly showProgress = input(true, { transform: booleanAttribute });\n /** Corner radius of the spotlight cutout, in pixels. */\n readonly spotlightRadius = input(4);\n /** Blocks interaction with the page behind the tour. */\n readonly preventInteraction = input(false, { transform: booleanAttribute });\n /** Closes when clicking outside the card. */\n readonly closeOnInteractOutside = input(true, { transform: booleanAttribute });\n readonly closeOnEscape = input(true, { transform: booleanAttribute });\n\n protected readonly CLOSE_ICON_SIZE = CLOSE_ICON_SIZE;\n protected readonly flag = stateFlag;\n\n private readonly machine = nextMachineId();\n /**\n * `tour-<part>-<machine>`, which is neither of the two shapes the rest of the\n * library uses. zag builds this component's ids that way and the parity gate\n * compares references rather than literals, so the spelling is reproduced to\n * keep a DOM diff between the four libraries readable.\n */\n protected partId(part: string): string {\n return `tour-${part}-${this.machine}`;\n }\n\n private readonly running = signal(false);\n protected readonly open = this.running.asReadonly();\n protected readonly state = computed(() => (this.running() ? \"open\" : \"closed\"));\n\n protected readonly step = computed(() => {\n const id = this.stepId();\n if (id == null) return null;\n const found = this.steps().find((step) => step.id === id);\n return found ? normalizeTourStep(found) : null;\n });\n\n /** The index among *all* steps, which is what the two buttons are decided by. */\n private readonly stepIndex = computed(() => {\n const id = this.stepId();\n return id == null ? -1 : this.steps().findIndex((step) => step.id === id);\n });\n private readonly hasNextStep = computed(() => this.stepIndex() < this.steps().length - 1);\n private readonly hasPrevStep = computed(() => this.stepIndex() > 0);\n\n protected readonly progressText = computed(() =>\n tourProgressText(this.steps(), this.stepId()),\n );\n\n /** Steps fill in a Back/Next row when they do not name their own. */\n protected readonly actions = computed(() => this.step()?.actions ?? (this.step() ? DEFAULT_ACTIONS : []));\n\n protected readonly contentClass = computed(() =>\n tourStyles({ size: this.size(), variant: this.variant() }),\n );\n\n /**\n * A step with no target has no side to be on, so it is centred — and it is\n * centred even before a step exists, which is what the other three render.\n */\n protected readonly placement = computed(() => (this.step()?.target?.() ? null : \"center\"));\n\n /** Hidden by the *step*, not by the tour: a step may ask for no dimming. */\n protected readonly backdropHidden = computed(() => !this.step()?.backdrop);\n protected readonly spotlightHidden = computed(\n () => !this.running() || !this.step()?.target?.(),\n );\n\n protected readonly backdropStyle = computed(\n () =>\n \"--tour-layer: 0; \" +\n `position: ${this.step()?.type === \"dialog\" ? \"fixed\" : \"absolute\"}; inset: 0px;`,\n );\n\n protected readonly spotlightStyle = computed(\n () =>\n \"--tour-layer: 1; position: absolute; width: 0px; height: 0px; left: 0px; top: 0px; \" +\n `border-radius: ${this.spotlightRadius()}px; pointer-events: none;`,\n );\n\n protected readonly positionerStyle = \"--tour-layer: 2;\";\n\n protected actionType(action: TourStepAction): string {\n const kind = action.action ?? \"next\";\n if (kind === \"next\" || kind === \"prev\") return kind;\n if (kind === \"dismiss\") return \"close\";\n return \"custom\";\n }\n\n protected actionLabel(action: TourStepAction): string | null {\n const kind = action.action ?? \"next\";\n if (kind === \"next\") return \"next step\";\n if (kind === \"prev\") return \"previous step\";\n if (kind === \"dismiss\") return \"close tour\";\n return null;\n }\n\n protected actionDisabled(action: TourStepAction): boolean {\n const kind = action.action ?? \"next\";\n if (kind === \"next\") return !this.hasNextStep();\n if (kind === \"prev\") return !this.hasPrevStep();\n return false;\n }\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n\n private readonly overlay = inject(Overlay);\n private readonly document = inject(DOCUMENT);\n private readonly presence = inject(HostPresence);\n private readonly appRef = inject(ApplicationRef);\n\n private overlayRef?: OverlayRef;\n private surfaceView?: EmbeddedViewRef<unknown>;\n private applied = false;\n /**\n * `undefined` until the first pass, which is what makes the initial `stepId` a\n * seed rather than an instruction. See the class note.\n */\n private seenStepId: string | null | undefined = undefined;\n\n constructor() {\n effect(() => {\n const id = this.stepId();\n untracked(() => this.onStepId(id));\n });\n effect(() => {\n this.running();\n this.step();\n untracked(() => this.sync());\n });\n }\n\n ngOnInit(): void {\n this.overlayRef = createSurface(this.overlay, {\n // The card is centred by `Tour.css` for a dialog step and by the step's\n // own placement otherwise; the CDK is only asked for a container.\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n });\n this.surfaceView = this.overlayRef.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n setSurfaceInteractive(this.overlayRef, false);\n this.presence.hide();\n this.document.addEventListener(\"pointerdown\", this.onDocumentPointerDown, true);\n }\n\n ngOnDestroy(): void {\n this.document.removeEventListener(\"pointerdown\", this.onDocumentPointerDown, true);\n this.overlayRef?.dispose();\n }\n\n /** Open the tour at a step. The imperative half of `stepId`. */\n start(id: string): void {\n if (!this.isValidStep(id)) return;\n this.seenStepId = id;\n this.stepId.set(id);\n this.stepIdChange.emit(id);\n this.running.set(true);\n flushNow(this.appRef);\n }\n\n isValidStep(id: string): boolean {\n return this.steps().some((step) => step.id === id);\n }\n\n next(): void {\n this.goto(this.stepIndex() + 1);\n }\n\n previous(): void {\n this.goto(this.stepIndex() - 1);\n }\n\n /** Ends the tour and reports it as `stepId: null`, the way React's does. */\n dismiss(): void {\n this.running.set(false);\n this.seenStepId = null;\n this.stepId.set(null);\n this.stepIdChange.emit(null);\n flushNow(this.appRef);\n }\n\n private goto(index: number): void {\n const step = this.steps()[index];\n if (!step) return;\n this.seenStepId = step.id;\n this.stepId.set(step.id);\n this.stepIdChange.emit(step.id);\n flushNow(this.appRef);\n }\n\n private onStepId(id: string | null): void {\n if (this.seenStepId === undefined) {\n // The seed. zag's `stepId` bindable takes the prop as its default value,\n // so the machine already holds it and its watch never fires.\n this.seenStepId = id;\n return;\n }\n if (id === this.seenStepId) return;\n this.seenStepId = id;\n if (id != null && this.isValidStep(id)) this.running.set(true);\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[data-part=\"content\"]') ?? null\n );\n }\n\n private sync(): void {\n const open = this.running();\n this.surfaceView?.detectChanges();\n const ref = this.overlayRef;\n if (!ref) return;\n /**\n * The pane takes clicks exactly when the backdrop is painted.\n *\n * The other three libraries portal the backdrop straight into `document.body`\n * where it blocks the page on its own; Angular's sits inside a CDK pane, and\n * `.cdk-overlay-pane` is what actually receives the pointer. So the two have\n * to be kept in step by hand — and the condition is the *backdrop's*, not the\n * tour's, because a closed tour whose current step asks for dimming still\n * renders an un-hidden backdrop in every library. That is a finding about the\n * machine rather than about this port; what matters here is that Angular\n * blocks the page in exactly the cases React does.\n */\n setSurfaceInteractive(ref, open || !this.backdropHidden());\n if (open === this.applied) return;\n this.applied = open;\n if (!open) return;\n raiseSurface(ref);\n this.contentElement()?.focus({ preventScroll: true });\n }\n\n protected run(action: TourStepAction): void {\n switch (action.action ?? \"next\") {\n case \"next\":\n this.next();\n break;\n case \"prev\":\n this.previous();\n break;\n default:\n // `dismiss` and `skip` both end the tour; the difference is which\n // callback zag invokes, and this component reports both as `null`.\n this.dismiss();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented || !this.running()) return;\n if (event.key === \"Escape\") {\n if (this.closeOnEscape()) this.dismiss();\n return;\n }\n if (event.key === \"ArrowRight\" && this.hasNextStep()) this.next();\n else if (event.key === \"ArrowLeft\" && this.hasPrevStep()) this.previous();\n }\n\n private readonly onDocumentPointerDown = (event: PointerEvent): void => {\n if (!this.running() || !this.closeOnInteractOutside()) return;\n const content = this.contentElement();\n const target = event.target;\n if (!content || (target instanceof Node && content.contains(target))) return;\n this.dismiss();\n };\n}\n","/**\n * sRGB, HSL and HSB: parsing, conversion and formatting, written out by hand.\n *\n * ── Why this file exists ────────────────────────────────────────────────────\n *\n * React, Svelte and Vue get their color maths from `@zag-js/color-utils`, which\n * the machine uses for everything a ColorPicker says about itself. This package\n * has no zag and may take no third-party dependency beyond the CDK, so the\n * choice is between writing the conversions and shipping a picker that cannot\n * name the color it is showing.\n *\n * It is not decorative maths. Every one of these values is **compared** by the\n * parity gate, because the machine writes the color into the accessibility\n * tree in four different notations at once:\n *\n * aria-label=\"select color. current color is rgba(37, 99, 235, 1)\" trigger\n * data-value=\"#2563EB\" value swatch\n * aria-valuenow=\"221.21\" aria-valuetext=\"hue 221.21\" hue thumb\n * aria-valuetext=\"saturation 84.26, brightness 92.16\" area thumb\n *\n * Those four come from three different color spaces and two different rounding\n * rules. A conversion that is a hundredth out reads differently to a screen\n * reader and fails the gate, which is exactly the point of writing it down\n * rather than approximating it.\n *\n * ── Sources ─────────────────────────────────────────────────────────────────\n *\n * The conversions are the standard ones, from the derivations in the Wikipedia\n * article \"HSL and HSV\" (§\"From RGB\", §\"HSV to RGB alternative\", §\"HSL to RGB\n * alternative\", §\"HSV to HSL\") — which is the same reference `@zag-js/color-utils`\n * names, deliberately: the alternative formulations differ in floating-point\n * behaviour, and a different-but-equivalent derivation would round differently\n * in the last place and disagree with the other three libraries.\n *\n * The two rules that are *not* in the maths, and matter as much:\n *\n * - Every converted channel is rounded to **two decimal places**, and alpha\n * with it. That is why a hue reads `221.21` rather than `221.21212121`.\n * - A conversion **to** RGB rounds each channel to a whole number, because a\n * byte is what sRGB stores.\n *\n * The named-color table is CSS Color Module Level 4 §6.1 (\"Named Colors\"),\n * transcribed as data.\n *\n * ── And it is checked, not merely written ───────────────────────────────────\n *\n * `color.spec.ts` holds values read out of a **running** `@ark-ui/react`\n * ColorPicker in Chromium — the aria attributes above, for a range of colors\n * and in all three notations the component supports — and asserts this file\n * reproduces them. It also round-trips every one back through the other two\n * spaces, because a conversion that is self-consistent and wrong is the failure\n * a reference table catches and a symmetry test does not.\n */\n\nexport type ColorFormat = \"rgba\" | \"hsla\" | \"hsba\";\n/** The notations `colorToString` can print. `css` is each space's own default. */\nexport type ColorNotation = ColorFormat | \"rgb\" | \"hsl\" | \"hsb\" | \"hex\" | \"hexa\" | \"css\";\n\nexport interface RgbaColor {\n format: \"rgba\";\n red: number;\n green: number;\n blue: number;\n alpha: number;\n}\n\nexport interface HslaColor {\n format: \"hsla\";\n hue: number;\n saturation: number;\n lightness: number;\n alpha: number;\n}\n\nexport interface HsbaColor {\n format: \"hsba\";\n hue: number;\n saturation: number;\n brightness: number;\n alpha: number;\n}\n\nexport type ColorValue = RgbaColor | HslaColor | HsbaColor;\n\n/** A channel's bounds, which is what a slider thumb reports as its range. */\nexport interface ChannelRange {\n minValue: number;\n maxValue: number;\n step: number;\n}\n\n/**\n * Round to `places` decimal places.\n *\n * The rounding rule the whole file depends on, and the reason it is a named\n * function rather than an inline `Math.round(x * 100) / 100`: every converted\n * channel goes through it, and a single place that forgot would be a hue that\n * reads `221.2121212121212` in one library and `221.21` in three.\n */\nexport const roundTo = (value: number, places = 0): number => {\n const factor = 10 ** places;\n return Math.round(value * factor) / factor;\n};\n\nconst clamp = (value: number, low: number, high: number) =>\n Math.min(Math.max(Number.isNaN(value) ? 0 : value, low), high);\n\n/** Positive modulo, so a hue of -10° comes back as 350° rather than -10°. */\nconst mod = (value: number, m: number) => ((value % m) + m) % m;\n\nconst HEX_COLOR = /^#[\\da-f]+$/i;\nconst RGB_COLOR = /^rgba?\\((.*)\\)$/;\nconst HSL_COLOR =\n /hsl\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%)\\)|hsla\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d(.\\d+)?)\\)/;\nconst HSB_COLOR =\n /hsb\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%)\\)|hsba\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d(.\\d+)?)\\)/;\n\n/**\n * CSS Color Module Level 4 §6.1, \"Named Colors\", as `name:rrggbb` pairs.\n *\n * A table rather than a lookup through the browser, so that a color parses the\n * same way in a unit test, in a server render and on a page — and so that the\n * answer cannot depend on which engine is asked.\n */\nconst NAMED_COLORS =\n \"aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,\" +\n \"beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,\" +\n \"blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,\" +\n \"chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,\" +\n \"cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,\" +\n \"darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,\" +\n \"darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,\" +\n \"darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,\" +\n \"darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,\" +\n \"firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,\" +\n \"gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,\" +\n \"green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,\" +\n \"indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,\" +\n \"lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,\" +\n \"lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,\" +\n \"lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,\" +\n \"lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,\" +\n \"limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,\" +\n \"mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,\" +\n \"mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,\" +\n \"mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,\" +\n \"moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,\" +\n \"olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,\" +\n \"palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,\" +\n \"peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,\" +\n \"rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,\" +\n \"salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,\" +\n \"silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,\" +\n \"springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,\" +\n \"tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,\" +\n \"whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32\";\n\nconst NAMED_COLOR_MAP = new Map(\n NAMED_COLORS.split(\",\").map((pair) => {\n const [name, hex] = pair.split(\":\");\n return [name!, `#${hex!}`] as const;\n }),\n);\n\n/**\n * Parse any CSS color this component accepts.\n *\n * Throws rather than returning a fallback, which is deliberate and is what the\n * other three libraries do: a picker silently showing black because someone\n * typed `#gg0000` is worse than one that says so.\n */\nexport function parseColor(value: string): ColorValue {\n const named = NAMED_COLOR_MAP.get(value);\n if (named) return parseColor(named);\n const parsed = parseRgb(value) ?? parseHsb(value) ?? parseHsl(value);\n if (!parsed) throw new Error(`Invalid color value: ${value}`);\n return parsed;\n}\n\nfunction parseRgb(value: string): RgbaColor | undefined {\n let channels: number[] | undefined;\n\n // 4, 5, 7 and 9 characters: #rgb, #rgba, #rrggbb, #rrggbbaa. Anything else of\n // the right shape is not a hex color, however hexadecimal it looks — and\n // splitting one into bytes anyway reads `#abcde` as two and a half channels.\n if (HEX_COLOR.test(value) && [4, 5, 7, 9].includes(value.length)) {\n // Each digit doubles in the short forms, so `#abc` is `#aabbcc`.\n const digits = (value.length < 6 ? value.replace(/[^#]/gi, \"$&$&\") : value).slice(1).split(\"\");\n const bytes: number[] = [];\n while (digits.length > 0) {\n bytes.push(parseInt(digits.splice(0, 2).join(\"\"), 16));\n }\n // The fourth byte is alpha out of 255 rather than out of 1, which is why\n // `#2563eb80` has an alpha of 0.5019607843137255 and not 0.5.\n channels = bytes.length === 4 ? [...bytes.slice(0, 3), bytes[3]! / 255] : bytes;\n }\n\n const match = value.match(RGB_COLOR);\n if (match?.[1]) {\n channels = match[1]\n .split(\",\")\n .map((part) => Number(part.trim()))\n .map((num, index) => clamp(num, 0, index < 3 ? 255 : 1));\n }\n\n if (!channels || channels.length < 3) return undefined;\n return {\n format: \"rgba\",\n red: channels[0]!,\n green: channels[1]!,\n blue: channels[2]!,\n alpha: channels[3] ?? 1,\n };\n}\n\nfunction parseHsl(value: string): HslaColor | undefined {\n const match = value.match(HSL_COLOR);\n if (!match) return undefined;\n const [hue, saturation, lightness, alpha] = (match[1] ?? match[2])!\n .split(\",\")\n .map((part) => Number(part.trim().replace(\"%\", \"\")));\n return {\n format: \"hsla\",\n hue: mod(hue!, 360),\n saturation: clamp(saturation!, 0, 100),\n lightness: clamp(lightness!, 0, 100),\n alpha: clamp(alpha ?? 1, 0, 1),\n };\n}\n\nfunction parseHsb(value: string): HsbaColor | undefined {\n const match = value.match(HSB_COLOR);\n if (!match) return undefined;\n const [hue, saturation, brightness, alpha] = (match[1] ?? match[2])!\n .split(\",\")\n .map((part) => Number(part.trim().replace(\"%\", \"\")));\n return {\n format: \"hsba\",\n hue: mod(hue!, 360),\n saturation: clamp(saturation!, 0, 100),\n brightness: clamp(brightness!, 0, 100),\n alpha: clamp(alpha ?? 1, 0, 1),\n };\n}\n\n/**\n * sRGB to HSB (HSV).\n *\n * \"HSL and HSV\", §From RGB: the hue is the angle around the color hexagon,\n * found from whichever channel is largest; the saturation is how far the chroma\n * has travelled towards that maximum; the brightness *is* the maximum.\n */\nexport function rgbToHsb(color: RgbaColor): HsbaColor {\n const red = color.red / 255;\n const green = color.green / 255;\n const blue = color.blue / 255;\n const min = Math.min(red, green, blue);\n const brightness = Math.max(red, green, blue);\n const chroma = brightness - min;\n const saturation = brightness === 0 ? 0 : chroma / brightness;\n return {\n format: \"hsba\",\n hue: roundTo(hueOf(red, green, blue, brightness, chroma) * 360, 2),\n saturation: roundTo(saturation * 100, 2),\n brightness: roundTo(brightness * 100, 2),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/**\n * sRGB to HSL.\n *\n * Same hue, a different second and third axis: lightness is the midpoint of the\n * largest and smallest channels rather than the largest, and the saturation is\n * measured against how much room is left at that lightness — which is why the\n * denominator changes sign about `lightness = 0.5`.\n */\nexport function rgbToHsl(color: RgbaColor): HslaColor {\n const red = color.red / 255;\n const green = color.green / 255;\n const blue = color.blue / 255;\n const min = Math.min(red, green, blue);\n const max = Math.max(red, green, blue);\n const lightness = (max + min) / 2;\n const chroma = max - min;\n const saturation =\n chroma === 0 ? 0 : chroma / (lightness < 0.5 ? max + min : 2 - max - min);\n return {\n format: \"hsla\",\n hue: roundTo(hueOf(red, green, blue, max, chroma) * 360, 2),\n saturation: roundTo(saturation * 100, 2),\n lightness: roundTo(lightness * 100, 2),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/**\n * The hue, in turns, shared by both conversions above.\n *\n * The `+ 6` on the red branch is what keeps the result positive when green is\n * below blue — the sector below the red axis is the *last* sixth of the wheel,\n * not a negative first one.\n */\nfunction hueOf(\n red: number,\n green: number,\n blue: number,\n max: number,\n chroma: number,\n): number {\n if (chroma === 0) return 0;\n let hue: number;\n if (max === red) hue = (green - blue) / chroma + (green < blue ? 6 : 0);\n else if (max === green) hue = (blue - red) / chroma + 2;\n else hue = (red - green) / chroma + 4;\n return hue / 6;\n}\n\n/** HSB to HSL: the same color, re-expressed about its midpoint. */\nexport function hsbToHsl(color: HsbaColor): HslaColor {\n const saturation = color.saturation / 100;\n const brightness = color.brightness / 100;\n const lightness = brightness * (1 - saturation / 2);\n const hslSaturation =\n lightness === 0 || lightness === 1\n ? 0\n : (brightness - lightness) / Math.min(lightness, 1 - lightness);\n return {\n format: \"hsla\",\n hue: roundTo(color.hue, 2),\n saturation: roundTo(hslSaturation * 100, 2),\n lightness: roundTo(lightness * 100, 2),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/** HSL to HSB, the inverse of the above. */\nexport function hslToHsb(color: HslaColor): HsbaColor {\n const saturation = color.saturation / 100;\n const lightness = color.lightness / 100;\n const brightness = lightness + saturation * Math.min(lightness, 1 - lightness);\n const hsbSaturation = brightness === 0 ? 0 : 2 * (1 - lightness / brightness);\n return {\n format: \"hsba\",\n hue: roundTo(color.hue, 2),\n saturation: roundTo(hsbSaturation * 100, 2),\n brightness: roundTo(brightness * 100, 2),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/**\n * HSB to sRGB, by the alternative formulation.\n *\n * The three channels are the same function `f` sampled at n = 5, 3 and 1, which\n * is the piecewise sextant definition folded into one expression — and folding\n * it is not a tidying: the piecewise form branches on the hue sector and lands\n * on the other side of a rounding boundary at the sector edges.\n */\nexport function hsbToRgb(color: HsbaColor): RgbaColor {\n const saturation = color.saturation / 100;\n const brightness = color.brightness / 100;\n const f = (n: number): number => {\n const k = (n + color.hue / 60) % 6;\n return brightness - saturation * brightness * Math.max(Math.min(k, 4 - k, 1), 0);\n };\n return {\n format: \"rgba\",\n red: Math.round(f(5) * 255),\n green: Math.round(f(3) * 255),\n blue: Math.round(f(1) * 255),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/** HSL to sRGB, the same folded sampling at n = 0, 8 and 4. */\nexport function hslToRgb(color: HslaColor): RgbaColor {\n const saturation = color.saturation / 100;\n const lightness = color.lightness / 100;\n const a = saturation * Math.min(lightness, 1 - lightness);\n const f = (n: number): number => {\n const k = (n + color.hue / 30) % 12;\n return lightness - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n };\n return {\n format: \"rgba\",\n red: Math.round(f(0) * 255),\n green: Math.round(f(8) * 255),\n blue: Math.round(f(4) * 255),\n alpha: roundTo(color.alpha, 2),\n };\n}\n\n/** Re-express a color in another space, going through RGB where it must. */\nexport function toColorFormat(color: ColorValue, format: ColorFormat): ColorValue {\n if (color.format === format) return color;\n if (color.format === \"rgba\") return format === \"hsba\" ? rgbToHsb(color) : rgbToHsl(color);\n if (color.format === \"hsba\") return format === \"rgba\" ? hsbToRgb(color) : hsbToHsl(color);\n return format === \"rgba\" ? hslToRgb(color) : hslToHsb(color);\n}\n\nconst toRgb = (color: ColorValue): RgbaColor => toColorFormat(color, \"rgba\") as RgbaColor;\n\nconst hexByte = (value: number) => value.toString(16).padStart(2, \"0\");\n\n/**\n * Print a color.\n *\n * Note what is *not* symmetrical: hex comes out upper case (which is what\n * `data-value` carries), while `rgba()` and `hsla()` print their numbers as\n * JavaScript stringifies them — so an alpha of 1 is `1` and never `1.00`.\n */\nexport function colorToString(color: ColorValue, notation: ColorNotation = \"css\"): string {\n switch (notation) {\n case \"hex\": {\n const rgb = toRgb(color);\n return `#${(hexByte(rgb.red) + hexByte(rgb.green) + hexByte(rgb.blue)).toUpperCase()}`;\n }\n case \"hexa\": {\n const rgb = toRgb(color);\n return `#${(\n hexByte(rgb.red) +\n hexByte(rgb.green) +\n hexByte(rgb.blue) +\n hexByte(Math.round(rgb.alpha * 255))\n ).toUpperCase()}`;\n }\n case \"rgb\": {\n const rgb = toRgb(color);\n return `rgb(${rgb.red}, ${rgb.green}, ${rgb.blue})`;\n }\n case \"rgba\": {\n const rgb = toRgb(color);\n return `rgba(${rgb.red}, ${rgb.green}, ${rgb.blue}, ${rgb.alpha})`;\n }\n case \"hsl\":\n case \"hsla\": {\n const hsl = toColorFormat(color, \"hsla\") as HslaColor;\n const body = `${hsl.hue}, ${roundTo(hsl.saturation, 2)}%, ${roundTo(hsl.lightness, 2)}%`;\n return notation === \"hsl\" ? `hsl(${body})` : `hsla(${body}, ${hsl.alpha})`;\n }\n case \"hsb\":\n case \"hsba\": {\n const hsb = toColorFormat(color, \"hsba\") as HsbaColor;\n const body = `${hsb.hue}, ${roundTo(hsb.saturation, 2)}%, ${roundTo(hsb.brightness, 2)}%`;\n return notation === \"hsb\" ? `hsb(${body})` : `hsba(${body}, ${hsb.alpha})`;\n }\n default:\n /**\n * `css` is each space's *own* default notation, with one exception that\n * is not a slip: HSB has no CSS syntax at all, so an HSB color prints as\n * `hsla()`. That is what the machine does, and it is why the root's\n * `--value` is never `hsba(…)`.\n */\n if (color.format === \"rgba\") return colorToString(color, \"rgba\");\n return colorToString(color, \"hsla\");\n }\n}\n\n/** The channels each space exposes, in the order the area and sliders read them. */\nexport function colorChannels(format: ColorFormat): string[] {\n if (format === \"rgba\") return [\"red\", \"green\", \"blue\"];\n if (format === \"hsla\") return [\"hue\", \"saturation\", \"lightness\"];\n return [\"hue\", \"saturation\", \"brightness\"];\n}\n\nexport function channelValue(color: ColorValue, channel: string): number {\n const value = (color as unknown as Record<string, number>)[channel];\n if (typeof value !== \"number\") {\n throw new Error(`Unsupported color channel: ${channel}`);\n }\n return value;\n}\n\n/** A channel's slider range, which reaches the DOM as aria-valuemin/max. */\nexport function channelRange(channel: string): ChannelRange {\n switch (channel) {\n case \"red\":\n case \"green\":\n case \"blue\":\n return { minValue: 0, maxValue: 255, step: 1 };\n case \"hue\":\n return { minValue: 0, maxValue: 360, step: 1 };\n case \"saturation\":\n case \"lightness\":\n case \"brightness\":\n return { minValue: 0, maxValue: 100, step: 1 };\n case \"alpha\":\n return { minValue: 0, maxValue: 1, step: 0.01 };\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n}\n\n/** Where a channel sits in its range, 0–1 — the thumb's position on its track. */\nexport function channelPercent(color: ColorValue, channel: string): number {\n const { minValue, maxValue } = channelRange(channel);\n return (channelValue(color, channel) - minValue) / (maxValue - minValue);\n}\n\n/** Replace one channel, clamped into its own range. */\nexport function withChannelValue(\n color: ColorValue,\n channel: string,\n value: number,\n): ColorValue {\n const { minValue, maxValue } = channelRange(channel);\n channelValue(color, channel);\n return { ...color, [channel]: clamp(value, minValue, maxValue) } as ColorValue;\n}\n\n/**\n * Whether two colors are the same, in the sense the swatches use.\n *\n * Compared channel by channel in each color's *own* space rather than through a\n * common one, because a color converted into another space and back is not\n * always itself — `#2563EB` as hsla is `hsla(221.21, 83.19%, 53.33%, 1)`, which\n * converts back to `rgb(37, 99, 235)` but through numbers that have already been\n * rounded twice. Comparing after a round trip makes a swatch fail to recognise\n * the value it is showing, which is exactly the bug the parity gate has an\n * allowance for on the React and Svelte side.\n */\nexport function isSameColor(a: ColorValue, b: ColorValue): boolean {\n if (a.format !== b.format) return false;\n const channels = [...colorChannels(a.format), \"alpha\"];\n return channels.every((channel) => channelValue(a, channel) === channelValue(b, channel));\n}\n","/**\n * Reading and writing one field of the notation row.\n *\n * The half of a field that `COLOR_NOTATION_FIELDS` in `@ui-organized/core`\n * cannot describe, because it needs a color and the four libraries do not\n * share one — the three Ark packages pass around `@zag-js/color-utils` `Color`s\n * and this one computes `ColorValue`s in `color.ts`. Core names the channel,\n * its space and its range; these two functions fetch and set it.\n *\n * The conversion on every read and write is the point, not an inefficiency: a\n * field must work from whatever space the picker is holding the color in, so\n * an HSL field can be typed into while the machine is in rgba. Flipping the\n * notation select is a way of *reading* the color, and moving the picker's own\n * format would move the value string, the form value and which pair of channels\n * the area is — see the note on `format` in `color-picker.ts`.\n */\nimport {\n formatChannel,\n formatOklchComponents,\n normalizeHex,\n parseOklch,\n readChannelInput,\n type ColorChannelField,\n type ColorField,\n type Rgba,\n} from \"@ui-organized/core\";\nimport {\n colorToString,\n parseColor,\n roundTo,\n toColorFormat,\n withChannelValue,\n channelValue,\n type ColorValue,\n} from \"./color.js\";\n\n/** The color as 8-bit sRGB, which is the form the OKLCH maths works in. */\nexport function toRgba(color: ColorValue): Rgba {\n const rgb = toColorFormat(color, \"rgba\");\n return {\n r: roundTo(channelValue(rgb, \"red\")),\n g: roundTo(channelValue(rgb, \"green\")),\n b: roundTo(channelValue(rgb, \"blue\")),\n a: channelValue(rgb, \"alpha\"),\n };\n}\n\n/** `space: null` is alpha — the one channel that survives a conversion. */\nconst inSpace = (color: ColorValue, field: ColorChannelField) =>\n field.space ? toColorFormat(color, field.space) : color;\n\nexport function readField(field: ColorField, color: ColorValue): string {\n if (field.kind === \"channel\") {\n return formatChannel(channelValue(inSpace(color, field), field.channel), field);\n }\n return field.key === \"hex\" ? colorToString(color, \"hex\") : formatOklchComponents(toRgba(color));\n}\n\n/**\n * `null` rejects the edit, and the field falls back to the color it was\n * showing rather than guessing at what was meant.\n */\nexport function writeField(\n field: ColorField,\n text: string,\n color: ColorValue,\n): ColorValue | null {\n if (field.kind === \"channel\") {\n const value = readChannelInput(text, field);\n if (value === null) return null;\n return withChannelValue(inSpace(color, field), field.channel, value);\n }\n\n if (field.key === \"hex\") {\n const hex = normalizeHex(text);\n if (!hex) return null;\n /* Alpha deliberately survives a hex edit rather than being reset to opaque\n by a six-digit string. The field beside this one owns alpha; typing a\n color is not a statement about transparency. */\n return withChannelValue(parseColor(hex), \"alpha\", channelValue(color, \"alpha\"));\n }\n\n const parsed = parseOklch(text);\n if (!parsed) return null;\n return parseColor(`rgba(${parsed.r}, ${parsed.g}, ${parsed.b}, ${parsed.a})`);\n}\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n ApplicationRef,\n Component,\n DOCUMENT,\n ElementRef,\n EmbeddedViewRef,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild,\n ViewContainerRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from \"@angular/core\";\nimport {\n COLOR_NOTATIONS,\n COLOR_NOTATION_FIELDS,\n CONTROL_ICON_SIZE,\n CONTROL_TEXT_CLASS,\n colorPickerStyles,\n type ColorField,\n type ColorNotation,\n type ColorPickerVariants,\n type ControlSize,\n} from \"@ui-organized/core\";\nimport { UioPart, stateFlag } from \"../part.js\";\nimport { UioFieldError } from \"../field-error/field-error.js\";\nimport { UioIcon } from \"../icons/icon.js\";\nimport { UioInput } from \"../input/input.js\";\nimport { UioSelect } from \"../select/select.js\";\nimport { nextMachineId, VISUALLY_HIDDEN_INPUT } from \"../part-ids.js\";\nimport { AnchoredSurface } from \"../overlay/anchored.js\";\nimport { anchoredPositions } from \"../overlay/anchor.js\";\nimport { pushLayer, removeLayer, type DismissibleLayer } from \"../overlay/dismiss.js\";\nimport { flushNow } from \"../overlay/flush.js\";\nimport { focusInside, restoreFocus } from \"../overlay/focus.js\";\nimport { applySurfaceStacking, raiseSurface, setSurfaceInteractive } from \"../overlay/surface.js\";\nimport { readField, writeField } from \"./channel-fields.js\";\nimport {\n channelPercent,\n channelRange,\n channelValue,\n colorChannels,\n colorToString,\n isSameColor,\n parseColor,\n roundTo,\n toColorFormat,\n withChannelValue,\n type ColorFormat,\n type ColorValue,\n} from \"./color.js\";\nimport { glyph } from \"../icons/glyph.js\";\n\nexport type ColorPickerSize = ControlSize;\nexport type ColorPickerVariant = NonNullable<ColorPickerVariants[\"variant\"]>;\n\nconst DEFAULT_COLOR = \"#000000\";\n\n/**\n * Checkerboard cell size for the alpha grid. A perceptual constant for reading\n * transparency rather than a brand value, so it does not move with the spacing\n * scale — the same reasoning the React component gives for passing it.\n */\nconst TRANSPARENCY_CELL = \"12px\";\n\nconst GRID_STYLE =\n `--size: ${TRANSPARENCY_CELL}; width: 100%; height: 100%; position: absolute; ` +\n \"background-color: #fff; \" +\n \"background-image: conic-gradient(#eeeeee 0 25%, transparent 0 50%, #eeeeee 0 75%, transparent 0); \" +\n \"background-size: var(--size) var(--size); inset: 0px; z-index: auto; pointer-events: none;\";\n\n/** zag's hue rail, which is the same six stops whatever color is selected. */\nconst HUE_TRACK =\n \"linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, \" +\n \"rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)\";\n\n/**\n * A color swatch that opens a picker.\n *\n * ```html\n * <div uioColorPicker label=\"Brand\" [(value)]=\"brand\" [swatches]=\"palette\"></div>\n * ```\n *\n * ── The color maths is this package's own ──────────────────────────────────\n *\n * The other three libraries convert, parse and print colors with\n * `@zag-js/color-utils`. This package takes no dependency beyond the CDK, so\n * that arithmetic is written out in `color.ts` — and it is not cosmetic: the\n * machine puts the color into the accessibility tree in three spaces at once,\n * so `aria-label`, `aria-valuenow` and `aria-valuetext` are all conversions\n * being compared to the hundredth. See the note there, and the reference values\n * captured from a running React picker in `color.spec.ts`.\n *\n * ── Two colors, not one ────────────────────────────────────────────────────\n *\n * The value is held in whatever space it was *written in* — `#2563eb` is an RGB\n * color, `hsl(221, 83%, 53%)` an HSL one — while the area and the sliders read\n * an `areaValue` converted into HSB (or HSL, when the format is `hsla`). That is\n * why the hue thumb can read `221.21` while the trigger says `rgba(37, 99, 235,\n * 1)`: they are the same color in two spaces, and the rounding happens on the\n * way between them.\n *\n * It is also why alpha is read off the *converted* color: `#2563eb80` has an\n * alpha of `0.5019607843137255`, which the trigger prints in full and the alpha\n * slider reports as `0.5`, because the conversion rounds every channel to two\n * places. Reading alpha off the raw value instead is a one-character change that\n * puts Angular a thousandth away from the other three.\n */\n@Component({\n selector: \"div[uioColorPicker]\",\n standalone: true,\n exportAs: \"uioColorPicker\",\n imports: [UioFieldError, UioIcon, UioInput, UioSelect],\n template: `\n @if (label(); as text) {\n <label\n class=\"field__label\"\n data-scope=\"color-picker\"\n data-part=\"label\"\n [id]=\"partId('label')\"\n [attr.for]=\"partId('hidden-input')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-required]=\"flag(required())\"\n [attr.data-focus]=\"flag(focused())\"\n (click)=\"onLabelClick($event)\"\n >{{ text }}\n @if (required()) {\n <span class=\"field__required\" aria-hidden=\"true\"></span>\n }\n </label>\n }\n\n <div\n class=\"color-picker__control\"\n data-scope=\"color-picker\"\n data-part=\"control\"\n [id]=\"partId('control')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-state]=\"openState()\"\n [attr.data-focus]=\"flag(focused())\"\n >\n <button\n #trigger\n [class]=\"triggerClass()\"\n data-scope=\"color-picker\"\n data-part=\"trigger\"\n type=\"button\"\n aria-haspopup=\"dialog\"\n [id]=\"partId('trigger')\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-controls]=\"partId('content')\"\n [attr.aria-labelledby]=\"partId('label')\"\n [attr.aria-expanded]=\"open()\"\n [attr.data-state]=\"openState()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n [attr.data-focus]=\"flag(focused())\"\n [attr.style]=\"triggerStyle\"\n (click)=\"toggle()\"\n (focus)=\"triggerFocused.set(true)\"\n (blur)=\"triggerFocused.set(false)\"\n >\n <span class=\"color-picker__swatch-well\">\n <div\n class=\"color-picker__grid\"\n data-scope=\"color-picker\"\n data-part=\"transparency-grid\"\n [attr.style]=\"GRID_STYLE\"\n ></div>\n <div\n class=\"color-picker__value-swatch\"\n data-scope=\"color-picker\"\n data-part=\"swatch\"\n [attr.data-state]=\"valueSwatchState()\"\n [attr.data-value]=\"valueAsHex()\"\n [attr.style]=\"swatchStyle(color())\"\n ></div>\n </span>\n @if (variant() !== \"swatch-only\") {\n <span\n class=\"color-picker__value-text\"\n data-scope=\"color-picker\"\n data-part=\"value-text\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-focus]=\"flag(focused())\"\n >{{ valueAsString() }}</span\n >\n }\n </button>\n </div>\n\n @if (helperVisible()) {\n <span class=\"field__description\">{{ helperText() }}</span>\n }\n <span uioFieldError [message]=\"errorMessage()\"></span>\n\n <!--\n Not a hidden input in the \"hidden\" sense: it is visually hidden and out of\n the tab order, so a form submits the color and a label points at it. Same\n element the other three render.\n -->\n <input\n type=\"text\"\n tabindex=\"-1\"\n [id]=\"partId('hidden-input')\"\n [attr.aria-label]=\"label() ?? 'Color'\"\n [attr.name]=\"name()\"\n [attr.disabled]=\"disabled() ? '' : null\"\n [attr.readonly]=\"readOnly() ? '' : null\"\n [attr.required]=\"required() ? '' : null\"\n [value]=\"valueAsString()\"\n [attr.style]=\"VISUALLY_HIDDEN_INPUT\"\n />\n\n <ng-container #anchor />\n <ng-template #surface>\n <div\n class=\"color-picker__positioner\"\n data-scope=\"color-picker\"\n data-part=\"positioner\"\n [id]=\"partId('positioner')\"\n >\n <div\n class=\"color-picker__popup\"\n data-scope=\"color-picker\"\n data-part=\"content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [id]=\"partId('content')\"\n [attr.aria-label]=\"contentLabel()\"\n [attr.data-state]=\"openState()\"\n [attr.hidden]=\"open() ? null : ''\"\n [attr.data-placement]=\"anchored.placement()\"\n [attr.data-side]=\"anchored.side()\"\n (keydown)=\"onContentKeydown($event)\"\n >\n <div\n class=\"color-picker__area\"\n data-scope=\"color-picker\"\n data-part=\"area\"\n role=\"group\"\n [id]=\"partId('area')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.style]=\"areaStyle\"\n (pointerdown)=\"onAreaPointerDown($event)\"\n >\n <div\n class=\"color-picker__area-bg\"\n data-scope=\"color-picker\"\n data-part=\"area-background\"\n [id]=\"partId('area-gradient')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.style]=\"areaBackgroundStyle()\"\n ></div>\n <div\n class=\"color-picker__thumb\"\n data-scope=\"color-picker\"\n data-part=\"area-thumb\"\n role=\"slider\"\n aria-roledescription=\"2d slider\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [id]=\"partId('area-thumb')\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-label]=\"areaLabel()\"\n [attr.aria-valuenow]=\"channel(areaChannels()[0])\"\n [attr.aria-valuetext]=\"areaValueText()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n [attr.style]=\"areaThumbStyle()\"\n (keydown)=\"onAreaKeydown($event)\"\n ></div>\n </div>\n\n <div class=\"color-picker__sliders\">\n <div class=\"color-picker__slider-row\">\n <div\n class=\"color-picker__channel-slider\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider\"\n data-channel=\"hue\"\n data-orientation=\"horizontal\"\n role=\"presentation\"\n [attr.style]=\"sliderStyle\"\n (pointerdown)=\"onSliderPointerDown($event, 'hue')\"\n >\n <div\n class=\"color-picker__channel-track\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider-track\"\n role=\"group\"\n data-channel=\"hue\"\n data-orientation=\"horizontal\"\n [id]=\"partId('slider-track:hue')\"\n [attr.style]=\"trackStyle('hue')\"\n ></div>\n <div\n class=\"color-picker__thumb\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider-thumb\"\n role=\"slider\"\n aria-label=\"hue\"\n data-channel=\"hue\"\n data-orientation=\"horizontal\"\n aria-orientation=\"horizontal\"\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n [id]=\"partId('slider-thumb:hue')\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-disabled]=\"flag(disabled())\"\n [attr.aria-valuenow]=\"channel('hue')\"\n [attr.aria-valuetext]=\"'hue ' + channel('hue')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.style]=\"sliderThumbStyle('hue')\"\n (keydown)=\"onSliderKeydown($event, 'hue')\"\n ></div>\n </div>\n @if (showEyeDropper()) {\n <button\n class=\"color-picker__eyedropper\"\n data-scope=\"color-picker\"\n data-part=\"eye-dropper-trigger\"\n type=\"button\"\n aria-label=\"Pick a color from the screen\"\n [disabled]=\"disabled()\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.data-readonly]=\"flag(readOnly())\"\n [attr.data-invalid]=\"flag(invalid())\"\n (click)=\"pickFromScreen()\"\n >\n <span uioIcon [name]=\"glyph('pipette')\" [size]=\"iconSize()\"></span>\n </button>\n }\n </div>\n\n <div\n class=\"color-picker__channel-slider\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider\"\n data-channel=\"alpha\"\n data-orientation=\"horizontal\"\n role=\"presentation\"\n [attr.style]=\"sliderStyle\"\n (pointerdown)=\"onSliderPointerDown($event, 'alpha')\"\n >\n <div\n class=\"color-picker__grid\"\n data-scope=\"color-picker\"\n data-part=\"transparency-grid\"\n [attr.style]=\"GRID_STYLE\"\n ></div>\n <div\n class=\"color-picker__channel-track\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider-track\"\n role=\"group\"\n data-channel=\"alpha\"\n data-orientation=\"horizontal\"\n [id]=\"partId('slider-track:alpha')\"\n [attr.style]=\"trackStyle('alpha')\"\n ></div>\n <div\n class=\"color-picker__thumb\"\n data-scope=\"color-picker\"\n data-part=\"channel-slider-thumb\"\n role=\"slider\"\n aria-label=\"alpha\"\n data-channel=\"alpha\"\n data-orientation=\"horizontal\"\n aria-orientation=\"horizontal\"\n aria-valuemin=\"0\"\n aria-valuemax=\"1\"\n [id]=\"partId('slider-thumb:alpha')\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-disabled]=\"flag(disabled())\"\n [attr.aria-valuenow]=\"channel('alpha')\"\n [attr.aria-valuetext]=\"'alpha ' + channel('alpha')\"\n [attr.data-disabled]=\"flag(disabled())\"\n [attr.style]=\"sliderThumbStyle('alpha')\"\n (keydown)=\"onSliderKeydown($event, 'alpha')\"\n ></div>\n </div>\n </div>\n\n @if (showFormatInputs()) {\n <div class=\"color-picker__notation\">\n <!--\n The label is rendered and hidden in CSS rather than left off:\n the trigger, the listbox and the hidden control are all named\n after it, so an absent label leaves dangling references behind.\n -->\n <div\n uioSelect\n class=\"color-picker__format\"\n size=\"sm\"\n label=\"Color notation\"\n [options]=\"notations\"\n [value]=\"inputFormat()\"\n [disabled]=\"disabled()\"\n (valueChange)=\"onFormatChange($event)\"\n ></div>\n\n <div class=\"color-picker__inputs\" [attr.data-format]=\"inputFormat()\">\n @for (field of notationFields(); track field.key) {\n <div class=\"color-picker__field\">\n <!--\n focusin / focusout rather than focus / blur: UioInput\n renders the control, so what this element can hear is what\n bubbles up to it, and the plain two do not bubble.\n -->\n <div\n uioInput\n size=\"sm\"\n [type]=\"field.kind === 'channel' ? 'number' : 'text'\"\n [inputMode]=\"field.kind === 'channel' ? 'decimal' : 'text'\"\n [aria-label]=\"field.label\"\n [spellcheck]=\"false\"\n autocomplete=\"off\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [min]=\"field.kind === 'channel' ? field.min : undefined\"\n [max]=\"field.kind === 'channel' ? field.max : undefined\"\n [step]=\"field.kind === 'channel' ? field.step : undefined\"\n [value]=\"shownField(field)\"\n (valueChange)=\"onFieldInput(field, $event)\"\n (focusin)=\"onFieldFocus($event)\"\n (focusout)=\"commitField(field)\"\n (keydown)=\"onFieldKeydown($event, field)\"\n ></div>\n <!--\n Only the numeric channels are abbreviated. A HEX caption\n under a hex field would only repeat the select above it —\n but the line stays reserved in CSS, so switching notation\n cannot resize the popup out from under the pointer.\n -->\n @if (field.kind === \"channel\") {\n <span class=\"color-picker__field-label\" aria-hidden=\"true\">{{\n field.label\n }}</span>\n }\n </div>\n }\n </div>\n </div>\n }\n\n @if (swatches().length) {\n <div\n class=\"color-picker__swatches\"\n data-scope=\"color-picker\"\n data-part=\"swatch-group\"\n role=\"group\"\n >\n @for (swatch of swatches(); track swatch) {\n <button\n class=\"color-picker__swatch-trigger\"\n data-scope=\"color-picker\"\n data-part=\"swatch-trigger\"\n type=\"button\"\n [disabled]=\"!interactive()\"\n [attr.aria-label]=\"'select ' + swatchHex(swatch) + ' as the color'\"\n [attr.data-state]=\"swatchState(swatch)\"\n [attr.data-value]=\"swatchHex(swatch)\"\n [attr.data-disabled]=\"flag(!interactive())\"\n [attr.style]=\"swatchTriggerStyle(swatch)\"\n (click)=\"choose(swatch)\"\n >\n <div\n class=\"color-picker__swatch\"\n data-scope=\"color-picker\"\n data-part=\"swatch\"\n [attr.data-state]=\"swatchState(swatch)\"\n [attr.data-value]=\"swatchHex(swatch)\"\n [attr.style]=\"swatchStyle(parsed(swatch))\"\n ></div>\n </button>\n }\n </div>\n }\n </div>\n </div>\n </ng-template>\n `,\n host: {\n \"[class]\": \"hostClass()\",\n \"[id]\": \"rootId\",\n \"[attr.data-disabled]\": \"flag(disabled())\",\n \"[attr.data-readonly]\": \"flag(readOnly())\",\n \"[attr.data-invalid]\": \"flag(invalid())\",\n \"[attr.style]\": \"rootStyle()\",\n },\n})\nexport class UioColorPicker extends UioPart implements OnInit, OnDestroy {\n protected readonly glyph = glyph;\n readonly scope = \"color-picker\";\n readonly part = \"root\";\n\n readonly label = input<string | undefined>(undefined);\n readonly helperText = input<string | undefined>(undefined);\n /** A string shows a message; `true` marks the field invalid without one. */\n readonly error = input<string | boolean | undefined>(undefined);\n /** A CSS color string. Uncontrolled until something binds it. */\n readonly value = model<string>(DEFAULT_COLOR);\n readonly valueChange = output<string>();\n /** Fired once the interaction ends. */\n readonly valueChangeEnd = output<string>();\n /** Which notation the value is printed in. Defaults to the value's own. */\n /**\n * Defaulted, as the other three libraries default it. Left undefined the\n * picker falls back to the value's own space (zag's `defaultFormat`), so a\n * picker handed `hsl(...)` announced and submitted in a notation the caller\n * never asked for.\n */\n readonly format = input<ColorFormat, ColorFormat | undefined>(\"rgba\", {\n // A transform, not just a default: Angular applies an `input()` default only\n // when the input is *unbound*, so `[format]=\"undefined\"` would otherwise set\n // undefined where the other three libraries' `format = \"rgba\"` parameter\n // default applies. This makes an explicit undefined mean the same thing.\n transform: (value) => value ?? \"rgba\",\n });\n readonly swatches = input<string[]>([]);\n readonly showEyeDropper = input(true, { transform: booleanAttribute });\n /**\n * Shows the notation select and its channel fields — HEX, RGB, HSL, OKLCH —\n * under the sliders. Defaults to true. Turn it off for a picker meant to be\n * driven by eye rather than by number.\n */\n readonly showFormatInputs = input(true, { transform: booleanAttribute });\n readonly open = model(false);\n readonly openChange = output<boolean>();\n readonly size = input<ColorPickerSize>(\"md\");\n readonly variant = input<ColorPickerVariant>(\"default\");\n readonly required = input(false, { transform: booleanAttribute });\n override readonly disabled = input(false, { transform: booleanAttribute });\n override readonly readOnly = input(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n\n protected readonly flag = stateFlag;\n protected readonly GRID_STYLE = GRID_STYLE;\n protected readonly VISUALLY_HIDDEN_INPUT = VISUALLY_HIDDEN_INPUT;\n protected readonly triggerStyle = \"position: relative;\";\n protected readonly areaStyle =\n \"position: relative; touch-action: none; forced-color-adjust: none;\";\n protected readonly sliderStyle = \"position: relative; touch-action: none;\";\n\n private readonly machine = nextMachineId();\n protected readonly rootId = `color-picker:${this.machine}`;\n protected partId(part: string): string {\n return `${this.rootId}:${part}`;\n }\n\n /**\n * The trigger carries the control's type scale, as every other library's does\n * — it is a button with a swatch and a value in it, and without the class its\n * text is a size adrift from the Input beside it.\n */\n protected readonly triggerClass = computed(\n () => `${CONTROL_TEXT_CLASS[this.size()]} color-picker__trigger`,\n );\n\n override readonly invalid = computed(() => !!this.error());\n protected readonly errorMessage = computed(() =>\n typeof this.error() === \"string\" ? (this.error() as string) : undefined,\n );\n protected readonly helperVisible = computed(() => !!this.helperText() && !this.invalid());\n protected readonly interactive = computed(() => !this.disabled() && !this.readOnly());\n /**\n * The open state, which the control, the trigger and the popup carry — and\n * the **root** does not.\n *\n * Deliberately not an override of `UioPart.state`: the machine's\n * `getRootProps` emits no `data-state` at all, so binding it on the host would\n * give Angular an attribute the other three libraries do not render. The root\n * reports `data-disabled`, `data-readonly` and `data-invalid` and nothing else.\n */\n protected readonly openState = computed(() => (this.open() ? \"open\" : \"closed\"));\n\n /**\n * Whether the trigger holds focus, and the picker is not open.\n *\n * The machine reaches `data-focus` through a whole *state* rather than a flag —\n * `focused` is tagged `[\"closed\", \"focused\"]`, so a picker that is open is\n * never focused however the browser feels about it. That is not a detail worth\n * smoothing over: the attribute comes back the moment Escape closes the popup\n * and returns focus to the trigger, which is the one place the gate catches a\n * port that treated it as \"the trigger has focus\" and nothing more.\n *\n * `focus` and `blur` rather than `focusin`/`focusout`, because the trigger is\n * the only element in question and neither event needs to bubble to reach it.\n */\n protected readonly triggerFocused = signal(false);\n protected readonly focused = computed(() => this.triggerFocused() && !this.open());\n\n protected readonly hostClass = computed(() =>\n colorPickerStyles({ size: this.size(), variant: this.variant() }),\n );\n protected readonly iconSize = computed(() => CONTROL_ICON_SIZE[this.size()]);\n\n /** The value, parsed. A bad string is the caller's, not something to hide. */\n /**\n * The value, in the format the *machine* runs on.\n *\n * The conversion is not cosmetic. zag holds its color in the machine's format\n * from the moment it parses one, so an `hsl(221, 83%, 53%)` handed to a picker\n * running on rgba is rounded to `rgb(36, 99, 235)` first and every derived\n * number — the area's saturation and brightness, the hue thumb's\n * `aria-valuenow` — is computed from *that*. Parsing into the value's own\n * space instead kept a precision the other three libraries never have, and the\n * parity gate reported the thumbs a hundredth apart.\n */\n protected readonly color = computed<ColorValue>(() =>\n toColorFormat(parseColor(this.value()), this.resolvedFormat()),\n );\n\n /* ─── The notation row ────────────────────────────────────────────────────\n Which notations exist and which fields each one shows come from\n `COLOR_NOTATIONS` / `COLOR_NOTATION_FIELDS` in `@ui-organized/core`, shared\n with the React, Svelte and Vue pickers so all four offer the same row. */\n\n protected readonly notations = COLOR_NOTATIONS;\n\n /**\n * Which notation the fields are showing.\n *\n * Local, and initialised from the *machine's* format once rather than derived\n * from it: it is a way of reading the color rather than a property of it, so\n * switching it must not move the value string, the form value or which pair\n * of channels the area is — and a later change to `format` must not yank the\n * row out from under a reader who has switched it.\n */\n protected readonly inputFormat = signal<ColorNotation>(\"rgb\");\n\n protected readonly notationFields = computed<ColorField[]>(\n () => COLOR_NOTATION_FIELDS[this.inputFormat()],\n );\n\n /**\n * The field being typed into, and what has been typed.\n *\n * `null` means every field shows the color. While a field is mid-edit the\n * color must not overwrite what is being typed — which it otherwise would on\n * every pointer move over the area behind the field.\n */\n private readonly draft = signal<{ key: string; text: string } | null>(null);\n\n protected shownField(field: ColorField): string {\n const draft = this.draft();\n return draft?.key === field.key ? draft.text : readField(field, this.color());\n }\n\n protected onFormatChange(next: string): void {\n this.draft.set(null);\n this.inputFormat.set(next as ColorNotation);\n }\n\n protected onFieldInput(field: ColorField, text: string): void {\n this.draft.set({ key: field.key, text });\n }\n\n protected onFieldFocus(event: FocusEvent): void {\n (event.target as HTMLInputElement | null)?.select?.();\n }\n\n /**\n * Applies a typed edit, which is a finished interaction — so it reports an\n * end as well as a change, unlike a drag, which reports many changes and one\n * end when the pointer lifts. An unreadable edit is dropped and the field\n * falls back to the color it was showing.\n */\n protected commitField(field: ColorField): void {\n const draft = this.draft();\n if (draft?.key !== field.key) return;\n this.draft.set(null);\n const next = writeField(field, draft.text, this.color());\n if (next) this.commit(toColorFormat(next, this.resolvedFormat()), true);\n }\n\n protected onFieldKeydown(event: KeyboardEvent, field: ColorField): void {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this.commitField(field);\n } else if (event.key === \"Escape\") {\n // Abandon the edit without closing the picker under it.\n event.stopPropagation();\n this.draft.set(null);\n }\n }\n\n private readonly resolvedFormat = computed<ColorFormat>(() => this.format());\n\n protected readonly valueAsString = computed(() =>\n colorToString(this.color(), this.resolvedFormat()),\n );\n protected readonly valueAsHex = computed(() => colorToString(this.color(), \"hex\"));\n protected readonly triggerLabel = computed(\n () => `select color. current color is ${this.valueAsString()}`,\n );\n\n /**\n * The popup is a `role=\"dialog\"` with no title to take a name from — the same\n * trap `UioPopoverTitle` exists to close. Without this it reaches a screen\n * reader as an unnamed dialog (axe `aria-dialog-name`).\n */\n protected readonly contentLabel = computed(() => {\n const text = this.label();\n return text ? `${text} color picker` : \"Color picker\";\n });\n\n /**\n * The color the area and the sliders work in.\n *\n * HSB unless the format is HSL, which is zag's rule and the reason the area's\n * second axis is labelled \"brightness\" for an RGB color and \"lightness\" for\n * an HSL one.\n */\n protected readonly areaValue = computed(() =>\n toColorFormat(this.color(), this.resolvedFormat() === \"hsla\" ? \"hsla\" : \"hsba\"),\n );\n\n protected readonly areaChannels = computed(() => {\n const channels = colorChannels(this.areaValue().format);\n return [channels[1]!, channels[2]!];\n });\n protected readonly areaLabel = computed(\n () => `${this.areaChannels()[0]} and ${this.areaChannels()[1]}`,\n );\n protected readonly areaValueText = computed(() => {\n const [x, y] = this.areaChannels();\n return `${x} ${this.channel(x!)}, ${y} ${this.channel(y!)}`;\n });\n\n /** Every channel the DOM reports comes from the converted color. */\n protected channel(name: string): number {\n return channelValue(this.areaValue(), name);\n }\n\n protected readonly rootStyle = computed(() => `--value: ${colorToString(this.color(), \"css\")};`);\n\n protected readonly areaBackgroundStyle = computed(() => {\n const hue = this.channel(\"hue\");\n const layers =\n this.areaValue().format === \"hsla\"\n ? [\n \"linear-gradient(to top, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, \" +\n \"hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)\",\n \"linear-gradient(to right,hsl(0,0%,50%),hsla(0,0%,50%,0))\",\n `hsl(${hue}, 100%, 50%)`,\n ]\n : [\n \"linear-gradient(to top,hsl(0,0%,0%),hsla(0,0%,0%,0))\",\n \"linear-gradient(to right,hsl(0,0%,100%),hsla(0,0%,100%,0))\",\n `hsl(${hue}, 100%, 50%)`,\n ];\n return `${this.areaStyle} background: ${layers.join(\",\")};`;\n });\n\n protected readonly areaThumbStyle = computed(() => {\n const [x, y] = this.areaChannels();\n const left = channelPercent(this.areaValue(), x!) * 100;\n const top = (1 - channelPercent(this.areaValue(), y!)) * 100;\n const opaque = colorToString(withChannelValue(this.areaValue(), \"alpha\", 1), \"css\");\n return (\n `position: absolute; left: ${left}%; top: ${top}%; transform: translate(-50%, -50%); ` +\n `touch-action: none; forced-color-adjust: none; --color: ${opaque}; ` +\n `background: ${colorToString(this.areaValue(), \"rgb\")};`\n );\n });\n\n protected trackStyle(channel: \"hue\" | \"alpha\"): string {\n const base = \"position: relative; forced-color-adjust: none; background-image: \";\n if (channel === \"hue\") return `${base}${HUE_TRACK};`;\n const clear = colorToString(withChannelValue(this.areaValue(), \"alpha\", 0), \"css\");\n const solid = colorToString(withChannelValue(this.areaValue(), \"alpha\", 1), \"css\");\n return `${base}linear-gradient(to right, ${clear}, ${solid});`;\n }\n\n protected sliderThumbStyle(channel: \"hue\" | \"alpha\"): string {\n const left = channelPercent(this.areaValue(), channel) * 100;\n return (\n \"forced-color-adjust: none; position: absolute; \" +\n `background: ${colorToString(this.areaValue(), \"rgb\")}; left: ${left}%; top: 50%;`\n );\n }\n\n protected swatchStyle(color: ColorValue): string {\n const css = colorToString(color, \"css\");\n return `--color: ${css}; position: relative; background: ${colorToString(color, \"rgb\")};`;\n }\n\n protected swatchTriggerStyle(swatch: string): string {\n return `--color: ${this.swatchHex(swatch)}; position: relative;`;\n }\n\n protected parsed(swatch: string): ColorValue {\n return parseColor(swatch);\n }\n\n /** A swatch names itself in hex, whatever notation the caller wrote it in. */\n protected swatchHex(swatch: string): string {\n return colorToString(parseColor(swatch), \"hex\");\n }\n\n protected swatchState(swatch: string): \"checked\" | \"unchecked\" {\n const swatchColor = toColorFormat(parseColor(swatch), this.resolvedFormat());\n return isSameColor(swatchColor, this.color()) ? \"checked\" : \"unchecked\";\n }\n\n /**\n * The value's own swatch, which is checked whenever the color survives a\n * round trip through its printed form.\n *\n * That is a strange thing for a swatch to be unsure about and it is the\n * machine's own arrangement: Ark hands `getSwatchProps` the value as a\n * *string*, zag parses it back, and a color whose printed form rounds — an\n * RGB value shown as `hsla(221.21, 83.19%, 53.33%, 1)` — no longer matches the\n * value it came from. The parity gate has an allowance for the resulting\n * disagreement between React, Svelte and Vue; this reproduces the mechanism\n * rather than short-circuiting it, so Angular lands on React's answer.\n */\n protected readonly valueSwatchState = computed<\"checked\" | \"unchecked\">(() => {\n const roundTripped = toColorFormat(parseColor(this.valueAsString()), this.resolvedFormat());\n return isSameColor(roundTripped, this.color()) ? \"checked\" : \"unchecked\";\n });\n\n readonly anchored = new AnchoredSurface(inject(Overlay));\n\n /** See `UioDialog` — decorator queries are the spelling both compilers register. */\n @ViewChild(\"surface\", { static: true }) private surface!: TemplateRef<unknown>;\n @ViewChild(\"anchor\", { read: ViewContainerRef, static: true }) private anchor!: ViewContainerRef;\n @ViewChild(\"trigger\", { static: true }) private trigger!: ElementRef<HTMLElement>;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly document = inject(DOCUMENT);\n private readonly appRef = inject(ApplicationRef);\n\n private surfaceView?: EmbeddedViewRef<unknown>;\n private applied = false;\n\n private readonly layer: DismissibleLayer = {\n surface: () => this.contentElement(),\n trigger: () => this.trigger?.nativeElement ?? null,\n dismiss: () => this.hide(),\n };\n\n constructor() {\n super();\n effect(() => {\n this.open();\n untracked(() => this.sync());\n });\n }\n\n /** `ngOnInit`, not `ngAfterViewInit` — see the note in `UioDialog`. */\n ngOnInit(): void {\n /* Seeded here rather than where it is declared: a field initialiser runs\n before Angular has set the inputs, so `format()` would still be undefined\n and every picker would open on RGB. Set once, not derived — see the note\n on `inputFormat`. */\n this.inputFormat.set(this.format() === \"hsla\" ? \"hsl\" : \"rgb\");\n const ref = this.anchored.create(\n this.trigger.nativeElement,\n // zag's positioning for this component: below the trigger, left edges\n // aligned, with a four-pixel gutter.\n anchoredPositions(\"bottom\", \"start\", 4, 0),\n );\n this.surfaceView = ref.attach(\n new TemplatePortal(this.surface, this.anchor),\n ) as EmbeddedViewRef<unknown>;\n applySurfaceStacking(ref);\n setSurfaceInteractive(ref, false);\n }\n\n ngOnDestroy(): void {\n removeLayer(this.layer);\n this.anchored.dispose();\n }\n\n show(): void {\n this.setOpen(true);\n }\n hide(): void {\n this.setOpen(false);\n }\n toggle(): void {\n if (!this.interactive()) return;\n this.setOpen(!this.open());\n }\n\n private setOpen(next: boolean): void {\n if (next === this.open()) return;\n this.open.set(next);\n this.openChange.emit(next);\n if (next) pushLayer(this.document, this.layer);\n else removeLayer(this.layer);\n flushNow(this.appRef);\n }\n\n private contentElement(): HTMLElement | null {\n return (\n this.anchored.overlayRef?.overlayElement.querySelector<HTMLElement>(\n '[data-part=\"content\"]',\n ) ?? null\n );\n }\n\n private sync(): void {\n const open = this.open();\n if (open === this.applied) return;\n this.applied = open;\n const ref = this.anchored.overlayRef;\n this.surfaceView?.detectChanges();\n if (!ref) return;\n setSurfaceInteractive(ref, open);\n if (open) {\n // Measured only now: while closed the popup is `hidden`, has no size, and\n // the CDK placed a zero-height box.\n this.anchored.reposition();\n raiseSurface(ref);\n const content = this.contentElement();\n if (content) focusInside(content);\n pushLayer(this.document, this.layer);\n return;\n }\n restoreFocus(this.trigger?.nativeElement ?? null);\n }\n\n protected onLabelClick(event: Event): void {\n event.preventDefault();\n if (!this.interactive()) return;\n this.trigger?.nativeElement.focus({ preventScroll: true });\n }\n\n protected onContentKeydown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n event.preventDefault();\n this.hide();\n }\n\n /** Set the color and report it, in the caller's own notation. */\n private commit(color: ColorValue, end = false): void {\n const next = colorToString(color, this.resolvedFormat());\n if (next !== this.value()) {\n this.value.set(next);\n this.valueChange.emit(next);\n }\n if (end) this.valueChangeEnd.emit(next);\n flushNow(this.appRef);\n }\n\n protected choose(swatch: string): void {\n if (!this.interactive()) return;\n this.commit(toColorFormat(parseColor(swatch), this.resolvedFormat()), true);\n }\n\n /**\n * The eyedropper, where the browser has one.\n *\n * Behind a feature test rather than a build-time flag: `EyeDropper` is\n * Chromium-only, and a picker that threw on Firefox would be worse than one\n * whose button does nothing there — which is also what the machine does.\n */\n protected pickFromScreen(): void {\n if (!this.interactive()) return;\n const view = this.document.defaultView as (Window & { EyeDropper?: new () => unknown }) | null;\n const Ctor = view?.EyeDropper;\n if (!Ctor) return;\n const dropper = new Ctor() as { open(): Promise<{ sRGBHex: string }> };\n void dropper.open().then(({ sRGBHex }) => {\n this.commit(toColorFormat(parseColor(sRGBHex), this.resolvedFormat()), true);\n });\n }\n\n private setChannel(channel: string, value: number, end = false): void {\n const next = withChannelValue(this.areaValue(), channel, value);\n this.commit(toColorFormat(next, this.resolvedFormat()), end);\n }\n\n protected onAreaPointerDown(event: PointerEvent): void {\n if (!this.interactive() || event.button !== 0) return;\n event.preventDefault();\n const area = event.currentTarget as HTMLElement;\n const apply = (moved: PointerEvent) => this.setFromArea(area, moved.clientX, moved.clientY);\n apply(event);\n this.track(apply, () => this.valueChangeEnd.emit(this.value()));\n }\n\n private setFromArea(area: HTMLElement, clientX: number, clientY: number): void {\n const box = area.getBoundingClientRect();\n if (!box.width || !box.height) return;\n const [x, y] = this.areaChannels();\n const xRange = channelRange(x!);\n const yRange = channelRange(y!);\n const xPercent = Math.min(Math.max((clientX - box.left) / box.width, 0), 1);\n // The vertical axis runs the other way: the top of the square is the\n // *largest* value, which is why the thumb's `top` is `1 - percent`.\n const yPercent = 1 - Math.min(Math.max((clientY - box.top) / box.height, 0), 1);\n let next = withChannelValue(\n this.areaValue(),\n x!,\n roundTo(xRange.minValue + xPercent * (xRange.maxValue - xRange.minValue), 2),\n );\n next = withChannelValue(\n next,\n y!,\n roundTo(yRange.minValue + yPercent * (yRange.maxValue - yRange.minValue), 2),\n );\n this.commit(toColorFormat(next, this.resolvedFormat()));\n }\n\n protected onSliderPointerDown(event: PointerEvent, channel: \"hue\" | \"alpha\"): void {\n if (!this.interactive() || event.button !== 0) return;\n event.preventDefault();\n const slider = event.currentTarget as HTMLElement;\n const apply = (moved: PointerEvent) => this.setFromSlider(slider, channel, moved.clientX);\n apply(event);\n this.track(apply, () => this.valueChangeEnd.emit(this.value()));\n }\n\n private setFromSlider(slider: HTMLElement, channel: \"hue\" | \"alpha\", clientX: number): void {\n const box = slider.getBoundingClientRect();\n if (!box.width) return;\n const { minValue, maxValue, step } = channelRange(channel);\n const percent = Math.min(Math.max((clientX - box.left) / box.width, 0), 1);\n const raw = minValue + percent * (maxValue - minValue);\n // Snapped to the channel's own step, so a hue lands on a whole degree and an\n // alpha on a hundredth rather than on whatever fraction of a pixel it was.\n this.setChannel(channel, roundTo(Math.round(raw / step) * step, 2));\n }\n\n protected onAreaKeydown(event: KeyboardEvent): void {\n if (!this.interactive()) return;\n const [x, y] = this.areaChannels();\n const step = event.shiftKey ? 10 : 1;\n const move: Record<string, [string, number]> = {\n ArrowLeft: [x!, -step],\n ArrowRight: [x!, step],\n ArrowUp: [y!, step],\n ArrowDown: [y!, -step],\n };\n const delta = move[event.key];\n if (!delta) return;\n event.preventDefault();\n const [channel, amount] = delta;\n this.setChannel(channel, roundTo(this.channel(channel) + amount, 2), true);\n }\n\n protected onSliderKeydown(event: KeyboardEvent, channel: \"hue\" | \"alpha\"): void {\n if (!this.interactive()) return;\n const { step } = channelRange(channel);\n const amount = (event.shiftKey ? 10 : 1) * step;\n const delta =\n event.key === \"ArrowLeft\" || event.key === \"ArrowDown\"\n ? -amount\n : event.key === \"ArrowRight\" || event.key === \"ArrowUp\"\n ? amount\n : null;\n if (delta === null) return;\n event.preventDefault();\n this.setChannel(channel, roundTo(this.channel(channel) + delta, 2), true);\n }\n\n /** Follow a pointer on the document until it is released. */\n private track(move: (event: PointerEvent) => void, end: () => void): void {\n const document = this.document;\n const onMove = (event: PointerEvent) => move(event);\n const stop = () => {\n document.removeEventListener(\"pointermove\", onMove);\n document.removeEventListener(\"pointerup\", stop);\n document.removeEventListener(\"pointercancel\", stop);\n end();\n flushNow(this.appRef);\n };\n document.addEventListener(\"pointermove\", onMove);\n document.addEventListener(\"pointerup\", stop);\n document.addEventListener(\"pointercancel\", stop);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.UioInteractionState","CHECK_ICON_SIZE","ICON_SIZE","ITEM_ICON_SIZE","clamp","DELETE_ICON_SIZE","HEADER_ICON_SIZE","PARKED","DEFAULT_SPACING","round"],"mappings":";;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AAEH;;;;;;;AAOG;AACG,SAAU,SAAS,CAAC,KAAiC,EAAA;IACzD,OAAO,KAAK,GAAG,EAAE,GAAG,IAAI;AAC1B;AAEA;;;;;;;AAOG;AACI,MAAM,mBAAmB,GAAG;IACjC,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,eAAe;IACf,cAAc;IACd,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,kBAAkB;;MAmBE,OAAO,CAAA;;AAOlB,IAAA,KAAK,GAA0B,MAAM,CAAC,IAAI,4EAAC;AAC3C,IAAA,QAAQ,GAAoB,MAAM,CAAC,KAAK,+EAAC;AACzC,IAAA,OAAO,GAAoB,MAAM,CAAC,KAAK,8EAAC;AACxC,IAAA,QAAQ,GAAoB,MAAM,CAAC,KAAK,+EAAC;AACzC,IAAA,KAAK,GAAoB,MAAM,CAAC,KAAK,4EAAC;AACtC,IAAA,YAAY,GAAoB,MAAM,CAAC,KAAK,mFAAC;AAC7C,IAAA,KAAK,GAAoB,MAAM,CAAC,KAAK,4EAAC;AACtC,IAAA,WAAW,GAAoB,MAAM,CAAC,KAAK,kFAAC;AAC5C,IAAA,QAAQ,GAAoB,MAAM,CAAC,KAAK,+EAAC;AACzC,IAAA,WAAW,GAA6C,MAAM,CAAC,IAAI,kFAAC;;IAG1D,IAAI,GAAG,SAAS;wGAnBf,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,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