@edx/frontend-plugin-advertisements 2.24.2 → 2.25.0

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 (34) hide show
  1. package/dist/course-exit-upsell/CourseExitUpsell.js +147 -0
  2. package/dist/course-exit-upsell/CourseExitUpsell.js.map +1 -0
  3. package/dist/course-exit-upsell/UpgradeFootnote.js +74 -0
  4. package/dist/course-exit-upsell/UpgradeFootnote.js.map +1 -0
  5. package/dist/course-exit-upsell/index.js +10 -0
  6. package/dist/course-exit-upsell/index.js.map +1 -0
  7. package/dist/course-exit-upsell/messages.js +46 -0
  8. package/dist/course-exit-upsell/messages.js.map +1 -0
  9. package/dist/course-exit-upsell/track.js +124 -0
  10. package/dist/course-exit-upsell/track.js.map +1 -0
  11. package/dist/data/__factories__/extraOffer.factory.js +15 -0
  12. package/dist/data/__factories__/extraOffer.factory.js.map +1 -0
  13. package/dist/data/__factories__/index.js +1 -0
  14. package/dist/data/__factories__/index.js.map +1 -1
  15. package/dist/data/lms_api.js +40 -0
  16. package/dist/data/lms_api.js.map +1 -1
  17. package/dist/index.js +38 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/subscription-upsell/SubscriptionBenefitsModal.js +145 -0
  20. package/dist/subscription-upsell/SubscriptionBenefitsModal.js.map +1 -0
  21. package/dist/subscription-upsell/SubscriptionComparisonModal.js +248 -0
  22. package/dist/subscription-upsell/SubscriptionComparisonModal.js.map +1 -0
  23. package/dist/subscription-upsell/SubscriptionComparisonModal.scss +66 -0
  24. package/dist/subscription-upsell/SubscriptionUpgradeCard.js +193 -0
  25. package/dist/subscription-upsell/SubscriptionUpgradeCard.js.map +1 -0
  26. package/dist/subscription-upsell/SubscriptionUpsell.js +186 -0
  27. package/dist/subscription-upsell/SubscriptionUpsell.js.map +1 -0
  28. package/dist/subscription-upsell/index.js +61 -0
  29. package/dist/subscription-upsell/index.js.map +1 -0
  30. package/dist/subscription-upsell/messages.js +261 -0
  31. package/dist/subscription-upsell/messages.js.map +1 -0
  32. package/dist/subscription-upsell/useSubscriptionOffer.js +80 -0
  33. package/dist/subscription-upsell/useSubscriptionOffer.js.map +1 -0
  34. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "AccessExpirationAlert", {
9
9
  return _accessExpirationAlert.default;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "CourseExitUpsell", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _courseExitUpsell.default;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "DynamicExperienceSlot", {
13
19
  enumerable: true,
14
20
  get: function () {
@@ -33,6 +39,30 @@ Object.defineProperty(exports, "SectionList", {
33
39
  return _sectionOutline.default;
34
40
  }
35
41
  });
42
+ Object.defineProperty(exports, "SubscriptionBenefitsModal", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _subscriptionUpsell.SubscriptionBenefitsModal;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "SubscriptionComparisonModal", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _subscriptionUpsell.SubscriptionComparisonModal;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "SubscriptionUpgradeCard", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _subscriptionUpsell.SubscriptionUpgradeCard;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "SubscriptionUpsell", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _subscriptionUpsell.SubscriptionUpsell;
64
+ }
65
+ });
36
66
  Object.defineProperty(exports, "UclWrapper", {
37
67
  enumerable: true,
38
68
  get: function () {
@@ -57,15 +87,23 @@ Object.defineProperty(exports, "UpsellBullets", {
57
87
  return _generic.UpsellBullets;
58
88
  }
59
89
  });
90
+ Object.defineProperty(exports, "useSubscriptionOffer", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _subscriptionUpsell.useSubscriptionOffer;
94
+ }
95
+ });
60
96
  var _upgradeNotification = _interopRequireDefault(require("./upgrade-notification"));
61
97
  var _paywall = _interopRequireDefault(require("./paywall"));
62
98
  var _upgradeModal = _interopRequireDefault(require("./upgrade-modal"));
63
99
  var _accessExpirationAlert = _interopRequireDefault(require("./access-expiration-alert"));
64
100
  var _upgradeToCompleteAlert = _interopRequireDefault(require("./upgrade-to-complete-alert"));
101
+ var _courseExitUpsell = _interopRequireDefault(require("./course-exit-upsell"));
65
102
  var _generic = require("./generic");
66
103
  var _sectionOutline = _interopRequireDefault(require("./section-outline"));
67
104
  var _dynamicExperienceSlot = _interopRequireDefault(require("./dynamic-experience-slot"));
68
105
  var _uclWrapper = _interopRequireDefault(require("./ucl-wrapper"));
106
+ var _subscriptionUpsell = require("./subscription-upsell");
69
107
  require("./index.scss");
70
108
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
71
109
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_upgradeNotification","_interopRequireDefault","require","_paywall","_upgradeModal","_accessExpirationAlert","_upgradeToCompleteAlert","_generic","_sectionOutline","_dynamicExperienceSlot","_uclWrapper","e","__esModule","default"],"sources":["../src/index.jsx"],"sourcesContent":["import UpgradeNotification from './upgrade-notification';\nimport LockPaywall from './paywall';\nimport NextUnitButton from './upgrade-modal';\nimport AccessExpirationAlert from './access-expiration-alert';\nimport UpgradeToCompleteAlert from './upgrade-to-complete-alert';\nimport { UpsellBullets } from './generic';\nimport SectionList from './section-outline';\nimport DynamicExperienceSlot from './dynamic-experience-slot';\nimport UclWrapper from './ucl-wrapper';\nimport './index.scss';\n\nexport {\n UpgradeNotification,\n LockPaywall,\n NextUnitButton,\n AccessExpirationAlert,\n UpgradeToCompleteAlert,\n UpsellBullets,\n SectionList,\n DynamicExperienceSlot,\n UclWrapper,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,sBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,sBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACAA,OAAA;AAAsB,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_upgradeNotification","_interopRequireDefault","require","_paywall","_upgradeModal","_accessExpirationAlert","_upgradeToCompleteAlert","_courseExitUpsell","_generic","_sectionOutline","_dynamicExperienceSlot","_uclWrapper","_subscriptionUpsell","e","__esModule","default"],"sources":["../src/index.jsx"],"sourcesContent":["import UpgradeNotification from './upgrade-notification';\nimport LockPaywall from './paywall';\nimport NextUnitButton from './upgrade-modal';\nimport AccessExpirationAlert from './access-expiration-alert';\nimport UpgradeToCompleteAlert from './upgrade-to-complete-alert';\nimport CourseExitUpsell from './course-exit-upsell';\nimport { UpsellBullets } from './generic';\nimport SectionList from './section-outline';\nimport DynamicExperienceSlot from './dynamic-experience-slot';\nimport UclWrapper from './ucl-wrapper';\nimport {\n useSubscriptionOffer,\n SubscriptionUpsell,\n SubscriptionUpgradeCard,\n SubscriptionBenefitsModal,\n SubscriptionComparisonModal,\n} from './subscription-upsell';\nimport './index.scss';\n\nexport {\n UpgradeNotification,\n LockPaywall,\n NextUnitButton,\n AccessExpirationAlert,\n UpgradeToCompleteAlert,\n CourseExitUpsell,\n UpsellBullets,\n SectionList,\n DynamicExperienceSlot,\n UclWrapper,\n useSubscriptionOffer,\n SubscriptionUpsell,\n SubscriptionUpgradeCard,\n SubscriptionBenefitsModal,\n SubscriptionComparisonModal,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,sBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,sBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AAOAA,OAAA;AAAsB,SAAAD,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.BENEFITS_MODAL_VARIANT = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _i18n = require("@edx/frontend-platform/i18n");
10
+ var _paragon = require("@openedx/paragon");
11
+ var _icons = require("@openedx/paragon/icons");
12
+ var _useSubscriptionOffer = _interopRequireDefault(require("./useSubscriptionOffer"));
13
+ var _messages = _interopRequireDefault(require("./messages"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ /* eslint import/no-unresolved: 0 */
17
+
18
+ const BENEFITS_MODAL_VARIANT = exports.BENEFITS_MODAL_VARIANT = {
19
+ FREE_TRIAL: 'freeTrial',
20
+ LAUNCH: 'launch'
21
+ };
22
+
23
+ /** The benefits pop-up (Figma 3339-7937 free trial, 3482-70647 launch). Nothing opens it yet. */
24
+ const SubscriptionBenefitsModal = _ref => {
25
+ let {
26
+ courseId,
27
+ isOpen,
28
+ onClose,
29
+ variant,
30
+ onSubscribeClick,
31
+ onPurchaseClick
32
+ } = _ref;
33
+ const {
34
+ formatMessage
35
+ } = (0, _i18n.useIntl)();
36
+ const offer = (0, _useSubscriptionOffer.default)(courseId);
37
+ if (!offer || !offer.canSubscribe) {
38
+ return null;
39
+ }
40
+ const {
41
+ hasTrial,
42
+ purchaseUrl,
43
+ canPurchase,
44
+ coursePrice
45
+ } = offer;
46
+ const isFreeTrial = variant === BENEFITS_MODAL_VARIANT.FREE_TRIAL && hasTrial;
47
+ const title = formatMessage(isFreeTrial ? _messages.default.modalTitleFreeTrial : _messages.default.modalTitleLaunch);
48
+ const ctaVariant = isFreeTrial ? 'primary' : 'brand'; // Figma: dark on free trial, brand on launch
49
+
50
+ const benefits = [{
51
+ key: 'certificates',
52
+ title: formatMessage(_messages.default.benefitCertificatesTitle),
53
+ body: formatMessage(_messages.default.benefitCertificatesBody)
54
+ }, {
55
+ key: 'change-course',
56
+ title: formatMessage(_messages.default.benefitChangeCourseTitle),
57
+ body: formatMessage(_messages.default.benefitChangeCourseBody)
58
+ }, hasTrial && {
59
+ key: 'trial',
60
+ title: formatMessage(_messages.default.benefitTrialTitle),
61
+ body: formatMessage(_messages.default.benefitTrialBody)
62
+ }].filter(Boolean);
63
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog, {
64
+ title: title,
65
+ isOpen: isOpen,
66
+ onClose: onClose,
67
+ size: "lg",
68
+ hasCloseButton: true,
69
+ isFullscreenOnMobile: true,
70
+ isOverflowVisible: false,
71
+ className: "subscription-benefits-modal",
72
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Header, {
73
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
74
+ className: "font-weight-bold mb-2",
75
+ "data-testid": "subscription-modal-brand",
76
+ children: formatMessage(_messages.default.brand)
77
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Title, {
78
+ as: "h2",
79
+ children: title
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
81
+ className: "mt-2 mb-0",
82
+ children: formatMessage(_messages.default.modalSubtitle)
83
+ })]
84
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Body, {
85
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
86
+ className: "list-unstyled bg-white rounded p-4 mb-0",
87
+ children: benefits.map(benefit => /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
88
+ className: "d-flex mb-3",
89
+ "data-testid": `subscription-modal-benefit-${benefit.key}`,
90
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Icon, {
91
+ src: _icons.CheckCircleOutline,
92
+ className: "mr-2 flex-shrink-0"
93
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
94
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
95
+ className: "font-weight-bold",
96
+ children: benefit.title
97
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
98
+ children: benefit.body
99
+ })]
100
+ })]
101
+ }, benefit.key))
102
+ })
103
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Footer, {
104
+ className: "flex-column align-items-end",
105
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ActionRow, {
106
+ children: [canPurchase && /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
107
+ as: "a",
108
+ href: purchaseUrl,
109
+ variant: `outline-${ctaVariant}`,
110
+ onClick: onPurchaseClick,
111
+ "data-testid": "subscription-modal-purchase-button",
112
+ children: coursePrice ? formatMessage(_messages.default.earnCertificateFor, {
113
+ price: coursePrice
114
+ }) : formatMessage(_messages.default.purchaseNoPrice)
115
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
116
+ as: "a",
117
+ href: offer.subscribeUrl,
118
+ variant: ctaVariant,
119
+ onClick: onSubscribeClick,
120
+ "data-testid": "subscription-modal-subscribe-button",
121
+ children: formatMessage(_messages.default.continueToCheckout)
122
+ })]
123
+ }), isFreeTrial && /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
124
+ className: "mt-1",
125
+ "data-testid": "subscription-modal-cancel-anytime",
126
+ children: formatMessage(_messages.default.cancelAnytime)
127
+ })]
128
+ })]
129
+ });
130
+ };
131
+ SubscriptionBenefitsModal.propTypes = {
132
+ courseId: _propTypes.default.string.isRequired,
133
+ isOpen: _propTypes.default.bool.isRequired,
134
+ onClose: _propTypes.default.func.isRequired,
135
+ variant: _propTypes.default.oneOf(Object.values(BENEFITS_MODAL_VARIANT)),
136
+ onSubscribeClick: _propTypes.default.func,
137
+ onPurchaseClick: _propTypes.default.func
138
+ };
139
+ SubscriptionBenefitsModal.defaultProps = {
140
+ variant: BENEFITS_MODAL_VARIANT.LAUNCH,
141
+ onSubscribeClick: undefined,
142
+ onPurchaseClick: undefined
143
+ };
144
+ var _default = exports.default = SubscriptionBenefitsModal;
145
+ //# sourceMappingURL=SubscriptionBenefitsModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionBenefitsModal.js","names":["_react","_interopRequireDefault","require","_propTypes","_i18n","_paragon","_icons","_useSubscriptionOffer","_messages","_jsxRuntime","e","__esModule","default","BENEFITS_MODAL_VARIANT","exports","FREE_TRIAL","LAUNCH","SubscriptionBenefitsModal","_ref","courseId","isOpen","onClose","variant","onSubscribeClick","onPurchaseClick","formatMessage","useIntl","offer","useSubscriptionOffer","canSubscribe","hasTrial","purchaseUrl","canPurchase","coursePrice","isFreeTrial","title","messages","modalTitleFreeTrial","modalTitleLaunch","ctaVariant","benefits","key","benefitCertificatesTitle","body","benefitCertificatesBody","benefitChangeCourseTitle","benefitChangeCourseBody","benefitTrialTitle","benefitTrialBody","filter","Boolean","jsxs","ModalDialog","size","hasCloseButton","isFullscreenOnMobile","isOverflowVisible","className","children","Header","jsx","brand","Title","as","modalSubtitle","Body","map","benefit","Icon","src","CheckCircleOutline","Footer","ActionRow","Button","href","onClick","earnCertificateFor","price","purchaseNoPrice","subscribeUrl","continueToCheckout","cancelAnytime","propTypes","PropTypes","string","isRequired","bool","func","oneOf","Object","values","defaultProps","undefined","_default"],"sources":["../../src/subscription-upsell/SubscriptionBenefitsModal.jsx"],"sourcesContent":["/* eslint import/no-unresolved: 0 */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport {\n ActionRow, Button, Icon, ModalDialog,\n} from '@openedx/paragon';\nimport { CheckCircleOutline } from '@openedx/paragon/icons';\n\nimport useSubscriptionOffer from './useSubscriptionOffer';\nimport messages from './messages';\n\nexport const BENEFITS_MODAL_VARIANT = {\n FREE_TRIAL: 'freeTrial',\n LAUNCH: 'launch',\n};\n\n/** The benefits pop-up (Figma 3339-7937 free trial, 3482-70647 launch). Nothing opens it yet. */\nconst SubscriptionBenefitsModal = ({\n courseId,\n isOpen,\n onClose,\n variant,\n onSubscribeClick,\n onPurchaseClick,\n}) => {\n const { formatMessage } = useIntl();\n const offer = useSubscriptionOffer(courseId);\n\n if (!offer || !offer.canSubscribe) {\n return null;\n }\n\n const {\n hasTrial, purchaseUrl, canPurchase, coursePrice,\n } = offer;\n const isFreeTrial = variant === BENEFITS_MODAL_VARIANT.FREE_TRIAL && hasTrial;\n const title = formatMessage(isFreeTrial ? messages.modalTitleFreeTrial : messages.modalTitleLaunch);\n const ctaVariant = isFreeTrial ? 'primary' : 'brand'; // Figma: dark on free trial, brand on launch\n\n const benefits = [\n {\n key: 'certificates',\n title: formatMessage(messages.benefitCertificatesTitle),\n body: formatMessage(messages.benefitCertificatesBody),\n },\n {\n key: 'change-course',\n title: formatMessage(messages.benefitChangeCourseTitle),\n body: formatMessage(messages.benefitChangeCourseBody),\n },\n hasTrial && {\n key: 'trial',\n title: formatMessage(messages.benefitTrialTitle),\n body: formatMessage(messages.benefitTrialBody),\n },\n ].filter(Boolean);\n\n return (\n <ModalDialog\n title={title}\n isOpen={isOpen}\n onClose={onClose}\n size=\"lg\"\n hasCloseButton\n isFullscreenOnMobile\n isOverflowVisible={false}\n className=\"subscription-benefits-modal\"\n >\n <ModalDialog.Header>\n <p className=\"font-weight-bold mb-2\" data-testid=\"subscription-modal-brand\">{formatMessage(messages.brand)}</p>\n <ModalDialog.Title as=\"h2\">{title}</ModalDialog.Title>\n <p className=\"mt-2 mb-0\">{formatMessage(messages.modalSubtitle)}</p>\n </ModalDialog.Header>\n <ModalDialog.Body>\n <ul className=\"list-unstyled bg-white rounded p-4 mb-0\">\n {benefits.map((benefit) => (\n <li key={benefit.key} className=\"d-flex mb-3\" data-testid={`subscription-modal-benefit-${benefit.key}`}>\n <Icon src={CheckCircleOutline} className=\"mr-2 flex-shrink-0\" />\n <div>\n <div className=\"font-weight-bold\">{benefit.title}</div>\n <div>{benefit.body}</div>\n </div>\n </li>\n ))}\n </ul>\n </ModalDialog.Body>\n <ModalDialog.Footer className=\"flex-column align-items-end\">\n <ActionRow>\n {canPurchase && (\n <Button\n as=\"a\"\n href={purchaseUrl}\n variant={`outline-${ctaVariant}`}\n onClick={onPurchaseClick}\n data-testid=\"subscription-modal-purchase-button\"\n >\n {coursePrice\n ? formatMessage(messages.earnCertificateFor, { price: coursePrice })\n : formatMessage(messages.purchaseNoPrice)}\n </Button>\n )}\n <Button\n as=\"a\"\n href={offer.subscribeUrl}\n variant={ctaVariant}\n onClick={onSubscribeClick}\n data-testid=\"subscription-modal-subscribe-button\"\n >\n {formatMessage(messages.continueToCheckout)}\n </Button>\n </ActionRow>\n {isFreeTrial && (\n <small className=\"mt-1\" data-testid=\"subscription-modal-cancel-anytime\">{formatMessage(messages.cancelAnytime)}</small>\n )}\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nSubscriptionBenefitsModal.propTypes = {\n courseId: PropTypes.string.isRequired,\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n variant: PropTypes.oneOf(Object.values(BENEFITS_MODAL_VARIANT)),\n onSubscribeClick: PropTypes.func,\n onPurchaseClick: PropTypes.func,\n};\n\nSubscriptionBenefitsModal.defaultProps = {\n variant: BENEFITS_MODAL_VARIANT.LAUNCH,\n onSubscribeClick: undefined,\n onPurchaseClick: undefined,\n};\n\nexport default SubscriptionBenefitsModal;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAGA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,qBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAkC,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAVlC;;AAYO,MAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACpCE,UAAU,EAAE,WAAW;EACvBC,MAAM,EAAE;AACV,CAAC;;AAED;AACA,MAAMC,yBAAyB,GAAGC,IAAA,IAO5B;EAAA,IAP6B;IACjCC,QAAQ;IACRC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,gBAAgB;IAChBC;EAC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AAY,mCAAmC;QAAAC,QAAA,EAAEjC,aAAa,CAACW,iBAAQ,CAAC6C,aAAa;MAAC,CAAQ,CACvH;IAAA,CACiB,CAAC;EAAA,CACV,CAAC;AAElB,CAAC;AAEDhE,yBAAyB,CAACiE,SAAS,GAAG;EACpC/D,QAAQ,EAAEgE,kBAAS,CAACC,MAAM,CAACC,UAAU;EACrCjE,MAAM,EAAE+D,kBAAS,CAACG,IAAI,CAACD,UAAU;EACjChE,OAAO,EAAE8D,kBAAS,CAACI,IAAI,CAACF,UAAU;EAClC/D,OAAO,EAAE6D,kBAAS,CAACK,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC7E,sBAAsB,CAAC,CAAC;EAC/DU,gBAAgB,EAAE4D,kBAAS,CAACI,IAAI;EAChC/D,eAAe,EAAE2D,kBAAS,CAACI;AAC7B,CAAC;AAEDtE,yBAAyB,CAAC0E,YAAY,GAAG;EACvCrE,OAAO,EAAET,sBAAsB,CAACG,MAAM;EACtCO,gBAAgB,EAAEqE,SAAS;EAC3BpE,eAAe,EAAEoE;AACnB,CAAC;AAAC,IAAAC,QAAA,GAAA/E,OAAA,CAAAF,OAAA,GAEaK,yBAAyB","ignoreList":[]}
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _i18n = require("@edx/frontend-platform/i18n");
11
+ var _paragon = require("@openedx/paragon");
12
+ var _icons = require("@openedx/paragon/icons");
13
+ var _useSubscriptionOffer = _interopRequireDefault(require("./useSubscriptionOffer"));
14
+ var _messages = _interopRequireDefault(require("./messages"));
15
+ require("./SubscriptionComparisonModal.scss");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ /* eslint import/no-unresolved: 0 */
20
+
21
+ const SUBSCRIBE = 'subscribe';
22
+ const BUY = 'buy';
23
+
24
+ /** Subscribe vs Buy course pop-up (Figma 3339-8172); one column at a time on small screens. */
25
+ const SubscriptionComparisonModal = _ref => {
26
+ let {
27
+ courseId,
28
+ isOpen,
29
+ onClose,
30
+ onSubscribeClick,
31
+ onPurchaseClick
32
+ } = _ref;
33
+ const {
34
+ formatMessage
35
+ } = (0, _i18n.useIntl)();
36
+ const offer = (0, _useSubscriptionOffer.default)(courseId);
37
+ const isSmallScreen = (0, _paragon.useWindowSize)().width < _paragon.breakpoints.medium.minWidth;
38
+ const [activePlan, setActivePlan] = (0, _react.useState)(SUBSCRIBE);
39
+ if (!offer || !offer.canSubscribe) {
40
+ return null;
41
+ }
42
+ const {
43
+ hasTrial,
44
+ purchaseUrl,
45
+ canPurchase,
46
+ coursePrice,
47
+ subscribePrice
48
+ } = offer;
49
+ const included = /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Icon, {
50
+ src: _icons.CheckCircle,
51
+ screenReaderText: formatMessage(_messages.default.includedAlt)
52
+ });
53
+ const notIncluded = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
54
+ className: "sr-only",
55
+ children: formatMessage(_messages.default.notIncludedAlt)
56
+ });
57
+ const cell = value => {
58
+ if (value === true) {
59
+ return included;
60
+ }
61
+ if (value === false) {
62
+ return notIncluded;
63
+ }
64
+ return value || null;
65
+ };
66
+ const subscribePriceCell = subscribePrice && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
+ className: "font-weight-bold",
68
+ children: subscribePrice
69
+ });
70
+ const buyPriceCell = coursePrice && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
71
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
+ className: "font-weight-bold",
73
+ children: coursePrice
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
75
+ children: formatMessage(_messages.default.oneTimePurchase)
76
+ })]
77
+ });
78
+ const rows = [{
79
+ key: 'price',
80
+ label: formatMessage(_messages.default.rowPrice),
81
+ [SUBSCRIBE]: subscribePriceCell,
82
+ [BUY]: buyPriceCell
83
+ }, {
84
+ key: 'unlimited-access',
85
+ label: formatMessage(_messages.default.featureUnlimitedAccess),
86
+ [SUBSCRIBE]: true,
87
+ [BUY]: true
88
+ }, {
89
+ key: 'certificates',
90
+ label: formatMessage(_messages.default.rowEarnCertificates),
91
+ [SUBSCRIBE]: formatMessage(_messages.default.certificatesUnlimited),
92
+ [BUY]: formatMessage(_messages.default.certificatesOne)
93
+ }, {
94
+ key: 'graded-assignments',
95
+ label: formatMessage(_messages.default.featureGradedAssignments),
96
+ [SUBSCRIBE]: true,
97
+ [BUY]: true
98
+ }, {
99
+ key: 'change-courses',
100
+ label: formatMessage(_messages.default.featureChangeCourses),
101
+ [SUBSCRIBE]: true,
102
+ [BUY]: false
103
+ }, {
104
+ key: 'cancel-anytime',
105
+ label: formatMessage(_messages.default.cancelAnytime),
106
+ [SUBSCRIBE]: true,
107
+ [BUY]: false
108
+ }, hasTrial && {
109
+ key: 'free-trial',
110
+ label: formatMessage(_messages.default.featureFreeTrial),
111
+ [SUBSCRIBE]: true,
112
+ [BUY]: false
113
+ }].filter(Boolean);
114
+ const plans = [{
115
+ key: SUBSCRIBE,
116
+ name: formatMessage(_messages.default.subscribeColumn),
117
+ className: 'plan-subscribe'
118
+ }, canPurchase && {
119
+ key: BUY,
120
+ name: formatMessage(_messages.default.buyCourseColumn),
121
+ className: 'plan-buy'
122
+ }].filter(Boolean);
123
+ // The selected plan can vanish, e.g. Buy was selected and the course lost its purchase link.
124
+ const activeKey = plans.some(plan => plan.key === activePlan) ? activePlan : plans[0].key;
125
+ const visiblePlans = isSmallScreen ? plans.filter(plan => plan.key === activeKey) : plans;
126
+ const activeIndex = plans.findIndex(plan => plan.key === activeKey);
127
+ const showPlanAt = index => setActivePlan(plans[(index + plans.length) % plans.length].key);
128
+ const title = formatMessage(_messages.default.comparisonTitle);
129
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog, {
130
+ title: title,
131
+ isOpen: isOpen,
132
+ onClose: onClose,
133
+ size: "lg",
134
+ hasCloseButton: true,
135
+ isFullscreenOnMobile: true,
136
+ isOverflowVisible: false,
137
+ className: "subscription-comparison-modal",
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Header, {
139
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Title, {
140
+ as: "h2",
141
+ children: title
142
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
143
+ className: "mt-2 mb-0",
144
+ children: formatMessage(_messages.default.comparisonSubtitle)
145
+ })]
146
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Body, {
147
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
148
+ className: "w-100 text-center subscription-comparison-table",
149
+ "data-testid": "subscription-comparison-table",
150
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
151
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
152
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
153
+ scope: "col",
154
+ className: "feature-header",
155
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
156
+ className: "sr-only",
157
+ children: formatMessage(_messages.default.featureColumn)
158
+ })
159
+ }), visiblePlans.map(plan => /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
160
+ scope: "col",
161
+ className: plan.className,
162
+ "data-testid": `subscription-comparison-header-${plan.key}`,
163
+ children: plan.name
164
+ }, plan.key))]
165
+ })
166
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
167
+ children: rows.map(row => /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
168
+ "data-testid": `subscription-comparison-row-${row.key}`,
169
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
170
+ scope: "row",
171
+ className: "feature-cell",
172
+ children: row.label
173
+ }), visiblePlans.map(plan => /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
174
+ className: plan.className,
175
+ "data-testid": `subscription-comparison-cell-${row.key}-${plan.key}`,
176
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
177
+ className: "center-items flex-column",
178
+ children: cell(row[plan.key])
179
+ })
180
+ }, plan.key))]
181
+ }, row.key))
182
+ })]
183
+ }), isSmallScreen && plans.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
184
+ className: "d-flex align-items-center justify-content-center mt-3",
185
+ "data-testid": "subscription-comparison-controls",
186
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.IconButton, {
187
+ src: _icons.ChevronLeft,
188
+ iconAs: _paragon.Icon,
189
+ alt: formatMessage(_messages.default.previousPlan),
190
+ onClick: () => showPlanAt(activeIndex - 1)
191
+ }), plans.map(plan => /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
192
+ type: "button",
193
+ className: (0, _classnames.default)('btn btn-link p-1', {
194
+ 'font-weight-bold': plan.key === activeKey
195
+ }),
196
+ "aria-pressed": plan.key === activeKey,
197
+ "aria-label": formatMessage(_messages.default.showPlan, {
198
+ plan: plan.name
199
+ }),
200
+ onClick: () => setActivePlan(plan.key),
201
+ children: plan.key === activeKey ? '●' : '○'
202
+ }, plan.key)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.IconButton, {
203
+ src: _icons.ChevronRight,
204
+ iconAs: _paragon.Icon,
205
+ alt: formatMessage(_messages.default.nextPlan),
206
+ onClick: () => showPlanAt(activeIndex + 1)
207
+ })]
208
+ })]
209
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Footer, {
210
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ActionRow, {
211
+ className: (0, _classnames.default)({
212
+ 'subscription-comparison-actions-stacked': isSmallScreen
213
+ }),
214
+ "data-testid": "subscription-comparison-actions",
215
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
216
+ as: "a",
217
+ href: offer.subscribeUrl,
218
+ variant: "primary",
219
+ onClick: onSubscribeClick,
220
+ "data-testid": "subscription-comparison-subscribe-button",
221
+ children: formatMessage(hasTrial ? _messages.default.startFreeTrial : _messages.default.subscribe)
222
+ }), canPurchase && /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
223
+ as: "a",
224
+ href: purchaseUrl,
225
+ variant: "outline-primary",
226
+ onClick: onPurchaseClick,
227
+ "data-testid": "subscription-comparison-purchase-button",
228
+ children: coursePrice ? formatMessage(_messages.default.buyFor, {
229
+ price: coursePrice
230
+ }) : formatMessage(_messages.default.purchaseNoPrice)
231
+ })]
232
+ })
233
+ })]
234
+ });
235
+ };
236
+ SubscriptionComparisonModal.propTypes = {
237
+ courseId: _propTypes.default.string.isRequired,
238
+ isOpen: _propTypes.default.bool.isRequired,
239
+ onClose: _propTypes.default.func.isRequired,
240
+ onSubscribeClick: _propTypes.default.func,
241
+ onPurchaseClick: _propTypes.default.func
242
+ };
243
+ SubscriptionComparisonModal.defaultProps = {
244
+ onSubscribeClick: undefined,
245
+ onPurchaseClick: undefined
246
+ };
247
+ var _default = exports.default = SubscriptionComparisonModal;
248
+ //# sourceMappingURL=SubscriptionComparisonModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionComparisonModal.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_i18n","_paragon","_icons","_useSubscriptionOffer","_messages","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SUBSCRIBE","BUY","SubscriptionComparisonModal","_ref","courseId","isOpen","onClose","onSubscribeClick","onPurchaseClick","formatMessage","useIntl","offer","useSubscriptionOffer","isSmallScreen","useWindowSize","width","breakpoints","medium","minWidth","activePlan","setActivePlan","useState","canSubscribe","hasTrial","purchaseUrl","canPurchase","coursePrice","subscribePrice","included","jsx","Icon","src","CheckCircle","screenReaderText","messages","includedAlt","notIncluded","className","children","notIncludedAlt","cell","value","subscribePriceCell","buyPriceCell","jsxs","Fragment","oneTimePurchase","rows","key","label","rowPrice","featureUnlimitedAccess","rowEarnCertificates","certificatesUnlimited","certificatesOne","featureGradedAssignments","featureChangeCourses","cancelAnytime","featureFreeTrial","filter","Boolean","plans","name","subscribeColumn","buyCourseColumn","activeKey","some","plan","visiblePlans","activeIndex","findIndex","showPlanAt","index","length","title","comparisonTitle","ModalDialog","size","hasCloseButton","isFullscreenOnMobile","isOverflowVisible","Header","Title","as","comparisonSubtitle","Body","scope","featureColumn","map","row","IconButton","ChevronLeft","iconAs","alt","previousPlan","onClick","type","classNames","showPlan","ChevronRight","nextPlan","Footer","ActionRow","Button","href","subscribeUrl","variant","startFreeTrial","subscribe","buyFor","price","purchaseNoPrice","propTypes","PropTypes","string","isRequired","bool","func","defaultProps","undefined","_default","exports"],"sources":["../../src/subscription-upsell/SubscriptionComparisonModal.jsx"],"sourcesContent":["/* eslint import/no-unresolved: 0 */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport {\n ActionRow, breakpoints, Button, Icon, IconButton, ModalDialog, useWindowSize,\n} from '@openedx/paragon';\nimport { ChevronLeft, ChevronRight, CheckCircle } from '@openedx/paragon/icons';\n\nimport useSubscriptionOffer from './useSubscriptionOffer';\nimport messages from './messages';\nimport './SubscriptionComparisonModal.scss';\n\nconst SUBSCRIBE = 'subscribe';\nconst BUY = 'buy';\n\n/** Subscribe vs Buy course pop-up (Figma 3339-8172); one column at a time on small screens. */\nconst SubscriptionComparisonModal = ({\n courseId,\n isOpen,\n onClose,\n onSubscribeClick,\n onPurchaseClick,\n}) => {\n const { formatMessage } = useIntl();\n const offer = useSubscriptionOffer(courseId);\n const isSmallScreen = useWindowSize().width < breakpoints.medium.minWidth;\n const [activePlan, setActivePlan] = useState(SUBSCRIBE);\n\n if (!offer || !offer.canSubscribe) {\n return null;\n }\n\n const {\n hasTrial, purchaseUrl, canPurchase, coursePrice, subscribePrice,\n } = offer;\n\n const included = <Icon src={CheckCircle} screenReaderText={formatMessage(messages.includedAlt)} />;\n const notIncluded = <span className=\"sr-only\">{formatMessage(messages.notIncludedAlt)}</span>;\n const cell = (value) => {\n if (value === true) { return included; }\n if (value === false) { return notIncluded; }\n return value || null;\n };\n\n const subscribePriceCell = subscribePrice && <div className=\"font-weight-bold\">{subscribePrice}</div>;\n const buyPriceCell = coursePrice && (\n <>\n <div className=\"font-weight-bold\">{coursePrice}</div>\n <small>{formatMessage(messages.oneTimePurchase)}</small>\n </>\n );\n\n const rows = [\n {\n key: 'price', label: formatMessage(messages.rowPrice), [SUBSCRIBE]: subscribePriceCell, [BUY]: buyPriceCell,\n },\n {\n key: 'unlimited-access', label: formatMessage(messages.featureUnlimitedAccess), [SUBSCRIBE]: true, [BUY]: true,\n },\n {\n key: 'certificates',\n label: formatMessage(messages.rowEarnCertificates),\n [SUBSCRIBE]: formatMessage(messages.certificatesUnlimited),\n [BUY]: formatMessage(messages.certificatesOne),\n },\n {\n key: 'graded-assignments', label: formatMessage(messages.featureGradedAssignments), [SUBSCRIBE]: true, [BUY]: true,\n },\n {\n key: 'change-courses', label: formatMessage(messages.featureChangeCourses), [SUBSCRIBE]: true, [BUY]: false,\n },\n {\n key: 'cancel-anytime', label: formatMessage(messages.cancelAnytime), [SUBSCRIBE]: true, [BUY]: false,\n },\n hasTrial && {\n key: 'free-trial', label: formatMessage(messages.featureFreeTrial), [SUBSCRIBE]: true, [BUY]: false,\n },\n ].filter(Boolean);\n\n const plans = [\n { key: SUBSCRIBE, name: formatMessage(messages.subscribeColumn), className: 'plan-subscribe' },\n canPurchase && { key: BUY, name: formatMessage(messages.buyCourseColumn), className: 'plan-buy' },\n ].filter(Boolean);\n // The selected plan can vanish, e.g. Buy was selected and the course lost its purchase link.\n const activeKey = plans.some((plan) => plan.key === activePlan) ? activePlan : plans[0].key;\n const visiblePlans = isSmallScreen ? plans.filter((plan) => plan.key === activeKey) : plans;\n const activeIndex = plans.findIndex((plan) => plan.key === activeKey);\n const showPlanAt = (index) => setActivePlan(plans[(index + plans.length) % plans.length].key);\n\n const title = formatMessage(messages.comparisonTitle);\n\n return (\n <ModalDialog\n title={title}\n isOpen={isOpen}\n onClose={onClose}\n size=\"lg\"\n hasCloseButton\n isFullscreenOnMobile\n isOverflowVisible={false}\n className=\"subscription-comparison-modal\"\n >\n <ModalDialog.Header>\n <ModalDialog.Title as=\"h2\">{title}</ModalDialog.Title>\n <p className=\"mt-2 mb-0\">{formatMessage(messages.comparisonSubtitle)}</p>\n </ModalDialog.Header>\n <ModalDialog.Body>\n <table className=\"w-100 text-center subscription-comparison-table\" data-testid=\"subscription-comparison-table\">\n <thead>\n <tr>\n <th scope=\"col\" className=\"feature-header\"><span className=\"sr-only\">{formatMessage(messages.featureColumn)}</span></th>\n {visiblePlans.map((plan) => (\n <th scope=\"col\" key={plan.key} className={plan.className} data-testid={`subscription-comparison-header-${plan.key}`}>\n {plan.name}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row) => (\n <tr key={row.key} data-testid={`subscription-comparison-row-${row.key}`}>\n <th scope=\"row\" className=\"feature-cell\">{row.label}</th>\n {visiblePlans.map((plan) => (\n <td key={plan.key} className={plan.className} data-testid={`subscription-comparison-cell-${row.key}-${plan.key}`}>\n <div className=\"center-items flex-column\">{cell(row[plan.key])}</div>\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n {isSmallScreen && plans.length > 1 && (\n <div className=\"d-flex align-items-center justify-content-center mt-3\" data-testid=\"subscription-comparison-controls\">\n <IconButton\n src={ChevronLeft}\n iconAs={Icon}\n alt={formatMessage(messages.previousPlan)}\n onClick={() => showPlanAt(activeIndex - 1)}\n />\n {plans.map((plan) => (\n <button\n type=\"button\"\n key={plan.key}\n className={classNames('btn btn-link p-1', { 'font-weight-bold': plan.key === activeKey })}\n aria-pressed={plan.key === activeKey}\n aria-label={formatMessage(messages.showPlan, { plan: plan.name })}\n onClick={() => setActivePlan(plan.key)}\n >\n {plan.key === activeKey ? '●' : '○'}\n </button>\n ))}\n <IconButton\n src={ChevronRight}\n iconAs={Icon}\n alt={formatMessage(messages.nextPlan)}\n onClick={() => showPlanAt(activeIndex + 1)}\n />\n </div>\n )}\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <ActionRow\n className={classNames({ 'subscription-comparison-actions-stacked': isSmallScreen })}\n data-testid=\"subscription-comparison-actions\"\n >\n <Button\n as=\"a\"\n href={offer.subscribeUrl}\n variant=\"primary\"\n onClick={onSubscribeClick}\n data-testid=\"subscription-comparison-subscribe-button\"\n >\n {formatMessage(hasTrial ? messages.startFreeTrial : messages.subscribe)}\n </Button>\n {canPurchase && (\n <Button\n as=\"a\"\n href={purchaseUrl}\n variant=\"outline-primary\"\n onClick={onPurchaseClick}\n data-testid=\"subscription-comparison-purchase-button\"\n >\n {coursePrice\n ? formatMessage(messages.buyFor, { price: coursePrice })\n : formatMessage(messages.purchaseNoPrice)}\n </Button>\n )}\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nSubscriptionComparisonModal.propTypes = {\n courseId: PropTypes.string.isRequired,\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n onSubscribeClick: PropTypes.func,\n onPurchaseClick: PropTypes.func,\n};\n\nSubscriptionComparisonModal.defaultProps = {\n onSubscribeClick: undefined,\n onPurchaseClick: undefined,\n};\n\nexport default SubscriptionComparisonModal;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAGA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAAO,qBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,SAAA,GAAAN,sBAAA,CAAAF,OAAA;AACAA,OAAA;AAA4C,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAA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AW,iBACV,IAAA7C,WAAA,CAAAiD,GAAA,EAACrD,QAAA,CAAA+H,MAAM;UACLpB,EAAE,EAAC,GAAG;UACNqB,IAAI,EAAEhF,WAAY;UAClBkF,OAAO,EAAC,iBAAiB;UACzBX,OAAO,EAAEvF,eAAgB;UACzB,eAAY,yCAAyC;UAAA8B,QAAA,EAEpDZ,WAAW,GACRjB,aAAa,CAACyB,iBAAQ,CAAC2E,MAAM,EAAE;YAAEC,KAAK,EAAEpF;UAAY,CAAC,CAAC,GACtDjB,aAAa,CAACyB,iBAAQ,CAAC6E,eAAe;QAAC,CACrC,CACT;MAAA,CACQ;IAAC,CACM,CAAC;EAAA,CACV,CAAC;AAElB,CAAC;AAED7G,2BAA2B,CAAC8G,SAAS,GAAG;EACtC5G,QAAQ,EAAE6G,kBAAS,CAACC,MAAM,CAACC,UAAU;EACrC9G,MAAM,EAAE4G,kBAAS,CAACG,IAAI,CAACD,UAAU;EACjC7G,OAAO,EAAE2G,kBAAS,CAACI,IAAI,CAACF,UAAU;EAClC5G,gBAAgB,EAAE0G,kBAAS,CAACI,IAAI;EAChC7G,eAAe,EAAEyG,kBAAS,CAACI;AAC7B,CAAC;AAEDnH,2BAA2B,CAACoH,YAAY,GAAG;EACzC/G,gBAAgB,EAAEgH,SAAS;EAC3B/G,eAAe,EAAE+G;AACnB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1I,OAAA,GAEamB,2BAA2B","ignoreList":[]}
@@ -0,0 +1,66 @@
1
+ // Scoped to the modal so the sidebar card's UpsellTable styles stay untouched.
2
+ .subscription-comparison-modal {
3
+ .subscription-comparison-table {
4
+ border-collapse: separate;
5
+ border-spacing: 0;
6
+ overflow: hidden;
7
+ border-radius: var(--pgn-size-border-radius-base);
8
+
9
+ th,
10
+ td {
11
+ padding: 1rem 0.75rem;
12
+ border-bottom: 1px solid rgba(255, 255, 255, 0.15);
13
+ }
14
+
15
+ thead th {
16
+ padding: 1.5rem 0.75rem;
17
+ font-weight: 700;
18
+ border-bottom: 0;
19
+ }
20
+
21
+ .feature-header {
22
+ background: transparent;
23
+ }
24
+
25
+ .feature-cell {
26
+ text-align: left;
27
+ color: var(--pgn-color-gray-700);
28
+ background-color: var(--pgn-color-light-300);
29
+ border-bottom-color: var(--pgn-color-light-500);
30
+ }
31
+
32
+ // Brand teal with white text; lighter shades are the same token under a white overlay,
33
+ // kept light enough for white text to stay above 4.5:1 on both themes.
34
+ .plan-subscribe,
35
+ .plan-buy {
36
+ color: var(--pgn-color-white);
37
+ background-color: var(--pgn-color-primary-500);
38
+ }
39
+
40
+ thead .plan-subscribe {
41
+ background-image: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
42
+ }
43
+
44
+ .plan-buy {
45
+ background-image: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28));
46
+ }
47
+
48
+ thead .plan-buy {
49
+ background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
50
+ }
51
+
52
+ .pgn__icon {
53
+ color: var(--pgn-color-white);
54
+ }
55
+ }
56
+
57
+ .subscription-comparison-actions-stacked {
58
+ flex-direction: column;
59
+ align-items: stretch;
60
+
61
+ > * + * {
62
+ margin-inline-start: 0;
63
+ margin-top: var(--pgn-spacing-action-row-gap-y, 0.75rem);
64
+ }
65
+ }
66
+ }