pelatform-ui 1.2.9 → 1.3.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.
Files changed (42) hide show
  1. package/README.md +254 -120
  2. package/css/theme.css +1 -59
  3. package/dist/animation.d.ts +379 -3
  4. package/dist/animation.js +1785 -2
  5. package/dist/badge-Rr33PgV_.d.ts +15 -0
  6. package/dist/base.d.ts +1452 -1
  7. package/dist/base.js +12148 -2
  8. package/dist/button-Bc3N6jWT.d.ts +22 -0
  9. package/dist/chunk-4Z3DBWB6.js +193 -0
  10. package/dist/chunk-NW6KWHKZ.js +22 -0
  11. package/dist/chunk-Q2RH7YQE.js +857 -0
  12. package/dist/{chunk-NOAZYT3J.js → chunk-V3ET2B55.js} +2 -4
  13. package/dist/chunk-XKN6BR2K.js +59 -0
  14. package/dist/components.d.ts +472 -2129
  15. package/dist/components.js +969 -1421
  16. package/dist/hooks.d.ts +1197 -4
  17. package/dist/hooks.js +912 -5
  18. package/dist/index.d.ts +7 -84
  19. package/dist/index.js +1 -623
  20. package/dist/radix.d.ts +1440 -1
  21. package/dist/radix.js +11360 -2
  22. package/package.json +33 -22
  23. package/css/components/apexcharts.css +0 -101
  24. package/css/components/book.css +0 -19
  25. package/css/components/extra.css +0 -12
  26. package/css/components/image-input.css +0 -51
  27. package/css/components/leaflet.css +0 -25
  28. package/css/components/patterns.css +0 -34
  29. package/css/components/rating.css +0 -89
  30. package/css/components/scrollable.css +0 -118
  31. package/css/components/theme-transition.css +0 -51
  32. package/dist/chunk-HW52LCWN.js +0 -22
  33. package/dist/chunk-QEWGMDVY.js +0 -10
  34. package/dist/colors-CUDWvz1g.d.ts +0 -42
  35. package/dist/components-B1rw2xzN.d.ts +0 -46
  36. package/dist/utils.d.ts +0 -6
  37. package/dist/utils.js +0 -14
  38. /package/css/{shadcn → color}/gray.css +0 -0
  39. /package/css/{shadcn → color}/neutral.css +0 -0
  40. /package/css/{shadcn → color}/slate.css +0 -0
  41. /package/css/{shadcn → color}/stone.css +0 -0
  42. /package/css/{shadcn → color}/zinc.css +0 -0
package/dist/hooks.d.ts CHANGED
@@ -1,5 +1,643 @@
1
- export * from '@pelatform/ui.hook';
2
- import { M as META_THEME_COLORS } from './colors-CUDWvz1g.js';
1
+ import * as React from 'react';
2
+ import React__default, { DragEvent, ChangeEvent, InputHTMLAttributes, ComponentType, SVGProps, RefObject } from 'react';
3
+ import { META_THEME_COLORS } from '@pelatform/utils';
4
+
5
+ /**
6
+ * Analytics tracking hook for React components
7
+ * Provides utilities for tracking CRUD operations and user interactions
8
+ * with Google Analytics integration
9
+ */
10
+ /**
11
+ * Type definition for window with Google Analytics gtag function
12
+ * This extends the Window interface to include the gtag function
13
+ * that's injected by the Google Analytics script
14
+ * This implementation matches the global declaration in analytics.ts
15
+ */
16
+ interface GtagWindow extends Window {
17
+ gtag?: (command: "event" | "config" | "set", targetId: string, config?: Record<string, string | number | boolean | object | null | undefined>) => void;
18
+ }
19
+ /**
20
+ * Main application modules for analytics tracking
21
+ * Comprehensive SaaS platform modules
22
+ */
23
+ type ModuleType = "workspace" | "user" | "billing" | "analytics" | "integration" | "content" | "communication" | "system" | "security" | "automation" | "ecommerce";
24
+ /**
25
+ * Workspace module specific submodules
26
+ * Core workspace management functionality
27
+ */
28
+ type WorkspaceSubModuleType = "workspaces" | "projects" | "teams" | "collaboration" | "templates" | "workflows" | "dashboard" | "kanban" | "calendar" | "files";
29
+ /**
30
+ * User module specific submodules
31
+ * User management and authentication
32
+ */
33
+ type UserSubModuleType = "users" | "profiles" | "roles" | "permissions" | "groups" | "invitations" | "authentication" | "sessions" | "preferences" | "activity";
34
+ /**
35
+ * Billing module specific submodules
36
+ * Subscription and payment management
37
+ */
38
+ type BillingSubModuleType = "subscriptions" | "plans" | "invoices" | "payments" | "credits" | "usage" | "discounts" | "taxes" | "refunds" | "billing_history";
39
+ /**
40
+ * Analytics module specific submodules
41
+ * Data analytics and reporting
42
+ */
43
+ type AnalyticsSubModuleType = "reports" | "dashboards" | "metrics" | "events" | "funnels" | "cohorts" | "segments" | "exports" | "real_time" | "custom_reports";
44
+ /**
45
+ * Integration module specific submodules
46
+ * Third-party integrations and APIs
47
+ */
48
+ type IntegrationSubModuleType = "api_keys" | "webhooks" | "oauth" | "connectors" | "sync" | "imports" | "exports" | "marketplace" | "custom_integrations" | "rate_limits";
49
+ /**
50
+ * Content module specific submodules
51
+ * Content management and media
52
+ */
53
+ type ContentSubModuleType = "documents" | "media" | "assets" | "libraries" | "versions" | "comments" | "reviews" | "publishing" | "cdn" | "storage";
54
+ /**
55
+ * Communication module specific submodules
56
+ * Messaging and notification systems
57
+ */
58
+ type CommunicationSubModuleType = "notifications" | "emails" | "sms" | "chat" | "announcements" | "broadcasts" | "templates" | "campaigns" | "channels" | "delivery";
59
+ /**
60
+ * System module specific submodules
61
+ * System administration and maintenance
62
+ */
63
+ type SystemSubModuleType = "settings" | "configurations" | "logs" | "monitoring" | "backups" | "maintenance" | "health_checks" | "performance" | "database" | "cache";
64
+ /**
65
+ * Security module specific submodules
66
+ * Security and compliance features
67
+ */
68
+ type SecuritySubModuleType = "audit_logs" | "access_control" | "encryption" | "compliance" | "threats" | "vulnerabilities" | "certificates" | "firewall" | "monitoring" | "incidents";
69
+ /**
70
+ * Automation module specific submodules
71
+ * Workflow automation and triggers
72
+ */
73
+ type AutomationSubModuleType = "workflows" | "triggers" | "actions" | "conditions" | "schedules" | "pipelines" | "bots" | "scripts" | "rules" | "execution_logs";
74
+ /**
75
+ * E-commerce module specific submodules
76
+ * Online store and transaction management
77
+ */
78
+ type EcommerceSubModuleType = "products" | "categories" | "inventory" | "orders" | "customers" | "payments" | "shipping" | "discounts" | "reviews" | "analytics";
79
+ /**
80
+ * Union type of all possible submodules
81
+ * Combines all module-specific submodule types for comprehensive tracking
82
+ */
83
+ type SubModuleType = WorkspaceSubModuleType | UserSubModuleType | BillingSubModuleType | AnalyticsSubModuleType | IntegrationSubModuleType | ContentSubModuleType | CommunicationSubModuleType | SystemSubModuleType | SecuritySubModuleType | AutomationSubModuleType | EcommerceSubModuleType;
84
+ /**
85
+ * Hook for tracking analytics events in React components
86
+ *
87
+ * This hook provides methods for tracking CRUD operations
88
+ * with proper typing and structure for Google Analytics.
89
+ *
90
+ * @returns Object containing tracking methods for different CRUD operations
91
+ *
92
+ * @example
93
+ * ```tsx
94
+ * // Workspace management tracking
95
+ * function WorkspaceManagement() {
96
+ * const { trackCreate, trackUpdate, trackDelete, trackView } = useAnalytics();
97
+ *
98
+ * const handleCreateWorkspace = async (workspaceData) => {
99
+ * const workspace = await createWorkspace(workspaceData);
100
+ * trackCreate('workspace', 'workspaces', 'workspace', workspace.id);
101
+ * };
102
+ *
103
+ * const handleViewProject = (projectId) => {
104
+ * trackView('workspace', 'projects', 'project', projectId);
105
+ * };
106
+ *
107
+ * return <WorkspaceForm onSubmit={handleCreateWorkspace} />;
108
+ * }
109
+ *
110
+ * // Billing and subscription tracking
111
+ * function BillingDashboard() {
112
+ * const { trackUpdate, trackView } = useAnalytics();
113
+ *
114
+ * const handleUpgradePlan = async (planId) => {
115
+ * await upgradePlan(planId);
116
+ * trackUpdate('billing', 'subscriptions', 'plan', planId);
117
+ * };
118
+ *
119
+ * const handleViewInvoice = (invoiceId) => {
120
+ * trackView('billing', 'invoices', 'invoice', invoiceId);
121
+ * };
122
+ *
123
+ * return <BillingInterface onUpgrade={handleUpgradePlan} />;
124
+ * }
125
+ *
126
+ * // User management tracking
127
+ * function UserManagement() {
128
+ * const { trackCreate, trackUpdate } = useAnalytics();
129
+ *
130
+ * const handleInviteUser = async (email, role) => {
131
+ * const invitation = await inviteUser(email, role);
132
+ * trackCreate('user', 'invitations', 'invitation', invitation.id);
133
+ * };
134
+ *
135
+ * const handleUpdatePermissions = async (userId, permissions) => {
136
+ * await updateUserPermissions(userId, permissions);
137
+ * trackUpdate('user', 'permissions', 'permission', userId);
138
+ * };
139
+ *
140
+ * return <UserInviteForm onInvite={handleInviteUser} />;
141
+ * }
142
+ *
143
+ * // Integration and automation tracking
144
+ * function IntegrationSettings() {
145
+ * const { trackCreate, trackUpdate } = useAnalytics();
146
+ *
147
+ * const handleCreateWebhook = async (webhookData) => {
148
+ * const webhook = await createWebhook(webhookData);
149
+ * trackCreate('integration', 'webhooks', 'webhook', webhook.id);
150
+ * };
151
+ *
152
+ * const handleUpdateWorkflow = async (workflowId, updates) => {
153
+ * await updateWorkflow(workflowId, updates);
154
+ * trackUpdate('automation', 'workflows', 'workflow', workflowId);
155
+ * };
156
+ *
157
+ * return <IntegrationPanel onCreate={handleCreateWebhook} />;
158
+ * }
159
+ * ```
160
+ */
161
+ declare const useAnalytics: () => {
162
+ trackCreate: (module: ModuleType, submodule: SubModuleType, itemType: string, itemId?: string) => void;
163
+ trackUpdate: (module: ModuleType, submodule: SubModuleType, itemType: string, itemId: string) => void;
164
+ trackDelete: (module: ModuleType, submodule: SubModuleType, itemType: string, itemId: string, isHardDelete?: boolean) => void;
165
+ };
166
+
167
+ /**
168
+ * Body class management hook for React components
169
+ * Dynamically adds and removes CSS classes from the document body element
170
+ * Useful for global styling based on component state or route changes
171
+ */
172
+ /**
173
+ * Hook to dynamically add and remove CSS classes from the document body
174
+ *
175
+ * This hook automatically manages the lifecycle of body classes:
176
+ * - Adds classes when the component mounts
177
+ * - Removes classes when the component unmounts
178
+ * - Updates classes when the className prop changes
179
+ *
180
+ * @param className - Space-separated string of CSS class names to apply to body
181
+ *
182
+ * @example
183
+ * ```tsx
184
+ * // Single class
185
+ * useBodyClasses('dark-theme');
186
+ *
187
+ * // Multiple classes
188
+ * useBodyClasses('modal-open overflow-hidden');
189
+ *
190
+ * // Conditional classes
191
+ * useBodyClasses(isModalOpen ? 'modal-open' : '');
192
+ * ```
193
+ */
194
+ declare const useBodyClasses: (className: string) => void;
195
+
196
+ /**
197
+ * Clipboard copy functionality hook for React components
198
+ * Provides a simple interface for copying text to clipboard with feedback
199
+ * Includes automatic state management and timeout handling
200
+ */
201
+ /**
202
+ * Configuration options for the copy to clipboard hook
203
+ */
204
+ interface UseCopyToClipboardOptions {
205
+ /** Duration in milliseconds to show the copied state (default: 2000ms) */
206
+ timeout?: number;
207
+ /** Callback function executed after successful copy operation */
208
+ onCopy?: () => void;
209
+ }
210
+ /**
211
+ * Hook for copying text to clipboard with automatic state management
212
+ *
213
+ * Features:
214
+ * - Automatic copied state management with timeout
215
+ * - Browser compatibility checks
216
+ * - Error handling for failed copy operations
217
+ * - Optional callback for successful copies
218
+ *
219
+ * @param options - Configuration options for the hook
220
+ * @returns Object containing copied state and copy function
221
+ *
222
+ * @example
223
+ * ```tsx
224
+ * const { copied, copy } = useCopyToClipboard({
225
+ * timeout: 3000,
226
+ * onCopy: () => toast.success('Copied to clipboard!')
227
+ * });
228
+ *
229
+ * return (
230
+ * <button onClick={() => copy('Hello World')}>
231
+ * {copied ? 'Copied!' : 'Copy Text'}
232
+ * </button>
233
+ * );
234
+ * ```
235
+ */
236
+ declare function useCopyToClipboard({ timeout, onCopy }?: UseCopyToClipboardOptions): {
237
+ /** Whether text was recently copied (true for timeout duration) */
238
+ copied: boolean;
239
+ /** Function to copy text to clipboard */
240
+ copy: (value: string) => void;
241
+ };
242
+
243
+ /**
244
+ * File upload functionality hook for React components
245
+ * Provides comprehensive file upload capabilities with drag & drop support
246
+ * Includes validation, preview generation, and state management
247
+ */
248
+
249
+ /**
250
+ * Metadata structure for uploaded files
251
+ */
252
+ type FileMetadata = {
253
+ /** The name of the file */
254
+ name: string;
255
+ /** The size of the file in bytes */
256
+ size: number;
257
+ /** The MIME type of the file */
258
+ type: string;
259
+ /** The URL where the file can be accessed */
260
+ url: string;
261
+ /** Unique identifier for the file */
262
+ id: string;
263
+ };
264
+ /**
265
+ * File object with preview capabilities
266
+ */
267
+ type FileWithPreview = {
268
+ /** The actual file object or metadata */
269
+ file: File | FileMetadata;
270
+ /** Unique identifier for the file */
271
+ id: string;
272
+ /** Optional preview URL for the file (typically for images) */
273
+ preview?: string;
274
+ };
275
+ /**
276
+ * Configuration options for the file upload hook
277
+ */
278
+ type FileUploadOptions = {
279
+ /** Maximum number of files allowed (only used when multiple is true, defaults to Infinity) */
280
+ maxFiles?: number;
281
+ /** Maximum file size in bytes (defaults to Infinity) */
282
+ maxSize?: number;
283
+ /** Accepted file types (MIME types or extensions, defaults to '*') */
284
+ accept?: string;
285
+ /** Whether multiple files can be selected (defaults to false) */
286
+ multiple?: boolean;
287
+ /** Initial files to populate the upload state */
288
+ initialFiles?: FileMetadata[];
289
+ /** Callback function executed when files change */
290
+ onFilesChange?: (files: FileWithPreview[]) => void;
291
+ /** Callback function executed when new files are added */
292
+ onFilesAdded?: (addedFiles: FileWithPreview[]) => void;
293
+ onError?: (errors: string[]) => void;
294
+ };
295
+ /**
296
+ * Current state of the file upload component
297
+ */
298
+ type FileUploadState = {
299
+ /** Array of files currently selected/uploaded */
300
+ files: FileWithPreview[];
301
+ /** Whether the user is currently dragging files over the drop zone */
302
+ isDragging: boolean;
303
+ /** Array of validation error messages */
304
+ errors: string[];
305
+ };
306
+ /**
307
+ * Actions available for file upload management
308
+ */
309
+ type FileUploadActions = {
310
+ /** Add new files to the upload state */
311
+ addFiles: (files: FileList | File[]) => void;
312
+ /** Remove a specific file by its ID */
313
+ removeFile: (id: string) => void;
314
+ /** Clear all files from the upload state */
315
+ clearFiles: () => void;
316
+ /** Clear all error messages */
317
+ clearErrors: () => void;
318
+ /** Handle drag enter event for drop zone */
319
+ handleDragEnter: (e: DragEvent<HTMLElement>) => void;
320
+ /** Handle drag leave event for drop zone */
321
+ handleDragLeave: (e: DragEvent<HTMLElement>) => void;
322
+ /** Handle drag over event for drop zone */
323
+ handleDragOver: (e: DragEvent<HTMLElement>) => void;
324
+ /** Handle drop event for drop zone */
325
+ handleDrop: (e: DragEvent<HTMLElement>) => void;
326
+ /** Handle file input change event */
327
+ handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
328
+ /** Programmatically open the file dialog */
329
+ openFileDialog: () => void;
330
+ /** Get props for the file input element */
331
+ getInputProps: (props?: InputHTMLAttributes<HTMLInputElement>) => InputHTMLAttributes<HTMLInputElement> & {
332
+ ref: React__default.Ref<HTMLInputElement>;
333
+ };
334
+ };
335
+ /**
336
+ * Hook for comprehensive file upload functionality with drag & drop support
337
+ *
338
+ * Features:
339
+ * - Single and multiple file upload support
340
+ * - Drag and drop functionality
341
+ * - File validation (size, type, count)
342
+ * - Preview generation for images
343
+ * - Error handling and state management
344
+ * - Duplicate file detection
345
+ * - Memory cleanup for object URLs
346
+ *
347
+ * @param options - Configuration options for the file upload hook
348
+ * @returns Tuple containing current state and available actions
349
+ *
350
+ * @example
351
+ * ```tsx
352
+ * const [state, actions] = useFileUpload({
353
+ * maxFiles: 5,
354
+ * maxSize: 10 * 1024 * 1024, // 10MB
355
+ * accept: 'image/*',
356
+ * multiple: true,
357
+ * onFilesChange: (files) => console.log('Files changed:', files),
358
+ * onFilesAdded: (newFiles) => console.log('New files added:', newFiles)
359
+ * });
360
+ *
361
+ * return (
362
+ * <div
363
+ * onDragEnter={actions.handleDragEnter}
364
+ * onDragLeave={actions.handleDragLeave}
365
+ * onDragOver={actions.handleDragOver}
366
+ * onDrop={actions.handleDrop}
367
+ * >
368
+ * <input {...actions.getInputProps()} />
369
+ * <button onClick={actions.openFileDialog}>
370
+ * Upload Files
371
+ * </button>
372
+ * {state.files.map(file => (
373
+ * <div key={file.id}>
374
+ * {file.file.name}
375
+ * <button onClick={() => actions.removeFile(file.id)}>
376
+ * Remove
377
+ * </button>
378
+ * </div>
379
+ * ))}
380
+ * </div>
381
+ * );
382
+ * ```
383
+ */
384
+ declare const useFileUpload: (options?: FileUploadOptions) => [FileUploadState, FileUploadActions];
385
+ /**
386
+ * Helper function to format bytes to human-readable format
387
+ *
388
+ * @param bytes - The number of bytes to format
389
+ * @param decimals - Number of decimal places to show (default: 2)
390
+ * @returns Formatted string with appropriate unit (e.g., "1.5 MB")
391
+ *
392
+ * @example
393
+ * ```tsx
394
+ * formatBytes(1024); // "1 KB"
395
+ * formatBytes(1536, 1); // "1.5 KB"
396
+ * formatBytes(1048576); // "1 MB"
397
+ * ```
398
+ */
399
+ declare const formatBytes: (bytes: number, decimals?: number) => string;
400
+
401
+ /**
402
+ * Hook that indicates whether code is executing on the client after hydration
403
+ *
404
+ * Features:
405
+ * - SSR-safe: returns `false` on the server to avoid hydration mismatches
406
+ * - Client-stable: returns `true` after hydration and remains stable
407
+ * - Minimal overhead: uses a no-op external store subscription
408
+ *
409
+ * @returns Boolean indicating hydration state (`true` on client, `false` on server)
410
+ *
411
+ * @example
412
+ * ```tsx
413
+ * // Conditionally render client-only components safely
414
+ * function ClientOnly() {
415
+ * const hydrated = useHydrated();
416
+ * if (!hydrated) return null;
417
+ * return <InteractiveChart />;
418
+ * }
419
+ * ```
420
+ *
421
+ * @since 1.0.0
422
+ */
423
+ declare function useHydrated(): boolean;
424
+
425
+ /**
426
+ * Intersection observer hook for React components
427
+ * Efficiently observes visibility of DOM elements using a shared IntersectionObserver instance.
428
+ * Ideal for lazy loading, infinite scrolling, and animating elements when they enter the viewport.
429
+ */
430
+
431
+ /**
432
+ * Configuration options for the `useIntersectionObserver` hook.
433
+ *
434
+ * Extends the native `IntersectionObserverInit` options with an additional
435
+ * convenience flag for freezing the observer state.
436
+ */
437
+ interface IntersectionObserverOptions extends IntersectionObserverInit {
438
+ /**
439
+ * When `true`, the hook stops observing once the element becomes visible
440
+ * and keeps returning `true` for subsequent renders.
441
+ *
442
+ * This is useful for one-time animations or lazy loading where you only
443
+ * care about the first time an element enters the viewport.
444
+ */
445
+ freezeOnceVisible?: boolean;
446
+ }
447
+ /**
448
+ * React hook that tracks whether a DOM element is currently intersecting the viewport.
449
+ *
450
+ * Features:
451
+ * - Uses a shared `IntersectionObserver` instance for better performance.
452
+ * - Supports custom `threshold`, `root`, and `rootMargin` options.
453
+ * - Optional `freezeOnceVisible` flag to stop observing after first intersection.
454
+ *
455
+ * @param elementRef - React ref pointing to the DOM element to observe.
456
+ * @param options - Optional observer configuration and behavior flags.
457
+ * @param options.threshold - Intersection threshold(s) for triggering visibility changes.
458
+ * @param options.root - Scrollable ancestor element to use as the viewport (defaults to browser viewport).
459
+ * @param options.rootMargin - Margin around the root, expressed in CSS units (e.g. `"0px 0px -20% 0px"`).
460
+ * @param options.freezeOnceVisible - When `true`, stops observing after the element first becomes visible.
461
+ *
462
+ * @returns `true` when the element is intersecting based on the given options, otherwise `false`.
463
+ *
464
+ * @example
465
+ * ```tsx
466
+ * const ref = React.useRef<HTMLDivElement | null>(null);
467
+ * const isVisible = useIntersectionObserver(ref, {
468
+ * threshold: 0.2,
469
+ * rootMargin: "0px 0px -10% 0px",
470
+ * freezeOnceVisible: true,
471
+ * });
472
+ *
473
+ * return (
474
+ * <div ref={ref} className={isVisible ? "animate-in" : "opacity-0"}>
475
+ * I will animate when I enter the viewport.
476
+ * </div>
477
+ * );
478
+ * ```
479
+ */
480
+ declare function useIntersectionObserver(elementRef: React.RefObject<Element | null>, { threshold, root, rootMargin, freezeOnceVisible, }?: IntersectionObserverOptions): boolean;
481
+
482
+ /**
483
+ * Platform detection hook for React components
484
+ * Determines whether the current user agent is running on a macOS device.
485
+ * Useful for rendering platform-specific keyboard shortcuts or UI variations.
486
+ */
487
+ /**
488
+ * React hook that returns whether the current platform is macOS.
489
+ *
490
+ * This hook:
491
+ * - Runs only on the client (browser) side.
492
+ * - Checks `navigator.platform` and normalizes the value to uppercase.
493
+ * - Returns a boolean indicating if the platform contains `"MAC"`.
494
+ *
495
+ * @returns `true` if the current platform is macOS, otherwise `false`.
496
+ *
497
+ * @example
498
+ * ```tsx
499
+ * const isMac = useIsMac();
500
+ *
501
+ * return (
502
+ * <kbd>
503
+ * {isMac ? "⌘" : "Ctrl"} + K
504
+ * </kbd>
505
+ * );
506
+ * ```
507
+ */
508
+ declare function useIsMac(): boolean;
509
+
510
+ /**
511
+ * Media query hook for responsive React components
512
+ * Provides real-time tracking of CSS media query matches
513
+ * with SSR-safe implementation and automatic cleanup
514
+ */
515
+ /**
516
+ * Hook for tracking CSS media query matches in React components
517
+ *
518
+ * Features:
519
+ * - Real-time updates when media query state changes
520
+ * - SSR-safe implementation
521
+ * - Automatic event listener cleanup
522
+ * - Supports all standard CSS media queries
523
+ *
524
+ * @param query - CSS media query string (e.g., '(min-width: 768px)')
525
+ * @returns Boolean indicating whether the media query currently matches
526
+ *
527
+ * @example
528
+ * ```tsx
529
+ * // Basic responsive behavior
530
+ * const isMobile = useMediaQuery('(max-width: 768px)');
531
+ * const isTablet = useMediaQuery('(min-width: 769px) and (max-width: 1024px)');
532
+ * const isDesktop = useMediaQuery('(min-width: 1025px)');
533
+ *
534
+ * // Dark mode preference
535
+ * const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');
536
+ *
537
+ * // Reduced motion preference
538
+ * const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
539
+ *
540
+ * return (
541
+ * <div>
542
+ * {isMobile && <MobileLayout />}
543
+ * {isTablet && <TabletLayout />}
544
+ * {isDesktop && <DesktopLayout />}
545
+ * </div>
546
+ * );
547
+ * ```
548
+ */
549
+ declare const useMediaQuery: (query: string) => boolean;
550
+
551
+ /**
552
+ * Menu navigation utilities hook for dashboard layouts
553
+ * Provides comprehensive menu state management and navigation helpers
554
+ * Handles active states, breadcrumbs, and hierarchical menu structures
555
+ */
556
+
557
+ /**
558
+ * Menu item interface
559
+ */
560
+ interface MenuItem {
561
+ /** Heading text */
562
+ heading?: string;
563
+ /** Menu item title */
564
+ title?: string;
565
+ /** Navigation path */
566
+ path?: string;
567
+ /** Menu item icon component */
568
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
569
+ /** Whether to show separator */
570
+ separator?: boolean;
571
+ /** Root path for active state matching */
572
+ rootPath?: string;
573
+ /** Child menu items */
574
+ children?: MenuConfig;
575
+ /** Children index for nested items */
576
+ childrenIndex?: number;
577
+ /** Whether the item is external */
578
+ external?: boolean;
579
+ /** Whether the item is disabled */
580
+ disabled?: boolean;
581
+ /** Disable text */
582
+ disabledText?: string;
583
+ /** Badge text */
584
+ badge?: string;
585
+ /** Badge variant */
586
+ badgeVariant?: "primary" | "destructive" | "success" | "info" | "warning" | "secondary" | "outline";
587
+ /** Collapse configuration */
588
+ collapse?: boolean;
589
+ /** Title when collapsed */
590
+ collapseTitle?: string;
591
+ /** Title when expanded */
592
+ expandTitle?: string;
593
+ }
594
+ /**
595
+ * Type aliases for backward compatibility
596
+ */
597
+ type MenuConfig = MenuItem[];
598
+ /** Return type interface for useMenu hook */
599
+ interface UseMenuReturn {
600
+ /** Check if a specific path is currently active */
601
+ isActive: (path: string | undefined) => boolean;
602
+ /** Check if any child menu item is currently active */
603
+ hasActiveChild: (children: MenuItem[] | undefined) => boolean;
604
+ /** Check if a menu item (including its children) is currently active */
605
+ isItemActive: (item: MenuItem) => boolean;
606
+ /** Get the currently active menu item from the menu configuration */
607
+ getCurrentItem: (items: MenuConfig) => MenuItem | undefined;
608
+ /** Generate breadcrumb trail for the current active path */
609
+ getBreadcrumb: (items: MenuConfig) => MenuItem[];
610
+ /** Get child menu items at a specific level for the current active path */
611
+ getChildren: (items: MenuConfig, level: number) => MenuConfig | null;
612
+ }
613
+ /**
614
+ * Hook for managing menu navigation state and utilities
615
+ *
616
+ * This hook provides comprehensive menu management functionality including:
617
+ * - Active state detection for menu items and paths
618
+ * - Hierarchical menu navigation support
619
+ * - Breadcrumb generation for current navigation path
620
+ * - Child menu extraction at specific levels
621
+ * - Support for nested menu structures
622
+ *
623
+ * @param pathname - Current pathname from router or location
624
+ * @returns Object containing menu utility functions
625
+ *
626
+ * @example
627
+ * ```tsx
628
+ * const { isActive, getBreadcrumb, getCurrentItem } = useMenu(pathname);
629
+ *
630
+ * // Check if path is active
631
+ * const isHomeActive = isActive('/dashboard');
632
+ *
633
+ * // Get breadcrumb for current path
634
+ * const breadcrumb = getBreadcrumb(menuItems);
635
+ *
636
+ * // Get current active menu item
637
+ * const currentItem = getCurrentItem(menuItems);
638
+ * ```
639
+ */
640
+ declare const useMenu: (pathname: string) => UseMenuReturn;
3
641
 
4
642
  /**
5
643
  * Meta theme color management hook for React components
@@ -85,9 +723,564 @@ import { M as META_THEME_COLORS } from './colors-CUDWvz1g.js';
85
723
  */
86
724
  declare function useMetaColor(defaultColors?: typeof META_THEME_COLORS): {
87
725
  /** Current meta theme color based on resolved theme */
88
- metaColor: "#ffffff" | "#09090b";
726
+ metaColor: "#09090b" | "#ffffff";
89
727
  /** Function to manually set meta theme color */
90
728
  setMetaColor: (color: string) => void;
91
729
  };
92
730
 
93
- export { useMetaColor };
731
+ /**
732
+ * Mobile device detection hook for React components
733
+ * Provides real-time mobile/desktop state based on configurable viewport width breakpoint
734
+ * Uses customizable mobile breakpoint with proper SSR handling and hydration safety
735
+ */
736
+ /**
737
+ * Hook to detect if the current viewport is mobile-sized based on configurable breakpoint
738
+ *
739
+ * This hook provides real-time detection of mobile vs desktop viewports with a customizable
740
+ * breakpoint threshold. It handles SSR properly by starting with undefined state and updating
741
+ * on client-side hydration to prevent hydration mismatches.
742
+ *
743
+ * The hook uses both `matchMedia` API for efficient media query listening and `window.innerWidth`
744
+ * for consistent viewport width detection across different browsers and devices.
745
+ *
746
+ * Features:
747
+ * - Real-time viewport size tracking with media query listeners
748
+ * - SSR-safe implementation preventing hydration mismatches
749
+ * - Automatic event listener cleanup on unmount
750
+ * - Configurable mobile breakpoint with sensible default (1024px)
751
+ * - Performance optimized with proper dependency management
752
+ * - TypeScript support with proper type definitions
753
+ *
754
+ * @param breakpoint - Custom breakpoint in pixels. Viewports smaller than this value are considered mobile. Defaults to 1024px if not provided.
755
+ * @returns Boolean indicating if current viewport width is smaller than the specified breakpoint (mobile-sized)
756
+ *
757
+ * @example
758
+ * ```tsx
759
+ * // Basic usage with default breakpoint (1024px)
760
+ * function ResponsiveComponent() {
761
+ * const isMobile = useIsMobile();
762
+ *
763
+ * return (
764
+ * <div>
765
+ * {isMobile ? (
766
+ * <MobileNavigation />
767
+ * ) : (
768
+ * <DesktopNavigation />
769
+ * )}
770
+ * </div>
771
+ * );
772
+ * }
773
+ *
774
+ * // Custom breakpoint for tablet detection
775
+ * function TabletResponsiveComponent() {
776
+ * const isMobile = useIsMobile(768); // Use 768px breakpoint
777
+ * const isTablet = useIsMobile(1024); // Use 1024px for tablet detection
778
+ *
779
+ * return (
780
+ * <div className={isMobile ? 'mobile-layout' : isTablet ? 'tablet-layout' : 'desktop-layout'}>
781
+ * <Content />
782
+ * </div>
783
+ * );
784
+ * }
785
+ *
786
+ * // Conditional rendering with custom breakpoint
787
+ * function AdaptiveLayout() {
788
+ * const isSmallScreen = useIsMobile(640); // Custom small screen breakpoint
789
+ *
790
+ * return (
791
+ * <div className="container">
792
+ * {isSmallScreen ? (
793
+ * <div className="flex flex-col space-y-4">
794
+ * <MobileHeader />
795
+ * <MobileContent />
796
+ * </div>
797
+ * ) : (
798
+ * <div className="grid grid-cols-12 gap-6">
799
+ * <aside className="col-span-3">
800
+ * <Sidebar />
801
+ * </aside>
802
+ * <main className="col-span-9">
803
+ * <DesktopContent />
804
+ * </main>
805
+ * </div>
806
+ * )}
807
+ * </div>
808
+ * );
809
+ * }
810
+ *
811
+ * // Multiple breakpoints for different layouts
812
+ * function MultiBreakpointLayout() {
813
+ * const isMobile = useIsMobile(640); // Mobile: < 640px
814
+ * const isTablet = useIsMobile(1024); // Tablet: < 1024px
815
+ * const isDesktop = !isTablet; // Desktop: >= 1024px
816
+ *
817
+ * if (isMobile) {
818
+ * return <MobileLayout />;
819
+ * }
820
+ *
821
+ * if (isTablet) {
822
+ * return <TabletLayout />;
823
+ * }
824
+ *
825
+ * return <DesktopLayout />;
826
+ * }
827
+ * ```
828
+ *
829
+ * @since 1.0.0
830
+ */
831
+ declare function useIsMobile(breakpoint?: number): boolean;
832
+
833
+ /**
834
+ * Component mount state hook for React components
835
+ * Provides a reliable way to detect when a component has mounted on the client
836
+ * Essential for SSR applications to prevent hydration mismatches
837
+ */
838
+ /**
839
+ * Hook to detect when a React component has mounted on the client side
840
+ *
841
+ * This hook is essential for SSR applications where you need to conditionally
842
+ * render content only after the component has mounted on the client. It helps
843
+ * prevent hydration mismatches between server and client rendering.
844
+ *
845
+ * Features:
846
+ * - Starts with false during SSR
847
+ * - Updates to true after client-side mount
848
+ * - Prevents hydration mismatches
849
+ * - Simple boolean state management
850
+ *
851
+ * @returns Boolean indicating whether the component has mounted
852
+ *
853
+ * @example
854
+ * ```tsx
855
+ * function ClientOnlyComponent() {
856
+ * const mounted = useMounted();
857
+ *
858
+ * // Prevent rendering until mounted to avoid hydration issues
859
+ * if (!mounted) {
860
+ * return <div>Loading...</div>;
861
+ * }
862
+ *
863
+ * return (
864
+ * <div>
865
+ * <BrowserOnlyFeature />
866
+ * <LocalStorageComponent />
867
+ * </div>
868
+ * );
869
+ * }
870
+ *
871
+ * // Conditional rendering based on mount state
872
+ * function ThemeToggle() {
873
+ * const mounted = useMounted();
874
+ * const { theme, setTheme } = useTheme();
875
+ *
876
+ * // Avoid showing theme toggle until mounted
877
+ * if (!mounted) return null;
878
+ *
879
+ * return (
880
+ * <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
881
+ * Toggle Theme
882
+ * </button>
883
+ * );
884
+ * }
885
+ * ```
886
+ */
887
+ declare function useMounted(): boolean;
888
+
889
+ /**
890
+ * DOM Mutation Observer hook for React components
891
+ * Provides a React-friendly interface for observing DOM changes
892
+ * with automatic cleanup and ref integration
893
+ */
894
+
895
+ /**
896
+ * Hook to observe DOM mutations on a referenced element
897
+ *
898
+ * This hook provides a React-friendly way to use the MutationObserver API.
899
+ * It automatically handles observer creation, cleanup, and ref management.
900
+ * Useful for detecting DOM changes that occur outside of React's control.
901
+ *
902
+ * Features:
903
+ * - Automatic observer lifecycle management
904
+ * - Configurable observation options
905
+ * - Ref-based element targeting
906
+ * - Automatic cleanup on unmount
907
+ *
908
+ * @param ref - React ref pointing to the element to observe
909
+ * @param callback - Function called when mutations are detected
910
+ * @param options - MutationObserver configuration options
911
+ *
912
+ * @example
913
+ * ```tsx
914
+ * function DynamicContent() {
915
+ * const contentRef = useRef<HTMLDivElement>(null);
916
+ *
917
+ * // Watch for any changes to the content div
918
+ * useMutationObserver(
919
+ * contentRef,
920
+ * (mutations) => {
921
+ * mutations.forEach((mutation) => {
922
+ * console.log('DOM changed:', mutation.type);
923
+ * });
924
+ * }
925
+ * );
926
+ *
927
+ * return <div ref={contentRef}>Dynamic content here</div>;
928
+ * }
929
+ *
930
+ * // Watch only for attribute changes
931
+ * function AttributeWatcher() {
932
+ * const elementRef = useRef<HTMLElement>(null);
933
+ *
934
+ * useMutationObserver(
935
+ * elementRef,
936
+ * (mutations) => {
937
+ * mutations.forEach((mutation) => {
938
+ * if (mutation.type === 'attributes') {
939
+ * console.log('Attribute changed:', mutation.attributeName);
940
+ * }
941
+ * });
942
+ * },
943
+ * { attributes: true, childList: false, subtree: false }
944
+ * );
945
+ *
946
+ * return <div ref={elementRef}>Watched element</div>;
947
+ * }
948
+ * ```
949
+ */
950
+ declare const useMutationObserver: (ref: React.RefObject<HTMLElement | null>, callback: MutationCallback, options?: MutationObserverInit) => void;
951
+
952
+ /**
953
+ * Google reCAPTCHA v2 integration hook for React components
954
+ * Provides a complete solution for implementing reCAPTCHA v2 with automatic
955
+ * script loading, widget management, and token retrieval
956
+ */
957
+ /**
958
+ * Hook for integrating Google reCAPTCHA v2 into React components
959
+ *
960
+ * This hook provides a complete solution for reCAPTCHA v2 integration including:
961
+ * - Automatic script loading and initialization
962
+ * - Widget rendering and management
963
+ * - Token retrieval and validation
964
+ * - Cleanup and reset functionality
965
+ *
966
+ * @param siteKey - Your Google reCAPTCHA site key
967
+ * @returns Object containing ref, token getter, reset function, and initializer
968
+ *
969
+ * @example
970
+ * ```tsx
971
+ * function ContactForm() {
972
+ * const { containerRef, getToken, resetCaptcha } = useRecaptchaV2('your-site-key');
973
+ *
974
+ * const handleSubmit = async (e) => {
975
+ * e.preventDefault();
976
+ *
977
+ * try {
978
+ * const token = getToken();
979
+ * if (!token) {
980
+ * alert('Please complete the reCAPTCHA');
981
+ * return;
982
+ * }
983
+ *
984
+ * // Submit form with token
985
+ * await submitForm({ token, ...formData });
986
+ * resetCaptcha(); // Reset after successful submission
987
+ * } catch (error) {
988
+ * console.error('Submission failed:', error);
989
+ * }
990
+ * };
991
+ *
992
+ * return (
993
+ * <form onSubmit={handleSubmit}>
994
+ * <input type="email" placeholder="Email" />
995
+ * <div ref={containerRef}></div>
996
+ * <button type="submit">Submit</button>
997
+ * </form>
998
+ * );
999
+ * }
1000
+ * ```
1001
+ */
1002
+ declare function useRecaptchaV2(siteKey: string): {
1003
+ /** Ref to attach to the container div where reCAPTCHA will be rendered */
1004
+ containerRef: React.RefObject<HTMLDivElement | null>;
1005
+ /** Function to get the reCAPTCHA response token */
1006
+ getToken: () => string;
1007
+ /** Function to reset the reCAPTCHA widget */
1008
+ resetCaptcha: () => void;
1009
+ /** Function to manually initialize reCAPTCHA (usually not needed) */
1010
+ initializeRecaptcha: () => Promise<void>;
1011
+ };
1012
+
1013
+ /**
1014
+ * Google Analytics linker parameter cleanup hook for React
1015
+ * Safely removes the GA `_gl` query parameter from the URL after GA initialization.
1016
+ */
1017
+ /**
1018
+ * Hook to remove the Google Analytics `_gl` query parameter from the current URL.
1019
+ *
1020
+ * GA's cross-domain linker temporarily appends `_gl` to URLs for attribution.
1021
+ * Removing it *too early* can break attribution, so this hook waits briefly
1022
+ * (≈2 seconds) to allow GA to read it, then strips the param using
1023
+ * `history.replaceState` without causing a page reload or React re-render.
1024
+ *
1025
+ * Behavior:
1026
+ * - Runs once on mount.
1027
+ * - If `_gl` is present, schedules its removal after ~2000ms.
1028
+ * - Uses `window.history.replaceState` to avoid navigation/re-render.
1029
+ *
1030
+ * @example
1031
+ * ```tsx
1032
+ * // app/layout.tsx or a top-level client component
1033
+ * import { useRemoveGAParams } from '@/hooks/use-remove-ga-params';
1034
+ *
1035
+ * export default function RootLayout({ children }: { children: React.ReactNode }) {
1036
+ * useRemoveGAParams();
1037
+ * return <>{children}</>;
1038
+ * }
1039
+ * ```
1040
+ */
1041
+ declare function useRemoveGAParams(): void;
1042
+
1043
+ /**
1044
+ * Scroll position tracking hook for React components
1045
+ * Monitors scroll position of window or specific elements
1046
+ * with real-time updates and automatic cleanup
1047
+ */
1048
+
1049
+ /**
1050
+ * Configuration options for the scroll position hook
1051
+ */
1052
+ interface UseScrollPositionProps {
1053
+ /** Optional ref to a specific scrollable element (defaults to document) */
1054
+ targetRef?: RefObject<HTMLElement | Document | undefined>;
1055
+ }
1056
+ /**
1057
+ * Hook to track scroll position of window or specific elements
1058
+ *
1059
+ * This hook provides real-time tracking of scroll position with support
1060
+ * for both window scrolling and element-specific scrolling. It automatically
1061
+ * handles event listener management and cleanup.
1062
+ *
1063
+ * Features:
1064
+ * - Real-time scroll position tracking
1065
+ * - Support for window and element scrolling
1066
+ * - Automatic event listener cleanup
1067
+ * - SSR-safe implementation
1068
+ * - Performance optimized
1069
+ *
1070
+ * @param options - Configuration options for the hook
1071
+ * @returns Current scroll position in pixels
1072
+ *
1073
+ * @example
1074
+ * ```tsx
1075
+ * // Track window scroll position
1076
+ * function ScrollIndicator() {
1077
+ * const scrollPosition = useScrollPosition();
1078
+ *
1079
+ * return (
1080
+ * <div className="scroll-indicator">
1081
+ * Scrolled: {scrollPosition}px
1082
+ * </div>
1083
+ * );
1084
+ * }
1085
+ *
1086
+ * // Track specific element scroll position
1087
+ * function ScrollableContent() {
1088
+ * const contentRef = useRef<HTMLDivElement>(null);
1089
+ * const scrollPosition = useScrollPosition({ targetRef: contentRef });
1090
+ *
1091
+ * return (
1092
+ * <div
1093
+ * ref={contentRef}
1094
+ * className="h-96 overflow-y-auto"
1095
+ * >
1096
+ * <div className="h-[1000px]">
1097
+ * <p>Scroll position: {scrollPosition}px</p>
1098
+ * <p>Long content here...</p>
1099
+ * </div>
1100
+ * </div>
1101
+ * );
1102
+ * }
1103
+ *
1104
+ * // Show/hide header based on scroll
1105
+ * function StickyHeader() {
1106
+ * const scrollPosition = useScrollPosition();
1107
+ * const isVisible = scrollPosition < 100;
1108
+ *
1109
+ * return (
1110
+ * <header className={`transition-transform ${
1111
+ * isVisible ? 'translate-y-0' : '-translate-y-full'
1112
+ * }`}>
1113
+ * Header content
1114
+ * </header>
1115
+ * );
1116
+ * }
1117
+ * ```
1118
+ */
1119
+ declare const useScrollPosition: ({ targetRef }?: UseScrollPositionProps) => number;
1120
+
1121
+ /**
1122
+ * Dual slider input management hook for React components
1123
+ * Provides synchronized state management between range slider and number inputs
1124
+ * with validation and boundary enforcement
1125
+ */
1126
+
1127
+ /**
1128
+ * Configuration options for the slider input hook
1129
+ */
1130
+ interface UseSliderInputProps {
1131
+ /** Minimum allowed value for the range */
1132
+ minValue: number;
1133
+ /** Maximum allowed value for the range */
1134
+ maxValue: number;
1135
+ /** Initial values for the range [min, max] */
1136
+ initialValue: [number, number];
1137
+ }
1138
+ /**
1139
+ * Hook for managing dual slider input with synchronized state
1140
+ *
1141
+ * This hook provides state management for components that need both
1142
+ * a range slider and corresponding number inputs. It handles synchronization
1143
+ * between the two input types, validation, and boundary enforcement.
1144
+ *
1145
+ * Features:
1146
+ * - Synchronized slider and input values
1147
+ * - Automatic validation and boundary enforcement
1148
+ * - Prevents invalid range configurations (min > max)
1149
+ * - Optimized with useCallback for performance
1150
+ *
1151
+ * @param props - Configuration options for the hook
1152
+ * @returns Object containing state and handlers for slider and inputs
1153
+ *
1154
+ * @example
1155
+ * ```tsx
1156
+ * function PriceRangeFilter() {
1157
+ * const {
1158
+ * sliderValues,
1159
+ * inputValues,
1160
+ * handleSliderChange,
1161
+ * handleInputChange,
1162
+ * validateAndUpdateValue
1163
+ * } = useSliderInput({
1164
+ * minValue: 0,
1165
+ * maxValue: 1000,
1166
+ * initialValue: [100, 500]
1167
+ * });
1168
+ *
1169
+ * return (
1170
+ * <div className="price-range">
1171
+ * <div className="inputs">
1172
+ * <input
1173
+ * type="number"
1174
+ * value={inputValues[0]}
1175
+ * onChange={(e) => handleInputChange(e, 0)}
1176
+ * onBlur={() => validateAndUpdateValue(inputValues[0], 0)}
1177
+ * placeholder="Min price"
1178
+ * />
1179
+ * <input
1180
+ * type="number"
1181
+ * value={inputValues[1]}
1182
+ * onChange={(e) => handleInputChange(e, 1)}
1183
+ * onBlur={() => validateAndUpdateValue(inputValues[1], 1)}
1184
+ * placeholder="Max price"
1185
+ * />
1186
+ * </div>
1187
+ *
1188
+ * <Slider
1189
+ * value={sliderValues}
1190
+ * onValueChange={handleSliderChange}
1191
+ * min={0}
1192
+ * max={1000}
1193
+ * step={10}
1194
+ * />
1195
+ * </div>
1196
+ * );
1197
+ * }
1198
+ * ```
1199
+ */
1200
+ declare function useSliderInput({ minValue, maxValue, initialValue }: UseSliderInputProps): {
1201
+ /** Function to manually set slider values */
1202
+ setSliderValues: React.Dispatch<React.SetStateAction<[number, number]>>;
1203
+ /** Function to manually set input values */
1204
+ setInputValues: React.Dispatch<React.SetStateAction<[number, number]>>;
1205
+ /** Current slider values [min, max] */
1206
+ sliderValues: [number, number];
1207
+ /** Current input values [min, max] */
1208
+ inputValues: [number, number];
1209
+ /** Handler for slider value changes */
1210
+ handleSliderChange: (values: [number, number]) => void;
1211
+ /** Handler for input field changes */
1212
+ handleInputChange: (e: React.ChangeEvent<HTMLInputElement>, index: 0 | 1) => void;
1213
+ /** Function to validate and update values from inputs */
1214
+ validateAndUpdateValue: (value: number, index: 0 | 1) => void;
1215
+ };
1216
+
1217
+ /**
1218
+ * Viewport dimensions tracking hook for React components
1219
+ * Provides real-time viewport width and height with automatic updates
1220
+ * on window resize events with SSR-safe implementation
1221
+ */
1222
+ /**
1223
+ * Type definition for viewport dimensions
1224
+ * Returns tuple of [height, width] in pixels
1225
+ */
1226
+ type ViewportDimensions = [number, number];
1227
+ /**
1228
+ * Hook to track viewport dimensions with real-time updates
1229
+ *
1230
+ * This hook provides the current viewport dimensions and automatically
1231
+ * updates when the window is resized. It's useful for responsive layouts,
1232
+ * conditional rendering based on screen size, and dynamic calculations.
1233
+ *
1234
+ * Features:
1235
+ * - Real-time viewport dimension tracking
1236
+ * - Automatic updates on window resize
1237
+ * - Performance optimized with passive event listeners
1238
+ * - SSR-safe implementation
1239
+ * - Returns both height and width
1240
+ *
1241
+ * @returns Tuple containing [height, width] in pixels
1242
+ *
1243
+ * @example
1244
+ * ```tsx
1245
+ * // Basic usage
1246
+ * function ResponsiveComponent() {
1247
+ * const [height, width] = useViewport();
1248
+ *
1249
+ * return (
1250
+ * <div>
1251
+ * <p>Viewport: {width}x{height}</p>
1252
+ * {width > 768 ? <DesktopLayout /> : <MobileLayout />}
1253
+ * </div>
1254
+ * );
1255
+ * }
1256
+ *
1257
+ * // Destructured usage
1258
+ * function ViewportInfo() {
1259
+ * const [height, width] = useViewport();
1260
+ * const aspectRatio = (width / height).toFixed(2);
1261
+ *
1262
+ * return (
1263
+ * <div className="viewport-info">
1264
+ * <p>Width: {width}px</p>
1265
+ * <p>Height: {height}px</p>
1266
+ * <p>Aspect Ratio: {aspectRatio}</p>
1267
+ * </div>
1268
+ * );
1269
+ * }
1270
+ *
1271
+ * // Conditional rendering based on viewport
1272
+ * function AdaptiveGrid() {
1273
+ * const [, width] = useViewport();
1274
+ * const columns = width > 1200 ? 4 : width > 768 ? 3 : width > 480 ? 2 : 1;
1275
+ *
1276
+ * return (
1277
+ * <div className={`grid grid-cols-${columns} gap-4`}>
1278
+ * {items.map(item => <GridItem key={item.id} {...item} />)}
1279
+ * </div>
1280
+ * );
1281
+ * }
1282
+ * ```
1283
+ */
1284
+ declare const useViewport: () => ViewportDimensions;
1285
+
1286
+ export { type FileMetadata, type FileUploadActions, type FileUploadOptions, type FileUploadState, type FileWithPreview, type GtagWindow, formatBytes, useAnalytics, useBodyClasses, useCopyToClipboard, useFileUpload, useHydrated, useIntersectionObserver, useIsMac, useIsMobile, useMediaQuery, useMenu, useMetaColor, useMounted, useMutationObserver, useRecaptchaV2, useRemoveGAParams, useScrollPosition, useSliderInput, useViewport };