@cdevhub/ngx-tw 0.6.1 → 0.7.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/fesm2022/cdevhub-ngx-tw-alert.mjs +8 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +18 -8
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +14 -8
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +7 -7
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +7 -7
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +8 -8
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +8 -8
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +8 -8
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +16 -16
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +7 -7
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +10 -4
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select.mjs +7 -7
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-separator.mjs +7 -7
- package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +21 -21
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +29 -9
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +8 -8
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +8 -8
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/index.json +1 -1
- package/package.json +1 -1
- package/types/cdevhub-ngx-tw-tabs.d.ts +23 -3
- package/types/cdevhub-ngx-tw-theme.d.ts +18 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdevhub-ngx-tw-popover.mjs","sources":["../../../projects/ngx-tw/popover/popover-tokens.ts","../../../projects/ngx-tw/popover/popover.ts","../../../projects/ngx-tw/popover/popover-close.ts","../../../projects/ngx-tw/popover/popover-title.ts","../../../projects/ngx-tw/popover/cdevhub-ngx-tw-popover.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Context object provided to popover template content. */\nexport interface PopoverTemplateContext<T = unknown> {\n /** The data passed via `twPopoverData` input. */\n $implicit: T;\n /** Closes the popover. */\n close: () => void;\n}\n\n/** Reference to control the popover from inside component content. */\nexport interface PopoverRef {\n /** Closes the popover. */\n close(): void;\n /** @internal — used by `PopoverTitleDirective` to register itself with `aria-labelledby`. */\n _addAriaLabelledBy?: (id: string) => void;\n /** @internal — used by `PopoverTitleDirective` to unregister itself. */\n _removeAriaLabelledBy?: (id: string) => void;\n}\n\n/** Injection token providing arbitrary data to popover component content. */\nexport const TW_POPOVER_DATA = new InjectionToken<unknown>('TW_POPOVER_DATA');\n\n/** Injection token providing a `PopoverRef` to popover component content. */\nexport const TW_POPOVER_REF = new InjectionToken<PopoverRef>('TW_POPOVER_REF');\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_DATA} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_DATA = TW_POPOVER_DATA;\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_REF} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_REF = TW_POPOVER_REF;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n type Type,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n type ConnectedPosition,\n type FlexibleConnectedPositionStrategy,\n Overlay,\n type OverlayRef,\n} from '@angular/cdk/overlay';\nimport { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Subscription } from 'rxjs';\nimport { tv } from 'tailwind-variants';\nimport type { TwColor, TwSize } from '@cdevhub/ngx-tw/core';\nimport {\n TW_POPOVER_DATA,\n TW_POPOVER_REF,\n type PopoverRef,\n type PopoverTemplateContext,\n} from './popover-tokens';\n\n// ── Types ──\n\n/** Placement position of the popover relative to its trigger element. */\nexport type PopoverPosition =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n\n/** Scroll strategy for the popover overlay. */\nexport type PopoverScrollStrategy = 'reposition' | 'close' | 'block' | 'noop';\n\n/** Backdrop behavior for the popover. */\nexport type PopoverBackdrop = 'transparent' | 'dimmed' | 'none';\n\n/** Trigger interaction that opens the popover. */\nexport type PopoverTrigger = 'click' | 'focus' | 'manual';\n\n/** Direction the arrow points toward (derived from resolved overlay position). */\ntype ArrowDirection = 'top' | 'bottom' | 'left' | 'right';\n\n/** Duration of leave animation in ms (must match _base.css scale-out/fade-out). */\nconst ANIMATION_DURATION = 120;\n\n// ── Variant config ──\n\nconst popoverVariants = tv(\n {\n slots: {\n wrapper: 'relative',\n panel:\n 'bg-surface-overlay text-fg text-sm border border-border rounded-lg shadow-md overflow-hidden',\n arrow: 'absolute size-2.5 rotate-45 bg-surface-overlay border border-border',\n },\n variants: {\n size: {\n xs: { panel: 'p-2' },\n sm: { panel: 'p-3' },\n md: { panel: 'p-4' },\n lg: { panel: 'p-6' },\n xl: { panel: 'p-8' },\n },\n },\n defaultVariants: { size: 'md' },\n },\n { twMerge: true },\n);\n\n// ── Color accent classes ──\n\nconst COLOR_ACCENT_CLASSES: Record<TwColor, string> = {\n primary: 'border-t-2 border-t-primary-500',\n secondary: 'border-t-2 border-t-secondary-500',\n accent: 'border-t-2 border-t-accent-500',\n neutral: 'border-t-2 border-t-neutral-500',\n info: 'border-t-2 border-t-info-500',\n success: 'border-t-2 border-t-success-500',\n warning: 'border-t-2 border-t-warning-500',\n error: 'border-t-2 border-t-error-500',\n};\n\n// ── Position mappings ──\n\nfunction buildPositionMap(offset: number): Record<PopoverPosition, ConnectedPosition> {\n return {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-end': {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-start': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: offset,\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -offset,\n },\n 'left-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'top',\n offsetX: -offset,\n },\n 'left-end': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetX: -offset,\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: offset,\n },\n 'right-start': {\n originX: 'end',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n offsetX: offset,\n },\n 'right-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetX: offset,\n },\n };\n}\n\nconst FALLBACK_ORDER: Record<string, PopoverPosition[]> = {\n top: ['bottom', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\nfunction buildPositions(\n preferred: PopoverPosition,\n offset: number,\n): ConnectedPosition[] {\n const positionMap = buildPositionMap(offset);\n const primary = preferred.split('-')[0];\n const positions = [positionMap[preferred]];\n const fallbacks = FALLBACK_ORDER[primary] ?? FALLBACK_ORDER['top'];\n for (const fb of fallbacks) {\n positions.push(positionMap[fb]);\n }\n return positions;\n}\n\nfunction resolveArrowDirection(position: ConnectedPosition): ArrowDirection {\n if (position.overlayY === 'bottom') return 'bottom';\n if (position.overlayY === 'top') return 'top';\n if (position.overlayX === 'end') return 'right';\n return 'left';\n}\n\n/** Arrow position classes keyed by which side the arrow sits on. */\nconst ARROW_POSITION_CLASSES: Record<ArrowDirection, string> = {\n bottom: 'left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 border-t-0 border-l-0',\n top: 'left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 border-b-0 border-r-0',\n right: 'top-1/2 -translate-y-1/2 right-0 translate-x-1/2 border-b-0 border-l-0',\n left: 'top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 border-t-0 border-r-0',\n};\n\n// ── Internal overlay component (not exported) ──\n\nlet nextPopoverId = 0;\n\n@Component({\n selector: 'tw-popover-overlay',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CdkPortalOutlet],\n host: {\n class: 'origin-center',\n '[id]': 'id',\n '[attr.role]': '\"dialog\"',\n '[attr.aria-modal]': 'ariaModal() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n '[attr.aria-labelledby]': 'computedAriaLabelledBy()',\n '[animate.enter]': '\"scale-in\"',\n '[animate.leave]': '\"scale-out\"',\n },\n template: `\n <div [class]=\"wrapperClasses()\">\n <div [class]=\"panelClasses()\">\n <ng-template [cdkPortalOutlet]=\"portal()\" />\n </div>\n @if (showArrow()) {\n <span [class]=\"arrowClasses()\" aria-hidden=\"true\"></span>\n }\n </div>\n `,\n})\nclass PopoverOverlayComponent {\n readonly id = `tw-popover-${nextPopoverId++}`;\n\n readonly size = signal<TwSize>('md');\n readonly color = signal<TwColor | undefined>(undefined);\n readonly showArrow = signal(true);\n readonly arrowDirection = signal<ArrowDirection>('top');\n readonly ariaLabel = signal<string | undefined>(undefined);\n readonly ariaModal = signal(true);\n readonly ariaLabelledByQueue = signal<readonly string[]>([]);\n readonly panelClass = signal<string>('');\n readonly portal = signal<TemplatePortal<PopoverTemplateContext> | ComponentPortal<unknown> | null>(null);\n\n readonly computedAriaLabelledBy = computed(() => {\n if (this.ariaLabel()) return null;\n return this.ariaLabelledByQueue()[0] ?? null;\n });\n\n /** @internal Registers a projected title's id so the panel's `aria-labelledby` points at it. */\n _addAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => (q.includes(id) ? q : [...q, id]));\n }\n\n /** @internal Unregisters a previously added `aria-labelledby` id when the title is destroyed. */\n _removeAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => q.filter((existing) => existing !== id));\n }\n\n private readonly variantResult = computed(() =>\n popoverVariants({ size: this.size() }),\n );\n\n readonly wrapperClasses = computed(() => this.variantResult().wrapper());\n\n readonly panelClasses = computed(() => {\n const base = this.variantResult().panel();\n const colorClass = this.color() ? COLOR_ACCENT_CLASSES[this.color()!] : '';\n const custom = this.panelClass();\n return [base, colorClass, custom].filter(Boolean).join(' ');\n });\n\n readonly arrowClasses = computed(() => {\n const base = this.variantResult().arrow();\n const position = ARROW_POSITION_CLASSES[this.arrowDirection()];\n return `${base} ${position}`;\n });\n}\n\n// ── Popover directive ──\n\n@Directive({\n selector: '[twPopover]',\n exportAs: 'twPopover',\n host: {\n // Static marker so the directive is locatable in tests and by consumers.\n // Its own selector is not usable for that: `[twPopover]` takes a required\n // `TemplateRef`, so it is ALWAYS property-bound and Angular emits no\n // attribute for a bound input. Material solves this with a class\n // (`.mat-mdc-menu-trigger`); `data-tw-*` is this repo's existing convention\n // (see `data-tw-table-loading`, `data-tw-sort-arrow`) and carries no styling.\n 'data-tw-popover-trigger': '',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'twPopoverOpen()',\n '[attr.aria-controls]': 'overlayComponentId()',\n '(click)': 'onHostClick()',\n '(focus)': 'onHostFocus()',\n '(blur)': 'onHostBlur()',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class PopoverDirective {\n /** The content to render. An `ng-template` receives context with `$implicit` (data) and `close` (function). A component class receives data and a ref via injection tokens. */\n readonly twPopover = input.required<\n TemplateRef<PopoverTemplateContext> | Type<unknown>\n >();\n\n /** Preferred placement relative to the trigger. CDK handles fallback when space is insufficient. Defaults to `'bottom'`. */\n readonly twPopoverPosition = input<PopoverPosition>('bottom');\n\n /** What user interaction opens the popover. `'manual'` means consumers call `open()`/`close()` programmatically. Defaults to `'click'`. */\n readonly twPopoverTriggerOn = input<PopoverTrigger>('click');\n\n /** When true, all trigger interactions are suppressed. Defaults to `false`. */\n readonly twPopoverDisabled = input(false);\n\n /** Two-way bindable open state. Setting to `true` opens the popover; the popover sets it to `false` on close. Defaults to `false`. */\n readonly twPopoverOpen = model(false);\n\n /** Controls panel padding using the standard spacing scale. Defaults to `'md'`. */\n readonly twPopoverSize = input<TwSize>('md');\n\n /** Pixel distance between trigger and panel edge. Defaults to `8`. */\n readonly twPopoverOffset = input(8);\n\n /** Whether to render a directional arrow pointing at the trigger. Defaults to `true` — the arrow is the visual anchor tying the panel to its trigger; the special case is a compact iconic trigger where the arrow would crowd the layout. */\n readonly twPopoverArrow = input(true);\n\n /** Backdrop behavior. `'transparent'` catches outside clicks invisibly. `'dimmed'` adds a semi-transparent overlay. `'none'` disables the backdrop. Defaults to `'transparent'`. */\n readonly twPopoverBackdrop = input<PopoverBackdrop>('transparent');\n\n /** Whether clicking outside the panel closes the popover. Only relevant when backdrop is `'none'`. Defaults to `true` — clicking away is the universal dismiss gesture for floating panels; the special case is a popover owning a multi-step flow the user must complete. */\n readonly twPopoverCloseOnOutside = input(true);\n\n /** Whether pressing Escape closes the popover. Defaults to `true` — the WAI-ARIA dialog pattern mandates that Escape closes; the special case is a popover owning a child layer (nested dialog or menu) that should consume Escape first. */\n readonly twPopoverCloseOnEscape = input(true);\n\n /** CDK scroll strategy for the overlay. Defaults to `'reposition'`. */\n readonly twPopoverScrollStrategy = input<PopoverScrollStrategy>('reposition');\n\n /** Whether to trap focus inside the popover panel using CDK FocusTrapFactory. Defaults to `true` — it matches the `role=\"dialog\"` baseline, where a focus-trapped panel announces itself as modal; the special case is an inline popover acting as an informational tooltip. */\n readonly twPopoverTrapFocus = input(true);\n\n /** Arbitrary data passed to template context or component via `TW_POPOVER_DATA` token. Defaults to `undefined`. */\n readonly twPopoverData = input<unknown>(undefined);\n\n /** Additional CSS classes applied to the overlay panel for consumer customization. Defaults to an empty string. */\n readonly twPopoverPanelClass = input<string | string[]>('');\n\n /** Optional semantic color. When set, adds a colored top border accent to the panel. */\n readonly twPopoverColor = input<TwColor | undefined>(undefined);\n\n /** Explicit `aria-label` for the dialog panel. Defaults to `undefined`. */\n readonly twPopoverAriaLabel = input<string | undefined>(undefined);\n\n /** Fires after the popover becomes visible. */\n readonly twPopoverOpened = output<void>();\n\n /** Fires after the popover is fully removed. */\n readonly twPopoverClosed = output<void>();\n\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(FocusTrapFactory);\n\n private overlayRef: OverlayRef | null = null;\n private popoverInstance: PopoverOverlayComponent | null = null;\n private focusTrap: ReturnType<FocusTrapFactory['create']> | null = null;\n private perOpenSubs: Subscription | null = null;\n /** The `twPopoverBackdrop` value baked into the current `overlayRef`. */\n private appliedBackdrop: PopoverBackdrop | null = null;\n /** The `twPopoverScrollStrategy` value baked into the current `overlayRef`. */\n private appliedScrollStrategy: PopoverScrollStrategy | null = null;\n private closing = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n /** Tracked focus-blur close timer; cleared on destroy so it can't fire post-teardown. */\n private blurCloseTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly overlayId = signal<string | null>(null);\n\n /** The overlay component's id for aria-controls binding. */\n protected readonly overlayComponentId = computed(() => this.overlayId());\n\n constructor() {\n // React to model changes from the parent\n effect(() => {\n const isOpen = this.twPopoverOpen();\n const disabled = this.twPopoverDisabled();\n if (disabled && this.popoverInstance) {\n this.closePopover();\n return;\n }\n if (isOpen && this.closing && this.popoverInstance && !disabled) {\n // Reopened before the leave animation finished. Cancelling the pending\n // close is preferable to queueing a reopen: the overlay is still\n // attached, so the surface simply stays up instead of visibly closing\n // and springing back. Without this the deferred callback below would\n // also write `false` over the consumer's `true`.\n this.cancelPendingClose();\n return;\n }\n if (isOpen && !this.popoverInstance && !disabled && !this.closing) {\n this.openPopover();\n } else if (!isOpen && this.popoverInstance) {\n this.closePopover();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearCloseTimer();\n if (this.blurCloseTimer !== null) {\n clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = null;\n }\n this.destroyFocusTrap();\n this.perOpenSubs?.unsubscribe();\n this.disposeOverlay();\n });\n }\n\n /** Programmatically open the popover. */\n open(): void {\n if (this.twPopoverDisabled() || this.popoverInstance || this.closing) return;\n this.twPopoverOpen.set(true);\n }\n\n /** Programmatically close the popover. */\n close(): void {\n if (!this.popoverInstance && !this.closing) return;\n this.twPopoverOpen.set(false);\n }\n\n /** Toggle open/close. */\n toggle(): void {\n if (this.popoverInstance || this.closing) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Force CDK to recalculate overlay position. */\n reposition(): void {\n this.overlayRef?.updatePosition();\n }\n\n // ── Host event handlers ──\n\n protected onHostClick(): void {\n if (this.twPopoverTriggerOn() === 'click') {\n this.toggle();\n }\n }\n\n protected onHostFocus(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n this.open();\n }\n }\n\n protected onHostBlur(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n if (this.blurCloseTimer !== null) clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = setTimeout(() => {\n this.blurCloseTimer = null;\n const activeEl = document.activeElement;\n const overlayEl = this.overlayRef?.overlayElement;\n if (overlayEl && overlayEl.contains(activeEl)) return;\n this.close();\n });\n }\n }\n\n protected onEscape(): void {\n if (this.twPopoverCloseOnEscape() && this.popoverInstance) {\n this.close();\n }\n }\n\n // ── Private ──\n\n private openPopover(): void {\n const createdFresh = this.ensureOverlay();\n // A freshly built OverlayRef already carries a strategy made from the\n // current inputs; only a reused one needs the per-open position refresh.\n if (!createdFresh) this.updatePositionStrategy();\n this.attachContent();\n this.subscribePerOpen();\n this.overlayId.set(this.popoverInstance?.id ?? null);\n this.setupFocusTrap();\n this.twPopoverOpened.emit();\n }\n\n private closePopover(): void {\n if (this.closing) return;\n this.closing = true;\n\n // Restore focus to the trigger UNLESS the consumer has deliberately moved\n // focus to a different focusable element outside the overlay. We detect\n // that by checking whether the active element is a real focusable target\n // outside the overlay — body/null means focus is \"unset\" and we should\n // still restore (the typical case after Escape or backdrop click).\n const overlayEl = this.overlayRef?.overlayElement;\n const activeEl = document.activeElement as HTMLElement | null;\n const focusOutsideOverlayIntentionally =\n !!activeEl &&\n activeEl !== document.body &&\n activeEl !== this.elementRef.nativeElement &&\n !overlayEl?.contains(activeEl);\n\n // 1. Destroy focus trap so focus can leave\n this.destroyFocusTrap();\n\n // 2. Return focus to trigger only when appropriate\n if (!focusOutsideOverlayIntentionally) {\n this.elementRef.nativeElement.focus();\n }\n\n // 3. Wait for leave animation, then detach\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n }\n\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = null;\n this.popoverInstance = null;\n this.overlayId.set(null);\n\n // Use untracked to prevent effect re-trigger\n untracked(() => this.twPopoverOpen.set(false));\n\n this.twPopoverClosed.emit();\n this.closing = false;\n }, ANIMATION_DURATION);\n }\n\n private currentPositionStrategy: FlexibleConnectedPositionStrategy | null = null;\n\n private buildPositionStrategy(): FlexibleConnectedPositionStrategy {\n const positions = buildPositions(\n this.twPopoverPosition(),\n this.twPopoverOffset(),\n );\n\n return this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(8);\n }\n\n /**\n * Ensures an `OverlayRef` exists whose creation-time configuration matches the\n * current inputs. Returns `true` when a fresh ref was built.\n *\n * `hasBackdrop` / `backdropClass` are read by CDK inside `OverlayRef.attach()`\n * straight off the config object handed to `Overlay.create()`, and there is no\n * public setter that re-renders them. Since closing only detaches, a ref built\n * on the first open would otherwise keep the first open's backdrop for the\n * directive's whole lifetime — while `subscribePerOpen` re-reads\n * `twPopoverBackdrop` every open to decide whether backdrop-click closes, so\n * the two reads of one input disagreed. Rebuilding only when a creation-time\n * input actually changed keeps the common reopen path on the same ref.\n */\n private ensureOverlay(): boolean {\n const backdrop = this.twPopoverBackdrop();\n const scrollStrategyName = this.twPopoverScrollStrategy();\n\n if (this.overlayRef) {\n if (\n backdrop === this.appliedBackdrop &&\n scrollStrategyName === this.appliedScrollStrategy\n ) {\n return false;\n }\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n }\n\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n\n const hasBackdrop = backdrop !== 'none';\n const backdropClass =\n backdrop === 'dimmed' ? 'bg-black/20' : 'cdk-overlay-transparent-backdrop';\n\n const scrollStrategy = this.resolveScrollStrategy();\n\n this.appliedBackdrop = backdrop;\n this.appliedScrollStrategy = scrollStrategyName;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy,\n hasBackdrop,\n backdropClass,\n panelClass: 'tw-popover-panel',\n });\n return true;\n }\n\n private updatePositionStrategy(): void {\n if (!this.overlayRef) return;\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n this.overlayRef.updatePositionStrategy(positionStrategy);\n }\n\n private subscribePerOpen(): void {\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = new Subscription();\n\n const backdrop = this.twPopoverBackdrop();\n const hasBackdrop = backdrop !== 'none';\n\n // Backdrop click closes\n if (hasBackdrop) {\n this.perOpenSubs.add(\n this.overlayRef!.backdropClick().subscribe(() => this.close()),\n );\n }\n\n // Outside pointer events when no backdrop\n if (!hasBackdrop && this.twPopoverCloseOnOutside()) {\n this.perOpenSubs.add(\n this.overlayRef!.outsidePointerEvents().subscribe(() => this.close()),\n );\n }\n\n // Escape from within the overlay\n this.perOpenSubs.add(\n this.overlayRef!.keydownEvents().subscribe((event) => {\n if (event.key === 'Escape' && this.twPopoverCloseOnEscape()) {\n this.close();\n }\n }),\n );\n\n // Per-open position change subscription — torn down on close to prevent\n // accumulation when the directive is opened/closed many times.\n if (this.currentPositionStrategy) {\n this.perOpenSubs.add(\n this.currentPositionStrategy.positionChanges.subscribe((change) => {\n if (this.popoverInstance) {\n const dir = resolveArrowDirection(change.connectionPair);\n this.popoverInstance.arrowDirection.set(dir);\n }\n }),\n );\n }\n }\n\n private attachContent(): void {\n const content = this.twPopover();\n\n // Attach the internal overlay component\n const overlayPortal = new ComponentPortal(\n PopoverOverlayComponent,\n this.viewContainerRef,\n );\n const componentRef = this.overlayRef!.attach(overlayPortal);\n this.popoverInstance = componentRef.instance;\n\n // Configure the overlay component\n this.popoverInstance.size.set(this.twPopoverSize());\n this.popoverInstance.color.set(this.twPopoverColor());\n this.popoverInstance.showArrow.set(this.twPopoverArrow());\n this.popoverInstance.ariaLabel.set(this.twPopoverAriaLabel());\n this.popoverInstance.ariaModal.set(this.twPopoverTrapFocus());\n this.popoverInstance.ariaLabelledByQueue.set([]);\n this.popoverInstance.panelClass.set(this.resolvePanelClass());\n\n // Provide TW_POPOVER_REF for both template and component content. Title directives\n // call _addAriaLabelledBy / _removeAriaLabelledBy to register their id with the\n // overlay's aria-labelledby queue.\n const overlayInstance = this.popoverInstance;\n const popoverRef: PopoverRef = {\n close: () => this.close(),\n _addAriaLabelledBy: (id) => overlayInstance._addAriaLabelledBy(id),\n _removeAriaLabelledBy: (id) => overlayInstance._removeAriaLabelledBy(id),\n };\n\n // Create the content portal\n if (content instanceof TemplateRef) {\n const context: PopoverTemplateContext = {\n $implicit: this.twPopoverData(),\n close: () => this.close(),\n };\n const templateInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const templatePortal = new TemplatePortal(\n content,\n this.viewContainerRef,\n context,\n templateInjector,\n );\n this.popoverInstance.portal.set(templatePortal);\n } else {\n const contentInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const componentPortal = new ComponentPortal(\n content,\n this.viewContainerRef,\n contentInjector,\n );\n this.popoverInstance.portal.set(componentPortal);\n }\n }\n\n private setupFocusTrap(): void {\n if (!this.twPopoverTrapFocus() || !this.overlayRef) return;\n const overlayEl = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(overlayEl);\n this.focusTrap.focusInitialElementWhenReady();\n }\n\n private destroyFocusTrap(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n this.appliedBackdrop = null;\n this.appliedScrollStrategy = null;\n this.popoverInstance = null;\n }\n\n /**\n * Aborts an in-flight close, leaving the popover open.\n *\n * `closePopover` tears the focus trap down immediately and defers only the\n * detach, so cancelling has to rebuild the trap — the overlay itself is still\n * attached and the instance still live.\n */\n private cancelPendingClose(): void {\n this.clearCloseTimer();\n this.closing = false;\n this.setupFocusTrap();\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private resolveScrollStrategy() {\n const strategy = this.twPopoverScrollStrategy();\n switch (strategy) {\n case 'close':\n return this.overlay.scrollStrategies.close();\n case 'block':\n return this.overlay.scrollStrategies.block();\n case 'noop':\n return this.overlay.scrollStrategies.noop();\n default:\n return this.overlay.scrollStrategies.reposition();\n }\n }\n\n private resolvePanelClass(): string {\n const raw = this.twPopoverPanelClass();\n return Array.isArray(raw) ? raw.join(' ') : raw;\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Convenience directive that closes the enclosing popover when the host element is clicked.\n * Place on any element inside popover content.\n *\n * ```html\n * <button twPopoverClose>Cancel</button>\n * ```\n */\n@Directive({\n selector: '[twPopoverClose]',\n host: {\n '(click)': 'closePopover()',\n '[attr.type]': '\"button\"',\n },\n})\nexport class PopoverCloseDirective {\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n protected closePopover(): void {\n this.popoverRef?.close();\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Popover title. Registers its ID with the enclosing popover overlay's\n * `aria-labelledby` queue so screen readers announce it automatically.\n *\n * Mirrors `DialogTitleDirective` and is the recommended way to label a\n * popover whose content has a heading. Use `twPopoverAriaLabel` when no\n * heading is present.\n */\n@Directive({\n selector: '[twPopoverTitle], tw-popover-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class PopoverTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-popover-title-');\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n this.popoverRef?._addAriaLabelledBy?.(this.id());\n }\n\n ngOnDestroy(): void {\n this.popoverRef?._removeAriaLabelledBy?.(this.id());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAoBA;MACa,eAAe,GAAG,IAAI,cA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,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,+BAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oCAAoC;AAC9C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,+BAA+B;AACtC,wBAAA,MAAM,EAAE,MAAM;AACf,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cdevhub-ngx-tw-popover.mjs","sources":["../../../projects/ngx-tw/popover/popover-tokens.ts","../../../projects/ngx-tw/popover/popover.ts","../../../projects/ngx-tw/popover/popover-close.ts","../../../projects/ngx-tw/popover/popover-title.ts","../../../projects/ngx-tw/popover/cdevhub-ngx-tw-popover.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Context object provided to popover template content. */\nexport interface PopoverTemplateContext<T = unknown> {\n /** The data passed via `twPopoverData` input. */\n $implicit: T;\n /** Closes the popover. */\n close: () => void;\n}\n\n/** Reference to control the popover from inside component content. */\nexport interface PopoverRef {\n /** Closes the popover. */\n close(): void;\n /** @internal — used by `PopoverTitleDirective` to register itself with `aria-labelledby`. */\n _addAriaLabelledBy?: (id: string) => void;\n /** @internal — used by `PopoverTitleDirective` to unregister itself. */\n _removeAriaLabelledBy?: (id: string) => void;\n}\n\n/** Injection token providing arbitrary data to popover component content. */\nexport const TW_POPOVER_DATA = new InjectionToken<unknown>('TW_POPOVER_DATA');\n\n/** Injection token providing a `PopoverRef` to popover component content. */\nexport const TW_POPOVER_REF = new InjectionToken<PopoverRef>('TW_POPOVER_REF');\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_DATA} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_DATA = TW_POPOVER_DATA;\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_REF} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_REF = TW_POPOVER_REF;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n type Type,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n type ConnectedPosition,\n type FlexibleConnectedPositionStrategy,\n Overlay,\n type OverlayRef,\n} from '@angular/cdk/overlay';\nimport { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Subscription } from 'rxjs';\nimport { tv } from 'tailwind-variants';\nimport { consumeOverlayEscape, type TwColor, type TwSize } from '@cdevhub/ngx-tw/core';\nimport {\n TW_POPOVER_DATA,\n TW_POPOVER_REF,\n type PopoverRef,\n type PopoverTemplateContext,\n} from './popover-tokens';\n\n// ── Types ──\n\n/** Placement position of the popover relative to its trigger element. */\nexport type PopoverPosition =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n\n/** Scroll strategy for the popover overlay. */\nexport type PopoverScrollStrategy = 'reposition' | 'close' | 'block' | 'noop';\n\n/** Backdrop behavior for the popover. */\nexport type PopoverBackdrop = 'transparent' | 'dimmed' | 'none';\n\n/** Trigger interaction that opens the popover. */\nexport type PopoverTrigger = 'click' | 'focus' | 'manual';\n\n/** Direction the arrow points toward (derived from resolved overlay position). */\ntype ArrowDirection = 'top' | 'bottom' | 'left' | 'right';\n\n/** Duration of leave animation in ms (must match _base.css scale-out/fade-out). */\nconst ANIMATION_DURATION = 120;\n\n// ── Variant config ──\n\nconst popoverVariants = tv(\n {\n slots: {\n wrapper: 'relative',\n panel:\n 'bg-surface-overlay text-fg text-sm border border-border rounded-lg shadow-md overflow-hidden',\n arrow: 'absolute size-2.5 rotate-45 bg-surface-overlay border border-border',\n },\n variants: {\n size: {\n xs: { panel: 'p-2' },\n sm: { panel: 'p-3' },\n md: { panel: 'p-4' },\n lg: { panel: 'p-6' },\n xl: { panel: 'p-8' },\n },\n },\n defaultVariants: { size: 'md' },\n },\n { twMerge: true },\n);\n\n// ── Color accent classes ──\n\nconst COLOR_ACCENT_CLASSES: Record<TwColor, string> = {\n primary: 'border-t-2 border-t-primary-500',\n secondary: 'border-t-2 border-t-secondary-500',\n accent: 'border-t-2 border-t-accent-500',\n neutral: 'border-t-2 border-t-neutral-500',\n info: 'border-t-2 border-t-info-500',\n success: 'border-t-2 border-t-success-500',\n warning: 'border-t-2 border-t-warning-500',\n error: 'border-t-2 border-t-error-500',\n};\n\n// ── Position mappings ──\n\nfunction buildPositionMap(offset: number): Record<PopoverPosition, ConnectedPosition> {\n return {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-end': {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-start': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: offset,\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -offset,\n },\n 'left-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'top',\n offsetX: -offset,\n },\n 'left-end': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetX: -offset,\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: offset,\n },\n 'right-start': {\n originX: 'end',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n offsetX: offset,\n },\n 'right-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetX: offset,\n },\n };\n}\n\nconst FALLBACK_ORDER: Record<string, PopoverPosition[]> = {\n top: ['bottom', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\nfunction buildPositions(\n preferred: PopoverPosition,\n offset: number,\n): ConnectedPosition[] {\n const positionMap = buildPositionMap(offset);\n const primary = preferred.split('-')[0];\n const positions = [positionMap[preferred]];\n const fallbacks = FALLBACK_ORDER[primary] ?? FALLBACK_ORDER['top'];\n for (const fb of fallbacks) {\n positions.push(positionMap[fb]);\n }\n return positions;\n}\n\nfunction resolveArrowDirection(position: ConnectedPosition): ArrowDirection {\n if (position.overlayY === 'bottom') return 'bottom';\n if (position.overlayY === 'top') return 'top';\n if (position.overlayX === 'end') return 'right';\n return 'left';\n}\n\n/** Arrow position classes keyed by which side the arrow sits on. */\nconst ARROW_POSITION_CLASSES: Record<ArrowDirection, string> = {\n bottom: 'left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 border-t-0 border-l-0',\n top: 'left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 border-b-0 border-r-0',\n right: 'top-1/2 -translate-y-1/2 right-0 translate-x-1/2 border-b-0 border-l-0',\n left: 'top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 border-t-0 border-r-0',\n};\n\n// ── Internal overlay component (not exported) ──\n\nlet nextPopoverId = 0;\n\n@Component({\n selector: 'tw-popover-overlay',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CdkPortalOutlet],\n host: {\n class: 'origin-center',\n '[id]': 'id',\n '[attr.role]': '\"dialog\"',\n '[attr.aria-modal]': 'ariaModal() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n '[attr.aria-labelledby]': 'computedAriaLabelledBy()',\n '[animate.enter]': '\"scale-in\"',\n '[animate.leave]': '\"scale-out\"',\n },\n template: `\n <div [class]=\"wrapperClasses()\">\n <div [class]=\"panelClasses()\">\n <ng-template [cdkPortalOutlet]=\"portal()\" />\n </div>\n @if (showArrow()) {\n <span [class]=\"arrowClasses()\" aria-hidden=\"true\"></span>\n }\n </div>\n `,\n})\nclass PopoverOverlayComponent {\n readonly id = `tw-popover-${nextPopoverId++}`;\n\n readonly size = signal<TwSize>('md');\n readonly color = signal<TwColor | undefined>(undefined);\n readonly showArrow = signal(true);\n readonly arrowDirection = signal<ArrowDirection>('top');\n readonly ariaLabel = signal<string | undefined>(undefined);\n readonly ariaModal = signal(true);\n readonly ariaLabelledByQueue = signal<readonly string[]>([]);\n readonly panelClass = signal<string>('');\n readonly portal = signal<TemplatePortal<PopoverTemplateContext> | ComponentPortal<unknown> | null>(null);\n\n readonly computedAriaLabelledBy = computed(() => {\n if (this.ariaLabel()) return null;\n return this.ariaLabelledByQueue()[0] ?? null;\n });\n\n /** @internal Registers a projected title's id so the panel's `aria-labelledby` points at it. */\n _addAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => (q.includes(id) ? q : [...q, id]));\n }\n\n /** @internal Unregisters a previously added `aria-labelledby` id when the title is destroyed. */\n _removeAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => q.filter((existing) => existing !== id));\n }\n\n private readonly variantResult = computed(() =>\n popoverVariants({ size: this.size() }),\n );\n\n readonly wrapperClasses = computed(() => this.variantResult().wrapper());\n\n readonly panelClasses = computed(() => {\n const base = this.variantResult().panel();\n const colorClass = this.color() ? COLOR_ACCENT_CLASSES[this.color()!] : '';\n const custom = this.panelClass();\n return [base, colorClass, custom].filter(Boolean).join(' ');\n });\n\n readonly arrowClasses = computed(() => {\n const base = this.variantResult().arrow();\n const position = ARROW_POSITION_CLASSES[this.arrowDirection()];\n return `${base} ${position}`;\n });\n}\n\n// ── Popover directive ──\n\n@Directive({\n selector: '[twPopover]',\n exportAs: 'twPopover',\n host: {\n // Static marker so the directive is locatable in tests and by consumers.\n // Its own selector is not usable for that: `[twPopover]` takes a required\n // `TemplateRef`, so it is ALWAYS property-bound and Angular emits no\n // attribute for a bound input. Material solves this with a class\n // (`.mat-mdc-menu-trigger`); `data-tw-*` is this repo's existing convention\n // (see `data-tw-table-loading`, `data-tw-sort-arrow`) and carries no styling.\n 'data-tw-popover-trigger': '',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'twPopoverOpen()',\n '[attr.aria-controls]': 'overlayComponentId()',\n '(click)': 'onHostClick()',\n '(focus)': 'onHostFocus()',\n '(blur)': 'onHostBlur()',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class PopoverDirective {\n /** The content to render. An `ng-template` receives context with `$implicit` (data) and `close` (function). A component class receives data and a ref via injection tokens. */\n readonly twPopover = input.required<\n TemplateRef<PopoverTemplateContext> | Type<unknown>\n >();\n\n /** Preferred placement relative to the trigger. CDK handles fallback when space is insufficient. Defaults to `'bottom'`. */\n readonly twPopoverPosition = input<PopoverPosition>('bottom');\n\n /** What user interaction opens the popover. `'manual'` means consumers call `open()`/`close()` programmatically. Defaults to `'click'`. */\n readonly twPopoverTriggerOn = input<PopoverTrigger>('click');\n\n /** When true, all trigger interactions are suppressed. Defaults to `false`. */\n readonly twPopoverDisabled = input(false);\n\n /** Two-way bindable open state. Setting to `true` opens the popover; the popover sets it to `false` on close. Defaults to `false`. */\n readonly twPopoverOpen = model(false);\n\n /** Controls panel padding using the standard spacing scale. Defaults to `'md'`. */\n readonly twPopoverSize = input<TwSize>('md');\n\n /** Pixel distance between trigger and panel edge. Defaults to `8`. */\n readonly twPopoverOffset = input(8);\n\n /** Whether to render a directional arrow pointing at the trigger. Defaults to `true` — the arrow is the visual anchor tying the panel to its trigger; the special case is a compact iconic trigger where the arrow would crowd the layout. */\n readonly twPopoverArrow = input(true);\n\n /** Backdrop behavior. `'transparent'` catches outside clicks invisibly. `'dimmed'` adds a semi-transparent overlay. `'none'` disables the backdrop. Defaults to `'transparent'`. */\n readonly twPopoverBackdrop = input<PopoverBackdrop>('transparent');\n\n /** Whether clicking outside the panel closes the popover. Only relevant when backdrop is `'none'`. Defaults to `true` — clicking away is the universal dismiss gesture for floating panels; the special case is a popover owning a multi-step flow the user must complete. */\n readonly twPopoverCloseOnOutside = input(true);\n\n /** Whether pressing Escape closes the popover. Defaults to `true` — the WAI-ARIA dialog pattern mandates that Escape closes; the special case is a popover owning a child layer (nested dialog or menu) that should consume Escape first. */\n readonly twPopoverCloseOnEscape = input(true);\n\n /** CDK scroll strategy for the overlay. Defaults to `'reposition'`. */\n readonly twPopoverScrollStrategy = input<PopoverScrollStrategy>('reposition');\n\n /** Whether to trap focus inside the popover panel using CDK FocusTrapFactory. Defaults to `true` — it matches the `role=\"dialog\"` baseline, where a focus-trapped panel announces itself as modal; the special case is an inline popover acting as an informational tooltip. */\n readonly twPopoverTrapFocus = input(true);\n\n /** Arbitrary data passed to template context or component via `TW_POPOVER_DATA` token. Defaults to `undefined`. */\n readonly twPopoverData = input<unknown>(undefined);\n\n /** Additional CSS classes applied to the overlay panel for consumer customization. Defaults to an empty string. */\n readonly twPopoverPanelClass = input<string | string[]>('');\n\n /** Optional semantic color. When set, adds a colored top border accent to the panel. */\n readonly twPopoverColor = input<TwColor | undefined>(undefined);\n\n /** Explicit `aria-label` for the dialog panel. Defaults to `undefined`. */\n readonly twPopoverAriaLabel = input<string | undefined>(undefined);\n\n /** Fires after the popover becomes visible. */\n readonly twPopoverOpened = output<void>();\n\n /** Fires after the popover is fully removed. */\n readonly twPopoverClosed = output<void>();\n\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(FocusTrapFactory);\n\n private overlayRef: OverlayRef | null = null;\n private popoverInstance: PopoverOverlayComponent | null = null;\n private focusTrap: ReturnType<FocusTrapFactory['create']> | null = null;\n private perOpenSubs: Subscription | null = null;\n /** The `twPopoverBackdrop` value baked into the current `overlayRef`. */\n private appliedBackdrop: PopoverBackdrop | null = null;\n /** The `twPopoverScrollStrategy` value baked into the current `overlayRef`. */\n private appliedScrollStrategy: PopoverScrollStrategy | null = null;\n private closing = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n /** Tracked focus-blur close timer; cleared on destroy so it can't fire post-teardown. */\n private blurCloseTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly overlayId = signal<string | null>(null);\n\n /** The overlay component's id for aria-controls binding. */\n protected readonly overlayComponentId = computed(() => this.overlayId());\n\n constructor() {\n // React to model changes from the parent\n effect(() => {\n const isOpen = this.twPopoverOpen();\n const disabled = this.twPopoverDisabled();\n if (disabled && this.popoverInstance) {\n this.closePopover();\n return;\n }\n if (isOpen && this.closing && this.popoverInstance && !disabled) {\n // Reopened before the leave animation finished. Cancelling the pending\n // close is preferable to queueing a reopen: the overlay is still\n // attached, so the surface simply stays up instead of visibly closing\n // and springing back. Without this the deferred callback below would\n // also write `false` over the consumer's `true`.\n this.cancelPendingClose();\n return;\n }\n if (isOpen && !this.popoverInstance && !disabled && !this.closing) {\n this.openPopover();\n } else if (!isOpen && this.popoverInstance) {\n this.closePopover();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearCloseTimer();\n if (this.blurCloseTimer !== null) {\n clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = null;\n }\n this.destroyFocusTrap();\n this.perOpenSubs?.unsubscribe();\n this.disposeOverlay();\n });\n }\n\n /** Programmatically open the popover. */\n open(): void {\n if (this.twPopoverDisabled() || this.popoverInstance || this.closing) return;\n this.twPopoverOpen.set(true);\n }\n\n /** Programmatically close the popover. */\n close(): void {\n if (!this.popoverInstance && !this.closing) return;\n this.twPopoverOpen.set(false);\n }\n\n /** Toggle open/close. */\n toggle(): void {\n if (this.popoverInstance || this.closing) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Force CDK to recalculate overlay position. */\n reposition(): void {\n this.overlayRef?.updatePosition();\n }\n\n // ── Host event handlers ──\n\n protected onHostClick(): void {\n if (this.twPopoverTriggerOn() === 'click') {\n this.toggle();\n }\n }\n\n protected onHostFocus(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n this.open();\n }\n }\n\n protected onHostBlur(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n if (this.blurCloseTimer !== null) clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = setTimeout(() => {\n this.blurCloseTimer = null;\n const activeEl = document.activeElement;\n const overlayEl = this.overlayRef?.overlayElement;\n if (overlayEl && overlayEl.contains(activeEl)) return;\n this.close();\n });\n }\n }\n\n protected onEscape(): void {\n if (this.twPopoverCloseOnEscape() && this.popoverInstance) {\n this.close();\n }\n }\n\n // ── Private ──\n\n private openPopover(): void {\n const createdFresh = this.ensureOverlay();\n // A freshly built OverlayRef already carries a strategy made from the\n // current inputs; only a reused one needs the per-open position refresh.\n if (!createdFresh) this.updatePositionStrategy();\n this.attachContent();\n this.subscribePerOpen();\n this.overlayId.set(this.popoverInstance?.id ?? null);\n this.setupFocusTrap();\n this.twPopoverOpened.emit();\n }\n\n private closePopover(): void {\n if (this.closing) return;\n this.closing = true;\n\n // Restore focus to the trigger UNLESS the consumer has deliberately moved\n // focus to a different focusable element outside the overlay. We detect\n // that by checking whether the active element is a real focusable target\n // outside the overlay — body/null means focus is \"unset\" and we should\n // still restore (the typical case after Escape or backdrop click).\n const overlayEl = this.overlayRef?.overlayElement;\n const activeEl = document.activeElement as HTMLElement | null;\n const focusOutsideOverlayIntentionally =\n !!activeEl &&\n activeEl !== document.body &&\n activeEl !== this.elementRef.nativeElement &&\n !overlayEl?.contains(activeEl);\n\n // 1. Destroy focus trap so focus can leave\n this.destroyFocusTrap();\n\n // 2. Return focus to trigger only when appropriate\n if (!focusOutsideOverlayIntentionally) {\n this.elementRef.nativeElement.focus();\n }\n\n // 3. Wait for leave animation, then detach\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n }\n\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = null;\n this.popoverInstance = null;\n this.overlayId.set(null);\n\n // Use untracked to prevent effect re-trigger\n untracked(() => this.twPopoverOpen.set(false));\n\n this.twPopoverClosed.emit();\n this.closing = false;\n }, ANIMATION_DURATION);\n }\n\n private currentPositionStrategy: FlexibleConnectedPositionStrategy | null = null;\n\n private buildPositionStrategy(): FlexibleConnectedPositionStrategy {\n const positions = buildPositions(\n this.twPopoverPosition(),\n this.twPopoverOffset(),\n );\n\n return this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(8);\n }\n\n /**\n * Ensures an `OverlayRef` exists whose creation-time configuration matches the\n * current inputs. Returns `true` when a fresh ref was built.\n *\n * `hasBackdrop` / `backdropClass` are read by CDK inside `OverlayRef.attach()`\n * straight off the config object handed to `Overlay.create()`, and there is no\n * public setter that re-renders them. Since closing only detaches, a ref built\n * on the first open would otherwise keep the first open's backdrop for the\n * directive's whole lifetime — while `subscribePerOpen` re-reads\n * `twPopoverBackdrop` every open to decide whether backdrop-click closes, so\n * the two reads of one input disagreed. Rebuilding only when a creation-time\n * input actually changed keeps the common reopen path on the same ref.\n */\n private ensureOverlay(): boolean {\n const backdrop = this.twPopoverBackdrop();\n const scrollStrategyName = this.twPopoverScrollStrategy();\n\n if (this.overlayRef) {\n if (\n backdrop === this.appliedBackdrop &&\n scrollStrategyName === this.appliedScrollStrategy\n ) {\n return false;\n }\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n }\n\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n\n const hasBackdrop = backdrop !== 'none';\n const backdropClass =\n backdrop === 'dimmed' ? 'bg-black/20' : 'cdk-overlay-transparent-backdrop';\n\n const scrollStrategy = this.resolveScrollStrategy();\n\n this.appliedBackdrop = backdrop;\n this.appliedScrollStrategy = scrollStrategyName;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy,\n hasBackdrop,\n backdropClass,\n panelClass: 'tw-popover-panel',\n });\n return true;\n }\n\n private updatePositionStrategy(): void {\n if (!this.overlayRef) return;\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n this.overlayRef.updatePositionStrategy(positionStrategy);\n }\n\n private subscribePerOpen(): void {\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = new Subscription();\n\n const backdrop = this.twPopoverBackdrop();\n const hasBackdrop = backdrop !== 'none';\n\n // Backdrop click closes\n if (hasBackdrop) {\n this.perOpenSubs.add(\n this.overlayRef!.backdropClick().subscribe(() => this.close()),\n );\n }\n\n // Outside pointer events when no backdrop\n if (!hasBackdrop && this.twPopoverCloseOnOutside()) {\n this.perOpenSubs.add(\n this.overlayRef!.outsidePointerEvents().subscribe(() => this.close()),\n );\n }\n\n // Escape from within the overlay. Uses `core`'s `consumeOverlayEscape`\n // rather than re-filtering `keydownEvents()` here: that helper is exported\n // from `@cdevhub/ngx-tw/core` as public API, and until this call site\n // existed the library shipped a compatibility promise for a function it\n // never used itself while duplicating its body inline.\n // `Subscription.add()` accepts a teardown function, which is exactly what\n // `consumeOverlayEscape` returns — the helper's own JSDoc names this shape.\n this.perOpenSubs.add(\n consumeOverlayEscape(this.overlayRef!, () => {\n if (this.twPopoverCloseOnEscape()) this.close();\n }),\n );\n\n // Per-open position change subscription — torn down on close to prevent\n // accumulation when the directive is opened/closed many times.\n if (this.currentPositionStrategy) {\n this.perOpenSubs.add(\n this.currentPositionStrategy.positionChanges.subscribe((change) => {\n if (this.popoverInstance) {\n const dir = resolveArrowDirection(change.connectionPair);\n this.popoverInstance.arrowDirection.set(dir);\n }\n }),\n );\n }\n }\n\n private attachContent(): void {\n const content = this.twPopover();\n\n // Attach the internal overlay component\n const overlayPortal = new ComponentPortal(\n PopoverOverlayComponent,\n this.viewContainerRef,\n );\n const componentRef = this.overlayRef!.attach(overlayPortal);\n this.popoverInstance = componentRef.instance;\n\n // Configure the overlay component\n this.popoverInstance.size.set(this.twPopoverSize());\n this.popoverInstance.color.set(this.twPopoverColor());\n this.popoverInstance.showArrow.set(this.twPopoverArrow());\n this.popoverInstance.ariaLabel.set(this.twPopoverAriaLabel());\n this.popoverInstance.ariaModal.set(this.twPopoverTrapFocus());\n this.popoverInstance.ariaLabelledByQueue.set([]);\n this.popoverInstance.panelClass.set(this.resolvePanelClass());\n\n // Provide TW_POPOVER_REF for both template and component content. Title directives\n // call _addAriaLabelledBy / _removeAriaLabelledBy to register their id with the\n // overlay's aria-labelledby queue.\n const overlayInstance = this.popoverInstance;\n const popoverRef: PopoverRef = {\n close: () => this.close(),\n _addAriaLabelledBy: (id) => overlayInstance._addAriaLabelledBy(id),\n _removeAriaLabelledBy: (id) => overlayInstance._removeAriaLabelledBy(id),\n };\n\n // Create the content portal\n if (content instanceof TemplateRef) {\n const context: PopoverTemplateContext = {\n $implicit: this.twPopoverData(),\n close: () => this.close(),\n };\n const templateInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const templatePortal = new TemplatePortal(\n content,\n this.viewContainerRef,\n context,\n templateInjector,\n );\n this.popoverInstance.portal.set(templatePortal);\n } else {\n const contentInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const componentPortal = new ComponentPortal(\n content,\n this.viewContainerRef,\n contentInjector,\n );\n this.popoverInstance.portal.set(componentPortal);\n }\n }\n\n private setupFocusTrap(): void {\n if (!this.twPopoverTrapFocus() || !this.overlayRef) return;\n const overlayEl = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(overlayEl);\n this.focusTrap.focusInitialElementWhenReady();\n }\n\n private destroyFocusTrap(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n this.appliedBackdrop = null;\n this.appliedScrollStrategy = null;\n this.popoverInstance = null;\n }\n\n /**\n * Aborts an in-flight close, leaving the popover open.\n *\n * `closePopover` tears the focus trap down immediately and defers only the\n * detach, so cancelling has to rebuild the trap — the overlay itself is still\n * attached and the instance still live.\n */\n private cancelPendingClose(): void {\n this.clearCloseTimer();\n this.closing = false;\n this.setupFocusTrap();\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private resolveScrollStrategy() {\n const strategy = this.twPopoverScrollStrategy();\n switch (strategy) {\n case 'close':\n return this.overlay.scrollStrategies.close();\n case 'block':\n return this.overlay.scrollStrategies.block();\n case 'noop':\n return this.overlay.scrollStrategies.noop();\n default:\n return this.overlay.scrollStrategies.reposition();\n }\n }\n\n private resolvePanelClass(): string {\n const raw = this.twPopoverPanelClass();\n return Array.isArray(raw) ? raw.join(' ') : raw;\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Convenience directive that closes the enclosing popover when the host element is clicked.\n * Place on any element inside popover content.\n *\n * ```html\n * <button twPopoverClose>Cancel</button>\n * ```\n */\n@Directive({\n selector: '[twPopoverClose]',\n host: {\n '(click)': 'closePopover()',\n '[attr.type]': '\"button\"',\n },\n})\nexport class PopoverCloseDirective {\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n protected closePopover(): void {\n this.popoverRef?.close();\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Popover title. Registers its ID with the enclosing popover overlay's\n * `aria-labelledby` queue so screen readers announce it automatically.\n *\n * Mirrors `DialogTitleDirective` and is the recommended way to label a\n * popover whose content has a heading. Use `twPopoverAriaLabel` when no\n * heading is present.\n */\n@Directive({\n selector: '[twPopoverTitle], tw-popover-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class PopoverTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-popover-title-');\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n this.popoverRef?._addAriaLabelledBy?.(this.id());\n }\n\n ngOnDestroy(): void {\n this.popoverRef?._removeAriaLabelledBy?.(this.id());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoBA;MACa,eAAe,GAAG,IAAI,cAAc,CAAU,iBAAiB;AAE5E;MACa,cAAc,GAAG,IAAI,cAAc,CAAa,gBAAgB;AAE7E;;;;;AAKG;AACI,MAAM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A,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,+BAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oCAAoC;AAC9C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,+BAA+B;AACtC,wBAAA,MAAM,EAAE,MAAM;AACf,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -128,7 +128,7 @@ const SOLID_RING = {
|
|
|
128
128
|
neutral: 'border-fg',
|
|
129
129
|
info: 'border-info-600',
|
|
130
130
|
success: 'border-success-600',
|
|
131
|
-
warning: 'border-warning-
|
|
131
|
+
warning: 'border-warning-border-strong',
|
|
132
132
|
error: 'border-error-600',
|
|
133
133
|
};
|
|
134
134
|
const SOLID_DOT = {
|
|
@@ -148,7 +148,7 @@ const OUTLINE_RING = {
|
|
|
148
148
|
neutral: 'border-fg',
|
|
149
149
|
info: 'border-info-600',
|
|
150
150
|
success: 'border-success-600',
|
|
151
|
-
warning: 'border-warning-
|
|
151
|
+
warning: 'border-warning-border-strong',
|
|
152
152
|
error: 'border-error-600',
|
|
153
153
|
};
|
|
154
154
|
const OUTLINE_DOT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdevhub-ngx-tw-radio.mjs","sources":["../../../projects/ngx-tw/radio/radio.ts","../../../projects/ngx-tw/radio/cdevhub-ngx-tw-radio.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n isDevMode,\n linkedSignal,\n model,\n type OnInit,\n output,\n signal,\n type Signal,\n} from '@angular/core';\nimport { type ControlValueAccessor, NgControl } from '@angular/forms';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { tv } from 'tailwind-variants';\nimport {\n type ErrorStateMatcher,\n type TwColor,\n type TwSize,\n wireErrorState,\n} from '@cdevhub/ngx-tw/core';\n\n/** Visual style of the selected radio indicator. */\nexport type RadioVariant = 'solid' | 'outline';\n\n/** Layout direction of a radio group. */\nexport type RadioOrientation = 'horizontal' | 'vertical';\n\n/** Position of the label relative to the radio control. */\nexport type RadioLabelPosition = 'before' | 'after';\n\n// ── Radio tv() config ────────────────────────────────────────────\n\nconst radioVariants = tv(\n {\n slots: {\n // `items-start` aligns circleWrap with the top of the label container; combined with\n // a `min-h-N` matching the label's first-line line-height on circleWrap, the circle\n // stays centered on the first line whether the label spans one line or many.\n //\n // ── Row-height scale (selection cohort) ──────────────────────────────\n // The rendered row is `max(circleWrap, label first line)`, and the host itself is the\n // click target (`role=\"radio\"` + `tabindex` + `(click)` all sit on the root), so the\n // row IS the interactive target. It runs 16 / 20 / 24 / 28 / 32 px — five distinct\n // steps, every one on the 4px baseline of docs/vertical-rhythm.md, and identical to\n // `checkbox` and `switch`. Selection controls are glyph-scale and deliberately do NOT\n // take the pinned 24/32/36/44/48 form-row scale (vertical-rhythm.md section 4).\n //\n // The row is driven by `circleWrap` min-h, NOT by the circle glyph, which keeps its own\n // 14 / 16 / 20 / 24 / 28 scale. Driving it from circleWrap is what makes the five steps\n // survive when no label is projected.\n //\n // Because centering demands `circleWrap height == label first-line leading`, the label\n // leading carries the same 4 / 5 / 6 / 7 / 8 progression. That is forced, not chosen:\n // the label font scale has only three steps (text-xs, text-sm, text-base), so leading\n // is the only lever that can break the sm/md and lg/xl ties. Before this, sm and md\n // both rendered a 20px row — a dead step. Accepted cost: `text-base leading-8` at xl is\n // a 2.0 line ratio, looser than typographic ideal on a wrapped multi-line label.\n root: 'inline-flex items-start gap-3 cursor-pointer select-none rounded-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n circleWrap: 'relative inline-flex items-center justify-center shrink-0',\n circle:\n 'inline-flex items-center justify-center rounded-full border bg-surface transition-colors duration-normal motion-reduce:transition-none',\n dotWrap:\n 'inline-flex items-center justify-center pointer-events-none',\n dot: 'inline-block rounded-full',\n labelWrap: 'flex flex-col min-w-0 empty:hidden',\n label: 'font-medium text-fg empty:hidden',\n description: 'text-fg-muted empty:hidden',\n },\n variants: {\n size: {\n xs: {\n // `size-3.5` half-step: aligns with text-xs/leading-4 row metric.\n circle: 'size-3.5',\n // The dot runs 6 / 8 / 10 / 12 / 14px — it is NOT on the status-dot sub-scale of\n // CLAUDE.md (that one is for standalone presence pips). It is a proportional inner\n // selection mark, held at ~50% of the enclosing circle at every size, so its value\n // is derived from `circle` rather than picked off a table. At xs, 50% of a 14px\n // circle is 7px, which no utility expresses; `size-1.5` (6px) is the nearest step\n // down — rounding up to 8px would leave under 3px of ring on each side.\n dot: 'size-1.5',\n circleWrap: 'min-h-4',\n label: 'text-xs leading-4',\n description: 'text-2xs leading-4',\n },\n sm: {\n circle: 'size-4',\n dot: 'size-2',\n circleWrap: 'min-h-5',\n label: 'text-sm leading-5',\n description: 'text-xs leading-4',\n },\n md: {\n circle: 'size-5',\n dot: 'size-2.5',\n // 24px row. `text-sm` is shared with sm by the documented font scale, so the\n // leading breaks the tie: leading-6 lifts the row off sm's 20px.\n circleWrap: 'min-h-6',\n label: 'text-sm leading-6',\n description: 'text-xs leading-4',\n },\n lg: {\n circle: 'size-6',\n dot: 'size-3',\n // 28px row — leading-7 keeps the first label line the same height as circleWrap.\n circleWrap: 'min-h-7',\n label: 'text-base leading-7',\n description: 'text-sm leading-5',\n },\n xl: {\n circle: 'size-7',\n // xl density: dot uses `size-3.5` (14px) as the proportionally-sized\n // selection mark inside the size-7 (28px) circle — exactly 50%.\n dot: 'size-3.5',\n // 32px row. `text-base` is shared with lg, so leading-8 breaks that tie the same\n // way leading-6 breaks sm/md. A 2.0 ratio on a wrapped label is the accepted cost.\n circleWrap: 'min-h-8',\n label: 'text-base leading-8',\n description: 'text-sm leading-5',\n },\n },\n labelPosition: {\n before: { root: 'flex-row-reverse' },\n after: { root: 'flex-row' },\n },\n checked: {\n true: { circle: '' },\n false: { circle: 'border-border hover:border-border-strong' },\n },\n disabled: {\n true: { root: 'opacity-50 pointer-events-none cursor-not-allowed' },\n false: { root: '' },\n },\n errorState: {\n true: { circle: '', label: 'text-error-700', description: 'text-error-600' },\n false: { circle: '', label: '', description: '' },\n },\n },\n compoundVariants: [\n // Error state on an unchecked radio repaints the ring with the error color.\n { errorState: true, checked: false, class: { circle: 'border-error-500 hover:border-error-600' } },\n ],\n defaultVariants: {\n size: 'md',\n labelPosition: 'after',\n checked: false,\n disabled: false,\n errorState: false,\n },\n },\n { twMerge: true },\n);\n\n// ── Static selected-state color lookups (all classes written statically for Tailwind v4 scanning) ──\n\nconst SOLID_RING: Record<TwColor, string> = {\n primary: 'border-primary-600',\n secondary: 'border-secondary-600',\n accent: 'border-accent-600',\n neutral: 'border-fg',\n info: 'border-info-600',\n success: 'border-success-600',\n warning: 'border-warning-500',\n error: 'border-error-600',\n};\n\nconst SOLID_DOT: Record<TwColor, string> = {\n primary: 'bg-primary-600',\n secondary: 'bg-secondary-600',\n accent: 'bg-accent-600',\n neutral: 'bg-fg',\n info: 'bg-info-600',\n success: 'bg-success-600',\n warning: 'bg-warning-500',\n error: 'bg-error-600',\n};\n\nconst OUTLINE_RING: Record<TwColor, string> = {\n primary: 'border-primary-600',\n secondary: 'border-secondary-600',\n accent: 'border-accent-600',\n neutral: 'border-fg',\n info: 'border-info-600',\n success: 'border-success-600',\n warning: 'border-warning-500',\n error: 'border-error-600',\n};\n\nconst OUTLINE_DOT: Record<TwColor, string> = {\n primary: 'bg-primary-600',\n secondary: 'bg-secondary-600',\n accent: 'bg-accent-600',\n neutral: 'bg-fg',\n info: 'bg-info-600',\n success: 'bg-success-600',\n warning: 'bg-warning-500',\n error: 'bg-error-600',\n};\n\nlet nextRadioId = 0;\n\n// ── RadioComponent ───────────────────────────────────────────────\n\n@Component({\n selector: 'tw-radio',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <span [class]=\"circleWrapClasses()\">\n <span [class]=\"circleClasses()\">\n @if (isSelected()) {\n <span [class]=\"dotWrapClasses()\" animate.enter=\"check-in\">\n <ng-content select=\"[slot='dot']\">\n <span [class]=\"dotClasses()\"></span>\n </ng-content>\n </span>\n }\n </span>\n </span>\n\n <span [class]=\"labelWrapClasses()\">\n <span [id]=\"labelId\" [class]=\"labelClasses()\">\n <ng-content />\n @if (label()) {\n {{ label() }}\n }\n </span>\n <span [id]=\"descriptionId\" [class]=\"descriptionClasses()\">\n <ng-content select=\"[slot='description']\" />\n @if (description()) {\n {{ description() }}\n }\n </span>\n </span>\n `,\n host: {\n 'role': 'radio',\n '[id]': 'hostId',\n '[class]': 'rootClasses()',\n '[attr.data-checked]': 'isSelected()',\n '[attr.aria-checked]': 'isSelected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[attr.aria-invalid]': 'errorState() || null',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'effectiveAriaLabelledby() || null',\n '[attr.aria-describedby]': 'effectiveAriaDescribedby() || null',\n '[attr.tabindex]': 'isFocusable() ? 0 : -1',\n '[attr.name]': 'effectiveName() || null',\n '(click)': 'onActivate()',\n '(keydown)': 'onKeydown($event)',\n '(blur)': 'onBlur()',\n },\n})\nexport class RadioComponent implements ControlValueAccessor, OnInit {\n /** The value this radio contributes when selected inside a `tw-radio-group`. Required when nested in a group; ignored when used standalone. Defaults to `undefined`. */\n readonly value = input<unknown>(undefined);\n\n /** Overrides the parent group's color for this radio. When undefined, inherits from the group (or defaults to `'primary'` standalone). */\n readonly color = input<TwColor | undefined>(undefined);\n\n /** Overrides the parent group's size for this radio. When undefined, inherits from the group (or defaults to `'md'` standalone). */\n readonly size = input<TwSize | undefined>(undefined);\n\n /** Overrides the parent group's variant for this radio. When undefined, inherits from the group (or defaults to `'solid'` standalone). */\n readonly variant = input<RadioVariant | undefined>(undefined);\n\n /** When true, disables this radio regardless of the group's state. Group-disabled always wins as an OR. Defaults to `false`. */\n readonly disabled = input(false);\n\n /** Optional inline label rendered next to the radio. Use default content projection for rich label content instead. */\n readonly label = input<string | undefined>(undefined);\n\n /** Optional secondary description rendered under the label. Use `[slot=\"description\"]` content projection for rich content instead. */\n readonly description = input<string | undefined>(undefined);\n\n /** Position of the label/description relative to the radio. Defaults to `'after'`. */\n readonly labelPosition = input<RadioLabelPosition>('after');\n\n /** Optional name attribute for standalone use. Ignored when the parent group provides a name. */\n readonly name = input<string | undefined>(undefined);\n\n /** Accessible name when no visible label is provided. Mirrored to `aria-label`. Defaults to `undefined`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** ID of an external element that labels the radio. Mirrored to `aria-labelledby`. Defaults to `undefined`. */\n readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n /** ID of an external element that describes the radio. Mirrored to `aria-describedby`. Defaults to `undefined`. */\n readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n /**\n * Two-way bound checked state. Authoritative only in standalone mode.\n * Defaults to `false`.\n *\n * Standalone, the minted `checkedChange` output is the *any-change* channel:\n * it fires both when the user selects this radio and when a bound form writes\n * into it (`FormControl.setValue`, `ngModel`, `writeValue`). `(change)` is the\n * *user-gesture-only* channel — bind that one for analytics or a confirmation\n * prompt, where a programmatic write must not count as a click.\n *\n * Inside a `tw-radio-group` this model is inert: the group owns selection,\n * the rendered state comes from the group's `value`, and the component never\n * writes `checked` — so `(checkedChange)` never fires on a grouped radio.\n * `(change)` still fires when this radio becomes the selected one. Bind the\n * group's `[(value)]` / `(change)` instead.\n */\n readonly checked = model(false);\n\n /** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the radio uses the `TW_ERROR_STATE_MATCHER` token's value. */\n readonly errorStateMatcher = input<ErrorStateMatcher | undefined>(undefined);\n\n /**\n * Fires after the checked state changes from a user interaction on this\n * radio. In grouped mode only fires when this radio becomes the selected one.\n * Does **not** fire when selection is updated programmatically via\n * `writeValue` / `FormControl.setValue` / `ngModel` — standalone, bind the\n * two-way binding's `(checkedChange)` for that, which fires on any change.\n * (Grouped, `(checkedChange)` never fires at all; use the group's\n * `[(value)]`.)\n */\n readonly change = output<boolean>();\n\n private readonly focusMonitor = inject(FocusMonitor);\n readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n private readonly parent = inject(forwardRef(() => RadioGroupComponent), { optional: true });\n private readonly ngControl = inject(NgControl, { optional: true, self: true });\n\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n private readonly cvaDisabled = signal(false);\n\n /** @internal Shared `errorState` derivation — see `wireErrorState`. */\n private readonly errorWiring = wireErrorState({\n ngControl: () => this.ngControl,\n matcher: () => this.errorStateMatcher(),\n // A radio inside a group inherits the group's error state verbatim,\n // including `false`; standalone it falls through to the matcher.\n errorStateOverride: () => (this.parent ? this.parent.errorState() : undefined),\n });\n\n private readonly uid = nextRadioId++;\n readonly hostId = `tw-radio-${this.uid}`;\n readonly labelId = `${this.hostId}-label`;\n readonly descriptionId = `${this.hostId}-description`;\n\n private readonly internalChecked = linkedSignal(() => this.checked());\n\n /** Resolved color — radio's own color wins, then group's, then `'primary'`. */\n readonly effectiveColor = computed<TwColor>(\n () => this.color() ?? this.parent?.color() ?? 'primary',\n );\n\n /** Resolved size — radio's own size wins, then group's, then `'md'`. */\n readonly effectiveSize = computed<TwSize>(\n () => this.size() ?? this.parent?.size() ?? 'md',\n );\n\n /** Resolved variant — radio's own variant wins, then group's, then `'solid'`. */\n readonly effectiveVariant = computed<RadioVariant>(\n () => this.variant() ?? this.parent?.variant() ?? 'solid',\n );\n\n /** Resolved name attribute — parent group's name wins for HTML form semantics. */\n readonly effectiveName = computed(() => this.parent?.name() ?? this.name());\n\n /** Whether this radio is currently selected (grouped: parent.value === this.value; standalone: internal checked). */\n readonly isSelected = computed(() => {\n if (this.parent) return this.parent.value() === this.value();\n return this.internalChecked();\n });\n\n /** Whether this radio is disabled (own disabled OR parent's disabled OR CVA-disabled). */\n readonly isDisabled = computed(\n () => this.disabled() || this.cvaDisabled() || (this.parent?.isDisabled() ?? false),\n );\n\n /** Whether the radio is in an error state per the configured `ErrorStateMatcher`. Inherits from the parent group when wrapped; falls back to its own NgControl when standalone. */\n readonly errorState: Signal<boolean> = this.errorWiring.errorState;\n\n /** Roving tabindex: in a group, only the selected (or first enabled if none selected) radio is focusable. Standalone radios are always focusable unless disabled. */\n readonly isFocusable = computed(() => {\n if (this.isDisabled()) return false;\n if (!this.parent) return true;\n if (this.isSelected()) return true;\n const parentValue = this.parent.value();\n if (parentValue === null || parentValue === undefined) {\n const firstEnabled = this.parent\n .radios()\n .find((r: RadioComponent) => !r.isDisabled());\n return firstEnabled === this;\n }\n return false;\n });\n\n readonly effectiveAriaLabelledby = computed(() => {\n const external = this.ariaLabelledby();\n if (external) return external;\n if (this.ariaLabel()) return undefined;\n return this.labelId;\n });\n\n readonly effectiveAriaDescribedby = computed(() => {\n const external = this.ariaDescribedby();\n if (external) return external;\n return this.descriptionId;\n });\n\n private readonly variantResult = computed(() =>\n radioVariants({\n size: this.effectiveSize(),\n labelPosition: this.labelPosition(),\n checked: this.isSelected(),\n disabled: this.isDisabled(),\n errorState: this.errorState(),\n }),\n );\n\n readonly rootClasses = computed(() => this.variantResult().root());\n readonly circleWrapClasses = computed(() => this.variantResult().circleWrap());\n readonly labelWrapClasses = computed(() => this.variantResult().labelWrap());\n readonly labelClasses = computed(() => this.variantResult().label());\n readonly descriptionClasses = computed(() => this.variantResult().description());\n readonly dotWrapClasses = computed(() => this.variantResult().dotWrap());\n\n readonly circleClasses = computed(() => {\n const base = this.variantResult().circle();\n if (!this.isSelected()) return base;\n const ringLookup = this.effectiveVariant() === 'solid' ? SOLID_RING : OUTLINE_RING;\n return `${base} ${ringLookup[this.effectiveColor()]}`;\n });\n\n readonly dotClasses = computed(() => {\n const base = this.variantResult().dot();\n const dotLookup = this.effectiveVariant() === 'solid' ? SOLID_DOT : OUTLINE_DOT;\n return `${base} ${dotLookup[this.effectiveColor()]}`;\n });\n\n constructor() {\n // Material-style CVA wiring for standalone `<tw-radio>` use. Mirrors\n // `checkbox.ts` / `slider.ts` — avoids the circular-DI a static\n // `NG_VALUE_ACCESSOR` provider would create when `NgControl` is injected\n // with `self: true` on the same element. When this radio is wrapped in a\n // `tw-radio-group`, the group owns CVA and child `NgControl` bindings are\n // not expected (no `[(ngModel)]` on children).\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n afterNextRender(() => {\n if (isDevMode() && !this.hasAccessibleNameHint()) {\n console.warn(\n '[tw-radio] The radio has no accessible name. Provide a `label` input, project label content, or set `aria-label` / `aria-labelledby`.',\n );\n }\n });\n }\n\n /** Called by user click or group keyboard handler. Selects this radio. */\n onActivate(): void {\n if (this.isDisabled()) return;\n if (this.parent) {\n const wasSelected = this.isSelected();\n this.parent.selectValue(this.value());\n if (!wasSelected) {\n this.change.emit(true);\n }\n return;\n }\n // Standalone — match native <input type=\"radio\">: clicking does not toggle back off\n if (!this.internalChecked()) {\n this.internalChecked.set(true);\n this.checked.set(true);\n this.onChange(true);\n // Deliberately NOT `onTouched()` — that is the blur notification, and\n // `onBlur()` owns it. See the note on `RadioGroupComponent.selectValue`.\n this.change.emit(true);\n }\n }\n\n /** Handles keyboard activation. Space selects; Enter does NOT — matches native `<input type=\"radio\">` semantics. */\n onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) return;\n if (event.key === ' ' || event.key === 'Spacebar') {\n event.preventDefault();\n this.onActivate();\n }\n }\n\n /** @internal Host blur. In a group, notifies the group's CVA touched callback; standalone, notifies the local CVA. */\n onBlur(): void {\n if (this.parent) {\n this.parent.notifyTouched();\n } else {\n this.onTouched();\n // Blur flips `touched` on `NgControl`; bump the revision so `errorState` recomputes.\n this.errorWiring.bump();\n }\n }\n\n /** Focuses the host element. Required for keyboard navigation from the group. */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n // ── ControlValueAccessor (standalone use) ──\n\n writeValue(value: boolean | null | undefined): void {\n const next = !!value;\n this.internalChecked.set(next);\n this.checked.set(next);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n ngOnInit(): void {\n this.focusMonitor.monitor(this.elementRef);\n this.destroyRef.onDestroy(() => {\n this.focusMonitor.stopMonitoring(this.elementRef);\n });\n\n // Track validator status/value changes on a bound NgControl so `errorState`\n // re-evaluates when status flips. Mirrors `input.ts`'s pattern.\n this.errorWiring.connect();\n }\n\n private hasAccessibleNameHint(): boolean {\n if (this.label() || this.ariaLabel() || this.ariaLabelledby()) return true;\n const host = this.elementRef.nativeElement;\n return host.textContent !== null && host.textContent.trim().length > 0;\n }\n}\n\n// ── RadioGroup tv() config ───────────────────────────────────────\n\nconst radioGroupVariants = tv(\n {\n base: 'flex',\n variants: {\n orientation: {\n vertical: 'flex-col gap-2',\n horizontal: 'flex-row flex-wrap gap-3',\n },\n disabled: {\n true: 'opacity-50 pointer-events-none cursor-not-allowed',\n false: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n disabled: false,\n },\n },\n { twMerge: true },\n);\n\nlet nextGroupId = 0;\n\n// ── RadioGroupComponent ──────────────────────────────────────────\n\n@Component({\n selector: 'tw-radio-group',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />`,\n host: {\n 'role': 'radiogroup',\n '[id]': 'hostId',\n '[class]': 'rootClasses()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[attr.aria-required]': 'required() || null',\n '[attr.aria-invalid]': 'errorState() || null',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'ariaLabelledby() || null',\n '[attr.aria-describedby]': 'ariaDescribedby() || null',\n '(keydown)': 'onKeydown($event)',\n },\n})\n/**\n * A keyboard-navigable group of `<tw-radio>` children with shared color, size,\n * variant, and an owned selected `value`. The `T` type parameter is the type\n * of each radio's `value` input — typically a string-literal union, but any\n * value that compares with `===` works. Inferred when consumers bind via\n * `[(value)]`; explicit on `[formControl]` of `FormControl<T | null>`.\n */\nexport class RadioGroupComponent<T = unknown> implements ControlValueAccessor, OnInit {\n /** Sets the semantic color applied to the selected radio's dot/ring. Propagated to children unless a child overrides it. Defaults to `'primary'`. */\n readonly color = input<TwColor>('primary');\n\n /** Controls the overall scale of radios inside the group. Propagated to children unless a child overrides it. Defaults to `'md'`. */\n readonly size = input<TwSize>('md');\n\n /** Visual style of the selected indicator. `'solid'` fills the dot with the color against a colored ring; `'outline'` keeps a transparent fill with a colored ring and colored dot. Propagated to children unless a child overrides it. Defaults to `'solid'`. */\n readonly variant = input<RadioVariant>('solid');\n\n /** Layout direction of the group. Sets `aria-orientation` and the visual axis; both arrow-key pairs navigate in either orientation, per WAI-ARIA APG. Defaults to `'vertical'`. */\n readonly orientation = input<RadioOrientation>('vertical');\n\n /** When true, disables every radio in the group and blocks keyboard interaction. Defaults to `false`. */\n readonly disabled = input(false);\n\n /** When true, sets `aria-required=\"true\"` on the group for assistive tech. Also inferred from `Validators.required` on a bound control, so a reactive/template-driven form does not have to state it twice. Defaults to `false`. */\n readonly requiredInput = input(false, { alias: 'required' });\n\n /**\n * @internal Shared `errorState` / `required` / `errors` derivation — see\n * `wireErrorState`. Declared here, above `required`, because class field\n * initializers run in declaration order.\n */\n private readonly errorWiring = wireErrorState({\n ngControl: () => this.ngControl,\n matcher: () => this.errorStateMatcher(),\n required: () => this.requiredInput(),\n });\n\n /**\n * @internal Resolved required state: the `required` input OR'd with\n * `Validators.required` on a bound `NgControl`.\n */\n readonly required: Signal<boolean> = this.errorWiring.required;\n\n /** Optional form-association name. Propagated to each child radio's host `name` attribute so standard HTML form semantics still apply. */\n readonly name = input<string | undefined>(undefined);\n\n /** Accessible name for the group when no visible label is provided. Mirrored to `aria-label`. Defaults to `undefined`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** ID of an external element that labels the group. Mirrored to `aria-labelledby`. Defaults to `undefined`. */\n readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n /** ID of an external element that describes the group. Mirrored to `aria-describedby`. Defaults to `undefined`. */\n readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n /**\n * Two-way bound selected value. `null` means no selection. Defaults to\n * `null`.\n *\n * The two-way binding mints a `valueChange` output. That output is the\n * *any-change* channel: it fires when the user picks a radio **and** when a\n * bound form writes into the group (`FormControl.setValue`, `ngModel`,\n * `writeValue`). `(change)` is the *user-gesture-only* channel — bind that\n * one for analytics or a confirmation prompt, where a programmatic write must\n * not count as a click. Writing back into the same form from a\n * `(valueChange)` handler will echo.\n */\n readonly value = model<T | null>(null);\n\n /** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the group uses the `TW_ERROR_STATE_MATCHER` token's value. */\n readonly errorStateMatcher = input<ErrorStateMatcher | undefined>(undefined);\n\n /**\n * Fires after the selected value changes from a user interaction. Does\n * **not** fire when the value is updated programmatically via `writeValue` /\n * `FormControl.setValue` / `ngModel` — for those, bind the two-way binding's\n * `(valueChange)` instead, which fires on any change.\n */\n readonly change = output<T | null>();\n\n /** @internal Child radios discovered via content projection. */\n readonly radios = contentChildren(RadioComponent, { descendants: true });\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n private readonly ngControl = inject(NgControl, { optional: true, self: true });\n\n readonly hostId = `tw-radio-group-${nextGroupId++}`;\n\n private onChange: (value: T | null) => void = () => {};\n private onTouched: () => void = () => {};\n private readonly cvaDisabled = signal(false);\n\n /** Effective disabled state — input OR CVA disabled. */\n readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n\n /** Group-level error state per the configured `ErrorStateMatcher`. Reads the bound `NgControl.invalid` through the matcher; child radios inherit from this when wrapped in the group. */\n readonly errorState: Signal<boolean> = this.errorWiring.errorState;\n\n readonly activeValue = linkedSignal(() => this.value());\n\n private readonly variantResult = computed(() =>\n radioGroupVariants({\n orientation: this.orientation(),\n disabled: this.isDisabled(),\n }),\n );\n\n readonly rootClasses = computed(() => this.variantResult());\n\n constructor() {\n // Material-style CVA wiring: declare ourselves as the value accessor on any\n // host-level `NgControl` (FormControlDirective, NgModel, etc.). This avoids\n // the circular-DI that a static `NG_VALUE_ACCESSOR` provider would create\n // because `NgControl` is injected with `self: true` on the same element.\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n afterNextRender(() => {\n if (isDevMode() && !this.ariaLabel() && !this.ariaLabelledby()) {\n console.warn(\n '[tw-radio-group] The radiogroup has no accessible name. Set `aria-label` or `aria-labelledby`.',\n );\n }\n });\n }\n\n /** Selects the given value from a user interaction. Updates the model and notifies forms. */\n selectValue(next: unknown): void {\n if (this.isDisabled()) return;\n const typed = next as T | null;\n if (typed === this.activeValue()) {\n return;\n }\n this.activeValue.set(typed);\n this.value.set(typed);\n this.onChange(typed);\n // Deliberately NOT `onTouched()`. Angular's CVA contract registers\n // `onTouched` as the BLUR notification; calling it on selection flipped\n // `touched` with no blur, so a consumer staging error display on `touched`\n // got different behaviour from `tw-radio-group` than from `tw-slider` /\n // `tw-input`. `notifyTouched()` — reached from a child radio's real blur —\n // is the only place that fires it.\n this.change.emit(typed);\n }\n\n /** @internal Called by child radios on blur — propagates to CVA onTouched and bumps the errorState revision so a blur on a child radio refreshes the group's `aria-invalid`. */\n notifyTouched(): void {\n this.onTouched();\n this.errorWiring.bump();\n }\n\n /** @internal Handles roving-focus keyboard navigation (Arrow keys, Space) across the radios in the group. */\n onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) return;\n const radios = this.radios();\n if (radios.length === 0) return;\n\n const enabledCount = radios.reduce(\n (count, r) => (r.isDisabled() ? count : count + 1),\n 0,\n );\n if (enabledCount === 0) return;\n\n const currentIdx = radios.findIndex(\n (r: RadioComponent) => r.value() === this.activeValue(),\n );\n const startIdx = currentIdx >= 0 ? currentIdx : this.firstEnabledIndex(radios);\n\n let targetIndex = -1;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n targetIndex = this.findNextEnabledIndex(radios, startIdx, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n targetIndex = this.findNextEnabledIndex(radios, startIdx, -1);\n break;\n case 'Home':\n targetIndex = this.firstEnabledIndex(radios);\n break;\n case 'End':\n targetIndex = this.lastEnabledIndex(radios);\n break;\n default:\n return;\n }\n\n if (targetIndex >= 0) {\n event.preventDefault();\n const target = radios[targetIndex];\n this.selectValue(target.value());\n target.focus();\n }\n }\n\n private findNextEnabledIndex(\n radios: readonly RadioComponent[],\n from: number,\n direction: 1 | -1,\n ): number {\n const len = radios.length;\n let idx = from;\n for (let i = 0; i < len; i++) {\n idx = (idx + direction + len) % len;\n if (!radios[idx].isDisabled()) return idx;\n }\n return -1;\n }\n\n private firstEnabledIndex(radios: readonly RadioComponent[]): number {\n for (let i = 0; i < radios.length; i++) {\n if (!radios[i].isDisabled()) return i;\n }\n return -1;\n }\n\n private lastEnabledIndex(radios: readonly RadioComponent[]): number {\n for (let i = radios.length - 1; i >= 0; i--) {\n if (!radios[i].isDisabled()) return i;\n }\n return -1;\n }\n\n // ── ControlValueAccessor ──\n\n writeValue(value: T | null): void {\n this.activeValue.set(value);\n this.value.set(value ?? null);\n }\n\n registerOnChange(fn: (value: T | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n ngOnInit(): void {\n this.focusMonitor.monitor(this.elementRef);\n this.destroyRef.onDestroy(() => {\n this.focusMonitor.stopMonitoring(this.elementRef);\n });\n\n // NgControl's `control` is set by the parent FormControl* directive before\n // children's `ngOnInit`. Subscribe here so errorState reacts to status/value\n // changes on the bound control.\n this.errorWiring.connect();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAsCA;AAEA,MAAM,aAAa,GAAG,EAAE,CACtB;AACE,IAAA,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;AAuBL,QAAA,IAAI,EAAE,8JAA8J;AACpK,QAAA,UAAU,EAAE,2DAA2D;AACvE,QAAA,MAAM,EACJ,wIAAwI;AAC1I,QAAA,OAAO,EACL,6DAA6D;AAC/D,QAAA,GAAG,EAAE,2BAA2B;AAChC,QAAA,SAAS,EAAE,oCAAoC;AAC/C,QAAA,KAAK,EAAE,kCAAkC;AACzC,QAAA,WAAW,EAAE,4BAA4B;AAC1C,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE;;AAEF,gBAAA,MAAM,EAAE,UAAU;;;;;;;AAOlB,gBAAA,GAAG,EAAE,UAAU;AACf,gBAAA,UAAU,EAAE,SAAS;AACrB,gBAAA,KAAK,EAAE,mBAAmB;AAC1B,gBAAA,WAAW,EAAE,oBAAoB;AAClC,aAAA;AACD,YAAA,EAAE,EAAE;AACF,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,GAAG,EAAE,QAAQ;AACb,gBAAA,UAAU,EAAE,SAAS;AACrB,gBAAA,KAAK,EAAE,mBAAmB;AAC1B,gBAAA,WAAW,EAAE,mBAAmB;AACjC,aAAA;AACD,YAAA,EAAE,EAAE;AACF,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,GAAG,EAAE,UAAU;;;AAGf,gBAAA,UAAU,EAAE,SAAS;AACrB,gBAAA,KAAK,EAAE,mBAAmB;AAC1B,gBAAA,WAAW,EAAE,mBAAmB;AACjC,aAAA;AACD,YAAA,EAAE,EAAE;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AA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,cAAc,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACnqBzE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cdevhub-ngx-tw-radio.mjs","sources":["../../../projects/ngx-tw/radio/radio.ts","../../../projects/ngx-tw/radio/cdevhub-ngx-tw-radio.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n forwardRef,\n inject,\n input,\n isDevMode,\n linkedSignal,\n model,\n type OnInit,\n output,\n signal,\n type Signal,\n} from '@angular/core';\nimport { type ControlValueAccessor, NgControl } from '@angular/forms';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { tv } from 'tailwind-variants';\nimport {\n type ErrorStateMatcher,\n type TwColor,\n type TwSize,\n wireErrorState,\n} from '@cdevhub/ngx-tw/core';\n\n/** Visual style of the selected radio indicator. */\nexport type RadioVariant = 'solid' | 'outline';\n\n/** Layout direction of a radio group. */\nexport type RadioOrientation = 'horizontal' | 'vertical';\n\n/** Position of the label relative to the radio control. */\nexport type RadioLabelPosition = 'before' | 'after';\n\n// ── Radio tv() config ────────────────────────────────────────────\n\nconst radioVariants = tv(\n {\n slots: {\n // `items-start` aligns circleWrap with the top of the label container; combined with\n // a `min-h-N` matching the label's first-line line-height on circleWrap, the circle\n // stays centered on the first line whether the label spans one line or many.\n //\n // ── Row-height scale (selection cohort) ──────────────────────────────\n // The rendered row is `max(circleWrap, label first line)`, and the host itself is the\n // click target (`role=\"radio\"` + `tabindex` + `(click)` all sit on the root), so the\n // row IS the interactive target. It runs 16 / 20 / 24 / 28 / 32 px — five distinct\n // steps, every one on the 4px baseline of docs/vertical-rhythm.md, and identical to\n // `checkbox` and `switch`. Selection controls are glyph-scale and deliberately do NOT\n // take the pinned 24/32/36/44/48 form-row scale (vertical-rhythm.md section 4).\n //\n // The row is driven by `circleWrap` min-h, NOT by the circle glyph, which keeps its own\n // 14 / 16 / 20 / 24 / 28 scale. Driving it from circleWrap is what makes the five steps\n // survive when no label is projected.\n //\n // Because centering demands `circleWrap height == label first-line leading`, the label\n // leading carries the same 4 / 5 / 6 / 7 / 8 progression. That is forced, not chosen:\n // the label font scale has only three steps (text-xs, text-sm, text-base), so leading\n // is the only lever that can break the sm/md and lg/xl ties. Before this, sm and md\n // both rendered a 20px row — a dead step. Accepted cost: `text-base leading-8` at xl is\n // a 2.0 line ratio, looser than typographic ideal on a wrapped multi-line label.\n root: 'inline-flex items-start gap-3 cursor-pointer select-none rounded-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n circleWrap: 'relative inline-flex items-center justify-center shrink-0',\n circle:\n 'inline-flex items-center justify-center rounded-full border bg-surface transition-colors duration-normal motion-reduce:transition-none',\n dotWrap:\n 'inline-flex items-center justify-center pointer-events-none',\n dot: 'inline-block rounded-full',\n labelWrap: 'flex flex-col min-w-0 empty:hidden',\n label: 'font-medium text-fg empty:hidden',\n description: 'text-fg-muted empty:hidden',\n },\n variants: {\n size: {\n xs: {\n // `size-3.5` half-step: aligns with text-xs/leading-4 row metric.\n circle: 'size-3.5',\n // The dot runs 6 / 8 / 10 / 12 / 14px — it is NOT on the status-dot sub-scale of\n // CLAUDE.md (that one is for standalone presence pips). It is a proportional inner\n // selection mark, held at ~50% of the enclosing circle at every size, so its value\n // is derived from `circle` rather than picked off a table. At xs, 50% of a 14px\n // circle is 7px, which no utility expresses; `size-1.5` (6px) is the nearest step\n // down — rounding up to 8px would leave under 3px of ring on each side.\n dot: 'size-1.5',\n circleWrap: 'min-h-4',\n label: 'text-xs leading-4',\n description: 'text-2xs leading-4',\n },\n sm: {\n circle: 'size-4',\n dot: 'size-2',\n circleWrap: 'min-h-5',\n label: 'text-sm leading-5',\n description: 'text-xs leading-4',\n },\n md: {\n circle: 'size-5',\n dot: 'size-2.5',\n // 24px row. `text-sm` is shared with sm by the documented font scale, so the\n // leading breaks the tie: leading-6 lifts the row off sm's 20px.\n circleWrap: 'min-h-6',\n label: 'text-sm leading-6',\n description: 'text-xs leading-4',\n },\n lg: {\n circle: 'size-6',\n dot: 'size-3',\n // 28px row — leading-7 keeps the first label line the same height as circleWrap.\n circleWrap: 'min-h-7',\n label: 'text-base leading-7',\n description: 'text-sm leading-5',\n },\n xl: {\n circle: 'size-7',\n // xl density: dot uses `size-3.5` (14px) as the proportionally-sized\n // selection mark inside the size-7 (28px) circle — exactly 50%.\n dot: 'size-3.5',\n // 32px row. `text-base` is shared with lg, so leading-8 breaks that tie the same\n // way leading-6 breaks sm/md. A 2.0 ratio on a wrapped label is the accepted cost.\n circleWrap: 'min-h-8',\n label: 'text-base leading-8',\n description: 'text-sm leading-5',\n },\n },\n labelPosition: {\n before: { root: 'flex-row-reverse' },\n after: { root: 'flex-row' },\n },\n checked: {\n true: { circle: '' },\n false: { circle: 'border-border hover:border-border-strong' },\n },\n disabled: {\n true: { root: 'opacity-50 pointer-events-none cursor-not-allowed' },\n false: { root: '' },\n },\n errorState: {\n true: { circle: '', label: 'text-error-700', description: 'text-error-600' },\n false: { circle: '', label: '', description: '' },\n },\n },\n compoundVariants: [\n // Error state on an unchecked radio repaints the ring with the error color.\n { errorState: true, checked: false, class: { circle: 'border-error-500 hover:border-error-600' } },\n ],\n defaultVariants: {\n size: 'md',\n labelPosition: 'after',\n checked: false,\n disabled: false,\n errorState: false,\n },\n },\n { twMerge: true },\n);\n\n// ── Static selected-state color lookups (all classes written statically for Tailwind v4 scanning) ──\n\nconst SOLID_RING: Record<TwColor, string> = {\n primary: 'border-primary-600',\n secondary: 'border-secondary-600',\n accent: 'border-accent-600',\n neutral: 'border-fg',\n info: 'border-info-600',\n success: 'border-success-600',\n warning: 'border-warning-border-strong',\n error: 'border-error-600',\n};\n\nconst SOLID_DOT: Record<TwColor, string> = {\n primary: 'bg-primary-600',\n secondary: 'bg-secondary-600',\n accent: 'bg-accent-600',\n neutral: 'bg-fg',\n info: 'bg-info-600',\n success: 'bg-success-600',\n warning: 'bg-warning-500',\n error: 'bg-error-600',\n};\n\nconst OUTLINE_RING: Record<TwColor, string> = {\n primary: 'border-primary-600',\n secondary: 'border-secondary-600',\n accent: 'border-accent-600',\n neutral: 'border-fg',\n info: 'border-info-600',\n success: 'border-success-600',\n warning: 'border-warning-border-strong',\n error: 'border-error-600',\n};\n\nconst OUTLINE_DOT: Record<TwColor, string> = {\n primary: 'bg-primary-600',\n secondary: 'bg-secondary-600',\n accent: 'bg-accent-600',\n neutral: 'bg-fg',\n info: 'bg-info-600',\n success: 'bg-success-600',\n warning: 'bg-warning-500',\n error: 'bg-error-600',\n};\n\nlet nextRadioId = 0;\n\n// ── RadioComponent ───────────────────────────────────────────────\n\n@Component({\n selector: 'tw-radio',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <span [class]=\"circleWrapClasses()\">\n <span [class]=\"circleClasses()\">\n @if (isSelected()) {\n <span [class]=\"dotWrapClasses()\" animate.enter=\"check-in\">\n <ng-content select=\"[slot='dot']\">\n <span [class]=\"dotClasses()\"></span>\n </ng-content>\n </span>\n }\n </span>\n </span>\n\n <span [class]=\"labelWrapClasses()\">\n <span [id]=\"labelId\" [class]=\"labelClasses()\">\n <ng-content />\n @if (label()) {\n {{ label() }}\n }\n </span>\n <span [id]=\"descriptionId\" [class]=\"descriptionClasses()\">\n <ng-content select=\"[slot='description']\" />\n @if (description()) {\n {{ description() }}\n }\n </span>\n </span>\n `,\n host: {\n 'role': 'radio',\n '[id]': 'hostId',\n '[class]': 'rootClasses()',\n '[attr.data-checked]': 'isSelected()',\n '[attr.aria-checked]': 'isSelected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[attr.aria-invalid]': 'errorState() || null',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'effectiveAriaLabelledby() || null',\n '[attr.aria-describedby]': 'effectiveAriaDescribedby() || null',\n '[attr.tabindex]': 'isFocusable() ? 0 : -1',\n '[attr.name]': 'effectiveName() || null',\n '(click)': 'onActivate()',\n '(keydown)': 'onKeydown($event)',\n '(blur)': 'onBlur()',\n },\n})\nexport class RadioComponent implements ControlValueAccessor, OnInit {\n /** The value this radio contributes when selected inside a `tw-radio-group`. Required when nested in a group; ignored when used standalone. Defaults to `undefined`. */\n readonly value = input<unknown>(undefined);\n\n /** Overrides the parent group's color for this radio. When undefined, inherits from the group (or defaults to `'primary'` standalone). */\n readonly color = input<TwColor | undefined>(undefined);\n\n /** Overrides the parent group's size for this radio. When undefined, inherits from the group (or defaults to `'md'` standalone). */\n readonly size = input<TwSize | undefined>(undefined);\n\n /** Overrides the parent group's variant for this radio. When undefined, inherits from the group (or defaults to `'solid'` standalone). */\n readonly variant = input<RadioVariant | undefined>(undefined);\n\n /** When true, disables this radio regardless of the group's state. Group-disabled always wins as an OR. Defaults to `false`. */\n readonly disabled = input(false);\n\n /** Optional inline label rendered next to the radio. Use default content projection for rich label content instead. */\n readonly label = input<string | undefined>(undefined);\n\n /** Optional secondary description rendered under the label. Use `[slot=\"description\"]` content projection for rich content instead. */\n readonly description = input<string | undefined>(undefined);\n\n /** Position of the label/description relative to the radio. Defaults to `'after'`. */\n readonly labelPosition = input<RadioLabelPosition>('after');\n\n /** Optional name attribute for standalone use. Ignored when the parent group provides a name. */\n readonly name = input<string | undefined>(undefined);\n\n /** Accessible name when no visible label is provided. Mirrored to `aria-label`. Defaults to `undefined`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** ID of an external element that labels the radio. Mirrored to `aria-labelledby`. Defaults to `undefined`. */\n readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n /** ID of an external element that describes the radio. Mirrored to `aria-describedby`. Defaults to `undefined`. */\n readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n /**\n * Two-way bound checked state. Authoritative only in standalone mode.\n * Defaults to `false`.\n *\n * Standalone, the minted `checkedChange` output is the *any-change* channel:\n * it fires both when the user selects this radio and when a bound form writes\n * into it (`FormControl.setValue`, `ngModel`, `writeValue`). `(change)` is the\n * *user-gesture-only* channel — bind that one for analytics or a confirmation\n * prompt, where a programmatic write must not count as a click.\n *\n * Inside a `tw-radio-group` this model is inert: the group owns selection,\n * the rendered state comes from the group's `value`, and the component never\n * writes `checked` — so `(checkedChange)` never fires on a grouped radio.\n * `(change)` still fires when this radio becomes the selected one. Bind the\n * group's `[(value)]` / `(change)` instead.\n */\n readonly checked = model(false);\n\n /** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the radio uses the `TW_ERROR_STATE_MATCHER` token's value. */\n readonly errorStateMatcher = input<ErrorStateMatcher | undefined>(undefined);\n\n /**\n * Fires after the checked state changes from a user interaction on this\n * radio. In grouped mode only fires when this radio becomes the selected one.\n * Does **not** fire when selection is updated programmatically via\n * `writeValue` / `FormControl.setValue` / `ngModel` — standalone, bind the\n * two-way binding's `(checkedChange)` for that, which fires on any change.\n * (Grouped, `(checkedChange)` never fires at all; use the group's\n * `[(value)]`.)\n */\n readonly change = output<boolean>();\n\n private readonly focusMonitor = inject(FocusMonitor);\n readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n private readonly parent = inject(forwardRef(() => RadioGroupComponent), { optional: true });\n private readonly ngControl = inject(NgControl, { optional: true, self: true });\n\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n private readonly cvaDisabled = signal(false);\n\n /** @internal Shared `errorState` derivation — see `wireErrorState`. */\n private readonly errorWiring = wireErrorState({\n ngControl: () => this.ngControl,\n matcher: () => this.errorStateMatcher(),\n // A radio inside a group inherits the group's error state verbatim,\n // including `false`; standalone it falls through to the matcher.\n errorStateOverride: () => (this.parent ? this.parent.errorState() : undefined),\n });\n\n private readonly uid = nextRadioId++;\n readonly hostId = `tw-radio-${this.uid}`;\n readonly labelId = `${this.hostId}-label`;\n readonly descriptionId = `${this.hostId}-description`;\n\n private readonly internalChecked = linkedSignal(() => this.checked());\n\n /** Resolved color — radio's own color wins, then group's, then `'primary'`. */\n readonly effectiveColor = computed<TwColor>(\n () => this.color() ?? this.parent?.color() ?? 'primary',\n );\n\n /** Resolved size — radio's own size wins, then group's, then `'md'`. */\n readonly effectiveSize = computed<TwSize>(\n () => this.size() ?? this.parent?.size() ?? 'md',\n );\n\n /** Resolved variant — radio's own variant wins, then group's, then `'solid'`. */\n readonly effectiveVariant = computed<RadioVariant>(\n () => this.variant() ?? this.parent?.variant() ?? 'solid',\n );\n\n /** Resolved name attribute — parent group's name wins for HTML form semantics. */\n readonly effectiveName = computed(() => this.parent?.name() ?? this.name());\n\n /** Whether this radio is currently selected (grouped: parent.value === this.value; standalone: internal checked). */\n readonly isSelected = computed(() => {\n if (this.parent) return this.parent.value() === this.value();\n return this.internalChecked();\n });\n\n /** Whether this radio is disabled (own disabled OR parent's disabled OR CVA-disabled). */\n readonly isDisabled = computed(\n () => this.disabled() || this.cvaDisabled() || (this.parent?.isDisabled() ?? false),\n );\n\n /** Whether the radio is in an error state per the configured `ErrorStateMatcher`. Inherits from the parent group when wrapped; falls back to its own NgControl when standalone. */\n readonly errorState: Signal<boolean> = this.errorWiring.errorState;\n\n /** Roving tabindex: in a group, only the selected (or first enabled if none selected) radio is focusable. Standalone radios are always focusable unless disabled. */\n readonly isFocusable = computed(() => {\n if (this.isDisabled()) return false;\n if (!this.parent) return true;\n if (this.isSelected()) return true;\n const parentValue = this.parent.value();\n if (parentValue === null || parentValue === undefined) {\n const firstEnabled = this.parent\n .radios()\n .find((r: RadioComponent) => !r.isDisabled());\n return firstEnabled === this;\n }\n return false;\n });\n\n readonly effectiveAriaLabelledby = computed(() => {\n const external = this.ariaLabelledby();\n if (external) return external;\n if (this.ariaLabel()) return undefined;\n return this.labelId;\n });\n\n readonly effectiveAriaDescribedby = computed(() => {\n const external = this.ariaDescribedby();\n if (external) return external;\n return this.descriptionId;\n });\n\n private readonly variantResult = computed(() =>\n radioVariants({\n size: this.effectiveSize(),\n labelPosition: this.labelPosition(),\n checked: this.isSelected(),\n disabled: this.isDisabled(),\n errorState: this.errorState(),\n }),\n );\n\n readonly rootClasses = computed(() => this.variantResult().root());\n readonly circleWrapClasses = computed(() => this.variantResult().circleWrap());\n readonly labelWrapClasses = computed(() => this.variantResult().labelWrap());\n readonly labelClasses = computed(() => this.variantResult().label());\n readonly descriptionClasses = computed(() => this.variantResult().description());\n readonly dotWrapClasses = computed(() => this.variantResult().dotWrap());\n\n readonly circleClasses = computed(() => {\n const base = this.variantResult().circle();\n if (!this.isSelected()) return base;\n const ringLookup = this.effectiveVariant() === 'solid' ? SOLID_RING : OUTLINE_RING;\n return `${base} ${ringLookup[this.effectiveColor()]}`;\n });\n\n readonly dotClasses = computed(() => {\n const base = this.variantResult().dot();\n const dotLookup = this.effectiveVariant() === 'solid' ? SOLID_DOT : OUTLINE_DOT;\n return `${base} ${dotLookup[this.effectiveColor()]}`;\n });\n\n constructor() {\n // Material-style CVA wiring for standalone `<tw-radio>` use. Mirrors\n // `checkbox.ts` / `slider.ts` — avoids the circular-DI a static\n // `NG_VALUE_ACCESSOR` provider would create when `NgControl` is injected\n // with `self: true` on the same element. When this radio is wrapped in a\n // `tw-radio-group`, the group owns CVA and child `NgControl` bindings are\n // not expected (no `[(ngModel)]` on children).\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n afterNextRender(() => {\n if (isDevMode() && !this.hasAccessibleNameHint()) {\n console.warn(\n '[tw-radio] The radio has no accessible name. Provide a `label` input, project label content, or set `aria-label` / `aria-labelledby`.',\n );\n }\n });\n }\n\n /** Called by user click or group keyboard handler. Selects this radio. */\n onActivate(): void {\n if (this.isDisabled()) return;\n if (this.parent) {\n const wasSelected = this.isSelected();\n this.parent.selectValue(this.value());\n if (!wasSelected) {\n this.change.emit(true);\n }\n return;\n }\n // Standalone — match native <input type=\"radio\">: clicking does not toggle back off\n if (!this.internalChecked()) {\n this.internalChecked.set(true);\n this.checked.set(true);\n this.onChange(true);\n // Deliberately NOT `onTouched()` — that is the blur notification, and\n // `onBlur()` owns it. See the note on `RadioGroupComponent.selectValue`.\n this.change.emit(true);\n }\n }\n\n /** Handles keyboard activation. Space selects; Enter does NOT — matches native `<input type=\"radio\">` semantics. */\n onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) return;\n if (event.key === ' ' || event.key === 'Spacebar') {\n event.preventDefault();\n this.onActivate();\n }\n }\n\n /** @internal Host blur. In a group, notifies the group's CVA touched callback; standalone, notifies the local CVA. */\n onBlur(): void {\n if (this.parent) {\n this.parent.notifyTouched();\n } else {\n this.onTouched();\n // Blur flips `touched` on `NgControl`; bump the revision so `errorState` recomputes.\n this.errorWiring.bump();\n }\n }\n\n /** Focuses the host element. Required for keyboard navigation from the group. */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n // ── ControlValueAccessor (standalone use) ──\n\n writeValue(value: boolean | null | undefined): void {\n const next = !!value;\n this.internalChecked.set(next);\n this.checked.set(next);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n ngOnInit(): void {\n this.focusMonitor.monitor(this.elementRef);\n this.destroyRef.onDestroy(() => {\n this.focusMonitor.stopMonitoring(this.elementRef);\n });\n\n // Track validator status/value changes on a bound NgControl so `errorState`\n // re-evaluates when status flips. Mirrors `input.ts`'s pattern.\n this.errorWiring.connect();\n }\n\n private hasAccessibleNameHint(): boolean {\n if (this.label() || this.ariaLabel() || this.ariaLabelledby()) return true;\n const host = this.elementRef.nativeElement;\n return host.textContent !== null && host.textContent.trim().length > 0;\n }\n}\n\n// ── RadioGroup tv() config ───────────────────────────────────────\n\nconst radioGroupVariants = tv(\n {\n base: 'flex',\n variants: {\n orientation: {\n vertical: 'flex-col gap-2',\n horizontal: 'flex-row flex-wrap gap-3',\n },\n disabled: {\n true: 'opacity-50 pointer-events-none cursor-not-allowed',\n false: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n disabled: false,\n },\n },\n { twMerge: true },\n);\n\nlet nextGroupId = 0;\n\n// ── RadioGroupComponent ──────────────────────────────────────────\n\n@Component({\n selector: 'tw-radio-group',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />`,\n host: {\n 'role': 'radiogroup',\n '[id]': 'hostId',\n '[class]': 'rootClasses()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-disabled]': 'isDisabled() || null',\n '[attr.aria-required]': 'required() || null',\n '[attr.aria-invalid]': 'errorState() || null',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'ariaLabelledby() || null',\n '[attr.aria-describedby]': 'ariaDescribedby() || null',\n '(keydown)': 'onKeydown($event)',\n },\n})\n/**\n * A keyboard-navigable group of `<tw-radio>` children with shared color, size,\n * variant, and an owned selected `value`. The `T` type parameter is the type\n * of each radio's `value` input — typically a string-literal union, but any\n * value that compares with `===` works. Inferred when consumers bind via\n * `[(value)]`; explicit on `[formControl]` of `FormControl<T | null>`.\n */\nexport class RadioGroupComponent<T = unknown> implements ControlValueAccessor, OnInit {\n /** Sets the semantic color applied to the selected radio's dot/ring. Propagated to children unless a child overrides it. Defaults to `'primary'`. */\n readonly color = input<TwColor>('primary');\n\n /** Controls the overall scale of radios inside the group. Propagated to children unless a child overrides it. Defaults to `'md'`. */\n readonly size = input<TwSize>('md');\n\n /** Visual style of the selected indicator. `'solid'` fills the dot with the color against a colored ring; `'outline'` keeps a transparent fill with a colored ring and colored dot. Propagated to children unless a child overrides it. Defaults to `'solid'`. */\n readonly variant = input<RadioVariant>('solid');\n\n /** Layout direction of the group. Sets `aria-orientation` and the visual axis; both arrow-key pairs navigate in either orientation, per WAI-ARIA APG. Defaults to `'vertical'`. */\n readonly orientation = input<RadioOrientation>('vertical');\n\n /** When true, disables every radio in the group and blocks keyboard interaction. Defaults to `false`. */\n readonly disabled = input(false);\n\n /** When true, sets `aria-required=\"true\"` on the group for assistive tech. Also inferred from `Validators.required` on a bound control, so a reactive/template-driven form does not have to state it twice. Defaults to `false`. */\n readonly requiredInput = input(false, { alias: 'required' });\n\n /**\n * @internal Shared `errorState` / `required` / `errors` derivation — see\n * `wireErrorState`. Declared here, above `required`, because class field\n * initializers run in declaration order.\n */\n private readonly errorWiring = wireErrorState({\n ngControl: () => this.ngControl,\n matcher: () => this.errorStateMatcher(),\n required: () => this.requiredInput(),\n });\n\n /**\n * @internal Resolved required state: the `required` input OR'd with\n * `Validators.required` on a bound `NgControl`.\n */\n readonly required: Signal<boolean> = this.errorWiring.required;\n\n /** Optional form-association name. Propagated to each child radio's host `name` attribute so standard HTML form semantics still apply. */\n readonly name = input<string | undefined>(undefined);\n\n /** Accessible name for the group when no visible label is provided. Mirrored to `aria-label`. Defaults to `undefined`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** ID of an external element that labels the group. Mirrored to `aria-labelledby`. Defaults to `undefined`. */\n readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n /** ID of an external element that describes the group. Mirrored to `aria-describedby`. Defaults to `undefined`. */\n readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n /**\n * Two-way bound selected value. `null` means no selection. Defaults to\n * `null`.\n *\n * The two-way binding mints a `valueChange` output. That output is the\n * *any-change* channel: it fires when the user picks a radio **and** when a\n * bound form writes into the group (`FormControl.setValue`, `ngModel`,\n * `writeValue`). `(change)` is the *user-gesture-only* channel — bind that\n * one for analytics or a confirmation prompt, where a programmatic write must\n * not count as a click. Writing back into the same form from a\n * `(valueChange)` handler will echo.\n */\n readonly value = model<T | null>(null);\n\n /** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the group uses the `TW_ERROR_STATE_MATCHER` token's value. */\n readonly errorStateMatcher = input<ErrorStateMatcher | undefined>(undefined);\n\n /**\n * Fires after the selected value changes from a user interaction. Does\n * **not** fire when the value is updated programmatically via `writeValue` /\n * `FormControl.setValue` / `ngModel` — for those, bind the two-way binding's\n * `(valueChange)` instead, which fires on any change.\n */\n readonly change = output<T | null>();\n\n /** @internal Child radios discovered via content projection. */\n readonly radios = contentChildren(RadioComponent, { descendants: true });\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n private readonly ngControl = inject(NgControl, { optional: true, self: true });\n\n readonly hostId = `tw-radio-group-${nextGroupId++}`;\n\n private onChange: (value: T | null) => void = () => {};\n private onTouched: () => void = () => {};\n private readonly cvaDisabled = signal(false);\n\n /** Effective disabled state — input OR CVA disabled. */\n readonly isDisabled = computed(() => this.disabled() || this.cvaDisabled());\n\n /** Group-level error state per the configured `ErrorStateMatcher`. Reads the bound `NgControl.invalid` through the matcher; child radios inherit from this when wrapped in the group. */\n readonly errorState: Signal<boolean> = this.errorWiring.errorState;\n\n readonly activeValue = linkedSignal(() => this.value());\n\n private readonly variantResult = computed(() =>\n radioGroupVariants({\n orientation: this.orientation(),\n disabled: this.isDisabled(),\n }),\n );\n\n readonly rootClasses = computed(() => this.variantResult());\n\n constructor() {\n // Material-style CVA wiring: declare ourselves as the value accessor on any\n // host-level `NgControl` (FormControlDirective, NgModel, etc.). This avoids\n // the circular-DI that a static `NG_VALUE_ACCESSOR` provider would create\n // because `NgControl` is injected with `self: true` on the same element.\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n afterNextRender(() => {\n if (isDevMode() && !this.ariaLabel() && !this.ariaLabelledby()) {\n console.warn(\n '[tw-radio-group] The radiogroup has no accessible name. Set `aria-label` or `aria-labelledby`.',\n );\n }\n });\n }\n\n /** Selects the given value from a user interaction. Updates the model and notifies forms. */\n selectValue(next: unknown): void {\n if (this.isDisabled()) return;\n const typed = next as T | null;\n if (typed === this.activeValue()) {\n return;\n }\n this.activeValue.set(typed);\n this.value.set(typed);\n this.onChange(typed);\n // Deliberately NOT `onTouched()`. Angular's CVA contract registers\n // `onTouched` as the BLUR notification; calling it on selection flipped\n // `touched` with no blur, so a consumer staging error display on `touched`\n // got different behaviour from `tw-radio-group` than from `tw-slider` /\n // `tw-input`. `notifyTouched()` — reached from a child radio's real blur —\n // is the only place that fires it.\n this.change.emit(typed);\n }\n\n /** @internal Called by child radios on blur — propagates to CVA onTouched and bumps the errorState revision so a blur on a child radio refreshes the group's `aria-invalid`. */\n notifyTouched(): void {\n this.onTouched();\n this.errorWiring.bump();\n }\n\n /** @internal Handles roving-focus keyboard navigation (Arrow keys, Space) across the radios in the group. */\n onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) return;\n const radios = this.radios();\n if (radios.length === 0) return;\n\n const enabledCount = radios.reduce(\n (count, r) => (r.isDisabled() ? count : count + 1),\n 0,\n );\n if (enabledCount === 0) return;\n\n const currentIdx = radios.findIndex(\n (r: RadioComponent) => r.value() === this.activeValue(),\n );\n const startIdx = currentIdx >= 0 ? currentIdx : this.firstEnabledIndex(radios);\n\n let targetIndex = -1;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n targetIndex = this.findNextEnabledIndex(radios, startIdx, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n targetIndex = this.findNextEnabledIndex(radios, startIdx, -1);\n break;\n case 'Home':\n targetIndex = this.firstEnabledIndex(radios);\n break;\n case 'End':\n targetIndex = this.lastEnabledIndex(radios);\n break;\n default:\n return;\n }\n\n if (targetIndex >= 0) {\n event.preventDefault();\n const target = radios[targetIndex];\n this.selectValue(target.value());\n target.focus();\n }\n }\n\n private findNextEnabledIndex(\n radios: readonly RadioComponent[],\n from: number,\n direction: 1 | -1,\n ): number {\n const len = radios.length;\n let idx = from;\n for (let i = 0; i < len; i++) {\n idx = (idx + direction + len) % len;\n if (!radios[idx].isDisabled()) return idx;\n }\n return -1;\n }\n\n private firstEnabledIndex(radios: readonly RadioComponent[]): number {\n for (let i = 0; i < radios.length; i++) {\n if (!radios[i].isDisabled()) return i;\n }\n return -1;\n }\n\n private lastEnabledIndex(radios: readonly RadioComponent[]): number {\n for (let i = radios.length - 1; i >= 0; i--) {\n if (!radios[i].isDisabled()) return i;\n }\n return -1;\n }\n\n // ── ControlValueAccessor ──\n\n writeValue(value: T | null): void {\n this.activeValue.set(value);\n this.value.set(value ?? null);\n }\n\n registerOnChange(fn: (value: T | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n\n ngOnInit(): void {\n this.focusMonitor.monitor(this.elementRef);\n this.destroyRef.onDestroy(() => {\n this.focusMonitor.stopMonitoring(this.elementRef);\n });\n\n // NgControl's `control` is set by the parent FormControl* directive before\n // children's `ngOnInit`. Subscribe here so errorState reacts to status/value\n // changes on the bound control.\n this.errorWiring.connect();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAsCA;AAEA,MAAM,aAAa,GAAG,EAAE,CACtB;AACE,IAAA,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;AAuBL,QAAA,IAAI,EAAE,8JAA8J;AACpK,QAAA,UAAU,EAAE,2DAA2D;AACvE,QAAA,MAAM,EACJ,wIAAwI;AAC1I,QAAA,OAAO,EACL,6DAA6D;AAC/D,QAAA,GAAG,EAAE,2BAA2B;AAChC,QAAA,SAAS,EAAE,oCAAoC;AAC/C,QAAA,KAAK,EAAE,kCAAkC;AACzC,QAAA,WAAW,EAAE,4BAA4B;AAC1C,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE;;AAEF,gBAAA,MAAM,EAA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