@page-speed/lightbox 0.0.1
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/README.md +244 -0
- package/dist/__mocks__/styleMock.d.ts +4 -0
- package/dist/components/Layouts/HorizontalLayout.d.ts +16 -0
- package/dist/components/Lightbox.d.ts +10 -0
- package/dist/components/LightboxChrome.d.ts +21 -0
- package/dist/components/LightboxContent.d.ts +13 -0
- package/dist/components/LightboxOverlay.d.ts +12 -0
- package/dist/components/index.css +99 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +21964 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2033 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +2079 -0
- package/dist/hooks/useGalleryState.d.ts +14 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +1 -0
- package/dist/hooks/useLightbox.d.ts +20 -0
- package/dist/hooks/useLightboxState.d.ts +9 -0
- package/dist/hooks/useResponsiveness.d.ts +7 -0
- package/dist/index.cjs +22043 -0
- package/dist/index.css +99 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22043 -0
- package/dist/renderers/ComponentRenderer.d.ts +9 -0
- package/dist/renderers/ImageRenderer.d.ts +14 -0
- package/dist/renderers/PDFRenderer.d.ts +11 -0
- package/dist/renderers/VideoRenderer.d.ts +13 -0
- package/dist/renderers/index.css +99 -0
- package/dist/renderers/index.d.ts +4 -0
- package/dist/renderers/index.js +21620 -0
- package/dist/types.d.ts +62 -0
- package/package.json +84 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LightboxItem } from "../types";
|
|
2
|
+
interface ComponentRendererProps {
|
|
3
|
+
item: LightboxItem;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Renders a custom React component provided on the LightboxItem.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ComponentRenderer({ item }: ComponentRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LightboxItem, LightboxLayoutType } from "../types";
|
|
2
|
+
interface ImageRendererProps {
|
|
3
|
+
item: LightboxItem;
|
|
4
|
+
layout: LightboxLayoutType;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Basic image renderer.
|
|
8
|
+
*
|
|
9
|
+
* This intentionally uses a plain <img> tag so consuming apps can decide
|
|
10
|
+
* whether to wrap or replace it with @opensite/img when used inside the
|
|
11
|
+
* Semantic Site Builder.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ImageRenderer({ item }: ImageRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LightboxItem, LightboxLayoutType } from "../types";
|
|
2
|
+
interface PDFRendererProps {
|
|
3
|
+
item: LightboxItem;
|
|
4
|
+
layout: LightboxLayoutType;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Thin wrapper around @page-speed/pdf-viewer, loaded lazily so that the
|
|
8
|
+
* heavy PDF runtime is only fetched when a PDF item is actually viewed.
|
|
9
|
+
*/
|
|
10
|
+
export declare function PDFRenderer({ item }: PDFRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LightboxItem, LightboxLayoutType } from "../types";
|
|
2
|
+
interface VideoRendererProps {
|
|
3
|
+
item: LightboxItem;
|
|
4
|
+
layout: LightboxLayoutType;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Basic HTML5 video renderer.
|
|
8
|
+
*
|
|
9
|
+
* For production Semantic Site Builder usage, this can be swapped for
|
|
10
|
+
* @opensite/video via composition without changing the Lightbox API.
|
|
11
|
+
*/
|
|
12
|
+
export declare function VideoRenderer({ item }: VideoRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* src/styles/Lightbox.module.css */
|
|
2
|
+
.Lightbox_lightboxPortal2 {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
.Lightbox_overlay2 {
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
background: var(--lightbox-overlay, rgba(0, 0, 0, 0.85));
|
|
14
|
+
}
|
|
15
|
+
.Lightbox_horizontalLayoutRoot2 {
|
|
16
|
+
position: relative;
|
|
17
|
+
max-width: var(--lightbox-max-width, 90vw);
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: var(--lightbox-padding, 24px);
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
.Lightbox_horizontalLayoutContainer2 {
|
|
23
|
+
position: relative;
|
|
24
|
+
background: var(--lightbox-modal-bg, #111);
|
|
25
|
+
color: var(--lightbox-text, #fff);
|
|
26
|
+
border-radius: var(--lightbox-radius, 12px);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}
|
|
31
|
+
.Lightbox_mainContent2 {
|
|
32
|
+
flex: 1;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
background: var(--lightbox-content-bg, #000);
|
|
37
|
+
}
|
|
38
|
+
.Lightbox_toolbar2 {
|
|
39
|
+
border-top: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
|
|
40
|
+
}
|
|
41
|
+
.Lightbox_media2 {
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
max-height: 80vh;
|
|
44
|
+
object-fit: contain;
|
|
45
|
+
}
|
|
46
|
+
.Lightbox_chrome2 {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
padding: 8px 12px;
|
|
51
|
+
background: var(--lightbox-toolbar, rgba(0, 0, 0, 0.5));
|
|
52
|
+
}
|
|
53
|
+
.Lightbox_chromeSection2 {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
}
|
|
58
|
+
.Lightbox_navButton2,
|
|
59
|
+
.Lightbox_closeButton2 {
|
|
60
|
+
border: none;
|
|
61
|
+
border-radius: 999px;
|
|
62
|
+
padding: 6px 10px;
|
|
63
|
+
background: rgba(255, 255, 255, 0.08);
|
|
64
|
+
color: inherit;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
.Lightbox_navButton2:disabled {
|
|
68
|
+
opacity: 0.4;
|
|
69
|
+
cursor: default;
|
|
70
|
+
}
|
|
71
|
+
.Lightbox_counter2 {
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
opacity: 0.85;
|
|
74
|
+
}
|
|
75
|
+
.Lightbox_captionContainer2 {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
}
|
|
79
|
+
.Lightbox_captionTitle2 {
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
.Lightbox_captionText2 {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
opacity: 0.85;
|
|
86
|
+
}
|
|
87
|
+
.Lightbox_pdfContainer2 {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 80vh;
|
|
90
|
+
background: #111;
|
|
91
|
+
}
|
|
92
|
+
.Lightbox_pdfFallback2 {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
color: var(--lightbox-text-muted, rgba(255, 255, 255, 0.7));
|
|
99
|
+
}
|