@radix-ng/primitives 0.50.0 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/collection/README.md +1 -0
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +134 -66
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +224 -132
  5. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  6. package/fesm2022/radix-ng-primitives-arrow.mjs +26 -10
  7. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
  9. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-avatar.mjs +68 -75
  11. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  13. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  14. package/fesm2022/radix-ng-primitives-calendar.mjs +104 -103
  15. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-checkbox.mjs +414 -80
  17. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collapsible.mjs +193 -92
  19. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-collection.mjs +72 -0
  21. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
  22. package/fesm2022/radix-ng-primitives-config.mjs +5 -5
  23. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-context-menu.mjs +143 -427
  25. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-core.mjs +757 -757
  27. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-cropper.mjs +55 -53
  29. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-date-field.mjs +93 -86
  31. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-dialog.mjs +658 -330
  33. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +98 -76
  35. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
  37. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  38. package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
  39. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  41. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  42. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  43. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  44. package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
  45. package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-focus-scope.mjs +29 -14
  47. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  49. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  50. package/fesm2022/radix-ng-primitives-label.mjs +11 -11
  51. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-menu.mjs +1484 -353
  53. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  55. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  57. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  58. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1060 -1553
  59. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -366
  61. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
  63. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-popover.mjs +980 -995
  65. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-popper.mjs +137 -82
  67. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-portal.mjs +40 -16
  69. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  71. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  73. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  74. package/fesm2022/radix-ng-primitives-progress.mjs +231 -92
  75. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-radio.mjs +211 -70
  77. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-roving-focus.mjs +127 -77
  79. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-select.mjs +791 -511
  81. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-separator.mjs +16 -45
  83. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-slider.mjs +976 -720
  85. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-stepper.mjs +69 -71
  87. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-switch.mjs +128 -124
  89. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-tabs.mjs +388 -115
  91. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-time-field.mjs +111 -117
  93. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle-group.mjs +122 -248
  95. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toggle.mjs +99 -62
  97. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-toolbar.mjs +307 -94
  99. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1079
  101. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  102. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +46 -87
  103. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  104. package/fesm2022/radix-ng-primitives.mjs.map +1 -1
  105. package/meter/README.md +3 -0
  106. package/navigation-menu/README.md +2 -1
  107. package/package.json +85 -63
  108. package/portal/README.md +2 -0
  109. package/preview-card/README.md +3 -0
  110. package/schematics/collection.json +1 -0
  111. package/schematics/ng-add/index.d.ts +3 -2
  112. package/schematics/ng-add/index.js +62 -31
  113. package/schematics/ng-add/index.js.map +1 -1
  114. package/schematics/ng-add/package-config.d.ts +4 -2
  115. package/schematics/ng-add/package-config.js +10 -2
  116. package/schematics/ng-add/package-config.js.map +1 -1
  117. package/schematics/ng-add/schema.d.ts +3 -0
  118. package/schematics/ng-add/schema.js +3 -0
  119. package/schematics/ng-add/schema.js.map +1 -0
  120. package/schematics/ng-add/schema.json +14 -0
  121. package/select/README.md +2 -0
  122. package/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +102 -67
  123. package/types/radix-ng-primitives-alert-dialog.d.ts +114 -0
  124. package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +1 -1
  125. package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +1 -1
  126. package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +7 -11
  127. package/types/radix-ng-primitives-button.d.ts +73 -0
  128. package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +2 -3
  129. package/types/radix-ng-primitives-checkbox.d.ts +337 -0
  130. package/types/radix-ng-primitives-collapsible.d.ts +159 -0
  131. package/types/radix-ng-primitives-collection.d.ts +44 -0
  132. package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +1 -1
  133. package/types/radix-ng-primitives-context-menu.d.ts +73 -0
  134. package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +311 -236
  135. package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +6 -5
  136. package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +42 -27
  137. package/types/radix-ng-primitives-dialog.d.ts +323 -0
  138. package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +15 -7
  139. package/types/radix-ng-primitives-drawer.d.ts +448 -0
  140. package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +1 -1
  141. package/types/radix-ng-primitives-field.d.ts +373 -0
  142. package/types/radix-ng-primitives-fieldset.d.ts +48 -0
  143. package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +13 -5
  144. package/types/radix-ng-primitives-input.d.ts +87 -0
  145. package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -1
  146. package/types/radix-ng-primitives-menu.d.ts +612 -0
  147. package/types/radix-ng-primitives-menubar.d.ts +66 -0
  148. package/types/radix-ng-primitives-meter.d.ts +193 -0
  149. package/types/radix-ng-primitives-navigation-menu.d.ts +488 -0
  150. package/types/radix-ng-primitives-number-field.d.ts +464 -0
  151. package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +2 -2
  152. package/types/radix-ng-primitives-popover.d.ts +416 -0
  153. package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +50 -9
  154. package/types/radix-ng-primitives-portal.d.ts +30 -0
  155. package/types/radix-ng-primitives-presence.d.ts +55 -0
  156. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  157. package/types/radix-ng-primitives-progress.d.ts +206 -0
  158. package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +56 -26
  159. package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +38 -27
  160. package/types/radix-ng-primitives-select.d.ts +512 -0
  161. package/types/radix-ng-primitives-separator.d.ts +38 -0
  162. package/types/radix-ng-primitives-slider.d.ts +377 -0
  163. package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +21 -22
  164. package/types/radix-ng-primitives-switch.d.ts +121 -0
  165. package/types/radix-ng-primitives-tabs.d.ts +247 -0
  166. package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +46 -31
  167. package/types/radix-ng-primitives-toggle-group.d.ts +116 -0
  168. package/types/radix-ng-primitives-toggle.d.ts +65 -0
  169. package/types/radix-ng-primitives-toolbar.d.ts +180 -0
  170. package/types/radix-ng-primitives-tooltip.d.ts +395 -0
  171. package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +19 -19
  172. package/alert-dialog/index.d.ts +0 -57
  173. package/checkbox/index.d.ts +0 -164
  174. package/collapsible/index.d.ts +0 -85
  175. package/context-menu/index.d.ts +0 -129
  176. package/dialog/index.d.ts +0 -205
  177. package/dropdown-menu/README.md +0 -1
  178. package/dropdown-menu/index.d.ts +0 -171
  179. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -583
  180. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  181. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1246
  182. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  183. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -740
  184. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  185. package/hover-card/README.md +0 -3
  186. package/hover-card/index.d.ts +0 -472
  187. package/menu/index.d.ts +0 -139
  188. package/menubar/index.d.ts +0 -56
  189. package/navigation-menu/index.d.ts +0 -405
  190. package/number-field/index.d.ts +0 -203
  191. package/popover/index.d.ts +0 -403
  192. package/portal/index.d.ts +0 -22
  193. package/presence/index.d.ts +0 -103
  194. package/progress/index.d.ts +0 -79
  195. package/select/index.d.ts +0 -214
  196. package/separator/index.d.ts +0 -63
  197. package/slider/index.d.ts +0 -263
  198. package/switch/index.d.ts +0 -105
  199. package/tabs/index.d.ts +0 -112
  200. package/toggle/index.d.ts +0 -75
  201. package/toggle-group/index.d.ts +0 -194
  202. package/toolbar/index.d.ts +0 -55
  203. package/tooltip/index.d.ts +0 -433
  204. package/tooltip2/README.md +0 -3
  205. package/tooltip2/index.d.ts +0 -325
  206. /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
  207. /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ # @radix-ng/primitives/collection
@@ -1,19 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, inject, ElementRef, input, booleanAttribute, model, output, computed, effect, NgModule } from '@angular/core';
2
+ import { Directive, inject, ElementRef, input, booleanAttribute, model, output, computed, effect, signal, NgModule } from '@angular/core';
3
3
  import * as i1 from '@radix-ng/primitives/collapsible';
4
- import { RdxCollapsibleContentPresenceDirective, injectCollapsibleRootContext, RdxCollapsibleRootDirective, RdxCollapsibleContentDirective, RdxCollapsibleTriggerDirective } from '@radix-ng/primitives/collapsible';
5
- import { createContext, useArrowNavigation } from '@radix-ng/primitives/core';
6
- import { _IdGenerator } from '@angular/cdk/a11y';
4
+ import { RdxCollapsiblePanelPresenceDirective, injectCollapsibleRootContext, RdxCollapsibleRootDirective, RdxCollapsiblePanelDirective } from '@radix-ng/primitives/collapsible';
5
+ import { createContext, injectId, useArrowNavigation } from '@radix-ng/primitives/core';
7
6
 
8
7
  class RdxAccordionContentPresenceDirective {
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionContentPresenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
10
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxAccordionContentPresenceDirective, isStandalone: true, selector: "ng-template[rdxAccordionContentPresence]", hostDirectives: [{ directive: i1.RdxCollapsibleContentPresenceDirective }], ngImport: i0 }); }
8
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionContentPresenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
9
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxAccordionContentPresenceDirective, isStandalone: true, selector: "ng-template[rdxAccordionContentPresence]", hostDirectives: [{ directive: i1.RdxCollapsiblePanelPresenceDirective }], ngImport: i0 }); }
11
10
  }
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionContentPresenceDirective, decorators: [{
11
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionContentPresenceDirective, decorators: [{
13
12
  type: Directive,
14
13
  args: [{
15
14
  selector: 'ng-template[rdxAccordionContentPresence]',
16
- hostDirectives: [RdxCollapsibleContentPresenceDirective]
15
+ hostDirectives: [RdxCollapsiblePanelPresenceDirective]
17
16
  }]
18
17
  }] });
19
18
 
@@ -28,6 +27,8 @@ const rootContext = () => {
28
27
  elementRef: instance.elementRef,
29
28
  value: instance.value,
30
29
  isSingle: instance.isSingle,
30
+ loopFocus: instance.loopFocus,
31
+ keepMounted: instance.keepMounted,
31
32
  changeModelValue: instance.changeModelValue
32
33
  };
33
34
  };
@@ -37,38 +38,38 @@ const rootContext = () => {
37
38
  class RdxAccordionRootDirective {
38
39
  constructor() {
39
40
  this.elementRef = inject(ElementRef);
40
- this.id = input(inject(_IdGenerator).getId('rdx-accordion-'), ...(ngDevMode ? [{ debugName: "id" }] : []));
41
+ this.id = input(injectId('rdx-accordion-'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
41
42
  /**
42
43
  * The reading direction of the accordion when applicable. If omitted, assumes LTR (left-to-right) reading mode.
43
44
  *
44
45
  * @group Props
45
46
  */
46
- this.dir = input('ltr', ...(ngDevMode ? [{ debugName: "dir" }] : []));
47
+ this.dir = input('ltr', ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
47
48
  /** Whether the Accordion is disabled.
48
49
  * @defaultValue false
49
50
  * @group Props
50
51
  */
51
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
52
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
52
53
  /**
53
54
  * The orientation of the accordion.
54
55
  *
55
56
  * @defaultValue 'vertical'
56
57
  * @group Props
57
58
  */
58
- this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
59
+ this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
59
60
  /**
60
61
  * The default active value of the item(s).
61
62
  *
62
63
  * Use when you do not need to control the state of the item(s).
63
64
  * @group Props
64
65
  */
65
- this.defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : []));
66
+ this.defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : /* istanbul ignore next */ []));
66
67
  /**
67
68
  * The controlled value of the item to expand.
68
69
  *
69
70
  * @group Props
70
71
  */
71
- this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
72
+ this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
72
73
  /**
73
74
  * When type is "single", allows closing content when clicking trigger for an open item.
74
75
  * When type is "multiple", this prop has no effect.
@@ -76,22 +77,48 @@ class RdxAccordionRootDirective {
76
77
  * @defaultValue false
77
78
  * @group Props
78
79
  */
79
- this.collapsible = input(false, ...(ngDevMode ? [{ debugName: "collapsible", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
80
+ this.collapsible = input(false, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
80
81
  /**
81
82
  * Determines whether a "single" or "multiple" items can be selected at a time.
82
83
  *
83
84
  * @defaultValue 'single'
84
85
  * @group Props
85
86
  */
86
- this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : []));
87
+ this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
87
88
  /**
88
- * Event handler called when the expanded state of an item changes and type is "multiple".
89
+ * Allow multiple panels to be open simultaneously.
90
+ * Takes precedence over `type` when `true`.
91
+ *
92
+ * @defaultValue false
93
+ * @group Props
94
+ */
95
+ this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
96
+ /**
97
+ * Whether keyboard focus wraps from the last item to the first and vice versa.
98
+ *
99
+ * @defaultValue true
100
+ * @group Props
101
+ */
102
+ this.loopFocus = input(true, { ...(ngDevMode ? { debugName: "loopFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
103
+ /**
104
+ * Whether to keep the content of collapsed items mounted in the DOM.
105
+ * When `true`, closed panels keep their element in the DOM instead of
106
+ * receiving a `hidden` attribute. Applies to the always-mounted
107
+ * `rdxAccordionContent`; the `rdxAccordionContentPresence` variant always
108
+ * unmounts.
109
+ *
110
+ * @defaultValue false
111
+ * @group Props
112
+ */
113
+ this.keepMounted = input(false, { ...(ngDevMode ? { debugName: "keepMounted" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
114
+ /**
115
+ * Event handler called when the expanded state of an item changes.
89
116
  * @group Emits
90
117
  */
91
118
  this.onValueChange = output();
92
- this.isSingle = computed(() => this.type() === 'single', ...(ngDevMode ? [{ debugName: "isSingle" }] : []));
119
+ this.isSingle = computed(() => !this.multiple() && this.type() !== 'multiple', ...(ngDevMode ? [{ debugName: "isSingle" }] : /* istanbul ignore next */ []));
93
120
  this.changeModelValue = (newValue) => {
94
- if (this.type() === 'single') {
121
+ if (this.isSingle()) {
95
122
  this.value.set(this.isEqual(newValue, this.value()) ? undefined : newValue);
96
123
  }
97
124
  else {
@@ -114,6 +141,7 @@ class RdxAccordionRootDirective {
114
141
  }
115
142
  this.value.set(modelValueArray);
116
143
  }
144
+ this.onValueChange.emit(this.value());
117
145
  };
118
146
  effect(() => {
119
147
  if (this.defaultValue() !== undefined) {
@@ -127,20 +155,21 @@ class RdxAccordionRootDirective {
127
155
  isEqual(a, b) {
128
156
  return JSON.stringify(a) === JSON.stringify(b);
129
157
  }
130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
131
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: RdxAccordionRootDirective, isStandalone: true, selector: "[rdxAccordionRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-orientation": "orientation()" } }, providers: [provideAccordionRootContext(rootContext)], exportAs: ["rdxAccordionRoot"], ngImport: i0 }); }
158
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
159
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxAccordionRootDirective, isStandalone: true, selector: "[rdxAccordionRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null }, keepMounted: { classPropertyName: "keepMounted", publicName: "keepMounted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideAccordionRootContext(rootContext)], exportAs: ["rdxAccordionRoot"], ngImport: i0 }); }
132
160
  }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionRootDirective, decorators: [{
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionRootDirective, decorators: [{
134
162
  type: Directive,
135
163
  args: [{
136
164
  selector: '[rdxAccordionRoot]',
137
165
  exportAs: 'rdxAccordionRoot',
138
166
  providers: [provideAccordionRootContext(rootContext)],
139
167
  host: {
140
- '[attr.data-orientation]': 'orientation()'
168
+ '[attr.data-orientation]': 'orientation()',
169
+ '[attr.data-disabled]': 'disabled() ? "" : undefined'
141
170
  }
142
171
  }]
143
- }], ctorParameters: () => [] });
172
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], loopFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "loopFocus", required: false }] }], keepMounted: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepMounted", required: false }] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }] } });
144
173
 
145
174
  const [injectAccordionItemContext, provideAccordionItemContext] = createContext('AccordionItemContext');
146
175
  const itemContext = () => {
@@ -150,10 +179,11 @@ const itemContext = () => {
150
179
  dataState: instance.dataState,
151
180
  disabled: instance.disabled,
152
181
  dataDisabled: instance.isDisabled,
153
- triggerId: '',
182
+ triggerId: instance.triggerId,
154
183
  currentElement: instance.elementRef,
155
184
  value: computed(() => instance.value()),
156
- updateOpen: instance.updateOpen
185
+ updateOpen: instance.updateOpen,
186
+ index: instance.index
157
187
  };
158
188
  };
159
189
  /**
@@ -168,43 +198,74 @@ class RdxAccordionItemDirective {
168
198
  * A string value for the accordion item. All items within an accordion should use a unique value.
169
199
  * @group Props
170
200
  */
171
- this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
201
+ this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
172
202
  /**
173
203
  * Whether or not an accordion item is disabled from user interaction.
174
204
  * When `true`, prevents the user from interacting with the item.
175
205
  * @group Props
176
206
  */
177
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
207
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
208
+ /**
209
+ * Event handler called when the panel open state changes.
210
+ * @group Emits
211
+ */
212
+ this.onOpenChange = output();
178
213
  this.isDisabled = computed(() => {
179
214
  return this.rootContext.disabled() || this.disabled();
180
- }, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
181
- this.open = computed(() => this.rootContext.isSingle()
182
- ? this.value() === this.rootContext.value()
183
- : Array.isArray(this.rootContext.value()) && this.rootContext.value().includes(this.value()), ...(ngDevMode ? [{ debugName: "open" }] : []));
184
- this.dataState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "dataState" }] : []));
215
+ }, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
216
+ this.open = computed(() => {
217
+ const rootValue = this.rootContext.value();
218
+ return this.rootContext.isSingle()
219
+ ? this.value() === rootValue
220
+ : Array.isArray(rootValue) && rootValue.includes(this.value());
221
+ }, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
222
+ this.dataState = computed(() => (this.open() ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "dataState" }] : /* istanbul ignore next */ []));
223
+ /** Set by the trigger; links the content's `aria-labelledby` to the trigger `id`. */
224
+ this.triggerId = signal('', ...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
225
+ this.index = computed(() => {
226
+ const allItems = Array.from(this.rootContext.elementRef.nativeElement.querySelectorAll('[rdxAccordionItem]'));
227
+ return allItems.indexOf(this.elementRef.nativeElement);
228
+ }, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
185
229
  this.updateOpen = () => {
186
230
  this.collapsibleContext.open.set(this.open());
187
231
  };
232
+ // Collapsed accordion panels stay findable by the browser's in-page search; opening one
233
+ // via find-in-page expands the item. (The standalone Collapsible defaults to plain `hidden`.)
234
+ this.collapsibleContext.hiddenUntilFound.set(true);
188
235
  effect(() => {
189
236
  this.updateOpen();
190
237
  });
238
+ effect(() => {
239
+ this.collapsibleContext.keepMounted.set(this.rootContext.keepMounted());
240
+ });
241
+ let initialized = false;
242
+ effect(() => {
243
+ const isOpen = this.open();
244
+ if (!initialized) {
245
+ initialized = true;
246
+ return;
247
+ }
248
+ this.onOpenChange.emit(isOpen);
249
+ });
191
250
  }
192
251
  handleArrowKey(event) {
252
+ const keyEvent = event;
193
253
  const target = event.target;
194
254
  const allCollectionItems = Array.from(this.rootContext.elementRef.nativeElement?.querySelectorAll('[data-rdx-collection-item]') ?? []);
195
255
  const collectionItemIndex = allCollectionItems.findIndex((item) => item === target);
196
256
  if (collectionItemIndex === -1)
197
257
  return;
198
- useArrowNavigation(event, this.elementRef.nativeElement.querySelector('[data-rdx-collection-item]'), this.rootContext.elementRef.nativeElement, {
258
+ useArrowNavigation(keyEvent, this.elementRef.nativeElement.querySelector('[data-rdx-collection-item]'), this.rootContext.elementRef.nativeElement, {
199
259
  arrowKeyOptions: this.rootContext.orientation(),
200
260
  dir: this.rootContext.direction(),
261
+ loop: this.rootContext.loopFocus(),
201
262
  focus: true
202
263
  });
203
264
  }
204
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
205
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: RdxAccordionItemDirective, isStandalone: true, selector: "[rdxAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.arrowDown": "handleArrowKey($event)", "keydown.arrowUp": "handleArrowKey($event)", "keydown.arrowLeft": "handleArrowKey($event)", "keydown.arrowRight": "handleArrowKey($event)", "keydown.home": "handleArrowKey($event)", "keydown.end": "handleArrowKey($event)" }, properties: { "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-state": "dataState()" } }, providers: [provideAccordionItemContext(itemContext)], exportAs: ["rdxAccordionItem"], hostDirectives: [{ directive: i1.RdxCollapsibleRootDirective, inputs: ["disabled", "disabled", "open", "open"] }], ngImport: i0 }); }
265
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
266
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxAccordionItemDirective, isStandalone: true, selector: "[rdxAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onOpenChange: "onOpenChange" }, host: { listeners: { "keydown.arrowDown": "handleArrowKey($event)", "keydown.arrowUp": "handleArrowKey($event)", "keydown.arrowLeft": "handleArrowKey($event)", "keydown.arrowRight": "handleArrowKey($event)", "keydown.home": "handleArrowKey($event)", "keydown.end": "handleArrowKey($event)" }, properties: { "attr.data-orientation": "rootContext.orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-state": "dataState()", "attr.data-index": "index()" } }, providers: [provideAccordionItemContext(itemContext)], exportAs: ["rdxAccordionItem"], hostDirectives: [{ directive: i1.RdxCollapsibleRootDirective, inputs: ["disabled", "disabled", "open", "open"] }], ngImport: i0 }); }
206
267
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionItemDirective, decorators: [{
268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionItemDirective, decorators: [{
208
269
  type: Directive,
209
270
  args: [{
210
271
  selector: '[rdxAccordionItem]',
@@ -218,8 +279,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
218
279
  ],
219
280
  host: {
220
281
  '[attr.data-orientation]': 'rootContext.orientation()',
221
- '[attr.data-disabled]': 'disabled() ? "" : undefined',
282
+ '[attr.data-disabled]': 'isDisabled() ? "" : undefined',
222
283
  '[attr.data-state]': 'dataState()',
284
+ '[attr.data-index]': 'index()',
223
285
  '(keydown.arrowDown)': 'handleArrowKey($event)',
224
286
  '(keydown.arrowUp)': 'handleArrowKey($event)',
225
287
  '(keydown.arrowLeft)': 'handleArrowKey($event)',
@@ -228,30 +290,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
228
290
  '(keydown.end)': 'handleArrowKey($event)'
229
291
  }
230
292
  }]
231
- }], ctorParameters: () => [] });
293
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onOpenChange: [{ type: i0.Output, args: ["onOpenChange"] }] } });
232
294
 
233
295
  class RdxAccordionContentDirective {
234
296
  constructor() {
235
297
  this.rootContext = injectAccordionRootContext();
236
298
  this.itemContext = injectAccordionItemContext();
237
299
  }
238
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
239
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxAccordionContentDirective, isStandalone: true, selector: "[rdxAccordionContent]", host: { attributes: { "role": "region" }, properties: { "attr.aria-labelledby": "itemContext.triggerId", "attr.data-state": "itemContext.dataState()", "attr.data-disabled": "itemContext.dataDisabled()", "attr.data-orientation": "rootContext.orientation()", "style": "{\n '--radix-accordion-content-height': 'var(--radix-collapsible-content-height)',\n '--radix-accordion-content-width': 'var(--radix-collapsible-content-width)',\n }" } }, hostDirectives: [{ directive: i1.RdxCollapsibleContentDirective }], ngImport: i0 }); }
300
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
301
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxAccordionContentDirective, isStandalone: true, selector: "[rdxAccordionContent]", host: { attributes: { "role": "region" }, properties: { "attr.aria-labelledby": "itemContext.triggerId()", "attr.data-state": "itemContext.dataState()", "attr.data-disabled": "itemContext.dataDisabled() ? \"\" : undefined", "attr.data-orientation": "rootContext.orientation()", "attr.data-index": "itemContext.index()", "style": "{\n '--radix-accordion-content-height': 'var(--collapsible-panel-height)',\n '--radix-accordion-content-width': 'var(--collapsible-panel-width)',\n }" } }, hostDirectives: [{ directive: i1.RdxCollapsiblePanelDirective }], ngImport: i0 }); }
240
302
  }
241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionContentDirective, decorators: [{
303
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionContentDirective, decorators: [{
242
304
  type: Directive,
243
305
  args: [{
244
306
  selector: '[rdxAccordionContent]',
245
- hostDirectives: [RdxCollapsibleContentDirective],
307
+ hostDirectives: [RdxCollapsiblePanelDirective],
246
308
  host: {
247
309
  role: 'region',
248
- '[attr.aria-labelledby]': 'itemContext.triggerId',
310
+ '[attr.aria-labelledby]': 'itemContext.triggerId()',
249
311
  '[attr.data-state]': 'itemContext.dataState()',
250
- '[attr.data-disabled]': 'itemContext.dataDisabled()',
312
+ '[attr.data-disabled]': 'itemContext.dataDisabled() ? "" : undefined',
251
313
  '[attr.data-orientation]': 'rootContext.orientation()',
314
+ '[attr.data-index]': 'itemContext.index()',
252
315
  '[style]': `{
253
- '--radix-accordion-content-height': 'var(--radix-collapsible-content-height)',
254
- '--radix-accordion-content-width': 'var(--radix-collapsible-content-width)',
316
+ '--radix-accordion-content-height': 'var(--collapsible-panel-height)',
317
+ '--radix-accordion-content-width': 'var(--collapsible-panel-width)',
255
318
  }`
256
319
  }
257
320
  }]
@@ -262,17 +325,18 @@ class RdxAccordionHeaderDirective {
262
325
  this.rootContext = injectAccordionRootContext();
263
326
  this.itemContext = injectAccordionItemContext();
264
327
  }
265
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
266
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxAccordionHeaderDirective, isStandalone: true, selector: "[rdxAccordionHeader]", host: { properties: { "attr.data-state": "itemContext.dataState()", "attr.data-disabled": "itemContext.dataDisabled()", "attr.data-orientation": "rootContext.orientation()" } }, ngImport: i0 }); }
328
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
329
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxAccordionHeaderDirective, isStandalone: true, selector: "[rdxAccordionHeader]", host: { properties: { "attr.data-state": "itemContext.dataState()", "attr.data-disabled": "itemContext.dataDisabled() ? \"\" : undefined", "attr.data-orientation": "rootContext.orientation()", "attr.data-index": "itemContext.index()" } }, ngImport: i0 }); }
267
330
  }
268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionHeaderDirective, decorators: [{
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionHeaderDirective, decorators: [{
269
332
  type: Directive,
270
333
  args: [{
271
334
  selector: '[rdxAccordionHeader]',
272
335
  host: {
273
336
  '[attr.data-state]': 'itemContext.dataState()',
274
- '[attr.data-disabled]': 'itemContext.dataDisabled()',
275
- '[attr.data-orientation]': 'rootContext.orientation()'
337
+ '[attr.data-disabled]': 'itemContext.dataDisabled() ? "" : undefined',
338
+ '[attr.data-orientation]': 'rootContext.orientation()',
339
+ '[attr.data-index]': 'itemContext.index()'
276
340
  }
277
341
  }]
278
342
  }] });
@@ -281,31 +345,35 @@ class RdxAccordionTriggerDirective {
281
345
  constructor() {
282
346
  this.rootContext = injectAccordionRootContext();
283
347
  this.itemContext = injectAccordionItemContext();
284
- this.itemContext.triggerId = inject(_IdGenerator).getId('rdx-accordion-trigger-');
348
+ this.itemContext.triggerId.set(injectId('rdx-accordion-trigger-'));
285
349
  }
286
350
  changeItem() {
287
- const triggerDisabled = this.rootContext.isSingle() && this.itemContext.open() && !this.rootContext.collapsible();
288
- if (this.itemContext.disabled() || triggerDisabled) {
289
- this.itemContext.updateOpen();
351
+ // In single mode an open item stays open (unless `collapsible`), so a click on it is a no-op.
352
+ const lockedOpen = this.rootContext.isSingle() && this.itemContext.open() && !this.rootContext.collapsible();
353
+ // `dataDisabled` is the effective disabled state (accordion-root OR item level).
354
+ if (this.itemContext.dataDisabled() || lockedOpen) {
290
355
  return;
291
356
  }
292
357
  this.rootContext.changeModelValue(this.itemContext.value());
293
358
  }
294
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
295
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxAccordionTriggerDirective, isStandalone: true, selector: "[rdxAccordionTrigger]", host: { listeners: { "click": "changeItem()" }, properties: { "id": "itemContext.triggerId", "attr.data-rdx-collection-item": "\"\"", "attr.role": "\"button\"", "attr.aria-disabled": "itemContext.open() && !rootContext.collapsible() ? \"true\" : undefined", "attr.data-orientation": "rootContext.orientation()", "disabled": "itemContext.disabled()" } }, hostDirectives: [{ directive: i1.RdxCollapsibleTriggerDirective }], ngImport: i0 }); }
359
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
360
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxAccordionTriggerDirective, isStandalone: true, selector: "[rdxAccordionTrigger]", host: { listeners: { "click": "changeItem()" }, properties: { "id": "itemContext.triggerId()", "attr.data-rdx-collection-item": "\"\"", "attr.role": "\"button\"", "attr.aria-expanded": "itemContext.open()", "attr.aria-disabled": "itemContext.open() && !rootContext.collapsible() ? \"true\" : undefined", "attr.data-orientation": "rootContext.orientation()", "attr.data-state": "itemContext.dataState()", "attr.disabled": "itemContext.dataDisabled() ? \"\" : undefined", "attr.data-panel-open": "itemContext.open() ? \"\" : undefined", "attr.data-index": "itemContext.index()" } }, ngImport: i0 }); }
296
361
  }
297
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionTriggerDirective, decorators: [{
362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionTriggerDirective, decorators: [{
298
363
  type: Directive,
299
364
  args: [{
300
365
  selector: '[rdxAccordionTrigger]',
301
- hostDirectives: [RdxCollapsibleTriggerDirective],
302
366
  host: {
303
- '[id]': 'itemContext.triggerId',
367
+ '[id]': 'itemContext.triggerId()',
304
368
  '[attr.data-rdx-collection-item]': '""',
305
369
  '[attr.role]': '"button"',
370
+ '[attr.aria-expanded]': 'itemContext.open()',
306
371
  '[attr.aria-disabled]': 'itemContext.open() && !rootContext.collapsible() ? "true" : undefined',
307
372
  '[attr.data-orientation]': 'rootContext.orientation()',
308
- '[disabled]': 'itemContext.disabled()',
373
+ '[attr.data-state]': 'itemContext.dataState()',
374
+ '[attr.disabled]': 'itemContext.dataDisabled() ? "" : undefined',
375
+ '[attr.data-panel-open]': 'itemContext.open() ? "" : undefined',
376
+ '[attr.data-index]': 'itemContext.index()',
309
377
  '(click)': 'changeItem()'
310
378
  }
311
379
  }]
@@ -320,8 +388,8 @@ const _imports = [
320
388
  RdxAccordionContentPresenceDirective
321
389
  ];
322
390
  class RdxAccordionModule {
323
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
324
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionModule, imports: [RdxAccordionContentDirective,
391
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
392
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionModule, imports: [RdxAccordionContentDirective,
325
393
  RdxAccordionHeaderDirective,
326
394
  RdxAccordionItemDirective,
327
395
  RdxAccordionRootDirective,
@@ -332,9 +400,9 @@ class RdxAccordionModule {
332
400
  RdxAccordionRootDirective,
333
401
  RdxAccordionTriggerDirective,
334
402
  RdxAccordionContentPresenceDirective] }); }
335
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionModule }); }
403
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionModule }); }
336
404
  }
337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxAccordionModule, decorators: [{
405
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAccordionModule, decorators: [{
338
406
  type: NgModule,
339
407
  args: [{
340
408
  imports: [..._imports],