@wavelengthusaf/web-components 1.7.0 → 1.8.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.
@@ -5755,6 +5755,7 @@ template6.innerHTML = `
5755
5755
  align-items: center;
5756
5756
  justify-content: space-between;
5757
5757
  cursor: pointer;
5758
+ box-sizing: border-box;
5758
5759
  border: 1px solid black;
5759
5760
  gap: 4px;
5760
5761
  padding: 0 8px;
@@ -5783,7 +5784,7 @@ template6.innerHTML = `
5783
5784
  }
5784
5785
 
5785
5786
  .options-list {
5786
- position: relative;
5787
+ position: absolute;
5787
5788
  left: 0;
5788
5789
  right: 0;
5789
5790
  margin: 0;
@@ -5822,7 +5823,26 @@ var WavelengthDropdown = class extends HTMLElement {
5822
5823
  this._selectedValue = this.getAttribute("default-value");
5823
5824
  }
5824
5825
  static get observedAttributes() {
5825
- return ["options", "default-value", "color", "font-size", "font-family", "border-radius", "width", "height", "arrow-size", "popup-radius", "popup-align", "popup-selected-color"];
5826
+ return [
5827
+ "options",
5828
+ "default-value",
5829
+ "color",
5830
+ "font-size",
5831
+ "font-family",
5832
+ "border-radius",
5833
+ "border-color",
5834
+ "width",
5835
+ "height",
5836
+ "arrow-size",
5837
+ "arrow-color",
5838
+ "popup-radius",
5839
+ "popup-align",
5840
+ "popup-selected-color",
5841
+ "popup-background-color",
5842
+ "popup-text-color",
5843
+ "popup-text-align",
5844
+ "popup-hover-background"
5845
+ ];
5826
5846
  }
5827
5847
  connectedCallback() {
5828
5848
  this.parseOptionsAttribute();
@@ -5869,10 +5889,11 @@ var WavelengthDropdown = class extends HTMLElement {
5869
5889
  li.style.textOverflow = "clip";
5870
5890
  li.style.fontSize = this.getAttribute("font-size") || this.style.fontSize || "inherit";
5871
5891
  li.style.fontFamily = this.getAttribute("font-family") || this.style.fontFamily || "inherit";
5872
- li.style.color = "#000";
5892
+ li.style.color = this.getAttribute("popup-text-color") || "#000";
5893
+ li.style.textAlign = this.getAttribute("popup-text-align") || "left";
5873
5894
  const originalBg = li.style.backgroundColor;
5874
5895
  li.addEventListener("mouseenter", () => {
5875
- li.style.backgroundColor = "#eee";
5896
+ li.style.backgroundColor = this.getAttribute("popup-hover-background") || "#eee";
5876
5897
  });
5877
5898
  li.addEventListener("mouseleave", () => {
5878
5899
  if (this._selectedValue === opt.value) {
@@ -5919,6 +5940,7 @@ var WavelengthDropdown = class extends HTMLElement {
5919
5940
  height: this.getAttribute("height") || style.height
5920
5941
  });
5921
5942
  Object.assign(this.dropdownField.style, {
5943
+ borderColor: this.getAttribute("border-color") || style.borderColor,
5922
5944
  borderRadius: this.getAttribute("border-radius") || style.borderRadius,
5923
5945
  fontSize: this.getAttribute("font-size") || style.fontSize,
5924
5946
  fontFamily: this.getAttribute("font-family") || style.fontFamily,
@@ -5927,6 +5949,7 @@ var WavelengthDropdown = class extends HTMLElement {
5927
5949
  this.dropdownBox.style.minWidth = this.getAttribute("width") || "auto";
5928
5950
  const arrow = this.dropdownField.querySelector(".arrow");
5929
5951
  arrow.style.padding = this.getAttribute("arrow-size") || "2px";
5952
+ arrow.style.background = this.getAttribute("arrow-color") || "black";
5930
5953
  this.optionsList.style.minWidth = "auto";
5931
5954
  const popupAlign = this.getAttribute("popup-align") || "left";
5932
5955
  switch (popupAlign) {
@@ -5947,7 +5970,7 @@ var WavelengthDropdown = class extends HTMLElement {
5947
5970
  this.optionsList.style.transform = "none";
5948
5971
  break;
5949
5972
  }
5950
- this.optionsList.style.backgroundColor = "white";
5973
+ this.optionsList.style.backgroundColor = this.getAttribute("popup-background-color") || "white";
5951
5974
  this.optionsList.style.borderRadius = this.getAttribute("popup-radius") || this.getAttribute("border-radius") || "4px";
5952
5975
  }
5953
5976
  get value() {
@@ -5972,6 +5995,60 @@ if (!customElements.get("wavelength-dropdown")) {
5972
5995
  customElements.define("wavelength-dropdown", WavelengthDropdown);
5973
5996
  }
5974
5997
 
5998
+ // src/web-components/wavelength-snackbar.template.html
5999
+ var wavelength_snackbar_template_default = '<style>\n :host {\n display: flex;\n position: fixed;\n z-index: 1000;\n top: 0;\n left: 0;\n height: 100vh;\n width: 100%;\n padding: 20px;\n box-sizing: border-box;\n pointer-events: none;\n opacity: 0;\n align-items: flex-end;\n transform: translateY(100px);\n justify-content: var(--justify-content, center);\n transition:\n opacity 0.3s ease-in-out,\n transform 0.3s ease-in-out;\n }\n\n :host([vertical-align="top"]) {\n align-items: flex-start;\n transform: translateY(-100px);\n }\n\n :host([vertical-align="center"]) {\n align-items: center;\n transform: scale(0.9);\n }\n\n :host([vertical-align="bottom"]) {\n align-items: flex-end;\n transform: translateY(100px);\n }\n\n :host(.show) {\n opacity: 1;\n transform: none;\n }\n\n #container {\n display: none;\n pointer-events: auto;\n background-color: var(--background-color, #333);\n color: var(--font-color, #fff);\n font-family: var(--font-family, Arial, sans-serif);\n font-size: var(--font-size, 16px);\n border: var(--border, none);\n padding: var(--padding, 16px);\n border-radius: var(--border-radius, 8px);\n width: var(--width, auto);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n text-align: center;\n }\n</style>\n\n<div id="container"></div>\n';
6000
+
6001
+ // src/web-components/wavelength-snackbar.ts
6002
+ var WavelengthSnackbar = class extends HTMLElement {
6003
+ static get observedAttributes() {
6004
+ return ["message", "background-color", "font-color", "font-family", "font-size", "border", "padding", "border-radius", "width", "horizontal-align", "duration"];
6005
+ }
6006
+ constructor() {
6007
+ super();
6008
+ this.attachShadow({ mode: "open" });
6009
+ }
6010
+ connectedCallback() {
6011
+ this.shadowRoot.innerHTML = wavelength_snackbar_template_default;
6012
+ this.snackbarElement = this.shadowRoot.querySelector("#container");
6013
+ this.render();
6014
+ }
6015
+ attributeChangedCallback(name, oldValue, newValue) {
6016
+ if (oldValue === newValue) return;
6017
+ this.render();
6018
+ if (name === "message" && newValue) this.show();
6019
+ }
6020
+ render() {
6021
+ if (!this.snackbarElement) return;
6022
+ const message = this.getAttribute("message") || "";
6023
+ this.snackbarElement.textContent = message;
6024
+ this.snackbarElement.style.display = message ? "block" : "none";
6025
+ const props = [
6026
+ ["--background-color", "background-color", "#333"],
6027
+ ["--font-color", "font-color", "#fff"],
6028
+ ["--font-family", "font-family", "Arial, sans-serif"],
6029
+ ["--font-size", "font-size", "16px"],
6030
+ ["--border", "border", "none"],
6031
+ ["--padding", "padding", "16px"],
6032
+ ["--border-radius", "border-radius", "8px"],
6033
+ ["--width", "width", "auto"],
6034
+ ["--justify-content", "horizontal-align", "center"]
6035
+ ];
6036
+ for (const [prop, attr, fallback] of props) {
6037
+ this.style.setProperty(prop, _nullishCoalesce(this.getAttribute(attr), () => ( fallback)));
6038
+ }
6039
+ }
6040
+ show(message, duration) {
6041
+ if (!this.snackbarElement) return;
6042
+ if (message) this.snackbarElement.textContent = message;
6043
+ const displayDuration = _nullishCoalesce(duration, () => ( parseInt(_nullishCoalesce(this.getAttribute("duration"), () => ( "3000")), 10)));
6044
+ this.classList.remove("show");
6045
+ void this.offsetWidth;
6046
+ this.classList.add("show");
6047
+ setTimeout(() => this.classList.remove("show"), displayDuration);
6048
+ }
6049
+ };
6050
+ customElements.define("wavelength-snackbar", WavelengthSnackbar);
6051
+
5975
6052
  // src/web-components/wavelength-planetrail.template.html
5976
6053
  var wavelength_planetrail_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n .flex-container {\n display: flex;\n align-items: center;\n }\n\n #inner {\n border-radius: 25px;\n height: 2px;\n flex-grow: 1;\n background-color: var(--color);\n }\n\n #path {\n fill: var(--color);\n }\n</style>\n\n<div id="outer" class="flex-container" >\n <div id="inner">\n </div>\n <div>\n <svg id="plane" width="40" height="40">\n <path\n d="M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"\n id="path"\n />\n </svg>\n </div>\n</div>\n';
5977
6054
 
@@ -6016,6 +6093,71 @@ if (!customElements.get("wavelength-planetrail")) {
6016
6093
  customElements.define("wavelength-planetrail", WavelengthPlaneTrail);
6017
6094
  }
6018
6095
 
6096
+ // src/web-components/wavelength-manyplanes.template.html
6097
+ var wavelength_manyplanes_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n #plane-container {\n display: flex;\n justify-content: flex-end;\n height: 40px;\n }\n</style>\n<div id="plane-container" class="flex-container"></div>';
6098
+
6099
+ // src/web-components/wavelength-manyplanes.ts
6100
+ var WavelengthManyPlanes = class extends HTMLElement {
6101
+ static get observedAttributes() {
6102
+ return ["number-of-planes", "trail-dir", "opacity", "color", "gradient", "spaced"];
6103
+ }
6104
+ constructor() {
6105
+ super();
6106
+ this.shadow = this.attachShadow({ mode: "open" });
6107
+ this.shadow.innerHTML = wavelength_manyplanes_template_default;
6108
+ }
6109
+ connectedCallback() {
6110
+ this.updateComponent();
6111
+ }
6112
+ attributeChangedCallback() {
6113
+ this.updateComponent();
6114
+ }
6115
+ updateComponent() {
6116
+ const numberOfPlanes = this.getAttribute("number-of-planes") || "5";
6117
+ const trailDir = this.getAttribute("trail-dir") || "right";
6118
+ const opacity = this.getAttribute("opacity") || "1";
6119
+ const color = this.getAttribute("color") || "#00308F";
6120
+ const gradient = this.getAttribute("gradient") || "false";
6121
+ const spaced = this.getAttribute("spaced") || "true";
6122
+ const planeContainer = this.shadow.getElementById("plane-container");
6123
+ if (planeContainer === null) {
6124
+ return;
6125
+ }
6126
+ planeContainer.replaceChildren();
6127
+ planeContainer.style.flexDirection = trailDir === "right" ? "row" : "row-reverse";
6128
+ planeContainer.style.justifyContent = spaced === "true" ? "space-between" : "flex-end";
6129
+ for (let i = 0; i < parseInt(numberOfPlanes); i++) {
6130
+ let currentPlaneOpacity = opacity;
6131
+ if (gradient === "true") {
6132
+ currentPlaneOpacity = (parseFloat(opacity) * ((i + 1) / parseInt(numberOfPlanes))).toString();
6133
+ }
6134
+ planeContainer.appendChild(this.createPlane(currentPlaneOpacity, color, trailDir === "right" ? false : true));
6135
+ }
6136
+ }
6137
+ createPlane(opacity, color, flipped) {
6138
+ const svgNS = "http://www.w3.org/2000/svg";
6139
+ const newPlane = document.createElementNS(svgNS, "svg");
6140
+ const planePath = document.createElementNS(svgNS, "path");
6141
+ newPlane.setAttribute("width", "40");
6142
+ newPlane.setAttribute("height", "40");
6143
+ newPlane.setAttribute("id", "planes");
6144
+ newPlane.setAttribute("transform", flipped ? "matrix(-1, 0, 0, 1, 0, 0)" : "");
6145
+ newPlane.setAttribute("opacity", opacity);
6146
+ newPlane.appendChild(planePath);
6147
+ planePath.setAttribute(
6148
+ "d",
6149
+ "M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"
6150
+ );
6151
+ planePath.setAttribute("fill", color);
6152
+ return newPlane;
6153
+ }
6154
+ };
6155
+ if (!customElements.get("wavelength-manyplanes")) {
6156
+ customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
6157
+ }
6158
+
6159
+
6160
+
6019
6161
 
6020
6162
 
6021
6163
 
@@ -6034,7 +6176,7 @@ if (!customElements.get("wavelength-planetrail")) {
6034
6176
 
6035
6177
 
6036
6178
 
6037
- exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthTitleBar = WavelengthTitleBar;
6179
+ exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthTitleBar = WavelengthTitleBar;
6038
6180
  /*! Bundled license information:
6039
6181
 
6040
6182
  react/cjs/react.production.min.js:
@@ -1852,6 +1852,16 @@ declare class WavelengthDropdown extends HTMLElement {
1852
1852
  set color(col: string);
1853
1853
  }
1854
1854
 
1855
+ declare class WavelengthSnackbar extends HTMLElement {
1856
+ static get observedAttributes(): string[];
1857
+ private snackbarElement;
1858
+ constructor();
1859
+ connectedCallback(): void;
1860
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
1861
+ private render;
1862
+ show(message?: string, duration?: number): void;
1863
+ }
1864
+
1855
1865
  declare class BasePlaneTrail extends HTMLElement {
1856
1866
  static get observedAttributes(): string[];
1857
1867
  private shadow;
@@ -2235,4 +2245,14 @@ declare const WavelengthPlaneTrail_base: {
2235
2245
  declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
2236
2246
  }
2237
2247
 
2238
- export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthTitleBar };
2248
+ declare class WavelengthManyPlanes extends HTMLElement {
2249
+ static get observedAttributes(): string[];
2250
+ private shadow;
2251
+ constructor();
2252
+ connectedCallback(): void;
2253
+ attributeChangedCallback(): void;
2254
+ updateComponent(): void;
2255
+ createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
2256
+ }
2257
+
2258
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
@@ -1852,6 +1852,16 @@ declare class WavelengthDropdown extends HTMLElement {
1852
1852
  set color(col: string);
1853
1853
  }
1854
1854
 
1855
+ declare class WavelengthSnackbar extends HTMLElement {
1856
+ static get observedAttributes(): string[];
1857
+ private snackbarElement;
1858
+ constructor();
1859
+ connectedCallback(): void;
1860
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
1861
+ private render;
1862
+ show(message?: string, duration?: number): void;
1863
+ }
1864
+
1855
1865
  declare class BasePlaneTrail extends HTMLElement {
1856
1866
  static get observedAttributes(): string[];
1857
1867
  private shadow;
@@ -2235,4 +2245,14 @@ declare const WavelengthPlaneTrail_base: {
2235
2245
  declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
2236
2246
  }
2237
2247
 
2238
- export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthTitleBar };
2248
+ declare class WavelengthManyPlanes extends HTMLElement {
2249
+ static get observedAttributes(): string[];
2250
+ private shadow;
2251
+ constructor();
2252
+ connectedCallback(): void;
2253
+ attributeChangedCallback(): void;
2254
+ updateComponent(): void;
2255
+ createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
2256
+ }
2257
+
2258
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
package/dist/esm/index.js CHANGED
@@ -5755,6 +5755,7 @@ template6.innerHTML = `
5755
5755
  align-items: center;
5756
5756
  justify-content: space-between;
5757
5757
  cursor: pointer;
5758
+ box-sizing: border-box;
5758
5759
  border: 1px solid black;
5759
5760
  gap: 4px;
5760
5761
  padding: 0 8px;
@@ -5783,7 +5784,7 @@ template6.innerHTML = `
5783
5784
  }
5784
5785
 
5785
5786
  .options-list {
5786
- position: relative;
5787
+ position: absolute;
5787
5788
  left: 0;
5788
5789
  right: 0;
5789
5790
  margin: 0;
@@ -5822,7 +5823,26 @@ var WavelengthDropdown = class extends HTMLElement {
5822
5823
  this._selectedValue = this.getAttribute("default-value");
5823
5824
  }
5824
5825
  static get observedAttributes() {
5825
- return ["options", "default-value", "color", "font-size", "font-family", "border-radius", "width", "height", "arrow-size", "popup-radius", "popup-align", "popup-selected-color"];
5826
+ return [
5827
+ "options",
5828
+ "default-value",
5829
+ "color",
5830
+ "font-size",
5831
+ "font-family",
5832
+ "border-radius",
5833
+ "border-color",
5834
+ "width",
5835
+ "height",
5836
+ "arrow-size",
5837
+ "arrow-color",
5838
+ "popup-radius",
5839
+ "popup-align",
5840
+ "popup-selected-color",
5841
+ "popup-background-color",
5842
+ "popup-text-color",
5843
+ "popup-text-align",
5844
+ "popup-hover-background"
5845
+ ];
5826
5846
  }
5827
5847
  connectedCallback() {
5828
5848
  this.parseOptionsAttribute();
@@ -5869,10 +5889,11 @@ var WavelengthDropdown = class extends HTMLElement {
5869
5889
  li.style.textOverflow = "clip";
5870
5890
  li.style.fontSize = this.getAttribute("font-size") || this.style.fontSize || "inherit";
5871
5891
  li.style.fontFamily = this.getAttribute("font-family") || this.style.fontFamily || "inherit";
5872
- li.style.color = "#000";
5892
+ li.style.color = this.getAttribute("popup-text-color") || "#000";
5893
+ li.style.textAlign = this.getAttribute("popup-text-align") || "left";
5873
5894
  const originalBg = li.style.backgroundColor;
5874
5895
  li.addEventListener("mouseenter", () => {
5875
- li.style.backgroundColor = "#eee";
5896
+ li.style.backgroundColor = this.getAttribute("popup-hover-background") || "#eee";
5876
5897
  });
5877
5898
  li.addEventListener("mouseleave", () => {
5878
5899
  if (this._selectedValue === opt.value) {
@@ -5919,6 +5940,7 @@ var WavelengthDropdown = class extends HTMLElement {
5919
5940
  height: this.getAttribute("height") || style.height
5920
5941
  });
5921
5942
  Object.assign(this.dropdownField.style, {
5943
+ borderColor: this.getAttribute("border-color") || style.borderColor,
5922
5944
  borderRadius: this.getAttribute("border-radius") || style.borderRadius,
5923
5945
  fontSize: this.getAttribute("font-size") || style.fontSize,
5924
5946
  fontFamily: this.getAttribute("font-family") || style.fontFamily,
@@ -5927,6 +5949,7 @@ var WavelengthDropdown = class extends HTMLElement {
5927
5949
  this.dropdownBox.style.minWidth = this.getAttribute("width") || "auto";
5928
5950
  const arrow = this.dropdownField.querySelector(".arrow");
5929
5951
  arrow.style.padding = this.getAttribute("arrow-size") || "2px";
5952
+ arrow.style.background = this.getAttribute("arrow-color") || "black";
5930
5953
  this.optionsList.style.minWidth = "auto";
5931
5954
  const popupAlign = this.getAttribute("popup-align") || "left";
5932
5955
  switch (popupAlign) {
@@ -5947,7 +5970,7 @@ var WavelengthDropdown = class extends HTMLElement {
5947
5970
  this.optionsList.style.transform = "none";
5948
5971
  break;
5949
5972
  }
5950
- this.optionsList.style.backgroundColor = "white";
5973
+ this.optionsList.style.backgroundColor = this.getAttribute("popup-background-color") || "white";
5951
5974
  this.optionsList.style.borderRadius = this.getAttribute("popup-radius") || this.getAttribute("border-radius") || "4px";
5952
5975
  }
5953
5976
  get value() {
@@ -5972,6 +5995,60 @@ if (!customElements.get("wavelength-dropdown")) {
5972
5995
  customElements.define("wavelength-dropdown", WavelengthDropdown);
5973
5996
  }
5974
5997
 
5998
+ // src/web-components/wavelength-snackbar.template.html
5999
+ var wavelength_snackbar_template_default = '<style>\n :host {\n display: flex;\n position: fixed;\n z-index: 1000;\n top: 0;\n left: 0;\n height: 100vh;\n width: 100%;\n padding: 20px;\n box-sizing: border-box;\n pointer-events: none;\n opacity: 0;\n align-items: flex-end;\n transform: translateY(100px);\n justify-content: var(--justify-content, center);\n transition:\n opacity 0.3s ease-in-out,\n transform 0.3s ease-in-out;\n }\n\n :host([vertical-align="top"]) {\n align-items: flex-start;\n transform: translateY(-100px);\n }\n\n :host([vertical-align="center"]) {\n align-items: center;\n transform: scale(0.9);\n }\n\n :host([vertical-align="bottom"]) {\n align-items: flex-end;\n transform: translateY(100px);\n }\n\n :host(.show) {\n opacity: 1;\n transform: none;\n }\n\n #container {\n display: none;\n pointer-events: auto;\n background-color: var(--background-color, #333);\n color: var(--font-color, #fff);\n font-family: var(--font-family, Arial, sans-serif);\n font-size: var(--font-size, 16px);\n border: var(--border, none);\n padding: var(--padding, 16px);\n border-radius: var(--border-radius, 8px);\n width: var(--width, auto);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n text-align: center;\n }\n</style>\n\n<div id="container"></div>\n';
6000
+
6001
+ // src/web-components/wavelength-snackbar.ts
6002
+ var WavelengthSnackbar = class extends HTMLElement {
6003
+ static get observedAttributes() {
6004
+ return ["message", "background-color", "font-color", "font-family", "font-size", "border", "padding", "border-radius", "width", "horizontal-align", "duration"];
6005
+ }
6006
+ constructor() {
6007
+ super();
6008
+ this.attachShadow({ mode: "open" });
6009
+ }
6010
+ connectedCallback() {
6011
+ this.shadowRoot.innerHTML = wavelength_snackbar_template_default;
6012
+ this.snackbarElement = this.shadowRoot.querySelector("#container");
6013
+ this.render();
6014
+ }
6015
+ attributeChangedCallback(name, oldValue, newValue) {
6016
+ if (oldValue === newValue) return;
6017
+ this.render();
6018
+ if (name === "message" && newValue) this.show();
6019
+ }
6020
+ render() {
6021
+ if (!this.snackbarElement) return;
6022
+ const message = this.getAttribute("message") || "";
6023
+ this.snackbarElement.textContent = message;
6024
+ this.snackbarElement.style.display = message ? "block" : "none";
6025
+ const props = [
6026
+ ["--background-color", "background-color", "#333"],
6027
+ ["--font-color", "font-color", "#fff"],
6028
+ ["--font-family", "font-family", "Arial, sans-serif"],
6029
+ ["--font-size", "font-size", "16px"],
6030
+ ["--border", "border", "none"],
6031
+ ["--padding", "padding", "16px"],
6032
+ ["--border-radius", "border-radius", "8px"],
6033
+ ["--width", "width", "auto"],
6034
+ ["--justify-content", "horizontal-align", "center"]
6035
+ ];
6036
+ for (const [prop, attr, fallback] of props) {
6037
+ this.style.setProperty(prop, this.getAttribute(attr) ?? fallback);
6038
+ }
6039
+ }
6040
+ show(message, duration) {
6041
+ if (!this.snackbarElement) return;
6042
+ if (message) this.snackbarElement.textContent = message;
6043
+ const displayDuration = duration ?? parseInt(this.getAttribute("duration") ?? "3000", 10);
6044
+ this.classList.remove("show");
6045
+ void this.offsetWidth;
6046
+ this.classList.add("show");
6047
+ setTimeout(() => this.classList.remove("show"), displayDuration);
6048
+ }
6049
+ };
6050
+ customElements.define("wavelength-snackbar", WavelengthSnackbar);
6051
+
5975
6052
  // src/web-components/wavelength-planetrail.template.html
5976
6053
  var wavelength_planetrail_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n .flex-container {\n display: flex;\n align-items: center;\n }\n\n #inner {\n border-radius: 25px;\n height: 2px;\n flex-grow: 1;\n background-color: var(--color);\n }\n\n #path {\n fill: var(--color);\n }\n</style>\n\n<div id="outer" class="flex-container" >\n <div id="inner">\n </div>\n <div>\n <svg id="plane" width="40" height="40">\n <path\n d="M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"\n id="path"\n />\n </svg>\n </div>\n</div>\n';
5977
6054
 
@@ -6015,6 +6092,69 @@ var WavelengthPlaneTrail = class extends StylingMixin(BasePlaneTrail) {
6015
6092
  if (!customElements.get("wavelength-planetrail")) {
6016
6093
  customElements.define("wavelength-planetrail", WavelengthPlaneTrail);
6017
6094
  }
6095
+
6096
+ // src/web-components/wavelength-manyplanes.template.html
6097
+ var wavelength_manyplanes_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n #plane-container {\n display: flex;\n justify-content: flex-end;\n height: 40px;\n }\n</style>\n<div id="plane-container" class="flex-container"></div>';
6098
+
6099
+ // src/web-components/wavelength-manyplanes.ts
6100
+ var WavelengthManyPlanes = class extends HTMLElement {
6101
+ static get observedAttributes() {
6102
+ return ["number-of-planes", "trail-dir", "opacity", "color", "gradient", "spaced"];
6103
+ }
6104
+ constructor() {
6105
+ super();
6106
+ this.shadow = this.attachShadow({ mode: "open" });
6107
+ this.shadow.innerHTML = wavelength_manyplanes_template_default;
6108
+ }
6109
+ connectedCallback() {
6110
+ this.updateComponent();
6111
+ }
6112
+ attributeChangedCallback() {
6113
+ this.updateComponent();
6114
+ }
6115
+ updateComponent() {
6116
+ const numberOfPlanes = this.getAttribute("number-of-planes") || "5";
6117
+ const trailDir = this.getAttribute("trail-dir") || "right";
6118
+ const opacity = this.getAttribute("opacity") || "1";
6119
+ const color = this.getAttribute("color") || "#00308F";
6120
+ const gradient = this.getAttribute("gradient") || "false";
6121
+ const spaced = this.getAttribute("spaced") || "true";
6122
+ const planeContainer = this.shadow.getElementById("plane-container");
6123
+ if (planeContainer === null) {
6124
+ return;
6125
+ }
6126
+ planeContainer.replaceChildren();
6127
+ planeContainer.style.flexDirection = trailDir === "right" ? "row" : "row-reverse";
6128
+ planeContainer.style.justifyContent = spaced === "true" ? "space-between" : "flex-end";
6129
+ for (let i = 0; i < parseInt(numberOfPlanes); i++) {
6130
+ let currentPlaneOpacity = opacity;
6131
+ if (gradient === "true") {
6132
+ currentPlaneOpacity = (parseFloat(opacity) * ((i + 1) / parseInt(numberOfPlanes))).toString();
6133
+ }
6134
+ planeContainer.appendChild(this.createPlane(currentPlaneOpacity, color, trailDir === "right" ? false : true));
6135
+ }
6136
+ }
6137
+ createPlane(opacity, color, flipped) {
6138
+ const svgNS = "http://www.w3.org/2000/svg";
6139
+ const newPlane = document.createElementNS(svgNS, "svg");
6140
+ const planePath = document.createElementNS(svgNS, "path");
6141
+ newPlane.setAttribute("width", "40");
6142
+ newPlane.setAttribute("height", "40");
6143
+ newPlane.setAttribute("id", "planes");
6144
+ newPlane.setAttribute("transform", flipped ? "matrix(-1, 0, 0, 1, 0, 0)" : "");
6145
+ newPlane.setAttribute("opacity", opacity);
6146
+ newPlane.appendChild(planePath);
6147
+ planePath.setAttribute(
6148
+ "d",
6149
+ "M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"
6150
+ );
6151
+ planePath.setAttribute("fill", color);
6152
+ return newPlane;
6153
+ }
6154
+ };
6155
+ if (!customElements.get("wavelength-manyplanes")) {
6156
+ customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
6157
+ }
6018
6158
  export {
6019
6159
  BaseWavelengthInput,
6020
6160
  BaseWavelengthMultiSelectAutocomplete,
@@ -6028,11 +6168,13 @@ export {
6028
6168
  WavelengthFileDropZone,
6029
6169
  WavelengthForm,
6030
6170
  WavelengthInput,
6171
+ WavelengthManyPlanes,
6031
6172
  WavelengthMultiSelectAutocomplete,
6032
6173
  WavelengthNavBar,
6033
6174
  WavelengthNotificationPanel,
6034
6175
  WavelengthPlaneTrail,
6035
6176
  WavelengthProgressBar,
6177
+ WavelengthSnackbar,
6036
6178
  WavelengthTitleBar
6037
6179
  };
6038
6180
  /*! Bundled license information:
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.7.0",
5
+ "version": "1.8.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",