@wirekyt/react 0.0.1 → 0.0.2
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-CUyHBXOI.d.cts +33 -0
- package/dist/index-CW-Aj6aT.d.ts +95 -0
- package/dist/index-CxWYgVJk.d.ts +23 -0
- package/dist/index-D7JH9e9E.d.ts +33 -0
- package/dist/index-DTLK6Fuh.d.cts +95 -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
|
@@ -0,0 +1,93 @@
|
|
|
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-CUyHBXOI.cjs";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as popover from "@wirekyt/dom/machines/popover";
|
|
7
|
+
import { FocusOutsideEvent, FocusOutsideEvent as PopoverFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as PopoverInteractOutsideEvent, OpenChangeDetails, OpenChangeDetails as PopoverOpenChangeDetails, PointerDownOutsideEvent, PointerDownOutsideEvent as PopoverPointerDownOutsideEvent, TriggerProps, TriggerValueChangeDetails, TriggerValueChangeDetails as PopoverTriggerValueChangeDetails, anatomy as popoverAnatomy } from "@wirekyt/dom/machines/popover";
|
|
8
|
+
//#region src/components/popover/anchor.d.ts
|
|
9
|
+
interface PopoverAnchorBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface PopoverAnchorProps extends HTMLProps<"div">, PopoverAnchorBaseProps {}
|
|
11
|
+
declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/popover/arrow.d.ts
|
|
14
|
+
interface PopoverArrowBaseProps extends PolymorphicProps {}
|
|
15
|
+
interface PopoverArrowProps extends HTMLProps<"div">, PopoverArrowBaseProps {}
|
|
16
|
+
declare const PopoverArrow: import("react").ForwardRefExoticComponent<PopoverArrowProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/popover/arrow-tip.d.ts
|
|
19
|
+
interface PopoverArrowTipBaseProps extends PolymorphicProps {}
|
|
20
|
+
interface PopoverArrowTipProps extends HTMLProps<"div">, PopoverArrowTipBaseProps {}
|
|
21
|
+
declare const PopoverArrowTip: import("react").ForwardRefExoticComponent<PopoverArrowTipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/popover/close-trigger.d.ts
|
|
24
|
+
interface PopoverCloseTriggerBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface PopoverCloseTriggerProps extends HTMLProps<"button">, PopoverCloseTriggerBaseProps {}
|
|
26
|
+
declare const PopoverCloseTrigger: import("react").ForwardRefExoticComponent<PopoverCloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/popover/content.d.ts
|
|
29
|
+
interface PopoverContentBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface PopoverContentProps extends HTMLProps<"div">, PopoverContentBaseProps {}
|
|
31
|
+
declare const PopoverContent: import("react").ForwardRefExoticComponent<PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/popover/use.d.ts
|
|
34
|
+
interface UsePopoverProps extends Optional<Omit<popover.Props, "dir" | "getRootNode">, "id"> {}
|
|
35
|
+
interface UsePopoverReturn extends popover.Api<PropTypes> {}
|
|
36
|
+
declare const usePopover: (props?: UsePopoverProps) => UsePopoverReturn;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/popover/use-context.d.ts
|
|
39
|
+
interface UsePopoverContext extends UsePopoverReturn {}
|
|
40
|
+
declare const PopoverProvider: import("react").Provider<UsePopoverContext>, usePopoverContext: () => UsePopoverContext;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/popover/context.d.ts
|
|
43
|
+
interface PopoverContextProps {
|
|
44
|
+
children: (context: UsePopoverContext) => ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare const PopoverContext: (props: PopoverContextProps) => ReactNode;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/popover/description.d.ts
|
|
49
|
+
interface PopoverDescriptionBaseProps extends PolymorphicProps {}
|
|
50
|
+
interface PopoverDescriptionProps extends HTMLProps<"div">, PopoverDescriptionBaseProps {}
|
|
51
|
+
declare const PopoverDescription: import("react").ForwardRefExoticComponent<PopoverDescriptionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/popover/indicator.d.ts
|
|
54
|
+
interface PopoverIndicatorBaseProps extends PolymorphicProps {}
|
|
55
|
+
interface PopoverIndicatorProps extends HTMLProps<"div">, PopoverIndicatorBaseProps {}
|
|
56
|
+
declare const PopoverIndicator: import("react").ForwardRefExoticComponent<PopoverIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/popover/positioner.d.ts
|
|
59
|
+
interface PopoverPositionerBaseProps extends PolymorphicProps {}
|
|
60
|
+
interface PopoverPositionerProps extends HTMLProps<"div">, PopoverPositionerBaseProps {}
|
|
61
|
+
declare const PopoverPositioner: import("react").ForwardRefExoticComponent<PopoverPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/popover/root.d.ts
|
|
64
|
+
interface PopoverRootBaseProps extends UsePopoverProps, UsePresenceProps {}
|
|
65
|
+
interface PopoverRootProps extends PopoverRootBaseProps {
|
|
66
|
+
children?: ReactNode | undefined;
|
|
67
|
+
}
|
|
68
|
+
declare const PopoverRoot: (props: PopoverRootProps) => import("react").JSX.Element;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/popover/root-provider.d.ts
|
|
71
|
+
interface RootProviderProps {
|
|
72
|
+
value: UsePopoverReturn;
|
|
73
|
+
}
|
|
74
|
+
interface PopoverRootProviderBaseProps extends RootProviderProps, UsePresenceProps {}
|
|
75
|
+
interface PopoverRootProviderProps extends PopoverRootProviderBaseProps {
|
|
76
|
+
children?: ReactNode | undefined;
|
|
77
|
+
}
|
|
78
|
+
declare const PopoverRootProvider: (props: PopoverRootProviderProps) => import("react").JSX.Element;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/popover/title.d.ts
|
|
81
|
+
interface PopoverTitleBaseProps extends PolymorphicProps {}
|
|
82
|
+
interface PopoverTitleProps extends HTMLProps<"div">, PopoverTitleBaseProps {}
|
|
83
|
+
declare const PopoverTitle: import("react").ForwardRefExoticComponent<PopoverTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/popover/trigger.d.ts
|
|
86
|
+
interface PopoverTriggerBaseProps extends TriggerProps, PolymorphicProps {}
|
|
87
|
+
interface PopoverTriggerProps extends Assign<HTMLProps<"button">, PopoverTriggerBaseProps> {}
|
|
88
|
+
declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
89
|
+
declare namespace popover_d_exports {
|
|
90
|
+
export { PopoverAnchor as Anchor, PopoverAnchorBaseProps as AnchorBaseProps, PopoverAnchorProps as AnchorProps, PopoverArrow as Arrow, PopoverArrowBaseProps as ArrowBaseProps, PopoverArrowProps as ArrowProps, PopoverArrowTip as ArrowTip, PopoverArrowTipBaseProps as ArrowTipBaseProps, PopoverArrowTipProps as ArrowTipProps, PopoverCloseTrigger as CloseTrigger, PopoverCloseTriggerBaseProps as CloseTriggerBaseProps, PopoverCloseTriggerProps as CloseTriggerProps, PopoverContent as Content, PopoverContentBaseProps as ContentBaseProps, PopoverContentProps as ContentProps, PopoverContext as Context, PopoverContextProps as ContextProps, PopoverDescription as Description, PopoverDescriptionBaseProps as DescriptionBaseProps, PopoverDescriptionProps as DescriptionProps, FocusOutsideEvent, PopoverIndicator as Indicator, PopoverIndicatorBaseProps as IndicatorBaseProps, PopoverIndicatorProps as IndicatorProps, InteractOutsideEvent, OpenChangeDetails, PointerDownOutsideEvent, PopoverPositioner as Positioner, PopoverPositionerBaseProps as PositionerBaseProps, PopoverPositionerProps as PositionerProps, PopoverRoot as Root, PopoverRootBaseProps as RootBaseProps, PopoverRootProps as RootProps, PopoverRootProvider as RootProvider, PopoverRootProviderBaseProps as RootProviderBaseProps, PopoverRootProviderProps as RootProviderProps, PopoverTitle as Title, PopoverTitleBaseProps as TitleBaseProps, PopoverTitleProps as TitleProps, PopoverTrigger as Trigger, PopoverTriggerBaseProps as TriggerBaseProps, PopoverTriggerProps as TriggerProps, TriggerValueChangeDetails };
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { popover_d_exports as Popover, PopoverAnchor, type PopoverAnchorBaseProps, type PopoverAnchorProps, PopoverArrow, type PopoverArrowBaseProps, type PopoverArrowProps, PopoverArrowTip, type PopoverArrowTipBaseProps, type PopoverArrowTipProps, PopoverCloseTrigger, type PopoverCloseTriggerBaseProps, type PopoverCloseTriggerProps, PopoverContent, type PopoverContentBaseProps, type PopoverContentProps, PopoverContext, type PopoverContextProps, PopoverDescription, type PopoverDescriptionBaseProps, type PopoverDescriptionProps, type PopoverFocusOutsideEvent, PopoverIndicator, type PopoverIndicatorBaseProps, type PopoverIndicatorProps, type PopoverInteractOutsideEvent, type PopoverOpenChangeDetails, type PopoverPointerDownOutsideEvent, PopoverPositioner, type PopoverPositionerBaseProps, type PopoverPositionerProps, PopoverRoot, type PopoverRootBaseProps, type PopoverRootProps, PopoverRootProvider, type PopoverRootProviderBaseProps, type PopoverRootProviderProps, PopoverTitle, type PopoverTitleBaseProps, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerBaseProps, type PopoverTriggerProps, type PopoverTriggerValueChangeDetails, type UsePopoverContext, type UsePopoverProps, type UsePopoverReturn, popoverAnatomy, usePopover, usePopoverContext };
|
|
@@ -0,0 +1,93 @@
|
|
|
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-D7JH9e9E.js";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as popover from "@wirekyt/dom/machines/popover";
|
|
7
|
+
import { FocusOutsideEvent, FocusOutsideEvent as PopoverFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as PopoverInteractOutsideEvent, OpenChangeDetails, OpenChangeDetails as PopoverOpenChangeDetails, PointerDownOutsideEvent, PointerDownOutsideEvent as PopoverPointerDownOutsideEvent, TriggerProps, TriggerValueChangeDetails, TriggerValueChangeDetails as PopoverTriggerValueChangeDetails, anatomy as popoverAnatomy } from "@wirekyt/dom/machines/popover";
|
|
8
|
+
//#region src/components/popover/anchor.d.ts
|
|
9
|
+
interface PopoverAnchorBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface PopoverAnchorProps extends HTMLProps<"div">, PopoverAnchorBaseProps {}
|
|
11
|
+
declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/popover/arrow.d.ts
|
|
14
|
+
interface PopoverArrowBaseProps extends PolymorphicProps {}
|
|
15
|
+
interface PopoverArrowProps extends HTMLProps<"div">, PopoverArrowBaseProps {}
|
|
16
|
+
declare const PopoverArrow: import("react").ForwardRefExoticComponent<PopoverArrowProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/popover/arrow-tip.d.ts
|
|
19
|
+
interface PopoverArrowTipBaseProps extends PolymorphicProps {}
|
|
20
|
+
interface PopoverArrowTipProps extends HTMLProps<"div">, PopoverArrowTipBaseProps {}
|
|
21
|
+
declare const PopoverArrowTip: import("react").ForwardRefExoticComponent<PopoverArrowTipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/popover/close-trigger.d.ts
|
|
24
|
+
interface PopoverCloseTriggerBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface PopoverCloseTriggerProps extends HTMLProps<"button">, PopoverCloseTriggerBaseProps {}
|
|
26
|
+
declare const PopoverCloseTrigger: import("react").ForwardRefExoticComponent<PopoverCloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/popover/content.d.ts
|
|
29
|
+
interface PopoverContentBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface PopoverContentProps extends HTMLProps<"div">, PopoverContentBaseProps {}
|
|
31
|
+
declare const PopoverContent: import("react").ForwardRefExoticComponent<PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/popover/use.d.ts
|
|
34
|
+
interface UsePopoverProps extends Optional<Omit<popover.Props, "dir" | "getRootNode">, "id"> {}
|
|
35
|
+
interface UsePopoverReturn extends popover.Api<PropTypes> {}
|
|
36
|
+
declare const usePopover: (props?: UsePopoverProps) => UsePopoverReturn;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/popover/use-context.d.ts
|
|
39
|
+
interface UsePopoverContext extends UsePopoverReturn {}
|
|
40
|
+
declare const PopoverProvider: import("react").Provider<UsePopoverContext>, usePopoverContext: () => UsePopoverContext;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/popover/context.d.ts
|
|
43
|
+
interface PopoverContextProps {
|
|
44
|
+
children: (context: UsePopoverContext) => ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare const PopoverContext: (props: PopoverContextProps) => ReactNode;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/popover/description.d.ts
|
|
49
|
+
interface PopoverDescriptionBaseProps extends PolymorphicProps {}
|
|
50
|
+
interface PopoverDescriptionProps extends HTMLProps<"div">, PopoverDescriptionBaseProps {}
|
|
51
|
+
declare const PopoverDescription: import("react").ForwardRefExoticComponent<PopoverDescriptionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/popover/indicator.d.ts
|
|
54
|
+
interface PopoverIndicatorBaseProps extends PolymorphicProps {}
|
|
55
|
+
interface PopoverIndicatorProps extends HTMLProps<"div">, PopoverIndicatorBaseProps {}
|
|
56
|
+
declare const PopoverIndicator: import("react").ForwardRefExoticComponent<PopoverIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/popover/positioner.d.ts
|
|
59
|
+
interface PopoverPositionerBaseProps extends PolymorphicProps {}
|
|
60
|
+
interface PopoverPositionerProps extends HTMLProps<"div">, PopoverPositionerBaseProps {}
|
|
61
|
+
declare const PopoverPositioner: import("react").ForwardRefExoticComponent<PopoverPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/popover/root.d.ts
|
|
64
|
+
interface PopoverRootBaseProps extends UsePopoverProps, UsePresenceProps {}
|
|
65
|
+
interface PopoverRootProps extends PopoverRootBaseProps {
|
|
66
|
+
children?: ReactNode | undefined;
|
|
67
|
+
}
|
|
68
|
+
declare const PopoverRoot: (props: PopoverRootProps) => import("react").JSX.Element;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/popover/root-provider.d.ts
|
|
71
|
+
interface RootProviderProps {
|
|
72
|
+
value: UsePopoverReturn;
|
|
73
|
+
}
|
|
74
|
+
interface PopoverRootProviderBaseProps extends RootProviderProps, UsePresenceProps {}
|
|
75
|
+
interface PopoverRootProviderProps extends PopoverRootProviderBaseProps {
|
|
76
|
+
children?: ReactNode | undefined;
|
|
77
|
+
}
|
|
78
|
+
declare const PopoverRootProvider: (props: PopoverRootProviderProps) => import("react").JSX.Element;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/popover/title.d.ts
|
|
81
|
+
interface PopoverTitleBaseProps extends PolymorphicProps {}
|
|
82
|
+
interface PopoverTitleProps extends HTMLProps<"div">, PopoverTitleBaseProps {}
|
|
83
|
+
declare const PopoverTitle: import("react").ForwardRefExoticComponent<PopoverTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/popover/trigger.d.ts
|
|
86
|
+
interface PopoverTriggerBaseProps extends TriggerProps, PolymorphicProps {}
|
|
87
|
+
interface PopoverTriggerProps extends Assign<HTMLProps<"button">, PopoverTriggerBaseProps> {}
|
|
88
|
+
declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
89
|
+
declare namespace popover_d_exports {
|
|
90
|
+
export { PopoverAnchor as Anchor, PopoverAnchorBaseProps as AnchorBaseProps, PopoverAnchorProps as AnchorProps, PopoverArrow as Arrow, PopoverArrowBaseProps as ArrowBaseProps, PopoverArrowProps as ArrowProps, PopoverArrowTip as ArrowTip, PopoverArrowTipBaseProps as ArrowTipBaseProps, PopoverArrowTipProps as ArrowTipProps, PopoverCloseTrigger as CloseTrigger, PopoverCloseTriggerBaseProps as CloseTriggerBaseProps, PopoverCloseTriggerProps as CloseTriggerProps, PopoverContent as Content, PopoverContentBaseProps as ContentBaseProps, PopoverContentProps as ContentProps, PopoverContext as Context, PopoverContextProps as ContextProps, PopoverDescription as Description, PopoverDescriptionBaseProps as DescriptionBaseProps, PopoverDescriptionProps as DescriptionProps, FocusOutsideEvent, PopoverIndicator as Indicator, PopoverIndicatorBaseProps as IndicatorBaseProps, PopoverIndicatorProps as IndicatorProps, InteractOutsideEvent, OpenChangeDetails, PointerDownOutsideEvent, PopoverPositioner as Positioner, PopoverPositionerBaseProps as PositionerBaseProps, PopoverPositionerProps as PositionerProps, PopoverRoot as Root, PopoverRootBaseProps as RootBaseProps, PopoverRootProps as RootProps, PopoverRootProvider as RootProvider, PopoverRootProviderBaseProps as RootProviderBaseProps, PopoverRootProviderProps as RootProviderProps, PopoverTitle as Title, PopoverTitleBaseProps as TitleBaseProps, PopoverTitleProps as TitleProps, PopoverTrigger as Trigger, PopoverTriggerBaseProps as TriggerBaseProps, PopoverTriggerProps as TriggerProps, TriggerValueChangeDetails };
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { popover_d_exports as Popover, PopoverAnchor, type PopoverAnchorBaseProps, type PopoverAnchorProps, PopoverArrow, type PopoverArrowBaseProps, type PopoverArrowProps, PopoverArrowTip, type PopoverArrowTipBaseProps, type PopoverArrowTipProps, PopoverCloseTrigger, type PopoverCloseTriggerBaseProps, type PopoverCloseTriggerProps, PopoverContent, type PopoverContentBaseProps, type PopoverContentProps, PopoverContext, type PopoverContextProps, PopoverDescription, type PopoverDescriptionBaseProps, type PopoverDescriptionProps, type PopoverFocusOutsideEvent, PopoverIndicator, type PopoverIndicatorBaseProps, type PopoverIndicatorProps, type PopoverInteractOutsideEvent, type PopoverOpenChangeDetails, type PopoverPointerDownOutsideEvent, PopoverPositioner, type PopoverPositionerBaseProps, type PopoverPositionerProps, PopoverRoot, type PopoverRootBaseProps, type PopoverRootProps, PopoverRootProvider, type PopoverRootProviderBaseProps, type PopoverRootProviderProps, PopoverTitle, type PopoverTitleBaseProps, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerBaseProps, type PopoverTriggerProps, type PopoverTriggerValueChangeDetails, type UsePopoverContext, type UsePopoverProps, type UsePopoverReturn, popoverAnatomy, usePopover, usePopoverContext };
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
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 popover from "@wirekyt/dom/machines/popover";
|
|
11
|
+
import { anatomy as popoverAnatomy } from "@wirekyt/dom/machines/popover";
|
|
12
|
+
//#region src/components/popover/use-context.ts
|
|
13
|
+
const [PopoverProvider, usePopoverContext] = createContext$1({
|
|
14
|
+
name: "PopoverContext",
|
|
15
|
+
hookName: "usePopoverContext",
|
|
16
|
+
providerName: "<PopoverProvider />"
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/popover/anchor.tsx
|
|
20
|
+
const PopoverAnchor = forwardRef((props, ref) => {
|
|
21
|
+
const mergedProps = mergeProps(usePopoverContext().getAnchorProps(), props);
|
|
22
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
23
|
+
...mergedProps,
|
|
24
|
+
ref
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
PopoverAnchor.displayName = "PopoverAnchor";
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/popover/arrow.tsx
|
|
30
|
+
const PopoverArrow = forwardRef((props, ref) => {
|
|
31
|
+
const mergedProps = mergeProps(usePopoverContext().getArrowProps(), props);
|
|
32
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
PopoverArrow.displayName = "PopoverArrow";
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/popover/arrow-tip.tsx
|
|
40
|
+
const PopoverArrowTip = forwardRef((props, ref) => {
|
|
41
|
+
const mergedProps = mergeProps(usePopoverContext().getArrowTipProps(), props);
|
|
42
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
43
|
+
...mergedProps,
|
|
44
|
+
ref
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
PopoverArrowTip.displayName = "PopoverArrowTip";
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/popover/close-trigger.tsx
|
|
50
|
+
const PopoverCloseTrigger = forwardRef((props, ref) => {
|
|
51
|
+
const mergedProps = mergeProps(usePopoverContext().getCloseTriggerProps(), props);
|
|
52
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
53
|
+
...mergedProps,
|
|
54
|
+
ref
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
PopoverCloseTrigger.displayName = "PopoverCloseTrigger";
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/components/popover/content.tsx
|
|
60
|
+
const PopoverContent = forwardRef((props, ref) => {
|
|
61
|
+
const popover = usePopoverContext();
|
|
62
|
+
const presence = usePresenceContext();
|
|
63
|
+
const mergedProps = mergeProps(popover.getContentProps(), presence.getPresenceProps(), props);
|
|
64
|
+
const composedRefs = useComposedRefs(presence.ref, ref);
|
|
65
|
+
if (presence.unmounted) return null;
|
|
66
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
67
|
+
...mergedProps,
|
|
68
|
+
ref: composedRefs
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
PopoverContent.displayName = "PopoverContent";
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/popover/context.tsx
|
|
74
|
+
const PopoverContext = (props) => props.children(usePopoverContext());
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/popover/description.tsx
|
|
77
|
+
const PopoverDescription = forwardRef((props, ref) => {
|
|
78
|
+
const mergedProps = mergeProps(usePopoverContext().getDescriptionProps(), props);
|
|
79
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
80
|
+
...mergedProps,
|
|
81
|
+
ref
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
PopoverDescription.displayName = "PopoverDescription";
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/components/popover/indicator.tsx
|
|
87
|
+
const PopoverIndicator = forwardRef((props, ref) => {
|
|
88
|
+
const mergedProps = mergeProps(usePopoverContext().getIndicatorProps(), props);
|
|
89
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
90
|
+
...mergedProps,
|
|
91
|
+
ref
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
PopoverIndicator.displayName = "PopoverIndicator";
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/popover/positioner.tsx
|
|
97
|
+
const PopoverPositioner = forwardRef((props, ref) => {
|
|
98
|
+
const popover = usePopoverContext();
|
|
99
|
+
const presence = usePresenceContext();
|
|
100
|
+
const mergedProps = mergeProps(popover.getPositionerProps(), props);
|
|
101
|
+
if (presence.unmounted) return null;
|
|
102
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
103
|
+
...mergedProps,
|
|
104
|
+
ref
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
PopoverPositioner.displayName = "PopoverPositioner";
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/popover/use.ts
|
|
110
|
+
const usePopover = (props) => {
|
|
111
|
+
const id = useId();
|
|
112
|
+
const { getRootNode } = useEnvironmentContext();
|
|
113
|
+
const { dir } = useLocaleContext();
|
|
114
|
+
const machineProps = {
|
|
115
|
+
id,
|
|
116
|
+
dir,
|
|
117
|
+
getRootNode,
|
|
118
|
+
...props
|
|
119
|
+
};
|
|
120
|
+
const service = useMachine(popover.machine, machineProps);
|
|
121
|
+
return popover.connect(service, normalizeProps);
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/popover/root.tsx
|
|
125
|
+
const PopoverRoot = (props) => {
|
|
126
|
+
const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
|
|
127
|
+
const popover = usePopover(localProps);
|
|
128
|
+
return /* @__PURE__ */ jsx(PopoverProvider, {
|
|
129
|
+
value: popover,
|
|
130
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
131
|
+
value: usePresence(mergeProps({ present: popover.open }, presenceProps)),
|
|
132
|
+
children
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/popover/root-provider.tsx
|
|
138
|
+
const PopoverRootProvider = (props) => {
|
|
139
|
+
const [presenceProps, { value: popover, children }] = splitPresenceProps(props);
|
|
140
|
+
return /* @__PURE__ */ jsx(PopoverProvider, {
|
|
141
|
+
value: popover,
|
|
142
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
143
|
+
value: usePresence(mergeProps({ present: popover.open }, presenceProps)),
|
|
144
|
+
children
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/components/popover/title.tsx
|
|
150
|
+
const PopoverTitle = forwardRef((props, ref) => {
|
|
151
|
+
const mergedProps = mergeProps(usePopoverContext().getTitleProps(), props);
|
|
152
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
153
|
+
...mergedProps,
|
|
154
|
+
ref
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
PopoverTitle.displayName = "PopoverTitle";
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/components/popover/trigger.tsx
|
|
160
|
+
const splitTriggerProps = createSplitProps();
|
|
161
|
+
const PopoverTrigger = forwardRef((props, ref) => {
|
|
162
|
+
const [triggerProps, localProps] = splitTriggerProps(props, ["value"]);
|
|
163
|
+
const popover = usePopoverContext();
|
|
164
|
+
const presence = usePresenceContext();
|
|
165
|
+
const triggerPropsRaw = popover.getTriggerProps(triggerProps);
|
|
166
|
+
const mergedProps = mergeProps({
|
|
167
|
+
...triggerPropsRaw,
|
|
168
|
+
"aria-controls": presence.unmounted ? void 0 : triggerPropsRaw["aria-controls"]
|
|
169
|
+
}, localProps);
|
|
170
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
171
|
+
...mergedProps,
|
|
172
|
+
ref
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/components/popover/popover.ts
|
|
178
|
+
var popover_exports = /* @__PURE__ */ __exportAll({
|
|
179
|
+
Anchor: () => PopoverAnchor,
|
|
180
|
+
Arrow: () => PopoverArrow,
|
|
181
|
+
ArrowTip: () => PopoverArrowTip,
|
|
182
|
+
CloseTrigger: () => PopoverCloseTrigger,
|
|
183
|
+
Content: () => PopoverContent,
|
|
184
|
+
Context: () => PopoverContext,
|
|
185
|
+
Description: () => PopoverDescription,
|
|
186
|
+
Indicator: () => PopoverIndicator,
|
|
187
|
+
Positioner: () => PopoverPositioner,
|
|
188
|
+
Root: () => PopoverRoot,
|
|
189
|
+
RootProvider: () => PopoverRootProvider,
|
|
190
|
+
Title: () => PopoverTitle,
|
|
191
|
+
Trigger: () => PopoverTrigger
|
|
192
|
+
});
|
|
193
|
+
//#endregion
|
|
194
|
+
export { popover_exports as Popover, PopoverAnchor, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContent, PopoverContext, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverRoot, PopoverRootProvider, PopoverTitle, PopoverTrigger, popoverAnatomy, usePopover, usePopoverContext };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_environment = require("./environment-B6IaCAuQ.cjs");
|
|
2
|
+
require("./providers-DrJEJcrE.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_dom = require("react-dom");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _wirekyt_dom_dom_query = require("@wirekyt/dom/dom-query");
|
|
7
|
+
//#region src/components/portal/portal.tsx
|
|
8
|
+
const Portal = (props) => {
|
|
9
|
+
const { children, disabled } = props;
|
|
10
|
+
const [container, setContainer] = (0, react.useState)(props.container?.current);
|
|
11
|
+
const isServer = (0, react.useSyncExternalStore)(subscribe, () => false, () => true);
|
|
12
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
13
|
+
(0, react.useEffect)(() => {
|
|
14
|
+
setContainer(() => props.container?.current);
|
|
15
|
+
}, [props.container]);
|
|
16
|
+
if (isServer || disabled) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
17
|
+
const mountNode = container ?? getPortalNode(getRootNode);
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: react.Children.map(children, (child) => (0, react_dom.createPortal)(child, mountNode)) });
|
|
19
|
+
};
|
|
20
|
+
const getPortalNode = (cb) => {
|
|
21
|
+
const node = cb?.();
|
|
22
|
+
const rootNode = node.getRootNode();
|
|
23
|
+
if ((0, _wirekyt_dom_dom_query.isShadowRoot)(rootNode)) return rootNode;
|
|
24
|
+
return (0, _wirekyt_dom_dom_query.getDocument)(node).body;
|
|
25
|
+
};
|
|
26
|
+
const subscribe = () => () => {};
|
|
27
|
+
//#endregion
|
|
28
|
+
Object.defineProperty(exports, "Portal", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return Portal;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { n as useEnvironmentContext } from "./environment-BTgKwk5E.js";
|
|
2
|
+
import "./providers-FEHnDTvb.js";
|
|
3
|
+
import { Children, useEffect, useState, useSyncExternalStore } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
|
+
import { getDocument, isShadowRoot } from "@wirekyt/dom/dom-query";
|
|
7
|
+
//#region src/components/portal/portal.tsx
|
|
8
|
+
const Portal = (props) => {
|
|
9
|
+
const { children, disabled } = props;
|
|
10
|
+
const [container, setContainer] = useState(props.container?.current);
|
|
11
|
+
const isServer = useSyncExternalStore(subscribe, () => false, () => true);
|
|
12
|
+
const { getRootNode } = useEnvironmentContext();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setContainer(() => props.container?.current);
|
|
15
|
+
}, [props.container]);
|
|
16
|
+
if (isServer || disabled) return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
17
|
+
const mountNode = container ?? getPortalNode(getRootNode);
|
|
18
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: Children.map(children, (child) => createPortal(child, mountNode)) });
|
|
19
|
+
};
|
|
20
|
+
const getPortalNode = (cb) => {
|
|
21
|
+
const node = cb?.();
|
|
22
|
+
const rootNode = node.getRootNode();
|
|
23
|
+
if (isShadowRoot(rootNode)) return rootNode;
|
|
24
|
+
return getDocument(node).body;
|
|
25
|
+
};
|
|
26
|
+
const subscribe = () => () => {};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Portal as t };
|
package/dist/portal.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren, RefObject } from "react";
|
|
2
|
+
//#region src/components/portal/portal.d.ts
|
|
3
|
+
interface PortalProps {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
container?: RefObject<HTMLElement | null> | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const Portal: (props: PropsWithChildren<PortalProps>) => import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Portal, type PortalProps };
|
package/dist/portal.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren, RefObject } from "react";
|
|
2
|
+
//#region src/components/portal/portal.d.ts
|
|
3
|
+
interface PortalProps {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
container?: RefObject<HTMLElement | null> | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const Portal: (props: PropsWithChildren<PortalProps>) => import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Portal, type PortalProps };
|
package/dist/portal.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
3
|
+
const require_core = require("./core-CBFAnVIP.cjs");
|
|
4
|
+
const require_factory = require("./factory-CFFufs5e.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _wirekyt_dom_machines_presence = require("@wirekyt/dom/machines/presence");
|
|
8
|
+
_wirekyt_dom_machines_presence = require_rolldown_runtime.__toESM(_wirekyt_dom_machines_presence, 1);
|
|
9
|
+
//#region src/components/presence/split-props.ts
|
|
10
|
+
const splitPresenceProps = (props) => require_utils.createSplitProps()(props, [
|
|
11
|
+
"immediate",
|
|
12
|
+
"lazyMount",
|
|
13
|
+
"onExitComplete",
|
|
14
|
+
"present",
|
|
15
|
+
"skipAnimationOnMount",
|
|
16
|
+
"unmountOnExit"
|
|
17
|
+
]);
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/presence/use.ts
|
|
20
|
+
const usePresence = (props = {}) => {
|
|
21
|
+
const { lazyMount, unmountOnExit, present, skipAnimationOnMount = false, ...rest } = props;
|
|
22
|
+
const wasEverPresent = (0, react.useRef)(false);
|
|
23
|
+
const machineProps = {
|
|
24
|
+
...rest,
|
|
25
|
+
present,
|
|
26
|
+
onExitComplete: require_utils.useEvent(props.onExitComplete)
|
|
27
|
+
};
|
|
28
|
+
const service = require_core.useMachine(_wirekyt_dom_machines_presence.machine, machineProps);
|
|
29
|
+
const api = _wirekyt_dom_machines_presence.connect(service, require_core.normalizeProps);
|
|
30
|
+
if (api.present) wasEverPresent.current = true;
|
|
31
|
+
const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
|
|
32
|
+
const getPresenceProps = () => ({
|
|
33
|
+
"data-state": api.skip && skipAnimationOnMount ? void 0 : present ? "open" : "closed",
|
|
34
|
+
hidden: !api.present
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
ref: api.setNode,
|
|
38
|
+
getPresenceProps,
|
|
39
|
+
present: api.present,
|
|
40
|
+
unmounted
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/presence/presence.tsx
|
|
45
|
+
const Presence = (0, react.forwardRef)((props, ref) => {
|
|
46
|
+
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
47
|
+
const presence = usePresence(presenceProps);
|
|
48
|
+
const composedRefs = require_utils.useComposedRefs(presence.ref, ref);
|
|
49
|
+
if (presence.unmounted) return null;
|
|
50
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.div, {
|
|
51
|
+
...localProps,
|
|
52
|
+
...presence.getPresenceProps(),
|
|
53
|
+
"data-scope": "presence",
|
|
54
|
+
"data-part": "root",
|
|
55
|
+
ref: composedRefs
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
Presence.displayName = "Presence";
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/presence/use-context.ts
|
|
61
|
+
const [PresenceProvider, usePresenceContext] = require_utils.createContext({
|
|
62
|
+
name: "PresenceContext",
|
|
63
|
+
hookName: "usePresenceContext",
|
|
64
|
+
providerName: "<PresenceProvider />"
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
Object.defineProperty(exports, "Presence", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function() {
|
|
70
|
+
return Presence;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "PresenceProvider", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function() {
|
|
76
|
+
return PresenceProvider;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(exports, "splitPresenceProps", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function() {
|
|
82
|
+
return splitPresenceProps;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "usePresence", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function() {
|
|
88
|
+
return usePresence;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(exports, "usePresenceContext", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function() {
|
|
94
|
+
return usePresenceContext;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { c as createSplitProps, l as useComposedRefs, r as useEvent, u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
2
|
+
import { a as useMachine, i as normalizeProps } from "./core-CEYOEcVI.js";
|
|
3
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
4
|
+
import { forwardRef, useRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as presence from "@wirekyt/dom/machines/presence";
|
|
7
|
+
//#region src/components/presence/split-props.ts
|
|
8
|
+
const splitPresenceProps = (props) => createSplitProps()(props, [
|
|
9
|
+
"immediate",
|
|
10
|
+
"lazyMount",
|
|
11
|
+
"onExitComplete",
|
|
12
|
+
"present",
|
|
13
|
+
"skipAnimationOnMount",
|
|
14
|
+
"unmountOnExit"
|
|
15
|
+
]);
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/presence/use.ts
|
|
18
|
+
const usePresence = (props = {}) => {
|
|
19
|
+
const { lazyMount, unmountOnExit, present, skipAnimationOnMount = false, ...rest } = props;
|
|
20
|
+
const wasEverPresent = useRef(false);
|
|
21
|
+
const machineProps = {
|
|
22
|
+
...rest,
|
|
23
|
+
present,
|
|
24
|
+
onExitComplete: useEvent(props.onExitComplete)
|
|
25
|
+
};
|
|
26
|
+
const service = useMachine(presence.machine, machineProps);
|
|
27
|
+
const api = presence.connect(service, normalizeProps);
|
|
28
|
+
if (api.present) wasEverPresent.current = true;
|
|
29
|
+
const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
|
|
30
|
+
const getPresenceProps = () => ({
|
|
31
|
+
"data-state": api.skip && skipAnimationOnMount ? void 0 : present ? "open" : "closed",
|
|
32
|
+
hidden: !api.present
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
ref: api.setNode,
|
|
36
|
+
getPresenceProps,
|
|
37
|
+
present: api.present,
|
|
38
|
+
unmounted
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/presence/presence.tsx
|
|
43
|
+
const Presence = forwardRef((props, ref) => {
|
|
44
|
+
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
45
|
+
const presence = usePresence(presenceProps);
|
|
46
|
+
const composedRefs = useComposedRefs(presence.ref, ref);
|
|
47
|
+
if (presence.unmounted) return null;
|
|
48
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
49
|
+
...localProps,
|
|
50
|
+
...presence.getPresenceProps(),
|
|
51
|
+
"data-scope": "presence",
|
|
52
|
+
"data-part": "root",
|
|
53
|
+
ref: composedRefs
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
Presence.displayName = "Presence";
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/presence/use-context.ts
|
|
59
|
+
const [PresenceProvider, usePresenceContext] = createContext$1({
|
|
60
|
+
name: "PresenceContext",
|
|
61
|
+
hookName: "usePresenceContext",
|
|
62
|
+
providerName: "<PresenceProvider />"
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { splitPresenceProps as a, usePresence as i, usePresenceContext as n, Presence as r, PresenceProvider as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_presence = require("./presence-BOs-D6Cv.cjs");
|
|
3
|
+
exports.Presence = require_presence.Presence;
|
|
4
|
+
exports.PresenceProvider = require_presence.PresenceProvider;
|
|
5
|
+
exports.splitPresenceProps = require_presence.splitPresenceProps;
|
|
6
|
+
exports.usePresence = require_presence.usePresence;
|
|
7
|
+
exports.usePresenceContext = require_presence.usePresenceContext;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Presence, c as UsePresenceProps, i as splitPresenceProps, l as UsePresenceReturn, n as UsePresenceContext, o as PresenceBaseProps, r as usePresenceContext, s as PresenceProps, t as PresenceProvider, u as usePresence } from "./index-CUyHBXOI.cjs";
|
|
2
|
+
export { Presence, type PresenceBaseProps, type PresenceProps, PresenceProvider, type UsePresenceContext, type UsePresenceProps, type UsePresenceReturn, splitPresenceProps, usePresence, usePresenceContext };
|