@saasquatch/mint-components 1.3.2-12 → 1.3.2-13
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/sqm-divided-layout_30.cjs.entry.js +348 -430
- package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +2 -2
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +30 -30
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +4 -7
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +7 -31
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +167 -222
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +12 -5
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +82 -50
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +10 -2
- package/dist/esm/sqm-divided-layout_30.entry.js +348 -430
- package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-16f5a7cb.system.js +1 -1
- package/dist/mint-components/{p-d2e71fe0.entry.js → p-3f7218fb.entry.js} +10 -10
- package/dist/mint-components/p-b6b4022a.system.entry.js +1 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +2 -2
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +2 -2
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +9 -4
- 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 -1
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +2 -1
- package/dist/types/components.d.ts +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +0 -53
- package/dist/mint-components/p-b47179b8.system.entry.js +0 -1
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +0 -12
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { MatrixStory } from "./Matrix";
|
|
2
3
|
import { TaskCardView } from "./sqm-task-card-view";
|
|
3
|
-
import
|
|
4
|
+
import { ProgressBarView } from "./progress-bar/progress-bar-view";
|
|
5
|
+
import scenarioTaskCard from "./sqm-task-card.feature";
|
|
6
|
+
import scenarioProgressBar from "./progress-bar/progress-bar.feature";
|
|
7
|
+
const scenario = scenarioTaskCard + scenarioProgressBar;
|
|
4
8
|
export default {
|
|
5
9
|
title: "Components/Task Card/",
|
|
6
10
|
parameters: {
|
|
7
11
|
scenario,
|
|
8
12
|
},
|
|
9
13
|
};
|
|
14
|
+
const storyFrame = {
|
|
15
|
+
display: "inline-flex",
|
|
16
|
+
gap: "32px",
|
|
17
|
+
};
|
|
10
18
|
const resizable = {
|
|
11
19
|
width: "347px",
|
|
12
20
|
minWidth: "347px",
|
|
@@ -14,49 +22,55 @@ const resizable = {
|
|
|
14
22
|
height: "fit-content",
|
|
15
23
|
overflow: "hidden",
|
|
16
24
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
25
|
+
const oneAction = {
|
|
26
|
+
rewardAmount: 20,
|
|
27
|
+
rewardUnit: "Points",
|
|
28
|
+
cardTitle: "Complete a survey",
|
|
29
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
30
|
+
repeatable: false,
|
|
31
|
+
showProgressBar: false,
|
|
32
|
+
progress: 0,
|
|
33
|
+
goal: 1,
|
|
34
|
+
buttonText: "Take survey",
|
|
35
|
+
buttonLink: "https://example.com/",
|
|
36
|
+
showExpiry: false,
|
|
37
|
+
dateExpires: null,
|
|
38
|
+
loading: false,
|
|
39
|
+
};
|
|
40
|
+
const coupleActions = {
|
|
41
|
+
rewardAmount: 40,
|
|
42
|
+
rewardUnit: "Points",
|
|
43
|
+
cardTitle: "Comment on 5 articles",
|
|
44
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
45
|
+
repeatable: false,
|
|
46
|
+
showProgressBar: true,
|
|
47
|
+
steps: true,
|
|
48
|
+
progress: 1,
|
|
49
|
+
goal: 5,
|
|
50
|
+
buttonText: "Take survey",
|
|
51
|
+
buttonLink: "https://example.com/",
|
|
52
|
+
showExpiry: false,
|
|
53
|
+
dateExpires: null,
|
|
54
|
+
loading: false,
|
|
55
|
+
};
|
|
56
|
+
const manyActions = {
|
|
57
|
+
rewardAmount: 150,
|
|
58
|
+
rewardUnit: "Points",
|
|
59
|
+
cardTitle: "Spend $500 at our Store",
|
|
60
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
61
|
+
repeatable: false,
|
|
62
|
+
showProgressBar: true,
|
|
63
|
+
progress: 100,
|
|
64
|
+
goal: 500,
|
|
65
|
+
progressBarUnit: "$",
|
|
66
|
+
buttonText: "Take survey",
|
|
67
|
+
buttonLink: "https://example.com/",
|
|
68
|
+
showExpiry: false,
|
|
69
|
+
dateExpires: null,
|
|
70
|
+
loading: false,
|
|
71
|
+
};
|
|
72
|
+
export const TaskCardNotRepeatable = () => {
|
|
73
|
+
return (h("div", { style: storyFrame },
|
|
60
74
|
h("div", { style: resizable },
|
|
61
75
|
h("h4", null, "One Action"),
|
|
62
76
|
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
@@ -67,9 +81,6 @@ export const NotRepeatable = () => {
|
|
|
67
81
|
h("h5", null)),
|
|
68
82
|
h("div", { style: resizable },
|
|
69
83
|
h("h4", null, "A Couple Actions"),
|
|
70
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
71
|
-
" ",
|
|
72
|
-
h("h5", null),
|
|
73
84
|
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
74
85
|
" ",
|
|
75
86
|
h("h5", null),
|
|
@@ -78,9 +89,6 @@ export const NotRepeatable = () => {
|
|
|
78
89
|
h("h5", null)),
|
|
79
90
|
h("div", { style: resizable },
|
|
80
91
|
h("h4", null, "Many Actions"),
|
|
81
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
82
|
-
" ",
|
|
83
|
-
h("h5", null),
|
|
84
92
|
h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
85
93
|
" ",
|
|
86
94
|
h("h5", null),
|
|
@@ -88,243 +96,180 @@ export const NotRepeatable = () => {
|
|
|
88
96
|
" ",
|
|
89
97
|
h("h5", null))));
|
|
90
98
|
};
|
|
91
|
-
export const
|
|
92
|
-
|
|
93
|
-
rewardAmount: 20,
|
|
94
|
-
rewardUnit: "Points",
|
|
95
|
-
cardTitle: "Complete a survey",
|
|
96
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
97
|
-
buttonText: "Take survey",
|
|
98
|
-
goal: 1,
|
|
99
|
-
showExpiry: true,
|
|
100
|
-
repeatable: false,
|
|
101
|
-
dateExpires: "Nov 1, 2021",
|
|
102
|
-
buttonLink: "https://example.com/",
|
|
103
|
-
showProgressBar: false,
|
|
104
|
-
loading: false,
|
|
105
|
-
};
|
|
106
|
-
const coupleActions = {
|
|
107
|
-
rewardAmount: 40,
|
|
108
|
-
rewardUnit: "Points",
|
|
109
|
-
cardTitle: "Comment on 5 articles",
|
|
110
|
-
showProgressBar: true,
|
|
111
|
-
goal: 5,
|
|
112
|
-
steps: true,
|
|
113
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
114
|
-
buttonText: "Start reading",
|
|
115
|
-
showExpiry: true,
|
|
116
|
-
repeatable: false,
|
|
117
|
-
dateExpires: "Nov 1, 2021",
|
|
118
|
-
buttonLink: "https://example.com/",
|
|
119
|
-
loading: false,
|
|
120
|
-
};
|
|
121
|
-
const manyActions = {
|
|
122
|
-
rewardAmount: 150,
|
|
123
|
-
rewardUnit: "Points",
|
|
124
|
-
repeatable: false,
|
|
125
|
-
cardTitle: "Spend $500 at our Store",
|
|
126
|
-
showProgressBar: true,
|
|
127
|
-
goal: 500,
|
|
128
|
-
progressBarUnit: "$",
|
|
129
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
130
|
-
buttonText: "Visit our Store",
|
|
131
|
-
showExpiry: true,
|
|
132
|
-
dateExpires: "Nov 1, 2021",
|
|
133
|
-
buttonLink: "https://example.com/",
|
|
134
|
-
loading: false,
|
|
135
|
-
};
|
|
136
|
-
return (h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
99
|
+
export const TaskCardRepeatable = () => {
|
|
100
|
+
return (h("div", { style: storyFrame },
|
|
137
101
|
h("div", { style: resizable },
|
|
138
102
|
h("h4", null, "One Action"),
|
|
139
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
103
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0, repeatable: true })),
|
|
140
104
|
" ",
|
|
141
105
|
h("h5", null),
|
|
142
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
106
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1, repeatable: true })),
|
|
143
107
|
" ",
|
|
144
108
|
h("h5", null)),
|
|
145
109
|
h("div", { style: resizable },
|
|
146
110
|
h("h4", null, "A Couple Actions"),
|
|
147
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
148
|
-
" ",
|
|
111
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1, repeatable: true })),
|
|
149
112
|
h("h5", null),
|
|
150
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
151
|
-
" ",
|
|
113
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5, repeatable: true })),
|
|
152
114
|
h("h5", null),
|
|
153
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
154
|
-
"
|
|
115
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 7, repeatable: true })),
|
|
116
|
+
h("h5", null),
|
|
117
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 10, repeatable: true })),
|
|
155
118
|
h("h5", null)),
|
|
156
119
|
h("div", { style: resizable },
|
|
157
120
|
h("h4", null, "Many Actions"),
|
|
158
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
159
|
-
" ",
|
|
121
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100, repeatable: true })),
|
|
160
122
|
h("h5", null),
|
|
161
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
162
|
-
" ",
|
|
123
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500, repeatable: true })),
|
|
163
124
|
h("h5", null),
|
|
164
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
165
|
-
"
|
|
125
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true })),
|
|
126
|
+
h("h5", null),
|
|
127
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true })),
|
|
166
128
|
h("h5", null))));
|
|
167
129
|
};
|
|
168
|
-
export const
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
showExpiry: false,
|
|
173
|
-
cardTitle: "Complete a survey",
|
|
174
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
175
|
-
buttonText: "Take survey",
|
|
176
|
-
goal: 1,
|
|
177
|
-
repeatable: true,
|
|
178
|
-
buttonLink: "https://example.com/",
|
|
179
|
-
showProgressBar: false,
|
|
180
|
-
loading: false,
|
|
181
|
-
};
|
|
182
|
-
const coupleActions = {
|
|
183
|
-
rewardAmount: 40,
|
|
184
|
-
rewardUnit: "Points",
|
|
185
|
-
showExpiry: false,
|
|
186
|
-
cardTitle: "Comment on 5 articles",
|
|
187
|
-
showProgressBar: true,
|
|
188
|
-
repeatable: true,
|
|
189
|
-
goal: 5,
|
|
190
|
-
steps: true,
|
|
191
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
192
|
-
buttonText: "Start reading",
|
|
193
|
-
buttonLink: "https://example.com/",
|
|
194
|
-
loading: false,
|
|
195
|
-
};
|
|
196
|
-
const manyActions = {
|
|
197
|
-
rewardAmount: 150,
|
|
198
|
-
rewardUnit: "Points",
|
|
199
|
-
showExpiry: false,
|
|
200
|
-
cardTitle: "Spend $500 at our Store",
|
|
201
|
-
showProgressBar: true,
|
|
202
|
-
repeatable: true,
|
|
203
|
-
goal: 500,
|
|
204
|
-
progressBarUnit: "$",
|
|
205
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
206
|
-
buttonText: "Visit our Store",
|
|
207
|
-
buttonLink: "https://example.com/",
|
|
208
|
-
loading: false,
|
|
130
|
+
export const TaskCardDateExpires = () => {
|
|
131
|
+
const expire = {
|
|
132
|
+
showExpiry: true,
|
|
133
|
+
dateExpires: "2021-12-01T08:00:00.000Z/2077-12-01T08:00:00.000Z",
|
|
209
134
|
};
|
|
210
|
-
|
|
135
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
136
|
+
return (h("div", { style: storyFrame },
|
|
211
137
|
h("div", { style: resizable },
|
|
212
138
|
h("h4", null, "One Action"),
|
|
213
|
-
h(TaskCardView, Object.assign({}, oneAction,
|
|
139
|
+
h(TaskCardView, Object.assign({}, oneAction, expire)),
|
|
214
140
|
" ",
|
|
215
141
|
h("h5", null),
|
|
216
|
-
h(TaskCardView, Object.assign({}, oneAction,
|
|
142
|
+
h(TaskCardView, Object.assign({}, oneAction, expireRepeat)),
|
|
217
143
|
" ",
|
|
218
144
|
h("h5", null)),
|
|
219
145
|
h("div", { style: resizable },
|
|
220
146
|
h("h4", null, "A Couple Actions"),
|
|
221
|
-
h(TaskCardView, Object.assign({}, coupleActions,
|
|
147
|
+
h(TaskCardView, Object.assign({}, coupleActions, expire)),
|
|
222
148
|
" ",
|
|
223
149
|
h("h5", null),
|
|
224
|
-
h(TaskCardView, Object.assign({}, coupleActions,
|
|
150
|
+
h(TaskCardView, Object.assign({}, coupleActions, expireRepeat)),
|
|
151
|
+
" ",
|
|
152
|
+
h("h5", null)),
|
|
153
|
+
h("div", { style: resizable },
|
|
154
|
+
h("h4", null, "Many Actions"),
|
|
155
|
+
h(TaskCardView, Object.assign({}, manyActions, expire)),
|
|
225
156
|
" ",
|
|
226
157
|
h("h5", null),
|
|
227
|
-
h(TaskCardView, Object.assign({},
|
|
158
|
+
h(TaskCardView, Object.assign({}, manyActions, expireRepeat)),
|
|
159
|
+
" ",
|
|
160
|
+
h("h5", null))));
|
|
161
|
+
};
|
|
162
|
+
export const TaskCardLoading = () => {
|
|
163
|
+
const loading = { loading: true };
|
|
164
|
+
return (h("div", { style: storyFrame },
|
|
165
|
+
h("div", { style: resizable },
|
|
166
|
+
h("h4", null, "One Action"),
|
|
167
|
+
h(TaskCardView, Object.assign({}, oneAction, loading)),
|
|
228
168
|
" ",
|
|
229
169
|
h("h5", null),
|
|
230
|
-
h(TaskCardView, Object.assign({},
|
|
170
|
+
h(TaskCardView, Object.assign({}, oneAction, loading)),
|
|
231
171
|
" ",
|
|
232
172
|
h("h5", null)),
|
|
233
173
|
h("div", { style: resizable },
|
|
234
|
-
h("h4", null, "
|
|
235
|
-
h(TaskCardView, Object.assign({},
|
|
174
|
+
h("h4", null, "A Couple Actions"),
|
|
175
|
+
h(TaskCardView, Object.assign({}, coupleActions, loading)),
|
|
236
176
|
" ",
|
|
237
177
|
h("h5", null),
|
|
238
|
-
h(TaskCardView, Object.assign({},
|
|
178
|
+
h(TaskCardView, Object.assign({}, coupleActions, loading)),
|
|
239
179
|
" ",
|
|
240
|
-
h("h5", null),
|
|
241
|
-
|
|
180
|
+
h("h5", null)),
|
|
181
|
+
h("div", { style: resizable },
|
|
182
|
+
h("h4", null, "Many Actions"),
|
|
183
|
+
h(TaskCardView, Object.assign({}, manyActions, loading)),
|
|
242
184
|
" ",
|
|
243
185
|
h("h5", null),
|
|
244
|
-
h(TaskCardView, Object.assign({}, manyActions,
|
|
186
|
+
h(TaskCardView, Object.assign({}, manyActions, loading)),
|
|
245
187
|
" ",
|
|
246
188
|
h("h5", null))));
|
|
247
189
|
};
|
|
248
|
-
export const
|
|
249
|
-
const
|
|
250
|
-
rewardAmount: 20,
|
|
251
|
-
rewardUnit: "Points",
|
|
252
|
-
cardTitle: "Complete a survey",
|
|
253
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
254
|
-
buttonText: "Take survey",
|
|
255
|
-
goal: 1,
|
|
256
|
-
repeatable: true,
|
|
257
|
-
showExpiry: true,
|
|
258
|
-
dateExpires: "Nov 1, 2021",
|
|
259
|
-
buttonLink: "https://example.com/",
|
|
260
|
-
showProgressBar: false,
|
|
261
|
-
loading: false,
|
|
262
|
-
};
|
|
263
|
-
const coupleActions = {
|
|
264
|
-
rewardAmount: 40,
|
|
265
|
-
rewardUnit: "Points",
|
|
266
|
-
cardTitle: "Comment on 5 articles",
|
|
267
|
-
showProgressBar: true,
|
|
268
|
-
repeatable: true,
|
|
269
|
-
goal: 5,
|
|
270
|
-
steps: true,
|
|
271
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
272
|
-
buttonText: "Start reading",
|
|
273
|
-
showExpiry: true,
|
|
274
|
-
dateExpires: "Nov 1, 2021",
|
|
275
|
-
buttonLink: "https://example.com/",
|
|
276
|
-
loading: false,
|
|
277
|
-
};
|
|
278
|
-
const manyActions = {
|
|
279
|
-
rewardAmount: 150,
|
|
280
|
-
rewardUnit: "Points",
|
|
281
|
-
cardTitle: "Spend $500 at our Store",
|
|
282
|
-
showProgressBar: true,
|
|
283
|
-
repeatable: true,
|
|
284
|
-
goal: 500,
|
|
285
|
-
progressBarUnit: "$",
|
|
286
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
287
|
-
buttonText: "Visit our Store",
|
|
190
|
+
export const TaskCardExpired = () => {
|
|
191
|
+
const expire = {
|
|
288
192
|
showExpiry: true,
|
|
289
|
-
dateExpires: "
|
|
290
|
-
buttonLink: "https://example.com/",
|
|
291
|
-
loading: false,
|
|
193
|
+
dateExpires: "2021-12-01T08:00:00.000Z/2021-12-01T08:00:00.000Z",
|
|
292
194
|
};
|
|
293
|
-
|
|
195
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
196
|
+
return (h("div", { style: storyFrame },
|
|
294
197
|
h("div", { style: resizable },
|
|
295
198
|
h("h4", null, "One Action"),
|
|
296
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
199
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expire)),
|
|
297
200
|
" ",
|
|
298
201
|
h("h5", null),
|
|
299
|
-
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
202
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expire)),
|
|
203
|
+
" ",
|
|
204
|
+
h("h5", null),
|
|
205
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
|
|
206
|
+
" ",
|
|
207
|
+
h("h5", null),
|
|
208
|
+
h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expireRepeat)),
|
|
300
209
|
" ",
|
|
301
210
|
h("h5", null)),
|
|
302
211
|
h("div", { style: resizable },
|
|
303
212
|
h("h4", null, "A Couple Actions"),
|
|
304
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
213
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expire)),
|
|
305
214
|
" ",
|
|
306
215
|
h("h5", null),
|
|
307
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
216
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expire)),
|
|
308
217
|
" ",
|
|
309
218
|
h("h5", null),
|
|
310
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
311
|
-
" ",
|
|
219
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expireRepeat)),
|
|
312
220
|
h("h5", null),
|
|
313
|
-
h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
314
|
-
" ",
|
|
221
|
+
h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expireRepeat)),
|
|
315
222
|
h("h5", null)),
|
|
316
223
|
h("div", { style: resizable },
|
|
317
224
|
h("h4", null, "Many Actions"),
|
|
318
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
225
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expire)),
|
|
319
226
|
" ",
|
|
320
227
|
h("h5", null),
|
|
321
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
228
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expire)),
|
|
322
229
|
" ",
|
|
323
230
|
h("h5", null),
|
|
324
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
325
|
-
" ",
|
|
231
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expireRepeat)),
|
|
326
232
|
h("h5", null),
|
|
327
|
-
h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
328
|
-
" ",
|
|
233
|
+
h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expireRepeat)),
|
|
329
234
|
h("h5", null))));
|
|
330
235
|
};
|
|
236
|
+
export const ProgressBar = () => {
|
|
237
|
+
const props = {
|
|
238
|
+
progress: 0,
|
|
239
|
+
goal: 500,
|
|
240
|
+
progressBarUnit: "$",
|
|
241
|
+
};
|
|
242
|
+
return (h("div", null,
|
|
243
|
+
h(MatrixStory, { matrix: { progress: [-100, 0, 100, 500, 1000] }, props: props, Component: ProgressBarView })));
|
|
244
|
+
};
|
|
245
|
+
export const ProgressBarSteps = () => {
|
|
246
|
+
const props = {
|
|
247
|
+
progress: 0,
|
|
248
|
+
steps: true,
|
|
249
|
+
goal: 5,
|
|
250
|
+
progressBarUnit: "$",
|
|
251
|
+
};
|
|
252
|
+
return (h("div", null,
|
|
253
|
+
h(MatrixStory, { matrix: { progress: [-1, 0, 1, 5, 7] }, props: props, Component: ProgressBarView })));
|
|
254
|
+
};
|
|
255
|
+
export const ProgressBarRepeatable = () => {
|
|
256
|
+
const props = {
|
|
257
|
+
progress: 0,
|
|
258
|
+
goal: 500,
|
|
259
|
+
progressBarUnit: "$",
|
|
260
|
+
repeatable: true,
|
|
261
|
+
};
|
|
262
|
+
return (h("div", null,
|
|
263
|
+
h(MatrixStory, { matrix: { progress: [100, 500, 650, 1200] }, props: props, Component: ProgressBarView })));
|
|
264
|
+
};
|
|
265
|
+
export const ProgressBarStepsRepeatable = () => {
|
|
266
|
+
const props = {
|
|
267
|
+
progress: 0,
|
|
268
|
+
steps: true,
|
|
269
|
+
goal: 5,
|
|
270
|
+
progressBarUnit: "$",
|
|
271
|
+
repeatable: true,
|
|
272
|
+
};
|
|
273
|
+
return (h("div", null,
|
|
274
|
+
h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
|
|
275
|
+
};
|
|
@@ -3,7 +3,7 @@ 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, complete = false, } = props;
|
|
6
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, } = props;
|
|
7
7
|
console.log("progress bar props", props);
|
|
8
8
|
const gift1 = SVGs.gift();
|
|
9
9
|
const gift2 = SVGs.gift();
|
|
@@ -32,7 +32,10 @@ export function ProgressBarView(props) {
|
|
|
32
32
|
ProgressBar: {
|
|
33
33
|
"& .progress-bar": {
|
|
34
34
|
height: "15px",
|
|
35
|
-
marginTop: steps
|
|
35
|
+
marginTop: steps
|
|
36
|
+
? "var(--sl-spacing-medium)"
|
|
37
|
+
: "var(--sl-spacing-large)",
|
|
38
|
+
filter: expired ? "grayscale(1)" : "",
|
|
36
39
|
marginBottom: "var(--sl-spacing-xx-large)",
|
|
37
40
|
marginRight: "var(--sl-spacing-x-small)",
|
|
38
41
|
fontSize: "var(--sl-font-size-x-small)",
|
|
@@ -50,7 +53,9 @@ export function ProgressBarView(props) {
|
|
|
50
53
|
width: "100%",
|
|
51
54
|
height: "4px",
|
|
52
55
|
borderRadius: "4px",
|
|
53
|
-
backgroundColor: complete
|
|
56
|
+
backgroundColor: complete
|
|
57
|
+
? "var(--sl-color-success-500)"
|
|
58
|
+
: "var(--sl-color-primary-500)",
|
|
54
59
|
},
|
|
55
60
|
"& .progress": {
|
|
56
61
|
display: "block",
|
|
@@ -63,7 +68,9 @@ export function ProgressBarView(props) {
|
|
|
63
68
|
width: "12px",
|
|
64
69
|
height: "12px",
|
|
65
70
|
display: "flex",
|
|
66
|
-
backgroundColor: complete
|
|
71
|
+
backgroundColor: complete
|
|
72
|
+
? "var(--sl-color-success-500)"
|
|
73
|
+
: "var(--sl-color-primary-500)",
|
|
67
74
|
borderRadius: "50%",
|
|
68
75
|
position: "relative",
|
|
69
76
|
left: "47%",
|
|
@@ -253,7 +260,7 @@ export function ProgressBarView(props) {
|
|
|
253
260
|
}
|
|
254
261
|
else {
|
|
255
262
|
items.push(h("div", { class: "remain" }));
|
|
256
|
-
items.push(h("div", { class: "empty" },
|
|
263
|
+
items.push(h("div", { class: "empty" }, i));
|
|
257
264
|
}
|
|
258
265
|
}
|
|
259
266
|
else if (i == goal) {
|