@lp-labs/ui-components 0.0.0-stage → 1.0.0
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/CHANGELOG.md +41 -0
- package/LICENSE +21 -0
- package/README.md +256 -2
- package/dist/cjs/components/Accordion.d.ts +78 -0
- package/dist/cjs/components/Accordion.js +78 -0
- package/dist/cjs/components/AdvancedComponents.d.ts +353 -0
- package/dist/cjs/components/AdvancedComponents.js +353 -0
- package/dist/cjs/components/Alert.d.ts +102 -0
- package/dist/cjs/components/Alert.js +102 -0
- package/dist/cjs/components/Avatar.d.ts +89 -0
- package/dist/cjs/components/Avatar.js +89 -0
- package/dist/cjs/components/Badge.d.ts +57 -0
- package/dist/cjs/components/Badge.js +57 -0
- package/dist/cjs/components/Breadcrumb.d.ts +50 -0
- package/dist/cjs/components/Breadcrumb.js +50 -0
- package/dist/cjs/components/Button.d.ts +77 -0
- package/dist/cjs/components/Button.js +77 -0
- package/dist/cjs/components/ButtonVariants.d.ts +261 -0
- package/dist/cjs/components/ButtonVariants.js +261 -0
- package/dist/cjs/components/Card.d.ts +56 -0
- package/dist/cjs/components/Card.js +56 -0
- package/dist/cjs/components/CardVariants.d.ts +267 -0
- package/dist/cjs/components/CardVariants.js +267 -0
- package/dist/cjs/components/Checkbox.d.ts +50 -0
- package/dist/cjs/components/Checkbox.js +50 -0
- package/dist/cjs/components/Chip.d.ts +104 -0
- package/dist/cjs/components/Chip.js +104 -0
- package/dist/cjs/components/DataDisplayComponents.d.ts +275 -0
- package/dist/cjs/components/DataDisplayComponents.js +275 -0
- package/dist/cjs/components/Divider.d.ts +77 -0
- package/dist/cjs/components/Divider.js +77 -0
- package/dist/cjs/components/Drawer.d.ts +142 -0
- package/dist/cjs/components/Drawer.js +142 -0
- package/dist/cjs/components/Dropdown.d.ts +139 -0
- package/dist/cjs/components/Dropdown.js +139 -0
- package/dist/cjs/components/Form.d.ts +41 -0
- package/dist/cjs/components/Form.js +41 -0
- package/dist/cjs/components/FormGroup.d.ts +58 -0
- package/dist/cjs/components/FormGroup.js +58 -0
- package/dist/cjs/components/FormInputVariants.d.ts +298 -0
- package/dist/cjs/components/FormInputVariants.js +298 -0
- package/dist/cjs/components/Image.d.ts +106 -0
- package/dist/cjs/components/Image.js +106 -0
- package/dist/cjs/components/Input.d.ts +65 -0
- package/dist/cjs/components/Input.js +65 -0
- package/dist/cjs/components/LayoutComponents.d.ts +258 -0
- package/dist/cjs/components/LayoutComponents.js +258 -0
- package/dist/cjs/components/Link.d.ts +71 -0
- package/dist/cjs/components/Link.js +71 -0
- package/dist/cjs/components/LoadingFeedbackComponents.d.ts +230 -0
- package/dist/cjs/components/LoadingFeedbackComponents.js +230 -0
- package/dist/cjs/components/Menu.d.ts +167 -0
- package/dist/cjs/components/Menu.js +167 -0
- package/dist/cjs/components/Modal.d.ts +145 -0
- package/dist/cjs/components/Modal.js +145 -0
- package/dist/cjs/components/ModalTypes.d.ts +288 -0
- package/dist/cjs/components/ModalTypes.js +288 -0
- package/dist/cjs/components/Navbar.d.ts +181 -0
- package/dist/cjs/components/Navbar.js +181 -0
- package/dist/cjs/components/NavigationComponents.d.ts +276 -0
- package/dist/cjs/components/NavigationComponents.js +276 -0
- package/dist/cjs/components/Pagination.d.ts +94 -0
- package/dist/cjs/components/Pagination.js +94 -0
- package/dist/cjs/components/Popover.d.ts +108 -0
- package/dist/cjs/components/Popover.js +108 -0
- package/dist/cjs/components/Progress.d.ts +68 -0
- package/dist/cjs/components/Progress.js +68 -0
- package/dist/cjs/components/Radio.d.ts +93 -0
- package/dist/cjs/components/Radio.js +93 -0
- package/dist/cjs/components/Rating.d.ts +82 -0
- package/dist/cjs/components/Rating.js +82 -0
- package/dist/cjs/components/Select.d.ts +74 -0
- package/dist/cjs/components/Select.js +74 -0
- package/dist/cjs/components/Sidebar.d.ts +174 -0
- package/dist/cjs/components/Sidebar.js +174 -0
- package/dist/cjs/components/Skeleton.d.ts +57 -0
- package/dist/cjs/components/Skeleton.js +57 -0
- package/dist/cjs/components/Slider.d.ts +64 -0
- package/dist/cjs/components/Slider.js +64 -0
- package/dist/cjs/components/Spinner.d.ts +70 -0
- package/dist/cjs/components/Spinner.js +70 -0
- package/dist/cjs/components/Stack.d.ts +75 -0
- package/dist/cjs/components/Stack.js +75 -0
- package/dist/cjs/components/Stepper.d.ts +150 -0
- package/dist/cjs/components/Stepper.js +150 -0
- package/dist/cjs/components/Table.d.ts +173 -0
- package/dist/cjs/components/Table.js +173 -0
- package/dist/cjs/components/Tabs.d.ts +104 -0
- package/dist/cjs/components/Tabs.js +104 -0
- package/dist/cjs/components/Tag.d.ts +74 -0
- package/dist/cjs/components/Tag.js +74 -0
- package/dist/cjs/components/Textarea.d.ts +75 -0
- package/dist/cjs/components/Textarea.js +75 -0
- package/dist/cjs/components/Timeline.d.ts +124 -0
- package/dist/cjs/components/Timeline.js +124 -0
- package/dist/cjs/components/Toast.d.ts +155 -0
- package/dist/cjs/components/Toast.js +155 -0
- package/dist/cjs/components/Toggle.d.ts +75 -0
- package/dist/cjs/components/Toggle.js +75 -0
- package/dist/cjs/components/Tooltip.d.ts +80 -0
- package/dist/cjs/components/Tooltip.js +80 -0
- package/dist/cjs/components/TypographyComponents.d.ts +265 -0
- package/dist/cjs/components/TypographyComponents.js +265 -0
- package/dist/cjs/components/UtilityComponents.d.ts +345 -0
- package/dist/cjs/components/UtilityComponents.js +345 -0
- package/dist/cjs/components/Video.d.ts +82 -0
- package/dist/cjs/components/Video.js +82 -0
- package/dist/cjs/components/index.d.ts +311 -0
- package/dist/cjs/components/index.js +311 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/styles/main.css +493 -0
- package/dist/cjs/theme/ThemeProvider.d.ts +185 -0
- package/dist/cjs/theme/ThemeProvider.js +185 -0
- package/dist/cjs/theme/index.d.ts +2 -0
- package/dist/cjs/theme/index.js +2 -0
- package/dist/cjs/utilities/classNames.d.ts +200 -0
- package/dist/cjs/utilities/classNames.js +200 -0
- package/dist/cjs/utilities/index.d.ts +3 -0
- package/dist/cjs/utilities/index.js +3 -0
- package/dist/cjs/utilities/styles.d.ts +94 -0
- package/dist/cjs/utilities/styles.js +94 -0
- package/dist/esm/components/Accordion.d.ts +78 -0
- package/dist/esm/components/Accordion.js +78 -0
- package/dist/esm/components/AdvancedComponents.d.ts +353 -0
- package/dist/esm/components/AdvancedComponents.js +353 -0
- package/dist/esm/components/Alert.d.ts +102 -0
- package/dist/esm/components/Alert.js +102 -0
- package/dist/esm/components/Avatar.d.ts +89 -0
- package/dist/esm/components/Avatar.js +89 -0
- package/dist/esm/components/Badge.d.ts +57 -0
- package/dist/esm/components/Badge.js +57 -0
- package/dist/esm/components/Breadcrumb.d.ts +50 -0
- package/dist/esm/components/Breadcrumb.js +50 -0
- package/dist/esm/components/Button.d.ts +77 -0
- package/dist/esm/components/Button.js +77 -0
- package/dist/esm/components/ButtonVariants.d.ts +261 -0
- package/dist/esm/components/ButtonVariants.js +261 -0
- package/dist/esm/components/Card.d.ts +56 -0
- package/dist/esm/components/Card.js +56 -0
- package/dist/esm/components/CardVariants.d.ts +267 -0
- package/dist/esm/components/CardVariants.js +267 -0
- package/dist/esm/components/Checkbox.d.ts +50 -0
- package/dist/esm/components/Checkbox.js +50 -0
- package/dist/esm/components/Chip.d.ts +104 -0
- package/dist/esm/components/Chip.js +104 -0
- package/dist/esm/components/DataDisplayComponents.d.ts +275 -0
- package/dist/esm/components/DataDisplayComponents.js +275 -0
- package/dist/esm/components/Divider.d.ts +77 -0
- package/dist/esm/components/Divider.js +77 -0
- package/dist/esm/components/Drawer.d.ts +142 -0
- package/dist/esm/components/Drawer.js +142 -0
- package/dist/esm/components/Dropdown.d.ts +139 -0
- package/dist/esm/components/Dropdown.js +139 -0
- package/dist/esm/components/Form.d.ts +41 -0
- package/dist/esm/components/Form.js +41 -0
- package/dist/esm/components/FormGroup.d.ts +58 -0
- package/dist/esm/components/FormGroup.js +58 -0
- package/dist/esm/components/FormInputVariants.d.ts +298 -0
- package/dist/esm/components/FormInputVariants.js +298 -0
- package/dist/esm/components/Image.d.ts +106 -0
- package/dist/esm/components/Image.js +106 -0
- package/dist/esm/components/Input.d.ts +65 -0
- package/dist/esm/components/Input.js +65 -0
- package/dist/esm/components/LayoutComponents.d.ts +258 -0
- package/dist/esm/components/LayoutComponents.js +258 -0
- package/dist/esm/components/Link.d.ts +71 -0
- package/dist/esm/components/Link.js +71 -0
- package/dist/esm/components/LoadingFeedbackComponents.d.ts +230 -0
- package/dist/esm/components/LoadingFeedbackComponents.js +230 -0
- package/dist/esm/components/Menu.d.ts +167 -0
- package/dist/esm/components/Menu.js +167 -0
- package/dist/esm/components/Modal.d.ts +145 -0
- package/dist/esm/components/Modal.js +145 -0
- package/dist/esm/components/ModalTypes.d.ts +288 -0
- package/dist/esm/components/ModalTypes.js +288 -0
- package/dist/esm/components/Navbar.d.ts +181 -0
- package/dist/esm/components/Navbar.js +181 -0
- package/dist/esm/components/NavigationComponents.d.ts +276 -0
- package/dist/esm/components/NavigationComponents.js +276 -0
- package/dist/esm/components/Pagination.d.ts +94 -0
- package/dist/esm/components/Pagination.js +94 -0
- package/dist/esm/components/Popover.d.ts +108 -0
- package/dist/esm/components/Popover.js +108 -0
- package/dist/esm/components/Progress.d.ts +68 -0
- package/dist/esm/components/Progress.js +68 -0
- package/dist/esm/components/Radio.d.ts +93 -0
- package/dist/esm/components/Radio.js +93 -0
- package/dist/esm/components/Rating.d.ts +82 -0
- package/dist/esm/components/Rating.js +82 -0
- package/dist/esm/components/Select.d.ts +74 -0
- package/dist/esm/components/Select.js +74 -0
- package/dist/esm/components/Sidebar.d.ts +174 -0
- package/dist/esm/components/Sidebar.js +174 -0
- package/dist/esm/components/Skeleton.d.ts +57 -0
- package/dist/esm/components/Skeleton.js +57 -0
- package/dist/esm/components/Slider.d.ts +64 -0
- package/dist/esm/components/Slider.js +64 -0
- package/dist/esm/components/Spinner.d.ts +70 -0
- package/dist/esm/components/Spinner.js +70 -0
- package/dist/esm/components/Stack.d.ts +75 -0
- package/dist/esm/components/Stack.js +75 -0
- package/dist/esm/components/Stepper.d.ts +150 -0
- package/dist/esm/components/Stepper.js +150 -0
- package/dist/esm/components/Table.d.ts +173 -0
- package/dist/esm/components/Table.js +173 -0
- package/dist/esm/components/Tabs.d.ts +104 -0
- package/dist/esm/components/Tabs.js +104 -0
- package/dist/esm/components/Tag.d.ts +74 -0
- package/dist/esm/components/Tag.js +74 -0
- package/dist/esm/components/Textarea.d.ts +75 -0
- package/dist/esm/components/Textarea.js +75 -0
- package/dist/esm/components/Timeline.d.ts +124 -0
- package/dist/esm/components/Timeline.js +124 -0
- package/dist/esm/components/Toast.d.ts +155 -0
- package/dist/esm/components/Toast.js +155 -0
- package/dist/esm/components/Toggle.d.ts +75 -0
- package/dist/esm/components/Toggle.js +75 -0
- package/dist/esm/components/Tooltip.d.ts +80 -0
- package/dist/esm/components/Tooltip.js +80 -0
- package/dist/esm/components/TypographyComponents.d.ts +265 -0
- package/dist/esm/components/TypographyComponents.js +265 -0
- package/dist/esm/components/UtilityComponents.d.ts +345 -0
- package/dist/esm/components/UtilityComponents.js +345 -0
- package/dist/esm/components/Video.d.ts +82 -0
- package/dist/esm/components/Video.js +82 -0
- package/dist/esm/components/index.d.ts +311 -0
- package/dist/esm/components/index.js +311 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/styles/main.css +493 -0
- package/dist/esm/theme/ThemeProvider.d.ts +185 -0
- package/dist/esm/theme/ThemeProvider.js +185 -0
- package/dist/esm/theme/index.d.ts +2 -0
- package/dist/esm/theme/index.js +2 -0
- package/dist/esm/utilities/classNames.d.ts +200 -0
- package/dist/esm/utilities/classNames.js +200 -0
- package/dist/esm/utilities/index.d.ts +3 -0
- package/dist/esm/utilities/index.js +3 -0
- package/dist/esm/utilities/styles.d.ts +94 -0
- package/dist/esm/utilities/styles.js +94 -0
- package/dist/styles/main.css +493 -0
- package/package.json +124 -6
- package/src/styles/main.css +493 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CardVariantProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
6
|
+
hoverEffect?: 'none' | 'lift' | 'glow' | 'scale';
|
|
7
|
+
border?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const shadowClass = {
|
|
12
|
+
none: 'shadow-none',
|
|
13
|
+
sm: 'shadow-sm',
|
|
14
|
+
md: 'shadow-md',
|
|
15
|
+
lg: 'shadow-lg',
|
|
16
|
+
xl: 'shadow-2xl',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const paddingClass = {
|
|
20
|
+
none: 'p-0',
|
|
21
|
+
sm: 'p-3',
|
|
22
|
+
md: 'p-6',
|
|
23
|
+
lg: 'p-8',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const hoverClass = {
|
|
27
|
+
none: '',
|
|
28
|
+
lift: 'hover:shadow-lg hover:-translate-y-1 transition-all',
|
|
29
|
+
glow: 'hover:shadow-lg hover:ring-2 hover:ring-blue-400 transition-all',
|
|
30
|
+
scale: 'hover:scale-105 transition-transform',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const CardBasic: React.FC<CardVariantProps> = ({
|
|
34
|
+
shadow = 'md',
|
|
35
|
+
padding = 'md',
|
|
36
|
+
hoverEffect = 'lift',
|
|
37
|
+
border = true,
|
|
38
|
+
className = '',
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border border-gray-200' : ''} ${className}`}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const CardImage: React.FC<
|
|
53
|
+
CardVariantProps & {
|
|
54
|
+
image?: string;
|
|
55
|
+
imageAlt?: string;
|
|
56
|
+
imageHeight?: 'sm' | 'md' | 'lg';
|
|
57
|
+
}
|
|
58
|
+
> = ({
|
|
59
|
+
shadow = 'md',
|
|
60
|
+
padding = 'md',
|
|
61
|
+
hoverEffect = 'lift',
|
|
62
|
+
image,
|
|
63
|
+
imageAlt = '',
|
|
64
|
+
imageHeight = 'md',
|
|
65
|
+
border = true,
|
|
66
|
+
className = '',
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const heightClass = {
|
|
71
|
+
sm: 'h-32',
|
|
72
|
+
md: 'h-48',
|
|
73
|
+
lg: 'h-64',
|
|
74
|
+
}[imageHeight];
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={`rounded-lg overflow-hidden bg-white ${shadowClass[shadow]} ${border ? 'border border-gray-200' : ''} ${hoverClass[hoverEffect]} ${className}`}
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
{image && (
|
|
82
|
+
<div className={`${heightClass} w-full overflow-hidden bg-gray-200`}>
|
|
83
|
+
<img src={image} alt={imageAlt} className="w-full h-full object-cover" />
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
<div className={paddingClass[padding]}>{children}</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const CardHorizontal: React.FC<
|
|
92
|
+
CardVariantProps & {
|
|
93
|
+
image?: string;
|
|
94
|
+
imageAlt?: string;
|
|
95
|
+
imageWidth?: 'sm' | 'md' | 'lg';
|
|
96
|
+
}
|
|
97
|
+
> = ({
|
|
98
|
+
shadow = 'md',
|
|
99
|
+
padding = 'md',
|
|
100
|
+
hoverEffect = 'lift',
|
|
101
|
+
image,
|
|
102
|
+
imageAlt = '',
|
|
103
|
+
imageWidth = 'md',
|
|
104
|
+
border = true,
|
|
105
|
+
className = '',
|
|
106
|
+
children,
|
|
107
|
+
...props
|
|
108
|
+
}) => {
|
|
109
|
+
const widthClass = {
|
|
110
|
+
sm: 'w-32',
|
|
111
|
+
md: 'w-48',
|
|
112
|
+
lg: 'w-64',
|
|
113
|
+
}[imageWidth];
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
className={`rounded-lg flex items-stretch bg-white ${shadowClass[shadow]} ${border ? 'border border-gray-200' : ''} ${hoverClass[hoverEffect]} ${className}`}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
{image && (
|
|
121
|
+
<div className={`${widthClass} flex-shrink-0 overflow-hidden bg-gray-200`}>
|
|
122
|
+
<img src={image} alt={imageAlt} className="w-full h-full object-cover" />
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
<div className={paddingClass[padding]}>{children}</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const CardExpanding: React.FC<CardVariantProps & { expandable?: boolean }> = ({
|
|
131
|
+
shadow = 'md',
|
|
132
|
+
padding = 'md',
|
|
133
|
+
hoverEffect = 'glow',
|
|
134
|
+
expandable = true,
|
|
135
|
+
border = true,
|
|
136
|
+
className = '',
|
|
137
|
+
children,
|
|
138
|
+
...props
|
|
139
|
+
}) => {
|
|
140
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<div
|
|
144
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border border-gray-200' : ''} cursor-pointer transition-all ${className}`}
|
|
145
|
+
onClick={() => expandable && setIsExpanded(!isExpanded)}
|
|
146
|
+
{...props}
|
|
147
|
+
>
|
|
148
|
+
<div className="flex justify-between items-center">
|
|
149
|
+
<div className={isExpanded ? '' : 'line-clamp-2'}>{children}</div>
|
|
150
|
+
{expandable && <span className="ml-4">{isExpanded ? '▼' : '▶'}</span>}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const CardInteractive: React.FC<
|
|
157
|
+
CardVariantProps & {
|
|
158
|
+
onClick?: () => void;
|
|
159
|
+
isActive?: boolean;
|
|
160
|
+
}
|
|
161
|
+
> = ({
|
|
162
|
+
shadow = 'md',
|
|
163
|
+
padding = 'md',
|
|
164
|
+
hoverEffect = 'scale',
|
|
165
|
+
onClick,
|
|
166
|
+
isActive = false,
|
|
167
|
+
border = true,
|
|
168
|
+
className = '',
|
|
169
|
+
children,
|
|
170
|
+
...props
|
|
171
|
+
}) => {
|
|
172
|
+
return (
|
|
173
|
+
<div
|
|
174
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border' : ''} ${isActive ? 'border-blue-500 ring-2 ring-blue-200' : 'border-gray-200'} cursor-pointer transition-all ${className}`}
|
|
175
|
+
onClick={onClick}
|
|
176
|
+
{...props}
|
|
177
|
+
>
|
|
178
|
+
{children}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const CardGradient: React.FC<
|
|
184
|
+
CardVariantProps & {
|
|
185
|
+
gradient?: 'blue' | 'purple' | 'green' | 'orange' | 'pink';
|
|
186
|
+
}
|
|
187
|
+
> = ({
|
|
188
|
+
shadow = 'md',
|
|
189
|
+
padding = 'md',
|
|
190
|
+
gradient = 'blue',
|
|
191
|
+
border = true,
|
|
192
|
+
className = '',
|
|
193
|
+
children,
|
|
194
|
+
...props
|
|
195
|
+
}) => {
|
|
196
|
+
const gradientClass = {
|
|
197
|
+
blue: 'from-blue-400 to-blue-600',
|
|
198
|
+
purple: 'from-purple-400 to-purple-600',
|
|
199
|
+
green: 'from-green-400 to-green-600',
|
|
200
|
+
orange: 'from-orange-400 to-orange-600',
|
|
201
|
+
pink: 'from-pink-400 to-pink-600',
|
|
202
|
+
}[gradient];
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<div
|
|
206
|
+
className={`rounded-lg bg-gradient-to-br ${gradientClass} ${paddingClass[padding]} ${shadowClass[shadow]} text-white ${className}`}
|
|
207
|
+
{...props}
|
|
208
|
+
>
|
|
209
|
+
{children}
|
|
210
|
+
</div>
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const CardMinimal: React.FC<CardVariantProps> = ({
|
|
215
|
+
padding = 'md',
|
|
216
|
+
border = false,
|
|
217
|
+
className = '',
|
|
218
|
+
children,
|
|
219
|
+
...props
|
|
220
|
+
}) => {
|
|
221
|
+
return (
|
|
222
|
+
<div
|
|
223
|
+
className={`rounded-lg bg-white ${paddingClass[padding]} ${border ? 'border border-gray-200' : ''} ${className}`}
|
|
224
|
+
{...props}
|
|
225
|
+
>
|
|
226
|
+
{children}
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const CardBordered: React.FC<
|
|
232
|
+
CardVariantProps & {
|
|
233
|
+
borderColor?: 'blue' | 'green' | 'red' | 'yellow' | 'gray';
|
|
234
|
+
borderSize?: 'sm' | 'md' | 'lg';
|
|
235
|
+
}
|
|
236
|
+
> = ({
|
|
237
|
+
shadow = 'sm',
|
|
238
|
+
padding = 'md',
|
|
239
|
+
borderColor = 'gray',
|
|
240
|
+
borderSize = 'md',
|
|
241
|
+
className = '',
|
|
242
|
+
children,
|
|
243
|
+
...props
|
|
244
|
+
}) => {
|
|
245
|
+
const borderColorClass = {
|
|
246
|
+
blue: 'border-blue-500',
|
|
247
|
+
green: 'border-green-500',
|
|
248
|
+
red: 'border-red-500',
|
|
249
|
+
yellow: 'border-yellow-500',
|
|
250
|
+
gray: 'border-gray-300',
|
|
251
|
+
}[borderColor];
|
|
252
|
+
|
|
253
|
+
const borderSizeClass = {
|
|
254
|
+
sm: 'border-2',
|
|
255
|
+
md: 'border-4',
|
|
256
|
+
lg: 'border-8',
|
|
257
|
+
}[borderSize];
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div
|
|
261
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${borderSizeClass} ${borderColorClass} ${className}`}
|
|
262
|
+
{...props}
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CardVariantProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
6
|
+
hoverEffect?: 'none' | 'lift' | 'glow' | 'scale';
|
|
7
|
+
border?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const shadowClass = {
|
|
12
|
+
none: 'shadow-none',
|
|
13
|
+
sm: 'shadow-sm',
|
|
14
|
+
md: 'shadow-md',
|
|
15
|
+
lg: 'shadow-lg',
|
|
16
|
+
xl: 'shadow-2xl',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const paddingClass = {
|
|
20
|
+
none: 'p-0',
|
|
21
|
+
sm: 'p-3',
|
|
22
|
+
md: 'p-6',
|
|
23
|
+
lg: 'p-8',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const hoverClass = {
|
|
27
|
+
none: '',
|
|
28
|
+
lift: 'hover:shadow-lg hover:-translate-y-1 transition-all',
|
|
29
|
+
glow: 'hover:shadow-lg hover:ring-2 hover:ring-blue-400 transition-all',
|
|
30
|
+
scale: 'hover:scale-105 transition-transform',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const CardBasic: React.FC<CardVariantProps> = ({
|
|
34
|
+
shadow = 'md',
|
|
35
|
+
padding = 'md',
|
|
36
|
+
hoverEffect = 'lift',
|
|
37
|
+
border = true,
|
|
38
|
+
className = '',
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border border-gray-200' : ''} ${className}`}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const CardImage: React.FC<
|
|
53
|
+
CardVariantProps & {
|
|
54
|
+
image?: string;
|
|
55
|
+
imageAlt?: string;
|
|
56
|
+
imageHeight?: 'sm' | 'md' | 'lg';
|
|
57
|
+
}
|
|
58
|
+
> = ({
|
|
59
|
+
shadow = 'md',
|
|
60
|
+
padding = 'md',
|
|
61
|
+
hoverEffect = 'lift',
|
|
62
|
+
image,
|
|
63
|
+
imageAlt = '',
|
|
64
|
+
imageHeight = 'md',
|
|
65
|
+
border = true,
|
|
66
|
+
className = '',
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const heightClass = {
|
|
71
|
+
sm: 'h-32',
|
|
72
|
+
md: 'h-48',
|
|
73
|
+
lg: 'h-64',
|
|
74
|
+
}[imageHeight];
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={`rounded-lg overflow-hidden bg-white ${shadowClass[shadow]} ${border ? 'border border-gray-200' : ''} ${hoverClass[hoverEffect]} ${className}`}
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
{image && (
|
|
82
|
+
<div className={`${heightClass} w-full overflow-hidden bg-gray-200`}>
|
|
83
|
+
<img src={image} alt={imageAlt} className="w-full h-full object-cover" />
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
<div className={paddingClass[padding]}>{children}</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const CardHorizontal: React.FC<
|
|
92
|
+
CardVariantProps & {
|
|
93
|
+
image?: string;
|
|
94
|
+
imageAlt?: string;
|
|
95
|
+
imageWidth?: 'sm' | 'md' | 'lg';
|
|
96
|
+
}
|
|
97
|
+
> = ({
|
|
98
|
+
shadow = 'md',
|
|
99
|
+
padding = 'md',
|
|
100
|
+
hoverEffect = 'lift',
|
|
101
|
+
image,
|
|
102
|
+
imageAlt = '',
|
|
103
|
+
imageWidth = 'md',
|
|
104
|
+
border = true,
|
|
105
|
+
className = '',
|
|
106
|
+
children,
|
|
107
|
+
...props
|
|
108
|
+
}) => {
|
|
109
|
+
const widthClass = {
|
|
110
|
+
sm: 'w-32',
|
|
111
|
+
md: 'w-48',
|
|
112
|
+
lg: 'w-64',
|
|
113
|
+
}[imageWidth];
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
className={`rounded-lg flex items-stretch bg-white ${shadowClass[shadow]} ${border ? 'border border-gray-200' : ''} ${hoverClass[hoverEffect]} ${className}`}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
{image && (
|
|
121
|
+
<div className={`${widthClass} flex-shrink-0 overflow-hidden bg-gray-200`}>
|
|
122
|
+
<img src={image} alt={imageAlt} className="w-full h-full object-cover" />
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
<div className={paddingClass[padding]}>{children}</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const CardExpanding: React.FC<CardVariantProps & { expandable?: boolean }> = ({
|
|
131
|
+
shadow = 'md',
|
|
132
|
+
padding = 'md',
|
|
133
|
+
hoverEffect = 'glow',
|
|
134
|
+
expandable = true,
|
|
135
|
+
border = true,
|
|
136
|
+
className = '',
|
|
137
|
+
children,
|
|
138
|
+
...props
|
|
139
|
+
}) => {
|
|
140
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<div
|
|
144
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border border-gray-200' : ''} cursor-pointer transition-all ${className}`}
|
|
145
|
+
onClick={() => expandable && setIsExpanded(!isExpanded)}
|
|
146
|
+
{...props}
|
|
147
|
+
>
|
|
148
|
+
<div className="flex justify-between items-center">
|
|
149
|
+
<div className={isExpanded ? '' : 'line-clamp-2'}>{children}</div>
|
|
150
|
+
{expandable && <span className="ml-4">{isExpanded ? '▼' : '▶'}</span>}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const CardInteractive: React.FC<
|
|
157
|
+
CardVariantProps & {
|
|
158
|
+
onClick?: () => void;
|
|
159
|
+
isActive?: boolean;
|
|
160
|
+
}
|
|
161
|
+
> = ({
|
|
162
|
+
shadow = 'md',
|
|
163
|
+
padding = 'md',
|
|
164
|
+
hoverEffect = 'scale',
|
|
165
|
+
onClick,
|
|
166
|
+
isActive = false,
|
|
167
|
+
border = true,
|
|
168
|
+
className = '',
|
|
169
|
+
children,
|
|
170
|
+
...props
|
|
171
|
+
}) => {
|
|
172
|
+
return (
|
|
173
|
+
<div
|
|
174
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${hoverClass[hoverEffect]} ${border ? 'border' : ''} ${isActive ? 'border-blue-500 ring-2 ring-blue-200' : 'border-gray-200'} cursor-pointer transition-all ${className}`}
|
|
175
|
+
onClick={onClick}
|
|
176
|
+
{...props}
|
|
177
|
+
>
|
|
178
|
+
{children}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const CardGradient: React.FC<
|
|
184
|
+
CardVariantProps & {
|
|
185
|
+
gradient?: 'blue' | 'purple' | 'green' | 'orange' | 'pink';
|
|
186
|
+
}
|
|
187
|
+
> = ({
|
|
188
|
+
shadow = 'md',
|
|
189
|
+
padding = 'md',
|
|
190
|
+
gradient = 'blue',
|
|
191
|
+
border = true,
|
|
192
|
+
className = '',
|
|
193
|
+
children,
|
|
194
|
+
...props
|
|
195
|
+
}) => {
|
|
196
|
+
const gradientClass = {
|
|
197
|
+
blue: 'from-blue-400 to-blue-600',
|
|
198
|
+
purple: 'from-purple-400 to-purple-600',
|
|
199
|
+
green: 'from-green-400 to-green-600',
|
|
200
|
+
orange: 'from-orange-400 to-orange-600',
|
|
201
|
+
pink: 'from-pink-400 to-pink-600',
|
|
202
|
+
}[gradient];
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<div
|
|
206
|
+
className={`rounded-lg bg-gradient-to-br ${gradientClass} ${paddingClass[padding]} ${shadowClass[shadow]} text-white ${className}`}
|
|
207
|
+
{...props}
|
|
208
|
+
>
|
|
209
|
+
{children}
|
|
210
|
+
</div>
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const CardMinimal: React.FC<CardVariantProps> = ({
|
|
215
|
+
padding = 'md',
|
|
216
|
+
border = false,
|
|
217
|
+
className = '',
|
|
218
|
+
children,
|
|
219
|
+
...props
|
|
220
|
+
}) => {
|
|
221
|
+
return (
|
|
222
|
+
<div
|
|
223
|
+
className={`rounded-lg bg-white ${paddingClass[padding]} ${border ? 'border border-gray-200' : ''} ${className}`}
|
|
224
|
+
{...props}
|
|
225
|
+
>
|
|
226
|
+
{children}
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const CardBordered: React.FC<
|
|
232
|
+
CardVariantProps & {
|
|
233
|
+
borderColor?: 'blue' | 'green' | 'red' | 'yellow' | 'gray';
|
|
234
|
+
borderSize?: 'sm' | 'md' | 'lg';
|
|
235
|
+
}
|
|
236
|
+
> = ({
|
|
237
|
+
shadow = 'sm',
|
|
238
|
+
padding = 'md',
|
|
239
|
+
borderColor = 'gray',
|
|
240
|
+
borderSize = 'md',
|
|
241
|
+
className = '',
|
|
242
|
+
children,
|
|
243
|
+
...props
|
|
244
|
+
}) => {
|
|
245
|
+
const borderColorClass = {
|
|
246
|
+
blue: 'border-blue-500',
|
|
247
|
+
green: 'border-green-500',
|
|
248
|
+
red: 'border-red-500',
|
|
249
|
+
yellow: 'border-yellow-500',
|
|
250
|
+
gray: 'border-gray-300',
|
|
251
|
+
}[borderColor];
|
|
252
|
+
|
|
253
|
+
const borderSizeClass = {
|
|
254
|
+
sm: 'border-2',
|
|
255
|
+
md: 'border-4',
|
|
256
|
+
lg: 'border-8',
|
|
257
|
+
}[borderSize];
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div
|
|
261
|
+
className={`rounded-lg bg-white ${shadowClass[shadow]} ${paddingClass[padding]} ${borderSizeClass} ${borderColorClass} ${className}`}
|
|
262
|
+
{...props}
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn } from '../utilities/classNames';
|
|
3
|
+
|
|
4
|
+
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
label?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
label,
|
|
14
|
+
error = false,
|
|
15
|
+
errorMessage,
|
|
16
|
+
id,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
},
|
|
20
|
+
ref,
|
|
21
|
+
) => {
|
|
22
|
+
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col gap-1">
|
|
26
|
+
<label className="flex items-center gap-2 cursor-pointer">
|
|
27
|
+
<input
|
|
28
|
+
ref={ref}
|
|
29
|
+
id={inputId}
|
|
30
|
+
type="checkbox"
|
|
31
|
+
className={cn(
|
|
32
|
+
'w-4 h-4 rounded border border-gray-300 text-blue-600',
|
|
33
|
+
'focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1',
|
|
34
|
+
'disabled:opacity-50 disabled:cursor-not-allowed',
|
|
35
|
+
error && 'border-red-500',
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
{label && <span className="text-sm text-gray-700">{label}</span>}
|
|
41
|
+
</label>
|
|
42
|
+
{error && errorMessage && (
|
|
43
|
+
<p className="text-sm text-red-600">{errorMessage}</p>
|
|
44
|
+
)}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn } from '../utilities/classNames';
|
|
3
|
+
|
|
4
|
+
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
label?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
label,
|
|
14
|
+
error = false,
|
|
15
|
+
errorMessage,
|
|
16
|
+
id,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
},
|
|
20
|
+
ref,
|
|
21
|
+
) => {
|
|
22
|
+
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col gap-1">
|
|
26
|
+
<label className="flex items-center gap-2 cursor-pointer">
|
|
27
|
+
<input
|
|
28
|
+
ref={ref}
|
|
29
|
+
id={inputId}
|
|
30
|
+
type="checkbox"
|
|
31
|
+
className={cn(
|
|
32
|
+
'w-4 h-4 rounded border border-gray-300 text-blue-600',
|
|
33
|
+
'focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1',
|
|
34
|
+
'disabled:opacity-50 disabled:cursor-not-allowed',
|
|
35
|
+
error && 'border-red-500',
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
{label && <span className="text-sm text-gray-700">{label}</span>}
|
|
41
|
+
</label>
|
|
42
|
+
{error && errorMessage && (
|
|
43
|
+
<p className="text-sm text-red-600">{errorMessage}</p>
|
|
44
|
+
)}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
Checkbox.displayName = 'Checkbox';
|