@bunnyapp/components 1.0.2 → 1.0.4

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.
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import { FrontendTransaction as T } from "@bunnyapp/common";
3
+ declare function Quotes({ filter, quoteComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onQuoteClick, suppressQuoteDisplay, style, noQuotesMessage, }: {
4
+ /** A custom component to render instead of the default invoice component */
5
+ quoteComponent?: React.ReactNode;
6
+ /** Whether to show the search bar */
7
+ showSearchBar?: boolean;
8
+ /** Whether to show the title */
9
+ showTitle?: boolean;
10
+ /** The columns to display in the transactions list */
11
+ columns?: ("date-and-title" | "state" | "amount" | "download" | "actions")[];
12
+ /** A custom class name to apply to the component */
13
+ className?: string;
14
+ /** Whether to use a modal for the invoice drawer */
15
+ useModal?: boolean;
16
+ /** Whether to show a shadow around the transactions list */
17
+ shadow?: "none" | "sm" | "md" | "lg" | "xl";
18
+ /** A custom class name to apply to the search bar */
19
+ searchBarClassName?: string;
20
+ /** A function to call when a quote is clicked */
21
+ onQuoteClick?: (quote: T.Transaction) => void;
22
+ /** Whether to hide the display showing the quote */
23
+ suppressQuoteDisplay?: boolean;
24
+ /** A custom style to apply to the component */
25
+ style?: React.CSSProperties;
26
+ /** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
27
+ filter?: string;
28
+ /** Message to display when there are no quotes */
29
+ noQuotesMessage?: string;
30
+ }): import("react/jsx-runtime").JSX.Element;
31
+ export default Quotes;
@@ -1,6 +1,6 @@
1
- import { FrontendTransaction as Transaction } from "@bunnyapp/common";
1
+ import { FrontendTransaction as T } from "@bunnyapp/common";
2
2
  type StateTagProps = {
3
- state: Transaction.TransactionState;
3
+ state: T.TransactionState;
4
4
  };
5
5
  declare const StateTag: ({ state }: StateTagProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default StateTag;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FrontendTransaction as T, TransactionKind } from "@bunnyapp/common";
3
- export default function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, }: {
3
+ export default function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, }: {
4
4
  /** A custom component to render instead of the default invoice component */
5
5
  transactionComponent?: React.ReactNode;
6
6
  /** Whether to show the search bar */
@@ -25,4 +25,14 @@ export default function Transactions({ transactionComponent, showSearchBar, show
25
25
  kindsToShow?: TransactionKind[];
26
26
  /** A custom style to apply to the component */
27
27
  style?: React.CSSProperties;
28
+ /** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
29
+ filter?: string;
30
+ /** Message to display when there are no transactions */
31
+ noTransactionsMessage?: string;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search, title, }: {
34
+ transactions: T.Transaction[];
35
+ onSearchValueChanged: (value: string) => void;
36
+ search: string;
37
+ title?: string;
28
38
  }): import("react/jsx-runtime").JSX.Element;
@@ -14,5 +14,8 @@ export type TransactionsContextValues = {
14
14
  suppressTransactionDisplay?: boolean;
15
15
  kindsToShow: TransactionKind[];
16
16
  style?: React.CSSProperties;
17
+ filter?: string;
18
+ noTransactionsMessage?: string;
19
+ downloadTransactionLink?: (id: string) => string;
17
20
  };
18
21
  export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
@@ -1,7 +1,17 @@
1
- import { FrontendTransaction as T } from "@bunnyapp/common";
1
+ import { FrontendTransaction as T, TransactionState } from "@bunnyapp/common";
2
+ export type Generic = {
3
+ amount: number;
4
+ createdAt: string;
5
+ currencyId: string;
6
+ description: string;
7
+ kind: string;
8
+ state: TransactionState;
9
+ transactionable?: any;
10
+ id: string;
11
+ };
2
12
  export type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download" | "actions";
3
13
  declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
4
14
  transactions: T.Transaction[];
5
- onTransactionClick: (transaction: T.Transaction) => void;
15
+ onTransactionClick?: ((transaction: T.Transaction) => void) | undefined;
6
16
  }) => import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
7
17
  export default TransactionsListDesktop;
@@ -0,0 +1,6 @@
1
+ declare const getQuotes: ({ token, subdomain, filter, }: {
2
+ token: string;
3
+ subdomain: string;
4
+ filter?: string | undefined;
5
+ }) => Promise<any>;
6
+ export default getQuotes;
package/dist/index.d.ts CHANGED
@@ -67,7 +67,7 @@ declare function BunnyProvider({ children, token, subdomain, window, accountId,
67
67
  darkMode?: boolean;
68
68
  }): react_jsx_runtime.JSX.Element;
69
69
 
70
- declare function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, }: {
70
+ declare function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, }: {
71
71
  /** A custom component to render instead of the default invoice component */
72
72
  transactionComponent?: react.ReactNode;
73
73
  /** Whether to show the search bar */
@@ -92,6 +92,10 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
92
92
  kindsToShow?: TransactionKind[];
93
93
  /** A custom style to apply to the component */
94
94
  style?: react.CSSProperties;
95
+ /** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
96
+ filter?: string;
97
+ /** Message to display when there are no transactions */
98
+ noTransactionsMessage?: string;
95
99
  }): react_jsx_runtime.JSX.Element;
96
100
 
97
101
  declare const Subscriptions: ({ shadow, gap, showTitle, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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",
@@ -58,7 +58,7 @@
58
58
  "vite": "^5.4.11"
59
59
  },
60
60
  "peerDependencies": {
61
- "@bunnyapp/common": "^1.0.32",
61
+ "@bunnyapp/common": "^1.0.33",
62
62
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
63
63
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
64
64
  "@fortawesome/free-regular-svg-icons": "^6.7.2",