@tecsinapse/cortex-react 1.15.0-beta.23 → 1.15.0-beta.26
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/Button.js +3 -4
- package/dist/cjs/components/Card.js +3 -4
- package/dist/cjs/components/Carousel/CarouselItem.js +1 -1
- package/dist/cjs/components/Checkbox.js +3 -3
- package/dist/cjs/components/Hint.js +4 -5
- package/dist/cjs/components/Input/Face.js +7 -2
- package/dist/cjs/components/Modal.js +3 -4
- package/dist/cjs/components/Popover/Trigger.js +1 -1
- package/dist/cjs/components/RadioButton.js +14 -17
- package/dist/cjs/components/Select/MultiOption.js +1 -1
- package/dist/cjs/components/Select/Trigger.js +1 -1
- package/dist/cjs/components/Snackbar/BaseSnackbar.js +4 -7
- package/dist/cjs/components/Stepper/Root.js +8 -4
- package/dist/cjs/components/Tag.js +20 -23
- package/dist/cjs/components/TextArea/Face.js +3 -1
- package/dist/cjs/components/Toggle.js +4 -4
- package/dist/cjs/components/Uploader/Manager.js +3 -3
- package/dist/cjs/components/Uploader/Upload.js +10 -4
- package/dist/cjs/hooks/useDebouncedState.js +1 -1
- package/dist/cjs/hooks/useFileUpload.js +4 -2
- package/dist/cjs/provider/ManagerContext.js +1 -9
- package/dist/esm/components/Button.js +3 -4
- package/dist/esm/components/Card.js +3 -4
- package/dist/esm/components/Carousel/CarouselItem.js +1 -1
- package/dist/esm/components/Checkbox.js +4 -4
- package/dist/esm/components/Hint.js +4 -5
- package/dist/esm/components/Input/Face.js +7 -2
- package/dist/esm/components/Modal.js +3 -4
- package/dist/esm/components/Popover/Trigger.js +1 -1
- package/dist/esm/components/RadioButton.js +14 -17
- package/dist/esm/components/Select/MultiOption.js +1 -1
- package/dist/esm/components/Select/Trigger.js +1 -1
- package/dist/esm/components/Snackbar/BaseSnackbar.js +4 -7
- package/dist/esm/components/Stepper/Root.js +8 -4
- package/dist/esm/components/Tag.js +20 -23
- package/dist/esm/components/TextArea/Face.js +3 -1
- package/dist/esm/components/Toggle.js +4 -4
- package/dist/esm/components/Uploader/Manager.js +3 -3
- package/dist/esm/components/Uploader/Upload.js +10 -4
- package/dist/esm/hooks/useDebouncedState.js +1 -1
- package/dist/esm/hooks/useFileUpload.js +4 -2
- package/dist/esm/provider/ManagerContext.js +1 -9
- package/dist/types/components/Button.d.ts +2 -1
- package/dist/types/components/Card.d.ts +2 -1
- package/dist/types/components/Checkbox.d.ts +2 -1
- package/dist/types/components/Hint.d.ts +4 -3
- package/dist/types/components/Masonry.d.ts +2 -2
- package/dist/types/components/Modal.d.ts +3 -2
- package/dist/types/components/RadioButton.d.ts +2 -1
- package/dist/types/components/Select/useMultiSelectOption.d.ts +1 -1
- package/dist/types/components/Snackbar/BaseSnackbar.d.ts +2 -1
- package/dist/types/components/Tag.d.ts +8 -3
- package/dist/types/components/Toggle.d.ts +5 -2
- package/dist/types/components/Uploader/Manager.d.ts +1 -1
- package/dist/types/components/Uploader/index.d.ts +1 -1
- package/dist/types/components/Uploader/types.d.ts +1 -0
- package/dist/types/hooks/useCalendarCell.d.ts +1 -1
- package/dist/types/hooks/useDatePickerInput.d.ts +1 -1
- package/dist/types/hooks/useDateRangePickerInput.d.ts +1 -1
- package/dist/types/hooks/useFileUpload.d.ts +2 -1
- package/dist/types/hooks/useRangeCalendar.d.ts +1 -1
- package/dist/types/utils/react.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { radioButtonStyles } from '@tecsinapse/cortex-core';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
3
|
|
|
5
4
|
const { container, input, label: labelStyle } = radioButtonStyles();
|
|
6
|
-
const RadioButton =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
);
|
|
5
|
+
const RadioButton = ({ label, reversed, id, ref, ...rest }) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: container({ reversed }),
|
|
10
|
+
ref,
|
|
11
|
+
"data-testid": "radio-button-container",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx("input", { id, type: "radio", className: input(), ...rest }),
|
|
14
|
+
label ? /* @__PURE__ */ jsx("label", { htmlFor: id, className: labelStyle(), children: label }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
22
19
|
|
|
23
20
|
export { RadioButton };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { snackbar } from '@tecsinapse/cortex-core';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
3
|
|
|
5
|
-
const BaseSnackbar =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
);
|
|
4
|
+
const BaseSnackbar = (props) => {
|
|
5
|
+
const { children, show, variants, ref } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx(Fragment, { children: show ? /* @__PURE__ */ jsx("div", { className: snackbar(variants), ref, "data-testid": "snackbar", children }) : /* @__PURE__ */ jsx(Fragment, {}) });
|
|
7
|
+
};
|
|
11
8
|
|
|
12
9
|
export { BaseSnackbar };
|
|
@@ -12,8 +12,11 @@ const Root = ({
|
|
|
12
12
|
const initialSelectedIndex = useMemo(() => {
|
|
13
13
|
let initialIndex = null;
|
|
14
14
|
React.Children.forEach(children, (child, index) => {
|
|
15
|
-
if (React.isValidElement(child)
|
|
16
|
-
|
|
15
|
+
if (React.isValidElement(child)) {
|
|
16
|
+
const element = child;
|
|
17
|
+
if (element.props.selected) {
|
|
18
|
+
initialIndex = index;
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
});
|
|
19
22
|
return initialIndex;
|
|
@@ -39,13 +42,14 @@ const Root = ({
|
|
|
39
42
|
const renderNode = useMemo(
|
|
40
43
|
() => (child, index) => {
|
|
41
44
|
if (React.isValidElement(child) && child.type === Node) {
|
|
42
|
-
|
|
45
|
+
const element = child;
|
|
46
|
+
return React.cloneElement(element, {
|
|
43
47
|
isFirst: index === 0,
|
|
44
48
|
isLast: index === childrenCount - 1,
|
|
45
49
|
selected: selectedNode === index,
|
|
46
50
|
segmented,
|
|
47
51
|
interactive,
|
|
48
|
-
onClick: () => handleNodeClick(index,
|
|
52
|
+
onClick: () => handleNodeClick(index, element.props.onClick)
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
return null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { tag } from '@tecsinapse/cortex-core';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
3
|
import { LiaTimesSolid } from 'react-icons/lia';
|
|
5
4
|
|
|
6
5
|
const Close = ({
|
|
@@ -26,8 +25,8 @@ const Label = ({
|
|
|
26
25
|
}) => {
|
|
27
26
|
return /* @__PURE__ */ jsx("p", { className, ...rest, children });
|
|
28
27
|
};
|
|
29
|
-
const Face =
|
|
30
|
-
const { variants, className, intent, children, style, ...rest } = props;
|
|
28
|
+
const Face = (props) => {
|
|
29
|
+
const { variants, className, intent, children, style, ref, ...rest } = props;
|
|
31
30
|
return /* @__PURE__ */ jsx(
|
|
32
31
|
"div",
|
|
33
32
|
{
|
|
@@ -42,26 +41,24 @@ const Face = forwardRef((props, ref) => {
|
|
|
42
41
|
children
|
|
43
42
|
}
|
|
44
43
|
);
|
|
45
|
-
}
|
|
46
|
-
const Root =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
);
|
|
44
|
+
};
|
|
45
|
+
const Root = (props) => {
|
|
46
|
+
const { label, variants, intent, className, onDismiss, ref, ...rest } = props;
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
Face,
|
|
49
|
+
{
|
|
50
|
+
...rest,
|
|
51
|
+
variants,
|
|
52
|
+
intent,
|
|
53
|
+
className,
|
|
54
|
+
ref,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Label, { children: label }),
|
|
57
|
+
onDismiss ? /* @__PURE__ */ jsx(Close, { onClick: onDismiss }) : null
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
65
62
|
const Tag = {
|
|
66
63
|
Root,
|
|
67
64
|
Close,
|
|
@@ -7,7 +7,9 @@ import { getValidChildren } from './utils.js';
|
|
|
7
7
|
const TextAreaFace = React.forwardRef(
|
|
8
8
|
({ children, variants, className, ...rest }, ref) => {
|
|
9
9
|
const clones = getValidChildren(children).map((el) => {
|
|
10
|
-
|
|
10
|
+
const element = el;
|
|
11
|
+
const elProps = element.props || {};
|
|
12
|
+
return React.cloneElement(element, { ...elProps, variants });
|
|
11
13
|
});
|
|
12
14
|
return /* @__PURE__ */ jsx(
|
|
13
15
|
"div",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { styleLabelElement, styleInputElement, toggle } from '@tecsinapse/cortex-core';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
3
|
|
|
5
|
-
const Toggle =
|
|
4
|
+
const Toggle = (props) => {
|
|
5
|
+
const { ref, ...rest } = props;
|
|
6
6
|
return /* @__PURE__ */ jsx(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
@@ -16,13 +16,13 @@ const Toggle = forwardRef((props, ref) => {
|
|
|
16
16
|
className: styleInputElement(),
|
|
17
17
|
ref,
|
|
18
18
|
"data-testid": "toggle-input",
|
|
19
|
-
...
|
|
19
|
+
...rest
|
|
20
20
|
}
|
|
21
21
|
),
|
|
22
22
|
/* @__PURE__ */ jsx("div", { className: toggle() })
|
|
23
23
|
] })
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
export { Toggle };
|
|
@@ -7,13 +7,13 @@ import { clsx } from 'clsx';
|
|
|
7
7
|
import { IoChevronUp, IoChevronDown } from 'react-icons/io5';
|
|
8
8
|
import { manager } from '@tecsinapse/cortex-core';
|
|
9
9
|
import { useManagerHelpers } from '../../hooks/useManagerHelpers.js';
|
|
10
|
-
import { Loading } from '../Loading.js';
|
|
11
10
|
|
|
12
11
|
const Manager = ({
|
|
13
12
|
open,
|
|
14
13
|
files,
|
|
15
14
|
onDelete,
|
|
16
15
|
uploadProgressText = "Upload(s) in progress",
|
|
16
|
+
uploadSuccessText = "Upload(s) completed",
|
|
17
17
|
onClose
|
|
18
18
|
}) => {
|
|
19
19
|
const {
|
|
@@ -45,14 +45,14 @@ const Manager = ({
|
|
|
45
45
|
children: min ? /* @__PURE__ */ jsx(IoChevronUp, {}) : /* @__PURE__ */ jsx(IoChevronDown, {})
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
/* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", children: uploadProgressText }),
|
|
48
|
+
/* @__PURE__ */ jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadSuccessText }),
|
|
49
49
|
/* @__PURE__ */ jsx(
|
|
50
50
|
Button,
|
|
51
51
|
{
|
|
52
52
|
variants: { variant: "filled", size: "square" },
|
|
53
53
|
onClick: onClose,
|
|
54
54
|
disabled: isLoading,
|
|
55
|
-
children:
|
|
55
|
+
children: /* @__PURE__ */ jsx(IoMdClose, {})
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] }),
|
|
@@ -42,6 +42,15 @@ const File = ({
|
|
|
42
42
|
return "info";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
const formatFileSize = (size) => {
|
|
46
|
+
const units = ["B", "KB", "MB", "GB"];
|
|
47
|
+
let i = 0;
|
|
48
|
+
while (size >= 1024 && i < units.length - 1) {
|
|
49
|
+
size /= 1024;
|
|
50
|
+
i++;
|
|
51
|
+
}
|
|
52
|
+
return `${size.toFixed(2)} ${units[i]}`;
|
|
53
|
+
};
|
|
45
54
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col w-full", children: [
|
|
46
55
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border rounded-t-mili shadow p-mili", children: [
|
|
47
56
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-centi", children: [
|
|
@@ -55,10 +64,7 @@ const File = ({
|
|
|
55
64
|
) : /* @__PURE__ */ jsx("span", { className: "border-2 text-kilo text-primary-medium w-tera h-tera flex items-center justify-center rounded-mili", children: /* @__PURE__ */ jsx(FaRegFileLines, {}) }),
|
|
56
65
|
/* @__PURE__ */ jsxs("div", { className: "flex-col", children: [
|
|
57
66
|
/* @__PURE__ */ jsx("p", { className: "font-semibold truncate max-w-[200px]", children: file.file.name }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
(file.file.size / 1024).toFixed(2),
|
|
60
|
-
" KB"
|
|
61
|
-
] })
|
|
67
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: formatFileSize(file.file.size) })
|
|
62
68
|
] })
|
|
63
69
|
] }),
|
|
64
70
|
file.status === "success" && showDelete ? /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef, useState, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
function useDebouncedState(initialState, timeoutCallback, timeoutMs = 166) {
|
|
4
|
-
const timeoutId = useRef();
|
|
4
|
+
const timeoutId = useRef(void 0);
|
|
5
5
|
const [state, setState] = useState(initialState);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (timeoutId.current) clearTimeout(timeoutId.current);
|
|
@@ -27,7 +27,8 @@ const useFileUpload = ({
|
|
|
27
27
|
isFolder = false,
|
|
28
28
|
noClick = false,
|
|
29
29
|
ignoreRejections = false,
|
|
30
|
-
uploadProgressText
|
|
30
|
+
uploadProgressText,
|
|
31
|
+
uploadSuccessText
|
|
31
32
|
}) => {
|
|
32
33
|
const {
|
|
33
34
|
showManager,
|
|
@@ -96,7 +97,8 @@ const useFileUpload = ({
|
|
|
96
97
|
showManager?.({
|
|
97
98
|
onClose: closeManager,
|
|
98
99
|
onDelete: handleRemoveFile,
|
|
99
|
-
uploadProgressText
|
|
100
|
+
uploadProgressText,
|
|
101
|
+
uploadSuccessText
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
104
|
}, [handleRemoveFile, closeManager]);
|
|
@@ -7,8 +7,7 @@ import 'react-icons/lia';
|
|
|
7
7
|
import '@internationalized/date';
|
|
8
8
|
import '../components/Badge.js';
|
|
9
9
|
import 'react-icons/md';
|
|
10
|
-
import '
|
|
11
|
-
import '../components/Button.js';
|
|
10
|
+
import '@tecsinapse/cortex-core';
|
|
12
11
|
import 'react-aria';
|
|
13
12
|
import 'react-stately';
|
|
14
13
|
import './MenubarContext.js';
|
|
@@ -21,17 +20,14 @@ import { FileStatus } from '../components/Uploader/types.js';
|
|
|
21
20
|
import '@floating-ui/react';
|
|
22
21
|
import 'currency.js';
|
|
23
22
|
import '../components/Calendar/CalendarCell.js';
|
|
24
|
-
import '@tecsinapse/cortex-core';
|
|
25
23
|
import 'react-icons/fa';
|
|
26
24
|
import 'react-icons/io';
|
|
27
25
|
import 'embla-carousel-react';
|
|
28
26
|
import 'embla-carousel-autoplay';
|
|
29
|
-
import '../components/Checkbox.js';
|
|
30
27
|
import '../components/ColorPicker.js';
|
|
31
28
|
import '../components/DatePicker/DateSegment.js';
|
|
32
29
|
import '../components/DatePicker/DatePickerInputBase.js';
|
|
33
30
|
import '../components/GroupButton.js';
|
|
34
|
-
import '../components/Hint.js';
|
|
35
31
|
import '../components/Input/Box.js';
|
|
36
32
|
import '../components/Input/Face.js';
|
|
37
33
|
import '../components/Input/Left.js';
|
|
@@ -49,7 +45,6 @@ import '../components/Menubar/Header.js';
|
|
|
49
45
|
import '../components/Menubar/Item.js';
|
|
50
46
|
import './CategoriesContext.js';
|
|
51
47
|
import '../components/Menubar/SubItem.js';
|
|
52
|
-
import '../components/Modal.js';
|
|
53
48
|
import '../components/ProgressBar/Progress.js';
|
|
54
49
|
import '../components/RadioButton.js';
|
|
55
50
|
import '../components/Select/GroupedOptions.js';
|
|
@@ -58,16 +53,13 @@ import '../components/Select/MultiGroupedOptions.js';
|
|
|
58
53
|
import '../components/Select/MultiOptions.js';
|
|
59
54
|
import '../components/Select/Options.js';
|
|
60
55
|
import '../components/Select/Trigger.js';
|
|
61
|
-
import '../components/Snackbar/BaseSnackbar.js';
|
|
62
56
|
import '../styles/stepNodeVariants.js';
|
|
63
|
-
import '../components/Tag.js';
|
|
64
57
|
import '../components/TextArea/Box.js';
|
|
65
58
|
import '../components/TextArea/Face.js';
|
|
66
59
|
import '../components/TextArea/Left.js';
|
|
67
60
|
import '../components/TextArea/Right.js';
|
|
68
61
|
import '../components/TextArea/Root.js';
|
|
69
62
|
import '../components/TimePicker/TimeFieldInput.js';
|
|
70
|
-
import '../components/Toggle.js';
|
|
71
63
|
import '../components/Tooltip.js';
|
|
72
64
|
import 'react-icons/hi2';
|
|
73
65
|
import 'react-icons/fa6';
|
|
@@ -6,5 +6,6 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
6
6
|
variant?: ButtonVariants['variant'];
|
|
7
7
|
size?: ButtonVariants['size'];
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
9
10
|
}
|
|
10
|
-
export declare const Button:
|
|
11
|
+
export declare const Button: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
4
5
|
}
|
|
5
|
-
export declare const Card:
|
|
6
|
+
export declare const Card: (props: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
export interface CheckboxProps extends HTMLAttributes<HTMLInputElement> {
|
|
3
3
|
indeterminate?: boolean;
|
|
4
|
+
ref?: React.Ref<CheckboxRef>;
|
|
4
5
|
}
|
|
5
6
|
export interface CheckboxRef extends HTMLAttributes<HTMLInputElement> {
|
|
6
7
|
setIndeterminate: (value: boolean) => void;
|
|
7
8
|
}
|
|
8
|
-
export declare const Checkbox:
|
|
9
|
+
export declare const Checkbox: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HintVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface HintProps {
|
|
2
|
+
import React, { HTMLProps } from 'react';
|
|
3
|
+
export interface HintProps extends Omit<HTMLProps<HTMLDivElement>, 'className'> {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
variants?: HintVariants;
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
6
7
|
}
|
|
7
|
-
export declare const Hint:
|
|
8
|
+
export declare const Hint: (props: HintProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
export interface MasonryProps {
|
|
3
3
|
columns: number;
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const Masonry: ({ children, columns }: MasonryProps) =>
|
|
6
|
+
declare const Masonry: ({ children, columns }: MasonryProps) => React.ReactElement;
|
|
7
7
|
export default Masonry;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode, type DialogHTMLAttributes } from 'react';
|
|
2
|
-
interface ModalProps {
|
|
2
|
+
interface ModalProps extends DialogHTMLAttributes<HTMLDialogElement> {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
children?: ReactNode;
|
|
6
|
+
ref?: React.Ref<HTMLDialogElement>;
|
|
6
7
|
}
|
|
7
|
-
export declare const Modal:
|
|
8
|
+
export declare const Modal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -2,5 +2,6 @@ import React, { InputHTMLAttributes } from 'react';
|
|
|
2
2
|
export interface RadioButtonProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
label?: string;
|
|
4
4
|
reversed?: boolean;
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5
6
|
}
|
|
6
|
-
export declare const RadioButton:
|
|
7
|
+
export declare const RadioButton: ({ label, reversed, id, ref, ...rest }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,6 @@ export declare const useMultiSelectOption: <T>(option: T, onSelect?: (option: T[
|
|
|
3
3
|
value: any;
|
|
4
4
|
isChecked: boolean;
|
|
5
5
|
onClickOption: () => void;
|
|
6
|
-
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
6
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
7
7
|
labelExtractor: (value: any) => string;
|
|
8
8
|
};
|
|
@@ -4,6 +4,7 @@ interface SnackbarProps {
|
|
|
4
4
|
variants?: SnackbarVariants;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
show: boolean;
|
|
7
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
8
|
}
|
|
8
|
-
export declare const BaseSnackbar:
|
|
9
|
+
export declare const BaseSnackbar: (props: SnackbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { TagVariants } from '@tecsinapse/cortex-core';
|
|
2
2
|
import React, { HTMLProps } from 'react';
|
|
3
|
-
export interface TagProps {
|
|
3
|
+
export interface TagProps extends HTMLProps<HTMLDivElement> {
|
|
4
4
|
variants?: TagVariants;
|
|
5
5
|
intent?: TagVariants['intent'];
|
|
6
6
|
label: string;
|
|
7
7
|
onDismiss?: () => void;
|
|
8
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
9
|
+
}
|
|
10
|
+
interface FaceProps extends Pick<TagProps, 'variants' | 'intent'>, HTMLProps<HTMLDivElement> {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
8
12
|
}
|
|
9
13
|
export declare const Tag: {
|
|
10
|
-
Root:
|
|
14
|
+
Root: (props: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
Close: ({ onClick, className, ...rest }: Omit<HTMLProps<HTMLButtonElement>, "children" | "type">) => import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
Label: ({ children, className, ...rest }: HTMLProps<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
Face:
|
|
17
|
+
Face: (props: FaceProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
18
|
};
|
|
19
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface ToggleProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
4
|
+
}
|
|
5
|
+
export declare const Toggle: (props: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ManagerProps } from './types';
|
|
2
|
-
export declare const Manager: <T>({ open, files, onDelete, uploadProgressText, onClose, }: ManagerProps<T>) => any;
|
|
2
|
+
export declare const Manager: <T>({ open, files, onDelete, uploadProgressText, uploadSuccessText, onClose, }: ManagerProps<T>) => any;
|
|
@@ -5,5 +5,5 @@ export declare const Uploader: {
|
|
|
5
5
|
Files: <T>({ files, onDelete, uploadProgressText, }: import("./types").FilesProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Modal: ({ open, onClose, children, title, }: import("./types").ModalProps) => any;
|
|
7
7
|
Root: <T>({ open, onClose, dropzoneProps, selectFileText, dropText, buttonText, titleModal, onDelete, uploadProgressText, files, }: import("./types").RootUploaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
Manager: <T>({ open, files, onDelete, uploadProgressText, onClose, }: import("./types").ManagerProps<T>) => any;
|
|
8
|
+
Manager: <T>({ open, files, onDelete, uploadProgressText, uploadSuccessText, onClose, }: import("./types").ManagerProps<T>) => any;
|
|
9
9
|
};
|
|
@@ -5,7 +5,7 @@ interface useCalendarCellProps {
|
|
|
5
5
|
date: CalendarDate;
|
|
6
6
|
}
|
|
7
7
|
export declare const useCalendarCell: ({ state, date }: useCalendarCellProps) => {
|
|
8
|
-
ref: import("react").
|
|
8
|
+
ref: import("react").RefObject<null>;
|
|
9
9
|
cellProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
10
10
|
buttonProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
11
11
|
isSelected: boolean;
|
|
@@ -7,6 +7,6 @@ interface useDatePickerInputProps {
|
|
|
7
7
|
export declare const useDatePickerInput: ({ value, onChange, minValue, maxValue, }: useDatePickerInputProps) => {
|
|
8
8
|
fieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
9
9
|
state: import("react-stately").DatePickerState;
|
|
10
|
-
ref: import("react").
|
|
10
|
+
ref: import("react").RefObject<null>;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -9,6 +9,6 @@ export declare const useDateRangePickerInput: ({ value, onChange, minValue, maxV
|
|
|
9
9
|
startFieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
10
10
|
endFieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
11
11
|
state: import("react-stately").DateRangePickerState;
|
|
12
|
-
ref: import("react").
|
|
12
|
+
ref: import("react").RefObject<null>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -18,10 +18,11 @@ interface UseFileUploadOptions {
|
|
|
18
18
|
hasManager?: boolean;
|
|
19
19
|
isFolder?: boolean;
|
|
20
20
|
uploadProgressText?: string;
|
|
21
|
+
uploadSuccessText?: string;
|
|
21
22
|
noClick?: boolean;
|
|
22
23
|
ignoreRejections?: boolean;
|
|
23
24
|
}
|
|
24
|
-
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, noClick, ignoreRejections, uploadProgressText, }: UseFileUploadOptions) => {
|
|
25
|
+
export declare const useFileUpload: <T>({ accept, onAccept, onOpenManager, onFileRejected, maxSize, allowMultiple, preventDuplicates, onDuplicate, hasManager, isFolder, noClick, ignoreRejections, uploadProgressText, uploadSuccessText, }: UseFileUploadOptions) => {
|
|
25
26
|
onOpen: () => void;
|
|
26
27
|
onClose: () => void;
|
|
27
28
|
onDelete: (index: number) => void;
|
|
@@ -9,6 +9,6 @@ export declare const useRangeCalendar: ({ value, onChange, minValue, maxValue, }
|
|
|
9
9
|
calendarProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
10
10
|
title: string;
|
|
11
11
|
state: import("react-stately").RangeCalendarState;
|
|
12
|
-
ref: import("react").
|
|
12
|
+
ref: import("react").RefObject<null>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function cloneWithProps(children: React.ReactElement, props:
|
|
2
|
+
export declare function cloneWithProps(children: React.ReactElement, props: React.HTMLAttributes<HTMLDivElement>): React.FunctionComponentElement<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.15.0-beta.
|
|
3
|
+
"version": "1.15.0-beta.26",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react": "^0.26.18",
|
|
22
22
|
"@internationalized/date": "3.7.0",
|
|
23
|
-
"@tecsinapse/cortex-core": "1.2.0-beta.
|
|
23
|
+
"@tecsinapse/cortex-core": "1.2.0-beta.15",
|
|
24
24
|
"clsx": "2.1.1",
|
|
25
25
|
"currency.js": "2.0.4",
|
|
26
26
|
"embla-carousel-autoplay": "^8.0.0",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://tecsinapse.github.io/design-system/",
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"react": ">=18.0.0",
|
|
47
|
-
"react-dom": ">=18.0.0",
|
|
46
|
+
"react": ">=18.0.0 || ^19.0.0",
|
|
47
|
+
"react-dom": ">=18.0.0 || ^19.0.0",
|
|
48
48
|
"react-icons": ">=5.2.0",
|
|
49
|
-
"
|
|
49
|
+
"tailwindcss": "^4.1.16"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
-
}
|
|
51
|
+
"gitHead": "ca3d4658b6b1481f91f52838f667c41cc1da0579"
|
|
52
|
+
}
|