@solostylist/ui-kit 1.0.74 → 1.0.75

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.
@@ -2,6 +2,7 @@ import { TypographyProps } from '@mui/material';
2
2
  export interface SCopyableTextProps {
3
3
  text?: string;
4
4
  typographyProps?: TypographyProps;
5
+ onCopied?: () => void;
5
6
  }
6
- declare const SCopyableText: ({ text, typographyProps }: SCopyableTextProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ declare const SCopyableText: ({ text, typographyProps, onCopied }: SCopyableTextProps) => import("react/jsx-runtime").JSX.Element | null;
7
8
  export default SCopyableText;
@@ -1,33 +1,34 @@
1
1
  import { j as e } from "../jsx-runtime-DywqP_6a.js";
2
- import { useState as a } from "react";
3
- import { Box as l, IconButton as d, Typography as x } from "@mui/material";
4
- import { c as s } from "../createSvgIcon-DN-sh_sr.js";
5
- const m = s(/* @__PURE__ */ e.jsx("path", {
2
+ import { useState as l } from "react";
3
+ import { Box as d, IconButton as m, Typography as x } from "@mui/material";
4
+ import { c as i } from "../createSvgIcon-DN-sh_sr.js";
5
+ const u = i(/* @__PURE__ */ e.jsx("path", {
6
6
  d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
7
- }), "Check"), h = s(/* @__PURE__ */ e.jsx("path", {
7
+ }), "Check"), h = i(/* @__PURE__ */ e.jsx("path", {
8
8
  d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"
9
- }), "ContentCopy"), j = ({ text: t, typographyProps: o }) => {
10
- const [r, i] = a(!1), n = async () => {
11
- try {
12
- await navigator.clipboard.writeText(t || ""), i(!0), setTimeout(() => i(!1), 2e3);
13
- } catch (c) {
14
- console.error("Failed to copy text:", c);
15
- }
9
+ }), "ContentCopy"), b = ({ text: t, typographyProps: o, onCopied: r }) => {
10
+ const [s, c] = l(!1), a = async () => {
11
+ if (t)
12
+ try {
13
+ await navigator.clipboard.writeText(t), c(!0), setTimeout(() => c(!1), 2e3), r == null || r();
14
+ } catch (n) {
15
+ console.error("Failed to copy text:", n);
16
+ }
16
17
  };
17
- return t ? /* @__PURE__ */ e.jsxs(l, { sx: { position: "relative" }, children: [
18
+ return t ? /* @__PURE__ */ e.jsxs(d, { sx: { position: "relative" }, children: [
18
19
  /* @__PURE__ */ e.jsx(
19
- d,
20
+ m,
20
21
  {
21
- onClick: n,
22
+ onClick: a,
22
23
  size: "small",
23
24
  sx: {
24
25
  position: "absolute",
25
26
  top: 8,
26
27
  right: 8,
27
28
  zIndex: 1,
28
- color: r ? "success.main" : "inherit"
29
+ color: s ? "success.main" : "inherit"
29
30
  },
30
- children: r ? /* @__PURE__ */ e.jsx(m, { fontSize: "small" }) : /* @__PURE__ */ e.jsx(h, { fontSize: "small" })
31
+ children: s ? /* @__PURE__ */ e.jsx(u, { fontSize: "small" }) : /* @__PURE__ */ e.jsx(h, { fontSize: "small" })
31
32
  }
32
33
  ),
33
34
  /* @__PURE__ */ e.jsx(
@@ -51,5 +52,5 @@ const m = s(/* @__PURE__ */ e.jsx("path", {
51
52
  ] }) : null;
52
53
  };
53
54
  export {
54
- j as default
55
+ b as default
55
56
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.74",
6
+ "version": "1.0.75",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "private": false,
9
9
  "type": "module",