@true-tech-team/react-components 0.0.4 → 0.0.5
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 +138 -0
- package/index.css +1 -1
- package/index.d.ts +10 -0
- package/index.js +1 -1
- package/index.mjs +10539 -6746
- package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroup.d.ts +79 -0
- package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupContext.d.ts +38 -0
- package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupItem.d.ts +37 -0
- package/lib/components/buttons/ButtonToggleGroup/index.d.ts +7 -0
- package/lib/components/buttons/ToggleButton/ToggleButton.d.ts +96 -0
- package/lib/components/buttons/ToggleButton/index.d.ts +3 -0
- package/lib/components/display/Icon/icons/BookmarkFilled.d.ts +3 -0
- package/lib/components/display/Icon/icons/ChevronsLeft.d.ts +3 -0
- package/lib/components/display/Icon/icons/ChevronsRight.d.ts +3 -0
- package/lib/components/display/Icon/icons/HeartFilled.d.ts +3 -0
- package/lib/components/display/Icon/icons/More.d.ts +3 -0
- package/lib/components/display/Icon/icons/StarFilled.d.ts +3 -0
- package/lib/components/display/Icon/icons/ThumbsUpFilled.d.ts +3 -0
- package/lib/components/display/Icon/icons/index.d.ts +15 -1
- package/lib/components/display/OverflowText/OverflowText.d.ts +81 -0
- package/lib/components/display/OverflowText/index.d.ts +2 -0
- package/lib/components/display/ScrollArea/ScrollArea.d.ts +112 -0
- package/lib/components/display/ScrollArea/index.d.ts +3 -0
- package/lib/components/display/Tabs/Tab.d.ts +41 -0
- package/lib/components/display/Tabs/TabList.d.ts +27 -0
- package/lib/components/display/Tabs/TabPanel.d.ts +31 -0
- package/lib/components/display/Tabs/Tabs.d.ts +90 -0
- package/lib/components/display/Tabs/TabsContext.d.ts +63 -0
- package/lib/components/display/Tabs/index.d.ts +11 -0
- package/lib/components/display/TruncatedList/TruncatedList.d.ts +69 -0
- package/lib/components/display/TruncatedList/index.d.ts +2 -0
- package/lib/components/display/index.d.ts +3 -0
- package/lib/components/index.d.ts +44 -0
- package/lib/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +122 -0
- package/lib/components/inputs/CheckboxGroup/CheckboxGroupContext.d.ts +42 -0
- package/lib/components/inputs/CheckboxGroup/CheckboxGroupItem.d.ts +50 -0
- package/lib/components/inputs/CheckboxGroup/index.d.ts +7 -0
- package/lib/components/layout/AdaptiveGrid/AdaptiveGrid.d.ts +100 -0
- package/lib/components/layout/AdaptiveGrid/index.d.ts +2 -0
- package/lib/components/layout/MasonryLayout/MasonryLayout.d.ts +74 -0
- package/lib/components/layout/MasonryLayout/index.d.ts +2 -0
- package/lib/components/layout/Panes/Pane.d.ts +72 -0
- package/lib/components/layout/Panes/Panes.d.ts +75 -0
- package/lib/components/layout/Panes/PanesContext.d.ts +60 -0
- package/lib/components/layout/Panes/index.d.ts +6 -0
- package/lib/components/layout/ResponsiveStack/ResponsiveStack.d.ts +99 -0
- package/lib/components/layout/ResponsiveStack/index.d.ts +2 -0
- package/lib/components/layout/index.d.ts +4 -0
- package/lib/components/navigation/BottomNavigation/BottomNavigation.d.ts +53 -0
- package/lib/components/navigation/BottomNavigation/BottomNavigationContext.d.ts +27 -0
- package/lib/components/navigation/BottomNavigation/BottomNavigationItem.d.ts +59 -0
- package/lib/components/navigation/BottomNavigation/index.d.ts +7 -0
- package/lib/components/navigation/Breadcrumbs/BreadcrumbItem.d.ts +37 -0
- package/lib/components/navigation/Breadcrumbs/BreadcrumbSeparator.d.ts +22 -0
- package/lib/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +96 -0
- package/lib/components/navigation/Breadcrumbs/index.d.ts +9 -0
- package/lib/components/navigation/Breadcrumbs/useBreadcrumbsFromPath.d.ts +73 -0
- package/lib/components/navigation/CollapsibleSidebar/CollapsibleSidebar.d.ts +113 -0
- package/lib/components/navigation/CollapsibleSidebar/index.d.ts +2 -0
- package/lib/components/navigation/NavLink/NavLink.d.ts +74 -0
- package/lib/components/navigation/NavLink/index.d.ts +3 -0
- package/lib/components/navigation/Navbar/Navbar.d.ts +81 -0
- package/lib/components/navigation/Navbar/NavbarActions.d.ts +21 -0
- package/lib/components/navigation/Navbar/NavbarBrand.d.ts +29 -0
- package/lib/components/navigation/Navbar/NavbarCollapse.d.ts +26 -0
- package/lib/components/navigation/Navbar/NavbarContext.d.ts +50 -0
- package/lib/components/navigation/Navbar/NavbarNav.d.ts +22 -0
- package/lib/components/navigation/Navbar/NavbarToggle.d.ts +21 -0
- package/lib/components/navigation/Navbar/index.d.ts +15 -0
- package/lib/components/navigation/Pagination/Pagination.d.ts +99 -0
- package/lib/components/navigation/Pagination/index.d.ts +3 -0
- package/lib/components/navigation/SideNav/SideNav.d.ts +89 -0
- package/lib/components/navigation/SideNav/SideNavContext.d.ts +43 -0
- package/lib/components/navigation/SideNav/SideNavDivider.d.ts +22 -0
- package/lib/components/navigation/SideNav/SideNavGroup.d.ts +44 -0
- package/lib/components/navigation/SideNav/SideNavItem.d.ts +71 -0
- package/lib/components/navigation/SideNav/index.d.ts +11 -0
- package/lib/components/navigation/Stepper/Step.d.ts +57 -0
- package/lib/components/navigation/Stepper/Stepper.d.ts +80 -0
- package/lib/components/navigation/Stepper/StepperContext.d.ts +58 -0
- package/lib/components/navigation/Stepper/index.d.ts +7 -0
- package/lib/components/navigation/index.d.ts +16 -0
- package/lib/components/overlays/Alert/Alert.d.ts +102 -0
- package/lib/components/overlays/Alert/AlertContext.d.ts +94 -0
- package/lib/components/overlays/Alert/AlertPresets.d.ts +42 -0
- package/lib/components/overlays/Alert/AlertProvider.d.ts +40 -0
- package/lib/components/overlays/Alert/index.d.ts +11 -0
- package/lib/components/overlays/Dialog/Dialog.d.ts +197 -0
- package/lib/components/overlays/Dialog/DialogContext.d.ts +75 -0
- package/lib/components/overlays/Dialog/DialogProvider.d.ts +30 -0
- package/lib/components/overlays/Dialog/index.d.ts +9 -0
- package/lib/components/overlays/Toast/Toast.d.ts +103 -0
- package/lib/components/overlays/Toast/ToastContainer.d.ts +37 -0
- package/lib/components/overlays/Toast/ToastContext.d.ts +126 -0
- package/lib/components/overlays/Toast/ToastProvider.d.ts +71 -0
- package/lib/components/overlays/Toast/index.d.ts +11 -0
- package/lib/hooks/index.d.ts +10 -0
- package/lib/hooks/useAlert/index.d.ts +2 -0
- package/lib/hooks/useAlert/useAlert.d.ts +99 -0
- package/lib/hooks/useAsyncToast/index.d.ts +2 -0
- package/lib/hooks/useAsyncToast/useAsyncToast.d.ts +93 -0
- package/lib/hooks/useDialog/index.d.ts +2 -0
- package/lib/hooks/useDialog/useDialog.d.ts +58 -0
- package/lib/hooks/useResizeObserver/index.d.ts +2 -0
- package/lib/hooks/useResizeObserver/useResizeObserver.d.ts +69 -0
- package/lib/hooks/useToast/index.d.ts +2 -0
- package/lib/hooks/useToast/useToast.d.ts +97 -0
- package/lib/providers/GlobalProvider/GlobalProvider.d.ts +16 -1
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the AdaptiveGrid component
|
|
5
|
+
*/
|
|
6
|
+
export interface AdaptiveGridProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Minimum width for each grid item (px)
|
|
9
|
+
* @default 200
|
|
10
|
+
*/
|
|
11
|
+
minItemWidth?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum columns (regardless of available space)
|
|
14
|
+
*/
|
|
15
|
+
maxColumns?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum columns
|
|
18
|
+
* @default 1
|
|
19
|
+
*/
|
|
20
|
+
minColumns?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Gap between items (px)
|
|
23
|
+
* @default 16
|
|
24
|
+
*/
|
|
25
|
+
gap?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Row gap (defaults to gap)
|
|
28
|
+
*/
|
|
29
|
+
rowGap?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Column gap (defaults to gap)
|
|
32
|
+
*/
|
|
33
|
+
columnGap?: number;
|
|
34
|
+
/**
|
|
35
|
+
* How items fill available space
|
|
36
|
+
* - 'auto-fill': Creates as many columns as will fit
|
|
37
|
+
* - 'auto-fit': Collapses empty columns
|
|
38
|
+
* @default 'auto-fill'
|
|
39
|
+
*/
|
|
40
|
+
fillMode?: 'auto-fill' | 'auto-fit';
|
|
41
|
+
/**
|
|
42
|
+
* Item alignment within cells
|
|
43
|
+
* @default 'stretch'
|
|
44
|
+
*/
|
|
45
|
+
alignItems?: 'start' | 'center' | 'end' | 'stretch';
|
|
46
|
+
/**
|
|
47
|
+
* Content justification
|
|
48
|
+
* @default 'start'
|
|
49
|
+
*/
|
|
50
|
+
justifyItems?: 'start' | 'center' | 'end' | 'stretch';
|
|
51
|
+
/**
|
|
52
|
+
* Callback when column count changes
|
|
53
|
+
*/
|
|
54
|
+
onColumnCountChange?: (count: number) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Content to render
|
|
57
|
+
*/
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* AdaptiveGrid - A CSS grid that auto-adjusts columns based on container width
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* Basic usage:
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <AdaptiveGrid minItemWidth={250} gap={16}>
|
|
67
|
+
* {products.map(product => (
|
|
68
|
+
* <ProductCard key={product.id} {...product} />
|
|
69
|
+
* ))}
|
|
70
|
+
* </AdaptiveGrid>
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* With column limits:
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <AdaptiveGrid
|
|
77
|
+
* minItemWidth={200}
|
|
78
|
+
* maxColumns={4}
|
|
79
|
+
* minColumns={2}
|
|
80
|
+
* gap={24}
|
|
81
|
+
* >
|
|
82
|
+
* {items.map(item => <Card key={item.id} {...item} />)}
|
|
83
|
+
* </AdaptiveGrid>
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* Different row and column gaps:
|
|
88
|
+
* ```tsx
|
|
89
|
+
* <AdaptiveGrid
|
|
90
|
+
* minItemWidth={300}
|
|
91
|
+
* rowGap={32}
|
|
92
|
+
* columnGap={16}
|
|
93
|
+
* fillMode="auto-fit"
|
|
94
|
+
* >
|
|
95
|
+
* {cards.map(card => <Card key={card.id} {...card} />)}
|
|
96
|
+
* </AdaptiveGrid>
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare const AdaptiveGrid: React.ForwardRefExoticComponent<AdaptiveGridProps & React.RefAttributes<HTMLDivElement>>;
|
|
100
|
+
export default AdaptiveGrid;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the MasonryLayout component
|
|
5
|
+
*/
|
|
6
|
+
export interface MasonryLayoutProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Target column width (px) - determines number of columns
|
|
9
|
+
* @default 250
|
|
10
|
+
*/
|
|
11
|
+
columnWidth?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Gap between items (px)
|
|
14
|
+
* @default 16
|
|
15
|
+
*/
|
|
16
|
+
gap?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum columns
|
|
19
|
+
*/
|
|
20
|
+
maxColumns?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Minimum columns
|
|
23
|
+
* @default 1
|
|
24
|
+
*/
|
|
25
|
+
minColumns?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Animation duration for layout changes (ms)
|
|
28
|
+
* @default 250
|
|
29
|
+
*/
|
|
30
|
+
animationDuration?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Animation easing function
|
|
33
|
+
* @default 'ease-out'
|
|
34
|
+
*/
|
|
35
|
+
animationEasing?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when column count changes
|
|
38
|
+
*/
|
|
39
|
+
onColumnCountChange?: (count: number) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Content to render
|
|
42
|
+
*/
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* MasonryLayout - Pinterest-style masonry layout that responds to container width
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* Basic usage:
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <MasonryLayout columnWidth={250} gap={16}>
|
|
52
|
+
* {images.map(img => (
|
|
53
|
+
* <img key={img.id} src={img.url} alt={img.alt} />
|
|
54
|
+
* ))}
|
|
55
|
+
* </MasonryLayout>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* With column constraints:
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <MasonryLayout
|
|
62
|
+
* columnWidth={200}
|
|
63
|
+
* gap={24}
|
|
64
|
+
* minColumns={2}
|
|
65
|
+
* maxColumns={5}
|
|
66
|
+
* >
|
|
67
|
+
* {cards.map(card => (
|
|
68
|
+
* <Card key={card.id} {...card} />
|
|
69
|
+
* ))}
|
|
70
|
+
* </MasonryLayout>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare const MasonryLayout: React.ForwardRefExoticComponent<MasonryLayoutProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
export default MasonryLayout;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Pane component
|
|
5
|
+
*/
|
|
6
|
+
export interface PaneProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Minimum width of the pane in pixels
|
|
9
|
+
* @default 200
|
|
10
|
+
*/
|
|
11
|
+
minWidth?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum width of the pane in pixels
|
|
14
|
+
*/
|
|
15
|
+
maxWidth?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Preferred width of the pane (flex-basis)
|
|
18
|
+
* Can be pixels, percentage, or 'auto'
|
|
19
|
+
* @default 'auto'
|
|
20
|
+
*/
|
|
21
|
+
preferredWidth?: number | string;
|
|
22
|
+
/**
|
|
23
|
+
* Flex grow factor
|
|
24
|
+
* @default 1
|
|
25
|
+
*/
|
|
26
|
+
grow?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Flex shrink factor
|
|
29
|
+
* @default 1
|
|
30
|
+
*/
|
|
31
|
+
shrink?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Priority for visibility (higher = shown first when space is limited)
|
|
34
|
+
* By default, uses the index (later children = higher priority)
|
|
35
|
+
*/
|
|
36
|
+
priority?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Unique identifier for the pane
|
|
39
|
+
*/
|
|
40
|
+
id?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Content of the pane
|
|
43
|
+
*/
|
|
44
|
+
children: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Internal props passed from Panes to Pane
|
|
48
|
+
*/
|
|
49
|
+
export interface PaneInternalProps {
|
|
50
|
+
/** Index of this pane within Panes children */
|
|
51
|
+
_index?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Pane - A child component of Panes that represents a single pane
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <Panes>
|
|
59
|
+
* <Pane minWidth={200} maxWidth={400}>
|
|
60
|
+
* Left sidebar
|
|
61
|
+
* </Pane>
|
|
62
|
+
* <Pane minWidth={400} grow={2}>
|
|
63
|
+
* Main content
|
|
64
|
+
* </Pane>
|
|
65
|
+
* <Pane minWidth={200}>
|
|
66
|
+
* Right sidebar
|
|
67
|
+
* </Pane>
|
|
68
|
+
* </Panes>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const Pane: React.ForwardRefExoticComponent<PaneProps & PaneInternalProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
export default Pane;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Panes container component
|
|
5
|
+
*/
|
|
6
|
+
export interface PanesProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Gap between panes in pixels
|
|
9
|
+
* @default 16
|
|
10
|
+
*/
|
|
11
|
+
gap?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Animation duration for pane transitions (ms)
|
|
14
|
+
* @default 250
|
|
15
|
+
*/
|
|
16
|
+
animationDuration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Animation easing function
|
|
19
|
+
* @default 'ease-in-out'
|
|
20
|
+
*/
|
|
21
|
+
animationEasing?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Minimum container width to show any panes
|
|
24
|
+
* @default 200
|
|
25
|
+
*/
|
|
26
|
+
minContainerWidth?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Callback when visible panes change
|
|
29
|
+
* @param visibleIds - Array of visible pane IDs
|
|
30
|
+
* @param visibleIndices - Array of visible pane indices
|
|
31
|
+
*/
|
|
32
|
+
onVisiblePanesChange?: (visibleIds: string[], visibleIndices: number[]) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Callback when a pane is hidden due to space constraints
|
|
35
|
+
* @param id - The ID of the hidden pane
|
|
36
|
+
* @param index - The index of the hidden pane
|
|
37
|
+
*/
|
|
38
|
+
onPaneHidden?: (id: string, index: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Pane children
|
|
41
|
+
*/
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Panes - A container that manages responsive pane visibility
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* Basic usage:
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Panes gap={16}>
|
|
51
|
+
* <Pane minWidth={200}>Sidebar</Pane>
|
|
52
|
+
* <Pane minWidth={400} grow={2}>Main Content</Pane>
|
|
53
|
+
* <Pane minWidth={200}>Details</Pane>
|
|
54
|
+
* </Panes>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* With callbacks:
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Panes
|
|
61
|
+
* onVisiblePanesChange={(ids, indices) => {
|
|
62
|
+
* console.log('Visible panes:', ids);
|
|
63
|
+
* }}
|
|
64
|
+
* onPaneHidden={(id, index) => {
|
|
65
|
+
* console.log('Pane hidden:', id, 'at index', index);
|
|
66
|
+
* }}
|
|
67
|
+
* >
|
|
68
|
+
* <Pane minWidth={200}>First</Pane>
|
|
69
|
+
* <Pane minWidth={300}>Second</Pane>
|
|
70
|
+
* <Pane minWidth={200}>Third (highest priority)</Pane>
|
|
71
|
+
* </Panes>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const Panes: React.ForwardRefExoticComponent<PanesProps & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
export default Panes;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for a registered pane
|
|
3
|
+
*/
|
|
4
|
+
export interface PaneConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
minWidth: number;
|
|
7
|
+
maxWidth?: number;
|
|
8
|
+
preferredWidth: number | string;
|
|
9
|
+
grow: number;
|
|
10
|
+
shrink: number;
|
|
11
|
+
priority: number;
|
|
12
|
+
index: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Context value for Panes component
|
|
16
|
+
*/
|
|
17
|
+
export interface PanesContextValue {
|
|
18
|
+
/**
|
|
19
|
+
* Register a pane with the container
|
|
20
|
+
*/
|
|
21
|
+
registerPane: (config: PaneConfig) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Unregister a pane
|
|
24
|
+
*/
|
|
25
|
+
unregisterPane: (id: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Update a pane's configuration
|
|
28
|
+
*/
|
|
29
|
+
updatePane: (id: string, config: Partial<PaneConfig>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Set of currently visible pane IDs
|
|
32
|
+
*/
|
|
33
|
+
visiblePanes: Set<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Set of pane IDs currently entering (animating in)
|
|
36
|
+
*/
|
|
37
|
+
enteringPanes: Set<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Set of pane IDs currently exiting (animating out)
|
|
40
|
+
*/
|
|
41
|
+
exitingPanes: Set<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Animation duration (ms)
|
|
44
|
+
*/
|
|
45
|
+
animationDuration: number;
|
|
46
|
+
/**
|
|
47
|
+
* Animation easing function
|
|
48
|
+
*/
|
|
49
|
+
animationEasing: string;
|
|
50
|
+
/**
|
|
51
|
+
* Gap between panes (px)
|
|
52
|
+
*/
|
|
53
|
+
gap: number;
|
|
54
|
+
}
|
|
55
|
+
declare const PanesContext: import('react').Context<PanesContextValue | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Hook to access Panes context
|
|
58
|
+
*/
|
|
59
|
+
export declare function usePanesContext(): PanesContextValue;
|
|
60
|
+
export { PanesContext };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Panes } from './Panes';
|
|
2
|
+
export type { PanesProps } from './Panes';
|
|
3
|
+
export { Pane } from './Pane';
|
|
4
|
+
export type { PaneProps } from './Pane';
|
|
5
|
+
export { usePanesContext } from './PanesContext';
|
|
6
|
+
export type { PanesContextValue, PaneConfig } from './PanesContext';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
4
|
+
type FlexAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
5
|
+
type FlexJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the ResponsiveStack component
|
|
8
|
+
*/
|
|
9
|
+
export interface ResponsiveStackProps extends BaseComponentProps {
|
|
10
|
+
/**
|
|
11
|
+
* Breakpoint width to switch from horizontal to vertical layout (px)
|
|
12
|
+
* @default 768
|
|
13
|
+
*/
|
|
14
|
+
breakpoint?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Direction when at/above breakpoint
|
|
17
|
+
* @default 'row'
|
|
18
|
+
*/
|
|
19
|
+
direction?: FlexDirection;
|
|
20
|
+
/**
|
|
21
|
+
* Direction when below breakpoint
|
|
22
|
+
* @default 'column'
|
|
23
|
+
*/
|
|
24
|
+
collapseDirection?: FlexDirection;
|
|
25
|
+
/**
|
|
26
|
+
* Gap between items (px)
|
|
27
|
+
* @default 16
|
|
28
|
+
*/
|
|
29
|
+
gap?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Gap when collapsed (defaults to gap)
|
|
32
|
+
*/
|
|
33
|
+
collapseGap?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Item alignment
|
|
36
|
+
* @default 'stretch'
|
|
37
|
+
*/
|
|
38
|
+
align?: FlexAlign;
|
|
39
|
+
/**
|
|
40
|
+
* Alignment when collapsed (defaults to align)
|
|
41
|
+
*/
|
|
42
|
+
collapseAlign?: FlexAlign;
|
|
43
|
+
/**
|
|
44
|
+
* Content justification
|
|
45
|
+
* @default 'start'
|
|
46
|
+
*/
|
|
47
|
+
justify?: FlexJustify;
|
|
48
|
+
/**
|
|
49
|
+
* Justification when collapsed (defaults to justify)
|
|
50
|
+
*/
|
|
51
|
+
collapseJustify?: FlexJustify;
|
|
52
|
+
/**
|
|
53
|
+
* Whether items should wrap
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
wrap?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Callback when layout direction changes
|
|
59
|
+
* @param isCollapsed - Whether the layout is in collapsed state
|
|
60
|
+
* @param direction - Current direction
|
|
61
|
+
*/
|
|
62
|
+
onLayoutChange?: (isCollapsed: boolean, direction: FlexDirection) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Content to render
|
|
65
|
+
*/
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* ResponsiveStack - A flex container that switches direction based on container width
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* Basic usage (row -> column on narrow screens):
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <ResponsiveStack breakpoint={600}>
|
|
75
|
+
* <div>Item 1</div>
|
|
76
|
+
* <div>Item 2</div>
|
|
77
|
+
* <div>Item 3</div>
|
|
78
|
+
* </ResponsiveStack>
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* Custom alignment:
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <ResponsiveStack
|
|
85
|
+
* breakpoint={768}
|
|
86
|
+
* align="center"
|
|
87
|
+
* justify="space-between"
|
|
88
|
+
* collapseAlign="stretch"
|
|
89
|
+
* collapseJustify="start"
|
|
90
|
+
* gap={24}
|
|
91
|
+
* collapseGap={16}
|
|
92
|
+
* >
|
|
93
|
+
* <Button>Save</Button>
|
|
94
|
+
* <Button>Cancel</Button>
|
|
95
|
+
* </ResponsiveStack>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare const ResponsiveStack: React.ForwardRefExoticComponent<ResponsiveStackProps & React.RefAttributes<HTMLDivElement>>;
|
|
99
|
+
export default ResponsiveStack;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface BottomNavigationProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Selected item value (controlled)
|
|
6
|
+
*/
|
|
7
|
+
value?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Default selected value (uncontrolled)
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when selection changes
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to show labels for all items
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
showLabels?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to only show label for selected item
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
showSelectedLabel?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Navigation items
|
|
28
|
+
*/
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* BottomNavigation - Mobile bottom navigation bar
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Basic usage
|
|
37
|
+
* <BottomNavigation value={selected} onChange={setSelected}>
|
|
38
|
+
* <BottomNavigationItem value="home" label="Home" icon="Home" />
|
|
39
|
+
* <BottomNavigationItem value="search" label="Search" icon="Search" />
|
|
40
|
+
* <BottomNavigationItem value="profile" label="Profile" icon="User" />
|
|
41
|
+
* </BottomNavigation>
|
|
42
|
+
*
|
|
43
|
+
* // Show label only for selected item
|
|
44
|
+
* <BottomNavigation value={selected} onChange={setSelected} showSelectedLabel>
|
|
45
|
+
* <BottomNavigationItem value="home" label="Home" icon="Home" />
|
|
46
|
+
* <BottomNavigationItem value="search" label="Search" icon="Search" />
|
|
47
|
+
* <BottomNavigationItem value="notifications" label="Notifications" icon="Bell" badge={<Badge>3</Badge>} />
|
|
48
|
+
* <BottomNavigationItem value="profile" label="Profile" icon="User" />
|
|
49
|
+
* </BottomNavigation>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const BottomNavigation: React.ForwardRefExoticComponent<BottomNavigationProps & React.RefAttributes<HTMLElement>>;
|
|
53
|
+
export default BottomNavigation;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface BottomNavigationContextValue {
|
|
2
|
+
/**
|
|
3
|
+
* Currently selected item value
|
|
4
|
+
*/
|
|
5
|
+
selectedValue: string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Select an item
|
|
8
|
+
*/
|
|
9
|
+
onSelect: (value: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to show labels
|
|
12
|
+
*/
|
|
13
|
+
showLabels: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to only show label for selected item
|
|
16
|
+
*/
|
|
17
|
+
showSelectedLabel: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const BottomNavigationContext: import('react').Context<BottomNavigationContextValue | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Hook to access BottomNavigation context (returns null if outside BottomNavigation)
|
|
22
|
+
*/
|
|
23
|
+
export declare function useBottomNavigationContext(): BottomNavigationContextValue | null;
|
|
24
|
+
/**
|
|
25
|
+
* Hook to access BottomNavigation context (throws if outside BottomNavigation)
|
|
26
|
+
*/
|
|
27
|
+
export declare function useBottomNavigationContextStrict(): BottomNavigationContextValue;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface BottomNavigationItemProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for this item
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Item label
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Item icon
|
|
15
|
+
*/
|
|
16
|
+
icon: React.ReactNode | IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Badge content
|
|
19
|
+
*/
|
|
20
|
+
badge?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Whether item is disabled
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Link href (renders as anchor tag)
|
|
27
|
+
*/
|
|
28
|
+
href?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Click handler
|
|
31
|
+
*/
|
|
32
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* BottomNavigationItem - Individual item in BottomNavigation
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <BottomNavigationItem value="home" label="Home" icon="Home" />
|
|
40
|
+
*
|
|
41
|
+
* // With badge
|
|
42
|
+
* <BottomNavigationItem
|
|
43
|
+
* value="notifications"
|
|
44
|
+
* label="Notifications"
|
|
45
|
+
* icon="Bell"
|
|
46
|
+
* badge={<Badge>5</Badge>}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // As link
|
|
50
|
+
* <BottomNavigationItem
|
|
51
|
+
* value="profile"
|
|
52
|
+
* label="Profile"
|
|
53
|
+
* icon="User"
|
|
54
|
+
* href="/profile"
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const BottomNavigationItem: React.ForwardRefExoticComponent<BottomNavigationItemProps & React.RefAttributes<HTMLElement>>;
|
|
59
|
+
export default BottomNavigationItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { BottomNavigation } from './BottomNavigation';
|
|
2
|
+
export type { BottomNavigationProps } from './BottomNavigation';
|
|
3
|
+
export { default } from './BottomNavigation';
|
|
4
|
+
export { BottomNavigationItem } from './BottomNavigationItem';
|
|
5
|
+
export type { BottomNavigationItemProps } from './BottomNavigationItem';
|
|
6
|
+
export { BottomNavigationContext, useBottomNavigationContext, useBottomNavigationContextStrict, } from './BottomNavigationContext';
|
|
7
|
+
export type { BottomNavigationContextValue } from './BottomNavigationContext';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface BreadcrumbItemProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Link href
|
|
7
|
+
*/
|
|
8
|
+
href?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether this is the current page
|
|
11
|
+
*/
|
|
12
|
+
current?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Icon to display
|
|
15
|
+
*/
|
|
16
|
+
icon?: React.ReactNode | IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Click handler
|
|
19
|
+
*/
|
|
20
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Item content
|
|
23
|
+
*/
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* BreadcrumbItem - Individual breadcrumb item
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
32
|
+
* <BreadcrumbItem href="/products">Products</BreadcrumbItem>
|
|
33
|
+
* <BreadcrumbItem current>Electronics</BreadcrumbItem>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const BreadcrumbItem: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLElement>>;
|
|
37
|
+
export default BreadcrumbItem;
|