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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
  13. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  15. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  17. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  19. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  22. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-core.mjs +845 -744
  24. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
  26. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
  28. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  30. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  32. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
  34. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  35. package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
  36. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  38. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  40. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  41. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  42. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  43. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  44. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  45. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  46. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
  48. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  50. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  51. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  52. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  53. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  54. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  56. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  59. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
  61. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  63. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  65. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  67. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  68. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  69. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  71. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  73. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
  75. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
  76. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  77. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  79. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  81. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  83. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  85. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
  87. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  89. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
  91. package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
  92. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  93. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  95. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  97. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
  99. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  101. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  102. package/meter/README.md +3 -0
  103. package/navigation-menu/README.md +2 -1
  104. package/package.json +39 -18
  105. package/portal/README.md +2 -0
  106. package/preview-card/README.md +3 -0
  107. package/schematics/collection.json +1 -0
  108. package/schematics/ng-add/index.d.ts +3 -2
  109. package/schematics/ng-add/index.js +62 -31
  110. package/schematics/ng-add/index.js.map +1 -1
  111. package/schematics/ng-add/package-config.d.ts +4 -2
  112. package/schematics/ng-add/package-config.js +10 -2
  113. package/schematics/ng-add/package-config.js.map +1 -1
  114. package/schematics/ng-add/schema.d.ts +3 -0
  115. package/schematics/ng-add/schema.js +3 -0
  116. package/schematics/ng-add/schema.js.map +1 -0
  117. package/schematics/ng-add/schema.json +14 -0
  118. package/select/README.md +2 -0
  119. package/types/radix-ng-primitives-accordion.d.ts +51 -16
  120. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  121. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  122. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  123. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  124. package/types/radix-ng-primitives-button.d.ts +73 -0
  125. package/types/radix-ng-primitives-calendar.d.ts +39 -20
  126. package/types/radix-ng-primitives-checkbox.d.ts +204 -35
  127. package/types/radix-ng-primitives-collapsible.d.ts +114 -40
  128. package/types/radix-ng-primitives-collection.d.ts +38 -34
  129. package/types/radix-ng-primitives-config.d.ts +1 -1
  130. package/types/radix-ng-primitives-context-menu.d.ts +61 -116
  131. package/types/radix-ng-primitives-core.d.ts +345 -235
  132. package/types/radix-ng-primitives-cropper.d.ts +89 -56
  133. package/types/radix-ng-primitives-date-field.d.ts +49 -28
  134. package/types/radix-ng-primitives-dialog.d.ts +283 -165
  135. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  136. package/types/radix-ng-primitives-drawer.d.ts +426 -0
  137. package/types/radix-ng-primitives-editable.d.ts +91 -14
  138. package/types/radix-ng-primitives-field.d.ts +374 -0
  139. package/types/radix-ng-primitives-fieldset.d.ts +49 -0
  140. package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
  141. package/types/radix-ng-primitives-input.d.ts +87 -0
  142. package/types/radix-ng-primitives-label.d.ts +0 -1
  143. package/types/radix-ng-primitives-menu.d.ts +584 -99
  144. package/types/radix-ng-primitives-menubar.d.ts +61 -50
  145. package/types/radix-ng-primitives-meter.d.ts +194 -0
  146. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  147. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  148. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  149. package/types/radix-ng-primitives-popover.d.ts +366 -351
  150. package/types/radix-ng-primitives-popper.d.ts +68 -11
  151. package/types/radix-ng-primitives-portal.d.ts +14 -6
  152. package/types/radix-ng-primitives-presence.d.ts +28 -76
  153. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  154. package/types/radix-ng-primitives-progress.d.ts +175 -48
  155. package/types/radix-ng-primitives-radio.d.ts +55 -25
  156. package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
  157. package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
  158. package/types/radix-ng-primitives-select.d.ts +475 -177
  159. package/types/radix-ng-primitives-separator.d.ts +7 -32
  160. package/types/radix-ng-primitives-slider.d.ts +315 -201
  161. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  162. package/types/radix-ng-primitives-switch.d.ts +86 -71
  163. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  164. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  165. package/types/radix-ng-primitives-toast.d.ts +378 -0
  166. package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
  167. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  168. package/types/radix-ng-primitives-toolbar.d.ts +164 -38
  169. package/types/radix-ng-primitives-tooltip.d.ts +348 -384
  170. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  171. package/dropdown-menu/README.md +0 -1
  172. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  173. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  174. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  175. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  176. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  177. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  178. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  179. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  180. package/hover-card/README.md +0 -3
  181. package/select2/README.md +0 -3
  182. package/tooltip2/README.md +0 -3
  183. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  184. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  185. package/types/radix-ng-primitives-select2.d.ts +0 -511
  186. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -1,28 +1,21 @@
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 { InputSignal, Signal } from '@angular/core';
3
+ import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
4
+ import { NumberInput, BooleanInput } from '@radix-ng/primitives/core';
4
5
  import * as _radix_ng_primitives_cropper from '@radix-ng/primitives/cropper';
5
6
 
6
- interface CropperContextToken {
7
- image: InputSignal<string>;
8
- getImageProps: () => {
9
- [key: string]: any;
10
- };
11
- getImageWrapperStyle: () => Record<string, string>;
12
- getCropAreaStyle: () => Record<string, string>;
13
- descriptionId: WritableSignal<string>;
14
- }
15
- declare const CROPPER_ROOT_CONTEXT: InjectionToken<CropperContextToken>;
16
- declare function injectCropperRootContext(): CropperContextToken;
17
-
7
+ /** A crop rectangle in the source image's natural-pixel coordinate space. */
18
8
  type Area = {
19
9
  x: number;
20
10
  y: number;
21
11
  width: number;
22
12
  height: number;
23
13
  };
24
- declare class RdxCropperRootDirective implements CropperContextToken {
14
+
15
+ declare class RdxCropperRootDirective {
25
16
  private readonly elementRef;
17
+ private readonly injector;
18
+ private readonly isBrowser;
26
19
  private readonly CROPPER_DESC_WARN_MESSAGE;
27
20
  readonly image: _angular_core.InputSignal<string>;
28
21
  readonly cropPadding: _angular_core.InputSignalWithTransform<number, unknown>;
@@ -30,29 +23,55 @@ declare class RdxCropperRootDirective implements CropperContextToken {
30
23
  readonly minZoom: _angular_core.InputSignalWithTransform<number, unknown>;
31
24
  readonly maxZoom: _angular_core.InputSignalWithTransform<number, unknown>;
32
25
  readonly zoomSensitivity: _angular_core.InputSignalWithTransform<number, unknown>;
26
+ /** Pan distance (px) per arrow-key press. */
33
27
  readonly keyboardStep: _angular_core.InputSignalWithTransform<number, unknown>;
28
+ /** Zoom delta per `+` / `-` / `PageUp` / `PageDown` press. */
29
+ readonly zoomKeyboardStep: _angular_core.InputSignalWithTransform<number, unknown>;
34
30
  readonly zoom: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
31
+ /** Accessible name for the cropper widget. */
32
+ readonly ariaLabel: _angular_core.InputSignal<string>;
33
+ /** Disables all interaction (drag, wheel/pinch zoom, keyboard); exposed as `data-disabled`. */
34
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
35
35
  readonly onCropChange: _angular_core.OutputEmitterRef<Area | null>;
36
36
  readonly onZoomChange: _angular_core.OutputEmitterRef<number>;
37
37
  private readonly imgWidth;
38
38
  private readonly imgHeight;
39
+ /** Raw content-box size (px) of the root, fed by the ResizeObserver / initial measure. */
40
+ private readonly containerSize;
41
+ /**
42
+ * Crop-area size derived from the container minus padding, fitted to `aspectRatio`. A `computed`
43
+ * (not a written signal) so it stays reactive to `aspectRatio` / `cropPadding` changes, not only
44
+ * to container resizes — previously these inputs were read inside the ResizeObserver closure and
45
+ * never recomputed until the next resize.
46
+ */
47
+ private readonly cropAreaSize;
39
48
  private readonly cropAreaWidth;
40
49
  private readonly cropAreaHeight;
41
50
  private readonly imageWrapperWidth;
42
51
  private readonly imageWrapperHeight;
43
- private readonly offsetX;
44
- private readonly offsetY;
52
+ /** Raw (unclamped) pan-offset intent (px) written by gestures; clamping lives in `clampedOffset`. */
53
+ private readonly offset;
45
54
  private readonly internalZoom;
46
- private readonly isDragging;
47
- readonly descriptionId: _angular_core.WritableSignal<string>;
55
+ protected readonly isDragging: _angular_core.WritableSignal<boolean>;
56
+ readonly descriptionId: string;
48
57
  private readonly isZoomControlled;
49
58
  protected readonly effectiveZoom: _angular_core.Signal<number>;
50
- protected readonly zoomValueText: _angular_core.Signal<string>;
59
+ /**
60
+ * The applied pan offset (px): the raw intent clamped to keep the image covering the crop window
61
+ * at the current geometry/zoom. Derived (not an effect) so it self-corrects when the container
62
+ * resizes or the zoom/aspect-ratio changes — no write-back, no `untracked` re-entrancy. This is the
63
+ * value the view renders and the crop math reads.
64
+ */
65
+ private readonly clampedOffset;
66
+ /**
67
+ * Crop rectangle derived from the rendered pan/zoom — the single source of truth for emission.
68
+ * `onCropChange` fires from one effect watching this, so interactions/handlers never emit directly
69
+ * (which previously double-emitted). Value equality keeps it from notifying on equal results.
70
+ */
71
+ private readonly cropData;
51
72
  private readonly dragStartPoint;
52
73
  private readonly dragStartOffset;
53
- private readonly latestRestrictedOffset;
54
74
  private readonly latestZoom;
55
- private readonly isInitialSetupDone;
56
75
  private readonly initialPinchDistance;
57
76
  private readonly initialPinchZoom;
58
77
  private readonly isPinching;
@@ -62,75 +81,89 @@ declare class RdxCropperRootDirective implements CropperContextToken {
62
81
  private initializeContainerDimensions;
63
82
  private setupImageLoadEffect;
64
83
  private setupDimensionsEffects;
84
+ /** Current rendered geometry the crop math operates on, read from the state signals. */
85
+ private geometry;
65
86
  private restrictOffset;
66
- private calculateCropData;
67
- private setupCropCalculationEffect;
68
87
  private setupAccessibilityWarningEffect;
88
+ /**
89
+ * Single attachment point for every interaction listener. Re-runs on `disabled()`, so a disabled
90
+ * cropper has NO interaction listeners bound at all — there is no per-handler `disabled` check to
91
+ * forget, and a new gesture path can't accidentally bypass the gate. Uses `{ passive: false }` so
92
+ * the handlers can `preventDefault()` (wheel/touch scrolling, arrow-key page scroll).
93
+ */
69
94
  private setupEventListenersEffect;
70
- private handleInteractionEnd;
95
+ private onMouseDown;
71
96
  /**
72
- * @ignore
97
+ * Zoom toward an anchor point (coordinates relative to the root's center). `fromZoom`/`fromOffset`
98
+ * are the zoom/offset the anchor is measured against — the live state for wheel/keyboard, the
99
+ * gesture-start baseline for pinch. Emits the zoom request via {@link updateZoom}, then re-anchors
100
+ * the pan offset **only when the zoom is uncontrolled**: in controlled mode the rendered zoom does
101
+ * not change until the parent writes `zoom` back, so writing an offset for a not-yet-applied zoom
102
+ * would pan the image without rescaling it (`clampedOffset` re-derives once the new zoom applies).
73
103
  */
74
- onMouseDown(e: MouseEvent): void;
104
+ private zoomToPoint;
75
105
  private handleWheel;
76
106
  private getPinchDistance;
77
107
  private getPinchCenter;
78
108
  private handleTouchStart;
79
109
  private handleTouchMove;
80
110
  private handleTouchEnd;
111
+ private onKeyDown;
112
+ /** Zoom by `delta` keeping the crop center fixed (the keyboard counterpart of wheel/pinch zoom). */
113
+ private zoomFromCenter;
81
114
  /**
82
- * @ignore
115
+ * Inline style for the image wrapper: measured size, centered in the root, then translated and
116
+ * scaled by the current pan offset and zoom. A `computed` (not a method) so the `[style]` binding
117
+ * only re-applies when an input actually changes — a per-change-detection method call would
118
+ * allocate a new object every tick and force a constant re-bind.
83
119
  */
84
- onKeyDown(e: KeyboardEvent): void;
85
- /**
86
- * @ignore
87
- */
88
- onKeyUp(e: KeyboardEvent): void;
89
- /**
90
- * @ignore
91
- */
92
- getImageProps(): {
93
- [key: string]: any;
94
- };
95
- /**
96
- * @ignore
97
- */
98
- getImageWrapperStyle(): Record<string, string>;
99
- /**
100
- * @ignore
101
- */
102
- getCropAreaStyle(): Record<string, string>;
120
+ readonly imageWrapperStyle: _angular_core.Signal<Record<string, string>>;
121
+ /** Inline style for the crop-area overlay (its measured width/height). */
122
+ readonly cropAreaStyle: _angular_core.Signal<Record<string, string>>;
103
123
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCropperRootDirective, never>;
104
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCropperRootDirective, "[rdxCropperRoot]", never, { "image": { "alias": "image"; "required": true; "isSignal": true; }; "cropPadding": { "alias": "cropPadding"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "zoomSensitivity": { "alias": "zoomSensitivity"; "required": false; "isSignal": true; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; }, { "onCropChange": "onCropChange"; "onZoomChange": "onZoomChange"; }, never, never, true, never>;
124
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCropperRootDirective, "[rdxCropperRoot]", never, { "image": { "alias": "image"; "required": true; "isSignal": true; }; "cropPadding": { "alias": "cropPadding"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "zoomSensitivity": { "alias": "zoomSensitivity"; "required": false; "isSignal": true; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; "zoomKeyboardStep": { "alias": "zoomKeyboardStep"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onCropChange": "onCropChange"; "onZoomChange": "onZoomChange"; }, never, never, true, never>;
105
125
  }
106
126
 
107
127
  declare class RdxCropperImageComponent {
108
- protected readonly rootContext: _radix_ng_primitives_cropper.CropperContextToken;
128
+ protected readonly rootContext: _radix_ng_primitives_cropper.CropperRootContext;
109
129
  readonly imgClass: _angular_core.InputSignal<string | undefined>;
110
130
  readonly imgStyles: _angular_core.InputSignal<string | undefined>;
111
- protected readonly imgClasses: _angular_core.Signal<string | undefined>;
112
- protected readonly imgStyless: _angular_core.Signal<string | undefined>;
131
+ /**
132
+ * `alt` text for the rendered image. Defaults to `''` (decorative — screen readers skip it, since
133
+ * the cropper widget describes itself via the root's label/description). Set a non-empty value to
134
+ * give the image a meaningful accessible name.
135
+ */
136
+ readonly imgAlt: _angular_core.InputSignal<string>;
113
137
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCropperImageComponent, never>;
114
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<RdxCropperImageComponent, "[rdxCropperImage]", never, { "imgClass": { "alias": "imgClass"; "required": false; "isSignal": true; }; "imgStyles": { "alias": "imgStyles"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
138
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RdxCropperImageComponent, "[rdxCropperImage]", never, { "imgClass": { "alias": "imgClass"; "required": false; "isSignal": true; }; "imgStyles": { "alias": "imgStyles"; "required": false; "isSignal": true; }; "imgAlt": { "alias": "imgAlt"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
115
139
  }
116
140
 
117
141
  declare class RdxCropperCropAreaDirective {
118
- readonly rootContext: _radix_ng_primitives_cropper.CropperContextToken;
142
+ readonly rootContext: _radix_ng_primitives_cropper.CropperRootContext;
119
143
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCropperCropAreaDirective, never>;
120
144
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCropperCropAreaDirective, "[rdxCropperCropArea]", never, {}, {}, never, never, true, never>;
121
145
  }
122
146
 
123
147
  declare class RdxCropperDescriptionDirective {
124
- readonly rootContext: _radix_ng_primitives_cropper.CropperContextToken;
148
+ readonly rootContext: _radix_ng_primitives_cropper.CropperRootContext;
125
149
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCropperDescriptionDirective, never>;
126
150
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCropperDescriptionDirective, "[rdxCropperDescription]", never, {}, {}, never, never, true, never>;
127
151
  }
128
152
 
153
+ interface CropperRootContext {
154
+ image: InputSignal<string>;
155
+ imageWrapperStyle: Signal<Record<string, string>>;
156
+ cropAreaStyle: Signal<Record<string, string>>;
157
+ descriptionId: string;
158
+ }
159
+ declare const injectCropperRootContext: _radix_ng_primitives_core.InjectContext<CropperRootContext>;
160
+ declare const provideCropperRootContext: (useFactory: () => CropperRootContext) => _angular_core.Provider;
161
+
129
162
  declare class RdxCropperModule {
130
163
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCropperModule, never>;
131
164
  static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCropperModule, never, [typeof RdxCropperRootDirective, typeof RdxCropperImageComponent, typeof RdxCropperCropAreaDirective, typeof RdxCropperDescriptionDirective], [typeof RdxCropperRootDirective, typeof RdxCropperImageComponent, typeof RdxCropperCropAreaDirective, typeof RdxCropperDescriptionDirective]>;
132
165
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxCropperModule>;
133
166
  }
134
167
 
135
- export { CROPPER_ROOT_CONTEXT, RdxCropperCropAreaDirective, RdxCropperDescriptionDirective, RdxCropperImageComponent, RdxCropperModule, RdxCropperRootDirective, injectCropperRootContext };
136
- export type { Area, CropperContextToken };
168
+ export { RdxCropperCropAreaDirective, RdxCropperDescriptionDirective, RdxCropperImageComponent, RdxCropperModule, RdxCropperRootDirective, injectCropperRootContext, provideCropperRootContext };
169
+ export type { Area, CropperRootContext };
@@ -1,19 +1,16 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, AfterViewInit, InputSignal, ModelSignal, Signal, WritableSignal, InjectionToken } from '@angular/core';
2
+ import { Signal, InjectionToken, InputSignal, ModelSignal, WritableSignal } from '@angular/core';
3
3
  import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
4
- import { DateMatcher, HourCycle, Granularity, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
5
- import { Direction } from '@angular/cdk/bidi';
6
- import { BooleanInput } from '@angular/cdk/coercion';
4
+ import { DateMatcher, HourCycle, Granularity, Direction, BooleanInput, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
7
5
  import { DateValue } from '@internationalized/date';
8
6
 
9
- declare class RdxDateFieldRootDirective implements OnInit, AfterViewInit {
10
- private readonly elementRef;
7
+ declare class RdxDateFieldRootDirective {
11
8
  /**
12
- * The controlled checked state of the calendar.
9
+ * The controlled value of the date field.
13
10
  */
14
11
  readonly value: _angular_core.ModelSignal<DateValue | undefined>;
15
12
  /**
16
- * A callback fired when the date field's value is invalid.
13
+ * A matcher that marks specific dates as unavailable; a matched value makes the field invalid.
17
14
  */
18
15
  readonly isDateUnavailable: _angular_core.InputSignal<DateMatcher | undefined>;
19
16
  /**
@@ -51,43 +48,57 @@ declare class RdxDateFieldRootDirective implements OnInit, AfterViewInit {
51
48
  * The stepping interval for the time fields. Defaults to 1
52
49
  */
53
50
  readonly step: _angular_core.InputSignal<DateStep | undefined>;
54
- readonly step$: _angular_core.Signal<DateStep>;
51
+ readonly step$: Signal<DateStep>;
55
52
  /**
53
+ * Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or
54
+ * `hourCycle` change so segments always render with the current settings.
56
55
  * @ignore
57
56
  */
58
- readonly defaultDate: _angular_core.Signal<DateValue>;
57
+ readonly formatter: Signal<Formatter>;
58
+ /**
59
+ * @ignore
60
+ */
61
+ readonly defaultDate: Signal<DateValue>;
59
62
  /**
60
63
  * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view
61
64
  */
62
65
  readonly placeholder: _angular_core.ModelSignal<DateValue | undefined>;
63
66
  /**
67
+ * Segment input parts, collected from the projected content in DOM order. This
68
+ * stays in sync with `segmentContents()` (granularity / locale / value changes
69
+ * add or remove segments) instead of being captured once after view init.
64
70
  * @ignore
65
71
  */
66
- readonly segmentElements: _angular_core.WritableSignal<Set<HTMLElement>>;
72
+ private readonly segmentInputs;
67
73
  /**
74
+ * The focusable (non-literal) segment elements, in DOM order.
68
75
  * @ignore
69
76
  */
70
- readonly currentFocusedElement: _angular_core.WritableSignal<HTMLElement | null>;
77
+ readonly segmentElements: Signal<HTMLElement[]>;
71
78
  /**
72
79
  * @ignore
73
80
  */
74
- formatter: Formatter;
81
+ readonly currentFocusedElement: _angular_core.WritableSignal<HTMLElement | null>;
75
82
  /**
76
83
  * @ignore
77
84
  */
78
- readonly segmentValues: _angular_core.WritableSignal<SegmentValueObj>;
85
+ readonly inferredGranularity: Signal<Granularity | undefined>;
79
86
  /**
87
+ * The per-segment values. Writable so segment editing (via `useDateField`) can
88
+ * update individual parts, but re-synced from the model whenever the value,
89
+ * granularity or formatter change — so a controlled `value` set after init is
90
+ * reflected, and an empty field re-initializes when granularity changes.
80
91
  * @ignore
81
92
  */
82
- readonly inferredGranularity: _angular_core.Signal<Granularity | undefined>;
93
+ readonly segmentValues: _angular_core.WritableSignal<SegmentValueObj>;
83
94
  /**
84
95
  * @ignore
85
96
  */
86
- readonly isInvalid: _angular_core.Signal<boolean>;
97
+ readonly isInvalid: Signal<boolean>;
87
98
  /**
88
99
  * @ignore
89
100
  */
90
- readonly allSegmentContent: _angular_core.Signal<{
101
+ readonly allSegmentContent: Signal<{
91
102
  obj: _radix_ng_primitives_core.SegmentContentObj;
92
103
  arr: {
93
104
  part: _radix_ng_primitives_core.SegmentPart;
@@ -97,29 +108,27 @@ declare class RdxDateFieldRootDirective implements OnInit, AfterViewInit {
97
108
  /**
98
109
  * An array of segments that should be readonly, which prevent user input on them.
99
110
  */
100
- readonly segmentContents: _angular_core.Signal<{
111
+ readonly segmentContents: Signal<{
101
112
  part: _radix_ng_primitives_core.SegmentPart;
102
113
  value: string;
103
114
  }[]>;
104
115
  /**
105
116
  * @ignore
106
117
  */
107
- readonly currentSegmentIndex: _angular_core.Signal<number>;
118
+ readonly currentSegmentIndex: Signal<number>;
108
119
  /**
109
120
  * @ignore
110
121
  */
111
- readonly prevFocusableSegment: _angular_core.Signal<HTMLElement | null>;
122
+ readonly prevFocusableSegment: Signal<HTMLElement | null>;
112
123
  /**
113
124
  * @ignore
114
125
  */
115
- readonly nextFocusableSegment: _angular_core.Signal<HTMLElement | null>;
126
+ readonly nextFocusableSegment: Signal<HTMLElement | null>;
116
127
  /**
117
128
  * @ignore
118
129
  */
119
130
  readonly focusNext: () => void;
120
131
  constructor();
121
- ngOnInit(): void;
122
- ngAfterViewInit(): void;
123
132
  /**
124
133
  * @ignore
125
134
  */
@@ -129,11 +138,17 @@ declare class RdxDateFieldRootDirective implements OnInit, AfterViewInit {
129
138
  */
130
139
  setFocusedElement(el: HTMLElement): void;
131
140
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxDateFieldRootDirective, never>;
132
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxDateFieldRootDirective, "[rdxDateFieldRoot]", ["rdxDateFieldRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "isDateUnavailable": { "alias": "isDateUnavailable"; "required": false; "isSignal": true; }; "hourCycle": { "alias": "hourCycle"; "required": false; "isSignal": true; }; "granularity": { "alias": "granularity"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "hideTimeZone": { "alias": "hideTimeZone"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "placeholder": "placeholderChange"; }, never, never, true, never>;
141
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxDateFieldRootDirective, "[rdxDateFieldRoot]", ["rdxDateFieldRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "isDateUnavailable": { "alias": "isDateUnavailable"; "required": false; "isSignal": true; }; "hourCycle": { "alias": "hourCycle"; "required": false; "isSignal": true; }; "granularity": { "alias": "granularity"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "hideTimeZone": { "alias": "hideTimeZone"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "placeholder": "placeholderChange"; }, ["segmentInputs"], never, true, never>;
133
142
  }
134
143
 
135
144
  declare class RdxDateFieldInputDirective {
136
145
  private readonly elementRef;
146
+ /**
147
+ * The host element of this segment. Consumed by the root to collect focusable
148
+ * segments in DOM order.
149
+ * @ignore
150
+ */
151
+ readonly element: HTMLElement;
137
152
  private readonly rootContext;
138
153
  /**
139
154
  * The part of the date to render
@@ -162,15 +177,21 @@ declare class RdxDateFieldInputDirective {
162
177
  readonly lastKeyZero: _angular_core.WritableSignal<boolean>;
163
178
  private readonly fieldData;
164
179
  private readonly attributes;
180
+ /**
181
+ * Attribute keys applied imperatively on the previous effect run, so keys that
182
+ * disappear from `attributes()` are removed instead of lingering as stale state.
183
+ * @ignore
184
+ */
185
+ private appliedAttrs;
186
+ constructor();
165
187
  /**
166
188
  * @ignore
167
189
  */
168
- handleSegmentClick: (e: Event) => void;
190
+ handleSegmentClick(event: Event): void;
169
191
  /**
170
192
  * @ignore
171
193
  */
172
- handleSegmentKeydown: (e: Event) => void;
173
- constructor();
194
+ handleSegmentKeydown(event: Event): void;
174
195
  /**
175
196
  * @ignore
176
197
  */
@@ -192,7 +213,7 @@ interface DateFieldContextToken {
192
213
  placeholder: ModelSignal<DateValue>;
193
214
  hourCycle: InputSignal<HourCycle>;
194
215
  step$: Signal<DateStep>;
195
- formatter: Formatter;
216
+ formatter: Signal<Formatter>;
196
217
  segmentValues: WritableSignal<SegmentValueObj>;
197
218
  focusNext: () => void;
198
219
  setFocusedElement: (el: HTMLElement) => void;