@gustavo-valsechi/client 1.3.12 → 1.3.13
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 {
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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"
|
|
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,
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/is-prop-valid": "1.3.0",
|
|
20
|
-
"@gustavo-valsechi/server": "1.0.4",
|
|
21
20
|
"@hookform/resolvers": "5.2.2",
|
|
22
21
|
"apexcharts": "3.51.0",
|
|
23
22
|
"lodash": "4.17.21",
|