@flexzap/overlay 1.2.1 → 1.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vitor Azevedo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -142,8 +142,8 @@ npm run overlay:test:watch # Run tests in watch mode (no coverage)
142
142
 
143
143
  ```bash
144
144
  # From the monorepo root
145
- npm run overlay:build # Build the library
146
- ng build @flexzap/overlay # Build directly using CLI
145
+ npm run overlay:build # Build directly
146
+ ng build @flexzap/overlay # Build using Angular CLI
147
147
  ```
148
148
 
149
149
  ### Code Scaffolding
@@ -2,8 +2,27 @@ import * as i0 from '@angular/core';
2
2
  import { input, ChangeDetectionStrategy, Component, inject, ElementRef, Renderer2, Directive, output } from '@angular/core';
3
3
  import { ZapSvgConfig, ZapSvg } from '@flexzap/symbols';
4
4
 
5
+ /**
6
+ * Component that displays a tooltip with text content.
7
+ * Positioned relative to a target element.
8
+ *
9
+ * @example
10
+ * ```html
11
+ * <zap-tooltip [position]="'top'" [visible]="true">
12
+ * Tooltip Content
13
+ * </zap-tooltip>
14
+ * ```
15
+ */
5
16
  class ZapTooltip {
17
+ /**
18
+ * The position of the tooltip relative to the target.
19
+ * Required.
20
+ */
6
21
  position = input.required(...(ngDevMode ? [{ debugName: "position" }] : []));
22
+ /**
23
+ * Whether the tooltip is currently visible.
24
+ * @default false
25
+ */
7
26
  visible = input(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
8
27
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ZapTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
9
28
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: ZapTooltip, isStandalone: true, selector: "zap-tooltip", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.zap-position": "position()", "attr.zap-visible": "visible()" } }, ngImport: i0, template: "<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{width:max-content;display:none}:host[zap-visible=true]{display:table}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -67,13 +86,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
67
86
  }]
68
87
  }] });
69
88
 
89
+ /**
90
+ * A shell component for creating modal dialogs.
91
+ * Handles visibility, backdrop, and close interactions (click outside, escape key).
92
+ *
93
+ * @example
94
+ * ```html
95
+ * <zap-modal-shell [visible]="isOpen()" (close)="onClose()">
96
+ * <div class="modal-content">
97
+ * <h2>Title</h2>
98
+ * <p>Content...</p>
99
+ * </div>
100
+ * </zap-modal-shell>
101
+ * ```
102
+ */
70
103
  class ZapModalShell {
104
+ /**
105
+ * Whether the modal is visible.
106
+ * Required.
107
+ */
71
108
  visible = input.required(...(ngDevMode ? [{ debugName: "visible" }] : []));
109
+ /**
110
+ * Event emitted when the modal should close.
111
+ * Triggered by clicking the close button or pressing Escape.
112
+ */
72
113
  close = output();
73
114
  svgConfigIcon = ZapSvgConfig.createIcon();
115
+ /**
116
+ * Closes the modal by emitting the close event.
117
+ */
74
118
  closeModal() {
75
119
  this.close.emit();
76
120
  }
121
+ /**
122
+ * Handles the Escape key press to close the modal.
123
+ * @param e The keyboard event.
124
+ */
77
125
  onKeyDown(e) {
78
126
  const event = e;
79
127
  if (event.key === 'Escape') {
@@ -1 +1 @@
1
- {"version":3,"file":"flexzap-overlay.mjs","sources":["../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.ts","../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.html","../../../../projects/flexzap/overlay/src/lib/tooltip-bind/tooltip-bind.ts","../../../../projects/flexzap/overlay/src/lib/modal-shell/modal-shell.ts","../../../../projects/flexzap/overlay/src/lib/modal-shell/modal-shell.html","../../../../projects/flexzap/overlay/src/public-api.ts","../../../../projects/flexzap/overlay/src/flexzap-overlay.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'zap-tooltip',\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.zap-position]': 'position()',\n '[attr.zap-visible]': 'visible()'\n }\n})\nexport class ZapTooltip {\n position = input.required<'top' | 'right' | 'bottom' | 'left'>();\n visible = input(false);\n}\n","<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n","import { Directive, ElementRef, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[ZapTooltipBind]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()'\n }\n})\n/**\n * Directive that binds the visibility of a sibling `zap-tooltip` to the host element's hover events.\n *\n * It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `zap-visible`\n * attribute of the immediate previous or next sibling if it matches the `zap-tooltip` tag.\n *\n * @usageNotes\n * Apply this directive to any element that has a `zap-tooltip` sibling.\n *\n * ```html\n * <button ZapTooltipBind>Hover me</button>\n * <zap-tooltip [position]=\"'top'\">I'm a tooltip</zap-tooltip>\n * ```\n */\nexport class ZapTooltipBind {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n onMouseEnter() {\n this.toggleTooltip(true);\n }\n\n onMouseLeave() {\n this.toggleTooltip(false);\n }\n\n private toggleTooltip(show: boolean) {\n const element = this.elementRef.nativeElement;\n const nextSibling = element.nextElementSibling;\n const prevSibling = element.previousElementSibling;\n\n if (nextSibling && nextSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(nextSibling, show);\n }\n\n if (prevSibling && prevSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(prevSibling, show);\n }\n }\n\n private updateSibling(sibling: Element, show: boolean) {\n this.renderer.setAttribute(sibling, 'zap-visible', String(show));\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\n\nimport { ZapSvg, ZapSvgConfig, ZapSvgInterface } from '@flexzap/symbols';\n\n@Component({\n selector: 'zap-modal-shell',\n imports: [ZapSvg],\n templateUrl: './modal-shell.html',\n styleUrl: './modal-shell.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.zap-visible]': 'visible()',\n '(window:keydown.escape)': 'onKeyDown($event)'\n }\n})\nexport class ZapModalShell {\n visible = input.required<boolean>();\n close = output<void>();\n\n svgConfigIcon: ZapSvgInterface = ZapSvgConfig.createIcon();\n\n closeModal() {\n this.close.emit();\n }\n\n onKeyDown(e: Event) {\n const event = e as KeyboardEvent;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close.emit();\n }\n }\n}\n","<section class=\"zap-modal-shell\" (click)=\"closeModal()\">\n <div (click)=\"$event.stopPropagation()\">\n <button type=\"button\" (click)=\"closeModal()\">\n <zap-svg [name]=\"'close'\" [config]=\"svgConfigIcon\"></zap-svg>\n </button>\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n</section>\n","/*\n * Public API Surface of overlay\n */\n\nexport * from './lib/tooltip/tooltip';\nexport * from './lib/tooltip-bind/tooltip-bind';\nexport * from './lib/modal-shell/modal-shell';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,UAAU,CAAA;AACrB,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAuC;AAChE,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;uGAFX,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,+aCZvB,oEAGA,EAAA,MAAA,EAAA,CAAA,+EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDSa,UAAU,EAAA,UAAA,EAAA,CAAA;kBAVtB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,oBAAoB,EAAE;AACvB,qBAAA,EAAA,QAAA,EAAA,oEAAA,EAAA,MAAA,EAAA,CAAA,+EAAA,CAAA,EAAA;;;AEDH;;;;;;;;;;;;;AAaG;MACU,cAAc,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,QAAQ,G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A,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FASL,aAAa,EAAA,UAAA,EAAA,CAAA;kBAXzB,SAAS;+BACE,iBAAiB,EAAA,OAAA,EAClB,CAAC,MAAM,CAAC,mBAGA,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,oBAAoB,EAAE,WAAW;AACjC,wBAAA,yBAAyB,EAAE;AAC5B,qBAAA,EAAA,QAAA,EAAA,2UAAA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA;;;AEbH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"flexzap-overlay.mjs","sources":["../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.ts","../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.html","../../../../projects/flexzap/overlay/src/lib/tooltip-bind/tooltip-bind.ts","../../../../projects/flexzap/overlay/src/lib/modal-shell/modal-shell.ts","../../../../projects/flexzap/overlay/src/lib/modal-shell/modal-shell.html","../../../../projects/flexzap/overlay/src/public-api.ts","../../../../projects/flexzap/overlay/src/flexzap-overlay.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * Component that displays a tooltip with text content.\n * Positioned relative to a target element.\n *\n * @example\n * ```html\n * <zap-tooltip [position]=\"'top'\" [visible]=\"true\">\n * Tooltip Content\n * </zap-tooltip>\n * ```\n */\n@Component({\n selector: 'zap-tooltip',\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.zap-position]': 'position()',\n '[attr.zap-visible]': 'visible()'\n }\n})\nexport class ZapTooltip {\n /**\n * The position of the tooltip relative to the target.\n * Required.\n */\n position = input.required<'top' | 'right' | 'bottom' | 'left'>();\n\n /**\n * Whether the tooltip is currently visible.\n * @default false\n */\n visible = input(false);\n}\n","<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n","import { Directive, ElementRef, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[ZapTooltipBind]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()'\n }\n})\n/**\n * Directive that binds the visibility of a sibling `zap-tooltip` to the host element's hover events.\n *\n * It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `zap-visible`\n * attribute of the immediate previous or next sibling if it matches the `zap-tooltip` tag.\n *\n * @usageNotes\n * Apply this directive to any element that has a `zap-tooltip` sibling.\n *\n * ```html\n * <button ZapTooltipBind>Hover me</button>\n * <zap-tooltip [position]=\"'top'\">I'm a tooltip</zap-tooltip>\n * ```\n */\nexport class ZapTooltipBind {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n onMouseEnter() {\n this.toggleTooltip(true);\n }\n\n onMouseLeave() {\n this.toggleTooltip(false);\n }\n\n private toggleTooltip(show: boolean) {\n const element = this.elementRef.nativeElement;\n const nextSibling = element.nextElementSibling;\n const prevSibling = element.previousElementSibling;\n\n if (nextSibling && nextSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(nextSibling, show);\n }\n\n if (prevSibling && prevSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(prevSibling, show);\n }\n }\n\n private updateSibling(sibling: Element, show: boolean) {\n this.renderer.setAttribute(sibling, 'zap-visible', String(show));\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\n\nimport { ZapSvg, ZapSvgConfig, ZapSvgInterface } from '@flexzap/symbols';\n\n/**\n * A shell component for creating modal dialogs.\n * Handles visibility, backdrop, and close interactions (click outside, escape key).\n *\n * @example\n * ```html\n * <zap-modal-shell [visible]=\"isOpen()\" (close)=\"onClose()\">\n * <div class=\"modal-content\">\n * <h2>Title</h2>\n * <p>Content...</p>\n * </div>\n * </zap-modal-shell>\n * ```\n */\n@Component({\n selector: 'zap-modal-shell',\n imports: [ZapSvg],\n templateUrl: './modal-shell.html',\n styleUrl: './modal-shell.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.zap-visible]': 'visible()',\n '(window:keydown.escape)': 'onKeyDown($event)'\n }\n})\nexport class ZapModalShell {\n /**\n * Whether the modal is visible.\n * Required.\n */\n visible = input.required<boolean>();\n\n /**\n * Event emitted when the modal should close.\n * Triggered by clicking the close button or pressing Escape.\n */\n close = output<void>();\n\n svgConfigIcon: ZapSvgInterface = ZapSvgConfig.createIcon();\n\n /**\n * Closes the modal by emitting the close event.\n */\n closeModal() {\n this.close.emit();\n }\n\n /**\n * Handles the Escape key press to close the modal.\n * @param e The keyboard event.\n */\n onKeyDown(e: Event) {\n const event = e as KeyboardEvent;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close.emit();\n }\n }\n}\n","<section class=\"zap-modal-shell\" (click)=\"closeModal()\">\n <div (click)=\"$event.stopPropagation()\">\n <button type=\"button\" (click)=\"closeModal()\">\n <zap-svg [name]=\"'close'\" [config]=\"svgConfigIcon\"></zap-svg>\n </button>\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n</section>\n","/*\n * Public API Surface of overlay\n */\n\nexport * from './lib/tooltip/index';\nexport * from './lib/tooltip-bind/index';\nexport * from './lib/modal-shell/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;AAUG;MAWU,UAAU,CAAA;AACrB;;;AAGG;AACH,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAuC;AAEhE;;;AAGG;AACH,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;uGAXX,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UA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.0",
4
4
  "description": "All the overlay components that makes part of the flexzap library",
5
5
  "keywords": [
6
6
  "flexzap",
@@ -1,8 +1,27 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ZapSvgInterface } from '@flexzap/symbols';
3
3
 
4
+ /**
5
+ * Component that displays a tooltip with text content.
6
+ * Positioned relative to a target element.
7
+ *
8
+ * @example
9
+ * ```html
10
+ * <zap-tooltip [position]="'top'" [visible]="true">
11
+ * Tooltip Content
12
+ * </zap-tooltip>
13
+ * ```
14
+ */
4
15
  declare class ZapTooltip {
16
+ /**
17
+ * The position of the tooltip relative to the target.
18
+ * Required.
19
+ */
5
20
  position: i0.InputSignal<"top" | "right" | "bottom" | "left">;
21
+ /**
22
+ * Whether the tooltip is currently visible.
23
+ * @default false
24
+ */
6
25
  visible: i0.InputSignal<boolean>;
7
26
  static ɵfac: i0.ɵɵFactoryDeclaration<ZapTooltip, never>;
8
27
  static ɵcmp: i0.ɵɵComponentDeclaration<ZapTooltip, "zap-tooltip", never, { "position": { "alias": "position"; "required": true; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
@@ -19,11 +38,40 @@ declare class ZapTooltipBind {
19
38
  static ɵdir: i0.ɵɵDirectiveDeclaration<ZapTooltipBind, "[ZapTooltipBind]", never, {}, {}, never, never, true, never>;
20
39
  }
21
40
 
41
+ /**
42
+ * A shell component for creating modal dialogs.
43
+ * Handles visibility, backdrop, and close interactions (click outside, escape key).
44
+ *
45
+ * @example
46
+ * ```html
47
+ * <zap-modal-shell [visible]="isOpen()" (close)="onClose()">
48
+ * <div class="modal-content">
49
+ * <h2>Title</h2>
50
+ * <p>Content...</p>
51
+ * </div>
52
+ * </zap-modal-shell>
53
+ * ```
54
+ */
22
55
  declare class ZapModalShell {
56
+ /**
57
+ * Whether the modal is visible.
58
+ * Required.
59
+ */
23
60
  visible: i0.InputSignal<boolean>;
61
+ /**
62
+ * Event emitted when the modal should close.
63
+ * Triggered by clicking the close button or pressing Escape.
64
+ */
24
65
  close: i0.OutputEmitterRef<void>;
25
66
  svgConfigIcon: ZapSvgInterface;
67
+ /**
68
+ * Closes the modal by emitting the close event.
69
+ */
26
70
  closeModal(): void;
71
+ /**
72
+ * Handles the Escape key press to close the modal.
73
+ * @param e The keyboard event.
74
+ */
27
75
  onKeyDown(e: Event): void;
28
76
  static ɵfac: i0.ɵɵFactoryDeclaration<ZapModalShell, never>;
29
77
  static ɵcmp: i0.ɵɵComponentDeclaration<ZapModalShell, "zap-modal-shell", never, { "visible": { "alias": "visible"; "required": true; "isSignal": true; }; }, { "close": "close"; }, never, ["*"], true, never>;