@bunnyapp/components 1.5.0-beta.7 → 1.5.0-beta.9

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/index.js CHANGED
@@ -154,7 +154,7 @@ var BrandContext = react.createContext({
154
154
  });
155
155
 
156
156
  // This will be replaced at build time by rollup-plugin-replace
157
- var PACKAGE_VERSION = '1.5.0-beta.6';
157
+ var PACKAGE_VERSION = '1.5.0-beta.8';
158
158
  var createRequestHeaders = function (token) {
159
159
  var headers = createClientDevHeaders({ token: token });
160
160
  // Add the components version header
@@ -22058,7 +22058,7 @@ var getSubscriptionStatusText = function (subscription) {
22058
22058
  case 'ACTIVATE':
22059
22059
  return "Activates on ".concat(common.formatDate(endDate));
22060
22060
  case 'CANCEL':
22061
- return "Trial ends on ".concat(common.formatDate(endDate));
22061
+ return "Trial expires on ".concat(common.formatDate(trialEndDate));
22062
22062
  }
22063
22063
  }
22064
22064
  if (evergreen) {
@@ -22078,7 +22078,7 @@ var SubscriptionCardHeader = function (_a) {
22078
22078
  var isTrial = isSubscriptionTrial(subscription);
22079
22079
  return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: {
22080
22080
  backgroundColor: darkMode ? 'var(--row-background-dark)' : '',
22081
- } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_b = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _b === void 0 ? void 0 : _b.name) && (jsxRuntime.jsx(Text$a, __assign({ style: __assign({ fontSize: '11px', fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_c = subscription.product.name) === null || _c === void 0 ? void 0 : _c.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-grow bunny-items-center bunny-gap-2" }, { children: [((_d = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _d === void 0 ? void 0 : _d.name) && (jsxRuntime.jsx(Text$a, __assign({ className: "bunny-text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(CustomizedTag, __assign({ color: TAG_COLORS[(_e = subscription.state) === null || _e === void 0 ? void 0 : _e.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase().replace(/_/g, ' ')), isTrial ? " (".concat(trialDaysLeft || 'N/A', " days left)") : ''] }))] }))] })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-6" }, { children: jsxRuntime.jsx(SubscriptionStatusAndActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, subscription: subscription }) }))] })));
22081
+ } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_b = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _b === void 0 ? void 0 : _b.name) && (jsxRuntime.jsx(Text$a, __assign({ style: __assign({ fontSize: '11px', fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_c = subscription.product.name) === null || _c === void 0 ? void 0 : _c.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-grow bunny-items-center bunny-gap-2" }, { children: [((_d = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _d === void 0 ? void 0 : _d.name) && (jsxRuntime.jsx(Text$a, __assign({ className: "bunny-text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(CustomizedTag, __assign({ color: TAG_COLORS[(_e = subscription.state) === null || _e === void 0 ? void 0 : _e.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase().replace(/_/g, ' ')), isTrial ? " (".concat(trialDaysLeft !== null && trialDaysLeft !== void 0 ? trialDaysLeft : 'N/A', " days left)") : ''] }))] }))] })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-6" }, { children: jsxRuntime.jsx(SubscriptionStatusAndActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, subscription: subscription }) }))] })));
22082
22082
  };
22083
22083
  function SubscriptionStatusAndActions(_a) {
22084
22084
  var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, subscription = _a.subscription;
@@ -22462,7 +22462,15 @@ var useQuoteCreate = function (_a) {
22462
22462
  },
22463
22463
  }), createEmptyQuote = _d.mutate, isCreatingEmptyQuote = _d.isPending;
22464
22464
  var _e = reactQuery.useMutation({
22465
- mutationFn: quoteSubscriptionActivate,
22465
+ mutationFn: function (_a) {
22466
+ var subscriptionId = _a.subscriptionId;
22467
+ return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
22468
+ switch (_b.label) {
22469
+ case 0: return [4 /*yield*/, quoteSubscriptionActivate({ subscriptionId: subscriptionId, apiHost: apiHost, token: token })];
22470
+ case 1: return [2 /*return*/, _b.sent()];
22471
+ }
22472
+ }); });
22473
+ },
22466
22474
  onSuccess: function (response) {
22467
22475
  var _a;
22468
22476
  var quote = (_a = response === null || response === void 0 ? void 0 : response.quoteSubscriptionActivate) === null || _a === void 0 ? void 0 : _a.quote;
@@ -22485,8 +22493,6 @@ var useQuoteCreate = function (_a) {
22485
22493
  if (isActivatingTrialSubscription || isActivatingExpiredTrialSubscription) {
22486
22494
  subscriptionActivate({
22487
22495
  subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id,
22488
- apiHost: apiHost,
22489
- token: token,
22490
22496
  });
22491
22497
  }
22492
22498
  else if (buyingAddonsForCurrentSubscription) {
@@ -1,93 +1,13 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import Quote from "./Quote";
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Quote from './Quote';
3
3
  declare const meta: Meta<typeof Quote>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const Default: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
7
- [x: string]: any;
8
- }, {
9
- [x: string]: any;
10
- className?: any;
11
- backButtonName?: any;
12
- onBackButtonClick?: any;
13
- shadow?: any;
14
- hideDownloadButton?: any;
15
- id?: any;
16
- onPaymentSuccess?: any;
17
- invoiceQuoteViewComponent?: any;
18
- onInvoiceDownloadError?: any;
19
- hidePaymentForm?: any;
20
- onInvoiceLoaded?: any;
21
- onQuoteLoaded?: any;
22
- }>;
23
- export declare const NoShadow: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
24
- [x: string]: any;
25
- }, {
26
- [x: string]: any;
27
- className?: any;
28
- backButtonName?: any;
29
- onBackButtonClick?: any;
30
- shadow?: any;
31
- hideDownloadButton?: any;
32
- id?: any;
33
- onPaymentSuccess?: any;
34
- invoiceQuoteViewComponent?: any;
35
- onInvoiceDownloadError?: any;
36
- hidePaymentForm?: any;
37
- onInvoiceLoaded?: any;
38
- onQuoteLoaded?: any;
39
- }>;
40
- export declare const Mobile: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
41
- [x: string]: any;
42
- }, {
43
- [x: string]: any;
44
- className?: any;
45
- backButtonName?: any;
46
- onBackButtonClick?: any;
47
- shadow?: any;
48
- hideDownloadButton?: any;
49
- id?: any;
50
- onPaymentSuccess?: any;
51
- invoiceQuoteViewComponent?: any;
52
- onInvoiceDownloadError?: any;
53
- hidePaymentForm?: any;
54
- onInvoiceLoaded?: any;
55
- onQuoteLoaded?: any;
56
- }>;
57
- export declare const CustomClassName: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
58
- [x: string]: any;
59
- }, {
60
- [x: string]: any;
61
- className?: any;
62
- backButtonName?: any;
63
- onBackButtonClick?: any;
64
- shadow?: any;
65
- hideDownloadButton?: any;
66
- id?: any;
67
- onPaymentSuccess?: any;
68
- invoiceQuoteViewComponent?: any;
69
- onInvoiceDownloadError?: any;
70
- hidePaymentForm?: any;
71
- onInvoiceLoaded?: any;
72
- onQuoteLoaded?: any;
73
- }>;
6
+ export declare const Default: Story;
7
+ export declare const NoShadow: Story;
8
+ export declare const Mobile: Story;
9
+ export declare const CustomClassName: Story;
74
10
  export declare const HideDownloadButton: Story;
75
11
  export declare const AcceptedQuote: Story;
76
12
  export declare const AcceptedQuoteDarkMode: Story;
77
- export declare const DarkMode: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
78
- [x: string]: any;
79
- }, {
80
- [x: string]: any;
81
- className?: any;
82
- backButtonName?: any;
83
- onBackButtonClick?: any;
84
- shadow?: any;
85
- hideDownloadButton?: any;
86
- id?: any;
87
- onPaymentSuccess?: any;
88
- invoiceQuoteViewComponent?: any;
89
- onInvoiceDownloadError?: any;
90
- hidePaymentForm?: any;
91
- onInvoiceLoaded?: any;
92
- onQuoteLoaded?: any;
93
- }>;
13
+ export declare const DarkMode: Story;
package/dist/esm/index.js CHANGED
@@ -143,7 +143,7 @@ var BrandContext = createContext({
143
143
  });
144
144
 
145
145
  // This will be replaced at build time by rollup-plugin-replace
146
- var PACKAGE_VERSION = '1.5.0-beta.6';
146
+ var PACKAGE_VERSION = '1.5.0-beta.8';
147
147
  var createRequestHeaders = function (token) {
148
148
  var headers = createClientDevHeaders({ token: token });
149
149
  // Add the components version header
@@ -22047,7 +22047,7 @@ var getSubscriptionStatusText = function (subscription) {
22047
22047
  case 'ACTIVATE':
22048
22048
  return "Activates on ".concat(formatDate(endDate));
22049
22049
  case 'CANCEL':
22050
- return "Trial ends on ".concat(formatDate(endDate));
22050
+ return "Trial expires on ".concat(formatDate(trialEndDate));
22051
22051
  }
22052
22052
  }
22053
22053
  if (evergreen) {
@@ -22067,7 +22067,7 @@ var SubscriptionCardHeader = function (_a) {
22067
22067
  var isTrial = isSubscriptionTrial(subscription);
22068
22068
  return (jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: {
22069
22069
  backgroundColor: darkMode ? 'var(--row-background-dark)' : '',
22070
- } }, { children: [jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_b = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _b === void 0 ? void 0 : _b.name) && (jsx(Text$a, __assign({ style: __assign({ fontSize: '11px', fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_c = subscription.product.name) === null || _c === void 0 ? void 0 : _c.toUpperCase() }))), jsxs("div", __assign({ className: "bunny-flex bunny-grow bunny-items-center bunny-gap-2" }, { children: [((_d = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _d === void 0 ? void 0 : _d.name) && (jsx(Text$a, __assign({ className: "bunny-text-lg" }, { children: subscription.plan.name }))), jsxs(CustomizedTag, __assign({ color: TAG_COLORS[(_e = subscription.state) === null || _e === void 0 ? void 0 : _e.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase().replace(/_/g, ' ')), isTrial ? " (".concat(trialDaysLeft || 'N/A', " days left)") : ''] }))] }))] })), jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-6" }, { children: jsx(SubscriptionStatusAndActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, subscription: subscription }) }))] })));
22070
+ } }, { children: [jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_b = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _b === void 0 ? void 0 : _b.name) && (jsx(Text$a, __assign({ style: __assign({ fontSize: '11px', fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_c = subscription.product.name) === null || _c === void 0 ? void 0 : _c.toUpperCase() }))), jsxs("div", __assign({ className: "bunny-flex bunny-grow bunny-items-center bunny-gap-2" }, { children: [((_d = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _d === void 0 ? void 0 : _d.name) && (jsx(Text$a, __assign({ className: "bunny-text-lg" }, { children: subscription.plan.name }))), jsxs(CustomizedTag, __assign({ color: TAG_COLORS[(_e = subscription.state) === null || _e === void 0 ? void 0 : _e.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase().replace(/_/g, ' ')), isTrial ? " (".concat(trialDaysLeft !== null && trialDaysLeft !== void 0 ? trialDaysLeft : 'N/A', " days left)") : ''] }))] }))] })), jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-6" }, { children: jsx(SubscriptionStatusAndActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, subscription: subscription }) }))] })));
22071
22071
  };
22072
22072
  function SubscriptionStatusAndActions(_a) {
22073
22073
  var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, subscription = _a.subscription;
@@ -22451,7 +22451,15 @@ var useQuoteCreate = function (_a) {
22451
22451
  },
22452
22452
  }), createEmptyQuote = _d.mutate, isCreatingEmptyQuote = _d.isPending;
22453
22453
  var _e = useMutation({
22454
- mutationFn: quoteSubscriptionActivate,
22454
+ mutationFn: function (_a) {
22455
+ var subscriptionId = _a.subscriptionId;
22456
+ return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
22457
+ switch (_b.label) {
22458
+ case 0: return [4 /*yield*/, quoteSubscriptionActivate({ subscriptionId: subscriptionId, apiHost: apiHost, token: token })];
22459
+ case 1: return [2 /*return*/, _b.sent()];
22460
+ }
22461
+ }); });
22462
+ },
22455
22463
  onSuccess: function (response) {
22456
22464
  var _a;
22457
22465
  var quote = (_a = response === null || response === void 0 ? void 0 : response.quoteSubscriptionActivate) === null || _a === void 0 ? void 0 : _a.quote;
@@ -22474,8 +22482,6 @@ var useQuoteCreate = function (_a) {
22474
22482
  if (isActivatingTrialSubscription || isActivatingExpiredTrialSubscription) {
22475
22483
  subscriptionActivate({
22476
22484
  subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id,
22477
- apiHost: apiHost,
22478
- token: token,
22479
22485
  });
22480
22486
  }
22481
22487
  else if (buyingAddonsForCurrentSubscription) {
@@ -1,93 +1,13 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import Quote from "./Quote";
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Quote from './Quote';
3
3
  declare const meta: Meta<typeof Quote>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const Default: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
7
- [x: string]: any;
8
- }, {
9
- [x: string]: any;
10
- className?: any;
11
- backButtonName?: any;
12
- onBackButtonClick?: any;
13
- shadow?: any;
14
- hideDownloadButton?: any;
15
- id?: any;
16
- onPaymentSuccess?: any;
17
- invoiceQuoteViewComponent?: any;
18
- onInvoiceDownloadError?: any;
19
- hidePaymentForm?: any;
20
- onInvoiceLoaded?: any;
21
- onQuoteLoaded?: any;
22
- }>;
23
- export declare const NoShadow: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
24
- [x: string]: any;
25
- }, {
26
- [x: string]: any;
27
- className?: any;
28
- backButtonName?: any;
29
- onBackButtonClick?: any;
30
- shadow?: any;
31
- hideDownloadButton?: any;
32
- id?: any;
33
- onPaymentSuccess?: any;
34
- invoiceQuoteViewComponent?: any;
35
- onInvoiceDownloadError?: any;
36
- hidePaymentForm?: any;
37
- onInvoiceLoaded?: any;
38
- onQuoteLoaded?: any;
39
- }>;
40
- export declare const Mobile: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
41
- [x: string]: any;
42
- }, {
43
- [x: string]: any;
44
- className?: any;
45
- backButtonName?: any;
46
- onBackButtonClick?: any;
47
- shadow?: any;
48
- hideDownloadButton?: any;
49
- id?: any;
50
- onPaymentSuccess?: any;
51
- invoiceQuoteViewComponent?: any;
52
- onInvoiceDownloadError?: any;
53
- hidePaymentForm?: any;
54
- onInvoiceLoaded?: any;
55
- onQuoteLoaded?: any;
56
- }>;
57
- export declare const CustomClassName: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
58
- [x: string]: any;
59
- }, {
60
- [x: string]: any;
61
- className?: any;
62
- backButtonName?: any;
63
- onBackButtonClick?: any;
64
- shadow?: any;
65
- hideDownloadButton?: any;
66
- id?: any;
67
- onPaymentSuccess?: any;
68
- invoiceQuoteViewComponent?: any;
69
- onInvoiceDownloadError?: any;
70
- hidePaymentForm?: any;
71
- onInvoiceLoaded?: any;
72
- onQuoteLoaded?: any;
73
- }>;
6
+ export declare const Default: Story;
7
+ export declare const NoShadow: Story;
8
+ export declare const Mobile: Story;
9
+ export declare const CustomClassName: Story;
74
10
  export declare const HideDownloadButton: Story;
75
11
  export declare const AcceptedQuote: Story;
76
12
  export declare const AcceptedQuoteDarkMode: Story;
77
- export declare const DarkMode: import("@storybook/core/csf").StoryAnnotations<import("@storybook/react/dist/types-5617c98e").R, {
78
- [x: string]: any;
79
- }, {
80
- [x: string]: any;
81
- className?: any;
82
- backButtonName?: any;
83
- onBackButtonClick?: any;
84
- shadow?: any;
85
- hideDownloadButton?: any;
86
- id?: any;
87
- onPaymentSuccess?: any;
88
- invoiceQuoteViewComponent?: any;
89
- onInvoiceDownloadError?: any;
90
- hidePaymentForm?: any;
91
- onInvoiceLoaded?: any;
92
- onQuoteLoaded?: any;
93
- }>;
13
+ export declare const DarkMode: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.5.0-beta.7",
3
+ "version": "1.5.0-beta.9",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",