@wavelengthusaf/components 3.3.9 → 3.3.11

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.
@@ -318,9 +318,9 @@ interface WavelengthTitleBarProps {
318
318
  titleText?: string;
319
319
  subtitleText?: string;
320
320
  textColor?: string;
321
- textShadow?: boolean;
321
+ shadowColor?: string;
322
322
  }
323
- declare function WavelengthTitleBar({ titleText, subtitleText, textColor, textShadow }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
323
+ declare function WavelengthTitleBar({ titleText, subtitleText, textColor, shadowColor }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
324
324
 
325
325
  interface WavelengthBannerProps {
326
326
  bannerText?: string;
@@ -318,9 +318,9 @@ interface WavelengthTitleBarProps {
318
318
  titleText?: string;
319
319
  subtitleText?: string;
320
320
  textColor?: string;
321
- textShadow?: boolean;
321
+ shadowColor?: string;
322
322
  }
323
- declare function WavelengthTitleBar({ titleText, subtitleText, textColor, textShadow }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
323
+ declare function WavelengthTitleBar({ titleText, subtitleText, textColor, shadowColor }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
324
324
 
325
325
  interface WavelengthBannerProps {
326
326
  bannerText?: string;
package/dist/esm/index.js CHANGED
@@ -1246,6 +1246,10 @@ var WavelengthBanner = class extends HTMLElement {
1246
1246
  font-family: sans-serif;
1247
1247
  font-size: 1rem;
1248
1248
  }
1249
+
1250
+ p {
1251
+ margin: 0;
1252
+ }
1249
1253
  `;
1250
1254
  this.container = document.createElement("div");
1251
1255
  this.container.classList.add("banner");
@@ -2300,6 +2304,7 @@ var WavelengthTitleBar = class extends HTMLElement {
2300
2304
  subtitle.classList.add("subtitle");
2301
2305
  subtitle.textContent = this.getAttribute("subtitle-text") || "Default Subtitle";
2302
2306
  const textColor = this.getAttribute("text-color") || "#34649b";
2307
+ const shadowColor = this.getAttribute("shadow-color");
2303
2308
  const style3 = document.createElement("style");
2304
2309
  style3.textContent = `
2305
2310
  :host {
@@ -2312,7 +2317,7 @@ var WavelengthTitleBar = class extends HTMLElement {
2312
2317
  .title {
2313
2318
  font-family: "Goldman", sans-serif;
2314
2319
  font-size: 3.75rem;
2315
- text-shadow: 0.313rem 0.313rem 0.375rem #FFFFFF;
2320
+ ${shadowColor ? `text-shadow: 0.313rem 0.313rem 0.375rem ${shadowColor};` : ""}
2316
2321
  -webkit-text-stroke: 1px black;
2317
2322
  letter-spacing: 0.07em;
2318
2323
  user-select: none;
@@ -2342,35 +2347,32 @@ var WavelengthTitleBar = class extends HTMLElement {
2342
2347
  }
2343
2348
  }
2344
2349
  static get observedAttributes() {
2345
- return ["title-text", "subtitle-text", "text-color", "has-shadow"];
2350
+ return ["title-text", "subtitle-text", "text-color", "shadow-color"];
2346
2351
  }
2347
2352
  attributeChangedCallback(name, oldValue, newValue) {
2348
- if (oldValue !== newValue) {
2349
- if (name === "title-text") {
2350
- const titleElement = this.shadowRoot?.querySelector(".title");
2351
- if (titleElement) {
2352
- titleElement.textContent = newValue;
2353
- }
2354
- } else if (name === "subtitle-text") {
2355
- const subtitleElement = this.shadowRoot?.querySelector(".subtitle");
2356
- if (subtitleElement) {
2357
- subtitleElement.textContent = newValue;
2358
- }
2359
- } else if (name === "text-color") {
2360
- const titleElement = this.shadowRoot?.querySelector(".title");
2361
- const subtitleElement = this.shadowRoot?.querySelector(".subtitle");
2362
- if (titleElement) {
2363
- titleElement.style.color = newValue;
2364
- }
2365
- if (subtitleElement) {
2366
- subtitleElement.style.color = newValue;
2367
- }
2368
- } else if (name === "has-shadow") {
2369
- const titleElement = this.shadowRoot?.querySelector(".title");
2353
+ if (oldValue === newValue) return;
2354
+ const titleElement = this.shadowRoot?.querySelector(".title");
2355
+ const subtitleElement = this.shadowRoot?.querySelector(".subtitle");
2356
+ switch (name) {
2357
+ case "title-text":
2358
+ if (titleElement) titleElement.textContent = newValue;
2359
+ break;
2360
+ case "subtitle-text":
2361
+ if (subtitleElement) subtitleElement.textContent = newValue;
2362
+ break;
2363
+ case "text-color":
2364
+ if (titleElement) titleElement.style.color = newValue;
2365
+ if (subtitleElement) subtitleElement.style.color = newValue;
2366
+ break;
2367
+ case "shadow-color":
2370
2368
  if (titleElement) {
2371
- titleElement.style.textShadow = newValue !== "false" ? "none" : "0.313rem 0.313rem 0.375rem #FFFFFF";
2369
+ if (newValue) {
2370
+ titleElement.style.textShadow = `0.313rem 0.313rem 0.375rem ${newValue}`;
2371
+ } else {
2372
+ titleElement.style.textShadow = "";
2373
+ }
2372
2374
  }
2373
- }
2375
+ break;
2374
2376
  }
2375
2377
  }
2376
2378
  };
@@ -6334,16 +6336,16 @@ function WavelengthFooter({ text, textColor }) {
6334
6336
  // src/components/headers/WavelengthTitleBar/WavelengthTitleBar.tsx
6335
6337
  import { useEffect as useEffect3, useRef as useRef4 } from "react";
6336
6338
  import { jsx as jsx22 } from "react/jsx-runtime";
6337
- function WavelengthTitleBar2({ titleText, subtitleText, textColor, textShadow }) {
6339
+ function WavelengthTitleBar2({ titleText, subtitleText, textColor, shadowColor }) {
6338
6340
  const ref = useRef4(null);
6339
6341
  useEffect3(() => {
6340
6342
  if (ref.current) {
6341
6343
  ref.current.setAttribute("title-text", titleText || "Default Title");
6342
6344
  ref.current.setAttribute("subtitle-text", subtitleText || "Default Subtitle");
6343
6345
  ref.current.setAttribute("text-color", textColor || "#34649b");
6344
- ref.current.setAttribute("has-shadow", textShadow ? "false" : "true");
6346
+ ref.current.setAttribute("shadow-color", shadowColor || "");
6345
6347
  }
6346
- }, [titleText, subtitleText, textColor, textShadow]);
6348
+ }, [titleText, subtitleText, textColor, shadowColor]);
6347
6349
  return /* @__PURE__ */ jsx22("wavelength-title-bar", { ref });
6348
6350
  }
6349
6351