react-18-ui-library 0.1.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 +202 -0
- package/dist/components/actions/CopyButton/CopyButton.d.ts +14 -0
- package/dist/components/actions/CopyButton/index.d.ts +2 -0
- package/dist/components/display/Avatar/Avatar.d.ts +21 -0
- package/dist/components/display/Avatar/index.d.ts +2 -0
- package/dist/components/display/Badge/Badge.d.ts +20 -0
- package/dist/components/display/Badge/index.d.ts +2 -0
- package/dist/components/display/Box/Box.d.ts +18 -0
- package/dist/components/display/Box/index.d.ts +2 -0
- package/dist/components/display/Card/Card.d.ts +11 -0
- package/dist/components/display/Card/index.d.ts +2 -0
- package/dist/components/display/Collapsible/Collapsible.d.ts +15 -0
- package/dist/components/display/Collapsible/index.d.ts +2 -0
- package/dist/components/display/DataTable/DataTable.d.ts +46 -0
- package/dist/components/display/EmptyState/EmptyState.d.ts +10 -0
- package/dist/components/display/EmptyState/index.d.ts +2 -0
- package/dist/components/display/Icon/Icon.d.ts +9 -0
- package/dist/components/display/Icon/index.d.ts +2 -0
- package/dist/components/display/Image/Image.d.ts +15 -0
- package/dist/components/display/Image/index.d.ts +2 -0
- package/dist/components/display/List/List.d.ts +24 -0
- package/dist/components/display/List/index.d.ts +2 -0
- package/dist/components/display/MarkdownReader/MarkdownReader.d.ts +7 -0
- package/dist/components/display/SVG/SVG.d.ts +18 -0
- package/dist/components/display/SVG/index.d.ts +2 -0
- package/dist/components/display/Stat/Stat.d.ts +13 -0
- package/dist/components/display/Stat/index.d.ts +2 -0
- package/dist/components/display/Table/Table.d.ts +31 -0
- package/dist/components/display/Table/index.d.ts +2 -0
- package/dist/components/display/Tag/Tag.d.ts +16 -0
- package/dist/components/display/Tag/index.d.ts +2 -0
- package/dist/components/display/Timeline/Timeline.d.ts +15 -0
- package/dist/components/display/Timeline/index.d.ts +2 -0
- package/dist/components/display/TreeView/TreeView.d.ts +23 -0
- package/dist/components/display/TreeView/index.d.ts +2 -0
- package/dist/components/feedback/Alert/Alert.d.ts +15 -0
- package/dist/components/feedback/Alert/index.d.ts +2 -0
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.d.ts +18 -0
- package/dist/components/feedback/ErrorBoundary/index.d.ts +2 -0
- package/dist/components/feedback/FullScreenLoader/FullScreenLoader.d.ts +27 -0
- package/dist/components/feedback/ProgressBar/ProgressBar.d.ts +15 -0
- package/dist/components/feedback/ProgressBar/index.d.ts +2 -0
- package/dist/components/feedback/Skeleton/Skeleton.d.ts +16 -0
- package/dist/components/feedback/Skeleton/index.d.ts +2 -0
- package/dist/components/feedback/Spinner/Spinner.d.ts +9 -0
- package/dist/components/feedback/Spinner/index.d.ts +2 -0
- package/dist/components/feedback/Toast/Toast.d.ts +7 -0
- package/dist/components/feedback/Toast/index.d.ts +2 -0
- package/dist/components/forms/FileUpload/FileUpload.d.ts +24 -0
- package/dist/components/forms/FileUpload/index.d.ts +2 -0
- package/dist/components/forms/FormField/FormField.d.ts +12 -0
- package/dist/components/forms/FormField/index.d.ts +2 -0
- package/dist/components/forms/JSONForm/FormValidator.d.ts +157 -0
- package/dist/components/forms/JSONForm/JSONForm.d.ts +53 -0
- package/dist/components/forms/JSONForm/index.d.ts +4 -0
- package/dist/components/inputs/Button/Button.d.ts +15 -0
- package/dist/components/inputs/Button/index.d.ts +2 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +14 -0
- package/dist/components/inputs/Checkbox/index.d.ts +2 -0
- package/dist/components/inputs/ChipSelect/ChipSelect.d.ts +24 -0
- package/dist/components/inputs/DatePicker/DatePicker.d.ts +39 -0
- package/dist/components/inputs/DatePicker/index.d.ts +2 -0
- package/dist/components/inputs/IconButton/IconButton.d.ts +14 -0
- package/dist/components/inputs/IconButton/index.d.ts +2 -0
- package/dist/components/inputs/MultiSelect/MultiSelect.d.ts +35 -0
- package/dist/components/inputs/MultiSelect/index.d.ts +2 -0
- package/dist/components/inputs/NumberInput/NumberInput.d.ts +23 -0
- package/dist/components/inputs/NumberInput/index.d.ts +2 -0
- package/dist/components/inputs/OTPInput/OTPInput.d.ts +18 -0
- package/dist/components/inputs/OTPInput/index.d.ts +2 -0
- package/dist/components/inputs/PhoneInput/PhoneInput.d.ts +35 -0
- package/dist/components/inputs/PhoneInput/index.d.ts +2 -0
- package/dist/components/inputs/Radio/Radio.d.ts +20 -0
- package/dist/components/inputs/Radio/index.d.ts +2 -0
- package/dist/components/inputs/Rating/Rating.d.ts +19 -0
- package/dist/components/inputs/Rating/index.d.ts +2 -0
- package/dist/components/inputs/SearchSelect/SearchSelect.d.ts +39 -0
- package/dist/components/inputs/Select/Select.d.ts +25 -0
- package/dist/components/inputs/Select/index.d.ts +2 -0
- package/dist/components/inputs/Slider/Slider.d.ts +20 -0
- package/dist/components/inputs/Slider/index.d.ts +2 -0
- package/dist/components/inputs/Switch/Switch.d.ts +14 -0
- package/dist/components/inputs/Switch/index.d.ts +2 -0
- package/dist/components/inputs/TagInput/TagInput.d.ts +17 -0
- package/dist/components/inputs/TextArea/TextArea.d.ts +18 -0
- package/dist/components/inputs/TextArea/index.d.ts +2 -0
- package/dist/components/inputs/TextField/TextField.d.ts +21 -0
- package/dist/components/inputs/TextField/index.d.ts +2 -0
- package/dist/components/layout/AppShell/AppShell.d.ts +12 -0
- package/dist/components/layout/AppShell/index.d.ts +2 -0
- package/dist/components/layout/Container/Container.d.ts +8 -0
- package/dist/components/layout/Container/index.d.ts +2 -0
- package/dist/components/layout/Divider/Divider.d.ts +10 -0
- package/dist/components/layout/Divider/index.d.ts +2 -0
- package/dist/components/layout/Grid/Grid.d.ts +13 -0
- package/dist/components/layout/Grid/index.d.ts +2 -0
- package/dist/components/layout/Navbar/Navbar.d.ts +19 -0
- package/dist/components/layout/Navbar/index.d.ts +2 -0
- package/dist/components/layout/Sidebar/Sidebar.d.ts +24 -0
- package/dist/components/layout/Sidebar/index.d.ts +2 -0
- package/dist/components/layout/Spacer/Spacer.d.ts +6 -0
- package/dist/components/layout/Spacer/index.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.d.ts +14 -0
- package/dist/components/layout/Stack/index.d.ts +2 -0
- package/dist/components/navigation/Breadcrumb/Breadcrumb.d.ts +13 -0
- package/dist/components/navigation/Breadcrumb/index.d.ts +2 -0
- package/dist/components/navigation/Pagination/Pagination.d.ts +10 -0
- package/dist/components/navigation/Pagination/index.d.ts +2 -0
- package/dist/components/navigation/StepIndicator/StepIndicator.d.ts +15 -0
- package/dist/components/navigation/StepIndicator/index.d.ts +2 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts +25 -0
- package/dist/components/navigation/Tabs/index.d.ts +2 -0
- package/dist/components/overlay/CommandPalette/CommandPalette.d.ts +35 -0
- package/dist/components/overlay/CommandPalette/index.d.ts +2 -0
- package/dist/components/overlay/ConfirmDialog/ConfirmDialog.d.ts +20 -0
- package/dist/components/overlay/ContextMenu/ContextMenu.d.ts +19 -0
- package/dist/components/overlay/ContextMenu/index.d.ts +2 -0
- package/dist/components/overlay/Drawer/Drawer.d.ts +18 -0
- package/dist/components/overlay/Drawer/index.d.ts +2 -0
- package/dist/components/overlay/Modal/Modal.d.ts +17 -0
- package/dist/components/overlay/Modal/index.d.ts +2 -0
- package/dist/components/overlay/Popover/Popover.d.ts +15 -0
- package/dist/components/overlay/Popover/index.d.ts +2 -0
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +13 -0
- package/dist/components/overlay/Tooltip/index.d.ts +2 -0
- package/dist/components/typography/Code/Code.d.ts +11 -0
- package/dist/components/typography/Code/index.d.ts +2 -0
- package/dist/components/typography/Heading/Heading.d.ts +12 -0
- package/dist/components/typography/Heading/index.d.ts +2 -0
- package/dist/components/typography/Kbd/Kbd.d.ts +8 -0
- package/dist/components/typography/Kbd/index.d.ts +2 -0
- package/dist/components/typography/Label/Label.d.ts +8 -0
- package/dist/components/typography/Label/index.d.ts +2 -0
- package/dist/components/typography/Link/Link.d.ts +9 -0
- package/dist/components/typography/Link/index.d.ts +2 -0
- package/dist/components/typography/Text/Text.d.ts +16 -0
- package/dist/components/typography/Text/index.d.ts +2 -0
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useClipboard.d.ts +11 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +5 -0
- package/dist/hooks/useKeyboard.d.ts +9 -0
- package/dist/hooks/useLocalStorage.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useTheme.d.ts +4 -0
- package/dist/hooks/useToast.d.ts +16 -0
- package/dist/hooks/useWindowSize.d.ts +8 -0
- package/dist/index.cjs.js +3639 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1587 -0
- package/dist/index.esm.js +3512 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/theme/ThemeProvider.d.ts +59 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +112 -0
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# react-18-ui-library
|
|
2
|
+
|
|
3
|
+
A fully customizable, theme-aware React 18 enterprise UI component library. All components consume CSS custom properties from the parent app's `:root` — no hardcoded colors, no runtime CSS-in-JS overhead.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install react-18-ui-library
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// 1. Import the default theme tokens (fallback values)
|
|
13
|
+
import 'react-18-ui-library/styles'
|
|
14
|
+
|
|
15
|
+
// 2. Use components directly — they read CSS vars from your app's :root
|
|
16
|
+
import { Button, TextField, AppShell } from 'react-18-ui-library'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Theme System
|
|
20
|
+
|
|
21
|
+
Components read CSS custom properties from the parent app's `:root`. Override any token in your app's CSS:
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
/* your-app/globals.css */
|
|
25
|
+
:root {
|
|
26
|
+
--color-primary: #7c3aed;
|
|
27
|
+
--color-primary-hover: #6d28d9;
|
|
28
|
+
--color-primary-foreground: #ffffff;
|
|
29
|
+
--color-background: #fafafa;
|
|
30
|
+
--color-surface: #ffffff;
|
|
31
|
+
--color-text: #111827;
|
|
32
|
+
--radius-md: 0.5rem;
|
|
33
|
+
--font-family-base: 'Inter', sans-serif;
|
|
34
|
+
/* ...etc */
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or use the optional `ThemeProvider` to set tokens programmatically:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { ThemeProvider } from 'react-18-ui-library'
|
|
42
|
+
|
|
43
|
+
<ThemeProvider tokens={{ colorPrimary: '#7c3aed', radiusMd: '0.5rem' }}>
|
|
44
|
+
<App />
|
|
45
|
+
</ThemeProvider>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Component Categories
|
|
49
|
+
|
|
50
|
+
| Category | Components |
|
|
51
|
+
|---|---|
|
|
52
|
+
| **Layout** | `AppShell`, `Navbar`, `Sidebar`, `Container`, `Stack`, `Grid`, `Divider`, `Spacer` |
|
|
53
|
+
| **Navigation** | `Tabs`, `Breadcrumb`, `Pagination`, `StepIndicator` |
|
|
54
|
+
| **Inputs** | `Button`, `IconButton`, `TextField`, `TextArea`, `Select`, `Checkbox`, `RadioGroup`, `Switch` |
|
|
55
|
+
| **Forms** | `FormField`, `JSONForm`, `FileUpload` |
|
|
56
|
+
| **Display** | `Card`, `Box`, `Image`, `Avatar`, `Badge`, `Tag`, `Icon`, `SVG`, `Table`, `List`, `Timeline`, `Stat`, `EmptyState` |
|
|
57
|
+
| **Feedback** | `Alert`, `ToastProvider`, `Spinner`, `Skeleton`, `ProgressBar`, `ErrorBoundary` |
|
|
58
|
+
| **Overlay** | `Modal`, `Drawer`, `Tooltip`, `Popover`, `ContextMenu` |
|
|
59
|
+
| **Typography** | `Heading`, `Text`, `Label`, `Code`, `Link` |
|
|
60
|
+
|
|
61
|
+
## Key Components
|
|
62
|
+
|
|
63
|
+
### AppShell — Full Layout
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { AppShell } from 'react-18-ui-library'
|
|
67
|
+
import { LayoutDashboard, Users, Settings } from 'lucide-react'
|
|
68
|
+
|
|
69
|
+
<AppShell
|
|
70
|
+
navbar={{
|
|
71
|
+
logo: <Logo />,
|
|
72
|
+
links: [{ label: 'Home', href: '/', active: true }],
|
|
73
|
+
actions: <Button size="sm">Sign Out</Button>,
|
|
74
|
+
}}
|
|
75
|
+
sidebar={{
|
|
76
|
+
items: [
|
|
77
|
+
{ id: 'dash', label: 'Dashboard', icon: <LayoutDashboard size={16} />, active: true },
|
|
78
|
+
{ id: 'users', label: 'Users', icon: <Users size={16} />, badge: 5 },
|
|
79
|
+
{ id: 'settings', label: 'Settings', icon: <Settings size={16} /> },
|
|
80
|
+
],
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<main>Your page content</main>
|
|
84
|
+
</AppShell>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### TextField — Prefix / Suffix
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<TextField
|
|
91
|
+
label="Amount"
|
|
92
|
+
prefixText="$"
|
|
93
|
+
suffixText="USD"
|
|
94
|
+
placeholder="0.00"
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<TextField
|
|
98
|
+
label="Search"
|
|
99
|
+
prefixIcon={<Search size={14} />}
|
|
100
|
+
clearable
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<TextField
|
|
104
|
+
label="Phone"
|
|
105
|
+
prefixImage="/flags/us.png"
|
|
106
|
+
prefixText="+1"
|
|
107
|
+
type="tel"
|
|
108
|
+
/>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### JSONForm — Schema-Driven Forms
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { JSONForm } from 'react-18-ui-library'
|
|
115
|
+
import type { JSONFormField } from 'react-18-ui-library'
|
|
116
|
+
|
|
117
|
+
const schema: JSONFormField[] = [
|
|
118
|
+
{ name: 'name', type: 'text', label: 'Full Name', required: true, prefixIcon: <User size={14} /> },
|
|
119
|
+
{ name: 'email', type: 'email', label: 'Email', required: true, prefixIcon: <Mail size={14} /> },
|
|
120
|
+
{ name: 'role', type: 'select', label: 'Role', options: [{ value: 'admin', label: 'Admin' }] },
|
|
121
|
+
{ name: 'bio', type: 'textarea', label: 'Bio', showCharCount: true, validation: { maxLength: 200 } },
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
<JSONForm
|
|
125
|
+
schema={schema}
|
|
126
|
+
columns={2}
|
|
127
|
+
onSubmit={(data) => console.log(data)}
|
|
128
|
+
submitLabel="Save"
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### FileUpload — Drag & Drop
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { FileUpload } from 'react-18-ui-library'
|
|
136
|
+
|
|
137
|
+
<FileUpload
|
|
138
|
+
label="Upload Documents"
|
|
139
|
+
accept={{ 'image/*': ['.png', '.jpg'], 'application/pdf': ['.pdf'] }}
|
|
140
|
+
maxSize={5 * 1024 * 1024}
|
|
141
|
+
maxFiles={10}
|
|
142
|
+
files={files}
|
|
143
|
+
onFilesChange={setFiles}
|
|
144
|
+
onFileRemove={(id) => setFiles(prev => prev.filter(f => f.id !== id))}
|
|
145
|
+
/>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Toast Notifications
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { ToastProvider, useToast } from 'react-18-ui-library'
|
|
152
|
+
|
|
153
|
+
// Wrap your app
|
|
154
|
+
<ToastProvider toasts={toasts} onDismiss={dismiss} position="bottom-right" />
|
|
155
|
+
|
|
156
|
+
// In any component
|
|
157
|
+
const { toast } = useToast()
|
|
158
|
+
toast({ title: 'Saved!', description: 'Changes saved successfully.', variant: 'success' })
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Development
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Install dependencies
|
|
165
|
+
npm install
|
|
166
|
+
|
|
167
|
+
# Start Storybook
|
|
168
|
+
npm run dev
|
|
169
|
+
|
|
170
|
+
# Build library
|
|
171
|
+
npm run build
|
|
172
|
+
|
|
173
|
+
# Run tests
|
|
174
|
+
npm test
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## CSS Token Reference
|
|
178
|
+
|
|
179
|
+
| Token | Default | Purpose |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| `--color-primary` | `#6366f1` | Primary brand color |
|
|
182
|
+
| `--color-background` | `#f8fafc` | Page background |
|
|
183
|
+
| `--color-surface` | `#ffffff` | Card/panel background |
|
|
184
|
+
| `--color-text` | `#0f172a` | Primary text |
|
|
185
|
+
| `--color-text-muted` | `#64748b` | Secondary text |
|
|
186
|
+
| `--color-border` | `#e2e8f0` | Border color |
|
|
187
|
+
| `--color-error` | `#ef4444` | Error state |
|
|
188
|
+
| `--color-success` | `#22c55e` | Success state |
|
|
189
|
+
| `--radius-md` | `0.375rem` | Default border radius |
|
|
190
|
+
| `--font-family-base` | system-ui | Base font |
|
|
191
|
+
| `--navbar-height` | `64px` | Navbar height |
|
|
192
|
+
| `--sidebar-width` | `260px` | Sidebar expanded width |
|
|
193
|
+
| `--sidebar-collapsed-width` | `64px` | Sidebar collapsed width |
|
|
194
|
+
|
|
195
|
+
## Peer Dependencies
|
|
196
|
+
|
|
197
|
+
- `react >= 18.0.0`
|
|
198
|
+
- `react-dom >= 18.0.0`
|
|
199
|
+
|
|
200
|
+
## License
|
|
201
|
+
|
|
202
|
+
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CopyButtonSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export type CopyButtonVariant = 'ghost' | 'outline' | 'solid';
|
|
3
|
+
export interface CopyButtonProps {
|
|
4
|
+
value: string;
|
|
5
|
+
size?: CopyButtonSize;
|
|
6
|
+
variant?: CopyButtonVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
copiedLabel?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
onCopy?: (value: string) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function CopyButton({ value, size, variant, label, copiedLabel, timeout, onCopy, className, disabled, }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export type AvatarStatus = 'online' | 'offline' | 'away' | 'busy';
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
src?: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
size?: AvatarSize;
|
|
10
|
+
status?: AvatarStatus;
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AvatarGroupProps {
|
|
15
|
+
avatars: AvatarProps[];
|
|
16
|
+
max?: number;
|
|
17
|
+
size?: AvatarSize;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function Avatar({ src, alt, name, icon, size, status, rounded, className, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function AvatarGroup({ avatars, max, size, className }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "error" | "info" | "success" | "warning" | "primary" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
dot?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface BadgeProps extends VariantProps<typeof badgeVariants> {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Badge({ variant, size, dot, children, className }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export interface BadgeAnchorProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
badge?: React.ReactNode;
|
|
16
|
+
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function BadgeAnchor({ children, badge, position, className }: BadgeAnchorProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BoxProps {
|
|
3
|
+
as?: 'div' | 'section' | 'article' | 'aside' | 'main' | 'header' | 'footer' | 'nav' | 'span' | 'p';
|
|
4
|
+
bg?: 'surface' | 'background' | 'primary' | 'secondary' | 'error' | 'success' | 'warning' | 'info';
|
|
5
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
6
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg';
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
id?: string;
|
|
13
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
14
|
+
role?: string;
|
|
15
|
+
tabIndex?: number;
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Box({ as: Component, bg, rounded, shadow, bordered, padding, className, children, ...props }: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
header?: React.ReactNode;
|
|
4
|
+
footer?: React.ReactNode;
|
|
5
|
+
hoverable?: boolean;
|
|
6
|
+
clickable?: boolean;
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg';
|
|
9
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
10
|
+
}
|
|
11
|
+
export declare function Card({ header, footer, hoverable, clickable, bordered, shadow, padding, className, children, onClick, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CollapsibleProps {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
variant?: 'default' | 'bordered' | 'filled';
|
|
11
|
+
className?: string;
|
|
12
|
+
triggerClassName?: string;
|
|
13
|
+
contentClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Collapsible({ title, children, defaultOpen, open: controlledOpen, onOpenChange, disabled, icon, variant, className, triggerClassName, contentClassName, }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
3
|
+
export interface DataTableColumn<T = Record<string, unknown>> {
|
|
4
|
+
key: string;
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
accessor?: (row: T) => React.ReactNode;
|
|
7
|
+
sortValue?: (row: T) => string | number;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
width?: string | number;
|
|
10
|
+
align?: 'left' | 'center' | 'right';
|
|
11
|
+
className?: string;
|
|
12
|
+
pin?: 'left' | 'right';
|
|
13
|
+
}
|
|
14
|
+
export interface DataTablePagination {
|
|
15
|
+
mode: 'client' | 'server';
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
pageSizeOptions?: number[];
|
|
18
|
+
totalRows?: number;
|
|
19
|
+
page?: number;
|
|
20
|
+
onPageChange?: (page: number) => void;
|
|
21
|
+
onPageSizeChange?: (size: number) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface DataTableProps<T = Record<string, unknown>> {
|
|
24
|
+
columns: DataTableColumn<T>[];
|
|
25
|
+
data: T[];
|
|
26
|
+
keyExtractor: (row: T, index: number) => string;
|
|
27
|
+
selectable?: boolean;
|
|
28
|
+
selectedKeys?: string[];
|
|
29
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
30
|
+
sortKey?: string;
|
|
31
|
+
sortDirection?: SortDirection;
|
|
32
|
+
onSortChange?: (key: string, direction: SortDirection) => void;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
emptyMessage?: React.ReactNode;
|
|
35
|
+
stickyHeader?: boolean;
|
|
36
|
+
striped?: boolean;
|
|
37
|
+
hoverable?: boolean;
|
|
38
|
+
bordered?: boolean;
|
|
39
|
+
compact?: boolean;
|
|
40
|
+
className?: string;
|
|
41
|
+
pagination?: DataTablePagination;
|
|
42
|
+
toolbar?: React.ReactNode;
|
|
43
|
+
rowActions?: (row: T) => React.ReactNode;
|
|
44
|
+
caption?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function DataTable<T = Record<string, unknown>>({ columns, data, keyExtractor, selectable, selectedKeys, onSelectionChange, sortKey, sortDirection, onSortChange, loading, emptyMessage, stickyHeader, striped, hoverable, bordered, compact, className, pagination, toolbar, rowActions, caption, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
illustration?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
action?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function EmptyState({ title, description, illustration, icon, action, className, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LucideIcon, type LucideProps } from 'lucide-react';
|
|
2
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface IconProps extends Omit<LucideProps, 'size'> {
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
size?: IconSize | number;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Icon({ icon: LucideIconComponent, size, color, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ImageFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
3
|
+
export type ImageRatio = '1/1' | '4/3' | '16/9' | '3/2' | '2/3' | 'auto';
|
|
4
|
+
export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src'> {
|
|
5
|
+
src: string;
|
|
6
|
+
fallbackSrc?: string;
|
|
7
|
+
fallbackIcon?: React.ReactNode;
|
|
8
|
+
fit?: ImageFit;
|
|
9
|
+
ratio?: ImageRatio;
|
|
10
|
+
lazy?: boolean;
|
|
11
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
12
|
+
blur?: boolean;
|
|
13
|
+
containerClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Image({ src, fallbackSrc, fallbackIcon, fit, ratio, lazy, rounded, blur, containerClassName, className, alt, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ListItemProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
primary: React.ReactNode;
|
|
5
|
+
secondary?: React.ReactNode;
|
|
6
|
+
leading?: React.ReactNode;
|
|
7
|
+
trailing?: React.ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
divider?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ListProps {
|
|
15
|
+
items?: ListItemProps[];
|
|
16
|
+
ordered?: boolean;
|
|
17
|
+
divided?: boolean;
|
|
18
|
+
hoverable?: boolean;
|
|
19
|
+
compact?: boolean;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function ListItem({ primary, secondary, leading, trailing, onClick, active, disabled, divider, className, }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function List({ items, ordered, divided, hoverable, compact, children, className, }: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MarkdownReaderProps {
|
|
2
|
+
children: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
codeTheme?: 'dark' | 'light';
|
|
5
|
+
showLineNumbers?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function MarkdownReader({ children, className, codeTheme, showLineNumbers, }: MarkdownReaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SVGProps {
|
|
3
|
+
src?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
size?: number | string;
|
|
8
|
+
color?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
14
|
+
viewBox?: string;
|
|
15
|
+
fill?: string;
|
|
16
|
+
stroke?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function SVG({ src, children, width, height, size, color, className, title, role, viewBox, fill, stroke, ...props }: SVGProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface StatProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: React.ReactNode;
|
|
5
|
+
delta?: number;
|
|
6
|
+
deltaLabel?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
iconBg?: 'primary' | 'success' | 'error' | 'warning' | 'info';
|
|
9
|
+
description?: string;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Stat({ label, value, delta, deltaLabel, icon, iconBg, description, loading, className, }: StatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
3
|
+
export interface TableColumn<T = Record<string, unknown>> {
|
|
4
|
+
key: string;
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
accessor?: (row: T) => React.ReactNode;
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
width?: string | number;
|
|
9
|
+
align?: 'left' | 'center' | 'right';
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TableProps<T = Record<string, unknown>> {
|
|
13
|
+
columns: TableColumn<T>[];
|
|
14
|
+
data: T[];
|
|
15
|
+
keyExtractor: (row: T, index: number) => string;
|
|
16
|
+
selectable?: boolean;
|
|
17
|
+
selectedKeys?: string[];
|
|
18
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
19
|
+
sortKey?: string;
|
|
20
|
+
sortDirection?: SortDirection;
|
|
21
|
+
onSortChange?: (key: string, direction: SortDirection) => void;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
emptyMessage?: React.ReactNode;
|
|
24
|
+
stickyHeader?: boolean;
|
|
25
|
+
striped?: boolean;
|
|
26
|
+
hoverable?: boolean;
|
|
27
|
+
bordered?: boolean;
|
|
28
|
+
compact?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function Table<T = Record<string, unknown>>({ columns, data, keyExtractor, selectable, selectedKeys, onSelectionChange, sortKey, sortDirection, onSortChange, loading, emptyMessage, stickyHeader, striped, hoverable, bordered, compact, className, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const tagVariants: (props?: ({
|
|
4
|
+
variant?: "error" | "info" | "success" | "warning" | "default" | "primary" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
rounded?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface TagProps extends VariantProps<typeof tagVariants> {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
removable?: boolean;
|
|
12
|
+
onRemove?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Tag({ variant, size, rounded, children, icon, removable, onRemove, className }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TimelineItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
timestamp?: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
variant?: 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
9
|
+
}
|
|
10
|
+
export interface TimelineProps {
|
|
11
|
+
items: TimelineItem[];
|
|
12
|
+
orientation?: 'vertical' | 'horizontal';
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Timeline({ items, orientation, className }: TimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TreeViewItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
children?: TreeViewItem[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
badge?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface TreeViewProps {
|
|
11
|
+
items: TreeViewItem[];
|
|
12
|
+
selectedId?: string;
|
|
13
|
+
onSelect?: (id: string, item: TreeViewItem) => void;
|
|
14
|
+
defaultExpandedIds?: string[];
|
|
15
|
+
expandedIds?: string[];
|
|
16
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
17
|
+
multiSelect?: boolean;
|
|
18
|
+
selectedIds?: string[];
|
|
19
|
+
onMultiSelect?: (ids: string[]) => void;
|
|
20
|
+
indent?: number;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function TreeView({ items, selectedId, onSelect, defaultExpandedIds, expandedIds: controlledExpandedIds, onExpandedChange, multiSelect, selectedIds, onMultiSelect, indent, className, }: TreeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "error" | "info" | "success" | "warning" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface AlertProps extends VariantProps<typeof alertVariants> {
|
|
7
|
+
title?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
dismissible?: boolean;
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Alert({ variant, title, children, dismissible, onDismiss, icon, className, }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export {};
|