@saasquatch/mint-components 1.3.1-7 → 1.3.2-11
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-b021dc8c.js → ShadowViewAddon-a85b8c8d.js} +1 -1
- package/dist/cjs/{global-5610b310.js → global-6223fe8f.js} +282 -70
- package/dist/cjs/{index.module-03ce03c2.js → index.module-7dd4b981.js} +3 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mint-components.cjs.js +3 -3
- package/dist/cjs/{re-render-b5efae5f.js → re-render-6111d4bd.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} +2629 -165
- package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-leaderboard-rank-view-c287ac06.js → sqm-leaderboard-rank-view-7dd44d62.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-153503f0.js → sqm-navigation-sidebar-item-view-6c7f78e6.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-1d8728f9.js → sqm-portal-email-verification-view-08d1848c.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-portal-footer-view-dc4b0667.js → sqm-portal-footer-view-69c73802.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-a7519f19.js → sqm-portal-profile-view-14b41436.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-d7bd93f2.js → useDemoBigStat-2786227e.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 +61 -0
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +309 -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-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 +390 -0
- package/dist/collection/{stories → components/sqm-user-name}/UserName.stories.js +3 -3
- package/dist/collection/global/styles.js +281 -69
- package/dist/collection/global/styles.ts +281 -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-2e3ea31f.js → ShadowViewAddon-a3f510db.js} +1 -1
- package/dist/esm/{global-cc82aa03.js → global-90da933f.js} +282 -70
- package/dist/esm/{index.module-33c313d2.js → index.module-90d2c3ad.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/{re-render-338d931e.js → re-render-e06f2f7f.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} +2627 -167
- package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm/{sqm-leaderboard-rank-view-4f48da0c.js → sqm-leaderboard-rank-view-47844836.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-5dfa535f.js → sqm-navigation-sidebar-item-view-f2304ad9.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-87bf8191.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
- package/dist/esm/{sqm-portal-footer-view-da135cff.js → sqm-portal-footer-view-d9fe0bf8.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-8781176c.js → sqm-portal-profile-view-b67467b4.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-bb14d844.js → useDemoBigStat-c3b955b7.js} +119 -22
- package/dist/esm-es5/{ShadowViewAddon-2e3ea31f.js → ShadowViewAddon-a3f510db.js} +1 -1
- package/dist/esm-es5/{global-cc82aa03.js → global-90da933f.js} +2 -2
- package/dist/esm-es5/{index.module-33c313d2.js → index.module-90d2c3ad.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-338d931e.js → re-render-e06f2f7f.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-4f48da0c.js → sqm-leaderboard-rank-view-47844836.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-5dfa535f.js → sqm-navigation-sidebar-item-view-f2304ad9.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-87bf8191.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-footer-view-da135cff.js → sqm-portal-footer-view-d9fe0bf8.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-8781176c.js → sqm-portal-profile-view-b67467b4.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-c3b955b7.js +1 -0
- package/dist/mint-components/assets/Reward-icon.png +0 -0
- package/dist/mint-components/global/styles.ts +281 -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-8e87084e.system.js → p-07c924fa.system.js} +1 -1
- package/dist/mint-components/{p-f02360c9.js → p-0eb3e89c.js} +1 -1
- package/dist/mint-components/p-160bd62f.entry.js +1 -0
- package/dist/mint-components/p-16f5a7cb.system.js +1 -0
- package/dist/mint-components/{p-086aaa1e.system.entry.js → p-1a09e4e1.system.entry.js} +1 -1
- package/dist/mint-components/p-1c8b0290.entry.js +1 -0
- package/dist/mint-components/{p-16d0ec52.system.entry.js → p-1dcdca58.system.entry.js} +1 -1
- package/dist/mint-components/p-20d41ab1.entry.js +1 -0
- package/dist/mint-components/{p-36de7c74.entry.js → p-221a4097.entry.js} +1 -1
- package/dist/mint-components/{p-ff3c9d53.system.entry.js → p-223b42bd.system.entry.js} +1 -1
- package/dist/mint-components/{p-bbb3ff09.js → p-224504ad.js} +1 -1
- package/dist/mint-components/{p-7b7613cf.system.entry.js → p-24b3c6f0.system.entry.js} +1 -1
- package/dist/mint-components/{p-34dea514.system.entry.js → p-24c9a599.system.entry.js} +1 -1
- package/dist/mint-components/{p-156464b2.entry.js → p-29fab29b.entry.js} +1 -1
- package/dist/mint-components/{p-1369c11a.system.entry.js → p-304e6c82.system.entry.js} +1 -1
- package/dist/mint-components/{p-01722953.entry.js → p-3397167c.entry.js} +1 -1
- package/dist/mint-components/{p-c03c68c1.entry.js → p-33c5ffb7.entry.js} +1 -1
- package/dist/mint-components/{p-ead730e0.system.entry.js → p-396bf448.system.entry.js} +1 -1
- package/dist/mint-components/p-3b97aed8.system.js +1 -0
- package/dist/mint-components/{p-1996e9c8.system.js → p-3ce2fb83.system.js} +1 -1
- package/dist/mint-components/{p-c32fb8e5.entry.js → p-3d856985.entry.js} +1 -1
- package/dist/mint-components/{p-dd0b0a4a.system.entry.js → p-4052b948.system.entry.js} +1 -1
- package/dist/mint-components/{p-c434c33a.system.entry.js → p-412a9226.system.entry.js} +1 -1
- package/dist/mint-components/{p-21bb74aa.system.entry.js → p-44d0fc80.system.entry.js} +1 -1
- package/dist/mint-components/{p-a011c13c.entry.js → p-45c752a0.entry.js} +1 -1
- package/dist/mint-components/{p-b4fc47a0.js → p-46a4269a.js} +2 -2
- package/dist/mint-components/{p-e52c77cd.entry.js → p-52802c88.entry.js} +1 -1
- package/dist/mint-components/{p-5950e58a.entry.js → p-5480e4ee.entry.js} +1 -1
- package/dist/mint-components/{p-683a4971.system.entry.js → p-55508395.system.entry.js} +1 -1
- package/dist/mint-components/{p-48cdbd66.js → p-563253e8.js} +1 -1
- package/dist/mint-components/{p-4e61f958.system.js → p-60855d33.system.js} +1 -1
- package/dist/mint-components/{p-ff3d1ed1.system.entry.js → p-67ae18d1.system.entry.js} +1 -1
- package/dist/mint-components/{p-e83632dd.js → p-6882070c.js} +1 -1
- package/dist/mint-components/{p-2a6f038c.system.entry.js → p-69bcf4fa.system.entry.js} +1 -1
- package/dist/mint-components/{p-c35bb682.system.entry.js → p-6bf0a4d9.system.entry.js} +1 -1
- package/dist/mint-components/p-6e245fa3.system.entry.js +1 -0
- package/dist/mint-components/{p-f4a9712a.entry.js → p-723ebe45.entry.js} +2 -2
- package/dist/mint-components/{p-e2fc8abf.system.entry.js → p-73148868.system.entry.js} +1 -1
- package/dist/mint-components/{p-0f84ebfe.entry.js → p-8435a22d.entry.js} +1 -1
- package/dist/mint-components/p-883a32e7.entry.js +1 -0
- package/dist/mint-components/p-9c554ca0.system.js +1 -0
- package/dist/mint-components/{p-b1e03222.entry.js → p-9d6dbb2d.entry.js} +1 -1
- package/dist/mint-components/p-9e4fee30.system.entry.js +1 -0
- package/dist/mint-components/{p-4a313a31.js → p-a2c3cff3.js} +1 -1
- package/dist/mint-components/{p-c1cadf29.entry.js → p-a4c2c7ed.entry.js} +1 -1
- package/dist/mint-components/{p-c43f3b6b.system.js → p-a6094ff9.system.js} +1 -1
- package/dist/mint-components/{p-b3e976e0.entry.js → p-ade44a4e.entry.js} +1 -1
- package/dist/mint-components/{p-8d65fef3.entry.js → p-b1bb07db.entry.js} +1 -1
- package/dist/mint-components/p-b47179b8.system.entry.js +1 -0
- package/dist/mint-components/{p-754060c8.system.js → p-b608f7a4.system.js} +2 -2
- package/dist/mint-components/{p-2bfc61a5.entry.js → p-b8bd2607.entry.js} +1 -1
- package/dist/mint-components/{p-775529b9.system.entry.js → p-be2738b0.system.entry.js} +1 -1
- package/dist/mint-components/p-c6114bfe.system.js +1 -0
- package/dist/mint-components/{p-713ea21e.system.entry.js → p-c79c608d.system.entry.js} +1 -1
- package/dist/mint-components/{p-7c3a270c.system.entry.js → p-cca9026f.system.entry.js} +1 -1
- package/dist/mint-components/p-cd410a05.entry.js +9 -0
- package/dist/mint-components/p-cdeae699.system.js +1 -0
- package/dist/mint-components/{p-772341ce.system.entry.js → p-d174d0bc.system.entry.js} +1 -1
- package/dist/mint-components/{p-83bdbf25.js → p-d21e0dbd.js} +1 -1
- package/dist/mint-components/p-d2e71fe0.entry.js +335 -0
- package/dist/mint-components/{p-846cebe7.js → p-d35b0366.js} +1 -1
- package/dist/mint-components/{p-4843c461.js → p-db2e4c42.js} +1 -1
- package/dist/mint-components/{p-2ad23b02.system.entry.js → p-dc603d08.system.entry.js} +1 -1
- package/dist/mint-components/{p-871ed4c8.system.js → p-e7f633b9.system.js} +1 -1
- package/dist/mint-components/p-f17050de.entry.js +1 -0
- package/dist/mint-components/p-f90486ca.js +235 -0
- package/dist/mint-components/p-fce1dbf6.entry.js +1 -0
- 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 +75 -0
- package/dist/types/components/sqm-user-name/UserName.stories.d.ts +6 -0
- package/dist/types/components.d.ts +273 -10
- package/dist/types/global/android.d.ts +7 -0
- package/dist/types/global/demo.d.ts +1 -0
- package/dist/types/global/styles.d.ts +1 -1
- package/dist/types/stories/features.d.ts +4 -0
- package/dist/types/stories/templates.d.ts +4 -0
- 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 +1 -1
- package/dist/esm-es5/sqm-divided-layout_26.entry.js +0 -1
- package/dist/esm-es5/useDemoBigStat-bb14d844.js +0 -1
- package/dist/mint-components/p-1a2eadd1.entry.js +0 -1
- package/dist/mint-components/p-33b57b39.system.entry.js +0 -1
- package/dist/mint-components/p-38fbdc3a.js +0 -227
- package/dist/mint-components/p-4cabd25b.entry.js +0 -1
- package/dist/mint-components/p-6b21186a.entry.js +0 -230
- package/dist/mint-components/p-7129015b.system.js +0 -1
- package/dist/mint-components/p-8cbc24b8.entry.js +0 -9
- package/dist/mint-components/p-b462e84e.system.js +0 -1
- package/dist/mint-components/p-bd67990b.system.entry.js +0 -1
- package/dist/mint-components/p-cff66d2e.entry.js +0 -1
- package/dist/mint-components/p-d1604020.system.js +0 -1
- package/dist/mint-components/p-d482d10c.entry.js +0 -1
- package/dist/mint-components/p-d8a80855.entry.js +0 -1
- package/dist/mint-components/p-e282d07b.system.entry.js +0 -1
- package/dist/mint-components/p-ee6f5a1c.system.js +0 -1
- package/dist/mint-components/p-fa20e730.entry.js +0 -1
- package/dist/mint-components/p-fb185ffd.system.js +0 -1
- package/dist/types/stories/UserName.stories.d.ts +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as Host } from './index-17b4da69.js';
|
|
1
|
+
import { h, r as registerInstance, c as Host, d as getAssetPath } from './index-17b4da69.js';
|
|
2
2
|
import { m as h$1, j as useState, e as useEffect, f as useRef, n as d$2, y as y$1, b as browser, u as useReducer, c as createCommonjsModule, a as commonjsGlobal, k as useMemo } from './extends-3a3f9fe2.js';
|
|
3
|
-
import { i as intl, a as insertCSS } from './global-
|
|
3
|
+
import { i as intl, a as insertCSS } from './global-90da933f.js';
|
|
4
4
|
import { u as useCallback } from './use-callback-b38a1523.js';
|
|
5
|
-
import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1 } from './index.module-
|
|
5
|
+
import { d as dist, T as T$1, e as en, b as be, j as j$1, Z as Ze, r as rn, D as De, q as qe, P as P$1, E as Ee, M as M$1, a as sn, c as an, x as x$1, f as D$1, L as L$1, N as Ne, A as A$1 } from './index.module-90d2c3ad.js';
|
|
6
6
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
7
7
|
import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
|
|
8
8
|
import { g as getProps, a as getMissingProps } from './utils-454405f5.js';
|
|
@@ -11,21 +11,21 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
|
|
|
11
11
|
import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
|
|
12
12
|
import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
|
|
13
13
|
import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
|
|
14
|
-
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-
|
|
15
|
-
import { u as useRerenderListener } from './re-render-
|
|
16
|
-
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-
|
|
14
|
+
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-47844836.js';
|
|
15
|
+
import { u as useRerenderListener, a as useRequestRerender } from './re-render-e06f2f7f.js';
|
|
16
|
+
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-c3b955b7.js';
|
|
17
17
|
import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
|
|
18
|
-
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-
|
|
18
|
+
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-a3f510db.js';
|
|
19
19
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
|
|
20
|
-
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-
|
|
20
|
+
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-f2304ad9.js';
|
|
21
21
|
import { S as StatContainerView } from './sqm-stat-container-view-4133feb6.js';
|
|
22
|
-
import { P as PortalProfileView } from './sqm-portal-profile-view-
|
|
22
|
+
import { P as PortalProfileView } from './sqm-portal-profile-view-b67467b4.js';
|
|
23
23
|
import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-e3a6a716.js';
|
|
24
|
-
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-
|
|
24
|
+
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-8cefe480.js';
|
|
25
25
|
import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
|
|
26
26
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
|
|
27
27
|
import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
|
|
28
|
-
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-
|
|
28
|
+
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-d9fe0bf8.js';
|
|
29
29
|
import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
|
|
30
30
|
import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
|
|
31
31
|
|
|
@@ -14745,6 +14745,951 @@ const ReferralTableUserCell = class {
|
|
|
14745
14745
|
}
|
|
14746
14746
|
};
|
|
14747
14747
|
|
|
14748
|
+
const GET_EXCHANGE_LIST = dist.gql `
|
|
14749
|
+
query getExchangeList {
|
|
14750
|
+
viewer {
|
|
14751
|
+
... on User {
|
|
14752
|
+
visibleRewardExchangeItems(limit: 20, offset: 0) {
|
|
14753
|
+
data {
|
|
14754
|
+
key
|
|
14755
|
+
name
|
|
14756
|
+
description
|
|
14757
|
+
imageUrl
|
|
14758
|
+
available
|
|
14759
|
+
unavailableReason
|
|
14760
|
+
unavailableReasonCode
|
|
14761
|
+
ruleType
|
|
14762
|
+
sourceUnit
|
|
14763
|
+
sourceValue
|
|
14764
|
+
prettySourceValue
|
|
14765
|
+
sourceMinValue
|
|
14766
|
+
prettySourceMinValue
|
|
14767
|
+
sourceMaxValue
|
|
14768
|
+
prettySourceMaxValue
|
|
14769
|
+
destinationMinValue
|
|
14770
|
+
prettyDestinationMinValue
|
|
14771
|
+
destinationMaxValue
|
|
14772
|
+
prettyDestinationMaxValue
|
|
14773
|
+
globalRewardKey
|
|
14774
|
+
destinationUnit
|
|
14775
|
+
steps {
|
|
14776
|
+
sourceValue
|
|
14777
|
+
prettySourceValue
|
|
14778
|
+
destinationValue
|
|
14779
|
+
prettyDestinationValue
|
|
14780
|
+
available
|
|
14781
|
+
unavailableReasonCode
|
|
14782
|
+
}
|
|
14783
|
+
}
|
|
14784
|
+
totalCount
|
|
14785
|
+
}
|
|
14786
|
+
}
|
|
14787
|
+
}
|
|
14788
|
+
}
|
|
14789
|
+
`;
|
|
14790
|
+
const EXCHANGE = dist.gql `
|
|
14791
|
+
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
14792
|
+
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
14793
|
+
reward {
|
|
14794
|
+
id
|
|
14795
|
+
fuelTankCode
|
|
14796
|
+
}
|
|
14797
|
+
}
|
|
14798
|
+
}
|
|
14799
|
+
`;
|
|
14800
|
+
function useRewardExchangeList(props) {
|
|
14801
|
+
var _a, _b, _c, _d;
|
|
14802
|
+
const drawerRef = useRef();
|
|
14803
|
+
const [exchangeState, setExchangeState] = useReducer((state, next) => ({
|
|
14804
|
+
...state,
|
|
14805
|
+
...next,
|
|
14806
|
+
}), {
|
|
14807
|
+
selectedItem: undefined,
|
|
14808
|
+
selectedStep: undefined,
|
|
14809
|
+
redeemStage: "chooseReward",
|
|
14810
|
+
amount: 0,
|
|
14811
|
+
exchangeError: false,
|
|
14812
|
+
});
|
|
14813
|
+
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
14814
|
+
const user = T$1();
|
|
14815
|
+
const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
|
|
14816
|
+
const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14817
|
+
useEffect(() => {
|
|
14818
|
+
var _a, _b;
|
|
14819
|
+
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) {
|
|
14820
|
+
setExchangeState({ redeemStage: "success" });
|
|
14821
|
+
}
|
|
14822
|
+
if (!!errors) {
|
|
14823
|
+
console.log("YEA");
|
|
14824
|
+
setExchangeState({ exchangeError: true });
|
|
14825
|
+
}
|
|
14826
|
+
}, [exchangeResponse, errors]);
|
|
14827
|
+
function openDrawer() {
|
|
14828
|
+
var _a;
|
|
14829
|
+
setExchangeState({ redeemStage: "chooseReward" });
|
|
14830
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
|
|
14831
|
+
}
|
|
14832
|
+
function exchangeReward() {
|
|
14833
|
+
if (!selectedItem)
|
|
14834
|
+
return;
|
|
14835
|
+
let exchangeVariables = {
|
|
14836
|
+
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
14837
|
+
userId: user.id,
|
|
14838
|
+
};
|
|
14839
|
+
switch (selectedItem.ruleType) {
|
|
14840
|
+
case "FIXED_GLOBAL_REWARD":
|
|
14841
|
+
exchangeVariables = {
|
|
14842
|
+
...exchangeVariables,
|
|
14843
|
+
redeemCreditInput: {
|
|
14844
|
+
amount: selectedItem.sourceValue,
|
|
14845
|
+
unit: selectedItem.sourceUnit,
|
|
14846
|
+
},
|
|
14847
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14848
|
+
};
|
|
14849
|
+
break;
|
|
14850
|
+
case "VARIABLE_GLOBAL_REWARD":
|
|
14851
|
+
exchangeVariables = {
|
|
14852
|
+
...exchangeVariables,
|
|
14853
|
+
redeemCreditInput: {
|
|
14854
|
+
amount: amount,
|
|
14855
|
+
unit: selectedItem.sourceUnit,
|
|
14856
|
+
},
|
|
14857
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14858
|
+
rewardInput: {
|
|
14859
|
+
valueInCents: selectedStep.destinationValue,
|
|
14860
|
+
},
|
|
14861
|
+
};
|
|
14862
|
+
break;
|
|
14863
|
+
case "VARIABLE_CREDIT_REWARD":
|
|
14864
|
+
exchangeVariables = {
|
|
14865
|
+
...exchangeVariables,
|
|
14866
|
+
redeemCreditInput: {
|
|
14867
|
+
amount: amount,
|
|
14868
|
+
unit: selectedItem.sourceUnit,
|
|
14869
|
+
},
|
|
14870
|
+
rewardInput: {
|
|
14871
|
+
type: "CREDIT",
|
|
14872
|
+
unit: selectedItem.destinationUnit,
|
|
14873
|
+
assignedCredit: selectedStep.destinationValue,
|
|
14874
|
+
},
|
|
14875
|
+
};
|
|
14876
|
+
break;
|
|
14877
|
+
default:
|
|
14878
|
+
exchangeVariables = {
|
|
14879
|
+
...exchangeVariables,
|
|
14880
|
+
redeemCreditInput: {
|
|
14881
|
+
amount: selectedItem.sourceValue,
|
|
14882
|
+
unit: selectedItem.sourceUnit,
|
|
14883
|
+
},
|
|
14884
|
+
globalRewardKey: selectedItem.globalRewardKey,
|
|
14885
|
+
};
|
|
14886
|
+
}
|
|
14887
|
+
exchange({ exchangeRewardInput: exchangeVariables });
|
|
14888
|
+
}
|
|
14889
|
+
const resetState = useCallback((e) => {
|
|
14890
|
+
var _a, _b;
|
|
14891
|
+
// selects also trigger an sl-hide event :(
|
|
14892
|
+
//@ts-ignore - componentId is not private here
|
|
14893
|
+
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))
|
|
14894
|
+
return;
|
|
14895
|
+
setExchangeState({
|
|
14896
|
+
amount: 0,
|
|
14897
|
+
selectedStep: undefined,
|
|
14898
|
+
selectedItem: undefined,
|
|
14899
|
+
exchangeError: false,
|
|
14900
|
+
});
|
|
14901
|
+
}, []);
|
|
14902
|
+
useEffect(() => {
|
|
14903
|
+
if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
|
|
14904
|
+
return;
|
|
14905
|
+
const drawer = drawerRef.current;
|
|
14906
|
+
// Clear input value when drawer is closed
|
|
14907
|
+
drawer.addEventListener("sl-hide", resetState);
|
|
14908
|
+
return () => {
|
|
14909
|
+
drawer.removeEventListener("sl-hide", resetState);
|
|
14910
|
+
};
|
|
14911
|
+
}, [drawerRef.current]);
|
|
14912
|
+
function setStage(stage) {
|
|
14913
|
+
setExchangeState({ redeemStage: stage });
|
|
14914
|
+
}
|
|
14915
|
+
return {
|
|
14916
|
+
states: {
|
|
14917
|
+
content: {
|
|
14918
|
+
text: props,
|
|
14919
|
+
},
|
|
14920
|
+
selectedItem,
|
|
14921
|
+
redeemStage,
|
|
14922
|
+
amount,
|
|
14923
|
+
selectedStep,
|
|
14924
|
+
exchangeError,
|
|
14925
|
+
loading,
|
|
14926
|
+
},
|
|
14927
|
+
data: {
|
|
14928
|
+
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,
|
|
14929
|
+
//@ts-ignore
|
|
14930
|
+
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,
|
|
14931
|
+
},
|
|
14932
|
+
callbacks: {
|
|
14933
|
+
exchangeReward,
|
|
14934
|
+
openDrawer,
|
|
14935
|
+
setExchangeState,
|
|
14936
|
+
setStage,
|
|
14937
|
+
},
|
|
14938
|
+
refs: {
|
|
14939
|
+
drawerRef,
|
|
14940
|
+
},
|
|
14941
|
+
};
|
|
14942
|
+
}
|
|
14943
|
+
|
|
14944
|
+
const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14945
|
+
h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
|
|
14946
|
+
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" })));
|
|
14947
|
+
const CheckMark = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
|
|
14948
|
+
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" })));
|
|
14949
|
+
|
|
14950
|
+
function Dot({ active, completed, incomplete, }) {
|
|
14951
|
+
return (h("div", { style: {
|
|
14952
|
+
flex: "0 0 0",
|
|
14953
|
+
content: "''",
|
|
14954
|
+
height: "4px",
|
|
14955
|
+
borderRadius: "4px",
|
|
14956
|
+
background: incomplete ? "#E5E5E5" : "#9E9E9E",
|
|
14957
|
+
position: "relative",
|
|
14958
|
+
bottom: "0",
|
|
14959
|
+
left: "0",
|
|
14960
|
+
display: "flex",
|
|
14961
|
+
justifyContent: "center",
|
|
14962
|
+
columnGap: "50px",
|
|
14963
|
+
marginRight: "-2px",
|
|
14964
|
+
boxSizing: "content-box",
|
|
14965
|
+
} },
|
|
14966
|
+
h("div", { style: {
|
|
14967
|
+
backgroundColor: completed ? "#9E9E9E" : "#FFF",
|
|
14968
|
+
border: active
|
|
14969
|
+
? "3px solid #9E9E9E"
|
|
14970
|
+
: incomplete
|
|
14971
|
+
? "3px solid #E5E5E5"
|
|
14972
|
+
: "3px solid #9E9E9E",
|
|
14973
|
+
borderRadius: "50%",
|
|
14974
|
+
width: "10px",
|
|
14975
|
+
height: "10px",
|
|
14976
|
+
margin: "-6px auto 0px",
|
|
14977
|
+
zIndex: "1",
|
|
14978
|
+
boxSizing: "content-box",
|
|
14979
|
+
} }, completed && (h("div", { style: { top: "-6px", position: "relative" } },
|
|
14980
|
+
h(CheckMark, null))))));
|
|
14981
|
+
}
|
|
14982
|
+
function ProgressLine({ incomplete = false, active = false }) {
|
|
14983
|
+
return (h("div", { style: {
|
|
14984
|
+
content: "''",
|
|
14985
|
+
flex: "0.5 0.5 0",
|
|
14986
|
+
height: "4px",
|
|
14987
|
+
borderRadius: "4px",
|
|
14988
|
+
background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
|
|
14989
|
+
position: "relative",
|
|
14990
|
+
bottom: "0",
|
|
14991
|
+
left: "0",
|
|
14992
|
+
display: "flex",
|
|
14993
|
+
justifyContent: "center",
|
|
14994
|
+
columnGap: "50px",
|
|
14995
|
+
marginRight: "-2px",
|
|
14996
|
+
boxSizing: "content-box",
|
|
14997
|
+
} }));
|
|
14998
|
+
}
|
|
14999
|
+
function Progress({ active, completed, incomplete }) {
|
|
15000
|
+
return [
|
|
15001
|
+
h(ProgressLine, { incomplete: incomplete }),
|
|
15002
|
+
h(Dot, { active: active, completed: completed, incomplete: incomplete }),
|
|
15003
|
+
h(ProgressLine, { incomplete: incomplete, active: active }),
|
|
15004
|
+
];
|
|
15005
|
+
}
|
|
15006
|
+
function ProgressBar({ stageCount, currentStage, }) {
|
|
15007
|
+
return (h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage })))));
|
|
15008
|
+
}
|
|
15009
|
+
|
|
15010
|
+
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
15011
|
+
const stageProgressList = {
|
|
15012
|
+
chooseReward: "Choose reward",
|
|
15013
|
+
chooseAmount: "Amount",
|
|
15014
|
+
confirmation: "Confirm",
|
|
15015
|
+
};
|
|
15016
|
+
function RewardExchangeView(props) {
|
|
15017
|
+
const style = {
|
|
15018
|
+
Container: {
|
|
15019
|
+
padding: "var(--sl-spacing-medium)",
|
|
15020
|
+
position: "relative",
|
|
15021
|
+
},
|
|
15022
|
+
CardContainer: {
|
|
15023
|
+
"&:active": {
|
|
15024
|
+
//boxShadow: "0 3px 10px #87ceeb6e!important",
|
|
15025
|
+
},
|
|
15026
|
+
},
|
|
15027
|
+
Base: {
|
|
15028
|
+
display: "flex",
|
|
15029
|
+
cursor: "pointer",
|
|
15030
|
+
textAlign: "center",
|
|
15031
|
+
height: "120px",
|
|
15032
|
+
"&::part(base)": {
|
|
15033
|
+
boxShadow: "none",
|
|
15034
|
+
width: "100%",
|
|
15035
|
+
// maxWidth: "350px",
|
|
15036
|
+
display: "flex",
|
|
15037
|
+
margin: "0 auto",
|
|
15038
|
+
},
|
|
15039
|
+
"&::part(body)": {
|
|
15040
|
+
padding: 0,
|
|
15041
|
+
display: "flex",
|
|
15042
|
+
width: "100%",
|
|
15043
|
+
},
|
|
15044
|
+
},
|
|
15045
|
+
Drawer: {
|
|
15046
|
+
"&::part(base)": {
|
|
15047
|
+
minWidth: "400px",
|
|
15048
|
+
maxWidth: "700px",
|
|
15049
|
+
width: "50%",
|
|
15050
|
+
margin: "0 auto",
|
|
15051
|
+
right: "0",
|
|
15052
|
+
},
|
|
15053
|
+
"&::part(panel)": {
|
|
15054
|
+
height: "85vh",
|
|
15055
|
+
width: "100%",
|
|
15056
|
+
},
|
|
15057
|
+
},
|
|
15058
|
+
FullImage: {
|
|
15059
|
+
objectFit: "contain",
|
|
15060
|
+
maxWidth: "100%",
|
|
15061
|
+
height: "100px",
|
|
15062
|
+
},
|
|
15063
|
+
PreviewImage: {
|
|
15064
|
+
objectFit: "contain",
|
|
15065
|
+
width: "120px",
|
|
15066
|
+
height: "120px",
|
|
15067
|
+
flex: 0.33,
|
|
15068
|
+
},
|
|
15069
|
+
InputBox: {
|
|
15070
|
+
width: "100%",
|
|
15071
|
+
marginBottom: "20px",
|
|
15072
|
+
},
|
|
15073
|
+
Select: {
|
|
15074
|
+
"&::part(base)": {
|
|
15075
|
+
flex: "0.75",
|
|
15076
|
+
},
|
|
15077
|
+
"&::part(menu)": {
|
|
15078
|
+
maxHeight: "40vh",
|
|
15079
|
+
},
|
|
15080
|
+
},
|
|
15081
|
+
Buttons: {
|
|
15082
|
+
marginLeft: "auto",
|
|
15083
|
+
width: "100%",
|
|
15084
|
+
maxWidth: "300px",
|
|
15085
|
+
},
|
|
15086
|
+
Button: {
|
|
15087
|
+
margin: "10px 0",
|
|
15088
|
+
display: "block",
|
|
15089
|
+
textAlign: "center",
|
|
15090
|
+
cursor: "pointer",
|
|
15091
|
+
},
|
|
15092
|
+
ProgressBar: {
|
|
15093
|
+
fontSize: "80%",
|
|
15094
|
+
marginBottom: "20px",
|
|
15095
|
+
"& .text-area": {
|
|
15096
|
+
marginTop: "5px",
|
|
15097
|
+
display: "flex",
|
|
15098
|
+
justifyContent: "center",
|
|
15099
|
+
textAlign: "center",
|
|
15100
|
+
whiteSpace: "nowrap",
|
|
15101
|
+
marginBottom: "6px",
|
|
15102
|
+
"& .text": {
|
|
15103
|
+
flex: "1 1 0",
|
|
15104
|
+
},
|
|
15105
|
+
"& .text.subdued": {
|
|
15106
|
+
color: "#BDBDBD",
|
|
15107
|
+
},
|
|
15108
|
+
},
|
|
15109
|
+
},
|
|
15110
|
+
KutayCard: {
|
|
15111
|
+
"&::part(base)": {
|
|
15112
|
+
boxShadow: "none",
|
|
15113
|
+
},
|
|
15114
|
+
},
|
|
15115
|
+
KutayButton: {
|
|
15116
|
+
display: "flex",
|
|
15117
|
+
flexWrap: "wrap",
|
|
15118
|
+
margin: "var(--sl-spacing-medium) 0",
|
|
15119
|
+
"& .cancel": {
|
|
15120
|
+
width: "150px",
|
|
15121
|
+
marginLeft: "auto",
|
|
15122
|
+
marginRight: "var(--sl-spacing-medium)",
|
|
15123
|
+
"&::part(base)": {
|
|
15124
|
+
fontWeight: "var(--sl-font-weight-normal)",
|
|
15125
|
+
color: "var(--sl-color-neutral-1000)",
|
|
15126
|
+
},
|
|
15127
|
+
},
|
|
15128
|
+
"& .continue": {
|
|
15129
|
+
width: "150px",
|
|
15130
|
+
"&::part(base)": {
|
|
15131
|
+
background: "var(--sl-color-neutral-500)",
|
|
15132
|
+
fontWeight: "var(--sl-font-weight-normal)",
|
|
15133
|
+
color: "var(--sl-color-neutral-0)",
|
|
15134
|
+
},
|
|
15135
|
+
},
|
|
15136
|
+
},
|
|
15137
|
+
};
|
|
15138
|
+
// JSS config
|
|
15139
|
+
jss.setup(create());
|
|
15140
|
+
const sheet = jss.createStyleSheet(style);
|
|
15141
|
+
const styleString = sheet.toString();
|
|
15142
|
+
const { states, data, callbacks, refs } = props;
|
|
15143
|
+
const { selectedItem, selectedStep } = states;
|
|
15144
|
+
function getInput() {
|
|
15145
|
+
var _a, _b;
|
|
15146
|
+
const item = states.selectedItem;
|
|
15147
|
+
if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
|
|
15148
|
+
return h("span", null);
|
|
15149
|
+
if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
15150
|
+
return h("p", null,
|
|
15151
|
+
"Not enough ",
|
|
15152
|
+
item.sourceUnit,
|
|
15153
|
+
" to redeem for this reward.");
|
|
15154
|
+
}
|
|
15155
|
+
return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
|
|
15156
|
+
var _a, _b, _c, _d, _e;
|
|
15157
|
+
return callbacks.setExchangeState({
|
|
15158
|
+
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,
|
|
15159
|
+
selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
|
|
15160
|
+
});
|
|
15161
|
+
} }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
|
|
15162
|
+
step.prettyDestinationValue,
|
|
15163
|
+
h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
|
|
15164
|
+
step.prettySourceValue,
|
|
15165
|
+
step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
|
|
15166
|
+
}
|
|
15167
|
+
function chooseReward() {
|
|
15168
|
+
var _a;
|
|
15169
|
+
const nextStage = "chooseAmount";
|
|
15170
|
+
// console.log({ nextStage, ruleType: selectedItem?.ruleType });
|
|
15171
|
+
return [
|
|
15172
|
+
h("div", { style: {
|
|
15173
|
+
display: "grid",
|
|
15174
|
+
justifyContent: "center",
|
|
15175
|
+
gap: "20px",
|
|
15176
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
15177
|
+
} }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
15178
|
+
const style = {
|
|
15179
|
+
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
|
|
15180
|
+
? "0 0 0 2px var(--sl-color-primary-500)"
|
|
15181
|
+
: "none",
|
|
15182
|
+
marginBottom: "10px 0",
|
|
15183
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
15184
|
+
flex: "1",
|
|
15185
|
+
minWidth: "100%",
|
|
15186
|
+
color: !item.available && "#eee",
|
|
15187
|
+
};
|
|
15188
|
+
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
15189
|
+
? item.prettySourceValue
|
|
15190
|
+
: `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
|
|
15191
|
+
return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
15192
|
+
h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
|
|
15193
|
+
callbacks.setExchangeState({ selectedItem: item }) },
|
|
15194
|
+
item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { style: {
|
|
15195
|
+
width: "18px",
|
|
15196
|
+
height: "18px",
|
|
15197
|
+
borderRadius: "50%",
|
|
15198
|
+
background: "var(--sl-color-primary-500)",
|
|
15199
|
+
position: "relative",
|
|
15200
|
+
margin: "-9px",
|
|
15201
|
+
left: "350px",
|
|
15202
|
+
} },
|
|
15203
|
+
h("div", { style: { position: "relative", top: "-6px" } },
|
|
15204
|
+
h(CheckMark, null)))),
|
|
15205
|
+
// item?.imageUrl &&
|
|
15206
|
+
h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
|
|
15207
|
+
h("p", { style: {
|
|
15208
|
+
textAlign: "left",
|
|
15209
|
+
margin: "0",
|
|
15210
|
+
flex: "1",
|
|
15211
|
+
fontSize: "90%",
|
|
15212
|
+
padding: "8px",
|
|
15213
|
+
} },
|
|
15214
|
+
h("b", null, item.description),
|
|
15215
|
+
h("p", { style: { margin: "0" } }, amount),
|
|
15216
|
+
item.unavailableReasonCode && (h("p", { style: {
|
|
15217
|
+
fontSize: "70%",
|
|
15218
|
+
color: "#F2994A",
|
|
15219
|
+
marginTop: "0",
|
|
15220
|
+
} }, item.unavailableReasonCode ===
|
|
15221
|
+
"INSUFFICIENT_REDEEMABLE_CREDIT"
|
|
15222
|
+
? "Not enough points"
|
|
15223
|
+
: item.unavailableReasonCode))))));
|
|
15224
|
+
})),
|
|
15225
|
+
h("div", { class: sheet.classes.KutayButton },
|
|
15226
|
+
h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage(nextStage), disabled: !states.selectedItem }, "Continue")),
|
|
15227
|
+
];
|
|
15228
|
+
}
|
|
15229
|
+
function chooseAmount() {
|
|
15230
|
+
const input = getInput();
|
|
15231
|
+
return (h("div", null,
|
|
15232
|
+
h("div", { style: { width: "50%", margin: "0 auto" } }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) && (h("img", { class: sheet.classes.FullImage, src: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl }))),
|
|
15233
|
+
h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
|
|
15234
|
+
h("div", { class: sheet.classes.InputBox }, input),
|
|
15235
|
+
h("div", { class: sheet.classes.KutayButton },
|
|
15236
|
+
h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.setStage("chooseReward") }, "Cancel"),
|
|
15237
|
+
h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: states.selectedItem.ruleType !== "FIXED_GLOBAL_REWARD" ||
|
|
15238
|
+
(input && !states.amount) }, "Continue to confirmation"))));
|
|
15239
|
+
}
|
|
15240
|
+
// console.log({ selectedItem, selectedStep });
|
|
15241
|
+
function confirmation() {
|
|
15242
|
+
const previousStage = "chooseAmount";
|
|
15243
|
+
return (h("div", null,
|
|
15244
|
+
h("h2", null, "Confirm and redeem"),
|
|
15245
|
+
h("div", { style: { textAlign: "center" } },
|
|
15246
|
+
h("p", null,
|
|
15247
|
+
h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
|
|
15248
|
+
h("p", null,
|
|
15249
|
+
h(ExchangeArrows, null)),
|
|
15250
|
+
h("div", { class: sheet.classes.CardContainer, style: {
|
|
15251
|
+
boxShadow: "none",
|
|
15252
|
+
marginBottom: "10px",
|
|
15253
|
+
flex: "1",
|
|
15254
|
+
minWidth: "100%",
|
|
15255
|
+
} },
|
|
15256
|
+
h("sl-card", { class: sheet.classes.Base },
|
|
15257
|
+
h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
15258
|
+
getAssetPath("./assets/Reward-icon.png") }),
|
|
15259
|
+
h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
|
|
15260
|
+
h("div", { class: sheet.classes.Buttons },
|
|
15261
|
+
h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
|
|
15262
|
+
h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15263
|
+
}
|
|
15264
|
+
function success() {
|
|
15265
|
+
return (h("div", { style: { textAlign: "center" } },
|
|
15266
|
+
h("img", { class: sheet.classes.FullImage, src: getAssetPath("./assets/Reward-icon.png") }),
|
|
15267
|
+
h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
|
|
15268
|
+
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)));
|
|
15269
|
+
}
|
|
15270
|
+
const stages = {
|
|
15271
|
+
chooseReward: () => chooseReward(),
|
|
15272
|
+
chooseAmount: () => chooseAmount(),
|
|
15273
|
+
confirmation: () => confirmation(),
|
|
15274
|
+
success: () => success(),
|
|
15275
|
+
};
|
|
15276
|
+
const currentStage = stages[states.redeemStage];
|
|
15277
|
+
function stageMap() {
|
|
15278
|
+
const stageNumber = stageList.indexOf(states.redeemStage);
|
|
15279
|
+
return (h("div", { class: sheet.classes.ProgressBar },
|
|
15280
|
+
h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
|
|
15281
|
+
if (stage === states.redeemStage) {
|
|
15282
|
+
return h("span", { class: "text" }, stageProgressList[stage]);
|
|
15283
|
+
}
|
|
15284
|
+
else {
|
|
15285
|
+
return (h("span", { class: "text subdued" }, stageProgressList[stage]));
|
|
15286
|
+
}
|
|
15287
|
+
})),
|
|
15288
|
+
h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
15289
|
+
}
|
|
15290
|
+
console.log(props);
|
|
15291
|
+
return (h("div", { class: sheet.classes.Container },
|
|
15292
|
+
h("style", { type: "text/css" }, styleString),
|
|
15293
|
+
h("div", null,
|
|
15294
|
+
stageMap(),
|
|
15295
|
+
currentStage && currentStage(),
|
|
15296
|
+
states.exchangeError &&
|
|
15297
|
+
"Something went wrong. Please contact support or try again.")));
|
|
15298
|
+
}
|
|
15299
|
+
|
|
15300
|
+
const SqmRewardExchangeList = class {
|
|
15301
|
+
constructor(hostRef) {
|
|
15302
|
+
registerInstance(this, hostRef);
|
|
15303
|
+
this.ignored = true;
|
|
15304
|
+
/**
|
|
15305
|
+
* @uiName Exchange button text
|
|
15306
|
+
*/
|
|
15307
|
+
this.buttonText = "Exchange Rewards";
|
|
15308
|
+
h$1(this);
|
|
15309
|
+
}
|
|
15310
|
+
disconnectedCallback() { }
|
|
15311
|
+
render() {
|
|
15312
|
+
// const missingProps = getMissingProps([
|
|
15313
|
+
// {
|
|
15314
|
+
// attribute: "listType",
|
|
15315
|
+
// value: this.listType,
|
|
15316
|
+
// },
|
|
15317
|
+
// ]);
|
|
15318
|
+
// if (missingProps) {
|
|
15319
|
+
// return <RequiredPropsError missingProps={missingProps} />;
|
|
15320
|
+
// }
|
|
15321
|
+
const { states, data, callbacks, refs } = j$1()
|
|
15322
|
+
? useRewardExchangeListDemo(getProps(this))
|
|
15323
|
+
: useRewardExchangeList(getProps(this));
|
|
15324
|
+
return (h(Host, { style: { display: "contents" } }, h(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
|
|
15325
|
+
}
|
|
15326
|
+
static get assetsDirs() { return ["assets"]; }
|
|
15327
|
+
};
|
|
15328
|
+
function useRewardExchangeListDemo(props) {
|
|
15329
|
+
return cjs({
|
|
15330
|
+
states: {
|
|
15331
|
+
content: {
|
|
15332
|
+
text: props,
|
|
15333
|
+
},
|
|
15334
|
+
redeemStage: "chooseReward",
|
|
15335
|
+
amount: 0,
|
|
15336
|
+
selectedStep: undefined,
|
|
15337
|
+
exchangeError: false,
|
|
15338
|
+
loading: false,
|
|
15339
|
+
},
|
|
15340
|
+
data: {
|
|
15341
|
+
shareCode: "SHARECODE123",
|
|
15342
|
+
},
|
|
15343
|
+
callbacks: {
|
|
15344
|
+
exchangeReward: () => { },
|
|
15345
|
+
openDrawer: () => { },
|
|
15346
|
+
setExchangeState: (_) => { },
|
|
15347
|
+
setStage: (_) => { },
|
|
15348
|
+
},
|
|
15349
|
+
refs: {
|
|
15350
|
+
drawerRef: {},
|
|
15351
|
+
},
|
|
15352
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15353
|
+
}
|
|
15354
|
+
|
|
15355
|
+
const style$7 = {
|
|
15356
|
+
THead: {
|
|
15357
|
+
padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
|
|
15358
|
+
"text-align": "left",
|
|
15359
|
+
},
|
|
15360
|
+
TCell: {
|
|
15361
|
+
padding: "var(--sl-spacing-small) var(--sl-spacing-medium) var(--sl-spacing-small) 0",
|
|
15362
|
+
},
|
|
15363
|
+
TRow: {
|
|
15364
|
+
"border-top": "1px solid #EAEAEA",
|
|
15365
|
+
},
|
|
15366
|
+
Table: {
|
|
15367
|
+
"border-collapse": "collapse",
|
|
15368
|
+
width: "100%",
|
|
15369
|
+
},
|
|
15370
|
+
ButtonContainer: {
|
|
15371
|
+
display: "flex",
|
|
15372
|
+
"justify-content": "flex-end",
|
|
15373
|
+
"margin-top": "var(--sl-spacing-small)",
|
|
15374
|
+
...gap({ direction: "row", size: "var(--sl-spacing-small)" }),
|
|
15375
|
+
},
|
|
15376
|
+
};
|
|
15377
|
+
jss.setup(create());
|
|
15378
|
+
const sheet$7 = jss.createStyleSheet(style$7);
|
|
15379
|
+
const styleString$7 = sheet$7.toString();
|
|
15380
|
+
function GenericTableView(props) {
|
|
15381
|
+
const { states, data, callbacks, elements } = props;
|
|
15382
|
+
const { columns, rows } = elements;
|
|
15383
|
+
const { show } = states;
|
|
15384
|
+
return (h("div", null,
|
|
15385
|
+
h("style", { type: "text/css" }, styleString$7),
|
|
15386
|
+
h("table", { class: sheet$7.classes.Table },
|
|
15387
|
+
data.textOverrides.showLabels && (h("thead", null,
|
|
15388
|
+
h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => (h("th", { class: sheet$7.classes.THead },
|
|
15389
|
+
h(TextSpanView, { type: "h3" }, column))))))),
|
|
15390
|
+
h("tbody", null,
|
|
15391
|
+
show === "loading" && elements.loadingElement,
|
|
15392
|
+
show === "empty" && elements.emptyElement,
|
|
15393
|
+
show === "rows" && (rows === null || rows === void 0 ? void 0 : rows.map((row, i) => (h("tr", { class: sheet$7.classes.TRow, style: {
|
|
15394
|
+
borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
|
|
15395
|
+
}, part: "table-row" }, row.map((cell) => (h("td", { class: sheet$7.classes.TCell },
|
|
15396
|
+
h(TextSpanView, { type: "p" }, cell)))))))))),
|
|
15397
|
+
h("div", { class: sheet$7.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
|
|
15398
|
+
h("sl-button", { size: "small", disabled: !states.hasPrev, loading: show === "loading", onClick: callbacks.prevPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.prevLabel),
|
|
15399
|
+
h("sl-button", { size: "small", loading: show === "loading", disabled: !states.hasNext, onClick: callbacks.nextPage, exportparts: "base: defaultbutton-base" }, data.textOverrides.moreLabel))));
|
|
15400
|
+
}
|
|
15401
|
+
|
|
15402
|
+
function LoadingSlot$1() {
|
|
15403
|
+
return (h("slot", { name: "loading" },
|
|
15404
|
+
h(LoadingSkeleton, null)));
|
|
15405
|
+
}
|
|
15406
|
+
function LoadingSkeleton() {
|
|
15407
|
+
return (h("div", { style: { width: "100%" } },
|
|
15408
|
+
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15409
|
+
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15410
|
+
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15411
|
+
h("sl-skeleton", { style: { marginBottom: "28px" } }),
|
|
15412
|
+
h("sl-skeleton", null)));
|
|
15413
|
+
}
|
|
15414
|
+
function EmptySlot$1({ label }) {
|
|
15415
|
+
return (h("slot", { name: "empty" },
|
|
15416
|
+
h(EmptySkeleton, { label: label })));
|
|
15417
|
+
}
|
|
15418
|
+
function EmptySkeleton({ label }) {
|
|
15419
|
+
return (h("div", { style: { width: "100%" } },
|
|
15420
|
+
h("sqm-text", null,
|
|
15421
|
+
h("h3", { style: { color: "#777777" } }, label))));
|
|
15422
|
+
}
|
|
15423
|
+
|
|
15424
|
+
const CSS_NAMESPACE = "sqm-rewards-table";
|
|
15425
|
+
const GET_REWARDS = gql `
|
|
15426
|
+
query getRewards(
|
|
15427
|
+
$limit: Int!
|
|
15428
|
+
$offset: Int!
|
|
15429
|
+
$rewardFilter: RewardFilterInput
|
|
15430
|
+
) {
|
|
15431
|
+
viewer {
|
|
15432
|
+
... on User {
|
|
15433
|
+
id
|
|
15434
|
+
rewards(limit: $limit, offset: $offset, filter: $rewardFilter) {
|
|
15435
|
+
totalCount
|
|
15436
|
+
count
|
|
15437
|
+
data {
|
|
15438
|
+
id
|
|
15439
|
+
type
|
|
15440
|
+
value
|
|
15441
|
+
unit
|
|
15442
|
+
name
|
|
15443
|
+
dateGiven
|
|
15444
|
+
dateExpires
|
|
15445
|
+
dateCancelled
|
|
15446
|
+
dateRedeemed
|
|
15447
|
+
dateScheduledFor
|
|
15448
|
+
fuelTankCode
|
|
15449
|
+
fuelTankType
|
|
15450
|
+
currency
|
|
15451
|
+
prettyValue
|
|
15452
|
+
statuses
|
|
15453
|
+
globalRewardKey
|
|
15454
|
+
programRewardKey
|
|
15455
|
+
rewardRedemptionTransactions {
|
|
15456
|
+
data {
|
|
15457
|
+
exchangedRewards {
|
|
15458
|
+
data {
|
|
15459
|
+
prettyValue
|
|
15460
|
+
type
|
|
15461
|
+
fuelTankCode
|
|
15462
|
+
globalRewardKey
|
|
15463
|
+
}
|
|
15464
|
+
}
|
|
15465
|
+
}
|
|
15466
|
+
}
|
|
15467
|
+
}
|
|
15468
|
+
}
|
|
15469
|
+
}
|
|
15470
|
+
}
|
|
15471
|
+
}
|
|
15472
|
+
`;
|
|
15473
|
+
function useRewardsTable(props, emptyElement, loadingElement) {
|
|
15474
|
+
var _a, _b;
|
|
15475
|
+
const user = T$1();
|
|
15476
|
+
const programIdContext = M$1();
|
|
15477
|
+
// Default to context, overriden by props
|
|
15478
|
+
const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
|
|
15479
|
+
const rewardFilter = {
|
|
15480
|
+
userId_eq: user === null || user === void 0 ? void 0 : user.id,
|
|
15481
|
+
accountId_eq: user === null || user === void 0 ? void 0 : user.accountId,
|
|
15482
|
+
// If no program ID, shows all programs
|
|
15483
|
+
...(programId
|
|
15484
|
+
? programId === "classic"
|
|
15485
|
+
? { programId_exists: false }
|
|
15486
|
+
: { programId_eq: programId }
|
|
15487
|
+
: {}),
|
|
15488
|
+
};
|
|
15489
|
+
const [content, setContent] = useReducer((state, next) => ({
|
|
15490
|
+
...state,
|
|
15491
|
+
...next,
|
|
15492
|
+
}), {
|
|
15493
|
+
columns: [],
|
|
15494
|
+
rows: [],
|
|
15495
|
+
loading: false,
|
|
15496
|
+
page: 0,
|
|
15497
|
+
});
|
|
15498
|
+
const { envelope: rewardsData, states, callbacks, } = 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; }, {
|
|
15499
|
+
limit: props.perPage,
|
|
15500
|
+
offset: 0,
|
|
15501
|
+
}, {
|
|
15502
|
+
rewardFilter,
|
|
15503
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
15504
|
+
const tick = useRerenderListener();
|
|
15505
|
+
const components = useChildElements();
|
|
15506
|
+
const data = rewardsData === null || rewardsData === void 0 ? void 0 : rewardsData.data;
|
|
15507
|
+
async function getComponentData(components) {
|
|
15508
|
+
// filter out loading and empty states from columns array
|
|
15509
|
+
const columnComponents = components.filter((component) => component.slot !== "loading" && component.slot !== "empty");
|
|
15510
|
+
// get the column titles (renderLabel is asynchronous)
|
|
15511
|
+
const columnsPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderLabel()));
|
|
15512
|
+
// get the column cells (renderCell is asynchronous)
|
|
15513
|
+
const cellsPromise = data === null || data === void 0 ? void 0 : data.map(async (r) => {
|
|
15514
|
+
const cellPromise = columnComponents === null || columnComponents === void 0 ? void 0 : columnComponents.map(async (c) => tryMethod$1(c, () => c.renderCell([r], c)));
|
|
15515
|
+
const cells = await Promise.all(cellPromise);
|
|
15516
|
+
return cells;
|
|
15517
|
+
});
|
|
15518
|
+
const rows = cellsPromise && (await Promise.all(cellsPromise)).filter((i) => i);
|
|
15519
|
+
setContent({ rows });
|
|
15520
|
+
const columns = columnsPromise && (await Promise.all(columnsPromise));
|
|
15521
|
+
// Set the content to render and finish loading components
|
|
15522
|
+
setContent({ columns, loading: false, page: states.currentPage });
|
|
15523
|
+
}
|
|
15524
|
+
useEffect(() => {
|
|
15525
|
+
setContent({ loading: true });
|
|
15526
|
+
rewardsData && getComponentData(components);
|
|
15527
|
+
}, [rewardsData, components, tick]);
|
|
15528
|
+
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);
|
|
15529
|
+
console.log(states.loading, content.loading, rewardsData);
|
|
15530
|
+
const show =
|
|
15531
|
+
// 1 - Loading if loading
|
|
15532
|
+
states.loading || content.loading
|
|
15533
|
+
? "loading"
|
|
15534
|
+
: // 2 - Empty if empty
|
|
15535
|
+
isEmpty
|
|
15536
|
+
? "empty"
|
|
15537
|
+
: // 3 - Then show rows
|
|
15538
|
+
"rows";
|
|
15539
|
+
return {
|
|
15540
|
+
states: {
|
|
15541
|
+
hasNext: states.currentPage < states.pageCount - 1,
|
|
15542
|
+
hasPrev: states.currentPage > 0,
|
|
15543
|
+
show,
|
|
15544
|
+
namespace: CSS_NAMESPACE,
|
|
15545
|
+
},
|
|
15546
|
+
data: {
|
|
15547
|
+
textOverrides: {
|
|
15548
|
+
showLabels: props.showLabels,
|
|
15549
|
+
prevLabel: props.prevLabel,
|
|
15550
|
+
moreLabel: props.moreLabel,
|
|
15551
|
+
},
|
|
15552
|
+
},
|
|
15553
|
+
elements: {
|
|
15554
|
+
columns: content.columns,
|
|
15555
|
+
rows: content.rows,
|
|
15556
|
+
emptyElement,
|
|
15557
|
+
loadingElement,
|
|
15558
|
+
},
|
|
15559
|
+
callbacks: {
|
|
15560
|
+
nextPage: () => {
|
|
15561
|
+
callbacks.setCurrentPage(states.currentPage + 1);
|
|
15562
|
+
},
|
|
15563
|
+
prevPage: () => {
|
|
15564
|
+
callbacks.setCurrentPage(states.currentPage - 1);
|
|
15565
|
+
},
|
|
15566
|
+
},
|
|
15567
|
+
};
|
|
15568
|
+
}
|
|
15569
|
+
function generateUserError$1(e) {
|
|
15570
|
+
try {
|
|
15571
|
+
return JSON.stringify(e);
|
|
15572
|
+
}
|
|
15573
|
+
catch (e) {
|
|
15574
|
+
return "An unknown error";
|
|
15575
|
+
}
|
|
15576
|
+
}
|
|
15577
|
+
async function tryMethod$1(c, callback) {
|
|
15578
|
+
const tag = c.tagName.toLowerCase();
|
|
15579
|
+
await customElements.whenDefined(tag);
|
|
15580
|
+
let labelPromise;
|
|
15581
|
+
try {
|
|
15582
|
+
labelPromise = callback();
|
|
15583
|
+
}
|
|
15584
|
+
catch (e) {
|
|
15585
|
+
// renderLabel did not return a promise, so this method probably doesn't exist
|
|
15586
|
+
// therefore, we IGNORE the label
|
|
15587
|
+
if (callback.name === "renderReferrerCell") {
|
|
15588
|
+
console.error("column does not have a renderReferrerCell method.");
|
|
15589
|
+
}
|
|
15590
|
+
else {
|
|
15591
|
+
console.error("label promise failed", e);
|
|
15592
|
+
}
|
|
15593
|
+
return h("span", null);
|
|
15594
|
+
}
|
|
15595
|
+
try {
|
|
15596
|
+
return await labelPromise;
|
|
15597
|
+
}
|
|
15598
|
+
catch (e) {
|
|
15599
|
+
// The column returned a promise, and that promise failed.
|
|
15600
|
+
// This should not happen so we fail fast
|
|
15601
|
+
console.error("Error rendering label", e);
|
|
15602
|
+
const userError = generateUserError$1(e);
|
|
15603
|
+
return (h("details", null,
|
|
15604
|
+
h("summary", null, "Error"),
|
|
15605
|
+
userError));
|
|
15606
|
+
}
|
|
15607
|
+
}
|
|
15608
|
+
|
|
15609
|
+
const RewardsTable = class {
|
|
15610
|
+
constructor(hostRef) {
|
|
15611
|
+
registerInstance(this, hostRef);
|
|
15612
|
+
/** @uiName Number of rewards per page */
|
|
15613
|
+
this.perPage = 3;
|
|
15614
|
+
/** @uiName Show column labels */
|
|
15615
|
+
this.showLabels = true;
|
|
15616
|
+
/** @uiName Previous button text */
|
|
15617
|
+
this.prevLabel = "Prev";
|
|
15618
|
+
/** @uiName View More button text */
|
|
15619
|
+
this.moreLabel = "Next";
|
|
15620
|
+
/** @uiName Show Referred by user in table */
|
|
15621
|
+
this.showReferrer = false;
|
|
15622
|
+
h$1(this);
|
|
15623
|
+
}
|
|
15624
|
+
disconnectedCallback() { }
|
|
15625
|
+
render() {
|
|
15626
|
+
const empty = h(EmptySlot$1, { label: "No Rewards Yet" });
|
|
15627
|
+
const loading = h(LoadingSlot$1, null);
|
|
15628
|
+
const { states, data, callbacks, elements } = j$1()
|
|
15629
|
+
? useRewardsTableDemo(this)
|
|
15630
|
+
: useRewardsTable(this, empty, loading);
|
|
15631
|
+
return (h(GenericTableView, { states: states, data: data, callbacks: callbacks, elements: elements }));
|
|
15632
|
+
}
|
|
15633
|
+
};
|
|
15634
|
+
function useRewardsTableDemo(props) {
|
|
15635
|
+
return cjs({
|
|
15636
|
+
states: {
|
|
15637
|
+
hasPrev: false,
|
|
15638
|
+
hasNext: false,
|
|
15639
|
+
loading: false,
|
|
15640
|
+
namespace: CSS_NAMESPACE,
|
|
15641
|
+
},
|
|
15642
|
+
callbacks: {
|
|
15643
|
+
prevPage: () => console.log("Prev"),
|
|
15644
|
+
nextPage: () => console.log("Next"),
|
|
15645
|
+
},
|
|
15646
|
+
data: {
|
|
15647
|
+
textOverrides: {
|
|
15648
|
+
showLabels: props.showLabels,
|
|
15649
|
+
prevLabel: props.prevLabel,
|
|
15650
|
+
moreLabel: props.moreLabel,
|
|
15651
|
+
},
|
|
15652
|
+
referralData: [],
|
|
15653
|
+
},
|
|
15654
|
+
elements: {
|
|
15655
|
+
emptyElement: h(EmptySkeleton, { label: "No Rewards Yet" }),
|
|
15656
|
+
loadingElement: h(LoadingSkeleton, null),
|
|
15657
|
+
// TODO: This should be smarter
|
|
15658
|
+
columns: [h("div", null, "Name"), h("div", null, "Email"), h("div", null, "DOB")],
|
|
15659
|
+
rows: [],
|
|
15660
|
+
},
|
|
15661
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15662
|
+
}
|
|
15663
|
+
|
|
15664
|
+
const RewardsTableColumn = class {
|
|
15665
|
+
constructor(hostRef) {
|
|
15666
|
+
registerInstance(this, hostRef);
|
|
15667
|
+
/**
|
|
15668
|
+
* @uiName Reward column title
|
|
15669
|
+
*/
|
|
15670
|
+
this.columnTitle = "Rewards";
|
|
15671
|
+
/**
|
|
15672
|
+
* @uiName Hide dropdown details of reward
|
|
15673
|
+
*/
|
|
15674
|
+
this.hideDetails = false;
|
|
15675
|
+
h$1(this);
|
|
15676
|
+
}
|
|
15677
|
+
disconnectedCallback() { }
|
|
15678
|
+
//@ts-ignore
|
|
15679
|
+
async renderCell(data) {
|
|
15680
|
+
// TODO: Do the right thing with many rewards, pending rewards, canceled rewards
|
|
15681
|
+
console.log({ data });
|
|
15682
|
+
return (h("sqm-referral-table-rewards-cell", { rewards: data, hideDetails: this.hideDetails }));
|
|
15683
|
+
}
|
|
15684
|
+
async renderLabel() {
|
|
15685
|
+
return this.columnTitle;
|
|
15686
|
+
}
|
|
15687
|
+
render() {
|
|
15688
|
+
useRequestRerender([this.columnTitle]);
|
|
15689
|
+
return h(Host, { style: { display: "none" } });
|
|
15690
|
+
}
|
|
15691
|
+
};
|
|
15692
|
+
|
|
14748
15693
|
const debug$1 = browser("sq:useRouter");
|
|
14749
15694
|
function matchPath(pattern, page) {
|
|
14750
15695
|
if (!pattern)
|
|
@@ -14837,19 +15782,19 @@ const SqmRouter = class {
|
|
|
14837
15782
|
};
|
|
14838
15783
|
SqmRouter.style = sqmRouterCss;
|
|
14839
15784
|
|
|
14840
|
-
const style$
|
|
15785
|
+
const style$8 = {
|
|
14841
15786
|
HostBlock: HostBlock,
|
|
14842
15787
|
buttonStyle: {
|
|
14843
15788
|
display: "block",
|
|
14844
15789
|
},
|
|
14845
15790
|
};
|
|
14846
15791
|
jss.setup(create());
|
|
14847
|
-
const sheet$
|
|
14848
|
-
const styleString$
|
|
15792
|
+
const sheet$8 = jss.createStyleSheet(style$8);
|
|
15793
|
+
const styleString$8 = sheet$8.toString();
|
|
14849
15794
|
function ShareButtonView(props, children) {
|
|
14850
15795
|
return props.hide ? (h(Host, { style: { display: "none" } })) : (h("div", null,
|
|
14851
|
-
h("style", { type: "text/css" }, styleString$
|
|
14852
|
-
h("sl-button", { class: sheet$
|
|
15796
|
+
h("style", { type: "text/css" }, styleString$8),
|
|
15797
|
+
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` },
|
|
14853
15798
|
!props.hideicon && (h("sl-icon", { slot: props.iconslot, name: props.icon ? props.icon : props.medium, exportparts: "icon" })),
|
|
14854
15799
|
!props.hidetext && children)));
|
|
14855
15800
|
}
|
|
@@ -16487,7 +17432,7 @@ var _createEmotion = createEmotion({
|
|
|
16487
17432
|
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?h:b,g=f.title,m=void 0===g?"Stencilbook":g,x=f.homepage,h$1=void 0===x?y("h3",null,"Select a story!"):x,v=f.addons,k=void 0===v?[]:v,w=useMemo(function(){return a.map(d$1).reduce(p$1,{_:[]})},a),S=useState(void 0),C=S[0],z=S[1],O=null==C?void 0:C.key,j=useState("desktop"),T=j[0],_=j[1],B=useState(!0),D=B[0],L=B[1],N=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$1,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}}
|
|
16488
17433
|
|
|
16489
17434
|
const ShareButton_stories = {
|
|
16490
|
-
title: "Share Button",
|
|
17435
|
+
title: "Components/Share Button",
|
|
16491
17436
|
};
|
|
16492
17437
|
const WithIcon = () => {
|
|
16493
17438
|
const props = { medium: "facebook", iconslot: "suffix" };
|
|
@@ -16543,7 +17488,7 @@ const ShareButton$1 = /*#__PURE__*/Object.freeze({
|
|
|
16543
17488
|
});
|
|
16544
17489
|
|
|
16545
17490
|
const ShareLink_stories = {
|
|
16546
|
-
title: "Share Link",
|
|
17491
|
+
title: "Components/Share Link",
|
|
16547
17492
|
};
|
|
16548
17493
|
const Default = () => {
|
|
16549
17494
|
const props = {
|
|
@@ -16584,14 +17529,15 @@ const ShareLink$1 = /*#__PURE__*/Object.freeze({
|
|
|
16584
17529
|
});
|
|
16585
17530
|
|
|
16586
17531
|
const BigStat_stories = {
|
|
16587
|
-
title: "Big Stat",
|
|
17532
|
+
title: "Components/Big Stat",
|
|
16588
17533
|
};
|
|
16589
17534
|
const Default$1 = () => {
|
|
16590
|
-
const props = { statvalue: "9.900,00" };
|
|
17535
|
+
const props = { value: 990000, statvalue: "9.900,00" };
|
|
16591
17536
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
16592
17537
|
};
|
|
16593
17538
|
const LeftAlign = () => {
|
|
16594
17539
|
const props = {
|
|
17540
|
+
value: 500,
|
|
16595
17541
|
statvalue: "500",
|
|
16596
17542
|
alignment: "left",
|
|
16597
17543
|
};
|
|
@@ -16599,6 +17545,7 @@ const LeftAlign = () => {
|
|
|
16599
17545
|
};
|
|
16600
17546
|
const RightAlign = () => {
|
|
16601
17547
|
const props = {
|
|
17548
|
+
value: 500,
|
|
16602
17549
|
statvalue: "500",
|
|
16603
17550
|
alignment: "right",
|
|
16604
17551
|
};
|
|
@@ -16606,6 +17553,7 @@ const RightAlign = () => {
|
|
|
16606
17553
|
};
|
|
16607
17554
|
const FlexReverse = () => {
|
|
16608
17555
|
const props = {
|
|
17556
|
+
value: 500,
|
|
16609
17557
|
statvalue: "500",
|
|
16610
17558
|
flexReverse: true,
|
|
16611
17559
|
};
|
|
@@ -16613,6 +17561,7 @@ const FlexReverse = () => {
|
|
|
16613
17561
|
};
|
|
16614
17562
|
const FlexReverseRight = () => {
|
|
16615
17563
|
const props = {
|
|
17564
|
+
value: 500,
|
|
16616
17565
|
statvalue: "500",
|
|
16617
17566
|
flexReverse: true,
|
|
16618
17567
|
alignment: "right",
|
|
@@ -16621,6 +17570,7 @@ const FlexReverseRight = () => {
|
|
|
16621
17570
|
};
|
|
16622
17571
|
const FlexReverseLeft = () => {
|
|
16623
17572
|
const props = {
|
|
17573
|
+
value: 500,
|
|
16624
17574
|
statvalue: "500",
|
|
16625
17575
|
flexReverse: true,
|
|
16626
17576
|
alignment: "left",
|
|
@@ -16629,12 +17579,14 @@ const FlexReverseLeft = () => {
|
|
|
16629
17579
|
};
|
|
16630
17580
|
const NoStatValue = () => {
|
|
16631
17581
|
const props = {
|
|
17582
|
+
value: 0,
|
|
16632
17583
|
statvalue: "...",
|
|
16633
17584
|
};
|
|
16634
17585
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
16635
17586
|
};
|
|
16636
17587
|
const InvalidStatValue = () => {
|
|
16637
17588
|
const props = {
|
|
17589
|
+
value: 0,
|
|
16638
17590
|
statvalue: "!!!",
|
|
16639
17591
|
};
|
|
16640
17592
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
@@ -16654,7 +17606,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
|
|
|
16654
17606
|
});
|
|
16655
17607
|
|
|
16656
17608
|
const Leaderboard_stories = {
|
|
16657
|
-
title: "Leaderboard",
|
|
17609
|
+
title: "Components/Leaderboard",
|
|
16658
17610
|
parameters: {
|
|
16659
17611
|
tagname: "sqm-leaderboard",
|
|
16660
17612
|
},
|
|
@@ -16931,7 +17883,7 @@ const Router = /*#__PURE__*/Object.freeze({
|
|
|
16931
17883
|
});
|
|
16932
17884
|
|
|
16933
17885
|
const LeaderboardRank_stories = {
|
|
16934
|
-
title: "Leaderboard Rank",
|
|
17886
|
+
title: "Components/Leaderboard Rank",
|
|
16935
17887
|
};
|
|
16936
17888
|
const First = () => {
|
|
16937
17889
|
const props = { data: { rank: "1st" } };
|
|
@@ -16978,7 +17930,7 @@ function setupLoggedOut() {
|
|
|
16978
17930
|
};
|
|
16979
17931
|
}
|
|
16980
17932
|
const PortalFrame_stories = {
|
|
16981
|
-
title: "Portal Frame",
|
|
17933
|
+
title: "Components/Portal Frame",
|
|
16982
17934
|
};
|
|
16983
17935
|
const defaultProps = {
|
|
16984
17936
|
data: {
|
|
@@ -17073,7 +18025,7 @@ const PortalFrame$1 = /*#__PURE__*/Object.freeze({
|
|
|
17073
18025
|
});
|
|
17074
18026
|
|
|
17075
18027
|
const EditProfileForm_stories = {
|
|
17076
|
-
title: "Edit Profile Form",
|
|
18028
|
+
title: "Components/Edit Profile Form",
|
|
17077
18029
|
};
|
|
17078
18030
|
const defaultProps$1 = {
|
|
17079
18031
|
states: {
|
|
@@ -17360,6 +18312,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
|
|
|
17360
18312
|
const ProgramGoals = createHookStory(() => {
|
|
17361
18313
|
const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
|
|
17362
18314
|
return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
|
|
18315
|
+
});
|
|
18316
|
+
const CustomField = createHookStory(() => {
|
|
18317
|
+
return View(`/customFields/thingCount`, "/(customFields)/:customField");
|
|
17363
18318
|
});
|
|
17364
18319
|
|
|
17365
18320
|
const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
@@ -17391,7 +18346,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
|
|
|
17391
18346
|
RewardsAvailableWithSlash: RewardsAvailableWithSlash,
|
|
17392
18347
|
RewardBalance: RewardBalance,
|
|
17393
18348
|
RewardBalanceCashUSD: RewardBalanceCashUSD,
|
|
17394
|
-
ProgramGoals: ProgramGoals
|
|
18349
|
+
ProgramGoals: ProgramGoals,
|
|
18350
|
+
CustomField: CustomField
|
|
17395
18351
|
});
|
|
17396
18352
|
|
|
17397
18353
|
function setupGraphQL$4() {
|
|
@@ -17512,62 +18468,286 @@ const TopStartedReferrers = createHookStory(() => {
|
|
|
17512
18468
|
];
|
|
17513
18469
|
});
|
|
17514
18470
|
|
|
17515
|
-
const UseLeaderboard = /*#__PURE__*/Object.freeze({
|
|
18471
|
+
const UseLeaderboard = /*#__PURE__*/Object.freeze({
|
|
18472
|
+
__proto__: null,
|
|
18473
|
+
'default': UseLeaderboard_stories,
|
|
18474
|
+
TopConvertedReferrers: TopConvertedReferrers,
|
|
18475
|
+
TopStartedReferrers: TopStartedReferrers
|
|
18476
|
+
});
|
|
18477
|
+
|
|
18478
|
+
const FormMessage_stories = {
|
|
18479
|
+
title: "Components/Form Message",
|
|
18480
|
+
};
|
|
18481
|
+
const SuccessAlert = () => {
|
|
18482
|
+
return (h("sqm-form-message", { type: "success" },
|
|
18483
|
+
h("div", null, "This is a success message.")));
|
|
18484
|
+
};
|
|
18485
|
+
const ErrorAlert = () => {
|
|
18486
|
+
return (h("sqm-form-message", { type: "error" },
|
|
18487
|
+
h("div", null, "This is an error message")));
|
|
18488
|
+
};
|
|
18489
|
+
const InfoAlert = () => {
|
|
18490
|
+
return (h("sqm-form-message", { type: "info" },
|
|
18491
|
+
h("div", null, "This is an info message")));
|
|
18492
|
+
};
|
|
18493
|
+
const FullStackSuccess = () => {
|
|
18494
|
+
return (h("sqm-form-message", { type: "success", exportparts: "successalert-icon" },
|
|
18495
|
+
h("div", { class: "AlertContent" },
|
|
18496
|
+
h("div", { part: "successalert-text" }, "Title"),
|
|
18497
|
+
h("div", { part: "successalert-subtext" }, "Body text."),
|
|
18498
|
+
h("sl-button", { type: "default", exportparts: "base: defaultbutton-base", onClick: () => {
|
|
18499
|
+
console.log("click");
|
|
18500
|
+
} }, "Primary Action"),
|
|
18501
|
+
h("sl-button", { class: "SecondaryTextButton", type: "text", onClick: () => {
|
|
18502
|
+
console.log("click");
|
|
18503
|
+
} }, "Secondary Action"))));
|
|
18504
|
+
};
|
|
18505
|
+
|
|
18506
|
+
const FormMessage$1 = /*#__PURE__*/Object.freeze({
|
|
18507
|
+
__proto__: null,
|
|
18508
|
+
'default': FormMessage_stories,
|
|
18509
|
+
SuccessAlert: SuccessAlert,
|
|
18510
|
+
ErrorAlert: ErrorAlert,
|
|
18511
|
+
InfoAlert: InfoAlert,
|
|
18512
|
+
FullStackSuccess: FullStackSuccess
|
|
18513
|
+
});
|
|
18514
|
+
|
|
18515
|
+
const EXCHANGE$1 = dist.gql `
|
|
18516
|
+
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
18517
|
+
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
18518
|
+
reward {
|
|
18519
|
+
id
|
|
18520
|
+
}
|
|
18521
|
+
}
|
|
18522
|
+
}
|
|
18523
|
+
`;
|
|
18524
|
+
const UseRewardExchangeList_stories = {
|
|
18525
|
+
title: "Hooks / useRewardExchange",
|
|
18526
|
+
};
|
|
18527
|
+
function setupGraphQL$6() {
|
|
18528
|
+
const id = "testestest";
|
|
18529
|
+
const accountId = id;
|
|
18530
|
+
const programId = "sam-partner-test-2";
|
|
18531
|
+
//@ts-ignore
|
|
18532
|
+
window.widgetIdent = {
|
|
18533
|
+
tenantAlias: "test_a8b41jotf8a1v",
|
|
18534
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18535
|
+
programId,
|
|
18536
|
+
};
|
|
18537
|
+
useEffect(() => {
|
|
18538
|
+
L$1({
|
|
18539
|
+
accountId,
|
|
18540
|
+
id,
|
|
18541
|
+
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18542
|
+
});
|
|
18543
|
+
return () => {
|
|
18544
|
+
window.widgetIdent = undefined;
|
|
18545
|
+
L$1(undefined);
|
|
18546
|
+
};
|
|
18547
|
+
}, []);
|
|
18548
|
+
return { id, accountId };
|
|
18549
|
+
}
|
|
18550
|
+
function useExchangeButton() {
|
|
18551
|
+
const { id, accountId } = setupGraphQL$6();
|
|
18552
|
+
const [points, setPoints] = useState(10);
|
|
18553
|
+
const [rate, setRate] = useState(100);
|
|
18554
|
+
const [exchange, { data, errors }] = Ne(EXCHANGE$1);
|
|
18555
|
+
return {
|
|
18556
|
+
states: {
|
|
18557
|
+
points,
|
|
18558
|
+
rate,
|
|
18559
|
+
},
|
|
18560
|
+
data: {
|
|
18561
|
+
id,
|
|
18562
|
+
accountId,
|
|
18563
|
+
data,
|
|
18564
|
+
errors,
|
|
18565
|
+
},
|
|
18566
|
+
callbacks: {
|
|
18567
|
+
exchange,
|
|
18568
|
+
setPoints,
|
|
18569
|
+
setRate,
|
|
18570
|
+
},
|
|
18571
|
+
};
|
|
18572
|
+
}
|
|
18573
|
+
const DefaultView = (props) => {
|
|
18574
|
+
const { states, data, callbacks } = props;
|
|
18575
|
+
return (h("div", null,
|
|
18576
|
+
h("div", null,
|
|
18577
|
+
h("label", null, "Rate:"),
|
|
18578
|
+
h("input", { value: states.rate, onInput: (e) =>
|
|
18579
|
+
// @ts-ignore
|
|
18580
|
+
callbacks.setRate(e.target.value) })),
|
|
18581
|
+
h("input", { value: states.points, onInput: (e) =>
|
|
18582
|
+
// @ts-ignore
|
|
18583
|
+
callbacks.setPoints(e.target.value) }),
|
|
18584
|
+
h("button", { onClick: () => callbacks.exchange(props.input) }, "Exchange"),
|
|
18585
|
+
h("details", null,
|
|
18586
|
+
h("summary", null, "response"),
|
|
18587
|
+
h("h4", null, "data"),
|
|
18588
|
+
h("div", { style: { maxWidth: "500px" } },
|
|
18589
|
+
h("pre", { style: { width: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.data))),
|
|
18590
|
+
h("h4", null, "errors"),
|
|
18591
|
+
h("div", { style: { maxWidth: "500px" } },
|
|
18592
|
+
h("pre", { style: { maxWidth: "500px", whiteSpace: "pre-wrap" } }, JSON.stringify(data.errors))))));
|
|
18593
|
+
};
|
|
18594
|
+
const RewardList = createHookStory(() => {
|
|
18595
|
+
setupGraphQL$6();
|
|
18596
|
+
return (h("sqm-reward-exchange-list", { "list-type": "something" }));
|
|
18597
|
+
});
|
|
18598
|
+
const FixedGlobalReward = createHookStory(() => {
|
|
18599
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18600
|
+
return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18601
|
+
exchangeRewardInput: {
|
|
18602
|
+
userId: data.id,
|
|
18603
|
+
accountId: data.accountId,
|
|
18604
|
+
redeemCreditInput: {
|
|
18605
|
+
amount: states.points,
|
|
18606
|
+
unit: "POINT",
|
|
18607
|
+
},
|
|
18608
|
+
globalRewardKey: "gc1",
|
|
18609
|
+
},
|
|
18610
|
+
} }));
|
|
18611
|
+
});
|
|
18612
|
+
const VariableGlobalReward = createHookStory(() => {
|
|
18613
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18614
|
+
return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18615
|
+
exchangeRewardInput: {
|
|
18616
|
+
userId: data.id,
|
|
18617
|
+
accountId: data.accountId,
|
|
18618
|
+
redeemCreditInput: {
|
|
18619
|
+
amount: states.points,
|
|
18620
|
+
unit: "POINT",
|
|
18621
|
+
},
|
|
18622
|
+
globalRewardKey: "gc1",
|
|
18623
|
+
rewardInput: {
|
|
18624
|
+
valueInCents: Math.ceil(states.points * states.rate),
|
|
18625
|
+
},
|
|
18626
|
+
},
|
|
18627
|
+
} }));
|
|
18628
|
+
});
|
|
18629
|
+
const VariableCreditReward = createHookStory(() => {
|
|
18630
|
+
const { states, data, callbacks } = useExchangeButton();
|
|
18631
|
+
return (h(DefaultView, { states: states, data: data, callbacks: callbacks, input: {
|
|
18632
|
+
exchangeRewardInput: {
|
|
18633
|
+
userId: data.id,
|
|
18634
|
+
accountId: data.accountId,
|
|
18635
|
+
redeemCreditInput: {
|
|
18636
|
+
amount: states.points,
|
|
18637
|
+
unit: "POINT",
|
|
18638
|
+
},
|
|
18639
|
+
rewardInput: {
|
|
18640
|
+
type: "CREDIT",
|
|
18641
|
+
unit: "foo",
|
|
18642
|
+
assignedCredit: Math.ceil(states.points * states.rate),
|
|
18643
|
+
},
|
|
18644
|
+
},
|
|
18645
|
+
} }));
|
|
18646
|
+
});
|
|
18647
|
+
|
|
18648
|
+
const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
18649
|
+
__proto__: null,
|
|
18650
|
+
'default': UseRewardExchangeList_stories,
|
|
18651
|
+
RewardList: RewardList,
|
|
18652
|
+
FixedGlobalReward: FixedGlobalReward,
|
|
18653
|
+
VariableGlobalReward: VariableGlobalReward,
|
|
18654
|
+
VariableCreditReward: VariableCreditReward
|
|
18655
|
+
});
|
|
18656
|
+
|
|
18657
|
+
const UseRewardsTable_stories = {
|
|
18658
|
+
title: "Hooks / useRewardsTable",
|
|
18659
|
+
};
|
|
18660
|
+
function setupGraphQL$7() {
|
|
18661
|
+
const id = "testestest";
|
|
18662
|
+
const accountId = id;
|
|
18663
|
+
//@ts-ignore
|
|
18664
|
+
window.widgetIdent = {
|
|
18665
|
+
tenantAlias: "test_a8b41jotf8a1v",
|
|
18666
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18667
|
+
};
|
|
18668
|
+
useEffect(() => {
|
|
18669
|
+
L$1({
|
|
18670
|
+
accountId,
|
|
18671
|
+
id,
|
|
18672
|
+
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InRlc3Rlc3Rlc3QiLCJpZCI6InRlc3Rlc3Rlc3QifX0.qYnU5hNeIj9C_G3NogfG7btgCPGZC7JRXY0MG6a63zs",
|
|
18673
|
+
});
|
|
18674
|
+
return () => {
|
|
18675
|
+
window.widgetIdent = undefined;
|
|
18676
|
+
L$1(undefined);
|
|
18677
|
+
};
|
|
18678
|
+
}, []);
|
|
18679
|
+
return { id, accountId };
|
|
18680
|
+
}
|
|
18681
|
+
const RewardsTableWithProgram = createHookStory(() => {
|
|
18682
|
+
setupGraphQL$7();
|
|
18683
|
+
A$1("sam-partner-test-2");
|
|
18684
|
+
return (h("sqm-rewards-table", null,
|
|
18685
|
+
h("sqm-rewards-table-column", null)));
|
|
18686
|
+
});
|
|
18687
|
+
const RewardsTableNoProgram = createHookStory(() => {
|
|
18688
|
+
setupGraphQL$7();
|
|
18689
|
+
A$1(undefined);
|
|
18690
|
+
return (h("sqm-rewards-table", null,
|
|
18691
|
+
h("sqm-rewards-table-column", null)));
|
|
18692
|
+
});
|
|
18693
|
+
|
|
18694
|
+
const UseRewardsTable = /*#__PURE__*/Object.freeze({
|
|
17516
18695
|
__proto__: null,
|
|
17517
|
-
'default':
|
|
17518
|
-
|
|
17519
|
-
|
|
18696
|
+
'default': UseRewardsTable_stories,
|
|
18697
|
+
RewardsTableWithProgram: RewardsTableWithProgram,
|
|
18698
|
+
RewardsTableNoProgram: RewardsTableNoProgram
|
|
17520
18699
|
});
|
|
17521
18700
|
|
|
17522
|
-
const
|
|
17523
|
-
|
|
17524
|
-
|
|
17525
|
-
const SuccessAlert = () => {
|
|
17526
|
-
return (h("sqm-form-message", { type: "success" },
|
|
17527
|
-
h("div", null, "This is a success message.")));
|
|
17528
|
-
};
|
|
17529
|
-
const ErrorAlert = () => {
|
|
17530
|
-
return (h("sqm-form-message", { type: "error" },
|
|
17531
|
-
h("div", null, "This is an error message")));
|
|
17532
|
-
};
|
|
17533
|
-
const InfoAlert = () => {
|
|
17534
|
-
return (h("sqm-form-message", { type: "info" },
|
|
17535
|
-
h("div", null, "This is an info message")));
|
|
18701
|
+
const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
|
|
18702
|
+
const UseTaskCard_stories = {
|
|
18703
|
+
title: "Hooks / useTaskCard",
|
|
17536
18704
|
};
|
|
17537
|
-
|
|
17538
|
-
|
|
17539
|
-
|
|
17540
|
-
|
|
17541
|
-
|
|
17542
|
-
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
18705
|
+
function setupGraphQL$8() {
|
|
18706
|
+
const id = "sam+klip@saasquat.ch";
|
|
18707
|
+
const accountId = id;
|
|
18708
|
+
const programId = "klip-referral-program";
|
|
18709
|
+
//@ts-ignore
|
|
18710
|
+
window.widgetIdent = {
|
|
18711
|
+
tenantAlias: "test_a74miwdpofztj",
|
|
18712
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18713
|
+
programId,
|
|
18714
|
+
};
|
|
18715
|
+
useEffect(() => {
|
|
18716
|
+
L$1({
|
|
18717
|
+
accountId,
|
|
18718
|
+
id,
|
|
18719
|
+
jwt: JWT,
|
|
18720
|
+
});
|
|
18721
|
+
return () => {
|
|
18722
|
+
window.widgetIdent = undefined;
|
|
18723
|
+
L$1(undefined);
|
|
18724
|
+
};
|
|
18725
|
+
}, []);
|
|
18726
|
+
return { id, accountId };
|
|
18727
|
+
}
|
|
18728
|
+
const TaskCard = createHookStory(() => {
|
|
18729
|
+
setupGraphQL$8();
|
|
18730
|
+
return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
|
|
18731
|
+
});
|
|
17549
18732
|
|
|
17550
|
-
const
|
|
18733
|
+
const UseTaskCard = /*#__PURE__*/Object.freeze({
|
|
17551
18734
|
__proto__: null,
|
|
17552
|
-
'default':
|
|
17553
|
-
|
|
17554
|
-
ErrorAlert: ErrorAlert,
|
|
17555
|
-
InfoAlert: InfoAlert,
|
|
17556
|
-
FullStackSuccess: FullStackSuccess
|
|
18735
|
+
'default': UseTaskCard_stories,
|
|
18736
|
+
TaskCard: TaskCard
|
|
17557
18737
|
});
|
|
17558
18738
|
|
|
17559
18739
|
const NewPortal_stories = {
|
|
17560
18740
|
title: "New Portal",
|
|
17561
18741
|
};
|
|
17562
|
-
const style$
|
|
18742
|
+
const style$9 = {
|
|
17563
18743
|
HeaderSubtitleBold: {
|
|
17564
18744
|
"font-weight": 500,
|
|
17565
18745
|
"text-decoration": "underline",
|
|
17566
18746
|
},
|
|
17567
18747
|
};
|
|
17568
18748
|
jss.setup(create());
|
|
17569
|
-
const sheet$
|
|
17570
|
-
const styleString$
|
|
18749
|
+
const sheet$9 = jss.createStyleSheet(style$9);
|
|
18750
|
+
const styleString$9 = sheet$9.toString();
|
|
17571
18751
|
const barProps = {
|
|
17572
18752
|
data: {
|
|
17573
18753
|
programs: [
|
|
@@ -17662,7 +18842,7 @@ const Dashboard = () => {
|
|
|
17662
18842
|
hide: false,
|
|
17663
18843
|
};
|
|
17664
18844
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
17665
|
-
h("style", { type: "text/css" }, styleString$
|
|
18845
|
+
h("style", { type: "text/css" }, styleString$9),
|
|
17666
18846
|
h(Sidebar, null),
|
|
17667
18847
|
h("sqm-divided-layout", { direction: "column" },
|
|
17668
18848
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17675,10 +18855,10 @@ const Dashboard = () => {
|
|
|
17675
18855
|
h("h1", null, "John Smith"))),
|
|
17676
18856
|
})),
|
|
17677
18857
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17678
|
-
h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
|
|
17679
|
-
h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
|
|
17680
|
-
h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
|
|
17681
|
-
h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
|
|
18858
|
+
h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
|
|
18859
|
+
h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
|
|
18860
|
+
h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
|
|
18861
|
+
h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
|
|
17682
18862
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
17683
18863
|
h(PortalSectionView, Object.assign({}, {
|
|
17684
18864
|
labelMargin: "x-large",
|
|
@@ -17720,7 +18900,7 @@ const Dashboard = () => {
|
|
|
17720
18900
|
};
|
|
17721
18901
|
const EditProfile$2 = () => {
|
|
17722
18902
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
17723
|
-
h("style", { type: "text/css" }, styleString$
|
|
18903
|
+
h("style", { type: "text/css" }, styleString$9),
|
|
17724
18904
|
h(Sidebar, null),
|
|
17725
18905
|
h("sqm-divided-layout", { direction: "column" },
|
|
17726
18906
|
h(PortalProfileView, Object.assign({}, {
|
|
@@ -17784,7 +18964,7 @@ const EditProfile$2 = () => {
|
|
|
17784
18964
|
};
|
|
17785
18965
|
const Commissions = () => {
|
|
17786
18966
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
17787
|
-
h("style", { type: "text/css" }, styleString$
|
|
18967
|
+
h("style", { type: "text/css" }, styleString$9),
|
|
17788
18968
|
h(Sidebar, null),
|
|
17789
18969
|
h("sqm-divided-layout", { direction: "column" },
|
|
17790
18970
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17797,19 +18977,19 @@ const Commissions = () => {
|
|
|
17797
18977
|
h("p", null,
|
|
17798
18978
|
"for the",
|
|
17799
18979
|
" ",
|
|
17800
|
-
h("span", { class: sheet$
|
|
18980
|
+
h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
17801
18981
|
" ",
|
|
17802
18982
|
"program"))),
|
|
17803
18983
|
})),
|
|
17804
18984
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17805
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
|
|
17806
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
|
|
17807
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
|
|
17808
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
|
|
18985
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
|
|
18986
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
|
|
18987
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
|
|
18988
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
|
|
17809
18989
|
};
|
|
17810
18990
|
const Activity = () => {
|
|
17811
18991
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
17812
|
-
h("style", { type: "text/css" }, styleString$
|
|
18992
|
+
h("style", { type: "text/css" }, styleString$9),
|
|
17813
18993
|
h(Sidebar, null),
|
|
17814
18994
|
h("sqm-divided-layout", { direction: "column" },
|
|
17815
18995
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
@@ -17822,7 +19002,7 @@ const Activity = () => {
|
|
|
17822
19002
|
h("p", null,
|
|
17823
19003
|
"for the",
|
|
17824
19004
|
" ",
|
|
17825
|
-
h("span", { class: sheet$
|
|
19005
|
+
h("span", { class: sheet$9.classes.HeaderSubtitleBold }, "Partner Program #1"),
|
|
17826
19006
|
" ",
|
|
17827
19007
|
"program"))),
|
|
17828
19008
|
})),
|
|
@@ -17832,10 +19012,10 @@ const Activity = () => {
|
|
|
17832
19012
|
label: (h("sqm-text", null,
|
|
17833
19013
|
h("h3", null, "Referral Activity"))),
|
|
17834
19014
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17835
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
|
|
17836
|
-
h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
|
|
17837
|
-
h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
|
|
17838
|
-
h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
|
|
19015
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
|
|
19016
|
+
h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
|
|
19017
|
+
h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
|
|
19018
|
+
h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
|
|
17839
19019
|
}))),
|
|
17840
19020
|
h(PortalSectionView, Object.assign({}, {
|
|
17841
19021
|
labelMargin: "x-large",
|
|
@@ -17843,9 +19023,9 @@ const Activity = () => {
|
|
|
17843
19023
|
label: (h("sqm-text", null,
|
|
17844
19024
|
h("h3", null, "Traffic Generated"))),
|
|
17845
19025
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
17846
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
|
|
17847
|
-
h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
|
|
17848
|
-
h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
|
|
19026
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
|
|
19027
|
+
h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
|
|
19028
|
+
h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
|
|
17849
19029
|
})))));
|
|
17850
19030
|
};
|
|
17851
19031
|
|
|
@@ -17859,7 +19039,7 @@ const NewPortal = /*#__PURE__*/Object.freeze({
|
|
|
17859
19039
|
});
|
|
17860
19040
|
|
|
17861
19041
|
const SidebarItem_stories = {
|
|
17862
|
-
title: "Sidebar Item",
|
|
19042
|
+
title: "Components/Sidebar Item",
|
|
17863
19043
|
};
|
|
17864
19044
|
const InactiveItem = () => {
|
|
17865
19045
|
const props = {
|
|
@@ -17896,7 +19076,7 @@ const SidebarItem = /*#__PURE__*/Object.freeze({
|
|
|
17896
19076
|
});
|
|
17897
19077
|
|
|
17898
19078
|
const NavigationSidebar_stories = {
|
|
17899
|
-
title: "Navigation Sidebar",
|
|
19079
|
+
title: "Components/Navigation Sidebar",
|
|
17900
19080
|
};
|
|
17901
19081
|
const DefaultNavigationSidebar = () => {
|
|
17902
19082
|
const barProps = {
|
|
@@ -17945,7 +19125,7 @@ const NavigationSidebar = /*#__PURE__*/Object.freeze({
|
|
|
17945
19125
|
});
|
|
17946
19126
|
|
|
17947
19127
|
const PortalLogin_stories = {
|
|
17948
|
-
title: "Portal Login",
|
|
19128
|
+
title: "Components/Portal Login",
|
|
17949
19129
|
};
|
|
17950
19130
|
const defaultProps$2 = {
|
|
17951
19131
|
states: {
|
|
@@ -17990,7 +19170,7 @@ const PortalLogin$1 = /*#__PURE__*/Object.freeze({
|
|
|
17990
19170
|
});
|
|
17991
19171
|
|
|
17992
19172
|
const PortalRegister_stories = {
|
|
17993
|
-
title: "Portal Register",
|
|
19173
|
+
title: "Components/Portal Register",
|
|
17994
19174
|
};
|
|
17995
19175
|
const defaultProps$3 = {
|
|
17996
19176
|
states: {
|
|
@@ -18093,7 +19273,7 @@ const PortalRegister$1 = /*#__PURE__*/Object.freeze({
|
|
|
18093
19273
|
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";
|
|
18094
19274
|
|
|
18095
19275
|
const PortalForgotPassword_stories = {
|
|
18096
|
-
title: "Portal Forgot Password",
|
|
19276
|
+
title: "Components/Portal Forgot Password",
|
|
18097
19277
|
parameters: {
|
|
18098
19278
|
scenario,
|
|
18099
19279
|
},
|
|
@@ -18171,7 +19351,7 @@ const PortalForgotPassword = /*#__PURE__*/Object.freeze({
|
|
|
18171
19351
|
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";
|
|
18172
19352
|
|
|
18173
19353
|
const PortalEmailVerification_stories = {
|
|
18174
|
-
title: "Portal Email Verification",
|
|
19354
|
+
title: "Components/Portal Email Verification",
|
|
18175
19355
|
parameters: {
|
|
18176
19356
|
scenario: scenario$1,
|
|
18177
19357
|
},
|
|
@@ -18257,7 +19437,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
18257
19437
|
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\"";
|
|
18258
19438
|
|
|
18259
19439
|
const PortalResetPassword_stories = {
|
|
18260
|
-
title: "Portal Reset Password",
|
|
19440
|
+
title: "Components/Portal Reset Password",
|
|
18261
19441
|
parameters: {
|
|
18262
19442
|
scenario: scenario$2,
|
|
18263
19443
|
},
|
|
@@ -18421,7 +19601,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
18421
19601
|
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 |";
|
|
18422
19602
|
|
|
18423
19603
|
const PortalVerifyEmail_stories = {
|
|
18424
|
-
title: "Portal Verify Email",
|
|
19604
|
+
title: "Components/Portal Verify Email",
|
|
18425
19605
|
parameters: {
|
|
18426
19606
|
scenario: scenario$3,
|
|
18427
19607
|
},
|
|
@@ -18465,7 +19645,7 @@ const PortalVerifyEmail = /*#__PURE__*/Object.freeze({
|
|
|
18465
19645
|
});
|
|
18466
19646
|
|
|
18467
19647
|
const AssetCard_stories = {
|
|
18468
|
-
title: "Asset Card",
|
|
19648
|
+
title: "Components/Asset Card",
|
|
18469
19649
|
};
|
|
18470
19650
|
const Default$7 = () => {
|
|
18471
19651
|
const props = {
|
|
@@ -18501,7 +19681,7 @@ const AssetCard = /*#__PURE__*/Object.freeze({
|
|
|
18501
19681
|
});
|
|
18502
19682
|
|
|
18503
19683
|
const DividedLayout_stories = {
|
|
18504
|
-
title: "Divided Layout",
|
|
19684
|
+
title: "Components/Divided Layout",
|
|
18505
19685
|
};
|
|
18506
19686
|
const barProps$1 = {
|
|
18507
19687
|
data: {
|
|
@@ -18593,7 +19773,7 @@ const DividedLayout$1 = /*#__PURE__*/Object.freeze({
|
|
|
18593
19773
|
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";
|
|
18594
19774
|
|
|
18595
19775
|
const ChangePassword_stories = {
|
|
18596
|
-
title: "Change Password",
|
|
19776
|
+
title: "Components/Change Password",
|
|
18597
19777
|
parameters: {
|
|
18598
19778
|
scenario: scenario$4,
|
|
18599
19779
|
},
|
|
@@ -18749,7 +19929,7 @@ const ChangePassword = /*#__PURE__*/Object.freeze({
|
|
|
18749
19929
|
});
|
|
18750
19930
|
|
|
18751
19931
|
const PortalProfile_stories = {
|
|
18752
|
-
title: "Portal Profile",
|
|
19932
|
+
title: "Components/Portal Profile",
|
|
18753
19933
|
};
|
|
18754
19934
|
// const style = {};
|
|
18755
19935
|
jss.setup(create());
|
|
@@ -18990,7 +20170,7 @@ const PortalProfile = /*#__PURE__*/Object.freeze({
|
|
|
18990
20170
|
});
|
|
18991
20171
|
|
|
18992
20172
|
const ReferralTableRewardsCell_stories = {
|
|
18993
|
-
title: "Referral Table Rewards Cell",
|
|
20173
|
+
title: "Components/Referral Table Rewards Cell",
|
|
18994
20174
|
};
|
|
18995
20175
|
const baseReward = {
|
|
18996
20176
|
id: "123",
|
|
@@ -19222,7 +20402,7 @@ const ReferralTableRewardsCell$1 = /*#__PURE__*/Object.freeze({
|
|
|
19222
20402
|
});
|
|
19223
20403
|
|
|
19224
20404
|
const ReferralTable_stories = {
|
|
19225
|
-
title: "Referral Table",
|
|
20405
|
+
title: "Components/Referral Table",
|
|
19226
20406
|
};
|
|
19227
20407
|
const loadingElement = (h("div", { slot: "loading", style: { display: "contents" } },
|
|
19228
20408
|
h("sqm-table-row", null,
|
|
@@ -19709,7 +20889,7 @@ const ReferralTable$1 = /*#__PURE__*/Object.freeze({
|
|
|
19709
20889
|
});
|
|
19710
20890
|
|
|
19711
20891
|
const ReferralTableCell_stories = {
|
|
19712
|
-
title: "Referral Table Cell",
|
|
20892
|
+
title: "Components/Referral Table Cell",
|
|
19713
20893
|
};
|
|
19714
20894
|
const TableCell = () => {
|
|
19715
20895
|
return (h("sqm-referral-table-cell", { innerTemplate: "Table Cell Text" }));
|
|
@@ -19781,73 +20961,1029 @@ const ReferralTableCell$1 = /*#__PURE__*/Object.freeze({
|
|
|
19781
20961
|
RewardsCell: RewardsCell
|
|
19782
20962
|
});
|
|
19783
20963
|
|
|
19784
|
-
const UserName_stories = {
|
|
19785
|
-
title: "User Name",
|
|
20964
|
+
const UserName_stories = {
|
|
20965
|
+
title: "Tests/User Name",
|
|
20966
|
+
};
|
|
20967
|
+
const DemoData = () => {
|
|
20968
|
+
return (h("sqm-user-name", { demoData: {
|
|
20969
|
+
loading: false,
|
|
20970
|
+
loadingText: "...",
|
|
20971
|
+
username: "Test Testerson",
|
|
20972
|
+
} }));
|
|
20973
|
+
};
|
|
20974
|
+
const Username = () => {
|
|
20975
|
+
return h("sqm-user-name", null);
|
|
20976
|
+
};
|
|
20977
|
+
|
|
20978
|
+
const UserName = /*#__PURE__*/Object.freeze({
|
|
20979
|
+
__proto__: null,
|
|
20980
|
+
'default': UserName_stories,
|
|
20981
|
+
DemoData: DemoData,
|
|
20982
|
+
Username: Username
|
|
20983
|
+
});
|
|
20984
|
+
|
|
20985
|
+
const PasswordField_stories = {
|
|
20986
|
+
title: "Components/Portal Password Field",
|
|
20987
|
+
};
|
|
20988
|
+
const Start = () => {
|
|
20989
|
+
return (h("sqm-password-field", { demoData: {
|
|
20990
|
+
initValue: "",
|
|
20991
|
+
states: {
|
|
20992
|
+
enableValidation: true,
|
|
20993
|
+
validationErrors: {},
|
|
20994
|
+
content: {
|
|
20995
|
+
fieldLabel: "Password",
|
|
20996
|
+
},
|
|
20997
|
+
},
|
|
20998
|
+
} }));
|
|
20999
|
+
};
|
|
21000
|
+
const EmptyError = () => {
|
|
21001
|
+
return (h("sqm-password-field", { demoData: {
|
|
21002
|
+
initValue: "",
|
|
21003
|
+
states: {
|
|
21004
|
+
enableValidation: true,
|
|
21005
|
+
validationErrors: { password: "Cannot be empty" },
|
|
21006
|
+
content: {
|
|
21007
|
+
fieldLabel: "Password",
|
|
21008
|
+
},
|
|
21009
|
+
},
|
|
21010
|
+
} }));
|
|
21011
|
+
};
|
|
21012
|
+
const ValidationError = () => {
|
|
21013
|
+
return (h("sqm-password-field", { demoData: {
|
|
21014
|
+
initValue: "asdf",
|
|
21015
|
+
states: {
|
|
21016
|
+
enableValidation: true,
|
|
21017
|
+
validationErrors: { password: "Incomplete" },
|
|
21018
|
+
content: {
|
|
21019
|
+
fieldLabel: "Password",
|
|
21020
|
+
},
|
|
21021
|
+
},
|
|
21022
|
+
} }));
|
|
21023
|
+
};
|
|
21024
|
+
|
|
21025
|
+
const PasswordField = /*#__PURE__*/Object.freeze({
|
|
21026
|
+
__proto__: null,
|
|
21027
|
+
'default': PasswordField_stories,
|
|
21028
|
+
Start: Start,
|
|
21029
|
+
EmptyError: EmptyError,
|
|
21030
|
+
ValidationError: ValidationError
|
|
21031
|
+
});
|
|
21032
|
+
|
|
21033
|
+
const checkmark_circle = () => {
|
|
21034
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
21035
|
+
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" })));
|
|
21036
|
+
};
|
|
21037
|
+
const arrow_left_right = () => {
|
|
21038
|
+
return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21039
|
+
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" })));
|
|
21040
|
+
};
|
|
21041
|
+
|
|
21042
|
+
const gift = () => {
|
|
21043
|
+
return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21044
|
+
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)" }),
|
|
21045
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
|
|
21046
|
+
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)" })));
|
|
21047
|
+
};
|
|
21048
|
+
|
|
21049
|
+
function ProgressBarView(props) {
|
|
21050
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, } = props;
|
|
21051
|
+
console.log("progress bar props", props);
|
|
21052
|
+
const gift1 = gift();
|
|
21053
|
+
const gift2 = gift();
|
|
21054
|
+
const gift3 = gift();
|
|
21055
|
+
var items = [];
|
|
21056
|
+
var columns = "";
|
|
21057
|
+
var repetitions = Math.floor(progress / goal);
|
|
21058
|
+
if (repeatable) {
|
|
21059
|
+
if (steps) {
|
|
21060
|
+
addStepsRepeatable();
|
|
21061
|
+
}
|
|
21062
|
+
else {
|
|
21063
|
+
addLinearRepeatable();
|
|
21064
|
+
}
|
|
21065
|
+
}
|
|
21066
|
+
// non repeatable
|
|
21067
|
+
else {
|
|
21068
|
+
if (steps) {
|
|
21069
|
+
addSteps();
|
|
21070
|
+
}
|
|
21071
|
+
else {
|
|
21072
|
+
addLinear();
|
|
21073
|
+
}
|
|
21074
|
+
}
|
|
21075
|
+
const style = {
|
|
21076
|
+
ProgressBar: {
|
|
21077
|
+
"& .progress-bar": {
|
|
21078
|
+
height: "15px",
|
|
21079
|
+
marginTop: steps ? "var(--sl-spacing-x-medium)" : "var(--sl-spacing-large)",
|
|
21080
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
21081
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
21082
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21083
|
+
display: "grid",
|
|
21084
|
+
gridTemplateColumns: columns,
|
|
21085
|
+
lineHeight: "45px",
|
|
21086
|
+
userSelect: "none",
|
|
21087
|
+
},
|
|
21088
|
+
"& .progress-bar.repeatable-steps": {
|
|
21089
|
+
marginLeft: "var(--sl-spacing-x-small)",
|
|
21090
|
+
},
|
|
21091
|
+
"& .filled:after": {
|
|
21092
|
+
content: '""',
|
|
21093
|
+
display: "flex",
|
|
21094
|
+
width: "100%",
|
|
21095
|
+
height: "4px",
|
|
21096
|
+
borderRadius: "4px",
|
|
21097
|
+
backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
|
|
21098
|
+
},
|
|
21099
|
+
"& .progress": {
|
|
21100
|
+
display: "block",
|
|
21101
|
+
textAlign: "center",
|
|
21102
|
+
marginLeft: "-100px",
|
|
21103
|
+
marginRight: "-100px",
|
|
21104
|
+
},
|
|
21105
|
+
"& .progress::after": {
|
|
21106
|
+
content: '""',
|
|
21107
|
+
width: "12px",
|
|
21108
|
+
height: "12px",
|
|
21109
|
+
display: "flex",
|
|
21110
|
+
backgroundColor: complete ? "var(--sl-color-success-500)" : "var(--sl-color-primary-500)",
|
|
21111
|
+
borderRadius: "50%",
|
|
21112
|
+
position: "relative",
|
|
21113
|
+
left: "47%",
|
|
21114
|
+
top: "-85%",
|
|
21115
|
+
},
|
|
21116
|
+
"& .progress.bg:after": {
|
|
21117
|
+
width: "0",
|
|
21118
|
+
height: "0",
|
|
21119
|
+
border: "none",
|
|
21120
|
+
},
|
|
21121
|
+
"& .progress.top": {
|
|
21122
|
+
position: "relative",
|
|
21123
|
+
top: "-40px",
|
|
21124
|
+
},
|
|
21125
|
+
"& .progress.top:after": {
|
|
21126
|
+
top: "-16%",
|
|
21127
|
+
},
|
|
21128
|
+
"& .empty": {
|
|
21129
|
+
display: "block",
|
|
21130
|
+
textAlign: "center",
|
|
21131
|
+
marginLeft: "-100px",
|
|
21132
|
+
marginRight: "-100px",
|
|
21133
|
+
},
|
|
21134
|
+
"& .empty::after": {
|
|
21135
|
+
content: '""',
|
|
21136
|
+
width: "12px",
|
|
21137
|
+
height: "12px",
|
|
21138
|
+
border: "2px solid #E0E0E0",
|
|
21139
|
+
margin: "-2px",
|
|
21140
|
+
display: "flex",
|
|
21141
|
+
backgroundColor: "white",
|
|
21142
|
+
borderRadius: "50%",
|
|
21143
|
+
position: "relative",
|
|
21144
|
+
left: "47%",
|
|
21145
|
+
top: "-85%",
|
|
21146
|
+
},
|
|
21147
|
+
"& .empty.bg:after": {
|
|
21148
|
+
width: "0",
|
|
21149
|
+
height: "0",
|
|
21150
|
+
border: "none",
|
|
21151
|
+
},
|
|
21152
|
+
"& .remain:after": {
|
|
21153
|
+
content: '""',
|
|
21154
|
+
display: "flex",
|
|
21155
|
+
width: "100%",
|
|
21156
|
+
height: "4px",
|
|
21157
|
+
borderRadius: "4px",
|
|
21158
|
+
backgroundColor: "#E0E0E0",
|
|
21159
|
+
},
|
|
21160
|
+
"& .gift.bw": {
|
|
21161
|
+
filter: "grayscale(100%)",
|
|
21162
|
+
},
|
|
21163
|
+
"& .gift.start": {
|
|
21164
|
+
transform: "scale(80%)",
|
|
21165
|
+
top: "-20px",
|
|
21166
|
+
},
|
|
21167
|
+
"& .gift": {
|
|
21168
|
+
textAlign: "center",
|
|
21169
|
+
marginLeft: "-100px",
|
|
21170
|
+
marginRight: "-100px",
|
|
21171
|
+
position: "relative",
|
|
21172
|
+
display: "list-item",
|
|
21173
|
+
listStyleType: "none",
|
|
21174
|
+
top: "-18px",
|
|
21175
|
+
filter: goal <= progress ? "" : "grayscale(100%)",
|
|
21176
|
+
zIndex: "1",
|
|
21177
|
+
},
|
|
21178
|
+
},
|
|
21179
|
+
};
|
|
21180
|
+
jss.setup(create());
|
|
21181
|
+
const sheet = jss.createStyleSheet(style);
|
|
21182
|
+
const styleString = sheet.toString();
|
|
21183
|
+
return (h("div", { class: sheet.classes.ProgressBar },
|
|
21184
|
+
h("style", { type: "text/css" }, styleString),
|
|
21185
|
+
h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
|
|
21186
|
+
function clamp(x, min, max) {
|
|
21187
|
+
return Math.min(Math.max(x, min), max);
|
|
21188
|
+
}
|
|
21189
|
+
function addLinear() {
|
|
21190
|
+
const ratio = progress / goal;
|
|
21191
|
+
columns =
|
|
21192
|
+
clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
|
|
21193
|
+
items.push(h("div", { class: "filled" }));
|
|
21194
|
+
items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
|
|
21195
|
+
? ""
|
|
21196
|
+
: progressBarUnit + clamp(progress, 0, goal)));
|
|
21197
|
+
items.push(h("div", { class: "remain" }));
|
|
21198
|
+
items.push(h("div", { class: "progress bg" }, goal));
|
|
21199
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
21200
|
+
}
|
|
21201
|
+
function addSteps() {
|
|
21202
|
+
let ratio = 1 / goal;
|
|
21203
|
+
for (let i = 1; i < goal; i++) {
|
|
21204
|
+
columns += ratio + "fr 0fr ";
|
|
21205
|
+
if (i > progress) {
|
|
21206
|
+
items.push(h("div", { class: "remain" }));
|
|
21207
|
+
items.push(h("div", { class: "empty" }, i));
|
|
21208
|
+
}
|
|
21209
|
+
else {
|
|
21210
|
+
items.push(h("div", { class: "filled" }));
|
|
21211
|
+
items.push(h("div", { class: "progress" }, i));
|
|
21212
|
+
}
|
|
21213
|
+
}
|
|
21214
|
+
columns += ratio + "fr 0fr ";
|
|
21215
|
+
// reward success
|
|
21216
|
+
if (goal <= progress) {
|
|
21217
|
+
columns += "0fr ";
|
|
21218
|
+
items.push(h("div", { class: "filled" }));
|
|
21219
|
+
items.push(h("div", { class: "progress bg" }, goal));
|
|
21220
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
21221
|
+
}
|
|
21222
|
+
// reward fail
|
|
21223
|
+
else {
|
|
21224
|
+
columns += "0fr ";
|
|
21225
|
+
items.push(h("div", { class: "remain" }));
|
|
21226
|
+
items.push(h("div", { class: "empty bg" }, goal));
|
|
21227
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
21228
|
+
}
|
|
21229
|
+
}
|
|
21230
|
+
function addLinearRepeatable() {
|
|
21231
|
+
let repetitions = Math.floor(progress / goal);
|
|
21232
|
+
let ratio = ((progress % goal) / goal) * 0.5;
|
|
21233
|
+
// 0 repetition
|
|
21234
|
+
if (repetitions == 0) {
|
|
21235
|
+
columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
21236
|
+
items.push(h("div", { class: "filled" }));
|
|
21237
|
+
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
|
|
21238
|
+
items.push(h("div", { class: "remain" }));
|
|
21239
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21240
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
21241
|
+
items.push(h("div", { class: "remain" }));
|
|
21242
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21243
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21244
|
+
}
|
|
21245
|
+
// single repetition
|
|
21246
|
+
else if (repetitions == 1) {
|
|
21247
|
+
columns =
|
|
21248
|
+
"0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
|
|
21249
|
+
items.push(h("div", { class: "filled" }));
|
|
21250
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
21251
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
21252
|
+
items.push(h("div", { class: "filled" }));
|
|
21253
|
+
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
|
|
21254
|
+
items.push(h("div", { class: "remain" }));
|
|
21255
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
21256
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21257
|
+
}
|
|
21258
|
+
// multiple repetitions
|
|
21259
|
+
else {
|
|
21260
|
+
columns =
|
|
21261
|
+
"0fr 0fr 0.5fr 0fr 0fr " +
|
|
21262
|
+
ratio +
|
|
21263
|
+
"fr 0fr " +
|
|
21264
|
+
(0.5 - ratio) +
|
|
21265
|
+
"fr 0fr 0fr";
|
|
21266
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
|
|
21267
|
+
items.push(h("div", { class: "gift start" }, gift1));
|
|
21268
|
+
items.push(h("div", { class: "filled" }));
|
|
21269
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
|
|
21270
|
+
items.push(h("div", { class: "gift" }, gift2));
|
|
21271
|
+
items.push(h("div", { class: "filled" }));
|
|
21272
|
+
items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
|
|
21273
|
+
items.push(h("div", { class: "remain" }));
|
|
21274
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
|
|
21275
|
+
items.push(h("div", { class: "gift bw" }, gift3));
|
|
21276
|
+
}
|
|
21277
|
+
}
|
|
21278
|
+
function addStepsRepeatable() {
|
|
21279
|
+
let repetitions = Math.floor(progress / goal);
|
|
21280
|
+
// no or single repetition
|
|
21281
|
+
if (repetitions < 2) {
|
|
21282
|
+
let ratio = 1 / goal;
|
|
21283
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21284
|
+
columns += ratio + "fr 0fr ";
|
|
21285
|
+
if (i > progress) {
|
|
21286
|
+
if (i == goal) {
|
|
21287
|
+
columns += "0fr ";
|
|
21288
|
+
items.push(h("div", { class: "remain" }));
|
|
21289
|
+
items.push(h("div", { class: "empty bg" }, goal));
|
|
21290
|
+
items.push(h("div", { class: "gift bw" }, gift1));
|
|
21291
|
+
}
|
|
21292
|
+
else if (i == goal * 2) {
|
|
21293
|
+
columns += "0fr 0fr";
|
|
21294
|
+
items.push(h("div", { class: "remain" }));
|
|
21295
|
+
items.push(h("div", { class: "empty bg" }, goal * 2));
|
|
21296
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
21297
|
+
}
|
|
21298
|
+
else {
|
|
21299
|
+
items.push(h("div", { class: "remain" }));
|
|
21300
|
+
items.push(h("div", { class: "empty" }, progressBarUnit + i));
|
|
21301
|
+
}
|
|
21302
|
+
}
|
|
21303
|
+
else if (i == goal) {
|
|
21304
|
+
columns += "0fr ";
|
|
21305
|
+
items.push(h("div", { class: "filled" }));
|
|
21306
|
+
items.push(h("div", { class: "progress bg" }, i));
|
|
21307
|
+
items.push(h("div", { class: "gift" }, gift3));
|
|
21308
|
+
}
|
|
21309
|
+
else {
|
|
21310
|
+
items.push(h("div", { class: "filled" }));
|
|
21311
|
+
items.push(h("div", { class: "progress" }, i));
|
|
21312
|
+
}
|
|
21313
|
+
}
|
|
21314
|
+
}
|
|
21315
|
+
// case repetition many
|
|
21316
|
+
else {
|
|
21317
|
+
let position = (progress % goal) + goal;
|
|
21318
|
+
let ratio = 1 / goal;
|
|
21319
|
+
columns += "0fr 0fr ";
|
|
21320
|
+
items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
|
|
21321
|
+
items.push(h("div", { class: "gift start" }, gift1));
|
|
21322
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
21323
|
+
columns += ratio + "fr 0fr ";
|
|
21324
|
+
if (i <= goal) {
|
|
21325
|
+
if (i == goal) {
|
|
21326
|
+
columns += "0fr ";
|
|
21327
|
+
items.push(h("div", { class: "filled" }));
|
|
21328
|
+
items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
|
|
21329
|
+
items.push(h("div", { class: "gift" }, gift2));
|
|
21330
|
+
}
|
|
21331
|
+
else {
|
|
21332
|
+
items.push(h("div", { class: "filled" }));
|
|
21333
|
+
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21334
|
+
}
|
|
21335
|
+
}
|
|
21336
|
+
else if (i > position) {
|
|
21337
|
+
if (i == goal * 2) {
|
|
21338
|
+
columns += "0fr 0fr";
|
|
21339
|
+
items.push(h("div", { class: "remain" }));
|
|
21340
|
+
items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
|
|
21341
|
+
items.push(h("div", { class: "gift bw" }, gift3));
|
|
21342
|
+
}
|
|
21343
|
+
else {
|
|
21344
|
+
items.push(h("div", { class: "remain" }));
|
|
21345
|
+
items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
|
|
21346
|
+
}
|
|
21347
|
+
}
|
|
21348
|
+
else {
|
|
21349
|
+
items.push(h("div", { class: "filled" }));
|
|
21350
|
+
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
21351
|
+
}
|
|
21352
|
+
}
|
|
21353
|
+
}
|
|
21354
|
+
}
|
|
21355
|
+
}
|
|
21356
|
+
|
|
21357
|
+
function TaskCardView(props) {
|
|
21358
|
+
const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
|
|
21359
|
+
console.log({ props });
|
|
21360
|
+
const checkmark_circle$1 = checkmark_circle();
|
|
21361
|
+
const arrow_left_right$1 = arrow_left_right();
|
|
21362
|
+
const style = {
|
|
21363
|
+
HostBlock: HostBlock,
|
|
21364
|
+
TaskCard: {
|
|
21365
|
+
"& .main > div": {
|
|
21366
|
+
margin: "var(--sl-spacing-medium)",
|
|
21367
|
+
},
|
|
21368
|
+
"& .main": {
|
|
21369
|
+
position: "relative",
|
|
21370
|
+
boxSizing: "border-box",
|
|
21371
|
+
minWidth: "347px",
|
|
21372
|
+
background: "var(--sl-color-white)",
|
|
21373
|
+
border: "1px solid var(--sl-color-gray-300)",
|
|
21374
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
21375
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21376
|
+
lineHeight: "var(--sl-line-height-dense)",
|
|
21377
|
+
},
|
|
21378
|
+
"& .main.complete": {
|
|
21379
|
+
background: "var(--sl-color-success-50)",
|
|
21380
|
+
borderColor: "var(--sl-color-success-700)",
|
|
21381
|
+
},
|
|
21382
|
+
},
|
|
21383
|
+
Header: {
|
|
21384
|
+
display: "flex",
|
|
21385
|
+
"& .icon": {
|
|
21386
|
+
alignSelf: "center",
|
|
21387
|
+
lineHeight: "0",
|
|
21388
|
+
color: "var(--sl-color-success-700)",
|
|
21389
|
+
fontSize: "var(--sl-font-size-large)",
|
|
21390
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
21391
|
+
},
|
|
21392
|
+
"& .value": {
|
|
21393
|
+
alignSelf: "center",
|
|
21394
|
+
color: "var(--sl-color-black)",
|
|
21395
|
+
fontSize: "var(--sl-font-size-x-large)",
|
|
21396
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21397
|
+
lineHeight: "100%",
|
|
21398
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21399
|
+
},
|
|
21400
|
+
"& .text": {
|
|
21401
|
+
alignSelf: "end",
|
|
21402
|
+
textTransform: "uppercase",
|
|
21403
|
+
color: "var(--sl-color-gray-600)",
|
|
21404
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21405
|
+
lineHeight: "var(--sl-font-size-medium)",
|
|
21406
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21407
|
+
},
|
|
21408
|
+
},
|
|
21409
|
+
Title: {
|
|
21410
|
+
color: "var(--sl-color-black)",
|
|
21411
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21412
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21413
|
+
},
|
|
21414
|
+
Footer: {
|
|
21415
|
+
display: "flex",
|
|
21416
|
+
"& .icon": {
|
|
21417
|
+
fontSize: "var(--sl-font-size-xx-small)",
|
|
21418
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
21419
|
+
},
|
|
21420
|
+
"& .text": {
|
|
21421
|
+
marginTop: "auto",
|
|
21422
|
+
verticalAlign: "text-bottom",
|
|
21423
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21424
|
+
color: "var(--sl-color-gray-600)",
|
|
21425
|
+
},
|
|
21426
|
+
"& .success": {
|
|
21427
|
+
color: "var(--sl-color-success-600)!important",
|
|
21428
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21429
|
+
},
|
|
21430
|
+
"& .action": {
|
|
21431
|
+
marginTop: "auto",
|
|
21432
|
+
marginLeft: "auto",
|
|
21433
|
+
},
|
|
21434
|
+
"& sl-button.action::part(base) ": {
|
|
21435
|
+
color: "var(--sl-color-white)",
|
|
21436
|
+
background: "var(--sl-color-primary-500)",
|
|
21437
|
+
border: "1px solid var(--sl-color-primary-500)",
|
|
21438
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
21439
|
+
},
|
|
21440
|
+
"& sl-button.action.completed::part(base) ": {
|
|
21441
|
+
border: "1px solid var(--sl-color-gray-300)!important",
|
|
21442
|
+
background: "var(--sl-color-gray-300)!important",
|
|
21443
|
+
},
|
|
21444
|
+
},
|
|
21445
|
+
};
|
|
21446
|
+
jss.setup(create());
|
|
21447
|
+
const sheet = jss.createStyleSheet(style);
|
|
21448
|
+
const styleString = sheet.toString();
|
|
21449
|
+
const showComplete = progress >= goal;
|
|
21450
|
+
const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
|
|
21451
|
+
const taskComplete = showComplete && repeatable === false;
|
|
21452
|
+
console.log({ showProgressBar, loading });
|
|
21453
|
+
return (h("div", { class: sheet.classes.TaskCard },
|
|
21454
|
+
h("div", { class: showComplete ? "main complete" : "main" },
|
|
21455
|
+
h("style", { type: "text/css" }, styleString),
|
|
21456
|
+
h("div", { class: sheet.classes.Header },
|
|
21457
|
+
showComplete && h("span", { class: "icon" }, checkmark_circle$1),
|
|
21458
|
+
h("span", { class: "value" }, rewardAmount),
|
|
21459
|
+
h("span", { class: "text" }, rewardUnit)),
|
|
21460
|
+
h("div", { class: sheet.classes.Title }, cardTitle),
|
|
21461
|
+
h(Details, { description: description }),
|
|
21462
|
+
showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props, { complete: taskComplete }))),
|
|
21463
|
+
h("div", { class: sheet.classes.Footer },
|
|
21464
|
+
h("span", { class: "text" },
|
|
21465
|
+
repeatable && (h("div", null,
|
|
21466
|
+
h("span", { class: repetitions > 0 ? "icon success" : "icon" }, arrow_left_right$1),
|
|
21467
|
+
h("span", { class: repetitions > 0 ? "success" : "" },
|
|
21468
|
+
"Completed ",
|
|
21469
|
+
repetitions,
|
|
21470
|
+
" times"))),
|
|
21471
|
+
showExpiry && (h("span", null,
|
|
21472
|
+
"Ends ",
|
|
21473
|
+
" ",
|
|
21474
|
+
dateExpires))),
|
|
21475
|
+
h("sl-button", { class: taskComplete ? "action completed" : "action", size: "small", onClick: () => window.open(buttonLink), disabled: taskComplete }, buttonText)))));
|
|
21476
|
+
}
|
|
21477
|
+
function Details(props) {
|
|
21478
|
+
const style = {
|
|
21479
|
+
Description: {
|
|
21480
|
+
"& input[type=checkbox]": {
|
|
21481
|
+
display: "none",
|
|
21482
|
+
},
|
|
21483
|
+
"& input:checked ~ .details": {
|
|
21484
|
+
transform: "rotate(-180deg)",
|
|
21485
|
+
},
|
|
21486
|
+
"& .details": {
|
|
21487
|
+
position: "absolute",
|
|
21488
|
+
top: "var(--sl-spacing-medium)",
|
|
21489
|
+
right: "var(--sl-spacing-medium)",
|
|
21490
|
+
color: "var(--sl-color-gray-700)",
|
|
21491
|
+
fontSize: "var(--sl-font-size-large)",
|
|
21492
|
+
"& :hover": {
|
|
21493
|
+
color: "var(--sl-color-primary-700)",
|
|
21494
|
+
},
|
|
21495
|
+
transformOrigin: "50% 37%",
|
|
21496
|
+
transition: "transform var(--sl-transition-medium) ease",
|
|
21497
|
+
},
|
|
21498
|
+
"& input:checked ~ .summary": {
|
|
21499
|
+
transition: "max-height var(--sl-transition-medium) ease",
|
|
21500
|
+
maxHeight: "300px",
|
|
21501
|
+
},
|
|
21502
|
+
"& .summary": {
|
|
21503
|
+
display: "block",
|
|
21504
|
+
overflow: "hidden",
|
|
21505
|
+
color: "var(--sl-color-gray-700)",
|
|
21506
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21507
|
+
maxHeight: "0px",
|
|
21508
|
+
transition: "max-height var(--sl-transition-fast) ease-out",
|
|
21509
|
+
},
|
|
21510
|
+
},
|
|
21511
|
+
};
|
|
21512
|
+
jss.setup(create());
|
|
21513
|
+
const sheet = jss.createStyleSheet(style);
|
|
21514
|
+
const styleString = sheet.toString();
|
|
21515
|
+
const rid = Math.random().toString(36).slice(2);
|
|
21516
|
+
return (h("div", null,
|
|
21517
|
+
h("style", { type: "text/css" }, styleString),
|
|
21518
|
+
h("span", { class: sheet.classes.Description },
|
|
21519
|
+
h("input", { type: "checkbox", id: "details-" + rid }),
|
|
21520
|
+
h("label", { class: "details", htmlFor: "details-" + rid },
|
|
21521
|
+
h("sl-icon", { name: "chevron-down" })),
|
|
21522
|
+
h("span", { class: "summary" }, props.description))));
|
|
21523
|
+
}
|
|
21524
|
+
|
|
21525
|
+
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 |";
|
|
21526
|
+
|
|
21527
|
+
const TaskCard_stories = {
|
|
21528
|
+
title: "Components/Task Card/",
|
|
21529
|
+
parameters: {
|
|
21530
|
+
scenario: scenario$5,
|
|
21531
|
+
},
|
|
19786
21532
|
};
|
|
19787
|
-
const
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
|
|
21533
|
+
const resizable = {
|
|
21534
|
+
width: "347px",
|
|
21535
|
+
minWidth: "347px",
|
|
21536
|
+
resize: "horizontal",
|
|
21537
|
+
height: "fit-content",
|
|
21538
|
+
overflow: "hidden",
|
|
19793
21539
|
};
|
|
19794
|
-
const
|
|
19795
|
-
|
|
21540
|
+
const NotRepeatable = () => {
|
|
21541
|
+
const oneAction = {
|
|
21542
|
+
rewardAmount: 20,
|
|
21543
|
+
showExpiry: false,
|
|
21544
|
+
rewardUnit: "Points",
|
|
21545
|
+
cardTitle: "Complete a survey",
|
|
21546
|
+
repeatable: false,
|
|
21547
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21548
|
+
buttonText: "Take survey",
|
|
21549
|
+
goal: 1,
|
|
21550
|
+
buttonLink: "https://example.com/",
|
|
21551
|
+
showProgressBar: false,
|
|
21552
|
+
loading: false,
|
|
21553
|
+
};
|
|
21554
|
+
const coupleActions = {
|
|
21555
|
+
rewardAmount: 40,
|
|
21556
|
+
rewardUnit: "Points",
|
|
21557
|
+
cardTitle: "Comment on 5 articles",
|
|
21558
|
+
showProgressBar: true,
|
|
21559
|
+
showExpiry: false,
|
|
21560
|
+
goal: 5,
|
|
21561
|
+
repeatable: false,
|
|
21562
|
+
steps: true,
|
|
21563
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21564
|
+
buttonText: "Start reading",
|
|
21565
|
+
buttonLink: "https://example.com/",
|
|
21566
|
+
loading: false,
|
|
21567
|
+
};
|
|
21568
|
+
const manyActions = {
|
|
21569
|
+
rewardAmount: 150,
|
|
21570
|
+
rewardUnit: "Points",
|
|
21571
|
+
cardTitle: "Spend $500 at our Store",
|
|
21572
|
+
showProgressBar: true,
|
|
21573
|
+
showExpiry: false,
|
|
21574
|
+
goal: 500,
|
|
21575
|
+
repeatable: false,
|
|
21576
|
+
progressBarUnit: "$",
|
|
21577
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21578
|
+
buttonText: "Visit our Store",
|
|
21579
|
+
buttonLink: "https://example.com/",
|
|
21580
|
+
loading: false,
|
|
21581
|
+
};
|
|
21582
|
+
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21583
|
+
h("div", { style: resizable },
|
|
21584
|
+
h("h4", null, "One Action"),
|
|
21585
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21586
|
+
" ",
|
|
21587
|
+
h("h5", null),
|
|
21588
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21589
|
+
" ",
|
|
21590
|
+
h("h5", null)),
|
|
21591
|
+
h("div", { style: resizable },
|
|
21592
|
+
h("h4", null, "A Couple Actions"),
|
|
21593
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21594
|
+
" ",
|
|
21595
|
+
h("h5", null),
|
|
21596
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21597
|
+
" ",
|
|
21598
|
+
h("h5", null),
|
|
21599
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21600
|
+
" ",
|
|
21601
|
+
h("h5", null)),
|
|
21602
|
+
h("div", { style: resizable },
|
|
21603
|
+
h("h4", null, "Many Actions"),
|
|
21604
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21605
|
+
" ",
|
|
21606
|
+
h("h5", null),
|
|
21607
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21608
|
+
" ",
|
|
21609
|
+
h("h5", null),
|
|
21610
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21611
|
+
" ",
|
|
21612
|
+
h("h5", null))));
|
|
21613
|
+
};
|
|
21614
|
+
const NotRepeatableWithExpiry = () => {
|
|
21615
|
+
const oneAction = {
|
|
21616
|
+
rewardAmount: 20,
|
|
21617
|
+
rewardUnit: "Points",
|
|
21618
|
+
cardTitle: "Complete a survey",
|
|
21619
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21620
|
+
buttonText: "Take survey",
|
|
21621
|
+
goal: 1,
|
|
21622
|
+
showExpiry: true,
|
|
21623
|
+
repeatable: false,
|
|
21624
|
+
dateExpires: "Nov 1, 2021",
|
|
21625
|
+
buttonLink: "https://example.com/",
|
|
21626
|
+
showProgressBar: false,
|
|
21627
|
+
loading: false,
|
|
21628
|
+
};
|
|
21629
|
+
const coupleActions = {
|
|
21630
|
+
rewardAmount: 40,
|
|
21631
|
+
rewardUnit: "Points",
|
|
21632
|
+
cardTitle: "Comment on 5 articles",
|
|
21633
|
+
showProgressBar: true,
|
|
21634
|
+
goal: 5,
|
|
21635
|
+
steps: true,
|
|
21636
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21637
|
+
buttonText: "Start reading",
|
|
21638
|
+
showExpiry: true,
|
|
21639
|
+
repeatable: false,
|
|
21640
|
+
dateExpires: "Nov 1, 2021",
|
|
21641
|
+
buttonLink: "https://example.com/",
|
|
21642
|
+
loading: false,
|
|
21643
|
+
};
|
|
21644
|
+
const manyActions = {
|
|
21645
|
+
rewardAmount: 150,
|
|
21646
|
+
rewardUnit: "Points",
|
|
21647
|
+
repeatable: false,
|
|
21648
|
+
cardTitle: "Spend $500 at our Store",
|
|
21649
|
+
showProgressBar: true,
|
|
21650
|
+
goal: 500,
|
|
21651
|
+
progressBarUnit: "$",
|
|
21652
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21653
|
+
buttonText: "Visit our Store",
|
|
21654
|
+
showExpiry: true,
|
|
21655
|
+
dateExpires: "Nov 1, 2021",
|
|
21656
|
+
buttonLink: "https://example.com/",
|
|
21657
|
+
loading: false,
|
|
21658
|
+
};
|
|
21659
|
+
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21660
|
+
h("div", { style: resizable },
|
|
21661
|
+
h("h4", null, "One Action"),
|
|
21662
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21663
|
+
" ",
|
|
21664
|
+
h("h5", null),
|
|
21665
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21666
|
+
" ",
|
|
21667
|
+
h("h5", null)),
|
|
21668
|
+
h("div", { style: resizable },
|
|
21669
|
+
h("h4", null, "A Couple Actions"),
|
|
21670
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21671
|
+
" ",
|
|
21672
|
+
h("h5", null),
|
|
21673
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21674
|
+
" ",
|
|
21675
|
+
h("h5", null),
|
|
21676
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21677
|
+
" ",
|
|
21678
|
+
h("h5", null)),
|
|
21679
|
+
h("div", { style: resizable },
|
|
21680
|
+
h("h4", null, "Many Actions"),
|
|
21681
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21682
|
+
" ",
|
|
21683
|
+
h("h5", null),
|
|
21684
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21685
|
+
" ",
|
|
21686
|
+
h("h5", null),
|
|
21687
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21688
|
+
" ",
|
|
21689
|
+
h("h5", null))));
|
|
21690
|
+
};
|
|
21691
|
+
const Repeatable = () => {
|
|
21692
|
+
const oneAction = {
|
|
21693
|
+
rewardAmount: 20,
|
|
21694
|
+
rewardUnit: "Points",
|
|
21695
|
+
showExpiry: false,
|
|
21696
|
+
cardTitle: "Complete a survey",
|
|
21697
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21698
|
+
buttonText: "Take survey",
|
|
21699
|
+
goal: 1,
|
|
21700
|
+
repeatable: true,
|
|
21701
|
+
buttonLink: "https://example.com/",
|
|
21702
|
+
showProgressBar: false,
|
|
21703
|
+
loading: false,
|
|
21704
|
+
};
|
|
21705
|
+
const coupleActions = {
|
|
21706
|
+
rewardAmount: 40,
|
|
21707
|
+
rewardUnit: "Points",
|
|
21708
|
+
showExpiry: false,
|
|
21709
|
+
cardTitle: "Comment on 5 articles",
|
|
21710
|
+
showProgressBar: true,
|
|
21711
|
+
repeatable: true,
|
|
21712
|
+
goal: 5,
|
|
21713
|
+
steps: true,
|
|
21714
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21715
|
+
buttonText: "Start reading",
|
|
21716
|
+
buttonLink: "https://example.com/",
|
|
21717
|
+
loading: false,
|
|
21718
|
+
};
|
|
21719
|
+
const manyActions = {
|
|
21720
|
+
rewardAmount: 150,
|
|
21721
|
+
rewardUnit: "Points",
|
|
21722
|
+
showExpiry: false,
|
|
21723
|
+
cardTitle: "Spend $500 at our Store",
|
|
21724
|
+
showProgressBar: true,
|
|
21725
|
+
repeatable: true,
|
|
21726
|
+
goal: 500,
|
|
21727
|
+
progressBarUnit: "$",
|
|
21728
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21729
|
+
buttonText: "Visit our Store",
|
|
21730
|
+
buttonLink: "https://example.com/",
|
|
21731
|
+
loading: false,
|
|
21732
|
+
};
|
|
21733
|
+
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21734
|
+
h("div", { style: resizable },
|
|
21735
|
+
h("h4", null, "One Action"),
|
|
21736
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21737
|
+
" ",
|
|
21738
|
+
h("h5", null),
|
|
21739
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21740
|
+
" ",
|
|
21741
|
+
h("h5", null)),
|
|
21742
|
+
h("div", { style: resizable },
|
|
21743
|
+
h("h4", null, "A Couple Actions"),
|
|
21744
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21745
|
+
" ",
|
|
21746
|
+
h("h5", null),
|
|
21747
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21748
|
+
" ",
|
|
21749
|
+
h("h5", null),
|
|
21750
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21751
|
+
" ",
|
|
21752
|
+
h("h5", null),
|
|
21753
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21754
|
+
" ",
|
|
21755
|
+
h("h5", null)),
|
|
21756
|
+
h("div", { style: resizable },
|
|
21757
|
+
h("h4", null, "Many Actions"),
|
|
21758
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21759
|
+
" ",
|
|
21760
|
+
h("h5", null),
|
|
21761
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21762
|
+
" ",
|
|
21763
|
+
h("h5", null),
|
|
21764
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21765
|
+
" ",
|
|
21766
|
+
h("h5", null),
|
|
21767
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21768
|
+
" ",
|
|
21769
|
+
h("h5", null))));
|
|
21770
|
+
};
|
|
21771
|
+
const RepeatableWithExpiry = () => {
|
|
21772
|
+
const oneAction = {
|
|
21773
|
+
rewardAmount: 20,
|
|
21774
|
+
rewardUnit: "Points",
|
|
21775
|
+
cardTitle: "Complete a survey",
|
|
21776
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21777
|
+
buttonText: "Take survey",
|
|
21778
|
+
goal: 1,
|
|
21779
|
+
repeatable: true,
|
|
21780
|
+
showExpiry: true,
|
|
21781
|
+
dateExpires: "Nov 1, 2021",
|
|
21782
|
+
buttonLink: "https://example.com/",
|
|
21783
|
+
showProgressBar: false,
|
|
21784
|
+
loading: false,
|
|
21785
|
+
};
|
|
21786
|
+
const coupleActions = {
|
|
21787
|
+
rewardAmount: 40,
|
|
21788
|
+
rewardUnit: "Points",
|
|
21789
|
+
cardTitle: "Comment on 5 articles",
|
|
21790
|
+
showProgressBar: true,
|
|
21791
|
+
repeatable: true,
|
|
21792
|
+
goal: 5,
|
|
21793
|
+
steps: true,
|
|
21794
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21795
|
+
buttonText: "Start reading",
|
|
21796
|
+
showExpiry: true,
|
|
21797
|
+
dateExpires: "Nov 1, 2021",
|
|
21798
|
+
buttonLink: "https://example.com/",
|
|
21799
|
+
loading: false,
|
|
21800
|
+
};
|
|
21801
|
+
const manyActions = {
|
|
21802
|
+
rewardAmount: 150,
|
|
21803
|
+
rewardUnit: "Points",
|
|
21804
|
+
cardTitle: "Spend $500 at our Store",
|
|
21805
|
+
showProgressBar: true,
|
|
21806
|
+
repeatable: true,
|
|
21807
|
+
goal: 500,
|
|
21808
|
+
progressBarUnit: "$",
|
|
21809
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21810
|
+
buttonText: "Visit our Store",
|
|
21811
|
+
showExpiry: true,
|
|
21812
|
+
dateExpires: "Nov 1, 2021",
|
|
21813
|
+
buttonLink: "https://example.com/",
|
|
21814
|
+
loading: false,
|
|
21815
|
+
};
|
|
21816
|
+
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21817
|
+
h("div", { style: resizable },
|
|
21818
|
+
h("h4", null, "One Action"),
|
|
21819
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21820
|
+
" ",
|
|
21821
|
+
h("h5", null),
|
|
21822
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21823
|
+
" ",
|
|
21824
|
+
h("h5", null)),
|
|
21825
|
+
h("div", { style: resizable },
|
|
21826
|
+
h("h4", null, "A Couple Actions"),
|
|
21827
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21828
|
+
" ",
|
|
21829
|
+
h("h5", null),
|
|
21830
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21831
|
+
" ",
|
|
21832
|
+
h("h5", null),
|
|
21833
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7 })),
|
|
21834
|
+
" ",
|
|
21835
|
+
h("h5", null),
|
|
21836
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
21837
|
+
" ",
|
|
21838
|
+
h("h5", null)),
|
|
21839
|
+
h("div", { style: resizable },
|
|
21840
|
+
h("h4", null, "Many Actions"),
|
|
21841
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21842
|
+
" ",
|
|
21843
|
+
h("h5", null),
|
|
21844
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21845
|
+
" ",
|
|
21846
|
+
h("h5", null),
|
|
21847
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 650 })),
|
|
21848
|
+
" ",
|
|
21849
|
+
h("h5", null),
|
|
21850
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
21851
|
+
" ",
|
|
21852
|
+
h("h5", null))));
|
|
19796
21853
|
};
|
|
19797
21854
|
|
|
19798
|
-
const
|
|
21855
|
+
const TaskCard$1 = /*#__PURE__*/Object.freeze({
|
|
19799
21856
|
__proto__: null,
|
|
19800
|
-
'default':
|
|
19801
|
-
|
|
19802
|
-
|
|
21857
|
+
'default': TaskCard_stories,
|
|
21858
|
+
NotRepeatable: NotRepeatable,
|
|
21859
|
+
NotRepeatableWithExpiry: NotRepeatableWithExpiry,
|
|
21860
|
+
Repeatable: Repeatable,
|
|
21861
|
+
RepeatableWithExpiry: RepeatableWithExpiry
|
|
19803
21862
|
});
|
|
19804
21863
|
|
|
19805
|
-
|
|
19806
|
-
|
|
21864
|
+
/**
|
|
21865
|
+
* Displays a cartesian product of the input props
|
|
21866
|
+
*
|
|
21867
|
+
* @returns
|
|
21868
|
+
*/
|
|
21869
|
+
function MatrixStory({ matrix, props, Component, }) {
|
|
21870
|
+
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21871
|
+
const propValues = matrix[propKey];
|
|
21872
|
+
return propValues.map((val) => {
|
|
21873
|
+
return {
|
|
21874
|
+
[propKey]: val,
|
|
21875
|
+
};
|
|
21876
|
+
});
|
|
21877
|
+
});
|
|
21878
|
+
const combinations = cartesian(...propMatrix);
|
|
21879
|
+
const propsCombinations = combinations.map((combo) => {
|
|
21880
|
+
return combo.reduce((props, prop) => {
|
|
21881
|
+
return {
|
|
21882
|
+
...props,
|
|
21883
|
+
...prop,
|
|
21884
|
+
};
|
|
21885
|
+
}, {});
|
|
21886
|
+
});
|
|
21887
|
+
return propsCombinations.map((combo) => {
|
|
21888
|
+
const example = { ...props, ...combo };
|
|
21889
|
+
return (h("div", null,
|
|
21890
|
+
h(PropsTable, { values: example }),
|
|
21891
|
+
h("hr", null),
|
|
21892
|
+
h(Component, Object.assign({}, example))));
|
|
21893
|
+
});
|
|
21894
|
+
}
|
|
21895
|
+
function PropsTable({ values }) {
|
|
21896
|
+
return (h("table", null,
|
|
21897
|
+
h("tbody", null, Object.keys(values).map((key) => {
|
|
21898
|
+
return (h("tr", null,
|
|
21899
|
+
h("th", null, key),
|
|
21900
|
+
h("td", null, JSON.stringify(values[key]))));
|
|
21901
|
+
}))));
|
|
21902
|
+
}
|
|
21903
|
+
/**
|
|
21904
|
+
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21905
|
+
*
|
|
21906
|
+
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21907
|
+
*
|
|
21908
|
+
* @param args - an array of arrays
|
|
21909
|
+
* @returns combinations of the elements in those array
|
|
21910
|
+
*/
|
|
21911
|
+
function cartesian(...args) {
|
|
21912
|
+
var r = [], max = args.length - 1;
|
|
21913
|
+
function helper(arr, i) {
|
|
21914
|
+
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21915
|
+
var a = arr.slice(0); // clone arr
|
|
21916
|
+
a.push(args[i][j]);
|
|
21917
|
+
if (i == max)
|
|
21918
|
+
r.push(a);
|
|
21919
|
+
else
|
|
21920
|
+
helper(a, i + 1);
|
|
21921
|
+
}
|
|
21922
|
+
}
|
|
21923
|
+
helper([], 0);
|
|
21924
|
+
return r;
|
|
21925
|
+
}
|
|
21926
|
+
|
|
21927
|
+
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 |";
|
|
21928
|
+
|
|
21929
|
+
const progressBar_stories = {
|
|
21930
|
+
title: "Components/Task Card Progress Bar",
|
|
21931
|
+
parameters: {
|
|
21932
|
+
scenario: scenario$6,
|
|
21933
|
+
},
|
|
19807
21934
|
};
|
|
19808
|
-
const
|
|
19809
|
-
return
|
|
19810
|
-
initValue: "",
|
|
19811
|
-
states: {
|
|
19812
|
-
enableValidation: true,
|
|
19813
|
-
validationErrors: {},
|
|
19814
|
-
content: {
|
|
19815
|
-
fieldLabel: "Password",
|
|
19816
|
-
},
|
|
19817
|
-
},
|
|
19818
|
-
} }));
|
|
21935
|
+
const Default$a = () => {
|
|
21936
|
+
return h(ProgressBarView, null);
|
|
19819
21937
|
};
|
|
19820
|
-
const
|
|
19821
|
-
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
},
|
|
19829
|
-
},
|
|
19830
|
-
} }));
|
|
21938
|
+
const ProgressBar$1 = () => {
|
|
21939
|
+
const props = {
|
|
21940
|
+
progress: 0,
|
|
21941
|
+
goal: 500,
|
|
21942
|
+
progressBarUnit: "$",
|
|
21943
|
+
};
|
|
21944
|
+
return (h("div", null,
|
|
21945
|
+
h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
|
|
19831
21946
|
};
|
|
19832
|
-
const
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
21947
|
+
const ProgressBarSteps = () => {
|
|
21948
|
+
const props = {
|
|
21949
|
+
progress: 0,
|
|
21950
|
+
steps: true,
|
|
21951
|
+
goal: 5,
|
|
21952
|
+
progressBarUnit: "$",
|
|
21953
|
+
};
|
|
21954
|
+
return (h("div", null,
|
|
21955
|
+
h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
|
|
21956
|
+
};
|
|
21957
|
+
const ProgressBarRepeatable = () => {
|
|
21958
|
+
const props = {
|
|
21959
|
+
progress: 0,
|
|
21960
|
+
goal: 500,
|
|
21961
|
+
progressBarUnit: "$",
|
|
21962
|
+
repeatable: true,
|
|
21963
|
+
};
|
|
21964
|
+
return (h("div", null,
|
|
21965
|
+
h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
|
|
21966
|
+
};
|
|
21967
|
+
const ProgressBarStepsRepeatable = () => {
|
|
21968
|
+
const props = {
|
|
21969
|
+
progress: 0,
|
|
21970
|
+
steps: true,
|
|
21971
|
+
goal: 5,
|
|
21972
|
+
progressBarUnit: "$",
|
|
21973
|
+
repeatable: true,
|
|
21974
|
+
};
|
|
21975
|
+
return (h("div", null,
|
|
21976
|
+
h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
|
|
19843
21977
|
};
|
|
19844
21978
|
|
|
19845
|
-
const
|
|
21979
|
+
const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
|
|
19846
21980
|
__proto__: null,
|
|
19847
|
-
'default':
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
21981
|
+
'default': progressBar_stories,
|
|
21982
|
+
Default: Default$a,
|
|
21983
|
+
ProgressBar: ProgressBar$1,
|
|
21984
|
+
ProgressBarSteps: ProgressBarSteps,
|
|
21985
|
+
ProgressBarRepeatable: ProgressBarRepeatable,
|
|
21986
|
+
ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
|
|
19851
21987
|
});
|
|
19852
21988
|
|
|
19853
21989
|
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";
|
|
@@ -22862,7 +24998,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
|
|
|
22862
24998
|
|
|
22863
24999
|
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";
|
|
22864
25000
|
|
|
22865
|
-
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; };
|
|
25001
|
+
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";
|
|
22866
25002
|
|
|
22867
25003
|
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";
|
|
22868
25004
|
|
|
@@ -23068,7 +25204,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
|
|
|
23068
25204
|
const PoweredByImg_stories = {
|
|
23069
25205
|
title: "Powered By",
|
|
23070
25206
|
};
|
|
23071
|
-
const Default$
|
|
25207
|
+
const Default$b = () => {
|
|
23072
25208
|
return h(PoweredByImg$1, null);
|
|
23073
25209
|
};
|
|
23074
25210
|
const CustomColor = () => {
|
|
@@ -23081,17 +25217,17 @@ const CustomWidthAndHeight = () => {
|
|
|
23081
25217
|
const PoweredByImg = /*#__PURE__*/Object.freeze({
|
|
23082
25218
|
__proto__: null,
|
|
23083
25219
|
'default': PoweredByImg_stories,
|
|
23084
|
-
Default: Default$
|
|
25220
|
+
Default: Default$b,
|
|
23085
25221
|
CustomColor: CustomColor,
|
|
23086
25222
|
CustomWidthAndHeight: CustomWidthAndHeight
|
|
23087
25223
|
});
|
|
23088
25224
|
|
|
23089
|
-
const scenario$
|
|
25225
|
+
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";
|
|
23090
25226
|
|
|
23091
25227
|
const PortalFooter_stories = {
|
|
23092
25228
|
title: "Portal Footer",
|
|
23093
25229
|
parameters: {
|
|
23094
|
-
scenario: scenario$
|
|
25230
|
+
scenario: scenario$7,
|
|
23095
25231
|
},
|
|
23096
25232
|
};
|
|
23097
25233
|
const defaultProps$9 = {
|
|
@@ -23120,12 +25256,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
|
|
|
23120
25256
|
FooterNoPoweredBy: FooterNoPoweredBy
|
|
23121
25257
|
});
|
|
23122
25258
|
|
|
23123
|
-
const scenario$
|
|
25259
|
+
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 |";
|
|
23124
25260
|
|
|
23125
25261
|
const Hero_stories = {
|
|
23126
25262
|
title: "Hero Layout",
|
|
23127
25263
|
parameters: {
|
|
23128
|
-
scenario: scenario$
|
|
25264
|
+
scenario: scenario$8,
|
|
23129
25265
|
},
|
|
23130
25266
|
};
|
|
23131
25267
|
const LoginOneColumn = () => {
|
|
@@ -23302,12 +25438,12 @@ const Hero = /*#__PURE__*/Object.freeze({
|
|
|
23302
25438
|
TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
|
|
23303
25439
|
});
|
|
23304
25440
|
|
|
23305
|
-
const scenario$
|
|
25441
|
+
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 | |";
|
|
23306
25442
|
|
|
23307
25443
|
const ReferralIframe_stories = {
|
|
23308
25444
|
title: "Referral Iframe",
|
|
23309
25445
|
parameters: {
|
|
23310
|
-
scenario: scenario$
|
|
25446
|
+
scenario: scenario$9,
|
|
23311
25447
|
},
|
|
23312
25448
|
};
|
|
23313
25449
|
const props = {
|
|
@@ -23338,12 +25474,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
|
|
|
23338
25474
|
ReferralIframeError: ReferralIframeError
|
|
23339
25475
|
});
|
|
23340
25476
|
|
|
23341
|
-
const scenario$
|
|
25477
|
+
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";
|
|
23342
25478
|
|
|
23343
25479
|
const NameFields_stories = {
|
|
23344
25480
|
title: "Name Fields",
|
|
23345
25481
|
parameters: {
|
|
23346
|
-
scenario: scenario$
|
|
25482
|
+
scenario: scenario$a,
|
|
23347
25483
|
},
|
|
23348
25484
|
};
|
|
23349
25485
|
const props$1 = {
|
|
@@ -23381,6 +25517,251 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
|
|
|
23381
25517
|
NameFieldsWithErrors: NameFieldsWithErrors
|
|
23382
25518
|
});
|
|
23383
25519
|
|
|
25520
|
+
const baseResponse = (data) => ({
|
|
25521
|
+
states: {
|
|
25522
|
+
content: null,
|
|
25523
|
+
redeemStage: "chooseReward",
|
|
25524
|
+
amount: 0,
|
|
25525
|
+
exchangeError: false,
|
|
25526
|
+
loading: false,
|
|
25527
|
+
selectedItem: null,
|
|
25528
|
+
selectedStep: null,
|
|
25529
|
+
},
|
|
25530
|
+
data: {
|
|
25531
|
+
exchangeList: data,
|
|
25532
|
+
},
|
|
25533
|
+
callbacks: {
|
|
25534
|
+
exchangeReward: null,
|
|
25535
|
+
openDrawer: null,
|
|
25536
|
+
setStage: null,
|
|
25537
|
+
setExchangeState: null,
|
|
25538
|
+
refs: null,
|
|
25539
|
+
},
|
|
25540
|
+
refs: null,
|
|
25541
|
+
});
|
|
25542
|
+
const baseReward$2 = {
|
|
25543
|
+
key: "",
|
|
25544
|
+
name: "",
|
|
25545
|
+
description: "",
|
|
25546
|
+
imageUrl: "",
|
|
25547
|
+
available: true,
|
|
25548
|
+
unavailableReason: null,
|
|
25549
|
+
unavailableReasonCode: null,
|
|
25550
|
+
ruleType: "FIXED_GLOBAL_REWARD",
|
|
25551
|
+
sourceUnit: "POINT",
|
|
25552
|
+
sourceValue: 10,
|
|
25553
|
+
prettySourceValue: "10 SaaSquatch Points",
|
|
25554
|
+
sourceMinValue: null,
|
|
25555
|
+
prettySourceMinValue: null,
|
|
25556
|
+
sourceMaxValue: null,
|
|
25557
|
+
prettySourceMaxValue: null,
|
|
25558
|
+
destinationMinValue: null,
|
|
25559
|
+
prettyDestinationMinValue: null,
|
|
25560
|
+
destinationMaxValue: null,
|
|
25561
|
+
prettyDestinationMaxValue: null,
|
|
25562
|
+
globalRewardKey: "",
|
|
25563
|
+
destinationUnit: null,
|
|
25564
|
+
steps: [],
|
|
25565
|
+
};
|
|
25566
|
+
const notEnoughPoints = {
|
|
25567
|
+
available: false,
|
|
25568
|
+
unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
|
|
25569
|
+
};
|
|
25570
|
+
const usTax = {
|
|
25571
|
+
available: false,
|
|
25572
|
+
unavailableReasonCode: "US_TAX",
|
|
25573
|
+
};
|
|
25574
|
+
const imageUrl = (props) => ({
|
|
25575
|
+
imageUrl: props,
|
|
25576
|
+
});
|
|
25577
|
+
const description = (props) => ({
|
|
25578
|
+
description: props,
|
|
25579
|
+
});
|
|
25580
|
+
const fixedValue = (props) => ({
|
|
25581
|
+
prettySourceValue: props,
|
|
25582
|
+
});
|
|
25583
|
+
const variableValue = (min, max, text) => ({
|
|
25584
|
+
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25585
|
+
sourceMinValue: min,
|
|
25586
|
+
prettySourceMinValue: min + " " + text,
|
|
25587
|
+
sourceMaxValue: max,
|
|
25588
|
+
prettySourceMaxValue: max + " " + text,
|
|
25589
|
+
});
|
|
25590
|
+
const test = {
|
|
25591
|
+
...baseResponse([
|
|
25592
|
+
{
|
|
25593
|
+
...baseReward$2,
|
|
25594
|
+
...description("Free swag with a promo code"),
|
|
25595
|
+
...imageUrl("https://i.imgur.com/Ds7M19I.png"),
|
|
25596
|
+
...fixedValue("40 SaaSquatch Points"),
|
|
25597
|
+
},
|
|
25598
|
+
{
|
|
25599
|
+
...baseReward$2,
|
|
25600
|
+
...description("Visa® Prepaid Card USD"),
|
|
25601
|
+
...imageUrl("https://i.imgur.com/4s3q2zz.png"),
|
|
25602
|
+
...variableValue(20, 80, "SaaSquatch Points"),
|
|
25603
|
+
},
|
|
25604
|
+
{
|
|
25605
|
+
...baseReward$2,
|
|
25606
|
+
...description("A very exclusive gift box"),
|
|
25607
|
+
...imageUrl("https://i.imgur.com/XuiJi4l.png"),
|
|
25608
|
+
...fixedValue("30 SaaSquatch Points"),
|
|
25609
|
+
},
|
|
25610
|
+
{
|
|
25611
|
+
...baseReward$2,
|
|
25612
|
+
...description("$50 Store credit"),
|
|
25613
|
+
...imageUrl("https://i.imgur.com/WkCMVSE.png"),
|
|
25614
|
+
...fixedValue("100 SaaSquatch Points"),
|
|
25615
|
+
},
|
|
25616
|
+
{
|
|
25617
|
+
...baseReward$2,
|
|
25618
|
+
...description("Variable amount of store credit"),
|
|
25619
|
+
...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
|
|
25620
|
+
...variableValue(20, 100, "SaaSquatch Points"),
|
|
25621
|
+
},
|
|
25622
|
+
{
|
|
25623
|
+
...baseReward$2,
|
|
25624
|
+
...notEnoughPoints,
|
|
25625
|
+
...description("A very rare cactus"),
|
|
25626
|
+
...imageUrl("https://i.imgur.com/CvCdpXc.png"),
|
|
25627
|
+
...fixedValue("2000 SaaSquatch Points"),
|
|
25628
|
+
},
|
|
25629
|
+
{
|
|
25630
|
+
...baseReward$2,
|
|
25631
|
+
...usTax,
|
|
25632
|
+
...description("$1000 Store credit"),
|
|
25633
|
+
...imageUrl("https://i.imgur.com/I9FCh9Z.png"),
|
|
25634
|
+
...fixedValue("2000 SaaSquatch Points"),
|
|
25635
|
+
},
|
|
25636
|
+
{
|
|
25637
|
+
...baseReward$2,
|
|
25638
|
+
...notEnoughPoints,
|
|
25639
|
+
...description("A holiday gift box"),
|
|
25640
|
+
...imageUrl("https://i.imgur.com/HBJS1WH.png"),
|
|
25641
|
+
...fixedValue("100 SaaSquatch Points"),
|
|
25642
|
+
},
|
|
25643
|
+
]),
|
|
25644
|
+
};
|
|
25645
|
+
const test2 = {
|
|
25646
|
+
states: {
|
|
25647
|
+
content: {
|
|
25648
|
+
text: {
|
|
25649
|
+
buttonText: "Exchange Rewards",
|
|
25650
|
+
ignored: true,
|
|
25651
|
+
},
|
|
25652
|
+
},
|
|
25653
|
+
redeemStage: "chooseAmount",
|
|
25654
|
+
amount: 0,
|
|
25655
|
+
exchangeError: false,
|
|
25656
|
+
loading: false,
|
|
25657
|
+
selectedItem: {
|
|
25658
|
+
key: "r4",
|
|
25659
|
+
name: "Salmon Coins",
|
|
25660
|
+
description: "Points for Salmon Coins",
|
|
25661
|
+
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",
|
|
25662
|
+
available: true,
|
|
25663
|
+
unavailableReason: null,
|
|
25664
|
+
unavailableReasonCode: null,
|
|
25665
|
+
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
25666
|
+
sourceUnit: "POINT",
|
|
25667
|
+
sourceValue: null,
|
|
25668
|
+
prettySourceValue: null,
|
|
25669
|
+
sourceMinValue: 1,
|
|
25670
|
+
prettySourceMinValue: "1 Point",
|
|
25671
|
+
sourceMaxValue: 100,
|
|
25672
|
+
prettySourceMaxValue: "100 Points",
|
|
25673
|
+
destinationMinValue: 1,
|
|
25674
|
+
prettyDestinationMinValue: "1 Salmon Coin",
|
|
25675
|
+
destinationMaxValue: 100,
|
|
25676
|
+
prettyDestinationMaxValue: "100 Salmons",
|
|
25677
|
+
globalRewardKey: null,
|
|
25678
|
+
destinationUnit: "TESTUNIT",
|
|
25679
|
+
steps: [
|
|
25680
|
+
{
|
|
25681
|
+
sourceValue: 1,
|
|
25682
|
+
prettySourceValue: "1 Point",
|
|
25683
|
+
destinationValue: 1,
|
|
25684
|
+
prettyDestinationValue: "1 Salmon Coin",
|
|
25685
|
+
available: true,
|
|
25686
|
+
unavailableReasonCode: null,
|
|
25687
|
+
},
|
|
25688
|
+
{
|
|
25689
|
+
sourceValue: 2,
|
|
25690
|
+
prettySourceValue: "2 Points",
|
|
25691
|
+
destinationValue: 2,
|
|
25692
|
+
prettyDestinationValue: "2 Salmons",
|
|
25693
|
+
available: true,
|
|
25694
|
+
unavailableReasonCode: null,
|
|
25695
|
+
},
|
|
25696
|
+
{
|
|
25697
|
+
sourceValue: 3,
|
|
25698
|
+
prettySourceValue: "3 Points",
|
|
25699
|
+
destinationValue: 3,
|
|
25700
|
+
prettyDestinationValue: "3 Salmons",
|
|
25701
|
+
available: true,
|
|
25702
|
+
unavailableReasonCode: null,
|
|
25703
|
+
},
|
|
25704
|
+
{
|
|
25705
|
+
sourceValue: 4,
|
|
25706
|
+
prettySourceValue: "4 Points",
|
|
25707
|
+
destinationValue: 4,
|
|
25708
|
+
prettyDestinationValue: "4 Salmons",
|
|
25709
|
+
available: true,
|
|
25710
|
+
unavailableReasonCode: null,
|
|
25711
|
+
},
|
|
25712
|
+
{
|
|
25713
|
+
sourceValue: 5,
|
|
25714
|
+
prettySourceValue: "5 Points",
|
|
25715
|
+
destinationValue: 5,
|
|
25716
|
+
prettyDestinationValue: "5 Salmons",
|
|
25717
|
+
available: true,
|
|
25718
|
+
unavailableReasonCode: null,
|
|
25719
|
+
},
|
|
25720
|
+
],
|
|
25721
|
+
},
|
|
25722
|
+
selectedStep: null,
|
|
25723
|
+
},
|
|
25724
|
+
data: {
|
|
25725
|
+
exchangeList: null,
|
|
25726
|
+
},
|
|
25727
|
+
callbacks: {
|
|
25728
|
+
exchangeReward: null,
|
|
25729
|
+
openDrawer: null,
|
|
25730
|
+
setStage: null,
|
|
25731
|
+
setExchangeState: null,
|
|
25732
|
+
refs: {
|
|
25733
|
+
drawerRef: {},
|
|
25734
|
+
},
|
|
25735
|
+
},
|
|
25736
|
+
refs: null,
|
|
25737
|
+
};
|
|
25738
|
+
|
|
25739
|
+
const RewardExchangeList_stories = {
|
|
25740
|
+
title: "Components/Reward Exchange List",
|
|
25741
|
+
};
|
|
25742
|
+
const resizable$1 = {
|
|
25743
|
+
width: "683px",
|
|
25744
|
+
minWidth: "260px",
|
|
25745
|
+
resize: "horizontal",
|
|
25746
|
+
height: "fit-content",
|
|
25747
|
+
overflow: "hidden",
|
|
25748
|
+
};
|
|
25749
|
+
const Default$c = () => {
|
|
25750
|
+
return (h("div", { style: resizable$1 },
|
|
25751
|
+
h(RewardExchangeView, Object.assign({}, test))));
|
|
25752
|
+
};
|
|
25753
|
+
const Default2 = () => {
|
|
25754
|
+
return (h("div", { style: { ...resizable$1, height: "700px" } },
|
|
25755
|
+
h(RewardExchangeView, Object.assign({}, test2))));
|
|
25756
|
+
};
|
|
25757
|
+
|
|
25758
|
+
const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
25759
|
+
__proto__: null,
|
|
25760
|
+
'default': RewardExchangeList_stories,
|
|
25761
|
+
Default: Default$c,
|
|
25762
|
+
Default2: Default2
|
|
25763
|
+
});
|
|
25764
|
+
|
|
23384
25765
|
function deepFreeze(obj) {
|
|
23385
25766
|
if (obj instanceof Map) {
|
|
23386
25767
|
obj.clear = obj.delete = obj.set = function () {
|
|
@@ -25961,7 +28342,9 @@ const CucumberAddon = ({ story }, children) => {
|
|
|
25961
28342
|
// No scenario or invalid. Ignoring.
|
|
25962
28343
|
}
|
|
25963
28344
|
return (h("div", null,
|
|
25964
|
-
|
|
28345
|
+
h("details", null,
|
|
28346
|
+
h("summary", null, "Specs"),
|
|
28347
|
+
result && h("pre", { innerHTML: result.value })),
|
|
25965
28348
|
children));
|
|
25966
28349
|
};
|
|
25967
28350
|
|
|
@@ -25998,6 +28381,8 @@ const stories = [
|
|
|
25998
28381
|
ReferralTableRewardsCell$1,
|
|
25999
28382
|
UserName,
|
|
26000
28383
|
PasswordField,
|
|
28384
|
+
TaskCard$1,
|
|
28385
|
+
TaskCardProgressBar,
|
|
26001
28386
|
PortalTemplates,
|
|
26002
28387
|
ProgramMenu$1,
|
|
26003
28388
|
PoweredByImg,
|
|
@@ -26005,6 +28390,10 @@ const stories = [
|
|
|
26005
28390
|
Hero,
|
|
26006
28391
|
ReferralIframe$1,
|
|
26007
28392
|
NameFields$1,
|
|
28393
|
+
RewardExchangeList,
|
|
28394
|
+
UseRewardExchangeList,
|
|
28395
|
+
UseTaskCard,
|
|
28396
|
+
UseRewardsTable
|
|
26008
28397
|
];
|
|
26009
28398
|
const StencilStorybook = class {
|
|
26010
28399
|
constructor(hostRef) {
|
|
@@ -26044,6 +28433,77 @@ const TableRow = class {
|
|
|
26044
28433
|
}
|
|
26045
28434
|
};
|
|
26046
28435
|
|
|
28436
|
+
const TaskCard$2 = class {
|
|
28437
|
+
constructor(hostRef) {
|
|
28438
|
+
registerInstance(this, hostRef);
|
|
28439
|
+
this.ignored = true;
|
|
28440
|
+
/**
|
|
28441
|
+
* @uiName Reward Amount
|
|
28442
|
+
*/
|
|
28443
|
+
this.rewardAmount = 0;
|
|
28444
|
+
/**
|
|
28445
|
+
* @uiName Reward Unit
|
|
28446
|
+
*/
|
|
28447
|
+
this.rewardUnit = "Points";
|
|
28448
|
+
/**
|
|
28449
|
+
* @uiName Title Text
|
|
28450
|
+
*/
|
|
28451
|
+
this.cardTitle = "Title Text";
|
|
28452
|
+
/**
|
|
28453
|
+
* @uiName Description Text
|
|
28454
|
+
*/
|
|
28455
|
+
this.description = "Description Text";
|
|
28456
|
+
/**
|
|
28457
|
+
* @uiName Goal Repeatable
|
|
28458
|
+
*/
|
|
28459
|
+
this.repeatable = false;
|
|
28460
|
+
/**
|
|
28461
|
+
* @uiName Show Progress Bar
|
|
28462
|
+
*/
|
|
28463
|
+
this.showProgressBar = false;
|
|
28464
|
+
/**
|
|
28465
|
+
* @uiName Goal Progress Source
|
|
28466
|
+
*/
|
|
28467
|
+
this.progressSource = "";
|
|
28468
|
+
/**
|
|
28469
|
+
* @uiName Goal Completion Number
|
|
28470
|
+
*/
|
|
28471
|
+
this.goal = 1;
|
|
28472
|
+
/**
|
|
28473
|
+
* @uiName Progress Bar Steps
|
|
28474
|
+
*/
|
|
28475
|
+
this.steps = false;
|
|
28476
|
+
/**
|
|
28477
|
+
* @uiName Show Goal Expiry
|
|
28478
|
+
*/
|
|
28479
|
+
this.showExpiry = false;
|
|
28480
|
+
/**
|
|
28481
|
+
* @uiName CTA Button Text
|
|
28482
|
+
*/
|
|
28483
|
+
this.buttonText = "Complete Action";
|
|
28484
|
+
/**
|
|
28485
|
+
* @uiName CTA Button Link
|
|
28486
|
+
*/
|
|
28487
|
+
this.buttonLink = "https://example.com/";
|
|
28488
|
+
/**
|
|
28489
|
+
* Select what type of stat to display for the goal. Manual paths are also supported.
|
|
28490
|
+
*
|
|
28491
|
+
* @uiWidget StatTypeSelectWidget
|
|
28492
|
+
* @uiName Stat Type
|
|
28493
|
+
* @uiOptions {"version": 1.1}
|
|
28494
|
+
*/
|
|
28495
|
+
this.statType = "/programGoals/count/Referral-Started%2Freferrals";
|
|
28496
|
+
h$1(this);
|
|
28497
|
+
}
|
|
28498
|
+
disconnectedCallback() { }
|
|
28499
|
+
render() {
|
|
28500
|
+
const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
|
|
28501
|
+
const { value, statvalue } = props;
|
|
28502
|
+
console.log(props, j$1());
|
|
28503
|
+
return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
|
|
28504
|
+
}
|
|
28505
|
+
};
|
|
28506
|
+
|
|
26047
28507
|
const debug$2 = browser("sq:global");
|
|
26048
28508
|
const textStyles = `
|
|
26049
28509
|
sqm-text {
|
|
@@ -26169,4 +28629,4 @@ function useUserNameDemo(props) {
|
|
|
26169
28629
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
26170
28630
|
}
|
|
26171
28631
|
|
|
26172
|
-
export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, Text as sqm_text, UserName$1 as sqm_user_name };
|
|
28632
|
+
export { DividedLayout as sqm_divided_layout, EditProfile as sqm_edit_profile, FormMessage as sqm_form_message, SqmHookStoryContainer as sqm_hook_story_container, NavigationMenu as sqm_navigation_menu, PortalPasswordField as sqm_password_field, PortalChangePassword as sqm_portal_change_password, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramMenu as sqm_program_menu, SqmReferralIframe as sqm_referral_iframe, ReferralTable as sqm_referral_table, ReferralTableCell as sqm_referral_table_cell, ReferralTableDateCell as sqm_referral_table_date_cell, ReferralTableRewardsCell as sqm_referral_table_rewards_cell, ReferralTableStatusCell as sqm_referral_table_status_cell, ReferralTableUserCell as sqm_referral_table_user_cell, SqmRewardExchangeList as sqm_reward_exchange_list, RewardsTable as sqm_rewards_table, RewardsTableColumn as sqm_rewards_table_column, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareLink as sqm_share_link, StencilStorybook as sqm_stencilbook, TableCell$1 as sqm_table_cell, TableRow as sqm_table_row, TaskCard$2 as sqm_task_card, Text as sqm_text, UserName$1 as sqm_user_name };
|