@radix-ng/primitives 1.0.2 → 1.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-panel-presence.directive.ts","../../../packages/primitives/collapsible/src/collapsible-panel.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/index.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n ModelSignal,\n output,\n signal,\n Signal,\n untracked,\n WritableSignal\n} from '@angular/core';\nimport {\n BooleanInput,\n createContext,\n injectId,\n RdxTransitionStatus,\n useTransitionStatus\n} from '@radix-ng/primitives/core';\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\nexport interface CollapsibleRootContext {\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n panelId: Signal<string>;\n /** Writable so composing primitives (Accordion) can drive the state. */\n open: ModelSignal<boolean>;\n disabled: Signal<boolean>;\n /** Open/close transition phase, for `data-starting-style` / `data-ending-style`. */\n transitionStatus: Signal<RdxTransitionStatus>;\n /** `true` while the panel should stay rendered: open, or running its exit transition. */\n mounted: Signal<boolean>;\n /**\n * Composition fallbacks. The standalone Panel inputs write here, and Accordion writes here\n * directly; the Panel reads these so both wiring paths converge on a single source of truth.\n */\n keepMounted: WritableSignal<boolean>;\n hiddenUntilFound: WritableSignal<boolean>;\n toggle: () => void;\n /** Registers the panel element whose transition duration gates the close completion. */\n registerTransitionElement: (element: HTMLElement) => () => void;\n}\n\nexport const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext<CollapsibleRootContext>(\n 'CollapsibleRootContext',\n 'components/collapsible'\n);\n\nconst rootContext = (): CollapsibleRootContext => {\n const instance = inject(RdxCollapsibleRootDirective);\n\n return {\n panelId: instance.panelId,\n open: instance.open,\n disabled: instance.disabled,\n transitionStatus: instance.transitionStatus,\n mounted: instance.mounted,\n keepMounted: instance.keepMountedContext,\n hiddenUntilFound: instance.hiddenUntilFoundContext,\n registerTransitionElement: (element) => instance.registerTransitionElement(element),\n toggle: () => {\n if (instance.disabled()) {\n return;\n }\n\n untracked(() => {\n instance.open.set(!instance.open());\n });\n\n instance.onOpenChange.emit(instance.open());\n }\n };\n};\n\n/**\n * Groups all parts of the collapsible.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'rdxCollapsibleRoot',\n providers: [provideCollapsibleRootContext(rootContext)],\n host: {\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-closed]': 'open() ? undefined : \"\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n private readonly transition = useTransitionStatus((open) => this.onOpenChangeComplete.emit(open));\n\n /** Reactive open/close transition phase (`'starting'` | `'ending'` | `undefined`). */\n readonly transitionStatus = this.transition.status;\n\n /** Registers the panel element whose transition duration gates the close completion. */\n readonly registerTransitionElement = this.transition.registerElement;\n\n /**\n * The controlled open state of the collapsible.\n * `true` - expanded, `false` - collapsed.\n *\n * @group Props\n * @defaultValue false\n */\n readonly open = model<boolean>(false);\n\n /**\n * The open state of the collapsible when it is initially rendered.\n * Use when you do not need to control its open state.\n *\n * @group Props\n * @defaultValue false\n */\n readonly defaultOpen = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the component should ignore user interaction.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n readonly panelId = input<string>(injectId('rdx-collapsible-panel-'));\n\n /** Composition fallbacks (see {@link CollapsibleRootContext}). Default `false`. */\n readonly keepMountedContext = signal(false);\n readonly hiddenUntilFoundContext = signal(false);\n\n /** `true` while the panel must stay rendered: open, or mid exit transition. */\n readonly mounted = computed(() => this.open() || this.transitionStatus() === 'ending');\n\n /**\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n\n /**\n * Event handler called after the open/close transition has finished.\n *\n * @group Emits\n */\n readonly onOpenChangeComplete = output<boolean>();\n\n private hasAppliedDefaultOpen = false;\n private previousOpen = this.open();\n\n constructor() {\n effect(() => {\n const defaultOpen = this.defaultOpen();\n\n if (!this.hasAppliedDefaultOpen && defaultOpen) {\n this.hasAppliedDefaultOpen = true;\n untracked(() => {\n this.open.set(true);\n // Treat an initially-open collapsible as settled so it doesn't play an\n // enter transition on first render.\n this.previousOpen = true;\n });\n }\n });\n\n effect(() => {\n const open = this.open();\n\n if (open !== this.previousOpen) {\n this.previousOpen = open;\n untracked(() => this.transition.start(open));\n }\n });\n }\n}\n","import { Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * Structural directive that mounts the collapsible panel contents only while open, unmounting them\n * once the exit animation finishes. Opt into this when the closed contents should leave the DOM;\n * otherwise apply `rdxCollapsiblePanel` directly (optionally with `keepMounted`).\n */\n@Directive({\n selector: 'ng-template[rdxCollapsiblePanelPresence]',\n providers: [\n provideRdxPresenceContext(() => ({\n present: injectCollapsibleRootContext().open\n }))\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCollapsiblePanelPresenceDirective {}\n","import {\n afterRenderEffect,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * Coerces a collapsible boolean input that distinguishes \"not set\" (`undefined`) from `false`,\n * so the Panel only overrides the shared context value when the consumer passes the input.\n */\nconst optionalBoolean = (value: BooleanInput | undefined): boolean | undefined =>\n value === undefined ? undefined : booleanAttribute(value);\n\n/**\n * A panel with the collapsible contents.\n */\n@Directive({\n selector: '[rdxCollapsiblePanel]',\n host: {\n '[id]': 'rootContext.panelId()',\n '[attr.data-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-closed]': 'rootContext.open() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-starting-style]': 'rootContext.transitionStatus() === \"starting\" ? \"\" : undefined',\n '[attr.data-ending-style]': 'rootContext.transitionStatus() === \"ending\" ? \"\" : undefined',\n '[attr.hidden]': 'hidden()',\n '[style.--collapsible-panel-width.px]': 'width()',\n '[style.--collapsible-panel-height.px]': 'height()'\n }\n})\nexport class RdxCollapsiblePanelDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly rootContext = injectCollapsibleRootContext();\n\n /**\n * Whether to keep the element in the DOM while the panel is closed.\n * When `true`, the closed panel keeps its element (no `hidden` attribute) so the consumer's\n * `data-closed` CSS is responsible for visually collapsing it.\n *\n * @group Props\n * @defaultValue false\n */\n readonly keepMounted = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n /**\n * Allows the browser's built-in page search to find and expand the panel contents.\n * When `true`, the closed panel uses `hidden=\"until-found\"` instead of plain `hidden`.\n *\n * @group Props\n * @defaultValue false\n */\n readonly hiddenUntilFound = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n readonly height = signal<number | null>(null);\n readonly width = signal<number | null>(null);\n\n /**\n * The `hidden` attribute value. The panel is shown while open or while its exit transition runs;\n * a kept-mounted panel stays visible (the consumer collapses it via CSS); otherwise the closed\n * panel is hidden — with `until-found` when find-in-page support is requested.\n */\n readonly hidden = computed<'' | 'until-found' | undefined>(() => {\n const visible = this.rootContext.open() || this.rootContext.transitionStatus() === 'ending';\n\n if (visible || this.rootContext.keepMounted()) {\n return undefined;\n }\n\n return this.rootContext.hiddenUntilFound() ? 'until-found' : '';\n });\n\n /**\n * The first measurement (the initial mount) must not re-enable animations, so an element that\n * mounts already open renders at its final size without playing the open animation.\n */\n private isFirstMeasure = true;\n private originalStyles?: { transitionDuration: string; animationName: string };\n\n constructor() {\n const unregister = this.rootContext.registerTransitionElement(this.elementRef.nativeElement);\n inject(DestroyRef).onDestroy(unregister);\n\n // Forward the Panel inputs into the shared context, but only when the consumer actually\n // sets them — so Accordion's context writes are never clobbered by the Panel defaults.\n effect(() => {\n const keepMounted = this.keepMounted();\n if (keepMounted !== undefined) {\n untracked(() => this.rootContext.keepMounted.set(keepMounted));\n }\n });\n\n effect(() => {\n const hiddenUntilFound = this.hiddenUntilFound();\n if (hiddenUntilFound !== undefined) {\n untracked(() => this.rootContext.hiddenUntilFound.set(hiddenUntilFound));\n }\n });\n\n // `afterRenderEffect` runs after the DOM is committed (but before paint) with the settled\n // `open` state — no `requestAnimationFrame` race — and is a no-op during SSR.\n afterRenderEffect(() => {\n // Re-measure whenever the open state flips; the panel is visible at that point (during\n // an exit it is kept rendered by the `ending` transition phase).\n this.rootContext.open();\n this.updateDimensions();\n });\n }\n\n private updateDimensions(): void {\n const node = this.elementRef.nativeElement;\n if (!node) return;\n\n this.originalStyles ??= {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n\n // Block any animation/transition so we can measure the element at its natural size.\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n // Let the element take its natural height while measuring, so a `height` bound to the very\n // variable we are computing (the Base UI collapse pattern) does not feed back into itself.\n const previousHeight = node.style.height;\n node.style.height = 'auto';\n\n const rect = node.getBoundingClientRect();\n this.height.set(rect.height);\n this.width.set(rect.width);\n\n node.style.height = previousHeight;\n\n // Re-enable the original animation, unless this is the very first (mount) measurement.\n if (!this.isFirstMeasure) {\n node.style.transitionDuration = this.originalStyles.transitionDuration;\n node.style.animationName = this.originalStyles.animationName;\n }\n\n this.isFirstMeasure = false;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * A button that opens and closes the collapsible panel.\n */\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.aria-controls]': 'rootContext.panelId()',\n '[attr.aria-expanded]': 'rootContext.open()',\n '[attr.data-panel-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() || undefined',\n\n '(click)': 'rootContext.toggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n protected readonly rootContext = injectCollapsibleRootContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCollapsiblePanelPresenceDirective } from './src/collapsible-panel-presence.directive';\nimport { RdxCollapsiblePanelDirective } from './src/collapsible-panel.directive';\nimport { RdxCollapsibleRootDirective } from './src/collapsible-root.directive';\nimport { RdxCollapsibleTriggerDirective } from './src/collapsible-trigger.directive';\n\nexport * from './src/collapsible-panel-presence.directive';\nexport * from './src/collapsible-panel.directive';\nexport * from './src/collapsible-root.directive';\nexport * from './src/collapsible-trigger.directive';\n\nconst _imports = [\n RdxCollapsiblePanelDirective,\n RdxCollapsibleRootDirective,\n RdxCollapsibleTriggerDirective,\n RdxCollapsiblePanelPresenceDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxCollapsibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA8CO,MAAM,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,GAAG,aAAa,CACtF,wBAAwB,EACxB,wBAAwB;AAG5B,MAAM,WAAW,GAAG,MAA6B;AAC7C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,2BAA2B,CAAC;IAEpD,OAAO;QACH,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,IAAI,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AAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACrBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-panel.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/index.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n ModelSignal,\n output,\n signal,\n Signal,\n untracked,\n WritableSignal\n} from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n createContext,\n injectId,\n RdxCancelableChangeEventDetails,\n RdxTransitionStatus,\n useTransitionStatus\n} from '@radix-ng/primitives/core';\n\nexport type RdxCollapsibleState = 'open' | 'closed';\nexport type RdxCollapsibleOpenChangeReason = 'trigger-press' | 'none';\nexport type RdxCollapsibleOpenChangeEventDetails = RdxCancelableChangeEventDetails<RdxCollapsibleOpenChangeReason>;\nexport interface RdxCollapsibleOpenChangeEvent {\n open: boolean;\n eventDetails: RdxCollapsibleOpenChangeEventDetails;\n}\n\nexport interface CollapsibleRootContext {\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n panelId: Signal<string>;\n /** Writable so composing primitives (Accordion) can drive the state. */\n open: ModelSignal<boolean>;\n disabled: Signal<boolean>;\n /** Open/close transition phase, for `data-starting-style` / `data-ending-style`. */\n transitionStatus: Signal<RdxTransitionStatus>;\n /** `true` while the panel should stay rendered: open, or running its exit transition. */\n mounted: Signal<boolean>;\n /**\n * Composition fallbacks. The standalone Panel inputs write here, and Accordion writes here\n * directly; the Panel reads these so both wiring paths converge on a single source of truth.\n */\n keepMounted: WritableSignal<boolean>;\n hiddenUntilFound: WritableSignal<boolean>;\n toggle: (event: Event, trigger?: HTMLElement) => void;\n setOpen: (open: boolean, reason: RdxCollapsibleOpenChangeReason, event: Event, trigger?: HTMLElement) => boolean;\n setPanelIdState: (id: string | undefined) => void;\n /** Registers the panel element whose transition duration gates the close completion. */\n registerTransitionElement: (element: HTMLElement) => () => void;\n}\n\nexport const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext<CollapsibleRootContext>(\n 'CollapsibleRootContext',\n 'components/collapsible'\n);\n\nconst rootContext = (): CollapsibleRootContext => {\n const instance = inject(RdxCollapsibleRootDirective);\n\n return {\n panelId: instance.resolvedPanelId,\n open: instance.open,\n disabled: instance.disabled,\n transitionStatus: instance.transitionStatus,\n mounted: instance.mounted,\n keepMounted: instance.keepMountedContext,\n hiddenUntilFound: instance.hiddenUntilFoundContext,\n setOpen: (open, reason, event, trigger) => instance.setOpen(open, reason, event, trigger),\n setPanelIdState: (id) => instance.setPanelIdState(id),\n registerTransitionElement: (element) => instance.registerTransitionElement(element),\n toggle: (event, trigger) => {\n if (instance.disabled()) {\n return;\n }\n\n instance.setOpen(!instance.open(), 'trigger-press', event, trigger);\n }\n };\n};\n\n/**\n * Groups all parts of the collapsible.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'rdxCollapsibleRoot',\n providers: [provideCollapsibleRootContext(rootContext)],\n host: {\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-closed]': 'open() ? undefined : \"\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n private readonly transition = useTransitionStatus((open) => this.onOpenChangeComplete.emit(open));\n\n private readonly generatedPanelId = injectId('rdx-collapsible-panel-');\n private readonly panelIdState = signal<string | undefined>(undefined);\n\n /** Reactive open/close transition phase (`'starting'` | `'ending'` | `undefined`). */\n readonly transitionStatus = this.transition.status;\n\n /** Registers the panel element whose transition duration gates the close completion. */\n readonly registerTransitionElement = this.transition.registerElement;\n\n /**\n * The controlled open state of the collapsible.\n * `true` - expanded, `false` - collapsed.\n *\n * @group Props\n * @defaultValue false\n */\n readonly open = model<boolean>(false);\n\n /**\n * The open state of the collapsible when it is initially rendered.\n * Use when you do not need to control its open state.\n *\n * @group Props\n * @defaultValue false\n */\n readonly defaultOpen = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the component should ignore user interaction.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n readonly panelId = input<string | undefined>(undefined);\n\n /** Stable id linking the trigger's `aria-controls` to the panel. */\n readonly resolvedPanelId = computed(() => this.panelIdState() ?? this.panelId() ?? this.generatedPanelId);\n\n /** Composition fallbacks (see {@link CollapsibleRootContext}). Default `false`. */\n readonly keepMountedContext = signal(false);\n readonly hiddenUntilFoundContext = signal(false);\n\n /** `true` while the panel must stay rendered: open, or mid exit transition. */\n readonly mounted = computed(() => this.open() || this.transitionStatus() === 'ending');\n\n /**\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<RdxCollapsibleOpenChangeEvent>();\n\n /**\n * Event handler called after the open/close transition has finished.\n *\n * @group Emits\n */\n readonly onOpenChangeComplete = output<boolean>();\n\n private hasAppliedDefaultOpen = false;\n private previousOpen = this.open();\n\n setPanelIdState(id: string | undefined): void {\n this.panelIdState.set(id);\n }\n\n setOpen(nextOpen: boolean, reason: RdxCollapsibleOpenChangeReason, event: Event, trigger?: HTMLElement): boolean {\n if (nextOpen === this.open()) {\n return true;\n }\n\n const { eventDetails } = createCancelableChangeEventDetails(reason, event, trigger);\n\n this.onOpenChange.emit({ open: nextOpen, eventDetails });\n\n if (eventDetails.isCanceled()) {\n return false;\n }\n\n untracked(() => {\n this.open.set(nextOpen);\n });\n\n return true;\n }\n\n constructor() {\n effect(() => {\n const defaultOpen = this.defaultOpen();\n\n if (!this.hasAppliedDefaultOpen && defaultOpen) {\n this.hasAppliedDefaultOpen = true;\n untracked(() => {\n this.open.set(true);\n // Treat an initially-open collapsible as settled so it doesn't play an\n // enter transition on first render.\n this.previousOpen = true;\n });\n }\n });\n\n effect(() => {\n const open = this.open();\n\n if (open !== this.previousOpen) {\n this.previousOpen = open;\n untracked(() => this.transition.start(open));\n }\n });\n }\n}\n","import {\n afterRenderEffect,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Renderer2,\n signal,\n untracked\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * Coerces a collapsible boolean input that distinguishes \"not set\" (`undefined`) from `false`,\n * so the Panel only overrides the shared context value when the consumer passes the input.\n */\nconst optionalBoolean = (value: BooleanInput | undefined): boolean | undefined =>\n value === undefined ? undefined : booleanAttribute(value);\n\n/**\n * A panel with the collapsible contents.\n */\n@Directive({\n selector: '[rdxCollapsiblePanel]',\n host: {\n '[id]': 'rootContext.panelId()',\n '[attr.data-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-closed]': 'rootContext.open() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-starting-style]': 'rootContext.transitionStatus() === \"starting\" ? \"\" : undefined',\n '[attr.data-ending-style]': 'rootContext.transitionStatus() === \"ending\" ? \"\" : undefined',\n '[attr.hidden]': 'hidden()',\n '[style.--collapsible-panel-width.px]': 'width()',\n '[style.--collapsible-panel-height.px]': 'height()'\n }\n})\nexport class RdxCollapsiblePanelDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly destroyRef = inject(DestroyRef);\n private readonly marker = this.renderer.createComment('rdx-collapsible-panel');\n\n private parentNode: Node | null = null;\n private isAttached = true;\n\n protected readonly rootContext = injectCollapsibleRootContext();\n\n /**\n * Optional explicit panel id. When set, the trigger's `aria-controls` points to this id.\n *\n * @group Props\n */\n readonly id = input<string | undefined>(undefined, { alias: 'id' });\n\n /**\n * Whether to keep the element in the DOM while the panel is closed.\n * When `true`, the closed panel keeps its element and receives the `hidden` attribute once the\n * close transition finishes.\n *\n * @group Props\n * @defaultValue false\n */\n readonly keepMounted = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n /**\n * Allows the browser's built-in page search to find and expand the panel contents.\n * When `true`, the closed panel uses `hidden=\"until-found\"` instead of plain `hidden`.\n *\n * @group Props\n * @defaultValue false\n */\n readonly hiddenUntilFound = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: optionalBoolean\n });\n\n readonly height = signal<number | null>(null);\n readonly width = signal<number | null>(null);\n\n /** Mirrors Base UI's `shouldRender`: hidden panels unmount unless kept for search/measurement. */\n readonly shouldRender = computed(\n () =>\n this.rootContext.keepMounted() ||\n this.rootContext.hiddenUntilFound() ||\n this.rootContext.mounted() ||\n this.rootContext.open()\n );\n\n /**\n * The `hidden` attribute value. The panel is shown while open or while its exit transition runs.\n * A kept-mounted panel remains in the DOM but is still hidden while closed.\n */\n readonly hidden = computed<'' | 'until-found' | undefined>(() => {\n const visible = this.rootContext.open() || this.rootContext.transitionStatus() === 'ending';\n\n if (visible) {\n return undefined;\n }\n\n return this.rootContext.hiddenUntilFound() ? 'until-found' : '';\n });\n\n /**\n * The first measurement (the initial mount) must not re-enable animations, so an element that\n * mounts already open renders at its final size without playing the open animation.\n */\n private isFirstMeasure = true;\n private originalStyles?: { transitionDuration: string; animationName: string };\n\n constructor() {\n const unregister = this.rootContext.registerTransitionElement(this.elementRef.nativeElement);\n this.destroyRef.onDestroy(unregister);\n\n this.insertMarker();\n\n const unlistenBeforeMatch = this.renderer.listen(\n this.elementRef.nativeElement,\n 'beforematch',\n (event: Event) => {\n this.rootContext.setOpen(true, 'none', event);\n }\n );\n\n this.destroyRef.onDestroy(() => {\n unlistenBeforeMatch();\n this.removeMarker();\n });\n\n effect(() => {\n this.rootContext.setPanelIdState(this.id());\n });\n\n this.destroyRef.onDestroy(() => {\n this.rootContext.setPanelIdState(undefined);\n });\n\n effect(() => {\n this.syncRenderedState();\n });\n\n // Forward the Panel inputs into the shared context, but only when the consumer actually\n // sets them — so Accordion's context writes are never clobbered by the Panel defaults.\n effect(() => {\n const keepMounted = this.keepMounted();\n if (keepMounted !== undefined) {\n untracked(() => this.rootContext.keepMounted.set(keepMounted));\n }\n });\n\n effect(() => {\n const hiddenUntilFound = this.hiddenUntilFound();\n if (hiddenUntilFound !== undefined) {\n untracked(() => this.rootContext.hiddenUntilFound.set(hiddenUntilFound));\n }\n });\n\n // `afterRenderEffect` runs after the DOM is committed (but before paint) with the settled\n // `open` state — no `requestAnimationFrame` race — and is a no-op during SSR.\n afterRenderEffect(() => {\n // Re-measure whenever the open state flips; the panel is visible at that point (during\n // an exit it is kept rendered by the `ending` transition phase).\n this.rootContext.open();\n this.updateDimensions();\n });\n }\n\n private insertMarker(): void {\n const host = this.elementRef.nativeElement;\n const parent = this.renderer.parentNode(host) as Node | null;\n\n if (!parent) {\n return;\n }\n\n this.parentNode = parent;\n this.renderer.insertBefore(parent, this.marker, host);\n }\n\n private removeMarker(): void {\n const parent = this.renderer.parentNode(this.marker) as Node | null;\n\n if (parent) {\n this.renderer.removeChild(parent, this.marker);\n }\n }\n\n private syncRenderedState(): void {\n const parent = this.parentNode;\n\n if (!parent) {\n return;\n }\n\n const host = this.elementRef.nativeElement;\n const shouldRender = this.shouldRender();\n\n if (shouldRender && !this.isAttached) {\n this.renderer.insertBefore(parent, host, this.renderer.nextSibling(this.marker));\n this.isAttached = true;\n return;\n }\n\n if (!shouldRender && this.isAttached) {\n this.renderer.removeChild(parent, host);\n this.isAttached = false;\n }\n }\n\n private updateDimensions(): void {\n const node = this.elementRef.nativeElement;\n if (!node) return;\n\n this.originalStyles ??= {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n\n // Block any animation/transition so we can measure the element at its natural size.\n node.style.transitionDuration = '0s';\n node.style.animationName = 'none';\n\n // Let the element take its natural height while measuring, so a `height` bound to the very\n // variable we are computing (the Base UI collapse pattern) does not feed back into itself.\n const previousHeight = node.style.height;\n node.style.height = 'auto';\n\n const rect = node.getBoundingClientRect();\n this.height.set(rect.height);\n this.width.set(rect.width);\n\n node.style.height = previousHeight;\n\n // Re-enable the original animation, unless this is the very first (mount) measurement.\n if (!this.isFirstMeasure) {\n node.style.transitionDuration = this.originalStyles.transitionDuration;\n node.style.animationName = this.originalStyles.animationName;\n }\n\n this.isFirstMeasure = false;\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n/**\n * A button that opens and closes the collapsible panel.\n */\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.aria-controls]': 'rootContext.open() ? rootContext.panelId() : undefined',\n '[attr.aria-expanded]': 'rootContext.open()',\n '[attr.data-panel-open]': 'rootContext.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.aria-disabled]': 'rootContext.disabled() ? \"true\" : undefined',\n\n '(click)': 'handleClick($event)'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly rootContext = injectCollapsibleRootContext();\n\n protected handleClick(event: MouseEvent): void {\n this.rootContext.toggle(event, this.elementRef.nativeElement);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCollapsiblePanelDirective } from './src/collapsible-panel.directive';\nimport { RdxCollapsibleRootDirective } from './src/collapsible-root.directive';\nimport { RdxCollapsibleTriggerDirective } from './src/collapsible-trigger.directive';\n\nexport * from './src/collapsible-panel.directive';\nexport * from './src/collapsible-root.directive';\nexport * from './src/collapsible-trigger.directive';\n\nconst _imports = [RdxCollapsiblePanelDirective, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxCollapsibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAwDO,MAAM,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,GAAG,aAAa,CACtF,wBAAwB,EACxB,wBAAwB;AAG5B,MAAM,WAAW,GAAG,MAA6B;AAC7C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,2BAA2B,CAAC;IAEpD,OAAO;QACH,OAAO,EAAE,QAAQ,CAAC,eAAe;QACjC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,WAAW,EAAE,QAAQ,CAAC,kBAAkB;QACxC,gBAAgB,EAAE,QAAQ,CAAC,uBAAuB;QAClD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;QACzF,eAAe,EAAE,CAAC,EAAE,KAAK,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACrD,yBAAyB,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,yBAAyB,CAAC,OAAO,CAAC;AACnF,QAAA,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAI;AACvB,YAAA,IAAI,QAAQ,CAAC,QAAQ,EAAE,EAAE;gBACrB;YACJ;AAEA,YAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC;QACvE;KACH;AACL,CAAC;AAED;;;;AAIG;MAWU,2BAA2B,CAAA;AAoEpC,IAAA,eAAe,CAAC,EAAsB,EAAA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A,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAZ1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,IAAI,EAAE;AACF,wBAAA,sBAAsB,EAAE,wDAAwD;AAChF,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,wBAAwB,EAAE,qCAAqC;AAC/D,wBAAA,sBAAsB,EAAE,yCAAyC;AACjE,wBAAA,sBAAsB,EAAE,6CAA6C;AAErE,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACRD,MAAM,QAAQ,GAAG,CAAC,4BAA4B,EAAE,2BAA2B,EAAE,8BAA8B,CAAC;MAM/F,oBAAoB,CAAA;8GAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAApB,oBAAoB,EAAA,OAAA,EAAA,CANf,4BAA4B,EAAE,2BAA2B,EAAE,8BAA8B,CAAA,EAAA,OAAA,EAAA,CAAzF,4BAA4B,EAAE,2BAA2B,EAAE,8BAA8B,CAAA,EAAA,CAAA,CAAA;+GAM9F,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACdD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Headless, signals-first UI primitives for Angular.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -1,83 +1,33 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Signal, WritableSignal, ElementRef, InputSignalWithTransform, InputSignal, ModelSignal } from '@angular/core';
2
+ import { InputSignalWithTransform, InputSignal, ModelSignal, Signal, WritableSignal, ElementRef } from '@angular/core';
3
3
  import * as _radix_ng_primitives_accordion from '@radix-ng/primitives/accordion';
4
- import * as i1 from '@radix-ng/primitives/collapsible';
5
4
  import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
6
- import { BooleanInput, DataOrientation, AcceptableValue } from '@radix-ng/primitives/core';
7
- import * as i2 from '@radix-ng/primitives/composite';
8
-
9
- declare class RdxAccordionContentDirective {
10
- protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
11
- protected readonly itemContext: _radix_ng_primitives_accordion.AccordionItemContext;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionContentDirective, never>;
13
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionContentDirective, "[rdxAccordionContent]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxCollapsiblePanelDirective; inputs: {}; outputs: {}; }]>;
14
- }
5
+ import { BooleanInput, DataOrientation, AcceptableValue, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
6
+ import * as i1 from '@radix-ng/primitives/composite';
7
+ import * as i1$1 from '@radix-ng/primitives/collapsible';
15
8
 
16
9
  declare class RdxAccordionHeaderDirective {
17
- protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
18
10
  protected readonly itemContext: _radix_ng_primitives_accordion.AccordionItemContext;
19
11
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionHeaderDirective, never>;
20
12
  static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionHeaderDirective, "[rdxAccordionHeader]", never, {}, {}, never, never, true, never>;
21
13
  }
22
14
 
23
- type RdxAccordionItemState = 'open' | 'closed';
24
- type AccordionItemContext = {
25
- open: Signal<boolean>;
26
- disabled: Signal<boolean>;
27
- triggerId: WritableSignal<string>;
28
- dataState: Signal<RdxAccordionItemState>;
29
- dataDisabled: Signal<boolean>;
30
- currentElement: ElementRef<HTMLElement>;
31
- value: Signal<string | undefined>;
32
- updateOpen: () => void;
33
- index: Signal<number>;
34
- };
35
- declare const injectAccordionItemContext: _radix_ng_primitives_core.InjectContext<AccordionItemContext>;
36
- declare const provideAccordionItemContext: (useFactory: () => AccordionItemContext) => i0.Provider;
37
- /**
38
- * @group Components
39
- */
40
- declare class RdxAccordionItemDirective {
41
- readonly elementRef: ElementRef<HTMLElement>;
42
- private readonly collapsibleContext;
43
- private readonly listItem;
44
- protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
45
- /**
46
- * A string value for the accordion item. All items within an accordion should use a unique value.
47
- * @group Props
48
- */
49
- readonly value: i0.InputSignal<string | undefined>;
50
- /**
51
- * Whether or not an accordion item is disabled from user interaction.
52
- * When `true`, prevents the user from interacting with the item.
53
- * @group Props
54
- */
55
- readonly disabled: i0.InputSignalWithTransform<boolean, BooleanInput>;
56
- /**
57
- * Event handler called when the panel open state changes.
58
- * @group Emits
59
- */
60
- readonly onOpenChange: i0.OutputEmitterRef<boolean>;
61
- readonly isDisabled: Signal<boolean>;
62
- readonly open: Signal<boolean>;
63
- readonly dataState: Signal<RdxAccordionItemState>;
64
- /** Set by the trigger; links the content's `aria-labelledby` to the trigger `id`. */
65
- readonly triggerId: WritableSignal<string>;
66
- readonly index: Signal<number>;
67
- constructor();
68
- updateOpen: () => void;
69
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionItemDirective, never>;
70
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onOpenChange": "onOpenChange"; }, never, never, true, [{ directive: typeof i1.RdxCollapsibleRootDirective; inputs: { "disabled": "disabled"; "open": "open"; }; outputs: {}; }, { directive: typeof i2.RdxCompositeListItem; inputs: {}; outputs: {}; }]>;
15
+ /** The reason an accordion value change was requested. */
16
+ type RdxAccordionValueChangeReason = 'trigger-press' | 'none';
17
+ type RdxAccordionValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxAccordionValueChangeReason>;
18
+ /** Payload of {@link RdxAccordionRootDirective.onValueChange}, mirroring Base UI's `(value, eventDetails)`. */
19
+ interface RdxAccordionValueChangeEvent {
20
+ value: AcceptableValue | AcceptableValue[] | undefined;
21
+ eventDetails: RdxAccordionValueChangeEventDetails;
71
22
  }
72
-
73
23
  type AccordionRootContext = {
74
24
  disabled: InputSignalWithTransform<boolean, BooleanInput>;
75
25
  orientation: InputSignal<DataOrientation>;
76
26
  value: ModelSignal<AcceptableValue | AcceptableValue[] | undefined>;
77
- collapsible: Signal<boolean>;
78
27
  isSingle: Signal<boolean>;
79
28
  keepMounted: InputSignalWithTransform<boolean, BooleanInput>;
80
- changeModelValue: (value: string) => void;
29
+ hiddenUntilFound: InputSignalWithTransform<boolean, BooleanInput>;
30
+ changeModelValue: (value: string, event?: Event) => void;
81
31
  };
82
32
  declare const injectAccordionRootContext: _radix_ng_primitives_core.InjectContext<AccordionRootContext>;
83
33
  declare const provideAccordionRootContext: (useFactory: () => AccordionRootContext) => i0.Provider;
@@ -85,7 +35,6 @@ declare const provideAccordionRootContext: (useFactory: () => AccordionRootConte
85
35
  * @group Components
86
36
  */
87
37
  declare class RdxAccordionRootDirective {
88
- readonly id: InputSignal<string>;
89
38
  /** Whether the Accordion is disabled.
90
39
  * @defaultValue false
91
40
  * @group Props
@@ -116,23 +65,8 @@ declare class RdxAccordionRootDirective {
116
65
  */
117
66
  readonly value: ModelSignal<AcceptableValue | AcceptableValue[] | undefined>;
118
67
  /**
119
- * When type is "single", allows closing content when clicking trigger for an open item.
120
- * When type is "multiple", this prop has no effect.
121
- *
122
- * @defaultValue false
123
- * @group Props
124
- */
125
- readonly collapsible: InputSignalWithTransform<boolean, BooleanInput>;
126
- /**
127
- * Determines whether a "single" or "multiple" items can be selected at a time.
128
- *
129
- * @defaultValue 'single'
130
- * @group Props
131
- */
132
- readonly type: InputSignal<"multiple" | "single">;
133
- /**
134
- * Allow multiple panels to be open simultaneously.
135
- * Takes precedence over `type` when `true`.
68
+ * Allow multiple panels to be open simultaneously. In single mode an open item can always be
69
+ * closed by clicking its trigger again (Base UI parity — there is no separate `collapsible`).
136
70
  *
137
71
  * @defaultValue false
138
72
  * @group Props
@@ -149,48 +83,109 @@ declare class RdxAccordionRootDirective {
149
83
  readonly loopFocus: InputSignalWithTransform<boolean, BooleanInput>;
150
84
  /**
151
85
  * Whether to keep the content of collapsed items mounted in the DOM.
152
- * When `true`, closed panels keep their element in the DOM instead of
153
- * receiving a `hidden` attribute. Applies to the always-mounted
154
- * `rdxAccordionContent`; the `rdxAccordionContentPresence` variant always
155
- * unmounts.
86
+ * When `true`, closed panels keep their element in the DOM while hidden.
156
87
  *
157
88
  * @defaultValue false
158
89
  * @group Props
159
90
  */
160
91
  readonly keepMounted: InputSignalWithTransform<boolean, BooleanInput>;
161
92
  /**
162
- * Event handler called when the expanded state of an item changes.
93
+ * Allow collapsed panels to remain mounted (but hidden) so the browser's in-page search
94
+ * can find and reveal them. Mirrors Base UI's `hiddenUntilFound`.
95
+ *
96
+ * @defaultValue false
97
+ * @group Props
98
+ */
99
+ readonly hiddenUntilFound: InputSignalWithTransform<boolean, BooleanInput>;
100
+ /**
101
+ * Event handler called when the expanded value changes. Emits the next value plus a cancelable
102
+ * `eventDetails` (Base UI parity); call `eventDetails.cancel()` to reject the change.
163
103
  * @group Emits
164
104
  */
165
- readonly onValueChange: i0.OutputEmitterRef<AcceptableValue | AcceptableValue[] | undefined>;
105
+ readonly onValueChange: i0.OutputEmitterRef<RdxAccordionValueChangeEvent>;
166
106
  readonly isSingle: Signal<boolean>;
167
107
  constructor();
168
- changeModelValue: (newValue: string) => void;
108
+ changeModelValue: (newValue: string, event?: Event) => void;
169
109
  private isValueEqualOrExist;
170
110
  private isEqual;
171
111
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionRootDirective, never>;
172
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]", ["rdxAccordionRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i2.RdxCompositeList; inputs: {}; outputs: {}; }]>;
112
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]", ["rdxAccordionRoot"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "hiddenUntilFound": { "alias": "hiddenUntilFound"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i1.RdxCompositeList; inputs: {}; outputs: {}; }]>;
113
+ }
114
+
115
+ /** Payload of {@link RdxAccordionItemDirective.onOpenChange}, mirroring Base UI's `(open, eventDetails)`. */
116
+ interface RdxAccordionItemOpenChangeEvent {
117
+ open: boolean;
118
+ eventDetails: RdxAccordionValueChangeEventDetails;
119
+ }
120
+ type AccordionItemContext = {
121
+ open: Signal<boolean>;
122
+ disabled: Signal<boolean>;
123
+ triggerId: WritableSignal<string>;
124
+ dataDisabled: Signal<boolean>;
125
+ currentElement: ElementRef<HTMLElement>;
126
+ value: Signal<string | undefined>;
127
+ updateOpen: () => void;
128
+ index: Signal<number>;
129
+ };
130
+ declare const injectAccordionItemContext: _radix_ng_primitives_core.InjectContext<AccordionItemContext>;
131
+ declare const provideAccordionItemContext: (useFactory: () => AccordionItemContext) => i0.Provider;
132
+ /**
133
+ * @group Components
134
+ */
135
+ declare class RdxAccordionItemDirective {
136
+ readonly elementRef: ElementRef<HTMLElement>;
137
+ private readonly collapsibleContext;
138
+ private readonly listItem;
139
+ protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
140
+ /**
141
+ * A string value for the accordion item. All items within an accordion should use a unique value.
142
+ * @group Props
143
+ */
144
+ readonly value: i0.InputSignal<string | undefined>;
145
+ /**
146
+ * Whether or not an accordion item is disabled from user interaction.
147
+ * When `true`, prevents the user from interacting with the item.
148
+ * @group Props
149
+ */
150
+ readonly disabled: i0.InputSignalWithTransform<boolean, BooleanInput>;
151
+ /**
152
+ * Event handler called when the panel open state changes. Emits `{ open, eventDetails }`
153
+ * (Base UI parity).
154
+ * @group Emits
155
+ */
156
+ readonly onOpenChange: i0.OutputEmitterRef<RdxAccordionItemOpenChangeEvent>;
157
+ readonly isDisabled: Signal<boolean>;
158
+ readonly open: Signal<boolean>;
159
+ /** Set by the trigger; links the content's `aria-labelledby` to the trigger `id`. */
160
+ readonly triggerId: WritableSignal<string>;
161
+ readonly index: Signal<number>;
162
+ constructor();
163
+ updateOpen: () => void;
164
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionItemDirective, never>;
165
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onOpenChange": "onOpenChange"; }, never, never, true, [{ directive: typeof i1$1.RdxCollapsibleRootDirective; inputs: { "disabled": "disabled"; "open": "open"; }; outputs: {}; }, { directive: typeof i1.RdxCompositeListItem; inputs: {}; outputs: {}; }]>;
166
+ }
167
+
168
+ declare class RdxAccordionPanelDirective {
169
+ protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
170
+ protected readonly itemContext: _radix_ng_primitives_accordion.AccordionItemContext;
171
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionPanelDirective, never>;
172
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionPanelDirective, "[rdxAccordionPanel]", never, {}, {}, never, never, true, [{ directive: typeof i1$1.RdxCollapsiblePanelDirective; inputs: {}; outputs: {}; }]>;
173
173
  }
174
174
 
175
175
  declare class RdxAccordionTriggerDirective {
176
176
  protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
177
177
  protected readonly itemContext: _radix_ng_primitives_accordion.AccordionItemContext;
178
178
  constructor();
179
- changeItem(): void;
179
+ changeItem(event: Event): void;
180
180
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionTriggerDirective, never>;
181
181
  static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionTriggerDirective, "[rdxAccordionTrigger]", never, {}, {}, never, never, true, never>;
182
182
  }
183
183
 
184
- declare class RdxAccordionContentPresenceDirective {
185
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionContentPresenceDirective, never>;
186
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionContentPresenceDirective, "ng-template[rdxAccordionContentPresence]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxCollapsiblePanelPresenceDirective; inputs: {}; outputs: {}; }]>;
187
- }
188
-
189
184
  declare class RdxAccordionModule {
190
185
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionModule, never>;
191
- static ɵmod: i0.ɵɵNgModuleDeclaration<RdxAccordionModule, never, [typeof RdxAccordionContentDirective, typeof RdxAccordionHeaderDirective, typeof RdxAccordionItemDirective, typeof RdxAccordionRootDirective, typeof RdxAccordionTriggerDirective, typeof RdxAccordionContentPresenceDirective], [typeof RdxAccordionContentDirective, typeof RdxAccordionHeaderDirective, typeof RdxAccordionItemDirective, typeof RdxAccordionRootDirective, typeof RdxAccordionTriggerDirective, typeof RdxAccordionContentPresenceDirective]>;
186
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RdxAccordionModule, never, [typeof RdxAccordionHeaderDirective, typeof RdxAccordionItemDirective, typeof RdxAccordionPanelDirective, typeof RdxAccordionRootDirective, typeof RdxAccordionTriggerDirective], [typeof RdxAccordionHeaderDirective, typeof RdxAccordionItemDirective, typeof RdxAccordionPanelDirective, typeof RdxAccordionRootDirective, typeof RdxAccordionTriggerDirective]>;
192
187
  static ɵinj: i0.ɵɵInjectorDeclaration<RdxAccordionModule>;
193
188
  }
194
189
 
195
- export { RdxAccordionContentDirective, RdxAccordionContentPresenceDirective, RdxAccordionHeaderDirective, RdxAccordionItemDirective, RdxAccordionModule, RdxAccordionRootDirective, RdxAccordionTriggerDirective, injectAccordionItemContext, injectAccordionRootContext, provideAccordionItemContext, provideAccordionRootContext };
196
- export type { AccordionItemContext, AccordionRootContext, RdxAccordionItemState };
190
+ export { RdxAccordionHeaderDirective, RdxAccordionItemDirective, RdxAccordionModule, RdxAccordionPanelDirective, RdxAccordionRootDirective, RdxAccordionTriggerDirective, injectAccordionItemContext, injectAccordionRootContext, provideAccordionItemContext, provideAccordionRootContext };
191
+ export type { AccordionItemContext, AccordionRootContext, RdxAccordionItemOpenChangeEvent, RdxAccordionValueChangeEvent, RdxAccordionValueChangeEventDetails, RdxAccordionValueChangeReason };
@@ -157,12 +157,11 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
157
157
  */
158
158
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
159
159
  /**
160
- * Whether the user should be unable to tick or untick the checkbox.
160
+ * Whether the user should be unable to tick or untick the checkbox. Bound in templates as
161
+ * `readOnly` (Base UI spelling); the TS member stays `readonly` to satisfy `RdxFormCheckboxControl`.
161
162
  * @group Props
162
163
  */
163
164
  readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
164
- /** Alias matching Base UI's `readOnly` prop spelling. */
165
- readonly readOnly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
166
165
  /**
167
166
  * Whether or not the checkbox is required.
168
167
  * @group Props
@@ -215,7 +214,7 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
215
214
  private setOptionalAttribute;
216
215
  private setBooleanAttribute;
217
216
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxRootDirective, never>;
218
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxRootDirective, "[rdxCheckboxRoot]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "submitValue": { "alias": "value"; "required": false; "isSignal": true; }; "uncheckedValue": { "alias": "uncheckedValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "parent": { "alias": "parent"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "indeterminate": "indeterminateChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "checked"; "disabled": "disabled"; }; outputs: {}; }]>;
217
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxRootDirective, "[rdxCheckboxRoot]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "submitValue": { "alias": "value"; "required": false; "isSignal": true; }; "uncheckedValue": { "alias": "uncheckedValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "parent": { "alias": "parent"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "indeterminate": "indeterminateChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "checked"; "disabled": "disabled"; }; outputs: {}; }]>;
219
218
  }
220
219
 
221
220
  type RdxCheckboxGroupValueChangeReason = 'none';
@@ -2,19 +2,29 @@ import * as _angular_core from '@angular/core';
2
2
  import { Signal, ModelSignal, WritableSignal } from '@angular/core';
3
3
  import * as _radix_ng_primitives_collapsible from '@radix-ng/primitives/collapsible';
4
4
  import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
5
- import { BooleanInput, RdxTransitionStatus } from '@radix-ng/primitives/core';
6
- import * as i1 from '@radix-ng/primitives/presence';
5
+ import { BooleanInput, RdxTransitionStatus, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
7
6
 
8
7
  /**
9
8
  * A panel with the collapsible contents.
10
9
  */
11
10
  declare class RdxCollapsiblePanelDirective {
12
11
  private readonly elementRef;
12
+ private readonly renderer;
13
+ private readonly destroyRef;
14
+ private readonly marker;
15
+ private parentNode;
16
+ private isAttached;
13
17
  protected readonly rootContext: _radix_ng_primitives_collapsible.CollapsibleRootContext;
18
+ /**
19
+ * Optional explicit panel id. When set, the trigger's `aria-controls` points to this id.
20
+ *
21
+ * @group Props
22
+ */
23
+ readonly id: _angular_core.InputSignal<string | undefined>;
14
24
  /**
15
25
  * Whether to keep the element in the DOM while the panel is closed.
16
- * When `true`, the closed panel keeps its element (no `hidden` attribute) so the consumer's
17
- * `data-closed` CSS is responsible for visually collapsing it.
26
+ * When `true`, the closed panel keeps its element and receives the `hidden` attribute once the
27
+ * close transition finishes.
18
28
  *
19
29
  * @group Props
20
30
  * @defaultValue false
@@ -30,10 +40,11 @@ declare class RdxCollapsiblePanelDirective {
30
40
  readonly hiddenUntilFound: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
31
41
  readonly height: _angular_core.WritableSignal<number | null>;
32
42
  readonly width: _angular_core.WritableSignal<number | null>;
43
+ /** Mirrors Base UI's `shouldRender`: hidden panels unmount unless kept for search/measurement. */
44
+ readonly shouldRender: _angular_core.Signal<boolean>;
33
45
  /**
34
- * The `hidden` attribute value. The panel is shown while open or while its exit transition runs;
35
- * a kept-mounted panel stays visible (the consumer collapses it via CSS); otherwise the closed
36
- * panel is hidden — with `until-found` when find-in-page support is requested.
46
+ * The `hidden` attribute value. The panel is shown while open or while its exit transition runs.
47
+ * A kept-mounted panel remains in the DOM but is still hidden while closed.
37
48
  */
38
49
  readonly hidden: _angular_core.Signal<"" | "until-found" | undefined>;
39
50
  /**
@@ -43,12 +54,21 @@ declare class RdxCollapsiblePanelDirective {
43
54
  private isFirstMeasure;
44
55
  private originalStyles?;
45
56
  constructor();
57
+ private insertMarker;
58
+ private removeMarker;
59
+ private syncRenderedState;
46
60
  private updateDimensions;
47
61
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCollapsiblePanelDirective, never>;
48
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCollapsiblePanelDirective, "[rdxCollapsiblePanel]", never, { "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "hiddenUntilFound": { "alias": "hiddenUntilFound"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
62
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCollapsiblePanelDirective, "[rdxCollapsiblePanel]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "hiddenUntilFound": { "alias": "hiddenUntilFound"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
49
63
  }
50
64
 
51
65
  type RdxCollapsibleState = 'open' | 'closed';
66
+ type RdxCollapsibleOpenChangeReason = 'trigger-press' | 'none';
67
+ type RdxCollapsibleOpenChangeEventDetails = RdxCancelableChangeEventDetails<RdxCollapsibleOpenChangeReason>;
68
+ interface RdxCollapsibleOpenChangeEvent {
69
+ open: boolean;
70
+ eventDetails: RdxCollapsibleOpenChangeEventDetails;
71
+ }
52
72
  interface CollapsibleRootContext {
53
73
  /** Stable id linking the trigger's `aria-controls` to the panel. */
54
74
  panelId: Signal<string>;
@@ -65,7 +85,9 @@ interface CollapsibleRootContext {
65
85
  */
66
86
  keepMounted: WritableSignal<boolean>;
67
87
  hiddenUntilFound: WritableSignal<boolean>;
68
- toggle: () => void;
88
+ toggle: (event: Event, trigger?: HTMLElement) => void;
89
+ setOpen: (open: boolean, reason: RdxCollapsibleOpenChangeReason, event: Event, trigger?: HTMLElement) => boolean;
90
+ setPanelIdState: (id: string | undefined) => void;
69
91
  /** Registers the panel element whose transition duration gates the close completion. */
70
92
  registerTransitionElement: (element: HTMLElement) => () => void;
71
93
  }
@@ -78,6 +100,8 @@ declare const provideCollapsibleRootContext: (useFactory: () => CollapsibleRootC
78
100
  */
79
101
  declare class RdxCollapsibleRootDirective {
80
102
  private readonly transition;
103
+ private readonly generatedPanelId;
104
+ private readonly panelIdState;
81
105
  /** Reactive open/close transition phase (`'starting'` | `'ending'` | `undefined`). */
82
106
  readonly transitionStatus: Signal<RdxTransitionStatus>;
83
107
  /** Registers the panel element whose transition duration gates the close completion. */
@@ -106,7 +130,9 @@ declare class RdxCollapsibleRootDirective {
106
130
  */
107
131
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
108
132
  /** Stable id linking the trigger's `aria-controls` to the panel. */
109
- readonly panelId: _angular_core.InputSignal<string>;
133
+ readonly panelId: _angular_core.InputSignal<string | undefined>;
134
+ /** Stable id linking the trigger's `aria-controls` to the panel. */
135
+ readonly resolvedPanelId: Signal<string>;
110
136
  /** Composition fallbacks (see {@link CollapsibleRootContext}). Default `false`. */
111
137
  readonly keepMountedContext: WritableSignal<boolean>;
112
138
  readonly hiddenUntilFoundContext: WritableSignal<boolean>;
@@ -117,7 +143,7 @@ declare class RdxCollapsibleRootDirective {
117
143
  *
118
144
  * @group Emits
119
145
  */
120
- readonly onOpenChange: _angular_core.OutputEmitterRef<boolean>;
146
+ readonly onOpenChange: _angular_core.OutputEmitterRef<RdxCollapsibleOpenChangeEvent>;
121
147
  /**
122
148
  * Event handler called after the open/close transition has finished.
123
149
  *
@@ -126,6 +152,8 @@ declare class RdxCollapsibleRootDirective {
126
152
  readonly onOpenChangeComplete: _angular_core.OutputEmitterRef<boolean>;
127
153
  private hasAppliedDefaultOpen;
128
154
  private previousOpen;
155
+ setPanelIdState(id: string | undefined): void;
156
+ setOpen(nextOpen: boolean, reason: RdxCollapsibleOpenChangeReason, event: Event, trigger?: HTMLElement): boolean;
129
157
  constructor();
130
158
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCollapsibleRootDirective, never>;
131
159
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCollapsibleRootDirective, "[rdxCollapsibleRoot]", ["rdxCollapsibleRoot"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "defaultOpen": { "alias": "defaultOpen"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "panelId": { "alias": "panelId"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "onOpenChange": "onOpenChange"; "onOpenChangeComplete": "onOpenChangeComplete"; }, never, never, true, never>;
@@ -135,26 +163,18 @@ declare class RdxCollapsibleRootDirective {
135
163
  * A button that opens and closes the collapsible panel.
136
164
  */
137
165
  declare class RdxCollapsibleTriggerDirective {
166
+ private readonly elementRef;
138
167
  protected readonly rootContext: _radix_ng_primitives_collapsible.CollapsibleRootContext;
168
+ protected handleClick(event: MouseEvent): void;
139
169
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCollapsibleTriggerDirective, never>;
140
170
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCollapsibleTriggerDirective, "[rdxCollapsibleTrigger]", never, {}, {}, never, never, true, never>;
141
171
  }
142
172
 
143
- /**
144
- * Structural directive that mounts the collapsible panel contents only while open, unmounting them
145
- * once the exit animation finishes. Opt into this when the closed contents should leave the DOM;
146
- * otherwise apply `rdxCollapsiblePanel` directly (optionally with `keepMounted`).
147
- */
148
- declare class RdxCollapsiblePanelPresenceDirective {
149
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCollapsiblePanelPresenceDirective, never>;
150
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCollapsiblePanelPresenceDirective, "ng-template[rdxCollapsiblePanelPresence]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxPresenceDirective; inputs: {}; outputs: {}; }]>;
151
- }
152
-
153
173
  declare class RdxCollapsibleModule {
154
174
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCollapsibleModule, never>;
155
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCollapsibleModule, never, [typeof RdxCollapsiblePanelDirective, typeof RdxCollapsibleRootDirective, typeof RdxCollapsibleTriggerDirective, typeof RdxCollapsiblePanelPresenceDirective], [typeof RdxCollapsiblePanelDirective, typeof RdxCollapsibleRootDirective, typeof RdxCollapsibleTriggerDirective, typeof RdxCollapsiblePanelPresenceDirective]>;
175
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCollapsibleModule, never, [typeof RdxCollapsiblePanelDirective, typeof RdxCollapsibleRootDirective, typeof RdxCollapsibleTriggerDirective], [typeof RdxCollapsiblePanelDirective, typeof RdxCollapsibleRootDirective, typeof RdxCollapsibleTriggerDirective]>;
156
176
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxCollapsibleModule>;
157
177
  }
158
178
 
159
- export { RdxCollapsibleModule, RdxCollapsiblePanelDirective, RdxCollapsiblePanelPresenceDirective, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsibleRootContext, provideCollapsibleRootContext };
160
- export type { CollapsibleRootContext, RdxCollapsibleState };
179
+ export { RdxCollapsibleModule, RdxCollapsiblePanelDirective, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsibleRootContext, provideCollapsibleRootContext };
180
+ export type { CollapsibleRootContext, RdxCollapsibleOpenChangeEvent, RdxCollapsibleOpenChangeEventDetails, RdxCollapsibleOpenChangeReason, RdxCollapsibleState };