@sendoutcards/quantum-design-ui 1.7.60 → 1.7.61

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/index.es.js CHANGED
@@ -22044,333 +22044,6 @@ var ConfigurationCard = function (_a) {
22044
22044
  }))));
22045
22045
  };
22046
22046
 
22047
- var UpsaleOptions = function (_a) {
22048
- var selectableOptions = _a.selectableOptions,
22049
- selectedOption = _a.selectedOption,
22050
- handleSelectedOption = _a.handleSelectedOption,
22051
- removeSelectedOption = _a.removeSelectedOption,
22052
- showCheckoutView = _a.showCheckoutView,
22053
- handleShouldShowCheckoutView = _a.handleShouldShowCheckoutView,
22054
- children = _a.children,
22055
- activeSelectedOption = _a.activeSelectedOption,
22056
- extraLink = _a.extraLink,
22057
- _b = _a.defaultNumOptionsShown,
22058
- defaultNumOptionsShown = _b === void 0 ? selectableOptions.length : _b,
22059
- submitAction = _a.submitAction;
22060
- var shouldShowCheckoutScreen = selectedOption && showCheckoutView;
22061
- return jsx(Div, {
22062
- height: "100%",
22063
- position: "relative",
22064
- width: "100%"
22065
- }, jsx(Div, null, shouldShowCheckoutScreen && // Back Button
22066
- jsx(Div, {
22067
- outset: {
22068
- top: 'x4'
22069
- },
22070
- position: "relative",
22071
- bottom: "25px",
22072
- right: "7px",
22073
- height: "20px",
22074
- cursor: "pointer",
22075
- onClick: function () {
22076
- removeSelectedOption();
22077
- handleShouldShowCheckoutView(false);
22078
- }
22079
- }, jsx(HStack, {
22080
- gap: "x_25",
22081
- justify: "start",
22082
- alignItems: "center"
22083
- }, jsx(Icon, {
22084
- name: "leftChevron",
22085
- size: "small",
22086
- primaryColor: "primaryBodyText"
22087
- }), jsx(Text, {
22088
- type: 'caption',
22089
- weight: "semiBold",
22090
- color: "primaryBody",
22091
- content: "Back",
22092
- alignment: "center",
22093
- style: {
22094
- position: 'relative',
22095
- bottom: 4
22096
- }
22097
- })), jsx(Spacer, {
22098
- space: "x2"
22099
- })), jsx(VStack, {
22100
- gap: "x2"
22101
- }, shouldShowCheckoutScreen && activeSelectedOption ? jsx(Div, null, jsx(RadioOptionCard, _extends({}, activeSelectedOption, {
22102
- isSelected: true
22103
- })), children) : jsx(VStack, {
22104
- gap: "x2"
22105
- }, selectableOptions.filter(function (_, index) {
22106
- return index < defaultNumOptionsShown;
22107
- }).map(function (option, index) {
22108
- var _a;
22109
-
22110
- return jsx(RadioOptionCard, _extends({}, option, {
22111
- key: index,
22112
- optionId: option.optionId,
22113
- onSelect: function () {
22114
- return handleSelectedOption(option.optionId);
22115
- },
22116
- isSelected: (_a = (activeSelectedOption && selectedOption) === option.optionId) !== null && _a !== void 0 ? _a : false
22117
- }));
22118
- })), extraLink && jsx(Anchor, {
22119
- title: extraLink.title,
22120
- onClick: extraLink.onClick,
22121
- href: extraLink.href,
22122
- size: "small",
22123
- color: "primaryBody",
22124
- outset: "0 auto"
22125
- }), submitAction && jsx(Flex, {
22126
- width: "100%",
22127
- justifyContent: "center",
22128
- alignItems: "center"
22129
- }, jsx(Button, {
22130
- title: submitAction.title,
22131
- type: submitAction.type,
22132
- onClick: submitAction.onClick,
22133
- fullWidth: submitAction.isFullWidth,
22134
- disabled: submitAction.isDisabled,
22135
- size: "large"
22136
- })))));
22137
- };
22138
-
22139
- var SOC_FRONT_Z_INDEX = 103;
22140
- var UpsaleDialog = function (_a) {
22141
- var _b;
22142
-
22143
- var title = _a.title,
22144
- description = _a.description,
22145
- checkoutTitle = _a.checkoutTitle,
22146
- checkoutDescription = _a.checkoutDescription,
22147
- selectableOptions = _a.selectableOptions,
22148
- isOpen = _a.isOpen,
22149
- setIsDialogOpen = _a.setIsDialogOpen,
22150
- upsaleContent = _a.upsaleContent,
22151
- children = _a.children,
22152
- selectedOption = _a.selectedOption,
22153
- handleSelectedOption = _a.handleSelectedOption,
22154
- removeSelectedOption = _a.removeSelectedOption,
22155
- insetOverride = _a.insetOverride,
22156
- maxWidth = _a.maxWidth,
22157
- maxHeight = _a.maxHeight,
22158
- _c = _a.zIndex,
22159
- zIndex = _c === void 0 ? SOC_FRONT_Z_INDEX : _c,
22160
- //Soc-frontend
22161
- successComponent = _a.successComponent,
22162
- upsaleContentTitle = _a.upsaleContentTitle,
22163
- _d = _a.sponsorId,
22164
- sponsorId = _d === void 0 ? '9070' : _d,
22165
- extraLink = _a.extraLink,
22166
- defaultNumOptionsShown = _a.defaultNumOptionsShown,
22167
- submitAction = _a.submitAction,
22168
- acceptSelectedAction = _a.acceptSelectedAction;
22169
-
22170
- var _e = React.useState(false),
22171
- shouldShowCheckoutView = _e[0],
22172
- setShouldShowCheckoutView = _e[1];
22173
-
22174
- var _f = useResizeObserver(),
22175
- ref = _f.ref,
22176
- width = _f.width,
22177
- height = _f.height;
22178
-
22179
- var dialogFooterHeight = '170px';
22180
- var device = useWindowSize().width;
22181
- var isMobile = device <= 910;
22182
-
22183
- var findOption = function (selectedOption) {
22184
- return selectableOptions.filter(function (option) {
22185
- return option.optionId === selectedOption;
22186
- });
22187
- };
22188
-
22189
- var activeSelectedOption = findOption(selectedOption);
22190
-
22191
- var handleOnClick = function () {
22192
- setShouldShowCheckoutView(true);
22193
- acceptSelectedAction === null || acceptSelectedAction === void 0 ? void 0 : acceptSelectedAction.onClick();
22194
- };
22195
-
22196
- return jsx(Dialog, {
22197
- ref: ref,
22198
- isOpen: isOpen,
22199
- onClose: function () {
22200
- return setIsDialogOpen(!isOpen);
22201
- },
22202
- zIndex: zIndex,
22203
- insetOverride: insetOverride,
22204
- maxWidth: maxWidth,
22205
- maxHeight: maxHeight,
22206
- height: isMobile ? 'unset' : '80%',
22207
- shouldScroll: true,
22208
- width: "100%"
22209
- }, successComponent ? jsx(Flex, {
22210
- width: width + "px",
22211
- height: height + "px",
22212
- justifyContent: "center",
22213
- alignItems: 'center'
22214
- }, successComponent) : jsx(React.Fragment, null, jsx(Div, {
22215
- width: "100%",
22216
- inset: {
22217
- bottom: 'x4',
22218
- top: 'x8'
22219
- }
22220
- }, jsx(Text, {
22221
- type: "subtitle",
22222
- weight: "bold",
22223
- content: shouldShowCheckoutView ? checkoutTitle : title,
22224
- alignment: "center"
22225
- }), jsx(Text, {
22226
- type: "body",
22227
- content: shouldShowCheckoutView ? checkoutDescription : description,
22228
- alignment: "center"
22229
- })), jsx(Scrollable, null, jsx(Flex, {
22230
- justifyContent: 'center',
22231
- alignItems: 'flex-start',
22232
- width: '100%',
22233
- inset: device <= 1367 && device > 580 ? {
22234
- top: 'x4',
22235
- horizontal: 'x8',
22236
- bottom: dialogFooterHeight
22237
- } : device <= 580 ? {
22238
- top: 'x4',
22239
- horizontal: 'x4',
22240
- bottom: dialogFooterHeight
22241
- } : {
22242
- top: 'x4',
22243
- horizontal: '10rem',
22244
- bottom: dialogFooterHeight
22245
- },
22246
- flexWrap: "wrap",
22247
- overflowY: "hidden",
22248
- flexDirection: isMobile ? 'column' : 'row'
22249
- }, jsx(Flex, {
22250
- flexWrap: "wrap",
22251
- inset: {
22252
- top: 'x3',
22253
- horizontal: 'x3'
22254
- },
22255
- overflowY: "auto",
22256
- width: isMobile ? '100%' : 'calc(50% - 12px)',
22257
- order: 3
22258
- }, jsx(UpsaleOptions, {
22259
- selectableOptions: selectableOptions,
22260
- selectedOption: selectedOption,
22261
- handleSelectedOption: function (optionId) {
22262
- return handleSelectedOption(optionId);
22263
- },
22264
- removeSelectedOption: removeSelectedOption,
22265
- showCheckoutView: shouldShowCheckoutView,
22266
- handleShouldShowCheckoutView: function (value) {
22267
- return setShouldShowCheckoutView(value);
22268
- },
22269
- activeSelectedOption: activeSelectedOption[0],
22270
- extraLink: {
22271
- title: extraLink === null || extraLink === void 0 ? void 0 : extraLink.title,
22272
- onClick: extraLink === null || extraLink === void 0 ? void 0 : extraLink.onClick,
22273
- href: extraLink === null || extraLink === void 0 ? void 0 : extraLink.href
22274
- },
22275
- defaultNumOptionsShown: defaultNumOptionsShown,
22276
- submitAction: submitAction
22277
- }, children), !shouldShowCheckoutView && jsx(Flex, {
22278
- justifyContent: "center",
22279
- position: isMobile ? 'fixed' : 'relative',
22280
- bottom: isMobile ? '0' : 'unset',
22281
- height: "100px",
22282
- alignItems: "center",
22283
- width: "100%",
22284
- backgroundColor: isMobile ? 'foreground' : undefined,
22285
- boxShadow: isMobile ? 'mediumDark' : undefined,
22286
- left: "0",
22287
- zIndex: isMobile ? 10 : undefined
22288
- }, jsx(Button, {
22289
- type: 'primary',
22290
- size: "large",
22291
- title: (_b = acceptSelectedAction === null || acceptSelectedAction === void 0 ? void 0 : acceptSelectedAction.title) !== null && _b !== void 0 ? _b : 'Continue to Checkout',
22292
- disabled: !selectedOption.length,
22293
- onClick: handleOnClick
22294
- }))), !isMobile && jsx(Div, {
22295
- width: "x3",
22296
- order: 2
22297
- }), jsx(Flex, {
22298
- overflowY: "auto",
22299
- width: isMobile ? '100%' : 'calc(50% - 12px)',
22300
- order: 1
22301
- }, jsx(Div, {
22302
- width: "100%",
22303
- inset: {
22304
- top: '1.4rem'
22305
- }
22306
- }, jsx(Accordion, {
22307
- defaultActiveKeys: [1],
22308
- arrowLocation: "right",
22309
- background: "background",
22310
- inset: "x0",
22311
- isExclusive: true,
22312
- sections: [{
22313
- body: jsx(React.Fragment, null, upsaleContent),
22314
- heading: jsx(Div, {
22315
- inset: isMobile ? {
22316
- left: '4.1rem'
22317
- } : {
22318
- left: 'x4'
22319
- },
22320
- width: "100%",
22321
- display: "flex",
22322
- justifyContent: "space-between",
22323
- alignItems: "center"
22324
- }, jsx(Text, {
22325
- weight: "bold",
22326
- type: "caption",
22327
- content: upsaleContentTitle
22328
- }), jsx(Div, {
22329
- width: "34px",
22330
- height: "34px",
22331
- borderRadius: "small",
22332
- backgroundSize: "cover",
22333
- backgroundPosition: "center",
22334
- outset: {
22335
- right: 'x2'
22336
- }
22337
- })),
22338
- key: 1
22339
- }]
22340
- }))))), jsx(Div, {
22341
- backgroundColor: "foreground",
22342
- width: device <= 1367 ? '100%' : 'calc(100% - 10rem)',
22343
- position: isMobile ? 'relative' : 'absolute',
22344
- bottom: isMobile ? dialogFooterHeight : 'x0',
22345
- inset: isMobile ? 'x1' : {
22346
- bottom: 'x4'
22347
- },
22348
- left: "50%",
22349
- transform: "translateX(-50%)",
22350
- zIndex: !isMobile ? SOC_FRONT_Z_INDEX : undefined
22351
- }, jsx(Separator, {
22352
- orientation: "horizontal",
22353
- caption: "Want to try it first?",
22354
- shouldCaptionWrap: false
22355
- }), jsx(Flex, {
22356
- width: "100%",
22357
- justifyContent: "center",
22358
- alignItems: "center",
22359
- inset: {
22360
- top: 'x2_5'
22361
- }
22362
- }, jsx(Button, {
22363
- type: "secondary",
22364
- outlined: true,
22365
- hover: true,
22366
- size: "medium",
22367
- title: "Send a Free Postcard",
22368
- onClick: function () {
22369
- return window.open("https://www.sendoutcards.com/" + sponsorId + "/send/");
22370
- }
22371
- })))));
22372
- };
22373
-
22374
22047
  var ComparisonIncludesList = function (_a) {
22375
22048
  var items = _a.items,
22376
22049
  isMinified = _a.isMinified;
@@ -23680,55 +23353,383 @@ var comparisonItems97 = [{
23680
23353
  isIncluded: true
23681
23354
  }];
23682
23355
 
23683
- var SubscriptionUpsaleDialog = function (_a) {
23356
+ var SubscriptionUpsaleDialog = function (_a) {
23357
+ var title = _a.title,
23358
+ description = _a.description,
23359
+ checkoutTitle = _a.checkoutTitle,
23360
+ checkoutDescription = _a.checkoutDescription,
23361
+ selectableOptions = _a.selectableOptions,
23362
+ upsaleContentTitle = _a.upsaleContentTitle,
23363
+ isOpen = _a.isOpen,
23364
+ setIsDialogOpen = _a.setIsDialogOpen,
23365
+ _b = _a.optionFormLocation,
23366
+ optionFormLocation = _b === void 0 ? 'right' : _b,
23367
+ children = _a.children,
23368
+ selectedOption = _a.selectedOption,
23369
+ removeSelectedOption = _a.removeSelectedOption,
23370
+ successComponent = _a.successComponent,
23371
+ insetOverride = _a.insetOverride,
23372
+ handleSelectedOption = _a.handleSelectedOption,
23373
+ sponsorId = _a.sponsorId;
23374
+ _a.upsaleContent;
23375
+ var rest = __rest(_a, ["title", "description", "checkoutTitle", "checkoutDescription", "selectableOptions", "upsaleContentTitle", "isOpen", "setIsDialogOpen", "optionFormLocation", "children", "selectedOption", "removeSelectedOption", "successComponent", "insetOverride", "handleSelectedOption", "sponsorId", "upsaleContent"]);
23376
+
23377
+ var device = useWindowSize().width;
23378
+ return jsx("div", null, jsx(UpsaleDialog, _extends({
23379
+ sponsorId: sponsorId,
23380
+ title: title,
23381
+ description: description,
23382
+ checkoutTitle: checkoutTitle,
23383
+ checkoutDescription: checkoutDescription,
23384
+ selectableOptions: selectableOptions,
23385
+ selectedOption: selectedOption,
23386
+ handleSelectedOption: function (optionId) {
23387
+ return handleSelectedOption(optionId);
23388
+ },
23389
+ removeSelectedOption: removeSelectedOption,
23390
+ upsaleContentTitle: upsaleContentTitle,
23391
+ upsaleContent: jsx(ComparisonIncludesList, {
23392
+ isMinified: device <= 1017,
23393
+ items: selectedOption === '324132' //this is the item code for the 37 subscription
23394
+ ? comparisonItems37 : comparisonItems97
23395
+ }),
23396
+ optionFormLocation: optionFormLocation,
23397
+ setIsDialogOpen: function () {
23398
+ return setIsDialogOpen(!isOpen);
23399
+ },
23400
+ isOpen: isOpen,
23401
+ successComponent: successComponent,
23402
+ insetOverride: insetOverride,
23403
+ maxWidth: '1500px'
23404
+ }, rest), children));
23405
+ };
23406
+
23407
+ var UpsaleOptions = function (_a) {
23408
+ var selectableOptions = _a.selectableOptions,
23409
+ selectedOption = _a.selectedOption,
23410
+ handleSelectedOption = _a.handleSelectedOption,
23411
+ removeSelectedOption = _a.removeSelectedOption,
23412
+ showCheckoutView = _a.showCheckoutView,
23413
+ handleShouldShowCheckoutView = _a.handleShouldShowCheckoutView,
23414
+ children = _a.children,
23415
+ activeSelectedOption = _a.activeSelectedOption,
23416
+ extraLink = _a.extraLink,
23417
+ _b = _a.defaultNumOptionsShown,
23418
+ defaultNumOptionsShown = _b === void 0 ? selectableOptions.length : _b,
23419
+ submitAction = _a.submitAction;
23420
+ var shouldShowCheckoutScreen = selectedOption && showCheckoutView;
23421
+ return jsx(Div, {
23422
+ height: "100%",
23423
+ position: "relative",
23424
+ width: "100%"
23425
+ }, jsx(Div, null, shouldShowCheckoutScreen && // Back Button
23426
+ jsx(Div, {
23427
+ outset: {
23428
+ top: 'x4'
23429
+ },
23430
+ position: "relative",
23431
+ bottom: "25px",
23432
+ right: "7px",
23433
+ height: "20px",
23434
+ cursor: "pointer",
23435
+ onClick: function () {
23436
+ removeSelectedOption();
23437
+ handleShouldShowCheckoutView(false);
23438
+ }
23439
+ }, jsx(HStack, {
23440
+ gap: "x_25",
23441
+ justify: "start",
23442
+ alignItems: "center"
23443
+ }, jsx(Icon, {
23444
+ name: "leftChevron",
23445
+ size: "small",
23446
+ primaryColor: "primaryBodyText"
23447
+ }), jsx(Text, {
23448
+ type: 'caption',
23449
+ weight: "semiBold",
23450
+ color: "primaryBody",
23451
+ content: "Back",
23452
+ alignment: "center",
23453
+ style: {
23454
+ position: 'relative',
23455
+ bottom: 4
23456
+ }
23457
+ })), jsx(Spacer, {
23458
+ space: "x2"
23459
+ })), jsx(VStack, {
23460
+ gap: "x2"
23461
+ }, shouldShowCheckoutScreen && activeSelectedOption ? jsx(Div, null, jsx(RadioOptionCard, _extends({}, activeSelectedOption, {
23462
+ isSelected: true
23463
+ })), children) : jsx(VStack, {
23464
+ gap: "x2"
23465
+ }, selectableOptions.filter(function (_, index) {
23466
+ return index < defaultNumOptionsShown;
23467
+ }).map(function (option, index) {
23468
+ var _a;
23469
+
23470
+ return jsx(RadioOptionCard, _extends({}, option, {
23471
+ key: index,
23472
+ optionId: option.optionId,
23473
+ onSelect: function () {
23474
+ return handleSelectedOption(option.optionId);
23475
+ },
23476
+ isSelected: (_a = (activeSelectedOption && selectedOption) === option.optionId) !== null && _a !== void 0 ? _a : false
23477
+ }));
23478
+ })), extraLink && jsx(Anchor, {
23479
+ title: extraLink.title,
23480
+ onClick: extraLink.onClick,
23481
+ href: extraLink.href,
23482
+ size: "small",
23483
+ color: "primaryBody",
23484
+ outset: "0 auto"
23485
+ }), submitAction && jsx(Flex, {
23486
+ width: "100%",
23487
+ justifyContent: "center",
23488
+ alignItems: "center"
23489
+ }, jsx(Button, {
23490
+ title: submitAction.title,
23491
+ type: submitAction.type,
23492
+ onClick: submitAction.onClick,
23493
+ fullWidth: submitAction.isFullWidth,
23494
+ disabled: submitAction.isDisabled,
23495
+ size: "large"
23496
+ })))));
23497
+ };
23498
+
23499
+ var SOC_FRONT_Z_INDEX = 103;
23500
+ var UpsaleDialog = function (_a) {
23501
+ var _b;
23502
+
23684
23503
  var title = _a.title,
23685
23504
  description = _a.description,
23686
23505
  checkoutTitle = _a.checkoutTitle,
23687
23506
  checkoutDescription = _a.checkoutDescription,
23688
23507
  selectableOptions = _a.selectableOptions,
23689
- upsaleContentTitle = _a.upsaleContentTitle,
23690
23508
  isOpen = _a.isOpen,
23691
23509
  setIsDialogOpen = _a.setIsDialogOpen,
23692
- _b = _a.optionFormLocation,
23693
- optionFormLocation = _b === void 0 ? 'right' : _b,
23510
+ upsaleContent = _a.upsaleContent,
23694
23511
  children = _a.children,
23695
23512
  selectedOption = _a.selectedOption,
23513
+ handleSelectedOption = _a.handleSelectedOption,
23696
23514
  removeSelectedOption = _a.removeSelectedOption,
23697
- successComponent = _a.successComponent,
23698
23515
  insetOverride = _a.insetOverride,
23699
- handleSelectedOption = _a.handleSelectedOption,
23700
- sponsorId = _a.sponsorId;
23701
- _a.upsaleContent;
23702
- var rest = __rest(_a, ["title", "description", "checkoutTitle", "checkoutDescription", "selectableOptions", "upsaleContentTitle", "isOpen", "setIsDialogOpen", "optionFormLocation", "children", "selectedOption", "removeSelectedOption", "successComponent", "insetOverride", "handleSelectedOption", "sponsorId", "upsaleContent"]);
23516
+ maxWidth = _a.maxWidth,
23517
+ maxHeight = _a.maxHeight,
23518
+ _c = _a.zIndex,
23519
+ zIndex = _c === void 0 ? SOC_FRONT_Z_INDEX : _c,
23520
+ //Soc-frontend
23521
+ successComponent = _a.successComponent,
23522
+ upsaleContentTitle = _a.upsaleContentTitle,
23523
+ _d = _a.sponsorId,
23524
+ sponsorId = _d === void 0 ? '9070' : _d,
23525
+ extraLink = _a.extraLink,
23526
+ defaultNumOptionsShown = _a.defaultNumOptionsShown,
23527
+ submitAction = _a.submitAction,
23528
+ acceptSelectedAction = _a.acceptSelectedAction,
23529
+ shouldHideSendFreeCard = _a.shouldHideSendFreeCard;
23530
+
23531
+ var _e = React.useState(false),
23532
+ shouldShowCheckoutView = _e[0],
23533
+ setShouldShowCheckoutView = _e[1];
23703
23534
 
23535
+ var _f = useResizeObserver(),
23536
+ ref = _f.ref,
23537
+ width = _f.width,
23538
+ height = _f.height;
23539
+
23540
+ var dialogFooterHeight = shouldHideSendFreeCard ? '120px' : '170px';
23704
23541
  var device = useWindowSize().width;
23705
- return jsx("div", null, jsx(UpsaleDialog, _extends({
23706
- sponsorId: sponsorId,
23707
- title: title,
23708
- description: description,
23709
- checkoutTitle: checkoutTitle,
23710
- checkoutDescription: checkoutDescription,
23542
+ var isMobile = device <= 910;
23543
+
23544
+ var findOption = function (selectedOption) {
23545
+ return selectableOptions.filter(function (option) {
23546
+ return option.optionId === selectedOption;
23547
+ });
23548
+ };
23549
+
23550
+ var activeSelectedOption = findOption(selectedOption);
23551
+
23552
+ var handleOnClick = function () {
23553
+ setShouldShowCheckoutView(true);
23554
+ acceptSelectedAction === null || acceptSelectedAction === void 0 ? void 0 : acceptSelectedAction.onClick();
23555
+ };
23556
+
23557
+ return jsx(Dialog, {
23558
+ ref: ref,
23559
+ isOpen: isOpen,
23560
+ onClose: function () {
23561
+ return setIsDialogOpen(!isOpen);
23562
+ },
23563
+ zIndex: zIndex,
23564
+ insetOverride: insetOverride,
23565
+ maxWidth: maxWidth,
23566
+ maxHeight: maxHeight,
23567
+ height: isMobile ? 'unset' : '80%',
23568
+ shouldScroll: true,
23569
+ width: "100%"
23570
+ }, successComponent ? jsx(Flex, {
23571
+ width: width + "px",
23572
+ height: height + "px",
23573
+ justifyContent: "center",
23574
+ alignItems: 'center'
23575
+ }, successComponent) : jsx(React.Fragment, null, jsx(Div, {
23576
+ width: "100%",
23577
+ inset: {
23578
+ bottom: 'x4',
23579
+ top: 'x8'
23580
+ }
23581
+ }, jsx(Text, {
23582
+ type: "subtitle",
23583
+ weight: "bold",
23584
+ content: shouldShowCheckoutView ? checkoutTitle : title,
23585
+ alignment: "center"
23586
+ }), jsx(Text, {
23587
+ type: "body",
23588
+ content: shouldShowCheckoutView ? checkoutDescription : description,
23589
+ alignment: "center"
23590
+ })), jsx(Scrollable, null, jsx(Flex, {
23591
+ justifyContent: 'center',
23592
+ alignItems: 'flex-start',
23593
+ width: '100%',
23594
+ inset: device <= 1367 && device > 580 ? {
23595
+ top: 'x4',
23596
+ horizontal: 'x8',
23597
+ bottom: dialogFooterHeight
23598
+ } : device <= 580 ? {
23599
+ top: 'x4',
23600
+ horizontal: 'x4',
23601
+ bottom: dialogFooterHeight
23602
+ } : {
23603
+ top: 'x4',
23604
+ horizontal: '10rem',
23605
+ bottom: dialogFooterHeight
23606
+ },
23607
+ flexWrap: "wrap",
23608
+ overflowY: "hidden",
23609
+ flexDirection: isMobile ? 'column' : 'row'
23610
+ }, jsx(Flex, {
23611
+ flexWrap: "wrap",
23612
+ inset: {
23613
+ top: 'x3',
23614
+ horizontal: 'x3'
23615
+ },
23616
+ overflowY: "auto",
23617
+ width: isMobile ? '100%' : 'calc(50% - 12px)',
23618
+ order: 3
23619
+ }, jsx(UpsaleOptions, {
23711
23620
  selectableOptions: selectableOptions,
23712
23621
  selectedOption: selectedOption,
23713
23622
  handleSelectedOption: function (optionId) {
23714
23623
  return handleSelectedOption(optionId);
23715
23624
  },
23716
23625
  removeSelectedOption: removeSelectedOption,
23717
- upsaleContentTitle: upsaleContentTitle,
23718
- upsaleContent: jsx(ComparisonIncludesList, {
23719
- isMinified: device <= 1017,
23720
- items: selectedOption === '324132' //this is the item code for the 37 subscription
23721
- ? comparisonItems37 : comparisonItems97
23722
- }),
23723
- optionFormLocation: optionFormLocation,
23724
- setIsDialogOpen: function () {
23725
- return setIsDialogOpen(!isOpen);
23626
+ showCheckoutView: shouldShowCheckoutView,
23627
+ handleShouldShowCheckoutView: function (value) {
23628
+ return setShouldShowCheckoutView(value);
23726
23629
  },
23727
- isOpen: isOpen,
23728
- successComponent: successComponent,
23729
- insetOverride: insetOverride,
23730
- maxWidth: '1500px'
23731
- }, rest), children));
23630
+ activeSelectedOption: activeSelectedOption[0],
23631
+ extraLink: {
23632
+ title: extraLink === null || extraLink === void 0 ? void 0 : extraLink.title,
23633
+ onClick: extraLink === null || extraLink === void 0 ? void 0 : extraLink.onClick,
23634
+ href: extraLink === null || extraLink === void 0 ? void 0 : extraLink.href
23635
+ },
23636
+ defaultNumOptionsShown: defaultNumOptionsShown,
23637
+ submitAction: submitAction
23638
+ }, children), !shouldShowCheckoutView && jsx(Flex, {
23639
+ justifyContent: "center",
23640
+ position: isMobile ? 'fixed' : 'relative',
23641
+ bottom: isMobile ? '0' : 'unset',
23642
+ height: "100px",
23643
+ alignItems: "center",
23644
+ width: "100%",
23645
+ backgroundColor: isMobile ? 'foreground' : undefined,
23646
+ boxShadow: isMobile ? 'mediumDark' : undefined,
23647
+ left: "0",
23648
+ zIndex: isMobile ? 10 : undefined
23649
+ }, jsx(Button, {
23650
+ type: 'primary',
23651
+ size: "large",
23652
+ title: (_b = acceptSelectedAction === null || acceptSelectedAction === void 0 ? void 0 : acceptSelectedAction.title) !== null && _b !== void 0 ? _b : 'Continue to Checkout',
23653
+ disabled: !selectedOption.length,
23654
+ onClick: handleOnClick
23655
+ }))), !isMobile && jsx(Div, {
23656
+ width: "x3",
23657
+ order: 2
23658
+ }), jsx(Flex, {
23659
+ overflowY: "auto",
23660
+ width: isMobile ? '100%' : 'calc(50% - 12px)',
23661
+ order: 1
23662
+ }, jsx(Div, {
23663
+ width: "100%",
23664
+ inset: {
23665
+ top: '1.4rem'
23666
+ }
23667
+ }, jsx(Accordion, {
23668
+ defaultActiveKeys: [1],
23669
+ arrowLocation: "right",
23670
+ background: "background",
23671
+ inset: "x0",
23672
+ isExclusive: true,
23673
+ sections: [{
23674
+ body: jsx(React.Fragment, null, upsaleContent),
23675
+ heading: jsx(Div, {
23676
+ inset: isMobile ? {
23677
+ left: '4.1rem'
23678
+ } : {
23679
+ left: 'x4'
23680
+ },
23681
+ width: "100%",
23682
+ display: "flex",
23683
+ justifyContent: "space-between",
23684
+ alignItems: "center"
23685
+ }, jsx(Text, {
23686
+ weight: "bold",
23687
+ type: "caption",
23688
+ content: upsaleContentTitle
23689
+ }), jsx(Div, {
23690
+ width: "34px",
23691
+ height: "34px",
23692
+ borderRadius: "small",
23693
+ backgroundSize: "cover",
23694
+ backgroundPosition: "center",
23695
+ outset: {
23696
+ right: 'x2'
23697
+ }
23698
+ })),
23699
+ key: 1
23700
+ }]
23701
+ }))))), !shouldHideSendFreeCard && jsx(Div, {
23702
+ backgroundColor: "foreground",
23703
+ width: device <= 1367 ? '100%' : 'calc(100% - 10rem)',
23704
+ position: isMobile ? 'relative' : 'absolute',
23705
+ bottom: isMobile ? dialogFooterHeight : 'x0',
23706
+ inset: isMobile ? 'x1' : {
23707
+ bottom: 'x4'
23708
+ },
23709
+ left: "50%",
23710
+ transform: "translateX(-50%)",
23711
+ zIndex: !isMobile ? SOC_FRONT_Z_INDEX : undefined
23712
+ }, jsx(Separator, {
23713
+ orientation: "horizontal",
23714
+ caption: "Want to try it first?",
23715
+ shouldCaptionWrap: false
23716
+ }), jsx(Flex, {
23717
+ width: "100%",
23718
+ justifyContent: "center",
23719
+ alignItems: "center",
23720
+ inset: {
23721
+ top: 'x2_5'
23722
+ }
23723
+ }, jsx(Button, {
23724
+ type: "secondary",
23725
+ outlined: true,
23726
+ hover: true,
23727
+ size: "medium",
23728
+ title: "Send a Free Postcard",
23729
+ onClick: function () {
23730
+ return window.open("https://www.sendoutcards.com/" + sponsorId + "/send/");
23731
+ }
23732
+ })))));
23732
23733
  };
23733
23734
 
23734
23735
  var useColorSwatch = function () {
@@ -42,5 +42,4 @@ export * from "../organisms/releaseNoteDialog/releaseNoteDialog";
42
42
  export * from "../organisms/imageUploader/imageUploader";
43
43
  export * from "../organisms/imageUploadWidget/imageUploadWidget";
44
44
  export * from "../organisms/configurationCard/configurationCard";
45
- export * from "../organisms/upsaleDialog/upsaleDialog";
46
45
  export * from "../organisms/comparisonIncludesList/comparisonIncludesList";
@@ -7,3 +7,4 @@ export * from "../portfolios/soc/components/bulkSend/bulkSend";
7
7
  export * from "../portfolios/soc/components/bulkSend/cardQuantitySlider";
8
8
  export * from "../portfolios/soc/components/paperTypeModal/paperTypeModal";
9
9
  export * from "../portfolios/soc/subscriptionUpsaleDialog/subscriptionUpsaleDialog";
10
+ export * from "../portfolios/soc/upsaleDialog/upsaleDialog";
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- import { UpsaleDialogProps } from "../../../exports/organisms";
2
+ import { UpsaleDialogProps } from "../../../exports/socPortfolio";
3
3
  export declare const SubscriptionUpsaleDialog: FC<UpsaleDialogProps>;
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { UpsaleOptionsType, SubmitOptionType } from './upsaleOptions';
3
- import { Responsive, LiteralUnion, HOCSpacingKeys } from "../../helpers/hoc-types/entityValueTypes";
3
+ import { Responsive, LiteralUnion, HOCSpacingKeys } from "../../../helpers/hoc-types/entityValueTypes";
4
4
  export declare type ExtraLinkType = {
5
5
  title: string;
6
6
  onClick?: () => void;
@@ -32,5 +32,6 @@ export declare type UpsaleDialogProps = {
32
32
  defaultNumOptionsShown?: number;
33
33
  submitAction?: SubmitOptionType;
34
34
  acceptSelectedAction?: AcceptSelectedOptionType;
35
+ shouldHideSendFreeCard?: boolean;
35
36
  } & UpsaleOptionsType;
36
37
  export declare const UpsaleDialog: FC<UpsaleDialogProps>;
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from 'react';
2
- import { AnchorProps } from "../../exports/atoms";
3
- import { ButtonType } from "../../exports/molecules";
2
+ import { AnchorProps } from "../../../exports/atoms";
3
+ import { ButtonType } from "../../../exports/molecules";
4
4
  export declare type SubmitOptionType = {
5
5
  title: string;
6
6
  type?: ButtonType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.7.60",
3
+ "version": "1.7.61",
4
4
  "description": "UI component library for Quantum Design System",
5
5
  "module": "dist/index.es.js",
6
6
  "jsnext:main": "dist/index.es.js",