@molecule/app-ui-angular 1.0.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 (75) hide show
  1. package/LICENSE +115 -0
  2. package/README.md +1591 -0
  3. package/dist/components/alert.component.d.ts +71 -0
  4. package/dist/components/alert.component.d.ts.map +1 -0
  5. package/dist/components/alert.component.js +222 -0
  6. package/dist/components/alert.component.js.map +1 -0
  7. package/dist/components/badge.component.d.ts +27 -0
  8. package/dist/components/badge.component.d.ts.map +1 -0
  9. package/dist/components/badge.component.js +78 -0
  10. package/dist/components/badge.component.js.map +1 -0
  11. package/dist/components/button.component.d.ts +38 -0
  12. package/dist/components/button.component.d.ts.map +1 -0
  13. package/dist/components/button.component.js +136 -0
  14. package/dist/components/button.component.js.map +1 -0
  15. package/dist/components/checkbox.component.d.ts +53 -0
  16. package/dist/components/checkbox.component.d.ts.map +1 -0
  17. package/dist/components/checkbox.component.js +165 -0
  18. package/dist/components/checkbox.component.js.map +1 -0
  19. package/dist/components/index.d.ts +18 -0
  20. package/dist/components/index.d.ts.map +1 -0
  21. package/dist/components/index.js +18 -0
  22. package/dist/components/index.js.map +1 -0
  23. package/dist/components/input.component.d.ts +87 -0
  24. package/dist/components/input.component.d.ts.map +1 -0
  25. package/dist/components/input.component.js +307 -0
  26. package/dist/components/input.component.js.map +1 -0
  27. package/dist/components/modal.component.d.ts +142 -0
  28. package/dist/components/modal.component.d.ts.map +1 -0
  29. package/dist/components/modal.component.js +375 -0
  30. package/dist/components/modal.component.js.map +1 -0
  31. package/dist/components/radio-group.component.d.ts +63 -0
  32. package/dist/components/radio-group.component.d.ts.map +1 -0
  33. package/dist/components/radio-group.component.js +207 -0
  34. package/dist/components/radio-group.component.js.map +1 -0
  35. package/dist/components/select.component.d.ts +72 -0
  36. package/dist/components/select.component.d.ts.map +1 -0
  37. package/dist/components/select.component.js +273 -0
  38. package/dist/components/select.component.js.map +1 -0
  39. package/dist/components/spinner.component.d.ts +36 -0
  40. package/dist/components/spinner.component.d.ts.map +1 -0
  41. package/dist/components/spinner.component.js +115 -0
  42. package/dist/components/spinner.component.js.map +1 -0
  43. package/dist/components/switch.component.d.ts +54 -0
  44. package/dist/components/switch.component.d.ts.map +1 -0
  45. package/dist/components/switch.component.js +147 -0
  46. package/dist/components/switch.component.js.map +1 -0
  47. package/dist/components/toast.component.d.ts +92 -0
  48. package/dist/components/toast.component.d.ts.map +1 -0
  49. package/dist/components/toast.component.js +298 -0
  50. package/dist/components/toast.component.js.map +1 -0
  51. package/dist/components/tooltip.component.d.ts +77 -0
  52. package/dist/components/tooltip.component.d.ts.map +1 -0
  53. package/dist/components/tooltip.component.js +315 -0
  54. package/dist/components/tooltip.component.js.map +1 -0
  55. package/dist/index.d.ts +59 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +59 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/types.d.ts +7 -0
  60. package/dist/types.d.ts.map +1 -0
  61. package/dist/types.js +7 -0
  62. package/dist/types.js.map +1 -0
  63. package/dist/utilities/index.d.ts +8 -0
  64. package/dist/utilities/index.d.ts.map +1 -0
  65. package/dist/utilities/index.js +8 -0
  66. package/dist/utilities/index.js.map +1 -0
  67. package/dist/utilities/render-icon.d.ts +15 -0
  68. package/dist/utilities/render-icon.d.ts.map +1 -0
  69. package/dist/utilities/render-icon.js +44 -0
  70. package/dist/utilities/render-icon.js.map +1 -0
  71. package/dist/utilities/utilities.d.ts +12 -0
  72. package/dist/utilities/utilities.d.ts.map +1 -0
  73. package/dist/utilities/utilities.js +14 -0
  74. package/dist/utilities/utilities.js.map +1 -0
  75. package/package.json +54 -0
@@ -0,0 +1,298 @@
1
+ /**
2
+ * Angular Toast UI component with UIClassMap-driven styling.
3
+ *
4
+ * @module
5
+ */
6
+ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
7
+ import { t } from '@molecule/app-i18n';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { getIconSvg } from '../utilities/render-icon.js';
10
+ import * as i0 from "@angular/core";
11
+ const _c0 = ["*"];
12
+ function MoleculeToast_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
13
+ i0.ɵɵdomElementStart(0, "span");
14
+ i0.ɵɵdomElement(1, "span", 4);
15
+ i0.ɵɵdomElementEnd();
16
+ } if (rf & 2) {
17
+ const ctx_r0 = i0.ɵɵnextContext(2);
18
+ i0.ɵɵclassMap(ctx_r0.cm.toastIconWrapper);
19
+ i0.ɵɵadvance();
20
+ i0.ɵɵdomProperty("innerHTML", ctx_r0.statusIconSvg, i0.ɵɵsanitizeHtml);
21
+ } }
22
+ function MoleculeToast_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
23
+ i0.ɵɵdomElementStart(0, "div");
24
+ i0.ɵɵtext(1);
25
+ i0.ɵɵdomElementEnd();
26
+ } if (rf & 2) {
27
+ const ctx_r0 = i0.ɵɵnextContext(2);
28
+ i0.ɵɵclassMap(ctx_r0.titleClass);
29
+ i0.ɵɵadvance();
30
+ i0.ɵɵtextInterpolate(ctx_r0.title);
31
+ } }
32
+ function MoleculeToast_Conditional_0_Conditional_4_Template(rf, ctx) { if (rf & 1) {
33
+ i0.ɵɵdomElementStart(0, "div");
34
+ i0.ɵɵtext(1);
35
+ i0.ɵɵdomElementEnd();
36
+ } if (rf & 2) {
37
+ const ctx_r0 = i0.ɵɵnextContext(2);
38
+ i0.ɵɵclassMap(ctx_r0.descriptionClass);
39
+ i0.ɵɵadvance();
40
+ i0.ɵɵtextInterpolate(ctx_r0.description);
41
+ } }
42
+ function MoleculeToast_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
43
+ i0.ɵɵdomElementStart(0, "div");
44
+ i0.ɵɵprojection(1);
45
+ i0.ɵɵdomElementEnd();
46
+ } if (rf & 2) {
47
+ const ctx_r0 = i0.ɵɵnextContext(2);
48
+ i0.ɵɵclassMap(ctx_r0.descriptionClass);
49
+ } }
50
+ function MoleculeToast_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
51
+ const _r2 = i0.ɵɵgetCurrentView();
52
+ i0.ɵɵdomElementStart(0, "button", 5);
53
+ i0.ɵɵdomListener("click", function MoleculeToast_Conditional_0_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onDismiss()); });
54
+ i0.ɵɵdomElement(1, "span", 4);
55
+ i0.ɵɵdomElementEnd();
56
+ } if (rf & 2) {
57
+ const ctx_r0 = i0.ɵɵnextContext(2);
58
+ i0.ɵɵclassMap(ctx_r0.closeButtonClass);
59
+ i0.ɵɵattribute("aria-label", ctx_r0.closeAriaLabel);
60
+ i0.ɵɵadvance();
61
+ i0.ɵɵdomProperty("innerHTML", ctx_r0.dismissIconSvg, i0.ɵɵsanitizeHtml);
62
+ } }
63
+ function MoleculeToast_Conditional_0_Template(rf, ctx) { if (rf & 1) {
64
+ i0.ɵɵdomElementStart(0, "div", 1);
65
+ i0.ɵɵconditionalCreate(1, MoleculeToast_Conditional_0_Conditional_1_Template, 2, 3, "span", 2);
66
+ i0.ɵɵdomElementStart(2, "div");
67
+ i0.ɵɵconditionalCreate(3, MoleculeToast_Conditional_0_Conditional_3_Template, 2, 3, "div", 2);
68
+ i0.ɵɵconditionalCreate(4, MoleculeToast_Conditional_0_Conditional_4_Template, 2, 3, "div", 2)(5, MoleculeToast_Conditional_0_Conditional_5_Template, 2, 2, "div", 2);
69
+ i0.ɵɵdomElementEnd();
70
+ i0.ɵɵconditionalCreate(6, MoleculeToast_Conditional_0_Conditional_6_Template, 2, 4, "button", 3);
71
+ i0.ɵɵdomElementEnd();
72
+ } if (rf & 2) {
73
+ const ctx_r0 = i0.ɵɵnextContext();
74
+ i0.ɵɵstyleMap(ctx_r0.style);
75
+ i0.ɵɵclassMap(ctx_r0.toastClasses);
76
+ i0.ɵɵattribute("data-testid", ctx_r0.testId);
77
+ i0.ɵɵadvance();
78
+ i0.ɵɵconditional(ctx_r0.showIcon ? 1 : -1);
79
+ i0.ɵɵadvance();
80
+ i0.ɵɵclassMap(ctx_r0.cm.toastContentWrapper);
81
+ i0.ɵɵadvance();
82
+ i0.ɵɵconditional(ctx_r0.title ? 3 : -1);
83
+ i0.ɵɵadvance();
84
+ i0.ɵɵconditional(ctx_r0.description ? 4 : 5);
85
+ i0.ɵɵadvance(2);
86
+ i0.ɵɵconditional(ctx_r0.dismissible ? 6 : -1);
87
+ } }
88
+ const statusVariantMap = {
89
+ primary: 'default',
90
+ secondary: 'default',
91
+ success: 'success',
92
+ warning: 'warning',
93
+ error: 'error',
94
+ info: 'info',
95
+ };
96
+ /**
97
+ * Angular Toast UI component with UIClassMap-driven styling.
98
+ */
99
+ /**
100
+ * Molecule Toast class.
101
+ */
102
+ export class MoleculeToast {
103
+ title;
104
+ description;
105
+ status = 'info';
106
+ duration = 5000;
107
+ dismissible = true;
108
+ closeLabel;
109
+ position = 'bottom-right';
110
+ className;
111
+ style;
112
+ testId;
113
+ dismiss = new EventEmitter();
114
+ isVisible = true;
115
+ timer;
116
+ /**
117
+ * Retrieves the current UI class map.
118
+ * @returns The UIClassMap instance for styling.
119
+ */
120
+ get cm() {
121
+ return getClassMap();
122
+ }
123
+ /**
124
+ * Computes the accessible close button label.
125
+ * @returns The localized aria-label for the close button.
126
+ */
127
+ get closeAriaLabel() {
128
+ return this.closeLabel || t('ui.toast.close', undefined, { defaultValue: 'Close' });
129
+ }
130
+ /**
131
+ * Retrieves the CSS class for the toast title.
132
+ * @returns The title class name string.
133
+ */
134
+ get titleClass() {
135
+ return this.cm.toastTitle;
136
+ }
137
+ /**
138
+ * Retrieves the CSS class for the toast description.
139
+ * @returns The description class name string.
140
+ */
141
+ get descriptionClass() {
142
+ return this.cm.toastDescription;
143
+ }
144
+ /**
145
+ * Retrieves the CSS class for the close button.
146
+ * @returns The close button class name string.
147
+ */
148
+ get closeButtonClass() {
149
+ return this.cm.toastClose;
150
+ }
151
+ /**
152
+ * Determines the icon type based on the toast status.
153
+ * @returns The mapped icon type string.
154
+ */
155
+ get iconType() {
156
+ return statusVariantMap[this.status] || 'default';
157
+ }
158
+ /**
159
+ * Determines whether the status icon should be shown.
160
+ * @returns True if the icon type is not default.
161
+ */
162
+ get showIcon() {
163
+ return this.iconType !== 'default';
164
+ }
165
+ statusIconMap = {
166
+ info: 'info-circle',
167
+ success: 'check-circle',
168
+ warning: 'exclamation-triangle',
169
+ error: 'x-circle',
170
+ };
171
+ /**
172
+ * Generates the SVG markup for the status icon.
173
+ * @returns The SVG string for the current status icon.
174
+ */
175
+ get statusIconSvg() {
176
+ const name = this.statusIconMap[this.iconType];
177
+ return name ? getIconSvg(name, this.cm.iconMd) : '';
178
+ }
179
+ /**
180
+ * Generates the SVG markup for the dismiss icon.
181
+ * @returns The SVG string for the dismiss button icon.
182
+ */
183
+ get dismissIconSvg() {
184
+ return getIconSvg('x-mark', this.cm.iconSm);
185
+ }
186
+ /**
187
+ * Computes the combined CSS classes for the toast container.
188
+ * @returns The toast class name string.
189
+ */
190
+ get toastClasses() {
191
+ const variant = statusVariantMap[this.status] || 'default';
192
+ return this.cm.cn(this.cm.toast({ variant }), this.className);
193
+ }
194
+ /**
195
+ * Starts the auto-dismiss timer on component creation.
196
+ */
197
+ ngOnInit() {
198
+ if (this.duration > 0) {
199
+ this.timer = setTimeout(() => {
200
+ this.isVisible = false;
201
+ this.dismiss.emit();
202
+ }, this.duration);
203
+ }
204
+ }
205
+ /**
206
+ * Clears the auto-dismiss timer on component destruction.
207
+ */
208
+ ngOnDestroy() {
209
+ if (this.timer) {
210
+ clearTimeout(this.timer);
211
+ }
212
+ }
213
+ /**
214
+ * Handles the dismiss action by hiding the toast.
215
+ */
216
+ onDismiss() {
217
+ this.isVisible = false;
218
+ this.dismiss.emit();
219
+ }
220
+ static ɵfac = function MoleculeToast_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MoleculeToast)(); };
221
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MoleculeToast, selectors: [["mol-toast"]], inputs: { title: "title", description: "description", status: "status", duration: "duration", dismissible: "dismissible", closeLabel: "closeLabel", position: "position", className: "className", style: "style", testId: "testId" }, outputs: { dismiss: "dismiss" }, ngContentSelectors: _c0, decls: 1, vars: 1, consts: [["role", "alert", "data-state", "open", 3, "class", "style"], ["role", "alert", "data-state", "open"], [3, "class"], ["type", "button", 3, "class"], [3, "innerHTML"], ["type", "button", 3, "click"]], template: function MoleculeToast_Template(rf, ctx) { if (rf & 1) {
222
+ i0.ɵɵprojectionDef();
223
+ i0.ɵɵconditionalCreate(0, MoleculeToast_Conditional_0_Template, 7, 11, "div", 0);
224
+ } if (rf & 2) {
225
+ i0.ɵɵconditional(ctx.isVisible ? 0 : -1);
226
+ } }, encapsulation: 2 });
227
+ }
228
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MoleculeToast, [{
229
+ type: Component,
230
+ args: [{
231
+ selector: 'mol-toast',
232
+ standalone: true,
233
+ changeDetection: ChangeDetectionStrategy.OnPush,
234
+ template: `
235
+ @if (isVisible) {
236
+ <div
237
+ role="alert"
238
+ data-state="open"
239
+ [class]="toastClasses"
240
+ [style]="style"
241
+ [attr.data-testid]="testId"
242
+ >
243
+ @if (showIcon) {
244
+ <span [class]="cm.toastIconWrapper">
245
+ <span [innerHTML]="statusIconSvg"></span>
246
+ </span>
247
+ }
248
+ <div [class]="cm.toastContentWrapper">
249
+ @if (title) {
250
+ <div [class]="titleClass">{{ title }}</div>
251
+ }
252
+ @if (description) {
253
+ <div [class]="descriptionClass">{{ description }}</div>
254
+ } @else {
255
+ <div [class]="descriptionClass">
256
+ <ng-content></ng-content>
257
+ </div>
258
+ }
259
+ </div>
260
+ @if (dismissible) {
261
+ <button
262
+ type="button"
263
+ (click)="onDismiss()"
264
+ [class]="closeButtonClass"
265
+ [attr.aria-label]="closeAriaLabel"
266
+ >
267
+ <span [innerHTML]="dismissIconSvg"></span>
268
+ </button>
269
+ }
270
+ </div>
271
+ }
272
+ `,
273
+ }]
274
+ }], null, { title: [{
275
+ type: Input
276
+ }], description: [{
277
+ type: Input
278
+ }], status: [{
279
+ type: Input
280
+ }], duration: [{
281
+ type: Input
282
+ }], dismissible: [{
283
+ type: Input
284
+ }], closeLabel: [{
285
+ type: Input
286
+ }], position: [{
287
+ type: Input
288
+ }], className: [{
289
+ type: Input
290
+ }], style: [{
291
+ type: Input
292
+ }], testId: [{
293
+ type: Input
294
+ }], dismiss: [{
295
+ type: Output
296
+ }] }); })();
297
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MoleculeToast, { className: "MoleculeToast", filePath: "components/toast.component.ts", lineNumber: 84 }); })();
298
+ //# sourceMappingURL=toast.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.component.js","sourceRoot":"","sources":["../../src/components/toast.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,KAAK,EAGL,MAAM,GACP,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;;;;IA6B9C,+BAAoC;IAClC,6BAAyC;IAC3C,oBAAO;;;IAFD,yCAA6B;IAC3B,cAA2B;IAA3B,sEAA2B;;;IAKjC,8BAA0B;IAAA,YAAW;IAAA,oBAAM;;;IAAtC,gCAAoB;IAAC,cAAW;IAAX,kCAAW;;;IAGrC,8BAAgC;IAAA,YAAiB;IAAA,oBAAM;;;IAAlD,sCAA0B;IAAC,cAAiB;IAAjB,wCAAiB;;;IAEjD,8BAAgC;IAC9B,kBAAyB;IAC3B,oBAAM;;;IAFD,sCAA0B;;;;IAMjC,oCAKC;IAHC,mMA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,QAAQ,GAAG,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC3B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;gBACtB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;YACrB,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;uGAtIU,aAAa;6DAAb,aAAa;;YA1CtB,gFAAiB;;YAAjB,wCAoCC;;;iFAMQ,aAAa;cA/CzB,SAAS;eAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,IAAI;gBAChB,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCT;aACF;;kBAKE,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kFAbI,aAAa"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Angular Tooltip UI component with UIClassMap-driven styling.
3
+ *
4
+ * @module
5
+ */
6
+ import { type ElementRef, type OnDestroy } from '@angular/core';
7
+ import type { TooltipPlacement, UIClassMap } from '@molecule/app-ui';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * Returns the arrow's inline position style for a given placement. The arrow
11
+ * has no dedicated ClassMap resolver (`tooltip()` takes no options), so its
12
+ * shape/position is expressed via a small inline style — the sanctioned
13
+ * exception for values ClassMap cannot express. Its color is NOT hardcoded:
14
+ * `var(--color-surface)` / `var(--color-border)` are the same CSS custom
15
+ * properties the `bg-surface`/`border` classes in `tooltipContent` resolve
16
+ * to, so the arrow always matches the tooltip body in both themes.
17
+ *
18
+ * A standalone function (rather than a class member) so it's unit-testable
19
+ * in isolation, matching `getModalWrapperStyle()` in `modal.component.ts`.
20
+ * @param placement - The tooltip's resolved placement.
21
+ * @returns Inline style positioning the rotated-square arrow for that placement.
22
+ */
23
+ export declare function getTooltipArrowStyle(placement: TooltipPlacement): Record<string, string>;
24
+ /**
25
+ * Angular Tooltip UI component with UIClassMap-driven styling.
26
+ *
27
+ * Wraps child content and shows a tooltip on hover/focus. `hasArrow` renders
28
+ * a small themed pointer at the resolved `placement` edge.
29
+ */
30
+ export declare class MoleculeTooltip implements OnDestroy {
31
+ content: string;
32
+ placement: TooltipPlacement;
33
+ delay: number;
34
+ hasArrow: boolean;
35
+ className?: string;
36
+ style?: Record<string, string>;
37
+ testId?: string;
38
+ triggerRef?: ElementRef<HTMLDivElement>;
39
+ tooltipRef?: ElementRef<HTMLDivElement>;
40
+ isVisible: boolean;
41
+ positionStyle: Record<string, string>;
42
+ private timeoutId?;
43
+ /**
44
+ * Retrieves the current UI class map.
45
+ * @returns The UIClassMap instance for styling.
46
+ */
47
+ get cm(): UIClassMap;
48
+ /**
49
+ * Computes the combined CSS classes for the tooltip content.
50
+ * @returns The tooltip class name string.
51
+ */
52
+ get tooltipClasses(): string;
53
+ /**
54
+ * Retrieves the inline style for the tooltip's arrow element.
55
+ * @returns Inline style positioning the rotated-square arrow.
56
+ */
57
+ get arrowStyle(): Record<string, string>;
58
+ /**
59
+ * Shows the tooltip with optional delay.
60
+ */
61
+ show(): void;
62
+ /**
63
+ * Hides the tooltip and cancels any pending delay.
64
+ */
65
+ hide(): void;
66
+ /**
67
+ * Clears pending timeouts on component destruction.
68
+ */
69
+ ngOnDestroy(): void;
70
+ /**
71
+ * Calculates and applies the tooltip position relative to the trigger.
72
+ */
73
+ private updatePosition;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<MoleculeTooltip, never>;
75
+ static ɵcmp: i0.ɵɵComponentDeclaration<MoleculeTooltip, "mol-tooltip", never, { "content": { "alias": "content"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "hasArrow": { "alias": "hasArrow"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["*"], true, never>;
76
+ }
77
+ //# sourceMappingURL=tooltip.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,UAAU,EAEf,KAAK,SAAS,EAEf,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAMpE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiDxF;AAED;;;;;GAKG;AACH,qBA2Ca,eAAgB,YAAW,SAAS;IACtC,OAAO,SAAK;IACZ,SAAS,EAAE,gBAAgB,CAAQ;IACnC,KAAK,SAAI;IACT,QAAQ,UAAQ;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IAEF,UAAU,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAA;IAE/D,SAAS,UAAQ;IACjB,aAAa,EAAE,MAAM,CAAC,MAA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