@solostylist/ui-kit 1.0.195 → 1.0.197
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/entries/core.d.ts +2 -0
- package/dist/entries/core.js +121 -118
- package/dist/entries/editor.js +3 -2
- package/dist/entries/motion.js +26 -26
- package/dist/entries/stripe.js +8 -8
- package/dist/hooks/index.js +9 -8
- package/dist/main.js +197 -193
- package/dist/s-chat-input/s-chat-input.js +4 -4
- package/dist/s-chat-message/s-chat-message.js +80 -87
- package/dist/s-comment-message/s-comment-message.js +81 -83
- package/dist/s-countdown/s-count-down.js +1 -1
- package/dist/s-data-table/s-data-table.js +11 -11
- package/dist/s-file-dropzone/s-file-dropzone.js +4 -4
- package/dist/s-glow-button/s-glow-button.js +4 -4
- package/dist/s-image-modal/s-image-modal.js +8 -8
- package/dist/s-label/s-label.js +9 -9
- package/dist/s-multi-select/s-multi-select.js +6 -6
- package/dist/s-review/s-review.js +91 -93
- package/dist/s-select/s-select.d.ts +3 -0
- package/dist/s-select/s-select.js +64 -63
- package/dist/s-stripe/s-stripe.js +4 -4
- package/dist/s-switch/index.d.ts +2 -0
- package/dist/s-switch/index.js +4 -0
- package/dist/s-switch/s-switch.d.ts +16 -0
- package/dist/s-switch/s-switch.js +17 -0
- package/dist/s-text-editor/s-text-editor-toolbar.js +8 -8
- package/dist/s-text-truncation/s-text-truncation.d.ts +1 -0
- package/dist/s-text-truncation/s-text-truncation.js +62 -42
- package/dist/s-theme-demo/s-theme-demo.js +7 -7
- package/dist/s-two-pane-layout/s-two-pane-layout.js +1 -1
- package/dist/utils-DJIrqgo5.js +18 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { hslToRgb as s, Button as u } from "@mui/material";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { SMovingBorder as f } from "../s-moving-border/s-moving-border.js";
|
|
4
|
+
import { blue as x } from "../theme/theme-primitives.js";
|
|
5
5
|
const a = ({
|
|
6
6
|
borderRadius: t = 12,
|
|
7
7
|
children: l,
|
|
@@ -9,10 +9,10 @@ const a = ({
|
|
|
9
9
|
width: o = "fit-content",
|
|
10
10
|
height: r = "60px",
|
|
11
11
|
glowSize: p = 60,
|
|
12
|
-
glowColor: i = s(
|
|
12
|
+
glowColor: i = s(x[500]),
|
|
13
13
|
...m
|
|
14
14
|
}) => /* @__PURE__ */ e.jsx(
|
|
15
|
-
|
|
15
|
+
f,
|
|
16
16
|
{
|
|
17
17
|
width: o,
|
|
18
18
|
height: r,
|
|
@@ -2,10 +2,10 @@ import { j as o } from "../jsx-runtime-tc70JA_2.js";
|
|
|
2
2
|
import j, { useState as C, useEffect as k } from "react";
|
|
3
3
|
import { Modal as L, Box as d, Paper as m, Typography as w, IconButton as y, Stack as A } from "@mui/material";
|
|
4
4
|
import { motion as b, AnimatePresence as D } from "framer-motion";
|
|
5
|
-
import
|
|
6
|
-
import { C as N } from "../
|
|
7
|
-
import { C as T } from "../
|
|
8
|
-
import $ from "../
|
|
5
|
+
import F from "../s-lazy-image/s-lazy-image.js";
|
|
6
|
+
import { C as N } from "../Close-C-pCw-CD.js";
|
|
7
|
+
import { C as T } from "../ChevronLeft-BJjuFNNQ.js";
|
|
8
|
+
import { C as $ } from "../ChevronRight-5ZX3FodP.js";
|
|
9
9
|
const z = ({ item: r, onClick: l, style: c = {}, objectFit: e = "contain", disableVideoControls: s = !1 }) => r.type === "video" ? /* @__PURE__ */ o.jsx(
|
|
10
10
|
d,
|
|
11
11
|
{
|
|
@@ -22,7 +22,7 @@ const z = ({ item: r, onClick: l, style: c = {}, objectFit: e = "contain", disab
|
|
|
22
22
|
children: /* @__PURE__ */ o.jsx("source", { src: r.url, type: "video/mp4" })
|
|
23
23
|
}
|
|
24
24
|
) : /* @__PURE__ */ o.jsx(
|
|
25
|
-
|
|
25
|
+
F,
|
|
26
26
|
{
|
|
27
27
|
src: r.url,
|
|
28
28
|
alt: r.title || "",
|
|
@@ -200,7 +200,7 @@ const z = ({ item: r, onClick: l, style: c = {}, objectFit: e = "contain", disab
|
|
|
200
200
|
right: { xs: 8, sm: 10, md: 12 },
|
|
201
201
|
zIndex: (i) => i.zIndex.modal + 102
|
|
202
202
|
},
|
|
203
|
-
children: /* @__PURE__ */ o.jsx(
|
|
203
|
+
children: /* @__PURE__ */ o.jsx(N, {})
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
206
|
P && a && /* @__PURE__ */ o.jsxs(
|
|
@@ -242,7 +242,7 @@ const z = ({ item: r, onClick: l, style: c = {}, objectFit: e = "contain", disab
|
|
|
242
242
|
opacity: 0.5
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
|
-
children: /* @__PURE__ */ o.jsx(
|
|
245
|
+
children: /* @__PURE__ */ o.jsx(T, {})
|
|
246
246
|
}
|
|
247
247
|
),
|
|
248
248
|
/* @__PURE__ */ o.jsx(
|
|
@@ -263,7 +263,7 @@ const z = ({ item: r, onClick: l, style: c = {}, objectFit: e = "contain", disab
|
|
|
263
263
|
opacity: 0.5
|
|
264
264
|
}
|
|
265
265
|
},
|
|
266
|
-
children: /* @__PURE__ */ o.jsx(
|
|
266
|
+
children: /* @__PURE__ */ o.jsx($, {})
|
|
267
267
|
}
|
|
268
268
|
)
|
|
269
269
|
] })
|
package/dist/s-label/s-label.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Stack as o,
|
|
4
|
-
const a =
|
|
1
|
+
import { j as t } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
+
import { c as l } from "../createSvgIcon-DTNHY3_v.js";
|
|
3
|
+
import { Stack as o, Typography as n, Tooltip as i } from "@mui/material";
|
|
4
|
+
const a = l(/* @__PURE__ */ t.jsx("path", {
|
|
5
5
|
d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
|
|
6
|
-
}), "HelpOutlineOutlined"), m = ({ label:
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
6
|
+
}), "HelpOutlineOutlined"), m = ({ label: r, children: s, hint: e, sx: c }) => /* @__PURE__ */ t.jsxs(o, { width: "100%", sx: c, children: [
|
|
7
|
+
/* @__PURE__ */ t.jsxs(o, { direction: "row", alignItems: "center", mb: 1, children: [
|
|
8
|
+
/* @__PURE__ */ t.jsx(n, { variant: "subtitle2", color: "text.secondary", children: r }),
|
|
9
|
+
e ? /* @__PURE__ */ t.jsx(i, { title: e, placement: "top", children: /* @__PURE__ */ t.jsx(a, { sx: { marginLeft: "4px", fontSize: 16, color: "text.secondary" } }) }) : null
|
|
10
10
|
] }),
|
|
11
|
-
|
|
11
|
+
s
|
|
12
12
|
] });
|
|
13
13
|
m.displayName = "SLabel";
|
|
14
14
|
export {
|
|
@@ -3,9 +3,9 @@ import * as o from "react";
|
|
|
3
3
|
import { c as j } from "../createSvgIcon-DTNHY3_v.js";
|
|
4
4
|
import { Stack as M, OutlinedInput as C } from "@mui/material";
|
|
5
5
|
import { usePopover as b } from "../hooks/use-popover.js";
|
|
6
|
-
import {
|
|
7
|
-
import { M as I } from "../
|
|
8
|
-
import {
|
|
6
|
+
import { SChips as v } from "../s-chips/s-chips.js";
|
|
7
|
+
import { M as I } from "../Menu-_ZW9WiF2.js";
|
|
8
|
+
import { M as k } from "../MenuItem-DTapLhin.js";
|
|
9
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
11
|
}), "UnfoldMore"), L = ({
|
|
@@ -44,7 +44,7 @@ const E = j(/* @__PURE__ */ t.jsx("path", {
|
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
46
|
/* @__PURE__ */ t.jsx(
|
|
47
|
-
|
|
47
|
+
I,
|
|
48
48
|
{
|
|
49
49
|
anchorEl: f,
|
|
50
50
|
onClose: s.handleClose,
|
|
@@ -53,7 +53,7 @@ const E = j(/* @__PURE__ */ t.jsx("path", {
|
|
|
53
53
|
children: a.map((e) => {
|
|
54
54
|
const n = l.includes(e.value);
|
|
55
55
|
return /* @__PURE__ */ t.jsx(
|
|
56
|
-
|
|
56
|
+
k,
|
|
57
57
|
{
|
|
58
58
|
onClick: () => {
|
|
59
59
|
x(e.value, !n);
|
|
@@ -67,7 +67,7 @@ const E = j(/* @__PURE__ */ t.jsx("path", {
|
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ t.jsx(
|
|
70
|
-
|
|
70
|
+
v,
|
|
71
71
|
{
|
|
72
72
|
chips: a.filter((e) => l.includes(e.value)).map((e) => e.label),
|
|
73
73
|
...d
|
|
@@ -1,93 +1,91 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { useId as K, useState as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { SSkeleton as i } from "../s-skeleton/s-skeleton.js";
|
|
2
|
+
import { useId as K, useState as h, useEffect as P } from "react";
|
|
3
|
+
import { Box as o, Stack as a, Divider as M, Typography as r, IconButton as S } from "@mui/material";
|
|
5
4
|
import { SAvatar as Q } from "../s-avatar/s-avatar.js";
|
|
6
|
-
import {
|
|
5
|
+
import { SImageModal as X } from "../s-image-modal/s-image-modal.js";
|
|
7
6
|
import Z from "../s-lazy-image/s-lazy-image.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
7
|
+
import { SRating as _ } from "../s-rating/s-rating.js";
|
|
8
|
+
import { SSkeleton as n } from "../s-skeleton/s-skeleton.js";
|
|
9
|
+
import { c as T } from "../createSvgIcon-DTNHY3_v.js";
|
|
10
|
+
import { g as ee } from "../utils-DJIrqgo5.js";
|
|
11
|
+
const te = T(/* @__PURE__ */ e.jsx("path", {
|
|
11
12
|
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"),
|
|
13
|
+
}), "ThumbDown"), se = T(/* @__PURE__ */ e.jsx("path", {
|
|
13
14
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
showDivider: C = !0,
|
|
34
|
-
loading: O = !1,
|
|
35
|
-
sx: T = {}
|
|
15
|
+
}), "ThumbUp"), ie = ({
|
|
16
|
+
id: k,
|
|
17
|
+
userName: m,
|
|
18
|
+
userAvatar: R,
|
|
19
|
+
rating: L,
|
|
20
|
+
reviewContent: $,
|
|
21
|
+
datetime: z,
|
|
22
|
+
images: x,
|
|
23
|
+
userHelpfulVote: d = null,
|
|
24
|
+
helpfulYes: H = 0,
|
|
25
|
+
helpfulNo: V = 0,
|
|
26
|
+
onHelpfulVote: v,
|
|
27
|
+
showHelpfulSection: D = !0,
|
|
28
|
+
avatarSize: p = 48,
|
|
29
|
+
maxRating: E = 5,
|
|
30
|
+
readOnly: O = !0,
|
|
31
|
+
showDivider: w = !0,
|
|
32
|
+
loading: U = !1,
|
|
33
|
+
sx: y = {}
|
|
36
34
|
}) => {
|
|
37
|
-
const
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
id: `review-${
|
|
35
|
+
const W = K(), I = k ?? W, [B, g] = h(H), [N, j] = h(V), [l, f] = h(d), [Y, b] = h(!1), [A, u] = h(null), C = (s) => {
|
|
36
|
+
let i = s;
|
|
37
|
+
l === s ? (s === "yes" ? g((t) => Math.max(0, t - 1)) : j((t) => Math.max(0, t - 1)), f(null), i = null) : (l === "yes" ? g((t) => Math.max(0, t - 1)) : l === "no" && j((t) => Math.max(0, t - 1)), s === "yes" ? g((t) => t + 1) : j((t) => t + 1), f(s), i = s), v && v(I, i);
|
|
38
|
+
}, c = x?.map((s, i) => ({
|
|
39
|
+
id: `review-${I}-image-${i}`,
|
|
42
40
|
type: "image",
|
|
43
|
-
url:
|
|
44
|
-
title: `Review image ${
|
|
45
|
-
desc: `Image ${
|
|
46
|
-
})) || [], F = (
|
|
47
|
-
const
|
|
48
|
-
|
|
41
|
+
url: s,
|
|
42
|
+
title: `Review image ${i + 1}`,
|
|
43
|
+
desc: `Image ${i + 1} from ${m}'s review`
|
|
44
|
+
})) || [], F = (s) => {
|
|
45
|
+
const i = c[s];
|
|
46
|
+
i && (u(i), b(!0));
|
|
49
47
|
}, q = () => {
|
|
50
|
-
|
|
51
|
-
}, G = (
|
|
52
|
-
|
|
53
|
-
}, J =
|
|
48
|
+
b(!1), u(null);
|
|
49
|
+
}, G = (s) => {
|
|
50
|
+
u(s);
|
|
51
|
+
}, J = ee(z);
|
|
54
52
|
return P(() => {
|
|
55
|
-
|
|
56
|
-
}, [
|
|
53
|
+
f(d);
|
|
54
|
+
}, [d]), U ? /* @__PURE__ */ e.jsxs(o, { sx: { py: 2, ...y }, children: [
|
|
57
55
|
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
58
|
-
/* @__PURE__ */ e.jsx(
|
|
59
|
-
/* @__PURE__ */ e.jsxs(
|
|
56
|
+
/* @__PURE__ */ e.jsx(n, { component: "rounded-avatar", width: p, height: p }),
|
|
57
|
+
/* @__PURE__ */ e.jsxs(o, { sx: { flex: 1 }, children: [
|
|
60
58
|
/* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
59
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: 120, height: 20 }),
|
|
60
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: 80, height: 16 })
|
|
63
61
|
] }),
|
|
64
|
-
/* @__PURE__ */ e.jsx(
|
|
65
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
+
/* @__PURE__ */ e.jsx(o, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(n, { variant: "text", width: 100, height: 20 }) }),
|
|
63
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
|
|
66
64
|
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
|
|
67
|
-
/* @__PURE__ */ e.jsx(
|
|
68
|
-
/* @__PURE__ */ e.jsx(
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
/* @__PURE__ */ e.jsx(
|
|
65
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: 140, height: 16, sx: { mr: 2 } }),
|
|
66
|
+
/* @__PURE__ */ e.jsx(n, { component: "icon-button" }),
|
|
67
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: 20, height: 16 }),
|
|
68
|
+
/* @__PURE__ */ e.jsx(n, { component: "icon-button" }),
|
|
69
|
+
/* @__PURE__ */ e.jsx(n, { variant: "text", width: 20, height: 16 })
|
|
72
70
|
] })
|
|
73
71
|
] })
|
|
74
72
|
] }),
|
|
75
|
-
|
|
76
|
-
] }) : /* @__PURE__ */ e.jsxs(
|
|
73
|
+
w && /* @__PURE__ */ e.jsx(M, { sx: { mt: 2 } })
|
|
74
|
+
] }) : /* @__PURE__ */ e.jsxs(o, { sx: { py: 2, ...y }, children: [
|
|
77
75
|
/* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
|
|
78
|
-
/* @__PURE__ */ e.jsx(Q, { avatar:
|
|
79
|
-
/* @__PURE__ */ e.jsxs(
|
|
76
|
+
/* @__PURE__ */ e.jsx(Q, { avatar: R, name: m, size: p }),
|
|
77
|
+
/* @__PURE__ */ e.jsxs(o, { sx: { flex: 1 }, children: [
|
|
80
78
|
/* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
79
|
+
/* @__PURE__ */ e.jsx(r, { variant: "subtitle2", fontWeight: "600", children: m }),
|
|
80
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(r, { variant: "caption", children: J }) })
|
|
83
81
|
] }),
|
|
84
|
-
/* @__PURE__ */ e.jsx(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
82
|
+
/* @__PURE__ */ e.jsx(o, { sx: { mb: 1 }, children: /* @__PURE__ */ e.jsx(_, { value: L, max: E, readOnly: O }) }),
|
|
83
|
+
/* @__PURE__ */ e.jsx(r, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: $ }),
|
|
84
|
+
x && x.length > 0 && /* @__PURE__ */ e.jsx(a, { direction: "row", spacing: 1, sx: { mb: 2, flexWrap: "wrap", gap: 1 }, children: x.map((s, i) => /* @__PURE__ */ e.jsx(
|
|
87
85
|
Z,
|
|
88
86
|
{
|
|
89
|
-
src:
|
|
90
|
-
alt: `Review image ${
|
|
87
|
+
src: s,
|
|
88
|
+
alt: `Review image ${i + 1}`,
|
|
91
89
|
width: 80,
|
|
92
90
|
height: 80,
|
|
93
91
|
variant: "rounded",
|
|
@@ -95,7 +93,7 @@ const ee = z(/* @__PURE__ */ e.jsx("path", {
|
|
|
95
93
|
objectFit: "cover",
|
|
96
94
|
cursor: "pointer"
|
|
97
95
|
},
|
|
98
|
-
onClick: () => F(
|
|
96
|
+
onClick: () => F(i),
|
|
99
97
|
onMouseEnter: (t) => {
|
|
100
98
|
t.currentTarget.style.opacity = "0.8";
|
|
101
99
|
},
|
|
@@ -103,60 +101,60 @@ const ee = z(/* @__PURE__ */ e.jsx("path", {
|
|
|
103
101
|
t.currentTarget.style.opacity = "1";
|
|
104
102
|
}
|
|
105
103
|
},
|
|
106
|
-
|
|
104
|
+
i
|
|
107
105
|
)) }),
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */ e.jsx(
|
|
106
|
+
D && /* @__PURE__ */ e.jsxs(a, { direction: "row", spacing: 1, sx: { display: "inline-flex", alignItems: "center" }, children: [
|
|
107
|
+
/* @__PURE__ */ e.jsx(r, { variant: "caption", sx: { mr: 2 }, children: "Was this review helpful?" }),
|
|
110
108
|
/* @__PURE__ */ e.jsx(
|
|
111
|
-
|
|
109
|
+
S,
|
|
112
110
|
{
|
|
113
|
-
onClick: () =>
|
|
111
|
+
onClick: () => C("yes"),
|
|
114
112
|
sx: {
|
|
115
|
-
color:
|
|
113
|
+
color: l === "yes" ? "primary.main" : "text.secondary",
|
|
116
114
|
"&:hover": {
|
|
117
115
|
backgroundColor: "action.hover"
|
|
118
116
|
}
|
|
119
117
|
},
|
|
120
|
-
children: /* @__PURE__ */ e.jsx(
|
|
118
|
+
children: /* @__PURE__ */ e.jsx(se, { fontSize: "small" })
|
|
121
119
|
}
|
|
122
120
|
),
|
|
123
|
-
/* @__PURE__ */ e.jsx(
|
|
121
|
+
/* @__PURE__ */ e.jsx(r, { variant: "caption", children: B }),
|
|
124
122
|
/* @__PURE__ */ e.jsx(
|
|
125
|
-
|
|
123
|
+
S,
|
|
126
124
|
{
|
|
127
|
-
onClick: () =>
|
|
125
|
+
onClick: () => C("no"),
|
|
128
126
|
sx: {
|
|
129
|
-
color:
|
|
127
|
+
color: l === "no" ? "error.main" : "text.secondary",
|
|
130
128
|
ml: 1,
|
|
131
129
|
"&:hover": {
|
|
132
130
|
backgroundColor: "action.hover"
|
|
133
131
|
}
|
|
134
132
|
},
|
|
135
|
-
children: /* @__PURE__ */ e.jsx(
|
|
133
|
+
children: /* @__PURE__ */ e.jsx(te, { fontSize: "small" })
|
|
136
134
|
}
|
|
137
135
|
),
|
|
138
|
-
/* @__PURE__ */ e.jsx(
|
|
136
|
+
/* @__PURE__ */ e.jsx(r, { variant: "caption", children: N })
|
|
139
137
|
] })
|
|
140
138
|
] })
|
|
141
139
|
] }),
|
|
142
|
-
|
|
140
|
+
w && /* @__PURE__ */ e.jsx(M, { sx: { mt: 2 } }),
|
|
143
141
|
/* @__PURE__ */ e.jsx(
|
|
144
|
-
|
|
142
|
+
X,
|
|
145
143
|
{
|
|
146
|
-
isOpen:
|
|
144
|
+
isOpen: Y,
|
|
147
145
|
onClose: q,
|
|
148
146
|
selectedItem: A,
|
|
149
147
|
onItemChange: G,
|
|
150
|
-
mediaItems:
|
|
151
|
-
showNavigation:
|
|
152
|
-
showThumbnailDock:
|
|
153
|
-
showCounter:
|
|
148
|
+
mediaItems: c,
|
|
149
|
+
showNavigation: c.length > 1,
|
|
150
|
+
showThumbnailDock: c.length > 1,
|
|
151
|
+
showCounter: c.length > 1
|
|
154
152
|
}
|
|
155
153
|
)
|
|
156
154
|
] });
|
|
157
155
|
};
|
|
158
|
-
|
|
156
|
+
ie.displayName = "SReview";
|
|
159
157
|
export {
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
ie as SReview,
|
|
159
|
+
ie as default
|
|
162
160
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { SelectProps } from '@mui/material';
|
|
2
3
|
/** Base type constraint for select options - can be primitives or objects */
|
|
3
4
|
type BaseOption = string | number | Record<string, unknown>;
|
|
@@ -29,6 +30,8 @@ export type SSelectProps<T extends BaseOption = string> = Omit<SelectProps, 'err
|
|
|
29
30
|
searchable?: boolean;
|
|
30
31
|
/** Placeholder text for the search input */
|
|
31
32
|
searchPlaceholder?: string;
|
|
33
|
+
/** Custom render function for options */
|
|
34
|
+
renderOption?: (option: T) => ReactNode;
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* A flexible select component that handles both primitive and object options with form integration.
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Select as
|
|
5
|
-
import { SForm as
|
|
6
|
-
const
|
|
2
|
+
import { forwardRef as F, useState as p } from "react";
|
|
3
|
+
import { c as M } from "../createSvgIcon-DTNHY3_v.js";
|
|
4
|
+
import { Select as T, ListSubheader as B, TextField as D, InputAdornment as K, MenuItem as f, Box as x } from "@mui/material";
|
|
5
|
+
import { SForm as N } from "../s-form/s-form.js";
|
|
6
|
+
const R = M(/* @__PURE__ */ t.jsx("path", {
|
|
7
7
|
d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
|
|
8
|
-
}), "Search"),
|
|
8
|
+
}), "Search"), W = F(
|
|
9
9
|
({
|
|
10
|
-
options:
|
|
11
|
-
optionLabel:
|
|
12
|
-
optionValue:
|
|
13
|
-
placeholder:
|
|
14
|
-
label:
|
|
15
|
-
error:
|
|
16
|
-
required:
|
|
17
|
-
simple:
|
|
18
|
-
htmlFor:
|
|
19
|
-
searchable:
|
|
20
|
-
searchPlaceholder:
|
|
10
|
+
options: o = [],
|
|
11
|
+
optionLabel: y = "name",
|
|
12
|
+
optionValue: C = "id",
|
|
13
|
+
placeholder: g,
|
|
14
|
+
label: b = "",
|
|
15
|
+
error: I,
|
|
16
|
+
required: w = !1,
|
|
17
|
+
simple: P = !1,
|
|
18
|
+
htmlFor: v,
|
|
19
|
+
searchable: r = !1,
|
|
20
|
+
searchPlaceholder: V = "",
|
|
21
|
+
renderOption: u,
|
|
21
22
|
...s
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ t.jsx(
|
|
25
|
-
|
|
23
|
+
}, $) => {
|
|
24
|
+
const h = s.value !== void 0, [L, k] = p(s.multiple ? [] : null), z = h ? s.value : L, [i, j] = p(""), [A, S] = p(!1), a = (e) => String(typeof e == "string" || typeof e == "number" ? e : e[y]), l = (e) => typeof e == "string" || typeof e == "number" ? e : e[C], m = r && i ? o.filter((e) => a(e).toLowerCase().includes(i.toLowerCase())) : o;
|
|
25
|
+
return /* @__PURE__ */ t.jsx(N, { error: I, label: b, required: w, htmlFor: v, children: /* @__PURE__ */ t.jsxs(
|
|
26
|
+
T,
|
|
26
27
|
{
|
|
27
|
-
id:
|
|
28
|
+
id: v,
|
|
28
29
|
displayEmpty: !0,
|
|
29
30
|
fullWidth: !0,
|
|
30
31
|
defaultValue: "",
|
|
31
|
-
ref:
|
|
32
|
-
open:
|
|
33
|
-
onOpen:
|
|
34
|
-
onClose:
|
|
35
|
-
|
|
32
|
+
ref: $,
|
|
33
|
+
open: r ? A : void 0,
|
|
34
|
+
onOpen: r ? () => S(!0) : void 0,
|
|
35
|
+
onClose: r ? () => {
|
|
36
|
+
S(!1), j("");
|
|
36
37
|
} : void 0,
|
|
37
|
-
MenuProps:
|
|
38
|
+
MenuProps: r ? {
|
|
38
39
|
autoFocus: !1,
|
|
39
40
|
PaperProps: {
|
|
40
41
|
onKeyDown: (e) => {
|
|
@@ -44,38 +45,38 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
44
45
|
} : void 0,
|
|
45
46
|
renderValue: s.multiple ? (e) => {
|
|
46
47
|
const n = e;
|
|
47
|
-
return n.length === 0 ? /* @__PURE__ */ t.jsx(
|
|
48
|
-
const
|
|
49
|
-
return
|
|
48
|
+
return n.length === 0 ? /* @__PURE__ */ t.jsx(x, { component: "span", sx: { color: "divider" }, children: g }) : n?.map((d) => {
|
|
49
|
+
const c = o.find((E) => l(E) === l(d));
|
|
50
|
+
return c ? a(c) : "";
|
|
50
51
|
}).filter(Boolean).join(", ");
|
|
51
52
|
} : (e) => {
|
|
52
53
|
const n = e;
|
|
53
54
|
if (n == null || n === "")
|
|
54
|
-
return /* @__PURE__ */ t.jsx(
|
|
55
|
-
if (
|
|
55
|
+
return /* @__PURE__ */ t.jsx(x, { component: "span", sx: { color: "divider" }, children: g });
|
|
56
|
+
if (P)
|
|
56
57
|
return a(n);
|
|
57
|
-
const
|
|
58
|
-
return
|
|
58
|
+
const d = o.find((c) => l(c) === l(n));
|
|
59
|
+
return d ? a(d) : "";
|
|
59
60
|
},
|
|
60
61
|
...s,
|
|
61
|
-
value:
|
|
62
|
+
value: o.length ? z ?? "" : "",
|
|
62
63
|
onChange: (e, n) => {
|
|
63
64
|
if (s.onChange)
|
|
64
65
|
s.onChange(e, n);
|
|
65
|
-
else if (!
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
else if (!h) {
|
|
67
|
+
const d = e.target.value;
|
|
68
|
+
k(d);
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
r && /* @__PURE__ */ t.jsx(B, { sx: { px: 2, py: 1, position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
73
|
+
D,
|
|
73
74
|
{
|
|
74
75
|
fullWidth: !0,
|
|
75
76
|
autoFocus: !0,
|
|
76
|
-
placeholder:
|
|
77
|
-
value:
|
|
78
|
-
onChange: (e) =>
|
|
77
|
+
placeholder: V,
|
|
78
|
+
value: i,
|
|
79
|
+
onChange: (e) => j(e.target.value),
|
|
79
80
|
onKeyDown: (e) => {
|
|
80
81
|
e.key !== "Escape" && e.stopPropagation();
|
|
81
82
|
},
|
|
@@ -83,42 +84,42 @@ const K = E(/* @__PURE__ */ t.jsx("path", {
|
|
|
83
84
|
e.stopPropagation();
|
|
84
85
|
},
|
|
85
86
|
InputProps: {
|
|
86
|
-
startAdornment: /* @__PURE__ */ t.jsx(
|
|
87
|
+
startAdornment: /* @__PURE__ */ t.jsx(K, { position: "start", children: /* @__PURE__ */ t.jsx(R, { fontSize: "small" }) })
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
) }),
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
r ? m?.length > 0 ? m.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
92
|
+
f,
|
|
92
93
|
{
|
|
93
94
|
disabled: e?.disabled ?? !1,
|
|
94
|
-
value:
|
|
95
|
-
children: a(e)
|
|
95
|
+
value: l(e),
|
|
96
|
+
children: u ? u(e) : a(e)
|
|
96
97
|
},
|
|
97
|
-
`${
|
|
98
|
-
)) :
|
|
99
|
-
|
|
98
|
+
`${l(e)}-${n}`
|
|
99
|
+
)) : i ? /* @__PURE__ */ t.jsx(f, { disabled: !0, children: /* @__PURE__ */ t.jsx(x, { sx: { color: "text.secondary", textAlign: "center", width: "100%" }, children: "No results found" }) }) : o?.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
100
|
+
f,
|
|
100
101
|
{
|
|
101
102
|
disabled: e?.disabled ?? !1,
|
|
102
|
-
value:
|
|
103
|
-
children: a(e)
|
|
103
|
+
value: l(e),
|
|
104
|
+
children: u ? u(e) : a(e)
|
|
104
105
|
},
|
|
105
|
-
`${
|
|
106
|
-
)) :
|
|
107
|
-
|
|
106
|
+
`${l(e)}-${n}`
|
|
107
|
+
)) : o?.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
108
|
+
f,
|
|
108
109
|
{
|
|
109
110
|
disabled: e?.disabled ?? !1,
|
|
110
|
-
value:
|
|
111
|
-
children: a(e)
|
|
111
|
+
value: l(e),
|
|
112
|
+
children: u ? u(e) : a(e)
|
|
112
113
|
},
|
|
113
|
-
`${
|
|
114
|
+
`${l(e)}-${n}`
|
|
114
115
|
))
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
) });
|
|
118
119
|
}
|
|
119
120
|
);
|
|
120
|
-
|
|
121
|
+
W.displayName = "SSelect";
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
W as SSelect,
|
|
124
|
+
W as default
|
|
124
125
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as l } from "../jsx-runtime-tc70JA_2.js";
|
|
2
|
-
import u from "
|
|
3
|
-
import
|
|
2
|
+
import { STextField as u } from "../s-text-field/s-text-field.js";
|
|
3
|
+
import m from "./stripe-input.js";
|
|
4
4
|
const a = (r) => {
|
|
5
5
|
const { helperText: p, slotProps: t, inputProps: o, error: e, labelErrorMessage: i, stripeElement: n, ...s } = r;
|
|
6
6
|
return /* @__PURE__ */ l.jsx(
|
|
7
|
-
|
|
7
|
+
u,
|
|
8
8
|
{
|
|
9
9
|
fullWidth: !0,
|
|
10
10
|
slotProps: {
|
|
@@ -21,7 +21,7 @@ const a = (r) => {
|
|
|
21
21
|
component: n
|
|
22
22
|
// Pass Stripe element as component
|
|
23
23
|
},
|
|
24
|
-
inputComponent:
|
|
24
|
+
inputComponent: m
|
|
25
25
|
// Custom input component for Stripe integration
|
|
26
26
|
}
|
|
27
27
|
},
|