@saasquatch/mint-components 1.3.1-6 → 1.3.2-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -31
- package/dist/cjs/{ShadowViewAddon-a33867b9.js → ShadowViewAddon-d2fde0a2.js} +1 -1
- package/dist/cjs/{global-f4f5e602.js → global-e04d7cde.js} +279 -70
- package/dist/cjs/{index.module-e9dac160.js → index.module-07ed6ad2.js} +4 -2
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mint-components.cjs.js +3 -3
- package/dist/cjs/{re-render-3acba68a.js → re-render-81649c33.js} +1 -1
- package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
- package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-divided-layout_26.cjs.entry.js → sqm-divided-layout_30.cjs.entry.js} +2607 -168
- package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-leaderboard-rank-view-54299e38.js → sqm-leaderboard-rank-view-0ba128e2.js} +2 -2
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
- package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-navigation-sidebar-item-view-daa9c2e1.js → sqm-navigation-sidebar-item-view-0bad789c.js} +1 -1
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
- package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-395079fe.js → sqm-portal-email-verification-view-3c7d8701.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +4 -4
- package/dist/cjs/{sqm-portal-footer-view-c82aedb5.js → sqm-portal-footer-view-8f5d682e.js} +1 -1
- package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-profile-view-9fa00ccd.js → sqm-portal-profile-view-14866b58.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
- package/dist/cjs/{useDemoBigStat-e99cc8a2.js → useDemoBigStat-1692a6a1.js} +119 -22
- package/dist/collection/collection-manifest.json +7 -3
- package/dist/collection/{stories → components/sqm-asset-card}/AssetCard.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-big-stat}/BigStat.stories.js +10 -3
- package/dist/collection/{stories → components/sqm-big-stat}/UseBigStat.stories.js +7 -4
- package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -21
- package/dist/collection/components/sqm-big-stat/useBigStat.js +117 -21
- package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
- package/dist/collection/{stories → components/sqm-divided-layout}/DividedLayout.stories.js +4 -4
- package/dist/collection/{stories → components/sqm-edit-profile}/EditProfileForm.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-edit-profile}/UseEditProfile.stories.js +1 -1
- package/dist/collection/{stories → components/sqm-form-message}/FormMessage.stories.js +1 -1
- package/dist/collection/{stories → components/sqm-hero}/Hero.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-leaderboard}/Leaderboard.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-leaderboard}/UseLeaderboard.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-leaderboard-rank}/LeaderboardRank.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-name-fields}/NameFields.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-navigation-sidebar}/NavigationSidebar.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-navigation-sidebar-item}/SidebarItem.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-password-field}/PasswordField.stories.js +1 -1
- package/dist/collection/{stories → components/sqm-portal-change-password}/ChangePassword.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-portal-email-verification}/PortalEmailVerification.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-portal-footer}/PortalFooter.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-portal-forgot-password}/PortalForgotPassword.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-portal-frame}/PortalFrame.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-portal-login}/PortalLogin.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-portal-profile}/PortalProfile.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-portal-register}/PortalRegister.stories.js +2 -2
- package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
- package/dist/collection/{stories → components/sqm-portal-reset-password}/PortalResetPassword.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-portal-verify-email}/PortalVerifyEmail.stories.js +3 -3
- package/dist/collection/{stories → components/sqm-program-menu}/ProgramMenu.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-referral-iframe}/ReferralIframe.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-referral-table}/ReferralTable.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-referral-table}/ReferralTableCell.stories.js +1 -1
- package/dist/collection/{stories → components/sqm-referral-table}/ReferralTableRewardsCell.stories.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-date-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-status-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-user-column.js +1 -1
- package/dist/collection/components/sqm-referral-table/useReferralTable.js +2 -2
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +21 -0
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +218 -0
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +8 -0
- package/dist/collection/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.js +143 -0
- package/dist/collection/components/sqm-reward-exchange-list/assets/Reward-icon.png +0 -0
- package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +60 -0
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +269 -0
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +121 -0
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +198 -0
- package/dist/collection/components/sqm-rewards-table/UseRewardsTable.stories.js +53 -0
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table-column.js +120 -0
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +222 -0
- package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +190 -0
- package/dist/collection/{stories → components/sqm-router}/Router.stories.js +1 -1
- package/dist/collection/{stories → components/sqm-share-button}/ShareButton.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-share-button}/UseShareButton.stories.js +2 -2
- package/dist/collection/components/sqm-share-button/sqm-share-button.js +1 -1
- package/dist/collection/{stories → components/sqm-share-link}/ShareLink.stories.js +2 -2
- package/dist/collection/{stories → components/sqm-share-link}/UseShareLink.stories.js +3 -3
- package/dist/collection/components/sqm-share-link/useShareLink.js +1 -2
- package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +48 -36
- package/dist/collection/components/sqm-task-card/Matrix.js +63 -0
- package/dist/collection/components/sqm-task-card/SVGs.js +9 -0
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +330 -0
- package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
- package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +173 -0
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +384 -0
- package/dist/collection/{stories → components/sqm-user-name}/UserName.stories.js +3 -3
- package/dist/collection/global/styles.js +278 -69
- package/dist/collection/global/styles.ts +278 -69
- package/dist/collection/stories/NewPortal.stories.js +15 -15
- package/dist/collection/tables/GenericTableView.js +51 -0
- package/dist/collection/tables/TableSlots.js +22 -0
- package/dist/collection/{components/sqm-referral-table → tables}/re-render.js +0 -0
- package/dist/collection/{components/sqm-referral-table → tables}/sqm-table-cell.js +0 -0
- package/dist/collection/{components/sqm-referral-table → tables}/sqm-table-row.js +0 -0
- package/dist/collection/{components/sqm-referral-table → tables}/useChildElements.js +0 -0
- package/dist/esm/{ShadowViewAddon-7cbc6390.js → ShadowViewAddon-aa087ef2.js} +1 -1
- package/dist/esm/{global-5dfb4fa8.js → global-107bb084.js} +279 -70
- package/dist/esm/{index.module-07f3fbb0.js → index.module-1f571929.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/{re-render-0be5746e.js → re-render-76c9129f.js} +1 -1
- package/dist/esm/sqm-asset-card.entry.js +1 -1
- package/dist/esm/sqm-big-stat.entry.js +2 -2
- package/dist/esm/{sqm-divided-layout_26.entry.js → sqm-divided-layout_30.entry.js} +2605 -170
- package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm/{sqm-leaderboard-rank-view-04161da4.js → sqm-leaderboard-rank-view-c1aefdd5.js} +2 -2
- package/dist/esm/sqm-leaderboard-rank.entry.js +3 -3
- package/dist/esm/sqm-leaderboard.entry.js +2 -2
- package/dist/esm/sqm-name-fields.entry.js +1 -1
- package/dist/esm/{sqm-navigation-sidebar-item-view-78631800.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-d6ffe3b8.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +4 -4
- package/dist/esm/{sqm-portal-footer-view-5aa288c9.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
- package/dist/esm/sqm-portal-footer.entry.js +3 -3
- package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
- package/dist/esm/sqm-portal-logout.entry.js +1 -1
- package/dist/esm/{sqm-portal-profile-view-636a8688.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +3 -3
- package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm/sqm-referral-table-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
- package/dist/esm/sqm-share-code.entry.js +1 -1
- package/dist/esm/{useDemoBigStat-531a4d2a.js → useDemoBigStat-49cdfe32.js} +119 -22
- package/dist/esm-es5/{ShadowViewAddon-7cbc6390.js → ShadowViewAddon-aa087ef2.js} +1 -1
- package/dist/esm-es5/{global-5dfb4fa8.js → global-107bb084.js} +2 -2
- package/dist/esm-es5/{index.module-07f3fbb0.js → index.module-1f571929.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/{re-render-0be5746e.js → re-render-76c9129f.js} +1 -1
- package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
- package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -0
- package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm-es5/{sqm-leaderboard-rank-view-04161da4.js → sqm-leaderboard-rank-view-c1aefdd5.js} +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
- package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
- package/dist/esm-es5/{sqm-navigation-sidebar-item-view-78631800.js → sqm-navigation-sidebar-item-view-b3618185.js} +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-d6ffe3b8.js → sqm-portal-email-verification-view-df0559b0.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-footer-view-5aa288c9.js → sqm-portal-footer-view-2b2bfc9e.js} +1 -1
- package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-636a8688.js → sqm-portal-profile-view-2fbb0845.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
- package/dist/esm-es5/sqm-share-code.entry.js +1 -1
- package/dist/esm-es5/useDemoBigStat-49cdfe32.js +1 -0
- package/dist/mint-components/assets/Reward-icon.png +0 -0
- package/dist/mint-components/global/styles.ts +278 -69
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-cb8a3610.system.entry.js → p-03b7444e.system.entry.js} +1 -1
- package/dist/mint-components/{p-b745adaa.system.js → p-0470556b.system.js} +1 -1
- package/dist/mint-components/{p-6bbb9d5a.system.entry.js → p-0ca63e9e.system.entry.js} +1 -1
- package/dist/mint-components/{p-4ca49eb2.system.entry.js → p-0ddd6063.system.entry.js} +1 -1
- package/dist/mint-components/{p-a12e34b0.entry.js → p-0f19ab40.entry.js} +1 -1
- package/dist/mint-components/{p-84da6c55.system.entry.js → p-123930ab.system.entry.js} +1 -1
- package/dist/mint-components/p-20991bdd.system.entry.js +1 -0
- package/dist/mint-components/{p-3f3b81de.system.js → p-22ee65c4.system.js} +1 -1
- package/dist/mint-components/{p-f05f6004.system.entry.js → p-2b9a01ce.system.entry.js} +1 -1
- package/dist/mint-components/{p-705141c1.entry.js → p-3b9492a8.entry.js} +1 -1
- package/dist/mint-components/{p-11fe72bd.entry.js → p-3bbc61af.entry.js} +1 -1
- package/dist/mint-components/{p-99f85aae.js → p-3fd9db63.js} +1 -1
- package/dist/mint-components/p-458070cf.js +1 -0
- package/dist/mint-components/{p-1c69eba7.js → p-4ae9f594.js} +1 -1
- package/dist/mint-components/{p-7e6a38d0.system.entry.js → p-57568b23.system.entry.js} +1 -1
- package/dist/mint-components/{p-453df041.entry.js → p-57aa7493.entry.js} +1 -1
- package/dist/mint-components/p-5986de11.entry.js +1 -0
- package/dist/mint-components/p-59fa991d.entry.js +335 -0
- package/dist/mint-components/{p-cac1ffd0.entry.js → p-5a1a2b2c.entry.js} +1 -1
- package/dist/mint-components/{p-552a99b9.system.js → p-5e681b4b.system.js} +1 -1
- package/dist/mint-components/p-62b134cb.system.entry.js +1 -0
- package/dist/mint-components/{p-9fb97b00.system.entry.js → p-64299f78.system.entry.js} +1 -1
- package/dist/mint-components/p-6466d643.entry.js +1 -0
- package/dist/mint-components/{p-91c46672.js → p-70008004.js} +1 -1
- package/dist/mint-components/{p-a1029019.system.entry.js → p-70a6f9d9.system.entry.js} +1 -1
- package/dist/mint-components/p-719c2664.system.js +1 -0
- package/dist/mint-components/p-75924795.system.entry.js +1 -0
- package/dist/mint-components/{p-55580223.system.js → p-8155cd07.system.js} +1 -1
- package/dist/mint-components/{p-f5333477.system.entry.js → p-86a55c58.system.entry.js} +1 -1
- package/dist/mint-components/{p-087571f1.entry.js → p-874e7da3.entry.js} +1 -1
- package/dist/mint-components/{p-d9123a4a.system.entry.js → p-8ac0ec83.system.entry.js} +1 -1
- package/dist/mint-components/{p-d32ebb2d.system.js → p-91b0d151.system.js} +1 -1
- package/dist/mint-components/{p-45befbb8.system.entry.js → p-9ca6142b.system.entry.js} +1 -1
- package/dist/mint-components/{p-e3d75555.entry.js → p-a26457cd.entry.js} +1 -1
- package/dist/mint-components/{p-ccddec52.js → p-a37fc3cb.js} +1 -1
- package/dist/mint-components/p-a48fc54e.system.js +1 -0
- package/dist/mint-components/{p-6accffd6.js → p-ab378185.js} +1 -1
- package/dist/mint-components/p-ac92b5ea.js +235 -0
- package/dist/mint-components/{p-6a9b7f7c.entry.js → p-b0c6f82b.entry.js} +1 -1
- package/dist/mint-components/{p-df3a9a38.entry.js → p-b0e9c89c.entry.js} +1 -1
- package/dist/mint-components/{p-d98a6a1c.entry.js → p-b3bac2c6.entry.js} +1 -1
- package/dist/mint-components/{p-40f1482a.system.entry.js → p-bcb30771.system.entry.js} +1 -1
- package/dist/mint-components/{p-6a95537b.system.js → p-bdfdb088.system.js} +1 -1
- package/dist/mint-components/{p-7f7f60ea.entry.js → p-beb02af2.entry.js} +1 -1
- package/dist/mint-components/{p-77cf28f1.system.js → p-beeeda0c.system.js} +2 -2
- package/dist/mint-components/p-bf10c781.system.js +1 -0
- package/dist/mint-components/{p-ab551be3.system.entry.js → p-c0e8aaa7.system.entry.js} +1 -1
- package/dist/mint-components/{p-24cc7ee3.system.entry.js → p-c35b54e4.system.entry.js} +1 -1
- package/dist/mint-components/{p-2818f3a0.entry.js → p-c61c61e7.entry.js} +1 -1
- package/dist/mint-components/{p-94c25cfe.entry.js → p-c974b7d4.entry.js} +1 -1
- package/dist/mint-components/{p-aeb995ca.entry.js → p-cbf1db2b.entry.js} +1 -1
- package/dist/mint-components/{p-0d3f2c66.entry.js → p-d1e28563.entry.js} +1 -1
- package/dist/mint-components/{p-b95eaf63.entry.js → p-d37f227e.entry.js} +1 -1
- package/dist/mint-components/{p-730785e9.system.js → p-d44e98b8.system.js} +1 -1
- package/dist/mint-components/{p-80a40e90.js → p-d73d26ec.js} +2 -2
- package/dist/mint-components/{p-ab9ef09d.entry.js → p-dacbf435.entry.js} +1 -1
- package/dist/mint-components/{p-1af6d49d.system.entry.js → p-dbc04567.system.entry.js} +1 -1
- package/dist/mint-components/{p-4018d7eb.entry.js → p-de0efef2.entry.js} +1 -1
- package/dist/mint-components/{p-72420d6b.system.entry.js → p-e01213a2.system.entry.js} +1 -1
- package/dist/mint-components/p-e2a855b8.system.entry.js +1 -0
- package/dist/mint-components/{p-0996811b.entry.js → p-f0ad9b15.entry.js} +1 -1
- package/dist/mint-components/{p-23f0e229.system.entry.js → p-f0cbf76e.system.entry.js} +1 -1
- package/dist/mint-components/{p-48b04ef0.entry.js → p-f2db1c3b.entry.js} +1 -1
- package/dist/mint-components/{p-e1549548.system.entry.js → p-f538a675.system.entry.js} +1 -1
- package/dist/mint-components/{p-8edba448.js → p-f7e2418a.js} +1 -1
- package/dist/mint-components/{p-f7118fd5.js → p-f8abbd79.js} +1 -1
- package/dist/mint-components/{p-92671ed2.system.entry.js → p-fc90a3fe.system.entry.js} +1 -1
- package/dist/types/{stories → components/sqm-asset-card}/AssetCard.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-big-stat}/BigStat.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-big-stat}/UseBigStat.stories.d.ts +6 -0
- package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
- package/dist/types/components/sqm-big-stat/sqm-big-stat.d.ts +0 -6
- package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
- package/dist/types/{stories → components/sqm-divided-layout}/DividedLayout.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-edit-profile}/EditProfileForm.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-edit-profile}/UseEditProfile.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-form-message}/FormMessage.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-hero}/Hero.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-leaderboard}/Leaderboard.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-leaderboard}/UseLeaderboard.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-leaderboard-rank}/LeaderboardRank.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-name-fields}/NameFields.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-navigation-sidebar}/NavigationSidebar.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-navigation-sidebar-item}/SidebarItem.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-password-field}/PasswordField.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-change-password}/ChangePassword.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-email-verification}/PortalEmailVerification.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-footer}/PortalFooter.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-forgot-password}/PortalForgotPassword.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-frame}/PortalFrame.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-login}/PortalLogin.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-profile}/PortalProfile.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-register}/PortalRegister.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-reset-password}/PortalResetPassword.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-portal-verify-email}/PortalVerifyEmail.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-program-menu}/ProgramMenu.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-referral-iframe}/ReferralIframe.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-referral-table}/ReferralTable.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-referral-table}/ReferralTableCell.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-referral-table}/ReferralTableRewardsCell.stories.d.ts +0 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +6 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +81 -0
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +3 -0
- package/dist/types/components/sqm-reward-exchange-list/UseRewardExchangeList.stories.d.ts +28 -0
- package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +4 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +25 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +20 -0
- package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +43 -0
- package/dist/types/components/sqm-rewards-table/UseRewardsTable.stories.d.ts +16 -0
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table-column.d.ts +20 -0
- package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +32 -0
- package/dist/types/components/sqm-rewards-table/useRewardsTable.d.ts +38 -0
- package/dist/types/{stories → components/sqm-router}/Router.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-share-button}/ShareButton.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-share-button}/UseShareButton.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-share-link}/ShareLink.stories.d.ts +0 -0
- package/dist/types/{stories → components/sqm-share-link}/UseShareLink.stories.d.ts +0 -0
- package/dist/types/components/sqm-task-card/Matrix.d.ts +11 -0
- package/dist/types/components/sqm-task-card/SVGs.d.ts +2 -0
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +11 -0
- package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
- package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +10 -0
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
- package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +16 -0
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +73 -0
- package/dist/types/components/sqm-user-name/UserName.stories.d.ts +6 -0
- package/dist/types/components.d.ts +269 -10
- package/dist/types/global/styles.d.ts +1 -1
- package/dist/types/tables/GenericTableView.d.ts +29 -0
- package/dist/types/tables/TableSlots.d.ts +8 -0
- package/dist/types/{components/sqm-referral-table → tables}/re-render.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → tables}/sqm-table-cell.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → tables}/sqm-table-row.d.ts +0 -0
- package/dist/types/{components/sqm-referral-table → tables}/useChildElements.d.ts +0 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/sqm-divided-layout_26.entry.js +0 -1
- package/dist/esm-es5/useDemoBigStat-531a4d2a.js +0 -1
- package/dist/mint-components/p-0ed2de6a.js +0 -1
- package/dist/mint-components/p-253d07a3.system.entry.js +0 -1
- package/dist/mint-components/p-3ace9bab.entry.js +0 -230
- package/dist/mint-components/p-3e5c8dc2.entry.js +0 -1
- package/dist/mint-components/p-3fc2b5d4.system.js +0 -1
- package/dist/mint-components/p-420e50a8.entry.js +0 -1
- package/dist/mint-components/p-44a83e6e.system.js +0 -1
- package/dist/mint-components/p-4a9dcc1f.system.js +0 -1
- package/dist/mint-components/p-52be0df6.js +0 -227
- package/dist/mint-components/p-54d90d9f.system.entry.js +0 -1
- package/dist/mint-components/p-a60e8e00.system.entry.js +0 -1
- package/dist/mint-components/p-c6f2d1f4.system.entry.js +0 -1
- package/dist/types/stories/UserName.stories.d.ts +0 -6
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b0129cd6.js');
|
|
6
6
|
const _extends = require('./extends-0302d27d.js');
|
|
7
|
-
const global = require('./global-
|
|
7
|
+
const global = require('./global-e04d7cde.js');
|
|
8
8
|
const useCallback = require('./use-callback-fadb2643.js');
|
|
9
|
-
const index_module = require('./index.module-
|
|
9
|
+
const index_module = require('./index.module-07ed6ad2.js');
|
|
10
10
|
const jsonpointer = require('./jsonpointer-11327262.js');
|
|
11
11
|
const jssPresetDefault_esm = require('./jss-preset-default.esm-6304d24f.js');
|
|
12
12
|
const utils = require('./utils-95e5317c.js');
|
|
@@ -15,21 +15,21 @@ const mixins = require('./mixins-7b7c59fe.js');
|
|
|
15
15
|
const sqmPortalContainerView = require('./sqm-portal-container-view-d144735a.js');
|
|
16
16
|
const sqmPortalSectionView = require('./sqm-portal-section-view-3b008930.js');
|
|
17
17
|
const sqmTextSpanView = require('./sqm-text-span-view-b5ae787b.js');
|
|
18
|
-
const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-
|
|
19
|
-
const reRender = require('./re-render-
|
|
20
|
-
const useDemoBigStat = require('./useDemoBigStat-
|
|
18
|
+
const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-0ba128e2.js');
|
|
19
|
+
const reRender = require('./re-render-81649c33.js');
|
|
20
|
+
const useDemoBigStat = require('./useDemoBigStat-1692a6a1.js');
|
|
21
21
|
const sqmShareLinkView = require('./sqm-share-link-view-a935d07e.js');
|
|
22
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
22
|
+
const ShadowViewAddon = require('./ShadowViewAddon-d2fde0a2.js');
|
|
23
23
|
const sqmNavigationSidebarView = require('./sqm-navigation-sidebar-view-d06e1885.js');
|
|
24
|
-
const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-
|
|
24
|
+
const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-0bad789c.js');
|
|
25
25
|
const sqmStatContainerView = require('./sqm-stat-container-view-ee7b00ff.js');
|
|
26
|
-
const sqmPortalProfileView = require('./sqm-portal-profile-view-
|
|
26
|
+
const sqmPortalProfileView = require('./sqm-portal-profile-view-14866b58.js');
|
|
27
27
|
const sqmPortalForgotPasswordView = require('./sqm-portal-forgot-password-view-1704d285.js');
|
|
28
|
-
const sqmPortalEmailVerificationView = require('./sqm-portal-email-verification-view-
|
|
28
|
+
const sqmPortalEmailVerificationView = require('./sqm-portal-email-verification-view-3c7d8701.js');
|
|
29
29
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-4d78fd6d.js');
|
|
30
30
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-b595e302.js');
|
|
31
31
|
const sqmAssetCardView = require('./sqm-asset-card-view-07f86880.js');
|
|
32
|
-
const sqmPortalFooterView = require('./sqm-portal-footer-view-
|
|
32
|
+
const sqmPortalFooterView = require('./sqm-portal-footer-view-8f5d682e.js');
|
|
33
33
|
const sqmHeroView = require('./sqm-hero-view-bb3d00a1.js');
|
|
34
34
|
const sqmNameFieldsView = require('./sqm-name-fields-view-24614ac7.js');
|
|
35
35
|
|
|
@@ -14749,6 +14749,927 @@ const ReferralTableUserCell = class {
|
|
|
14749
14749
|
}
|
|
14750
14750
|
};
|
|
14751
14751
|
|
|
14752
|
+
const GET_EXCHANGE_LIST = index_module.dist.gql `
|
|
14753
|
+
query getExchangeList {
|
|
14754
|
+
viewer {
|
|
14755
|
+
... on User {
|
|
14756
|
+
visibleRewardExchangeItems(limit: 20, offset: 0) {
|
|
14757
|
+
data {
|
|
14758
|
+
key
|
|
14759
|
+
name
|
|
14760
|
+
description
|
|
14761
|
+
imageUrl
|
|
14762
|
+
available
|
|
14763
|
+
unavailableReason
|
|
14764
|
+
unavailableReasonCode
|
|
14765
|
+
ruleType
|
|
14766
|
+
sourceUnit
|
|
14767
|
+
sourceValue
|
|
14768
|
+
prettySourceValue
|
|
14769
|
+
sourceMinValue
|
|
14770
|
+
prettySourceMinValue
|
|
14771
|
+
sourceMaxValue
|
|
14772
|
+
prettySourceMaxValue
|
|
14773
|
+
destinationMinValue
|
|
14774
|
+
prettyDestinationMinValue
|
|
14775
|
+
destinationMaxValue
|
|
14776
|
+
prettyDestinationMaxValue
|
|
14777
|
+
globalRewardKey
|
|
14778
|
+
destinationUnit
|
|
14779
|
+
steps {
|
|
14780
|
+
sourceValue
|
|
14781
|
+
prettySourceValue
|
|
14782
|
+
destinationValue
|
|
14783
|
+
prettyDestinationValue
|
|
14784
|
+
available
|
|
14785
|
+
unavailableReasonCode
|
|
14786
|
+
}
|
|
14787
|
+
}
|
|
14788
|
+
totalCount
|
|
14789
|
+
}
|
|
14790
|
+
}
|
|
14791
|
+
}
|
|
14792
|
+
}
|
|
14793
|
+
`;
|
|
14794
|
+
const EXCHANGE = index_module.dist.gql `
|
|
14795
|
+
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
14796
|
+
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
14797
|
+
reward {
|
|
14798
|
+
id
|
|
14799
|
+
fuelTankCode
|
|
14800
|
+
}
|
|
14801
|
+
}
|
|
14802
|
+
}
|
|
14803
|
+
`;
|
|
14804
|
+
function useRewardExchangeList(props) {
|
|
14805
|
+
var _a, _b, _c, _d;
|
|
14806
|
+
const drawerRef = _extends.useRef();
|
|
14807
|
+
const [exchangeState, setExchangeState] = _extends.useReducer((state, next) => ({
|
|
14808
|
+
...state,
|
|
14809
|
+
...next,
|
|
14810
|
+
}), {
|
|
14811
|
+
selectedItem: undefined,
|
|
14812
|
+
selectedStep: undefined,
|
|
14813
|
+
redeemStage: "chooseReward",
|
|
14814
|
+
amount: 0,
|
|
14815
|
+
exchangeError: false,
|
|
14816
|
+
});
|
|
14817
|
+
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
14818
|
+
const user = index_module.T();
|
|
14819
|
+
const [exchange, { data: exchangeResponse, errors }] = index_module.be(EXCHANGE);
|
|
14820
|
+
const { data, loading } = index_module.en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14821
|
+
_extends.useEffect(() => {
|
|
14822
|
+
var _a, _b;
|
|
14823
|
+
if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
|
|
14824
|
+
setExchangeState({ redeemStage: "success" });
|
|
14825
|
+
}
|
|
14826
|
+
if (!!errors) {
|
|
14827
|
+
console.log("YEA");
|
|
14828
|
+
setExchangeState({ exchangeError: true });
|
|
14829
|
+
}
|
|
14830
|
+
}, [exchangeResponse, errors]);
|
|
14831
|
+
function openDrawer() {
|
|
14832
|
+
var _a;
|
|
14833
|
+
setExchangeState({ redeemStage: "chooseReward" });
|
|
14834
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
|
|
14835
|
+
}
|
|
14836
|
+
function exchangeReward() {
|
|
14837
|
+
if (!selectedItem)
|
|
14838
|
+
return;
|
|
14839
|
+
let exchangeVariables = {
|
|
14840
|
+
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
14841
|
+
userId: user.id,
|
|
14842
|
+
};
|
|
14843
|
+
switch (selectedItem.ruleType) {
|
|
14844
|
+
case "FIXED_GLOBAL_REWARD":
|
|
14845
|
+
exchangeVariables = {
|
|
14846
|
+
...exchangeVariables,
|
|
14847
|
+
redeemCreditInput: {
|
|
14848
|
+
amount: selectedItem.sourceValue,
|
|
14849
|
+
unit: selectedItem.sourceUnit,
|
|
14850
|
+
},
|
|
14851
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14852
|
+
};
|
|
14853
|
+
break;
|
|
14854
|
+
case "VARIABLE_GLOBAL_REWARD":
|
|
14855
|
+
exchangeVariables = {
|
|
14856
|
+
...exchangeVariables,
|
|
14857
|
+
redeemCreditInput: {
|
|
14858
|
+
amount: amount,
|
|
14859
|
+
unit: selectedItem.sourceUnit,
|
|
14860
|
+
},
|
|
14861
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14862
|
+
rewardInput: {
|
|
14863
|
+
valueInCents: selectedStep.destinationValue,
|
|
14864
|
+
},
|
|
14865
|
+
};
|
|
14866
|
+
break;
|
|
14867
|
+
case "VARIABLE_CREDIT_REWARD":
|
|
14868
|
+
exchangeVariables = {
|
|
14869
|
+
...exchangeVariables,
|
|
14870
|
+
redeemCreditInput: {
|
|
14871
|
+
amount: amount,
|
|
14872
|
+
unit: selectedItem.sourceUnit,
|
|
14873
|
+
},
|
|
14874
|
+
rewardInput: {
|
|
14875
|
+
type: "CREDIT",
|
|
14876
|
+
unit: selectedItem.destinationUnit,
|
|
14877
|
+
assignedCredit: selectedStep.destinationValue,
|
|
14878
|
+
},
|
|
14879
|
+
};
|
|
14880
|
+
break;
|
|
14881
|
+
default:
|
|
14882
|
+
exchangeVariables = {
|
|
14883
|
+
...exchangeVariables,
|
|
14884
|
+
redeemCreditInput: {
|
|
14885
|
+
amount: selectedItem.sourceValue,
|
|
14886
|
+
unit: selectedItem.sourceUnit,
|
|
14887
|
+
},
|
|
14888
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14889
|
+
};
|
|
14890
|
+
}
|
|
14891
|
+
exchange({ exchangeRewardInput: exchangeVariables });
|
|
14892
|
+
}
|
|
14893
|
+
const resetState = useCallback.useCallback((e) => {
|
|
14894
|
+
var _a, _b;
|
|
14895
|
+
// selects also trigger an sl-hide event :(
|
|
14896
|
+
//@ts-ignore - componentId is not private here
|
|
14897
|
+
if (((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.componentId) !== ((_b = drawerRef.current) === null || _b === void 0 ? void 0 : _b.componentId))
|
|
14898
|
+
return;
|
|
14899
|
+
setExchangeState({
|
|
14900
|
+
amount: 0,
|
|
14901
|
+
selectedStep: undefined,
|
|
14902
|
+
selectedItem: undefined,
|
|
14903
|
+
exchangeError: false,
|
|
14904
|
+
});
|
|
14905
|
+
}, []);
|
|
14906
|
+
_extends.useEffect(() => {
|
|
14907
|
+
if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
|
|
14908
|
+
return;
|
|
14909
|
+
const drawer = drawerRef.current;
|
|
14910
|
+
// Clear input value when drawer is closed
|
|
14911
|
+
drawer.addEventListener("sl-hide", resetState);
|
|
14912
|
+
return () => {
|
|
14913
|
+
drawer.removeEventListener("sl-hide", resetState);
|
|
14914
|
+
};
|
|
14915
|
+
}, [drawerRef.current]);
|
|
14916
|
+
function setStage(stage) {
|
|
14917
|
+
setExchangeState({ redeemStage: stage });
|
|
14918
|
+
}
|
|
14919
|
+
return {
|
|
14920
|
+
states: {
|
|
14921
|
+
content: {
|
|
14922
|
+
text: props,
|
|
14923
|
+
},
|
|
14924
|
+
selectedItem,
|
|
14925
|
+
redeemStage,
|
|
14926
|
+
amount,
|
|
14927
|
+
selectedStep,
|
|
14928
|
+
exchangeError,
|
|
14929
|
+
loading,
|
|
14930
|
+
},
|
|
14931
|
+
data: {
|
|
14932
|
+
exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
|
|
14933
|
+
//@ts-ignore
|
|
14934
|
+
fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
|
|
14935
|
+
},
|
|
14936
|
+
callbacks: {
|
|
14937
|
+
exchangeReward,
|
|
14938
|
+
openDrawer,
|
|
14939
|
+
setExchangeState,
|
|
14940
|
+
setStage,
|
|
14941
|
+
},
|
|
14942
|
+
refs: {
|
|
14943
|
+
drawerRef,
|
|
14944
|
+
},
|
|
14945
|
+
};
|
|
14946
|
+
}
|
|
14947
|
+
|
|
14948
|
+
const LeftArrow = () => (index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
|
|
14949
|
+
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
|
|
14950
|
+
const ExchangeArrows = () => (index.h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14951
|
+
index.h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
|
|
14952
|
+
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.6255 21.783C10.5129 21.8963 10.3597 21.96 10.2 21.96C10.0402 21.96 9.88705 21.8963 9.77442 21.783L5.87442 17.8597C5.64081 17.6247 5.64194 17.2448 5.87695 17.0112C6.11197 16.7775 6.49186 16.7787 6.72548 17.0137L9.59995 19.9054V8.52001C9.59995 8.18864 9.86858 7.92001 10.2 7.92001C10.5313 7.92001 10.8 8.18864 10.8 8.52001V19.9054L13.6744 17.0137C13.908 16.7787 14.2879 16.7775 14.5229 17.0112C14.758 17.2448 14.7591 17.6247 14.5255 17.8597L10.6255 21.783ZM20.2255 8.09707C20.1129 7.98378 19.9597 7.92007 19.8 7.92007C19.6402 7.92007 19.487 7.98378 19.3744 8.09707L15.4744 12.0204C15.2408 12.2554 15.2419 12.6353 15.477 12.8689C15.712 13.1025 16.0919 13.1014 16.3255 12.8664L19.2 9.97473V21.3601C19.2 21.6914 19.4686 21.9601 19.8 21.9601C20.1313 21.9601 20.4 21.6914 20.4 21.3601V9.97473L23.2744 12.8664C23.508 13.1014 23.8879 13.1025 24.1229 12.8689C24.358 12.6353 24.3591 12.2554 24.1255 12.0204L20.2255 8.09707Z", fill: "#333333" })));
|
|
14953
|
+
const CheckMark = () => (index.h("svg", { style: { top: "-4px", position: "relative", left: "2px" }, xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
|
|
14954
|
+
index.h("path", { d: "M2.12828 2.71485C1.72536 2.33712 1.09253 2.35754 0.714799 2.76045C0.337068 3.16336 0.357483 3.7962 0.760395 4.17393L2.12828 2.71485ZM3.81471 5.66661L3.13076 6.39615C3.51542 6.75677 4.11399 6.75677 4.49865 6.39615L3.81471 5.66661ZM9.23939 1.95171C9.6423 1.57397 9.66271 0.941139 9.28498 0.538227C8.90725 0.135315 8.27442 0.114901 7.87151 0.492631L9.23939 1.95171ZM0.760395 4.17393L3.13076 6.39615L4.49865 4.93708L2.12828 2.71485L0.760395 4.17393ZM4.49865 6.39615L9.23939 1.95171L7.87151 0.492631L3.13076 4.93708L4.49865 6.39615Z", fill: "white" })));
|
|
14955
|
+
|
|
14956
|
+
function Dot({ active, completed, incomplete, }) {
|
|
14957
|
+
return (index.h("div", { style: {
|
|
14958
|
+
flex: "0 0 0",
|
|
14959
|
+
content: "''",
|
|
14960
|
+
height: "4px",
|
|
14961
|
+
borderRadius: "4px",
|
|
14962
|
+
background: incomplete ? "#E5E5E5" : "#9E9E9E",
|
|
14963
|
+
position: "relative",
|
|
14964
|
+
bottom: "0",
|
|
14965
|
+
left: "0",
|
|
14966
|
+
display: "flex",
|
|
14967
|
+
justifyContent: "center",
|
|
14968
|
+
columnGap: "50px",
|
|
14969
|
+
marginRight: "-2px",
|
|
14970
|
+
boxSizing: "content-box",
|
|
14971
|
+
} },
|
|
14972
|
+
index.h("div", { style: {
|
|
14973
|
+
backgroundColor: completed ? "#9E9E9E" : "#FFF",
|
|
14974
|
+
border: active
|
|
14975
|
+
? "2px solid #9E9E9E"
|
|
14976
|
+
: incomplete
|
|
14977
|
+
? "2px solid #E5E5E5"
|
|
14978
|
+
: "none",
|
|
14979
|
+
borderRadius: "50%",
|
|
14980
|
+
width: completed ? "14px" : "10px",
|
|
14981
|
+
height: completed ? "14px" : "10px",
|
|
14982
|
+
margin: "-5px auto 0px",
|
|
14983
|
+
zIndex: "1",
|
|
14984
|
+
boxSizing: "content-box",
|
|
14985
|
+
} }, completed && index.h(CheckMark, null))));
|
|
14986
|
+
}
|
|
14987
|
+
function ProgressLine({ incomplete = false, active = false }) {
|
|
14988
|
+
return (index.h("div", { style: {
|
|
14989
|
+
content: "''",
|
|
14990
|
+
flex: "0.5 0.5 0",
|
|
14991
|
+
height: "4px",
|
|
14992
|
+
borderRadius: "4px",
|
|
14993
|
+
background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
|
|
14994
|
+
position: "relative",
|
|
14995
|
+
bottom: "0",
|
|
14996
|
+
left: "0",
|
|
14997
|
+
display: "flex",
|
|
14998
|
+
justifyContent: "center",
|
|
14999
|
+
columnGap: "50px",
|
|
15000
|
+
marginRight: "-2px",
|
|
15001
|
+
boxSizing: "content-box",
|
|
15002
|
+
} }));
|
|
15003
|
+
}
|
|
15004
|
+
function Progress({ active, completed, incomplete }) {
|
|
15005
|
+
return [
|
|
15006
|
+
index.h(ProgressLine, { incomplete: incomplete }),
|
|
15007
|
+
index.h(Dot, { active: active, completed: completed, incomplete: incomplete }),
|
|
15008
|
+
index.h(ProgressLine, { incomplete: incomplete, active: active }),
|
|
15009
|
+
];
|
|
15010
|
+
}
|
|
15011
|
+
function ProgressBar({ stageCount, currentStage, }) {
|
|
15012
|
+
return (index.h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (index.h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
|
|
15013
|
+
}
|
|
15014
|
+
|
|
15015
|
+
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
15016
|
+
const stageProgressList = {
|
|
15017
|
+
chooseReward: "Choose reward",
|
|
15018
|
+
chooseAmount: "Amount",
|
|
15019
|
+
confirmation: "Confirm",
|
|
15020
|
+
};
|
|
15021
|
+
function RewardExchangeView(props) {
|
|
15022
|
+
const style = {
|
|
15023
|
+
Container: {
|
|
15024
|
+
position: "relative",
|
|
15025
|
+
},
|
|
15026
|
+
CardContainer: {
|
|
15027
|
+
"&:hover": {
|
|
15028
|
+
boxShadow: "0 3px 10px #87ceeb6e!important",
|
|
15029
|
+
},
|
|
15030
|
+
},
|
|
15031
|
+
Base: {
|
|
15032
|
+
display: "flex",
|
|
15033
|
+
cursor: "pointer",
|
|
15034
|
+
textAlign: "center",
|
|
15035
|
+
height: "120px",
|
|
15036
|
+
"&::part(base)": {
|
|
15037
|
+
width: "100%",
|
|
15038
|
+
maxWidth: "350px",
|
|
15039
|
+
display: "flex",
|
|
15040
|
+
margin: "0 auto",
|
|
15041
|
+
},
|
|
15042
|
+
"&::part(body)": {
|
|
15043
|
+
padding: 0,
|
|
15044
|
+
display: "flex",
|
|
15045
|
+
width: "100%",
|
|
15046
|
+
},
|
|
15047
|
+
},
|
|
15048
|
+
Drawer: {
|
|
15049
|
+
"&::part(base)": {
|
|
15050
|
+
minWidth: "400px",
|
|
15051
|
+
maxWidth: "700px",
|
|
15052
|
+
width: "50%",
|
|
15053
|
+
margin: "0 auto",
|
|
15054
|
+
right: "0",
|
|
15055
|
+
},
|
|
15056
|
+
"&::part(panel)": {
|
|
15057
|
+
height: "85vh",
|
|
15058
|
+
width: "100%",
|
|
15059
|
+
},
|
|
15060
|
+
},
|
|
15061
|
+
FullImage: {
|
|
15062
|
+
objectFit: "contain",
|
|
15063
|
+
maxWidth: "100%",
|
|
15064
|
+
height: "100px",
|
|
15065
|
+
},
|
|
15066
|
+
PreviewImage: {
|
|
15067
|
+
objectFit: "contain",
|
|
15068
|
+
width: "120px",
|
|
15069
|
+
height: "120px",
|
|
15070
|
+
flex: 0.33,
|
|
15071
|
+
},
|
|
15072
|
+
InputBox: {
|
|
15073
|
+
width: "100%",
|
|
15074
|
+
marginBottom: "20px",
|
|
15075
|
+
},
|
|
15076
|
+
Select: {
|
|
15077
|
+
"&::part(base)": {
|
|
15078
|
+
flex: "0.75",
|
|
15079
|
+
},
|
|
15080
|
+
"&::part(menu)": {
|
|
15081
|
+
maxHeight: "40vh",
|
|
15082
|
+
},
|
|
15083
|
+
},
|
|
15084
|
+
Buttons: {
|
|
15085
|
+
marginLeft: "auto",
|
|
15086
|
+
width: "100%",
|
|
15087
|
+
maxWidth: "300px",
|
|
15088
|
+
},
|
|
15089
|
+
Button: {
|
|
15090
|
+
margin: "10px 0",
|
|
15091
|
+
display: "block",
|
|
15092
|
+
textAlign: "center",
|
|
15093
|
+
cursor: "pointer",
|
|
15094
|
+
},
|
|
15095
|
+
ProgressBar: {
|
|
15096
|
+
fontSize: "80%",
|
|
15097
|
+
marginBottom: "20px",
|
|
15098
|
+
"& .text-area": {
|
|
15099
|
+
marginTop: "5px",
|
|
15100
|
+
display: "flex",
|
|
15101
|
+
justifyContent: "center",
|
|
15102
|
+
textAlign: "center",
|
|
15103
|
+
whiteSpace: "nowrap",
|
|
15104
|
+
marginBottom: "6px",
|
|
15105
|
+
"& .text": {
|
|
15106
|
+
flex: "1 1 0",
|
|
15107
|
+
},
|
|
15108
|
+
"& .text.subdued": {
|
|
15109
|
+
color: "#BDBDBD",
|
|
15110
|
+
},
|
|
15111
|
+
},
|
|
15112
|
+
},
|
|
15113
|
+
};
|
|
15114
|
+
// JSS config
|
|
15115
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
15116
|
+
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
15117
|
+
const styleString = sheet.toString();
|
|
15118
|
+
const { states, data, callbacks, refs } = props;
|
|
15119
|
+
const { selectedItem, selectedStep } = states;
|
|
15120
|
+
function getInput() {
|
|
15121
|
+
var _a, _b;
|
|
15122
|
+
const item = states.selectedItem;
|
|
15123
|
+
if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
|
|
15124
|
+
return index.h("span", null);
|
|
15125
|
+
if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
15126
|
+
return index.h("p", null,
|
|
15127
|
+
"Not enough ",
|
|
15128
|
+
item.sourceUnit,
|
|
15129
|
+
" to redeem for this reward.");
|
|
15130
|
+
}
|
|
15131
|
+
return (index.h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
|
|
15132
|
+
var _a, _b, _c, _d, _e;
|
|
15133
|
+
return callbacks.setExchangeState({
|
|
15134
|
+
amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
|
|
15135
|
+
selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
|
|
15136
|
+
});
|
|
15137
|
+
} }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (index.h("sl-menu-item", { value: step, disabled: !step.available },
|
|
15138
|
+
step.prettyDestinationValue,
|
|
15139
|
+
index.h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
|
|
15140
|
+
step.prettySourceValue,
|
|
15141
|
+
step.unavailableReasonCode && (index.h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
|
|
15142
|
+
}
|
|
15143
|
+
function chooseReward() {
|
|
15144
|
+
var _a;
|
|
15145
|
+
const nextStage = "chooseAmount";
|
|
15146
|
+
// console.log({ nextStage, ruleType: selectedItem?.ruleType });
|
|
15147
|
+
return [
|
|
15148
|
+
index.h("div", { style: {
|
|
15149
|
+
display: "grid",
|
|
15150
|
+
justifyContent: "center",
|
|
15151
|
+
gap: "20px",
|
|
15152
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
15153
|
+
} }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
15154
|
+
const style = {
|
|
15155
|
+
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
|
|
15156
|
+
marginBottom: "10px 0",
|
|
15157
|
+
flex: "1",
|
|
15158
|
+
minWidth: "100%",
|
|
15159
|
+
color: !item.available && "#eee",
|
|
15160
|
+
};
|
|
15161
|
+
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
15162
|
+
? item.prettySourceValue
|
|
15163
|
+
: `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
|
|
15164
|
+
return (index.h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
15165
|
+
index.h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
|
|
15166
|
+
callbacks.setExchangeState({ selectedItem: item }) },
|
|
15167
|
+
// item?.imageUrl &&
|
|
15168
|
+
index.h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || index.getAssetPath("./assets/Reward-icon.png") }),
|
|
15169
|
+
index.h("p", { style: {
|
|
15170
|
+
textAlign: "left",
|
|
15171
|
+
margin: "0",
|
|
15172
|
+
flex: "1",
|
|
15173
|
+
fontSize: "90%",
|
|
15174
|
+
padding: "8px"
|
|
15175
|
+
} },
|
|
15176
|
+
index.h("b", null, item.description),
|
|
15177
|
+
index.h("p", { style: { margin: "0" } }, amount),
|
|
15178
|
+
item.unavailableReasonCode && (index.h("p", { style: {
|
|
15179
|
+
fontSize: "70%",
|
|
15180
|
+
color: "#F2994A",
|
|
15181
|
+
marginTop: "0",
|
|
15182
|
+
} }, item.unavailableReasonCode ===
|
|
15183
|
+
"INSUFFICIENT_REDEEMABLE_CREDIT"
|
|
15184
|
+
? "Not enough points"
|
|
15185
|
+
: item.unavailableReasonCode))))));
|
|
15186
|
+
})),
|
|
15187
|
+
index.h("div", { class: sheet.classes.Buttons },
|
|
15188
|
+
index.h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
|
|
15189
|
+
index.h("a", {
|
|
15190
|
+
// onClick={() => refs.drawerRef.current?.hide()}
|
|
15191
|
+
style: { display: "block" }, class: sheet.classes.Button }, "Cancel")),
|
|
15192
|
+
];
|
|
15193
|
+
}
|
|
15194
|
+
function chooseAmount() {
|
|
15195
|
+
const input = getInput();
|
|
15196
|
+
return (index.h("div", null,
|
|
15197
|
+
index.h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (index.h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
|
|
15198
|
+
index.h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
|
|
15199
|
+
index.h("div", { class: sheet.classes.InputBox }, input),
|
|
15200
|
+
index.h("div", { class: sheet.classes.Buttons },
|
|
15201
|
+
index.h("sl-button", { onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount, style: { display: "block" }, class: sheet.classes.Button }, "Continue"),
|
|
15202
|
+
index.h("a", { onClick: () => callbacks.setStage("chooseReward"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15203
|
+
}
|
|
15204
|
+
// console.log({ selectedItem, selectedStep });
|
|
15205
|
+
function confirmation() {
|
|
15206
|
+
const previousStage = "chooseAmount";
|
|
15207
|
+
return (index.h("div", null,
|
|
15208
|
+
index.h("h2", null, "Confirm and redeem"),
|
|
15209
|
+
index.h("div", { style: { textAlign: "center" } },
|
|
15210
|
+
index.h("p", null,
|
|
15211
|
+
index.h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
|
|
15212
|
+
index.h("p", null,
|
|
15213
|
+
index.h(ExchangeArrows, null)),
|
|
15214
|
+
index.h("div", { class: sheet.classes.CardContainer, style: {
|
|
15215
|
+
boxShadow: "none",
|
|
15216
|
+
marginBottom: "10px",
|
|
15217
|
+
flex: "1",
|
|
15218
|
+
minWidth: "100%",
|
|
15219
|
+
} },
|
|
15220
|
+
index.h("sl-card", { class: sheet.classes.Base },
|
|
15221
|
+
index.h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
15222
|
+
index.getAssetPath("./assets/Reward-icon.png") }),
|
|
15223
|
+
index.h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
|
|
15224
|
+
index.h("div", { class: sheet.classes.Buttons },
|
|
15225
|
+
index.h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
|
|
15226
|
+
index.h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15227
|
+
}
|
|
15228
|
+
function success() {
|
|
15229
|
+
return (index.h("div", { style: { textAlign: "center" } },
|
|
15230
|
+
index.h("img", { class: sheet.classes.FullImage, src: index.getAssetPath("./assets/Reward-icon.png") }),
|
|
15231
|
+
index.h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
|
|
15232
|
+
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && index.h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
|
|
15233
|
+
}
|
|
15234
|
+
const stages = {
|
|
15235
|
+
chooseReward: () => chooseReward(),
|
|
15236
|
+
chooseAmount: () => chooseAmount(),
|
|
15237
|
+
confirmation: () => confirmation(),
|
|
15238
|
+
success: () => success(),
|
|
15239
|
+
};
|
|
15240
|
+
const currentStage = stages[states.redeemStage];
|
|
15241
|
+
function stageMap() {
|
|
15242
|
+
const stageNumber = stageList.indexOf(states.redeemStage);
|
|
15243
|
+
return (index.h("div", { class: sheet.classes.ProgressBar },
|
|
15244
|
+
index.h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
|
|
15245
|
+
if (stage === states.redeemStage) {
|
|
15246
|
+
return index.h("span", { class: "text" }, stageProgressList[stage]);
|
|
15247
|
+
}
|
|
15248
|
+
else {
|
|
15249
|
+
return (index.h("span", { class: "text subdued" }, stageProgressList[stage]));
|
|
15250
|
+
}
|
|
15251
|
+
})),
|
|
15252
|
+
index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
15253
|
+
}
|
|
15254
|
+
const BackButton = () => {
|
|
15255
|
+
if (states.redeemStage === "success")
|
|
15256
|
+
return "";
|
|
15257
|
+
let previousStage = "";
|
|
15258
|
+
if (states.redeemStage === "confirmation") {
|
|
15259
|
+
previousStage = "chooseAmount";
|
|
15260
|
+
}
|
|
15261
|
+
else if (states.redeemStage === "chooseAmount") {
|
|
15262
|
+
previousStage = "chooseReward";
|
|
15263
|
+
}
|
|
15264
|
+
return (index.h("div", { slot: "label" },
|
|
15265
|
+
index.h("a", { style: { cursor: "pointer", fontSize: "80%", color: "#858585" }, onClick: () => callbacks.setStage(previousStage) },
|
|
15266
|
+
index.h(LeftArrow, null),
|
|
15267
|
+
" Back")));
|
|
15268
|
+
};
|
|
15269
|
+
console.log(props);
|
|
15270
|
+
return (index.h("div", { class: sheet.classes.Container },
|
|
15271
|
+
index.h("style", { type: "text/css" }, styleString),
|
|
15272
|
+
index.h("div", null,
|
|
15273
|
+
index.h(BackButton, null),
|
|
15274
|
+
stageMap(),
|
|
15275
|
+
currentStage && currentStage(),
|
|
15276
|
+
states.exchangeError &&
|
|
15277
|
+
"Something went wrong. Please contact support or try again.")));
|
|
15278
|
+
}
|
|
15279
|
+
|
|
15280
|
+
const SqmRewardExchangeList = class {
|
|
15281
|
+
constructor(hostRef) {
|
|
15282
|
+
index.registerInstance(this, hostRef);
|
|
15283
|
+
this.ignored = true;
|
|
15284
|
+
/**
|
|
15285
|
+
* @uiName Exchange button text
|
|
15286
|
+
*/
|
|
15287
|
+
this.buttonText = "Exchange Rewards";
|
|
15288
|
+
_extends.h$1(this);
|
|
15289
|
+
}
|
|
15290
|
+
disconnectedCallback() { }
|
|
15291
|
+
render() {
|
|
15292
|
+
// const missingProps = getMissingProps([
|
|
15293
|
+
// {
|
|
15294
|
+
// attribute: "listType",
|
|
15295
|
+
// value: this.listType,
|
|
15296
|
+
// },
|
|
15297
|
+
// ]);
|
|
15298
|
+
// if (missingProps) {
|
|
15299
|
+
// return <RequiredPropsError missingProps={missingProps} />;
|
|
15300
|
+
// }
|
|
15301
|
+
const { states, data, callbacks, refs } = index_module.j()
|
|
15302
|
+
? useRewardExchangeListDemo(utils.getProps(this))
|
|
15303
|
+
: useRewardExchangeList(utils.getProps(this));
|
|
15304
|
+
return (index.h(index.Host, { style: { display: "contents" } }, index.h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
|
|
15305
|
+
}
|
|
15306
|
+
static get assetsDirs() { return ["assets"]; }
|
|
15307
|
+
};
|
|
15308
|
+
function useRewardExchangeListDemo(props) {
|
|
15309
|
+
return cjs.cjs({
|
|
15310
|
+
states: {
|
|
15311
|
+
content: {
|
|
15312
|
+
text: props,
|
|
15313
|
+
},
|
|
15314
|
+
redeemStage: "chooseReward",
|
|
15315
|
+
amount: 0,
|
|
15316
|
+
selectedStep: undefined,
|
|
15317
|
+
exchangeError: false,
|
|
15318
|
+
loading: false,
|
|
15319
|
+
},
|
|
15320
|
+
data: {
|
|
15321
|
+
shareCode: "SHARECODE123",
|
|
15322
|
+
},
|
|
15323
|
+
callbacks: {
|
|
15324
|
+
exchangeReward: () => { },
|
|
15325
|
+
openDrawer: () => { },
|
|
15326
|
+
setExchangeState: (_) => { },
|
|
15327
|
+
setStage: (_) => { },
|
|
15328
|
+
},
|
|
15329
|
+
refs: {
|
|
15330
|
+
drawerRef: {},
|
|
15331
|
+
},
|
|
15332
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15333
|
+
}
|
|
15334
|
+
|
|
15335
|
+
const style$7 = {
|
|
15336
|
+
THead: {
|
|
15337
|
+
padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
|
|
15338
|
+
"text-align": "left",
|
|
15339
|
+
},
|
|
15340
|
+
TCell: {
|
|
15341
|
+
padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
|
|
15342
|
+
},
|
|
15343
|
+
TRow: {
|
|
15344
|
+
"border-top": "1px solid #EAEAEA",
|
|
15345
|
+
},
|
|
15346
|
+
Table: {
|
|
15347
|
+
"border-collapse": "collapse",
|
|
15348
|
+
width: "100%",
|
|
15349
|
+
},
|
|
15350
|
+
ButtonContainer: {
|
|
15351
|
+
display: "flex",
|
|
15352
|
+
"justify-content": "flex-end",
|
|
15353
|
+
"margin-top": "var(--sl-spacing-small)",
|
|
15354
|
+
...mixins.gap({ direction: "row", size: "var(--sl-spacing-small)" }),
|
|
15355
|
+
},
|
|
15356
|
+
};
|
|
15357
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
15358
|
+
const sheet$7 = jssPresetDefault_esm.jss.createStyleSheet(style$7);
|
|
15359
|
+
const styleString$7 = sheet$7.toString();
|
|
15360
|
+
function GenericTableView(props) {
|
|
15361
|
+
const { states, data, callbacks, elements } = props;
|
|
15362
|
+
const { columns, rows } = elements;
|
|
15363
|
+
const { show } = states;
|
|
15364
|
+
return (index.h("div", null,
|
|
15365
|
+
index.h("style", { type: "text/css" }, styleString$7),
|
|
15366
|
+
index.h("table", { class: sheet$7.classes.Table },
|
|
15367
|
+
data.textOverrides.showLabels && (index.h("thead", null,
|
|
15368
|
+
index.h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (index.h("th", { class: sheet$7.classes.THead },
|
|
15369
|
+
index.h(sqmTextSpanView.TextSpanView, { type: "h3" }, column))))))),
|
|
15370
|
+
index.h("tbody", null,
|
|
15371
|
+
show === "loading" && elements.loadingElement,
|
|
15372
|
+
show === "empty" && elements.emptyElement,
|
|
15373
|
+
show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (index.h("tr", { class: sheet$7.classes.TRow, style: {
|
|
15374
|
+
borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
|
|
15375
|
+
}, part: "table-row" }, row.map((cell) => (index.h("td", { class: sheet$7.classes.TCell },
|
|
15376
|
+
index.h(sqmTextSpanView.TextSpanView, { type: "p" }, cell)))))))))),
|
|
15377
|
+
index.h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
|
|
15378
|
+
index.h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
|
|
15379
|
+
index.h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
|
|
15380
|
+
}
|
|
15381
|
+
|
|
15382
|
+
function LoadingSlot$1() {
|
|
15383
|
+
return (index.h("slot", { name: "loading" },
|
|
15384
|
+
index.h(LoadingSkeleton, null)));
|
|
15385
|
+
}
|
|
15386
|
+
function LoadingSkeleton() {
|
|
15387
|
+
return (index.h("div", { style: { width: "100%" } },
|
|
15388
|
+
index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15389
|
+
index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15390
|
+
index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15391
|
+
index.h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15392
|
+
index.h("sl-skeleton", null)));
|
|
15393
|
+
}
|
|
15394
|
+
function EmptySlot$1({ label }) {
|
|
15395
|
+
return (index.h("slot", { name: "empty" },
|
|
15396
|
+
index.h(EmptySkeleton, { label: label })));
|
|
15397
|
+
}
|
|
15398
|
+
function EmptySkeleton({ label }) {
|
|
15399
|
+
return (index.h("div", { style: { width: "100%" } },
|
|
15400
|
+
index.h("sqm-text", null,
|
|
15401
|
+
index.h("h3", { style: { color: "#777777" } }, label))));
|
|
15402
|
+
}
|
|
15403
|
+
|
|
15404
|
+
const CSS_NAMESPACE = "sqm-rewards-table";
|
|
15405
|
+
const GET_REWARDS = sqmLeaderboardRankView.gql `
|
|
15406
|
+
query getRewards(
|
|
15407
|
+
$limit: Int!
|
|
15408
|
+
$offset: Int!
|
|
15409
|
+
$rewardFilter: RewardFilterInput
|
|
15410
|
+
) {
|
|
15411
|
+
viewer {
|
|
15412
|
+
... on User {
|
|
15413
|
+
id
|
|
15414
|
+
rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
|
|
15415
|
+
totalCount
|
|
15416
|
+
count
|
|
15417
|
+
data {
|
|
15418
|
+
id
|
|
15419
|
+
type
|
|
15420
|
+
value
|
|
15421
|
+
unit
|
|
15422
|
+
name
|
|
15423
|
+
dateGiven
|
|
15424
|
+
dateExpires
|
|
15425
|
+
dateCancelled
|
|
15426
|
+
dateRedeemed
|
|
15427
|
+
dateScheduledFor
|
|
15428
|
+
fuelTankCode
|
|
15429
|
+
fuelTankType
|
|
15430
|
+
currency
|
|
15431
|
+
prettyValue
|
|
15432
|
+
statuses
|
|
15433
|
+
globalRewardKey
|
|
15434
|
+
programRewardKey
|
|
15435
|
+
rewardRedemptionTransactions {
|
|
15436
|
+
data {
|
|
15437
|
+
exchangedRewards {
|
|
15438
|
+
data {
|
|
15439
|
+
prettyValue
|
|
15440
|
+
type
|
|
15441
|
+
fuelTankCode
|
|
15442
|
+
globalRewardKey
|
|
15443
|
+
}
|
|
15444
|
+
}
|
|
15445
|
+
}
|
|
15446
|
+
}
|
|
15447
|
+
}
|
|
15448
|
+
}
|
|
15449
|
+
}
|
|
15450
|
+
}
|
|
15451
|
+
}
|
|
15452
|
+
`;
|
|
15453
|
+
function useRewardsTable(props, emptyElement, loadingElement) {
|
|
15454
|
+
var _a, _b;
|
|
15455
|
+
const user = index_module.T();
|
|
15456
|
+
const programIdContext = index_module.M();
|
|
15457
|
+
// Default to context, overriden by props
|
|
15458
|
+
const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
|
|
15459
|
+
const rewardFilter = {
|
|
15460
|
+
userId_eq: user === null || user === void 0 ? void 0 : user.id,
|
|
15461
|
+
accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
|
|
15462
|
+
// If no program ID, shows all programs
|
|
15463
|
+
...(programId
|
|
15464
|
+
? programId === "classic"
|
|
15465
|
+
? { programId_exists: false }
|
|
15466
|
+
: { programId_eq: programId }
|
|
15467
|
+
: {}),
|
|
15468
|
+
};
|
|
15469
|
+
const [content, setContent] = _extends.useReducer((state, next) => ({
|
|
15470
|
+
...state,
|
|
15471
|
+
...next,
|
|
15472
|
+
}), {
|
|
15473
|
+
columns: [],
|
|
15474
|
+
rows: [],
|
|
15475
|
+
loading: false,
|
|
15476
|
+
page: 0,
|
|
15477
|
+
});
|
|
15478
|
+
const { envelope: rewardsData, states, callbacks, } = index_module.sn(GET_REWARDS, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.rewards; }, {
|
|
15479
|
+
limit: props.perPage,
|
|
15480
|
+
offset: 0,
|
|
15481
|
+
}, {
|
|
15482
|
+
rewardFilter,
|
|
15483
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15484
|
+
const tick = reRender.useRerenderListener();
|
|
15485
|
+
const components = useChildElements();
|
|
15486
|
+
const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
|
|
15487
|
+
async function getComponentData(components) {
|
|
15488
|
+
// filter out loading and empty states from columns array
|
|
15489
|
+
const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
|
|
15490
|
+
// get the column titles (renderLabel is asynchronous)
|
|
15491
|
+
const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
|
|
15492
|
+
// get the column cells (renderCell is asynchronous)
|
|
15493
|
+
const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
|
|
15494
|
+
const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
|
|
15495
|
+
const cells = await Promise.all(cellPromise);
|
|
15496
|
+
return cells;
|
|
15497
|
+
});
|
|
15498
|
+
const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
|
|
15499
|
+
setContent({ rows });
|
|
15500
|
+
const columns = columnsPromise && (await Promise.all(columnsPromise));
|
|
15501
|
+
// Set the content to render and finish loading components
|
|
15502
|
+
setContent({ columns, loading: false, page: states.currentPage });
|
|
15503
|
+
}
|
|
15504
|
+
_extends.useEffect(() => {
|
|
15505
|
+
setContent({ loading: true });
|
|
15506
|
+
rewardsData && getComponentData(components);
|
|
15507
|
+
}, [rewardsData, components, tick]);
|
|
15508
|
+
const isEmpty = !((_b = content === null || content === void 0 ? void 0 : content.rows) === null || _b === void 0 ? void 0 : _b.length) && !(data === null || data === void 0 ? void 0 : data.length);
|
|
15509
|
+
console.log(states.loading, content.loading, rewardsData);
|
|
15510
|
+
const show =
|
|
15511
|
+
// 1 - Loading if loading
|
|
15512
|
+
states.loading || content.loading
|
|
15513
|
+
? "loading"
|
|
15514
|
+
: // 2 - Empty if empty
|
|
15515
|
+
isEmpty
|
|
15516
|
+
? "empty"
|
|
15517
|
+
: // 3 - Then show rows
|
|
15518
|
+
"rows";
|
|
15519
|
+
return {
|
|
15520
|
+
states: {
|
|
15521
|
+
hasNext: states.currentPage < states.pageCount - 1,
|
|
15522
|
+
hasPrev: states.currentPage > 0,
|
|
15523
|
+
show,
|
|
15524
|
+
namespace: CSS_NAMESPACE,
|
|
15525
|
+
},
|
|
15526
|
+
data: {
|
|
15527
|
+
textOverrides: {
|
|
15528
|
+
showLabels: props.showLabels,
|
|
15529
|
+
prevLabel: props.prevLabel,
|
|
15530
|
+
moreLabel: props.moreLabel,
|
|
15531
|
+
},
|
|
15532
|
+
},
|
|
15533
|
+
elements: {
|
|
15534
|
+
columns: content.columns,
|
|
15535
|
+
rows: content.rows,
|
|
15536
|
+
emptyElement,
|
|
15537
|
+
loadingElement,
|
|
15538
|
+
},
|
|
15539
|
+
callbacks: {
|
|
15540
|
+
nextPage: () => {
|
|
15541
|
+
callbacks.setCurrentPage(states.currentPage + 1);
|
|
15542
|
+
},
|
|
15543
|
+
prevPage: () => {
|
|
15544
|
+
callbacks.setCurrentPage(states.currentPage - 1);
|
|
15545
|
+
},
|
|
15546
|
+
},
|
|
15547
|
+
};
|
|
15548
|
+
}
|
|
15549
|
+
function generateUserError$1(e) {
|
|
15550
|
+
try {
|
|
15551
|
+
return JSON.stringify(e);
|
|
15552
|
+
}
|
|
15553
|
+
catch (e) {
|
|
15554
|
+
return "An unknown error";
|
|
15555
|
+
}
|
|
15556
|
+
}
|
|
15557
|
+
async function tryMethod$1(c, callback) {
|
|
15558
|
+
const tag = c.tagName.toLowerCase();
|
|
15559
|
+
await customElements.whenDefined(tag);
|
|
15560
|
+
let labelPromise;
|
|
15561
|
+
try {
|
|
15562
|
+
labelPromise = callback();
|
|
15563
|
+
}
|
|
15564
|
+
catch (e) {
|
|
15565
|
+
// renderLabel did not return a promise, so this method probably doesn't exist
|
|
15566
|
+
// therefore, we IGNORE the label
|
|
15567
|
+
if (callback.name === "renderReferrerCell") {
|
|
15568
|
+
console.error("column does not have a renderReferrerCell method.");
|
|
15569
|
+
}
|
|
15570
|
+
else {
|
|
15571
|
+
console.error("label promise failed", e);
|
|
15572
|
+
}
|
|
15573
|
+
return index.h("span", null);
|
|
15574
|
+
}
|
|
15575
|
+
try {
|
|
15576
|
+
return await labelPromise;
|
|
15577
|
+
}
|
|
15578
|
+
catch (e) {
|
|
15579
|
+
// The column returned a promise, and that promise failed.
|
|
15580
|
+
// This should not happen so we fail fast
|
|
15581
|
+
console.error("Error rendering label", e);
|
|
15582
|
+
const userError = generateUserError$1(e);
|
|
15583
|
+
return (index.h("details", null,
|
|
15584
|
+
index.h("summary", null, "Error"),
|
|
15585
|
+
userError));
|
|
15586
|
+
}
|
|
15587
|
+
}
|
|
15588
|
+
|
|
15589
|
+
const RewardsTable = class {
|
|
15590
|
+
constructor(hostRef) {
|
|
15591
|
+
index.registerInstance(this, hostRef);
|
|
15592
|
+
/** @uiName Number of rewards per page */
|
|
15593
|
+
this.perPage = 3;
|
|
15594
|
+
/** @uiName Show column labels */
|
|
15595
|
+
this.showLabels = true;
|
|
15596
|
+
/** @uiName Previous button text */
|
|
15597
|
+
this.prevLabel = "Prev";
|
|
15598
|
+
/** @uiName View More button text */
|
|
15599
|
+
this.moreLabel = "Next";
|
|
15600
|
+
/** @uiName Show Referred by user in table */
|
|
15601
|
+
this.showReferrer = false;
|
|
15602
|
+
_extends.h$1(this);
|
|
15603
|
+
}
|
|
15604
|
+
disconnectedCallback() { }
|
|
15605
|
+
render() {
|
|
15606
|
+
const empty = index.h(EmptySlot$1, { label: "No Rewards Yet" });
|
|
15607
|
+
const loading = index.h(LoadingSlot$1, null);
|
|
15608
|
+
const { states, data, callbacks, elements } = index_module.j()
|
|
15609
|
+
? useRewardsTableDemo(this)
|
|
15610
|
+
: useRewardsTable(this, empty, loading);
|
|
15611
|
+
return (index.h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
|
|
15612
|
+
}
|
|
15613
|
+
};
|
|
15614
|
+
function useRewardsTableDemo(props) {
|
|
15615
|
+
return cjs.cjs({
|
|
15616
|
+
states: {
|
|
15617
|
+
hasPrev: false,
|
|
15618
|
+
hasNext: false,
|
|
15619
|
+
loading: false,
|
|
15620
|
+
namespace: CSS_NAMESPACE,
|
|
15621
|
+
},
|
|
15622
|
+
callbacks: {
|
|
15623
|
+
prevPage: () => console.log("Prev"),
|
|
15624
|
+
nextPage: () => console.log("Next"),
|
|
15625
|
+
},
|
|
15626
|
+
data: {
|
|
15627
|
+
textOverrides: {
|
|
15628
|
+
showLabels: props.showLabels,
|
|
15629
|
+
prevLabel: props.prevLabel,
|
|
15630
|
+
moreLabel: props.moreLabel,
|
|
15631
|
+
},
|
|
15632
|
+
referralData: [],
|
|
15633
|
+
},
|
|
15634
|
+
elements: {
|
|
15635
|
+
emptyElement: index.h(EmptySkeleton, { label: "No Rewards Yet" }),
|
|
15636
|
+
loadingElement: index.h(LoadingSkeleton, null),
|
|
15637
|
+
// TODO: This should be smarter
|
|
15638
|
+
columns: [index.h("div", null, "Name"), index.h("div", null, "Email"), index.h("div", null, "DOB")],
|
|
15639
|
+
rows: [],
|
|
15640
|
+
},
|
|
15641
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15642
|
+
}
|
|
15643
|
+
|
|
15644
|
+
const RewardsTableColumn = class {
|
|
15645
|
+
constructor(hostRef) {
|
|
15646
|
+
index.registerInstance(this, hostRef);
|
|
15647
|
+
/**
|
|
15648
|
+
* @uiName Reward column title
|
|
15649
|
+
*/
|
|
15650
|
+
this.columnTitle = "Rewards";
|
|
15651
|
+
/**
|
|
15652
|
+
* @uiName Hide dropdown details of reward
|
|
15653
|
+
*/
|
|
15654
|
+
this.hideDetails = false;
|
|
15655
|
+
_extends.h$1(this);
|
|
15656
|
+
}
|
|
15657
|
+
disconnectedCallback() { }
|
|
15658
|
+
//@ts-ignore
|
|
15659
|
+
async renderCell(data) {
|
|
15660
|
+
// TODO: Do the right thing with many rewards, pending rewards, canceled rewards
|
|
15661
|
+
console.log({ data });
|
|
15662
|
+
return (index.h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
|
|
15663
|
+
}
|
|
15664
|
+
async renderLabel() {
|
|
15665
|
+
return this.columnTitle;
|
|
15666
|
+
}
|
|
15667
|
+
render() {
|
|
15668
|
+
reRender.useRequestRerender([this.columnTitle]);
|
|
15669
|
+
return index.h(index.Host, { style: { display: "none" } });
|
|
15670
|
+
}
|
|
15671
|
+
};
|
|
15672
|
+
|
|
14752
15673
|
const debug$1 = _extends.browser("sq:useRouter");
|
|
14753
15674
|
function matchPath(pattern, page) {
|
|
14754
15675
|
if (!pattern)
|
|
@@ -14841,19 +15762,19 @@ const SqmRouter = class {
|
|
|
14841
15762
|
};
|
|
14842
15763
|
SqmRouter.style = sqmRouterCss;
|
|
14843
15764
|
|
|
14844
|
-
const style$
|
|
15765
|
+
const style$8 = {
|
|
14845
15766
|
HostBlock: mixins.HostBlock,
|
|
14846
15767
|
buttonStyle: {
|
|
14847
15768
|
display: "block",
|
|
14848
15769
|
},
|
|
14849
15770
|
};
|
|
14850
15771
|
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
14851
|
-
const sheet$
|
|
14852
|
-
const styleString$
|
|
15772
|
+
const sheet$8 = jssPresetDefault_esm.jss.createStyleSheet(style$8);
|
|
15773
|
+
const styleString$8 = sheet$8.toString();
|
|
14853
15774
|
function ShareButtonView(props, children) {
|
|
14854
15775
|
return props.hide ? (index.h(index.Host, { style: { display: "none" } })) : (index.h("div", null,
|
|
14855
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
14856
|
-
index.h("sl-button", { class: sheet$
|
|
15776
|
+
index.h("style", { type: "text/css" }, styleString$8),
|
|
15777
|
+
index.h("sl-button", { class: sheet$8.classes.buttonStyle, loading: props.loading, disabled: props.disabled, pill: props.pill, size: props.size, type: props.type, onClick: props.onClick, exportparts: `base: ${props.type}sharebutton-base` },
|
|
14857
15778
|
!props.hideicon && (index.h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
|
|
14858
15779
|
!props.hidetext && children)));
|
|
14859
15780
|
}
|
|
@@ -15012,14 +15933,13 @@ const MessageLinkQuery$1 = index_module.dist.gql `
|
|
|
15012
15933
|
}
|
|
15013
15934
|
`;
|
|
15014
15935
|
function useShareLink(props) {
|
|
15015
|
-
var _a, _b
|
|
15936
|
+
var _a, _b;
|
|
15016
15937
|
const { programId = index_module.M() } = props;
|
|
15017
15938
|
const user = index_module.T();
|
|
15018
15939
|
const { data } = index_module.en(MessageLinkQuery$1, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15019
15940
|
const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink) !== null && _b !== void 0 ? _b :
|
|
15020
15941
|
// Shown during loading
|
|
15021
15942
|
"...";
|
|
15022
|
-
console.log((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.shareLink, shareString);
|
|
15023
15943
|
const [open, setOpen] = _extends.useState(false);
|
|
15024
15944
|
function onClick() {
|
|
15025
15945
|
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
@@ -16492,7 +17412,7 @@ var _createEmotion = createEmotion({
|
|
|
16492
17412
|
function i$1(){return (i$1=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r]);}return n}).apply(this,arguments)}function s(n,t){return t||(t=n.slice(0)),n.raw=t,n}var a$1,l,u,c$1=css(a$1||(a$1=s(['\n width: 100vw;\n height: 100vh;\n\n .story-book-outer-div {\n .story-div {\n font-family: "Arial", sans-serif;\n font-size: 12px;\n }\n padding-bottom: 500px;\n }\n\n .story-div {\n position: fixed;\n box-sizing: border-box;\n top: 0;\n width: 250px;\n height: 100vh;\n z-index: 999;\n overflow-y: scroll;\n background: white;\n margin-bottom: 32px;\n }\n\n .header {\n padding: 24px 0 16px 16px;\n margin-bottom: 24px;\n color: white;\n background: #333;\n cursor: pointer;\n\n h2 {\n letter-spacing: 3px;\n font-weight: 400;\n }\n }\n\n .parentStoryList {\n list-style: none;\n padding-left: 16px;\n\n summary {\n margin-bottom: 4px;\n }\n }\n .parentStory {\n cursor: pointer;\n }\n .parentStory.selected {\n font-weight: bold;\n }\n\n .subStory {\n font-size: 12px;\n cursor: pointer;\n line-height: 1.5em;\n margin-top: 4px;\n\n a {\n display: block;\n padding: 4px 4px 4px 16px;\n }\n }\n .subStory:hover {\n background-color: #eee;\n }\n .subStory.selected {\n background-color: lightgreen;\n }\n\n .component {\n padding: 24px 16px;\n }\n\n h4.group-header {\n margin: 8px 0;\n text-transform: uppercase;\n font-weight: 600;\n font-size: 14px;\n color: #575757;\n }\n\n .group-wrapper {\n margin-bottom: 24px;\n }\n\n .dynamic-display-wrapper {\n position: fixed;\n display: flex;\n flex-direction: column;\n bottom: 0;\n left: 100%;\n padding: 16px;\n z-index: 1000;\n background: white;\n transform: translateX(-100%);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n\n & > :not(:first-child) {\n margin-top: 12px;\n }\n\n p {\n font-size: 12px;\n margin: 0;\n padding: 0;\n }\n\n .button-wrapper {\n display: flex;\n\n & > :not(:first-child) {\n margin-left: 12px;\n }\n }\n\n & button {\n border: 1px solid #eaeaea;\n background: white;\n border-radius: 4px;\n color: #777;\n padding: 4px 12px;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n &.active {\n background: #555;\n border-color: #555;\n color: white;\n }\n }\n }\n'])));function p$1(n,t){var o,r=t.story.title.split("/"),e=r[1]?r[0]:"_";return i$1({},n,((o={})[e]=[].concat(n[e]||[],[{story:i$1({},t.story,{title:r[1]||r[0]}),subs:t.subs}]).sort(function(n,t){return n.story.title.localeCompare(t.story.title)}),o))}function d$1(n){return {story:n.default,subs:function(n,t){if(null==n)return {};var o,r,e={},i=Object.keys(n);for(r=0;r<i.length;r++)t.indexOf(o=i[r])>=0||(e[o]=n[o]);return e}(n,["default"])}}function f(a,f){var b=f.h,y=void 0===b?index.h:b,g=f.title,m=void 0===g?"Stencilbook":g,x=f.homepage,h=void 0===x?y("h3",null,"Select a story!"):x,v=f.addons,k=void 0===v?[]:v,w=_extends.useMemo(function(){return a.map(d$1).reduce(p$1,{_:[]})},a),S=_extends.useState(void 0),C=S[0],z=S[1],O=null==C?void 0:C.key,j=_extends.useState("desktop"),T=j[0],_=j[1],B=_extends.useState(!0),D=B[0],L=B[1],N=_extends.useState(!1),q=N[0],A=N[1],M=function(){return y("div",{class:"dynamic-display-wrapper"},y("div",{class:"button-wrapper"},y("button",{class:"desktop"===T?"active":"",onClick:function(){return _("desktop")}},"Desktop"),y("button",{class:"tablet"===T?"active":"",onClick:function(){return _("tablet")}},"Tablet"),y("button",{class:"mobile"===T?"active":"",onClick:function(){return _("mobile")}},"Mobile")),y("p",null,"Note: Currently doesn't test breakpoints, use the native tester for now"),y("hr",null),y("button",{class:q?"active":"",onClick:function(){return A(function(n){return !n})}},"Toggle Dark Background"),y("hr",null),y("button",{class:D?"active":"",onClick:function(){return L(function(n){return !n})}},"Toggle Sidebar"))},P="mobile"===T?"375px":"tablet"===T?"768px":"1124px",V=css(l||(l=s(["\n max-width: ",";\n margin-left: ",";\n "])),P,D?"250px":"0px"),X=css(u||(u=s(["\n display: none;\n "])));document.body.style.backgroundColor=q?"#232323":"#fafafa";var E=function(n){var t=n.selected,o=k.reduce(function(n,o){return function(){return y(o,{story:i$1({},t)},y(n,null))}},null==t?void 0:t.story);return y(o,null)},F=function(){return y("div",{class:"story-book-outer-div"},y("div",{class:"story-div "+(D?"":X)},y("div",{class:"header",onClick:function(){z(void 0);}},y("h2",null,m)),y("ul",{class:"parentStoryList"},Object.keys(w).sort().map(function(n){return y("div",{class:"group-wrapper"},"_"!==n&&y("h4",{class:"group-header"},n),w[n].map(function(t){return y("li",{class:"parentStory"},y("details",{style:{marginBottom:"10px"}},y("summary",{style:{outline:"none"}},t.story.title),t.subs&&Object.keys(t.subs).map(function(o){var e=n+"/"+o,i=t.subs[o],s=i.storyName||lodash_startcase(o);return y("div",{class:"subStory "+(O===e?"selected":"")},y("a",{onClick:function(){return function(n,t,o,r){z({key:t,story:n,parent:o,label:r});}(i,e,t.story,s)}},s))})))}))}))),y(M,null),y("div",{class:"component "+V},!O&&h,O&&y("div",null,y("h3",null,C.label),y(E,{selected:C}))))};return {class:c$1,children:y(F,null),View:F,selected:C}}
|
|
16493
17413
|
|
|
16494
17414
|
const ShareButton_stories = {
|
|
16495
|
-
title: "Share Button",
|
|
17415
|
+
title: "Components/Share Button",
|
|
16496
17416
|
};
|
|
16497
17417
|
const WithIcon = () => {
|
|
16498
17418
|
const props = { medium: "facebook", iconslot: "suffix" };
|
|
@@ -16548,7 +17468,7 @@ const ShareButton$1 = /*#__PURE__*/Object.freeze({
|
|
|
16548
17468
|
});
|
|
16549
17469
|
|
|
16550
17470
|
const ShareLink_stories = {
|
|
16551
|
-
title: "Share Link",
|
|
17471
|
+
title: "Components/Share Link",
|
|
16552
17472
|
};
|
|
16553
17473
|
const Default = () => {
|
|
16554
17474
|
const props = {
|
|
@@ -16589,14 +17509,15 @@ const ShareLink$1 = /*#__PURE__*/Object.freeze({
|
|
|
16589
17509
|
});
|
|
16590
17510
|
|
|
16591
17511
|
const BigStat_stories = {
|
|
16592
|
-
title: "Big Stat",
|
|
17512
|
+
title: "Components/Big Stat",
|
|
16593
17513
|
};
|
|
16594
17514
|
const Default$1 = () => {
|
|
16595
|
-
const props = { statvalue: "9.900,00" };
|
|
17515
|
+
const props = { value: 990000, statvalue: "9.900,00" };
|
|
16596
17516
|
return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
|
|
16597
17517
|
};
|
|
16598
17518
|
const LeftAlign = () => {
|
|
16599
17519
|
const props = {
|
|
17520
|
+
value: 500,
|
|
16600
17521
|
statvalue: "500",
|
|
16601
17522
|
alignment: "left",
|
|
16602
17523
|
};
|
|
@@ -16604,6 +17525,7 @@ const LeftAlign = () => {
|
|
|
16604
17525
|
};
|
|
16605
17526
|
const RightAlign = () => {
|
|
16606
17527
|
const props = {
|
|
17528
|
+
value: 500,
|
|
16607
17529
|
statvalue: "500",
|
|
16608
17530
|
alignment: "right",
|
|
16609
17531
|
};
|
|
@@ -16611,6 +17533,7 @@ const RightAlign = () => {
|
|
|
16611
17533
|
};
|
|
16612
17534
|
const FlexReverse = () => {
|
|
16613
17535
|
const props = {
|
|
17536
|
+
value: 500,
|
|
16614
17537
|
statvalue: "500",
|
|
16615
17538
|
flexReverse: true,
|
|
16616
17539
|
};
|
|
@@ -16618,6 +17541,7 @@ const FlexReverse = () => {
|
|
|
16618
17541
|
};
|
|
16619
17542
|
const FlexReverseRight = () => {
|
|
16620
17543
|
const props = {
|
|
17544
|
+
value: 500,
|
|
16621
17545
|
statvalue: "500",
|
|
16622
17546
|
flexReverse: true,
|
|
16623
17547
|
alignment: "right",
|
|
@@ -16626,6 +17550,7 @@ const FlexReverseRight = () => {
|
|
|
16626
17550
|
};
|
|
16627
17551
|
const FlexReverseLeft = () => {
|
|
16628
17552
|
const props = {
|
|
17553
|
+
value: 500,
|
|
16629
17554
|
statvalue: "500",
|
|
16630
17555
|
flexReverse: true,
|
|
16631
17556
|
alignment: "left",
|
|
@@ -16634,12 +17559,14 @@ const FlexReverseLeft = () => {
|
|
|
16634
17559
|
};
|
|
16635
17560
|
const NoStatValue = () => {
|
|
16636
17561
|
const props = {
|
|
17562
|
+
value: 0,
|
|
16637
17563
|
statvalue: "...",
|
|
16638
17564
|
};
|
|
16639
17565
|
return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
|
|
16640
17566
|
};
|
|
16641
17567
|
const InvalidStatValue = () => {
|
|
16642
17568
|
const props = {
|
|
17569
|
+
value: 0,
|
|
16643
17570
|
statvalue: "!!!",
|
|
16644
17571
|
};
|
|
16645
17572
|
return index.h(useDemoBigStat.BigStatView, Object.assign({}, props), "Big stat");
|
|
@@ -16659,7 +17586,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
|
|
|
16659
17586
|
});
|
|
16660
17587
|
|
|
16661
17588
|
const Leaderboard_stories = {
|
|
16662
|
-
title: "Leaderboard",
|
|
17589
|
+
title: "Components/Leaderboard",
|
|
16663
17590
|
parameters: {
|
|
16664
17591
|
tagname: "sqm-leaderboard",
|
|
16665
17592
|
},
|
|
@@ -16936,7 +17863,7 @@ const Router = /*#__PURE__*/Object.freeze({
|
|
|
16936
17863
|
});
|
|
16937
17864
|
|
|
16938
17865
|
const LeaderboardRank_stories = {
|
|
16939
|
-
title: "Leaderboard Rank",
|
|
17866
|
+
title: "Components/Leaderboard Rank",
|
|
16940
17867
|
};
|
|
16941
17868
|
const First = () => {
|
|
16942
17869
|
const props = { data: { rank: "1st" } };
|
|
@@ -16983,7 +17910,7 @@ function setupLoggedOut() {
|
|
|
16983
17910
|
};
|
|
16984
17911
|
}
|
|
16985
17912
|
const PortalFrame_stories = {
|
|
16986
|
-
title: "Portal Frame",
|
|
17913
|
+
title: "Components/Portal Frame",
|
|
16987
17914
|
};
|
|
16988
17915
|
const defaultProps = {
|
|
16989
17916
|
data: {
|
|
@@ -17078,7 +18005,7 @@ const PortalFrame$1 = /*#__PURE__*/Object.freeze({
|
|
|
17078
18005
|
});
|
|
17079
18006
|
|
|
17080
18007
|
const EditProfileForm_stories = {
|
|
17081
|
-
title: "Edit Profile Form",
|
|
18008
|
+
title: "Components/Edit Profile Form",
|
|
17082
18009
|
};
|
|
17083
18010
|
const defaultProps$1 = {
|
|
17084
18011
|
states: {
|
|
@@ -17365,6 +18292,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
|
|
|
17365
18292
|
const ProgramGoals = createHookStory(() => {
|
|
17366
18293
|
const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
|
|
17367
18294
|
return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
|
|
18295
|
+
});
|
|
18296
|
+
const CustomField = createHookStory(() => {
|
|
18297
|
+
return View(`/customFields/thingCount`, "/(customFields)/:customField");
|
|
17368
18298
|
});
|
|
17369
18299
|
|
|
17370
18300
|
const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
@@ -17396,7 +18326,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
|
17396
18326
|
RewardsAvailableWithSlash: RewardsAvailableWithSlash,
|
|
17397
18327
|
RewardBalance: RewardBalance,
|
|
17398
18328
|
RewardBalanceCashUSD: RewardBalanceCashUSD,
|
|
17399
|
-
ProgramGoals: ProgramGoals
|
|
18329
|
+
ProgramGoals: ProgramGoals,
|
|
18330
|
+
CustomField: CustomField
|
|
17400
18331
|
});
|
|
17401
18332
|
|
|
17402
18333
|
function setupGraphQL$4() {
|
|
@@ -17517,62 +18448,286 @@ const TopStartedReferrers = createHookStory(() => {
|
|
|
17517
18448
|
];
|
|
17518
18449
|
});
|
|
17519
18450
|
|
|
17520
|
-
const UseLeaderboard = /*#__PURE__*/Object.freeze({
|
|
18451
|
+
const UseLeaderboard = /*#__PURE__*/Object.freeze({
|
|
18452
|
+
__proto__: null,
|
|
18453
|
+
'default': UseLeaderboard_stories,
|
|
18454
|
+
TopConvertedReferrers: TopConvertedReferrers,
|
|
18455
|
+
TopStartedReferrers: TopStartedReferrers
|
|
18456
|
+
});
|
|
18457
|
+
|
|
18458
|
+
const FormMessage_stories = {
|
|
18459
|
+
title: "Components/Form Message",
|
|
18460
|
+
};
|
|
18461
|
+
const SuccessAlert = () => {
|
|
18462
|
+
return (index.h("sqm-form-message", { type: "success" },
|
|
18463
|
+
index.h("div", null, "This is a success message.")));
|
|
18464
|
+
};
|
|
18465
|
+
const ErrorAlert = () => {
|
|
18466
|
+
return (index.h("sqm-form-message", { type: "error" },
|
|
18467
|
+
index.h("div", null, "This is an error message")));
|
|
18468
|
+
};
|
|
18469
|
+
const InfoAlert = () => {
|
|
18470
|
+
return (index.h("sqm-form-message", { type: "info" },
|
|
18471
|
+
index.h("div", null, "This is an info message")));
|
|
18472
|
+
};
|
|
18473
|
+
const FullStackSuccess = () => {
|
|
18474
|
+
return (index.h("sqm-form-message", { type: "success", exportparts: "successalert-icon" },
|
|
18475
|
+
index.h("div", { class: "AlertContent" },
|
|
18476
|
+
index.h("div", { part: "successalert-text" }, "Title"),
|
|
18477
|
+
index.h("div", { part: "successalert-subtext" }, "Body text."),
|
|
18478
|
+
index.h("sl-button", { type: "default", exportparts: "base: defaultbutton-base", onClick: () => {
|
|
18479
|
+
console.log("click");
|
|
18480
|
+
} }, "Primary Action"),
|
|
18481
|
+
index.h("sl-button", { class: "SecondaryTextButton", type: "text", onClick: () => {
|
|
18482
|
+
console.log("click");
|
|
18483
|
+
} }, "Secondary Action"))));
|
|
18484
|
+
};
|
|
18485
|
+
|
|
18486
|
+
const FormMessage$1 = /*#__PURE__*/Object.freeze({
|
|
18487
|
+
__proto__: null,
|
|
18488
|
+
'default': FormMessage_stories,
|
|
18489
|
+
SuccessAlert: SuccessAlert,
|
|
18490
|
+
ErrorAlert: ErrorAlert,
|
|
18491
|
+
InfoAlert: InfoAlert,
|
|
18492
|
+
FullStackSuccess: FullStackSuccess
|
|
18493
|
+
});
|
|
18494
|
+
|
|
18495
|
+
const EXCHANGE$1 = index_module.dist.gql `
|
|
18496
|
+
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
18497
|
+
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
18498
|
+
reward {
|
|
18499
|
+
id
|
|
18500
|
+
}
|
|
18501
|
+
}
|
|
18502
|
+
}
|
|
18503
|
+
`;
|
|
18504
|
+
const UseRewardExchangeList_stories = {
|
|
18505
|
+
title: "Hooks / useRewardExchange",
|
|
18506
|
+
};
|
|
18507
|
+
function setupGraphQL$6() {
|
|
18508
|
+
const id = "testestest";
|
|
18509
|
+
const accountId = id;
|
|
18510
|
+
const programId = "sam-partner-test-2";
|
|
18511
|
+
//@ts-ignore
|
|
18512
|
+
window.widgetIdent = {
|
|
18513
|
+
tenantAlias: "test_a8b41jotf8a1v",
|
|
18514
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18515
|
+
programId,
|
|
18516
|
+
};
|
|
18517
|
+
_extends.useEffect(() => {
|
|
18518
|
+
index_module.L({
|
|
18519
|
+
accountId,
|
|
18520
|
+
id,
|
|
18521
|
+
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18522
|
+
});
|
|
18523
|
+
return () => {
|
|
18524
|
+
window.widgetIdent = undefined;
|
|
18525
|
+
index_module.L(undefined);
|
|
18526
|
+
};
|
|
18527
|
+
}, []);
|
|
18528
|
+
return { id, accountId };
|
|
18529
|
+
}
|
|
18530
|
+
function useExchangeButton() {
|
|
18531
|
+
const { id, accountId } = setupGraphQL$6();
|
|
18532
|
+
const [points, setPoints] = _extends.useState(10);
|
|
18533
|
+
const [rate, setRate] = _extends.useState(100);
|
|
18534
|
+
const [exchange, { data, errors }] = index_module.Ne(EXCHANGE$1);
|
|
18535
|
+
return {
|
|
18536
|
+
states: {
|
|
18537
|
+
points,
|
|
18538
|
+
rate,
|
|
18539
|
+
},
|
|
18540
|
+
data: {
|
|
18541
|
+
id,
|
|
18542
|
+
accountId,
|
|
18543
|
+
data,
|
|
18544
|
+
errors,
|
|
18545
|
+
},
|
|
18546
|
+
callbacks: {
|
|
18547
|
+
exchange,
|
|
18548
|
+
setPoints,
|
|
18549
|
+
setRate,
|
|
18550
|
+
},
|
|
18551
|
+
};
|
|
18552
|
+
}
|
|
18553
|
+
const DefaultView = (props) => {
|
|
18554
|
+
const { states, data, callbacks } = props;
|
|
18555
|
+
return (index.h("div", null,
|
|
18556
|
+
index.h("div", null,
|
|
18557
|
+
index.h("label", null, "Rate:"),
|
|
18558
|
+
index.h("input", { value: states.rate, onInput: (e) =>
|
|
18559
|
+
// @ts-ignore
|
|
18560
|
+
callbacks.setRate(e.target.value) })),
|
|
18561
|
+
index.h("input", { value: states.points, onInput: (e) =>
|
|
18562
|
+
// @ts-ignore
|
|
18563
|
+
callbacks.setPoints(e.target.value) }),
|
|
18564
|
+
index.h("button", { onClick: () => callbacks.exchange(props.input) }, "Exchange"),
|
|
18565
|
+
index.h("details", null,
|
|
18566
|
+
index.h("summary", null, "response"),
|
|
18567
|
+
index.h("h4", null, "data"),
|
|
18568
|
+
index.h("div", { style: { maxWidth: "500px" } },
|
|
18569
|
+
index.h("pre", { style: { width: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.data))),
|
|
18570
|
+
index.h("h4", null, "errors"),
|
|
18571
|
+
index.h("div", { style: { maxWidth: "500px" } },
|
|
18572
|
+
index.h("pre", { style: { maxWidth: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.errors))))));
|
|
18573
|
+
};
|
|
18574
|
+
const RewardList = createHookStory(() => {
|
|
18575
|
+
setupGraphQL$6();
|
|
18576
|
+
return (index.h("sqm-reward-exchange-list", { "list-type": "something" }));
|
|
18577
|
+
});
|
|
18578
|
+
const FixedGlobalReward = createHookStory(() => {
|
|
18579
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18580
|
+
return (index.h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18581
|
+
exchangeRewardInput: {
|
|
18582
|
+
userId: data.id,
|
|
18583
|
+
accountId: data.accountId,
|
|
18584
|
+
redeemCreditInput: {
|
|
18585
|
+
amount: states.points,
|
|
18586
|
+
unit: "POINT",
|
|
18587
|
+
},
|
|
18588
|
+
globalRewardKey: "gc1",
|
|
18589
|
+
},
|
|
18590
|
+
} }));
|
|
18591
|
+
});
|
|
18592
|
+
const VariableGlobalReward = createHookStory(() => {
|
|
18593
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18594
|
+
return (index.h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18595
|
+
exchangeRewardInput: {
|
|
18596
|
+
userId: data.id,
|
|
18597
|
+
accountId: data.accountId,
|
|
18598
|
+
redeemCreditInput: {
|
|
18599
|
+
amount: states.points,
|
|
18600
|
+
unit: "POINT",
|
|
18601
|
+
},
|
|
18602
|
+
globalRewardKey: "gc1",
|
|
18603
|
+
rewardInput: {
|
|
18604
|
+
valueInCents: Math.ceil(states.points * states.rate),
|
|
18605
|
+
},
|
|
18606
|
+
},
|
|
18607
|
+
} }));
|
|
18608
|
+
});
|
|
18609
|
+
const VariableCreditReward = createHookStory(() => {
|
|
18610
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18611
|
+
return (index.h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18612
|
+
exchangeRewardInput: {
|
|
18613
|
+
userId: data.id,
|
|
18614
|
+
accountId: data.accountId,
|
|
18615
|
+
redeemCreditInput: {
|
|
18616
|
+
amount: states.points,
|
|
18617
|
+
unit: "POINT",
|
|
18618
|
+
},
|
|
18619
|
+
rewardInput: {
|
|
18620
|
+
type: "CREDIT",
|
|
18621
|
+
unit: "foo",
|
|
18622
|
+
assignedCredit: Math.ceil(states.points * states.rate),
|
|
18623
|
+
},
|
|
18624
|
+
},
|
|
18625
|
+
} }));
|
|
18626
|
+
});
|
|
18627
|
+
|
|
18628
|
+
const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
18629
|
+
__proto__: null,
|
|
18630
|
+
'default': UseRewardExchangeList_stories,
|
|
18631
|
+
RewardList: RewardList,
|
|
18632
|
+
FixedGlobalReward: FixedGlobalReward,
|
|
18633
|
+
VariableGlobalReward: VariableGlobalReward,
|
|
18634
|
+
VariableCreditReward: VariableCreditReward
|
|
18635
|
+
});
|
|
18636
|
+
|
|
18637
|
+
const UseRewardsTable_stories = {
|
|
18638
|
+
title: "Hooks / useRewardsTable",
|
|
18639
|
+
};
|
|
18640
|
+
function setupGraphQL$7() {
|
|
18641
|
+
const id = "testestest";
|
|
18642
|
+
const accountId = id;
|
|
18643
|
+
//@ts-ignore
|
|
18644
|
+
window.widgetIdent = {
|
|
18645
|
+
tenantAlias: "test_a8b41jotf8a1v",
|
|
18646
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18647
|
+
};
|
|
18648
|
+
_extends.useEffect(() => {
|
|
18649
|
+
index_module.L({
|
|
18650
|
+
accountId,
|
|
18651
|
+
id,
|
|
18652
|
+
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18653
|
+
});
|
|
18654
|
+
return () => {
|
|
18655
|
+
window.widgetIdent = undefined;
|
|
18656
|
+
index_module.L(undefined);
|
|
18657
|
+
};
|
|
18658
|
+
}, []);
|
|
18659
|
+
return { id, accountId };
|
|
18660
|
+
}
|
|
18661
|
+
const RewardsTableWithProgram = createHookStory(() => {
|
|
18662
|
+
setupGraphQL$7();
|
|
18663
|
+
index_module.A("sam-partner-test-2");
|
|
18664
|
+
return (index.h("sqm-rewards-table", null,
|
|
18665
|
+
index.h("sqm-rewards-table-column", null)));
|
|
18666
|
+
});
|
|
18667
|
+
const RewardsTableNoProgram = createHookStory(() => {
|
|
18668
|
+
setupGraphQL$7();
|
|
18669
|
+
index_module.A(undefined);
|
|
18670
|
+
return (index.h("sqm-rewards-table", null,
|
|
18671
|
+
index.h("sqm-rewards-table-column", null)));
|
|
18672
|
+
});
|
|
18673
|
+
|
|
18674
|
+
const UseRewardsTable = /*#__PURE__*/Object.freeze({
|
|
17521
18675
|
__proto__: null,
|
|
17522
|
-
'default':
|
|
17523
|
-
|
|
17524
|
-
|
|
18676
|
+
'default': UseRewardsTable_stories,
|
|
18677
|
+
RewardsTableWithProgram: RewardsTableWithProgram,
|
|
18678
|
+
RewardsTableNoProgram: RewardsTableNoProgram
|
|
17525
18679
|
});
|
|
17526
18680
|
|
|
17527
|
-
const
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
const SuccessAlert = () => {
|
|
17531
|
-
return (index.h("sqm-form-message", { type: "success" },
|
|
17532
|
-
index.h("div", null, "This is a success message.")));
|
|
17533
|
-
};
|
|
17534
|
-
const ErrorAlert = () => {
|
|
17535
|
-
return (index.h("sqm-form-message", { type: "error" },
|
|
17536
|
-
index.h("div", null, "This is an error message")));
|
|
17537
|
-
};
|
|
17538
|
-
const InfoAlert = () => {
|
|
17539
|
-
return (index.h("sqm-form-message", { type: "info" },
|
|
17540
|
-
index.h("div", null, "This is an info message")));
|
|
18681
|
+
const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
|
|
18682
|
+
const UseTaskCard_stories = {
|
|
18683
|
+
title: "Hooks / useTaskCard",
|
|
17541
18684
|
};
|
|
17542
|
-
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
18685
|
+
function setupGraphQL$8() {
|
|
18686
|
+
const id = "sam+klip@saasquat.ch";
|
|
18687
|
+
const accountId = id;
|
|
18688
|
+
const programId = "klip-referral-program";
|
|
18689
|
+
//@ts-ignore
|
|
18690
|
+
window.widgetIdent = {
|
|
18691
|
+
tenantAlias: "test_a74miwdpofztj",
|
|
18692
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18693
|
+
programId,
|
|
18694
|
+
};
|
|
18695
|
+
_extends.useEffect(() => {
|
|
18696
|
+
index_module.L({
|
|
18697
|
+
accountId,
|
|
18698
|
+
id,
|
|
18699
|
+
jwt: JWT,
|
|
18700
|
+
});
|
|
18701
|
+
return () => {
|
|
18702
|
+
window.widgetIdent = undefined;
|
|
18703
|
+
index_module.L(undefined);
|
|
18704
|
+
};
|
|
18705
|
+
}, []);
|
|
18706
|
+
return { id, accountId };
|
|
18707
|
+
}
|
|
18708
|
+
const TaskCard = createHookStory(() => {
|
|
18709
|
+
setupGraphQL$8();
|
|
18710
|
+
return (index.h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
|
|
18711
|
+
});
|
|
17554
18712
|
|
|
17555
|
-
const
|
|
18713
|
+
const UseTaskCard = /*#__PURE__*/Object.freeze({
|
|
17556
18714
|
__proto__: null,
|
|
17557
|
-
'default':
|
|
17558
|
-
|
|
17559
|
-
ErrorAlert: ErrorAlert,
|
|
17560
|
-
InfoAlert: InfoAlert,
|
|
17561
|
-
FullStackSuccess: FullStackSuccess
|
|
18715
|
+
'default': UseTaskCard_stories,
|
|
18716
|
+
TaskCard: TaskCard
|
|
17562
18717
|
});
|
|
17563
18718
|
|
|
17564
18719
|
const NewPortal_stories = {
|
|
17565
18720
|
title: "New Portal",
|
|
17566
18721
|
};
|
|
17567
|
-
const style$
|
|
18722
|
+
const style$9 = {
|
|
17568
18723
|
HeaderSubtitleBold: {
|
|
17569
18724
|
"font-weight": 500,
|
|
17570
18725
|
"text-decoration": "underline",
|
|
17571
18726
|
},
|
|
17572
18727
|
};
|
|
17573
18728
|
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
17574
|
-
const sheet$
|
|
17575
|
-
const styleString$
|
|
18729
|
+
const sheet$9 = jssPresetDefault_esm.jss.createStyleSheet(style$9);
|
|
18730
|
+
const styleString$9 = sheet$9.toString();
|
|
17576
18731
|
const barProps = {
|
|
17577
18732
|
data: {
|
|
17578
18733
|
programs: [
|
|
@@ -17667,7 +18822,7 @@ const Dashboard = () => {
|
|
|
17667
18822
|
hide: false,
|
|
17668
18823
|
};
|
|
17669
18824
|
return (index.h("sqm-divided-layout", { direction: "row" },
|
|
17670
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
18825
|
+
index.h("style", { type: "text/css" }, styleString$9),
|
|
17671
18826
|
index.h(Sidebar, null),
|
|
17672
18827
|
index.h("sqm-divided-layout", { direction: "column" },
|
|
17673
18828
|
index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17680,10 +18835,10 @@ const Dashboard = () => {
|
|
|
17680
18835
|
index.h("h1", null, "John Smith"))),
|
|
17681
18836
|
})),
|
|
17682
18837
|
index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17683
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
|
|
17684
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
|
|
17685
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
|
|
17686
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
|
|
18838
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
|
|
18839
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
|
|
18840
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
|
|
18841
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
|
|
17687
18842
|
index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
17688
18843
|
index.h(sqmPortalSectionView.PortalSectionView, Object.assign({}, {
|
|
17689
18844
|
labelMargin: "x-large",
|
|
@@ -17725,7 +18880,7 @@ const Dashboard = () => {
|
|
|
17725
18880
|
};
|
|
17726
18881
|
const EditProfile$2 = () => {
|
|
17727
18882
|
return (index.h("sqm-divided-layout", { direction: "row" },
|
|
17728
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
18883
|
+
index.h("style", { type: "text/css" }, styleString$9),
|
|
17729
18884
|
index.h(Sidebar, null),
|
|
17730
18885
|
index.h("sqm-divided-layout", { direction: "column" },
|
|
17731
18886
|
index.h(sqmPortalProfileView.PortalProfileView, Object.assign({}, {
|
|
@@ -17789,7 +18944,7 @@ const EditProfile$2 = () => {
|
|
|
17789
18944
|
};
|
|
17790
18945
|
const Commissions = () => {
|
|
17791
18946
|
return (index.h("sqm-divided-layout", { direction: "row" },
|
|
17792
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
18947
|
+
index.h("style", { type: "text/css" }, styleString$9),
|
|
17793
18948
|
index.h(Sidebar, null),
|
|
17794
18949
|
index.h("sqm-divided-layout", { direction: "column" },
|
|
17795
18950
|
index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17802,19 +18957,19 @@ const Commissions = () => {
|
|
|
17802
18957
|
index.h("p", null,
|
|
17803
18958
|
"for the",
|
|
17804
18959
|
" ",
|
|
17805
|
-
index.h("span", { class: sheet$
|
|
18960
|
+
index.h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
17806
18961
|
" ",
|
|
17807
18962
|
"program"))),
|
|
17808
18963
|
})),
|
|
17809
18964
|
index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17810
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
|
|
17811
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
|
|
17812
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
|
|
17813
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
|
|
18965
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
|
|
18966
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
|
|
18967
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
|
|
18968
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
|
|
17814
18969
|
};
|
|
17815
18970
|
const Activity = () => {
|
|
17816
18971
|
return (index.h("sqm-divided-layout", { direction: "row" },
|
|
17817
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
18972
|
+
index.h("style", { type: "text/css" }, styleString$9),
|
|
17818
18973
|
index.h(Sidebar, null),
|
|
17819
18974
|
index.h("sqm-divided-layout", { direction: "column" },
|
|
17820
18975
|
index.h(sqmPortalContainerView.PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17827,7 +18982,7 @@ const Activity = () => {
|
|
|
17827
18982
|
index.h("p", null,
|
|
17828
18983
|
"for the",
|
|
17829
18984
|
" ",
|
|
17830
|
-
index.h("span", { class: sheet$
|
|
18985
|
+
index.h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
17831
18986
|
" ",
|
|
17832
18987
|
"program"))),
|
|
17833
18988
|
})),
|
|
@@ -17837,10 +18992,10 @@ const Activity = () => {
|
|
|
17837
18992
|
label: (index.h("sqm-text", null,
|
|
17838
18993
|
index.h("h3", null, "Referral Activity"))),
|
|
17839
18994
|
content: (index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17840
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
|
|
17841
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
|
|
17842
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
|
|
17843
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
|
|
18995
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
|
|
18996
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
|
|
18997
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
|
|
18998
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
|
|
17844
18999
|
}))),
|
|
17845
19000
|
index.h(sqmPortalSectionView.PortalSectionView, Object.assign({}, {
|
|
17846
19001
|
labelMargin: "x-large",
|
|
@@ -17848,9 +19003,9 @@ const Activity = () => {
|
|
|
17848
19003
|
label: (index.h("sqm-text", null,
|
|
17849
19004
|
index.h("h3", null, "Traffic Generated"))),
|
|
17850
19005
|
content: (index.h(sqmStatContainerView.StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17851
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
|
|
17852
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
|
|
17853
|
-
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
|
|
19006
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
|
|
19007
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
|
|
19008
|
+
index.h(useDemoBigStat.BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
|
|
17854
19009
|
})))));
|
|
17855
19010
|
};
|
|
17856
19011
|
|
|
@@ -17864,7 +19019,7 @@ const NewPortal = /*#__PURE__*/Object.freeze({
|
|
|
17864
19019
|
});
|
|
17865
19020
|
|
|
17866
19021
|
const SidebarItem_stories = {
|
|
17867
|
-
title: "Sidebar Item",
|
|
19022
|
+
title: "Components/Sidebar Item",
|
|
17868
19023
|
};
|
|
17869
19024
|
const InactiveItem = () => {
|
|
17870
19025
|
const props = {
|
|
@@ -17901,7 +19056,7 @@ const SidebarItem = /*#__PURE__*/Object.freeze({
|
|
|
17901
19056
|
});
|
|
17902
19057
|
|
|
17903
19058
|
const NavigationSidebar_stories = {
|
|
17904
|
-
title: "Navigation Sidebar",
|
|
19059
|
+
title: "Components/Navigation Sidebar",
|
|
17905
19060
|
};
|
|
17906
19061
|
const DefaultNavigationSidebar = () => {
|
|
17907
19062
|
const barProps = {
|
|
@@ -17950,7 +19105,7 @@ const NavigationSidebar = /*#__PURE__*/Object.freeze({
|
|
|
17950
19105
|
});
|
|
17951
19106
|
|
|
17952
19107
|
const PortalLogin_stories = {
|
|
17953
|
-
title: "Portal Login",
|
|
19108
|
+
title: "Components/Portal Login",
|
|
17954
19109
|
};
|
|
17955
19110
|
const defaultProps$2 = {
|
|
17956
19111
|
states: {
|
|
@@ -17995,7 +19150,7 @@ const PortalLogin$1 = /*#__PURE__*/Object.freeze({
|
|
|
17995
19150
|
});
|
|
17996
19151
|
|
|
17997
19152
|
const PortalRegister_stories = {
|
|
17998
|
-
title: "Portal Register",
|
|
19153
|
+
title: "Components/Portal Register",
|
|
17999
19154
|
};
|
|
18000
19155
|
const defaultProps$3 = {
|
|
18001
19156
|
states: {
|
|
@@ -18098,7 +19253,7 @@ const PortalRegister$1 = /*#__PURE__*/Object.freeze({
|
|
|
18098
19253
|
const scenario = "@author:\r\n@owner:ian\r\nFeature: Forgot Password\r\n\r\n @motivating\r\n Scenario: Users can request to reset their password\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email is sent\r\n Then a confirmation banner is shown stating a password reset email was sent\r\n\r\n @motivating\r\n Scenario: Users are notified if sending their password reset email fails\r\n Given a user enters their email address\r\n And that email address is linked to a previously created account\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n When the password reset email fails to send\r\n Then the user will not receive a password reset email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n @landmine\r\n Scenario: If the input email is not associated to an account a success banner will be shown but an email will not be sent\r\n Given the user entered an email address that is not associated to an accoun\r\n When they click \"Reset Password\"\r\n Then the button enters a loading state\r\n But no email will be sent\r\n And a success banner is shown stating a password reset email was sent if the given email was associated to an account\r\n\r\n @motivating\r\n Scenario: Users can resend password reset email\r\n Given a user had previously requested to reset their password\r\n When they enter their email address\r\n And that email address is linked to a previously created account\r\n And they click \"Reset Password\"\r\n Then the user will receive a second password reset email\r\n And a success banner is shown stating that their email was sent\r\n";
|
|
18099
19254
|
|
|
18100
19255
|
const PortalForgotPassword_stories = {
|
|
18101
|
-
title: "Portal Forgot Password",
|
|
19256
|
+
title: "Components/Portal Forgot Password",
|
|
18102
19257
|
parameters: {
|
|
18103
19258
|
scenario,
|
|
18104
19259
|
},
|
|
@@ -18176,7 +19331,7 @@ const PortalForgotPassword = /*#__PURE__*/Object.freeze({
|
|
|
18176
19331
|
const scenario$1 = "@author:\r\n@owner: ian\r\nFeature: Email Verification\r\n\r\n @minutae\r\n Scenario: User's redirected from registration can re-send their verification email\r\n Given a user has registered\r\n And they have been sent a verification email\r\n When they are redirected to the email verification page\r\n Then a message will be displayed\r\n And it will reflect that a email has already been sent to their email\r\n But they can still re-send the email\r\n When they click to \"Resend-Email\"\r\n Then the user will receive a verification email\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message fails\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When an error occurs trying to send the verification email\r\n Then the user will not receive a verification email\r\n And an error banner is shown stating that they should try again\r\n\r\n @motivating\r\n Scenario: Users are notified if sending the email verification message succeeds\r\n Given a user with an email was stored in session data from registration\r\n When they click to \"Resend-Email\"\r\n Then the button enters a loading state\r\n When the email verification message sends\r\n Then the user will receive a verification email\r\n And a success banner is shown stating that their email was resent";
|
|
18177
19332
|
|
|
18178
19333
|
const PortalEmailVerification_stories = {
|
|
18179
|
-
title: "Portal Email Verification",
|
|
19334
|
+
title: "Components/Portal Email Verification",
|
|
18180
19335
|
parameters: {
|
|
18181
19336
|
scenario: scenario$1,
|
|
18182
19337
|
},
|
|
@@ -18262,7 +19417,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
18262
19417
|
const scenario$2 = "@author:\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message will be displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their password reset code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password will not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"";
|
|
18263
19418
|
|
|
18264
19419
|
const PortalResetPassword_stories = {
|
|
18265
|
-
title: "Portal Reset Password",
|
|
19420
|
+
title: "Components/Portal Reset Password",
|
|
18266
19421
|
parameters: {
|
|
18267
19422
|
scenario: scenario$2,
|
|
18268
19423
|
},
|
|
@@ -18426,7 +19581,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
18426
19581
|
const scenario$3 = "@author:\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email will take you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they click \"Continue\"\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users will be automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" will appear\r\n When they wait 5 seconds\r\n Then they will be redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button will enter a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n Then they will see an error message saying that their verification code is invalid or expired\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n Examples:\r\n | oobCode |\r\n | invalid oob code |\r\n | non existant oob code |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they will be redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users will be redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |";
|
|
18427
19582
|
|
|
18428
19583
|
const PortalVerifyEmail_stories = {
|
|
18429
|
-
title: "Portal Verify Email",
|
|
19584
|
+
title: "Components/Portal Verify Email",
|
|
18430
19585
|
parameters: {
|
|
18431
19586
|
scenario: scenario$3,
|
|
18432
19587
|
},
|
|
@@ -18470,7 +19625,7 @@ const PortalVerifyEmail = /*#__PURE__*/Object.freeze({
|
|
|
18470
19625
|
});
|
|
18471
19626
|
|
|
18472
19627
|
const AssetCard_stories = {
|
|
18473
|
-
title: "Asset Card",
|
|
19628
|
+
title: "Components/Asset Card",
|
|
18474
19629
|
};
|
|
18475
19630
|
const Default$7 = () => {
|
|
18476
19631
|
const props = {
|
|
@@ -18506,7 +19661,7 @@ const AssetCard = /*#__PURE__*/Object.freeze({
|
|
|
18506
19661
|
});
|
|
18507
19662
|
|
|
18508
19663
|
const DividedLayout_stories = {
|
|
18509
|
-
title: "Divided Layout",
|
|
19664
|
+
title: "Components/Divided Layout",
|
|
18510
19665
|
};
|
|
18511
19666
|
const barProps$1 = {
|
|
18512
19667
|
data: {
|
|
@@ -18598,7 +19753,7 @@ const DividedLayout$1 = /*#__PURE__*/Object.freeze({
|
|
|
18598
19753
|
const scenario$4 = "Feature: Change Password\r\n\r\n @motivating\r\n Scenario: Users can change their password\r\n Given a user has registered for the portal\r\n And they have a password\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n Then they will see a success banner stating that the change was successful\r\n When they logout\r\n And try to login\r\n Then they will not be able to login with their old password\r\n But they will be able to login with their new password\r\n\r\n @motivating\r\n Scenario: Users must confirm their password change\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they enter their new password\r\n But they enter a different password to confirm\r\n And click \"Change Password\"\r\n Then they will see an error banner stating that the passwords didnt match\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password\r\n\r\n @motivating\r\n Scenario: Users must enter a new password and confirm it to change their password\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n Then a popup will appear\r\n When they click \"Change password\"\r\n Then a validation error will appear for the new password field\r\n And their password will not be changed\r\n When they enter a new password\r\n And they click \"Change password\"\r\n Then a validation error will appear for the confirm new password field\r\n And their password will not be changed\r\n\r\n @motivating\r\n Scenario: An error banner will be displayed if the password change fails\r\n Given a user has registered for the portal\r\n When they navigate to the edit profile page\r\n And click \"Change your password...\"\r\n When they enter their new password\r\n And confirm it\r\n And click \"Change Password\"\r\n But the change fails\r\n Then they will see an error banner stating that the change failed\r\n When they logout\r\n And try to login\r\n Then they will be able to login with their existing password";
|
|
18599
19754
|
|
|
18600
19755
|
const ChangePassword_stories = {
|
|
18601
|
-
title: "Change Password",
|
|
19756
|
+
title: "Components/Change Password",
|
|
18602
19757
|
parameters: {
|
|
18603
19758
|
scenario: scenario$4,
|
|
18604
19759
|
},
|
|
@@ -18754,7 +19909,7 @@ const ChangePassword = /*#__PURE__*/Object.freeze({
|
|
|
18754
19909
|
});
|
|
18755
19910
|
|
|
18756
19911
|
const PortalProfile_stories = {
|
|
18757
|
-
title: "Portal Profile",
|
|
19912
|
+
title: "Components/Portal Profile",
|
|
18758
19913
|
};
|
|
18759
19914
|
// const style = {};
|
|
18760
19915
|
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
@@ -18995,7 +20150,7 @@ const PortalProfile = /*#__PURE__*/Object.freeze({
|
|
|
18995
20150
|
});
|
|
18996
20151
|
|
|
18997
20152
|
const ReferralTableRewardsCell_stories = {
|
|
18998
|
-
title: "Referral Table Rewards Cell",
|
|
20153
|
+
title: "Components/Referral Table Rewards Cell",
|
|
18999
20154
|
};
|
|
19000
20155
|
const baseReward = {
|
|
19001
20156
|
id: "123",
|
|
@@ -19227,7 +20382,7 @@ const ReferralTableRewardsCell$1 = /*#__PURE__*/Object.freeze({
|
|
|
19227
20382
|
});
|
|
19228
20383
|
|
|
19229
20384
|
const ReferralTable_stories = {
|
|
19230
|
-
title: "Referral Table",
|
|
20385
|
+
title: "Components/Referral Table",
|
|
19231
20386
|
};
|
|
19232
20387
|
const loadingElement = (index.h("div", { slot: "loading", style: { display: "contents" } },
|
|
19233
20388
|
index.h("sqm-table-row", null,
|
|
@@ -19714,7 +20869,7 @@ const ReferralTable$1 = /*#__PURE__*/Object.freeze({
|
|
|
19714
20869
|
});
|
|
19715
20870
|
|
|
19716
20871
|
const ReferralTableCell_stories = {
|
|
19717
|
-
title: "Referral Table Cell",
|
|
20872
|
+
title: "Components/Referral Table Cell",
|
|
19718
20873
|
};
|
|
19719
20874
|
const TableCell = () => {
|
|
19720
20875
|
return (index.h("sqm-referral-table-cell", { innerTemplate: "Table Cell Text" }));
|
|
@@ -19786,73 +20941,1029 @@ const ReferralTableCell$1 = /*#__PURE__*/Object.freeze({
|
|
|
19786
20941
|
RewardsCell: RewardsCell
|
|
19787
20942
|
});
|
|
19788
20943
|
|
|
19789
|
-
const UserName_stories = {
|
|
19790
|
-
title: "User Name",
|
|
20944
|
+
const UserName_stories = {
|
|
20945
|
+
title: "Tests/User Name",
|
|
20946
|
+
};
|
|
20947
|
+
const DemoData = () => {
|
|
20948
|
+
return (index.h("sqm-user-name", { demoData: {
|
|
20949
|
+
loading: false,
|
|
20950
|
+
loadingText: "...",
|
|
20951
|
+
username: "Test Testerson",
|
|
20952
|
+
} }));
|
|
20953
|
+
};
|
|
20954
|
+
const Username = () => {
|
|
20955
|
+
return index.h("sqm-user-name", null);
|
|
20956
|
+
};
|
|
20957
|
+
|
|
20958
|
+
const UserName = /*#__PURE__*/Object.freeze({
|
|
20959
|
+
__proto__: null,
|
|
20960
|
+
'default': UserName_stories,
|
|
20961
|
+
DemoData: DemoData,
|
|
20962
|
+
Username: Username
|
|
20963
|
+
});
|
|
20964
|
+
|
|
20965
|
+
const PasswordField_stories = {
|
|
20966
|
+
title: "Components/Portal Password Field",
|
|
20967
|
+
};
|
|
20968
|
+
const Start = () => {
|
|
20969
|
+
return (index.h("sqm-password-field", { demoData: {
|
|
20970
|
+
initValue: "",
|
|
20971
|
+
states: {
|
|
20972
|
+
enableValidation: true,
|
|
20973
|
+
validationErrors: {},
|
|
20974
|
+
content: {
|
|
20975
|
+
fieldLabel: "Password",
|
|
20976
|
+
},
|
|
20977
|
+
},
|
|
20978
|
+
} }));
|
|
20979
|
+
};
|
|
20980
|
+
const EmptyError = () => {
|
|
20981
|
+
return (index.h("sqm-password-field", { demoData: {
|
|
20982
|
+
initValue: "",
|
|
20983
|
+
states: {
|
|
20984
|
+
enableValidation: true,
|
|
20985
|
+
validationErrors: { password: "Cannot be empty" },
|
|
20986
|
+
content: {
|
|
20987
|
+
fieldLabel: "Password",
|
|
20988
|
+
},
|
|
20989
|
+
},
|
|
20990
|
+
} }));
|
|
20991
|
+
};
|
|
20992
|
+
const ValidationError = () => {
|
|
20993
|
+
return (index.h("sqm-password-field", { demoData: {
|
|
20994
|
+
initValue: "asdf",
|
|
20995
|
+
states: {
|
|
20996
|
+
enableValidation: true,
|
|
20997
|
+
validationErrors: { password: "Incomplete" },
|
|
20998
|
+
content: {
|
|
20999
|
+
fieldLabel: "Password",
|
|
21000
|
+
},
|
|
21001
|
+
},
|
|
21002
|
+
} }));
|
|
21003
|
+
};
|
|
21004
|
+
|
|
21005
|
+
const PasswordField = /*#__PURE__*/Object.freeze({
|
|
21006
|
+
__proto__: null,
|
|
21007
|
+
'default': PasswordField_stories,
|
|
21008
|
+
Start: Start,
|
|
21009
|
+
EmptyError: EmptyError,
|
|
21010
|
+
ValidationError: ValidationError
|
|
21011
|
+
});
|
|
21012
|
+
|
|
21013
|
+
const checkmark_circle = () => {
|
|
21014
|
+
return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
21015
|
+
index.h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
|
|
21016
|
+
};
|
|
21017
|
+
const arrow_left_right = () => {
|
|
21018
|
+
return (index.h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21019
|
+
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.265 2.789a.346.346 0 000-.489L8.066.101a.346.346 0 10-.489.489l1.61 1.609H2.073a.691.691 0 00-.69.691v1.728a.346.346 0 00.69 0V2.89h7.114L7.577 4.5a.346.346 0 10.49.488l2.198-2.2zM.101 9.21a.346.346 0 000 .489l2.2 2.199a.346.346 0 00.488-.489l-1.61-1.609h7.114c.382 0 .691-.31.691-.691V7.382a.346.346 0 00-.691 0V9.11H1.18L2.789 7.5a.346.346 0 10-.489-.488l-2.199 2.2z", fill: "currentColor" })));
|
|
21020
|
+
};
|
|
21021
|
+
|
|
21022
|
+
const gift = () => {
|
|
21023
|
+
return (index.h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21024
|
+
index.h("path", { d: "M15 5H9v11h4.5a1 1 0 001-1V9h.5a1 1 0 001-1V6a1 1 0 00-1-1zM1.5 9v6a1 1 0 001 1H7V5H1a1 1 0 00-1 1v2a1 1 0 001 1h.5z", fill: "var(--sl-color-primary-200)" }),
|
|
21025
|
+
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
|
|
21026
|
+
index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.71c0 .886-1.33 2.227-2 2.29H9v11H7.002V5H4.588C3.212 4.702 2 3.645 2 2.52 2 1.426 2.476.558 3.342.183 4.169-.176 5.125.02 5.88.545c.927.643 1.447 1.851 1.919 2.947l.123.286.12-.272C8.51 2.45 9.045 1.243 9.94.596c.793-.573 1.801-.79 2.672-.397.9.405 1.388 1.336 1.388 2.51zM10.612 1.5c.48-.347 1.056-.41 1.548 0 .428.357.45.525.506.93l.01.07c0 .599-.516 1.5-1.032 1.5-.366 0-.653-.003-.922-.006-.49-.005-.92-.01-1.657.006.14-.272.252-.533.36-.782.285-.667.534-1.246 1.187-1.718zm-5.673 0c-.233-.161-.766-.09-.987.006-.183.08-.456.32-.456 1.015 0 .674 1.092 1.257 1.092 1.257S5.454 4 7.002 4c-.527-1.305-1.273-1.951-2.063-2.5z", fill: "var(--sl-color-primary-600)" })));
|
|
21027
|
+
};
|
|
21028
|
+
|
|
21029
|
+
function ProgressBarView(props) {
|
|
21030
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, } = props;
|
|
21031
|
+
console.log("progress bar props", props);
|
|
21032
|
+
const gift1 = gift();
|
|
21033
|
+
const gift2 = gift();
|
|
21034
|
+
const gift3 = gift();
|
|
21035
|
+
var items = [];
|
|
21036
|
+
var columns = "";
|
|
21037
|
+
var repetitions = Math.floor(progress / goal);
|
|
21038
|
+
if (repeatable) {
|
|
21039
|
+
if (steps) {
|
|
21040
|
+
addStepsRepeatable();
|
|
21041
|
+
}
|
|
21042
|
+
else {
|
|
21043
|
+
addLinearRepeatable();
|
|
21044
|
+
}
|
|
21045
|
+
}
|
|
21046
|
+
// non repeatable
|
|
21047
|
+
else {
|
|
21048
|
+
if (steps) {
|
|
21049
|
+
addSteps();
|
|
21050
|
+
}
|
|
21051
|
+
else {
|
|
21052
|
+
addLinear();
|
|
21053
|
+
}
|
|
21054
|
+
}
|
|
21055
|
+
const style = {
|
|
21056
|
+
ProgressBar: {
|
|
21057
|
+
"& .progress-bar": {
|
|
21058
|
+
height: "15px",
|
|
21059
|
+
marginTop: steps ? "var(--sl-spacing-x-medium)" : "var(--sl-spacing-large)",
|
|
21060
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
21061
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
21062
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21063
|
+
display: "grid",
|
|
21064
|
+
gridTemplateColumns: columns,
|
|
21065
|
+
lineHeight: "45px",
|
|
21066
|
+
userSelect: "none",
|
|
21067
|
+
},
|
|
21068
|
+
"& .progress-bar.repeatable-steps": {
|
|
21069
|
+
marginLeft: "var(--sl-spacing-x-small)",
|
|
21070
|
+
},
|
|
21071
|
+
"& .filled:after": {
|
|
21072
|
+
content: '""',
|
|
21073
|
+
display: "flex",
|
|
21074
|
+
width: "100%",
|
|
21075
|
+
height: "4px",
|
|
21076
|
+
borderRadius: "4px",
|
|
21077
|
+
backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
|
|
21078
|
+
},
|
|
21079
|
+
"& .progress": {
|
|
21080
|
+
display: "block",
|
|
21081
|
+
textAlign: "center",
|
|
21082
|
+
marginLeft: "-100px",
|
|
21083
|
+
marginRight: "-100px",
|
|
21084
|
+
},
|
|
21085
|
+
"& .progress::after": {
|
|
21086
|
+
content: '""',
|
|
21087
|
+
width: "12px",
|
|
21088
|
+
height: "12px",
|
|
21089
|
+
display: "flex",
|
|
21090
|
+
backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
|
|
21091
|
+
borderRadius: "50%",
|
|
21092
|
+
position: "relative",
|
|
21093
|
+
left: "47%",
|
|
21094
|
+
top: "-85%",
|
|
21095
|
+
},
|
|
21096
|
+
"& .progress.bg:after": {
|
|
21097
|
+
width: "0",
|
|
21098
|
+
height: "0",
|
|
21099
|
+
border: "none",
|
|
21100
|
+
},
|
|
21101
|
+
"& .progress.top": {
|
|
21102
|
+
position: "relative",
|
|
21103
|
+
top: "-40px",
|
|
21104
|
+
},
|
|
21105
|
+
"& .progress.top:after": {
|
|
21106
|
+
top: "-16%",
|
|
21107
|
+
},
|
|
21108
|
+
"& .empty": {
|
|
21109
|
+
display: "block",
|
|
21110
|
+
textAlign: "center",
|
|
21111
|
+
marginLeft: "-100px",
|
|
21112
|
+
marginRight: "-100px",
|
|
21113
|
+
},
|
|
21114
|
+
"& .empty::after": {
|
|
21115
|
+
content: '""',
|
|
21116
|
+
width: "12px",
|
|
21117
|
+
height: "12px",
|
|
21118
|
+
border: "2px solid #E0E0E0",
|
|
21119
|
+
margin: "-2px",
|
|
21120
|
+
display: "flex",
|
|
21121
|
+
backgroundColor: "white",
|
|
21122
|
+
borderRadius: "50%",
|
|
21123
|
+
position: "relative",
|
|
21124
|
+
left: "47%",
|
|
21125
|
+
top: "-85%",
|
|
21126
|
+
},
|
|
21127
|
+
"& .empty.bg:after": {
|
|
21128
|
+
width: "0",
|
|
21129
|
+
height: "0",
|
|
21130
|
+
border: "none",
|
|
21131
|
+
},
|
|
21132
|
+
"& .remain:after": {
|
|
21133
|
+
content: '""',
|
|
21134
|
+
display: "flex",
|
|
21135
|
+
width: "100%",
|
|
21136
|
+
height: "4px",
|
|
21137
|
+
borderRadius: "4px",
|
|
21138
|
+
backgroundColor: "#E0E0E0",
|
|
21139
|
+
},
|
|
21140
|
+
"& .gift.bw": {
|
|
21141
|
+
filter: "grayscale(100%)",
|
|
21142
|
+
},
|
|
21143
|
+
"& .gift.start": {
|
|
21144
|
+
transform: "scale(80%)",
|
|
21145
|
+
top: "-20px",
|
|
21146
|
+
},
|
|
21147
|
+
"& .gift": {
|
|
21148
|
+
textAlign: "center",
|
|
21149
|
+
marginLeft: "-100px",
|
|
21150
|
+
marginRight: "-100px",
|
|
21151
|
+
position: "relative",
|
|
21152
|
+
display: "list-item",
|
|
21153
|
+
listStyleType: "none",
|
|
21154
|
+
top: "-18px",
|
|
21155
|
+
filter: goal <= progress ? "" : "grayscale(100%)",
|
|
21156
|
+
zIndex: "1",
|
|
21157
|
+
},
|
|
21158
|
+
},
|
|
21159
|
+
};
|
|
21160
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
21161
|
+
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
21162
|
+
const styleString = sheet.toString();
|
|
21163
|
+
return (index.h("div", { class: sheet.classes.ProgressBar },
|
|
21164
|
+
index.h("style", { type: "text/css" }, styleString),
|
|
21165
|
+
index.h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
|
|
21166
|
+
function clamp(x, min, max) {
|
|
21167
|
+
return Math.min(Math.max(x, min), max);
|
|
21168
|
+
}
|
|
21169
|
+
function addLinear() {
|
|
21170
|
+
const ratio = progress / goal;
|
|
21171
|
+
columns =
|
|
21172
|
+
clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
|
|
21173
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21174
|
+
items.push(index.h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
|
|
21175
|
+
? ""
|
|
21176
|
+
: progressBarUnit + clamp(progress, 0, goal)));
|
|
21177
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21178
|
+
items.push(index.h("div", { class: "progress bg" }, goal));
|
|
21179
|
+
items.push(index.h("div", { class: "gift" }, gift1));
|
|
21180
|
+
}
|
|
21181
|
+
function addSteps() {
|
|
21182
|
+
let ratio = 1 / goal;
|
|
21183
|
+
for (let i = 1; i < goal; i++) {
|
|
21184
|
+
columns += ratio + "fr 0fr ";
|
|
21185
|
+
if (i > progress) {
|
|
21186
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21187
|
+
items.push(index.h("div", { class: "empty" }, i));
|
|
21188
|
+
}
|
|
21189
|
+
else {
|
|
21190
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21191
|
+
items.push(index.h("div", { class: "progress" }, i));
|
|
21192
|
+
}
|
|
21193
|
+
}
|
|
21194
|
+
columns += ratio + "fr 0fr ";
|
|
21195
|
+
// reward success
|
|
21196
|
+
if (goal <= progress) {
|
|
21197
|
+
columns += "0fr ";
|
|
21198
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21199
|
+
items.push(index.h("div", { class: "progress bg" }, goal));
|
|
21200
|
+
items.push(index.h("div", { class: "gift" }, gift1));
|
|
21201
|
+
}
|
|
21202
|
+
// reward fail
|
|
21203
|
+
else {
|
|
21204
|
+
columns += "0fr ";
|
|
21205
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21206
|
+
items.push(index.h("div", { class: "empty bg" }, goal));
|
|
21207
|
+
items.push(index.h("div", { class: "gift" }, gift1));
|
|
21208
|
+
}
|
|
21209
|
+
}
|
|
21210
|
+
function addLinearRepeatable() {
|
|
21211
|
+
let repetitions = Math.floor(progress / goal);
|
|
21212
|
+
let ratio = ((progress % goal) / goal) * 0.5;
|
|
21213
|
+
// 0 repetition
|
|
21214
|
+
if (repetitions == 0) {
|
|
21215
|
+
columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
21216
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21217
|
+
items.push(index.h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
|
|
21218
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21219
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21220
|
+
items.push(index.h("div", { class: "gift" }, gift1));
|
|
21221
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21222
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21223
|
+
items.push(index.h("div", { class: "gift bw" }, gift2));
|
|
21224
|
+
}
|
|
21225
|
+
// single repetition
|
|
21226
|
+
else if (repetitions == 1) {
|
|
21227
|
+
columns =
|
|
21228
|
+
"0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
|
|
21229
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21230
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21231
|
+
items.push(index.h("div", { class: "gift" }, gift1));
|
|
21232
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21233
|
+
items.push(index.h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
|
|
21234
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21235
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21236
|
+
items.push(index.h("div", { class: "gift bw" }, gift2));
|
|
21237
|
+
}
|
|
21238
|
+
// multiple repetitions
|
|
21239
|
+
else {
|
|
21240
|
+
columns =
|
|
21241
|
+
"0fr 0fr 0.5fr 0fr 0fr " +
|
|
21242
|
+
ratio +
|
|
21243
|
+
"fr 0fr " +
|
|
21244
|
+
(0.5 - ratio) +
|
|
21245
|
+
"fr 0fr 0fr";
|
|
21246
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
|
|
21247
|
+
items.push(index.h("div", { class: "gift start" }, gift1));
|
|
21248
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21249
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
|
|
21250
|
+
items.push(index.h("div", { class: "gift" }, gift2));
|
|
21251
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21252
|
+
items.push(index.h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
|
|
21253
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21254
|
+
items.push(index.h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
|
|
21255
|
+
items.push(index.h("div", { class: "gift bw" }, gift3));
|
|
21256
|
+
}
|
|
21257
|
+
}
|
|
21258
|
+
function addStepsRepeatable() {
|
|
21259
|
+
let repetitions = Math.floor(progress / goal);
|
|
21260
|
+
// no or single repetition
|
|
21261
|
+
if (repetitions < 2) {
|
|
21262
|
+
let ratio = 1 / goal;
|
|
21263
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21264
|
+
columns += ratio + "fr 0fr ";
|
|
21265
|
+
if (i > progress) {
|
|
21266
|
+
if (i == goal) {
|
|
21267
|
+
columns += "0fr ";
|
|
21268
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21269
|
+
items.push(index.h("div", { class: "empty bg" }, goal));
|
|
21270
|
+
items.push(index.h("div", { class: "gift bw" }, gift1));
|
|
21271
|
+
}
|
|
21272
|
+
else if (i == goal * 2) {
|
|
21273
|
+
columns += "0fr 0fr";
|
|
21274
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21275
|
+
items.push(index.h("div", { class: "empty bg" }, goal * 2));
|
|
21276
|
+
items.push(index.h("div", { class: "gift bw" }, gift2));
|
|
21277
|
+
}
|
|
21278
|
+
else {
|
|
21279
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21280
|
+
items.push(index.h("div", { class: "empty" }, progressBarUnit + i));
|
|
21281
|
+
}
|
|
21282
|
+
}
|
|
21283
|
+
else if (i == goal) {
|
|
21284
|
+
columns += "0fr ";
|
|
21285
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21286
|
+
items.push(index.h("div", { class: "progress bg" }, i));
|
|
21287
|
+
items.push(index.h("div", { class: "gift" }, gift3));
|
|
21288
|
+
}
|
|
21289
|
+
else {
|
|
21290
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21291
|
+
items.push(index.h("div", { class: "progress" }, i));
|
|
21292
|
+
}
|
|
21293
|
+
}
|
|
21294
|
+
}
|
|
21295
|
+
// case repetition many
|
|
21296
|
+
else {
|
|
21297
|
+
let position = (progress % goal) + goal;
|
|
21298
|
+
let ratio = 1 / goal;
|
|
21299
|
+
columns += "0fr 0fr ";
|
|
21300
|
+
items.push(index.h("div", { class: "progress bg" }, goal * (repetitions - 1)));
|
|
21301
|
+
items.push(index.h("div", { class: "gift start" }, gift1));
|
|
21302
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21303
|
+
columns += ratio + "fr 0fr ";
|
|
21304
|
+
if (i <= goal) {
|
|
21305
|
+
if (i == goal) {
|
|
21306
|
+
columns += "0fr ";
|
|
21307
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21308
|
+
items.push(index.h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
|
|
21309
|
+
items.push(index.h("div", { class: "gift" }, gift2));
|
|
21310
|
+
}
|
|
21311
|
+
else {
|
|
21312
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21313
|
+
items.push(index.h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21314
|
+
}
|
|
21315
|
+
}
|
|
21316
|
+
else if (i > position) {
|
|
21317
|
+
if (i == goal * 2) {
|
|
21318
|
+
columns += "0fr 0fr";
|
|
21319
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21320
|
+
items.push(index.h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
|
|
21321
|
+
items.push(index.h("div", { class: "gift bw" }, gift3));
|
|
21322
|
+
}
|
|
21323
|
+
else {
|
|
21324
|
+
items.push(index.h("div", { class: "remain" }));
|
|
21325
|
+
items.push(index.h("div", { class: "empty" }, i + goal * (repetitions - 1)));
|
|
21326
|
+
}
|
|
21327
|
+
}
|
|
21328
|
+
else {
|
|
21329
|
+
items.push(index.h("div", { class: "filled" }));
|
|
21330
|
+
items.push(index.h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21331
|
+
}
|
|
21332
|
+
}
|
|
21333
|
+
}
|
|
21334
|
+
}
|
|
21335
|
+
}
|
|
21336
|
+
|
|
21337
|
+
function TaskCardView(props) {
|
|
21338
|
+
const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
|
|
21339
|
+
console.log({ props });
|
|
21340
|
+
const checkmark_circle$1 = checkmark_circle();
|
|
21341
|
+
const arrow_left_right$1 = arrow_left_right();
|
|
21342
|
+
const style = {
|
|
21343
|
+
HostBlock: mixins.HostBlock,
|
|
21344
|
+
TaskCard: {
|
|
21345
|
+
"& .main > div": {
|
|
21346
|
+
margin: "var(--sl-spacing-medium)",
|
|
21347
|
+
},
|
|
21348
|
+
"& .main": {
|
|
21349
|
+
position: "relative",
|
|
21350
|
+
boxSizing: "border-box",
|
|
21351
|
+
minWidth: "347px",
|
|
21352
|
+
background: "var(--sl-color-white)",
|
|
21353
|
+
border: "1px solid var(--sl-color-gray-300)",
|
|
21354
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
21355
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21356
|
+
lineHeight: "var(--sl-line-height-dense)",
|
|
21357
|
+
},
|
|
21358
|
+
"& .main.complete": {
|
|
21359
|
+
background: "var(--sl-color-success-50)",
|
|
21360
|
+
borderColor: "var(--sl-color-success-700)",
|
|
21361
|
+
},
|
|
21362
|
+
},
|
|
21363
|
+
Header: {
|
|
21364
|
+
display: "flex",
|
|
21365
|
+
"& .icon": {
|
|
21366
|
+
alignSelf: "center",
|
|
21367
|
+
lineHeight: "0",
|
|
21368
|
+
color: "var(--sl-color-success-700)",
|
|
21369
|
+
fontSize: "var(--sl-font-size-large)",
|
|
21370
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
21371
|
+
},
|
|
21372
|
+
"& .value": {
|
|
21373
|
+
alignSelf: "center",
|
|
21374
|
+
color: "var(--sl-color-black)",
|
|
21375
|
+
fontSize: "var(--sl-font-size-x-large)",
|
|
21376
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21377
|
+
lineHeight: "100%",
|
|
21378
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21379
|
+
},
|
|
21380
|
+
"& .text": {
|
|
21381
|
+
alignSelf: "end",
|
|
21382
|
+
textTransform: "uppercase",
|
|
21383
|
+
color: "var(--sl-color-gray-600)",
|
|
21384
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21385
|
+
lineHeight: "var(--sl-font-size-medium)",
|
|
21386
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21387
|
+
},
|
|
21388
|
+
},
|
|
21389
|
+
Title: {
|
|
21390
|
+
color: "var(--sl-color-black)",
|
|
21391
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21392
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21393
|
+
},
|
|
21394
|
+
Footer: {
|
|
21395
|
+
display: "flex",
|
|
21396
|
+
"& .icon": {
|
|
21397
|
+
fontSize: "var(--sl-font-size-xx-small)",
|
|
21398
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21399
|
+
},
|
|
21400
|
+
"& .text": {
|
|
21401
|
+
marginTop: "auto",
|
|
21402
|
+
verticalAlign: "text-bottom",
|
|
21403
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21404
|
+
color: "var(--sl-color-gray-600)",
|
|
21405
|
+
},
|
|
21406
|
+
"& .success": {
|
|
21407
|
+
color: "var(--sl-color-success-600)!important",
|
|
21408
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21409
|
+
},
|
|
21410
|
+
"& .action": {
|
|
21411
|
+
marginTop: "auto",
|
|
21412
|
+
marginLeft: "auto",
|
|
21413
|
+
},
|
|
21414
|
+
"& sl-button.action::part(base) ": {
|
|
21415
|
+
color: "var(--sl-color-white)",
|
|
21416
|
+
background: "var(--sl-color-primary-500)",
|
|
21417
|
+
border: "1px solid var(--sl-color-primary-500)",
|
|
21418
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
21419
|
+
},
|
|
21420
|
+
"& sl-button.action.completed::part(base) ": {
|
|
21421
|
+
border: "1px solid var(--sl-color-gray-300)!important",
|
|
21422
|
+
background: "var(--sl-color-gray-300)!important",
|
|
21423
|
+
},
|
|
21424
|
+
},
|
|
21425
|
+
};
|
|
21426
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
21427
|
+
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
21428
|
+
const styleString = sheet.toString();
|
|
21429
|
+
const showComplete = progress >= goal;
|
|
21430
|
+
const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
|
|
21431
|
+
const taskComplete = showComplete && repeatable === false;
|
|
21432
|
+
console.log({ showProgressBar, loading });
|
|
21433
|
+
return (index.h("div", { class: sheet.classes.TaskCard },
|
|
21434
|
+
index.h("div", { class: showComplete ? "main complete" : "main" },
|
|
21435
|
+
index.h("style", { type: "text/css" }, styleString),
|
|
21436
|
+
index.h("div", { class: sheet.classes.Header },
|
|
21437
|
+
showComplete && index.h("span", { class: "icon" }, checkmark_circle$1),
|
|
21438
|
+
index.h("span", { class: "value" }, rewardAmount),
|
|
21439
|
+
index.h("span", { class: "text" }, rewardUnit)),
|
|
21440
|
+
index.h("div", { class: sheet.classes.Title }, cardTitle),
|
|
21441
|
+
index.h(Details, { description: description }),
|
|
21442
|
+
showProgressBar && loading ? (index.h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && index.h(ProgressBarView, Object.assign({}, props, { complete: taskComplete }))),
|
|
21443
|
+
index.h("div", { class: sheet.classes.Footer },
|
|
21444
|
+
index.h("span", { class: "text" },
|
|
21445
|
+
repeatable && (index.h("div", null,
|
|
21446
|
+
index.h("span", { class: repetitions > 0 ? "icon success" : "icon" }, arrow_left_right$1),
|
|
21447
|
+
index.h("span", { class: repetitions > 0 ? "success" : "" },
|
|
21448
|
+
"Completed ",
|
|
21449
|
+
repetitions,
|
|
21450
|
+
" times"))),
|
|
21451
|
+
showExpiry && (index.h("span", null,
|
|
21452
|
+
"Ends ",
|
|
21453
|
+
" ",
|
|
21454
|
+
dateExpires))),
|
|
21455
|
+
index.h("sl-button", { class: taskComplete ? "action completed" : "action", size: "small", onClick: () => window.open(buttonLink), disabled: taskComplete }, buttonText)))));
|
|
21456
|
+
}
|
|
21457
|
+
function Details(props) {
|
|
21458
|
+
const style = {
|
|
21459
|
+
Description: {
|
|
21460
|
+
"& input[type=checkbox]": {
|
|
21461
|
+
display: "none",
|
|
21462
|
+
},
|
|
21463
|
+
"& input:checked ~ .details": {
|
|
21464
|
+
transform: "rotate(-180deg)",
|
|
21465
|
+
},
|
|
21466
|
+
"& .details": {
|
|
21467
|
+
position: "absolute",
|
|
21468
|
+
top: "var(--sl-spacing-medium)",
|
|
21469
|
+
right: "var(--sl-spacing-medium)",
|
|
21470
|
+
color: "var(--sl-color-gray-700)",
|
|
21471
|
+
fontSize: "var(--sl-font-size-large)",
|
|
21472
|
+
"& :hover": {
|
|
21473
|
+
color: "var(--sl-color-primary-700)",
|
|
21474
|
+
},
|
|
21475
|
+
transformOrigin: "50% 37%",
|
|
21476
|
+
transition: "transform var(--sl-transition-medium) ease",
|
|
21477
|
+
},
|
|
21478
|
+
"& input:checked ~ .summary": {
|
|
21479
|
+
transition: "max-height var(--sl-transition-medium) ease",
|
|
21480
|
+
maxHeight: "300px",
|
|
21481
|
+
},
|
|
21482
|
+
"& .summary": {
|
|
21483
|
+
display: "block",
|
|
21484
|
+
overflow: "hidden",
|
|
21485
|
+
color: "var(--sl-color-gray-700)",
|
|
21486
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21487
|
+
maxHeight: "0px",
|
|
21488
|
+
transition: "max-height var(--sl-transition-fast) ease-out",
|
|
21489
|
+
},
|
|
21490
|
+
},
|
|
21491
|
+
};
|
|
21492
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
21493
|
+
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
21494
|
+
const styleString = sheet.toString();
|
|
21495
|
+
const rid = Math.random().toString(36).slice(2);
|
|
21496
|
+
return (index.h("div", null,
|
|
21497
|
+
index.h("style", { type: "text/css" }, styleString),
|
|
21498
|
+
index.h("span", { class: sheet.classes.Description },
|
|
21499
|
+
index.h("input", { type: "checkbox", id: "details-" + rid }),
|
|
21500
|
+
index.h("label", { class: "details", htmlFor: "details-" + rid },
|
|
21501
|
+
index.h("sl-icon", { name: "chevron-down" })),
|
|
21502
|
+
index.h("span", { class: "summary" }, props.description))));
|
|
21503
|
+
}
|
|
21504
|
+
|
|
21505
|
+
const scenario$5 = "@author:derek\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario: A header, body title, description and a CTA button are always displayed\r\n\t\tGiven the Task Card is configured with the following props\r\n\t\t\t| prop | value |\r\n\t\t\t| rewardAmount | \"40\" |\r\n\t\t\t| rewardUnit | \"Points\" |\r\n\t\t\t| cardTitle | Complete a survey |\r\n\t\t\t| description | Fill out our survey form and receive points! |\r\n\t\t\t| buttonText | Take Survey |\r\n\t\t\t| buttonLink | https://example.com/ |\r\n\t\tWhen a user views the Task Card\r\n\t\tThen they see \"40 Points\" as the heading\r\n\t\tAnd the \"40\" is bolded\r\n\t\tAnd they see \"Complete a survey\" bolded in the body\r\n\t\tAnd a details icon in the top right hand corner\r\n\t\tAnd a button with text \"Take Survey\" in the bottom right hand corner\r\n\t\tWhen they click the button\r\n\t\tThen they are redirected to \"example.com\" in a new window\r\n\t\tWhen they click the details icon\r\n\t\tThen \"Fill out our survey form and receive points!\" is shown as the card description\r\n\r\n\tScenario: A loading state is displayed while the Task Card is loading\r\n\t\tGiven a Task Card component\r\n\t\tWhen a user views the Task Card\r\n\t\tThen a loading state is displayed\r\n\t\tWhen the Task Card has loaded\r\n\t\tThen the loading state disapears\r\n\r\n\tScenario Outline: The Progress Bar can be shown or hidden but is hidden by default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"showProgressBar\" <value>\r\n\t\tWhen a user views the Task Card\r\n\t\tThen the progress bar <mayBe> displayed\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\tScenario Outline: Tasks can be repeatable or one-time only but are one-time only be default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"repeatable\" <value>\r\n\t\tAnd a user who has already completed the task\r\n\t\tWhen they views the Task Card\r\n\t\tThen they see a green checkmark icon beside the card heading\r\n\t\tAnd the card <mayBe> green\r\n\t\tAnd the card's border <mayBe> green\r\n\t\tAnd the CTA button <mayBe> disabled\r\n\t\tAnd the CTA button <mayBe> grey\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | isn't |\r\n\t\t\t| has | false | is |\r\n\t\t\t| doesn't have | | is |\r\n\r\n\tScenario: Task Expiries can be configured and disable the CTA after the expiry\r\n\t\tGiven a Task Card component\r\n\t\tAnd it is configured for <expiry>\r\n\t\tWhen a user views the Card on <day>\r\n\t\tThen they the expiry on <cardLocation>\r\n\t\tAnd the text <mayBe> orange\r\n\t\tAnd the card <mayBe> disabled\r\n\t\tAnd the card <mayBe> grey\r\n\t\tAnd the user <mayBe> unable to complete the loyalty task\r\n\t\tExamples:\r\n\t\t\t| expiry | day | cardLocation | mayBe |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 1st 2021 12:00:00 | bottom left | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 31 2021 11:00:00 | top right | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Jan 15th 2022 10:00:00 | top right | is |\r\n\r\n\tScenario Outline: Task expiry can be hidden or shown but is hidden by default\r\n\t\tGiven a Task Card\r\n\t\tAnd it is configured with an expiry\r\n\t\tAnd it <mayHave> \"showExpiry\" <value>\r\n\t\tWhen a user views the Task card\r\n\t\tThen the expiry <mayBe> shown in the bottom left hand corner\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\t#DS: Currently this text is non configurable and isnt set up for proper pluralization\r\n\tScenario Outline: A task completion count is displayed for repeatable tasks\r\n\t\tGiven a Task Card is configured for a repeatable task\r\n\t\tAnd has \"goalCompletionNumber\" <goalCompletionNumberValue>\r\n\t\tAnd a user with <userGoalProgress>\r\n\t\tWhen the user views the task card\r\n\t\tThen they see a repeat icon\r\n\t\tAnd the <text> in the bottom left hand corner\r\n\t\tAnd the <text> is green\r\n\t\tExamples:\r\n\t\t\t| goalCompletionNumber | userGoalProgress | text |\r\n\t\t\t| 1 | 0 | Completed 0 times |\r\n\t\t\t| 1 | 1 | Completed 1 times |\r\n\t\t\t| 1 | 2 | Completed 2 times |\r\n\t\t\t| 10 | 5 | Completed 0 times |\r\n\t\t\t| 10 | 12 | Completed 1 times |\r\n\t\t\t| 10 | 29 | Completed 2 times |\r\n\r\n\tScenario Outline: The source of a user's progress can be a custom field or a program goal\r\n\t\tGiven a Task Card is configured to have <progressSourcePath> progress source\r\n\t\tAnd a user\r\n\t\tWhen they view the Task card\r\n\t\tThen the value at <progressSourcePath> is used to benchmark their progress against the Goal Completion Count\r\n\t\tExamples:\r\n\t\t\t| value |\r\n\t\t\t| /customFields/activityCount |\r\n\t\t\t| /customFields/purchaseTotal |\r\n\t\t\t| /programGoals/count%2FComment-on-Article |\r\n\t\t\t| /programGoals/count/Referral-Started%2Freferrals |\r\n\r\n\tScenario Outline: The users completion of a goal is calculated by the Goal Completion Number\r\n\t\tGiven a Task Card is configured to have <goalValue>\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen they are shown to have <progressValue> towards <goalValue>\r\n\t\tWhen their progress grows larger than <goalValue>\r\n\t\tThen the task is marked as completed\r\n\t\tExamples:\r\n\t\t\t| goalValue | progressValue |\r\n\t\t\t| 1 | 0 |\r\n\t\t\t| 10 | 9 |\r\n\t\t\t| 5 | 2 |\r\n\r\n\tScenario: The Goal Completion Number defaults to 1\r\n\t\tGiven a Task Card without a configured \"goalCompletionNumber\"\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen it <mayBe> marked as completed\r\n\t\tExamples:\r\n\t\t\t| progressValue | mayBe |\r\n\t\t\t| 0 | isn't |\r\n\t\t\t| 1 | is |\r\n\t\t\t| 2 | is |";
|
|
21506
|
+
|
|
21507
|
+
const TaskCard_stories = {
|
|
21508
|
+
title: "Components/Task Card/",
|
|
21509
|
+
parameters: {
|
|
21510
|
+
scenario: scenario$5,
|
|
21511
|
+
},
|
|
19791
21512
|
};
|
|
19792
|
-
const
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
21513
|
+
const resizable = {
|
|
21514
|
+
width: "347px",
|
|
21515
|
+
minWidth: "347px",
|
|
21516
|
+
resize: "horizontal",
|
|
21517
|
+
height: "fit-content",
|
|
21518
|
+
overflow: "hidden",
|
|
19798
21519
|
};
|
|
19799
|
-
const
|
|
19800
|
-
|
|
21520
|
+
const NotRepeatable = () => {
|
|
21521
|
+
const oneAction = {
|
|
21522
|
+
rewardAmount: 20,
|
|
21523
|
+
showExpiry: false,
|
|
21524
|
+
rewardUnit: "Points",
|
|
21525
|
+
cardTitle: "Complete a survey",
|
|
21526
|
+
repeatable: false,
|
|
21527
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21528
|
+
buttonText: "Take survey",
|
|
21529
|
+
goal: 1,
|
|
21530
|
+
buttonLink: "https://example.com/",
|
|
21531
|
+
showProgressBar: false,
|
|
21532
|
+
loading: false,
|
|
21533
|
+
};
|
|
21534
|
+
const coupleActions = {
|
|
21535
|
+
rewardAmount: 40,
|
|
21536
|
+
rewardUnit: "Points",
|
|
21537
|
+
cardTitle: "Comment on 5 articles",
|
|
21538
|
+
showProgressBar: true,
|
|
21539
|
+
showExpiry: false,
|
|
21540
|
+
goal: 5,
|
|
21541
|
+
repeatable: false,
|
|
21542
|
+
steps: true,
|
|
21543
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21544
|
+
buttonText: "Start reading",
|
|
21545
|
+
buttonLink: "https://example.com/",
|
|
21546
|
+
loading: false,
|
|
21547
|
+
};
|
|
21548
|
+
const manyActions = {
|
|
21549
|
+
rewardAmount: 150,
|
|
21550
|
+
rewardUnit: "Points",
|
|
21551
|
+
cardTitle: "Spend $500 at our Store",
|
|
21552
|
+
showProgressBar: true,
|
|
21553
|
+
showExpiry: false,
|
|
21554
|
+
goal: 500,
|
|
21555
|
+
repeatable: false,
|
|
21556
|
+
progressBarUnit: "$",
|
|
21557
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21558
|
+
buttonText: "Visit our Store",
|
|
21559
|
+
buttonLink: "https://example.com/",
|
|
21560
|
+
loading: false,
|
|
21561
|
+
};
|
|
21562
|
+
return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21563
|
+
index.h("div", { style: resizable },
|
|
21564
|
+
index.h("h4", null, "One Action"),
|
|
21565
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21566
|
+
" ",
|
|
21567
|
+
index.h("h5", null),
|
|
21568
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21569
|
+
" ",
|
|
21570
|
+
index.h("h5", null)),
|
|
21571
|
+
index.h("div", { style: resizable },
|
|
21572
|
+
index.h("h4", null, "A Couple Actions"),
|
|
21573
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21574
|
+
" ",
|
|
21575
|
+
index.h("h5", null),
|
|
21576
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21577
|
+
" ",
|
|
21578
|
+
index.h("h5", null),
|
|
21579
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21580
|
+
" ",
|
|
21581
|
+
index.h("h5", null)),
|
|
21582
|
+
index.h("div", { style: resizable },
|
|
21583
|
+
index.h("h4", null, "Many Actions"),
|
|
21584
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21585
|
+
" ",
|
|
21586
|
+
index.h("h5", null),
|
|
21587
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21588
|
+
" ",
|
|
21589
|
+
index.h("h5", null),
|
|
21590
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21591
|
+
" ",
|
|
21592
|
+
index.h("h5", null))));
|
|
21593
|
+
};
|
|
21594
|
+
const NotRepeatableWithExpiry = () => {
|
|
21595
|
+
const oneAction = {
|
|
21596
|
+
rewardAmount: 20,
|
|
21597
|
+
rewardUnit: "Points",
|
|
21598
|
+
cardTitle: "Complete a survey",
|
|
21599
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21600
|
+
buttonText: "Take survey",
|
|
21601
|
+
goal: 1,
|
|
21602
|
+
showExpiry: true,
|
|
21603
|
+
repeatable: false,
|
|
21604
|
+
dateExpires: "Nov 1, 2021",
|
|
21605
|
+
buttonLink: "https://example.com/",
|
|
21606
|
+
showProgressBar: false,
|
|
21607
|
+
loading: false,
|
|
21608
|
+
};
|
|
21609
|
+
const coupleActions = {
|
|
21610
|
+
rewardAmount: 40,
|
|
21611
|
+
rewardUnit: "Points",
|
|
21612
|
+
cardTitle: "Comment on 5 articles",
|
|
21613
|
+
showProgressBar: true,
|
|
21614
|
+
goal: 5,
|
|
21615
|
+
steps: true,
|
|
21616
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21617
|
+
buttonText: "Start reading",
|
|
21618
|
+
showExpiry: true,
|
|
21619
|
+
repeatable: false,
|
|
21620
|
+
dateExpires: "Nov 1, 2021",
|
|
21621
|
+
buttonLink: "https://example.com/",
|
|
21622
|
+
loading: false,
|
|
21623
|
+
};
|
|
21624
|
+
const manyActions = {
|
|
21625
|
+
rewardAmount: 150,
|
|
21626
|
+
rewardUnit: "Points",
|
|
21627
|
+
repeatable: false,
|
|
21628
|
+
cardTitle: "Spend $500 at our Store",
|
|
21629
|
+
showProgressBar: true,
|
|
21630
|
+
goal: 500,
|
|
21631
|
+
progressBarUnit: "$",
|
|
21632
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21633
|
+
buttonText: "Visit our Store",
|
|
21634
|
+
showExpiry: true,
|
|
21635
|
+
dateExpires: "Nov 1, 2021",
|
|
21636
|
+
buttonLink: "https://example.com/",
|
|
21637
|
+
loading: false,
|
|
21638
|
+
};
|
|
21639
|
+
return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21640
|
+
index.h("div", { style: resizable },
|
|
21641
|
+
index.h("h4", null, "One Action"),
|
|
21642
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21643
|
+
" ",
|
|
21644
|
+
index.h("h5", null),
|
|
21645
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21646
|
+
" ",
|
|
21647
|
+
index.h("h5", null)),
|
|
21648
|
+
index.h("div", { style: resizable },
|
|
21649
|
+
index.h("h4", null, "A Couple Actions"),
|
|
21650
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21651
|
+
" ",
|
|
21652
|
+
index.h("h5", null),
|
|
21653
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21654
|
+
" ",
|
|
21655
|
+
index.h("h5", null),
|
|
21656
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21657
|
+
" ",
|
|
21658
|
+
index.h("h5", null)),
|
|
21659
|
+
index.h("div", { style: resizable },
|
|
21660
|
+
index.h("h4", null, "Many Actions"),
|
|
21661
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21662
|
+
" ",
|
|
21663
|
+
index.h("h5", null),
|
|
21664
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21665
|
+
" ",
|
|
21666
|
+
index.h("h5", null),
|
|
21667
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21668
|
+
" ",
|
|
21669
|
+
index.h("h5", null))));
|
|
21670
|
+
};
|
|
21671
|
+
const Repeatable = () => {
|
|
21672
|
+
const oneAction = {
|
|
21673
|
+
rewardAmount: 20,
|
|
21674
|
+
rewardUnit: "Points",
|
|
21675
|
+
showExpiry: false,
|
|
21676
|
+
cardTitle: "Complete a survey",
|
|
21677
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21678
|
+
buttonText: "Take survey",
|
|
21679
|
+
goal: 1,
|
|
21680
|
+
repeatable: true,
|
|
21681
|
+
buttonLink: "https://example.com/",
|
|
21682
|
+
showProgressBar: false,
|
|
21683
|
+
loading: false,
|
|
21684
|
+
};
|
|
21685
|
+
const coupleActions = {
|
|
21686
|
+
rewardAmount: 40,
|
|
21687
|
+
rewardUnit: "Points",
|
|
21688
|
+
showExpiry: false,
|
|
21689
|
+
cardTitle: "Comment on 5 articles",
|
|
21690
|
+
showProgressBar: true,
|
|
21691
|
+
repeatable: true,
|
|
21692
|
+
goal: 5,
|
|
21693
|
+
steps: true,
|
|
21694
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21695
|
+
buttonText: "Start reading",
|
|
21696
|
+
buttonLink: "https://example.com/",
|
|
21697
|
+
loading: false,
|
|
21698
|
+
};
|
|
21699
|
+
const manyActions = {
|
|
21700
|
+
rewardAmount: 150,
|
|
21701
|
+
rewardUnit: "Points",
|
|
21702
|
+
showExpiry: false,
|
|
21703
|
+
cardTitle: "Spend $500 at our Store",
|
|
21704
|
+
showProgressBar: true,
|
|
21705
|
+
repeatable: true,
|
|
21706
|
+
goal: 500,
|
|
21707
|
+
progressBarUnit: "$",
|
|
21708
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21709
|
+
buttonText: "Visit our Store",
|
|
21710
|
+
buttonLink: "https://example.com/",
|
|
21711
|
+
loading: false,
|
|
21712
|
+
};
|
|
21713
|
+
return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21714
|
+
index.h("div", { style: resizable },
|
|
21715
|
+
index.h("h4", null, "One Action"),
|
|
21716
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21717
|
+
" ",
|
|
21718
|
+
index.h("h5", null),
|
|
21719
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21720
|
+
" ",
|
|
21721
|
+
index.h("h5", null)),
|
|
21722
|
+
index.h("div", { style: resizable },
|
|
21723
|
+
index.h("h4", null, "A Couple Actions"),
|
|
21724
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21725
|
+
" ",
|
|
21726
|
+
index.h("h5", null),
|
|
21727
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21728
|
+
" ",
|
|
21729
|
+
index.h("h5", null),
|
|
21730
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21731
|
+
" ",
|
|
21732
|
+
index.h("h5", null),
|
|
21733
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21734
|
+
" ",
|
|
21735
|
+
index.h("h5", null)),
|
|
21736
|
+
index.h("div", { style: resizable },
|
|
21737
|
+
index.h("h4", null, "Many Actions"),
|
|
21738
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21739
|
+
" ",
|
|
21740
|
+
index.h("h5", null),
|
|
21741
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21742
|
+
" ",
|
|
21743
|
+
index.h("h5", null),
|
|
21744
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21745
|
+
" ",
|
|
21746
|
+
index.h("h5", null),
|
|
21747
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21748
|
+
" ",
|
|
21749
|
+
index.h("h5", null))));
|
|
21750
|
+
};
|
|
21751
|
+
const RepeatableWithExpiry = () => {
|
|
21752
|
+
const oneAction = {
|
|
21753
|
+
rewardAmount: 20,
|
|
21754
|
+
rewardUnit: "Points",
|
|
21755
|
+
cardTitle: "Complete a survey",
|
|
21756
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21757
|
+
buttonText: "Take survey",
|
|
21758
|
+
goal: 1,
|
|
21759
|
+
repeatable: true,
|
|
21760
|
+
showExpiry: true,
|
|
21761
|
+
dateExpires: "Nov 1, 2021",
|
|
21762
|
+
buttonLink: "https://example.com/",
|
|
21763
|
+
showProgressBar: false,
|
|
21764
|
+
loading: false,
|
|
21765
|
+
};
|
|
21766
|
+
const coupleActions = {
|
|
21767
|
+
rewardAmount: 40,
|
|
21768
|
+
rewardUnit: "Points",
|
|
21769
|
+
cardTitle: "Comment on 5 articles",
|
|
21770
|
+
showProgressBar: true,
|
|
21771
|
+
repeatable: true,
|
|
21772
|
+
goal: 5,
|
|
21773
|
+
steps: true,
|
|
21774
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21775
|
+
buttonText: "Start reading",
|
|
21776
|
+
showExpiry: true,
|
|
21777
|
+
dateExpires: "Nov 1, 2021",
|
|
21778
|
+
buttonLink: "https://example.com/",
|
|
21779
|
+
loading: false,
|
|
21780
|
+
};
|
|
21781
|
+
const manyActions = {
|
|
21782
|
+
rewardAmount: 150,
|
|
21783
|
+
rewardUnit: "Points",
|
|
21784
|
+
cardTitle: "Spend $500 at our Store",
|
|
21785
|
+
showProgressBar: true,
|
|
21786
|
+
repeatable: true,
|
|
21787
|
+
goal: 500,
|
|
21788
|
+
progressBarUnit: "$",
|
|
21789
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21790
|
+
buttonText: "Visit our Store",
|
|
21791
|
+
showExpiry: true,
|
|
21792
|
+
dateExpires: "Nov 1, 2021",
|
|
21793
|
+
buttonLink: "https://example.com/",
|
|
21794
|
+
loading: false,
|
|
21795
|
+
};
|
|
21796
|
+
return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21797
|
+
index.h("div", { style: resizable },
|
|
21798
|
+
index.h("h4", null, "One Action"),
|
|
21799
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21800
|
+
" ",
|
|
21801
|
+
index.h("h5", null),
|
|
21802
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21803
|
+
" ",
|
|
21804
|
+
index.h("h5", null)),
|
|
21805
|
+
index.h("div", { style: resizable },
|
|
21806
|
+
index.h("h4", null, "A Couple Actions"),
|
|
21807
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21808
|
+
" ",
|
|
21809
|
+
index.h("h5", null),
|
|
21810
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21811
|
+
" ",
|
|
21812
|
+
index.h("h5", null),
|
|
21813
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21814
|
+
" ",
|
|
21815
|
+
index.h("h5", null),
|
|
21816
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21817
|
+
" ",
|
|
21818
|
+
index.h("h5", null)),
|
|
21819
|
+
index.h("div", { style: resizable },
|
|
21820
|
+
index.h("h4", null, "Many Actions"),
|
|
21821
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21822
|
+
" ",
|
|
21823
|
+
index.h("h5", null),
|
|
21824
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21825
|
+
" ",
|
|
21826
|
+
index.h("h5", null),
|
|
21827
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21828
|
+
" ",
|
|
21829
|
+
index.h("h5", null),
|
|
21830
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21831
|
+
" ",
|
|
21832
|
+
index.h("h5", null))));
|
|
19801
21833
|
};
|
|
19802
21834
|
|
|
19803
|
-
const
|
|
21835
|
+
const TaskCard$1 = /*#__PURE__*/Object.freeze({
|
|
19804
21836
|
__proto__: null,
|
|
19805
|
-
'default':
|
|
19806
|
-
|
|
19807
|
-
|
|
21837
|
+
'default': TaskCard_stories,
|
|
21838
|
+
NotRepeatable: NotRepeatable,
|
|
21839
|
+
NotRepeatableWithExpiry: NotRepeatableWithExpiry,
|
|
21840
|
+
Repeatable: Repeatable,
|
|
21841
|
+
RepeatableWithExpiry: RepeatableWithExpiry
|
|
19808
21842
|
});
|
|
19809
21843
|
|
|
19810
|
-
|
|
19811
|
-
|
|
21844
|
+
/**
|
|
21845
|
+
* Displays a cartesian product of the input props
|
|
21846
|
+
*
|
|
21847
|
+
* @returns
|
|
21848
|
+
*/
|
|
21849
|
+
function MatrixStory({ matrix, props, Component, }) {
|
|
21850
|
+
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21851
|
+
const propValues = matrix[propKey];
|
|
21852
|
+
return propValues.map((val) => {
|
|
21853
|
+
return {
|
|
21854
|
+
[propKey]: val,
|
|
21855
|
+
};
|
|
21856
|
+
});
|
|
21857
|
+
});
|
|
21858
|
+
const combinations = cartesian(...propMatrix);
|
|
21859
|
+
const propsCombinations = combinations.map((combo) => {
|
|
21860
|
+
return combo.reduce((props, prop) => {
|
|
21861
|
+
return {
|
|
21862
|
+
...props,
|
|
21863
|
+
...prop,
|
|
21864
|
+
};
|
|
21865
|
+
}, {});
|
|
21866
|
+
});
|
|
21867
|
+
return propsCombinations.map((combo) => {
|
|
21868
|
+
const example = { ...props, ...combo };
|
|
21869
|
+
return (index.h("div", null,
|
|
21870
|
+
index.h(PropsTable, { values: example }),
|
|
21871
|
+
index.h("hr", null),
|
|
21872
|
+
index.h(Component, Object.assign({}, example))));
|
|
21873
|
+
});
|
|
21874
|
+
}
|
|
21875
|
+
function PropsTable({ values }) {
|
|
21876
|
+
return (index.h("table", null,
|
|
21877
|
+
index.h("tbody", null, Object.keys(values).map((key) => {
|
|
21878
|
+
return (index.h("tr", null,
|
|
21879
|
+
index.h("th", null, key),
|
|
21880
|
+
index.h("td", null, JSON.stringify(values[key]))));
|
|
21881
|
+
}))));
|
|
21882
|
+
}
|
|
21883
|
+
/**
|
|
21884
|
+
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21885
|
+
*
|
|
21886
|
+
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21887
|
+
*
|
|
21888
|
+
* @param args - an array of arrays
|
|
21889
|
+
* @returns combinations of the elements in those array
|
|
21890
|
+
*/
|
|
21891
|
+
function cartesian(...args) {
|
|
21892
|
+
var r = [], max = args.length - 1;
|
|
21893
|
+
function helper(arr, i) {
|
|
21894
|
+
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21895
|
+
var a = arr.slice(0); // clone arr
|
|
21896
|
+
a.push(args[i][j]);
|
|
21897
|
+
if (i == max)
|
|
21898
|
+
r.push(a);
|
|
21899
|
+
else
|
|
21900
|
+
helper(a, i + 1);
|
|
21901
|
+
}
|
|
21902
|
+
}
|
|
21903
|
+
helper([], 0);
|
|
21904
|
+
return r;
|
|
21905
|
+
}
|
|
21906
|
+
|
|
21907
|
+
const scenario$6 = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
|
|
21908
|
+
|
|
21909
|
+
const progressBar_stories = {
|
|
21910
|
+
title: "Components/Task Card Progress Bar",
|
|
21911
|
+
parameters: {
|
|
21912
|
+
scenario: scenario$6,
|
|
21913
|
+
},
|
|
19812
21914
|
};
|
|
19813
|
-
const
|
|
19814
|
-
return
|
|
19815
|
-
initValue: "",
|
|
19816
|
-
states: {
|
|
19817
|
-
enableValidation: true,
|
|
19818
|
-
validationErrors: {},
|
|
19819
|
-
content: {
|
|
19820
|
-
fieldLabel: "Password",
|
|
19821
|
-
},
|
|
19822
|
-
},
|
|
19823
|
-
} }));
|
|
21915
|
+
const Default$a = () => {
|
|
21916
|
+
return index.h(ProgressBarView, null);
|
|
19824
21917
|
};
|
|
19825
|
-
const
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19833
|
-
},
|
|
19834
|
-
},
|
|
19835
|
-
} }));
|
|
21918
|
+
const ProgressBar$1 = () => {
|
|
21919
|
+
const props = {
|
|
21920
|
+
progress: 0,
|
|
21921
|
+
goal: 500,
|
|
21922
|
+
progressBarUnit: "$",
|
|
21923
|
+
};
|
|
21924
|
+
return (index.h("div", null,
|
|
21925
|
+
index.h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
|
|
19836
21926
|
};
|
|
19837
|
-
const
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
21927
|
+
const ProgressBarSteps = () => {
|
|
21928
|
+
const props = {
|
|
21929
|
+
progress: 0,
|
|
21930
|
+
steps: true,
|
|
21931
|
+
goal: 5,
|
|
21932
|
+
progressBarUnit: "$",
|
|
21933
|
+
};
|
|
21934
|
+
return (index.h("div", null,
|
|
21935
|
+
index.h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
|
|
21936
|
+
};
|
|
21937
|
+
const ProgressBarRepeatable = () => {
|
|
21938
|
+
const props = {
|
|
21939
|
+
progress: 0,
|
|
21940
|
+
goal: 500,
|
|
21941
|
+
progressBarUnit: "$",
|
|
21942
|
+
repeatable: true,
|
|
21943
|
+
};
|
|
21944
|
+
return (index.h("div", null,
|
|
21945
|
+
index.h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
|
|
21946
|
+
};
|
|
21947
|
+
const ProgressBarStepsRepeatable = () => {
|
|
21948
|
+
const props = {
|
|
21949
|
+
progress: 0,
|
|
21950
|
+
steps: true,
|
|
21951
|
+
goal: 5,
|
|
21952
|
+
progressBarUnit: "$",
|
|
21953
|
+
repeatable: true,
|
|
21954
|
+
};
|
|
21955
|
+
return (index.h("div", null,
|
|
21956
|
+
index.h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
|
|
19848
21957
|
};
|
|
19849
21958
|
|
|
19850
|
-
const
|
|
21959
|
+
const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
|
|
19851
21960
|
__proto__: null,
|
|
19852
|
-
'default':
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
21961
|
+
'default': progressBar_stories,
|
|
21962
|
+
Default: Default$a,
|
|
21963
|
+
ProgressBar: ProgressBar$1,
|
|
21964
|
+
ProgressBarSteps: ProgressBarSteps,
|
|
21965
|
+
ProgressBarRepeatable: ProgressBarRepeatable,
|
|
21966
|
+
ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
|
|
19856
21967
|
});
|
|
19857
21968
|
|
|
19858
21969
|
const portalTemplate = "<sqm-portal-frame>\r\n <a slot=\"header\" href=\"/\">\r\n <sqm-text style=\"height: 60px\">\r\n <img\r\n style=\"height: 60px\"\r\n src=\"https://res.cloudinary.com/saasquatch/image/upload/v1634255445/squatch-assets/Copy_of_saasquatch-logo-tree-large-horizontal.png\"\r\n />\r\n </sqm-text>\r\n </a>\r\n <sqb-program-section program-id=\"referral-program\">\r\n <sqm-router>\r\n <template\r\n path=\"/:path(\\bregister\\b|\\bemailVerification\\b|\\blogin\\b|\\bverifyEmail\\b|\\bforgotPassword\\b|\\bresetPassword\\b|\\blogout\\b)\"\r\n >\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-hero\r\n background=\"https://images.unsplash.com/photo-1599676821464-3555954838dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1939&q=80\"\r\n >\r\n <sqm-router>\r\n <template path=\"/register\">\r\n <sqm-portal-register>\r\n <sqm-name-fields slot=\"formData\"></sqm-name-fields>\r\n </sqm-portal-register>\r\n </template>\r\n\r\n <template path=\"/emailVerification\">\r\n <sqm-portal-protected-route\r\n redirect-to=\"/login\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-email-verification></sqm-portal-email-verification>\r\n </template>\r\n\r\n <template path=\"/login\">\r\n <sqm-portal-login></sqm-portal-login>\r\n </template>\r\n\r\n <template path=\"/verifyEmail\">\r\n <sqm-portal-verify-email></sqm-portal-verify-email>\r\n </template>\r\n\r\n <template path=\"/forgotPassword\">\r\n <sqm-portal-forgot-password\r\n email-label=\"Business Email\"\r\n ></sqm-portal-forgot-password>\r\n </template>\r\n\r\n <template path=\"/resetPassword\">\r\n <sqm-portal-reset-password\r\n confirm-password=\"true\"\r\n ></sqm-portal-reset-password>\r\n </template>\r\n <template path=\"/logout\">\r\n <sqm-portal-logout next-page=\"/login\"></sqm-portal-logout>\r\n </template>\r\n </sqm-router>\r\n </sqm-hero>\r\n </sqm-graphql-client-provider>\r\n </template>\r\n </sqm-router>\r\n <sqm-router>\r\n <template path=\"/:path(\\bactivity\\b|\\beditProfile\\b)?\">\r\n <sqm-divided-layout\r\n direction=\"row\"\r\n style=\"\r\n border-top: 1px solid #eaeaea;\r\n border-bottom: 1px solid #eaeaea;\r\n \"\r\n >\r\n <sqm-navigation-sidebar>\r\n <sqm-navigation-sidebar-item\r\n path=\"/\"\r\n icon=\"house\"\r\n label=\"Dashboard\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/activity\"\r\n icon=\"bar-chart\"\r\n label=\"Activity\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/editProfile\"\r\n icon=\"person\"\r\n label=\"Edit Profile\"\r\n ></sqm-navigation-sidebar-item>\r\n <sqm-navigation-sidebar-item\r\n path=\"/logout\"\r\n icon=\"box-arrow-right\"\r\n label=\"Logout\"\r\n ></sqm-navigation-sidebar-item>\r\n </sqm-navigation-sidebar>\r\n <sqm-divided-layout direction=\"column\">\r\n <sqm-router>\r\n <template path=\"/\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqb-widget\r\n widget-type=\"p/referral-program/w/referrerWidget\"\r\n track-loads=\"true\"\r\n ></sqb-widget>\r\n </template>\r\n <template path=\"/editProfile\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-portal-profile></sqm-portal-profile> </sqm-portal-container\r\n ><sqm-portal-container direction=\"column\" gap=\"xxx-large\">\r\n <sqm-graphql-client-provider\r\n domain=\"https://managed-identity.saasquatch.com\"\r\n >\r\n <sqm-portal-change-password></sqm-portal-change-password>\r\n </sqm-graphql-client-provider>\r\n </sqm-portal-container>\r\n </template>\r\n\r\n <template path=\"/activity\">\r\n <sqm-portal-protected-route\r\n require-email-verification=\"true\"\r\n redirect-to=\"/login\"\r\n redirect-to-unverified=\"/emailVerification\"\r\n ></sqm-portal-protected-route>\r\n <sqm-portal-container\r\n direction=\"column\"\r\n padding=\"xxx-large\"\r\n gap=\"xxx-large\"\r\n >\r\n <sqm-text> <h1>Activity</h1></sqm-text>\r\n <sqm-stat-container space=\"xxxx-large\"\r\n ><sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/referralsCount\"\r\n ><sqm-text><p>Referrals</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardsCountFiltered/AVAILABLE\"\r\n ><sqm-text><p>Rewards Earned</p></sqm-text></sqm-big-stat\r\n >\r\n <sqm-big-stat\r\n flex-reverse=\"true\"\r\n alignment=\"left\"\r\n stat-type=\"/rewardBalance/CREDIT/CENTS\"\r\n ><sqm-text><p>Reward Balance</p></sqm-text></sqm-big-stat\r\n >\r\n </sqm-stat-container>\r\n <sqm-referral-table>\r\n <sqm-referral-table-user-column></sqm-referral-table-user-column>\r\n <sqm-referral-table-rewards-column></sqm-referral-table-rewards-column>\r\n <sqm-referral-table-status-column></sqm-referral-table-status-column>\r\n <sqm-referral-table-date-column\r\n column-title=\"Referred\"\r\n date-shown=\"dateReferralStarted\"\r\n ></sqm-referral-table-date-column> </sqm-referral-table\r\n ></sqm-portal-container>\r\n </template>\r\n </sqm-router>\r\n </sqm-divided-layout>\r\n </sqm-divided-layout>\r\n </template>\r\n </sqm-router>\r\n </sqb-program-section>\r\n <sqm-portal-footer\r\n slot=\"footer\"\r\n support-email=\"support@example.com\"\r\n terms-link=\"https://example.com\"\r\n faq-link=\"https://example.com\"\r\n terms-text=\"Terms And Conditions\"\r\n faq-text=\"FAQ\"\r\n show-powered-by=\"true\"\r\n ></sqm-portal-footer>\r\n</sqm-portal-frame>\r\n";
|
|
@@ -22867,7 +24978,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
|
|
|
22867
24978
|
|
|
22868
24979
|
const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Request Password Reset\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-forgot-password --> sqm-form-message\r\n style sqm-portal-forgot-password fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
22869
24980
|
|
|
22870
|
-
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\r\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; };
|
|
24981
|
+
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\r\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; }; refs?: { formRef: any; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\r\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\r\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\r\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n- [sqm-password-field](../sqm-password-field)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-register --> sqm-form-message\r\n sqm-portal-register --> sqm-password-field\r\n sqm-stencilbook --> sqm-portal-register\r\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
22871
24982
|
|
|
22872
24983
|
const EditProfileReadme = "# sqm-portal-profile\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------ | --------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\r\n| `countrytext` | `countrytext` | | `string` | `\"Country\"` |\r\n| `demoData` | -- | | `{ states?: { success: boolean; loading: boolean; submitDisabled: boolean; showCountry: boolean; formState: { country: string; firstName: string; lastName: string; errors: any; error: string; }; user: { id: string; accountId: string; firstName: string; lastName: string; email: string; countryCode: string; }; text: { firstnametext: string; lastnametext: string; emailtext: string; countrytext: string; editProfileHeader: string; editProfileSubHeader: string; submitChangeButtonText: string; }; }; }` | `undefined` |\r\n| `editProfileHeader` | `edit-profile-header` | | `string` | `\"Edit your profile\"` |\r\n| `editProfileSubHeader` | `edit-profile-sub-header` | | `string` | `\"Personal Information\"` |\r\n| `emailtext` | `emailtext` | | `string` | `\"Email\"` |\r\n| `firstnametext` | `firstnametext` | | `string` | `\"First Name\"` |\r\n| `lastnametext` | `lastnametext` | | `string` | `\"Last Name\"` |\r\n| `showCountry` | `show-country` | | `boolean` | `true` |\r\n| `submitChangeButtonText` | `submit-change-button-text` | | `string` | `\"Submit Changes\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-profile --> sqm-form-message\r\n style sqm-portal-profile fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
22873
24984
|
|
|
@@ -22875,7 +24986,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
|
|
|
22875
24986
|
|
|
22876
24987
|
const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
22877
24988
|
|
|
22878
|
-
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24989
|
+
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-verify-email --> sqm-form-message\r\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
22879
24990
|
|
|
22880
24991
|
const PortalTemplates_stories = {
|
|
22881
24992
|
title: "Templates / Portal",
|
|
@@ -23073,7 +25184,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
|
|
|
23073
25184
|
const PoweredByImg_stories = {
|
|
23074
25185
|
title: "Powered By",
|
|
23075
25186
|
};
|
|
23076
|
-
const Default$
|
|
25187
|
+
const Default$b = () => {
|
|
23077
25188
|
return index.h(sqmPortalFooterView.PoweredByImg, null);
|
|
23078
25189
|
};
|
|
23079
25190
|
const CustomColor = () => {
|
|
@@ -23086,17 +25197,17 @@ const CustomWidthAndHeight = () => {
|
|
|
23086
25197
|
const PoweredByImg = /*#__PURE__*/Object.freeze({
|
|
23087
25198
|
__proto__: null,
|
|
23088
25199
|
'default': PoweredByImg_stories,
|
|
23089
|
-
Default: Default$
|
|
25200
|
+
Default: Default$b,
|
|
23090
25201
|
CustomColor: CustomColor,
|
|
23091
25202
|
CustomWidthAndHeight: CustomWidthAndHeight
|
|
23092
25203
|
});
|
|
23093
25204
|
|
|
23094
|
-
const scenario$
|
|
25205
|
+
const scenario$7 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
|
|
23095
25206
|
|
|
23096
25207
|
const PortalFooter_stories = {
|
|
23097
25208
|
title: "Portal Footer",
|
|
23098
25209
|
parameters: {
|
|
23099
|
-
scenario: scenario$
|
|
25210
|
+
scenario: scenario$7,
|
|
23100
25211
|
},
|
|
23101
25212
|
};
|
|
23102
25213
|
const defaultProps$9 = {
|
|
@@ -23125,12 +25236,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
|
|
|
23125
25236
|
FooterNoPoweredBy: FooterNoPoweredBy
|
|
23126
25237
|
});
|
|
23127
25238
|
|
|
23128
|
-
const scenario$
|
|
25239
|
+
const scenario$8 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
|
|
23129
25240
|
|
|
23130
25241
|
const Hero_stories = {
|
|
23131
25242
|
title: "Hero Layout",
|
|
23132
25243
|
parameters: {
|
|
23133
|
-
scenario: scenario$
|
|
25244
|
+
scenario: scenario$8,
|
|
23134
25245
|
},
|
|
23135
25246
|
};
|
|
23136
25247
|
const LoginOneColumn = () => {
|
|
@@ -23307,12 +25418,12 @@ const Hero = /*#__PURE__*/Object.freeze({
|
|
|
23307
25418
|
TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
|
|
23308
25419
|
});
|
|
23309
25420
|
|
|
23310
|
-
const scenario$
|
|
25421
|
+
const scenario$9 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
|
|
23311
25422
|
|
|
23312
25423
|
const ReferralIframe_stories = {
|
|
23313
25424
|
title: "Referral Iframe",
|
|
23314
25425
|
parameters: {
|
|
23315
|
-
scenario: scenario$
|
|
25426
|
+
scenario: scenario$9,
|
|
23316
25427
|
},
|
|
23317
25428
|
};
|
|
23318
25429
|
const props = {
|
|
@@ -23343,12 +25454,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
|
|
|
23343
25454
|
ReferralIframeError: ReferralIframeError
|
|
23344
25455
|
});
|
|
23345
25456
|
|
|
23346
|
-
const scenario$
|
|
25457
|
+
const scenario$a = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
|
|
23347
25458
|
|
|
23348
25459
|
const NameFields_stories = {
|
|
23349
25460
|
title: "Name Fields",
|
|
23350
25461
|
parameters: {
|
|
23351
|
-
scenario: scenario$
|
|
25462
|
+
scenario: scenario$a,
|
|
23352
25463
|
},
|
|
23353
25464
|
};
|
|
23354
25465
|
const props$1 = {
|
|
@@ -23386,6 +25497,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
|
|
|
23386
25497
|
NameFieldsWithErrors: NameFieldsWithErrors
|
|
23387
25498
|
});
|
|
23388
25499
|
|
|
25500
|
+
const baseResponse = (data) => ({
|
|
25501
|
+
states: {
|
|
25502
|
+
content: null,
|
|
25503
|
+
redeemStage: "chooseReward",
|
|
25504
|
+
amount: 0,
|
|
25505
|
+
exchangeError: false,
|
|
25506
|
+
loading: false,
|
|
25507
|
+
selectedItem: null,
|
|
25508
|
+
selectedStep: null,
|
|
25509
|
+
},
|
|
25510
|
+
data: {
|
|
25511
|
+
exchangeList: data,
|
|
25512
|
+
},
|
|
25513
|
+
callbacks: {
|
|
25514
|
+
exchangeReward: null,
|
|
25515
|
+
openDrawer: null,
|
|
25516
|
+
setStage: null,
|
|
25517
|
+
setExchangeState: null,
|
|
25518
|
+
refs: null,
|
|
25519
|
+
},
|
|
25520
|
+
refs: null,
|
|
25521
|
+
});
|
|
25522
|
+
const baseReward$2 = {
|
|
25523
|
+
key: "",
|
|
25524
|
+
name: "",
|
|
25525
|
+
description: "",
|
|
25526
|
+
imageUrl: "",
|
|
25527
|
+
available: true,
|
|
25528
|
+
unavailableReason: null,
|
|
25529
|
+
unavailableReasonCode: null,
|
|
25530
|
+
ruleType: "FIXED_GLOBAL_REWARD",
|
|
25531
|
+
sourceUnit: "POINT",
|
|
25532
|
+
sourceValue: 10,
|
|
25533
|
+
prettySourceValue: "10 SaaSquatch Points",
|
|
25534
|
+
sourceMinValue: null,
|
|
25535
|
+
prettySourceMinValue: null,
|
|
25536
|
+
sourceMaxValue: null,
|
|
25537
|
+
prettySourceMaxValue: null,
|
|
25538
|
+
destinationMinValue: null,
|
|
25539
|
+
prettyDestinationMinValue: null,
|
|
25540
|
+
destinationMaxValue: null,
|
|
25541
|
+
prettyDestinationMaxValue: null,
|
|
25542
|
+
globalRewardKey: "",
|
|
25543
|
+
destinationUnit: null,
|
|
25544
|
+
steps: [],
|
|
25545
|
+
};
|
|
25546
|
+
const notEnoughPoints = {
|
|
25547
|
+
available: false,
|
|
25548
|
+
unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
|
|
25549
|
+
};
|
|
25550
|
+
const usTax = {
|
|
25551
|
+
available: false,
|
|
25552
|
+
unavailableReasonCode: "US_TAX",
|
|
25553
|
+
};
|
|
25554
|
+
const imageUrl = (props) => ({
|
|
25555
|
+
imageUrl: props,
|
|
25556
|
+
});
|
|
25557
|
+
const description = (props) => ({
|
|
25558
|
+
description: props,
|
|
25559
|
+
});
|
|
25560
|
+
const fixedValue = (props) => ({
|
|
25561
|
+
prettySourceValue: props,
|
|
25562
|
+
});
|
|
25563
|
+
const variableValue = (min, max, text) => ({
|
|
25564
|
+
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25565
|
+
sourceMinValue: min,
|
|
25566
|
+
prettySourceMinValue: min + " " + text,
|
|
25567
|
+
sourceMaxValue: max,
|
|
25568
|
+
prettySourceMaxValue: max + " " + text,
|
|
25569
|
+
});
|
|
25570
|
+
const test = {
|
|
25571
|
+
...baseResponse([
|
|
25572
|
+
{
|
|
25573
|
+
...baseReward$2,
|
|
25574
|
+
...description("Free swag with a promo code"),
|
|
25575
|
+
...imageUrl("https://i.imgur.com/Ds7M19I.png"),
|
|
25576
|
+
...fixedValue("40 SaaSquatch Points"),
|
|
25577
|
+
},
|
|
25578
|
+
{
|
|
25579
|
+
...baseReward$2,
|
|
25580
|
+
...description("Visa® Prepaid Card USD"),
|
|
25581
|
+
...imageUrl("https://i.imgur.com/4s3q2zz.png"),
|
|
25582
|
+
...variableValue(20, 80, "SaaSquatch Points"),
|
|
25583
|
+
},
|
|
25584
|
+
{
|
|
25585
|
+
...baseReward$2,
|
|
25586
|
+
...description("A very exclusive gift box"),
|
|
25587
|
+
...imageUrl("https://i.imgur.com/XuiJi4l.png"),
|
|
25588
|
+
...fixedValue("30 SaaSquatch Points"),
|
|
25589
|
+
},
|
|
25590
|
+
{
|
|
25591
|
+
...baseReward$2,
|
|
25592
|
+
...description("$50 Store credit"),
|
|
25593
|
+
...imageUrl("https://i.imgur.com/WkCMVSE.png"),
|
|
25594
|
+
...fixedValue("100 SaaSquatch Points"),
|
|
25595
|
+
},
|
|
25596
|
+
{
|
|
25597
|
+
...baseReward$2,
|
|
25598
|
+
...description("Variable amount of store credit"),
|
|
25599
|
+
...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
|
|
25600
|
+
...variableValue(20, 100, "SaaSquatch Points"),
|
|
25601
|
+
},
|
|
25602
|
+
{
|
|
25603
|
+
...baseReward$2,
|
|
25604
|
+
...notEnoughPoints,
|
|
25605
|
+
...description("A very rare cactus"),
|
|
25606
|
+
...imageUrl("https://i.imgur.com/CvCdpXc.png"),
|
|
25607
|
+
...fixedValue("2000 SaaSquatch Points"),
|
|
25608
|
+
},
|
|
25609
|
+
{
|
|
25610
|
+
...baseReward$2,
|
|
25611
|
+
...usTax,
|
|
25612
|
+
...description("$1000 Store credit"),
|
|
25613
|
+
...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
|
|
25614
|
+
...fixedValue("2000 SaaSquatch Points"),
|
|
25615
|
+
},
|
|
25616
|
+
{
|
|
25617
|
+
...baseReward$2,
|
|
25618
|
+
...notEnoughPoints,
|
|
25619
|
+
...description("A holiday gift box"),
|
|
25620
|
+
...imageUrl("https://i.imgur.com/HBJS1WH.png"),
|
|
25621
|
+
...fixedValue("100 SaaSquatch Points"),
|
|
25622
|
+
},
|
|
25623
|
+
]),
|
|
25624
|
+
};
|
|
25625
|
+
const test2 = {
|
|
25626
|
+
states: {
|
|
25627
|
+
content: {
|
|
25628
|
+
text: {
|
|
25629
|
+
buttonText: "Exchange Rewards",
|
|
25630
|
+
ignored: true,
|
|
25631
|
+
},
|
|
25632
|
+
},
|
|
25633
|
+
redeemStage: "chooseAmount",
|
|
25634
|
+
amount: 0,
|
|
25635
|
+
exchangeError: false,
|
|
25636
|
+
loading: false,
|
|
25637
|
+
selectedItem: {
|
|
25638
|
+
key: "r4",
|
|
25639
|
+
name: "Salmon Coins",
|
|
25640
|
+
description: "Points for Salmon Coins",
|
|
25641
|
+
imageUrl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUWFRgWFRYYGRgZGh4cHBocHR4aHxwdGRwZHBwfHh4cIS4lHB4rHxoYJjgnKy8xNTU1GiQ7QD00Py40NTEBDAwMEA8QHhISHzQrJCs0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NP/AABEIAIABiQMBIgACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABAECAwUGBwj/xAA+EAABAwICBgYHBwQCAwAAAAABAAIRAyEEMQUSQVFhcQYTgZGhsQciMkJScvAUYoKSwdHhorLC8SMzFUNj/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAfEQEBAQEBAQEAAwEBAAAAAAAAARECEiExE0FRYQP/2gAMAwEAAhEDEQA/APZkREBERAREQEREBERAREQEREBERAREQERY6jw0EkgACSTYADMk7AgvVjHgzBBixgzBXmfSjpqapNLDuLaeTqgs58Zhl/Vbx28BnA0Lj3UXNcx0G0tmxHwkW1tvLhks3qRZHryqtdonSjK7dZtnCzmzJaf1HFbFWXUERFQREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBFSVqdNafoYVoNaoAT7LBdzvlaLxxyG0oNlUqBoLnEAASSTAAFySTkF5H0z6WHEuNKiSKANx7JqkXl20MFoHfsAidKemVTFeo31KPwAgl0ZF7hY7IaLA39aBHNsIO0cv34eaCVSeBlcnblb/FqnYatxz3WLhw+FnHMrVMfx7/MjyCkMI5znx+Y7flCx1NajqNGaUdTIex2qRYRkRuj3h+y9D0Lp2nXETq1APWb5xv5ZjxXj9Ovt8dsdmXIHmVKw+OIg62rGWqQIINvWs1vZJWeZeVuV7gi5Xoj0j+0g03kGowSSMnNkCTYAOkjK17cOqXSXWBERUEREBERAREQEREBERAREQEREBERBRFjq1WtaXOcGtAkuJAAG8k2C5LS/TukyW0GGq74j6jO83PcAd6DslQFeI6Y6VYmvOvWcG/BS9RvIwZcODiV1vomonq69QWa57Wht82N1i6+ZIe0diD0JERAREQEREBERARFgxOJZTaX1HtY0ZucQAOZNkGdFxmkvSJg2SGa9Y5eo2G/mdEji2VzmO9JWIdalTp0xvcS93+IHcUHqyiYvH0qQmpUYwb3ua3+4rxTG9IsbV9vEVI3NPVjuZC1XUyST7RvfM85zQezYrptgGW68OO5jXP8AFojxWoxHpMw49ilVfxOowH+onwXmzcKdqudhrG0oOyr+k+qfYwzG/M9zvANatfX9ImOd7Ios5NJI/M4+S55lCQREFXvoaosJU0ScV0u0g+ZxL28GtYzxa2fFaKs173F73ue45uc4uceZcSStuyiI8+zmqfZNvDJNGlGGVww5W21BFh2eCubSMAxCmrjUCkruqK2v2dUNAxZTVazUdlJU7A6Rq0rs1J3vp06jvzPYXeKyCiQL5jzhUZhrXAngg2+H6c41lmmnx/42j+2FLZ6RcbtFA/gd+j1z4o8Fa2lJNoTTHV0/SVifeo0Ty1m+bipdL0nO9/DDm2p+hZ+q4p9A7B3rG7D7ldR6NR9JlA+1Qqj5Sx3m4KfR9IOCd7RqM+ZhP9msvKjQVr6B2Jo9oodLcC/LEsHzSz+8BbLDaRo1P+urTf8AK9rvIrwQUSrTSDtxummPohF4Dh8VXZ/11qrAPhe9o7gYUmp0kxzmln2mrB3EB35wNYd6uo9oxukqNETWqspg5a7mtnlJute3pbgSYGJp9pgd5svC6mHc5xcXFzjmXEknmTcqVo3Btc8Nq1RSZHt6jn8hqtuVLf8AFkfQVGs17Q5rg5pyIIIPIjNZFxnQgYXDsdTZjadUvdrBtqcWizC4mTtPALswVZUVREVBEWr0tpujh2k1HXiQwXc7k3ntMBBs1y+nOmFKjLaUVXjODDW/M7aeA3XIXHae6XVq8tE06RkBjbufwc7ad7R6oyOstA8SBrmBsYMvC7nclm0TdJ6Zq4l01Hl8GzR6rGn7rbxzu6+ajOpW9cwPhH6/RVGHdYcBJ7hYfVlewxlnvzPfkPBc63GsxNODkQBsi8cBGXYAvbui+jxQwtFgEHUDncXP9Z09pK8r6N4QV8XSY4Swv1nWMEMBeQTx1YjivbF1n4wIiKgiIgIoOkdJUaDdatUaxuzWMExsAzceAuuG016RjduFpz/9KgMfhYDPeRyQeh1KgaC5xAAuSTAA4k5LldJ9PsHSkNc6s7dTEt/OYaRyleZY/FVq/rYis525rnta0cmWaOwBR6VJvZs4q4mur0j6Q8U+RRYykN//AGO4GXANH5SuWxlWrWdr13ve7e8zHyjJo4CFIpU5dnEe7CzMpgkGO02gBTYIlHCNOWaq7CxnCmsLGky4H9O7MqSXMd7Jnz7Vf0a84Y7M1e3DAGTErOQcoVGAgXud6xeo1jC+iDsmLgHfCyNZa43LIAeCrqu4f6UvS4w06bRIBvtG76/VXhuYiwyWRtMzO+yv1Dv3qejEcuEScuSqy4BG0LK6mdpsVXqSs+lxHfRsdWATwVWstfwUjqztOfJWll4m5k5d6noxH1A4R5KoZsj+Fnbh4yt2BVFMzF8s7J6XGBzIyEo1ucgjmpXUcSqvpwJv5p6MRXU4KPZAsCeA4qUKMDWEmc8haMzKvFDinpMQxTtzWGphSQIMR4rZ9TxKtFDVMTmdt8k9JiA6lA9bZmVa2nrXGV4Wy6kn/SCieCejGt+z7xmqNw42dotmtmKBz3oaJ2Af7V0xrRQWB2GcTIIjzW2dhycx9cVUUjuWtRqeom8Kx1K4EEzt3dq2tXCuIgerfNXtoHIieJj9E1WndhQsuHxFWkJp1XsH3HOb4A3WxNI5kW7FjfhpvfMfUKWkS8J0xxzBPWB42B7GnxbB8Vs6HpHrCzsOxzvuuczwId5rROpDYIUX7MdbIRGe8/tmp7MbLSXS/F1zGv1TDbVpktJ5vnW7iBwWrNSZtebn6vzOfFVdRGcXG/gsRBDshzlX2YvNM5iBPvHyaNg4eG1YjTGwEnaTf67SFKaRffynyusVWmTcz2sJ7tdat2J/axur7zm8p1u5rLDvV9erAsCecADs/hVYHDIv7NRo8FHxTnfAT+L9LrEm1b+Oz9GGj9Z9XEOAloFNsTm71nk615jU/MV6UuX9HmC6vBMMQajnVD+Iw3+lrV1C7MiIiAuO9IHSKthWU20GEvqlw19XWDA3VyGRcS4RNrGxXYrnOk2lMTRNPqKTHtdOs5xIAgthoIyLpME2tkUHj+OOIc7rq7aznEj13tI5Aa1o3NFuCuwrdbWE6riLS3IjxFoyBXqjelDXtLK+FqesIcwalQXzBDi0kfhXKaVwNBjvUa4U3e44arqZ+66TLfEdsiejHLvwuIBa6wMga4aHsc0DIyQGk2sYNjvKtpawqOLWwwxbjAkwbiTPet7UoPp2JljvZeNvBw913gdig1KV5XK3LrUmzGLDTrtaTMmOU2/lS37ABbb/AAsOFoE1GQPeb5hSXsHblO1T18Xz9Ryxu5VwLTDzuj/L9JVXtUmizOMnF3c0GPM9y1OrSxjartiFiqAufVakUoP1hJEZrK6mSRBi97Z71cwZdir9d4WNXFdVXNEqx0ERvVW2Fgp6XyuLFY5h1gda0XEZ9queyYuREG31krnH+fruU9LimomoMz2LIFR0C5OXYI4p6MYxTOtMjVjLirnTcNF4tOXarmNMkmI2b+9Zm7Pr6/hPRjBTa7Ii+/YVke0xbPYs4CAJ6MYg3KyvaxXGYnM7BvVackXEHd2/68U9GMb6YIIOX6K3qwIHYJ+tyyUmOvr6udonLjO1XagsSMtvZCejGCjh2tsNu03klZQxYsSx9tRwF7yFlkNgE3yE7SrOk8mp9fXasLcOQ4nXJnJuwfWaz6xmIsRnbPkriP3VnR5Y9S/P/StbB+uav2fXFY2MDRAgBb1PK5zARBEqxrCTIJABiIF/4V7XAHNXdYO1X6mLKtEOBaQSCLqw4Yauq31Rsjv2rKao+vFKeHcSS1r3TsDSc+Q4KWUYxTsNvNW1mgA2mPFTv/H4g5Uan5CPNYq2isRBmg8j5Z8FPPRsatzgXECLfV9ywOpif45fXapr6DwdUtLTuIIPcVb1WrcxuG4fynMpsQyyPLb+gPkotRzQbhp5kDwICmVXjeQOYjucIBUWq8jcR94FvcW2K758xz36xlrfgj8MjwJUSs1v3B4f3BSw5o90s4tgjvb+yxYydWQ6RxA8wYWZ+rXqfo9x/WYNjSQTSJpmDsEFv9JA7CuqXlPotx5biKlLJr6etH3mERH4XOmNwXqy6siIiArHNBEG4KvRBp8XoNjrsJpncAHM7WnIfKWrVVKGKpWcwPZvpme9jr90rrEQcBUbQMyzVM3nWaAeAB1QeS1dbRjM2vjg6/iP2XpOJwTH+00ExEizo5i8cFrH9Gqcy2AeLWu8gFiytS44puHYy4cHOi0ZDZKgVMPORlegO0PUbZmpHzOb4AR4qK/RNfiB90yfF58li87+rOscTTwT5HqnmRAHG+alDDRyFu/+JK6N2BLTdpHF0yVKo4VgF4KvM35C2OKqtDZLnBvMxMhRnYpnuBzvlB8yt5pvo/TZrVWAu2lusZ7Jz5LRMqUzsaOcHzlZ65y/VnSprH4I+ZzR5lOsd8LOx7VIAaBIcR2D9WfqrqYJMes7dZpn8oXOyNzWClUJIBaR4/QUkMU+ngY4k5/sPFX/AGXZ9bFm81djWOaRECZsrw1T/syDDeaxjSG1nmq9XkpzMMq9QfBXE1DDFka3fkpXUHcqmgdmcJhqKykGiGgDkq6ql9QqUsKAIE773vxKmLqMGqrWKaMOrm4fbClVE1FaaUrYjDqvUKfVa80bz3KvUeS2LcNfKyzNw4GasqfGpOFJtcRe23f2LL9iO7gtoQR7LHu+Vrj5BafFaRfJaPVjOxkcxs7V2541z66g/CATrEfsoVUMBzJ2WvdYMRUnN2tO0u1e45FYX1CPasD8Q1f62+qe0Ld5iemdzm7bc7HslZcO9jXAlrXfdfrDuDSCe2QorfxAb7Fve2W94UzDwLWjgBHhY9wUsw/XUaG0i1zmsZh2NnMtgQNp9n9V1C0fR3AajNciC4WERDc9m+3gt4u/O59crm/FURFpEfE4Zjxqva1w3ET3blz2keh9N96bi0/C712nhJ9bvJ5LqUQeTaX6P1qMl7SGj32+s3tOwcHRwXPPBbmNXc5t2nmNy95IXM6W6H0Ksup/8Tz8Ilp5sy7oWbB5WwbQPxM/Vv8AEJUo6wkAO4tMH9j2Qttpbo5Xw51ns9Uf+xhJb2mJbycAOK1vWA3zO8eq79ncslj7rSnRrGNw+Mo1HEta18O1rQ14LHE2yAdO3Je7r54xFyYMjcQAe79oXsvQfSn2jCUy6demOrfOZLAIPa3VPMncuusujREQEREBERAREQEREFpaCIN1FqaPpu92OVvJTEQaitoVpye4c4P7LWV+i0/A7iRB7wupRZvMqy2OHf0OvIZB3tcP8lJo6EcwWYRvPtE9sldeiniL6rlRgnDNju4qx2F4fWxdakJeIeq5A0An2ZdaWDcO5WdQz4W9wWP4v+r7rlxhQs1LBt2roDhGfC3uT7Iz4fNanGJ6rmK1WgDAlxytsO6+SjPxLB7rwOQPkV02J0PRqTrNgxGsLOHbt5GQua0hoavSksHWM+7JcObMxzaT8oTrn5+Lz1/qjcVSPvgfN6v91ipjKQNxF1znXcOBvEcJH6iVJ0bpHq3TAc33mOEC+4gEA5XcvPLNyt38+N6KKuZQnIE8gt9hyxzQ5oaQdwH1KkQuv8Mv9se655mCecmHtt5rMNFvPwt8fJbtFqf+PKe61bNED3nk8gB5ypFLR7GmYk/eMxyGSmItTjmfkS21VRcXgqdQRUY10ZEi45HMHkpSLaOS0l0Qa6TRcWnc4m/4oJI+YOXLYvRVagfWa5g+JsBp5gkscTwIPBeqqhErN5laleTUmkH2Rzb/AMZ7Wmx71v8AQOB6yqJ9lvrOnbGw75MeK6itoOg6/VgH7stHcLHuUjBYFlIEMETcnMlSc1fXxMREW2BERAREQEREBc3pbodha8nV6t596nDZ5tjVPOJ4rpEQeU6U9H+Ibem5lYbB7Du5xj+rsW89HuiMThzVFZmoxwbAJBlwJuIOUE35dncopn1dVREVQREQEREBERAREQEREBERAREQEREBERAREQEREGuxuiqNW72An4hLXfmbBjhktFi+h+2nV5B4y/EyI7l1qLN5l/VlsaDo9oytQLmvc0sI2OJOtaDBYItO07Fv0RWTJhbqqIiqCIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z",
|
|
25642
|
+
available: true,
|
|
25643
|
+
unavailableReason: null,
|
|
25644
|
+
unavailableReasonCode: null,
|
|
25645
|
+
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25646
|
+
sourceUnit: "POINT",
|
|
25647
|
+
sourceValue: null,
|
|
25648
|
+
prettySourceValue: null,
|
|
25649
|
+
sourceMinValue: 1,
|
|
25650
|
+
prettySourceMinValue: "1 Point",
|
|
25651
|
+
sourceMaxValue: 100,
|
|
25652
|
+
prettySourceMaxValue: "100 Points",
|
|
25653
|
+
destinationMinValue: 1,
|
|
25654
|
+
prettyDestinationMinValue: "1 Salmon Coin",
|
|
25655
|
+
destinationMaxValue: 100,
|
|
25656
|
+
prettyDestinationMaxValue: "100 Salmons",
|
|
25657
|
+
globalRewardKey: null,
|
|
25658
|
+
destinationUnit: "TESTUNIT",
|
|
25659
|
+
steps: [
|
|
25660
|
+
{
|
|
25661
|
+
sourceValue: 1,
|
|
25662
|
+
prettySourceValue: "1 Point",
|
|
25663
|
+
destinationValue: 1,
|
|
25664
|
+
prettyDestinationValue: "1 Salmon Coin",
|
|
25665
|
+
available: true,
|
|
25666
|
+
unavailableReasonCode: null,
|
|
25667
|
+
},
|
|
25668
|
+
{
|
|
25669
|
+
sourceValue: 2,
|
|
25670
|
+
prettySourceValue: "2 Points",
|
|
25671
|
+
destinationValue: 2,
|
|
25672
|
+
prettyDestinationValue: "2 Salmons",
|
|
25673
|
+
available: true,
|
|
25674
|
+
unavailableReasonCode: null,
|
|
25675
|
+
},
|
|
25676
|
+
{
|
|
25677
|
+
sourceValue: 3,
|
|
25678
|
+
prettySourceValue: "3 Points",
|
|
25679
|
+
destinationValue: 3,
|
|
25680
|
+
prettyDestinationValue: "3 Salmons",
|
|
25681
|
+
available: true,
|
|
25682
|
+
unavailableReasonCode: null,
|
|
25683
|
+
},
|
|
25684
|
+
{
|
|
25685
|
+
sourceValue: 4,
|
|
25686
|
+
prettySourceValue: "4 Points",
|
|
25687
|
+
destinationValue: 4,
|
|
25688
|
+
prettyDestinationValue: "4 Salmons",
|
|
25689
|
+
available: true,
|
|
25690
|
+
unavailableReasonCode: null,
|
|
25691
|
+
},
|
|
25692
|
+
{
|
|
25693
|
+
sourceValue: 5,
|
|
25694
|
+
prettySourceValue: "5 Points",
|
|
25695
|
+
destinationValue: 5,
|
|
25696
|
+
prettyDestinationValue: "5 Salmons",
|
|
25697
|
+
available: true,
|
|
25698
|
+
unavailableReasonCode: null,
|
|
25699
|
+
},
|
|
25700
|
+
],
|
|
25701
|
+
},
|
|
25702
|
+
selectedStep: null,
|
|
25703
|
+
},
|
|
25704
|
+
data: {
|
|
25705
|
+
exchangeList: null,
|
|
25706
|
+
},
|
|
25707
|
+
callbacks: {
|
|
25708
|
+
exchangeReward: null,
|
|
25709
|
+
openDrawer: null,
|
|
25710
|
+
setStage: null,
|
|
25711
|
+
setExchangeState: null,
|
|
25712
|
+
refs: {
|
|
25713
|
+
drawerRef: {},
|
|
25714
|
+
},
|
|
25715
|
+
},
|
|
25716
|
+
refs: null,
|
|
25717
|
+
};
|
|
25718
|
+
|
|
25719
|
+
const RewardExchangeList_stories = {
|
|
25720
|
+
title: "Components/Reward Exchange List",
|
|
25721
|
+
};
|
|
25722
|
+
const resizable$1 = {
|
|
25723
|
+
width: "683px",
|
|
25724
|
+
minWidth: "260px",
|
|
25725
|
+
resize: "horizontal",
|
|
25726
|
+
height: "fit-content",
|
|
25727
|
+
overflow: "hidden",
|
|
25728
|
+
};
|
|
25729
|
+
const Default$c = () => {
|
|
25730
|
+
return (index.h("div", { style: resizable$1 },
|
|
25731
|
+
index.h(RewardExchangeView, Object.assign({}, test))));
|
|
25732
|
+
};
|
|
25733
|
+
const Default2 = () => {
|
|
25734
|
+
return (index.h("div", { style: { ...resizable$1, height: "700px" } },
|
|
25735
|
+
index.h(RewardExchangeView, Object.assign({}, test2))));
|
|
25736
|
+
};
|
|
25737
|
+
|
|
25738
|
+
const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
25739
|
+
__proto__: null,
|
|
25740
|
+
'default': RewardExchangeList_stories,
|
|
25741
|
+
Default: Default$c,
|
|
25742
|
+
Default2: Default2
|
|
25743
|
+
});
|
|
25744
|
+
|
|
23389
25745
|
function deepFreeze(obj) {
|
|
23390
25746
|
if (obj instanceof Map) {
|
|
23391
25747
|
obj.clear = obj.delete = obj.set = function () {
|
|
@@ -25966,7 +28322,9 @@ const CucumberAddon = ({ story }, children) => {
|
|
|
25966
28322
|
// No scenario or invalid. Ignoring.
|
|
25967
28323
|
}
|
|
25968
28324
|
return (index.h("div", null,
|
|
25969
|
-
|
|
28325
|
+
index.h("details", null,
|
|
28326
|
+
index.h("summary", null, "Specs"),
|
|
28327
|
+
result && index.h("pre", { innerHTML: result.value })),
|
|
25970
28328
|
children));
|
|
25971
28329
|
};
|
|
25972
28330
|
|
|
@@ -26003,6 +28361,8 @@ const stories = [
|
|
|
26003
28361
|
ReferralTableRewardsCell$1,
|
|
26004
28362
|
UserName,
|
|
26005
28363
|
PasswordField,
|
|
28364
|
+
TaskCard$1,
|
|
28365
|
+
TaskCardProgressBar,
|
|
26006
28366
|
PortalTemplates,
|
|
26007
28367
|
ProgramMenu$1,
|
|
26008
28368
|
PoweredByImg,
|
|
@@ -26010,6 +28370,10 @@ const stories = [
|
|
|
26010
28370
|
Hero,
|
|
26011
28371
|
ReferralIframe$1,
|
|
26012
28372
|
NameFields$1,
|
|
28373
|
+
RewardExchangeList,
|
|
28374
|
+
UseRewardExchangeList,
|
|
28375
|
+
UseTaskCard,
|
|
28376
|
+
UseRewardsTable
|
|
26013
28377
|
];
|
|
26014
28378
|
const StencilStorybook = class {
|
|
26015
28379
|
constructor(hostRef) {
|
|
@@ -26049,6 +28413,77 @@ const TableRow = class {
|
|
|
26049
28413
|
}
|
|
26050
28414
|
};
|
|
26051
28415
|
|
|
28416
|
+
const TaskCard$2 = class {
|
|
28417
|
+
constructor(hostRef) {
|
|
28418
|
+
index.registerInstance(this, hostRef);
|
|
28419
|
+
this.ignored = true;
|
|
28420
|
+
/**
|
|
28421
|
+
* @uiName Reward Amount
|
|
28422
|
+
*/
|
|
28423
|
+
this.rewardAmount = 0;
|
|
28424
|
+
/**
|
|
28425
|
+
* @uiName Reward Unit
|
|
28426
|
+
*/
|
|
28427
|
+
this.rewardUnit = "Points";
|
|
28428
|
+
/**
|
|
28429
|
+
* @uiName Title Text
|
|
28430
|
+
*/
|
|
28431
|
+
this.cardTitle = "Title Text";
|
|
28432
|
+
/**
|
|
28433
|
+
* @uiName Description Text
|
|
28434
|
+
*/
|
|
28435
|
+
this.description = "Description Text";
|
|
28436
|
+
/**
|
|
28437
|
+
* @uiName Goal Repeatable
|
|
28438
|
+
*/
|
|
28439
|
+
this.repeatable = false;
|
|
28440
|
+
/**
|
|
28441
|
+
* @uiName Show Progress Bar
|
|
28442
|
+
*/
|
|
28443
|
+
this.showProgressBar = false;
|
|
28444
|
+
/**
|
|
28445
|
+
* @uiName Goal Progress Source
|
|
28446
|
+
*/
|
|
28447
|
+
this.progressSource = "";
|
|
28448
|
+
/**
|
|
28449
|
+
* @uiName Goal Completion Number
|
|
28450
|
+
*/
|
|
28451
|
+
this.goal = 1;
|
|
28452
|
+
/**
|
|
28453
|
+
* @uiName Progress Bar Steps
|
|
28454
|
+
*/
|
|
28455
|
+
this.steps = false;
|
|
28456
|
+
/**
|
|
28457
|
+
* @uiName Show Goal Expiry
|
|
28458
|
+
*/
|
|
28459
|
+
this.showExpiry = false;
|
|
28460
|
+
/**
|
|
28461
|
+
* @uiName CTA Button Text
|
|
28462
|
+
*/
|
|
28463
|
+
this.buttonText = "Complete Action";
|
|
28464
|
+
/**
|
|
28465
|
+
* @uiName CTA Button Link
|
|
28466
|
+
*/
|
|
28467
|
+
this.buttonLink = "https://example.com/";
|
|
28468
|
+
/**
|
|
28469
|
+
* Select what type of stat to display for the goal. Manual paths are also supported.
|
|
28470
|
+
*
|
|
28471
|
+
* @uiWidget StatTypeSelectWidget
|
|
28472
|
+
* @uiName Stat Type
|
|
28473
|
+
* @uiOptions {"version": 1.1}
|
|
28474
|
+
*/
|
|
28475
|
+
this.statType = "/programGoals/count/Referral-Started%2Freferrals";
|
|
28476
|
+
_extends.h$1(this);
|
|
28477
|
+
}
|
|
28478
|
+
disconnectedCallback() { }
|
|
28479
|
+
render() {
|
|
28480
|
+
const { props } = index_module.j() ? useDemoBigStat.useDemoBigStat(this) : useDemoBigStat.useBigStat(this);
|
|
28481
|
+
const { value, statvalue } = props;
|
|
28482
|
+
console.log(props, index_module.j());
|
|
28483
|
+
return (index.h(TaskCardView, Object.assign({}, utils.getProps(this), { progress: value, loading: value === undefined })));
|
|
28484
|
+
}
|
|
28485
|
+
};
|
|
28486
|
+
|
|
26052
28487
|
const debug$2 = _extends.browser("sq:global");
|
|
26053
28488
|
const textStyles = `
|
|
26054
28489
|
sqm-text {
|
|
@@ -26192,11 +28627,15 @@ exports.sqm_referral_table_date_cell = ReferralTableDateCell;
|
|
|
26192
28627
|
exports.sqm_referral_table_rewards_cell = ReferralTableRewardsCell;
|
|
26193
28628
|
exports.sqm_referral_table_status_cell = ReferralTableStatusCell;
|
|
26194
28629
|
exports.sqm_referral_table_user_cell = ReferralTableUserCell;
|
|
28630
|
+
exports.sqm_reward_exchange_list = SqmRewardExchangeList;
|
|
28631
|
+
exports.sqm_rewards_table = RewardsTable;
|
|
28632
|
+
exports.sqm_rewards_table_column = RewardsTableColumn;
|
|
26195
28633
|
exports.sqm_router = SqmRouter;
|
|
26196
28634
|
exports.sqm_share_button = ShareButton;
|
|
26197
28635
|
exports.sqm_share_link = ShareLink;
|
|
26198
28636
|
exports.sqm_stencilbook = StencilStorybook;
|
|
26199
28637
|
exports.sqm_table_cell = TableCell$1;
|
|
26200
28638
|
exports.sqm_table_row = TableRow;
|
|
28639
|
+
exports.sqm_task_card = TaskCard$2;
|
|
26201
28640
|
exports.sqm_text = Text;
|
|
26202
28641
|
exports.sqm_user_name = UserName$1;
|