@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.
- package/README.md +9 -0
- package/dist/cjs/index.cjs +54 -52
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +31 -29
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.d.cts
CHANGED
|
@@ -318,9 +318,9 @@ interface WavelengthTitleBarProps {
|
|
|
318
318
|
titleText?: string;
|
|
319
319
|
subtitleText?: string;
|
|
320
320
|
textColor?: string;
|
|
321
|
-
|
|
321
|
+
shadowColor?: string;
|
|
322
322
|
}
|
|
323
|
-
declare function WavelengthTitleBar({ titleText, subtitleText, textColor,
|
|
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.d.ts
CHANGED
|
@@ -318,9 +318,9 @@ interface WavelengthTitleBarProps {
|
|
|
318
318
|
titleText?: string;
|
|
319
319
|
subtitleText?: string;
|
|
320
320
|
textColor?: string;
|
|
321
|
-
|
|
321
|
+
shadowColor?: string;
|
|
322
322
|
}
|
|
323
|
-
declare function WavelengthTitleBar({ titleText, subtitleText, textColor,
|
|
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
|
|
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", "
|
|
2350
|
+
return ["title-text", "subtitle-text", "text-color", "shadow-color"];
|
|
2346
2351
|
}
|
|
2347
2352
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2348
|
-
if (oldValue
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
if (subtitleElement)
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
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
|
-
|
|
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,
|
|
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("
|
|
6346
|
+
ref.current.setAttribute("shadow-color", shadowColor || "");
|
|
6345
6347
|
}
|
|
6346
|
-
}, [titleText, subtitleText, textColor,
|
|
6348
|
+
}, [titleText, subtitleText, textColor, shadowColor]);
|
|
6347
6349
|
return /* @__PURE__ */ jsx22("wavelength-title-bar", { ref });
|
|
6348
6350
|
}
|
|
6349
6351
|
|