@saasquatch/mint-components 1.5.0-78 → 1.5.0-79

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.
@@ -2098,6 +2098,319 @@ function RewardExchangeView(props) {
2098
2098
  states.redeemStage === "success")));
2099
2099
  }
2100
2100
 
2101
+ const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, error = false, loading = false, fueltank = null) => ({
2102
+ states: {
2103
+ content: {
2104
+ text: {
2105
+ buttonText: "Exchange Rewards",
2106
+ notAvailableError: "{unavailableReasonCode, select, NOT_CHAMPION {CUSTOM ERROR MESSAGE } US_TAX {Exceeds tax limit for this year} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {unavailableReasonCode} }",
2107
+ chooseRewardTitle: "Rewards",
2108
+ chooseAmountTitle: "Select",
2109
+ confirmationTitle: "Confirm",
2110
+ rewardTitle: "Choose a reward",
2111
+ cancelText: "Cancel",
2112
+ backText: "Back",
2113
+ continueText: "Continue",
2114
+ continueToConfirmationText: "Continue to confirmation",
2115
+ redeemText: "Redeem",
2116
+ redeemTitle: "Confirm and redeem",
2117
+ redemptionSuccessText: "Redeemed {sourceValue} for {destinationValue}",
2118
+ doneText: "Done",
2119
+ toolTipText: "Copied!",
2120
+ selectText: "Select amount to receive",
2121
+ sourceAmountMessage: "{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",
2122
+ rewardRedeemedText: "Reward redeemed",
2123
+ redemptionError: "An error occured trying to redeem this reward. Please try again",
2124
+ promoCode: "Promo code",
2125
+ skeletonCardNum: 8,
2126
+ rewardNameTitle: "Reward Name",
2127
+ rewardAmountTitle: "Reward Amount",
2128
+ costTitle: "Cost",
2129
+ },
2130
+ },
2131
+ redeemStage: stage,
2132
+ amount: 0,
2133
+ exchangeError: error,
2134
+ loading: loading,
2135
+ selectedItem: selectedItem,
2136
+ selectedStep: selectedStep,
2137
+ open: false,
2138
+ },
2139
+ data: {
2140
+ exchangeList: data,
2141
+ fuelTankCode: fueltank,
2142
+ },
2143
+ callbacks: {
2144
+ exchangeReward: null,
2145
+ resetState: null,
2146
+ setStage: null,
2147
+ setExchangeState: null,
2148
+ copyFuelTankCode: null,
2149
+ refs: null,
2150
+ },
2151
+ refs: null,
2152
+ });
2153
+ const baseReward = {
2154
+ key: "",
2155
+ name: "",
2156
+ description: "Description of reward. Lorem ipsum dolor sit amet, consectetur adipiscing. Id nec semper sapien dignissim rhoncus nunc.",
2157
+ imageUrl: "",
2158
+ available: true,
2159
+ unavailableReasonCode: null,
2160
+ ruleType: "FIXED_GLOBAL_REWARD",
2161
+ sourceUnit: "POINT",
2162
+ sourceValue: 10,
2163
+ prettySourceValue: "10 SaaSquatch Points",
2164
+ sourceMinValue: null,
2165
+ prettySourceMinValue: null,
2166
+ sourceMaxValue: null,
2167
+ prettySourceMaxValue: null,
2168
+ destinationMinValue: null,
2169
+ prettyDestinationMinValue: null,
2170
+ destinationMaxValue: null,
2171
+ prettyDestinationMaxValue: null,
2172
+ globalRewardKey: "",
2173
+ destinationUnit: null,
2174
+ steps: [],
2175
+ };
2176
+ const notEnoughPoints = {
2177
+ available: false,
2178
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
2179
+ };
2180
+ const usTax = {
2181
+ available: false,
2182
+ unavailableReasonCode: "US_TAX",
2183
+ };
2184
+ const customError = {
2185
+ available: false,
2186
+ unavailableReasonCode: "NOT_CHAMPION",
2187
+ };
2188
+ const selected = {
2189
+ key: "r1",
2190
+ };
2191
+ const imageUrl = (props) => ({
2192
+ imageUrl: props,
2193
+ });
2194
+ const name = (props) => ({
2195
+ name: props,
2196
+ });
2197
+ const fixedValue = (props) => ({
2198
+ prettySourceValue: props,
2199
+ });
2200
+ const variableValue = (min, max, unit) => ({
2201
+ ruleType: "VARIABLE_CREDIT_REWARD",
2202
+ sourceMinValue: min,
2203
+ prettySourceMinValue: min + " " + unit,
2204
+ sourceMaxValue: max,
2205
+ prettySourceMaxValue: max + " " + unit,
2206
+ });
2207
+ const data = [
2208
+ {
2209
+ ...baseReward,
2210
+ ...name("Free swag with a promo code"),
2211
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
2212
+ ...fixedValue("40 SaaSquatch Points"),
2213
+ },
2214
+ {
2215
+ ...baseReward,
2216
+ ...selected,
2217
+ ...name("Visa® Prepaid Card USD"),
2218
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2219
+ ...variableValue(20, 80, "Points"),
2220
+ },
2221
+ {
2222
+ ...baseReward,
2223
+ ...name("A very exclusive gift box"),
2224
+ ...imageUrl("https://i.imgur.com/93BvEgH.png"),
2225
+ ...fixedValue("30 SaaSquatch Points"),
2226
+ },
2227
+ {
2228
+ ...baseReward,
2229
+ ...name("$50 Store credit"),
2230
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
2231
+ ...fixedValue("100 SaaSquatch Points"),
2232
+ },
2233
+ {
2234
+ ...baseReward,
2235
+ ...name("Variable amount of store credit"),
2236
+ ...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
2237
+ ...variableValue(20, 100, "Points"),
2238
+ },
2239
+ {
2240
+ ...baseReward,
2241
+ ...notEnoughPoints,
2242
+ ...name("A very rare cactus"),
2243
+ ...imageUrl("https://i.imgur.com/hhlF2Ey.png"),
2244
+ ...fixedValue("2000 SaaSquatch Points"),
2245
+ },
2246
+ {
2247
+ ...baseReward,
2248
+ ...usTax,
2249
+ ...name("$1000 Store credit with a really super long name in the front page"),
2250
+ ...imageUrl("https://i.imgur.com/y9HSls1.png"),
2251
+ ...fixedValue("2000 SaaSquatch Long Points"),
2252
+ },
2253
+ {
2254
+ ...baseReward,
2255
+ ...notEnoughPoints,
2256
+ ...name("A holiday gift box"),
2257
+ ...imageUrl("https://i.imgur.com/dWEdB3p.png"),
2258
+ ...fixedValue("100 SaaSquatch Points"),
2259
+ },
2260
+ ];
2261
+ const rewardExchange = {
2262
+ ...baseResponse(data),
2263
+ };
2264
+ const rewardExchangeLongText = {
2265
+ ...baseResponse([
2266
+ {
2267
+ ...baseReward,
2268
+ ...notEnoughPoints,
2269
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2270
+ ...imageUrl("https://i.imgur.com/dWEdB3p.png"),
2271
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2272
+ },
2273
+ {
2274
+ ...baseReward,
2275
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2276
+ ...imageUrl("https://i.imgur.com/y9HSls1.png"),
2277
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2278
+ },
2279
+ {
2280
+ ...baseReward,
2281
+ ...name("Suuuuuuuuper aweeeeesssssoooommme reward!!!!!!"),
2282
+ ...imageUrl("https://i.imgur.com/WkCMVSE.png"),
2283
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
2284
+ },
2285
+ ...data,
2286
+ ]),
2287
+ };
2288
+ const rewardExchangeCustomErrorMsg = {
2289
+ ...baseResponse([
2290
+ {
2291
+ ...baseReward,
2292
+ ...customError,
2293
+ ...name("A very rare cactus"),
2294
+ ...imageUrl("https://i.imgur.com/hhlF2Ey.png"),
2295
+ ...fixedValue("2000 SaaSquatch Points"),
2296
+ },
2297
+ ...data,
2298
+ ]),
2299
+ };
2300
+ const rewardExchangeSelected = {
2301
+ ...baseResponse(data, "chooseReward", {
2302
+ ...baseReward,
2303
+ ...selected,
2304
+ ...name("Visa® Prepaid Card USD"),
2305
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2306
+ ...variableValue(20, 80, "Points"),
2307
+ }),
2308
+ };
2309
+ const baseStep = (dst, dstUnit, src, srcUnit, available = true, unavailableReason = null) => ({
2310
+ destinationValue: dst,
2311
+ prettyDestinationValue: dstUnit + dst,
2312
+ sourceValue: src,
2313
+ prettySourceValue: src + " " + srcUnit,
2314
+ available: available,
2315
+ unavailableReasonCode: unavailableReason,
2316
+ });
2317
+ const chooseAmountVariable = {
2318
+ ...baseResponse(data, "chooseAmount", {
2319
+ ...baseReward,
2320
+ ...name("Visa® Prepaid Card USD"),
2321
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2322
+ ...variableValue(20, 80, "Points"),
2323
+ steps: [
2324
+ baseStep(20, "$", 40, "Points"),
2325
+ baseStep(30, "$", 60, "Points"),
2326
+ baseStep(40, "$", 80, "Points"),
2327
+ baseStep(50, "$", 100, "Points"),
2328
+ baseStep(60, "$", 120, "Points"),
2329
+ ],
2330
+ }),
2331
+ };
2332
+ const chooseAmountVariableDisabled = {
2333
+ ...baseResponse(data, "chooseAmount", {
2334
+ ...baseReward,
2335
+ ...name("Visa® Prepaid Card USD"),
2336
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2337
+ ...variableValue(20, 80, "Points"),
2338
+ steps: [
2339
+ baseStep(20, "$", 40, "Points"),
2340
+ baseStep(30, "$", 60, "Points"),
2341
+ baseStep(40, "$", 80, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2342
+ baseStep(50, "$", 100, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2343
+ baseStep(60, "$", 120, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
2344
+ ],
2345
+ }),
2346
+ };
2347
+ const chooseAmountVariableUnavailable = {
2348
+ ...baseResponse(data, "chooseAmount", {
2349
+ ...baseReward,
2350
+ ...name("Visa® Prepaid Card USD"),
2351
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2352
+ ...variableValue(20, 80, "Points"),
2353
+ steps: [
2354
+ baseStep(20, "$", 40, "Points"),
2355
+ baseStep(30, "$", 60, "Points"),
2356
+ baseStep(40, "$", 80, "Points", false, "US_TAX"),
2357
+ baseStep(50, "$", 100, "Points", false, "US_TAX"),
2358
+ baseStep(60, "$", 120, "Points", false, "US_TAX"),
2359
+ ],
2360
+ }),
2361
+ };
2362
+ const chooseAmountFixed = {
2363
+ ...baseResponse(data, "chooseAmount", {
2364
+ ...baseReward,
2365
+ ...name("Free swag with a promo code"),
2366
+ ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
2367
+ ...fixedValue("40 SaaSquatch Points"),
2368
+ }),
2369
+ };
2370
+ const confirmFixed = {
2371
+ ...baseResponse(data, "confirmation", {
2372
+ ...baseReward,
2373
+ ...name("Free swag with a promo code"),
2374
+ ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
2375
+ ...fixedValue("40 SaaSquatch Points"),
2376
+ }),
2377
+ };
2378
+ const confirmVariable = {
2379
+ ...baseResponse(data, "confirmation", {
2380
+ ...baseReward,
2381
+ ...name("Visa® Prepaid Card USD"),
2382
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2383
+ ...variableValue(20, 80, "Points"),
2384
+ }, baseStep(20, "$", 40, "Points")),
2385
+ };
2386
+ const error = {
2387
+ ...baseResponse(data, "confirmation", {
2388
+ ...baseReward,
2389
+ ...name("Visa® Prepaid Card USD"),
2390
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
2391
+ ...variableValue(20, 80, "Points"),
2392
+ }, baseStep(20, "$", 40, "Points"), true),
2393
+ };
2394
+ const success = {
2395
+ ...baseResponse(data, "success", {
2396
+ ...baseReward,
2397
+ ...name("Free swag with a promo code"),
2398
+ ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
2399
+ ...fixedValue("40 SaaSquatch Points"),
2400
+ }, undefined, undefined, undefined, "4ah2-hh46-gk7r"),
2401
+ };
2402
+ const successVariable = {
2403
+ ...baseResponse(data, "success", {
2404
+ ...baseReward,
2405
+ ...name("Visa® Prepaid Card USD"),
2406
+ ...imageUrl("https://i.imgur.com/93BvEgH.png"),
2407
+ ...variableValue(20, 80, "Points"),
2408
+ }, baseStep(20, "$", 40, "Points")),
2409
+ };
2410
+ const loading = {
2411
+ ...baseResponse(null, "chooseReward", null, null, false, true),
2412
+ };
2413
+
2101
2414
  function CardFeedView(props, children) {
2102
2415
  const style = {
2103
2416
  Container: {
@@ -2224,6 +2537,20 @@ exports.ShareButtonView = ShareButtonView;
2224
2537
  exports.ShareLinkView = ShareLinkView;
2225
2538
  exports.TaskCardView = TaskCardView;
2226
2539
  exports.autoColorScaleCss = autoColorScaleCss;
2540
+ exports.chooseAmountFixed = chooseAmountFixed;
2541
+ exports.chooseAmountVariable = chooseAmountVariable;
2542
+ exports.chooseAmountVariableDisabled = chooseAmountVariableDisabled;
2543
+ exports.chooseAmountVariableUnavailable = chooseAmountVariableUnavailable;
2544
+ exports.confirmFixed = confirmFixed;
2545
+ exports.confirmVariable = confirmVariable;
2546
+ exports.error = error;
2547
+ exports.loading = loading;
2548
+ exports.rewardExchange = rewardExchange;
2549
+ exports.rewardExchangeCustomErrorMsg = rewardExchangeCustomErrorMsg;
2550
+ exports.rewardExchangeLongText = rewardExchangeLongText;
2551
+ exports.rewardExchangeSelected = rewardExchangeSelected;
2552
+ exports.success = success;
2553
+ exports.successVariable = successVariable;
2227
2554
  exports.useShareButton = useShareButton;
2228
2555
  exports.useShareLink = useShareLink;
2229
2556
  exports.withShadowView = withShadowView;
@@ -19,7 +19,7 @@ const utils = require('./utils-01dbfd4a.js');
19
19
  require('./sqm-text-span-view-f101dedf.js');
20
20
  const useDemoBigStat = require('./useDemoBigStat-426e3319.js');
21
21
  require('./sqm-portal-container-view-fdfb3656.js');
22
- const ShadowViewAddon = require('./ShadowViewAddon-878ad3f9.js');
22
+ const ShadowViewAddon = require('./ShadowViewAddon-5fef14ad.js');
23
23
  require('./sqm-portal-section-view-186a5f7e.js');
24
24
 
25
25
  /**
@@ -6569,6 +6569,7 @@ function useRewardExchangeListDemo(props) {
6569
6569
  },
6570
6570
  data: {
6571
6571
  shareCode: "SHARECODE123",
6572
+ exchangeList: ShadowViewAddon.rewardExchange.data.exchangeList,
6572
6573
  },
6573
6574
  callbacks: {
6574
6575
  exchangeReward: () => { },