@wavelengthusaf/components 2.9.3 → 2.10.1
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 +11 -0
- package/dist/cjs/index.cjs +154 -94
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +6 -1
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.js +153 -93
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,17 @@ npm install @wavelengthusaf/components
|
|
|
14
14
|
|
|
15
15
|
## Release Notes
|
|
16
16
|
|
|
17
|
+
### 2.10.1
|
|
18
|
+
|
|
19
|
+
- 5/13/2025
|
|
20
|
+
- Small fix to exports
|
|
21
|
+
|
|
22
|
+
### 2.10.0
|
|
23
|
+
|
|
24
|
+
- 5/13/2025
|
|
25
|
+
- Added Sample Component (skeleton)
|
|
26
|
+
- Added documentation for internal developers to create their own Web Components
|
|
27
|
+
|
|
17
28
|
### 2.9.3
|
|
18
29
|
|
|
19
30
|
- 5/06/2025
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1182,6 +1182,48 @@ var require_react_is2 = __commonJS({
|
|
|
1182
1182
|
}
|
|
1183
1183
|
});
|
|
1184
1184
|
|
|
1185
|
+
// src/web-components/sample-component.ts
|
|
1186
|
+
var template = document.createElement("template");
|
|
1187
|
+
template.innerHTML = `
|
|
1188
|
+
<style>
|
|
1189
|
+
:host {
|
|
1190
|
+
display: block;
|
|
1191
|
+
/* Define component defaults here */
|
|
1192
|
+
}
|
|
1193
|
+
</style>
|
|
1194
|
+
<div class="content">
|
|
1195
|
+
<slot></slot> <!-- Enables user-defined inner HTML -->
|
|
1196
|
+
</div>
|
|
1197
|
+
`;
|
|
1198
|
+
var SampleComponent = class extends HTMLElement {
|
|
1199
|
+
// List of attributes to observe for changes
|
|
1200
|
+
static get observedAttributes() {
|
|
1201
|
+
return ["test-prop"];
|
|
1202
|
+
}
|
|
1203
|
+
constructor() {
|
|
1204
|
+
super();
|
|
1205
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
1206
|
+
this.shadow.append(template.content.cloneNode(true));
|
|
1207
|
+
}
|
|
1208
|
+
// Called when component is inserted into the DOM
|
|
1209
|
+
connectedCallback() {
|
|
1210
|
+
this.updateComponent();
|
|
1211
|
+
}
|
|
1212
|
+
// Called when observed attributes change
|
|
1213
|
+
attributeChangedCallback() {
|
|
1214
|
+
this.updateComponent();
|
|
1215
|
+
}
|
|
1216
|
+
// Main update logic; Your component's functionality will go here and/or in other methods that you have below
|
|
1217
|
+
updateComponent() {
|
|
1218
|
+
const prop = this.getAttribute("test-prop") || "";
|
|
1219
|
+
const container = this.shadow.querySelector(".content");
|
|
1220
|
+
if (container) container.textContent = prop;
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
if (!customElements.get("sample-component")) {
|
|
1224
|
+
customElements.define("sample-component", SampleComponent);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1185
1227
|
// src/web-components/wavelength-banner.ts
|
|
1186
1228
|
var WavelengthBanner = class extends HTMLElement {
|
|
1187
1229
|
static get observedAttributes() {
|
|
@@ -1238,6 +1280,78 @@ if (!customElements.get("wavelength-banner")) {
|
|
|
1238
1280
|
}
|
|
1239
1281
|
|
|
1240
1282
|
// src/web-components/wavelength-button.ts
|
|
1283
|
+
var buttonTemplate = document.createElement("template");
|
|
1284
|
+
buttonTemplate.innerHTML = `
|
|
1285
|
+
<style>
|
|
1286
|
+
:host {
|
|
1287
|
+
display: inline-flex;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
button {
|
|
1291
|
+
display: inline-flex;
|
|
1292
|
+
align-items: center;
|
|
1293
|
+
justify-content: center;
|
|
1294
|
+
position: relative;
|
|
1295
|
+
overflow: hidden;
|
|
1296
|
+
border: none;
|
|
1297
|
+
border-radius: 0.25rem;
|
|
1298
|
+
cursor: pointer;
|
|
1299
|
+
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
|
|
1300
|
+
font-weight: 500;
|
|
1301
|
+
font-size: 0.875rem;
|
|
1302
|
+
letter-spacing: 0.02857rem;
|
|
1303
|
+
text-transform: uppercase;
|
|
1304
|
+
user-select: none;
|
|
1305
|
+
white-space: normal;
|
|
1306
|
+
word-break: break-word;
|
|
1307
|
+
text-align: center;
|
|
1308
|
+
height: auto;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
button .ripple {
|
|
1312
|
+
position: absolute;
|
|
1313
|
+
border-radius: 50%;
|
|
1314
|
+
transform: scale(0);
|
|
1315
|
+
animation: ripple 600ms linear;
|
|
1316
|
+
pointer-events: none;
|
|
1317
|
+
z-index: 0;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
button .label {
|
|
1321
|
+
position: relative;
|
|
1322
|
+
z-index: 1;
|
|
1323
|
+
display: block;
|
|
1324
|
+
width: 100%;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
@keyframes ripple {
|
|
1328
|
+
to {
|
|
1329
|
+
transform: scale(4);
|
|
1330
|
+
opacity: 0;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
button.contained {
|
|
1335
|
+
box-shadow: 0rem 0.125rem 0.25rem -0.063rem #000000;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
button.contained:hover,
|
|
1339
|
+
button.outlined:hover,
|
|
1340
|
+
button.text:hover {
|
|
1341
|
+
opacity: 0.96;
|
|
1342
|
+
transition: background-color 300ms ease-in-out;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
button:disabled {
|
|
1346
|
+
opacity: 0.5;
|
|
1347
|
+
pointer-events: none;
|
|
1348
|
+
}
|
|
1349
|
+
</style>
|
|
1350
|
+
|
|
1351
|
+
<button>
|
|
1352
|
+
<span class="label"><slot>LABEL</slot></span>
|
|
1353
|
+
</button>
|
|
1354
|
+
`;
|
|
1241
1355
|
var WavelengthButton = class extends HTMLElement {
|
|
1242
1356
|
constructor() {
|
|
1243
1357
|
super();
|
|
@@ -1246,76 +1360,14 @@ var WavelengthButton = class extends HTMLElement {
|
|
|
1246
1360
|
this.handleHoverOut = () => {
|
|
1247
1361
|
};
|
|
1248
1362
|
const shadow = this.attachShadow({ mode: "open" });
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
display: inline-flex;
|
|
1258
|
-
align-items: center;
|
|
1259
|
-
justify-content: center;
|
|
1260
|
-
position: relative;
|
|
1261
|
-
overflow: hidden;
|
|
1262
|
-
border: none;
|
|
1263
|
-
border-radius: 0.25rem;
|
|
1264
|
-
cursor: pointer;
|
|
1265
|
-
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
|
|
1266
|
-
font-weight: 500;
|
|
1267
|
-
font-size: 0.875rem;
|
|
1268
|
-
letter-spacing: 0.02857rem;
|
|
1269
|
-
text-transform: uppercase;
|
|
1270
|
-
user-select: none;
|
|
1271
|
-
white-space: normal;
|
|
1272
|
-
word-break: break-word;
|
|
1273
|
-
text-align: center;
|
|
1274
|
-
height: auto;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
button .ripple {
|
|
1278
|
-
position: absolute;
|
|
1279
|
-
border-radius: 50%;
|
|
1280
|
-
transform: scale(0);
|
|
1281
|
-
animation: ripple 600ms linear;
|
|
1282
|
-
pointer-events: none;
|
|
1283
|
-
z-index: 0;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
button .label {
|
|
1287
|
-
position: relative;
|
|
1288
|
-
z-index: 1;
|
|
1289
|
-
display: block;
|
|
1290
|
-
width: 100%;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
@keyframes ripple {
|
|
1294
|
-
to {
|
|
1295
|
-
transform: scale(4);
|
|
1296
|
-
opacity: 0;
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
button.contained {
|
|
1301
|
-
box-shadow: 0rem 0.125rem 0.25rem -0.063rem #000000;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
button.contained:hover,
|
|
1305
|
-
button.outlined:hover,
|
|
1306
|
-
button.text:hover {
|
|
1307
|
-
opacity: 0.96;
|
|
1308
|
-
transition: background-color 300ms ease-in-out;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
button:disabled {
|
|
1312
|
-
opacity: 0.5;
|
|
1313
|
-
pointer-events: none;
|
|
1314
|
-
}
|
|
1315
|
-
`;
|
|
1316
|
-
this.button.addEventListener("click", this.handleRipple.bind(this));
|
|
1317
|
-
shadow.appendChild(style3);
|
|
1318
|
-
shadow.appendChild(this.button);
|
|
1363
|
+
shadow.appendChild(buttonTemplate.content.cloneNode(true));
|
|
1364
|
+
this.button = shadow.querySelector("button");
|
|
1365
|
+
this.button.addEventListener("click", (event) => {
|
|
1366
|
+
this.handleRipple(event);
|
|
1367
|
+
if (!this.getAttribute("href")) {
|
|
1368
|
+
this.dispatchEvent(new MouseEvent("click", { bubbles: true, composed: true }));
|
|
1369
|
+
}
|
|
1370
|
+
});
|
|
1319
1371
|
}
|
|
1320
1372
|
static get observedAttributes() {
|
|
1321
1373
|
return ["variant", "size", "margin", "padding", "color-one", "color-two", "font-size", "disabled", "border-radius", "href", "width", "height", "box-shadow", "target"];
|
|
@@ -1352,15 +1404,8 @@ var WavelengthButton = class extends HTMLElement {
|
|
|
1352
1404
|
} else {
|
|
1353
1405
|
this.applyPresetSize(size);
|
|
1354
1406
|
}
|
|
1355
|
-
if (width2)
|
|
1356
|
-
|
|
1357
|
-
}
|
|
1358
|
-
if (height2) {
|
|
1359
|
-
this.button.style.height = height2;
|
|
1360
|
-
} else {
|
|
1361
|
-
this.button.style.height = "auto";
|
|
1362
|
-
}
|
|
1363
|
-
this.button.innerHTML = `<span class="label"><slot>LABEL</slot></span>`;
|
|
1407
|
+
if (width2) this.button.style.width = width2;
|
|
1408
|
+
this.button.style.height = height2;
|
|
1364
1409
|
if (variant === "contained") {
|
|
1365
1410
|
this.button.style.backgroundColor = colorOne;
|
|
1366
1411
|
this.button.style.color = colorTwo;
|
|
@@ -1371,7 +1416,7 @@ var WavelengthButton = class extends HTMLElement {
|
|
|
1371
1416
|
this.button.style.color = colorOne;
|
|
1372
1417
|
this.button.style.border = `0.063rem solid ${colorOne}`;
|
|
1373
1418
|
this.button.style.boxShadow = boxShadow || "none";
|
|
1374
|
-
} else
|
|
1419
|
+
} else {
|
|
1375
1420
|
this.button.style.backgroundColor = "transparent";
|
|
1376
1421
|
this.button.style.color = colorOne;
|
|
1377
1422
|
this.button.style.border = "none";
|
|
@@ -1388,7 +1433,7 @@ var WavelengthButton = class extends HTMLElement {
|
|
|
1388
1433
|
this.handleHoverIn = () => {
|
|
1389
1434
|
if (variant === "contained") {
|
|
1390
1435
|
this.button.style.backgroundColor = this.shadeColor(colorOne, -15);
|
|
1391
|
-
} else
|
|
1436
|
+
} else {
|
|
1392
1437
|
this.button.style.backgroundColor = this.hexToRgba(colorOne, 0.05);
|
|
1393
1438
|
}
|
|
1394
1439
|
};
|
|
@@ -1441,24 +1486,17 @@ var WavelengthButton = class extends HTMLElement {
|
|
|
1441
1486
|
if (this.button.disabled) return;
|
|
1442
1487
|
const variant = this.getAttribute("variant") || "outlined";
|
|
1443
1488
|
const colorOne = this.getAttribute("color-one") || "#1976D2";
|
|
1444
|
-
let rippleColor = "rgba(0,0,0,0.2)";
|
|
1445
|
-
if (variant === "contained") {
|
|
1446
|
-
rippleColor = this.hexToRgba(this.shadeColor(colorOne, 40), 0.6);
|
|
1447
|
-
} else {
|
|
1448
|
-
rippleColor = this.hexToRgba(this.shadeColor(colorOne, -40), 0.3);
|
|
1449
|
-
}
|
|
1450
1489
|
const ripple = document.createElement("span");
|
|
1451
1490
|
ripple.className = "ripple";
|
|
1452
|
-
|
|
1491
|
+
const color2 = variant === "contained" ? this.hexToRgba(this.shadeColor(colorOne, 40), 0.6) : this.hexToRgba(this.shadeColor(colorOne, -40), 0.3);
|
|
1492
|
+
ripple.style.backgroundColor = color2;
|
|
1453
1493
|
const rect = this.button.getBoundingClientRect();
|
|
1454
1494
|
const size = Math.max(rect.width, rect.height);
|
|
1455
1495
|
ripple.style.width = ripple.style.height = `${size}px`;
|
|
1456
1496
|
ripple.style.left = `${event.clientX - rect.left - size / 2}px`;
|
|
1457
1497
|
ripple.style.top = `${event.clientY - rect.top - size / 2}px`;
|
|
1458
1498
|
this.button.appendChild(ripple);
|
|
1459
|
-
setTimeout(() =>
|
|
1460
|
-
ripple.remove();
|
|
1461
|
-
}, 600);
|
|
1499
|
+
setTimeout(() => ripple.remove(), 600);
|
|
1462
1500
|
}
|
|
1463
1501
|
};
|
|
1464
1502
|
if (!customElements.get("wavelength-button")) {
|
|
@@ -1675,13 +1713,14 @@ var WavelengthButton2 = ({
|
|
|
1675
1713
|
setAttr("href", href);
|
|
1676
1714
|
setAttr("target", target);
|
|
1677
1715
|
setAttr("box-shadow", boxShadow);
|
|
1678
|
-
disabled
|
|
1716
|
+
if (disabled) el.setAttribute("disabled", "");
|
|
1717
|
+
else el.removeAttribute("disabled");
|
|
1679
1718
|
const handleClick = (e) => {
|
|
1680
1719
|
_optionalChain([onClick, 'optionalCall', _17 => _17(e)]);
|
|
1681
1720
|
};
|
|
1682
1721
|
el.addEventListener("click", handleClick);
|
|
1683
1722
|
return () => el.removeEventListener("click", handleClick);
|
|
1684
|
-
}, [variant, size, height2, width2, margin2, padding2, colorOne, colorTwo, fontSize, borderRadius2, disabled, href, onClick]);
|
|
1723
|
+
}, [variant, size, height2, width2, margin2, padding2, colorOne, colorTwo, fontSize, borderRadius2, disabled, href, onClick, boxShadow, target]);
|
|
1685
1724
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "wavelength-button", { ref, className, style: style3, ...rest, children });
|
|
1686
1725
|
};
|
|
1687
1726
|
|
|
@@ -7177,6 +7216,27 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
|
|
|
7177
7216
|
] });
|
|
7178
7217
|
};
|
|
7179
7218
|
|
|
7219
|
+
// src/components/samples/SampleComponent.tsx
|
|
7220
|
+
|
|
7221
|
+
|
|
7222
|
+
var SampleComponent2 = ({
|
|
7223
|
+
testProp,
|
|
7224
|
+
children,
|
|
7225
|
+
...rest
|
|
7226
|
+
// This rest operator includes className, style, onClick, etc.
|
|
7227
|
+
}) => {
|
|
7228
|
+
const ref = _react.useRef.call(void 0, null);
|
|
7229
|
+
_react.useEffect.call(void 0, () => {
|
|
7230
|
+
const el = ref.current;
|
|
7231
|
+
if (!el) return;
|
|
7232
|
+
if (testProp !== void 0) {
|
|
7233
|
+
el.setAttribute("test-prop", testProp);
|
|
7234
|
+
}
|
|
7235
|
+
}, [testProp]);
|
|
7236
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "sample-component", { ref, ...rest, children });
|
|
7237
|
+
};
|
|
7238
|
+
|
|
7239
|
+
|
|
7180
7240
|
|
|
7181
7241
|
|
|
7182
7242
|
|
|
@@ -7227,7 +7287,7 @@ var WavelengthDataTable = ({ data, columns, itemsPerPage, totalPages }) => {
|
|
|
7227
7287
|
|
|
7228
7288
|
|
|
7229
7289
|
|
|
7230
|
-
exports.AppLogo = AppLogo; exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.DefaultCarousel = DefaultCarousel; exports.DefaultIcon = DefaultIcon; exports.DefaultPagination = DefaultPagination; exports.ManyPlanesComponent = ManyPlanesComponent; exports.NotAvailablePage = NotAvailablePage; exports.SearchTextField = SearchTextField; exports.SliderCardCarousel = SliderCardCarousel; exports.TestSnackbar = TestSnackbar; exports.WavelengthAccessAlert = WavelengthAccessAlert; exports.WavelengthAlert = WavelengthAlert; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton2; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthPermissionAlert = WavelengthPermissionAlert; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
|
|
7290
|
+
exports.AppLogo = AppLogo; exports.ButtonIcon = ButtonIcon; exports.ButtonMenu = ButtonMenu; exports.DefaultCarousel = DefaultCarousel; exports.DefaultIcon = DefaultIcon; exports.DefaultPagination = DefaultPagination; exports.ManyPlanesComponent = ManyPlanesComponent; exports.NotAvailablePage = NotAvailablePage; exports.SampleComponent = SampleComponent2; exports.SearchTextField = SearchTextField; exports.SliderCardCarousel = SliderCardCarousel; exports.TestSnackbar = TestSnackbar; exports.WavelengthAccessAlert = WavelengthAccessAlert; exports.WavelengthAlert = WavelengthAlert; exports.WavelengthAppTheme = WavelengthAppTheme; exports.WavelengthAutocomplete = WavelengthAutocomplete; exports.WavelengthBanner = WavelengthBanner2; exports.WavelengthBox = WavelengthBox; exports.WavelengthButton = WavelengthButton2; exports.WavelengthCommentDisplay = WavelengthCommentDisplay; exports.WavelengthConfirmationModal = WavelengthConfirmationModal; exports.WavelengthContentModal = WavelengthContentModal; exports.WavelengthContentPlaceholder = WavelengthContentPlaceholder; exports.WavelengthDataTable = WavelengthDataTable; exports.WavelengthDragAndDrop = WavelengthDragAndDrop; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthDropdownButton = WavelengthDropdownButton; exports.WavelengthExampleComponent = WavelengthExampleComponent; exports.WavelengthFileDownloader = WavelengthFileDownloader; exports.WavelengthFooter = WavelengthFooter; exports.WavelengthPermissionAlert = WavelengthPermissionAlert; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthPopUpMenu = WavelengthPopUpMenu; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSearch = WavelengthSearch; exports.WavelengthSideBar = WavelengthSideBar; exports.WavelengthSlider = WavelengthSlider; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthSpinningLogo = WavelengthSpinningLogo; exports.WavelengthSpinningOuterCircle = WavelengthSpinningOuterCircle; exports.WavelengthStandardSnackbar = WavelengthStandardSnackbar; exports.WavelengthStyledButton = WavelengthStyledButton; exports.WavelengthTextField = WavelengthTextField; exports.WavelengthTitleBar = WavelengthTitleBar2; exports.add = add; exports.ascendingRange = ascendingRange; exports.concat = concat; exports.findBestStringMatch = findBestStringMatch; exports.range = range; exports.useOutsideClick = useOutsideClick; exports.useThemeContext = useThemeContext;
|
|
7231
7291
|
/*! Bundled license information:
|
|
7232
7292
|
|
|
7233
7293
|
react-is/cjs/react-is.production.min.js:
|