@radix-ng/primitives 0.5.0 → 0.6.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 (180) hide show
  1. package/alert-dialog/README.md +1 -0
  2. package/alert-dialog/index.d.ts +6 -0
  3. package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +7 -0
  4. package/alert-dialog/src/alert-dialog-content.directive.d.ts +8 -0
  5. package/alert-dialog/src/alert-dialog-root.directive.d.ts +9 -0
  6. package/alert-dialog/src/alert-dialog-title.directive.d.ts +5 -0
  7. package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +7 -0
  8. package/alert-dialog/src/alert-dialog.service.d.ts +14 -0
  9. package/avatar/index.d.ts +3 -1
  10. package/avatar/src/avatar-fallback.directive.d.ts +10 -17
  11. package/avatar/src/avatar-image.directive.d.ts +10 -11
  12. package/avatar/src/avatar-root.directive.d.ts +21 -0
  13. package/avatar/src/avatar.config.d.ts +3 -2
  14. package/checkbox/src/checkbox.directive.d.ts +2 -1
  15. package/collapsible/README.md +1 -0
  16. package/collapsible/index.d.ts +3 -0
  17. package/collapsible/src/collapsible-content.directive.d.ts +11 -0
  18. package/collapsible/src/collapsible-root.directive.d.ts +52 -0
  19. package/collapsible/src/collapsible-trigger.directive.d.ts +26 -0
  20. package/esm2022/alert-dialog/index.mjs +7 -0
  21. package/esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs +5 -0
  22. package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +24 -0
  23. package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +26 -0
  24. package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +24 -0
  25. package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +14 -0
  26. package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +24 -0
  27. package/esm2022/alert-dialog/src/alert-dialog.service.mjs +45 -0
  28. package/esm2022/avatar/index.mjs +2 -2
  29. package/esm2022/avatar/src/avatar-fallback.directive.mjs +23 -30
  30. package/esm2022/avatar/src/avatar-image.directive.mjs +29 -31
  31. package/esm2022/avatar/src/avatar-root.directive.mjs +38 -0
  32. package/esm2022/avatar/src/avatar.config.mjs +2 -2
  33. package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +4 -4
  34. package/esm2022/checkbox/src/checkbox.directive.mjs +4 -4
  35. package/esm2022/collapsible/index.mjs +4 -0
  36. package/esm2022/collapsible/radix-ng-primitives-collapsible.mjs +5 -0
  37. package/esm2022/collapsible/src/collapsible-content.directive.mjs +26 -0
  38. package/esm2022/collapsible/src/collapsible-root.directive.mjs +114 -0
  39. package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +49 -0
  40. package/esm2022/label/index.mjs +2 -2
  41. package/esm2022/label/src/label-root.directive.mjs +48 -0
  42. package/esm2022/progress/index.mjs +2 -2
  43. package/esm2022/progress/src/progress-indicator.directive.mjs +11 -10
  44. package/esm2022/progress/src/progress-root.directive.mjs +71 -0
  45. package/esm2022/radio/index.mjs +2 -4
  46. package/esm2022/radio/src/radio-indicator.directive.mjs +8 -13
  47. package/esm2022/radio/src/radio-item.directive.mjs +27 -42
  48. package/esm2022/radio/src/radio-root.directive.mjs +106 -0
  49. package/esm2022/roving-focus/index.mjs +1 -3
  50. package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +9 -16
  51. package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +21 -26
  52. package/esm2022/separator/src/separator.directive.mjs +12 -17
  53. package/esm2022/switch/index.mjs +2 -3
  54. package/esm2022/switch/src/switch-root.directive.mjs +74 -0
  55. package/esm2022/switch/src/switch-thumb.directive.mjs +10 -12
  56. package/esm2022/toggle/index.mjs +2 -2
  57. package/esm2022/toggle/src/toggle-root.directive.mjs +51 -0
  58. package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +4 -4
  59. package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +4 -4
  60. package/esm2022/toggle-group/src/toggle-group.directive.mjs +4 -4
  61. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +150 -0
  62. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -0
  63. package/fesm2022/radix-ng-primitives-avatar.mjs +79 -90
  64. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  65. package/fesm2022/radix-ng-primitives-checkbox.mjs +6 -6
  66. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  67. package/fesm2022/radix-ng-primitives-collapsible.mjs +190 -0
  68. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -0
  69. package/fesm2022/radix-ng-primitives-label.mjs +20 -32
  70. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  71. package/fesm2022/radix-ng-primitives-progress.mjs +55 -49
  72. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  73. package/fesm2022/radix-ng-primitives-radio.mjs +70 -100
  74. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  75. package/fesm2022/radix-ng-primitives-roving-focus.mjs +19 -42
  76. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  77. package/fesm2022/radix-ng-primitives-separator.mjs +12 -17
  78. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  79. package/fesm2022/radix-ng-primitives-switch.mjs +49 -106
  80. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  81. package/fesm2022/radix-ng-primitives-toggle-group.mjs +9 -9
  82. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  83. package/fesm2022/radix-ng-primitives-toggle.mjs +15 -29
  84. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  85. package/label/index.d.ts +1 -1
  86. package/label/src/label-root.directive.d.ts +13 -0
  87. package/package.json +12 -19
  88. package/progress/index.d.ts +2 -1
  89. package/progress/src/progress-indicator.directive.d.ts +2 -2
  90. package/progress/src/progress-root.directive.d.ts +29 -0
  91. package/radio/index.d.ts +1 -3
  92. package/radio/src/radio-indicator.directive.d.ts +3 -9
  93. package/radio/src/radio-item.directive.d.ts +9 -28
  94. package/radio/src/{radio-group.directive.d.ts → radio-root.directive.d.ts} +24 -16
  95. package/roving-focus/index.d.ts +0 -2
  96. package/roving-focus/src/roving-focus-group.directive.d.ts +4 -6
  97. package/roving-focus/src/roving-focus-item.directive.d.ts +6 -8
  98. package/separator/src/separator.directive.d.ts +14 -8
  99. package/switch/index.d.ts +2 -2
  100. package/switch/src/switch-root.directive.d.ts +35 -0
  101. package/switch/src/switch-thumb.directive.d.ts +2 -5
  102. package/toggle/index.d.ts +2 -1
  103. package/toggle/src/toggle-root.directive.d.ts +32 -0
  104. package/toggle-group/src/toggle-group-multi.directive.d.ts +1 -1
  105. package/toggle-group/src/toggle-group.directive.d.ts +1 -1
  106. package/accordion/README.md +0 -3
  107. package/accordion/index.d.ts +0 -7
  108. package/accordion/src/accordion/accordion.directive.d.ts +0 -64
  109. package/accordion/src/accordion/accordion.token.d.ts +0 -4
  110. package/accordion/src/accordion-content/accordion-content.directive.d.ts +0 -44
  111. package/accordion/src/accordion-header/accordion-header.directive.d.ts +0 -6
  112. package/accordion/src/accordion-item/accordion-item.directive.d.ts +0 -42
  113. package/accordion/src/accordion-item/accordion-item.token.d.ts +0 -4
  114. package/accordion/src/accordion-state.directive.d.ts +0 -28
  115. package/accordion/src/accordion-trigger/accordion-trigger.directive.d.ts +0 -23
  116. package/accordion/src/accordion.config.d.ts +0 -25
  117. package/avatar/src/avatar.directive.d.ts +0 -22
  118. package/avatar/src/avatar.token.d.ts +0 -4
  119. package/esm2022/accordion/index.mjs +0 -8
  120. package/esm2022/accordion/radix-ng-primitives-accordion.mjs +0 -5
  121. package/esm2022/accordion/src/accordion/accordion.directive.mjs +0 -108
  122. package/esm2022/accordion/src/accordion/accordion.token.mjs +0 -6
  123. package/esm2022/accordion/src/accordion-content/accordion-content.directive.mjs +0 -75
  124. package/esm2022/accordion/src/accordion-header/accordion-header.directive.mjs +0 -17
  125. package/esm2022/accordion/src/accordion-item/accordion-item.directive.mjs +0 -81
  126. package/esm2022/accordion/src/accordion-item/accordion-item.token.mjs +0 -6
  127. package/esm2022/accordion/src/accordion-state.directive.mjs +0 -49
  128. package/esm2022/accordion/src/accordion-trigger/accordion-trigger.directive.mjs +0 -49
  129. package/esm2022/accordion/src/accordion.config.mjs +0 -27
  130. package/esm2022/avatar/src/avatar.directive.mjs +0 -38
  131. package/esm2022/avatar/src/avatar.token.mjs +0 -6
  132. package/esm2022/label/src/label.directive.mjs +0 -60
  133. package/esm2022/overlay/index.mjs +0 -5
  134. package/esm2022/overlay/radix-ng-primitives-overlay.mjs +0 -5
  135. package/esm2022/overlay/src/overlay-arrow.directive.mjs +0 -59
  136. package/esm2022/overlay/src/overlay-arrow.token.mjs +0 -3
  137. package/esm2022/overlay/src/overlay-trigger.directive.mjs +0 -279
  138. package/esm2022/overlay/src/overlay-trigger.token.mjs +0 -9
  139. package/esm2022/overlay/src/overlay.directive.mjs +0 -51
  140. package/esm2022/overlay/src/overlay.token.mjs +0 -3
  141. package/esm2022/progress/src/progress.directive.mjs +0 -62
  142. package/esm2022/progress/src/progress.token.mjs +0 -6
  143. package/esm2022/radio/src/radio-group.directive.mjs +0 -108
  144. package/esm2022/radio/src/radio-group.token.mjs +0 -6
  145. package/esm2022/radio/src/radio-item.token.mjs +0 -6
  146. package/esm2022/roving-focus/src/roving-focus-group.token.mjs +0 -9
  147. package/esm2022/roving-focus/src/roving-focus-item.token.mjs +0 -6
  148. package/esm2022/switch/src/switch.directive.mjs +0 -125
  149. package/esm2022/switch/src/switch.token.mjs +0 -6
  150. package/esm2022/toggle/src/toggle.directive.mjs +0 -65
  151. package/esm2022/visually-hidden/index.mjs +0 -2
  152. package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +0 -5
  153. package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +0 -42
  154. package/fesm2022/radix-ng-primitives-accordion.mjs +0 -394
  155. package/fesm2022/radix-ng-primitives-accordion.mjs.map +0 -1
  156. package/fesm2022/radix-ng-primitives-overlay.mjs +0 -399
  157. package/fesm2022/radix-ng-primitives-overlay.mjs.map +0 -1
  158. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +0 -49
  159. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +0 -1
  160. package/label/src/label.directive.d.ts +0 -19
  161. package/overlay/README.md +0 -1
  162. package/overlay/index.d.ts +0 -4
  163. package/overlay/src/overlay-arrow.directive.d.ts +0 -29
  164. package/overlay/src/overlay-arrow.token.d.ts +0 -3
  165. package/overlay/src/overlay-trigger.directive.d.ts +0 -163
  166. package/overlay/src/overlay-trigger.token.d.ts +0 -7
  167. package/overlay/src/overlay.directive.d.ts +0 -29
  168. package/overlay/src/overlay.token.d.ts +0 -3
  169. package/progress/src/progress.directive.d.ts +0 -26
  170. package/progress/src/progress.token.d.ts +0 -4
  171. package/radio/src/radio-group.token.d.ts +0 -4
  172. package/radio/src/radio-item.token.d.ts +0 -4
  173. package/roving-focus/src/roving-focus-group.token.d.ts +0 -7
  174. package/roving-focus/src/roving-focus-item.token.d.ts +0 -4
  175. package/switch/src/switch.directive.d.ts +0 -73
  176. package/switch/src/switch.token.d.ts +0 -4
  177. package/toggle/src/toggle.directive.d.ts +0 -30
  178. package/visually-hidden/README.md +0 -3
  179. package/visually-hidden/index.d.ts +0 -1
  180. package/visually-hidden/src/visually-hidden.directive.d.ts +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n Directive,\n EventEmitter,\n HostListener,\n Input,\n Output\n} from '@angular/core';\n\nlet uniqueId = 0;\n\n@Directive({\n selector: 'button[rdxToggle]',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed',\n '[attr.data-state]': 'pressed ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled'\n }\n})\nexport class RdxToggleDirective {\n /**\n * Whether the toggle is pressed.\n * @default false\n */\n @Input({ alias: 'rdxTogglePressed', transform: booleanAttribute }) pressed = false;\n\n /**\n * Whether the toggle is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Determine element id\n */\n @Input() id = 'rdx-toggle-' + uniqueId++;\n /**\n * Event emitted when the toggle is pressed.\n */\n @Output('rdxToggleOnPressedChange') readonly pressedChange = new EventEmitter<boolean>();\n\n /**\n * Toggle the pressed state.\n */\n @HostListener('click')\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.pressed = !this.pressed;\n this.pressedChange.emit(this.pressed);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AASA,IAAI,QAAQ,GAAG,CAAC,CAAC;MAYJ,kBAAkB,CAAA;AAV/B,IAAA,WAAA,GAAA;AAWI;;;AAGG;QACgE,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;AAEnF;;;AAGG;QACiE,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAErF;;AAEG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,aAAa,GAAG,QAAQ,EAAE,CAAC;AACzC;;AAEG;AAC0C,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;AAc5F,KAAA;AAZG;;AAEG;IAEH,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;AAED,QAAA,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACzC;8GAjCQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,CAAA,kBAAA,EAAA,SAAA,EAKoB,gBAAgB,CAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,EAAA,UAAA,EAMf,gBAAgB,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,EAAA,mBAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAXvD,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAV9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,qBAAqB,EAAE,SAAS;AAChC,wBAAA,mBAAmB,EAAE,wBAAwB;AAC7C,wBAAA,sBAAsB,EAAE,UAAU;AACrC,qBAAA;AACJ,iBAAA,CAAA;8BAMsE,OAAO,EAAA,CAAA;sBAAzE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAMG,QAAQ,EAAA,CAAA;sBAA3E,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKzD,EAAE,EAAA,CAAA;sBAAV,KAAK;gBAIuC,aAAa,EAAA,CAAA;sBAAzD,MAAM;uBAAC,0BAA0B,CAAA;gBAMlC,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,OAAO,CAAA;;;AC9CzB;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-root.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { booleanAttribute, Directive, EventEmitter, Input, Output } from '@angular/core';\n\nlet uniqueId = 0;\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: EventEmitter<boolean>;\n}\n\n@Directive({\n selector: 'button[ToggleRoot]',\n exportAs: 'ToggleRoot',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed',\n '[attr.data-state]': 'pressed ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled',\n\n '(click)': '_toggle($event)'\n }\n})\nexport class RdxToggleRootDirective implements ToggleProps {\n @Input({ alias: 'rdxTogglePressed', transform: booleanAttribute }) pressed = false;\n\n @Input({ alias: 'rdxToggleDisabled', transform: booleanAttribute }) disabled = false;\n\n @Input() id = 'rdx-toggle-' + uniqueId++;\n /**\n * Event emitted when the toggle is pressed.\n */\n @Output('rdxToggleOnPressedChange') readonly onPressedChange = new EventEmitter<boolean>();\n\n _toggle(event: MouseEvent): void {\n if (this.disabled) {\n return;\n }\n this.pressed = !this.pressed;\n this.onPressedChange.emit(this.pressed);\n\n event.stopPropagation();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,QAAQ,GAAG,CAAC,CAAC;MAgCJ,sBAAsB,CAAA;AAbnC,IAAA,WAAA,GAAA;QAcuE,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;QAEf,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAE5E,QAAA,IAAA,CAAA,EAAE,GAAG,aAAa,GAAG,QAAQ,EAAE,CAAC;AACzC;;AAEG;AAC0C,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;AAW9F,KAAA;AATG,IAAA,OAAO,CAAC,KAAiB,EAAA;AACrB,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;AACD,QAAA,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAExC,KAAK,CAAC,eAAe,EAAE,CAAC;KAC3B;+GAnBQ,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,CAAA,kBAAA,EAAA,SAAA,EACgB,gBAAgB,CAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,EAAA,UAAA,EAEf,gBAAgB,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,eAAA,EAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,mBAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAHvD,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAblC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,qBAAqB,EAAE,SAAS;AAChC,wBAAA,mBAAmB,EAAE,wBAAwB;AAC7C,wBAAA,sBAAsB,EAAE,UAAU;AAElC,wBAAA,SAAS,EAAE,iBAAiB;AAC/B,qBAAA;AACJ,iBAAA,CAAA;8BAEsE,OAAO,EAAA,CAAA;sBAAzE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAEG,QAAQ,EAAA,CAAA;sBAA3E,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAEzD,EAAE,EAAA,CAAA;sBAAV,KAAK;gBAIuC,eAAe,EAAA,CAAA;sBAA3D,MAAM;uBAAC,0BAA0B,CAAA;;;AC3CtC;;AAEG;;;;"}
package/label/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './src/label.directive';
1
+ export * from './src/label-root.directive';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class RdxLabelRootDirective {
3
+ id: string;
4
+ /**
5
+ * The id of the element the label is associated with.
6
+ * @default '-'
7
+ */
8
+ readonly htmlFor: import("@angular/core").InputSignal<string>;
9
+ private readonly elementRef;
10
+ onMouseDown(event: MouseEvent): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxLabelRootDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelRootDirective, "label[LabelRoot]", ["LabelRoot"], { "id": { "alias": "id"; "required": false; }; "htmlFor": { "alias": "htmlFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,7 +22,6 @@
22
22
  "@angular/cdk": "^17.0.0"
23
23
  },
24
24
  "dependencies": {
25
- "@floating-ui/dom": "^1.6.3",
26
25
  "tslib": "^2.3.0"
27
26
  },
28
27
  "sideEffects": false,
@@ -38,11 +37,11 @@
38
37
  "esm": "./esm2022/radix-ng-primitives.mjs",
39
38
  "default": "./fesm2022/radix-ng-primitives.mjs"
40
39
  },
41
- "./accordion": {
42
- "types": "./accordion/index.d.ts",
43
- "esm2022": "./esm2022/accordion/radix-ng-primitives-accordion.mjs",
44
- "esm": "./esm2022/accordion/radix-ng-primitives-accordion.mjs",
45
- "default": "./fesm2022/radix-ng-primitives-accordion.mjs"
40
+ "./alert-dialog": {
41
+ "types": "./alert-dialog/index.d.ts",
42
+ "esm2022": "./esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs",
43
+ "esm": "./esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs",
44
+ "default": "./fesm2022/radix-ng-primitives-alert-dialog.mjs"
46
45
  },
47
46
  "./avatar": {
48
47
  "types": "./avatar/index.d.ts",
@@ -56,18 +55,18 @@
56
55
  "esm": "./esm2022/checkbox/radix-ng-primitives-checkbox.mjs",
57
56
  "default": "./fesm2022/radix-ng-primitives-checkbox.mjs"
58
57
  },
58
+ "./collapsible": {
59
+ "types": "./collapsible/index.d.ts",
60
+ "esm2022": "./esm2022/collapsible/radix-ng-primitives-collapsible.mjs",
61
+ "esm": "./esm2022/collapsible/radix-ng-primitives-collapsible.mjs",
62
+ "default": "./fesm2022/radix-ng-primitives-collapsible.mjs"
63
+ },
59
64
  "./label": {
60
65
  "types": "./label/index.d.ts",
61
66
  "esm2022": "./esm2022/label/radix-ng-primitives-label.mjs",
62
67
  "esm": "./esm2022/label/radix-ng-primitives-label.mjs",
63
68
  "default": "./fesm2022/radix-ng-primitives-label.mjs"
64
69
  },
65
- "./overlay": {
66
- "types": "./overlay/index.d.ts",
67
- "esm2022": "./esm2022/overlay/radix-ng-primitives-overlay.mjs",
68
- "esm": "./esm2022/overlay/radix-ng-primitives-overlay.mjs",
69
- "default": "./fesm2022/radix-ng-primitives-overlay.mjs"
70
- },
71
70
  "./progress": {
72
71
  "types": "./progress/index.d.ts",
73
72
  "esm2022": "./esm2022/progress/radix-ng-primitives-progress.mjs",
@@ -109,12 +108,6 @@
109
108
  "esm2022": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
110
109
  "esm": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
111
110
  "default": "./fesm2022/radix-ng-primitives-toggle-group.mjs"
112
- },
113
- "./visually-hidden": {
114
- "types": "./visually-hidden/index.d.ts",
115
- "esm2022": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
116
- "esm": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
117
- "default": "./fesm2022/radix-ng-primitives-visually-hidden.mjs"
118
111
  }
119
112
  }
120
113
  }
@@ -1,2 +1,3 @@
1
1
  export * from './src/progress-indicator.directive';
2
- export * from './src/progress.directive';
2
+ export * from './src/progress-root.directive';
3
+ export type { ProgressProps } from './src/progress-root.directive';
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class RdxProgressIndicatorDirective {
3
- protected readonly progress: import("@radix-ng/primitives/progress").RdxProgressDirective;
3
+ readonly _progress: import("./progress-root.directive").RdxProgressRootDirective;
4
4
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxProgressIndicatorDirective, never>;
5
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressIndicatorDirective, "[rdxProgressIndicator]", never, {}, {}, never, never, true, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressIndicatorDirective, "div[ProgressIndicator]", ["ProgressIndicator"], {}, {}, never, never, true, never>;
6
6
  }
@@ -0,0 +1,29 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare function injectProgress(): RdxProgressRootDirective;
3
+ export type ProgressState = 'indeterminate' | 'loading' | 'complete';
4
+ export interface ProgressProps {
5
+ value?: number | null | undefined;
6
+ max?: number;
7
+ getValueLabel?: string;
8
+ }
9
+ export declare class RdxProgressRootDirective implements ProgressProps {
10
+ id: string;
11
+ value: number;
12
+ /**
13
+ * @default 100
14
+ */
15
+ max: number;
16
+ valueLabel: (value: number, max: number) => string;
17
+ /**
18
+ * Get the state of the progress bar.
19
+ * @returns 'indeterminate' | 'loading' | 'complete'
20
+ * @internal
21
+ */
22
+ get state(): ProgressState;
23
+ private getProgressState;
24
+ private defaultGetValueLabel;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxProgressRootDirective, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressRootDirective, "div[ProgressRoot]", ["ProgressRoot"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "rdxValue"; "required": false; }; "max": { "alias": "rdxMax"; "required": false; }; "valueLabel": { "alias": "rdxValueLabel"; "required": false; }; }, {}, never, never, true, never>;
27
+ static ngAcceptInputType_value: unknown;
28
+ static ngAcceptInputType_max: unknown;
29
+ }
package/radio/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export * from './src/radio-group.directive';
2
- export * from './src/radio-group.token';
1
+ export * from './src/radio-root.directive';
3
2
  export * from './src/radio-indicator.directive';
4
3
  export * from './src/radio-item.directive';
5
- export * from './src/radio-item.token';
@@ -1,13 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class RdxRadioIndicatorDirective {
3
- /**
4
- * Access the radio group.
5
- */
6
- protected readonly radioGroup: import("@radix-ng/primitives/radio").RdxRadioGroupDirective;
7
- /**
8
- * Access the radio group item.
9
- */
10
- protected readonly radioItem: import("@radix-ng/primitives/radio").RdxRadioItemDirective;
3
+ protected readonly radioGroup: import("./radio-root.directive").RdxRadioGroupDirective;
4
+ protected readonly radioItem: import("./radio-item.directive").RdxRadioItemDirective;
11
5
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioIndicatorDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioIndicatorDirective, "[rdxRadioIndicator]", never, {}, {}, never, never, true, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioIndicatorDirective, "[RadioIndicator]", ["RadioIndicator"], {}, {}, never, never, true, never>;
13
7
  }
@@ -1,36 +1,17 @@
1
+ import { InjectionToken } from '@angular/core';
1
2
  import * as i0 from "@angular/core";
2
3
  import * as i1 from "@radix-ng/primitives/roving-focus";
4
+ export declare const RdxRadioItemToken: InjectionToken<RdxRadioItemDirective>;
5
+ export declare function injectRadioItem(): RdxRadioItemDirective;
3
6
  export declare class RdxRadioItemDirective {
4
- /**
5
- * Access the radio group.
6
- */
7
- protected readonly radioGroup: import("@radix-ng/primitives/radio").RdxRadioGroupDirective;
8
- /**
9
- * The value of the radio item.
10
- */
7
+ protected readonly radioGroup: import("./radio-root.directive").RdxRadioGroupDirective;
8
+ id: string;
11
9
  value: string;
12
- /**
13
- * Whether the radio item is disabled.
14
- * @default false
15
- */
16
10
  disabled: boolean;
17
- /**
18
- * Handle keydown events.
19
- * @param event The keydown event.
20
- * @internal
21
- */
22
- protected onKeydown(event: KeyboardEvent): void;
23
- /**
24
- * When the item receives focus, select it.
25
- * @internal
26
- */
27
- protected onFocus(): void;
28
- /**
29
- * When the item receives a click, select it.
30
- * @internal
31
- */
32
- protected onClick(): void;
11
+ _onKeydown(event: KeyboardEvent): void;
12
+ _onFocus(): void;
13
+ _onClick(): void;
33
14
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioItemDirective, never>;
34
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "button[rdxRadioItem]", never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: {}; outputs: {}; }]>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "[RadioItem]", ["RadioItem"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: {}; outputs: {}; }]>;
35
16
  static ngAcceptInputType_disabled: unknown;
36
17
  }
@@ -1,25 +1,32 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter, InjectionToken } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "@radix-ng/primitives/roving-focus";
5
- export declare class RdxRadioGroupDirective implements ControlValueAccessor {
6
- /**
7
- * The value of the radio group.
8
- */
5
+ export declare const RdxRadioGroupToken: InjectionToken<RdxRadioGroupDirective>;
6
+ export declare function injectRadioGroup(): RdxRadioGroupDirective;
7
+ interface RadioGroupProps {
8
+ name?: string;
9
+ disabled?: boolean;
10
+ defaultValue?: string;
11
+ value?: string;
12
+ onValueChange?: EventEmitter<string>;
13
+ }
14
+ export declare class RdxRadioGroupDirective implements RadioGroupProps, ControlValueAccessor {
15
+ private readonly changeDetector;
9
16
  value?: string;
10
- /**
11
- * Whether the radio group is disabled.
12
- */
13
17
  disabled: boolean;
14
18
  /**
15
- * The orientation of the radio group.
16
- * @default 'horizontal'
19
+ * The orientation of the radio group only vertical.
20
+ * Horizontal radio buttons can sometimes be challenging to scan and localize.
21
+ * The horizontal arrangement of radio buttons may also lead to difficulties in determining which
22
+ * label corresponds to which button: whether the label is above or below the button.
23
+ * @default 'vertical'
17
24
  */
18
- orientation: 'horizontal' | 'vertical';
25
+ readonly _orientation = "vertical";
19
26
  /**
20
27
  * Event emitted when the value of the radio group changes.
21
28
  */
22
- readonly valueChange: EventEmitter<string>;
29
+ readonly onValueChange: EventEmitter<string>;
23
30
  /**
24
31
  * The callback function to call when the value of the radio group changes.
25
32
  * @internal
@@ -30,6 +37,7 @@ export declare class RdxRadioGroupDirective implements ControlValueAccessor {
30
37
  * @internal
31
38
  */
32
39
  private onTouched?;
40
+ constructor(changeDetector: ChangeDetectorRef);
33
41
  /**
34
42
  * Select a radio item.
35
43
  * @param value The value of the radio item to select.
@@ -55,11 +63,11 @@ export declare class RdxRadioGroupDirective implements ControlValueAccessor {
55
63
  */
56
64
  setDisabledState(isDisabled: boolean): void;
57
65
  /**
58
- * When focus leaves the radio group, mark it as touched.
59
- * @internal
66
+ * When focus leaves the radio group.
60
67
  */
61
- protected onFocusout(): void;
68
+ _onFocusout(): void;
62
69
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioGroupDirective, never>;
63
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "[rdxRadioGroup]", never, { "value": { "alias": "rdxRadioGroupValue"; "required": false; }; "disabled": { "alias": "rdxRadioGroupDisabled"; "required": false; }; "orientation": { "alias": "rdxRadioGroupOrientation"; "required": false; }; }, { "valueChange": "rdxRadioGroupValueChange"; }, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: {}; outputs: {}; }]>;
70
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "div[RadioRoot]", ["RadioRoot"], { "value": { "alias": "rdxValue"; "required": false; }; "disabled": { "alias": "rdxDisabled"; "required": false; }; }, { "onValueChange": "rdxOnValueChange"; }, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: {}; outputs: {}; }]>;
64
71
  static ngAcceptInputType_disabled: unknown;
65
72
  }
73
+ export {};
@@ -1,4 +1,2 @@
1
1
  export * from './src/roving-focus-group.directive';
2
- export * from './src/roving-focus-group.token';
3
2
  export * from './src/roving-focus-item.directive';
4
- export * from './src/roving-focus-item.token';
@@ -2,6 +2,8 @@ import { FocusKeyManager } from '@angular/cdk/a11y';
2
2
  import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
3
3
  import type { RdxRovingFocusItemDirective } from './roving-focus-item.directive';
4
4
  import * as i0 from "@angular/core";
5
+ export type Orientation = 'horizontal' | 'vertical';
6
+ export declare function injectRovingFocusGroup(): RdxRovingFocusGroupDirective;
5
7
  export declare class RdxRovingFocusGroupDirective implements OnInit, OnChanges, OnDestroy {
6
8
  private readonly directionality;
7
9
  private readonly destroyRef;
@@ -10,16 +12,12 @@ export declare class RdxRovingFocusGroupDirective implements OnInit, OnChanges,
10
12
  * We don't use ContentChildren as dynamically added items may not be in the correct order.
11
13
  */
12
14
  private readonly items;
13
- /**
14
- * Create the focus key manager instance.
15
- * @internal
16
- */
17
15
  readonly keyManager: FocusKeyManager<RdxRovingFocusItemDirective>;
18
16
  /**
19
17
  * Determine the orientation of the roving focus group.
20
18
  * @default vertical
21
19
  */
22
- orientation: 'horizontal' | 'vertical';
20
+ orientation: Orientation;
23
21
  /**
24
22
  * Determine if focus should wrap when the end or beginning is reached.
25
23
  * @default true
@@ -48,7 +46,7 @@ export declare class RdxRovingFocusGroupDirective implements OnInit, OnChanges,
48
46
  * Set the orientation of the roving focus group.
49
47
  * @param orientation The orientation of the roving focus group.
50
48
  */
51
- setOrientation(orientation: 'horizontal' | 'vertical'): void;
49
+ setOrientation(orientation: Orientation): void;
52
50
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusGroupDirective, never>;
53
51
  static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientation": { "alias": "rdxRovingFocusGroupOrientation"; "required": false; }; "wrap": { "alias": "rdxRovingFocusGroupWrap"; "required": false; }; }, {}, never, never, true, never>;
54
52
  static ngAcceptInputType_wrap: unknown;
@@ -1,6 +1,7 @@
1
1
  import { FocusableOption } from '@angular/cdk/a11y';
2
2
  import { OnDestroy, OnInit } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
+ export declare function injectRovingFocusItem(): RdxRovingFocusItemDirective;
4
5
  export declare class RdxRovingFocusItemDirective implements OnInit, OnDestroy, FocusableOption {
5
6
  /**
6
7
  * Access the group the roving focus item belongs to.
@@ -26,22 +27,19 @@ export declare class RdxRovingFocusItemDirective implements OnInit, OnDestroy, F
26
27
  * Define if the item is disabled.
27
28
  */
28
29
  disabled: boolean;
29
- /**
30
- * Derive the tabindex of the roving focus item.
31
- * @internal
32
- */
33
- get tabindex(): number;
34
30
  ngOnInit(): void;
35
31
  ngOnDestroy(): void;
36
32
  /**
37
33
  * Handle key events on the roving focus item.
38
34
  * @param event The key event.
39
- * @internal
40
35
  */
41
- onKeydown(event: KeyboardEvent): void;
36
+ _onKeydown(event: KeyboardEvent): void;
37
+ /**
38
+ * Derive the tabindex of the roving focus item.
39
+ */
40
+ _tabindex(): number;
42
41
  /**
43
42
  * Focus the roving focus item.
44
- * @param origin The origin of the focus request.
45
43
  * @internal
46
44
  */
47
45
  focus(): void;
@@ -1,16 +1,22 @@
1
1
  import * as i0 from "@angular/core";
2
- export declare class RdxSeparatorDirective {
2
+ declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
3
+ export type Orientation = (typeof ORIENTATIONS)[number];
4
+ export interface SeparatorProps {
3
5
  /**
4
- * The orientation of the separator.
5
- * @default 'horizontal'
6
+ * Either `vertical` or `horizontal`. Defaults to `horizontal`.
6
7
  */
7
- orientation: 'horizontal' | 'vertical';
8
+ orientation?: Orientation;
8
9
  /**
9
- * Whether the separator is for decoration purposes. If true, the separator will not be included in the accessibility tree.
10
- * @default false
10
+ * Whether the component is purely decorative. When true, accessibility-related attributes
11
+ * are updated so that the rendered element is removed from the accessibility tree.
11
12
  */
13
+ decorative?: boolean;
14
+ }
15
+ export declare class RdxSeparatorRootDirective implements SeparatorProps {
16
+ orientation: Orientation;
12
17
  decorative: boolean;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxSeparatorDirective, never>;
14
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSeparatorDirective, "[rdxSeparator]", never, { "orientation": { "alias": "rdxSeparatorOrientation"; "required": false; }; "decorative": { "alias": "rdxSeparatorDecorative"; "required": false; }; }, {}, never, never, true, never>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxSeparatorRootDirective, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSeparatorRootDirective, "div[SeparatorRoot]", never, { "orientation": { "alias": "rdxOrientation"; "required": false; }; "decorative": { "alias": "rdxDecorative"; "required": false; }; }, {}, never, never, true, never>;
15
20
  static ngAcceptInputType_decorative: unknown;
16
21
  }
22
+ export {};
package/switch/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './src/switch-thumb.directive';
2
- export * from './src/switch.directive';
3
- export * from './src/switch.token';
2
+ export * from './src/switch-root.directive';
3
+ export type { SwitchProps } from './src/switch-root.directive';
@@ -0,0 +1,35 @@
1
+ import { EventEmitter, InjectionToken } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ export declare const RdxSwitchToken: InjectionToken<RdxSwitchRootDirective>;
5
+ export declare function injectSwitch(): RdxSwitchRootDirective;
6
+ export interface SwitchProps {
7
+ checked?: boolean;
8
+ defaultChecked?: boolean;
9
+ required?: boolean;
10
+ onCheckedChange?: EventEmitter<boolean>;
11
+ }
12
+ export declare class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {
13
+ required: boolean;
14
+ checked: boolean;
15
+ disabled: boolean;
16
+ readonly onCheckedChange: EventEmitter<boolean>;
17
+ /**
18
+ * The method to be called in order to update ngModel.
19
+ */
20
+ _onChange?: (checked: boolean) => void;
21
+ /**
22
+ * onTouch function registered via registerOnTouch (ControlValueAccessor).
23
+ */
24
+ _onTouched?: () => void;
25
+ registerOnChange(fn: (checked: boolean) => void): void;
26
+ registerOnTouched(fn: () => void): void;
27
+ writeValue(checked: boolean): void;
28
+ setDisabledState(isDisabled: boolean): void;
29
+ _toggle(): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchRootDirective, never>;
31
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchRootDirective, "button[SwitchRoot]", ["SwitchRoot"], { "required": { "alias": "required"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onCheckedChange": "onCheckedChange"; }, never, never, true, never>;
32
+ static ngAcceptInputType_required: unknown;
33
+ static ngAcceptInputType_checked: unknown;
34
+ static ngAcceptInputType_disabled: unknown;
35
+ }
@@ -1,9 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class RdxSwitchThumbDirective {
3
- /**
4
- * Access the switch directive.
5
- */
6
- protected readonly switch: import("@radix-ng/primitives/switch").RdxSwitchDirective;
3
+ protected readonly switchRoot: import("./switch-root.directive").RdxSwitchRootDirective;
7
4
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchThumbDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchThumbDirective, "[rdxSwitchThumb]", never, {}, {}, never, never, true, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchThumbDirective, "span[SwitchThumb]", ["SwitchThumb"], {}, {}, never, never, true, never>;
9
6
  }
package/toggle/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from './src/toggle.directive';
1
+ export * from './src/toggle-root.directive';
2
+ export type { ToggleProps } from './src/toggle-root.directive';
@@ -0,0 +1,32 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export interface ToggleProps {
4
+ /**
5
+ * The controlled state of the toggle.
6
+ */
7
+ pressed?: boolean;
8
+ /**
9
+ * The state of the toggle when initially rendered. Use `defaultPressed`
10
+ * if you do not need to control the state of the toggle.
11
+ * @defaultValue false
12
+ */
13
+ defaultPressed?: boolean;
14
+ /**
15
+ * The callback that fires when the state of the toggle changes.
16
+ */
17
+ onPressedChange?: EventEmitter<boolean>;
18
+ }
19
+ export declare class RdxToggleRootDirective implements ToggleProps {
20
+ pressed: boolean;
21
+ disabled: boolean;
22
+ id: string;
23
+ /**
24
+ * Event emitted when the toggle is pressed.
25
+ */
26
+ readonly onPressedChange: EventEmitter<boolean>;
27
+ _toggle(event: MouseEvent): void;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleRootDirective, never>;
29
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleRootDirective, "button[ToggleRoot]", ["ToggleRoot"], { "pressed": { "alias": "rdxTogglePressed"; "required": false; }; "disabled": { "alias": "rdxToggleDisabled"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, { "onPressedChange": "rdxToggleOnPressedChange"; }, never, never, true, never>;
30
+ static ngAcceptInputType_pressed: unknown;
31
+ static ngAcceptInputType_disabled: unknown;
32
+ }
@@ -40,7 +40,7 @@ export declare class RdxToggleGroupMultiDirective implements OnInit, OnChanges,
40
40
  */
41
41
  private onChange?;
42
42
  /**
43
- * The touched callback.
43
+ * onTouch function registered via registerOnTouch (ControlValueAccessor).
44
44
  */
45
45
  protected onTouched?: () => void;
46
46
  ngOnInit(): void;
@@ -40,7 +40,7 @@ export declare class RdxToggleGroupDirective implements OnInit, OnChanges, After
40
40
  */
41
41
  private onChange?;
42
42
  /**
43
- * The touched callback.
43
+ * onTouch function registered via registerOnTouch (ControlValueAccessor).
44
44
  */
45
45
  protected onTouched?: () => void;
46
46
  ngOnInit(): void;
@@ -1,3 +0,0 @@
1
- # @ng-primitives/ng-primitives/accordion
2
-
3
- Secondary entry point of `@ng-primitives/ng-primitives`. It can be used by importing from `@ng-primitives/ng-primitives/accordion`.
@@ -1,7 +0,0 @@
1
- export * from './src/accordion-content/accordion-content.directive';
2
- export * from './src/accordion-header/accordion-header.directive';
3
- export * from './src/accordion-item/accordion-item.directive';
4
- export * from './src/accordion-trigger/accordion-trigger.directive';
5
- export * from './src/accordion/accordion.directive';
6
- export * from './src/accordion-state.directive';
7
- export * from './src/accordion.config';
@@ -1,64 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@radix-ng/primitives/roving-focus";
4
- /**
5
- * The root accordion directive that all parts should be placed within.
6
- */
7
- export declare class RdxAccordionDirective implements OnInit {
8
- /**
9
- * Access the global accordion configuration.
10
- */
11
- private readonly config;
12
- /**
13
- * Access the roving focus group
14
- */
15
- private readonly rovingFocusGroup;
16
- /**
17
- * Determines whether multiple items can be open simultaneously.
18
- * @default false
19
- */
20
- multiple: boolean;
21
- /**
22
- * The orientation of the accordion.
23
- * @default 'vertical'
24
- */
25
- orientation: 'horizontal' | 'vertical';
26
- /**
27
- * Determines whether the accordion should be disabled.
28
- * @default false
29
- */
30
- disabled: boolean;
31
- /**
32
- * Store the currently expanded item(s).
33
- * @internal
34
- */
35
- readonly expanded: import("@angular/core").WritableSignal<string[]>;
36
- /**
37
- * The touched callback.
38
- */
39
- protected onTouched?: () => void;
40
- ngOnInit(): void;
41
- /**
42
- * Expand an item.
43
- * @param id The id of the item to expand.
44
- */
45
- expand(id: string): void;
46
- /**
47
- * Collapse an Item.
48
- * @param id The id of the Item to collapse.
49
- */
50
- collapse(id: string): void;
51
- /**
52
- * Toggle an item.
53
- * @param id The id of the item to toggle.
54
- */
55
- toggle(id: string): void;
56
- /**
57
- * Collapse all items.
58
- */
59
- collapseAll(): void;
60
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionDirective, never>;
61
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionDirective, "[rdxAccordion]", never, { "multiple": { "alias": "rdxAccordionMultiple"; "required": false; }; "orientation": { "alias": "rdxAccordionOrientation"; "required": false; }; "disabled": { "alias": "rdxAccordionDisabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "rdxRovingFocusGroupOrientation": "orientation"; }; outputs: {}; }]>;
62
- static ngAcceptInputType_multiple: unknown;
63
- static ngAcceptInputType_disabled: unknown;
64
- }
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import type { RdxAccordionDirective } from './accordion.directive';
3
- export declare const RdxAccordionToken: InjectionToken<RdxAccordionDirective>;
4
- export declare function injectAccordion(): RdxAccordionDirective;