@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
@@ -1,7 +1,11 @@
1
1
  import { h } from "@stencil/core";
2
- import { TaskCardView, } from "./sqm-task-card-view";
2
+ import { TaskCardView } from "./sqm-task-card-view";
3
+ import scenario from "./sqm-task-card.feature";
3
4
  export default {
4
- title: "Components/Task Card",
5
+ title: "Components/Task Card/",
6
+ parameters: {
7
+ scenario,
8
+ },
5
9
  };
6
10
  const resizable = {
7
11
  width: "347px",
@@ -10,42 +14,47 @@ const resizable = {
10
14
  height: "fit-content",
11
15
  overflow: "hidden",
12
16
  };
13
- export const Default = () => {
14
- const oneAction = {
15
- points: 20,
16
- cardTitle: "Complete a survey",
17
- description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
18
- buttonText: "Take survey",
19
- buttonOnClick: () => { },
20
- };
21
- // @ts-ignore
22
- return h(TaskCardView, null);
23
- };
24
17
  export const NotRepeatable = () => {
25
18
  const oneAction = {
26
- points: 20,
19
+ rewardAmount: 20,
20
+ showExpiry: false,
21
+ rewardUnit: "Points",
27
22
  cardTitle: "Complete a survey",
23
+ repeatable: false,
28
24
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
29
25
  buttonText: "Take survey",
30
26
  goal: 1,
27
+ buttonLink: "https://example.com/",
28
+ showProgressBar: false,
29
+ loading: false,
31
30
  };
32
31
  const coupleActions = {
33
- points: 40,
32
+ rewardAmount: 40,
33
+ rewardUnit: "Points",
34
34
  cardTitle: "Comment on 5 articles",
35
35
  showProgressBar: true,
36
+ showExpiry: false,
36
37
  goal: 5,
37
- steps: 1,
38
+ repeatable: false,
39
+ steps: true,
38
40
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
39
41
  buttonText: "Start reading",
42
+ buttonLink: "https://example.com/",
43
+ loading: false,
40
44
  };
41
45
  const manyActions = {
42
- points: 150,
46
+ rewardAmount: 150,
47
+ rewardUnit: "Points",
43
48
  cardTitle: "Spend $500 at our Store",
44
49
  showProgressBar: true,
50
+ showExpiry: false,
45
51
  goal: 500,
52
+ repeatable: false,
46
53
  unit: "$",
47
54
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
48
55
  buttonText: "Visit our Store",
56
+ buttonLink: "https://example.com/",
57
+ loading: false,
49
58
  };
50
59
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
51
60
  h("div", { style: resizable },
@@ -66,13 +75,6 @@ export const NotRepeatable = () => {
66
75
  h("h5", null),
67
76
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
68
77
  " ",
69
- h("h5", null),
70
- h("h5", null,
71
- "Progress ",
72
- ">",
73
- " Goal"),
74
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
75
- " ",
76
78
  h("h5", null)),
77
79
  h("div", { style: resizable },
78
80
  h("h4", null, "Many Actions"),
@@ -84,46 +86,52 @@ export const NotRepeatable = () => {
84
86
  h("h5", null),
85
87
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
86
88
  " ",
87
- h("h5", null),
88
- h("h5", null,
89
- "Progress ",
90
- ">",
91
- " Goal"),
92
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
93
- " ",
94
89
  h("h5", null))));
95
90
  };
96
91
  export const NotRepeatableWithExpiry = () => {
97
92
  const oneAction = {
98
- points: 20,
93
+ rewardAmount: 20,
94
+ rewardUnit: "Points",
99
95
  cardTitle: "Complete a survey",
100
96
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
101
97
  buttonText: "Take survey",
102
98
  goal: 1,
103
- expire: true,
104
- dateExpire: "Nov 1, 2021",
99
+ showExpiry: true,
100
+ repeatable: false,
101
+ dateExpires: "Nov 1, 2021",
102
+ buttonLink: "https://example.com/",
103
+ showProgressBar: false,
104
+ loading: false,
105
105
  };
106
106
  const coupleActions = {
107
- points: 40,
107
+ rewardAmount: 40,
108
+ rewardUnit: "Points",
108
109
  cardTitle: "Comment on 5 articles",
109
110
  showProgressBar: true,
110
111
  goal: 5,
111
- steps: 1,
112
+ steps: true,
112
113
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
113
114
  buttonText: "Start reading",
114
- expire: true,
115
- dateExpire: "Nov 1, 2021",
115
+ showExpiry: true,
116
+ repeatable: false,
117
+ dateExpires: "Nov 1, 2021",
118
+ buttonLink: "https://example.com/",
119
+ loading: false,
116
120
  };
117
121
  const manyActions = {
118
- points: 150,
122
+ rewardAmount: 150,
123
+ rewardUnit: "Points",
124
+ repeatable: false,
119
125
  cardTitle: "Spend $500 at our Store",
120
126
  showProgressBar: true,
121
127
  goal: 500,
122
128
  unit: "$",
123
129
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
124
130
  buttonText: "Visit our Store",
125
- expire: true,
126
- dateExpire: "Nov 1, 2021",
131
+ showExpiry: true,
132
+ dateExpires: "Nov 1, 2021",
133
+ buttonLink: "https://example.com/",
134
+ loading: false,
127
135
  };
128
136
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
129
137
  h("div", { style: resizable },
@@ -144,13 +152,6 @@ export const NotRepeatableWithExpiry = () => {
144
152
  h("h5", null),
145
153
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
146
154
  " ",
147
- h("h5", null),
148
- h("h5", null,
149
- "Progress ",
150
- ">",
151
- " Goal"),
152
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 9 })),
153
- " ",
154
155
  h("h5", null)),
155
156
  h("div", { style: resizable },
156
157
  h("h4", null, "Many Actions"),
@@ -162,36 +163,40 @@ export const NotRepeatableWithExpiry = () => {
162
163
  h("h5", null),
163
164
  h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
164
165
  " ",
165
- h("h5", null),
166
- h("h5", null,
167
- "Progress ",
168
- ">",
169
- " Goal"),
170
- h(TaskCardView, Object.assign({}, manyActions, { progress: 700 })),
171
- " ",
172
166
  h("h5", null))));
173
167
  };
174
168
  export const Repeatable = () => {
175
169
  const oneAction = {
176
- points: 20,
170
+ rewardAmount: 20,
171
+ rewardUnit: "Points",
172
+ showExpiry: false,
177
173
  cardTitle: "Complete a survey",
178
174
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
179
175
  buttonText: "Take survey",
180
176
  goal: 1,
181
177
  repeatable: true,
178
+ buttonLink: "https://example.com/",
179
+ showProgressBar: false,
180
+ loading: false,
182
181
  };
183
182
  const coupleActions = {
184
- points: 40,
183
+ rewardAmount: 40,
184
+ rewardUnit: "Points",
185
+ showExpiry: false,
185
186
  cardTitle: "Comment on 5 articles",
186
187
  showProgressBar: true,
187
188
  repeatable: true,
188
189
  goal: 5,
189
- steps: 1,
190
+ steps: true,
190
191
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
191
192
  buttonText: "Start reading",
193
+ buttonLink: "https://example.com/",
194
+ loading: false,
192
195
  };
193
196
  const manyActions = {
194
- points: 150,
197
+ rewardAmount: 150,
198
+ rewardUnit: "Points",
199
+ showExpiry: false,
195
200
  cardTitle: "Spend $500 at our Store",
196
201
  showProgressBar: true,
197
202
  repeatable: true,
@@ -199,6 +204,8 @@ export const Repeatable = () => {
199
204
  unit: "$",
200
205
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
201
206
  buttonText: "Visit our Store",
207
+ buttonLink: "https://example.com/",
208
+ loading: false,
202
209
  };
203
210
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
204
211
  h("div", { style: resizable },
@@ -222,18 +229,6 @@ export const Repeatable = () => {
222
229
  h("h5", null),
223
230
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
224
231
  " ",
225
- h("h5", null),
226
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
227
- " ",
228
- h("h5", null),
229
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
230
- " ",
231
- h("h5", null),
232
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
233
- " ",
234
- h("h5", null),
235
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
236
- " ",
237
232
  h("h5", null)),
238
233
  h("div", { style: resizable },
239
234
  h("h4", null, "Many Actions"),
@@ -248,45 +243,41 @@ export const Repeatable = () => {
248
243
  h("h5", null),
249
244
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
250
245
  " ",
251
- h("h5", null),
252
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
253
- " ",
254
- h("h5", null),
255
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
256
- " ",
257
- h("h5", null),
258
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
259
- " ",
260
- h("h5", null),
261
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
262
- " ",
263
246
  h("h5", null))));
264
247
  };
265
248
  export const RepeatableWithExpiry = () => {
266
249
  const oneAction = {
267
- points: 20,
250
+ rewardAmount: 20,
251
+ rewardUnit: "Points",
268
252
  cardTitle: "Complete a survey",
269
253
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
270
254
  buttonText: "Take survey",
271
255
  goal: 1,
272
256
  repeatable: true,
273
- expire: true,
274
- dateExpire: "Nov 1, 2021",
257
+ showExpiry: true,
258
+ dateExpires: "Nov 1, 2021",
259
+ buttonLink: "https://example.com/",
260
+ showProgressBar: false,
261
+ loading: false,
275
262
  };
276
263
  const coupleActions = {
277
- points: 40,
264
+ rewardAmount: 40,
265
+ rewardUnit: "Points",
278
266
  cardTitle: "Comment on 5 articles",
279
267
  showProgressBar: true,
280
268
  repeatable: true,
281
269
  goal: 5,
282
- steps: 1,
270
+ steps: true,
283
271
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
284
272
  buttonText: "Start reading",
285
- expire: true,
286
- dateExpire: "Nov 1, 2021",
273
+ showExpiry: true,
274
+ dateExpires: "Nov 1, 2021",
275
+ buttonLink: "https://example.com/",
276
+ loading: false,
287
277
  };
288
278
  const manyActions = {
289
- points: 150,
279
+ rewardAmount: 150,
280
+ rewardUnit: "Points",
290
281
  cardTitle: "Spend $500 at our Store",
291
282
  showProgressBar: true,
292
283
  repeatable: true,
@@ -294,8 +285,10 @@ export const RepeatableWithExpiry = () => {
294
285
  unit: "$",
295
286
  description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
296
287
  buttonText: "Visit our Store",
297
- expire: true,
298
- dateExpire: "Nov 1, 2021",
288
+ showExpiry: true,
289
+ dateExpires: "Nov 1, 2021",
290
+ buttonLink: "https://example.com/",
291
+ loading: false,
299
292
  };
300
293
  return (h("div", { style: { display: "inline-flex", gap: "32px" } },
301
294
  h("div", { style: resizable },
@@ -319,18 +312,6 @@ export const RepeatableWithExpiry = () => {
319
312
  h("h5", null),
320
313
  h(TaskCardView, Object.assign({}, coupleActions, { progress: 10 })),
321
314
  " ",
322
- h("h5", null),
323
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 12 })),
324
- " ",
325
- h("h5", null),
326
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 15 })),
327
- " ",
328
- h("h5", null),
329
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 17 })),
330
- " ",
331
- h("h5", null),
332
- h(TaskCardView, Object.assign({}, coupleActions, { progress: 22 })),
333
- " ",
334
315
  h("h5", null)),
335
316
  h("div", { style: resizable },
336
317
  h("h4", null, "Many Actions"),
@@ -345,155 +326,5 @@ export const RepeatableWithExpiry = () => {
345
326
  h("h5", null),
346
327
  h(TaskCardView, Object.assign({}, manyActions, { progress: 1000 })),
347
328
  " ",
348
- h("h5", null),
349
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1200 })),
350
- " ",
351
- h("h5", null),
352
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1500 })),
353
- " ",
354
- h("h5", null),
355
- h(TaskCardView, Object.assign({}, manyActions, { progress: 1700 })),
356
- " ",
357
- h("h5", null),
358
- h(TaskCardView, Object.assign({}, manyActions, { progress: 2200 })),
359
- " ",
360
329
  h("h5", null))));
361
330
  };
362
- // export const Repeatable = () => {
363
- // const oneAction = {
364
- // points: 20,
365
- // cardTitle: "Complete a survey",
366
- // description:
367
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
368
- // repeatable: 0,
369
- // buttonText: "Take survey",
370
- // buttonOnClick: () => {},
371
- // };
372
- // const coupleActions = {
373
- // points: 40,
374
- // cardTitle: "Comment on 5 articles",
375
- // goal: 5,
376
- // steps: 1,
377
- // repeatable: true,
378
- // description:
379
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
380
- // buttonText: "Start reading",
381
- // buttonOnClick: () => {},
382
- // };
383
- // const manyActions = {
384
- // points: 150,
385
- // cardTitle: "Spend $500 at our Store",
386
- // goal: 500,
387
- // repeatable: true,
388
- // unit: "$",
389
- // description:
390
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
391
- // buttonText: "Visit our Store",
392
- // buttonOnClick: () => {},
393
- // };
394
- // return (
395
- // <div style={{ display: "inline-flex", gap: "32px" }}>
396
- // <div style={resizable}>
397
- // <h4>One Action</h4>
398
- // <TaskCardView {...oneAction} /> <h5 />
399
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
400
- // </div>
401
- // <div style={resizable}>
402
- // <h4>A Couple Actions</h4>
403
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
404
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
405
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
406
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
407
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
408
- // </div>
409
- // <div style={resizable}>
410
- // <h4>Many Actions</h4>
411
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
412
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
413
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
414
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
415
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
416
- // </div>
417
- // </div>
418
- // );
419
- // };
420
- // export const RepeatableWithExpiry = () => {
421
- // const oneAction = {
422
- // points: 20,
423
- // cardTitle: "Complete a survey",
424
- // expire: "Nov 30, 2021",
425
- // description:
426
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
427
- // repeatable: 0,
428
- // buttonText: "Take survey",
429
- // buttonOnClick: () => {},
430
- // };
431
- // const coupleActions = {
432
- // points: 40,
433
- // cardTitle: "Comment on 5 articles",
434
- // expire: "Nov 30, 2021",
435
- // goal: 5,
436
- // steps: 1,
437
- // repeatable: true,
438
- // description:
439
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
440
- // buttonText: "Start reading",
441
- // buttonOnClick: () => {},
442
- // };
443
- // const manyActions = {
444
- // points: 150,
445
- // cardTitle: "Spend $500 at our Store",
446
- // expire: "Nov 30, 2021",
447
- // goal: 500,
448
- // repeatable: true,
449
- // unit: "$",
450
- // description:
451
- // "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
452
- // buttonText: "Visit our Store",
453
- // buttonOnClick: () => {},
454
- // };
455
- // return (
456
- // <div style={{ display: "inline-flex", gap: "32px" }}>
457
- // <div style={resizable}>
458
- // <h4>One Action</h4>
459
- // <TaskCardView {...oneAction} /> <h5 />
460
- // <TaskCardView {...oneAction} repeatable={1} complete /> <h5 />
461
- // </div>
462
- // <div style={resizable}>
463
- // <h4>A Couple Actions</h4>
464
- // <TaskCardView {...coupleActions} progress={1} /> <h5 />
465
- // <TaskCardView {...coupleActions} progress={5} /> <h5 />
466
- // <TaskCardView {...coupleActions} progress={7} /> <h5 />
467
- // <TaskCardView {...coupleActions} progress={10} /> <h5 />
468
- // <TaskCardView {...coupleActions} progress={12} /> <h5 />
469
- // </div>
470
- // <div style={resizable}>
471
- // <h4>Many Actions</h4>
472
- // <TaskCardView {...manyActions} progress={100} /> <h5 />
473
- // <TaskCardView {...manyActions} progress={500} /> <h5 />
474
- // <TaskCardView {...manyActions} progress={650} /> <h5 />
475
- // <TaskCardView {...manyActions} progress={1000} /> <h5 />
476
- // <TaskCardView {...manyActions} progress={1200} /> <h5 />
477
- // </div>
478
- // </div>
479
- // );
480
- // };
481
- // export const ProgressBar = () => {
482
- // const props = {
483
- // goal: 5,
484
- // };
485
- // return (
486
- // <div>
487
- // <MatrixStory
488
- // matrix={{ progress: [1, 2, 5], steps: [0, 1], repeatable: [false] }}
489
- // props={props}
490
- // Component={ProgressBarView}
491
- // />
492
- // <MatrixStory
493
- // matrix={{ progress: [2, 5, 7, 12], steps: [0, 1], repeatable: [true] }}
494
- // props={props}
495
- // Component={ProgressBarView}
496
- // />
497
- // </div>
498
- // );
499
- // };
@@ -0,0 +1,41 @@
1
+ import { setUserIdentity } from "@saasquatch/component-boilerplate";
2
+ import { useEffect } from "@saasquatch/universal-hooks";
3
+ import { h } from "@stencil/core";
4
+ import { createHookStory } from "../sqm-stencilbook/HookStoryAddon";
5
+ const JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoic2FtK2tsaXBAc2Fhc3F1YXQuY2giLCJhY2NvdW50SWQiOiJzYW0ra2xpcEBzYWFzcXVhdC5jaCJ9fQ.FMNZ6oajyr6SiCcRqKKdyPqvNTvWROQ60MKAyfvWGfc";
6
+ export default {
7
+ title: "Hooks / useTaskCard",
8
+ };
9
+ function setupGraphQL() {
10
+ const id = "sam+klip@saasquat.ch";
11
+ const accountId = id;
12
+ const programId = "klip-referral-program";
13
+ //@ts-ignore
14
+ window.widgetIdent = {
15
+ tenantAlias: "test_a74miwdpofztj",
16
+ appDomain: "https://staging.referralsaasquatch.com",
17
+ programId,
18
+ };
19
+ useEffect(() => {
20
+ setUserIdentity({
21
+ accountId,
22
+ id,
23
+ jwt: JWT,
24
+ });
25
+ return () => {
26
+ window.widgetIdent = undefined;
27
+ setUserIdentity(undefined);
28
+ };
29
+ }, []);
30
+ return { id, accountId };
31
+ }
32
+ export const TaskCard = createHookStory(() => {
33
+ setupGraphQL();
34
+ const props = {
35
+ listType: "",
36
+ render: () => { },
37
+ disconnectedCallback: () => { },
38
+ ignored: true,
39
+ };
40
+ return (h("sqm-task-card", { "card-title": "Comment on 5 articles", "button-text": "Start reading", goal: 5, steps: true, "show-progress-bar": true }));
41
+ });
@@ -0,0 +1,7 @@
1
+ import { h } from "@stencil/core";
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 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)" }),
5
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.5 9v1h13V9h-13z", fill: "var(--sl-color-primary-300)" }),
6
+ 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)" })));
7
+ };