@solostylist/ui-kit 1.0.21 → 1.0.22
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,7 +1,5 @@
|
|
|
1
1
|
import { SelectProps } from '@mui/material';
|
|
2
|
-
type BaseOption = string | number |
|
|
3
|
-
[key: string]: unknown;
|
|
4
|
-
};
|
|
2
|
+
type BaseOption = string | number | Record<string, any>;
|
|
5
3
|
export type SSelectProps<T extends BaseOption = string> = Omit<SelectProps, 'error' | 'variant'> & {
|
|
6
4
|
options?: T[];
|
|
7
5
|
optionLabel?: T extends object ? keyof T : never;
|
|
@@ -12,8 +12,13 @@ export default SSnackbarMessage;
|
|
|
12
12
|
export interface SnackbarMessageOpenOptions {
|
|
13
13
|
message: string;
|
|
14
14
|
}
|
|
15
|
+
export interface handleOpenParams {
|
|
16
|
+
snackbarMessageOptions: SnackbarMessageOpenOptions;
|
|
17
|
+
snackbarProps?: SnackbarProps;
|
|
18
|
+
alertProps?: AlertProps;
|
|
19
|
+
}
|
|
15
20
|
export interface SnackbarMessageContextProps {
|
|
16
|
-
handleOpen: (snackbarMessageOptions
|
|
21
|
+
handleOpen: ({ snackbarMessageOptions, snackbarProps, alertProps }: handleOpenParams) => void;
|
|
17
22
|
handleClose: () => void;
|
|
18
23
|
open: boolean;
|
|
19
24
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { Snackbar as
|
|
4
|
-
import { useDialog as
|
|
5
|
-
const
|
|
3
|
+
import { Snackbar as h, Alert as S } from "@mui/material";
|
|
4
|
+
import { useDialog as k } from "../hooks/use-dialog.js";
|
|
5
|
+
const x = ({
|
|
6
6
|
message: s,
|
|
7
7
|
onClose: e = () => {
|
|
8
8
|
},
|
|
@@ -10,23 +10,23 @@ const k = ({
|
|
|
10
10
|
snackbarProps: n,
|
|
11
11
|
alertProps: o
|
|
12
12
|
}) => /* @__PURE__ */ t.jsx(
|
|
13
|
-
|
|
13
|
+
h,
|
|
14
14
|
{
|
|
15
15
|
open: r,
|
|
16
16
|
autoHideDuration: 1e4,
|
|
17
17
|
onClose: e,
|
|
18
18
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
19
19
|
...n,
|
|
20
|
-
children: /* @__PURE__ */ t.jsx(
|
|
20
|
+
children: /* @__PURE__ */ t.jsx(S, { onClose: e, severity: "error", sx: { width: "100%" }, ...o, children: s })
|
|
21
21
|
}
|
|
22
|
-
), c = a.createContext(null),
|
|
23
|
-
const e =
|
|
22
|
+
), c = a.createContext(null), M = ({ children: s }) => {
|
|
23
|
+
const e = k(), [r, n] = a.useState({
|
|
24
24
|
message: ""
|
|
25
25
|
}), [o, l] = a.useState({}), [i, u] = a.useState({}), p = {
|
|
26
26
|
handleOpen: a.useCallback(
|
|
27
|
-
(d, g = {}, m = {}) => {
|
|
28
|
-
const { message:
|
|
29
|
-
n({ message:
|
|
27
|
+
({ snackbarMessageOptions: d, snackbarProps: g = {}, alertProps: m = {} }) => {
|
|
28
|
+
const { message: b } = d;
|
|
29
|
+
n({ message: b }), l(g), u(m), e.handleOpen();
|
|
30
30
|
},
|
|
31
31
|
[e]
|
|
32
32
|
),
|
|
@@ -35,7 +35,7 @@ const k = ({
|
|
|
35
35
|
};
|
|
36
36
|
return /* @__PURE__ */ t.jsxs(c.Provider, { value: p, children: [
|
|
37
37
|
/* @__PURE__ */ t.jsx(
|
|
38
|
-
|
|
38
|
+
x,
|
|
39
39
|
{
|
|
40
40
|
open: e.open,
|
|
41
41
|
message: r == null ? void 0 : r.message,
|
|
@@ -53,7 +53,7 @@ const k = ({
|
|
|
53
53
|
return s;
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
M as SnackbarMessageProvider,
|
|
57
|
+
x as default,
|
|
58
58
|
j as useSnackbarMessage
|
|
59
59
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as l } from "../../jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as i from "react";
|
|
3
3
|
import { c as p } from "../../createSvgIcon-CFj_BoDp.js";
|
|
4
4
|
import { gray as r, brand as n } from "../theme-primitives.js";
|
|
5
|
-
import { d as c, m as
|
|
5
|
+
import { d as c, m as e } from "../../menuItemClasses-D9_8SIPH.js";
|
|
6
6
|
import { g as b } from "../../generateUtilityClasses-DStZbN71.js";
|
|
7
7
|
import { s } from "../../selectClasses-BDdGqseQ.js";
|
|
8
8
|
import { b as u } from "../../buttonBaseClasses-D9p3ujfW.js";
|
|
9
|
-
import { a
|
|
9
|
+
import { a } from "../../createTheme-DkVAXJiq.js";
|
|
10
10
|
const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
11
11
|
d: "m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L12.7 3.7a.996.996 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0zm0 12.34-2.46-2.46a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0z"
|
|
12
12
|
}), "UnfoldMoreRounded"), t = b("MuiTab", ["root", "labelIcon", "textColorInherit", "textColorPrimary", "textColorSecondary", "selected", "disabled", "fullWidth", "wrapped", "iconWrapper", "icon"]), R = {
|
|
@@ -15,12 +15,12 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
15
15
|
root: ({ theme: o }) => ({
|
|
16
16
|
borderRadius: (o.vars || o).shape.borderRadius,
|
|
17
17
|
padding: "6px 8px",
|
|
18
|
-
[`&.${
|
|
18
|
+
[`&.${e.focusVisible}`]: {
|
|
19
19
|
backgroundColor: "transparent"
|
|
20
20
|
},
|
|
21
|
-
[`&.${
|
|
22
|
-
[`&.${
|
|
23
|
-
backgroundColor:
|
|
21
|
+
[`&.${e.selected}`]: {
|
|
22
|
+
[`&.${e.focusVisible}`]: {
|
|
23
|
+
backgroundColor: a(o.palette.action.selected, 0.3)
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
})
|
|
@@ -43,7 +43,7 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
43
43
|
boxShadow: "hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px",
|
|
44
44
|
[`& .${u.root}`]: {
|
|
45
45
|
"&.Mui-selected": {
|
|
46
|
-
backgroundColor:
|
|
46
|
+
backgroundColor: a(o.palette.action.selected, 0.3)
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
...o.applyStyles("dark", {
|
|
@@ -55,7 +55,7 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
55
55
|
},
|
|
56
56
|
MuiSelect: {
|
|
57
57
|
defaultProps: {
|
|
58
|
-
IconComponent:
|
|
58
|
+
IconComponent: i.forwardRef((o, d) => /* @__PURE__ */ l.jsx(x, { fontSize: "small", ...o, ref: d }))
|
|
59
59
|
},
|
|
60
60
|
styleOverrides: {
|
|
61
61
|
root: ({ theme: o }) => ({
|
|
@@ -80,9 +80,9 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
80
80
|
borderRadius: (o.vars || o).shape.borderRadius,
|
|
81
81
|
borderColor: r[700],
|
|
82
82
|
backgroundColor: (o.vars || o).palette.background.paper,
|
|
83
|
-
boxShadow: `inset 0 1px 0 1px ${
|
|
83
|
+
boxShadow: `inset 0 1px 0 1px ${a(r[700], 0.15)}, inset 0 -1px 0 1px hsla(220, 0%, 0%, 0.7)`,
|
|
84
84
|
"&:hover": {
|
|
85
|
-
borderColor:
|
|
85
|
+
borderColor: a(r[700], 0.7),
|
|
86
86
|
backgroundColor: (o.vars || o).palette.background.paper,
|
|
87
87
|
boxShadow: "none"
|
|
88
88
|
},
|
|
@@ -96,11 +96,7 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
96
96
|
})
|
|
97
97
|
}),
|
|
98
98
|
select: ({ theme: o }) => ({
|
|
99
|
-
display: "flex",
|
|
100
|
-
alignItems: "center",
|
|
101
99
|
...o.applyStyles("dark", {
|
|
102
|
-
display: "flex",
|
|
103
|
-
alignItems: "center",
|
|
104
100
|
"&:focus-visible": {
|
|
105
101
|
backgroundColor: r[900]
|
|
106
102
|
}
|
|
@@ -134,7 +130,7 @@ const x = p(/* @__PURE__ */ l.jsx("path", {
|
|
|
134
130
|
width: 0
|
|
135
131
|
},
|
|
136
132
|
"&:focus-visible": {
|
|
137
|
-
outline: `3px solid ${
|
|
133
|
+
outline: `3px solid ${a(n[500], 0.5)}`,
|
|
138
134
|
outlineOffset: "4px",
|
|
139
135
|
borderRadius: "2px"
|
|
140
136
|
}
|