ng-primitives 0.120.4 → 0.121.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 (147) hide show
  1. package/example-theme/index.css +9 -0
  2. package/fesm2022/ng-primitives-a11y.mjs +5 -5
  3. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-accordion.mjs +34 -51
  5. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-ai.mjs +39 -52
  7. package/fesm2022/ng-primitives-ai.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-autofill.mjs +4 -4
  9. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-avatar.mjs +14 -17
  11. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
  13. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-button.mjs +7 -9
  15. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-checkbox.mjs +15 -30
  17. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-combobox.mjs +60 -92
  19. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-common.mjs +4 -4
  21. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-context-menu.mjs +68 -121
  23. package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-date-picker.mjs +91 -115
  25. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-dialog.mjs +35 -51
  27. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-file-upload.mjs +26 -53
  29. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
  31. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  32. package/fesm2022/ng-primitives-form-field.mjs +39 -44
  33. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-input-otp.mjs +30 -43
  35. package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
  36. package/fesm2022/ng-primitives-input.mjs +6 -8
  37. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-interactions.mjs +31 -48
  39. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-internal.mjs +39 -35
  41. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-listbox.mjs +34 -48
  43. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-menu.mjs +85 -151
  45. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-meter.mjs +25 -36
  47. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
  49. package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
  50. package/fesm2022/ng-primitives-number-field.mjs +35 -59
  51. package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
  52. package/fesm2022/ng-primitives-pagination.mjs +270 -297
  53. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  54. package/fesm2022/ng-primitives-popover.mjs +209 -223
  55. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  56. package/fesm2022/ng-primitives-portal.mjs +88 -59
  57. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  58. package/fesm2022/ng-primitives-progress.mjs +30 -41
  59. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  60. package/fesm2022/ng-primitives-radio.mjs +20 -30
  61. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  62. package/fesm2022/ng-primitives-resize.mjs +3 -3
  63. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  64. package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
  65. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  66. package/fesm2022/ng-primitives-search.mjs +9 -9
  67. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  68. package/fesm2022/ng-primitives-select.mjs +720 -620
  69. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  70. package/fesm2022/ng-primitives-separator.mjs +4 -6
  71. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  72. package/fesm2022/ng-primitives-slider.mjs +63 -100
  73. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  74. package/fesm2022/ng-primitives-state.mjs +3 -3
  75. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  76. package/fesm2022/ng-primitives-switch.mjs +15 -21
  77. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  78. package/fesm2022/ng-primitives-tabs.mjs +31 -41
  79. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  80. package/fesm2022/ng-primitives-textarea.mjs +5 -7
  81. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  82. package/fesm2022/ng-primitives-toast.mjs +30 -23
  83. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  84. package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
  85. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  86. package/fesm2022/ng-primitives-toggle.mjs +10 -19
  87. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  88. package/fesm2022/ng-primitives-toolbar.mjs +4 -6
  89. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  90. package/fesm2022/ng-primitives-tooltip.mjs +401 -402
  91. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  92. package/fesm2022/ng-primitives-utils.mjs +5 -4
  93. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  94. package/package.json +56 -55
  95. package/schematics/ng-generate/templates/select/select.__fileSuffix@dasherize__.ts.template +48 -48
  96. package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +18 -24
  97. package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +85 -98
  98. package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +3 -10
  99. package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +7 -30
  100. package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +15 -70
  101. package/{button/index.d.ts → types/ng-primitives-button.d.ts} +23 -29
  102. package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +68 -74
  103. package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
  104. package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +2 -1
  105. package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
  106. package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +7 -2
  107. package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +5 -20
  108. package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +3 -10
  109. package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +9 -40
  110. package/{input/index.d.ts → types/ng-primitives-input.d.ts} +3 -10
  111. package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +17 -63
  112. package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +15 -70
  113. package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +80 -110
  114. package/types/ng-primitives-pagination.d.ts +502 -0
  115. package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +244 -57
  116. package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +22 -13
  117. package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +3 -10
  118. package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +65 -79
  119. package/types/ng-primitives-select.d.ts +687 -0
  120. package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +3 -10
  121. package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +76 -138
  122. package/{state/index.d.ts → types/ng-primitives-state.d.ts} +26 -21
  123. package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +50 -64
  124. package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +9 -40
  125. package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +3 -10
  126. package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +13 -1
  127. package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +75 -89
  128. package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +50 -56
  129. package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +3 -10
  130. package/types/ng-primitives-tooltip.d.ts +691 -0
  131. package/pagination/index.d.ts +0 -211
  132. package/select/index.d.ts +0 -396
  133. package/tooltip/index.d.ts +0 -384
  134. /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
  135. /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
  136. /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
  137. /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
  138. /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
  139. /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
  140. /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
  141. /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
  142. /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
  143. /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
  144. /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
  145. /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
  146. /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
  147. /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
@@ -0,0 +1,691 @@
1
+ import * as ng_primitives_portal from 'ng-primitives/portal';
2
+ import { NgpOffset, NgpFlip, NgpShift, NgpOverlayArrowState, NgpOverlayArrowProps, NgpOverlayContent, NgpPosition, NgpOverlay, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal';
3
+ export { NgpOverlayArrowProps as NgpTooltipArrowProps, NgpOverlayArrowState as NgpTooltipArrowState, injectOverlayContext as injectTooltipContext } from 'ng-primitives/portal';
4
+ import * as _angular_core from '@angular/core';
5
+ import { Provider, WritableSignal, Signal, OnDestroy, ElementRef } from '@angular/core';
6
+ import { Placement } from '@floating-ui/dom';
7
+ import { NumberInput, BooleanInput } from '@angular/cdk/coercion';
8
+ import * as ng_primitives_state from 'ng-primitives/state';
9
+ import { StateInjectionOptions } from 'ng-primitives/state';
10
+
11
+ interface NgpTooltipConfig {
12
+ /**
13
+ * Define the offset of the tooltip relative to the trigger.
14
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
15
+ * @default 4
16
+ */
17
+ offset: NgpOffset;
18
+ /**
19
+ * Define the placement of the tooltip relative to the trigger.
20
+ * @default 'top'
21
+ */
22
+ placement: Placement;
23
+ /**
24
+ * Define the delay before the tooltip is shown.
25
+ * @default 0
26
+ */
27
+ showDelay: number;
28
+ /**
29
+ * Define the delay before the tooltip is hidden.
30
+ * @default 500
31
+ */
32
+ hideDelay: number;
33
+ /**
34
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
35
+ * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.
36
+ * @default true
37
+ */
38
+ flip: NgpFlip;
39
+ /**
40
+ * Define the container element or selector into which the tooltip should be attached.
41
+ * @default 'body'
42
+ */
43
+ container: HTMLElement | string | null;
44
+ /**
45
+ * Whether the tooltip should only show when the trigger element overflows.
46
+ * @default false
47
+ */
48
+ showOnOverflow: boolean;
49
+ /**
50
+ * Whether to use the text content of the trigger element as the tooltip content.
51
+ * @default true
52
+ */
53
+ useTextContent: boolean;
54
+ /**
55
+ * Configure shift behavior to keep the tooltip in view.
56
+ * Can be a boolean to enable/disable, or an object with padding and limiter options.
57
+ * @default undefined (enabled by default in overlay)
58
+ */
59
+ shift: NgpShift;
60
+ /**
61
+ * Whether to track the trigger element position on every animation frame.
62
+ * Useful for moving elements like slider thumbs.
63
+ * @default false
64
+ */
65
+ trackPosition: boolean;
66
+ /**
67
+ * Defines how the tooltip behaves when the window is scrolled.
68
+ * @default 'reposition'
69
+ */
70
+ scrollBehavior: 'reposition' | 'close';
71
+ /**
72
+ * Cooldown duration in milliseconds.
73
+ * When moving from one tooltip to another within this duration,
74
+ * the showDelay is skipped for the new tooltip.
75
+ * @default 300
76
+ */
77
+ cooldown: number;
78
+ /**
79
+ * Whether hovering the tooltip content keeps it open while moving from the trigger.
80
+ * @default false
81
+ */
82
+ hoverableContent: boolean;
83
+ }
84
+ /**
85
+ * Provide the default Tooltip configuration
86
+ * @param config The Tooltip configuration
87
+ * @returns The provider
88
+ */
89
+ declare function provideTooltipConfig(config: Partial<NgpTooltipConfig>): Provider[];
90
+
91
+ declare class NgpTooltipArrow {
92
+ /**
93
+ * Padding between the arrow and the edges of the tooltip.
94
+ * This prevents the arrow from overflowing the rounded corners.
95
+ */
96
+ readonly padding: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
97
+ protected readonly state: ng_primitives_portal.NgpOverlayArrowState;
98
+ /**
99
+ * Set the padding between the arrow and the edges of the tooltip.
100
+ * @param value The padding value in pixels
101
+ */
102
+ setPadding(value: number | undefined): void;
103
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpTooltipArrow, never>;
104
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpTooltipArrow, "[ngpTooltipArrow]", ["ngpTooltipArrow"], { "padding": { "alias": "ngpTooltipArrowPadding"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
105
+ }
106
+
107
+ declare const NgpTooltipArrowStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<NgpOverlayArrowState>>;
108
+ declare const ngpTooltipArrow: ({ padding }: NgpOverlayArrowProps) => NgpOverlayArrowState;
109
+ declare const injectTooltipArrowState: {
110
+ (): _angular_core.Signal<NgpOverlayArrowState>;
111
+ (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<NgpOverlayArrowState | null>;
112
+ (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<NgpOverlayArrowState> | _angular_core.Signal<NgpOverlayArrowState | null>;
113
+ };
114
+ declare const provideTooltipArrowState: (opts?: {
115
+ inherit?: boolean;
116
+ }) => _angular_core.FactoryProvider;
117
+
118
+ interface TooltipHoverBridgePoint {
119
+ x: number;
120
+ y: number;
121
+ }
122
+
123
+ interface NgpTooltipTriggerState<T> {
124
+ /** Access the tooltip template ref. */
125
+ readonly tooltip: WritableSignal<NgpOverlayContent<T> | string | null>;
126
+ /**
127
+ * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.
128
+ * @default false
129
+ */
130
+ readonly disabled: Signal<boolean>;
131
+ /**
132
+ * Define the placement of the tooltip relative to the trigger.
133
+ * @default 'top'
134
+ */
135
+ readonly placement: Signal<NgpTooltipPlacement>;
136
+ /**
137
+ * Define the offset of the tooltip relative to the trigger.
138
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
139
+ * @default 0
140
+ */
141
+ readonly offset: Signal<NgpOffset>;
142
+ /**
143
+ * Define the delay before the tooltip is displayed.
144
+ * @default 500
145
+ */
146
+ readonly showDelay: Signal<number>;
147
+ /**
148
+ * Define the delay before the tooltip is hidden.
149
+ * @default 0
150
+ */
151
+ readonly hideDelay: Signal<number>;
152
+ /**
153
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
154
+ * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.
155
+ * @default true
156
+ */
157
+ readonly flip: Signal<NgpFlip>;
158
+ /**
159
+ * Configure shift behavior to keep the tooltip in view.
160
+ * Can be a boolean to enable/disable, or an object with padding and limiter options.
161
+ * @default undefined (enabled by default in overlay)
162
+ */
163
+ readonly shift: Signal<NgpShift>;
164
+ /**
165
+ * Define the container in which the tooltip should be attached.
166
+ * @default document.body
167
+ */
168
+ readonly container: Signal<HTMLElement | string | null>;
169
+ /**
170
+ * Define whether the tooltip should only show when the trigger element overflows.
171
+ * @default false
172
+ */
173
+ readonly showOnOverflow: Signal<boolean>;
174
+ /**
175
+ * Define an anchor element for positioning the tooltip.
176
+ * If provided, the tooltip will be positioned relative to this element instead of the trigger.
177
+ */
178
+ readonly anchor: Signal<HTMLElement | null>;
179
+ /**
180
+ * Provide context to the tooltip. This can be used to pass data to the tooltip content.
181
+ */
182
+ readonly context: Signal<T | undefined>;
183
+ /**
184
+ * Define whether to use the text content of the trigger element as the tooltip content.
185
+ * When enabled, the tooltip will display the text content of the trigger element.
186
+ * @default true
187
+ */
188
+ readonly useTextContent: Signal<boolean>;
189
+ /**
190
+ * Define whether to track the trigger element position on every animation frame.
191
+ * Useful for moving elements like slider thumbs.
192
+ * @default false
193
+ */
194
+ readonly trackPosition: Signal<boolean>;
195
+ /**
196
+ * Programmatic position for the tooltip. When provided, the tooltip
197
+ * will be positioned at these coordinates instead of the trigger element.
198
+ * Use with trackPosition="true" for smooth cursor following.
199
+ */
200
+ readonly position: Signal<NgpPosition | null>;
201
+ /**
202
+ * Defines how the tooltip behaves when the window is scrolled.
203
+ * @default 'reposition'
204
+ */
205
+ readonly scrollBehavior: Signal<'reposition' | 'close'>;
206
+ /**
207
+ * Define the cooldown duration in milliseconds.
208
+ * When moving from one tooltip to another within this duration,
209
+ * the showDelay is skipped for the new tooltip.
210
+ * @default 300
211
+ */
212
+ readonly cooldown: Signal<number>;
213
+ /**
214
+ * Whether hovering tooltip content keeps the tooltip open.
215
+ * @default false
216
+ */
217
+ readonly hoverableContent: Signal<boolean>;
218
+ /**
219
+ * The overlay that manages the tooltip
220
+ * @internal
221
+ */
222
+ readonly overlay: WritableSignal<NgpOverlay<T | string> | null>;
223
+ /**
224
+ * The unique id of the tooltip.
225
+ */
226
+ readonly tooltipId: Signal<string | undefined>;
227
+ /**
228
+ * The open state of the tooltip.
229
+ * @internal
230
+ */
231
+ readonly open: Signal<boolean>;
232
+ /**
233
+ * Determine if the trigger element has overflow.
234
+ */
235
+ readonly hasOverflow: Signal<boolean>;
236
+ /**
237
+ * Tracks whether pointer is currently over tooltip content.
238
+ */
239
+ readonly contentHovered: Signal<boolean>;
240
+ /**
241
+ * Current pointer grace polygon used while crossing trigger -> tooltip.
242
+ */
243
+ readonly hoverBridgePolygon: Signal<TooltipHoverBridgePoint[] | null>;
244
+ /**
245
+ * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).
246
+ */
247
+ show: () => void;
248
+ /**
249
+ * Hide the tooltip.
250
+ */
251
+ hide: () => void;
252
+ /**
253
+ * Set the tooltip id.
254
+ */
255
+ setTooltipId: (id: string) => void;
256
+ /**
257
+ * Called by tooltip content when pointer enters the tooltip.
258
+ * @internal
259
+ */
260
+ onTooltipHoverStart: () => void;
261
+ /**
262
+ * Called by tooltip content when pointer leaves the tooltip.
263
+ * @internal
264
+ */
265
+ onTooltipHoverEnd: () => void;
266
+ destroy: () => void;
267
+ }
268
+ interface NgpTooltipTriggerProps<T> {
269
+ /** Access the tooltip template ref. */
270
+ readonly tooltip?: Signal<NgpOverlayContent<T> | string | null>;
271
+ /**
272
+ * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.
273
+ * @default false
274
+ */
275
+ readonly disabled?: Signal<boolean>;
276
+ /**
277
+ * Define the placement of the tooltip relative to the trigger.
278
+ * @default 'top'
279
+ */
280
+ readonly placement?: Signal<NgpTooltipPlacement>;
281
+ /**
282
+ * Define the offset of the tooltip relative to the trigger.
283
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
284
+ * @default 0
285
+ */
286
+ readonly offset?: Signal<NgpOffset>;
287
+ /**
288
+ * Define the delay before the tooltip is displayed.
289
+ * @default 500
290
+ */
291
+ readonly showDelay?: Signal<number>;
292
+ /**
293
+ * Define the delay before the tooltip is hidden.
294
+ * @default 0
295
+ */
296
+ readonly hideDelay?: Signal<number>;
297
+ /**
298
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
299
+ * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.
300
+ * @default true
301
+ */
302
+ readonly flip?: Signal<NgpFlip>;
303
+ /**
304
+ * Configure shift behavior to keep the tooltip in view.
305
+ * Can be a boolean to enable/disable, or an object with padding and limiter options.
306
+ * @default undefined (enabled by default in overlay)
307
+ */
308
+ readonly shift?: Signal<NgpShift>;
309
+ /**
310
+ * Define the container in which the tooltip should be attached.
311
+ * @default document.body
312
+ */
313
+ readonly container?: Signal<HTMLElement | string | null>;
314
+ /**
315
+ * Define whether the tooltip should only show when the trigger element overflows.
316
+ * @default false
317
+ */
318
+ readonly showOnOverflow?: Signal<boolean>;
319
+ /**
320
+ * Define an anchor element for positioning the tooltip.
321
+ * If provided, the tooltip will be positioned relative to this element instead of the trigger.
322
+ */
323
+ readonly anchor?: Signal<HTMLElement | null>;
324
+ /**
325
+ * Provide context to the tooltip. This can be used to pass data to the tooltip content.
326
+ */
327
+ readonly context?: Signal<T | undefined>;
328
+ /**
329
+ * Define whether to use the text content of the trigger element as the tooltip content.
330
+ * When enabled, the tooltip will display the text content of the trigger element.
331
+ * @default true
332
+ */
333
+ readonly useTextContent?: Signal<boolean>;
334
+ /**
335
+ * Define whether to track the trigger element position on every animation frame.
336
+ * Useful for moving elements like slider thumbs.
337
+ * @default false
338
+ */
339
+ readonly trackPosition?: Signal<boolean>;
340
+ /**
341
+ * Programmatic position for the tooltip. When provided, the tooltip
342
+ * will be positioned at these coordinates instead of the trigger element.
343
+ * Use with trackPosition="true" for smooth cursor following.
344
+ */
345
+ readonly position?: Signal<NgpPosition | null>;
346
+ /**
347
+ * Defines how the tooltip behaves when the window is scrolled.
348
+ * @default 'reposition'
349
+ */
350
+ readonly scrollBehavior?: Signal<'reposition' | 'close'>;
351
+ /**
352
+ * Define the cooldown duration in milliseconds.
353
+ * When moving from one tooltip to another within this duration,
354
+ * the showDelay is skipped for the new tooltip.
355
+ * @default 300
356
+ */
357
+ readonly cooldown?: Signal<number>;
358
+ /**
359
+ * Whether hovering tooltip content keeps the tooltip open.
360
+ * @default false
361
+ */
362
+ readonly hoverableContent?: Signal<boolean>;
363
+ }
364
+ declare const NgpTooltipTriggerStateToken: _angular_core.InjectionToken<WritableSignal<{
365
+ tooltip: WritableSignal<string | NgpOverlayContent<unknown> | null>;
366
+ disabled: Signal<boolean>;
367
+ placement: Signal<NgpTooltipPlacement>;
368
+ offset: Signal<NgpOffset>;
369
+ showDelay: Signal<number>;
370
+ hideDelay: Signal<number>;
371
+ flip: Signal<NgpFlip>;
372
+ shift: Signal<NgpShift>;
373
+ container: Signal<string | HTMLElement | null>;
374
+ showOnOverflow: Signal<boolean>;
375
+ anchor: Signal<HTMLElement | null>;
376
+ context: Signal<unknown>;
377
+ useTextContent: Signal<boolean>;
378
+ trackPosition: Signal<boolean>;
379
+ position: Signal<NgpPosition | null>;
380
+ scrollBehavior: Signal<"reposition" | "close">;
381
+ cooldown: Signal<number>;
382
+ hoverableContent: Signal<boolean>;
383
+ overlay: WritableSignal<NgpOverlay<unknown> | null>;
384
+ tooltipId: WritableSignal<string | undefined>;
385
+ open: Signal<boolean>;
386
+ hasOverflow: Signal<boolean>;
387
+ contentHovered: WritableSignal<boolean>;
388
+ hoverBridgePolygon: WritableSignal<TooltipHoverBridgePoint[] | null>;
389
+ show: () => void;
390
+ hide: () => void;
391
+ setTooltipId: (id: string) => void;
392
+ onTooltipHoverStart: () => void;
393
+ onTooltipHoverEnd: () => void;
394
+ destroy: () => void;
395
+ }>>;
396
+ declare const ngpTooltipTrigger: <T>({ tooltip: _tooltip, disabled, placement, offset, showDelay, hideDelay, flip, shift, container, showOnOverflow, anchor, context, useTextContent, trackPosition, position, scrollBehavior, cooldown, hoverableContent, }: NgpTooltipTriggerProps<T>) => {
397
+ tooltip: WritableSignal<string | NgpOverlayContent<T> | null>;
398
+ disabled: Signal<boolean>;
399
+ placement: Signal<NgpTooltipPlacement>;
400
+ offset: Signal<NgpOffset>;
401
+ showDelay: Signal<number>;
402
+ hideDelay: Signal<number>;
403
+ flip: Signal<NgpFlip>;
404
+ shift: Signal<NgpShift>;
405
+ container: Signal<string | HTMLElement | null>;
406
+ showOnOverflow: Signal<boolean>;
407
+ anchor: Signal<HTMLElement | null>;
408
+ context: Signal<T | undefined>;
409
+ useTextContent: Signal<boolean>;
410
+ trackPosition: Signal<boolean>;
411
+ position: Signal<NgpPosition | null>;
412
+ scrollBehavior: Signal<"reposition" | "close">;
413
+ cooldown: Signal<number>;
414
+ hoverableContent: Signal<boolean>;
415
+ overlay: WritableSignal<NgpOverlay<string | T> | null>;
416
+ tooltipId: WritableSignal<string | undefined>;
417
+ open: Signal<boolean>;
418
+ hasOverflow: Signal<boolean>;
419
+ contentHovered: WritableSignal<boolean>;
420
+ hoverBridgePolygon: WritableSignal<TooltipHoverBridgePoint[] | null>;
421
+ show: () => void;
422
+ hide: () => void;
423
+ setTooltipId: (id: string) => void;
424
+ onTooltipHoverStart: () => void;
425
+ onTooltipHoverEnd: () => void;
426
+ destroy: () => void;
427
+ };
428
+ declare const provideTooltipTriggerState: (opts?: {
429
+ inherit?: boolean;
430
+ }) => _angular_core.FactoryProvider;
431
+ declare function injectTooltipTriggerState<T>(options?: StateInjectionOptions): Signal<NgpTooltipTriggerState<T>>;
432
+ type NgpTooltipPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
433
+
434
+ type TooltipInput<T> = NgpOverlayContent<T> | string | null | undefined;
435
+ /**
436
+ * Apply the `ngpTooltipTrigger` directive to an element that triggers the tooltip to show.
437
+ */
438
+ declare class NgpTooltipTrigger<T = null> implements OnDestroy {
439
+ /**
440
+ * Access the global tooltip configuration.
441
+ */
442
+ private readonly config;
443
+ /**
444
+ * Access the tooltip template ref.
445
+ */
446
+ readonly tooltip: _angular_core.InputSignalWithTransform<string | NgpOverlayContent<T> | null, TooltipInput<T>>;
447
+ /**
448
+ * Define if the trigger should be disabled. This will prevent the tooltip from being shown or hidden from interactions.
449
+ * @default false
450
+ */
451
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
452
+ /**
453
+ * Define the placement of the tooltip relative to the trigger.
454
+ * @default 'top'
455
+ */
456
+ readonly placement: _angular_core.InputSignal<NgpTooltipPlacement>;
457
+ /**
458
+ * Define the offset of the tooltip relative to the trigger.
459
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
460
+ * @default 0
461
+ */
462
+ readonly offset: _angular_core.InputSignalWithTransform<NgpOffset, NgpOffsetInput>;
463
+ /**
464
+ * Define the delay before the tooltip is displayed.
465
+ * @default 500
466
+ */
467
+ readonly showDelay: _angular_core.InputSignalWithTransform<number, NumberInput>;
468
+ /**
469
+ * Define the delay before the tooltip is hidden.
470
+ * @default 0
471
+ */
472
+ readonly hideDelay: _angular_core.InputSignalWithTransform<number, NumberInput>;
473
+ /**
474
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
475
+ * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.
476
+ * @default true
477
+ */
478
+ readonly flip: _angular_core.InputSignalWithTransform<NgpFlip, NgpFlipInput>;
479
+ /**
480
+ * Configure shift behavior to keep the tooltip in view.
481
+ * Can be a boolean to enable/disable, or an object with padding and limiter options.
482
+ * @default undefined (enabled by default in overlay)
483
+ */
484
+ readonly shift: _angular_core.InputSignalWithTransform<NgpShift, NgpShiftInput>;
485
+ /**
486
+ * Define the container in which the tooltip should be attached.
487
+ * @default document.body
488
+ */
489
+ readonly container: _angular_core.InputSignal<string | HTMLElement | null>;
490
+ /**
491
+ * Define whether the tooltip should only show when the trigger element overflows.
492
+ * @default false
493
+ */
494
+ readonly showOnOverflow: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
495
+ /**
496
+ * Define an anchor element for positioning the tooltip.
497
+ * If provided, the tooltip will be positioned relative to this element instead of the trigger.
498
+ */
499
+ readonly anchor: _angular_core.InputSignal<HTMLElement | null>;
500
+ /**
501
+ * Provide context to the tooltip. This can be used to pass data to the tooltip content.
502
+ */
503
+ readonly context: _angular_core.InputSignal<T | undefined>;
504
+ /**
505
+ * Define whether to use the text content of the trigger element as the tooltip content.
506
+ * When enabled, the tooltip will display the text content of the trigger element.
507
+ * @default true
508
+ */
509
+ readonly useTextContent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
510
+ /**
511
+ * Define whether to track the trigger element position on every animation frame.
512
+ * Useful for moving elements like slider thumbs.
513
+ * @default false
514
+ */
515
+ readonly trackPosition: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
516
+ /**
517
+ * Programmatic position for the tooltip. When provided, the tooltip
518
+ * will be positioned at these coordinates instead of the trigger element.
519
+ * Use with trackPosition="true" for smooth cursor following.
520
+ */
521
+ readonly position: _angular_core.InputSignal<NgpPosition | null>;
522
+ /**
523
+ * Defines how the tooltip behaves when the window is scrolled.
524
+ * @default 'reposition'
525
+ */
526
+ readonly scrollBehavior: _angular_core.InputSignal<"reposition" | "close">;
527
+ /**
528
+ * Define the cooldown duration in milliseconds.
529
+ * When moving from one tooltip to another within this duration,
530
+ * the showDelay is skipped for the new tooltip.
531
+ * @default 300
532
+ */
533
+ readonly cooldown: _angular_core.InputSignalWithTransform<number, NumberInput>;
534
+ /**
535
+ * Whether hovering tooltip content keeps the tooltip open.
536
+ * @default false
537
+ */
538
+ readonly hoverableContent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
539
+ protected readonly state: {
540
+ tooltip: _angular_core.WritableSignal<string | NgpOverlayContent<T> | null>;
541
+ disabled: _angular_core.Signal<boolean>;
542
+ placement: _angular_core.Signal<NgpTooltipPlacement>;
543
+ offset: _angular_core.Signal<NgpOffset>;
544
+ showDelay: _angular_core.Signal<number>;
545
+ hideDelay: _angular_core.Signal<number>;
546
+ flip: _angular_core.Signal<NgpFlip>;
547
+ shift: _angular_core.Signal<NgpShift>;
548
+ container: _angular_core.Signal<string | HTMLElement | null>;
549
+ showOnOverflow: _angular_core.Signal<boolean>;
550
+ anchor: _angular_core.Signal<HTMLElement | null>;
551
+ context: _angular_core.Signal<T | undefined>;
552
+ useTextContent: _angular_core.Signal<boolean>;
553
+ trackPosition: _angular_core.Signal<boolean>;
554
+ position: _angular_core.Signal<NgpPosition | null>;
555
+ scrollBehavior: _angular_core.Signal<"reposition" | "close">;
556
+ cooldown: _angular_core.Signal<number>;
557
+ hoverableContent: _angular_core.Signal<boolean>;
558
+ overlay: _angular_core.WritableSignal<ng_primitives_portal.NgpOverlay<string | T> | null>;
559
+ tooltipId: _angular_core.WritableSignal<string | undefined>;
560
+ open: _angular_core.Signal<boolean>;
561
+ hasOverflow: _angular_core.Signal<boolean>;
562
+ contentHovered: _angular_core.WritableSignal<boolean>;
563
+ hoverBridgePolygon: _angular_core.WritableSignal<TooltipHoverBridgePoint[] | null>;
564
+ show: () => void;
565
+ hide: () => void;
566
+ setTooltipId: (id: string) => void;
567
+ onTooltipHoverStart: () => void;
568
+ onTooltipHoverEnd: () => void;
569
+ destroy: () => void;
570
+ };
571
+ ngOnDestroy(): void;
572
+ /**
573
+ * Show the tooltip programmatically (skips cooldown so multiple tooltips can coexist).
574
+ */
575
+ show(): void;
576
+ /**
577
+ * Hide the tooltip.
578
+ */
579
+ hide(): void;
580
+ /**
581
+ * Called by tooltip content when pointer enters the tooltip.
582
+ * @internal
583
+ */
584
+ onTooltipHoverStart(): void;
585
+ /**
586
+ * Called by tooltip content when pointer leaves the tooltip.
587
+ * @internal
588
+ */
589
+ onTooltipHoverEnd(): void;
590
+ /**
591
+ * Set the tooltip id.
592
+ */
593
+ setTooltipId(id: string): void;
594
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpTooltipTrigger<any>, never>;
595
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpTooltipTrigger<any>, "[ngpTooltipTrigger]", ["ngpTooltipTrigger"], { "tooltip": { "alias": "ngpTooltipTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpTooltipTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpTooltipTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpTooltipTriggerOffset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpTooltipTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpTooltipTriggerHideDelay"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpTooltipTriggerFlip"; "required": false; "isSignal": true; }; "shift": { "alias": "ngpTooltipTriggerShift"; "required": false; "isSignal": true; }; "container": { "alias": "ngpTooltipTriggerContainer"; "required": false; "isSignal": true; }; "showOnOverflow": { "alias": "ngpTooltipTriggerShowOnOverflow"; "required": false; "isSignal": true; }; "anchor": { "alias": "ngpTooltipTriggerAnchor"; "required": false; "isSignal": true; }; "context": { "alias": "ngpTooltipTriggerContext"; "required": false; "isSignal": true; }; "useTextContent": { "alias": "ngpTooltipTriggerUseTextContent"; "required": false; "isSignal": true; }; "trackPosition": { "alias": "ngpTooltipTriggerTrackPosition"; "required": false; "isSignal": true; }; "position": { "alias": "ngpTooltipTriggerPosition"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpTooltipTriggerScrollBehavior"; "required": false; "isSignal": true; }; "cooldown": { "alias": "ngpTooltipTriggerCooldown"; "required": false; "isSignal": true; }; "hoverableContent": { "alias": "ngpTooltipTriggerHoverableContent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
596
+ }
597
+
598
+ /**
599
+ * Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
600
+ */
601
+ declare class NgpTooltip {
602
+ /**
603
+ * The unique id of the tooltip.
604
+ */
605
+ readonly id: _angular_core.InputSignal<string>;
606
+ protected readonly state: {
607
+ elementRef: _angular_core.ElementRef<HTMLElement>;
608
+ id: _angular_core.WritableSignal<string>;
609
+ };
610
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpTooltip, never>;
611
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
612
+ }
613
+
614
+ interface NgpTooltipState {
615
+ /** Access the element's reference. */
616
+ readonly elementRef: ElementRef;
617
+ /** The unique id of the tooltip. */
618
+ readonly id: Signal<string>;
619
+ }
620
+ interface NgpTooltipProps {
621
+ /** The unique id of the tooltip. */
622
+ readonly id?: Signal<string>;
623
+ }
624
+ declare const NgpTooltipStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{
625
+ elementRef: ElementRef<HTMLElement>;
626
+ id: _angular_core.WritableSignal<string>;
627
+ }>>;
628
+ declare const ngpTooltip: ({ id: _id }: NgpTooltipProps) => {
629
+ elementRef: ElementRef<HTMLElement>;
630
+ id: _angular_core.WritableSignal<string>;
631
+ };
632
+ declare const injectTooltipState: {
633
+ (): Signal<{
634
+ elementRef: ElementRef<HTMLElement>;
635
+ id: _angular_core.WritableSignal<string>;
636
+ }>;
637
+ (options: ng_primitives_state.StateInjectionOptions): Signal<{
638
+ elementRef: ElementRef<HTMLElement>;
639
+ id: _angular_core.WritableSignal<string>;
640
+ } | null>;
641
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<{
642
+ elementRef: ElementRef<HTMLElement>;
643
+ id: _angular_core.WritableSignal<string>;
644
+ }> | Signal<{
645
+ elementRef: ElementRef<HTMLElement>;
646
+ id: _angular_core.WritableSignal<string>;
647
+ } | null>;
648
+ };
649
+ declare const provideTooltipState: (opts?: {
650
+ inherit?: boolean;
651
+ }) => _angular_core.FactoryProvider;
652
+
653
+ interface NgpTooltipTextContentState {
654
+ /** Access the component's context. */
655
+ readonly elementRef: ElementRef;
656
+ /** The string content to display. */
657
+ readonly content: Signal<unknown>;
658
+ }
659
+ interface NgpTooltipTextContentProps {
660
+ }
661
+ declare const NgpTooltipTextContentStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{
662
+ elementRef: ElementRef<HTMLElement>;
663
+ content: Signal<unknown>;
664
+ }>>;
665
+ declare const ngpTooltipTextContent: ({}: NgpTooltipTextContentProps) => {
666
+ elementRef: ElementRef<HTMLElement>;
667
+ content: Signal<unknown>;
668
+ };
669
+ declare const injectTooltipTextContentState: {
670
+ (): Signal<{
671
+ elementRef: ElementRef<HTMLElement>;
672
+ content: Signal<unknown>;
673
+ }>;
674
+ (options: ng_primitives_state.StateInjectionOptions): Signal<{
675
+ elementRef: ElementRef<HTMLElement>;
676
+ content: Signal<unknown>;
677
+ } | null>;
678
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<{
679
+ elementRef: ElementRef<HTMLElement>;
680
+ content: Signal<unknown>;
681
+ }> | Signal<{
682
+ elementRef: ElementRef<HTMLElement>;
683
+ content: Signal<unknown>;
684
+ } | null>;
685
+ };
686
+ declare const provideTooltipTextContentState: (opts?: {
687
+ inherit?: boolean;
688
+ }) => _angular_core.FactoryProvider;
689
+
690
+ export { NgpTooltip, NgpTooltipArrow, NgpTooltipArrowStateToken, NgpTooltipStateToken, NgpTooltipTextContentStateToken, NgpTooltipTrigger, NgpTooltipTriggerStateToken, injectTooltipArrowState, injectTooltipState, injectTooltipTextContentState, injectTooltipTriggerState, ngpTooltip, ngpTooltipArrow, ngpTooltipTextContent, ngpTooltipTrigger, provideTooltipArrowState, provideTooltipConfig, provideTooltipState, provideTooltipTextContentState, provideTooltipTriggerState };
691
+ export type { NgpTooltipConfig, NgpTooltipPlacement, NgpTooltipProps, NgpTooltipState, NgpTooltipTextContentProps, NgpTooltipTextContentState, NgpTooltipTriggerProps, NgpTooltipTriggerState };