@addsign/moje-agenda-shared-lib 2.0.40 → 2.0.41

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.
@@ -0,0 +1,234 @@
1
+ import * as React from "react";
2
+ import { a as useCallbackRef, b as composeEventHandlers } from "./index-CDCkSjVs.js";
3
+ import { P as Primitive, d as dispatchDiscreteCustomEvent } from "./index-DoYsULhE.js";
4
+ import { u as useComposedRefs } from "./index-D9mvqz1C.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7
+ const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
8
+ React.useEffect(() => {
9
+ const handleKeyDown = (event) => {
10
+ if (event.key === "Escape") {
11
+ onEscapeKeyDown(event);
12
+ }
13
+ };
14
+ ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
15
+ return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
16
+ }, [onEscapeKeyDown, ownerDocument]);
17
+ }
18
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
19
+ var CONTEXT_UPDATE = "dismissableLayer.update";
20
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
21
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
22
+ var originalBodyPointerEvents;
23
+ var DismissableLayerContext = React.createContext({
24
+ layers: /* @__PURE__ */ new Set(),
25
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
26
+ branches: /* @__PURE__ */ new Set()
27
+ });
28
+ var DismissableLayer = React.forwardRef(
29
+ (props, forwardedRef) => {
30
+ const {
31
+ disableOutsidePointerEvents = false,
32
+ onEscapeKeyDown,
33
+ onPointerDownOutside,
34
+ onFocusOutside,
35
+ onInteractOutside,
36
+ onDismiss,
37
+ ...layerProps
38
+ } = props;
39
+ const context = React.useContext(DismissableLayerContext);
40
+ const [node, setNode] = React.useState(null);
41
+ const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
42
+ const [, force] = React.useState({});
43
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
44
+ const layers = Array.from(context.layers);
45
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
46
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
47
+ const index = node ? layers.indexOf(node) : -1;
48
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
49
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
50
+ const pointerDownOutside = usePointerDownOutside((event) => {
51
+ const target = event.target;
52
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
53
+ if (!isPointerEventsEnabled || isPointerDownOnBranch)
54
+ return;
55
+ onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
56
+ onInteractOutside == null ? void 0 : onInteractOutside(event);
57
+ if (!event.defaultPrevented)
58
+ onDismiss == null ? void 0 : onDismiss();
59
+ }, ownerDocument);
60
+ const focusOutside = useFocusOutside((event) => {
61
+ const target = event.target;
62
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
63
+ if (isFocusInBranch)
64
+ return;
65
+ onFocusOutside == null ? void 0 : onFocusOutside(event);
66
+ onInteractOutside == null ? void 0 : onInteractOutside(event);
67
+ if (!event.defaultPrevented)
68
+ onDismiss == null ? void 0 : onDismiss();
69
+ }, ownerDocument);
70
+ useEscapeKeydown((event) => {
71
+ const isHighestLayer = index === context.layers.size - 1;
72
+ if (!isHighestLayer)
73
+ return;
74
+ onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
75
+ if (!event.defaultPrevented && onDismiss) {
76
+ event.preventDefault();
77
+ onDismiss();
78
+ }
79
+ }, ownerDocument);
80
+ React.useEffect(() => {
81
+ if (!node)
82
+ return;
83
+ if (disableOutsidePointerEvents) {
84
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
85
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
86
+ ownerDocument.body.style.pointerEvents = "none";
87
+ }
88
+ context.layersWithOutsidePointerEventsDisabled.add(node);
89
+ }
90
+ context.layers.add(node);
91
+ dispatchUpdate();
92
+ return () => {
93
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
94
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
95
+ }
96
+ };
97
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
98
+ React.useEffect(() => {
99
+ return () => {
100
+ if (!node)
101
+ return;
102
+ context.layers.delete(node);
103
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
104
+ dispatchUpdate();
105
+ };
106
+ }, [node, context]);
107
+ React.useEffect(() => {
108
+ const handleUpdate = () => force({});
109
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
110
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
111
+ }, []);
112
+ return /* @__PURE__ */ jsx(
113
+ Primitive.div,
114
+ {
115
+ ...layerProps,
116
+ ref: composedRefs,
117
+ style: {
118
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
119
+ ...props.style
120
+ },
121
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
122
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
123
+ onPointerDownCapture: composeEventHandlers(
124
+ props.onPointerDownCapture,
125
+ pointerDownOutside.onPointerDownCapture
126
+ )
127
+ }
128
+ );
129
+ }
130
+ );
131
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
132
+ var BRANCH_NAME = "DismissableLayerBranch";
133
+ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
134
+ const context = React.useContext(DismissableLayerContext);
135
+ const ref = React.useRef(null);
136
+ const composedRefs = useComposedRefs(forwardedRef, ref);
137
+ React.useEffect(() => {
138
+ const node = ref.current;
139
+ if (node) {
140
+ context.branches.add(node);
141
+ return () => {
142
+ context.branches.delete(node);
143
+ };
144
+ }
145
+ }, [context.branches]);
146
+ return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
147
+ });
148
+ DismissableLayerBranch.displayName = BRANCH_NAME;
149
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
150
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
151
+ const isPointerInsideReactTreeRef = React.useRef(false);
152
+ const handleClickRef = React.useRef(() => {
153
+ });
154
+ React.useEffect(() => {
155
+ const handlePointerDown = (event) => {
156
+ if (event.target && !isPointerInsideReactTreeRef.current) {
157
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
158
+ handleAndDispatchCustomEvent(
159
+ POINTER_DOWN_OUTSIDE,
160
+ handlePointerDownOutside,
161
+ eventDetail,
162
+ { discrete: true }
163
+ );
164
+ };
165
+ const eventDetail = { originalEvent: event };
166
+ if (event.pointerType === "touch") {
167
+ ownerDocument.removeEventListener("click", handleClickRef.current);
168
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
169
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
170
+ } else {
171
+ handleAndDispatchPointerDownOutsideEvent2();
172
+ }
173
+ } else {
174
+ ownerDocument.removeEventListener("click", handleClickRef.current);
175
+ }
176
+ isPointerInsideReactTreeRef.current = false;
177
+ };
178
+ const timerId = window.setTimeout(() => {
179
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
180
+ }, 0);
181
+ return () => {
182
+ window.clearTimeout(timerId);
183
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
184
+ ownerDocument.removeEventListener("click", handleClickRef.current);
185
+ };
186
+ }, [ownerDocument, handlePointerDownOutside]);
187
+ return {
188
+ // ensures we check React component tree (not just DOM tree)
189
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
190
+ };
191
+ }
192
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
193
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
194
+ const isFocusInsideReactTreeRef = React.useRef(false);
195
+ React.useEffect(() => {
196
+ const handleFocus = (event) => {
197
+ if (event.target && !isFocusInsideReactTreeRef.current) {
198
+ const eventDetail = { originalEvent: event };
199
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
200
+ discrete: false
201
+ });
202
+ }
203
+ };
204
+ ownerDocument.addEventListener("focusin", handleFocus);
205
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
206
+ }, [ownerDocument, handleFocusOutside]);
207
+ return {
208
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
209
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
210
+ };
211
+ }
212
+ function dispatchUpdate() {
213
+ const event = new CustomEvent(CONTEXT_UPDATE);
214
+ document.dispatchEvent(event);
215
+ }
216
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
217
+ const target = detail.originalEvent.target;
218
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
219
+ if (handler)
220
+ target.addEventListener(name, handler, { once: true });
221
+ if (discrete) {
222
+ dispatchDiscreteCustomEvent(target, event);
223
+ } else {
224
+ target.dispatchEvent(event);
225
+ }
226
+ }
227
+ var Root = DismissableLayer;
228
+ var Branch = DismissableLayerBranch;
229
+ export {
230
+ Branch as B,
231
+ DismissableLayer as D,
232
+ Root as R
233
+ };
234
+ //# sourceMappingURL=index-CDptxuif.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CDptxuif.js","sources":["../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs","../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n if (event.key === \"Escape\") {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\nexport {\n useEscapeKeydown\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/dismissable-layer/src/DismissableLayer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;AAGA,SAAS,iBAAiB,qBAAqB,gBAAgB,yCAAY,UAAU;AACnF,QAAM,kBAAkB,eAAe,mBAAmB;AAC1D,QAAM,UAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAU;AAC/B,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACtB;AAAA,IACP;AACI,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAI,CAAE;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAI,CAAE;AAAA,EAC9F,GAAK,CAAC,iBAAiB,aAAa,CAAC;AACrC;ACJA,IAAI,yBAAyB;AAC7B,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,gBAAgB;AACpB,IAAI;AACJ,IAAI,0BAA0B,MAAM,cAAc;AAAA,EAChD,QAAwB,oBAAI,IAAK;AAAA,EACjC,wCAAwD,oBAAI,IAAK;AAAA,EACjE,UAA0B,oBAAI,IAAK;AACrC,CAAC;AACE,IAAC,mBAAmB,MAAM;AAAA,EAC3B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,8BAA8B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACJ,IAAG;AACJ,UAAM,UAAU,MAAM,WAAW,uBAAuB;AACxD,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,IAAI;AAC3C,UAAM,iBAAgB,6BAAM,mBAAiB,yCAAY;AACzD,UA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ACH;AACG,IAAC,OAAO;AACR,IAAC,SAAS;","x_google_ignoreList":[0,1]}
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { R as ReactDOM, P as Primitive } from "./index-DoYsULhE.js";
3
+ import { u as useLayoutEffect2 } from "./index-CDCkSjVs.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var PORTAL_NAME = "Portal";
6
+ var Portal = React.forwardRef((props, forwardedRef) => {
7
+ var _a;
8
+ const { container: containerProp, ...portalProps } = props;
9
+ const [mounted, setMounted] = React.useState(false);
10
+ useLayoutEffect2(() => setMounted(true), []);
11
+ const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
12
+ return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
13
+ });
14
+ Portal.displayName = PORTAL_NAME;
15
+ export {
16
+ Portal as P
17
+ };
18
+ //# sourceMappingURL=index-CpcwEIT_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CpcwEIT_.js","sources":["../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/portal/src/Portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;AAQA,IAAI,cAAc;AACf,IAAC,SAAS,MAAM,WAAW,CAAC,OAAO,iBAAiB;;AACrD,QAAM,EAAE,WAAW,eAAe,GAAG,YAAW,IAAK;AACrD,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAClDA,mBAAgB,MAAM,WAAW,IAAI,GAAG,CAAE,CAAA;AAC1C,QAAM,YAAY,iBAAiB,aAAW,8CAAY,aAAZ,mBAAsB;AACpE,SAAO,YAAY,SAAS,aAA6B,oBAAI,UAAU,KAAK,EAAE,GAAG,aAAa,KAAK,aAAY,CAAE,GAAG,SAAS,IAAI;AACnI,CAAC;AACD,OAAO,cAAc;","x_google_ignoreList":[0]}