@balinasoftware/balinaui-components 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.
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# BalinauiComponents
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build balinaui-components
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/balinaui-components
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, EventEmitter, HostListener, Output, Input } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
class BalinauiComponents {
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: BalinauiComponents, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.0", type: BalinauiComponents, isStandalone: true, selector: "lib-balinaui-components", ngImport: i0, template: ` <p>balinaui-components works!</p> `, isInline: true, styles: [""] });
|
|
9
|
+
}
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: BalinauiComponents, decorators: [{
|
|
11
|
+
type: Component,
|
|
12
|
+
args: [{ selector: 'lib-balinaui-components', imports: [], template: ` <p>balinaui-components works!</p> ` }]
|
|
13
|
+
}] });
|
|
14
|
+
|
|
15
|
+
class Navbar {
|
|
16
|
+
elementRef;
|
|
17
|
+
brand = 'Aero';
|
|
18
|
+
links = ['Contact Us', 'Parameter'];
|
|
19
|
+
initiallyLoggedIn = false;
|
|
20
|
+
userName = 'Guest User';
|
|
21
|
+
userEmail = 'guest@example.com';
|
|
22
|
+
login = new EventEmitter();
|
|
23
|
+
logout = new EventEmitter();
|
|
24
|
+
isLoggedIn = false;
|
|
25
|
+
isDropdownOpen = false;
|
|
26
|
+
constructor(elementRef) {
|
|
27
|
+
this.elementRef = elementRef;
|
|
28
|
+
}
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
this.isLoggedIn = this.initiallyLoggedIn;
|
|
31
|
+
}
|
|
32
|
+
handleLoginClick() {
|
|
33
|
+
this.isLoggedIn = true;
|
|
34
|
+
this.login.emit();
|
|
35
|
+
}
|
|
36
|
+
handleProfileClick() {
|
|
37
|
+
this.isDropdownOpen = !this.isDropdownOpen;
|
|
38
|
+
}
|
|
39
|
+
handleLogoutClick() {
|
|
40
|
+
this.isLoggedIn = false;
|
|
41
|
+
this.isDropdownOpen = false;
|
|
42
|
+
this.logout.emit();
|
|
43
|
+
}
|
|
44
|
+
// Close the dropdown when clicking outside of it
|
|
45
|
+
onDocumentClick(event) {
|
|
46
|
+
if (this.isDropdownOpen && !this.elementRef.nativeElement.contains(event.target)) {
|
|
47
|
+
this.isDropdownOpen = false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Navbar, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.0", type: Navbar, isStandalone: true, selector: "lib-navbar", inputs: { brand: "brand", links: "links", initiallyLoggedIn: "initiallyLoggedIn", userName: "userName", userEmail: "userEmail" }, outputs: { login: "login", logout: "logout" }, host: { listeners: { "document:mousedown": "onDocumentClick($event)" } }, ngImport: i0, template: "<header class=\"anv-navbar\">\n <div class=\"anv-topbar\"></div>\n <div class=\"anv-stripes\">\n <div class=\"anv-content\">\n <div class=\"anv-brand\">\n <img src=\"assets/youtube.svg\" alt=\"Aero logo\" class=\"anv-brand-icon\" />\n </div>\n\n <nav class=\"anv-links\">\n <a *ngFor=\"let link of links\" href=\"#\" class=\"anv-link\">{{ link }}</a>\n </nav>\n\n <div class=\"anv-actions\">\n <button class=\"anv-icon-btn\" aria-label=\"Notifications\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>\n <path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>\n </svg>\n </button>\n\n <span class=\"anv-divider\"></span>\n\n <button *ngIf=\"!isLoggedIn\" class=\"anv-login-btn\" (click)=\"handleLoginClick()\">\n Login\n </button>\n\n <div *ngIf=\"isLoggedIn\" class=\"anv-profile-wrap\">\n <button\n class=\"anv-profile-btn\"\n (click)=\"handleProfileClick()\"\n [attr.aria-expanded]=\"isDropdownOpen\"\n aria-haspopup=\"true\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </button>\n\n <div *ngIf=\"isDropdownOpen\" class=\"anv-dropdown\">\n <div class=\"anv-dropdown-header\">\n <div class=\"anv-dropdown-avatar\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </div>\n <div class=\"anv-dropdown-info\">\n <span class=\"anv-dropdown-name\">{{ userName }}</span>\n <span class=\"anv-dropdown-email\">{{ userEmail }}</span>\n </div>\n </div>\n <hr class=\"anv-dropdown-sep\" />\n <button class=\"anv-dropdown-item anv-logout\" (click)=\"handleLogoutClick()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/>\n <polyline points=\"16 17 21 12 16 7\"/>\n <line x1=\"21\" y1=\"12\" x2=\"9\" y2=\"12\"/>\n </svg>\n Log out\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</header>", styles: [".anv-navbar{width:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.anv-topbar{height:6px;background:#2740a8;width:100%}.anv-stripes{width:100%;background-color:#fff;border-bottom:1px solid #e5e5e5}.anv-content{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:18px 32px;gap:24px}.anv-brand{display:flex;align-items:center;gap:8px}.anv-brand-icon{height:40px;width:auto;object-fit:contain}.anv-brand-name{font-weight:700;font-size:20px;color:#1f4d4a;letter-spacing:.3px}.anv-links{display:flex;align-items:center;gap:32px;margin-left:auto;margin-right:28px}.anv-link{color:#4a4a4a;font-weight:700;font-size:16px;text-decoration:none;white-space:nowrap;transition:opacity .15s ease}.anv-link:hover{opacity:.7}.anv-actions{display:flex;align-items:center;gap:18px}.anv-icon-btn{background:none;border:none;cursor:pointer;color:#1a1a1a;display:flex;align-items:center;justify-content:center;padding:4px;transition:opacity .15s ease}.anv-icon-btn:hover{opacity:.7}.anv-divider{width:1px;height:26px;background:#d9d9d9}.anv-login-btn{background:#1f4d4a;color:#fff;border:none;padding:9px 22px;border-radius:999px;font-weight:600;font-size:14px;cursor:pointer;transition:background .15s ease,transform .1s ease}.anv-login-btn:hover{background:#163836}.anv-login-btn:active{transform:scale(.97)}.anv-profile-wrap{position:relative}.anv-profile-btn{width:42px;height:42px;border-radius:50%;background:#111;color:#fff;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .1s ease}.anv-profile-btn:hover{transform:scale(1.05)}.anv-dropdown{position:absolute;top:calc(100% + 12px);right:0;background:#fff;border-radius:12px;box-shadow:0 8px 24px #00000026;min-width:220px;padding:8px;z-index:50;animation:anv-dropdown-in .15s ease}@keyframes anv-dropdown-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}.anv-dropdown-header{display:flex;align-items:center;gap:10px;padding:10px 8px}.anv-dropdown-avatar{width:38px;height:38px;border-radius:50%;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0}.anv-dropdown-info{display:flex;flex-direction:column;overflow:hidden}.anv-dropdown-name{font-weight:600;font-size:14px;color:#1a1a1a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.anv-dropdown-email{font-size:12px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.anv-dropdown-sep{border:none;border-top:1px solid #eeeeee;margin:4px 0}.anv-dropdown-item{width:100%;display:flex;align-items:center;gap:10px;background:none;border:none;padding:10px 8px;border-radius:8px;font-size:14px;font-weight:500;color:#1a1a1a;cursor:pointer;text-align:left;transition:background .15s ease}.anv-dropdown-item:hover{background:#f5f5f5}.anv-logout{color:#c0392b}@media(max-width:640px){.anv-content{padding:12px 16px;gap:12px}.anv-links{gap:16px;margin-right:12px}.anv-link{font-size:13px}.anv-brand-name{font-size:17px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Navbar, decorators: [{
|
|
54
|
+
type: Component,
|
|
55
|
+
args: [{ selector: 'lib-navbar', imports: [CommonModule], template: "<header class=\"anv-navbar\">\n <div class=\"anv-topbar\"></div>\n <div class=\"anv-stripes\">\n <div class=\"anv-content\">\n <div class=\"anv-brand\">\n <img src=\"assets/youtube.svg\" alt=\"Aero logo\" class=\"anv-brand-icon\" />\n </div>\n\n <nav class=\"anv-links\">\n <a *ngFor=\"let link of links\" href=\"#\" class=\"anv-link\">{{ link }}</a>\n </nav>\n\n <div class=\"anv-actions\">\n <button class=\"anv-icon-btn\" aria-label=\"Notifications\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>\n <path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>\n </svg>\n </button>\n\n <span class=\"anv-divider\"></span>\n\n <button *ngIf=\"!isLoggedIn\" class=\"anv-login-btn\" (click)=\"handleLoginClick()\">\n Login\n </button>\n\n <div *ngIf=\"isLoggedIn\" class=\"anv-profile-wrap\">\n <button\n class=\"anv-profile-btn\"\n (click)=\"handleProfileClick()\"\n [attr.aria-expanded]=\"isDropdownOpen\"\n aria-haspopup=\"true\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </button>\n\n <div *ngIf=\"isDropdownOpen\" class=\"anv-dropdown\">\n <div class=\"anv-dropdown-header\">\n <div class=\"anv-dropdown-avatar\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </div>\n <div class=\"anv-dropdown-info\">\n <span class=\"anv-dropdown-name\">{{ userName }}</span>\n <span class=\"anv-dropdown-email\">{{ userEmail }}</span>\n </div>\n </div>\n <hr class=\"anv-dropdown-sep\" />\n <button class=\"anv-dropdown-item anv-logout\" (click)=\"handleLogoutClick()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/>\n <polyline points=\"16 17 21 12 16 7\"/>\n <line x1=\"21\" y1=\"12\" x2=\"9\" y2=\"12\"/>\n </svg>\n Log out\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</header>", styles: [".anv-navbar{width:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.anv-topbar{height:6px;background:#2740a8;width:100%}.anv-stripes{width:100%;background-color:#fff;border-bottom:1px solid #e5e5e5}.anv-content{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:18px 32px;gap:24px}.anv-brand{display:flex;align-items:center;gap:8px}.anv-brand-icon{height:40px;width:auto;object-fit:contain}.anv-brand-name{font-weight:700;font-size:20px;color:#1f4d4a;letter-spacing:.3px}.anv-links{display:flex;align-items:center;gap:32px;margin-left:auto;margin-right:28px}.anv-link{color:#4a4a4a;font-weight:700;font-size:16px;text-decoration:none;white-space:nowrap;transition:opacity .15s ease}.anv-link:hover{opacity:.7}.anv-actions{display:flex;align-items:center;gap:18px}.anv-icon-btn{background:none;border:none;cursor:pointer;color:#1a1a1a;display:flex;align-items:center;justify-content:center;padding:4px;transition:opacity .15s ease}.anv-icon-btn:hover{opacity:.7}.anv-divider{width:1px;height:26px;background:#d9d9d9}.anv-login-btn{background:#1f4d4a;color:#fff;border:none;padding:9px 22px;border-radius:999px;font-weight:600;font-size:14px;cursor:pointer;transition:background .15s ease,transform .1s ease}.anv-login-btn:hover{background:#163836}.anv-login-btn:active{transform:scale(.97)}.anv-profile-wrap{position:relative}.anv-profile-btn{width:42px;height:42px;border-radius:50%;background:#111;color:#fff;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .1s ease}.anv-profile-btn:hover{transform:scale(1.05)}.anv-dropdown{position:absolute;top:calc(100% + 12px);right:0;background:#fff;border-radius:12px;box-shadow:0 8px 24px #00000026;min-width:220px;padding:8px;z-index:50;animation:anv-dropdown-in .15s ease}@keyframes anv-dropdown-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}.anv-dropdown-header{display:flex;align-items:center;gap:10px;padding:10px 8px}.anv-dropdown-avatar{width:38px;height:38px;border-radius:50%;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0}.anv-dropdown-info{display:flex;flex-direction:column;overflow:hidden}.anv-dropdown-name{font-weight:600;font-size:14px;color:#1a1a1a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.anv-dropdown-email{font-size:12px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.anv-dropdown-sep{border:none;border-top:1px solid #eeeeee;margin:4px 0}.anv-dropdown-item{width:100%;display:flex;align-items:center;gap:10px;background:none;border:none;padding:10px 8px;border-radius:8px;font-size:14px;font-weight:500;color:#1a1a1a;cursor:pointer;text-align:left;transition:background .15s ease}.anv-dropdown-item:hover{background:#f5f5f5}.anv-logout{color:#c0392b}@media(max-width:640px){.anv-content{padding:12px 16px;gap:12px}.anv-links{gap:16px;margin-right:12px}.anv-link{font-size:13px}.anv-brand-name{font-size:17px}}\n"] }]
|
|
56
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { brand: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], links: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], initiallyLoggedIn: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], userName: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], userEmail: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], login: [{
|
|
67
|
+
type: Output
|
|
68
|
+
}], logout: [{
|
|
69
|
+
type: Output
|
|
70
|
+
}], onDocumentClick: [{
|
|
71
|
+
type: HostListener,
|
|
72
|
+
args: ['document:mousedown', ['$event']]
|
|
73
|
+
}] } });
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Public API Surface of balinaui-components
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Generated bundle index. Do not edit.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
export { BalinauiComponents, Navbar };
|
|
84
|
+
//# sourceMappingURL=balinasoftware-balinaui-components.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balinasoftware-balinaui-components.mjs","sources":["../../../projects/balinaui-components/src/lib/balinaui-components.ts","../../../projects/balinaui-components/src/lib/navbar/navbar.ts","../../../projects/balinaui-components/src/lib/navbar/navbar.html","../../../projects/balinaui-components/src/public-api.ts","../../../projects/balinaui-components/src/balinasoftware-balinaui-components.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-balinaui-components',\n imports: [],\n template: ` <p>balinaui-components works!</p> `,\n styles: ``,\n})\nexport class BalinauiComponents {}\n","import { Component,ElementRef,HostListener,Input,Output,ViewEncapsulation, } from '@angular/core';\nimport { EventEmitter } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n@Component({\n selector: 'lib-navbar',\n imports: [CommonModule],\n templateUrl: './navbar.html',\n styleUrl: './navbar.css',\n})\nexport class Navbar {\n @Input() brand = 'Aero';\n @Input() links: string[] = ['Contact Us', 'Parameter'];\n @Input() initiallyLoggedIn = false;\n @Input() userName = 'Guest User';\n @Input() userEmail = 'guest@example.com';\n\n @Output() login = new EventEmitter();\n @Output() logout = new EventEmitter();\n\n isLoggedIn = false;\n isDropdownOpen = false;\n\n constructor(private elementRef: ElementRef) {}\n\n ngOnInit() {\n this.isLoggedIn = this.initiallyLoggedIn;\n }\n\n handleLoginClick() {\n this.isLoggedIn = true;\n this.login.emit();\n }\n\n handleProfileClick() {\n this.isDropdownOpen = !this.isDropdownOpen;\n }\n\n handleLogoutClick() {\n this.isLoggedIn = false;\n this.isDropdownOpen = false;\n this.logout.emit();\n }\n\n // Close the dropdown when clicking outside of it\n @HostListener('document:mousedown', ['$event'])\n onDocumentClick(event: MouseEvent) {\n if (this.isDropdownOpen && !this.elementRef.nativeElement.contains(event.target)) {\n this.isDropdownOpen = false;\n }\n }\n}\n","<header class=\"anv-navbar\">\n <div class=\"anv-topbar\"></div>\n <div class=\"anv-stripes\">\n <div class=\"anv-content\">\n <div class=\"anv-brand\">\n <img src=\"assets/youtube.svg\" alt=\"Aero logo\" class=\"anv-brand-icon\" />\n </div>\n\n <nav class=\"anv-links\">\n <a *ngFor=\"let link of links\" href=\"#\" class=\"anv-link\">{{ link }}</a>\n </nav>\n\n <div class=\"anv-actions\">\n <button class=\"anv-icon-btn\" aria-label=\"Notifications\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>\n <path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>\n </svg>\n </button>\n\n <span class=\"anv-divider\"></span>\n\n <button *ngIf=\"!isLoggedIn\" class=\"anv-login-btn\" (click)=\"handleLoginClick()\">\n Login\n </button>\n\n <div *ngIf=\"isLoggedIn\" class=\"anv-profile-wrap\">\n <button\n class=\"anv-profile-btn\"\n (click)=\"handleProfileClick()\"\n [attr.aria-expanded]=\"isDropdownOpen\"\n aria-haspopup=\"true\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </button>\n\n <div *ngIf=\"isDropdownOpen\" class=\"anv-dropdown\">\n <div class=\"anv-dropdown-header\">\n <div class=\"anv-dropdown-avatar\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n </svg>\n </div>\n <div class=\"anv-dropdown-info\">\n <span class=\"anv-dropdown-name\">{{ userName }}</span>\n <span class=\"anv-dropdown-email\">{{ userEmail }}</span>\n </div>\n </div>\n <hr class=\"anv-dropdown-sep\" />\n <button class=\"anv-dropdown-item anv-logout\" (click)=\"handleLogoutClick()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/>\n <polyline points=\"16 17 21 12 16 7\"/>\n <line x1=\"21\" y1=\"12\" x2=\"9\" y2=\"12\"/>\n </svg>\n Log out\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</header>","/*\n * Public API Surface of balinaui-components\n */\n\nexport * from './lib/balinaui-components';\nexport * from './lib/navbar/navbar';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,kBAAkB,CAAA;uGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,e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A,CAAA,EAAA,CAAA;;2FAIX,MAAM,EAAA,UAAA,EAAA,CAAA;kBANlB,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,k/FAAA,EAAA,MAAA,EAAA,CAAA,y9FAAA,CAAA,EAAA;;sBAKtB;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBA2BA,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE5ChD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@balinasoftware/balinaui-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^22.1.0",
|
|
6
|
+
"@angular/core": "^22.1.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/balinasoftware-balinaui-components.mjs",
|
|
13
|
+
"typings": "types/balinasoftware-balinaui-components.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/balinasoftware-balinaui-components.d.ts",
|
|
20
|
+
"default": "./fesm2022/balinasoftware-balinaui-components.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, ElementRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class BalinauiComponents {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BalinauiComponents, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BalinauiComponents, "lib-balinaui-components", never, {}, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare class Navbar {
|
|
10
|
+
private elementRef;
|
|
11
|
+
brand: string;
|
|
12
|
+
links: string[];
|
|
13
|
+
initiallyLoggedIn: boolean;
|
|
14
|
+
userName: string;
|
|
15
|
+
userEmail: string;
|
|
16
|
+
login: EventEmitter<any>;
|
|
17
|
+
logout: EventEmitter<any>;
|
|
18
|
+
isLoggedIn: boolean;
|
|
19
|
+
isDropdownOpen: boolean;
|
|
20
|
+
constructor(elementRef: ElementRef);
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
handleLoginClick(): void;
|
|
23
|
+
handleProfileClick(): void;
|
|
24
|
+
handleLogoutClick(): void;
|
|
25
|
+
onDocumentClick(event: MouseEvent): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Navbar, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Navbar, "lib-navbar", never, { "brand": { "alias": "brand"; "required": false; }; "links": { "alias": "links"; "required": false; }; "initiallyLoggedIn": { "alias": "initiallyLoggedIn"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; "userEmail": { "alias": "userEmail"; "required": false; }; }, { "login": "login"; "logout": "logout"; }, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { BalinauiComponents, Navbar };
|