@zipkito/gallery 1.0.0
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.
Potentially problematic release.
This version of @zipkito/gallery might be problematic. Click here for more details.
- package/dist/index.d.mts +189 -0
- package/dist/index.d.ts +189 -0
- package/dist/index.js +900 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +860 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +48 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { UseMdxComponents } from '@mdx-js/mdx';
|
|
5
|
+
import { OverlayProps } from '@zipkito/shared';
|
|
6
|
+
import { Container, Typography, SxProps, Theme } from '@mui/material';
|
|
7
|
+
|
|
8
|
+
type SlideGallerySlideType = "Image" | "ImageWithText" | "PDF";
|
|
9
|
+
interface SlideGallerySlide {
|
|
10
|
+
type: SlideGallerySlideType;
|
|
11
|
+
image?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
file?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ArrowRenderProps {
|
|
18
|
+
canGoPrev: boolean;
|
|
19
|
+
canGoNext: boolean;
|
|
20
|
+
prev: () => void;
|
|
21
|
+
next: () => void;
|
|
22
|
+
}
|
|
23
|
+
interface ArrowSlotProps {
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
}
|
|
27
|
+
type ArrowRenderFn = (params: ArrowSlotProps) => ReactNode;
|
|
28
|
+
|
|
29
|
+
declare const GALLERY_TYPE: {
|
|
30
|
+
readonly Slide: "slide";
|
|
31
|
+
readonly MDX: "mdx";
|
|
32
|
+
readonly Iframe: "iframe";
|
|
33
|
+
};
|
|
34
|
+
interface WithVisibility {
|
|
35
|
+
visible: boolean;
|
|
36
|
+
originalIndex: number;
|
|
37
|
+
type: (typeof GALLERY_TYPE)[keyof typeof GALLERY_TYPE];
|
|
38
|
+
}
|
|
39
|
+
interface MDXGalleryType extends WithVisibility {
|
|
40
|
+
file?: string;
|
|
41
|
+
}
|
|
42
|
+
interface SlideGalleryType extends WithVisibility {
|
|
43
|
+
slides: SlideGallerySlide[];
|
|
44
|
+
}
|
|
45
|
+
interface IframeGalleryType extends WithVisibility {
|
|
46
|
+
path?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface MDXLoaderContext {
|
|
50
|
+
components?: UseMdxComponents;
|
|
51
|
+
loadSource: (file: string) => Promise<string>;
|
|
52
|
+
}
|
|
53
|
+
interface MDXGallerySlots {
|
|
54
|
+
root?: ElementType;
|
|
55
|
+
container?: ElementType;
|
|
56
|
+
loadingMessage?: ElementType;
|
|
57
|
+
errorMessage?: ElementType;
|
|
58
|
+
}
|
|
59
|
+
interface MDXGallerySlotProps {
|
|
60
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
61
|
+
container?: ComponentPropsWithoutRef<typeof Container>;
|
|
62
|
+
loadingMessage?: ComponentPropsWithoutRef<typeof Typography>;
|
|
63
|
+
errorMessage?: ComponentPropsWithoutRef<typeof Typography>;
|
|
64
|
+
}
|
|
65
|
+
interface MDXGalleryProps {
|
|
66
|
+
gallery: MDXGalleryType;
|
|
67
|
+
mdxContext: MDXLoaderContext;
|
|
68
|
+
actions?: ReactNode;
|
|
69
|
+
slots?: MDXGallerySlots;
|
|
70
|
+
slotProps?: MDXGallerySlotProps;
|
|
71
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
72
|
+
sx?: SxProps<Theme>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare const MDXGallery: react.MemoExoticComponent<(props: MDXGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
76
|
+
|
|
77
|
+
interface ImageSliderControlsSlots {
|
|
78
|
+
root?: ElementType;
|
|
79
|
+
dotsWrapper?: ElementType;
|
|
80
|
+
dot?: ElementType;
|
|
81
|
+
leftArrow?: ElementType<ArrowSlotProps>;
|
|
82
|
+
rightArrow?: ElementType<ArrowSlotProps>;
|
|
83
|
+
}
|
|
84
|
+
interface ImageSliderControlsSlotProps {
|
|
85
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
86
|
+
dotsWrapper?: ComponentPropsWithoutRef<"div">;
|
|
87
|
+
dot?: ComponentPropsWithoutRef<"div">;
|
|
88
|
+
leftArrow?: Partial<ArrowSlotProps>;
|
|
89
|
+
rightArrow?: Partial<ArrowSlotProps>;
|
|
90
|
+
}
|
|
91
|
+
interface ImageSliderControlsProps {
|
|
92
|
+
showDots: boolean;
|
|
93
|
+
showArrows: boolean;
|
|
94
|
+
currentSlide: number;
|
|
95
|
+
memoizedSlides: (SlideGallerySlide & {
|
|
96
|
+
alt: string;
|
|
97
|
+
})[];
|
|
98
|
+
canGoPrev: boolean;
|
|
99
|
+
canGoNext: boolean;
|
|
100
|
+
prev: () => void;
|
|
101
|
+
next: () => void;
|
|
102
|
+
goToSlide: (index: number) => void;
|
|
103
|
+
slots?: ImageSliderControlsSlots;
|
|
104
|
+
slotProps?: ImageSliderControlsSlotProps;
|
|
105
|
+
sx?: SxProps<Theme>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface ImageSliderSlots {
|
|
109
|
+
root?: ElementType;
|
|
110
|
+
sliderWrapper?: ElementType;
|
|
111
|
+
slidesWrapper?: ElementType;
|
|
112
|
+
slideItem?: ElementType;
|
|
113
|
+
slideContent?: ElementType;
|
|
114
|
+
imageWrapper?: ElementType;
|
|
115
|
+
slideImage?: ElementType;
|
|
116
|
+
textWrapper?: ElementType;
|
|
117
|
+
slideTitle?: ElementType;
|
|
118
|
+
slideDescription?: ElementType;
|
|
119
|
+
slideEmbed?: ElementType;
|
|
120
|
+
slideLink?: ElementType;
|
|
121
|
+
emptyControls?: ElementType;
|
|
122
|
+
}
|
|
123
|
+
interface ImageSliderSlotProps {
|
|
124
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
125
|
+
sliderWrapper?: ComponentPropsWithoutRef<"div">;
|
|
126
|
+
slidesWrapper?: ComponentPropsWithoutRef<"div">;
|
|
127
|
+
slideItem?: ComponentPropsWithoutRef<"div">;
|
|
128
|
+
slideContent?: ComponentPropsWithoutRef<"div">;
|
|
129
|
+
imageWrapper?: ComponentPropsWithoutRef<"div">;
|
|
130
|
+
slideImage?: ComponentPropsWithoutRef<"img">;
|
|
131
|
+
textWrapper?: ComponentPropsWithoutRef<"div">;
|
|
132
|
+
slideTitle?: ComponentPropsWithoutRef<"h3">;
|
|
133
|
+
slideDescription?: ComponentPropsWithoutRef<"p">;
|
|
134
|
+
slideEmbed?: ComponentPropsWithoutRef<"embed">;
|
|
135
|
+
slideLink?: ComponentPropsWithoutRef<"a">;
|
|
136
|
+
emptyControls?: ComponentPropsWithoutRef<"div">;
|
|
137
|
+
}
|
|
138
|
+
interface ImageSliderProps {
|
|
139
|
+
loop?: boolean;
|
|
140
|
+
showDots?: boolean;
|
|
141
|
+
showArrows?: boolean;
|
|
142
|
+
slides: (SlideGallerySlide & {
|
|
143
|
+
alt: string;
|
|
144
|
+
})[];
|
|
145
|
+
className?: string;
|
|
146
|
+
transitionDuration?: number;
|
|
147
|
+
onSlideChange?: (index: number) => void;
|
|
148
|
+
slots?: ImageSliderSlots;
|
|
149
|
+
slotProps?: ImageSliderSlotProps;
|
|
150
|
+
controlsProps?: Omit<ImageSliderControlsProps, "showDots" | "showArrows" | "currentSlide" | "memoizedSlides" | "canGoPrev" | "canGoNext" | "prev" | "next" | "goToSlide">;
|
|
151
|
+
sx?: SxProps<Theme>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface SlideGallerySlots {
|
|
155
|
+
root?: ElementType;
|
|
156
|
+
}
|
|
157
|
+
interface SlideGallerySlotProps {
|
|
158
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
159
|
+
}
|
|
160
|
+
interface SlideGalleryProps {
|
|
161
|
+
gallery: SlideGalleryType;
|
|
162
|
+
slots?: SlideGallerySlots;
|
|
163
|
+
slotProps?: SlideGallerySlotProps;
|
|
164
|
+
imageSliderProps?: Omit<ImageSliderProps, "controlsProps">;
|
|
165
|
+
controlsProps?: Omit<ImageSliderControlsProps, "showDots" | "showArrows" | "currentSlide" | "memoizedSlides" | "canGoPrev" | "canGoNext" | "prev" | "next" | "goToSlide">;
|
|
166
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
167
|
+
sx?: SxProps<Theme>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare const SlideGallery: react.MemoExoticComponent<(props: SlideGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
171
|
+
|
|
172
|
+
interface IframeGallerySlots {
|
|
173
|
+
frame?: ElementType;
|
|
174
|
+
}
|
|
175
|
+
interface IframeGallerySlotProps {
|
|
176
|
+
frame?: ComponentPropsWithoutRef<"iframe">;
|
|
177
|
+
}
|
|
178
|
+
interface IframeGalleryProps {
|
|
179
|
+
gallery: IframeGalleryType;
|
|
180
|
+
actions?: ReactNode;
|
|
181
|
+
slots?: IframeGallerySlots;
|
|
182
|
+
slotProps?: IframeGallerySlotProps;
|
|
183
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
184
|
+
sx?: SxProps<Theme>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
declare const IframeGallery: react.MemoExoticComponent<(props: IframeGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
188
|
+
|
|
189
|
+
export { type ArrowRenderFn, type ArrowRenderProps, type ArrowSlotProps, GALLERY_TYPE, IframeGallery, type IframeGalleryType, MDXGallery, type MDXGalleryType, SlideGallery, type SlideGallerySlide, type SlideGallerySlideType, type SlideGalleryType, type WithVisibility };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { UseMdxComponents } from '@mdx-js/mdx';
|
|
5
|
+
import { OverlayProps } from '@zipkito/shared';
|
|
6
|
+
import { Container, Typography, SxProps, Theme } from '@mui/material';
|
|
7
|
+
|
|
8
|
+
type SlideGallerySlideType = "Image" | "ImageWithText" | "PDF";
|
|
9
|
+
interface SlideGallerySlide {
|
|
10
|
+
type: SlideGallerySlideType;
|
|
11
|
+
image?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
file?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ArrowRenderProps {
|
|
18
|
+
canGoPrev: boolean;
|
|
19
|
+
canGoNext: boolean;
|
|
20
|
+
prev: () => void;
|
|
21
|
+
next: () => void;
|
|
22
|
+
}
|
|
23
|
+
interface ArrowSlotProps {
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
}
|
|
27
|
+
type ArrowRenderFn = (params: ArrowSlotProps) => ReactNode;
|
|
28
|
+
|
|
29
|
+
declare const GALLERY_TYPE: {
|
|
30
|
+
readonly Slide: "slide";
|
|
31
|
+
readonly MDX: "mdx";
|
|
32
|
+
readonly Iframe: "iframe";
|
|
33
|
+
};
|
|
34
|
+
interface WithVisibility {
|
|
35
|
+
visible: boolean;
|
|
36
|
+
originalIndex: number;
|
|
37
|
+
type: (typeof GALLERY_TYPE)[keyof typeof GALLERY_TYPE];
|
|
38
|
+
}
|
|
39
|
+
interface MDXGalleryType extends WithVisibility {
|
|
40
|
+
file?: string;
|
|
41
|
+
}
|
|
42
|
+
interface SlideGalleryType extends WithVisibility {
|
|
43
|
+
slides: SlideGallerySlide[];
|
|
44
|
+
}
|
|
45
|
+
interface IframeGalleryType extends WithVisibility {
|
|
46
|
+
path?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface MDXLoaderContext {
|
|
50
|
+
components?: UseMdxComponents;
|
|
51
|
+
loadSource: (file: string) => Promise<string>;
|
|
52
|
+
}
|
|
53
|
+
interface MDXGallerySlots {
|
|
54
|
+
root?: ElementType;
|
|
55
|
+
container?: ElementType;
|
|
56
|
+
loadingMessage?: ElementType;
|
|
57
|
+
errorMessage?: ElementType;
|
|
58
|
+
}
|
|
59
|
+
interface MDXGallerySlotProps {
|
|
60
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
61
|
+
container?: ComponentPropsWithoutRef<typeof Container>;
|
|
62
|
+
loadingMessage?: ComponentPropsWithoutRef<typeof Typography>;
|
|
63
|
+
errorMessage?: ComponentPropsWithoutRef<typeof Typography>;
|
|
64
|
+
}
|
|
65
|
+
interface MDXGalleryProps {
|
|
66
|
+
gallery: MDXGalleryType;
|
|
67
|
+
mdxContext: MDXLoaderContext;
|
|
68
|
+
actions?: ReactNode;
|
|
69
|
+
slots?: MDXGallerySlots;
|
|
70
|
+
slotProps?: MDXGallerySlotProps;
|
|
71
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
72
|
+
sx?: SxProps<Theme>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare const MDXGallery: react.MemoExoticComponent<(props: MDXGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
76
|
+
|
|
77
|
+
interface ImageSliderControlsSlots {
|
|
78
|
+
root?: ElementType;
|
|
79
|
+
dotsWrapper?: ElementType;
|
|
80
|
+
dot?: ElementType;
|
|
81
|
+
leftArrow?: ElementType<ArrowSlotProps>;
|
|
82
|
+
rightArrow?: ElementType<ArrowSlotProps>;
|
|
83
|
+
}
|
|
84
|
+
interface ImageSliderControlsSlotProps {
|
|
85
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
86
|
+
dotsWrapper?: ComponentPropsWithoutRef<"div">;
|
|
87
|
+
dot?: ComponentPropsWithoutRef<"div">;
|
|
88
|
+
leftArrow?: Partial<ArrowSlotProps>;
|
|
89
|
+
rightArrow?: Partial<ArrowSlotProps>;
|
|
90
|
+
}
|
|
91
|
+
interface ImageSliderControlsProps {
|
|
92
|
+
showDots: boolean;
|
|
93
|
+
showArrows: boolean;
|
|
94
|
+
currentSlide: number;
|
|
95
|
+
memoizedSlides: (SlideGallerySlide & {
|
|
96
|
+
alt: string;
|
|
97
|
+
})[];
|
|
98
|
+
canGoPrev: boolean;
|
|
99
|
+
canGoNext: boolean;
|
|
100
|
+
prev: () => void;
|
|
101
|
+
next: () => void;
|
|
102
|
+
goToSlide: (index: number) => void;
|
|
103
|
+
slots?: ImageSliderControlsSlots;
|
|
104
|
+
slotProps?: ImageSliderControlsSlotProps;
|
|
105
|
+
sx?: SxProps<Theme>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface ImageSliderSlots {
|
|
109
|
+
root?: ElementType;
|
|
110
|
+
sliderWrapper?: ElementType;
|
|
111
|
+
slidesWrapper?: ElementType;
|
|
112
|
+
slideItem?: ElementType;
|
|
113
|
+
slideContent?: ElementType;
|
|
114
|
+
imageWrapper?: ElementType;
|
|
115
|
+
slideImage?: ElementType;
|
|
116
|
+
textWrapper?: ElementType;
|
|
117
|
+
slideTitle?: ElementType;
|
|
118
|
+
slideDescription?: ElementType;
|
|
119
|
+
slideEmbed?: ElementType;
|
|
120
|
+
slideLink?: ElementType;
|
|
121
|
+
emptyControls?: ElementType;
|
|
122
|
+
}
|
|
123
|
+
interface ImageSliderSlotProps {
|
|
124
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
125
|
+
sliderWrapper?: ComponentPropsWithoutRef<"div">;
|
|
126
|
+
slidesWrapper?: ComponentPropsWithoutRef<"div">;
|
|
127
|
+
slideItem?: ComponentPropsWithoutRef<"div">;
|
|
128
|
+
slideContent?: ComponentPropsWithoutRef<"div">;
|
|
129
|
+
imageWrapper?: ComponentPropsWithoutRef<"div">;
|
|
130
|
+
slideImage?: ComponentPropsWithoutRef<"img">;
|
|
131
|
+
textWrapper?: ComponentPropsWithoutRef<"div">;
|
|
132
|
+
slideTitle?: ComponentPropsWithoutRef<"h3">;
|
|
133
|
+
slideDescription?: ComponentPropsWithoutRef<"p">;
|
|
134
|
+
slideEmbed?: ComponentPropsWithoutRef<"embed">;
|
|
135
|
+
slideLink?: ComponentPropsWithoutRef<"a">;
|
|
136
|
+
emptyControls?: ComponentPropsWithoutRef<"div">;
|
|
137
|
+
}
|
|
138
|
+
interface ImageSliderProps {
|
|
139
|
+
loop?: boolean;
|
|
140
|
+
showDots?: boolean;
|
|
141
|
+
showArrows?: boolean;
|
|
142
|
+
slides: (SlideGallerySlide & {
|
|
143
|
+
alt: string;
|
|
144
|
+
})[];
|
|
145
|
+
className?: string;
|
|
146
|
+
transitionDuration?: number;
|
|
147
|
+
onSlideChange?: (index: number) => void;
|
|
148
|
+
slots?: ImageSliderSlots;
|
|
149
|
+
slotProps?: ImageSliderSlotProps;
|
|
150
|
+
controlsProps?: Omit<ImageSliderControlsProps, "showDots" | "showArrows" | "currentSlide" | "memoizedSlides" | "canGoPrev" | "canGoNext" | "prev" | "next" | "goToSlide">;
|
|
151
|
+
sx?: SxProps<Theme>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface SlideGallerySlots {
|
|
155
|
+
root?: ElementType;
|
|
156
|
+
}
|
|
157
|
+
interface SlideGallerySlotProps {
|
|
158
|
+
root?: ComponentPropsWithoutRef<"div">;
|
|
159
|
+
}
|
|
160
|
+
interface SlideGalleryProps {
|
|
161
|
+
gallery: SlideGalleryType;
|
|
162
|
+
slots?: SlideGallerySlots;
|
|
163
|
+
slotProps?: SlideGallerySlotProps;
|
|
164
|
+
imageSliderProps?: Omit<ImageSliderProps, "controlsProps">;
|
|
165
|
+
controlsProps?: Omit<ImageSliderControlsProps, "showDots" | "showArrows" | "currentSlide" | "memoizedSlides" | "canGoPrev" | "canGoNext" | "prev" | "next" | "goToSlide">;
|
|
166
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
167
|
+
sx?: SxProps<Theme>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare const SlideGallery: react.MemoExoticComponent<(props: SlideGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
171
|
+
|
|
172
|
+
interface IframeGallerySlots {
|
|
173
|
+
frame?: ElementType;
|
|
174
|
+
}
|
|
175
|
+
interface IframeGallerySlotProps {
|
|
176
|
+
frame?: ComponentPropsWithoutRef<"iframe">;
|
|
177
|
+
}
|
|
178
|
+
interface IframeGalleryProps {
|
|
179
|
+
gallery: IframeGalleryType;
|
|
180
|
+
actions?: ReactNode;
|
|
181
|
+
slots?: IframeGallerySlots;
|
|
182
|
+
slotProps?: IframeGallerySlotProps;
|
|
183
|
+
overlayProps?: Omit<OverlayProps, "visible">;
|
|
184
|
+
sx?: SxProps<Theme>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
declare const IframeGallery: react.MemoExoticComponent<(props: IframeGalleryProps) => react_jsx_runtime.JSX.Element | null>;
|
|
188
|
+
|
|
189
|
+
export { type ArrowRenderFn, type ArrowRenderProps, type ArrowSlotProps, GALLERY_TYPE, IframeGallery, type IframeGalleryType, MDXGallery, type MDXGalleryType, SlideGallery, type SlideGallerySlide, type SlideGallerySlideType, type SlideGalleryType, type WithVisibility };
|