@solostylist/ui-kit 1.0.138 → 1.0.139
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/main.d.ts +2 -2
- package/dist/main.js +8 -8
- package/dist/s-gallery/index.d.ts +2 -0
- package/dist/s-gallery/index.js +5 -0
- package/dist/{s-interactive-gallery/s-interactive-gallery.d.ts → s-gallery/s-gallery.d.ts} +8 -8
- package/dist/{s-interactive-gallery/s-interactive-gallery.js → s-gallery/s-gallery.js} +29 -29
- package/package.json +1 -1
- package/dist/s-interactive-gallery/index.d.ts +0 -2
- package/dist/s-interactive-gallery/index.js +0 -5
- /package/dist/{s-interactive-gallery → s-gallery}/package.json +0 -0
package/dist/main.d.ts
CHANGED
|
@@ -98,8 +98,8 @@ export { default as SSpotlightCursor } from './s-spotlight-cursor/index';
|
|
|
98
98
|
export type { SSpotlightCursorProps, SpotlightConfig } from './s-spotlight-cursor/index';
|
|
99
99
|
export { default as SCopyableText } from './s-copyable-text/index';
|
|
100
100
|
export type { SCopyableTextProps } from './s-copyable-text/index';
|
|
101
|
-
export { default as
|
|
102
|
-
export type {
|
|
101
|
+
export { default as SGallery, MediaItem } from './s-gallery/index';
|
|
102
|
+
export type { SGalleryProps, MediaItemProps, GalleryLayoutVariant } from './s-gallery/index';
|
|
103
103
|
export { default as SImageModal } from './s-image-modal/index';
|
|
104
104
|
export type { MediaItemType } from './s-image-modal/index';
|
|
105
105
|
export type { SImageModalProps } from './s-image-modal/index';
|
package/dist/main.js
CHANGED
|
@@ -11,7 +11,7 @@ import { default as b } from "./s-comment-message/s-comment-message.js";
|
|
|
11
11
|
import { default as M } from "./s-text-editor/s-text-editor.js";
|
|
12
12
|
import "./s-text-editor/s-text-editor-toolbar.js";
|
|
13
13
|
import { default as y } from "./s-checkbox/s-checkbox.js";
|
|
14
|
-
import { default as
|
|
14
|
+
import { default as I } from "./s-chip/s-chip.js";
|
|
15
15
|
import { default as F } from "./s-chips/s-chips.js";
|
|
16
16
|
import { default as B } from "./s-data-table/s-data-table.js";
|
|
17
17
|
import { DialogConfirmProvider as z, default as E, useDialogConfirm as R } from "./s-dialog-confirm/s-dialog-confirm.js";
|
|
@@ -35,7 +35,7 @@ import { default as Te } from "./s-skeleton/s-skeleton.js";
|
|
|
35
35
|
import { default as ve } from "./s-tip/s-tip.js";
|
|
36
36
|
import { default as be } from "./s-text-truncation/s-text-truncation.js";
|
|
37
37
|
import { default as Me, SnackbarMessageProvider as he, useSnackbarMessage as ye } from "./s-snackbar-message/s-snackbar-message.js";
|
|
38
|
-
import { default as
|
|
38
|
+
import { default as Ie } from "./s-form/s-form.js";
|
|
39
39
|
import { SSmartTextField as Fe } from "./s-smart-text-field/s-smart-text-field.js";
|
|
40
40
|
import { SCopilotKitProvider as Be } from "./s-copilot-kit-provider/s-copilot-kit-provider.js";
|
|
41
41
|
import { SStripeCVC as ze, SStripeExpiry as Ee, SStripeNumber as Re, StripeTextField as Ge } from "./s-stripe/s-stripe.js";
|
|
@@ -50,7 +50,7 @@ import { default as $e } from "./s-moving-border/s-moving-border.js";
|
|
|
50
50
|
import { default as oo } from "./s-scroll-reveal/s-scroll-reveal.js";
|
|
51
51
|
import { default as ao } from "./s-spotlight-cursor/s-spotlight-cursor.js";
|
|
52
52
|
import { default as fo } from "./s-copyable-text/s-copyable-text.js";
|
|
53
|
-
import { MediaItem as mo, default as so } from "./s-
|
|
53
|
+
import { MediaItem as mo, default as so } from "./s-gallery/s-gallery.js";
|
|
54
54
|
import { default as So } from "./s-image-modal/s-image-modal.js";
|
|
55
55
|
import { default as xo } from "./s-lazy-image/s-lazy-image.js";
|
|
56
56
|
import { default as no } from "./s-image-comparison/s-image-comparison.js";
|
|
@@ -59,7 +59,7 @@ import { default as Co } from "./s-category-card/s-category-card.js";
|
|
|
59
59
|
import { default as Po } from "./s-radial-pulse-animate/s-radial-pulse-animate.js";
|
|
60
60
|
import { default as Do } from "./s-rating/s-rating.js";
|
|
61
61
|
import { default as ho } from "./s-review/s-review.js";
|
|
62
|
-
import { default as
|
|
62
|
+
import { default as Lo } from "./s-tabs/s-tabs.js";
|
|
63
63
|
import { default as ko } from "./s-tabs/s-tab.js";
|
|
64
64
|
import { default as Ao } from "./s-tabs/s-tab-panel.js";
|
|
65
65
|
import { default as wo } from "./s-text-shimmer/s-text-shimmer.js";
|
|
@@ -90,7 +90,7 @@ export {
|
|
|
90
90
|
T as SChatInput,
|
|
91
91
|
v as SChatMessage,
|
|
92
92
|
y as SCheckbox,
|
|
93
|
-
|
|
93
|
+
I as SChip,
|
|
94
94
|
F as SChips,
|
|
95
95
|
b as SCommentMessage,
|
|
96
96
|
Be as SCopilotKitProvider,
|
|
@@ -106,14 +106,14 @@ export {
|
|
|
106
106
|
Y as SFileDropzone,
|
|
107
107
|
_ as SFileIcon,
|
|
108
108
|
Q as SFlexBox,
|
|
109
|
-
|
|
109
|
+
Ie as SForm,
|
|
110
|
+
so as SGallery,
|
|
110
111
|
Ze as SGlowButton,
|
|
111
112
|
Xe as SGradientIcon,
|
|
112
113
|
ee as SI18nProvider,
|
|
113
114
|
re as SIconButton,
|
|
114
115
|
no as SImageComparison,
|
|
115
116
|
So as SImageModal,
|
|
116
|
-
so as SInteractiveGallery,
|
|
117
117
|
co as SItemNotFound,
|
|
118
118
|
te as SLabel,
|
|
119
119
|
Go as SLanguagePopover,
|
|
@@ -139,7 +139,7 @@ export {
|
|
|
139
139
|
Re as SStripeNumber,
|
|
140
140
|
ko as STab,
|
|
141
141
|
Ao as STabPanel,
|
|
142
|
-
|
|
142
|
+
Lo as STabs,
|
|
143
143
|
M as STextEditor,
|
|
144
144
|
de as STextField,
|
|
145
145
|
wo as STextShimmer,
|
|
@@ -32,24 +32,24 @@ export declare const MediaItem: React.FC<MediaItemProps>;
|
|
|
32
32
|
/**
|
|
33
33
|
* Built-in layout variants for the gallery
|
|
34
34
|
*/
|
|
35
|
-
export type GalleryLayoutVariant = 'masonry' | 'grid' | 'spotlight' | 'featured';
|
|
35
|
+
export type GalleryLayoutVariant = 'masonry' | 'grid' | 'spotlight' | 'featured' | 'custom';
|
|
36
36
|
/**
|
|
37
|
-
* Props interface for the main
|
|
37
|
+
* Props interface for the main SGallery component
|
|
38
38
|
*/
|
|
39
|
-
export interface
|
|
39
|
+
export interface SGalleryProps {
|
|
40
40
|
/** Array of media items to display in the gallery */
|
|
41
41
|
mediaItems: MediaItemType[];
|
|
42
42
|
/** Layout variant to use (default: 'masonry') */
|
|
43
43
|
variant?: GalleryLayoutVariant;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* SGallery - A sophisticated media gallery with drag-and-drop, modal viewing, and animations.
|
|
47
47
|
*
|
|
48
48
|
* This component provides a complete gallery solution with:
|
|
49
49
|
*
|
|
50
50
|
* Grid Layout Features:
|
|
51
51
|
* - Responsive grid with customizable spans per item
|
|
52
|
-
* - Built-in layout variants (masonry, grid, spotlight,
|
|
52
|
+
* - Built-in layout variants (masonry, grid, spotlight, featured, custom)
|
|
53
53
|
* - Drag-and-drop reordering of items
|
|
54
54
|
* - Hover overlays with title/description
|
|
55
55
|
* - Staggered entrance animations
|
|
@@ -75,8 +75,8 @@ export interface SInteractiveGalleryProps {
|
|
|
75
75
|
*
|
|
76
76
|
* Built with Framer Motion for smooth animations and Material-UI for theming.
|
|
77
77
|
*
|
|
78
|
-
* @param props -
|
|
78
|
+
* @param props - SGalleryProps with media items array and optional layout variant
|
|
79
79
|
* @returns JSX.Element - Complete interactive gallery system
|
|
80
80
|
*/
|
|
81
|
-
declare const
|
|
82
|
-
export default
|
|
81
|
+
declare const SGallery: React.FC<SGalleryProps>;
|
|
82
|
+
export default SGallery;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as r } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as h, useId as C, useEffect as y, useRef as S } from "react";
|
|
3
3
|
import { Box as c, Paper as k, Typography as x } from "@mui/material";
|
|
4
4
|
import { AnimatePresence as $, motion as m } from "framer-motion";
|
|
5
5
|
import R from "../s-image-modal/s-image-modal.js";
|
|
6
6
|
import D from "../s-lazy-image/s-lazy-image.js";
|
|
7
|
-
const E = ({ item:
|
|
8
|
-
const e = S(null), [i, s] =
|
|
7
|
+
const E = ({ item: n, sx: o, onClick: l }) => {
|
|
8
|
+
const e = S(null), [i, s] = h(!1), [f, u] = h(!0);
|
|
9
9
|
return y(() => {
|
|
10
10
|
const d = {
|
|
11
11
|
root: null,
|
|
@@ -13,8 +13,8 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
13
13
|
// Start loading 50px before entering viewport
|
|
14
14
|
threshold: 0.1
|
|
15
15
|
// Trigger when 10% of video is visible
|
|
16
|
-
}, t = new IntersectionObserver((
|
|
17
|
-
|
|
16
|
+
}, t = new IntersectionObserver((a) => {
|
|
17
|
+
a.forEach((p) => s(p.isIntersecting));
|
|
18
18
|
}, d);
|
|
19
19
|
return e.current && t.observe(e.current), () => {
|
|
20
20
|
e.current && t.unobserve(e.current);
|
|
@@ -24,16 +24,16 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
24
24
|
return i ? (async () => {
|
|
25
25
|
if (!(!e.current || !i || !d))
|
|
26
26
|
try {
|
|
27
|
-
e.current.readyState >= 3 ? (u(!1), await e.current.play()) : (u(!0), await new Promise((
|
|
28
|
-
e.current && (e.current.oncanplay = () =>
|
|
27
|
+
e.current.readyState >= 3 ? (u(!1), await e.current.play()) : (u(!0), await new Promise((a) => {
|
|
28
|
+
e.current && (e.current.oncanplay = () => a());
|
|
29
29
|
}), d && (u(!1), await e.current.play()));
|
|
30
|
-
} catch (
|
|
31
|
-
console.warn("Video playback failed:",
|
|
30
|
+
} catch (a) {
|
|
31
|
+
console.warn("Video playback failed:", a);
|
|
32
32
|
}
|
|
33
33
|
})() : e.current && e.current.pause(), () => {
|
|
34
34
|
d = !1, e.current && (e.current.pause(), e.current.removeAttribute("src"), e.current.load());
|
|
35
35
|
};
|
|
36
|
-
}, [i]),
|
|
36
|
+
}, [i]), n.type === "video" ? /* @__PURE__ */ r.jsxs(
|
|
37
37
|
c,
|
|
38
38
|
{
|
|
39
39
|
sx: {
|
|
@@ -58,16 +58,16 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
58
58
|
width: "100%",
|
|
59
59
|
height: "100%",
|
|
60
60
|
objectFit: "cover",
|
|
61
|
-
opacity:
|
|
61
|
+
opacity: f ? 0.8 : 1,
|
|
62
62
|
transition: "opacity 0.2s",
|
|
63
63
|
transform: "translateZ(0)",
|
|
64
64
|
willChange: "transform",
|
|
65
65
|
display: "block"
|
|
66
66
|
},
|
|
67
|
-
children: /* @__PURE__ */ r.jsx("source", { src:
|
|
67
|
+
children: /* @__PURE__ */ r.jsx("source", { src: n.url, type: "video/mp4" })
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
|
|
70
|
+
f && /* @__PURE__ */ r.jsx(
|
|
71
71
|
c,
|
|
72
72
|
{
|
|
73
73
|
sx: {
|
|
@@ -102,8 +102,8 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
102
102
|
) : /* @__PURE__ */ r.jsx(c, { onClick: l, sx: { width: "100%", height: "100%", ...o }, children: /* @__PURE__ */ r.jsx(
|
|
103
103
|
D,
|
|
104
104
|
{
|
|
105
|
-
src:
|
|
106
|
-
alt:
|
|
105
|
+
src: n.url,
|
|
106
|
+
alt: n.title || "",
|
|
107
107
|
width: "100%",
|
|
108
108
|
height: "100%",
|
|
109
109
|
style: {
|
|
@@ -115,7 +115,7 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
) });
|
|
118
|
-
}, w = (
|
|
118
|
+
}, w = (n, o) => o === "custom" ? n : n.map((l, e) => {
|
|
119
119
|
let i = 1, s = 2;
|
|
120
120
|
switch (o) {
|
|
121
121
|
case "grid":
|
|
@@ -132,11 +132,11 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
134
|
return { ...l, colSpan: i, rowSpan: s };
|
|
135
|
-
}), T = ({ mediaItems:
|
|
136
|
-
const [l, e] =
|
|
135
|
+
}), T = ({ mediaItems: n, variant: o = "masonry" }) => {
|
|
136
|
+
const [l, e] = h(null), [i, s] = h(() => w(n, o)), [f, u] = h(!1), d = C();
|
|
137
137
|
return y(() => {
|
|
138
|
-
s(w(
|
|
139
|
-
}, [
|
|
138
|
+
s(w(n, o));
|
|
139
|
+
}, [n, o]), /* @__PURE__ */ r.jsxs(c, { sx: { width: "100%", position: "relative", zIndex: 1 }, children: [
|
|
140
140
|
/* @__PURE__ */ r.jsx(
|
|
141
141
|
R,
|
|
142
142
|
{
|
|
@@ -176,11 +176,11 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
176
176
|
position: "relative"
|
|
177
177
|
// Ensure proper stacking context
|
|
178
178
|
},
|
|
179
|
-
children: i.map((t,
|
|
179
|
+
children: i.map((t, a) => /* @__PURE__ */ r.jsx(
|
|
180
180
|
m.div,
|
|
181
181
|
{
|
|
182
182
|
layoutId: `media-${t.id}-${d}`,
|
|
183
|
-
onClick: () => !
|
|
183
|
+
onClick: () => !f && e(t),
|
|
184
184
|
variants: {
|
|
185
185
|
hidden: { y: 50, scale: 0.9, opacity: 0 },
|
|
186
186
|
visible: {
|
|
@@ -191,7 +191,7 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
191
191
|
type: "spring",
|
|
192
192
|
stiffness: 350,
|
|
193
193
|
damping: 25,
|
|
194
|
-
delay:
|
|
194
|
+
delay: a * 0.05
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
},
|
|
@@ -200,12 +200,12 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
200
200
|
dragConstraints: { left: 0, right: 0, top: 0, bottom: 0 },
|
|
201
201
|
dragElastic: 1,
|
|
202
202
|
onDragStart: () => u(!0),
|
|
203
|
-
onDragEnd: (p,
|
|
203
|
+
onDragEnd: (p, b) => {
|
|
204
204
|
u(!1);
|
|
205
|
-
const
|
|
206
|
-
if (Math.abs(
|
|
207
|
-
const g = [...i], j = g[
|
|
208
|
-
g.splice(
|
|
205
|
+
const v = b.offset.x + b.offset.y;
|
|
206
|
+
if (Math.abs(v) > 50) {
|
|
207
|
+
const g = [...i], j = g[a], I = v > 0 ? Math.min(a + 1, i.length - 1) : Math.max(a - 1, 0);
|
|
208
|
+
g.splice(a, 1), g.splice(I, 0, j), s(g);
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
style: {
|
|
@@ -234,7 +234,7 @@ const E = ({ item: a, sx: o, onClick: l }) => {
|
|
|
234
234
|
{
|
|
235
235
|
item: t,
|
|
236
236
|
sx: { position: "absolute", inset: 0, width: "100%", height: "100%" },
|
|
237
|
-
onClick: () => !
|
|
237
|
+
onClick: () => !f && e(t)
|
|
238
238
|
}
|
|
239
239
|
),
|
|
240
240
|
(t.title || t.desc) && /* @__PURE__ */ r.jsxs(
|
package/package.json
CHANGED
|
File without changes
|