@true-tech-team/react-components 0.0.4 → 0.0.6
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/index.css +1 -1
- package/index.d.ts +10 -0
- package/index.js +1 -1
- package/index.mjs +15961 -6871
- 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/List/List.d.ts +6 -0
- package/lib/components/display/List/ListContext.d.ts +15 -0
- package/lib/components/display/List/ListEmpty.d.ts +25 -0
- package/lib/components/display/List/ListGroup.d.ts +36 -0
- package/lib/components/display/List/ListHeader.d.ts +62 -0
- package/lib/components/display/List/ListItem.d.ts +19 -0
- package/lib/components/display/List/ListSearch.d.ts +32 -0
- package/lib/components/display/List/ListSkeleton.d.ts +27 -0
- package/lib/components/display/List/hooks/index.d.ts +5 -0
- package/lib/components/display/List/hooks/useListExpand.d.ts +6 -0
- package/lib/components/display/List/hooks/useListFilter.d.ts +6 -0
- package/lib/components/display/List/hooks/useListGroups.d.ts +6 -0
- package/lib/components/display/List/hooks/useListKeyboardNav.d.ts +6 -0
- package/lib/components/display/List/hooks/useListSelection.d.ts +6 -0
- package/lib/components/display/List/index.d.ts +11 -0
- package/lib/components/display/List/types.d.ts +485 -0
- package/lib/components/display/List/utils.d.ts +47 -0
- 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/Table/Table.d.ts +6 -0
- package/lib/components/display/Table/TableBody.d.ts +4 -0
- package/lib/components/display/Table/TableCell.d.ts +12 -0
- package/lib/components/display/Table/TableContext.d.ts +10 -0
- package/lib/components/display/Table/TableHeader.d.ts +4 -0
- package/lib/components/display/Table/TableRow.d.ts +9 -0
- package/lib/components/display/Table/TableSearch.d.ts +32 -0
- package/lib/components/display/Table/TableSkeleton.d.ts +12 -0
- package/lib/components/display/Table/hooks/index.d.ts +10 -0
- package/lib/components/display/Table/hooks/useInfiniteScroll.d.ts +11 -0
- package/lib/components/display/Table/hooks/useTableExpand.d.ts +10 -0
- package/lib/components/display/Table/hooks/useTableFilter.d.ts +22 -0
- package/lib/components/display/Table/hooks/useTableSelection.d.ts +16 -0
- package/lib/components/display/Table/hooks/useTableSort.d.ts +11 -0
- package/lib/components/display/Table/index.d.ts +13 -0
- package/lib/components/display/Table/types.d.ts +295 -0
- package/lib/components/display/Table/utils.d.ts +37 -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 +4 -0
- package/lib/components/dnd/DndProvider/DndContext.d.ts +91 -0
- package/lib/components/dnd/DndProvider/DndProvider.d.ts +37 -0
- package/lib/components/dnd/DndProvider/index.d.ts +3 -0
- package/lib/components/dnd/DragHandle/DragHandle.d.ts +41 -0
- package/lib/components/dnd/DragHandle/index.d.ts +2 -0
- package/lib/components/dnd/DragOverlay/DragOverlay.d.ts +39 -0
- package/lib/components/dnd/DragOverlay/index.d.ts +2 -0
- package/lib/components/dnd/KanbanBoard/KanbanBoard.d.ts +126 -0
- package/lib/components/dnd/KanbanBoard/KanbanBoardContext.d.ts +62 -0
- package/lib/components/dnd/KanbanBoard/KanbanCard.d.ts +76 -0
- package/lib/components/dnd/KanbanBoard/KanbanColumn.d.ts +43 -0
- package/lib/components/dnd/KanbanBoard/index.d.ts +5 -0
- package/lib/components/dnd/ResizablePanels/ResizablePanel.d.ts +53 -0
- package/lib/components/dnd/ResizablePanels/ResizablePanels.d.ts +43 -0
- package/lib/components/dnd/ResizablePanels/ResizablePanelsContext.d.ts +64 -0
- package/lib/components/dnd/ResizablePanels/ResizeHandle.d.ts +28 -0
- package/lib/components/dnd/ResizablePanels/index.d.ts +5 -0
- package/lib/components/dnd/SortableGrid/SortableGrid.d.ts +76 -0
- package/lib/components/dnd/SortableGrid/SortableGridItem.d.ts +47 -0
- package/lib/components/dnd/SortableGrid/index.d.ts +3 -0
- package/lib/components/dnd/SortableList/SortableItem.d.ts +76 -0
- package/lib/components/dnd/SortableList/SortableList.d.ts +98 -0
- package/lib/components/dnd/SortableList/SortableListContext.d.ts +42 -0
- package/lib/components/dnd/SortableList/index.d.ts +4 -0
- package/lib/components/dnd/hooks/index.d.ts +3 -0
- package/lib/components/dnd/hooks/useDraggable.d.ts +66 -0
- package/lib/components/dnd/hooks/useDroppable.d.ts +73 -0
- package/lib/components/dnd/hooks/useSortable.d.ts +94 -0
- package/lib/components/dnd/index.d.ts +8 -0
- package/lib/components/filters/FilterContext.d.ts +34 -0
- package/lib/components/filters/core/ActiveFilters/ActiveFilters.d.ts +16 -0
- package/lib/components/filters/core/ActiveFilters/index.d.ts +2 -0
- package/lib/components/filters/core/FilterField/FilterField.d.ts +17 -0
- package/lib/components/filters/core/FilterField/index.d.ts +2 -0
- package/lib/components/filters/core/FilterProvider/FilterProvider.d.ts +4 -0
- package/lib/components/filters/core/FilterProvider/index.d.ts +2 -0
- package/lib/components/filters/core/FilterSection/FilterSection.d.ts +16 -0
- package/lib/components/filters/core/FilterSection/index.d.ts +2 -0
- package/lib/components/filters/core/index.d.ts +7 -0
- package/lib/components/filters/fields/CheckboxFilter.d.ts +17 -0
- package/lib/components/filters/fields/DateFilter.d.ts +21 -0
- package/lib/components/filters/fields/DateRangeFilter.d.ts +19 -0
- package/lib/components/filters/fields/ListSelectFilter.d.ts +19 -0
- package/lib/components/filters/fields/MultiSelectFilter.d.ts +19 -0
- package/lib/components/filters/fields/NumberFilter.d.ts +19 -0
- package/lib/components/filters/fields/NumberRangeFilter.d.ts +19 -0
- package/lib/components/filters/fields/RatingFilter.d.ts +19 -0
- package/lib/components/filters/fields/SelectFilter.d.ts +21 -0
- package/lib/components/filters/fields/TextFilter.d.ts +21 -0
- package/lib/components/filters/fields/ToggleFilter.d.ts +17 -0
- package/lib/components/filters/fields/index.d.ts +25 -0
- package/lib/components/filters/hooks/index.d.ts +9 -0
- package/lib/components/filters/hooks/useFilter.d.ts +57 -0
- package/lib/components/filters/hooks/useFilterDependencies.d.ts +40 -0
- package/lib/components/filters/hooks/useFilterOptions.d.ts +70 -0
- package/lib/components/filters/index.d.ts +43 -0
- package/lib/components/filters/layouts/FilterAccordion/FilterAccordion.d.ts +15 -0
- package/lib/components/filters/layouts/FilterAccordion/index.d.ts +2 -0
- package/lib/components/filters/layouts/FilterBar/FilterBar.d.ts +18 -0
- package/lib/components/filters/layouts/FilterBar/index.d.ts +2 -0
- package/lib/components/filters/layouts/FilterModal/FilterModal.d.ts +24 -0
- package/lib/components/filters/layouts/FilterModal/index.d.ts +2 -0
- package/lib/components/filters/layouts/FilterPopover/FilterPopover.d.ts +19 -0
- package/lib/components/filters/layouts/FilterPopover/index.d.ts +2 -0
- package/lib/components/filters/layouts/FilterSidebar/FilterSidebar.d.ts +20 -0
- package/lib/components/filters/layouts/FilterSidebar/index.d.ts +2 -0
- package/lib/components/filters/layouts/index.d.ts +8 -0
- package/lib/components/filters/types.d.ts +937 -0
- package/lib/components/index.d.ts +52 -0
- package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
- 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/inputs/NumberInput/NumberInput.d.ts +3 -1
- 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
- package/README.md +0 -688
|
@@ -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;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface BreadcrumbSeparatorProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Custom separator content
|
|
6
|
+
* @default "/"
|
|
7
|
+
*/
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* BreadcrumbSeparator - Separator between breadcrumb items
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <BreadcrumbSeparator>/</BreadcrumbSeparator>
|
|
16
|
+
* <BreadcrumbSeparator>
|
|
17
|
+
* <ChevronRight />
|
|
18
|
+
* </BreadcrumbSeparator>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const BreadcrumbSeparator: React.ForwardRefExoticComponent<BreadcrumbSeparatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
22
|
+
export default BreadcrumbSeparator;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon';
|
|
4
|
+
export interface BreadcrumbItemConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Display label
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Link href
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Icon to display
|
|
15
|
+
*/
|
|
16
|
+
icon?: React.ReactNode | IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Whether this is the current/active page
|
|
19
|
+
*/
|
|
20
|
+
current?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface BreadcrumbsProps extends BaseComponentProps {
|
|
27
|
+
/**
|
|
28
|
+
* Custom separator element
|
|
29
|
+
* @default "/"
|
|
30
|
+
*/
|
|
31
|
+
separator?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum items before collapsing
|
|
34
|
+
*/
|
|
35
|
+
maxItems?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Number of items to show at start when collapsed
|
|
38
|
+
* @default 1
|
|
39
|
+
*/
|
|
40
|
+
itemsBeforeCollapse?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Number of items to show at end when collapsed
|
|
43
|
+
* @default 2
|
|
44
|
+
*/
|
|
45
|
+
itemsAfterCollapse?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Show home icon for first item
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
showHomeIcon?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Size variant
|
|
53
|
+
* @default 'md'
|
|
54
|
+
*/
|
|
55
|
+
size?: ComponentSize;
|
|
56
|
+
/**
|
|
57
|
+
* Breadcrumb items (declarative API)
|
|
58
|
+
*/
|
|
59
|
+
items?: BreadcrumbItemConfig[];
|
|
60
|
+
/**
|
|
61
|
+
* Children (compound API - BreadcrumbItem components)
|
|
62
|
+
*/
|
|
63
|
+
children?: React.ReactNode;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Breadcrumbs - Show current location in navigation hierarchy
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // Declarative API with items prop
|
|
71
|
+
* <Breadcrumbs
|
|
72
|
+
* items={[
|
|
73
|
+
* { label: 'Home', href: '/' },
|
|
74
|
+
* { label: 'Products', href: '/products' },
|
|
75
|
+
* { label: 'Electronics', current: true },
|
|
76
|
+
* ]}
|
|
77
|
+
* />
|
|
78
|
+
*
|
|
79
|
+
* // Compound API with children
|
|
80
|
+
* <Breadcrumbs>
|
|
81
|
+
* <BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
82
|
+
* <BreadcrumbItem href="/products">Products</BreadcrumbItem>
|
|
83
|
+
* <BreadcrumbItem current>Electronics</BreadcrumbItem>
|
|
84
|
+
* </Breadcrumbs>
|
|
85
|
+
*
|
|
86
|
+
* // With collapse
|
|
87
|
+
* <Breadcrumbs
|
|
88
|
+
* items={items}
|
|
89
|
+
* maxItems={4}
|
|
90
|
+
* itemsBeforeCollapse={1}
|
|
91
|
+
* itemsAfterCollapse={2}
|
|
92
|
+
* />
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare const Breadcrumbs: React.ForwardRefExoticComponent<BreadcrumbsProps & React.RefAttributes<HTMLElement>>;
|
|
96
|
+
export default Breadcrumbs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Breadcrumbs } from './Breadcrumbs';
|
|
2
|
+
export type { BreadcrumbsProps, BreadcrumbItemConfig } from './Breadcrumbs';
|
|
3
|
+
export { default } from './Breadcrumbs';
|
|
4
|
+
export { BreadcrumbItem } from './BreadcrumbItem';
|
|
5
|
+
export type { BreadcrumbItemProps } from './BreadcrumbItem';
|
|
6
|
+
export { BreadcrumbSeparator } from './BreadcrumbSeparator';
|
|
7
|
+
export type { BreadcrumbSeparatorProps } from './BreadcrumbSeparator';
|
|
8
|
+
export { useBreadcrumbsFromPath } from './useBreadcrumbsFromPath';
|
|
9
|
+
export type { UseBreadcrumbsFromPathOptions } from './useBreadcrumbsFromPath';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BreadcrumbItemConfig } from './Breadcrumbs';
|
|
2
|
+
export interface UseBreadcrumbsFromPathOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Current path (e.g., from useLocation or window.location.pathname)
|
|
5
|
+
*/
|
|
6
|
+
path: string;
|
|
7
|
+
/**
|
|
8
|
+
* Custom label mapping for path segments
|
|
9
|
+
* @example { 'users': 'All Users', 'settings': 'Account Settings' }
|
|
10
|
+
*/
|
|
11
|
+
labels?: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Base path to start from (segments before this are ignored)
|
|
14
|
+
* @default '/'
|
|
15
|
+
*/
|
|
16
|
+
basePath?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Label for the home/root breadcrumb
|
|
19
|
+
* @default 'Home'
|
|
20
|
+
*/
|
|
21
|
+
homeLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Include home as the first breadcrumb
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
includeHome?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Transform function for labels (applied after labels lookup)
|
|
29
|
+
* @default Capitalizes first letter and replaces hyphens/underscores with spaces
|
|
30
|
+
*/
|
|
31
|
+
labelTransform?: (segment: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Segments to exclude from breadcrumbs (e.g., route groups like '(auth)')
|
|
34
|
+
*/
|
|
35
|
+
excludeSegments?: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Hook to auto-generate breadcrumbs from a URL path
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Basic usage
|
|
43
|
+
* const breadcrumbs = useBreadcrumbsFromPath({
|
|
44
|
+
* path: '/products/electronics/phones',
|
|
45
|
+
* });
|
|
46
|
+
* // Result: [
|
|
47
|
+
* // { label: 'Home', href: '/' },
|
|
48
|
+
* // { label: 'Products', href: '/products' },
|
|
49
|
+
* // { label: 'Electronics', href: '/products/electronics' },
|
|
50
|
+
* // { label: 'Phones', href: '/products/electronics/phones', current: true },
|
|
51
|
+
* // ]
|
|
52
|
+
*
|
|
53
|
+
* // With custom labels
|
|
54
|
+
* const breadcrumbs = useBreadcrumbsFromPath({
|
|
55
|
+
* path: '/users/123/settings',
|
|
56
|
+
* labels: {
|
|
57
|
+
* 'users': 'All Users',
|
|
58
|
+
* 'settings': 'Account Settings',
|
|
59
|
+
* },
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // With Next.js App Router (excluding route groups)
|
|
63
|
+
* const breadcrumbs = useBreadcrumbsFromPath({
|
|
64
|
+
* path: '/(dashboard)/projects/123',
|
|
65
|
+
* excludeSegments: ['(dashboard)', '(auth)'],
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // Usage in component
|
|
69
|
+
* <Breadcrumbs items={breadcrumbs} />
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function useBreadcrumbsFromPath(options: UseBreadcrumbsFromPathOptions): BreadcrumbItemConfig[];
|
|
73
|
+
export default useBreadcrumbsFromPath;
|