@appforgeapps/uiforge 0.1.0 → 0.5.2

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { default as default_2 } from 'react';
2
+ import { FC } from 'react';
2
3
  import { JSX } from 'react/jsx-runtime';
4
+ import { RefObject } from 'react';
3
5
 
4
6
  /**
5
7
  * Represents a single activity/event in the stream
@@ -43,18 +45,85 @@ export declare interface ActivityEvent {
43
45
  children?: ActivityEvent[];
44
46
  }
45
47
 
48
+ /**
49
+ * Icon Maps - Icon lookup tables for easy access to icon components
50
+ *
51
+ * These maps are in a separate file to avoid React Fast Refresh issues
52
+ * when exporting both components and constants from the same file.
53
+ */
46
54
  export declare const ActivityIcons: {
47
- commit: default_2.FC<IconProps>;
48
- pr: default_2.FC<IconProps>;
49
- issue: default_2.FC<IconProps>;
50
- comment: default_2.FC<IconProps>;
51
- star: default_2.FC<IconProps>;
52
- fork: default_2.FC<IconProps>;
53
- merge: default_2.FC<IconProps>;
54
- release: default_2.FC<IconProps>;
55
- deploy: default_2.FC<IconProps>;
55
+ commit: FC<IconProps>;
56
+ pr: FC<IconProps>;
57
+ issue: FC<IconProps>;
58
+ comment: FC<IconProps>;
59
+ star: FC<IconProps>;
60
+ fork: FC<IconProps>;
61
+ merge: FC<IconProps>;
62
+ release: FC<IconProps>;
63
+ deploy: FC<IconProps>;
56
64
  };
57
65
 
66
+ /**
67
+ * Context for passing density and showMeta settings from ActivityStream to ActivityItem
68
+ */
69
+ export declare interface ActivityItemContextValue {
70
+ /**
71
+ * Density mode for the item
72
+ */
73
+ density: ActivityStreamDensity;
74
+ /**
75
+ * Whether to show metadata (timestamps, descriptions, etc.)
76
+ */
77
+ showMeta: boolean;
78
+ }
79
+
80
+ /**
81
+ * Represents a single activity/event item
82
+ */
83
+ export declare interface ActivityItemEvent {
84
+ /**
85
+ * Unique identifier for the event
86
+ */
87
+ id: string | number;
88
+ /**
89
+ * Type/category of the event (e.g., 'commit', 'issue', 'pr', 'comment')
90
+ */
91
+ type: string;
92
+ /**
93
+ * Display title for the event
94
+ */
95
+ title: string;
96
+ /**
97
+ * Optional description or content
98
+ */
99
+ description?: string;
100
+ /**
101
+ * Timestamp of the event
102
+ */
103
+ timestamp: Date | string;
104
+ /**
105
+ * Icon to display (can be emoji, React node, or icon class)
106
+ */
107
+ icon?: default_2.ReactNode;
108
+ /**
109
+ * Optional metadata for the event (e.g., repository name, user, etc.)
110
+ */
111
+ metadata?: Record<string, unknown>;
112
+ }
113
+
114
+ /**
115
+ * Provider component for ActivityItem context
116
+ */
117
+ export declare const ActivityItemProvider: default_2.FC<{
118
+ children: default_2.ReactNode;
119
+ value: ActivityItemContextValue;
120
+ }>;
121
+
122
+ /**
123
+ * Density options for the activity stream
124
+ */
125
+ export declare type ActivityStreamDensity = 'comfortable' | 'compact' | 'condensed';
126
+
58
127
  /**
59
128
  * Pagination configuration for loading more events
60
129
  */
@@ -94,18 +163,28 @@ export declare const BugIcon: default_2.FC<IconProps>;
94
163
  export declare const BuildIcon: default_2.FC<IconProps>;
95
164
 
96
165
  export declare const BusinessIcons: {
97
- chart: default_2.FC<IconProps>;
98
- meeting: default_2.FC<IconProps>;
99
- document: default_2.FC<IconProps>;
100
- calendar: default_2.FC<IconProps>;
101
- briefcase: default_2.FC<IconProps>;
166
+ chart: FC<IconProps>;
167
+ meeting: FC<IconProps>;
168
+ document: FC<IconProps>;
169
+ calendar: FC<IconProps>;
170
+ briefcase: FC<IconProps>;
102
171
  };
103
172
 
104
173
  /**
105
- * A customizable button component
174
+ * A customizable button component with accessibility-focused touch targets
175
+ *
176
+ * By default, buttons have a minimum 44×44px touch target for accessibility.
177
+ * Use density='condensed' to allow smaller targets in dense UIs.
106
178
  */
107
179
  export declare const Button: default_2.FC<ButtonProps>;
108
180
 
181
+ /**
182
+ * Density options for button sizing
183
+ * - 'default': Standard 44px minimum touch target for accessibility
184
+ * - 'condensed': Smaller touch target for dense UIs (not recommended for touch devices)
185
+ */
186
+ export declare type ButtonDensity = 'default' | 'condensed';
187
+
109
188
  export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
110
189
  /**
111
190
  * Variant style of the button
@@ -115,6 +194,17 @@ export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTML
115
194
  * Size of the button
116
195
  */
117
196
  size?: 'small' | 'medium' | 'large';
197
+ /**
198
+ * Theme variant ('light' or 'dark')
199
+ */
200
+ theme?: 'light' | 'dark';
201
+ /**
202
+ * Density of the button - affects minimum touch target size
203
+ * - 'default': Enforces 44px minimum touch target (recommended for accessibility)
204
+ * - 'condensed': Allows smaller touch targets for dense UIs
205
+ * @default 'default'
206
+ */
207
+ density?: ButtonDensity;
118
208
  /**
119
209
  * Button contents
120
210
  */
@@ -196,35 +286,83 @@ export declare const DeployIcon: default_2.FC<IconProps>;
196
286
 
197
287
  export declare const DeploymentIcon: default_2.FC<IconProps>;
198
288
 
289
+ /**
290
+ * Detect which video provider handles a given URL
291
+ * @param url - The video URL to analyze
292
+ * @returns The matching VideoProvider or null if not found
293
+ */
294
+ export declare function detectProvider(url: string): VideoProvider | null;
295
+
199
296
  export declare const DevProcessIcons: {
200
- gitbranch: default_2.FC<IconProps>;
201
- prdraft: default_2.FC<IconProps>;
202
- testing: default_2.FC<IconProps>;
203
- deployment: default_2.FC<IconProps>;
204
- review: default_2.FC<IconProps>;
205
- build: default_2.FC<IconProps>;
297
+ gitbranch: FC<IconProps>;
298
+ prdraft: FC<IconProps>;
299
+ testing: FC<IconProps>;
300
+ deployment: FC<IconProps>;
301
+ review: FC<IconProps>;
302
+ build: FC<IconProps>;
206
303
  };
207
304
 
208
305
  export declare const DocumentIcon: default_2.FC<IconProps>;
209
306
 
210
307
  export declare const DumbbellIcon: default_2.FC<IconProps>;
211
308
 
309
+ /**
310
+ * Options for video embedding
311
+ */
312
+ export declare interface EmbedOptions {
313
+ /**
314
+ * Enable autoplay (note: most browsers require muted=true for autoplay to work)
315
+ */
316
+ autoplay?: boolean;
317
+ /**
318
+ * Mute the video by default
319
+ */
320
+ muted?: boolean;
321
+ /**
322
+ * Loop the video
323
+ */
324
+ loop?: boolean;
325
+ /**
326
+ * Start time in seconds
327
+ */
328
+ startTime?: number;
329
+ /**
330
+ * Show video controls
331
+ */
332
+ controls?: boolean;
333
+ }
334
+
212
335
  /**
213
336
  * Export format options
214
337
  */
215
338
  export declare type ExportFormat = 'json' | 'html' | 'markdown';
216
339
 
340
+ /**
341
+ * Extract video ID from a URL using the appropriate provider
342
+ * @param url - The video URL to parse
343
+ * @returns Object containing the provider and video ID, or null if not found
344
+ */
345
+ export declare function extractVideoId(url: string): VideoIdExtractionResult | null;
346
+
217
347
  export declare const FitnessIcons: {
218
- dumbbell: default_2.FC<IconProps>;
219
- running: default_2.FC<IconProps>;
220
- heartrate: default_2.FC<IconProps>;
221
- strength: default_2.FC<IconProps>;
348
+ dumbbell: FC<IconProps>;
349
+ running: FC<IconProps>;
350
+ heartrate: FC<IconProps>;
351
+ strength: FC<IconProps>;
222
352
  };
223
353
 
224
354
  export declare const FoldIcon: default_2.FC<IconProps>;
225
355
 
226
356
  export declare const ForkIcon: default_2.FC<IconProps>;
227
357
 
358
+ /**
359
+ * Get embed URL from a video URL
360
+ * @param url - The video URL
361
+ * @param options - Embed options
362
+ * @returns The embed URL or null if not found
363
+ */
364
+ export declare function getEmbedUrlFromVideoUrl(url: string, options?: Parameters<VideoProvider['getEmbedUrl']>[1]): string | null;
365
+
228
366
  export declare const GitBranchIcon: default_2.FC<IconProps>;
229
367
 
230
368
  /**
@@ -309,6 +447,44 @@ export declare interface GridPaginationConfig {
309
447
  serverSide?: boolean;
310
448
  }
311
449
 
450
+ /**
451
+ * HamburgerButton - An accessible hamburger menu button for drawer/menu controls
452
+ *
453
+ * Features:
454
+ * - Proper ARIA attributes (aria-expanded, aria-controls)
455
+ * - Animated hamburger-to-X transformation
456
+ * - 44x44px minimum touch target by default
457
+ * - Keyboard accessible
458
+ */
459
+ export declare const HamburgerButton: default_2.FC<HamburgerButtonProps>;
460
+
461
+ /**
462
+ * Props for the HamburgerButton component
463
+ */
464
+ export declare interface HamburgerButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-expanded' | 'aria-controls'> {
465
+ /**
466
+ * Whether the controlled menu/drawer is open
467
+ */
468
+ isOpen: boolean;
469
+ /**
470
+ * ID of the element this button controls (for aria-controls)
471
+ */
472
+ controlsId: string;
473
+ /**
474
+ * Accessible label for the button
475
+ */
476
+ ariaLabel?: string;
477
+ /**
478
+ * Additional CSS class names
479
+ */
480
+ className?: string;
481
+ /**
482
+ * Size variant of the button
483
+ * @default 'medium'
484
+ */
485
+ size?: 'small' | 'medium' | 'large';
486
+ }
487
+
312
488
  export declare const HeartRateIcon: default_2.FC<IconProps>;
313
489
 
314
490
  /**
@@ -321,6 +497,13 @@ export declare interface IconProps {
321
497
  color?: string;
322
498
  }
323
499
 
500
+ /**
501
+ * Check if a URL is from an adult content provider
502
+ * @param url - The video URL to check
503
+ * @returns true if the URL is from an adult content provider
504
+ */
505
+ export declare function isAdultContent(url: string): boolean;
506
+
324
507
  export declare const IssueIcon: default_2.FC<IconProps>;
325
508
 
326
509
  export declare const MeditationIcon: default_2.FC<IconProps>;
@@ -331,6 +514,11 @@ export declare const MergeIcon: default_2.FC<IconProps>;
331
514
 
332
515
  export declare const PlanetIcon: default_2.FC<IconProps>;
333
516
 
517
+ /**
518
+ * Map of provider names to provider objects for quick lookup
519
+ */
520
+ export declare const providersByName: Record<string, VideoProvider>;
521
+
334
522
  export declare const PullRequestDraftIcon: default_2.FC<IconProps>;
335
523
 
336
524
  export declare const PullRequestIcon: default_2.FC<IconProps>;
@@ -347,12 +535,17 @@ export declare const SatelliteIcon: default_2.FC<IconProps>;
347
535
 
348
536
  export declare const ServerIcon: default_2.FC<IconProps>;
349
537
 
538
+ /**
539
+ * Sidebar variant types
540
+ */
541
+ export declare type SidebarVariant = 'static' | 'drawer' | 'bottom';
542
+
350
543
  export declare const SpaceIcons: {
351
- rocket: default_2.FC<IconProps>;
352
- satellite: default_2.FC<IconProps>;
353
- alien: default_2.FC<IconProps>;
354
- planet: default_2.FC<IconProps>;
355
- telescope: default_2.FC<IconProps>;
544
+ rocket: FC<IconProps>;
545
+ satellite: FC<IconProps>;
546
+ alien: FC<IconProps>;
547
+ planet: FC<IconProps>;
548
+ telescope: FC<IconProps>;
356
549
  };
357
550
 
358
551
  export declare const StarIcon: default_2.FC<IconProps>;
@@ -362,12 +555,12 @@ export declare const StrengthIcon: default_2.FC<IconProps>;
362
555
  export declare const TaiChiIcon: default_2.FC<IconProps>;
363
556
 
364
557
  export declare const TechIcons: {
365
- server: default_2.FC<IconProps>;
366
- database: default_2.FC<IconProps>;
367
- cloud: default_2.FC<IconProps>;
368
- terminal: default_2.FC<IconProps>;
369
- bug: default_2.FC<IconProps>;
370
- code: default_2.FC<IconProps>;
558
+ server: FC<IconProps>;
559
+ database: FC<IconProps>;
560
+ cloud: FC<IconProps>;
561
+ terminal: FC<IconProps>;
562
+ bug: FC<IconProps>;
563
+ code: FC<IconProps>;
371
564
  };
372
565
 
373
566
  export declare const TelescopeIcon: default_2.FC<IconProps>;
@@ -386,6 +579,59 @@ export declare interface TextFormat {
386
579
  code?: boolean;
387
580
  }
388
581
 
582
+ /**
583
+ * A standalone activity item component that can be used independently or within ActivityStream.
584
+ * Supports compact/mobile layouts through density prop and showMeta flag.
585
+ */
586
+ export declare const UIForgeActivityItem: default_2.FC<UIForgeActivityItemProps>;
587
+
588
+ /**
589
+ * Props for the UIForgeActivityItem component
590
+ */
591
+ export declare interface UIForgeActivityItemProps {
592
+ /**
593
+ * The activity event data to display
594
+ */
595
+ event: ActivityItemEvent;
596
+ /**
597
+ * Whether the item is expanded (shows description)
598
+ */
599
+ expanded?: boolean;
600
+ /**
601
+ * Callback when the item is toggled
602
+ */
603
+ onToggle?: (eventId: string | number, expanded: boolean) => void;
604
+ /**
605
+ * Whether the item is expandable (has description or is expandable)
606
+ */
607
+ expandable?: boolean;
608
+ /**
609
+ * Whether this is a child item (nested styling)
610
+ */
611
+ isChild?: boolean;
612
+ /**
613
+ * Whether to show the timeline marker
614
+ */
615
+ showTimeline?: boolean;
616
+ /**
617
+ * Density mode for the item. If not provided, uses context value or 'comfortable'
618
+ */
619
+ density?: ActivityStreamDensity;
620
+ /**
621
+ * Whether to show metadata (timestamps, descriptions). If not provided, uses context value.
622
+ * When false, hides timestamps and truncates long content.
623
+ */
624
+ showMeta?: boolean;
625
+ /**
626
+ * Custom icon renderer
627
+ */
628
+ renderIcon?: (event: ActivityItemEvent) => default_2.ReactNode;
629
+ /**
630
+ * Custom className for styling
631
+ */
632
+ className?: string;
633
+ }
634
+
389
635
  /**
390
636
  * A GitHub-inspired activity stream component with smart grouping, timeline, and theming
391
637
  */
@@ -407,6 +653,10 @@ export declare interface UIForgeActivityStreamProps {
407
653
  * Custom className for styling
408
654
  */
409
655
  className?: string;
656
+ /**
657
+ * Custom inline styles
658
+ */
659
+ style?: default_2.CSSProperties;
410
660
  /**
411
661
  * Whether to show the "Show more" bar
412
662
  */
@@ -462,8 +712,42 @@ export declare interface UIForgeActivityStreamProps {
462
712
  /**
463
713
  * Global scale factor (density) for spacing and icon sizes in the stream.
464
714
  * Set to values like 0.8 for compact, 1 for default, 1.2 for spacious.
715
+ * @deprecated Use `density` prop instead for semantic density control.
465
716
  */
466
717
  scale?: number;
718
+ /**
719
+ * Density mode for the activity stream.
720
+ * - 'comfortable': Default spacing and sizing (default)
721
+ * - 'compact': Reduced spacing and smaller icons
722
+ * - 'condensed': Minimal spacing for maximum information density
723
+ */
724
+ density?: ActivityStreamDensity;
725
+ /**
726
+ * Whether to enable responsive density switching based on container width.
727
+ * When true, the component will automatically switch to 'compact' density
728
+ * when the container width is below the breakpoint.
729
+ * @default true
730
+ */
731
+ responsive?: boolean;
732
+ /**
733
+ * Breakpoint width in pixels below which responsive mode switches to compact.
734
+ * Only applies when `responsive` is true.
735
+ * @default 640
736
+ */
737
+ compactBreakpointPx?: number;
738
+ /**
739
+ * Optional ref to the container element for responsive measurements.
740
+ * If not provided, an internal ref is used.
741
+ */
742
+ containerRef?: RefObject<HTMLElement | null>;
743
+ /**
744
+ * Whether to show metadata (timestamps, descriptions, etc.) on activity items.
745
+ * When false, hides timestamps and truncates long content for a denser display.
746
+ * When undefined, metadata is shown by default but may be auto-hidden on narrow containers
747
+ * if responsive is true.
748
+ * @default true
749
+ */
750
+ showMeta?: boolean;
467
751
  /**
468
752
  * Custom icon renderer
469
753
  */
@@ -472,6 +756,19 @@ export declare interface UIForgeActivityStreamProps {
472
756
  * Custom event renderer
473
757
  */
474
758
  renderEvent?: (event: ActivityEvent) => default_2.ReactNode;
759
+ /**
760
+ * Whether to enable virtualization for improved performance with large lists.
761
+ * When enabled, uses react-window to render only visible items.
762
+ * Note: Virtualization may affect animations and dynamic height measurements.
763
+ * @default false
764
+ */
765
+ virtualization?: boolean;
766
+ /**
767
+ * Height of each item in pixels when virtualization is enabled.
768
+ * Required for react-window's fixed-size list.
769
+ * @default 48
770
+ */
771
+ virtualItemHeight?: number;
475
772
  }
476
773
 
477
774
  /**
@@ -520,6 +817,10 @@ export declare interface UIForgeBlocksEditorProps {
520
817
  * Whether the editor is read-only
521
818
  */
522
819
  readOnly?: boolean;
820
+ /**
821
+ * Theme variant ('light' or 'dark')
822
+ */
823
+ theme?: 'light' | 'dark';
523
824
  /**
524
825
  * Custom CSS class name
525
826
  */
@@ -564,6 +865,10 @@ export declare interface UIForgeComboBoxProps {
564
865
  * Async callback for dynamic suggestions (receives search text)
565
866
  */
566
867
  onSearch?: (searchText: string, signal?: AbortSignal) => Promise<ComboBoxOption[]>;
868
+ /**
869
+ * Theme variant ('light' or 'dark')
870
+ */
871
+ theme?: 'light' | 'dark';
567
872
  /**
568
873
  * Placeholder text
569
874
  */
@@ -637,7 +942,7 @@ export declare interface UIForgeComboBoxProps {
637
942
  /**
638
943
  * UIForgeGrid - A feature-rich data grid component
639
944
  */
640
- export declare const UIForgeGrid: <T extends Record<string, unknown>>({ columns, data, selectable, selectedRows: controlledSelectedRows, getRowKey, onSelectionChange, onCellEdit, actionButtons, searchable, searchPlaceholder, onSearch, customFilter, pagination, onPageChange, onPageSizeChange, pageSizeOptions, className, loading, emptyMessage, }: UIForgeGridProps<T>) => JSX.Element;
945
+ export declare const UIForgeGrid: <T extends Record<string, unknown>>({ columns, data, theme, selectable, selectedRows: controlledSelectedRows, getRowKey, onSelectionChange, onCellEdit, actionButtons, searchable, searchPlaceholder, onSearch, customFilter, pagination, onPageChange, onPageSizeChange, pageSizeOptions, className, loading, emptyMessage, }: UIForgeGridProps<T>) => JSX.Element;
641
946
 
642
947
  /**
643
948
  * Props for the UIForgeGrid component
@@ -651,6 +956,10 @@ export declare interface UIForgeGridProps<T = Record<string, unknown>> {
651
956
  * Data to display in the grid
652
957
  */
653
958
  data: T[];
959
+ /**
960
+ * Theme variant ('light' or 'dark')
961
+ */
962
+ theme?: 'light' | 'dark';
654
963
  /**
655
964
  * Enable row selection
656
965
  */
@@ -722,24 +1031,108 @@ export declare interface UIForgeGridProps<T = Record<string, unknown>> {
722
1031
  }
723
1032
 
724
1033
  /**
725
- * UIForgeVideo - A video component with overlay that supports YouTube and Vimeo embeds
1034
+ * UIForgeSidebar - A reusable sidebar component with multiple variants
1035
+ *
1036
+ * Features:
1037
+ * - Static variant for desktop fixed sidebars
1038
+ * - Drawer variant for slide-in panels with accessibility support
1039
+ * - Bottom variant for mobile bottom navigation
1040
+ * - Focus trapping for drawer/bottom variants
1041
+ * - ESC and backdrop click to close
1042
+ * - CSS safe-area insets support
1043
+ */
1044
+ export declare const UIForgeSidebar: default_2.FC<UIForgeSidebarProps>;
1045
+
1046
+ /**
1047
+ * Props for the UIForgeSidebar component
1048
+ */
1049
+ export declare interface UIForgeSidebarProps {
1050
+ /**
1051
+ * Unique identifier for the sidebar element
1052
+ * Useful for linking with aria-controls on trigger buttons
1053
+ */
1054
+ id?: string;
1055
+ /**
1056
+ * Variant style of the sidebar
1057
+ * - 'static': Desktop fixed sidebar (default)
1058
+ * - 'drawer': Slide-in panel for mobile & small containers
1059
+ * - 'bottom': Bottom navigation variant for mobile
1060
+ */
1061
+ variant?: SidebarVariant;
1062
+ /**
1063
+ * Whether the sidebar is open (only applies to 'drawer' and 'bottom' variants)
1064
+ */
1065
+ open?: boolean;
1066
+ /**
1067
+ * Callback when open state changes (only applies to 'drawer' and 'bottom' variants)
1068
+ */
1069
+ onOpenChange?: (open: boolean) => void;
1070
+ /**
1071
+ * Content to display inside the sidebar
1072
+ */
1073
+ children: default_2.ReactNode;
1074
+ /**
1075
+ * Additional CSS class names
1076
+ */
1077
+ className?: string;
1078
+ /**
1079
+ * ARIA label for the sidebar
1080
+ */
1081
+ ariaLabel?: string;
1082
+ /**
1083
+ * Width of the sidebar (CSS value, applies to 'static' and 'drawer' variants)
1084
+ */
1085
+ width?: string;
1086
+ /**
1087
+ * Height of the sidebar (CSS value, applies to 'bottom' variant only)
1088
+ */
1089
+ height?: string;
1090
+ /**
1091
+ * Position of the sidebar for 'static' and 'drawer' variants
1092
+ */
1093
+ position?: 'left' | 'right';
1094
+ /**
1095
+ * Whether to show the backdrop overlay (only applies to 'drawer' and 'bottom' variants)
1096
+ */
1097
+ showBackdrop?: boolean;
1098
+ /**
1099
+ * Whether to close on backdrop click (only applies when showBackdrop is true)
1100
+ */
1101
+ closeOnBackdropClick?: boolean;
1102
+ /**
1103
+ * Whether to close on ESC key press (only applies to 'drawer' and 'bottom' variants)
1104
+ */
1105
+ closeOnEscape?: boolean;
1106
+ /**
1107
+ * Whether to trap focus within the sidebar (only applies to 'drawer' and 'bottom' variants)
1108
+ */
1109
+ trapFocus?: boolean;
1110
+ }
1111
+
1112
+ /**
1113
+ * UIForgeVideo - A universal video component that supports 30+ video platforms
726
1114
  *
727
1115
  * Features:
728
- * - Displays video title and optional description
729
- * - Supports YouTube and Vimeo video embeds
1116
+ * - Auto-detects video provider from URL
1117
+ * - Supports 30+ video platforms including YouTube, Vimeo, Twitch, and more
730
1118
  * - Shows thumbnail with overlay icon before playing
731
- * - Emits event when video is clicked to play
1119
+ * - Emits events for video interactions
732
1120
  * - Lazy loads the video player on interaction
1121
+ * - Adult content filtering (disabled by default)
1122
+ * - Responsive design with configurable aspect ratios
733
1123
  *
734
1124
  * @example
735
1125
  * ```tsx
1126
+ * // Auto-detect from URL
1127
+ * <UIForgeVideo url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" />
1128
+ *
1129
+ * // With options
736
1130
  * <UIForgeVideo
737
- * title="Introduction to React"
738
- * description="Learn React basics in this tutorial"
739
- * youtubeId="dQw4w9WgXcQ"
740
- * onPlay={(videoId, provider) => {
741
- * console.log(`Playing ${provider} video: ${videoId}`)
742
- * }}
1131
+ * url="https://vimeo.com/123456789"
1132
+ * autoplay={false}
1133
+ * muted={true}
1134
+ * aspectRatio="16:9"
1135
+ * onPlay={(id, provider) => console.log(`Playing ${provider} video ${id}`)}
743
1136
  * />
744
1137
  * ```
745
1138
  */
@@ -790,21 +1183,56 @@ export declare interface UIForgeVideoPreviewProps {
790
1183
  */
791
1184
  export declare interface UIForgeVideoProps {
792
1185
  /**
793
- * Video title
1186
+ * Video title (optional when using url prop)
794
1187
  */
795
- title: string;
1188
+ title?: string;
796
1189
  /**
797
1190
  * Video description
798
1191
  */
799
1192
  description?: string;
1193
+ /**
1194
+ * Video URL from any supported platform
1195
+ * The provider and video ID will be automatically detected
1196
+ */
1197
+ url?: string;
800
1198
  /**
801
1199
  * YouTube video ID (e.g., "dQw4w9WgXcQ" from https://www.youtube.com/watch?v=dQw4w9WgXcQ)
1200
+ * @deprecated Use url prop instead
802
1201
  */
803
1202
  youtubeId?: string;
804
1203
  /**
805
1204
  * Vimeo video ID (e.g., "123456789" from https://vimeo.com/123456789)
1205
+ * @deprecated Use url prop instead
806
1206
  */
807
1207
  vimeoId?: string;
1208
+ /**
1209
+ * Directly specify the provider name (e.g., "youtube", "vimeo")
1210
+ */
1211
+ provider?: string;
1212
+ /**
1213
+ * Video ID when using direct provider specification
1214
+ */
1215
+ videoId?: string;
1216
+ /**
1217
+ * Enable autoplay (note: most browsers require muted=true for autoplay to work)
1218
+ */
1219
+ autoplay?: boolean;
1220
+ /**
1221
+ * Mute the video by default
1222
+ */
1223
+ muted?: boolean;
1224
+ /**
1225
+ * Loop the video
1226
+ */
1227
+ loop?: boolean;
1228
+ /**
1229
+ * Start time in seconds
1230
+ */
1231
+ startTime?: number;
1232
+ /**
1233
+ * Show video controls (default: true)
1234
+ */
1235
+ controls?: boolean;
808
1236
  /**
809
1237
  * Custom thumbnail URL (optional, will use provider's default if not specified)
810
1238
  */
@@ -812,34 +1240,227 @@ export declare interface UIForgeVideoProps {
812
1240
  /**
813
1241
  * Callback fired when the video overlay is clicked and playback begins
814
1242
  */
815
- onPlay?: (videoId: string, provider: 'youtube' | 'vimeo') => void;
1243
+ onPlay?: (videoId: string, provider: string) => void;
1244
+ /**
1245
+ * Callback fired when video playback is paused
1246
+ */
1247
+ onPause?: (videoId: string, provider: string) => void;
1248
+ /**
1249
+ * Callback fired when video playback ends
1250
+ */
1251
+ onEnded?: (videoId: string, provider: string) => void;
1252
+ /**
1253
+ * Callback fired when an error occurs
1254
+ */
1255
+ onError?: (error: Error, provider: string) => void;
1256
+ /**
1257
+ * Callback fired when the video player is ready
1258
+ */
1259
+ onReady?: (videoId: string, provider: string) => void;
816
1260
  /**
817
1261
  * Custom className for styling
818
1262
  */
819
1263
  className?: string;
1264
+ /**
1265
+ * Aspect ratio of the video player (default: "16:9")
1266
+ */
1267
+ aspectRatio?: '16:9' | '4:3' | '1:1' | 'auto' | string;
1268
+ /**
1269
+ * Width of the video player
1270
+ */
1271
+ width?: string | number;
1272
+ /**
1273
+ * Height of the video player
1274
+ */
1275
+ height?: string | number;
1276
+ /**
1277
+ * Maximum height of the video player
1278
+ */
1279
+ maxHeight?: string | number;
1280
+ /**
1281
+ * Enable responsive behavior (aspect-video, full width, no min-height constraints)
1282
+ * When true, uses aspect-ratio layout that scales correctly on small screens
1283
+ * @default false
1284
+ */
1285
+ responsive?: boolean;
1286
+ /**
1287
+ * Hide the header (title and description) for tight mobile UIs
1288
+ * @default false
1289
+ */
1290
+ hideHeader?: boolean;
820
1291
  /**
821
1292
  * Custom overlay icon (defaults to play icon)
822
1293
  */
823
1294
  overlayIcon?: default_2.ReactNode;
824
1295
  /**
825
- * Aspect ratio of the video player (default: "16/9")
1296
+ * Allow adult content to be embedded
1297
+ * Default: false (must be explicitly enabled)
826
1298
  */
827
- aspectRatio?: string;
1299
+ allowAdultContent?: boolean;
1300
+ /**
1301
+ * Fallback content when video cannot be loaded
1302
+ */
1303
+ fallback?: default_2.ReactNode;
828
1304
  }
829
1305
 
830
1306
  export declare const UIIcons: {
831
- unfold: default_2.FC<IconProps>;
832
- fold: default_2.FC<IconProps>;
833
- close: default_2.FC<IconProps>;
834
- check: default_2.FC<IconProps>;
1307
+ unfold: FC<IconProps>;
1308
+ fold: FC<IconProps>;
1309
+ close: FC<IconProps>;
1310
+ check: FC<IconProps>;
835
1311
  };
836
1312
 
837
1313
  export declare const UnfoldIcon: default_2.FC<IconProps>;
838
1314
 
1315
+ /**
1316
+ * Hook to access the ActivityItem context
1317
+ */
1318
+ export declare function useActivityItemContext(): ActivityItemContextValue;
1319
+
1320
+ /**
1321
+ * A hook that dynamically calculates the optimal page size for paginated lists
1322
+ * based on the container's available height and item measurements.
1323
+ *
1324
+ * Uses ResizeObserver to respond to container size changes and MutationObserver
1325
+ * to detect when new items are added to the container.
1326
+ *
1327
+ * @param containerRef - A ref to the scrollable container element
1328
+ * @param options - Configuration options for the hook
1329
+ * @returns The calculated page size, clamped to [min, max]
1330
+ *
1331
+ * @example
1332
+ * ```tsx
1333
+ * function PaginatedList() {
1334
+ * const containerRef = useRef<HTMLDivElement>(null)
1335
+ * const pageSize = useDynamicPageCount(containerRef, {
1336
+ * sampleCount: 3,
1337
+ * min: 5,
1338
+ * max: 20,
1339
+ * approxItemHeight: 100,
1340
+ * })
1341
+ *
1342
+ * return (
1343
+ * <div ref={containerRef} style={{ height: '600px', overflow: 'auto' }}>
1344
+ * {items.slice(0, pageSize).map(item => <ListItem key={item.id} {...item} />)}
1345
+ * </div>
1346
+ * )
1347
+ * }
1348
+ * ```
1349
+ */
1350
+ export declare function useDynamicPageCount(containerRef: RefObject<HTMLElement | null> | null, options?: UseDynamicPageCountOptions): number;
1351
+
1352
+ /**
1353
+ * Options for the useDynamicPageCount hook
1354
+ */
1355
+ export declare interface UseDynamicPageCountOptions {
1356
+ /**
1357
+ * Number of sample items to measure for calculating average item height.
1358
+ * @default 3
1359
+ */
1360
+ sampleCount?: number;
1361
+ /**
1362
+ * Minimum page size to return.
1363
+ * @default 3
1364
+ */
1365
+ min?: number;
1366
+ /**
1367
+ * Maximum page size to return.
1368
+ * @default 15
1369
+ */
1370
+ max?: number;
1371
+ /**
1372
+ * Approximate item height in pixels used as fallback when items cannot be measured.
1373
+ * @default 120
1374
+ */
1375
+ approxItemHeight?: number;
1376
+ }
1377
+
1378
+ /**
1379
+ * A hook that determines whether a container element is "compact" by measuring its width.
1380
+ * Uses ResizeObserver to respond to container size changes.
1381
+ *
1382
+ * @param containerRef - A ref to the HTML element to observe, or null
1383
+ * @param breakpointPx - The width threshold in pixels (default: 640). Returns true when width < breakpointPx
1384
+ * @returns true when the container width is less than breakpointPx, false otherwise.
1385
+ * Returns false when the container width is 0 (not rendered/measured yet).
1386
+ *
1387
+ * @example
1388
+ * ```tsx
1389
+ * function ResponsiveComponent() {
1390
+ * const containerRef = useRef<HTMLDivElement>(null)
1391
+ * const isCompact = useResponsive(containerRef, 640)
1392
+ *
1393
+ * return (
1394
+ * <div ref={containerRef}>
1395
+ * {isCompact ? <MobileLayout /> : <DesktopLayout />}
1396
+ * </div>
1397
+ * )
1398
+ * }
1399
+ * ```
1400
+ */
1401
+ export declare function useResponsive(containerRef: RefObject<HTMLElement | null> | null, breakpointPx?: number): boolean;
1402
+
1403
+ /**
1404
+ * Result of video ID extraction from a URL
1405
+ */
1406
+ declare interface VideoIdExtractionResult {
1407
+ provider: VideoProvider;
1408
+ videoId: string;
1409
+ }
1410
+
1411
+ /**
1412
+ * Video provider interface
1413
+ */
1414
+ export declare interface VideoProvider {
1415
+ /**
1416
+ * Internal provider name (lowercase, no spaces)
1417
+ */
1418
+ name: string;
1419
+ /**
1420
+ * Display name for the provider
1421
+ */
1422
+ displayName: string;
1423
+ /**
1424
+ * Domains this provider handles
1425
+ */
1426
+ domains: string[];
1427
+ /**
1428
+ * Extract video ID from a URL
1429
+ */
1430
+ extractVideoId: (url: string) => string | null;
1431
+ /**
1432
+ * Generate embed URL for a video ID
1433
+ */
1434
+ getEmbedUrl: (videoId: string, options?: EmbedOptions) => string;
1435
+ /**
1436
+ * Whether the provider supports autoplay
1437
+ */
1438
+ supportsAutoplay?: boolean;
1439
+ /**
1440
+ * Whether the provider has a JavaScript API
1441
+ */
1442
+ supportsApi?: boolean;
1443
+ /**
1444
+ * Provider tier classification
1445
+ */
1446
+ tier: VideoProviderTier;
1447
+ }
1448
+
1449
+ /**
1450
+ * Array of all registered video providers
1451
+ * Ordered by tier and priority for matching
1452
+ */
1453
+ export declare const videoProviders: VideoProvider[];
1454
+
1455
+ /**
1456
+ * Video provider tier classification
1457
+ */
1458
+ export declare type VideoProviderTier = 'major' | 'professional' | 'cloud' | 'social' | 'adult';
1459
+
839
1460
  export declare const WellnessIcons: {
840
- taichi: default_2.FC<IconProps>;
841
- meditation: default_2.FC<IconProps>;
842
- yoga: default_2.FC<IconProps>;
1461
+ taichi: FC<IconProps>;
1462
+ meditation: FC<IconProps>;
1463
+ yoga: FC<IconProps>;
843
1464
  };
844
1465
 
845
1466
  export declare const YogaIcon: default_2.FC<IconProps>;