@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.
Files changed (63) hide show
  1. package/dist/cjs/components/Button.js +3 -4
  2. package/dist/cjs/components/Card.js +3 -4
  3. package/dist/cjs/components/Carousel/CarouselItem.js +1 -1
  4. package/dist/cjs/components/Checkbox.js +3 -3
  5. package/dist/cjs/components/Hint.js +4 -5
  6. package/dist/cjs/components/Input/Face.js +7 -2
  7. package/dist/cjs/components/Modal.js +3 -4
  8. package/dist/cjs/components/Popover/Trigger.js +1 -1
  9. package/dist/cjs/components/RadioButton.js +14 -17
  10. package/dist/cjs/components/Select/MultiOption.js +1 -1
  11. package/dist/cjs/components/Select/Trigger.js +1 -1
  12. package/dist/cjs/components/Snackbar/BaseSnackbar.js +4 -7
  13. package/dist/cjs/components/Stepper/Root.js +8 -4
  14. package/dist/cjs/components/Tag.js +20 -23
  15. package/dist/cjs/components/TextArea/Face.js +3 -1
  16. package/dist/cjs/components/Toggle.js +4 -4
  17. package/dist/cjs/components/Uploader/Manager.js +3 -3
  18. package/dist/cjs/components/Uploader/Upload.js +10 -4
  19. package/dist/cjs/hooks/useDebouncedState.js +1 -1
  20. package/dist/cjs/hooks/useFileUpload.js +4 -2
  21. package/dist/cjs/provider/ManagerContext.js +1 -9
  22. package/dist/esm/components/Button.js +3 -4
  23. package/dist/esm/components/Card.js +3 -4
  24. package/dist/esm/components/Carousel/CarouselItem.js +1 -1
  25. package/dist/esm/components/Checkbox.js +4 -4
  26. package/dist/esm/components/Hint.js +4 -5
  27. package/dist/esm/components/Input/Face.js +7 -2
  28. package/dist/esm/components/Modal.js +3 -4
  29. package/dist/esm/components/Popover/Trigger.js +1 -1
  30. package/dist/esm/components/RadioButton.js +14 -17
  31. package/dist/esm/components/Select/MultiOption.js +1 -1
  32. package/dist/esm/components/Select/Trigger.js +1 -1
  33. package/dist/esm/components/Snackbar/BaseSnackbar.js +4 -7
  34. package/dist/esm/components/Stepper/Root.js +8 -4
  35. package/dist/esm/components/Tag.js +20 -23
  36. package/dist/esm/components/TextArea/Face.js +3 -1
  37. package/dist/esm/components/Toggle.js +4 -4
  38. package/dist/esm/components/Uploader/Manager.js +3 -3
  39. package/dist/esm/components/Uploader/Upload.js +10 -4
  40. package/dist/esm/hooks/useDebouncedState.js +1 -1
  41. package/dist/esm/hooks/useFileUpload.js +4 -2
  42. package/dist/esm/provider/ManagerContext.js +1 -9
  43. package/dist/types/components/Button.d.ts +2 -1
  44. package/dist/types/components/Card.d.ts +2 -1
  45. package/dist/types/components/Checkbox.d.ts +2 -1
  46. package/dist/types/components/Hint.d.ts +4 -3
  47. package/dist/types/components/Masonry.d.ts +2 -2
  48. package/dist/types/components/Modal.d.ts +3 -2
  49. package/dist/types/components/RadioButton.d.ts +2 -1
  50. package/dist/types/components/Select/useMultiSelectOption.d.ts +1 -1
  51. package/dist/types/components/Snackbar/BaseSnackbar.d.ts +2 -1
  52. package/dist/types/components/Tag.d.ts +8 -3
  53. package/dist/types/components/Toggle.d.ts +5 -2
  54. package/dist/types/components/Uploader/Manager.d.ts +1 -1
  55. package/dist/types/components/Uploader/index.d.ts +1 -1
  56. package/dist/types/components/Uploader/types.d.ts +1 -0
  57. package/dist/types/hooks/useCalendarCell.d.ts +1 -1
  58. package/dist/types/hooks/useDatePickerInput.d.ts +1 -1
  59. package/dist/types/hooks/useDateRangePickerInput.d.ts +1 -1
  60. package/dist/types/hooks/useFileUpload.d.ts +2 -1
  61. package/dist/types/hooks/useRangeCalendar.d.ts +1 -1
  62. package/dist/types/utils/react.d.ts +1 -1
  63. package/package.json +7 -7
@@ -2,10 +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');
6
5
 
7
- const Button = React.forwardRef((props, ref) => {
8
- const { variants, intent, variant, size, children, className, ...rest } = props;
6
+ const Button = (props) => {
7
+ const { variants, intent, variant, size, children, className, ref, ...rest } = props;
9
8
  return /* @__PURE__ */ jsxRuntime.jsx(
10
9
  "button",
11
10
  {
@@ -15,6 +14,6 @@ const Button = React.forwardRef((props, ref) => {
15
14
  children
16
15
  }
17
16
  );
18
- });
17
+ };
19
18
 
20
19
  exports.Button = Button;
@@ -2,11 +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');
6
5
 
7
- const Card = React.forwardRef((props, ref) => {
8
- const { children, className, ...rest } = props;
6
+ const Card = (props) => {
7
+ const { children, className, ref, ...rest } = props;
9
8
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.card({ className }), ref, ...rest, children });
10
- });
9
+ };
11
10
 
12
11
  exports.Card = Card;
@@ -57,7 +57,7 @@ const CarouselItem = ({ item }) => {
57
57
  {
58
58
  type: "button",
59
59
  "data-testid": "button-link-carousel",
60
- className: "z-absolute absolute bottom-deca left-[10%]",
60
+ className: "z-absolute absolute bottom-giga left-[10%]",
61
61
  children: item.button.title
62
62
  }
63
63
  )
@@ -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 = React.forwardRef((props, ref) => {
7
+ const Checkbox = (props) => {
8
8
  const localRef = React.useRef(null);
9
- const { className, indeterminate, ...rest } = props;
9
+ const { className, indeterminate, ref, ...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 = React.forwardRef((props, ref) => {
31
31
  ...rest
32
32
  }
33
33
  );
34
- });
34
+ };
35
35
 
36
36
  exports.Checkbox = Checkbox;
@@ -2,11 +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');
6
5
 
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
- });
6
+ const Hint = (props) => {
7
+ const { children, variants, ref, ...rest } = props;
8
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cortexCore.hint(variants), ref, ...rest, children: children ?? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
9
+ };
11
10
 
12
11
  exports.Hint = Hint;
@@ -13,14 +13,19 @@ 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
- return React.cloneElement(el, { ...el.props, variants });
16
+ const element = el;
17
+ const elProps = element.props || {};
18
+ return React.cloneElement(element, { ...elProps, variants });
17
19
  });
18
20
  return /* @__PURE__ */ jsxRuntime.jsx(
19
21
  "div",
20
22
  {
21
23
  "data-testid": "input-face",
22
24
  ...rest,
23
- className: clsx(cortexCore.input(variants), className),
25
+ className: clsx(
26
+ cortexCore.input(variants),
27
+ className
28
+ ),
24
29
  ref,
25
30
  children: clones
26
31
  }
@@ -2,10 +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');
6
5
 
7
- const Modal = React.forwardRef((props, ref) => {
8
- const { open, onClose, children, className, ...rest } = props;
6
+ const Modal = (props) => {
7
+ const { open, onClose, children, className, ref, ...rest } = props;
9
8
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10
9
  /* @__PURE__ */ jsxRuntime.jsx(
11
10
  "div",
@@ -26,6 +25,6 @@ const Modal = React.forwardRef((props, ref) => {
26
25
  }
27
26
  )
28
27
  ] });
29
- });
28
+ };
30
29
 
31
30
  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.props?.disabled;
16
+ const isDisabled = disabled ?? children.props.disabled;
17
17
  return react.cloneWithProps(children, {
18
18
  ...triggerProps,
19
19
  ...isDisabled ? isDisabledProps : {}
@@ -2,24 +2,21 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var cortexCore = require('@tecsinapse/cortex-core');
5
- var React = require('react');
6
5
 
7
6
  const { container, input, label: labelStyle } = cortexCore.radioButtonStyles();
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
- );
7
+ const RadioButton = ({ label, reversed, id, ref, ...rest }) => {
8
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9
+ "div",
10
+ {
11
+ className: container({ reversed }),
12
+ ref,
13
+ "data-testid": "radio-button-container",
14
+ children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx("input", { id, type: "radio", className: input(), ...rest }),
16
+ label ? /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: labelStyle(), children: label }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
17
+ ]
18
+ }
19
+ );
20
+ };
24
21
 
25
22
  exports.RadioButton = RadioButton;
@@ -27,7 +27,7 @@ const SelectMultiOption = ({
27
27
  ref: inputRef
28
28
  }
29
29
  ),
30
- labelExtractor(option)
30
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1", children: labelExtractor(option) })
31
31
  ]
32
32
  }
33
33
  );
@@ -45,7 +45,7 @@ const SelectTrigger = ({
45
45
  /* @__PURE__ */ jsxRuntime.jsx(
46
46
  "span",
47
47
  {
48
- className: clsx({ "mt-mili": hasValue && label }),
48
+ className: clsx("truncate", { "mt-mili": hasValue && label }),
49
49
  "data-testid": "select-placeholder",
50
50
  children: _placeholder
51
51
  }
@@ -2,13 +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');
6
5
 
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
- );
6
+ const BaseSnackbar = (props) => {
7
+ const { children, show, variants, ref } = props;
8
+ 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, {}) });
9
+ };
13
10
 
14
11
  exports.BaseSnackbar = BaseSnackbar;
@@ -14,8 +14,11 @@ const Root = ({
14
14
  const initialSelectedIndex = React.useMemo(() => {
15
15
  let initialIndex = null;
16
16
  React.Children.forEach(children, (child, index) => {
17
- if (React.isValidElement(child) && child.props.selected) {
18
- initialIndex = index;
17
+ if (React.isValidElement(child)) {
18
+ const element = child;
19
+ if (element.props.selected) {
20
+ initialIndex = index;
21
+ }
19
22
  }
20
23
  });
21
24
  return initialIndex;
@@ -41,13 +44,14 @@ const Root = ({
41
44
  const renderNode = React.useMemo(
42
45
  () => (child, index) => {
43
46
  if (React.isValidElement(child) && child.type === Node.Node) {
44
- return React.cloneElement(child, {
47
+ const element = child;
48
+ return React.cloneElement(element, {
45
49
  isFirst: index === 0,
46
50
  isLast: index === childrenCount - 1,
47
51
  selected: selectedNode === index,
48
52
  segmented,
49
53
  interactive,
50
- onClick: () => handleNodeClick(index, child.props.onClick)
54
+ onClick: () => handleNodeClick(index, element.props.onClick)
51
55
  });
52
56
  }
53
57
  return null;
@@ -2,7 +2,6 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var cortexCore = require('@tecsinapse/cortex-core');
5
- var React = require('react');
6
5
  var lia = require('react-icons/lia');
7
6
 
8
7
  const Close = ({
@@ -28,8 +27,8 @@ const Label = ({
28
27
  }) => {
29
28
  return /* @__PURE__ */ jsxRuntime.jsx("p", { className, ...rest, children });
30
29
  };
31
- const Face = React.forwardRef((props, ref) => {
32
- const { variants, className, intent, children, style, ...rest } = props;
30
+ const Face = (props) => {
31
+ const { variants, className, intent, children, style, ref, ...rest } = props;
33
32
  return /* @__PURE__ */ jsxRuntime.jsx(
34
33
  "div",
35
34
  {
@@ -44,26 +43,24 @@ const Face = React.forwardRef((props, ref) => {
44
43
  children
45
44
  }
46
45
  );
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
- );
46
+ };
47
+ const Root = (props) => {
48
+ const { label, variants, intent, className, onDismiss, ref, ...rest } = props;
49
+ return /* @__PURE__ */ jsxRuntime.jsxs(
50
+ Face,
51
+ {
52
+ ...rest,
53
+ variants,
54
+ intent,
55
+ className,
56
+ ref,
57
+ children: [
58
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
59
+ onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(Close, { onClick: onDismiss }) : null
60
+ ]
61
+ }
62
+ );
63
+ };
67
64
  const Tag = {
68
65
  Root,
69
66
  Close,
@@ -9,7 +9,9 @@ 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
- return React.cloneElement(el, { ...el.props, variants });
12
+ const element = el;
13
+ const elProps = element.props || {};
14
+ return React.cloneElement(element, { ...elProps, variants });
13
15
  });
14
16
  return /* @__PURE__ */ jsxRuntime.jsx(
15
17
  "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');
6
5
 
7
- const Toggle = React.forwardRef((props, ref) => {
6
+ const Toggle = (props) => {
7
+ const { ref, ...rest } = props;
8
8
  return /* @__PURE__ */ jsxRuntime.jsx(
9
9
  "div",
10
10
  {
@@ -18,13 +18,13 @@ const Toggle = React.forwardRef((props, ref) => {
18
18
  className: cortexCore.styleInputElement(),
19
19
  ref,
20
20
  "data-testid": "toggle-input",
21
- ...props
21
+ ...rest
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;
@@ -9,13 +9,13 @@ var clsx = require('clsx');
9
9
  var io5 = require('react-icons/io5');
10
10
  var cortexCore = require('@tecsinapse/cortex-core');
11
11
  var useManagerHelpers = require('../../hooks/useManagerHelpers.js');
12
- var Loading = require('../Loading.js');
13
12
 
14
13
  const Manager = ({
15
14
  open,
16
15
  files,
17
16
  onDelete,
18
17
  uploadProgressText = "Upload(s) in progress",
18
+ uploadSuccessText = "Upload(s) completed",
19
19
  onClose
20
20
  }) => {
21
21
  const {
@@ -47,14 +47,14 @@ const Manager = ({
47
47
  children: min ? /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(io5.IoChevronDown, {})
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", children: uploadProgressText }),
50
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { "data-testid": "upload-progress", children: isLoading ? uploadProgressText : uploadSuccessText }),
51
51
  /* @__PURE__ */ jsxRuntime.jsx(
52
52
  Button.Button,
53
53
  {
54
54
  variants: { variant: "filled", size: "square" },
55
55
  onClick: onClose,
56
56
  disabled: isLoading,
57
- children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Loading.Loading, {}) : /* @__PURE__ */ jsxRuntime.jsx(io.IoMdClose, {})
57
+ children: /* @__PURE__ */ jsxRuntime.jsx(io.IoMdClose, {})
58
58
  }
59
59
  )
60
60
  ] }),
@@ -44,6 +44,15 @@ const File = ({
44
44
  return "info";
45
45
  }
46
46
  }
47
+ const formatFileSize = (size) => {
48
+ const units = ["B", "KB", "MB", "GB"];
49
+ let i = 0;
50
+ while (size >= 1024 && i < units.length - 1) {
51
+ size /= 1024;
52
+ i++;
53
+ }
54
+ return `${size.toFixed(2)} ${units[i]}`;
55
+ };
47
56
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full", children: [
48
57
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border rounded-t-mili shadow p-mili", children: [
49
58
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-centi", children: [
@@ -57,10 +66,7 @@ const File = ({
57
66
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "border-2 text-kilo text-primary-medium w-tera h-tera flex items-center justify-center rounded-mili", children: /* @__PURE__ */ jsxRuntime.jsx(fa6.FaRegFileLines, {}) }),
58
67
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-col", children: [
59
68
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold truncate max-w-[200px]", children: file.file.name }),
60
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-500", children: [
61
- (file.file.size / 1024).toFixed(2),
62
- " KB"
63
- ] })
69
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: formatFileSize(file.file.size) })
64
70
  ] })
65
71
  ] }),
66
72
  file.status === "success" && showDelete ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -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(void 0);
7
7
  const [state, setState] = React.useState(initialState);
8
8
  React.useEffect(() => {
9
9
  if (timeoutId.current) clearTimeout(timeoutId.current);
@@ -29,7 +29,8 @@ const useFileUpload = ({
29
29
  isFolder = false,
30
30
  noClick = false,
31
31
  ignoreRejections = false,
32
- uploadProgressText
32
+ uploadProgressText,
33
+ uploadSuccessText
33
34
  }) => {
34
35
  const {
35
36
  showManager,
@@ -98,7 +99,8 @@ const useFileUpload = ({
98
99
  showManager?.({
99
100
  onClose: closeManager,
100
101
  onDelete: handleRemoveFile,
101
- uploadProgressText
102
+ uploadProgressText,
103
+ uploadSuccessText
102
104
  });
103
105
  }
104
106
  }, [handleRemoveFile, closeManager]);
@@ -9,8 +9,7 @@ require('react-icons/lia');
9
9
  require('@internationalized/date');
10
10
  require('../components/Badge.js');
11
11
  require('react-icons/md');
12
- require('../components/Card.js');
13
- require('../components/Button.js');
12
+ require('@tecsinapse/cortex-core');
14
13
  require('react-aria');
15
14
  require('react-stately');
16
15
  require('./MenubarContext.js');
@@ -23,17 +22,14 @@ var types = require('../components/Uploader/types.js');
23
22
  require('@floating-ui/react');
24
23
  require('currency.js');
25
24
  require('../components/Calendar/CalendarCell.js');
26
- require('@tecsinapse/cortex-core');
27
25
  require('react-icons/fa');
28
26
  require('react-icons/io');
29
27
  require('embla-carousel-react');
30
28
  require('embla-carousel-autoplay');
31
- require('../components/Checkbox.js');
32
29
  require('../components/ColorPicker.js');
33
30
  require('../components/DatePicker/DateSegment.js');
34
31
  require('../components/DatePicker/DatePickerInputBase.js');
35
32
  require('../components/GroupButton.js');
36
- require('../components/Hint.js');
37
33
  require('../components/Input/Box.js');
38
34
  require('../components/Input/Face.js');
39
35
  require('../components/Input/Left.js');
@@ -51,7 +47,6 @@ require('../components/Menubar/Header.js');
51
47
  require('../components/Menubar/Item.js');
52
48
  require('./CategoriesContext.js');
53
49
  require('../components/Menubar/SubItem.js');
54
- require('../components/Modal.js');
55
50
  require('../components/ProgressBar/Progress.js');
56
51
  require('../components/RadioButton.js');
57
52
  require('../components/Select/GroupedOptions.js');
@@ -60,16 +55,13 @@ require('../components/Select/MultiGroupedOptions.js');
60
55
  require('../components/Select/MultiOptions.js');
61
56
  require('../components/Select/Options.js');
62
57
  require('../components/Select/Trigger.js');
63
- require('../components/Snackbar/BaseSnackbar.js');
64
58
  require('../styles/stepNodeVariants.js');
65
- require('../components/Tag.js');
66
59
  require('../components/TextArea/Box.js');
67
60
  require('../components/TextArea/Face.js');
68
61
  require('../components/TextArea/Left.js');
69
62
  require('../components/TextArea/Right.js');
70
63
  require('../components/TextArea/Root.js');
71
64
  require('../components/TimePicker/TimeFieldInput.js');
72
- require('../components/Toggle.js');
73
65
  require('../components/Tooltip.js');
74
66
  require('react-icons/hi2');
75
67
  require('react-icons/fa6');
@@ -1,9 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { button } from '@tecsinapse/cortex-core';
3
- import { forwardRef } from 'react';
4
3
 
5
- const Button = forwardRef((props, ref) => {
6
- const { variants, intent, variant, size, children, className, ...rest } = props;
4
+ const Button = (props) => {
5
+ const { variants, intent, variant, size, children, className, ref, ...rest } = props;
7
6
  return /* @__PURE__ */ jsx(
8
7
  "button",
9
8
  {
@@ -13,6 +12,6 @@ const Button = forwardRef((props, ref) => {
13
12
  children
14
13
  }
15
14
  );
16
- });
15
+ };
17
16
 
18
17
  export { Button };
@@ -1,10 +1,9 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { card } from '@tecsinapse/cortex-core';
3
- import { forwardRef } from 'react';
4
3
 
5
- const Card = forwardRef((props, ref) => {
6
- const { children, className, ...rest } = props;
4
+ const Card = (props) => {
5
+ const { children, className, ref, ...rest } = props;
7
6
  return /* @__PURE__ */ jsx("div", { className: card({ className }), ref, ...rest, children });
8
- });
7
+ };
9
8
 
10
9
  export { Card };
@@ -55,7 +55,7 @@ const CarouselItem = ({ item }) => {
55
55
  {
56
56
  type: "button",
57
57
  "data-testid": "button-link-carousel",
58
- className: "z-absolute absolute bottom-deca left-[10%]",
58
+ className: "z-absolute absolute bottom-giga left-[10%]",
59
59
  children: item.button.title
60
60
  }
61
61
  )
@@ -1,10 +1,10 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { checkbox } from '@tecsinapse/cortex-core';
3
- import { forwardRef, useRef, useCallback, useEffect, useImperativeHandle } from 'react';
3
+ import { useRef, useCallback, useEffect, useImperativeHandle } from 'react';
4
4
 
5
- const Checkbox = forwardRef((props, ref) => {
5
+ const Checkbox = (props) => {
6
6
  const localRef = useRef(null);
7
- const { className, indeterminate, ...rest } = props;
7
+ const { className, indeterminate, ref, ...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 = forwardRef((props, ref) => {
29
29
  ...rest
30
30
  }
31
31
  );
32
- });
32
+ };
33
33
 
34
34
  export { Checkbox };
@@ -1,10 +1,9 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { hint } from '@tecsinapse/cortex-core';
3
- import { forwardRef } from 'react';
4
3
 
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
- });
4
+ const Hint = (props) => {
5
+ const { children, variants, ref, ...rest } = props;
6
+ return /* @__PURE__ */ jsx("div", { className: hint(variants), ref, ...rest, children: children ?? /* @__PURE__ */ jsx(Fragment, {}) });
7
+ };
9
8
 
10
9
  export { Hint };
@@ -11,14 +11,19 @@ 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
- return React.cloneElement(el, { ...el.props, variants });
14
+ const element = el;
15
+ const elProps = element.props || {};
16
+ return React.cloneElement(element, { ...elProps, variants });
15
17
  });
16
18
  return /* @__PURE__ */ jsx(
17
19
  "div",
18
20
  {
19
21
  "data-testid": "input-face",
20
22
  ...rest,
21
- className: clsx(input(variants), className),
23
+ className: clsx(
24
+ input(variants),
25
+ className
26
+ ),
22
27
  ref,
23
28
  children: clones
24
29
  }
@@ -1,9 +1,8 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { overlay, modal } from '@tecsinapse/cortex-core';
3
- import { forwardRef } from 'react';
4
3
 
5
- const Modal = forwardRef((props, ref) => {
6
- const { open, onClose, children, className, ...rest } = props;
4
+ const Modal = (props) => {
5
+ const { open, onClose, children, className, ref, ...rest } = props;
7
6
  return /* @__PURE__ */ jsxs(Fragment, { children: [
8
7
  /* @__PURE__ */ jsx(
9
8
  "div",
@@ -24,6 +23,6 @@ const Modal = forwardRef((props, ref) => {
24
23
  }
25
24
  )
26
25
  ] });
27
- });
26
+ };
28
27
 
29
28
  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.props?.disabled;
14
+ const isDisabled = disabled ?? children.props.disabled;
15
15
  return cloneWithProps(children, {
16
16
  ...triggerProps,
17
17
  ...isDisabled ? isDisabledProps : {}