@wirekyt/react 0.0.1 → 0.0.3
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/accordion.cjs +209 -0
- package/dist/accordion.d.cts +69 -0
- package/dist/accordion.d.ts +69 -0
- package/dist/accordion.js +184 -0
- package/dist/angle-slider.cjs +193 -0
- package/dist/angle-slider.d.cts +73 -0
- package/dist/angle-slider.d.ts +73 -0
- package/dist/angle-slider.js +168 -0
- package/dist/avatar.cjs +120 -0
- package/dist/avatar.d.cts +48 -0
- package/dist/avatar.d.ts +48 -0
- package/dist/avatar.js +100 -0
- package/dist/carousel.cjs +246 -0
- package/dist/carousel.d.cts +94 -0
- package/dist/carousel.d.ts +94 -0
- package/dist/carousel.js +223 -0
- package/dist/checkbox.cjs +284 -0
- package/dist/checkbox.d.cts +115 -0
- package/dist/checkbox.d.ts +115 -0
- package/dist/checkbox.js +263 -0
- package/dist/client-only.cjs +12 -0
- package/dist/client-only.d.cts +8 -0
- package/dist/client-only.d.ts +8 -0
- package/dist/client-only.js +11 -0
- package/dist/clipboard.cjs +174 -0
- package/dist/clipboard.d.cts +70 -0
- package/dist/clipboard.d.ts +70 -0
- package/dist/clipboard.js +150 -0
- package/dist/collapsible-B62i_oPJ.cjs +185 -0
- package/dist/collapsible-CiTNjCNf.js +131 -0
- package/dist/collapsible.cjs +23 -0
- package/dist/collapsible.d.cts +56 -0
- package/dist/collapsible.d.ts +56 -0
- package/dist/collapsible.js +2 -0
- package/dist/collection-BFjWNdUS.cjs +223 -0
- package/dist/collection-BJOl6a4H.js +180 -0
- package/dist/collection.cjs +9 -0
- package/dist/collection.d.cts +2 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/color-picker.cjs +575 -0
- package/dist/color-picker.d.cts +179 -0
- package/dist/color-picker.d.ts +179 -0
- package/dist/color-picker.js +530 -0
- package/dist/combobox.cjs +390 -0
- package/dist/combobox.d.cts +128 -0
- package/dist/combobox.d.ts +128 -0
- package/dist/combobox.js +359 -0
- package/dist/core-CBFAnVIP.cjs +375 -0
- package/dist/core-CEYOEcVI.js +357 -0
- package/dist/date-input.cjs +217 -0
- package/dist/date-input.d.cts +69 -0
- package/dist/date-input.d.ts +69 -0
- package/dist/date-input.js +193 -0
- package/dist/date-picker.cjs +588 -0
- package/dist/date-picker.d.cts +190 -0
- package/dist/date-picker.d.ts +190 -0
- package/dist/date-picker.js +543 -0
- package/dist/dialog.cjs +199 -0
- package/dist/dialog.d.cts +78 -0
- package/dist/dialog.d.ts +78 -0
- package/dist/dialog.js +174 -0
- package/dist/download-trigger.cjs +53 -0
- package/dist/download-trigger.d.cts +22 -0
- package/dist/download-trigger.d.ts +22 -0
- package/dist/download-trigger.js +51 -0
- package/dist/drawer.cjs +296 -0
- package/dist/drawer.d.cts +115 -0
- package/dist/drawer.d.ts +115 -0
- package/dist/drawer.js +264 -0
- package/dist/editable.cjs +228 -0
- package/dist/editable.d.cts +79 -0
- package/dist/editable.d.ts +79 -0
- package/dist/editable.js +202 -0
- package/dist/environment-B6IaCAuQ.cjs +59 -0
- package/dist/environment-BTgKwk5E.js +42 -0
- package/dist/factory--dkoVnFK.d.cts +14 -0
- package/dist/factory--dkoVnFK.d.ts +14 -0
- package/dist/factory-CFFufs5e.cjs +59 -0
- package/dist/factory-Nm__-4xn.js +48 -0
- package/dist/field-Cy1E02DH.js +349 -0
- package/dist/field-x8H5uXB9.cjs +438 -0
- package/dist/field.cjs +22 -0
- package/dist/field.d.cts +129 -0
- package/dist/field.d.ts +129 -0
- package/dist/field.js +2 -0
- package/dist/fieldset-DWZXj1t5.cjs +232 -0
- package/dist/fieldset-fx44GCtM.js +178 -0
- package/dist/fieldset.cjs +18 -0
- package/dist/fieldset.d.cts +71 -0
- package/dist/fieldset.d.ts +71 -0
- package/dist/fieldset.js +3 -0
- package/dist/file-upload.cjs +328 -0
- package/dist/file-upload.d.cts +101 -0
- package/dist/file-upload.d.ts +101 -0
- package/dist/file-upload.js +298 -0
- package/dist/floating-panel.cjs +271 -0
- package/dist/floating-panel.d.cts +98 -0
- package/dist/floating-panel.d.ts +98 -0
- package/dist/floating-panel.js +242 -0
- package/dist/format.cjs +64 -0
- package/dist/format.d.cts +44 -0
- package/dist/format.d.ts +44 -0
- package/dist/format.js +54 -0
- package/dist/frame.cjs +85 -0
- package/dist/frame.d.cts +12 -0
- package/dist/frame.d.ts +12 -0
- package/dist/frame.js +84 -0
- package/dist/highlight.cjs +29 -0
- package/dist/highlight.d.cts +13 -0
- package/dist/highlight.d.ts +13 -0
- package/dist/highlight.js +27 -0
- package/dist/hover-card.cjs +154 -0
- package/dist/hover-card.d.cts +68 -0
- package/dist/hover-card.d.ts +68 -0
- package/dist/hover-card.js +131 -0
- package/dist/image-cropper.cjs +0 -0
- package/dist/image-cropper.d.cts +1 -0
- package/dist/image-cropper.d.ts +1 -0
- package/dist/image-cropper.js +0 -0
- package/dist/index-3Al0R5bH.d.cts +73 -0
- package/dist/index-B7wAg5Wf.d.ts +146 -0
- package/dist/index-BAn8qiCM.d.ts +73 -0
- package/dist/index-BSX88T_g.d.cts +146 -0
- package/dist/index-CQAbOgb7.d.cts +23 -0
- package/dist/index-CW-Aj6aT.d.ts +95 -0
- package/dist/index-CxWYgVJk.d.ts +23 -0
- package/dist/index-DRnET7mJ.d.ts +33 -0
- package/dist/index-DTLK6Fuh.d.cts +95 -0
- package/dist/index-DyTY8HEb.d.cts +33 -0
- package/dist/index-srZfUQNt.d.cts +20 -0
- package/dist/index-srZfUQNt.d.ts +20 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/json-tree-view.cjs +244 -0
- package/dist/json-tree-view.d.cts +45 -0
- package/dist/json-tree-view.d.ts +45 -0
- package/dist/json-tree-view.js +234 -0
- package/dist/listbox.cjs +290 -0
- package/dist/listbox.d.cts +109 -0
- package/dist/listbox.d.ts +109 -0
- package/dist/listbox.js +264 -0
- package/dist/marquee.cjs +164 -0
- package/dist/marquee.d.cts +60 -0
- package/dist/marquee.d.ts +60 -0
- package/dist/marquee.js +142 -0
- package/dist/menu.cjs +506 -0
- package/dist/menu.d.cts +162 -0
- package/dist/menu.d.ts +162 -0
- package/dist/menu.js +469 -0
- package/dist/navigation-menu.cjs +331 -0
- package/dist/navigation-menu.d.cts +89 -0
- package/dist/navigation-menu.d.ts +89 -0
- package/dist/navigation-menu.js +303 -0
- package/dist/number-input.cjs +222 -0
- package/dist/number-input.d.cts +73 -0
- package/dist/number-input.d.ts +73 -0
- package/dist/number-input.js +197 -0
- package/dist/pagination.cjs +183 -0
- package/dist/pagination.d.cts +68 -0
- package/dist/pagination.d.ts +68 -0
- package/dist/pagination.js +159 -0
- package/dist/password-input.cjs +179 -0
- package/dist/password-input.d.cts +65 -0
- package/dist/password-input.d.ts +65 -0
- package/dist/password-input.js +156 -0
- package/dist/pin-input.cjs +180 -0
- package/dist/pin-input.d.cts +58 -0
- package/dist/pin-input.d.ts +58 -0
- package/dist/pin-input.js +158 -0
- package/dist/popover.cjs +222 -0
- package/dist/popover.d.cts +93 -0
- package/dist/popover.d.ts +93 -0
- package/dist/popover.js +194 -0
- package/dist/portal-6_XzBXiA.cjs +33 -0
- package/dist/portal-QYL_2wB0.js +28 -0
- package/dist/portal.cjs +3 -0
- package/dist/portal.d.cts +9 -0
- package/dist/portal.d.ts +9 -0
- package/dist/portal.js +2 -0
- package/dist/presence-BOs-D6Cv.cjs +96 -0
- package/dist/presence-I8Rceflw.js +65 -0
- package/dist/presence.cjs +7 -0
- package/dist/presence.d.cts +2 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +2 -0
- package/dist/progress.cjs +206 -0
- package/dist/progress.d.cts +78 -0
- package/dist/progress.d.ts +78 -0
- package/dist/progress.js +180 -0
- package/dist/providers-DrJEJcrE.cjs +128 -0
- package/dist/providers-FEHnDTvb.js +87 -0
- package/dist/qr-code.cjs +154 -0
- package/dist/qr-code.d.cts +58 -0
- package/dist/qr-code.d.ts +58 -0
- package/dist/qr-code.js +132 -0
- package/dist/radio-group.cjs +222 -0
- package/dist/radio-group.d.cts +78 -0
- package/dist/radio-group.d.ts +78 -0
- package/dist/radio-group.js +196 -0
- package/dist/rating-group.cjs +186 -0
- package/dist/rating-group.d.cts +68 -0
- package/dist/rating-group.d.ts +68 -0
- package/dist/rating-group.js +162 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
- package/dist/scroll-area.cjs +166 -0
- package/dist/scroll-area.d.cts +67 -0
- package/dist/scroll-area.d.ts +67 -0
- package/dist/scroll-area.js +143 -0
- package/dist/segment-group.cjs +215 -0
- package/dist/segment-group.d.cts +81 -0
- package/dist/segment-group.d.ts +81 -0
- package/dist/segment-group.js +194 -0
- package/dist/select.cjs +395 -0
- package/dist/select.d.cts +132 -0
- package/dist/select.d.ts +132 -0
- package/dist/select.js +358 -0
- package/dist/signature-pad.cjs +197 -0
- package/dist/signature-pad.d.cts +68 -0
- package/dist/signature-pad.d.ts +68 -0
- package/dist/signature-pad.js +173 -0
- package/dist/slider.cjs +260 -0
- package/dist/slider.d.cts +88 -0
- package/dist/slider.d.ts +88 -0
- package/dist/slider.js +232 -0
- package/dist/steps.cjs +271 -0
- package/dist/steps.d.cts +104 -0
- package/dist/steps.d.ts +104 -0
- package/dist/steps.js +241 -0
- package/dist/swap.cjs +134 -0
- package/dist/swap.d.cts +49 -0
- package/dist/swap.d.ts +49 -0
- package/dist/swap.js +121 -0
- package/dist/switch.cjs +166 -0
- package/dist/switch.d.cts +58 -0
- package/dist/switch.d.ts +58 -0
- package/dist/switch.js +144 -0
- package/dist/tabs.cjs +177 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +155 -0
- package/dist/tags-input.cjs +298 -0
- package/dist/tags-input.d.cts +98 -0
- package/dist/tags-input.d.ts +98 -0
- package/dist/tags-input.js +268 -0
- package/dist/timer.cjs +167 -0
- package/dist/timer.d.cts +63 -0
- package/dist/timer.d.ts +63 -0
- package/dist/timer.js +144 -0
- package/dist/toast.cjs +154 -0
- package/dist/toast.d.cts +59 -0
- package/dist/toast.d.ts +59 -0
- package/dist/toast.js +132 -0
- package/dist/toggle-group.cjs +118 -0
- package/dist/toggle-group.d.cts +43 -0
- package/dist/toggle-group.d.ts +43 -0
- package/dist/toggle-group.js +99 -0
- package/dist/toggle.cjs +85 -0
- package/dist/toggle.d.cts +38 -0
- package/dist/toggle.d.ts +38 -0
- package/dist/toggle.js +71 -0
- package/dist/tooltip.cjs +154 -0
- package/dist/tooltip.d.cts +68 -0
- package/dist/tooltip.d.ts +68 -0
- package/dist/tooltip.js +131 -0
- package/dist/tour.cjs +290 -0
- package/dist/tour.d.cts +112 -0
- package/dist/tour.d.ts +112 -0
- package/dist/tour.js +246 -0
- package/dist/tree-view-CNTEWXlu.js +339 -0
- package/dist/tree-view-CU4Hl5X1.cjs +484 -0
- package/dist/tree-view.cjs +41 -0
- package/dist/tree-view.d.cts +3 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/types-BQQfrr86.d.cts +6 -0
- package/dist/types-BQQfrr86.d.ts +6 -0
- package/dist/use-context-38DKWHsx.cjs +20 -0
- package/dist/use-context-CITa6pn9.js +10 -0
- package/dist/utils-Cfwm9WW1.cjs +166 -0
- package/dist/utils-CqLmqrgj.js +107 -0
- package/package.json +274 -6
package/dist/frame.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { l as useComposedRefs, n as useSafeLayoutEffect } from "./utils-CqLmqrgj.js";
|
|
2
|
+
import { t as EnvironmentProvider } from "./environment-BTgKwk5E.js";
|
|
3
|
+
import "./providers-FEHnDTvb.js";
|
|
4
|
+
import { forwardRef, useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/frame/content.tsx
|
|
8
|
+
const FrameContent = (props) => {
|
|
9
|
+
const { onMount, onUnmount, children } = props;
|
|
10
|
+
const mountedRef = useRef(false);
|
|
11
|
+
const calledRef = useRef(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!mountedRef.current && !calledRef.current) {
|
|
14
|
+
onMount?.();
|
|
15
|
+
mountedRef.current = true;
|
|
16
|
+
calledRef.current = true;
|
|
17
|
+
}
|
|
18
|
+
return () => {
|
|
19
|
+
if (mountedRef.current) {
|
|
20
|
+
onUnmount?.();
|
|
21
|
+
mountedRef.current = false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
return children;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/frame/frame.tsx
|
|
29
|
+
const initialSrcDoc = `<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class="frame-root"></div></body></html>`;
|
|
30
|
+
function getMountNode(frame) {
|
|
31
|
+
const doc = frame.contentWindow?.document;
|
|
32
|
+
if (!doc) return null;
|
|
33
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
34
|
+
}
|
|
35
|
+
const Frame = forwardRef((props, ref) => {
|
|
36
|
+
const { children, head, onMount, onUnmount, srcDoc = initialSrcDoc, ...rest } = props;
|
|
37
|
+
const [frameRef, setFrameRef] = useState(null);
|
|
38
|
+
const [mountNode, setMountNode] = useState(null);
|
|
39
|
+
const composedRefs = useComposedRefs(ref, setFrameRef);
|
|
40
|
+
useSafeLayoutEffect(() => {
|
|
41
|
+
if (!frameRef) return;
|
|
42
|
+
const doc = frameRef.contentWindow?.document;
|
|
43
|
+
if (!doc) return;
|
|
44
|
+
doc.open();
|
|
45
|
+
doc.write(srcDoc);
|
|
46
|
+
doc.close();
|
|
47
|
+
setMountNode(getMountNode(frameRef));
|
|
48
|
+
}, [frameRef, srcDoc]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!frameRef?.contentDocument) return;
|
|
51
|
+
const win = frameRef.contentWindow;
|
|
52
|
+
if (!win) return;
|
|
53
|
+
const mountNode = getMountNode(frameRef);
|
|
54
|
+
if (!mountNode) return;
|
|
55
|
+
const exec = () => {
|
|
56
|
+
win.requestAnimationFrame(() => {
|
|
57
|
+
if (!frameRef.contentDocument?.documentElement) return;
|
|
58
|
+
frameRef.style.setProperty("--width", `${mountNode.scrollWidth}px`);
|
|
59
|
+
frameRef.style.setProperty("--height", `${mountNode.scrollHeight}px`);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
63
|
+
exec();
|
|
64
|
+
if (frameRef.contentDocument) resizeObserver.observe(mountNode);
|
|
65
|
+
return () => {
|
|
66
|
+
resizeObserver.disconnect();
|
|
67
|
+
};
|
|
68
|
+
}, [frameRef]);
|
|
69
|
+
return /* @__PURE__ */ jsx(EnvironmentProvider, {
|
|
70
|
+
value: () => frameRef?.contentDocument ?? document,
|
|
71
|
+
children: /* @__PURE__ */ jsxs("iframe", {
|
|
72
|
+
title: `frame:${useId()}`,
|
|
73
|
+
ref: composedRefs,
|
|
74
|
+
...rest,
|
|
75
|
+
children: [mountNode ? createPortal(/* @__PURE__ */ jsx(FrameContent, {
|
|
76
|
+
onMount,
|
|
77
|
+
onUnmount,
|
|
78
|
+
children
|
|
79
|
+
}), mountNode) : null, head && frameRef ? createPortal(head, frameRef.contentDocument.head) : null]
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
//#endregion
|
|
84
|
+
export { Frame };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let _wirekyt_dom_highlight_word = require("@wirekyt/dom/highlight-word");
|
|
6
|
+
//#region src/components/highlight/use.ts
|
|
7
|
+
const useHighlight = (props) => {
|
|
8
|
+
return (0, react.useMemo)(() => (0, _wirekyt_dom_highlight_word.highlightWord)(props), [props]);
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/highlight/highlight.tsx
|
|
12
|
+
const splitHighlightBaseProps = require_utils.createSplitProps();
|
|
13
|
+
const Highlight = (props) => {
|
|
14
|
+
if (typeof props.text !== "string") throw new Error("[wirekyt/highlight] text must be a string");
|
|
15
|
+
const [highlightProps, localProps] = splitHighlightBaseProps(props, [
|
|
16
|
+
"query",
|
|
17
|
+
"text",
|
|
18
|
+
"ignoreCase",
|
|
19
|
+
"matchAll",
|
|
20
|
+
"exactMatch"
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: useHighlight(highlightProps).map(({ text, match }, i) => match ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("mark", {
|
|
23
|
+
...localProps,
|
|
24
|
+
children: text
|
|
25
|
+
}, i) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: text }, i)) });
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.Highlight = Highlight;
|
|
29
|
+
exports.useHighlight = useHighlight;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./index-CQAbOgb7.cjs";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.cjs";
|
|
3
|
+
import { HighlightChunk, HighlightWordProps } from "@wirekyt/dom/highlight-word";
|
|
4
|
+
//#region src/components/highlight/use.d.ts
|
|
5
|
+
interface UseHighlightProps extends HighlightWordProps {}
|
|
6
|
+
declare const useHighlight: (props: UseHighlightProps) => HighlightChunk[];
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/highlight/highlight.d.ts
|
|
9
|
+
interface HighlightBaseProps extends UseHighlightProps {}
|
|
10
|
+
interface HighlightProps extends Assign<React.ComponentProps<"mark">, HighlightBaseProps> {}
|
|
11
|
+
declare const Highlight: (props: HighlightProps) => import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./index-CxWYgVJk.js";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.js";
|
|
3
|
+
import { HighlightChunk, HighlightWordProps } from "@wirekyt/dom/highlight-word";
|
|
4
|
+
//#region src/components/highlight/use.d.ts
|
|
5
|
+
interface UseHighlightProps extends HighlightWordProps {}
|
|
6
|
+
declare const useHighlight: (props: UseHighlightProps) => HighlightChunk[];
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/highlight/highlight.d.ts
|
|
9
|
+
interface HighlightBaseProps extends UseHighlightProps {}
|
|
10
|
+
interface HighlightProps extends Assign<React.ComponentProps<"mark">, HighlightBaseProps> {}
|
|
11
|
+
declare const Highlight: (props: HighlightProps) => import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { c as createSplitProps } from "./utils-CqLmqrgj.js";
|
|
2
|
+
import { Fragment, useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { highlightWord } from "@wirekyt/dom/highlight-word";
|
|
5
|
+
//#region src/components/highlight/use.ts
|
|
6
|
+
const useHighlight = (props) => {
|
|
7
|
+
return useMemo(() => highlightWord(props), [props]);
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/components/highlight/highlight.tsx
|
|
11
|
+
const splitHighlightBaseProps = createSplitProps();
|
|
12
|
+
const Highlight = (props) => {
|
|
13
|
+
if (typeof props.text !== "string") throw new Error("[wirekyt/highlight] text must be a string");
|
|
14
|
+
const [highlightProps, localProps] = splitHighlightBaseProps(props, [
|
|
15
|
+
"query",
|
|
16
|
+
"text",
|
|
17
|
+
"ignoreCase",
|
|
18
|
+
"matchAll",
|
|
19
|
+
"exactMatch"
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ jsx(Fragment, { children: useHighlight(highlightProps).map(({ text, match }, i) => match ? /* @__PURE__ */ jsx("mark", {
|
|
22
|
+
...localProps,
|
|
23
|
+
children: text
|
|
24
|
+
}, i) : /* @__PURE__ */ jsx(Fragment, { children: text }, i)) });
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Highlight, useHighlight };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
4
|
+
const require_environment = require("./environment-B6IaCAuQ.cjs");
|
|
5
|
+
const require_core = require("./core-CBFAnVIP.cjs");
|
|
6
|
+
const require_factory = require("./factory-CFFufs5e.cjs");
|
|
7
|
+
const require_providers = require("./providers-DrJEJcrE.cjs");
|
|
8
|
+
const require_presence = require("./presence-BOs-D6Cv.cjs");
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let _wirekyt_dom_machines_hover_card = require("@wirekyt/dom/machines/hover-card");
|
|
12
|
+
_wirekyt_dom_machines_hover_card = require_rolldown_runtime.__toESM(_wirekyt_dom_machines_hover_card, 1);
|
|
13
|
+
let _wirekyt_dom = require("@wirekyt/dom");
|
|
14
|
+
//#region src/components/hover-card/use-context.ts
|
|
15
|
+
const [HoverCardProvider, useHoverCardContext] = require_utils.createContext({
|
|
16
|
+
name: "HoverCardContext",
|
|
17
|
+
hookName: "useHoverCardContext",
|
|
18
|
+
providerName: "<HoverCardProvider />"
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/hover-card/arrow.tsx
|
|
22
|
+
const HoverCardArrow = (0, react.forwardRef)((props, ref) => {
|
|
23
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useHoverCardContext().getArrowProps(), props);
|
|
24
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
25
|
+
...mergedProps,
|
|
26
|
+
ref
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
HoverCardArrow.displayName = "HoverCardArrow";
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/hover-card/arrow-tip.tsx
|
|
32
|
+
const HoverCardArrowTip = (0, react.forwardRef)((props, ref) => {
|
|
33
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useHoverCardContext().getArrowTipProps(), props);
|
|
34
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
35
|
+
...mergedProps,
|
|
36
|
+
ref
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
HoverCardArrowTip.displayName = "HoverCardArrowTip";
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/hover-card/content.tsx
|
|
42
|
+
const HoverCardContent = (0, react.forwardRef)((props, ref) => {
|
|
43
|
+
const hoverCard = useHoverCardContext();
|
|
44
|
+
const presence = require_presence.usePresenceContext();
|
|
45
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(hoverCard.getContentProps(), presence.getPresenceProps(), props);
|
|
46
|
+
const composedRefs = require_utils.useComposedRefs(presence.ref, ref);
|
|
47
|
+
if (presence.unmounted) return null;
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
49
|
+
...mergedProps,
|
|
50
|
+
ref: composedRefs
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/hover-card/context.tsx
|
|
56
|
+
const HoverCardContext = (props) => props.children(useHoverCardContext());
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/hover-card/positioner.tsx
|
|
59
|
+
const HoverCardPositioner = (0, react.forwardRef)((props, ref) => {
|
|
60
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useHoverCardContext().getPositionerProps(), props);
|
|
61
|
+
if (require_presence.usePresenceContext().unmounted) return null;
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
63
|
+
...mergedProps,
|
|
64
|
+
ref
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
HoverCardPositioner.displayName = "HoverCardPositioner";
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/hover-card/use.ts
|
|
70
|
+
const useHoverCard = (props) => {
|
|
71
|
+
const id = (0, react.useId)();
|
|
72
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
73
|
+
const { dir } = require_providers.useLocaleContext();
|
|
74
|
+
const machineProps = {
|
|
75
|
+
id,
|
|
76
|
+
dir,
|
|
77
|
+
getRootNode,
|
|
78
|
+
...props
|
|
79
|
+
};
|
|
80
|
+
const service = require_core.useMachine(_wirekyt_dom_machines_hover_card.machine, machineProps);
|
|
81
|
+
return _wirekyt_dom_machines_hover_card.connect(service, require_core.normalizeProps);
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/hover-card/root.tsx
|
|
85
|
+
const HoverCardRoot = (props) => {
|
|
86
|
+
const [presenceProps, { children, ...localProps }] = require_presence.splitPresenceProps(props);
|
|
87
|
+
const hoverCard = useHoverCard(localProps);
|
|
88
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HoverCardProvider, {
|
|
89
|
+
value: hoverCard,
|
|
90
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_presence.PresenceProvider, {
|
|
91
|
+
value: require_presence.usePresence((0, _wirekyt_dom.mergeProps)({ present: hoverCard.open }, presenceProps)),
|
|
92
|
+
children
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/hover-card/root-provider.tsx
|
|
98
|
+
const HoverCardRootProvider = (props) => {
|
|
99
|
+
const [presenceProps, { value: hoverCard, children }] = require_presence.splitPresenceProps(props);
|
|
100
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HoverCardProvider, {
|
|
101
|
+
value: hoverCard,
|
|
102
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_presence.PresenceProvider, {
|
|
103
|
+
value: require_presence.usePresence((0, _wirekyt_dom.mergeProps)({ present: hoverCard.open }, presenceProps)),
|
|
104
|
+
children
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/hover-card/trigger.tsx
|
|
110
|
+
const splitTriggerProps = require_utils.createSplitProps();
|
|
111
|
+
const HoverCardTrigger = (0, react.forwardRef)((props, ref) => {
|
|
112
|
+
const [triggerProps, localProps] = splitTriggerProps(props, ["value"]);
|
|
113
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(useHoverCardContext().getTriggerProps(triggerProps), localProps);
|
|
114
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.button, {
|
|
115
|
+
...mergedProps,
|
|
116
|
+
ref
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/components/hover-card/hover-card.ts
|
|
122
|
+
var hover_card_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
123
|
+
Arrow: () => HoverCardArrow,
|
|
124
|
+
ArrowTip: () => HoverCardArrowTip,
|
|
125
|
+
Content: () => HoverCardContent,
|
|
126
|
+
Context: () => HoverCardContext,
|
|
127
|
+
Positioner: () => HoverCardPositioner,
|
|
128
|
+
Root: () => HoverCardRoot,
|
|
129
|
+
RootProvider: () => HoverCardRootProvider,
|
|
130
|
+
Trigger: () => HoverCardTrigger
|
|
131
|
+
});
|
|
132
|
+
//#endregion
|
|
133
|
+
Object.defineProperty(exports, "HoverCard", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function() {
|
|
136
|
+
return hover_card_exports;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
exports.HoverCardArrow = HoverCardArrow;
|
|
140
|
+
exports.HoverCardArrowTip = HoverCardArrowTip;
|
|
141
|
+
exports.HoverCardContent = HoverCardContent;
|
|
142
|
+
exports.HoverCardContext = HoverCardContext;
|
|
143
|
+
exports.HoverCardPositioner = HoverCardPositioner;
|
|
144
|
+
exports.HoverCardRoot = HoverCardRoot;
|
|
145
|
+
exports.HoverCardRootProvider = HoverCardRootProvider;
|
|
146
|
+
exports.HoverCardTrigger = HoverCardTrigger;
|
|
147
|
+
Object.defineProperty(exports, "hoverCardAnatomy", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return _wirekyt_dom_machines_hover_card.anatomy;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
exports.useHoverCard = useHoverCard;
|
|
154
|
+
exports.useHoverCardContext = useHoverCardContext;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CQAbOgb7.cjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "./types-BQQfrr86.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.cjs";
|
|
4
|
+
import { c as UsePresenceProps } from "./index-DyTY8HEb.cjs";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as hoverCard from "@wirekyt/dom/machines/hover-card";
|
|
7
|
+
import { FocusOutsideEvent, FocusOutsideEvent as HoverCardFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as HoverCardInteractOutsideEvent, OpenChangeDetails, OpenChangeDetails as HoverCardOpenChangeDetails, PointerDownOutsideEvent, PointerDownOutsideEvent as HoverCardPointerDownOutsideEvent, TriggerProps, TriggerValueChangeDetails, TriggerValueChangeDetails as HoverCardTriggerValueChangeDetails, anatomy as hoverCardAnatomy } from "@wirekyt/dom/machines/hover-card";
|
|
8
|
+
//#region src/components/hover-card/arrow.d.ts
|
|
9
|
+
interface HoverCardArrowBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface HoverCardArrowProps extends HTMLProps<"div">, HoverCardArrowBaseProps {}
|
|
11
|
+
declare const HoverCardArrow: import("react").ForwardRefExoticComponent<HoverCardArrowProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/hover-card/arrow-tip.d.ts
|
|
14
|
+
interface HoverCardArrowTipBaseProps extends PolymorphicProps {}
|
|
15
|
+
interface HoverCardArrowTipProps extends HTMLProps<"div">, HoverCardArrowTipBaseProps {}
|
|
16
|
+
declare const HoverCardArrowTip: import("react").ForwardRefExoticComponent<HoverCardArrowTipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/hover-card/content.d.ts
|
|
19
|
+
interface HoverCardContentBaseProps extends PolymorphicProps {}
|
|
20
|
+
interface HoverCardContentProps extends HTMLProps<"div">, HoverCardContentBaseProps {}
|
|
21
|
+
declare const HoverCardContent: import("react").ForwardRefExoticComponent<HoverCardContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/hover-card/use.d.ts
|
|
24
|
+
interface UseHoverCardProps extends Optional<Omit<hoverCard.Props, "dir" | "getRootNode">, "id"> {}
|
|
25
|
+
interface UseHoverCardReturn extends hoverCard.Api<PropTypes> {}
|
|
26
|
+
declare const useHoverCard: (props?: UseHoverCardProps) => UseHoverCardReturn;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/hover-card/use-context.d.ts
|
|
29
|
+
interface UseHoverCardContext extends UseHoverCardReturn {}
|
|
30
|
+
declare const HoverCardProvider: import("react").Provider<UseHoverCardContext>, useHoverCardContext: () => UseHoverCardContext;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/hover-card/context.d.ts
|
|
33
|
+
interface HoverCardContextProps {
|
|
34
|
+
children: (context: UseHoverCardContext) => ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare const HoverCardContext: (props: HoverCardContextProps) => ReactNode;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/hover-card/positioner.d.ts
|
|
39
|
+
interface HoverCardPositionerBaseProps extends PolymorphicProps {}
|
|
40
|
+
interface HoverCardPositionerProps extends HTMLProps<"div">, HoverCardPositionerBaseProps {}
|
|
41
|
+
declare const HoverCardPositioner: import("react").ForwardRefExoticComponent<HoverCardPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/hover-card/root.d.ts
|
|
44
|
+
interface HoverCardRootBaseProps extends UseHoverCardProps, UsePresenceProps {}
|
|
45
|
+
interface HoverCardRootProps extends HoverCardRootBaseProps {
|
|
46
|
+
children?: ReactNode | undefined;
|
|
47
|
+
}
|
|
48
|
+
declare const HoverCardRoot: (props: HoverCardRootProps) => import("react").JSX.Element;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/hover-card/root-provider.d.ts
|
|
51
|
+
interface RootProviderProps {
|
|
52
|
+
value: UseHoverCardReturn;
|
|
53
|
+
}
|
|
54
|
+
interface HoverCardRootProviderBaseProps extends RootProviderProps, UsePresenceProps {}
|
|
55
|
+
interface HoverCardRootProviderProps extends HoverCardRootProviderBaseProps {
|
|
56
|
+
children?: ReactNode | undefined;
|
|
57
|
+
}
|
|
58
|
+
declare const HoverCardRootProvider: (props: HoverCardRootProviderProps) => import("react").JSX.Element;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/hover-card/trigger.d.ts
|
|
61
|
+
interface HoverCardTriggerBaseProps extends TriggerProps, PolymorphicProps {}
|
|
62
|
+
interface HoverCardTriggerProps extends Assign<HTMLProps<"button">, HoverCardTriggerBaseProps> {}
|
|
63
|
+
declare const HoverCardTrigger: import("react").ForwardRefExoticComponent<HoverCardTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
declare namespace hover_card_d_exports {
|
|
65
|
+
export { HoverCardArrow as Arrow, HoverCardArrowBaseProps as ArrowBaseProps, HoverCardArrowProps as ArrowProps, HoverCardArrowTip as ArrowTip, HoverCardArrowTipBaseProps as ArrowTipBaseProps, HoverCardArrowTipProps as ArrowTipProps, HoverCardContent as Content, HoverCardContentBaseProps as ContentBaseProps, HoverCardContentProps as ContentProps, HoverCardContext as Context, HoverCardContextProps as ContextProps, FocusOutsideEvent, InteractOutsideEvent, OpenChangeDetails, PointerDownOutsideEvent, HoverCardPositioner as Positioner, HoverCardPositionerBaseProps as PositionerBaseProps, HoverCardPositionerProps as PositionerProps, HoverCardRoot as Root, HoverCardRootBaseProps as RootBaseProps, HoverCardRootProps as RootProps, HoverCardRootProvider as RootProvider, HoverCardRootProviderBaseProps as RootProviderBaseProps, HoverCardRootProviderProps as RootProviderProps, HoverCardTrigger as Trigger, HoverCardTriggerBaseProps as TriggerBaseProps, HoverCardTriggerProps as TriggerProps, TriggerValueChangeDetails };
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { hover_card_d_exports as HoverCard, HoverCardArrow, type HoverCardArrowBaseProps, type HoverCardArrowProps, HoverCardArrowTip, type HoverCardArrowTipBaseProps, type HoverCardArrowTipProps, HoverCardContent, type HoverCardContentBaseProps, type HoverCardContentProps, HoverCardContext, type HoverCardContextProps, type HoverCardFocusOutsideEvent, type HoverCardInteractOutsideEvent, type HoverCardOpenChangeDetails, type HoverCardPointerDownOutsideEvent, HoverCardPositioner, type HoverCardPositionerBaseProps, type HoverCardPositionerProps, HoverCardRoot, type HoverCardRootBaseProps, type HoverCardRootProps, HoverCardRootProvider, type HoverCardRootProviderBaseProps, type HoverCardRootProviderProps, HoverCardTrigger, type HoverCardTriggerBaseProps, type HoverCardTriggerProps, type HoverCardTriggerValueChangeDetails, type UseHoverCardContext, type UseHoverCardProps, type UseHoverCardReturn, hoverCardAnatomy, useHoverCard, useHoverCardContext };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CxWYgVJk.js";
|
|
2
|
+
import { r as Optional, t as Assign } from "./types-BQQfrr86.js";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.js";
|
|
4
|
+
import { c as UsePresenceProps } from "./index-DRnET7mJ.js";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as hoverCard from "@wirekyt/dom/machines/hover-card";
|
|
7
|
+
import { FocusOutsideEvent, FocusOutsideEvent as HoverCardFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as HoverCardInteractOutsideEvent, OpenChangeDetails, OpenChangeDetails as HoverCardOpenChangeDetails, PointerDownOutsideEvent, PointerDownOutsideEvent as HoverCardPointerDownOutsideEvent, TriggerProps, TriggerValueChangeDetails, TriggerValueChangeDetails as HoverCardTriggerValueChangeDetails, anatomy as hoverCardAnatomy } from "@wirekyt/dom/machines/hover-card";
|
|
8
|
+
//#region src/components/hover-card/arrow.d.ts
|
|
9
|
+
interface HoverCardArrowBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface HoverCardArrowProps extends HTMLProps<"div">, HoverCardArrowBaseProps {}
|
|
11
|
+
declare const HoverCardArrow: import("react").ForwardRefExoticComponent<HoverCardArrowProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/hover-card/arrow-tip.d.ts
|
|
14
|
+
interface HoverCardArrowTipBaseProps extends PolymorphicProps {}
|
|
15
|
+
interface HoverCardArrowTipProps extends HTMLProps<"div">, HoverCardArrowTipBaseProps {}
|
|
16
|
+
declare const HoverCardArrowTip: import("react").ForwardRefExoticComponent<HoverCardArrowTipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/hover-card/content.d.ts
|
|
19
|
+
interface HoverCardContentBaseProps extends PolymorphicProps {}
|
|
20
|
+
interface HoverCardContentProps extends HTMLProps<"div">, HoverCardContentBaseProps {}
|
|
21
|
+
declare const HoverCardContent: import("react").ForwardRefExoticComponent<HoverCardContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/hover-card/use.d.ts
|
|
24
|
+
interface UseHoverCardProps extends Optional<Omit<hoverCard.Props, "dir" | "getRootNode">, "id"> {}
|
|
25
|
+
interface UseHoverCardReturn extends hoverCard.Api<PropTypes> {}
|
|
26
|
+
declare const useHoverCard: (props?: UseHoverCardProps) => UseHoverCardReturn;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/hover-card/use-context.d.ts
|
|
29
|
+
interface UseHoverCardContext extends UseHoverCardReturn {}
|
|
30
|
+
declare const HoverCardProvider: import("react").Provider<UseHoverCardContext>, useHoverCardContext: () => UseHoverCardContext;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/hover-card/context.d.ts
|
|
33
|
+
interface HoverCardContextProps {
|
|
34
|
+
children: (context: UseHoverCardContext) => ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare const HoverCardContext: (props: HoverCardContextProps) => ReactNode;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/hover-card/positioner.d.ts
|
|
39
|
+
interface HoverCardPositionerBaseProps extends PolymorphicProps {}
|
|
40
|
+
interface HoverCardPositionerProps extends HTMLProps<"div">, HoverCardPositionerBaseProps {}
|
|
41
|
+
declare const HoverCardPositioner: import("react").ForwardRefExoticComponent<HoverCardPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/hover-card/root.d.ts
|
|
44
|
+
interface HoverCardRootBaseProps extends UseHoverCardProps, UsePresenceProps {}
|
|
45
|
+
interface HoverCardRootProps extends HoverCardRootBaseProps {
|
|
46
|
+
children?: ReactNode | undefined;
|
|
47
|
+
}
|
|
48
|
+
declare const HoverCardRoot: (props: HoverCardRootProps) => import("react").JSX.Element;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/hover-card/root-provider.d.ts
|
|
51
|
+
interface RootProviderProps {
|
|
52
|
+
value: UseHoverCardReturn;
|
|
53
|
+
}
|
|
54
|
+
interface HoverCardRootProviderBaseProps extends RootProviderProps, UsePresenceProps {}
|
|
55
|
+
interface HoverCardRootProviderProps extends HoverCardRootProviderBaseProps {
|
|
56
|
+
children?: ReactNode | undefined;
|
|
57
|
+
}
|
|
58
|
+
declare const HoverCardRootProvider: (props: HoverCardRootProviderProps) => import("react").JSX.Element;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/hover-card/trigger.d.ts
|
|
61
|
+
interface HoverCardTriggerBaseProps extends TriggerProps, PolymorphicProps {}
|
|
62
|
+
interface HoverCardTriggerProps extends Assign<HTMLProps<"button">, HoverCardTriggerBaseProps> {}
|
|
63
|
+
declare const HoverCardTrigger: import("react").ForwardRefExoticComponent<HoverCardTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
declare namespace hover_card_d_exports {
|
|
65
|
+
export { HoverCardArrow as Arrow, HoverCardArrowBaseProps as ArrowBaseProps, HoverCardArrowProps as ArrowProps, HoverCardArrowTip as ArrowTip, HoverCardArrowTipBaseProps as ArrowTipBaseProps, HoverCardArrowTipProps as ArrowTipProps, HoverCardContent as Content, HoverCardContentBaseProps as ContentBaseProps, HoverCardContentProps as ContentProps, HoverCardContext as Context, HoverCardContextProps as ContextProps, FocusOutsideEvent, InteractOutsideEvent, OpenChangeDetails, PointerDownOutsideEvent, HoverCardPositioner as Positioner, HoverCardPositionerBaseProps as PositionerBaseProps, HoverCardPositionerProps as PositionerProps, HoverCardRoot as Root, HoverCardRootBaseProps as RootBaseProps, HoverCardRootProps as RootProps, HoverCardRootProvider as RootProvider, HoverCardRootProviderBaseProps as RootProviderBaseProps, HoverCardRootProviderProps as RootProviderProps, HoverCardTrigger as Trigger, HoverCardTriggerBaseProps as TriggerBaseProps, HoverCardTriggerProps as TriggerProps, TriggerValueChangeDetails };
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { hover_card_d_exports as HoverCard, HoverCardArrow, type HoverCardArrowBaseProps, type HoverCardArrowProps, HoverCardArrowTip, type HoverCardArrowTipBaseProps, type HoverCardArrowTipProps, HoverCardContent, type HoverCardContentBaseProps, type HoverCardContentProps, HoverCardContext, type HoverCardContextProps, type HoverCardFocusOutsideEvent, type HoverCardInteractOutsideEvent, type HoverCardOpenChangeDetails, type HoverCardPointerDownOutsideEvent, HoverCardPositioner, type HoverCardPositionerBaseProps, type HoverCardPositionerProps, HoverCardRoot, type HoverCardRootBaseProps, type HoverCardRootProps, HoverCardRootProvider, type HoverCardRootProviderBaseProps, type HoverCardRootProviderProps, HoverCardTrigger, type HoverCardTriggerBaseProps, type HoverCardTriggerProps, type HoverCardTriggerValueChangeDetails, type UseHoverCardContext, type UseHoverCardProps, type UseHoverCardReturn, hoverCardAnatomy, useHoverCard, useHoverCardContext };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { c as createSplitProps, l as useComposedRefs, u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
3
|
+
import { n as useEnvironmentContext } from "./environment-BTgKwk5E.js";
|
|
4
|
+
import { a as useMachine, i as normalizeProps, t as mergeProps } from "./core-CEYOEcVI.js";
|
|
5
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
6
|
+
import { a as useLocaleContext } from "./providers-FEHnDTvb.js";
|
|
7
|
+
import { a as splitPresenceProps, i as usePresence, n as usePresenceContext, t as PresenceProvider } from "./presence-I8Rceflw.js";
|
|
8
|
+
import { forwardRef, useId } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import * as hoverCard from "@wirekyt/dom/machines/hover-card";
|
|
11
|
+
import { anatomy as hoverCardAnatomy } from "@wirekyt/dom/machines/hover-card";
|
|
12
|
+
//#region src/components/hover-card/use-context.ts
|
|
13
|
+
const [HoverCardProvider, useHoverCardContext] = createContext$1({
|
|
14
|
+
name: "HoverCardContext",
|
|
15
|
+
hookName: "useHoverCardContext",
|
|
16
|
+
providerName: "<HoverCardProvider />"
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/hover-card/arrow.tsx
|
|
20
|
+
const HoverCardArrow = forwardRef((props, ref) => {
|
|
21
|
+
const mergedProps = mergeProps(useHoverCardContext().getArrowProps(), props);
|
|
22
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
23
|
+
...mergedProps,
|
|
24
|
+
ref
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
HoverCardArrow.displayName = "HoverCardArrow";
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/hover-card/arrow-tip.tsx
|
|
30
|
+
const HoverCardArrowTip = forwardRef((props, ref) => {
|
|
31
|
+
const mergedProps = mergeProps(useHoverCardContext().getArrowTipProps(), props);
|
|
32
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
HoverCardArrowTip.displayName = "HoverCardArrowTip";
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/hover-card/content.tsx
|
|
40
|
+
const HoverCardContent = forwardRef((props, ref) => {
|
|
41
|
+
const hoverCard = useHoverCardContext();
|
|
42
|
+
const presence = usePresenceContext();
|
|
43
|
+
const mergedProps = mergeProps(hoverCard.getContentProps(), presence.getPresenceProps(), props);
|
|
44
|
+
const composedRefs = useComposedRefs(presence.ref, ref);
|
|
45
|
+
if (presence.unmounted) return null;
|
|
46
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
47
|
+
...mergedProps,
|
|
48
|
+
ref: composedRefs
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/hover-card/context.tsx
|
|
54
|
+
const HoverCardContext = (props) => props.children(useHoverCardContext());
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/hover-card/positioner.tsx
|
|
57
|
+
const HoverCardPositioner = forwardRef((props, ref) => {
|
|
58
|
+
const mergedProps = mergeProps(useHoverCardContext().getPositionerProps(), props);
|
|
59
|
+
if (usePresenceContext().unmounted) return null;
|
|
60
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
61
|
+
...mergedProps,
|
|
62
|
+
ref
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
HoverCardPositioner.displayName = "HoverCardPositioner";
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/hover-card/use.ts
|
|
68
|
+
const useHoverCard = (props) => {
|
|
69
|
+
const id = useId();
|
|
70
|
+
const { getRootNode } = useEnvironmentContext();
|
|
71
|
+
const { dir } = useLocaleContext();
|
|
72
|
+
const machineProps = {
|
|
73
|
+
id,
|
|
74
|
+
dir,
|
|
75
|
+
getRootNode,
|
|
76
|
+
...props
|
|
77
|
+
};
|
|
78
|
+
const service = useMachine(hoverCard.machine, machineProps);
|
|
79
|
+
return hoverCard.connect(service, normalizeProps);
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/hover-card/root.tsx
|
|
83
|
+
const HoverCardRoot = (props) => {
|
|
84
|
+
const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
|
|
85
|
+
const hoverCard = useHoverCard(localProps);
|
|
86
|
+
return /* @__PURE__ */ jsx(HoverCardProvider, {
|
|
87
|
+
value: hoverCard,
|
|
88
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
89
|
+
value: usePresence(mergeProps({ present: hoverCard.open }, presenceProps)),
|
|
90
|
+
children
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/components/hover-card/root-provider.tsx
|
|
96
|
+
const HoverCardRootProvider = (props) => {
|
|
97
|
+
const [presenceProps, { value: hoverCard, children }] = splitPresenceProps(props);
|
|
98
|
+
return /* @__PURE__ */ jsx(HoverCardProvider, {
|
|
99
|
+
value: hoverCard,
|
|
100
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
101
|
+
value: usePresence(mergeProps({ present: hoverCard.open }, presenceProps)),
|
|
102
|
+
children
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/hover-card/trigger.tsx
|
|
108
|
+
const splitTriggerProps = createSplitProps();
|
|
109
|
+
const HoverCardTrigger = forwardRef((props, ref) => {
|
|
110
|
+
const [triggerProps, localProps] = splitTriggerProps(props, ["value"]);
|
|
111
|
+
const mergedProps = mergeProps(useHoverCardContext().getTriggerProps(triggerProps), localProps);
|
|
112
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
113
|
+
...mergedProps,
|
|
114
|
+
ref
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/hover-card/hover-card.ts
|
|
120
|
+
var hover_card_exports = /* @__PURE__ */ __exportAll({
|
|
121
|
+
Arrow: () => HoverCardArrow,
|
|
122
|
+
ArrowTip: () => HoverCardArrowTip,
|
|
123
|
+
Content: () => HoverCardContent,
|
|
124
|
+
Context: () => HoverCardContext,
|
|
125
|
+
Positioner: () => HoverCardPositioner,
|
|
126
|
+
Root: () => HoverCardRoot,
|
|
127
|
+
RootProvider: () => HoverCardRootProvider,
|
|
128
|
+
Trigger: () => HoverCardTrigger
|
|
129
|
+
});
|
|
130
|
+
//#endregion
|
|
131
|
+
export { hover_card_exports as HoverCard, HoverCardArrow, HoverCardArrowTip, HoverCardContent, HoverCardContext, HoverCardPositioner, HoverCardRoot, HoverCardRootProvider, HoverCardTrigger, hoverCardAnatomy, useHoverCard, useHoverCardContext };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
File without changes
|