@gustavo-valsechi/client 1.3.12 → 1.3.14

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,26 +1,27 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useEffect, useRef, useState } from "react";
3
+ import { useRef, useState } from "react";
4
4
  import { Container } from "./styles";
5
- import { getStorage, setStorage } from "@gustavo-valsechi/server";
6
- import randomColor from "randomcolor";
7
5
  import _ from "lodash";
8
6
  export function Avatar(props) {
9
7
  const containerRef = useRef({});
10
8
  const [color, setColor] = useState("");
11
- useEffect(() => {
12
- if (color)
13
- return;
14
- (async () => {
15
- const storageKey = process.env.NEXT_PUBLIC_STORAGE_AVATAR;
16
- const storageColor = await getStorage(storageKey);
17
- if (storageColor)
18
- return setColor(storageColor);
19
- const random = randomColor({ luminosity: "light" });
20
- await setStorage(storageKey, random);
21
- setColor(random);
22
- })();
23
- }, [color]);
9
+ // useEffect(() => {
10
+ // if (color) return
11
+ //
12
+ // (async () => {
13
+ // const storageKey = process.env.NEXT_PUBLIC_STORAGE_AVATAR
14
+ //
15
+ // const storageColor = await getStorage(storageKey)
16
+ //
17
+ // if (storageColor) return setColor(storageColor)
18
+ //
19
+ // const random = randomColor({ luminosity: "light" })
20
+ //
21
+ // await setStorage(storageKey, random)
22
+ // setColor(random)
23
+ // })()
24
+ // }, [color])
24
25
  const name = () => {
25
26
  const [first, secound] = _.split(props.name, ' ') || [];
26
27
  if (first && secound)
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef } from "react";
4
4
  import { Container } from "./styles";
5
5
  import { getCardContent } from "../tools";
6
- import { Utils } from "@gustavo-valsechi/server";
6
+ // import { Utils } from "@gustavo-valsechi/server"
7
7
  import assets from "../assets";
8
8
  import _ from "lodash";
9
9
  export default function CreditCardComponent(props) {
@@ -19,5 +19,5 @@ export default function CreditCardComponent(props) {
19
19
  }
20
20
  flagRef.current.style.backgroundImage = `url(${content.logo})`;
21
21
  }, [flagRef, props.number]);
22
- return (_jsxs(Container, { children: [_jsxs("div", { className: "iz-credit-card-left", children: [_jsx("div", { className: "iz-credit-card-top", children: _jsx("div", { id: "iz-credit-card-chip", style: { backgroundImage: `url(${assets.Chip})` } }) }), _jsxs("div", { className: "iz-credit-card-bottom", children: [_jsx("div", { className: "iz-credit-card-number", children: _jsx("div", { className: "iz-credit-card-elipse", children: Utils.mask.loop(props.number, { sequencyNumber: 4, maxSequency: 4, placeholder: "•" }) }) }), _jsx("div", { className: "iz-credit-card-name", children: _jsx("div", { className: "iz-credit-card-elipse", children: _.deburr((_a = props.name) === null || _a === void 0 ? void 0 : _a.replace(/[^A-Za-zÀ-ÿ\s]/g, "").toUpperCase()) || "Nome do Titular" }) })] })] }), _jsxs("div", { className: "iz-credit-card-right", children: [_jsx("div", { className: "iz-credit-card-top", children: _jsx("div", { id: "iz-credit-card-flag", ref: flagRef }) }), _jsxs("div", { className: "iz-credit-card-bottom", children: [_jsx("span", { children: "validade" }), _jsx("span", { children: Utils.mask.loop(props.expiry, { sequencyNumber: 2, maxSequency: 2, placeholder: "•", separator: "/" }) })] })] })] }));
22
+ return (_jsxs(Container, { children: [_jsxs("div", { className: "iz-credit-card-left", children: [_jsx("div", { className: "iz-credit-card-top", children: _jsx("div", { id: "iz-credit-card-chip", style: { backgroundImage: `url(${assets.Chip})` } }) }), _jsxs("div", { className: "iz-credit-card-bottom", children: [_jsx("div", { className: "iz-credit-card-number", children: _jsx("div", { className: "iz-credit-card-elipse" }) }), _jsx("div", { className: "iz-credit-card-name", children: _jsx("div", { className: "iz-credit-card-elipse", children: _.deburr((_a = props.name) === null || _a === void 0 ? void 0 : _a.replace(/[^A-Za-zÀ-ÿ\s]/g, "").toUpperCase()) || "Nome do Titular" }) })] })] }), _jsxs("div", { className: "iz-credit-card-right", children: [_jsx("div", { className: "iz-credit-card-top", children: _jsx("div", { id: "iz-credit-card-flag", ref: flagRef }) }), _jsx("div", { className: "iz-credit-card-bottom", children: _jsx("span", { children: "validade" }) })] })] }));
23
23
  }
@@ -1,19 +1,17 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { createContext, useContext, useEffect, useState } from "react";
3
+ import { createContext, useContext, useState } from "react";
4
4
  import { ThemeProvider } from "styled-components";
5
5
  import { Switcher } from "./styles";
6
6
  import { Themes } from "./content";
7
- import { setStorage } from "@gustavo-valsechi/server";
8
7
  const ThemeContext = createContext({});
9
8
  const ThemeProviderContainer = (props) => {
10
9
  const [theme, setTheme] = useState("light");
11
10
  const [defaultTheme] = useState("light");
12
- useEffect(() => {
13
- if (!theme)
14
- return;
15
- (async () => await setStorage(process.env.NEXT_PUBLIC_STORAGE_THEME, theme))();
16
- }, [theme]);
11
+ // useEffect(() => {
12
+ // if (!theme) return
13
+ // (async () => await setStorage(process.env.NEXT_PUBLIC_STORAGE_THEME, theme))()
14
+ // }, [theme])
17
15
  const SwitcherComponent = () => {
18
16
  return (_jsxs(Switcher, { onClick: () => setTheme(theme === "light" ? "dark" : "light"), "data-theme": theme || defaultTheme, children: [_jsx("i", { "aria-hidden": true, className: "fa-solid fa-moon" }), _jsx("div", { className: "switcher", children: _jsx("div", {}) }), _jsx("i", { "aria-hidden": true, className: "fa-solid fa-sun" })] }));
19
17
  };
@@ -2,16 +2,19 @@ import { defineConfig } from "tsup";
2
2
  export default defineConfig({
3
3
  entry: {
4
4
  "index": "index.tsx",
5
- "interfaces/index": "interfaces/index.tsx",
6
- "components/index": "components/index.tsx",
7
- "contexts/index": "contexts/index.tsx",
5
+ "components/index": "components/index.ts",
6
+ "contexts/index": "contexts/index.ts",
7
+ "interfaces/index": "interfaces/index.ts",
8
8
  },
9
- outDir: "dist",
10
9
  format: ["esm", "cjs"],
11
10
  dts: true,
11
+ sourcemap: true,
12
12
  clean: true,
13
- splitting: false,
14
13
  minify: true,
14
+ external: ["react", "react-dom", "styled-components", "next"],
15
+ bundle: true,
16
+ splitting: false,
17
+ treeshake: true,
18
+ target: "es2020",
15
19
  banner: { js: '"use client";' },
16
- external: ["react", "react-dom", "styled-components"]
17
20
  });
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "main": "dist/index.js",
5
+ "module": "dist/index.js",
5
6
  "types": "dist/index.d.ts",
6
- "files": [
7
- "dist"
8
- ],
7
+ "files": ["dist"],
9
8
  "license": "UNLICENSED",
10
9
  "scripts": {
11
10
  "build": "npx rimraf node_modules/.cache && tsc && tsc-alias"
@@ -17,7 +16,6 @@
17
16
  },
18
17
  "dependencies": {
19
18
  "@emotion/is-prop-valid": "1.3.0",
20
- "@gustavo-valsechi/server": "1.0.4",
21
19
  "@hookform/resolvers": "5.2.2",
22
20
  "apexcharts": "3.51.0",
23
21
  "lodash": "4.17.21",
@@ -28,7 +26,7 @@
28
26
  "react-hook-form": "7.65.0",
29
27
  "react-hot-toast": "2.4.1",
30
28
  "react-lottie": "1.2.4",
31
- "tsup": "^8.5.0",
29
+ "tsup": "8.5.0",
32
30
  "zod": "4.1.12",
33
31
  "zod-formik-adapter": "1.3.0"
34
32
  },
@@ -40,12 +38,12 @@
40
38
  "@types/react-dom": "18.3.0",
41
39
  "@types/react-lottie": "1.2.10",
42
40
  "@types/styled-components": "5.1.34",
43
- "esbuild": "^0.25.11",
41
+ "esbuild": "0.25.11",
44
42
  "raw-loader": "4.0.2",
45
43
  "react": "18.3.1",
46
44
  "react-dom": "18.3.1",
47
45
  "styled-components": "6.1.12",
48
- "tsc-alias": "^1.8.16",
46
+ "tsc-alias": "1.8.16",
49
47
  "typescript": "5.5.4"
50
48
  },
51
49
  "publishConfig": {