@solostylist/ui-kit 1.0.143 → 1.0.145

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.
@@ -14,7 +14,7 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
14
14
  }), "InsertDriveFile"), G = x(/* @__PURE__ */ r.jsx("path", {
15
15
  d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"
16
16
  }), "Refresh"), _ = ({
17
- message: f,
17
+ message: h,
18
18
  variant: w = "received",
19
19
  timestamp: g,
20
20
  avatar: u,
@@ -25,7 +25,7 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
25
25
  attachments: m = [],
26
26
  onAttachmentClick: t,
27
27
  onDownload: n,
28
- hasError: h = !1,
28
+ hasError: f = !1,
29
29
  errorMessage: T = "Failed to send message",
30
30
  onRetry: v,
31
31
  sx: B,
@@ -93,11 +93,11 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
93
93
  backgroundColor: i ? "primary.main" : "",
94
94
  color: i ? "primary.contrastText" : "text.primary",
95
95
  border: i ? "none" : "1px solid",
96
- borderColor: h ? "error.main" : "divider",
96
+ borderColor: f ? "error.main" : "divider",
97
97
  ...i && {
98
98
  backgroundColor: "primary.dark"
99
99
  },
100
- ...h && {
100
+ ...f && {
101
101
  opacity: 0.7
102
102
  },
103
103
  overflow: "hidden"
@@ -219,7 +219,7 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
219
219
  },
220
220
  e.id
221
221
  )) }),
222
- f && /* @__PURE__ */ r.jsx(o, { sx: { px: 2, py: 1.5, pt: m.length > 0 ? 0 : 1.5 }, children: /* @__PURE__ */ r.jsx(
222
+ h && /* @__PURE__ */ r.jsx(o, { sx: { px: 2, py: 1.5, pt: m.length > 0 ? 0 : 1.5 }, children: /* @__PURE__ */ r.jsx(
223
223
  s,
224
224
  {
225
225
  variant: "body2",
@@ -228,7 +228,7 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
228
228
  lineHeight: 1.4,
229
229
  whiteSpace: "pre-wrap"
230
230
  },
231
- children: f
231
+ children: h
232
232
  }
233
233
  ) })
234
234
  ]
@@ -247,7 +247,7 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
247
247
  children: H(g)
248
248
  }
249
249
  ),
250
- h && /* @__PURE__ */ r.jsxs(
250
+ f && /* @__PURE__ */ r.jsxs(
251
251
  o,
252
252
  {
253
253
  display: "flex",
@@ -259,33 +259,19 @@ const A = x(/* @__PURE__ */ r.jsx("path", {
259
259
  mr: i ? 0.5 : 0
260
260
  },
261
261
  children: [
262
- /* @__PURE__ */ r.jsx(P, { sx: { fontSize: "0.875rem" } }),
262
+ /* @__PURE__ */ r.jsx(P, { sx: { fontSize: "1rem" } }),
263
263
  /* @__PURE__ */ r.jsx(
264
264
  s,
265
265
  {
266
266
  variant: "caption",
267
267
  sx: {
268
- fontSize: "0.75rem",
268
+ fontSize: "0.875rem",
269
269
  fontWeight: 500
270
270
  },
271
271
  children: T
272
272
  }
273
273
  ),
274
- v && /* @__PURE__ */ r.jsx(
275
- b,
276
- {
277
- size: "small",
278
- onClick: v,
279
- sx: {
280
- color: "error.main",
281
- padding: 0.25,
282
- "&:hover": {
283
- backgroundColor: "error.light"
284
- }
285
- },
286
- children: /* @__PURE__ */ r.jsx(G, { sx: { fontSize: "0.875rem" } })
287
- }
288
- )
274
+ v && /* @__PURE__ */ r.jsx(b, { size: "small", onClick: v, children: /* @__PURE__ */ r.jsx(G, {}) })
289
275
  ]
290
276
  }
291
277
  )
@@ -12,10 +12,12 @@ export interface SCommentMessageProps {
12
12
  totalReplies?: number;
13
13
  onLike?: (commentId: string | number) => void;
14
14
  onReply?: (commentId: string | number, parentId?: string | number) => void;
15
+ onToggleReplies?: (commentId: string | number) => void;
15
16
  showReplies?: boolean;
16
17
  avatarSize?: number;
17
18
  level?: number;
18
19
  maxLevel?: number;
20
+ loading?: boolean;
19
21
  children?: React.ReactNode;
20
22
  sx?: SxProps;
21
23
  }
@@ -1,105 +1,125 @@
1
1
  import { j as t } from "../jsx-runtime-OVHDjVDe.js";
2
- import { useState as y, useEffect as E } from "react";
3
- import { Box as m, Stack as M, Typography as d, IconButton as P, Button as R, Collapse as V } from "@mui/material";
4
- import Y from "../s-avatar/s-avatar.js";
5
- import { F as q } from "../Favorite-DmSF47XC.js";
6
- import { c as S } from "../createSvgIcon-Dq42_0tn.js";
7
- import { E as G } from "../ExpandMore-mZGpvXf6.js";
8
- const J = S(/* @__PURE__ */ t.jsx("path", {
2
+ import { useState as S, useEffect as R } from "react";
3
+ import { Box as c, Stack as x, Typography as g, IconButton as q, Button as F, Collapse as G } from "@mui/material";
4
+ import J from "../s-avatar/s-avatar.js";
5
+ import e from "../s-skeleton/s-skeleton.js";
6
+ import { F as K } from "../Favorite-DmSF47XC.js";
7
+ import { c as L } from "../createSvgIcon-Dq42_0tn.js";
8
+ import { E as O } from "../ExpandMore-mZGpvXf6.js";
9
+ const Q = L(/* @__PURE__ */ t.jsx("path", {
9
10
  d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
10
- }), "ExpandLess"), K = S(/* @__PURE__ */ t.jsx("path", {
11
+ }), "ExpandLess"), U = L(/* @__PURE__ */ t.jsx("path", {
11
12
  d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
12
- }), "FavoriteBorder"), O = S(/* @__PURE__ */ t.jsx("path", {
13
+ }), "FavoriteBorder"), X = L(/* @__PURE__ */ t.jsx("path", {
13
14
  d: "M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11"
14
- }), "Reply"), Q = (a) => {
15
- const c = /* @__PURE__ */ new Date(), x = typeof a == "string" ? new Date(a) : a, h = c.getTime() - x.getTime(), f = Math.floor(h / 1e3), s = Math.floor(f / 60), o = Math.floor(s / 60), e = Math.floor(o / 24), l = Math.floor(e / 7), n = Math.floor(e / 30), r = Math.floor(e / 365);
16
- return f < 60 ? "just now" : s < 60 ? s === 1 ? "1 minute ago" : `${s} minutes ago` : o < 24 ? o === 1 ? "1 hour ago" : `${o} hours ago` : e < 7 ? e === 1 ? "1 day ago" : `${e} days ago` : l < 4 ? l === 1 ? "1 week ago" : `${l} weeks ago` : n < 12 ? n === 1 ? "1 month ago" : `${n} months ago` : r === 1 ? "1 year ago" : `${r} years ago`;
17
- }, U = ({
18
- id: a = Date.now(),
19
- userName: c,
20
- userAvatar: x,
21
- commentContent: h,
15
+ }), "Reply"), Z = (i) => {
16
+ const d = /* @__PURE__ */ new Date(), j = typeof i == "string" ? new Date(i) : i, p = d.getTime() - j.getTime(), f = Math.floor(p / 1e3), n = Math.floor(f / 60), o = Math.floor(n / 60), s = Math.floor(o / 24), h = Math.floor(s / 7), r = Math.floor(s / 30), a = Math.floor(s / 365);
17
+ return f < 60 ? "just now" : n < 60 ? n === 1 ? "1 minute ago" : `${n} minutes ago` : o < 24 ? o === 1 ? "1 hour ago" : `${o} hours ago` : s < 7 ? s === 1 ? "1 day ago" : `${s} days ago` : h < 4 ? h === 1 ? "1 week ago" : `${h} weeks ago` : r < 12 ? r === 1 ? "1 month ago" : `${r} months ago` : a === 1 ? "1 year ago" : `${a} years ago`;
18
+ }, _ = ({
19
+ id: i = Date.now(),
20
+ userName: d,
21
+ userAvatar: j,
22
+ commentContent: p,
22
23
  datetime: f,
23
- likes: s = 0,
24
+ likes: n = 0,
24
25
  isLiked: o = !1,
25
- replies: e = [],
26
- totalReplies: l,
27
- onLike: n,
28
- onReply: r,
29
- showReplies: p = !0,
30
- avatarSize: L = 48,
31
- level: w = 0,
26
+ replies: s = [],
27
+ totalReplies: h,
28
+ onLike: r,
29
+ onReply: a,
30
+ onToggleReplies: C,
31
+ showReplies: u = !0,
32
+ avatarSize: m = 48,
33
+ level: b = 0,
32
34
  maxLevel: z = 3,
33
- children: C,
34
- sx: B = {}
35
+ loading: T = !1,
36
+ children: k,
37
+ sx: $ = {}
35
38
  }) => {
36
- const [$, g] = y(s), [j, u] = y(o), [I, D] = y(!1), T = () => {
37
- j ? (g((i) => Math.max(0, i - 1)), u(!1)) : (g((i) => i + 1), u(!0)), n && n(a);
38
- }, b = () => {
39
- r && r(a);
40
- }, F = () => {
41
- D(!I);
42
- }, H = Q(f), v = l ?? e.length, k = v > 0, W = Math.min(w, z) * 2;
43
- return E(() => {
44
- g(s);
45
- }, [s]), E(() => {
46
- u(o);
47
- }, [o]), /* @__PURE__ */ t.jsxs(m, { sx: { pl: W, py: 1, ...B }, children: [
48
- /* @__PURE__ */ t.jsxs(M, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
49
- /* @__PURE__ */ t.jsx(Y, { avatar: x, name: c, size: L }),
50
- /* @__PURE__ */ t.jsxs(m, { sx: { flex: 1 }, children: [
51
- /* @__PURE__ */ t.jsxs(M, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
52
- /* @__PURE__ */ t.jsx(d, { variant: "subtitle2", fontWeight: "600", children: c }),
53
- /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(d, { variant: "caption", color: "text.secondary", children: H }) })
39
+ const [E, v] = S(n), [w, I] = S(o), [y, H] = S(!1), W = () => {
40
+ w ? (v((l) => Math.max(0, l - 1)), I(!1)) : (v((l) => l + 1), I(!0)), r && r(i);
41
+ }, A = () => {
42
+ a && a(i);
43
+ }, P = () => {
44
+ H(!y), C && C(i);
45
+ }, V = Z(f), M = h ?? s.length, B = M > 0, D = Math.min(b, z) * 2;
46
+ return R(() => {
47
+ v(n);
48
+ }, [n]), R(() => {
49
+ I(o);
50
+ }, [o]), T ? /* @__PURE__ */ t.jsx(c, { sx: { pl: D, py: 1, ...$ }, children: /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
51
+ /* @__PURE__ */ t.jsx(e, { component: "rounded-avatar", width: m, height: m }),
52
+ /* @__PURE__ */ t.jsxs(c, { sx: { flex: 1 }, children: [
53
+ /* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
54
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: 120, height: 20 }),
55
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 16 })
56
+ ] }),
57
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
58
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: "85%", height: 16, sx: { mb: 0.5 } }),
59
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: "70%", height: 16, sx: { mb: 2 } }),
60
+ /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 1, alignItems: "center", children: [
61
+ /* @__PURE__ */ t.jsx(e, { component: "icon-button" }),
62
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: 20, height: 16 }),
63
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: 60, height: 32 }),
64
+ /* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 32 })
65
+ ] })
66
+ ] })
67
+ ] }) }) : /* @__PURE__ */ t.jsxs(c, { sx: { pl: D, py: 1, ...$ }, children: [
68
+ /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
69
+ /* @__PURE__ */ t.jsx(J, { avatar: j, name: d, size: m }),
70
+ /* @__PURE__ */ t.jsxs(c, { sx: { flex: 1 }, children: [
71
+ /* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
72
+ /* @__PURE__ */ t.jsx(g, { variant: "subtitle2", fontWeight: "600", children: d }),
73
+ /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(g, { variant: "caption", color: "text.secondary", children: V }) })
54
74
  ] }),
55
- /* @__PURE__ */ t.jsx(d, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: h }),
56
- /* @__PURE__ */ t.jsxs(M, { direction: "row", spacing: 1, alignItems: "center", children: [
75
+ /* @__PURE__ */ t.jsx(g, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: p }),
76
+ /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 1, alignItems: "center", children: [
57
77
  /* @__PURE__ */ t.jsx(
58
- P,
78
+ q,
59
79
  {
60
80
  size: "small",
61
- onClick: T,
81
+ onClick: W,
62
82
  sx: {
63
- color: j ? "error.main" : "text.secondary"
83
+ color: w ? "error.main" : "text.secondary"
64
84
  },
65
- children: j ? /* @__PURE__ */ t.jsx(q, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(K, { fontSize: "small" })
85
+ children: w ? /* @__PURE__ */ t.jsx(K, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(U, { fontSize: "small" })
66
86
  }
67
87
  ),
68
- $ > 0 && /* @__PURE__ */ t.jsx(d, { variant: "caption", color: "text.secondary", children: $ }),
69
- /* @__PURE__ */ t.jsx(R, { size: "small", startIcon: /* @__PURE__ */ t.jsx(O, { fontSize: "small" }), onClick: b, variant: "text", children: "Reply" }),
70
- k && p && /* @__PURE__ */ t.jsxs(
71
- R,
88
+ E > 0 && /* @__PURE__ */ t.jsx(g, { variant: "caption", color: "text.secondary", children: E }),
89
+ /* @__PURE__ */ t.jsx(F, { size: "small", startIcon: /* @__PURE__ */ t.jsx(X, { fontSize: "small" }), onClick: A, variant: "text", children: "Reply" }),
90
+ B && u && /* @__PURE__ */ t.jsxs(
91
+ F,
72
92
  {
73
93
  size: "small",
74
- startIcon: I ? /* @__PURE__ */ t.jsx(J, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(G, { fontSize: "small" }),
75
- onClick: F,
94
+ startIcon: y ? /* @__PURE__ */ t.jsx(Q, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(O, { fontSize: "small" }),
95
+ onClick: P,
76
96
  variant: "text",
77
97
  children: [
78
- v,
98
+ M,
79
99
  " ",
80
- v === 1 ? "reply" : "replies"
100
+ M === 1 ? "reply" : "replies"
81
101
  ]
82
102
  }
83
103
  )
84
104
  ] }),
85
- C && /* @__PURE__ */ t.jsx(m, { sx: { mt: 2 }, children: C })
105
+ k && /* @__PURE__ */ t.jsx(c, { sx: { mt: 2 }, children: k })
86
106
  ] })
87
107
  ] }),
88
- k && p && /* @__PURE__ */ t.jsx(V, { in: I, children: /* @__PURE__ */ t.jsx(m, { sx: { mt: 2 }, children: e.map((i, A) => /* @__PURE__ */ t.jsx(
89
- U,
108
+ B && u && /* @__PURE__ */ t.jsx(G, { in: y, children: /* @__PURE__ */ t.jsx(c, { sx: { mt: 2 }, children: s.map((l, Y) => /* @__PURE__ */ t.jsx(
109
+ _,
90
110
  {
91
- ...i,
92
- level: w + 1,
111
+ ...l,
112
+ level: b + 1,
93
113
  maxLevel: z,
94
- onLike: n,
95
- onReply: r,
96
- showReplies: p,
97
- avatarSize: Math.max(32, L - 8)
114
+ onLike: r,
115
+ onReply: a,
116
+ showReplies: u,
117
+ avatarSize: Math.max(32, m - 8)
98
118
  },
99
- i.id || `reply-${A}`
119
+ l.id || `reply-${Y}`
100
120
  )) }) })
101
121
  ] });
102
122
  };
103
123
  export {
104
- U as default
124
+ _ as default
105
125
  };
@@ -16,6 +16,8 @@ export interface SReviewProps {
16
16
  avatarSize?: number;
17
17
  maxRating?: number;
18
18
  readOnly?: boolean;
19
+ showDivider?: boolean;
20
+ loading?: boolean;
19
21
  sx?: SxProps;
20
22
  }
21
23
  declare const SReview: React.FC<SReviewProps>;
@@ -1,70 +1,93 @@
1
1
  import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
- import { useState as g, useEffect as A } from "react";
3
- import { Box as b, Stack as p, Typography as i, IconButton as T, Divider as F } from "@mui/material";
4
- import N from "../s-avatar/s-avatar.js";
5
- import q from "../s-image-modal/s-image-modal.js";
6
- import G from "../s-lazy-image/s-lazy-image.js";
7
- import J from "../s-rating/s-rating.js";
8
- import { c as $ } from "../createSvgIcon-Dq42_0tn.js";
9
- const K = $(/* @__PURE__ */ e.jsx("path", {
2
+ import { useState as j, useEffect as G } from "react";
3
+ import { Box as h, Stack as a, Divider as D, Typography as x, IconButton as H } from "@mui/material";
4
+ import J from "../s-avatar/s-avatar.js";
5
+ import K from "../s-image-modal/s-image-modal.js";
6
+ import P from "../s-lazy-image/s-lazy-image.js";
7
+ import Q from "../s-rating/s-rating.js";
8
+ import r from "../s-skeleton/s-skeleton.js";
9
+ import { c as L } from "../createSvgIcon-Dq42_0tn.js";
10
+ const X = L(/* @__PURE__ */ e.jsx("path", {
10
11
  d: "M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2m4 0v12h4V3z"
11
- }), "ThumbDown"), P = $(/* @__PURE__ */ e.jsx("path", {
12
+ }), "ThumbDown"), Z = L(/* @__PURE__ */ e.jsx("path", {
12
13
  d: "M1 21h4V9H1zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73z"
13
- }), "ThumbUp"), Q = (r) => {
14
- const c = /* @__PURE__ */ new Date(), y = typeof r == "string" ? new Date(r) : r, j = c.getTime() - y.getTime(), u = Math.floor(j / 1e3), l = Math.floor(u / 60), s = Math.floor(l / 60), a = Math.floor(s / 24), h = Math.floor(a / 7), m = Math.floor(a / 30), f = Math.floor(a / 365);
15
- return u < 60 ? "just now" : l < 60 ? l === 1 ? "1 minute ago" : `${l} minutes ago` : s < 24 ? s === 1 ? "1 hour ago" : `${s} hours ago` : a < 7 ? a === 1 ? "1 day ago" : `${a} days ago` : h < 4 ? h === 1 ? "1 week ago" : `${h} weeks ago` : m < 12 ? m === 1 ? "1 month ago" : `${m} months ago` : f === 1 ? "1 year ago" : `${f} years ago`;
16
- }, ae = ({
17
- id: r = Date.now(),
18
- userName: c,
19
- userAvatar: y,
20
- rating: j,
21
- reviewContent: u,
22
- datetime: l,
14
+ }), "ThumbUp"), _ = (l) => {
15
+ const m = /* @__PURE__ */ new Date(), v = typeof l == "string" ? new Date(l) : l, y = m.getTime() - v.getTime(), w = Math.floor(y / 1e3), c = Math.floor(w / 60), s = Math.floor(c / 60), i = Math.floor(s / 24), d = Math.floor(i / 7), f = Math.floor(i / 30), g = Math.floor(i / 365);
16
+ return w < 60 ? "just now" : c < 60 ? c === 1 ? "1 minute ago" : `${c} minutes ago` : s < 24 ? s === 1 ? "1 hour ago" : `${s} hours ago` : i < 7 ? i === 1 ? "1 day ago" : `${i} days ago` : d < 4 ? d === 1 ? "1 week ago" : `${d} weeks ago` : f < 12 ? f === 1 ? "1 month ago" : `${f} months ago` : g === 1 ? "1 year ago" : `${g} years ago`;
17
+ }, ce = ({
18
+ id: l = Date.now(),
19
+ userName: m,
20
+ userAvatar: v,
21
+ rating: y,
22
+ reviewContent: w,
23
+ datetime: c,
23
24
  images: s,
24
- userHelpfulVote: a = null,
25
- helpfulYes: h = 0,
26
- helpfulNo: m = 0,
27
- onHelpfulVote: f,
28
- showHelpfulSection: k = !0,
29
- avatarSize: z = 48,
30
- maxRating: D = 5,
31
- readOnly: H = !0,
32
- sx: L = {}
25
+ userHelpfulVote: i = null,
26
+ helpfulYes: d = 0,
27
+ helpfulNo: f = 0,
28
+ onHelpfulVote: g,
29
+ showHelpfulSection: R = !0,
30
+ avatarSize: I = 48,
31
+ maxRating: V = 5,
32
+ readOnly: W = !0,
33
+ showDivider: S = !0,
34
+ loading: E = !1,
35
+ sx: T = {}
33
36
  }) => {
34
- const [R, v] = g(h), [V, w] = g(m), [d, I] = g(a), [W, C] = g(!1), [E, M] = g(null), S = (t) => {
35
- let n = t;
36
- d === t ? (t === "yes" ? v((o) => Math.max(0, o - 1)) : w((o) => Math.max(0, o - 1)), I(null), n = null) : (d === "yes" ? v((o) => Math.max(0, o - 1)) : d === "no" && w((o) => Math.max(0, o - 1)), t === "yes" ? v((o) => o + 1) : w((o) => o + 1), I(t), n = t), f && f(r, n);
37
- }, x = (s == null ? void 0 : s.map((t, n) => ({
38
- id: `review-${r}-image-${n}`,
37
+ const [O, M] = j(d), [U, b] = j(f), [p, k] = j(i), [Y, $] = j(!1), [B, C] = j(null), z = (n) => {
38
+ let o = n;
39
+ p === n ? (n === "yes" ? M((t) => Math.max(0, t - 1)) : b((t) => Math.max(0, t - 1)), k(null), o = null) : (p === "yes" ? M((t) => Math.max(0, t - 1)) : p === "no" && b((t) => Math.max(0, t - 1)), n === "yes" ? M((t) => t + 1) : b((t) => t + 1), k(n), o = n), g && g(l, o);
40
+ }, u = (s == null ? void 0 : s.map((n, o) => ({
41
+ id: `review-${l}-image-${o}`,
39
42
  type: "image",
40
- url: t,
41
- title: `Review image ${n + 1}`,
42
- desc: `Image ${n + 1} from ${c}'s review`
43
- }))) || [], O = (t) => {
44
- const n = x[t];
45
- n && (M(n), C(!0));
46
- }, U = () => {
47
- C(!1), M(null);
48
- }, Y = (t) => {
49
- M(t);
50
- }, B = Q(l);
51
- return A(() => {
52
- I(a);
53
- }, [a]), /* @__PURE__ */ e.jsxs(b, { sx: { py: 2, ...L }, children: [
54
- /* @__PURE__ */ e.jsxs(p, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
55
- /* @__PURE__ */ e.jsx(N, { avatar: y, name: c, size: z }),
56
- /* @__PURE__ */ e.jsxs(b, { sx: { flex: 1 }, children: [
57
- /* @__PURE__ */ e.jsxs(p, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
58
- /* @__PURE__ */ e.jsx(i, { variant: "subtitle2", fontWeight: "600", children: c }),
59
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(i, { variant: "caption", color: "text.secondary", children: B }) })
43
+ url: n,
44
+ title: `Review image ${o + 1}`,
45
+ desc: `Image ${o + 1} from ${m}'s review`
46
+ }))) || [], A = (n) => {
47
+ const o = u[n];
48
+ o && (C(o), $(!0));
49
+ }, F = () => {
50
+ $(!1), C(null);
51
+ }, N = (n) => {
52
+ C(n);
53
+ }, q = _(c);
54
+ return G(() => {
55
+ k(i);
56
+ }, [i]), E ? /* @__PURE__ */ e.jsxs(h, { sx: { py: 2, ...T }, children: [
57
+ /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
58
+ /* @__PURE__ */ e.jsx(r, { component: "rounded-avatar", width: I, height: I }),
59
+ /* @__PURE__ */ e.jsxs(h, { sx: { flex: 1 }, children: [
60
+ /* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
61
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: 120, height: 20 }),
62
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: 80, height: 16 })
60
63
  ] }),
61
- /* @__PURE__ */ e.jsx(b, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(J, { value: j, max: D, readOnly: H, size: "small" }) }),
62
- /* @__PURE__ */ e.jsx(i, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: u }),
63
- s && s.length > 0 && /* @__PURE__ */ e.jsx(p, { direction: "row", spacing: 1, sx: { mb: 2, flexWrap: "wrap", gap: 1 }, children: s.map((t, n) => /* @__PURE__ */ e.jsx(
64
- G,
64
+ /* @__PURE__ */ e.jsx(h, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(r, { variant: "text", width: 100, height: 20 }) }),
65
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
66
+ /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
67
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: 140, height: 16, sx: { mr: 2 } }),
68
+ /* @__PURE__ */ e.jsx(r, { component: "icon-button" }),
69
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: 20, height: 16 }),
70
+ /* @__PURE__ */ e.jsx(r, { component: "icon-button" }),
71
+ /* @__PURE__ */ e.jsx(r, { variant: "text", width: 20, height: 16 })
72
+ ] })
73
+ ] })
74
+ ] }),
75
+ S && /* @__PURE__ */ e.jsx(D, { sx: { mt: 2 } })
76
+ ] }) : /* @__PURE__ */ e.jsxs(h, { sx: { py: 2, ...T }, children: [
77
+ /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
78
+ /* @__PURE__ */ e.jsx(J, { avatar: v, name: m, size: I }),
79
+ /* @__PURE__ */ e.jsxs(h, { sx: { flex: 1 }, children: [
80
+ /* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
81
+ /* @__PURE__ */ e.jsx(x, { variant: "subtitle2", fontWeight: "600", children: m }),
82
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(x, { variant: "caption", color: "text.secondary", children: q }) })
83
+ ] }),
84
+ /* @__PURE__ */ e.jsx(h, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(Q, { value: y, max: V, readOnly: W, size: "small" }) }),
85
+ /* @__PURE__ */ e.jsx(x, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: w }),
86
+ s && s.length > 0 && /* @__PURE__ */ e.jsx(a, { direction: "row", spacing: 1, sx: { mb: 2, flexWrap: "wrap", gap: 1 }, children: s.map((n, o) => /* @__PURE__ */ e.jsx(
87
+ P,
65
88
  {
66
- src: t,
67
- alt: `Review image ${n + 1}`,
89
+ src: n,
90
+ alt: `Review image ${o + 1}`,
68
91
  width: 80,
69
92
  height: 80,
70
93
  variant: "rounded",
@@ -72,68 +95,68 @@ const K = $(/* @__PURE__ */ e.jsx("path", {
72
95
  objectFit: "cover",
73
96
  cursor: "pointer"
74
97
  },
75
- onClick: () => O(n),
76
- onMouseEnter: (o) => {
77
- o.currentTarget.style.opacity = "0.8";
98
+ onClick: () => A(o),
99
+ onMouseEnter: (t) => {
100
+ t.currentTarget.style.opacity = "0.8";
78
101
  },
79
- onMouseLeave: (o) => {
80
- o.currentTarget.style.opacity = "1";
102
+ onMouseLeave: (t) => {
103
+ t.currentTarget.style.opacity = "1";
81
104
  }
82
105
  },
83
- n
106
+ o
84
107
  )) }),
85
- k && /* @__PURE__ */ e.jsxs(p, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
86
- /* @__PURE__ */ e.jsx(i, { variant: "caption", color: "text.secondary", sx: { mr: 2 }, children: "Was this review helpful?" }),
108
+ R && /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
109
+ /* @__PURE__ */ e.jsx(x, { variant: "caption", color: "text.secondary", sx: { mr: 2 }, children: "Was this review helpful?" }),
87
110
  /* @__PURE__ */ e.jsx(
88
- T,
111
+ H,
89
112
  {
90
113
  size: "small",
91
- onClick: () => S("yes"),
114
+ onClick: () => z("yes"),
92
115
  sx: {
93
- color: d === "yes" ? "primary.main" : "text.secondary",
116
+ color: p === "yes" ? "primary.main" : "text.secondary",
94
117
  "&:hover": {
95
118
  backgroundColor: "action.hover"
96
119
  }
97
120
  },
98
- children: /* @__PURE__ */ e.jsx(P, { fontSize: "small" })
121
+ children: /* @__PURE__ */ e.jsx(Z, { fontSize: "small" })
99
122
  }
100
123
  ),
101
- /* @__PURE__ */ e.jsx(i, { variant: "caption", color: "text.secondary", children: R }),
124
+ /* @__PURE__ */ e.jsx(x, { variant: "caption", color: "text.secondary", children: O }),
102
125
  /* @__PURE__ */ e.jsx(
103
- T,
126
+ H,
104
127
  {
105
128
  size: "small",
106
- onClick: () => S("no"),
129
+ onClick: () => z("no"),
107
130
  sx: {
108
- color: d === "no" ? "error.main" : "text.secondary",
131
+ color: p === "no" ? "error.main" : "text.secondary",
109
132
  ml: 1,
110
133
  "&:hover": {
111
134
  backgroundColor: "action.hover"
112
135
  }
113
136
  },
114
- children: /* @__PURE__ */ e.jsx(K, { fontSize: "small" })
137
+ children: /* @__PURE__ */ e.jsx(X, { fontSize: "small" })
115
138
  }
116
139
  ),
117
- /* @__PURE__ */ e.jsx(i, { variant: "caption", color: "text.secondary", children: V })
140
+ /* @__PURE__ */ e.jsx(x, { variant: "caption", color: "text.secondary", children: U })
118
141
  ] })
119
142
  ] })
120
143
  ] }),
121
- /* @__PURE__ */ e.jsx(F, { sx: { mt: 2 } }),
144
+ S && /* @__PURE__ */ e.jsx(D, { sx: { mt: 2 } }),
122
145
  /* @__PURE__ */ e.jsx(
123
- q,
146
+ K,
124
147
  {
125
- isOpen: W,
126
- onClose: U,
127
- selectedItem: E,
128
- onItemChange: Y,
129
- mediaItems: x,
130
- showNavigation: x.length > 1,
131
- showThumbnailDock: x.length > 1,
132
- showCounter: x.length > 1
148
+ isOpen: Y,
149
+ onClose: F,
150
+ selectedItem: B,
151
+ onItemChange: N,
152
+ mediaItems: u,
153
+ showNavigation: u.length > 1,
154
+ showThumbnailDock: u.length > 1,
155
+ showCounter: u.length > 1
133
156
  }
134
157
  )
135
158
  ] });
136
159
  };
137
160
  export {
138
- ae as default
161
+ ce as default
139
162
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.143",
6
+ "version": "1.0.145",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",