ixia-ui-react 1.8.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/accordion/index.d.ts +41 -0
- package/dist/accordion/index.js +142 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert/index.d.ts +22 -0
- package/dist/alert/index.js +1 -0
- package/dist/alert-Dcu9R8CY.js +73 -0
- package/dist/alert-Dcu9R8CY.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +39 -0
- package/dist/alert-dialog/index.js +134 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/autocomplete/index.d.ts +2 -0
- package/dist/autocomplete/index.js +1 -0
- package/dist/autocomplete-BfpWVO1l.js +169 -0
- package/dist/autocomplete-BfpWVO1l.js.map +1 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +1 -0
- package/dist/avatar-Bp4gZh21.js +93 -0
- package/dist/avatar-Bp4gZh21.js.map +1 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge-Cl-9WTW-.js +160 -0
- package/dist/badge-Cl-9WTW-.js.map +1 -0
- package/dist/bento-box/index.d.ts +30 -0
- package/dist/bento-box/index.js +103 -0
- package/dist/bento-box/index.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +18 -0
- package/dist/breadcrumb/index.js +58 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.js +1 -0
- package/dist/button-BpUC-R1J.js +307 -0
- package/dist/button-BpUC-R1J.js.map +1 -0
- package/dist/button-group/index.d.ts +2 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group-7azbqlcO.js +269 -0
- package/dist/button-group-7azbqlcO.js.map +1 -0
- package/dist/button.types-BFKrBCGd.d.ts +10 -0
- package/dist/calendar/index.d.ts +63 -0
- package/dist/calendar/index.js +292 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/chart/index.d.ts +87 -0
- package/dist/chart/index.js +262 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox-BuUZ1Lly.js +54 -0
- package/dist/checkbox-BuUZ1Lly.js.map +1 -0
- package/dist/checkbox-group/index.d.ts +6 -0
- package/dist/checkbox-group/index.js +17 -0
- package/dist/checkbox-group/index.js.map +1 -0
- package/dist/cn-BDi0DfT5.js +29 -0
- package/dist/cn-BDi0DfT5.js.map +1 -0
- package/dist/code-block/index.d.ts +50 -0
- package/dist/code-block/index.js +208 -0
- package/dist/code-block/index.js.map +1 -0
- package/dist/collapsible/index.d.ts +2 -0
- package/dist/collapsible/index.js +1 -0
- package/dist/collapsible-BVqrh0Q0.js +44 -0
- package/dist/collapsible-BVqrh0Q0.js.map +1 -0
- package/dist/color-channel-slider/index.d.ts +2 -0
- package/dist/color-channel-slider/index.js +1 -0
- package/dist/color-channel-slider-h8mUPJ35.js +70 -0
- package/dist/color-channel-slider-h8mUPJ35.js.map +1 -0
- package/dist/color-picker/index.d.ts +137 -0
- package/dist/color-picker/index.js +621 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/combobox/index.d.ts +64 -0
- package/dist/combobox/index.js +289 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/context-menu/index.d.ts +49 -0
- package/dist/context-menu/index.js +166 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/dialog/index.d.ts +36 -0
- package/dist/dialog/index.js +119 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/drawer/index.d.ts +31 -0
- package/dist/drawer/index.js +95 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/dropzone/index.d.ts +70 -0
- package/dist/dropzone/index.js +479 -0
- package/dist/dropzone/index.js.map +1 -0
- package/dist/field/index.d.ts +2 -0
- package/dist/field/index.js +1 -0
- package/dist/field-DTL7eA5y.js +254 -0
- package/dist/field-DTL7eA5y.js.map +1 -0
- package/dist/form/index.d.ts +220 -0
- package/dist/form/index.js +3 -0
- package/dist/form-BxMg796f.js +192 -0
- package/dist/form-BxMg796f.js.map +1 -0
- package/dist/has-single-element-child-DLGI0Dh2.js +12 -0
- package/dist/has-single-element-child-DLGI0Dh2.js.map +1 -0
- package/dist/hooks/index.d.ts +26 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks-DUm-q_ig.js +68 -0
- package/dist/hooks-DUm-q_ig.js.map +1 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon-D3JWfCa2.js +85 -0
- package/dist/icon-D3JWfCa2.js.map +1 -0
- package/dist/icon-container/index.d.ts +10 -0
- package/dist/icon-container/index.js +64 -0
- package/dist/icon-container/index.js.map +1 -0
- package/dist/index-0ZQzIKoE.d.ts +11 -0
- package/dist/index-B3MK1QYh.d.ts +11 -0
- package/dist/index-BJVMIPq4.d.ts +54 -0
- package/dist/index-BsV-u_jc.d.ts +4 -0
- package/dist/index-BygR7cUT.d.ts +22 -0
- package/dist/index-BzTOLSgZ.d.ts +9 -0
- package/dist/index-C15xiG9O.d.ts +14 -0
- package/dist/index-C2zco6-C.d.ts +15 -0
- package/dist/index-CIDOd4Z8.d.ts +56 -0
- package/dist/index-CQti9gFb.d.ts +49 -0
- package/dist/index-CiE-Rqit.d.ts +70 -0
- package/dist/index-D1kkOg9k.d.ts +14 -0
- package/dist/index-DLfdAked.d.ts +34 -0
- package/dist/index-DMaW_XF1.d.ts +24 -0
- package/dist/index-Db_QGr6S.d.ts +5 -0
- package/dist/index-DdFxZ3Xr.d.ts +22 -0
- package/dist/index-DfNHJF0t.d.ts +33 -0
- package/dist/index-DyQYoAUf.d.ts +29 -0
- package/dist/index-N2CBSUDu.d.ts +14 -0
- package/dist/index-PuhTRMce.d.ts +11 -0
- package/dist/index-Wb_tILYa.d.ts +24 -0
- package/dist/index-bVyqfhJS.d.ts +4 -0
- package/dist/index-x4f8gnaI.d.ts +15 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.js +1 -0
- package/dist/input-Laj6dwtK.js +179 -0
- package/dist/input-Laj6dwtK.js.map +1 -0
- package/dist/input-group/index.d.ts +2 -0
- package/dist/input-group/index.js +1 -0
- package/dist/input-group-CgdazGrY.js +111 -0
- package/dist/input-group-CgdazGrY.js.map +1 -0
- package/dist/input-otp/index.d.ts +13 -0
- package/dist/input-otp/index.js +44 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input.types-816rEVWU.d.ts +20 -0
- package/dist/input.types-D0gyoaQv.js +48 -0
- package/dist/input.types-D0gyoaQv.js.map +1 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +25 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/label/index.d.ts +8 -0
- package/dist/label/index.js +1 -0
- package/dist/label-BgpayDvN.js +27 -0
- package/dist/label-BgpayDvN.js.map +1 -0
- package/dist/layer-tree/index.d.ts +728 -0
- package/dist/layer-tree/index.js +685 -0
- package/dist/layer-tree/index.js.map +1 -0
- package/dist/map/google/index.d.ts +143 -0
- package/dist/map/google/index.js +445 -0
- package/dist/map/google/index.js.map +1 -0
- package/dist/map/index.d.ts +94 -0
- package/dist/map/index.js +208 -0
- package/dist/map/index.js.map +1 -0
- package/dist/map.context-Dw1D7E8m.js +11 -0
- package/dist/map.context-Dw1D7E8m.js.map +1 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu-sf13cnGp.js +173 -0
- package/dist/menu-sf13cnGp.js.map +1 -0
- package/dist/menu-tone-DWBEHoX2.js +22 -0
- package/dist/menu-tone-DWBEHoX2.js.map +1 -0
- package/dist/meter/index.d.ts +2 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter-HD5taq57.js +116 -0
- package/dist/meter-HD5taq57.js.map +1 -0
- package/dist/nav-bar/index.d.ts +25 -0
- package/dist/nav-bar/index.js +133 -0
- package/dist/nav-bar/index.js.map +1 -0
- package/dist/navigation-menu/index.d.ts +43 -0
- package/dist/navigation-menu/index.js +176 -0
- package/dist/navigation-menu/index.js.map +1 -0
- package/dist/number-field/index.d.ts +14 -0
- package/dist/number-field/index.js +116 -0
- package/dist/number-field/index.js.map +1 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover-B1s4xXrX.js +114 -0
- package/dist/popover-B1s4xXrX.js.map +1 -0
- package/dist/preview-card/index.d.ts +13 -0
- package/dist/preview-card/index.js +35 -0
- package/dist/preview-card/index.js.map +1 -0
- package/dist/profile/index.d.ts +21 -0
- package/dist/profile/index.js +52 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/progress/index.d.ts +23 -0
- package/dist/progress/index.js +97 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/radar-ping/index.d.ts +11 -0
- package/dist/radar-ping/index.js +49 -0
- package/dist/radar-ping/index.js.map +1 -0
- package/dist/radio-group/index.d.ts +2 -0
- package/dist/radio-group/index.js +1 -0
- package/dist/radio-group-Dj43u35Z.js +47 -0
- package/dist/radio-group-Dj43u35Z.js.map +1 -0
- package/dist/resizeable/index.d.ts +11 -0
- package/dist/resizeable/index.js +31 -0
- package/dist/resizeable/index.js.map +1 -0
- package/dist/scroll-area/index.d.ts +11 -0
- package/dist/scroll-area/index.js +51 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +1 -0
- package/dist/select-DncJXYim.js +159 -0
- package/dist/select-DncJXYim.js.map +1 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +1 -0
- package/dist/separator-DgIQp1cB.js +97 -0
- package/dist/separator-DgIQp1cB.js.map +1 -0
- package/dist/sidebar/index.d.ts +80 -0
- package/dist/sidebar/index.js +334 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/site-header/index.d.ts +22 -0
- package/dist/site-header/index.js +55 -0
- package/dist/site-header/index.js.map +1 -0
- package/dist/skeleton/index.d.ts +4 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton-DSG3FWby.js +13 -0
- package/dist/skeleton-DSG3FWby.js.map +1 -0
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider-D_XlV4OW.js +114 -0
- package/dist/slider-D_XlV4OW.js.map +1 -0
- package/dist/slider-group/index.d.ts +46 -0
- package/dist/slider-group/index.js +198 -0
- package/dist/slider-group/index.js.map +1 -0
- package/dist/styles.css +4 -1
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch-DXHixGHe.js +23 -0
- package/dist/switch-DXHixGHe.js.map +1 -0
- package/dist/table/index.d.ts +920 -0
- package/dist/table/index.js +1544 -0
- package/dist/table/index.js.map +1 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +1 -0
- package/dist/tabs-DTC7coap.js +270 -0
- package/dist/tabs-DTC7coap.js.map +1 -0
- package/dist/text-area/index.d.ts +2 -0
- package/dist/text-area/index.js +1 -0
- package/dist/text-area-H6HjKnv_.js +50 -0
- package/dist/text-area-H6HjKnv_.js.map +1 -0
- package/dist/toast/index.d.ts +65 -0
- package/dist/toast/index.js +216 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +1 -0
- package/dist/toggle-ZT9thVmz.js +73 -0
- package/dist/toggle-ZT9thVmz.js.map +1 -0
- package/dist/toggle-group/index.d.ts +10 -0
- package/dist/toggle-group/index.js +63 -0
- package/dist/toggle-group/index.js.map +1 -0
- package/dist/toggle-group-context-CBNZEf1I.js +6 -0
- package/dist/toggle-group-context-CBNZEf1I.js.map +1 -0
- package/dist/tooltip/index.d.ts +18 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip-B6z3tDbW.js +41 -0
- package/dist/tooltip-B6z3tDbW.js.map +1 -0
- package/dist/trim-text-children-CQRFg2fL.js +33 -0
- package/dist/trim-text-children-CQRFg2fL.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils-BI2x7nW5.js +5 -0
- package/dist/utils-BI2x7nW5.js.map +1 -0
- package/package.json +100 -31
- package/dist/index.d.ts +0 -8000
- package/dist/index.js +0 -17274
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
|
+
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
+
import { t as Button } from "../button-BpUC-R1J.js";
|
|
4
|
+
import { c as MeterFooter, n as MeterValue, o as MeterIndicator, r as MeterTrack, t as Meter } from "../meter-HD5taq57.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import React, { useId } from "react";
|
|
7
|
+
// src/components/dropzone/dropzone.utils.ts
|
|
8
|
+
const BYTES_PER_UNIT = 1e3;
|
|
9
|
+
const FIRST_UNIT_INDEX = 0;
|
|
10
|
+
const UNIT_STEP = 1;
|
|
11
|
+
const LAST_UNIT_OFFSET = 1;
|
|
12
|
+
const NO_DECIMALS = 0;
|
|
13
|
+
const SINGLE_DECIMAL = 1;
|
|
14
|
+
const EMPTY_LENGTH = 0;
|
|
15
|
+
const PATTERN_START = 0;
|
|
16
|
+
const formatFileSize = (bytes) => {
|
|
17
|
+
if (bytes < BYTES_PER_UNIT) return `${bytes} B`;
|
|
18
|
+
const units = [
|
|
19
|
+
"KB",
|
|
20
|
+
"MB",
|
|
21
|
+
"GB",
|
|
22
|
+
"TB"
|
|
23
|
+
];
|
|
24
|
+
let size = bytes / BYTES_PER_UNIT, unitIndex = FIRST_UNIT_INDEX, decimals = NO_DECIMALS;
|
|
25
|
+
while (size >= BYTES_PER_UNIT && unitIndex < units.length - LAST_UNIT_OFFSET) {
|
|
26
|
+
size /= BYTES_PER_UNIT;
|
|
27
|
+
unitIndex += UNIT_STEP;
|
|
28
|
+
}
|
|
29
|
+
if (!Number.isInteger(size)) decimals = SINGLE_DECIMAL;
|
|
30
|
+
return `${size.toFixed(decimals)}${units[unitIndex]}`;
|
|
31
|
+
};
|
|
32
|
+
const getFileKey = (file) => `${file.name}-${file.size}-${file.lastModified}`;
|
|
33
|
+
const isFileTypeAccepted = (file, acceptedFileTypes) => {
|
|
34
|
+
if (acceptedFileTypes.length === EMPTY_LENGTH) return true;
|
|
35
|
+
const fileName = file.name.toLowerCase(), fileType = file.type.toLowerCase();
|
|
36
|
+
return acceptedFileTypes.some((accepted) => {
|
|
37
|
+
const pattern = accepted.toLowerCase();
|
|
38
|
+
if (pattern.startsWith(".")) return fileName.endsWith(pattern);
|
|
39
|
+
if (pattern.endsWith("/*")) return fileType.startsWith(pattern.slice(PATTERN_START, -1));
|
|
40
|
+
return fileType === pattern;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const DropzoneContext = React.createContext(void 0);
|
|
44
|
+
const useDropzone = () => {
|
|
45
|
+
const context = React.useContext(DropzoneContext);
|
|
46
|
+
if (!context) throw new Error("useDropzone must be used within a DropzoneProvider");
|
|
47
|
+
return context;
|
|
48
|
+
};
|
|
49
|
+
// src/components/dropzone/dropzone.tsx
|
|
50
|
+
const SINGLE_FILE = 1;
|
|
51
|
+
const FIRST_INDEX = 0;
|
|
52
|
+
const EMPTY = 0;
|
|
53
|
+
const MIN_PROGRESS = 0;
|
|
54
|
+
const MAX_PROGRESS = 100;
|
|
55
|
+
const defaultMaxFilesErrorLabel = (max) => {
|
|
56
|
+
let suffix = "s";
|
|
57
|
+
if (max === SINGLE_FILE) suffix = "";
|
|
58
|
+
return `You can select up to ${max} file${suffix}.`;
|
|
59
|
+
};
|
|
60
|
+
const defaultMaxFileSizeErrorLabel = (fileName, max) => `"${fileName}" exceeds the maximum size of ${max}.`;
|
|
61
|
+
const defaultFileTypeErrorLabel = (fileName) => `"${fileName}" is not an accepted file type.`;
|
|
62
|
+
const resolveAcceptedTypes = (accept) => {
|
|
63
|
+
if (typeof accept !== "string") return [];
|
|
64
|
+
return accept.split(",").map((value) => value.trim()).filter(Boolean);
|
|
65
|
+
};
|
|
66
|
+
const toFileArray = (fileList) => {
|
|
67
|
+
if (!fileList) return [];
|
|
68
|
+
return [...fileList];
|
|
69
|
+
};
|
|
70
|
+
const formatOptionalSize = (size) => {
|
|
71
|
+
if (size === void 0) return;
|
|
72
|
+
return formatFileSize(size);
|
|
73
|
+
};
|
|
74
|
+
function Dropzone$1({ maxFiles, maxFileSize, maxFilesErrorLabel = defaultMaxFilesErrorLabel, maxFileSizeErrorLabel = defaultMaxFileSizeErrorLabel, fileTypeErrorLabel = defaultFileTypeErrorLabel, onUpload, ref, className, children, onChange, onConfirm, ...props }) {
|
|
75
|
+
const inputRef = React.useRef(null), filesRef = React.useRef([]), [isHovering, setIsHovering] = React.useState(false), [files, setFiles] = React.useState([]), [fileError, setFileError] = React.useState(void 0), [fileProgress, setFileProgress] = React.useState({}), acceptedFileTypes = resolveAcceptedTypes(props.accept), formattedMaxFileSize = formatOptionalSize(maxFileSize), syncInputFiles = React.useCallback((nextFiles) => {
|
|
76
|
+
if (!inputRef.current) return;
|
|
77
|
+
const dataTransfer = new DataTransfer();
|
|
78
|
+
nextFiles.forEach((file) => dataTransfer.items.add(file));
|
|
79
|
+
inputRef.current.files = dataTransfer.files;
|
|
80
|
+
}, []), getNextFiles = (incomingFiles) => {
|
|
81
|
+
if (!props.multiple) return incomingFiles.slice(FIRST_INDEX, SINGLE_FILE);
|
|
82
|
+
return [...filesRef.current, ...incomingFiles].filter((file, index, source) => source.findIndex((item) => item.name === file.name && item.size === file.size && item.lastModified === file.lastModified) === index);
|
|
83
|
+
}, startUploads = (newFiles) => {
|
|
84
|
+
newFiles.forEach((file) => {
|
|
85
|
+
const key = getFileKey(file);
|
|
86
|
+
if (!onUpload) {
|
|
87
|
+
setFileProgress((previous) => ({
|
|
88
|
+
...previous,
|
|
89
|
+
[key]: MAX_PROGRESS
|
|
90
|
+
}));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
setFileProgress((previous) => ({
|
|
94
|
+
...previous,
|
|
95
|
+
[key]: MIN_PROGRESS
|
|
96
|
+
}));
|
|
97
|
+
onUpload(file, (percent) => {
|
|
98
|
+
setFileProgress((previous) => ({
|
|
99
|
+
...previous,
|
|
100
|
+
[key]: Math.max(MIN_PROGRESS, Math.min(MAX_PROGRESS, percent))
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}, commitFiles = (previousFiles, acceptedFiles) => {
|
|
105
|
+
const previousKeys = new Set(previousFiles.map(getFileKey)), addedFiles = acceptedFiles.filter((file) => !previousKeys.has(getFileKey(file)));
|
|
106
|
+
filesRef.current = acceptedFiles;
|
|
107
|
+
setFiles(acceptedFiles);
|
|
108
|
+
syncInputFiles(acceptedFiles);
|
|
109
|
+
startUploads(addedFiles);
|
|
110
|
+
}, partitionBySize = (candidateFiles) => {
|
|
111
|
+
if (maxFileSize === void 0) return {
|
|
112
|
+
acceptedFiles: candidateFiles,
|
|
113
|
+
oversizedFiles: []
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
acceptedFiles: candidateFiles.filter((file) => file.size <= maxFileSize),
|
|
117
|
+
oversizedFiles: candidateFiles.filter((file) => file.size > maxFileSize)
|
|
118
|
+
};
|
|
119
|
+
}, processFiles = (candidateFiles) => {
|
|
120
|
+
const invalidTypeFiles = candidateFiles.filter((file) => !isFileTypeAccepted(file, acceptedFileTypes)), { oversizedFiles, acceptedFiles } = partitionBySize(candidateFiles);
|
|
121
|
+
if (invalidTypeFiles.length > EMPTY) return {
|
|
122
|
+
acceptedFiles: void 0,
|
|
123
|
+
error: fileTypeErrorLabel(invalidTypeFiles[FIRST_INDEX].name)
|
|
124
|
+
};
|
|
125
|
+
if (maxFiles !== void 0 && acceptedFiles.length > maxFiles) return {
|
|
126
|
+
acceptedFiles: void 0,
|
|
127
|
+
error: maxFilesErrorLabel(maxFiles)
|
|
128
|
+
};
|
|
129
|
+
if (oversizedFiles.length > EMPTY && maxFileSize !== void 0) return {
|
|
130
|
+
acceptedFiles,
|
|
131
|
+
error: maxFileSizeErrorLabel(oversizedFiles[FIRST_INDEX].name, formatFileSize(maxFileSize))
|
|
132
|
+
};
|
|
133
|
+
return {
|
|
134
|
+
acceptedFiles,
|
|
135
|
+
error: void 0
|
|
136
|
+
};
|
|
137
|
+
}, applyAcceptedFiles = (candidateFiles) => {
|
|
138
|
+
const previousFiles = filesRef.current, nextFiles = getNextFiles(candidateFiles), { acceptedFiles, error } = processFiles(nextFiles);
|
|
139
|
+
if (acceptedFiles) commitFiles(previousFiles, acceptedFiles);
|
|
140
|
+
return {
|
|
141
|
+
acceptedFiles,
|
|
142
|
+
error,
|
|
143
|
+
previousFiles
|
|
144
|
+
};
|
|
145
|
+
}, removeFile = (fileToRemove) => {
|
|
146
|
+
const removedKey = getFileKey(fileToRemove);
|
|
147
|
+
setFiles((previousFiles) => {
|
|
148
|
+
const nextFiles = previousFiles.filter((file) => file !== fileToRemove);
|
|
149
|
+
filesRef.current = nextFiles;
|
|
150
|
+
syncInputFiles(nextFiles);
|
|
151
|
+
return nextFiles;
|
|
152
|
+
});
|
|
153
|
+
setFileProgress((previous) => {
|
|
154
|
+
const next = { ...previous };
|
|
155
|
+
delete next[removedKey];
|
|
156
|
+
return next;
|
|
157
|
+
});
|
|
158
|
+
setFileError(void 0);
|
|
159
|
+
}, handleFiles = (event) => {
|
|
160
|
+
const { acceptedFiles, error, previousFiles } = applyAcceptedFiles(toFileArray(event.target.files));
|
|
161
|
+
setFileError(error);
|
|
162
|
+
if (!acceptedFiles) {
|
|
163
|
+
syncInputFiles(previousFiles);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
onChange?.(event);
|
|
167
|
+
}, handleDragOver = (event) => {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
setIsHovering(true);
|
|
170
|
+
}, handleDragLeave = () => {
|
|
171
|
+
setIsHovering(false);
|
|
172
|
+
}, handleDrop = (event) => {
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
const { acceptedFiles, error } = applyAcceptedFiles([...event.dataTransfer.files]);
|
|
175
|
+
setFileError(error);
|
|
176
|
+
if (!acceptedFiles) {
|
|
177
|
+
setIsHovering(false);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
inputRef.current?.dispatchEvent(new Event("change", { bubbles: true }));
|
|
181
|
+
setIsHovering(false);
|
|
182
|
+
};
|
|
183
|
+
React.useEffect(() => {
|
|
184
|
+
filesRef.current = files;
|
|
185
|
+
}, [files]);
|
|
186
|
+
return /* @__PURE__ */ jsx(DropzoneContext.Provider, {
|
|
187
|
+
value: {
|
|
188
|
+
acceptedFileTypes,
|
|
189
|
+
fileError,
|
|
190
|
+
fileProgress,
|
|
191
|
+
files,
|
|
192
|
+
handleDragLeave,
|
|
193
|
+
handleDragOver,
|
|
194
|
+
handleDrop,
|
|
195
|
+
handleFiles,
|
|
196
|
+
inputRef,
|
|
197
|
+
isHovering,
|
|
198
|
+
maxFileSize: formattedMaxFileSize,
|
|
199
|
+
maxFiles,
|
|
200
|
+
onConfirm,
|
|
201
|
+
onUpload,
|
|
202
|
+
props,
|
|
203
|
+
removeFile,
|
|
204
|
+
setFiles
|
|
205
|
+
},
|
|
206
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
207
|
+
className: cn("space-y-md", className),
|
|
208
|
+
ref,
|
|
209
|
+
children
|
|
210
|
+
})
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
// src/components/dropzone/dropzone-actions.tsx
|
|
214
|
+
function DropzoneActions({ className, ref, ...props }) {
|
|
215
|
+
return /* @__PURE__ */ jsx("div", {
|
|
216
|
+
className: cn("flex items-center gap-xs", className),
|
|
217
|
+
ref,
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
// src/components/dropzone/dropzone-clear.tsx
|
|
222
|
+
const EMPTY_FILE_COUNT$1 = 0;
|
|
223
|
+
function DropzoneClear({ className, ref, ...props }) {
|
|
224
|
+
const { files, setFiles } = useDropzone();
|
|
225
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
226
|
+
disabled: files.length === EMPTY_FILE_COUNT$1,
|
|
227
|
+
onClick: () => setFiles([]),
|
|
228
|
+
tone: "error",
|
|
229
|
+
variant: "outline",
|
|
230
|
+
className: cn("w-full", className),
|
|
231
|
+
ref,
|
|
232
|
+
...props
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// src/components/dropzone/dropzone-confirm.tsx
|
|
236
|
+
const EMPTY_FILE_COUNT = 0;
|
|
237
|
+
function DropzoneConfirm({ className, ref, ...props }) {
|
|
238
|
+
const { files, onConfirm } = useDropzone(), handleClick = () => {
|
|
239
|
+
if (onConfirm) onConfirm(files);
|
|
240
|
+
};
|
|
241
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
242
|
+
disabled: files.length === EMPTY_FILE_COUNT,
|
|
243
|
+
onClick: handleClick,
|
|
244
|
+
className: cn("w-full", className),
|
|
245
|
+
ref,
|
|
246
|
+
...props
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
// src/components/dropzone/dropzone-container.tsx
|
|
250
|
+
function DropzoneContainer({ className, children, ...containerProps }) {
|
|
251
|
+
const { fileError, handleDragLeave, handleDragOver, handleDrop, handleFiles, inputRef, isHovering, props } = useDropzone(), inputId = useId(), isDisabled = props.disabled ?? false;
|
|
252
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("label", {
|
|
253
|
+
htmlFor: inputId,
|
|
254
|
+
"aria-disabled": isDisabled,
|
|
255
|
+
onDragLeave: handleDragLeave,
|
|
256
|
+
onDragOver: handleDragOver,
|
|
257
|
+
onDrop: handleDrop,
|
|
258
|
+
className: cn("flex size-full items-center justify-center rounded-xl border-2 border-brand-border bg-surface py-2xl transition-all outline-none", !isDisabled && "cursor-pointer", isHovering && "ring-8 ring-brand-border-strong/20", fileError && "border-error-border", isDisabled && "cursor-not-allowed opacity-50", className),
|
|
259
|
+
...containerProps,
|
|
260
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
261
|
+
className: "flex flex-col items-center justify-center gap-lg",
|
|
262
|
+
children
|
|
263
|
+
})
|
|
264
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
265
|
+
...props,
|
|
266
|
+
id: inputId,
|
|
267
|
+
hidden: true,
|
|
268
|
+
onChange: handleFiles,
|
|
269
|
+
onClick: (event) => {
|
|
270
|
+
event.currentTarget.value = "";
|
|
271
|
+
},
|
|
272
|
+
ref: inputRef,
|
|
273
|
+
type: "file"
|
|
274
|
+
})] });
|
|
275
|
+
}
|
|
276
|
+
// src/components/dropzone/dropzone-error.tsx
|
|
277
|
+
function DropzoneError({ className, children, ref, ...props }) {
|
|
278
|
+
const { fileError } = useDropzone();
|
|
279
|
+
if (!fileError && !children) return;
|
|
280
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
281
|
+
className: cn("flex items-center gap-2xs style-text-strong--1 text-error-default", className),
|
|
282
|
+
ref,
|
|
283
|
+
role: "alert",
|
|
284
|
+
...props,
|
|
285
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: "error" }), children ?? fileError]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
// src/components/dropzone/dropzone-file-limit.tsx
|
|
289
|
+
function DropzoneFileLimit({ className, children, ref, ...props }) {
|
|
290
|
+
const { files, maxFiles } = useDropzone();
|
|
291
|
+
if (maxFiles === void 0) return;
|
|
292
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
293
|
+
className: cn("style-text-default--1 text-on-surface-variant", className),
|
|
294
|
+
ref,
|
|
295
|
+
...props,
|
|
296
|
+
children: [
|
|
297
|
+
files.length,
|
|
298
|
+
"/",
|
|
299
|
+
maxFiles,
|
|
300
|
+
children
|
|
301
|
+
]
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
// src/components/dropzone/dropzone-file-size-limit.tsx
|
|
305
|
+
function DropzoneFileSizeLimit({ className, children, ref, ...props }) {
|
|
306
|
+
const { maxFileSize } = useDropzone();
|
|
307
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
308
|
+
className: cn("", className),
|
|
309
|
+
ref,
|
|
310
|
+
...props,
|
|
311
|
+
children: [children, maxFileSize]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
// src/components/dropzone/dropzone-files.tsx
|
|
315
|
+
function DropzoneFiles({ className, ref, ...props }) {
|
|
316
|
+
return /* @__PURE__ */ jsx("div", {
|
|
317
|
+
className: cn("flex flex-col gap-xs", className),
|
|
318
|
+
ref,
|
|
319
|
+
...props
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
// src/components/dropzone/dropzone-files-header.tsx
|
|
323
|
+
function DropzoneFilesHeader({ className, ref, ...props }) {
|
|
324
|
+
return /* @__PURE__ */ jsx("div", {
|
|
325
|
+
className: cn("flex items-center justify-between gap-sm", className),
|
|
326
|
+
ref,
|
|
327
|
+
...props
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
// src/components/dropzone/dropzone-files-list.tsx
|
|
331
|
+
const NO_PROGRESS = 0;
|
|
332
|
+
const COMPLETE_PROGRESS = 100;
|
|
333
|
+
function DropzoneFilesList({ className, children, ref, ...props }) {
|
|
334
|
+
const { files, fileProgress, removeFile, onUpload } = useDropzone();
|
|
335
|
+
return /* @__PURE__ */ jsxs("ul", {
|
|
336
|
+
className: cn("flex flex-col gap-xs", className),
|
|
337
|
+
ref,
|
|
338
|
+
...props,
|
|
339
|
+
children: [files.map((file) => {
|
|
340
|
+
const fileKey = getFileKey(file), progress = fileProgress[fileKey] ?? NO_PROGRESS, isUploading = progress >= NO_PROGRESS && progress < COMPLETE_PROGRESS, isUploaded = progress >= COMPLETE_PROGRESS;
|
|
341
|
+
let meterTone = "brand";
|
|
342
|
+
if (isUploaded) meterTone = "success";
|
|
343
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
344
|
+
className: cn("flex items-center justify-between gap-lg rounded-xl border bg-surface px-md py-sm", isUploading && "border-border", isUploaded && "border-border"),
|
|
345
|
+
children: [
|
|
346
|
+
isUploading && /* @__PURE__ */ jsx("div", {
|
|
347
|
+
className: "flex items-center justify-center rounded-full bg-brand-container p-xs",
|
|
348
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
349
|
+
name: "fileUpload",
|
|
350
|
+
className: "size-md text-brand-on-container"
|
|
351
|
+
})
|
|
352
|
+
}),
|
|
353
|
+
isUploaded && /* @__PURE__ */ jsx("div", {
|
|
354
|
+
className: "flex items-center justify-center rounded-full bg-success-container p-xs",
|
|
355
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
356
|
+
name: "selected",
|
|
357
|
+
className: "size-md text-success-on-container"
|
|
358
|
+
})
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ jsxs("div", {
|
|
361
|
+
className: "flex w-full flex-col justify-between gap-3xs",
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ jsx("span", {
|
|
364
|
+
className: "style-text-default-0",
|
|
365
|
+
children: file.name
|
|
366
|
+
}),
|
|
367
|
+
onUpload && /* @__PURE__ */ jsxs(Meter, {
|
|
368
|
+
orientation: "vertical",
|
|
369
|
+
tone: meterTone,
|
|
370
|
+
value: progress,
|
|
371
|
+
children: [/* @__PURE__ */ jsx(MeterTrack, { children: /* @__PURE__ */ jsx(MeterIndicator, {}) }), /* @__PURE__ */ jsxs(MeterFooter, { children: [/* @__PURE__ */ jsx("span", {
|
|
372
|
+
className: "style-text-prose--1 text-on-surface-variant",
|
|
373
|
+
children: formatFileSize(file.size)
|
|
374
|
+
}), /* @__PURE__ */ jsx(MeterValue, {})] })]
|
|
375
|
+
}),
|
|
376
|
+
!onUpload && /* @__PURE__ */ jsx("span", {
|
|
377
|
+
className: "style-text-prose--1 text-on-surface-variant",
|
|
378
|
+
children: formatFileSize(file.size)
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ jsx(Button, {
|
|
383
|
+
variant: "ghost",
|
|
384
|
+
tone: "error",
|
|
385
|
+
onClick: () => removeFile(file),
|
|
386
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "delete" })
|
|
387
|
+
})
|
|
388
|
+
]
|
|
389
|
+
}, fileKey);
|
|
390
|
+
}), children]
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
// src/components/dropzone/dropzone-files-title.tsx
|
|
394
|
+
function DropzoneFilesTitle({ className, ref, ...props }) {
|
|
395
|
+
return /* @__PURE__ */ jsx("span", {
|
|
396
|
+
className: cn("style-text-default-0", className),
|
|
397
|
+
ref,
|
|
398
|
+
...props
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
// src/components/dropzone/dropzone-formats.tsx
|
|
402
|
+
function DropzoneFormats({ className, children, ref, ...props }) {
|
|
403
|
+
const { acceptedFileTypes } = useDropzone();
|
|
404
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
405
|
+
className: cn("", className),
|
|
406
|
+
ref,
|
|
407
|
+
...props,
|
|
408
|
+
children: [acceptedFileTypes.join(", "), children]
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
// src/components/dropzone/dropzone-heading.tsx
|
|
412
|
+
function DropzoneHeading({ className, ref, ...props }) {
|
|
413
|
+
return /* @__PURE__ */ jsx("span", {
|
|
414
|
+
className: cn("style-text-default-0", className),
|
|
415
|
+
ref,
|
|
416
|
+
...props
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
// src/components/dropzone/dropzone-icon.tsx
|
|
420
|
+
function DropzoneIcon({ className, ref, ...props }) {
|
|
421
|
+
return /* @__PURE__ */ jsx("div", {
|
|
422
|
+
className: cn("rounded-full bg-brand-container p-sm [&>svg]:size-lg [&>svg]:text-brand-on-container", className),
|
|
423
|
+
ref,
|
|
424
|
+
...props
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
// src/components/dropzone/dropzone-info.tsx
|
|
428
|
+
function DropzoneInfo({ className, ref, ...props }) {
|
|
429
|
+
return /* @__PURE__ */ jsx("div", {
|
|
430
|
+
className: cn("flex flex-col items-center justify-center gap-sm", className),
|
|
431
|
+
ref,
|
|
432
|
+
...props
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
// src/components/dropzone/dropzone-subtitle.tsx
|
|
436
|
+
function DropzoneSubtitle({ className, ref, ...props }) {
|
|
437
|
+
return /* @__PURE__ */ jsx("span", {
|
|
438
|
+
className: cn("text-on-surface-variant", className),
|
|
439
|
+
ref,
|
|
440
|
+
...props
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
// src/components/dropzone/dropzone-trigger.tsx
|
|
444
|
+
function DropzoneTrigger({ className, ref, ...props }) {
|
|
445
|
+
const { inputRef } = useDropzone(), handleClick = (event) => {
|
|
446
|
+
event.stopPropagation();
|
|
447
|
+
inputRef.current?.click();
|
|
448
|
+
};
|
|
449
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
450
|
+
variant: "link",
|
|
451
|
+
onClick: handleClick,
|
|
452
|
+
className: cn("", className),
|
|
453
|
+
ref,
|
|
454
|
+
...props
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
// src/components/dropzone/index.ts
|
|
458
|
+
const Dropzone = Object.assign(Dropzone$1, {
|
|
459
|
+
Actions: DropzoneActions,
|
|
460
|
+
Clear: DropzoneClear,
|
|
461
|
+
Confirm: DropzoneConfirm,
|
|
462
|
+
Container: DropzoneContainer,
|
|
463
|
+
Error: DropzoneError,
|
|
464
|
+
FileLimit: DropzoneFileLimit,
|
|
465
|
+
FileSizeLimit: DropzoneFileSizeLimit,
|
|
466
|
+
Files: DropzoneFiles,
|
|
467
|
+
FilesHeader: DropzoneFilesHeader,
|
|
468
|
+
FilesList: DropzoneFilesList,
|
|
469
|
+
FilesTitle: DropzoneFilesTitle,
|
|
470
|
+
Formats: DropzoneFormats,
|
|
471
|
+
Heading: DropzoneHeading,
|
|
472
|
+
Icon: DropzoneIcon,
|
|
473
|
+
Info: DropzoneInfo,
|
|
474
|
+
Subtitle: DropzoneSubtitle,
|
|
475
|
+
Trigger: DropzoneTrigger
|
|
476
|
+
});
|
|
477
|
+
export { Dropzone, DropzoneActions, DropzoneClear, DropzoneConfirm, DropzoneContainer, DropzoneError, DropzoneFilesList as DropzoneFileList, DropzoneFileSizeLimit, DropzoneFiles, DropzoneFilesHeader, DropzoneFilesTitle, DropzoneFormats, DropzoneHeading, DropzoneIcon, DropzoneInfo, DropzoneSubtitle, DropzoneTrigger };
|
|
478
|
+
|
|
479
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Dropzone","EMPTY_FILE_COUNT","DropzoneRoot"],"sources":["../../src/components/dropzone/dropzone.utils.ts","../../src/components/dropzone/dropzone.tsx","../../src/components/dropzone/dropzone-actions.tsx","../../src/components/dropzone/dropzone-clear.tsx","../../src/components/dropzone/dropzone-confirm.tsx","../../src/components/dropzone/dropzone-container.tsx","../../src/components/dropzone/dropzone-error.tsx","../../src/components/dropzone/dropzone-file-limit.tsx","../../src/components/dropzone/dropzone-file-size-limit.tsx","../../src/components/dropzone/dropzone-files.tsx","../../src/components/dropzone/dropzone-files-header.tsx","../../src/components/dropzone/dropzone-files-list.tsx","../../src/components/dropzone/dropzone-files-title.tsx","../../src/components/dropzone/dropzone-formats.tsx","../../src/components/dropzone/dropzone-heading.tsx","../../src/components/dropzone/dropzone-icon.tsx","../../src/components/dropzone/dropzone-info.tsx","../../src/components/dropzone/dropzone-subtitle.tsx","../../src/components/dropzone/dropzone-trigger.tsx","../../src/components/dropzone/index.ts"],"sourcesContent":["import React from 'react'\n\nimport type { DropzoneContextProps } from './dropzone.types'\n\nconst BYTES_PER_UNIT = 1000,\n FIRST_UNIT_INDEX = 0,\n UNIT_STEP = 1,\n LAST_UNIT_OFFSET = 1,\n NO_DECIMALS = 0,\n SINGLE_DECIMAL = 1,\n EMPTY_LENGTH = 0,\n PATTERN_START = 0,\n WILDCARD_SUFFIX_LENGTH = 1,\n formatFileSize = (bytes: number): string => {\n if (bytes < BYTES_PER_UNIT) {\n return `${bytes} B`\n }\n\n const units = ['KB', 'MB', 'GB', 'TB']\n let size = bytes / BYTES_PER_UNIT,\n unitIndex = FIRST_UNIT_INDEX,\n decimals = NO_DECIMALS\n\n while (size >= BYTES_PER_UNIT && unitIndex < units.length - LAST_UNIT_OFFSET) {\n size /= BYTES_PER_UNIT\n unitIndex += UNIT_STEP\n }\n\n if (!Number.isInteger(size)) {\n decimals = SINGLE_DECIMAL\n }\n\n return `${size.toFixed(decimals)}${units[unitIndex]}`\n },\n getFileKey = (file: File): string => `${file.name}-${file.size}-${file.lastModified}`,\n isFileTypeAccepted = (file: File, acceptedFileTypes: string[]): boolean => {\n if (acceptedFileTypes.length === EMPTY_LENGTH) {\n return true\n }\n\n const fileName = file.name.toLowerCase(),\n fileType = file.type.toLowerCase()\n\n return acceptedFileTypes.some((accepted) => {\n const pattern = accepted.toLowerCase()\n\n if (pattern.startsWith('.')) {\n return fileName.endsWith(pattern)\n }\n\n if (pattern.endsWith('/*')) {\n return fileType.startsWith(pattern.slice(PATTERN_START, -WILDCARD_SUFFIX_LENGTH))\n }\n\n return fileType === pattern\n })\n },\n DropzoneContext = React.createContext<DropzoneContextProps | undefined>(undefined),\n useDropzone = () => {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('useDropzone must be used within a DropzoneProvider')\n }\n\n return context\n }\n\nexport { DropzoneContext, formatFileSize, getFileKey, isFileTypeAccepted, useDropzone }\n","import React from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport type { DropzoneProps } from './dropzone.types'\nimport { DropzoneContext, formatFileSize, getFileKey, isFileTypeAccepted } from './dropzone.utils'\n\nconst SINGLE_FILE = 1,\n FIRST_INDEX = 0,\n EMPTY = 0,\n MIN_PROGRESS = 0,\n MAX_PROGRESS = 100,\n defaultMaxFilesErrorLabel = (max: number) => {\n let suffix = 's'\n if (max === SINGLE_FILE) {\n suffix = ''\n }\n return `You can select up to ${max} file${suffix}.`\n },\n defaultMaxFileSizeErrorLabel = (fileName: string, max: string) =>\n `\"${fileName}\" exceeds the maximum size of ${max}.`,\n defaultFileTypeErrorLabel = (fileName: string) => `\"${fileName}\" is not an accepted file type.`,\n resolveAcceptedTypes = (accept: string | undefined) => {\n if (typeof accept !== 'string') {\n return []\n }\n return accept\n .split(',')\n .map((value) => value.trim())\n .filter(Boolean)\n },\n toFileArray = (fileList: FileList | null) => {\n if (!fileList) {\n return []\n }\n return [...fileList]\n },\n formatOptionalSize = (size: number | undefined) => {\n if (size === undefined) {\n return undefined\n }\n return formatFileSize(size)\n }\n\nexport function Dropzone({\n maxFiles,\n maxFileSize,\n maxFilesErrorLabel = defaultMaxFilesErrorLabel,\n maxFileSizeErrorLabel = defaultMaxFileSizeErrorLabel,\n fileTypeErrorLabel = defaultFileTypeErrorLabel,\n onUpload,\n ref,\n className,\n children,\n onChange,\n onConfirm,\n ...props\n}: DropzoneProps) {\n const inputRef = React.useRef<HTMLInputElement | null>(null),\n filesRef = React.useRef<File[]>([]),\n [isHovering, setIsHovering] = React.useState(false),\n [files, setFiles] = React.useState<File[]>([]),\n [fileError, setFileError] = React.useState<string | undefined>(undefined),\n [fileProgress, setFileProgress] = React.useState<Record<string, number>>({}),\n acceptedFileTypes = resolveAcceptedTypes(props.accept),\n formattedMaxFileSize = formatOptionalSize(maxFileSize),\n syncInputFiles = React.useCallback((nextFiles: File[]) => {\n if (!inputRef.current) {\n return\n }\n\n const dataTransfer = new DataTransfer()\n nextFiles.forEach((file) => dataTransfer.items.add(file))\n inputRef.current.files = dataTransfer.files\n }, []),\n getNextFiles = (incomingFiles: File[]) => {\n if (!props.multiple) {\n return incomingFiles.slice(FIRST_INDEX, SINGLE_FILE)\n }\n\n const mergedFiles = [...filesRef.current, ...incomingFiles],\n dedupedFiles = mergedFiles.filter(\n (file, index, source) =>\n source.findIndex(\n (item) =>\n item.name === file.name &&\n item.size === file.size &&\n item.lastModified === file.lastModified,\n ) === index,\n )\n\n return dedupedFiles\n },\n startUploads = (newFiles: File[]) => {\n newFiles.forEach((file) => {\n const key = getFileKey(file)\n\n if (!onUpload) {\n setFileProgress((previous) => ({ ...previous, [key]: MAX_PROGRESS }))\n return\n }\n\n setFileProgress((previous) => ({ ...previous, [key]: MIN_PROGRESS }))\n void onUpload(file, (percent) => {\n setFileProgress((previous) => ({\n ...previous,\n [key]: Math.max(MIN_PROGRESS, Math.min(MAX_PROGRESS, percent)),\n }))\n })\n })\n },\n commitFiles = (previousFiles: File[], acceptedFiles: File[]) => {\n const previousKeys = new Set(previousFiles.map(getFileKey)),\n addedFiles = acceptedFiles.filter((file) => !previousKeys.has(getFileKey(file)))\n filesRef.current = acceptedFiles\n setFiles(acceptedFiles)\n syncInputFiles(acceptedFiles)\n startUploads(addedFiles)\n },\n partitionBySize = (candidateFiles: File[]) => {\n if (maxFileSize === undefined) {\n return { acceptedFiles: candidateFiles, oversizedFiles: [] as File[] }\n }\n\n return {\n acceptedFiles: candidateFiles.filter((file) => file.size <= maxFileSize),\n oversizedFiles: candidateFiles.filter((file) => file.size > maxFileSize),\n }\n },\n processFiles = (candidateFiles: File[]) => {\n const invalidTypeFiles = candidateFiles.filter(\n (file) => !isFileTypeAccepted(file, acceptedFileTypes),\n ),\n { oversizedFiles, acceptedFiles } = partitionBySize(candidateFiles)\n\n if (invalidTypeFiles.length > EMPTY) {\n return {\n acceptedFiles: undefined,\n error: fileTypeErrorLabel(invalidTypeFiles[FIRST_INDEX].name),\n }\n }\n\n if (maxFiles !== undefined && acceptedFiles.length > maxFiles) {\n return {\n acceptedFiles: undefined,\n error: maxFilesErrorLabel(maxFiles),\n }\n }\n\n if (oversizedFiles.length > EMPTY && maxFileSize !== undefined) {\n return {\n acceptedFiles,\n error: maxFileSizeErrorLabel(\n oversizedFiles[FIRST_INDEX].name,\n formatFileSize(maxFileSize),\n ),\n }\n }\n\n return { acceptedFiles, error: undefined }\n },\n applyAcceptedFiles = (candidateFiles: File[]) => {\n const previousFiles = filesRef.current,\n nextFiles = getNextFiles(candidateFiles),\n { acceptedFiles, error } = processFiles(nextFiles)\n\n if (acceptedFiles) {\n commitFiles(previousFiles, acceptedFiles)\n }\n\n return { acceptedFiles, error, previousFiles }\n },\n removeFile = (fileToRemove: File) => {\n const removedKey = getFileKey(fileToRemove)\n\n setFiles((previousFiles) => {\n const nextFiles = previousFiles.filter((file) => file !== fileToRemove)\n filesRef.current = nextFiles\n syncInputFiles(nextFiles)\n return nextFiles\n })\n setFileProgress((previous) => {\n const next = { ...previous }\n delete next[removedKey]\n return next\n })\n setFileError(undefined)\n },\n handleFiles = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { acceptedFiles, error, previousFiles } = applyAcceptedFiles(\n toFileArray(event.target.files),\n )\n\n setFileError(error)\n if (!acceptedFiles) {\n syncInputFiles(previousFiles)\n return\n }\n\n onChange?.(event)\n },\n handleDragOver = (event: React.DragEvent<HTMLElement>) => {\n event.preventDefault()\n setIsHovering(true)\n },\n handleDragLeave = () => {\n setIsHovering(false)\n },\n handleDrop = (event: React.DragEvent<HTMLElement>) => {\n event.preventDefault()\n const { acceptedFiles, error } = applyAcceptedFiles([...event.dataTransfer.files])\n\n setFileError(error)\n if (!acceptedFiles) {\n setIsHovering(false)\n return\n }\n\n inputRef.current?.dispatchEvent(new Event('change', { bubbles: true }))\n setIsHovering(false)\n }\n\n React.useEffect(() => {\n filesRef.current = files\n }, [files])\n\n return (\n <DropzoneContext.Provider\n value={{\n acceptedFileTypes,\n fileError,\n fileProgress,\n files,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n handleFiles,\n inputRef,\n isHovering,\n maxFileSize: formattedMaxFileSize,\n maxFiles,\n onConfirm,\n onUpload,\n props,\n removeFile,\n setFiles,\n }}\n >\n <div className={cn('space-y-md', className)} ref={ref}>\n {children}\n </div>\n </DropzoneContext.Provider>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneActionsProps } from './dropzone.types'\n\nexport function DropzoneActions({ className, ref, ...props }: DropzoneActionsProps) {\n return <div className={cn('flex items-center gap-xs', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport type { DropzoneClearProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nconst EMPTY_FILE_COUNT = 0\n\nexport function DropzoneClear({ className, ref, ...props }: DropzoneClearProps) {\n const { files, setFiles } = useDropzone()\n\n return (\n <Button\n disabled={files.length === EMPTY_FILE_COUNT}\n onClick={() => setFiles([])}\n tone=\"error\"\n variant=\"outline\"\n className={cn('w-full', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport type { DropzoneConfirmProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nconst EMPTY_FILE_COUNT = 0\n\nexport function DropzoneConfirm({ className, ref, ...props }: DropzoneConfirmProps) {\n const { files, onConfirm } = useDropzone(),\n handleClick = () => {\n if (onConfirm) {\n onConfirm(files)\n }\n }\n return (\n <Button\n disabled={files.length === EMPTY_FILE_COUNT}\n onClick={handleClick}\n className={cn('w-full', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { useId } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport type { DropzoneContainerProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneContainer({\n className,\n children,\n ...containerProps\n}: DropzoneContainerProps) {\n const {\n fileError,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n handleFiles,\n inputRef,\n isHovering,\n props,\n } = useDropzone(),\n inputId = useId(),\n isDisabled = props.disabled ?? false\n\n return (\n <>\n {/* Drag-and-drop has no keyboard equivalent; the label/input and Dropzone.Trigger provide the accessible path. */}\n {/* oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <label\n htmlFor={inputId}\n aria-disabled={isDisabled}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={cn(\n 'flex size-full items-center justify-center rounded-xl border-2 border-brand-border bg-surface py-2xl transition-all outline-none',\n !isDisabled && 'cursor-pointer',\n isHovering && 'ring-8 ring-brand-border-strong/20',\n fileError && 'border-error-border',\n isDisabled && 'cursor-not-allowed opacity-50',\n className,\n )}\n {...containerProps}\n >\n <div className=\"flex flex-col items-center justify-center gap-lg\">{children}</div>\n </label>\n <input\n {...props}\n id={inputId}\n hidden\n onChange={handleFiles}\n onClick={(event) => {\n event.currentTarget.value = ''\n }}\n ref={inputRef}\n type=\"file\"\n />\n </>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Icon } from '../icon'\nimport type { DropzoneErrorProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneError({ className, children, ref, ...props }: DropzoneErrorProps) {\n const { fileError } = useDropzone()\n\n if (!fileError && !children) {\n return undefined\n }\n\n return (\n <p\n className={cn('flex items-center gap-2xs style-text-strong--1 text-error-default', className)}\n ref={ref}\n role=\"alert\"\n {...props}\n >\n <Icon name=\"error\" />\n {children ?? fileError}\n </p>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFileLimitProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneFileLimit({ className, children, ref, ...props }: DropzoneFileLimitProps) {\n const { files, maxFiles } = useDropzone()\n\n if (maxFiles === undefined) {\n return undefined\n }\n\n return (\n <span\n className={cn('style-text-default--1 text-on-surface-variant', className)}\n ref={ref}\n {...props}\n >\n {files.length}/{maxFiles}\n {children}\n </span>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFileSizeLimitProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneFileSizeLimit({\n className,\n children,\n ref,\n ...props\n}: DropzoneFileSizeLimitProps) {\n const { maxFileSize } = useDropzone()\n\n return (\n <span className={cn('', className)} ref={ref} {...props}>\n {children}\n {maxFileSize}\n </span>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFilesProps } from './dropzone.types'\n\nexport function DropzoneFiles({ className, ref, ...props }: DropzoneFilesProps) {\n return <div className={cn('flex flex-col gap-xs', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFilesHeaderProps } from './dropzone.types'\n\nexport function DropzoneFilesHeader({ className, ref, ...props }: DropzoneFilesHeaderProps) {\n return (\n <div\n className={cn('flex items-center justify-between gap-sm', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { Meter, MeterFooter, MeterIndicator, MeterTrack, MeterValue } from '../meter'\nimport type { DropzoneFilesListProps } from './dropzone.types'\nimport { formatFileSize, getFileKey, useDropzone } from './dropzone.utils'\n\nconst NO_PROGRESS = 0,\n COMPLETE_PROGRESS = 100\n\nexport function DropzoneFilesList({ className, children, ref, ...props }: DropzoneFilesListProps) {\n const { files, fileProgress, removeFile, onUpload } = useDropzone()\n\n return (\n <ul className={cn('flex flex-col gap-xs', className)} ref={ref} {...props}>\n {files.map((file) => {\n const fileKey = getFileKey(file),\n progress = fileProgress[fileKey] ?? NO_PROGRESS,\n isUploading = progress >= NO_PROGRESS && progress < COMPLETE_PROGRESS,\n isUploaded = progress >= COMPLETE_PROGRESS\n\n let meterTone: 'success' | 'brand' = 'brand'\n if (isUploaded) {\n meterTone = 'success'\n }\n\n return (\n <li\n key={fileKey}\n className={cn(\n 'flex items-center justify-between gap-lg rounded-xl border bg-surface px-md py-sm',\n isUploading && 'border-border',\n isUploaded && 'border-border',\n )}\n >\n {isUploading && (\n <div className=\"flex items-center justify-center rounded-full bg-brand-container p-xs\">\n <Icon name=\"fileUpload\" className=\"size-md text-brand-on-container\" />\n </div>\n )}\n {isUploaded && (\n <div className=\"flex items-center justify-center rounded-full bg-success-container p-xs\">\n <Icon name=\"selected\" className=\"size-md text-success-on-container\" />\n </div>\n )}\n <div className=\"flex w-full flex-col justify-between gap-3xs\">\n <span className=\"style-text-default-0\">{file.name}</span>\n {onUpload && (\n <Meter orientation=\"vertical\" tone={meterTone} value={progress}>\n <MeterTrack>\n <MeterIndicator />\n </MeterTrack>\n <MeterFooter>\n <span className=\"style-text-prose--1 text-on-surface-variant\">\n {formatFileSize(file.size)}\n </span>\n <MeterValue />\n </MeterFooter>\n </Meter>\n )}\n {!onUpload && (\n <span className=\"style-text-prose--1 text-on-surface-variant\">\n {formatFileSize(file.size)}\n </span>\n )}\n </div>\n <Button variant=\"ghost\" tone=\"error\" onClick={() => removeFile(file)}>\n <Icon name=\"delete\" />\n </Button>\n </li>\n )\n })}\n {children}\n </ul>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFilesTitleProps } from './dropzone.types'\n\nexport function DropzoneFilesTitle({ className, ref, ...props }: DropzoneFilesTitleProps) {\n return <span className={cn('style-text-default-0', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneFormatsProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneFormats({ className, children, ref, ...props }: DropzoneFormatsProps) {\n const { acceptedFileTypes } = useDropzone()\n\n return (\n <span className={cn('', className)} ref={ref} {...props}>\n {acceptedFileTypes.join(', ')}\n {children}\n </span>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneHeadingProps } from './dropzone.types'\n\nexport function DropzoneHeading({ className, ref, ...props }: DropzoneHeadingProps) {\n return <span className={cn('style-text-default-0', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneIconProps } from './dropzone.types'\n\nexport function DropzoneIcon({ className, ref, ...props }: DropzoneIconProps) {\n return (\n <div\n className={cn(\n 'rounded-full bg-brand-container p-sm [&>svg]:size-lg [&>svg]:text-brand-on-container',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneInfoProps } from './dropzone.types'\n\nexport function DropzoneInfo({ className, ref, ...props }: DropzoneInfoProps) {\n return (\n <div\n className={cn('flex flex-col items-center justify-center gap-sm', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { DropzoneSubtitleProps } from './dropzone.types'\n\nexport function DropzoneSubtitle({ className, ref, ...props }: DropzoneSubtitleProps) {\n return <span className={cn('text-on-surface-variant', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport type { DropzoneTriggerProps } from './dropzone.types'\nimport { useDropzone } from './dropzone.utils'\n\nexport function DropzoneTrigger({ className, ref, ...props }: DropzoneTriggerProps) {\n const { inputRef } = useDropzone(),\n handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n inputRef.current?.click()\n }\n\n return (\n <Button\n variant=\"link\"\n onClick={handleClick}\n className={cn('', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Dropzone as DropzoneRoot } from './dropzone'\nimport { DropzoneActions } from './dropzone-actions'\nimport { DropzoneClear } from './dropzone-clear'\nimport { DropzoneConfirm } from './dropzone-confirm'\nimport { DropzoneContainer } from './dropzone-container'\nimport { DropzoneError } from './dropzone-error'\nimport { DropzoneFileLimit } from './dropzone-file-limit'\nimport { DropzoneFileSizeLimit } from './dropzone-file-size-limit'\nimport { DropzoneFiles } from './dropzone-files'\nimport { DropzoneFilesHeader } from './dropzone-files-header'\nimport { DropzoneFilesList } from './dropzone-files-list'\nimport { DropzoneFilesTitle } from './dropzone-files-title'\nimport { DropzoneFormats } from './dropzone-formats'\nimport { DropzoneHeading } from './dropzone-heading'\nimport { DropzoneIcon } from './dropzone-icon'\nimport { DropzoneInfo } from './dropzone-info'\nimport { DropzoneSubtitle } from './dropzone-subtitle'\nimport { DropzoneTrigger } from './dropzone-trigger'\n\nconst Dropzone = Object.assign(DropzoneRoot, {\n Actions: DropzoneActions,\n Clear: DropzoneClear,\n Confirm: DropzoneConfirm,\n Container: DropzoneContainer,\n Error: DropzoneError,\n FileLimit: DropzoneFileLimit,\n FileSizeLimit: DropzoneFileSizeLimit,\n Files: DropzoneFiles,\n FilesHeader: DropzoneFilesHeader,\n FilesList: DropzoneFilesList,\n FilesTitle: DropzoneFilesTitle,\n Formats: DropzoneFormats,\n Heading: DropzoneHeading,\n Icon: DropzoneIcon,\n Info: DropzoneInfo,\n Subtitle: DropzoneSubtitle,\n Trigger: DropzoneTrigger,\n})\n\nexport type {\n DropzoneProps,\n DropzoneContainerProps,\n DropzoneErrorProps,\n DropzoneActionsProps,\n DropzoneClearProps,\n DropzoneConfirmProps,\n DropzoneFilesListProps,\n DropzoneFileLimitProps,\n DropzoneFilesHeaderProps,\n DropzoneFilesProps,\n DropzoneFilesTitleProps,\n DropzoneFileSizeLimitProps,\n DropzoneFormatsProps,\n DropzoneHeadingProps,\n DropzoneIconProps,\n DropzoneSubtitleProps,\n DropzoneTriggerProps,\n DropzoneInfoProps,\n} from './dropzone.types'\nexport { DropzoneContainer } from './dropzone-container'\nexport { DropzoneError } from './dropzone-error'\nexport { DropzoneFilesList as DropzoneFileList } from './dropzone-files-list'\nexport { DropzoneFileSizeLimit } from './dropzone-file-size-limit'\nexport { DropzoneFormats } from './dropzone-formats'\nexport { DropzoneHeading } from './dropzone-heading'\nexport { DropzoneIcon } from './dropzone-icon'\nexport { DropzoneSubtitle } from './dropzone-subtitle'\nexport { DropzoneTrigger } from './dropzone-trigger'\nexport { DropzoneInfo } from './dropzone-info'\nexport { DropzoneFiles } from './dropzone-files'\nexport { DropzoneFilesHeader } from './dropzone-files-header'\nexport { DropzoneFilesTitle } from './dropzone-files-title'\nexport { DropzoneActions } from './dropzone-actions'\nexport { DropzoneConfirm } from './dropzone-confirm'\nexport { DropzoneClear } from './dropzone-clear'\n\nexport { Dropzone }\n"],"mappings":";;;;;;;AAIA,MAAM,iBAAiB;AACrB,MAAA,mBAAmB;AACnB,MAAA,YAAY;AACZ,MAAA,mBAAmB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AAW,KAAK,GAAG,SAA4B;CAC5E,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,oDAAoD,SAAS;EACtE;EACL,GAAI;CACL,CAAA;AAEL;;ACRA,SAAgB,iBAAiB,EAAE,WAAW,KAAK,GAAG,SAAgC;CACpF,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,2BAA2B,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AAC1F;;ACAA,SAAgB,gBAAgB,EAAE,WAAW,KAAK,GAAG,SAA+B;CAClF,MAAM,EAAE,aAAa,YAAY,GAC/B,eAAe,UAA+C;EAC5D,MAAM,gBAAgB;EACtB,SAAS,SAAS,MAAM;CAC1B;CAEF,OACE,oBAAC,QAAD;EACE,SAAQ;EACR,SAAS;EACT,WAAW,GAAG,IAAI,SAAS;EACtB;EACL,GAAI;CACL,CAAA;AAEL;;ACHA,MAAM,WAAW,OAAO,OAAOC,YAAc;CAC3C,SAAS;CACT,OAAO;CACP,SAAS;CACT,WAAW;CACX,OAAO;CACP,WAAW;CACX,eAAe;CACf,OAAO;CACP,aAAa;CACb,WAAW;CACX,YAAY;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,MAAM;CACN,UAAU;CACV,SAAS;AACX,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as FieldSetProps, C as FieldInputProps, D as FieldRadioProps, E as FieldRadioGroupProps, M as FieldSwitchProps, N as FieldTextAreaProps, O as FieldRowProps, P as FieldToggleProps, S as FieldInputGroupProps, T as FieldProps, _ as FieldCheckbox, a as FieldSlider, b as FieldErrorProps, c as FieldRow, d as FieldLabel, f as FieldInputGroupInput, g as FieldDescription, h as FieldErrors, i as FieldSwitch, j as FieldSliderProps, k as FieldSelectProps, l as FieldRadioGroup, m as FieldInput, n as FieldToggle, o as FieldSet, p as FieldInputGroup, r as FieldTextArea, s as FieldSelect, t as Field, u as FieldRadio, v as FieldCheckboxProps, w as FieldLabelProps, x as FieldInputGroupInputProps, y as FieldDescriptionProps } from "../index-CiE-Rqit.js";
|
|
2
|
+
export { Field, FieldCheckbox, type FieldCheckboxProps, FieldDescription, type FieldDescriptionProps, type FieldErrorProps, FieldErrors, FieldInput, FieldInputGroup, FieldInputGroupInput, type FieldInputGroupInputProps, type FieldInputGroupProps, type FieldInputProps, FieldLabel, type FieldLabelProps, type FieldProps, FieldRadio, FieldRadioGroup, type FieldRadioGroupProps, type FieldRadioProps, FieldRow, type FieldRowProps, FieldSelect, type FieldSelectProps, FieldSet, type FieldSetProps, FieldSlider, type FieldSliderProps, FieldSwitch, type FieldSwitchProps, FieldTextArea, type FieldTextAreaProps, FieldToggle, type FieldToggleProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Field, _ as FieldCheckbox, g as FieldDescription, h as FieldErrors, m as FieldInput, p as FieldInputGroup, f as FieldInputGroupInput, d as FieldLabel, u as FieldRadio, l as FieldRadioGroup, c as FieldRow, s as FieldSelect, o as FieldSet, a as FieldSlider, i as FieldSwitch, r as FieldTextArea, n as FieldToggle } from "../field-DTL7eA5y.js";
|