@solostylist/ui-kit 1.0.87 → 1.0.88

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.
@@ -0,0 +1,11 @@
1
+ import { j as o } from "./jsx-runtime-DywqP_6a.js";
2
+ import { c as t } from "./createSvgIcon-vJH0FaMW.js";
3
+ const n = t(/* @__PURE__ */ o.jsx("path", {
4
+ d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
5
+ }), "ChevronLeft"), s = t(/* @__PURE__ */ o.jsx("path", {
6
+ d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
7
+ }), "ChevronRight");
8
+ export {
9
+ n as C,
10
+ s as a
11
+ };
package/dist/main.d.ts CHANGED
@@ -83,5 +83,7 @@ export type { MediaItemType } from './s-image-modal/index';
83
83
  export type { SImageModalProps } from './s-image-modal/index';
84
84
  export { default as SLazyImage } from './s-lazy-image/index';
85
85
  export type { SLazyImageProps } from './s-lazy-image/index';
86
+ export { default as SImageComparison } from './s-image-comparison/index';
87
+ export type { SImageComparisonProps } from './s-image-comparison/index';
86
88
  export * from './hooks';
87
89
  export * from './utils';
package/dist/main.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { default as t } from "./s-autocomplete/s-autocomplete.js";
2
2
  import { default as f } from "./s-button/s-button.js";
3
- import { default as p } from "./s-button-link/s-button-link.js";
3
+ import { default as m } from "./s-button-link/s-button-link.js";
4
4
  import { default as s } from "./s-chat-input/s-chat-input.js";
5
5
  import { default as S } from "./s-text-editor/s-text-editor.js";
6
6
  import "./s-text-editor/s-text-editor-toolbar.js";
7
7
  import { default as u } from "./s-checkbox/s-checkbox.js";
8
8
  import { default as n } from "./s-chip/s-chip.js";
9
9
  import { default as c } from "./s-chips/s-chips.js";
10
- import { default as P } from "./s-data-table/s-data-table.js";
11
- import { DialogConfirmProvider as v, default as C, useDialogConfirm as M } from "./s-dialog-confirm/s-dialog-confirm.js";
12
- import { DialogMessageProvider as I, default as k, useDialogMessage as L } from "./s-dialog-message/s-dialog-message.js";
10
+ import { default as C } from "./s-data-table/s-data-table.js";
11
+ import { DialogConfirmProvider as T, default as v, useDialogConfirm as I } from "./s-dialog-confirm/s-dialog-confirm.js";
12
+ import { DialogMessageProvider as b, default as k, useDialogMessage as L } from "./s-dialog-message/s-dialog-message.js";
13
13
  import { default as F } from "./s-error/s-error.js";
14
14
  import { default as B } from "./s-empty/s-empty.js";
15
15
  import { default as E } from "./s-dialog/s-dialog.js";
@@ -26,13 +26,13 @@ import { default as $ } from "./s-select/s-select.js";
26
26
  import { default as oe } from "./s-skeleton/s-skeleton.js";
27
27
  import { default as te } from "./s-tip/s-tip.js";
28
28
  import { default as fe } from "./s-text-truncation/s-text-truncation.js";
29
- import { default as pe, SnackbarMessageProvider as me, useSnackbarMessage as se } from "./s-snackbar-message/s-snackbar-message.js";
29
+ import { default as me, SnackbarMessageProvider as pe, useSnackbarMessage as se } from "./s-snackbar-message/s-snackbar-message.js";
30
30
  import { default as Se } from "./s-form/s-form.js";
31
31
  import { SSmartTextField as ue } from "./s-smart-text-field/s-smart-text-field.js";
32
32
  import { SCopilotKitProvider as ne } from "./s-copilot-kit-provider/s-copilot-kit-provider.js";
33
- import { SStripeCVC as ce, SStripeExpiry as De, SStripeNumber as Pe, StripeTextField as Te } from "./s-stripe/s-stripe.js";
34
- import { default as Ce } from "./s-theme-provider/s-theme-provider.js";
35
- import { default as be } from "./s-datetime-picker/s-datetime-picker.js";
33
+ import { SStripeCVC as ce, SStripeExpiry as De, SStripeNumber as Ce, StripeTextField as Pe } from "./s-stripe/s-stripe.js";
34
+ import { default as ve } from "./s-theme-provider/s-theme-provider.js";
35
+ import { default as Me } from "./s-datetime-picker/s-datetime-picker.js";
36
36
  import { default as ke } from "./s-date-picker/s-date-picker.js";
37
37
  import { default as ye } from "./s-localization-provider/s-localization-provider.js";
38
38
  import { default as he } from "./s-gradient-icon/s-gradient-icon.js";
@@ -42,32 +42,33 @@ import { default as je } from "./s-copyable-text/s-copyable-text.js";
42
42
  import { MediaItem as Ae, default as Ke } from "./s-interactive-gallery/s-interactive-gallery.js";
43
43
  import { default as qe } from "./s-image-modal/s-image-modal.js";
44
44
  import { default as Je } from "./s-lazy-image/s-lazy-image.js";
45
- import { useDialog as Qe } from "./hooks/use-dialog.js";
46
- import { usePopover as Ue } from "./hooks/use-popover.js";
47
- import { formatDatePosted as Xe } from "./utils/dayjs.js";
48
- import { bytesToSize as Ze } from "./utils/bytes-to-size.js";
49
- import { LogLevel as $e, Logger as eo, createLogger as oo, logger as ro } from "./utils/logger.js";
50
- import { default as ao } from "dayjs";
45
+ import { default as Qe } from "./s-image-comparison/s-image-comparison.js";
46
+ import { useDialog as Ue } from "./hooks/use-dialog.js";
47
+ import { usePopover as Xe } from "./hooks/use-popover.js";
48
+ import { formatDatePosted as Ze } from "./utils/dayjs.js";
49
+ import { bytesToSize as $e } from "./utils/bytes-to-size.js";
50
+ import { LogLevel as oo, Logger as ro, createLogger as to, logger as ao } from "./utils/logger.js";
51
+ import { default as lo } from "dayjs";
51
52
  export {
52
- v as DialogConfirmProvider,
53
- I as DialogMessageProvider,
54
- $e as LogLevel,
55
- eo as Logger,
53
+ T as DialogConfirmProvider,
54
+ b as DialogMessageProvider,
55
+ oo as LogLevel,
56
+ ro as Logger,
56
57
  Ae as MediaItem,
57
58
  t as SAutocomplete,
58
59
  f as SButton,
59
- p as SButtonLink,
60
+ m as SButtonLink,
60
61
  s as SChatInput,
61
62
  u as SCheckbox,
62
63
  n as SChip,
63
64
  c as SChips,
64
65
  ne as SCopilotKitProvider,
65
66
  je as SCopyableText,
66
- P as SDataTable,
67
+ C as SDataTable,
67
68
  ke as SDatePicker,
68
- be as SDateTimePicker,
69
+ Me as SDateTimePicker,
69
70
  E as SDialog,
70
- C as SDialogConfirm,
71
+ v as SDialogConfirm,
71
72
  k as SDialogMessage,
72
73
  B as SEmpty,
73
74
  F as SError,
@@ -78,6 +79,7 @@ export {
78
79
  he as SGradientIcon,
79
80
  K as SI18nProvider,
80
81
  q as SIconButton,
82
+ Qe as SImageComparison,
81
83
  qe as SImageModal,
82
84
  Ke as SInteractiveGallery,
83
85
  J as SLabel,
@@ -90,25 +92,25 @@ export {
90
92
  $ as SSelect,
91
93
  oe as SSkeleton,
92
94
  ue as SSmartTextField,
93
- pe as SSnackbarMessage,
95
+ me as SSnackbarMessage,
94
96
  ce as SStripeCVC,
95
97
  De as SStripeExpiry,
96
- Pe as SStripeNumber,
98
+ Ce as SStripeNumber,
97
99
  S as STextEditor,
98
100
  X as STextField,
99
101
  fe as STextTruncation,
100
- Ce as SThemeProvider,
102
+ ve as SThemeProvider,
101
103
  te as STip,
102
- me as SnackbarMessageProvider,
103
- Te as StripeTextField,
104
- Ze as bytesToSize,
105
- oo as createLogger,
106
- ao as dayjs,
107
- Xe as formatDatePosted,
108
- ro as logger,
109
- Qe as useDialog,
110
- M as useDialogConfirm,
104
+ pe as SnackbarMessageProvider,
105
+ Pe as StripeTextField,
106
+ $e as bytesToSize,
107
+ to as createLogger,
108
+ lo as dayjs,
109
+ Ze as formatDatePosted,
110
+ ao as logger,
111
+ Ue as useDialog,
112
+ I as useDialogConfirm,
111
113
  L as useDialogMessage,
112
- Ue as usePopover,
114
+ Xe as usePopover,
113
115
  se as useSnackbarMessage
114
116
  };
@@ -0,0 +1,2 @@
1
+ export { default } from './s-image-comparison';
2
+ export type { SImageComparisonProps } from './s-image-comparison';
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./s-image-comparison.js";
2
+ export {
3
+ o as default
4
+ };
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }
@@ -0,0 +1,11 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import * as React from 'react';
3
+ export interface SImageComparisonProps extends BoxProps {
4
+ leftImage: string;
5
+ rightImage: string;
6
+ altLeft?: string;
7
+ altRight?: string;
8
+ initialPosition?: number;
9
+ }
10
+ declare const SImageComparison: React.ForwardRefExoticComponent<Omit<SImageComparisonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ export default SImageComparison;
@@ -0,0 +1,155 @@
1
+ import { j as e } from "../jsx-runtime-DywqP_6a.js";
2
+ import * as s from "react";
3
+ import { C as y, a as I } from "../ChevronRight-D5BryGH5.js";
4
+ import { Box as o, IconButton as L } from "@mui/material";
5
+ const R = s.forwardRef(
6
+ ({ sx: f, leftImage: v, rightImage: g, altLeft: b = "Left image", altRight: w = "Right image", initialPosition: j = 50, ...E }, i) => {
7
+ const [r, S] = s.useState(j), [n, d] = s.useState(!1), l = s.useRef(null), u = (t) => {
8
+ if (!l.current) return;
9
+ const p = l.current.getBoundingClientRect();
10
+ let c = (t - p.left) / p.width * 100;
11
+ c = Math.max(0, Math.min(100, c)), S(c);
12
+ }, m = (t) => {
13
+ n && u(t.clientX);
14
+ }, h = (t) => {
15
+ n && u(t.touches[0].clientX);
16
+ }, x = () => {
17
+ d(!0);
18
+ }, a = () => {
19
+ d(!1);
20
+ };
21
+ return s.useEffect(() => (n ? (document.addEventListener("mousemove", m), document.addEventListener("touchmove", h), document.addEventListener("mouseup", a), document.addEventListener("touchend", a), document.body.style.cursor = "ew-resize") : document.body.style.cursor = "", () => {
22
+ document.removeEventListener("mousemove", m), document.removeEventListener("touchmove", h), document.removeEventListener("mouseup", a), document.removeEventListener("touchend", a), document.body.style.cursor = "";
23
+ }), [n]), /* @__PURE__ */ e.jsxs(
24
+ o,
25
+ {
26
+ ref: (t) => {
27
+ l.current = t, typeof i == "function" ? i(t) : i && (i.current = t);
28
+ },
29
+ sx: {
30
+ position: "relative",
31
+ width: "100%",
32
+ height: "100%",
33
+ overflow: "hidden",
34
+ userSelect: "none",
35
+ "&:hover .slider-handle": {
36
+ transform: "translate(-50%, -50%) scale(1.05)"
37
+ },
38
+ ...f
39
+ },
40
+ onMouseDown: x,
41
+ onTouchStart: x,
42
+ ...E,
43
+ children: [
44
+ /* @__PURE__ */ e.jsx(
45
+ o,
46
+ {
47
+ component: "img",
48
+ src: g,
49
+ alt: w,
50
+ sx: {
51
+ position: "absolute",
52
+ inset: 0,
53
+ width: "100%",
54
+ height: "100%",
55
+ objectFit: "cover",
56
+ pointerEvents: "none"
57
+ },
58
+ draggable: !1
59
+ }
60
+ ),
61
+ /* @__PURE__ */ e.jsx(
62
+ o,
63
+ {
64
+ sx: {
65
+ position: "absolute",
66
+ inset: 0,
67
+ width: "100%",
68
+ height: "100%",
69
+ overflow: "hidden",
70
+ pointerEvents: "none",
71
+ clipPath: `polygon(0 0, ${r}% 0, ${r}% 100%, 0 100%)`
72
+ },
73
+ children: /* @__PURE__ */ e.jsx(
74
+ o,
75
+ {
76
+ component: "img",
77
+ src: v,
78
+ alt: b,
79
+ sx: {
80
+ width: "100%",
81
+ height: "100%",
82
+ objectFit: "cover"
83
+ },
84
+ draggable: !1
85
+ }
86
+ )
87
+ }
88
+ ),
89
+ /* @__PURE__ */ e.jsxs(
90
+ o,
91
+ {
92
+ sx: {
93
+ position: "absolute",
94
+ top: 0,
95
+ height: "100%",
96
+ width: "4px",
97
+ cursor: "ew-resize",
98
+ left: `calc(${r}% - 2px)`
99
+ },
100
+ children: [
101
+ /* @__PURE__ */ e.jsx(
102
+ o,
103
+ {
104
+ sx: {
105
+ position: "absolute",
106
+ inset: "0 0 0 0",
107
+ width: "4px",
108
+ bgcolor: "divider",
109
+ backdropFilter: "blur(4px)"
110
+ }
111
+ }
112
+ ),
113
+ /* @__PURE__ */ e.jsx(
114
+ L,
115
+ {
116
+ className: "slider-handle",
117
+ sx: {
118
+ position: "absolute",
119
+ top: "50%",
120
+ left: "50%",
121
+ transform: "translate(-50%, -50%)",
122
+ width: 48,
123
+ height: 48,
124
+ backdropFilter: "blur(10px)",
125
+ boxShadow: 3,
126
+ transition: "all 0.3s ease-in-out",
127
+ ...n && {
128
+ transform: "translate(-50%, -50%) scale(1.05)",
129
+ boxShadow: 6
130
+ }
131
+ },
132
+ role: "slider",
133
+ "aria-valuenow": r,
134
+ "aria-valuemin": 0,
135
+ "aria-valuemax": 100,
136
+ "aria-orientation": "horizontal",
137
+ "aria-label": "Image comparison slider",
138
+ children: /* @__PURE__ */ e.jsxs(o, { sx: { display: "flex", alignItems: "center" }, children: [
139
+ /* @__PURE__ */ e.jsx(y, { sx: { fontSize: 20 } }),
140
+ /* @__PURE__ */ e.jsx(I, { sx: { fontSize: 20 } })
141
+ ] })
142
+ }
143
+ )
144
+ ]
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ );
150
+ }
151
+ );
152
+ R.displayName = "SImageComparison";
153
+ export {
154
+ R as default
155
+ };
@@ -1,74 +1,70 @@
1
- import { j as i } from "../jsx-runtime-DywqP_6a.js";
2
- import { useState as k, useEffect as z } from "react";
3
- import { Modal as A, Box as l, Paper as b, Typography as w, IconButton as m, Stack as T } from "@mui/material";
4
- import { motion as u, AnimatePresence as F } from "framer-motion";
5
- import { C as M } from "../Close-CKpTrk7X.js";
6
- import { c as P } from "../createSvgIcon-vJH0FaMW.js";
7
- const $ = P(/* @__PURE__ */ i.jsx("path", {
8
- d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
9
- }), "ChevronLeft"), B = P(/* @__PURE__ */ i.jsx("path", {
10
- d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
11
- }), "ChevronRight"), I = ({ item: s, onClick: c, style: r = {}, objectFit: e = "contain", disableVideoControls: n = !1 }) => s.type === "video" ? /* @__PURE__ */ i.jsx(
12
- l,
1
+ import { j as o } from "../jsx-runtime-DywqP_6a.js";
2
+ import { useState as k, useEffect as w } from "react";
3
+ import { Modal as A, Box as d, Paper as b, Typography as z, IconButton as m, Stack as L } from "@mui/material";
4
+ import { motion as h, AnimatePresence as T } from "framer-motion";
5
+ import { C as F } from "../Close-CKpTrk7X.js";
6
+ import { C as $, a as B } from "../ChevronRight-D5BryGH5.js";
7
+ const I = ({ item: s, onClick: l, style: x = {}, objectFit: e = "contain", disableVideoControls: n = !1 }) => s.type === "video" ? /* @__PURE__ */ o.jsx(
8
+ d,
13
9
  {
14
10
  component: "video",
15
- onClick: c,
11
+ onClick: l,
16
12
  controls: !n,
17
13
  sx: {
18
14
  width: "100%",
19
15
  height: "100%",
20
16
  objectFit: e,
21
17
  bgcolor: "background.paper",
22
- ...r
18
+ ...x
23
19
  },
24
- children: /* @__PURE__ */ i.jsx("source", { src: s.url, type: "video/mp4" })
20
+ children: /* @__PURE__ */ o.jsx("source", { src: s.url, type: "video/mp4" })
25
21
  }
26
- ) : /* @__PURE__ */ i.jsx(
27
- l,
22
+ ) : /* @__PURE__ */ o.jsx(
23
+ d,
28
24
  {
29
25
  component: "img",
30
26
  src: s.url,
31
27
  alt: s.title || "",
32
- onClick: c,
28
+ onClick: l,
33
29
  sx: {
34
30
  width: "100%",
35
31
  height: "100%",
36
32
  objectFit: e,
37
33
  bgcolor: "background.paper",
38
- ...r
34
+ ...x
39
35
  }
40
36
  }
41
- ), V = ({
37
+ ), M = ({
42
38
  selectedItem: s,
43
- isOpen: c,
44
- onClose: r,
39
+ isOpen: l,
40
+ onClose: x,
45
41
  onItemChange: e,
46
42
  mediaItems: n = [],
47
43
  renderMediaItem: f,
48
- showNavigation: E = !0,
49
- showThumbnailDock: S = !0,
50
- showCounter: R = !0,
44
+ showNavigation: P = !0,
45
+ showThumbnailDock: E = !0,
46
+ showCounter: S = !0,
51
47
  modalSx: C = {}
52
48
  }) => {
53
- const [v, L] = k({ x: 0, y: 0 }), [D, h] = k(s || null), o = s || D;
54
- z(() => {
55
- s && h(s);
49
+ const [v, R] = k({ x: 0, y: 0 }), [D, u] = k(s || null), i = s || D;
50
+ w(() => {
51
+ s && u(s);
56
52
  }, [s]);
57
- const p = E && n.length > 1 && o, a = o ? n.findIndex((t) => t.id === o.id) : -1, g = n.length, y = () => {
58
- if (p && a > 0) {
59
- const t = n[a - 1];
60
- e ? e(t) : h(t);
53
+ const p = P && n.length > 1 && i, r = i ? n.findIndex((t) => t.id === i.id) : -1, g = n.length, y = () => {
54
+ if (p && r > 0) {
55
+ const t = n[r - 1];
56
+ e ? e(t) : u(t);
61
57
  }
62
58
  }, j = () => {
63
- if (p && a < g - 1) {
64
- const t = n[a + 1];
65
- e ? e(t) : h(t);
59
+ if (p && r < g - 1) {
60
+ const t = n[r + 1];
61
+ e ? e(t) : u(t);
66
62
  }
67
63
  };
68
- return z(() => {
69
- const t = (d) => {
70
- if (c)
71
- switch (d.key) {
64
+ return w(() => {
65
+ const t = (a) => {
66
+ if (l)
67
+ switch (a.key) {
72
68
  case "ArrowLeft":
73
69
  y();
74
70
  break;
@@ -76,16 +72,16 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
76
72
  j();
77
73
  break;
78
74
  case "Escape":
79
- r();
75
+ x();
80
76
  break;
81
77
  }
82
78
  };
83
79
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
84
- }, [c, a, g, p]), !c || !o ? null : /* @__PURE__ */ i.jsx(
80
+ }, [l, r, g, p]), !l || !i ? null : /* @__PURE__ */ o.jsx(
85
81
  A,
86
82
  {
87
- open: c,
88
- onClose: r,
83
+ open: l,
84
+ onClose: x,
89
85
  sx: {
90
86
  zIndex: (t) => t.zIndex.modal + 100,
91
87
  ...C
@@ -98,15 +94,15 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
98
94
  }
99
95
  }
100
96
  },
101
- children: /* @__PURE__ */ i.jsxs(l, { children: [
102
- /* @__PURE__ */ i.jsx(
103
- u.div,
97
+ children: /* @__PURE__ */ o.jsxs(d, { children: [
98
+ /* @__PURE__ */ o.jsx(
99
+ h.div,
104
100
  {
105
101
  initial: { scale: 0.98 },
106
102
  animate: { scale: 1 },
107
103
  exit: { scale: 0.98 },
108
104
  transition: { type: "spring", stiffness: 400, damping: 30 },
109
- children: /* @__PURE__ */ i.jsxs(
105
+ children: /* @__PURE__ */ o.jsxs(
110
106
  b,
111
107
  {
112
108
  elevation: 3,
@@ -120,16 +116,16 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
120
116
  zIndex: (t) => t.zIndex.modal + 101
121
117
  },
122
118
  children: [
123
- /* @__PURE__ */ i.jsx(
124
- l,
119
+ /* @__PURE__ */ o.jsx(
120
+ d,
125
121
  {
126
122
  sx: {
127
123
  height: "100%",
128
124
  display: "flex",
129
125
  flexDirection: "column"
130
126
  },
131
- children: /* @__PURE__ */ i.jsx(
132
- l,
127
+ children: /* @__PURE__ */ o.jsx(
128
+ d,
133
129
  {
134
130
  sx: {
135
131
  flex: 1,
@@ -139,8 +135,8 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
139
135
  justifyContent: "center",
140
136
  bgcolor: "background.default"
141
137
  },
142
- children: /* @__PURE__ */ i.jsx(F, { mode: "wait", children: /* @__PURE__ */ i.jsx(
143
- u.div,
138
+ children: /* @__PURE__ */ o.jsx(T, { mode: "wait", children: /* @__PURE__ */ o.jsx(
139
+ h.div,
144
140
  {
145
141
  style: { position: "relative" },
146
142
  initial: { y: 20, scale: 0.97 },
@@ -150,11 +146,11 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
150
146
  transition: { type: "spring", stiffness: 500, damping: 30, mass: 0.5 }
151
147
  },
152
148
  exit: { y: 20, scale: 0.97, transition: { duration: 0.15 } },
153
- onClick: r,
154
- children: /* @__PURE__ */ i.jsxs(
149
+ children: /* @__PURE__ */ o.jsxs(
155
150
  b,
156
151
  {
157
152
  elevation: 6,
153
+ onClick: (t) => t.stopPropagation(),
158
154
  sx: {
159
155
  position: "relative",
160
156
  width: "100%",
@@ -165,9 +161,9 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
165
161
  overflow: "hidden"
166
162
  },
167
163
  children: [
168
- f ? f(o, r) : /* @__PURE__ */ i.jsx(I, { item: o, onClick: r }),
169
- (o.title || o.desc) && /* @__PURE__ */ i.jsxs(
170
- l,
164
+ f ? f(i) : /* @__PURE__ */ o.jsx(I, { item: i }),
165
+ (i.title || i.desc) && /* @__PURE__ */ o.jsxs(
166
+ d,
171
167
  {
172
168
  sx: {
173
169
  position: "absolute",
@@ -180,8 +176,8 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
180
176
  },
181
177
  onClick: (t) => t.stopPropagation(),
182
178
  children: [
183
- o.title && /* @__PURE__ */ i.jsx(w, { variant: "h6", sx: { fontWeight: 600, fontSize: { xs: 14, sm: 18, md: 20 } }, children: o.title }),
184
- o.desc && /* @__PURE__ */ i.jsx(w, { variant: "body2", sx: { opacity: 0.8, mt: 0.5 }, children: o.desc })
179
+ i.title && /* @__PURE__ */ o.jsx(z, { variant: "h6", sx: { fontWeight: 600, fontSize: { xs: 14, sm: 18, md: 20 } }, children: i.title }),
180
+ i.desc && /* @__PURE__ */ o.jsx(z, { variant: "body2", sx: { opacity: 0.8, mt: 0.5 }, children: i.desc })
185
181
  ]
186
182
  }
187
183
  )
@@ -189,28 +185,28 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
189
185
  }
190
186
  )
191
187
  },
192
- o.id
188
+ i.id
193
189
  ) })
194
190
  }
195
191
  )
196
192
  }
197
193
  ),
198
- /* @__PURE__ */ i.jsx(
194
+ /* @__PURE__ */ o.jsx(
199
195
  m,
200
196
  {
201
197
  "aria-label": "Close",
202
- onClick: r,
198
+ onClick: x,
203
199
  sx: {
204
200
  position: "absolute",
205
201
  top: { xs: 8, sm: 10, md: 12 },
206
202
  right: { xs: 8, sm: 10, md: 12 },
207
203
  zIndex: (t) => t.zIndex.modal + 102
208
204
  },
209
- children: /* @__PURE__ */ i.jsx(M, {})
205
+ children: /* @__PURE__ */ o.jsx(F, {})
210
206
  }
211
207
  ),
212
- R && p && /* @__PURE__ */ i.jsxs(
213
- l,
208
+ S && p && /* @__PURE__ */ o.jsxs(
209
+ d,
214
210
  {
215
211
  sx: {
216
212
  position: "absolute",
@@ -223,21 +219,21 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
223
219
  color: "text.primary"
224
220
  },
225
221
  children: [
226
- a + 1,
222
+ r + 1,
227
223
  " / ",
228
224
  g
229
225
  ]
230
226
  }
231
227
  ),
232
- p && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
233
- /* @__PURE__ */ i.jsx(
228
+ p && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
229
+ /* @__PURE__ */ o.jsx(
234
230
  m,
235
231
  {
236
232
  "aria-label": "Previous image",
237
233
  onClick: (t) => {
238
234
  t.stopPropagation(), y();
239
235
  },
240
- disabled: a === 0,
236
+ disabled: r === 0,
241
237
  sx: {
242
238
  position: "absolute",
243
239
  left: { xs: 8, sm: 10, md: 12 },
@@ -248,17 +244,17 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
248
244
  opacity: 0.5
249
245
  }
250
246
  },
251
- children: /* @__PURE__ */ i.jsx($, {})
247
+ children: /* @__PURE__ */ o.jsx($, {})
252
248
  }
253
249
  ),
254
- /* @__PURE__ */ i.jsx(
250
+ /* @__PURE__ */ o.jsx(
255
251
  m,
256
252
  {
257
253
  "aria-label": "Next image",
258
254
  onClick: (t) => {
259
255
  t.stopPropagation(), j();
260
256
  },
261
- disabled: a === g - 1,
257
+ disabled: r === g - 1,
262
258
  sx: {
263
259
  position: "absolute",
264
260
  right: { xs: 8, sm: 10, md: 12 },
@@ -269,7 +265,7 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
269
265
  opacity: 0.5
270
266
  }
271
267
  },
272
- children: /* @__PURE__ */ i.jsx(B, {})
268
+ children: /* @__PURE__ */ o.jsx(B, {})
273
269
  }
274
270
  )
275
271
  ] })
@@ -278,16 +274,16 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
278
274
  )
279
275
  }
280
276
  ),
281
- S && p && n.length > 1 && /* @__PURE__ */ i.jsx(
282
- u.div,
277
+ E && p && n.length > 1 && /* @__PURE__ */ o.jsx(
278
+ h.div,
283
279
  {
284
280
  drag: !0,
285
281
  dragMomentum: !1,
286
282
  dragElastic: 0.1,
287
283
  initial: !1,
288
284
  animate: { x: v.x, y: v.y },
289
- onDragEnd: (t, d) => {
290
- L((x) => ({ x: x.x + d.offset.x, y: x.y + d.offset.y }));
285
+ onDragEnd: (t, a) => {
286
+ R((c) => ({ x: c.x + a.offset.x, y: c.y + a.offset.y }));
291
287
  },
292
288
  style: {
293
289
  position: "fixed",
@@ -297,7 +293,7 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
297
293
  transform: "translateX(-50%)",
298
294
  touchAction: "none"
299
295
  },
300
- children: /* @__PURE__ */ i.jsx(
296
+ children: /* @__PURE__ */ o.jsx(
301
297
  b,
302
298
  {
303
299
  elevation: 8,
@@ -313,11 +309,11 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
313
309
  px: 1.5,
314
310
  py: 1
315
311
  },
316
- children: /* @__PURE__ */ i.jsx(T, { direction: "row", alignItems: "center", spacing: -1.5, children: n.map((t, d) => /* @__PURE__ */ i.jsxs(
317
- u.div,
312
+ children: /* @__PURE__ */ o.jsx(L, { direction: "row", alignItems: "center", spacing: -1.5, children: n.map((t, a) => /* @__PURE__ */ o.jsxs(
313
+ h.div,
318
314
  {
319
- onClick: (x) => {
320
- x.stopPropagation(), e ? e(t) : h(t);
315
+ onClick: (c) => {
316
+ c.stopPropagation(), e ? e(t) : u(t);
321
317
  },
322
318
  style: {
323
319
  position: "relative",
@@ -326,16 +322,16 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
326
322
  borderRadius: 10,
327
323
  overflow: "hidden",
328
324
  flexShrink: 0,
329
- zIndex: o.id === t.id ? 30 : n.length - d,
330
- border: o.id === t.id ? "2px solid" : void 0,
331
- borderColor: o.id === t.id ? "divider" : void 0,
325
+ zIndex: i.id === t.id ? 30 : n.length - a,
326
+ border: i.id === t.id ? "2px solid" : void 0,
327
+ borderColor: i.id === t.id ? "divider" : void 0,
332
328
  cursor: "pointer"
333
329
  },
334
- initial: { rotate: d % 2 === 0 ? -15 : 15 },
330
+ initial: { rotate: a % 2 === 0 ? -15 : 15 },
335
331
  animate: {
336
- scale: o.id === t.id ? 1.2 : 1,
337
- rotate: o.id === t.id ? 0 : d % 2 === 0 ? -15 : 15,
338
- y: o.id === t.id ? -8 : 0
332
+ scale: i.id === t.id ? 1.2 : 1,
333
+ rotate: i.id === t.id ? 0 : a % 2 === 0 ? -15 : 15,
334
+ y: i.id === t.id ? -8 : 0
339
335
  },
340
336
  whileHover: {
341
337
  scale: 1.3,
@@ -345,8 +341,8 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
345
341
  },
346
342
  children: [
347
343
  f ? f(t, () => {
348
- e ? e(t) : h(t);
349
- }) : /* @__PURE__ */ i.jsx(
344
+ e ? e(t) : u(t);
345
+ }) : /* @__PURE__ */ o.jsx(
350
346
  I,
351
347
  {
352
348
  item: t,
@@ -360,19 +356,19 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
360
356
  disableVideoControls: !0
361
357
  }
362
358
  ),
363
- /* @__PURE__ */ i.jsx(
364
- l,
359
+ /* @__PURE__ */ o.jsx(
360
+ d,
365
361
  {
366
362
  sx: {
367
363
  position: "absolute",
368
364
  inset: 0,
369
- background: (x) => `linear-gradient(to bottom, transparent, ${x.palette.action.hover}, ${x.palette.action.selected})`,
365
+ background: (c) => `linear-gradient(to bottom, transparent, ${c.palette.action.hover}, ${c.palette.action.selected})`,
370
366
  pointerEvents: "none"
371
367
  }
372
368
  }
373
369
  ),
374
- o.id === t.id && /* @__PURE__ */ i.jsx(
375
- u.div,
370
+ i.id === t.id && /* @__PURE__ */ o.jsx(
371
+ h.div,
376
372
  {
377
373
  layoutId: "activeGlow",
378
374
  style: {
@@ -400,5 +396,5 @@ const $ = P(/* @__PURE__ */ i.jsx("path", {
400
396
  };
401
397
  export {
402
398
  I as DefaultMediaItem,
403
- V as default
399
+ M as default
404
400
  };
@@ -1,55 +1,55 @@
1
1
  import { j as r } from "../jsx-runtime-DywqP_6a.js";
2
- import { useState as u, useEffect as y, useRef as w } from "react";
3
- import { Box as n, Paper as j, Typography as v } from "@mui/material";
4
- import { AnimatePresence as I, motion as x } from "framer-motion";
5
- import C from "../s-image-modal/s-image-modal.js";
6
- import S from "../s-lazy-image/s-lazy-image.js";
7
- const k = ({ item: s, sx: o, onClick: a }) => {
8
- const e = w(null), [d, h] = u(!1), [p, t] = u(!0);
2
+ import { useState as u, useId as j, useEffect as y, useRef as I } from "react";
3
+ import { Box as s, Paper as C, Typography as x } from "@mui/material";
4
+ import { AnimatePresence as S, motion as b } from "framer-motion";
5
+ import k from "../s-image-modal/s-image-modal.js";
6
+ import $ from "../s-lazy-image/s-lazy-image.js";
7
+ const R = ({ item: a, sx: i, onClick: l }) => {
8
+ const e = I(null), [c, h] = u(!1), [p, d] = u(!0);
9
9
  return y(() => {
10
- const i = {
10
+ const t = {
11
11
  root: null,
12
12
  rootMargin: "50px",
13
13
  // Start loading 50px before entering viewport
14
14
  threshold: 0.1
15
15
  // Trigger when 10% of video is visible
16
- }, c = new IntersectionObserver((l) => {
17
- l.forEach((f) => h(f.isIntersecting));
18
- }, i);
19
- return e.current && c.observe(e.current), () => {
20
- e.current && c.unobserve(e.current);
16
+ }, o = new IntersectionObserver((n) => {
17
+ n.forEach((f) => h(f.isIntersecting));
18
+ }, t);
19
+ return e.current && o.observe(e.current), () => {
20
+ e.current && o.unobserve(e.current);
21
21
  };
22
22
  }, []), y(() => {
23
- let i = !0;
24
- return d ? (async () => {
25
- if (!(!e.current || !d || !i))
23
+ let t = !0;
24
+ return c ? (async () => {
25
+ if (!(!e.current || !c || !t))
26
26
  try {
27
- e.current.readyState >= 3 ? (t(!1), await e.current.play()) : (t(!0), await new Promise((l) => {
28
- e.current && (e.current.oncanplay = () => l());
29
- }), i && (t(!1), await e.current.play()));
30
- } catch (l) {
31
- console.warn("Video playback failed:", l);
27
+ e.current.readyState >= 3 ? (d(!1), await e.current.play()) : (d(!0), await new Promise((n) => {
28
+ e.current && (e.current.oncanplay = () => n());
29
+ }), t && (d(!1), await e.current.play()));
30
+ } catch (n) {
31
+ console.warn("Video playback failed:", n);
32
32
  }
33
33
  })() : e.current && e.current.pause(), () => {
34
- i = !1, e.current && (e.current.pause(), e.current.removeAttribute("src"), e.current.load());
34
+ t = !1, e.current && (e.current.pause(), e.current.removeAttribute("src"), e.current.load());
35
35
  };
36
- }, [d]), s.type === "video" ? /* @__PURE__ */ r.jsxs(
37
- n,
36
+ }, [c]), a.type === "video" ? /* @__PURE__ */ r.jsxs(
37
+ s,
38
38
  {
39
39
  sx: {
40
40
  position: "relative",
41
41
  overflow: "hidden",
42
42
  width: "100%",
43
43
  height: "100%",
44
- ...o
44
+ ...i
45
45
  },
46
46
  children: [
47
47
  /* @__PURE__ */ r.jsx(
48
- n,
48
+ s,
49
49
  {
50
50
  component: "video",
51
51
  ref: e,
52
- onClick: a,
52
+ onClick: l,
53
53
  playsInline: !0,
54
54
  muted: !0,
55
55
  loop: !0,
@@ -64,11 +64,11 @@ const k = ({ item: s, sx: o, onClick: a }) => {
64
64
  willChange: "transform",
65
65
  display: "block"
66
66
  },
67
- children: /* @__PURE__ */ r.jsx("source", { src: s.url, type: "video/mp4" })
67
+ children: /* @__PURE__ */ r.jsx("source", { src: a.url, type: "video/mp4" })
68
68
  }
69
69
  ),
70
70
  p && /* @__PURE__ */ r.jsx(
71
- n,
71
+ s,
72
72
  {
73
73
  sx: {
74
74
  position: "absolute",
@@ -79,7 +79,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
79
79
  bgcolor: "action.disabled"
80
80
  },
81
81
  children: /* @__PURE__ */ r.jsx(
82
- n,
82
+ s,
83
83
  {
84
84
  sx: {
85
85
  width: 24,
@@ -99,39 +99,39 @@ const k = ({ item: s, sx: o, onClick: a }) => {
99
99
  )
100
100
  ]
101
101
  }
102
- ) : /* @__PURE__ */ r.jsx(n, { onClick: a, sx: { width: "100%", height: "100%", ...o }, children: /* @__PURE__ */ r.jsx(
103
- S,
102
+ ) : /* @__PURE__ */ r.jsx(s, { onClick: l, sx: { width: "100%", height: "100%", ...i }, children: /* @__PURE__ */ r.jsx(
103
+ $,
104
104
  {
105
- src: s.url,
106
- alt: s.title || "",
105
+ src: a.url,
106
+ alt: a.title || "",
107
107
  width: "100%",
108
108
  height: "100%",
109
109
  style: {
110
- objectFit: o != null && o.objectFit ? o.objectFit : "cover",
111
- cursor: a ? "pointer" : "default",
110
+ objectFit: i != null && i.objectFit ? i.objectFit : "cover",
111
+ cursor: l ? "pointer" : "default",
112
112
  display: "block",
113
113
  width: "100%",
114
114
  height: "100%"
115
115
  }
116
116
  }
117
117
  ) });
118
- }, $ = ({ mediaItems: s }) => {
119
- const [o, a] = u(null), [e, d] = u(s), [h, p] = u(!1);
118
+ }, F = ({ mediaItems: a }) => {
119
+ const [i, l] = u(null), [e, c] = u(a), [h, p] = u(!1), d = j();
120
120
  return y(() => {
121
- d(s);
122
- }, [s]), /* @__PURE__ */ r.jsxs(n, { sx: { width: "100%", position: "relative", zIndex: 1 }, children: [
121
+ c(a);
122
+ }, [a]), /* @__PURE__ */ r.jsxs(s, { sx: { width: "100%", position: "relative", zIndex: 1 }, children: [
123
123
  /* @__PURE__ */ r.jsx(
124
- C,
124
+ k,
125
125
  {
126
- selectedItem: o,
127
- isOpen: !!o,
128
- onClose: () => a(null),
129
- onItemChange: a,
126
+ selectedItem: i,
127
+ isOpen: !!i,
128
+ onClose: () => l(null),
129
+ onItemChange: l,
130
130
  mediaItems: e
131
131
  }
132
132
  ),
133
- /* @__PURE__ */ r.jsx(I, { mode: "wait", children: !o && /* @__PURE__ */ r.jsx(
134
- x.div,
133
+ /* @__PURE__ */ r.jsx(S, { mode: "wait", children: !i && /* @__PURE__ */ r.jsx(
134
+ b.div,
135
135
  {
136
136
  initial: "hidden",
137
137
  animate: "visible",
@@ -145,7 +145,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
145
145
  }
146
146
  },
147
147
  children: /* @__PURE__ */ r.jsx(
148
- n,
148
+ s,
149
149
  {
150
150
  sx: {
151
151
  display: "grid",
@@ -159,11 +159,11 @@ const k = ({ item: s, sx: o, onClick: a }) => {
159
159
  position: "relative"
160
160
  // Ensure proper stacking context
161
161
  },
162
- children: e.map((t, i) => /* @__PURE__ */ r.jsx(
163
- x.div,
162
+ children: e.map((t, o) => /* @__PURE__ */ r.jsx(
163
+ b.div,
164
164
  {
165
- layoutId: `media-${t.id}`,
166
- onClick: () => !h && a(t),
165
+ layoutId: `media-${t.id}-${d}`,
166
+ onClick: () => !h && l(t),
167
167
  variants: {
168
168
  hidden: { y: 50, scale: 0.9, opacity: 0 },
169
169
  visible: {
@@ -174,7 +174,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
174
174
  type: "spring",
175
175
  stiffness: 350,
176
176
  damping: 25,
177
- delay: i * 0.05
177
+ delay: o * 0.05
178
178
  }
179
179
  }
180
180
  },
@@ -183,12 +183,12 @@ const k = ({ item: s, sx: o, onClick: a }) => {
183
183
  dragConstraints: { left: 0, right: 0, top: 0, bottom: 0 },
184
184
  dragElastic: 1,
185
185
  onDragStart: () => p(!0),
186
- onDragEnd: (c, l) => {
186
+ onDragEnd: (n, f) => {
187
187
  p(!1);
188
- const f = l.offset.x + l.offset.y;
189
- if (Math.abs(f) > 50) {
190
- const g = [...e], b = g[i], m = f > 0 ? Math.min(i + 1, e.length - 1) : Math.max(i - 1, 0);
191
- g.splice(i, 1), g.splice(m, 0, b), d(g);
188
+ const v = f.offset.x + f.offset.y;
189
+ if (Math.abs(v) > 50) {
190
+ const g = [...e], m = g[o], w = v > 0 ? Math.min(o + 1, e.length - 1) : Math.max(o - 1, 0);
191
+ g.splice(o, 1), g.splice(w, 0, m), c(g);
192
192
  }
193
193
  },
194
194
  style: {
@@ -197,7 +197,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
197
197
  gridColumn: t.colSpan ? `span ${t.colSpan}` : "span 1"
198
198
  },
199
199
  children: /* @__PURE__ */ r.jsxs(
200
- j,
200
+ C,
201
201
  {
202
202
  elevation: 4,
203
203
  sx: {
@@ -214,15 +214,15 @@ const k = ({ item: s, sx: o, onClick: a }) => {
214
214
  },
215
215
  children: [
216
216
  /* @__PURE__ */ r.jsx(
217
- k,
217
+ R,
218
218
  {
219
219
  item: t,
220
220
  sx: { position: "absolute", inset: 0, width: "100%", height: "100%" },
221
- onClick: () => !h && a(t)
221
+ onClick: () => !h && l(t)
222
222
  }
223
223
  ),
224
224
  (t.title || t.desc) && /* @__PURE__ */ r.jsxs(
225
- n,
225
+ s,
226
226
  {
227
227
  className: "hover-overlay",
228
228
  sx: {
@@ -239,17 +239,17 @@ const k = ({ item: s, sx: o, onClick: a }) => {
239
239
  },
240
240
  children: [
241
241
  /* @__PURE__ */ r.jsx(
242
- n,
242
+ s,
243
243
  {
244
244
  sx: {
245
245
  position: "absolute",
246
246
  inset: 0,
247
- background: (c) => `linear-gradient(to top, ${c.palette.grey[900]}CC, ${c.palette.grey[900]}66, transparent)`
247
+ background: (n) => `linear-gradient(to top, ${n.palette.grey[900]}CC, ${n.palette.grey[900]}66, transparent)`
248
248
  }
249
249
  }
250
250
  ),
251
251
  t.title && /* @__PURE__ */ r.jsx(
252
- v,
252
+ x,
253
253
  {
254
254
  variant: "subtitle2",
255
255
  sx: {
@@ -264,7 +264,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
264
264
  }
265
265
  ),
266
266
  t.desc && /* @__PURE__ */ r.jsx(
267
- v,
267
+ x,
268
268
  {
269
269
  variant: "caption",
270
270
  sx: {
@@ -286,7 +286,7 @@ const k = ({ item: s, sx: o, onClick: a }) => {
286
286
  }
287
287
  )
288
288
  },
289
- t.id
289
+ `${t.id}-${d}`
290
290
  ))
291
291
  }
292
292
  )
@@ -295,6 +295,6 @@ const k = ({ item: s, sx: o, onClick: a }) => {
295
295
  ] });
296
296
  };
297
297
  export {
298
- k as MediaItem,
299
- $ as default
298
+ R as MediaItem,
299
+ F as default
300
300
  };
@@ -19,7 +19,16 @@ const g = c(/* @__PURE__ */ s.jsx("path", {
19
19
  var r;
20
20
  const [t, m] = j(!1), n = o === "password", x = () => {
21
21
  m(!t);
22
- }, f = n && t ? "text" : o, u = n ? /* @__PURE__ */ s.jsx(w, { position: "end", children: /* @__PURE__ */ s.jsx(b, { "aria-label": "toggle password visibility", onClick: x, edge: "end", children: t ? /* @__PURE__ */ s.jsx(P, {}) : /* @__PURE__ */ s.jsx(g, {}) }) }) : void 0;
22
+ }, f = n && t ? "text" : o, u = n ? /* @__PURE__ */ s.jsx(w, { position: "end", children: /* @__PURE__ */ s.jsx(
23
+ b,
24
+ {
25
+ "aria-label": "toggle password visibility",
26
+ onClick: x,
27
+ edge: "end",
28
+ size: "small",
29
+ children: t ? /* @__PURE__ */ s.jsx(P, {}) : /* @__PURE__ */ s.jsx(g, {})
30
+ }
31
+ ) }) : void 0;
23
32
  return /* @__PURE__ */ s.jsx(y, { label: d, hint: p, error: i, required: a, htmlFor: e, children: /* @__PURE__ */ s.jsx(
24
33
  h,
25
34
  {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.87",
6
+ "version": "1.0.88",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",