@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,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface TabListProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tab children
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* TabList component - container for Tab items
|
|
11
|
+
*
|
|
12
|
+
* Must be used within Tabs.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Tabs defaultValue="tab1">
|
|
17
|
+
* <TabList>
|
|
18
|
+
* <Tab value="tab1">Tab 1</Tab>
|
|
19
|
+
* <Tab value="tab2">Tab 2</Tab>
|
|
20
|
+
* </TabList>
|
|
21
|
+
* <TabPanel value="tab1">Content 1</TabPanel>
|
|
22
|
+
* <TabPanel value="tab2">Content 2</TabPanel>
|
|
23
|
+
* </Tabs>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export default TabList;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface TabPanelProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Value identifier matching the corresponding Tab
|
|
6
|
+
*/
|
|
7
|
+
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* Panel content
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TabPanel component - content panel for a tab
|
|
15
|
+
*
|
|
16
|
+
* Must be used within Tabs and paired with a Tab of the same value.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Tabs defaultValue="tab1">
|
|
21
|
+
* <TabList>
|
|
22
|
+
* <Tab value="tab1">Tab 1</Tab>
|
|
23
|
+
* <Tab value="tab2">Tab 2</Tab>
|
|
24
|
+
* </TabList>
|
|
25
|
+
* <TabPanel value="tab1">Content for tab 1</TabPanel>
|
|
26
|
+
* <TabPanel value="tab2">Content for tab 2</TabPanel>
|
|
27
|
+
* </Tabs>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const TabPanel: React.ForwardRefExoticComponent<TabPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export default TabPanel;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
import { TabsVariant } from './TabsContext';
|
|
4
|
+
export interface TabsProps extends Omit<BaseComponentProps, 'onChange'> {
|
|
5
|
+
/**
|
|
6
|
+
* Currently selected tab value (controlled)
|
|
7
|
+
*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Default selected tab value (uncontrolled)
|
|
11
|
+
*/
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback when tab selection changes
|
|
15
|
+
* @param value - The newly selected tab value
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (value: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Visual variant of the tabs
|
|
20
|
+
* @default 'line'
|
|
21
|
+
*/
|
|
22
|
+
variant?: TabsVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Size of the tabs
|
|
25
|
+
* @default 'md'
|
|
26
|
+
*/
|
|
27
|
+
size?: ComponentSize;
|
|
28
|
+
/**
|
|
29
|
+
* Orientation of the tab list
|
|
30
|
+
* @default 'horizontal'
|
|
31
|
+
*/
|
|
32
|
+
orientation?: 'horizontal' | 'vertical';
|
|
33
|
+
/**
|
|
34
|
+
* Whether tabs are disabled
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether tab panels should be lazy loaded (only render when active)
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
lazyMount?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to keep inactive panels mounted (with lazyMount)
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
keepMounted?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether tabs should fit container width (distribute equally)
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
fitted?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Tab components (TabList and TabPanels)
|
|
55
|
+
*/
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Tabs component - tab navigation with headers and content panels
|
|
60
|
+
*
|
|
61
|
+
* A container component that manages tab selection and provides context
|
|
62
|
+
* to TabList, Tab, and TabPanel children.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* // Basic usage
|
|
67
|
+
* <Tabs defaultValue="tab1">
|
|
68
|
+
* <TabList>
|
|
69
|
+
* <Tab value="tab1">Overview</Tab>
|
|
70
|
+
* <Tab value="tab2">Details</Tab>
|
|
71
|
+
* <Tab value="tab3">Settings</Tab>
|
|
72
|
+
* </TabList>
|
|
73
|
+
* <TabPanel value="tab1">Overview content</TabPanel>
|
|
74
|
+
* <TabPanel value="tab2">Details content</TabPanel>
|
|
75
|
+
* <TabPanel value="tab3">Settings content</TabPanel>
|
|
76
|
+
* </Tabs>
|
|
77
|
+
*
|
|
78
|
+
* // Controlled with icons
|
|
79
|
+
* <Tabs value={activeTab} onChange={setActiveTab} variant="enclosed">
|
|
80
|
+
* <TabList>
|
|
81
|
+
* <Tab value="home" icon="home">Home</Tab>
|
|
82
|
+
* <Tab value="settings" icon="settings">Settings</Tab>
|
|
83
|
+
* </TabList>
|
|
84
|
+
* <TabPanel value="home">Home content</TabPanel>
|
|
85
|
+
* <TabPanel value="settings">Settings content</TabPanel>
|
|
86
|
+
* </Tabs>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
export default Tabs;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ComponentSize } from '../../../types';
|
|
2
|
+
export type TabsVariant = 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded';
|
|
3
|
+
export interface TabsContextValue {
|
|
4
|
+
/**
|
|
5
|
+
* Unique ID for this tabs instance (used to generate deterministic IDs)
|
|
6
|
+
*/
|
|
7
|
+
tabsId: string;
|
|
8
|
+
/**
|
|
9
|
+
* Currently selected tab value
|
|
10
|
+
*/
|
|
11
|
+
selectedValue: string;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when tab selection changes
|
|
14
|
+
*/
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Orientation of the tabs
|
|
18
|
+
*/
|
|
19
|
+
orientation: 'horizontal' | 'vertical';
|
|
20
|
+
/**
|
|
21
|
+
* Visual variant of the tabs
|
|
22
|
+
*/
|
|
23
|
+
variant: TabsVariant;
|
|
24
|
+
/**
|
|
25
|
+
* Size of the tabs
|
|
26
|
+
*/
|
|
27
|
+
size: ComponentSize;
|
|
28
|
+
/**
|
|
29
|
+
* Whether all tabs are disabled
|
|
30
|
+
*/
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether tabs should fill container width
|
|
34
|
+
*/
|
|
35
|
+
fitted: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether panels should be lazy mounted
|
|
38
|
+
*/
|
|
39
|
+
lazyMount: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to keep inactive panels mounted
|
|
42
|
+
*/
|
|
43
|
+
keepMounted: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Set of panel values that have been activated at least once
|
|
46
|
+
*/
|
|
47
|
+
activatedPanels: Set<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Mark a panel as having been activated
|
|
50
|
+
*/
|
|
51
|
+
markPanelActivated: (value: string) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare const TabsContext: import('react').Context<TabsContextValue | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Hook to optionally access Tabs context
|
|
56
|
+
* Returns null if not within a Tabs component
|
|
57
|
+
*/
|
|
58
|
+
export declare const useTabsContext: () => TabsContextValue | null;
|
|
59
|
+
/**
|
|
60
|
+
* Hook to access Tabs context
|
|
61
|
+
* @throws Error if used outside of Tabs
|
|
62
|
+
*/
|
|
63
|
+
export declare const useTabsContextStrict: () => TabsContextValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Tabs } from './Tabs';
|
|
2
|
+
export type { TabsProps } from './Tabs';
|
|
3
|
+
export { TabList } from './TabList';
|
|
4
|
+
export type { TabListProps } from './TabList';
|
|
5
|
+
export { Tab } from './Tab';
|
|
6
|
+
export type { TabProps } from './Tab';
|
|
7
|
+
export { TabPanel } from './TabPanel';
|
|
8
|
+
export type { TabPanelProps } from './TabPanel';
|
|
9
|
+
export { TabsContext, useTabsContext, useTabsContextStrict, } from './TabsContext';
|
|
10
|
+
export type { TabsContextValue, TabsVariant } from './TabsContext';
|
|
11
|
+
export { default } from './Tabs';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PopoverPosition } from '../../../utils/positioning';
|
|
3
|
+
import { BaseComponentProps } from '../../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the TruncatedList component
|
|
6
|
+
*/
|
|
7
|
+
export interface TruncatedListProps<T> extends Omit<BaseComponentProps, 'children'> {
|
|
8
|
+
/**
|
|
9
|
+
* Items to display
|
|
10
|
+
*/
|
|
11
|
+
items: T[];
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of visible items before truncation
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
maxVisible?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Render function for each visible item
|
|
19
|
+
*/
|
|
20
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Render function for the "+N more" indicator
|
|
23
|
+
* If not provided, uses default indicator
|
|
24
|
+
*/
|
|
25
|
+
renderMore?: (count: number, hiddenItems: T[]) => React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Gap between items (px)
|
|
28
|
+
* @default 8
|
|
29
|
+
*/
|
|
30
|
+
gap?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Direction of the list
|
|
33
|
+
* @default 'horizontal'
|
|
34
|
+
*/
|
|
35
|
+
direction?: 'horizontal' | 'vertical';
|
|
36
|
+
/**
|
|
37
|
+
* Show hidden items in a tooltip on hover
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
showTooltip?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Custom tooltip content for hidden items
|
|
43
|
+
* If not provided, uses renderItem for each hidden item
|
|
44
|
+
*/
|
|
45
|
+
tooltipContent?: (hiddenItems: T[]) => React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Tooltip position
|
|
48
|
+
* @default 'top'
|
|
49
|
+
*/
|
|
50
|
+
tooltipPosition?: PopoverPosition;
|
|
51
|
+
/**
|
|
52
|
+
* Maximum width of the tooltip
|
|
53
|
+
* @default 300
|
|
54
|
+
*/
|
|
55
|
+
tooltipMaxWidth?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Callback when the "more" indicator is clicked
|
|
58
|
+
*/
|
|
59
|
+
onMoreClick?: (hiddenItems: T[]) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Custom key extractor for items
|
|
62
|
+
* @default (item, index) => index
|
|
63
|
+
*/
|
|
64
|
+
keyExtractor?: (item: T, index: number) => string | number;
|
|
65
|
+
}
|
|
66
|
+
export declare const TruncatedList: <T>(props: TruncatedListProps<T> & {
|
|
67
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
68
|
+
}) => React.ReactElement;
|
|
69
|
+
export default TruncatedList;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { Button } from './buttons/Button';
|
|
2
2
|
export type { ButtonProps } from './buttons/Button';
|
|
3
|
+
export { ToggleButton } from './buttons/ToggleButton';
|
|
4
|
+
export type { ToggleButtonProps } from './buttons/ToggleButton';
|
|
5
|
+
export { ButtonToggleGroup, ButtonToggleGroupItem, ButtonToggleGroupContext, useButtonToggleGroup, } from './buttons/ButtonToggleGroup';
|
|
6
|
+
export type { ButtonToggleGroupProps, ButtonToggleGroupItemProps, ButtonToggleGroupContextValue, } from './buttons/ButtonToggleGroup';
|
|
3
7
|
export { Icon } from './display/Icon';
|
|
4
8
|
export type { IconProps } from './display/Icon';
|
|
5
9
|
export { Badge } from './display/Badge';
|
|
@@ -22,6 +26,10 @@ export { KPI } from './display/KPI';
|
|
|
22
26
|
export type { KPIProps } from './display/KPI';
|
|
23
27
|
export { Skeleton } from './display/Skeleton';
|
|
24
28
|
export type { SkeletonProps } from './display/Skeleton';
|
|
29
|
+
export { OverflowText } from './display/OverflowText';
|
|
30
|
+
export type { OverflowTextProps } from './display/OverflowText';
|
|
31
|
+
export { TruncatedList } from './display/TruncatedList';
|
|
32
|
+
export type { TruncatedListProps } from './display/TruncatedList';
|
|
25
33
|
export { Spinner } from './display/Spinner';
|
|
26
34
|
export type { SpinnerProps, SpinnerStyle, SpinnerVariant, SpinnerSpeed } from './display/Spinner';
|
|
27
35
|
export { Collapse } from './display/Collapse';
|
|
@@ -38,6 +46,10 @@ export { Reveal } from './display/Reveal';
|
|
|
38
46
|
export type { RevealProps, RevealAnimation } from './display/Reveal';
|
|
39
47
|
export { Carousel } from './display/Carousel';
|
|
40
48
|
export type { CarouselProps } from './display/Carousel';
|
|
49
|
+
export { Tabs, TabList, Tab, TabPanel, TabsContext, useTabsContext, useTabsContextStrict, } from './display/Tabs';
|
|
50
|
+
export type { TabsProps, TabListProps, TabProps, TabPanelProps, TabsContextValue, TabsVariant, } from './display/Tabs';
|
|
51
|
+
export { ScrollArea } from './display/ScrollArea';
|
|
52
|
+
export type { ScrollAreaProps, ScrollAreaRef } from './display/ScrollArea';
|
|
41
53
|
export { PageMessages } from './display/PageMessages';
|
|
42
54
|
export type { PageMessagesProps, PageMessageState, PageMessageStateConfig, PageMessageAction, LoadingStateConfig, } from './display/PageMessages';
|
|
43
55
|
export { getActiveState } from './display/PageMessages';
|
|
@@ -53,6 +65,12 @@ export { Dropdown } from './overlays/Dropdown';
|
|
|
53
65
|
export type { DropdownProps } from './overlays/Dropdown';
|
|
54
66
|
export { LoadingOverlay } from './overlays/LoadingOverlay';
|
|
55
67
|
export type { LoadingOverlayProps, LoadingOverlayMode } from './overlays/LoadingOverlay';
|
|
68
|
+
export { Dialog, DialogHeader, DialogBody, DialogFooter, DialogProvider, DialogContext, useDialogContext, useDialogContextStrict, } from './overlays/Dialog';
|
|
69
|
+
export type { DialogProps, DialogSize, DialogHeaderProps, DialogBodyProps, DialogFooterProps, DialogProviderProps, DialogContextValue, DialogStackItem, } from './overlays/Dialog';
|
|
70
|
+
export { Alert, AlertProvider, AlertContext, useAlertContext, useAlertContextStrict, ALERT_PRESETS, getAlertPreset, } from './overlays/Alert';
|
|
71
|
+
export type { AlertProps, AlertVariant, AlertPreset, AlertProviderProps, AlertContextValue, AlertQueueItem, } from './overlays/Alert';
|
|
72
|
+
export { Toast, ToastContainer, ToastProvider, ToastContext, useToastContext, useToastContextStrict, } from './overlays/Toast';
|
|
73
|
+
export type { ToastProps, ToastData, ToastVariant, ToastPosition, ToastAnimationState, ToastContainerProps, ToastProviderProps, ToastContextValue, ToastInstance, PromiseToastOptions, } from './overlays/Toast';
|
|
56
74
|
export { Input } from './inputs/Input';
|
|
57
75
|
export type { InputProps, ValidationResult, FormatMask, ValidationTiming, InputType, } from './inputs/Input';
|
|
58
76
|
export { Autocomplete } from './inputs/Autocomplete';
|
|
@@ -63,6 +81,8 @@ export { Checkbox } from './inputs/Checkbox';
|
|
|
63
81
|
export type { CheckboxProps } from './inputs/Checkbox';
|
|
64
82
|
export { Radio, RadioGroup, useRadioGroup, RadioGroupContext } from './inputs/Radio';
|
|
65
83
|
export type { RadioProps, RadioGroupProps, RadioGroupContextValue } from './inputs/Radio';
|
|
84
|
+
export { CheckboxGroup, CheckboxGroupItem, CheckboxGroupContext, useCheckboxGroup, useCheckboxGroupStrict, } from './inputs/CheckboxGroup';
|
|
85
|
+
export type { CheckboxGroupProps, CheckboxGroupItemProps, CheckboxGroupContextValue, } from './inputs/CheckboxGroup';
|
|
66
86
|
export { Textarea } from './inputs/Textarea';
|
|
67
87
|
export type { TextareaProps } from './inputs/Textarea';
|
|
68
88
|
export { Select } from './inputs/Select';
|
|
@@ -85,6 +105,30 @@ export { DatePicker } from './inputs/DatePicker';
|
|
|
85
105
|
export type { DatePickerProps } from './inputs/DatePicker';
|
|
86
106
|
export { DateRangePicker } from './inputs/DateRangePicker';
|
|
87
107
|
export type { DateRangePickerProps, DateRangePreset } from './inputs/DateRangePicker';
|
|
108
|
+
export { Panes, Pane, usePanesContext } from './layout/Panes';
|
|
109
|
+
export type { PanesProps, PaneProps, PanesContextValue, PaneConfig } from './layout/Panes';
|
|
110
|
+
export { ResponsiveStack } from './layout/ResponsiveStack';
|
|
111
|
+
export type { ResponsiveStackProps } from './layout/ResponsiveStack';
|
|
112
|
+
export { AdaptiveGrid } from './layout/AdaptiveGrid';
|
|
113
|
+
export type { AdaptiveGridProps } from './layout/AdaptiveGrid';
|
|
114
|
+
export { MasonryLayout } from './layout/MasonryLayout';
|
|
115
|
+
export type { MasonryLayoutProps } from './layout/MasonryLayout';
|
|
116
|
+
export { CollapsibleSidebar } from './navigation/CollapsibleSidebar';
|
|
117
|
+
export type { CollapsibleSidebarProps } from './navigation/CollapsibleSidebar';
|
|
118
|
+
export { NavLink } from './navigation/NavLink';
|
|
119
|
+
export type { NavLinkProps, NavLinkVariant } from './navigation/NavLink';
|
|
120
|
+
export { Navbar, NavbarBrand, NavbarNav, NavbarActions, NavbarToggle, NavbarCollapse, NavbarContext, useNavbarContext, useNavbarContextStrict, } from './navigation/Navbar';
|
|
121
|
+
export type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarActionsProps, NavbarToggleProps, NavbarCollapseProps, NavbarContextValue, NavbarVariant, NavbarPosition, } from './navigation/Navbar';
|
|
122
|
+
export { SideNav, SideNavItem, SideNavGroup, SideNavDivider, SideNavContext, useSideNavContext, useSideNavContextStrict, } from './navigation/SideNav';
|
|
123
|
+
export type { SideNavProps, SideNavItemProps, SideNavGroupProps, SideNavDividerProps, SideNavContextValue, } from './navigation/SideNav';
|
|
124
|
+
export { Breadcrumbs, BreadcrumbItem, BreadcrumbSeparator, useBreadcrumbsFromPath, } from './navigation/Breadcrumbs';
|
|
125
|
+
export type { BreadcrumbsProps, BreadcrumbItemProps, BreadcrumbItemConfig, BreadcrumbSeparatorProps, UseBreadcrumbsFromPathOptions, } from './navigation/Breadcrumbs';
|
|
126
|
+
export { Pagination } from './navigation/Pagination';
|
|
127
|
+
export type { PaginationProps, PaginationVariant, PaginationShape } from './navigation/Pagination';
|
|
128
|
+
export { Stepper, Step, StepperContext, useStepperContext, useStepperContextStrict, } from './navigation/Stepper';
|
|
129
|
+
export type { StepperProps, StepProps, StepperContextValue, StepperVariant, StepperOrientation, } from './navigation/Stepper';
|
|
130
|
+
export { BottomNavigation, BottomNavigationItem, BottomNavigationContext, useBottomNavigationContext, useBottomNavigationContextStrict, } from './navigation/BottomNavigation';
|
|
131
|
+
export type { BottomNavigationProps, BottomNavigationItemProps, BottomNavigationContextValue, } from './navigation/BottomNavigation';
|
|
88
132
|
export { FormBuilder, useFormContext } from './forms/FormBuilder';
|
|
89
133
|
export type { FormBuilderProps } from './forms/FormBuilder';
|
|
90
134
|
export { useFormState, useFormValidation } from './forms/FormBuilder';
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize, ComponentVariant } from '../../../types';
|
|
3
|
+
export interface CheckboxGroupProps extends Omit<BaseComponentProps, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* Array of selected values (controlled)
|
|
6
|
+
*/
|
|
7
|
+
value?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Default selected values (uncontrolled)
|
|
10
|
+
* @default []
|
|
11
|
+
*/
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Callback when selection changes
|
|
15
|
+
* @param values - Array of currently selected values
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (values: string[]) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Variant style for all checkboxes
|
|
20
|
+
* @default 'primary'
|
|
21
|
+
*/
|
|
22
|
+
variant?: ComponentVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Size for all checkboxes
|
|
25
|
+
* @default 'md'
|
|
26
|
+
*/
|
|
27
|
+
size?: ComponentSize;
|
|
28
|
+
/**
|
|
29
|
+
* Layout orientation
|
|
30
|
+
* @default 'vertical'
|
|
31
|
+
*/
|
|
32
|
+
orientation?: 'horizontal' | 'vertical';
|
|
33
|
+
/**
|
|
34
|
+
* Group label
|
|
35
|
+
*/
|
|
36
|
+
label?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Helper text below the group
|
|
39
|
+
*/
|
|
40
|
+
helperText?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Error message when in error state
|
|
43
|
+
*/
|
|
44
|
+
errorMessage?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the group is in error state
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
error?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether all checkboxes are disabled
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether all checkboxes are read-only
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
readOnly?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether at least one selection is required
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
required?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Minimum number of selections required
|
|
67
|
+
*/
|
|
68
|
+
min?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of selections allowed
|
|
71
|
+
*/
|
|
72
|
+
max?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Gap between checkboxes (in spacing units)
|
|
75
|
+
* @default 2
|
|
76
|
+
*/
|
|
77
|
+
gap?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Name attribute for form submission
|
|
80
|
+
*/
|
|
81
|
+
name?: string;
|
|
82
|
+
/**
|
|
83
|
+
* ID for the fieldset element
|
|
84
|
+
*/
|
|
85
|
+
id?: string;
|
|
86
|
+
/**
|
|
87
|
+
* CheckboxGroupItem children
|
|
88
|
+
*/
|
|
89
|
+
children: React.ReactNode;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* CheckboxGroup component - container for multiple checkboxes with multi-select
|
|
93
|
+
*
|
|
94
|
+
* A group component that manages multiple checkbox selections with support
|
|
95
|
+
* for min/max constraints, validation, and accessibility.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* // Basic usage
|
|
100
|
+
* <CheckboxGroup value={selected} onChange={setSelected} label="Select options">
|
|
101
|
+
* <CheckboxGroupItem value="option1" label="Option 1" />
|
|
102
|
+
* <CheckboxGroupItem value="option2" label="Option 2" />
|
|
103
|
+
* <CheckboxGroupItem value="option3" label="Option 3" />
|
|
104
|
+
* </CheckboxGroup>
|
|
105
|
+
*
|
|
106
|
+
* // With constraints
|
|
107
|
+
* <CheckboxGroup
|
|
108
|
+
* value={selected}
|
|
109
|
+
* onChange={setSelected}
|
|
110
|
+
* label="Select 1-3 options"
|
|
111
|
+
* min={1}
|
|
112
|
+
* max={3}
|
|
113
|
+
* >
|
|
114
|
+
* <CheckboxGroupItem value="a" label="Option A" />
|
|
115
|
+
* <CheckboxGroupItem value="b" label="Option B" />
|
|
116
|
+
* <CheckboxGroupItem value="c" label="Option C" />
|
|
117
|
+
* <CheckboxGroupItem value="d" label="Option D" />
|
|
118
|
+
* </CheckboxGroup>
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
122
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentSize, ComponentVariant } from '../../../types';
|
|
2
|
+
export interface CheckboxGroupContextValue {
|
|
3
|
+
/**
|
|
4
|
+
* Group name for form submission
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* Array of currently selected values
|
|
9
|
+
*/
|
|
10
|
+
values: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Callback when selection changes
|
|
13
|
+
*/
|
|
14
|
+
onChange: (value: string, checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the group is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the group is read-only
|
|
21
|
+
*/
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Size for all checkboxes
|
|
25
|
+
*/
|
|
26
|
+
size?: ComponentSize;
|
|
27
|
+
/**
|
|
28
|
+
* Variant style for all checkboxes
|
|
29
|
+
*/
|
|
30
|
+
variant?: ComponentVariant;
|
|
31
|
+
}
|
|
32
|
+
export declare const CheckboxGroupContext: import('react').Context<CheckboxGroupContextValue | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Hook to optionally access CheckboxGroup context
|
|
35
|
+
* Returns null if not within a CheckboxGroup (allows standalone Checkbox usage)
|
|
36
|
+
*/
|
|
37
|
+
export declare const useCheckboxGroup: () => CheckboxGroupContextValue | null;
|
|
38
|
+
/**
|
|
39
|
+
* Hook to access CheckboxGroup context
|
|
40
|
+
* @throws Error if used outside of CheckboxGroup
|
|
41
|
+
*/
|
|
42
|
+
export declare const useCheckboxGroupStrict: () => CheckboxGroupContextValue;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon/icons';
|
|
4
|
+
export interface CheckboxGroupItemProps extends Omit<BaseComponentProps, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* Value for this checkbox (required in group)
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Label text to display next to checkbox
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Label placement relative to checkbox
|
|
15
|
+
* @default 'end'
|
|
16
|
+
*/
|
|
17
|
+
labelPlacement?: 'start' | 'end';
|
|
18
|
+
/**
|
|
19
|
+
* Whether this specific checkbox is disabled
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Helper text to display below the checkbox
|
|
25
|
+
*/
|
|
26
|
+
helperText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Custom check icon
|
|
29
|
+
*/
|
|
30
|
+
checkIcon?: React.ReactNode | IconName;
|
|
31
|
+
/**
|
|
32
|
+
* ID for the input element
|
|
33
|
+
*/
|
|
34
|
+
id?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* CheckboxGroupItem component - individual checkbox within a CheckboxGroup
|
|
38
|
+
*
|
|
39
|
+
* Must be used as a child of CheckboxGroup.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <CheckboxGroup value={selected} onChange={setSelected}>
|
|
44
|
+
* <CheckboxGroupItem value="option1" label="Option 1" />
|
|
45
|
+
* <CheckboxGroupItem value="option2" label="Option 2" />
|
|
46
|
+
* </CheckboxGroup>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const CheckboxGroupItem: React.ForwardRefExoticComponent<CheckboxGroupItemProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
|
+
export default CheckboxGroupItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CheckboxGroup } from './CheckboxGroup';
|
|
2
|
+
export type { CheckboxGroupProps } from './CheckboxGroup';
|
|
3
|
+
export { CheckboxGroupItem } from './CheckboxGroupItem';
|
|
4
|
+
export type { CheckboxGroupItemProps } from './CheckboxGroupItem';
|
|
5
|
+
export { CheckboxGroupContext, useCheckboxGroup, useCheckboxGroupStrict, } from './CheckboxGroupContext';
|
|
6
|
+
export type { CheckboxGroupContextValue } from './CheckboxGroupContext';
|
|
7
|
+
export { default } from './CheckboxGroup';
|