@solostylist/ui-kit 1.0.116 → 1.0.117

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.
@@ -1,30 +1,31 @@
1
- import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
- import * as s from "react";
3
- import { C as y, a as I } from "../ChevronRight-DQD188LX.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) => {
1
+ import { j as t } from "../jsx-runtime-OVHDjVDe.js";
2
+ import * as n from "react";
3
+ import { C as I, a as L } from "../ChevronRight-DQD188LX.js";
4
+ import { Box as s, IconButton as R } from "@mui/material";
5
+ import v from "../s-lazy-image/s-lazy-image.js";
6
+ const C = n.forwardRef(
7
+ ({ sx: x, leftImage: g, rightImage: b, altLeft: w = "Left image", altRight: j = "Right image", initialPosition: y = 50, ...E }, r) => {
8
+ const [i, S] = n.useState(y), [o, d] = n.useState(!1), l = n.useRef(null), u = (e) => {
8
9
  if (!l.current) return;
9
- const p = l.current.getBoundingClientRect();
10
- let c = (t - p.left) / p.width * 100;
10
+ const f = l.current.getBoundingClientRect();
11
+ let c = (e - f.left) / f.width * 100;
11
12
  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 = () => {
13
+ }, m = (e) => {
14
+ o && u(e.clientX);
15
+ }, h = (e) => {
16
+ o && u(e.touches[0].clientX);
17
+ }, p = () => {
17
18
  d(!0);
18
19
  }, a = () => {
19
20
  d(!1);
20
21
  };
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
+ return n.useEffect(() => (o ? (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
23
  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,
24
+ }), [o]), /* @__PURE__ */ t.jsxs(
25
+ s,
25
26
  {
26
- ref: (t) => {
27
- l.current = t, typeof i == "function" ? i(t) : i && (i.current = t);
27
+ ref: (e) => {
28
+ l.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
28
29
  },
29
30
  sx: {
30
31
  position: "relative",
@@ -35,19 +36,18 @@ const R = s.forwardRef(
35
36
  "&:hover .slider-handle": {
36
37
  transform: "translate(-50%, -50%) scale(1.05)"
37
38
  },
38
- ...f
39
+ ...x
39
40
  },
40
- onMouseDown: x,
41
- onTouchStart: x,
41
+ onMouseDown: p,
42
+ onTouchStart: p,
42
43
  ...E,
43
44
  children: [
44
- /* @__PURE__ */ e.jsx(
45
- o,
45
+ /* @__PURE__ */ t.jsx(
46
+ v,
46
47
  {
47
- component: "img",
48
- src: g,
49
- alt: w,
50
- sx: {
48
+ src: b,
49
+ alt: j,
50
+ style: {
51
51
  position: "absolute",
52
52
  inset: 0,
53
53
  width: "100%",
@@ -58,8 +58,8 @@ const R = s.forwardRef(
58
58
  draggable: !1
59
59
  }
60
60
  ),
61
- /* @__PURE__ */ e.jsx(
62
- o,
61
+ /* @__PURE__ */ t.jsx(
62
+ s,
63
63
  {
64
64
  sx: {
65
65
  position: "absolute",
@@ -68,15 +68,14 @@ const R = s.forwardRef(
68
68
  height: "100%",
69
69
  overflow: "hidden",
70
70
  pointerEvents: "none",
71
- clipPath: `polygon(0 0, ${r}% 0, ${r}% 100%, 0 100%)`
71
+ clipPath: `polygon(0 0, ${i}% 0, ${i}% 100%, 0 100%)`
72
72
  },
73
- children: /* @__PURE__ */ e.jsx(
74
- o,
73
+ children: /* @__PURE__ */ t.jsx(
74
+ v,
75
75
  {
76
- component: "img",
77
- src: v,
78
- alt: b,
79
- sx: {
76
+ src: g,
77
+ alt: w,
78
+ style: {
80
79
  width: "100%",
81
80
  height: "100%",
82
81
  objectFit: "cover"
@@ -86,8 +85,8 @@ const R = s.forwardRef(
86
85
  )
87
86
  }
88
87
  ),
89
- /* @__PURE__ */ e.jsxs(
90
- o,
88
+ /* @__PURE__ */ t.jsxs(
89
+ s,
91
90
  {
92
91
  sx: {
93
92
  position: "absolute",
@@ -95,11 +94,11 @@ const R = s.forwardRef(
95
94
  height: "100%",
96
95
  width: "4px",
97
96
  cursor: "ew-resize",
98
- left: `calc(${r}% - 2px)`
97
+ left: `calc(${i}% - 2px)`
99
98
  },
100
99
  children: [
101
- /* @__PURE__ */ e.jsx(
102
- o,
100
+ /* @__PURE__ */ t.jsx(
101
+ s,
103
102
  {
104
103
  sx: {
105
104
  position: "absolute",
@@ -110,8 +109,8 @@ const R = s.forwardRef(
110
109
  }
111
110
  }
112
111
  ),
113
- /* @__PURE__ */ e.jsx(
114
- L,
112
+ /* @__PURE__ */ t.jsx(
113
+ R,
115
114
  {
116
115
  className: "slider-handle",
117
116
  sx: {
@@ -124,20 +123,23 @@ const R = s.forwardRef(
124
123
  backdropFilter: "blur(10px)",
125
124
  boxShadow: 3,
126
125
  transition: "all 0.3s ease-in-out",
127
- ...n && {
126
+ ...o && {
128
127
  transform: "translate(-50%, -50%) scale(1.05)",
129
128
  boxShadow: 6
130
129
  }
131
130
  },
132
131
  role: "slider",
133
- "aria-valuenow": r,
132
+ "aria-valuenow": i,
134
133
  "aria-valuemin": 0,
135
134
  "aria-valuemax": 100,
136
135
  "aria-orientation": "horizontal",
137
136
  "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 } })
137
+ onClick: (e) => {
138
+ e.preventDefault(), e.stopPropagation();
139
+ },
140
+ children: /* @__PURE__ */ t.jsxs(s, { sx: { display: "flex", alignItems: "center" }, children: [
141
+ /* @__PURE__ */ t.jsx(I, { sx: { fontSize: 20 } }),
142
+ /* @__PURE__ */ t.jsx(L, { sx: { fontSize: 20 } })
141
143
  ] })
142
144
  }
143
145
  )
@@ -149,7 +151,7 @@ const R = s.forwardRef(
149
151
  );
150
152
  }
151
153
  );
152
- R.displayName = "SImageComparison";
154
+ C.displayName = "SImageComparison";
153
155
  export {
154
- R as default
156
+ C as default
155
157
  };
@@ -35,6 +35,7 @@ const u = l(/* @__PURE__ */ i.jsx("path", {
35
35
  MuiIconButton: {
36
36
  styleOverrides: {
37
37
  root: ({ theme: o }) => ({
38
+ color: "var(--s-palette-text-primary)",
38
39
  boxShadow: "none",
39
40
  textTransform: "none",
40
41
  fontWeight: o.typography.fontWeightMedium,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.116",
6
+ "version": "1.0.117",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",