@kopexa/popover 4.0.2 → 4.1.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.
@@ -5,7 +5,7 @@ import {
5
5
  PopoverRoot,
6
6
  PopoverTrigger,
7
7
  __export
8
- } from "./chunk-EN5K2552.mjs";
8
+ } from "./chunk-XCWTKEVD.mjs";
9
9
 
10
10
  // src/namespace.ts
11
11
  var namespace_exports = {};
@@ -40,14 +40,19 @@ 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,
47
52
  ...props
48
53
  }) {
49
54
  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(
55
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsx(Portal2, { disabled: !portalled, children: /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
51
56
  PopoverPrimitive.Content,
52
57
  {
53
58
  "data-slot": "popover-content",
@@ -56,6 +61,7 @@ function PopoverContent({
56
61
  className: styles.content({ className }),
57
62
  ...props,
58
63
  asChild: true,
64
+ forceMount: !portalled ? true : void 0,
59
65
  children: /* @__PURE__ */ jsx(
60
66
  motion.div,
61
67
  {
package/dist/index.js CHANGED
@@ -78,14 +78,19 @@ 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,
85
90
  ...props
86
91
  }) {
87
92
  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)(
93
+ 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
94
  PopoverPrimitive.Content,
90
95
  {
91
96
  "data-slot": "popover-content",
@@ -94,6 +99,7 @@ function PopoverContent({
94
99
  className: styles.content({ className }),
95
100
  ...props,
96
101
  asChild: true,
102
+ forceMount: !portalled ? true : void 0,
97
103
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
104
  import_react.motion.div,
99
105
  {
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-J5PI7XN3.mjs";
5
5
  import {
6
6
  PopoverAnchor,
7
7
  PopoverContent,
8
8
  PopoverRoot,
9
9
  PopoverTrigger
10
- } from "./chunk-EN5K2552.mjs";
10
+ } from "./chunk-XCWTKEVD.mjs";
11
11
  export {
12
12
  namespace_exports as Popover,
13
13
  PopoverAnchor,
package/dist/namespace.js CHANGED
@@ -68,14 +68,19 @@ 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,
75
80
  ...props
76
81
  }) {
77
82
  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)(
83
+ 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
84
  PopoverPrimitive.Content,
80
85
  {
81
86
  "data-slot": "popover-content",
@@ -84,6 +89,7 @@ function PopoverContent({
84
89
  className: styles.content({ className }),
85
90
  ...props,
86
91
  asChild: true,
92
+ forceMount: !portalled ? true : void 0,
87
93
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
94
  import_react.motion.div,
89
95
  {
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import "./chunk-YHIC45AQ.mjs";
2
+ import "./chunk-J5PI7XN3.mjs";
3
3
  import {
4
4
  PopoverAnchor,
5
5
  PopoverContent,
6
6
  PopoverRoot,
7
7
  PopoverTrigger
8
- } from "./chunk-EN5K2552.mjs";
8
+ } from "./chunk-XCWTKEVD.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, ...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, ...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,19 @@ 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,
73
78
  ...props
74
79
  }) {
75
80
  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)(
81
+ 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
82
  PopoverPrimitive.Content,
78
83
  {
79
84
  "data-slot": "popover-content",
@@ -82,6 +87,7 @@ function PopoverContent({
82
87
  className: styles.content({ className }),
83
88
  ...props,
84
89
  asChild: true,
90
+ forceMount: !portalled ? true : void 0,
85
91
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
92
  import_react.motion.div,
87
93
  {
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-XCWTKEVD.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": "4.1.0",
4
4
  "description": "Displays rich content in a portal, triggered by a button.",
5
5
  "keywords": [
6
6
  "popover"
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@radix-ui/react-popover": "^1.1.14",
35
- "@kopexa/use-controllable-state": "1.1.0",
36
35
  "@kopexa/react-utils": "2.0.0",
36
+ "@kopexa/use-controllable-state": "1.1.0",
37
37
  "@kopexa/shared-utils": "1.1.0",
38
38
  "@kopexa/motion-utils": "4.0.2"
39
39
  },