@bunnyapp/components 1.6.0-beta.17 → 1.6.0-beta.18

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
@@ -143,7 +143,7 @@ const useAllErrorFormats = () => {
143
143
  };
144
144
 
145
145
  // This will be replaced at build time by rollup-plugin-replace
146
- const PACKAGE_VERSION = '1.6.0-beta.16';
146
+ const PACKAGE_VERSION = '1.6.0-beta.17';
147
147
  const createRequestHeaders = (token) => {
148
148
  const headers = createClientDevHeaders({ token });
149
149
  // Add the components version header
@@ -20114,7 +20114,7 @@ const quoteAccept = async ({ quoteId, apiHost, token, changedFormItems, }) => {
20114
20114
  throw errors;
20115
20115
  return (_b = response.quoteAccept) === null || _b === void 0 ? void 0 : _b.quote;
20116
20116
  };
20117
- const useSendAcceptQuote = ({ quoteId, apiHost, token, }) => {
20117
+ const useSendAcceptQuote = ({ quoteId, apiHost, token, onQuoteAccepted, }) => {
20118
20118
  // Hooks
20119
20119
  const graphQLMutation = common.useGraphQLmutation(() => {
20120
20120
  console.log('navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented');
@@ -20173,6 +20173,7 @@ const useSendAcceptQuote = ({ quoteId, apiHost, token, }) => {
20173
20173
  },
20174
20174
  onSuccess: () => {
20175
20175
  setAcceptBoxVisible(false);
20176
+ onQuoteAccepted === null || onQuoteAccepted === void 0 ? void 0 : onQuoteAccepted();
20176
20177
  queryClient.invalidateQueries({
20177
20178
  queryKey: common.QueryKeyFactory.default.createQuoteKey({
20178
20179
  id: quoteId,
@@ -20396,7 +20397,7 @@ defaultStyled.div `
20396
20397
  width: 100%;
20397
20398
  }
20398
20399
  `;
20399
- function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow = 'shadow-md', className, hideDownloadButton = false, onQuoteLoaded, }) {
20400
+ function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow = 'shadow-md', className, hideDownloadButton = false, onQuoteLoaded, onQuoteAccepted, }) {
20400
20401
  return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, { value: {
20401
20402
  id,
20402
20403
  invoiceQuoteViewComponent,
@@ -20406,7 +20407,7 @@ function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymen
20406
20407
  className,
20407
20408
  hideDownloadButton,
20408
20409
  onQuoteLoaded,
20409
- }, children: jsxRuntime.jsx(ActualQuote, {}) }));
20410
+ }, children: jsxRuntime.jsx(ActualQuote, { onQuoteAccepted: onQuoteAccepted }) }));
20410
20411
  }
20411
20412
  const useQuotePaymentHold = (formattedQuote) => {
20412
20413
  var _a, _b;
@@ -20421,7 +20422,7 @@ const useQuotePaymentHold = (formattedQuote) => {
20421
20422
  paymentHoldCompleted: currentPaymentHold ? true : false,
20422
20423
  };
20423
20424
  };
20424
- function ActualQuote() {
20425
+ function ActualQuote({ onQuoteAccepted }) {
20425
20426
  var _a, _b, _c, _d;
20426
20427
  // Context
20427
20428
  const { apiHost } = react.useContext(BunnyContext);
@@ -20441,6 +20442,7 @@ function ActualQuote() {
20441
20442
  token,
20442
20443
  apiHost,
20443
20444
  quoteId: id,
20445
+ onQuoteAccepted,
20444
20446
  });
20445
20447
  useSigningComplete({ data: formattedQuote, token });
20446
20448
  const isMobile = common.useIsMobile();
@@ -1,3 +1,7 @@
1
1
  import { InvoiceQuoteContextProps } from '../../contexts/InvoiceQuoteContext';
2
2
  export declare const MarkupContainer: any;
3
- export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): import("react/jsx-runtime").JSX.Element;
3
+ type QuoteProps = InvoiceQuoteContextProps & {
4
+ onQuoteAccepted?: () => void;
5
+ };
6
+ export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, onQuoteAccepted, }: QuoteProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1,7 +1,8 @@
1
- declare const useSendAcceptQuote: ({ quoteId, apiHost, token, }: {
1
+ declare const useSendAcceptQuote: ({ quoteId, apiHost, token, onQuoteAccepted, }: {
2
2
  quoteId?: string;
3
3
  apiHost: string;
4
4
  token?: string;
5
+ onQuoteAccepted?: () => void;
5
6
  }) => {
6
7
  acceptBoxVisible: boolean;
7
8
  isAccepting: boolean;
package/dist/esm/index.js CHANGED
@@ -141,7 +141,7 @@ const useAllErrorFormats = () => {
141
141
  };
142
142
 
143
143
  // This will be replaced at build time by rollup-plugin-replace
144
- const PACKAGE_VERSION = '1.6.0-beta.16';
144
+ const PACKAGE_VERSION = '1.6.0-beta.17';
145
145
  const createRequestHeaders = (token) => {
146
146
  const headers = createClientDevHeaders({ token });
147
147
  // Add the components version header
@@ -20112,7 +20112,7 @@ const quoteAccept = async ({ quoteId, apiHost, token, changedFormItems, }) => {
20112
20112
  throw errors;
20113
20113
  return (_b = response.quoteAccept) === null || _b === void 0 ? void 0 : _b.quote;
20114
20114
  };
20115
- const useSendAcceptQuote = ({ quoteId, apiHost, token, }) => {
20115
+ const useSendAcceptQuote = ({ quoteId, apiHost, token, onQuoteAccepted, }) => {
20116
20116
  // Hooks
20117
20117
  const graphQLMutation = useGraphQLmutation(() => {
20118
20118
  console.log('navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented');
@@ -20171,6 +20171,7 @@ const useSendAcceptQuote = ({ quoteId, apiHost, token, }) => {
20171
20171
  },
20172
20172
  onSuccess: () => {
20173
20173
  setAcceptBoxVisible(false);
20174
+ onQuoteAccepted === null || onQuoteAccepted === void 0 ? void 0 : onQuoteAccepted();
20174
20175
  queryClient.invalidateQueries({
20175
20176
  queryKey: QueryKeyFactory$1.default.createQuoteKey({
20176
20177
  id: quoteId,
@@ -20394,7 +20395,7 @@ defaultStyled.div `
20394
20395
  width: 100%;
20395
20396
  }
20396
20397
  `;
20397
- function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow = 'shadow-md', className, hideDownloadButton = false, onQuoteLoaded, }) {
20398
+ function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow = 'shadow-md', className, hideDownloadButton = false, onQuoteLoaded, onQuoteAccepted, }) {
20398
20399
  return (jsx(InvoiceQuoteContext.Provider, { value: {
20399
20400
  id,
20400
20401
  invoiceQuoteViewComponent,
@@ -20404,7 +20405,7 @@ function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymen
20404
20405
  className,
20405
20406
  hideDownloadButton,
20406
20407
  onQuoteLoaded,
20407
- }, children: jsx(ActualQuote, {}) }));
20408
+ }, children: jsx(ActualQuote, { onQuoteAccepted: onQuoteAccepted }) }));
20408
20409
  }
20409
20410
  const useQuotePaymentHold = (formattedQuote) => {
20410
20411
  var _a, _b;
@@ -20419,7 +20420,7 @@ const useQuotePaymentHold = (formattedQuote) => {
20419
20420
  paymentHoldCompleted: currentPaymentHold ? true : false,
20420
20421
  };
20421
20422
  };
20422
- function ActualQuote() {
20423
+ function ActualQuote({ onQuoteAccepted }) {
20423
20424
  var _a, _b, _c, _d;
20424
20425
  // Context
20425
20426
  const { apiHost } = useContext(BunnyContext);
@@ -20439,6 +20440,7 @@ function ActualQuote() {
20439
20440
  token,
20440
20441
  apiHost,
20441
20442
  quoteId: id,
20443
+ onQuoteAccepted,
20442
20444
  });
20443
20445
  useSigningComplete({ data: formattedQuote, token });
20444
20446
  const isMobile = useIsMobile();
@@ -1,3 +1,7 @@
1
1
  import { InvoiceQuoteContextProps } from '../../contexts/InvoiceQuoteContext';
2
2
  export declare const MarkupContainer: any;
3
- export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): import("react/jsx-runtime").JSX.Element;
3
+ type QuoteProps = InvoiceQuoteContextProps & {
4
+ onQuoteAccepted?: () => void;
5
+ };
6
+ export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, onQuoteAccepted, }: QuoteProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1,7 +1,8 @@
1
- declare const useSendAcceptQuote: ({ quoteId, apiHost, token, }: {
1
+ declare const useSendAcceptQuote: ({ quoteId, apiHost, token, onQuoteAccepted, }: {
2
2
  quoteId?: string;
3
3
  apiHost: string;
4
4
  token?: string;
5
+ onQuoteAccepted?: () => void;
5
6
  }) => {
6
7
  acceptBoxVisible: boolean;
7
8
  isAccepting: boolean;
package/dist/index.d.ts CHANGED
@@ -32,7 +32,10 @@ declare global {
32
32
  }
33
33
  }
34
34
 
35
- declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
35
+ type QuoteProps = InvoiceQuoteContextProps & {
36
+ onQuoteAccepted?: () => void;
37
+ };
38
+ declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, onQuoteAccepted, }: QuoteProps): react_jsx_runtime.JSX.Element;
36
39
 
37
40
  type TransactionListColumnType = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
38
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.6.0-beta.17",
3
+ "version": "1.6.0-beta.18",
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",