@bunnyapp/components 1.8.0-beta.45 → 1.8.0-beta.46
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.
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { InfiniteTable } from './tables/InfiniteTable';
|
|
2
|
-
export type { Column, ColumnAlign, CursorPage, InfiniteTableQueryArgs } from './tables/InfiniteTable';
|
|
3
1
|
export { Invoice } from './Invoice';
|
|
4
2
|
export { Invoices } from './tables/Invoices';
|
|
5
3
|
export { Quote } from './Quote';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,34 +11,35 @@ import { Transaction } from '@/types/Transaction';
|
|
|
11
11
|
|
|
12
12
|
type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
|
13
13
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
type InvoiceQuoteContextProps = {
|
|
15
|
+
id?: string | null | undefined;
|
|
16
|
+
invoiceQuoteViewComponent?: React.ReactNode;
|
|
17
|
+
backButtonName?: string;
|
|
18
|
+
onBackButtonClick?: () => void;
|
|
19
|
+
onInvoiceDownloadError?: () => void;
|
|
20
|
+
onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
|
|
21
|
+
shadow?: ShadowType;
|
|
22
|
+
className?: string;
|
|
23
|
+
hideDownloadButton?: boolean;
|
|
24
|
+
onInvoiceLoaded?: (formattedInvoice: FormattedInvoice) => void;
|
|
25
|
+
onQuoteUnavailableError?: () => void;
|
|
26
|
+
suppressQuoteUnavailableErrorNotification?: boolean;
|
|
21
27
|
};
|
|
22
28
|
|
|
23
|
-
type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/** Bold header text. Pass an empty string to render no label. */
|
|
28
|
-
label: string;
|
|
29
|
-
/** Cell renderer for each row. */
|
|
30
|
-
render: (row: T) => ReactNode;
|
|
31
|
-
/** Cell + header alignment. Defaults to 'left'. */
|
|
32
|
-
align?: ColumnAlign;
|
|
33
|
-
/** Explicit `grid-template-columns` segment (e.g. `'120px'`, `'auto'`). Ignored when `flex` is true. */
|
|
34
|
-
width?: string;
|
|
35
|
-
/** When true, this column takes the remaining space (`3fr`). At most one column should set this. */
|
|
36
|
-
flex?: boolean;
|
|
37
|
-
};
|
|
38
|
-
type InfiniteTableQueryArgs = {
|
|
39
|
-
first: number;
|
|
40
|
-
after?: string;
|
|
29
|
+
type InvoiceProps = InvoiceQuoteContextProps & {
|
|
30
|
+
hidePaymentForm?: boolean;
|
|
31
|
+
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
32
|
+
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
41
33
|
};
|
|
34
|
+
declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, hidePaymentForm, onInvoiceLoaded, onPaymentMethodSaved, onPaymentMethodRemoved, }: InvoiceProps): react.JSX.Element;
|
|
35
|
+
|
|
36
|
+
declare global {
|
|
37
|
+
interface Window {
|
|
38
|
+
heap: any;
|
|
39
|
+
PayFields: any;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
42
43
|
/** Shared display options for the resource table wrappers (Invoices, Quotes, Transactions, ...). */
|
|
43
44
|
type TableDisplayOptions<ColumnKey extends string> = {
|
|
44
45
|
/** Whether to show the search bar */
|
|
@@ -72,61 +73,6 @@ type TableBehaviorOptions = {
|
|
|
72
73
|
rowsPerPage?: number;
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
type Props$1<T> = {
|
|
76
|
-
/** Base cache key. `rowsPerPage` is appended automatically. */
|
|
77
|
-
queryKey: readonly unknown[];
|
|
78
|
-
/** Fetches a single page. Must return a Relay-shaped `CursorPage`. */
|
|
79
|
-
queryFn: (args: InfiniteTableQueryArgs) => Promise<CursorPage<T>>;
|
|
80
|
-
/** Extracts a stable React key from each row. */
|
|
81
|
-
getRowKey: (row: T) => string | number;
|
|
82
|
-
/** Declarative column configuration. */
|
|
83
|
-
columns: Column<T>[];
|
|
84
|
-
/** Invoked when a row is clicked. Presence enables the row-hover cursor. */
|
|
85
|
-
onRowClick?: (row: T) => void;
|
|
86
|
-
/** Fallback text shown when the current page has no rows. */
|
|
87
|
-
emptyMessage?: string;
|
|
88
|
-
/** Fully custom empty-state renderer; overrides `emptyMessage`. */
|
|
89
|
-
renderEmpty?: () => ReactNode;
|
|
90
|
-
/** Force a page size. When omitted the table auto-sizes to the viewport. Must be 1-100. */
|
|
91
|
-
rowsPerPage?: number;
|
|
92
|
-
/** Card shadow class. */
|
|
93
|
-
shadow?: ShadowType;
|
|
94
|
-
className?: string;
|
|
95
|
-
style?: React.CSSProperties;
|
|
96
|
-
/** Escape hatch: on mobile, render each row with this callback instead of the columns grid. */
|
|
97
|
-
renderMobileRow?: (row: T) => ReactNode;
|
|
98
|
-
};
|
|
99
|
-
declare function InfiniteTable<T>({ queryKey, queryFn, getRowKey, columns, onRowClick, emptyMessage, renderEmpty, rowsPerPage, shadow, className, style, renderMobileRow, }: Props$1<T>): react.JSX.Element;
|
|
100
|
-
|
|
101
|
-
type InvoiceQuoteContextProps = {
|
|
102
|
-
id?: string | null | undefined;
|
|
103
|
-
invoiceQuoteViewComponent?: React.ReactNode;
|
|
104
|
-
backButtonName?: string;
|
|
105
|
-
onBackButtonClick?: () => void;
|
|
106
|
-
onInvoiceDownloadError?: () => void;
|
|
107
|
-
onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
|
|
108
|
-
shadow?: ShadowType;
|
|
109
|
-
className?: string;
|
|
110
|
-
hideDownloadButton?: boolean;
|
|
111
|
-
onInvoiceLoaded?: (formattedInvoice: FormattedInvoice) => void;
|
|
112
|
-
onQuoteUnavailableError?: () => void;
|
|
113
|
-
suppressQuoteUnavailableErrorNotification?: boolean;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
type InvoiceProps = InvoiceQuoteContextProps & {
|
|
117
|
-
hidePaymentForm?: boolean;
|
|
118
|
-
onPaymentMethodSaved?: (paymentMethodId: string) => void;
|
|
119
|
-
onPaymentMethodRemoved?: (paymentMethodId: string) => void;
|
|
120
|
-
};
|
|
121
|
-
declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, hidePaymentForm, onInvoiceLoaded, onPaymentMethodSaved, onPaymentMethodRemoved, }: InvoiceProps): react.JSX.Element;
|
|
122
|
-
|
|
123
|
-
declare global {
|
|
124
|
-
interface Window {
|
|
125
|
-
heap: any;
|
|
126
|
-
PayFields: any;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
76
|
type InvoiceColumnKey = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
131
77
|
type InvoiceDateType = 'createdAt' | 'issuedAt' | 'dueAt';
|
|
132
78
|
|
|
@@ -471,5 +417,4 @@ declare function MiniCreditCard({ className, buttons, hideDropdownMenu, hideDefa
|
|
|
471
417
|
id?: string;
|
|
472
418
|
}): react.JSX.Element;
|
|
473
419
|
|
|
474
|
-
export { BillingDetails, BunnyProvider, Footer,
|
|
475
|
-
export type { Column, ColumnAlign, CursorPage, InfiniteTableQueryArgs };
|
|
420
|
+
export { BillingDetails, BunnyProvider, Footer, Invoice, Invoices, MiniCreditCard, PaymentForm, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions, UpgradeWrapper as Upgrade };
|
package/package.json
CHANGED