@tecsinapse/cortex-react 1.14.1-beta.0 → 1.14.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/Button.js +4 -3
- package/dist/cjs/components/Card.js +4 -3
- package/dist/cjs/components/Checkbox.js +3 -3
- package/dist/cjs/components/Hint.js +5 -4
- package/dist/cjs/components/Input/Face.js +1 -2
- package/dist/cjs/components/Modal.js +4 -3
- package/dist/cjs/components/Popover/Trigger.js +1 -1
- package/dist/cjs/components/RadioButton.js +17 -14
- package/dist/cjs/components/Snackbar/BaseSnackbar.js +7 -4
- package/dist/cjs/components/Tag.js +23 -20
- package/dist/cjs/components/TextArea/Face.js +1 -2
- package/dist/cjs/components/Toggle.js +4 -4
- package/dist/cjs/hooks/useDebouncedState.js +1 -1
- package/dist/esm/components/Button.js +4 -3
- package/dist/esm/components/Card.js +4 -3
- package/dist/esm/components/Checkbox.js +4 -4
- package/dist/esm/components/Hint.js +5 -4
- package/dist/esm/components/Input/Face.js +1 -2
- package/dist/esm/components/Modal.js +4 -3
- package/dist/esm/components/Popover/Trigger.js +1 -1
- package/dist/esm/components/RadioButton.js +17 -14
- package/dist/esm/components/Snackbar/BaseSnackbar.js +7 -4
- package/dist/esm/components/Tag.js +23 -20
- package/dist/esm/components/TextArea/Face.js +1 -2
- package/dist/esm/components/Toggle.js +4 -4
- package/dist/esm/hooks/useDebouncedState.js +1 -1
- package/dist/types/components/Button.d.ts +1 -2
- package/dist/types/components/Card.d.ts +1 -2
- package/dist/types/components/Checkbox.d.ts +1 -2
- package/dist/types/components/Hint.d.ts +3 -4
- package/dist/types/components/Masonry.d.ts +2 -2
- package/dist/types/components/Modal.d.ts +2 -3
- package/dist/types/components/RadioButton.d.ts +1 -2
- package/dist/types/components/Select/useMultiSelectOption.d.ts +1 -1
- package/dist/types/components/Snackbar/BaseSnackbar.d.ts +1 -2
- package/dist/types/components/Tag.d.ts +3 -8
- package/dist/types/components/Toggle.d.ts +2 -5
- 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/useRangeCalendar.d.ts +1 -1
- package/package.json +5 -5
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const Button = (props) => {
|
|
7
|
-
const { variants, intent, variant, size, children, className,
|
|
7
|
+
const Button = React.forwardRef((props, ref) => {
|
|
8
|
+
const { variants, intent, variant, size, children, className, ...rest } = props;
|
|
8
9
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
10
|
"button",
|
|
10
11
|
{
|
|
@@ -14,6 +15,6 @@ const Button = (props) => {
|
|
|
14
15
|
children
|
|
15
16
|
}
|
|
16
17
|
);
|
|
17
|
-
};
|
|
18
|
+
});
|
|
18
19
|
|
|
19
20
|
exports.Button = Button;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const Card = (props) => {
|
|
7
|
-
const { children, className,
|
|
7
|
+
const Card = React.forwardRef((props, ref) => {
|
|
8
|
+
const { children, className, ...rest } = props;
|
|
8
9
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.card({ className }), ref, ...rest, children });
|
|
9
|
-
};
|
|
10
|
+
});
|
|
10
11
|
|
|
11
12
|
exports.Card = Card;
|
|
@@ -4,9 +4,9 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
7
|
-
const Checkbox = (props) => {
|
|
7
|
+
const Checkbox = React.forwardRef((props, ref) => {
|
|
8
8
|
const localRef = React.useRef(null);
|
|
9
|
-
const { className, indeterminate,
|
|
9
|
+
const { className, indeterminate, ...rest } = props;
|
|
10
10
|
const setIndeterminate = React.useCallback((value) => {
|
|
11
11
|
if (localRef?.current) {
|
|
12
12
|
localRef.current.indeterminate = value;
|
|
@@ -31,6 +31,6 @@ const Checkbox = (props) => {
|
|
|
31
31
|
...rest
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
|
-
};
|
|
34
|
+
});
|
|
35
35
|
|
|
36
36
|
exports.Checkbox = Checkbox;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const Hint = (props) => {
|
|
7
|
-
const { children, variants
|
|
8
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.hint(variants), ref,
|
|
9
|
-
};
|
|
7
|
+
const Hint = React.forwardRef((props, ref) => {
|
|
8
|
+
const { children, variants } = props;
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.hint(variants), ref, children: children ?? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
|
|
10
|
+
});
|
|
10
11
|
|
|
11
12
|
exports.Hint = Hint;
|
|
@@ -13,8 +13,7 @@ const getValidChildren = (children) => {
|
|
|
13
13
|
const InputFace = React.forwardRef(
|
|
14
14
|
({ children, variants, className, ...rest }, ref) => {
|
|
15
15
|
const clones = getValidChildren(children).map((el) => {
|
|
16
|
-
|
|
17
|
-
return React.cloneElement(el, { ...elProps, variants });
|
|
16
|
+
return React.cloneElement(el, { ...el.props, variants });
|
|
18
17
|
});
|
|
19
18
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
19
|
"div",
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const Modal = (props) => {
|
|
7
|
-
const { open, onClose, children, className,
|
|
7
|
+
const Modal = React.forwardRef((props, ref) => {
|
|
8
|
+
const { open, onClose, children, className, ...rest } = props;
|
|
8
9
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9
10
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10
11
|
"div",
|
|
@@ -25,6 +26,6 @@ const Modal = (props) => {
|
|
|
25
26
|
}
|
|
26
27
|
)
|
|
27
28
|
] });
|
|
28
|
-
};
|
|
29
|
+
});
|
|
29
30
|
|
|
30
31
|
exports.Modal = Modal;
|
|
@@ -13,7 +13,7 @@ const isDisabledProps = {
|
|
|
13
13
|
};
|
|
14
14
|
const PopoverTrigger = ({ children, disabled }) => {
|
|
15
15
|
const { triggerProps } = Context.usePopoverContext();
|
|
16
|
-
const isDisabled = disabled ?? children
|
|
16
|
+
const isDisabled = disabled ?? children.props?.disabled;
|
|
17
17
|
return react.cloneWithProps(children, {
|
|
18
18
|
...triggerProps,
|
|
19
19
|
...isDisabled ? isDisabledProps : {}
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
7
|
const { container, input, label: labelStyle } = cortexCore.radioButtonStyles();
|
|
7
|
-
const RadioButton = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const RadioButton = React.forwardRef(
|
|
9
|
+
({ label, reversed, id, ...rest }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: container({ reversed }),
|
|
14
|
+
ref,
|
|
15
|
+
"data-testid": "radio-button-container",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { id, type: "radio", className: input(), ...rest }),
|
|
18
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: labelStyle(), children: label }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
exports.RadioButton = RadioButton;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const BaseSnackbar = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
7
|
+
const BaseSnackbar = React.forwardRef(
|
|
8
|
+
(props, ref) => {
|
|
9
|
+
const { children, show, variants } = props;
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: show ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.snackbar(variants), ref, "data-testid": "snackbar", children }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
10
13
|
|
|
11
14
|
exports.BaseSnackbar = BaseSnackbar;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
var lia = require('react-icons/lia');
|
|
6
7
|
|
|
7
8
|
const Close = ({
|
|
@@ -27,8 +28,8 @@ const Label = ({
|
|
|
27
28
|
}) => {
|
|
28
29
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className, ...rest, children });
|
|
29
30
|
};
|
|
30
|
-
const Face = (props) => {
|
|
31
|
-
const { variants, className, intent, children, style,
|
|
31
|
+
const Face = React.forwardRef((props, ref) => {
|
|
32
|
+
const { variants, className, intent, children, style, ...rest } = props;
|
|
32
33
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
34
|
"div",
|
|
34
35
|
{
|
|
@@ -43,24 +44,26 @@ const Face = (props) => {
|
|
|
43
44
|
children
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
|
-
};
|
|
47
|
-
const Root = (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
});
|
|
48
|
+
const Root = React.forwardRef(
|
|
49
|
+
(props, ref) => {
|
|
50
|
+
const { label, variants, intent, className, onDismiss, ...rest } = props;
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52
|
+
Face,
|
|
53
|
+
{
|
|
54
|
+
...rest,
|
|
55
|
+
variants,
|
|
56
|
+
intent,
|
|
57
|
+
className,
|
|
58
|
+
ref,
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
|
|
61
|
+
onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(Close, { onClick: onDismiss }) : null
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
64
67
|
const Tag = {
|
|
65
68
|
Root,
|
|
66
69
|
Close,
|
|
@@ -9,8 +9,7 @@ var utils = require('./utils.js');
|
|
|
9
9
|
const TextAreaFace = React.forwardRef(
|
|
10
10
|
({ children, variants, className, ...rest }, ref) => {
|
|
11
11
|
const clones = utils.getValidChildren(children).map((el) => {
|
|
12
|
-
|
|
13
|
-
return React.cloneElement(el, { ...elProps, variants });
|
|
12
|
+
return React.cloneElement(el, { ...el.props, variants });
|
|
14
13
|
});
|
|
15
14
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
15
|
"div",
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var cortexCore = require('@tecsinapse/cortex-core');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
|
|
6
|
-
const Toggle = (props) => {
|
|
7
|
-
const { ref, ...rest } = props;
|
|
7
|
+
const Toggle = React.forwardRef((props, ref) => {
|
|
8
8
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
@@ -18,13 +18,13 @@ const Toggle = (props) => {
|
|
|
18
18
|
className: cortexCore.styleInputElement(),
|
|
19
19
|
ref,
|
|
20
20
|
"data-testid": "toggle-input",
|
|
21
|
-
...
|
|
21
|
+
...props
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
24
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.toggle() })
|
|
25
25
|
] })
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
|
-
};
|
|
28
|
+
});
|
|
29
29
|
|
|
30
30
|
exports.Toggle = Toggle;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
5
|
function useDebouncedState(initialState, timeoutCallback, timeoutMs = 166) {
|
|
6
|
-
const timeoutId = React.useRef(
|
|
6
|
+
const timeoutId = React.useRef();
|
|
7
7
|
const [state, setState] = React.useState(initialState);
|
|
8
8
|
React.useEffect(() => {
|
|
9
9
|
if (timeoutId.current) clearTimeout(timeoutId.current);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { button } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
|
-
const Button = (props) => {
|
|
5
|
-
const { variants, intent, variant, size, children, className,
|
|
5
|
+
const Button = forwardRef((props, ref) => {
|
|
6
|
+
const { variants, intent, variant, size, children, className, ...rest } = props;
|
|
6
7
|
return /* @__PURE__ */ jsx(
|
|
7
8
|
"button",
|
|
8
9
|
{
|
|
@@ -12,6 +13,6 @@ const Button = (props) => {
|
|
|
12
13
|
children
|
|
13
14
|
}
|
|
14
15
|
);
|
|
15
|
-
};
|
|
16
|
+
});
|
|
16
17
|
|
|
17
18
|
export { Button };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { card } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
|
-
const Card = (props) => {
|
|
5
|
-
const { children, className,
|
|
5
|
+
const Card = forwardRef((props, ref) => {
|
|
6
|
+
const { children, className, ...rest } = props;
|
|
6
7
|
return /* @__PURE__ */ jsx("div", { className: card({ className }), ref, ...rest, children });
|
|
7
|
-
};
|
|
8
|
+
});
|
|
8
9
|
|
|
9
10
|
export { Card };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { checkbox } from '@tecsinapse/cortex-core';
|
|
3
|
-
import { useRef, useCallback, useEffect, useImperativeHandle } from 'react';
|
|
3
|
+
import { forwardRef, useRef, useCallback, useEffect, useImperativeHandle } from 'react';
|
|
4
4
|
|
|
5
|
-
const Checkbox = (props) => {
|
|
5
|
+
const Checkbox = forwardRef((props, ref) => {
|
|
6
6
|
const localRef = useRef(null);
|
|
7
|
-
const { className, indeterminate,
|
|
7
|
+
const { className, indeterminate, ...rest } = props;
|
|
8
8
|
const setIndeterminate = useCallback((value) => {
|
|
9
9
|
if (localRef?.current) {
|
|
10
10
|
localRef.current.indeterminate = value;
|
|
@@ -29,6 +29,6 @@ const Checkbox = (props) => {
|
|
|
29
29
|
...rest
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
|
-
};
|
|
32
|
+
});
|
|
33
33
|
|
|
34
34
|
export { Checkbox };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { hint } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
|
-
const Hint = (props) => {
|
|
5
|
-
const { children, variants
|
|
6
|
-
return /* @__PURE__ */ jsx("div", { className: hint(variants), ref,
|
|
7
|
-
};
|
|
5
|
+
const Hint = forwardRef((props, ref) => {
|
|
6
|
+
const { children, variants } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: hint(variants), ref, children: children ?? /* @__PURE__ */ jsx(Fragment, {}) });
|
|
8
|
+
});
|
|
8
9
|
|
|
9
10
|
export { Hint };
|
|
@@ -11,8 +11,7 @@ const getValidChildren = (children) => {
|
|
|
11
11
|
const InputFace = React.forwardRef(
|
|
12
12
|
({ children, variants, className, ...rest }, ref) => {
|
|
13
13
|
const clones = getValidChildren(children).map((el) => {
|
|
14
|
-
|
|
15
|
-
return React.cloneElement(el, { ...elProps, variants });
|
|
14
|
+
return React.cloneElement(el, { ...el.props, variants });
|
|
16
15
|
});
|
|
17
16
|
return /* @__PURE__ */ jsx(
|
|
18
17
|
"div",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { overlay, modal } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
|
-
const Modal = (props) => {
|
|
5
|
-
const { open, onClose, children, className,
|
|
5
|
+
const Modal = forwardRef((props, ref) => {
|
|
6
|
+
const { open, onClose, children, className, ...rest } = props;
|
|
6
7
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7
8
|
/* @__PURE__ */ jsx(
|
|
8
9
|
"div",
|
|
@@ -23,6 +24,6 @@ const Modal = (props) => {
|
|
|
23
24
|
}
|
|
24
25
|
)
|
|
25
26
|
] });
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
|
|
28
29
|
export { Modal };
|
|
@@ -11,7 +11,7 @@ const isDisabledProps = {
|
|
|
11
11
|
};
|
|
12
12
|
const PopoverTrigger = ({ children, disabled }) => {
|
|
13
13
|
const { triggerProps } = usePopoverContext();
|
|
14
|
-
const isDisabled = disabled ?? children
|
|
14
|
+
const isDisabled = disabled ?? children.props?.disabled;
|
|
15
15
|
return cloneWithProps(children, {
|
|
16
16
|
...triggerProps,
|
|
17
17
|
...isDisabled ? isDisabledProps : {}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { radioButtonStyles } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
5
|
const { container, input, label: labelStyle } = radioButtonStyles();
|
|
5
|
-
const RadioButton = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const RadioButton = forwardRef(
|
|
7
|
+
({ label, reversed, id, ...rest }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: container({ reversed }),
|
|
12
|
+
ref,
|
|
13
|
+
"data-testid": "radio-button-container",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx("input", { id, type: "radio", className: input(), ...rest }),
|
|
16
|
+
label ? /* @__PURE__ */ jsx("label", { htmlFor: id, className: labelStyle(), children: label }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
19
22
|
|
|
20
23
|
export { RadioButton };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { snackbar } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
|
|
4
|
-
const BaseSnackbar = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
5
|
+
const BaseSnackbar = forwardRef(
|
|
6
|
+
(props, ref) => {
|
|
7
|
+
const { children, show, variants } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(Fragment, { children: show ? /* @__PURE__ */ jsx("div", { className: snackbar(variants), ref, "data-testid": "snackbar", children }) : /* @__PURE__ */ jsx(Fragment, {}) });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
8
11
|
|
|
9
12
|
export { BaseSnackbar };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { tag } from '@tecsinapse/cortex-core';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { LiaTimesSolid } from 'react-icons/lia';
|
|
4
5
|
|
|
5
6
|
const Close = ({
|
|
@@ -25,8 +26,8 @@ const Label = ({
|
|
|
25
26
|
}) => {
|
|
26
27
|
return /* @__PURE__ */ jsx("p", { className, ...rest, children });
|
|
27
28
|
};
|
|
28
|
-
const Face = (props) => {
|
|
29
|
-
const { variants, className, intent, children, style,
|
|
29
|
+
const Face = forwardRef((props, ref) => {
|
|
30
|
+
const { variants, className, intent, children, style, ...rest } = props;
|
|
30
31
|
return /* @__PURE__ */ jsx(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
@@ -41,24 +42,26 @@ const Face = (props) => {
|
|
|
41
42
|
children
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
|
-
};
|
|
45
|
-
const Root = (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
});
|
|
46
|
+
const Root = forwardRef(
|
|
47
|
+
(props, ref) => {
|
|
48
|
+
const { label, variants, intent, className, onDismiss, ...rest } = props;
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
Face,
|
|
51
|
+
{
|
|
52
|
+
...rest,
|
|
53
|
+
variants,
|
|
54
|
+
intent,
|
|
55
|
+
className,
|
|
56
|
+
ref,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Label, { children: label }),
|
|
59
|
+
onDismiss ? /* @__PURE__ */ jsx(Close, { onClick: onDismiss }) : null
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
62
65
|
const Tag = {
|
|
63
66
|
Root,
|
|
64
67
|
Close,
|
|
@@ -7,8 +7,7 @@ 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
|
-
|
|
11
|
-
return React.cloneElement(el, { ...elProps, variants });
|
|
10
|
+
return React.cloneElement(el, { ...el.props, variants });
|
|
12
11
|
});
|
|
13
12
|
return /* @__PURE__ */ jsx(
|
|
14
13
|
"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';
|
|
3
4
|
|
|
4
|
-
const Toggle = (props) => {
|
|
5
|
-
const { ref, ...rest } = props;
|
|
5
|
+
const Toggle = forwardRef((props, ref) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
@@ -16,13 +16,13 @@ const Toggle = (props) => {
|
|
|
16
16
|
className: styleInputElement(),
|
|
17
17
|
ref,
|
|
18
18
|
"data-testid": "toggle-input",
|
|
19
|
-
...
|
|
19
|
+
...props
|
|
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 };
|
|
@@ -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();
|
|
5
5
|
const [state, setState] = useState(initialState);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (timeoutId.current) clearTimeout(timeoutId.current);
|
|
@@ -6,6 +6,5 @@ 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>;
|
|
10
9
|
}
|
|
11
|
-
export declare const Button:
|
|
10
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
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>;
|
|
5
4
|
}
|
|
6
|
-
export declare const Card:
|
|
5
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
export interface CheckboxProps extends HTMLAttributes<HTMLInputElement> {
|
|
3
3
|
indeterminate?: boolean;
|
|
4
|
-
ref?: React.Ref<CheckboxRef>;
|
|
5
4
|
}
|
|
6
5
|
export interface CheckboxRef extends HTMLAttributes<HTMLInputElement> {
|
|
7
6
|
setIndeterminate: (value: boolean) => void;
|
|
8
7
|
}
|
|
9
|
-
export declare const Checkbox:
|
|
8
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.HTMLAttributes<HTMLInputElement> & React.RefAttributes<CheckboxRef>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HintVariants } from '@tecsinapse/cortex-core';
|
|
2
|
-
import React
|
|
3
|
-
export interface HintProps
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface HintProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
variants?: HintVariants;
|
|
6
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
7
6
|
}
|
|
8
|
-
export declare const Hint:
|
|
7
|
+
export declare const Hint: React.ForwardRefExoticComponent<Omit<HintProps & Omit<React.HTMLProps<HTMLDivElement>, "className">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { 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) => JSX.Element;
|
|
7
7
|
export default Masonry;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode, type DialogHTMLAttributes } from 'react';
|
|
2
|
-
interface ModalProps
|
|
2
|
+
interface ModalProps {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
children?: ReactNode;
|
|
6
|
-
ref?: React.Ref<HTMLDialogElement>;
|
|
7
6
|
}
|
|
8
|
-
export declare const Modal: (
|
|
7
|
+
export declare const Modal: import("react").ForwardRefExoticComponent<ModalProps & DialogHTMLAttributes<HTMLDialogElement> & import("react").RefAttributes<HTMLDialogElement>>;
|
|
9
8
|
export {};
|
|
@@ -2,6 +2,5 @@ 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>;
|
|
6
5
|
}
|
|
7
|
-
export declare const RadioButton:
|
|
6
|
+
export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -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>;
|
|
7
7
|
labelExtractor: (value: any) => string;
|
|
8
8
|
};
|
|
@@ -4,7 +4,6 @@ interface SnackbarProps {
|
|
|
4
4
|
variants?: SnackbarVariants;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
show: boolean;
|
|
7
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
8
7
|
}
|
|
9
|
-
export declare const BaseSnackbar:
|
|
8
|
+
export declare const BaseSnackbar: React.ForwardRefExoticComponent<SnackbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
9
|
export {};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { TagVariants } from '@tecsinapse/cortex-core';
|
|
2
2
|
import React, { HTMLProps } from 'react';
|
|
3
|
-
export interface TagProps
|
|
3
|
+
export interface TagProps {
|
|
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>;
|
|
12
8
|
}
|
|
13
9
|
export declare const Tag: {
|
|
14
|
-
Root:
|
|
10
|
+
Root: React.ForwardRefExoticComponent<Omit<TagProps & React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
11
|
Close: ({ onClick, className, ...rest }: Omit<HTMLProps<HTMLButtonElement>, "children" | "type">) => import("react/jsx-runtime").JSX.Element;
|
|
16
12
|
Label: ({ children, className, ...rest }: HTMLProps<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
Face:
|
|
13
|
+
Face: React.ForwardRefExoticComponent<Omit<Pick<TagProps, "intent" | "variants"> & React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
14
|
};
|
|
19
|
-
export {};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import React
|
|
2
|
-
export
|
|
3
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
4
|
-
}
|
|
5
|
-
export declare const Toggle: (props: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Toggle: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -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").MutableRefObject<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").MutableRefObject<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").MutableRefObject<null>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -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").MutableRefObject<null>;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.14.1
|
|
3
|
+
"version": "1.14.1",
|
|
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.
|
|
23
|
+
"@tecsinapse/cortex-core": "1.1.3",
|
|
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",
|
|
47
|
+
"react-dom": ">=18.0.0",
|
|
48
48
|
"react-icons": ">=5.2.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8b207794502440570661516f1dfea3f35a2f560f"
|
|
52
52
|
}
|