@wavelengthusaf/web-components 1.1.0 → 1.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.
package/README.md CHANGED
@@ -14,6 +14,16 @@ npm install @wavelengthusaf/web-components
14
14
 
15
15
  ## Release Notes
16
16
 
17
+ ### 1.2.0
18
+
19
+ - 12/4/2025
20
+ - Added wavelength-nav-bar
21
+
22
+ ### 1.1.1
23
+
24
+ - 11/26/2025
25
+ - Updated wavelength-multi-select-autocomplete to wrap component definition
26
+
17
27
  ### 1.1.0
18
28
 
19
29
  - 10/22/2025
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/mixins/StylingMixin.ts
2
- function StylingMixin(Base) {
3
- return class extends Base {
2
+ function StylingMixin(mixinBaseClass) {
3
+ return class extends mixinBaseClass {
4
4
  constructor() {
5
5
  super(...arguments);
6
6
  // Use a specific ID for the injected style tag
@@ -2337,7 +2337,192 @@ var BaseWavelengthMultiSelectAutocomplete = class extends HTMLElement {
2337
2337
  BaseWavelengthMultiSelectAutocomplete.formAssociated = true;
2338
2338
  var WavelengthMultiSelectAutocomplete = class extends StylingMixin(BaseWavelengthMultiSelectAutocomplete) {
2339
2339
  };
2340
- customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSelectAutocomplete);
2340
+ if (!customElements.get("wavelength-multi-select-autocomplete")) {
2341
+ customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSelectAutocomplete);
2342
+ }
2343
+
2344
+ // src/web-components/wavelength-nav-bar.ts
2345
+ var template5 = document.createElement("template");
2346
+ template5.innerHTML = `
2347
+ <style>
2348
+ :host {
2349
+ display: block;
2350
+ font-family: sans-serif;
2351
+ }
2352
+
2353
+
2354
+ nav {
2355
+ display: flex;
2356
+ width: 100%;
2357
+ height: var(--height, 25px);
2358
+ padding: var(--padding, 1rem);
2359
+ border-bottom: var(--border, 1px solid #ddd);
2360
+ position: fixed;
2361
+ top: -25;
2362
+ z-index: 1000;
2363
+ background: var(--bg, #ffffffff);
2364
+ color: var(--txt, #000);
2365
+ gap:1rem;
2366
+ white-space: nowrap;
2367
+ align-items: center;
2368
+ justify-content: space-between;
2369
+ }
2370
+
2371
+ .flex-spacer {
2372
+ flex: 8;
2373
+ }
2374
+
2375
+ .home {
2376
+ flex: 1;
2377
+ justify-content: flex-start;
2378
+ cursor: pointer;
2379
+ display: flex;
2380
+ align-items: center;
2381
+ gap: 0.5rem;
2382
+ }
2383
+
2384
+ #logo svg {
2385
+ width: 28px;
2386
+ height: 28px;
2387
+ flex-shrink: 0;
2388
+ cursor: pointer;
2389
+ }
2390
+
2391
+ .tab {
2392
+ padding: 0.35rem 0.75rem;
2393
+ border: 1px solid #ffffffff;
2394
+ border-radius: 4px;
2395
+ text-align: center;
2396
+ cursor: pointer;
2397
+ background: #fff;
2398
+ }
2399
+
2400
+ .tab:hover {
2401
+ background: #f0f0f0; /* optional hover effect */
2402
+ }
2403
+
2404
+
2405
+ .settings {
2406
+ flex: 1;
2407
+ justify-content: flex-end;
2408
+ cursor: pointer;
2409
+ display: flex;
2410
+ align-items: center;
2411
+ gap: 0.5rem;
2412
+ }
2413
+
2414
+ .profile {
2415
+ padding: 0.5rem 0.75rem;
2416
+ border: 2px solid #ccc;
2417
+ border-radius: 6px;
2418
+ cursor: pointer;
2419
+ display: flex;
2420
+ flex-direction: column;
2421
+ text-align: center;
2422
+ }
2423
+
2424
+ .profile-name {
2425
+ font-weight: 600;
2426
+ }
2427
+
2428
+ .profile-note {
2429
+ font-size: 0.8rem;
2430
+ opacity: 0.75;
2431
+ }
2432
+
2433
+ .middle-tab-group {
2434
+ display: flex;
2435
+ align-items: center;
2436
+ gap: 0.5rem;
2437
+ flex: 3;
2438
+ }
2439
+ </style>
2440
+ <nav>
2441
+ <div class="section home" id="logo">
2442
+ <!-- Inline SVG to ensure universal compatibility -->
2443
+ <svg id="a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="280" height="280" viewBox="0 0 280 280">
2444
+ <defs>
2445
+ <style>
2446
+ .b {
2447
+ fill: #231f20;
2448
+ }
2449
+ .c {
2450
+ fill: #fff;
2451
+ }
2452
+ </style>
2453
+ </defs>
2454
+ <path class="b" d="M82.5,272.3c-8,.5-13.5-2-17.5-5.5s-34-47.5-36-50.5-2-2.5-2-7.5-1.5-122-1.5-122c1.5-5.5,7-17.5,18-16l72-3.5c1-3.5,4-4.5,4-4.5l-44.5-40.5c-5.5-5.5,1.5-11.5,6.5-7l46,41c4-1.5,10.5-2,15.5-1l38.5-44.5c5.5-5.5,12,0,8,5.5l-36,42.5c1.5,1,4,4.5,4.5,6l28-2c5.5,0,47.5,14,57,17s12,9,12,17-1.5,140-1.5,140c-2.7,12.3-10.5,19-27.5,20.5l-143.5,15Z"/>
2455
+ <path class="c" d="M240,113.3c.3-11.6-9.4-21-21-20.4l-122.5,6.4c-10.6.6-19,9.3-19,20v100.8c0,11.9,10.3,21.1,22.1,19.9l120.4-12.8c10-1.1,17.7-9.4,17.9-19.4l2.1-94.4Z"/>
2456
+ <ellipse class="c" cx="228.4" cy="241.6" rx="7" ry="6.5" transform="translate(-89 340.5) rotate(-63.9)"/>
2457
+ <path d="M132,217.5c-9.5,0-16.3-3.5-21-9.9-6-8.3-7.5-23.5-7.5-39.6s1-29.2,9.5-38.6c6-6.6,10-9.9,22-9.9s16.5,2.8,21,9.4c6.5,9.6,7.5,23.1,7.5,39.2s-.4,20.3-3.1,27.7c-2.7,7.3-6.3,12.8-11,16.4-4.7,3.6-11.3,5.4-17.4,5.4ZM132.5,200.4c5.2,0,7.8-2.9,10-8.8,1.5-6.6,2-11.9,2-23.7s0-17.6-1.5-24.2c-2.3-5.8-4.8-8.8-9.8-8.8-5.2,1.1-6.4,3.6-8.7,9.4-1.5,10.5-1.5,12.7-1.5,23.7s0,19.3,1.5,25.3c2.5,5,2.7,7.2,8,7.2Z"/>
2458
+ <path d="M172.7,209.3c-1.1-1.1-.5-12.3-.5-12.3,0,0,0-.6,1.1-1.1,5.9,0,10.1-1.6,10.7-2.8,1.1-1.1,1.6-1.3,1.6-3.9l.5-44.1c0-6.1-7-2.8-12.9-3.3-.5,0-1.1-.6-1.1-1.1v-12.8c3.7-.7,8-1.9,11.1-3.9,3.1-2,4.3-5.7,6.4-8.4l16.8-1.1-.5,73.1s.5,3.3,2.1,3.9c1.1.4,7.5.6,9.1.6s1.6,1.1,1.6,1.1c0,1.7.5,11.7,0,12.3,0,.6-45,5-46.1,3.9Z"/>
2459
+ </svg>
2460
+ <slot name="home"></slot>
2461
+ </div>
2462
+ <div class="flex-spacer"></div>
2463
+ <div class = "middle-tab-group">
2464
+ <div class="tab"><a href="/applications"><slot name="tab">Applications</slot></a></div>
2465
+ <div class="tab"><a href="/users"><slot name="tab">Users</slot></a></div>
2466
+ <div class="tab"><a href="/apikeys"><slot name="tab">API Keys</slot></a></div>
2467
+ </div>
2468
+ <div class="flex-spacer"></div>
2469
+ <div class="section settings">
2470
+ <div class="profile">
2471
+ <span class="profile-name">User</span>
2472
+ <span class="profile-note">Notifications</span>
2473
+ </div>
2474
+ </div>
2475
+ </nav>
2476
+ `;
2477
+ var WavelengthNavBar = class extends HTMLElement {
2478
+ static get observedAttributes() {
2479
+ return ["bg-color", "txt-color", "height", "padding", "border", "items"];
2480
+ }
2481
+ constructor() {
2482
+ super();
2483
+ const shadow = this.attachShadow({ mode: "open" });
2484
+ shadow.appendChild(template5.content.cloneNode(true));
2485
+ _optionalChain([shadow, 'access', _61 => _61.querySelector, 'call', _62 => _62("#logo"), 'optionalAccess', _63 => _63.addEventListener, 'call', _64 => _64("click", () => {
2486
+ this.dispatchEvent(new CustomEvent("home-click"));
2487
+ })]);
2488
+ }
2489
+ connectedCallback() {
2490
+ this.applyStyles();
2491
+ this.renderTabs();
2492
+ }
2493
+ attributeChangedCallback() {
2494
+ this.applyStyles();
2495
+ this.renderTabs();
2496
+ }
2497
+ applyStyles() {
2498
+ this.style.setProperty("--bg", this.getAttribute("bg-color") || "#fff");
2499
+ this.style.setProperty("--txt", this.getAttribute("txt-color") || "#000");
2500
+ this.style.setProperty("--height", this.getAttribute("height") || "60px");
2501
+ this.style.setProperty("--padding", this.getAttribute("padding") || "0 1rem");
2502
+ this.style.setProperty("--border", this.getAttribute("border") || "1px solid #ddd");
2503
+ }
2504
+ renderTabs() {
2505
+ const container = _optionalChain([this, 'access', _65 => _65.shadowRoot, 'optionalAccess', _66 => _66.querySelector, 'call', _67 => _67(".middle-tab-group")]);
2506
+ if (!container) return;
2507
+ container.innerHTML = "";
2508
+ const itemsAttr = this.getAttribute("items");
2509
+ const items = itemsAttr ? JSON.parse(itemsAttr) : [];
2510
+ items.forEach((item) => {
2511
+ const tab = document.createElement("div");
2512
+ tab.className = "tab";
2513
+ tab.textContent = item.title;
2514
+ if (item.path) {
2515
+ tab.addEventListener("click", () => {
2516
+ alert(`You clicked: ${item.title}`);
2517
+ });
2518
+ }
2519
+ container.appendChild(tab);
2520
+ });
2521
+ }
2522
+ };
2523
+ if (!customElements.get("wavelength-nav-bar")) {
2524
+ customElements.define("wavelength-nav-bar", WavelengthNavBar);
2525
+ }
2341
2526
 
2342
2527
 
2343
2528
 
@@ -2351,5 +2536,5 @@ customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSel
2351
2536
 
2352
2537
 
2353
2538
 
2354
- exports.BaseSampleComponent = BaseSampleComponent; exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthTitleBar = WavelengthTitleBar;
2539
+ exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthTitleBar = WavelengthTitleBar;
2355
2540
  //# sourceMappingURL=index.cjs.map
@@ -1359,4 +1359,13 @@ declare const WavelengthMultiSelectAutocomplete_base: {
1359
1359
  declare class WavelengthMultiSelectAutocomplete extends WavelengthMultiSelectAutocomplete_base {
1360
1360
  }
1361
1361
 
1362
- export { BaseSampleComponent, BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthDatePicker, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthProgressBar, WavelengthTitleBar };
1362
+ declare class WavelengthNavBar extends HTMLElement {
1363
+ static get observedAttributes(): string[];
1364
+ constructor();
1365
+ connectedCallback(): void;
1366
+ attributeChangedCallback(): void;
1367
+ private applyStyles;
1368
+ private renderTabs;
1369
+ }
1370
+
1371
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthDatePicker, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthProgressBar, WavelengthTitleBar };
@@ -1359,4 +1359,13 @@ declare const WavelengthMultiSelectAutocomplete_base: {
1359
1359
  declare class WavelengthMultiSelectAutocomplete extends WavelengthMultiSelectAutocomplete_base {
1360
1360
  }
1361
1361
 
1362
- export { BaseSampleComponent, BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthDatePicker, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthProgressBar, WavelengthTitleBar };
1362
+ declare class WavelengthNavBar extends HTMLElement {
1363
+ static get observedAttributes(): string[];
1364
+ constructor();
1365
+ connectedCallback(): void;
1366
+ attributeChangedCallback(): void;
1367
+ private applyStyles;
1368
+ private renderTabs;
1369
+ }
1370
+
1371
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthDatePicker, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthProgressBar, WavelengthTitleBar };
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/mixins/StylingMixin.ts
2
- function StylingMixin(Base) {
3
- return class extends Base {
2
+ function StylingMixin(mixinBaseClass) {
3
+ return class extends mixinBaseClass {
4
4
  constructor() {
5
5
  super(...arguments);
6
6
  // Use a specific ID for the injected style tag
@@ -2337,9 +2337,193 @@ var BaseWavelengthMultiSelectAutocomplete = class extends HTMLElement {
2337
2337
  BaseWavelengthMultiSelectAutocomplete.formAssociated = true;
2338
2338
  var WavelengthMultiSelectAutocomplete = class extends StylingMixin(BaseWavelengthMultiSelectAutocomplete) {
2339
2339
  };
2340
- customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSelectAutocomplete);
2340
+ if (!customElements.get("wavelength-multi-select-autocomplete")) {
2341
+ customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSelectAutocomplete);
2342
+ }
2343
+
2344
+ // src/web-components/wavelength-nav-bar.ts
2345
+ var template5 = document.createElement("template");
2346
+ template5.innerHTML = `
2347
+ <style>
2348
+ :host {
2349
+ display: block;
2350
+ font-family: sans-serif;
2351
+ }
2352
+
2353
+
2354
+ nav {
2355
+ display: flex;
2356
+ width: 100%;
2357
+ height: var(--height, 25px);
2358
+ padding: var(--padding, 1rem);
2359
+ border-bottom: var(--border, 1px solid #ddd);
2360
+ position: fixed;
2361
+ top: -25;
2362
+ z-index: 1000;
2363
+ background: var(--bg, #ffffffff);
2364
+ color: var(--txt, #000);
2365
+ gap:1rem;
2366
+ white-space: nowrap;
2367
+ align-items: center;
2368
+ justify-content: space-between;
2369
+ }
2370
+
2371
+ .flex-spacer {
2372
+ flex: 8;
2373
+ }
2374
+
2375
+ .home {
2376
+ flex: 1;
2377
+ justify-content: flex-start;
2378
+ cursor: pointer;
2379
+ display: flex;
2380
+ align-items: center;
2381
+ gap: 0.5rem;
2382
+ }
2383
+
2384
+ #logo svg {
2385
+ width: 28px;
2386
+ height: 28px;
2387
+ flex-shrink: 0;
2388
+ cursor: pointer;
2389
+ }
2390
+
2391
+ .tab {
2392
+ padding: 0.35rem 0.75rem;
2393
+ border: 1px solid #ffffffff;
2394
+ border-radius: 4px;
2395
+ text-align: center;
2396
+ cursor: pointer;
2397
+ background: #fff;
2398
+ }
2399
+
2400
+ .tab:hover {
2401
+ background: #f0f0f0; /* optional hover effect */
2402
+ }
2403
+
2404
+
2405
+ .settings {
2406
+ flex: 1;
2407
+ justify-content: flex-end;
2408
+ cursor: pointer;
2409
+ display: flex;
2410
+ align-items: center;
2411
+ gap: 0.5rem;
2412
+ }
2413
+
2414
+ .profile {
2415
+ padding: 0.5rem 0.75rem;
2416
+ border: 2px solid #ccc;
2417
+ border-radius: 6px;
2418
+ cursor: pointer;
2419
+ display: flex;
2420
+ flex-direction: column;
2421
+ text-align: center;
2422
+ }
2423
+
2424
+ .profile-name {
2425
+ font-weight: 600;
2426
+ }
2427
+
2428
+ .profile-note {
2429
+ font-size: 0.8rem;
2430
+ opacity: 0.75;
2431
+ }
2432
+
2433
+ .middle-tab-group {
2434
+ display: flex;
2435
+ align-items: center;
2436
+ gap: 0.5rem;
2437
+ flex: 3;
2438
+ }
2439
+ </style>
2440
+ <nav>
2441
+ <div class="section home" id="logo">
2442
+ <!-- Inline SVG to ensure universal compatibility -->
2443
+ <svg id="a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="280" height="280" viewBox="0 0 280 280">
2444
+ <defs>
2445
+ <style>
2446
+ .b {
2447
+ fill: #231f20;
2448
+ }
2449
+ .c {
2450
+ fill: #fff;
2451
+ }
2452
+ </style>
2453
+ </defs>
2454
+ <path class="b" d="M82.5,272.3c-8,.5-13.5-2-17.5-5.5s-34-47.5-36-50.5-2-2.5-2-7.5-1.5-122-1.5-122c1.5-5.5,7-17.5,18-16l72-3.5c1-3.5,4-4.5,4-4.5l-44.5-40.5c-5.5-5.5,1.5-11.5,6.5-7l46,41c4-1.5,10.5-2,15.5-1l38.5-44.5c5.5-5.5,12,0,8,5.5l-36,42.5c1.5,1,4,4.5,4.5,6l28-2c5.5,0,47.5,14,57,17s12,9,12,17-1.5,140-1.5,140c-2.7,12.3-10.5,19-27.5,20.5l-143.5,15Z"/>
2455
+ <path class="c" d="M240,113.3c.3-11.6-9.4-21-21-20.4l-122.5,6.4c-10.6.6-19,9.3-19,20v100.8c0,11.9,10.3,21.1,22.1,19.9l120.4-12.8c10-1.1,17.7-9.4,17.9-19.4l2.1-94.4Z"/>
2456
+ <ellipse class="c" cx="228.4" cy="241.6" rx="7" ry="6.5" transform="translate(-89 340.5) rotate(-63.9)"/>
2457
+ <path d="M132,217.5c-9.5,0-16.3-3.5-21-9.9-6-8.3-7.5-23.5-7.5-39.6s1-29.2,9.5-38.6c6-6.6,10-9.9,22-9.9s16.5,2.8,21,9.4c6.5,9.6,7.5,23.1,7.5,39.2s-.4,20.3-3.1,27.7c-2.7,7.3-6.3,12.8-11,16.4-4.7,3.6-11.3,5.4-17.4,5.4ZM132.5,200.4c5.2,0,7.8-2.9,10-8.8,1.5-6.6,2-11.9,2-23.7s0-17.6-1.5-24.2c-2.3-5.8-4.8-8.8-9.8-8.8-5.2,1.1-6.4,3.6-8.7,9.4-1.5,10.5-1.5,12.7-1.5,23.7s0,19.3,1.5,25.3c2.5,5,2.7,7.2,8,7.2Z"/>
2458
+ <path d="M172.7,209.3c-1.1-1.1-.5-12.3-.5-12.3,0,0,0-.6,1.1-1.1,5.9,0,10.1-1.6,10.7-2.8,1.1-1.1,1.6-1.3,1.6-3.9l.5-44.1c0-6.1-7-2.8-12.9-3.3-.5,0-1.1-.6-1.1-1.1v-12.8c3.7-.7,8-1.9,11.1-3.9,3.1-2,4.3-5.7,6.4-8.4l16.8-1.1-.5,73.1s.5,3.3,2.1,3.9c1.1.4,7.5.6,9.1.6s1.6,1.1,1.6,1.1c0,1.7.5,11.7,0,12.3,0,.6-45,5-46.1,3.9Z"/>
2459
+ </svg>
2460
+ <slot name="home"></slot>
2461
+ </div>
2462
+ <div class="flex-spacer"></div>
2463
+ <div class = "middle-tab-group">
2464
+ <div class="tab"><a href="/applications"><slot name="tab">Applications</slot></a></div>
2465
+ <div class="tab"><a href="/users"><slot name="tab">Users</slot></a></div>
2466
+ <div class="tab"><a href="/apikeys"><slot name="tab">API Keys</slot></a></div>
2467
+ </div>
2468
+ <div class="flex-spacer"></div>
2469
+ <div class="section settings">
2470
+ <div class="profile">
2471
+ <span class="profile-name">User</span>
2472
+ <span class="profile-note">Notifications</span>
2473
+ </div>
2474
+ </div>
2475
+ </nav>
2476
+ `;
2477
+ var WavelengthNavBar = class extends HTMLElement {
2478
+ static get observedAttributes() {
2479
+ return ["bg-color", "txt-color", "height", "padding", "border", "items"];
2480
+ }
2481
+ constructor() {
2482
+ super();
2483
+ const shadow = this.attachShadow({ mode: "open" });
2484
+ shadow.appendChild(template5.content.cloneNode(true));
2485
+ shadow.querySelector("#logo")?.addEventListener("click", () => {
2486
+ this.dispatchEvent(new CustomEvent("home-click"));
2487
+ });
2488
+ }
2489
+ connectedCallback() {
2490
+ this.applyStyles();
2491
+ this.renderTabs();
2492
+ }
2493
+ attributeChangedCallback() {
2494
+ this.applyStyles();
2495
+ this.renderTabs();
2496
+ }
2497
+ applyStyles() {
2498
+ this.style.setProperty("--bg", this.getAttribute("bg-color") || "#fff");
2499
+ this.style.setProperty("--txt", this.getAttribute("txt-color") || "#000");
2500
+ this.style.setProperty("--height", this.getAttribute("height") || "60px");
2501
+ this.style.setProperty("--padding", this.getAttribute("padding") || "0 1rem");
2502
+ this.style.setProperty("--border", this.getAttribute("border") || "1px solid #ddd");
2503
+ }
2504
+ renderTabs() {
2505
+ const container = this.shadowRoot?.querySelector(".middle-tab-group");
2506
+ if (!container) return;
2507
+ container.innerHTML = "";
2508
+ const itemsAttr = this.getAttribute("items");
2509
+ const items = itemsAttr ? JSON.parse(itemsAttr) : [];
2510
+ items.forEach((item) => {
2511
+ const tab = document.createElement("div");
2512
+ tab.className = "tab";
2513
+ tab.textContent = item.title;
2514
+ if (item.path) {
2515
+ tab.addEventListener("click", () => {
2516
+ alert(`You clicked: ${item.title}`);
2517
+ });
2518
+ }
2519
+ container.appendChild(tab);
2520
+ });
2521
+ }
2522
+ };
2523
+ if (!customElements.get("wavelength-nav-bar")) {
2524
+ customElements.define("wavelength-nav-bar", WavelengthNavBar);
2525
+ }
2341
2526
  export {
2342
- BaseSampleComponent,
2343
2527
  BaseWavelengthInput,
2344
2528
  BaseWavelengthMultiSelectAutocomplete,
2345
2529
  SampleComponent,
@@ -2349,6 +2533,7 @@ export {
2349
2533
  WavelengthForm,
2350
2534
  WavelengthInput,
2351
2535
  WavelengthMultiSelectAutocomplete,
2536
+ WavelengthNavBar,
2352
2537
  WavelengthProgressBar,
2353
2538
  WavelengthTitleBar
2354
2539
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wavelengthusaf/web-components",
3
3
  "author": "563 EWS - Wavelength",
4
4
  "license": "MIT",
5
- "version": "1.1.0",
5
+ "version": "1.2.0",
6
6
  "description": "Common component library used by Wavelength developers (NATIVE WEB COMPONENTS)",
7
7
  "main": "/dist/cjs/index.cjs",
8
8
  "module": "/dist/esm/index.js",