@spscommerce/ds-web-components 7.10.8 → 7.11.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.
@@ -2,7 +2,8 @@ var it = Object.defineProperty;
2
2
  var rt = (e, t, s) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var a = (e, t, s) => (rt(e, typeof t != "symbol" ? t + "" : t, s), s);
4
4
  import { noI18nI18n as at, SpsIcon as Se, SpsInsightCardKind as ot, SpsInsightCardIcons as lt } from "@spscommerce/ds-shared";
5
- import { code as c, parseFileSize as ct } from "@spscommerce/utils";
5
+ import { parseFileSize as ct, code as c } from "@spscommerce/utils";
6
+ const _s = {};
6
7
  var h = {};
7
8
  Object.defineProperty(h, "__esModule", { value: !0 });
8
9
  /**
@@ -904,259 +905,14 @@ function et() {
904
905
  });
905
906
  };
906
907
  }
907
- var rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, E = (e, t, s, n) => {
908
+ var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
908
909
  for (var i = n > 1 ? void 0 : n ? as(t, s) : t, r = e.length - 1, l; r >= 0; r--)
909
910
  (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
910
911
  return n && i && rs(t, s, i), i;
911
- }, os = /* @__PURE__ */ ((e) => (e.FIT = "fit", e.FILL = "fill", e))(os || {});
912
- const F = "sps-photo";
913
- var q;
914
- let O = (q = class extends HTMLElement {
915
- constructor() {
916
- super(...arguments);
917
- a(this, "src");
918
- a(this, "altText");
919
- a(this, "mode", "fill");
920
- a(this, "placeholderIcon");
921
- a(this, "width");
922
- a(this, "fitWidth");
923
- a(this, "imageInternal");
924
- a(this, "waitForWidthInterval");
925
- a(this, "waitForImgHeightInterval");
926
- }
927
- get image() {
928
- return this.imageInternal;
929
- }
930
- set image(t) {
931
- this.imageInternal = t, t && (this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval), this.waitForImgHeightInterval = window.setInterval(() => {
932
- const s = t.getBoundingClientRect();
933
- if (s.height) {
934
- window.clearInterval(this.waitForImgHeightInterval), delete this.waitForImgHeightInterval;
935
- let n = !0;
936
- n = s.width / s.height > 1, this.fitWidth = n === (this.mode === "fit");
937
- }
938
- }, 1e3 / 60));
939
- }
940
- get [T]() {
941
- return [
942
- F,
943
- this.fitWidth ? `${F}--fit-width` : `${F}--fit-height`,
944
- this.placeholderIcon && `${F}--placeholder`
945
- ];
946
- }
947
- get [he]() {
948
- return {
949
- fontSize: `${this.width * 0.05}rem`,
950
- width: `${this.width}rem`,
951
- height: `${0.75 * this.width}rem`
952
- };
953
- }
954
- connectedCallback() {
955
- this.waitForWidthInterval = window.setInterval(() => {
956
- const t = this.getBoundingClientRect();
957
- t.width && (this.setWidth(t.width), window.clearInterval(this.waitForWidthInterval), delete this.waitForWidthInterval);
958
- }, 1e3 / 60);
959
- }
960
- disconnectedCallback() {
961
- this.waitForWidthInterval && window.clearInterval(this.waitForWidthInterval), this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval);
962
- }
963
- render() {
964
- return this.src ? this.width ? /* @__PURE__ */ o("img", {
965
- src: this.src,
966
- alt: this.altText
967
- }) : /* @__PURE__ */ o("span", null) : /* @__PURE__ */ o("i", {
968
- className: `sps-icon sps-icon-${this.placeholderIcon}`
969
- });
970
- }
971
- setWidth(t) {
972
- if (t && !this.width) {
973
- const s = document.body.parentElement.style.fontSize || "16px", n = Number(s.substr(0, s.length - 2));
974
- this.width = t / n;
975
- }
976
- }
977
- }, a(q, "displayName", F), a(q, "props", {
978
- src: "string",
979
- altText: "string",
980
- mode: "SpsPhotoDisplayMode",
981
- placeholderIcon: "SpsIcon"
982
- }), q);
983
- E([
984
- p()
985
- ], O.prototype, "src", 2);
986
- E([
987
- p()
988
- ], O.prototype, "altText", 2);
989
- E([
990
- p()
991
- ], O.prototype, "mode", 2);
992
- E([
993
- p()
994
- ], O.prototype, "placeholderIcon", 2);
995
- E([
996
- et()
997
- ], O.prototype, "width", 2);
998
- E([
999
- et()
1000
- ], O.prototype, "fitWidth", 2);
1001
- E([
1002
- xe("img", { refresh: !0 })
1003
- ], O.prototype, "image", 1);
1004
- O = E([
1005
- j({ tag: F })
1006
- ], O);
1007
- const ls = {
1008
- sizing: {
1009
- label: "Sizing",
1010
- description: c`
1011
- <p>
1012
- Photos are block elements, so a photo fills its container's width unless
1013
- an explicit width is set. It is always a 4:3 aspect ratio. In this example,
1014
- photos have been placed in cards which have different widths in the 12
1015
- column grid.
1016
- </p>
1017
- `,
1018
- examples: {
1019
- basic: {
1020
- jsx: c`
1021
- <div className="sfg-row">
1022
- <div className="sfg-col-2">
1023
- <sps-card>
1024
- <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
1025
- </sps-card>
1026
- </div>
1027
- <div className="sfg-col-4">
1028
- <sps-card>
1029
- <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
1030
- </sps-card>
1031
- </div>
1032
- <div className="sfg-col-6">
1033
- <sps-card>
1034
- <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
1035
- </sps-card>
1036
- </div>
1037
- </div>
1038
- `
1039
- }
1040
- }
1041
- },
1042
- displayMode: {
1043
- label: "Fill vs. Fit",
1044
- description: c`
1045
- <p>
1046
- There are two display modes available:
1047
- <ul>
1048
- <li><b>"fill"</b> fills the entire 4:3 container, cropping off any excess portions of the image.
1049
- <li><b>"fit"</b> fits the entire image into the container, leaving any excess portions of the container blank.
1050
- </ul>
1051
- </p>
1052
- `,
1053
- examples: {
1054
- landscape: {
1055
- description: "<p>Landscape oriented photo (container outline added for illustrative purposes)</p>",
1056
- jsx: c`
1057
- <div className="sfg-row">
1058
- <div className="sfg-col-4">
1059
- <sps-photo src="assets/images/photo-landscape.jpg" mode="fill"></sps-photo>
1060
- </div>
1061
- <div className="sfg-col-4">
1062
- <sps-photo src="assets/images/photo-landscape.jpg" mode="fit"></sps-photo>
1063
- </div>
1064
- </div>
1065
- `
1066
- },
1067
- portrait: {
1068
- description: "<p>Portrait oriented photo (container outline added for illustrative purposes)</p>",
1069
- jsx: c`
1070
- <div className="sfg-row">
1071
- <div className="sfg-col-4">
1072
- <sps-photo src="assets/images/photo-portrait.jpg" mode="fill"></sps-photo>
1073
- </div>
1074
- <div className="sfg-col-4">
1075
- <sps-photo id="foo" src="assets/images/photo-portrait.jpg" mode="fit"></sps-photo>
1076
- </div>
1077
- </div>
1078
- `
1079
- }
1080
- }
1081
- },
1082
- placeholder: {
1083
- label: "Placeholders",
1084
- description: c`
1085
- <p>
1086
- When an image is not provided for a particular use case (such as a user avatar,
1087
- a company photo, item image, etc.), a placeholder should be shown in its place.
1088
-
1089
- The placeholder's icon, selected from our SPS icon set, should represent the
1090
- type of image it is substituting for.
1091
- </p>
1092
- `,
1093
- examples: {
1094
- general: {
1095
- description: "<p>General Photo</p>",
1096
- jsx: c`
1097
- <div className="sfg-row">
1098
- <div className="sfg-col-3">
1099
- <sps-photo placeholderIcon="photo"></sps-photo>
1100
- </div>
1101
- </div>
1102
- `
1103
- },
1104
- photoAlt: {
1105
- description: "<p>Photo Alt</p>",
1106
- jsx: c`
1107
- <div className="sfg-row">
1108
- <div className="sfg-col-3">
1109
- <sps-photo placeholderIcon="camera"></sps-photo>
1110
- </div>
1111
- </div>
1112
- `
1113
- },
1114
- user: {
1115
- description: "<p>User / Single Person</p>",
1116
- jsx: c`
1117
- <div className="sfg-row">
1118
- <div className="sfg-col-3">
1119
- <sps-photo placeholderIcon="user"></sps-photo>
1120
- </div>
1121
- </div>
1122
- `
1123
- },
1124
- group: {
1125
- description: "<p>Group / Multiple People</p>",
1126
- jsx: c`
1127
- <div className="sfg-row">
1128
- <div className="sfg-col-3">
1129
- <sps-photo placeholderIcon="group"></sps-photo>
1130
- </div>
1131
- </div>
1132
- `
1133
- },
1134
- company: {
1135
- description: "<p>Company / Building</p>",
1136
- jsx: c`
1137
- <div className="sfg-row">
1138
- <div className="sfg-col-3">
1139
- <sps-photo placeholderIcon="building"></sps-photo>
1140
- </div>
1141
- </div>
1142
- `
1143
- }
1144
- }
1145
- }
1146
- }, Ss = {
1147
- Photos: {
1148
- components: [O],
1149
- examples: ls
1150
- }
1151
- };
1152
- var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
1153
- for (var i = n > 1 ? void 0 : n ? ps(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1154
- (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
1155
- return n && i && cs(t, s, i), i;
1156
912
  };
1157
913
  const v = "sps-file-upload";
1158
- var G;
1159
- let f = (G = class extends HTMLElement {
914
+ var q;
915
+ let f = (q = class extends HTMLElement {
1160
916
  constructor() {
1161
917
  super();
1162
918
  a(this, "description");
@@ -1322,7 +1078,7 @@ let f = (G = class extends HTMLElement {
1322
1078
  handleFileInputChange(t) {
1323
1079
  t.stopPropagation(), this.selectFiles(t.target.files);
1324
1080
  }
1325
- }, a(G, "displayName", v), a(G, "props", {
1081
+ }, a(q, "displayName", v), a(q, "props", {
1326
1082
  description: "string",
1327
1083
  multiple: "boolean",
1328
1084
  dismissable: "boolean",
@@ -1335,7 +1091,7 @@ let f = (G = class extends HTMLElement {
1335
1091
  selection: { event: !0, type: "CustomEvent<Array<File>>" },
1336
1092
  dismissal: { event: !0, type: "CustomEvent<void>" },
1337
1093
  download: { event: !0, type: "CustomEvent<void>" }
1338
- }), G);
1094
+ }), q);
1339
1095
  b([
1340
1096
  p()
1341
1097
  ], f.prototype, "description", 2);
@@ -1396,7 +1152,7 @@ b([
1396
1152
  f = b([
1397
1153
  j({ tag: v })
1398
1154
  ], f);
1399
- const Os = {
1155
+ const Ss = {
1400
1156
  basic: {
1401
1157
  label: "Basic File Upload",
1402
1158
  description: c`
@@ -1716,14 +1472,14 @@ const Os = {
1716
1472
  }
1717
1473
  }
1718
1474
  };
1719
- var ds = Object.defineProperty, hs = Object.getOwnPropertyDescriptor, A = (e, t, s, n) => {
1720
- for (var i = n > 1 ? void 0 : n ? hs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1475
+ var os = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, O = (e, t, s, n) => {
1476
+ for (var i = n > 1 ? void 0 : n ? ls(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1721
1477
  (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
1722
- return n && i && ds(t, s, i), i;
1478
+ return n && i && os(t, s, i), i;
1723
1479
  };
1724
1480
  const _ = "sps-insight-card";
1725
- var X;
1726
- let y = (X = class extends HTMLElement {
1481
+ var G;
1482
+ let y = (G = class extends HTMLElement {
1727
1483
  constructor() {
1728
1484
  super(...arguments);
1729
1485
  a(this, "icon");
@@ -1774,7 +1530,7 @@ let y = (X = class extends HTMLElement {
1774
1530
  className: `${_}__partners-text`
1775
1531
  }, t("design-system:insightCard.partners"))));
1776
1532
  }
1777
- }, a(X, "displayName", _), a(X, "props", {
1533
+ }, a(G, "displayName", _), a(G, "props", {
1778
1534
  icon: "SpsIcon",
1779
1535
  kind: "SpsInsightCardKind",
1780
1536
  title: "string",
@@ -1782,45 +1538,45 @@ let y = (X = class extends HTMLElement {
1782
1538
  partnerCount: "number",
1783
1539
  totalPartners: "number",
1784
1540
  secondary: "boolean"
1785
- }), X);
1786
- A([
1541
+ }), G);
1542
+ O([
1787
1543
  p()
1788
1544
  ], y.prototype, "icon", 2);
1789
- A([
1545
+ O([
1790
1546
  p()
1791
1547
  ], y.prototype, "kind", 2);
1792
- A([
1548
+ O([
1793
1549
  p()
1794
1550
  ], y.prototype, "title", 2);
1795
- A([
1551
+ O([
1796
1552
  p()
1797
1553
  ], y.prototype, "metric", 2);
1798
- A([
1554
+ O([
1799
1555
  p()
1800
1556
  ], y.prototype, "partnerCount", 2);
1801
- A([
1557
+ O([
1802
1558
  p()
1803
1559
  ], y.prototype, "totalPartners", 2);
1804
- A([
1560
+ O([
1805
1561
  p()
1806
1562
  ], y.prototype, "secondary", 2);
1807
- A([
1563
+ O([
1808
1564
  _e()
1809
1565
  ], y.prototype, "content", 2);
1810
- A([
1566
+ O([
1811
1567
  xe(`.${_}__detail`)
1812
1568
  ], y.prototype, "detail", 2);
1813
- y = A([
1569
+ y = O([
1814
1570
  j({ tag: _ })
1815
1571
  ], y);
1816
- var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, ye = (e, t, s, n) => {
1817
- for (var i = n > 1 ? void 0 : n ? fs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1572
+ var cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, ye = (e, t, s, n) => {
1573
+ for (var i = n > 1 ? void 0 : n ? ps(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1818
1574
  (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
1819
- return n && i && us(t, s, i), i;
1575
+ return n && i && cs(t, s, i), i;
1820
1576
  };
1821
1577
  const D = "sps-insights";
1822
- var K;
1823
- let te = (K = class extends HTMLElement {
1578
+ var X;
1579
+ let te = (X = class extends HTMLElement {
1824
1580
  constructor() {
1825
1581
  super();
1826
1582
  a(this, "content", []);
@@ -1851,7 +1607,7 @@ let te = (K = class extends HTMLElement {
1851
1607
  type: "button"
1852
1608
  }, this.showAdditionalInsights ? "Hide " : "Show ", "Additional Insights")));
1853
1609
  }
1854
- }, a(K, "displayName", D), a(K, "props", {}), K);
1610
+ }, a(X, "displayName", D), a(X, "props", {}), X);
1855
1611
  ye([
1856
1612
  _e()
1857
1613
  ], te.prototype, "content", 2);
@@ -1861,7 +1617,7 @@ ye([
1861
1617
  te = ye([
1862
1618
  j({ tag: D })
1863
1619
  ], te);
1864
- const As = {
1620
+ const Os = {
1865
1621
  basic: {
1866
1622
  label: "Basic Insight Cards",
1867
1623
  examples: {
@@ -2194,12 +1950,12 @@ const As = {
2194
1950
  }
2195
1951
  }
2196
1952
  };
2197
- var gs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, L = (e, t, s, n) => {
2198
- for (var i = n > 1 ? void 0 : n ? ms(t, s) : t, r = e.length - 1, l; r >= 0; r--)
1953
+ var ds = Object.defineProperty, hs = Object.getOwnPropertyDescriptor, L = (e, t, s, n) => {
1954
+ for (var i = n > 1 ? void 0 : n ? hs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
2199
1955
  (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
2200
- return n && i && gs(t, s, i), i;
2201
- }, Q;
2202
- let P = (Q = class extends HTMLElement {
1956
+ return n && i && ds(t, s, i), i;
1957
+ }, K;
1958
+ let P = (K = class extends HTMLElement {
2203
1959
  constructor() {
2204
1960
  super(...arguments);
2205
1961
  a(this, "active", !1);
@@ -2227,14 +1983,14 @@ let P = (Q = class extends HTMLElement {
2227
1983
  className: "sps-tag sps-tag--default"
2228
1984
  }, this.tag));
2229
1985
  }
2230
- }, a(Q, "displayName", "sps-nav-tab"), a(Q, "props", {
1986
+ }, a(K, "displayName", "sps-nav-tab"), a(K, "props", {
2231
1987
  active: "boolean",
2232
1988
  label: "string",
2233
1989
  icon: "SpsIcon",
2234
1990
  tag: "string",
2235
1991
  href: "string",
2236
1992
  target: "string"
2237
- }), Q);
1993
+ }), K);
2238
1994
  L([
2239
1995
  p()
2240
1996
  ], P.prototype, "active", 2);
@@ -2256,12 +2012,12 @@ L([
2256
2012
  P = L([
2257
2013
  j({ tag: "sps-nav-tab" })
2258
2014
  ], P);
2259
- var vs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, st = (e, t, s, n) => {
2260
- for (var i = n > 1 ? void 0 : n ? bs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
2015
+ var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, st = (e, t, s, n) => {
2016
+ for (var i = n > 1 ? void 0 : n ? fs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
2261
2017
  (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
2262
- return n && i && vs(t, s, i), i;
2263
- }, Z;
2264
- let ue = (Z = class extends HTMLElement {
2018
+ return n && i && us(t, s, i), i;
2019
+ }, Q;
2020
+ let ue = (Q = class extends HTMLElement {
2265
2021
  constructor() {
2266
2022
  super(...arguments);
2267
2023
  a(this, "content", []);
@@ -2271,14 +2027,14 @@ let ue = (Z = class extends HTMLElement {
2271
2027
  className: "sps-tabbed-nav"
2272
2028
  }, this.content);
2273
2029
  }
2274
- }, a(Z, "displayName", "sps-nav-tab-set"), a(Z, "props", {}), Z);
2030
+ }, a(Q, "displayName", "sps-nav-tab-set"), a(Q, "props", {}), Q);
2275
2031
  st([
2276
2032
  _e()
2277
2033
  ], ue.prototype, "content", 2);
2278
2034
  ue = st([
2279
2035
  j({ tag: "sps-nav-tab-set" })
2280
2036
  ], ue);
2281
- const Ds = {
2037
+ const As = {
2282
2038
  basic: {
2283
2039
  label: "Basic Navigation Tabs",
2284
2040
  description: c`
@@ -2316,6 +2072,246 @@ const Ds = {
2316
2072
  }
2317
2073
  }
2318
2074
  };
2075
+ var gs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, E = (e, t, s, n) => {
2076
+ for (var i = n > 1 ? void 0 : n ? ms(t, s) : t, r = e.length - 1, l; r >= 0; r--)
2077
+ (l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
2078
+ return n && i && gs(t, s, i), i;
2079
+ }, vs = /* @__PURE__ */ ((e) => (e.FIT = "fit", e.FILL = "fill", e))(vs || {});
2080
+ const F = "sps-photo";
2081
+ var Z;
2082
+ let A = (Z = class extends HTMLElement {
2083
+ constructor() {
2084
+ super(...arguments);
2085
+ a(this, "src");
2086
+ a(this, "altText");
2087
+ a(this, "mode", "fill");
2088
+ a(this, "placeholderIcon");
2089
+ a(this, "width");
2090
+ a(this, "fitWidth");
2091
+ a(this, "imageInternal");
2092
+ a(this, "waitForWidthInterval");
2093
+ a(this, "waitForImgHeightInterval");
2094
+ }
2095
+ get image() {
2096
+ return this.imageInternal;
2097
+ }
2098
+ set image(t) {
2099
+ this.imageInternal = t, t && (this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval), this.waitForImgHeightInterval = window.setInterval(() => {
2100
+ const s = t.getBoundingClientRect();
2101
+ if (s.height) {
2102
+ window.clearInterval(this.waitForImgHeightInterval), delete this.waitForImgHeightInterval;
2103
+ let n = !0;
2104
+ n = s.width / s.height > 1, this.fitWidth = n === (this.mode === "fit");
2105
+ }
2106
+ }, 1e3 / 60));
2107
+ }
2108
+ get [T]() {
2109
+ return [
2110
+ F,
2111
+ this.fitWidth ? `${F}--fit-width` : `${F}--fit-height`,
2112
+ this.placeholderIcon && `${F}--placeholder`
2113
+ ];
2114
+ }
2115
+ get [he]() {
2116
+ return {
2117
+ fontSize: `${this.width * 0.05}rem`,
2118
+ width: `${this.width}rem`,
2119
+ height: `${0.75 * this.width}rem`
2120
+ };
2121
+ }
2122
+ connectedCallback() {
2123
+ this.waitForWidthInterval = window.setInterval(() => {
2124
+ const t = this.getBoundingClientRect();
2125
+ t.width && (this.setWidth(t.width), window.clearInterval(this.waitForWidthInterval), delete this.waitForWidthInterval);
2126
+ }, 1e3 / 60);
2127
+ }
2128
+ disconnectedCallback() {
2129
+ this.waitForWidthInterval && window.clearInterval(this.waitForWidthInterval), this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval);
2130
+ }
2131
+ render() {
2132
+ return this.src ? this.width ? /* @__PURE__ */ o("img", {
2133
+ src: this.src,
2134
+ alt: this.altText
2135
+ }) : /* @__PURE__ */ o("span", null) : /* @__PURE__ */ o("i", {
2136
+ className: `sps-icon sps-icon-${this.placeholderIcon}`
2137
+ });
2138
+ }
2139
+ setWidth(t) {
2140
+ if (t && !this.width) {
2141
+ const s = document.body.parentElement.style.fontSize || "16px", n = Number(s.substr(0, s.length - 2));
2142
+ this.width = t / n;
2143
+ }
2144
+ }
2145
+ }, a(Z, "displayName", F), a(Z, "props", {
2146
+ src: "string",
2147
+ altText: "string",
2148
+ mode: "SpsPhotoDisplayMode",
2149
+ placeholderIcon: "SpsIcon"
2150
+ }), Z);
2151
+ E([
2152
+ p()
2153
+ ], A.prototype, "src", 2);
2154
+ E([
2155
+ p()
2156
+ ], A.prototype, "altText", 2);
2157
+ E([
2158
+ p()
2159
+ ], A.prototype, "mode", 2);
2160
+ E([
2161
+ p()
2162
+ ], A.prototype, "placeholderIcon", 2);
2163
+ E([
2164
+ et()
2165
+ ], A.prototype, "width", 2);
2166
+ E([
2167
+ et()
2168
+ ], A.prototype, "fitWidth", 2);
2169
+ E([
2170
+ xe("img", { refresh: !0 })
2171
+ ], A.prototype, "image", 1);
2172
+ A = E([
2173
+ j({ tag: F })
2174
+ ], A);
2175
+ const Ds = {
2176
+ sizing: {
2177
+ label: "Sizing",
2178
+ description: c`
2179
+ <p>
2180
+ Photos are block elements, so a photo fills its container's width unless
2181
+ an explicit width is set. It is always a 4:3 aspect ratio. In this example,
2182
+ photos have been placed in cards which have different widths in the 12
2183
+ column grid.
2184
+ </p>
2185
+ `,
2186
+ examples: {
2187
+ basic: {
2188
+ jsx: c`
2189
+ <div className="sfg-row">
2190
+ <div className="sfg-col-2">
2191
+ <sps-card>
2192
+ <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
2193
+ </sps-card>
2194
+ </div>
2195
+ <div className="sfg-col-4">
2196
+ <sps-card>
2197
+ <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
2198
+ </sps-card>
2199
+ </div>
2200
+ <div className="sfg-col-6">
2201
+ <sps-card>
2202
+ <sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
2203
+ </sps-card>
2204
+ </div>
2205
+ </div>
2206
+ `
2207
+ }
2208
+ }
2209
+ },
2210
+ displayMode: {
2211
+ label: "Fill vs. Fit",
2212
+ description: c`
2213
+ <p>
2214
+ There are two display modes available:
2215
+ <ul>
2216
+ <li><b>"fill"</b> fills the entire 4:3 container, cropping off any excess portions of the image.
2217
+ <li><b>"fit"</b> fits the entire image into the container, leaving any excess portions of the container blank.
2218
+ </ul>
2219
+ </p>
2220
+ `,
2221
+ examples: {
2222
+ landscape: {
2223
+ description: "<p>Landscape oriented photo (container outline added for illustrative purposes)</p>",
2224
+ jsx: c`
2225
+ <div className="sfg-row">
2226
+ <div className="sfg-col-4">
2227
+ <sps-photo src="assets/images/photo-landscape.jpg" mode="fill"></sps-photo>
2228
+ </div>
2229
+ <div className="sfg-col-4">
2230
+ <sps-photo src="assets/images/photo-landscape.jpg" mode="fit"></sps-photo>
2231
+ </div>
2232
+ </div>
2233
+ `
2234
+ },
2235
+ portrait: {
2236
+ description: "<p>Portrait oriented photo (container outline added for illustrative purposes)</p>",
2237
+ jsx: c`
2238
+ <div className="sfg-row">
2239
+ <div className="sfg-col-4">
2240
+ <sps-photo src="assets/images/photo-portrait.jpg" mode="fill"></sps-photo>
2241
+ </div>
2242
+ <div className="sfg-col-4">
2243
+ <sps-photo id="foo" src="assets/images/photo-portrait.jpg" mode="fit"></sps-photo>
2244
+ </div>
2245
+ </div>
2246
+ `
2247
+ }
2248
+ }
2249
+ },
2250
+ placeholder: {
2251
+ label: "Placeholders",
2252
+ description: c`
2253
+ <p>
2254
+ When an image is not provided for a particular use case (such as a user avatar,
2255
+ a company photo, item image, etc.), a placeholder should be shown in its place.
2256
+
2257
+ The placeholder's icon, selected from our SPS icon set, should represent the
2258
+ type of image it is substituting for.
2259
+ </p>
2260
+ `,
2261
+ examples: {
2262
+ general: {
2263
+ description: "<p>General Photo</p>",
2264
+ jsx: c`
2265
+ <div className="sfg-row">
2266
+ <div className="sfg-col-3">
2267
+ <sps-photo placeholderIcon="photo"></sps-photo>
2268
+ </div>
2269
+ </div>
2270
+ `
2271
+ },
2272
+ photoAlt: {
2273
+ description: "<p>Photo Alt</p>",
2274
+ jsx: c`
2275
+ <div className="sfg-row">
2276
+ <div className="sfg-col-3">
2277
+ <sps-photo placeholderIcon="camera"></sps-photo>
2278
+ </div>
2279
+ </div>
2280
+ `
2281
+ },
2282
+ user: {
2283
+ description: "<p>User / Single Person</p>",
2284
+ jsx: c`
2285
+ <div className="sfg-row">
2286
+ <div className="sfg-col-3">
2287
+ <sps-photo placeholderIcon="user"></sps-photo>
2288
+ </div>
2289
+ </div>
2290
+ `
2291
+ },
2292
+ group: {
2293
+ description: "<p>Group / Multiple People</p>",
2294
+ jsx: c`
2295
+ <div className="sfg-row">
2296
+ <div className="sfg-col-3">
2297
+ <sps-photo placeholderIcon="group"></sps-photo>
2298
+ </div>
2299
+ </div>
2300
+ `
2301
+ },
2302
+ company: {
2303
+ description: "<p>Company / Building</p>",
2304
+ jsx: c`
2305
+ <div className="sfg-row">
2306
+ <div className="sfg-col-3">
2307
+ <sps-photo placeholderIcon="building"></sps-photo>
2308
+ </div>
2309
+ </div>
2310
+ `
2311
+ }
2312
+ }
2313
+ }
2314
+ };
2319
2315
  export {
2320
2316
  Ie as AttrBindings,
2321
2317
  T as ClassBindings,
@@ -2323,22 +2319,22 @@ export {
2323
2319
  _e as Content,
2324
2320
  Ne as EventDispatcher,
2325
2321
  re as EventListener,
2326
- Ss as MANIFEST,
2322
+ _s as MANIFEST,
2327
2323
  tt as MIMEType,
2328
2324
  p as Prop,
2329
2325
  xe as QuerySelector,
2330
2326
  is as QuerySelectorAll,
2331
2327
  f as SpsFileUploadComponent,
2332
- Os as SpsFileUploadExamples,
2328
+ Ss as SpsFileUploadExamples,
2333
2329
  y as SpsInsightCardComponent,
2334
- As as SpsInsightCardExamples,
2330
+ Os as SpsInsightCardExamples,
2335
2331
  te as SpsInsightsComponent,
2336
2332
  P as SpsNavTabComponent,
2337
2333
  ue as SpsNavTabSetComponent,
2338
- Ds as SpsNavTabsExamples,
2339
- O as SpsPhotoComponent,
2340
- os as SpsPhotoDisplayMode,
2341
- ls as SpsPhotoExamples,
2334
+ As as SpsNavTabsExamples,
2335
+ A as SpsPhotoComponent,
2336
+ vs as SpsPhotoDisplayMode,
2337
+ Ds as SpsPhotoExamples,
2342
2338
  he as StyleBindings,
2343
2339
  et as Watch,
2344
2340
  o as h,