@openway/ui 1.0.0 → 1.0.2

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.
Files changed (58) hide show
  1. package/README.md +203 -181
  2. package/dist/chunk-X4LIYOS5.js +3 -0
  3. package/dist/chunk-X4LIYOS5.js.map +1 -0
  4. package/dist/index.cjs +5 -1
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +2740 -1473
  7. package/dist/index.d.ts +2740 -1473
  8. package/dist/index.js +5 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/query.cjs +3 -0
  11. package/dist/query.cjs.map +1 -0
  12. package/dist/query.d.cts +431 -0
  13. package/dist/query.d.ts +431 -0
  14. package/dist/query.js +3 -0
  15. package/dist/query.js.map +1 -0
  16. package/dist/useInfiniteScroll-D9AW6cQV.d.cts +598 -0
  17. package/dist/useInfiniteScroll-D9AW6cQV.d.ts +598 -0
  18. package/docs/AGENTS.md +144 -0
  19. package/docs/README.md +150 -0
  20. package/docs/SKILL.md +54 -0
  21. package/docs/components/alert.md +246 -0
  22. package/docs/components/badge.md +238 -0
  23. package/docs/components/button.md +262 -0
  24. package/docs/components/carousel.md +354 -0
  25. package/docs/components/checkbox.md +252 -0
  26. package/docs/components/collapse.md +318 -0
  27. package/docs/components/confirm.md +322 -0
  28. package/docs/components/datepicker.md +259 -0
  29. package/docs/components/daterangepicker.md +260 -0
  30. package/docs/components/datetimepicker.md +226 -0
  31. package/docs/components/datetimerangepicker.md +222 -0
  32. package/docs/components/dropdown.md +275 -0
  33. package/docs/components/empty.md +200 -0
  34. package/docs/components/file-preview.md +180 -0
  35. package/docs/components/input.md +559 -0
  36. package/docs/components/modal.md +293 -0
  37. package/docs/components/popover.md +255 -0
  38. package/docs/components/radio.md +245 -0
  39. package/docs/components/select.md +254 -0
  40. package/docs/components/skeleton.md +150 -0
  41. package/docs/components/slider.md +346 -0
  42. package/docs/components/table.md +316 -0
  43. package/docs/components/tabs.md +432 -0
  44. package/docs/components/textarea.md +193 -0
  45. package/docs/components/timepicker.md +242 -0
  46. package/docs/components/timerangepicker.md +210 -0
  47. package/docs/components/toast.md +282 -0
  48. package/docs/components/toggle.md +211 -0
  49. package/docs/components/tooltip.md +213 -0
  50. package/docs/components/upload-avatar.md +318 -0
  51. package/docs/components/upload-file.md +245 -0
  52. package/docs/components/upload-image.md +126 -0
  53. package/docs/hooks/useDebounce.md +92 -0
  54. package/docs/hooks/useInfiniteScroll.md +95 -0
  55. package/docs/hooks/useMutationApp.md +242 -0
  56. package/docs/hooks/useSelectInfiniteQuery.md +123 -0
  57. package/docs/hooks/useTableQuery.md +124 -0
  58. package/package.json +31 -12
package/dist/index.d.cts CHANGED
@@ -1,10 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import react__default, { ButtonHTMLAttributes, Ref, ReactNode, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SVGProps, ReactElement, CSSProperties, HTMLProps, RefObject, MouseEvent } from 'react';
2
+ import react, { ButtonHTMLAttributes, Ref, ReactNode, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SVGProps, ReactElement, CSSProperties, HTMLProps, RefObject, MouseEvent, TdHTMLAttributes, ThHTMLAttributes } from 'react';
4
3
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
5
- import { ToastT, ToasterProps as ToasterProps$1 } from 'sonner';
4
+ import { A as AlertProps, T as ToasterProps, a as ToastOptions, b as ToastPromiseOptions, E as EmptyProps, c as EmptyPresetImage, S as SelectProps, M as MultiSelectProps, d as SelectOptionItem, e as SelectSize, f as SelectVariant, g as SelectColor, h as SelectRadius, i as SelectSearchPlacement, j as SelectFilterField, k as SelectFilterLayout } from './useInfiniteScroll-D9AW6cQV.cjs';
5
+ export { l as AlertColor, m as AlertRadius, n as AlertSize, o as AlertVariant, B as BaseSelectProps, p as EmptyLayout, q as EmptySize, r as SelectFilterType, s as SelectSearchMode, t as SingleSelectProps, u as ToastMessageObject, v as ToastMessageResult, w as ToastPosition, x as ToastPromiseFunction, U as UseInfiniteScrollOptions, y as UseInfiniteScrollReturn, z as useInfiniteScroll } from './useInfiniteScroll-D9AW6cQV.cjs';
6
6
  import { Placement, ExtendedRefs, ReferenceType, FloatingContext } from '@floating-ui/react';
7
+ import { Accept, DropzoneRootProps } from 'react-dropzone';
7
8
  import { ImageProps } from 'next/image';
9
+ import * as _tanstack_react_table from '@tanstack/react-table';
10
+ import { TableFeatures, FilterFn, RowData, TableOptions, ColumnHelper, ReactTable, ColumnDef, Row, PaginationState, OnChangeFn, SortingState, RowSelectionState, ColumnVisibilityState, FilterFnOption, ColumnFiltersState, Header, Column } from '@tanstack/react-table';
11
+ export { Column, ColumnDef, ColumnFiltersState, ColumnHelper, ColumnVisibilityState, Header, OnChangeFn, PaginationState, ReactTable, Row, RowData, RowSelectionState, SortingState } from '@tanstack/react-table';
12
+ import { RankingInfo } from '@tanstack/match-sorter-utils';
13
+ export { RankingInfo } from '@tanstack/match-sorter-utils';
14
+ import 'sonner';
8
15
 
9
16
  type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
10
17
  type ButtonVariant = "filled" | "soft" | "ghost" | "text" | "outline" | "other";
@@ -1109,7 +1116,108 @@ type CheckboxColor = "primary" | "secondary" | "error" | "success" | "warning" |
1109
1116
  type CheckboxRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
1110
1117
  type CheckboxLabelPlacement = "right" | "left";
1111
1118
  type CheckboxGroupOrientation = "horizontal" | "vertical";
1119
+ type CheckboxSearchMode = "client" | "server";
1120
+ /**
1121
+ * Đại diện cho một phần tử tùy chọn checkbox trong danh sách options của CheckboxGroup
1122
+ */
1123
+ interface CheckboxOptionItem<TData = unknown> {
1124
+ /** Giá trị định danh duy nhất của checkbox */
1125
+ value: string;
1126
+ /** Nhãn hiển thị chính của checkbox */
1127
+ label: ReactNode;
1128
+ /** Đoạn mô tả/chú thích phụ hiển thị bên dưới nhãn */
1129
+ description?: ReactNode;
1130
+ /** Vô hiệu hóa tương tác của ô checkbox này */
1131
+ disabled?: boolean;
1132
+ /** Chế độ chỉ đọc cho ô checkbox này */
1133
+ isReadOnly?: boolean;
1134
+ /** Trạng thái gạch ngang (indeterminate) */
1135
+ indeterminate?: boolean;
1136
+ /** Dữ liệu gốc đính kèm (dùng khi tìm kiếm hoặc lưu trữ ngữ cảnh nâng cao) */
1137
+ data?: TData;
1138
+ /** Cho phép mở rộng các trường tùy biến phục vụ tìm kiếm theo searchField */
1139
+ [key: string]: unknown;
1140
+ }
1141
+ /**
1142
+ * Cấu hình tập trung các cờ trạng thái / tính năng của Checkbox
1143
+ */
1144
+ interface CheckboxConfig {
1145
+ /**
1146
+ * Đánh dấu trường bắt buộc (hiển thị dấu * đỏ cạnh label)
1147
+ * @default false
1148
+ */
1149
+ isRequired?: boolean;
1150
+ /**
1151
+ * Trạng thái báo lỗi (viền đỏ, aria-invalid="true")
1152
+ * @default false
1153
+ */
1154
+ isInvalid?: boolean;
1155
+ /**
1156
+ * Trạng thái đang tải (vô hiệu hóa tương tác, aria-busy="true")
1157
+ * @default false
1158
+ */
1159
+ isLoading?: boolean;
1160
+ /**
1161
+ * Hiển thị biểu tượng xoay spinner khi đang ở trạng thái loading
1162
+ * @default false
1163
+ */
1164
+ showSpinner?: boolean;
1165
+ /**
1166
+ * Trạng thái trung gian (indeterminate / gạch ngang) - thường dùng cho "Chọn tất cả"
1167
+ * @default false
1168
+ */
1169
+ indeterminate?: boolean;
1170
+ }
1171
+ /**
1172
+ * Cấu hình tập trung các cờ trạng thái / tính năng của CheckboxGroup
1173
+ */
1174
+ interface CheckboxGroupConfig {
1175
+ /**
1176
+ * Đánh dấu trường bắt buộc chọn
1177
+ * @default false
1178
+ */
1179
+ isRequired?: boolean;
1180
+ /**
1181
+ * Trạng thái báo lỗi cho cả nhóm
1182
+ * @default false
1183
+ */
1184
+ isInvalid?: boolean;
1185
+ /**
1186
+ * Trạng thái đang tải cho cả nhóm
1187
+ * @default false
1188
+ */
1189
+ isLoading?: boolean;
1190
+ /**
1191
+ * Hiển thị spinner cho các checkbox con đang tải
1192
+ * @default false
1193
+ */
1194
+ showSpinner?: boolean;
1195
+ /**
1196
+ * Chế độ chỉ đọc cho cả nhóm
1197
+ * @default false
1198
+ */
1199
+ isReadOnly?: boolean;
1200
+ /**
1201
+ * Kích hoạt thanh tìm kiếm tích hợp
1202
+ * @default false
1203
+ */
1204
+ searchable?: boolean;
1205
+ /**
1206
+ * Trạng thái đang tải tìm kiếm (Server mode)
1207
+ * @default false
1208
+ */
1209
+ isSearching?: boolean;
1210
+ /**
1211
+ * Tự động bảo lưu các mục đã chọn khi lọc tìm kiếm
1212
+ * @default true
1213
+ */
1214
+ preserveSelected?: boolean;
1215
+ }
1112
1216
  interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
1217
+ /**
1218
+ * Cấu hình tập trung các cờ trạng thái / tính năng (isRequired, isInvalid, isLoading, indeterminate,...)
1219
+ */
1220
+ config?: CheckboxConfig;
1113
1221
  /**
1114
1222
  * Ref chuyển tiếp đến phần tử HTML input (React 19)
1115
1223
  */
@@ -1141,29 +1249,9 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "siz
1141
1249
  /**
1142
1250
  * Tùy chỉnh độ bo góc của ô checkbox:
1143
1251
  * - 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'
1144
- * @default theo từng `size` (xs: rounded-xs, sm: rounded-sm, md: rounded-md, lg: rounded-md, xl: rounded-lg)
1252
+ * @default 'md'
1145
1253
  */
1146
1254
  radius?: CheckboxRadius;
1147
- /**
1148
- * Trạng thái trung gian (indeterminate / gạch ngang) - thường dùng cho "Chọn tất cả"
1149
- * @default false
1150
- */
1151
- indeterminate?: boolean;
1152
- /**
1153
- * Trạng thái đang tải (hiển thị spinner và vô hiệu hóa tương tác)
1154
- * @default false
1155
- */
1156
- isLoading?: boolean;
1157
- /**
1158
- * Trạng thái báo lỗi (viền đỏ, aria-invalid="true")
1159
- * @default false
1160
- */
1161
- isInvalid?: boolean;
1162
- /**
1163
- * Đánh dấu trường bắt buộc (hiển thị dấu * đỏ cạnh label)
1164
- * @default false
1165
- */
1166
- isRequired?: boolean;
1167
1255
  /**
1168
1256
  * Nhãn văn bản hiển thị cạnh ô checkbox
1169
1257
  */
@@ -1208,11 +1296,72 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "siz
1208
1296
  */
1209
1297
  helperClassName?: string;
1210
1298
  }
1211
- interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
1299
+ interface CheckboxGroupProps<TData = unknown> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
1300
+ /**
1301
+ * Cấu hình tập trung các cờ trạng thái / tính năng
1302
+ */
1303
+ config?: CheckboxGroupConfig;
1212
1304
  /**
1213
1305
  * Ref chuyển tiếp đến container thẻ div của nhóm (React 19)
1214
1306
  */
1215
1307
  ref?: Ref<HTMLDivElement>;
1308
+ /**
1309
+ * Danh sách các tùy chọn checkbox dạng mảng dữ liệu (Data-driven)
1310
+ * @default []
1311
+ */
1312
+ options?: CheckboxOptionItem<TData>[];
1313
+ /**
1314
+ * Chế độ tìm kiếm: 'client' (lọc tại chỗ) hoặc 'server' (gọi API sau debounce)
1315
+ * @default 'client'
1316
+ */
1317
+ searchMode?: CheckboxSearchMode;
1318
+ /**
1319
+ * Placeholder hiển thị trong ô tìm kiếm
1320
+ * @default 'Tìm kiếm...'
1321
+ */
1322
+ searchPlaceholder?: string;
1323
+ /**
1324
+ * Giá trị từ khóa tìm kiếm (khi kiểm soát Controlled)
1325
+ */
1326
+ searchValue?: string;
1327
+ /**
1328
+ * Giá trị từ khóa tìm kiếm mặc định ban đầu (Uncontrolled)
1329
+ */
1330
+ defaultSearchValue?: string;
1331
+ /**
1332
+ * Callback kích hoạt khi từ khóa tìm kiếm thay đổi
1333
+ */
1334
+ onSearchChange?: (value: string) => void;
1335
+ /**
1336
+ * Tùy biến className cho ô input tìm kiếm
1337
+ */
1338
+ searchClassName?: string;
1339
+ /**
1340
+ * Trường dữ liệu để so khớp khi tìm kiếm ở mode client.
1341
+ * - Có thể truyền 1 field (string, ví dụ 'label', 'email', 'code')
1342
+ * - Hoặc nhiều fields (string[], ví dụ ['label', 'email', 'description']) để tìm kiếm mở rộng (OR).
1343
+ * @default 'label'
1344
+ */
1345
+ searchField?: string | string[];
1346
+ /**
1347
+ * Hàm tùy biến lọc dữ liệu ở mode client
1348
+ */
1349
+ filterFn?: (option: CheckboxOptionItem<TData>, query: string) => boolean;
1350
+ /**
1351
+ * Callback được gọi sau khi debounce khi người dùng gõ tìm kiếm (ở Server mode).
1352
+ * Có thể trả về Promise danh sách options mới hoặc cập nhật prop options từ ngoài.
1353
+ */
1354
+ onSearch?: (query: string) => void | Promise<CheckboxOptionItem<TData>[] | void>;
1355
+ /**
1356
+ * Thời gian trì hoãn debounce tính theo mili-giây (Server mode).
1357
+ * @default 300
1358
+ */
1359
+ debounceMs?: number;
1360
+ /**
1361
+ * Nội dung hiển thị khi không có kết quả tìm kiếm
1362
+ * @default 'Không tìm thấy kết quả'
1363
+ */
1364
+ emptyText?: ReactNode;
1216
1365
  /**
1217
1366
  * Mảng các giá trị được chọn (Controlled mode)
1218
1367
  */
@@ -1249,26 +1398,6 @@ interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCha
1249
1398
  * @default false
1250
1399
  */
1251
1400
  disabled?: boolean;
1252
- /**
1253
- * Chế độ chỉ đọc cho toàn bộ checkbox trong nhóm
1254
- * @default false
1255
- */
1256
- isReadOnly?: boolean;
1257
- /**
1258
- * Trạng thái đang tải cho toàn bộ checkbox trong nhóm
1259
- * @default false
1260
- */
1261
- isLoading?: boolean;
1262
- /**
1263
- * Trạng thái báo lỗi cho cả nhóm
1264
- * @default false
1265
- */
1266
- isInvalid?: boolean;
1267
- /**
1268
- * Đánh dấu nhóm bắt buộc phải chọn
1269
- * @default false
1270
- */
1271
- isRequired?: boolean;
1272
1401
  /**
1273
1402
  * Tiêu đề / Nhãn chung cho cả nhóm checkbox
1274
1403
  */
@@ -1305,40 +1434,42 @@ interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCha
1305
1434
  * Tùy biến className cho helperText hoặc errorMessage của nhóm
1306
1435
  */
1307
1436
  helperClassName?: string;
1308
- /**
1309
- * Danh sách các component con (thường là các Checkbox)
1310
- */
1311
- children?: ReactNode;
1312
1437
  }
1313
1438
 
1314
- declare function Checkbox({ size: sizeProp, variant: variantProp, color: colorProp, radius: radiusProp, indeterminate, isLoading: isLoadingProp, isInvalid: isInvalidProp, isRequired: isRequiredProp, label: labelProp, children, helperText, errorMessage, labelPlacement: labelPlacementProp, icon, indeterminateIcon, wrapperClassName, boxClassName, labelClassName, helperClassName, className, checked: checkedProp, defaultChecked, disabled: disabledProp, readOnly: readOnlyProp, onChange, value, id: idProp, name: nameProp, ref, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
1315
-
1316
- declare function CheckboxGroup({ value: valueProp, defaultValue, onChange, size, color, variant, radius, disabled, isReadOnly, isLoading, isInvalid: isInvalidProp, isRequired, label, helperText, errorMessage, orientation, labelPlacement, className, wrapperClassName, labelClassName, helperClassName, children, ref, ...props }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
1439
+ declare function Checkbox({ size, variant, color, radius, config, label: labelProp, children, helperText, errorMessage, labelPlacement, icon, indeterminateIcon, wrapperClassName, boxClassName, labelClassName, helperClassName, className, checked: checkedProp, defaultChecked, disabled, readOnly, onChange, value, id: idProp, name, ref, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
1317
1440
 
1318
- interface CheckboxGroupContextValue {
1319
- name?: string;
1320
- value?: string[];
1321
- onChange?: (val: string, checked: boolean) => void;
1322
- size?: CheckboxSize;
1323
- color?: CheckboxColor;
1324
- variant?: CheckboxVariant;
1325
- radius?: CheckboxRadius;
1326
- disabled?: boolean;
1327
- isReadOnly?: boolean;
1328
- isLoading?: boolean;
1329
- isInvalid?: boolean;
1330
- isRequired?: boolean;
1331
- labelPlacement?: CheckboxLabelPlacement;
1332
- }
1333
- declare const CheckboxGroupContext: react.Context<CheckboxGroupContextValue | undefined>;
1334
- declare const useCheckboxGroupContext: () => CheckboxGroupContextValue | undefined;
1441
+ declare function CheckboxGroup<TData = unknown>({ value: valueProp, defaultValue, onChange, size, color, variant, radius, disabled, label, helperText, errorMessage, orientation, labelPlacement, className, wrapperClassName, labelClassName, helperClassName, options, config, searchMode, searchPlaceholder, searchValue: searchValueProp, defaultSearchValue, onSearchChange, searchClassName, searchField, filterFn, onSearch, debounceMs, emptyText, children, ref, ...props }: CheckboxGroupProps<TData>): react_jsx_runtime.JSX.Element;
1335
1442
 
1336
1443
  type RadioSize = "xs" | "sm" | "md" | "lg" | "xl";
1337
1444
  type RadioVariant = "filled" | "outline" | "soft" | "other";
1338
1445
  type RadioColor = "primary" | "secondary" | "error" | "success" | "warning" | "info" | "neutral";
1339
1446
  type RadioLabelPlacement = "right" | "left";
1340
1447
  type RadioGroupOrientation = "horizontal" | "vertical";
1448
+ /**
1449
+ * Cau hinh tap trung cac co trang thai / tinh nang cua Radio
1450
+ */
1451
+ interface RadioConfig {
1452
+ /**
1453
+ * Danh dau bat buoc
1454
+ * @default false
1455
+ */
1456
+ isRequired?: boolean;
1457
+ /**
1458
+ * Trang thai bao loi (vien do)
1459
+ * @default false
1460
+ */
1461
+ isInvalid?: boolean;
1462
+ /**
1463
+ * Trang thai dang tai (hien thi spinner va vo hieu hoa tuong tac)
1464
+ * @default false
1465
+ */
1466
+ isLoading?: boolean;
1467
+ }
1341
1468
  interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
1469
+ /**
1470
+ * Cau hinh tap trung cac co trang thai / tinh nang
1471
+ */
1472
+ config?: RadioConfig;
1342
1473
  /**
1343
1474
  * Ref chuyen tiep den phan tu HTML input (React 19)
1344
1475
  */
@@ -1367,21 +1498,6 @@ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"
1367
1498
  * @default 'primary'
1368
1499
  */
1369
1500
  color?: RadioColor;
1370
- /**
1371
- * Trang thai dang tai (hien thi spinner va vo hieu hoa tuong tac)
1372
- * @default false
1373
- */
1374
- isLoading?: boolean;
1375
- /**
1376
- * Trang thai bao loi (vien do, aria-invalid="true")
1377
- * @default false
1378
- */
1379
- isInvalid?: boolean;
1380
- /**
1381
- * Danh dau truong bat buoc (hien thi dau * do canh label)
1382
- * @default false
1383
- */
1384
- isRequired?: boolean;
1385
1501
  /**
1386
1502
  * Nhan van ban hien thi canh o radio
1387
1503
  */
@@ -1422,125 +1538,214 @@ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"
1422
1538
  */
1423
1539
  helperClassName?: string;
1424
1540
  }
1425
- interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
1541
+ type RadioSearchMode = "client" | "server";
1542
+ interface RadioOptionItem<TData = unknown> {
1426
1543
  /**
1427
- * Ref chuyen tiep den container the div cua nhom (React 19)
1544
+ * Gia tri dinh danh duy nhat cua radio option
1428
1545
  */
1429
- ref?: Ref<HTMLDivElement>;
1546
+ value: string;
1430
1547
  /**
1431
- * Gia tri dang duoc chon (Controlled mode) - string don hoac null de bo chon
1548
+ * Nhan van ban hoac node hien thi
1432
1549
  */
1433
- value?: string | null;
1550
+ label?: ReactNode;
1434
1551
  /**
1435
- * Gia tri mac dinh ban dau (Uncontrolled mode)
1552
+ * Doan van ban huong dan/chu thich ben duoi
1436
1553
  */
1437
- defaultValue?: string | null;
1554
+ description?: ReactNode;
1438
1555
  /**
1439
- * Callback kich hoat khi radio duoc chon thay doi
1556
+ * Vo hieu hoa rieng cho option nay
1440
1557
  */
1441
- onChange?: (value: string | null) => void;
1558
+ disabled?: boolean;
1442
1559
  /**
1443
- * Kich co ap dung chung cho tat ca cac radio con
1444
- * @default 'md'
1560
+ * Che do chi doc rieng cho option nay
1445
1561
  */
1446
- size?: RadioSize;
1562
+ isReadOnly?: boolean;
1447
1563
  /**
1448
- * Mau sac ap dung chung cho tat ca cac radio con
1449
- * @default 'primary'
1564
+ * Du lieu goc tuy chinh gan kem
1450
1565
  */
1451
- color?: RadioColor;
1566
+ data?: TData;
1452
1567
  /**
1453
- * Bien the ap dung chung cho tat ca cac radio con
1454
- * @default 'filled'
1568
+ * Ho tro cac truong tuy y khac de phuc vu loc theo searchField
1455
1569
  */
1456
- variant?: RadioVariant;
1570
+ [key: string]: unknown;
1571
+ }
1572
+ /**
1573
+ * Cau hinh tap trung cac co trang thai / tinh nang cua RadioGroup
1574
+ */
1575
+ interface RadioGroupConfig {
1457
1576
  /**
1458
- * Vo hieu hoa toan bo cac radio trong nhom
1577
+ * Danh dau bat buoc chon
1459
1578
  * @default false
1460
1579
  */
1461
- disabled?: boolean;
1580
+ isRequired?: boolean;
1462
1581
  /**
1463
- * Che do chi doc cho toan bo radio trong nhom
1582
+ * Trang thai bao loi cua nhom
1464
1583
  * @default false
1465
1584
  */
1466
- isReadOnly?: boolean;
1585
+ isInvalid?: boolean;
1467
1586
  /**
1468
- * Trang thai dang tai cho toan bo radio trong nhom
1587
+ * Trang thai dang tai cua nhom
1469
1588
  * @default false
1470
1589
  */
1471
1590
  isLoading?: boolean;
1472
1591
  /**
1473
- * Trang thai bao loi cho ca nhom
1592
+ * Che do chi doc cho nhom
1474
1593
  * @default false
1475
1594
  */
1476
- isInvalid?: boolean;
1595
+ isReadOnly?: boolean;
1477
1596
  /**
1478
- * Danh dau nhom bat buoc phai chon
1597
+ * Bat o tim kiem cho nhom Radio
1479
1598
  * @default false
1480
1599
  */
1481
- isRequired?: boolean;
1600
+ searchable?: boolean;
1482
1601
  /**
1483
- * Tieu de / Nhan chung cho ca nhom radio
1602
+ * Trang thai dang tai tim kiem (Server mode)
1603
+ * @default false
1484
1604
  */
1485
- label?: ReactNode;
1605
+ isSearching?: boolean;
1486
1606
  /**
1487
- * Huong sap xep cac radio:
1488
- * - 'vertical': Sap xep theo chieu doc (mac dinh)
1489
- * - 'horizontal': Sap xep theo chieu ngang
1490
- * @default 'vertical'
1607
+ * Tu dong bao luu va hien thi muc da chon khi loc tim kiem
1608
+ * @default true
1491
1609
  */
1492
- orientation?: RadioGroupOrientation;
1610
+ preserveSelected?: boolean;
1611
+ }
1612
+ interface RadioGroupProps<TData = unknown> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children"> {
1493
1613
  /**
1494
- * Vi tri dat nhan cua cac radio con trong nhom
1495
- * @default 'right'
1614
+ * Cau hinh tap trung cac co trang thai / tinh nang
1496
1615
  */
1497
- labelPlacement?: RadioLabelPlacement;
1616
+ config?: RadioGroupConfig;
1498
1617
  /**
1499
- * Doan van ban huong dan/chu thich cho nhom
1618
+ * Ref chuyen tiep den container the div cua nhom (React 19)
1500
1619
  */
1501
- helperText?: ReactNode;
1620
+ ref?: Ref<HTMLDivElement>;
1502
1621
  /**
1503
- * Thong bao loi hien thi cho ca nhom (se tu dong kich hoat isInvalid)
1622
+ * Danh sach cac option cua radio group (Data-driven pattern)
1504
1623
  */
1505
- errorMessage?: ReactNode;
1624
+ options?: RadioOptionItem<TData>[];
1506
1625
  /**
1507
- * Tuy bien className cho container boc ngoai cung cua nhom
1626
+ * Gia tri dang duoc chon (Controlled mode) - string don hoac null de bo chon
1508
1627
  */
1509
- wrapperClassName?: string;
1628
+ value?: string | null;
1510
1629
  /**
1511
- * Tuy bien className cho tieu de nhan cua nhom
1630
+ * Gia tri mac dinh ban dau (Uncontrolled mode)
1512
1631
  */
1513
- labelClassName?: string;
1632
+ defaultValue?: string | null;
1514
1633
  /**
1515
- * Tuy bien className cho helperText hoac errorMessage cua nhom
1634
+ * Callback kich hoat khi radio duoc chon thay doi
1516
1635
  */
1517
- helperClassName?: string;
1636
+ onChange?: (value: string | null) => void;
1518
1637
  /**
1519
- * Danh sach cac component con (thuong la cac Radio)
1638
+ * Placeholder cho o input tim kiem
1639
+ */
1640
+ searchPlaceholder?: string;
1641
+ /**
1642
+ * Gia tri tim kiem hien tai (Controlled search)
1643
+ */
1644
+ searchValue?: string;
1645
+ /**
1646
+ * Callback khi gia tri tim kiem thay doi
1647
+ */
1648
+ onSearchChange?: (val: string) => void;
1649
+ /**
1650
+ * Che do tim kiem:
1651
+ * - 'client': Loc danh sach bang fuzzy matching qua match-sorter-utils (mac dinh)
1652
+ * - 'server': Goi API tim kiem bat dong bo qua onSearch
1653
+ * @default 'client'
1654
+ */
1655
+ searchMode?: RadioSearchMode;
1656
+ /**
1657
+ * Cac truong du lieu can loc (trong che do client search).
1658
+ * Co the la 1 key hoac mang cac keys (vd: ['label', 'description', 'code'])
1659
+ * @default 'label'
1660
+ */
1661
+ searchField?: string | string[];
1662
+ /**
1663
+ * Custom filter function cho che do client search
1664
+ */
1665
+ filterFn?: (item: RadioOptionItem<TData>, query: string) => boolean;
1666
+ /**
1667
+ * Callback tim kiem bat dong bo cho server search mode
1668
+ */
1669
+ onSearch?: (query: string) => Promise<RadioOptionItem<TData>[]>;
1670
+ /**
1671
+ * Thoi gian debounce khi nguoi dung nhap tu khoa tim kiem (ms)
1672
+ * @default 300
1673
+ */
1674
+ debounceMs?: number;
1675
+ /**
1676
+ * Thong bao hien thi khi khong tim thay ket qua
1677
+ * @default 'Khong tim thay ket qua'
1678
+ */
1679
+ emptyText?: ReactNode;
1680
+ /**
1681
+ * Tuy bien className cho khung chua o tim kiem
1682
+ */
1683
+ searchClassName?: string;
1684
+ /**
1685
+ * Kich thuoc o input tim kiem
1686
+ */
1687
+ searchInputSize?: "xs" | "sm" | "md" | "lg" | "xl";
1688
+ /**
1689
+ * Kich co ap dung chung cho tat ca cac radio con
1690
+ * @default 'md'
1520
1691
  */
1521
- children?: ReactNode;
1522
- }
1523
-
1524
- declare function Radio({ size: sizeProp, variant: variantProp, color: colorProp, isLoading: isLoadingProp, isInvalid: isInvalidProp, isRequired: isRequiredProp, label, helperText, errorMessage, labelPlacement: labelPlacementProp, dotIcon, wrapperClassName, boxClassName, labelClassName, helperClassName, className, checked: checkedProp, defaultChecked, disabled: disabledProp, readOnly: readOnlyProp, onChange, value, id: idProp, name: nameProp, ref, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
1525
-
1526
- declare function RadioGroup({ value: valueProp, defaultValue, onChange, size, color, variant, disabled, isReadOnly, isLoading, isInvalid: isInvalidProp, isRequired, label, helperText, errorMessage, orientation, labelPlacement, className, wrapperClassName, labelClassName, helperClassName, children, ref, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
1527
-
1528
- interface RadioGroupContextValue {
1529
- name: string;
1530
- value?: string | null;
1531
- onChange?: (val: string | null) => void;
1532
1692
  size?: RadioSize;
1693
+ /**
1694
+ * Mau sac ap dung chung cho tat ca cac radio con
1695
+ * @default 'primary'
1696
+ */
1533
1697
  color?: RadioColor;
1698
+ /**
1699
+ * Bien the ap dung chung cho tat ca cac radio con
1700
+ * @default 'filled'
1701
+ */
1534
1702
  variant?: RadioVariant;
1703
+ /**
1704
+ * Vo hieu hoa toan bo cac radio trong nhom
1705
+ * @default false
1706
+ */
1535
1707
  disabled?: boolean;
1536
- isReadOnly?: boolean;
1537
- isLoading?: boolean;
1538
- isInvalid?: boolean;
1539
- isRequired?: boolean;
1708
+ /**
1709
+ * Tieu de / Nhan chung cho ca nhom radio
1710
+ */
1711
+ label?: ReactNode;
1712
+ /**
1713
+ * Huong sap xep cac radio:
1714
+ * - 'vertical': Sap xep theo chieu doc (mac dinh)
1715
+ * - 'horizontal': Sap xep theo chieu ngang
1716
+ * @default 'vertical'
1717
+ */
1718
+ orientation?: RadioGroupOrientation;
1719
+ /**
1720
+ * Vi tri dat nhan cua cac radio con trong nhom
1721
+ * @default 'right'
1722
+ */
1540
1723
  labelPlacement?: RadioLabelPlacement;
1724
+ /**
1725
+ * Doan van ban huong dan/chu thich cho nhom
1726
+ */
1727
+ helperText?: ReactNode;
1728
+ /**
1729
+ * Thong bao loi hien thi cho ca nhom (se tu dong kich hoat isInvalid)
1730
+ */
1731
+ errorMessage?: ReactNode;
1732
+ /**
1733
+ * Tuy bien className cho container boc ngoai cung cua nhom
1734
+ */
1735
+ wrapperClassName?: string;
1736
+ /**
1737
+ * Tuy bien className cho tieu de nhan cua nhom
1738
+ */
1739
+ labelClassName?: string;
1740
+ /**
1741
+ * Tuy bien className cho helperText hoac errorMessage cua nhom
1742
+ */
1743
+ helperClassName?: string;
1541
1744
  }
1542
- declare const RadioGroupContext: react.Context<RadioGroupContextValue | undefined>;
1543
- declare const useRadioGroupContext: () => RadioGroupContextValue | undefined;
1745
+
1746
+ declare function Radio({ size, variant, color, disabled, readOnly, config, labelPlacement, label, helperText, errorMessage, dotIcon, wrapperClassName, boxClassName, labelClassName, helperClassName, className, checked: checkedProp, defaultChecked, onChange, value, id: idProp, name, ref, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
1747
+
1748
+ declare function RadioGroup<TData = unknown>({ options, value: valueProp, defaultValue, onChange, size, color, variant, disabled, label, helperText, errorMessage, orientation, labelPlacement, className, wrapperClassName, labelClassName, helperClassName, config, searchPlaceholder, searchValue: searchValueProp, onSearchChange, searchMode, searchField, filterFn, onSearch, debounceMs, emptyText, searchClassName, searchInputSize: searchInputSizeProp, ref, ...props }: RadioGroupProps<TData>): react_jsx_runtime.JSX.Element;
1544
1749
 
1545
1750
  type ToggleSize = "xs" | "sm" | "md" | "lg" | "xl";
1546
1751
  type ToggleVariant = "filled" | "outline" | "soft" | "other";
@@ -1744,279 +1949,20 @@ declare function TrashIcon({ width, height, className, ...props }: SVGProps<SVGS
1744
1949
 
1745
1950
  declare function UploadIcon({ width, height, className, ...props }: SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
1746
1951
 
1747
- /**
1748
- * Các kích cỡ tiêu chuẩn của Alert:
1749
- * - 'xs': Siêu nhỏ (text-xs, padding p-2)
1750
- * - 'sm': Nhỏ (text-xs, title text-sm, padding p-2.5)
1751
- * - 'md': Vừa - mặc định (text-sm, padding p-3.5)
1752
- * - 'lg': Lớn (text-base, padding p-4)
1753
- * - 'xl': Rất lớn (text-lg, padding p-5)
1754
- */
1755
- type AlertSize = "xs" | "sm" | "md" | "lg" | "xl";
1756
- /**
1757
- * Các biến thể giao diện và phong cách hiển thị màu sắc của Alert:
1758
- * - 'soft': Nền nhạt pastel, viền mờ 2px, chữ đậm (mặc định)
1759
- * - 'filled': Nền màu đậm, chữ trắng tương phản cao
1760
- * - 'outline': Nền trắng, viền rõ nét theo màu chủ đề
1761
- * - 'accent-left': Nền pastel kèm viền nhấn dày 4px bên trái
1762
- * - 'ghost': Nền và viền trong suốt
1763
- * - 'other': Bỏ qua màu mặc định, tự do styling qua className
1764
- */
1765
- type AlertVariant = "soft" | "filled" | "outline" | "accent-left" | "ghost" | "other";
1766
- /**
1767
- * 7 chủ đề màu sắc theo Design System:
1768
- * - 'primary': Màu chủ đạo
1769
- * - 'secondary': Màu phụ
1770
- * - 'neutral': Màu trung tính
1771
- * - 'error': Màu đỏ cảnh báo lỗi nguy cấp
1772
- * - 'success': Màu xanh lá thông báo thành công
1773
- * - 'warning': Màu vàng/cam cảnh báo
1774
- * - 'info': Màu xanh dương thông tin (mặc định)
1775
- */
1776
- type AlertColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
1777
- /**
1778
- * Độ bo góc của khung thông báo Alert:
1779
- * - 'none': Góc vuông phẳng (rounded-none)
1780
- * - 'sm': Bo góc nhỏ (rounded-sm)
1781
- * - 'md': Bo góc vừa (rounded-md)
1782
- * - 'lg': Bo góc lớn (rounded-lg - mặc định)
1783
- * - 'xl': Bo góc rất lớn (rounded-xl)
1784
- * - 'full': Bo tròn hoàn toàn (rounded-2xl)
1785
- */
1786
- type AlertRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
1787
- /**
1788
- * Props cho component `Alert`.
1789
- */
1790
- interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
1791
- /**
1792
- * Ref chuyển tiếp đến phần tử HTML div của Alert
1793
- */
1794
- ref?: Ref<HTMLDivElement>;
1795
- /**
1796
- * Kích cỡ của Alert (5 sizes: xs, sm, md, lg, xl)
1797
- * @default 'md'
1798
- */
1799
- size?: AlertSize;
1800
- /**
1801
- * Biến thể giao diện của Alert:
1802
- * - 'soft': nền nhạt pastel, viền mờ, chữ đậm tương ứng (mặc định)
1803
- * - 'filled': nền màu đậm, chữ tương phản cao
1804
- * - 'outline': nền trắng, viền rõ nét theo màu chủ đề
1805
- * - 'accent-left': viền nhấn dày bên trái, nền pastel
1806
- * - 'ghost': nền và viền trong suốt
1807
- * - 'other': không áp dụng style màu mặc định, tự do tùy biến qua className
1808
- * @default 'soft'
1809
- */
1810
- variant?: AlertVariant;
1811
- /**
1812
- * Chủ đề màu sắc (primary, secondary, neutral, error, success, warning, info)
1813
- * @default 'info'
1814
- */
1815
- color?: AlertColor;
1816
- /**
1817
- * Tùy chỉnh độ bo góc:
1818
- * - 'none': góc vuông 0px
1819
- * - 'sm': bo góc nhỏ
1820
- * - 'md': bo góc vừa
1821
- * - 'lg': bo góc lớn (mặc định)
1822
- * - 'xl': bo góc rất lớn
1823
- * - 'full': bo tròn hoàn toàn
1824
- * @default 'lg'
1825
- */
1826
- radius?: AlertRadius;
1827
- /**
1828
- * Tiêu đề của Alert
1829
- */
1830
- title?: ReactNode;
1831
- /**
1832
- * Nội dung mô tả chi tiết của Alert (có thể truyền qua prop description hoặc children)
1833
- */
1834
- description?: ReactNode;
1835
- /**
1836
- * Icon hiển thị ở đầu thông báo:
1837
- * - `true` (hoặc không truyền): tự động hiển thị icon theo `color`
1838
- * - `false`: ẩn icon
1839
- * - `ReactNode`: icon tùy chỉnh
1840
- * @default true
1841
- */
1842
- icon?: ReactNode | boolean;
1843
- /**
1844
- * Phần tử hành động phụ (Action slot, ví dụ: Nút bấm, liên kết thao tác)
1845
- */
1846
- action?: ReactNode;
1847
- /**
1848
- * Hiển thị nút đóng (Close button x) để người dùng có thể tắt thông báo. Tự động ẩn Alert khi click.
1849
- * @default true
1850
- */
1851
- closable?: boolean;
1852
- /**
1853
- * Callback khi người dùng bấm nút đóng
1854
- */
1855
- onClose?: () => void;
1856
- /**
1857
- * Nhãn accessibility cho nút đóng
1858
- * @default 'Close alert'
1859
- */
1860
- closeAriaLabel?: string;
1861
- /**
1862
- * Chế độ Banner: Full width, không bo góc (`rounded-none`), không viền 2 bên (`border-x-0`), thích hợp gắn cố định trên cùng màn hình
1863
- * @default false
1864
- */
1865
- banner?: boolean;
1866
- /**
1867
- * Class tùy biến cho phần tiêu đề (title)
1868
- */
1869
- titleClassName?: string;
1870
- /**
1871
- * Class tùy biến cho phần nội dung mô tả (description / children)
1872
- */
1873
- descriptionClassName?: string;
1874
- /**
1875
- * Class tùy biến cho vùng action slot
1876
- */
1877
- actionClassName?: string;
1878
- /**
1879
- * Class tùy biến cho icon wrapper
1880
- */
1881
- iconClassName?: string;
1882
- /**
1883
- * Class tùy biến cho nút đóng
1884
- */
1885
- closeButtonClassName?: string;
1886
- /**
1887
- * Class tùy biến cho container bao ngoài
1888
- */
1889
- className?: string;
1890
- /**
1891
- * Nội dung tùy biến bên trong Alert
1892
- */
1893
- children?: ReactNode;
1952
+ interface AvatarIconProps extends SVGProps<SVGSVGElement> {
1953
+ variant?: "solid" | "outline";
1894
1954
  }
1955
+ declare function AvatarIcon({ width, height, variant, className, ...props }: AvatarIconProps): react_jsx_runtime.JSX.Element;
1895
1956
 
1896
- declare function Alert({ size, variant, color, radius, title, description, icon, action, closable, onClose, closeAriaLabel, banner, titleClassName, descriptionClassName, actionClassName, iconClassName, closeButtonClassName, className, children, role, ref, ...props }: AlertProps): react_jsx_runtime.JSX.Element;
1957
+ declare function ArrowUpDownIcon({ width, height, className, ...props }: SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
1897
1958
 
1898
- /**
1899
- * Vị trí hiển thị của danh sách thông báo Toast trên màn hình.
1900
- */
1901
- type ToastPosition = "top-left" | "top-right" | "top-center" | "bottom-left" | "bottom-right" | "bottom-center";
1902
- /**
1903
- * Cấu hình tùy chọn cho từng thông báo Toast đơn lẻ:
1904
- * - Dạng gọi hàm chuẩn: `toast.success(title, description?, options?)`
1905
- */
1906
- interface ToastOptions extends Omit<AlertProps, "title" | "description"> {
1907
- /**
1908
- * Thời gian hiển thị thông báo trước khi tự động đóng (miliseconds). Mặc định 4000ms.
1909
- * @default 4000
1910
- */
1911
- duration?: number;
1912
- /**
1913
- * Vị trí hiển thị riêng cho thông báo này trên màn hình.
1914
- */
1915
- position?: ToastPosition;
1916
- /**
1917
- * Callback được gọi khi thông báo bị đóng/gỡ bỏ khỏi màn hình.
1918
- */
1919
- onDismiss?: (toast: ToastT) => void;
1920
- /**
1921
- * Callback được gọi khi thông báo tự động đóng do hết thời gian duration.
1922
- */
1923
- onAutoClose?: (toast: ToastT) => void;
1924
- }
1925
- /**
1926
- * Cấu trúc thông báo dạng Object chi tiết cho `toast.promise`.
1927
- */
1928
- interface ToastMessageObject {
1929
- title?: ReactNode;
1930
- description?: ReactNode;
1931
- color?: AlertColor;
1932
- variant?: AlertVariant;
1933
- }
1934
- /**
1935
- * Kiểu dữ liệu linh hoạt cho nội dung thông báo trả về trong `toast.promise`:
1936
- * - `ReactNode`: Chuỗi text hoặc phần tử JSX thông thường.
1937
- * - `ToastMessageObject`: Object chi tiết gồm `{ title, description, color, variant }`.
1938
- */
1939
- type ToastMessageResult = ReactNode | ToastMessageObject;
1940
- /**
1941
- * Hàm tạo nội dung thông báo thành công động dựa theo dữ liệu `data: T` trả về từ Promise.
1942
- */
1943
- type ToastPromiseFunction<T> = (data: T) => ToastMessageResult;
1944
- /**
1945
- * Cấu hình các trạng thái cho `toast.promise(promise, options)`.
1946
- */
1947
- interface ToastPromiseOptions<T = unknown> {
1948
- /**
1949
- * Nội dung hiển thị trong lúc Promise đang thực thi (Loading state).
1950
- */
1951
- loading: ToastMessageResult;
1952
- /**
1953
- * Nội dung hiển thị khi Promise thực thi thành công (Resolve state).
1954
- * Có thể truyền trực tiếp nội dung hoặc một hàm nhận `data: T`.
1955
- */
1956
- success: ToastMessageResult | ToastPromiseFunction<T>;
1957
- /**
1958
- * Nội dung hiển thị khi Promise gặp lỗi (Reject state).
1959
- * Có thể truyền trực tiếp nội dung hoặc một hàm nhận `error: unknown`.
1960
- */
1961
- error: ToastMessageResult | ((error: unknown) => ToastMessageResult);
1962
- /**
1963
- * Callback chạy sau khi Promise hoàn tất (cả khi resolve hoặc reject).
1964
- */
1965
- finally?: () => void | Promise<void>;
1966
- /**
1967
- * Thời gian hiển thị thông báo kết quả (ms). Mặc định 4000ms.
1968
- * @default 4000
1969
- */
1970
- duration?: number;
1971
- /**
1972
- * Kích cỡ của Alert hiển thị trong Toast.
1973
- */
1974
- size?: AlertSize;
1975
- /**
1976
- * Biến thể giao diện của Alert hiển thị trong Toast.
1977
- */
1978
- variant?: AlertVariant;
1979
- /**
1980
- * Tùy chỉnh độ bo góc của Alert hiển thị trong Toast.
1981
- */
1982
- radius?: AlertRadius;
1983
- }
1984
- /**
1985
- * Props cho component `<Toaster />` được mount tại root layout của ứng dụng.
1986
- */
1987
- interface ToasterProps extends ToasterProps$1 {
1988
- /**
1989
- * Vị trí mặc định của toàn bộ danh sách toasts trên màn hình.
1990
- * @default 'top-right'
1991
- */
1992
- position?: ToastPosition;
1993
- /**
1994
- * Số lượng toast tối đa hiển thị cùng lúc trước khi tự động xếp chồng 3D (stack).
1995
- * @default 3
1996
- */
1997
- visibleToasts?: number;
1998
- /**
1999
- * Mở rộng toàn bộ danh sách toasts thay vì gộp lại thành 1 stack 3D.
2000
- * - `false` (mặc định): Tự động gộp thẻ 3D, chỉ bung ra khi hover chuột.
2001
- * - `true`: Luôn luôn mở rộng trải dài toàn bộ danh sách.
2002
- * @default false
2003
- */
2004
- expand?: boolean;
2005
- /**
2006
- * Thời gian hiển thị mặc định của các toasts (miliseconds).
2007
- * @default 4000
2008
- */
2009
- duration?: number;
2010
- /**
2011
- * Cho phép hiển thị nút đóng `(X)` trên các toasts.
2012
- * @default true
2013
- */
2014
- closeButton?: boolean;
2015
- /**
2016
- * Tùy biến className bao ngoài container của Toaster.
2017
- */
2018
- className?: string;
2019
- }
1959
+ declare function ArrowUpIcon({ width, height, className, ...props }: SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
1960
+
1961
+ declare function ArrowDownIcon({ width, height, className, ...props }: SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
1962
+
1963
+ declare function SlidersHorizontalIcon({ width, height, className, ...props }: SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
1964
+
1965
+ declare function Alert({ size, variant, color, radius, title, description, icon, action, closable, onClose, closeAriaLabel, banner, titleClassName, descriptionClassName, actionClassName, iconClassName, closeButtonClassName, className, children, role, ref, ...props }: AlertProps): react_jsx_runtime.JSX.Element;
2020
1966
 
2021
1967
  declare function Toaster({ position, visibleToasts, expand, duration, closeButton, className, toastOptions, ...props }: ToasterProps): react_jsx_runtime.JSX.Element;
2022
1968
 
@@ -3099,7 +3045,6 @@ interface TabsContextValue {
3099
3045
  destroyInactiveTabPane: boolean;
3100
3046
  onCloseTab?: (key: string | number) => void;
3101
3047
  }
3102
- declare const TabsContext: react.Context<TabsContextValue | null>;
3103
3048
  declare function useTabsContext(): TabsContextValue;
3104
3049
 
3105
3050
  /**
@@ -4323,6 +4268,11 @@ interface CalendarProps {
4323
4268
  * Class CSS bổ sung cho container lịch
4324
4269
  */
4325
4270
  className?: string;
4271
+ /**
4272
+ * Hiển thị viền ngoài của Calendar
4273
+ * @default true
4274
+ */
4275
+ bordered?: boolean;
4326
4276
  }
4327
4277
  interface DatePickerConfig {
4328
4278
  /**
@@ -4541,11 +4491,16 @@ interface DatePickerProps {
4541
4491
  * Class CSS cho popover chứa lịch
4542
4492
  */
4543
4493
  popoverClassName?: string;
4494
+ /**
4495
+ * Có render popover thông qua Portal (gắn vào document.body) hay không
4496
+ * @default true
4497
+ */
4498
+ portal?: boolean;
4544
4499
  }
4545
4500
 
4546
- declare function DatePicker({ ref, value: controlledValue, defaultValue, onChange, format, displayFormat: customDisplayFormat, defaultView, locale, firstDayOfWeek, minDate, maxDate, isDateDisabled, size, variant, color, radius, label, labelPlacement, placeholder, helperText, errorMessage, name, id, autoComplete, viewTabs, view: controlledView, onViewChange, onClear, placement, disabled, readOnly, config, className, wrapperClassName, inputWrapperClassName, labelClassName, helperClassName, popoverClassName, }: DatePickerProps): react_jsx_runtime.JSX.Element;
4501
+ declare function DatePicker({ ref, value: controlledValue, defaultValue, onChange, format, displayFormat: customDisplayFormat, defaultView, locale, firstDayOfWeek, minDate, maxDate, isDateDisabled, size, variant, color, radius, label, labelPlacement, placeholder, helperText, errorMessage, name, id, autoComplete, viewTabs, view: controlledView, onViewChange, onClear, placement, disabled, readOnly, portal, config, className, wrapperClassName, inputWrapperClassName, labelClassName, helperClassName, popoverClassName, }: DatePickerProps): react_jsx_runtime.JSX.Element;
4547
4502
 
4548
- declare function Calendar({ value: selectedDate, onChange, view, onViewChange, minDate, maxDate, isDateDisabled, locale, firstDayOfWeek, showWeekNumbers, showViewTabs, viewTabs, size, color, radius, className, }: CalendarProps): react_jsx_runtime.JSX.Element;
4503
+ declare function Calendar({ value: selectedDate, onChange, view, onViewChange, minDate, maxDate, isDateDisabled, locale, firstDayOfWeek, showWeekNumbers, showViewTabs, viewTabs, size, color, radius, className, bordered, }: CalendarProps): react_jsx_runtime.JSX.Element;
4549
4504
 
4550
4505
  declare function CalendarHeader({ currentMonth, view, onViewChange, onPrevMonth, onNextMonth, onPrevYear, onNextYear, onPrevDecade, onNextDecade, size, color, locale, showMonthButtons, }: CalendarHeaderProps): react_jsx_runtime.JSX.Element;
4551
4506
 
@@ -4875,6 +4830,8 @@ interface DateRangeCalendarProps {
4875
4830
  radius?: DateRangePickerRadius;
4876
4831
  /** Custom CSS class cho container */
4877
4832
  className?: string;
4833
+ /** Hiển thị viền ngoài của Calendar @default true */
4834
+ bordered?: boolean;
4878
4835
  }
4879
4836
  /**
4880
4837
  * Cấu hình tập trung các cờ tính năng / trạng thái cho DateRangePicker
@@ -5101,11 +5058,16 @@ interface DateRangePickerProps {
5101
5058
  * CSS class bổ sung cho khung popover lịch
5102
5059
  */
5103
5060
  popoverClassName?: string;
5061
+ /**
5062
+ * Có render popover thông qua Portal (gắn vào document.body) hay không
5063
+ * @default true
5064
+ */
5065
+ portal?: boolean;
5104
5066
  }
5105
5067
 
5106
- declare function DateRangePicker({ ref, value: controlledValue, defaultValue, onChange, separator, format, displayFormat: customDisplayFormat, defaultView, locale, firstDayOfWeek, minDate, maxDate, isDateDisabled, size, variant, color, radius, label, labelPlacement, placeholder, helperText, errorMessage, name, id, autoComplete, viewTabs, view: controlledView, onViewChange, onClear, placement, disabled, readOnly, config, className, wrapperClassName, inputWrapperClassName, labelClassName, helperClassName, popoverClassName, }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
5068
+ declare function DateRangePicker({ ref, value: controlledValue, defaultValue, onChange, separator, format, displayFormat: customDisplayFormat, defaultView, locale, firstDayOfWeek, minDate, maxDate, isDateDisabled, size, variant, color, radius, label, labelPlacement, placeholder, helperText, errorMessage, name, id, autoComplete, viewTabs, view: controlledView, onViewChange, onClear, placement, disabled, readOnly, portal, config, className, wrapperClassName, inputWrapperClassName, labelClassName, helperClassName, popoverClassName, }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
5107
5069
 
5108
- declare function DateRangeCalendar({ value, onChange, view, onViewChange, minDate, maxDate, isDateDisabled, locale, firstDayOfWeek, showWeekNumbers, showViewTabs, viewTabs, size, color, radius, className, }: DateRangeCalendarProps): react_jsx_runtime.JSX.Element;
5070
+ declare function DateRangeCalendar({ value, onChange, view, onViewChange, minDate, maxDate, isDateDisabled, locale, firstDayOfWeek, showWeekNumbers, showViewTabs, viewTabs, size, color, radius, className, bordered, }: DateRangeCalendarProps): react_jsx_runtime.JSX.Element;
5109
5071
 
5110
5072
  declare function DateRangeHeader({ month1, month2, view, onViewChange, onPrevMonth, onNextMonth, onPrevYear, onNextYear, onPrevDecade, onNextDecade, size, color, locale, }: DateRangeHeaderProps): react_jsx_runtime.JSX.Element;
5111
5073
 
@@ -6180,80 +6142,6 @@ interface DateTimeRangePickerProps {
6180
6142
  */
6181
6143
  declare function DateTimeRangePicker({ ref, value: controlledValue, defaultValue, onChange, format: customFormat, displayFormat: customDisplayFormat, separator, startLabel, endLabel, layout, locale, defaultView, firstDayOfWeek, minDate, maxDate, isDateDisabled, viewTabs, use12Hours, showSeconds, hourStep, minuteStep, secondStep, minTime, maxTime, disabledHours, disabledMinutes, disabledSeconds, size, variant, color, radius, label, labelPlacement, placeholder, placeholders, helperText, errorMessage, name, id, autoComplete, disabled, readOnly, config, onClear, placement, className, wrapperClassName, inputWrapperClassName, labelClassName, helperClassName, popoverClassName, }: DateTimeRangePickerProps): react_jsx_runtime.JSX.Element;
6182
6144
 
6183
- type EmptySize = "sm" | "md" | "lg";
6184
- type EmptyPresetImage = "default" | "search" | "error" | "folder" | "simple";
6185
- type EmptyLayout = "vertical" | "horizontal";
6186
- interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
6187
- /**
6188
- * Ref chuyển tiếp đến phần tử HTML div
6189
- */
6190
- ref?: Ref<HTMLDivElement>;
6191
- /**
6192
- * Kích cỡ của Empty component:
6193
- * - 'sm': Nhỏ gọn, thích hợp cho dropdown, popover, bảng nhỏ
6194
- * - 'md': Tiêu chuẩn, thích hợp cho card, section, modal
6195
- * - 'lg': Lớn, thích hợp cho toàn trang, dashboard
6196
- * @default 'md'
6197
- */
6198
- size?: EmptySize;
6199
- /**
6200
- * Bố cục hiển thị:
6201
- * - 'vertical': Xếp dọc ảnh -> tiêu đề -> mô tả -> hành động
6202
- * - 'horizontal': Dàn ngang ảnh bên trái, nội dung & hành động bên phải
6203
- * @default 'vertical'
6204
- */
6205
- layout?: EmptyLayout;
6206
- /**
6207
- * Ảnh hoặc minh họa:
6208
- * - Tên preset: 'default' | 'search' | 'error' | 'folder' | 'simple'
6209
- * - URL hình ảnh (string bắt đầu bằng http://, https://, /, hoặc ./)
6210
- * - ReactNode tùy biến (SVG icon, custom component, v.v.)
6211
- * @default 'default'
6212
- */
6213
- image?: EmptyPresetImage | (string & {}) | ReactNode;
6214
- /**
6215
- * Kích thước tùy chỉnh cho ảnh / illustration (pixel hoặc chuỗi kích thước CSS)
6216
- */
6217
- imageSize?: number | string;
6218
- /**
6219
- * Class tùy biến cho phần bao ngoài của ảnh
6220
- */
6221
- imageClassName?: string;
6222
- /**
6223
- * Thuộc tính alt cho hình ảnh khi truyền URL
6224
- * @default 'Empty'
6225
- */
6226
- imageAlt?: string;
6227
- /**
6228
- * Tiêu đề của trạng thái rỗng
6229
- */
6230
- title?: ReactNode;
6231
- /**
6232
- * Class tùy biến cho tiêu đề
6233
- */
6234
- titleClassName?: string;
6235
- /**
6236
- * Đoạn văn bản mô tả chi tiết hoặc hướng dẫn thao tác
6237
- */
6238
- description?: ReactNode;
6239
- /**
6240
- * Class tùy biến cho phần mô tả
6241
- */
6242
- descriptionClassName?: string;
6243
- /**
6244
- * Nút bấm hoặc nhóm hành động bên dưới (Call-to-Action)
6245
- */
6246
- actions?: ReactNode;
6247
- /**
6248
- * Class tùy biến cho khu vực chứa actions
6249
- */
6250
- actionsClassName?: string;
6251
- /**
6252
- * Nội dung bổ sung tùy biến bên dưới hoặc thay thế
6253
- */
6254
- children?: ReactNode;
6255
- }
6256
-
6257
6145
  declare function Empty({ size, layout, image, imageSize, imageClassName, imageAlt, title, titleClassName, description, descriptionClassName, actions, actionsClassName, children, className, role, ref, ...props }: EmptyProps): react_jsx_runtime.JSX.Element;
6258
6146
 
6259
6147
  interface EmptyIllustrationProps extends SVGProps<SVGSVGElement> {
@@ -6261,185 +6149,40 @@ interface EmptyIllustrationProps extends SVGProps<SVGSVGElement> {
6261
6149
  }
6262
6150
  declare function EmptyIllustration({ preset, ...props }: EmptyIllustrationProps): react_jsx_runtime.JSX.Element;
6263
6151
 
6264
- type SelectSize = "xs" | "sm" | "md" | "lg" | "xl";
6265
- type SelectVariant = "outline" | "filled" | "ghost" | "other";
6266
- type SelectColor = "primary" | "secondary" | "error" | "success" | "warning" | "info" | "neutral";
6267
- type SelectRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
6268
- type SelectSearchMode = "client" | "server";
6269
- type SelectSearchPlacement = "trigger" | "menu" | "both";
6270
- type SelectFilterLayout = "vertical" | "grid";
6271
- interface SelectOptionItem<TData = unknown> {
6272
- value: string | number;
6273
- label: string;
6274
- disabled?: boolean;
6275
- description?: ReactNode;
6276
- icon?: ReactNode;
6277
- data?: TData;
6278
- }
6279
- type SelectFilterType = "string" | "text" | "number" | "date" | "date-range" | "checkbox-group" | "custom";
6280
- interface SelectFilterField<TValue = unknown> {
6281
- /** Tên định danh trường lọc (dùng làm key trong object filters) */
6282
- name: string;
6283
- /** Loại component lọc */
6284
- type: SelectFilterType;
6285
- /** Nhãn hiển thị của bộ lọc */
6286
- label?: ReactNode;
6287
- /** Placeholder cho input */
6288
- placeholder?: string;
6289
- /** Giá trị mặc định */
6290
- defaultValue?: TValue;
6291
- /** Giá trị điều khiển */
6292
- value?: TValue;
6293
- /** Số cột chiếm trong grid layout (1, 2, 3...) */
6294
- colSpan?: number;
6295
- /** Danh sách options (dùng cho checkbox-group hoặc select con) */
6296
- options?: {
6297
- label: ReactNode;
6298
- value: string | number;
6299
- disabled?: boolean;
6300
- }[];
6301
- /** Props truyền thêm vào component tương ứng (InputProps, DatePickerProps, ...) */
6302
- props?: Record<string, unknown>;
6303
- /** Custom render khi type="custom" */
6304
- render?: (fieldState: {
6305
- value: TValue | undefined;
6306
- onChange: (val: TValue) => void;
6307
- }) => ReactNode;
6308
- }
6309
- interface BaseSelectProps<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>> {
6310
- /** Ref chuyển tiếp tới root wrapper element */
6311
- ref?: Ref<HTMLDivElement>;
6312
- /** Kích thước: xs, sm, md, lg, xl. Mặc định 'md' */
6152
+ declare function Select<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>>({ ref, options, value, defaultValue, onChange, size, variant, color, radius, id: idProp, label, labelPlacement, placeholder, helperText, errorMessage, isInvalid: isInvalidProp, isDisabled, readOnly, isRequired, name, searchable, searchMode, searchPlacement, searchPlaceholder, searchField, searchValue: searchValueProp, onSearchChange, menuFilters, menuFilterValues: controlledFilterValues, menuFilterLayout, menuFilterGridCols, showResetFilters, resetFiltersText, onMenuFilterChange, menuHeader, menuFooter, listFooter, onSearch, debounceMs, filterFn, isLoading, emptyText, emptyProps, clearable, portal, placement, maxMenuHeight, animated, animationDuration, startContent, endContent, renderValue, renderOption, className, triggerClassName, menuClassName, labelClassName, ...props }: SelectProps<TData, TFilters>): react_jsx_runtime.JSX.Element;
6153
+
6154
+ declare function MultiSelect<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>>({ ref, options, value: valueProp, defaultValue, onChange, size, variant, color, radius, id: idProp, label, labelPlacement, placeholder, helperText, errorMessage, isInvalid: isInvalidProp, isDisabled, readOnly, isRequired, name, maxTagCount, searchable, searchMode, searchPlacement, searchPlaceholder, searchField, preserveSelected, searchValue: searchValueProp, onSearchChange, menuFilters, menuFilterValues: controlledFilterValues, menuFilterLayout, menuFilterGridCols, showResetFilters, resetFiltersText, onMenuFilterChange, menuHeader, menuFooter, listFooter, onSearch, debounceMs, filterFn, isLoading, emptyText, emptyProps, clearable, portal, placement, maxMenuHeight, animated, animationDuration, startContent, endContent, renderValue, renderOption, className, triggerClassName, menuClassName, labelClassName, ...props }: MultiSelectProps<TData, TFilters>): react_jsx_runtime.JSX.Element;
6155
+
6156
+ interface SingleSelectTriggerProps<TData = unknown> {
6157
+ id?: string;
6158
+ selectedOption: SelectOptionItem<TData> | null;
6159
+ isOpen: boolean;
6313
6160
  size?: SelectSize;
6314
- /** Biến thể giao diện: outline, filled, ghost, other. Mặc định 'outline' */
6315
6161
  variant?: SelectVariant;
6316
- /** Chủ đề màu sắc: primary, secondary, error, success, warning, info, neutral. Mặc định 'primary' */
6317
6162
  color?: SelectColor;
6318
- /** Độ bo góc: none, sm, md, lg, xl, full */
6319
6163
  radius?: SelectRadius;
6320
- /** Danh sách các tùy chọn */
6321
- options: SelectOptionItem<TData>[];
6322
- /** ID định danh cho Select */
6323
- id?: string;
6324
- /** Nhãn tiêu đề của Select */
6325
- label?: ReactNode;
6326
- /** Vị trí nhãn: top, left, floating. Mặc định 'top' */
6327
- labelPlacement?: LabelPlacement;
6328
- /** Văn bản gợi ý khi chưa chọn */
6329
6164
  placeholder?: string;
6330
- /** Văn bản hướng dẫn bên dưới */
6331
- helperText?: ReactNode;
6332
- /** Thông báo lỗi khi không hợp lệ */
6333
- errorMessage?: ReactNode;
6334
- /** Trạng thái không hợp lệ */
6335
- isInvalid?: boolean;
6336
- /** Bắt buộc chọn */
6337
- isRequired?: boolean;
6338
- /** Vô hiệu hóa Select */
6339
- isDisabled?: boolean;
6340
- /** Chỉ đọc, không cho phép thay đổi */
6341
- isReadOnly?: boolean;
6342
- /** Alias cho isReadOnly */
6165
+ disabled?: boolean;
6343
6166
  readOnly?: boolean;
6344
- /** Tên trường form HTML để submit */
6345
- name?: string;
6346
- /** Cho phép tìm kiếm. Mặc định false */
6167
+ isInvalid?: boolean;
6347
6168
  searchable?: boolean;
6348
- /** Chế độ tìm kiếm: 'client' (fuzzy search) hoặc 'server' (debounce + API). Mặc định 'client' */
6349
- searchMode?: SelectSearchMode;
6350
- /** Vị trí ô tìm kiếm: 'trigger' (trên trigger), 'menu' (trong dropdown), 'both'. Mặc định 'trigger' */
6351
6169
  searchPlacement?: SelectSearchPlacement;
6352
- /** Placeholder cho ô tìm kiếm */
6353
- searchPlaceholder?: string;
6354
- /** Giá trị từ khóa tìm kiếm (khi controlled) */
6355
6170
  searchValue?: string;
6356
- /** Callback khi từ khóa thay đổi */
6357
- onSearchChange?: (value: string) => void;
6358
- /** Cấu hình danh sách các bộ lọc hiển thị bên trong dropdown menu */
6359
- menuFilters?: SelectFilterField<unknown>[];
6360
- /** Giá trị điều khiển cho các bộ lọc trong menu */
6361
- menuFilterValues?: Partial<TFilters>;
6362
- /** Bố cục danh sách bộ lọc: 'vertical' hoặc 'grid'. Mặc định 'vertical' */
6363
- menuFilterLayout?: SelectFilterLayout;
6364
- /** Số cột khi menuFilterLayout='grid'. Mặc định 2 */
6365
- menuFilterGridCols?: number;
6366
- /** Hiển thị nút Reset / Xóa bộ lọc. Mặc định true khi có menuFilters */
6367
- showResetFilters?: boolean;
6368
- /** Văn bản nút Reset bộ lọc. Mặc định 'Xoá bộ lọc' */
6369
- resetFiltersText?: ReactNode;
6370
- /** Callback khi bất kỳ filter nào trong menu thay đổi */
6371
- onMenuFilterChange?: (filters: TFilters) => void;
6372
- /** Nội dung tùy biến trên đầu menu (trước hoặc thay thế filter) */
6373
- menuHeader?: ReactNode;
6374
- /** Nội dung tùy biến dưới đáy menu */
6375
- menuFooter?: ReactNode;
6376
- /** Callback được gọi sau khi debounce khi search query hoặc menu filters thay đổi (ở Server mode) */
6377
- onSearch?: (query: string, filters: TFilters) => void | Promise<void>;
6378
- /** Thời gian trì hoãn debounce tính theo ms. Mặc định 300 */
6379
- debounceMs?: number;
6380
- /** Hàm custom predicate lọc options ở chế độ client */
6381
- filterFn?: (option: SelectOptionItem<TData>, query: string, filters: TFilters) => boolean;
6382
- /** Trạng thái đang tải dữ liệu */
6383
- loading?: boolean;
6384
- /** Alias cho loading (chuẩn hoá theo Design System form inputs) */
6385
- isLoading?: boolean;
6386
- /** Văn bản hiển thị khi không có dữ liệu */
6387
- emptyText?: ReactNode;
6388
- /** Props tùy biến chuyển tiếp đến component Empty */
6389
- emptyProps?: Partial<EmptyProps>;
6390
- /** Hiển thị nút xoá nhanh toàn bộ giá trị đã chọn */
6171
+ onSearchChange?: (val: string) => void;
6172
+ onClear?: (e: react.MouseEvent) => void;
6391
6173
  clearable?: boolean;
6392
- /** Render menu qua Portal để tránh bị che bởi overflow hidden. Mặc định true */
6393
- portal?: boolean;
6394
- /** Vị trí hiển thị của popup dropdown. Mặc định 'bottom-start' */
6395
- placement?: Placement;
6396
- /** Chiều cao tối đa của vùng cuộn menu. Mặc định 280px */
6397
- maxMenuHeight?: number | string;
6398
- /** Icon hoặc nội dung ở đầu trigger */
6174
+ isLoading?: boolean;
6399
6175
  startContent?: ReactNode;
6400
- /** Icon hoặc nội dung ở cuối trigger */
6401
6176
  endContent?: ReactNode;
6402
- /** Tùy biến render giá trị hiển thị trên trigger */
6403
- renderValue?: (selected: SelectOptionItem<TData> | SelectOptionItem<TData>[]) => ReactNode;
6404
- /** Tùy biến render từng option trong menu */
6405
- renderOption?: (option: SelectOptionItem<TData>, state: {
6406
- selected: boolean;
6407
- active: boolean;
6408
- }) => ReactNode;
6409
- /** ClassName tùy biến cho wrapper ngoài cùng */
6177
+ renderValue?: (selected: SelectOptionItem<TData>) => ReactNode;
6178
+ triggerRef: (node: HTMLElement | null) => void;
6179
+ getReferenceProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
6180
+ onKeyDown?: (e: react.KeyboardEvent<HTMLInputElement>) => void;
6410
6181
  className?: string;
6411
- /** ClassName cho phần trigger box */
6412
- triggerClassName?: string;
6413
- /** ClassName cho popup dropdown menu */
6414
- menuClassName?: string;
6415
- }
6416
- type SingleSelectProps<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>> = BaseSelectProps<TData, TFilters> & {
6417
- /** Chế độ chọn đơn */
6418
- multiple?: false;
6419
- /** Giá trị đã chọn (controlled) */
6420
- value?: string | number | null;
6421
- /** Giá trị mặc định ban đầu (uncontrolled) */
6422
- defaultValue?: string | number | null;
6423
- /** Callback khi giá trị thay đổi */
6424
- onChange?: (value: string | number | null, option?: SelectOptionItem<TData> | null) => void;
6425
- };
6426
- type MultiSelectProps<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>> = BaseSelectProps<TData, TFilters> & {
6427
- /** Chế độ chọn nhiều */
6428
- multiple: true;
6429
- /** Danh sách giá trị đã chọn (controlled) */
6430
- value?: (string | number)[];
6431
- /** Danh sách giá trị mặc định ban đầu (uncontrolled) */
6432
- defaultValue?: (string | number)[];
6433
- /** Callback khi giá trị thay đổi */
6434
- onChange?: (values: (string | number)[], options?: SelectOptionItem<TData>[]) => void;
6435
- /** Giới hạn số lượng tag Badge hiển thị trước khi gom thành +N */
6436
- maxTagCount?: number;
6437
- };
6438
- type SelectProps<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>> = SingleSelectProps<TData, TFilters> | MultiSelectProps<TData, TFilters>;
6439
-
6440
- declare function Select<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>>(props: SelectProps<TData, TFilters>): react_jsx_runtime.JSX.Element;
6182
+ }
6183
+ declare function SingleSelectTrigger<TData = unknown>({ id, selectedOption, isOpen, size, variant, color, radius, placeholder, disabled, readOnly, isInvalid, searchable, searchPlacement, searchValue, onSearchChange, onClear, clearable, isLoading, startContent, endContent, renderValue, triggerRef, getReferenceProps, onKeyDown, className, }: SingleSelectTriggerProps<TData>): react_jsx_runtime.JSX.Element;
6441
6184
 
6442
- interface SelectTriggerProps<TData = unknown> {
6185
+ interface MultiSelectTriggerProps<TData = unknown> {
6443
6186
  id?: string;
6444
6187
  selectedOptions: SelectOptionItem<TData>[];
6445
6188
  isOpen: boolean;
@@ -6451,42 +6194,44 @@ interface SelectTriggerProps<TData = unknown> {
6451
6194
  disabled?: boolean;
6452
6195
  readOnly?: boolean;
6453
6196
  isInvalid?: boolean;
6454
- multiple?: boolean;
6455
6197
  maxTagCount?: number;
6456
6198
  searchable?: boolean;
6457
6199
  searchPlacement?: SelectSearchPlacement;
6458
6200
  searchValue?: string;
6459
6201
  onSearchChange?: (val: string) => void;
6460
6202
  onRemoveTag?: (option: SelectOptionItem<TData>) => void;
6461
- onClear?: (e: react__default.MouseEvent) => void;
6203
+ onClear?: (e: react.MouseEvent) => void;
6462
6204
  clearable?: boolean;
6463
- loading?: boolean;
6464
6205
  isLoading?: boolean;
6465
6206
  startContent?: ReactNode;
6466
6207
  endContent?: ReactNode;
6467
- renderValue?: (selected: SelectOptionItem<TData> | SelectOptionItem<TData>[]) => ReactNode;
6208
+ renderValue?: (selected: SelectOptionItem<TData>[]) => ReactNode;
6468
6209
  triggerRef: (node: HTMLElement | null) => void;
6469
6210
  getReferenceProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
6470
- onKeyDown?: (e: react__default.KeyboardEvent<HTMLInputElement>) => void;
6211
+ onKeyDown?: (e: react.KeyboardEvent<HTMLInputElement>) => void;
6471
6212
  className?: string;
6472
6213
  }
6473
- declare function SelectTrigger<TData = unknown>({ id, selectedOptions, isOpen, size, variant, color, radius, placeholder, disabled, readOnly, isInvalid, multiple, maxTagCount, searchable, searchPlacement, searchValue, onSearchChange, onRemoveTag, onClear, clearable, loading: loadingProp, isLoading: isLoadingProp, startContent, endContent, renderValue, triggerRef, getReferenceProps, onKeyDown, className, }: SelectTriggerProps<TData>): react_jsx_runtime.JSX.Element;
6214
+ declare function MultiSelectTrigger<TData = unknown>({ id, selectedOptions, isOpen, size, variant, color, radius, placeholder, disabled, readOnly, isInvalid, maxTagCount, searchable, searchPlacement, searchValue, onSearchChange, onRemoveTag, onClear, clearable, isLoading, startContent, endContent, renderValue, triggerRef, getReferenceProps, onKeyDown, className, }: MultiSelectTriggerProps<TData>): react_jsx_runtime.JSX.Element;
6474
6215
 
6475
6216
  interface SelectMenuProps<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>> {
6476
6217
  isOpen: boolean;
6218
+ isMounted?: boolean;
6219
+ animated?: boolean;
6220
+ transitionStyles?: CSSProperties;
6477
6221
  options: SelectOptionItem<TData>[];
6478
6222
  selectedValues: (string | number)[];
6479
6223
  activeIndex: number | null;
6480
6224
  size?: SelectSize;
6481
6225
  color?: SelectColor;
6482
6226
  radius?: SelectRadius;
6483
- loading?: boolean;
6227
+ isLoading?: boolean;
6484
6228
  portal?: boolean;
6485
6229
  maxMenuHeight?: number | string;
6486
6230
  emptyText?: ReactNode;
6487
6231
  emptyProps?: Partial<EmptyProps>;
6488
6232
  menuHeader?: ReactNode;
6489
6233
  menuFooter?: ReactNode;
6234
+ listFooter?: ReactNode;
6490
6235
  menuFilters?: SelectFilterField<unknown>[];
6491
6236
  menuFilterValues?: Partial<TFilters>;
6492
6237
  menuFilterLayout?: SelectFilterLayout;
@@ -6504,10 +6249,10 @@ interface SelectMenuProps<TData = unknown, TFilters extends Record<string, unkno
6504
6249
  floatingStyles: CSSProperties;
6505
6250
  floatingRef: (node: HTMLElement | null) => void;
6506
6251
  getFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
6507
- listElementsRef: react__default.RefObject<(HTMLElement | null)[]>;
6252
+ listElementsRef: react.RefObject<(HTMLElement | null)[]>;
6508
6253
  className?: string;
6509
6254
  }
6510
- declare function SelectMenu<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>>({ isOpen, options, selectedValues, activeIndex, size, color, radius, loading, portal, maxMenuHeight, emptyText, emptyProps, menuHeader, menuFooter, menuFilters, menuFilterValues, menuFilterLayout, menuFilterGridCols, showResetFilters, resetFiltersText, onMenuFilterChange, onResetFilters, renderOption, onSelectOption, onOptionMouseEnter, floatingStyles, floatingRef, getFloatingProps, listElementsRef, className, }: SelectMenuProps<TData, TFilters>): react_jsx_runtime.JSX.Element | null;
6255
+ declare function SelectMenu<TData = unknown, TFilters extends Record<string, unknown> = Record<string, unknown>>({ isOpen, isMounted, animated, transitionStyles, options, selectedValues, activeIndex, size, color, radius, isLoading, portal, maxMenuHeight, emptyText, emptyProps, menuHeader, menuFooter, listFooter, menuFilters, menuFilterValues, menuFilterLayout, menuFilterGridCols, showResetFilters, resetFiltersText, onMenuFilterChange, onResetFilters, renderOption, onSelectOption, onOptionMouseEnter, floatingStyles, floatingRef, getFloatingProps, listElementsRef, className, }: SelectMenuProps<TData, TFilters>): react_jsx_runtime.JSX.Element | null;
6511
6256
 
6512
6257
  interface SelectMenuFilterProps<TFilters extends Record<string, unknown> = Record<string, unknown>> {
6513
6258
  filters: SelectFilterField<unknown>[];
@@ -6521,7 +6266,7 @@ interface SelectMenuFilterProps<TFilters extends Record<string, unknown> = Recor
6521
6266
  color?: SelectColor;
6522
6267
  radius?: SelectRadius;
6523
6268
  }
6524
- declare function SelectMenuFilter<TFilters extends Record<string, unknown> = Record<string, unknown>>({ filters, values, onChange, onReset, layout, gridCols, showReset, resetText, color, radius, }: SelectMenuFilterProps<TFilters>): react_jsx_runtime.JSX.Element | null;
6269
+ declare function SelectMenuFilter<TFilters extends Record<string, unknown> = Record<string, unknown>>({ filters, values, onChange, onReset, showReset, resetText, color, radius, }: SelectMenuFilterProps<TFilters>): react_jsx_runtime.JSX.Element | null;
6525
6270
 
6526
6271
  interface SelectOptionProps<TData = unknown> {
6527
6272
  option: SelectOptionItem<TData>;
@@ -6541,6 +6286,14 @@ interface SelectOptionProps<TData = unknown> {
6541
6286
  }
6542
6287
  declare function SelectOption<TData = unknown>({ option, isSelected, isActive, size, color, radius, disabled, renderOption, onClick, onMouseEnter, ref, }: SelectOptionProps<TData>): react_jsx_runtime.JSX.Element;
6543
6288
 
6289
+ type UseAnimatedErrorOptions = {
6290
+ exitDuration?: number;
6291
+ };
6292
+ declare function useAnimatedError(errorMessage: ReactNode, options?: UseAnimatedErrorOptions): {
6293
+ displayedError: ReactNode;
6294
+ isExiting: boolean;
6295
+ };
6296
+
6544
6297
  /**
6545
6298
  * Custom hook to debounce a value by a given delay in milliseconds.
6546
6299
  *
@@ -6563,368 +6316,196 @@ declare function useDebouncedCallback<Args extends unknown[], R = void>(callback
6563
6316
  cancel: () => void;
6564
6317
  };
6565
6318
 
6566
- type UploadImageShape = "rectangle" | "square";
6567
- type UploadImageViewMode = "dropzone" | "card-grid" | "button";
6568
- type UploadImageSize = "xs" | "sm" | "md" | "lg" | "xl";
6569
- type UploadImageColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
6570
- type UploadImageRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
6571
- type UploadImageVariant = "outline" | "filled" | "ghost" | "other";
6572
- interface UploadFileItem {
6573
- id: string;
6574
- name: string;
6575
- size?: number;
6576
- type?: string;
6577
- url?: string;
6578
- file?: File;
6579
- status?: "idle" | "uploading" | "success" | "error";
6580
- progress?: number;
6581
- errorMessage?: string;
6582
- }
6583
- interface UploadImageProps {
6319
+ interface UseFloatingTransitionOptions {
6584
6320
  /**
6585
- * List or single file item managed by the component
6321
+ * Transition duration in milliseconds.
6322
+ * Can be a number or an object with `open` and `close` durations.
6323
+ * @default 150
6586
6324
  */
6587
- value?: UploadFileItem[] | UploadFileItem | string[] | string;
6325
+ duration?: number | {
6326
+ open?: number;
6327
+ close?: number;
6328
+ };
6588
6329
  /**
6589
- * Initial default value (uncontrolled)
6330
+ * Distance offset in pixels to translate from initially and when closing.
6331
+ * @default 4
6590
6332
  */
6591
- defaultValue?: UploadFileItem[] | UploadFileItem | string[] | string;
6333
+ offset?: number;
6592
6334
  /**
6593
- * Callback triggered when the file list changes
6335
+ * Scale factor when closed / unmounted.
6336
+ * @default 0.96
6594
6337
  */
6595
- onChange?: (items: UploadFileItem[]) => void;
6338
+ scale?: number;
6596
6339
  /**
6597
- * Callback triggered when a file item is removed
6340
+ * Whether transitions should animate. If false, duration is 0.
6341
+ * @default true
6598
6342
  */
6599
- onRemove?: (item: UploadFileItem, index: number) => void;
6343
+ animated?: boolean;
6344
+ }
6345
+ declare function useFloatingTransition(context: FloatingContext, options?: UseFloatingTransitionOptions): {
6346
+ isMounted: boolean;
6347
+ styles: React.CSSProperties;
6348
+ };
6349
+
6350
+ /**
6351
+ * Lấy cấu hình tương ứng theo `key` từ đối tượng `configMap` (sizeConfig, radiusConfig, variantConfig, colorConfig...),
6352
+ * nếu `key` không hợp lệ hoặc không tồn tại trong `configMap`, sẽ trả về giá trị an toàn của `fallbackKey`.
6353
+ *
6354
+ * @param key - Khóa được truyền vào (size, radius, variant... có thể undefined, null hoặc chuỗi bất kỳ)
6355
+ * @param configMap - Đối tượng ánh xạ cấu hình
6356
+ * @param fallbackKey - Khóa dự phòng khi không tìm thấy (fallback an toàn)
6357
+ * @returns Cấu hình tương ứng của khóa đó
6358
+ */
6359
+ declare function getSafeConfig<TConfig, TKey extends PropertyKey = string>(key: TKey | undefined | null, configMap: Record<TKey, TConfig>, fallbackKey: TKey): TConfig;
6360
+ /**
6361
+ * Lọc và xếp hạng danh sách phần tử theo từ khóa tìm kiếm (Fuzzy Search qua @tanstack/match-sorter-utils).
6362
+ *
6363
+ * @param items - Danh sách các phần tử cần lọc
6364
+ * @param query - Từ khóa tìm kiếm
6365
+ * @param fields - Một trường hoặc danh sách các trường (hoặc hàm accessor) để so khớp
6366
+ * @returns Danh sách phần tử khớp, đã được sắp xếp theo độ tương quan cao nhất
6367
+ */
6368
+ declare function rankAndFilterItems<T>(items: T[], query: string, fields?: (keyof T | string | ((item: T) => string | undefined | null))[] | (keyof T | string)): T[];
6369
+
6370
+ /**
6371
+ * Các kích thước chiều rộng tiêu chuẩn của Modal:
6372
+ * - 'xs': 320px (nhỏ gọn, dành cho thông báo nhanh)
6373
+ * - 'sm': 400px (dành cho form ngắn, xác nhận)
6374
+ * - 'md': 540px (chuẩn mặc định cho đa số form)
6375
+ * - 'lg': 720px (dành cho form phức tạp, upload ảnh)
6376
+ * - 'xl': 960px (dành cho bảng dữ liệu, preview tài liệu)
6377
+ * - 'full': Toàn màn hình
6378
+ */
6379
+ type ModalSize = "xs" | "sm" | "md" | "lg" | "xl" | "full";
6380
+ /**
6381
+ * Các mức bo góc của khung hộp thoại Modal:
6382
+ * - 'none': Không bo góc (vuông vức)
6383
+ * - 'sm': Bo góc nhẹ (rounded-sm)
6384
+ * - 'md': Bo góc vừa (rounded-md)
6385
+ * - 'lg': Bo góc lớn (rounded-lg)
6386
+ * - 'xl': Bo góc rất lớn (rounded-xl)
6387
+ * - 'full': Bo tròn hoàn toàn (rounded-3xl)
6388
+ */
6389
+ type ModalRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
6390
+ /**
6391
+ * Props cho component `<Modal>` (Khung giao diện hộp thoại dialog box)
6392
+ */
6393
+ interface ModalProps extends HTMLAttributes<HTMLDivElement> {
6600
6394
  /**
6601
- * Callback triggered when an image preview is requested
6395
+ * Ref chuyển tiếp (forwardRef) trỏ trực tiếp đến thẻ div hộp thoại
6602
6396
  */
6603
- onPreview?: (item: UploadFileItem) => void;
6397
+ ref?: Ref<HTMLDivElement>;
6604
6398
  /**
6605
- * Whether to allow multiple file uploads
6606
- * @default false
6399
+ * Kích thước chiều rộng của hộp thoại
6400
+ * @default 'md'
6607
6401
  */
6608
- multiple?: boolean;
6402
+ size?: ModalSize;
6609
6403
  /**
6610
- * Maximum number of allowed files
6611
- * @default 1 when multiple=false, unlimited when multiple=true
6404
+ * Tùy chỉnh độ bo góc của hộp thoại.
6405
+ * Nếu không truyền, mặc định sẽ áp dụng bo góc `rounded-lg`.
6612
6406
  */
6613
- maxCount?: number;
6407
+ radius?: ModalRadius;
6614
6408
  /**
6615
- * Maximum file size in bytes
6616
- * Example: 5 * 1024 * 1024 (5MB)
6409
+ * Class tùy biến CSS cho container bao ngoài hộp thoại
6617
6410
  */
6618
- maxSize?: number;
6411
+ className?: string;
6619
6412
  /**
6620
- * Accepted file MIME types or extensions
6621
- * @default "image/*"
6413
+ * Nội dung bên trong hộp thoại (thường là `<ModalHeader>`, `<ModalBody>`, `<ModalFooter>`)
6622
6414
  */
6623
- accept?: string;
6415
+ children?: ReactNode;
6416
+ }
6417
+ /**
6418
+ * Props cho component `<ModalHeader>` (Phần đầu của hộp thoại Modal)
6419
+ */
6420
+ interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
6624
6421
  /**
6625
- * Custom hook executed before upload to validate or transform file.
6626
- * Return `true` to proceed, `false` or error message string to reject.
6422
+ * Kích thước áp dụng cho tiêu đề khoảng cách padding trong header
6423
+ * @default 'md'
6627
6424
  */
6628
- beforeUpload?: (file: File) => boolean | string | Promise<boolean | string>;
6425
+ size?: ModalSize;
6629
6426
  /**
6630
- * Display mode:
6631
- * - 'dropzone': Large drag and drop area with title and description
6632
- * - 'card-grid': Thumbnail card grid (picture wall)
6633
- * - 'button': Compact trigger button
6634
- * @default 'dropzone'
6427
+ * Tiêu đề chính của Modal (dạng text string hoặc ReactNode)
6635
6428
  */
6636
- viewMode?: UploadImageViewMode;
6429
+ title?: ReactNode;
6637
6430
  /**
6638
- * Shape of the container
6639
- * @default 'rectangle' for dropzone, 'square' for card-grid
6431
+ * Đoạn văn bản mô tả phụ bên dưới tiêu đề
6640
6432
  */
6641
- shape?: UploadImageShape;
6433
+ description?: ReactNode;
6642
6434
  /**
6643
- * 5 standard size levels (xs, sm, md, lg, xl)
6644
- * @default 'md'
6435
+ * Class tùy biến CSS riêng cho phần text tiêu đề (Title)
6645
6436
  */
6646
- size?: UploadImageSize;
6437
+ titleClassName?: string;
6647
6438
  /**
6648
- * Design System color theme (primary, secondary, neutral, error, success, warning, info)
6649
- * @default 'primary'
6439
+ * Class tùy biến CSS riêng cho phần text tả (Description)
6650
6440
  */
6651
- color?: UploadImageColor;
6441
+ descriptionClassName?: string;
6652
6442
  /**
6653
- * Visual variant (outline, filled, ghost, other)
6654
- * @default 'outline'
6443
+ * Cho phép hiển thị nút đóng (X) góc phải của header
6444
+ * @default true
6655
6445
  */
6656
- variant?: UploadImageVariant;
6446
+ showCloseButton?: boolean;
6657
6447
  /**
6658
- * Corner radius
6659
- * @default based on size
6448
+ * Callback tùy biến khi người dùng click vào nút đóng (X).
6449
+ * Luôn kết hợp kích hoạt hiệu ứng exit animation của ModalContainer.
6660
6450
  */
6661
- radius?: UploadImageRadius;
6451
+ onClose?: () => void;
6662
6452
  /**
6663
- * Label text above the upload container
6453
+ * Class tùy biến CSS cho nút bấm đóng (X)
6664
6454
  */
6665
- label?: ReactNode;
6455
+ closeButtonClassName?: string;
6666
6456
  /**
6667
- * Helper or instruction text below the upload container
6457
+ * Class tùy biến CSS cho toàn bộ khối header
6668
6458
  */
6669
- helperText?: ReactNode;
6459
+ className?: string;
6670
6460
  /**
6671
- * Error message to display
6461
+ * Nội dung ReactNode tùy chỉnh thêm vào bên trong header
6672
6462
  */
6673
- errorMessage?: ReactNode;
6463
+ children?: ReactNode;
6464
+ }
6465
+ /**
6466
+ * Props cho component `<ModalBody>` (Phần thân chứa nội dung chính cuộn được của Modal)
6467
+ */
6468
+ interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
6674
6469
  /**
6675
- * Whether the field is in an invalid/error state
6470
+ * Kích thước áp dụng cho khoảng cách padding và cỡ chữ bên trong body
6471
+ * @default 'md'
6676
6472
  */
6677
- isInvalid?: boolean;
6473
+ size?: ModalSize;
6678
6474
  /**
6679
- * Whether the component is disabled
6680
- * @default false
6475
+ * Class tùy biến CSS cho toàn bộ khối body (hỗ trợ overflow cuộn dọc)
6681
6476
  */
6682
- disabled?: boolean;
6477
+ className?: string;
6683
6478
  /**
6684
- * Whether the component is in read-only mode
6685
- * @default false
6479
+ * Nội dung chính hiển thị bên trong body (Form nhập liệu, Danh sách, Văn bản...)
6686
6480
  */
6687
- readOnly?: boolean;
6481
+ children?: ReactNode;
6482
+ }
6483
+ /**
6484
+ * Props cho component `<ModalFooter>` (Phần chân trang chứa các nút hành động xác nhận/hủy)
6485
+ */
6486
+ interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {
6688
6487
  /**
6689
- * Whether the component is in a loading state
6690
- * @default false
6488
+ * Kích thước áp dụng cho padding khoảng cách gap giữa các nút bấm
6489
+ * @default 'md'
6691
6490
  */
6692
- isLoading?: boolean;
6491
+ size?: ModalSize;
6693
6492
  /**
6694
- * Custom title text inside the Dropzone area
6493
+ * Class tùy biến CSS cho toàn bộ khối footer
6695
6494
  */
6696
- dropzoneTitle?: ReactNode;
6495
+ className?: string;
6697
6496
  /**
6698
- * Custom description text inside the Dropzone area
6497
+ * Các nút bấm hành động (ví dụ: `<Button>Hủy</Button>`, `<Button color="primary">Lưu</Button>`)
6699
6498
  */
6700
- dropzoneDescription?: ReactNode;
6499
+ children?: ReactNode;
6500
+ }
6501
+ /**
6502
+ * Props cho component `<ModalContainer>` (Tầng Wrapper quản lý Overlay Backdrop, Native Dialog, ESC & Animation)
6503
+ */
6504
+ interface ModalContainerProps extends HTMLAttributes<HTMLDialogElement> {
6701
6505
  /**
6702
- * Custom upload icon
6506
+ * Trạng thái hiển thị mở/đóng modal (Controlled State)
6703
6507
  */
6704
- icon?: ReactNode;
6705
- /**
6706
- * Text for button trigger when viewMode="button"
6707
- */
6708
- buttonText?: ReactNode;
6709
- /**
6710
- * Custom item renderer for the thumbnail list
6711
- */
6712
- renderItem?: (item: UploadFileItem, index: number, actions: {
6713
- remove: () => void;
6714
- preview: () => void;
6715
- }) => ReactNode;
6716
- /**
6717
- * Custom CSS class for outer container
6718
- */
6719
- className?: string;
6720
- /**
6721
- * Custom CSS class for Dropzone/Trigger area
6722
- */
6723
- dropzoneClassName?: string;
6724
- /**
6725
- * Custom CSS class for preview list
6726
- */
6727
- previewClassName?: string;
6728
- /**
6729
- * Accessible aria-label for the interactive area
6730
- */
6731
- ariaLabel?: string;
6732
- }
6733
-
6734
- declare function UploadImage({ value, defaultValue, onChange, onRemove, onPreview, multiple, maxCount, maxSize, accept, beforeUpload, viewMode, shape, size, color, variant, radius, label, helperText, errorMessage, isInvalid: isInvalidProp, disabled, readOnly, isLoading, dropzoneTitle, dropzoneDescription, icon, buttonText, renderItem, className, dropzoneClassName, previewClassName, ariaLabel, }: UploadImageProps): react_jsx_runtime.JSX.Element;
6735
-
6736
- interface UploadImageDropzoneProps {
6737
- size?: UploadImageSize;
6738
- color?: UploadImageColor;
6739
- variant?: UploadImageVariant;
6740
- radius?: UploadImageRadius;
6741
- shape?: UploadImageShape;
6742
- disabled?: boolean;
6743
- readOnly?: boolean;
6744
- isLoading?: boolean;
6745
- isDragging?: boolean;
6746
- isInvalid?: boolean;
6747
- dropzoneTitle?: ReactNode;
6748
- dropzoneDescription?: ReactNode;
6749
- icon?: ReactNode;
6750
- onTriggerUpload: () => void;
6751
- className?: string;
6752
- describedById?: string;
6753
- }
6754
- declare function UploadImageDropzone({ size, color, variant, radius, shape, disabled, readOnly, isLoading, isDragging, isInvalid, dropzoneTitle, dropzoneDescription, icon, onTriggerUpload, className, describedById, }: UploadImageDropzoneProps): react_jsx_runtime.JSX.Element;
6755
-
6756
- interface UploadImageListProps {
6757
- items: UploadFileItem[];
6758
- size: UploadImageSize;
6759
- color?: UploadImageColor;
6760
- variant?: UploadImageVariant;
6761
- radius: UploadImageRadius;
6762
- disabled?: boolean;
6763
- readOnly?: boolean;
6764
- maxCount?: number;
6765
- onRemove: (item: UploadFileItem, index: number) => void;
6766
- onPreview: (item: UploadFileItem) => void;
6767
- onTriggerUpload: () => void;
6768
- renderItem?: (item: UploadFileItem, index: number, actions: {
6769
- remove: () => void;
6770
- preview: () => void;
6771
- }) => ReactNode;
6772
- showAddButton?: boolean;
6773
- className?: string;
6774
- }
6775
- declare function UploadImageList({ items, size, radius, disabled, readOnly, maxCount, onRemove, onPreview, onTriggerUpload, renderItem, showAddButton, className, }: UploadImageListProps): react_jsx_runtime.JSX.Element;
6776
-
6777
- declare function formatBytes(bytes: number, decimals?: number): string;
6778
- interface ValidateFileOptions {
6779
- maxSize?: number;
6780
- accept?: string;
6781
- }
6782
- declare function validateFile(file: File, options?: ValidateFileOptions): {
6783
- isValid: boolean;
6784
- error?: string;
6785
- };
6786
- declare function createFileItem(file: File, url?: string): UploadFileItem;
6787
- declare function revokeFileItem(item: UploadFileItem): void;
6788
-
6789
- /**
6790
- * Các kích thước chiều rộng tiêu chuẩn của Modal:
6791
- * - 'xs': 320px (nhỏ gọn, dành cho thông báo nhanh)
6792
- * - 'sm': 400px (dành cho form ngắn, xác nhận)
6793
- * - 'md': 540px (chuẩn mặc định cho đa số form)
6794
- * - 'lg': 720px (dành cho form phức tạp, upload ảnh)
6795
- * - 'xl': 960px (dành cho bảng dữ liệu, preview tài liệu)
6796
- * - 'full': Toàn màn hình
6797
- */
6798
- type ModalSize = "xs" | "sm" | "md" | "lg" | "xl" | "full";
6799
- /**
6800
- * Các mức bo góc của khung hộp thoại Modal:
6801
- * - 'none': Không bo góc (vuông vức)
6802
- * - 'sm': Bo góc nhẹ (rounded-sm)
6803
- * - 'md': Bo góc vừa (rounded-md)
6804
- * - 'lg': Bo góc lớn (rounded-lg)
6805
- * - 'xl': Bo góc rất lớn (rounded-xl)
6806
- * - 'full': Bo tròn hoàn toàn (rounded-3xl)
6807
- */
6808
- type ModalRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
6809
- /**
6810
- * Props cho component `<Modal>` (Khung giao diện hộp thoại dialog box)
6811
- */
6812
- interface ModalProps extends HTMLAttributes<HTMLDivElement> {
6813
- /**
6814
- * Ref chuyển tiếp (forwardRef) trỏ trực tiếp đến thẻ div hộp thoại
6815
- */
6816
- ref?: Ref<HTMLDivElement>;
6817
- /**
6818
- * Kích thước chiều rộng của hộp thoại
6819
- * @default 'md'
6820
- */
6821
- size?: ModalSize;
6822
- /**
6823
- * Tùy chỉnh độ bo góc của hộp thoại.
6824
- * Nếu không truyền, mặc định sẽ áp dụng bo góc `rounded-lg`.
6825
- */
6826
- radius?: ModalRadius;
6827
- /**
6828
- * Class tùy biến CSS cho container bao ngoài hộp thoại
6829
- */
6830
- className?: string;
6831
- /**
6832
- * Nội dung bên trong hộp thoại (thường là `<ModalHeader>`, `<ModalBody>`, `<ModalFooter>`)
6833
- */
6834
- children?: ReactNode;
6835
- }
6836
- /**
6837
- * Props cho component `<ModalHeader>` (Phần đầu của hộp thoại Modal)
6838
- */
6839
- interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
6840
- /**
6841
- * Kích thước áp dụng cho tiêu đề và khoảng cách padding trong header
6842
- * @default 'md'
6843
- */
6844
- size?: ModalSize;
6845
- /**
6846
- * Tiêu đề chính của Modal (dạng text string hoặc ReactNode)
6847
- */
6848
- title?: ReactNode;
6849
- /**
6850
- * Đoạn văn bản mô tả phụ bên dưới tiêu đề
6851
- */
6852
- description?: ReactNode;
6853
- /**
6854
- * Class tùy biến CSS riêng cho phần text tiêu đề (Title)
6855
- */
6856
- titleClassName?: string;
6857
- /**
6858
- * Class tùy biến CSS riêng cho phần text mô tả (Description)
6859
- */
6860
- descriptionClassName?: string;
6861
- /**
6862
- * Cho phép hiển thị nút đóng (X) ở góc phải của header
6863
- * @default true
6864
- */
6865
- showCloseButton?: boolean;
6866
- /**
6867
- * Callback tùy biến khi người dùng click vào nút đóng (X).
6868
- * Luôn kết hợp kích hoạt hiệu ứng exit animation của ModalContainer.
6869
- */
6870
- onClose?: () => void;
6871
- /**
6872
- * Class tùy biến CSS cho nút bấm đóng (X)
6873
- */
6874
- closeButtonClassName?: string;
6875
- /**
6876
- * Class tùy biến CSS cho toàn bộ khối header
6877
- */
6878
- className?: string;
6879
- /**
6880
- * Nội dung ReactNode tùy chỉnh thêm vào bên trong header
6881
- */
6882
- children?: ReactNode;
6883
- }
6884
- /**
6885
- * Props cho component `<ModalBody>` (Phần thân chứa nội dung chính cuộn được của Modal)
6886
- */
6887
- interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
6888
- /**
6889
- * Kích thước áp dụng cho khoảng cách padding và cỡ chữ bên trong body
6890
- * @default 'md'
6891
- */
6892
- size?: ModalSize;
6893
- /**
6894
- * Class tùy biến CSS cho toàn bộ khối body (hỗ trợ overflow cuộn dọc)
6895
- */
6896
- className?: string;
6897
- /**
6898
- * Nội dung chính hiển thị bên trong body (Form nhập liệu, Danh sách, Văn bản...)
6899
- */
6900
- children?: ReactNode;
6901
- }
6902
- /**
6903
- * Props cho component `<ModalFooter>` (Phần chân trang chứa các nút hành động xác nhận/hủy)
6904
- */
6905
- interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {
6906
- /**
6907
- * Kích thước áp dụng cho padding và khoảng cách gap giữa các nút bấm
6908
- * @default 'md'
6909
- */
6910
- size?: ModalSize;
6911
- /**
6912
- * Class tùy biến CSS cho toàn bộ khối footer
6913
- */
6914
- className?: string;
6915
- /**
6916
- * Các nút bấm hành động (ví dụ: `<Button>Hủy</Button>`, `<Button color="primary">Lưu</Button>`)
6917
- */
6918
- children?: ReactNode;
6919
- }
6920
- /**
6921
- * Props cho component `<ModalContainer>` (Tầng Wrapper quản lý Overlay Backdrop, Native Dialog, ESC & Animation)
6922
- */
6923
- interface ModalContainerProps extends HTMLAttributes<HTMLDialogElement> {
6924
- /**
6925
- * Trạng thái hiển thị mở/đóng modal (Controlled State)
6926
- */
6927
- open?: boolean;
6508
+ open?: boolean;
6928
6509
  /**
6929
6510
  * Callback được kích hoạt khi modal đóng (click ra ngoài backdrop, nhấn phím ESC, hoặc click nút đóng X)
6930
6511
  */
@@ -7013,6 +6594,11 @@ interface ToolbarToolsConfig {
7013
6594
  * @default true
7014
6595
  */
7015
6596
  zoomOut?: boolean;
6597
+ /**
6598
+ * Cho phép hiển thị thanh trượt Slider điều chỉnh zoom
6599
+ * @default true
6600
+ */
6601
+ zoomSlider?: boolean;
7016
6602
  /**
7017
6603
  * Cho phép hiển thị nút Reset tỉ lệ về 100% (1:1)
7018
6604
  * @default true
@@ -7042,6 +6628,29 @@ interface ImagePreviewToolbarProps {
7042
6628
  * Mức độ phóng to hiện tại của ảnh (ví dụ: 1 = 100%, 1.5 = 150%)
7043
6629
  */
7044
6630
  zoom: number;
6631
+ /**
6632
+ * Mức độ thu nhỏ tối thiểu (mặc định: 0.2 tức 20%)
6633
+ * @default 0.2
6634
+ */
6635
+ minZoom?: number;
6636
+ /**
6637
+ * Mức độ phóng to tối đa (mặc định: 5 tức 500%)
6638
+ * @default 5
6639
+ */
6640
+ maxZoom?: number;
6641
+ /**
6642
+ * Bước nhảy khi kéo thanh Slider
6643
+ * @default 0.05
6644
+ */
6645
+ step?: number;
6646
+ /**
6647
+ * Callback khi giá trị zoom thay đổi qua thanh trượt Slider
6648
+ */
6649
+ onZoomChange?: (zoom: number) => void;
6650
+ /**
6651
+ * Tùy biến chi tiết các props truyền vào Slider component
6652
+ */
6653
+ sliderProps?: Partial<SliderProps>;
7045
6654
  /**
7046
6655
  * Góc xoay hiện tại của ảnh tính theo độ (0, 90, 180, 270)
7047
6656
  */
@@ -7163,7 +6772,7 @@ interface ServerFile {
7163
6772
  /**
7164
6773
  * Đối tượng File truyền vào xem trước (File đối tượng từ input hoặc ServerFile từ API)
7165
6774
  */
7166
- type PreviewFile = File | ServerFile;
6775
+ type PreviewFile = File | ServerFile | string;
7167
6776
  /**
7168
6777
  * Props cho component `<FilePreview>` (Component xác định loại file và chọn component hiển thị tương ứng)
7169
6778
  */
@@ -7250,721 +6859,2379 @@ interface FileContainerProps {
7250
6859
  children?: ReactNode;
7251
6860
  }
7252
6861
 
7253
- type UploadAvatarShape = "circle" | "square";
7254
- type UploadAvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
7255
- type UploadAvatarColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
7256
- type UploadAvatarRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
7257
- type UploadAvatarVariant = "outline" | "filled" | "ghost" | "other";
7258
- type UploadAvatarLabelPlacement = "top" | "left";
7259
- interface UploadAvatarCropOptions {
6862
+ /**
6863
+ * Hình dạng khung hiển thị hình ảnh
6864
+ * - 'rectangle': Khung chữ nhật (mặc định cho Dropzone)
6865
+ * - 'square': Khung vuông tỷ lệ 1:1 (mặc định cho Card Grid)
6866
+ */
6867
+ type UploadImageShape = "rectangle" | "square";
6868
+ /**
6869
+ * Chế độ hiển thị giao diện tải ảnh
6870
+ * - 'dropzone': Khung kéo thả lớn với tiêu đề và mô tả trực quan
6871
+ * - 'card-grid': Lưới thẻ ảnh dạng thumbnail (picture wall)
6872
+ * - 'button': Nút bấm kích hoạt tải ảnh nhỏ gọn
6873
+ */
6874
+ type UploadImageViewMode = "dropzone" | "card-grid" | "button";
6875
+ /**
6876
+ * 5 mức kích thước chuẩn trong Design System
6877
+ */
6878
+ type UploadImageSize = "xs" | "sm" | "md" | "lg" | "xl";
6879
+ /**
6880
+ * Bảng màu chủ đề trong Design System
6881
+ */
6882
+ type UploadImageColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
6883
+ /**
6884
+ * Độ bo góc theo token hệ thống
6885
+ */
6886
+ type UploadImageRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
6887
+ /**
6888
+ * Biến thể kiểu dáng hiển thị
6889
+ */
6890
+ type UploadImageVariant = "outline" | "filled" | "ghost" | "other";
6891
+ /**
6892
+ * Kiểu căn chỉnh hiển thị hình ảnh trong khung chứa (CSS object-fit)
6893
+ * - 'contain': Thu phóng giữ nguyên tỷ lệ sao cho toàn bộ hình ảnh nằm trọn trong khung
6894
+ * - 'cover': Lấp đầy khung chứa (có thể bị cắt viền)
6895
+ * - 'fill': Kéo dãn lấp đầy khung chứa
6896
+ * - 'none': Giữ nguyên kích thước gốc của hình ảnh
6897
+ * - 'scale-down': Chọn kích thước nhỏ hơn giữa 'none' và 'contain'
6898
+ */
6899
+ type UploadImageObjectFit = "cover" | "contain" | "fill" | "none" | "scale-down";
6900
+ /**
6901
+ * Trạng thái kéo thả tệp trên vùng Dropzone
6902
+ * - 'idle': Trạng thái bình thường
6903
+ * - 'active': Đang có tệp hợp lệ được kéo trên vùng Dropzone
6904
+ * - 'reject': Tệp đang kéo bị từ chối do sai định dạng hoặc vượt quá dung lượng
6905
+ */
6906
+ type UploadImageDragStatus = "idle" | "active" | "reject";
6907
+ /**
6908
+ * Props cho component chính `<UploadImage>`
6909
+ */
6910
+ interface UploadImageProps {
7260
6911
  /**
7261
- * Tỷ lệ khung hình khi cắt ảnh (mặc định 1 cho avatar 1:1)
7262
- * @default 1
6912
+ * Danh sách hoặc một mục tệp hình ảnh được quản (Controlled mode)
7263
6913
  */
7264
- aspectRatio?: number;
6914
+ value?: PreviewFile[] | PreviewFile | null;
7265
6915
  /**
7266
- * Hình dạng vùng cắt ảnh
7267
- * @default 'round' cho circle avatar, 'rect' cho square avatar
7268
- */
7269
- cropShape?: "round" | "rect";
7270
- /**
7271
- * Hiển thị lưới căn chỉnh
7272
- * @default true
7273
- */
7274
- showGrid?: boolean;
7275
- /**
7276
- * Tỷ lệ thu phóng tối thiểu
7277
- * @default 1
7278
- */
7279
- minZoom?: number;
7280
- /**
7281
- * Tỷ lệ thu phóng tối đa
7282
- * @default 4
6916
+ * Giá trị mặc định ban đầu khi dùng ở chế độ không kiểm soát (Uncontrolled mode)
7283
6917
  */
7284
- maxZoom?: number;
7285
- /**
7286
- * Tiêu đề modal cắt ảnh
7287
- * @default "Cắt ảnh đại diện"
7288
- */
7289
- modalTitle?: string;
7290
- }
7291
- interface UploadAvatarProps {
6918
+ defaultValue?: PreviewFile[] | PreviewFile | null;
7292
6919
  /**
7293
- * Ref chuyển tiếp đến thẻ input file ẩn (React 19)
6920
+ * Callback kích hoạt khi danh sách hình ảnh thay đổi (thêm mới, thay thế)
7294
6921
  */
7295
- ref?: Ref<HTMLInputElement>;
6922
+ onChange?: (items: PreviewFile[]) => void;
7296
6923
  /**
7297
- * Kích cỡ của avatar:
7298
- * - 'xs': 48x48px (size-12)
7299
- * - 'sm': 64x64px (size-16)
7300
- * - 'md': 80x80px (size-20 - mặc định)
7301
- * - 'lg': 96x96px (size-24)
7302
- * - 'xl': 128x128px (size-32)
7303
- * @default 'md'
6924
+ * Callback kích hoạt khi một hình ảnh bị xóa khỏi danh sách
7304
6925
  */
7305
- size?: UploadAvatarSize;
6926
+ onRemove?: (item: PreviewFile, index: number) => void;
7306
6927
  /**
7307
- * Biến thể giao diện của avatar:
7308
- * - 'outline': viền nét quanh avatar (mặc định)
7309
- * - 'filled': nền pastel nhạt, có viền mờ
7310
- * - 'ghost': trong suốt, viền tối giản
7311
- * - 'other': không áp dụng style mặc định, tùy biến qua className
7312
- * @default 'outline'
6928
+ * Callback kích hoạt khi người dùng yêu cầu xem trước (phóng to) hình ảnh
7313
6929
  */
7314
- variant?: UploadAvatarVariant;
6930
+ onPreview?: (item: PreviewFile) => void;
7315
6931
  /**
7316
- * Chủ đề màu sắc
7317
- * @default 'primary'
6932
+ * Cho phép tải lên nhiều hình ảnh cùng lúc hay chỉ tải một ảnh
6933
+ * @default false
7318
6934
  */
7319
- color?: UploadAvatarColor;
6935
+ multiple?: boolean;
7320
6936
  /**
7321
- * Hình dạng avatar: 'circle' (tròn) hoặc 'square' (vuông)
7322
- * @default 'circle'
6937
+ * Giới hạn số lượng hình ảnh tối đa được phép tải lên
6938
+ * @default 1 khi multiple=false, không giới hạn khi multiple=true
7323
6939
  */
7324
- shape?: UploadAvatarShape;
6940
+ maxCount?: number;
7325
6941
  /**
7326
- * Tùy chỉnh độ bo góc khi shape="square"
7327
- * @default theo từng size (xs: rounded, sm: rounded-md, md: rounded-lg, lg: rounded-xl, xl: rounded-2xl)
6942
+ * Giới hạn dung lượng tối đa của mỗi tệp hình ảnh (tính theo bytes)
6943
+ * dụ: 5 * 1024 * 1024 tương đương 5MB
7328
6944
  */
7329
- radius?: UploadAvatarRadius;
6945
+ maxSize?: number;
7330
6946
  /**
7331
- * Giá trị ảnh avatar (PreviewFile = File | ServerFile hoặc chuỗi URL)
6947
+ * Các định dạng tệp được chấp nhận (chuỗi MIME/extension hoặc object Accept từ react-dropzone)
6948
+ * @default "image/*"
7332
6949
  */
7333
- value?: PreviewFile | string | null;
6950
+ accept?: string | Accept;
7334
6951
  /**
7335
- * Giá trị mặc định ban đầu khi khởi tạo (Uncontrolled)
6952
+ * Hook xử trước khi tải tệp lên để xác thực hoặc chuyển đổi dữ liệu.
6953
+ * Trả về `true` để tiếp tục, `false` hoặc chuỗi thông báo lỗi để từ chối tệp.
7336
6954
  */
7337
- defaultValue?: PreviewFile | string | null;
6955
+ beforeUpload?: (file: File) => boolean | string | Promise<boolean | string>;
7338
6956
  /**
7339
- * Callback khi ảnh avatar thay đổi (hoặc bị xóa với null)
6957
+ * Chế độ hiển thị giao diện của component:
6958
+ * - 'dropzone': Vùng kéo thả lớn với tiêu đề và mô tả
6959
+ * - 'card-grid': Lưới thẻ ảnh thu nhỏ (picture wall)
6960
+ * - 'button': Nút bấm kích hoạt tải ảnh nhỏ gọn
6961
+ * @default 'dropzone'
7340
6962
  */
7341
- onChange?: (item: PreviewFile | null) => void;
6963
+ viewMode?: UploadImageViewMode;
7342
6964
  /**
7343
- * Callback khi ảnh avatar bị xóa
6965
+ * Hình dạng của khung tải ảnh
6966
+ * @default 'rectangle' cho dropzone, 'square' cho card-grid
7344
6967
  */
7345
- onRemove?: (item: PreviewFile) => void;
6968
+ shape?: UploadImageShape;
7346
6969
  /**
7347
- * Callback khi mở xem trước ảnh phóng to (lightbox preview)
6970
+ * Kiểu căn chỉnh hiển thị hình ảnh trong khung chứa (CSS object-fit)
6971
+ * @default 'contain' cho dropzone 1 ảnh, 'cover' cho thumbnail danh sách
7348
6972
  */
7349
- onPreview?: (item: PreviewFile) => void;
6973
+ objectFit?: UploadImageObjectFit;
7350
6974
  /**
7351
- * Callback khi người dùng nhấn nút xóa nhanh nội dung
6975
+ * Kích cỡ của component (áp dụng cho dropzone, thumbnail, font chữ, icon)
6976
+ * @default 'md'
7352
6977
  */
7353
- onClear?: () => void;
6978
+ size?: UploadImageSize;
7354
6979
  /**
7355
- * Dung lượng file tối đa cho phép (bytes, ví dụ: 2 * 1024 * 1024 = 2MB)
6980
+ * Bảng màu chủ đề trong Design System
6981
+ * @default 'primary'
7356
6982
  */
7357
- maxSize?: number;
6983
+ color?: UploadImageColor;
7358
6984
  /**
7359
- * Định dạng MIME type hoặc phần mở rộng được chấp nhận
7360
- * @default "image/*"
6985
+ * Biến thể kiểu dáng hiển thị của khung tải ảnh
6986
+ * @default 'outline'
7361
6987
  */
7362
- accept?: string;
6988
+ variant?: UploadImageVariant;
7363
6989
  /**
7364
- * Bật modal cắt xén ảnh (crop) trước khi áp dụng
7365
- * @default true
6990
+ * Tùy chỉnh độ bo góc của các phần tử (khung dropzone, thumbnail, nút bấm)
6991
+ * @default phụ thuộc vào prop size
7366
6992
  */
7367
- crop?: boolean | UploadAvatarCropOptions;
6993
+ radius?: UploadImageRadius;
7368
6994
  /**
7369
- * Nhãn hiển thị cho avatar
6995
+ * Nhãn văn bản hiển thị phía trên component
7370
6996
  */
7371
6997
  label?: ReactNode;
7372
6998
  /**
7373
- * Vị trí đặt nhãn: 'top' | 'left'
7374
- * @default 'top'
7375
- */
7376
- labelPlacement?: UploadAvatarLabelPlacement;
7377
- /**
7378
- * Đánh dấu trường bắt buộc nhập (hiển thị dấu * đỏ cạnh label)
6999
+ * Đánh dấu trường bắt buộc nhập (hiển thị dấu * màu đỏ cạnh nhãn)
7379
7000
  * @default false
7380
7001
  */
7381
7002
  isRequired?: boolean;
7382
7003
  /**
7383
- * Đoạn văn bản hướng dẫn/chú thích bên dưới avatar
7004
+ * Lớp CSS tùy biến cho nhãn văn bản (label)
7005
+ */
7006
+ labelClassName?: string;
7007
+ /**
7008
+ * Văn bản hướng dẫn hoặc ghi chú phụ trợ hiển thị phía dưới component
7384
7009
  */
7385
7010
  helperText?: ReactNode;
7386
7011
  /**
7387
- * Thông báo lỗi hiển thị bên dưới avatar (khi lỗi sẽ kích hoạt trạng thái báo lỗi và viền đỏ)
7012
+ * Thông báo lỗi tùy chỉnh hiển thị khi trường không hợp lệ
7388
7013
  */
7389
7014
  errorMessage?: ReactNode;
7390
7015
  /**
7391
- * Trạng thái báo lỗi (viền đỏ, aria-invalid="true")
7016
+ * Trạng thái báo lỗi cho trường nhập (hiển thị viền màu đỏ)
7392
7017
  * @default false
7393
7018
  */
7394
7019
  isInvalid?: boolean;
7395
7020
  /**
7396
- * Trạng thái đang tải (hiển thị spinner hiệu hóa tương tác)
7397
- * @default false
7398
- */
7399
- isLoading?: boolean;
7400
- /**
7401
- * Vô hiệu hóa toàn bộ tương tác
7021
+ * hiệu hóa toàn bộ tương tác tải ảnh xóa ảnh
7402
7022
  * @default false
7403
7023
  */
7404
7024
  disabled?: boolean;
7405
7025
  /**
7406
- * Chế độ chỉ đọc
7026
+ * Chế độ chỉ đọc (cho phép xem trước nhưng không cho phép tải thêm hoặc xóa ảnh)
7407
7027
  * @default false
7408
7028
  */
7409
7029
  readOnly?: boolean;
7410
7030
  /**
7411
- * Cho phép hiển thị nút xóa nhanh
7031
+ * Trạng thái đang tải dữ liệu (hiển thị hiệu ứng xoay spinner và vô hiệu hóa tương tác)
7412
7032
  * @default false
7413
7033
  */
7414
- isClearable?: boolean;
7415
- /**
7416
- * Icon placeholder tùy biến khi chưa có ảnh
7417
- */
7418
- icon?: ReactNode;
7034
+ isLoading?: boolean;
7419
7035
  /**
7420
- * Tên trường form input
7036
+ * Tiêu đề chính tùy chỉnh bên trong khung Dropzone
7037
+ * @default "Kéo thả hình ảnh vào đây, hoặc nhấn để duyệt file"
7421
7038
  */
7422
- name?: string;
7039
+ dropzoneTitle?: ReactNode;
7423
7040
  /**
7424
- * ID phần tử input
7041
+ * tả phụ tùy chỉnh bên trong khung Dropzone
7042
+ * @default "Hỗ trợ định dạng PNG, JPG, WEBP, GIF"
7425
7043
  */
7426
- id?: string;
7044
+ dropzoneDescription?: ReactNode;
7427
7045
  /**
7428
- * Mở rộng chiếm toàn bộ chiều rộng 100% của container cha
7429
- * @default false
7046
+ * Biểu tượng tùy chỉnh hiển thị vị trí icon trung tâm
7430
7047
  */
7431
- isFullWidth?: boolean;
7048
+ icon?: ReactNode;
7432
7049
  /**
7433
- * Tùy biến className cho container bọc ngoài cùng (bao gồm label, avatar, helper/error text)
7050
+ * Nhãn chữ của nút bấm khi viewMode="button"
7051
+ * @default "Tải ảnh lên"
7434
7052
  */
7435
- className?: string;
7053
+ buttonText?: ReactNode;
7436
7054
  /**
7437
- * Tùy biến className cho container bọc ngoài cùng (giống Input)
7055
+ * Render prop tùy biến giao diện hiển thị cho từng mục hình ảnh trong danh sách
7438
7056
  */
7439
- wrapperClassName?: string;
7057
+ renderItem?: (item: PreviewFile, index: number, actions: {
7058
+ remove: () => void;
7059
+ preview: () => void;
7060
+ }) => ReactNode;
7440
7061
  /**
7441
- * Tùy biến className cho khung viền của riêng avatar
7062
+ * Lớp CSS tùy biến cho container bao ngoài cùng của component
7442
7063
  */
7443
- avatarClassName?: string;
7064
+ className?: string;
7444
7065
  /**
7445
- * Tùy biến className cho khung viền của riêng avatar (alias giống inputWrapperClassName)
7066
+ * Lớp CSS tùy biến cho vùng Dropzone hoặc vùng kích hoạt
7446
7067
  */
7447
- avatarWrapperClassName?: string;
7068
+ dropzoneClassName?: string;
7448
7069
  /**
7449
- * Tùy biến className cho phần tử <label>
7070
+ * Lớp CSS tùy biến cho danh sách xem trước hình ảnh (UploadImageList)
7450
7071
  */
7451
- labelClassName?: string;
7072
+ previewClassName?: string;
7452
7073
  /**
7453
- * Tùy biến className cho đoạn văn bản helperText hoặc errorMessage
7074
+ * Lớp CSS tùy biến cho thông báo trợ giúp/báo lỗi (HelperErrorText)
7454
7075
  */
7455
7076
  helperClassName?: string;
7456
- /**
7457
- * Nhãn accessibility cho khu vực upload avatar
7458
- */
7459
- ariaLabel?: string;
7460
- }
7461
-
7462
- declare function UploadAvatar({ size, variant, color, shape, radius, value, defaultValue, onChange, onRemove, onPreview, onClear, maxSize, accept, crop, label, labelPlacement, isRequired, helperText, errorMessage, isInvalid, isLoading, disabled, readOnly, isClearable, icon, name, id, isFullWidth, className, wrapperClassName, avatarClassName, avatarWrapperClassName, labelClassName, helperClassName, ariaLabel, ref, }: UploadAvatarProps): react_jsx_runtime.JSX.Element;
7463
-
7464
- interface UploadAvatarCropContentProps {
7465
- imageSrc: string;
7466
- fileName?: string;
7467
- fileType?: string;
7468
- aspectRatio?: number;
7469
- cropShape?: "round" | "rect";
7470
- showGrid?: boolean;
7471
- minZoom?: number;
7472
- maxZoom?: number;
7473
- onApply: (croppedFile: File) => void;
7474
- onCancel?: () => void;
7475
7077
  }
7476
- type UploadAvatarCropModalProps = UploadAvatarCropContentProps & {
7477
- open?: boolean;
7478
- modalTitle?: string;
7479
- onClose?: () => void;
7480
- };
7481
- declare function UploadAvatarCropContent({ imageSrc: initialImageSrc, fileName: initialFileName, fileType: initialFileType, aspectRatio, cropShape, showGrid, minZoom, maxZoom, onApply, onCancel, }: UploadAvatarCropContentProps): react_jsx_runtime.JSX.Element;
7482
- declare function UploadAvatarCropModal({ open, modalTitle, onClose, onCancel, onApply, ...restProps }: UploadAvatarCropModalProps): react_jsx_runtime.JSX.Element;
7483
-
7484
- /**
7485
- * Các kích thước chiều rộng tiêu chuẩn của Confirm:
7486
- * - 'xs': 320px (nhỏ gọn, dành cho thông báo ngắn)
7487
- * - 'sm': 380px (dành cho câu hỏi xác nhận đơn giản)
7488
- * - 'md': 440px (chuẩn mặc định cho đa số hộp thoại xác nhận)
7489
- * - 'lg': 520px (dành cho thông báo cảnh báo chi tiết)
7490
- * - 'xl': 600px (dành cho nội dung phức tạp hoặc danh sách)
7491
- */
7492
- type ConfirmSize = "xs" | "sm" | "md" | "lg" | "xl";
7493
- /**
7494
- * Các chủ đề màu sắc biểu thị mức độ quan trọng hoặc loại hành động của Confirm:
7495
- * - 'warning': Cảnh báo hành động có rủi ro (vàng/cam)
7496
- * - 'error': Hành động nguy hiểm / phá hủy / xóa dữ liệu (đỏ)
7497
- * - 'primary': Hành động nghiệp vụ chính (xanh dương)
7498
- * - 'secondary': Hành động phụ (nâu đồng)
7499
- * - 'neutral': Thông báo trung tính (xám)
7500
- * - 'success': Xác nhận hoàn thành hoặc kích hoạt thành công (xanh lá)
7501
- * - 'info': Thông tin cần người dùng lưu ý (xanh lơ)
7502
- */
7503
- type ConfirmColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
7504
- /**
7505
- * Các mức bo góc của khung hộp thoại Confirm:
7506
- * - 'none': Không bo góc (vuông vức)
7507
- * - 'sm': Bo góc nhẹ (rounded-sm)
7508
- * - 'md': Bo góc vừa (rounded-md)
7509
- * - 'lg': Bo góc lớn (rounded-lg)
7510
- * - 'xl': Bo góc rất lớn (rounded-xl)
7511
- * - 'full': Bo tròn hoàn toàn (rounded-2xl)
7512
- */
7513
- type ConfirmRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
7514
7078
  /**
7515
- * Props cho component `<Confirm>` (Khung giao diện hộp thoại xác nhận - Pure Compound Dialog Box)
7079
+ * Props cho sub-component `<UploadImageDropzone>`
7516
7080
  */
7517
- interface ConfirmProps extends HTMLAttributes<HTMLDivElement> {
7081
+ interface UploadImageDropzoneProps {
7518
7082
  /**
7519
- * Ref chuyển tiếp (forwardRef) trỏ trực tiếp đến thẻ div hộp thoại
7083
+ * Kích cỡ của khung Dropzone
7084
+ * @default 'md'
7520
7085
  */
7521
- ref?: Ref<HTMLDivElement>;
7086
+ size?: UploadImageSize;
7522
7087
  /**
7523
- * Kích thước chiều rộng của hộp thoại (được kế thừa tự động bởi ConfirmHeader, ConfirmBody, ConfirmFooter)
7524
- * @default 'md'
7088
+ * Màu sắc chủ đề khi hover kéo thả
7089
+ * @default 'primary'
7525
7090
  */
7526
- size?: ConfirmSize;
7091
+ color?: UploadImageColor;
7527
7092
  /**
7528
- * Chủ đề màu sắc cho hộp thoại (được kế thừa tự động bởi ConfirmHeader và ConfirmFooter)
7529
- * @default 'warning'
7093
+ * Biến thể kiểu dáng viền/nền của khung Dropzone
7094
+ * @default 'outline'
7530
7095
  */
7531
- color?: ConfirmColor;
7096
+ variant?: UploadImageVariant;
7532
7097
  /**
7533
- * Tùy chỉnh độ bo góc của hộp thoại:
7534
- * - 'none': không bo góc
7535
- * - 'sm': bo góc nhỏ
7536
- * - 'md': bo góc vừa
7537
- * - 'lg': bo góc lớn
7538
- * - 'xl': bo góc rất lớn
7539
- * - 'full': bo tròn hoàn toàn
7540
- * @default 'rounded-lg'
7098
+ * Tùy biến độ bo góc của khung Dropzone
7099
+ * @default phụ thuộc vào size
7541
7100
  */
7542
- radius?: ConfirmRadius;
7101
+ radius?: UploadImageRadius;
7543
7102
  /**
7544
- * Class tùy biến CSS cho container bao ngoài hộp thoại
7103
+ * Hình dạng của khung Dropzone ('rectangle' hoặc 'square')
7104
+ * @default 'rectangle'
7545
7105
  */
7546
- className?: string;
7106
+ shape?: UploadImageShape;
7547
7107
  /**
7548
- * Các sub-component con bên trong hộp thoại:
7549
- * `<ConfirmHeader>`, `<ConfirmBody>`, `<ConfirmFooter>`
7108
+ * Kiểu căn chỉnh hiển thị hình ảnh trong khung Dropzone (CSS object-fit)
7109
+ * @default 'contain'
7550
7110
  */
7551
- children?: ReactNode;
7552
- }
7553
- /**
7554
- * Props cho component `<ConfirmHeader>` (Phần đầu của hộp thoại Confirm)
7555
- */
7556
- interface ConfirmHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
7111
+ objectFit?: UploadImageObjectFit;
7557
7112
  /**
7558
- * Kích thước áp dụng cho tiêu đề, icon khoảng cách padding trong header
7559
- * @default 'md'
7113
+ * hiệu hóa khung kéo thảchọn tệp
7114
+ * @default false
7560
7115
  */
7561
- size?: ConfirmSize;
7116
+ disabled?: boolean;
7562
7117
  /**
7563
- * Chủ đề màu sắc cho icon badge
7564
- * @default 'warning'
7118
+ * Chế độ chỉ đọc, không cho phép kích hoạt chọn tệp mới
7119
+ * @default false
7565
7120
  */
7566
- color?: ConfirmColor;
7121
+ readOnly?: boolean;
7567
7122
  /**
7568
- * Icon hiển thị cạnh tiêu đề (`true`: icon mặc định theo màu, `false`: ẩn icon, `ReactNode`: icon tùy chỉnh)
7569
- * @default true
7123
+ * Trạng thái đang tải tệp hoặc xử hình ảnh
7124
+ * @default false
7570
7125
  */
7571
- icon?: ReactNode | boolean;
7126
+ isLoading?: boolean;
7572
7127
  /**
7573
- * Tiêu đề chính của hộp thoại Confirm
7128
+ * Trạng thái kéo thả tệp trên vùng Dropzone ('idle' | 'active' | 'reject')
7129
+ * @default 'idle'
7574
7130
  */
7575
- title?: ReactNode;
7131
+ dragStatus?: UploadImageDragStatus;
7576
7132
  /**
7577
- * Class CSS tùy biến cho container bao ngoài icon badge
7133
+ * Trạng thái hiển thị viền lỗi
7134
+ * @default false
7578
7135
  */
7579
- iconClassName?: string;
7136
+ isInvalid?: boolean;
7580
7137
  /**
7581
- * Class CSS tùy biến cho tiêu đề
7138
+ * Tiêu đề hiển thị bên trong khung Dropzone
7582
7139
  */
7583
- titleClassName?: string;
7140
+ dropzoneTitle?: ReactNode;
7141
+ /**
7142
+ * Mô tả phụ hiển thị bên trong khung Dropzone
7143
+ */
7144
+ dropzoneDescription?: ReactNode;
7145
+ /**
7146
+ * Biểu tượng tùy chỉnh trong khung Dropzone
7147
+ */
7148
+ icon?: ReactNode;
7149
+ /**
7150
+ * Mục hình ảnh đã tải lên để hiển thị trực tiếp trong khung khi ở chế độ 1 ảnh
7151
+ */
7152
+ item?: PreviewFile | null;
7153
+ /**
7154
+ * Callback xóa ảnh khi nhấn nút Xóa ảnh ở góc trên bên phải
7155
+ */
7156
+ onRemove?: () => void;
7157
+ /**
7158
+ * Callback mở lightbox xem trước khi nhấn vào thân hình ảnh
7159
+ */
7160
+ onPreview?: () => void;
7161
+ /**
7162
+ * Callback mở hộp thoại chọn tệp của trình duyệt (hoặc khi nhấn nút Thay đổi ảnh)
7163
+ */
7164
+ onTriggerUpload?: () => void;
7165
+ /**
7166
+ * Hàm gắn thuộc tính accessibility và sự kiện kéo thả từ react-dropzone
7167
+ */
7168
+ getRootProps?: <T extends DropzoneRootProps>(props?: T) => T;
7169
+ /**
7170
+ * Lớp CSS tùy biến bổ sung cho khung Dropzone
7171
+ */
7172
+ className?: string;
7173
+ /**
7174
+ * ID phần tử chứa văn bản hướng dẫn/mô tả hỗ trợ accessibility (aria-describedby)
7175
+ */
7176
+ describedById?: string;
7177
+ }
7178
+ /**
7179
+ * Props cho sub-component `<UploadImageList>`
7180
+ */
7181
+ interface UploadImageListProps {
7182
+ /**
7183
+ * Danh sách các mục hình ảnh cần hiển thị
7184
+ */
7185
+ items: PreviewFile[];
7186
+ /**
7187
+ * Kích cỡ của thumbnail hình ảnh
7188
+ * @default 'md'
7189
+ */
7190
+ size: UploadImageSize;
7191
+ /**
7192
+ * Màu sắc chủ đề cho các nút thao tác
7193
+ * @default 'primary'
7194
+ */
7195
+ color?: UploadImageColor;
7196
+ /**
7197
+ * Biến thể hiển thị
7198
+ * @default 'outline'
7199
+ */
7200
+ variant?: UploadImageVariant;
7201
+ /**
7202
+ * Độ bo góc của từng thumbnail ảnh trong danh sách
7203
+ */
7204
+ radius: UploadImageRadius;
7205
+ /**
7206
+ * Kiểu căn chỉnh hiển thị hình ảnh trong thumbnail (CSS object-fit)
7207
+ * @default 'cover'
7208
+ */
7209
+ objectFit?: UploadImageObjectFit;
7210
+ /**
7211
+ * Vô hiệu hóa các nút tương tác trong danh sách
7212
+ * @default false
7213
+ */
7214
+ disabled?: boolean;
7215
+ /**
7216
+ * Chế độ chỉ đọc (ẩn nút xóa và nút thêm ảnh)
7217
+ * @default false
7218
+ */
7219
+ readOnly?: boolean;
7220
+ /**
7221
+ * Số lượng hình ảnh tối đa cho phép (dùng để ẩn nút thêm ảnh khi đã đạt giới hạn)
7222
+ */
7223
+ maxCount?: number;
7224
+ /**
7225
+ * Callback khi nhấn nút xóa một mục hình ảnh
7226
+ */
7227
+ onRemove: (item: PreviewFile, index: number) => void;
7228
+ /**
7229
+ * Callback khi nhấn nút xem trước một mục hình ảnh
7230
+ */
7231
+ onPreview: (item: PreviewFile) => void;
7232
+ /**
7233
+ * Callback mở hộp thoại tải ảnh khi nhấn nút thêm (+)
7234
+ */
7235
+ onTriggerUpload: () => void;
7236
+ /**
7237
+ * Render prop tùy biến giao diện từng mục hình ảnh trong danh sách
7238
+ */
7239
+ renderItem?: (item: PreviewFile, index: number, actions: {
7240
+ remove: () => void;
7241
+ preview: () => void;
7242
+ }) => ReactNode;
7243
+ /**
7244
+ * Cho phép hiển thị nút thêm (+) ở cuối danh sách hay không
7245
+ * @default true
7246
+ */
7247
+ showAddButton?: boolean;
7248
+ /**
7249
+ * Lớp CSS tùy biến cho container danh sách
7250
+ */
7251
+ className?: string;
7252
+ }
7253
+
7254
+ declare function UploadImage({ value, defaultValue, onChange, onRemove, onPreview, multiple, maxCount, maxSize, accept, beforeUpload, viewMode, shape, objectFit, size, color, variant, radius, label, isRequired, labelClassName, helperText, errorMessage, isInvalid: isInvalidProp, disabled, readOnly, isLoading, dropzoneTitle, dropzoneDescription, icon, buttonText, renderItem, className, dropzoneClassName, previewClassName, helperClassName, }: UploadImageProps): react_jsx_runtime.JSX.Element;
7255
+
7256
+ declare function UploadImageDropzone({ size, color, variant, radius, shape, objectFit, disabled, readOnly, isLoading, dragStatus, isInvalid, dropzoneTitle, dropzoneDescription, icon, item, onRemove, onPreview, onTriggerUpload, getRootProps, className, describedById, }: UploadImageDropzoneProps): react_jsx_runtime.JSX.Element;
7257
+
7258
+ declare function UploadImageList({ items, size, radius, objectFit, disabled, readOnly, maxCount, onRemove, onPreview, onTriggerUpload, renderItem, showAddButton, className, }: UploadImageListProps): react_jsx_runtime.JSX.Element;
7259
+
7260
+ declare function formatBytes(bytes?: number, decimals?: number): string;
7261
+
7262
+ type UploadAvatarShape = "circle" | "square";
7263
+ type UploadAvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
7264
+ type UploadAvatarColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
7265
+ type UploadAvatarRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
7266
+ type UploadAvatarVariant = "outline" | "filled" | "ghost" | "other";
7267
+ type UploadAvatarLabelPlacement = "top" | "left";
7268
+ interface UploadAvatarCropOptions {
7269
+ /**
7270
+ * Tỷ lệ khung hình khi cắt ảnh (mặc định 1 cho avatar 1:1)
7271
+ * @default 1
7272
+ */
7273
+ aspectRatio?: number;
7274
+ /**
7275
+ * Hình dạng vùng cắt ảnh
7276
+ * @default 'round' cho circle avatar, 'rect' cho square avatar
7277
+ */
7278
+ cropShape?: "round" | "rect";
7279
+ /**
7280
+ * Hiển thị lưới căn chỉnh
7281
+ * @default true
7282
+ */
7283
+ showGrid?: boolean;
7284
+ /**
7285
+ * Tỷ lệ thu phóng tối thiểu
7286
+ * @default 1
7287
+ */
7288
+ minZoom?: number;
7289
+ /**
7290
+ * Tỷ lệ thu phóng tối đa
7291
+ * @default 4
7292
+ */
7293
+ maxZoom?: number;
7294
+ /**
7295
+ * Tiêu đề modal cắt ảnh
7296
+ * @default "Cắt ảnh đại diện"
7297
+ */
7298
+ modalTitle?: string;
7299
+ }
7300
+ interface UploadAvatarConfig {
7301
+ /**
7302
+ * Đánh dấu trường bắt buộc nhập (hiển thị dấu * đỏ cạnh label)
7303
+ * @default false
7304
+ */
7305
+ isRequired?: boolean;
7306
+ /**
7307
+ * Trạng thái báo lỗi (viền đỏ, aria-invalid="true")
7308
+ * @default false
7309
+ */
7310
+ isInvalid?: boolean;
7311
+ /**
7312
+ * Trạng thái đang tải (vô hiệu hóa tương tác)
7313
+ * @default false
7314
+ */
7315
+ isLoading?: boolean;
7316
+ /**
7317
+ * Hiển thị biểu tượng xoay spinner khi đang ở trạng thái loading
7318
+ * @default false
7319
+ */
7320
+ showSpinner?: boolean;
7321
+ /**
7322
+ * Cho phép hiển thị nút xóa nhanh
7323
+ * @default false
7324
+ */
7325
+ isClearable?: boolean;
7326
+ /**
7327
+ * Mở rộng chiếm toàn bộ chiều rộng 100% của container cha
7328
+ * @default false
7329
+ */
7330
+ isFullWidth?: boolean;
7331
+ }
7332
+ interface UploadAvatarProps {
7333
+ /**
7334
+ * Cấu hình tập trung các cờ trạng thái / tính năng
7335
+ */
7336
+ config?: UploadAvatarConfig;
7337
+ /**
7338
+ * Ref chuyển tiếp đến thẻ input file ẩn (React 19)
7339
+ */
7340
+ ref?: Ref<HTMLInputElement>;
7341
+ /**
7342
+ * Kích cỡ của avatar:
7343
+ * - 'xs': 48x48px (size-12)
7344
+ * - 'sm': 64x64px (size-16)
7345
+ * - 'md': 80x80px (size-20 - mặc định)
7346
+ * - 'lg': 96x96px (size-24)
7347
+ * - 'xl': 128x128px (size-32)
7348
+ * @default 'md'
7349
+ */
7350
+ size?: UploadAvatarSize;
7351
+ /**
7352
+ * Biến thể giao diện của avatar:
7353
+ * - 'outline': viền nét quanh avatar (mặc định)
7354
+ * - 'filled': nền pastel nhạt, có viền mờ
7355
+ * - 'ghost': trong suốt, viền tối giản
7356
+ * - 'other': không áp dụng style mặc định, tùy biến qua className
7357
+ * @default 'outline'
7358
+ */
7359
+ variant?: UploadAvatarVariant;
7360
+ /**
7361
+ * Chủ đề màu sắc
7362
+ * @default 'primary'
7363
+ */
7364
+ color?: UploadAvatarColor;
7365
+ /**
7366
+ * Hình dạng avatar: 'circle' (tròn) hoặc 'square' (vuông)
7367
+ * @default 'circle'
7368
+ */
7369
+ shape?: UploadAvatarShape;
7370
+ /**
7371
+ * Tùy chỉnh độ bo góc khi shape="square"
7372
+ * @default theo từng size (xs: rounded, sm: rounded-md, md: rounded-lg, lg: rounded-xl, xl: rounded-2xl)
7373
+ */
7374
+ radius?: UploadAvatarRadius;
7375
+ /**
7376
+ * Giá trị ảnh avatar (PreviewFile = File | ServerFile hoặc chuỗi URL)
7377
+ */
7378
+ value?: PreviewFile | string | null;
7379
+ /**
7380
+ * Giá trị mặc định ban đầu khi khởi tạo (Uncontrolled)
7381
+ */
7382
+ defaultValue?: PreviewFile | string | null;
7383
+ /**
7384
+ * Callback khi ảnh avatar thay đổi (hoặc bị xóa với null)
7385
+ */
7386
+ onChange?: (item: PreviewFile | null) => void;
7387
+ /**
7388
+ * Callback khi ảnh avatar bị xóa
7389
+ */
7390
+ onRemove?: (item: PreviewFile) => void;
7391
+ /**
7392
+ * Callback khi mở xem trước ảnh phóng to (lightbox preview)
7393
+ */
7394
+ onPreview?: (item: PreviewFile) => void;
7395
+ /**
7396
+ * Callback khi người dùng nhấn nút xóa nhanh nội dung
7397
+ */
7398
+ onClear?: () => void;
7399
+ /**
7400
+ * Dung lượng file tối đa cho phép (bytes, ví dụ: 2 * 1024 * 1024 = 2MB)
7401
+ */
7402
+ maxSize?: number;
7403
+ /**
7404
+ * Định dạng MIME type hoặc phần mở rộng được chấp nhận (chuỗi hoặc đối tượng Accept từ react-dropzone)
7405
+ * @default "image/*"
7406
+ */
7407
+ accept?: string | Accept;
7408
+ /**
7409
+ * Bật modal cắt xén ảnh (crop) trước khi áp dụng
7410
+ * @default true
7411
+ */
7412
+ crop?: boolean | UploadAvatarCropOptions;
7413
+ /**
7414
+ * Nhãn hiển thị cho avatar
7415
+ */
7416
+ label?: ReactNode;
7417
+ /**
7418
+ * Vị trí đặt nhãn: 'top' | 'left'
7419
+ * @default 'top'
7420
+ */
7421
+ labelPlacement?: UploadAvatarLabelPlacement;
7422
+ /**
7423
+ * Đoạn văn bản hướng dẫn/chú thích bên dưới avatar
7424
+ */
7425
+ helperText?: ReactNode;
7426
+ /**
7427
+ * Thông báo lỗi hiển thị bên dưới avatar (khi có lỗi sẽ kích hoạt trạng thái báo lỗi và viền đỏ)
7428
+ */
7429
+ errorMessage?: ReactNode;
7430
+ /**
7431
+ * Vô hiệu hóa toàn bộ tương tác
7432
+ * @default false
7433
+ */
7434
+ disabled?: boolean;
7435
+ /**
7436
+ * Chế độ chỉ đọc
7437
+ * @default false
7438
+ */
7439
+ readOnly?: boolean;
7440
+ /**
7441
+ * Icon placeholder tùy biến khi chưa có ảnh
7442
+ */
7443
+ icon?: ReactNode;
7444
+ /**
7445
+ * Tên trường form input
7446
+ */
7447
+ name?: string;
7448
+ /**
7449
+ * ID phần tử input
7450
+ */
7451
+ id?: string;
7452
+ /**
7453
+ * Tùy biến className cho container bọc ngoài cùng (bao gồm label, avatar, helper/error text)
7454
+ */
7455
+ className?: string;
7456
+ /**
7457
+ * Tùy biến className cho container bọc ngoài cùng (giống Input)
7458
+ */
7459
+ wrapperClassName?: string;
7460
+ /**
7461
+ * Tùy biến className cho khung viền của riêng avatar
7462
+ */
7463
+ avatarClassName?: string;
7464
+ /**
7465
+ * Tùy biến className cho khung viền của riêng avatar (alias giống inputWrapperClassName)
7466
+ */
7467
+ avatarWrapperClassName?: string;
7468
+ /**
7469
+ * Tùy biến className cho phần tử <label>
7470
+ */
7471
+ labelClassName?: string;
7472
+ /**
7473
+ * Tùy biến className cho đoạn văn bản helperText hoặc errorMessage
7474
+ */
7475
+ helperClassName?: string;
7476
+ /**
7477
+ * Nhãn accessibility cho khu vực upload avatar
7478
+ */
7479
+ ariaLabel?: string;
7480
+ }
7481
+
7482
+ declare function UploadAvatar({ size, variant, color, shape, radius, value, defaultValue, onChange, onRemove, onPreview, onClear, maxSize, accept, crop, label, labelPlacement, config, helperText, errorMessage, disabled, readOnly, icon, name, id, className, wrapperClassName, avatarClassName, avatarWrapperClassName, labelClassName, helperClassName, ref, }: UploadAvatarProps): react_jsx_runtime.JSX.Element;
7483
+
7484
+ interface UploadAvatarCropContentProps {
7485
+ imageSrc?: string;
7486
+ file?: File | null;
7487
+ fileName?: string;
7488
+ fileType?: string;
7489
+ aspectRatio?: number;
7490
+ cropShape?: "round" | "rect";
7491
+ showGrid?: boolean;
7492
+ minZoom?: number;
7493
+ maxZoom?: number;
7494
+ onApply: (croppedFile: File) => void;
7495
+ onCancel?: () => void;
7496
+ }
7497
+ type UploadAvatarCropModalProps = UploadAvatarCropContentProps & {
7498
+ open?: boolean;
7499
+ modalTitle?: string;
7500
+ onClose?: () => void;
7501
+ };
7502
+ declare function UploadAvatarCropContent({ imageSrc: initialImageSrc, file, fileName: initialFileName, fileType: initialFileType, aspectRatio, cropShape, showGrid, minZoom, maxZoom, onApply, onCancel, }: UploadAvatarCropContentProps): react_jsx_runtime.JSX.Element;
7503
+ declare function UploadAvatarCropModal({ open, modalTitle, onClose, onCancel, onApply, ...restProps }: UploadAvatarCropModalProps): react_jsx_runtime.JSX.Element;
7504
+
7505
+ /**
7506
+ * Hình dạng khung hiển thị tệp tin
7507
+ * - 'rectangle': Khung chữ nhật (mặc định cho Dropzone)
7508
+ * - 'square': Khung vuông tỷ lệ 1:1
7509
+ */
7510
+ type UploadFileShape = "rectangle" | "square";
7511
+ /**
7512
+ * Chế độ hiển thị giao diện tải tệp tin
7513
+ * - 'dropzone': Khung kéo thả lớn kèm tiêu đề và mô tả trực quan
7514
+ * - 'button': Nút bấm kích hoạt tải tệp gọn gàng
7515
+ * - 'compact': Khung kéo thả thu nhỏ dạng thanh ngang
7516
+ */
7517
+ type UploadFileViewMode = "dropzone" | "button" | "compact";
7518
+ /**
7519
+ * Kiểu hiển thị danh sách tệp tin
7520
+ * - 'list': Danh sách dạng hàng ngang chi tiết (tên, icon, dung lượng, hành động)
7521
+ * - 'grid': Dạng thẻ card gọn gàng bố cục lưới
7522
+ */
7523
+ type UploadFileListType = "list" | "grid";
7524
+ /**
7525
+ * 5 mức kích thước chuẩn trong Design System
7526
+ */
7527
+ type UploadFileSize = "xs" | "sm" | "md" | "lg" | "xl";
7528
+ /**
7529
+ * Bảng màu chủ đề trong Design System
7530
+ */
7531
+ type UploadFileColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
7532
+ /**
7533
+ * Độ bo góc theo token hệ thống
7534
+ */
7535
+ type UploadFileRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
7536
+ /**
7537
+ * Biến thể kiểu dáng hiển thị
7538
+ */
7539
+ type UploadFileVariant = "outline" | "filled" | "ghost" | "other";
7540
+ /**
7541
+ * Trạng thái kéo thả tệp trên vùng Dropzone
7542
+ * - 'idle': Trạng thái bình thường
7543
+ * - 'active': Đang có tệp hợp lệ được kéo trên vùng Dropzone
7544
+ * - 'reject': Tệp đang kéo bị từ chối do sai định dạng hoặc vượt quá dung lượng
7545
+ */
7546
+ type UploadFileDragStatus = "idle" | "active" | "reject";
7547
+ /**
7548
+ * Phân loại định dạng tệp tin cho icon và màu sắc huy hiệu
7549
+ */
7550
+ type FileCategory = "pdf" | "word" | "excel" | "powerpoint" | "archive" | "text" | "image" | "audio" | "video" | "code" | "other";
7551
+ /**
7552
+ * Props cho component `<FileIcon>`
7553
+ */
7554
+ interface FileIconProps {
7555
+ /**
7556
+ * Đối tượng tệp tin (File, ServerFile, hoặc chuỗi src)
7557
+ */
7558
+ file?: PreviewFile;
7559
+ /**
7560
+ * Tên tệp hoặc phần mở rộng tệp cụ thể (tự động phân loại nếu không truyền file)
7561
+ */
7562
+ fileName?: string;
7563
+ /**
7564
+ * Chỉ định danh mục định dạng cụ thể (ghi đè tự động nhận diện)
7565
+ */
7566
+ category?: FileCategory;
7567
+ /**
7568
+ * Kích thước icon
7569
+ * @default 'md'
7570
+ */
7571
+ size?: UploadFileSize | number;
7572
+ /**
7573
+ * Class tùy biến CSS
7574
+ */
7575
+ className?: string;
7576
+ }
7577
+ /**
7578
+ * Props cho component hiển thị từng mục tệp tin `<UploadFileItemRow>`
7579
+ */
7580
+ interface UploadFileItemRowProps {
7581
+ /**
7582
+ * Đối tượng tệp tin (PreviewFile: File | ServerFile | string)
7583
+ */
7584
+ item: PreviewFile;
7585
+ /**
7586
+ * Vị trí index trong danh sách
7587
+ */
7588
+ index: number;
7589
+ /**
7590
+ * Kiểu hiển thị danh sách
7591
+ * @default 'list'
7592
+ */
7593
+ listType?: UploadFileListType;
7594
+ /**
7595
+ * Kích thước giao diện
7596
+ * @default 'md'
7597
+ */
7598
+ size?: UploadFileSize;
7599
+ /**
7600
+ * Bo góc theo token
7601
+ */
7602
+ radius?: UploadFileRadius;
7603
+ /**
7604
+ * Màu chủ đề
7605
+ */
7606
+ color?: UploadFileColor;
7607
+ /**
7608
+ * Vô hiệu hóa tương tác
7609
+ */
7610
+ disabled?: boolean;
7611
+ /**
7612
+ * Chế độ chỉ đọc (không thể xóa)
7613
+ */
7614
+ readOnly?: boolean;
7615
+ /**
7616
+ * Hiển thị nút xem trước
7617
+ * @default true
7618
+ */
7619
+ showPreviewButton?: boolean;
7620
+ /**
7621
+ * Hiển thị nút tải xuống
7622
+ * @default true
7623
+ */
7624
+ showDownloadButton?: boolean;
7625
+ /**
7626
+ * Hiển thị nút xóa
7627
+ * @default true
7628
+ */
7629
+ showRemoveButton?: boolean;
7630
+ /**
7631
+ * Callback khi người dùng xóa tệp
7632
+ */
7633
+ onRemove?: (item: PreviewFile, index: number) => void;
7634
+ /**
7635
+ * Callback khi người dùng xem trước tệp
7636
+ */
7637
+ onPreview?: (item: PreviewFile) => void;
7638
+ /**
7639
+ * Callback khi người dùng tải xuống tệp
7640
+ */
7641
+ onDownload?: (item: PreviewFile) => void;
7642
+ /**
7643
+ * Callback khi người dùng bấm thử lại tải lên (nếu có lỗi)
7644
+ */
7645
+ onRetry?: (item: PreviewFile, index: number) => void;
7646
+ /**
7647
+ * Hàm render tùy chỉnh cho từng mục tệp
7648
+ */
7649
+ renderItem?: (item: PreviewFile, index: number, actions: {
7650
+ remove: () => void;
7651
+ preview: () => void;
7652
+ download: () => void;
7653
+ }) => ReactNode;
7654
+ /**
7655
+ * Class tùy biến CSS
7656
+ */
7657
+ className?: string;
7658
+ }
7659
+ /**
7660
+ * Props cho danh sách tệp tin `<UploadFileList>`
7661
+ */
7662
+ interface UploadFileListProps {
7663
+ /**
7664
+ * Danh sách các tệp tin đã tải lên
7665
+ */
7666
+ items: PreviewFile[];
7667
+ /**
7668
+ * Kiểu hiển thị danh sách tệp tin
7669
+ * @default 'list'
7670
+ */
7671
+ listType?: UploadFileListType;
7672
+ /**
7673
+ * Kích thước hiển thị
7674
+ */
7675
+ size: UploadFileSize;
7676
+ /**
7677
+ * Màu chủ đề
7678
+ */
7679
+ color?: UploadFileColor;
7680
+ /**
7681
+ * Biến thể hiển thị
7682
+ */
7683
+ variant?: UploadFileVariant;
7684
+ /**
7685
+ * Bo góc
7686
+ */
7687
+ radius: UploadFileRadius;
7688
+ /**
7689
+ * Trạng thái vô hiệu hóa
7690
+ */
7691
+ disabled?: boolean;
7692
+ /**
7693
+ * Trạng thái chỉ đọc
7694
+ */
7695
+ readOnly?: boolean;
7696
+ /**
7697
+ * Số lượng tệp tối đa
7698
+ */
7699
+ maxCount?: number;
7700
+ /**
7701
+ * Hiển thị nút xem trước
7702
+ * @default true
7703
+ */
7704
+ showPreviewButton?: boolean;
7705
+ /**
7706
+ * Hiển thị nút tải xuống
7707
+ * @default true
7708
+ */
7709
+ showDownloadButton?: boolean;
7710
+ /**
7711
+ * Hiển thị nút xóa
7712
+ * @default true
7713
+ */
7714
+ showRemoveButton?: boolean;
7715
+ /**
7716
+ * Callback khi xóa tệp
7717
+ */
7718
+ onRemove: (item: PreviewFile, index: number) => void;
7719
+ /**
7720
+ * Callback khi xem trước tệp
7721
+ */
7722
+ onPreview: (item: PreviewFile) => void;
7723
+ /**
7724
+ * Callback khi tải xuống tệp
7725
+ */
7726
+ onDownload?: (item: PreviewFile) => void;
7727
+ /**
7728
+ * Callback khi thử lại tải lên
7729
+ */
7730
+ onRetry?: (item: PreviewFile, index: number) => void;
7731
+ /**
7732
+ * Hàm render tùy biến giao diện item
7733
+ */
7734
+ renderItem?: (item: PreviewFile, index: number, actions: {
7735
+ remove: () => void;
7736
+ preview: () => void;
7737
+ download: () => void;
7738
+ }) => ReactNode;
7739
+ /**
7740
+ * Class tùy biến CSS
7741
+ */
7742
+ className?: string;
7743
+ }
7744
+ /**
7745
+ * Props cho vùng kéo thả `<UploadFileDropzone>`
7746
+ */
7747
+ interface UploadFileDropzoneProps {
7748
+ /**
7749
+ * Kích thước giao diện
7750
+ * @default 'md'
7751
+ */
7752
+ size?: UploadFileSize;
7753
+ /**
7754
+ * Bảng màu chủ đề
7755
+ * @default 'primary'
7756
+ */
7757
+ color?: UploadFileColor;
7758
+ /**
7759
+ * Biến thể kiểu dáng
7760
+ * @default 'outline'
7761
+ */
7762
+ variant?: UploadFileVariant;
7763
+ /**
7764
+ * Độ bo góc
7765
+ */
7766
+ radius?: UploadFileRadius;
7767
+ /**
7768
+ * Hình dạng khung dropzone ('rectangle' hoặc 'square')
7769
+ * @default 'rectangle'
7770
+ */
7771
+ shape?: UploadFileShape;
7772
+ /**
7773
+ * Chế độ thu gọn dạng thanh ngang
7774
+ * @default false
7775
+ */
7776
+ compact?: boolean;
7777
+ /**
7778
+ * Trạng thái vô hiệu hóa
7779
+ */
7780
+ disabled?: boolean;
7781
+ /**
7782
+ * Trạng thái chỉ đọc
7783
+ */
7784
+ readOnly?: boolean;
7785
+ /**
7786
+ * Trạng thái đang tải / xử lý
7787
+ */
7788
+ isLoading?: boolean;
7789
+ /**
7790
+ * Hiển thị biểu tượng xoay spinner khi đang ở trạng thái loading
7791
+ * @default false
7792
+ */
7793
+ showSpinner?: boolean;
7794
+ /**
7795
+ * Trạng thái kéo thả tệp
7796
+ */
7797
+ dragStatus?: UploadFileDragStatus;
7798
+ /**
7799
+ * Trạng thái không hợp lệ
7800
+ */
7801
+ isInvalid?: boolean;
7802
+ /**
7803
+ * Tiêu đề chính của vùng kéo thả
7804
+ */
7805
+ dropzoneTitle?: ReactNode;
7806
+ /**
7807
+ * Đoạn mô tả phụ trợ của vùng kéo thả
7808
+ */
7809
+ dropzoneDescription?: ReactNode;
7810
+ /**
7811
+ * Icon hiển thị ở trung tâm vùng kéo thả
7812
+ */
7813
+ icon?: ReactNode;
7814
+ /**
7815
+ * Hàm kích hoạt hộp thoại chọn tệp
7816
+ */
7817
+ onTriggerUpload?: () => void;
7818
+ /**
7819
+ * Props gốc từ useDropzone
7820
+ */
7821
+ getRootProps?: <T extends DropzoneRootProps>(props?: T) => T;
7822
+ /**
7823
+ * Class tùy biến CSS
7824
+ */
7825
+ className?: string;
7826
+ /**
7827
+ * ID phần tử mô tả lỗi/trợ giúp (A11y)
7828
+ */
7829
+ describedById?: string;
7830
+ }
7831
+ /**
7832
+ * Cấu hình tập trung các cờ trạng thái / tính năng boolean cho `<UploadFile>`
7833
+ */
7834
+ interface UploadFileConfig {
7835
+ /**
7836
+ * Đánh dấu trường bắt buộc nhập (hiển thị dấu * màu đỏ cạnh nhãn)
7837
+ * @default false
7838
+ */
7839
+ isRequired?: boolean;
7840
+ /**
7841
+ * Đánh dấu trường đang trong trạng thái lỗi/không hợp lệ
7842
+ * @default false
7843
+ */
7844
+ isInvalid?: boolean;
7845
+ /**
7846
+ * Trạng thái đang tải dữ liệu hoặc đang upload
7847
+ * @default false
7848
+ */
7849
+ isLoading?: boolean;
7850
+ /**
7851
+ * Hiển thị biểu tượng xoay spinner khi đang ở trạng thái loading
7852
+ * @default false
7853
+ */
7854
+ showSpinner?: boolean;
7855
+ /**
7856
+ * Cho phép tải lên nhiều tệp tin cùng lúc
7857
+ * @default false
7858
+ */
7859
+ multiple?: boolean;
7860
+ /**
7861
+ * Cho phép hiển thị danh sách các tệp tin đã tải lên bên dưới
7862
+ * @default true
7863
+ */
7864
+ showFileList?: boolean;
7865
+ /**
7866
+ * Hiển thị nút xem trước trên từng tệp tin
7867
+ * @default true
7868
+ */
7869
+ showPreviewButton?: boolean;
7870
+ /**
7871
+ * Hiển thị nút tải xuống trên từng tệp tin
7872
+ * @default true
7873
+ */
7874
+ showDownloadButton?: boolean;
7875
+ /**
7876
+ * Hiển thị nút xóa trên từng tệp tin
7877
+ * @default true
7878
+ */
7879
+ showRemoveButton?: boolean;
7880
+ }
7881
+ /**
7882
+ * Props chính cho component `<UploadFile>`
7883
+ */
7884
+ interface UploadFileProps {
7885
+ /**
7886
+ * Cấu hình tập trung các cờ trạng thái / tính năng boolean
7887
+ */
7888
+ config?: UploadFileConfig;
7889
+ /**
7890
+ * Danh sách hoặc một mục tệp tin được quản lý (Controlled mode)
7891
+ */
7892
+ value?: PreviewFile[] | PreviewFile | null;
7893
+ /**
7894
+ * Giá trị mặc định ban đầu khi dùng ở chế độ không kiểm soát (Uncontrolled mode)
7895
+ */
7896
+ defaultValue?: PreviewFile[] | PreviewFile | null;
7897
+ /**
7898
+ * Callback kích hoạt khi danh sách tệp tin thay đổi
7899
+ */
7900
+ onChange?: (items: PreviewFile[]) => void;
7901
+ /**
7902
+ * Callback kích hoạt khi một tệp tin bị xóa khỏi danh sách
7903
+ */
7904
+ onRemove?: (item: PreviewFile, index: number) => void;
7905
+ /**
7906
+ * Callback kích hoạt khi người dùng yêu cầu xem trước tệp tin
7907
+ */
7908
+ onPreview?: (item: PreviewFile) => void;
7909
+ /**
7910
+ * Callback kích hoạt khi người dùng bấm nút tải xuống tệp tin
7911
+ */
7912
+ onDownload?: (item: PreviewFile) => void;
7913
+ /**
7914
+ * Callback kích hoạt khi người dùng bấm thử lại tải lên (khi có lỗi)
7915
+ */
7916
+ onRetry?: (item: PreviewFile, index: number) => void;
7917
+ /**
7918
+ * Giới hạn số lượng tệp tin tối đa được phép tải lên
7919
+ * @default 1 khi multiple=false, không giới hạn khi multiple=true
7920
+ */
7921
+ maxCount?: number;
7922
+ /**
7923
+ * Dung lượng tệp tối đa (tính theo bytes)
7924
+ */
7925
+ maxSize?: number;
7926
+ /**
7927
+ * Dung lượng tệp tối thiểu (tính theo bytes)
7928
+ */
7929
+ minSize?: number;
7930
+ /**
7931
+ * Định dạng tệp tin chấp nhận tải lên (chuỗi extension như ".pdf,.docx,.xlsx" hoặc MIME type)
7932
+ */
7933
+ accept?: string | Accept;
7934
+ /**
7935
+ * Hook xử lý hoặc xác thực tệp trước khi chấp nhận tải lên
7936
+ * Trả về false hoặc chuỗi thông báo lỗi để từ chối tệp
7937
+ */
7938
+ beforeUpload?: (file: File) => boolean | string | Promise<boolean | string>;
7939
+ /**
7940
+ * Chế độ hiển thị giao diện tải tệp
7941
+ * - 'dropzone': Khung kéo thả lớn kèm tiêu đề và mô tả
7942
+ * - 'button': Nút bấm kích hoạt tải tệp
7943
+ * - 'compact': Khung kéo thả dạng thanh ngang thu nhỏ
7944
+ * @default 'dropzone'
7945
+ */
7946
+ viewMode?: UploadFileViewMode;
7947
+ /**
7948
+ * Kiểu hiển thị danh sách tệp tin
7949
+ * - 'list': Dạng hàng ngang chi tiết
7950
+ * - 'grid': Dạng thẻ card trên lưới
7951
+ * @default 'list'
7952
+ */
7953
+ listType?: UploadFileListType;
7954
+ /**
7955
+ * Hình dạng của khung tải tệp ('rectangle' hoặc 'square')
7956
+ * @default 'rectangle'
7957
+ */
7958
+ shape?: UploadFileShape;
7959
+ /**
7960
+ * 5 mức kích thước chuẩn trong Design System
7961
+ * @default 'md'
7962
+ */
7963
+ size?: UploadFileSize;
7964
+ /**
7965
+ * Bảng màu chủ đề
7966
+ * @default 'primary'
7967
+ */
7968
+ color?: UploadFileColor;
7969
+ /**
7970
+ * Biến thể kiểu dáng
7971
+ * @default 'outline'
7972
+ */
7973
+ variant?: UploadFileVariant;
7974
+ /**
7975
+ * Độ bo góc theo token hệ thống
7976
+ */
7977
+ radius?: UploadFileRadius;
7978
+ /**
7979
+ * Tiêu đề nhãn của trường form
7980
+ */
7981
+ label?: ReactNode;
7982
+ /**
7983
+ * Lớp CSS tùy biến cho nhãn văn bản (label)
7984
+ */
7985
+ labelClassName?: string;
7986
+ /**
7987
+ * Đoạn văn bản trợ giúp hiển thị bên dưới
7988
+ */
7989
+ helperText?: ReactNode;
7990
+ /**
7991
+ * Thông báo lỗi hiển thị bên dưới trường khi không hợp lệ
7992
+ */
7993
+ errorMessage?: ReactNode;
7994
+ /**
7995
+ * Vô hiệu hóa toàn bộ tương tác
7996
+ * @default false
7997
+ */
7998
+ disabled?: boolean;
7999
+ /**
8000
+ * Trạng thái chỉ đọc (không thể thêm mới hoặc xóa tệp)
8001
+ * @default false
8002
+ */
8003
+ readOnly?: boolean;
8004
+ /**
8005
+ * Tiêu đề hiển thị trong khung Dropzone
8006
+ */
8007
+ dropzoneTitle?: ReactNode;
8008
+ /**
8009
+ * Mô tả phụ hiển thị trong khung Dropzone
8010
+ */
8011
+ dropzoneDescription?: ReactNode;
8012
+ /**
8013
+ * Nhãn văn bản hiển thị trên nút bấm khi viewMode='button'
8014
+ * @default 'Tải tệp lên'
8015
+ */
8016
+ buttonText?: ReactNode;
8017
+ /**
8018
+ * Icon tùy biến cho vùng Dropzone
8019
+ */
8020
+ icon?: ReactNode;
8021
+ /**
8022
+ * Hàm render tùy biến hoàn toàn giao diện từng mục tệp tin trong danh sách
8023
+ */
8024
+ renderItem?: (item: PreviewFile, index: number, actions: {
8025
+ remove: () => void;
8026
+ preview: () => void;
8027
+ download: () => void;
8028
+ }) => ReactNode;
8029
+ /**
8030
+ * Class tùy biến CSS cho container ngoài cùng
8031
+ */
8032
+ className?: string;
8033
+ /**
8034
+ * Class tùy biến CSS cho khung Dropzone
8035
+ */
8036
+ dropzoneClassName?: string;
8037
+ /**
8038
+ * Class tùy biến CSS cho danh sách tệp tin
8039
+ */
8040
+ listClassName?: string;
8041
+ /**
8042
+ * Class tùy biến CSS cho danh sách xem trước (UploadFileList)
8043
+ */
8044
+ previewClassName?: string;
8045
+ /**
8046
+ * Class tùy biến CSS cho vùng Helper/Error Text
8047
+ */
8048
+ helperClassName?: string;
8049
+ }
8050
+
8051
+ declare function UploadFile({ value, defaultValue, onChange, onRemove, onPreview, onDownload, onRetry, maxCount, maxSize, minSize, accept, beforeUpload, viewMode, listType, shape, size, color, variant, radius, label, labelClassName, helperText, errorMessage, disabled, readOnly, dropzoneTitle, dropzoneDescription, buttonText, icon, renderItem, className, dropzoneClassName, listClassName, previewClassName, helperClassName, config, }: UploadFileProps): react_jsx_runtime.JSX.Element;
8052
+
8053
+ declare function UploadFileDropzone({ size, color, variant, radius, shape, compact, disabled, readOnly, isLoading, showSpinner, dragStatus, isInvalid, dropzoneTitle, dropzoneDescription, icon, onTriggerUpload, getRootProps, className, describedById, }: UploadFileDropzoneProps): react_jsx_runtime.JSX.Element;
8054
+
8055
+ declare function UploadFileList({ items, listType, size, color, radius, disabled, readOnly, showPreviewButton, showDownloadButton, showRemoveButton, onRemove, onPreview, onDownload, onRetry, renderItem, className, }: UploadFileListProps): react_jsx_runtime.JSX.Element | null;
8056
+
8057
+ declare function UploadFileItemRow({ item, index, listType, size, radius, disabled, readOnly, showPreviewButton, showDownloadButton, showRemoveButton, onRemove, onPreview, onDownload, onRetry, renderItem, className, }: UploadFileItemRowProps): react_jsx_runtime.JSX.Element;
8058
+
8059
+ declare function FileIcon({ file, fileName, category: explicitCategory, size, className, }: FileIconProps): react_jsx_runtime.JSX.Element;
8060
+
8061
+ /**
8062
+ * Phân loại định dạng tệp tin dựa trên phần mở rộng hoặc MIME type
8063
+ */
8064
+ declare function getFileCategory(itemOrName?: PreviewFile | string | null): FileCategory;
8065
+
8066
+ /**
8067
+ * Các kích thước chiều rộng tiêu chuẩn của Confirm:
8068
+ * - 'xs': 320px (nhỏ gọn, dành cho thông báo ngắn)
8069
+ * - 'sm': 380px (dành cho câu hỏi xác nhận đơn giản)
8070
+ * - 'md': 440px (chuẩn mặc định cho đa số hộp thoại xác nhận)
8071
+ * - 'lg': 520px (dành cho thông báo cảnh báo chi tiết)
8072
+ * - 'xl': 600px (dành cho nội dung phức tạp hoặc danh sách)
8073
+ */
8074
+ type ConfirmSize = "xs" | "sm" | "md" | "lg" | "xl";
8075
+ /**
8076
+ * Các chủ đề màu sắc biểu thị mức độ quan trọng hoặc loại hành động của Confirm:
8077
+ * - 'warning': Cảnh báo hành động có rủi ro (vàng/cam)
8078
+ * - 'error': Hành động nguy hiểm / phá hủy / xóa dữ liệu (đỏ)
8079
+ * - 'primary': Hành động nghiệp vụ chính (xanh dương)
8080
+ * - 'secondary': Hành động phụ (nâu đồng)
8081
+ * - 'neutral': Thông báo trung tính (xám)
8082
+ * - 'success': Xác nhận hoàn thành hoặc kích hoạt thành công (xanh lá)
8083
+ * - 'info': Thông tin cần người dùng lưu ý (xanh lơ)
8084
+ */
8085
+ type ConfirmColor = "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | "info";
8086
+ /**
8087
+ * Các mức bo góc của khung hộp thoại Confirm:
8088
+ * - 'none': Không bo góc (vuông vức)
8089
+ * - 'sm': Bo góc nhẹ (rounded-sm)
8090
+ * - 'md': Bo góc vừa (rounded-md)
8091
+ * - 'lg': Bo góc lớn (rounded-lg)
8092
+ * - 'xl': Bo góc rất lớn (rounded-xl)
8093
+ * - 'full': Bo tròn hoàn toàn (rounded-2xl)
8094
+ */
8095
+ type ConfirmRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
8096
+ /**
8097
+ * Props cho component `<Confirm>` (Khung giao diện hộp thoại xác nhận - Pure Compound Dialog Box)
8098
+ */
8099
+ interface ConfirmProps extends HTMLAttributes<HTMLDivElement> {
8100
+ /**
8101
+ * Ref chuyển tiếp (forwardRef) trỏ trực tiếp đến thẻ div hộp thoại
8102
+ */
8103
+ ref?: Ref<HTMLDivElement>;
8104
+ /**
8105
+ * Kích thước chiều rộng của hộp thoại (được kế thừa tự động bởi ConfirmHeader, ConfirmBody, ConfirmFooter)
8106
+ * @default 'md'
8107
+ */
8108
+ size?: ConfirmSize;
8109
+ /**
8110
+ * Chủ đề màu sắc cho hộp thoại (được kế thừa tự động bởi ConfirmHeader và ConfirmFooter)
8111
+ * @default 'warning'
8112
+ */
8113
+ color?: ConfirmColor;
8114
+ /**
8115
+ * Tùy chỉnh độ bo góc của hộp thoại:
8116
+ * - 'none': không bo góc
8117
+ * - 'sm': bo góc nhỏ
8118
+ * - 'md': bo góc vừa
8119
+ * - 'lg': bo góc lớn
8120
+ * - 'xl': bo góc rất lớn
8121
+ * - 'full': bo tròn hoàn toàn
8122
+ * @default 'rounded-lg'
8123
+ */
8124
+ radius?: ConfirmRadius;
8125
+ /**
8126
+ * Class tùy biến CSS cho container bao ngoài hộp thoại
8127
+ */
8128
+ className?: string;
8129
+ /**
8130
+ * Các sub-component con bên trong hộp thoại:
8131
+ * `<ConfirmHeader>`, `<ConfirmBody>`, `<ConfirmFooter>`
8132
+ */
8133
+ children?: ReactNode;
8134
+ }
8135
+ /**
8136
+ * Props cho component `<ConfirmHeader>` (Phần đầu của hộp thoại Confirm)
8137
+ */
8138
+ interface ConfirmHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
8139
+ /**
8140
+ * Kích thước áp dụng cho tiêu đề, icon và khoảng cách padding trong header
8141
+ * @default 'md'
8142
+ */
8143
+ size?: ConfirmSize;
8144
+ /**
8145
+ * Chủ đề màu sắc cho icon badge
8146
+ * @default 'warning'
8147
+ */
8148
+ color?: ConfirmColor;
8149
+ /**
8150
+ * Icon hiển thị cạnh tiêu đề (`true`: icon mặc định theo màu, `false`: ẩn icon, `ReactNode`: icon tùy chỉnh)
8151
+ * @default true
8152
+ */
8153
+ icon?: ReactNode | boolean;
8154
+ /**
8155
+ * Tiêu đề chính của hộp thoại Confirm
8156
+ */
8157
+ title?: ReactNode;
8158
+ /**
8159
+ * Class CSS tùy biến cho container bao ngoài icon badge
8160
+ */
8161
+ iconClassName?: string;
8162
+ /**
8163
+ * Class CSS tùy biến cho tiêu đề
8164
+ */
8165
+ titleClassName?: string;
7584
8166
  /**
7585
8167
  * Cho phép hiển thị nút đóng (X) ở góc phải của header
7586
8168
  * @default false
7587
8169
  */
7588
- showCloseButton?: boolean;
8170
+ showCloseButton?: boolean;
8171
+ /**
8172
+ * Callback tùy biến khi click nút đóng (X).
8173
+ * Tự động kết hợp hiệu ứng Exit Animation của ConfirmContainer.
8174
+ */
8175
+ onClose?: () => void;
8176
+ /**
8177
+ * Class CSS tùy biến cho nút đóng (X)
8178
+ */
8179
+ closeButtonClassName?: string;
8180
+ /**
8181
+ * Class CSS tùy biến cho toàn bộ header
8182
+ */
8183
+ className?: string;
8184
+ /**
8185
+ * Nội dung ReactNode tùy chỉnh bên trong header
8186
+ */
8187
+ children?: ReactNode;
8188
+ }
8189
+ /**
8190
+ * Props cho component `<ConfirmBody>` (Phần thân chứa nội dung mô tả của Confirm)
8191
+ */
8192
+ interface ConfirmBodyProps extends HTMLAttributes<HTMLDivElement> {
8193
+ /**
8194
+ * Kích thước áp dụng cho cỡ chữ và padding của body
8195
+ * @default 'md'
8196
+ */
8197
+ size?: ConfirmSize;
8198
+ /**
8199
+ * Đoạn văn bản mô tả ngắn (sẽ được bọc trong thẻ `<p>`)
8200
+ */
8201
+ description?: ReactNode;
8202
+ /**
8203
+ * Class CSS tùy biến riêng cho thẻ `<p>` mô tả
8204
+ */
8205
+ descriptionClassName?: string;
8206
+ /**
8207
+ * Class CSS tùy biến cho toàn bộ body
8208
+ */
8209
+ className?: string;
8210
+ /**
8211
+ * Nội dung con tùy biến bên trong body
8212
+ */
8213
+ children?: ReactNode;
8214
+ }
8215
+ /**
8216
+ * Props cho component `<ConfirmFooter>` (Phần chân chứa các nút hành động xác nhận và hủy)
8217
+ */
8218
+ interface ConfirmFooterProps extends HTMLAttributes<HTMLDivElement> {
8219
+ /**
8220
+ * Kích thước áp dụng cho padding và kích thước các nút bấm
8221
+ * @default 'md'
8222
+ */
8223
+ size?: ConfirmSize;
8224
+ /**
8225
+ * Nhãn văn bản cho nút Xác nhận
8226
+ * @default 'Xác nhận'
8227
+ */
8228
+ confirmText?: ReactNode;
8229
+ /**
8230
+ * Nhãn văn bản cho nút Hủy (truyền `false` để ẩn nút Hủy)
8231
+ * @default 'Hủy'
8232
+ */
8233
+ cancelText?: ReactNode | false;
8234
+ /**
8235
+ * Biến thể của nút Xác nhận ('filled', 'outline', 'soft', ...)
8236
+ * @default 'filled'
8237
+ */
8238
+ confirmVariant?: ButtonVariant;
8239
+ /**
8240
+ * Biến thể của nút Hủy ('filled', 'outline', 'soft', ...)
8241
+ * @default 'outline'
8242
+ */
8243
+ cancelVariant?: ButtonVariant;
8244
+ /**
8245
+ * Màu nút Xác nhận tùy chỉnh (mặc định lấy theo `color`)
8246
+ */
8247
+ confirmColor?: ButtonColor;
8248
+ /**
8249
+ * Màu nút Hủy
8250
+ * @default 'secondary'
8251
+ */
8252
+ cancelColor?: ButtonColor;
8253
+ /**
8254
+ * Callback khi người dùng bấm nút Xác nhận (trả về void hoặc Promise)
8255
+ */
8256
+ onConfirm?: () => void | Promise<unknown>;
8257
+ /**
8258
+ * Callback khi người dùng bấm nút Hủy
8259
+ */
8260
+ onCancel?: () => void;
8261
+ /**
8262
+ * Callback đóng hộp thoại
8263
+ */
8264
+ onClose?: () => void;
8265
+ /**
8266
+ * Props bổ sung truyền trực tiếp cho component Button Xác nhận
8267
+ */
8268
+ confirmButtonProps?: Partial<ButtonProps>;
8269
+ /**
8270
+ * Props bổ sung truyền trực tiếp cho component Button Hủy
8271
+ */
8272
+ cancelButtonProps?: Partial<ButtonProps>;
8273
+ /**
8274
+ * Class CSS tùy biến cho khối footer
8275
+ */
8276
+ className?: string;
8277
+ /**
8278
+ * Các nút bấm tùy chỉnh bên trong footer (khi dùng Pure Compound Pattern)
8279
+ */
8280
+ children?: ReactNode;
8281
+ }
8282
+ /**
8283
+ * Props cho component `<ConfirmContainer>` (Tầng Wrapper quản lý Overlay Backdrop, Native Dialog, ESC & Animation)
8284
+ */
8285
+ interface ConfirmContainerProps extends HTMLAttributes<HTMLDialogElement> {
8286
+ /**
8287
+ * Trạng thái hiển thị mở/đóng Confirm (Controlled State)
8288
+ * @default false
8289
+ */
8290
+ open?: boolean;
8291
+ /**
8292
+ * Callback được kích hoạt khi Confirm đóng (click ra ngoài backdrop, nhấn phím ESC, hoặc click nút đóng X)
8293
+ */
8294
+ onClose?: () => void;
8295
+ /**
8296
+ * Kích thước tổng thể của Confirm (truyền xuống context để đồng bộ kích thước cho Confirm, Header, Body, Footer)
8297
+ * @default 'md'
8298
+ */
8299
+ size?: ConfirmSize;
8300
+ /**
8301
+ * Chủ đề màu sắc tổng thể của Confirm (truyền xuống context để đồng bộ cho Confirm, Header, Footer)
8302
+ * @default 'warning'
8303
+ */
8304
+ color?: ConfirmColor;
8305
+ /**
8306
+ * Trạng thái đang tải / xử lý (Loading).
8307
+ * Khi `isLoading = true`:
8308
+ * - Chặn đóng Confirm khi click vào vùng backdrop overlay (`closeOnOverlayClick`)
8309
+ * - Chặn đóng Confirm khi nhấn phím ESC (`closeOnEsc`)
8310
+ * - Chặn đóng Confirm từ nút đóng (X) và component `<ConfirmClose>`
8311
+ * @default false
8312
+ */
8313
+ isLoading?: boolean;
8314
+ /**
8315
+ * Cho phép tự động đóng Confirm khi người dùng click vào vùng backdrop overlay bên ngoài
8316
+ * @default true
8317
+ */
8318
+ closeOnOverlayClick?: boolean;
8319
+ /**
8320
+ * Cho phép tự động đóng Confirm khi người dùng nhấn phím ESC (Escape) trên bàn phím
8321
+ * @default true
8322
+ */
8323
+ closeOnEsc?: boolean;
8324
+ /**
8325
+ * Tự động khóa cuộn trang (body scroll lock) khi Confirm đang hiển thị
8326
+ * @default true
8327
+ */
8328
+ lockScroll?: boolean;
8329
+ /**
8330
+ * Class tùy biến CSS cho lớp nền backdrop mờ toàn màn hình
8331
+ */
8332
+ overlayClassName?: string;
8333
+ /**
8334
+ * Class tùy biến CSS cho container bao ngoài dialog
8335
+ */
8336
+ className?: string;
8337
+ /**
8338
+ * Nội dung bên trong container (thường là component `<Confirm>`)
8339
+ */
8340
+ children?: ReactNode;
8341
+ }
8342
+ /**
8343
+ * Props cho component `<ConfirmClose>` (Wrapper tự động kích hoạt đóng Confirm có Exit Animation cho bất kỳ nút bấm nào)
8344
+ */
8345
+ interface ConfirmCloseProps extends HTMLAttributes<HTMLElement> {
8346
+ /**
8347
+ * Component con cần bọc để kích hoạt sự kiện đóng (thường là `<Button>`)
8348
+ */
8349
+ children?: ReactNode;
8350
+ /**
8351
+ * Tự động truyền thẳng sự kiện onClick và props vào phần tử con (cloneElement) thay vì bọc ngoài bằng thẻ div
8352
+ * @default true
8353
+ */
8354
+ asChild?: boolean;
8355
+ }
8356
+
8357
+ /**
8358
+ * Khung giao diện hộp thoại xác nhận (Confirm Dialog Box).
8359
+ * Thiết kế theo mô hình Pure Compound Pattern giống Modal:
8360
+ * Nhận size/color từ ConfirmContainer qua Context và render {children}.
8361
+ */
8362
+ declare function Confirm({ size, radius, className, children, ref, ...props }: ConfirmProps): react_jsx_runtime.JSX.Element;
8363
+
8364
+ declare function ConfirmContainer({ open, size, color, isLoading, closeOnOverlayClick, closeOnEsc, lockScroll, overlayClassName, className, children, onClose, ...props }: ConfirmContainerProps): react_jsx_runtime.JSX.Element | null;
8365
+
8366
+ /**
8367
+ * Phần đầu của hộp thoại Confirm (Hiển thị icon badge, tiêu đề và nút đóng X)
8368
+ */
8369
+ declare function ConfirmHeader({ size, color, icon, title, iconClassName, titleClassName, showCloseButton, onClose, closeButtonClassName, className, children, ...props }: ConfirmHeaderProps): react_jsx_runtime.JSX.Element;
8370
+
8371
+ /**
8372
+ * Phần thân của hộp thoại Confirm (Hiển thị nội dung mô tả hoặc nội dung tùy biến)
8373
+ */
8374
+ declare function ConfirmBody({ size, description, descriptionClassName, className, children, ...props }: ConfirmBodyProps): react_jsx_runtime.JSX.Element;
8375
+
8376
+ /**
8377
+ * Phần chân của hộp thoại Confirm (Chứa các nút hành động Xác nhận, Hủy, hoặc các nút tùy chỉnh)
8378
+ */
8379
+ declare function ConfirmFooter({ size, confirmText, cancelText, confirmVariant, cancelVariant, confirmColor, cancelColor, onConfirm, onCancel, onClose, confirmButtonProps, cancelButtonProps, className, children, ...props }: ConfirmFooterProps): react_jsx_runtime.JSX.Element;
8380
+
8381
+ /**
8382
+ * Component wrapper kích hoạt đóng Confirm kèm hiệu ứng thoát (Exit Animation)
8383
+ * Tự động vô hiệu hóa (`disabled`) khi `isLoading = true`.
8384
+ */
8385
+ declare function ConfirmClose({ children, asChild, onClick, ...props }: ConfirmCloseProps): react_jsx_runtime.JSX.Element;
8386
+
8387
+ /**
8388
+ * Giá trị được chia sẻ từ `<ConfirmContainer>` và `<Confirm>` xuống các sub-component con thông qua Context
8389
+ */
8390
+ interface ConfirmContextValue {
8391
+ /**
8392
+ * Callback kích hoạt đóng Confirm kèm hiệu ứng thoát (Exit Animation)
8393
+ */
8394
+ onClose: () => void;
8395
+ /**
8396
+ * Trạng thái đang tải / xử lý (Loading).
8397
+ * Khi `true`, sẽ chặn đóng hộp thoại và tự động vô hiệu hóa các nút đóng / hủy.
8398
+ */
8399
+ isLoading?: boolean;
8400
+ /**
8401
+ * Kích thước chiều rộng của Confirm
8402
+ */
8403
+ size?: ConfirmSize;
8404
+ /**
8405
+ * Chủ đề màu sắc của Confirm
8406
+ */
8407
+ color?: ConfirmColor;
8408
+ }
8409
+ /**
8410
+ * Hook truy xuất context của Confirm từ bên trong `<ConfirmContainer>` hoặc `<Confirm>`
8411
+ */
8412
+ declare const useConfirmContext: () => ConfirmContextValue | null;
8413
+
8414
+ declare function Modal({ size, radius, className, children, ref, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
8415
+
8416
+ declare function ModalContainer({ open, id, size, isLoading, closeOnOverlayClick, closeOnEsc, lockScroll, overlayClassName, className, children, onClose, ...props }: ModalContainerProps): react_jsx_runtime.JSX.Element | null;
8417
+
8418
+ declare function ModalHeader({ size, title, description, titleClassName, descriptionClassName, showCloseButton, onClose, closeButtonClassName, className, children, ...props }: ModalHeaderProps): react_jsx_runtime.JSX.Element;
8419
+
8420
+ declare function ModalBody({ size, className, children, ...props }: ModalBodyProps): react_jsx_runtime.JSX.Element;
8421
+
8422
+ declare function ModalFooter({ size, className, children, ...props }: ModalFooterProps): react_jsx_runtime.JSX.Element;
8423
+
8424
+ declare function ModalClose({ children, asChild, onClick, ...props }: ModalCloseProps): react_jsx_runtime.JSX.Element;
8425
+
8426
+ interface ModalContextValue {
8427
+ onClose: () => void;
8428
+ isLoading?: boolean;
8429
+ size?: ModalSize;
8430
+ }
8431
+ declare const useModalContext: () => ModalContextValue | null;
8432
+
8433
+ /**
8434
+ * Component `<FilePreview>`: Nhận file và headerTitle qua useFileContext(),
8435
+ * tự động xác định loại file và chọn component hiển thị tương ứng.
8436
+ */
8437
+ declare function FilePreview({ onDownload, imageProps, className, }: FilePreviewProps): react_jsx_runtime.JSX.Element;
8438
+
8439
+ /**
8440
+ * Component `<FileContainer>`: Hộp thoại bọc Modal Dialog quản lý Backdrop, Top Layer, ESC và Lock Scroll
8441
+ * Nhận prop `file` và truyền xuống `<FilePreview />` qua `FileContext`.
8442
+ */
8443
+ declare function FileContainer({ open, onClose, file, title, description, size, radius, showCloseButton, closeOnOverlayClick, closeOnEsc, lockScroll, className, overlayClassName, children, }: FileContainerProps): react_jsx_runtime.JSX.Element;
8444
+
8445
+ interface FileContextValue {
8446
+ file?: PreviewFile;
8447
+ headerTitle?: ReactNode;
8448
+ }
8449
+ declare const useFileContext: () => FileContextValue | null;
8450
+
8451
+ declare const IMAGE_EXTENSIONS: string[];
8452
+ declare const PDF_EXTENSIONS: string[];
8453
+ declare const VIDEO_EXTENSIONS: string[];
8454
+ declare const AUDIO_EXTENSIONS: string[];
8455
+ declare const DOCUMENT_EXTENSIONS: string[];
8456
+
8457
+ declare function getFileName(input?: PreviewFile | string | null): string;
8458
+ declare function getFileExtension(filenameOrSrc?: string): string;
8459
+ declare function getFileType(filenameOrSrc?: string): FileType;
8460
+ declare function normalizePreviewFile(input?: PreviewFile | null): {
8461
+ file: File | undefined;
8462
+ serverFile: ServerFile | undefined;
8463
+ name: string;
8464
+ type: FileType;
8465
+ };
8466
+ declare function downloadFile(src: string, filename?: string): void;
8467
+
8468
+ declare function ImagePreview({ src, name, minZoom, maxZoom, showToolbar, toolbarProps, children, }: ImagePreviewProps): react_jsx_runtime.JSX.Element | null;
8469
+
8470
+ declare function ImagePreviewToolbar({ zoom, minZoom, maxZoom, step, onZoomChange, sliderProps, onZoomIn, onZoomOut, onRotateCw, onRotateCcw, onFlipHorizontal, onReset, currentImage, tools, className, }: ImagePreviewToolbarProps): react_jsx_runtime.JSX.Element;
8471
+
8472
+ type SkeletonVariant = "pulse" | "wave" | "none";
8473
+ type SkeletonRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
8474
+ type SkeletonShape = "rectangle" | "circle";
8475
+ type SkeletonObjectFit = "cover" | "contain" | "fill" | "none" | "scale-down";
8476
+ interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
8477
+ /**
8478
+ * Ref trỏ tới phần tử div bên ngoài.
8479
+ */
8480
+ ref?: Ref<HTMLDivElement>;
8481
+ /**
8482
+ * Kiểu animation hiển thị:
8483
+ * - 'pulse': nhịp thở opacity (mặc định)
8484
+ * - 'wave': shimmer chạy từ góc trên-trái xuống góc dưới-phải
8485
+ * - 'none': không animation (static placeholder)
8486
+ * @default 'pulse'
8487
+ */
8488
+ variant?: SkeletonVariant;
8489
+ /**
8490
+ * Hình dạng của skeleton:
8491
+ * - 'rectangle': hình chữ nhật, kết hợp với `radius` để bo góc (mặc định)
8492
+ * - 'circle': hình tròn hoàn toàn, `width` === `height`, bỏ qua `radius`
8493
+ * @default 'rectangle'
8494
+ */
8495
+ shape?: SkeletonShape;
8496
+ /**
8497
+ * Độ bo góc, chỉ áp dụng khi `shape === 'rectangle'`
8498
+ * @default 'md'
8499
+ */
8500
+ radius?: SkeletonRadius;
8501
+ /**
8502
+ * Chiều rộng (CSS string hoặc số px)
8503
+ * @example "100%", "200px", 200
8504
+ */
8505
+ width?: string | number;
8506
+ /**
8507
+ * Chiều cao (CSS string hoặc số px)
8508
+ * @example "1rem", "40px", 40
8509
+ * @default "1rem"
8510
+ */
8511
+ height?: string | number;
8512
+ /**
8513
+ * Số lượng dòng skeleton xếp theo cột.
8514
+ * Khi > 1, dòng cuối cùng sẽ tự động thu hẹp còn 60% width để mô phỏng đoạn văn tự nhiên.
8515
+ * @default 1
8516
+ */
8517
+ lines?: number;
8518
+ /**
8519
+ * Khoảng cách giữa các dòng khi `lines > 1` (CSS string hoặc số px)
8520
+ * @default "0.5rem"
8521
+ */
8522
+ gap?: string | number;
8523
+ }
8524
+ interface LoadingImageProps extends Omit<ImageProps, "onLoad" | "onError" | "alt" | "src" | "onClick"> {
8525
+ /**
8526
+ * Đường dẫn ảnh, đối tượng File / Blob hoặc ServerFile ({ src/url, name, ... }). Tùy chọn khi chỉ hiển thị skeleton placeholder.
8527
+ */
8528
+ src?: ImageProps["src"] | File | Blob | ServerFile;
8529
+ /**
8530
+ * Văn bản thay thế cho ảnh. Mặc định là chuỗi rỗng.
8531
+ * @default ""
8532
+ */
8533
+ alt?: string;
8534
+ /**
8535
+ * Kiểu animation của skeleton khi đang tải ảnh.
8536
+ * @default 'pulse'
8537
+ */
8538
+ skeletonVariant?: SkeletonVariant;
8539
+ /**
8540
+ * Độ bo góc áp dụng đồng thời cho skeleton placeholder và ảnh.
8541
+ * @default 'md'
8542
+ */
8543
+ radius?: SkeletonRadius;
8544
+ /**
8545
+ * Kiểu căn chỉnh hiển thị ảnh (object-fit).
8546
+ * @default 'cover'
8547
+ */
8548
+ objectFit?: SkeletonObjectFit;
8549
+ /**
8550
+ * Bật tính năng click vào ảnh để xem trước phóng to qua FilePreview (trong FileContainer modal).
8551
+ * @default true
8552
+ */
8553
+ preview?: boolean;
8554
+ /**
8555
+ * Class CSS tuỳ thêm cho wrapper bên ngoài.
8556
+ */
8557
+ wrapperClassName?: string;
8558
+ /**
8559
+ * Inline style tuỳ thêm cho wrapper bên ngoài.
8560
+ */
8561
+ wrapperStyle?: React.CSSProperties;
8562
+ /**
8563
+ * Callback khi người dùng click vào ảnh / wrapper.
8564
+ */
8565
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
8566
+ /**
8567
+ * Callback được gọi khi ảnh tải thành công.
8568
+ */
8569
+ onLoad?: ImageProps["onLoad"];
8570
+ /**
8571
+ * Callback được gọi khi ảnh gặp lỗi tải.
8572
+ */
8573
+ onError?: ImageProps["onError"];
8574
+ /**
8575
+ * Ref trỏ tới phần tử wrapper div bên ngoài.
8576
+ */
8577
+ ref?: Ref<HTMLDivElement>;
8578
+ }
8579
+
8580
+ declare function Skeleton({ ref, variant, shape, radius, width, height, lines, gap, className, style, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
8581
+
8582
+ declare function LoadingImage({ src, alt, width, height, fill, skeletonVariant, radius, objectFit, preview, className, wrapperClassName, style, wrapperStyle, onLoad, onError, onClick, ref, ...imageProps }: LoadingImageProps): react_jsx_runtime.JSX.Element;
8583
+
8584
+ interface FuzzyFilterMeta {
8585
+ itemRank?: RankingInfo;
8586
+ }
8587
+ type FuzzyFeatures = TableFeatures & {
8588
+ filterMeta: FuzzyFilterMeta;
8589
+ };
8590
+ /**
8591
+ * Thuật toán lọc Fuzzy (Fuzzy Filter) sử dụng `@tanstack/match-sorter-utils`.
8592
+ *
8593
+ * Tính năng:
8594
+ * - Chuẩn hóa và so khớp gần đúng (Equal, StartsWith, WordStartsWith, Contains, Acronym, Matches)
8595
+ * - Tự động loại bỏ dấu tiếng Việt / diacritics
8596
+ * - Không phân biệt chữ hoa / chữ thường (Case-insensitive)
8597
+ * - Đính kèm thông tin `RankingInfo` vào metadata qua `addMeta` để hỗ trợ sắp xếp theo độ liên quan
8598
+ */
8599
+ declare const fuzzyFilter: FilterFn<FuzzyFeatures, RowData>;
8600
+
8601
+ /**
8602
+ * Bộ features tiêu chuẩn của @openway/ui dành cho TanStack Table v9.
8603
+ * Bao gồm: Sắp xếp (Sorting), Phân trang (Pagination), Chọn dòng (Row Selection),
8604
+ * Lọc cột & Lọc toàn bảng (Column & Global Filtering), Ẩn/hiện cột (Visibility),
8605
+ * Ghim cột (Pinning), và Sắp xếp thứ tự cột (Column Ordering).
8606
+ */
8607
+ declare const defaultTableFeatures: {
8608
+ rowSortingFeature: _tanstack_react_table.TableFeature;
8609
+ rowPaginationFeature: _tanstack_react_table.TableFeature;
8610
+ rowSelectionFeature: _tanstack_react_table.TableFeature;
8611
+ columnFilteringFeature: _tanstack_react_table.TableFeature;
8612
+ globalFilteringFeature: _tanstack_react_table.TableFeature;
8613
+ columnVisibilityFeature: _tanstack_react_table.TableFeature;
8614
+ columnPinningFeature: _tanstack_react_table.TableFeature;
8615
+ columnOrderingFeature: _tanstack_react_table.TableFeature;
8616
+ sortedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
8617
+ paginatedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
8618
+ filteredRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
8619
+ filterFns: {
8620
+ fuzzy: _tanstack_react_table.FilterFn<FuzzyFeatures, RowData>;
8621
+ };
8622
+ };
8623
+ type DefaultTableFeatures = typeof defaultTableFeatures;
8624
+ /**
8625
+ * Helper tạo định nghĩa cột (column definitions) có type-safety đầy đủ
8626
+ * gắn liền với DefaultTableFeatures của TanStack Table v9.
8627
+ */
8628
+ declare function createTableColumnHelper<TData extends RowData = RowData>(): ColumnHelper<DefaultTableFeatures, TData>;
8629
+ type UseDataTableOptions<TData extends RowData = RowData> = Omit<TableOptions<DefaultTableFeatures, TData>, "features" | "columns"> & {
8630
+ features?: DefaultTableFeatures;
8631
+ columns: TableOptions<DefaultTableFeatures, TData>["columns"] | ReturnType<ColumnHelper<DefaultTableFeatures, TData>["columns"]>;
8632
+ };
8633
+ /**
8634
+ * Hook `useDataTable` bọc `useTable` của TanStack Table v9 với cấu hình
8635
+ * tính năng mặc định tối ưu sẵn cho @openway/ui.
8636
+ */
8637
+ declare function useDataTable<TData extends RowData = RowData>(options: UseDataTableOptions<TData>): ReactTable<DefaultTableFeatures, TData>;
8638
+
8639
+ /**
8640
+ * Kiểu trạng thái thứ tự các cột: danh sách ID của các cột
8641
+ */
8642
+ type ColumnOrderState = string[];
8643
+ /**
8644
+ * Kích cỡ hiển thị của Table:
8645
+ * - 'sm': Nhỏ gọn (dense), padding hẹp (px-3 py-2), font chữ text-xs, phù hợp bảng nhiều dữ liệu hoặc màn hình nhỏ
8646
+ * - 'md': Tiêu chuẩn (mặc định), padding cân đối (px-4 py-3), font chữ text-sm, phù hợp hầu hết giao diện quản trị
8647
+ * - 'lg': Thoáng đãng, padding rộng (px-5 py-4), font chữ text-base, phù hợp bảng dữ liệu chính, báo cáo hoặc dashboard
8648
+ */
8649
+ type TableSize = "sm" | "md" | "lg";
8650
+ /**
8651
+ * Biến thể kiểu dáng giao diện của Table:
8652
+ * - 'default': Bảng phẳng với đường kẻ phân cách viền mờ thanh lịch, nền header xám nhạt trung tính
8653
+ * - 'striped': Bảng kẻ sọc xen kẽ (Zebra stripes), các dòng chẵn mang nền xám nhạt giúp tăng khả năng đọc lướt
8654
+ * - 'bordered': Viền đầy đủ bao quanh từng ô và toàn bộ khung bao ngoài của bảng
8655
+ */
8656
+ type TableVariant = "default" | "striped" | "bordered";
8657
+ /**
8658
+ * Hướng căn lề nội dung của các ô trong Table:
8659
+ * - 'left': Căn lề trái (mặc định cho văn bản, tên, mô tả, nội dung dài)
8660
+ * - 'center': Căn giữa (phù hợp cho mã định danh ID, trạng thái, ngày tháng, checkbox)
8661
+ * - 'right': Căn lề phải (chuẩn cho số tiền, số lượng, phần trăm, cột hành động thao tác)
8662
+ */
8663
+ type TableAlign = "left" | "center" | "right";
8664
+ /**
8665
+ * Thuộc tính của component bọc ngoài `<Table />` (`<table>`)
8666
+ */
8667
+ interface TableProps extends HTMLAttributes<HTMLTableElement> {
8668
+ /**
8669
+ * Ref chuyển tiếp trực tiếp đến phần tử HTML table (React 19)
8670
+ */
8671
+ ref?: Ref<HTMLTableElement>;
8672
+ /**
8673
+ * Biến thể kiểu dáng hiển thị của bảng
8674
+ * @default 'default'
8675
+ */
8676
+ variant?: TableVariant;
8677
+ /**
8678
+ * Kích cỡ hiển thị của bảng (khoảng đệm và kích thước chữ)
8679
+ * @default 'md'
8680
+ */
8681
+ size?: TableSize;
8682
+ /**
8683
+ * Class tùy biến cho khung container bao ngoài thẻ table (khung xử lý cuộn ngang overflow-x-auto)
8684
+ */
8685
+ containerClassName?: string;
8686
+ /**
8687
+ * Props truyền bổ sung vào thẻ div wrapper bao ngoài
8688
+ */
8689
+ wrapperProps?: HTMLAttributes<HTMLDivElement>;
8690
+ /**
8691
+ * Nội dung các phần tử bảng bên trong (TableHeader, TableBody, TableFooter, TableCaption...)
8692
+ */
8693
+ children?: ReactNode;
8694
+ }
8695
+ /**
8696
+ * Thuộc tính của component phần đầu bảng `<TableHeader />` (`<thead>`)
8697
+ */
8698
+ interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
8699
+ /**
8700
+ * Ref chuyển tiếp đến phần tử HTML thead
8701
+ */
8702
+ ref?: Ref<HTMLTableSectionElement>;
8703
+ /**
8704
+ * Nội dung dòng tiêu đề bên trong thẻ thead
8705
+ */
8706
+ children?: ReactNode;
8707
+ }
8708
+ /**
8709
+ * Thuộc tính của component thân bảng `<TableBody />` (`<tbody>`)
8710
+ */
8711
+ interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
8712
+ /**
8713
+ * Ref chuyển tiếp đến phần tử HTML tbody
8714
+ */
8715
+ ref?: Ref<HTMLTableSectionElement>;
8716
+ /**
8717
+ * Nội dung các dòng dữ liệu bên trong thẻ tbody
8718
+ */
8719
+ children?: ReactNode;
8720
+ }
8721
+ /**
8722
+ * Thuộc tính của component chân bảng `<TableFooter />` (`<tfoot>`)
8723
+ */
8724
+ interface TableFooterProps extends HTMLAttributes<HTMLTableSectionElement> {
8725
+ /**
8726
+ * Ref chuyển tiếp đến phần tử HTML tfoot
8727
+ */
8728
+ ref?: Ref<HTMLTableSectionElement>;
8729
+ /**
8730
+ * Nội dung tổng kết hoặc thông tin thống kê ở chân bảng
8731
+ */
8732
+ children?: ReactNode;
8733
+ }
8734
+ /**
8735
+ * Thuộc tính của component dòng `<TableRow />` (`<tr>`)
8736
+ */
8737
+ interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
8738
+ /**
8739
+ * Ref chuyển tiếp đến phần tử HTML tr
8740
+ */
8741
+ ref?: Ref<HTMLTableRowElement>;
8742
+ /**
8743
+ * Đánh dấu dòng đang được chọn (áp dụng background highlight và thuộc tính aria-selected)
8744
+ * @default false
8745
+ */
8746
+ isSelected?: boolean;
7589
8747
  /**
7590
- * Callback tùy biến khi click nút đóng (X).
7591
- * Tự động kết hợp hiệu ứng Exit Animation của ConfirmContainer.
8748
+ * Bật hiệu ứng đổi màu nền nhẹ khi chuột qua dòng
8749
+ * @default true
7592
8750
  */
7593
- onClose?: () => void;
8751
+ isHoverable?: boolean;
7594
8752
  /**
7595
- * Class CSS tùy biến cho nút đóng (X)
8753
+ * Nội dung các ô dữ liệu bên trong dòng (TableCell hoặc TableHead)
7596
8754
  */
7597
- closeButtonClassName?: string;
8755
+ children?: ReactNode;
8756
+ }
8757
+ /**
8758
+ * Thuộc tính của ô tiêu đề `<TableHead />` (`<th>`)
8759
+ */
8760
+ interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {
7598
8761
  /**
7599
- * Class CSS tùy biến cho toàn bộ header
8762
+ * Ref chuyển tiếp đến phần tử HTML th
7600
8763
  */
7601
- className?: string;
8764
+ ref?: Ref<HTMLTableCellElement>;
7602
8765
  /**
7603
- * Nội dung ReactNode tùy chỉnh bên trong header
8766
+ * Hướng căn lề nội dung tiêu đề ('left', 'center', 'right')
8767
+ * @default 'left'
8768
+ */
8769
+ align?: TableAlign;
8770
+ /**
8771
+ * Nội dung hiển thị bên trong ô tiêu đề
7604
8772
  */
7605
8773
  children?: ReactNode;
7606
8774
  }
7607
8775
  /**
7608
- * Props cho component `<ConfirmBody>` (Phần thân chứa nội dung mô tả của Confirm)
8776
+ * Thuộc tính của ô dữ liệu `<TableCell />` (`<td>`)
7609
8777
  */
7610
- interface ConfirmBodyProps extends HTMLAttributes<HTMLDivElement> {
8778
+ interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
7611
8779
  /**
7612
- * Kích thước áp dụng cho cỡ chữ và padding của body
7613
- * @default 'md'
8780
+ * Ref chuyển tiếp đến phần tử HTML td
7614
8781
  */
7615
- size?: ConfirmSize;
8782
+ ref?: Ref<HTMLTableCellElement>;
7616
8783
  /**
7617
- * Đoạn văn bản tả ngắn (sẽ được bọc trong thẻ `<p>`)
8784
+ * Hướng căn lề nội dung ô ('left', 'center', 'right')
8785
+ * @default 'left'
7618
8786
  */
7619
- description?: ReactNode;
8787
+ align?: TableAlign;
7620
8788
  /**
7621
- * Class CSS tùy biến riêng cho thẻ `<p>` mô tả
8789
+ * Nội dung hiển thị bên trong ô dữ liệu
7622
8790
  */
7623
- descriptionClassName?: string;
8791
+ children?: ReactNode;
8792
+ }
8793
+ /**
8794
+ * Thuộc tính của chú thích bảng `<TableCaption />` (`<caption>`)
8795
+ */
8796
+ interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
7624
8797
  /**
7625
- * Class CSS tùy biến cho toàn bộ body
8798
+ * Ref chuyển tiếp đến phần tử HTML caption
7626
8799
  */
7627
- className?: string;
8800
+ ref?: Ref<HTMLTableCaptionElement>;
7628
8801
  /**
7629
- * Nội dung con tùy biến bên trong body
8802
+ * Văn bản tả hoặc chú thích phụ bên dưới bảng
7630
8803
  */
7631
8804
  children?: ReactNode;
7632
8805
  }
7633
8806
  /**
7634
- * Props cho component `<ConfirmFooter>` (Phần chân chứa các nút hành động xác nhận và hủy)
8807
+ * Thuộc tính của component tiêu đề cột tương tác sắp xếp `<TableColumnHeader />`
7635
8808
  */
7636
- interface ConfirmFooterProps extends HTMLAttributes<HTMLDivElement> {
8809
+ interface TableColumnHeaderProps<TData extends RowData = RowData, TValue = unknown> extends HTMLAttributes<HTMLDivElement> {
8810
+ /**
8811
+ * Đối tượng cột TanStack Table v9
8812
+ */
8813
+ column: Column<DefaultTableFeatures, TData, TValue>;
8814
+ /**
8815
+ * Tên tiêu đề hiển thị của cột
8816
+ */
8817
+ title: string;
8818
+ }
8819
+ /**
8820
+ * Thuộc tính của component tiêu đề cột hỗ trợ kéo thả sắp xếp `<DraggableTableHead />`
8821
+ */
8822
+ interface DraggableTableHeadProps<TData extends RowData = RowData, TValue = unknown> {
8823
+ /**
8824
+ * Đối tượng Header TanStack Table v9 đại diện cho cột
8825
+ */
8826
+ header: Header<DefaultTableFeatures, TData, TValue>;
8827
+ /**
8828
+ * Cho phép sắp xếp dữ liệu cột khi click vào tiêu đề
8829
+ */
8830
+ canSort?: boolean;
8831
+ /**
8832
+ * Nội dung React hiển thị bên trong ô header
8833
+ */
8834
+ headerContent?: ReactNode;
8835
+ /**
8836
+ * Trạng thái sắp xếp WAI-ARIA ('ascending' | 'descending' | 'none')
8837
+ */
8838
+ ariaSort?: "ascending" | "descending" | "none";
8839
+ /**
8840
+ * Vô hiệu hóa tính năng kéo thả cho cột này (ví dụ cột Checkbox `_select`)
8841
+ * @default false
8842
+ */
8843
+ disabled?: boolean;
8844
+ /**
8845
+ * Class tùy biến cho phần tử `<th>`
8846
+ */
8847
+ className?: string;
8848
+ }
8849
+ /**
8850
+ * Thuộc tính của thanh điều hướng phân trang `<TablePagination />`
8851
+ */
8852
+ interface TablePaginationProps<TData extends RowData = RowData> {
8853
+ /**
8854
+ * Instance của bảng ReactTable từ hook TanStack Table v9 (`useDataTable` hoặc `useTable`)
8855
+ */
8856
+ table: ReactTable<DefaultTableFeatures, TData>;
8857
+ /**
8858
+ * Danh sách tùy chọn số dòng hiển thị trên mỗi trang trong dropdown
8859
+ * @default [10, 20, 50, 100]
8860
+ */
8861
+ pageSizeOptions?: number[];
8862
+ /**
8863
+ * Hiển thị dropdown lựa chọn số dòng trên mỗi trang
8864
+ * @default true
8865
+ */
8866
+ showPageSizeSelector?: boolean;
8867
+ /**
8868
+ * Hiển thị ô nhảy nhanh đến trang chỉ định
8869
+ * @default false
8870
+ */
8871
+ showPageJump?: boolean;
8872
+ /**
8873
+ * Class tùy biến cho thanh phân trang
8874
+ */
8875
+ className?: string;
8876
+ }
8877
+ /**
8878
+ * Kiểu hiển thị của bộ lọc trong TableToolbar / DataTable (đồng nhất với SelectFilterType)
8879
+ */
8880
+ type TableFilterType = "string" | "text" | "number" | "date" | "date-range" | "checkbox-group" | "select" | "custom";
8881
+ /**
8882
+ * Tùy chọn dành cho bộ lọc dạng select / checkbox-group
8883
+ */
8884
+ interface TableFilterOption {
8885
+ label: ReactNode;
8886
+ value: string | number | boolean;
8887
+ disabled?: boolean;
8888
+ }
8889
+ /**
8890
+ * Định nghĩa cấu hình bộ lọc cho DataTable / TableToolbar (đồng nhất với SelectFilterField)
8891
+ */
8892
+ interface TableFilterDef<TValue = unknown> {
8893
+ /**
8894
+ * Tên định danh trường lọc (dùng làm key trong object filters, đồng nhất với SelectFilterField)
8895
+ */
8896
+ name: string;
8897
+ /**
8898
+ * Tên hiển thị của bộ lọc trên giao diện (ví dụ: "Trạng thái", "Ngày tạo")
8899
+ */
8900
+ label?: ReactNode;
8901
+ /**
8902
+ * Kiểu hiển thị bộ lọc: 'string' | 'text' | 'number' | 'date' | 'date-range' | 'checkbox-group' | 'select' | 'custom'
8903
+ */
8904
+ type: TableFilterType;
8905
+ /**
8906
+ * Danh sách options dành cho kiểu 'select' hoặc 'checkbox-group'
8907
+ */
8908
+ options?: TableFilterOption[];
8909
+ /**
8910
+ * Placeholder gợi ý trong editor
8911
+ */
8912
+ placeholder?: string;
8913
+ /**
8914
+ * Giá trị mặc định khi khởi tạo
8915
+ */
8916
+ defaultValue?: TValue;
8917
+ /**
8918
+ * Giá trị điều khiển
8919
+ */
8920
+ value?: TValue;
8921
+ /**
8922
+ * Thuộc tính tùy biến truyền bổ sung vào component editor (DateRangePicker, DatePicker, CheckboxGroup...)
8923
+ */
8924
+ props?: Record<string, unknown>;
8925
+ /**
8926
+ * Hàm render component tùy biến khi `type: 'custom'`
8927
+ */
8928
+ render?: (props: {
8929
+ value: TValue;
8930
+ onChange: (val: TValue) => void;
8931
+ }) => ReactNode;
8932
+ }
8933
+ /**
8934
+ * Thuộc tính của thanh công cụ bảng `<TableToolbar />`
8935
+ */
8936
+ interface TableToolbarProps<TData extends RowData = RowData> {
8937
+ /**
8938
+ * Instance của bảng ReactTable từ hook TanStack Table v9
8939
+ */
8940
+ table: ReactTable<DefaultTableFeatures, TData>;
8941
+ /**
8942
+ * Placeholder gợi ý cho ô tìm kiếm toàn bảng
8943
+ * @default 'Tìm kiếm trong bảng...'
8944
+ */
8945
+ searchPlaceholder?: string;
8946
+ /**
8947
+ * Bật ô tìm kiếm toàn bảng (Global Filter)
8948
+ * @default true
8949
+ */
8950
+ enableGlobalFilter?: boolean;
8951
+ /**
8952
+ * Bật menu Popover cho phép người dùng ẩn/hiện từng cột
8953
+ * @default true
8954
+ */
8955
+ enableColumnVisibility?: boolean;
8956
+ /**
8957
+ * Bật nút làm mới dữ liệu trên thanh công cụ (Refresh button)
8958
+ * @default false
8959
+ */
8960
+ isRefresh?: boolean;
8961
+ /**
8962
+ * Callback được gọi khi người dùng click vào nút làm mới trên thanh công cụ
8963
+ */
8964
+ onRefresh?: () => void;
8965
+ /**
8966
+ * Các nút hành động tùy biến hiển thị ở góc phải thanh công cụ (ví dụ: Thêm mới, Bộ lọc nâng cao, Xuất file...)
8967
+ */
8968
+ actions?: ReactNode;
8969
+ /**
8970
+ * Hàm render các nút hành động hàng loạt khi có ít nhất 1 dòng được chọn (Bulk Actions)
8971
+ */
8972
+ selectedActions?: (selectedRows: Row<DefaultTableFeatures, TData>[]) => ReactNode;
8973
+ /**
8974
+ * Danh sách cấu hình các bộ lọc menu hiển thị trên thanh công cụ
8975
+ */
8976
+ filters?: TableFilterDef[];
8977
+ /**
8978
+ * Giá trị hiện tại của các bộ lọc: `{ [name]: value }`
8979
+ */
8980
+ filterValues?: Record<string, unknown>;
8981
+ /**
8982
+ * Callback khi một bộ lọc thay đổi giá trị
8983
+ */
8984
+ onFilterChange?: (name: string, value: unknown) => void;
8985
+ /**
8986
+ * Callback khi người dùng bấm "Đặt lại bộ lọc" (Reset all)
8987
+ */
8988
+ onFilterReset?: () => void;
8989
+ /**
8990
+ * Class tùy biến cho thanh công cụ
8991
+ */
8992
+ className?: string;
8993
+ }
8994
+ /**
8995
+ * Thuộc tính của component bảng hoàn chỉnh `<DataTable />`
8996
+ * Tích hợp sẵn toàn bộ tính năng của TanStack Table v9.
8997
+ */
8998
+ interface DataTableProps<TData extends RowData = RowData> {
7637
8999
  /**
7638
- * Kích thước áp dụng cho padding kích thước các nút bấm
7639
- * @default 'md'
9000
+ * Danh sách định nghĩa các cột dữ liệu (sử dụng helper `createTableColumnHelper` để tạo)
7640
9001
  */
7641
- size?: ConfirmSize;
9002
+ columns: ColumnDef<DefaultTableFeatures, TData, unknown>[] | ReturnType<ColumnHelper<DefaultTableFeatures, TData>["columns"]>;
7642
9003
  /**
7643
- * Nhãn văn bản cho nút Xác nhận
7644
- * @default 'Xác nhận'
9004
+ * Mảng dữ liệu nguồn hiển thị trong bảng
7645
9005
  */
7646
- confirmText?: ReactNode;
9006
+ data: TData[];
7647
9007
  /**
7648
- * Nhãn văn bản cho nút Hủy (truyền `false` để ẩn nút Hủy)
7649
- * @default 'Hủy'
9008
+ * Biến thể giao diện của bảng:
9009
+ * - 'default': Viền ngang mờ thanh lịch
9010
+ * - 'striped': Dòng xen kẽ màu (Zebra stripes)
9011
+ * - 'bordered': Viền lưới đầy đủ bao quanh từng ô
9012
+ * @default 'default'
7650
9013
  */
7651
- cancelText?: ReactNode | false;
9014
+ variant?: TableVariant;
7652
9015
  /**
7653
- * Biến thể của nút Xác nhận ('filled', 'outline', 'soft', ...)
7654
- * @default 'filled'
9016
+ * Kích thước bảng ('sm' nhỏ gọn, 'md' chuẩn, 'lg' thoáng đãng)
9017
+ * @default 'md'
7655
9018
  */
7656
- confirmVariant?: ButtonVariant;
9019
+ size?: TableSize;
7657
9020
  /**
7658
- * Biến thể của nút Hủy ('filled', 'outline', 'soft', ...)
7659
- * @default 'outline'
9021
+ * Trạng thái đang tải dữ liệu (tự động hiển thị các dòng Skeleton animation)
9022
+ * @default false
7660
9023
  */
7661
- cancelVariant?: ButtonVariant;
9024
+ isLoading?: boolean;
7662
9025
  /**
7663
- * Màu nút Xác nhận tùy chỉnh (mặc định lấy theo `color`)
9026
+ * Bật nút làm mới dữ liệu trên thanh công cụ (Refresh button)
9027
+ * @default false
7664
9028
  */
7665
- confirmColor?: ButtonColor;
9029
+ isRefresh?: boolean;
7666
9030
  /**
7667
- * Màu nút Hủy
7668
- * @default 'secondary'
9031
+ * Callback được gọi khi người dùng click vào nút làm mới trên thanh công cụ
7669
9032
  */
7670
- cancelColor?: ButtonColor;
9033
+ onRefresh?: () => void;
7671
9034
  /**
7672
- * Callback khi người dùng bấm nút Xác nhận (trả về void hoặc Promise)
9035
+ * Số dòng Skeleton hiển thị khi đang tải (`isLoading={true}`)
9036
+ * @default 5
7673
9037
  */
7674
- onConfirm?: () => void | Promise<unknown>;
9038
+ loadingRowsCount?: number;
7675
9039
  /**
7676
- * Callback khi người dùng bấm nút Hủy
9040
+ * Văn bản hiển thị khi bảng không dữ liệu
9041
+ * @default 'Không có dữ liệu hiển thị'
7677
9042
  */
7678
- onCancel?: () => void;
9043
+ emptyText?: string;
7679
9044
  /**
7680
- * Callback đóng hộp thoại
9045
+ * Hình ảnh hoặc component minh họa tùy biến khi bảng không có dữ liệu (thay thế Empty mặc định)
7681
9046
  */
7682
- onClose?: () => void;
9047
+ emptyIllustration?: ReactNode;
7683
9048
  /**
7684
- * Props bổ sung truyền trực tiếp cho component Button Xác nhận
9049
+ * Bật tính năng sắp xếp (Sorting) khi click vào tiêu đề cột
9050
+ * @default true
7685
9051
  */
7686
- confirmButtonProps?: Partial<ButtonProps>;
9052
+ enableSorting?: boolean;
7687
9053
  /**
7688
- * Props bổ sung truyền trực tiếp cho component Button Hủy
9054
+ * Bật ô tìm kiếm toàn bảng (Global Filter) trên thanh công cụ
9055
+ * @default true
7689
9056
  */
7690
- cancelButtonProps?: Partial<ButtonProps>;
9057
+ enableFiltering?: boolean;
7691
9058
  /**
7692
- * Class CSS tùy biến cho khối footer
9059
+ * Bật thanh phân trang (Pagination) chân bảng
9060
+ * @default true
7693
9061
  */
7694
- className?: string;
9062
+ enablePagination?: boolean;
7695
9063
  /**
7696
- * Các nút bấm tùy chỉnh bên trong footer (khi dùng Pure Compound Pattern)
9064
+ * Bật tính năng chọn dòng (tự động chèn cột Checkbox chọn dòng và chọn tất cả)
9065
+ * @default false
7697
9066
  */
7698
- children?: ReactNode;
7699
- }
7700
- /**
7701
- * Props cho component `<ConfirmContainer>` (Tầng Wrapper quản lý Overlay Backdrop, Native Dialog, ESC & Animation)
7702
- */
7703
- interface ConfirmContainerProps extends HTMLAttributes<HTMLDialogElement> {
9067
+ enableRowSelection?: boolean;
7704
9068
  /**
7705
- * Trạng thái hiển thị mở/đóng Confirm (Controlled State)
7706
- * @default false
9069
+ * Bật menu Popover cho phép người dùng chủ động ẩn/hiện từng cột
9070
+ * @default true
7707
9071
  */
7708
- open?: boolean;
9072
+ enableColumnVisibility?: boolean;
7709
9073
  /**
7710
- * Callback được kích hoạt khi Confirm đóng (click ra ngoài backdrop, nhấn phím ESC, hoặc click nút đóng X)
9074
+ * Bật tính năng kéo thả thay đổi thứ tự các cột (Column Ordering / Dnd)
9075
+ * @default false
7711
9076
  */
7712
- onClose?: () => void;
9077
+ enableColumnOrdering?: boolean;
7713
9078
  /**
7714
- * Kích thước tổng thể của Confirm (truyền xuống context để đồng bộ kích thước cho Confirm, Header, Body, Footer)
7715
- * @default 'md'
9079
+ * Văn bản gợi ý placeholder cho ô tìm kiếm
9080
+ * @default 'Tìm kiếm trong bảng...'
7716
9081
  */
7717
- size?: ConfirmSize;
9082
+ searchPlaceholder?: string;
7718
9083
  /**
7719
- * Chủ đề màu sắc tổng thể của Confirm (truyền xuống context để đồng bộ cho Confirm, Header, Footer)
7720
- * @default 'warning'
9084
+ * Các nút hành động tùy biến đặt góc phải thanh công cụ (ví dụ: Nút thêm mới, Export...)
7721
9085
  */
7722
- color?: ConfirmColor;
9086
+ toolbarActions?: ReactNode;
7723
9087
  /**
7724
- * Trạng thái đang tải / xử (Loading).
7725
- * Khi `isLoading = true`:
7726
- * - Chặn đóng Confirm khi click vào vùng backdrop overlay (`closeOnOverlayClick`)
7727
- * - Chặn đóng Confirm khi nhấn phím ESC (`closeOnEsc`)
7728
- * - Chặn đóng Confirm từ nút đóng (X) và component `<ConfirmClose>`
7729
- * @default false
9088
+ * Render các nút thao tác hàng loạt khi có dòng được chọn (ví dụ: Xóa, Đổi trạng thái, Xuất dữ liệu...)
7730
9089
  */
7731
- isLoading?: boolean;
9090
+ renderBulkActions?: (selectedRows: Row<DefaultTableFeatures, TData>[]) => ReactNode;
7732
9091
  /**
7733
- * Cho phép tự động đóng Confirm khi người dùng click vào vùng backdrop overlay bên ngoài
7734
- * @default true
9092
+ * Danh sách các tùy chọn số lượng dòng trên mỗi trang
9093
+ * @default [10, 20, 50, 100]
7735
9094
  */
7736
- closeOnOverlayClick?: boolean;
9095
+ pageSizeOptions?: number[];
7737
9096
  /**
7738
- * Cho phép tự động đóng Confirm khi người dùng nhấn phím ESC (Escape) trên bàn phím
7739
- * @default true
9097
+ * Số lượng dòng hiển thị mặc định mỗi trang khi khởi tạo
9098
+ * @default 10
7740
9099
  */
7741
- closeOnEsc?: boolean;
9100
+ initialPageSize?: number;
7742
9101
  /**
7743
- * Tự động khóa cuộn trang (body scroll lock) khi Confirm đang hiển thị
7744
- * @default true
9102
+ * Bật chế độ phân trang thủ công từ server (dữ liệu đã được cắt sẵn theo trang từ API)
9103
+ * @default false
7745
9104
  */
7746
- lockScroll?: boolean;
9105
+ manualPagination?: boolean;
7747
9106
  /**
7748
- * Class tùy biến CSS cho lớp nền backdrop mờ toàn màn hình
9107
+ * Bật chế độ sắp xếp thủ công từ server (truyền tham số sort lên API)
9108
+ * @default false
7749
9109
  */
7750
- overlayClassName?: string;
9110
+ manualSorting?: boolean;
7751
9111
  /**
7752
- * Class tùy biến CSS cho container bao ngoài dialog
9112
+ * Bật chế độ tìm kiếm/lọc thủ công từ server (truyền từ khóa filter lên API)
9113
+ * @default false
7753
9114
  */
7754
- className?: string;
9115
+ manualFiltering?: boolean;
7755
9116
  /**
7756
- * Nội dung bên trong container (thường component `<Confirm>`)
9117
+ * Tổng số trang trả về từ máy chủ (bắt buộc khi dùng `manualPagination={true}`)
7757
9118
  */
7758
- children?: ReactNode;
7759
- }
7760
- /**
7761
- * Props cho component `<ConfirmClose>` (Wrapper tự động kích hoạt đóng Confirm có Exit Animation cho bất kỳ nút bấm nào)
7762
- */
7763
- interface ConfirmCloseProps extends HTMLAttributes<HTMLElement> {
9119
+ pageCount?: number;
7764
9120
  /**
7765
- * Component con cần bọc để kích hoạt sự kiện đóng (thường là `<Button>`)
9121
+ * Tổng số lượng bản ghi thực tế từ máy chủ
7766
9122
  */
7767
- children?: ReactNode;
9123
+ rowCount?: number;
7768
9124
  /**
7769
- * Tự động truyền thẳng sự kiện onClick props vào phần tử con (cloneElement) thay vì bọc ngoài bằng thẻ div
7770
- * @default true
9125
+ * Trạng thái phân trang điều khiển ngoài: `{ pageIndex, pageSize }`
7771
9126
  */
7772
- asChild?: boolean;
7773
- }
7774
-
7775
- /**
7776
- * Khung giao diện hộp thoại xác nhận (Confirm Dialog Box).
7777
- * Thiết kế theo mô hình Pure Compound Pattern giống Modal:
7778
- * Nhận size/color từ ConfirmContainer qua Context và render {children}.
7779
- */
7780
- declare function Confirm({ size, radius, className, children, ref, ...props }: ConfirmProps): react_jsx_runtime.JSX.Element;
7781
-
7782
- declare function ConfirmContainer({ open, size, color, isLoading, closeOnOverlayClick, closeOnEsc, lockScroll, overlayClassName, className, children, onClose, ...props }: ConfirmContainerProps): react_jsx_runtime.JSX.Element | null;
7783
-
7784
- /**
7785
- * Phần đầu của hộp thoại Confirm (Hiển thị icon badge, tiêu đề và nút đóng X)
7786
- */
7787
- declare function ConfirmHeader({ size, color, icon, title, iconClassName, titleClassName, showCloseButton, onClose, closeButtonClassName, className, children, ...props }: ConfirmHeaderProps): react_jsx_runtime.JSX.Element;
7788
-
7789
- /**
7790
- * Phần thân của hộp thoại Confirm (Hiển thị nội dung mô tả hoặc nội dung tùy biến)
7791
- */
7792
- declare function ConfirmBody({ size, description, descriptionClassName, className, children, ...props }: ConfirmBodyProps): react_jsx_runtime.JSX.Element;
7793
-
7794
- /**
7795
- * Phần chân của hộp thoại Confirm (Chứa các nút hành động Xác nhận, Hủy, hoặc các nút tùy chỉnh)
7796
- */
7797
- declare function ConfirmFooter({ size, confirmText, cancelText, confirmVariant, cancelVariant, confirmColor, cancelColor, onConfirm, onCancel, onClose, confirmButtonProps, cancelButtonProps, className, children, ...props }: ConfirmFooterProps): react_jsx_runtime.JSX.Element;
7798
-
7799
- /**
7800
- * Component wrapper kích hoạt đóng Confirm kèm hiệu ứng thoát (Exit Animation)
7801
- * Tự động vô hiệu hóa (`disabled`) khi `isLoading = true`.
7802
- */
7803
- declare function ConfirmClose({ children, asChild, onClick, ...props }: ConfirmCloseProps): react_jsx_runtime.JSX.Element;
7804
-
7805
- /**
7806
- * Giá trị được chia sẻ từ `<ConfirmContainer>` và `<Confirm>` xuống các sub-component con thông qua Context
7807
- */
7808
- interface ConfirmContextValue {
9127
+ pagination?: PaginationState;
7809
9128
  /**
7810
- * Callback kích hoạt đóng Confirm kèm hiệu ứng thoát (Exit Animation)
9129
+ * Callback khi trạng thái phân trang thay đổi
7811
9130
  */
7812
- onClose: () => void;
9131
+ onPaginationChange?: ((pagination: PaginationState) => void) | OnChangeFn<PaginationState>;
7813
9132
  /**
7814
- * Trạng thái đang tải / xử (Loading).
7815
- * Khi `true`, sẽ chặn đóng hộp thoại và tự động vô hiệu hóa các nút đóng / hủy.
9133
+ * Trạng thái sắp xếp điều khiển ngoài: `Array<{ id, desc }>`
7816
9134
  */
7817
- isLoading?: boolean;
9135
+ sorting?: SortingState;
7818
9136
  /**
7819
- * Kích thước chiều rộng của Confirm
9137
+ * Callback khi trạng thái sắp xếp thay đổi
7820
9138
  */
7821
- size?: ConfirmSize;
9139
+ onSortingChange?: ((sorting: SortingState) => void) | OnChangeFn<SortingState>;
7822
9140
  /**
7823
- * Chủ đề màu sắc của Confirm
9141
+ * Trạng thái dòng được chọn điều khiển ngoài: `Record<rowId, boolean>`
7824
9142
  */
7825
- color?: ConfirmColor;
7826
- }
7827
- /**
7828
- * Hook truy xuất context của Confirm từ bên trong `<ConfirmContainer>` hoặc `<Confirm>`
7829
- */
7830
- declare const useConfirmContext: () => ConfirmContextValue | null;
7831
-
7832
- declare function Modal({ size, radius, className, children, ref, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
7833
-
7834
- declare function ModalContainer({ open, id, size, isLoading, closeOnOverlayClick, closeOnEsc, lockScroll, overlayClassName, className, children, onClose, ...props }: ModalContainerProps): react_jsx_runtime.JSX.Element | null;
7835
-
7836
- declare function ModalHeader({ size, title, description, titleClassName, descriptionClassName, showCloseButton, onClose, closeButtonClassName, className, children, ...props }: ModalHeaderProps): react_jsx_runtime.JSX.Element;
7837
-
7838
- declare function ModalBody({ size, className, children, ...props }: ModalBodyProps): react_jsx_runtime.JSX.Element;
7839
-
7840
- declare function ModalFooter({ size, className, children, ...props }: ModalFooterProps): react_jsx_runtime.JSX.Element;
7841
-
7842
- declare function ModalClose({ children, asChild, onClick, ...props }: ModalCloseProps): react_jsx_runtime.JSX.Element;
7843
-
7844
- interface ModalContextValue {
7845
- onClose: () => void;
7846
- isLoading?: boolean;
7847
- size?: ModalSize;
7848
- }
7849
- declare const useModalContext: () => ModalContextValue | null;
7850
-
7851
- /**
7852
- * Component `<FilePreview>`: Nhận file và headerTitle qua useFileContext(),
7853
- * tự động xác định loại file và chọn component hiển thị tương ứng.
7854
- */
7855
- declare function FilePreview({ onDownload, imageProps, className, }: FilePreviewProps): react_jsx_runtime.JSX.Element;
7856
-
7857
- /**
7858
- * Component `<FileContainer>`: Hộp thoại bọc Modal Dialog quản lý Backdrop, Top Layer, ESC và Lock Scroll
7859
- * Nhận prop `file` và truyền xuống `<FilePreview />` qua `FileContext`.
7860
- */
7861
- declare function FileContainer({ open, onClose, file, title, description, size, radius, showCloseButton, closeOnOverlayClick, closeOnEsc, lockScroll, className, overlayClassName, children, }: FileContainerProps): react_jsx_runtime.JSX.Element;
7862
-
7863
- interface FileContextValue {
7864
- file?: PreviewFile;
7865
- headerTitle?: ReactNode;
7866
- }
7867
- declare const useFileContext: () => FileContextValue | null;
7868
-
7869
- declare const IMAGE_EXTENSIONS: string[];
7870
- declare const PDF_EXTENSIONS: string[];
7871
- declare const VIDEO_EXTENSIONS: string[];
7872
- declare const AUDIO_EXTENSIONS: string[];
7873
- declare const DOCUMENT_EXTENSIONS: string[];
7874
-
7875
- declare function getFileName(filenameOrSrc?: string): string;
7876
- declare function getFileExtension(filenameOrSrc?: string): string;
7877
- declare function getFileType(filenameOrSrc?: string): FileType;
7878
- declare function normalizePreviewFile(input?: PreviewFile): {
7879
- file: File | undefined;
7880
- serverFile: ServerFile | undefined;
7881
- name: string;
7882
- type: FileType;
7883
- };
7884
- declare function downloadFile(src: string, filename?: string): void;
7885
-
7886
- declare function ImagePreview({ src, name, minZoom, maxZoom, showToolbar, toolbarProps, children, }: ImagePreviewProps): react_jsx_runtime.JSX.Element | null;
7887
-
7888
- declare function ImagePreviewToolbar({ zoom, onZoomIn, onZoomOut, onRotateCw, onRotateCcw, onFlipHorizontal, onReset, currentImage, tools, className, }: ImagePreviewToolbarProps): react_jsx_runtime.JSX.Element;
7889
-
7890
- type SkeletonVariant = "pulse" | "wave" | "none";
7891
- type SkeletonRadius = "none" | "sm" | "md" | "lg" | "xl" | "full";
7892
- type SkeletonShape = "rectangle" | "circle";
7893
- interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
9143
+ rowSelection?: RowSelectionState;
7894
9144
  /**
7895
- * Kiểu animation hiển thị:
7896
- * - 'pulse': nhịp thở opacity (mặc định)
7897
- * - 'wave': shimmer chạy từ góc trên-trái xuống góc dưới-phải
7898
- * - 'none': không animation (static placeholder)
7899
- * @default 'pulse'
9145
+ * Callback khi danh sách dòng được chọn thay đổi
7900
9146
  */
7901
- variant?: SkeletonVariant;
9147
+ onRowSelectionChange?: ((selection: RowSelectionState) => void) | OnChangeFn<RowSelectionState>;
7902
9148
  /**
7903
- * Hình dạng của skeleton:
7904
- * - 'rectangle': hình chữ nhật, kết hợp với `radius` để bo góc (mặc định)
7905
- * - 'circle': hình tròn hoàn toàn, `width` === `height`, bỏ qua `radius`
7906
- * @default 'rectangle'
9149
+ * Trạng thái hiển thị cột điều khiển ngoài: `Record<columnId, boolean>`
7907
9150
  */
7908
- shape?: SkeletonShape;
9151
+ columnVisibility?: ColumnVisibilityState;
7909
9152
  /**
7910
- * Độ bo góc, chỉ áp dụng khi `shape === 'rectangle'`
7911
- * @default 'md'
9153
+ * Callback khi trạng thái hiển thị cột thay đổi
7912
9154
  */
7913
- radius?: SkeletonRadius;
9155
+ onColumnVisibilityChange?: ((visibility: ColumnVisibilityState) => void) | OnChangeFn<ColumnVisibilityState>;
7914
9156
  /**
7915
- * Chiều rộng (CSS string hoặc số px)
7916
- * @example "100%", "200px", 200
9157
+ * Trạng thái thứ tự các cột điều khiển ngoài (mảng danh sách ID cột)
7917
9158
  */
7918
- width?: string | number;
9159
+ columnOrder?: string[];
7919
9160
  /**
7920
- * Chiều cao (CSS string hoặc số px)
7921
- * @example "1rem", "40px", 40
7922
- * @default "1rem"
9161
+ * Callback khi thứ tự cột thay đổi
7923
9162
  */
7924
- height?: string | number;
9163
+ onColumnOrderChange?: ((order: string[]) => void) | OnChangeFn<string[]>;
7925
9164
  /**
7926
- * Số lượng dòng skeleton xếp theo cột.
7927
- * Khi > 1, dòng cuối cùng sẽ tự động thu hẹp còn 60% width để mô phỏng đoạn văn tự nhiên.
7928
- * @default 1
9165
+ * Từ khóa tìm kiếm toàn bảng điều khiển ngoài
7929
9166
  */
7930
- lines?: number;
9167
+ globalFilter?: string;
7931
9168
  /**
7932
- * Khoảng cách giữa các dòng khi `lines > 1` (CSS string hoặc số px)
7933
- * @default "0.5rem"
9169
+ * Callback khi từ khóa tìm kiếm toàn bảng thay đổi
7934
9170
  */
7935
- gap?: string | number;
7936
- }
7937
- interface LoadingImageProps extends Omit<ImageProps, "onLoad" | "onError"> {
9171
+ onGlobalFilterChange?: (filter: string) => void;
7938
9172
  /**
7939
- * Kiểu animation của skeleton khi đang tải ảnh.
7940
- * @default 'pulse'
9173
+ * Hàm hoặc tên bộ lọc toàn bảng tùy biến (FilterFn hoặc 'fuzzy').
9174
+ * Mặc định DataTable sử dụng `fuzzyFilter` (Fuzzy Search từ @tanstack/match-sorter-utils).
7941
9175
  */
7942
- skeletonVariant?: SkeletonVariant;
9176
+ globalFilterFn?: FilterFnOption<DefaultTableFeatures, TData>;
7943
9177
  /**
7944
- * Độ bo góc áp dụng đồng thời cho skeleton placeholder ảnh.
7945
- * @default 'md'
9178
+ * Danh sách cấu hình các bộ lọc menu hiển thị dạng SelectMenuFilter trên thanh công cụ
7946
9179
  */
7947
- radius?: SkeletonRadius;
9180
+ filters?: TableFilterDef[];
7948
9181
  /**
7949
- * Class CSS tuỳ thêm cho wrapper bên ngoài.
9182
+ * Trạng thái bộ lọc cột điều khiển ngoài (ColumnFiltersState của TanStack Table)
7950
9183
  */
7951
- wrapperClassName?: string;
9184
+ columnFilters?: ColumnFiltersState;
7952
9185
  /**
7953
- * Inline style tuỳ thêm cho wrapper bên ngoài.
9186
+ * Callback khi trạng thái bộ lọc cột thay đổi (trả về mảng ColumnFiltersState của TanStack Table)
7954
9187
  */
7955
- wrapperStyle?: react__default.CSSProperties;
9188
+ onColumnFiltersChange?: ((filters: ColumnFiltersState) => void) | OnChangeFn<ColumnFiltersState>;
7956
9189
  /**
7957
- * Callback được gọi khi ảnh tải thành công.
9190
+ * Callback được kích hoạt khi người dùng click vào một dòng trong bảng
7958
9191
  */
7959
- onLoad?: ImageProps["onLoad"];
9192
+ onRowClick?: (row: Row<DefaultTableFeatures, TData>) => void;
7960
9193
  /**
7961
- * Callback được gọi khi ảnh gặp lỗi tải.
9194
+ * Class tùy biến cho phần tử bọc ngoài toàn bộ component (gồm toolbar + table + pagination)
7962
9195
  */
7963
- onError?: ImageProps["onError"];
7964
- }
9196
+ className?: string;
9197
+ /**
9198
+ * Class tùy biến cho khung container bao quanh trực tiếp thẻ table
9199
+ */
9200
+ containerClassName?: string;
9201
+ }
9202
+
9203
+ declare const tableVariantConfig: Record<TableVariant, {
9204
+ container: string;
9205
+ table: string;
9206
+ head: string;
9207
+ row: string;
9208
+ cell: string;
9209
+ }>;
9210
+ declare const DEFAULT_PAGE_SIZE_OPTIONS: number[];
9211
+ declare const DEFAULT_PAGE_SIZE = 10;
9212
+
9213
+ interface TableContextValue {
9214
+ size: TableSize;
9215
+ variantStyles: (typeof tableVariantConfig)[TableVariant];
9216
+ }
9217
+ declare const useTableStyles: () => TableContextValue;
9218
+ declare function Table({ variant, size, className, containerClassName, wrapperProps, children, ref, ...props }: TableProps): react_jsx_runtime.JSX.Element;
9219
+ declare function TableHeader({ className, children, ref, ...props }: TableHeaderProps): react_jsx_runtime.JSX.Element;
9220
+ declare function TableBody({ className, children, ref, ...props }: TableBodyProps): react_jsx_runtime.JSX.Element;
9221
+ declare function TableFooter({ className, children, ref, ...props }: TableFooterProps): react_jsx_runtime.JSX.Element;
9222
+ declare function TableRow({ isSelected, isHoverable, className, children, ref, ...props }: TableRowProps): react_jsx_runtime.JSX.Element;
9223
+ declare function TableHead({ align, className, children, ref, ...props }: TableHeadProps & {
9224
+ ref?: Ref<HTMLTableCellElement>;
9225
+ }): react_jsx_runtime.JSX.Element;
9226
+ declare function TableCell({ align, className, children, ref, ...props }: TableCellProps): react_jsx_runtime.JSX.Element;
9227
+ declare function TableCaption({ className, children, ref, ...props }: TableCaptionProps): react_jsx_runtime.JSX.Element;
9228
+
9229
+ declare function TableColumnHeader<TData extends RowData = RowData, TValue = unknown>({ column, title, className, ...props }: TableColumnHeaderProps<TData, TValue>): react_jsx_runtime.JSX.Element;
9230
+
9231
+ declare function TablePagination<TData extends RowData = RowData>({ table, pageSizeOptions, showPageSizeSelector, className, }: TablePaginationProps<TData>): react_jsx_runtime.JSX.Element;
7965
9232
 
7966
- declare function Skeleton({ variant, shape, radius, width, height, lines, gap, className, style, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
9233
+ declare function TableToolbar<TData extends RowData = RowData>({ table, searchPlaceholder, enableGlobalFilter, enableColumnVisibility, isRefresh, onRefresh, actions, selectedActions, filters, filterValues, onFilterChange, onFilterReset, className, }: TableToolbarProps<TData>): react_jsx_runtime.JSX.Element;
7967
9234
 
7968
- declare function LoadingImage({ src, alt, width, height, fill, skeletonVariant, radius, className, wrapperClassName, style, wrapperStyle, onLoad, onError, ...imageProps }: LoadingImageProps): react_jsx_runtime.JSX.Element;
9235
+ declare function DataTable<TData extends RowData = RowData>({ columns, data, variant, size, isLoading, isRefresh, onRefresh, loadingRowsCount, emptyText, emptyIllustration, enableSorting, enableFiltering, enablePagination, enableRowSelection, enableColumnVisibility, enableColumnOrdering, filters, searchPlaceholder, toolbarActions, renderBulkActions, pageSizeOptions, initialPageSize, manualPagination, manualSorting, manualFiltering, pageCount, rowCount, pagination: controlledPagination, onPaginationChange, sorting: controlledSorting, onSortingChange, rowSelection: controlledRowSelection, onRowSelectionChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, columnOrder: controlledColumnOrder, onColumnOrderChange, globalFilter: controlledGlobalFilter, onGlobalFilterChange, globalFilterFn: controlledGlobalFilterFn, columnFilters: controlledColumnFilters, onColumnFiltersChange, onRowClick, className, containerClassName, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
7969
9236
 
7970
- export { AUDIO_EXTENSIONS, Alert, AlertCircleIcon, type AlertColor, type AlertProps, type AlertRadius, type AlertSize, AlertTriangleIcon, type AlertVariant, Badge, type BadgeColor, type BadgeProps, type BadgeRadius, type BadgeSize, type BadgeVariant, type BaseSelectProps, Button, type ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Calendar, type CalendarDay, CalendarHeader, type CalendarHeaderProps, CalendarIcon, type CalendarProps, type CalendarView, Carousel, type CarouselArrowPosition, CarouselContent, type CarouselContentProps, type CarouselContextValue, type CarouselNavigationProps, type CarouselNavigationVariant, CarouselNext, CarouselPagination, type CarouselPaginationProps, type CarouselPaginationType, CarouselPrevious, type CarouselProps, type CarouselRadius, type CarouselSize, CarouselSlide, type CarouselSlideProps, CheckCircleIcon, CheckIcon, Checkbox, type CheckboxColor, CheckboxGroup, CheckboxGroupContext, type CheckboxGroupOrientation, type CheckboxGroupProps, type CheckboxLabelPlacement, type CheckboxProps, type CheckboxRadius, type CheckboxSize, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ClockIcon, CloseIcon, Collapse, type CollapseActiveKey, type CollapseColor, CollapseContent, type CollapseContentProps, type CollapseContextValue$1 as CollapseContextValue, type CollapseExpandIconPosition, CollapseHeader, type CollapseHeaderProps, CollapsePanel, type CollapsePanelContextValue$1 as CollapsePanelContextValue, type CollapsePanelProps, type CollapseProps, type CollapseRadius, type CollapseSize, type CollapseVariant, Collapsible, type CollapsibleProps, Confirm, ConfirmBody, type ConfirmBodyProps, ConfirmClose, type ConfirmCloseProps, type ConfirmColor, ConfirmContainer, type ConfirmContainerProps, ConfirmFooter, type ConfirmFooterProps, ConfirmHeader, type ConfirmHeaderProps, type ConfirmProps, type ConfirmRadius, type ConfirmSize, CropIcon, DEFAULT_TOAST_DURATION, DOCUMENT_EXTENSIONS, DatePicker, type DatePickerColor, type DatePickerConfig, type DatePickerProps, type DatePickerRadius, type DatePickerSize, type DatePickerVariant, type DateRange, DateRangeCalendar, type DateRangeCalendarDay, type DateRangeCalendarProps, DateRangeDayGrid, type DateRangeDayGridProps, DateRangeHeader, type DateRangeHeaderProps, DateRangeMonthGrid, type DateRangeMonthGridProps, DateRangePicker, type DateRangePickerColor, type DateRangePickerConfig, type DateRangePickerProps, type DateRangePickerRadius, type DateRangePickerSize, type DateRangePickerVariant, type DateRangeValue, DateRangeYearGrid, type DateRangeYearGridProps, DateTimePicker, type DateTimePickerColor, type DateTimePickerConfig, type DateTimePickerLayout, type DateTimePickerProps, type DateTimePickerRadius, type DateTimePickerSize, type DateTimePickerVariant, type DateTimeRange, DateTimeRangePicker, type DateTimeRangePickerColor, type DateTimeRangePickerConfig, type DateTimeRangePickerLayout, type DateTimeRangePickerProps, type DateTimeRangePickerRadius, type DateTimeRangePickerSize, type DateTimeRangePickerVariant, type DateTimeRangeValue, type DateTimeValue, type DateValue, DayGrid, type DayGridProps, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadIcon, Dropdown, type DropdownColor, type DropdownContextValue, DropdownGroup, type DropdownGroupProps, DropdownHeader, type DropdownHeaderProps, DropdownItem, type DropdownItemProps, DropdownMenu, type DropdownMenuProps, type DropdownPlacement, type DropdownProps, type DropdownRadius, DropdownSeparator, type DropdownSeparatorProps, type DropdownSize, DropdownTrigger, type DropdownTriggerProps, type DropdownTriggerType, Empty, EmptyDefaultIcon, EmptyErrorIcon, EmptyFolderIcon, EmptyIllustration, type EmptyLayout, type EmptyPresetImage, type EmptyProps, EmptySearchIcon, EmptySimpleIcon, type EmptySize, EyeIcon, FileContainer, type FileContainerProps, FilePreview, type FilePreviewProps, type FileType, FlipHorizontalIcon, IMAGE_EXTENSIONS, IconButton, type IconButtonProps, ImageIcon, type ImageItem, ImagePreview, type ImagePreviewProps, ImagePreviewToolbar, type ImagePreviewToolbarProps, InfoCircleIcon, Input, type InputColor, type InputConfig, type InputProps, type InputRadius, type InputSize, type InputVariant, type LabelPlacement, LoadingImage, type LoadingImageProps, type LocaleConfig, MinusIcon, Modal, ModalBody, type ModalBodyProps, ModalClose, type ModalCloseProps, ModalContainer, type ModalContainerProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, type ModalRadius, type ModalSize, MonthGrid, type MonthGridProps, MultiInput, type MultiInputConfig, type MultiInputProps, type MultiSelectProps, NumberInput, type NumberInputProps, OtpInput, type OtpInputConfig, type OtpInputProps, type OtpInputRef, type OtpInputType, PDF_EXTENSIONS, PasswordInput, type PasswordInputProps, PlusIcon, Popover, PopoverBody, type PopoverBodyProps, PopoverClose, type PopoverCloseProps, type PopoverColor, PopoverContent, type PopoverContentProps, type PopoverContextValue, PopoverFooter, type PopoverFooterProps, PopoverHeader, type PopoverHeaderProps, type PopoverPlacement, type PopoverProps, type PopoverRadius, type PopoverSize, PopoverTrigger, type PopoverTriggerProps, type PopoverTriggerType, type PreviewFile, Radio, type RadioColor, RadioDotIcon, RadioGroup, RadioGroupContext, type RadioGroupOrientation, type RadioGroupProps, type RadioLabelPlacement, type RadioProps, type RadioSize, type RadioVariant, ResetIcon, RotateCcwIcon, RotateCwIcon, SearchIcon, Select, type SelectColor, Select as SelectComponent, type SelectFilterField, type SelectFilterLayout, type SelectFilterType, SelectMenu, SelectMenuFilter, SelectOption, type SelectOptionItem, type SelectProps, type SelectRadius, type SelectSearchMode, type SelectSearchPlacement, type SelectSize, SelectTrigger, type SelectVariant, type ServerFile, type SingleSelectProps, Skeleton, type SkeletonProps, type SkeletonRadius, type SkeletonShape, type SkeletonVariant, Slider, type SliderColor, type SliderConfig, type SliderLabelPlacement, type SliderMark, SliderMarks, type SliderOrientation, type SliderProps, type SliderRadius, type SliderSize, SliderStepDots, SliderThumb, type SliderTooltipMode, type SliderTooltipPlacement, type SliderValue, type SliderVariant, Spinner, Tab, type TabColor, TabList, type TabListProps, type TabOrientation, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabPlacement, type TabProps, type TabRadius, type TabSize, type TabVariant, Tabs, TabsContext, type TabsProps, type TagRenderProps, TextArea, type TextAreaColor, type TextAreaConfig, type TextAreaLabelPlacement, type TextAreaProps, type TextAreaRadius, type TextAreaResize, type TextAreaSize, type TextAreaVariant, TimeColumn, type TimeColumnItem, type TimeColumnProps, type TimeObject, type TimePeriod, TimePicker, type TimePickerColor, type TimePickerConfig, type TimePickerProps, type TimePickerRadius, type TimePickerSize, type TimePickerVariant, type TimeRange, TimeRangePicker, type TimeRangePickerColor, type TimeRangePickerConfig, type TimeRangePickerProps, type TimeRangePickerRadius, type TimeRangePickerSize, type TimeRangePickerVariant, type TimeRangeValue, type TimeValue, TimeView, type TimeViewProps, type ToastMessageObject, type ToastMessageResult, type ToastOptions, type ToastPosition, type ToastPromiseFunction, type ToastPromiseOptions, Toaster, type ToasterProps, Toggle, type ToggleColor, type ToggleConfig, type ToggleLabelPlacement, type ToggleProps, type ToggleRadius, type ToggleSize, type ToggleVariant, type ToolbarToolsConfig, Tooltip, type TooltipColor, type TooltipPlacement, type TooltipProps, type TooltipRadius, type TooltipSize, type TooltipVariant, TrashIcon, UploadAvatar, type UploadAvatarColor, UploadAvatarCropContent, UploadAvatarCropModal, type UploadAvatarCropOptions, type UploadAvatarLabelPlacement, type UploadAvatarProps, type UploadAvatarRadius, type UploadAvatarShape, type UploadAvatarSize, type UploadAvatarVariant, type UploadFileItem, UploadIcon, UploadImage, type UploadImageColor, UploadImageDropzone, UploadImageList, type UploadImageProps, type UploadImageRadius, type UploadImageShape, type UploadImageSize, type UploadImageVariant, type UploadImageViewMode, VIDEO_EXTENSIONS, YearGrid, type YearGridProps, ZoomInIcon, ZoomOutIcon, checkIsDisabled, clamp, combineDateTime, createDateWithTime, createFileItem, downloadFile, formatBytes, formatDate, formatDateTime, formatNumberString, formatTime, generateCalendarGrid, generateRangeCalendarGrid, getDefaultDateTimeFormat, getDefaultFormat, getFileExtension, getFileName, getFileType, getISOWeekNumber, getPercentage, isDateAfter, isDateBefore, isSameDay, isSameMonth, isSameTime, isTimeAfter, isTimeBefore, isTimeInRange, isValidOtpChar, normalizePreviewFile, padZero, parseDate, parseDateTime, parseNumber, parseRawNumberString, parseTimeToDate, resolveLocale, revokeFileItem, sanitizeOtpString, splitTagsFromText, toDate, toDateTime, toTimeObject, toast, useCarousel, useCarouselContext, useCheckboxGroupContext, useCollapseContext, useCollapsePanelContext, useConfirmContext, useDebounce, useDebouncedCallback, useDropdownContext, useFileContext, useModalContext, usePopoverContext, useRadioGroupContext, useTabsContext, validateFile };
9237
+ export { AUDIO_EXTENSIONS, Alert, AlertCircleIcon, AlertProps, AlertTriangleIcon, ArrowDownIcon, ArrowUpDownIcon, ArrowUpIcon, AvatarIcon, type AvatarIconProps, Badge, type BadgeColor, type BadgeProps, type BadgeRadius, type BadgeSize, type BadgeVariant, Button, type ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Calendar, type CalendarDay, CalendarHeader, type CalendarHeaderProps, CalendarIcon, type CalendarProps, type CalendarView, Carousel, type CarouselArrowPosition, CarouselContent, type CarouselContentProps, type CarouselContextValue, type CarouselNavigationProps, type CarouselNavigationVariant, CarouselNext, CarouselPagination, type CarouselPaginationProps, type CarouselPaginationType, CarouselPrevious, type CarouselProps, type CarouselRadius, type CarouselSize, CarouselSlide, type CarouselSlideProps, CheckCircleIcon, CheckIcon, Checkbox, type CheckboxColor, type CheckboxConfig, CheckboxGroup, type CheckboxGroupConfig, type CheckboxGroupOrientation, type CheckboxGroupProps, type CheckboxLabelPlacement, type CheckboxOptionItem, type CheckboxProps, type CheckboxRadius, type CheckboxSearchMode, type CheckboxSize, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ClockIcon, CloseIcon, Collapse, type CollapseActiveKey, type CollapseColor, CollapseContent, type CollapseContentProps, type CollapseContextValue$1 as CollapseContextValue, type CollapseExpandIconPosition, CollapseHeader, type CollapseHeaderProps, CollapsePanel, type CollapsePanelContextValue$1 as CollapsePanelContextValue, type CollapsePanelProps, type CollapseProps, type CollapseRadius, type CollapseSize, type CollapseVariant, Collapsible, type CollapsibleProps, type ColumnOrderState, Confirm, ConfirmBody, type ConfirmBodyProps, ConfirmClose, type ConfirmCloseProps, type ConfirmColor, ConfirmContainer, type ConfirmContainerProps, ConfirmFooter, type ConfirmFooterProps, ConfirmHeader, type ConfirmHeaderProps, type ConfirmProps, type ConfirmRadius, type ConfirmSize, CropIcon, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_TOAST_DURATION, DOCUMENT_EXTENSIONS, DataTable, type DataTableProps, DatePicker, type DatePickerColor, type DatePickerConfig, type DatePickerProps, type DatePickerRadius, type DatePickerSize, type DatePickerVariant, type DateRange, DateRangeCalendar, type DateRangeCalendarDay, type DateRangeCalendarProps, DateRangeDayGrid, type DateRangeDayGridProps, DateRangeHeader, type DateRangeHeaderProps, DateRangeMonthGrid, type DateRangeMonthGridProps, DateRangePicker, type DateRangePickerColor, type DateRangePickerConfig, type DateRangePickerProps, type DateRangePickerRadius, type DateRangePickerSize, type DateRangePickerVariant, type DateRangeValue, DateRangeYearGrid, type DateRangeYearGridProps, DateTimePicker, type DateTimePickerColor, type DateTimePickerConfig, type DateTimePickerLayout, type DateTimePickerProps, type DateTimePickerRadius, type DateTimePickerSize, type DateTimePickerVariant, type DateTimeRange, DateTimeRangePicker, type DateTimeRangePickerColor, type DateTimeRangePickerConfig, type DateTimeRangePickerLayout, type DateTimeRangePickerProps, type DateTimeRangePickerRadius, type DateTimeRangePickerSize, type DateTimeRangePickerVariant, type DateTimeRangeValue, type DateTimeValue, type DateValue, DayGrid, type DayGridProps, type DefaultTableFeatures, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadIcon, type DraggableTableHeadProps, Dropdown, type DropdownColor, type DropdownContextValue, DropdownGroup, type DropdownGroupProps, DropdownHeader, type DropdownHeaderProps, DropdownItem, type DropdownItemProps, DropdownMenu, type DropdownMenuProps, type DropdownPlacement, type DropdownProps, type DropdownRadius, DropdownSeparator, type DropdownSeparatorProps, type DropdownSize, DropdownTrigger, type DropdownTriggerProps, type DropdownTriggerType, Empty, EmptyDefaultIcon, EmptyErrorIcon, EmptyFolderIcon, EmptyIllustration, EmptyPresetImage, EmptyProps, EmptySearchIcon, EmptySimpleIcon, EyeIcon, type FileCategory, FileContainer, type FileContainerProps, FileIcon, type FileIconProps, FilePreview, type FilePreviewProps, type FileType, FlipHorizontalIcon, IMAGE_EXTENSIONS, IconButton, type IconButtonProps, ImageIcon, type ImageItem, ImagePreview, type ImagePreviewProps, ImagePreviewToolbar, type ImagePreviewToolbarProps, InfoCircleIcon, Input, type InputColor, type InputConfig, type InputProps, type InputRadius, type InputSize, type InputVariant, type LabelPlacement, LoadingImage, type LoadingImageProps, type LocaleConfig, MinusIcon, Modal, ModalBody, type ModalBodyProps, ModalClose, type ModalCloseProps, ModalContainer, type ModalContainerProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, type ModalRadius, type ModalSize, MonthGrid, type MonthGridProps, MultiInput, type MultiInputConfig, type MultiInputProps, MultiSelect, MultiSelectProps, MultiSelectTrigger, NumberInput, type NumberInputProps, OtpInput, type OtpInputConfig, type OtpInputProps, type OtpInputRef, type OtpInputType, PDF_EXTENSIONS, PasswordInput, type PasswordInputProps, PlusIcon, Popover, PopoverBody, type PopoverBodyProps, PopoverClose, type PopoverCloseProps, type PopoverColor, PopoverContent, type PopoverContentProps, type PopoverContextValue, PopoverFooter, type PopoverFooterProps, PopoverHeader, type PopoverHeaderProps, type PopoverPlacement, type PopoverProps, type PopoverRadius, type PopoverSize, PopoverTrigger, type PopoverTriggerProps, type PopoverTriggerType, type PreviewFile, Radio, type RadioColor, type RadioConfig, RadioDotIcon, RadioGroup, type RadioGroupConfig, type RadioGroupOrientation, type RadioGroupProps, type RadioLabelPlacement, type RadioOptionItem, type RadioProps, type RadioSearchMode, type RadioSize, type RadioVariant, ResetIcon, RotateCcwIcon, RotateCwIcon, SearchIcon, Select, SelectColor, Select as SelectComponent, SelectFilterField, SelectFilterLayout, SelectMenu, SelectMenuFilter, SelectOption, SelectOptionItem, SelectProps, SelectRadius, SelectSearchPlacement, SelectSize, SingleSelectTrigger as SelectTrigger, SelectVariant, type ServerFile, SingleSelectTrigger, Skeleton, type SkeletonObjectFit, type SkeletonProps, type SkeletonRadius, type SkeletonShape, type SkeletonVariant, Slider, type SliderColor, type SliderConfig, type SliderLabelPlacement, type SliderMark, SliderMarks, type SliderOrientation, type SliderProps, type SliderRadius, type SliderSize, SliderStepDots, SliderThumb, type SliderTooltipMode, type SliderTooltipPlacement, type SliderValue, type SliderVariant, SlidersHorizontalIcon, Spinner, Tab, type TabColor, TabList, type TabListProps, type TabOrientation, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabPlacement, type TabProps, type TabRadius, type TabSize, type TabVariant, Table, type TableAlign, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableColumnHeader, type TableColumnHeaderProps, type TableFilterDef, type TableFilterOption, type TableFilterType, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TablePagination, type TablePaginationProps, type TableProps, TableRow, type TableRowProps, type TableSize, TableToolbar, type TableToolbarProps, type TableVariant, Tabs, type TabsProps, type TagRenderProps, TextArea, type TextAreaColor, type TextAreaConfig, type TextAreaLabelPlacement, type TextAreaProps, type TextAreaRadius, type TextAreaResize, type TextAreaSize, type TextAreaVariant, TimeColumn, type TimeColumnItem, type TimeColumnProps, type TimeObject, type TimePeriod, TimePicker, type TimePickerColor, type TimePickerConfig, type TimePickerProps, type TimePickerRadius, type TimePickerSize, type TimePickerVariant, type TimeRange, TimeRangePicker, type TimeRangePickerColor, type TimeRangePickerConfig, type TimeRangePickerProps, type TimeRangePickerRadius, type TimeRangePickerSize, type TimeRangePickerVariant, type TimeRangeValue, type TimeValue, TimeView, type TimeViewProps, ToastOptions, ToastPromiseOptions, Toaster, ToasterProps, Toggle, type ToggleColor, type ToggleConfig, type ToggleLabelPlacement, type ToggleProps, type ToggleRadius, type ToggleSize, type ToggleVariant, type ToolbarToolsConfig, Tooltip, type TooltipColor, type TooltipPlacement, type TooltipProps, type TooltipRadius, type TooltipSize, type TooltipVariant, TrashIcon, UploadAvatar, type UploadAvatarColor, type UploadAvatarConfig, UploadAvatarCropContent, UploadAvatarCropModal, type UploadAvatarCropOptions, type UploadAvatarLabelPlacement, type UploadAvatarProps, type UploadAvatarRadius, type UploadAvatarShape, type UploadAvatarSize, type UploadAvatarVariant, UploadFile, type UploadFileColor, type UploadFileConfig, type UploadFileDragStatus, UploadFileDropzone, type UploadFileDropzoneProps, UploadFileItemRow, type UploadFileItemRowProps, UploadFileList, type UploadFileListProps, type UploadFileListType, type UploadFileProps, type UploadFileRadius, type UploadFileShape, type UploadFileSize, type UploadFileVariant, type UploadFileViewMode, UploadIcon, UploadImage, type UploadImageColor, type UploadImageDragStatus, UploadImageDropzone, type UploadImageDropzoneProps, UploadImageList, type UploadImageListProps, type UploadImageObjectFit, type UploadImageProps, type UploadImageRadius, type UploadImageShape, type UploadImageSize, type UploadImageVariant, type UploadImageViewMode, type UseDataTableOptions, type UseFloatingTransitionOptions, VIDEO_EXTENSIONS, YearGrid, type YearGridProps, ZoomInIcon, ZoomOutIcon, checkIsDisabled, clamp, combineDateTime, createDateWithTime, createTableColumnHelper, defaultTableFeatures, downloadFile, formatBytes, formatDate, formatDateTime, formatNumberString, formatTime, fuzzyFilter, generateCalendarGrid, generateRangeCalendarGrid, getDefaultDateTimeFormat, getDefaultFormat, getFileCategory, getFileExtension, getFileName, getFileType, getISOWeekNumber, getPercentage, getSafeConfig, isDateAfter, isDateBefore, isSameDay, isSameMonth, isSameTime, isTimeAfter, isTimeBefore, isTimeInRange, isValidOtpChar, normalizePreviewFile, padZero, parseDate, parseDateTime, parseNumber, parseRawNumberString, parseTimeToDate, rankAndFilterItems, resolveLocale, sanitizeOtpString, splitTagsFromText, toDate, toDateTime, toTimeObject, toast, useAnimatedError, useCarousel, useCarouselContext, useCollapseContext, useCollapsePanelContext, useConfirmContext, useDataTable, useDebounce, useDebouncedCallback, useDropdownContext, useFileContext, useFloatingTransition, useModalContext, usePopoverContext, useTableStyles, useTabsContext };