@solostylist/ui-kit 1.0.101 → 1.0.102

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,71 +1,71 @@
1
1
  import { j as r } from "../jsx-runtime-DywqP_6a.js";
2
- import { forwardRef as F, useState as c, useRef as K, useId as O, useEffect as B } from "react";
3
- import { Box as t, outlinedInputClasses as T, Popper as W, ClickAwayListener as D } from "@mui/material";
4
- import H from "emoji-picker-react";
5
- import _ from "../s-file-icon/s-file-icon.js";
2
+ import { forwardRef as S, useState as c, useRef as K, useId as T, useEffect as B } from "react";
3
+ import { Box as s, outlinedInputClasses as D, Typography as E, Popper as W, ClickAwayListener as H } from "@mui/material";
4
+ import _ from "emoji-picker-react";
5
+ import q from "../s-file-icon/s-file-icon.js";
6
6
  import d from "../s-icon-button/s-icon-button.js";
7
- import q from "../s-text-field/s-text-field.js";
8
- import { C as G } from "../Close-DqRHeMAW.js";
9
- import { c as k } from "../createSvgIcon-DCQI9UV5.js";
10
- const J = k(/* @__PURE__ */ r.jsx("path", {
7
+ import G from "../s-text-field/s-text-field.js";
8
+ import { C as J } from "../Close-DqRHeMAW.js";
9
+ import { c as v } from "../createSvgIcon-DCQI9UV5.js";
10
+ const N = v(/* @__PURE__ */ r.jsx("path", {
11
11
  d: "m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"
12
- }), "ArrowUpward"), N = k(/* @__PURE__ */ r.jsx("path", {
12
+ }), "ArrowUpward"), Q = v(/* @__PURE__ */ r.jsx("path", {
13
13
  d: "M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"
14
- }), "AttachFile"), Q = k(/* @__PURE__ */ r.jsx("path", {
14
+ }), "AttachFile"), X = v(/* @__PURE__ */ r.jsx("path", {
15
15
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
16
- }), "EmojiEmotions"), ae = F(
17
- ({ onSubmit: p, onFileSelect: m, disabled: a, acceptedFileTypes: E, maxFileSize: C, ...z }, M) => {
18
- const [u, h] = c(""), [l, x] = c([]), [i, f] = c(/* @__PURE__ */ new Map()), [v, g] = c(!1), y = K(null), w = O(), b = (e) => e.type.startsWith("image/"), U = (e) => {
16
+ }), "EmojiEmotions"), ie = S(
17
+ ({ onSubmit: p, onFileSelect: m, disabled: a, acceptedFileTypes: M, maxFileSize: k, ...z }, U) => {
18
+ const [u, h] = c(""), [l, x] = c([]), [i, f] = c(/* @__PURE__ */ new Map()), [C, g] = c(!1), y = K(null), w = T(), b = (e) => e.type.startsWith("image/"), L = (e) => {
19
19
  const o = `${e.name}-${e.size}-${e.lastModified}`;
20
20
  if (i.has(o))
21
21
  return i.get(o);
22
22
  if (b(e)) {
23
23
  const n = URL.createObjectURL(e);
24
- return f((s) => new Map(s).set(o, n)), n;
24
+ return f((t) => new Map(t).set(o, n)), n;
25
25
  }
26
26
  return "";
27
- }, L = (e) => {
28
- h(e.target.value);
29
27
  }, $ = (e) => {
28
+ h(e.target.value);
29
+ }, P = (e) => {
30
30
  h((o) => o + e.emoji), g(!1);
31
- }, P = () => {
32
- g(!v);
31
+ }, V = () => {
32
+ g(!C);
33
33
  }, R = () => {
34
34
  a || u.trim().length === 0 && l.length === 0 || (p == null || p(u, l), h(""), i.forEach((e) => URL.revokeObjectURL(e)), f(/* @__PURE__ */ new Map()), x([]));
35
- }, S = (e) => {
36
- const n = Array.from(e.target.files || []).filter((s) => !(C && s.size > C));
37
- x((s) => [...s, ...n]), m == null || m(n), e.target.value = "";
38
- }, V = (e) => {
35
+ }, A = (e) => {
36
+ const n = Array.from(e.target.files || []).filter((t) => !(k && t.size > k));
37
+ x((t) => [...t, ...n]), m == null || m(n), e.target.value = "";
38
+ }, F = (e) => {
39
39
  const o = l[e];
40
40
  if (o && b(o)) {
41
- const n = `${o.name}-${o.size}-${o.lastModified}`, s = i.get(n);
42
- s && (URL.revokeObjectURL(s), f((j) => {
41
+ const n = `${o.name}-${o.size}-${o.lastModified}`, t = i.get(n);
42
+ t && (URL.revokeObjectURL(t), f((j) => {
43
43
  const I = new Map(j);
44
44
  return I.delete(n), I;
45
45
  }));
46
46
  }
47
- x((n) => n.filter((s, j) => j !== e));
48
- }, A = (e) => {
47
+ x((n) => n.filter((t, j) => j !== e));
48
+ }, O = (e) => {
49
49
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), R());
50
50
  };
51
51
  return B(() => () => {
52
52
  i.forEach((e) => URL.revokeObjectURL(e));
53
- }, [i]), /* @__PURE__ */ r.jsxs(t, { border: "1px solid", borderColor: "divider", borderRadius: 2, padding: "8px 12px", children: [
53
+ }, [i]), /* @__PURE__ */ r.jsxs(s, { border: "1px solid", borderColor: "divider", borderRadius: 2, padding: "8px 12px", children: [
54
54
  /* @__PURE__ */ r.jsx(
55
- q,
55
+ G,
56
56
  {
57
57
  placeholder: "Enter your message here...",
58
58
  disabled: a,
59
59
  value: u,
60
- onChange: L,
61
- onKeyDown: A,
60
+ onChange: $,
61
+ onKeyDown: O,
62
62
  multiline: !0,
63
63
  minRows: 1,
64
64
  maxRows: 10,
65
65
  size: "small",
66
66
  variant: "outlined",
67
67
  fullWidth: !0,
68
- inputRef: M,
68
+ inputRef: U,
69
69
  slotProps: {
70
70
  input: {
71
71
  sx: {
@@ -73,7 +73,7 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
73
73
  backgroundColor: "transparent",
74
74
  border: "none",
75
75
  padding: 0,
76
- [`&.${T.focused}`]: {
76
+ [`&.${D.focused}`]: {
77
77
  outline: "none"
78
78
  },
79
79
  "& fieldset": {
@@ -91,10 +91,10 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
91
91
  ...z
92
92
  }
93
93
  ),
94
- l.length > 0 && /* @__PURE__ */ r.jsx(t, { mt: 1, children: l.map((e, o) => {
95
- const n = b(e), s = e.name.split(".").pop();
94
+ l.length > 0 && /* @__PURE__ */ r.jsx(s, { mt: 1, children: l.map((e, o) => {
95
+ const n = b(e), t = e.name.split(".").pop();
96
96
  return /* @__PURE__ */ r.jsxs(
97
- t,
97
+ s,
98
98
  {
99
99
  display: "flex",
100
100
  alignItems: "center",
@@ -108,12 +108,12 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
108
108
  mb: 0.5
109
109
  },
110
110
  children: [
111
- /* @__PURE__ */ r.jsxs(t, { display: "flex", alignItems: "center", gap: 1, children: [
111
+ /* @__PURE__ */ r.jsxs(s, { display: "flex", alignItems: "center", gap: 1, children: [
112
112
  n ? /* @__PURE__ */ r.jsx(
113
- t,
113
+ s,
114
114
  {
115
115
  component: "img",
116
- src: U(e),
116
+ src: L(e),
117
117
  alt: e.name,
118
118
  sx: {
119
119
  width: 40,
@@ -124,31 +124,31 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
124
124
  borderColor: "divider"
125
125
  }
126
126
  }
127
- ) : /* @__PURE__ */ r.jsx(_, { extension: s }),
128
- /* @__PURE__ */ r.jsxs(t, { children: [
129
- /* @__PURE__ */ r.jsx(t, { component: "span", sx: { fontSize: "0.875rem", fontWeight: 500 }, children: e.name }),
130
- /* @__PURE__ */ r.jsxs(t, { component: "span", sx: { fontSize: "0.75rem", color: "text.secondary", ml: 1 }, children: [
127
+ ) : /* @__PURE__ */ r.jsx(q, { extension: t }),
128
+ /* @__PURE__ */ r.jsxs(s, { display: "flex", flexDirection: "row", alignItems: "center", gap: 1, children: [
129
+ /* @__PURE__ */ r.jsx(E, { variant: "subtitle2", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", children: e.name }),
130
+ /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs(E, { variant: "caption", color: "text.secondary", children: [
131
131
  "(",
132
132
  Math.round(e.size / 1024),
133
133
  " KB)"
134
- ] })
134
+ ] }) })
135
135
  ] })
136
136
  ] }),
137
- /* @__PURE__ */ r.jsx(d, { size: "small", onClick: () => V(o), sx: { minWidth: "auto", p: 0.5 }, children: /* @__PURE__ */ r.jsx(G, {}) })
137
+ /* @__PURE__ */ r.jsx(d, { size: "small", onClick: () => F(o), sx: { minWidth: "auto", p: 0.5 }, children: /* @__PURE__ */ r.jsx(J, {}) })
138
138
  ]
139
139
  },
140
140
  `${e.name}-${o}`
141
141
  );
142
142
  }) }),
143
- /* @__PURE__ */ r.jsxs(t, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 1, children: [
144
- /* @__PURE__ */ r.jsxs(t, { display: "flex", gap: 1, children: [
143
+ /* @__PURE__ */ r.jsxs(s, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 1, children: [
144
+ /* @__PURE__ */ r.jsxs(s, { display: "flex", gap: 1, children: [
145
145
  /* @__PURE__ */ r.jsx(
146
146
  "input",
147
147
  {
148
148
  type: "file",
149
149
  multiple: !0,
150
- accept: E,
151
- onChange: S,
150
+ accept: M,
151
+ onChange: A,
152
152
  style: { display: "none" },
153
153
  id: `file-attachment-input-${w}`,
154
154
  disabled: a
@@ -166,14 +166,14 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
166
166
  transform: "scale(1.1)"
167
167
  }
168
168
  },
169
- children: /* @__PURE__ */ r.jsx(N, {})
169
+ children: /* @__PURE__ */ r.jsx(Q, {})
170
170
  }
171
171
  ) }),
172
172
  /* @__PURE__ */ r.jsx(
173
173
  d,
174
174
  {
175
175
  ref: y,
176
- onClick: P,
176
+ onClick: V,
177
177
  disabled: a,
178
178
  size: "small",
179
179
  sx: {
@@ -182,7 +182,7 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
182
182
  transform: "scale(1.1)"
183
183
  }
184
184
  },
185
- children: /* @__PURE__ */ r.jsx(Q, {})
185
+ children: /* @__PURE__ */ r.jsx(X, {})
186
186
  }
187
187
  )
188
188
  ] }),
@@ -198,12 +198,12 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
198
198
  transform: "scale(1.2)"
199
199
  }
200
200
  },
201
- children: /* @__PURE__ */ r.jsx(J, {})
201
+ children: /* @__PURE__ */ r.jsx(N, {})
202
202
  }
203
203
  )
204
204
  ] }),
205
- /* @__PURE__ */ r.jsx(W, { open: v, anchorEl: y.current, placement: "top-start", sx: { zIndex: 1300 }, children: /* @__PURE__ */ r.jsx(D, { onClickAway: () => g(!1), children: /* @__PURE__ */ r.jsx(
206
- t,
205
+ /* @__PURE__ */ r.jsx(W, { open: C, anchorEl: y.current, placement: "top-start", sx: { zIndex: 1300 }, children: /* @__PURE__ */ r.jsx(H, { onClickAway: () => g(!1), children: /* @__PURE__ */ r.jsx(
206
+ s,
207
207
  {
208
208
  sx: {
209
209
  border: "1px solid",
@@ -293,9 +293,9 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
293
293
  }
294
294
  },
295
295
  children: /* @__PURE__ */ r.jsx(
296
- H,
296
+ _,
297
297
  {
298
- onEmojiClick: $,
298
+ onEmojiClick: P,
299
299
  width: 300,
300
300
  height: 400,
301
301
  searchDisabled: !1,
@@ -309,5 +309,5 @@ const J = k(/* @__PURE__ */ r.jsx("path", {
309
309
  }
310
310
  );
311
311
  export {
312
- ae as default
312
+ ie as default
313
313
  };
@@ -1,2 +1,2 @@
1
1
  export { default } from './s-chat-message';
2
- export type { SChatMessageProps } from './s-chat-message';
2
+ export type { SChatMessageProps, ChatAttachment } from './s-chat-message';
@@ -1,7 +1,16 @@
1
1
  import { default as React } from 'react';
2
2
  import { BoxProps } from '@mui/material';
3
+ export interface ChatAttachment {
4
+ id: string;
5
+ type: 'image' | 'file';
6
+ url: string;
7
+ name?: string;
8
+ size?: number;
9
+ mimeType?: string;
10
+ thumbnailUrl?: string;
11
+ }
3
12
  export interface SChatMessageProps extends Omit<BoxProps, 'children'> {
4
- message: string;
13
+ message?: string;
5
14
  variant?: 'sent' | 'received';
6
15
  timestamp?: string | Date;
7
16
  avatar?: string;
@@ -9,6 +18,9 @@ export interface SChatMessageProps extends Omit<BoxProps, 'children'> {
9
18
  showAvatar?: boolean;
10
19
  showTimestamp?: boolean;
11
20
  maxWidth?: string | number;
21
+ attachments?: ChatAttachment[];
22
+ onAttachmentClick?: (attachment: ChatAttachment) => void;
23
+ onDownload?: (attachment: ChatAttachment) => void;
12
24
  }
13
25
  declare const SChatMessage: React.FC<SChatMessageProps>;
14
26
  export default SChatMessage;
@@ -1,50 +1,69 @@
1
- import { j as e } from "../jsx-runtime-DywqP_6a.js";
2
- import { Box as o, Typography as n } from "@mui/material";
3
- import x from "../s-avatar/s-avatar.js";
4
- const b = ({
5
- message: d,
6
- variant: c = "received",
7
- timestamp: a,
8
- avatar: s,
9
- senderName: i,
10
- showAvatar: l = !0,
11
- showTimestamp: m = !1,
12
- maxWidth: p = "70%",
13
- sx: f,
14
- ...g
1
+ import { j as r } from "../jsx-runtime-DywqP_6a.js";
2
+ import { useState as v } from "react";
3
+ import { Box as o, Typography as l, Paper as H, IconButton as D } from "@mui/material";
4
+ import S from "../s-avatar/s-avatar.js";
5
+ import L from "../s-image-modal/s-image-modal.js";
6
+ import O from "../s-lazy-image/s-lazy-image.js";
7
+ import { c as b } from "../createSvgIcon-DCQI9UV5.js";
8
+ const R = b(/* @__PURE__ */ r.jsx("path", {
9
+ d: "M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"
10
+ }), "Download"), U = b(/* @__PURE__ */ r.jsx("path", {
11
+ d: "M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"
12
+ }), "InsertDriveFile"), Q = ({
13
+ message: m,
14
+ variant: z = "received",
15
+ timestamp: f,
16
+ avatar: g,
17
+ senderName: t,
18
+ showAvatar: h = !0,
19
+ showTimestamp: I = !1,
20
+ maxWidth: w = "70%",
21
+ attachments: x = [],
22
+ onAttachmentClick: s,
23
+ onDownload: n,
24
+ sx: M,
25
+ ...k
15
26
  }) => {
16
- const r = c === "sent", h = (t) => (typeof t == "string" ? new Date(t) : t).toLocaleTimeString("en-US", {
27
+ const [a, u] = v(null), [C, j] = v(!1), i = z === "sent", T = (e) => (typeof e == "string" ? new Date(e) : e).toLocaleTimeString("en-US", {
17
28
  hour: "2-digit",
18
29
  minute: "2-digit",
19
30
  hour12: !0
20
- });
21
- return /* @__PURE__ */ e.jsxs(
31
+ }), B = (e) => {
32
+ if (!e) return "";
33
+ const c = ["Bytes", "KB", "MB", "GB"], p = Math.floor(Math.log(e) / Math.log(1024));
34
+ return Math.round(e / Math.pow(1024, p) * 100) / 100 + " " + c[p];
35
+ }, F = (e) => {
36
+ s ? s(e) : (u(e), j(!0));
37
+ }, W = (e) => {
38
+ s ? s(e) : n && n(e);
39
+ }, d = x.filter((e) => e.type === "image"), y = x.filter((e) => e.type === "file");
40
+ return /* @__PURE__ */ r.jsxs(
22
41
  o,
23
42
  {
24
43
  display: "flex",
25
- flexDirection: r ? "row-reverse" : "row",
44
+ flexDirection: i ? "row-reverse" : "row",
26
45
  alignItems: "flex-start",
27
46
  gap: 1,
28
47
  mb: 1,
29
48
  sx: {
30
- maxWidth: p,
31
- alignSelf: r ? "flex-end" : "flex-start",
32
- ...f
49
+ maxWidth: w,
50
+ alignSelf: i ? "flex-end" : "flex-start",
51
+ ...M
33
52
  },
34
- ...g,
53
+ ...k,
35
54
  children: [
36
- l && !r && /* @__PURE__ */ e.jsx(x, { avatar: s, name: i, size: 36 }),
37
- /* @__PURE__ */ e.jsxs(
55
+ h && !i && /* @__PURE__ */ r.jsx(S, { avatar: g, name: t, size: 36 }),
56
+ /* @__PURE__ */ r.jsxs(
38
57
  o,
39
58
  {
40
59
  display: "flex",
41
60
  flexDirection: "column",
42
- alignItems: r ? "flex-end" : "flex-start",
61
+ alignItems: i ? "flex-end" : "flex-start",
43
62
  gap: 0.5,
44
63
  sx: { minWidth: 0 },
45
64
  children: [
46
- i && !r && /* @__PURE__ */ e.jsx(
47
- n,
65
+ t && !i && /* @__PURE__ */ r.jsx(
66
+ l,
48
67
  {
49
68
  variant: "caption",
50
69
  sx: {
@@ -53,62 +72,196 @@ const b = ({
53
72
  fontWeight: 500,
54
73
  ml: 0.5
55
74
  },
56
- children: i
75
+ children: t
57
76
  }
58
77
  ),
59
- /* @__PURE__ */ e.jsx(
78
+ /* @__PURE__ */ r.jsxs(
60
79
  o,
61
80
  {
62
81
  sx: {
63
82
  display: "inline-block",
64
- px: 2,
65
- py: 1.5,
66
83
  borderRadius: 2,
67
84
  wordBreak: "break-word",
68
85
  maxWidth: "100%",
69
- backgroundColor: r ? "primary.main" : "",
70
- color: r ? "primary.contrastText" : "text.primary",
71
- border: r ? "none" : "1px solid",
86
+ backgroundColor: i ? "primary.main" : "",
87
+ color: i ? "primary.contrastText" : "text.primary",
88
+ border: i ? "none" : "1px solid",
72
89
  borderColor: "divider",
73
- ...r && {
90
+ ...i && {
74
91
  backgroundColor: "primary.dark"
75
- }
92
+ },
93
+ overflow: "hidden"
76
94
  },
77
- children: /* @__PURE__ */ e.jsx(
78
- n,
79
- {
80
- variant: "body2",
81
- sx: {
82
- fontSize: "0.875rem",
83
- lineHeight: 1.4,
84
- whiteSpace: "pre-wrap"
95
+ children: [
96
+ d.length > 0 && /* @__PURE__ */ r.jsx(
97
+ o,
98
+ {
99
+ sx: {
100
+ display: "grid",
101
+ gridTemplateColumns: d.length === 1 ? "1fr" : "repeat(2, 1fr)",
102
+ gap: 0.5,
103
+ p: 0.5
104
+ },
105
+ minWidth: 200,
106
+ children: d.map((e) => /* @__PURE__ */ r.jsx(
107
+ o,
108
+ {
109
+ sx: {
110
+ position: "relative",
111
+ paddingTop: d.length === 1 ? "66.67%" : "100%",
112
+ cursor: "pointer",
113
+ borderRadius: 1.5,
114
+ overflow: "hidden",
115
+ "&:hover": {
116
+ opacity: 0.9
117
+ }
118
+ },
119
+ onClick: () => F(e),
120
+ children: /* @__PURE__ */ r.jsx(
121
+ O,
122
+ {
123
+ src: e.thumbnailUrl || e.url,
124
+ alt: e.name || "Image",
125
+ width: "100%",
126
+ height: "100%",
127
+ style: {
128
+ position: "absolute",
129
+ top: 0,
130
+ left: 0,
131
+ objectFit: "cover"
132
+ }
133
+ }
134
+ )
135
+ },
136
+ e.id
137
+ ))
138
+ }
139
+ ),
140
+ y.length > 0 && /* @__PURE__ */ r.jsx(o, { sx: { p: 1.5 }, children: y.map((e, c) => /* @__PURE__ */ r.jsxs(
141
+ H,
142
+ {
143
+ variant: "outlined",
144
+ sx: {
145
+ display: "flex",
146
+ alignItems: "center",
147
+ gap: 1.5,
148
+ p: 1,
149
+ mt: c > 0 ? 1 : 0,
150
+ cursor: "pointer",
151
+ backgroundColor: i ? "rgba(0,0,0,0.1)" : "background.paper",
152
+ "&:hover": {
153
+ backgroundColor: i ? "rgba(0,0,0,0.2)" : "action.hover"
154
+ }
155
+ },
156
+ onClick: () => W(e),
157
+ children: [
158
+ /* @__PURE__ */ r.jsx(
159
+ U,
160
+ {
161
+ sx: {
162
+ fontSize: 32,
163
+ color: i ? "primary.contrastText" : "action.active"
164
+ }
165
+ }
166
+ ),
167
+ /* @__PURE__ */ r.jsxs(o, { sx: { flex: 1, minWidth: 0 }, children: [
168
+ /* @__PURE__ */ r.jsx(
169
+ l,
170
+ {
171
+ variant: "body2",
172
+ sx: {
173
+ fontSize: "0.875rem",
174
+ fontWeight: 500,
175
+ overflow: "hidden",
176
+ textOverflow: "ellipsis",
177
+ whiteSpace: "nowrap",
178
+ color: i ? "inherit" : "text.primary"
179
+ },
180
+ children: e.name || "Unnamed File"
181
+ }
182
+ ),
183
+ e.size && /* @__PURE__ */ r.jsx(
184
+ l,
185
+ {
186
+ variant: "caption",
187
+ sx: {
188
+ fontSize: "0.75rem",
189
+ color: i ? "rgba(255,255,255,0.7)" : "text.secondary"
190
+ },
191
+ children: B(e.size)
192
+ }
193
+ )
194
+ ] }),
195
+ n && /* @__PURE__ */ r.jsx(
196
+ D,
197
+ {
198
+ size: "small",
199
+ onClick: (p) => {
200
+ p.stopPropagation(), n(e);
201
+ },
202
+ sx: {
203
+ color: i ? "primary.contrastText" : "action.active"
204
+ },
205
+ children: /* @__PURE__ */ r.jsx(R, { fontSize: "small" })
206
+ }
207
+ )
208
+ ]
85
209
  },
86
- children: d
87
- }
88
- )
210
+ e.id
211
+ )) }),
212
+ m && /* @__PURE__ */ r.jsx(o, { sx: { px: 2, py: 1.5, pt: x.length > 0 ? 0 : 1.5 }, children: /* @__PURE__ */ r.jsx(
213
+ l,
214
+ {
215
+ variant: "body2",
216
+ sx: {
217
+ fontSize: "0.875rem",
218
+ lineHeight: 1.4,
219
+ whiteSpace: "pre-wrap"
220
+ },
221
+ children: m
222
+ }
223
+ ) })
224
+ ]
89
225
  }
90
226
  ),
91
- m && a && /* @__PURE__ */ e.jsx(
92
- n,
227
+ I && f && /* @__PURE__ */ r.jsx(
228
+ l,
93
229
  {
94
230
  variant: "caption",
95
231
  sx: {
96
232
  color: "text.secondary",
97
233
  fontSize: "0.7rem",
98
- ml: r ? 0 : 0.5,
99
- mr: r ? 0.5 : 0
234
+ ml: i ? 0 : 0.5,
235
+ mr: i ? 0.5 : 0
100
236
  },
101
- children: h(a)
237
+ children: T(f)
102
238
  }
103
239
  )
104
240
  ]
105
241
  }
106
242
  ),
107
- l && r && /* @__PURE__ */ e.jsx(x, { avatar: s, name: i, size: 36 })
243
+ h && i && /* @__PURE__ */ r.jsx(S, { avatar: g, name: t, size: 36 }),
244
+ a && /* @__PURE__ */ r.jsx(
245
+ L,
246
+ {
247
+ isOpen: C,
248
+ onClose: () => {
249
+ j(!1), u(null);
250
+ },
251
+ selectedItem: {
252
+ id: a.id,
253
+ type: "image",
254
+ url: a.url,
255
+ title: a.name
256
+ },
257
+ showNavigation: !1,
258
+ showThumbnailDock: !1
259
+ }
260
+ )
108
261
  ]
109
262
  }
110
263
  );
111
264
  };
112
265
  export {
113
- b as default
266
+ Q as default
114
267
  };
@@ -1,63 +1,65 @@
1
1
  import { j as a } from "../jsx-runtime-DywqP_6a.js";
2
- import { useId as x, useState as f } from "react";
3
- import { useTheme as j, Box as d, Skeleton as L } from "@mui/material";
4
- const y = ({
5
- src: u,
2
+ import { useId as i, useState as f } from "react";
3
+ import { useTheme as j, Box as m, Skeleton as L } from "@mui/material";
4
+ const I = ({
5
+ src: n,
6
6
  variant: e = "rounded",
7
7
  height: o = "auto",
8
8
  width: s = "100%",
9
- style: t,
10
- minWidth: m = "auto",
11
- minHeight: n = "auto",
12
- ...i
9
+ style: r,
10
+ minWidth: t = "auto",
11
+ minHeight: u = "auto",
12
+ ...c
13
13
  }) => {
14
- const c = x(), l = j(), [r, p] = f(!1);
14
+ const l = i(), p = j(), [d, x] = f(!1);
15
15
  return (
16
16
  // Container box maintains consistent dimensions throughout the loading process
17
17
  // This prevents layout shifts and provides stable positioning for both skeleton and image
18
- /* @__PURE__ */ a.jsxs(d, { height: o, width: s, children: [
19
- !r && /* @__PURE__ */ a.jsx(
18
+ /* @__PURE__ */ a.jsxs(m, { height: o, width: s, children: [
19
+ !d && /* @__PURE__ */ a.jsx(
20
20
  L,
21
21
  {
22
22
  variant: e,
23
- id: `image-skeleton-${c}`,
23
+ id: `image-skeleton-${l}`,
24
24
  animation: "wave",
25
25
  style: {
26
26
  height: o,
27
27
  width: s,
28
- minWidth: m,
29
- minHeight: n,
30
- ...t
28
+ minWidth: t,
29
+ minHeight: u,
30
+ ...r
31
31
  // User styles applied to skeleton for consistency
32
32
  }
33
33
  }
34
34
  ),
35
35
  /* @__PURE__ */ a.jsx(
36
- d,
36
+ m,
37
37
  {
38
38
  component: "img",
39
- src: u,
39
+ src: n,
40
40
  style: {
41
41
  height: o,
42
42
  width: s,
43
+ minWidth: t,
44
+ minHeight: u,
43
45
  // Performance optimization: display toggling instead of opacity transitions
44
46
  // This approach reduces GPU usage and improves rendering performance
45
- display: r ? "block" : "none",
47
+ display: d ? "block" : "none",
46
48
  // Theme-aware border radius calculation for consistent styling
47
49
  // Matches Material-UI skeleton variants with proper theme integration
48
- borderRadius: e === "circular" ? "50%" : e === "rounded" ? l.shape.borderRadius : "0px",
49
- ...t
50
+ borderRadius: e === "circular" ? "50%" : e === "rounded" ? p.shape.borderRadius : "0px",
51
+ ...r
50
52
  // User-provided styles override defaults
51
53
  },
52
54
  onLoad: () => {
53
- p(!0);
55
+ x(!0);
54
56
  },
55
- ...i
57
+ ...c
56
58
  }
57
59
  )
58
60
  ] })
59
61
  );
60
62
  };
61
63
  export {
62
- y as default
64
+ I as default
63
65
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.101",
6
+ "version": "1.0.102",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",