@growflowstudio/growflowbooking-admin-ui 1.0.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.
@@ -0,0 +1,208 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1 from 'react';
3
+ import { Fetcher, AdminTenant, AdminTenantCreate, AdminTenantUpdate, AdminTenantDetail, CustomerWithTenant, AdminCustomerCreate, AdminCustomerUpdate, SubscriptionPlan, SubscriptionPlanCreate, SubscriptionPlanUpdate } from '@growflowstudio/growflowbooking-admin-core';
4
+
5
+ /**
6
+ * Configure which booking modules are enabled for this project.
7
+ * By default, all modules are enabled.
8
+ */
9
+ interface BookingModulesConfig {
10
+ tenants?: boolean;
11
+ customers?: boolean;
12
+ subscriptionPlans?: boolean;
13
+ billingPlans?: boolean;
14
+ billingSubscriptions?: boolean;
15
+ settings?: boolean;
16
+ }
17
+ interface BookingAdminConfig {
18
+ /** Base path for booking admin API (e.g., '/api/v1') */
19
+ basePath: string;
20
+ /** HTTP fetcher function from the host application (handles auth) */
21
+ fetcher: Fetcher;
22
+ /** Locale for number/date formatting (default: 'it-IT') */
23
+ locale?: string;
24
+ /** Default currency (default: 'EUR') */
25
+ currency?: string;
26
+ /** Enable/disable booking modules. All enabled by default. */
27
+ modules?: BookingModulesConfig;
28
+ }
29
+ declare function useBookingAdminConfig(): BookingAdminConfig;
30
+ /** Returns the resolved modules config (with defaults applied) */
31
+ declare function useEnabledModules(): Required<BookingModulesConfig>;
32
+ interface BookingAdminProviderProps {
33
+ config: BookingAdminConfig;
34
+ children: React$1.ReactNode;
35
+ }
36
+ declare function BookingAdminProvider({ config, children }: BookingAdminProviderProps): react_jsx_runtime.JSX.Element;
37
+
38
+ interface TenantsPageProps {
39
+ wrapper?: React.ComponentType<{
40
+ children: React.ReactNode;
41
+ }>;
42
+ header?: React.ReactNode;
43
+ }
44
+ declare function TenantsPage({ wrapper: Wrapper, header }: TenantsPageProps): react_jsx_runtime.JSX.Element;
45
+
46
+ interface CustomersPageProps {
47
+ wrapper?: React.ComponentType<{
48
+ children: React.ReactNode;
49
+ }>;
50
+ header?: React.ReactNode;
51
+ }
52
+ declare function CustomersPage({ wrapper: Wrapper, header }: CustomersPageProps): react_jsx_runtime.JSX.Element;
53
+
54
+ interface SubscriptionPlansPageProps {
55
+ wrapper?: React.ComponentType<{
56
+ children: React.ReactNode;
57
+ }>;
58
+ header?: React.ReactNode;
59
+ }
60
+ declare function SubscriptionPlansPage({ wrapper: Wrapper, header }: SubscriptionPlansPageProps): react_jsx_runtime.JSX.Element;
61
+
62
+ interface BillingPlansPageProps {
63
+ wrapper?: React.ComponentType<{
64
+ children: React.ReactNode;
65
+ }>;
66
+ header?: React.ReactNode;
67
+ }
68
+ declare function BillingPlansPage({ wrapper: Wrapper, header }: BillingPlansPageProps): react_jsx_runtime.JSX.Element;
69
+
70
+ interface BillingSubscriptionsPageProps {
71
+ wrapper?: React.ComponentType<{
72
+ children: React.ReactNode;
73
+ }>;
74
+ header?: React.ReactNode;
75
+ }
76
+ declare function BillingSubscriptionsPage({ wrapper: Wrapper, header }: BillingSubscriptionsPageProps): react_jsx_runtime.JSX.Element;
77
+
78
+ interface SettingsPageProps {
79
+ wrapper?: React.ComponentType<{
80
+ children: React.ReactNode;
81
+ }>;
82
+ header?: React.ReactNode;
83
+ }
84
+ declare function SettingsPage({ wrapper: Wrapper, header }: SettingsPageProps): react_jsx_runtime.JSX.Element;
85
+
86
+ interface TenantsTableProps {
87
+ tenants: AdminTenant[];
88
+ isLoading: boolean;
89
+ onEdit: (tenant: AdminTenant) => void;
90
+ onDelete: (tenant: AdminTenant) => void;
91
+ onView: (tenant: AdminTenant) => void;
92
+ }
93
+ declare function TenantsTable({ tenants, isLoading, onEdit, onDelete, onView }: TenantsTableProps): react_jsx_runtime.JSX.Element;
94
+
95
+ interface TenantFormDialogProps {
96
+ isOpen: boolean;
97
+ onOpenChange: (open: boolean) => void;
98
+ tenant: AdminTenant | null;
99
+ onSubmit: (data: AdminTenantCreate | AdminTenantUpdate) => void;
100
+ isPending: boolean;
101
+ }
102
+ declare function TenantFormDialog({ isOpen, onOpenChange, tenant, onSubmit, isPending }: TenantFormDialogProps): react_jsx_runtime.JSX.Element | null;
103
+
104
+ interface TenantDetailDialogProps {
105
+ isOpen: boolean;
106
+ onOpenChange: (open: boolean) => void;
107
+ tenant: AdminTenantDetail | undefined;
108
+ isLoading: boolean;
109
+ }
110
+ declare function TenantDetailDialog({ isOpen, onOpenChange, tenant, isLoading }: TenantDetailDialogProps): react_jsx_runtime.JSX.Element | null;
111
+
112
+ interface CustomersTableProps {
113
+ customers: CustomerWithTenant[];
114
+ isLoading: boolean;
115
+ onEdit: (customer: CustomerWithTenant) => void;
116
+ onDelete: (customer: CustomerWithTenant) => void;
117
+ }
118
+ declare function CustomersTable({ customers, isLoading, onEdit, onDelete }: CustomersTableProps): react_jsx_runtime.JSX.Element;
119
+
120
+ interface CustomerFormDialogProps {
121
+ isOpen: boolean;
122
+ onOpenChange: (open: boolean) => void;
123
+ customer: CustomerWithTenant | null;
124
+ onSubmit: (data: AdminCustomerCreate | AdminCustomerUpdate) => void;
125
+ isPending: boolean;
126
+ tenantId?: string;
127
+ }
128
+ declare function CustomerFormDialog({ isOpen, onOpenChange, customer, onSubmit, isPending, tenantId }: CustomerFormDialogProps): react_jsx_runtime.JSX.Element | null;
129
+
130
+ interface SubscriptionPlansTableProps {
131
+ plans: SubscriptionPlan[];
132
+ isLoading: boolean;
133
+ onEdit: (plan: SubscriptionPlan) => void;
134
+ onDelete: (plan: SubscriptionPlan) => void;
135
+ }
136
+ declare function SubscriptionPlansTable({ plans, isLoading, onEdit, onDelete }: SubscriptionPlansTableProps): react_jsx_runtime.JSX.Element;
137
+
138
+ interface SubscriptionPlanFormDialogProps {
139
+ isOpen: boolean;
140
+ onOpenChange: (open: boolean) => void;
141
+ plan: SubscriptionPlan | null;
142
+ onSubmit: (data: SubscriptionPlanCreate | SubscriptionPlanUpdate) => void;
143
+ isPending: boolean;
144
+ }
145
+ declare function SubscriptionPlanFormDialog({ isOpen, onOpenChange, plan, onSubmit, isPending }: SubscriptionPlanFormDialogProps): react_jsx_runtime.JSX.Element | null;
146
+
147
+ interface DeleteConfirmDialogProps {
148
+ isOpen: boolean;
149
+ onOpenChange: (open: boolean) => void;
150
+ title?: string;
151
+ description: React$1.ReactNode;
152
+ onConfirm: () => void;
153
+ isDeleting: boolean;
154
+ confirmLabel?: string;
155
+ cancelLabel?: string;
156
+ }
157
+ declare function DeleteConfirmDialog({ isOpen, onOpenChange, title, description, onConfirm, isDeleting, confirmLabel, cancelLabel, }: DeleteConfirmDialogProps): react_jsx_runtime.JSX.Element | null;
158
+
159
+ interface FilterOption {
160
+ value: string;
161
+ label: string;
162
+ }
163
+ interface FilterBarProps {
164
+ searchPlaceholder?: string;
165
+ searchValue: string;
166
+ onSearchChange: (value: string) => void;
167
+ statusFilter?: string;
168
+ onStatusFilterChange?: (value: string) => void;
169
+ statusOptions?: FilterOption[];
170
+ onRefresh: () => void;
171
+ }
172
+ declare function FilterBar({ searchPlaceholder, searchValue, onSearchChange, statusFilter, onStatusFilterChange, statusOptions, onRefresh, }: FilterBarProps): react_jsx_runtime.JSX.Element;
173
+
174
+ interface StatusBadgeProps {
175
+ label: string;
176
+ colorClass: string;
177
+ className?: string;
178
+ }
179
+ declare function StatusBadge({ label, colorClass, className }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
180
+
181
+ interface SkeletonRowsProps {
182
+ rows?: number;
183
+ columns?: number;
184
+ }
185
+ declare function SkeletonRows({ rows, columns }: SkeletonRowsProps): react_jsx_runtime.JSX.Element;
186
+
187
+ interface PaginationProps {
188
+ page: number;
189
+ pageSize: number;
190
+ total: number;
191
+ onPageChange: (page: number) => void;
192
+ }
193
+ declare function Pagination({ page, pageSize, total, onPageChange }: PaginationProps): react_jsx_runtime.JSX.Element;
194
+
195
+ interface BookingNavItem {
196
+ key: string;
197
+ label: string;
198
+ /** Lucide icon name (consumer maps to actual icon component) */
199
+ icon: string;
200
+ /** Suggested href path (consumer can override) */
201
+ href: string;
202
+ }
203
+ /**
204
+ * Returns navigation items filtered by enabled modules.
205
+ */
206
+ declare function getBookingNavItems(modules?: BookingModulesConfig, basePath?: string): BookingNavItem[];
207
+
208
+ export { BillingPlansPage, type BillingPlansPageProps, BillingSubscriptionsPage, type BillingSubscriptionsPageProps, type BookingAdminConfig, BookingAdminProvider, type BookingAdminProviderProps, type BookingModulesConfig, type BookingNavItem, CustomerFormDialog, CustomersPage, type CustomersPageProps, CustomersTable, DeleteConfirmDialog, FilterBar, Pagination, SettingsPage, type SettingsPageProps, SkeletonRows, StatusBadge, SubscriptionPlanFormDialog, SubscriptionPlansPage, type SubscriptionPlansPageProps, SubscriptionPlansTable, TenantDetailDialog, TenantFormDialog, TenantsPage, type TenantsPageProps, TenantsTable, getBookingNavItems, useBookingAdminConfig, useEnabledModules };
@@ -0,0 +1,208 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1 from 'react';
3
+ import { Fetcher, AdminTenant, AdminTenantCreate, AdminTenantUpdate, AdminTenantDetail, CustomerWithTenant, AdminCustomerCreate, AdminCustomerUpdate, SubscriptionPlan, SubscriptionPlanCreate, SubscriptionPlanUpdate } from '@growflowstudio/growflowbooking-admin-core';
4
+
5
+ /**
6
+ * Configure which booking modules are enabled for this project.
7
+ * By default, all modules are enabled.
8
+ */
9
+ interface BookingModulesConfig {
10
+ tenants?: boolean;
11
+ customers?: boolean;
12
+ subscriptionPlans?: boolean;
13
+ billingPlans?: boolean;
14
+ billingSubscriptions?: boolean;
15
+ settings?: boolean;
16
+ }
17
+ interface BookingAdminConfig {
18
+ /** Base path for booking admin API (e.g., '/api/v1') */
19
+ basePath: string;
20
+ /** HTTP fetcher function from the host application (handles auth) */
21
+ fetcher: Fetcher;
22
+ /** Locale for number/date formatting (default: 'it-IT') */
23
+ locale?: string;
24
+ /** Default currency (default: 'EUR') */
25
+ currency?: string;
26
+ /** Enable/disable booking modules. All enabled by default. */
27
+ modules?: BookingModulesConfig;
28
+ }
29
+ declare function useBookingAdminConfig(): BookingAdminConfig;
30
+ /** Returns the resolved modules config (with defaults applied) */
31
+ declare function useEnabledModules(): Required<BookingModulesConfig>;
32
+ interface BookingAdminProviderProps {
33
+ config: BookingAdminConfig;
34
+ children: React$1.ReactNode;
35
+ }
36
+ declare function BookingAdminProvider({ config, children }: BookingAdminProviderProps): react_jsx_runtime.JSX.Element;
37
+
38
+ interface TenantsPageProps {
39
+ wrapper?: React.ComponentType<{
40
+ children: React.ReactNode;
41
+ }>;
42
+ header?: React.ReactNode;
43
+ }
44
+ declare function TenantsPage({ wrapper: Wrapper, header }: TenantsPageProps): react_jsx_runtime.JSX.Element;
45
+
46
+ interface CustomersPageProps {
47
+ wrapper?: React.ComponentType<{
48
+ children: React.ReactNode;
49
+ }>;
50
+ header?: React.ReactNode;
51
+ }
52
+ declare function CustomersPage({ wrapper: Wrapper, header }: CustomersPageProps): react_jsx_runtime.JSX.Element;
53
+
54
+ interface SubscriptionPlansPageProps {
55
+ wrapper?: React.ComponentType<{
56
+ children: React.ReactNode;
57
+ }>;
58
+ header?: React.ReactNode;
59
+ }
60
+ declare function SubscriptionPlansPage({ wrapper: Wrapper, header }: SubscriptionPlansPageProps): react_jsx_runtime.JSX.Element;
61
+
62
+ interface BillingPlansPageProps {
63
+ wrapper?: React.ComponentType<{
64
+ children: React.ReactNode;
65
+ }>;
66
+ header?: React.ReactNode;
67
+ }
68
+ declare function BillingPlansPage({ wrapper: Wrapper, header }: BillingPlansPageProps): react_jsx_runtime.JSX.Element;
69
+
70
+ interface BillingSubscriptionsPageProps {
71
+ wrapper?: React.ComponentType<{
72
+ children: React.ReactNode;
73
+ }>;
74
+ header?: React.ReactNode;
75
+ }
76
+ declare function BillingSubscriptionsPage({ wrapper: Wrapper, header }: BillingSubscriptionsPageProps): react_jsx_runtime.JSX.Element;
77
+
78
+ interface SettingsPageProps {
79
+ wrapper?: React.ComponentType<{
80
+ children: React.ReactNode;
81
+ }>;
82
+ header?: React.ReactNode;
83
+ }
84
+ declare function SettingsPage({ wrapper: Wrapper, header }: SettingsPageProps): react_jsx_runtime.JSX.Element;
85
+
86
+ interface TenantsTableProps {
87
+ tenants: AdminTenant[];
88
+ isLoading: boolean;
89
+ onEdit: (tenant: AdminTenant) => void;
90
+ onDelete: (tenant: AdminTenant) => void;
91
+ onView: (tenant: AdminTenant) => void;
92
+ }
93
+ declare function TenantsTable({ tenants, isLoading, onEdit, onDelete, onView }: TenantsTableProps): react_jsx_runtime.JSX.Element;
94
+
95
+ interface TenantFormDialogProps {
96
+ isOpen: boolean;
97
+ onOpenChange: (open: boolean) => void;
98
+ tenant: AdminTenant | null;
99
+ onSubmit: (data: AdminTenantCreate | AdminTenantUpdate) => void;
100
+ isPending: boolean;
101
+ }
102
+ declare function TenantFormDialog({ isOpen, onOpenChange, tenant, onSubmit, isPending }: TenantFormDialogProps): react_jsx_runtime.JSX.Element | null;
103
+
104
+ interface TenantDetailDialogProps {
105
+ isOpen: boolean;
106
+ onOpenChange: (open: boolean) => void;
107
+ tenant: AdminTenantDetail | undefined;
108
+ isLoading: boolean;
109
+ }
110
+ declare function TenantDetailDialog({ isOpen, onOpenChange, tenant, isLoading }: TenantDetailDialogProps): react_jsx_runtime.JSX.Element | null;
111
+
112
+ interface CustomersTableProps {
113
+ customers: CustomerWithTenant[];
114
+ isLoading: boolean;
115
+ onEdit: (customer: CustomerWithTenant) => void;
116
+ onDelete: (customer: CustomerWithTenant) => void;
117
+ }
118
+ declare function CustomersTable({ customers, isLoading, onEdit, onDelete }: CustomersTableProps): react_jsx_runtime.JSX.Element;
119
+
120
+ interface CustomerFormDialogProps {
121
+ isOpen: boolean;
122
+ onOpenChange: (open: boolean) => void;
123
+ customer: CustomerWithTenant | null;
124
+ onSubmit: (data: AdminCustomerCreate | AdminCustomerUpdate) => void;
125
+ isPending: boolean;
126
+ tenantId?: string;
127
+ }
128
+ declare function CustomerFormDialog({ isOpen, onOpenChange, customer, onSubmit, isPending, tenantId }: CustomerFormDialogProps): react_jsx_runtime.JSX.Element | null;
129
+
130
+ interface SubscriptionPlansTableProps {
131
+ plans: SubscriptionPlan[];
132
+ isLoading: boolean;
133
+ onEdit: (plan: SubscriptionPlan) => void;
134
+ onDelete: (plan: SubscriptionPlan) => void;
135
+ }
136
+ declare function SubscriptionPlansTable({ plans, isLoading, onEdit, onDelete }: SubscriptionPlansTableProps): react_jsx_runtime.JSX.Element;
137
+
138
+ interface SubscriptionPlanFormDialogProps {
139
+ isOpen: boolean;
140
+ onOpenChange: (open: boolean) => void;
141
+ plan: SubscriptionPlan | null;
142
+ onSubmit: (data: SubscriptionPlanCreate | SubscriptionPlanUpdate) => void;
143
+ isPending: boolean;
144
+ }
145
+ declare function SubscriptionPlanFormDialog({ isOpen, onOpenChange, plan, onSubmit, isPending }: SubscriptionPlanFormDialogProps): react_jsx_runtime.JSX.Element | null;
146
+
147
+ interface DeleteConfirmDialogProps {
148
+ isOpen: boolean;
149
+ onOpenChange: (open: boolean) => void;
150
+ title?: string;
151
+ description: React$1.ReactNode;
152
+ onConfirm: () => void;
153
+ isDeleting: boolean;
154
+ confirmLabel?: string;
155
+ cancelLabel?: string;
156
+ }
157
+ declare function DeleteConfirmDialog({ isOpen, onOpenChange, title, description, onConfirm, isDeleting, confirmLabel, cancelLabel, }: DeleteConfirmDialogProps): react_jsx_runtime.JSX.Element | null;
158
+
159
+ interface FilterOption {
160
+ value: string;
161
+ label: string;
162
+ }
163
+ interface FilterBarProps {
164
+ searchPlaceholder?: string;
165
+ searchValue: string;
166
+ onSearchChange: (value: string) => void;
167
+ statusFilter?: string;
168
+ onStatusFilterChange?: (value: string) => void;
169
+ statusOptions?: FilterOption[];
170
+ onRefresh: () => void;
171
+ }
172
+ declare function FilterBar({ searchPlaceholder, searchValue, onSearchChange, statusFilter, onStatusFilterChange, statusOptions, onRefresh, }: FilterBarProps): react_jsx_runtime.JSX.Element;
173
+
174
+ interface StatusBadgeProps {
175
+ label: string;
176
+ colorClass: string;
177
+ className?: string;
178
+ }
179
+ declare function StatusBadge({ label, colorClass, className }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
180
+
181
+ interface SkeletonRowsProps {
182
+ rows?: number;
183
+ columns?: number;
184
+ }
185
+ declare function SkeletonRows({ rows, columns }: SkeletonRowsProps): react_jsx_runtime.JSX.Element;
186
+
187
+ interface PaginationProps {
188
+ page: number;
189
+ pageSize: number;
190
+ total: number;
191
+ onPageChange: (page: number) => void;
192
+ }
193
+ declare function Pagination({ page, pageSize, total, onPageChange }: PaginationProps): react_jsx_runtime.JSX.Element;
194
+
195
+ interface BookingNavItem {
196
+ key: string;
197
+ label: string;
198
+ /** Lucide icon name (consumer maps to actual icon component) */
199
+ icon: string;
200
+ /** Suggested href path (consumer can override) */
201
+ href: string;
202
+ }
203
+ /**
204
+ * Returns navigation items filtered by enabled modules.
205
+ */
206
+ declare function getBookingNavItems(modules?: BookingModulesConfig, basePath?: string): BookingNavItem[];
207
+
208
+ export { BillingPlansPage, type BillingPlansPageProps, BillingSubscriptionsPage, type BillingSubscriptionsPageProps, type BookingAdminConfig, BookingAdminProvider, type BookingAdminProviderProps, type BookingModulesConfig, type BookingNavItem, CustomerFormDialog, CustomersPage, type CustomersPageProps, CustomersTable, DeleteConfirmDialog, FilterBar, Pagination, SettingsPage, type SettingsPageProps, SkeletonRows, StatusBadge, SubscriptionPlanFormDialog, SubscriptionPlansPage, type SubscriptionPlansPageProps, SubscriptionPlansTable, TenantDetailDialog, TenantFormDialog, TenantsPage, type TenantsPageProps, TenantsTable, getBookingNavItems, useBookingAdminConfig, useEnabledModules };