@radix-ng/primitives 0.51.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 (178) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  13. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  15. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  17. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  18. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  19. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-core.mjs +735 -744
  23. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-cropper.mjs +1 -0
  25. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-date-field.mjs +51 -45
  27. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  29. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
  33. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  34. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  35. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  36. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  37. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  38. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  40. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  41. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  42. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  43. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  44. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  45. package/fesm2022/radix-ng-primitives-menu.mjs +1480 -344
  46. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  48. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  50. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  51. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  52. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  53. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  54. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  57. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popper.mjs +91 -41
  59. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  61. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  63. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  65. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  66. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  67. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  69. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  71. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  73. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  75. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  77. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  79. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  81. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-tabs.mjs +381 -108
  83. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  85. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  87. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  89. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  91. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1071
  93. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  95. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  96. package/meter/README.md +3 -0
  97. package/navigation-menu/README.md +2 -1
  98. package/package.json +31 -18
  99. package/portal/README.md +2 -0
  100. package/preview-card/README.md +3 -0
  101. package/schematics/collection.json +1 -0
  102. package/schematics/ng-add/index.d.ts +3 -2
  103. package/schematics/ng-add/index.js +62 -31
  104. package/schematics/ng-add/index.js.map +1 -1
  105. package/schematics/ng-add/package-config.d.ts +4 -2
  106. package/schematics/ng-add/package-config.js +10 -2
  107. package/schematics/ng-add/package-config.js.map +1 -1
  108. package/schematics/ng-add/schema.d.ts +3 -0
  109. package/schematics/ng-add/schema.js +3 -0
  110. package/schematics/ng-add/schema.js.map +1 -0
  111. package/schematics/ng-add/schema.json +14 -0
  112. package/select/README.md +2 -0
  113. package/types/radix-ng-primitives-accordion.d.ts +48 -14
  114. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  115. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  116. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  117. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  118. package/types/radix-ng-primitives-button.d.ts +73 -0
  119. package/types/radix-ng-primitives-calendar.d.ts +1 -2
  120. package/types/radix-ng-primitives-checkbox.d.ts +201 -32
  121. package/types/radix-ng-primitives-collapsible.d.ts +112 -39
  122. package/types/radix-ng-primitives-collection.d.ts +38 -34
  123. package/types/radix-ng-primitives-config.d.ts +1 -1
  124. package/types/radix-ng-primitives-context-menu.d.ts +60 -116
  125. package/types/radix-ng-primitives-core.d.ts +307 -236
  126. package/types/radix-ng-primitives-cropper.d.ts +2 -2
  127. package/types/radix-ng-primitives-date-field.d.ts +38 -23
  128. package/types/radix-ng-primitives-dialog.d.ts +282 -165
  129. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  130. package/types/radix-ng-primitives-drawer.d.ts +448 -0
  131. package/types/radix-ng-primitives-editable.d.ts +1 -1
  132. package/types/radix-ng-primitives-field.d.ts +373 -0
  133. package/types/radix-ng-primitives-fieldset.d.ts +48 -0
  134. package/types/radix-ng-primitives-focus-scope.d.ts +13 -5
  135. package/types/radix-ng-primitives-input.d.ts +87 -0
  136. package/types/radix-ng-primitives-label.d.ts +0 -1
  137. package/types/radix-ng-primitives-menu.d.ts +572 -99
  138. package/types/radix-ng-primitives-menubar.d.ts +60 -50
  139. package/types/radix-ng-primitives-meter.d.ts +193 -0
  140. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  141. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  142. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  143. package/types/radix-ng-primitives-popover.d.ts +365 -351
  144. package/types/radix-ng-primitives-popper.d.ts +49 -9
  145. package/types/radix-ng-primitives-portal.d.ts +14 -6
  146. package/types/radix-ng-primitives-presence.d.ts +28 -76
  147. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  148. package/types/radix-ng-primitives-progress.d.ts +174 -48
  149. package/types/radix-ng-primitives-radio.d.ts +55 -25
  150. package/types/radix-ng-primitives-roving-focus.d.ts +30 -21
  151. package/types/radix-ng-primitives-select.d.ts +475 -177
  152. package/types/radix-ng-primitives-separator.d.ts +7 -32
  153. package/types/radix-ng-primitives-slider.d.ts +315 -201
  154. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  155. package/types/radix-ng-primitives-switch.d.ts +86 -71
  156. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  157. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  158. package/types/radix-ng-primitives-toggle-group.d.ts +85 -164
  159. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  160. package/types/radix-ng-primitives-toolbar.d.ts +163 -38
  161. package/types/radix-ng-primitives-tooltip.d.ts +347 -384
  162. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  163. package/dropdown-menu/README.md +0 -1
  164. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  165. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  166. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  167. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  168. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  169. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  170. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  171. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  172. package/hover-card/README.md +0 -3
  173. package/select2/README.md +0 -3
  174. package/tooltip2/README.md +0 -3
  175. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  176. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  177. package/types/radix-ng-primitives-select2.d.ts +0 -511
  178. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -1,10 +1,39 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, Provider, ElementRef, Injector, InjectionToken, InputSignal, WritableSignal, ModelSignal, Signal, EffectRef, EffectCleanupRegisterFn, CreateEffectOptions } from '@angular/core';
3
- import { BooleanInput } from '@angular/cdk/coercion';
4
- import { ControlValueAccessor, FormControlDirective, FormControlName, NgModel } from '@angular/forms';
5
- import { DateValue, DayOfWeek, CalendarDateTime, ZonedDateTime, Time } from '@internationalized/date';
6
- import { ConnectionPositionPair, ConnectedPosition } from '@angular/cdk/overlay';
7
- import { Direction } from '@angular/cdk/bidi';
2
+ import { Type, Provider, InputSignal, WritableSignal, ModelSignal, Signal, InjectionToken, InputSignalWithTransform, OutputRef, ElementRef, Injector, EffectRef, EffectCleanupRegisterFn, CreateEffectOptions } from '@angular/core';
3
+ import { ControlValueAccessor } from '@angular/forms';
4
+ import { DateValue, Time, CalendarDateTime, ZonedDateTime } from '@internationalized/date';
5
+
6
+ type DataOrientation = 'vertical' | 'horizontal';
7
+ /** Layout direction for bidirectional text. */
8
+ type Direction = 'ltr' | 'rtl';
9
+ /**
10
+ * Nullable from `Type` adds `null` and `undefined`
11
+ *
12
+ * @example ```ts
13
+ * // Expect: string | number | undefined | null
14
+ * type Value = Nulling<string | number>;
15
+ * ```
16
+ */
17
+ type Nullable<Type> = null | Type | undefined;
18
+ /**
19
+ * SafeFunction is a type for functions that accept any number of arguments of unknown types
20
+ * and return a value of an unknown type. This is useful when you want to define a function
21
+ * without being strict about the input or output types, maintaining flexibility.
22
+ *
23
+ * @example ```ts
24
+ * const safeFn: SafeFunction = (...args) => {
25
+ * return args.length > 0 ? args[0] : null;
26
+ * };
27
+ *
28
+ * const result = safeFn(1, 'hello'); // result: 1
29
+ * ```
30
+ */
31
+ type SafeFunction = (...args: unknown[]) => unknown;
32
+ type AcceptableValue = string | number | bigint | Record<string, any> | null;
33
+ /** Type describing the allowed values for a boolean `input()` using `booleanAttribute` coercion. */
34
+ type BooleanInput = string | boolean | null | undefined;
35
+ /** Type describing the allowed values for a number `input()` using `numberAttribute` coercion. */
36
+ type NumberInput = string | number | null | undefined;
8
37
 
9
38
  /**
10
39
  * A reusable ControlValueAccessor implementation for form controls
@@ -83,20 +112,6 @@ declare function injectControlValueAccessor<T>(): RdxControlValueAccessor<T>;
83
112
  */
84
113
  declare function provideValueAccessor<T>(type: Type<T>): Provider;
85
114
 
86
- declare class RdxAutoFocusDirective {
87
- #private;
88
- private _autoSelect;
89
- /**
90
- * @default false
91
- */
92
- set autoFocus(value: boolean);
93
- set autoSelect(value: boolean);
94
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxAutoFocusDirective, never>;
95
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAutoFocusDirective, "[rdxAutoFocus]", never, { "autoFocus": { "alias": "rdxAutoFocus"; "required": false; }; "autoSelect": { "alias": "autoSelect"; "required": false; }; }, {}, never, never, true, never>;
96
- static ngAcceptInputType_autoFocus: unknown;
97
- static ngAcceptInputType_autoSelect: unknown;
98
- }
99
-
100
115
  /**
101
116
  * The `clamp` function restricts a number within a specified range by returning the value itself if it
102
117
  * falls within the range, or the closest boundary value if it exceeds the range.
@@ -136,141 +151,6 @@ declare function roundToStepPrecision(value: number, step: number): number;
136
151
  */
137
152
  declare function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number;
138
153
 
139
- declare function injectDocument(): Document;
140
-
141
- declare function elementSize({ elementRef, injector }: {
142
- elementRef: ElementRef<HTMLElement>;
143
- injector: Injector;
144
- }): i0.Signal<{
145
- width: number;
146
- height: number;
147
- }>;
148
-
149
- declare class RdxFocusInitialDirective {
150
- /** @ignore */
151
- private readonly nativeElement;
152
- /** @ignore */
153
- focus(): void;
154
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxFocusInitialDirective, never>;
155
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxFocusInitialDirective, "[rdxFocusInitial]", never, {}, {}, never, never, true, never>;
156
- }
157
-
158
- declare function getActiveElement(): Element | null;
159
-
160
- /** Service that generates unique IDs for DOM nodes. */
161
- declare class _IdGenerator {
162
- private readonly _appId;
163
- /**
164
- * Generates a unique ID with a specific prefix.
165
- * @param prefix Prefix to add to the ID.
166
- */
167
- getId(prefix: string): string;
168
- static ɵfac: i0.ɵɵFactoryDeclaration<_IdGenerator, never>;
169
- static ɵprov: i0.ɵɵInjectableDeclaration<_IdGenerator>;
170
- }
171
-
172
- declare function injectNgControl(params: {
173
- optional: true;
174
- }): FormControlDirective | FormControlName | NgModel | undefined;
175
- declare function injectNgControl(params: {
176
- optional: false;
177
- }): FormControlDirective | FormControlName | NgModel;
178
- declare function injectNgControl(): FormControlDirective | FormControlName | NgModel;
179
-
180
- declare function injectIsClient(): boolean;
181
-
182
- /**
183
- * Compare two objects using reference equality and stable deep hashing.
184
- * @param {any} object1 First object
185
- * @param {any} object2 Second object
186
- * @return {boolean} true if equal and false if not
187
- */
188
- declare function isEqual(object1: any, object2: any): boolean;
189
-
190
- declare function isInsideForm(el: ElementRef<HTMLElement> | null): boolean;
191
-
192
- declare function isNullish(value: any): value is null | undefined;
193
-
194
- declare const isNumber: (v: any) => v is number;
195
-
196
- /**
197
- * The function `isValueEqualOrExist` checks if a value is equal to or exists in another value or
198
- * array.
199
- * @param {T | T[] | undefined} base - It represents the base value that you want to compare with the `current` value.
200
- * @param {T | T[] | undefined} current - The `current` parameter represents the current value that you want to compare with the `base` value or values.
201
- * @returns The `isValueEqualOrExist` function returns a boolean value. It checks if the `base` value
202
- * is equal to the `current` value or if the `current` value exists within the `base` value. The
203
- * function handles cases where `base` can be a single value, an array of values, or undefined.
204
- */
205
- declare function isValueEqualOrExist<T>(base: T | T[] | undefined, current: T | T[] | undefined): boolean;
206
-
207
- declare const ALT = "Alt";
208
- declare const ARROW_DOWN = "ArrowDown";
209
- declare const ARROW_LEFT = "ArrowLeft";
210
- declare const ARROW_RIGHT = "ArrowRight";
211
- declare const ARROW_UP = "ArrowUp";
212
- declare const BACKSPACE = "Backspace";
213
- declare const CAPS_LOCK = "CapsLock";
214
- declare const CONTROL = "Control";
215
- declare const DELETE = "Delete";
216
- declare const END = "End";
217
- declare const ENTER = "Enter";
218
- declare const ESCAPE = "Escape";
219
- declare const F1 = "F1";
220
- declare const F10 = "F10";
221
- declare const F11 = "F11";
222
- declare const F12 = "F12";
223
- declare const F2 = "F2";
224
- declare const F3 = "F3";
225
- declare const F4 = "F4";
226
- declare const F5 = "F5";
227
- declare const F6 = "F6";
228
- declare const F7 = "F7";
229
- declare const F8 = "F8";
230
- declare const F9 = "F9";
231
- declare const HOME = "Home";
232
- declare const META = "Meta";
233
- declare const PAGE_DOWN = "PageDown";
234
- declare const PAGE_UP = "PageUp";
235
- declare const SHIFT = "Shift";
236
- declare const SPACE = " ";
237
- declare const TAB = "Tab";
238
- declare const CTRL = "Control";
239
- declare const ASTERISK = "*";
240
- declare const a = "a";
241
- declare const P = "P";
242
- declare const A = "A";
243
- declare const p = "p";
244
- declare const n = "n";
245
- declare const j = "j";
246
- declare const k = "k";
247
- declare const SPACE_CODE = "Space";
248
-
249
- /**
250
- * Creates an Angular provider that binds the given token to the existing instance
251
- * of the specified class. This is especially useful when you want multiple
252
- * tokens (or interfaces) to resolve to the same directive/component instance.
253
- *
254
- * @template T - The type associated with the injection token.
255
- * @param token - The InjectionToken or abstract type you want to provide.
256
- * @param type - The class type whose existing instance will be used for this token.
257
- * @returns A Provider configuration object for Angular's DI system.
258
- *
259
- * @example
260
- *
261
- * @Directive({
262
- * providers: [
263
- * provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),
264
- * provideValueAccessor(RdxToggleGroupDirective)
265
- * ]
266
- * })
267
- * export class RdxToggleGroupDirective {}
268
- */
269
- declare function provideToken<T>(token: InjectionToken<T>, type: Type<unknown>): Provider;
270
-
271
- declare const WINDOW: InjectionToken<Window & typeof globalThis>;
272
- declare function injectWindow(): Window & typeof globalThis;
273
-
274
154
  /**
275
155
  * Creates a context with injector and provider functions for a given type
276
156
  * @template T The type of the context value
@@ -343,6 +223,7 @@ type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj;
343
223
  type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj;
344
224
  type SegmentContentObj = Record<EditableSegmentPart, string>;
345
225
 
226
+ type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
346
227
  type CreateMonthProps = {
347
228
  /**
348
229
  * The date object representing the month's date (usually the first day of the month).
@@ -697,87 +578,237 @@ declare function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEve
697
578
  originalEvent: OriginalEvent;
698
579
  } & (E extends CustomEvent<infer D> ? D : never)): void;
699
580
 
700
- declare enum RdxPositionSide {
701
- Top = "top",
702
- Right = "right",
703
- Bottom = "bottom",
704
- Left = "left"
581
+ /**
582
+ * Generates unique, SSR-stable IDs for DOM nodes.
583
+ *
584
+ * IDs are deterministic per prefix (a monotonic counter) so the server and the client produce the
585
+ * same sequence and hydration does not mismatch. The application's `APP_ID` is folded into the
586
+ * prefix so multiple Angular apps on one page don't collide; the default `ng` app id is omitted to
587
+ * keep IDs short for the common single-app case.
588
+ *
589
+ * Prefer the {@link injectId} hook at call sites; inject this service directly only when you need to
590
+ * generate IDs lazily outside an injection context.
591
+ */
592
+ declare class RdxIdGenerator {
593
+ private readonly appId;
594
+ /** Generates a unique ID with the given prefix. */
595
+ getId(prefix: string): string;
596
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxIdGenerator, never>;
597
+ static ɵprov: i0.ɵɵInjectableDeclaration<RdxIdGenerator>;
705
598
  }
706
- declare enum RdxPositionAlign {
707
- Start = "start",
708
- Center = "center",
709
- End = "end"
599
+ /**
600
+ * Returns a unique, SSR-stable ID for the given prefix — the Angular counterpart of React's
601
+ * `useId`. Must be called in an injection context (e.g. a field initializer or constructor).
602
+ *
603
+ * @example
604
+ * readonly contentId = injectId('rdx-dialog-content-');
605
+ */
606
+ declare function injectId(prefix: string): string;
607
+
608
+ declare const ALT = "Alt";
609
+ declare const ARROW_DOWN = "ArrowDown";
610
+ declare const ARROW_LEFT = "ArrowLeft";
611
+ declare const ARROW_RIGHT = "ArrowRight";
612
+ declare const ARROW_UP = "ArrowUp";
613
+ declare const BACKSPACE = "Backspace";
614
+ declare const CAPS_LOCK = "CapsLock";
615
+ declare const CONTROL = "Control";
616
+ declare const DELETE = "Delete";
617
+ declare const END = "End";
618
+ declare const ENTER = "Enter";
619
+ declare const ESCAPE = "Escape";
620
+ declare const F1 = "F1";
621
+ declare const F10 = "F10";
622
+ declare const F11 = "F11";
623
+ declare const F12 = "F12";
624
+ declare const F2 = "F2";
625
+ declare const F3 = "F3";
626
+ declare const F4 = "F4";
627
+ declare const F5 = "F5";
628
+ declare const F6 = "F6";
629
+ declare const F7 = "F7";
630
+ declare const F8 = "F8";
631
+ declare const F9 = "F9";
632
+ declare const HOME = "Home";
633
+ declare const META = "Meta";
634
+ declare const PAGE_DOWN = "PageDown";
635
+ declare const PAGE_UP = "PageUp";
636
+ declare const SHIFT = "Shift";
637
+ declare const SPACE = " ";
638
+ declare const TAB = "Tab";
639
+ declare const CTRL = "Control";
640
+ declare const ASTERISK = "*";
641
+ declare const a = "a";
642
+ declare const P = "P";
643
+ declare const A = "A";
644
+ declare const p = "p";
645
+ declare const n = "n";
646
+ declare const j = "j";
647
+ declare const k = "k";
648
+ declare const SPACE_CODE = "Space";
649
+
650
+ type AriaLivePoliteness = 'off' | 'polite' | 'assertive';
651
+ /**
652
+ * Announces messages to screen readers through an `aria-live` region, without moving focus.
653
+ *
654
+ * Own replacement for CDK's `LiveAnnouncer` — lazily appends a visually hidden live region to
655
+ * the document body and writes messages into it. No-op on the server.
656
+ */
657
+ declare class RdxLiveAnnouncer {
658
+ private readonly document;
659
+ private readonly isBrowser;
660
+ private liveElement;
661
+ private previousTimeout;
662
+ constructor();
663
+ /**
664
+ * Announces a message to screen readers.
665
+ *
666
+ * @param message The message to announce.
667
+ * @param politeness The politeness of the announcer element (defaults to `'polite'`).
668
+ * @param duration If provided, the message is cleared after this many milliseconds.
669
+ */
670
+ announce(message: string, politeness?: AriaLivePoliteness, duration?: number): void;
671
+ /** Clears the current announcement. */
672
+ clear(): void;
673
+ private getLiveElement;
674
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxLiveAnnouncer, never>;
675
+ static ɵprov: i0.ɵɵInjectableDeclaration<RdxLiveAnnouncer>;
710
676
  }
711
- type RdxPositionSideAndAlign = {
712
- side: RdxPositionSide;
713
- align: RdxPositionAlign;
714
- };
715
- type RdxPositionSideAndAlignOffsets = {
716
- sideOffset: number;
717
- alignOffset: number;
718
- };
719
- type RdxPositions = Readonly<{
720
- [key in RdxPositionSide]: Readonly<{
721
- [key in RdxPositionAlign]: Readonly<ConnectionPositionPair>;
722
- }>;
723
- }>;
724
- type RdxPositioningDefaults = Readonly<{
725
- offsets: Readonly<{
726
- side: number;
727
- align: number;
728
- }>;
729
- arrow: Readonly<{
730
- width: number;
731
- height: number;
732
- }>;
733
- }>;
734
- type RdxAllPossibleConnectedPositions = ReadonlyMap<`${RdxPositionSide}|${RdxPositionAlign}`, ConnectionPositionPair>;
735
- type RdxArrowPositionParams = {
736
- top: string;
737
- left: string;
738
- transform: string;
739
- transformOrigin: string;
740
- };
741
677
 
742
- declare const RDX_POSITIONS: RdxPositions;
743
- declare const RDX_POSITIONING_DEFAULTS: RdxPositioningDefaults;
678
+ /** Narrows to `null | undefined`. */
679
+ declare function isNullish(value: any): value is null | undefined;
680
+ /**
681
+ * Structural equality for the value shapes a primitive can hold: primitives (incl. `NaN`), arrays,
682
+ * plain objects, and the common built-ins `Date`, `RegExp`, `Map`, and `Set`. Reference cycles are
683
+ * handled. Other opaque objects (e.g. class instances with no own enumerable properties) fall back
684
+ * to per-key comparison and so only match when they expose equal enumerable state.
685
+ */
686
+ declare function isEqual(a: any, b: any): boolean;
744
687
 
745
- declare function getContentPosition(sideAndAlignWithOffsets: RdxPositionSideAndAlign & RdxPositionSideAndAlignOffsets): ConnectedPosition;
746
- declare function getAllPossibleConnectedPositions(): RdxAllPossibleConnectedPositions;
747
- declare function getSideAndAlignFromAllPossibleConnectedPositions(position: ConnectionPositionPair): RdxPositionSideAndAlign;
748
- declare function getArrowPositionParams(sideAndAlign: RdxPositionSideAndAlign, arrowWidthAndHeight: {
749
- width: number;
750
- height: number;
751
- }, triggerWidthAndHeight: {
688
+ /**
689
+ * Creates an Angular provider that binds the given token to the existing instance
690
+ * of the specified class. This is especially useful when you want multiple
691
+ * tokens (or interfaces) to resolve to the same directive/component instance.
692
+ *
693
+ * @template T - The type associated with the injection token.
694
+ * @param token - The InjectionToken or abstract type you want to provide.
695
+ * @param type - The class type whose existing instance will be used for this token.
696
+ * @returns A Provider configuration object for Angular's DI system.
697
+ *
698
+ * @example
699
+ *
700
+ * @Directive({
701
+ * providers: [
702
+ * provideToken(RdxFooToken, RdxFooDirective),
703
+ * provideValueAccessor(RdxFooDirective)
704
+ * ]
705
+ * })
706
+ * export class RdxFooDirective {}
707
+ */
708
+ declare function provideToken<T>(token: InjectionToken<T>, type: Type<unknown>): Provider;
709
+
710
+ /**
711
+ * Local mirror of Angular Signal Forms' control contracts
712
+ * (`@angular/forms/signals`, stable in Angular 22).
713
+ *
714
+ * These interfaces intentionally do **not** import from `@angular/forms/signals`
715
+ * so primitives can declare `implements RdxFormValueControl<T>` /
716
+ * `implements RdxFormCheckboxControl` while the library baseline is still on
717
+ * Angular 21, where the real API is experimental. They mirror Angular's contract
718
+ * closely enough to lock the public surface (the required `value` / `checked`
719
+ * signal) and catch naming regressions on CI — e.g. a rewrite renaming
720
+ * `value` → `modelValue` (as the slider once had) would no longer type-check.
721
+ *
722
+ * Optional state types are widened only where Radix NG controls legitimately
723
+ * differ from Angular's exact types (e.g. `input<string>()` produces
724
+ * `string | undefined`, and boolean inputs carry a coercion transform).
725
+ *
726
+ * Replace with the real imports once the baseline moves to Angular 22.
727
+ * See `.claude/skills/project-knowledge/references/signal-forms-readiness.md`.
728
+ */
729
+ /** An optional control-state member exposed as an Angular input signal (with or without a coercion transform). */
730
+ type RdxFormStateInput<T> = InputSignal<T> | InputSignalWithTransform<T, any>;
731
+ /**
732
+ * Minimal stand-in for Angular's `ValidationError`. The real type is a tagged
733
+ * union (`RequiredValidationError`, `PatternValidationError`, …); this keeps a
734
+ * shared shape until the v22 type is available.
735
+ */
736
+ interface RdxValidationError {
737
+ readonly kind: string;
738
+ readonly message?: string;
739
+ }
740
+ /** Optional state shared by value and checkbox controls (mirror of Angular's `FormUiControl`). */
741
+ interface RdxFormUiControl {
742
+ readonly disabled?: RdxFormStateInput<boolean>;
743
+ readonly readonly?: RdxFormStateInput<boolean>;
744
+ readonly required?: RdxFormStateInput<boolean>;
745
+ readonly invalid?: RdxFormStateInput<boolean>;
746
+ readonly hidden?: RdxFormStateInput<boolean>;
747
+ readonly pending?: RdxFormStateInput<boolean>;
748
+ readonly touched?: RdxFormStateInput<boolean>;
749
+ readonly dirty?: RdxFormStateInput<boolean>;
750
+ readonly name?: RdxFormStateInput<string | undefined>;
751
+ readonly errors?: RdxFormStateInput<readonly RdxValidationError[]>;
752
+ readonly minLength?: RdxFormStateInput<number | undefined>;
753
+ readonly maxLength?: RdxFormStateInput<number | undefined>;
754
+ readonly pattern?: RdxFormStateInput<readonly RegExp[]>;
755
+ /** Notifies the form that the control was touched (mirror of Angular's `touch` output). */
756
+ readonly touch?: OutputRef<void>;
757
+ }
758
+ /**
759
+ * Mirror of `FormValueControl<TValue>` — a control that edits a single value via
760
+ * `value = model<TValue>()`. It must **not** expose `checked`.
761
+ */
762
+ interface RdxFormValueControl<TValue> extends RdxFormUiControl {
763
+ readonly value: ModelSignal<TValue>;
764
+ readonly checked?: undefined;
765
+ readonly min?: RdxFormStateInput<NonNullable<TValue> | undefined>;
766
+ readonly max?: RdxFormStateInput<NonNullable<TValue> | undefined>;
767
+ }
768
+ /**
769
+ * Mirror of `FormCheckboxControl` — a control that toggles via
770
+ * `checked = model<boolean>()`. It must **not** expose `value`.
771
+ */
772
+ interface RdxFormCheckboxControl extends RdxFormUiControl {
773
+ readonly checked: ModelSignal<boolean>;
774
+ readonly value?: undefined;
775
+ }
776
+
777
+ declare function injectDocument(): Document;
778
+
779
+ declare function elementSize({ elementRef, injector }: {
780
+ elementRef: ElementRef<HTMLElement>;
781
+ injector: Injector;
782
+ }): i0.Signal<{
752
783
  width: number;
753
784
  height: number;
754
- }): RdxArrowPositionParams;
785
+ }>;
786
+
787
+ declare function getActiveElement(): Element | null;
755
788
 
756
- type DataOrientation = 'vertical' | 'horizontal';
757
789
  /**
758
- * Nullable from `Type` adds `null` and `undefined`
790
+ * Creates a resize observer effect for element
759
791
  *
760
- * @example ```ts
761
- * // Expect: string | number | undefined | null
762
- * type Value = Nulling<string | number>;
763
- * ```
792
+ * @param options Configuration options
793
+ * @param options.injector Angular injector
794
+ * @param options.element Signal returning the element to observe
795
+ * @param options.onResize Callback when element is resized
796
+ * @returns EffectRef that can be destroyed when needed
764
797
  */
765
- type Nullable<Type> = null | Type | undefined;
798
+ declare function resizeEffect(options: {
799
+ injector: Injector;
800
+ element: Signal<ElementRef | HTMLElement | null | undefined>;
801
+ onResize: ResizeObserverCallback;
802
+ }): EffectRef;
803
+
766
804
  /**
767
- * SafeFunction is a type for functions that accept any number of arguments of unknown types
768
- * and return a value of an unknown type. This is useful when you want to define a function
769
- * without being strict about the input or output types, maintaining flexibility.
770
- *
771
- * @example ```ts
772
- * const safeFn: SafeFunction = (...args) => {
773
- * return args.length > 0 ? args[0] : null;
774
- * };
805
+ * Locks `document.body` scrolling while `active()` is `true`, and restores the original overflow
806
+ * when it becomes `false` or the calling context is destroyed.
775
807
  *
776
- * const result = safeFn(1, 'hello'); // result: 1
777
- * ```
808
+ * Lock ownership is shared across all callers via a single module-level counter, so nested or
809
+ * concurrent overlays compose correctly. Must be called in an injection context.
778
810
  */
779
- type SafeFunction = (...args: unknown[]) => unknown;
780
- type AcceptableValue = string | number | bigint | Record<string, any> | null;
811
+ declare function useScrollLock(active: Signal<boolean>): void;
781
812
 
782
813
  type ArrowKeyOptions = 'horizontal' | 'vertical' | 'both';
783
814
  interface ArrowNavigationOptions {
@@ -844,19 +875,47 @@ interface ArrowNavigationOptions {
844
875
  declare function useArrowNavigation(e: KeyboardEvent, currentElement: HTMLElement, parentElement: HTMLElement | undefined, options?: ArrowNavigationOptions): HTMLElement | null;
845
876
 
846
877
  /**
847
- * Creates a resize observer effect for element
878
+ * Keeps hover content open while the pointer crosses the gap between a trigger and a popup.
879
+ */
880
+ declare function useGraceArea(triggerEl: Signal<HTMLElement | null | undefined>, containerEl: Signal<HTMLElement | null | undefined>, resetMs?: number): {
881
+ isPointerInTransit: Signal<boolean>;
882
+ onPointerExit: (callback: (value: void) => void) => () => void;
883
+ };
884
+
885
+ /**
886
+ * Lifecycle phase of an open/close transition.
848
887
  *
849
- * @param options Configuration options
850
- * @param options.injector Angular injector
851
- * @param options.element Signal returning the element to observe
852
- * @param options.onResize Callback when element is resized
853
- * @returns EffectRef that can be destroyed when needed
888
+ * - `'starting'` the part has just mounted/opened; the enter animation is about to run.
889
+ * - `'ending'` — the part is closing; the exit animation is running.
890
+ * - `undefined` — settled (no transition in progress).
854
891
  */
855
- declare function resizeEffect(options: {
856
- injector: Injector;
857
- element: Signal<ElementRef | HTMLElement | null | undefined>;
858
- onResize: ResizeObserverCallback;
859
- }): EffectRef;
892
+ type RdxTransitionStatus = 'starting' | 'ending' | undefined;
893
+ interface RdxTransitionStatusRef {
894
+ /** Reactive transition phase, intended for `data-starting-style` / `data-ending-style` bindings. */
895
+ readonly status: Signal<RdxTransitionStatus>;
896
+ /**
897
+ * Registers the element whose CSS transition/animation duration determines when the close
898
+ * transition is considered complete. Returns a cleanup that unregisters it.
899
+ */
900
+ registerElement: (element: HTMLElement) => () => void;
901
+ /** Drives a new transition for the given open state. Cancels any in-flight transition. */
902
+ start: (open: boolean) => void;
903
+ }
904
+ /**
905
+ * Shared open/close transition state machine used by overlay primitives (dialog, popover, …).
906
+ *
907
+ * On `start(open)` it flips `status` to `'starting'`/`'ending'`, then — after the next render and
908
+ * (for opening) one animation frame — clears it and waits for the registered element's running CSS
909
+ * animations/transitions to finish (via the Web Animations API) before invoking `onComplete(open)`.
910
+ * Completing on the real `animationend` rather than a duration timer keeps it from firing a frame
911
+ * late. A duration-based timer remains as a safety net, and if no element is registered or it has no
912
+ * animation (also SSR / jsdom, where computed durations are `0`) completion is synchronous.
913
+ *
914
+ * Must be called in an injection context (uses {@link Injector} and {@link DestroyRef}).
915
+ */
916
+ declare function useTransitionStatus(onComplete: (open: boolean) => void): RdxTransitionStatusRef;
917
+ /** Longest of an element's CSS transition / animation durations (including delays), in milliseconds. */
918
+ declare function getMaxTransitionDuration(element: HTMLElement): number;
860
919
 
861
920
  /**
862
921
  * We want to have the Tuple in order to use the types in the function signature
@@ -898,5 +957,17 @@ declare interface CreateExplicitEffectOptions extends CreateEffectOptions {
898
957
  */
899
958
  declare function watch<Input extends readonly unknown[], Params = Input>(deps: readonly [...ExplicitEffectValues<Input>], fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void, options?: CreateExplicitEffectOptions | undefined): EffectRef;
900
959
 
901
- export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RDX_POSITIONING_DEFAULTS, RDX_POSITIONS, RdxAutoFocusDirective, RdxControlValueAccessor, RdxFocusInitialDirective, RdxPositionAlign, RdxPositionSide, SHIFT, SPACE, SPACE_CODE, TAB, WINDOW, _IdGenerator, a, areAllDaysBetweenValid, clamp, createContent, createContext, createFormatter, createMonth, createMonths, elementSize, getActiveElement, getAllPossibleConnectedPositions, getArrowPositionParams, getContentPosition, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getSideAndAlignFromAllPossibleConnectedPositions, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectIsClient, injectNgControl, injectWindow, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isInsideForm, isNullish, isNumber, isNumberString, isSegmentNavigationKey, isValueEqualOrExist, isZonedDateTime, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideToken, provideValueAccessor, resizeEffect, roundToStepPrecision, segmentBuilders, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useArrowNavigation, useDateField, watch };
902
- export type { AcceptableValue, AnyExceptLiteral, CreateMonthProps, DataOrientation, DateAndTimeSegmentObj, DateFormatterOptions, DateMatcher, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DayPeriod, EditableSegmentPart, Formatter, Granularity, HourCycle, Month, NonEditableSegmentPart, Nullable, PlaceholderMap, RdxAllPossibleConnectedPositions, RdxArrowPositionParams, RdxPositionSideAndAlign, RdxPositionSideAndAlignOffsets, RdxPositioningDefaults, RdxPositions, SafeFunction, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps };
960
+ declare enum RdxPositionSide {
961
+ Top = "top",
962
+ Right = "right",
963
+ Bottom = "bottom",
964
+ Left = "left"
965
+ }
966
+ declare enum RdxPositionAlign {
967
+ Start = "start",
968
+ Center = "center",
969
+ End = "end"
970
+ }
971
+
972
+ export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RdxControlValueAccessor, RdxIdGenerator, RdxLiveAnnouncer, RdxPositionAlign, RdxPositionSide, SHIFT, SPACE, SPACE_CODE, TAB, a, areAllDaysBetweenValid, clamp, createContent, createContext, createFormatter, createMonth, createMonths, elementSize, getActiveElement, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMaxTransitionDuration, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectId, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isNullish, isNumberString, isSegmentNavigationKey, isZonedDateTime, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideToken, provideValueAccessor, resizeEffect, roundToStepPrecision, segmentBuilders, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useArrowNavigation, useDateField, useGraceArea, useScrollLock, useTransitionStatus, watch };
973
+ export type { AcceptableValue, AnyExceptLiteral, AriaLivePoliteness, BooleanInput, CreateMonthProps, DataOrientation, DateAndTimeSegmentObj, DateFormatterOptions, DateMatcher, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DayPeriod, Direction, EditableSegmentPart, Formatter, Granularity, HourCycle, Month, NonEditableSegmentPart, Nullable, NumberInput, PlaceholderMap, RdxFormCheckboxControl, RdxFormStateInput, RdxFormUiControl, RdxFormValueControl, RdxTransitionStatus, RdxTransitionStatusRef, RdxValidationError, SafeFunction, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps };
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InputSignal, WritableSignal, InjectionToken } from '@angular/core';
3
- import { NumberInput } from '@angular/cdk/coercion';
2
+ import { InjectionToken, InputSignal, WritableSignal } from '@angular/core';
3
+ import { NumberInput } from '@radix-ng/primitives/core';
4
4
  import * as _radix_ng_primitives_cropper from '@radix-ng/primitives/cropper';
5
5
 
6
6
  interface CropperContextToken {