@page-speed/lightbox 0.0.2 → 0.1.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.
package/README.md CHANGED
@@ -2,7 +2,23 @@
2
2
 
3
3
  # @page-speed/lightbox
4
4
 
5
- High‑performance, media‑rich lightbox for React, designed for the DashTrack / OpenSite ecosystem and the Semantic Site Builder engine.
5
+ High‑performance, media‑rich lightbox for React, professionally designed by the UI/UX team at [OpenSite](https://opensite.ai/) for their Semantic UI engine.
6
+
7
+
8
+ ## Page Speed Lightbox Showcase
9
+
10
+ > Below you can see the wide range of layouts that are available automatically, enabling a modern UI experience for users. And since the component was specifically engineered for our Semantic UI engine, in addition to the default layout and style variants, the Lightbox components are also completely customizable.
11
+
12
+ <p>
13
+ <br />
14
+ <div align="center">
15
+ <img src="https://github.com/user-attachments/assets/fe5c9392-5b8b-4e68-afe3-7dfccc5e657e" alt="ShadCN and Tailwind Lightbox Library" width="100%">
16
+ </div>
17
+ <br />
18
+ </p>
19
+ <br />
20
+ <p></p>
21
+
6
22
 
7
23
  ## Overview
8
24
 
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface CustomSlideLayoutProps {
3
+ content: React.ReactNode;
4
+ chrome: React.ReactNode;
5
+ height?: string | number;
6
+ maxWidth?: string | number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ }
10
+ /**
11
+ * Custom slide layout: optimized for component-type items where you want
12
+ * full creative control over the slide content. Chrome is overlaid or minimal.
13
+ */
14
+ export declare function CustomSlideLayout({ content, chrome, height, maxWidth, className, style, }: CustomSlideLayoutProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface FullscreenLayoutProps {
3
+ content: React.ReactNode;
4
+ chrome: React.ReactNode;
5
+ height?: string | number;
6
+ maxWidth?: string | number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ }
10
+ /**
11
+ * Fullscreen layout: takes up the entire viewport with minimal chrome.
12
+ * Ideal for mobile devices and immersive viewing experiences.
13
+ */
14
+ export declare function FullscreenLayout({ content, chrome, className, style, }: FullscreenLayoutProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface InlineLayoutProps {
3
+ content: React.ReactNode;
4
+ chrome: React.ReactNode;
5
+ height?: string | number;
6
+ maxWidth?: string | number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ }
10
+ /**
11
+ * Inline layout: renders the lightbox content inline on the page without
12
+ * the modal overlay. Useful for embedding galleries directly in page flow.
13
+ */
14
+ export declare function InlineLayout({ content, chrome, height, maxWidth, className, style, }: InlineLayoutProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ interface VerticalSplitLayoutProps {
3
+ content: React.ReactNode;
4
+ chrome: React.ReactNode;
5
+ height?: string | number;
6
+ maxWidth?: string | number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ }
10
+ /**
11
+ * Vertical split layout: content on the left, chrome/controls on the right.
12
+ * Ideal for tablet and medium-sized viewports where you want side-by-side
13
+ * media and metadata/controls.
14
+ */
15
+ export declare function VerticalSplitLayout({ content, chrome, height, maxWidth, className, style, }: VerticalSplitLayoutProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -97,3 +97,164 @@
97
97
  height: 100%;
98
98
  color: var(--lightbox-text-muted, rgba(255, 255, 255, 0.7));
99
99
  }
100
+ .Lightbox_verticalSplitLayoutRoot3 {
101
+ position: relative;
102
+ max-width: var(--lightbox-max-width, 90vw);
103
+ width: 100%;
104
+ padding: var(--lightbox-padding, 24px);
105
+ box-sizing: border-box;
106
+ }
107
+ .Lightbox_verticalSplitLayoutContainer3 {
108
+ position: relative;
109
+ background: var(--lightbox-modal-bg, #111);
110
+ color: var(--lightbox-text, #fff);
111
+ border-radius: var(--lightbox-radius, 12px);
112
+ overflow: hidden;
113
+ display: flex;
114
+ flex-direction: row;
115
+ min-height: 70vh;
116
+ }
117
+ .Lightbox_verticalSplitContent3 {
118
+ flex: 2;
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ background: var(--lightbox-content-bg, #000);
123
+ overflow: auto;
124
+ }
125
+ .Lightbox_verticalSplitSidebar3 {
126
+ flex: 1;
127
+ min-width: 300px;
128
+ max-width: 400px;
129
+ border-left: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
130
+ display: flex;
131
+ flex-direction: column;
132
+ background: var(--lightbox-sidebar-bg, rgba(0, 0, 0, 0.3));
133
+ }
134
+ @media (max-width: 1024px) {
135
+ .Lightbox_verticalSplitLayoutContainer3 {
136
+ flex-direction: column;
137
+ }
138
+ .Lightbox_verticalSplitSidebar3 {
139
+ min-width: auto;
140
+ max-width: none;
141
+ border-left: none;
142
+ border-top: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
143
+ }
144
+ }
145
+ .Lightbox_customSlideLayoutRoot3 {
146
+ position: relative;
147
+ max-width: var(--lightbox-max-width, 95vw);
148
+ width: 100%;
149
+ padding: var(--lightbox-padding, 16px);
150
+ box-sizing: border-box;
151
+ }
152
+ .Lightbox_customSlideLayoutContainer3 {
153
+ position: relative;
154
+ background: var(--lightbox-modal-bg, #111);
155
+ color: var(--lightbox-text, #fff);
156
+ border-radius: var(--lightbox-radius, 12px);
157
+ overflow: hidden;
158
+ min-height: 80vh;
159
+ display: flex;
160
+ flex-direction: column;
161
+ }
162
+ .Lightbox_customSlideContent3 {
163
+ flex: 1;
164
+ position: relative;
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+ background: var(--lightbox-content-bg, #000);
169
+ overflow: auto;
170
+ }
171
+ .Lightbox_customSlideChrome3 {
172
+ position: absolute;
173
+ bottom: 0;
174
+ left: 0;
175
+ right: 0;
176
+ background:
177
+ linear-gradient(
178
+ to top,
179
+ rgba(0, 0, 0, 0.8) 0%,
180
+ transparent 100%);
181
+ padding: 24px 16px 16px;
182
+ z-index: 10;
183
+ }
184
+ .Lightbox_fullscreenLayoutRoot3 {
185
+ position: fixed;
186
+ inset: 0;
187
+ z-index: 1000;
188
+ background: var(--lightbox-fullscreen-bg, #000);
189
+ }
190
+ .Lightbox_fullscreenLayoutContainer3 {
191
+ width: 100%;
192
+ height: 100%;
193
+ display: flex;
194
+ flex-direction: column;
195
+ color: var(--lightbox-text, #fff);
196
+ }
197
+ .Lightbox_fullscreenContent3 {
198
+ flex: 1;
199
+ display: flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ background: var(--lightbox-content-bg, #000);
203
+ overflow: auto;
204
+ }
205
+ .Lightbox_fullscreenChrome3 {
206
+ position: absolute;
207
+ top: 0;
208
+ left: 0;
209
+ right: 0;
210
+ background:
211
+ linear-gradient(
212
+ to bottom,
213
+ rgba(0, 0, 0, 0.8) 0%,
214
+ transparent 100%);
215
+ padding: 16px 24px 48px;
216
+ z-index: 10;
217
+ }
218
+ .Lightbox_inlineLayoutRoot3 {
219
+ position: relative;
220
+ max-width: var(--lightbox-max-width, 100%);
221
+ width: 100%;
222
+ margin: 0 auto;
223
+ }
224
+ .Lightbox_inlineLayoutContainer3 {
225
+ position: relative;
226
+ background: var(--lightbox-modal-bg, #111);
227
+ color: var(--lightbox-text, #fff);
228
+ border-radius: var(--lightbox-radius, 12px);
229
+ overflow: hidden;
230
+ display: flex;
231
+ flex-direction: column;
232
+ }
233
+ .Lightbox_inlineContent3 {
234
+ flex: 1;
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ background: var(--lightbox-content-bg, #000);
239
+ min-height: 400px;
240
+ }
241
+ .Lightbox_inlineToolbar3 {
242
+ border-top: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
243
+ }
244
+ @media (max-width: 768px) {
245
+ .Lightbox_verticalSplitLayoutRoot3,
246
+ .Lightbox_customSlideLayoutRoot3 {
247
+ padding: 0;
248
+ max-width: 100vw;
249
+ max-height: 100vh;
250
+ }
251
+ .Lightbox_verticalSplitLayoutContainer3,
252
+ .Lightbox_customSlideLayoutContainer3 {
253
+ border-radius: 0;
254
+ min-height: 100vh;
255
+ }
256
+ .Lightbox_customSlideChrome3,
257
+ .Lightbox_fullscreenChrome3 {
258
+ padding: 12px;
259
+ }
260
+ }
@@ -3,3 +3,7 @@ export { LightboxOverlay } from "./LightboxOverlay";
3
3
  export { LightboxContent } from "./LightboxContent";
4
4
  export { LightboxChrome } from "./LightboxChrome";
5
5
  export { HorizontalLayout } from "./Layouts/HorizontalLayout";
6
+ export { VerticalSplitLayout } from "./Layouts/VerticalSplitLayout";
7
+ export { CustomSlideLayout } from "./Layouts/CustomSlideLayout";
8
+ export { FullscreenLayout } from "./Layouts/FullscreenLayout";
9
+ export { InlineLayout } from "./Layouts/InlineLayout";
@@ -2806,11 +2806,11 @@ var require_react_jsx_runtime_development = __commonJS({
2806
2806
  return jsxWithValidation(type, props, key, false);
2807
2807
  }
2808
2808
  }
2809
- var jsx11 = jsxWithValidationDynamic;
2810
- var jsxs7 = jsxWithValidationStatic;
2809
+ var jsx15 = jsxWithValidationDynamic;
2810
+ var jsxs11 = jsxWithValidationStatic;
2811
2811
  exports2.Fragment = REACT_FRAGMENT_TYPE;
2812
- exports2.jsx = jsx11;
2813
- exports2.jsxs = jsxs7;
2812
+ exports2.jsx = jsx15;
2813
+ exports2.jsxs = jsxs11;
2814
2814
  })();
2815
2815
  }
2816
2816
  }
@@ -21605,7 +21605,23 @@ var Lightbox_default = {
21605
21605
  captionTitle: "Lightbox_captionTitle3",
21606
21606
  captionText: "Lightbox_captionText3",
21607
21607
  pdfContainer: "Lightbox_pdfContainer3",
21608
- pdfFallback: "Lightbox_pdfFallback3"
21608
+ pdfFallback: "Lightbox_pdfFallback3",
21609
+ verticalSplitLayoutRoot: "Lightbox_verticalSplitLayoutRoot3",
21610
+ verticalSplitLayoutContainer: "Lightbox_verticalSplitLayoutContainer3",
21611
+ verticalSplitContent: "Lightbox_verticalSplitContent3",
21612
+ verticalSplitSidebar: "Lightbox_verticalSplitSidebar3",
21613
+ customSlideLayoutRoot: "Lightbox_customSlideLayoutRoot3",
21614
+ customSlideLayoutContainer: "Lightbox_customSlideLayoutContainer3",
21615
+ customSlideContent: "Lightbox_customSlideContent3",
21616
+ customSlideChrome: "Lightbox_customSlideChrome3",
21617
+ fullscreenLayoutRoot: "Lightbox_fullscreenLayoutRoot3",
21618
+ fullscreenLayoutContainer: "Lightbox_fullscreenLayoutContainer3",
21619
+ fullscreenContent: "Lightbox_fullscreenContent3",
21620
+ fullscreenChrome: "Lightbox_fullscreenChrome3",
21621
+ inlineLayoutRoot: "Lightbox_inlineLayoutRoot3",
21622
+ inlineLayoutContainer: "Lightbox_inlineLayoutContainer3",
21623
+ inlineContent: "Lightbox_inlineContent3",
21624
+ inlineToolbar: "Lightbox_inlineToolbar3"
21609
21625
  };
21610
21626
 
21611
21627
  // src/components/LightboxOverlay.tsx
@@ -22478,8 +22494,121 @@ function HorizontalLayout({
22478
22494
  ) });
22479
22495
  }
22480
22496
 
22481
- // src/components/Lightbox.tsx
22497
+ // src/components/Layouts/VerticalSplitLayout.tsx
22482
22498
  var import_jsx_runtime14 = __toESM(require_jsx_runtime());
22499
+ function VerticalSplitLayout({
22500
+ content,
22501
+ chrome,
22502
+ height,
22503
+ maxWidth,
22504
+ className,
22505
+ style
22506
+ }) {
22507
+ const containerStyle = {
22508
+ maxWidth,
22509
+ height,
22510
+ ...style
22511
+ };
22512
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
22513
+ "div",
22514
+ {
22515
+ className: [
22516
+ Lightbox_default.verticalSplitLayoutContainer,
22517
+ className || ""
22518
+ ].join(" ").trim(),
22519
+ children: [
22520
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitContent, children: content }),
22521
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitSidebar, children: chrome })
22522
+ ]
22523
+ }
22524
+ ) });
22525
+ }
22526
+
22527
+ // src/components/Layouts/CustomSlideLayout.tsx
22528
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime());
22529
+ function CustomSlideLayout({
22530
+ content,
22531
+ chrome,
22532
+ height,
22533
+ maxWidth,
22534
+ className,
22535
+ style
22536
+ }) {
22537
+ const containerStyle = {
22538
+ maxWidth,
22539
+ height,
22540
+ ...style
22541
+ };
22542
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
22543
+ "div",
22544
+ {
22545
+ className: [
22546
+ Lightbox_default.customSlideLayoutContainer,
22547
+ className || ""
22548
+ ].join(" ").trim(),
22549
+ children: [
22550
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideContent, children: content }),
22551
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideChrome, children: chrome })
22552
+ ]
22553
+ }
22554
+ ) });
22555
+ }
22556
+
22557
+ // src/components/Layouts/FullscreenLayout.tsx
22558
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime());
22559
+ function FullscreenLayout({
22560
+ content,
22561
+ chrome,
22562
+ className,
22563
+ style
22564
+ }) {
22565
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenLayoutRoot, style, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
22566
+ "div",
22567
+ {
22568
+ className: [
22569
+ Lightbox_default.fullscreenLayoutContainer,
22570
+ className || ""
22571
+ ].join(" ").trim(),
22572
+ children: [
22573
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenContent, children: content }),
22574
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenChrome, children: chrome })
22575
+ ]
22576
+ }
22577
+ ) });
22578
+ }
22579
+
22580
+ // src/components/Layouts/InlineLayout.tsx
22581
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime());
22582
+ function InlineLayout({
22583
+ content,
22584
+ chrome,
22585
+ height,
22586
+ maxWidth,
22587
+ className,
22588
+ style
22589
+ }) {
22590
+ const containerStyle = {
22591
+ maxWidth,
22592
+ height,
22593
+ ...style
22594
+ };
22595
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
22596
+ "div",
22597
+ {
22598
+ className: [
22599
+ Lightbox_default.inlineLayoutContainer,
22600
+ className || ""
22601
+ ].join(" ").trim(),
22602
+ children: [
22603
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineContent, children: content }),
22604
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineToolbar, children: chrome })
22605
+ ]
22606
+ }
22607
+ ) });
22608
+ }
22609
+
22610
+ // src/components/Lightbox.tsx
22611
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime());
22483
22612
  function Lightbox(props) {
22484
22613
  const { items, initialIndex = 0 } = props;
22485
22614
  const gallery = useGalleryState({
@@ -22556,53 +22685,76 @@ function Lightbox(props) {
22556
22685
  captions: true,
22557
22686
  ...props.controls
22558
22687
  };
22559
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: Lightbox_default.lightboxPortal, role: "dialog", "aria-modal": "true", children: [
22560
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22688
+ const contentNode = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22689
+ LightboxContent,
22690
+ {
22691
+ item: currentItem,
22692
+ layout,
22693
+ optixFlowConfig: props.optixFlowConfig
22694
+ }
22695
+ );
22696
+ const chromeNode = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22697
+ LightboxChrome,
22698
+ {
22699
+ currentIndex: gallery.currentIndex,
22700
+ totalItems: items.length,
22701
+ currentItem,
22702
+ canNext: gallery.canNext,
22703
+ canPrev: gallery.canPrev,
22704
+ controls: effectiveControls,
22705
+ onNext: handleNext,
22706
+ onPrev: handlePrev,
22707
+ onClose: handleClose
22708
+ }
22709
+ );
22710
+ const layoutProps = {
22711
+ content: contentNode,
22712
+ chrome: chromeNode,
22713
+ height: props.height,
22714
+ maxWidth: props.maxWidth,
22715
+ className: props.className,
22716
+ style: props.style
22717
+ };
22718
+ if (layout === "inline") {
22719
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InlineLayout, { ...layoutProps });
22720
+ }
22721
+ let layoutComponent;
22722
+ switch (layout) {
22723
+ case "vertical-split":
22724
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VerticalSplitLayout, { ...layoutProps });
22725
+ break;
22726
+ case "custom-slide":
22727
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CustomSlideLayout, { ...layoutProps });
22728
+ break;
22729
+ case "fullscreen":
22730
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FullscreenLayout, { ...layoutProps });
22731
+ break;
22732
+ case "horizontal":
22733
+ default:
22734
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HorizontalLayout, { ...layoutProps });
22735
+ break;
22736
+ }
22737
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: Lightbox_default.lightboxPortal, role: "dialog", "aria-modal": "true", children: [
22738
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22561
22739
  LightboxOverlay,
22562
22740
  {
22563
22741
  onClose: handleClose,
22564
22742
  closeOnBackdropClick: props.closeOnBackdropClick ?? true
22565
22743
  }
22566
22744
  ),
22567
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22568
- HorizontalLayout,
22569
- {
22570
- content: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22571
- LightboxContent,
22572
- {
22573
- item: currentItem,
22574
- layout,
22575
- optixFlowConfig: props.optixFlowConfig
22576
- }
22577
- ),
22578
- chrome: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22579
- LightboxChrome,
22580
- {
22581
- currentIndex: gallery.currentIndex,
22582
- totalItems: items.length,
22583
- currentItem,
22584
- canNext: gallery.canNext,
22585
- canPrev: gallery.canPrev,
22586
- controls: effectiveControls,
22587
- onNext: handleNext,
22588
- onPrev: handlePrev,
22589
- onClose: handleClose
22590
- }
22591
- ),
22592
- height: props.height,
22593
- maxWidth: props.maxWidth,
22594
- className: props.className,
22595
- style: props.style
22596
- }
22597
- )
22745
+ layoutComponent
22598
22746
  ] });
22599
22747
  }
22600
22748
  export {
22749
+ CustomSlideLayout,
22750
+ FullscreenLayout,
22601
22751
  HorizontalLayout,
22752
+ InlineLayout,
22602
22753
  Lightbox,
22603
22754
  LightboxChrome,
22604
22755
  LightboxContent,
22605
- LightboxOverlay
22756
+ LightboxOverlay,
22757
+ VerticalSplitLayout
22606
22758
  };
22607
22759
  /*! Bundled license information:
22608
22760