@tecsinapse/cortex-react 1.6.0 → 1.7.0-beta.1
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/dist/cjs/components/Avatar.js +3 -2
- package/dist/cjs/components/Calendar/Calendar.js +2 -0
- package/dist/cjs/components/Calendar/CalendarCell.js +2 -0
- package/dist/cjs/components/Calendar/CalendarGrid.js +2 -0
- package/dist/cjs/components/Calendar/RangeCalendar.js +2 -0
- package/dist/cjs/components/DatePicker/DatePickerInput.js +6 -4
- package/dist/cjs/components/DatePicker/DateRangePickerInput.js +9 -7
- package/dist/cjs/components/Input/Mask.js +2 -0
- package/dist/cjs/components/Input/Search.js +2 -0
- package/dist/cjs/components/Input/index.js +2 -0
- package/dist/cjs/components/Input/masks.js +4 -2
- package/dist/cjs/components/Menubar/Dropdown.js +2 -0
- package/dist/cjs/components/Menubar/Header.js +2 -0
- package/dist/cjs/components/Menubar/ItemLink.js +2 -0
- package/dist/cjs/components/Menubar/Search.js +2 -0
- package/dist/cjs/components/Popover/Provider.js +4 -2
- package/dist/cjs/components/Popover/Trigger.js +3 -2
- package/dist/cjs/components/ProgressBar/ProgressBar.js +41 -0
- package/dist/cjs/components/ProgressBar/ProgressBarInfinite.js +15 -0
- package/dist/cjs/components/ProgressBar/ProgressBarSegments.js +48 -0
- package/dist/cjs/components/Select/GroupedOptions.js +2 -0
- package/dist/cjs/components/Select/MultiGroupedOptions.js +2 -0
- package/dist/cjs/components/Select/MultiOptions.js +2 -0
- package/dist/cjs/components/Select/Options.js +2 -0
- package/dist/cjs/components/Tooltip.js +15 -10
- package/dist/cjs/components/Uploader/Dropzone.js +30 -0
- package/dist/cjs/components/Uploader/Files.js +14 -0
- package/dist/cjs/components/Uploader/Modal.js +38 -0
- package/dist/cjs/components/Uploader/Root.js +38 -0
- package/dist/cjs/components/Uploader/Upload.js +31 -0
- package/dist/cjs/components/Uploader/index.js +16 -0
- package/dist/cjs/components/Uploader/types.js +70 -0
- package/dist/cjs/hooks/useCalendar.js +4 -3
- package/dist/cjs/hooks/useDatePickerInput.js +3 -3
- package/dist/cjs/hooks/useDateRangePickerInput.js +5 -5
- package/dist/cjs/hooks/useFileUpload.js +85 -0
- package/dist/cjs/hooks/{useFloatingLogic.js → useFloatingElement.js} +8 -12
- package/dist/cjs/hooks/useNumberMask.js +3 -2
- package/dist/cjs/hooks/useRangeCalendar.js +5 -5
- package/dist/cjs/index.js +12 -3
- package/dist/cjs/provider/MenubarProvider.js +2 -0
- package/dist/cjs/styles/progressBar.js +32 -1
- package/dist/cjs/{components/utils.js → utils/date.js} +0 -14
- package/dist/cjs/utils/react.js +9 -0
- package/dist/cjs/utils/string.js +12 -0
- package/dist/esm/components/Avatar.js +2 -1
- package/dist/esm/components/Calendar/Calendar.js +2 -0
- package/dist/esm/components/Calendar/CalendarCell.js +2 -0
- package/dist/esm/components/Calendar/CalendarGrid.js +2 -0
- package/dist/esm/components/Calendar/RangeCalendar.js +2 -0
- package/dist/esm/components/DatePicker/DatePickerInput.js +5 -3
- package/dist/esm/components/DatePicker/DateRangePickerInput.js +5 -3
- package/dist/esm/components/Input/Mask.js +2 -0
- package/dist/esm/components/Input/Search.js +2 -0
- package/dist/esm/components/Input/index.js +2 -0
- package/dist/esm/components/Input/masks.js +3 -1
- package/dist/esm/components/Menubar/Dropdown.js +2 -0
- package/dist/esm/components/Menubar/Header.js +2 -0
- package/dist/esm/components/Menubar/ItemLink.js +2 -0
- package/dist/esm/components/Menubar/Search.js +2 -0
- package/dist/esm/components/Popover/Provider.js +4 -2
- package/dist/esm/components/Popover/Trigger.js +2 -1
- package/dist/esm/components/ProgressBar/ProgressBar.js +39 -0
- package/dist/esm/components/ProgressBar/ProgressBarInfinite.js +13 -0
- package/dist/esm/components/ProgressBar/ProgressBarSegments.js +46 -0
- package/dist/esm/components/Select/GroupedOptions.js +2 -0
- package/dist/esm/components/Select/MultiGroupedOptions.js +2 -0
- package/dist/esm/components/Select/MultiOptions.js +2 -0
- package/dist/esm/components/Select/Options.js +2 -0
- package/dist/esm/components/Tooltip.js +12 -7
- package/dist/esm/components/Uploader/Dropzone.js +28 -0
- package/dist/esm/components/Uploader/Files.js +12 -0
- package/dist/esm/components/Uploader/Modal.js +36 -0
- package/dist/esm/components/Uploader/Root.js +36 -0
- package/dist/esm/components/Uploader/Upload.js +29 -0
- package/dist/esm/components/Uploader/index.js +13 -0
- package/dist/esm/components/Uploader/types.js +67 -0
- package/dist/esm/hooks/useCalendar.js +2 -1
- package/dist/esm/hooks/useDatePickerInput.js +1 -1
- package/dist/esm/hooks/useDateRangePickerInput.js +1 -1
- package/dist/esm/hooks/useFileUpload.js +83 -0
- package/dist/esm/hooks/{useFloatingLogic.js → useFloatingElement.js} +8 -12
- package/dist/esm/hooks/useNumberMask.js +2 -1
- package/dist/esm/hooks/useRangeCalendar.js +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/provider/MenubarProvider.js +2 -0
- package/dist/esm/styles/progressBar.js +32 -2
- package/dist/esm/utils/date.js +14 -0
- package/dist/esm/utils/react.js +7 -0
- package/dist/esm/utils/string.js +10 -0
- package/dist/types/components/{ProgressBar.d.ts → ProgressBar/ProgressBar.d.ts} +4 -3
- package/dist/types/components/ProgressBar/ProgressBarInfinite.d.ts +6 -0
- package/dist/types/components/ProgressBar/ProgressBarSegments.d.ts +9 -0
- package/dist/types/components/ProgressBar/index.d.ts +1 -0
- package/dist/types/components/Tooltip.d.ts +2 -0
- package/dist/types/components/Uploader/Dropzone.d.ts +3 -0
- package/dist/types/components/Uploader/Files.d.ts +3 -0
- package/dist/types/components/Uploader/Modal.d.ts +2 -0
- package/dist/types/components/Uploader/Root.d.ts +3 -0
- package/dist/types/components/Uploader/Upload.d.ts +3 -0
- package/dist/types/components/Uploader/index.d.ts +9 -0
- package/dist/types/components/Uploader/types.d.ts +63 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -1
- package/dist/types/hooks/useFileUpload.d.ts +23 -0
- package/dist/types/hooks/{useFloatingLogic.d.ts → useFloatingElement.d.ts} +8 -6
- package/dist/types/styles/progressBar.d.ts +167 -0
- package/dist/types/utils/date.d.ts +3 -0
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/types/utils/react.d.ts +2 -0
- package/dist/types/utils/string.d.ts +1 -0
- package/package.json +6 -4
- package/dist/cjs/components/ProgressBar.js +0 -71
- package/dist/esm/components/ProgressBar.js +0 -69
- package/dist/esm/components/utils.js +0 -26
- package/dist/types/components/utils.d.ts +0 -6
- /package/dist/cjs/utils/{extractNumbersFromString.js → extractors.js} +0 -0
- /package/dist/esm/utils/{extractNumbersFromString.js → extractors.js} +0 -0
- /package/dist/types/utils/{extractNumbersFromString.d.ts → extractors.d.ts} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var FileStatus = /* @__PURE__ */ ((FileStatus2) => {
|
|
4
|
+
FileStatus2["SUCCESS"] = "success";
|
|
5
|
+
FileStatus2["ERROR"] = "error";
|
|
6
|
+
FileStatus2["UPLOADING"] = "uploading";
|
|
7
|
+
return FileStatus2;
|
|
8
|
+
})(FileStatus || {});
|
|
9
|
+
const AcceptSpecificMap = {
|
|
10
|
+
APPLICATION: [
|
|
11
|
+
"application/pdf",
|
|
12
|
+
"application/zip",
|
|
13
|
+
"application/msword",
|
|
14
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
15
|
+
"application/vnd.ms-excel",
|
|
16
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
17
|
+
"application/vnd.ms-powerpoint",
|
|
18
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
19
|
+
"application/x-rar-compressed",
|
|
20
|
+
"application/x-7z-compressed",
|
|
21
|
+
"application/json",
|
|
22
|
+
"application/xml",
|
|
23
|
+
"application/rtf",
|
|
24
|
+
"application/x-tar",
|
|
25
|
+
"application/x-httpd-php",
|
|
26
|
+
"application/octet-stream"
|
|
27
|
+
],
|
|
28
|
+
IMAGE: [
|
|
29
|
+
"image/jpeg",
|
|
30
|
+
"image/png",
|
|
31
|
+
"image/gif",
|
|
32
|
+
"image/bmp",
|
|
33
|
+
"image/svg+xml",
|
|
34
|
+
"image/tiff",
|
|
35
|
+
"image/webp",
|
|
36
|
+
"image/x-icon"
|
|
37
|
+
],
|
|
38
|
+
VIDEO: [
|
|
39
|
+
"video/mp4",
|
|
40
|
+
"video/mpeg",
|
|
41
|
+
"video/quicktime",
|
|
42
|
+
"video/x-msvideo",
|
|
43
|
+
"video/x-ms-wmv",
|
|
44
|
+
"video/webm",
|
|
45
|
+
"video/ogg",
|
|
46
|
+
"video/x-flv"
|
|
47
|
+
],
|
|
48
|
+
AUDIO: [
|
|
49
|
+
"audio/mpeg",
|
|
50
|
+
"audio/wav",
|
|
51
|
+
"audio/ogg",
|
|
52
|
+
"audio/x-aac",
|
|
53
|
+
"audio/flac",
|
|
54
|
+
"audio/mp4",
|
|
55
|
+
"audio/aac",
|
|
56
|
+
"audio/webm"
|
|
57
|
+
],
|
|
58
|
+
TEXT: [
|
|
59
|
+
"text/plain",
|
|
60
|
+
"text/csv",
|
|
61
|
+
"text/html",
|
|
62
|
+
"text/css",
|
|
63
|
+
"text/xml",
|
|
64
|
+
"text/javascript",
|
|
65
|
+
"text/markdown"
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.AcceptSpecificMap = AcceptSpecificMap;
|
|
70
|
+
exports.FileStatus = FileStatus;
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
var date = require('@internationalized/date');
|
|
4
4
|
var reactAria = require('react-aria');
|
|
5
5
|
var reactStately = require('react-stately');
|
|
6
|
-
var
|
|
6
|
+
var date$1 = require('../utils/date.js');
|
|
7
|
+
require('react');
|
|
7
8
|
|
|
8
9
|
const useCalendar = ({ value, onChange }) => {
|
|
9
10
|
const { locale } = reactAria.useLocale();
|
|
10
11
|
const state = reactStately.useCalendarState({
|
|
11
12
|
locale,
|
|
12
13
|
createCalendar: date.createCalendar,
|
|
13
|
-
defaultValue:
|
|
14
|
-
onChange: (value2) => onChange(
|
|
14
|
+
defaultValue: date$1.dateToCalendarDate(value),
|
|
15
|
+
onChange: (value2) => onChange(date$1.calendarDateToDate(value2))
|
|
15
16
|
});
|
|
16
17
|
const { calendarProps, title } = reactAria.useCalendar({}, state);
|
|
17
18
|
return {
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAria = require('react-aria');
|
|
5
5
|
var reactStately = require('react-stately');
|
|
6
|
-
var
|
|
6
|
+
var date = require('../utils/date.js');
|
|
7
7
|
|
|
8
8
|
const useDatePickerInput = ({
|
|
9
9
|
value,
|
|
10
10
|
onChange
|
|
11
11
|
}) => {
|
|
12
12
|
const state = reactStately.useDatePickerState({
|
|
13
|
-
defaultValue:
|
|
13
|
+
defaultValue: date.dateToCalendarDate(value),
|
|
14
14
|
onChange: (value2) => {
|
|
15
|
-
onChange(
|
|
15
|
+
onChange(date.calendarDateToDate(value2));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
const ref = React.useRef(null);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAria = require('react-aria');
|
|
5
5
|
var reactStately = require('react-stately');
|
|
6
|
-
var
|
|
6
|
+
var date = require('../utils/date.js');
|
|
7
7
|
|
|
8
8
|
const useDateRangePickerInput = ({
|
|
9
9
|
value,
|
|
@@ -11,13 +11,13 @@ const useDateRangePickerInput = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
const state = reactStately.useDateRangePickerState({
|
|
13
13
|
defaultValue: {
|
|
14
|
-
start:
|
|
15
|
-
end:
|
|
14
|
+
start: date.dateToCalendarDate(value?.start),
|
|
15
|
+
end: date.dateToCalendarDate(value?.end)
|
|
16
16
|
},
|
|
17
17
|
onChange: (value2) => {
|
|
18
18
|
onChange({
|
|
19
|
-
start:
|
|
20
|
-
end:
|
|
19
|
+
start: date.calendarDateToDate(value2.start),
|
|
20
|
+
end: date.calendarDateToDate(value2.end)
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactDropzone = require('react-dropzone');
|
|
5
|
+
var uuid = require('uuid');
|
|
6
|
+
var types = require('../components/Uploader/types.js');
|
|
7
|
+
|
|
8
|
+
const useFileUpload = ({
|
|
9
|
+
accept = {},
|
|
10
|
+
onAccept,
|
|
11
|
+
maxSize,
|
|
12
|
+
allowMultiple = true
|
|
13
|
+
}) => {
|
|
14
|
+
const [files, setFiles] = React.useState([]);
|
|
15
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
16
|
+
const onOpen = React.useCallback(() => setIsOpen(true), []);
|
|
17
|
+
const onClose = React.useCallback(() => setIsOpen(false), []);
|
|
18
|
+
const updateFiles = React.useCallback(
|
|
19
|
+
(prevFiles, newFiles) => {
|
|
20
|
+
const current = /* @__PURE__ */ new Map();
|
|
21
|
+
[...prevFiles, ...newFiles].forEach((file) => current.set(file.uid, file));
|
|
22
|
+
return [...current.values()];
|
|
23
|
+
},
|
|
24
|
+
[]
|
|
25
|
+
);
|
|
26
|
+
const onDrop = async (acceptedFiles) => {
|
|
27
|
+
const newFiles = acceptedFiles.map((file) => ({
|
|
28
|
+
file,
|
|
29
|
+
status: onAccept ? types.FileStatus.UPLOADING : types.FileStatus.SUCCESS,
|
|
30
|
+
uid: uuid.v4()
|
|
31
|
+
}));
|
|
32
|
+
try {
|
|
33
|
+
setFiles((prevFiles) => [...prevFiles, ...newFiles]);
|
|
34
|
+
if (onAccept) {
|
|
35
|
+
const updatedFiles = await onAccept(newFiles);
|
|
36
|
+
setFiles((prevFiles) => updateFiles(prevFiles, updatedFiles));
|
|
37
|
+
}
|
|
38
|
+
} catch (e) {
|
|
39
|
+
const updatedFiles = newFiles.map((f) => ({
|
|
40
|
+
...f,
|
|
41
|
+
status: types.FileStatus.ERROR
|
|
42
|
+
}));
|
|
43
|
+
setFiles((prevFiles) => updateFiles(prevFiles, updatedFiles));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const addMimeTypes = (key, acc) => {
|
|
47
|
+
types.AcceptSpecificMap[key].forEach((mimeType) => {
|
|
48
|
+
acc[mimeType] = [];
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const mappedAccept = Object.keys(accept).reduce((acc, key) => {
|
|
52
|
+
const mimeTypes = accept[key];
|
|
53
|
+
if (Array.isArray(mimeTypes) && mimeTypes.length === 0) {
|
|
54
|
+
addMimeTypes(key, acc);
|
|
55
|
+
} else if (mimeTypes) {
|
|
56
|
+
mimeTypes.forEach((mimeType) => {
|
|
57
|
+
acc[mimeType] = [];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return acc;
|
|
61
|
+
}, {});
|
|
62
|
+
const { getRootProps, getInputProps, isDragActive } = reactDropzone.useDropzone({
|
|
63
|
+
onDrop,
|
|
64
|
+
accept: mappedAccept,
|
|
65
|
+
multiple: allowMultiple,
|
|
66
|
+
maxSize
|
|
67
|
+
});
|
|
68
|
+
const handleRemoveFile = React.useCallback((index) => {
|
|
69
|
+
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
70
|
+
}, []);
|
|
71
|
+
return {
|
|
72
|
+
onOpen,
|
|
73
|
+
onClose,
|
|
74
|
+
onDelete: handleRemoveFile,
|
|
75
|
+
dropzoneProps: {
|
|
76
|
+
getInputProps,
|
|
77
|
+
getRootProps,
|
|
78
|
+
isDragActive
|
|
79
|
+
},
|
|
80
|
+
open: isOpen,
|
|
81
|
+
files
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.useFileUpload = useFileUpload;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var React = require('react');
|
|
4
3
|
var react = require('@floating-ui/react');
|
|
4
|
+
var React = require('react');
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const useFloatingElement = ({
|
|
7
7
|
placement,
|
|
8
8
|
trigger,
|
|
9
|
+
delay,
|
|
9
10
|
arrowRef
|
|
10
11
|
}) => {
|
|
11
12
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -26,26 +27,21 @@ const useFloatingLogic = ({
|
|
|
26
27
|
]
|
|
27
28
|
}
|
|
28
29
|
);
|
|
29
|
-
const click = react.useClick(context);
|
|
30
|
+
const click = react.useClick(context, { enabled: trigger === "click" });
|
|
30
31
|
const dismiss = react.useDismiss(context);
|
|
31
32
|
const role = react.useRole(context);
|
|
33
|
+
const hover = react.useHover(context, { enabled: trigger === "hover", delay });
|
|
32
34
|
const { getReferenceProps, getFloatingProps } = react.useInteractions([
|
|
33
35
|
click,
|
|
34
36
|
dismiss,
|
|
35
|
-
role
|
|
37
|
+
role,
|
|
38
|
+
hover
|
|
36
39
|
]);
|
|
37
40
|
React.useEffect(() => {
|
|
38
41
|
if (isOpen) update();
|
|
39
42
|
}, [isOpen, update]);
|
|
40
43
|
const triggerProps = {
|
|
41
44
|
ref: refs.setReference,
|
|
42
|
-
...trigger === "hover" && {
|
|
43
|
-
onMouseEnter: () => setIsOpen(true),
|
|
44
|
-
onMouseLeave: () => setIsOpen(false)
|
|
45
|
-
},
|
|
46
|
-
...trigger === "click" && {
|
|
47
|
-
onClick: () => setIsOpen((prev) => !prev)
|
|
48
|
-
},
|
|
49
45
|
...getReferenceProps()
|
|
50
46
|
};
|
|
51
47
|
return {
|
|
@@ -63,4 +59,4 @@ const useFloatingLogic = ({
|
|
|
63
59
|
};
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
exports.
|
|
62
|
+
exports.useFloatingElement = useFloatingElement;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var currency = require('currency.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
|
|
5
|
+
require('@internationalized/date');
|
|
6
|
+
var extractors = require('../utils/extractors.js');
|
|
6
7
|
|
|
7
8
|
const DEFAULT_OPTIONS = {
|
|
8
9
|
symbol: "R$ ",
|
|
@@ -29,7 +30,7 @@ const getInternalNumberAndMask = (value, options) => {
|
|
|
29
30
|
internalNumber = value;
|
|
30
31
|
}
|
|
31
32
|
} else {
|
|
32
|
-
const onlyNumbers = String(
|
|
33
|
+
const onlyNumbers = String(extractors.extractNumbersFromString(value));
|
|
33
34
|
const padZeros = String(onlyNumbers).padStart(precision + 1, "0");
|
|
34
35
|
internalNumber = Number(padZeros.replace(getRegex(precision), "."));
|
|
35
36
|
}
|
|
@@ -4,7 +4,7 @@ var date = require('@internationalized/date');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAria = require('react-aria');
|
|
6
6
|
var reactStately = require('react-stately');
|
|
7
|
-
var
|
|
7
|
+
var date$1 = require('../utils/date.js');
|
|
8
8
|
|
|
9
9
|
const useRangeCalendar = ({
|
|
10
10
|
value,
|
|
@@ -15,12 +15,12 @@ const useRangeCalendar = ({
|
|
|
15
15
|
locale,
|
|
16
16
|
createCalendar: date.createCalendar,
|
|
17
17
|
defaultValue: {
|
|
18
|
-
start:
|
|
19
|
-
end:
|
|
18
|
+
start: date$1.dateToCalendarDate(value?.start),
|
|
19
|
+
end: date$1.dateToCalendarDate(value?.end)
|
|
20
20
|
},
|
|
21
21
|
onChange: (value2) => onChange({
|
|
22
|
-
start:
|
|
23
|
-
end:
|
|
22
|
+
start: date$1.calendarDateToDate(value2.start),
|
|
23
|
+
end: date$1.calendarDateToDate(value2.end)
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
const ref = React.useRef(null);
|
package/dist/cjs/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var Loading = require('./components/Loading.js');
|
|
|
26
26
|
var index$1 = require('./components/Menubar/index.js');
|
|
27
27
|
var Modal = require('./components/Modal.js');
|
|
28
28
|
var index$2 = require('./components/Popover/index.js');
|
|
29
|
-
var ProgressBar = require('./components/ProgressBar.js');
|
|
29
|
+
var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
30
30
|
var RadioButton = require('./components/RadioButton.js');
|
|
31
31
|
var index$3 = require('./components/Select/index.js');
|
|
32
32
|
var Skeleton = require('./components/Skeleton.js');
|
|
@@ -39,25 +39,29 @@ var TimeField = require('./components/TimeField/TimeField.js');
|
|
|
39
39
|
var TimeFieldInput = require('./components/TimeField/TimeFieldInput.js');
|
|
40
40
|
var Toggle = require('./components/Toggle.js');
|
|
41
41
|
var Tooltip = require('./components/Tooltip.js');
|
|
42
|
+
var index$5 = require('./components/Uploader/index.js');
|
|
42
43
|
var useCalendar = require('./hooks/useCalendar.js');
|
|
43
44
|
var useCalendarCell = require('./hooks/useCalendarCell.js');
|
|
44
45
|
var useCalendarGrid = require('./hooks/useCalendarGrid.js');
|
|
45
46
|
var useDatePickerInput = require('./hooks/useDatePickerInput.js');
|
|
46
47
|
var useDateRangePickerInput = require('./hooks/useDateRangePickerInput.js');
|
|
47
48
|
var useDebouncedState = require('./hooks/useDebouncedState.js');
|
|
48
|
-
var
|
|
49
|
+
var useFloatingElement = require('./hooks/useFloatingElement.js');
|
|
49
50
|
var useNumberMask = require('./hooks/useNumberMask.js');
|
|
50
51
|
var useOutsideClickListener = require('./hooks/useOutsideClickListener.js');
|
|
51
52
|
var useRangeCalendar = require('./hooks/useRangeCalendar.js');
|
|
52
53
|
var useSelectGroupedOptions = require('./hooks/useSelectGroupedOptions.js');
|
|
53
54
|
var useSelectOptions = require('./hooks/useSelectOptions.js');
|
|
54
55
|
var useStringMask = require('./hooks/useStringMask.js');
|
|
56
|
+
var useFileUpload = require('./hooks/useFileUpload.js');
|
|
55
57
|
var SnackbarSonner = require('./service/SnackbarSonner.js');
|
|
56
58
|
var MenubarProvider = require('./provider/MenubarProvider.js');
|
|
57
59
|
var SnackbarProvider = require('./provider/SnackbarProvider.js');
|
|
58
60
|
var MenubarContext = require('./provider/MenubarContext.js');
|
|
59
61
|
var useMenubar = require('./provider/useMenubar.js');
|
|
60
62
|
var masks = require('./components/Input/masks.js');
|
|
63
|
+
var Root = require('./components/Uploader/Root.js');
|
|
64
|
+
var types = require('./components/Uploader/types.js');
|
|
61
65
|
|
|
62
66
|
|
|
63
67
|
|
|
@@ -109,13 +113,14 @@ exports.TimeField = TimeField.TimeField;
|
|
|
109
113
|
exports.TimeFieldInput = TimeFieldInput.TimeFieldInput;
|
|
110
114
|
exports.Toggle = Toggle.Toggle;
|
|
111
115
|
exports.Tooltip = Tooltip.Tooltip;
|
|
116
|
+
exports.Uploader = index$5.Uploader;
|
|
112
117
|
exports.useCalendar = useCalendar.useCalendar;
|
|
113
118
|
exports.useCalendarCell = useCalendarCell.useCalendarCell;
|
|
114
119
|
exports.useCalendarGrid = useCalendarGrid.useCalendarGrid;
|
|
115
120
|
exports.useDatePickerInput = useDatePickerInput.useDatePickerInput;
|
|
116
121
|
exports.useDateRangePickerInput = useDateRangePickerInput.useDateRangePickerInput;
|
|
117
122
|
exports.useDebouncedState = useDebouncedState.useDebouncedState;
|
|
118
|
-
exports.
|
|
123
|
+
exports.useFloatingElement = useFloatingElement.useFloatingElement;
|
|
119
124
|
exports.getInternalNumberAndMask = useNumberMask.getInternalNumberAndMask;
|
|
120
125
|
exports.useNumberMask = useNumberMask.useNumberMask;
|
|
121
126
|
exports.useOutsideClickListener = useOutsideClickListener.useOutsideClickListener;
|
|
@@ -125,6 +130,7 @@ exports.useSelectOptions = useSelectOptions.useSelectOptions;
|
|
|
125
130
|
exports.getMask = useStringMask.getMask;
|
|
126
131
|
exports.mergeMask = useStringMask.mergeMask;
|
|
127
132
|
exports.useStringMask = useStringMask.useStringMask;
|
|
133
|
+
exports.useFileUpload = useFileUpload.useFileUpload;
|
|
128
134
|
exports.SnackbarSonner = SnackbarSonner.SnackbarSonner;
|
|
129
135
|
exports.MenubarProvider = MenubarProvider.MenubarProvider;
|
|
130
136
|
exports.SnackbarProvider = SnackbarProvider.SnackbarProvider;
|
|
@@ -138,3 +144,6 @@ exports.Masks = masks.Masks;
|
|
|
138
144
|
exports.NumberIMask = masks.NumberIMask;
|
|
139
145
|
exports.PercentageIMask = masks.PercentageIMask;
|
|
140
146
|
exports.PercentageMask = masks.PercentageMask;
|
|
147
|
+
exports.Root = Root.Root;
|
|
148
|
+
exports.AcceptSpecificMap = types.AcceptSpecificMap;
|
|
149
|
+
exports.FileStatus = types.FileStatus;
|
|
@@ -7,6 +7,8 @@ require('react-stately');
|
|
|
7
7
|
require('@floating-ui/react');
|
|
8
8
|
require('currency.js');
|
|
9
9
|
var useOutsideClickListener = require('../hooks/useOutsideClickListener.js');
|
|
10
|
+
require('react-dropzone');
|
|
11
|
+
require('uuid');
|
|
10
12
|
var MenubarContext = require('./MenubarContext.js');
|
|
11
13
|
|
|
12
14
|
const MenubarProvider = ({ children }) => {
|
|
@@ -10,12 +10,43 @@ const progressBarFilled = tailwindVariants.tv({
|
|
|
10
10
|
error: "bg-error-medium",
|
|
11
11
|
info: "bg-info-medium",
|
|
12
12
|
warning: "bg-warning-medium",
|
|
13
|
-
success: "bg-success-medium"
|
|
13
|
+
success: "bg-success-medium",
|
|
14
|
+
uploading: ""
|
|
14
15
|
},
|
|
15
16
|
showAnimation: {
|
|
16
17
|
true: "transition-[width] duration-1000 ease-linear"
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
});
|
|
21
|
+
const progressBarInfiniteVariants = tailwindVariants.tv({
|
|
22
|
+
slots: {
|
|
23
|
+
container: "relative mb-mili",
|
|
24
|
+
bar: "h-1.5 w-full overflow-hidden",
|
|
25
|
+
progress: "w-full h-full origin-left-right rounded-b-mili"
|
|
26
|
+
},
|
|
27
|
+
variants: {
|
|
28
|
+
status: {
|
|
29
|
+
uploading: {
|
|
30
|
+
progress: "bg-info-medium animate-progress"
|
|
31
|
+
},
|
|
32
|
+
success: {
|
|
33
|
+
progress: "bg-success-medium"
|
|
34
|
+
},
|
|
35
|
+
error: {
|
|
36
|
+
progress: "bg-error-medium"
|
|
37
|
+
},
|
|
38
|
+
default: {
|
|
39
|
+
progress: "bg-primary-medium"
|
|
40
|
+
},
|
|
41
|
+
info: {
|
|
42
|
+
progress: "bg-info-medium"
|
|
43
|
+
},
|
|
44
|
+
warning: {
|
|
45
|
+
progress: "bg-warning-medium"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
20
50
|
|
|
21
51
|
exports.progressBarFilled = progressBarFilled;
|
|
52
|
+
exports.progressBarInfiniteVariants = progressBarInfiniteVariants;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var date = require('@internationalized/date');
|
|
4
|
-
var React = require('react');
|
|
5
4
|
|
|
6
|
-
const getNameInitials = (name) => {
|
|
7
|
-
const nameSplit = name.split(" ");
|
|
8
|
-
const length = nameSplit.length;
|
|
9
|
-
if (length > 1) {
|
|
10
|
-
return `${nameSplit[0][0]}${nameSplit[length - 1][0]}`;
|
|
11
|
-
}
|
|
12
|
-
return name[0];
|
|
13
|
-
};
|
|
14
5
|
const dateToCalendarDate = (value) => {
|
|
15
6
|
return new date.CalendarDate(
|
|
16
7
|
value?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -21,11 +12,6 @@ const dateToCalendarDate = (value) => {
|
|
|
21
12
|
const calendarDateToDate = (value) => {
|
|
22
13
|
return value.toDate(date.getLocalTimeZone());
|
|
23
14
|
};
|
|
24
|
-
function cloneWithProps(children, triggerProps) {
|
|
25
|
-
return React.cloneElement(/* @__PURE__ */ React.createElement("div", null, children), triggerProps);
|
|
26
|
-
}
|
|
27
15
|
|
|
28
16
|
exports.calendarDateToDate = calendarDateToDate;
|
|
29
|
-
exports.cloneWithProps = cloneWithProps;
|
|
30
17
|
exports.dateToCalendarDate = dateToCalendarDate;
|
|
31
|
-
exports.getNameInitials = getNameInitials;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const getNameInitials = (name) => {
|
|
4
|
+
const nameSplit = name.split(" ");
|
|
5
|
+
const length = nameSplit.length;
|
|
6
|
+
if (length > 1) {
|
|
7
|
+
return `${nameSplit[0][0]}${nameSplit[length - 1][0]}`;
|
|
8
|
+
}
|
|
9
|
+
return name[0];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.getNameInitials = getNameInitials;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import
|
|
3
|
+
import '@internationalized/date';
|
|
4
|
+
import { getNameInitials } from '../utils/string.js';
|
|
4
5
|
|
|
5
6
|
const Avatar = ({ src, name, className, ...rest }) => {
|
|
6
7
|
const [hasError, setHasError] = React__default.useState(false);
|
|
@@ -5,6 +5,8 @@ import 'react-stately';
|
|
|
5
5
|
import { useCalendarCell } from '../../hooks/useCalendarCell.js';
|
|
6
6
|
import '@floating-ui/react';
|
|
7
7
|
import 'currency.js';
|
|
8
|
+
import 'react-dropzone';
|
|
9
|
+
import 'uuid';
|
|
8
10
|
import { calendarCell } from '../../styles/calendar-cell.js';
|
|
9
11
|
import '../../styles/groupButton.js';
|
|
10
12
|
import '../../styles/progressBar.js';
|
|
@@ -5,6 +5,8 @@ import 'react-stately';
|
|
|
5
5
|
import { useCalendarGrid } from '../../hooks/useCalendarGrid.js';
|
|
6
6
|
import '@floating-ui/react';
|
|
7
7
|
import 'currency.js';
|
|
8
|
+
import 'react-dropzone';
|
|
9
|
+
import 'uuid';
|
|
8
10
|
import { CalendarGridBodyRows } from './CalendarGridBodyRows.js';
|
|
9
11
|
import { CalendarGridHeaderRow } from './CalendarGridHeaderRow.js';
|
|
10
12
|
|
|
@@ -5,6 +5,8 @@ import 'react-stately';
|
|
|
5
5
|
import '@floating-ui/react';
|
|
6
6
|
import 'currency.js';
|
|
7
7
|
import { useRangeCalendar } from '../../hooks/useRangeCalendar.js';
|
|
8
|
+
import 'react-dropzone';
|
|
9
|
+
import 'uuid';
|
|
8
10
|
import { CalendarGrid } from './CalendarGrid.js';
|
|
9
11
|
import { CalendarHeader } from './CalendarHeader.js';
|
|
10
12
|
|
|
@@ -2,16 +2,18 @@ import React__default from 'react';
|
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
5
|
-
import { dateToCalendarDate } from '
|
|
5
|
+
import { dateToCalendarDate } from '../../utils/date.js';
|
|
6
6
|
import { useDatePickerInput } from '../../hooks/useDatePickerInput.js';
|
|
7
7
|
import '@floating-ui/react';
|
|
8
8
|
import 'currency.js';
|
|
9
|
+
import 'react-dropzone';
|
|
10
|
+
import 'uuid';
|
|
9
11
|
import { Calendar } from '../Calendar/Calendar.js';
|
|
10
|
-
import { DateField } from './DateField.js';
|
|
11
|
-
import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
12
12
|
import { Popover } from '../Popover/index.js';
|
|
13
13
|
import { usePopoverContext } from '../Popover/Context.js';
|
|
14
14
|
import { Content } from './Content.js';
|
|
15
|
+
import { DateField } from './DateField.js';
|
|
16
|
+
import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
15
17
|
|
|
16
18
|
const DatePickerInputWithPopover = (props) => {
|
|
17
19
|
const { setIsOpen } = usePopoverContext();
|
|
@@ -2,16 +2,18 @@ import React__default from 'react';
|
|
|
2
2
|
import '@internationalized/date';
|
|
3
3
|
import 'react-aria';
|
|
4
4
|
import 'react-stately';
|
|
5
|
-
import { dateToCalendarDate } from '
|
|
5
|
+
import { dateToCalendarDate } from '../../utils/date.js';
|
|
6
6
|
import { useDateRangePickerInput } from '../../hooks/useDateRangePickerInput.js';
|
|
7
7
|
import '@floating-ui/react';
|
|
8
8
|
import 'currency.js';
|
|
9
|
+
import 'react-dropzone';
|
|
10
|
+
import 'uuid';
|
|
9
11
|
import { RangeCalendar } from '../Calendar/RangeCalendar.js';
|
|
10
|
-
import { DateField } from './DateField.js';
|
|
11
|
-
import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
12
12
|
import { Popover } from '../Popover/index.js';
|
|
13
13
|
import { usePopoverContext } from '../Popover/Context.js';
|
|
14
14
|
import { Content } from './Content.js';
|
|
15
|
+
import { DateField } from './DateField.js';
|
|
16
|
+
import { DatePickerInputBase } from './DatePickerInputBase.js';
|
|
15
17
|
|
|
16
18
|
const DateRangePickerInputWithPopover = (props) => {
|
|
17
19
|
const { setIsOpen } = usePopoverContext();
|
|
@@ -5,6 +5,8 @@ import 'react-stately';
|
|
|
5
5
|
import '@floating-ui/react';
|
|
6
6
|
import { useNumberMask } from '../../hooks/useNumberMask.js';
|
|
7
7
|
import { useStringMask } from '../../hooks/useStringMask.js';
|
|
8
|
+
import 'react-dropzone';
|
|
9
|
+
import 'uuid';
|
|
8
10
|
import { InputRoot } from './Root.js';
|
|
9
11
|
|
|
10
12
|
const InputMask = React__default.forwardRef(
|
|
@@ -6,6 +6,8 @@ import 'react-stately';
|
|
|
6
6
|
import { useDebouncedState } from '../../hooks/useDebouncedState.js';
|
|
7
7
|
import '@floating-ui/react';
|
|
8
8
|
import 'currency.js';
|
|
9
|
+
import 'react-dropzone';
|
|
10
|
+
import 'uuid';
|
|
9
11
|
import { InputBox } from './Box.js';
|
|
10
12
|
import { InputFace } from './Face.js';
|
|
11
13
|
import { InputLeft } from './Left.js';
|
|
@@ -6,6 +6,8 @@ import 'react-aria';
|
|
|
6
6
|
import 'react-stately';
|
|
7
7
|
import '@floating-ui/react';
|
|
8
8
|
import 'currency.js';
|
|
9
|
+
import 'react-dropzone';
|
|
10
|
+
import 'uuid';
|
|
9
11
|
import '../../provider/MenubarContext.js';
|
|
10
12
|
import '../../provider/SnackbarProvider.js';
|
|
11
13
|
import { useMenubar } from '../../provider/useMenubar.js';
|
|
@@ -5,6 +5,8 @@ import 'react-aria';
|
|
|
5
5
|
import 'react-stately';
|
|
6
6
|
import '@floating-ui/react';
|
|
7
7
|
import 'currency.js';
|
|
8
|
+
import 'react-dropzone';
|
|
9
|
+
import 'uuid';
|
|
8
10
|
import '../../provider/MenubarContext.js';
|
|
9
11
|
import '../../provider/SnackbarProvider.js';
|
|
10
12
|
import { useMenubar } from '../../provider/useMenubar.js';
|