@wavelengthusaf/components 3.0.1 → 3.0.3

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.
@@ -321,14 +321,16 @@ interface WavelengthTitleBarProps {
321
321
  declare function WavelengthTitleBar({ titleText, subtitleText, textColor, textShadow }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
322
322
 
323
323
  interface WavelengthBannerProps {
324
- headerText?: string;
325
- headerColor?: string;
324
+ bannerText?: string;
325
+ bannerColor?: string;
326
326
  textColor?: string;
327
327
  opacity?: string | number;
328
328
  zIndex?: string | number;
329
329
  id?: string;
330
+ classification?: string;
331
+ control?: string[];
330
332
  }
331
- declare function WavelengthBanner({ headerText, headerColor, textColor, opacity, zIndex, id }: WavelengthBannerProps): react_jsx_runtime.JSX.Element;
333
+ declare function WavelengthBanner({ bannerText, bannerColor, textColor, opacity, zIndex, id, classification, control }: WavelengthBannerProps): react_jsx_runtime.JSX.Element;
332
334
 
333
335
  interface WavelengthAppLogoProps {
334
336
  width?: number;
@@ -584,4 +586,4 @@ interface SampleComponentProps extends React__default.HTMLAttributes<HTMLElement
584
586
  }
585
587
  declare const SampleComponent: React__default.FC<SampleComponentProps>;
586
588
 
587
- export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
589
+ export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
@@ -321,14 +321,16 @@ interface WavelengthTitleBarProps {
321
321
  declare function WavelengthTitleBar({ titleText, subtitleText, textColor, textShadow }: WavelengthTitleBarProps): react_jsx_runtime.JSX.Element;
322
322
 
323
323
  interface WavelengthBannerProps {
324
- headerText?: string;
325
- headerColor?: string;
324
+ bannerText?: string;
325
+ bannerColor?: string;
326
326
  textColor?: string;
327
327
  opacity?: string | number;
328
328
  zIndex?: string | number;
329
329
  id?: string;
330
+ classification?: string;
331
+ control?: string[];
330
332
  }
331
- declare function WavelengthBanner({ headerText, headerColor, textColor, opacity, zIndex, id }: WavelengthBannerProps): react_jsx_runtime.JSX.Element;
333
+ declare function WavelengthBanner({ bannerText, bannerColor, textColor, opacity, zIndex, id, classification, control }: WavelengthBannerProps): react_jsx_runtime.JSX.Element;
332
334
 
333
335
  interface WavelengthAppLogoProps {
334
336
  width?: number;
@@ -584,4 +586,4 @@ interface SampleComponentProps extends React__default.HTMLAttributes<HTMLElement
584
586
  }
585
587
  declare const SampleComponent: React__default.FC<SampleComponentProps>;
586
588
 
587
- export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
589
+ export { ButtonIcon, ButtonMenu, DefaultCarousel, DefaultPagination, SampleComponent, type SearchProps, type SearchResult, SliderCardCarousel, type StyledButtonPropsTwo, type ThemeProperties, WavelengthAccessAlert, WavelengthAlert, WavelengthAppLogo, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBanner, type WavelengthBannerProps, WavelengthBox, WavelengthButton, type WavelengthButtonProps, WavelengthCommentDisplay, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDataTable, WavelengthDefaultIcon, WavelengthDragAndDrop, WavelengthDropdown, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFileDownloader, WavelengthFooter, WavelengthManyPlanes, WavelengthNotAvailablePage, WavelengthPermissionAlert, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthProgressBar, type WavelengthProgressBarProps, WavelengthSearch, WavelengthSearchTextField, WavelengthSideBar, WavelengthSlider, WavelengthSnackbar, WavelengthSpinningLogo, WavelengthSpinningOuterCircle, WavelengthStandardSnackbar, WavelengthStyledButton, WavelengthTestSnackbar, WavelengthTextField, WavelengthTitleBar, add, ascendingRange, concat, findBestStringMatch, type menuItemProps, range, useOutsideClick, useThemeContext };
package/dist/esm/index.js CHANGED
@@ -1227,26 +1227,26 @@ if (!customElements.get("sample-component")) {
1227
1227
  // src/web-components/wavelength-banner.ts
1228
1228
  var WavelengthBanner = class extends HTMLElement {
1229
1229
  static get observedAttributes() {
1230
- return ["header-text", "header-color", "text-color", "opacity", "z-index", "id"];
1230
+ return ["banner-text", "banner-color", "text-color", "opacity", "z-index", "id", "classification", "control"];
1231
1231
  }
1232
1232
  constructor() {
1233
1233
  super();
1234
1234
  const shadow = this.attachShadow({ mode: "open" });
1235
1235
  const style3 = document.createElement("style");
1236
1236
  style3.textContent = `
1237
- :host {
1238
- display: block;
1239
- width: 100%;
1240
- }
1241
-
1242
- .banner {
1243
- width: 100%;
1244
- text-align: center;
1245
- font-weight: normal;
1246
- font-family: sans-serif;
1247
- font-size: 1rem;
1248
- }
1249
- `;
1237
+ :host {
1238
+ display: block;
1239
+ width: 100%;
1240
+ }
1241
+
1242
+ .banner {
1243
+ width: 100%;
1244
+ text-align: center;
1245
+ font-weight: normal;
1246
+ font-family: sans-serif;
1247
+ font-size: 1rem;
1248
+ }
1249
+ `;
1250
1250
  this.container = document.createElement("div");
1251
1251
  this.container.classList.add("banner");
1252
1252
  this.textElement = document.createElement("p");
@@ -1261,18 +1261,76 @@ var WavelengthBanner = class extends HTMLElement {
1261
1261
  this.updateAttributes();
1262
1262
  }
1263
1263
  updateAttributes() {
1264
- const headerText = this.getAttribute("header-text") || "CLASSIFICATION//CONTROL";
1265
- const headerColor = this.getAttribute("header-color") || "#4373aa";
1266
- const textColor = this.getAttribute("text-color") || "#ffffff";
1267
- const opacity = this.getAttribute("opacity") || "1";
1268
- const zIndex = this.getAttribute("z-index") || "10";
1269
- const id = this.getAttribute("id");
1270
- this.container.style.backgroundColor = headerColor;
1271
- this.container.style.opacity = opacity;
1272
- this.container.style.zIndex = zIndex;
1273
- if (id) this.container.id = id;
1274
- this.textElement.textContent = headerText.toUpperCase();
1275
- this.textElement.style.color = textColor;
1264
+ const classificationRaw = this.getAttribute("classification")?.toLowerCase() || "";
1265
+ const controlRaw = this.getAttribute("control") || "";
1266
+ const controlList = controlRaw.split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
1267
+ let bannerText = this.getAttribute("banner-text");
1268
+ const bannerColor = this.getAttribute("banner-color");
1269
+ const textColor = this.getAttribute("text-color");
1270
+ const palette2 = {
1271
+ primary: "#4373aa",
1272
+ secondary: "#ffffff"
1273
+ };
1274
+ let effectiveClassification = classificationRaw;
1275
+ let effectiveColor = palette2.primary;
1276
+ let effectiveTextColor = palette2.secondary;
1277
+ switch (classificationRaw) {
1278
+ case "unclassified":
1279
+ case "u":
1280
+ if (controlRaw) {
1281
+ effectiveColor = "#502b85";
1282
+ effectiveTextColor = "white";
1283
+ } else {
1284
+ effectiveColor = "#007a33";
1285
+ effectiveTextColor = "white";
1286
+ }
1287
+ break;
1288
+ case "controlled":
1289
+ case "controlled unclassified information":
1290
+ case "cui":
1291
+ effectiveColor = "#502b85";
1292
+ effectiveTextColor = "white";
1293
+ break;
1294
+ case "confidential":
1295
+ case "c":
1296
+ effectiveColor = "#0033a0";
1297
+ effectiveTextColor = "white";
1298
+ break;
1299
+ case "secret":
1300
+ case "s":
1301
+ effectiveColor = "#c8102e";
1302
+ effectiveTextColor = "white";
1303
+ break;
1304
+ case "top secret":
1305
+ case "ts":
1306
+ if (controlList.includes("sci")) {
1307
+ effectiveColor = "#fce83a";
1308
+ effectiveTextColor = "black";
1309
+ } else {
1310
+ effectiveColor = "#ff8c00";
1311
+ effectiveTextColor = "black";
1312
+ }
1313
+ break;
1314
+ case "":
1315
+ effectiveClassification = "CLASSIFICATION//CONTROL";
1316
+ break;
1317
+ default:
1318
+ effectiveColor = palette2.primary;
1319
+ effectiveTextColor = palette2.secondary;
1320
+ }
1321
+ if (!bannerText) {
1322
+ if (controlList.length === 0) {
1323
+ bannerText = effectiveClassification;
1324
+ } else {
1325
+ bannerText = `${effectiveClassification}//${controlList.join("/")}`;
1326
+ }
1327
+ }
1328
+ this.container.style.backgroundColor = bannerColor || effectiveColor;
1329
+ this.textElement.style.color = textColor || effectiveTextColor;
1330
+ this.container.style.opacity = this.getAttribute("opacity") || "1";
1331
+ this.container.style.zIndex = this.getAttribute("z-index") || "10";
1332
+ if (this.getAttribute("id")) this.container.id = this.getAttribute("id");
1333
+ this.textElement.textContent = bannerText.toUpperCase();
1276
1334
  }
1277
1335
  };
1278
1336
  if (!customElements.get("wavelength-banner")) {
@@ -5583,10 +5641,7 @@ function WavelengthAlert({
5583
5641
  /* @__PURE__ */ jsxs14("a", { href: url, style: { display: "flex", flexDirection: "column", gap: "4px", width: "250px", marginLeft: "12px", textDecoration: "none", color: baseContainerStyle.color }, children: [
5584
5642
  /* @__PURE__ */ jsx20("label", { style: { fontSize: "14px", lineHeight: "150%", letterSpacing: "0.15px", fontWeight: 500 }, children: timeStamp }),
5585
5643
  /* @__PURE__ */ jsx20("div", { style: { fontSize: "16px", fontWeight: 550, lineHeight: "24px" }, children: alertType }),
5586
- /* @__PURE__ */ jsxs14("div", { style: { fontSize: "14px", lineHeight: "20px", fontWeight: 400 }, children: [
5587
- "App: ",
5588
- appName
5589
- ] })
5644
+ /* @__PURE__ */ jsx20("div", { style: { fontSize: "14px", lineHeight: "20px", fontWeight: 400 }, children: appName })
5590
5645
  ] }),
5591
5646
  onClose && /* @__PURE__ */ jsx20(IconButton3, { sx: { padding: "0px", width: "20px" }, onClick: onClose, children: /* @__PURE__ */ jsx20(Close, {}) })
5592
5647
  ] });
@@ -5691,18 +5746,20 @@ function WavelengthTitleBar2({ titleText, subtitleText, textColor, textShadow })
5691
5746
  // src/components/headers/WavelengthTitleBar/WavelengthBanner.tsx
5692
5747
  import { useEffect as useEffect4, useRef as useRef5 } from "react";
5693
5748
  import { jsx as jsx23 } from "react/jsx-runtime";
5694
- function WavelengthBanner2({ headerText = "CLASSIFICATION//CONTROL", headerColor = "#000000", textColor = "#FFFFFF", opacity = 1, zIndex = 10, id }) {
5749
+ function WavelengthBanner2({ bannerText, bannerColor, textColor, opacity = 1, zIndex = 10, id, classification, control }) {
5695
5750
  const ref = useRef5(null);
5696
5751
  useEffect4(() => {
5697
- if (ref.current) {
5698
- ref.current.setAttribute("header-text", headerText);
5699
- ref.current.setAttribute("header-color", headerColor);
5700
- ref.current.setAttribute("text-color", textColor);
5701
- ref.current.setAttribute("opacity", String(opacity));
5702
- ref.current.setAttribute("z-index", String(zIndex));
5703
- if (id) ref.current.setAttribute("id", id);
5704
- }
5705
- }, [headerText, headerColor, textColor, opacity, zIndex, id]);
5752
+ if (!ref.current) return;
5753
+ const el = ref.current;
5754
+ if (bannerText !== void 0) el.setAttribute("banner-text", bannerText);
5755
+ if (bannerColor !== void 0) el.setAttribute("banner-color", bannerColor);
5756
+ if (textColor !== void 0) el.setAttribute("text-color", textColor);
5757
+ if (classification !== void 0) el.setAttribute("classification", classification);
5758
+ if (control !== void 0) el.setAttribute("control", String(control));
5759
+ if (opacity !== void 0) el.setAttribute("opacity", String(opacity));
5760
+ if (zIndex !== void 0) el.setAttribute("z-index", String(zIndex));
5761
+ if (id) el.setAttribute("id", id);
5762
+ }, [bannerText, bannerColor, textColor, classification, control, opacity, zIndex, id]);
5706
5763
  return /* @__PURE__ */ jsx23("wavelength-banner", { ref });
5707
5764
  }
5708
5765