@cdevhub/ngx-tw 0.2.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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/fesm2022/cdevhub-ngx-tw-accordion.mjs +108 -0
  4. package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -0
  5. package/fesm2022/cdevhub-ngx-tw-alert.mjs +240 -0
  6. package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -0
  7. package/fesm2022/cdevhub-ngx-tw-avatar.mjs +287 -0
  8. package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -0
  9. package/fesm2022/cdevhub-ngx-tw-badge.mjs +332 -0
  10. package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -0
  11. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +452 -0
  12. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -0
  13. package/fesm2022/cdevhub-ngx-tw-button.mjs +227 -0
  14. package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -0
  15. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +417 -0
  16. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -0
  17. package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs +232 -0
  18. package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs.map +1 -0
  19. package/fesm2022/cdevhub-ngx-tw-calendar.mjs +4482 -0
  20. package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -0
  21. package/fesm2022/cdevhub-ngx-tw-card.mjs +157 -0
  22. package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -0
  23. package/fesm2022/cdevhub-ngx-tw-carousel.mjs +1454 -0
  24. package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -0
  25. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +593 -0
  26. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -0
  27. package/fesm2022/cdevhub-ngx-tw-code-block.mjs +228 -0
  28. package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -0
  29. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +510 -0
  30. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -0
  31. package/fesm2022/cdevhub-ngx-tw-combobox.mjs +1721 -0
  32. package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -0
  33. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +721 -0
  34. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -0
  35. package/fesm2022/cdevhub-ngx-tw-core.mjs +861 -0
  36. package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -0
  37. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +1558 -0
  38. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -0
  39. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +1833 -0
  40. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -0
  41. package/fesm2022/cdevhub-ngx-tw-dialog.mjs +693 -0
  42. package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -0
  43. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +331 -0
  44. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -0
  45. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +289 -0
  46. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -0
  47. package/fesm2022/cdevhub-ngx-tw-form-field.mjs +572 -0
  48. package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -0
  49. package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +36 -0
  50. package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -0
  51. package/fesm2022/cdevhub-ngx-tw-icon.mjs +278 -0
  52. package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -0
  53. package/fesm2022/cdevhub-ngx-tw-input.mjs +355 -0
  54. package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -0
  55. package/fesm2022/cdevhub-ngx-tw-item.mjs +241 -0
  56. package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -0
  57. package/fesm2022/cdevhub-ngx-tw-menu.mjs +433 -0
  58. package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -0
  59. package/fesm2022/cdevhub-ngx-tw-paginator.mjs +691 -0
  60. package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -0
  61. package/fesm2022/cdevhub-ngx-tw-popover.mjs +678 -0
  62. package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -0
  63. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +335 -0
  64. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -0
  65. package/fesm2022/cdevhub-ngx-tw-radio.mjs +708 -0
  66. package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -0
  67. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +319 -0
  68. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -0
  69. package/fesm2022/cdevhub-ngx-tw-select.mjs +1722 -0
  70. package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -0
  71. package/fesm2022/cdevhub-ngx-tw-separator.mjs +115 -0
  72. package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -0
  73. package/fesm2022/cdevhub-ngx-tw-sheet.mjs +768 -0
  74. package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -0
  75. package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +149 -0
  76. package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -0
  77. package/fesm2022/cdevhub-ngx-tw-slider.mjs +1147 -0
  78. package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -0
  79. package/fesm2022/cdevhub-ngx-tw-sort.mjs +346 -0
  80. package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -0
  81. package/fesm2022/cdevhub-ngx-tw-spinner.mjs +186 -0
  82. package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -0
  83. package/fesm2022/cdevhub-ngx-tw-split.mjs +1082 -0
  84. package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -0
  85. package/fesm2022/cdevhub-ngx-tw-stat.mjs +579 -0
  86. package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -0
  87. package/fesm2022/cdevhub-ngx-tw-stepper.mjs +443 -0
  88. package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -0
  89. package/fesm2022/cdevhub-ngx-tw-switch.mjs +391 -0
  90. package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -0
  91. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +315 -0
  92. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -0
  93. package/fesm2022/cdevhub-ngx-tw-table.mjs +994 -0
  94. package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -0
  95. package/fesm2022/cdevhub-ngx-tw-tabs.mjs +508 -0
  96. package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -0
  97. package/fesm2022/cdevhub-ngx-tw-textarea.mjs +147 -0
  98. package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -0
  99. package/fesm2022/cdevhub-ngx-tw-theme.mjs +178 -0
  100. package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -0
  101. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +1344 -0
  102. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -0
  103. package/fesm2022/cdevhub-ngx-tw-timeline.mjs +1136 -0
  104. package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -0
  105. package/fesm2022/cdevhub-ngx-tw-toast.mjs +1311 -0
  106. package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -0
  107. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +533 -0
  108. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -0
  109. package/fesm2022/cdevhub-ngx-tw.mjs +61 -0
  110. package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -0
  111. package/package.json +265 -0
  112. package/theme/_base.css +394 -0
  113. package/theme/_dark.css +510 -0
  114. package/theme/_high-contrast.css +290 -0
  115. package/theme/_semantic.css +317 -0
  116. package/theme/_typography.css +9 -0
  117. package/theme/index.css +54 -0
  118. package/types/cdevhub-ngx-tw-accordion.d.ts +48 -0
  119. package/types/cdevhub-ngx-tw-alert.d.ts +67 -0
  120. package/types/cdevhub-ngx-tw-avatar.d.ts +79 -0
  121. package/types/cdevhub-ngx-tw-badge.d.ts +94 -0
  122. package/types/cdevhub-ngx-tw-breadcrumbs.d.ts +227 -0
  123. package/types/cdevhub-ngx-tw-button.d.ts +74 -0
  124. package/types/cdevhub-ngx-tw-calendar-luxon.d.ts +200 -0
  125. package/types/cdevhub-ngx-tw-calendar-testing.d.ts +113 -0
  126. package/types/cdevhub-ngx-tw-calendar.d.ts +1704 -0
  127. package/types/cdevhub-ngx-tw-card.d.ts +48 -0
  128. package/types/cdevhub-ngx-tw-carousel.d.ts +406 -0
  129. package/types/cdevhub-ngx-tw-checkbox.d.ts +136 -0
  130. package/types/cdevhub-ngx-tw-code-block.d.ts +93 -0
  131. package/types/cdevhub-ngx-tw-collapsible.d.ts +151 -0
  132. package/types/cdevhub-ngx-tw-combobox.d.ts +389 -0
  133. package/types/cdevhub-ngx-tw-command-palette.d.ts +215 -0
  134. package/types/cdevhub-ngx-tw-core.d.ts +719 -0
  135. package/types/cdevhub-ngx-tw-date-picker.d.ts +317 -0
  136. package/types/cdevhub-ngx-tw-date-range-picker.d.ts +313 -0
  137. package/types/cdevhub-ngx-tw-dialog.d.ts +303 -0
  138. package/types/cdevhub-ngx-tw-empty-state.d.ts +104 -0
  139. package/types/cdevhub-ngx-tw-flip-card.d.ts +95 -0
  140. package/types/cdevhub-ngx-tw-form-field.d.ts +210 -0
  141. package/types/cdevhub-ngx-tw-icon-lucide.d.ts +29 -0
  142. package/types/cdevhub-ngx-tw-icon.d.ts +134 -0
  143. package/types/cdevhub-ngx-tw-input.d.ts +110 -0
  144. package/types/cdevhub-ngx-tw-item.d.ts +70 -0
  145. package/types/cdevhub-ngx-tw-menu.d.ts +99 -0
  146. package/types/cdevhub-ngx-tw-paginator.d.ts +305 -0
  147. package/types/cdevhub-ngx-tw-popover.d.ts +157 -0
  148. package/types/cdevhub-ngx-tw-progress-bar.d.ts +100 -0
  149. package/types/cdevhub-ngx-tw-radio.d.ts +174 -0
  150. package/types/cdevhub-ngx-tw-segmented-control.d.ts +66 -0
  151. package/types/cdevhub-ngx-tw-select.d.ts +384 -0
  152. package/types/cdevhub-ngx-tw-separator.d.ts +28 -0
  153. package/types/cdevhub-ngx-tw-sheet.d.ts +335 -0
  154. package/types/cdevhub-ngx-tw-skeleton.d.ts +52 -0
  155. package/types/cdevhub-ngx-tw-slider.d.ts +258 -0
  156. package/types/cdevhub-ngx-tw-sort.d.ts +136 -0
  157. package/types/cdevhub-ngx-tw-spinner.d.ts +50 -0
  158. package/types/cdevhub-ngx-tw-split.d.ts +265 -0
  159. package/types/cdevhub-ngx-tw-stat.d.ts +140 -0
  160. package/types/cdevhub-ngx-tw-stepper.d.ts +127 -0
  161. package/types/cdevhub-ngx-tw-switch.d.ts +88 -0
  162. package/types/cdevhub-ngx-tw-tab-nav.d.ts +107 -0
  163. package/types/cdevhub-ngx-tw-table.d.ts +479 -0
  164. package/types/cdevhub-ngx-tw-tabs.d.ts +121 -0
  165. package/types/cdevhub-ngx-tw-textarea.d.ts +62 -0
  166. package/types/cdevhub-ngx-tw-theme.d.ts +106 -0
  167. package/types/cdevhub-ngx-tw-time-picker.d.ts +303 -0
  168. package/types/cdevhub-ngx-tw-timeline.d.ts +278 -0
  169. package/types/cdevhub-ngx-tw-toast.d.ts +388 -0
  170. package/types/cdevhub-ngx-tw-tooltip.d.ts +95 -0
  171. package/types/cdevhub-ngx-tw.d.ts +49 -0
@@ -0,0 +1,388 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal, WritableSignal, InjectionToken, TemplateRef, Type, OnDestroy, EnvironmentProviders } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import { Portal } from '@angular/cdk/portal';
5
+
6
+ /** Patch accepted by {@link ToastRef.update}. Mirrors the subset of `ToastConfig` that is safe to mutate live. */
7
+ interface ToastUpdatePatch {
8
+ /** New severity — updates color, default icon, and (for `'error'`) live-region politeness. */
9
+ severity?: ToastSeverity;
10
+ /** New auto-dismiss duration in ms. Restarts the timer if the toast is visible. `0` disables auto-dismiss. */
11
+ duration?: number;
12
+ /** Replace or clear the action button. Pass `null` to remove. */
13
+ action?: ToastAction | null;
14
+ /** Override the icon slot. */
15
+ icon?: string | false | undefined;
16
+ /** Replace the `TW_TOAST_DATA` payload. */
17
+ data?: unknown;
18
+ /** Replace the aria-label applied to the toast wrapper. */
19
+ ariaLabel?: string;
20
+ /** Replace the toast's content (string, template, or component). */
21
+ content?: ToastContent;
22
+ /** Whether the close button is shown. */
23
+ dismissible?: boolean;
24
+ }
25
+ /**
26
+ * Reference to a toast opened via {@link ToastService}. Use to dismiss the
27
+ * toast, pause / resume its auto-dismiss timer, or observe its lifecycle.
28
+ *
29
+ * The service returns a ref synchronously from every open method; the toast
30
+ * itself is attached asynchronously inside the CDK overlay.
31
+ */
32
+ declare class ToastRef<C = unknown, R = unknown> {
33
+ private readonly dismissCallback;
34
+ /** Unique id. Generated if `config.id` was not provided. */
35
+ readonly id: string;
36
+ /** Instance of the component rendered inside the toast (only for component-class content). */
37
+ componentInstance: C | null;
38
+ /** Resolved static config for this toast (defaults merged, severity shorthand applied). */
39
+ readonly config: Readonly<ToastConfig<unknown, R>>;
40
+ /** Reactive lifecycle state. */
41
+ readonly state: Signal<ToastState>;
42
+ /** Reactive severity — may change after `update()` (used by the `promise()` helper). */
43
+ readonly severity: Signal<ToastSeverity>;
44
+ /** Reactive dismissibility. */
45
+ readonly dismissible: Signal<boolean>;
46
+ /** Reactive icon override. */
47
+ readonly icon: Signal<string | false | undefined>;
48
+ /** Reactive content (the source of truth for what gets rendered). */
49
+ readonly content: Signal<ToastContent>;
50
+ /** Reactive action button configuration. */
51
+ readonly action: Signal<ToastAction | undefined>;
52
+ /** Reactive accessible label. */
53
+ readonly ariaLabel: Signal<string | undefined>;
54
+ /** Reactive data payload — re-read by the container to update `TW_TOAST_DATA`. */
55
+ readonly data: Signal<unknown>;
56
+ /** @internal Reactive "transient" class applied by swipe gestures (e.g. `translate3d(...)`). */
57
+ readonly swipeTransform: WritableSignal<string | null>;
58
+ /** @internal Reactive opacity applied during swipe gestures. */
59
+ readonly swipeOpacity: WritableSignal<number | null>;
60
+ /** @internal Leave-animation class override. When non-null, container uses this instead of the position default. */
61
+ readonly leaveAnimationOverride: WritableSignal<string | null>;
62
+ /** @internal Portal for component-class content. Set by the service; null for string / template content. */
63
+ _portal: Portal<unknown> | null;
64
+ /** @internal True while the pointer hovers this toast. */
65
+ _hovered: boolean;
66
+ /** @internal True while focus is within this toast. */
67
+ _focused: boolean;
68
+ /** @internal Set by the service so the ref can reach the CDK-owned OverlayRef if it needs to. */
69
+ _overlayPanelElement: HTMLElement | null;
70
+ private readonly stateSignal;
71
+ private readonly severitySignal;
72
+ private readonly dismissibleSignal;
73
+ private readonly iconSignal;
74
+ private readonly contentSignal;
75
+ private readonly actionSignal;
76
+ private readonly ariaLabelSignal;
77
+ private readonly dataSignal;
78
+ private readonly afterOpenedSubject;
79
+ private readonly beforeDismissedSubject;
80
+ private readonly afterDismissedSubject;
81
+ private readonly updatedSubject;
82
+ private dismissReason;
83
+ private dismissResult;
84
+ private autoDismissTimer;
85
+ private autoDismissStartedAt;
86
+ private autoDismissRemaining;
87
+ private paused;
88
+ private enterTimer;
89
+ private leaveTimer;
90
+ constructor(id: string, content: ToastContent, config: ToastConfig<unknown, R>, dismissCallback: (ref: ToastRef) => void);
91
+ /**
92
+ * Dismiss the toast programmatically. The leave animation plays before the
93
+ * element is removed and subscribers are notified. Safe to call multiple times.
94
+ */
95
+ dismiss(result?: R): void;
96
+ /** Pause the auto-dismiss timer (if any). Called automatically on hover / focus when `pauseOnInteraction` is true. */
97
+ pause(): void;
98
+ /** Resume the auto-dismiss timer with the remaining time. */
99
+ resume(): void;
100
+ /**
101
+ * @internal Update the hover state. When `pauseOnInteraction` is set and
102
+ * either hover or focus is active, the auto-dismiss timer is paused.
103
+ */
104
+ _setHovered(hovered: boolean): void;
105
+ /** @internal Update the focus-within state. See `_setHovered`. */
106
+ _setFocused(focused: boolean): void;
107
+ private _syncInteractionPause;
108
+ /** Invoke the configured action handler (or dismiss with reason `'action'` if none is set). */
109
+ triggerAction(): void;
110
+ /** Mutate the live toast in place. Used by the `promise()` helper to swap loading → success / error. */
111
+ update(patch: ToastUpdatePatch): void;
112
+ /** Observable that emits once after the enter animation completes. */
113
+ afterOpened(): Observable<void>;
114
+ /** Observable that emits once when the dismiss sequence starts. */
115
+ beforeDismissed(): Observable<R | undefined>;
116
+ /** Observable that emits once after the leave animation completes and the ref is cleaned up. */
117
+ afterDismissed(): Observable<ToastDismissal<R>>;
118
+ /** @internal Observable of `update()` calls. The container subscribes to re-announce to `LiveAnnouncer`. */
119
+ _updates(): Observable<ToastUpdatePatch>;
120
+ /** @internal Called by the service when the max-visible cap is exceeded. */
121
+ _dismissAsMaxExceeded(): void;
122
+ /** @internal Start the dismiss sequence with the given reason. */
123
+ _dismissWith(reason: ToastDismissReason, result?: R): void;
124
+ /** @internal Finalise dismissal — clears timers, emits `afterDismissed`, and hands control back to the service. */
125
+ _finishDismiss(): void;
126
+ private _markVisible;
127
+ private _startAutoDismissTimer;
128
+ }
129
+
130
+ /** Severity variant — drives color palette, default icon, and live-region politeness. */
131
+ type ToastSeverity = 'info' | 'success' | 'warning' | 'error' | 'neutral';
132
+ /** Screen anchor for a stack of toasts. One CDK overlay is created per position on first use. */
133
+ type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
134
+ /** Lifecycle state of a single toast. */
135
+ type ToastState = 'entering' | 'visible' | 'paused' | 'dismissing' | 'dismissed';
136
+ /** Reason a toast was dismissed. */
137
+ type ToastDismissReason = 'action' | 'timeout' | 'swipe' | 'manual' | 'programmatic' | 'max-exceeded';
138
+ /** Payload forwarded to `afterDismissed()` subscribers. */
139
+ interface ToastDismissal<R = unknown> {
140
+ /** Why the toast closed. */
141
+ reason: ToastDismissReason;
142
+ /** Optional value forwarded from `ref.dismiss(result)`. */
143
+ result?: R;
144
+ }
145
+ /** Context object handed to `TemplateRef` content (`let-data let-ref="ref"`). */
146
+ interface ToastTemplateContext<T = unknown> {
147
+ /** Data value from `config.data`, unwrapped as the template's `$implicit`. */
148
+ $implicit: T;
149
+ /** Reference to the toast itself, bound as `let-ref="ref"`. */
150
+ ref: ToastRef<unknown, unknown>;
151
+ }
152
+ /** Action button configuration. When `handler` is omitted the button dismisses the toast with reason `'action'`. */
153
+ interface ToastAction {
154
+ /** Visible label of the action button. */
155
+ label: string;
156
+ /** Optional callback invoked when the action is clicked or `ref.triggerAction()` is called. */
157
+ handler?: (ref: ToastRef) => void;
158
+ }
159
+ /**
160
+ * Per-call configuration for {@link ToastService} methods. Also used as the
161
+ * payload of {@link TW_TOAST_DEFAULT_OPTIONS} for app-wide defaults.
162
+ */
163
+ declare class ToastConfig<D = unknown, R = unknown> {
164
+ /** Severity of the toast. Defaults to `'info'`. */
165
+ severity?: ToastSeverity;
166
+ /** Screen position of the toast stack. Defaults to `'bottom-right'`. */
167
+ position?: ToastPosition;
168
+ /** Auto-dismiss duration in ms. `0` disables auto-dismiss. Defaults to `5000`. */
169
+ duration?: number;
170
+ /** When true, renders a close (×) button. Defaults to `true`. */
171
+ dismissible?: boolean;
172
+ /**
173
+ * Live-region politeness. When omitted, resolves to `'assertive'` for
174
+ * `severity: 'error'` and `'polite'` otherwise. Pass `'off'` to skip
175
+ * `LiveAnnouncer` entirely.
176
+ */
177
+ politeness?: 'polite' | 'assertive' | 'off';
178
+ /** Action button configuration. Omit to hide the action button. */
179
+ action?: ToastAction;
180
+ /** Arbitrary data provided to component / template content via `TW_TOAST_DATA`. */
181
+ data?: D | null;
182
+ /** Extra CSS classes merged onto the toast panel root via `twMerge`. */
183
+ panelClass?: string | string[];
184
+ /**
185
+ * Icon override. Pass a string (treated as text glyph / icon name) or
186
+ * `false` to hide the icon. When omitted the severity-default icon is used.
187
+ *
188
+ * Note: To render arbitrary icon markup, pass a `TemplateRef` to `show()`
189
+ * itself (the whole toast is a custom template) — the icon slot accepts only
190
+ * primitives for the string-content path.
191
+ */
192
+ icon?: string | false;
193
+ /** When true, pause the auto-dismiss timer while the toast is hovered or holds focus. Defaults to `true`. */
194
+ pauseOnInteraction?: boolean;
195
+ /** Enable horizontal swipe-to-dismiss via pointer gestures. Defaults to `true`. */
196
+ swipeToDismiss?: boolean;
197
+ /**
198
+ * Maximum visible toasts *per position*. When exceeded, the oldest toast in
199
+ * that position dismisses with reason `'max-exceeded'`. Defaults to `5`.
200
+ */
201
+ maxVisible?: number;
202
+ /** Explicit id. When omitted a unique id is generated. */
203
+ id?: string;
204
+ /** Accessible label applied to the toast element. When omitted, text content is used. */
205
+ ariaLabel?: string;
206
+ /** Accessible label applied to the per-position `role="region"` container. Defaults to `'Notifications'`. */
207
+ regionAriaLabel?: string;
208
+ }
209
+ /** Injection token providing `config.data` to projected component / template content. */
210
+ declare const TW_TOAST_DATA: InjectionToken<unknown>;
211
+ /** Injection token providing the owning {@link ToastRef} to projected component content. */
212
+ declare const TW_TOAST_REF: InjectionToken<ToastRef<unknown, unknown>>;
213
+ /** Injection token carrying application-wide toast defaults. Set via `provideToast(defaults)`. */
214
+ declare const TW_TOAST_DEFAULT_OPTIONS: InjectionToken<Partial<ToastConfig<unknown, unknown>>>;
215
+ /** Accepted content forms for `ToastService.show()`. */
216
+ type ToastContent = string | TemplateRef<ToastTemplateContext> | Type<unknown>;
217
+
218
+ interface PromiseMessages<T> {
219
+ loading: string;
220
+ success: string | ((value: T) => string);
221
+ error: string | ((err: unknown) => string);
222
+ }
223
+ /**
224
+ * Opens Tailwind-styled toasts / snackbars inside CDK overlays. One overlay is
225
+ * created per `ToastPosition` on first use and reused for the lifetime of the
226
+ * service; toasts stack vertically inside their position container.
227
+ *
228
+ * Not `providedIn: 'root'` — register via {@link provideToast}.
229
+ */
230
+ declare class ToastService implements OnDestroy {
231
+ private readonly overlay;
232
+ private readonly injector;
233
+ private readonly defaultOptions;
234
+ private readonly parent;
235
+ private readonly positionOverlays;
236
+ private readonly activeRefsAtThisLevel;
237
+ private readonly afterOpenedSubject;
238
+ private readonly afterAllDismissedSubject;
239
+ /** Reactive list of every toast that has not yet fully dismissed. */
240
+ readonly activeToasts: Signal<readonly ToastRef[]>;
241
+ /** Emits every time a new toast is opened. */
242
+ readonly afterOpened: Observable<ToastRef>;
243
+ /** Emits when the active-toasts list transitions back to empty. Emits immediately on subscribe if none are open. */
244
+ readonly afterAllDismissed: Observable<void>;
245
+ /**
246
+ * Open a toast. Content may be a string (rendered inside the default
247
+ * `ToastComponent`), a `TemplateRef` (rendered via `TemplatePortal`), or a
248
+ * component class (rendered via `ComponentPortal` with `TW_TOAST_REF` +
249
+ * `TW_TOAST_DATA` injected).
250
+ */
251
+ show<R = void, D = unknown>(content: ToastContent, config?: ToastConfig<D, R>): ToastRef<unknown, R>;
252
+ /** Shorthand for `show(message, { severity: 'success', ... })`. */
253
+ success<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R>;
254
+ /** Shorthand for `show(message, { severity: 'error', politeness: 'assertive', ... })`. */
255
+ error<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R>;
256
+ /** Shorthand for `show(message, { severity: 'warning', ... })`. */
257
+ warning<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R>;
258
+ /** Shorthand for `show(message, { severity: 'info', ... })`. */
259
+ info<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R>;
260
+ /**
261
+ * Show a loading toast, then swap it to success / error when the promise
262
+ * settles. The same ref is returned and re-used across all three states.
263
+ * The loading toast is pinned (duration forced to 0, dismissible forced to
264
+ * false) until the promise resolves.
265
+ */
266
+ promise<T, R = void>(promise: Promise<T>, messages: PromiseMessages<T>, config?: ToastConfig<unknown, R>): ToastRef<unknown, R>;
267
+ /** Dismiss a toast by id. No-op if no matching toast is active. */
268
+ dismiss(id: string): void;
269
+ /** Dismiss every active toast across every position. */
270
+ dismissAll(): void;
271
+ /** Look up an active toast by id. */
272
+ getToastById<R = unknown>(id: string): ToastRef<unknown, R> | undefined;
273
+ ngOnDestroy(): void;
274
+ private openWithSeverity;
275
+ private openInternal;
276
+ private enforceMaxVisible;
277
+ private registerOpen;
278
+ private handleDismissed;
279
+ private attachToContainer;
280
+ private announceOpen;
281
+ private announceUpdate;
282
+ private getContainerForPosition;
283
+ private buildPositionStrategy;
284
+ private resolveConfig;
285
+ private getAfterAllDismissedSource;
286
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastService, never>;
287
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ToastService>;
288
+ }
289
+ /**
290
+ * Registers {@link ToastService} for dependency injection and installs optional
291
+ * application-wide defaults.
292
+ *
293
+ * @example
294
+ * ```ts
295
+ * bootstrapApplication(AppComponent, {
296
+ * providers: [provideToast({ position: 'top-right', duration: 4000 })]
297
+ * });
298
+ * ```
299
+ */
300
+ declare function provideToast(defaultOptions?: Partial<ToastConfig>): EnvironmentProviders;
301
+
302
+ /** Slot directive for the icon. When projected, overrides the severity-default icon. */
303
+ declare class ToastIconDirective {
304
+ private readonly toast;
305
+ /** @internal */
306
+ readonly classes: _angular_core.Signal<string>;
307
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastIconDirective, never>;
308
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToastIconDirective, "[twToastIcon]", never, {}, {}, never, never, true, never>;
309
+ }
310
+ /** Slot directive for the bold title line inside a toast. */
311
+ declare class ToastTitleDirective {
312
+ private readonly toast;
313
+ /** @internal */
314
+ readonly classes: _angular_core.Signal<string>;
315
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastTitleDirective, never>;
316
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToastTitleDirective, "[twToastTitle]", never, {}, {}, never, never, true, never>;
317
+ }
318
+ /** Slot directive for a secondary description line inside a toast. */
319
+ declare class ToastDescriptionDirective {
320
+ private readonly toast;
321
+ /** @internal */
322
+ readonly classes: _angular_core.Signal<string>;
323
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastDescriptionDirective, never>;
324
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToastDescriptionDirective, "[twToastDescription]", never, {}, {}, never, never, true, never>;
325
+ }
326
+ /** Slot directive for the action button. Apply to a native `<button>` to inherit the severity-aware styling. */
327
+ declare class ToastActionDirective {
328
+ private readonly toast;
329
+ /** @internal */
330
+ readonly classes: _angular_core.Signal<string>;
331
+ /** @internal */
332
+ protected onClick(): void;
333
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastActionDirective, never>;
334
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ToastActionDirective, "[twToastAction]", never, {}, {}, never, never, true, never>;
335
+ }
336
+ /**
337
+ * Visual toast / snackbar panel. Rendered internally by {@link ToastService} for
338
+ * string content, and exported for consumers who want to compose the same
339
+ * visual inside a custom `TemplateRef` or component class passed to `show()`.
340
+ */
341
+ declare class ToastComponent {
342
+ /** Severity variant. Drives color palette, default icon, and ARIA role / live politeness. Defaults to `'info'`. */
343
+ readonly severity: _angular_core.InputSignal<ToastSeverity>;
344
+ /** Whether to render the close button. Defaults to `true`. */
345
+ readonly dismissible: _angular_core.InputSignal<boolean>;
346
+ /**
347
+ * Icon override. Pass a string to render as text inside the icon slot, or
348
+ * `false` to hide the built-in severity icon. Ignored when a `[twToastIcon]`
349
+ * child is projected. When omitted, the severity-default icon renders.
350
+ *
351
+ * For arbitrary icon markup, project a `[twToastIcon]` child instead.
352
+ */
353
+ readonly icon: _angular_core.InputSignal<string | false | undefined>;
354
+ /** Explicit aria-label for the toast wrapper. When omitted, text content is used by assistive tech. */
355
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
356
+ /** Fires when the close button is clicked. */
357
+ readonly dismissed: _angular_core.OutputEmitterRef<void>;
358
+ /** Fires when a `[twToastAction]` button is clicked. */
359
+ readonly actionClicked: _angular_core.OutputEmitterRef<void>;
360
+ /** @internal */
361
+ readonly projectedIcon: _angular_core.Signal<ToastIconDirective | undefined>;
362
+ /** @internal */
363
+ readonly hasProjectedIcon: _angular_core.Signal<boolean>;
364
+ private readonly variantResult;
365
+ /** @internal */
366
+ readonly rootClasses: _angular_core.Signal<string>;
367
+ /** @internal */
368
+ readonly iconClasses: _angular_core.Signal<string>;
369
+ /** @internal */
370
+ readonly titleClasses: _angular_core.Signal<string>;
371
+ /** @internal */
372
+ readonly descriptionClasses: _angular_core.Signal<string>;
373
+ /** @internal */
374
+ readonly contentClasses: _angular_core.Signal<string>;
375
+ /** @internal */
376
+ readonly actionClasses: _angular_core.Signal<string>;
377
+ /** @internal */
378
+ readonly dismissClasses: _angular_core.Signal<string>;
379
+ /** @internal */
380
+ protected readonly roleAttr: _angular_core.Signal<"alert" | "status">;
381
+ /** @internal */
382
+ protected readonly ariaLiveAttr: _angular_core.Signal<"polite" | "assertive">;
383
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastComponent, never>;
384
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToastComponent, "tw-toast", never, { "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; "actionClicked": "actionClicked"; }, ["projectedIcon"], ["[twToastIcon]", "[twToastTitle]", "[twToastDescription]", "*", "[twToastAction]"], true, never>;
385
+ }
386
+
387
+ export { TW_TOAST_DATA, TW_TOAST_DEFAULT_OPTIONS, TW_TOAST_REF, ToastActionDirective, ToastComponent, ToastConfig, ToastDescriptionDirective, ToastIconDirective, ToastRef, ToastService, ToastTitleDirective, provideToast };
388
+ export type { ToastAction, ToastContent, ToastDismissReason, ToastDismissal, ToastPosition, ToastSeverity, ToastState, ToastTemplateContext, ToastUpdatePatch };
@@ -0,0 +1,95 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef } from '@angular/core';
3
+ import { TwColor, TwSize } from '@cdevhub/ngx-tw/core';
4
+
5
+ /** Placement position of the tooltip relative to its trigger element. */
6
+ type TooltipPosition = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
7
+ declare class TooltipDirective {
8
+ /** The tooltip content. Strings render as text; TemplateRef renders via ngTemplateOutlet. */
9
+ readonly twTooltip: _angular_core.InputSignal<string | TemplateRef<void>>;
10
+ /** Preferred placement relative to the trigger. CDK handles fallback. Defaults to `'top'`. */
11
+ readonly twTooltipPosition: _angular_core.InputSignal<TooltipPosition>;
12
+ /** Semantic color palette for the tooltip. Defaults to `'neutral'`. */
13
+ readonly twTooltipColor: _angular_core.InputSignal<TwColor>;
14
+ /** Controls padding, font size, and maximum width. Defaults to `'md'`. */
15
+ readonly twTooltipSize: _angular_core.InputSignal<TwSize>;
16
+ /**
17
+ * Milliseconds to wait before showing after trigger. Defaults to `200` — an
18
+ * intent threshold: the trigger must be held long enough that the user reads
19
+ * as "wants the tooltip" rather than a passing graze with the pointer.
20
+ */
21
+ readonly twTooltipShowDelay: _angular_core.InputSignal<number>;
22
+ /**
23
+ * Milliseconds to wait before hiding after trigger ends. Defaults to `0`
24
+ * (immediate dismiss). The asymmetry with `twTooltipShowDelay` is
25
+ * intentional — show is gated to filter noise, hide is instant so the
26
+ * tooltip never lingers over content the user has moved on from.
27
+ */
28
+ readonly twTooltipHideDelay: _angular_core.InputSignal<number>;
29
+ /** When true, tooltip never shows. Defaults to `false`. */
30
+ readonly twTooltipDisabled: _angular_core.InputSignal<boolean>;
31
+ /** When true, renders an arrow pointing to the trigger. Defaults to `true`. */
32
+ readonly twTooltipArrow: _angular_core.InputSignal<boolean>;
33
+ /** Optional class string (space-separated) merged into the panel slot for consumer customization. */
34
+ readonly twTooltipPanelClass: _angular_core.InputSignal<string>;
35
+ /** Fires when the tooltip becomes visible. */
36
+ readonly twTooltipShown: _angular_core.OutputEmitterRef<void>;
37
+ /** Fires when the tooltip is fully hidden. */
38
+ readonly twTooltipHidden: _angular_core.OutputEmitterRef<void>;
39
+ private readonly overlay;
40
+ private readonly elementRef;
41
+ private readonly destroyRef;
42
+ private readonly ariaDescriber;
43
+ private overlayRef;
44
+ private tooltipInstance;
45
+ private showTimer;
46
+ private hideTimer;
47
+ /** Last description string handed to `AriaDescriber.describe` — required so the symmetrical `removeDescription` call passes the same key. */
48
+ private _describedBy;
49
+ /** True when the trigger's `aria-describedby` was set directly to the overlay id (TemplateRef fallback path); used by `removeAriaDescription` to choose the symmetrical teardown. */
50
+ private _templateDescribedBy;
51
+ constructor();
52
+ /** Programmatically show the tooltip. */
53
+ show(): void;
54
+ /** Programmatically hide the tooltip. */
55
+ hide(): void;
56
+ /** Toggle tooltip visibility. */
57
+ toggle(): void;
58
+ protected onMouseEnter(): void;
59
+ protected onMouseLeave(): void;
60
+ protected onFocusIn(): void;
61
+ protected onFocusOut(): void;
62
+ protected onEscape(): void;
63
+ protected onTouchStart(): void;
64
+ protected onTouchEnd(): void;
65
+ private createAndShow;
66
+ private createOverlay;
67
+ private updateTooltip;
68
+ private detach;
69
+ /**
70
+ * Push the current tooltip content as an `aria-describedby` link on the
71
+ * trigger element. Dual-mode wiring:
72
+ *
73
+ * - **String content**: routed through CDK `AriaDescriber.describe`, which
74
+ * maintains a single hidden message-container on the document and dedupes
75
+ * identical strings across all describers.
76
+ * - **TemplateRef content**: AriaDescriber's dedup table is keyed by string,
77
+ * so we fall back to a direct `setAttribute('aria-describedby', overlayId)`
78
+ * pointing at the `role="tooltip"` overlay. Without this fallback,
79
+ * assistive tech would have no description link for templated tooltip
80
+ * content.
81
+ *
82
+ * `_describedBy` tracks the string handed to `AriaDescriber`;
83
+ * `_templateDescribedBy` is `true` when the fallback path is active so
84
+ * `removeAriaDescription` can take the symmetrical teardown branch.
85
+ */
86
+ private applyAriaDescription;
87
+ private removeAriaDescription;
88
+ private disposeOverlay;
89
+ private clearTimers;
90
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TooltipDirective, never>;
91
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TooltipDirective, "[twTooltip]", ["twTooltip"], { "twTooltip": { "alias": "twTooltip"; "required": true; "isSignal": true; }; "twTooltipPosition": { "alias": "twTooltipPosition"; "required": false; "isSignal": true; }; "twTooltipColor": { "alias": "twTooltipColor"; "required": false; "isSignal": true; }; "twTooltipSize": { "alias": "twTooltipSize"; "required": false; "isSignal": true; }; "twTooltipShowDelay": { "alias": "twTooltipShowDelay"; "required": false; "isSignal": true; }; "twTooltipHideDelay": { "alias": "twTooltipHideDelay"; "required": false; "isSignal": true; }; "twTooltipDisabled": { "alias": "twTooltipDisabled"; "required": false; "isSignal": true; }; "twTooltipArrow": { "alias": "twTooltipArrow"; "required": false; "isSignal": true; }; "twTooltipPanelClass": { "alias": "twTooltipPanelClass"; "required": false; "isSignal": true; }; }, { "twTooltipShown": "twTooltipShown"; "twTooltipHidden": "twTooltipHidden"; }, never, never, true, never>;
92
+ }
93
+
94
+ export { TooltipDirective };
95
+ export type { TooltipPosition };
@@ -0,0 +1,49 @@
1
+ export * from '@cdevhub/ngx-tw/core';
2
+ export * from '@cdevhub/ngx-tw/badge';
3
+ export * from '@cdevhub/ngx-tw/button';
4
+ export * from '@cdevhub/ngx-tw/card';
5
+ export * from '@cdevhub/ngx-tw/flip-card';
6
+ export * from '@cdevhub/ngx-tw/alert';
7
+ export * from '@cdevhub/ngx-tw/tabs';
8
+ export * from '@cdevhub/ngx-tw/tab-nav';
9
+ export * from '@cdevhub/ngx-tw/separator';
10
+ export * from '@cdevhub/ngx-tw/tooltip';
11
+ export * from '@cdevhub/ngx-tw/code-block';
12
+ export * from '@cdevhub/ngx-tw/segmented-control';
13
+ export * from '@cdevhub/ngx-tw/avatar';
14
+ export * from '@cdevhub/ngx-tw/menu';
15
+ export * from '@cdevhub/ngx-tw/icon';
16
+ export * from '@cdevhub/ngx-tw/collapsible';
17
+ export * from '@cdevhub/ngx-tw/accordion';
18
+ export * from '@cdevhub/ngx-tw/popover';
19
+ export * from '@cdevhub/ngx-tw/dialog';
20
+ export * from '@cdevhub/ngx-tw/command-palette';
21
+ export * from '@cdevhub/ngx-tw/toast';
22
+ export * from '@cdevhub/ngx-tw/form-field';
23
+ export * from '@cdevhub/ngx-tw/switch';
24
+ export * from '@cdevhub/ngx-tw/checkbox';
25
+ export * from '@cdevhub/ngx-tw/radio';
26
+ export * from '@cdevhub/ngx-tw/select';
27
+ export * from '@cdevhub/ngx-tw/input';
28
+ export * from '@cdevhub/ngx-tw/textarea';
29
+ export * from '@cdevhub/ngx-tw/spinner';
30
+ export * from '@cdevhub/ngx-tw/progress-bar';
31
+ export * from '@cdevhub/ngx-tw/skeleton';
32
+ export * from '@cdevhub/ngx-tw/calendar';
33
+ export * from '@cdevhub/ngx-tw/date-picker';
34
+ export * from '@cdevhub/ngx-tw/date-range-picker';
35
+ export * from '@cdevhub/ngx-tw/time-picker';
36
+ export * from '@cdevhub/ngx-tw/slider';
37
+ export * from '@cdevhub/ngx-tw/stepper';
38
+ export * from '@cdevhub/ngx-tw/paginator';
39
+ export * from '@cdevhub/ngx-tw/sort';
40
+ export * from '@cdevhub/ngx-tw/split';
41
+ export * from '@cdevhub/ngx-tw/table';
42
+ export * from '@cdevhub/ngx-tw/item';
43
+ export * from '@cdevhub/ngx-tw/breadcrumbs';
44
+ export * from '@cdevhub/ngx-tw/timeline';
45
+ export * from '@cdevhub/ngx-tw/carousel';
46
+ export * from '@cdevhub/ngx-tw/stat';
47
+ export * from '@cdevhub/ngx-tw/combobox';
48
+ export * from '@cdevhub/ngx-tw/empty-state';
49
+ export * from '@cdevhub/ngx-tw/sheet';