@addsign/moje-agenda-shared-lib 2.0.4 → 2.0.5
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.
- package/dist/Dialog-BtXGfOmv.js +423 -0
- package/dist/Dialog-BtXGfOmv.js.map +1 -0
- package/dist/assets/style.css +15 -0
- package/dist/components/datatable/DataTable.js +2 -1
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +2 -1
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +2 -1
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/FileInput.js +3 -2
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +3 -2
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +2 -1
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +2 -1
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/SelectField.js +2 -1
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +2 -1
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.js +17 -7
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/ScrollArea.js +2 -2
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +180 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/popover.js +7 -6
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/radioGroup.js +7 -5
- package/dist/components/ui/radioGroup.js.map +1 -1
- package/dist/components/ui/select.js +8 -6
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/tooltip.js +6 -5
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/index-BLOUFOiQ.js +2266 -0
- package/dist/index-BLOUFOiQ.js.map +1 -0
- package/dist/index-CA2QNu6z.js +131 -0
- package/dist/index-CA2QNu6z.js.map +1 -0
- package/dist/index-CAxGI0Uw.js +230 -0
- package/dist/index-CAxGI0Uw.js.map +1 -0
- package/dist/index-CDCkSjVs.js +110 -0
- package/dist/index-CDCkSjVs.js.map +1 -0
- package/dist/index-CDlDRp01.js +1173 -0
- package/dist/index-CDlDRp01.js.map +1 -0
- package/dist/index-CshadhlS.js +15 -0
- package/dist/index-CshadhlS.js.map +1 -0
- package/dist/index-DFSwSCB0.js +47 -0
- package/dist/index-DFSwSCB0.js.map +1 -0
- package/dist/index-Deoi9R3y.js +15 -0
- package/dist/index-Deoi9R3y.js.map +1 -0
- package/dist/index-DjvLSytK.js +2203 -0
- package/dist/index-DjvLSytK.js.map +1 -0
- package/dist/index-E5yk6fTE.js +129 -0
- package/dist/index-E5yk6fTE.js.map +1 -0
- package/dist/index-pLFWXSOv.js +40 -0
- package/dist/index-pLFWXSOv.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/lib/components/ui/Combobox.tsx +18 -7
- package/lib/components/ui/checkbox.tsx +30 -0
- package/lib/main.ts +1 -0
- package/package.json +4 -2
- package/tailwind.config.js +97 -0
|
@@ -0,0 +1,230 @@
|
|
|
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-B761_inZ.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
|
+
export {
|
|
228
|
+
DismissableLayer as D
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=index-CAxGI0Uw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CAxGI0Uw.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,UAAM,CAAG,EAAA,KAAK,IAAI,MAAM,SAAS,CAAE,CAAA;AACnC,UAAM,eAA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React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
4
|
+
return function handleEvent(event) {
|
|
5
|
+
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
6
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
7
|
+
return ourEventHandler == null ? void 0 : ourEventHandler(event);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function createContext2(rootComponentName, defaultContext) {
|
|
12
|
+
const Context = React.createContext(defaultContext);
|
|
13
|
+
const Provider = (props) => {
|
|
14
|
+
const { children, ...context } = props;
|
|
15
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
16
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
17
|
+
};
|
|
18
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
19
|
+
function useContext2(consumerName) {
|
|
20
|
+
const context = React.useContext(Context);
|
|
21
|
+
if (context)
|
|
22
|
+
return context;
|
|
23
|
+
if (defaultContext !== void 0)
|
|
24
|
+
return defaultContext;
|
|
25
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
26
|
+
}
|
|
27
|
+
return [Provider, useContext2];
|
|
28
|
+
}
|
|
29
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
30
|
+
let defaultContexts = [];
|
|
31
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
32
|
+
const BaseContext = React.createContext(defaultContext);
|
|
33
|
+
const index = defaultContexts.length;
|
|
34
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
35
|
+
const Provider = (props) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const { scope, children, ...context } = props;
|
|
38
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
39
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
40
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
41
|
+
};
|
|
42
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
43
|
+
function useContext2(consumerName, scope) {
|
|
44
|
+
var _a;
|
|
45
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
46
|
+
const context = React.useContext(Context);
|
|
47
|
+
if (context)
|
|
48
|
+
return context;
|
|
49
|
+
if (defaultContext !== void 0)
|
|
50
|
+
return defaultContext;
|
|
51
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
52
|
+
}
|
|
53
|
+
return [Provider, useContext2];
|
|
54
|
+
}
|
|
55
|
+
const createScope = () => {
|
|
56
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
57
|
+
return React.createContext(defaultContext);
|
|
58
|
+
});
|
|
59
|
+
return function useScope(scope) {
|
|
60
|
+
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
61
|
+
return React.useMemo(
|
|
62
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
63
|
+
[scope, contexts]
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
createScope.scopeName = scopeName;
|
|
68
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
69
|
+
}
|
|
70
|
+
function composeContextScopes(...scopes) {
|
|
71
|
+
const baseScope = scopes[0];
|
|
72
|
+
if (scopes.length === 1)
|
|
73
|
+
return baseScope;
|
|
74
|
+
const createScope = () => {
|
|
75
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
76
|
+
useScope: createScope2(),
|
|
77
|
+
scopeName: createScope2.scopeName
|
|
78
|
+
}));
|
|
79
|
+
return function useComposedScopes(overrideScopes) {
|
|
80
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
81
|
+
const scopeProps = useScope(overrideScopes);
|
|
82
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
83
|
+
return { ...nextScopes2, ...currentScope };
|
|
84
|
+
}, {});
|
|
85
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
createScope.scopeName = baseScope.scopeName;
|
|
89
|
+
return createScope;
|
|
90
|
+
}
|
|
91
|
+
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
|
|
92
|
+
};
|
|
93
|
+
function useCallbackRef(callback) {
|
|
94
|
+
const callbackRef = React.useRef(callback);
|
|
95
|
+
React.useEffect(() => {
|
|
96
|
+
callbackRef.current = callback;
|
|
97
|
+
});
|
|
98
|
+
return React.useMemo(() => (...args) => {
|
|
99
|
+
var _a;
|
|
100
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
101
|
+
}, []);
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
useCallbackRef as a,
|
|
105
|
+
composeEventHandlers as b,
|
|
106
|
+
createContextScope as c,
|
|
107
|
+
createContext2 as d,
|
|
108
|
+
useLayoutEffect2 as u
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=index-CDCkSjVs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CDCkSjVs.js","sources":["../node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/@radix-ui/react-context/dist/index.mjs","../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-layout-effect/src/useLayoutEffect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-callback-ref/src/useCallbackRef.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AACA,SAAS,qBAAqB,sBAAsB,iBAAiB,EAAE,2BAA2B,KAAM,IAAG,IAAI;AAC7G,SAAO,SAAS,YAAY,OAAO;AACjC,iEAAuB;AACvB,QAAI,6BAA6B,SAAS,CAAC,MAAM,kBAAkB;AACjE,aAAO,mDAAkB;AAAA,IAC1B;AAAA,EACL;AACA;ACLA,SAAS,eAAe,mBAAmB,gBAAgB;AACzD,QAAM,UAAU,MAAM,cAAc,cAAc;AAClD,QAAM,WAAW,CAAC,UAAU;AAC1B,UAAM,EAAE,UAAU,GAAG,QAAO,IAAK;AACjC,UAAM,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACj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