@tecsinapse/cortex-react 1.3.0-beta.6 → 1.3.0-beta.7

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.
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var React = require('react');
4
6
  var react = require('@floating-ui/react');
5
7
  require('@internationalized/date');
@@ -7,41 +9,46 @@ require('react-aria');
7
9
  require('react-stately');
8
10
  var useFloatingLogic = require('../hooks/useFloatingLogic.js');
9
11
 
10
- React.forwardRef((props, ref) => {
11
- const {
12
- children,
13
- text,
14
- trigger = "hover",
15
- placement = "top",
16
- width,
17
- height
18
- } = props;
19
- const arrowRef = React.useRef(null);
20
- const {
21
- isOpen,
22
- triggerProps,
23
- x,
24
- y,
25
- strategy,
26
- refs,
27
- context,
28
- floatingStyles
29
- } = useFloatingLogic.useFloatingLogic({ placement, arrowRef, trigger });
30
- return /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(children, triggerProps), isOpen ? /* @__PURE__ */ React.createElement(
31
- "div",
32
- {
33
- ref: ref || refs.setFloating,
34
- className: "bg-black text-white p-2 rounded z-50 shadow-md text-justify",
35
- style: {
36
- position: strategy,
37
- top: y ?? 0,
38
- left: x ?? 0,
39
- width,
40
- height,
41
- ...floatingStyles
42
- }
43
- },
44
- text,
45
- /* @__PURE__ */ React.createElement(react.FloatingArrow, { ref: arrowRef, context, fill: "black" })
46
- ) : /* @__PURE__ */ React.createElement(React.Fragment, null));
47
- });
12
+ const Tooltip = React.forwardRef(
13
+ (props, ref) => {
14
+ const {
15
+ children,
16
+ text,
17
+ trigger = "hover",
18
+ placement = "top",
19
+ width,
20
+ height
21
+ } = props;
22
+ const arrowRef = React.useRef(null);
23
+ const {
24
+ isOpen,
25
+ triggerProps,
26
+ x,
27
+ y,
28
+ strategy,
29
+ refs,
30
+ context,
31
+ floatingStyles
32
+ } = useFloatingLogic.useFloatingLogic({ placement, arrowRef, trigger });
33
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(children, triggerProps), isOpen ? /* @__PURE__ */ React.createElement(
34
+ "div",
35
+ {
36
+ ref: ref || refs.setFloating,
37
+ className: "bg-black text-white p-2 rounded z-50 shadow-md text-justify",
38
+ style: {
39
+ position: strategy,
40
+ top: y ?? 0,
41
+ left: x ?? 0,
42
+ width,
43
+ height,
44
+ ...floatingStyles
45
+ }
46
+ },
47
+ text,
48
+ /* @__PURE__ */ React.createElement(react.FloatingArrow, { ref: arrowRef, context, fill: "black" })
49
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null));
50
+ }
51
+ );
52
+
53
+ exports.Tooltip = Tooltip;
54
+ exports.default = Tooltip;
package/dist/cjs/index.js CHANGED
@@ -24,7 +24,7 @@ var Tag = require('./components/Tag.js');
24
24
  var TextArea = require('./components/TextArea.js');
25
25
  var TimeFieldInput = require('./components/TimeFieldInput.js');
26
26
  var Toggle = require('./components/Toggle.js');
27
- require('./components/Tooltip.js');
27
+ var Tooltip = require('./components/Tooltip.js');
28
28
  var index$2 = require('./components/Popover/index.js');
29
29
  var index$3 = require('./components/Menubar/index.js');
30
30
  var useCalendar = require('./hooks/useCalendar.js');
@@ -72,6 +72,7 @@ exports.Tag = Tag.Tag;
72
72
  exports.TextArea = TextArea.TextArea;
73
73
  exports.TimeFieldInput = TimeFieldInput.TimeFieldInput;
74
74
  exports.Toggle = Toggle.Toggle;
75
+ exports.Tooltip = Tooltip.Tooltip;
75
76
  exports.Popover = index$2.Popover;
76
77
  exports.Menubar = index$3.Menubar;
77
78
  exports.useCalendar = useCalendar.useCalendar;
@@ -5,41 +5,45 @@ import 'react-aria';
5
5
  import 'react-stately';
6
6
  import { useFloatingLogic } from '../hooks/useFloatingLogic.js';
7
7
 
8
- forwardRef((props, ref) => {
9
- const {
10
- children,
11
- text,
12
- trigger = "hover",
13
- placement = "top",
14
- width,
15
- height
16
- } = props;
17
- const arrowRef = useRef(null);
18
- const {
19
- isOpen,
20
- triggerProps,
21
- x,
22
- y,
23
- strategy,
24
- refs,
25
- context,
26
- floatingStyles
27
- } = useFloatingLogic({ placement, arrowRef, trigger });
28
- return /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(children, triggerProps), isOpen ? /* @__PURE__ */ React.createElement(
29
- "div",
30
- {
31
- ref: ref || refs.setFloating,
32
- className: "bg-black text-white p-2 rounded z-50 shadow-md text-justify",
33
- style: {
34
- position: strategy,
35
- top: y ?? 0,
36
- left: x ?? 0,
37
- width,
38
- height,
39
- ...floatingStyles
40
- }
41
- },
42
- text,
43
- /* @__PURE__ */ React.createElement(FloatingArrow, { ref: arrowRef, context, fill: "black" })
44
- ) : /* @__PURE__ */ React.createElement(React.Fragment, null));
45
- });
8
+ const Tooltip = forwardRef(
9
+ (props, ref) => {
10
+ const {
11
+ children,
12
+ text,
13
+ trigger = "hover",
14
+ placement = "top",
15
+ width,
16
+ height
17
+ } = props;
18
+ const arrowRef = useRef(null);
19
+ const {
20
+ isOpen,
21
+ triggerProps,
22
+ x,
23
+ y,
24
+ strategy,
25
+ refs,
26
+ context,
27
+ floatingStyles
28
+ } = useFloatingLogic({ placement, arrowRef, trigger });
29
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(children, triggerProps), isOpen ? /* @__PURE__ */ React.createElement(
30
+ "div",
31
+ {
32
+ ref: ref || refs.setFloating,
33
+ className: "bg-black text-white p-2 rounded z-50 shadow-md text-justify",
34
+ style: {
35
+ position: strategy,
36
+ top: y ?? 0,
37
+ left: x ?? 0,
38
+ width,
39
+ height,
40
+ ...floatingStyles
41
+ }
42
+ },
43
+ text,
44
+ /* @__PURE__ */ React.createElement(FloatingArrow, { ref: arrowRef, context, fill: "black" })
45
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null));
46
+ }
47
+ );
48
+
49
+ export { Tooltip, Tooltip as default };
package/dist/esm/index.js CHANGED
@@ -22,7 +22,7 @@ export { Tag } from './components/Tag.js';
22
22
  export { TextArea } from './components/TextArea.js';
23
23
  export { TimeFieldInput } from './components/TimeFieldInput.js';
24
24
  export { Toggle } from './components/Toggle.js';
25
- import './components/Tooltip.js';
25
+ export { Tooltip } from './components/Tooltip.js';
26
26
  export { Popover } from './components/Popover/index.js';
27
27
  export { Menubar } from './components/Menubar/index.js';
28
28
  export { useCalendar } from './hooks/useCalendar.js';
@@ -9,5 +9,5 @@ interface TooltipProps {
9
9
  height?: number;
10
10
  style?: React.CSSProperties;
11
11
  }
12
- declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
13
13
  export default Tooltip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "1.3.0-beta.6",
3
+ "version": "1.3.0-beta.7",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
@@ -42,5 +42,5 @@
42
42
  "react-dom": ">=18.0.0",
43
43
  "tailwind": ">=3.3.0"
44
44
  },
45
- "gitHead": "c45d44c53d32b39febf7f65f2b54692681d677c3"
45
+ "gitHead": "cb9069b439abdea0331a49cb6666d93a148ab1df"
46
46
  }