@radix-ng/primitives 0.4.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 (181) 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 +12 -18
  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/index.mjs +6 -0
  59. package/esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs +5 -0
  60. package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +79 -0
  61. package/esm2022/toggle-group/src/toggle-group-button.token.mjs +6 -0
  62. package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +159 -0
  63. package/esm2022/toggle-group/src/toggle-group.directive.mjs +157 -0
  64. package/esm2022/toggle-group/src/toggle-group.token.mjs +6 -0
  65. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +150 -0
  66. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -0
  67. package/fesm2022/radix-ng-primitives-avatar.mjs +79 -90
  68. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  69. package/fesm2022/radix-ng-primitives-checkbox.mjs +6 -6
  70. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  71. package/fesm2022/radix-ng-primitives-collapsible.mjs +190 -0
  72. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -0
  73. package/fesm2022/radix-ng-primitives-label.mjs +20 -18
  74. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  75. package/fesm2022/radix-ng-primitives-progress.mjs +55 -49
  76. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  77. package/fesm2022/radix-ng-primitives-radio.mjs +70 -100
  78. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  79. package/fesm2022/radix-ng-primitives-roving-focus.mjs +22 -44
  80. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  81. package/fesm2022/radix-ng-primitives-separator.mjs +12 -17
  82. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  83. package/fesm2022/radix-ng-primitives-switch.mjs +49 -106
  84. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  85. package/fesm2022/radix-ng-primitives-toggle-group.mjs +397 -0
  86. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -0
  87. package/fesm2022/radix-ng-primitives-toggle.mjs +15 -29
  88. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  89. package/label/index.d.ts +1 -1
  90. package/label/src/label-root.directive.d.ts +13 -0
  91. package/package.json +18 -19
  92. package/progress/index.d.ts +2 -1
  93. package/progress/src/progress-indicator.directive.d.ts +2 -2
  94. package/progress/src/progress-root.directive.d.ts +29 -0
  95. package/radio/index.d.ts +1 -3
  96. package/radio/src/radio-indicator.directive.d.ts +3 -9
  97. package/radio/src/radio-item.directive.d.ts +9 -28
  98. package/radio/src/{radio-group.directive.d.ts → radio-root.directive.d.ts} +24 -16
  99. package/roving-focus/index.d.ts +0 -2
  100. package/roving-focus/src/roving-focus-group.directive.d.ts +5 -7
  101. package/roving-focus/src/roving-focus-item.directive.d.ts +6 -8
  102. package/separator/src/separator.directive.d.ts +14 -8
  103. package/switch/index.d.ts +2 -2
  104. package/switch/src/switch-root.directive.d.ts +35 -0
  105. package/switch/src/switch-thumb.directive.d.ts +2 -5
  106. package/toggle/index.d.ts +2 -1
  107. package/toggle/src/toggle-root.directive.d.ts +32 -0
  108. package/toggle-group/README.md +3 -0
  109. package/toggle-group/index.d.ts +5 -0
  110. package/toggle-group/src/toggle-group-button.directive.d.ts +39 -0
  111. package/toggle-group/src/toggle-group-button.token.d.ts +4 -0
  112. package/toggle-group/src/toggle-group-multi.directive.d.ts +90 -0
  113. package/toggle-group/src/toggle-group.directive.d.ts +90 -0
  114. package/toggle-group/src/toggle-group.token.d.ts +5 -0
  115. package/avatar/src/avatar.directive.d.ts +0 -22
  116. package/avatar/src/avatar.token.d.ts +0 -4
  117. package/esm2022/avatar/src/avatar.directive.mjs +0 -38
  118. package/esm2022/avatar/src/avatar.token.mjs +0 -6
  119. package/esm2022/label/src/label.directive.mjs +0 -46
  120. package/esm2022/overlay/index.mjs +0 -5
  121. package/esm2022/overlay/radix-ng-primitives-overlay.mjs +0 -5
  122. package/esm2022/overlay/src/overlay-arrow.directive.mjs +0 -59
  123. package/esm2022/overlay/src/overlay-arrow.token.mjs +0 -3
  124. package/esm2022/overlay/src/overlay-trigger.directive.mjs +0 -279
  125. package/esm2022/overlay/src/overlay-trigger.token.mjs +0 -9
  126. package/esm2022/overlay/src/overlay.directive.mjs +0 -51
  127. package/esm2022/overlay/src/overlay.token.mjs +0 -3
  128. package/esm2022/progress/src/progress.directive.mjs +0 -62
  129. package/esm2022/progress/src/progress.token.mjs +0 -6
  130. package/esm2022/radio/src/radio-group.directive.mjs +0 -108
  131. package/esm2022/radio/src/radio-group.token.mjs +0 -6
  132. package/esm2022/radio/src/radio-item.token.mjs +0 -6
  133. package/esm2022/roving-focus/src/roving-focus-group.token.mjs +0 -9
  134. package/esm2022/roving-focus/src/roving-focus-item.token.mjs +0 -6
  135. package/esm2022/switch/src/switch.directive.mjs +0 -125
  136. package/esm2022/switch/src/switch.token.mjs +0 -6
  137. package/esm2022/toggle/src/toggle.directive.mjs +0 -65
  138. package/esm2022/tooltip/index.mjs +0 -5
  139. package/esm2022/tooltip/radix-ng-primitives-tooltip.mjs +0 -5
  140. package/esm2022/tooltip/src/tooltip-arrow.directive.mjs +0 -17
  141. package/esm2022/tooltip/src/tooltip-trigger.directive.mjs +0 -148
  142. package/esm2022/tooltip/src/tooltip-trigger.token.mjs +0 -6
  143. package/esm2022/tooltip/src/tooltip.config.mjs +0 -31
  144. package/esm2022/tooltip/src/tooltip.directive.mjs +0 -46
  145. package/esm2022/visually-hidden/index.mjs +0 -2
  146. package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +0 -5
  147. package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +0 -42
  148. package/fesm2022/radix-ng-primitives-overlay.mjs +0 -399
  149. package/fesm2022/radix-ng-primitives-overlay.mjs.map +0 -1
  150. package/fesm2022/radix-ng-primitives-tooltip.mjs +0 -242
  151. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +0 -1
  152. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +0 -49
  153. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +0 -1
  154. package/label/src/label.directive.d.ts +0 -14
  155. package/overlay/README.md +0 -1
  156. package/overlay/index.d.ts +0 -4
  157. package/overlay/src/overlay-arrow.directive.d.ts +0 -29
  158. package/overlay/src/overlay-arrow.token.d.ts +0 -3
  159. package/overlay/src/overlay-trigger.directive.d.ts +0 -163
  160. package/overlay/src/overlay-trigger.token.d.ts +0 -7
  161. package/overlay/src/overlay.directive.d.ts +0 -29
  162. package/overlay/src/overlay.token.d.ts +0 -3
  163. package/progress/src/progress.directive.d.ts +0 -26
  164. package/progress/src/progress.token.d.ts +0 -4
  165. package/radio/src/radio-group.token.d.ts +0 -4
  166. package/radio/src/radio-item.token.d.ts +0 -4
  167. package/roving-focus/src/roving-focus-group.token.d.ts +0 -7
  168. package/roving-focus/src/roving-focus-item.token.d.ts +0 -4
  169. package/switch/src/switch.directive.d.ts +0 -73
  170. package/switch/src/switch.token.d.ts +0 -4
  171. package/toggle/src/toggle.directive.d.ts +0 -30
  172. package/tooltip/README.md +0 -1
  173. package/tooltip/index.d.ts +0 -4
  174. package/tooltip/src/tooltip-arrow.directive.d.ts +0 -6
  175. package/tooltip/src/tooltip-trigger.directive.d.ts +0 -79
  176. package/tooltip/src/tooltip-trigger.token.d.ts +0 -4
  177. package/tooltip/src/tooltip.config.d.ts +0 -46
  178. package/tooltip/src/tooltip.directive.d.ts +0 -17
  179. package/visually-hidden/README.md +0 -3
  180. package/visually-hidden/index.d.ts +0 -1
  181. package/visually-hidden/src/visually-hidden.directive.d.ts +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "0.4.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,6 +37,12 @@
38
37
  "esm": "./esm2022/radix-ng-primitives.mjs",
39
38
  "default": "./fesm2022/radix-ng-primitives.mjs"
40
39
  },
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"
45
+ },
41
46
  "./avatar": {
42
47
  "types": "./avatar/index.d.ts",
43
48
  "esm2022": "./esm2022/avatar/radix-ng-primitives-avatar.mjs",
@@ -50,18 +55,18 @@
50
55
  "esm": "./esm2022/checkbox/radix-ng-primitives-checkbox.mjs",
51
56
  "default": "./fesm2022/radix-ng-primitives-checkbox.mjs"
52
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
+ },
53
64
  "./label": {
54
65
  "types": "./label/index.d.ts",
55
66
  "esm2022": "./esm2022/label/radix-ng-primitives-label.mjs",
56
67
  "esm": "./esm2022/label/radix-ng-primitives-label.mjs",
57
68
  "default": "./fesm2022/radix-ng-primitives-label.mjs"
58
69
  },
59
- "./overlay": {
60
- "types": "./overlay/index.d.ts",
61
- "esm2022": "./esm2022/overlay/radix-ng-primitives-overlay.mjs",
62
- "esm": "./esm2022/overlay/radix-ng-primitives-overlay.mjs",
63
- "default": "./fesm2022/radix-ng-primitives-overlay.mjs"
64
- },
65
70
  "./progress": {
66
71
  "types": "./progress/index.d.ts",
67
72
  "esm2022": "./esm2022/progress/radix-ng-primitives-progress.mjs",
@@ -98,17 +103,11 @@
98
103
  "esm": "./esm2022/toggle/radix-ng-primitives-toggle.mjs",
99
104
  "default": "./fesm2022/radix-ng-primitives-toggle.mjs"
100
105
  },
101
- "./tooltip": {
102
- "types": "./tooltip/index.d.ts",
103
- "esm2022": "./esm2022/tooltip/radix-ng-primitives-tooltip.mjs",
104
- "esm": "./esm2022/tooltip/radix-ng-primitives-tooltip.mjs",
105
- "default": "./fesm2022/radix-ng-primitives-tooltip.mjs"
106
- },
107
- "./visually-hidden": {
108
- "types": "./visually-hidden/index.d.ts",
109
- "esm2022": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
110
- "esm": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
111
- "default": "./fesm2022/radix-ng-primitives-visually-hidden.mjs"
106
+ "./toggle-group": {
107
+ "types": "./toggle-group/index.d.ts",
108
+ "esm2022": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
109
+ "esm": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
110
+ "default": "./fesm2022/radix-ng-primitives-toggle-group.mjs"
112
111
  }
113
112
  }
114
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,8 +46,8 @@ 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
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientation": { "alias": "orientation"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; }, {}, never, never, true, never>;
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;
55
53
  }
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ # @radix-ng/primitives/toggle-group
2
+
3
+ Secondary entry point of `@radix-ng/primitives/toggle-group`.
@@ -0,0 +1,5 @@
1
+ export * from './src/toggle-group-button.directive';
2
+ export * from './src/toggle-group-button.token';
3
+ export * from './src/toggle-group-multi.directive';
4
+ export * from './src/toggle-group.directive';
5
+ export * from './src/toggle-group.token';
@@ -0,0 +1,39 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@radix-ng/primitives/roving-focus";
4
+ export declare class RdxToggleGroupButtonDirective implements OnChanges {
5
+ /**
6
+ * Access the toggle group.
7
+ */
8
+ protected readonly toggleGroup: import("@radix-ng/primitives/toggle-group").RdxToggleGroupDirective | import("@radix-ng/primitives/toggle-group").RdxToggleGroupMultiDirective;
9
+ /**
10
+ * Access the roving focus item.
11
+ */
12
+ private readonly rovingFocusItem;
13
+ /**
14
+ * The value of this toggle button.
15
+ */
16
+ value: string;
17
+ /**
18
+ * Whether this toggle button is disabled.
19
+ * @default false
20
+ */
21
+ disabled: boolean;
22
+ /**
23
+ * Whether this toggle button is checked.
24
+ */
25
+ protected get checked(): boolean;
26
+ ngOnChanges(changes: SimpleChanges): void;
27
+ /**
28
+ * Toggle this toggle button.
29
+ */
30
+ toggle(): void;
31
+ /**
32
+ * Ensure the disabled state is propagated to the roving focus item.
33
+ * @internal
34
+ */
35
+ updateDisabled(): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupButtonDirective, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupButtonDirective, "button[rdxToggleGroupButton]", never, { "value": { "alias": "rdxToggleGroupButtonValue"; "required": true; }; "disabled": { "alias": "rdxToggleGroupButtonDisabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: {}; outputs: {}; }]>;
38
+ static ngAcceptInputType_disabled: unknown;
39
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';
3
+ export declare const RdxToggleGroupButtonToken: InjectionToken<RdxToggleGroupButtonDirective>;
4
+ export declare function injectToggleGroupButton(): RdxToggleGroupButtonDirective;
@@ -0,0 +1,90 @@
1
+ import { AfterContentInit, EventEmitter, OnChanges, OnInit, QueryList, SimpleChanges } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@radix-ng/primitives/roving-focus";
6
+ export declare class RdxToggleGroupMultiDirective implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor {
7
+ /**
8
+ * Access the roving focus group
9
+ */
10
+ private readonly rovingFocusGroup;
11
+ /**
12
+ * The selected toggle button.
13
+ */
14
+ value: ReadonlyArray<string>;
15
+ /**
16
+ * The orientation of the toggle group.
17
+ * @default 'horizontal'
18
+ */
19
+ orientation: 'horizontal' | 'vertical';
20
+ /**
21
+ * Whether the toggle group is disabled.
22
+ * @default false
23
+ */
24
+ disabled: boolean;
25
+ /**
26
+ * Whether the toggle group roving focus should wrap.
27
+ * @default true
28
+ */
29
+ wrap: boolean;
30
+ /**
31
+ * Event emitted when the selected toggle button changes.
32
+ */
33
+ readonly valueChange: EventEmitter<readonly string[]>;
34
+ /**
35
+ * Access the buttons in the toggle group.
36
+ */
37
+ protected buttons?: QueryList<RdxToggleGroupButtonDirective>;
38
+ /**
39
+ * The value change callback.
40
+ */
41
+ private onChange?;
42
+ /**
43
+ * onTouch function registered via registerOnTouch (ControlValueAccessor).
44
+ */
45
+ protected onTouched?: () => void;
46
+ ngOnInit(): void;
47
+ ngOnChanges(changes: SimpleChanges): void;
48
+ ngAfterContentInit(): void;
49
+ /**
50
+ * Determine if a value is selected.
51
+ * @param value The value to check.
52
+ * @returns Whether the value is selected.
53
+ * @internal
54
+ */
55
+ isSelected(value: string): boolean;
56
+ /**
57
+ * Toggle a value.
58
+ * @param value The value to toggle.
59
+ * @internal
60
+ */
61
+ toggle(value: string): void;
62
+ /**
63
+ * Select a value from Angular forms.
64
+ * @param value The value to select.
65
+ * @internal
66
+ */
67
+ writeValue(value: ReadonlyArray<string>): void;
68
+ /**
69
+ * Register a callback to be called when the value changes.
70
+ * @param fn The callback to register.
71
+ * @internal
72
+ */
73
+ registerOnChange(fn: (value: ReadonlyArray<string>) => void): void;
74
+ /**
75
+ * Register a callback to be called when the toggle group is touched.
76
+ * @param fn The callback to register.
77
+ * @internal
78
+ */
79
+ registerOnTouched(fn: () => void): void;
80
+ /**
81
+ * Set the disabled state of the toggle group.
82
+ * @param isDisabled Whether the toggle group is disabled.
83
+ * @internal
84
+ */
85
+ setDisabledState(isDisabled: boolean): void;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupMultiDirective, never>;
87
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupMultiDirective, "[rdxToggleGroupMulti]", never, { "value": { "alias": "rdxToggleGroupMultiValue"; "required": false; }; "orientation": { "alias": "rdxToggleGroupMultiOrientation"; "required": false; }; "disabled": { "alias": "rdxToggleGroupMultiDisabled"; "required": false; }; "wrap": { "alias": "rdxToggleGroupMultiWrap"; "required": false; }; "valueChange": { "alias": "rdxToggleGroupMultiValueChange"; "required": false; }; }, {}, ["buttons"], never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "rdxRovingFocusGroupWrap": "wrap"; "rdxRovingFocusGroupOrientation": "orientation"; }; outputs: {}; }]>;
88
+ static ngAcceptInputType_disabled: unknown;
89
+ static ngAcceptInputType_wrap: unknown;
90
+ }