@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,99 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
export type PaginationVariant = 'default' | 'outlined' | 'minimal';
|
|
4
|
+
export type PaginationShape = 'rounded' | 'circular' | 'square';
|
|
5
|
+
export interface PaginationProps extends BaseComponentProps {
|
|
6
|
+
/**
|
|
7
|
+
* Total number of pages
|
|
8
|
+
*/
|
|
9
|
+
totalPages: number;
|
|
10
|
+
/**
|
|
11
|
+
* Current page (1-indexed)
|
|
12
|
+
*/
|
|
13
|
+
currentPage: number;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when page changes
|
|
16
|
+
*/
|
|
17
|
+
onPageChange: (page: number) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Number of page buttons to show on each side of current page
|
|
20
|
+
* @default 1
|
|
21
|
+
*/
|
|
22
|
+
siblingCount?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Number of boundary pages to show at start and end
|
|
25
|
+
* @default 1
|
|
26
|
+
*/
|
|
27
|
+
boundaryCount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Show first/last page buttons
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
showFirstLast?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Show prev/next buttons
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
showPrevNext?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Size
|
|
40
|
+
* @default 'md'
|
|
41
|
+
*/
|
|
42
|
+
size?: ComponentSize;
|
|
43
|
+
/**
|
|
44
|
+
* Visual variant
|
|
45
|
+
* @default 'default'
|
|
46
|
+
*/
|
|
47
|
+
variant?: PaginationVariant;
|
|
48
|
+
/**
|
|
49
|
+
* Shape of page buttons
|
|
50
|
+
* @default 'rounded'
|
|
51
|
+
*/
|
|
52
|
+
shape?: PaginationShape;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to disable component
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Custom labels
|
|
59
|
+
*/
|
|
60
|
+
labels?: {
|
|
61
|
+
first?: string;
|
|
62
|
+
last?: string;
|
|
63
|
+
prev?: string;
|
|
64
|
+
next?: string;
|
|
65
|
+
page?: (page: number) => string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pagination - Page navigation for paginated content
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* // Basic usage
|
|
74
|
+
* <Pagination
|
|
75
|
+
* totalPages={10}
|
|
76
|
+
* currentPage={currentPage}
|
|
77
|
+
* onPageChange={setCurrentPage}
|
|
78
|
+
* />
|
|
79
|
+
*
|
|
80
|
+
* // With custom sibling count
|
|
81
|
+
* <Pagination
|
|
82
|
+
* totalPages={20}
|
|
83
|
+
* currentPage={currentPage}
|
|
84
|
+
* onPageChange={setCurrentPage}
|
|
85
|
+
* siblingCount={2}
|
|
86
|
+
* />
|
|
87
|
+
*
|
|
88
|
+
* // Minimal style without first/last
|
|
89
|
+
* <Pagination
|
|
90
|
+
* totalPages={10}
|
|
91
|
+
* currentPage={currentPage}
|
|
92
|
+
* onPageChange={setCurrentPage}
|
|
93
|
+
* variant="minimal"
|
|
94
|
+
* showFirstLast={false}
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
99
|
+
export default Pagination;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface SideNavProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Position of the sidebar
|
|
6
|
+
* @default 'left'
|
|
7
|
+
*/
|
|
8
|
+
position?: 'left' | 'right';
|
|
9
|
+
/**
|
|
10
|
+
* Controlled collapsed state (icon-only mode)
|
|
11
|
+
*/
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Default collapsed state
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
defaultCollapsed?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Callback when collapse state changes
|
|
20
|
+
*/
|
|
21
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Width when expanded (px)
|
|
24
|
+
* @default 240
|
|
25
|
+
*/
|
|
26
|
+
expandedWidth?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Width when collapsed (px)
|
|
29
|
+
* @default 64
|
|
30
|
+
*/
|
|
31
|
+
collapsedWidth?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Currently selected item value (controlled)
|
|
34
|
+
*/
|
|
35
|
+
selectedValue?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Default selected item value
|
|
38
|
+
*/
|
|
39
|
+
defaultSelectedValue?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Callback when selection changes
|
|
42
|
+
*/
|
|
43
|
+
onSelect?: (value: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Header content
|
|
46
|
+
*/
|
|
47
|
+
header?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Footer content
|
|
50
|
+
*/
|
|
51
|
+
footer?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Navigation items
|
|
54
|
+
*/
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* SideNav - Side navigation panel with icons, labels, and nesting support
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* // Basic usage
|
|
63
|
+
* <SideNav>
|
|
64
|
+
* <SideNavItem value="home" icon="Home" label="Home" />
|
|
65
|
+
* <SideNavItem value="settings" icon="Settings" label="Settings" />
|
|
66
|
+
* </SideNav>
|
|
67
|
+
*
|
|
68
|
+
* // With groups
|
|
69
|
+
* <SideNav selectedValue="profile" onSelect={handleSelect}>
|
|
70
|
+
* <SideNavItem value="dashboard" icon="Home" label="Dashboard" />
|
|
71
|
+
* <SideNavGroup groupId="settings" label="Settings" icon="Settings">
|
|
72
|
+
* <SideNavItem value="profile" label="Profile" />
|
|
73
|
+
* <SideNavItem value="security" label="Security" />
|
|
74
|
+
* </SideNavGroup>
|
|
75
|
+
* <SideNavDivider label="Other" />
|
|
76
|
+
* <SideNavItem value="help" icon="HelpCircle" label="Help" />
|
|
77
|
+
* </SideNav>
|
|
78
|
+
*
|
|
79
|
+
* // With header and footer
|
|
80
|
+
* <SideNav
|
|
81
|
+
* header={<Logo />}
|
|
82
|
+
* footer={<UserProfile />}
|
|
83
|
+
* >
|
|
84
|
+
* {navItems}
|
|
85
|
+
* </SideNav>
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const SideNav: React.ForwardRefExoticComponent<SideNavProps & React.RefAttributes<HTMLElement>>;
|
|
89
|
+
export default SideNav;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface SideNavContextValue {
|
|
2
|
+
/**
|
|
3
|
+
* Unique ID for this SideNav instance
|
|
4
|
+
*/
|
|
5
|
+
sideNavId: string;
|
|
6
|
+
/**
|
|
7
|
+
* Whether the sidebar is collapsed (icon-only mode)
|
|
8
|
+
*/
|
|
9
|
+
collapsed: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Currently selected item value
|
|
12
|
+
*/
|
|
13
|
+
selectedValue: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Select an item
|
|
16
|
+
*/
|
|
17
|
+
onSelect: (value: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Position of the sidebar
|
|
20
|
+
*/
|
|
21
|
+
position: 'left' | 'right';
|
|
22
|
+
/**
|
|
23
|
+
* Set of expanded group IDs
|
|
24
|
+
*/
|
|
25
|
+
expandedGroups: Set<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Toggle a group's expanded state
|
|
28
|
+
*/
|
|
29
|
+
toggleGroup: (groupId: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Register a group as expanded by default
|
|
32
|
+
*/
|
|
33
|
+
registerDefaultExpanded: (groupId: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const SideNavContext: import('react').Context<SideNavContextValue | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Hook to access SideNav context (returns null if outside SideNav)
|
|
38
|
+
*/
|
|
39
|
+
export declare function useSideNavContext(): SideNavContextValue | null;
|
|
40
|
+
/**
|
|
41
|
+
* Hook to access SideNav context (throws if outside SideNav)
|
|
42
|
+
*/
|
|
43
|
+
export declare function useSideNavContextStrict(): SideNavContextValue;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface SideNavDividerProps extends Omit<BaseComponentProps, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Optional label for the divider
|
|
6
|
+
*/
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* SideNavDivider - Visual separator for SideNav
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Simple divider
|
|
15
|
+
* <SideNavDivider />
|
|
16
|
+
*
|
|
17
|
+
* // With label
|
|
18
|
+
* <SideNavDivider label="Settings" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const SideNavDivider: React.ForwardRefExoticComponent<SideNavDividerProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export default SideNavDivider;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface SideNavGroupProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for this group
|
|
7
|
+
*/
|
|
8
|
+
groupId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Group label
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Icon for the group header
|
|
15
|
+
*/
|
|
16
|
+
icon?: React.ReactNode | IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Controlled expanded state
|
|
19
|
+
*/
|
|
20
|
+
expanded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Default expanded state
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
defaultExpanded?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Nested navigation items
|
|
28
|
+
*/
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* SideNavGroup - Grouped/nested navigation items
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <SideNavGroup groupId="settings" label="Settings" icon="Settings">
|
|
37
|
+
* <SideNavItem value="profile" label="Profile" />
|
|
38
|
+
* <SideNavItem value="security" label="Security" />
|
|
39
|
+
* <SideNavItem value="notifications" label="Notifications" />
|
|
40
|
+
* </SideNavGroup>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const SideNavGroup: React.ForwardRefExoticComponent<SideNavGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export default SideNavGroup;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface SideNavItemProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for this item
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Icon to display
|
|
11
|
+
*/
|
|
12
|
+
icon?: React.ReactNode | IconName;
|
|
13
|
+
/**
|
|
14
|
+
* Label text
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* Tooltip text (shown when collapsed, defaults to label)
|
|
19
|
+
*/
|
|
20
|
+
tooltip?: string;
|
|
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<HTMLElement>) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Badge content
|
|
35
|
+
*/
|
|
36
|
+
badge?: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* End adornment (icon, badge, etc.)
|
|
39
|
+
*/
|
|
40
|
+
endAdornment?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Nesting level (set automatically by SideNavGroup)
|
|
43
|
+
*/
|
|
44
|
+
level?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* SideNavItem - Individual navigation item for SideNav
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <SideNavItem value="home" icon="Home" label="Home" />
|
|
52
|
+
*
|
|
53
|
+
* // With badge
|
|
54
|
+
* <SideNavItem
|
|
55
|
+
* value="notifications"
|
|
56
|
+
* icon="Bell"
|
|
57
|
+
* label="Notifications"
|
|
58
|
+
* badge={<Badge>5</Badge>}
|
|
59
|
+
* />
|
|
60
|
+
*
|
|
61
|
+
* // As link
|
|
62
|
+
* <SideNavItem
|
|
63
|
+
* value="settings"
|
|
64
|
+
* icon="Settings"
|
|
65
|
+
* label="Settings"
|
|
66
|
+
* href="/settings"
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare const SideNavItem: React.ForwardRefExoticComponent<SideNavItemProps & React.RefAttributes<HTMLElement>>;
|
|
71
|
+
export default SideNavItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SideNav } from './SideNav';
|
|
2
|
+
export type { SideNavProps } from './SideNav';
|
|
3
|
+
export { default } from './SideNav';
|
|
4
|
+
export { SideNavItem } from './SideNavItem';
|
|
5
|
+
export type { SideNavItemProps } from './SideNavItem';
|
|
6
|
+
export { SideNavGroup } from './SideNavGroup';
|
|
7
|
+
export type { SideNavGroupProps } from './SideNavGroup';
|
|
8
|
+
export { SideNavDivider } from './SideNavDivider';
|
|
9
|
+
export type { SideNavDividerProps } from './SideNavDivider';
|
|
10
|
+
export { SideNavContext, useSideNavContext, useSideNavContextStrict } from './SideNavContext';
|
|
11
|
+
export type { SideNavContextValue } from './SideNavContext';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface StepProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Step title
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Step description
|
|
11
|
+
*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Custom icon (for 'icon' variant)
|
|
15
|
+
*/
|
|
16
|
+
icon?: React.ReactNode | IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Whether step is optional
|
|
19
|
+
*/
|
|
20
|
+
optional?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether step has error
|
|
23
|
+
*/
|
|
24
|
+
error?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Error message
|
|
27
|
+
*/
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Step content (for vertical orientation)
|
|
31
|
+
*/
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Step index (injected by Stepper parent)
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
_stepIndex?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Step - Individual step in a Stepper
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <Step title="Account" description="Create your account" />
|
|
45
|
+
*
|
|
46
|
+
* // With custom icon
|
|
47
|
+
* <Step title="Shipping" icon="Truck" />
|
|
48
|
+
*
|
|
49
|
+
* // Optional step
|
|
50
|
+
* <Step title="Extras" optional />
|
|
51
|
+
*
|
|
52
|
+
* // With error
|
|
53
|
+
* <Step title="Payment" error errorMessage="Please fix payment details" />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const Step: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
export default Step;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
import { StepperVariant, StepperOrientation } from './StepperContext';
|
|
4
|
+
export interface StepperProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Current active step (0-indexed)
|
|
7
|
+
*/
|
|
8
|
+
currentStep: number;
|
|
9
|
+
/**
|
|
10
|
+
* Callback when step is clicked
|
|
11
|
+
*/
|
|
12
|
+
onStepChange?: (step: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Orientation
|
|
15
|
+
* @default 'horizontal'
|
|
16
|
+
*/
|
|
17
|
+
orientation?: StepperOrientation;
|
|
18
|
+
/**
|
|
19
|
+
* Visual variant
|
|
20
|
+
* @default 'numbered'
|
|
21
|
+
*/
|
|
22
|
+
variant?: StepperVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Size
|
|
25
|
+
* @default 'md'
|
|
26
|
+
*/
|
|
27
|
+
size?: ComponentSize;
|
|
28
|
+
/**
|
|
29
|
+
* Allow clicking on steps to navigate
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
allowStepClick?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Only allow clicking previous steps
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
onlyPreviousClickable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Completed steps (for non-linear steppers)
|
|
40
|
+
*/
|
|
41
|
+
completedSteps?: number[];
|
|
42
|
+
/**
|
|
43
|
+
* Step components
|
|
44
|
+
*/
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Stepper - Wizard-style step navigation
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // Basic usage
|
|
53
|
+
* <Stepper currentStep={currentStep} onStepChange={setCurrentStep}>
|
|
54
|
+
* <Step title="Account" description="Create your account" />
|
|
55
|
+
* <Step title="Profile" description="Set up your profile" />
|
|
56
|
+
* <Step title="Review" description="Review and confirm" />
|
|
57
|
+
* </Stepper>
|
|
58
|
+
*
|
|
59
|
+
* // With clickable steps
|
|
60
|
+
* <Stepper
|
|
61
|
+
* currentStep={currentStep}
|
|
62
|
+
* onStepChange={setCurrentStep}
|
|
63
|
+
* allowStepClick
|
|
64
|
+
* onlyPreviousClickable
|
|
65
|
+
* >
|
|
66
|
+
* <Step title="Step 1" />
|
|
67
|
+
* <Step title="Step 2" />
|
|
68
|
+
* <Step title="Step 3" />
|
|
69
|
+
* </Stepper>
|
|
70
|
+
*
|
|
71
|
+
* // Vertical orientation
|
|
72
|
+
* <Stepper currentStep={currentStep} orientation="vertical">
|
|
73
|
+
* <Step title="Step 1">Step 1 content</Step>
|
|
74
|
+
* <Step title="Step 2">Step 2 content</Step>
|
|
75
|
+
* <Step title="Step 3">Step 3 content</Step>
|
|
76
|
+
* </Stepper>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLDivElement>>;
|
|
80
|
+
export default Stepper;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ComponentSize } from '../../../types';
|
|
2
|
+
export type StepperVariant = 'numbered' | 'dot' | 'icon';
|
|
3
|
+
export type StepperOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export interface StepperContextValue {
|
|
5
|
+
/**
|
|
6
|
+
* Unique ID for this stepper instance
|
|
7
|
+
*/
|
|
8
|
+
stepperId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Current active step (0-indexed)
|
|
11
|
+
*/
|
|
12
|
+
currentStep: number;
|
|
13
|
+
/**
|
|
14
|
+
* Total number of steps
|
|
15
|
+
*/
|
|
16
|
+
totalSteps: number;
|
|
17
|
+
/**
|
|
18
|
+
* Orientation
|
|
19
|
+
*/
|
|
20
|
+
orientation: StepperOrientation;
|
|
21
|
+
/**
|
|
22
|
+
* Visual variant
|
|
23
|
+
*/
|
|
24
|
+
variant: StepperVariant;
|
|
25
|
+
/**
|
|
26
|
+
* Size
|
|
27
|
+
*/
|
|
28
|
+
size: ComponentSize;
|
|
29
|
+
/**
|
|
30
|
+
* Set of completed step indices
|
|
31
|
+
*/
|
|
32
|
+
completedSteps: Set<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Click handler for steps
|
|
35
|
+
*/
|
|
36
|
+
onStepClick?: (step: number) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Whether step clicking is allowed
|
|
39
|
+
*/
|
|
40
|
+
allowStepClick: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Only allow clicking previous steps
|
|
43
|
+
*/
|
|
44
|
+
onlyPreviousClickable: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Register a step and get its index
|
|
47
|
+
*/
|
|
48
|
+
registerStep: () => number;
|
|
49
|
+
}
|
|
50
|
+
export declare const StepperContext: import('react').Context<StepperContextValue | null>;
|
|
51
|
+
/**
|
|
52
|
+
* Hook to access Stepper context (returns null if outside Stepper)
|
|
53
|
+
*/
|
|
54
|
+
export declare function useStepperContext(): StepperContextValue | null;
|
|
55
|
+
/**
|
|
56
|
+
* Hook to access Stepper context (throws if outside Stepper)
|
|
57
|
+
*/
|
|
58
|
+
export declare function useStepperContextStrict(): StepperContextValue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Stepper } from './Stepper';
|
|
2
|
+
export type { StepperProps } from './Stepper';
|
|
3
|
+
export { default } from './Stepper';
|
|
4
|
+
export { Step } from './Step';
|
|
5
|
+
export type { StepProps } from './Step';
|
|
6
|
+
export { StepperContext, useStepperContext, useStepperContextStrict } from './StepperContext';
|
|
7
|
+
export type { StepperContextValue, StepperVariant, StepperOrientation } from './StepperContext';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { CollapsibleSidebar } from './CollapsibleSidebar';
|
|
2
|
+
export type { CollapsibleSidebarProps } from './CollapsibleSidebar';
|
|
3
|
+
export { NavLink } from './NavLink';
|
|
4
|
+
export type { NavLinkProps, NavLinkVariant } from './NavLink';
|
|
5
|
+
export { Navbar, NavbarBrand, NavbarNav, NavbarActions, NavbarToggle, NavbarCollapse, NavbarContext, useNavbarContext, useNavbarContextStrict, } from './Navbar';
|
|
6
|
+
export type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarActionsProps, NavbarToggleProps, NavbarCollapseProps, NavbarContextValue, NavbarVariant, NavbarPosition, } from './Navbar';
|
|
7
|
+
export { SideNav, SideNavItem, SideNavGroup, SideNavDivider, SideNavContext, useSideNavContext, useSideNavContextStrict, } from './SideNav';
|
|
8
|
+
export type { SideNavProps, SideNavItemProps, SideNavGroupProps, SideNavDividerProps, SideNavContextValue, } from './SideNav';
|
|
9
|
+
export { Breadcrumbs, BreadcrumbItem, BreadcrumbSeparator, useBreadcrumbsFromPath, } from './Breadcrumbs';
|
|
10
|
+
export type { BreadcrumbsProps, BreadcrumbItemProps, BreadcrumbItemConfig, BreadcrumbSeparatorProps, UseBreadcrumbsFromPathOptions, } from './Breadcrumbs';
|
|
11
|
+
export { Pagination } from './Pagination';
|
|
12
|
+
export type { PaginationProps, PaginationVariant, PaginationShape } from './Pagination';
|
|
13
|
+
export { Stepper, Step, StepperContext, useStepperContext, useStepperContextStrict, } from './Stepper';
|
|
14
|
+
export type { StepperProps, StepProps, StepperContextValue, StepperVariant, StepperOrientation, } from './Stepper';
|
|
15
|
+
export { BottomNavigation, BottomNavigationItem, BottomNavigationContext, useBottomNavigationContext, useBottomNavigationContextStrict, } from './BottomNavigation';
|
|
16
|
+
export type { BottomNavigationProps, BottomNavigationItemProps, BottomNavigationContextValue, } from './BottomNavigation';
|