@saasquatch/mint-components 1.3.2-2 → 1.3.2-6
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-divided-layout_27.cjs.entry.js → sqm-divided-layout_28.cjs.entry.js} +975 -395
- package/dist/cjs/{useDemoBigStat-17e61803.js → useDemoBigStat-d7c65044.js} +90 -20
- package/dist/collection/components/sqm-big-stat/BigStat.stories.js +8 -1
- package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
- package/dist/collection/components/sqm-big-stat/useBigStat.js +89 -20
- package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
- package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +26 -40
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +68 -47
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +2 -1
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +3 -1
- package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
- package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +74 -243
- 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 +15 -309
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +108 -48
- package/dist/collection/stories/NewPortal.stories.js +15 -15
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat.entry.js +1 -1
- package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_28.entry.js} +939 -360
- package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-3d4832ef.js} +90 -20
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
- package/dist/esm-es5/sqm-divided-layout_28.entry.js +1 -0
- package/dist/esm-es5/useDemoBigStat-3d4832ef.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0c07c81a.js +227 -0
- package/dist/mint-components/p-2d209222.system.entry.js +1 -0
- package/dist/mint-components/{p-c9c4f31b.system.entry.js → p-6e9944ed.system.entry.js} +1 -1
- package/dist/mint-components/p-8f04bed2.entry.js +288 -0
- package/dist/mint-components/p-91d39961.system.js +1 -1
- package/dist/mint-components/{p-e22eed7b.entry.js → p-aefa270d.entry.js} +1 -1
- package/dist/mint-components/p-fca9971b.system.js +1 -0
- package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
- package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-reward-exchange-list/progressBar.d.ts +3 -2
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +1 -0
- package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +3 -1
- 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 +9 -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 +13 -22
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +25 -13
- package/dist/types/components.d.ts +48 -34
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-task-card-view-57066e67.js +0 -476
- package/dist/cjs/sqm-task-card.cjs.entry.js +0 -56
- package/dist/esm/sqm-task-card-view-2ee495af.js +0 -474
- package/dist/esm/sqm-task-card.entry.js +0 -52
- package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
- package/dist/esm-es5/sqm-task-card-view-2ee495af.js +0 -1
- package/dist/esm-es5/sqm-task-card.entry.js +0 -1
- package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
- package/dist/mint-components/p-0ba3c956.system.entry.js +0 -1
- package/dist/mint-components/p-1e248afc.system.entry.js +0 -1
- package/dist/mint-components/p-353b4413.system.js +0 -1
- package/dist/mint-components/p-405a9253.js +0 -227
- package/dist/mint-components/p-8f5e2af4.entry.js +0 -1
- package/dist/mint-components/p-bca8867d.entry.js +0 -287
- package/dist/mint-components/p-e78a5a91.js +0 -1
- package/dist/mint-components/p-f87d8f53.system.js +0 -1
|
@@ -15,7 +15,7 @@ import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
|
|
|
15
15
|
import { g as gql } from './index-2f5dd0a1.js';
|
|
16
16
|
import { u as useRerenderListener } from './re-render-9ab5fe0f.js';
|
|
17
17
|
import { u as useChildElements } from './useChildElements-506f00d0.js';
|
|
18
|
-
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-
|
|
18
|
+
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-3d4832ef.js';
|
|
19
19
|
import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
|
|
20
20
|
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-fff5d35d.js';
|
|
21
21
|
import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-da91f5f3.js';
|
|
@@ -28,7 +28,6 @@ import { P as PortalEmailVerificationView } from './sqm-portal-email-verificatio
|
|
|
28
28
|
import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view-a4e50da2.js';
|
|
29
29
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
|
|
30
30
|
import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
|
|
31
|
-
import { T as TaskCardView } from './sqm-task-card-view-2ee495af.js';
|
|
32
31
|
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-c317518e.js';
|
|
33
32
|
import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
|
|
34
33
|
import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
|
|
@@ -14767,6 +14766,7 @@ const GET_EXCHANGE_LIST = dist.gql `
|
|
|
14767
14766
|
destinationValue
|
|
14768
14767
|
prettyDestinationValue
|
|
14769
14768
|
available
|
|
14769
|
+
unavailableReasonCode
|
|
14770
14770
|
}
|
|
14771
14771
|
}
|
|
14772
14772
|
totalCount
|
|
@@ -14801,7 +14801,7 @@ function useRewardExchangeList(props) {
|
|
|
14801
14801
|
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
14802
14802
|
const user = T$1();
|
|
14803
14803
|
const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
|
|
14804
|
-
const { data } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14804
|
+
const { data, loading } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14805
14805
|
useEffect(() => {
|
|
14806
14806
|
var _a, _b;
|
|
14807
14807
|
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) {
|
|
@@ -14910,6 +14910,7 @@ function useRewardExchangeList(props) {
|
|
|
14910
14910
|
amount,
|
|
14911
14911
|
selectedStep,
|
|
14912
14912
|
exchangeError,
|
|
14913
|
+
loading,
|
|
14913
14914
|
},
|
|
14914
14915
|
data: {
|
|
14915
14916
|
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,
|
|
@@ -14928,6 +14929,14 @@ function useRewardExchangeList(props) {
|
|
|
14928
14929
|
};
|
|
14929
14930
|
}
|
|
14930
14931
|
|
|
14932
|
+
const LeftArrow = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
|
|
14933
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
|
|
14934
|
+
const ExchangeArrows = () => (h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14935
|
+
h("circle", { cx: "15", cy: "15", r: "15", fill: "white" }),
|
|
14936
|
+
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" })));
|
|
14937
|
+
const CheckMark = () => (h("svg", { style: { top: "-4px", position: "relative", left: "2px" }, xmlns: "http://www.w3.org/2000/svg", width: "10", height: "7", viewBox: "0 0 10 7", fill: "none" },
|
|
14938
|
+
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" })));
|
|
14939
|
+
|
|
14931
14940
|
function Dot({ active, completed, incomplete, }) {
|
|
14932
14941
|
return (h("div", { style: {
|
|
14933
14942
|
flex: "0 0 0",
|
|
@@ -14952,59 +14961,41 @@ function Dot({ active, completed, incomplete, }) {
|
|
|
14952
14961
|
? "2px solid #E5E5E5"
|
|
14953
14962
|
: "none",
|
|
14954
14963
|
borderRadius: "50%",
|
|
14955
|
-
width: completed ? "
|
|
14956
|
-
height: completed ? "
|
|
14957
|
-
margin: "-
|
|
14964
|
+
width: completed ? "14px" : "10px",
|
|
14965
|
+
height: completed ? "14px" : "10px",
|
|
14966
|
+
margin: "-5px auto 0px",
|
|
14958
14967
|
zIndex: "1",
|
|
14959
14968
|
boxSizing: "content-box",
|
|
14960
|
-
} })));
|
|
14969
|
+
} }, completed && h(CheckMark, null))));
|
|
14970
|
+
}
|
|
14971
|
+
function ProgressLine({ incomplete = false, active = false }) {
|
|
14972
|
+
return (h("div", { style: {
|
|
14973
|
+
content: "''",
|
|
14974
|
+
flex: "0.5 0.5 0",
|
|
14975
|
+
height: "4px",
|
|
14976
|
+
borderRadius: "4px",
|
|
14977
|
+
background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
|
|
14978
|
+
position: "relative",
|
|
14979
|
+
bottom: "0",
|
|
14980
|
+
left: "0",
|
|
14981
|
+
display: "flex",
|
|
14982
|
+
justifyContent: "center",
|
|
14983
|
+
columnGap: "50px",
|
|
14984
|
+
marginRight: "-2px",
|
|
14985
|
+
boxSizing: "content-box",
|
|
14986
|
+
} }));
|
|
14961
14987
|
}
|
|
14962
14988
|
function Progress({ active, completed, incomplete }) {
|
|
14963
14989
|
return [
|
|
14964
|
-
h(
|
|
14965
|
-
content: "''",
|
|
14966
|
-
flex: "0.5 0.5 0",
|
|
14967
|
-
height: "4px",
|
|
14968
|
-
borderRadius: "4px",
|
|
14969
|
-
background: incomplete ? "#E5E5E5" : "#9E9E9E",
|
|
14970
|
-
position: "relative",
|
|
14971
|
-
bottom: "0",
|
|
14972
|
-
left: "0",
|
|
14973
|
-
display: "flex",
|
|
14974
|
-
justifyContent: "center",
|
|
14975
|
-
columnGap: "50px",
|
|
14976
|
-
marginRight: "-2px",
|
|
14977
|
-
boxSizing: "content-box",
|
|
14978
|
-
} }),
|
|
14990
|
+
h(ProgressLine, { incomplete: incomplete }),
|
|
14979
14991
|
h(Dot, { active: active, completed: completed, incomplete: incomplete }),
|
|
14980
|
-
h(
|
|
14981
|
-
content: "''",
|
|
14982
|
-
flex: "0.5 0.5 0",
|
|
14983
|
-
height: "4px",
|
|
14984
|
-
borderRadius: "4px",
|
|
14985
|
-
background: incomplete || active ? "#E5E5E5" : "#9E9E9E",
|
|
14986
|
-
position: "relative",
|
|
14987
|
-
bottom: "0",
|
|
14988
|
-
left: "0",
|
|
14989
|
-
display: "flex",
|
|
14990
|
-
justifyContent: "center",
|
|
14991
|
-
columnGap: "50px",
|
|
14992
|
-
marginRight: "-2px",
|
|
14993
|
-
boxSizing: "content-box",
|
|
14994
|
-
} }),
|
|
14992
|
+
h(ProgressLine, { incomplete: incomplete, active: active }),
|
|
14995
14993
|
];
|
|
14996
14994
|
}
|
|
14997
|
-
function ProgressBar({
|
|
14998
|
-
|
|
14999
|
-
return (h("div", { style: { display: "flex", columnGap: "-2px" } },
|
|
15000
|
-
h(Progress, { active: stage === 0, completed: stage > 0, incomplete: stage < 0 }),
|
|
15001
|
-
h(Progress, { active: stage === 1, completed: stage > 1, incomplete: stage < 1 }),
|
|
15002
|
-
h(Progress, { active: stage === 2, completed: stage > 2, incomplete: stage < 2 })));
|
|
14995
|
+
function ProgressBar({ stageCount, currentStage, }) {
|
|
14996
|
+
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 })))));
|
|
15003
14997
|
}
|
|
15004
14998
|
|
|
15005
|
-
const LeftArrow = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
|
|
15006
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
|
|
15007
|
-
|
|
15008
14999
|
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
15009
15000
|
const stageProgressList = {
|
|
15010
15001
|
chooseReward: "Choose reward",
|
|
@@ -15023,29 +15014,33 @@ function RewardExchangeView(props) {
|
|
|
15023
15014
|
},
|
|
15024
15015
|
},
|
|
15025
15016
|
Base: {
|
|
15026
|
-
display: "
|
|
15017
|
+
display: "flex",
|
|
15027
15018
|
cursor: "pointer",
|
|
15028
15019
|
textAlign: "center",
|
|
15020
|
+
height: "120px",
|
|
15029
15021
|
"&::part(base)": {
|
|
15030
15022
|
width: "100%",
|
|
15031
|
-
|
|
15023
|
+
maxWidth: "350px",
|
|
15032
15024
|
display: "flex",
|
|
15033
|
-
|
|
15034
|
-
alignItems: "center",
|
|
15025
|
+
margin: "0 auto",
|
|
15035
15026
|
},
|
|
15036
15027
|
"&::part(body)": {
|
|
15037
|
-
padding:
|
|
15028
|
+
padding: 0,
|
|
15029
|
+
display: "flex",
|
|
15030
|
+
width: "100%",
|
|
15038
15031
|
},
|
|
15039
15032
|
},
|
|
15040
15033
|
Drawer: {
|
|
15041
15034
|
"&::part(base)": {
|
|
15042
15035
|
minWidth: "400px",
|
|
15036
|
+
maxWidth: "700px",
|
|
15043
15037
|
width: "50%",
|
|
15044
15038
|
margin: "0 auto",
|
|
15045
15039
|
right: "0",
|
|
15046
15040
|
},
|
|
15047
15041
|
"&::part(panel)": {
|
|
15048
15042
|
height: "85vh",
|
|
15043
|
+
width: "100%",
|
|
15049
15044
|
},
|
|
15050
15045
|
},
|
|
15051
15046
|
FullImage: {
|
|
@@ -15055,8 +15050,9 @@ function RewardExchangeView(props) {
|
|
|
15055
15050
|
},
|
|
15056
15051
|
PreviewImage: {
|
|
15057
15052
|
objectFit: "contain",
|
|
15058
|
-
|
|
15059
|
-
height: "
|
|
15053
|
+
width: "120px",
|
|
15054
|
+
height: "120px",
|
|
15055
|
+
flex: 0.33,
|
|
15060
15056
|
},
|
|
15061
15057
|
InputBox: {
|
|
15062
15058
|
width: "100%",
|
|
@@ -15071,8 +15067,9 @@ function RewardExchangeView(props) {
|
|
|
15071
15067
|
},
|
|
15072
15068
|
},
|
|
15073
15069
|
Buttons: {
|
|
15074
|
-
|
|
15070
|
+
marginLeft: "auto",
|
|
15075
15071
|
width: "100%",
|
|
15072
|
+
maxWidth: "300px",
|
|
15076
15073
|
},
|
|
15077
15074
|
Button: {
|
|
15078
15075
|
margin: "10px 0",
|
|
@@ -15106,7 +15103,9 @@ function RewardExchangeView(props) {
|
|
|
15106
15103
|
});
|
|
15107
15104
|
} }, (_b = item.steps) === null || _b === void 0 ? void 0 : _b.map((step) => (h("sl-menu-item", { value: step, disabled: !step.available },
|
|
15108
15105
|
step.prettyDestinationValue,
|
|
15109
|
-
h("
|
|
15106
|
+
h("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } },
|
|
15107
|
+
step.prettySourceValue,
|
|
15108
|
+
step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode))))))));
|
|
15110
15109
|
}
|
|
15111
15110
|
function chooseReward() {
|
|
15112
15111
|
var _a;
|
|
@@ -15114,29 +15113,40 @@ function RewardExchangeView(props) {
|
|
|
15114
15113
|
? "confirmation"
|
|
15115
15114
|
: "chooseAmount";
|
|
15116
15115
|
console.log({ nextStage, ruleType: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType });
|
|
15117
|
-
return
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
} }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 :
|
|
15125
|
-
_a.map((item) => {
|
|
15116
|
+
return [
|
|
15117
|
+
h("div", { style: {
|
|
15118
|
+
display: "grid",
|
|
15119
|
+
justifyContent: "center",
|
|
15120
|
+
gap: "20px",
|
|
15121
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
|
|
15122
|
+
} }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
15126
15123
|
const style = {
|
|
15127
15124
|
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
|
|
15128
15125
|
marginBottom: "10px 0",
|
|
15129
15126
|
flex: "1",
|
|
15130
|
-
minWidth: "
|
|
15127
|
+
minWidth: "100%",
|
|
15128
|
+
color: !item.available && "#eee",
|
|
15131
15129
|
};
|
|
15132
|
-
|
|
15133
|
-
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15130
|
+
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
15131
|
+
? item.prettySourceValue
|
|
15132
|
+
: `${item.sourceMinValue} to ${item.sourceMaxValue} ${item.sourceUnit}`;
|
|
15133
|
+
return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
15134
|
+
h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
|
|
15135
|
+
callbacks.setExchangeState({ selectedItem: item }) },
|
|
15136
|
+
(item === null || item === void 0 ? void 0 : item.imageUrl) && (h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") })),
|
|
15137
|
+
h("p", { style: { margin: "0", flex: "1", fontSize: "90%" } },
|
|
15138
|
+
h("b", null, item.description),
|
|
15139
|
+
h("p", { style: { margin: "0" } }, amount),
|
|
15140
|
+
item.unavailableReasonCode && (h("p", { style: {
|
|
15141
|
+
fontSize: "70%",
|
|
15142
|
+
color: "#F2994A",
|
|
15143
|
+
marginTop: "0",
|
|
15144
|
+
} }, item.unavailableReasonCode))))));
|
|
15145
|
+
})),
|
|
15137
15146
|
h("div", { class: sheet.classes.Buttons },
|
|
15138
15147
|
h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
|
|
15139
|
-
h("a", { onClick: () => { var _a; return (_a = refs.drawerRef.current) === null || _a === void 0 ? void 0 : _a.hide(); }, style: { display: "block" }, class: sheet.classes.Button }, "Cancel"))
|
|
15148
|
+
h("a", { onClick: () => { var _a; return (_a = refs.drawerRef.current) === null || _a === void 0 ? void 0 : _a.hide(); }, style: { display: "block" }, class: sheet.classes.Button }, "Cancel")),
|
|
15149
|
+
];
|
|
15140
15150
|
}
|
|
15141
15151
|
function chooseAmount() {
|
|
15142
15152
|
const input = getInput();
|
|
@@ -15150,24 +15160,26 @@ function RewardExchangeView(props) {
|
|
|
15150
15160
|
}
|
|
15151
15161
|
console.log({ selectedItem, selectedStep });
|
|
15152
15162
|
function confirmation() {
|
|
15153
|
-
console.log("confirmation:", { selectedItem });
|
|
15154
|
-
const redemptionAmount = () => {
|
|
15155
|
-
var _a;
|
|
15156
|
-
if ((selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD") {
|
|
15157
|
-
return `Redeem ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceValue} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.globalRewardKey}`;
|
|
15158
|
-
}
|
|
15159
|
-
else {
|
|
15160
|
-
const amount = states.amount;
|
|
15161
|
-
const reward = (_a = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) !== null && _a !== void 0 ? _a : `${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.destinationUnit}`;
|
|
15162
|
-
return `Redeem ${amount} ${selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.sourceUnit} for ${reward}`;
|
|
15163
|
-
}
|
|
15164
|
-
};
|
|
15165
15163
|
const previousStage = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType) === "FIXED_GLOBAL_REWARD"
|
|
15166
15164
|
? "chooseReward"
|
|
15167
15165
|
: "chooseAmount";
|
|
15168
15166
|
return (h("div", null,
|
|
15169
|
-
h("h2", null, "Confirm
|
|
15170
|
-
|
|
15167
|
+
h("h2", null, "Confirm and redeem"),
|
|
15168
|
+
h("div", { style: { textAlign: "center" } },
|
|
15169
|
+
h("p", null,
|
|
15170
|
+
h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
|
|
15171
|
+
h("p", null,
|
|
15172
|
+
h(ExchangeArrows, null)),
|
|
15173
|
+
h("div", { class: sheet.classes.CardContainer, style: {
|
|
15174
|
+
boxShadow: "none",
|
|
15175
|
+
marginBottom: "10px",
|
|
15176
|
+
flex: "1",
|
|
15177
|
+
minWidth: "100%",
|
|
15178
|
+
} },
|
|
15179
|
+
h("sl-card", { class: sheet.classes.Base },
|
|
15180
|
+
h("img", { class: sheet.classes.PreviewImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
15181
|
+
getAssetPath("./assets/Reward-icon.png") }),
|
|
15182
|
+
h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
|
|
15171
15183
|
h("div", { class: sheet.classes.Buttons },
|
|
15172
15184
|
h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
|
|
15173
15185
|
h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
@@ -15188,24 +15200,24 @@ function RewardExchangeView(props) {
|
|
|
15188
15200
|
const currentStage = stages[states.redeemStage];
|
|
15189
15201
|
function stageMap() {
|
|
15190
15202
|
const stageNumber = stageList.indexOf(states.redeemStage);
|
|
15191
|
-
return (h("div", { style: { fontSize: "80%" } },
|
|
15192
|
-
h(ProgressBar, { stage: stageNumber }),
|
|
15203
|
+
return (h("div", { style: { fontSize: "80%", marginBottom: "20px" } },
|
|
15193
15204
|
h("div", { style: {
|
|
15194
15205
|
marginTop: "5px",
|
|
15195
15206
|
display: "flex",
|
|
15196
15207
|
justifyContent: "center",
|
|
15197
15208
|
textAlign: "center",
|
|
15198
15209
|
whiteSpace: "nowrap",
|
|
15199
|
-
marginBottom: "
|
|
15210
|
+
marginBottom: "6px",
|
|
15200
15211
|
} }, Object.keys(stageProgressList).map((stage) => {
|
|
15201
15212
|
if (stage === states.redeemStage)
|
|
15202
15213
|
return (h("b", { style: { flex: "1 1 0" } },
|
|
15203
15214
|
" ",
|
|
15204
15215
|
stageProgressList[stage]));
|
|
15205
15216
|
return h("i", { style: { flex: "1 1 0" } }, stageProgressList[stage]);
|
|
15206
|
-
}))
|
|
15217
|
+
})),
|
|
15218
|
+
h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
15207
15219
|
}
|
|
15208
|
-
const
|
|
15220
|
+
const BackButton = () => {
|
|
15209
15221
|
if (states.redeemStage === "success")
|
|
15210
15222
|
return "";
|
|
15211
15223
|
let previousStage = "";
|
|
@@ -15227,12 +15239,12 @@ function RewardExchangeView(props) {
|
|
|
15227
15239
|
h("style", { type: "text/css" }, styleString),
|
|
15228
15240
|
h("div", null,
|
|
15229
15241
|
h("sl-drawer", { ref: (ref) => (refs.drawerRef.current = ref), placement: "right", class: sheet.classes.Drawer, open: stageList.indexOf(states.redeemStage) >= 0 },
|
|
15230
|
-
h(
|
|
15242
|
+
h(BackButton, null),
|
|
15231
15243
|
stageMap(),
|
|
15232
15244
|
currentStage && currentStage(),
|
|
15233
15245
|
states.exchangeError &&
|
|
15234
15246
|
"Something went wrong. Please contact support or try again."),
|
|
15235
|
-
h("sl-button", { onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
|
|
15247
|
+
h("sl-button", { loading: states.loading, onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
|
|
15236
15248
|
}
|
|
15237
15249
|
|
|
15238
15250
|
const SqmRewardExchangeList = class {
|
|
@@ -15273,6 +15285,7 @@ function useRewardExchangeListDemo(props) {
|
|
|
15273
15285
|
amount: 0,
|
|
15274
15286
|
selectedStep: undefined,
|
|
15275
15287
|
exchangeError: false,
|
|
15288
|
+
loading: false,
|
|
15276
15289
|
},
|
|
15277
15290
|
data: {
|
|
15278
15291
|
shareCode: "SHARECODE123",
|
|
@@ -17131,11 +17144,12 @@ const BigStat_stories = {
|
|
|
17131
17144
|
title: "Components/Big Stat",
|
|
17132
17145
|
};
|
|
17133
17146
|
const Default$1 = () => {
|
|
17134
|
-
const props = { statvalue: "9.900,00" };
|
|
17147
|
+
const props = { value: 990000, statvalue: "9.900,00" };
|
|
17135
17148
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
17136
17149
|
};
|
|
17137
17150
|
const LeftAlign = () => {
|
|
17138
17151
|
const props = {
|
|
17152
|
+
value: 500,
|
|
17139
17153
|
statvalue: "500",
|
|
17140
17154
|
alignment: "left",
|
|
17141
17155
|
};
|
|
@@ -17143,6 +17157,7 @@ const LeftAlign = () => {
|
|
|
17143
17157
|
};
|
|
17144
17158
|
const RightAlign = () => {
|
|
17145
17159
|
const props = {
|
|
17160
|
+
value: 500,
|
|
17146
17161
|
statvalue: "500",
|
|
17147
17162
|
alignment: "right",
|
|
17148
17163
|
};
|
|
@@ -17150,6 +17165,7 @@ const RightAlign = () => {
|
|
|
17150
17165
|
};
|
|
17151
17166
|
const FlexReverse = () => {
|
|
17152
17167
|
const props = {
|
|
17168
|
+
value: 500,
|
|
17153
17169
|
statvalue: "500",
|
|
17154
17170
|
flexReverse: true,
|
|
17155
17171
|
};
|
|
@@ -17157,6 +17173,7 @@ const FlexReverse = () => {
|
|
|
17157
17173
|
};
|
|
17158
17174
|
const FlexReverseRight = () => {
|
|
17159
17175
|
const props = {
|
|
17176
|
+
value: 500,
|
|
17160
17177
|
statvalue: "500",
|
|
17161
17178
|
flexReverse: true,
|
|
17162
17179
|
alignment: "right",
|
|
@@ -17165,6 +17182,7 @@ const FlexReverseRight = () => {
|
|
|
17165
17182
|
};
|
|
17166
17183
|
const FlexReverseLeft = () => {
|
|
17167
17184
|
const props = {
|
|
17185
|
+
value: 500,
|
|
17168
17186
|
statvalue: "500",
|
|
17169
17187
|
flexReverse: true,
|
|
17170
17188
|
alignment: "left",
|
|
@@ -17173,12 +17191,14 @@ const FlexReverseLeft = () => {
|
|
|
17173
17191
|
};
|
|
17174
17192
|
const NoStatValue = () => {
|
|
17175
17193
|
const props = {
|
|
17194
|
+
value: 0,
|
|
17176
17195
|
statvalue: "...",
|
|
17177
17196
|
};
|
|
17178
17197
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
17179
17198
|
};
|
|
17180
17199
|
const InvalidStatValue = () => {
|
|
17181
17200
|
const props = {
|
|
17201
|
+
value: 0,
|
|
17182
17202
|
statvalue: "!!!",
|
|
17183
17203
|
};
|
|
17184
17204
|
return h(BigStatView, Object.assign({}, props), "Big stat");
|
|
@@ -18242,6 +18262,44 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
|
18242
18262
|
VariableCreditReward: VariableCreditReward
|
|
18243
18263
|
});
|
|
18244
18264
|
|
|
18265
|
+
const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
|
|
18266
|
+
const UseTaskCard_stories = {
|
|
18267
|
+
title: "Hooks / useTaskCard",
|
|
18268
|
+
};
|
|
18269
|
+
function setupGraphQL$7() {
|
|
18270
|
+
const id = "sam+klip@saasquat.ch";
|
|
18271
|
+
const accountId = id;
|
|
18272
|
+
const programId = "klip-referral-program";
|
|
18273
|
+
//@ts-ignore
|
|
18274
|
+
window.widgetIdent = {
|
|
18275
|
+
tenantAlias: "test_a74miwdpofztj",
|
|
18276
|
+
appDomain: "https://staging.referralsaasquatch.com",
|
|
18277
|
+
programId,
|
|
18278
|
+
};
|
|
18279
|
+
useEffect(() => {
|
|
18280
|
+
L$1({
|
|
18281
|
+
accountId,
|
|
18282
|
+
id,
|
|
18283
|
+
jwt: JWT,
|
|
18284
|
+
});
|
|
18285
|
+
return () => {
|
|
18286
|
+
window.widgetIdent = undefined;
|
|
18287
|
+
L$1(undefined);
|
|
18288
|
+
};
|
|
18289
|
+
}, []);
|
|
18290
|
+
return { id, accountId };
|
|
18291
|
+
}
|
|
18292
|
+
const TaskCard = createHookStory(() => {
|
|
18293
|
+
setupGraphQL$7();
|
|
18294
|
+
return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
|
|
18295
|
+
});
|
|
18296
|
+
|
|
18297
|
+
const UseTaskCard = /*#__PURE__*/Object.freeze({
|
|
18298
|
+
__proto__: null,
|
|
18299
|
+
'default': UseTaskCard_stories,
|
|
18300
|
+
TaskCard: TaskCard
|
|
18301
|
+
});
|
|
18302
|
+
|
|
18245
18303
|
const NewPortal_stories = {
|
|
18246
18304
|
title: "New Portal",
|
|
18247
18305
|
};
|
|
@@ -18361,10 +18419,10 @@ const Dashboard = () => {
|
|
|
18361
18419
|
h("h1", null, "John Smith"))),
|
|
18362
18420
|
})),
|
|
18363
18421
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18364
|
-
h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
|
|
18365
|
-
h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
|
|
18366
|
-
h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
|
|
18367
|
-
h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
|
|
18422
|
+
h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
|
|
18423
|
+
h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
|
|
18424
|
+
h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
|
|
18425
|
+
h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
|
|
18368
18426
|
h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
|
|
18369
18427
|
h(PortalSectionView, Object.assign({}, {
|
|
18370
18428
|
labelMargin: "x-large",
|
|
@@ -18488,10 +18546,10 @@ const Commissions = () => {
|
|
|
18488
18546
|
"program"))),
|
|
18489
18547
|
})),
|
|
18490
18548
|
h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18491
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
|
|
18492
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
|
|
18493
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
|
|
18494
|
-
h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
|
|
18549
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
|
|
18550
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
|
|
18551
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
|
|
18552
|
+
h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
|
|
18495
18553
|
};
|
|
18496
18554
|
const Activity = () => {
|
|
18497
18555
|
return (h("sqm-divided-layout", { direction: "row" },
|
|
@@ -18518,10 +18576,10 @@ const Activity = () => {
|
|
|
18518
18576
|
label: (h("sqm-text", null,
|
|
18519
18577
|
h("h3", null, "Referral Activity"))),
|
|
18520
18578
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18521
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
|
|
18522
|
-
h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
|
|
18523
|
-
h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
|
|
18524
|
-
h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
|
|
18579
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
|
|
18580
|
+
h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
|
|
18581
|
+
h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
|
|
18582
|
+
h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
|
|
18525
18583
|
}))),
|
|
18526
18584
|
h(PortalSectionView, Object.assign({}, {
|
|
18527
18585
|
labelMargin: "x-large",
|
|
@@ -18529,9 +18587,9 @@ const Activity = () => {
|
|
|
18529
18587
|
label: (h("sqm-text", null,
|
|
18530
18588
|
h("h3", null, "Traffic Generated"))),
|
|
18531
18589
|
content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
|
|
18532
|
-
h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
|
|
18533
|
-
h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
|
|
18534
|
-
h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
|
|
18590
|
+
h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
|
|
18591
|
+
h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
|
|
18592
|
+
h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
|
|
18535
18593
|
})))));
|
|
18536
18594
|
};
|
|
18537
18595
|
|
|
@@ -20536,8 +20594,496 @@ const PasswordField = /*#__PURE__*/Object.freeze({
|
|
|
20536
20594
|
ValidationError: ValidationError
|
|
20537
20595
|
});
|
|
20538
20596
|
|
|
20597
|
+
const checkmark_circle = () => {
|
|
20598
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
20599
|
+
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" })));
|
|
20600
|
+
};
|
|
20601
|
+
const arrow_left_right = () => {
|
|
20602
|
+
return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20603
|
+
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" })));
|
|
20604
|
+
};
|
|
20605
|
+
|
|
20606
|
+
const gift = () => {
|
|
20607
|
+
return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
20608
|
+
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)" }),
|
|
20609
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
|
|
20610
|
+
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)" })));
|
|
20611
|
+
};
|
|
20612
|
+
|
|
20613
|
+
function ProgressBarView(props) {
|
|
20614
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, } = props;
|
|
20615
|
+
console.log("progress bar props", props);
|
|
20616
|
+
const gift1 = gift();
|
|
20617
|
+
const gift2 = gift();
|
|
20618
|
+
const gift3 = gift();
|
|
20619
|
+
var items = [];
|
|
20620
|
+
var columns = "";
|
|
20621
|
+
var repetitions = Math.floor(progress / goal);
|
|
20622
|
+
if (repeatable) {
|
|
20623
|
+
if (steps) {
|
|
20624
|
+
addStepsRepeatable();
|
|
20625
|
+
}
|
|
20626
|
+
else {
|
|
20627
|
+
addLinearRepeatable();
|
|
20628
|
+
}
|
|
20629
|
+
}
|
|
20630
|
+
// non repeatable
|
|
20631
|
+
else {
|
|
20632
|
+
if (steps) {
|
|
20633
|
+
addSteps();
|
|
20634
|
+
}
|
|
20635
|
+
else {
|
|
20636
|
+
addLinear();
|
|
20637
|
+
}
|
|
20638
|
+
}
|
|
20639
|
+
const style = {
|
|
20640
|
+
ProgressBar: {
|
|
20641
|
+
"& .progress-bar": {
|
|
20642
|
+
height: "15px",
|
|
20643
|
+
marginTop: "var(--sl-spacing-xx-large)",
|
|
20644
|
+
marginBottom: "var(--sl-spacing-xx-large)",
|
|
20645
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
20646
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
20647
|
+
display: "grid",
|
|
20648
|
+
gridTemplateColumns: columns,
|
|
20649
|
+
lineHeight: "45px",
|
|
20650
|
+
userSelect: "none",
|
|
20651
|
+
},
|
|
20652
|
+
"& .progress-bar.repeatable-steps": {
|
|
20653
|
+
marginLeft: "var(--sl-spacing-x-small)",
|
|
20654
|
+
},
|
|
20655
|
+
"& .filled:after": {
|
|
20656
|
+
content: '""',
|
|
20657
|
+
display: "flex",
|
|
20658
|
+
width: "100%",
|
|
20659
|
+
height: "4px",
|
|
20660
|
+
borderRadius: "4px",
|
|
20661
|
+
backgroundColor: "var(--sl-color-primary-500)",
|
|
20662
|
+
},
|
|
20663
|
+
"& .progress": {
|
|
20664
|
+
display: "block",
|
|
20665
|
+
textAlign: "center",
|
|
20666
|
+
marginLeft: "-100px",
|
|
20667
|
+
marginRight: "-100px",
|
|
20668
|
+
},
|
|
20669
|
+
"& .progress::after": {
|
|
20670
|
+
content: '""',
|
|
20671
|
+
width: "12px",
|
|
20672
|
+
height: "12px",
|
|
20673
|
+
display: "flex",
|
|
20674
|
+
backgroundColor: "var(--sl-color-primary-500)",
|
|
20675
|
+
borderRadius: "50%",
|
|
20676
|
+
position: "relative",
|
|
20677
|
+
left: "47%",
|
|
20678
|
+
top: "-85%",
|
|
20679
|
+
},
|
|
20680
|
+
"& .progress.bg:after": {
|
|
20681
|
+
width: "0",
|
|
20682
|
+
height: "0",
|
|
20683
|
+
border: "none",
|
|
20684
|
+
},
|
|
20685
|
+
"& .progress.top": {
|
|
20686
|
+
position: "relative",
|
|
20687
|
+
top: "-40px",
|
|
20688
|
+
},
|
|
20689
|
+
"& .progress.top:after": {
|
|
20690
|
+
top: "-16%",
|
|
20691
|
+
},
|
|
20692
|
+
"& .empty": {
|
|
20693
|
+
display: "block",
|
|
20694
|
+
textAlign: "center",
|
|
20695
|
+
marginLeft: "-100px",
|
|
20696
|
+
marginRight: "-100px",
|
|
20697
|
+
},
|
|
20698
|
+
"& .empty::after": {
|
|
20699
|
+
content: '""',
|
|
20700
|
+
width: "12px",
|
|
20701
|
+
height: "12px",
|
|
20702
|
+
border: "2px solid #E0E0E0",
|
|
20703
|
+
margin: "-2px",
|
|
20704
|
+
display: "flex",
|
|
20705
|
+
backgroundColor: "white",
|
|
20706
|
+
borderRadius: "50%",
|
|
20707
|
+
position: "relative",
|
|
20708
|
+
left: "47%",
|
|
20709
|
+
top: "-85%",
|
|
20710
|
+
},
|
|
20711
|
+
"& .empty.bg:after": {
|
|
20712
|
+
width: "0",
|
|
20713
|
+
height: "0",
|
|
20714
|
+
border: "none",
|
|
20715
|
+
},
|
|
20716
|
+
"& .remain:after": {
|
|
20717
|
+
content: '""',
|
|
20718
|
+
display: "flex",
|
|
20719
|
+
width: "100%",
|
|
20720
|
+
height: "4px",
|
|
20721
|
+
borderRadius: "4px",
|
|
20722
|
+
backgroundColor: "#E0E0E0",
|
|
20723
|
+
},
|
|
20724
|
+
"& .gift.bw": {
|
|
20725
|
+
filter: "grayscale(100%)",
|
|
20726
|
+
},
|
|
20727
|
+
"& .gift.start": {
|
|
20728
|
+
transform: "scale(80%)",
|
|
20729
|
+
top: "-20px",
|
|
20730
|
+
},
|
|
20731
|
+
"& .gift": {
|
|
20732
|
+
textAlign: "center",
|
|
20733
|
+
marginLeft: "-100px",
|
|
20734
|
+
marginRight: "-100px",
|
|
20735
|
+
position: "relative",
|
|
20736
|
+
display: "list-item",
|
|
20737
|
+
listStyleType: "none",
|
|
20738
|
+
top: "-18px",
|
|
20739
|
+
filter: goal <= progress ? "" : "grayscale(100%)",
|
|
20740
|
+
zIndex: "1",
|
|
20741
|
+
},
|
|
20742
|
+
},
|
|
20743
|
+
};
|
|
20744
|
+
jss.setup(create());
|
|
20745
|
+
const sheet = jss.createStyleSheet(style);
|
|
20746
|
+
const styleString = sheet.toString();
|
|
20747
|
+
return (h("div", { class: sheet.classes.ProgressBar },
|
|
20748
|
+
h("style", { type: "text/css" }, styleString),
|
|
20749
|
+
h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
|
|
20750
|
+
function clamp(x, min, max) {
|
|
20751
|
+
return Math.min(Math.max(x, min), max);
|
|
20752
|
+
}
|
|
20753
|
+
function addLinear() {
|
|
20754
|
+
const ratio = progress / goal;
|
|
20755
|
+
columns =
|
|
20756
|
+
clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
|
|
20757
|
+
items.push(h("div", { class: "filled" }));
|
|
20758
|
+
items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
|
|
20759
|
+
? ""
|
|
20760
|
+
: progressBarUnit + clamp(progress, 0, goal)));
|
|
20761
|
+
items.push(h("div", { class: "remain" }));
|
|
20762
|
+
items.push(h("div", { class: "progress bg" }, goal));
|
|
20763
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
20764
|
+
}
|
|
20765
|
+
function addSteps() {
|
|
20766
|
+
let ratio = 1 / goal;
|
|
20767
|
+
for (let i = 1; i < goal; i++) {
|
|
20768
|
+
columns += ratio + "fr 0fr ";
|
|
20769
|
+
if (i > progress) {
|
|
20770
|
+
items.push(h("div", { class: "remain" }));
|
|
20771
|
+
items.push(h("div", { class: "empty" }, i));
|
|
20772
|
+
}
|
|
20773
|
+
else {
|
|
20774
|
+
items.push(h("div", { class: "filled" }));
|
|
20775
|
+
items.push(h("div", { class: "progress" }, i));
|
|
20776
|
+
}
|
|
20777
|
+
}
|
|
20778
|
+
columns += ratio + "fr 0fr ";
|
|
20779
|
+
// reward success
|
|
20780
|
+
if (goal <= progress) {
|
|
20781
|
+
columns += "0fr ";
|
|
20782
|
+
items.push(h("div", { class: "filled" }));
|
|
20783
|
+
items.push(h("div", { class: "progress bg" }, goal));
|
|
20784
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
20785
|
+
}
|
|
20786
|
+
// reward fail
|
|
20787
|
+
else {
|
|
20788
|
+
columns += "0fr ";
|
|
20789
|
+
items.push(h("div", { class: "remain" }));
|
|
20790
|
+
items.push(h("div", { class: "empty bg" }, goal));
|
|
20791
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
20792
|
+
}
|
|
20793
|
+
}
|
|
20794
|
+
function addLinearRepeatable() {
|
|
20795
|
+
let repetitions = Math.floor(progress / goal);
|
|
20796
|
+
let ratio = ((progress % goal) / goal) * 0.5;
|
|
20797
|
+
// 0 repetition
|
|
20798
|
+
if (repetitions == 0) {
|
|
20799
|
+
columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
20800
|
+
items.push(h("div", { class: "filled" }));
|
|
20801
|
+
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
|
|
20802
|
+
items.push(h("div", { class: "remain" }));
|
|
20803
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
20804
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
20805
|
+
items.push(h("div", { class: "remain" }));
|
|
20806
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
20807
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
20808
|
+
}
|
|
20809
|
+
// single repetition
|
|
20810
|
+
else if (repetitions == 1) {
|
|
20811
|
+
columns =
|
|
20812
|
+
"0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
|
|
20813
|
+
items.push(h("div", { class: "filled" }));
|
|
20814
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
|
|
20815
|
+
items.push(h("div", { class: "gift" }, gift1));
|
|
20816
|
+
items.push(h("div", { class: "filled" }));
|
|
20817
|
+
items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
|
|
20818
|
+
items.push(h("div", { class: "remain" }));
|
|
20819
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
20820
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
20821
|
+
}
|
|
20822
|
+
// multiple repetitions
|
|
20823
|
+
else {
|
|
20824
|
+
columns =
|
|
20825
|
+
"0fr 0fr 0.5fr 0fr 0fr " +
|
|
20826
|
+
ratio +
|
|
20827
|
+
"fr 0fr " +
|
|
20828
|
+
(0.5 - ratio) +
|
|
20829
|
+
"fr 0fr 0fr";
|
|
20830
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
|
|
20831
|
+
items.push(h("div", { class: "gift start" }, gift1));
|
|
20832
|
+
items.push(h("div", { class: "filled" }));
|
|
20833
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
|
|
20834
|
+
items.push(h("div", { class: "gift" }, gift2));
|
|
20835
|
+
items.push(h("div", { class: "filled" }));
|
|
20836
|
+
items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
|
|
20837
|
+
items.push(h("div", { class: "remain" }));
|
|
20838
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
|
|
20839
|
+
items.push(h("div", { class: "gift bw" }, gift3));
|
|
20840
|
+
}
|
|
20841
|
+
}
|
|
20842
|
+
function addStepsRepeatable() {
|
|
20843
|
+
let repetitions = Math.floor(progress / goal);
|
|
20844
|
+
// no or single repetition
|
|
20845
|
+
if (repetitions < 2) {
|
|
20846
|
+
let ratio = 1 / goal;
|
|
20847
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
20848
|
+
columns += ratio + "fr 0fr ";
|
|
20849
|
+
if (i > progress) {
|
|
20850
|
+
if (i == goal) {
|
|
20851
|
+
columns += "0fr ";
|
|
20852
|
+
items.push(h("div", { class: "remain" }));
|
|
20853
|
+
items.push(h("div", { class: "empty bg" }, goal));
|
|
20854
|
+
items.push(h("div", { class: "gift bw" }, gift1));
|
|
20855
|
+
}
|
|
20856
|
+
else if (i == goal * 2) {
|
|
20857
|
+
columns += "0fr 0fr";
|
|
20858
|
+
items.push(h("div", { class: "remain" }));
|
|
20859
|
+
items.push(h("div", { class: "empty bg" }, goal * 2));
|
|
20860
|
+
items.push(h("div", { class: "gift bw" }, gift2));
|
|
20861
|
+
}
|
|
20862
|
+
else {
|
|
20863
|
+
items.push(h("div", { class: "remain" }));
|
|
20864
|
+
items.push(h("div", { class: "empty" }, progressBarUnit + i));
|
|
20865
|
+
}
|
|
20866
|
+
}
|
|
20867
|
+
else if (i == goal) {
|
|
20868
|
+
columns += "0fr ";
|
|
20869
|
+
items.push(h("div", { class: "filled" }));
|
|
20870
|
+
items.push(h("div", { class: "progress bg" }, i));
|
|
20871
|
+
items.push(h("div", { class: "gift" }, gift3));
|
|
20872
|
+
}
|
|
20873
|
+
else {
|
|
20874
|
+
items.push(h("div", { class: "filled" }));
|
|
20875
|
+
items.push(h("div", { class: "progress" }, i));
|
|
20876
|
+
}
|
|
20877
|
+
}
|
|
20878
|
+
}
|
|
20879
|
+
// case repetition many
|
|
20880
|
+
else {
|
|
20881
|
+
let position = (progress % goal) + goal;
|
|
20882
|
+
let ratio = 1 / goal;
|
|
20883
|
+
columns += "0fr 0fr ";
|
|
20884
|
+
items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
|
|
20885
|
+
items.push(h("div", { class: "gift start" }, gift1));
|
|
20886
|
+
for (let i = 1; i < goal * 2 + 1; i++) {
|
|
20887
|
+
columns += ratio + "fr 0fr ";
|
|
20888
|
+
if (i <= goal) {
|
|
20889
|
+
if (i == goal) {
|
|
20890
|
+
columns += "0fr ";
|
|
20891
|
+
items.push(h("div", { class: "filled" }));
|
|
20892
|
+
items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
|
|
20893
|
+
items.push(h("div", { class: "gift" }, gift2));
|
|
20894
|
+
}
|
|
20895
|
+
else {
|
|
20896
|
+
items.push(h("div", { class: "filled" }));
|
|
20897
|
+
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
20898
|
+
}
|
|
20899
|
+
}
|
|
20900
|
+
else if (i > position) {
|
|
20901
|
+
if (i == goal * 2) {
|
|
20902
|
+
columns += "0fr 0fr";
|
|
20903
|
+
items.push(h("div", { class: "remain" }));
|
|
20904
|
+
items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
|
|
20905
|
+
items.push(h("div", { class: "gift bw" }, gift3));
|
|
20906
|
+
}
|
|
20907
|
+
else {
|
|
20908
|
+
items.push(h("div", { class: "remain" }));
|
|
20909
|
+
items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
|
|
20910
|
+
}
|
|
20911
|
+
}
|
|
20912
|
+
else {
|
|
20913
|
+
items.push(h("div", { class: "filled" }));
|
|
20914
|
+
items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
|
|
20915
|
+
}
|
|
20916
|
+
}
|
|
20917
|
+
}
|
|
20918
|
+
}
|
|
20919
|
+
}
|
|
20920
|
+
|
|
20921
|
+
function TaskCardView(props) {
|
|
20922
|
+
const { points, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpire, dateExpires, buttonText, buttonLink, loading, } = props;
|
|
20923
|
+
console.log({ props });
|
|
20924
|
+
const checkmark_circle$1 = checkmark_circle();
|
|
20925
|
+
const arrow_left_right$1 = arrow_left_right();
|
|
20926
|
+
const style = {
|
|
20927
|
+
HostBlock: HostBlock,
|
|
20928
|
+
TaskCard: {
|
|
20929
|
+
"& .main > div": {
|
|
20930
|
+
margin: "var(--sl-spacing-medium)",
|
|
20931
|
+
},
|
|
20932
|
+
"& .main": {
|
|
20933
|
+
position: "relative",
|
|
20934
|
+
boxSizing: "border-box",
|
|
20935
|
+
minWidth: "347px",
|
|
20936
|
+
background: "var(--sl-color-white)",
|
|
20937
|
+
border: "1px solid var(--sl-color-gray-300)",
|
|
20938
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
20939
|
+
fontSize: "var(--sl-font-size-small)",
|
|
20940
|
+
lineHeight: "var(--sl-line-height-dense)",
|
|
20941
|
+
},
|
|
20942
|
+
"& .main.complete": {
|
|
20943
|
+
background: "var(--sl-color-primary-50)",
|
|
20944
|
+
borderColor: "var(--sl-color-primary-700)",
|
|
20945
|
+
},
|
|
20946
|
+
},
|
|
20947
|
+
Header: {
|
|
20948
|
+
display: "flex",
|
|
20949
|
+
"& .icon": {
|
|
20950
|
+
alignSelf: "center",
|
|
20951
|
+
lineHeight: "0",
|
|
20952
|
+
color: "var(--sl-color-primary-700)",
|
|
20953
|
+
fontSize: "var(--sl-font-size-large)",
|
|
20954
|
+
marginRight: "var(--sl-spacing-x-small)",
|
|
20955
|
+
},
|
|
20956
|
+
"& .value": {
|
|
20957
|
+
alignSelf: "center",
|
|
20958
|
+
color: "var(--sl-color-black)",
|
|
20959
|
+
fontSize: "var(--sl-font-size-x-large)",
|
|
20960
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
20961
|
+
lineHeight: "100%",
|
|
20962
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
20963
|
+
},
|
|
20964
|
+
"& .text": {
|
|
20965
|
+
alignSelf: "end",
|
|
20966
|
+
textTransform: "uppercase",
|
|
20967
|
+
color: "var(--sl-color-gray-600)",
|
|
20968
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
20969
|
+
lineHeight: "var(--sl-font-size-medium)",
|
|
20970
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
20971
|
+
},
|
|
20972
|
+
},
|
|
20973
|
+
Title: {
|
|
20974
|
+
color: "var(--sl-color-black)",
|
|
20975
|
+
fontSize: "var(--sl-font-size-small)",
|
|
20976
|
+
},
|
|
20977
|
+
Footer: {
|
|
20978
|
+
display: "flex",
|
|
20979
|
+
"& .icon": {
|
|
20980
|
+
fontSize: "var(--sl-font-size-xx-small)",
|
|
20981
|
+
marginRight: "var(--sl-spacing-xx-small)",
|
|
20982
|
+
},
|
|
20983
|
+
"& .text": {
|
|
20984
|
+
marginTop: "auto",
|
|
20985
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
20986
|
+
color: "var(--sl-color-gray-600)",
|
|
20987
|
+
},
|
|
20988
|
+
"& .action": {
|
|
20989
|
+
marginTop: "auto",
|
|
20990
|
+
marginLeft: "auto",
|
|
20991
|
+
},
|
|
20992
|
+
"& sl-button.action::part(base) ": {
|
|
20993
|
+
color: "var(--sl-color-white)",
|
|
20994
|
+
background: "var(--sl-color-primary-500)",
|
|
20995
|
+
border: "1px solid var(--sl-color-primary-500)",
|
|
20996
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
20997
|
+
},
|
|
20998
|
+
},
|
|
20999
|
+
};
|
|
21000
|
+
jss.setup(create());
|
|
21001
|
+
const sheet = jss.createStyleSheet(style);
|
|
21002
|
+
const styleString = sheet.toString();
|
|
21003
|
+
const showComplete = progress >= goal;
|
|
21004
|
+
const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
|
|
21005
|
+
console.log({ showProgressBar, loading });
|
|
21006
|
+
return (h("div", { class: sheet.classes.TaskCard },
|
|
21007
|
+
h("div", { class: showComplete ? "main complete" : "main" },
|
|
21008
|
+
h("style", { type: "text/css" }, styleString),
|
|
21009
|
+
h("div", { class: sheet.classes.Header },
|
|
21010
|
+
showComplete && h("span", { class: "icon" }, checkmark_circle$1),
|
|
21011
|
+
h("span", { class: "value" }, points),
|
|
21012
|
+
h("span", { class: "text" }, rewardUnit)),
|
|
21013
|
+
h("div", { class: sheet.classes.Title }, cardTitle),
|
|
21014
|
+
showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props))),
|
|
21015
|
+
h(Details, { description: description }),
|
|
21016
|
+
h("div", { class: sheet.classes.Footer },
|
|
21017
|
+
h("span", { class: "text" },
|
|
21018
|
+
repeatable && (h("div", null,
|
|
21019
|
+
h("span", { class: "icon" }, arrow_left_right$1),
|
|
21020
|
+
h("span", null,
|
|
21021
|
+
"Completed ",
|
|
21022
|
+
repetitions,
|
|
21023
|
+
" times"))),
|
|
21024
|
+
showExpire && (h("span", null,
|
|
21025
|
+
"Ends ",
|
|
21026
|
+
" ",
|
|
21027
|
+
dateExpires))),
|
|
21028
|
+
h("sl-button", { class: "action", size: "small", onClick: () => alert(buttonLink), disabled: showComplete && repeatable == false }, showComplete && repeatable == false
|
|
21029
|
+
? "Task completed"
|
|
21030
|
+
: buttonText)))));
|
|
21031
|
+
}
|
|
21032
|
+
function Details(props) {
|
|
21033
|
+
const style = {
|
|
21034
|
+
Description: {
|
|
21035
|
+
"& input[type=checkbox]": {
|
|
21036
|
+
display: "none",
|
|
21037
|
+
},
|
|
21038
|
+
"& input:checked ~ .details": {
|
|
21039
|
+
transform: "rotate(-180deg)",
|
|
21040
|
+
},
|
|
21041
|
+
"& .details": {
|
|
21042
|
+
position: "absolute",
|
|
21043
|
+
top: "var(--sl-spacing-medium)",
|
|
21044
|
+
right: "var(--sl-spacing-medium)",
|
|
21045
|
+
color: "var(--sl-color-gray-700)",
|
|
21046
|
+
fontSize: "var(--sl-font-size-large)",
|
|
21047
|
+
"& :hover": {
|
|
21048
|
+
color: "var(--sl-color-primary-700)",
|
|
21049
|
+
},
|
|
21050
|
+
transformOrigin: "50% 37%",
|
|
21051
|
+
transition: "transform var(--sl-transition-medium) ease",
|
|
21052
|
+
},
|
|
21053
|
+
"& input:checked ~ .summary": {
|
|
21054
|
+
transition: "max-height var(--sl-transition-medium) ease",
|
|
21055
|
+
maxHeight: "300px",
|
|
21056
|
+
},
|
|
21057
|
+
"& .summary": {
|
|
21058
|
+
display: "block",
|
|
21059
|
+
overflow: "hidden",
|
|
21060
|
+
color: "var(--sl-color-gray-700)",
|
|
21061
|
+
fontSize: "var(--sl-font-size-x-small)",
|
|
21062
|
+
maxHeight: "0px",
|
|
21063
|
+
transition: "max-height var(--sl-transition-fast) ease-out",
|
|
21064
|
+
},
|
|
21065
|
+
},
|
|
21066
|
+
};
|
|
21067
|
+
jss.setup(create());
|
|
21068
|
+
const sheet = jss.createStyleSheet(style);
|
|
21069
|
+
const styleString = sheet.toString();
|
|
21070
|
+
const rid = Math.random().toString(36).slice(2);
|
|
21071
|
+
return (h("div", null,
|
|
21072
|
+
h("style", { type: "text/css" }, styleString),
|
|
21073
|
+
h("span", { class: sheet.classes.Description },
|
|
21074
|
+
h("input", { type: "checkbox", id: "details-" + rid }),
|
|
21075
|
+
h("label", { class: "details", htmlFor: "details-" + rid },
|
|
21076
|
+
h("sl-icon", { name: "chevron-down" })),
|
|
21077
|
+
h("span", { class: "summary" }, props.description))));
|
|
21078
|
+
}
|
|
21079
|
+
|
|
21080
|
+
const scenario$5 = "@author:\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario Outline: Task Card View\r\n\r\n\t\tGiven <points>, <title>, <description>, <progress>, <goal>, <buttonText>, <buttonLink>,\r\n\t\tThen <points> is shown on the top left corner of the header area\r\n\t\tAnd <title> is shown in the body area left aligned and in bold text\r\n\t\tAnd <buttonText> is shown on the bottom right corner of the footer area\r\n\t\tWhen the user clicks on details icon\r\n\t\tThen <description> becomes visible\r\n\r\n\t\tExamples:\r\n\t\t\t| points | title | description | progress | goal | buttonText | buttonLink |\r\n\t\t\t| 20 | Complete a survey | Description of action | 0 | 1 | Take Survey | www.example.com |\r\n\r\n\tScenario Outline: Task Card Single Action\r\n\r\n\t\tGiven a task card\r\n\t\tAnd showProgressBar has value false\r\n\r\n\tScenario Outline: Single Action Repeatable\r\n\r\n\r\n\tScenario Outline: Task Card Expiry\r\n\r\n\t\tGiven a task card component\r\n\t\tAnd it has expire value true\r\n\t\tAnd it has <dateExpire>\r\n\t\tThen <dateExpire> is shown on the lower left corner of the task card\r\n";
|
|
21081
|
+
|
|
20539
21082
|
const TaskCard_stories = {
|
|
20540
|
-
title: "Components/Task Card",
|
|
21083
|
+
title: "Components/Task Card/",
|
|
21084
|
+
parameters: {
|
|
21085
|
+
scenario: scenario$5,
|
|
21086
|
+
},
|
|
20541
21087
|
};
|
|
20542
21088
|
const resizable = {
|
|
20543
21089
|
width: "347px",
|
|
@@ -20546,35 +21092,47 @@ const resizable = {
|
|
|
20546
21092
|
height: "fit-content",
|
|
20547
21093
|
overflow: "hidden",
|
|
20548
21094
|
};
|
|
20549
|
-
const Default$a = () => {
|
|
20550
|
-
// @ts-ignore
|
|
20551
|
-
return h(TaskCardView, null);
|
|
20552
|
-
};
|
|
20553
21095
|
const NotRepeatable = () => {
|
|
20554
21096
|
const oneAction = {
|
|
20555
21097
|
points: 20,
|
|
21098
|
+
showExpire: false,
|
|
21099
|
+
rewardUnit: "Points",
|
|
20556
21100
|
cardTitle: "Complete a survey",
|
|
21101
|
+
repeatable: false,
|
|
20557
21102
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20558
21103
|
buttonText: "Take survey",
|
|
20559
21104
|
goal: 1,
|
|
21105
|
+
buttonLink: "https://example.com/",
|
|
21106
|
+
showProgressBar: false,
|
|
21107
|
+
loading: false,
|
|
20560
21108
|
};
|
|
20561
21109
|
const coupleActions = {
|
|
20562
21110
|
points: 40,
|
|
21111
|
+
rewardUnit: "Points",
|
|
20563
21112
|
cardTitle: "Comment on 5 articles",
|
|
20564
21113
|
showProgressBar: true,
|
|
21114
|
+
showExpire: false,
|
|
20565
21115
|
goal: 5,
|
|
20566
|
-
|
|
21116
|
+
repeatable: false,
|
|
21117
|
+
steps: true,
|
|
20567
21118
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20568
21119
|
buttonText: "Start reading",
|
|
21120
|
+
buttonLink: "https://example.com/",
|
|
21121
|
+
loading: false,
|
|
20569
21122
|
};
|
|
20570
21123
|
const manyActions = {
|
|
20571
21124
|
points: 150,
|
|
21125
|
+
rewardUnit: "Points",
|
|
20572
21126
|
cardTitle: "Spend $500 at our Store",
|
|
20573
21127
|
showProgressBar: true,
|
|
21128
|
+
showExpire: false,
|
|
20574
21129
|
goal: 500,
|
|
21130
|
+
repeatable: false,
|
|
20575
21131
|
unit: "$",
|
|
20576
21132
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20577
21133
|
buttonText: "Visit our Store",
|
|
21134
|
+
buttonLink: "https://example.com/",
|
|
21135
|
+
loading: false,
|
|
20578
21136
|
};
|
|
20579
21137
|
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
20580
21138
|
h("div", { style: resizable },
|
|
@@ -20595,13 +21153,6 @@ const NotRepeatable = () => {
|
|
|
20595
21153
|
h("h5", null),
|
|
20596
21154
|
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
20597
21155
|
" ",
|
|
20598
|
-
h("h5", null),
|
|
20599
|
-
h("h5", null,
|
|
20600
|
-
"Progress ",
|
|
20601
|
-
">",
|
|
20602
|
-
" Goal"),
|
|
20603
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
|
|
20604
|
-
" ",
|
|
20605
21156
|
h("h5", null)),
|
|
20606
21157
|
h("div", { style: resizable },
|
|
20607
21158
|
h("h4", null, "Many Actions"),
|
|
@@ -20613,46 +21164,52 @@ const NotRepeatable = () => {
|
|
|
20613
21164
|
h("h5", null),
|
|
20614
21165
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
20615
21166
|
" ",
|
|
20616
|
-
h("h5", null),
|
|
20617
|
-
h("h5", null,
|
|
20618
|
-
"Progress ",
|
|
20619
|
-
">",
|
|
20620
|
-
" Goal"),
|
|
20621
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
|
|
20622
|
-
" ",
|
|
20623
21167
|
h("h5", null))));
|
|
20624
21168
|
};
|
|
20625
21169
|
const NotRepeatableWithExpiry = () => {
|
|
20626
21170
|
const oneAction = {
|
|
20627
21171
|
points: 20,
|
|
21172
|
+
rewardUnit: "Points",
|
|
20628
21173
|
cardTitle: "Complete a survey",
|
|
20629
21174
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20630
21175
|
buttonText: "Take survey",
|
|
20631
21176
|
goal: 1,
|
|
20632
|
-
|
|
20633
|
-
|
|
21177
|
+
showExpire: true,
|
|
21178
|
+
repeatable: false,
|
|
21179
|
+
dateExpires: "Nov 1, 2021",
|
|
21180
|
+
buttonLink: "https://example.com/",
|
|
21181
|
+
showProgressBar: false,
|
|
21182
|
+
loading: false,
|
|
20634
21183
|
};
|
|
20635
21184
|
const coupleActions = {
|
|
20636
21185
|
points: 40,
|
|
21186
|
+
rewardUnit: "Points",
|
|
20637
21187
|
cardTitle: "Comment on 5 articles",
|
|
20638
21188
|
showProgressBar: true,
|
|
20639
21189
|
goal: 5,
|
|
20640
|
-
steps:
|
|
21190
|
+
steps: true,
|
|
20641
21191
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20642
21192
|
buttonText: "Start reading",
|
|
20643
|
-
|
|
20644
|
-
|
|
21193
|
+
showExpire: true,
|
|
21194
|
+
repeatable: false,
|
|
21195
|
+
dateExpires: "Nov 1, 2021",
|
|
21196
|
+
buttonLink: "https://example.com/",
|
|
21197
|
+
loading: false,
|
|
20645
21198
|
};
|
|
20646
21199
|
const manyActions = {
|
|
20647
21200
|
points: 150,
|
|
21201
|
+
rewardUnit: "Points",
|
|
21202
|
+
repeatable: false,
|
|
20648
21203
|
cardTitle: "Spend $500 at our Store",
|
|
20649
21204
|
showProgressBar: true,
|
|
20650
21205
|
goal: 500,
|
|
20651
21206
|
unit: "$",
|
|
20652
21207
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20653
21208
|
buttonText: "Visit our Store",
|
|
20654
|
-
|
|
20655
|
-
|
|
21209
|
+
showExpire: true,
|
|
21210
|
+
dateExpires: "Nov 1, 2021",
|
|
21211
|
+
buttonLink: "https://example.com/",
|
|
21212
|
+
loading: false,
|
|
20656
21213
|
};
|
|
20657
21214
|
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
20658
21215
|
h("div", { style: resizable },
|
|
@@ -20673,13 +21230,6 @@ const NotRepeatableWithExpiry = () => {
|
|
|
20673
21230
|
h("h5", null),
|
|
20674
21231
|
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
20675
21232
|
" ",
|
|
20676
|
-
h("h5", null),
|
|
20677
|
-
h("h5", null,
|
|
20678
|
-
"Progress ",
|
|
20679
|
-
">",
|
|
20680
|
-
" Goal"),
|
|
20681
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
|
|
20682
|
-
" ",
|
|
20683
21233
|
h("h5", null)),
|
|
20684
21234
|
h("div", { style: resizable },
|
|
20685
21235
|
h("h4", null, "Many Actions"),
|
|
@@ -20691,36 +21241,40 @@ const NotRepeatableWithExpiry = () => {
|
|
|
20691
21241
|
h("h5", null),
|
|
20692
21242
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
20693
21243
|
" ",
|
|
20694
|
-
h("h5", null),
|
|
20695
|
-
h("h5", null,
|
|
20696
|
-
"Progress ",
|
|
20697
|
-
">",
|
|
20698
|
-
" Goal"),
|
|
20699
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
|
|
20700
|
-
" ",
|
|
20701
21244
|
h("h5", null))));
|
|
20702
21245
|
};
|
|
20703
21246
|
const Repeatable = () => {
|
|
20704
21247
|
const oneAction = {
|
|
20705
21248
|
points: 20,
|
|
21249
|
+
rewardUnit: "Points",
|
|
21250
|
+
showExpire: false,
|
|
20706
21251
|
cardTitle: "Complete a survey",
|
|
20707
21252
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20708
21253
|
buttonText: "Take survey",
|
|
20709
21254
|
goal: 1,
|
|
20710
21255
|
repeatable: true,
|
|
21256
|
+
buttonLink: "https://example.com/",
|
|
21257
|
+
showProgressBar: false,
|
|
21258
|
+
loading: false,
|
|
20711
21259
|
};
|
|
20712
21260
|
const coupleActions = {
|
|
20713
21261
|
points: 40,
|
|
21262
|
+
rewardUnit: "Points",
|
|
21263
|
+
showExpire: false,
|
|
20714
21264
|
cardTitle: "Comment on 5 articles",
|
|
20715
21265
|
showProgressBar: true,
|
|
20716
21266
|
repeatable: true,
|
|
20717
21267
|
goal: 5,
|
|
20718
|
-
steps:
|
|
21268
|
+
steps: true,
|
|
20719
21269
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20720
21270
|
buttonText: "Start reading",
|
|
21271
|
+
buttonLink: "https://example.com/",
|
|
21272
|
+
loading: false,
|
|
20721
21273
|
};
|
|
20722
21274
|
const manyActions = {
|
|
20723
21275
|
points: 150,
|
|
21276
|
+
rewardUnit: "Points",
|
|
21277
|
+
showExpire: false,
|
|
20724
21278
|
cardTitle: "Spend $500 at our Store",
|
|
20725
21279
|
showProgressBar: true,
|
|
20726
21280
|
repeatable: true,
|
|
@@ -20728,6 +21282,8 @@ const Repeatable = () => {
|
|
|
20728
21282
|
unit: "$",
|
|
20729
21283
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20730
21284
|
buttonText: "Visit our Store",
|
|
21285
|
+
buttonLink: "https://example.com/",
|
|
21286
|
+
loading: false,
|
|
20731
21287
|
};
|
|
20732
21288
|
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
20733
21289
|
h("div", { style: resizable },
|
|
@@ -20751,18 +21307,6 @@ const Repeatable = () => {
|
|
|
20751
21307
|
h("h5", null),
|
|
20752
21308
|
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
20753
21309
|
" ",
|
|
20754
|
-
h("h5", null),
|
|
20755
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
|
|
20756
|
-
" ",
|
|
20757
|
-
h("h5", null),
|
|
20758
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
|
|
20759
|
-
" ",
|
|
20760
|
-
h("h5", null),
|
|
20761
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
|
|
20762
|
-
" ",
|
|
20763
|
-
h("h5", null),
|
|
20764
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
|
|
20765
|
-
" ",
|
|
20766
21310
|
h("h5", null)),
|
|
20767
21311
|
h("div", { style: resizable },
|
|
20768
21312
|
h("h4", null, "Many Actions"),
|
|
@@ -20777,45 +21321,41 @@ const Repeatable = () => {
|
|
|
20777
21321
|
h("h5", null),
|
|
20778
21322
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
20779
21323
|
" ",
|
|
20780
|
-
h("h5", null),
|
|
20781
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
|
|
20782
|
-
" ",
|
|
20783
|
-
h("h5", null),
|
|
20784
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
|
|
20785
|
-
" ",
|
|
20786
|
-
h("h5", null),
|
|
20787
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
|
|
20788
|
-
" ",
|
|
20789
|
-
h("h5", null),
|
|
20790
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
|
|
20791
|
-
" ",
|
|
20792
21324
|
h("h5", null))));
|
|
20793
21325
|
};
|
|
20794
21326
|
const RepeatableWithExpiry = () => {
|
|
20795
21327
|
const oneAction = {
|
|
20796
21328
|
points: 20,
|
|
21329
|
+
rewardUnit: "Points",
|
|
20797
21330
|
cardTitle: "Complete a survey",
|
|
20798
21331
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20799
21332
|
buttonText: "Take survey",
|
|
20800
21333
|
goal: 1,
|
|
20801
21334
|
repeatable: true,
|
|
20802
|
-
|
|
20803
|
-
|
|
21335
|
+
showExpire: true,
|
|
21336
|
+
dateExpires: "Nov 1, 2021",
|
|
21337
|
+
buttonLink: "https://example.com/",
|
|
21338
|
+
showProgressBar: false,
|
|
21339
|
+
loading: false,
|
|
20804
21340
|
};
|
|
20805
21341
|
const coupleActions = {
|
|
20806
21342
|
points: 40,
|
|
21343
|
+
rewardUnit: "Points",
|
|
20807
21344
|
cardTitle: "Comment on 5 articles",
|
|
20808
21345
|
showProgressBar: true,
|
|
20809
21346
|
repeatable: true,
|
|
20810
21347
|
goal: 5,
|
|
20811
|
-
steps:
|
|
21348
|
+
steps: true,
|
|
20812
21349
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20813
21350
|
buttonText: "Start reading",
|
|
20814
|
-
|
|
20815
|
-
|
|
21351
|
+
showExpire: true,
|
|
21352
|
+
dateExpires: "Nov 1, 2021",
|
|
21353
|
+
buttonLink: "https://example.com/",
|
|
21354
|
+
loading: false,
|
|
20816
21355
|
};
|
|
20817
21356
|
const manyActions = {
|
|
20818
21357
|
points: 150,
|
|
21358
|
+
rewardUnit: "Points",
|
|
20819
21359
|
cardTitle: "Spend $500 at our Store",
|
|
20820
21360
|
showProgressBar: true,
|
|
20821
21361
|
repeatable: true,
|
|
@@ -20823,8 +21363,10 @@ const RepeatableWithExpiry = () => {
|
|
|
20823
21363
|
unit: "$",
|
|
20824
21364
|
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20825
21365
|
buttonText: "Visit our Store",
|
|
20826
|
-
|
|
20827
|
-
|
|
21366
|
+
showExpire: true,
|
|
21367
|
+
dateExpires: "Nov 1, 2021",
|
|
21368
|
+
buttonLink: "https://example.com/",
|
|
21369
|
+
loading: false,
|
|
20828
21370
|
};
|
|
20829
21371
|
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
20830
21372
|
h("div", { style: resizable },
|
|
@@ -20848,18 +21390,6 @@ const RepeatableWithExpiry = () => {
|
|
|
20848
21390
|
h("h5", null),
|
|
20849
21391
|
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
|
|
20850
21392
|
" ",
|
|
20851
|
-
h("h5", null),
|
|
20852
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
|
|
20853
|
-
" ",
|
|
20854
|
-
h("h5", null),
|
|
20855
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
|
|
20856
|
-
" ",
|
|
20857
|
-
h("h5", null),
|
|
20858
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
|
|
20859
|
-
" ",
|
|
20860
|
-
h("h5", null),
|
|
20861
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
|
|
20862
|
-
" ",
|
|
20863
21393
|
h("h5", null)),
|
|
20864
21394
|
h("div", { style: resizable },
|
|
20865
21395
|
h("h4", null, "Many Actions"),
|
|
@@ -20874,169 +21404,143 @@ const RepeatableWithExpiry = () => {
|
|
|
20874
21404
|
h("h5", null),
|
|
20875
21405
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
|
|
20876
21406
|
" ",
|
|
20877
|
-
h("h5", null),
|
|
20878
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
|
|
20879
|
-
" ",
|
|
20880
|
-
h("h5", null),
|
|
20881
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
|
|
20882
|
-
" ",
|
|
20883
|
-
h("h5", null),
|
|
20884
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
|
|
20885
|
-
" ",
|
|
20886
|
-
h("h5", null),
|
|
20887
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
|
|
20888
|
-
" ",
|
|
20889
21407
|
h("h5", null))));
|
|
20890
|
-
};
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
// points: 20,
|
|
20894
|
-
// cardTitle: "Complete a survey",
|
|
20895
|
-
// description:
|
|
20896
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20897
|
-
// repeatable: 0,
|
|
20898
|
-
// buttonText: "Take survey",
|
|
20899
|
-
// buttonOnClick: () => {},
|
|
20900
|
-
// };
|
|
20901
|
-
// const coupleActions = {
|
|
20902
|
-
// points: 40,
|
|
20903
|
-
// cardTitle: "Comment on 5 articles",
|
|
20904
|
-
// goal: 5,
|
|
20905
|
-
// steps: 1,
|
|
20906
|
-
// repeatable: true,
|
|
20907
|
-
// description:
|
|
20908
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20909
|
-
// buttonText: "Start reading",
|
|
20910
|
-
// buttonOnClick: () => {},
|
|
20911
|
-
// };
|
|
20912
|
-
// const manyActions = {
|
|
20913
|
-
// points: 150,
|
|
20914
|
-
// cardTitle: "Spend $500 at our Store",
|
|
20915
|
-
// goal: 500,
|
|
20916
|
-
// repeatable: true,
|
|
20917
|
-
// unit: "$",
|
|
20918
|
-
// description:
|
|
20919
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20920
|
-
// buttonText: "Visit our Store",
|
|
20921
|
-
// buttonOnClick: () => {},
|
|
20922
|
-
// };
|
|
20923
|
-
// return (
|
|
20924
|
-
// <div style={{ display: "inline-flex", gap: "32px" }}>
|
|
20925
|
-
// <div style={resizable}>
|
|
20926
|
-
// <h4>One Action</h4>
|
|
20927
|
-
// <TaskCardView {...oneAction} /> <h5 />
|
|
20928
|
-
// <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
|
|
20929
|
-
// </div>
|
|
20930
|
-
// <div style={resizable}>
|
|
20931
|
-
// <h4>A Couple Actions</h4>
|
|
20932
|
-
// <TaskCardView {...coupleActions} progress={1} /> <h5 />
|
|
20933
|
-
// <TaskCardView {...coupleActions} progress={5} /> <h5 />
|
|
20934
|
-
// <TaskCardView {...coupleActions} progress={7} /> <h5 />
|
|
20935
|
-
// <TaskCardView {...coupleActions} progress={10} /> <h5 />
|
|
20936
|
-
// <TaskCardView {...coupleActions} progress={12} /> <h5 />
|
|
20937
|
-
// </div>
|
|
20938
|
-
// <div style={resizable}>
|
|
20939
|
-
// <h4>Many Actions</h4>
|
|
20940
|
-
// <TaskCardView {...manyActions} progress={100} /> <h5 />
|
|
20941
|
-
// <TaskCardView {...manyActions} progress={500} /> <h5 />
|
|
20942
|
-
// <TaskCardView {...manyActions} progress={650} /> <h5 />
|
|
20943
|
-
// <TaskCardView {...manyActions} progress={1000} /> <h5 />
|
|
20944
|
-
// <TaskCardView {...manyActions} progress={1200} /> <h5 />
|
|
20945
|
-
// </div>
|
|
20946
|
-
// </div>
|
|
20947
|
-
// );
|
|
20948
|
-
// };
|
|
20949
|
-
// export const RepeatableWithExpiry = () => {
|
|
20950
|
-
// const oneAction = {
|
|
20951
|
-
// points: 20,
|
|
20952
|
-
// cardTitle: "Complete a survey",
|
|
20953
|
-
// expire: "Nov 30, 2021",
|
|
20954
|
-
// description:
|
|
20955
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20956
|
-
// repeatable: 0,
|
|
20957
|
-
// buttonText: "Take survey",
|
|
20958
|
-
// buttonOnClick: () => {},
|
|
20959
|
-
// };
|
|
20960
|
-
// const coupleActions = {
|
|
20961
|
-
// points: 40,
|
|
20962
|
-
// cardTitle: "Comment on 5 articles",
|
|
20963
|
-
// expire: "Nov 30, 2021",
|
|
20964
|
-
// goal: 5,
|
|
20965
|
-
// steps: 1,
|
|
20966
|
-
// repeatable: true,
|
|
20967
|
-
// description:
|
|
20968
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20969
|
-
// buttonText: "Start reading",
|
|
20970
|
-
// buttonOnClick: () => {},
|
|
20971
|
-
// };
|
|
20972
|
-
// const manyActions = {
|
|
20973
|
-
// points: 150,
|
|
20974
|
-
// cardTitle: "Spend $500 at our Store",
|
|
20975
|
-
// expire: "Nov 30, 2021",
|
|
20976
|
-
// goal: 500,
|
|
20977
|
-
// repeatable: true,
|
|
20978
|
-
// unit: "$",
|
|
20979
|
-
// description:
|
|
20980
|
-
// "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
20981
|
-
// buttonText: "Visit our Store",
|
|
20982
|
-
// buttonOnClick: () => {},
|
|
20983
|
-
// };
|
|
20984
|
-
// return (
|
|
20985
|
-
// <div style={{ display: "inline-flex", gap: "32px" }}>
|
|
20986
|
-
// <div style={resizable}>
|
|
20987
|
-
// <h4>One Action</h4>
|
|
20988
|
-
// <TaskCardView {...oneAction} /> <h5 />
|
|
20989
|
-
// <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
|
|
20990
|
-
// </div>
|
|
20991
|
-
// <div style={resizable}>
|
|
20992
|
-
// <h4>A Couple Actions</h4>
|
|
20993
|
-
// <TaskCardView {...coupleActions} progress={1} /> <h5 />
|
|
20994
|
-
// <TaskCardView {...coupleActions} progress={5} /> <h5 />
|
|
20995
|
-
// <TaskCardView {...coupleActions} progress={7} /> <h5 />
|
|
20996
|
-
// <TaskCardView {...coupleActions} progress={10} /> <h5 />
|
|
20997
|
-
// <TaskCardView {...coupleActions} progress={12} /> <h5 />
|
|
20998
|
-
// </div>
|
|
20999
|
-
// <div style={resizable}>
|
|
21000
|
-
// <h4>Many Actions</h4>
|
|
21001
|
-
// <TaskCardView {...manyActions} progress={100} /> <h5 />
|
|
21002
|
-
// <TaskCardView {...manyActions} progress={500} /> <h5 />
|
|
21003
|
-
// <TaskCardView {...manyActions} progress={650} /> <h5 />
|
|
21004
|
-
// <TaskCardView {...manyActions} progress={1000} /> <h5 />
|
|
21005
|
-
// <TaskCardView {...manyActions} progress={1200} /> <h5 />
|
|
21006
|
-
// </div>
|
|
21007
|
-
// </div>
|
|
21008
|
-
// );
|
|
21009
|
-
// };
|
|
21010
|
-
// export const ProgressBar = () => {
|
|
21011
|
-
// const props = {
|
|
21012
|
-
// goal: 5,
|
|
21013
|
-
// };
|
|
21014
|
-
// return (
|
|
21015
|
-
// <div>
|
|
21016
|
-
// <MatrixStory
|
|
21017
|
-
// matrix={{ progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }}
|
|
21018
|
-
// props={props}
|
|
21019
|
-
// Component={ProgressBarView}
|
|
21020
|
-
// />
|
|
21021
|
-
// <MatrixStory
|
|
21022
|
-
// matrix={{ progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }}
|
|
21023
|
-
// props={props}
|
|
21024
|
-
// Component={ProgressBarView}
|
|
21025
|
-
// />
|
|
21026
|
-
// </div>
|
|
21027
|
-
// );
|
|
21028
|
-
// };
|
|
21029
|
-
|
|
21030
|
-
const TaskCard = /*#__PURE__*/Object.freeze({
|
|
21408
|
+
};
|
|
21409
|
+
|
|
21410
|
+
const TaskCard$1 = /*#__PURE__*/Object.freeze({
|
|
21031
21411
|
__proto__: null,
|
|
21032
21412
|
'default': TaskCard_stories,
|
|
21033
|
-
Default: Default$a,
|
|
21034
21413
|
NotRepeatable: NotRepeatable,
|
|
21035
21414
|
NotRepeatableWithExpiry: NotRepeatableWithExpiry,
|
|
21036
21415
|
Repeatable: Repeatable,
|
|
21037
21416
|
RepeatableWithExpiry: RepeatableWithExpiry
|
|
21038
21417
|
});
|
|
21039
21418
|
|
|
21419
|
+
/**
|
|
21420
|
+
* Displays a cartesian product of the input props
|
|
21421
|
+
*
|
|
21422
|
+
* @returns
|
|
21423
|
+
*/
|
|
21424
|
+
function MatrixStory({ matrix, props, Component, }) {
|
|
21425
|
+
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21426
|
+
const propValues = matrix[propKey];
|
|
21427
|
+
return propValues.map((val) => {
|
|
21428
|
+
return {
|
|
21429
|
+
[propKey]: val,
|
|
21430
|
+
};
|
|
21431
|
+
});
|
|
21432
|
+
});
|
|
21433
|
+
const combinations = cartesian(...propMatrix);
|
|
21434
|
+
const propsCombinations = combinations.map((combo) => {
|
|
21435
|
+
return combo.reduce((props, prop) => {
|
|
21436
|
+
return {
|
|
21437
|
+
...props,
|
|
21438
|
+
...prop,
|
|
21439
|
+
};
|
|
21440
|
+
}, {});
|
|
21441
|
+
});
|
|
21442
|
+
return propsCombinations.map((combo) => {
|
|
21443
|
+
const example = { ...props, ...combo };
|
|
21444
|
+
return (h("div", null,
|
|
21445
|
+
h(PropsTable, { values: example }),
|
|
21446
|
+
h("hr", null),
|
|
21447
|
+
h(Component, Object.assign({}, example))));
|
|
21448
|
+
});
|
|
21449
|
+
}
|
|
21450
|
+
function PropsTable({ values }) {
|
|
21451
|
+
return (h("table", null,
|
|
21452
|
+
h("tbody", null, Object.keys(values).map((key) => {
|
|
21453
|
+
return (h("tr", null,
|
|
21454
|
+
h("th", null, key),
|
|
21455
|
+
h("td", null, JSON.stringify(values[key]))));
|
|
21456
|
+
}))));
|
|
21457
|
+
}
|
|
21458
|
+
/**
|
|
21459
|
+
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21460
|
+
*
|
|
21461
|
+
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21462
|
+
*
|
|
21463
|
+
* @param args - an array of arrays
|
|
21464
|
+
* @returns combinations of the elements in those array
|
|
21465
|
+
*/
|
|
21466
|
+
function cartesian(...args) {
|
|
21467
|
+
var r = [], max = args.length - 1;
|
|
21468
|
+
function helper(arr, i) {
|
|
21469
|
+
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21470
|
+
var a = arr.slice(0); // clone arr
|
|
21471
|
+
a.push(args[i][j]);
|
|
21472
|
+
if (i == max)
|
|
21473
|
+
r.push(a);
|
|
21474
|
+
else
|
|
21475
|
+
helper(a, i + 1);
|
|
21476
|
+
}
|
|
21477
|
+
}
|
|
21478
|
+
helper([], 0);
|
|
21479
|
+
return r;
|
|
21480
|
+
}
|
|
21481
|
+
|
|
21482
|
+
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 |";
|
|
21483
|
+
|
|
21484
|
+
const progressBar_stories = {
|
|
21485
|
+
title: "Components/Task Card Progress Bar",
|
|
21486
|
+
parameters: {
|
|
21487
|
+
scenario: scenario$6,
|
|
21488
|
+
},
|
|
21489
|
+
};
|
|
21490
|
+
const Default$a = () => {
|
|
21491
|
+
return h(ProgressBarView, null);
|
|
21492
|
+
};
|
|
21493
|
+
const ProgressBar$1 = () => {
|
|
21494
|
+
const props = {
|
|
21495
|
+
progress: 0,
|
|
21496
|
+
goal: 500,
|
|
21497
|
+
progressBarUnit: "$",
|
|
21498
|
+
};
|
|
21499
|
+
return (h("div", null,
|
|
21500
|
+
h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
|
|
21501
|
+
};
|
|
21502
|
+
const ProgressBarSteps = () => {
|
|
21503
|
+
const props = {
|
|
21504
|
+
progress: 0,
|
|
21505
|
+
steps: true,
|
|
21506
|
+
goal: 5,
|
|
21507
|
+
progressBarUnit: "$",
|
|
21508
|
+
};
|
|
21509
|
+
return (h("div", null,
|
|
21510
|
+
h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
|
|
21511
|
+
};
|
|
21512
|
+
const ProgressBarRepeatable = () => {
|
|
21513
|
+
const props = {
|
|
21514
|
+
progress: 0,
|
|
21515
|
+
goal: 500,
|
|
21516
|
+
progressBarUnit: "$",
|
|
21517
|
+
repeatable: true,
|
|
21518
|
+
};
|
|
21519
|
+
return (h("div", null,
|
|
21520
|
+
h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
|
|
21521
|
+
};
|
|
21522
|
+
const ProgressBarStepsRepeatable = () => {
|
|
21523
|
+
const props = {
|
|
21524
|
+
progress: 0,
|
|
21525
|
+
steps: true,
|
|
21526
|
+
goal: 5,
|
|
21527
|
+
progressBarUnit: "$",
|
|
21528
|
+
repeatable: true,
|
|
21529
|
+
};
|
|
21530
|
+
return (h("div", null,
|
|
21531
|
+
h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
|
|
21532
|
+
};
|
|
21533
|
+
|
|
21534
|
+
const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
|
|
21535
|
+
__proto__: null,
|
|
21536
|
+
'default': progressBar_stories,
|
|
21537
|
+
Default: Default$a,
|
|
21538
|
+
ProgressBar: ProgressBar$1,
|
|
21539
|
+
ProgressBarSteps: ProgressBarSteps,
|
|
21540
|
+
ProgressBarRepeatable: ProgressBarRepeatable,
|
|
21541
|
+
ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
|
|
21542
|
+
});
|
|
21543
|
+
|
|
21040
21544
|
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";
|
|
21041
21545
|
|
|
21042
21546
|
const portalLeadSubmitTemplate = "<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|\\brefer\\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=\"/refer\"\r\n icon=\"inbox\"\r\n label=\"Submit A Lead\"\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 <template path=\"/refer\">\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-referral-iframe></sqm-referral-iframe>\r\n </template>\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";
|
|
@@ -24049,7 +24553,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
|
|
|
24049
24553
|
|
|
24050
24554
|
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";
|
|
24051
24555
|
|
|
24052
|
-
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\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` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24556
|
+
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";
|
|
24053
24557
|
|
|
24054
24558
|
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";
|
|
24055
24559
|
|
|
@@ -24057,7 +24561,7 @@ const ResetPasswordReadme = "# sqm-portal-reset-password\r\n\r\n\r\n\r\n<!-- Aut
|
|
|
24057
24561
|
|
|
24058
24562
|
const EmailVerificationReadme = "# sqm-portal-email-verification\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; }; content?: { email: string; verifyMessage: string; emailVerificationHeader: string; resendEmailButtonText: string; }; }` | `undefined` |\r\n| `emailVerificationHeader` | `email-verification-header` | | `string` | `\"Verify your email\"` |\r\n| `resendEmailButtonText` | `resend-email-button-text` | | `string` | `\"Re-send Email\"` |\r\n| `verifyMessage` | `verify-message` | | `string` | `\"A verification email was sent to {email}. Please verify your email to continue to the portal.\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-email-verification --> sqm-form-message\r\n style sqm-portal-email-verification fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
24059
24563
|
|
|
24060
|
-
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\
|
|
24564
|
+
const EmailVerifiedReadme = "# sqm-portal-verify-email\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| ---------- | ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | ----------- |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; verified: boolean; }; data?: { oobCode: string; }; }` | `undefined` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n\n\n## Dependencies\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-verify-email --> sqm-form-message\n style sqm-portal-verify-email fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
24061
24565
|
|
|
24062
24566
|
const PortalTemplates_stories = {
|
|
24063
24567
|
title: "Templates / Portal",
|
|
@@ -24273,12 +24777,12 @@ const PoweredByImg = /*#__PURE__*/Object.freeze({
|
|
|
24273
24777
|
CustomWidthAndHeight: CustomWidthAndHeight
|
|
24274
24778
|
});
|
|
24275
24779
|
|
|
24276
|
-
const scenario$
|
|
24780
|
+
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";
|
|
24277
24781
|
|
|
24278
24782
|
const PortalFooter_stories = {
|
|
24279
24783
|
title: "Portal Footer",
|
|
24280
24784
|
parameters: {
|
|
24281
|
-
scenario: scenario$
|
|
24785
|
+
scenario: scenario$7,
|
|
24282
24786
|
},
|
|
24283
24787
|
};
|
|
24284
24788
|
const defaultProps$9 = {
|
|
@@ -24307,12 +24811,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
|
|
|
24307
24811
|
FooterNoPoweredBy: FooterNoPoweredBy
|
|
24308
24812
|
});
|
|
24309
24813
|
|
|
24310
|
-
const scenario$
|
|
24814
|
+
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 |";
|
|
24311
24815
|
|
|
24312
24816
|
const Hero_stories = {
|
|
24313
24817
|
title: "Hero Layout",
|
|
24314
24818
|
parameters: {
|
|
24315
|
-
scenario: scenario$
|
|
24819
|
+
scenario: scenario$8,
|
|
24316
24820
|
},
|
|
24317
24821
|
};
|
|
24318
24822
|
const LoginOneColumn = () => {
|
|
@@ -24489,12 +24993,12 @@ const Hero = /*#__PURE__*/Object.freeze({
|
|
|
24489
24993
|
TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
|
|
24490
24994
|
});
|
|
24491
24995
|
|
|
24492
|
-
const scenario$
|
|
24996
|
+
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 | |";
|
|
24493
24997
|
|
|
24494
24998
|
const ReferralIframe_stories = {
|
|
24495
24999
|
title: "Referral Iframe",
|
|
24496
25000
|
parameters: {
|
|
24497
|
-
scenario: scenario$
|
|
25001
|
+
scenario: scenario$9,
|
|
24498
25002
|
},
|
|
24499
25003
|
};
|
|
24500
25004
|
const props = {
|
|
@@ -24525,12 +25029,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
|
|
|
24525
25029
|
ReferralIframeError: ReferralIframeError
|
|
24526
25030
|
});
|
|
24527
25031
|
|
|
24528
|
-
const scenario$
|
|
25032
|
+
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";
|
|
24529
25033
|
|
|
24530
25034
|
const NameFields_stories = {
|
|
24531
25035
|
title: "Name Fields",
|
|
24532
25036
|
parameters: {
|
|
24533
|
-
scenario: scenario$
|
|
25037
|
+
scenario: scenario$a,
|
|
24534
25038
|
},
|
|
24535
25039
|
};
|
|
24536
25040
|
const props$1 = {
|
|
@@ -27148,7 +27652,9 @@ const CucumberAddon = ({ story }, children) => {
|
|
|
27148
27652
|
// No scenario or invalid. Ignoring.
|
|
27149
27653
|
}
|
|
27150
27654
|
return (h("div", null,
|
|
27151
|
-
|
|
27655
|
+
h("details", null,
|
|
27656
|
+
h("summary", null, "Specs"),
|
|
27657
|
+
result && h("pre", { innerHTML: result.value })),
|
|
27152
27658
|
children));
|
|
27153
27659
|
};
|
|
27154
27660
|
|
|
@@ -27185,7 +27691,8 @@ const stories = [
|
|
|
27185
27691
|
ReferralTableRewardsCell$1,
|
|
27186
27692
|
UserName,
|
|
27187
27693
|
PasswordField,
|
|
27188
|
-
TaskCard,
|
|
27694
|
+
TaskCard$1,
|
|
27695
|
+
TaskCardProgressBar,
|
|
27189
27696
|
PortalTemplates,
|
|
27190
27697
|
ProgramMenu$1,
|
|
27191
27698
|
PoweredByImg,
|
|
@@ -27194,6 +27701,7 @@ const stories = [
|
|
|
27194
27701
|
ReferralIframe$1,
|
|
27195
27702
|
NameFields$1,
|
|
27196
27703
|
UseRewardExchangeList,
|
|
27704
|
+
UseTaskCard,
|
|
27197
27705
|
];
|
|
27198
27706
|
const StencilStorybook = class {
|
|
27199
27707
|
constructor(hostRef) {
|
|
@@ -27233,6 +27741,77 @@ const TableRow = class {
|
|
|
27233
27741
|
}
|
|
27234
27742
|
};
|
|
27235
27743
|
|
|
27744
|
+
const TaskCard$2 = class {
|
|
27745
|
+
constructor(hostRef) {
|
|
27746
|
+
registerInstance(this, hostRef);
|
|
27747
|
+
this.ignored = true;
|
|
27748
|
+
/**
|
|
27749
|
+
* @uiName Reward Amount
|
|
27750
|
+
*/
|
|
27751
|
+
this.points = 0;
|
|
27752
|
+
/**
|
|
27753
|
+
* @uiName Reward Unit
|
|
27754
|
+
*/
|
|
27755
|
+
this.rewardUnit = "Points";
|
|
27756
|
+
/**
|
|
27757
|
+
* @uiName Title Text
|
|
27758
|
+
*/
|
|
27759
|
+
this.cardTitle = "Title Text";
|
|
27760
|
+
/**
|
|
27761
|
+
* @uiName Description Text
|
|
27762
|
+
*/
|
|
27763
|
+
this.description = "Description Text";
|
|
27764
|
+
/**
|
|
27765
|
+
* @uiName Goal Repeatable
|
|
27766
|
+
*/
|
|
27767
|
+
this.repeatable = false;
|
|
27768
|
+
/**
|
|
27769
|
+
* @uiName Show Progress Bar
|
|
27770
|
+
*/
|
|
27771
|
+
this.showProgressBar = false;
|
|
27772
|
+
/**
|
|
27773
|
+
* @uiName Goal Progress Source
|
|
27774
|
+
*/
|
|
27775
|
+
this.progressSource = "";
|
|
27776
|
+
/**
|
|
27777
|
+
* @uiName Goal Completion Number
|
|
27778
|
+
*/
|
|
27779
|
+
this.goal = 1;
|
|
27780
|
+
/**
|
|
27781
|
+
* @uiName Progress Bar Steps
|
|
27782
|
+
*/
|
|
27783
|
+
this.steps = false;
|
|
27784
|
+
/**
|
|
27785
|
+
* @uiName Show Goal Expiry
|
|
27786
|
+
*/
|
|
27787
|
+
this.showExpire = false;
|
|
27788
|
+
/**
|
|
27789
|
+
* @uiName CTA Button Text
|
|
27790
|
+
*/
|
|
27791
|
+
this.buttonText = "Complete Action";
|
|
27792
|
+
/**
|
|
27793
|
+
* @uiName CTA Button Link
|
|
27794
|
+
*/
|
|
27795
|
+
this.buttonLink = "https://example.com/";
|
|
27796
|
+
/**
|
|
27797
|
+
* Select what type of stat to display for the goal. Manual paths are also supported.
|
|
27798
|
+
*
|
|
27799
|
+
* @uiWidget StatTypeSelectWidget
|
|
27800
|
+
* @uiName Stat Type
|
|
27801
|
+
* @uiOptions {"version": 1.1}
|
|
27802
|
+
*/
|
|
27803
|
+
this.statType = "/programGoals/count/Referral-Started%2Freferrals";
|
|
27804
|
+
h$1(this);
|
|
27805
|
+
}
|
|
27806
|
+
disconnectedCallback() { }
|
|
27807
|
+
render() {
|
|
27808
|
+
const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
|
|
27809
|
+
const { value, statvalue } = props;
|
|
27810
|
+
console.log(props, j$1());
|
|
27811
|
+
return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
|
|
27812
|
+
}
|
|
27813
|
+
};
|
|
27814
|
+
|
|
27236
27815
|
const debug$2 = browser("sq:global");
|
|
27237
27816
|
const textStyles = `
|
|
27238
27817
|
sqm-text {
|
|
@@ -27358,4 +27937,4 @@ function useUserNameDemo(props) {
|
|
|
27358
27937
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
27359
27938
|
}
|
|
27360
27939
|
|
|
27361
|
-
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, 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 };
|
|
27940
|
+
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, 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 };
|