@tqc-solution/design-system 0.1.73
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 +207 -0
- package/dist/assets/icon/IconAi.d.ts +3 -0
- package/dist/assets/icon/IconAlertTriangleSolid.d.ts +3 -0
- package/dist/assets/icon/IconAudio.d.ts +3 -0
- package/dist/assets/icon/IconCalendar.d.ts +3 -0
- package/dist/assets/icon/IconCaretDown.d.ts +3 -0
- package/dist/assets/icon/IconCheck.d.ts +3 -0
- package/dist/assets/icon/IconCheckCircleSolid.d.ts +3 -0
- package/dist/assets/icon/IconChevronLeft.d.ts +3 -0
- package/dist/assets/icon/IconChevronRight.d.ts +3 -0
- package/dist/assets/icon/IconCircleArrowLeftSolid.d.ts +3 -0
- package/dist/assets/icon/IconCircleArrowRightSolid.d.ts +3 -0
- package/dist/assets/icon/IconClock.d.ts +3 -0
- package/dist/assets/icon/IconClose.d.ts +3 -0
- package/dist/assets/icon/IconCloseCircleSolid.d.ts +3 -0
- package/dist/assets/icon/IconColumns.d.ts +3 -0
- package/dist/assets/icon/IconCopy.d.ts +3 -0
- package/dist/assets/icon/IconDelete.d.ts +3 -0
- package/dist/assets/icon/IconDocument.d.ts +3 -0
- package/dist/assets/icon/IconExcel.d.ts +3 -0
- package/dist/assets/icon/IconEye.d.ts +3 -0
- package/dist/assets/icon/IconEyeSlash.d.ts +3 -0
- package/dist/assets/icon/IconFile.d.ts +3 -0
- package/dist/assets/icon/IconFolder.d.ts +3 -0
- package/dist/assets/icon/IconImg.d.ts +3 -0
- package/dist/assets/icon/IconInfoSolid.d.ts +3 -0
- package/dist/assets/icon/IconPdf.d.ts +3 -0
- package/dist/assets/icon/IconPowerPoint.d.ts +3 -0
- package/dist/assets/icon/IconPts.d.ts +3 -0
- package/dist/assets/icon/IconSearch.d.ts +3 -0
- package/dist/assets/icon/IconSmallCaretRightSolid.d.ts +3 -0
- package/dist/assets/icon/IconTemplate.d.ts +3 -0
- package/dist/assets/icon/IconTxt.d.ts +3 -0
- package/dist/assets/icon/IconUpload.d.ts +3 -0
- package/dist/assets/icon/IconVideo.d.ts +3 -0
- package/dist/assets/icon/IconWord.d.ts +3 -0
- package/dist/assets/icon/IconZip.d.ts +3 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +37 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +37 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/CardTable/CardTable.d.ts +87 -0
- package/dist/components/CardTable/index.d.ts +2 -0
- package/dist/components/Chart/BarChart/BarChart.d.ts +40 -0
- package/dist/components/Chart/BarChart/index.d.ts +2 -0
- package/dist/components/Chart/HorizontalBarChart/HorizontalBarChart.d.ts +32 -0
- package/dist/components/Chart/HorizontalBarChart/index.d.ts +2 -0
- package/dist/components/Chart/LineChart/LineChart.d.ts +48 -0
- package/dist/components/Chart/LineChart/index.d.ts +2 -0
- package/dist/components/Chart/MultiLineAndBarChart/MultiLineAndBarChart.d.ts +57 -0
- package/dist/components/Chart/MultiLineAndBarChart/index.d.ts +2 -0
- package/dist/components/Chart/MultilineChart/MultilineChart.d.ts +25 -0
- package/dist/components/Chart/MultilineChart/index.d.ts +2 -0
- package/dist/components/Chart/PieChart/PieChart.d.ts +20 -0
- package/dist/components/Chart/PieChart/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker/DatePicker.d.ts +24 -0
- package/dist/components/DatePicker/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/DateRangePicker/DateRangePicker.d.ts +34 -0
- package/dist/components/DatePicker/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/MonthPicker/MonthPicker.d.ts +20 -0
- package/dist/components/DatePicker/MonthPicker/index.d.ts +2 -0
- package/dist/components/DatePicker/TimePicker/TimePicker.d.ts +20 -0
- package/dist/components/DatePicker/TimePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/YearPicker/YearPicker.d.ts +20 -0
- package/dist/components/DatePicker/YearPicker/index.d.ts +2 -0
- package/dist/components/Editor/Editor.d.ts +16 -0
- package/dist/components/Editor/index.d.ts +2 -0
- package/dist/components/EditorHtml/EditorHtml.d.ts +35 -0
- package/dist/components/EditorHtml/index.d.ts +2 -0
- package/dist/components/EditorJs/EditorJs.d.ts +35 -0
- package/dist/components/EditorJs/index.d.ts +2 -0
- package/dist/components/Input/InputForm/InputForm.d.ts +42 -0
- package/dist/components/Input/InputForm/index.d.ts +2 -0
- package/dist/components/Input/InputFormSpecial/InputFormSpecial.d.ts +110 -0
- package/dist/components/Input/InputFormSpecial/index.d.ts +2 -0
- package/dist/components/Input/InputOTP/InputOTP.d.ts +29 -0
- package/dist/components/Input/InputOTP/index.d.ts +2 -0
- package/dist/components/Input/InputSearch/InputSearch.d.ts +34 -0
- package/dist/components/Input/InputSearch/index.d.ts +2 -0
- package/dist/components/InputText/InputText.d.ts +56 -0
- package/dist/components/InputText/index.d.ts +2 -0
- package/dist/components/Loading/Loading.d.ts +19 -0
- package/dist/components/Loading/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +49 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +24 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +21 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +17 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +37 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/TabBar/TabBar.d.ts +18 -0
- package/dist/components/TabBar/index.d.ts +2 -0
- package/dist/components/TabBarGroup/TabBarGroup.d.ts +32 -0
- package/dist/components/TabBarGroup/index.d.ts +2 -0
- package/dist/components/Tag/Tag.d.ts +45 -0
- package/dist/components/Tag/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +9 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts +17 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Typography/Typography.d.ts +16 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/components/Upload/Upload.d.ts +49 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/index-BcEf-eHA.js +228 -0
- package/dist/index-BhBGF4B7.cjs +11 -0
- package/dist/index-DU1rSsif.js +548 -0
- package/dist/index-b5gz6Ifp.cjs +1 -0
- package/dist/index.cjs.js +58 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.es.js +8045 -0
- package/dist/pubfuture.css +188 -0
- package/dist/quill-CqfsVyV-.js +7529 -0
- package/dist/quill-DqFubOCp.cjs +49 -0
- package/dist/tailwind/index.d.ts +4 -0
- package/dist/tailwind/index.js +2 -0
- package/dist/tailwind/pubfuture.preset.d.ts +4 -0
- package/dist/tailwind/pubfuture.preset.js +217 -0
- package/dist/types.d.ts +6 -0
- package/package.json +100 -0
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# @tqc-solution/design-system
|
|
2
|
+
|
|
3
|
+
A production-ready React Design System with **multi-theme support**, **CSS variables**, and **Tailwind preset** integration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **Multi-theme support** - PubFuture and OIO themes
|
|
8
|
+
- 🎯 **CSS Variables** - All design tokens exposed as CSS variables
|
|
9
|
+
- ⚡ **Tailwind Preset** - Seamless Tailwind CSS integration
|
|
10
|
+
- 📦 **Auto-injected CSS** - No manual CSS imports needed
|
|
11
|
+
- 🔧 **TypeScript** - Full TypeScript support
|
|
12
|
+
- ⚛️ **React 18/19** - Compatible with React 18 and 19
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Install the package with your preferred theme tag:
|
|
19
|
+
|
|
20
|
+
### PubFuture Theme
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm i @tqc-solution/design-system@pubfuture
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### OIO Theme
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm i @tqc-solution/design-system@oio
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
All theme CSS is **automatically injected** into your bundle, so **no manual CSS import is needed**.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
// App.tsx
|
|
40
|
+
import { Button } from '@tqc-solution/design-system';
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<Button type="primary" size="large" label="Click me" />
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Components
|
|
54
|
+
|
|
55
|
+
### Button
|
|
56
|
+
|
|
57
|
+
A versatile button component with multiple variants and sizes.
|
|
58
|
+
|
|
59
|
+
#### Import
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Button } from '@tqc-solution/design-system';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Usage Examples
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
// Basic primary button
|
|
69
|
+
<Button type="primary" size="large" label="Primary" />
|
|
70
|
+
|
|
71
|
+
// Secondary variant
|
|
72
|
+
<Button variant="secondary" label="Secondary" />
|
|
73
|
+
|
|
74
|
+
// Text button
|
|
75
|
+
<Button variant="text" label="Text" />
|
|
76
|
+
|
|
77
|
+
// Link style button
|
|
78
|
+
<Button variant="link" href="/about" label="Go to about" />
|
|
79
|
+
|
|
80
|
+
// With icon
|
|
81
|
+
<Button startIcon={<Icon />} label="With icon" />
|
|
82
|
+
|
|
83
|
+
// Disabled state
|
|
84
|
+
<Button disabled label="Disabled" />
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Props
|
|
88
|
+
|
|
89
|
+
| Prop | Type | Default | Description |
|
|
90
|
+
|------|------|---------|-------------|
|
|
91
|
+
| `label` | `string` | - | Button text label |
|
|
92
|
+
| `variant` | `'primary' \| 'secondary' \| 'text' \| 'link' \| 'negative-primary' \| 'negative-secondary'` | `'primary'` | Button style variant |
|
|
93
|
+
| `size` | `'large' \| 'medium' \| 'full'` | `'large'` | Button size |
|
|
94
|
+
| `startIcon` | `ReactNode` | - | Icon displayed at the start of the button |
|
|
95
|
+
| `endIcon` | `ReactNode` | - | Icon displayed at the end of the button |
|
|
96
|
+
| `href` | `string` | - | Only used when `variant="link"` |
|
|
97
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## CSS Variables
|
|
102
|
+
|
|
103
|
+
The Design System exposes all **design tokens** as CSS variables on `:root`, making them available throughout your application.
|
|
104
|
+
|
|
105
|
+
### Available Variables
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
:root {
|
|
109
|
+
--background-fill-negative: #E84118;
|
|
110
|
+
--background-fill-brand: #3FAE3B;
|
|
111
|
+
--text-primary: #000000;
|
|
112
|
+
--spacing-16: 16px;
|
|
113
|
+
--radius-8: 8px;
|
|
114
|
+
/* ... and many more */
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Usage in Your CSS
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
/* example.css */
|
|
122
|
+
.danger-box {
|
|
123
|
+
background-color: var(--background-fill-negative);
|
|
124
|
+
color: var(--text-inverse);
|
|
125
|
+
padding: var(--spacing-16);
|
|
126
|
+
border-radius: var(--radius-8);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.card {
|
|
130
|
+
background-color: var(--background-fill-primary);
|
|
131
|
+
box-shadow: var(--shadow-shadow-md);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
> **Note:** Variable names do **not** include a `color-` prefix. Use `var(--background-fill-negative)`, **not** `var(--color-background-fill-negative)`. Variables are available immediately after importing any component from `@tqc-solution/design-system`.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Tailwind CSS Integration
|
|
140
|
+
|
|
141
|
+
The package provides a **Tailwind preset** for each theme, allowing you to use design system tokens directly in your Tailwind classes.
|
|
142
|
+
|
|
143
|
+
### Theme Mapping
|
|
144
|
+
|
|
145
|
+
- `@tqc-solution/design-system@pubfuture` → PubFuture preset
|
|
146
|
+
- `@tqc-solution/design-system@oio` → OIO preset
|
|
147
|
+
|
|
148
|
+
### Configuration
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
// tailwind.config.js
|
|
152
|
+
import tqcPreset from '@tqc-solution/design-system/tailwind';
|
|
153
|
+
|
|
154
|
+
/** @type {import('tailwindcss').Config} */
|
|
155
|
+
export default {
|
|
156
|
+
presets: [tqcPreset],
|
|
157
|
+
content: [
|
|
158
|
+
'./index.html',
|
|
159
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
160
|
+
],
|
|
161
|
+
theme: {
|
|
162
|
+
extend: {
|
|
163
|
+
// You can add custom theme extensions here
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
plugins: [],
|
|
167
|
+
};
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Usage Example
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
// App.tsx
|
|
174
|
+
import { Button } from '@tqc-solution/design-system';
|
|
175
|
+
|
|
176
|
+
function App() {
|
|
177
|
+
return (
|
|
178
|
+
<div className="bg-background-fill-primary p-24">
|
|
179
|
+
<h1 className="text-heading-2xl text-text-brand">
|
|
180
|
+
Hello Tailwind!
|
|
181
|
+
</h1>
|
|
182
|
+
|
|
183
|
+
<button className="bg-background-fill-brand text-text-inverse px-24 py-12 rounded-8 shadow-shadow-md">
|
|
184
|
+
Native HTML button with DS tokens
|
|
185
|
+
</button>
|
|
186
|
+
|
|
187
|
+
<Button className="ml-16" label="DS Button" />
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Available Tailwind Classes
|
|
194
|
+
|
|
195
|
+
Classes are mapped directly from the Design System's CSS variables:
|
|
196
|
+
|
|
197
|
+
- `bg-background-fill-primary` - Background colors
|
|
198
|
+
- `text-text-brand` - Text colors
|
|
199
|
+
- `rounded-8` - Border radius
|
|
200
|
+
- `shadow-shadow-md` - Shadows
|
|
201
|
+
- And many more...
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT © TQC Solution
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AlertType = 'info' | 'success' | 'error' | 'alert';
|
|
3
|
+
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
4
|
+
type: AlertType;
|
|
5
|
+
title: string;
|
|
6
|
+
supportText?: string;
|
|
7
|
+
actionLabel?: string;
|
|
8
|
+
onActionClick?: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
showClose?: boolean;
|
|
11
|
+
isAlertRadius?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type AvatarProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
3
|
+
/** Avatar size */
|
|
4
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
/** Avatar type */
|
|
6
|
+
type?: 'image' | 'text' | 'icon';
|
|
7
|
+
/** Image source URL (required when type='image') */
|
|
8
|
+
src?: string;
|
|
9
|
+
/** Alt text for image */
|
|
10
|
+
alt?: string;
|
|
11
|
+
/** Text to display (1-2 characters, required when type='text') */
|
|
12
|
+
text?: string;
|
|
13
|
+
/** Icon element to display (required when type='icon') */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/** Show status indicator dot */
|
|
16
|
+
statusIcon?: boolean;
|
|
17
|
+
/** Additional CSS class name */
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const Avatar: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
21
|
+
/** Avatar size */
|
|
22
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
23
|
+
/** Avatar type */
|
|
24
|
+
type?: "image" | "text" | "icon";
|
|
25
|
+
/** Image source URL (required when type='image') */
|
|
26
|
+
src?: string;
|
|
27
|
+
/** Alt text for image */
|
|
28
|
+
alt?: string;
|
|
29
|
+
/** Text to display (1-2 characters, required when type='text') */
|
|
30
|
+
text?: string;
|
|
31
|
+
/** Icon element to display (required when type='icon') */
|
|
32
|
+
icon?: ReactNode;
|
|
33
|
+
/** Show status indicator dot */
|
|
34
|
+
statusIcon?: boolean;
|
|
35
|
+
/** Additional CSS class name */
|
|
36
|
+
className?: string;
|
|
37
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, 'color'> & {
|
|
3
|
+
/** Badge text content */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Visual type of the badge */
|
|
6
|
+
type?: 'active' | 'secondary' | 'default' | 'negative' | 'pending' | 'disabled';
|
|
7
|
+
/** Style variant of the badge */
|
|
8
|
+
badgeStyle?: 'soft' | 'outline';
|
|
9
|
+
/** Size of the badge */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Icon to display at the start of the badge */
|
|
12
|
+
startIcon?: ReactNode;
|
|
13
|
+
/** Icon to display at the end of the badge */
|
|
14
|
+
endIcon?: ReactNode;
|
|
15
|
+
/** Dot indicator instead of text - shows only a colored dot */
|
|
16
|
+
dot?: boolean;
|
|
17
|
+
/** Additional CSS class name */
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const Badge: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "color"> & {
|
|
21
|
+
/** Badge text content */
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
/** Visual type of the badge */
|
|
24
|
+
type?: "active" | "secondary" | "default" | "negative" | "pending" | "disabled";
|
|
25
|
+
/** Style variant of the badge */
|
|
26
|
+
badgeStyle?: "soft" | "outline";
|
|
27
|
+
/** Size of the badge */
|
|
28
|
+
size?: "sm" | "md" | "lg";
|
|
29
|
+
/** Icon to display at the start of the badge */
|
|
30
|
+
startIcon?: ReactNode;
|
|
31
|
+
/** Icon to display at the end of the badge */
|
|
32
|
+
endIcon?: ReactNode;
|
|
33
|
+
/** Dot indicator instead of text - shows only a colored dot */
|
|
34
|
+
dot?: boolean;
|
|
35
|
+
/** Additional CSS class name */
|
|
36
|
+
className?: string;
|
|
37
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type AnchorHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
type BaseButtonProps = {
|
|
3
|
+
type?: 'primary' | 'secondary' | 'text' | 'link' | 'negative-secondary' | 'negative-primary';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
5
|
+
startIcon?: ReactNode;
|
|
6
|
+
endIcon?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
label?: string;
|
|
10
|
+
minWidth?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ButtonProps = BaseButtonProps & ((Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> & {
|
|
13
|
+
type?: Exclude<BaseButtonProps['type'], 'link'>;
|
|
14
|
+
}) | (AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
15
|
+
type: 'link';
|
|
16
|
+
href: string;
|
|
17
|
+
}));
|
|
18
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type ColumnType<T = any> = {
|
|
3
|
+
title?: ReactNode | ((props: any) => ReactNode);
|
|
4
|
+
dataIndex?: string | string[];
|
|
5
|
+
key?: string | number;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
minWidth?: number | string;
|
|
8
|
+
maxWidth?: number | string;
|
|
9
|
+
render?: (value: any, record: T, index: number) => ReactNode;
|
|
10
|
+
ellipsis?: boolean;
|
|
11
|
+
align?: 'left' | 'right' | 'center';
|
|
12
|
+
className?: string;
|
|
13
|
+
onCell?: (record: T, index: number) => any;
|
|
14
|
+
onHeaderCell?: () => any;
|
|
15
|
+
children?: ColumnType<T>[];
|
|
16
|
+
};
|
|
17
|
+
export type ColumnsType<T = any> = ColumnType<T>[];
|
|
18
|
+
export interface CardTableProps<T = any> {
|
|
19
|
+
/** Show add button */
|
|
20
|
+
showAddButton?: ReactNode;
|
|
21
|
+
/** Data source for the table */
|
|
22
|
+
dataSource?: T[];
|
|
23
|
+
/** Pagination configuration */
|
|
24
|
+
pagination?: {
|
|
25
|
+
/** Total number of items (if not provided, will use dataSource.length) */
|
|
26
|
+
total?: number;
|
|
27
|
+
/** Current page (1-indexed) - controlled mode */
|
|
28
|
+
current?: number;
|
|
29
|
+
/** Number of items per page */
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
/** Available page size options */
|
|
32
|
+
pageSizeOptions?: number[];
|
|
33
|
+
/** Callback when page changes */
|
|
34
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
35
|
+
/** Callback when page size changes */
|
|
36
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
37
|
+
/** Show pagination controls */
|
|
38
|
+
showPagination?: boolean;
|
|
39
|
+
/** Enable automatic pagination (default: true if dataSource is provided) */
|
|
40
|
+
autoPagination?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** Row selection configuration */
|
|
43
|
+
rowSelection?: {
|
|
44
|
+
/** Selected row keys (controlled mode) */
|
|
45
|
+
selectedRowKeys?: (string | number)[];
|
|
46
|
+
/** Callback when selection changes */
|
|
47
|
+
onChange?: (selectedRowKeys: (string | number)[], selectedRows: T[]) => void;
|
|
48
|
+
/** Get checkbox props for a row */
|
|
49
|
+
getCheckboxProps?: (record: T) => {
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Preserve selected rows when page changes (default: false) */
|
|
53
|
+
preserveSelectedRowKeys?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** Show more options icon */
|
|
56
|
+
showMoreOptions?: boolean;
|
|
57
|
+
/** Column keys that cannot be hidden (default columns) */
|
|
58
|
+
defaultColumns?: (string | number)[];
|
|
59
|
+
/** Column keys that are visible by default (if not provided, all columns are visible) */
|
|
60
|
+
defaultVisibleColumns?: (string | number)[];
|
|
61
|
+
/** Enable column resizing */
|
|
62
|
+
resize?: boolean;
|
|
63
|
+
/** Additional CSS class name */
|
|
64
|
+
className?: string;
|
|
65
|
+
/** Table columns */
|
|
66
|
+
columns?: ColumnsType<T>;
|
|
67
|
+
/** Row key function or string */
|
|
68
|
+
rowKey?: string | ((record: T) => string | number);
|
|
69
|
+
/** Row className function */
|
|
70
|
+
rowClassName?: string | ((record: T, index: number) => string);
|
|
71
|
+
/** Scroll configuration */
|
|
72
|
+
scroll?: {
|
|
73
|
+
x?: number | string;
|
|
74
|
+
y?: number | string;
|
|
75
|
+
};
|
|
76
|
+
/** Table layout */
|
|
77
|
+
tableLayout?: 'auto' | 'fixed';
|
|
78
|
+
/** Loading state */
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
/** Empty state */
|
|
81
|
+
emptyText?: ReactNode;
|
|
82
|
+
/** Show header */
|
|
83
|
+
showHeader?: boolean;
|
|
84
|
+
/** Additional table props */
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}
|
|
87
|
+
export declare const CardTable: import("react").ForwardRefExoticComponent<Omit<CardTableProps<any>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|