@radix-ng/primitives 0.51.0 → 1.0.0-beta.1

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.
Files changed (186) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
  13. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  15. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  17. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  19. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  22. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-core.mjs +845 -744
  24. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
  26. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
  28. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  30. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  32. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
  34. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  35. package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
  36. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  38. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  40. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  41. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  42. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  43. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  44. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  45. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  46. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
  48. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  50. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  51. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  52. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  53. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  54. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  56. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  59. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
  61. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  63. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  65. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  67. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  68. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  69. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  71. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  73. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
  75. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
  76. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  77. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  79. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  81. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  83. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  85. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
  87. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  89. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
  91. package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
  92. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  93. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  95. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  97. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
  99. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  101. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  102. package/meter/README.md +3 -0
  103. package/navigation-menu/README.md +2 -1
  104. package/package.json +39 -18
  105. package/portal/README.md +2 -0
  106. package/preview-card/README.md +3 -0
  107. package/schematics/collection.json +1 -0
  108. package/schematics/ng-add/index.d.ts +3 -2
  109. package/schematics/ng-add/index.js +62 -31
  110. package/schematics/ng-add/index.js.map +1 -1
  111. package/schematics/ng-add/package-config.d.ts +4 -2
  112. package/schematics/ng-add/package-config.js +10 -2
  113. package/schematics/ng-add/package-config.js.map +1 -1
  114. package/schematics/ng-add/schema.d.ts +3 -0
  115. package/schematics/ng-add/schema.js +3 -0
  116. package/schematics/ng-add/schema.js.map +1 -0
  117. package/schematics/ng-add/schema.json +14 -0
  118. package/select/README.md +2 -0
  119. package/types/radix-ng-primitives-accordion.d.ts +51 -16
  120. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  121. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  122. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  123. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  124. package/types/radix-ng-primitives-button.d.ts +73 -0
  125. package/types/radix-ng-primitives-calendar.d.ts +39 -20
  126. package/types/radix-ng-primitives-checkbox.d.ts +204 -35
  127. package/types/radix-ng-primitives-collapsible.d.ts +114 -40
  128. package/types/radix-ng-primitives-collection.d.ts +38 -34
  129. package/types/radix-ng-primitives-config.d.ts +1 -1
  130. package/types/radix-ng-primitives-context-menu.d.ts +61 -116
  131. package/types/radix-ng-primitives-core.d.ts +345 -235
  132. package/types/radix-ng-primitives-cropper.d.ts +89 -56
  133. package/types/radix-ng-primitives-date-field.d.ts +49 -28
  134. package/types/radix-ng-primitives-dialog.d.ts +283 -165
  135. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  136. package/types/radix-ng-primitives-drawer.d.ts +426 -0
  137. package/types/radix-ng-primitives-editable.d.ts +91 -14
  138. package/types/radix-ng-primitives-field.d.ts +374 -0
  139. package/types/radix-ng-primitives-fieldset.d.ts +49 -0
  140. package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
  141. package/types/radix-ng-primitives-input.d.ts +87 -0
  142. package/types/radix-ng-primitives-label.d.ts +0 -1
  143. package/types/radix-ng-primitives-menu.d.ts +584 -99
  144. package/types/radix-ng-primitives-menubar.d.ts +61 -50
  145. package/types/radix-ng-primitives-meter.d.ts +194 -0
  146. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  147. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  148. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  149. package/types/radix-ng-primitives-popover.d.ts +366 -351
  150. package/types/radix-ng-primitives-popper.d.ts +68 -11
  151. package/types/radix-ng-primitives-portal.d.ts +14 -6
  152. package/types/radix-ng-primitives-presence.d.ts +28 -76
  153. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  154. package/types/radix-ng-primitives-progress.d.ts +175 -48
  155. package/types/radix-ng-primitives-radio.d.ts +55 -25
  156. package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
  157. package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
  158. package/types/radix-ng-primitives-select.d.ts +475 -177
  159. package/types/radix-ng-primitives-separator.d.ts +7 -32
  160. package/types/radix-ng-primitives-slider.d.ts +315 -201
  161. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  162. package/types/radix-ng-primitives-switch.d.ts +86 -71
  163. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  164. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  165. package/types/radix-ng-primitives-toast.d.ts +378 -0
  166. package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
  167. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  168. package/types/radix-ng-primitives-toolbar.d.ts +164 -38
  169. package/types/radix-ng-primitives-tooltip.d.ts +348 -384
  170. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  171. package/dropdown-menu/README.md +0 -1
  172. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  173. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  174. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  175. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  176. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  177. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  178. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  179. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  180. package/hover-card/README.md +0 -3
  181. package/select2/README.md +0 -3
  182. package/tooltip2/README.md +0 -3
  183. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  184. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  185. package/types/radix-ng-primitives-select2.d.ts +0 -511
  186. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-checkbox.mjs","sources":["../../../packages/primitives/checkbox/src/checkbox-root.ts","../../../packages/primitives/checkbox/src/checkbox-button.ts","../../../packages/primitives/checkbox/src/checkbox-indicator.ts","../../../packages/primitives/checkbox/src/checkbox-indicator-presence.ts","../../../packages/primitives/checkbox/src/checkbox-input.ts","../../../packages/primitives/checkbox/index.ts","../../../packages/primitives/checkbox/radix-ng-primitives-checkbox.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, inject, input, model } from '@angular/core';\nimport { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';\nimport { createContext, RdxControlValueAccessor } from '@radix-ng/primitives/core';\n\nexport type CheckedState = boolean | 'indeterminate';\n\nexport function isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nexport function getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nconst rootContext = () => {\n const checkbox = inject(RdxCheckboxRootDirective);\n const controlValueAccessor = inject<RdxControlValueAccessor<CheckedState>>(RdxControlValueAccessor);\n\n return {\n checked: controlValueAccessor.value,\n disabled: controlValueAccessor.disabled,\n required: checkbox.required,\n value: checkbox.value,\n name: checkbox.name,\n form: checkbox.form,\n readonly: checkbox.readonly,\n state: checkbox.state,\n toggle() {\n checkbox.toggle();\n }\n };\n};\n\nexport type CheckboxRootContext = ReturnType<typeof rootContext>;\n\nexport const [injectCheckboxRootContext, provideCheckboxRootContext] =\n createContext<CheckboxRootContext>('CheckboxRootContext');\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCheckboxRoot]',\n providers: [provideCheckboxRootContext(rootContext)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value:checked', 'disabled']\n }\n ],\n host: {\n '[attr.data-state]': 'state()'\n }\n})\nexport class RdxCheckboxRootDirective {\n private readonly controlValueAccessor = inject(RdxControlValueAccessor);\n\n /**\n * The controlled checked state of the checkbox. Must be used in conjunction with onCheckedChange.\n * @group Props\n */\n readonly checked = model<CheckedState>(false);\n\n /**\n * The value of the checkbox. This is what is submitted with the form when the checkbox is checked.\n * @group Props\n */\n readonly value = input<string>('on');\n\n /**\n * Whether or not the checkbox button is disabled. This prevents the user from interacting with it.\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the user should be unable to tick or untick the checkbox.\n * @group Props\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the checkbox is required.\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Name of the form control. Submitted with the form as part of a name/value pair.\n * @group Props\n */\n readonly name = input<string>();\n\n /**\n * Associates the control with a form element.\n * @group Props\n */\n readonly form = input<string>();\n\n /**\n * Event emitted when the checkbox checked state changes.\n * @group Emits\n */\n readonly onCheckedChange = outputFromObservable(outputToObservable(this.controlValueAccessor.valueChange));\n\n readonly state = computed(() => {\n const checked = this.controlValueAccessor.value();\n\n if (checked === 'indeterminate') {\n return checked;\n }\n\n return checked ? 'checked' : 'unchecked';\n });\n\n toggle() {\n const checked = this.controlValueAccessor.value();\n\n if (checked === 'indeterminate') {\n this.controlValueAccessor.setValue(true);\n }\n\n this.controlValueAccessor.setValue(!checked);\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n/**\n * Directive: rdxCheckboxButton\n * Purpose: Turns a native <button> into an accessible checkbox control bound to the Radix Checkbox context.\n * It mirrors the checkbox state via ARIA/data attributes, toggles on click, and prevents Enter activation per WAI-ARIA.\n * In forms, it stops the button's click from bubbling so only the hidden input emits the native event used for form/validator integration.\n */\n@Directive({\n selector: 'button[rdxCheckboxButton]',\n host: {\n type: 'button',\n role: 'checkbox',\n '[attr.aria-checked]': 'rootContext.checked() === \"indeterminate\" ? \"mixed\" : rootContext.checked()',\n '[attr.aria-required]': 'rootContext.required() || undefined',\n '[attr.aria-readonly]': 'rootContext.readonly() || undefined',\n '[attr.data-state]': 'rootContext.state()',\n '[attr.data-disabled]': 'rootContext.disabled() || undefined',\n '[attr.data-readonly]': 'rootContext.readonly() || undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.value]': 'rootContext.value()',\n '(click)': 'clicked($event)',\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n '(keydown.enter)': '$event.preventDefault()'\n }\n})\nexport class RdxCheckboxButtonDirective {\n protected readonly rootContext = injectCheckboxRootContext()!;\n\n private readonly elementRef = inject<ElementRef<HTMLButtonElement>>(ElementRef);\n\n protected clicked(event: MouseEvent) {\n if (event.defaultPrevented || this.rootContext.readonly()) {\n return;\n }\n\n this.rootContext.toggle();\n\n if (this.rootContext.form() || this.elementRef.nativeElement.closest('form')) {\n // if checkbox is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect checkbox updates.\n event.stopPropagation();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: '[rdxCheckboxIndicator]',\n host: {\n '[attr.data-state]': 'rootContext.state()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[hidden]': '!rootContext.checked()',\n '[style.pointer-events]': '\"none\"'\n }\n})\nexport class RdxCheckboxIndicatorDirective {\n protected readonly rootContext = injectCheckboxRootContext()!;\n}\n","import { computed, Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: 'ng-template[rdxCheckboxIndicatorPresence]',\n providers: [\n provideRdxPresenceContext(() => {\n const rootContext = injectCheckboxRootContext()!;\n\n return {\n present: computed(() => !!rootContext.checked())\n };\n })\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCheckboxIndicatorPresenceDirective {}\n","import { afterNextRender, DestroyRef, Directive, ElementRef, inject } from '@angular/core';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: 'input[rdxCheckboxInput]',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name() || undefined',\n '[attr.checked]': 'rootContext.checked()',\n '[attr.form]': 'rootContext.form() || undefined',\n '[attr.value]': 'rootContext.value()',\n '[required]': 'rootContext.required() || undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[style]': `{\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n inset: 0,\n transform: 'translateX(-100%)',\n }`\n }\n})\nexport class RdxCheckboxInputDirective {\n protected readonly rootContext = injectCheckboxRootContext()!;\n\n private readonly elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n /**\n * Sets up an observer to bubble native input events when the underlying \"checked\" attribute changes.\n *\n * Why this exists\n * - The checkbox input in this directive is visually hidden and controlled by the Radix checkbox state.\n * - When Radix changes the checked state, it updates the input's DOM attribute (\"checked\").\n * - Some forms and frameworks rely on native events (click/change) from the input to sync value, validity and\n * form state. If the attribute changes programmatically without a user click, no event is fired by default.\n */\n afterNextRender(() => {\n const mutationObserver = new MutationObserver(() => {\n this.elementRef.nativeElement.dispatchEvent(new Event('click', { bubbles: true }));\n });\n mutationObserver.observe(this.elementRef.nativeElement, {\n attributes: true,\n attributeFilter: ['checked']\n });\n\n this.destroyRef.onDestroy(() => mutationObserver.disconnect());\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCheckboxButtonDirective } from './src/checkbox-button';\nimport { RdxCheckboxIndicatorDirective } from './src/checkbox-indicator';\nimport { RdxCheckboxIndicatorPresenceDirective } from './src/checkbox-indicator-presence';\nimport { RdxCheckboxInputDirective } from './src/checkbox-input';\nimport { RdxCheckboxRootDirective } from './src/checkbox-root';\n\nexport * from './src/checkbox-button';\nexport * from './src/checkbox-indicator';\nexport * from './src/checkbox-indicator-presence';\nexport * from './src/checkbox-input';\nexport * from './src/checkbox-root';\nexport type { CheckedState } from './src/checkbox-root';\n\nexport const checkboxImports = [\n RdxCheckboxInputDirective,\n RdxCheckboxRootDirective,\n RdxCheckboxButtonDirective,\n RdxCheckboxIndicatorDirective,\n RdxCheckboxIndicatorPresenceDirective\n];\n\n@NgModule({\n imports: [...checkboxImports],\n exports: [...checkboxImports]\n})\nexport class RdxCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAOM,SAAU,eAAe,CAAC,OAAsB,EAAA;IAClD,OAAO,OAAO,KAAK,eAAe;AACtC;AAEM,SAAU,QAAQ,CAAC,OAAqB,EAAA;IAC1C,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW;AACzF;AAEA,MAAM,WAAW,GAAG,MAAK;AACrB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACjD,IAAA,MAAM,oBAAoB,GAAG,MAAM,CAAwC,uBAAuB,CAAC;IAEnG,OAAO;QACH,OAAO,EAAE,oBAAoB,CAAC,KAAK;QACnC,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;QACvC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,GAAA;YACF,QAAQ,CAAC,MAAM,EAAE;QACrB;KACH;AACL,CAAC;AAIM,MAAM,CAA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AAA,OAAO,EAAE,CAAC,GAAG,eAAe;AAC/B,iBAAA;;;ACzBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-checkbox.mjs","sources":["../../../packages/primitives/checkbox/src/checkbox-group.ts","../../../packages/primitives/checkbox/src/checkbox-root.ts","../../../packages/primitives/checkbox/src/checkbox-button.ts","../../../packages/primitives/checkbox/src/checkbox-indicator.ts","../../../packages/primitives/checkbox/src/checkbox-indicator-presence.ts","../../../packages/primitives/checkbox/src/checkbox-input.ts","../../../packages/primitives/checkbox/index.ts","../../../packages/primitives/checkbox/radix-ng-primitives-checkbox.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n Signal\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { BooleanInput, createContext, provideValueAccessor } from '@radix-ng/primitives/core';\nimport type { CheckedState } from './checkbox-root';\n\nexport interface RdxCheckboxGroupContext {\n /** The names of the currently checked checkboxes. */\n value: Signal<string[]>;\n /** All checkbox names, used by a `parent` checkbox to check/uncheck every child. */\n allValues: Signal<string[]>;\n /** Whether the whole group is disabled. */\n disabled: Signal<boolean>;\n /** The derived state of a `parent` checkbox: all / none / some checked. */\n parentState: Signal<CheckedState>;\n /** The space-separated control ids the `parent` checkbox controls (for `aria-controls`). */\n controlledIds: Signal<string | undefined>;\n /** A stable id for a child's control element, derived from the group id and the child name. */\n controlId: (name: string) => string;\n /** Toggle a single child by name. */\n toggleValue: (name: string) => void;\n /** Toggle every child on or off (used by a `parent` checkbox). */\n toggleAll: () => void;\n /** Register a child's name and disabled state so the parent can preserve disabled items. */\n registerChild: (name: string, disabled: Signal<boolean>) => () => void;\n /** Register a child's control element id so the parent can reference it via `aria-controls`. */\n registerControl: (name: string, id: string) => () => void;\n}\n\nexport const [injectCheckboxGroupContext, provideCheckboxGroupContext] =\n createContext<RdxCheckboxGroupContext>('CheckboxGroupContext');\n\nconst groupContext = (): RdxCheckboxGroupContext => {\n const group = inject(RdxCheckboxGroupDirective);\n return {\n value: group.value,\n allValues: group.allValues,\n disabled: group.disabledState,\n parentState: group.parentState,\n controlledIds: group.controlledIds,\n controlId: (name) => group.controlId(name),\n toggleValue: (name) => group.toggleValue(name),\n toggleAll: () => group.toggleAll(),\n registerChild: (name, disabled) => group.registerChild(name, disabled),\n registerControl: (name, id) => group.registerControl(name, id)\n };\n};\n\nlet nextCheckboxGroupId = 0;\n\n/**\n * Groups a set of checkboxes that share a single array value (the names of the checked boxes).\n *\n * Each child `rdxCheckboxRoot` participates by its `name`. A child marked `parent` becomes a\n * \"select all\" checkbox whose state is derived from `allValues`.\n */\n@Directive({\n selector: '[rdxCheckboxGroup]',\n exportAs: 'rdxCheckboxGroup',\n providers: [provideValueAccessor(RdxCheckboxGroupDirective), provideCheckboxGroupContext(groupContext)],\n host: {\n role: 'group',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined'\n }\n})\nexport class RdxCheckboxGroupDirective implements ControlValueAccessor {\n /** The names of the currently checked checkboxes. Use with `onValueChange` or `[(value)]`. */\n readonly value = model<string[]>([]);\n\n /** The names checked initially when the group is uncontrolled. */\n readonly defaultValue = input<string[]>();\n\n /** All checkbox names in the group. Required for a `parent` (select-all) checkbox. */\n readonly allValues = input<string[]>([]);\n\n /** Whether the whole group is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emits the new array of checked names whenever the value changes. */\n readonly onValueChange = output<string[]>();\n\n private readonly disabledByCva = signal(false);\n readonly disabledState = computed(() => this.disabledByCva() || this.disabled());\n\n /** Derived state for a `parent` checkbox: `true` (all), `false` (none) or `'indeterminate'`. */\n readonly parentState = computed<CheckedState>(() => {\n const total = this.allValues().length;\n const count = this.value().length;\n if (total > 0 && count === total) {\n return true;\n }\n return count > 0 ? 'indeterminate' : false;\n });\n\n /**\n * The value as last set directly by a child (or the initial value) — the \"remembered\" partial\n * selection that a `parent` checkbox cycles back to, mirroring Base UI's `uncontrolledStateRef`.\n */\n private uncontrolledState: string[] = [];\n private seeded = false;\n /** Where the parent is in its mixed → on → off cycle. Reset to `mixed` on any direct child change. */\n private parentStatus: 'on' | 'off' | 'mixed' = 'mixed';\n /** Per-name disabled signals, so the parent can preserve disabled-but-checked children. */\n private readonly disabledByName = new Map<string, Signal<boolean>>();\n\n /** Stable group id used to derive child control ids when the consumer sets none. */\n private readonly elementId = `rdx-checkbox-group-${nextCheckboxGroupId++}`;\n /** Registered control element ids, keyed by child name. */\n private readonly controlIds = signal<Record<string, string>>({});\n\n /** The space-separated control ids in `allValues` order, for the parent's `aria-controls`. */\n readonly controlledIds = computed<string | undefined>(() => {\n const ids = this.controlIds();\n const list = this.allValues()\n .map((name) => ids[name])\n .filter((id): id is string => id !== undefined);\n return list.length > 0 ? list.join(' ') : undefined;\n });\n\n private hasAppliedDefault = false;\n private onChange: (value: string[]) => void = () => {\n /* Empty */\n };\n onTouched: () => void = () => {\n /* Empty */\n };\n\n constructor() {\n effect(() => {\n const defaultValue = this.defaultValue();\n if (!this.hasAppliedDefault && defaultValue !== undefined) {\n this.hasAppliedDefault = true;\n this.value.set(defaultValue);\n }\n });\n }\n\n /** @ignore Register a child's disabled signal keyed by its name. */\n registerChild(name: string, disabled: Signal<boolean>): () => void {\n this.disabledByName.set(name, disabled);\n return () => {\n if (this.disabledByName.get(name) === disabled) {\n this.disabledByName.delete(name);\n }\n };\n }\n\n /** A stable control id for a child, derived from the group id and the child name. */\n controlId(name: string): string {\n return `${this.elementId}-${name}`;\n }\n\n /** @ignore Register a child's control element id so the parent can list it in `aria-controls`. */\n registerControl(name: string, id: string): () => void {\n this.controlIds.update((ids) => ({ ...ids, [name]: id }));\n return () => {\n this.controlIds.update((ids) => {\n if (ids[name] !== id) {\n return ids;\n }\n const next = { ...ids };\n delete next[name];\n return next;\n });\n };\n }\n\n /** Add/remove a single child name from the value (a direct child change). */\n toggleValue(name: string): void {\n if (this.disabledState()) {\n return;\n }\n\n const current = this.value();\n const next = current.includes(name) ? current.filter((v) => v !== name) : [...current, name];\n this.emit(next);\n\n // A direct child change becomes the new \"remembered\" selection and resets the parent cycle.\n this.seeded = true;\n this.uncontrolledState = next;\n this.parentStatus = 'mixed';\n }\n\n /**\n * Toggle from the `parent` checkbox. Mirrors Base UI's `useCheckboxGroupParent`:\n *\n * - When the remembered selection is all/none, this is a plain check-all ↔ uncheck-all toggle.\n * - When it is a partial selection, clicks cycle: partial → all → none → partial → …, so the\n * user's original partial choice is restored rather than lost.\n *\n * Disabled-but-checked children are always preserved (they cannot be toggled programmatically).\n */\n toggleAll(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.ensureSeeded();\n\n const allValues = this.allValues();\n const remembered = this.uncontrolledState;\n\n // Disabled children that were checked stay checked through every transition.\n const none = allValues.filter((name) => this.isNameDisabled(name) && remembered.includes(name));\n const all = allValues.filter((name) => !this.isNameDisabled(name) || remembered.includes(name));\n\n const rememberedIsAllOrNone = remembered.length === all.length || remembered.length === 0;\n if (rememberedIsAllOrNone) {\n this.emit(this.value().length === all.length ? none : all);\n return;\n }\n\n let nextStatus: 'on' | 'off' | 'mixed' = 'mixed';\n let nextValue = remembered;\n if (this.parentStatus === 'mixed') {\n nextStatus = 'on';\n nextValue = all;\n } else if (this.parentStatus === 'on') {\n nextStatus = 'off';\n nextValue = none;\n }\n\n this.emit(nextValue);\n this.parentStatus = nextStatus;\n }\n\n private isNameDisabled(name: string): boolean {\n return this.disabledByName.get(name)?.() ?? false;\n }\n\n /** Seed the remembered selection from the current value the first time the parent is used. */\n private ensureSeeded(): void {\n if (!this.seeded) {\n this.seeded = true;\n this.uncontrolledState = this.value();\n }\n }\n\n private emit(next: string[]): void {\n this.value.set(next);\n this.onValueChange.emit(next);\n this.onChange(next);\n this.onTouched();\n }\n\n /** @ignore */\n writeValue(value: string[] | null): void {\n this.value.set(value ?? []);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.disabledByCva.set(isDisabled);\n }\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input, model } from '@angular/core';\nimport { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';\nimport {\n BooleanInput,\n createContext,\n RdxControlValueAccessor,\n RdxFormCheckboxControl\n} from '@radix-ng/primitives/core';\nimport { injectCheckboxGroupContext } from './checkbox-group';\n\n/**\n * Internal tri-state used only for the derived `parent` (select-all) state in\n * `rdxCheckboxGroup` and the `data-state` string. The public `checked` member is\n * a plain `boolean`; mixed state is exposed via the separate `indeterminate`\n * member (Base UI shape).\n */\nexport type CheckedState = boolean | 'indeterminate';\n\nexport function isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nexport function getState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nconst rootContext = () => {\n const checkbox = inject(RdxCheckboxRootDirective);\n\n // `checked`/`disabled` come from the directive so they reflect group membership when the\n // checkbox is inside a `rdxCheckboxGroup`; otherwise they fall back to the CVA.\n return {\n checked: checkbox.checkedState,\n indeterminate: checkbox.indeterminateState,\n disabled: checkbox.disabledState,\n required: checkbox.required,\n value: checkbox.submitValue,\n name: checkbox.name,\n parent: checkbox.parent,\n form: checkbox.form,\n readonly: checkbox.readonly,\n state: checkbox.state,\n toggle() {\n checkbox.toggle();\n }\n };\n};\n\nexport type CheckboxRootContext = ReturnType<typeof rootContext>;\n\nexport const [injectCheckboxRootContext, provideCheckboxRootContext] =\n createContext<CheckboxRootContext>('CheckboxRootContext');\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCheckboxRoot]',\n providers: [provideCheckboxRootContext(rootContext)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value:checked', 'disabled']\n }\n ],\n host: {\n '[attr.data-state]': 'state()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined'\n }\n})\nexport class RdxCheckboxRootDirective implements RdxFormCheckboxControl {\n private readonly controlValueAccessor = inject(RdxControlValueAccessor);\n\n /** The group this checkbox belongs to, if it is rendered inside a `rdxCheckboxGroup`. */\n private readonly group = injectCheckboxGroupContext(true);\n\n /**\n * @ignore\n * Reflects the effective disabled state (CVA, covering reactive-forms `.disable()`, plus the\n * group's disabled state), used for the `data-disabled` host attribute.\n */\n protected readonly isDisabled = computed(() => this.disabledState());\n\n /**\n * The controlled checked state of the checkbox. Must be used in conjunction with onCheckedChange.\n *\n * Mixed state is no longer expressed through `checked` — use the separate\n * `indeterminate` input (Base UI shape). This `boolean` model is what\n * `RdxFormCheckboxControl` / Angular Signal Forms bind to.\n * @group Props\n */\n readonly checked = model<boolean>(false);\n\n /**\n * Whether the checkbox is in a mixed state: neither ticked nor unticked.\n * Orthogonal to `checked` and not part of the submitted form value. A user\n * click resolves the checkbox to `checked` and clears `indeterminate`.\n * @group Props\n */\n readonly indeterminate = model<boolean>(false);\n\n /**\n * The value of the checkbox. This is what is submitted with the form when the checkbox is checked.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls. (Checkbox is not yet marked `implements` — its `checked` is still\n * `CheckedState`; see the `indeterminate` half of collision #1.)\n * @group Props\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n /**\n * Whether or not the checkbox button is disabled. This prevents the user from interacting with it.\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the user should be unable to tick or untick the checkbox.\n * @group Props\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the checkbox is required.\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Name of the form control. Submitted with the form as part of a name/value pair. Inside a\n * `rdxCheckboxGroup` this also identifies the checkbox in the group's value array.\n * @group Props\n */\n readonly name = input<string>();\n\n /**\n * When inside a `rdxCheckboxGroup`, marks this as the \"select all\" checkbox: its state is\n * derived from the group's `allValues`, and toggling it checks or unchecks every child.\n * @group Props\n */\n readonly parent = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Associates the control with a form element.\n * @group Props\n */\n readonly form = input<string>();\n\n /**\n * Event emitted when the checkbox checked state changes.\n * @group Emits\n */\n readonly onCheckedChange = outputFromObservable(outputToObservable(this.controlValueAccessor.valueChange));\n\n /**\n * @ignore\n * The effective checked state as a `boolean`. Inside a `rdxCheckboxGroup` it is derived from the\n * group (a `parent` checkbox is checked only when every child is; a child from whether its `name`\n * is in the group value); standalone it reads the CVA value.\n */\n readonly checkedState = computed<boolean>(() => {\n const group = this.group;\n if (group) {\n if (this.parent()) {\n return group.parentState() === true;\n }\n\n const name = this.name();\n if (name !== undefined) {\n return group.value().includes(name);\n }\n }\n\n return !!this.controlValueAccessor.value();\n });\n\n /**\n * @ignore\n * The effective mixed state. A `parent` checkbox is indeterminate when some — but not all —\n * children are checked; otherwise it follows the `indeterminate` input.\n */\n readonly indeterminateState = computed<boolean>(() => {\n const group = this.group;\n if (group && this.parent()) {\n return group.parentState() === 'indeterminate';\n }\n\n return this.indeterminate();\n });\n\n /** @ignore The effective disabled state, including the group. */\n readonly disabledState = computed(() => this.controlValueAccessor.disabled() || (this.group?.disabled() ?? false));\n\n readonly state = computed(() =>\n this.indeterminateState() ? 'indeterminate' : this.checkedState() ? 'checked' : 'unchecked'\n );\n\n constructor() {\n // Inside a group, register this child's name and its own disabled state so a `parent`\n // checkbox can preserve disabled-but-checked children when selecting/deselecting all.\n effect((onCleanup) => {\n const group = this.group;\n const name = this.name();\n if (group && !this.parent() && name !== undefined) {\n onCleanup(group.registerChild(name, this.controlValueAccessor.disabled));\n }\n });\n }\n\n toggle() {\n const group = this.group;\n if (group) {\n if (this.parent()) {\n group.toggleAll();\n return;\n }\n\n const name = this.name();\n if (name !== undefined) {\n group.toggleValue(name);\n return;\n }\n }\n\n // From the indeterminate state a click resolves to checked (matching\n // native + Base UI), otherwise it flips the boolean. A single setValue so\n // onCheckedChange fires once; the `checked`/`indeterminate` models are\n // kept in sync so `[(checked)]` / `[(indeterminate)]` reflect the change.\n const next = this.indeterminateState() ? true : !this.checkedState();\n\n this.indeterminate.set(false);\n this.checked.set(next);\n this.controlValueAccessor.setValue(next);\n }\n}\n","import { computed, Directive, effect, ElementRef, inject } from '@angular/core';\nimport { injectCheckboxGroupContext } from './checkbox-group';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n/**\n * Directive: rdxCheckboxButton\n * Purpose: Turns a native <button> into an accessible checkbox control bound to the Radix Checkbox context.\n * It mirrors the checkbox state via ARIA/data attributes, toggles on click, and prevents Enter activation per WAI-ARIA.\n * In forms, it stops the button's click from bubbling so only the hidden input emits the native event used for form/validator integration.\n */\n@Directive({\n selector: 'button[rdxCheckboxButton]',\n host: {\n type: 'button',\n role: 'checkbox',\n '[attr.aria-checked]': 'rootContext.indeterminate() ? \"mixed\" : rootContext.checked()',\n '[attr.aria-controls]': 'ariaControls()',\n '[attr.aria-required]': 'rootContext.required() || undefined',\n '[attr.aria-readonly]': 'rootContext.readonly() || undefined',\n '[attr.data-state]': 'rootContext.state()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.value]': 'rootContext.value()',\n '(click)': 'clicked($event)',\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n '(keydown.enter)': '$event.preventDefault()'\n }\n})\nexport class RdxCheckboxButtonDirective {\n protected readonly rootContext = injectCheckboxRootContext();\n private readonly group = injectCheckboxGroupContext(true);\n\n private readonly elementRef = inject<ElementRef<HTMLButtonElement>>(ElementRef);\n\n /** A `parent` checkbox lists the ids of the children it controls. */\n protected readonly ariaControls = computed(() =>\n this.group && this.rootContext.parent() ? this.group.controlledIds() : undefined\n );\n\n constructor() {\n // A child checkbox in a group exposes its control id so the parent can reference it via\n // `aria-controls`. Use the consumer's id when present, otherwise derive a stable one.\n effect((onCleanup) => {\n const group = this.group;\n const name = this.rootContext.name();\n if (!group || this.rootContext.parent() || name === undefined) {\n return;\n }\n\n const el = this.elementRef.nativeElement;\n if (!el.id) {\n el.id = group.controlId(name);\n }\n onCleanup(group.registerControl(name, el.id));\n });\n }\n\n protected clicked(event: MouseEvent) {\n if (event.defaultPrevented || this.rootContext.readonly()) {\n return;\n }\n\n this.rootContext.toggle();\n\n if (this.rootContext.form() || this.elementRef.nativeElement.closest('form')) {\n // if checkbox is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect checkbox updates.\n event.stopPropagation();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: '[rdxCheckboxIndicator]',\n host: {\n '[attr.data-state]': 'rootContext.state()',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[hidden]': '!rootContext.checked() && !rootContext.indeterminate()',\n '[style.pointer-events]': '\"none\"'\n }\n})\nexport class RdxCheckboxIndicatorDirective {\n protected readonly rootContext = injectCheckboxRootContext();\n}\n","import { computed, Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: 'ng-template[rdxCheckboxIndicatorPresence]',\n providers: [\n provideRdxPresenceContext(() => {\n const rootContext = injectCheckboxRootContext();\n\n return {\n present: computed(() => rootContext.checked() || rootContext.indeterminate())\n };\n })\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCheckboxIndicatorPresenceDirective {}\n","import { Directive, effect, ElementRef, inject } from '@angular/core';\nimport { injectCheckboxRootContext } from './checkbox-root';\n\n@Directive({\n selector: 'input[rdxCheckboxInput]',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name() || undefined',\n // Only a truly checked box is submitted; `indeterminate` is a property\n // (set below), never a submitted \"checked\" value.\n '[attr.checked]': 'rootContext.state() === \"checked\" ? \"\" : undefined',\n '[attr.form]': 'rootContext.form() || undefined',\n '[attr.value]': 'rootContext.value()',\n '[required]': 'rootContext.required() || undefined',\n '[attr.disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[style]': `{\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n inset: 0,\n transform: 'translateX(-100%)',\n }`\n }\n})\nexport class RdxCheckboxInputDirective {\n protected readonly rootContext = injectCheckboxRootContext();\n\n private readonly input = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n\n constructor() {\n let isInitial = true;\n\n /**\n * Keeps the hidden native input in sync so form submission, native\n * validation and form events reflect the checkbox state.\n *\n * - `indeterminate` is a native property (not a submittable value), so we\n * mirror it here rather than via an attribute.\n * - On every change (but not the initial render) we emit bubbling\n * `input`/`change` events so native form listeners react. We do NOT\n * dispatch a `click`: a click on a checkbox runs the toggle activation\n * behavior and would desync the input from the bound state.\n */\n effect(() => {\n // Track both so the native input mirrors the checkbox and emits change\n // events when either the checked or indeterminate state moves.\n this.rootContext.checked();\n this.input.indeterminate = this.rootContext.indeterminate();\n\n if (isInitial) {\n isInitial = false;\n return;\n }\n\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCheckboxButtonDirective } from './src/checkbox-button';\nimport { RdxCheckboxGroupDirective } from './src/checkbox-group';\nimport { RdxCheckboxIndicatorDirective } from './src/checkbox-indicator';\nimport { RdxCheckboxIndicatorPresenceDirective } from './src/checkbox-indicator-presence';\nimport { RdxCheckboxInputDirective } from './src/checkbox-input';\nimport { RdxCheckboxRootDirective } from './src/checkbox-root';\n\nexport * from './src/checkbox-button';\nexport * from './src/checkbox-group';\nexport * from './src/checkbox-indicator';\nexport * from './src/checkbox-indicator-presence';\nexport * from './src/checkbox-input';\nexport * from './src/checkbox-root';\nexport type { CheckedState } from './src/checkbox-root';\n\nexport const checkboxImports = [\n RdxCheckboxInputDirective,\n RdxCheckboxRootDirective,\n RdxCheckboxButtonDirective,\n RdxCheckboxIndicatorDirective,\n RdxCheckboxIndicatorPresenceDirective,\n RdxCheckboxGroupDirective\n];\n\n@NgModule({\n imports: [...checkboxImports],\n exports: [...checkboxImports]\n})\nexport class RdxCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAuCO,MAAM,CAAC,0BAA0B,EAAE,2BAA2B,CAAC,GAClE,aAAa,CAA0B,sBAAsB;AAEjE,MAAM,YAAY,GAAG,MAA8B;AAC/C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAC/C,OAAO;QACH,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,aAAa;QAC7B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1C,WAAW,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC;AAC9C,QAAA,SAAS,EAAE,MAAM,KAAK,CAAC,SAAS,EAAE;AAClC,QAAA,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,KAAK,CAAC,aAAa,CAAC,IAAI,EA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ACxB,0BAA0B;YAC1B,6BAA6B;YAC7B,qCAAqC;AACrC,YAAA,yBAAyB,aALzB,yBAAyB;YACzB,wBAAwB;YACxB,0BAA0B;YAC1B,6BAA6B;YAC7B,qCAAqC;YACrC,yBAAyB,CAAA,EAAA,CAAA,CAAA;+GAOhB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,eAAe,CAAC;AAC7B,oBAAA,OAAO,EAAE,CAAC,GAAG,eAAe;AAC/B,iBAAA;;;AC5BD;;AAEG;;;;"}
@@ -1,19 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, untracked, model, input, booleanAttribute, linkedSignal, computed, output, Directive, ElementRef, PLATFORM_ID, signal, effect, afterNextRender, NgModule } from '@angular/core';
2
+ import { inject, untracked, model, input, booleanAttribute, signal, computed, output, effect, Directive, ElementRef, DestroyRef, afterRenderEffect, NgModule } from '@angular/core';
3
3
  import * as i1 from '@radix-ng/primitives/presence';
4
4
  import { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';
5
- import { createContext } from '@radix-ng/primitives/core';
6
- import { isPlatformBrowser } from '@angular/common';
5
+ import { createContext, useTransitionStatus, injectId } from '@radix-ng/primitives/core';
7
6
 
8
7
  const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext('CollapsibleRootContext');
9
8
  const rootContext = () => {
10
9
  const instance = inject(RdxCollapsibleRootDirective);
11
10
  return {
12
- contentId: instance.contentId,
13
- disabled: instance.isDisabled,
11
+ panelId: instance.panelId,
14
12
  open: instance.open,
13
+ disabled: instance.disabled,
14
+ transitionStatus: instance.transitionStatus,
15
+ mounted: instance.mounted,
16
+ keepMounted: instance.keepMountedContext,
17
+ hiddenUntilFound: instance.hiddenUntilFoundContext,
18
+ registerTransitionElement: (element) => instance.registerTransitionElement(element),
15
19
  toggle: () => {
16
- if (instance.isDisabled()) {
20
+ if (instance.disabled()) {
17
21
  return;
18
22
  }
19
23
  untracked(() => {
@@ -24,39 +28,83 @@ const rootContext = () => {
24
28
  };
25
29
  };
26
30
  /**
31
+ * Groups all parts of the collapsible.
32
+ *
27
33
  * @group Components
28
34
  */
29
35
  class RdxCollapsibleRootDirective {
30
36
  constructor() {
37
+ this.transition = useTransitionStatus((open) => this.onOpenChangeComplete.emit(open));
38
+ /** Reactive open/close transition phase (`'starting'` | `'ending'` | `undefined`). */
39
+ this.transitionStatus = this.transition.status;
40
+ /** Registers the panel element whose transition duration gates the close completion. */
41
+ this.registerTransitionElement = this.transition.registerElement;
31
42
  /**
32
43
  * The controlled open state of the collapsible.
33
- * Sets the state of the directive. `true` - expanded, `false` - collapsed
44
+ * `true` - expanded, `false` - collapsed.
34
45
  *
35
46
  * @group Props
36
47
  * @defaultValue false
37
48
  */
38
49
  this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
39
- this.contentId = input('', ...(ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []));
40
50
  /**
41
- * Determines whether a directive is available for interaction.
42
- * When true, prevents the user from interacting with the collapsible.
51
+ * The open state of the collapsible when it is initially rendered.
52
+ * Use when you do not need to control its open state.
43
53
  *
44
54
  * @group Props
55
+ * @defaultValue false
56
+ */
57
+ this.defaultOpen = input(false, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
58
+ /**
59
+ * Whether the component should ignore user interaction.
60
+ *
61
+ * @group Props
62
+ * @defaultValue false
45
63
  */
46
64
  this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
47
- this._disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
48
- this.isDisabled = this._disabled.asReadonly();
49
- this.isOpen = computed(() => this.open(), ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
65
+ /** Stable id linking the trigger's `aria-controls` to the panel. */
66
+ this.panelId = input(injectId('rdx-collapsible-panel-'), ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
67
+ /** Composition fallbacks (see {@link CollapsibleRootContext}). Default `false`. */
68
+ this.keepMountedContext = signal(false, ...(ngDevMode ? [{ debugName: "keepMountedContext" }] : /* istanbul ignore next */ []));
69
+ this.hiddenUntilFoundContext = signal(false, ...(ngDevMode ? [{ debugName: "hiddenUntilFoundContext" }] : /* istanbul ignore next */ []));
70
+ /** `true` while the panel must stay rendered: open, or mid exit transition. */
71
+ this.mounted = computed(() => this.open() || this.transitionStatus() === 'ending', ...(ngDevMode ? [{ debugName: "mounted" }] : /* istanbul ignore next */ []));
50
72
  /**
51
- * Emitted with new value when directive state changed.
52
73
  * Event handler called when the open state of the collapsible changes.
53
74
  *
54
75
  * @group Emits
55
76
  */
56
77
  this.onOpenChange = output();
78
+ /**
79
+ * Event handler called after the open/close transition has finished.
80
+ *
81
+ * @group Emits
82
+ */
83
+ this.onOpenChangeComplete = output();
84
+ this.hasAppliedDefaultOpen = false;
85
+ this.previousOpen = this.open();
86
+ effect(() => {
87
+ const defaultOpen = this.defaultOpen();
88
+ if (!this.hasAppliedDefaultOpen && defaultOpen) {
89
+ this.hasAppliedDefaultOpen = true;
90
+ untracked(() => {
91
+ this.open.set(true);
92
+ // Treat an initially-open collapsible as settled so it doesn't play an
93
+ // enter transition on first render.
94
+ this.previousOpen = true;
95
+ });
96
+ }
97
+ });
98
+ effect(() => {
99
+ const open = this.open();
100
+ if (open !== this.previousOpen) {
101
+ this.previousOpen = open;
102
+ untracked(() => this.transition.start(open));
103
+ }
104
+ });
57
105
  }
58
106
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
59
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxCollapsibleRootDirective, isStandalone: true, selector: "[rdxCollapsibleRoot]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, contentId: { classPropertyName: "contentId", publicName: "contentId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", onOpenChange: "onOpenChange" }, host: { properties: { "attr.data-state": "open() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideCollapsibleRootContext(rootContext)], exportAs: ["rdxCollapsibleRoot"], ngImport: i0 }); }
107
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxCollapsibleRootDirective, isStandalone: true, selector: "[rdxCollapsibleRoot]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", onOpenChange: "onOpenChange", onOpenChangeComplete: "onOpenChangeComplete" }, host: { properties: { "attr.data-open": "open() ? \"\" : undefined", "attr.data-closed": "open() ? undefined : \"\"", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideCollapsibleRootContext(rootContext)], exportAs: ["rdxCollapsibleRoot"], ngImport: i0 }); }
60
108
  }
61
109
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleRootDirective, decorators: [{
62
110
  type: Directive,
@@ -65,24 +113,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
65
113
  exportAs: 'rdxCollapsibleRoot',
66
114
  providers: [provideCollapsibleRootContext(rootContext)],
67
115
  host: {
68
- '[attr.data-state]': 'open() ? "open" : "closed"',
116
+ '[attr.data-open]': 'open() ? "" : undefined',
117
+ '[attr.data-closed]': 'open() ? undefined : ""',
69
118
  '[attr.data-disabled]': 'disabled() ? "" : undefined'
70
119
  }
71
120
  }]
72
- }], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], contentId: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onOpenChange: [{ type: i0.Output, args: ["onOpenChange"] }] } });
121
+ }], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }], onOpenChange: [{ type: i0.Output, args: ["onOpenChange"] }], onOpenChangeComplete: [{ type: i0.Output, args: ["onOpenChangeComplete"] }] } });
73
122
 
74
- class RdxCollapsibleContentPresenceDirective {
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleContentPresenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollapsibleContentPresenceDirective, isStandalone: true, selector: "ng-template[rdxCollapsibleContentPresence]", providers: [
123
+ /**
124
+ * Structural directive that mounts the collapsible panel contents only while open, unmounting them
125
+ * once the exit animation finishes. Opt into this when the closed contents should leave the DOM;
126
+ * otherwise apply `rdxCollapsiblePanel` directly (optionally with `keepMounted`).
127
+ */
128
+ class RdxCollapsiblePanelPresenceDirective {
129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsiblePanelPresenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollapsiblePanelPresenceDirective, isStandalone: true, selector: "ng-template[rdxCollapsiblePanelPresence]", providers: [
77
131
  provideRdxPresenceContext(() => ({
78
132
  present: injectCollapsibleRootContext().open
79
133
  }))
80
134
  ], hostDirectives: [{ directive: i1.RdxPresenceDirective }], ngImport: i0 }); }
81
135
  }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleContentPresenceDirective, decorators: [{
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsiblePanelPresenceDirective, decorators: [{
83
137
  type: Directive,
84
138
  args: [{
85
- selector: 'ng-template[rdxCollapsibleContentPresence]',
139
+ selector: 'ng-template[rdxCollapsiblePanelPresence]',
86
140
  providers: [
87
141
  provideRdxPresenceContext(() => ({
88
142
  present: injectCollapsibleRootContext().open
@@ -92,98 +146,145 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
92
146
  }]
93
147
  }] });
94
148
 
95
- class RdxCollapsibleContentDirective {
149
+ /**
150
+ * Coerces a collapsible boolean input that distinguishes "not set" (`undefined`) from `false`,
151
+ * so the Panel only overrides the shared context value when the consumer passes the input.
152
+ */
153
+ const optionalBoolean = (value) => value === undefined ? undefined : booleanAttribute(value);
154
+ /**
155
+ * A panel with the collapsible contents.
156
+ */
157
+ class RdxCollapsiblePanelDirective {
96
158
  constructor() {
97
159
  this.elementRef = inject(ElementRef);
98
- this.platformId = inject(PLATFORM_ID);
99
160
  this.rootContext = injectCollapsibleRootContext();
100
- this.isOpen = computed(() => this.rootContext.open(), ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
161
+ /**
162
+ * Whether to keep the element in the DOM while the panel is closed.
163
+ * When `true`, the closed panel keeps its element (no `hidden` attribute) so the consumer's
164
+ * `data-closed` CSS is responsible for visually collapsing it.
165
+ *
166
+ * @group Props
167
+ * @defaultValue false
168
+ */
169
+ this.keepMounted = input(undefined, { ...(ngDevMode ? { debugName: "keepMounted" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
170
+ /**
171
+ * Allows the browser's built-in page search to find and expand the panel contents.
172
+ * When `true`, the closed panel uses `hidden="until-found"` instead of plain `hidden`.
173
+ *
174
+ * @group Props
175
+ * @defaultValue false
176
+ */
177
+ this.hiddenUntilFound = input(undefined, { ...(ngDevMode ? { debugName: "hiddenUntilFound" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
101
178
  this.height = signal(null, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
102
179
  this.width = signal(null, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
103
- this.shouldHide = signal(true, ...(ngDevMode ? [{ debugName: "shouldHide" }] : /* istanbul ignore next */ []));
104
- this.isMountAnimationPrevented = signal(true, ...(ngDevMode ? [{ debugName: "isMountAnimationPrevented" }] : /* istanbul ignore next */ []));
105
- this.currentStyle = signal(null, ...(ngDevMode ? [{ debugName: "currentStyle" }] : /* istanbul ignore next */ []));
106
- this.firstRender = true;
180
+ /**
181
+ * The `hidden` attribute value. The panel is shown while open or while its exit transition runs;
182
+ * a kept-mounted panel stays visible (the consumer collapses it via CSS); otherwise the closed
183
+ * panel is hidden — with `until-found` when find-in-page support is requested.
184
+ */
185
+ this.hidden = computed(() => {
186
+ const visible = this.rootContext.open() || this.rootContext.transitionStatus() === 'ending';
187
+ if (visible || this.rootContext.keepMounted()) {
188
+ return undefined;
189
+ }
190
+ return this.rootContext.hiddenUntilFound() ? 'until-found' : '';
191
+ }, ...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
192
+ /**
193
+ * The first measurement (the initial mount) must not re-enable animations, so an element that
194
+ * mounts already open renders at its final size without playing the open animation.
195
+ */
196
+ this.isFirstMeasure = true;
197
+ const unregister = this.rootContext.registerTransitionElement(this.elementRef.nativeElement);
198
+ inject(DestroyRef).onDestroy(unregister);
199
+ // Forward the Panel inputs into the shared context, but only when the consumer actually
200
+ // sets them — so Accordion's context writes are never clobbered by the Panel defaults.
107
201
  effect(() => {
108
- const isOpen = this.isOpen();
109
- if (!isPlatformBrowser(this.platformId)) {
110
- return;
202
+ const keepMounted = this.keepMounted();
203
+ if (keepMounted !== undefined) {
204
+ untracked(() => this.rootContext.keepMounted.set(keepMounted));
111
205
  }
112
- requestAnimationFrame(() => {
113
- this.updateDimensions(isOpen);
114
- });
115
206
  });
116
- afterNextRender(() => {
117
- requestAnimationFrame(() => {
118
- this.isMountAnimationPrevented.set(false);
119
- });
207
+ effect(() => {
208
+ const hiddenUntilFound = this.hiddenUntilFound();
209
+ if (hiddenUntilFound !== undefined) {
210
+ untracked(() => this.rootContext.hiddenUntilFound.set(hiddenUntilFound));
211
+ }
212
+ });
213
+ // `afterRenderEffect` runs after the DOM is committed (but before paint) with the settled
214
+ // `open` state — no `requestAnimationFrame` race — and is a no-op during SSR.
215
+ afterRenderEffect(() => {
216
+ // Re-measure whenever the open state flips; the panel is visible at that point (during
217
+ // an exit it is kept rendered by the `ending` transition phase).
218
+ this.rootContext.open();
219
+ this.updateDimensions();
120
220
  });
121
221
  }
122
- onAnimationEnd() {
123
- if (!this.isOpen()) {
124
- this.shouldHide.set(true);
125
- }
126
- }
127
- async updateDimensions(isOpen) {
222
+ updateDimensions() {
128
223
  const node = this.elementRef.nativeElement;
129
224
  if (!node)
130
225
  return;
131
- if (!this.currentStyle()) {
132
- this.currentStyle.set({
133
- transitionDuration: node.style.transitionDuration,
134
- animationName: node.style.animationName
135
- });
136
- }
137
- if (isOpen) {
138
- this.shouldHide.set(false);
139
- node.hidden = false;
140
- }
226
+ this.originalStyles ??= {
227
+ transitionDuration: node.style.transitionDuration,
228
+ animationName: node.style.animationName
229
+ };
230
+ // Block any animation/transition so we can measure the element at its natural size.
141
231
  node.style.transitionDuration = '0s';
142
232
  node.style.animationName = 'none';
233
+ // Let the element take its natural height while measuring, so a `height` bound to the very
234
+ // variable we are computing (the Base UI collapse pattern) does not feed back into itself.
235
+ const previousHeight = node.style.height;
236
+ node.style.height = 'auto';
143
237
  const rect = node.getBoundingClientRect();
144
238
  this.height.set(rect.height);
145
239
  this.width.set(rect.width);
146
- if (!this.isMountAnimationPrevented() && !this.firstRender) {
147
- node.style.transitionDuration = this.currentStyle()?.transitionDuration || '';
148
- node.style.animationName = this.currentStyle()?.animationName || '';
240
+ node.style.height = previousHeight;
241
+ // Re-enable the original animation, unless this is the very first (mount) measurement.
242
+ if (!this.isFirstMeasure) {
243
+ node.style.transitionDuration = this.originalStyles.transitionDuration;
244
+ node.style.animationName = this.originalStyles.animationName;
149
245
  }
150
- this.firstRender = false;
246
+ this.isFirstMeasure = false;
151
247
  }
152
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
153
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollapsibleContentDirective, isStandalone: true, selector: "[rdxCollapsibleContent]", host: { listeners: { "animationend": "onAnimationEnd()" }, properties: { "id": "rootContext.contentId()", "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : undefined", "attr.hidden": "shouldHide() ? \"until-found\" : undefined", "style.--radix-collapsible-content-width.px": "width()", "style.--radix-collapsible-content-height.px": "height()" } }, ngImport: i0 }); }
248
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsiblePanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
249
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxCollapsiblePanelDirective, isStandalone: true, selector: "[rdxCollapsiblePanel]", inputs: { keepMounted: { classPropertyName: "keepMounted", publicName: "keepMounted", isSignal: true, isRequired: false, transformFunction: null }, hiddenUntilFound: { classPropertyName: "hiddenUntilFound", publicName: "hiddenUntilFound", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "rootContext.panelId()", "attr.data-open": "rootContext.open() ? \"\" : undefined", "attr.data-closed": "rootContext.open() ? undefined : \"\"", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.hidden": "hidden()", "style.--collapsible-panel-width.px": "width()", "style.--collapsible-panel-height.px": "height()" } }, ngImport: i0 }); }
154
250
  }
155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleContentDirective, decorators: [{
251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsiblePanelDirective, decorators: [{
156
252
  type: Directive,
157
253
  args: [{
158
- selector: '[rdxCollapsibleContent]',
254
+ selector: '[rdxCollapsiblePanel]',
159
255
  host: {
160
- '[id]': 'rootContext.contentId()',
161
- '[attr.data-state]': 'rootContext.open() ? "open" : "closed"',
162
- '[attr.data-disabled]': 'rootContext.disabled() ? "true" : undefined',
163
- '[attr.hidden]': 'shouldHide() ? "until-found" : undefined',
164
- '[style.--radix-collapsible-content-width.px]': 'width()',
165
- '[style.--radix-collapsible-content-height.px]': 'height()',
166
- '(animationend)': 'onAnimationEnd()'
256
+ '[id]': 'rootContext.panelId()',
257
+ '[attr.data-open]': 'rootContext.open() ? "" : undefined',
258
+ '[attr.data-closed]': 'rootContext.open() ? undefined : ""',
259
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
260
+ '[attr.data-starting-style]': 'rootContext.transitionStatus() === "starting" ? "" : undefined',
261
+ '[attr.data-ending-style]': 'rootContext.transitionStatus() === "ending" ? "" : undefined',
262
+ '[attr.hidden]': 'hidden()',
263
+ '[style.--collapsible-panel-width.px]': 'width()',
264
+ '[style.--collapsible-panel-height.px]': 'height()'
167
265
  }
168
266
  }]
169
- }], ctorParameters: () => [] });
267
+ }], ctorParameters: () => [], propDecorators: { keepMounted: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepMounted", required: false }] }], hiddenUntilFound: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenUntilFound", required: false }] }] } });
170
268
 
269
+ /**
270
+ * A button that opens and closes the collapsible panel.
271
+ */
171
272
  class RdxCollapsibleTriggerDirective {
172
273
  constructor() {
173
274
  this.rootContext = injectCollapsibleRootContext();
174
275
  }
175
276
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
176
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollapsibleTriggerDirective, isStandalone: true, selector: "[rdxCollapsibleTrigger]", host: { listeners: { "click": "rootContext.toggle()" }, properties: { "attr.aria-controls": "rootContext.contentId()", "attr.aria-expanded": "rootContext.open()", "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : undefined", "attr.disabled": "rootContext.disabled() || undefined" } }, ngImport: i0 }); }
277
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxCollapsibleTriggerDirective, isStandalone: true, selector: "[rdxCollapsibleTrigger]", host: { listeners: { "click": "rootContext.toggle()" }, properties: { "attr.aria-controls": "rootContext.panelId()", "attr.aria-expanded": "rootContext.open()", "attr.data-panel-open": "rootContext.open() ? \"\" : undefined", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.disabled": "rootContext.disabled() || undefined" } }, ngImport: i0 }); }
177
278
  }
178
279
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleTriggerDirective, decorators: [{
179
280
  type: Directive,
180
281
  args: [{
181
282
  selector: '[rdxCollapsibleTrigger]',
182
283
  host: {
183
- '[attr.aria-controls]': 'rootContext.contentId()',
284
+ '[attr.aria-controls]': 'rootContext.panelId()',
184
285
  '[attr.aria-expanded]': 'rootContext.open()',
185
- '[attr.data-state]': 'rootContext.open() ? "open" : "closed"',
186
- '[attr.data-disabled]': 'rootContext.disabled() ? "true" : undefined',
286
+ '[attr.data-panel-open]': 'rootContext.open() ? "" : undefined',
287
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
187
288
  '[attr.disabled]': 'rootContext.disabled() || undefined',
188
289
  '(click)': 'rootContext.toggle()'
189
290
  }
@@ -191,20 +292,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
191
292
  }] });
192
293
 
193
294
  const _imports = [
194
- RdxCollapsibleContentDirective,
295
+ RdxCollapsiblePanelDirective,
195
296
  RdxCollapsibleRootDirective,
196
297
  RdxCollapsibleTriggerDirective,
197
- RdxCollapsibleContentPresenceDirective
298
+ RdxCollapsiblePanelPresenceDirective
198
299
  ];
199
300
  class RdxCollapsibleModule {
200
301
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
201
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleModule, imports: [RdxCollapsibleContentDirective,
302
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleModule, imports: [RdxCollapsiblePanelDirective,
202
303
  RdxCollapsibleRootDirective,
203
304
  RdxCollapsibleTriggerDirective,
204
- RdxCollapsibleContentPresenceDirective], exports: [RdxCollapsibleContentDirective,
305
+ RdxCollapsiblePanelPresenceDirective], exports: [RdxCollapsiblePanelDirective,
205
306
  RdxCollapsibleRootDirective,
206
307
  RdxCollapsibleTriggerDirective,
207
- RdxCollapsibleContentPresenceDirective] }); }
308
+ RdxCollapsiblePanelPresenceDirective] }); }
208
309
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleModule }); }
209
310
  }
210
311
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxCollapsibleModule, decorators: [{
@@ -219,5 +320,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
219
320
  * Generated bundle index. Do not edit.
220
321
  */
221
322
 
222
- export { RdxCollapsibleContentDirective, RdxCollapsibleContentPresenceDirective, RdxCollapsibleModule, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsibleRootContext, provideCollapsibleRootContext };
323
+ export { RdxCollapsibleModule, RdxCollapsiblePanelDirective, RdxCollapsiblePanelPresenceDirective, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsibleRootContext, provideCollapsibleRootContext };
223
324
  //# sourceMappingURL=radix-ng-primitives-collapsible.mjs.map