@saasquatch/mint-components 1.10.2-9 → 1.10.3-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.
Files changed (74) hide show
  1. package/dist/cjs/{ShadowViewAddon-721bb748.js → ShadowViewAddon-c3e91cee.js} +55 -30
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +57 -33
  5. package/dist/cjs/sqm-big-stat_38.cjs.entry.js +64 -23
  6. package/dist/cjs/sqm-empty_4.cjs.entry.js +8 -1
  7. package/dist/cjs/{sqm-portal-container-view-5fb2ad49.js → sqm-portal-container-view-990a85a3.js} +1 -1
  8. package/dist/cjs/sqm-stencilbook.cjs.entry.js +153 -30
  9. package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
  10. package/dist/collection/components/sqm-image/sqm-image-view.js +1 -1
  11. package/dist/collection/components/sqm-image/sqm-image.js +20 -0
  12. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +130 -24
  13. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +55 -29
  14. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +93 -29
  15. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +40 -4
  16. package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +12 -0
  17. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +1 -1
  18. package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +37 -0
  19. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +2 -1
  20. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +55 -32
  21. package/dist/esm/{ShadowViewAddon-31eb5b16.js → ShadowViewAddon-e012b2aa.js} +55 -30
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/mint-components.js +1 -1
  24. package/dist/esm/sqm-banking-info-form_16.entry.js +57 -33
  25. package/dist/esm/sqm-big-stat_38.entry.js +64 -23
  26. package/dist/esm/sqm-empty_4.entry.js +8 -1
  27. package/dist/esm/{sqm-portal-container-view-ab89c6cc.js → sqm-portal-container-view-6c582684.js} +1 -1
  28. package/dist/esm/sqm-stencilbook.entry.js +153 -30
  29. package/dist/esm-es5/ShadowViewAddon-e012b2aa.js +1 -0
  30. package/dist/esm-es5/loader.js +1 -1
  31. package/dist/esm-es5/mint-components.js +1 -1
  32. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  33. package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
  34. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  35. package/dist/esm-es5/sqm-portal-container-view-6c582684.js +1 -0
  36. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  37. package/dist/mint-components/mint-components.esm.js +1 -1
  38. package/dist/mint-components/{p-d6474614.js → p-10685090.js} +23 -23
  39. package/dist/mint-components/p-2ffefa3b.entry.js +223 -0
  40. package/dist/mint-components/{p-b45ba369.entry.js → p-31e810e9.entry.js} +2 -2
  41. package/dist/mint-components/p-5de21018.system.entry.js +1 -0
  42. package/dist/mint-components/p-7497a4f6.system.entry.js +1 -0
  43. package/dist/mint-components/{p-bf723ae9.entry.js → p-81689347.entry.js} +2 -2
  44. package/dist/mint-components/p-84361da0.system.entry.js +1 -0
  45. package/dist/mint-components/p-95771f79.system.js +1 -0
  46. package/dist/mint-components/p-9f0629ba.system.entry.js +1 -0
  47. package/dist/mint-components/{p-e704842c.js → p-c7fd9e16.js} +1 -1
  48. package/dist/mint-components/p-d8d2de11.entry.js +1 -0
  49. package/dist/mint-components/p-ed17e637.system.js +1 -1
  50. package/dist/mint-components/p-ed6ebd60.system.js +1 -0
  51. package/dist/types/components/sqm-image/sqm-image-view.d.ts +1 -0
  52. package/dist/types/components/sqm-image/sqm-image.d.ts +5 -0
  53. package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +5 -1
  54. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +6 -4
  55. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +23 -6
  56. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +4 -2
  57. package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +1 -0
  58. package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +1 -0
  59. package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +7 -0
  60. package/dist/types/components.d.ts +64 -12
  61. package/docs/docs.docx +0 -0
  62. package/docs/raisins.json +1 -1
  63. package/grapesjs/grapesjs.js +1 -1
  64. package/package.json +2 -2
  65. package/dist/esm-es5/ShadowViewAddon-31eb5b16.js +0 -1
  66. package/dist/esm-es5/sqm-portal-container-view-ab89c6cc.js +0 -1
  67. package/dist/mint-components/p-0d39c815.system.entry.js +0 -1
  68. package/dist/mint-components/p-1fe65a36.entry.js +0 -1
  69. package/dist/mint-components/p-27bd5535.entry.js +0 -187
  70. package/dist/mint-components/p-34fd1229.system.entry.js +0 -1
  71. package/dist/mint-components/p-922578e4.system.js +0 -1
  72. package/dist/mint-components/p-b567780d.system.js +0 -1
  73. package/dist/mint-components/p-c34a507e.system.entry.js +0 -1
  74. package/dist/mint-components/p-f1a1e7f3.system.entry.js +0 -1
@@ -19,8 +19,8 @@ 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-721bb748.js');
23
- require('./sqm-portal-container-view-5fb2ad49.js');
22
+ const ShadowViewAddon = require('./ShadowViewAddon-c3e91cee.js');
23
+ require('./sqm-portal-container-view-990a85a3.js');
24
24
 
25
25
  const BigStat = class {
26
26
  constructor(hostRef) {
@@ -1160,7 +1160,7 @@ function ImageView(props) {
1160
1160
  },
1161
1161
  Image: {
1162
1162
  minHeight: props.minHeight || "100%",
1163
- width: "100%",
1163
+ width: props.width || "100%",
1164
1164
  maxWidth: "max-content",
1165
1165
  objectFit: "cover",
1166
1166
  },
@@ -1275,6 +1275,26 @@ const GET_LEADERBOARD = index_module.dist.gql `
1275
1275
  }
1276
1276
  }
1277
1277
  `;
1278
+ const GET_LEADERBOARD_WITHOUT_NAMES = index_module.dist.gql `
1279
+ query (
1280
+ $type: String!
1281
+ $filter: UserLeaderboardFilterInput
1282
+ $locale: RSLocale
1283
+ $limit: Int!
1284
+ ) {
1285
+ userLeaderboard(type: $type, filter: $filter) {
1286
+ dateModified
1287
+ rows(limit: $limit) {
1288
+ textValue(locale: $locale)
1289
+ rank {
1290
+ rank
1291
+ denseRank
1292
+ rowNumber
1293
+ }
1294
+ }
1295
+ }
1296
+ }
1297
+ `;
1278
1298
  const GET_RANK = index_module.dist.gql `
1279
1299
  query (
1280
1300
  $type: String!
@@ -1295,6 +1315,24 @@ const GET_RANK = index_module.dist.gql `
1295
1315
  }
1296
1316
  }
1297
1317
  `;
1318
+ const GET_RANK_WITHOUT_NAMES = index_module.dist.gql `
1319
+ query (
1320
+ $type: String!
1321
+ $filter: UserLeaderboardFilterInput
1322
+ $locale: RSLocale
1323
+ ) {
1324
+ viewer {
1325
+ ... on User {
1326
+ leaderboardRank(type: $type, filter: $filter) {
1327
+ textValue(locale: $locale)
1328
+ rank
1329
+ denseRank
1330
+ rowNumber
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+ `;
1298
1336
  function useLeaderboard(props) {
1299
1337
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1300
1338
  const programIdContext = index_module.H();
@@ -1320,8 +1358,8 @@ function useLeaderboard(props) {
1320
1358
  if (props.maxRows > 0) {
1321
1359
  variables["limit"] = props.maxRows;
1322
1360
  }
1323
- const { data: leaderboardData, loading: loadingLeaderboard, errors: leaderboardErrors, } = index_module.yn(GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt), { batch: false });
1324
- const { data: rankData } = index_module.yn(GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
1361
+ const { data: leaderboardData, loading: loadingLeaderboard, errors: leaderboardErrors, } = index_module.yn(props.hideNames ? GET_LEADERBOARD_WITHOUT_NAMES : GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt), { batch: false });
1362
+ const { data: rankData } = index_module.yn(props.hideNames ? GET_RANK_WITHOUT_NAMES : GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
1325
1363
  const leaderboardRows = (_b = leaderboardData === null || leaderboardData === void 0 ? void 0 : leaderboardData.userLeaderboard) === null || _b === void 0 ? void 0 : _b.rows;
1326
1364
  const flattenedLeaderboard = getFlattenedLeaderboard(leaderboardRows);
1327
1365
  const sortedLeaderboard = flattenedLeaderboard === null || flattenedLeaderboard === void 0 ? void 0 : flattenedLeaderboard.sort(function (a, b) {
@@ -1365,8 +1403,6 @@ function useLeaderboard(props) {
1365
1403
  },
1366
1404
  elements: {
1367
1405
  empty: props.empty,
1368
- essentials: props.essentials,
1369
- loadingstate: props.loadingstate,
1370
1406
  },
1371
1407
  };
1372
1408
  }
@@ -1374,6 +1410,12 @@ function useLeaderboard(props) {
1374
1410
  const Leaderboard = class {
1375
1411
  constructor(hostRef) {
1376
1412
  index.registerInstance(this, hostRef);
1413
+ /**
1414
+ * Restrict the width of the leaderboard (Can be a pixel value or a percentage i.e. "500px", "33%", etc.)
1415
+ *
1416
+ * @uiName Width
1417
+ */
1418
+ this.width = "100%";
1377
1419
  /**
1378
1420
  * Hide the viewer's leaderboard row if not in the top results.
1379
1421
  *
@@ -1382,12 +1424,16 @@ const Leaderboard = class {
1382
1424
  */
1383
1425
  this.hideViewer = false;
1384
1426
  /**
1385
- * Hides the leaderboard if user is on Essentials plan
1427
+ * @uiName Viewing user text
1428
+ */
1429
+ this.viewingUserText = "You";
1430
+ /**
1431
+ * Hide the Names of users to protect personal identifiable information
1386
1432
  *
1387
- * @uiName Hide viewing user
1433
+ * @uiName Hide users names
1388
1434
  * @default
1389
1435
  */
1390
- this.isEssentials = false;
1436
+ this.hideNames = false;
1391
1437
  /**
1392
1438
  * Title displayed for users without names
1393
1439
  * @uiName Unknown user text
@@ -1407,8 +1453,6 @@ const Leaderboard = class {
1407
1453
  render() {
1408
1454
  const props = {
1409
1455
  empty: index.h(EmptySlot, null),
1410
- essentials: index.h(EssentialsSlot, null),
1411
- loadingstate: index.h(LoadingSlot, null),
1412
1456
  usersheading: this.usersheading,
1413
1457
  statsheading: this.statsheading,
1414
1458
  rankheading: this.rankheading,
@@ -1419,8 +1463,11 @@ const Leaderboard = class {
1419
1463
  anonymousUser: this.anonymousUser,
1420
1464
  interval: this.interval,
1421
1465
  hideViewer: this.hideViewer,
1466
+ viewingUserText: this.viewingUserText,
1467
+ hideNames: this.hideNames,
1422
1468
  showRank: this.showRank,
1423
- isEssentials: this.isEssentials,
1469
+ rankSuffix: this.rankSuffix,
1470
+ width: this.width,
1424
1471
  };
1425
1472
  const demoProps = { ...props, demoData: this.demoData };
1426
1473
  const viewprops = index_module.isDemo()
@@ -1432,14 +1479,6 @@ const Leaderboard = class {
1432
1479
  function EmptySlot() {
1433
1480
  return (index.h("slot", { name: "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" })));
1434
1481
  }
1435
- function EssentialsSlot() {
1436
- 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" })));
1437
- }
1438
- function LoadingSlot() {
1439
- return (index.h("slot", { name: "loading" }, index.h("table", null, [...Array(10)].map(() => {
1440
- return (index.h("tr", null, index.h("td", null, index.h("sl-skeleton", null))));
1441
- }))));
1442
- }
1443
1482
  function useLeaderboardDemo(props) {
1444
1483
  var _a, _b;
1445
1484
  const data = ((_b = (_a = props.demoData) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.leaderboard) || [
@@ -1495,6 +1534,10 @@ function useLeaderboardDemo(props) {
1495
1534
  : "Anonymous User",
1496
1535
  showRank: props.showRank,
1497
1536
  hideViewer: props.hideViewer,
1537
+ viewingUserText: props.viewingUserText,
1538
+ hideNames: props.hideNames,
1539
+ rankSuffix: props.rankSuffix,
1540
+ width: props.width,
1498
1541
  },
1499
1542
  },
1500
1543
  data: {
@@ -1503,8 +1546,6 @@ function useLeaderboardDemo(props) {
1503
1546
  },
1504
1547
  elements: {
1505
1548
  empty: index.h(EmptySlot, null),
1506
- essentials: index.h(EssentialsSlot, null),
1507
- loadingstate: index.h(LoadingSlot, null),
1508
1549
  },
1509
1550
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1510
1551
  }
@@ -8,7 +8,7 @@ const global = require('./global-02e50f09.js');
8
8
  require('./index.module-df530553.js');
9
9
  require('./JSS-8503a151.js');
10
10
  const utils = require('./utils-6847bc06.js');
11
- const sqmPortalContainerView = require('./sqm-portal-container-view-5fb2ad49.js');
11
+ const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
12
12
 
13
13
  function EmptyStateView(props) {
14
14
  const { emptyStateHeader, emptyStateImage, emptyStateText, supportText, missingFeature = "", } = props;
@@ -71,6 +71,13 @@ const PortalContainer = class {
71
71
  * @uiName Maximum width
72
72
  */
73
73
  this.maxWidth = "100%";
74
+ /**
75
+ * @uiName Flex wrap behavior
76
+ * @uiType string
77
+ * @uiEnum ["wrap", "nowrap"]
78
+ * @uiEnumNames ["Wrap", "No Wrap"]
79
+ */
80
+ this.flexWrap = "wrap";
74
81
  /**
75
82
  * @uiName Background color
76
83
  * @uiWidget color
@@ -29,7 +29,7 @@ function PortalContainerView(props, children) {
29
29
  Container: {
30
30
  boxSizing: "border-box",
31
31
  display: props.display || "grid",
32
- flexWrap: "wrap",
32
+ flexWrap: props.flexWrap || "wrap",
33
33
  "grid-template-columns": props.direction === "row"
34
34
  ? `repeat(auto-fill, minmax(${props.minWidth}, auto))`
35
35
  : "100%",
@@ -28,8 +28,8 @@ 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-721bb748.js');
32
- const sqmPortalContainerView = require('./sqm-portal-container-view-5fb2ad49.js');
31
+ const ShadowViewAddon = require('./ShadowViewAddon-c3e91cee.js');
32
+ const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
33
33
  const sqmInvoiceTableView = require('./sqm-invoice-table-view-28b14d28.js');
34
34
 
35
35
  /**
@@ -1604,8 +1604,8 @@ const SlottedIntoComponent = () => {
1604
1604
  data: {
1605
1605
  rankType: "rowNumber",
1606
1606
  leaderboard: [],
1607
- showUser: true,
1608
1607
  rowNumber: 10,
1608
+ showUser: true,
1609
1609
  userRank: {
1610
1610
  firstName: "Kutay",
1611
1611
  lastInitial: "C",
@@ -1813,7 +1813,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
1813
1813
  MultipleStats: MultipleStats
1814
1814
  });
1815
1815
 
1816
- const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
1816
+ const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n Scenario Outline: Users names can be hidden or shown\n Given a leaderboard\n And it has prop \"hide-names\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the referrer column\n\n Examples:\n | propValue | maySee |\n | true | don't see |\n | false | see |\n | | see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
1817
1817
 
1818
1818
  const Leaderboard_stories = {
1819
1819
  title: "Components/Leaderboard",
@@ -1895,8 +1895,8 @@ const users = [
1895
1895
  ];
1896
1896
  const pointsUsers = [
1897
1897
  {
1898
- firstName: "",
1899
- lastInitial: "",
1898
+ firstName: "Tom",
1899
+ lastInitial: "Smith",
1900
1900
  textValue: "82 Points",
1901
1901
  rank: 1,
1902
1902
  rowNumber: 1,
@@ -1970,17 +1970,12 @@ const defaultStyles$1 = {
1970
1970
  statsheading: "Referrals",
1971
1971
  rankheading: "Rank",
1972
1972
  anonymousUser: "Anonymous User",
1973
+ viewingUserText: "You",
1974
+ rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
1973
1975
  };
1974
1976
  const link = index.h("a", null, "Support");
1975
1977
  const defaultElements$1 = {
1976
1978
  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" })),
1977
- 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" })),
1978
- loadingstate: (index.h("slot", { name: "loading" },
1979
- index.h("table", null, [...Array(10)].map(() => {
1980
- return (index.h("tr", null,
1981
- index.h("td", null,
1982
- index.h("sl-skeleton", null))));
1983
- })))),
1984
1979
  };
1985
1980
  const Empty$1 = () => {
1986
1981
  const props = {
@@ -2009,11 +2004,10 @@ const Empty$1 = () => {
2009
2004
  };
2010
2005
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2011
2006
  };
2012
- const Essentials = () => {
2007
+ const Loading = () => {
2013
2008
  const props = {
2014
2009
  states: {
2015
- loading: false,
2016
- isEssentials: true,
2010
+ loading: true,
2017
2011
  hasLeaders: false,
2018
2012
  styles: {
2019
2013
  ...defaultStyles$1,
@@ -2021,15 +2015,8 @@ const Essentials = () => {
2021
2015
  },
2022
2016
  data: {
2023
2017
  rankType: "rowNumber",
2024
- leaderboard: [],
2025
2018
  rowNumber: 10,
2026
- viewerRank: {
2027
- firstName: "Kutay",
2028
- lastInitial: "C",
2029
- textValue: "8",
2030
- rowNumber: 11,
2031
- rank: 23,
2032
- },
2019
+ leaderboard: [],
2033
2020
  },
2034
2021
  elements: {
2035
2022
  ...defaultElements$1,
@@ -2037,10 +2024,11 @@ const Essentials = () => {
2037
2024
  };
2038
2025
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2039
2026
  };
2040
- const Loading = () => {
2027
+ const Essentials = () => {
2041
2028
  const props = {
2042
2029
  states: {
2043
- loading: true,
2030
+ loading: false,
2031
+ isEssentials: true,
2044
2032
  hasLeaders: false,
2045
2033
  styles: {
2046
2034
  ...defaultStyles$1,
@@ -2048,8 +2036,15 @@ const Loading = () => {
2048
2036
  },
2049
2037
  data: {
2050
2038
  rankType: "rowNumber",
2051
- rowNumber: 10,
2052
2039
  leaderboard: [],
2040
+ rowNumber: 10,
2041
+ viewerRank: {
2042
+ firstName: "Kutay",
2043
+ lastInitial: "C",
2044
+ textValue: "8",
2045
+ rowNumber: 11,
2046
+ rank: 23,
2047
+ },
2053
2048
  },
2054
2049
  elements: {
2055
2050
  ...defaultElements$1,
@@ -2186,6 +2181,38 @@ const ReferralLeaderboard = () => {
2186
2181
  };
2187
2182
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2188
2183
  };
2184
+ const ReferralLeaderboardWithMaxWidth = () => {
2185
+ const props = {
2186
+ states: {
2187
+ loading: false,
2188
+ hasLeaders: true,
2189
+ styles: {
2190
+ ...defaultStyles$1,
2191
+ rankheading: "Rank",
2192
+ usersheading: "User",
2193
+ statsheading: "Referrals",
2194
+ showRank: false,
2195
+ maxWidth: "300px",
2196
+ },
2197
+ },
2198
+ data: {
2199
+ rankType: "rowNumber",
2200
+ leaderboard: users,
2201
+ rowNumber: 10,
2202
+ viewerRank: {
2203
+ firstName: "Viktor",
2204
+ lastInitial: "V",
2205
+ textValue: "82",
2206
+ rank: 1,
2207
+ rowNumber: 1,
2208
+ },
2209
+ },
2210
+ elements: {
2211
+ ...defaultElements$1,
2212
+ },
2213
+ };
2214
+ return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2215
+ };
2189
2216
  const PointsLeaderboard = () => {
2190
2217
  const props = {
2191
2218
  states: {
@@ -2264,7 +2291,7 @@ const ViewerOutside = () => {
2264
2291
  lastInitial: "C",
2265
2292
  textValue: "8",
2266
2293
  rowNumber: 11,
2267
- rank: 23,
2294
+ rank: 24,
2268
2295
  },
2269
2296
  },
2270
2297
  elements: {
@@ -2295,6 +2322,33 @@ const ViewerAnonymous = () => {
2295
2322
  };
2296
2323
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2297
2324
  };
2325
+ const HideNamesWithViewerOutside = () => {
2326
+ const props = {
2327
+ states: {
2328
+ loading: false,
2329
+ hasLeaders: true,
2330
+ styles: {
2331
+ ...defaultStyles$1,
2332
+ showRank: true,
2333
+ hideNames: true,
2334
+ },
2335
+ },
2336
+ data: {
2337
+ rankType: "rowNumber",
2338
+ leaderboard: users,
2339
+ rowNumber: 10,
2340
+ viewerRank: {
2341
+ textValue: "8",
2342
+ rowNumber: 11,
2343
+ rank: 42,
2344
+ },
2345
+ },
2346
+ elements: {
2347
+ ...defaultElements$1,
2348
+ },
2349
+ };
2350
+ return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2351
+ };
2298
2352
  const HideViewer = () => {
2299
2353
  const props = {
2300
2354
  states: {
@@ -2325,21 +2379,77 @@ const HideViewer = () => {
2325
2379
  };
2326
2380
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2327
2381
  };
2382
+ const HideNames = () => {
2383
+ const props = {
2384
+ states: {
2385
+ loading: false,
2386
+ hasLeaders: true,
2387
+ rowNumber: 10,
2388
+ styles: {
2389
+ ...defaultStyles$1,
2390
+ showRank: true,
2391
+ hideNames: true,
2392
+ },
2393
+ },
2394
+ data: {
2395
+ rankType: "rowNumber",
2396
+ leaderboard: users,
2397
+ rowNumber: 10,
2398
+ viewerRank: {
2399
+ firstName: "Viktor",
2400
+ lastInitial: "V",
2401
+ textValue: "82",
2402
+ rowNumber: 1,
2403
+ rank: 1,
2404
+ },
2405
+ },
2406
+ elements: {
2407
+ ...defaultElements$1,
2408
+ },
2409
+ };
2410
+ return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2411
+ };
2412
+ const LeaderboardWithNoNamesAndGraphic = () => {
2413
+ return (index.h("div", { style: {
2414
+ display: "flex",
2415
+ alignItems: "flex-start",
2416
+ justifyContent: "center",
2417
+ width: "100%",
2418
+ gap: "50px",
2419
+ } },
2420
+ index.h("div", { style: {
2421
+ display: "flex",
2422
+ flexDirection: "column",
2423
+ alignItems: "center",
2424
+ justifyContent: "center",
2425
+ gap: "10px",
2426
+ maxWidth: "30%",
2427
+ } },
2428
+ index.h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
2429
+ index.h("h2", { style: { margin: "auto" } }, " Top Performers"),
2430
+ index.h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
2431
+ index.h("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" },
2432
+ 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" }))));
2433
+ };
2328
2434
 
2329
2435
  const Leaderboard = /*#__PURE__*/Object.freeze({
2330
2436
  __proto__: null,
2331
2437
  'default': Leaderboard_stories,
2332
2438
  Empty: Empty$1,
2333
- Essentials: Essentials,
2334
2439
  Loading: Loading,
2440
+ Essentials: Essentials,
2335
2441
  One: One,
2336
2442
  Five: Five,
2337
2443
  ReferralLeaderboard: ReferralLeaderboard,
2444
+ ReferralLeaderboardWithMaxWidth: ReferralLeaderboardWithMaxWidth,
2338
2445
  PointsLeaderboard: PointsLeaderboard,
2339
2446
  TenWithRank: TenWithRank,
2340
2447
  ViewerOutside: ViewerOutside,
2341
2448
  ViewerAnonymous: ViewerAnonymous,
2342
- HideViewer: HideViewer
2449
+ HideNamesWithViewerOutside: HideNamesWithViewerOutside,
2450
+ HideViewer: HideViewer,
2451
+ HideNames: HideNames,
2452
+ LeaderboardWithNoNamesAndGraphic: LeaderboardWithNoNamesAndGraphic
2343
2453
  });
2344
2454
 
2345
2455
  const HookStoryAddon = ({ story }, children) => {
@@ -11558,6 +11668,18 @@ const SpaceEvenly = () => {
11558
11668
  index.h("p", null, "Points Balance")))),
11559
11669
  index.h("sqm-scroll", { "scroll-id": "tab-2", outline: true, "button-type": "primary", "button-text": "Redeem your rewards", mobile: true }))));
11560
11670
  };
11671
+ const ResponsiveBox = () => {
11672
+ return (index.h("div", { style: { width: "100%", maxWidth: "1000px", border: "1px dashed grey" } },
11673
+ index.h("sqm-portal-container", { center: true, direction: "row", display: "flex", "justify-content": "space-between", "flex-wrap": "nowrap" },
11674
+ index.h("sqm-stat-container", { space: "xxx-large", display: "flex" },
11675
+ index.h("sqm-big-stat", { "flex-reverse": "true", alignment: "left", "stat-type": "/rewardsRedeemed/CREDIT/global" },
11676
+ index.h("sqm-text", null,
11677
+ index.h("p", null, "Rewards Redeemed"))),
11678
+ index.h("sqm-big-stat", { "flex-reverse": "true", alignment: "left", "stat-type": "/rewardBalance/CREDIT/POINT/value/global" },
11679
+ index.h("sqm-text", null,
11680
+ index.h("p", null, "Points Balance")))),
11681
+ index.h("sqm-scroll", { "scroll-id": "tab-2", outline: true, "button-type": "primary", "button-text": "Redeem your rewards", mobile: true }))));
11682
+ };
11561
11683
  const Start$1 = () => {
11562
11684
  return (index.h("div", { style: { width: "1000px", border: "1px dashed grey" } },
11563
11685
  index.h("sqm-portal-container", { center: true, direction: "row", display: "flex", "justify-content": "start" },
@@ -11621,6 +11743,7 @@ const PortalContainer = /*#__PURE__*/Object.freeze({
11621
11743
  SpaceBetween: SpaceBetween,
11622
11744
  SpaceAround: SpaceAround,
11623
11745
  SpaceEvenly: SpaceEvenly,
11746
+ ResponsiveBox: ResponsiveBox,
11624
11747
  Start: Start$1,
11625
11748
  Center: Center,
11626
11749
  End: End,
@@ -37,8 +37,8 @@ export const SlottedIntoComponent = () => {
37
37
  data: {
38
38
  rankType: "rowNumber",
39
39
  leaderboard: [],
40
- showUser: true,
41
40
  rowNumber: 10,
41
+ showUser: true,
42
42
  userRank: {
43
43
  firstName: "Kutay",
44
44
  lastInitial: "C",
@@ -11,7 +11,7 @@ export function ImageView(props) {
11
11
  },
12
12
  Image: {
13
13
  minHeight: props.minHeight || "100%",
14
- width: "100%",
14
+ width: props.width || "100%",
15
15
  maxWidth: "max-content",
16
16
  objectFit: "cover",
17
17
  },
@@ -126,6 +126,26 @@ export class Image {
126
126
  },
127
127
  "attribute": "min-height",
128
128
  "reflect": false
129
+ },
130
+ "width": {
131
+ "type": "string",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "string",
135
+ "resolved": "string",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [{
142
+ "text": "Width",
143
+ "name": "uiName"
144
+ }],
145
+ "text": "(Optional) Constrains the width of the image. Can be a pixel value or a percentage i.e. \"500px\", \"33%\", etc."
146
+ },
147
+ "attribute": "width",
148
+ "reflect": false
129
149
  }
130
150
  }; }
131
151
  }