@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.
- package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +123 -0
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +845 -744
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +363 -0
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +172 -0
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +6 -6
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-select.mjs +791 -509
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +39 -18
- package/portal/README.md +2 -0
- package/preview-card/README.md +3 -0
- package/schematics/collection.json +1 -0
- package/schematics/ng-add/index.d.ts +3 -2
- package/schematics/ng-add/index.js +62 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/package-config.d.ts +4 -2
- package/schematics/ng-add/package-config.js +10 -2
- package/schematics/ng-add/package-config.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +14 -0
- package/select/README.md +2 -0
- package/types/radix-ng-primitives-accordion.d.ts +51 -16
- package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
- package/types/radix-ng-primitives-arrow.d.ts +1 -1
- package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
- package/types/radix-ng-primitives-avatar.d.ts +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/types/radix-ng-primitives-calendar.d.ts +39 -20
- package/types/radix-ng-primitives-checkbox.d.ts +204 -35
- package/types/radix-ng-primitives-collapsible.d.ts +114 -40
- package/types/radix-ng-primitives-collection.d.ts +38 -34
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +61 -116
- package/types/radix-ng-primitives-core.d.ts +345 -235
- package/types/radix-ng-primitives-cropper.d.ts +89 -56
- package/types/radix-ng-primitives-date-field.d.ts +49 -28
- package/types/radix-ng-primitives-dialog.d.ts +283 -165
- package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +426 -0
- package/types/radix-ng-primitives-editable.d.ts +91 -14
- package/types/radix-ng-primitives-field.d.ts +374 -0
- package/types/radix-ng-primitives-fieldset.d.ts +49 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/types/radix-ng-primitives-label.d.ts +0 -1
- package/types/radix-ng-primitives-menu.d.ts +584 -99
- package/types/radix-ng-primitives-menubar.d.ts +61 -50
- package/types/radix-ng-primitives-meter.d.ts +194 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
- package/types/radix-ng-primitives-number-field.d.ts +405 -145
- package/types/radix-ng-primitives-pagination.d.ts +2 -2
- package/types/radix-ng-primitives-popover.d.ts +366 -351
- package/types/radix-ng-primitives-popper.d.ts +68 -11
- package/types/radix-ng-primitives-portal.d.ts +14 -6
- package/types/radix-ng-primitives-presence.d.ts +28 -76
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +175 -48
- package/types/radix-ng-primitives-radio.d.ts +55 -25
- package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
- package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
- package/types/radix-ng-primitives-select.d.ts +475 -177
- package/types/radix-ng-primitives-separator.d.ts +7 -32
- package/types/radix-ng-primitives-slider.d.ts +315 -201
- package/types/radix-ng-primitives-stepper.d.ts +5 -7
- package/types/radix-ng-primitives-switch.d.ts +86 -71
- package/types/radix-ng-primitives-tabs.d.ts +213 -79
- package/types/radix-ng-primitives-time-field.d.ts +42 -27
- package/types/radix-ng-primitives-toast.d.ts +378 -0
- package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
- package/types/radix-ng-primitives-toggle.d.ts +43 -53
- package/types/radix-ng-primitives-toolbar.d.ts +164 -38
- package/types/radix-ng-primitives-tooltip.d.ts +348 -384
- package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
- package/dropdown-menu/README.md +0 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
- package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/select2/README.md +0 -3
- package/tooltip2/README.md +0 -3
- package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
- package/types/radix-ng-primitives-hover-card.d.ts +0 -471
- package/types/radix-ng-primitives-select2.d.ts +0 -511
- package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Signal, WritableSignal, InjectionToken, InputSignal, ModelSignal } from '@angular/core';
|
|
3
3
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
-
import { TimeValue, HourCycle, Granularity, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
|
|
4
|
+
import { TimeValue, HourCycle, Granularity, Direction, BooleanInput, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
|
|
5
5
|
import * as _internationalized_date from '@internationalized/date';
|
|
6
|
-
import { Direction } from '@angular/cdk/bidi';
|
|
7
|
-
import { BooleanInput } from '@angular/cdk/coercion';
|
|
8
6
|
|
|
9
|
-
declare class RdxTimeFieldRootDirective
|
|
10
|
-
private readonly elementRef;
|
|
7
|
+
declare class RdxTimeFieldRootDirective {
|
|
11
8
|
/**
|
|
12
9
|
* The controlled checked state of the calendar.
|
|
13
10
|
*/
|
|
@@ -47,47 +44,61 @@ declare class RdxTimeFieldRootDirective implements OnInit, AfterViewInit {
|
|
|
47
44
|
* The stepping interval for the time fields. Defaults to 1
|
|
48
45
|
*/
|
|
49
46
|
readonly step: _angular_core.InputSignal<DateStep | undefined>;
|
|
50
|
-
readonly step$:
|
|
47
|
+
readonly step$: Signal<DateStep>;
|
|
51
48
|
/**
|
|
49
|
+
* Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or
|
|
50
|
+
* `hourCycle` change so segments always render with the current settings.
|
|
52
51
|
* @ignore
|
|
53
52
|
*/
|
|
54
|
-
readonly
|
|
53
|
+
readonly formatter: Signal<Formatter>;
|
|
54
|
+
/**
|
|
55
|
+
* @ignore
|
|
56
|
+
*/
|
|
57
|
+
readonly defaultDate: Signal<TimeValue>;
|
|
55
58
|
/**
|
|
56
59
|
* 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
|
|
57
60
|
*/
|
|
58
61
|
readonly placeholder: _angular_core.ModelSignal<TimeValue | undefined>;
|
|
59
62
|
/**
|
|
63
|
+
* Segment input parts, collected from the projected content in DOM order. This
|
|
64
|
+
* stays in sync with `segmentContents()` (granularity / locale / value changes
|
|
65
|
+
* add or remove segments) instead of being captured once after view init.
|
|
60
66
|
* @ignore
|
|
61
67
|
*/
|
|
62
|
-
readonly
|
|
68
|
+
private readonly segmentInputs;
|
|
63
69
|
/**
|
|
70
|
+
* The focusable (non-literal) segment elements, in DOM order.
|
|
64
71
|
* @ignore
|
|
65
72
|
*/
|
|
66
|
-
readonly
|
|
73
|
+
readonly segmentElements: Signal<HTMLElement[]>;
|
|
67
74
|
/**
|
|
68
75
|
* @ignore
|
|
69
76
|
*/
|
|
70
|
-
|
|
77
|
+
readonly currentFocusedElement: _angular_core.WritableSignal<HTMLElement | null>;
|
|
71
78
|
/**
|
|
72
79
|
* @ignore
|
|
73
80
|
*/
|
|
74
|
-
readonly
|
|
81
|
+
readonly inferredGranularity: Signal<Granularity>;
|
|
82
|
+
readonly convertedMinValue: Signal<_internationalized_date.CalendarDateTime | _internationalized_date.ZonedDateTime | undefined>;
|
|
83
|
+
readonly convertedMaxValue: Signal<_internationalized_date.CalendarDateTime | _internationalized_date.ZonedDateTime | undefined>;
|
|
84
|
+
readonly convertedModelValue: _angular_core.WritableSignal<TimeValue | undefined>;
|
|
85
|
+
readonly convertedPlaceholder: _angular_core.WritableSignal<TimeValue>;
|
|
75
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.
|
|
76
91
|
* @ignore
|
|
77
92
|
*/
|
|
78
|
-
readonly
|
|
79
|
-
readonly convertedMinValue: _angular_core.Signal<_internationalized_date.CalendarDateTime | _internationalized_date.ZonedDateTime | undefined>;
|
|
80
|
-
readonly convertedMaxValue: _angular_core.Signal<_internationalized_date.CalendarDateTime | _internationalized_date.ZonedDateTime | undefined>;
|
|
81
|
-
readonly convertedModelValue: _angular_core.WritableSignal<TimeValue | undefined>;
|
|
82
|
-
readonly convertedPlaceholder: _angular_core.WritableSignal<TimeValue>;
|
|
93
|
+
readonly segmentValues: _angular_core.WritableSignal<SegmentValueObj>;
|
|
83
94
|
/**
|
|
84
95
|
* @ignore
|
|
85
96
|
*/
|
|
86
|
-
readonly isInvalid:
|
|
97
|
+
readonly isInvalid: Signal<boolean>;
|
|
87
98
|
/**
|
|
88
99
|
* @ignore
|
|
89
100
|
*/
|
|
90
|
-
readonly allSegmentContent:
|
|
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 RdxTimeFieldRootDirective 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:
|
|
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:
|
|
118
|
+
readonly currentSegmentIndex: Signal<number>;
|
|
108
119
|
/**
|
|
109
120
|
* @ignore
|
|
110
121
|
*/
|
|
111
|
-
readonly prevFocusableSegment:
|
|
122
|
+
readonly prevFocusableSegment: Signal<HTMLElement | null>;
|
|
112
123
|
/**
|
|
113
124
|
* @ignore
|
|
114
125
|
*/
|
|
115
|
-
readonly nextFocusableSegment:
|
|
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 RdxTimeFieldRootDirective implements OnInit, AfterViewInit {
|
|
|
129
138
|
*/
|
|
130
139
|
setFocusedElement(el: HTMLElement): void;
|
|
131
140
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxTimeFieldRootDirective, never>;
|
|
132
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTimeFieldRootDirective, "[rdxTimeFieldRoot]", ["rdxTimeFieldRoot"], { "value": { "alias": "value"; "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"; },
|
|
141
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTimeFieldRootDirective, "[rdxTimeFieldRoot]", ["rdxTimeFieldRoot"], { "value": { "alias": "value"; "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 RdxTimeFieldInputDirective {
|
|
136
145
|
private readonly el;
|
|
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
|
|
@@ -190,7 +205,7 @@ interface TimeFieldContextToken {
|
|
|
190
205
|
isInvalid: Signal<boolean>;
|
|
191
206
|
disabled: InputSignal<boolean>;
|
|
192
207
|
readonly: InputSignal<boolean>;
|
|
193
|
-
formatter: Formatter
|
|
208
|
+
formatter: Signal<Formatter>;
|
|
194
209
|
hourCycle: InputSignal<HourCycle>;
|
|
195
210
|
segmentValues: WritableSignal<SegmentValueObj>;
|
|
196
211
|
focusNext: () => void;
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Provider } from '@angular/core';
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/portal';
|
|
4
|
+
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
5
|
+
import { RdxTransitionStatus } from '@radix-ng/primitives/core';
|
|
6
|
+
import * as i1$1 from '@radix-ng/primitives/popper';
|
|
7
|
+
import { RdxPopperAnchorElement, Side, Align, RdxPopperContentWrapper } from '@radix-ng/primitives/popper';
|
|
8
|
+
import * as _radix_ng_primitives_toast from '@radix-ng/primitives/toast';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Moves the toast viewport to a different part of the DOM — the Angular counterpart of
|
|
12
|
+
* `<Toast.Portal>`. Defaults to `document.body`; pass `container` to target another element.
|
|
13
|
+
*/
|
|
14
|
+
declare class RdxToastPortal {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastPortal, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastPortal, "[rdxToastPortal]", ["rdxToastPortal"], {}, {}, never, never, true, [{ directive: typeof i1.RdxPortal; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Relative ordering hint for a toast. `high` toasts are announced assertively. */
|
|
20
|
+
type RdxToastPriority = 'low' | 'high';
|
|
21
|
+
/** Action-button options carried on a toast and read back by the consumer (e.g. an "Undo" button). */
|
|
22
|
+
interface RdxToastActionProps {
|
|
23
|
+
/** Visible button label. */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Invoked when the action button is clicked. */
|
|
26
|
+
onClick?: (event: MouseEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Anchoring options for a toast rendered through `rdxToastPositioner` instead of the stack. The
|
|
30
|
+
* `anchor` is any popper-compatible reference (element, `ElementRef`, or virtual element).
|
|
31
|
+
*/
|
|
32
|
+
interface RdxToastPositionerProps {
|
|
33
|
+
anchor: RdxPopperAnchorElement;
|
|
34
|
+
side?: Side;
|
|
35
|
+
sideOffset?: number;
|
|
36
|
+
align?: Align;
|
|
37
|
+
alignOffset?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A single toast in the {@link RdxToastManager} queue. `id` is stable for the toast's lifetime;
|
|
41
|
+
* `transitionStatus` reflects the enter/leave animation phase (mirrors Base UI's transition system).
|
|
42
|
+
*/
|
|
43
|
+
interface RdxToastObject<Data = unknown> {
|
|
44
|
+
/** Stable id; generated by the manager when omitted from {@link RdxToastAddOptions}. */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Short heading text. */
|
|
47
|
+
title?: string;
|
|
48
|
+
/** Supporting body text. */
|
|
49
|
+
description?: string;
|
|
50
|
+
/** Caller-defined category (e.g. `'success' | 'error'`) for styling/branching. */
|
|
51
|
+
type?: string;
|
|
52
|
+
/** Auto-dismiss delay in ms. `0` (or a negative value) disables auto-dismiss. */
|
|
53
|
+
timeout?: number;
|
|
54
|
+
/** Announcement priority. `high` → `role="alert"` (assertive); `low` → `role="status"`. */
|
|
55
|
+
priority?: RdxToastPriority;
|
|
56
|
+
/** Arbitrary caller payload, surfaced back to templates/handlers. */
|
|
57
|
+
data?: Data;
|
|
58
|
+
/** Enter/leave phase, set by the manager while a toast mounts or is being removed. */
|
|
59
|
+
transitionStatus?: RdxTransitionStatus;
|
|
60
|
+
/** Set while a `promise()` toast is awaiting its source promise. */
|
|
61
|
+
loading?: boolean;
|
|
62
|
+
/** Action-button options surfaced to the template. */
|
|
63
|
+
actionProps?: RdxToastActionProps;
|
|
64
|
+
/** Anchoring options; when present the toast is positioned with `rdxToastPositioner`. */
|
|
65
|
+
positionerProps?: RdxToastPositionerProps;
|
|
66
|
+
/** Bump on an upsert (same `id`) to replay the enter animation. */
|
|
67
|
+
updateKey?: number | string;
|
|
68
|
+
/** Invoked when the toast is dismissed (by timeout, swipe, or `close()`). */
|
|
69
|
+
onClose?: () => void;
|
|
70
|
+
/** Invoked after the leave animation completes and the toast leaves the queue. */
|
|
71
|
+
onRemove?: () => void;
|
|
72
|
+
}
|
|
73
|
+
/** Options accepted by {@link RdxToastManager.add} / {@link RdxToastManager.update}. */
|
|
74
|
+
interface RdxToastAddOptions<Data = unknown> {
|
|
75
|
+
id?: string;
|
|
76
|
+
title?: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
type?: string;
|
|
79
|
+
timeout?: number;
|
|
80
|
+
priority?: RdxToastPriority;
|
|
81
|
+
data?: Data;
|
|
82
|
+
/** Marks the toast as pending (used by `promise()`); pending toasts skip auto-dismiss. */
|
|
83
|
+
loading?: boolean;
|
|
84
|
+
actionProps?: RdxToastActionProps;
|
|
85
|
+
positionerProps?: RdxToastPositionerProps;
|
|
86
|
+
updateKey?: number | string;
|
|
87
|
+
onClose?: () => void;
|
|
88
|
+
onRemove?: () => void;
|
|
89
|
+
}
|
|
90
|
+
/** Per-state copy used by {@link RdxToastManager.promise}. */
|
|
91
|
+
interface RdxToastPromiseOptions<Value = unknown, Data = unknown> {
|
|
92
|
+
loading: RdxToastAddOptions<Data> | string;
|
|
93
|
+
success: RdxToastAddOptions<Data> | string | ((value: Value) => RdxToastAddOptions<Data> | string);
|
|
94
|
+
error: RdxToastAddOptions<Data> | string | ((error: unknown) => RdxToastAddOptions<Data> | string);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* App-level coordinator and imperative API for toasts — the Angular counterpart of Base UI's
|
|
99
|
+
* `<Toast.Provider>` plus `useToastManager()`. Holds the queue as a signal that `RdxToastViewport`
|
|
100
|
+
* renders, owns each toast's auto-dismiss timer (pausable while the viewport is hovered/focused),
|
|
101
|
+
* and exposes `add` / `update` / `close` / `promise`.
|
|
102
|
+
*
|
|
103
|
+
* Provide it once near the app root with {@link provideRdxToastManager} or the `[rdxToastProvider]`
|
|
104
|
+
* directive, then inject `RdxToastManager` anywhere to push toasts.
|
|
105
|
+
*/
|
|
106
|
+
declare class RdxToastManager {
|
|
107
|
+
private readonly idGenerator;
|
|
108
|
+
private readonly _toasts;
|
|
109
|
+
/** The live queue, oldest first. Render it in `RdxToastViewport` (e.g. via `@for`). */
|
|
110
|
+
readonly toasts: i0.Signal<RdxToastObject<unknown>[]>;
|
|
111
|
+
/** Whether any toast is currently in the queue. */
|
|
112
|
+
readonly hasToasts: i0.Signal<boolean>;
|
|
113
|
+
private readonly _expanded;
|
|
114
|
+
/** Whether the stack is expanded (viewport hovered or focused) — drives `data-expanded`. */
|
|
115
|
+
readonly expanded: i0.Signal<boolean>;
|
|
116
|
+
private readonly _heights;
|
|
117
|
+
/** Measured heights (px) per toast id, reported by each `RdxToastRoot` for expanded-stack offsets. */
|
|
118
|
+
readonly heights: i0.Signal<Record<string, number>>;
|
|
119
|
+
/**
|
|
120
|
+
* Per-toast stacking metrics, computed once for the whole queue (front = newest, index `0`):
|
|
121
|
+
* `index` is the distance from the front and `offsetY` is the combined height of the toasts
|
|
122
|
+
* stacked in front. Roots read this by id instead of each rescanning the queue (O(n) vs O(n²)).
|
|
123
|
+
*/
|
|
124
|
+
readonly layout: i0.Signal<Record<string, {
|
|
125
|
+
index: number;
|
|
126
|
+
offsetY: number;
|
|
127
|
+
}>>;
|
|
128
|
+
/** Max number of simultaneously visible toasts. Configurable via `[rdxToastProvider]`. */
|
|
129
|
+
limit: number;
|
|
130
|
+
/** Default auto-dismiss delay (ms) for toasts that omit `timeout`. Set via `[rdxToastProvider]`. */
|
|
131
|
+
defaultTimeout: number;
|
|
132
|
+
private readonly timers;
|
|
133
|
+
/** Nested-pause depth so overlapping holds (hover + swipe) resume only when all release. */
|
|
134
|
+
private pauseDepth;
|
|
135
|
+
/** Queue a new toast. Returns its id (generated when not supplied). */
|
|
136
|
+
add<Data = unknown>(options: RdxToastAddOptions<Data>): string;
|
|
137
|
+
/** Merge new options into an existing toast (no-op if the id is unknown). */
|
|
138
|
+
update<Data = unknown>(id: string, options: Partial<RdxToastAddOptions<Data>>): void;
|
|
139
|
+
/**
|
|
140
|
+
* Begin dismissing a toast: fire `onClose`, then remove it after the leave animation.
|
|
141
|
+
* Omit `id` to dismiss every toast at once (mirrors Base UI's `close()`).
|
|
142
|
+
*/
|
|
143
|
+
close(id?: string): void;
|
|
144
|
+
/**
|
|
145
|
+
* Remove a toast from the queue immediately. `RdxToastRoot` calls this once its leave animation
|
|
146
|
+
* has finished; call it directly only when there is no exit animation.
|
|
147
|
+
*/
|
|
148
|
+
remove(id: string): void;
|
|
149
|
+
/** Toggle the expanded (hover/focus) state of the stack. Called by the viewport. */
|
|
150
|
+
setExpanded(expanded: boolean): void;
|
|
151
|
+
/** Record a toast's measured height (px) for expanded-stack offset math. Called by each root. */
|
|
152
|
+
setHeight(id: string, height: number): void;
|
|
153
|
+
/** Pause every auto-dismiss timer (e.g. while the viewport is hovered, focused, or being swiped). */
|
|
154
|
+
pauseAll(): void;
|
|
155
|
+
/** Release one pause; auto-dismiss timers resume only once every hold has released. */
|
|
156
|
+
resumeAll(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Drive a toast through a promise's lifecycle: show `loading`, then swap to `success` or
|
|
159
|
+
* `error` copy when it settles. Returns the original promise for chaining.
|
|
160
|
+
*/
|
|
161
|
+
promise<Value, Data = unknown>(promise: Promise<Value>, options: RdxToastPromiseOptions<Value, Data>): Promise<Value>;
|
|
162
|
+
private scheduleTimeout;
|
|
163
|
+
private clearTimer;
|
|
164
|
+
private clearHeight;
|
|
165
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastManager, never>;
|
|
166
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RdxToastManager>;
|
|
167
|
+
}
|
|
168
|
+
/** Provide a {@link RdxToastManager} for an app (e.g. in `app.config.ts`). */
|
|
169
|
+
declare function provideRdxToastManager(): Provider[];
|
|
170
|
+
/**
|
|
171
|
+
* Hosts a {@link RdxToastManager} for its subtree. Put it on a wrapping element (or the app root)
|
|
172
|
+
* so descendant viewports and components share one queue. `limit` caps simultaneously visible toasts.
|
|
173
|
+
*/
|
|
174
|
+
declare class RdxToastProvider {
|
|
175
|
+
private readonly manager;
|
|
176
|
+
/** Max number of toasts shown at once. */
|
|
177
|
+
readonly limit: i0.InputSignal<number>;
|
|
178
|
+
/** Default auto-dismiss delay (ms) for toasts that omit their own `timeout`. `0` disables it. */
|
|
179
|
+
readonly timeout: i0.InputSignal<number>;
|
|
180
|
+
constructor();
|
|
181
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastProvider, never>;
|
|
182
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastProvider, "[rdxToastProvider]", ["rdxToastProvider"], { "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "timeout": { "alias": "timeout"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The positioned region that holds the visible toasts — the Angular counterpart of
|
|
187
|
+
* `<Toast.Viewport>`. Exposes the queue for templates to render, and while it is hovered or focused
|
|
188
|
+
* it expands the stack (`data-expanded` on each root) and pauses every auto-dismiss timer, resuming
|
|
189
|
+
* once neither hover nor focus remains — matching Base UI.
|
|
190
|
+
*
|
|
191
|
+
* Headless: it carries no positioning styles. Consumers position it (e.g. fixed bottom-right) and
|
|
192
|
+
* iterate `viewport.toasts()` with `@for`.
|
|
193
|
+
*/
|
|
194
|
+
declare class RdxToastViewport {
|
|
195
|
+
protected readonly manager: RdxToastManager;
|
|
196
|
+
/** The live toast queue to render. */
|
|
197
|
+
readonly toasts: i0.Signal<_radix_ng_primitives_toast.RdxToastObject<unknown>[]>;
|
|
198
|
+
protected readonly hovered: i0.WritableSignal<boolean>;
|
|
199
|
+
protected readonly focused: i0.WritableSignal<boolean>;
|
|
200
|
+
/** Tracks the last expanded state so pause/resume stay balanced across transitions. */
|
|
201
|
+
private wasExpanded;
|
|
202
|
+
constructor();
|
|
203
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
204
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastViewport, never>;
|
|
205
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastViewport, "[rdxToastViewport]", ["rdxToastViewport"], {}, {}, never, never, true, never>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Positions an anchored toast against an element — the Angular counterpart of `<Toast.Positioner>`.
|
|
210
|
+
* Composes the popper machinery so a toast can point at a trigger instead of living in the stack.
|
|
211
|
+
*
|
|
212
|
+
* Bind `anchor` (and optionally `side`/`align`/offsets) — typically from a toast's `positionerProps`.
|
|
213
|
+
* It hosts its own `RdxPopper` so it is self-contained (no surrounding `rdxPopperRoot` needed), and
|
|
214
|
+
* mirrors the popper measurements as friendlier CSS variables plus `data-side` / `data-align`.
|
|
215
|
+
*/
|
|
216
|
+
declare class RdxToastPositioner {
|
|
217
|
+
protected readonly wrapper: RdxPopperContentWrapper;
|
|
218
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastPositioner, never>;
|
|
219
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastPositioner, "[rdxToastPositioner]", ["rdxToastPositioner"], {}, {}, never, never, true, [{ directive: typeof i1$1.RdxPopper; inputs: {}; outputs: {}; }, { directive: typeof i1$1.RdxPopperContentWrapper; inputs: { "anchor": "anchor"; "side": "side"; "sideOffset": "sideOffset"; "align": "align"; "alignOffset": "alignOffset"; "arrowPadding": "arrowPadding"; "avoidCollisions": "avoidCollisions"; "collisionBoundary": "collisionBoundary"; "collisionPadding": "collisionPadding"; "sticky": "sticky"; "hideWhenDetached": "hideWhenDetached"; "positionStrategy": "positionStrategy"; "updatePositionStrategy": "updatePositionStrategy"; }; outputs: {}; }]>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Direction a swipe travels to dismiss a toast. */
|
|
223
|
+
type RdxToastSwipeDirection = 'up' | 'down' | 'left' | 'right';
|
|
224
|
+
interface RdxToastSwipeConfig {
|
|
225
|
+
/** The toast element the gesture lives on (CSS variables + data attributes are written here). */
|
|
226
|
+
element: () => HTMLElement;
|
|
227
|
+
/** Allowed dismiss directions; the gesture follows whichever the user drags toward most. */
|
|
228
|
+
directions: () => RdxToastSwipeDirection[];
|
|
229
|
+
/** Whether the gesture is armed (false while the toast is leaving). */
|
|
230
|
+
enabled: () => boolean;
|
|
231
|
+
/** Travel (px) past which a release dismisses. Defaults to {@link DEFAULT_THRESHOLD}. */
|
|
232
|
+
threshold?: number;
|
|
233
|
+
/** Called once per release that commits to dismissal. */
|
|
234
|
+
onDismiss: (event: PointerEvent) => void;
|
|
235
|
+
/** Called when a swipe actually begins (e.g. to pause auto-dismiss timers). */
|
|
236
|
+
onPress?: () => void;
|
|
237
|
+
/** Called when a started swipe ends, dismissing or not (balances {@link RdxToastSwipeConfig.onPress}). */
|
|
238
|
+
onRelease?: () => void;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Headless swipe-to-dismiss for a toast, built on the shared {@link usePointerDrag} lifecycle (which
|
|
242
|
+
* owns pointer capture, the start threshold, window listeners, and tap/cancel handling). This layer
|
|
243
|
+
* adds the toast-specific direction projection, rubber-banding, flick detection, and the styling
|
|
244
|
+
* contract — it applies no transform itself:
|
|
245
|
+
*
|
|
246
|
+
* - `--toast-swipe-movement-x` / `--toast-swipe-movement-y` — signed px offset along the active axis.
|
|
247
|
+
* - `[data-swiping]` — present while a gesture is active (drive `transition: none` off this).
|
|
248
|
+
* - `[data-swipe-direction]` — the active direction.
|
|
249
|
+
* - `[data-swipe-dismiss]` — present briefly when a release commits to dismissal.
|
|
250
|
+
*
|
|
251
|
+
* Mark inner interactive regions with `[data-toast-swipe-ignore]` to opt them out of the gesture.
|
|
252
|
+
* `RdxToastRoot` (the gesture host) sets `touch-action: none` so a touch-drag is not stolen by native
|
|
253
|
+
* scrolling — without it the gesture only works with a mouse, not on touch devices.
|
|
254
|
+
* Must be called from an injection context (a directive constructor).
|
|
255
|
+
*/
|
|
256
|
+
declare function useToastSwipe(config: RdxToastSwipeConfig): void;
|
|
257
|
+
|
|
258
|
+
interface RdxToastRootContext {
|
|
259
|
+
/** The toast model this part tree renders. */
|
|
260
|
+
readonly toast: () => RdxToastObject;
|
|
261
|
+
/** `id` of the title element, wired to `aria-labelledby` once a title registers. */
|
|
262
|
+
readonly titleId: string;
|
|
263
|
+
/** `id` of the description element, wired to `aria-describedby` once a description registers. */
|
|
264
|
+
readonly descriptionId: string;
|
|
265
|
+
/** Register/unregister the title part so the root only points `aria-labelledby` at a real element. */
|
|
266
|
+
readonly setTitlePresent: (present: boolean) => void;
|
|
267
|
+
/** Register/unregister the description part so `aria-describedby` only targets a real element. */
|
|
268
|
+
readonly setDescriptionPresent: (present: boolean) => void;
|
|
269
|
+
/** Begin dismissing this toast. */
|
|
270
|
+
readonly close: () => void;
|
|
271
|
+
}
|
|
272
|
+
declare const injectRdxToastRootContext: _radix_ng_primitives_core.InjectContext<RdxToastRootContext>;
|
|
273
|
+
declare const provideRdxToastRootContext: (useFactory: () => RdxToastRootContext) => i0.Provider;
|
|
274
|
+
/**
|
|
275
|
+
* A single toast — the Angular counterpart of `<Toast.Root>`. Bind the toast model from the
|
|
276
|
+
* viewport's `@for`; this directive owns the announcement `role`, the `data-state` enter/leave
|
|
277
|
+
* contract, swipe-to-dismiss, and the stacking variables consumers style against.
|
|
278
|
+
*
|
|
279
|
+
* Stacking / styling contract written to the host (no transform is applied for you):
|
|
280
|
+
* - `--toast-index` — position from the front (`0` = frontmost).
|
|
281
|
+
* - `--toast-height` — this toast's measured height (px).
|
|
282
|
+
* - `--toast-offset-y` — combined height (px) of the toasts stacked in front, for expanded layout.
|
|
283
|
+
* - `--toast-swipe-movement-x` / `--toast-swipe-movement-y` — live swipe offset (px).
|
|
284
|
+
* - `[data-front]` — present on the frontmost toast.
|
|
285
|
+
* - `[data-expanded]` — present while the viewport is hovered/focused.
|
|
286
|
+
* - `[data-state]` — `open` while visible, `closed` once dismissal begins.
|
|
287
|
+
* - `[data-swiping]` / `[data-swipe-direction]` / `[data-swipe-dismiss]` — gesture state.
|
|
288
|
+
*
|
|
289
|
+
* When the leave animation (driven by `data-state="closed"`) ends, the toast leaves the queue.
|
|
290
|
+
*/
|
|
291
|
+
declare class RdxToastRoot {
|
|
292
|
+
protected readonly manager: RdxToastManager;
|
|
293
|
+
private readonly elementRef;
|
|
294
|
+
private readonly injector;
|
|
295
|
+
/** The toast model to render — pass the item from the viewport's `@for`. */
|
|
296
|
+
readonly toast: i0.InputSignal<RdxToastObject<unknown>>;
|
|
297
|
+
/** Allowed swipe-to-dismiss directions. Accepts a single direction or a list. */
|
|
298
|
+
readonly swipeDirection: i0.InputSignal<RdxToastSwipeDirection | RdxToastSwipeDirection[]>;
|
|
299
|
+
readonly titleId: string;
|
|
300
|
+
readonly descriptionId: string;
|
|
301
|
+
/** Whether a title / description part has registered, gating the aria-* references. */
|
|
302
|
+
readonly titlePresent: i0.WritableSignal<boolean>;
|
|
303
|
+
readonly descriptionPresent: i0.WritableSignal<boolean>;
|
|
304
|
+
private readonly size;
|
|
305
|
+
/** This toast's measured height (px). */
|
|
306
|
+
readonly height: i0.Signal<number>;
|
|
307
|
+
/** Position from the front of the stack — `0` is the newest/frontmost toast. */
|
|
308
|
+
readonly index: i0.Signal<number>;
|
|
309
|
+
/** Combined height (px) of the toasts stacked in front of this one (for expanded layout). */
|
|
310
|
+
readonly offsetY: i0.Signal<number>;
|
|
311
|
+
/** `alert` (assertive) for high-priority toasts, otherwise `status`. */
|
|
312
|
+
readonly role: i0.Signal<"alert" | "status">;
|
|
313
|
+
/** `open` while visible, `closed` once dismissal begins — drives enter/leave animations. */
|
|
314
|
+
readonly dataState: i0.Signal<"closed" | "open">;
|
|
315
|
+
private readonly directions;
|
|
316
|
+
constructor();
|
|
317
|
+
close(): void;
|
|
318
|
+
protected onAnimationEnd(): void;
|
|
319
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastRoot, never>;
|
|
320
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastRoot, "[rdxToastRoot]", ["rdxToastRoot"], { "toast": { "alias": "toast"; "required": true; "isSignal": true; }; "swipeDirection": { "alias": "swipeDirection"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Wraps a toast's inner parts (title, description, actions) — the Angular counterpart of
|
|
325
|
+
* `<Toast.Content>`. Headless: it carries no styles; consumers apply `overflow: hidden` to clip
|
|
326
|
+
* taller toasts during the stack/expand animation. It mirrors the root's `data-state` so content
|
|
327
|
+
* can transition together with the root.
|
|
328
|
+
*/
|
|
329
|
+
declare class RdxToastContent {
|
|
330
|
+
protected readonly rootContext: _radix_ng_primitives_toast.RdxToastRootContext;
|
|
331
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastContent, never>;
|
|
332
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastContent, "[rdxToastContent]", ["rdxToastContent"], {}, {}, never, never, true, never>;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** Accessible title for a toast; registers so the root only points `aria-labelledby` at a real node. */
|
|
336
|
+
declare class RdxToastTitle {
|
|
337
|
+
protected readonly rootContext: _radix_ng_primitives_toast.RdxToastRootContext;
|
|
338
|
+
constructor();
|
|
339
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastTitle, never>;
|
|
340
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastTitle, "[rdxToastTitle]", ["rdxToastTitle"], {}, {}, never, never, true, never>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** Supporting body text for a toast; registers so `aria-describedby` only targets a real node. */
|
|
344
|
+
declare class RdxToastDescription {
|
|
345
|
+
protected readonly rootContext: _radix_ng_primitives_toast.RdxToastRootContext;
|
|
346
|
+
constructor();
|
|
347
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastDescription, never>;
|
|
348
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastDescription, "[rdxToastDescription]", ["rdxToastDescription"], {}, {}, never, never, true, never>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** Button that dismisses its toast. Put it on a native `<button>` for built-in semantics. */
|
|
352
|
+
declare class RdxToastClose {
|
|
353
|
+
protected readonly rootContext: _radix_ng_primitives_toast.RdxToastRootContext;
|
|
354
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastClose, never>;
|
|
355
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastClose, "[rdxToastClose]", ["rdxToastClose"], {}, {}, never, never, true, never>;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* An action button inside a toast (e.g. "Undo"). Unlike {@link RdxToastClose} it does not dismiss
|
|
360
|
+
* on its own — wire your handler with `(click)` and call `close()` from the exposed context when
|
|
361
|
+
* the action should also close the toast.
|
|
362
|
+
*/
|
|
363
|
+
declare class RdxToastAction {
|
|
364
|
+
/** The toast root context, so handlers can read the toast or dismiss it after acting. */
|
|
365
|
+
readonly rootContext: _radix_ng_primitives_toast.RdxToastRootContext;
|
|
366
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastAction, never>;
|
|
367
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToastAction, "[rdxToastAction]", ["rdxToastAction"], {}, {}, never, never, true, never>;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
declare const toastImports: (typeof RdxToastPortal)[];
|
|
371
|
+
declare class RdxToastModule {
|
|
372
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToastModule, never>;
|
|
373
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxToastModule, never, [typeof RdxToastProvider, typeof RdxToastPortal, typeof RdxToastViewport, typeof RdxToastPositioner, typeof RdxToastRoot, typeof RdxToastContent, typeof RdxToastTitle, typeof RdxToastDescription, typeof RdxToastClose, typeof RdxToastAction], [typeof RdxToastProvider, typeof RdxToastPortal, typeof RdxToastViewport, typeof RdxToastPositioner, typeof RdxToastRoot, typeof RdxToastContent, typeof RdxToastTitle, typeof RdxToastDescription, typeof RdxToastClose, typeof RdxToastAction]>;
|
|
374
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RdxToastModule>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export { RdxToastAction, RdxToastClose, RdxToastContent, RdxToastDescription, RdxToastManager, RdxToastModule, RdxToastPortal, RdxToastPositioner, RdxToastProvider, RdxToastRoot, RdxToastTitle, RdxToastViewport, injectRdxToastRootContext, provideRdxToastManager, provideRdxToastRootContext, toastImports, useToastSwipe };
|
|
378
|
+
export type { RdxToastActionProps, RdxToastAddOptions, RdxToastObject, RdxToastPositionerProps, RdxToastPriority, RdxToastPromiseOptions, RdxToastRootContext, RdxToastSwipeConfig, RdxToastSwipeDirection };
|