@appforgeapps/uiforge 0.5.0 → 0.5.3
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/README.md +525 -1
- package/dist/index.d.ts +765 -2
- package/dist/uiforge.cjs +5 -5
- package/dist/uiforge.css +1 -1
- package/dist/uiforge.js +2458 -1476
- package/package.json +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { RefObject } from 'react';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Represents a single activity/event in the stream
|
|
@@ -62,6 +63,67 @@ export declare const ActivityIcons: {
|
|
|
62
63
|
deploy: FC<IconProps>;
|
|
63
64
|
};
|
|
64
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
|
+
|
|
65
127
|
/**
|
|
66
128
|
* Pagination configuration for loading more events
|
|
67
129
|
*/
|
|
@@ -109,10 +171,20 @@ export declare const BusinessIcons: {
|
|
|
109
171
|
};
|
|
110
172
|
|
|
111
173
|
/**
|
|
112
|
-
* 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.
|
|
113
178
|
*/
|
|
114
179
|
export declare const Button: default_2.FC<ButtonProps>;
|
|
115
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
|
+
|
|
116
188
|
export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
117
189
|
/**
|
|
118
190
|
* Variant style of the button
|
|
@@ -122,6 +194,17 @@ export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTML
|
|
|
122
194
|
* Size of the button
|
|
123
195
|
*/
|
|
124
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;
|
|
125
208
|
/**
|
|
126
209
|
* Button contents
|
|
127
210
|
*/
|
|
@@ -364,8 +447,111 @@ export declare interface GridPaginationConfig {
|
|
|
364
447
|
serverSide?: boolean;
|
|
365
448
|
}
|
|
366
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
|
+
|
|
367
488
|
export declare const HeartRateIcon: default_2.FC<IconProps>;
|
|
368
489
|
|
|
490
|
+
/**
|
|
491
|
+
* IconButton - An accessible icon-only button with touch-friendly targets
|
|
492
|
+
*
|
|
493
|
+
* Features:
|
|
494
|
+
* - 44x44px minimum touch target for all sizes (WCAG 2.1 compliant)
|
|
495
|
+
* - Keyboard accessible (Enter/Space triggers click)
|
|
496
|
+
* - Visible focus styles
|
|
497
|
+
* - Optional badge support for notifications
|
|
498
|
+
* - Dark mode support
|
|
499
|
+
* - Reduced motion support
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```tsx
|
|
503
|
+
* import { IconButton, CloseIcon } from '@appforgeapps/uiforge'
|
|
504
|
+
*
|
|
505
|
+
* <IconButton
|
|
506
|
+
* icon={<CloseIcon />}
|
|
507
|
+
* ariaLabel="Close dialog"
|
|
508
|
+
* onClick={handleClose}
|
|
509
|
+
* />
|
|
510
|
+
* ```
|
|
511
|
+
*
|
|
512
|
+
* @example With badge
|
|
513
|
+
* ```tsx
|
|
514
|
+
* <IconButton
|
|
515
|
+
* icon={<NotificationIcon />}
|
|
516
|
+
* ariaLabel="Notifications"
|
|
517
|
+
* badge={5}
|
|
518
|
+
* onClick={handleNotifications}
|
|
519
|
+
* />
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
export declare const IconButton: default_2.FC<IconButtonProps>;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Props for the IconButton component
|
|
526
|
+
*/
|
|
527
|
+
export declare interface IconButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> {
|
|
528
|
+
/**
|
|
529
|
+
* The icon element to display. Should be an SVG icon or icon component.
|
|
530
|
+
*/
|
|
531
|
+
icon: default_2.ReactNode;
|
|
532
|
+
/**
|
|
533
|
+
* Size variant of the button.
|
|
534
|
+
* All sizes maintain a minimum 44x44px touch target for accessibility.
|
|
535
|
+
* @default 'medium'
|
|
536
|
+
*/
|
|
537
|
+
size?: 'small' | 'medium' | 'large';
|
|
538
|
+
/**
|
|
539
|
+
* Accessible label for the button.
|
|
540
|
+
* Required for icon-only buttons to ensure screen reader accessibility.
|
|
541
|
+
* @important Always provide a descriptive label for icon-only buttons.
|
|
542
|
+
*/
|
|
543
|
+
ariaLabel: string;
|
|
544
|
+
/**
|
|
545
|
+
* Optional badge content to display (e.g., notification count).
|
|
546
|
+
* Can be a string or number. Will be visually displayed as a small badge on the button.
|
|
547
|
+
*/
|
|
548
|
+
badge?: string | number;
|
|
549
|
+
/**
|
|
550
|
+
* Additional CSS class names for styling overrides.
|
|
551
|
+
*/
|
|
552
|
+
className?: string;
|
|
553
|
+
}
|
|
554
|
+
|
|
369
555
|
/**
|
|
370
556
|
* UIForge Icon Library
|
|
371
557
|
* A collection of monochrome SVG icons for use across UIForge components
|
|
@@ -391,6 +577,206 @@ export declare const MeetingIcon: default_2.FC<IconProps>;
|
|
|
391
577
|
|
|
392
578
|
export declare const MergeIcon: default_2.FC<IconProps>;
|
|
393
579
|
|
|
580
|
+
/**
|
|
581
|
+
* MobileHeaderLayout - A 3-slot mobile header layout primitive
|
|
582
|
+
*
|
|
583
|
+
* This component provides a standardized mobile header with left, center, and right slots.
|
|
584
|
+
* It uses SafeAreaContainer internally to respect device safe areas (iOS notch, status bar).
|
|
585
|
+
*
|
|
586
|
+
* Features:
|
|
587
|
+
* - 3-slot layout: left / center (title) / right
|
|
588
|
+
* - Safe area handling via SafeAreaContainer
|
|
589
|
+
* - Left and right slots have fixed min-width (≥44px) for touch targets
|
|
590
|
+
* - Center slot is flexible with text-overflow: ellipsis for long titles
|
|
591
|
+
* - Optional hide-on-desktop behavior (configurable via CSS variable)
|
|
592
|
+
* - CSS variables for height (default 56px) and padding
|
|
593
|
+
* - Dark mode support
|
|
594
|
+
*
|
|
595
|
+
* @example Basic usage
|
|
596
|
+
* ```tsx
|
|
597
|
+
* import { MobileHeaderLayout, IconButton, ArrowLeftIcon } from '@appforgeapps/uiforge'
|
|
598
|
+
*
|
|
599
|
+
* <MobileHeaderLayout
|
|
600
|
+
* left={<IconButton icon={<ArrowLeftIcon />} ariaLabel="Go back" onClick={handleBack} />}
|
|
601
|
+
* title="Page Title"
|
|
602
|
+
* right={<IconButton icon={<MenuIcon />} ariaLabel="Menu" onClick={handleMenu} />}
|
|
603
|
+
* />
|
|
604
|
+
* ```
|
|
605
|
+
*
|
|
606
|
+
* @example With React node as title
|
|
607
|
+
* ```tsx
|
|
608
|
+
* <MobileHeaderLayout
|
|
609
|
+
* left={<BackButton />}
|
|
610
|
+
* title={<Logo />}
|
|
611
|
+
* hideOnDesktop
|
|
612
|
+
* />
|
|
613
|
+
* ```
|
|
614
|
+
*
|
|
615
|
+
* @example Long title with ellipsis
|
|
616
|
+
* ```tsx
|
|
617
|
+
* <MobileHeaderLayout
|
|
618
|
+
* title="This is a very long title that will be truncated with ellipsis"
|
|
619
|
+
* right={<OverflowMenuButton />}
|
|
620
|
+
* />
|
|
621
|
+
* ```
|
|
622
|
+
*/
|
|
623
|
+
export declare const MobileHeaderLayout: default_2.FC<MobileHeaderLayoutProps>;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Props for the MobileHeaderLayout component
|
|
627
|
+
*/
|
|
628
|
+
export declare interface MobileHeaderLayoutProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
629
|
+
/**
|
|
630
|
+
* Content to render in the left slot (typically a back button or hamburger menu).
|
|
631
|
+
* Slot has a fixed min-width of 44px for touch target consistency.
|
|
632
|
+
*/
|
|
633
|
+
left?: default_2.ReactNode;
|
|
634
|
+
/**
|
|
635
|
+
* Content to render in the center slot.
|
|
636
|
+
* Can be a string (which will be rendered with ellipsis on overflow) or a React node.
|
|
637
|
+
*/
|
|
638
|
+
title?: default_2.ReactNode;
|
|
639
|
+
/**
|
|
640
|
+
* Content to render in the right slot (typically action buttons or overflow menu).
|
|
641
|
+
* Slot has a fixed min-width of 44px for touch target consistency.
|
|
642
|
+
*/
|
|
643
|
+
right?: default_2.ReactNode;
|
|
644
|
+
/**
|
|
645
|
+
* When true, the header is hidden at desktop breakpoints (min-width: 600px by default).
|
|
646
|
+
* Override the breakpoint in your own CSS by targeting .uiforge-mobile-header-layout--hide-on-desktop.
|
|
647
|
+
* @default false
|
|
648
|
+
*/
|
|
649
|
+
hideOnDesktop?: boolean;
|
|
650
|
+
/**
|
|
651
|
+
* Additional CSS class names for styling overrides.
|
|
652
|
+
*/
|
|
653
|
+
className?: string;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* OverflowMenu - An accessible popover menu for secondary actions
|
|
658
|
+
*
|
|
659
|
+
* Features:
|
|
660
|
+
* - Keyboard accessible (Arrow keys, Enter, Escape)
|
|
661
|
+
* - ARIA attributes for screen readers
|
|
662
|
+
* - Click outside to close
|
|
663
|
+
* - Focus management (returns focus to trigger on close)
|
|
664
|
+
* - Optional custom trigger element
|
|
665
|
+
* - Menu item icons and disabled states
|
|
666
|
+
* - Dark mode support
|
|
667
|
+
* - Reduced motion support
|
|
668
|
+
*
|
|
669
|
+
* @example Basic usage
|
|
670
|
+
* ```tsx
|
|
671
|
+
* import { OverflowMenu } from '@appforgeapps/uiforge'
|
|
672
|
+
*
|
|
673
|
+
* <OverflowMenu
|
|
674
|
+
* items={[
|
|
675
|
+
* { id: 'edit', label: 'Edit' },
|
|
676
|
+
* { id: 'delete', label: 'Delete' },
|
|
677
|
+
* ]}
|
|
678
|
+
* onSelect={(item) => console.log('Selected:', item.id)}
|
|
679
|
+
* />
|
|
680
|
+
* ```
|
|
681
|
+
*
|
|
682
|
+
* @example With icons and disabled items
|
|
683
|
+
* ```tsx
|
|
684
|
+
* <OverflowMenu
|
|
685
|
+
* items={[
|
|
686
|
+
* { id: 'edit', label: 'Edit', icon: <EditIcon /> },
|
|
687
|
+
* { id: 'archive', label: 'Archive', icon: <ArchiveIcon />, disabled: true },
|
|
688
|
+
* { id: 'delete', label: 'Delete', icon: <DeleteIcon /> },
|
|
689
|
+
* ]}
|
|
690
|
+
* ariaLabel="Post actions"
|
|
691
|
+
* onSelect={handleAction}
|
|
692
|
+
* />
|
|
693
|
+
* ```
|
|
694
|
+
*
|
|
695
|
+
* @example With custom trigger
|
|
696
|
+
* ```tsx
|
|
697
|
+
* <OverflowMenu
|
|
698
|
+
* trigger={<IconButton icon={<MoreIcon />} ariaLabel="More options" />}
|
|
699
|
+
* items={menuItems}
|
|
700
|
+
* onSelect={handleSelect}
|
|
701
|
+
* />
|
|
702
|
+
* ```
|
|
703
|
+
*/
|
|
704
|
+
export declare const OverflowMenu: default_2.FC<OverflowMenuProps>;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Represents a single item in the overflow menu
|
|
708
|
+
*/
|
|
709
|
+
export declare interface OverflowMenuItem {
|
|
710
|
+
/**
|
|
711
|
+
* Unique identifier for this menu item
|
|
712
|
+
*/
|
|
713
|
+
id: string;
|
|
714
|
+
/**
|
|
715
|
+
* Display label for this menu item
|
|
716
|
+
*/
|
|
717
|
+
label: string;
|
|
718
|
+
/**
|
|
719
|
+
* Optional icon to display (can be a React node like an SVG icon)
|
|
720
|
+
*/
|
|
721
|
+
icon?: default_2.ReactNode;
|
|
722
|
+
/**
|
|
723
|
+
* Whether this menu item is disabled
|
|
724
|
+
* @default false
|
|
725
|
+
*/
|
|
726
|
+
disabled?: boolean;
|
|
727
|
+
/**
|
|
728
|
+
* Optional callback when this item is clicked.
|
|
729
|
+
* If not provided, the parent onSelect callback will be used.
|
|
730
|
+
*/
|
|
731
|
+
onClick?: () => void;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Props for the OverflowMenu component
|
|
736
|
+
*/
|
|
737
|
+
export declare interface OverflowMenuProps {
|
|
738
|
+
/**
|
|
739
|
+
* Array of menu items to display
|
|
740
|
+
*/
|
|
741
|
+
items: OverflowMenuItem[];
|
|
742
|
+
/**
|
|
743
|
+
* Callback when a menu item is selected
|
|
744
|
+
*/
|
|
745
|
+
onSelect?: (item: OverflowMenuItem) => void;
|
|
746
|
+
/**
|
|
747
|
+
* Accessible label for the trigger button
|
|
748
|
+
* @default 'More actions'
|
|
749
|
+
*/
|
|
750
|
+
ariaLabel?: string;
|
|
751
|
+
/**
|
|
752
|
+
* Custom trigger element. If not provided, a default "..." button is rendered.
|
|
753
|
+
*/
|
|
754
|
+
trigger?: default_2.ReactNode;
|
|
755
|
+
/**
|
|
756
|
+
* Alignment of the menu relative to the trigger button
|
|
757
|
+
* @default 'right'
|
|
758
|
+
*/
|
|
759
|
+
align?: 'left' | 'right';
|
|
760
|
+
/**
|
|
761
|
+
* Whether the menu is disabled
|
|
762
|
+
* @default false
|
|
763
|
+
*/
|
|
764
|
+
disabled?: boolean;
|
|
765
|
+
/**
|
|
766
|
+
* Size variant of the trigger button (when using default trigger)
|
|
767
|
+
* @default 'medium'
|
|
768
|
+
*/
|
|
769
|
+
size?: 'small' | 'medium' | 'large';
|
|
770
|
+
/**
|
|
771
|
+
* Additional CSS class names for styling overrides
|
|
772
|
+
*/
|
|
773
|
+
className?: string;
|
|
774
|
+
/**
|
|
775
|
+
* Test ID for the component
|
|
776
|
+
*/
|
|
777
|
+
'data-testid'?: string;
|
|
778
|
+
}
|
|
779
|
+
|
|
394
780
|
export declare const PlanetIcon: default_2.FC<IconProps>;
|
|
395
781
|
|
|
396
782
|
/**
|
|
@@ -410,10 +796,89 @@ export declare const RocketIcon: default_2.FC<IconProps>;
|
|
|
410
796
|
|
|
411
797
|
export declare const RunningIcon: default_2.FC<IconProps>;
|
|
412
798
|
|
|
799
|
+
/**
|
|
800
|
+
* SafeAreaContainer - A container component that applies device safe area insets as padding.
|
|
801
|
+
*
|
|
802
|
+
* This component wraps content and automatically applies `env(safe-area-inset-*)` CSS values
|
|
803
|
+
* as padding to respect device safe areas such as iOS notches, status bars, and home indicators.
|
|
804
|
+
*
|
|
805
|
+
* Features:
|
|
806
|
+
* - Automatically applies safe area insets on all supported devices (iOS, Android)
|
|
807
|
+
* - Falls back gracefully to 0px on browsers that don't support `env()` function
|
|
808
|
+
* - Allows selective disabling of individual insets via props
|
|
809
|
+
* - Minimal CSS footprint with no JavaScript dependencies
|
|
810
|
+
* - Dark mode compatible
|
|
811
|
+
*
|
|
812
|
+
* @example Basic usage for a mobile header
|
|
813
|
+
* ```tsx
|
|
814
|
+
* import { SafeAreaContainer } from '@appforgeapps/uiforge'
|
|
815
|
+
*
|
|
816
|
+
* <SafeAreaContainer disableBottom>
|
|
817
|
+
* <header>My App Header</header>
|
|
818
|
+
* </SafeAreaContainer>
|
|
819
|
+
* ```
|
|
820
|
+
*
|
|
821
|
+
* @example Full-screen container with all safe areas
|
|
822
|
+
* ```tsx
|
|
823
|
+
* <SafeAreaContainer className="my-app-layout">
|
|
824
|
+
* <main>Content here is protected from notches and home indicators</main>
|
|
825
|
+
* </SafeAreaContainer>
|
|
826
|
+
* ```
|
|
827
|
+
*
|
|
828
|
+
* @example Header with only top inset
|
|
829
|
+
* ```tsx
|
|
830
|
+
* <SafeAreaContainer disableBottom disableLeft disableRight>
|
|
831
|
+
* <nav>Navigation bar</nav>
|
|
832
|
+
* </SafeAreaContainer>
|
|
833
|
+
* ```
|
|
834
|
+
*/
|
|
835
|
+
export declare const SafeAreaContainer: default_2.FC<SafeAreaContainerProps>;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Props for the SafeAreaContainer component
|
|
839
|
+
*/
|
|
840
|
+
export declare interface SafeAreaContainerProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
841
|
+
/**
|
|
842
|
+
* The content to be wrapped with safe area insets.
|
|
843
|
+
*/
|
|
844
|
+
children: default_2.ReactNode;
|
|
845
|
+
/**
|
|
846
|
+
* Disable the top safe area inset padding.
|
|
847
|
+
* Useful when a parent element already handles the top inset.
|
|
848
|
+
* @default false
|
|
849
|
+
*/
|
|
850
|
+
disableTop?: boolean;
|
|
851
|
+
/**
|
|
852
|
+
* Disable the bottom safe area inset padding.
|
|
853
|
+
* Useful when you only need top inset for headers.
|
|
854
|
+
* @default false
|
|
855
|
+
*/
|
|
856
|
+
disableBottom?: boolean;
|
|
857
|
+
/**
|
|
858
|
+
* Disable the left safe area inset padding.
|
|
859
|
+
* @default false
|
|
860
|
+
*/
|
|
861
|
+
disableLeft?: boolean;
|
|
862
|
+
/**
|
|
863
|
+
* Disable the right safe area inset padding.
|
|
864
|
+
* @default false
|
|
865
|
+
*/
|
|
866
|
+
disableRight?: boolean;
|
|
867
|
+
/**
|
|
868
|
+
* Additional CSS class names for styling overrides.
|
|
869
|
+
*/
|
|
870
|
+
className?: string;
|
|
871
|
+
}
|
|
872
|
+
|
|
413
873
|
export declare const SatelliteIcon: default_2.FC<IconProps>;
|
|
414
874
|
|
|
415
875
|
export declare const ServerIcon: default_2.FC<IconProps>;
|
|
416
876
|
|
|
877
|
+
/**
|
|
878
|
+
* Sidebar variant types
|
|
879
|
+
*/
|
|
880
|
+
export declare type SidebarVariant = 'static' | 'drawer' | 'bottom';
|
|
881
|
+
|
|
417
882
|
export declare const SpaceIcons: {
|
|
418
883
|
rocket: FC<IconProps>;
|
|
419
884
|
satellite: FC<IconProps>;
|
|
@@ -453,6 +918,59 @@ export declare interface TextFormat {
|
|
|
453
918
|
code?: boolean;
|
|
454
919
|
}
|
|
455
920
|
|
|
921
|
+
/**
|
|
922
|
+
* A standalone activity item component that can be used independently or within ActivityStream.
|
|
923
|
+
* Supports compact/mobile layouts through density prop and showMeta flag.
|
|
924
|
+
*/
|
|
925
|
+
export declare const UIForgeActivityItem: default_2.FC<UIForgeActivityItemProps>;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Props for the UIForgeActivityItem component
|
|
929
|
+
*/
|
|
930
|
+
export declare interface UIForgeActivityItemProps {
|
|
931
|
+
/**
|
|
932
|
+
* The activity event data to display
|
|
933
|
+
*/
|
|
934
|
+
event: ActivityItemEvent;
|
|
935
|
+
/**
|
|
936
|
+
* Whether the item is expanded (shows description)
|
|
937
|
+
*/
|
|
938
|
+
expanded?: boolean;
|
|
939
|
+
/**
|
|
940
|
+
* Callback when the item is toggled
|
|
941
|
+
*/
|
|
942
|
+
onToggle?: (eventId: string | number, expanded: boolean) => void;
|
|
943
|
+
/**
|
|
944
|
+
* Whether the item is expandable (has description or is expandable)
|
|
945
|
+
*/
|
|
946
|
+
expandable?: boolean;
|
|
947
|
+
/**
|
|
948
|
+
* Whether this is a child item (nested styling)
|
|
949
|
+
*/
|
|
950
|
+
isChild?: boolean;
|
|
951
|
+
/**
|
|
952
|
+
* Whether to show the timeline marker
|
|
953
|
+
*/
|
|
954
|
+
showTimeline?: boolean;
|
|
955
|
+
/**
|
|
956
|
+
* Density mode for the item. If not provided, uses context value or 'comfortable'
|
|
957
|
+
*/
|
|
958
|
+
density?: ActivityStreamDensity;
|
|
959
|
+
/**
|
|
960
|
+
* Whether to show metadata (timestamps, descriptions). If not provided, uses context value.
|
|
961
|
+
* When false, hides timestamps and truncates long content.
|
|
962
|
+
*/
|
|
963
|
+
showMeta?: boolean;
|
|
964
|
+
/**
|
|
965
|
+
* Custom icon renderer
|
|
966
|
+
*/
|
|
967
|
+
renderIcon?: (event: ActivityItemEvent) => default_2.ReactNode;
|
|
968
|
+
/**
|
|
969
|
+
* Custom className for styling
|
|
970
|
+
*/
|
|
971
|
+
className?: string;
|
|
972
|
+
}
|
|
973
|
+
|
|
456
974
|
/**
|
|
457
975
|
* A GitHub-inspired activity stream component with smart grouping, timeline, and theming
|
|
458
976
|
*/
|
|
@@ -474,6 +992,10 @@ export declare interface UIForgeActivityStreamProps {
|
|
|
474
992
|
* Custom className for styling
|
|
475
993
|
*/
|
|
476
994
|
className?: string;
|
|
995
|
+
/**
|
|
996
|
+
* Custom inline styles
|
|
997
|
+
*/
|
|
998
|
+
style?: default_2.CSSProperties;
|
|
477
999
|
/**
|
|
478
1000
|
* Whether to show the "Show more" bar
|
|
479
1001
|
*/
|
|
@@ -529,8 +1051,42 @@ export declare interface UIForgeActivityStreamProps {
|
|
|
529
1051
|
/**
|
|
530
1052
|
* Global scale factor (density) for spacing and icon sizes in the stream.
|
|
531
1053
|
* Set to values like 0.8 for compact, 1 for default, 1.2 for spacious.
|
|
1054
|
+
* @deprecated Use `density` prop instead for semantic density control.
|
|
532
1055
|
*/
|
|
533
1056
|
scale?: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* Density mode for the activity stream.
|
|
1059
|
+
* - 'comfortable': Default spacing and sizing (default)
|
|
1060
|
+
* - 'compact': Reduced spacing and smaller icons
|
|
1061
|
+
* - 'condensed': Minimal spacing for maximum information density
|
|
1062
|
+
*/
|
|
1063
|
+
density?: ActivityStreamDensity;
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether to enable responsive density switching based on container width.
|
|
1066
|
+
* When true, the component will automatically switch to 'compact' density
|
|
1067
|
+
* when the container width is below the breakpoint.
|
|
1068
|
+
* @default true
|
|
1069
|
+
*/
|
|
1070
|
+
responsive?: boolean;
|
|
1071
|
+
/**
|
|
1072
|
+
* Breakpoint width in pixels below which responsive mode switches to compact.
|
|
1073
|
+
* Only applies when `responsive` is true.
|
|
1074
|
+
* @default 640
|
|
1075
|
+
*/
|
|
1076
|
+
compactBreakpointPx?: number;
|
|
1077
|
+
/**
|
|
1078
|
+
* Optional ref to the container element for responsive measurements.
|
|
1079
|
+
* If not provided, an internal ref is used.
|
|
1080
|
+
*/
|
|
1081
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Whether to show metadata (timestamps, descriptions, etc.) on activity items.
|
|
1084
|
+
* When false, hides timestamps and truncates long content for a denser display.
|
|
1085
|
+
* When undefined, metadata is shown by default but may be auto-hidden on narrow containers
|
|
1086
|
+
* if responsive is true.
|
|
1087
|
+
* @default true
|
|
1088
|
+
*/
|
|
1089
|
+
showMeta?: boolean;
|
|
534
1090
|
/**
|
|
535
1091
|
* Custom icon renderer
|
|
536
1092
|
*/
|
|
@@ -539,6 +1095,19 @@ export declare interface UIForgeActivityStreamProps {
|
|
|
539
1095
|
* Custom event renderer
|
|
540
1096
|
*/
|
|
541
1097
|
renderEvent?: (event: ActivityEvent) => default_2.ReactNode;
|
|
1098
|
+
/**
|
|
1099
|
+
* Whether to enable virtualization for improved performance with large lists.
|
|
1100
|
+
* When enabled, uses react-window to render only visible items.
|
|
1101
|
+
* Note: Virtualization may affect animations and dynamic height measurements.
|
|
1102
|
+
* @default false
|
|
1103
|
+
*/
|
|
1104
|
+
virtualization?: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Height of each item in pixels when virtualization is enabled.
|
|
1107
|
+
* Required for react-window's fixed-size list.
|
|
1108
|
+
* @default 48
|
|
1109
|
+
*/
|
|
1110
|
+
virtualItemHeight?: number;
|
|
542
1111
|
}
|
|
543
1112
|
|
|
544
1113
|
/**
|
|
@@ -587,6 +1156,10 @@ export declare interface UIForgeBlocksEditorProps {
|
|
|
587
1156
|
* Whether the editor is read-only
|
|
588
1157
|
*/
|
|
589
1158
|
readOnly?: boolean;
|
|
1159
|
+
/**
|
|
1160
|
+
* Theme variant ('light' or 'dark')
|
|
1161
|
+
*/
|
|
1162
|
+
theme?: 'light' | 'dark';
|
|
590
1163
|
/**
|
|
591
1164
|
* Custom CSS class name
|
|
592
1165
|
*/
|
|
@@ -631,6 +1204,10 @@ export declare interface UIForgeComboBoxProps {
|
|
|
631
1204
|
* Async callback for dynamic suggestions (receives search text)
|
|
632
1205
|
*/
|
|
633
1206
|
onSearch?: (searchText: string, signal?: AbortSignal) => Promise<ComboBoxOption[]>;
|
|
1207
|
+
/**
|
|
1208
|
+
* Theme variant ('light' or 'dark')
|
|
1209
|
+
*/
|
|
1210
|
+
theme?: 'light' | 'dark';
|
|
634
1211
|
/**
|
|
635
1212
|
* Placeholder text
|
|
636
1213
|
*/
|
|
@@ -704,7 +1281,7 @@ export declare interface UIForgeComboBoxProps {
|
|
|
704
1281
|
/**
|
|
705
1282
|
* UIForgeGrid - A feature-rich data grid component
|
|
706
1283
|
*/
|
|
707
|
-
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;
|
|
1284
|
+
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;
|
|
708
1285
|
|
|
709
1286
|
/**
|
|
710
1287
|
* Props for the UIForgeGrid component
|
|
@@ -718,6 +1295,10 @@ export declare interface UIForgeGridProps<T = Record<string, unknown>> {
|
|
|
718
1295
|
* Data to display in the grid
|
|
719
1296
|
*/
|
|
720
1297
|
data: T[];
|
|
1298
|
+
/**
|
|
1299
|
+
* Theme variant ('light' or 'dark')
|
|
1300
|
+
*/
|
|
1301
|
+
theme?: 'light' | 'dark';
|
|
721
1302
|
/**
|
|
722
1303
|
* Enable row selection
|
|
723
1304
|
*/
|
|
@@ -788,6 +1369,85 @@ export declare interface UIForgeGridProps<T = Record<string, unknown>> {
|
|
|
788
1369
|
emptyMessage?: string;
|
|
789
1370
|
}
|
|
790
1371
|
|
|
1372
|
+
/**
|
|
1373
|
+
* UIForgeSidebar - A reusable sidebar component with multiple variants
|
|
1374
|
+
*
|
|
1375
|
+
* Features:
|
|
1376
|
+
* - Static variant for desktop fixed sidebars
|
|
1377
|
+
* - Drawer variant for slide-in panels with accessibility support
|
|
1378
|
+
* - Bottom variant for mobile bottom navigation
|
|
1379
|
+
* - Focus trapping for drawer/bottom variants
|
|
1380
|
+
* - ESC and backdrop click to close
|
|
1381
|
+
* - CSS safe-area insets support
|
|
1382
|
+
*/
|
|
1383
|
+
export declare const UIForgeSidebar: default_2.FC<UIForgeSidebarProps>;
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Props for the UIForgeSidebar component
|
|
1387
|
+
*/
|
|
1388
|
+
export declare interface UIForgeSidebarProps {
|
|
1389
|
+
/**
|
|
1390
|
+
* Unique identifier for the sidebar element
|
|
1391
|
+
* Useful for linking with aria-controls on trigger buttons
|
|
1392
|
+
*/
|
|
1393
|
+
id?: string;
|
|
1394
|
+
/**
|
|
1395
|
+
* Variant style of the sidebar
|
|
1396
|
+
* - 'static': Desktop fixed sidebar (default)
|
|
1397
|
+
* - 'drawer': Slide-in panel for mobile & small containers
|
|
1398
|
+
* - 'bottom': Bottom navigation variant for mobile
|
|
1399
|
+
*/
|
|
1400
|
+
variant?: SidebarVariant;
|
|
1401
|
+
/**
|
|
1402
|
+
* Whether the sidebar is open (only applies to 'drawer' and 'bottom' variants)
|
|
1403
|
+
*/
|
|
1404
|
+
open?: boolean;
|
|
1405
|
+
/**
|
|
1406
|
+
* Callback when open state changes (only applies to 'drawer' and 'bottom' variants)
|
|
1407
|
+
*/
|
|
1408
|
+
onOpenChange?: (open: boolean) => void;
|
|
1409
|
+
/**
|
|
1410
|
+
* Content to display inside the sidebar
|
|
1411
|
+
*/
|
|
1412
|
+
children: default_2.ReactNode;
|
|
1413
|
+
/**
|
|
1414
|
+
* Additional CSS class names
|
|
1415
|
+
*/
|
|
1416
|
+
className?: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* ARIA label for the sidebar
|
|
1419
|
+
*/
|
|
1420
|
+
ariaLabel?: string;
|
|
1421
|
+
/**
|
|
1422
|
+
* Width of the sidebar (CSS value, applies to 'static' and 'drawer' variants)
|
|
1423
|
+
*/
|
|
1424
|
+
width?: string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Height of the sidebar (CSS value, applies to 'bottom' variant only)
|
|
1427
|
+
*/
|
|
1428
|
+
height?: string;
|
|
1429
|
+
/**
|
|
1430
|
+
* Position of the sidebar for 'static' and 'drawer' variants
|
|
1431
|
+
*/
|
|
1432
|
+
position?: 'left' | 'right';
|
|
1433
|
+
/**
|
|
1434
|
+
* Whether to show the backdrop overlay (only applies to 'drawer' and 'bottom' variants)
|
|
1435
|
+
*/
|
|
1436
|
+
showBackdrop?: boolean;
|
|
1437
|
+
/**
|
|
1438
|
+
* Whether to close on backdrop click (only applies when showBackdrop is true)
|
|
1439
|
+
*/
|
|
1440
|
+
closeOnBackdropClick?: boolean;
|
|
1441
|
+
/**
|
|
1442
|
+
* Whether to close on ESC key press (only applies to 'drawer' and 'bottom' variants)
|
|
1443
|
+
*/
|
|
1444
|
+
closeOnEscape?: boolean;
|
|
1445
|
+
/**
|
|
1446
|
+
* Whether to trap focus within the sidebar (only applies to 'drawer' and 'bottom' variants)
|
|
1447
|
+
*/
|
|
1448
|
+
trapFocus?: boolean;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
791
1451
|
/**
|
|
792
1452
|
* UIForgeVideo - A universal video component that supports 30+ video platforms
|
|
793
1453
|
*
|
|
@@ -952,6 +1612,21 @@ export declare interface UIForgeVideoProps {
|
|
|
952
1612
|
* Height of the video player
|
|
953
1613
|
*/
|
|
954
1614
|
height?: string | number;
|
|
1615
|
+
/**
|
|
1616
|
+
* Maximum height of the video player
|
|
1617
|
+
*/
|
|
1618
|
+
maxHeight?: string | number;
|
|
1619
|
+
/**
|
|
1620
|
+
* Enable responsive behavior (aspect-video, full width, no min-height constraints)
|
|
1621
|
+
* When true, uses aspect-ratio layout that scales correctly on small screens
|
|
1622
|
+
* @default false
|
|
1623
|
+
*/
|
|
1624
|
+
responsive?: boolean;
|
|
1625
|
+
/**
|
|
1626
|
+
* Hide the header (title and description) for tight mobile UIs
|
|
1627
|
+
* @default false
|
|
1628
|
+
*/
|
|
1629
|
+
hideHeader?: boolean;
|
|
955
1630
|
/**
|
|
956
1631
|
* Custom overlay icon (defaults to play icon)
|
|
957
1632
|
*/
|
|
@@ -976,6 +1651,94 @@ export declare const UIIcons: {
|
|
|
976
1651
|
|
|
977
1652
|
export declare const UnfoldIcon: default_2.FC<IconProps>;
|
|
978
1653
|
|
|
1654
|
+
/**
|
|
1655
|
+
* Hook to access the ActivityItem context
|
|
1656
|
+
*/
|
|
1657
|
+
export declare function useActivityItemContext(): ActivityItemContextValue;
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* A hook that dynamically calculates the optimal page size for paginated lists
|
|
1661
|
+
* based on the container's available height and item measurements.
|
|
1662
|
+
*
|
|
1663
|
+
* Uses ResizeObserver to respond to container size changes and MutationObserver
|
|
1664
|
+
* to detect when new items are added to the container.
|
|
1665
|
+
*
|
|
1666
|
+
* @param containerRef - A ref to the scrollable container element
|
|
1667
|
+
* @param options - Configuration options for the hook
|
|
1668
|
+
* @returns The calculated page size, clamped to [min, max]
|
|
1669
|
+
*
|
|
1670
|
+
* @example
|
|
1671
|
+
* ```tsx
|
|
1672
|
+
* function PaginatedList() {
|
|
1673
|
+
* const containerRef = useRef<HTMLDivElement>(null)
|
|
1674
|
+
* const pageSize = useDynamicPageCount(containerRef, {
|
|
1675
|
+
* sampleCount: 3,
|
|
1676
|
+
* min: 5,
|
|
1677
|
+
* max: 20,
|
|
1678
|
+
* approxItemHeight: 100,
|
|
1679
|
+
* })
|
|
1680
|
+
*
|
|
1681
|
+
* return (
|
|
1682
|
+
* <div ref={containerRef} style={{ height: '600px', overflow: 'auto' }}>
|
|
1683
|
+
* {items.slice(0, pageSize).map(item => <ListItem key={item.id} {...item} />)}
|
|
1684
|
+
* </div>
|
|
1685
|
+
* )
|
|
1686
|
+
* }
|
|
1687
|
+
* ```
|
|
1688
|
+
*/
|
|
1689
|
+
export declare function useDynamicPageCount(containerRef: RefObject<HTMLElement | null> | null, options?: UseDynamicPageCountOptions): number;
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Options for the useDynamicPageCount hook
|
|
1693
|
+
*/
|
|
1694
|
+
export declare interface UseDynamicPageCountOptions {
|
|
1695
|
+
/**
|
|
1696
|
+
* Number of sample items to measure for calculating average item height.
|
|
1697
|
+
* @default 3
|
|
1698
|
+
*/
|
|
1699
|
+
sampleCount?: number;
|
|
1700
|
+
/**
|
|
1701
|
+
* Minimum page size to return.
|
|
1702
|
+
* @default 3
|
|
1703
|
+
*/
|
|
1704
|
+
min?: number;
|
|
1705
|
+
/**
|
|
1706
|
+
* Maximum page size to return.
|
|
1707
|
+
* @default 15
|
|
1708
|
+
*/
|
|
1709
|
+
max?: number;
|
|
1710
|
+
/**
|
|
1711
|
+
* Approximate item height in pixels used as fallback when items cannot be measured.
|
|
1712
|
+
* @default 120
|
|
1713
|
+
*/
|
|
1714
|
+
approxItemHeight?: number;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* A hook that determines whether a container element is "compact" by measuring its width.
|
|
1719
|
+
* Uses ResizeObserver to respond to container size changes.
|
|
1720
|
+
*
|
|
1721
|
+
* @param containerRef - A ref to the HTML element to observe, or null
|
|
1722
|
+
* @param breakpointPx - The width threshold in pixels (default: 640). Returns true when width < breakpointPx
|
|
1723
|
+
* @returns true when the container width is less than breakpointPx, false otherwise.
|
|
1724
|
+
* Returns false when the container width is 0 (not rendered/measured yet).
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```tsx
|
|
1728
|
+
* function ResponsiveComponent() {
|
|
1729
|
+
* const containerRef = useRef<HTMLDivElement>(null)
|
|
1730
|
+
* const isCompact = useResponsive(containerRef, 640)
|
|
1731
|
+
*
|
|
1732
|
+
* return (
|
|
1733
|
+
* <div ref={containerRef}>
|
|
1734
|
+
* {isCompact ? <MobileLayout /> : <DesktopLayout />}
|
|
1735
|
+
* </div>
|
|
1736
|
+
* )
|
|
1737
|
+
* }
|
|
1738
|
+
* ```
|
|
1739
|
+
*/
|
|
1740
|
+
export declare function useResponsive(containerRef: RefObject<HTMLElement | null> | null, breakpointPx?: number): boolean;
|
|
1741
|
+
|
|
979
1742
|
/**
|
|
980
1743
|
* Result of video ID extraction from a URL
|
|
981
1744
|
*/
|