@sensorario/sg-components 0.0.61 → 0.0.64
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.
- package/dist/index.es.js +87 -10
- package/dist/sg-components.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
2
|
+
import { useState as r } from "react";
|
|
3
3
|
//#region src/components/Footer/Footer.tsx
|
|
4
|
-
var
|
|
4
|
+
var i = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] }) => /* @__PURE__ */ n("footer", {
|
|
5
5
|
className: "footer",
|
|
6
6
|
children: [/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("a", {
|
|
7
7
|
href: r,
|
|
@@ -11,7 +11,7 @@ var r = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
11
11
|
style: { marginLeft: "16px" },
|
|
12
12
|
children: e
|
|
13
13
|
}, n)) })]
|
|
14
|
-
}),
|
|
14
|
+
}), a = [
|
|
15
15
|
{
|
|
16
16
|
label: "guitar",
|
|
17
17
|
href: "https://guitar.simonegentili.com"
|
|
@@ -32,11 +32,11 @@ var r = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
32
32
|
label: "code2image",
|
|
33
33
|
href: "https://code2image.simonegentili.com"
|
|
34
34
|
}
|
|
35
|
-
],
|
|
35
|
+
], o = () => /* @__PURE__ */ t(i, {
|
|
36
36
|
href: "https://simonegentili.com",
|
|
37
37
|
copyright: "© 2026 simonegentili.com",
|
|
38
|
-
links:
|
|
39
|
-
}),
|
|
38
|
+
links: a
|
|
39
|
+
}), s = ({ onNavigate: e, title: n = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: r = "home" }) => /* @__PURE__ */ t("header", {
|
|
40
40
|
className: "header",
|
|
41
41
|
children: /* @__PURE__ */ t("div", {
|
|
42
42
|
className: "header-container",
|
|
@@ -51,11 +51,11 @@ var r = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
51
51
|
})
|
|
52
52
|
})
|
|
53
53
|
})
|
|
54
|
-
}),
|
|
54
|
+
}), c = ({ onNavigate: e }) => /* @__PURE__ */ t(s, {
|
|
55
55
|
onNavigate: e,
|
|
56
56
|
title: "Simone Gentili - senior web developer, tech author and chess enthusiast",
|
|
57
57
|
homePageKey: "home"
|
|
58
|
-
}),
|
|
58
|
+
}), l = ({ isLoggedIn: n, handleLogin: r, handleLogout: i }) => /* @__PURE__ */ t(e, { children: n ? /* @__PURE__ */ t("button", {
|
|
59
59
|
onClick: i,
|
|
60
60
|
style: {
|
|
61
61
|
fontSize: "0.9rem",
|
|
@@ -69,6 +69,83 @@ var r = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
69
69
|
padding: "0.4rem 1rem"
|
|
70
70
|
},
|
|
71
71
|
children: "Login"
|
|
72
|
-
}) })
|
|
72
|
+
}) }), u = ({ open: e, onClose: r, title: i, children: a }) => e ? /* @__PURE__ */ t("div", {
|
|
73
|
+
className: "modal-overlay",
|
|
74
|
+
children: /* @__PURE__ */ n("div", {
|
|
75
|
+
className: "modal-content",
|
|
76
|
+
children: [
|
|
77
|
+
i && /* @__PURE__ */ t("h2", {
|
|
78
|
+
className: "modal-title",
|
|
79
|
+
children: i
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ t("button", {
|
|
82
|
+
className: "modal-close",
|
|
83
|
+
onClick: r,
|
|
84
|
+
children: "×"
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ t("div", {
|
|
87
|
+
className: "modal-children",
|
|
88
|
+
children: a
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
}) : null, d = ({ label: e, ...r }) => /* @__PURE__ */ n("div", {
|
|
93
|
+
className: "input-wrapper",
|
|
94
|
+
children: [e && /* @__PURE__ */ t("label", {
|
|
95
|
+
className: "input-label",
|
|
96
|
+
children: e
|
|
97
|
+
}), /* @__PURE__ */ t("input", {
|
|
98
|
+
type: "password",
|
|
99
|
+
className: "input-field",
|
|
100
|
+
...r
|
|
101
|
+
})]
|
|
102
|
+
}), f = ({ label: e, ...n }) => /* @__PURE__ */ t("button", {
|
|
103
|
+
className: "custom-button",
|
|
104
|
+
...n,
|
|
105
|
+
children: e
|
|
106
|
+
}), p = ({ open: e, onClose: i, onSubmit: a }) => {
|
|
107
|
+
let [o, s] = r(""), [c, l] = r(""), [p, m] = r("");
|
|
108
|
+
return /* @__PURE__ */ t(u, {
|
|
109
|
+
open: e,
|
|
110
|
+
onClose: i,
|
|
111
|
+
title: "Imposta una nuova password",
|
|
112
|
+
children: /* @__PURE__ */ n("form", {
|
|
113
|
+
className: "set-password-modal-form",
|
|
114
|
+
onSubmit: (e) => {
|
|
115
|
+
if (e.preventDefault(), o === "" || c === "") {
|
|
116
|
+
m("Inserisci ed conferma la nuova password.");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (o !== c) {
|
|
120
|
+
m("Le password non coincidono.");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
m(""), a(o);
|
|
124
|
+
},
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ t(d, {
|
|
127
|
+
label: "Nuova password",
|
|
128
|
+
value: o,
|
|
129
|
+
onChange: (e) => s(e.target.value),
|
|
130
|
+
autoFocus: !0
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ t(d, {
|
|
133
|
+
label: "Conferma password",
|
|
134
|
+
value: c,
|
|
135
|
+
onChange: (e) => l(e.target.value)
|
|
136
|
+
}),
|
|
137
|
+
p && /* @__PURE__ */ t("p", {
|
|
138
|
+
className: "set-password-modal-error",
|
|
139
|
+
children: p
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ t(f, {
|
|
142
|
+
label: "Salva password",
|
|
143
|
+
type: "submit",
|
|
144
|
+
style: { width: "100%" }
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
};
|
|
73
150
|
//#endregion
|
|
74
|
-
export {
|
|
151
|
+
export { l as Authenticator, i as Footer, s as Header, o as SGFooter, c as SGHeader, p as SetPasswordModal };
|
package/dist/sg-components.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.footer{background-color:var(--primary-bg);border-top:1px solid var(--primary-border);font-family:var(--font-family);color:#555;justify-content:space-between;align-items:center;width:100%;padding:16px 32px;font-size:14px;display:flex;position:fixed;bottom:0;left:0}.footer a{color:#1ea7fd;text-decoration:none}.footer a:hover{text-decoration:underline}.logo-text{font-size:var(--font-size-h1);font-family:var(--font-family);margin:0;font-weight:400}.header{z-index:100;width:100%;font-size:var(--font-size);background-color:#fff;border-bottom:1px solid #e1e5e9;position:sticky;top:0;box-shadow:0 2px 4px #0000001a}.header-container{justify-content:flex-start;align-items:center;max-width:1200px;margin:0 auto;padding:16px;display:flex}.logo{cursor:pointer;color:#333;font-size:24px;font-weight:700;transition:color .2s}.logo:hover{color:#007acc}.logo-full{display:inline}.logo-short{display:none}@media (width<=768px){.header-container{padding:12px 16px}.logo{font-size:var(--font-size)}.logo-full{display:none}.logo-short{display:inline}}@media (width<=480px){.header-container{padding:8px 12px}.logo{font-size:var(--font-size)}}.modal-overlay{background:var(--modal-overlay);z-index:1000;justify-content:center;align-items:center;width:100vw;height:100vh;display:flex;position:fixed;top:0;left:0}.modal-children{font-family:var(--font-family);padding:16px}.modal-content{background:var(--modal-bg);font-size:var(--primary-font);border-radius:8px;min-width:320px;position:relative;box-shadow:0 2px 16px #00000026}.modal-title{color:var(--modal-title-color);font-family:var(--font-family);background-color:var(--primary-bg);font-size:var(--primary-font);border-top-left-radius:var(--primary-radius);border-top-right-radius:var(--primary-radius);margin-top:0;padding:16px}.modal-close{cursor:pointer;background:0 0;border:none;font-size:20px;position:absolute;top:8px;right:8px}.input-label{font-weight:500;font-family:var(--font-family);font-size:var(--primary-font);margin-bottom:4px;display:block}.input-wrapper{margin-bottom:16px}.input-label{font-weight:500;font-size:var(--primary-font);margin-bottom:4px;display:block}.input-field{border-radius:var(--radius);width:calc(100% - 16px);font-size:var(--primary-font);border-style:solid;border-width:1px;padding:8px}.custom-button{border-radius:var(--primary-radius);border:1px solid var(--primary-border);background:var(--primary-bg);cursor:pointer;font-size:var(--primary-font);font-family:var(--font-family);padding:8px 16px;transition:background .2s}.custom-button:hover{background:var(--primary-hover-bg)}:root{--unit:3px;--primary-bg:#f5f5f5;--primary-border:#ccc;--radius:calc(var(--unit) * 2);--primary-radius:var(--radius);--primary-font:var(--font-size);--primary-hover-bg:#e0e0e0;--modal-bg:#fff;--modal-overlay:#0000004d;--modal-title-color:#222;--input-bg:#fff;--input-border:#ccc;--input-radius:var(--radius);--input-font:1rem;--font-size:14px;--font-family:Arial, sans-serif;--font-size-h1:calc(var(--font-size) * 1.5)}.theme-dark{--primary-bg:#222;--primary-border:#444;--primary-font:1rem;--font-family:"Inter", Arial, sans-serif;--primary-hover-bg:#333;--modal-bg:#222;--modal-title-color:#fff;--input-bg:#333;--input-border:#555;--input-font:1rem}form{font-family:var(--font-family)}.
|
|
1
|
+
.footer{background-color:var(--primary-bg);border-top:1px solid var(--primary-border);font-family:var(--font-family);color:#555;justify-content:space-between;align-items:center;width:100%;padding:16px 32px;font-size:14px;display:flex;position:fixed;bottom:0;left:0}.footer a{color:#1ea7fd;text-decoration:none}.footer a:hover{text-decoration:underline}.logo-text{font-size:var(--font-size-h1);font-family:var(--font-family);margin:0;font-weight:400}.header{z-index:100;width:100%;font-size:var(--font-size);background-color:#fff;border-bottom:1px solid #e1e5e9;position:sticky;top:0;box-shadow:0 2px 4px #0000001a}.header-container{justify-content:flex-start;align-items:center;max-width:1200px;margin:0 auto;padding:16px;display:flex}.logo{cursor:pointer;color:#333;font-size:24px;font-weight:700;transition:color .2s}.logo:hover{color:#007acc}.logo-full{display:inline}.logo-short{display:none}@media (width<=768px){.header-container{padding:12px 16px}.logo{font-size:var(--font-size)}.logo-full{display:none}.logo-short{display:inline}}@media (width<=480px){.header-container{padding:8px 12px}.logo{font-size:var(--font-size)}}.modal-overlay{background:var(--modal-overlay);z-index:1000;justify-content:center;align-items:center;width:100vw;height:100vh;display:flex;position:fixed;top:0;left:0}.modal-children{font-family:var(--font-family);padding:16px}.modal-content{background:var(--modal-bg);font-size:var(--primary-font);border-radius:8px;min-width:320px;position:relative;box-shadow:0 2px 16px #00000026}.modal-title{color:var(--modal-title-color);font-family:var(--font-family);background-color:var(--primary-bg);font-size:var(--primary-font);border-top-left-radius:var(--primary-radius);border-top-right-radius:var(--primary-radius);margin-top:0;padding:16px}.modal-close{cursor:pointer;background:0 0;border:none;font-size:20px;position:absolute;top:8px;right:8px}.input-label{font-weight:500;font-family:var(--font-family);font-size:var(--primary-font);margin-bottom:4px;display:block}.input-field--invalid{background-color:#ffe5e5;border-color:#c00}.input-wrapper{margin-bottom:16px}.input-label{font-weight:500;font-size:var(--primary-font);margin-bottom:4px;display:block}.input-field{border-radius:var(--radius);width:calc(100% - 16px);font-size:var(--primary-font);border-style:solid;border-width:1px;padding:8px}.custom-button{border-radius:var(--primary-radius);border:1px solid var(--primary-border);background:var(--primary-bg);cursor:pointer;font-size:var(--primary-font);font-family:var(--font-family);padding:8px 16px;transition:background .2s}.custom-button:hover{background:var(--primary-hover-bg)}.login-modal-form{font-family:var(--font-family);font-size:var(--primary-font);flex-direction:column;gap:16px;display:flex}:root{--unit:3px;--primary-bg:#f5f5f5;--primary-border:#ccc;--radius:calc(var(--unit) * 2);--primary-radius:var(--radius);--primary-font:var(--font-size);--primary-hover-bg:#e0e0e0;--modal-bg:#fff;--modal-overlay:#0000004d;--modal-title-color:#222;--input-bg:#fff;--input-border:#ccc;--input-radius:var(--radius);--input-font:1rem;--font-size:14px;--font-family:Arial, sans-serif;--font-size-h1:calc(var(--font-size) * 1.5)}.theme-dark{--primary-bg:#222;--primary-border:#444;--primary-font:1rem;--font-family:"Inter", Arial, sans-serif;--primary-hover-bg:#333;--modal-bg:#222;--modal-title-color:#fff;--input-bg:#333;--input-border:#555;--input-font:1rem}form{font-family:var(--font-family)}.set-password-modal-form{font-family:var(--font-family);font-size:var(--primary-font);flex-direction:column;gap:16px;display:flex}.set-password-modal-error{color:#d32f2f;font-size:var(--primary-font);margin:0}
|
|
2
2
|
/*$vite$:1*/
|