@solostylist/ui-kit 1.0.100 → 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.
Files changed (46) hide show
  1. package/dist/{ButtonBase-Cn3itpEl.js → ButtonBase-B-mcxJe8.js} +28 -28
  2. package/dist/{ChevronRight-G7jhiUBG.js → ChevronRight-BB4jrtLy.js} +1 -1
  3. package/dist/{Close-BSG2-e7H.js → Close-DqRHeMAW.js} +1 -1
  4. package/dist/ExpandMore-CE1RzE_y.js +8 -0
  5. package/dist/{Menu-DYOw-I_3.js → Menu-HtTElywx.js} +4 -4
  6. package/dist/{MenuItem-DTRBXdpX.js → MenuItem-DzviefY7.js} +3 -3
  7. package/dist/{Paper-DEq2MLtq.js → Paper-pJ5bSU59.js} +2 -2
  8. package/dist/{Select-DmB-tjlR.js → Select-C9Hk7BA8.js} +3 -3
  9. package/dist/{Stack-GTpsqQv0.js → Stack-TRopps6s.js} +1 -1
  10. package/dist/{Typography-zQXZ4jKl.js → Typography-DGEEI1Q-.js} +1 -1
  11. package/dist/{createSvgIcon-CS-Z7P80.js → createSvgIcon-DCQI9UV5.js} +3 -3
  12. package/dist/{mergeSlotProps-BbDReBm1.js → mergeSlotProps-N1VTlioP.js} +1 -1
  13. package/dist/s-accordion/s-accordion.js +102 -104
  14. package/dist/s-carousel/s-carousel.js +1 -1
  15. package/dist/s-chat-input/s-chat-input.js +57 -57
  16. package/dist/s-chat-message/index.d.ts +1 -1
  17. package/dist/s-chat-message/s-chat-message.d.ts +13 -1
  18. package/dist/s-chat-message/s-chat-message.js +207 -54
  19. package/dist/s-comment-message/index.d.ts +2 -0
  20. package/dist/s-comment-message/index.js +4 -0
  21. package/dist/s-comment-message/package.json +5 -0
  22. package/dist/s-comment-message/s-comment-message.d.ts +21 -0
  23. package/dist/s-comment-message/s-comment-message.js +138 -0
  24. package/dist/s-copyable-text/s-copyable-text.js +1 -1
  25. package/dist/s-data-table/s-data-table.js +3 -3
  26. package/dist/s-date-picker/s-date-picker.js +4 -4
  27. package/dist/s-datetime-picker/s-datetime-picker.js +7 -7
  28. package/dist/s-dialog/s-dialog.js +1 -1
  29. package/dist/s-dialog-confirm/s-dialog-confirm.js +2 -2
  30. package/dist/s-dialog-message/s-dialog-message.js +2 -2
  31. package/dist/s-file-dropzone/s-file-dropzone.js +3 -3
  32. package/dist/s-image-comparison/s-image-comparison.js +1 -1
  33. package/dist/s-image-modal/s-image-modal.js +2 -2
  34. package/dist/s-label/s-label.js +5 -5
  35. package/dist/s-lazy-image/s-lazy-image.js +25 -23
  36. package/dist/s-multi-select/s-multi-select.js +5 -5
  37. package/dist/s-review/s-review.js +1 -1
  38. package/dist/s-text-editor/s-text-editor-toolbar.js +8 -8
  39. package/dist/s-text-field/s-text-field.js +5 -5
  40. package/dist/s-tip/s-tip.js +3 -3
  41. package/dist/theme/components/avatar.js +3 -3
  42. package/dist/theme/components/chip.js +1 -1
  43. package/dist/theme/customizations/inputs.js +1 -1
  44. package/dist/theme/customizations/navigation.js +1 -1
  45. package/dist/{useMobilePicker-By8yrJS0.js → useMobilePicker-c5_EH1sg.js} +6 -6
  46. package/package.json +1 -1
@@ -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-BSG2-e7H.js";
9
- import { b as k } from "../createSvgIcon-CS-Z7P80.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
  };
@@ -0,0 +1,2 @@
1
+ export { default } from './s-comment-message';
2
+ export type { SCommentMessageProps } from './s-comment-message';
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./s-comment-message.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,21 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps } from '@mui/material';
3
+ export interface SCommentMessageProps {
4
+ id?: string | number;
5
+ userName: string;
6
+ userAvatar?: string;
7
+ commentContent: string;
8
+ datetime: Date | string;
9
+ likes?: number;
10
+ isLiked?: boolean;
11
+ replies?: SCommentMessageProps[];
12
+ onLike?: (commentId: string | number) => void;
13
+ onReply?: (commentId: string | number, parentId?: string | number) => void;
14
+ showReplies?: boolean;
15
+ avatarSize?: number;
16
+ level?: number;
17
+ maxLevel?: number;
18
+ sx?: SxProps;
19
+ }
20
+ declare const SCommentMessage: React.FC<SCommentMessageProps>;
21
+ export default SCommentMessage;