@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,98 @@
|
|
|
1
|
+
import { a as PropTypes } from "./index-CxWYgVJk.js";
|
|
2
|
+
import { r as Optional } 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 floatingPanel from "@wirekyt/dom/machines/floating-panel";
|
|
7
|
+
import { AnchorPositionDetails, AnchorPositionDetails as FloatingPanelAnchorPositionDetails, ElementIds, ElementIds as FloatingPanelElementIds, IntlTranslations, IntlTranslations as FloatingPanelIntlTranslations, OpenChangeDetails, OpenChangeDetails as FloatingPanelOpenChangeDetails, Point, Point as FloatingPanelPoint, PositionChangeDetails, PositionChangeDetails as FloatingPanelPositionChangeDetails, ResizeTriggerAxis, ResizeTriggerAxis as FloatingPanelResizeTriggerAxis, ResizeTriggerProps, Size, Size as FloatingPanelSize, SizeChangeDetails, SizeChangeDetails as FloatingPanelSizeChangeDetails, Stage, Stage as FloatingPanelStage, StageChangeDetails, StageChangeDetails as FloatingPanelStageChangeDetails, StageTriggerProps, anatomy as floatingPanelAnatomy, resizeTriggerAxes } from "@wirekyt/dom/machines/floating-panel";
|
|
8
|
+
//#region src/components/floating-panel/body.d.ts
|
|
9
|
+
interface FloatingPanelBodyBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface FloatingPanelBodyProps extends HTMLProps<"div">, FloatingPanelBodyBaseProps {}
|
|
11
|
+
declare const FloatingPanelBody: import("react").ForwardRefExoticComponent<FloatingPanelBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/floating-panel/close-trigger.d.ts
|
|
14
|
+
interface FloatingPanelCloseTriggerBaseProps extends PolymorphicProps {}
|
|
15
|
+
interface FloatingPanelCloseTriggerProps extends HTMLProps<"button">, FloatingPanelCloseTriggerBaseProps {}
|
|
16
|
+
declare const FloatingPanelCloseTrigger: import("react").ForwardRefExoticComponent<FloatingPanelCloseTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/floating-panel/content.d.ts
|
|
19
|
+
interface FloatingPanelContentBaseProps extends PolymorphicProps {}
|
|
20
|
+
interface FloatingPanelContentProps extends HTMLProps<"div">, FloatingPanelContentBaseProps {}
|
|
21
|
+
declare const FloatingPanelContent: import("react").ForwardRefExoticComponent<FloatingPanelContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/floating-panel/use.d.ts
|
|
24
|
+
interface UseFloatingPanelProps extends Optional<Omit<floatingPanel.Props, "getRootNode">, "id"> {}
|
|
25
|
+
interface UseFloatingPanelReturn extends floatingPanel.Api<PropTypes> {}
|
|
26
|
+
declare const useFloatingPanel: (props?: UseFloatingPanelProps) => UseFloatingPanelReturn;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/floating-panel/use-context.d.ts
|
|
29
|
+
interface UseFloatingPanelContext extends UseFloatingPanelReturn {}
|
|
30
|
+
declare const FloatingPanelProvider: import("react").Provider<UseFloatingPanelContext>, useFloatingPanelContext: () => UseFloatingPanelContext;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/floating-panel/context.d.ts
|
|
33
|
+
interface FloatingPanelContextProps {
|
|
34
|
+
children: (context: UseFloatingPanelContext) => ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare const FloatingPanelContext: (props: FloatingPanelContextProps) => ReactNode;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/floating-panel/drag-trigger.d.ts
|
|
39
|
+
interface FloatingPanelDragTriggerBaseProps extends PolymorphicProps {}
|
|
40
|
+
interface FloatingPanelDragTriggerProps extends HTMLProps<"div">, FloatingPanelDragTriggerBaseProps {}
|
|
41
|
+
declare const FloatingPanelDragTrigger: import("react").ForwardRefExoticComponent<FloatingPanelDragTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/floating-panel/header.d.ts
|
|
44
|
+
interface FloatingPanelHeaderBaseProps extends PolymorphicProps {}
|
|
45
|
+
interface FloatingPanelHeaderProps extends HTMLProps<"div">, FloatingPanelHeaderBaseProps {}
|
|
46
|
+
declare const FloatingPanelHeader: import("react").ForwardRefExoticComponent<FloatingPanelHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/floating-panel/positioner.d.ts
|
|
49
|
+
interface FloatingPanelPositionerBaseProps extends PolymorphicProps {}
|
|
50
|
+
interface FloatingPanelPositionerProps extends HTMLProps<"div">, FloatingPanelPositionerBaseProps {}
|
|
51
|
+
declare const FloatingPanelPositioner: import("react").ForwardRefExoticComponent<FloatingPanelPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/floating-panel/resize-trigger.d.ts
|
|
54
|
+
interface FloatingPanelResizeTriggerBaseProps extends ResizeTriggerProps, PolymorphicProps {}
|
|
55
|
+
interface FloatingPanelResizeTriggerProps extends HTMLProps<"div">, FloatingPanelResizeTriggerBaseProps {}
|
|
56
|
+
declare const FloatingPanelResizeTrigger: import("react").ForwardRefExoticComponent<FloatingPanelResizeTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/floating-panel/stage-trigger.d.ts
|
|
59
|
+
interface FloatingPanelStageTriggerBaseProps extends PolymorphicProps, StageTriggerProps {}
|
|
60
|
+
interface FloatingPanelStageTriggerProps extends HTMLProps<"button">, FloatingPanelStageTriggerBaseProps {}
|
|
61
|
+
declare const FloatingPanelStageTrigger: import("react").ForwardRefExoticComponent<FloatingPanelStageTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/floating-panel/root.d.ts
|
|
64
|
+
interface FloatingPanelRootBaseProps extends UseFloatingPanelProps, UsePresenceProps {}
|
|
65
|
+
interface FloatingPanelRootProps extends FloatingPanelRootBaseProps {
|
|
66
|
+
children?: ReactNode | undefined;
|
|
67
|
+
}
|
|
68
|
+
declare const FloatingPanelRoot: (props: FloatingPanelRootProps) => import("react").JSX.Element;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/floating-panel/root-provider.d.ts
|
|
71
|
+
interface RootProviderProps {
|
|
72
|
+
value: UseFloatingPanelReturn;
|
|
73
|
+
}
|
|
74
|
+
interface FloatingPanelRootProviderBaseProps extends RootProviderProps, Omit<UsePresenceProps, "present"> {}
|
|
75
|
+
interface FloatingPanelRootProviderProps extends FloatingPanelRootProviderBaseProps {
|
|
76
|
+
children?: ReactNode | undefined;
|
|
77
|
+
}
|
|
78
|
+
declare const FloatingPanelRootProvider: (props: FloatingPanelRootProviderProps) => import("react").JSX.Element;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/floating-panel/title.d.ts
|
|
81
|
+
interface FloatingPanelTitleBaseProps extends PolymorphicProps {}
|
|
82
|
+
interface FloatingPanelTitleProps extends HTMLProps<"h2">, FloatingPanelTitleBaseProps {}
|
|
83
|
+
declare const FloatingPanelTitle: import("react").ForwardRefExoticComponent<FloatingPanelTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/floating-panel/trigger.d.ts
|
|
86
|
+
interface FloatingPanelTriggerBaseProps extends PolymorphicProps {}
|
|
87
|
+
interface FloatingPanelTriggerProps extends HTMLProps<"button">, FloatingPanelTriggerBaseProps {}
|
|
88
|
+
declare const FloatingPanelTrigger: import("react").ForwardRefExoticComponent<FloatingPanelTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/floating-panel/control.d.ts
|
|
91
|
+
interface FloatingPanelControlBaseProps extends PolymorphicProps {}
|
|
92
|
+
interface FloatingPanelControlProps extends HTMLProps<"div">, FloatingPanelControlBaseProps {}
|
|
93
|
+
declare const FloatingPanelControl: import("react").ForwardRefExoticComponent<FloatingPanelControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
94
|
+
declare namespace floating_panel_d_exports {
|
|
95
|
+
export { AnchorPositionDetails, FloatingPanelBody as Body, FloatingPanelBodyBaseProps as BodyBaseProps, FloatingPanelBodyProps as BodyProps, FloatingPanelCloseTrigger as CloseTrigger, FloatingPanelCloseTriggerBaseProps as CloseTriggerBaseProps, FloatingPanelCloseTriggerProps as CloseTriggerProps, FloatingPanelContent as Content, FloatingPanelContentBaseProps as ContentBaseProps, FloatingPanelContentProps as ContentProps, FloatingPanelContext as Context, FloatingPanelContextProps as ContextProps, FloatingPanelControl as Control, FloatingPanelControlBaseProps as ControlBaseProps, FloatingPanelControlProps as ControlProps, FloatingPanelDragTrigger as DragTrigger, FloatingPanelDragTriggerBaseProps as DragTriggerBaseProps, FloatingPanelDragTriggerProps as DragTriggerProps, ElementIds, FloatingPanelHeader as Header, FloatingPanelHeaderBaseProps as HeaderBaseProps, FloatingPanelHeaderProps as HeaderProps, IntlTranslations, OpenChangeDetails, Point, PositionChangeDetails, FloatingPanelPositioner as Positioner, FloatingPanelPositionerBaseProps as PositionerBaseProps, FloatingPanelPositionerProps as PositionerProps, FloatingPanelResizeTrigger as ResizeTrigger, ResizeTriggerAxis, FloatingPanelResizeTriggerBaseProps as ResizeTriggerBaseProps, FloatingPanelResizeTriggerProps as ResizeTriggerProps, FloatingPanelRoot as Root, FloatingPanelRootBaseProps as RootBaseProps, FloatingPanelRootProps as RootProps, FloatingPanelRootProvider as RootProvider, FloatingPanelRootProviderBaseProps as RootProviderBaseProps, FloatingPanelRootProviderProps as RootProviderProps, Size, SizeChangeDetails, Stage, StageChangeDetails, FloatingPanelStageTrigger as StageTrigger, FloatingPanelStageTriggerBaseProps as StageTriggerBaseProps, FloatingPanelStageTriggerProps as StageTriggerProps, FloatingPanelTitle as Title, FloatingPanelTitleBaseProps as TitleBaseProps, FloatingPanelTitleProps as TitleProps, FloatingPanelTrigger as Trigger, FloatingPanelTriggerBaseProps as TriggerBaseProps, FloatingPanelTriggerProps as TriggerProps, resizeTriggerAxes };
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { floating_panel_d_exports as FloatingPanel, type FloatingPanelAnchorPositionDetails, FloatingPanelBody, type FloatingPanelBodyBaseProps, type FloatingPanelBodyProps, FloatingPanelCloseTrigger, type FloatingPanelCloseTriggerBaseProps, type FloatingPanelCloseTriggerProps, FloatingPanelContent, type FloatingPanelContentBaseProps, type FloatingPanelContentProps, FloatingPanelContext, type FloatingPanelContextProps, FloatingPanelControl, type FloatingPanelControlBaseProps, type FloatingPanelControlProps, FloatingPanelDragTrigger, type FloatingPanelDragTriggerBaseProps, type FloatingPanelDragTriggerProps, type FloatingPanelElementIds, FloatingPanelHeader, type FloatingPanelHeaderBaseProps, type FloatingPanelHeaderProps, type FloatingPanelIntlTranslations, type FloatingPanelOpenChangeDetails, type FloatingPanelPoint, type FloatingPanelPositionChangeDetails, FloatingPanelPositioner, type FloatingPanelPositionerBaseProps, type FloatingPanelPositionerProps, FloatingPanelResizeTrigger, type FloatingPanelResizeTriggerAxis, type FloatingPanelResizeTriggerBaseProps, type FloatingPanelResizeTriggerProps, FloatingPanelRoot, type FloatingPanelRootBaseProps, type FloatingPanelRootProps, FloatingPanelRootProvider, type FloatingPanelRootProviderBaseProps, type FloatingPanelRootProviderProps, type FloatingPanelSize, type FloatingPanelSizeChangeDetails, type FloatingPanelStage, type FloatingPanelStageChangeDetails, FloatingPanelStageTrigger, type FloatingPanelStageTriggerBaseProps, type FloatingPanelStageTriggerProps, FloatingPanelTitle, type FloatingPanelTitleBaseProps, type FloatingPanelTitleProps, FloatingPanelTrigger, type FloatingPanelTriggerBaseProps, type FloatingPanelTriggerProps, type UseFloatingPanelContext, type UseFloatingPanelProps, type UseFloatingPanelReturn, floatingPanelAnatomy, useFloatingPanel, useFloatingPanelContext };
|
|
@@ -0,0 +1,242 @@
|
|
|
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 floatingPanel from "@wirekyt/dom/machines/floating-panel";
|
|
11
|
+
import { anatomy as floatingPanelAnatomy, resizeTriggerAxes } from "@wirekyt/dom/machines/floating-panel";
|
|
12
|
+
//#region src/components/floating-panel/use-context.ts
|
|
13
|
+
const [FloatingPanelProvider, useFloatingPanelContext] = createContext$1({
|
|
14
|
+
name: "FloatingPanelContext",
|
|
15
|
+
hookName: "useFloatingPanelContext",
|
|
16
|
+
providerName: "<FloatingPanelProvider />"
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/floating-panel/body.tsx
|
|
20
|
+
const FloatingPanelBody = forwardRef((props, ref) => {
|
|
21
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getBodyProps(), props);
|
|
22
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
23
|
+
...mergedProps,
|
|
24
|
+
ref
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
FloatingPanelBody.displayName = "FloatingPanelBody";
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/floating-panel/close-trigger.tsx
|
|
30
|
+
const FloatingPanelCloseTrigger = forwardRef((props, ref) => {
|
|
31
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getCloseTriggerProps(), props);
|
|
32
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
FloatingPanelCloseTrigger.displayName = "FloatingPanelCloseTrigger";
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/floating-panel/content.tsx
|
|
40
|
+
const FloatingPanelContent = forwardRef((props, ref) => {
|
|
41
|
+
const floatingPanel = useFloatingPanelContext();
|
|
42
|
+
const presence = usePresenceContext();
|
|
43
|
+
const mergedProps = mergeProps(floatingPanel.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
|
+
FloatingPanelContent.displayName = "FloatingPanelContent";
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/floating-panel/context.tsx
|
|
54
|
+
const FloatingPanelContext = (props) => props.children(useFloatingPanelContext());
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/floating-panel/drag-trigger.tsx
|
|
57
|
+
const FloatingPanelDragTrigger = forwardRef((props, ref) => {
|
|
58
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getDragTriggerProps(), props);
|
|
59
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
60
|
+
...mergedProps,
|
|
61
|
+
ref
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
FloatingPanelDragTrigger.displayName = "FloatingPanelDragTrigger";
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/floating-panel/header.tsx
|
|
67
|
+
const FloatingPanelHeader = forwardRef((props, ref) => {
|
|
68
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getHeaderProps(), props);
|
|
69
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
70
|
+
...mergedProps,
|
|
71
|
+
ref
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
FloatingPanelHeader.displayName = "FloatingPanelHeader";
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/floating-panel/positioner.tsx
|
|
77
|
+
const FloatingPanelPositioner = forwardRef((props, ref) => {
|
|
78
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getPositionerProps(), props);
|
|
79
|
+
if (usePresenceContext().unmounted) return null;
|
|
80
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
81
|
+
...mergedProps,
|
|
82
|
+
ref
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
FloatingPanelPositioner.displayName = "FloatingPanelPositioner";
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/components/floating-panel/resize-trigger.tsx
|
|
88
|
+
const splitResizeTriggerProps = createSplitProps();
|
|
89
|
+
const FloatingPanelResizeTrigger = forwardRef((props, ref) => {
|
|
90
|
+
const [resizeProps, localProps] = splitResizeTriggerProps(props, ["axis"]);
|
|
91
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getResizeTriggerProps(resizeProps), localProps);
|
|
92
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
93
|
+
...mergedProps,
|
|
94
|
+
ref
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
FloatingPanelResizeTrigger.displayName = "FloatingPanelResizeTrigger";
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/floating-panel/stage-trigger.tsx
|
|
100
|
+
const splitStageTriggerProps = createSplitProps();
|
|
101
|
+
const FloatingPanelStageTrigger = forwardRef((props, ref) => {
|
|
102
|
+
const [stage, localProps] = splitStageTriggerProps(props, ["stage"]);
|
|
103
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getStageTriggerProps(stage), localProps);
|
|
104
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
105
|
+
...mergedProps,
|
|
106
|
+
ref
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
FloatingPanelStageTrigger.displayName = "FloatingPanelStageTrigger";
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/floating-panel/use.ts
|
|
112
|
+
const useFloatingPanel = (props = {}) => {
|
|
113
|
+
const { getRootNode } = useEnvironmentContext();
|
|
114
|
+
const { dir } = useLocaleContext();
|
|
115
|
+
const context = {
|
|
116
|
+
id: useId(),
|
|
117
|
+
dir,
|
|
118
|
+
getRootNode,
|
|
119
|
+
...props
|
|
120
|
+
};
|
|
121
|
+
const service = useMachine(floatingPanel.machine, context);
|
|
122
|
+
return floatingPanel.connect(service, normalizeProps);
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/floating-panel/root.tsx
|
|
126
|
+
const splitRootProps = createSplitProps();
|
|
127
|
+
const FloatingPanelRoot = (props) => {
|
|
128
|
+
const [presenceProps, otherProps] = splitPresenceProps(props);
|
|
129
|
+
const [useFloatingPanelProps, localProps] = splitRootProps(otherProps, [
|
|
130
|
+
"allowOverflow",
|
|
131
|
+
"closeOnEscape",
|
|
132
|
+
"defaultOpen",
|
|
133
|
+
"defaultPosition",
|
|
134
|
+
"defaultSize",
|
|
135
|
+
"dir",
|
|
136
|
+
"disabled",
|
|
137
|
+
"draggable",
|
|
138
|
+
"getAnchorPosition",
|
|
139
|
+
"getBoundaryEl",
|
|
140
|
+
"gridSize",
|
|
141
|
+
"finalFocusEl",
|
|
142
|
+
"id",
|
|
143
|
+
"ids",
|
|
144
|
+
"initialFocusEl",
|
|
145
|
+
"lockAspectRatio",
|
|
146
|
+
"maxSize",
|
|
147
|
+
"minSize",
|
|
148
|
+
"onOpenChange",
|
|
149
|
+
"onPositionChange",
|
|
150
|
+
"onPositionChangeEnd",
|
|
151
|
+
"onSizeChange",
|
|
152
|
+
"onSizeChangeEnd",
|
|
153
|
+
"onStageChange",
|
|
154
|
+
"open",
|
|
155
|
+
"persistRect",
|
|
156
|
+
"position",
|
|
157
|
+
"resizable",
|
|
158
|
+
"restoreFocus",
|
|
159
|
+
"size",
|
|
160
|
+
"strategy",
|
|
161
|
+
"translations"
|
|
162
|
+
]);
|
|
163
|
+
const floatingPanel = useFloatingPanel(useFloatingPanelProps);
|
|
164
|
+
return /* @__PURE__ */ jsx(FloatingPanelProvider, {
|
|
165
|
+
value: floatingPanel,
|
|
166
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
167
|
+
value: usePresence(mergeProps({ present: floatingPanel.open }, presenceProps)),
|
|
168
|
+
children: localProps.children
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/components/floating-panel/root-provider.tsx
|
|
174
|
+
const splitRootProviderProps = createSplitProps();
|
|
175
|
+
const FloatingPanelRootProvider = (props) => {
|
|
176
|
+
const [presenceProps, baseProps] = splitPresenceProps(props);
|
|
177
|
+
const [{ value: floatingPanel }, localProps] = splitRootProviderProps(baseProps, ["value"]);
|
|
178
|
+
return /* @__PURE__ */ jsx(FloatingPanelProvider, {
|
|
179
|
+
value: floatingPanel,
|
|
180
|
+
children: /* @__PURE__ */ jsx(PresenceProvider, {
|
|
181
|
+
value: usePresence(mergeProps({ present: floatingPanel.open }, presenceProps)),
|
|
182
|
+
children: localProps.children
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/components/floating-panel/title.tsx
|
|
188
|
+
const FloatingPanelTitle = forwardRef((props, ref) => {
|
|
189
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getTitleProps(), props);
|
|
190
|
+
return /* @__PURE__ */ jsx(wire.h2, {
|
|
191
|
+
...mergedProps,
|
|
192
|
+
ref
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
FloatingPanelTitle.displayName = "FloatingPanelTitle";
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/components/floating-panel/trigger.tsx
|
|
198
|
+
const FloatingPanelTrigger = forwardRef((props, ref) => {
|
|
199
|
+
const floatingPanel = useFloatingPanelContext();
|
|
200
|
+
const presence = usePresenceContext();
|
|
201
|
+
const triggerProps = floatingPanel.getTriggerProps();
|
|
202
|
+
const mergedProps = mergeProps({
|
|
203
|
+
...triggerProps,
|
|
204
|
+
"aria-controls": presence.unmounted ? void 0 : triggerProps["aria-controls"]
|
|
205
|
+
}, props);
|
|
206
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
207
|
+
...mergedProps,
|
|
208
|
+
ref
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
FloatingPanelTrigger.displayName = "FloatingPanelTrigger";
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/components/floating-panel/control.tsx
|
|
214
|
+
const FloatingPanelControl = forwardRef((props, ref) => {
|
|
215
|
+
const mergedProps = mergeProps(useFloatingPanelContext().getControlProps(), props);
|
|
216
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
217
|
+
...mergedProps,
|
|
218
|
+
ref
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
FloatingPanelControl.displayName = "FloatingPanelControl";
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/components/floating-panel/floating-panel.ts
|
|
224
|
+
var floating_panel_exports = /* @__PURE__ */ __exportAll({
|
|
225
|
+
Body: () => FloatingPanelBody,
|
|
226
|
+
CloseTrigger: () => FloatingPanelCloseTrigger,
|
|
227
|
+
Content: () => FloatingPanelContent,
|
|
228
|
+
Context: () => FloatingPanelContext,
|
|
229
|
+
Control: () => FloatingPanelControl,
|
|
230
|
+
DragTrigger: () => FloatingPanelDragTrigger,
|
|
231
|
+
Header: () => FloatingPanelHeader,
|
|
232
|
+
Positioner: () => FloatingPanelPositioner,
|
|
233
|
+
ResizeTrigger: () => FloatingPanelResizeTrigger,
|
|
234
|
+
Root: () => FloatingPanelRoot,
|
|
235
|
+
RootProvider: () => FloatingPanelRootProvider,
|
|
236
|
+
StageTrigger: () => FloatingPanelStageTrigger,
|
|
237
|
+
Title: () => FloatingPanelTitle,
|
|
238
|
+
Trigger: () => FloatingPanelTrigger,
|
|
239
|
+
resizeTriggerAxes: () => resizeTriggerAxes
|
|
240
|
+
});
|
|
241
|
+
//#endregion
|
|
242
|
+
export { floating_panel_exports as FloatingPanel, FloatingPanelBody, FloatingPanelCloseTrigger, FloatingPanelContent, FloatingPanelContext, FloatingPanelControl, FloatingPanelDragTrigger, FloatingPanelHeader, FloatingPanelPositioner, FloatingPanelResizeTrigger, FloatingPanelRoot, FloatingPanelRootProvider, FloatingPanelStageTrigger, FloatingPanelTitle, FloatingPanelTrigger, floatingPanelAnatomy, useFloatingPanel, useFloatingPanelContext };
|
package/dist/format.cjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
+
const require_providers = require("./providers-DrJEJcrE.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _wirekyt_dom_i18n_utils = require("@wirekyt/dom/i18n-utils");
|
|
7
|
+
//#region src/components/format/byte.tsx
|
|
8
|
+
const FormatByte = (props) => {
|
|
9
|
+
const { locale } = require_providers.useLocaleContext();
|
|
10
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (0, react.useMemo)(() => {
|
|
11
|
+
const { value, ...intlOptions } = props;
|
|
12
|
+
return (0, _wirekyt_dom_i18n_utils.formatBytes)(value, locale, intlOptions);
|
|
13
|
+
}, [props, locale]) });
|
|
14
|
+
};
|
|
15
|
+
FormatByte.displayName = "FormatByte";
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/format/number.tsx
|
|
18
|
+
const FormatNumber = (props) => {
|
|
19
|
+
const { locale } = require_providers.useLocaleContext();
|
|
20
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (0, react.useMemo)(() => {
|
|
21
|
+
const { value, ...intlOptions } = props;
|
|
22
|
+
return (0, _wirekyt_dom_i18n_utils.formatNumber)(value, locale, intlOptions);
|
|
23
|
+
}, [props, locale]) });
|
|
24
|
+
};
|
|
25
|
+
FormatNumber.displayName = "FormatNumber";
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/format/relative-time.tsx
|
|
28
|
+
const FormatRelativeTime = (props) => {
|
|
29
|
+
const { locale } = require_providers.useLocaleContext();
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (0, react.useMemo)(() => {
|
|
31
|
+
const { value, ...intlOptions } = props;
|
|
32
|
+
return (0, _wirekyt_dom_i18n_utils.formatRelativeTime)(value, locale, intlOptions);
|
|
33
|
+
}, [props, locale]) });
|
|
34
|
+
};
|
|
35
|
+
FormatRelativeTime.displayName = "FormatRelativeTime";
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/format/time.tsx
|
|
38
|
+
const FormatTime = (props) => {
|
|
39
|
+
const { locale } = require_providers.useLocaleContext();
|
|
40
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (0, react.useMemo)(() => {
|
|
41
|
+
const { value, ...intlOptions } = props;
|
|
42
|
+
return (0, _wirekyt_dom_i18n_utils.formatTime)(value, locale, intlOptions);
|
|
43
|
+
}, [props, locale]) });
|
|
44
|
+
};
|
|
45
|
+
FormatTime.displayName = "FormatTime";
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/format/format.ts
|
|
48
|
+
var format_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
49
|
+
Byte: () => FormatByte,
|
|
50
|
+
Number: () => FormatNumber,
|
|
51
|
+
RelativeTime: () => FormatRelativeTime,
|
|
52
|
+
Time: () => FormatTime
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
Object.defineProperty(exports, "Format", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
return format_exports;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
exports.FormatByte = FormatByte;
|
|
62
|
+
exports.FormatNumber = FormatNumber;
|
|
63
|
+
exports.FormatRelativeTime = FormatRelativeTime;
|
|
64
|
+
exports.FormatTime = FormatTime;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FormatTimeOptions } from "@wirekyt/dom/i18n-utils";
|
|
2
|
+
//#region src/components/format/byte.d.ts
|
|
3
|
+
interface FormatByteProps {
|
|
4
|
+
unit?: "bit" | "byte" | undefined;
|
|
5
|
+
unitDisplay?: "long" | "short" | "narrow" | undefined;
|
|
6
|
+
unitSystem?: "decimal" | "binary" | undefined;
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
declare const FormatByte: {
|
|
10
|
+
(props: FormatByteProps): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/format/number.d.ts
|
|
15
|
+
interface FormatNumberProps extends Intl.NumberFormatOptions {
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
declare const FormatNumber: {
|
|
19
|
+
(props: FormatNumberProps): import("react").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/format/relative-time.d.ts
|
|
24
|
+
interface FormatRelativeTimeProps extends Intl.RelativeTimeFormatOptions {
|
|
25
|
+
value: Date;
|
|
26
|
+
}
|
|
27
|
+
declare const FormatRelativeTime: {
|
|
28
|
+
(props: FormatRelativeTimeProps): import("react").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/format/time.d.ts
|
|
33
|
+
interface FormatTimeProps extends FormatTimeOptions {
|
|
34
|
+
value: string | Date;
|
|
35
|
+
}
|
|
36
|
+
declare const FormatTime: {
|
|
37
|
+
(props: FormatTimeProps): import("react").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
declare namespace format_d_exports {
|
|
41
|
+
export { FormatByte as Byte, FormatByteProps as ByteProps, FormatNumber as Number, FormatNumberProps as NumberProps, FormatRelativeTime as RelativeTime, FormatRelativeTimeProps as RelativeTimeProps, FormatTime as Time, FormatTimeProps as TimeProps };
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { format_d_exports as Format, FormatByte, type FormatByteProps, FormatNumber, type FormatNumberProps, FormatRelativeTime, type FormatRelativeTimeProps, FormatTime, type FormatTimeProps };
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FormatTimeOptions } from "@wirekyt/dom/i18n-utils";
|
|
2
|
+
//#region src/components/format/byte.d.ts
|
|
3
|
+
interface FormatByteProps {
|
|
4
|
+
unit?: "bit" | "byte" | undefined;
|
|
5
|
+
unitDisplay?: "long" | "short" | "narrow" | undefined;
|
|
6
|
+
unitSystem?: "decimal" | "binary" | undefined;
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
declare const FormatByte: {
|
|
10
|
+
(props: FormatByteProps): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/format/number.d.ts
|
|
15
|
+
interface FormatNumberProps extends Intl.NumberFormatOptions {
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
declare const FormatNumber: {
|
|
19
|
+
(props: FormatNumberProps): import("react").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/format/relative-time.d.ts
|
|
24
|
+
interface FormatRelativeTimeProps extends Intl.RelativeTimeFormatOptions {
|
|
25
|
+
value: Date;
|
|
26
|
+
}
|
|
27
|
+
declare const FormatRelativeTime: {
|
|
28
|
+
(props: FormatRelativeTimeProps): import("react").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/format/time.d.ts
|
|
33
|
+
interface FormatTimeProps extends FormatTimeOptions {
|
|
34
|
+
value: string | Date;
|
|
35
|
+
}
|
|
36
|
+
declare const FormatTime: {
|
|
37
|
+
(props: FormatTimeProps): import("react").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
declare namespace format_d_exports {
|
|
41
|
+
export { FormatByte as Byte, FormatByteProps as ByteProps, FormatNumber as Number, FormatNumberProps as NumberProps, FormatRelativeTime as RelativeTime, FormatRelativeTimeProps as RelativeTimeProps, FormatTime as Time, FormatTimeProps as TimeProps };
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { format_d_exports as Format, FormatByte, type FormatByteProps, FormatNumber, type FormatNumberProps, FormatRelativeTime, type FormatRelativeTimeProps, FormatTime, type FormatTimeProps };
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as useLocaleContext } from "./providers-FEHnDTvb.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
5
|
+
import { formatBytes, formatNumber, formatRelativeTime, formatTime } from "@wirekyt/dom/i18n-utils";
|
|
6
|
+
//#region src/components/format/byte.tsx
|
|
7
|
+
const FormatByte = (props) => {
|
|
8
|
+
const { locale } = useLocaleContext();
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
|
|
10
|
+
const { value, ...intlOptions } = props;
|
|
11
|
+
return formatBytes(value, locale, intlOptions);
|
|
12
|
+
}, [props, locale]) });
|
|
13
|
+
};
|
|
14
|
+
FormatByte.displayName = "FormatByte";
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/format/number.tsx
|
|
17
|
+
const FormatNumber = (props) => {
|
|
18
|
+
const { locale } = useLocaleContext();
|
|
19
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
|
|
20
|
+
const { value, ...intlOptions } = props;
|
|
21
|
+
return formatNumber(value, locale, intlOptions);
|
|
22
|
+
}, [props, locale]) });
|
|
23
|
+
};
|
|
24
|
+
FormatNumber.displayName = "FormatNumber";
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/format/relative-time.tsx
|
|
27
|
+
const FormatRelativeTime = (props) => {
|
|
28
|
+
const { locale } = useLocaleContext();
|
|
29
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
|
|
30
|
+
const { value, ...intlOptions } = props;
|
|
31
|
+
return formatRelativeTime(value, locale, intlOptions);
|
|
32
|
+
}, [props, locale]) });
|
|
33
|
+
};
|
|
34
|
+
FormatRelativeTime.displayName = "FormatRelativeTime";
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/format/time.tsx
|
|
37
|
+
const FormatTime = (props) => {
|
|
38
|
+
const { locale } = useLocaleContext();
|
|
39
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
|
|
40
|
+
const { value, ...intlOptions } = props;
|
|
41
|
+
return formatTime(value, locale, intlOptions);
|
|
42
|
+
}, [props, locale]) });
|
|
43
|
+
};
|
|
44
|
+
FormatTime.displayName = "FormatTime";
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/format/format.ts
|
|
47
|
+
var format_exports = /* @__PURE__ */ __exportAll({
|
|
48
|
+
Byte: () => FormatByte,
|
|
49
|
+
Number: () => FormatNumber,
|
|
50
|
+
RelativeTime: () => FormatRelativeTime,
|
|
51
|
+
Time: () => FormatTime
|
|
52
|
+
});
|
|
53
|
+
//#endregion
|
|
54
|
+
export { format_exports as Format, FormatByte, FormatNumber, FormatRelativeTime, FormatTime };
|
package/dist/frame.cjs
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
3
|
+
const require_environment = require("./environment-B6IaCAuQ.cjs");
|
|
4
|
+
require("./providers-DrJEJcrE.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_dom = require("react-dom");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/frame/content.tsx
|
|
9
|
+
const FrameContent = (props) => {
|
|
10
|
+
const { onMount, onUnmount, children } = props;
|
|
11
|
+
const mountedRef = (0, react.useRef)(false);
|
|
12
|
+
const calledRef = (0, react.useRef)(false);
|
|
13
|
+
(0, react.useEffect)(() => {
|
|
14
|
+
if (!mountedRef.current && !calledRef.current) {
|
|
15
|
+
onMount?.();
|
|
16
|
+
mountedRef.current = true;
|
|
17
|
+
calledRef.current = true;
|
|
18
|
+
}
|
|
19
|
+
return () => {
|
|
20
|
+
if (mountedRef.current) {
|
|
21
|
+
onUnmount?.();
|
|
22
|
+
mountedRef.current = false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return children;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/frame/frame.tsx
|
|
30
|
+
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>`;
|
|
31
|
+
function getMountNode(frame) {
|
|
32
|
+
const doc = frame.contentWindow?.document;
|
|
33
|
+
if (!doc) return null;
|
|
34
|
+
return doc.body.querySelector(".frame-root") || doc.body;
|
|
35
|
+
}
|
|
36
|
+
const Frame = (0, react.forwardRef)((props, ref) => {
|
|
37
|
+
const { children, head, onMount, onUnmount, srcDoc = initialSrcDoc, ...rest } = props;
|
|
38
|
+
const [frameRef, setFrameRef] = (0, react.useState)(null);
|
|
39
|
+
const [mountNode, setMountNode] = (0, react.useState)(null);
|
|
40
|
+
const composedRefs = require_utils.useComposedRefs(ref, setFrameRef);
|
|
41
|
+
require_utils.useSafeLayoutEffect(() => {
|
|
42
|
+
if (!frameRef) return;
|
|
43
|
+
const doc = frameRef.contentWindow?.document;
|
|
44
|
+
if (!doc) return;
|
|
45
|
+
doc.open();
|
|
46
|
+
doc.write(srcDoc);
|
|
47
|
+
doc.close();
|
|
48
|
+
setMountNode(getMountNode(frameRef));
|
|
49
|
+
}, [frameRef, srcDoc]);
|
|
50
|
+
(0, react.useEffect)(() => {
|
|
51
|
+
if (!frameRef?.contentDocument) return;
|
|
52
|
+
const win = frameRef.contentWindow;
|
|
53
|
+
if (!win) return;
|
|
54
|
+
const mountNode = getMountNode(frameRef);
|
|
55
|
+
if (!mountNode) return;
|
|
56
|
+
const exec = () => {
|
|
57
|
+
win.requestAnimationFrame(() => {
|
|
58
|
+
if (!frameRef.contentDocument?.documentElement) return;
|
|
59
|
+
frameRef.style.setProperty("--width", `${mountNode.scrollWidth}px`);
|
|
60
|
+
frameRef.style.setProperty("--height", `${mountNode.scrollHeight}px`);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const resizeObserver = new win.ResizeObserver(exec);
|
|
64
|
+
exec();
|
|
65
|
+
if (frameRef.contentDocument) resizeObserver.observe(mountNode);
|
|
66
|
+
return () => {
|
|
67
|
+
resizeObserver.disconnect();
|
|
68
|
+
};
|
|
69
|
+
}, [frameRef]);
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_environment.EnvironmentProvider, {
|
|
71
|
+
value: () => frameRef?.contentDocument ?? document,
|
|
72
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("iframe", {
|
|
73
|
+
title: `frame:${(0, react.useId)()}`,
|
|
74
|
+
ref: composedRefs,
|
|
75
|
+
...rest,
|
|
76
|
+
children: [mountNode ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FrameContent, {
|
|
77
|
+
onMount,
|
|
78
|
+
onUnmount,
|
|
79
|
+
children
|
|
80
|
+
}), mountNode) : null, head && frameRef ? (0, react_dom.createPortal)(head, frameRef.contentDocument.head) : null]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.Frame = Frame;
|
package/dist/frame.d.cts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./index-CQAbOgb7.cjs";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.cjs";
|
|
3
|
+
//#region src/components/frame/frame.d.ts
|
|
4
|
+
interface FrameBaseProps {
|
|
5
|
+
head?: React.ReactNode | undefined;
|
|
6
|
+
onMount?: (() => void) | undefined;
|
|
7
|
+
onUnmount?: (() => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface FrameProps extends Assign<React.IframeHTMLAttributes<HTMLIFrameElement>, FrameBaseProps> {}
|
|
10
|
+
declare const Frame: import("react").ForwardRefExoticComponent<FrameProps & import("react").RefAttributes<HTMLIFrameElement>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Frame, type FrameBaseProps, type FrameProps };
|
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./index-CxWYgVJk.js";
|
|
2
|
+
import { t as Assign } from "./types-BQQfrr86.js";
|
|
3
|
+
//#region src/components/frame/frame.d.ts
|
|
4
|
+
interface FrameBaseProps {
|
|
5
|
+
head?: React.ReactNode | undefined;
|
|
6
|
+
onMount?: (() => void) | undefined;
|
|
7
|
+
onUnmount?: (() => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
interface FrameProps extends Assign<React.IframeHTMLAttributes<HTMLIFrameElement>, FrameBaseProps> {}
|
|
10
|
+
declare const Frame: import("react").ForwardRefExoticComponent<FrameProps & import("react").RefAttributes<HTMLIFrameElement>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Frame, type FrameBaseProps, type FrameProps };
|