@kopexa/popover 4.0.2 → 5.0.0

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.
@@ -40,14 +40,20 @@ var PopoverRoot = (props) => {
40
40
  function PopoverTrigger({ ...props }) {
41
41
  return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
42
42
  }
43
+ var Portal2 = ({ disabled, children }) => {
44
+ if (disabled) return children;
45
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { forceMount: true, children });
46
+ };
43
47
  function PopoverContent({
44
48
  className,
45
49
  align = "center",
46
50
  sideOffset = 4,
51
+ portalled = true,
52
+ children,
47
53
  ...props
48
54
  }) {
49
55
  const { open, styles } = usePopoverContext();
50
- return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
56
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsx(Portal2, { disabled: !portalled, children: /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
51
57
  PopoverPrimitive.Content,
52
58
  {
53
59
  "data-slot": "popover-content",
@@ -56,13 +62,15 @@ function PopoverContent({
56
62
  className: styles.content({ className }),
57
63
  ...props,
58
64
  asChild: true,
65
+ forceMount: !portalled ? true : void 0,
59
66
  children: /* @__PURE__ */ jsx(
60
67
  motion.div,
61
68
  {
62
69
  animate: "enter",
63
70
  exit: "exit",
64
71
  initial: "initial",
65
- variants: TRANSITION_VARIANTS.scaleSpringOpacity
72
+ variants: TRANSITION_VARIANTS.scaleSpringOpacity,
73
+ children
66
74
  }
67
75
  )
68
76
  }
@@ -5,7 +5,7 @@ import {
5
5
  PopoverRoot,
6
6
  PopoverTrigger,
7
7
  __export
8
- } from "./chunk-EN5K2552.mjs";
8
+ } from "./chunk-CVZNBNZ4.mjs";
9
9
 
10
10
  // src/namespace.ts
11
11
  var namespace_exports = {};
package/dist/index.js CHANGED
@@ -78,14 +78,20 @@ var PopoverRoot = (props) => {
78
78
  function PopoverTrigger({ ...props }) {
79
79
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
80
80
  }
81
+ var Portal2 = ({ disabled, children }) => {
82
+ if (disabled) return children;
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children });
84
+ };
81
85
  function PopoverContent({
82
86
  className,
83
87
  align = "center",
84
88
  sideOffset = 4,
89
+ portalled = true,
90
+ children,
85
91
  ...props
86
92
  }) {
87
93
  const { open, styles } = usePopoverContext();
88
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, { disabled: !portalled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
95
  PopoverPrimitive.Content,
90
96
  {
91
97
  "data-slot": "popover-content",
@@ -94,13 +100,15 @@ function PopoverContent({
94
100
  className: styles.content({ className }),
95
101
  ...props,
96
102
  asChild: true,
103
+ forceMount: !portalled ? true : void 0,
97
104
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
105
  import_react.motion.div,
99
106
  {
100
107
  animate: "enter",
101
108
  exit: "exit",
102
109
  initial: "initial",
103
- variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity
110
+ variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity,
111
+ children
104
112
  }
105
113
  )
106
114
  }
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  namespace_exports
4
- } from "./chunk-YHIC45AQ.mjs";
4
+ } from "./chunk-TDTYA2GD.mjs";
5
5
  import {
6
6
  PopoverAnchor,
7
7
  PopoverContent,
8
8
  PopoverRoot,
9
9
  PopoverTrigger
10
- } from "./chunk-EN5K2552.mjs";
10
+ } from "./chunk-CVZNBNZ4.mjs";
11
11
  export {
12
12
  namespace_exports as Popover,
13
13
  PopoverAnchor,
package/dist/namespace.js CHANGED
@@ -68,14 +68,20 @@ var PopoverRoot = (props) => {
68
68
  function PopoverTrigger({ ...props }) {
69
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
70
70
  }
71
+ var Portal2 = ({ disabled, children }) => {
72
+ if (disabled) return children;
73
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children });
74
+ };
71
75
  function PopoverContent({
72
76
  className,
73
77
  align = "center",
74
78
  sideOffset = 4,
79
+ portalled = true,
80
+ children,
75
81
  ...props
76
82
  }) {
77
83
  const { open, styles } = usePopoverContext();
78
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, { disabled: !portalled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
85
  PopoverPrimitive.Content,
80
86
  {
81
87
  "data-slot": "popover-content",
@@ -84,13 +90,15 @@ function PopoverContent({
84
90
  className: styles.content({ className }),
85
91
  ...props,
86
92
  asChild: true,
93
+ forceMount: !portalled ? true : void 0,
87
94
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
95
  import_react.motion.div,
89
96
  {
90
97
  animate: "enter",
91
98
  exit: "exit",
92
99
  initial: "initial",
93
- variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity
100
+ variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity,
101
+ children
94
102
  }
95
103
  )
96
104
  }
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import "./chunk-YHIC45AQ.mjs";
2
+ import "./chunk-TDTYA2GD.mjs";
3
3
  import {
4
4
  PopoverAnchor,
5
5
  PopoverContent,
6
6
  PopoverRoot,
7
7
  PopoverTrigger
8
- } from "./chunk-EN5K2552.mjs";
8
+ } from "./chunk-CVZNBNZ4.mjs";
9
9
  export {
10
10
  PopoverAnchor as Anchor,
11
11
  PopoverContent as Content,
@@ -9,8 +9,9 @@ declare function PopoverTrigger({ ...props }: PopoverTriggerProps): react_jsx_ru
9
9
  type PopoverContentProps = ComponentProps<typeof PopoverPrimitive.Content> & {
10
10
  align?: "start" | "center" | "end";
11
11
  sideOffset?: number;
12
+ portalled?: boolean;
12
13
  };
13
- declare function PopoverContent({ className, align, sideOffset, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element;
14
+ declare function PopoverContent({ className, align, sideOffset, portalled, children, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element;
14
15
  type PopoverAnchorProps = ComponentProps<typeof PopoverPrimitive.Anchor>;
15
16
  declare function PopoverAnchor({ ...props }: PopoverAnchorProps): react_jsx_runtime.JSX.Element;
16
17
 
package/dist/popover.d.ts CHANGED
@@ -9,8 +9,9 @@ declare function PopoverTrigger({ ...props }: PopoverTriggerProps): react_jsx_ru
9
9
  type PopoverContentProps = ComponentProps<typeof PopoverPrimitive.Content> & {
10
10
  align?: "start" | "center" | "end";
11
11
  sideOffset?: number;
12
+ portalled?: boolean;
12
13
  };
13
- declare function PopoverContent({ className, align, sideOffset, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element;
14
+ declare function PopoverContent({ className, align, sideOffset, portalled, children, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element;
14
15
  type PopoverAnchorProps = ComponentProps<typeof PopoverPrimitive.Anchor>;
15
16
  declare function PopoverAnchor({ ...props }: PopoverAnchorProps): react_jsx_runtime.JSX.Element;
16
17
 
package/dist/popover.js CHANGED
@@ -66,14 +66,20 @@ var PopoverRoot = (props) => {
66
66
  function PopoverTrigger({ ...props }) {
67
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
68
68
  }
69
+ var Portal2 = ({ disabled, children }) => {
70
+ if (disabled) return children;
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children });
72
+ };
69
73
  function PopoverContent({
70
74
  className,
71
75
  align = "center",
72
76
  sideOffset = 4,
77
+ portalled = true,
78
+ children,
73
79
  ...props
74
80
  }) {
75
81
  const { open, styles } = usePopoverContext();
76
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, { disabled: !portalled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.LazyMotion, { features: import_react.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
83
  PopoverPrimitive.Content,
78
84
  {
79
85
  "data-slot": "popover-content",
@@ -82,13 +88,15 @@ function PopoverContent({
82
88
  className: styles.content({ className }),
83
89
  ...props,
84
90
  asChild: true,
91
+ forceMount: !portalled ? true : void 0,
85
92
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
93
  import_react.motion.div,
87
94
  {
88
95
  animate: "enter",
89
96
  exit: "exit",
90
97
  initial: "initial",
91
- variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity
98
+ variants: import_motion_utils.TRANSITION_VARIANTS.scaleSpringOpacity,
99
+ children
92
100
  }
93
101
  )
94
102
  }
package/dist/popover.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  PopoverContent,
5
5
  PopoverRoot,
6
6
  PopoverTrigger
7
- } from "./chunk-EN5K2552.mjs";
7
+ } from "./chunk-CVZNBNZ4.mjs";
8
8
  export {
9
9
  PopoverAnchor,
10
10
  PopoverContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kopexa/popover",
3
- "version": "4.0.2",
3
+ "version": "5.0.0",
4
4
  "description": "Displays rich content in a portal, triggered by a button.",
5
5
  "keywords": [
6
6
  "popover"
@@ -28,14 +28,14 @@
28
28
  "motion": ">=12.23.6",
29
29
  "react": ">=19.0.0-rc.0",
30
30
  "react-dom": ">=19.0.0-rc.0",
31
- "@kopexa/theme": "1.1.0"
31
+ "@kopexa/theme": "1.2.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@radix-ui/react-popover": "^1.1.14",
35
35
  "@kopexa/use-controllable-state": "1.1.0",
36
36
  "@kopexa/react-utils": "2.0.0",
37
37
  "@kopexa/shared-utils": "1.1.0",
38
- "@kopexa/motion-utils": "4.0.2"
38
+ "@kopexa/motion-utils": "5.0.0"
39
39
  },
40
40
  "clean-package": "../../../clean-package.config.json",
41
41
  "module": "dist/index.mjs",