@zango-core/components 0.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/README.md +435 -0
- package/dist/components/Accordion/Accordion.d.ts +36 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Alert/Alert.d.ts +15 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +15 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +33 -0
- package/dist/components/ContextMenu/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +41 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +13 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +29 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Empty/Empty.d.ts +10 -0
- package/dist/components/Empty/index.d.ts +2 -0
- package/dist/components/Form/Form.d.ts +48 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/FormWidgets/index.d.ts +6 -0
- package/dist/components/InfoSection/InfoSection.d.ts +38 -0
- package/dist/components/InfoSection/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +13 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Layout/Layout.d.ts +35 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Loader/Loader.d.ts +24 -0
- package/dist/components/Message/Message.d.ts +35 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/MobileInput/MobileInput.d.ts +8 -0
- package/dist/components/MobileInput/index.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -0
- package/dist/components/PasswordInput/index.d.ts +1 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +44 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.example.d.ts +10 -0
- package/dist/components/PhoneNumberInput/index.d.ts +1 -0
- package/dist/components/Progress/Progress.d.ts +15 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Result/Result.d.ts +12 -0
- package/dist/components/Result/index.d.ts +2 -0
- package/dist/components/Segmented/Segmented.d.ts +19 -0
- package/dist/components/Segmented/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +31 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Space/Space.d.ts +12 -0
- package/dist/components/Space/index.d.ts +2 -0
- package/dist/components/Spin/Spin.d.ts +11 -0
- package/dist/components/Spin/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +20 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tag/Tag.d.ts +12 -0
- package/dist/components/Tag/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +7 -0
- package/dist/components/Textarea/index.d.ts +1 -0
- package/dist/components/Timeline/Timeline.d.ts +30 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +43 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/useToast.d.ts +10 -0
- package/dist/components/Typography/Typography.d.ts +31 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/demo/App.d.ts +2 -0
- package/dist/demo/main.d.ts +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/utils/cn.d.ts +1 -0
- package/dist/utils/injectStyles.d.ts +1 -0
- package/dist/zango-components.js +4932 -0
- package/dist/zango-components.js.map +1 -0
- package/dist/zango-components.umd.cjs +101 -0
- package/dist/zango-components.umd.cjs.map +1 -0
- package/package.json +82 -0
package/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# Zango Components
|
|
2
|
+
|
|
3
|
+
A modern React component library built with **Tailwind CSS** and customizable CSS variables that inherit from parent applications. Perfect for building consistent, accessible UI components across your applications.
|
|
4
|
+
|
|
5
|
+
## 🚀 Features
|
|
6
|
+
|
|
7
|
+
- **Tailwind CSS Integration**: All components use Tailwind utility classes for consistent styling
|
|
8
|
+
- **Color Inheritance**: CSS variables allow parent applications to override colors
|
|
9
|
+
- **TypeScript Support**: Full type definitions for all components
|
|
10
|
+
- **Responsive Design**: Components adapt to different screen sizes
|
|
11
|
+
- **Accessibility**: Proper ARIA attributes and keyboard navigation
|
|
12
|
+
- **Storybook Documentation**: Interactive component documentation
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @zango/components
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 🎨 Setup
|
|
22
|
+
|
|
23
|
+
### Import Styles
|
|
24
|
+
|
|
25
|
+
Import the component library styles in your application:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
// In your main entry file (e.g., main.tsx or index.tsx)
|
|
29
|
+
import '@zango/components/style.css';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Peer Dependencies
|
|
33
|
+
|
|
34
|
+
Make sure you have the following peer dependencies installed:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install react react-dom @radix-ui/react-dialog lucide-react
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Optional: Tailwind CSS Integration
|
|
41
|
+
|
|
42
|
+
If your project uses Tailwind CSS, you can optionally add the library to your content scanning for better integration:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
// tailwind.config.js
|
|
46
|
+
module.exports = {
|
|
47
|
+
content: [
|
|
48
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
49
|
+
"./node_modules/@zango/components/dist/**/*.{js,jsx,ts,tsx}", // Optional: for better integration
|
|
50
|
+
],
|
|
51
|
+
theme: {
|
|
52
|
+
extend: {
|
|
53
|
+
// You can extend or override colors here
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
plugins: [],
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Note**: This step is optional. The library works perfectly without any Tailwind configuration in your project.
|
|
61
|
+
|
|
62
|
+
## 🎯 Usage
|
|
63
|
+
|
|
64
|
+
### Basic Usage
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Button, Badge, Accordion } from '@zango/components';
|
|
68
|
+
// No need to import CSS - it's automatically included!
|
|
69
|
+
|
|
70
|
+
function App() {
|
|
71
|
+
return (
|
|
72
|
+
<div className="p-4">
|
|
73
|
+
<Button variant="primary" size="medium">
|
|
74
|
+
Click me
|
|
75
|
+
</Button>
|
|
76
|
+
|
|
77
|
+
<Badge variant="success">Active</Badge>
|
|
78
|
+
|
|
79
|
+
<Accordion
|
|
80
|
+
items={[
|
|
81
|
+
{
|
|
82
|
+
key: "item1",
|
|
83
|
+
title: "Accordion Item",
|
|
84
|
+
content: "This is the content"
|
|
85
|
+
}
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### With Custom Colors
|
|
94
|
+
|
|
95
|
+
```css
|
|
96
|
+
/* Override colors in your CSS - no imports needed! */
|
|
97
|
+
:root {
|
|
98
|
+
--colors-Brand-500: #3b82f6;
|
|
99
|
+
--colors-Brand-600: #2563eb;
|
|
100
|
+
--colors-Brand-700: #1d4ed8;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
// Components will automatically use your custom colors
|
|
106
|
+
<Button variant="primary">Custom Colored Button</Button>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 🧩 Available Components
|
|
110
|
+
|
|
111
|
+
### Button
|
|
112
|
+
|
|
113
|
+
A versatile button component with multiple variants and sizes.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<Button
|
|
117
|
+
variant="primary"
|
|
118
|
+
size="medium"
|
|
119
|
+
fullWidth={false}
|
|
120
|
+
disabled={false}
|
|
121
|
+
>
|
|
122
|
+
Button Text
|
|
123
|
+
</Button>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Props:**
|
|
127
|
+
- `variant`: `'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive' | 'danger' | 'success'`
|
|
128
|
+
- `size`: `'small' | 'medium' | 'large' | 'sm' | 'md' | 'lg'`
|
|
129
|
+
- `fullWidth`: `boolean`
|
|
130
|
+
- All standard HTML button attributes
|
|
131
|
+
|
|
132
|
+
### Badge
|
|
133
|
+
|
|
134
|
+
Status indicators with multiple variants.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<Badge variant="success">Success</Badge>
|
|
138
|
+
<Badge variant="warning">Warning</Badge>
|
|
139
|
+
<Badge variant="danger">Error</Badge>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Props:**
|
|
143
|
+
- `variant`: `'success' | 'low' | 'warning' | 'medium' | 'danger' | 'high' | 'critical' | 'neutral' | 'default' | 'outline'`
|
|
144
|
+
|
|
145
|
+
### Accordion
|
|
146
|
+
|
|
147
|
+
Expandable content sections with smooth animations.
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<Accordion
|
|
151
|
+
items={[
|
|
152
|
+
{
|
|
153
|
+
key: "item1",
|
|
154
|
+
title: "First Item",
|
|
155
|
+
content: <p>Content goes here</p>,
|
|
156
|
+
icon: <IconComponent />,
|
|
157
|
+
subtitle: "Optional subtitle"
|
|
158
|
+
}
|
|
159
|
+
]}
|
|
160
|
+
multiple={true}
|
|
161
|
+
collapsible={true}
|
|
162
|
+
/>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Context Menu
|
|
166
|
+
|
|
167
|
+
Dropdown menus with customizable items.
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
<ContextMenu
|
|
171
|
+
trigger={<Button>Open Menu</Button>}
|
|
172
|
+
align="right"
|
|
173
|
+
>
|
|
174
|
+
<ContextMenuItem onClick={() => console.log('clicked')}>
|
|
175
|
+
Menu Item
|
|
176
|
+
</ContextMenuItem>
|
|
177
|
+
<ContextMenuSeparator />
|
|
178
|
+
<ContextMenuItem danger>Delete</ContextMenuItem>
|
|
179
|
+
</ContextMenu>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Info Section
|
|
183
|
+
|
|
184
|
+
Flexible information display with multiple layouts.
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
<InfoSection
|
|
188
|
+
title="Section Title"
|
|
189
|
+
subtitle="Subtitle"
|
|
190
|
+
description="Description text"
|
|
191
|
+
variant="card"
|
|
192
|
+
size="medium"
|
|
193
|
+
icon={<IconComponent />}
|
|
194
|
+
badge={<Badge variant="success">New</Badge>}
|
|
195
|
+
actions={<Button size="small">Edit</Button>}
|
|
196
|
+
>
|
|
197
|
+
<InfoGrid columns={2}>
|
|
198
|
+
<InfoItem label="Label" value="Value" />
|
|
199
|
+
<InfoItem label="Status" value="Active" />
|
|
200
|
+
</InfoGrid>
|
|
201
|
+
</InfoSection>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Timeline
|
|
205
|
+
|
|
206
|
+
Event timeline with date grouping.
|
|
207
|
+
|
|
208
|
+
```tsx
|
|
209
|
+
<Timeline
|
|
210
|
+
sections={[
|
|
211
|
+
{
|
|
212
|
+
date: "Today",
|
|
213
|
+
events: [
|
|
214
|
+
{
|
|
215
|
+
id: "1",
|
|
216
|
+
type: "status_change",
|
|
217
|
+
title: "Status Updated",
|
|
218
|
+
description: "Changed to active",
|
|
219
|
+
timestamp: "2:30 PM",
|
|
220
|
+
date: "Dec 15",
|
|
221
|
+
icon: "activity"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
]}
|
|
226
|
+
/>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Drawer
|
|
230
|
+
|
|
231
|
+
Sliding panel overlay for displaying additional content.
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
<Drawer
|
|
235
|
+
open={open}
|
|
236
|
+
onClose={() => setOpen(false)}
|
|
237
|
+
title="Drawer Title"
|
|
238
|
+
size="md"
|
|
239
|
+
position="right"
|
|
240
|
+
>
|
|
241
|
+
<p>Drawer content</p>
|
|
242
|
+
</Drawer>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Props:**
|
|
246
|
+
- `open`: `boolean` (required)
|
|
247
|
+
- `onClose`: `() => void` (required)
|
|
248
|
+
- `size`: `'sm' | 'md' | 'lg' | 'xl' | 'full'`
|
|
249
|
+
- `position`: `'right' | 'left' | 'top' | 'bottom'`
|
|
250
|
+
- `title`: `string`
|
|
251
|
+
- `showBackButton`: `boolean`
|
|
252
|
+
- `onBack`: `() => void`
|
|
253
|
+
|
|
254
|
+
[Full Drawer documentation →](./docs/Drawer.md)
|
|
255
|
+
|
|
256
|
+
### Toast
|
|
257
|
+
|
|
258
|
+
Beautiful toast notifications powered by Sonner with customizable variants, positions, and actions.
|
|
259
|
+
|
|
260
|
+
```tsx
|
|
261
|
+
import { Toaster, toast, useToast } from '@zango/components';
|
|
262
|
+
|
|
263
|
+
// Add Toaster to your app root
|
|
264
|
+
function App() {
|
|
265
|
+
return (
|
|
266
|
+
<>
|
|
267
|
+
<YourApp />
|
|
268
|
+
<Toaster position="top-right" />
|
|
269
|
+
</>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Use toast in your components
|
|
274
|
+
function MyComponent() {
|
|
275
|
+
const { success, error, warning, info } = useToast();
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<Button onClick={() => success('Operation successful!')}>
|
|
279
|
+
Show Toast
|
|
280
|
+
</Button>
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Toast Options:**
|
|
286
|
+
```tsx
|
|
287
|
+
toast.success({
|
|
288
|
+
title: 'Success toast message',
|
|
289
|
+
description: 'Optional description text',
|
|
290
|
+
duration: 5000,
|
|
291
|
+
icon: <CustomIcon />,
|
|
292
|
+
primaryAction: {
|
|
293
|
+
label: 'Undo',
|
|
294
|
+
onClick: () => console.log('Undo clicked')
|
|
295
|
+
},
|
|
296
|
+
secondaryAction: {
|
|
297
|
+
label: 'Dismiss',
|
|
298
|
+
onClick: () => console.log('Dismissed')
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Props:**
|
|
304
|
+
- `position`: `'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'`
|
|
305
|
+
- `duration`: `number` (milliseconds)
|
|
306
|
+
- `variant`: `'success' | 'error' | 'warning' | 'info' | 'default'`
|
|
307
|
+
- Custom icons and actions supported
|
|
308
|
+
|
|
309
|
+
## 🎨 Customizing Colors
|
|
310
|
+
|
|
311
|
+
The component library uses CSS variables that can be overridden in your application:
|
|
312
|
+
|
|
313
|
+
```css
|
|
314
|
+
:root {
|
|
315
|
+
/* Brand colors */
|
|
316
|
+
--colors-Brand-500: #your-primary-color;
|
|
317
|
+
--colors-Brand-600: #your-primary-hover;
|
|
318
|
+
--colors-Brand-700: #your-primary-active;
|
|
319
|
+
|
|
320
|
+
/* Gray colors */
|
|
321
|
+
--colors-Gray-100: #your-gray-light;
|
|
322
|
+
--colors-Gray-500: #your-gray-medium;
|
|
323
|
+
--colors-Gray-900: #your-gray-dark;
|
|
324
|
+
|
|
325
|
+
/* Status colors */
|
|
326
|
+
--colors-success-500: #your-success-color;
|
|
327
|
+
--colors-error-500: #your-error-color;
|
|
328
|
+
--colors-warning-500: #your-warning-color;
|
|
329
|
+
|
|
330
|
+
/* Base colors */
|
|
331
|
+
--colors-Base-white: #ffffff;
|
|
332
|
+
--colors-Base-black: #000000;
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## 🛠️ Development
|
|
337
|
+
|
|
338
|
+
### Prerequisites
|
|
339
|
+
|
|
340
|
+
- Node.js (v16 or later)
|
|
341
|
+
- npm or yarn
|
|
342
|
+
|
|
343
|
+
### Getting Started
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# Clone the repository
|
|
347
|
+
git clone https://github.com/yourusername/zango-react-components.git
|
|
348
|
+
cd zango-react-components
|
|
349
|
+
|
|
350
|
+
# Install dependencies
|
|
351
|
+
npm install
|
|
352
|
+
|
|
353
|
+
# Start development server
|
|
354
|
+
npm run dev
|
|
355
|
+
|
|
356
|
+
# Run Storybook for component development
|
|
357
|
+
npm run storybook
|
|
358
|
+
|
|
359
|
+
# Build the library
|
|
360
|
+
npm run build
|
|
361
|
+
|
|
362
|
+
# Type check
|
|
363
|
+
npm run type-check
|
|
364
|
+
|
|
365
|
+
# Lint code
|
|
366
|
+
npm run lint
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Project Structure
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
src/
|
|
373
|
+
├── components/ # Component source files
|
|
374
|
+
│ ├── Button/
|
|
375
|
+
│ ├── Badge/
|
|
376
|
+
│ ├── Accordion/
|
|
377
|
+
│ ├── ContextMenu/
|
|
378
|
+
│ ├── InfoSection/
|
|
379
|
+
│ ├── Timeline/
|
|
380
|
+
│ └── Drawer/
|
|
381
|
+
├── styles/
|
|
382
|
+
│ ├── index.css # Main Tailwind CSS file
|
|
383
|
+
│ └── variables.css # CSS variables
|
|
384
|
+
├── utils/
|
|
385
|
+
│ └── cn.ts # Class name utility
|
|
386
|
+
└── index.ts # Main export file
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Available Scripts
|
|
390
|
+
|
|
391
|
+
- `npm run dev` - Start development server
|
|
392
|
+
- `npm run build` - Build the library for production
|
|
393
|
+
- `npm run storybook` - Start Storybook development server
|
|
394
|
+
- `npm run build-storybook` - Build Storybook for production
|
|
395
|
+
- `npm run type-check` - Run TypeScript type checking
|
|
396
|
+
- `npm run lint` - Run ESLint
|
|
397
|
+
|
|
398
|
+
### Building for Production
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
npm run build
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
This creates a `dist` folder with:
|
|
405
|
+
- `zango-components.js` - ES module build (with CSS included)
|
|
406
|
+
- `zango-components.umd.cjs` - UMD build (with CSS included)
|
|
407
|
+
- Type definitions
|
|
408
|
+
|
|
409
|
+
## 📚 Documentation
|
|
410
|
+
|
|
411
|
+
Visit our [Storybook documentation](https://your-storybook-url.com) to see all components in action with interactive examples.
|
|
412
|
+
|
|
413
|
+
## 🤝 Contributing
|
|
414
|
+
|
|
415
|
+
1. Fork the repository
|
|
416
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
417
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
418
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
419
|
+
5. Open a Pull Request
|
|
420
|
+
|
|
421
|
+
## 📄 License
|
|
422
|
+
|
|
423
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
424
|
+
|
|
425
|
+
## 🆘 Support
|
|
426
|
+
|
|
427
|
+
If you encounter any issues or have questions:
|
|
428
|
+
|
|
429
|
+
1. Check the [Storybook documentation](https://your-storybook-url.com)
|
|
430
|
+
2. Search [existing issues](https://github.com/yourusername/zango-react-components/issues)
|
|
431
|
+
3. Create a [new issue](https://github.com/yourusername/zango-react-components/issues/new) if needed
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
Made with ❤️ using React, TypeScript, and Tailwind CSS
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AccordionItemData {
|
|
4
|
+
key: string;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
subtitle?: React.ReactNode;
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
actions?: React.ReactNode;
|
|
12
|
+
hasFilter?: boolean;
|
|
13
|
+
headerStyle?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
interface AccordionProps {
|
|
16
|
+
items: AccordionItemData[];
|
|
17
|
+
defaultExpanded?: Record<string, boolean>;
|
|
18
|
+
className?: string;
|
|
19
|
+
itemClassName?: string;
|
|
20
|
+
headerClassName?: string;
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
multiple?: boolean;
|
|
23
|
+
collapsible?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const Accordion: React.FC<AccordionProps>;
|
|
26
|
+
interface AccordionItemProps {
|
|
27
|
+
title: React.ReactNode;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
subtitle?: React.ReactNode;
|
|
31
|
+
badge?: React.ReactNode;
|
|
32
|
+
actions?: React.ReactNode;
|
|
33
|
+
hasFilter?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const AccordionItem: ({ title, children, icon, subtitle, badge, actions, hasFilter }: AccordionItemProps) => AccordionItemData;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AlertProps {
|
|
4
|
+
type?: 'success' | 'info' | 'warning' | 'error';
|
|
5
|
+
message: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
closeText?: React.ReactNode;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
action?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
size?: 'small' | 'default' | 'large' | number;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
src?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
shape?: 'circle' | 'square';
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type BadgeVariant = "success" | "low" | "warning" | "medium" | "danger" | "high" | "critical" | "neutral" | "default" | "outline";
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
variant?: BadgeVariant;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Badge: React.FC<BadgeProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive' | 'danger' | 'success' | 'link';
|
|
5
|
+
size?: 'small' | 'medium' | 'large' | 'sm' | 'md' | 'lg';
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
hoverable?: boolean;
|
|
9
|
+
size?: 'default' | 'small';
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
extra?: React.ReactNode;
|
|
12
|
+
cover?: React.ReactNode;
|
|
13
|
+
actions?: React.ReactNode[];
|
|
14
|
+
}
|
|
15
|
+
export declare const Card: React.FC<CardProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
label?: string;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export default Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ContextMenuProps {
|
|
4
|
+
trigger: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
align?: 'left' | 'center' | 'right';
|
|
7
|
+
className?: string;
|
|
8
|
+
contentClassName?: string;
|
|
9
|
+
offset?: number;
|
|
10
|
+
closeOnClick?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
14
|
+
interface ContextMenuItemProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
icon?: React.ReactNode;
|
|
20
|
+
shortcut?: string;
|
|
21
|
+
danger?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const ContextMenuItem: React.FC<ContextMenuItemProps>;
|
|
24
|
+
interface ContextMenuSeparatorProps {
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const ContextMenuSeparator: React.FC<ContextMenuSeparatorProps>;
|
|
28
|
+
interface ContextMenuLabelProps {
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const ContextMenuLabel: React.FC<ContextMenuLabelProps>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContextMenu, ContextMenuItem, ContextMenuSeparator, ContextMenuLabel } from './ContextMenu';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
/** Whether the dialog is open */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Callback when the dialog open state changes */
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
/** Dialog title */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** Whether to show the close button */
|
|
11
|
+
showCloseButton?: boolean;
|
|
12
|
+
/** Custom className for the dialog container */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Custom className for the overlay */
|
|
15
|
+
overlayClassName?: string;
|
|
16
|
+
/** Custom className for the content container */
|
|
17
|
+
contentClassName?: string;
|
|
18
|
+
/** Dialog content */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Custom header content (overrides title) */
|
|
21
|
+
header?: ReactNode;
|
|
22
|
+
/** Custom footer content */
|
|
23
|
+
footer?: ReactNode;
|
|
24
|
+
/** Whether clicking the overlay closes the dialog */
|
|
25
|
+
closeOnOverlayClick?: boolean;
|
|
26
|
+
/** Whether pressing Escape key closes the dialog */
|
|
27
|
+
closeOnEscapeKey?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const Dialog: React.FC<DialogProps>;
|
|
30
|
+
export declare const DialogHeader: React.FC<{
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const DialogBody: React.FC<{
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const DialogFooter: React.FC<{
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DividerProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
type?: 'horizontal' | 'vertical';
|
|
8
|
+
orientation?: 'left' | 'right' | 'center';
|
|
9
|
+
orientationMargin?: string | number;
|
|
10
|
+
dashed?: boolean;
|
|
11
|
+
plain?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Divider: React.FC<DividerProps>;
|