@true-tech-team/react-components 0.0.3 → 0.0.4
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 +2 -0
- package/index.js +1 -1
- package/index.mjs +5047 -3543
- package/lib/components/buttons/Button/Button.d.ts +14 -3
- 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/index.d.ts +1 -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/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/index.d.ts +21 -0
- package/lib/components/inputs/Toggle/Toggle.d.ts +5 -0
- package/lib/components/overlays/LoadingOverlay/LoadingOverlay.d.ts +101 -0
- package/lib/components/overlays/LoadingOverlay/index.d.ts +3 -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/providers/GlobalProvider/GlobalProvider.d.ts +6 -1
- package/package.json +1 -1
|
@@ -41,9 +41,20 @@ export interface ButtonProps extends BaseComponentProps {
|
|
|
41
41
|
* Can be an icon name or a React component
|
|
42
42
|
*/
|
|
43
43
|
endIcon?: React.ReactNode | IconName;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the button is in loading state
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Text to display while loading (replaces children)
|
|
51
|
+
*/
|
|
52
|
+
loadingText?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Position of the loading spinner
|
|
55
|
+
* @default 'start'
|
|
56
|
+
*/
|
|
57
|
+
loadingPosition?: 'start' | 'end' | 'center';
|
|
44
58
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Button component with multiple variants and sizes
|
|
47
|
-
*/
|
|
48
59
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
60
|
export default Button;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
import { IconName } from '../../display/Icon/icons';
|
|
4
|
+
/**
|
|
5
|
+
* Position of the expand/collapse icon
|
|
6
|
+
*/
|
|
7
|
+
export type AccordionIconPosition = 'left' | 'right';
|
|
8
|
+
export interface AccordionProps extends BaseComponentProps {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier for the accordion
|
|
11
|
+
* Required when used within AccordionContainer
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Header content (can be string or ReactNode)
|
|
16
|
+
*/
|
|
17
|
+
header: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Accordion body content
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the accordion is expanded (controlled)
|
|
24
|
+
*/
|
|
25
|
+
isOpen?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Default expanded state (uncontrolled)
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when open state changes
|
|
33
|
+
* @param isOpen - The new open state
|
|
34
|
+
*/
|
|
35
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Position of the expand/collapse icon
|
|
38
|
+
* @default 'right'
|
|
39
|
+
*/
|
|
40
|
+
iconPosition?: AccordionIconPosition;
|
|
41
|
+
/**
|
|
42
|
+
* Custom expand icon (icon name or ReactNode)
|
|
43
|
+
* @default 'chevron-down'
|
|
44
|
+
*/
|
|
45
|
+
expandIcon?: IconName | ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Custom collapse icon (icon name or ReactNode)
|
|
48
|
+
* If not provided, expandIcon will rotate 180deg
|
|
49
|
+
*/
|
|
50
|
+
collapseIcon?: IconName | ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to disable the accordion
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Accordion size variant
|
|
58
|
+
* @default 'md'
|
|
59
|
+
*/
|
|
60
|
+
size?: ComponentSize;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to show border around the accordion
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
bordered?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Animation duration in milliseconds
|
|
68
|
+
* @default 250
|
|
69
|
+
*/
|
|
70
|
+
animationDuration?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to unmount body content when collapsed
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
unmountOnCollapse?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Additional header icon (shown before header text)
|
|
78
|
+
*/
|
|
79
|
+
headerIcon?: IconName | ReactNode;
|
|
80
|
+
/**
|
|
81
|
+
* Callback when header is clicked
|
|
82
|
+
*/
|
|
83
|
+
onHeaderClick?: () => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Accordion component
|
|
87
|
+
* A collapsible panel with a clickable header and expandable body
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* // Standalone usage
|
|
92
|
+
* <Accordion header="Section Title">
|
|
93
|
+
* <p>Section content here</p>
|
|
94
|
+
* </Accordion>
|
|
95
|
+
*
|
|
96
|
+
* // With custom icon position
|
|
97
|
+
* <Accordion header="Settings" iconPosition="left">
|
|
98
|
+
* <p>Settings content</p>
|
|
99
|
+
* </Accordion>
|
|
100
|
+
*
|
|
101
|
+
* // Controlled
|
|
102
|
+
* <Accordion
|
|
103
|
+
* header="Details"
|
|
104
|
+
* isOpen={isExpanded}
|
|
105
|
+
* onOpenChange={setIsExpanded}
|
|
106
|
+
* >
|
|
107
|
+
* <p>Details content</p>
|
|
108
|
+
* </Accordion>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const Accordion: import('react').ForwardRefExoticComponent<AccordionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
112
|
+
export default Accordion;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types';
|
|
3
|
+
import { AccordionMode } from './AccordionContext';
|
|
4
|
+
/**
|
|
5
|
+
* Position of the expand/collapse all controls
|
|
6
|
+
*/
|
|
7
|
+
export type AccordionControlsPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
8
|
+
export interface AccordionContainerProps extends Omit<BaseComponentProps, 'children'> {
|
|
9
|
+
/**
|
|
10
|
+
* Accordion children
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Mode for accordion expansion
|
|
15
|
+
* - 'single': Only one accordion can be open at a time
|
|
16
|
+
* - 'multiple': Multiple accordions can be open simultaneously
|
|
17
|
+
* @default 'multiple'
|
|
18
|
+
*/
|
|
19
|
+
mode?: AccordionMode;
|
|
20
|
+
/**
|
|
21
|
+
* Array of expanded accordion IDs (controlled)
|
|
22
|
+
*/
|
|
23
|
+
expandedIds?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Default expanded accordion IDs (uncontrolled)
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
28
|
+
defaultExpandedIds?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Callback when expanded IDs change
|
|
31
|
+
* @param expandedIds - Array of currently expanded accordion IDs
|
|
32
|
+
*/
|
|
33
|
+
onExpandedChange?: (expandedIds: string[]) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to show expand all / collapse all controls
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
showExpandAllControls?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Label for "Expand All" button
|
|
41
|
+
* @default 'Expand All'
|
|
42
|
+
*/
|
|
43
|
+
expandAllLabel?: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Label for "Collapse All" button
|
|
46
|
+
* @default 'Collapse All'
|
|
47
|
+
*/
|
|
48
|
+
collapseAllLabel?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Position of expand/collapse all controls
|
|
51
|
+
* @default 'top-right'
|
|
52
|
+
*/
|
|
53
|
+
controlsPosition?: AccordionControlsPosition;
|
|
54
|
+
/**
|
|
55
|
+
* Size variant for all accordions (can be overridden per accordion)
|
|
56
|
+
* @default 'md'
|
|
57
|
+
*/
|
|
58
|
+
size?: ComponentSize;
|
|
59
|
+
/**
|
|
60
|
+
* Gap between accordions in pixels
|
|
61
|
+
* @default 8
|
|
62
|
+
*/
|
|
63
|
+
gap?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Whether accordions should be bordered
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
bordered?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether to disable all accordions
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* AccordionContainer component
|
|
77
|
+
* Manages multiple accordions with optional expand/collapse all functionality
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* // Basic usage
|
|
82
|
+
* <AccordionContainer>
|
|
83
|
+
* <Accordion id="section1" header="Section 1">Content 1</Accordion>
|
|
84
|
+
* <Accordion id="section2" header="Section 2">Content 2</Accordion>
|
|
85
|
+
* </AccordionContainer>
|
|
86
|
+
*
|
|
87
|
+
* // With expand/collapse all
|
|
88
|
+
* <AccordionContainer showExpandAllControls>
|
|
89
|
+
* <Accordion id="section1" header="Section 1">Content 1</Accordion>
|
|
90
|
+
* <Accordion id="section2" header="Section 2">Content 2</Accordion>
|
|
91
|
+
* </AccordionContainer>
|
|
92
|
+
*
|
|
93
|
+
* // Single mode (only one open at a time)
|
|
94
|
+
* <AccordionContainer mode="single">
|
|
95
|
+
* <Accordion id="section1" header="Section 1">Content 1</Accordion>
|
|
96
|
+
* <Accordion id="section2" header="Section 2">Content 2</Accordion>
|
|
97
|
+
* </AccordionContainer>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare const AccordionContainer: React.FC<AccordionContainerProps>;
|
|
101
|
+
export default AccordionContainer;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentSize } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Accordion expansion mode
|
|
4
|
+
* - 'single': Only one accordion can be open at a time
|
|
5
|
+
* - 'multiple': Multiple accordions can be open simultaneously
|
|
6
|
+
*/
|
|
7
|
+
export type AccordionMode = 'single' | 'multiple';
|
|
8
|
+
/**
|
|
9
|
+
* Context value for AccordionContainer
|
|
10
|
+
*/
|
|
11
|
+
export interface AccordionContextValue {
|
|
12
|
+
/**
|
|
13
|
+
* Set of expanded accordion IDs
|
|
14
|
+
*/
|
|
15
|
+
expandedIds: Set<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Toggle expansion state of an accordion
|
|
18
|
+
* @param id - The accordion ID to toggle
|
|
19
|
+
*/
|
|
20
|
+
toggleAccordion: (id: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Expansion mode
|
|
23
|
+
*/
|
|
24
|
+
mode: AccordionMode;
|
|
25
|
+
/**
|
|
26
|
+
* Whether all accordions in the container are disabled
|
|
27
|
+
*/
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Size variant from container (can be overridden per accordion)
|
|
31
|
+
*/
|
|
32
|
+
size?: ComponentSize;
|
|
33
|
+
/**
|
|
34
|
+
* Whether accordions should show borders
|
|
35
|
+
*/
|
|
36
|
+
bordered?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Accordion context
|
|
40
|
+
* Provides state coordination for AccordionContainer
|
|
41
|
+
*/
|
|
42
|
+
export declare const AccordionContext: import('react').Context<AccordionContextValue | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Hook to access accordion container context
|
|
45
|
+
* Returns null if not within AccordionContainer (allowing standalone usage)
|
|
46
|
+
*
|
|
47
|
+
* @returns AccordionContextValue or null if outside container
|
|
48
|
+
*/
|
|
49
|
+
export declare function useAccordionContext(): AccordionContextValue | null;
|
|
50
|
+
/**
|
|
51
|
+
* Hook that throws if not within AccordionContainer
|
|
52
|
+
* Use this when accordion must be within a container
|
|
53
|
+
*
|
|
54
|
+
* @throws Error if used outside AccordionContainer
|
|
55
|
+
* @returns AccordionContextValue
|
|
56
|
+
*/
|
|
57
|
+
export declare function useAccordionContextStrict(): AccordionContextValue;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Accordion, default } from './Accordion';
|
|
2
|
+
export type { AccordionProps, AccordionIconPosition } from './Accordion';
|
|
3
|
+
export { AccordionContainer } from './AccordionContainer';
|
|
4
|
+
export type { AccordionContainerProps, AccordionControlsPosition } from './AccordionContainer';
|
|
5
|
+
export { AccordionContext, useAccordionContext, useAccordionContextStrict } from './AccordionContext';
|
|
6
|
+
export type { AccordionContextValue, AccordionMode } from './AccordionContext';
|
|
@@ -35,7 +35,7 @@ export interface AvatarProps extends Omit<BaseComponentProps, 'children'> {
|
|
|
35
35
|
/**
|
|
36
36
|
* Status indicator
|
|
37
37
|
*/
|
|
38
|
-
status?: 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'processing';
|
|
38
|
+
status?: 'online' | 'offline' | 'away' | 'busy' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'processing';
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Avatar - User profile picture or placeholder with initials/fallback
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { default as React, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { BaseComponentProps, ComponentSize } from '../../../types/component.types';
|
|
3
|
+
/**
|
|
4
|
+
* Card visual variants
|
|
5
|
+
*/
|
|
6
|
+
export type CardVariant = 'outlined' | 'elevated' | 'filled';
|
|
7
|
+
/**
|
|
8
|
+
* Card padding options
|
|
9
|
+
*/
|
|
10
|
+
export type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
11
|
+
/**
|
|
12
|
+
* Props for the Card component
|
|
13
|
+
*/
|
|
14
|
+
export interface CardProps extends BaseComponentProps {
|
|
15
|
+
/**
|
|
16
|
+
* Visual variant of the card
|
|
17
|
+
* @default 'outlined'
|
|
18
|
+
*/
|
|
19
|
+
variant?: CardVariant;
|
|
20
|
+
/**
|
|
21
|
+
* Size of the card (affects border-radius)
|
|
22
|
+
* @default 'md'
|
|
23
|
+
*/
|
|
24
|
+
size?: ComponentSize;
|
|
25
|
+
/**
|
|
26
|
+
* Padding inside the card
|
|
27
|
+
* @default 'md'
|
|
28
|
+
*/
|
|
29
|
+
padding?: CardPadding;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the card is interactive (clickable)
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
interactive?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the card is disabled
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Click handler (when interactive)
|
|
42
|
+
*/
|
|
43
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Optional header content
|
|
46
|
+
*/
|
|
47
|
+
header?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Optional footer content
|
|
50
|
+
*/
|
|
51
|
+
footer?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the header has a bottom divider
|
|
54
|
+
* @default true (when header is provided)
|
|
55
|
+
*/
|
|
56
|
+
headerDivider?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the footer has a top divider
|
|
59
|
+
* @default true (when footer is provided)
|
|
60
|
+
*/
|
|
61
|
+
footerDivider?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Whether to show hover effect (auto-enabled when interactive)
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
hoverable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the card takes full width
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
fullWidth?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Card - A flexible container component for grouping related content
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <Card variant="outlined" padding="md">
|
|
79
|
+
* Card content goes here
|
|
80
|
+
* </Card>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <Card
|
|
86
|
+
* header={<h3>Card Title</h3>}
|
|
87
|
+
* footer={<Button>Action</Button>}
|
|
88
|
+
* >
|
|
89
|
+
* Main content
|
|
90
|
+
* </Card>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <Card interactive onClick={() => console.log('clicked')}>
|
|
96
|
+
* Clickable card
|
|
97
|
+
* </Card>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
export default Card;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types/component.types';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Carousel component
|
|
6
|
+
*/
|
|
7
|
+
export interface CarouselProps extends Omit<BaseComponentProps, 'children'> {
|
|
8
|
+
/**
|
|
9
|
+
* Slides to display
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to auto-play the carousel
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
autoPlay?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Auto-play interval in milliseconds
|
|
19
|
+
* @default 5000
|
|
20
|
+
*/
|
|
21
|
+
autoPlayInterval?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to pause auto-play on hover
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
pauseOnHover?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show navigation dots
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
showDots?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to show navigation arrows
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
showArrows?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to loop infinitely
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
infinite?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Number of slides to show at once
|
|
44
|
+
* @default 1
|
|
45
|
+
*/
|
|
46
|
+
slidesToShow?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Number of slides to scroll at once
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
slidesToScroll?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Gap between slides
|
|
54
|
+
* @default '16px'
|
|
55
|
+
*/
|
|
56
|
+
gap?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Transition duration in milliseconds
|
|
59
|
+
* @default 300
|
|
60
|
+
*/
|
|
61
|
+
transitionDuration?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Active slide index (controlled mode)
|
|
64
|
+
*/
|
|
65
|
+
activeIndex?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Default active slide index (uncontrolled mode)
|
|
68
|
+
* @default 0
|
|
69
|
+
*/
|
|
70
|
+
defaultIndex?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Callback when slide changes
|
|
73
|
+
*/
|
|
74
|
+
onChange?: (index: number) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Icon for previous arrow
|
|
77
|
+
* @default 'chevron-left'
|
|
78
|
+
*/
|
|
79
|
+
prevIcon?: ReactNode | IconName;
|
|
80
|
+
/**
|
|
81
|
+
* Icon for next arrow
|
|
82
|
+
* @default 'chevron-right'
|
|
83
|
+
*/
|
|
84
|
+
nextIcon?: ReactNode | IconName;
|
|
85
|
+
/**
|
|
86
|
+
* Whether arrows should be outside the carousel
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
arrowsOutside?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Dot position
|
|
92
|
+
* @default 'bottom'
|
|
93
|
+
*/
|
|
94
|
+
dotsPosition?: 'bottom' | 'top';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Carousel - A sliding carousel component for displaying multiple items
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <Carousel>
|
|
102
|
+
* <div>Slide 1</div>
|
|
103
|
+
* <div>Slide 2</div>
|
|
104
|
+
* <div>Slide 3</div>
|
|
105
|
+
* </Carousel>
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* <Carousel autoPlay autoPlayInterval={3000} showDots>
|
|
111
|
+
* <img src="image1.jpg" alt="Slide 1" />
|
|
112
|
+
* <img src="image2.jpg" alt="Slide 2" />
|
|
113
|
+
* </Carousel>
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* // Multiple slides visible
|
|
119
|
+
* <Carousel slidesToShow={3} gap="24px">
|
|
120
|
+
* {items.map(item => <Card key={item.id}>{item.content}</Card>)}
|
|
121
|
+
* </Carousel>
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
125
|
+
export default Carousel;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../../types';
|
|
3
|
+
export interface CollapseProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the content is expanded
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Content to show/hide
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Animation duration in milliseconds
|
|
15
|
+
* @default 250
|
|
16
|
+
*/
|
|
17
|
+
duration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Easing function for animation
|
|
20
|
+
* @default 'ease-in-out'
|
|
21
|
+
*/
|
|
22
|
+
easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | string;
|
|
23
|
+
/**
|
|
24
|
+
* Callback when expand animation starts
|
|
25
|
+
*/
|
|
26
|
+
onExpandStart?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Callback when expand animation ends
|
|
29
|
+
*/
|
|
30
|
+
onExpandEnd?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when collapse animation starts
|
|
33
|
+
*/
|
|
34
|
+
onCollapseStart?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback when collapse animation ends
|
|
37
|
+
*/
|
|
38
|
+
onCollapseEnd?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to unmount children when collapsed
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
unmountOnCollapse?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Collapse component
|
|
47
|
+
* A container that provides smooth expand/collapse animation for its children
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <Collapse isOpen={isExpanded}>
|
|
52
|
+
* <div>Content to show/hide</div>
|
|
53
|
+
* </Collapse>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const Collapse: import('react').ForwardRefExoticComponent<CollapseProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
57
|
+
export default Collapse;
|