@saasquatch/mint-components 1.3.3-6 → 1.5.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ShadowViewAddon-d6a442a9.js → ShadowViewAddon-a85b8c8d.js} +1 -1
- package/dist/cjs/{global-b957dd98.js → global-6223fe8f.js} +1 -1
- package/dist/cjs/{index.module-85eb6b4d.js → index.module-7dd4b981.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mint-components.cjs.js +3 -3
- package/dist/cjs/{re-render-59955561.js → re-render-6111d4bd.js} +1 -1
- package/dist/cjs/sqm-asset-card.cjs.entry.js +1 -1
- package/dist/cjs/sqm-big-stat.cjs.entry.js +2 -2
- package/dist/cjs/sqm-divided-layout_30.cjs.entry.js +3995 -358
- package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-leaderboard-rank-view-9114d9ad.js → sqm-leaderboard-rank-view-7dd44d62.js} +2 -2
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard.cjs.entry.js +2 -2
- package/dist/cjs/sqm-name-fields.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-navigation-sidebar-item-view-b565a10a.js → sqm-navigation-sidebar-item-view-6c7f78e6.js} +1 -1
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +2 -2
- package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-bd40f7eb.js → sqm-portal-email-verification-view-08d1848c.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-portal-footer-view-b60e17c8.js → sqm-portal-footer-view-69c73802.js} +1 -1
- package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-logout.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-profile-view-c3b889d4.js → sqm-portal-profile-view-14b41436.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +3 -3
- package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-table-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-date-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-rewards-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-status-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table-user-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-share-code.cjs.entry.js +1 -1
- package/dist/cjs/{useDemoBigStat-9193e8c5.js → useDemoBigStat-2786227e.js} +1 -1
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +13 -18
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +106 -119
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +21 -5
- package/dist/collection/components/sqm-reward-exchange-list/assets/placeholder.png +0 -0
- package/dist/collection/components/sqm-reward-exchange-list/progressBar.js +32 -29
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +199 -89
- package/dist/collection/components/sqm-stencilbook/AutoColor.js +26 -0
- package/dist/collection/components/{sqm-task-card → sqm-stencilbook}/Matrix.js +0 -0
- package/dist/collection/components/sqm-stencilbook/Resizer.js +26 -0
- package/dist/collection/components/sqm-stencilbook/Themes.js +38 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +42 -3
- package/dist/collection/components/sqm-task-card/SVGs.js +7 -2
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +142 -4
- package/dist/collection/components/sqm-task-card/progress-bar/SVGs.js +5 -4
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +25 -6
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +74 -47
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +26 -1
- package/dist/esm/{ShadowViewAddon-2338f393.js → ShadowViewAddon-a3f510db.js} +1 -1
- package/dist/esm/{global-0e81c5e6.js → global-90da933f.js} +1 -1
- package/dist/esm/{index.module-9b5bb6a2.js → index.module-90d2c3ad.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/{re-render-57ac6584.js → re-render-e06f2f7f.js} +1 -1
- package/dist/esm/sqm-asset-card.entry.js +1 -1
- package/dist/esm/sqm-big-stat.entry.js +2 -2
- package/dist/esm/sqm-divided-layout_30.entry.js +3995 -358
- package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm/{sqm-leaderboard-rank-view-3f0dc20e.js → sqm-leaderboard-rank-view-47844836.js} +2 -2
- package/dist/esm/sqm-leaderboard-rank.entry.js +3 -3
- package/dist/esm/sqm-leaderboard.entry.js +2 -2
- package/dist/esm/sqm-name-fields.entry.js +1 -1
- package/dist/esm/{sqm-navigation-sidebar-item-view-79b0748c.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-8f253fb7.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
- package/dist/esm/{sqm-portal-footer-view-b8a2f15e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
- package/dist/esm/sqm-portal-footer.entry.js +3 -3
- package/dist/esm/sqm-portal-forgot-password.entry.js +1 -1
- package/dist/esm/sqm-portal-logout.entry.js +1 -1
- package/dist/esm/{sqm-portal-profile-view-831dea85.js → sqm-portal-profile-view-b67467b4.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +3 -3
- package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm/sqm-referral-table-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-date-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-rewards-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-status-column.entry.js +2 -2
- package/dist/esm/sqm-referral-table-user-column.entry.js +2 -2
- package/dist/esm/sqm-share-code.entry.js +1 -1
- package/dist/esm/{useDemoBigStat-660c8672.js → useDemoBigStat-c3b955b7.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-2338f393.js → ShadowViewAddon-a3f510db.js} +1 -1
- package/dist/esm-es5/{global-0e81c5e6.js → global-90da933f.js} +1 -1
- package/dist/esm-es5/{index.module-9b5bb6a2.js → index.module-90d2c3ad.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/{re-render-57ac6584.js → re-render-e06f2f7f.js} +1 -1
- package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat.entry.js +1 -1
- package/dist/esm-es5/sqm-divided-layout_30.entry.js +58 -1
- package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm-es5/{sqm-leaderboard-rank-view-3f0dc20e.js → sqm-leaderboard-rank-view-47844836.js} +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard.entry.js +1 -1
- package/dist/esm-es5/sqm-name-fields.entry.js +1 -1
- package/dist/esm-es5/{sqm-navigation-sidebar-item-view-79b0748c.js → sqm-navigation-sidebar-item-view-f2304ad9.js} +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-8f253fb7.js → sqm-portal-email-verification-view-8cefe480.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-footer-view-b8a2f15e.js → sqm-portal-footer-view-d9fe0bf8.js} +1 -1
- package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-831dea85.js → sqm-portal-profile-view-b67467b4.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-date-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-rewards-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-status-column.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table-user-column.entry.js +1 -1
- package/dist/esm-es5/sqm-share-code.entry.js +1 -1
- package/dist/esm-es5/{useDemoBigStat-660c8672.js → useDemoBigStat-c3b955b7.js} +1 -1
- package/dist/mint-components/assets/placeholder.png +0 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-be615f03.system.js → p-07c924fa.system.js} +1 -1
- package/dist/mint-components/{p-295b306a.js → p-0eb3e89c.js} +1 -1
- package/dist/mint-components/p-160bd62f.entry.js +1 -0
- package/dist/mint-components/{p-58bf2a30.system.js → p-16f5a7cb.system.js} +1 -1
- package/dist/mint-components/{p-55f029cd.system.entry.js → p-1a09e4e1.system.entry.js} +1 -1
- package/dist/mint-components/p-1c8b0290.entry.js +1 -0
- package/dist/mint-components/{p-b893904c.system.entry.js → p-1dcdca58.system.entry.js} +1 -1
- package/dist/mint-components/p-20d41ab1.entry.js +1 -0
- package/dist/mint-components/{p-a93149f4.entry.js → p-221a4097.entry.js} +1 -1
- package/dist/mint-components/{p-0a882bab.system.entry.js → p-223b42bd.system.entry.js} +1 -1
- package/dist/mint-components/{p-27bb0aa9.js → p-224504ad.js} +1 -1
- package/dist/mint-components/{p-7062ab8e.system.entry.js → p-24b3c6f0.system.entry.js} +1 -1
- package/dist/mint-components/{p-3404b8d2.system.entry.js → p-24c9a599.system.entry.js} +1 -1
- package/dist/mint-components/{p-aee2a2b9.entry.js → p-29fab29b.entry.js} +1 -1
- package/dist/mint-components/{p-ad1c6eb8.system.entry.js → p-304e6c82.system.entry.js} +1 -1
- package/dist/mint-components/{p-8f5b80f2.entry.js → p-3397167c.entry.js} +1 -1
- package/dist/mint-components/{p-62102076.entry.js → p-33c5ffb7.entry.js} +1 -1
- package/dist/mint-components/{p-98e29140.system.entry.js → p-396bf448.system.entry.js} +1 -1
- package/dist/mint-components/{p-69902f7c.system.js → p-3b97aed8.system.js} +1 -1
- package/dist/mint-components/{p-1ec1dcb3.system.js → p-3ce2fb83.system.js} +1 -1
- package/dist/mint-components/p-3d856985.entry.js +1 -0
- package/dist/mint-components/{p-1dc2793a.system.entry.js → p-4052b948.system.entry.js} +1 -1
- package/dist/mint-components/{p-46cb29e2.system.entry.js → p-412a9226.system.entry.js} +1 -1
- package/dist/mint-components/{p-75b143ac.system.entry.js → p-44d0fc80.system.entry.js} +1 -1
- package/dist/mint-components/p-45c752a0.entry.js +1 -0
- package/dist/mint-components/{p-b6107771.js → p-46a4269a.js} +1 -1
- package/dist/mint-components/{p-16b0b00b.entry.js → p-52802c88.entry.js} +2 -2
- package/dist/mint-components/p-5480e4ee.entry.js +1 -0
- package/dist/mint-components/p-55508395.system.entry.js +1 -0
- package/dist/mint-components/{p-a59e65f2.js → p-563253e8.js} +1 -1
- package/dist/mint-components/{p-58fb3d02.system.js → p-60855d33.system.js} +1 -1
- package/dist/mint-components/{p-0e49a93f.system.entry.js → p-67ae18d1.system.entry.js} +1 -1
- package/dist/mint-components/{p-8bfe1f7d.js → p-6882070c.js} +1 -1
- package/dist/mint-components/{p-cafc22bf.system.entry.js → p-69bcf4fa.system.entry.js} +1 -1
- package/dist/mint-components/{p-1dc2e37a.system.entry.js → p-6bf0a4d9.system.entry.js} +1 -1
- package/dist/mint-components/{p-b9edc48d.system.entry.js → p-6e245fa3.system.entry.js} +1 -1
- package/dist/mint-components/{p-77f9b4af.entry.js → p-723ebe45.entry.js} +1 -1
- package/dist/mint-components/{p-e53399e5.system.entry.js → p-73148868.system.entry.js} +1 -1
- package/dist/mint-components/p-8435a22d.entry.js +1 -0
- package/dist/mint-components/p-883a32e7.entry.js +1 -0
- package/dist/mint-components/p-925ccb31.system.entry.js +58 -0
- package/dist/mint-components/{p-7ee8a7ed.system.js → p-9c554ca0.system.js} +1 -1
- package/dist/mint-components/{p-75ae6fc0.entry.js → p-9d6dbb2d.entry.js} +1 -1
- package/dist/mint-components/p-9e4fee30.system.entry.js +1 -0
- package/dist/mint-components/{p-101fafa3.js → p-a2c3cff3.js} +1 -1
- package/dist/mint-components/{p-6acfe4a0.entry.js → p-a4c2c7ed.entry.js} +1 -1
- package/dist/mint-components/{p-f3ea7918.system.js → p-a6094ff9.system.js} +1 -1
- package/dist/mint-components/{p-25021e09.entry.js → p-ade44a4e.entry.js} +1 -1
- package/dist/mint-components/{p-be62004c.entry.js → p-b1bb07db.entry.js} +1 -1
- package/dist/mint-components/{p-d4fe6a69.system.js → p-b608f7a4.system.js} +1 -1
- package/dist/mint-components/{p-503192e9.entry.js → p-b8bd2607.entry.js} +1 -1
- package/dist/mint-components/{p-17e6fc02.system.entry.js → p-be2738b0.system.entry.js} +1 -1
- package/dist/mint-components/{p-b2cb66f5.system.js → p-c6114bfe.system.js} +1 -1
- package/dist/mint-components/{p-d5a00e40.system.entry.js → p-c79c608d.system.entry.js} +1 -1
- package/dist/mint-components/{p-1dd1105d.system.entry.js → p-cca9026f.system.entry.js} +1 -1
- package/dist/mint-components/p-cd410a05.entry.js +9 -0
- package/dist/mint-components/p-cdeae699.system.js +1 -0
- package/dist/mint-components/{p-232dddcc.system.entry.js → p-d174d0bc.system.entry.js} +1 -1
- package/dist/mint-components/{p-bafc60df.js → p-d21e0dbd.js} +1 -1
- package/dist/mint-components/{p-d5b84d6b.js → p-d35b0366.js} +1 -1
- package/dist/mint-components/{p-24d13567.js → p-db2e4c42.js} +1 -1
- package/dist/mint-components/{p-35103a1b.system.entry.js → p-dc603d08.system.entry.js} +1 -1
- package/dist/mint-components/{p-8a9966fc.system.js → p-e7f633b9.system.js} +1 -1
- package/dist/mint-components/p-f17050de.entry.js +1 -0
- package/dist/mint-components/{p-441119ee.js → p-f90486ca.js} +15 -15
- package/dist/mint-components/p-fce1dbf6.entry.js +1 -0
- package/dist/mint-components/p-fdb484a0.entry.js +392 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +9 -3
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +158 -36
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +0 -1
- package/dist/types/components/sqm-stencilbook/AutoColor.d.ts +1 -0
- package/dist/types/components/{sqm-task-card → sqm-stencilbook}/Matrix.d.ts +0 -0
- package/dist/types/components/sqm-stencilbook/Resizer.d.ts +3 -0
- package/dist/types/components/sqm-stencilbook/Themes.d.ts +16 -0
- package/dist/types/components/sqm-task-card/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +4 -1
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +1 -0
- package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +1 -0
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +5 -1
- package/dist/types/components.d.ts +8 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +4 -2
- package/dist/mint-components/p-024cc1be.system.entry.js +0 -1
- package/dist/mint-components/p-22d56623.entry.js +0 -9
- package/dist/mint-components/p-3098bb1b.system.entry.js +0 -1
- package/dist/mint-components/p-35ba4a8b.entry.js +0 -1
- package/dist/mint-components/p-51277d8e.system.entry.js +0 -1
- package/dist/mint-components/p-623e7f8c.entry.js +0 -335
- package/dist/mint-components/p-6410316b.entry.js +0 -1
- package/dist/mint-components/p-6cbb3a00.entry.js +0 -1
- package/dist/mint-components/p-853bd4bd.entry.js +0 -1
- package/dist/mint-components/p-85728f98.entry.js +0 -1
- package/dist/mint-components/p-8ec40f9a.entry.js +0 -1
- package/dist/mint-components/p-aa39d9c0.entry.js +0 -1
- package/dist/mint-components/p-dea06c92.entry.js +0 -1
- package/dist/mint-components/p-eb5aae94.entry.js +0 -1
- package/dist/mint-components/p-f7b80ac0.entry.js +0 -1
- package/dist/mint-components/p-f7d7e44d.system.js +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import { MatrixStory } from "
|
|
2
|
+
import { MatrixStory } from "../sqm-stencilbook/Matrix";
|
|
3
3
|
import { TaskCardView } from "./sqm-task-card-view";
|
|
4
4
|
import { ProgressBarView } from "./progress-bar/progress-bar-view";
|
|
5
5
|
import scenarioTaskCard from "./sqm-task-card.feature";
|
|
6
6
|
import scenarioProgressBar from "./progress-bar/progress-bar.feature";
|
|
7
|
+
import { DateTime } from "luxon";
|
|
8
|
+
import { Resizer } from "../sqm-stencilbook/Resizer";
|
|
7
9
|
const scenario = scenarioTaskCard + scenarioProgressBar;
|
|
8
10
|
export default {
|
|
9
11
|
title: "Components/Task Card/",
|
|
@@ -37,6 +39,7 @@ const oneAction = {
|
|
|
37
39
|
showExpiry: false,
|
|
38
40
|
rewardDuration: null,
|
|
39
41
|
loading: false,
|
|
42
|
+
finite: 0,
|
|
40
43
|
};
|
|
41
44
|
const coupleActions = {
|
|
42
45
|
rewardAmount: 40,
|
|
@@ -54,6 +57,7 @@ const coupleActions = {
|
|
|
54
57
|
showExpiry: false,
|
|
55
58
|
rewardDuration: null,
|
|
56
59
|
loading: false,
|
|
60
|
+
finite: 0,
|
|
57
61
|
};
|
|
58
62
|
const manyActions = {
|
|
59
63
|
rewardAmount: 150,
|
|
@@ -71,6 +75,49 @@ const manyActions = {
|
|
|
71
75
|
showExpiry: false,
|
|
72
76
|
rewardDuration: null,
|
|
73
77
|
loading: false,
|
|
78
|
+
finite: 0,
|
|
79
|
+
};
|
|
80
|
+
export const TaskCard = () => {
|
|
81
|
+
const expire = {
|
|
82
|
+
showExpiry: true,
|
|
83
|
+
rewardDuration: "2021-11-30T08:00:00.000Z/2021-12-01T08:00:00.000Z",
|
|
84
|
+
};
|
|
85
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
86
|
+
return (h("div", { style: storyFrame },
|
|
87
|
+
h(Resizer, null,
|
|
88
|
+
h("h4", null, "Not Repeatable"),
|
|
89
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
90
|
+
" ",
|
|
91
|
+
h("h5", null),
|
|
92
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
93
|
+
" ",
|
|
94
|
+
h("h5", null),
|
|
95
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 }))),
|
|
96
|
+
h(Resizer, null,
|
|
97
|
+
h("h4", null, "Repeatable"),
|
|
98
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 2, repeatable: true })),
|
|
99
|
+
" ",
|
|
100
|
+
h("h5", null),
|
|
101
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7, repeatable: true })),
|
|
102
|
+
h("h5", null),
|
|
103
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true }))),
|
|
104
|
+
h(Resizer, null,
|
|
105
|
+
h("h4", null, "Complete"),
|
|
106
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
107
|
+
" ",
|
|
108
|
+
h("h5", null),
|
|
109
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
110
|
+
" ",
|
|
111
|
+
h("h5", null),
|
|
112
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }))),
|
|
113
|
+
h(Resizer, null,
|
|
114
|
+
h("h4", null, "Unavailable"),
|
|
115
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
|
|
116
|
+
" ",
|
|
117
|
+
h("h5", null),
|
|
118
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 3 }, expireRepeat)),
|
|
119
|
+
h("h5", null),
|
|
120
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 250 }, expireRepeat)))));
|
|
74
121
|
};
|
|
75
122
|
export const TaskCardNotRepeatable = () => {
|
|
76
123
|
return (h("div", { style: storyFrame },
|
|
@@ -130,10 +177,51 @@ export const TaskCardRepeatable = () => {
|
|
|
130
177
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true })),
|
|
131
178
|
h("h5", null))));
|
|
132
179
|
};
|
|
180
|
+
export const TaskCardRepeatableFinite = () => {
|
|
181
|
+
return (h("div", { style: storyFrame },
|
|
182
|
+
h("div", { style: resizable },
|
|
183
|
+
h("h4", null, "One Action"),
|
|
184
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0, repeatable: true, finite: 2 })),
|
|
185
|
+
" ",
|
|
186
|
+
h("h5", null),
|
|
187
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1, repeatable: true, finite: 2 })),
|
|
188
|
+
" ",
|
|
189
|
+
h("h5", null),
|
|
190
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 2, repeatable: true, finite: 2 })),
|
|
191
|
+
" ",
|
|
192
|
+
h("h5", null)),
|
|
193
|
+
h("div", { style: resizable },
|
|
194
|
+
h("h4", null, "A Couple Actions"),
|
|
195
|
+
h("h5", null)),
|
|
196
|
+
h("div", { style: resizable },
|
|
197
|
+
h("h4", null, "Many Actions"),
|
|
198
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100, repeatable: true, finite: 2 })),
|
|
199
|
+
h("h5", null),
|
|
200
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500, repeatable: true, finite: 2 })),
|
|
201
|
+
h("h5", null),
|
|
202
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true, finite: 2 })),
|
|
203
|
+
h("h5", null),
|
|
204
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 950, repeatable: true, finite: 2 })),
|
|
205
|
+
h("h5", null),
|
|
206
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true, finite: 2 })),
|
|
207
|
+
h("h5", null),
|
|
208
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1300, repeatable: true, finite: 3 })),
|
|
209
|
+
h("h5", null),
|
|
210
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1500, repeatable: true, finite: 3 })),
|
|
211
|
+
h("h5", null),
|
|
212
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 2500, repeatable: true, finite: 3 })),
|
|
213
|
+
h("h5", null),
|
|
214
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 2500, repeatable: true, finite: 4 })),
|
|
215
|
+
h("h5", null),
|
|
216
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 2500, repeatable: true, finite: 5 })),
|
|
217
|
+
h("h5", null))));
|
|
218
|
+
};
|
|
133
219
|
export const TaskCardEndDate = () => {
|
|
134
220
|
const expire = {
|
|
135
221
|
showExpiry: true,
|
|
136
|
-
rewardDuration:
|
|
222
|
+
rewardDuration: DateTime.now().minus({ days: 1 }).toISO() +
|
|
223
|
+
"/" +
|
|
224
|
+
DateTime.now().plus({ days: 1 }).toISO(),
|
|
137
225
|
};
|
|
138
226
|
const expireRepeat = { ...expire, repeatable: true };
|
|
139
227
|
return (h("div", { style: storyFrame },
|
|
@@ -190,10 +278,60 @@ export const TaskCardLoading = () => {
|
|
|
190
278
|
" ",
|
|
191
279
|
h("h5", null))));
|
|
192
280
|
};
|
|
193
|
-
export const
|
|
281
|
+
export const TaskCardNotStarted = () => {
|
|
194
282
|
const expire = {
|
|
195
283
|
showExpiry: true,
|
|
196
|
-
rewardDuration:
|
|
284
|
+
rewardDuration: DateTime.now().plus({ days: 1 }).toISO() +
|
|
285
|
+
"/" +
|
|
286
|
+
DateTime.now().plus({ days: 2 }).toISO(),
|
|
287
|
+
};
|
|
288
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
289
|
+
return (h("div", { style: storyFrame },
|
|
290
|
+
h("div", { style: resizable },
|
|
291
|
+
h("h4", null, "One Action"),
|
|
292
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expire)),
|
|
293
|
+
" ",
|
|
294
|
+
h("h5", null),
|
|
295
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expire)),
|
|
296
|
+
" ",
|
|
297
|
+
h("h5", null),
|
|
298
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
|
|
299
|
+
" ",
|
|
300
|
+
h("h5", null),
|
|
301
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expireRepeat)),
|
|
302
|
+
" ",
|
|
303
|
+
h("h5", null)),
|
|
304
|
+
h("div", { style: resizable },
|
|
305
|
+
h("h4", null, "A Couple Actions"),
|
|
306
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expire)),
|
|
307
|
+
" ",
|
|
308
|
+
h("h5", null),
|
|
309
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expire)),
|
|
310
|
+
" ",
|
|
311
|
+
h("h5", null),
|
|
312
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expireRepeat)),
|
|
313
|
+
h("h5", null),
|
|
314
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expireRepeat)),
|
|
315
|
+
h("h5", null)),
|
|
316
|
+
h("div", { style: resizable },
|
|
317
|
+
h("h4", null, "Many Actions"),
|
|
318
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expire)),
|
|
319
|
+
" ",
|
|
320
|
+
h("h5", null),
|
|
321
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expire)),
|
|
322
|
+
" ",
|
|
323
|
+
h("h5", null),
|
|
324
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expireRepeat)),
|
|
325
|
+
h("h5", null),
|
|
326
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expireRepeat)),
|
|
327
|
+
h("h5", null))));
|
|
328
|
+
};
|
|
329
|
+
export const TaskCardEnded = () => {
|
|
330
|
+
const expire = {
|
|
331
|
+
showExpiry: true,
|
|
332
|
+
rewardDuration: DateTime.now().minus({ days: 2 }).toISO() +
|
|
333
|
+
"/" +
|
|
334
|
+
DateTime.now().minus({ days: 1 }).toISO(),
|
|
197
335
|
};
|
|
198
336
|
const expireRepeat = { ...expire, repeatable: true };
|
|
199
337
|
return (h("div", { style: storyFrame },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const gift = () => {
|
|
3
|
-
return (h("svg", { width: 16, height: 16, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
4
|
-
h("path", { d: "M15
|
|
5
|
-
h("path", {
|
|
6
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "
|
|
3
|
+
return (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
4
|
+
h("path", { d: "M15 5H12.4508H9V16H13.5C14.0523 16 14.5 15.5523 14.5 15V9H15C15.5523 9 16 8.55228 16 8V6C16 5.44772 15.5523 5 15 5Z", fill: "#F2C94C" }),
|
|
5
|
+
h("path", { d: "M1.5 9V15C1.5 15.5523 1.94772 16 2.5 16H7V5H4.64242H1C0.447715 5 0 5.44772 0 6V8C0 8.55228 0.447715 9 1 9H1.5Z", fill: "#F2C94C" }),
|
|
6
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9V10H14.5V9H1.5Z", fill: "#BE9720" }),
|
|
7
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M14 2.70949C14 3.59565 12.6694 4.93746 12 5H9V16H7.00179V5H4.58792C3.21247 4.70182 2 3.64537 2 2.52072C2 1.42474 2.47603 0.556701 3.34184 0.182041C4.16921 -0.175986 5.12452 0.0203328 5.87976 0.544666C6.80676 1.18825 7.32679 2.3963 7.79856 3.49226C7.83996 3.58845 7.88099 3.68378 7.9219 3.77778C7.96173 3.68865 8.00186 3.59793 8.0425 3.50608C8.50995 2.44948 9.04359 1.24325 9.9404 0.59563C10.7332 0.0231438 11.741 -0.193157 12.6121 0.198945C13.5129 0.604397 14 1.53453 14 2.70949ZM10.6123 1.5C11.0928 1.15305 11.668 1.09012 12.1597 1.5C12.5879 1.85694 12.6108 2.02497 12.6658 2.42926L12.6755 2.5C12.6755 3.09851 12.1597 4 11.6439 4C11.2785 4 10.9914 3.99691 10.7224 3.99402C10.2319 3.98875 9.80131 3.98412 9.06496 4C9.20533 3.72786 9.31743 3.46669 9.42434 3.21761C9.71026 2.55143 9.95907 1.97176 10.6123 1.5ZM4.93861 1.5C4.70607 1.33855 4.17281 1.4106 3.95166 1.5063C3.76894 1.58537 3.49602 1.82658 3.49602 2.52072C3.49602 3.19524 4.58792 3.77778 4.58792 3.77778C4.58792 3.77778 5.45441 4 7.00179 4C6.47506 2.69451 5.7289 2.04867 4.93861 1.5Z", fill: "#EB5757" })));
|
|
7
8
|
};
|
|
@@ -3,14 +3,13 @@ import jss from "jss";
|
|
|
3
3
|
import preset from "jss-preset-default";
|
|
4
4
|
import * as SVGs from "./SVGs";
|
|
5
5
|
export function ProgressBarView(props) {
|
|
6
|
-
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, expired = false, } = props;
|
|
7
|
-
console.log("progress bar props", props);
|
|
6
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, expired = false, finite = 0, } = props;
|
|
7
|
+
// console.log("progress bar props", props);
|
|
8
8
|
const gift1 = SVGs.gift();
|
|
9
9
|
const gift2 = SVGs.gift();
|
|
10
10
|
const gift3 = SVGs.gift();
|
|
11
11
|
var items = [];
|
|
12
12
|
var columns = "";
|
|
13
|
-
var repetitions = Math.floor(progress / goal);
|
|
14
13
|
if (repeatable) {
|
|
15
14
|
if (steps) {
|
|
16
15
|
addStepsRepeatable();
|
|
@@ -31,12 +30,12 @@ export function ProgressBarView(props) {
|
|
|
31
30
|
const style = {
|
|
32
31
|
ProgressBar: {
|
|
33
32
|
"& .progress-bar": {
|
|
34
|
-
height: "
|
|
33
|
+
height: "0",
|
|
35
34
|
marginTop: steps
|
|
36
35
|
? "var(--sl-spacing-medium)"
|
|
37
36
|
: "var(--sl-spacing-large)",
|
|
38
37
|
filter: expired ? "grayscale(1)" : "",
|
|
39
|
-
marginBottom: "var(--sl-spacing-
|
|
38
|
+
marginBottom: "var(--sl-spacing-xxx-large)",
|
|
40
39
|
marginRight: "var(--sl-spacing-x-small)",
|
|
41
40
|
fontSize: "var(--sl-font-size-x-small)",
|
|
42
41
|
display: "grid",
|
|
@@ -141,7 +140,10 @@ export function ProgressBarView(props) {
|
|
|
141
140
|
const styleString = sheet.toString();
|
|
142
141
|
return (h("div", { class: sheet.classes.ProgressBar },
|
|
143
142
|
h("style", { type: "text/css" }, styleString),
|
|
144
|
-
h("div", { class:
|
|
143
|
+
h("div", { class: (!Boolean(finite) && progress >= 2 * goal) ||
|
|
144
|
+
(Boolean(finite) && progress > 2 * goal)
|
|
145
|
+
? "progress-bar repeatable-steps"
|
|
146
|
+
: "progress-bar" }, items)));
|
|
145
147
|
function clamp(x, min, max) {
|
|
146
148
|
return Math.min(Math.max(x, min), max);
|
|
147
149
|
}
|
|
@@ -214,6 +216,23 @@ export function ProgressBarView(props) {
|
|
|
214
216
|
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * 2));
|
|
215
217
|
items.push(h("div", { class: "gift bw" }, gift2));
|
|
216
218
|
}
|
|
219
|
+
// finite repetition hit
|
|
220
|
+
else if (finite && repetitions >= finite) {
|
|
221
|
+
if (repetitions > 2) {
|
|
222
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (finite - 2)));
|
|
223
|
+
items.push(h("div", { class: "gift start" }, gift1));
|
|
224
|
+
columns = "0fr 0fr 0.5fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
columns = "0.5fr 0fr 0fr 0.5fr 0fr 0fr";
|
|
228
|
+
}
|
|
229
|
+
items.push(h("div", { class: "filled" }));
|
|
230
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * (finite - 1)));
|
|
231
|
+
items.push(h("div", { class: "gift" }, gift2));
|
|
232
|
+
items.push(h("div", { class: "filled" }));
|
|
233
|
+
items.push(h("div", { class: "progress bg" }, progressBarUnit + goal * finite));
|
|
234
|
+
items.push(h("div", { class: "gift" }, gift3));
|
|
235
|
+
}
|
|
217
236
|
// multiple repetitions
|
|
218
237
|
else {
|
|
219
238
|
columns =
|
|
@@ -6,29 +6,27 @@ import * as SVGs from "./SVGs";
|
|
|
6
6
|
import { ProgressBarView, } from "./progress-bar/progress-bar-view";
|
|
7
7
|
import { DateTime } from "luxon";
|
|
8
8
|
export function TaskCardView(props) {
|
|
9
|
-
console.log({ props });
|
|
9
|
+
// console.log({ props });
|
|
10
10
|
const checkmark_circle = SVGs.checkmark_circle();
|
|
11
|
+
const checkmark_filled = SVGs.checkmark_filled();
|
|
11
12
|
const arrow_left_right = SVGs.arrow_left_right();
|
|
12
13
|
const style = {
|
|
13
14
|
HostBlock: HostBlock,
|
|
14
15
|
TaskCard: {
|
|
15
|
-
"& .main > div": {
|
|
16
|
-
margin: "var(--sl-spacing-medium)",
|
|
17
|
-
},
|
|
18
16
|
"& .main": {
|
|
19
17
|
position: "relative",
|
|
20
18
|
boxSizing: "border-box",
|
|
21
19
|
minWidth: "347px",
|
|
22
20
|
background: "var(--sl-color-neutral-0)",
|
|
23
|
-
border: "1px solid var(--sl-color-neutral-
|
|
24
|
-
borderRadius: "var(--sl-border-radius-
|
|
21
|
+
border: "1px solid var(--sl-color-neutral-200)",
|
|
22
|
+
borderRadius: "var(--sl-border-radius-large)",
|
|
25
23
|
fontSize: "var(--sl-font-size-small)",
|
|
26
24
|
lineHeight: "var(--sl-line-height-dense)",
|
|
27
25
|
color: "var(--sl-color-neutral-600)",
|
|
28
26
|
},
|
|
29
27
|
"& .main.complete": {
|
|
30
|
-
background: "var(--sl-color-
|
|
31
|
-
borderColor: "var(--sl-color-
|
|
28
|
+
background: "var(--sl-color-primary-50)",
|
|
29
|
+
borderColor: "var(--sl-color-primary-500)",
|
|
32
30
|
},
|
|
33
31
|
"& .main.expired": {
|
|
34
32
|
color: "var(--sl-color-neutral-400)",
|
|
@@ -37,17 +35,30 @@ export function TaskCardView(props) {
|
|
|
37
35
|
"& .title": {
|
|
38
36
|
fontSize: "var(--sl-font-size-small)",
|
|
39
37
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
38
|
+
color: "var(--sl-color-neutral-950)",
|
|
39
|
+
},
|
|
40
|
+
"& .container": {
|
|
41
|
+
margin: "var(--sl-spacing-medium)",
|
|
40
42
|
},
|
|
41
|
-
"& .
|
|
42
|
-
|
|
43
|
+
"& .container.subdued": {
|
|
44
|
+
opacity: "0.66",
|
|
43
45
|
},
|
|
46
|
+
"& .container > div": {
|
|
47
|
+
margin: "var(--sl-spacing-medium) 0",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
Expired: {
|
|
51
|
+
margin: "var(--sl-spacing-medium)",
|
|
52
|
+
marginBottom: "calc(var(--sl-spacing-x-small)*-1)",
|
|
53
|
+
color: "var(--sl-color-warning-500)",
|
|
54
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
44
55
|
},
|
|
45
56
|
Header: {
|
|
46
57
|
display: "flex",
|
|
47
58
|
"& .icon": {
|
|
48
59
|
alignSelf: "center",
|
|
49
60
|
lineHeight: "0",
|
|
50
|
-
color: "var(--sl-color-
|
|
61
|
+
color: "var(--sl-color-primary-400)",
|
|
51
62
|
fontSize: "var(--sl-font-size-large)",
|
|
52
63
|
marginRight: "var(--sl-spacing-x-small)",
|
|
53
64
|
},
|
|
@@ -55,6 +66,7 @@ export function TaskCardView(props) {
|
|
|
55
66
|
alignSelf: "center",
|
|
56
67
|
fontSize: "var(--sl-font-size-x-large)",
|
|
57
68
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
69
|
+
color: "var(--sl-color-neutral-950)",
|
|
58
70
|
lineHeight: "100%",
|
|
59
71
|
marginRight: "var(--sl-spacing-xx-small)",
|
|
60
72
|
},
|
|
@@ -62,6 +74,7 @@ export function TaskCardView(props) {
|
|
|
62
74
|
alignSelf: "end",
|
|
63
75
|
textTransform: "uppercase",
|
|
64
76
|
fontSize: "var(--sl-font-size-x-small)",
|
|
77
|
+
color: "var(--sl-color-neutral-950)",
|
|
65
78
|
lineHeight: "var(--sl-font-size-medium)",
|
|
66
79
|
marginRight: "var(--sl-spacing-xx-small)",
|
|
67
80
|
},
|
|
@@ -70,9 +83,6 @@ export function TaskCardView(props) {
|
|
|
70
83
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
71
84
|
marginBottom: "var(--sl-spacing-xx-small)",
|
|
72
85
|
},
|
|
73
|
-
"& .black": {
|
|
74
|
-
color: "var(--sl-color-neutral-1000)",
|
|
75
|
-
},
|
|
76
86
|
"& .neutral": {
|
|
77
87
|
color: "var(--sl-color-neutral-400)",
|
|
78
88
|
},
|
|
@@ -82,6 +92,7 @@ export function TaskCardView(props) {
|
|
|
82
92
|
"& .icon": {
|
|
83
93
|
fontSize: "var(--sl-font-size-xx-small)",
|
|
84
94
|
marginRight: "var(--sl-spacing-xx-small)",
|
|
95
|
+
verticalAlign: "bottom",
|
|
85
96
|
},
|
|
86
97
|
"& .text": {
|
|
87
98
|
marginTop: "auto",
|
|
@@ -89,7 +100,7 @@ export function TaskCardView(props) {
|
|
|
89
100
|
fontSize: "var(--sl-font-size-x-small)",
|
|
90
101
|
},
|
|
91
102
|
"& .success": {
|
|
92
|
-
color: "var(--sl-color-
|
|
103
|
+
color: "var(--sl-color-primary-500)",
|
|
93
104
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
94
105
|
},
|
|
95
106
|
"& .action": {
|
|
@@ -100,6 +111,10 @@ export function TaskCardView(props) {
|
|
|
100
111
|
borderRadius: "var(--sl-border-radius-medium)",
|
|
101
112
|
},
|
|
102
113
|
"&.disabled::part(base)": {
|
|
114
|
+
border: "1px solid var(--sl-color-primary-400)",
|
|
115
|
+
background: "var(--sl-color-primary-400)",
|
|
116
|
+
},
|
|
117
|
+
"&.neutral::part(base)": {
|
|
103
118
|
border: "1px solid var(--sl-color-neutral-400)",
|
|
104
119
|
background: "var(--sl-color-neutral-400)",
|
|
105
120
|
},
|
|
@@ -119,8 +134,11 @@ export function TaskCardView(props) {
|
|
|
119
134
|
const dateStart = props.showExpiry && DateTime.fromISO(props.rewardDuration.split("/")[0]);
|
|
120
135
|
const dateEnd = props.showExpiry && DateTime.fromISO(props.rewardDuration.split("/")[1]);
|
|
121
136
|
const dateToday = DateTime.now();
|
|
122
|
-
const taskComplete = showComplete && props.repeatable === false
|
|
123
|
-
|
|
137
|
+
const taskComplete = (showComplete && props.repeatable === false) ||
|
|
138
|
+
(props.finite && props.progress >= props.finite * props.goal);
|
|
139
|
+
const taskEnded = props.showExpiry && dateEnd <= dateToday;
|
|
140
|
+
const taskNotStarted = props.showExpiry && dateToday <= dateStart;
|
|
141
|
+
const taskUnavailable = taskEnded || taskNotStarted;
|
|
124
142
|
return (h("div", { class: sheet.classes.TaskCard },
|
|
125
143
|
h("div", { class: taskUnavailable
|
|
126
144
|
? "main expired"
|
|
@@ -128,34 +146,43 @@ export function TaskCardView(props) {
|
|
|
128
146
|
? "main complete"
|
|
129
147
|
: "main" },
|
|
130
148
|
h("style", { type: "text/css" }, styleString),
|
|
131
|
-
h("div", { class: sheet.classes.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
taskUnavailable && (h("div", { class: sheet.classes.Expired }, taskEnded
|
|
150
|
+
? "Ended " + dateEnd.toLocaleString(DateTime.DATE_MED)
|
|
151
|
+
: "Starts " + dateStart.toLocaleString(DateTime.DATE_MED))),
|
|
152
|
+
h("div", { class: taskComplete || taskUnavailable ? "container subdued" : "container" },
|
|
153
|
+
h("div", { class: sheet.classes.Header }, props.loading ? (h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (h("div", null,
|
|
154
|
+
showComplete && (h("span", { class: taskUnavailable ? "icon neutral" : "icon" }, taskComplete ? checkmark_filled : checkmark_circle)),
|
|
155
|
+
h("span", { class: taskUnavailable ? "value black" : "value black" }, props.rewardAmount),
|
|
156
|
+
h("span", { class: "text" }, props.rewardUnit)))),
|
|
157
|
+
props.loading ? (h("sl-skeleton", { style: { width: "42%", margin: "var(--sl-spacing-medium) 0" } })) : (h("div", { class: taskUnavailable ? "title black" : "title black" }, props.cardTitle)),
|
|
158
|
+
props.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (h(Details, Object.assign({}, props))),
|
|
159
|
+
props.showProgressBar && props.loading ? (h("sl-skeleton", { style: { margin: "var(--sl-spacing-medium) 0" } })) : (props.showProgressBar && (h(ProgressBarView, Object.assign({}, props, { complete: taskComplete, expired: taskUnavailable })))),
|
|
160
|
+
h("div", { class: sheet.classes.Footer }, props.loading ? (h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (h("div", { style: { display: "contents" } },
|
|
161
|
+
h("span", { class: "text" },
|
|
162
|
+
props.repeatable && (h("div", null,
|
|
163
|
+
h("span", { class: repetitions > 0
|
|
164
|
+
? taskUnavailable
|
|
165
|
+
? "icon neutral"
|
|
166
|
+
: "icon success"
|
|
167
|
+
: "icon" }, arrow_left_right),
|
|
168
|
+
h("span", { class: repetitions > 0
|
|
169
|
+
? taskUnavailable
|
|
170
|
+
? "neutral"
|
|
171
|
+
: "success"
|
|
172
|
+
: "" }, "Completed " +
|
|
173
|
+
(props.finite
|
|
174
|
+
? Math.min(repetitions, props.finite)
|
|
175
|
+
: repetitions) +
|
|
176
|
+
(props.finite ? "/" + props.finite : "") +
|
|
177
|
+
" times"))),
|
|
178
|
+
props.showExpiry && !taskUnavailable && (h("span", null, "Ends " + dateEnd.toLocaleString(DateTime.DATE_FULL)))),
|
|
179
|
+
h("sl-button", { class: taskUnavailable
|
|
180
|
+
? "action neutral"
|
|
181
|
+
: taskComplete
|
|
182
|
+
? "action disabled"
|
|
183
|
+
: "action", type: "primary", size: "small", onClick: () => props.openNewTab
|
|
184
|
+
? window.open(props.buttonLink)
|
|
185
|
+
: window.open(props.buttonLink, "_parent"), disabled: taskComplete || taskUnavailable }, props.buttonText))))))));
|
|
159
186
|
}
|
|
160
187
|
function Details(props) {
|
|
161
188
|
const style = {
|
|
@@ -182,10 +209,10 @@ function Details(props) {
|
|
|
182
209
|
transition: "all var(--sl-transition-medium) ease",
|
|
183
210
|
maxHeight: "300px",
|
|
184
211
|
marginBottom: props.steps
|
|
185
|
-
? "var(--sl-spacing-large)"
|
|
212
|
+
? "var(--sl-spacing-x-large)"
|
|
186
213
|
: props.showProgressBar
|
|
187
214
|
? "var(--sl-spacing-xx-large)"
|
|
188
|
-
: "var(--sl-spacing-large)",
|
|
215
|
+
: "var(--sl-spacing-x-large)",
|
|
189
216
|
},
|
|
190
217
|
"& .summary": {
|
|
191
218
|
display: "block",
|
|
@@ -7,7 +7,7 @@ import { useDemoBigStat } from "../sqm-big-stat/useDemoBigStat";
|
|
|
7
7
|
import { TaskCardView } from "./sqm-task-card-view";
|
|
8
8
|
/**
|
|
9
9
|
* @uiName Task Card
|
|
10
|
-
* @uiOrder ["reward-amount", "reward-unit", "card-title", "description", "repeatable", "show-progress-bar", "stat-type", "progress-source", "goal", "steps", "progress-bar-unit", "show-expiry", "reward-duration", "button-text", "button-link", "open-new-tab"]
|
|
10
|
+
* @uiOrder ["reward-amount", "reward-unit", "card-title", "description", "repeatable", "finite", "show-progress-bar", "stat-type", "progress-source", "goal", "steps", "progress-bar-unit", "show-expiry", "reward-duration", "button-text", "button-link", "open-new-tab"]
|
|
11
11
|
*/
|
|
12
12
|
export class TaskCard {
|
|
13
13
|
constructor() {
|
|
@@ -32,6 +32,10 @@ export class TaskCard {
|
|
|
32
32
|
* @uiName Goal Repeatable
|
|
33
33
|
*/
|
|
34
34
|
this.repeatable = false;
|
|
35
|
+
/**
|
|
36
|
+
* @uiName Repeat Amount (0 for no limit)
|
|
37
|
+
*/
|
|
38
|
+
this.finite = 0;
|
|
35
39
|
/**
|
|
36
40
|
* @uiName Show Progress Bar
|
|
37
41
|
*/
|
|
@@ -191,6 +195,27 @@ export class TaskCard {
|
|
|
191
195
|
"reflect": false,
|
|
192
196
|
"defaultValue": "false"
|
|
193
197
|
},
|
|
198
|
+
"finite": {
|
|
199
|
+
"type": "number",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "number",
|
|
203
|
+
"resolved": "number",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": false,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [{
|
|
210
|
+
"text": "Repeat Amount (0 for no limit)",
|
|
211
|
+
"name": "uiName"
|
|
212
|
+
}],
|
|
213
|
+
"text": ""
|
|
214
|
+
},
|
|
215
|
+
"attribute": "finite",
|
|
216
|
+
"reflect": false,
|
|
217
|
+
"defaultValue": "0"
|
|
218
|
+
},
|
|
194
219
|
"showProgressBar": {
|
|
195
220
|
"type": "boolean",
|
|
196
221
|
"mutable": false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getAugmentedNamespace, c as createCommonjsModule, a as commonjsGlobal, b as browser, l as l$1 } from './extends-3a3f9fe2.js';
|
|
2
|
-
import { s as src, m as memoize, S } from './index.module-
|
|
2
|
+
import { s as src, m as memoize, S } from './index.module-90d2c3ad.js';
|
|
3
3
|
|
|
4
4
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
5
5
|
__assign = Object.assign || function(t) {
|