@omnikit-js/ui 0.6.0 → 0.9.1

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,349 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { c as PaymentMethod, C as Customer, E as Entitlement } from '../../types-EyXt-nzt.js';
3
+ export { Button, ButtonProps } from '@marcoschwartz/lite-ui';
4
+
5
+ interface Tab {
6
+ id: string;
7
+ label: string;
8
+ content: React.ReactNode;
9
+ }
10
+ interface TabsProps {
11
+ tabs: Tab[];
12
+ defaultTab?: string;
13
+ className?: string;
14
+ }
15
+ declare function Tabs({ tabs, defaultTab, className }: TabsProps): react_jsx_runtime.JSX.Element;
16
+
17
+ interface ModalProps {
18
+ isOpen: boolean;
19
+ onClose: () => void;
20
+ title: string;
21
+ children: React.ReactNode;
22
+ className?: string;
23
+ }
24
+ declare function Modal({ isOpen, onClose, title, children, className }: ModalProps): react_jsx_runtime.JSX.Element | null;
25
+
26
+ interface PaymentMethodManagerProps {
27
+ currentMethod: {
28
+ type: string;
29
+ last4: string;
30
+ expiry: string;
31
+ };
32
+ }
33
+ declare function PaymentMethodManager({ currentMethod }: PaymentMethodManagerProps): react_jsx_runtime.JSX.Element;
34
+
35
+ interface ActionConfig {
36
+ baseUrl: string;
37
+ apiKey?: string;
38
+ accessToken?: string;
39
+ projectId: number;
40
+ }
41
+ interface SubscriptionDisplay {
42
+ id: number;
43
+ plan: string;
44
+ status: string;
45
+ price: string;
46
+ period: string;
47
+ nextBilling: string;
48
+ cancelAtPeriodEnd?: boolean;
49
+ }
50
+ interface InvoiceDisplay {
51
+ id: string;
52
+ date: string;
53
+ amount: string;
54
+ status: string;
55
+ url: string;
56
+ }
57
+ interface PlanDisplay {
58
+ id: number;
59
+ priceId: number;
60
+ name: string;
61
+ description?: string;
62
+ price: string;
63
+ period: string;
64
+ features: string[];
65
+ current: boolean;
66
+ popular?: boolean;
67
+ }
68
+ interface BillingContentProps {
69
+ subscription: SubscriptionDisplay | null;
70
+ invoices: InvoiceDisplay[];
71
+ paymentMethods: PaymentMethod[];
72
+ plans: PlanDisplay[];
73
+ customer: Customer;
74
+ entitlements: Entitlement[];
75
+ actionConfig: ActionConfig;
76
+ className?: string;
77
+ }
78
+ declare function BillingContent({ subscription, invoices, paymentMethods, plans, customer, entitlements, actionConfig, className }: BillingContentProps): react_jsx_runtime.JSX.Element;
79
+
80
+ interface LoginFormProps {
81
+ /** API base URL (e.g., "https://api.example.com/omnikit") */
82
+ apiUrl: string;
83
+ /** Project ID for authentication scope */
84
+ projectId: number;
85
+ /** Called on successful login with user data and tokens */
86
+ onSuccess?: (data: LoginSuccessData) => void;
87
+ /** Called on login error */
88
+ onError?: (error: Error) => void;
89
+ /** Show "Remember me" checkbox */
90
+ showRememberMe?: boolean;
91
+ /** Allow login with username instead of email */
92
+ allowUsername?: boolean;
93
+ /** Custom class name for the form container */
94
+ className?: string;
95
+ /** Link to registration page */
96
+ registerLink?: string;
97
+ /** Link to forgot password page */
98
+ forgotPasswordLink?: string;
99
+ }
100
+ interface LoginSuccessData {
101
+ access_token: string;
102
+ refresh_token: string;
103
+ token_type: string;
104
+ expires_in: number;
105
+ user: {
106
+ id: number;
107
+ uuid: string;
108
+ email: string;
109
+ username: string;
110
+ display_name?: string;
111
+ project_id: number;
112
+ organization_id?: number;
113
+ default_project_id?: number;
114
+ };
115
+ organization?: {
116
+ id: number;
117
+ name: string;
118
+ slug: string;
119
+ } | null;
120
+ project?: {
121
+ id: number;
122
+ name: string;
123
+ slug: string;
124
+ } | null;
125
+ session?: {
126
+ id: string;
127
+ device_name: string;
128
+ device_type: string;
129
+ ip_address: string;
130
+ created_at: string;
131
+ expires_at: string;
132
+ };
133
+ }
134
+
135
+ declare function LoginForm({ apiUrl, projectId, onSuccess, onError, showRememberMe, allowUsername, className, registerLink, forgotPasswordLink, }: LoginFormProps): react_jsx_runtime.JSX.Element;
136
+
137
+ interface RegisterFormProps {
138
+ /** API base URL (e.g., "https://api.example.com/omnikit") */
139
+ apiUrl: string;
140
+ /** Project ID for user registration scope */
141
+ projectId: number;
142
+ /** Called on successful registration with user data and tokens */
143
+ onSuccess?: (data: RegisterSuccessData) => void;
144
+ /** Called on registration error */
145
+ onError?: (error: Error) => void;
146
+ /** Require username field (if false, generates from email) */
147
+ requireUsername?: boolean;
148
+ /** Show display name field */
149
+ showDisplayName?: boolean;
150
+ /** Show organization name field */
151
+ showOrganizationName?: boolean;
152
+ /** Show terms and conditions checkbox */
153
+ showTerms?: boolean;
154
+ /** Link to terms and conditions page */
155
+ termsLink?: string;
156
+ /** Custom class name for the form container */
157
+ className?: string;
158
+ /** Link to login page */
159
+ loginLink?: string;
160
+ }
161
+ interface RegisterSuccessData {
162
+ message: string;
163
+ access_token: string;
164
+ refresh_token: string;
165
+ token_type: string;
166
+ expires_in: number;
167
+ user: {
168
+ id: number;
169
+ uuid: string;
170
+ email: string;
171
+ username: string;
172
+ display_name?: string;
173
+ project_id: number;
174
+ organization_id?: number;
175
+ default_project_id?: number;
176
+ created_at: string;
177
+ personal_organization?: {
178
+ id: number;
179
+ name: string;
180
+ slug: string;
181
+ };
182
+ personal_project?: {
183
+ id: number;
184
+ name: string;
185
+ slug: string;
186
+ organization_id: number;
187
+ };
188
+ };
189
+ session?: {
190
+ id: string;
191
+ device_name: string;
192
+ device_type: string;
193
+ ip_address: string;
194
+ created_at: string;
195
+ expires_at: string;
196
+ };
197
+ }
198
+
199
+ declare function RegisterForm({ apiUrl, projectId, onSuccess, onError, requireUsername, showDisplayName, showOrganizationName, showTerms, termsLink, className, loginLink, }: RegisterFormProps): react_jsx_runtime.JSX.Element;
200
+
201
+ interface ForgotPasswordFormProps {
202
+ /** API base URL (e.g., "https://api.example.com/omnikit") */
203
+ apiUrl: string;
204
+ /** Project ID for authentication scope */
205
+ projectId: number;
206
+ /** Frontend URL for password reset link (e.g., "https://app.example.com/reset-password") */
207
+ resetPasswordUrl: string;
208
+ /** Called on successful request */
209
+ onSuccess?: () => void;
210
+ /** Called on error */
211
+ onError?: (error: Error) => void;
212
+ /** Custom class name for the form container */
213
+ className?: string;
214
+ /** Link to login page */
215
+ loginLink?: string;
216
+ }
217
+
218
+ declare function ForgotPasswordForm({ apiUrl, projectId, resetPasswordUrl, onSuccess, onError, className, loginLink, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
219
+
220
+ interface ResetPasswordFormProps {
221
+ /** API base URL (e.g., "https://api.example.com/omnikit") */
222
+ apiUrl: string;
223
+ /** Reset token from URL query parameter */
224
+ token: string;
225
+ /** Called on successful password reset */
226
+ onSuccess?: () => void;
227
+ /** Called on error */
228
+ onError?: (error: Error) => void;
229
+ /** Custom class name for the form container */
230
+ className?: string;
231
+ /** Link to login page */
232
+ loginLink?: string;
233
+ }
234
+
235
+ declare function ResetPasswordForm({ apiUrl, token, onSuccess, onError, className, loginLink, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
236
+
237
+ interface FileUploaderProps {
238
+ /** API base URL (e.g., "https://api.example.com/omnikit") */
239
+ apiUrl: string;
240
+ /** Project ID for storage scope */
241
+ projectId: number;
242
+ /** Target bucket ID (uses project default if not set) */
243
+ bucketId?: number;
244
+ /** Target folder ID */
245
+ folderId?: number;
246
+ /** Access level for uploaded files */
247
+ accessLevel?: 'private' | 'public';
248
+ /** Start upload immediately on file select (default: true) */
249
+ autoUpload?: boolean;
250
+ /** Max files uploading simultaneously (default: 3) */
251
+ maxConcurrentFiles?: number;
252
+ /** Max parts uploading per file (default: 5) */
253
+ maxConcurrentParts?: number;
254
+ /** File size threshold for multipart upload in bytes (default: 5MB) */
255
+ multipartThreshold?: number;
256
+ /** Part size for multipart upload in bytes (default: 5MB) */
257
+ partSize?: number;
258
+ /** Accepted file types (e.g., "image/*,video/*") */
259
+ accept?: string;
260
+ /** Max file size in bytes */
261
+ maxFileSize?: number;
262
+ /** Max number of files */
263
+ maxFiles?: number;
264
+ /** Called when a single file upload completes */
265
+ onUploadComplete?: (file: UploadedFile) => void;
266
+ /** Called when a file upload fails */
267
+ onUploadError?: (file: File, error: Error) => void;
268
+ /** Called when all uploads complete */
269
+ onAllUploadsComplete?: (files: UploadedFile[]) => void;
270
+ /** Called on progress updates */
271
+ onProgress?: (progress: UploadProgress) => void;
272
+ /** Called when files are selected (before upload) */
273
+ onFilesSelected?: (files: File[]) => void;
274
+ /** API key for authentication */
275
+ apiKey?: string;
276
+ /** JWT access token for authentication */
277
+ accessToken?: string;
278
+ /** Custom class name */
279
+ className?: string;
280
+ /** Show list of selected/uploading files (default: true) */
281
+ showFileList?: boolean;
282
+ /** Show upload progress bar (default: true) */
283
+ showProgress?: boolean;
284
+ /** Custom label text */
285
+ label?: string;
286
+ /** Custom helper text */
287
+ helperText?: string;
288
+ /** Disable the uploader */
289
+ disabled?: boolean;
290
+ }
291
+ interface UploadProgress {
292
+ /** Total number of files */
293
+ totalFiles: number;
294
+ /** Number of completed files */
295
+ completedFiles: number;
296
+ /** Currently uploading file name */
297
+ currentFile?: string;
298
+ /** Total bytes uploaded across all files */
299
+ bytesUploaded: number;
300
+ /** Total bytes to upload */
301
+ totalBytes: number;
302
+ /** Overall percentage (0-100) */
303
+ percentage: number;
304
+ /** Upload speed in bytes/sec (EMA smoothed) */
305
+ speed: number;
306
+ /** Estimated time remaining in seconds */
307
+ eta: number;
308
+ }
309
+ interface UploadedFile {
310
+ /** File ID in the database */
311
+ id: string;
312
+ /** Original file name */
313
+ name: string;
314
+ /** File size in bytes */
315
+ size: number;
316
+ /** MIME type */
317
+ mimeType: string;
318
+ /** Public URL (if available) */
319
+ url?: string;
320
+ /** Storage key/path */
321
+ storageKey?: string;
322
+ }
323
+ interface FileUploadState {
324
+ /** Unique identifier for this upload */
325
+ id: string;
326
+ /** The file being uploaded */
327
+ file: File;
328
+ /** Current status */
329
+ status: 'pending' | 'uploading' | 'completed' | 'error';
330
+ /** Upload progress (0-100) */
331
+ progress: number;
332
+ /** Error message if failed */
333
+ error?: string;
334
+ /** Uploaded file data on success */
335
+ result?: UploadedFile;
336
+ /** Bytes uploaded so far */
337
+ bytesUploaded: number;
338
+ }
339
+
340
+ declare function FileUploader({ apiUrl, projectId, bucketId, folderId, accessLevel, autoUpload, maxConcurrentFiles, maxConcurrentParts, multipartThreshold, partSize, accept, maxFileSize, maxFiles, onUploadComplete, onUploadError, onAllUploadsComplete, onProgress, onFilesSelected, apiKey, accessToken, className, showFileList, showProgress, label, helperText, disabled, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
341
+
342
+ /**
343
+ * Client Components
344
+ * These components run on the client side
345
+ */
346
+
347
+ declare const OMNIKIT_CLIENT_VERSION = "0.9.0";
348
+
349
+ export { BillingContent, type FileUploadState, FileUploader, type FileUploaderProps, ForgotPasswordForm, type ForgotPasswordFormProps, LoginForm, type LoginFormProps, type LoginSuccessData, Modal, type ModalProps, OMNIKIT_CLIENT_VERSION, PaymentMethodManager, type PaymentMethodManagerProps, RegisterForm, type RegisterFormProps, type RegisterSuccessData, ResetPasswordForm, type ResetPasswordFormProps, type Tab, Tabs, type TabsProps, type UploadProgress, type UploadedFile };