@innotechjsc/ui-kit 0.1.0 → 0.2.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 +125 -96
- package/dist/components/Autocomplete/Autocomplete.d.ts +14 -0
- package/dist/components/Avatar/Avatar.d.ts +20 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +19 -0
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Calendar/Calendar.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts +14 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +8 -0
- package/dist/components/DatePicker/DatePicker.d.ts +11 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +11 -0
- package/dist/components/Input/EmailInput.d.ts +4 -0
- package/dist/components/Input/HiddenInput.d.ts +5 -0
- package/dist/components/Input/Input.d.ts +14 -0
- package/dist/components/Input/NumberInput.d.ts +4 -0
- package/dist/components/Input/PasswordInput.d.ts +4 -0
- package/dist/components/Input/SearchInput.d.ts +4 -0
- package/dist/components/Input/Textarea.d.ts +8 -0
- package/dist/components/Input/index.d.ts +7 -0
- package/dist/components/Modal/Modal.d.ts +14 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +6 -0
- package/dist/components/Radio/RadioGroup.d.ts +15 -0
- package/dist/components/Select/MultiSelect.d.ts +13 -0
- package/dist/components/Select/Select.d.ts +15 -0
- package/dist/components/Slider/Slider.d.ts +4 -0
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/TimePicker/TimePicker.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +7721 -4547
- package/dist/index.umd.cjs +12 -12
- package/dist/styles/tokens.d.ts +22 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +24 -12
- package/dist/vite.svg +0 -1
package/README.md
CHANGED
|
@@ -1,149 +1,178 @@
|
|
|
1
1
|
# @innotechjsc/ui-kit
|
|
2
2
|
|
|
3
|
-
Thư viện Component UI chuẩn mực dành riêng cho các dự án React của Innotech JSC, được xây dựng với **Vite**, **TypeScript**, và **Tailwind CSS v4**.
|
|
3
|
+
Thư viện Component UI chuẩn mực dành riêng cho các dự án React của Innotech JSC, được xây dựng với **Vite**, **TypeScript**, và **Tailwind CSS v4**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 🚀 Dành cho Nhà phát triển (Human Developers)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# Sử dụng pnpm
|
|
11
|
-
pnpm add @innotechjsc/ui-kit
|
|
9
|
+
### 📦 Cài đặt
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
npm install @innotechjsc/ui-kit
|
|
11
|
+
Sử dụng **PNPM** (khuyên dùng) hoặc các package manager khác:
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @innotechjsc/ui-kit
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
### ⚙️ Cấu hình ban đầu
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
Import file CSS toàn cục vào file entry point của dự án (ví dụ: `main.tsx` hoặc `App.tsx`):
|
|
23
20
|
|
|
24
21
|
```tsx
|
|
25
|
-
|
|
26
|
-
import "@innotechjsc/ui-kit/styles/globals.css";
|
|
27
|
-
import React from "react";
|
|
28
|
-
import ReactDOM from "react-dom/client";
|
|
29
|
-
import App from "./App";
|
|
30
|
-
|
|
31
|
-
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
32
|
-
<React.StrictMode>
|
|
33
|
-
<App />
|
|
34
|
-
</React.StrictMode>,
|
|
35
|
-
);
|
|
22
|
+
import "@innotechjsc/ui-kit/dist/index.css";
|
|
36
23
|
```
|
|
37
24
|
|
|
38
|
-
|
|
25
|
+
### 🧩 Hướng dẫn sử dụng các Components chính
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
Thư viện cung cấp các components được tối ưu về UI/UX. Dưới đây là cách sử dụng một số component phổ biến nhất:
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
#### 1. Button (Nút bấm)
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
Hỗ trợ 3 variants chính: `primary`, `secondary`, `danger`.
|
|
45
32
|
|
|
46
33
|
```tsx
|
|
47
34
|
import { Button } from "@innotechjsc/ui-kit";
|
|
48
35
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<Button variant="secondary">Hủy bỏ</Button>
|
|
56
|
-
<Button variant="danger">Xóa dữ liệu</Button>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
36
|
+
<Button variant="primary" onClick={() => console.log("Clicked")}>
|
|
37
|
+
Xác nhận
|
|
38
|
+
</Button>
|
|
39
|
+
<Button variant="secondary" disabled>
|
|
40
|
+
Vô hiệu hóa
|
|
41
|
+
</Button>
|
|
60
42
|
```
|
|
61
43
|
|
|
62
|
-
|
|
44
|
+
#### 2. Input (Ô nhập liệu)
|
|
45
|
+
|
|
46
|
+
Tích hợp sẵn label, thông báo lỗi và icon.
|
|
63
47
|
|
|
64
48
|
```tsx
|
|
65
49
|
import { Input } from "@innotechjsc/ui-kit";
|
|
50
|
+
import { User } from "lucide-react";
|
|
51
|
+
|
|
52
|
+
<Input
|
|
53
|
+
label="Email"
|
|
54
|
+
placeholder="example@gmail.com"
|
|
55
|
+
startIcon={<User size={16} />}
|
|
56
|
+
error="Email không hợp lệ"
|
|
57
|
+
/>;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### 3. Select (Hộp chọn)
|
|
61
|
+
|
|
62
|
+
Xây dựng trên nền tảng Radix UI, hỗ trợ chọn một hoặc nhiều item.
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
```tsx
|
|
65
|
+
import {
|
|
66
|
+
Select,
|
|
67
|
+
SelectTrigger,
|
|
68
|
+
SelectValue,
|
|
69
|
+
SelectContent,
|
|
70
|
+
SelectItem,
|
|
71
|
+
} from "@innotechjsc/ui-kit";
|
|
72
|
+
|
|
73
|
+
<Select onValueChange={(value) => console.log(value)}>
|
|
74
|
+
<SelectTrigger className="w-[180px]">
|
|
75
|
+
<SelectValue placeholder="Chọn ngôn ngữ" />
|
|
76
|
+
</SelectTrigger>
|
|
77
|
+
<SelectContent>
|
|
78
|
+
<SelectItem value="vi">Tiếng Việt</SelectItem>
|
|
79
|
+
<SelectItem value="en">Tiếng Anh</SelectItem>
|
|
80
|
+
</SelectContent>
|
|
81
|
+
</Select>;
|
|
79
82
|
```
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
#### 4. DatePicker (Chọn ngày)
|
|
85
|
+
|
|
86
|
+
Tích hợp `date-fns` và hỗ trợ đa ngôn ngữ (vi/en).
|
|
82
87
|
|
|
83
88
|
```tsx
|
|
89
|
+
import { DatePicker } from "@innotechjsc/ui-kit";
|
|
84
90
|
import { useState } from "react";
|
|
85
|
-
import { Modal, Button } from "@innotechjsc/ui-kit";
|
|
86
91
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<>
|
|
92
|
-
<Button onClick={() => setIsOpen(true)}>Mở Modal</Button>
|
|
93
|
-
|
|
94
|
-
<Modal
|
|
95
|
-
isOpen={isOpen}
|
|
96
|
-
onClose={() => setIsOpen(false)}
|
|
97
|
-
title="Thông báo hệ thống"
|
|
98
|
-
>
|
|
99
|
-
<p className="text-gray-600 mb-4">
|
|
100
|
-
Cập nhật component thành công! Bạn có thể đóng modal này.
|
|
101
|
-
</p>
|
|
102
|
-
<div className="flex justify-end">
|
|
103
|
-
<Button onClick={() => setIsOpen(false)}>Đóng</Button>
|
|
104
|
-
</div>
|
|
105
|
-
</Modal>
|
|
106
|
-
</>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
92
|
+
const [date, setDate] = useState<Date>();
|
|
93
|
+
|
|
94
|
+
<DatePicker date={date} setDate={setDate} label="Ngày sinh" language="vi" />;
|
|
109
95
|
```
|
|
110
96
|
|
|
111
|
-
|
|
97
|
+
#### 5. Modal (Hội thoại)
|
|
98
|
+
|
|
99
|
+
Sử dụng Portal để đảm bảo hiển thị trên cùng.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import { Modal, Button } from "@innotechjsc/ui-kit";
|
|
103
|
+
import { useState } from "react";
|
|
104
|
+
|
|
105
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
106
|
+
|
|
107
|
+
<Button onClick={() => setIsOpen(true)}>Mở Modal</Button>
|
|
108
|
+
|
|
109
|
+
<Modal
|
|
110
|
+
isOpen={isOpen}
|
|
111
|
+
onClose={() => setIsOpen(false)}
|
|
112
|
+
title="Tiêu đề Modal"
|
|
113
|
+
>
|
|
114
|
+
<p>Nội dung hiển thị bên trong modal...</p>
|
|
115
|
+
</Modal>
|
|
116
|
+
```
|
|
112
117
|
|
|
113
|
-
|
|
118
|
+
### 📚 Toàn bộ Component
|
|
114
119
|
|
|
115
|
-
|
|
120
|
+
Để xem chi tiết danh sách tất cả props và demo trực quan, hãy chạy:
|
|
116
121
|
|
|
117
122
|
```bash
|
|
118
123
|
pnpm storybook
|
|
119
124
|
```
|
|
120
125
|
|
|
121
|
-
|
|
126
|
+
---
|
|
122
127
|
|
|
123
|
-
|
|
128
|
+
## 🤖 Dành cho AI Agents (Cursor, Copilot, etc.)
|
|
124
129
|
|
|
125
|
-
|
|
130
|
+
Phần này giúp AI hiểu cấu trúc và quy chuẩn của project để hỗ trợ code chính xác hơn.
|
|
126
131
|
|
|
127
|
-
|
|
128
|
-
npx changeset
|
|
129
|
-
```
|
|
132
|
+
### 📂 Cấu trúc dự án
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
- `src/components/`: Chứa mã nguồn của tất cả components. Mỗi component đặt trong một thư mục riêng.
|
|
135
|
+
- `src/styles/`: Chứa `globals.css` và `tokens.ts`.
|
|
136
|
+
- `index.ts`: Entry point chính, export tất cả components và styles.
|
|
133
137
|
|
|
134
|
-
|
|
135
|
-
# Update versions trong package.json và tạo ra CHANGELOG.md
|
|
136
|
-
npx changeset version
|
|
138
|
+
### 🛠 Tech Stack sử dụng
|
|
137
139
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
- **React 19 + TypeScript**: Strict mode.
|
|
141
|
+
- **Tailwind CSS v4**: Sử dụng các tiện ích CSS mới nhất.
|
|
142
|
+
- **Radix UI**: Primitive components cho accessibility (Checkbox, Popover, Select, v.v.).
|
|
143
|
+
- **CVA (class-variance-authority)**: Quản lý variants cho components (ví dụ: `variant="primary"`, `size="sm"`).
|
|
144
|
+
- **Lucide React**: Thư viện icon chuẩn.
|
|
141
145
|
|
|
142
|
-
|
|
146
|
+
### 📝 Quy trình tạo Component mới
|
|
143
147
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
1. Tạo thư mục `src/components/NewComponent`.
|
|
149
|
+
2. Sử dụng `Radix UI` if possible để đảm bảo tính tiếp cận (a11y).
|
|
150
|
+
3. Sử dụng `cva` để định nghĩa styles và variants.
|
|
151
|
+
4. Export component qua `index.ts` trong thư mục component và `src/index.ts`.
|
|
152
|
+
5. Tạo file Storybook `*.stories.tsx` để test.
|
|
153
|
+
|
|
154
|
+
### 🔍 Cách tìm kiếm Code
|
|
155
|
+
|
|
156
|
+
- Nếu cần xem logic của Input, hãy tìm tại `src/components/Input/Input.tsx`.
|
|
157
|
+
- Nếu cần xem cách define theme/màu sắc, hãy tìm tại `src/styles/tokens.ts` và `tailwind.config.ts`.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## ⚙️ Quy trình Build & Publish (Maintainers)
|
|
162
|
+
|
|
163
|
+
1. **Thay đổi code**: Thực hiện logic fix/thêm mới.
|
|
164
|
+
2. **Khai báo version**:
|
|
165
|
+
```bash
|
|
166
|
+
npx changeset
|
|
167
|
+
```
|
|
168
|
+
3. **Build**:
|
|
169
|
+
```bash
|
|
170
|
+
pnpm build
|
|
171
|
+
```
|
|
172
|
+
4. **Publish**:
|
|
173
|
+
```bash
|
|
174
|
+
pnpm publish
|
|
175
|
+
```
|
|
147
176
|
|
|
148
177
|
---
|
|
149
178
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type AutocompleteOption = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export interface AutocompleteProps {
|
|
6
|
+
options: AutocompleteOption[];
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Autocomplete({ options, value, onChange, placeholder, className, error, label, }: AutocompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
|
+
declare const avatarVariants: (props?: ({
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
6
|
+
shape?: "circle" | "square" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
9
|
+
}
|
|
10
|
+
declare const AvatarRoot: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
12
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
export interface CompositeAvatarProps extends AvatarProps {
|
|
14
|
+
src?: string;
|
|
15
|
+
alt?: string;
|
|
16
|
+
fallback?: React.ReactNode;
|
|
17
|
+
status?: "online" | "offline" | "busy" | "away";
|
|
18
|
+
}
|
|
19
|
+
declare const Avatar: React.ForwardRefExoticComponent<CompositeAvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
20
|
+
export { Avatar, AvatarRoot, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "primary" | "success" | "warning" | "danger" | "outline" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
8
|
+
dot?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function Badge({ className, variant, size, dot, children, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
3
|
+
separator?: React.ReactNode;
|
|
4
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
7
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
declare const BreadcrumbSeparator: {
|
|
12
|
+
({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
declare const BreadcrumbEllipsis: {
|
|
16
|
+
({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ButtonProps = {
|
|
3
|
+
/** The variant style of the button */
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
5
|
+
/** Button content */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare function Button({ variant, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DayPicker } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
4
|
+
selectedColor?: string;
|
|
5
|
+
};
|
|
6
|
+
declare function Calendar({ className, classNames, showOutsideDays, selectedColor, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace Calendar {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export { Calendar };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
+
declare const checkboxVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | null | undefined;
|
|
6
|
+
hasError?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export { Checkbox };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ColorPickerProps {
|
|
2
|
+
color?: string;
|
|
3
|
+
onChange?: (color: string) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ColorPicker({ color, onChange, className, error, label, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
date?: Date;
|
|
3
|
+
setDate: (date?: Date) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
selectedColor?: string;
|
|
9
|
+
language?: "vi" | "en";
|
|
10
|
+
}
|
|
11
|
+
export declare function DatePicker({ date, setDate, placeholder, className, error, label, selectedColor, language, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DateTimePickerProps {
|
|
2
|
+
date?: Date;
|
|
3
|
+
setDate: (date?: Date) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
selectedColor?: string;
|
|
9
|
+
language?: "vi" | "en";
|
|
10
|
+
}
|
|
11
|
+
export declare function DateTimePicker({ date, setDate, placeholder, className, error, label, selectedColor, language, }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const inputVariants: (props?: ({
|
|
4
|
+
hasError?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
|
|
7
|
+
label?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
startIcon?: React.ReactNode;
|
|
10
|
+
endIcon?: React.ReactNode;
|
|
11
|
+
wrapperClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export { Input, inputVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
wrapperClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
|
+
export { Textarea };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ModalProps = {
|
|
3
|
+
/** Whether the modal is open */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Function to call when modal requests to close */
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** Modal content */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Modal title */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** Optional class name */
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function Modal({ isOpen, onClose, title, children, className }: ModalProps): React.ReactPortal | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
declare const radioVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
8
|
+
}
|
|
9
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, VariantProps<typeof radioVariants> {
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Option = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export interface MultiSelectProps {
|
|
6
|
+
options: Option[];
|
|
7
|
+
selected: string[];
|
|
8
|
+
onChange: (selected: string[]) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function MultiSelect({ options, selected, onChange, placeholder, className, error, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
7
|
+
error?: boolean;
|
|
8
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|