@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.
Files changed (119) hide show
  1. package/dist/cjs/components/Avatar.js +3 -2
  2. package/dist/cjs/components/Calendar/Calendar.js +2 -0
  3. package/dist/cjs/components/Calendar/CalendarCell.js +2 -0
  4. package/dist/cjs/components/Calendar/CalendarGrid.js +2 -0
  5. package/dist/cjs/components/Calendar/RangeCalendar.js +2 -0
  6. package/dist/cjs/components/DatePicker/DatePickerInput.js +6 -4
  7. package/dist/cjs/components/DatePicker/DateRangePickerInput.js +9 -7
  8. package/dist/cjs/components/Input/Mask.js +2 -0
  9. package/dist/cjs/components/Input/Search.js +2 -0
  10. package/dist/cjs/components/Input/index.js +2 -0
  11. package/dist/cjs/components/Input/masks.js +4 -2
  12. package/dist/cjs/components/Menubar/Dropdown.js +2 -0
  13. package/dist/cjs/components/Menubar/Header.js +2 -0
  14. package/dist/cjs/components/Menubar/ItemLink.js +2 -0
  15. package/dist/cjs/components/Menubar/Search.js +2 -0
  16. package/dist/cjs/components/Popover/Provider.js +4 -2
  17. package/dist/cjs/components/Popover/Trigger.js +3 -2
  18. package/dist/cjs/components/ProgressBar/ProgressBar.js +41 -0
  19. package/dist/cjs/components/ProgressBar/ProgressBarInfinite.js +15 -0
  20. package/dist/cjs/components/ProgressBar/ProgressBarSegments.js +48 -0
  21. package/dist/cjs/components/Select/GroupedOptions.js +2 -0
  22. package/dist/cjs/components/Select/MultiGroupedOptions.js +2 -0
  23. package/dist/cjs/components/Select/MultiOptions.js +2 -0
  24. package/dist/cjs/components/Select/Options.js +2 -0
  25. package/dist/cjs/components/Tooltip.js +15 -10
  26. package/dist/cjs/components/Uploader/Dropzone.js +30 -0
  27. package/dist/cjs/components/Uploader/Files.js +14 -0
  28. package/dist/cjs/components/Uploader/Modal.js +38 -0
  29. package/dist/cjs/components/Uploader/Root.js +38 -0
  30. package/dist/cjs/components/Uploader/Upload.js +31 -0
  31. package/dist/cjs/components/Uploader/index.js +16 -0
  32. package/dist/cjs/components/Uploader/types.js +70 -0
  33. package/dist/cjs/hooks/useCalendar.js +4 -3
  34. package/dist/cjs/hooks/useDatePickerInput.js +3 -3
  35. package/dist/cjs/hooks/useDateRangePickerInput.js +5 -5
  36. package/dist/cjs/hooks/useFileUpload.js +85 -0
  37. package/dist/cjs/hooks/{useFloatingLogic.js → useFloatingElement.js} +8 -12
  38. package/dist/cjs/hooks/useNumberMask.js +3 -2
  39. package/dist/cjs/hooks/useRangeCalendar.js +5 -5
  40. package/dist/cjs/index.js +12 -3
  41. package/dist/cjs/provider/MenubarProvider.js +2 -0
  42. package/dist/cjs/styles/progressBar.js +32 -1
  43. package/dist/cjs/{components/utils.js → utils/date.js} +0 -14
  44. package/dist/cjs/utils/react.js +9 -0
  45. package/dist/cjs/utils/string.js +12 -0
  46. package/dist/esm/components/Avatar.js +2 -1
  47. package/dist/esm/components/Calendar/Calendar.js +2 -0
  48. package/dist/esm/components/Calendar/CalendarCell.js +2 -0
  49. package/dist/esm/components/Calendar/CalendarGrid.js +2 -0
  50. package/dist/esm/components/Calendar/RangeCalendar.js +2 -0
  51. package/dist/esm/components/DatePicker/DatePickerInput.js +5 -3
  52. package/dist/esm/components/DatePicker/DateRangePickerInput.js +5 -3
  53. package/dist/esm/components/Input/Mask.js +2 -0
  54. package/dist/esm/components/Input/Search.js +2 -0
  55. package/dist/esm/components/Input/index.js +2 -0
  56. package/dist/esm/components/Input/masks.js +3 -1
  57. package/dist/esm/components/Menubar/Dropdown.js +2 -0
  58. package/dist/esm/components/Menubar/Header.js +2 -0
  59. package/dist/esm/components/Menubar/ItemLink.js +2 -0
  60. package/dist/esm/components/Menubar/Search.js +2 -0
  61. package/dist/esm/components/Popover/Provider.js +4 -2
  62. package/dist/esm/components/Popover/Trigger.js +2 -1
  63. package/dist/esm/components/ProgressBar/ProgressBar.js +39 -0
  64. package/dist/esm/components/ProgressBar/ProgressBarInfinite.js +13 -0
  65. package/dist/esm/components/ProgressBar/ProgressBarSegments.js +46 -0
  66. package/dist/esm/components/Select/GroupedOptions.js +2 -0
  67. package/dist/esm/components/Select/MultiGroupedOptions.js +2 -0
  68. package/dist/esm/components/Select/MultiOptions.js +2 -0
  69. package/dist/esm/components/Select/Options.js +2 -0
  70. package/dist/esm/components/Tooltip.js +12 -7
  71. package/dist/esm/components/Uploader/Dropzone.js +28 -0
  72. package/dist/esm/components/Uploader/Files.js +12 -0
  73. package/dist/esm/components/Uploader/Modal.js +36 -0
  74. package/dist/esm/components/Uploader/Root.js +36 -0
  75. package/dist/esm/components/Uploader/Upload.js +29 -0
  76. package/dist/esm/components/Uploader/index.js +13 -0
  77. package/dist/esm/components/Uploader/types.js +67 -0
  78. package/dist/esm/hooks/useCalendar.js +2 -1
  79. package/dist/esm/hooks/useDatePickerInput.js +1 -1
  80. package/dist/esm/hooks/useDateRangePickerInput.js +1 -1
  81. package/dist/esm/hooks/useFileUpload.js +83 -0
  82. package/dist/esm/hooks/{useFloatingLogic.js → useFloatingElement.js} +8 -12
  83. package/dist/esm/hooks/useNumberMask.js +2 -1
  84. package/dist/esm/hooks/useRangeCalendar.js +1 -1
  85. package/dist/esm/index.js +6 -2
  86. package/dist/esm/provider/MenubarProvider.js +2 -0
  87. package/dist/esm/styles/progressBar.js +32 -2
  88. package/dist/esm/utils/date.js +14 -0
  89. package/dist/esm/utils/react.js +7 -0
  90. package/dist/esm/utils/string.js +10 -0
  91. package/dist/types/components/{ProgressBar.d.ts → ProgressBar/ProgressBar.d.ts} +4 -3
  92. package/dist/types/components/ProgressBar/ProgressBarInfinite.d.ts +6 -0
  93. package/dist/types/components/ProgressBar/ProgressBarSegments.d.ts +9 -0
  94. package/dist/types/components/ProgressBar/index.d.ts +1 -0
  95. package/dist/types/components/Tooltip.d.ts +2 -0
  96. package/dist/types/components/Uploader/Dropzone.d.ts +3 -0
  97. package/dist/types/components/Uploader/Files.d.ts +3 -0
  98. package/dist/types/components/Uploader/Modal.d.ts +2 -0
  99. package/dist/types/components/Uploader/Root.d.ts +3 -0
  100. package/dist/types/components/Uploader/Upload.d.ts +3 -0
  101. package/dist/types/components/Uploader/index.d.ts +9 -0
  102. package/dist/types/components/Uploader/types.d.ts +63 -0
  103. package/dist/types/components/index.d.ts +1 -0
  104. package/dist/types/hooks/index.d.ts +2 -1
  105. package/dist/types/hooks/useFileUpload.d.ts +23 -0
  106. package/dist/types/hooks/{useFloatingLogic.d.ts → useFloatingElement.d.ts} +8 -6
  107. package/dist/types/styles/progressBar.d.ts +167 -0
  108. package/dist/types/utils/date.d.ts +3 -0
  109. package/dist/types/utils/index.d.ts +4 -1
  110. package/dist/types/utils/react.d.ts +2 -0
  111. package/dist/types/utils/string.d.ts +1 -0
  112. package/package.json +6 -4
  113. package/dist/cjs/components/ProgressBar.js +0 -71
  114. package/dist/esm/components/ProgressBar.js +0 -69
  115. package/dist/esm/components/utils.js +0 -26
  116. package/dist/types/components/utils.d.ts +0 -6
  117. /package/dist/cjs/utils/{extractNumbersFromString.js → extractors.js} +0 -0
  118. /package/dist/esm/utils/{extractNumbersFromString.js → extractors.js} +0 -0
  119. /package/dist/types/utils/{extractNumbersFromString.d.ts → extractors.d.ts} +0 -0
package/dist/esm/index.js CHANGED
@@ -24,7 +24,7 @@ export { Loading } from './components/Loading.js';
24
24
  export { Menubar } from './components/Menubar/index.js';
25
25
  export { Modal } from './components/Modal.js';
26
26
  export { Popover } from './components/Popover/index.js';
27
- export { ProgressBar } from './components/ProgressBar.js';
27
+ export { ProgressBar } from './components/ProgressBar/ProgressBar.js';
28
28
  export { RadioButton } from './components/RadioButton.js';
29
29
  export { Select } from './components/Select/index.js';
30
30
  export { Skeleton } from './components/Skeleton.js';
@@ -37,22 +37,26 @@ export { TimeField } from './components/TimeField/TimeField.js';
37
37
  export { TimeFieldInput } from './components/TimeField/TimeFieldInput.js';
38
38
  export { Toggle } from './components/Toggle.js';
39
39
  export { Tooltip } from './components/Tooltip.js';
40
+ export { Uploader } from './components/Uploader/index.js';
40
41
  export { useCalendar } from './hooks/useCalendar.js';
41
42
  export { useCalendarCell } from './hooks/useCalendarCell.js';
42
43
  export { useCalendarGrid } from './hooks/useCalendarGrid.js';
43
44
  export { useDatePickerInput } from './hooks/useDatePickerInput.js';
44
45
  export { useDateRangePickerInput } from './hooks/useDateRangePickerInput.js';
45
46
  export { useDebouncedState } from './hooks/useDebouncedState.js';
46
- export { useFloatingLogic } from './hooks/useFloatingLogic.js';
47
+ export { useFloatingElement } from './hooks/useFloatingElement.js';
47
48
  export { getInternalNumberAndMask, useNumberMask } from './hooks/useNumberMask.js';
48
49
  export { useOutsideClickListener } from './hooks/useOutsideClickListener.js';
49
50
  export { useRangeCalendar } from './hooks/useRangeCalendar.js';
50
51
  export { useSelectGroupedOptions } from './hooks/useSelectGroupedOptions.js';
51
52
  export { useSelectOptions } from './hooks/useSelectOptions.js';
52
53
  export { getMask, mergeMask, useStringMask } from './hooks/useStringMask.js';
54
+ export { useFileUpload } from './hooks/useFileUpload.js';
53
55
  export { SnackbarSonner } from './service/SnackbarSonner.js';
54
56
  export { MenubarProvider } from './provider/MenubarProvider.js';
55
57
  export { SnackbarProvider, useSnackbar } from './provider/SnackbarProvider.js';
56
58
  export { MenubarContext } from './provider/MenubarContext.js';
57
59
  export { useMenubar } from './provider/useMenubar.js';
58
60
  export { BRLMask, CurrencyIMask, ExpressionMasks, Masks, NumberIMask, PercentageIMask, PercentageMask } from './components/Input/masks.js';
61
+ export { Root } from './components/Uploader/Root.js';
62
+ export { AcceptSpecificMap, FileStatus } from './components/Uploader/types.js';
@@ -5,6 +5,8 @@ import 'react-stately';
5
5
  import '@floating-ui/react';
6
6
  import 'currency.js';
7
7
  import { useOutsideClickListener } from '../hooks/useOutsideClickListener.js';
8
+ import 'react-dropzone';
9
+ import 'uuid';
8
10
  import { MenubarContext } from './MenubarContext.js';
9
11
 
10
12
  const MenubarProvider = ({ children }) => {
@@ -8,12 +8,42 @@ const progressBarFilled = tv({
8
8
  error: "bg-error-medium",
9
9
  info: "bg-info-medium",
10
10
  warning: "bg-warning-medium",
11
- success: "bg-success-medium"
11
+ success: "bg-success-medium",
12
+ uploading: ""
12
13
  },
13
14
  showAnimation: {
14
15
  true: "transition-[width] duration-1000 ease-linear"
15
16
  }
16
17
  }
17
18
  });
19
+ const progressBarInfiniteVariants = tv({
20
+ slots: {
21
+ container: "relative mb-mili",
22
+ bar: "h-1.5 w-full overflow-hidden",
23
+ progress: "w-full h-full origin-left-right rounded-b-mili"
24
+ },
25
+ variants: {
26
+ status: {
27
+ uploading: {
28
+ progress: "bg-info-medium animate-progress"
29
+ },
30
+ success: {
31
+ progress: "bg-success-medium"
32
+ },
33
+ error: {
34
+ progress: "bg-error-medium"
35
+ },
36
+ default: {
37
+ progress: "bg-primary-medium"
38
+ },
39
+ info: {
40
+ progress: "bg-info-medium"
41
+ },
42
+ warning: {
43
+ progress: "bg-warning-medium"
44
+ }
45
+ }
46
+ }
47
+ });
18
48
 
19
- export { progressBarFilled };
49
+ export { progressBarFilled, progressBarInfiniteVariants };
@@ -0,0 +1,14 @@
1
+ import { CalendarDate, getLocalTimeZone } from '@internationalized/date';
2
+
3
+ const dateToCalendarDate = (value) => {
4
+ return new CalendarDate(
5
+ value?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear(),
6
+ value?.getMonth() ? value.getMonth() + 1 : (/* @__PURE__ */ new Date()).getMonth() + 1,
7
+ value?.getDate() ?? (/* @__PURE__ */ new Date()).getDate()
8
+ );
9
+ };
10
+ const calendarDateToDate = (value) => {
11
+ return value.toDate(getLocalTimeZone());
12
+ };
13
+
14
+ export { calendarDateToDate, dateToCalendarDate };
@@ -0,0 +1,7 @@
1
+ import React__default from 'react';
2
+
3
+ function cloneWithProps(children, props) {
4
+ return React__default.cloneElement(/* @__PURE__ */ React__default.createElement("div", null, children), props);
5
+ }
6
+
7
+ export { cloneWithProps };
@@ -0,0 +1,10 @@
1
+ const getNameInitials = (name) => {
2
+ const nameSplit = name.split(" ");
3
+ const length = nameSplit.length;
4
+ if (length > 1) {
5
+ return `${nameSplit[0][0]}${nameSplit[length - 1][0]}`;
6
+ }
7
+ return name[0];
8
+ };
9
+
10
+ export { getNameInitials };
@@ -3,8 +3,9 @@ export interface ProgressBarProps {
3
3
  segments?: number;
4
4
  valueMin?: number;
5
5
  valueMax?: number;
6
- valueCurrent: number;
7
- intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error';
6
+ valueCurrent?: number;
7
+ intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
8
+ type?: 'infinite' | 'default';
8
9
  animated?: boolean;
9
10
  }
10
- export declare const ProgressBar: ({ segments: _segments, valueMin, valueMax, valueCurrent, intentProgress, animated, }: ProgressBarProps) => JSX.Element;
11
+ export declare const ProgressBar: ({ segments: _segments, valueMin, valueMax, valueCurrent, intentProgress, type, animated, }: ProgressBarProps) => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface ProgressBarInfiniteProps {
3
+ intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
4
+ }
5
+ export declare const ProgressBarInfinite: ({ intentProgress, }: ProgressBarInfiniteProps) => JSX.Element;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface ProgressBarSegmentsProps {
3
+ segments: number;
4
+ totalProgress: number;
5
+ intentProgress?: 'default' | 'success' | 'warning' | 'info' | 'error' | 'uploading';
6
+ showAnimation: boolean;
7
+ }
8
+ export declare const ProgressBarSegments: ({ segments, totalProgress, intentProgress, showAnimation, }: ProgressBarSegmentsProps) => JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ProgressBar';
@@ -1,5 +1,6 @@
1
1
  import { Placement } from '@floating-ui/react';
2
2
  import React from 'react';
3
+ import { type Delay } from '../hooks';
3
4
  interface TooltipProps {
4
5
  children: React.ReactElement;
5
6
  text: string;
@@ -7,6 +8,7 @@ interface TooltipProps {
7
8
  placement?: Placement;
8
9
  width?: number;
9
10
  height?: number;
11
+ delay?: Delay;
10
12
  style?: React.CSSProperties;
11
13
  }
12
14
  export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { DropzoneProps } from './types';
3
+ export declare const Dropzone: ({ dropzoneProps, selectFileText, dropText, buttonText, }: DropzoneProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { FilesProps } from './types';
3
+ export declare const Files: <T>({ files, onDelete, uploadProgressText, }: FilesProps<T>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ModalProps } from './types';
2
+ export declare const Modal: ({ open, onClose, children, title, }: ModalProps) => any;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { RootUploaderProps } from './types';
3
+ export declare const Root: <T>({ open, onClose, files, onDelete, dropzoneProps, selectFileText, dropText, buttonText, uploadProgressText, titleModal, }: RootUploaderProps<T>) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { FileProps } from './types';
3
+ export declare const File: <T>({ file, index, onDelete }: FileProps<T>) => JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export * from './Root';
3
+ export * from './types';
4
+ export declare const Uploader: {
5
+ Dropzone: ({ dropzoneProps, selectFileText, dropText, buttonText, }: import("./types").DropzoneProps) => JSX.Element;
6
+ Files: <T>({ files, onDelete, uploadProgressText, }: import("./types").FilesProps<T>) => JSX.Element;
7
+ Modal: ({ open, onClose, children, title, }: import("./types").ModalProps) => any;
8
+ Root: <T_1>({ open, onClose, files, onDelete, dropzoneProps, selectFileText, dropText, buttonText, uploadProgressText, titleModal, }: import("./types").RootUploaderProps<T_1>) => JSX.Element;
9
+ };
@@ -0,0 +1,63 @@
1
+ /// <reference types="react" />
2
+ import { DropzoneInputProps, DropzoneRootProps } from 'react-dropzone';
3
+ export interface FileItem {
4
+ file: File;
5
+ loading: 'loading' | 'success' | 'error';
6
+ }
7
+ export interface FileProps<T> {
8
+ file: FileUpload<T>;
9
+ index: number;
10
+ onDelete: (index: number) => void;
11
+ }
12
+ export interface FilesProps<T> {
13
+ files: FileUpload<T>[];
14
+ onDelete: (index: number) => void;
15
+ uploadProgressText?: string;
16
+ }
17
+ export interface UseDropzoneProps {
18
+ getRootProps: <T extends DropzoneRootProps>(props?: T) => T;
19
+ getInputProps: <T extends DropzoneInputProps>(props?: T) => T;
20
+ isDragActive: boolean;
21
+ }
22
+ export interface DropzoneProps {
23
+ dropzoneProps: UseDropzoneProps;
24
+ selectFileText?: string;
25
+ dropText?: string;
26
+ buttonText?: string;
27
+ }
28
+ export interface ModalProps {
29
+ open: boolean;
30
+ onClose: () => void;
31
+ children: React.ReactNode;
32
+ title?: string;
33
+ }
34
+ export declare enum FileStatus {
35
+ SUCCESS = "success",
36
+ ERROR = "error",
37
+ UPLOADING = "uploading"
38
+ }
39
+ export type FileUpload<T> = {
40
+ file: File;
41
+ metadata?: T;
42
+ uid: string;
43
+ status: FileStatus;
44
+ };
45
+ export interface RootUploaderProps<T> {
46
+ open: boolean;
47
+ onClose: () => void;
48
+ files: FileUpload<T>[];
49
+ onDelete: (index: number) => void;
50
+ dropzoneProps: UseDropzoneProps;
51
+ selectFileText?: string;
52
+ dropText?: string;
53
+ buttonText?: string;
54
+ uploadProgressText?: string;
55
+ titleModal?: string;
56
+ }
57
+ export declare const AcceptSpecificMap: {
58
+ readonly APPLICATION: readonly ["application/pdf", "application/zip", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/x-rar-compressed", "application/x-7z-compressed", "application/json", "application/xml", "application/rtf", "application/x-tar", "application/x-httpd-php", "application/octet-stream"];
59
+ readonly IMAGE: readonly ["image/jpeg", "image/png", "image/gif", "image/bmp", "image/svg+xml", "image/tiff", "image/webp", "image/x-icon"];
60
+ readonly VIDEO: readonly ["video/mp4", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/x-ms-wmv", "video/webm", "video/ogg", "video/x-flv"];
61
+ readonly AUDIO: readonly ["audio/mpeg", "audio/wav", "audio/ogg", "audio/x-aac", "audio/flac", "audio/mp4", "audio/aac", "audio/webm"];
62
+ readonly TEXT: readonly ["text/plain", "text/csv", "text/html", "text/css", "text/xml", "text/javascript", "text/markdown"];
63
+ };
@@ -29,3 +29,4 @@ export * from './TextArea';
29
29
  export * from './TimeField';
30
30
  export * from './Toggle';
31
31
  export * from './Tooltip';
32
+ export * from './Uploader';
@@ -4,10 +4,11 @@ export * from './useCalendarGrid';
4
4
  export * from './useDatePickerInput';
5
5
  export * from './useDateRangePickerInput';
6
6
  export * from './useDebouncedState';
7
- export * from './useFloatingLogic';
7
+ export * from './useFloatingElement';
8
8
  export * from './useNumberMask';
9
9
  export * from './useOutsideClickListener';
10
10
  export * from './useRangeCalendar';
11
11
  export * from './useSelectGroupedOptions';
12
12
  export * from './useSelectOptions';
13
13
  export * from './useStringMask';
14
+ export * from './useFileUpload';
@@ -0,0 +1,23 @@
1
+ import { UseDropzoneProps, AcceptSpecificMap, type FileUpload } from '../components/Uploader/types';
2
+ interface UseFileUploadOptions<T> {
3
+ accept?: {
4
+ IMAGE?: (typeof AcceptSpecificMap.IMAGE)[number][];
5
+ APPLICATION?: (typeof AcceptSpecificMap.APPLICATION)[number][];
6
+ AUDIO?: (typeof AcceptSpecificMap.AUDIO)[number][];
7
+ VIDEO?: (typeof AcceptSpecificMap.VIDEO)[number][];
8
+ TEXT?: (typeof AcceptSpecificMap.TEXT)[number][];
9
+ };
10
+ onAccept?: (files: FileUpload<T>[]) => Promise<FileUpload<T>[]>;
11
+ maxSize?: number;
12
+ allowMultiple?: boolean;
13
+ onDelete?: (file: FileUpload<T>) => Promise<void>;
14
+ }
15
+ export declare const useFileUpload: <T>({ accept, onAccept, maxSize, allowMultiple, }: UseFileUploadOptions<T>) => {
16
+ onOpen: () => void;
17
+ onClose: () => void;
18
+ onDelete: (index: number) => void;
19
+ dropzoneProps: UseDropzoneProps;
20
+ open: boolean;
21
+ files: FileUpload<T>[];
22
+ };
23
+ export {};
@@ -1,11 +1,16 @@
1
- import { RefObject } from 'react';
2
1
  import { Placement } from '@floating-ui/react';
3
- interface FloatingLogicProps {
2
+ import { RefObject } from 'react';
3
+ export type Delay = number | {
4
+ open?: number;
5
+ close?: number;
6
+ };
7
+ interface FloatingElementProps {
4
8
  placement?: Placement;
5
9
  trigger?: 'hover' | 'click';
10
+ delay?: Delay;
6
11
  arrowRef?: RefObject<SVGSVGElement>;
7
12
  }
8
- export declare const useFloatingLogic: ({ placement, trigger, arrowRef, }: FloatingLogicProps) => {
13
+ export declare const useFloatingElement: ({ placement, trigger, delay, arrowRef, }: FloatingElementProps) => {
9
14
  isOpen: boolean;
10
15
  setIsOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
11
16
  x: number;
@@ -37,9 +42,6 @@ export declare const useFloatingLogic: ({ placement, trigger, arrowRef, }: Float
37
42
  };
38
43
  floatingStyles: import("react").CSSProperties;
39
44
  triggerProps: {
40
- onClick?: (() => void) | undefined;
41
- onMouseEnter?: (() => void) | undefined;
42
- onMouseLeave?: (() => void) | undefined;
43
45
  ref: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
44
46
  };
45
47
  getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
@@ -5,6 +5,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
5
5
  info: string;
6
6
  warning: string;
7
7
  success: string;
8
+ uploading: string;
8
9
  };
9
10
  showAnimation: {
10
11
  true: string;
@@ -16,6 +17,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
16
17
  info: string;
17
18
  warning: string;
18
19
  success: string;
20
+ uploading: string;
19
21
  };
20
22
  showAnimation: {
21
23
  true: string;
@@ -27,6 +29,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
27
29
  info: string;
28
30
  warning: string;
29
31
  success: string;
32
+ uploading: string;
30
33
  };
31
34
  showAnimation: {
32
35
  true: string;
@@ -38,6 +41,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
38
41
  info: string;
39
42
  warning: string;
40
43
  success: string;
44
+ uploading: string;
41
45
  };
42
46
  showAnimation: {
43
47
  true: string;
@@ -49,6 +53,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
49
53
  info: string;
50
54
  warning: string;
51
55
  success: string;
56
+ uploading: string;
52
57
  };
53
58
  showAnimation: {
54
59
  true: string;
@@ -60,6 +65,7 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
60
65
  info: string;
61
66
  warning: string;
62
67
  success: string;
68
+ uploading: string;
63
69
  };
64
70
  showAnimation: {
65
71
  true: string;
@@ -71,8 +77,169 @@ export declare const progressBarFilled: import("tailwind-variants").TVReturnType
71
77
  info: string;
72
78
  warning: string;
73
79
  success: string;
80
+ uploading: string;
74
81
  };
75
82
  showAnimation: {
76
83
  true: string;
77
84
  };
78
85
  }>, unknown, unknown, undefined>>;
86
+ export declare const progressBarInfiniteVariants: import("tailwind-variants").TVReturnType<{
87
+ status: {
88
+ uploading: {
89
+ progress: string;
90
+ };
91
+ success: {
92
+ progress: string;
93
+ };
94
+ error: {
95
+ progress: string;
96
+ };
97
+ default: {
98
+ progress: string;
99
+ };
100
+ info: {
101
+ progress: string;
102
+ };
103
+ warning: {
104
+ progress: string;
105
+ };
106
+ };
107
+ }, {
108
+ container: string;
109
+ bar: string;
110
+ progress: string;
111
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
112
+ status: {
113
+ uploading: {
114
+ progress: string;
115
+ };
116
+ success: {
117
+ progress: string;
118
+ };
119
+ error: {
120
+ progress: string;
121
+ };
122
+ default: {
123
+ progress: string;
124
+ };
125
+ info: {
126
+ progress: string;
127
+ };
128
+ warning: {
129
+ progress: string;
130
+ };
131
+ };
132
+ }, {
133
+ status: {
134
+ uploading: {
135
+ progress: string;
136
+ };
137
+ success: {
138
+ progress: string;
139
+ };
140
+ error: {
141
+ progress: string;
142
+ };
143
+ default: {
144
+ progress: string;
145
+ };
146
+ info: {
147
+ progress: string;
148
+ };
149
+ warning: {
150
+ progress: string;
151
+ };
152
+ };
153
+ }>, {
154
+ status: {
155
+ uploading: {
156
+ progress: string;
157
+ };
158
+ success: {
159
+ progress: string;
160
+ };
161
+ error: {
162
+ progress: string;
163
+ };
164
+ default: {
165
+ progress: string;
166
+ };
167
+ info: {
168
+ progress: string;
169
+ };
170
+ warning: {
171
+ progress: string;
172
+ };
173
+ };
174
+ }, {
175
+ container: string;
176
+ bar: string;
177
+ progress: string;
178
+ }, import("tailwind-variants").TVReturnType<{
179
+ status: {
180
+ uploading: {
181
+ progress: string;
182
+ };
183
+ success: {
184
+ progress: string;
185
+ };
186
+ error: {
187
+ progress: string;
188
+ };
189
+ default: {
190
+ progress: string;
191
+ };
192
+ info: {
193
+ progress: string;
194
+ };
195
+ warning: {
196
+ progress: string;
197
+ };
198
+ };
199
+ }, {
200
+ container: string;
201
+ bar: string;
202
+ progress: string;
203
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
204
+ status: {
205
+ uploading: {
206
+ progress: string;
207
+ };
208
+ success: {
209
+ progress: string;
210
+ };
211
+ error: {
212
+ progress: string;
213
+ };
214
+ default: {
215
+ progress: string;
216
+ };
217
+ info: {
218
+ progress: string;
219
+ };
220
+ warning: {
221
+ progress: string;
222
+ };
223
+ };
224
+ }, {
225
+ status: {
226
+ uploading: {
227
+ progress: string;
228
+ };
229
+ success: {
230
+ progress: string;
231
+ };
232
+ error: {
233
+ progress: string;
234
+ };
235
+ default: {
236
+ progress: string;
237
+ };
238
+ info: {
239
+ progress: string;
240
+ };
241
+ warning: {
242
+ progress: string;
243
+ };
244
+ };
245
+ }>, unknown, unknown, undefined>>;
@@ -0,0 +1,3 @@
1
+ import { CalendarDate } from '@internationalized/date';
2
+ export declare const dateToCalendarDate: (value?: Date) => CalendarDate;
3
+ export declare const calendarDateToDate: (value: CalendarDate) => Date;
@@ -1 +1,4 @@
1
- export * from './extractNumbersFromString';
1
+ export * from './date';
2
+ export * from './extractors';
3
+ export * from './react';
4
+ export * from './string';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function cloneWithProps(children: React.ReactElement, props: any): React.FunctionComponentElement<any>;
@@ -0,0 +1 @@
1
+ export declare const getNameInitials: (name: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "1.6.0",
3
+ "version": "1.7.0-beta.1",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
@@ -20,17 +20,19 @@
20
20
  "dependencies": {
21
21
  "@floating-ui/react": "^0.26.18",
22
22
  "@internationalized/date": "*",
23
- "@tecsinapse/cortex-core": "0.3.3",
23
+ "@tecsinapse/cortex-core": "0.4.0-beta.0",
24
24
  "clsx": "*",
25
25
  "currency.js": "~2.0.4",
26
26
  "react-aria": "^3.33.1",
27
+ "react-dropzone": "^14.2.3",
27
28
  "react-icons": "^5.2.1",
28
29
  "react-imask": "7.6.1",
29
30
  "react-spring": "^9.7.4",
30
31
  "react-spring-carousel": "^2.0.19",
31
32
  "react-stately": "^3.31.1",
32
33
  "sonner": "^1.5.0",
33
- "tailwind-merge": "*"
34
+ "tailwind-merge": "*",
35
+ "uuid": "^10.0.0"
34
36
  },
35
37
  "repository": {
36
38
  "type": "git",
@@ -46,5 +48,5 @@
46
48
  "react-dom": ">=18.0.0",
47
49
  "tailwind": ">=3.3.0"
48
50
  },
49
- "gitHead": "138b41dd9a73cbec37c7b026858b6ab7ffd23206"
51
+ "gitHead": "4e2a6aac40665b670be9cb1b8fc0cd4181e49674"
50
52
  }