@saasquatch/mint-components 1.10.2-13 → 1.10.2-14

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.
Files changed (40) hide show
  1. package/dist/cjs/{ShadowViewAddon-1ddbaac2.js → ShadowViewAddon-36267ebd.js} +26 -19
  2. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +2 -1
  3. package/dist/cjs/sqm-big-stat_38.cjs.entry.js +1 -13
  4. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -7
  5. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +0 -6
  6. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +26 -19
  7. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +7 -22
  8. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +0 -1
  9. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +2 -1
  10. package/dist/esm/{ShadowViewAddon-881de075.js → ShadowViewAddon-b311a206.js} +26 -19
  11. package/dist/esm/sqm-banking-info-form_16.entry.js +2 -1
  12. package/dist/esm/sqm-big-stat_38.entry.js +1 -13
  13. package/dist/esm/sqm-stencilbook.entry.js +1 -7
  14. package/dist/esm-es5/ShadowViewAddon-b311a206.js +1 -0
  15. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  16. package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
  17. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  18. package/dist/mint-components/mint-components.esm.js +1 -1
  19. package/dist/mint-components/p-226245c7.system.entry.js +1 -0
  20. package/dist/mint-components/{p-773bfa43.entry.js → p-31e810e9.entry.js} +5 -5
  21. package/dist/mint-components/p-5de21018.system.entry.js +1 -0
  22. package/dist/mint-components/{p-6af4e1bf.js → p-7b001086.js} +20 -20
  23. package/dist/mint-components/{p-410d0544.entry.js → p-a9e7872a.entry.js} +9 -9
  24. package/dist/mint-components/p-c8bbb9ca.system.entry.js +1 -0
  25. package/dist/mint-components/p-d70348d8.system.js +1 -0
  26. package/dist/mint-components/p-ed17e637.system.js +1 -1
  27. package/dist/mint-components/{p-8fa71d87.entry.js → p-f1e256b6.entry.js} +1 -1
  28. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +0 -1
  29. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +6 -4
  30. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +0 -1
  31. package/dist/types/components.d.ts +2 -0
  32. package/docs/docs.docx +0 -0
  33. package/docs/raisins.json +1 -1
  34. package/grapesjs/grapesjs.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/esm-es5/ShadowViewAddon-881de075.js +0 -1
  37. package/dist/mint-components/p-23094362.system.js +0 -1
  38. package/dist/mint-components/p-2f5e7c77.system.entry.js +0 -1
  39. package/dist/mint-components/p-b5f0bb21.system.entry.js +0 -1
  40. package/dist/mint-components/p-c1c7f583.system.entry.js +0 -1
@@ -142,20 +142,34 @@ const vanillaStyle = `
142
142
  }
143
143
  `;
144
144
  function LeaderboardView(props) {
145
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
145
+ var _a, _b, _c;
146
146
  const { states, data, elements } = props;
147
147
  const { styles } = states;
148
148
  if (states.loading)
149
- return (index.h("div", { class: sheet$1.classes.Leaderboard },
149
+ return (index.h("div", { class: sheet$1.classes.Leaderboard, style: { width: styles.width || "100%" } },
150
150
  index.h("style", { type: "text/css" },
151
151
  styleString$1,
152
152
  vanillaStyle),
153
- elements.loadingstate));
153
+ index.h("table", null, [...Array(10)].map(() => {
154
+ return (index.h("tr", null,
155
+ index.h("td", null,
156
+ index.h("sl-skeleton", null))));
157
+ }))));
154
158
  if (states.isEssentials)
155
159
  return elements.essentials;
156
160
  if (!states.hasLeaders)
157
161
  return elements.empty;
158
162
  let userSeenFlag = false;
163
+ const getUsersName = (user) => {
164
+ if (!user.firstName && !user.lastInitial)
165
+ return styles.anonymousUser;
166
+ const { firstName, lastInitial } = user;
167
+ if (firstName && lastInitial)
168
+ return `${firstName} ${lastInitial}`;
169
+ if (firstName || lastInitial)
170
+ return firstName || lastInitial;
171
+ return styles.anonymousUser;
172
+ };
159
173
  return (index.h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
160
174
  index.h("style", { type: "text/css" },
161
175
  styleString$1,
@@ -173,15 +187,13 @@ function LeaderboardView(props) {
173
187
  user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
174
188
  ? "highlight"
175
189
  : "" },
176
- styles.showRank && (index.h("td", { class: "Rank" }, global.intl.formatMessage({
177
- id: "rank",
178
- defaultMessage: styles.rankSuffix,
179
- }, { rank: user.rank }))),
180
- !styles.hideNames && (index.h("td", { class: "User" }, user.firstName && user.lastInitial
181
- ? user.firstName + " " + user.lastInitial
182
- : user.firstName || user.lastInitial
183
- ? user.firstName || user.lastInitial
184
- : styles.anonymousUser)),
190
+ styles.showRank && (index.h("td", { class: "Rank" }, styles.rankSuffix
191
+ ? global.intl.formatMessage({
192
+ id: "rank",
193
+ defaultMessage: styles.rankSuffix,
194
+ }, { rank: user.rank })
195
+ : user.rank)),
196
+ !styles.hideNames && index.h("td", { class: "User" }, getUsersName(user)),
185
197
  index.h("td", { class: "Score" }, user.textValue)));
186
198
  }),
187
199
  !userSeenFlag && !styles.hideViewer && (index.h("tr", null,
@@ -189,13 +201,8 @@ function LeaderboardView(props) {
189
201
  index.h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
190
202
  !userSeenFlag && !styles.hideViewer && (index.h("tr", { class: "highlight" },
191
203
  styles.showRank && (index.h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
192
- !styles.hideNames && (index.h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
193
- ? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
194
- " " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
195
- : ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
196
- ? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
197
- : styles.anonymousUser)),
198
- index.h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
204
+ !styles.hideNames && (index.h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
205
+ index.h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
199
206
  }
200
207
 
201
208
  const style$2 = {
@@ -749,7 +749,8 @@ const style = {
749
749
  background: "var(--sl-color-gray-200)",
750
750
  },
751
751
  LargeSkeleton: {
752
- width: "320px",
752
+ width: "100%",
753
+ maxWidth: "320px",
753
754
  height: "40px",
754
755
  borderRadius: "50px",
755
756
  background: "var(--sl-color-gray-200)",
@@ -19,7 +19,7 @@ const index$1 = require('./index-8c6255f5.js');
19
19
  const useRegistrationFormState = require('./useRegistrationFormState-876ed65d.js');
20
20
  const utilities = require('./utilities-cec9dd36.js');
21
21
  const AsYouType = require('./AsYouType-6788393a.js');
22
- const ShadowViewAddon = require('./ShadowViewAddon-1ddbaac2.js');
22
+ const ShadowViewAddon = require('./ShadowViewAddon-36267ebd.js');
23
23
  require('./sqm-portal-container-view-990a85a3.js');
24
24
 
25
25
  const BigStat = class {
@@ -1405,7 +1405,6 @@ function useLeaderboard(props) {
1405
1405
  elements: {
1406
1406
  empty: props.empty,
1407
1407
  essentials: props.essentials,
1408
- loadingstate: props.loadingstate,
1409
1408
  },
1410
1409
  };
1411
1410
  }
@@ -1419,10 +1418,6 @@ const Leaderboard = class {
1419
1418
  * @uiName Width
1420
1419
  */
1421
1420
  this.width = "100%";
1422
- /**
1423
- * @uiName Rank Suffix
1424
- */
1425
- this.rankSuffix = "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}";
1426
1421
  /**
1427
1422
  * Hide the viewer's leaderboard row if not in the top results.
1428
1423
  *
@@ -1464,7 +1459,6 @@ const Leaderboard = class {
1464
1459
  const props = {
1465
1460
  empty: index.h(EmptySlot, null),
1466
1461
  essentials: index.h(EssentialsSlot, null),
1467
- loadingstate: index.h(LoadingSlot, null),
1468
1462
  usersheading: this.usersheading,
1469
1463
  statsheading: this.statsheading,
1470
1464
  rankheading: this.rankheading,
@@ -1494,11 +1488,6 @@ function EmptySlot() {
1494
1488
  function EssentialsSlot() {
1495
1489
  return (index.h("slot", { name: "essentials" }, index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support", "missing-feature": "Leaderboards" })));
1496
1490
  }
1497
- function LoadingSlot() {
1498
- return (index.h("slot", { name: "loading" }, index.h("table", null, [...Array(10)].map(() => {
1499
- return (index.h("tr", null, index.h("td", null, index.h("sl-skeleton", null))));
1500
- }))));
1501
- }
1502
1491
  function useLeaderboardDemo(props) {
1503
1492
  var _a, _b;
1504
1493
  const data = ((_b = (_a = props.demoData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.leaderboard) || [
@@ -1566,7 +1555,6 @@ function useLeaderboardDemo(props) {
1566
1555
  elements: {
1567
1556
  empty: index.h(EmptySlot, null),
1568
1557
  essentials: index.h(EssentialsSlot, null),
1569
- loadingstate: index.h(LoadingSlot, null),
1570
1558
  },
1571
1559
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1572
1560
  }
@@ -28,7 +28,7 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-fde54e35.js');
28
28
  require('./utilities-cec9dd36.js');
29
29
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-96f329ed.js');
30
30
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7ffcc0d4.js');
31
- const ShadowViewAddon = require('./ShadowViewAddon-1ddbaac2.js');
31
+ const ShadowViewAddon = require('./ShadowViewAddon-36267ebd.js');
32
32
  const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
33
33
  const sqmInvoiceTableView = require('./sqm-invoice-table-view-28b14d28.js');
34
34
 
@@ -1976,12 +1976,6 @@ const link = index.h("a", null, "Support");
1976
1976
  const defaultElements$1 = {
1977
1977
  empty: (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" })),
1978
1978
  essentials: (index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" })),
1979
- loadingstate: (index.h("slot", { name: "loading" },
1980
- index.h("table", null, [...Array(10)].map(() => {
1981
- return (index.h("tr", null,
1982
- index.h("td", null,
1983
- index.h("sl-skeleton", null))));
1984
- })))),
1985
1979
  };
1986
1980
  const Empty$1 = () => {
1987
1981
  const props = {
@@ -163,12 +163,6 @@ const tag = "Contact" + link + "about upgrading your plan";
163
163
  const defaultElements = {
164
164
  empty: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" })),
165
165
  essentials: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" })),
166
- loadingstate: (h("slot", { name: "loading" },
167
- h("table", null, [...Array(10)].map(() => {
168
- return (h("tr", null,
169
- h("td", null,
170
- h("sl-skeleton", null))));
171
- })))),
172
166
  };
173
167
  export const Empty = () => {
174
168
  const props = {
@@ -53,20 +53,34 @@ const vanillaStyle = `
53
53
  }
54
54
  `;
55
55
  export function LeaderboardView(props) {
56
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
56
+ var _a, _b, _c;
57
57
  const { states, data, elements } = props;
58
58
  const { styles } = states;
59
59
  if (states.loading)
60
- return (h("div", { class: sheet.classes.Leaderboard },
60
+ return (h("div", { class: sheet.classes.Leaderboard, style: { width: styles.width || "100%" } },
61
61
  h("style", { type: "text/css" },
62
62
  styleString,
63
63
  vanillaStyle),
64
- elements.loadingstate));
64
+ h("table", null, [...Array(10)].map(() => {
65
+ return (h("tr", null,
66
+ h("td", null,
67
+ h("sl-skeleton", null))));
68
+ }))));
65
69
  if (states.isEssentials)
66
70
  return elements.essentials;
67
71
  if (!states.hasLeaders)
68
72
  return elements.empty;
69
73
  let userSeenFlag = false;
74
+ const getUsersName = (user) => {
75
+ if (!user.firstName && !user.lastInitial)
76
+ return styles.anonymousUser;
77
+ const { firstName, lastInitial } = user;
78
+ if (firstName && lastInitial)
79
+ return `${firstName} ${lastInitial}`;
80
+ if (firstName || lastInitial)
81
+ return firstName || lastInitial;
82
+ return styles.anonymousUser;
83
+ };
70
84
  return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
71
85
  h("style", { type: "text/css" },
72
86
  styleString,
@@ -84,15 +98,13 @@ export function LeaderboardView(props) {
84
98
  user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
85
99
  ? "highlight"
86
100
  : "" },
87
- styles.showRank && (h("td", { class: "Rank" }, intl.formatMessage({
88
- id: "rank",
89
- defaultMessage: styles.rankSuffix,
90
- }, { rank: user.rank }))),
91
- !styles.hideNames && (h("td", { class: "User" }, user.firstName && user.lastInitial
92
- ? user.firstName + " " + user.lastInitial
93
- : user.firstName || user.lastInitial
94
- ? user.firstName || user.lastInitial
95
- : styles.anonymousUser)),
101
+ styles.showRank && (h("td", { class: "Rank" }, styles.rankSuffix
102
+ ? intl.formatMessage({
103
+ id: "rank",
104
+ defaultMessage: styles.rankSuffix,
105
+ }, { rank: user.rank })
106
+ : user.rank)),
107
+ !styles.hideNames && h("td", { class: "User" }, getUsersName(user)),
96
108
  h("td", { class: "Score" }, user.textValue)));
97
109
  }),
98
110
  !userSeenFlag && !styles.hideViewer && (h("tr", null,
@@ -100,11 +112,6 @@ export function LeaderboardView(props) {
100
112
  h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
101
113
  !userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
102
114
  styles.showRank && (h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
103
- !styles.hideNames && (h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
104
- ? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
105
- " " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
106
- : ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
107
- ? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
108
- : styles.anonymousUser)),
109
- h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
115
+ !styles.hideNames && (h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
116
+ h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
110
117
  }
@@ -10,10 +10,10 @@ import { useLeaderboard } from "./useLeaderboard";
10
10
  * @slots [{"name":"empty", "title":"Empty State"}]
11
11
  * @requiredFeatures ["LEADERBOARDS"]
12
12
  * @exampleGroup Leaderboard
13
- * @example Referral Started Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
14
- * @example Referral Converted Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topConvertedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
15
- * @example Points Earned Leaderboard - <sqm-leaderboard usersheading="Name" statsheading="Points" rank-type="rank" leaderboard-type="topPointEarners" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
16
- * @example Anonymous Leaderboard - <div style="display: flex; align-items: flex-start; justify-content: center; width: 100%; gap: 50px;"><div style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; max-width: 30%;"><sqm-image width="70%" alignment="center" image-url="https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png"></sqm-image><h2 style="margin: auto;">Top Performers</h2><p style="margin: 0; text-align: center;">The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!</p></div><sqm-leaderboard width="300px" usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true" hide-names="true" hide-viewer="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard"></sqm-empty></sqm-leaderboard></div>
13
+ * @example Referral Started Leaderboard - <sqm-leaderboard usersheading="Referrer" rank-suffix="{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
14
+ * @example Referral Converted Leaderboard - <sqm-leaderboard usersheading="Referrer" rank-suffix="{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}" statsheading="Referrals" rank-type="rank" leaderboard-type="topConvertedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
15
+ * @example Points Earned Leaderboard - <sqm-leaderboard usersheading="Name" rank-suffix="{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}" statsheading="Points" rank-type="rank" leaderboard-type="topPointEarners" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
16
+ * @example Anonymous Leaderboard - <div style="display: flex; align-items: flex-start; justify-content: center; width: 100%; gap: 50px;"><div style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; max-width: 30%;"><sqm-image width="70%" alignment="center" image-url="https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png"></sqm-image><h2 style="margin: auto;">Top Performers</h2><p style="margin: 0; text-align: center;">The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!</p></div><sqm-leaderboard width="300px" usersheading="Referrer" rank-suffix="{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true" hide-names="true" hide-viewer="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard"></sqm-empty></sqm-leaderboard></div>
17
17
  * @featureTooltip <div>Motivate your participants by gamifying your program. Contact <a href="mailto:saasquatch-support%40impact.com?subject=Next steps for Leaderboards feature&body=Hi Support Team, %0D%0A%0D%0A I am interested in learning more about how Leaderboards can support the growth of our referral program. Please connect me with a program strategy manager to discuss this feature further, and determine the next steps.%0D%0A%0D%0A%0D%0AThank you,%0D%0A[Add your name here]">Support</a> to upgrade your plan and add a leaderboard.</div>
18
18
  */
19
19
  export class Leaderboard {
@@ -24,10 +24,6 @@ export class Leaderboard {
24
24
  * @uiName Width
25
25
  */
26
26
  this.width = "100%";
27
- /**
28
- * @uiName Rank Suffix
29
- */
30
- this.rankSuffix = "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}";
31
27
  /**
32
28
  * Hide the viewer's leaderboard row if not in the top results.
33
29
  *
@@ -69,7 +65,6 @@ export class Leaderboard {
69
65
  const props = {
70
66
  empty: h(EmptySlot, null),
71
67
  essentials: h(EssentialsSlot, null),
72
- loadingstate: h(LoadingSlot, null),
73
68
  usersheading: this.usersheading,
74
69
  statsheading: this.statsheading,
75
70
  rankheading: this.rankheading,
@@ -234,11 +229,10 @@ export class Leaderboard {
234
229
  "text": "Rank Suffix",
235
230
  "name": "uiName"
236
231
  }],
237
- "text": ""
232
+ "text": "A JSONata string that formats the rank with the appropriate ordinal suffix (e.g., \"st\" for 1st, \"nd\" for 2nd, \"rd\" for 3rd, and \"th\" for all others)."
238
233
  },
239
234
  "attribute": "rank-suffix",
240
- "reflect": false,
241
- "defaultValue": "\"{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}\""
235
+ "reflect": false
242
236
  },
243
237
  "hideViewer": {
244
238
  "type": "boolean",
@@ -446,7 +440,7 @@ export class Leaderboard {
446
440
  "mutable": false,
447
441
  "complexType": {
448
442
  "original": "DemoData<LeaderboardViewProps>",
449
- "resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; hideNames?: boolean; anonymousUser?: string; rankSuffix?: string; width?: string; }; }; data?: { rankType: string; leaderboard: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }[]; viewerRank?: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }; }; elements?: { empty: VNode; essentials: VNode; loadingstate: VNode; }; }",
443
+ "resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; hideNames?: boolean; anonymousUser?: string; rankSuffix?: string; width?: string; }; }; data?: { rankType: string; leaderboard: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }[]; viewerRank?: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }; }; elements?: { empty: VNode; essentials: VNode; }; }",
450
444
  "references": {
451
445
  "DemoData": {
452
446
  "location": "import",
@@ -484,14 +478,6 @@ function EssentialsSlot() {
484
478
  return (h("slot", { name: "essentials" },
485
479
  h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support", "missing-feature": "Leaderboards" })));
486
480
  }
487
- function LoadingSlot() {
488
- return (h("slot", { name: "loading" },
489
- h("table", null, [...Array(10)].map(() => {
490
- return (h("tr", null,
491
- h("td", null,
492
- h("sl-skeleton", null))));
493
- }))));
494
- }
495
481
  function useLeaderboardDemo(props) {
496
482
  var _a, _b;
497
483
  const data = ((_b = (_a = props.demoData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.leaderboard) || [
@@ -559,7 +545,6 @@ function useLeaderboardDemo(props) {
559
545
  elements: {
560
546
  empty: h(EmptySlot, null),
561
547
  essentials: h(EssentialsSlot, null),
562
- loadingstate: h(LoadingSlot, null),
563
548
  },
564
549
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
565
550
  }
@@ -152,7 +152,6 @@ export function useLeaderboard(props) {
152
152
  elements: {
153
153
  empty: props.empty,
154
154
  essentials: props.essentials,
155
- loadingstate: props.loadingstate,
156
155
  },
157
156
  };
158
157
  }
@@ -116,7 +116,8 @@ const style = {
116
116
  background: "var(--sl-color-gray-200)",
117
117
  },
118
118
  LargeSkeleton: {
119
- width: "320px",
119
+ width: "100%",
120
+ maxWidth: "320px",
120
121
  height: "40px",
121
122
  borderRadius: "50px",
122
123
  background: "var(--sl-color-gray-200)",
@@ -140,20 +140,34 @@ const vanillaStyle = `
140
140
  }
141
141
  `;
142
142
  function LeaderboardView(props) {
143
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
143
+ var _a, _b, _c;
144
144
  const { states, data, elements } = props;
145
145
  const { styles } = states;
146
146
  if (states.loading)
147
- return (h("div", { class: sheet$1.classes.Leaderboard },
147
+ return (h("div", { class: sheet$1.classes.Leaderboard, style: { width: styles.width || "100%" } },
148
148
  h("style", { type: "text/css" },
149
149
  styleString$1,
150
150
  vanillaStyle),
151
- elements.loadingstate));
151
+ h("table", null, [...Array(10)].map(() => {
152
+ return (h("tr", null,
153
+ h("td", null,
154
+ h("sl-skeleton", null))));
155
+ }))));
152
156
  if (states.isEssentials)
153
157
  return elements.essentials;
154
158
  if (!states.hasLeaders)
155
159
  return elements.empty;
156
160
  let userSeenFlag = false;
161
+ const getUsersName = (user) => {
162
+ if (!user.firstName && !user.lastInitial)
163
+ return styles.anonymousUser;
164
+ const { firstName, lastInitial } = user;
165
+ if (firstName && lastInitial)
166
+ return `${firstName} ${lastInitial}`;
167
+ if (firstName || lastInitial)
168
+ return firstName || lastInitial;
169
+ return styles.anonymousUser;
170
+ };
157
171
  return (h("div", { class: sheet$1.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
158
172
  h("style", { type: "text/css" },
159
173
  styleString$1,
@@ -171,15 +185,13 @@ function LeaderboardView(props) {
171
185
  user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
172
186
  ? "highlight"
173
187
  : "" },
174
- styles.showRank && (h("td", { class: "Rank" }, intl.formatMessage({
175
- id: "rank",
176
- defaultMessage: styles.rankSuffix,
177
- }, { rank: user.rank }))),
178
- !styles.hideNames && (h("td", { class: "User" }, user.firstName && user.lastInitial
179
- ? user.firstName + " " + user.lastInitial
180
- : user.firstName || user.lastInitial
181
- ? user.firstName || user.lastInitial
182
- : styles.anonymousUser)),
188
+ styles.showRank && (h("td", { class: "Rank" }, styles.rankSuffix
189
+ ? intl.formatMessage({
190
+ id: "rank",
191
+ defaultMessage: styles.rankSuffix,
192
+ }, { rank: user.rank })
193
+ : user.rank)),
194
+ !styles.hideNames && h("td", { class: "User" }, getUsersName(user)),
183
195
  h("td", { class: "Score" }, user.textValue)));
184
196
  }),
185
197
  !userSeenFlag && !styles.hideViewer && (h("tr", null,
@@ -187,13 +199,8 @@ function LeaderboardView(props) {
187
199
  h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
188
200
  !userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
189
201
  styles.showRank && (h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
190
- !styles.hideNames && (h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
191
- ? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
192
- " " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
193
- : ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
194
- ? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
195
- : styles.anonymousUser)),
196
- h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
202
+ !styles.hideNames && (h("td", { class: "User" }, getUsersName(data.viewerRank || {}))),
203
+ h("td", { class: "Score" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.textValue) || "0"))))));
197
204
  }
198
205
 
199
206
  const style$2 = {
@@ -745,7 +745,8 @@ const style = {
745
745
  background: "var(--sl-color-gray-200)",
746
746
  },
747
747
  LargeSkeleton: {
748
- width: "320px",
748
+ width: "100%",
749
+ maxWidth: "320px",
749
750
  height: "40px",
750
751
  borderRadius: "50px",
751
752
  background: "var(--sl-color-gray-200)",
@@ -15,7 +15,7 @@ import { p as pathToRegexp } from './index-ffa26b43.js';
15
15
  import { R as REGISTRATION_FORM_STATE_CONTEXT, u as useRegistrationFormState } from './useRegistrationFormState-9fc1ac80.js';
16
16
  import { i as isEmpty } from './utilities-3f5bba22.js';
17
17
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
18
- import { b as useDemoBigStat, V as useBigStat, B as BigStatView, Q as autoColorScaleCss, K as CardFeedView, j as CheckboxFieldView, M as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, W as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, X as demoRewardExchange, k as RewardExchangeView, a as useShareButton, S as ShareButtonView, C as CopyTextView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-881de075.js';
18
+ import { b as useDemoBigStat, V as useBigStat, B as BigStatView, Q as autoColorScaleCss, K as CardFeedView, j as CheckboxFieldView, M as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, W as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, X as demoRewardExchange, k as RewardExchangeView, a as useShareButton, S as ShareButtonView, C as CopyTextView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-b311a206.js';
19
19
  import './sqm-portal-container-view-6c582684.js';
20
20
 
21
21
  const BigStat = class {
@@ -1401,7 +1401,6 @@ function useLeaderboard(props) {
1401
1401
  elements: {
1402
1402
  empty: props.empty,
1403
1403
  essentials: props.essentials,
1404
- loadingstate: props.loadingstate,
1405
1404
  },
1406
1405
  };
1407
1406
  }
@@ -1415,10 +1414,6 @@ const Leaderboard = class {
1415
1414
  * @uiName Width
1416
1415
  */
1417
1416
  this.width = "100%";
1418
- /**
1419
- * @uiName Rank Suffix
1420
- */
1421
- this.rankSuffix = "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}";
1422
1417
  /**
1423
1418
  * Hide the viewer's leaderboard row if not in the top results.
1424
1419
  *
@@ -1460,7 +1455,6 @@ const Leaderboard = class {
1460
1455
  const props = {
1461
1456
  empty: h$1(EmptySlot, null),
1462
1457
  essentials: h$1(EssentialsSlot, null),
1463
- loadingstate: h$1(LoadingSlot, null),
1464
1458
  usersheading: this.usersheading,
1465
1459
  statsheading: this.statsheading,
1466
1460
  rankheading: this.rankheading,
@@ -1490,11 +1484,6 @@ function EmptySlot() {
1490
1484
  function EssentialsSlot() {
1491
1485
  return (h$1("slot", { name: "essentials" }, h$1("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support", "missing-feature": "Leaderboards" })));
1492
1486
  }
1493
- function LoadingSlot() {
1494
- return (h$1("slot", { name: "loading" }, h$1("table", null, [...Array(10)].map(() => {
1495
- return (h$1("tr", null, h$1("td", null, h$1("sl-skeleton", null))));
1496
- }))));
1497
- }
1498
1487
  function useLeaderboardDemo(props) {
1499
1488
  var _a, _b;
1500
1489
  const data = ((_b = (_a = props.demoData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.leaderboard) || [
@@ -1562,7 +1551,6 @@ function useLeaderboardDemo(props) {
1562
1551
  elements: {
1563
1552
  empty: h$1(EmptySlot, null),
1564
1553
  essentials: h$1(EssentialsSlot, null),
1565
- loadingstate: h$1(LoadingSlot, null),
1566
1554
  },
1567
1555
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1568
1556
  }
@@ -24,7 +24,7 @@ import { P as PortalProfileView } from './sqm-portal-profile-view-ffe955c8.js';
24
24
  import './utilities-3f5bba22.js';
25
25
  import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-79a85e02.js';
26
26
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-d7ea2c56.js';
27
- import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as ProgressBar$2, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-881de075.js';
27
+ import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as ProgressBar$2, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-b311a206.js';
28
28
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-6c582684.js';
29
29
  import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-34ac7513.js';
30
30
 
@@ -1972,12 +1972,6 @@ const link = h("a", null, "Support");
1972
1972
  const defaultElements$1 = {
1973
1973
  empty: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" })),
1974
1974
  essentials: (h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1715360191/squatch-assets/Leaderboard_Not_Available.svg", "empty-state-header": "Leaderboards aren\u2019t available on your plan", "empty-state-text": "Contact {supportText} to upgrade your plan and start leveraging gamification in your program.", "support-text": "Support" })),
1975
- loadingstate: (h("slot", { name: "loading" },
1976
- h("table", null, [...Array(10)].map(() => {
1977
- return (h("tr", null,
1978
- h("td", null,
1979
- h("sl-skeleton", null))));
1980
- })))),
1981
1975
  };
1982
1976
  const Empty$1 = () => {
1983
1977
  const props = {