@basis-ng/primitives 0.0.1-alpha.33 → 0.0.1-alpha.34

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.
@@ -1,36 +1,36 @@
1
- import { Position } from '../../../shared/types/position.type';
1
+ import { TemplateRef } from '@angular/core';
2
+ import { Direction } from '../../../shared/types/direction.type';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
- * TooltipComponent is a reusable UI component that displays a tooltip
5
- * with customizable position, gap, variant, and size.
5
+ * Tooltip component used to display content or templates in a tooltip overlay.
6
6
  */
7
7
  export declare class TooltipComponent {
8
8
  /**
9
- * The position of the tooltip relative to its trigger element.
10
- * Defaults to 'top-center'.
9
+ * Specifies the size of the tooltip.
10
+ *
11
+ * @defaultValue '2'
11
12
  */
12
- readonly position: import("@angular/core").InputSignal<Position>;
13
+ readonly size: import("@angular/core").WritableSignal<"1" | "2" | "3">;
13
14
  /**
14
- * The gap (in pixels) between the tooltip and its trigger element.
15
- * Defaults to 8.
15
+ * Direction of the tooltip (e.g., top, bottom, left, right).
16
16
  */
17
- readonly gap: import("@angular/core").InputSignal<number>;
17
+ readonly direction: import("@angular/core").WritableSignal<Direction | undefined>;
18
18
  /**
19
- * The visual variant of the tooltip. Options include:
20
- * - 'primary'
21
- * - 'secondary'
22
- * - 'ghost'
23
- * - 'outlined'
24
- * Defaults to 'primary'.
19
+ * Indicates whether the tooltip is leaving (for animation purposes).
25
20
  */
26
- readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "ghost" | "outlined">;
21
+ readonly leaving: import("@angular/core").WritableSignal<boolean>;
27
22
  /**
28
- * The size of the tooltip. Options include:
29
- * - 'small'
30
- * - 'default'
31
- * Defaults to 'default'.
23
+ * Content of the tooltip, which can be a string or a template.
32
24
  */
33
- readonly size: import("@angular/core").InputSignal<"small" | "default">;
25
+ readonly content: import("@angular/core").WritableSignal<string | TemplateRef<any>>;
26
+ /**
27
+ * Determines if the content is a string.
28
+ */
29
+ readonly isString: import("@angular/core").Signal<boolean>;
30
+ /**
31
+ * Returns the template if the content is not a string.
32
+ */
33
+ readonly template: import("@angular/core").Signal<TemplateRef<any> | null>;
34
34
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "b-tooltip", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[b-tooltip-content]"], true, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "b-tooltip", never, {}, {}, never, never, true, never>;
36
36
  }
@@ -0,0 +1,110 @@
1
+ import { CdkOverlayOrigin, ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay';
2
+ import { TemplateRef, OnDestroy, ComponentRef } from '@angular/core';
3
+ import { Direction } from '../../../shared/types/direction.type';
4
+ import { UtilsService } from '../../../shared/services/utils.service';
5
+ import { Position } from '../../../public-api';
6
+ import { TooltipComponent } from './tooltip.component';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "@angular/cdk/overlay";
9
+ /**
10
+ * Directive to attach a tooltip to an element.
11
+ */
12
+ export declare class TooltipDirective implements OnDestroy {
13
+ /**
14
+ * Tooltip content, which can be a string or a template.
15
+ *
16
+ * @alias bTooltip
17
+ */
18
+ readonly content: import("@angular/core").InputSignal<string | TemplateRef<any>>;
19
+ /**
20
+ * Specifies the size of the tooltip.
21
+ *
22
+ * @defaultValue '2'
23
+ */
24
+ readonly size: import("@angular/core").InputSignal<"1" | "2" | "3">;
25
+ /**
26
+ * Overlay origin for positioning the tooltip.
27
+ */
28
+ origin: CdkOverlayOrigin;
29
+ /**
30
+ * Overlay service for creating and managing overlays.
31
+ */
32
+ overlay: Overlay;
33
+ /**
34
+ * Utility service for common operations.
35
+ */
36
+ utils: UtilsService;
37
+ /**
38
+ * Whether the tooltip should appear on hover.
39
+ *
40
+ * @defaultValue true
41
+ */
42
+ readonly hover: import("@angular/core").InputSignal<boolean>;
43
+ /**
44
+ * Whether the tooltip should appear on focus.
45
+ *
46
+ * @defaultValue false
47
+ */
48
+ readonly focus: import("@angular/core").InputSignal<boolean>;
49
+ /**
50
+ * Reference to the overlay instance.
51
+ */
52
+ readonly overlayRef: import("@angular/core").WritableSignal<OverlayRef | null>;
53
+ /**
54
+ * Map of positions for the tooltip.
55
+ */
56
+ readonly positionsMap: import("@angular/core").WritableSignal<Record<Position, ConnectedPosition>>;
57
+ /**
58
+ * List of positions for the tooltip.
59
+ *
60
+ * @defaultValue ['bottom-left']
61
+ */
62
+ readonly positions: import("@angular/core").InputSignal<Position[]>;
63
+ /**
64
+ * Computed connected positions based on the positions input.
65
+ */
66
+ readonly connectedPositions: import("@angular/core").Signal<ConnectedPosition[]>;
67
+ /**
68
+ * Delay before showing the tooltip.
69
+ *
70
+ * @defaultValue 0
71
+ */
72
+ readonly showDelay: import("@angular/core").InputSignal<number>;
73
+ /**
74
+ * Delay before hiding the tooltip.
75
+ *
76
+ * @defaultValue 150
77
+ */
78
+ readonly hideDelay: import("@angular/core").InputSignal<number>;
79
+ /**
80
+ * Currently connected position of the tooltip.
81
+ */
82
+ readonly connectedPosition: import("@angular/core").WritableSignal<ConnectedPosition | null>;
83
+ /**
84
+ * Direction of the tooltip based on the connected position.
85
+ */
86
+ readonly direction: import("@angular/core").Signal<Direction>;
87
+ /**
88
+ * Subscription to position change events.
89
+ */
90
+ private positionChangeSubscription;
91
+ /**
92
+ * Reference to the tooltip component instance.
93
+ */
94
+ readonly componentRef: import("@angular/core").WritableSignal<ComponentRef<TooltipComponent> | undefined>;
95
+ /**
96
+ * Shows the tooltip.
97
+ */
98
+ show(): void;
99
+ /**
100
+ * Hides the tooltip.
101
+ */
102
+ hide(): void;
103
+ /**
104
+ * Cleans up resources when the directive is destroyed.
105
+ */
106
+ ngOnDestroy(): void;
107
+ constructor();
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
109
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[bTooltip]", never, { "content": { "alias": "bTooltip"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hover": { "alias": "hover"; "required": false; "isSignal": true; }; "focus": { "alias": "focus"; "required": false; "isSignal": true; }; "positions": { "alias": "positions"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkOverlayOrigin; inputs: {}; outputs: {}; }]>;
110
+ }