@true-tech-team/react-components 0.0.5 → 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.js +1 -1
- package/index.mjs +14032 -8735
- 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/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/index.d.ts +1 -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 +8 -0
- package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/inputs/NumberInput/NumberInput.d.ts +3 -1
- package/package.json +1 -1
- package/README.md +0 -826
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ListProps } from './types';
|
|
3
|
+
export declare const List: <T extends Record<string, unknown> = Record<string, unknown>>(props: ListProps<T> & {
|
|
4
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
5
|
+
}) => React.ReactElement;
|
|
6
|
+
export default List;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ListContextValue } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Context for sharing List state with child components
|
|
4
|
+
*/
|
|
5
|
+
export declare const ListContext: import('react').Context<ListContextValue<Record<string, unknown>> | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Hook to access List context (optional access)
|
|
8
|
+
* Returns null if used outside of List component
|
|
9
|
+
*/
|
|
10
|
+
export declare function useListContext<T = Record<string, unknown>>(): ListContextValue<T> | null;
|
|
11
|
+
/**
|
|
12
|
+
* Hook to access List context (strict access)
|
|
13
|
+
* Throws error if used outside of List component
|
|
14
|
+
*/
|
|
15
|
+
export declare function useListContextStrict<T = Record<string, unknown>>(): ListContextValue<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ListEmptyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Content to display when list is empty
|
|
5
|
+
* @default 'No items to display'
|
|
6
|
+
*/
|
|
7
|
+
content?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Custom render function for empty state
|
|
10
|
+
*/
|
|
11
|
+
renderEmpty?: () => ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this is a "no results" state (from filtering)
|
|
14
|
+
*/
|
|
15
|
+
isNoResults?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Search query (shown when isNoResults is true)
|
|
18
|
+
*/
|
|
19
|
+
searchQuery?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function ListEmpty({ content, renderEmpty, isNoResults, searchQuery, }: ListEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare namespace ListEmpty {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
export default ListEmpty;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ListGroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* Group key (used for collapse state tracking)
|
|
5
|
+
*/
|
|
6
|
+
groupKey: string;
|
|
7
|
+
/**
|
|
8
|
+
* Number of items in the group
|
|
9
|
+
*/
|
|
10
|
+
itemCount: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the group is collapsible
|
|
13
|
+
*/
|
|
14
|
+
collapsible: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the group is collapsed
|
|
17
|
+
*/
|
|
18
|
+
isCollapsed: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Callback to toggle collapse state
|
|
21
|
+
*/
|
|
22
|
+
onToggle: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Custom render function for the group header
|
|
25
|
+
*/
|
|
26
|
+
renderHeader?: (groupKey: string, itemCount: number, isCollapsed: boolean) => ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Children (the group items)
|
|
29
|
+
*/
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function ListGroup({ groupKey, itemCount, collapsible, isCollapsed, onToggle, renderHeader, children, }: ListGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace ListGroup {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export default ListGroup;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BulkAction, SelectionMode } from './types';
|
|
3
|
+
import { ComponentSize } from '../../../types';
|
|
4
|
+
export interface ListHeaderProps<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
5
|
+
/**
|
|
6
|
+
* Selection mode
|
|
7
|
+
*/
|
|
8
|
+
selectionMode: SelectionMode;
|
|
9
|
+
/**
|
|
10
|
+
* Whether all items are selected
|
|
11
|
+
*/
|
|
12
|
+
isAllSelected: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether selection is indeterminate
|
|
15
|
+
*/
|
|
16
|
+
isIndeterminate: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback to select/deselect all
|
|
19
|
+
*/
|
|
20
|
+
onSelectAll: (selected: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Number of selected items
|
|
23
|
+
*/
|
|
24
|
+
selectedCount: number;
|
|
25
|
+
/**
|
|
26
|
+
* Total number of items
|
|
27
|
+
*/
|
|
28
|
+
totalCount: number;
|
|
29
|
+
/**
|
|
30
|
+
* Selected items data
|
|
31
|
+
*/
|
|
32
|
+
selectedItems: T[];
|
|
33
|
+
/**
|
|
34
|
+
* Selected item keys
|
|
35
|
+
*/
|
|
36
|
+
selectedKeys: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Bulk actions configuration
|
|
39
|
+
*/
|
|
40
|
+
bulkActions?: Array<BulkAction<T>>;
|
|
41
|
+
/**
|
|
42
|
+
* Custom render for bulk actions
|
|
43
|
+
*/
|
|
44
|
+
renderBulkActions?: (selectedItems: T[], selectedKeys: string[], actions: Array<BulkAction<T>>) => ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Position of header (for sticky behavior)
|
|
47
|
+
*/
|
|
48
|
+
position: 'top' | 'bottom' | 'sticky-top' | 'sticky-bottom';
|
|
49
|
+
/**
|
|
50
|
+
* Size variant
|
|
51
|
+
*/
|
|
52
|
+
size: ComponentSize;
|
|
53
|
+
/**
|
|
54
|
+
* Search component to render
|
|
55
|
+
*/
|
|
56
|
+
searchComponent?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare function ListHeader<T extends Record<string, unknown>>({ selectionMode, isAllSelected, isIndeterminate, onSelectAll, selectedCount, totalCount, selectedItems, selectedKeys, bulkActions, renderBulkActions, position, size, searchComponent, }: ListHeaderProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
59
|
+
export declare namespace ListHeader {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
export default ListHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ListItemProps<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
3
|
+
/**
|
|
4
|
+
* The item data
|
|
5
|
+
*/
|
|
6
|
+
item: T;
|
|
7
|
+
/**
|
|
8
|
+
* Index of the item in the list
|
|
9
|
+
*/
|
|
10
|
+
index: number;
|
|
11
|
+
/**
|
|
12
|
+
* Actual index in filtered data (may differ due to grouping)
|
|
13
|
+
*/
|
|
14
|
+
filteredIndex: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const ListItem: <T extends Record<string, unknown> = Record<string, unknown>>(props: ListItemProps<T> & {
|
|
17
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
18
|
+
}) => React.ReactElement;
|
|
19
|
+
export default ListItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ListSearchProps {
|
|
2
|
+
/**
|
|
3
|
+
* Current search query
|
|
4
|
+
*/
|
|
5
|
+
value: string;
|
|
6
|
+
/**
|
|
7
|
+
* Callback when search query changes
|
|
8
|
+
*/
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Placeholder text
|
|
12
|
+
* @default 'Search...'
|
|
13
|
+
*/
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the search is currently filtering (debounce active)
|
|
17
|
+
*/
|
|
18
|
+
isFiltering?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Auto focus the input on mount
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Callback when input is cleared
|
|
25
|
+
*/
|
|
26
|
+
onClear?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function ListSearch({ value, onChange, placeholder, isFiltering: _isFiltering, autoFocus, onClear, }: ListSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace ListSearch {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export default ListSearch;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentSize } from '../../../types';
|
|
2
|
+
export interface ListSkeletonProps {
|
|
3
|
+
/**
|
|
4
|
+
* Number of skeleton rows to display
|
|
5
|
+
* @default 5
|
|
6
|
+
*/
|
|
7
|
+
rows?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to show avatar placeholder
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
showAvatar?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show secondary text placeholder
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
showSecondaryText?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Size variant (affects dimensions)
|
|
20
|
+
*/
|
|
21
|
+
size?: ComponentSize;
|
|
22
|
+
}
|
|
23
|
+
export declare function ListSkeleton({ rows, showAvatar, showSecondaryText, size, }: ListSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare namespace ListSkeleton {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export default ListSkeleton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseListExpandOptions, UseListExpandReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing expandable list items
|
|
4
|
+
* Supports controlled/uncontrolled patterns
|
|
5
|
+
*/
|
|
6
|
+
export declare function useListExpand({ expandedKeys: controlledKeys, defaultExpandedKeys, onExpandChange, }: UseListExpandOptions): UseListExpandReturn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseListFilterOptions, UseListFilterReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for filtering list items with optional debounce
|
|
4
|
+
* Supports controlled/uncontrolled patterns and custom filter functions
|
|
5
|
+
*/
|
|
6
|
+
export declare function useListFilter<T extends Record<string, unknown>>({ data, searchQuery: controlledQuery, defaultSearchQuery, onSearchChange, searchFields, searchFn, debounceMs, }: UseListFilterOptions<T>): UseListFilterReturn<T>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseListGroupsOptions, UseListGroupsReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for grouping list items with collapsible support
|
|
4
|
+
* Supports controlled/uncontrolled patterns for collapsed state
|
|
5
|
+
*/
|
|
6
|
+
export declare function useListGroups<T extends Record<string, unknown>>({ data, groupBy, collapsedGroups: controlledCollapsed, defaultCollapsedGroups, onCollapsedGroupsChange, }: UseListGroupsOptions<T>): UseListGroupsReturn<T>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseListKeyboardNavOptions, UseListKeyboardNavReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for keyboard navigation in lists
|
|
4
|
+
* Supports vertical, horizontal, and grid navigation patterns
|
|
5
|
+
*/
|
|
6
|
+
export declare function useListKeyboardNav({ itemCount, onItemAction, onEscape, loop, orientation, columns, disabled, }: UseListKeyboardNavOptions): UseListKeyboardNavReturn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseListSelectionOptions, UseListSelectionReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing list item selection
|
|
4
|
+
* Supports single and multiple selection modes with controlled/uncontrolled patterns
|
|
5
|
+
*/
|
|
6
|
+
export declare function useListSelection({ selectionMode, selectedKeys: controlledKeys, defaultSelectedKeys, onSelectionChange, allItemKeys, }: UseListSelectionOptions): UseListSelectionReturn;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { List, default } from './List';
|
|
2
|
+
export { ListItem } from './ListItem';
|
|
3
|
+
export { ListHeader } from './ListHeader';
|
|
4
|
+
export { ListGroup } from './ListGroup';
|
|
5
|
+
export { ListSearch } from './ListSearch';
|
|
6
|
+
export { ListSkeleton } from './ListSkeleton';
|
|
7
|
+
export { ListEmpty } from './ListEmpty';
|
|
8
|
+
export { ListContext, useListContext, useListContextStrict } from './ListContext';
|
|
9
|
+
export { useListSelection, useListExpand, useListFilter, useListKeyboardNav, useListGroups, } from './hooks';
|
|
10
|
+
export type { ListProps, ListItemRenderContext, ListContextValue, SelectionMode, SelectionState, BulkAction, ItemAction, ListInfiniteScrollConfig, ListSkeletonConfig, ResponsiveColumns, UseListSelectionOptions, UseListSelectionReturn, UseListExpandOptions, UseListExpandReturn, UseListFilterOptions, UseListFilterReturn, UseListKeyboardNavOptions, UseListKeyboardNavReturn, UseListGroupsOptions, UseListGroupsReturn, ListGroup as ListGroupType, } from './types';
|
|
11
|
+
export { getNestedValue, formatValue, generateItemKey, searchItems, groupItems, sortItems, } from './utils';
|