@newskit-render/my-account 7.146.1 → 7.147.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.
- package/dist/cjs/Components/Elements/CancellationButtons/CancellationButtons.d.ts +7 -0
- package/dist/cjs/Components/Elements/CancellationButtons/CancellationButtons.js +43 -0
- package/dist/cjs/Components/Elements/CancellationButtons/CancellationButtons.js.map +1 -0
- package/dist/cjs/Components/Elements/CancellationButtons/index.d.ts +1 -0
- package/dist/cjs/Components/Elements/CancellationButtons/index.js +18 -0
- package/dist/cjs/Components/Elements/CancellationButtons/index.js.map +1 -0
- package/dist/esm/Components/Elements/CancellationButtons/CancellationButtons.d.ts +7 -0
- package/dist/esm/Components/Elements/CancellationButtons/CancellationButtons.js +36 -0
- package/dist/esm/Components/Elements/CancellationButtons/CancellationButtons.js.map +1 -0
- package/dist/esm/Components/Elements/CancellationButtons/index.d.ts +1 -0
- package/dist/esm/Components/Elements/CancellationButtons/index.js +2 -0
- package/dist/esm/Components/Elements/CancellationButtons/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonGroupProps } from '@newskit-render/shared-components';
|
|
3
|
+
export interface CancellationButtonsProps extends ButtonGroupProps {
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
onPrimaryButtonClick?: (event: React.MouseEvent) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const CancellationButtons: ({ baseUrl, onPrimaryButtonClick, keepFixed, paddingBlock, paddingInline, primaryButton, secondaryButton, stylePreset, ...buttonGroupProps }: CancellationButtonsProps) => JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.CancellationButtons = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var navigation_1 = require("next/navigation");
|
|
31
|
+
var shared_components_1 = require("@newskit-render/shared-components");
|
|
32
|
+
var dataUtils_1 = require("../../../helpers/dataUtils");
|
|
33
|
+
var CancellationButtons = function (_a) {
|
|
34
|
+
var _b = _a.baseUrl, baseUrl = _b === void 0 ? '' : _b, onPrimaryButtonClick = _a.onPrimaryButtonClick, keepFixed = _a.keepFixed, _c = _a.paddingBlock, paddingBlock = _c === void 0 ? 'space000' : _c, _d = _a.paddingInline, paddingInline = _d === void 0 ? 'space000' : _d, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, _e = _a.stylePreset, stylePreset = _e === void 0 ? { xs: 'buttonGroupSm' } : _e, buttonGroupProps = __rest(_a, ["baseUrl", "onPrimaryButtonClick", "keepFixed", "paddingBlock", "paddingInline", "primaryButton", "secondaryButton", "stylePreset"]);
|
|
35
|
+
var searchParams = (0, navigation_1.useSearchParams)();
|
|
36
|
+
var returnUrl = searchParams.get('returnUrl') ||
|
|
37
|
+
(0, dataUtils_1.replaceBaseURL)(baseUrl, '[baseURL]/subscription-and-billing');
|
|
38
|
+
var primaryButtonProps = __assign({ text: 'Continue with cancellation', onClick: onPrimaryButtonClick }, primaryButton);
|
|
39
|
+
var secondaryButtonProps = __assign(__assign({ text: 'Stay subscribed', href: returnUrl }, secondaryButton), { overrides: __assign({ stylePreset: 'buttonOutlinedSecondary' }, secondaryButton === null || secondaryButton === void 0 ? void 0 : secondaryButton.overrides) });
|
|
40
|
+
return (react_1.default.createElement(shared_components_1.ButtonGroup, __assign({ "data-testid": "cancellation-buttons", paddingBlock: paddingBlock, paddingInline: paddingInline, primaryButton: primaryButtonProps, secondaryButton: secondaryButtonProps, stylePreset: stylePreset, keepFixed: keepFixed }, buttonGroupProps)));
|
|
41
|
+
};
|
|
42
|
+
exports.CancellationButtons = CancellationButtons;
|
|
43
|
+
//# sourceMappingURL=CancellationButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CancellationButtons.js","sourceRoot":"","sources":["../../../../../src/Components/Elements/CancellationButtons/CancellationButtons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,8CAAiD;AACjD,uEAG0C;AAC1C,wDAA2D;AAOpD,IAAM,mBAAmB,GAAG,UAAC,EAUT;IATzB,IAAA,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EACZ,oBAAoB,0BAAA,EACpB,SAAS,eAAA,EACT,oBAAyB,EAAzB,YAAY,mBAAG,UAAU,KAAA,EACzB,qBAA0B,EAA1B,aAAa,mBAAG,UAAU,KAAA,EAC1B,aAAa,mBAAA,EACb,eAAe,qBAAA,EACf,mBAAqC,EAArC,WAAW,mBAAG,EAAE,EAAE,EAAE,eAAe,EAAE,KAAA,EAClC,gBAAgB,cATe,oIAUnC,CADoB;IAEnB,IAAM,YAAY,GAAG,IAAA,4BAAe,GAAE,CAAA;IAEtC,IAAM,SAAS,GACb,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC;QAC7B,IAAA,0BAAc,EAAC,OAAO,EAAE,oCAAoC,CAAC,CAAA;IAE/D,IAAM,kBAAkB,cACtB,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,oBAAoB,IAC1B,aAAa,CACjB,CAAA;IAED,IAAM,oBAAoB,uBACxB,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,SAAS,IACZ,eAAe,KAClB,SAAS,aACP,WAAW,EAAE,yBAAyB,IACnC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,IAEhC,CAAA;IAED,OAAO,CACL,8BAAC,+BAAW,4BACE,sBAAsB,EAClC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,kBAAkB,EACjC,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,IAChB,gBAAgB,EACpB,CACH,CAAA;AACH,CAAC,CAAA;AA7CY,QAAA,mBAAmB,uBA6C/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CancellationButtons';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CancellationButtons"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Elements/CancellationButtons/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonGroupProps } from '@newskit-render/shared-components';
|
|
3
|
+
export interface CancellationButtonsProps extends ButtonGroupProps {
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
onPrimaryButtonClick?: (event: React.MouseEvent) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const CancellationButtons: ({ baseUrl, onPrimaryButtonClick, keepFixed, paddingBlock, paddingInline, primaryButton, secondaryButton, stylePreset, ...buttonGroupProps }: CancellationButtonsProps) => JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { useSearchParams } from 'next/navigation';
|
|
25
|
+
import { ButtonGroup, } from '@newskit-render/shared-components';
|
|
26
|
+
import { replaceBaseURL } from '../../../helpers/dataUtils';
|
|
27
|
+
export var CancellationButtons = function (_a) {
|
|
28
|
+
var _b = _a.baseUrl, baseUrl = _b === void 0 ? '' : _b, onPrimaryButtonClick = _a.onPrimaryButtonClick, keepFixed = _a.keepFixed, _c = _a.paddingBlock, paddingBlock = _c === void 0 ? 'space000' : _c, _d = _a.paddingInline, paddingInline = _d === void 0 ? 'space000' : _d, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, _e = _a.stylePreset, stylePreset = _e === void 0 ? { xs: 'buttonGroupSm' } : _e, buttonGroupProps = __rest(_a, ["baseUrl", "onPrimaryButtonClick", "keepFixed", "paddingBlock", "paddingInline", "primaryButton", "secondaryButton", "stylePreset"]);
|
|
29
|
+
var searchParams = useSearchParams();
|
|
30
|
+
var returnUrl = searchParams.get('returnUrl') ||
|
|
31
|
+
replaceBaseURL(baseUrl, '[baseURL]/subscription-and-billing');
|
|
32
|
+
var primaryButtonProps = __assign({ text: 'Continue with cancellation', onClick: onPrimaryButtonClick }, primaryButton);
|
|
33
|
+
var secondaryButtonProps = __assign(__assign({ text: 'Stay subscribed', href: returnUrl }, secondaryButton), { overrides: __assign({ stylePreset: 'buttonOutlinedSecondary' }, secondaryButton === null || secondaryButton === void 0 ? void 0 : secondaryButton.overrides) });
|
|
34
|
+
return (React.createElement(ButtonGroup, __assign({ "data-testid": "cancellation-buttons", paddingBlock: paddingBlock, paddingInline: paddingInline, primaryButton: primaryButtonProps, secondaryButton: secondaryButtonProps, stylePreset: stylePreset, keepFixed: keepFixed }, buttonGroupProps)));
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=CancellationButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CancellationButtons.js","sourceRoot":"","sources":["../../../../../src/Components/Elements/CancellationButtons/CancellationButtons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EACL,WAAW,GAEZ,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAO3D,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAUT;IATzB,IAAA,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EACZ,oBAAoB,0BAAA,EACpB,SAAS,eAAA,EACT,oBAAyB,EAAzB,YAAY,mBAAG,UAAU,KAAA,EACzB,qBAA0B,EAA1B,aAAa,mBAAG,UAAU,KAAA,EAC1B,aAAa,mBAAA,EACb,eAAe,qBAAA,EACf,mBAAqC,EAArC,WAAW,mBAAG,EAAE,EAAE,EAAE,eAAe,EAAE,KAAA,EAClC,gBAAgB,cATe,oIAUnC,CADoB;IAEnB,IAAM,YAAY,GAAG,eAAe,EAAE,CAAA;IAEtC,IAAM,SAAS,GACb,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC;QAC7B,cAAc,CAAC,OAAO,EAAE,oCAAoC,CAAC,CAAA;IAE/D,IAAM,kBAAkB,cACtB,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,oBAAoB,IAC1B,aAAa,CACjB,CAAA;IAED,IAAM,oBAAoB,uBACxB,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,SAAS,IACZ,eAAe,KAClB,SAAS,aACP,WAAW,EAAE,yBAAyB,IACnC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,IAEhC,CAAA;IAED,OAAO,CACL,oBAAC,WAAW,4BACE,sBAAsB,EAClC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,kBAAkB,EACjC,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,IAChB,gBAAgB,EACpB,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CancellationButtons';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Components/Elements/CancellationButtons/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/my-account",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.147.0",
|
|
4
4
|
"description": "Newskit Render",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@hookform/resolvers": "2.9.10",
|
|
37
37
|
"@newskit-render/api": "^1.18.0",
|
|
38
38
|
"@newskit-render/feature-flags": "^1.15.0",
|
|
39
|
-
"@newskit-render/shared-components": "^4.
|
|
39
|
+
"@newskit-render/shared-components": "^4.64.0",
|
|
40
40
|
"@newskit-render/validation": "^1.22.1",
|
|
41
41
|
"@stripe/react-stripe-js": "2.1.1",
|
|
42
42
|
"@stripe/stripe-js": "1.54.1",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "57afa4ee6ea5ab2c792b65ebce983537bf8fc34b"
|
|
122
122
|
}
|