@solostylist/ui-kit 1.0.188 → 1.0.190
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.
- package/dist/s-accordion/package.json +5 -5
- package/dist/s-action-overlay/package.json +5 -5
- package/dist/s-action-overlay/s-action-overlay.js +0 -1
- package/dist/s-ai-tool-bar/package.json +5 -5
- package/dist/s-ai-tool-bar/s-ai-tool-bar.js +67 -71
- package/dist/s-autocomplete/package.json +5 -5
- package/dist/s-avatar/package.json +5 -5
- package/dist/s-blur-text/package.json +5 -5
- package/dist/s-breadcrumbs/package.json +5 -5
- package/dist/s-button/package.json +5 -5
- package/dist/s-button/s-button.d.ts +1 -2
- package/dist/s-button-link/package.json +5 -5
- package/dist/s-carousel/package.json +5 -5
- package/dist/s-category-card/package.json +5 -5
- package/dist/s-chat-input/package.json +5 -5
- package/dist/s-chat-input/s-chat-input.js +132 -129
- package/dist/s-chat-message/package.json +5 -5
- package/dist/s-chat-message/s-chat-message.js +28 -29
- package/dist/s-checkbox/package.json +5 -5
- package/dist/s-chip/package.json +5 -5
- package/dist/s-chip/s-chip.d.ts +1 -2
- package/dist/s-chips/package.json +5 -5
- package/dist/s-chips/s-chips.js +42 -41
- package/dist/s-code-block/package.json +5 -5
- package/dist/s-code-block/s-code-block.js +1 -2
- package/dist/s-comment-message/package.json +5 -5
- package/dist/s-comment-message/s-comment-message.js +67 -69
- package/dist/s-copyable-text/package.json +5 -5
- package/dist/s-countdown/package.json +5 -5
- package/dist/s-data-table/package.json +5 -5
- package/dist/s-data-table/s-data-table.js +157 -157
- package/dist/s-date-picker/package.json +5 -5
- package/dist/s-datetime-picker/package.json +5 -5
- package/dist/s-dialog/package.json +5 -5
- package/dist/s-dialog-confirm/package.json +5 -5
- package/dist/s-dialog-confirm/s-dialog-confirm.js +2 -2
- package/dist/s-dialog-message/package.json +5 -5
- package/dist/s-dialog-message/s-dialog-message.js +3 -3
- package/dist/s-empty/package.json +5 -5
- package/dist/s-error/package.json +5 -5
- package/dist/s-error-layout/package.json +5 -5
- package/dist/s-file-dropzone/package.json +5 -5
- package/dist/s-file-dropzone/s-file-dropzone.d.ts +1 -5
- package/dist/s-file-dropzone/s-file-dropzone.js +17 -19
- package/dist/s-file-icon/package.json +5 -5
- package/dist/s-flex-box/package.json +5 -5
- package/dist/s-flex-box/s-flex-box.d.ts +1 -2
- package/dist/s-form/package.json +5 -5
- package/dist/s-gallery/package.json +5 -5
- package/dist/s-gallery/s-gallery.js +86 -85
- package/dist/s-glow-button/package.json +5 -5
- package/dist/s-gradient-icon/package.json +5 -5
- package/dist/s-gradient-icon/s-gradient-icon.d.ts +1 -1
- package/dist/s-gradient-icon/s-gradient-icon.js +23 -24
- package/dist/s-i18n-provider/package.json +5 -5
- package/dist/s-icon-button/package.json +5 -5
- package/dist/s-image-comparison/package.json +5 -5
- package/dist/s-image-comparison/s-image-comparison.js +50 -44
- package/dist/s-image-modal/package.json +5 -5
- package/dist/s-image-modal/s-image-modal.js +128 -128
- package/dist/s-item-not-found/package.json +5 -5
- package/dist/s-label/package.json +5 -5
- package/dist/s-language-switcher/package.json +5 -5
- package/dist/s-language-switcher/s-language-switcher.js +98 -96
- package/dist/s-lazy-image/package.json +5 -5
- package/dist/s-localization-provider/package.json +5 -5
- package/dist/s-moving-border/package.json +5 -5
- package/dist/s-moving-border/s-moving-border.js +73 -73
- package/dist/s-multi-select/package.json +5 -5
- package/dist/s-multi-select/s-multi-select.js +38 -38
- package/dist/s-no-ssr/package.json +5 -5
- package/dist/s-overlay-scrollbar/package.json +5 -5
- package/dist/s-pagination/package.json +5 -5
- package/dist/s-pixel-reveal/package.json +5 -5
- package/dist/s-pixel-reveal/s-pixel-reveal.js +35 -33
- package/dist/s-radial-pulse-animate/package.json +5 -5
- package/dist/s-rating/package.json +5 -5
- package/dist/s-rating/s-rating.d.ts +1 -2
- package/dist/s-review/package.json +5 -5
- package/dist/s-review/s-review.js +75 -77
- package/dist/s-scroll-reveal/package.json +6 -6
- package/dist/s-scroll-to-top/package.json +5 -5
- package/dist/s-scroll-velocity/package.json +5 -5
- package/dist/s-select/package.json +5 -5
- package/dist/s-select/s-select.d.ts +1 -1
- package/dist/s-select/s-select.js +19 -21
- package/dist/s-select-list/package.json +5 -5
- package/dist/s-select-list/s-select-list.d.ts +2 -2
- package/dist/s-skeleton/package.json +5 -5
- package/dist/s-snackbar-message/package.json +5 -5
- package/dist/s-snackbar-message/s-snackbar-message.js +1 -1
- package/dist/s-spotlight-cursor/package.json +5 -5
- package/dist/s-stripe/package.json +5 -5
- package/dist/s-tabs/package.json +4 -4
- package/dist/s-tabs/s-tab.d.ts +1 -2
- package/dist/s-text-editor/package.json +5 -5
- package/dist/s-text-editor/s-text-editor-toolbar.js +55 -57
- package/dist/s-text-editor/s-text-editor.js +9 -9
- package/dist/s-text-field/package.json +5 -5
- package/dist/s-text-shimmer/package.json +5 -5
- package/dist/s-text-truncation/package.json +5 -5
- package/dist/s-theme-demo/package.json +5 -5
- package/dist/s-theme-provider/package.json +5 -5
- package/dist/s-theme-switch/package.json +5 -5
- package/dist/s-tip/package.json +5 -5
- package/dist/s-two-pane-layout/package.json +5 -5
- package/dist/s-typewriter-text/package.json +6 -6
- package/dist/s-zoom-image/package.json +5 -5
- package/package.json +8 -7
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import { usePopover as
|
|
6
|
-
import { M as
|
|
7
|
-
import { M as
|
|
8
|
-
import { SChips as
|
|
9
|
-
const
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { c as j } from "../createSvgIcon-DTNHY3_v.js";
|
|
4
|
+
import { Stack as M, OutlinedInput as C } from "@mui/material";
|
|
5
|
+
import { usePopover as b } from "../hooks/use-popover.js";
|
|
6
|
+
import { M as v } from "../Menu-_ZW9WiF2.js";
|
|
7
|
+
import { M as I } from "../MenuItem-DTapLhin.js";
|
|
8
|
+
import { SChips as k } from "../s-chips/s-chips.js";
|
|
9
|
+
const E = j(/* @__PURE__ */ t.jsx("path", {
|
|
10
10
|
d: "M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"
|
|
11
|
-
}), "UnfoldMore"),
|
|
11
|
+
}), "UnfoldMore"), L = ({
|
|
12
12
|
label: p,
|
|
13
|
-
onChange:
|
|
14
|
-
options:
|
|
15
|
-
value:
|
|
13
|
+
onChange: i,
|
|
14
|
+
options: a,
|
|
15
|
+
value: l = [],
|
|
16
16
|
chipProps: d
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
c.current &&
|
|
21
|
-
}, [
|
|
22
|
-
const
|
|
18
|
+
const s = b(), c = o.useRef(null), [u, m] = o.useState(), [f, h] = o.useState(null);
|
|
19
|
+
o.useEffect(() => {
|
|
20
|
+
c.current && m(c.current.offsetWidth);
|
|
21
|
+
}, [s.open]);
|
|
22
|
+
const x = o.useCallback(
|
|
23
23
|
(e, n) => {
|
|
24
|
-
let
|
|
25
|
-
n ?
|
|
24
|
+
let r = [...l];
|
|
25
|
+
n ? r.push(e) : r = r.filter((S) => S !== e), i?.(r);
|
|
26
26
|
},
|
|
27
|
-
[
|
|
27
|
+
[i, l]
|
|
28
28
|
);
|
|
29
|
-
return /* @__PURE__ */ t.jsxs(
|
|
29
|
+
return /* @__PURE__ */ t.jsxs(M, { direction: "column", gap: 1, children: [
|
|
30
30
|
/* @__PURE__ */ t.jsx(
|
|
31
|
-
|
|
31
|
+
C,
|
|
32
32
|
{
|
|
33
|
-
endAdornment: /* @__PURE__ */ t.jsx(
|
|
34
|
-
onClick:
|
|
33
|
+
endAdornment: /* @__PURE__ */ t.jsx(E, { fontSize: "small", sx: { color: "action.active", position: "absolute", right: "7px" } }),
|
|
34
|
+
onClick: s.handleOpen,
|
|
35
35
|
ref: (e) => {
|
|
36
|
-
|
|
36
|
+
h(e), c.current = e;
|
|
37
37
|
},
|
|
38
38
|
value: p,
|
|
39
39
|
sx: {
|
|
@@ -44,19 +44,19 @@ const v = x(/* @__PURE__ */ t.jsx("path", {
|
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
46
|
/* @__PURE__ */ t.jsx(
|
|
47
|
-
|
|
47
|
+
v,
|
|
48
48
|
{
|
|
49
|
-
anchorEl:
|
|
50
|
-
onClose:
|
|
51
|
-
open:
|
|
49
|
+
anchorEl: f,
|
|
50
|
+
onClose: s.handleClose,
|
|
51
|
+
open: s.open,
|
|
52
52
|
slotProps: { paper: { sx: { width: u ? `${u}px` : void 0 } } },
|
|
53
|
-
children:
|
|
54
|
-
const n =
|
|
53
|
+
children: a.map((e) => {
|
|
54
|
+
const n = l.includes(e.value);
|
|
55
55
|
return /* @__PURE__ */ t.jsx(
|
|
56
|
-
|
|
56
|
+
I,
|
|
57
57
|
{
|
|
58
58
|
onClick: () => {
|
|
59
|
-
|
|
59
|
+
x(e.value, !n);
|
|
60
60
|
},
|
|
61
61
|
selected: n,
|
|
62
62
|
children: e.label
|
|
@@ -67,16 +67,16 @@ const v = x(/* @__PURE__ */ t.jsx("path", {
|
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ t.jsx(
|
|
70
|
-
|
|
70
|
+
k,
|
|
71
71
|
{
|
|
72
|
-
chips:
|
|
72
|
+
chips: a.filter((e) => l.includes(e.value)).map((e) => e.label),
|
|
73
73
|
...d
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
] });
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
L.displayName = "SMultiSelect";
|
|
79
79
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
L as SMultiSelect,
|
|
81
|
+
L as default
|
|
82
82
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { brand as
|
|
1
|
+
import { j as A } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
+
import { forwardRef as Q, useRef as h, useEffect as N, useCallback as q } from "react";
|
|
3
|
+
import { brand as E } from "../theme/theme-primitives.js";
|
|
4
4
|
class U {
|
|
5
5
|
x;
|
|
6
6
|
y;
|
|
@@ -26,55 +26,57 @@ class U {
|
|
|
26
26
|
c.fillRect(this.x + o, this.y + o, this.size, this.size);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const Z =
|
|
29
|
+
const Z = Q(
|
|
30
30
|
({
|
|
31
31
|
gap: s = 5,
|
|
32
32
|
speed: c = 100,
|
|
33
|
-
colors: l = [
|
|
33
|
+
colors: l = [E[400], E[500], E[600]],
|
|
34
34
|
loading: o = !0,
|
|
35
35
|
src: z,
|
|
36
36
|
alt: y = "",
|
|
37
37
|
style: M,
|
|
38
38
|
children: b,
|
|
39
|
-
instant:
|
|
40
|
-
|
|
39
|
+
instant: k = !0,
|
|
40
|
+
...$
|
|
41
41
|
}, S) => {
|
|
42
|
-
const g = h(null), w = h(null),
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const g = h(null), w = h(null), D = h(null), p = h(/* @__PURE__ */ new Map()), a = h(null), I = h(1e3 / 60), C = h(0), P = h(!1);
|
|
43
|
+
N(() => {
|
|
44
|
+
P.current = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1;
|
|
45
|
+
}, []);
|
|
46
|
+
const O = q((e, n, u, r) => {
|
|
45
47
|
const t = e - u, i = n - r;
|
|
46
48
|
return t * t + i * i;
|
|
47
|
-
}, []), V =
|
|
49
|
+
}, []), V = q(() => {
|
|
48
50
|
const e = g.current, n = e?.getContext("2d");
|
|
49
51
|
if (!e || !n) return;
|
|
50
52
|
p.current = /* @__PURE__ */ new Map();
|
|
51
|
-
const u =
|
|
52
|
-
for (let f =
|
|
53
|
-
for (let m =
|
|
53
|
+
const u = P.current ? 0 : Math.max(0, Math.min(100, c)) * 1e-3, r = window.devicePixelRatio || 1, t = e.width / r, i = e.height / r, x = 2, X = 0.5, H = (t + i) * 0.01, T = t % s / 2, W = i % s / 2;
|
|
54
|
+
for (let f = T; f < t; f += s)
|
|
55
|
+
for (let m = W; m < i; m += s) {
|
|
54
56
|
const d = l[Math.floor(Math.random() * l.length)];
|
|
55
57
|
let v = 0;
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
v = Math.sqrt(O(
|
|
58
|
+
if (!k && !P.current) {
|
|
59
|
+
const G = f + s / 2, J = m + s / 2, K = t / 2, L = i / 2;
|
|
60
|
+
v = Math.sqrt(O(G, J, K, L));
|
|
59
61
|
}
|
|
60
|
-
const
|
|
62
|
+
const F = Math.random() * 4 + H, R = Math.random() * (x - X) + X, B = new U(f, m, d, u, v, F, R);
|
|
61
63
|
p.current.has(d) || p.current.set(d, []), p.current.get(d).push(B);
|
|
62
64
|
}
|
|
63
|
-
a.current && cancelAnimationFrame(a.current);
|
|
65
|
+
a.current && cancelAnimationFrame(a.current), C.current = performance.now();
|
|
64
66
|
const Y = () => {
|
|
65
67
|
a.current = requestAnimationFrame(Y);
|
|
66
|
-
const f = performance.now(), m = f -
|
|
67
|
-
if (m <
|
|
68
|
-
|
|
68
|
+
const f = performance.now(), m = f - C.current;
|
|
69
|
+
if (m < I.current) return;
|
|
70
|
+
C.current = f - m % I.current, n.clearRect(0, 0, t, i);
|
|
69
71
|
let d = !1;
|
|
70
|
-
p.current.forEach((v,
|
|
71
|
-
n.fillStyle =
|
|
72
|
+
p.current.forEach((v, F) => {
|
|
73
|
+
n.fillStyle = F;
|
|
72
74
|
for (const R of v)
|
|
73
75
|
R.update(o) && (R.draw(n, s), d = !0);
|
|
74
76
|
}), !o && !d && a.current && (cancelAnimationFrame(a.current), a.current = null);
|
|
75
77
|
};
|
|
76
78
|
Y();
|
|
77
|
-
}, [s, c, l,
|
|
79
|
+
}, [s, c, l, k, o, O]), j = q(() => {
|
|
78
80
|
const e = g.current, n = w.current, u = e?.getContext("2d");
|
|
79
81
|
if (!e || !n || !u) return;
|
|
80
82
|
const r = n.getBoundingClientRect();
|
|
@@ -82,15 +84,15 @@ const Z = L(
|
|
|
82
84
|
const t = Math.floor(r.width), i = Math.floor(r.height), x = window.devicePixelRatio || 1;
|
|
83
85
|
e.width = t * x, e.height = i * x, e.style.width = `${t}px`, e.style.height = `${i}px`, u.setTransform(1, 0, 0, 1, 0, 0), u.scale(x, x), V();
|
|
84
86
|
}, [V]);
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
+
return N(() => {
|
|
88
|
+
j();
|
|
87
89
|
const e = new ResizeObserver(() => {
|
|
88
|
-
requestAnimationFrame(() =>
|
|
90
|
+
requestAnimationFrame(() => j());
|
|
89
91
|
});
|
|
90
92
|
return w.current && e.observe(w.current), () => {
|
|
91
93
|
e.disconnect(), a.current && cancelAnimationFrame(a.current);
|
|
92
94
|
};
|
|
93
|
-
}, [
|
|
95
|
+
}, [j]), /* @__PURE__ */ A.jsxs(
|
|
94
96
|
"div",
|
|
95
97
|
{
|
|
96
98
|
ref: (e) => {
|
|
@@ -103,12 +105,12 @@ const Z = L(
|
|
|
103
105
|
overflow: "hidden",
|
|
104
106
|
...M
|
|
105
107
|
},
|
|
106
|
-
|
|
108
|
+
...$,
|
|
107
109
|
children: [
|
|
108
|
-
z && /* @__PURE__ */
|
|
110
|
+
z && /* @__PURE__ */ A.jsx(
|
|
109
111
|
"img",
|
|
110
112
|
{
|
|
111
|
-
ref:
|
|
113
|
+
ref: D,
|
|
112
114
|
src: z,
|
|
113
115
|
alt: y,
|
|
114
116
|
style: {
|
|
@@ -122,7 +124,7 @@ const Z = L(
|
|
|
122
124
|
}
|
|
123
125
|
),
|
|
124
126
|
b,
|
|
125
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ A.jsx(
|
|
126
128
|
"canvas",
|
|
127
129
|
{
|
|
128
130
|
ref: g,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -3,8 +3,7 @@ import { RatingProps } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* Props interface for SRating component
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
}
|
|
6
|
+
export type SRatingProps = RatingProps;
|
|
8
7
|
/**
|
|
9
8
|
* A star rating component that allows users to provide feedback and ratings.
|
|
10
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { useState as j, useEffect as
|
|
3
|
-
import { Box as
|
|
2
|
+
import { useId as K, useState as j, useEffect as P } from "react";
|
|
3
|
+
import { Box as c, Stack as a, Divider as H, Typography as h, IconButton as L } from "@mui/material";
|
|
4
4
|
import { SSkeleton as i } from "../s-skeleton/s-skeleton.js";
|
|
5
|
-
import { SAvatar as
|
|
6
|
-
import { SRating as
|
|
7
|
-
import
|
|
8
|
-
import { c as
|
|
9
|
-
import { SImageModal as
|
|
10
|
-
const
|
|
5
|
+
import { SAvatar as Q } from "../s-avatar/s-avatar.js";
|
|
6
|
+
import { SRating as X } from "../s-rating/s-rating.js";
|
|
7
|
+
import Z from "../s-lazy-image/s-lazy-image.js";
|
|
8
|
+
import { c as z } from "../createSvgIcon-DTNHY3_v.js";
|
|
9
|
+
import { SImageModal as _ } from "../s-image-modal/s-image-modal.js";
|
|
10
|
+
const ee = z(/* @__PURE__ */ e.jsx("path", {
|
|
11
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"
|
|
12
|
-
}), "ThumbDown"),
|
|
12
|
+
}), "ThumbDown"), te = z(/* @__PURE__ */ e.jsx("path", {
|
|
13
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"
|
|
14
|
-
}), "ThumbUp"),
|
|
15
|
-
const
|
|
16
|
-
return w < 60 ? "just now" :
|
|
17
|
-
},
|
|
18
|
-
id:
|
|
19
|
-
userName:
|
|
14
|
+
}), "ThumbUp"), ne = (m) => {
|
|
15
|
+
const d = /* @__PURE__ */ new Date(), v = typeof m == "string" ? new Date(m) : m, I = d.getTime() - v.getTime(), w = Math.floor(I / 1e3), l = Math.floor(w / 60), r = Math.floor(l / 60), o = Math.floor(r / 24), x = Math.floor(o / 7), f = Math.floor(o / 30), g = Math.floor(o / 365);
|
|
16
|
+
return w < 60 ? "just now" : l < 60 ? l === 1 ? "1 minute ago" : `${l} minutes ago` : r < 24 ? r === 1 ? "1 hour ago" : `${r} hours ago` : o < 7 ? o === 1 ? "1 day ago" : `${o} days ago` : x < 4 ? x === 1 ? "1 week ago" : `${x} weeks ago` : f < 12 ? f === 1 ? "1 month ago" : `${f} months ago` : g === 1 ? "1 year ago" : `${g} years ago`;
|
|
17
|
+
}, se = ({
|
|
18
|
+
id: m,
|
|
19
|
+
userName: d,
|
|
20
20
|
userAvatar: v,
|
|
21
|
-
rating:
|
|
21
|
+
rating: I,
|
|
22
22
|
reviewContent: w,
|
|
23
|
-
datetime:
|
|
24
|
-
images:
|
|
23
|
+
datetime: l,
|
|
24
|
+
images: r,
|
|
25
25
|
userHelpfulVote: o = null,
|
|
26
|
-
helpfulYes:
|
|
26
|
+
helpfulYes: x = 0,
|
|
27
27
|
helpfulNo: f = 0,
|
|
28
28
|
onHelpfulVote: g,
|
|
29
|
-
showHelpfulSection:
|
|
30
|
-
avatarSize:
|
|
31
|
-
maxRating:
|
|
32
|
-
readOnly:
|
|
29
|
+
showHelpfulSection: V = !0,
|
|
30
|
+
avatarSize: y = 48,
|
|
31
|
+
maxRating: W = 5,
|
|
32
|
+
readOnly: E = !0,
|
|
33
33
|
showDivider: C = !0,
|
|
34
|
-
loading:
|
|
34
|
+
loading: O = !1,
|
|
35
35
|
sx: T = {}
|
|
36
36
|
}) => {
|
|
37
|
-
const [
|
|
37
|
+
const U = K(), $ = m ?? U, [Y, M] = j(x), [B, b] = j(f), [p, S] = j(o), [N, D] = j(!1), [A, k] = j(null), R = (n) => {
|
|
38
38
|
let s = n;
|
|
39
|
-
p === n ? (n === "yes" ? M((t) => Math.max(0, t - 1)) : b((t) => Math.max(0, t - 1)), S(null), s = 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), S(n), s = n), g && g(
|
|
40
|
-
}, u =
|
|
41
|
-
id: `review-${
|
|
39
|
+
p === n ? (n === "yes" ? M((t) => Math.max(0, t - 1)) : b((t) => Math.max(0, t - 1)), S(null), s = 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), S(n), s = n), g && g($, s);
|
|
40
|
+
}, u = r?.map((n, s) => ({
|
|
41
|
+
id: `review-${$}-image-${s}`,
|
|
42
42
|
type: "image",
|
|
43
43
|
url: n,
|
|
44
44
|
title: `Review image ${s + 1}`,
|
|
45
|
-
desc: `Image ${s + 1} from ${
|
|
46
|
-
})) || [],
|
|
45
|
+
desc: `Image ${s + 1} from ${d}'s review`
|
|
46
|
+
})) || [], F = (n) => {
|
|
47
47
|
const s = u[n];
|
|
48
|
-
s && (k(s),
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
},
|
|
48
|
+
s && (k(s), D(!0));
|
|
49
|
+
}, q = () => {
|
|
50
|
+
D(!1), k(null);
|
|
51
|
+
}, G = (n) => {
|
|
52
52
|
k(n);
|
|
53
|
-
},
|
|
54
|
-
return
|
|
53
|
+
}, J = ne(l);
|
|
54
|
+
return P(() => {
|
|
55
55
|
S(o);
|
|
56
|
-
}, [o]),
|
|
57
|
-
/* @__PURE__ */ e.jsxs(
|
|
58
|
-
/* @__PURE__ */ e.jsx(i, { component: "rounded-avatar", width:
|
|
59
|
-
/* @__PURE__ */ e.jsxs(
|
|
60
|
-
/* @__PURE__ */ e.jsxs(
|
|
56
|
+
}, [o]), O ? /* @__PURE__ */ e.jsxs(c, { sx: { py: 2, ...T }, children: [
|
|
57
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
58
|
+
/* @__PURE__ */ e.jsx(i, { component: "rounded-avatar", width: y, height: y }),
|
|
59
|
+
/* @__PURE__ */ e.jsxs(c, { sx: { flex: 1 }, children: [
|
|
60
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
61
61
|
/* @__PURE__ */ e.jsx(i, { variant: "text", width: 120, height: 20 }),
|
|
62
62
|
/* @__PURE__ */ e.jsx(i, { variant: "text", width: 80, height: 16 })
|
|
63
63
|
] }),
|
|
64
|
-
/* @__PURE__ */ e.jsx(
|
|
64
|
+
/* @__PURE__ */ e.jsx(c, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(i, { variant: "text", width: 100, height: 20 }) }),
|
|
65
65
|
/* @__PURE__ */ e.jsx(i, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
|
|
66
|
-
/* @__PURE__ */ e.jsxs(
|
|
66
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
|
|
67
67
|
/* @__PURE__ */ e.jsx(i, { variant: "text", width: 140, height: 16, sx: { mr: 2 } }),
|
|
68
68
|
/* @__PURE__ */ e.jsx(i, { component: "icon-button" }),
|
|
69
69
|
/* @__PURE__ */ e.jsx(i, { variant: "text", width: 20, height: 16 }),
|
|
@@ -72,19 +72,19 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
72
72
|
] })
|
|
73
73
|
] })
|
|
74
74
|
] }),
|
|
75
|
-
C && /* @__PURE__ */ e.jsx(
|
|
76
|
-
] }) : /* @__PURE__ */ e.jsxs(
|
|
77
|
-
/* @__PURE__ */ e.jsxs(
|
|
78
|
-
/* @__PURE__ */ e.jsx(
|
|
79
|
-
/* @__PURE__ */ e.jsxs(
|
|
80
|
-
/* @__PURE__ */ e.jsxs(
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
75
|
+
C && /* @__PURE__ */ e.jsx(H, { sx: { mt: 2 } })
|
|
76
|
+
] }) : /* @__PURE__ */ e.jsxs(c, { sx: { py: 2, ...T }, children: [
|
|
77
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
78
|
+
/* @__PURE__ */ e.jsx(Q, { avatar: v, name: d, size: y }),
|
|
79
|
+
/* @__PURE__ */ e.jsxs(c, { sx: { flex: 1 }, children: [
|
|
80
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
81
|
+
/* @__PURE__ */ e.jsx(h, { variant: "subtitle2", fontWeight: "600", children: d }),
|
|
82
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(h, { variant: "caption", children: J }) })
|
|
83
83
|
] }),
|
|
84
|
-
/* @__PURE__ */ e.jsx(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
/* @__PURE__ */ e.jsx(c, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(X, { value: I, max: W, readOnly: E }) }),
|
|
85
|
+
/* @__PURE__ */ e.jsx(h, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: w }),
|
|
86
|
+
r && r.length > 0 && /* @__PURE__ */ e.jsx(a, { direction: "row", spacing: 1, sx: { mb: 2, flexWrap: "wrap", gap: 1 }, children: r.map((n, s) => /* @__PURE__ */ e.jsx(
|
|
87
|
+
Z,
|
|
88
88
|
{
|
|
89
89
|
src: n,
|
|
90
90
|
alt: `Review image ${s + 1}`,
|
|
@@ -95,7 +95,7 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
95
95
|
objectFit: "cover",
|
|
96
96
|
cursor: "pointer"
|
|
97
97
|
},
|
|
98
|
-
onClick: () =>
|
|
98
|
+
onClick: () => F(s),
|
|
99
99
|
onMouseEnter: (t) => {
|
|
100
100
|
t.currentTarget.style.opacity = "0.8";
|
|
101
101
|
},
|
|
@@ -105,28 +105,26 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
105
105
|
},
|
|
106
106
|
s
|
|
107
107
|
)) }),
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */ e.jsx(
|
|
108
|
+
V && /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
|
|
109
|
+
/* @__PURE__ */ e.jsx(h, { variant: "caption", sx: { mr: 2 }, children: "Was this review helpful?" }),
|
|
110
110
|
/* @__PURE__ */ e.jsx(
|
|
111
|
-
|
|
111
|
+
L,
|
|
112
112
|
{
|
|
113
|
-
|
|
114
|
-
onClick: () => z("yes"),
|
|
113
|
+
onClick: () => R("yes"),
|
|
115
114
|
sx: {
|
|
116
115
|
color: p === "yes" ? "primary.main" : "text.secondary",
|
|
117
116
|
"&:hover": {
|
|
118
117
|
backgroundColor: "action.hover"
|
|
119
118
|
}
|
|
120
119
|
},
|
|
121
|
-
children: /* @__PURE__ */ e.jsx(
|
|
120
|
+
children: /* @__PURE__ */ e.jsx(te, { fontSize: "small" })
|
|
122
121
|
}
|
|
123
122
|
),
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
+
/* @__PURE__ */ e.jsx(h, { variant: "caption", children: Y }),
|
|
125
124
|
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
125
|
+
L,
|
|
127
126
|
{
|
|
128
|
-
|
|
129
|
-
onClick: () => z("no"),
|
|
127
|
+
onClick: () => R("no"),
|
|
130
128
|
sx: {
|
|
131
129
|
color: p === "no" ? "error.main" : "text.secondary",
|
|
132
130
|
ml: 1,
|
|
@@ -134,21 +132,21 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
134
132
|
backgroundColor: "action.hover"
|
|
135
133
|
}
|
|
136
134
|
},
|
|
137
|
-
children: /* @__PURE__ */ e.jsx(
|
|
135
|
+
children: /* @__PURE__ */ e.jsx(ee, { fontSize: "small" })
|
|
138
136
|
}
|
|
139
137
|
),
|
|
140
|
-
/* @__PURE__ */ e.jsx(
|
|
138
|
+
/* @__PURE__ */ e.jsx(h, { variant: "caption", children: B })
|
|
141
139
|
] })
|
|
142
140
|
] })
|
|
143
141
|
] }),
|
|
144
|
-
C && /* @__PURE__ */ e.jsx(
|
|
142
|
+
C && /* @__PURE__ */ e.jsx(H, { sx: { mt: 2 } }),
|
|
145
143
|
/* @__PURE__ */ e.jsx(
|
|
146
|
-
|
|
144
|
+
_,
|
|
147
145
|
{
|
|
148
|
-
isOpen:
|
|
149
|
-
onClose:
|
|
150
|
-
selectedItem:
|
|
151
|
-
onItemChange:
|
|
146
|
+
isOpen: N,
|
|
147
|
+
onClose: q,
|
|
148
|
+
selectedItem: A,
|
|
149
|
+
onItemChange: G,
|
|
152
150
|
mediaItems: u,
|
|
153
151
|
showNavigation: u.length > 1,
|
|
154
152
|
showThumbnailDock: u.length > 1,
|
|
@@ -157,8 +155,8 @@ const X = H(/* @__PURE__ */ e.jsx("path", {
|
|
|
157
155
|
)
|
|
158
156
|
] });
|
|
159
157
|
};
|
|
160
|
-
|
|
158
|
+
se.displayName = "SReview";
|
|
161
159
|
export {
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
se as SReview,
|
|
161
|
+
se as default
|
|
164
162
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@solostylist/ui-kit/s-scroll-reveal",
|
|
3
|
-
"main": "./index.ts",
|
|
4
|
-
"module": "./index.ts",
|
|
5
|
-
"types": "./index.ts"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@solostylist/ui-kit/s-scroll-reveal",
|
|
3
|
+
"main": "./index.ts",
|
|
4
|
+
"module": "./index.ts",
|
|
5
|
+
"types": "./index.ts"
|
|
6
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "./index.js",
|
|
3
|
-
"types": "./index.d.ts",
|
|
4
|
-
"sideEffects": false
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "./index.js",
|
|
3
|
+
"types": "./index.d.ts",
|
|
4
|
+
"sideEffects": false
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectProps } from '@mui/material';
|
|
2
2
|
/** Base type constraint for select options - can be primitives or objects */
|
|
3
|
-
type BaseOption = string | number | Record<string,
|
|
3
|
+
type BaseOption = string | number | Record<string, unknown>;
|
|
4
4
|
/**
|
|
5
5
|
* Props interface for SSelect component
|
|
6
6
|
*/
|