@deftui/react 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -2
- package/dist/index.mjs +6 -2
- package/dist/styles.css +4 -1
- package/dist/vendor/README.md +65 -0
- package/dist/vendor/coss/scroll-area.d.mts +2 -2
- package/dist/vendor/coss/scroll-area.mjs +2 -2
- package/dist/vendor/shadcn/alert-dialog.d.mts +10 -8
- package/dist/vendor/shadcn/alert-dialog.mjs +14 -11
- package/dist/vendor/shadcn/combobox.d.mts +16 -14
- package/dist/vendor/shadcn/combobox.mjs +23 -20
- package/dist/vendor/shadcn/dialog.d.mts +10 -8
- package/dist/vendor/shadcn/dialog.mjs +15 -12
- package/dist/vendor/shadcn/drawer.d.mts +10 -8
- package/dist/vendor/shadcn/drawer.mjs +16 -13
- package/dist/vendor/shadcn/field.mjs +0 -1
- package/dist/vendor/shadcn/input.mjs +1 -1
- package/dist/vendor/shadcn/sidebar.mjs +0 -1
- package/dist/vendor/shadcn/skeleton.mjs +11 -3
- package/dist/vendor/tailored/lightbox.d.mts +187 -0
- package/dist/vendor/tailored/lightbox.mjs +2395 -0
- package/dist/widgets/breadcrumb.mjs +1 -1
- package/dist/widgets/index.d.mts +10 -15
- package/dist/widgets/index.mjs +27 -35
- package/dist/widgets/multimedia.d.mts +22 -0
- package/dist/widgets/multimedia.mjs +69 -0
- package/dist/widgets/pagination.mjs +1 -1
- package/dist/widgets/sidebar.mjs +1 -1
- package/dist/widgets/utils.d.mts +5 -0
- package/package.json +5 -1
- package/dist/vendor.css +0 -1
- package/dist/widgets/image-display.d.mts +0 -12
- package/dist/widgets/image-display.mjs +0 -29
- package/dist/widgets/toast.mjs +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "cn";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Drawer
|
|
5
|
+
import { Drawer } from "@base-ui/react/drawer";
|
|
6
6
|
// src/vendor/shadcn/drawer.tsx
|
|
7
7
|
const DrawerContext = React$1.createContext(null);
|
|
8
8
|
function useDrawer() {
|
|
@@ -10,7 +10,7 @@ function useDrawer() {
|
|
|
10
10
|
if (!context) throw new Error("useDrawer must be used within a Drawer.");
|
|
11
11
|
return context;
|
|
12
12
|
}
|
|
13
|
-
function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
|
|
13
|
+
function Drawer$1({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
|
|
14
14
|
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
15
15
|
const contextValue = React$1.useMemo(() => ({
|
|
16
16
|
hasSnapPoints,
|
|
@@ -25,7 +25,7 @@ function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirect
|
|
|
25
25
|
]);
|
|
26
26
|
return /* @__PURE__ */ jsx(DrawerContext.Provider, {
|
|
27
27
|
value: contextValue,
|
|
28
|
-
children: /* @__PURE__ */ jsx(
|
|
28
|
+
children: /* @__PURE__ */ jsx(Drawer.Root, {
|
|
29
29
|
"data-slot": "drawer",
|
|
30
30
|
modal,
|
|
31
31
|
snapPoints,
|
|
@@ -35,25 +35,25 @@ function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirect
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
function DrawerTrigger({ ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
+
return /* @__PURE__ */ jsx(Drawer.Trigger, {
|
|
39
39
|
"data-slot": "drawer-trigger",
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
function DrawerPortal({ ...props }) {
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
+
return /* @__PURE__ */ jsx(Drawer.Portal, {
|
|
45
45
|
"data-slot": "drawer-portal",
|
|
46
46
|
...props
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
function DrawerClose({ ...props }) {
|
|
50
|
-
return /* @__PURE__ */ jsx(
|
|
50
|
+
return /* @__PURE__ */ jsx(Drawer.Close, {
|
|
51
51
|
"data-slot": "drawer-close",
|
|
52
52
|
...props
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function DrawerOverlay({ className, ...props }) {
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
+
return /* @__PURE__ */ jsx(Drawer.Backdrop, {
|
|
57
57
|
"data-slot": "drawer-overlay",
|
|
58
58
|
className: cn("fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className),
|
|
59
59
|
...props
|
|
@@ -72,17 +72,17 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
72
72
|
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
73
73
|
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
74
74
|
"data-slot": "drawer-portal",
|
|
75
|
-
children: [modal === true && /* @__PURE__ */ jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : void 0 }), /* @__PURE__ */ jsx(
|
|
75
|
+
children: [modal === true && /* @__PURE__ */ jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : void 0 }), /* @__PURE__ */ jsx(Drawer.Viewport, {
|
|
76
76
|
"data-slot": "drawer-viewport",
|
|
77
77
|
"data-modal": modal,
|
|
78
78
|
className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto",
|
|
79
|
-
children: /* @__PURE__ */ jsxs(
|
|
79
|
+
children: /* @__PURE__ */ jsxs(Drawer.Popup, {
|
|
80
80
|
"data-slot": "drawer-popup",
|
|
81
81
|
"data-swipe-axis": swipeAxis,
|
|
82
82
|
"data-snap-points": hasSnapPoints ? "" : void 0,
|
|
83
83
|
className: cn("group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b", "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95", "after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full", "[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]", "[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]", "data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]", "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)", "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row", "data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]", "data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]", "data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]", "data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]", className),
|
|
84
84
|
...props,
|
|
85
|
-
children: [showSwipeHandle && /* @__PURE__ */ jsx(DrawerSwipeHandle, {}), /* @__PURE__ */ jsx(
|
|
85
|
+
children: [showSwipeHandle && /* @__PURE__ */ jsx(DrawerSwipeHandle, {}), /* @__PURE__ */ jsx(Drawer.Content, {
|
|
86
86
|
"data-slot": "drawer-content",
|
|
87
87
|
className: cn("flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"),
|
|
88
88
|
children
|
|
@@ -106,17 +106,20 @@ function DrawerFooter({ className, ...props }) {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
function DrawerTitle({ className, ...props }) {
|
|
109
|
-
return /* @__PURE__ */ jsx(
|
|
109
|
+
return /* @__PURE__ */ jsx(Drawer.Title, {
|
|
110
110
|
"data-slot": "drawer-title",
|
|
111
111
|
className: cn("font-medium text-foreground", className),
|
|
112
112
|
...props
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
function DrawerDescription({ className, ...props }) {
|
|
116
|
-
return /* @__PURE__ */ jsx(
|
|
116
|
+
return /* @__PURE__ */ jsx(Drawer.Description, {
|
|
117
117
|
"data-slot": "drawer-description",
|
|
118
118
|
className: cn("text-sm text-balance text-muted-foreground", className),
|
|
119
119
|
...props
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
function createDrawerHandle() {
|
|
123
|
+
return Drawer.createHandle();
|
|
124
|
+
}
|
|
125
|
+
export { Drawer$1 as Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, createDrawerHandle };
|
|
@@ -7,7 +7,7 @@ function Input$1({ className, type, ...props }) {
|
|
|
7
7
|
return /* @__PURE__ */ jsx(Input, {
|
|
8
8
|
type,
|
|
9
9
|
"data-slot": "input",
|
|
10
|
-
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
10
|
+
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow,background-color] duration-[150ms,150ms,5000000s] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground autofill:inset-shadow-[0_0_0_1000px] autofill:inset-shadow-foreground/4 autofill:[-webkit-text-fill-color:var(--foreground)] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:autofill:inset-shadow-foreground/8 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
11
11
|
...props
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -5,7 +5,6 @@ import { Input } from "./input.mjs";
|
|
|
5
5
|
import { Separator } from "./separator.mjs";
|
|
6
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
|
|
7
7
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.mjs";
|
|
8
|
-
import "./skeleton.mjs";
|
|
9
8
|
import { cn } from "cn";
|
|
10
9
|
import { cva } from "class-variance-authority";
|
|
11
10
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import "cn";
|
|
2
|
-
import "react/jsx-runtime";
|
|
3
|
-
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/vendor/shadcn/skeleton.tsx
|
|
4
|
+
function Skeleton({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export { Skeleton };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Button } from "../shadcn/button.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
type LightboxOverlay = "blur" | "brightness";
|
|
6
|
+
type LightboxDirection = "ltr" | "rtl";
|
|
7
|
+
type LightboxChangeReason = "trigger-press" | "previous-press" | "next-press" | "thumbnail-press" | "swipe" | "keyboard" | "programmatic" | "items-change";
|
|
8
|
+
type LightboxImageItem = {
|
|
9
|
+
id?: string;
|
|
10
|
+
type: "image";
|
|
11
|
+
src: string;
|
|
12
|
+
alt: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
srcSet?: string;
|
|
16
|
+
sizes?: string;
|
|
17
|
+
thumbnail?: React$1.ReactNode;
|
|
18
|
+
thumbnailSrc?: string;
|
|
19
|
+
caption?: React$1.ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
download?: boolean | {
|
|
22
|
+
src?: string;
|
|
23
|
+
filename?: string;
|
|
24
|
+
};
|
|
25
|
+
zoomable?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type LightboxVideoItem = {
|
|
28
|
+
id?: string;
|
|
29
|
+
type: "video";
|
|
30
|
+
src: string;
|
|
31
|
+
label: string;
|
|
32
|
+
thumbnail?: React$1.ReactNode;
|
|
33
|
+
poster?: string;
|
|
34
|
+
width?: number;
|
|
35
|
+
height?: number;
|
|
36
|
+
sources?: React$1.SourceHTMLAttributes<HTMLSourceElement>[];
|
|
37
|
+
tracks?: React$1.TrackHTMLAttributes<HTMLTrackElement>[];
|
|
38
|
+
videoProps?: Omit<React$1.VideoHTMLAttributes<HTMLVideoElement>, "children" | "className" | "height" | "poster" | "src" | "width">;
|
|
39
|
+
caption?: React$1.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
download?: boolean | {
|
|
42
|
+
src?: string;
|
|
43
|
+
filename?: string;
|
|
44
|
+
};
|
|
45
|
+
zoomable?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type LightboxItem = LightboxImageItem | LightboxVideoItem;
|
|
48
|
+
type LightboxImageChangeEventDetails = {
|
|
49
|
+
reason: LightboxChangeReason;
|
|
50
|
+
event?: Event;
|
|
51
|
+
previousIndex: number;
|
|
52
|
+
};
|
|
53
|
+
type LightboxOpenEventDetails = {
|
|
54
|
+
reason: Dialog.Root.ChangeEventReason;
|
|
55
|
+
event?: Event;
|
|
56
|
+
index: number;
|
|
57
|
+
item?: LightboxItem;
|
|
58
|
+
};
|
|
59
|
+
type LightboxControlContext = {
|
|
60
|
+
item?: LightboxItem;
|
|
61
|
+
index: number;
|
|
62
|
+
event: React$1.MouseEvent<HTMLElement>;
|
|
63
|
+
actions: LightboxActions;
|
|
64
|
+
};
|
|
65
|
+
type LightboxControl = {
|
|
66
|
+
id: string;
|
|
67
|
+
icon: React$1.ReactNode;
|
|
68
|
+
label: string;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
onClick: (context: LightboxControlContext) => void;
|
|
71
|
+
};
|
|
72
|
+
type LightboxActions = {
|
|
73
|
+
open: (index?: number) => void;
|
|
74
|
+
close: () => void;
|
|
75
|
+
goTo: (index: number) => void;
|
|
76
|
+
next: () => void;
|
|
77
|
+
previous: () => void;
|
|
78
|
+
zoomIn: () => void;
|
|
79
|
+
zoomOut: () => void;
|
|
80
|
+
resetZoom: () => void;
|
|
81
|
+
};
|
|
82
|
+
type LightboxProps = {
|
|
83
|
+
children?: React$1.ReactNode;
|
|
84
|
+
items?: LightboxItem[];
|
|
85
|
+
open?: boolean;
|
|
86
|
+
defaultOpen?: boolean;
|
|
87
|
+
onOpenChange?: Dialog.Root.Props["onOpenChange"];
|
|
88
|
+
onOpenChangeComplete?: Dialog.Root.Props["onOpenChangeComplete"];
|
|
89
|
+
onOpen?: (details: LightboxOpenEventDetails) => void;
|
|
90
|
+
onClose?: (details: LightboxOpenEventDetails) => void;
|
|
91
|
+
index?: number;
|
|
92
|
+
defaultIndex?: number;
|
|
93
|
+
onChangeImage?: (index: number, item: LightboxItem, details: LightboxImageChangeEventDetails) => void;
|
|
94
|
+
overlay?: "blur" | "brightness";
|
|
95
|
+
loop?: boolean;
|
|
96
|
+
noCounter?: boolean;
|
|
97
|
+
noCarousel?: boolean;
|
|
98
|
+
noControls?: boolean;
|
|
99
|
+
loading?: "lazy" | "eager";
|
|
100
|
+
preload?: number;
|
|
101
|
+
maxZoom?: number;
|
|
102
|
+
controls?: LightboxControl[];
|
|
103
|
+
dir?: "ltr" | "rtl";
|
|
104
|
+
className?: string;
|
|
105
|
+
actionsRef?: React$1.Ref<LightboxActions>;
|
|
106
|
+
} & Omit<Dialog.Root.Props, "children" | "modal" | "onOpenChange" | "onOpenChangeComplete" | "open" | "defaultOpen" | "actionsRef">;
|
|
107
|
+
type TransformState = {
|
|
108
|
+
scale: number;
|
|
109
|
+
panX: number;
|
|
110
|
+
panY: number;
|
|
111
|
+
swipeX: number;
|
|
112
|
+
dismissY: number;
|
|
113
|
+
dragging: boolean;
|
|
114
|
+
};
|
|
115
|
+
type RegisteredSource = {
|
|
116
|
+
element: HTMLElement;
|
|
117
|
+
morph: boolean;
|
|
118
|
+
};
|
|
119
|
+
type LightboxContextValue = {
|
|
120
|
+
activeIndex: number;
|
|
121
|
+
activeItem?: LightboxItem;
|
|
122
|
+
actions: LightboxActions;
|
|
123
|
+
armPostGestureActivationRepair: (event: Event) => void;
|
|
124
|
+
animateZoom: (target: Pick<TransformState, "scale" | "panX" | "panY">) => void;
|
|
125
|
+
changeIndex: (index: number, reason: LightboxChangeReason, event?: Event) => void;
|
|
126
|
+
closeWithDetails: (details: Dialog.Root.ChangeEventDetails) => void;
|
|
127
|
+
controls: LightboxControl[];
|
|
128
|
+
direction: LightboxDirection;
|
|
129
|
+
getSource: (index: number) => RegisteredSource | undefined;
|
|
130
|
+
items: LightboxItem[];
|
|
131
|
+
loadedAssets: ReadonlySet<string>;
|
|
132
|
+
loading: "lazy" | "eager";
|
|
133
|
+
loop: boolean;
|
|
134
|
+
markAssetLoaded: (key: string) => void;
|
|
135
|
+
maxZoom: number;
|
|
136
|
+
noCarousel: boolean;
|
|
137
|
+
noControls: boolean;
|
|
138
|
+
noCounter: boolean;
|
|
139
|
+
open: boolean;
|
|
140
|
+
overlay: LightboxOverlay;
|
|
141
|
+
preload: number;
|
|
142
|
+
registerMedia: (element: HTMLElement | null) => void;
|
|
143
|
+
registerSource: (index: number, source: RegisteredSource | null) => void;
|
|
144
|
+
requestOpen: (index: number, source?: RegisteredSource, event?: Event) => void;
|
|
145
|
+
setTransform: React$1.Dispatch<React$1.SetStateAction<TransformState>>;
|
|
146
|
+
shouldReduceMotion: boolean;
|
|
147
|
+
stopZoomAnimation: () => void;
|
|
148
|
+
transform: TransformState;
|
|
149
|
+
};
|
|
150
|
+
declare function useLightbox(): LightboxContextValue;
|
|
151
|
+
declare function Lightbox({ children, items: itemsProp, open: openProp, defaultOpen, onOpenChange, onOpenChangeComplete, onOpen, onClose, index: indexProp, defaultIndex, onChangeImage, overlay, loop, noCounter, noCarousel, noControls, loading, preload, maxZoom, controls, dir, className, actionsRef, ...rootProps }: LightboxProps): React$1.JSX.Element;
|
|
152
|
+
type LightboxTriggerProps = {
|
|
153
|
+
index?: number;
|
|
154
|
+
morph?: boolean;
|
|
155
|
+
} & Dialog.Trigger.Props;
|
|
156
|
+
declare function LightboxTrigger({ index, morph, onClick, ref, ...props }: LightboxTriggerProps): React$1.JSX.Element;
|
|
157
|
+
declare function LightboxBackdrop({ className, style, ...props }: Dialog.Backdrop.Props): React$1.JSX.Element;
|
|
158
|
+
declare function LightboxViewport({ className, ...props }: Dialog.Viewport.Props): React$1.JSX.Element;
|
|
159
|
+
type LightboxContentProps = {} & Dialog.Popup.Props;
|
|
160
|
+
declare function LightboxContent({ className, children, initialFocus, onKeyDown, style, ...props }: LightboxContentProps): React$1.JSX.Element;
|
|
161
|
+
type LightboxZoomProps = {
|
|
162
|
+
active?: boolean;
|
|
163
|
+
} & useRender.ComponentProps<"div">;
|
|
164
|
+
declare function LightboxZoom({ active, className, render, style, ref, ...props }: LightboxZoomProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
165
|
+
type LightboxSlideProps = {
|
|
166
|
+
index: number;
|
|
167
|
+
active?: boolean;
|
|
168
|
+
} & React$1.ComponentProps<"div">;
|
|
169
|
+
declare function LightboxSlide({ index, active, className, style, ...props }: LightboxSlideProps): React$1.JSX.Element | null;
|
|
170
|
+
declare function LightboxSlides({ className, onClick, onKeyDown, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onWheel, onDoubleClick, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
171
|
+
declare function LightboxToolbar({ className, children, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
172
|
+
declare function LightboxCounter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
173
|
+
declare function LightboxCaptions({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element | null;
|
|
174
|
+
type LightboxActionButtonProps = Omit<React$1.ComponentProps<typeof Button>, "color" | "size" | "variant">;
|
|
175
|
+
type LightboxThumbnailProps = {
|
|
176
|
+
index: number;
|
|
177
|
+
onClick?: React$1.MouseEventHandler<HTMLButtonElement>;
|
|
178
|
+
} & Omit<LightboxActionButtonProps, "onClick">;
|
|
179
|
+
declare function LightboxThumbnail({ index, className, onClick, ...props }: LightboxThumbnailProps): React$1.JSX.Element | null;
|
|
180
|
+
declare function LightboxThumbnails({ className, children, onKeyDown, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
181
|
+
declare function LightboxPrevious({ className, disabled: disabledProp, onClick, style, ...props }: LightboxActionButtonProps): React$1.JSX.Element | null;
|
|
182
|
+
declare function LightboxNext({ className, disabled: disabledProp, onClick, style, ...props }: LightboxActionButtonProps): React$1.JSX.Element | null;
|
|
183
|
+
declare function LightboxZoomButton({ className, disabled, onClick, ...props }: LightboxActionButtonProps): React$1.JSX.Element | null;
|
|
184
|
+
declare function LightboxDownload({ className, disabled, onClick, ...props }: Omit<LightboxActionButtonProps, "render">): React$1.JSX.Element | null;
|
|
185
|
+
declare function LightboxMore({ className, ...props }: LightboxActionButtonProps): React$1.JSX.Element | null;
|
|
186
|
+
declare function LightboxClose({ className, children, ...props }: Dialog.Close.Props): React$1.JSX.Element;
|
|
187
|
+
export { Lightbox, type LightboxActions, LightboxBackdrop, LightboxCaptions, type LightboxChangeReason, LightboxClose, LightboxContent, type LightboxControl, type LightboxControlContext, LightboxCounter, LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, LightboxMore, LightboxNext, type LightboxOpenEventDetails, LightboxPrevious, type LightboxProps, LightboxSlide, LightboxSlides, LightboxThumbnail, LightboxThumbnails, LightboxToolbar, LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, LightboxViewport, LightboxZoom, LightboxZoomButton, useLightbox };
|