@saasquatch/mint-components 1.5.0-0 → 1.5.0-4

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 (93) 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-divided-layout_30.cjs.entry.js → sqm-brand_31.cjs.entry.js} +27134 -26654
  4. package/dist/cjs/sqm-program-explainer-step-view-74863815.js +70 -0
  5. package/dist/cjs/sqm-program-explainer-step.cjs.entry.js +22 -0
  6. package/dist/cjs/sqm-program-explainer-view-afed92f5.js +45 -0
  7. package/dist/cjs/sqm-program-explainer.cjs.entry.js +23 -0
  8. package/dist/cjs/sqm-share-code.cjs.entry.js +19 -0
  9. package/dist/collection/collection-manifest.json +3 -0
  10. package/dist/collection/components/sqm-brand/SqmBrand.stories.js +93 -0
  11. package/dist/collection/components/sqm-brand/sqm-brand.js +97 -0
  12. package/dist/collection/components/sqm-program-explainer/ProgramExplainer.stories.js +49 -0
  13. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer-view.js +41 -0
  14. package/dist/collection/components/sqm-program-explainer/sqm-program-explainer.js +131 -0
  15. package/dist/collection/components/sqm-program-explainer-step/ProgramExplainerStep.stories.js +22 -0
  16. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step-view.js +66 -0
  17. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +123 -0
  18. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +5 -3
  19. package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +38 -19
  20. package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +3 -0
  21. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +142 -102
  22. package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +349 -3
  23. package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +28 -4
  24. package/dist/collection/components/sqm-rewards-table/useRewardsTable.js +0 -1
  25. package/dist/collection/components/sqm-share-code/useShareCode.js +20 -1
  26. package/dist/collection/components/sqm-share-link/useShareLink.js +20 -1
  27. package/dist/collection/components/sqm-stencilbook/AutoColor.js +32 -4
  28. package/dist/collection/components/sqm-stencilbook/Themes.js +14 -0
  29. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +6 -0
  30. package/dist/collection/components/sqm-task-card/TaskCard.stories.js +26 -18
  31. package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +37 -0
  32. package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +8 -6
  33. package/dist/collection/components/sqm-task-card/sqm-task-card.js +5 -6
  34. package/dist/collection/fonts/GoogleFonts.js +12 -0
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/esm/mint-components.js +1 -1
  37. package/dist/esm/{sqm-divided-layout_30.entry.js → sqm-brand_31.entry.js} +27128 -26649
  38. package/dist/esm/sqm-program-explainer-step-view-f190277a.js +68 -0
  39. package/dist/esm/sqm-program-explainer-step.entry.js +18 -0
  40. package/dist/esm/sqm-program-explainer-view-1c603bb7.js +43 -0
  41. package/dist/esm/sqm-program-explainer.entry.js +19 -0
  42. package/dist/esm/sqm-share-code.entry.js +20 -1
  43. package/dist/esm-es5/loader.js +1 -1
  44. package/dist/esm-es5/mint-components.js +1 -1
  45. package/dist/esm-es5/sqm-brand_31.entry.js +58 -0
  46. package/dist/esm-es5/sqm-program-explainer-step-view-f190277a.js +1 -0
  47. package/dist/esm-es5/sqm-program-explainer-step.entry.js +1 -0
  48. package/dist/esm-es5/sqm-program-explainer-view-1c603bb7.js +1 -0
  49. package/dist/esm-es5/sqm-program-explainer.entry.js +1 -0
  50. package/dist/esm-es5/sqm-share-code.entry.js +1 -1
  51. package/dist/mint-components/mint-components.esm.js +1 -1
  52. package/dist/mint-components/mint-components.js +1 -1
  53. package/dist/mint-components/p-16f5a7cb.system.js +1 -1
  54. package/dist/mint-components/p-2d6421b6.system.js +1 -0
  55. package/dist/mint-components/p-3b6228f4.system.js +1 -0
  56. package/dist/mint-components/p-49cbd0a2.entry.js +13 -0
  57. package/dist/mint-components/p-5f4d838e.system.entry.js +58 -0
  58. package/dist/mint-components/p-6c9c4477.js +1 -0
  59. package/dist/mint-components/p-84dc4854.entry.js +397 -0
  60. package/dist/mint-components/p-96a1967b.entry.js +1 -0
  61. package/dist/mint-components/p-9e4e397a.system.entry.js +1 -0
  62. package/dist/mint-components/p-bc8b6125.js +1 -0
  63. package/dist/mint-components/p-bf1b79ba.entry.js +1 -0
  64. package/dist/mint-components/p-c3f91add.system.entry.js +1 -0
  65. package/dist/mint-components/p-e6d77d20.system.entry.js +1 -0
  66. package/dist/types/components/sqm-brand/SqmBrand.stories.d.ts +7 -0
  67. package/dist/types/components/sqm-brand/sqm-brand.d.ts +23 -0
  68. package/dist/types/components/sqm-program-explainer/ProgramExplainer.stories.d.ts +7 -0
  69. package/dist/types/components/sqm-program-explainer/sqm-program-explainer-view.d.ts +9 -0
  70. package/dist/types/components/sqm-program-explainer/sqm-program-explainer.d.ts +31 -0
  71. package/dist/types/components/sqm-program-explainer-step/ProgramExplainerStep.stories.d.ts +5 -0
  72. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step-view.d.ts +8 -0
  73. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +29 -0
  74. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +2 -0
  75. package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +85 -0
  76. package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
  77. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -0
  78. package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +53 -0
  79. package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +17 -0
  80. package/dist/types/components/sqm-stencilbook/AutoColor.d.ts +15 -0
  81. package/dist/types/components/sqm-stencilbook/Themes.d.ts +1 -0
  82. package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +1 -0
  83. package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +1 -1
  84. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +1 -1
  85. package/dist/types/components.d.ts +253 -2
  86. package/dist/types/fonts/GoogleFonts.d.ts +9 -0
  87. package/grapesjs/grapesjs.js +1 -1
  88. package/package.json +2 -2
  89. package/dist/esm-es5/sqm-divided-layout_30.entry.js +0 -58
  90. package/dist/mint-components/p-55508395.system.entry.js +0 -1
  91. package/dist/mint-components/p-925ccb31.system.entry.js +0 -58
  92. package/dist/mint-components/p-cd410a05.entry.js +0 -9
  93. package/dist/mint-components/p-fdb484a0.entry.js +0 -392
@@ -4,15 +4,17 @@ import preset from "jss-preset-default";
4
4
  import { intl } from "../../global/global";
5
5
  import { HostBlock } from "../../global/mixins";
6
6
  import { ProgressBar } from "./progressBar";
7
- import { ExchangeArrows, CheckMark, Gift } from "./SVGs";
7
+ import { ShareLinkView } from "../sqm-share-link/sqm-share-link-view";
8
+ import { ExchangeArrows, Gift, CheckmarkFilled, } from "./SVGs";
8
9
  const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
9
- const stageProgressList = {
10
- chooseReward: "Choose reward",
11
- chooseAmount: "Amount",
12
- confirmation: "Confirm",
13
- };
14
10
  export function RewardExchangeView(props) {
15
- console.log(props);
11
+ const { states, data, callbacks } = props;
12
+ const { selectedItem, selectedStep } = states;
13
+ const stageProgressList = {
14
+ chooseReward: states.content.text.chooseRewardTitle,
15
+ chooseAmount: states.content.text.chooseAmountTitle,
16
+ confirmation: states.content.text.confirmationTitle,
17
+ };
16
18
  const style = {
17
19
  HostBlock: HostBlock,
18
20
  Container: {
@@ -72,24 +74,10 @@ export function RewardExchangeView(props) {
72
74
  marginBottom: "20px",
73
75
  },
74
76
  Select: {
75
- "&::part(base)": {
76
- flex: "0.75",
77
- },
78
- "&::part(menu)": {
79
- maxHeight: "40vh",
77
+ "&::part(label)": {
78
+ color: "var(--sl-color-primary-500)",
80
79
  },
81
80
  },
82
- Buttons: {
83
- marginLeft: "auto",
84
- width: "100%",
85
- maxWidth: "300px",
86
- },
87
- Button: {
88
- margin: "10px 0",
89
- display: "block",
90
- textAlign: "center",
91
- cursor: "pointer",
92
- },
93
81
  ProgressBar: {
94
82
  maxWidth: "350px",
95
83
  width: "100%",
@@ -111,7 +99,13 @@ export function RewardExchangeView(props) {
111
99
  },
112
100
  },
113
101
  },
114
- KutayCard: {
102
+ CardLayout: {
103
+ display: "flex",
104
+ width: "100%",
105
+ borderRadius: "3px",
106
+ background: "rgba(0, 0, 0, 0)",
107
+ },
108
+ Card: {
115
109
  display: "flex",
116
110
  userSelect: "none",
117
111
  height: "120px",
@@ -123,21 +117,12 @@ export function RewardExchangeView(props) {
123
117
  display: "flex",
124
118
  padding: 0,
125
119
  },
126
- "& .selected-outline": {
127
- width: "18px",
128
- height: "18px",
129
- minWidth: "18px",
130
- borderRadius: "50%",
131
- background: "var(--sl-color-primary-500)",
120
+ "& .selected": {
132
121
  position: "relative",
133
- margin: "-9px",
122
+ top: "-2%",
134
123
  left: "100%",
135
- },
136
- "& .selected-checkmark": {
137
- position: "relative",
138
- left: "12%",
139
- top: "-29%",
140
- transform: "scale(0.8)",
124
+ color: "var(--sl-color-primary-500)",
125
+ margin: "-9px",
141
126
  },
142
127
  },
143
128
  Square: {
@@ -156,14 +141,18 @@ export function RewardExchangeView(props) {
156
141
  },
157
142
  },
158
143
  Image: {
144
+ padding: "8px",
145
+ minWidth: "96px",
146
+ maxWidth: "96px",
159
147
  "& .image": {
148
+ width: "100%",
149
+ height: "100%",
160
150
  objectFit: "contain",
161
- width: "120px",
162
- height: "118px",
163
- flex: 0.33,
151
+ borderRadius: "4px",
164
152
  },
165
- "& .image.black": {
166
- filter: "brightness(20%)",
153
+ "& .image.subdued": {
154
+ filter: "brightness(0.95)",
155
+ opacity: "0.5",
167
156
  },
168
157
  },
169
158
  TextArea: {
@@ -174,12 +163,20 @@ export function RewardExchangeView(props) {
174
163
  lineHeight: "20px",
175
164
  fontWeight: "600",
176
165
  color: "var(--sl-color-neutral-1000)",
166
+ display: "-webkit-box",
167
+ "-webkit-line-clamp": "1",
168
+ "-webkit-box-orient": "vertical",
169
+ overflow: "hidden",
177
170
  },
178
171
  "& .amount": {
179
172
  fontSize: "14px",
180
173
  lineHeight: "18px",
181
174
  marginTop: "8px",
182
175
  color: "var(--sl-color-neutral-500)",
176
+ display: "-webkit-box",
177
+ "-webkit-line-clamp": "1",
178
+ "-webkit-box-orient": "vertical",
179
+ overflow: "hidden",
183
180
  },
184
181
  "& .error": {
185
182
  fontSize: "14px",
@@ -187,6 +184,10 @@ export function RewardExchangeView(props) {
187
184
  marginTop: "8px",
188
185
  fontWeight: "600",
189
186
  color: "var(--sl-color-warning-500)",
187
+ display: "-webkit-box",
188
+ "-webkit-line-clamp": "1",
189
+ "-webkit-box-orient": "vertical",
190
+ overflow: "hidden",
190
191
  },
191
192
  },
192
193
  ChooseAmount: {
@@ -201,7 +202,7 @@ export function RewardExchangeView(props) {
201
202
  //fontSize: "var(--sl-font-size-large)",
202
203
  fontSize: "113%",
203
204
  fontWeight: "var(--sl-font-weight-semibold)",
204
- color: "var(--sl-color-sky-500)",
205
+ color: "var(--sl-color-primary-500)",
205
206
  },
206
207
  "& .description": {
207
208
  fontSize: "var(--sl-font-size-medium)",
@@ -232,7 +233,13 @@ export function RewardExchangeView(props) {
232
233
  marginTop: "var(--sl-spacing-xx-small)",
233
234
  },
234
235
  },
235
- KutayButton: {
236
+ Grid: {
237
+ display: "grid",
238
+ justifyContent: "center",
239
+ gap: "20px",
240
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
241
+ },
242
+ Button: {
236
243
  display: "flex",
237
244
  flexWrap: "wrap-reverse",
238
245
  margin: "var(--sl-spacing-medium) 0",
@@ -271,18 +278,18 @@ export function RewardExchangeView(props) {
271
278
  jss.setup(preset());
272
279
  const sheet = jss.createStyleSheet(style);
273
280
  const styleString = sheet.toString();
274
- const { states, data, callbacks } = props;
275
- const { selectedItem, selectedStep } = states;
276
281
  function getInput() {
277
282
  var _a, _b;
278
283
  const item = states.selectedItem;
279
284
  if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
280
285
  return h("span", null, item === null || item === void 0 ? void 0 : item.prettySourceValue);
281
286
  if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
282
- return h("p", null,
283
- "Not enough ",
284
- item.sourceUnit,
285
- " to redeem for this reward.");
287
+ return (h("p", null, intl.formatMessage({
288
+ id: "notEnoughError",
289
+ defaultMessage: states.content.text.notEnoughError,
290
+ }, {
291
+ sourceUnit: item.sourceUnit,
292
+ })));
286
293
  }
287
294
  return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
288
295
  var _a, _b, _c, _d, _e;
@@ -301,72 +308,78 @@ export function RewardExchangeView(props) {
301
308
  defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
302
309
  }, {
303
310
  unavailableReason: step.unavailableReasonCode,
311
+ sourceValue: step.prettySourceValue || item.prettySourceMinValue,
304
312
  }))))));
305
313
  })));
306
314
  }
307
315
  function chooseReward() {
308
316
  var _a;
309
317
  return [
310
- h("div", { style: {
311
- display: "grid",
312
- justifyContent: "center",
313
- gap: "20px",
314
- gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
315
- } }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
316
- var _a, _b;
318
+ h("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
319
+ var _a, _b, _c, _d, _e;
317
320
  const style = {
318
321
  boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
319
322
  ? "0 0 0 2px var(--sl-color-primary-500)"
320
323
  : "none",
321
- marginBottom: "10px 0",
322
- borderRadius: "var(--sl-border-radius-medium)",
323
- flex: "1",
324
- minWidth: "100%",
325
- color: !item.available && "#eee",
324
+ borderRadius: "4px",
326
325
  };
327
326
  const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
328
327
  ? item.prettySourceValue
329
- : `${item.sourceMinValue} to ${item.prettySourceMaxValue}`;
328
+ : item.ruleType === "STEPPED_FIXED_GLOBAL_REWARD"
329
+ ? `${(_a = item.steps[0]) === null || _a === void 0 ? void 0 : _a.sourceValue} to ${(_b = item.steps.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.prettySourceValue}`
330
+ : `${item.prettySourceMinValue} to ${item.prettySourceMaxValue}`;
330
331
  return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
331
- h("sl-card", { class: sheet.classes.KutayCard, style: {
332
+ h("sl-card", { class: sheet.classes.Card, style: {
332
333
  cursor: item.unavailableReasonCode
333
334
  ? "not-allowed"
334
335
  : "pointer",
335
336
  }, onClick: () => item.available &&
336
337
  callbacks.setExchangeState({ selectedItem: item }) },
337
- item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { class: "selected-outline" },
338
- h("div", { class: "selected-checkmark" },
339
- h(CheckMark, null)))),
338
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { class: "selected" },
339
+ h(CheckmarkFilled, null))),
340
340
  h("div", { style: {
341
341
  display: "flex",
342
342
  width: "100%",
343
+ height: "120px",
343
344
  borderRadius: "3px",
344
345
  background: item.unavailableReasonCode
345
346
  ? "rgba(0, 0, 0, 0.05)"
346
347
  : "rgba(0, 0, 0, 0)",
347
348
  } },
348
- h("div", { class: sheet.classes.Square },
349
+ h("div", { class: sheet.classes.Image, style: {
350
+ opacity: item.unavailableReasonCode ? "0.5" : "1",
351
+ } },
349
352
  h("img", { class: item.unavailableReasonCode ? "image subdued" : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
350
353
  getAssetPath("./assets/placeholder.png") })),
351
354
  h("div", { class: sheet.classes.TextArea, style: {
352
355
  opacity: item.unavailableReasonCode ? "0.5" : "1",
353
356
  } },
354
- h("div", { class: "title" }, item.name),
355
- h("div", { class: "amount" }, amount),
357
+ h("div", { class: "title", style: {
358
+ "-webkit-line-clamp": item.unavailableReasonCode
359
+ ? "1"
360
+ : "2",
361
+ } }, (_c = item.name) !== null && _c !== void 0 ? _c : ""),
362
+ h("div", { class: "amount", style: {
363
+ "-webkit-line-clamp": item.unavailableReasonCode
364
+ ? "1"
365
+ : "2",
366
+ } }, amount),
356
367
  item.unavailableReasonCode && (h("div", { class: "error" }, intl.formatMessage({
357
368
  id: "unavailableCode",
358
- defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
369
+ defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
359
370
  }, {
360
371
  unavailableReason: item.unavailableReason ||
361
372
  item.unavailableReasonCode,
373
+ sourceValue: item.prettySourceValue ||
374
+ item.prettySourceMinValue,
362
375
  }))))))));
363
376
  })),
364
- h("div", { class: sheet.classes.KutayButton },
365
- h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem }, "Continue")),
377
+ h("div", { class: sheet.classes.Button },
378
+ h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText)),
366
379
  ];
367
380
  }
368
381
  function chooseAmount() {
369
- var _a, _b, _c;
382
+ var _a, _b, _c, _d;
370
383
  const input = getInput();
371
384
  const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
372
385
  ? false
@@ -375,17 +388,18 @@ export function RewardExchangeView(props) {
375
388
  h("div", null, h("img", { class: sheet.classes.FullImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
376
389
  getAssetPath("./assets/placeholder.png") })),
377
390
  h("div", { class: sheet.classes.ChooseAmount },
378
- h("div", { class: "title" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name),
379
- ((_b = states.selectedItem) === null || _b === void 0 ? void 0 : _b.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "points" }, input)) : (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
380
- ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h("div", { class: "points" }, input)),
391
+ h("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
392
+ ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "points" }, input)) : (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
393
+ ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h("div", { class: "points" }, input)),
381
394
  h("div", { class: "space" })),
382
- h("div", { class: sheet.classes.KutayButton },
383
- h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, "Cancel"),
384
- h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, "Continue to confirmation"))));
395
+ h("div", { class: sheet.classes.Button },
396
+ h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
397
+ h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText))));
385
398
  }
386
399
  function confirmation() {
400
+ var _a, _b;
387
401
  return (h("div", null,
388
- h("h2", { style: { margin: "20px 0" } }, "Confirm and redeem"),
402
+ h("h2", { style: { margin: "20px 0" } }, states.content.text.redeemTitle),
389
403
  h("div", { style: {
390
404
  textAlign: "center",
391
405
  marginBottom: "var(--sl-spacing-xxx-large)",
@@ -400,27 +414,39 @@ export function RewardExchangeView(props) {
400
414
  flex: "1",
401
415
  minWidth: "100%",
402
416
  } },
403
- h("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.KutayCard },
417
+ h("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.Card },
404
418
  h("div", { class: sheet.classes.Square },
405
419
  h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
406
420
  getAssetPath("./assets/placeholder.png") })),
407
421
  h("div", { class: sheet.classes.TextArea, style: {
408
422
  lineHeight: "18px",
409
423
  alignSelf: "center",
410
- } }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
411
- " " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)
412
- : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)))),
413
- h("div", { class: sheet.classes.KutayButton },
414
- h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, "Back"),
415
- h("sl-button", { class: "continue", size: "large", onClick: callbacks.exchangeReward }, "Redeem"))));
424
+ } }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (_a = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
425
+ " " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)) !== null && _a !== void 0 ? _a : "" : (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : "")))),
426
+ h("div", { class: sheet.classes.Button },
427
+ h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
428
+ h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText))));
416
429
  }
417
430
  function success() {
431
+ var _a, _b, _c;
418
432
  return (h("div", { class: sheet.classes.Success },
419
433
  h(Gift, null),
420
- h("div", { class: "title" }, "Reward Redeemed"),
421
- h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
422
- h("div", { class: sheet.classes.KutayButton },
423
- h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, "Done"))));
434
+ h("div", { class: "title" }, states.content.text.rewardRedeemedText),
435
+ h("div", { class: "description" }, intl.formatMessage({
436
+ id: "successMessage",
437
+ defaultMessage: states.content.text.redemptionSuccessText,
438
+ }, {
439
+ sourceValue: (_a = states.selectedItem.prettySourceValue) !== null && _a !== void 0 ? _a : (_b = states.selectedStep) === null || _b === void 0 ? void 0 : _b.prettySourceValue,
440
+ destinationValue: ((_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettyDestinationValue) ||
441
+ states.selectedItem.globalRewardKey,
442
+ })),
443
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (h("div", { style: {
444
+ width: "40%",
445
+ margin: "-30px auto var(--sl-spacing-xxx-large) auto",
446
+ } },
447
+ h(ShareLinkView, { shareString: data.fuelTankCode, tooltiptext: "Copied", open: states.open, onClick: callbacks.copyFuelTankCode }))),
448
+ h("div", { class: sheet.classes.Button },
449
+ h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
424
450
  }
425
451
  const stages = {
426
452
  chooseReward: () => chooseReward(),
@@ -443,25 +469,39 @@ export function RewardExchangeView(props) {
443
469
  h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
444
470
  }
445
471
  function loading() {
446
- return (h("div", { style: {
447
- display: "flex",
448
- height: "400px",
449
- alignItems: "center",
450
- justifyContent: "center",
451
- } },
452
- h("div", { style: { transform: "scale(5)" } },
453
- h("sl-spinner", null))));
472
+ return (h("div", { class: sheet.classes.Grid }, [...Array(8)].map(() => {
473
+ return (h("div", { class: sheet.classes.CardContainer },
474
+ h("sl-card", { class: sheet.classes.Card },
475
+ h("div", { class: sheet.classes.CardLayout },
476
+ h("div", null,
477
+ h("sl-skeleton", { style: {
478
+ width: "100px",
479
+ height: "100px",
480
+ margin: "9px",
481
+ "--border-radius": "4px",
482
+ } })),
483
+ h("div", { style: { margin: "12px 12px 0 0", width: "100%" } },
484
+ h("sl-skeleton", { style: { marginBottom: "12px" } }),
485
+ h("sl-skeleton", { style: { marginBottom: "12px" } }),
486
+ h("sl-skeleton", { style: { width: "45%" } }))))));
487
+ })));
454
488
  }
455
489
  function errorMessage() {
456
490
  return (h("sl-alert", { type: "danger", open: true },
457
491
  h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
458
- "An error occured trying to redeem this reward. Please try again."));
492
+ states.content.text.redemptionError));
493
+ }
494
+ function queryErrorMessage() {
495
+ return (h("sl-alert", { type: "danger", open: true },
496
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
497
+ states.content.text.queryError));
459
498
  }
460
499
  return (h("div", { class: sheet.classes.Container },
461
500
  h("style", { type: "text/css" }, styleString),
462
501
  h("div", null,
463
502
  stageMap(),
464
- states.loading && loading(),
503
+ states.redeemStage === "chooseReward" && states.loading && loading(),
465
504
  states.exchangeError && errorMessage(),
505
+ states.queryError && queryErrorMessage(),
466
506
  currentStage && currentStage())));
467
507
  }