@true-tech-team/react-components 0.0.3 → 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 +12 -0
- package/index.js +1 -1
- package/index.mjs +10774 -5477
- package/lib/components/buttons/Button/Button.d.ts +14 -3
- 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/Accordion/Accordion.d.ts +112 -0
- package/lib/components/display/Accordion/AccordionContainer.d.ts +101 -0
- package/lib/components/display/Accordion/AccordionContext.d.ts +57 -0
- package/lib/components/display/Accordion/index.d.ts +6 -0
- package/lib/components/display/Avatar/Avatar.d.ts +1 -1
- package/lib/components/display/Card/Card.d.ts +101 -0
- package/lib/components/display/Card/index.d.ts +3 -0
- package/lib/components/display/Carousel/Carousel.d.ts +125 -0
- package/lib/components/display/Carousel/index.d.ts +3 -0
- package/lib/components/display/Collapse/Collapse.d.ts +57 -0
- package/lib/components/display/Collapse/index.d.ts +2 -0
- package/lib/components/display/CountUp/CountUp.d.ts +119 -0
- package/lib/components/display/CountUp/index.d.ts +3 -0
- package/lib/components/display/FlipCard/FlipCard.d.ts +125 -0
- package/lib/components/display/FlipCard/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/Icon/index.d.ts +1 -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/PageMessages/PageMessageContent.d.ts +19 -0
- package/lib/components/display/PageMessages/PageMessages.d.ts +49 -0
- package/lib/components/display/PageMessages/defaultConfigs.d.ts +5 -0
- package/lib/components/display/PageMessages/index.d.ts +3 -0
- package/lib/components/display/PageMessages/types.d.ts +175 -0
- package/lib/components/display/ProgressBar/ProgressBar.d.ts +11 -0
- package/lib/components/display/Reveal/Reveal.d.ts +109 -0
- package/lib/components/display/Reveal/index.d.ts +3 -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/Spinner/Spinner.d.ts +79 -0
- package/lib/components/display/Spinner/index.d.ts +3 -0
- package/lib/components/display/StatusIndicator/StatusIndicator.d.ts +1 -1
- 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 +65 -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/inputs/Toggle/Toggle.d.ts +5 -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/LoadingOverlay/LoadingOverlay.d.ts +101 -0
- package/lib/components/overlays/LoadingOverlay/index.d.ts +3 -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/contexts/PageMessagesContext/PageMessagesContext.d.ts +91 -0
- package/lib/contexts/PageMessagesContext/index.d.ts +2 -0
- package/lib/contexts/index.d.ts +2 -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 +21 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExtendedComponentSize } from '../../../types/component.types';
|
|
2
|
+
import { PageMessageState, PageMessageStateConfig, LoadingStateConfig } from './types';
|
|
3
|
+
import { PageMessagesGlobalActions } from '../../../contexts/PageMessagesContext';
|
|
4
|
+
export interface PageMessageContentProps {
|
|
5
|
+
/** The active page message state */
|
|
6
|
+
state: PageMessageState;
|
|
7
|
+
/** Configuration for the state */
|
|
8
|
+
config: PageMessageStateConfig | LoadingStateConfig;
|
|
9
|
+
/** Size variant */
|
|
10
|
+
size: ExtendedComponentSize;
|
|
11
|
+
/** Error message (extracted from error prop) */
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
/** Global actions from context */
|
|
14
|
+
actions: PageMessagesGlobalActions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Internal component that renders the page message content
|
|
18
|
+
*/
|
|
19
|
+
export declare function PageMessageContent({ state, config, size, errorMessage, actions, }: PageMessageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PageMessagesProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* PageMessages - Handles page-level states like loading, error, forbidden, etc.
|
|
5
|
+
*
|
|
6
|
+
* States are displayed based on priority (loading > error > forbidden > etc.)
|
|
7
|
+
* When no state is active, children are rendered directly without any wrapper.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic usage
|
|
12
|
+
* <PageMessages loading={isLoading} error={error}>
|
|
13
|
+
* <MyContent />
|
|
14
|
+
* </PageMessages>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // With custom configuration
|
|
20
|
+
* <PageMessages
|
|
21
|
+
* empty={items.length === 0}
|
|
22
|
+
* emptyConfig={{
|
|
23
|
+
* title: 'No items yet',
|
|
24
|
+
* description: 'Create your first item to get started',
|
|
25
|
+
* primaryAction: {
|
|
26
|
+
* label: 'Create Item',
|
|
27
|
+
* onClick: handleCreate,
|
|
28
|
+
* },
|
|
29
|
+
* }}
|
|
30
|
+
* >
|
|
31
|
+
* <ItemList items={items} />
|
|
32
|
+
* </PageMessages>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // With custom renderer
|
|
38
|
+
* <PageMessages
|
|
39
|
+
* error={error}
|
|
40
|
+
* errorConfig={{
|
|
41
|
+
* render: () => <CustomErrorPage error={error} />,
|
|
42
|
+
* }}
|
|
43
|
+
* >
|
|
44
|
+
* <Dashboard />
|
|
45
|
+
* </PageMessages>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const PageMessages: React.ForwardRefExoticComponent<PageMessagesProps & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export default PageMessages;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps, ExtendedComponentSize } from '../../../types/component.types';
|
|
3
|
+
import { IconName } from '../Icon/icons';
|
|
4
|
+
import { SpinnerProps } from '../Spinner';
|
|
5
|
+
import { ButtonProps } from '../../buttons/Button';
|
|
6
|
+
/**
|
|
7
|
+
* Available page message state types
|
|
8
|
+
*/
|
|
9
|
+
export type PageMessageState = 'loading' | 'error' | 'forbidden' | 'not-found' | 'empty' | 'maintenance' | 'offline' | 'unauthorized' | 'timeout';
|
|
10
|
+
/**
|
|
11
|
+
* Action button configuration for page messages
|
|
12
|
+
*/
|
|
13
|
+
export interface PageMessageAction {
|
|
14
|
+
/** Button label */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Click handler */
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
/** Button variant */
|
|
19
|
+
variant?: ButtonProps['variant'];
|
|
20
|
+
/** Loading state for the button */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Icon to display */
|
|
23
|
+
icon?: IconName | ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for a single page message state
|
|
27
|
+
*/
|
|
28
|
+
export interface PageMessageStateConfig {
|
|
29
|
+
/** Title text displayed prominently */
|
|
30
|
+
title?: string;
|
|
31
|
+
/** Description or subtitle text */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Icon name from registry or custom ReactNode */
|
|
34
|
+
icon?: IconName | ReactNode;
|
|
35
|
+
/** Primary action button */
|
|
36
|
+
primaryAction?: PageMessageAction;
|
|
37
|
+
/** Secondary action button */
|
|
38
|
+
secondaryAction?: PageMessageAction;
|
|
39
|
+
/** Custom render function for complete control */
|
|
40
|
+
render?: () => ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Props for loading state specifically
|
|
44
|
+
*/
|
|
45
|
+
export interface LoadingStateConfig extends Omit<PageMessageStateConfig, 'icon'> {
|
|
46
|
+
/** Spinner props passthrough */
|
|
47
|
+
spinnerProps?: Partial<SpinnerProps>;
|
|
48
|
+
/** Whether to show text alongside spinner */
|
|
49
|
+
showText?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Props for the PageMessages component
|
|
53
|
+
*/
|
|
54
|
+
export interface PageMessagesProps extends BaseComponentProps {
|
|
55
|
+
/**
|
|
56
|
+
* Whether the page is in loading state
|
|
57
|
+
* Priority: 1 (highest)
|
|
58
|
+
*/
|
|
59
|
+
loading?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the page has an error
|
|
62
|
+
* Priority: 2
|
|
63
|
+
*/
|
|
64
|
+
error?: boolean | Error | string;
|
|
65
|
+
/**
|
|
66
|
+
* Whether access is forbidden (403)
|
|
67
|
+
* Priority: 3
|
|
68
|
+
*/
|
|
69
|
+
forbidden?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the resource is not found (404)
|
|
72
|
+
* Priority: 4
|
|
73
|
+
*/
|
|
74
|
+
notFound?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the user is unauthorized (401)
|
|
77
|
+
* Priority: 5
|
|
78
|
+
*/
|
|
79
|
+
unauthorized?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the page is in maintenance mode
|
|
82
|
+
* Priority: 6
|
|
83
|
+
*/
|
|
84
|
+
maintenance?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the user is offline
|
|
87
|
+
* Priority: 7
|
|
88
|
+
*/
|
|
89
|
+
offline?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Whether there was a timeout
|
|
92
|
+
* Priority: 8
|
|
93
|
+
*/
|
|
94
|
+
timeout?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the data is empty
|
|
97
|
+
* Priority: 9 (lowest)
|
|
98
|
+
*/
|
|
99
|
+
empty?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Custom loading state configuration
|
|
102
|
+
*/
|
|
103
|
+
loadingConfig?: LoadingStateConfig;
|
|
104
|
+
/**
|
|
105
|
+
* Custom error state configuration
|
|
106
|
+
*/
|
|
107
|
+
errorConfig?: PageMessageStateConfig;
|
|
108
|
+
/**
|
|
109
|
+
* Custom forbidden state configuration
|
|
110
|
+
*/
|
|
111
|
+
forbiddenConfig?: PageMessageStateConfig;
|
|
112
|
+
/**
|
|
113
|
+
* Custom not-found state configuration
|
|
114
|
+
*/
|
|
115
|
+
notFoundConfig?: PageMessageStateConfig;
|
|
116
|
+
/**
|
|
117
|
+
* Custom unauthorized state configuration
|
|
118
|
+
*/
|
|
119
|
+
unauthorizedConfig?: PageMessageStateConfig;
|
|
120
|
+
/**
|
|
121
|
+
* Custom maintenance state configuration
|
|
122
|
+
*/
|
|
123
|
+
maintenanceConfig?: PageMessageStateConfig;
|
|
124
|
+
/**
|
|
125
|
+
* Custom offline state configuration
|
|
126
|
+
*/
|
|
127
|
+
offlineConfig?: PageMessageStateConfig;
|
|
128
|
+
/**
|
|
129
|
+
* Custom timeout state configuration
|
|
130
|
+
*/
|
|
131
|
+
timeoutConfig?: PageMessageStateConfig;
|
|
132
|
+
/**
|
|
133
|
+
* Custom empty state configuration
|
|
134
|
+
*/
|
|
135
|
+
emptyConfig?: PageMessageStateConfig;
|
|
136
|
+
/**
|
|
137
|
+
* Size variant affecting icon and text sizes
|
|
138
|
+
* @default 'md'
|
|
139
|
+
*/
|
|
140
|
+
size?: ExtendedComponentSize;
|
|
141
|
+
/**
|
|
142
|
+
* Callback when retry action is triggered (for error/timeout states)
|
|
143
|
+
*/
|
|
144
|
+
onRetry?: () => void;
|
|
145
|
+
/**
|
|
146
|
+
* Callback when go back action is triggered
|
|
147
|
+
*/
|
|
148
|
+
onGoBack?: () => void;
|
|
149
|
+
/**
|
|
150
|
+
* Callback when go home action is triggered
|
|
151
|
+
*/
|
|
152
|
+
onGoHome?: () => void;
|
|
153
|
+
/**
|
|
154
|
+
* Callback when login action is triggered (for unauthorized/forbidden)
|
|
155
|
+
*/
|
|
156
|
+
onLogin?: () => void;
|
|
157
|
+
/**
|
|
158
|
+
* Whether to use fullscreen mode
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
161
|
+
fullScreen?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Whether to center the message vertically
|
|
164
|
+
* @default true
|
|
165
|
+
*/
|
|
166
|
+
centerVertically?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Minimum height when not fullscreen
|
|
169
|
+
*/
|
|
170
|
+
minHeight?: string | number;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Determines which state to display based on priority
|
|
174
|
+
*/
|
|
175
|
+
export declare function getActiveState(props: PageMessagesProps): PageMessageState | null;
|
|
@@ -47,6 +47,17 @@ export interface ProgressBarProps extends Omit<BaseComponentProps, 'children'> {
|
|
|
47
47
|
* Custom format function for the value display
|
|
48
48
|
*/
|
|
49
49
|
formatValue?: (value: number, max: number) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Indeterminate mode - shows infinite loading animation
|
|
52
|
+
* When true, value prop is ignored
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
indeterminate?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Buffer/secondary progress value (0-100)
|
|
58
|
+
* Shows a secondary progress track for buffering states
|
|
59
|
+
*/
|
|
60
|
+
bufferValue?: number;
|
|
50
61
|
}
|
|
51
62
|
/**
|
|
52
63
|
* ProgressBar - Linear progress indicator for showing task completion or loading states
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types/component.types';
|
|
3
|
+
/**
|
|
4
|
+
* Animation types available for reveal
|
|
5
|
+
*/
|
|
6
|
+
export type RevealAnimation = 'fade' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'zoom' | 'zoomIn' | 'zoomOut';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Reveal component
|
|
9
|
+
*/
|
|
10
|
+
export interface RevealProps extends BaseComponentProps {
|
|
11
|
+
/**
|
|
12
|
+
* Animation type
|
|
13
|
+
* @default 'fade'
|
|
14
|
+
*/
|
|
15
|
+
animation?: RevealAnimation;
|
|
16
|
+
/**
|
|
17
|
+
* Animation duration in milliseconds
|
|
18
|
+
* @default 500
|
|
19
|
+
*/
|
|
20
|
+
duration?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Delay before animation starts (ms)
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
delay?: number;
|
|
26
|
+
/**
|
|
27
|
+
* CSS easing function
|
|
28
|
+
* @default 'ease-out'
|
|
29
|
+
*/
|
|
30
|
+
easing?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Visibility threshold (0-1) for Intersection Observer
|
|
33
|
+
* @default 0.1
|
|
34
|
+
*/
|
|
35
|
+
threshold?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to animate only once
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
triggerOnce?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Distance for slide animations
|
|
43
|
+
* @default '20px'
|
|
44
|
+
*/
|
|
45
|
+
distance?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to stagger children animations
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
cascade?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Delay between staggered children (ms)
|
|
53
|
+
* @default 100
|
|
54
|
+
*/
|
|
55
|
+
cascadeDelay?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Callback when element is revealed
|
|
58
|
+
*/
|
|
59
|
+
onReveal?: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the component is initially visible (skips animation)
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
initiallyVisible?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Root margin for Intersection Observer
|
|
67
|
+
* @default '0px'
|
|
68
|
+
*/
|
|
69
|
+
rootMargin?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Play animation immediately on mount without requiring scroll
|
|
72
|
+
* Useful for hero sections or elements visible on initial page load
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
playOnMount?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Reveal - Intersection Observer-based reveal animation component
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <Reveal animation="slideUp">
|
|
83
|
+
* <div>Content that animates in when scrolled into view</div>
|
|
84
|
+
* </Reveal>
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* <Reveal animation="fade" cascade cascadeDelay={100}>
|
|
90
|
+
* <div>First item</div>
|
|
91
|
+
* <div>Second item</div>
|
|
92
|
+
* <div>Third item</div>
|
|
93
|
+
* </Reveal>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <Reveal
|
|
99
|
+
* animation="zoom"
|
|
100
|
+
* duration={800}
|
|
101
|
+
* delay={200}
|
|
102
|
+
* onReveal={() => console.log('Revealed!')}
|
|
103
|
+
* >
|
|
104
|
+
* <Card>Animated card</Card>
|
|
105
|
+
* </Reveal>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare const Reveal: React.ForwardRefExoticComponent<RevealProps & React.RefAttributes<HTMLDivElement>>;
|
|
109
|
+
export default Reveal;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface ScrollAreaRef {
|
|
4
|
+
/**
|
|
5
|
+
* Scroll to specific position
|
|
6
|
+
*/
|
|
7
|
+
scrollTo: (options: ScrollToOptions) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Scroll to top
|
|
10
|
+
*/
|
|
11
|
+
scrollToTop: (behavior?: ScrollBehavior) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Scroll to bottom
|
|
14
|
+
*/
|
|
15
|
+
scrollToBottom: (behavior?: ScrollBehavior) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Scroll to left
|
|
18
|
+
*/
|
|
19
|
+
scrollToLeft: (behavior?: ScrollBehavior) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Scroll to right
|
|
22
|
+
*/
|
|
23
|
+
scrollToRight: (behavior?: ScrollBehavior) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Get current scroll position
|
|
26
|
+
*/
|
|
27
|
+
getScrollPosition: () => {
|
|
28
|
+
scrollTop: number;
|
|
29
|
+
scrollLeft: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Get the viewport element
|
|
33
|
+
*/
|
|
34
|
+
getElement: () => HTMLDivElement | null;
|
|
35
|
+
}
|
|
36
|
+
export interface ScrollAreaProps extends BaseComponentProps {
|
|
37
|
+
/**
|
|
38
|
+
* Scroll direction
|
|
39
|
+
* @default 'vertical'
|
|
40
|
+
*/
|
|
41
|
+
direction?: 'vertical' | 'horizontal' | 'both';
|
|
42
|
+
/**
|
|
43
|
+
* Maximum height (enables vertical scroll)
|
|
44
|
+
*/
|
|
45
|
+
maxHeight?: string | number;
|
|
46
|
+
/**
|
|
47
|
+
* Maximum width (enables horizontal scroll)
|
|
48
|
+
*/
|
|
49
|
+
maxWidth?: string | number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to show shadow indicators at scroll edges
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
showShadows?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Callback when scroll position changes
|
|
57
|
+
*/
|
|
58
|
+
onScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Callback when scrolled to top
|
|
61
|
+
*/
|
|
62
|
+
onScrollToTop?: () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Callback when scrolled to bottom
|
|
65
|
+
*/
|
|
66
|
+
onScrollToBottom?: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Callback when scrolled to left edge
|
|
69
|
+
*/
|
|
70
|
+
onScrollToLeft?: () => void;
|
|
71
|
+
/**
|
|
72
|
+
* Callback when scrolled to right edge
|
|
73
|
+
*/
|
|
74
|
+
onScrollToRight?: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Threshold in pixels for scroll end callbacks
|
|
77
|
+
* @default 10
|
|
78
|
+
*/
|
|
79
|
+
scrollEndThreshold?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Content to render inside scrollable area
|
|
82
|
+
*/
|
|
83
|
+
children: React.ReactNode;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* ScrollArea component - a custom scrollbar container
|
|
87
|
+
*
|
|
88
|
+
* Provides styled scrollbars with various visibility modes and
|
|
89
|
+
* programmatic scroll control.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* Basic vertical scroll:
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <ScrollArea maxHeight={300}>
|
|
95
|
+
* <p>Long content here...</p>
|
|
96
|
+
* </ScrollArea>
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* With scroll callbacks:
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <ScrollArea
|
|
103
|
+
* maxHeight={400}
|
|
104
|
+
* onScrollToBottom={() => loadMore()}
|
|
105
|
+
* showShadows
|
|
106
|
+
* >
|
|
107
|
+
* {items.map(item => <Item key={item.id} {...item} />)}
|
|
108
|
+
* </ScrollArea>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<ScrollAreaRef>>;
|
|
112
|
+
export default ScrollArea;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps, ExtendedComponentSize } from '../../../types/component.types';
|
|
3
|
+
/**
|
|
4
|
+
* Visual style of the spinner animation
|
|
5
|
+
*/
|
|
6
|
+
export type SpinnerStyle = 'circular' | 'dots' | 'bars' | 'pulse';
|
|
7
|
+
/**
|
|
8
|
+
* Color variant of the spinner
|
|
9
|
+
*/
|
|
10
|
+
export type SpinnerVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral' | 'currentColor';
|
|
11
|
+
/**
|
|
12
|
+
* Animation speed of the spinner
|
|
13
|
+
*/
|
|
14
|
+
export type SpinnerSpeed = 'slow' | 'normal' | 'fast';
|
|
15
|
+
/**
|
|
16
|
+
* Props for the Spinner component
|
|
17
|
+
*/
|
|
18
|
+
export interface SpinnerProps extends Omit<BaseComponentProps, 'children'> {
|
|
19
|
+
/**
|
|
20
|
+
* Visual style of the spinner animation
|
|
21
|
+
* @default 'circular'
|
|
22
|
+
*/
|
|
23
|
+
spinnerStyle?: SpinnerStyle;
|
|
24
|
+
/**
|
|
25
|
+
* Size of the spinner
|
|
26
|
+
* @default 'md'
|
|
27
|
+
*/
|
|
28
|
+
size?: ExtendedComponentSize;
|
|
29
|
+
/**
|
|
30
|
+
* Color variant of the spinner
|
|
31
|
+
* @default 'primary'
|
|
32
|
+
*/
|
|
33
|
+
variant?: SpinnerVariant;
|
|
34
|
+
/**
|
|
35
|
+
* Animation speed
|
|
36
|
+
* @default 'normal'
|
|
37
|
+
*/
|
|
38
|
+
speed?: SpinnerSpeed;
|
|
39
|
+
/**
|
|
40
|
+
* Stroke width for circular spinner style
|
|
41
|
+
* @default 3
|
|
42
|
+
*/
|
|
43
|
+
strokeWidth?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Screen reader text
|
|
46
|
+
* @default 'Loading...'
|
|
47
|
+
*/
|
|
48
|
+
srText?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show the screen reader text visually
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
showSrText?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Spinner - Animated loading indicator with multiple configurable styles
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Spinner />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Spinner spinnerStyle="dots" size="lg" variant="primary" />
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <Spinner spinnerStyle="bars" speed="fast" variant="success" />
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <Spinner spinnerStyle="pulse" size="xl" />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
+
export default Spinner;
|
|
@@ -8,7 +8,7 @@ export interface StatusIndicatorProps extends BaseComponentProps {
|
|
|
8
8
|
* Status variant of the indicator
|
|
9
9
|
* @default 'neutral'
|
|
10
10
|
*/
|
|
11
|
-
status?: 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'processing';
|
|
11
|
+
status?: 'online' | 'offline' | 'away' | 'busy' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'processing';
|
|
12
12
|
/**
|
|
13
13
|
* Size of the indicator
|
|
14
14
|
* @default 'md'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
import { IconName } from '../Icon/icons';
|
|
4
|
+
export interface TabProps extends Omit<BaseComponentProps, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* Value identifier for this tab (required)
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Icon to display before tab label
|
|
11
|
+
*/
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
/**
|
|
14
|
+
* Whether this tab is disabled
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Tab label content
|
|
20
|
+
*/
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tab component - individual tab header button
|
|
25
|
+
*
|
|
26
|
+
* Must be used within TabList, which must be within Tabs.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Tabs defaultValue="tab1">
|
|
31
|
+
* <TabList>
|
|
32
|
+
* <Tab value="tab1">Tab 1</Tab>
|
|
33
|
+
* <Tab value="tab2" icon="settings">Settings</Tab>
|
|
34
|
+
* </TabList>
|
|
35
|
+
* <TabPanel value="tab1">Content 1</TabPanel>
|
|
36
|
+
* <TabPanel value="tab2">Content 2</TabPanel>
|
|
37
|
+
* </Tabs>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
export default Tab;
|
|
@@ -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;
|