@solostylist/ui-kit 1.0.18 → 1.0.19

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,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ReactImageGalleryProps } from 'react-image-gallery';
3
- export interface SImageGalleryProps extends ReactImageGalleryProps {
4
- }
2
+ import { default as ImageGallery } from 'react-image-gallery';
3
+ export type SImageGalleryProps = React.ComponentProps<typeof ImageGallery>;
5
4
  declare const SImageGallery: ({ ...props }: SImageGalleryProps) => React.JSX.Element;
6
5
  export default SImageGallery;
@@ -13,7 +13,7 @@ export interface SnackbarMessageOpenOptions {
13
13
  message: string;
14
14
  }
15
15
  export interface SnackbarMessageContextProps {
16
- handleOpen: (snackbarMessageOptions: SnackbarMessageOpenOptions) => void;
16
+ handleOpen: (snackbarMessageOptions: SnackbarMessageOpenOptions, snackbarProps?: SnackbarProps, alertProps?: AlertProps) => void;
17
17
  handleClose: () => void;
18
18
  open: boolean;
19
19
  }
@@ -1,50 +1,59 @@
1
- import { j as r } from "../jsx-runtime-C5mzlN2N.js";
2
- import * as n from "react";
3
- import { Snackbar as u, Alert as d } from "@mui/material";
4
- import { useDialog as g } from "../hooks/use-dialog.js";
5
- const m = ({
1
+ import { j as t } from "../jsx-runtime-C5mzlN2N.js";
2
+ import * as a from "react";
3
+ import { Snackbar as S, Alert as b } from "@mui/material";
4
+ import { useDialog as x } from "../hooks/use-dialog.js";
5
+ const k = ({
6
6
  message: s,
7
7
  onClose: e = () => {
8
8
  },
9
- open: a = !1,
10
- snackbarProps: t,
9
+ open: r = !1,
10
+ snackbarProps: n,
11
11
  alertProps: o
12
- }) => /* @__PURE__ */ r.jsx(
13
- u,
12
+ }) => /* @__PURE__ */ t.jsx(
13
+ S,
14
14
  {
15
- open: a,
15
+ open: r,
16
16
  autoHideDuration: 1e4,
17
17
  onClose: e,
18
18
  anchorOrigin: { vertical: "top", horizontal: "center" },
19
- ...t,
20
- children: /* @__PURE__ */ r.jsx(d, { onClose: e, severity: "error", sx: { width: "100%" }, ...o, children: s })
19
+ ...n,
20
+ children: /* @__PURE__ */ t.jsx(b, { onClose: e, severity: "error", sx: { width: "100%" }, ...o, children: s })
21
21
  }
22
- ), c = n.createContext(null), b = ({ children: s }) => {
23
- const e = g(), [a, t] = n.useState({
22
+ ), c = a.createContext(null), P = ({ children: s }) => {
23
+ const e = x(), [r, n] = a.useState({
24
24
  message: ""
25
- }), o = {
26
- handleOpen: n.useCallback(
27
- (i) => {
28
- const { message: l } = i;
29
- t({ message: l }), e.handleOpen();
25
+ }), [o, l] = a.useState({}), [i, u] = a.useState({}), p = {
26
+ handleOpen: a.useCallback(
27
+ (d, g = {}, m = {}) => {
28
+ const { message: h } = d;
29
+ n({ message: h }), l(g), u(m), e.handleOpen();
30
30
  },
31
31
  [e]
32
32
  ),
33
33
  handleClose: e.handleClose,
34
34
  open: e.open
35
35
  };
36
- return /* @__PURE__ */ r.jsxs(c.Provider, { value: o, children: [
37
- /* @__PURE__ */ r.jsx(m, { open: e.open, message: a == null ? void 0 : a.message, onClose: e.handleClose }),
36
+ return /* @__PURE__ */ t.jsxs(c.Provider, { value: p, children: [
37
+ /* @__PURE__ */ t.jsx(
38
+ k,
39
+ {
40
+ open: e.open,
41
+ message: r == null ? void 0 : r.message,
42
+ onClose: e.handleClose,
43
+ snackbarProps: o,
44
+ alertProps: i
45
+ }
46
+ ),
38
47
  s
39
48
  ] });
40
- }, S = () => {
41
- const s = n.useContext(c);
49
+ }, j = () => {
50
+ const s = a.useContext(c);
42
51
  if (!s)
43
52
  throw new Error("useSnackbarMessage must be used within a SnackbarMessageProvider");
44
53
  return s;
45
54
  };
46
55
  export {
47
- b as SnackbarMessageProvider,
48
- m as default,
49
- S as useSnackbarMessage
56
+ P as SnackbarMessageProvider,
57
+ k as default,
58
+ j as useSnackbarMessage
50
59
  };
@@ -1,20 +1,14 @@
1
- import { j as l } from "../jsx-runtime-C5mzlN2N.js";
2
- import { useState as o, useEffect as s } from "react";
3
- import { TextField as x } from "@mui/material";
1
+ import { j as r } from "../jsx-runtime-C5mzlN2N.js";
2
+ import { TextField as m } from "@mui/material";
4
3
  import d from "../s-form/s-form.js";
5
- const S = ({
6
- label: a = "",
7
- required: r = !1,
4
+ const u = ({
5
+ label: i = "",
6
+ required: o = !1,
8
7
  error: t,
9
- type: i = "text",
10
- htmlFor: u,
11
- ...e
12
- }) => {
13
- const [f, m] = o(e.value ?? "");
14
- return s(() => {
15
- m(e.value ?? "");
16
- }, [e.value]), /* @__PURE__ */ l.jsx(d, { label: a, error: t, required: r, htmlFor: u, children: /* @__PURE__ */ l.jsx(x, { fullWidth: !0, type: i, id: u, error: !!t, ...e, value: f ?? "" }) });
17
- };
8
+ type: s = "text",
9
+ htmlFor: e,
10
+ ...x
11
+ }) => /* @__PURE__ */ r.jsx(d, { label: i, error: t, required: o, htmlFor: e, children: /* @__PURE__ */ r.jsx(m, { fullWidth: !0, type: s, id: e, error: !!t, ...x }) });
18
12
  export {
19
- S as default
13
+ u as default
20
14
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.18",
6
+ "version": "1.0.19",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",