@saasquatch/mint-components 1.3.2-4 → 1.3.2-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mint-components.cjs.js +1 -1
  3. package/dist/cjs/sqm-big-stat.cjs.entry.js +1 -1
  4. package/dist/cjs/{sqm-divided-layout_27.cjs.entry.js → sqm-divided-layout_28.cjs.entry.js} +956 -381
  5. package/dist/cjs/{useDemoBigStat-17e61803.js → useDemoBigStat-051a69f7.js} +116 -20
  6. package/dist/collection/components/sqm-big-stat/BigStat.stories.js +8 -1
  7. package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +3 -0
  8. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +1 -1
  9. package/dist/collection/components/sqm-big-stat/useBigStat.js +115 -20
  10. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +1 -0
  11. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +5 -14
  12. package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +5 -4
  13. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +55 -43
  14. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +2 -1
  15. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +2 -1
  16. package/dist/collection/components/sqm-stencilbook/CucumberAddon.js +3 -1
  17. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
  18. package/dist/collection/components/sqm-task-card/SVGs.js +0 -6
  19. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +86 -255
  20. package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +41 -0
  21. package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +7 -0
  22. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +311 -0
  23. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +53 -0
  24. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +15 -308
  25. package/dist/collection/components/sqm-task-card/sqm-task-card.js +113 -29
  26. package/dist/collection/stories/NewPortal.stories.js +15 -15
  27. package/dist/esm/loader.js +1 -1
  28. package/dist/esm/mint-components.js +1 -1
  29. package/dist/esm/sqm-big-stat.entry.js +1 -1
  30. package/dist/esm/{sqm-divided-layout_27.entry.js → sqm-divided-layout_28.entry.js} +920 -346
  31. package/dist/esm/{useDemoBigStat-b71fe122.js → useDemoBigStat-95889548.js} +116 -20
  32. package/dist/esm-es5/loader.js +1 -1
  33. package/dist/esm-es5/mint-components.js +1 -1
  34. package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
  35. package/dist/esm-es5/sqm-divided-layout_28.entry.js +1 -0
  36. package/dist/esm-es5/useDemoBigStat-95889548.js +1 -0
  37. package/dist/mint-components/mint-components.esm.js +1 -1
  38. package/dist/mint-components/p-0faf1857.system.js +1 -0
  39. package/dist/mint-components/{p-e22eed7b.entry.js → p-1d445125.entry.js} +1 -1
  40. package/dist/mint-components/p-91d39961.system.js +1 -1
  41. package/dist/mint-components/p-a7f26a72.entry.js +288 -0
  42. package/dist/mint-components/{p-c9c4f31b.system.entry.js → p-b2633117.system.entry.js} +1 -1
  43. package/dist/mint-components/p-b6e6be5e.js +235 -0
  44. package/dist/mint-components/p-e0290737.system.entry.js +1 -0
  45. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +6 -0
  46. package/dist/types/components/sqm-big-stat/sqm-big-stat-view.d.ts +1 -0
  47. package/dist/types/components/sqm-big-stat/useBigStat.d.ts +4 -1
  48. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
  49. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +1 -0
  50. package/dist/types/components/sqm-task-card/SVGs.d.ts +0 -1
  51. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +3 -1
  52. package/dist/types/components/sqm-task-card/UseTaskCard.stories.d.ts +10 -0
  53. package/dist/types/components/sqm-task-card/progress-bar/SVGs.d.ts +1 -0
  54. package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +9 -0
  55. package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +12 -0
  56. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +13 -22
  57. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +28 -12
  58. package/dist/types/components.d.ts +54 -32
  59. package/grapesjs/grapesjs.js +1 -1
  60. package/package.json +1 -1
  61. package/dist/cjs/sqm-task-card-view-791797ac.js +0 -475
  62. package/dist/cjs/sqm-task-card.cjs.entry.js +0 -53
  63. package/dist/collection/components/sqm-task-card/useTaskCard.js +0 -0
  64. package/dist/esm/sqm-task-card-view-5cce0847.js +0 -473
  65. package/dist/esm/sqm-task-card.entry.js +0 -49
  66. package/dist/esm-es5/sqm-divided-layout_27.entry.js +0 -1
  67. package/dist/esm-es5/sqm-task-card-view-5cce0847.js +0 -1
  68. package/dist/esm-es5/sqm-task-card.entry.js +0 -1
  69. package/dist/esm-es5/useDemoBigStat-b71fe122.js +0 -1
  70. package/dist/mint-components/p-2b3a99df.js +0 -1
  71. package/dist/mint-components/p-32918497.entry.js +0 -288
  72. package/dist/mint-components/p-405a9253.js +0 -227
  73. package/dist/mint-components/p-4e5a2105.system.entry.js +0 -1
  74. package/dist/mint-components/p-6198d500.system.entry.js +0 -1
  75. package/dist/mint-components/p-6932204f.system.js +0 -1
  76. package/dist/mint-components/p-bbdafe3b.entry.js +0 -1
  77. package/dist/mint-components/p-f87d8f53.system.js +0 -1
  78. package/dist/types/components/sqm-task-card/useTaskCard.d.ts +0 -0
@@ -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-b71fe122.js';
18
+ import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-95889548.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-5cce0847.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';
@@ -14802,7 +14801,7 @@ function useRewardExchangeList(props) {
14802
14801
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
14803
14802
  const user = T$1();
14804
14803
  const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
14805
- 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));
14806
14805
  useEffect(() => {
14807
14806
  var _a, _b;
14808
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) {
@@ -14911,6 +14910,7 @@ function useRewardExchangeList(props) {
14911
14910
  amount,
14912
14911
  selectedStep,
14913
14912
  exchangeError,
14913
+ loading,
14914
14914
  },
14915
14915
  data: {
14916
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,
@@ -14929,6 +14929,14 @@ function useRewardExchangeList(props) {
14929
14929
  };
14930
14930
  }
14931
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
+
14932
14940
  function Dot({ active, completed, incomplete, }) {
14933
14941
  return (h("div", { style: {
14934
14942
  flex: "0 0 0",
@@ -14953,12 +14961,12 @@ function Dot({ active, completed, incomplete, }) {
14953
14961
  ? "2px solid #E5E5E5"
14954
14962
  : "none",
14955
14963
  borderRadius: "50%",
14956
- width: completed ? "12px" : "8px",
14957
- height: completed ? "12px" : "8px",
14958
- margin: "-4px auto 0px",
14964
+ width: completed ? "14px" : "10px",
14965
+ height: completed ? "14px" : "10px",
14966
+ margin: "-5px auto 0px",
14959
14967
  zIndex: "1",
14960
14968
  boxSizing: "content-box",
14961
- } })));
14969
+ } }, completed && h(CheckMark, null))));
14962
14970
  }
14963
14971
  function ProgressLine({ incomplete = false, active = false }) {
14964
14972
  return (h("div", { style: {
@@ -14988,23 +14996,6 @@ function ProgressBar({ stageCount, currentStage, }) {
14988
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 })))));
14989
14997
  }
14990
14998
 
14991
- 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" } },
14992
- 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" })));
14993
- const ExchangeArrows = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "42", height: "42", viewBox: "0 0 42 42", fill: "none" },
14994
- h("g", { filter: "url(#filter0_d_428_4515)" },
14995
- h("circle", { cx: "21", cy: "21", r: "15", fill: "white" })),
14996
- h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16.6255 27.783C16.5129 27.8963 16.3597 27.96 16.2 27.96C16.0402 27.96 15.887 27.8963 15.7744 27.783L11.8744 23.8597C11.6408 23.6247 11.6419 23.2448 11.877 23.0112C12.112 22.7775 12.4919 22.7787 12.7255 23.0137L15.6 25.9054V14.52C15.6 14.1886 15.8686 13.92 16.2 13.92C16.5313 13.92 16.8 14.1886 16.8 14.52V25.9054L19.6744 23.0137C19.908 22.7787 20.2879 22.7775 20.5229 23.0112C20.758 23.2448 20.7591 23.6247 20.5255 23.8597L16.6255 27.783ZM26.2255 14.0971C26.1129 13.9838 25.9597 13.9201 25.8 13.9201C25.6402 13.9201 25.487 13.9838 25.3744 14.0971L21.4744 18.0204C21.2408 18.2554 21.2419 18.6353 21.477 18.8689C21.712 19.1025 22.0919 19.1014 22.3255 18.8664L25.2 15.9747V27.3601C25.2 27.6914 25.4686 27.9601 25.8 27.9601C26.1313 27.9601 26.4 27.6914 26.4 27.3601V15.9747L29.2744 18.8664C29.508 19.1014 29.8879 19.1025 30.1229 18.8689C30.358 18.6353 30.3591 18.2554 30.1255 18.0204L26.2255 14.0971Z", fill: "#333333" }),
14997
- h("defs", null,
14998
- h("filter", { id: "filter0_d_428_4515", x: "0", y: "0", width: "42", height: "42", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "sRGB" },
14999
- h("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }),
15000
- h("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
15001
- h("feOffset", null),
15002
- h("feGaussianBlur", { stdDeviation: "3" }),
15003
- h("feComposite", { in2: "hardAlpha", operator: "out" }),
15004
- h("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.670833 0 0 0 0 0.670833 0 0 0 0 0.670833 0 0 0 0.2 0" }),
15005
- h("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_428_4515" }),
15006
- h("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow_428_4515", result: "shape" })))));
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: "block",
15017
+ display: "flex",
15027
15018
  cursor: "pointer",
15028
15019
  textAlign: "center",
15020
+ height: "120px",
15029
15021
  "&::part(base)": {
15030
15022
  width: "100%",
15031
- height: "170px",
15023
+ maxWidth: "350px",
15032
15024
  display: "flex",
15033
- justifyContent: "space-between",
15034
- alignItems: "center",
15025
+ margin: "0 auto",
15035
15026
  },
15036
15027
  "&::part(body)": {
15037
- padding: "10px 0",
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
- maxWidth: "100%",
15059
- height: "75px",
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
- bottom: "0",
15070
+ marginLeft: "auto",
15075
15071
  width: "100%",
15072
+ maxWidth: "300px",
15076
15073
  },
15077
15074
  Button: {
15078
15075
  margin: "10px 0",
@@ -15106,8 +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("div", { slot: "suffix", style: { fontSize: "75%", float: "right" } }, step.prettySourceValue),
15110
- step.unavailableReasonCode && (h("p", { style: { fontSize: "70%", color: "#F2994A" } }, step.unavailableReasonCode)))))));
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))))))));
15111
15109
  }
15112
15110
  function chooseReward() {
15113
15111
  var _a;
@@ -15115,41 +15113,40 @@ function RewardExchangeView(props) {
15115
15113
  ? "confirmation"
15116
15114
  : "chooseAmount";
15117
15115
  console.log({ nextStage, ruleType: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.ruleType });
15118
- return (h("div", { style: {
15119
- display: "flex",
15120
- justifyContent: "center",
15121
- flexWrap: "wrap",
15122
- alignItems: "center",
15123
- columnGap: "12px",
15124
- rowGap: "12px",
15125
- } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 :
15126
- _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) => {
15127
15123
  const style = {
15128
15124
  boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) ? "0 1px 8px #87ceeb" : "none",
15129
15125
  marginBottom: "10px 0",
15130
15126
  flex: "1",
15131
15127
  minWidth: "100%",
15132
15128
  color: !item.available && "#eee",
15133
- "&:hover": {
15134
- boxShadow: !item.available && "none",
15135
- },
15136
15129
  };
15137
- return (h("div", { key: item.key, class: sheet.classes.CardContainer,
15138
- //@ts-ignore
15139
- style: style },
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 },
15140
15134
  h("sl-card", { class: sheet.classes.Base, onClick: () => item.available &&
15141
15135
  callbacks.setExchangeState({ selectedItem: item }) },
15142
- h("img", { class: sheet.classes.PreviewImage, src: (item === null || item === void 0 ? void 0 : item.imageUrl) || getAssetPath("./assets/Reward-icon.png") }),
15143
- h("p", { style: { marginBottom: "0" } }, item.description),
15144
- item.unavailableReasonCode && (h("p", { style: {
15145
- fontSize: "70%",
15146
- color: "#F2994A",
15147
- marginTop: "0",
15148
- } }, item.unavailableReasonCode)))));
15149
- }),
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
+ })),
15150
15146
  h("div", { class: sheet.classes.Buttons },
15151
15147
  h("sl-button", { onClick: () => callbacks.setStage(nextStage), style: { display: "block" }, class: sheet.classes.Button, disabled: !states.selectedItem }, "Continue"),
15152
- 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
+ ];
15153
15150
  }
15154
15151
  function chooseAmount() {
15155
15152
  const input = getInput();
@@ -15169,14 +15166,20 @@ function RewardExchangeView(props) {
15169
15166
  return (h("div", null,
15170
15167
  h("h2", null, "Confirm and redeem"),
15171
15168
  h("div", { style: { textAlign: "center" } },
15172
- h("p", null,
15173
- h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.sourceValue)),
15174
15169
  h("p", null,
15175
15170
  h("b", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue)),
15176
15171
  h("p", null,
15177
15172
  h(ExchangeArrows, null)),
15178
- h("p", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.destinationValue),
15179
- h("p", null, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)),
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)))),
15180
15183
  h("div", { class: sheet.classes.Buttons },
15181
15184
  h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
15182
15185
  h("a", { onClick: () => callbacks.setStage(previousStage), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
@@ -15197,22 +15200,22 @@ function RewardExchangeView(props) {
15197
15200
  const currentStage = stages[states.redeemStage];
15198
15201
  function stageMap() {
15199
15202
  const stageNumber = stageList.indexOf(states.redeemStage);
15200
- return (h("div", { style: { fontSize: "80%" } },
15201
- h(ProgressBar, { stageCount: 3, currentStage: stageNumber }),
15203
+ return (h("div", { style: { fontSize: "80%", marginBottom: "20px" } },
15202
15204
  h("div", { style: {
15203
15205
  marginTop: "5px",
15204
15206
  display: "flex",
15205
15207
  justifyContent: "center",
15206
15208
  textAlign: "center",
15207
15209
  whiteSpace: "nowrap",
15208
- marginBottom: "10px",
15210
+ marginBottom: "6px",
15209
15211
  } }, Object.keys(stageProgressList).map((stage) => {
15210
15212
  if (stage === states.redeemStage)
15211
15213
  return (h("b", { style: { flex: "1 1 0" } },
15212
15214
  " ",
15213
15215
  stageProgressList[stage]));
15214
15216
  return h("i", { style: { flex: "1 1 0" } }, stageProgressList[stage]);
15215
- }))));
15217
+ })),
15218
+ h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
15216
15219
  }
15217
15220
  const BackButton = () => {
15218
15221
  if (states.redeemStage === "success")
@@ -15241,7 +15244,7 @@ function RewardExchangeView(props) {
15241
15244
  currentStage && currentStage(),
15242
15245
  states.exchangeError &&
15243
15246
  "Something went wrong. Please contact support or try again."),
15244
- h("sl-button", { onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
15247
+ h("sl-button", { loading: states.loading, onClick: () => callbacks.openDrawer() }, "Redeem Rewards"))));
15245
15248
  }
15246
15249
 
15247
15250
  const SqmRewardExchangeList = class {
@@ -15282,6 +15285,7 @@ function useRewardExchangeListDemo(props) {
15282
15285
  amount: 0,
15283
15286
  selectedStep: undefined,
15284
15287
  exchangeError: false,
15288
+ loading: false,
15285
15289
  },
15286
15290
  data: {
15287
15291
  shareCode: "SHARECODE123",
@@ -17140,11 +17144,12 @@ const BigStat_stories = {
17140
17144
  title: "Components/Big Stat",
17141
17145
  };
17142
17146
  const Default$1 = () => {
17143
- const props = { statvalue: "9.900,00" };
17147
+ const props = { value: 990000, statvalue: "9.900,00" };
17144
17148
  return h(BigStatView, Object.assign({}, props), "Big stat");
17145
17149
  };
17146
17150
  const LeftAlign = () => {
17147
17151
  const props = {
17152
+ value: 500,
17148
17153
  statvalue: "500",
17149
17154
  alignment: "left",
17150
17155
  };
@@ -17152,6 +17157,7 @@ const LeftAlign = () => {
17152
17157
  };
17153
17158
  const RightAlign = () => {
17154
17159
  const props = {
17160
+ value: 500,
17155
17161
  statvalue: "500",
17156
17162
  alignment: "right",
17157
17163
  };
@@ -17159,6 +17165,7 @@ const RightAlign = () => {
17159
17165
  };
17160
17166
  const FlexReverse = () => {
17161
17167
  const props = {
17168
+ value: 500,
17162
17169
  statvalue: "500",
17163
17170
  flexReverse: true,
17164
17171
  };
@@ -17166,6 +17173,7 @@ const FlexReverse = () => {
17166
17173
  };
17167
17174
  const FlexReverseRight = () => {
17168
17175
  const props = {
17176
+ value: 500,
17169
17177
  statvalue: "500",
17170
17178
  flexReverse: true,
17171
17179
  alignment: "right",
@@ -17174,6 +17182,7 @@ const FlexReverseRight = () => {
17174
17182
  };
17175
17183
  const FlexReverseLeft = () => {
17176
17184
  const props = {
17185
+ value: 500,
17177
17186
  statvalue: "500",
17178
17187
  flexReverse: true,
17179
17188
  alignment: "left",
@@ -17182,12 +17191,14 @@ const FlexReverseLeft = () => {
17182
17191
  };
17183
17192
  const NoStatValue = () => {
17184
17193
  const props = {
17194
+ value: 0,
17185
17195
  statvalue: "...",
17186
17196
  };
17187
17197
  return h(BigStatView, Object.assign({}, props), "Big stat");
17188
17198
  };
17189
17199
  const InvalidStatValue = () => {
17190
17200
  const props = {
17201
+ value: 0,
17191
17202
  statvalue: "!!!",
17192
17203
  };
17193
17204
  return h(BigStatView, Object.assign({}, props), "Big stat");
@@ -17913,6 +17924,9 @@ const RewardBalanceCashUSD = createHookStory(() => {
17913
17924
  const ProgramGoals = createHookStory(() => {
17914
17925
  const dummy = encodeURIComponent("Paid-Member-Goal/referrals");
17915
17926
  return View(`/programGoals/count/${dummy}`, "/(programGoals)/:metricType/:goalId");
17927
+ });
17928
+ const CustomField = createHookStory(() => {
17929
+ return View(`/customFields/thingCount`, "/(customFields)/:customField");
17916
17930
  });
17917
17931
 
17918
17932
  const UseBigStat = /*#__PURE__*/Object.freeze({
@@ -17944,7 +17958,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
17944
17958
  RewardsAvailableWithSlash: RewardsAvailableWithSlash,
17945
17959
  RewardBalance: RewardBalance,
17946
17960
  RewardBalanceCashUSD: RewardBalanceCashUSD,
17947
- ProgramGoals: ProgramGoals
17961
+ ProgramGoals: ProgramGoals,
17962
+ CustomField: CustomField
17948
17963
  });
17949
17964
 
17950
17965
  function setupGraphQL$4() {
@@ -18251,6 +18266,44 @@ const UseRewardExchangeList = /*#__PURE__*/Object.freeze({
18251
18266
  VariableCreditReward: VariableCreditReward
18252
18267
  });
18253
18268
 
18269
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
18270
+ const UseTaskCard_stories = {
18271
+ title: "Hooks / useTaskCard",
18272
+ };
18273
+ function setupGraphQL$7() {
18274
+ const id = "sam+klip@saasquat.ch";
18275
+ const accountId = id;
18276
+ const programId = "klip-referral-program";
18277
+ //@ts-ignore
18278
+ window.widgetIdent = {
18279
+ tenantAlias: "test_a74miwdpofztj",
18280
+ appDomain: "https://staging.referralsaasquatch.com",
18281
+ programId,
18282
+ };
18283
+ useEffect(() => {
18284
+ L$1({
18285
+ accountId,
18286
+ id,
18287
+ jwt: JWT,
18288
+ });
18289
+ return () => {
18290
+ window.widgetIdent = undefined;
18291
+ L$1(undefined);
18292
+ };
18293
+ }, []);
18294
+ return { id, accountId };
18295
+ }
18296
+ const TaskCard = createHookStory(() => {
18297
+ setupGraphQL$7();
18298
+ return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
18299
+ });
18300
+
18301
+ const UseTaskCard = /*#__PURE__*/Object.freeze({
18302
+ __proto__: null,
18303
+ 'default': UseTaskCard_stories,
18304
+ TaskCard: TaskCard
18305
+ });
18306
+
18254
18307
  const NewPortal_stories = {
18255
18308
  title: "New Portal",
18256
18309
  };
@@ -18370,10 +18423,10 @@ const Dashboard = () => {
18370
18423
  h("h1", null, "John Smith"))),
18371
18424
  })),
18372
18425
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18373
- h(BigStatView, Object.assign({}, { statvalue: "2,345" }), "Clicks"),
18374
- h(BigStatView, Object.assign({}, { statvalue: "58" }), "Referrals"),
18375
- h(BigStatView, Object.assign({}, { statvalue: "$10,540" }), "Earned"),
18376
- h(BigStatView, Object.assign({}, { statvalue: "$2,305" }), "Awaiting Payout"))),
18426
+ h(BigStatView, Object.assign({}, { statvalue: "2,345", value: 234500 }), "Clicks"),
18427
+ h(BigStatView, Object.assign({}, { statvalue: "58", value: 58 }), "Referrals"),
18428
+ h(BigStatView, Object.assign({}, { statvalue: "$10,540", value: 1054000 }), "Earned"),
18429
+ h(BigStatView, Object.assign({}, { statvalue: "$2,305", value: 230500 }), "Awaiting Payout"))),
18377
18430
  h(PortalContainerView, Object.assign({}, { direction: "column", padding: "xxx-large", gap: "xxx-large" }),
18378
18431
  h(PortalSectionView, Object.assign({}, {
18379
18432
  labelMargin: "x-large",
@@ -18497,10 +18550,10 @@ const Commissions = () => {
18497
18550
  "program"))),
18498
18551
  })),
18499
18552
  h(StatContainerView, Object.assign({}, { space: "64px" }),
18500
- h(BigStatView, Object.assign({}, { statvalue: "$ 1,000" }), "Total Earned"),
18501
- h(BigStatView, Object.assign({}, { statvalue: "$ 800" }), "Available"),
18502
- h(BigStatView, Object.assign({}, { statvalue: "$ 180" }), "Pending"),
18503
- h(BigStatView, Object.assign({}, { statvalue: "$ 20" }), "Redeemed"))))));
18553
+ h(BigStatView, Object.assign({}, { statvalue: "$ 1,000", value: 100000 }), "Total Earned"),
18554
+ h(BigStatView, Object.assign({}, { statvalue: "$ 800", value: 80000 }), "Available"),
18555
+ h(BigStatView, Object.assign({}, { statvalue: "$ 180", value: 18000 }), "Pending"),
18556
+ h(BigStatView, Object.assign({}, { statvalue: "$ 20", value: 2000 }), "Redeemed"))))));
18504
18557
  };
18505
18558
  const Activity = () => {
18506
18559
  return (h("sqm-divided-layout", { direction: "row" },
@@ -18527,10 +18580,10 @@ const Activity = () => {
18527
18580
  label: (h("sqm-text", null,
18528
18581
  h("h3", null, "Referral Activity"))),
18529
18582
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18530
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Total Referrals"),
18531
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "Converted"),
18532
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "Pending"),
18533
- h(BigStatView, Object.assign({}, { statvalue: "20" }), "Disqualified"))),
18583
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 100000 }), "Total Referrals"),
18584
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "Converted"),
18585
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "Pending"),
18586
+ h(BigStatView, Object.assign({}, { statvalue: "20", value: 20 }), "Disqualified"))),
18534
18587
  }))),
18535
18588
  h(PortalSectionView, Object.assign({}, {
18536
18589
  labelMargin: "x-large",
@@ -18538,9 +18591,9 @@ const Activity = () => {
18538
18591
  label: (h("sqm-text", null,
18539
18592
  h("h3", null, "Traffic Generated"))),
18540
18593
  content: (h(StatContainerView, Object.assign({}, { space: "64px" }),
18541
- h(BigStatView, Object.assign({}, { statvalue: "1,000" }), "Clicks"),
18542
- h(BigStatView, Object.assign({}, { statvalue: "800" }), "From share link"),
18543
- h(BigStatView, Object.assign({}, { statvalue: "180" }), "From share mediums"))),
18594
+ h(BigStatView, Object.assign({}, { statvalue: "1,000", value: 1000 }), "Clicks"),
18595
+ h(BigStatView, Object.assign({}, { statvalue: "800", value: 800 }), "From share link"),
18596
+ h(BigStatView, Object.assign({}, { statvalue: "180", value: 180 }), "From share mediums"))),
18544
18597
  })))));
18545
18598
  };
18546
18599
 
@@ -20545,8 +20598,496 @@ const PasswordField = /*#__PURE__*/Object.freeze({
20545
20598
  ValidationError: ValidationError
20546
20599
  });
20547
20600
 
20601
+ const checkmark_circle = () => {
20602
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
20603
+ 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" })));
20604
+ };
20605
+ const arrow_left_right = () => {
20606
+ return (h("svg", { width: 11, height: 12, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
20607
+ 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" })));
20608
+ };
20609
+
20610
+ const gift = () => {
20611
+ return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
20612
+ 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)" }),
20613
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
20614
+ 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)" })));
20615
+ };
20616
+
20617
+ function ProgressBarView(props) {
20618
+ const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, } = props;
20619
+ console.log("progress bar props", props);
20620
+ const gift1 = gift();
20621
+ const gift2 = gift();
20622
+ const gift3 = gift();
20623
+ var items = [];
20624
+ var columns = "";
20625
+ var repetitions = Math.floor(progress / goal);
20626
+ if (repeatable) {
20627
+ if (steps) {
20628
+ addStepsRepeatable();
20629
+ }
20630
+ else {
20631
+ addLinearRepeatable();
20632
+ }
20633
+ }
20634
+ // non repeatable
20635
+ else {
20636
+ if (steps) {
20637
+ addSteps();
20638
+ }
20639
+ else {
20640
+ addLinear();
20641
+ }
20642
+ }
20643
+ const style = {
20644
+ ProgressBar: {
20645
+ "& .progress-bar": {
20646
+ height: "15px",
20647
+ marginTop: "var(--sl-spacing-xx-large)",
20648
+ marginBottom: "var(--sl-spacing-xx-large)",
20649
+ marginRight: "var(--sl-spacing-x-small)",
20650
+ fontSize: "var(--sl-font-size-x-small)",
20651
+ display: "grid",
20652
+ gridTemplateColumns: columns,
20653
+ lineHeight: "45px",
20654
+ userSelect: "none",
20655
+ },
20656
+ "& .progress-bar.repeatable-steps": {
20657
+ marginLeft: "var(--sl-spacing-x-small)",
20658
+ },
20659
+ "& .filled:after": {
20660
+ content: '""',
20661
+ display: "flex",
20662
+ width: "100%",
20663
+ height: "4px",
20664
+ borderRadius: "4px",
20665
+ backgroundColor: "var(--sl-color-primary-500)",
20666
+ },
20667
+ "& .progress": {
20668
+ display: "block",
20669
+ textAlign: "center",
20670
+ marginLeft: "-100px",
20671
+ marginRight: "-100px",
20672
+ },
20673
+ "& .progress::after": {
20674
+ content: '""',
20675
+ width: "12px",
20676
+ height: "12px",
20677
+ display: "flex",
20678
+ backgroundColor: "var(--sl-color-primary-500)",
20679
+ borderRadius: "50%",
20680
+ position: "relative",
20681
+ left: "47%",
20682
+ top: "-85%",
20683
+ },
20684
+ "& .progress.bg:after": {
20685
+ width: "0",
20686
+ height: "0",
20687
+ border: "none",
20688
+ },
20689
+ "& .progress.top": {
20690
+ position: "relative",
20691
+ top: "-40px",
20692
+ },
20693
+ "& .progress.top:after": {
20694
+ top: "-16%",
20695
+ },
20696
+ "& .empty": {
20697
+ display: "block",
20698
+ textAlign: "center",
20699
+ marginLeft: "-100px",
20700
+ marginRight: "-100px",
20701
+ },
20702
+ "& .empty::after": {
20703
+ content: '""',
20704
+ width: "12px",
20705
+ height: "12px",
20706
+ border: "2px solid #E0E0E0",
20707
+ margin: "-2px",
20708
+ display: "flex",
20709
+ backgroundColor: "white",
20710
+ borderRadius: "50%",
20711
+ position: "relative",
20712
+ left: "47%",
20713
+ top: "-85%",
20714
+ },
20715
+ "& .empty.bg:after": {
20716
+ width: "0",
20717
+ height: "0",
20718
+ border: "none",
20719
+ },
20720
+ "& .remain:after": {
20721
+ content: '""',
20722
+ display: "flex",
20723
+ width: "100%",
20724
+ height: "4px",
20725
+ borderRadius: "4px",
20726
+ backgroundColor: "#E0E0E0",
20727
+ },
20728
+ "& .gift.bw": {
20729
+ filter: "grayscale(100%)",
20730
+ },
20731
+ "& .gift.start": {
20732
+ transform: "scale(80%)",
20733
+ top: "-20px",
20734
+ },
20735
+ "& .gift": {
20736
+ textAlign: "center",
20737
+ marginLeft: "-100px",
20738
+ marginRight: "-100px",
20739
+ position: "relative",
20740
+ display: "list-item",
20741
+ listStyleType: "none",
20742
+ top: "-18px",
20743
+ filter: goal <= progress ? "" : "grayscale(100%)",
20744
+ zIndex: "1",
20745
+ },
20746
+ },
20747
+ };
20748
+ jss.setup(create());
20749
+ const sheet = jss.createStyleSheet(style);
20750
+ const styleString = sheet.toString();
20751
+ return (h("div", { class: sheet.classes.ProgressBar },
20752
+ h("style", { type: "text/css" }, styleString),
20753
+ h("div", { class: repetitions > 1 ? "progress-bar repeatable-steps" : "progress-bar" }, items)));
20754
+ function clamp(x, min, max) {
20755
+ return Math.min(Math.max(x, min), max);
20756
+ }
20757
+ function addLinear() {
20758
+ const ratio = progress / goal;
20759
+ columns =
20760
+ clamp(ratio, 0, 1) + "fr 0fr " + clamp(1 - ratio, 0, 1) + "fr 0fr 0fr";
20761
+ items.push(h("div", { class: "filled" }));
20762
+ items.push(h("div", { class: clamp(progress, 0, goal) == goal ? "progress top bg" : "progress top" }, clamp(progress, 0, goal) == goal
20763
+ ? ""
20764
+ : progressBarUnit + clamp(progress, 0, goal)));
20765
+ items.push(h("div", { class: "remain" }));
20766
+ items.push(h("div", { class: "progress bg" }, goal));
20767
+ items.push(h("div", { class: "gift" }, gift1));
20768
+ }
20769
+ function addSteps() {
20770
+ let ratio = 1 / goal;
20771
+ for (let i = 1; i < goal; i++) {
20772
+ columns += ratio + "fr 0fr ";
20773
+ if (i > progress) {
20774
+ items.push(h("div", { class: "remain" }));
20775
+ items.push(h("div", { class: "empty" }, i));
20776
+ }
20777
+ else {
20778
+ items.push(h("div", { class: "filled" }));
20779
+ items.push(h("div", { class: "progress" }, i));
20780
+ }
20781
+ }
20782
+ columns += ratio + "fr 0fr ";
20783
+ // reward success
20784
+ if (goal <= progress) {
20785
+ columns += "0fr ";
20786
+ items.push(h("div", { class: "filled" }));
20787
+ items.push(h("div", { class: "progress bg" }, goal));
20788
+ items.push(h("div", { class: "gift" }, gift1));
20789
+ }
20790
+ // reward fail
20791
+ else {
20792
+ columns += "0fr ";
20793
+ items.push(h("div", { class: "remain" }));
20794
+ items.push(h("div", { class: "empty bg" }, goal));
20795
+ items.push(h("div", { class: "gift" }, gift1));
20796
+ }
20797
+ }
20798
+ function addLinearRepeatable() {
20799
+ let repetitions = Math.floor(progress / goal);
20800
+ let ratio = ((progress % goal) / goal) * 0.5;
20801
+ // 0 repetition
20802
+ if (repetitions == 0) {
20803
+ columns = ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr 0.5fr 0fr 0fr";
20804
+ items.push(h("div", { class: "filled" }));
20805
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progressBarUnit + progress));
20806
+ items.push(h("div", { class: "remain" }));
20807
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
20808
+ items.push(h("div", { class: "gift" }, gift1));
20809
+ items.push(h("div", { class: "remain" }));
20810
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
20811
+ items.push(h("div", { class: "gift bw" }, gift2));
20812
+ }
20813
+ // single repetition
20814
+ else if (repetitions == 1) {
20815
+ columns =
20816
+ "0.5fr 0fr 0fr " + ratio + "fr 0fr " + (0.5 - ratio) + "fr 0fr 0fr";
20817
+ items.push(h("div", { class: "filled" }));
20818
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal));
20819
+ items.push(h("div", { class: "gift" }, gift1));
20820
+ items.push(h("div", { class: "filled" }));
20821
+ items.push(h("div", { class: progress == goal ? "progress top bg" : "progress top" }, progress == goal ? "" : progressBarUnit + progress));
20822
+ items.push(h("div", { class: "remain" }));
20823
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
20824
+ items.push(h("div", { class: "gift bw" }, gift2));
20825
+ }
20826
+ // multiple repetitions
20827
+ else {
20828
+ columns =
20829
+ "0fr 0fr 0.5fr 0fr 0fr " +
20830
+ ratio +
20831
+ "fr 0fr " +
20832
+ (0.5 - ratio) +
20833
+ "fr 0fr 0fr";
20834
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions - 1)));
20835
+ items.push(h("div", { class: "gift start" }, gift1));
20836
+ items.push(h("div", { class: "filled" }));
20837
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * repetitions));
20838
+ items.push(h("div", { class: "gift" }, gift2));
20839
+ items.push(h("div", { class: "filled" }));
20840
+ items.push(h("div", { class: progress == goal * repetitions ? "progress top bg" : "progress top" }, progress == goal * repetitions ? "" : progressBarUnit + progress));
20841
+ items.push(h("div", { class: "remain" }));
20842
+ items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (repetitions + 1)));
20843
+ items.push(h("div", { class: "gift bw" }, gift3));
20844
+ }
20845
+ }
20846
+ function addStepsRepeatable() {
20847
+ let repetitions = Math.floor(progress / goal);
20848
+ // no or single repetition
20849
+ if (repetitions < 2) {
20850
+ let ratio = 1 / goal;
20851
+ for (let i = 1; i < goal * 2 + 1; i++) {
20852
+ columns += ratio + "fr 0fr ";
20853
+ if (i > progress) {
20854
+ if (i == goal) {
20855
+ columns += "0fr ";
20856
+ items.push(h("div", { class: "remain" }));
20857
+ items.push(h("div", { class: "empty bg" }, goal));
20858
+ items.push(h("div", { class: "gift bw" }, gift1));
20859
+ }
20860
+ else if (i == goal * 2) {
20861
+ columns += "0fr 0fr";
20862
+ items.push(h("div", { class: "remain" }));
20863
+ items.push(h("div", { class: "empty bg" }, goal * 2));
20864
+ items.push(h("div", { class: "gift bw" }, gift2));
20865
+ }
20866
+ else {
20867
+ items.push(h("div", { class: "remain" }));
20868
+ items.push(h("div", { class: "empty" }, progressBarUnit + i));
20869
+ }
20870
+ }
20871
+ else if (i == goal) {
20872
+ columns += "0fr ";
20873
+ items.push(h("div", { class: "filled" }));
20874
+ items.push(h("div", { class: "progress bg" }, i));
20875
+ items.push(h("div", { class: "gift" }, gift3));
20876
+ }
20877
+ else {
20878
+ items.push(h("div", { class: "filled" }));
20879
+ items.push(h("div", { class: "progress" }, i));
20880
+ }
20881
+ }
20882
+ }
20883
+ // case repetition many
20884
+ else {
20885
+ let position = (progress % goal) + goal;
20886
+ let ratio = 1 / goal;
20887
+ columns += "0fr 0fr ";
20888
+ items.push(h("div", { class: "progress bg" }, goal * (repetitions - 1)));
20889
+ items.push(h("div", { class: "gift start" }, gift1));
20890
+ for (let i = 1; i < goal * 2 + 1; i++) {
20891
+ columns += ratio + "fr 0fr ";
20892
+ if (i <= goal) {
20893
+ if (i == goal) {
20894
+ columns += "0fr ";
20895
+ items.push(h("div", { class: "filled" }));
20896
+ items.push(h("div", { class: "progress bg" }, i + goal * (repetitions - 1)));
20897
+ items.push(h("div", { class: "gift" }, gift2));
20898
+ }
20899
+ else {
20900
+ items.push(h("div", { class: "filled" }));
20901
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
20902
+ }
20903
+ }
20904
+ else if (i > position) {
20905
+ if (i == goal * 2) {
20906
+ columns += "0fr 0fr";
20907
+ items.push(h("div", { class: "remain" }));
20908
+ items.push(h("div", { class: "empty bg" }, i + goal * (repetitions - 1)));
20909
+ items.push(h("div", { class: "gift bw" }, gift3));
20910
+ }
20911
+ else {
20912
+ items.push(h("div", { class: "remain" }));
20913
+ items.push(h("div", { class: "empty" }, i + goal * (repetitions - 1)));
20914
+ }
20915
+ }
20916
+ else {
20917
+ items.push(h("div", { class: "filled" }));
20918
+ items.push(h("div", { class: "progress" }, i + goal * (repetitions - 1)));
20919
+ }
20920
+ }
20921
+ }
20922
+ }
20923
+ }
20924
+
20925
+ function TaskCardView(props) {
20926
+ const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
20927
+ console.log({ props });
20928
+ const checkmark_circle$1 = checkmark_circle();
20929
+ const arrow_left_right$1 = arrow_left_right();
20930
+ const style = {
20931
+ HostBlock: HostBlock,
20932
+ TaskCard: {
20933
+ "& .main > div": {
20934
+ margin: "var(--sl-spacing-medium)",
20935
+ },
20936
+ "& .main": {
20937
+ position: "relative",
20938
+ boxSizing: "border-box",
20939
+ minWidth: "347px",
20940
+ background: "var(--sl-color-white)",
20941
+ border: "1px solid var(--sl-color-gray-300)",
20942
+ borderRadius: "var(--sl-border-radius-medium)",
20943
+ fontSize: "var(--sl-font-size-small)",
20944
+ lineHeight: "var(--sl-line-height-dense)",
20945
+ },
20946
+ "& .main.complete": {
20947
+ background: "var(--sl-color-primary-50)",
20948
+ borderColor: "var(--sl-color-primary-700)",
20949
+ },
20950
+ },
20951
+ Header: {
20952
+ display: "flex",
20953
+ "& .icon": {
20954
+ alignSelf: "center",
20955
+ lineHeight: "0",
20956
+ color: "var(--sl-color-primary-700)",
20957
+ fontSize: "var(--sl-font-size-large)",
20958
+ marginRight: "var(--sl-spacing-x-small)",
20959
+ },
20960
+ "& .value": {
20961
+ alignSelf: "center",
20962
+ color: "var(--sl-color-black)",
20963
+ fontSize: "var(--sl-font-size-x-large)",
20964
+ fontWeight: "var(--sl-font-weight-semibold)",
20965
+ lineHeight: "100%",
20966
+ marginRight: "var(--sl-spacing-xx-small)",
20967
+ },
20968
+ "& .text": {
20969
+ alignSelf: "end",
20970
+ textTransform: "uppercase",
20971
+ color: "var(--sl-color-gray-600)",
20972
+ fontSize: "var(--sl-font-size-x-small)",
20973
+ lineHeight: "var(--sl-font-size-medium)",
20974
+ marginRight: "var(--sl-spacing-xx-small)",
20975
+ },
20976
+ },
20977
+ Title: {
20978
+ color: "var(--sl-color-black)",
20979
+ fontSize: "var(--sl-font-size-small)",
20980
+ },
20981
+ Footer: {
20982
+ display: "flex",
20983
+ "& .icon": {
20984
+ fontSize: "var(--sl-font-size-xx-small)",
20985
+ marginRight: "var(--sl-spacing-xx-small)",
20986
+ },
20987
+ "& .text": {
20988
+ marginTop: "auto",
20989
+ fontSize: "var(--sl-font-size-x-small)",
20990
+ color: "var(--sl-color-gray-600)",
20991
+ },
20992
+ "& .action": {
20993
+ marginTop: "auto",
20994
+ marginLeft: "auto",
20995
+ },
20996
+ "& sl-button.action::part(base) ": {
20997
+ color: "var(--sl-color-white)",
20998
+ background: "var(--sl-color-primary-500)",
20999
+ border: "1px solid var(--sl-color-primary-500)",
21000
+ borderRadius: "var(--sl-border-radius-medium)",
21001
+ },
21002
+ },
21003
+ };
21004
+ jss.setup(create());
21005
+ const sheet = jss.createStyleSheet(style);
21006
+ const styleString = sheet.toString();
21007
+ const showComplete = progress >= goal;
21008
+ const repetitions = showProgressBar ? Math.floor(progress / goal) : progress;
21009
+ console.log({ showProgressBar, loading });
21010
+ return (h("div", { class: sheet.classes.TaskCard },
21011
+ h("div", { class: showComplete ? "main complete" : "main" },
21012
+ h("style", { type: "text/css" }, styleString),
21013
+ h("div", { class: sheet.classes.Header },
21014
+ showComplete && h("span", { class: "icon" }, checkmark_circle$1),
21015
+ h("span", { class: "value" }, rewardAmount),
21016
+ h("span", { class: "text" }, rewardUnit)),
21017
+ h("div", { class: sheet.classes.Title }, cardTitle),
21018
+ showProgressBar && loading ? (h("sl-skeleton", { style: { width: "98%", margin: "0 auto" } })) : (showProgressBar && h(ProgressBarView, Object.assign({}, props))),
21019
+ h(Details, { description: description }),
21020
+ h("div", { class: sheet.classes.Footer },
21021
+ h("span", { class: "text" },
21022
+ repeatable && (h("div", null,
21023
+ h("span", { class: "icon" }, arrow_left_right$1),
21024
+ h("span", null,
21025
+ "Completed ",
21026
+ repetitions,
21027
+ " times"))),
21028
+ showExpiry && (h("span", null,
21029
+ "Ends ",
21030
+ " ",
21031
+ dateExpires))),
21032
+ h("sl-button", { class: "action", size: "small", onClick: () => alert(buttonLink), disabled: showComplete && repeatable == false }, showComplete && repeatable == false
21033
+ ? "Task completed"
21034
+ : buttonText)))));
21035
+ }
21036
+ function Details(props) {
21037
+ const style = {
21038
+ Description: {
21039
+ "& input[type=checkbox]": {
21040
+ display: "none",
21041
+ },
21042
+ "& input:checked ~ .details": {
21043
+ transform: "rotate(-180deg)",
21044
+ },
21045
+ "& .details": {
21046
+ position: "absolute",
21047
+ top: "var(--sl-spacing-medium)",
21048
+ right: "var(--sl-spacing-medium)",
21049
+ color: "var(--sl-color-gray-700)",
21050
+ fontSize: "var(--sl-font-size-large)",
21051
+ "& :hover": {
21052
+ color: "var(--sl-color-primary-700)",
21053
+ },
21054
+ transformOrigin: "50% 37%",
21055
+ transition: "transform var(--sl-transition-medium) ease",
21056
+ },
21057
+ "& input:checked ~ .summary": {
21058
+ transition: "max-height var(--sl-transition-medium) ease",
21059
+ maxHeight: "300px",
21060
+ },
21061
+ "& .summary": {
21062
+ display: "block",
21063
+ overflow: "hidden",
21064
+ color: "var(--sl-color-gray-700)",
21065
+ fontSize: "var(--sl-font-size-x-small)",
21066
+ maxHeight: "0px",
21067
+ transition: "max-height var(--sl-transition-fast) ease-out",
21068
+ },
21069
+ },
21070
+ };
21071
+ jss.setup(create());
21072
+ const sheet = jss.createStyleSheet(style);
21073
+ const styleString = sheet.toString();
21074
+ const rid = Math.random().toString(36).slice(2);
21075
+ return (h("div", null,
21076
+ h("style", { type: "text/css" }, styleString),
21077
+ h("span", { class: sheet.classes.Description },
21078
+ h("input", { type: "checkbox", id: "details-" + rid }),
21079
+ h("label", { class: "details", htmlFor: "details-" + rid },
21080
+ h("sl-icon", { name: "chevron-down" })),
21081
+ h("span", { class: "summary" }, props.description))));
21082
+ }
21083
+
21084
+ 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";
21085
+
20548
21086
  const TaskCard_stories = {
20549
- title: "Components/Task Card",
21087
+ title: "Components/Task Card/",
21088
+ parameters: {
21089
+ scenario: scenario$5,
21090
+ },
20550
21091
  };
20551
21092
  const resizable = {
20552
21093
  width: "347px",
@@ -20555,35 +21096,47 @@ const resizable = {
20555
21096
  height: "fit-content",
20556
21097
  overflow: "hidden",
20557
21098
  };
20558
- const Default$a = () => {
20559
- // @ts-ignore
20560
- return h(TaskCardView, null);
20561
- };
20562
21099
  const NotRepeatable = () => {
20563
21100
  const oneAction = {
20564
- points: 20,
21101
+ rewardAmount: 20,
21102
+ showExpiry: false,
21103
+ rewardUnit: "Points",
20565
21104
  cardTitle: "Complete a survey",
21105
+ repeatable: false,
20566
21106
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20567
21107
  buttonText: "Take survey",
20568
21108
  goal: 1,
21109
+ buttonLink: "https://example.com/",
21110
+ showProgressBar: false,
21111
+ loading: false,
20569
21112
  };
20570
21113
  const coupleActions = {
20571
- points: 40,
21114
+ rewardAmount: 40,
21115
+ rewardUnit: "Points",
20572
21116
  cardTitle: "Comment on 5 articles",
20573
21117
  showProgressBar: true,
21118
+ showExpiry: false,
20574
21119
  goal: 5,
20575
- steps: 1,
21120
+ repeatable: false,
21121
+ steps: true,
20576
21122
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20577
21123
  buttonText: "Start reading",
21124
+ buttonLink: "https://example.com/",
21125
+ loading: false,
20578
21126
  };
20579
21127
  const manyActions = {
20580
- points: 150,
21128
+ rewardAmount: 150,
21129
+ rewardUnit: "Points",
20581
21130
  cardTitle: "Spend $500 at our Store",
20582
21131
  showProgressBar: true,
21132
+ showExpiry: false,
20583
21133
  goal: 500,
21134
+ repeatable: false,
20584
21135
  unit: "$",
20585
21136
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20586
21137
  buttonText: "Visit our Store",
21138
+ buttonLink: "https://example.com/",
21139
+ loading: false,
20587
21140
  };
20588
21141
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20589
21142
  h("div", { style: resizable },
@@ -20604,13 +21157,6 @@ const NotRepeatable = () => {
20604
21157
  h("h5", null),
20605
21158
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20606
21159
  " ",
20607
- h("h5", null),
20608
- h("h5", null,
20609
- "Progress ",
20610
- ">",
20611
- " Goal"),
20612
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20613
- " ",
20614
21160
  h("h5", null)),
20615
21161
  h("div", { style: resizable },
20616
21162
  h("h4", null, "Many Actions"),
@@ -20622,46 +21168,52 @@ const NotRepeatable = () => {
20622
21168
  h("h5", null),
20623
21169
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20624
21170
  " ",
20625
- h("h5", null),
20626
- h("h5", null,
20627
- "Progress ",
20628
- ">",
20629
- " Goal"),
20630
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20631
- " ",
20632
21171
  h("h5", null))));
20633
21172
  };
20634
21173
  const NotRepeatableWithExpiry = () => {
20635
21174
  const oneAction = {
20636
- points: 20,
21175
+ rewardAmount: 20,
21176
+ rewardUnit: "Points",
20637
21177
  cardTitle: "Complete a survey",
20638
21178
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20639
21179
  buttonText: "Take survey",
20640
21180
  goal: 1,
20641
- expire: true,
20642
- dateExpire: "Nov 1, 2021",
21181
+ showExpiry: true,
21182
+ repeatable: false,
21183
+ dateExpires: "Nov 1, 2021",
21184
+ buttonLink: "https://example.com/",
21185
+ showProgressBar: false,
21186
+ loading: false,
20643
21187
  };
20644
21188
  const coupleActions = {
20645
- points: 40,
21189
+ rewardAmount: 40,
21190
+ rewardUnit: "Points",
20646
21191
  cardTitle: "Comment on 5 articles",
20647
21192
  showProgressBar: true,
20648
21193
  goal: 5,
20649
- steps: 1,
21194
+ steps: true,
20650
21195
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20651
21196
  buttonText: "Start reading",
20652
- expire: true,
20653
- dateExpire: "Nov 1, 2021",
21197
+ showExpiry: true,
21198
+ repeatable: false,
21199
+ dateExpires: "Nov 1, 2021",
21200
+ buttonLink: "https://example.com/",
21201
+ loading: false,
20654
21202
  };
20655
21203
  const manyActions = {
20656
- points: 150,
21204
+ rewardAmount: 150,
21205
+ rewardUnit: "Points",
21206
+ repeatable: false,
20657
21207
  cardTitle: "Spend $500 at our Store",
20658
21208
  showProgressBar: true,
20659
21209
  goal: 500,
20660
21210
  unit: "$",
20661
21211
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20662
21212
  buttonText: "Visit our Store",
20663
- expire: true,
20664
- dateExpire: "Nov 1, 2021",
21213
+ showExpiry: true,
21214
+ dateExpires: "Nov 1, 2021",
21215
+ buttonLink: "https://example.com/",
21216
+ loading: false,
20665
21217
  };
20666
21218
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20667
21219
  h("div", { style: resizable },
@@ -20682,13 +21234,6 @@ const NotRepeatableWithExpiry = () => {
20682
21234
  h("h5", null),
20683
21235
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
20684
21236
  " ",
20685
- h("h5", null),
20686
- h("h5", null,
20687
- "Progress ",
20688
- ">",
20689
- " Goal"),
20690
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
20691
- " ",
20692
21237
  h("h5", null)),
20693
21238
  h("div", { style: resizable },
20694
21239
  h("h4", null, "Many Actions"),
@@ -20700,36 +21245,40 @@ const NotRepeatableWithExpiry = () => {
20700
21245
  h("h5", null),
20701
21246
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
20702
21247
  " ",
20703
- h("h5", null),
20704
- h("h5", null,
20705
- "Progress ",
20706
- ">",
20707
- " Goal"),
20708
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
20709
- " ",
20710
21248
  h("h5", null))));
20711
21249
  };
20712
21250
  const Repeatable = () => {
20713
21251
  const oneAction = {
20714
- points: 20,
21252
+ rewardAmount: 20,
21253
+ rewardUnit: "Points",
21254
+ showExpiry: false,
20715
21255
  cardTitle: "Complete a survey",
20716
21256
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20717
21257
  buttonText: "Take survey",
20718
21258
  goal: 1,
20719
21259
  repeatable: true,
21260
+ buttonLink: "https://example.com/",
21261
+ showProgressBar: false,
21262
+ loading: false,
20720
21263
  };
20721
21264
  const coupleActions = {
20722
- points: 40,
21265
+ rewardAmount: 40,
21266
+ rewardUnit: "Points",
21267
+ showExpiry: false,
20723
21268
  cardTitle: "Comment on 5 articles",
20724
21269
  showProgressBar: true,
20725
21270
  repeatable: true,
20726
21271
  goal: 5,
20727
- steps: 1,
21272
+ steps: true,
20728
21273
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20729
21274
  buttonText: "Start reading",
21275
+ buttonLink: "https://example.com/",
21276
+ loading: false,
20730
21277
  };
20731
21278
  const manyActions = {
20732
- points: 150,
21279
+ rewardAmount: 150,
21280
+ rewardUnit: "Points",
21281
+ showExpiry: false,
20733
21282
  cardTitle: "Spend $500 at our Store",
20734
21283
  showProgressBar: true,
20735
21284
  repeatable: true,
@@ -20737,6 +21286,8 @@ const Repeatable = () => {
20737
21286
  unit: "$",
20738
21287
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20739
21288
  buttonText: "Visit our Store",
21289
+ buttonLink: "https://example.com/",
21290
+ loading: false,
20740
21291
  };
20741
21292
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20742
21293
  h("div", { style: resizable },
@@ -20760,18 +21311,6 @@ const Repeatable = () => {
20760
21311
  h("h5", null),
20761
21312
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20762
21313
  " ",
20763
- h("h5", null),
20764
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20765
- " ",
20766
- h("h5", null),
20767
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
20768
- " ",
20769
- h("h5", null),
20770
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20771
- " ",
20772
- h("h5", null),
20773
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
20774
- " ",
20775
21314
  h("h5", null)),
20776
21315
  h("div", { style: resizable },
20777
21316
  h("h4", null, "Many Actions"),
@@ -20786,45 +21325,41 @@ const Repeatable = () => {
20786
21325
  h("h5", null),
20787
21326
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20788
21327
  " ",
20789
- h("h5", null),
20790
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20791
- " ",
20792
- h("h5", null),
20793
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
20794
- " ",
20795
- h("h5", null),
20796
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20797
- " ",
20798
- h("h5", null),
20799
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20800
- " ",
20801
21328
  h("h5", null))));
20802
21329
  };
20803
21330
  const RepeatableWithExpiry = () => {
20804
21331
  const oneAction = {
20805
- points: 20,
21332
+ rewardAmount: 20,
21333
+ rewardUnit: "Points",
20806
21334
  cardTitle: "Complete a survey",
20807
21335
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20808
21336
  buttonText: "Take survey",
20809
21337
  goal: 1,
20810
21338
  repeatable: true,
20811
- expire: true,
20812
- dateExpire: "Nov 1, 2021",
21339
+ showExpiry: true,
21340
+ dateExpires: "Nov 1, 2021",
21341
+ buttonLink: "https://example.com/",
21342
+ showProgressBar: false,
21343
+ loading: false,
20813
21344
  };
20814
21345
  const coupleActions = {
20815
- points: 40,
21346
+ rewardAmount: 40,
21347
+ rewardUnit: "Points",
20816
21348
  cardTitle: "Comment on 5 articles",
20817
21349
  showProgressBar: true,
20818
21350
  repeatable: true,
20819
21351
  goal: 5,
20820
- steps: 1,
21352
+ steps: true,
20821
21353
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20822
21354
  buttonText: "Start reading",
20823
- expire: true,
20824
- dateExpire: "Nov 1, 2021",
21355
+ showExpiry: true,
21356
+ dateExpires: "Nov 1, 2021",
21357
+ buttonLink: "https://example.com/",
21358
+ loading: false,
20825
21359
  };
20826
21360
  const manyActions = {
20827
- points: 150,
21361
+ rewardAmount: 150,
21362
+ rewardUnit: "Points",
20828
21363
  cardTitle: "Spend $500 at our Store",
20829
21364
  showProgressBar: true,
20830
21365
  repeatable: true,
@@ -20832,8 +21367,10 @@ const RepeatableWithExpiry = () => {
20832
21367
  unit: "$",
20833
21368
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20834
21369
  buttonText: "Visit our Store",
20835
- expire: true,
20836
- dateExpire: "Nov 1, 2021",
21370
+ showExpiry: true,
21371
+ dateExpires: "Nov 1, 2021",
21372
+ buttonLink: "https://example.com/",
21373
+ loading: false,
20837
21374
  };
20838
21375
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
20839
21376
  h("div", { style: resizable },
@@ -20857,18 +21394,6 @@ const RepeatableWithExpiry = () => {
20857
21394
  h("h5", null),
20858
21395
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
20859
21396
  " ",
20860
- h("h5", null),
20861
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
20862
- " ",
20863
- h("h5", null),
20864
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
20865
- " ",
20866
- h("h5", null),
20867
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
20868
- " ",
20869
- h("h5", null),
20870
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
20871
- " ",
20872
21397
  h("h5", null)),
20873
21398
  h("div", { style: resizable },
20874
21399
  h("h4", null, "Many Actions"),
@@ -20883,169 +21408,143 @@ const RepeatableWithExpiry = () => {
20883
21408
  h("h5", null),
20884
21409
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
20885
21410
  " ",
20886
- h("h5", null),
20887
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
20888
- " ",
20889
- h("h5", null),
20890
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
20891
- " ",
20892
- h("h5", null),
20893
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
20894
- " ",
20895
- h("h5", null),
20896
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
20897
- " ",
20898
21411
  h("h5", null))));
20899
- };
20900
- // export const Repeatable = () => {
20901
- // const oneAction = {
20902
- // points: 20,
20903
- // cardTitle: "Complete a survey",
20904
- // description:
20905
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20906
- // repeatable: 0,
20907
- // buttonText: "Take survey",
20908
- // buttonOnClick: () => {},
20909
- // };
20910
- // const coupleActions = {
20911
- // points: 40,
20912
- // cardTitle: "Comment on 5 articles",
20913
- // goal: 5,
20914
- // steps: 1,
20915
- // repeatable: true,
20916
- // description:
20917
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20918
- // buttonText: "Start reading",
20919
- // buttonOnClick: () => {},
20920
- // };
20921
- // const manyActions = {
20922
- // points: 150,
20923
- // cardTitle: "Spend $500 at our Store",
20924
- // goal: 500,
20925
- // repeatable: true,
20926
- // unit: "$",
20927
- // description:
20928
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20929
- // buttonText: "Visit our Store",
20930
- // buttonOnClick: () => {},
20931
- // };
20932
- // return (
20933
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20934
- // <div style={resizable}>
20935
- // <h4>One Action</h4>
20936
- // <TaskCardView {...oneAction} /> <h5 />
20937
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20938
- // </div>
20939
- // <div style={resizable}>
20940
- // <h4>A Couple Actions</h4>
20941
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
20942
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
20943
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
20944
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
20945
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
20946
- // </div>
20947
- // <div style={resizable}>
20948
- // <h4>Many Actions</h4>
20949
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
20950
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
20951
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
20952
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
20953
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
20954
- // </div>
20955
- // </div>
20956
- // );
20957
- // };
20958
- // export const RepeatableWithExpiry = () => {
20959
- // const oneAction = {
20960
- // points: 20,
20961
- // cardTitle: "Complete a survey",
20962
- // expire: "Nov 30, 2021",
20963
- // description:
20964
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20965
- // repeatable: 0,
20966
- // buttonText: "Take survey",
20967
- // buttonOnClick: () => {},
20968
- // };
20969
- // const coupleActions = {
20970
- // points: 40,
20971
- // cardTitle: "Comment on 5 articles",
20972
- // expire: "Nov 30, 2021",
20973
- // goal: 5,
20974
- // steps: 1,
20975
- // repeatable: true,
20976
- // description:
20977
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20978
- // buttonText: "Start reading",
20979
- // buttonOnClick: () => {},
20980
- // };
20981
- // const manyActions = {
20982
- // points: 150,
20983
- // cardTitle: "Spend $500 at our Store",
20984
- // expire: "Nov 30, 2021",
20985
- // goal: 500,
20986
- // repeatable: true,
20987
- // unit: "$",
20988
- // description:
20989
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
20990
- // buttonText: "Visit our Store",
20991
- // buttonOnClick: () => {},
20992
- // };
20993
- // return (
20994
- // <div style={{ display: "inline-flex", gap: "32px" }}>
20995
- // <div style={resizable}>
20996
- // <h4>One Action</h4>
20997
- // <TaskCardView {...oneAction} /> <h5 />
20998
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
20999
- // </div>
21000
- // <div style={resizable}>
21001
- // <h4>A Couple Actions</h4>
21002
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
21003
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
21004
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
21005
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
21006
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
21007
- // </div>
21008
- // <div style={resizable}>
21009
- // <h4>Many Actions</h4>
21010
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
21011
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
21012
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
21013
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
21014
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
21015
- // </div>
21016
- // </div>
21017
- // );
21018
- // };
21019
- // export const ProgressBar = () => {
21020
- // const props = {
21021
- // goal: 5,
21022
- // };
21023
- // return (
21024
- // <div>
21025
- // <MatrixStory
21026
- // matrix={{ progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }}
21027
- // props={props}
21028
- // Component={ProgressBarView}
21029
- // />
21030
- // <MatrixStory
21031
- // matrix={{ progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }}
21032
- // props={props}
21033
- // Component={ProgressBarView}
21034
- // />
21035
- // </div>
21036
- // );
21037
- // };
21038
-
21039
- const TaskCard = /*#__PURE__*/Object.freeze({
21412
+ };
21413
+
21414
+ const TaskCard$1 = /*#__PURE__*/Object.freeze({
21040
21415
  __proto__: null,
21041
21416
  'default': TaskCard_stories,
21042
- Default: Default$a,
21043
21417
  NotRepeatable: NotRepeatable,
21044
21418
  NotRepeatableWithExpiry: NotRepeatableWithExpiry,
21045
21419
  Repeatable: Repeatable,
21046
21420
  RepeatableWithExpiry: RepeatableWithExpiry
21047
21421
  });
21048
21422
 
21423
+ /**
21424
+ * Displays a cartesian product of the input props
21425
+ *
21426
+ * @returns
21427
+ */
21428
+ function MatrixStory({ matrix, props, Component, }) {
21429
+ const propMatrix = Object.keys(matrix).map((propKey) => {
21430
+ const propValues = matrix[propKey];
21431
+ return propValues.map((val) => {
21432
+ return {
21433
+ [propKey]: val,
21434
+ };
21435
+ });
21436
+ });
21437
+ const combinations = cartesian(...propMatrix);
21438
+ const propsCombinations = combinations.map((combo) => {
21439
+ return combo.reduce((props, prop) => {
21440
+ return {
21441
+ ...props,
21442
+ ...prop,
21443
+ };
21444
+ }, {});
21445
+ });
21446
+ return propsCombinations.map((combo) => {
21447
+ const example = { ...props, ...combo };
21448
+ return (h("div", null,
21449
+ h(PropsTable, { values: example }),
21450
+ h("hr", null),
21451
+ h(Component, Object.assign({}, example))));
21452
+ });
21453
+ }
21454
+ function PropsTable({ values }) {
21455
+ return (h("table", null,
21456
+ h("tbody", null, Object.keys(values).map((key) => {
21457
+ return (h("tr", null,
21458
+ h("th", null, key),
21459
+ h("td", null, JSON.stringify(values[key]))));
21460
+ }))));
21461
+ }
21462
+ /**
21463
+ * Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
21464
+ *
21465
+ * TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
21466
+ *
21467
+ * @param args - an array of arrays
21468
+ * @returns combinations of the elements in those array
21469
+ */
21470
+ function cartesian(...args) {
21471
+ var r = [], max = args.length - 1;
21472
+ function helper(arr, i) {
21473
+ for (var j = 0, l = args[i].length; j < l; j++) {
21474
+ var a = arr.slice(0); // clone arr
21475
+ a.push(args[i][j]);
21476
+ if (i == max)
21477
+ r.push(a);
21478
+ else
21479
+ helper(a, i + 1);
21480
+ }
21481
+ }
21482
+ helper([], 0);
21483
+ return r;
21484
+ }
21485
+
21486
+ 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 |";
21487
+
21488
+ const progressBar_stories = {
21489
+ title: "Components/Task Card Progress Bar",
21490
+ parameters: {
21491
+ scenario: scenario$6,
21492
+ },
21493
+ };
21494
+ const Default$a = () => {
21495
+ return h(ProgressBarView, null);
21496
+ };
21497
+ const ProgressBar$1 = () => {
21498
+ const props = {
21499
+ progress: 0,
21500
+ goal: 500,
21501
+ progressBarUnit: "$",
21502
+ };
21503
+ return (h("div", null,
21504
+ h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
21505
+ };
21506
+ const ProgressBarSteps = () => {
21507
+ const props = {
21508
+ progress: 0,
21509
+ steps: true,
21510
+ goal: 5,
21511
+ progressBarUnit: "$",
21512
+ };
21513
+ return (h("div", null,
21514
+ h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
21515
+ };
21516
+ const ProgressBarRepeatable = () => {
21517
+ const props = {
21518
+ progress: 0,
21519
+ goal: 500,
21520
+ progressBarUnit: "$",
21521
+ repeatable: true,
21522
+ };
21523
+ return (h("div", null,
21524
+ h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
21525
+ };
21526
+ const ProgressBarStepsRepeatable = () => {
21527
+ const props = {
21528
+ progress: 0,
21529
+ steps: true,
21530
+ goal: 5,
21531
+ progressBarUnit: "$",
21532
+ repeatable: true,
21533
+ };
21534
+ return (h("div", null,
21535
+ h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
21536
+ };
21537
+
21538
+ const TaskCardProgressBar = /*#__PURE__*/Object.freeze({
21539
+ __proto__: null,
21540
+ 'default': progressBar_stories,
21541
+ Default: Default$a,
21542
+ ProgressBar: ProgressBar$1,
21543
+ ProgressBarSteps: ProgressBarSteps,
21544
+ ProgressBarRepeatable: ProgressBarRepeatable,
21545
+ ProgressBarStepsRepeatable: ProgressBarStepsRepeatable
21546
+ });
21547
+
21049
21548
  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";
21050
21549
 
21051
21550
  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";
@@ -24282,12 +24781,12 @@ const PoweredByImg = /*#__PURE__*/Object.freeze({
24282
24781
  CustomWidthAndHeight: CustomWidthAndHeight
24283
24782
  });
24284
24783
 
24285
- const scenario$5 = "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";
24784
+ 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";
24286
24785
 
24287
24786
  const PortalFooter_stories = {
24288
24787
  title: "Portal Footer",
24289
24788
  parameters: {
24290
- scenario: scenario$5,
24789
+ scenario: scenario$7,
24291
24790
  },
24292
24791
  };
24293
24792
  const defaultProps$9 = {
@@ -24316,12 +24815,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
24316
24815
  FooterNoPoweredBy: FooterNoPoweredBy
24317
24816
  });
24318
24817
 
24319
- const scenario$6 = "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 |";
24818
+ 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 |";
24320
24819
 
24321
24820
  const Hero_stories = {
24322
24821
  title: "Hero Layout",
24323
24822
  parameters: {
24324
- scenario: scenario$6,
24823
+ scenario: scenario$8,
24325
24824
  },
24326
24825
  };
24327
24826
  const LoginOneColumn = () => {
@@ -24498,12 +24997,12 @@ const Hero = /*#__PURE__*/Object.freeze({
24498
24997
  TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
24499
24998
  });
24500
24999
 
24501
- const scenario$7 = "@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 | |";
25000
+ 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 | |";
24502
25001
 
24503
25002
  const ReferralIframe_stories = {
24504
25003
  title: "Referral Iframe",
24505
25004
  parameters: {
24506
- scenario: scenario$7,
25005
+ scenario: scenario$9,
24507
25006
  },
24508
25007
  };
24509
25008
  const props = {
@@ -24534,12 +25033,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
24534
25033
  ReferralIframeError: ReferralIframeError
24535
25034
  });
24536
25035
 
24537
- const scenario$8 = "@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";
25036
+ 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";
24538
25037
 
24539
25038
  const NameFields_stories = {
24540
25039
  title: "Name Fields",
24541
25040
  parameters: {
24542
- scenario: scenario$8,
25041
+ scenario: scenario$a,
24543
25042
  },
24544
25043
  };
24545
25044
  const props$1 = {
@@ -27157,7 +27656,9 @@ const CucumberAddon = ({ story }, children) => {
27157
27656
  // No scenario or invalid. Ignoring.
27158
27657
  }
27159
27658
  return (h("div", null,
27160
- result && h("pre", { innerHTML: result.value }),
27659
+ h("details", null,
27660
+ h("summary", null, "Specs"),
27661
+ result && h("pre", { innerHTML: result.value })),
27161
27662
  children));
27162
27663
  };
27163
27664
 
@@ -27194,7 +27695,8 @@ const stories = [
27194
27695
  ReferralTableRewardsCell$1,
27195
27696
  UserName,
27196
27697
  PasswordField,
27197
- TaskCard,
27698
+ TaskCard$1,
27699
+ TaskCardProgressBar,
27198
27700
  PortalTemplates,
27199
27701
  ProgramMenu$1,
27200
27702
  PoweredByImg,
@@ -27203,6 +27705,7 @@ const stories = [
27203
27705
  ReferralIframe$1,
27204
27706
  NameFields$1,
27205
27707
  UseRewardExchangeList,
27708
+ UseTaskCard,
27206
27709
  ];
27207
27710
  const StencilStorybook = class {
27208
27711
  constructor(hostRef) {
@@ -27242,6 +27745,77 @@ const TableRow = class {
27242
27745
  }
27243
27746
  };
27244
27747
 
27748
+ const TaskCard$2 = class {
27749
+ constructor(hostRef) {
27750
+ registerInstance(this, hostRef);
27751
+ this.ignored = true;
27752
+ /**
27753
+ * @uiName Reward Amount
27754
+ */
27755
+ this.rewardAmount = 0;
27756
+ /**
27757
+ * @uiName Reward Unit
27758
+ */
27759
+ this.rewardUnit = "Points";
27760
+ /**
27761
+ * @uiName Title Text
27762
+ */
27763
+ this.cardTitle = "Title Text";
27764
+ /**
27765
+ * @uiName Description Text
27766
+ */
27767
+ this.description = "Description Text";
27768
+ /**
27769
+ * @uiName Goal Repeatable
27770
+ */
27771
+ this.repeatable = false;
27772
+ /**
27773
+ * @uiName Show Progress Bar
27774
+ */
27775
+ this.showProgressBar = false;
27776
+ /**
27777
+ * @uiName Goal Progress Source
27778
+ */
27779
+ this.progressSource = "";
27780
+ /**
27781
+ * @uiName Goal Completion Number
27782
+ */
27783
+ this.goal = 1;
27784
+ /**
27785
+ * @uiName Progress Bar Steps
27786
+ */
27787
+ this.steps = false;
27788
+ /**
27789
+ * @uiName Show Goal Expiry
27790
+ */
27791
+ this.showExpiry = false;
27792
+ /**
27793
+ * @uiName CTA Button Text
27794
+ */
27795
+ this.buttonText = "Complete Action";
27796
+ /**
27797
+ * @uiName CTA Button Link
27798
+ */
27799
+ this.buttonLink = "https://example.com/";
27800
+ /**
27801
+ * Select what type of stat to display for the goal. Manual paths are also supported.
27802
+ *
27803
+ * @uiWidget StatTypeSelectWidget
27804
+ * @uiName Stat Type
27805
+ * @uiOptions {"version": 1.1}
27806
+ */
27807
+ this.statType = "/programGoals/count/Referral-Started%2Freferrals";
27808
+ h$1(this);
27809
+ }
27810
+ disconnectedCallback() { }
27811
+ render() {
27812
+ const { props } = j$1() ? useDemoBigStat(this) : useBigStat(this);
27813
+ const { value, statvalue } = props;
27814
+ console.log(props, j$1());
27815
+ return (h(TaskCardView, Object.assign({}, getProps(this), { progress: value, loading: value === undefined })));
27816
+ }
27817
+ };
27818
+
27245
27819
  const debug$2 = browser("sq:global");
27246
27820
  const textStyles = `
27247
27821
  sqm-text {
@@ -27367,4 +27941,4 @@ function useUserNameDemo(props) {
27367
27941
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
27368
27942
  }
27369
27943
 
27370
- 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 };
27944
+ 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 };