@solostylist/ui-kit 1.0.130 → 1.0.132
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,23 +1,23 @@
|
|
|
1
1
|
import { j as p } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as s } from "react";
|
|
3
3
|
import { useColorScheme as g, useTheme as d, Button as h, alpha as e, Box as n } from "@mui/material";
|
|
4
4
|
import b from "../s-moving-border/s-moving-border.js";
|
|
5
|
-
const
|
|
5
|
+
const f = ({
|
|
6
6
|
borderRadius: r = 12,
|
|
7
7
|
children: i,
|
|
8
8
|
duration: o = 6e3,
|
|
9
9
|
// 6 second animation cycle
|
|
10
10
|
...l
|
|
11
11
|
}) => {
|
|
12
|
-
const m =
|
|
12
|
+
const m = s(null), { mode: a } = g(), t = d(), x = a === "light" ? (t.vars || t).palette.primary.main : (t.vars || t).palette.primary.light, c = a === "light" ? 90 : 110;
|
|
13
13
|
return /* @__PURE__ */ p.jsx(
|
|
14
14
|
b,
|
|
15
15
|
{
|
|
16
16
|
duration: o,
|
|
17
17
|
borderRadius: r,
|
|
18
18
|
height: 60,
|
|
19
|
-
glowSize:
|
|
20
|
-
glowColor:
|
|
19
|
+
glowSize: c,
|
|
20
|
+
glowColor: x,
|
|
21
21
|
children: /* @__PURE__ */ p.jsx(
|
|
22
22
|
h,
|
|
23
23
|
{
|
|
@@ -154,6 +154,13 @@ const y = ({
|
|
|
154
154
|
},
|
|
155
155
|
// Text glow animation on parent hover
|
|
156
156
|
"button:hover &": {
|
|
157
|
+
backgroundPosition: "100% 0, 50% 50%",
|
|
158
|
+
transform: "scale(1.02)",
|
|
159
|
+
textShadow: a === "light" ? `0 2px 4px ${e(t.palette.common.black, 0.12)},
|
|
160
|
+
0 4px 12px ${e(t.palette.primary.main, 0.15)},
|
|
161
|
+
0 0 20px ${e(t.palette.primary.main, 0.1)}` : `0 3px 6px ${e(t.palette.common.black, 0.5)},
|
|
162
|
+
0 6px 16px ${e(t.palette.primary.light, 0.25)},
|
|
163
|
+
0 0 30px ${e(t.palette.primary.light, 0.15)}`,
|
|
157
164
|
animation: "textGlow 2s ease-in-out infinite alternate"
|
|
158
165
|
},
|
|
159
166
|
// Keyframe animation for subtle text glow
|
|
@@ -201,5 +208,5 @@ const y = ({
|
|
|
201
208
|
);
|
|
202
209
|
};
|
|
203
210
|
export {
|
|
204
|
-
|
|
211
|
+
f as default
|
|
205
212
|
};
|
|
@@ -28,6 +28,10 @@ export type SSelectProps<T extends BaseOption = string> = Omit<SelectProps, 'err
|
|
|
28
28
|
simple?: boolean;
|
|
29
29
|
/** HTML id attribute for the select element */
|
|
30
30
|
htmlFor?: string;
|
|
31
|
+
/** Enable search/filter functionality in the dropdown */
|
|
32
|
+
searchable?: boolean;
|
|
33
|
+
/** Placeholder text for the search input */
|
|
34
|
+
searchPlaceholder?: string;
|
|
31
35
|
};
|
|
32
36
|
/**
|
|
33
37
|
* SSelect - A flexible select component that handles both primitive and object options
|
|
@@ -37,6 +41,7 @@ export type SSelectProps<T extends BaseOption = string> = Omit<SelectProps, 'err
|
|
|
37
41
|
* - Generic typing for type-safe option handling
|
|
38
42
|
* - Support for both primitive (string/number) and object options
|
|
39
43
|
* - Configurable option label and value extraction for objects
|
|
44
|
+
* - Optional search/filter functionality for large option lists
|
|
40
45
|
* - Placeholder support with proper styling
|
|
41
46
|
* - Single and multiple selection modes
|
|
42
47
|
* - Simple mode for primitive value rendering
|
|
@@ -1,68 +1,117 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { j as t } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
+
import { forwardRef as E, useState as f } from "react";
|
|
3
|
+
import { c as F } from "../createSvgIcon-By5UWB4_.js";
|
|
4
|
+
import { Select as M, ListSubheader as T, TextField as A, InputAdornment as B, MenuItem as p, Box as x } from "@mui/material";
|
|
5
|
+
import D from "../s-form/s-form.js";
|
|
6
|
+
const K = F(/* @__PURE__ */ t.jsx("path", {
|
|
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"), J = E(
|
|
6
9
|
({
|
|
7
|
-
options:
|
|
8
|
-
optionLabel:
|
|
9
|
-
optionValue:
|
|
10
|
-
placeholder:
|
|
11
|
-
label:
|
|
12
|
-
error:
|
|
13
|
-
required:
|
|
14
|
-
variant:
|
|
15
|
-
simple:
|
|
16
|
-
htmlFor:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
options: o = [],
|
|
11
|
+
optionLabel: y = "name",
|
|
12
|
+
optionValue: C = "id",
|
|
13
|
+
placeholder: g,
|
|
14
|
+
label: m = "",
|
|
15
|
+
error: I,
|
|
16
|
+
required: P = !1,
|
|
17
|
+
variant: R = "outlined",
|
|
18
|
+
simple: b = !1,
|
|
19
|
+
htmlFor: h,
|
|
20
|
+
searchable: r = !1,
|
|
21
|
+
searchPlaceholder: w = "",
|
|
22
|
+
...a
|
|
23
|
+
}, V) => {
|
|
24
|
+
const v = a.value !== void 0, [L, k] = f(a.multiple ? [] : null), z = v ? a.value : L, [d, j] = f(""), [O, S] = f(!1), s = (e) => String(typeof e == "string" || typeof e == "number" ? e : e[y]), l = (e) => typeof e == "string" || typeof e == "number" ? e : e[C], c = r && d ? o.filter((e) => s(e).toLowerCase().includes(d.toLowerCase())) : o;
|
|
25
|
+
return /* @__PURE__ */ t.jsx(D, { error: I, label: m, required: P, htmlFor: h, children: /* @__PURE__ */ t.jsxs(
|
|
26
|
+
M,
|
|
22
27
|
{
|
|
23
|
-
id:
|
|
28
|
+
id: h,
|
|
24
29
|
displayEmpty: !0,
|
|
25
30
|
fullWidth: !0,
|
|
26
31
|
defaultValue: "",
|
|
27
|
-
ref:
|
|
28
|
-
|
|
32
|
+
ref: V,
|
|
33
|
+
open: r ? O : void 0,
|
|
34
|
+
onOpen: r ? () => S(!0) : void 0,
|
|
35
|
+
onClose: r ? () => {
|
|
36
|
+
S(!1), j("");
|
|
37
|
+
} : void 0,
|
|
38
|
+
MenuProps: r ? {
|
|
39
|
+
autoFocus: !1,
|
|
40
|
+
PaperProps: {
|
|
41
|
+
onKeyDown: (e) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} : void 0,
|
|
46
|
+
renderValue: a.multiple ? (e) => {
|
|
29
47
|
const n = e;
|
|
30
|
-
return n.length === 0 ? /* @__PURE__ */
|
|
31
|
-
const
|
|
32
|
-
return
|
|
48
|
+
return n.length === 0 ? /* @__PURE__ */ t.jsx(x, { component: "span", sx: { color: "text.secondary" }, children: g }) : n == null ? void 0 : n.map((u) => {
|
|
49
|
+
const i = o.find(($) => l($) === l(u));
|
|
50
|
+
return i ? s(i) : "";
|
|
33
51
|
}).filter(Boolean).join(", ");
|
|
34
52
|
} : (e) => {
|
|
35
53
|
const n = e;
|
|
36
54
|
if (n == null || n === "")
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
40
|
-
const
|
|
41
|
-
return
|
|
55
|
+
return /* @__PURE__ */ t.jsx(x, { component: "span", sx: { color: "text.secondary" }, children: g });
|
|
56
|
+
if (b)
|
|
57
|
+
return s(n);
|
|
58
|
+
const u = o.find((i) => l(i) === l(n));
|
|
59
|
+
return u ? s(u) : "";
|
|
42
60
|
},
|
|
43
|
-
...
|
|
44
|
-
value:
|
|
61
|
+
...a,
|
|
62
|
+
value: o.length ? z ?? "" : "",
|
|
45
63
|
onChange: (e, n) => {
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
else if (!
|
|
49
|
-
const
|
|
50
|
-
|
|
64
|
+
if (a.onChange)
|
|
65
|
+
a.onChange(e, n);
|
|
66
|
+
else if (!v) {
|
|
67
|
+
const u = e.target.value;
|
|
68
|
+
k(u);
|
|
51
69
|
}
|
|
52
70
|
},
|
|
53
|
-
children:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
children: [
|
|
72
|
+
r && /* @__PURE__ */ t.jsx(T, { sx: { px: 2, py: 1, position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
73
|
+
A,
|
|
74
|
+
{
|
|
75
|
+
size: "small",
|
|
76
|
+
fullWidth: !0,
|
|
77
|
+
autoFocus: !0,
|
|
78
|
+
placeholder: w,
|
|
79
|
+
value: d,
|
|
80
|
+
onChange: (e) => j(e.target.value),
|
|
81
|
+
onKeyDown: (e) => {
|
|
82
|
+
e.key !== "Escape" && e.stopPropagation();
|
|
83
|
+
},
|
|
84
|
+
onClick: (e) => {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
},
|
|
87
|
+
InputProps: {
|
|
88
|
+
startAdornment: /* @__PURE__ */ t.jsx(B, { position: "start", children: /* @__PURE__ */ t.jsx(K, { fontSize: "small" }) })
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
) }),
|
|
92
|
+
(c == null ? void 0 : c.length) > 0 ? c.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
93
|
+
p,
|
|
94
|
+
{
|
|
95
|
+
disabled: (e == null ? void 0 : e.disabled) ?? !1,
|
|
96
|
+
value: l(e),
|
|
97
|
+
children: s(e)
|
|
98
|
+
},
|
|
99
|
+
`${l(e)}-${n}`
|
|
100
|
+
)) : r && d && /* @__PURE__ */ t.jsx(p, { disabled: !0, children: /* @__PURE__ */ t.jsx(x, { sx: { color: "text.secondary", fontStyle: "italic" }, children: "No results found" }) }),
|
|
101
|
+
!r && (o == null ? void 0 : o.map((e, n) => /* @__PURE__ */ t.jsx(
|
|
102
|
+
p,
|
|
103
|
+
{
|
|
104
|
+
disabled: (e == null ? void 0 : e.disabled) ?? !1,
|
|
105
|
+
value: l(e),
|
|
106
|
+
children: s(e)
|
|
107
|
+
},
|
|
108
|
+
`${l(e)}-${n}`
|
|
109
|
+
)))
|
|
110
|
+
]
|
|
62
111
|
}
|
|
63
112
|
) });
|
|
64
113
|
}
|
|
65
114
|
);
|
|
66
115
|
export {
|
|
67
|
-
|
|
116
|
+
J as default
|
|
68
117
|
};
|
|
@@ -260,10 +260,10 @@ const l = m(), e = {
|
|
|
260
260
|
}, x = {
|
|
261
261
|
palette: {
|
|
262
262
|
gradient: {
|
|
263
|
-
primary: "linear-gradient(90deg, #
|
|
264
|
-
secondary: "linear-gradient(90deg, #
|
|
265
|
-
indigo: "linear-gradient(to right, transparent,
|
|
266
|
-
sky: "linear-gradient(to right, transparent,
|
|
263
|
+
primary: "linear-gradient(90deg, #0ea5e9 0%, #2563eb 100%)",
|
|
264
|
+
secondary: "linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%)",
|
|
265
|
+
indigo: "linear-gradient(to right, transparent, rgba(79, 70, 229, 0.6), transparent)",
|
|
266
|
+
sky: "linear-gradient(to right, transparent, rgba(14, 165, 233, 0.55), transparent)"
|
|
267
267
|
},
|
|
268
268
|
blackAlpha: {
|
|
269
269
|
zero: h[0],
|