@sensorario/sg-components 0.0.64 → 0.0.67
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/.htaccess +32 -0
- package/dist/index.es.js +52 -52
- package/dist/sg-components.css +1 -1
- package/package.json +1 -1
package/dist/.htaccess
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<IfModule mod_rewrite.c>
|
|
2
|
+
RewriteEngine On
|
|
3
|
+
RewriteBase /
|
|
4
|
+
|
|
5
|
+
# Don't rewrite files or directories
|
|
6
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
7
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
8
|
+
|
|
9
|
+
# Rewrite everything else to index.html to allow html5 state links
|
|
10
|
+
RewriteRule . index.html [L]
|
|
11
|
+
</IfModule>
|
|
12
|
+
|
|
13
|
+
# Compression
|
|
14
|
+
<IfModule mod_deflate.c>
|
|
15
|
+
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
|
|
16
|
+
</IfModule>
|
|
17
|
+
|
|
18
|
+
# Disable Caching Completely
|
|
19
|
+
<IfModule mod_headers.c>
|
|
20
|
+
# Disable caching for all files
|
|
21
|
+
Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
|
|
22
|
+
Header set Pragma "no-cache"
|
|
23
|
+
Header set Expires "0"
|
|
24
|
+
</IfModule>
|
|
25
|
+
|
|
26
|
+
# Disable ETags
|
|
27
|
+
FileETag None
|
|
28
|
+
|
|
29
|
+
# Disable browser caching via mod_expires
|
|
30
|
+
<IfModule mod_expires.c>
|
|
31
|
+
ExpiresActive Off
|
|
32
|
+
</IfModule>
|
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/components/
|
|
4
|
-
var i = ({
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/Button/Button.tsx
|
|
4
|
+
var i = ({ label: e, ...t }) => /* @__PURE__ */ n("button", {
|
|
5
|
+
className: "custom-button",
|
|
6
|
+
...t,
|
|
7
|
+
children: e
|
|
8
|
+
}), a = ({ copyright: e = "© 2026 My Company", href: t = "#", links: i = [] }) => /* @__PURE__ */ r("footer", {
|
|
5
9
|
className: "footer",
|
|
6
|
-
children: [/* @__PURE__ */
|
|
7
|
-
href:
|
|
10
|
+
children: [/* @__PURE__ */ n("span", { children: /* @__PURE__ */ n("a", {
|
|
11
|
+
href: t,
|
|
8
12
|
children: e
|
|
9
|
-
}) }), i.length > 0 && /* @__PURE__ */
|
|
10
|
-
href:
|
|
13
|
+
}) }), i.length > 0 && /* @__PURE__ */ n("nav", { children: i.map(({ label: e, href: t }) => /* @__PURE__ */ n("a", {
|
|
14
|
+
href: t,
|
|
11
15
|
style: { marginLeft: "16px" },
|
|
12
16
|
children: e
|
|
13
|
-
},
|
|
14
|
-
}),
|
|
17
|
+
}, t)) })]
|
|
18
|
+
}), o = [
|
|
15
19
|
{
|
|
16
20
|
label: "guitar",
|
|
17
21
|
href: "https://guitar.simonegentili.com"
|
|
@@ -32,113 +36,109 @@ var i = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
32
36
|
label: "code2image",
|
|
33
37
|
href: "https://code2image.simonegentili.com"
|
|
34
38
|
}
|
|
35
|
-
],
|
|
39
|
+
], s = () => /* @__PURE__ */ n(a, {
|
|
36
40
|
href: "https://simonegentili.com",
|
|
37
41
|
copyright: "© 2026 simonegentili.com",
|
|
38
|
-
links:
|
|
39
|
-
}),
|
|
42
|
+
links: o
|
|
43
|
+
}), c = ({ onNavigate: e, title: t = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: r = "home" }) => /* @__PURE__ */ n("header", {
|
|
40
44
|
className: "header",
|
|
41
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ n("div", {
|
|
42
46
|
className: "header-container",
|
|
43
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ n("div", {
|
|
44
48
|
className: "logo",
|
|
45
49
|
onClick: () => {
|
|
46
50
|
e?.(r);
|
|
47
51
|
},
|
|
48
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ n("h1", {
|
|
49
53
|
className: "logo-text",
|
|
50
|
-
children:
|
|
54
|
+
children: t
|
|
51
55
|
})
|
|
52
56
|
})
|
|
53
57
|
})
|
|
54
|
-
}),
|
|
58
|
+
}), l = ({ onNavigate: e }) => /* @__PURE__ */ n(c, {
|
|
55
59
|
onNavigate: e,
|
|
56
60
|
title: "Simone Gentili - senior web developer, tech author and chess enthusiast",
|
|
57
61
|
homePageKey: "home"
|
|
58
|
-
}),
|
|
62
|
+
}), u = ({ isLoggedIn: e, handleLogin: r, handleLogout: i }) => /* @__PURE__ */ n(t, { children: e ? /* @__PURE__ */ n("button", {
|
|
59
63
|
onClick: i,
|
|
60
64
|
style: {
|
|
61
65
|
fontSize: "0.9rem",
|
|
62
66
|
padding: "0.4rem 1rem"
|
|
63
67
|
},
|
|
64
68
|
children: "logout"
|
|
65
|
-
}) : /* @__PURE__ */
|
|
69
|
+
}) : /* @__PURE__ */ n("button", {
|
|
66
70
|
onClick: r,
|
|
67
71
|
style: {
|
|
68
72
|
fontSize: "0.9rem",
|
|
69
73
|
padding: "0.4rem 1rem"
|
|
70
74
|
},
|
|
71
75
|
children: "Login"
|
|
72
|
-
}) }),
|
|
76
|
+
}) }), d = ({ open: e, onClose: t, title: i, children: a }) => e ? /* @__PURE__ */ n("div", {
|
|
73
77
|
className: "modal-overlay",
|
|
74
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ r("div", {
|
|
75
79
|
className: "modal-content",
|
|
76
80
|
children: [
|
|
77
|
-
i && /* @__PURE__ */
|
|
81
|
+
i && /* @__PURE__ */ n("h2", {
|
|
78
82
|
className: "modal-title",
|
|
79
83
|
children: i
|
|
80
84
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ n("button", {
|
|
82
86
|
className: "modal-close",
|
|
83
|
-
onClick:
|
|
87
|
+
onClick: t,
|
|
84
88
|
children: "×"
|
|
85
89
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ n("div", {
|
|
87
91
|
className: "modal-children",
|
|
88
92
|
children: a
|
|
89
93
|
})
|
|
90
94
|
]
|
|
91
95
|
})
|
|
92
|
-
}) : null,
|
|
96
|
+
}) : null, f = ({ label: e, ...t }) => /* @__PURE__ */ r("div", {
|
|
93
97
|
className: "input-wrapper",
|
|
94
|
-
children: [e && /* @__PURE__ */
|
|
98
|
+
children: [e && /* @__PURE__ */ n("label", {
|
|
95
99
|
className: "input-label",
|
|
96
100
|
children: e
|
|
97
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ n("input", {
|
|
98
102
|
type: "password",
|
|
99
103
|
className: "input-field",
|
|
100
|
-
...
|
|
104
|
+
...t
|
|
101
105
|
})]
|
|
102
|
-
}),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
let [o, s] = r(""), [c, l] = r(""), [p, m] = r("");
|
|
108
|
-
return /* @__PURE__ */ t(u, {
|
|
109
|
-
open: e,
|
|
110
|
-
onClose: i,
|
|
106
|
+
}), p = ({ open: t, onClose: a, onSubmit: o }) => {
|
|
107
|
+
let [s, c] = e(""), [l, u] = e(""), [p, m] = e("");
|
|
108
|
+
return /* @__PURE__ */ n(d, {
|
|
109
|
+
open: t,
|
|
110
|
+
onClose: a,
|
|
111
111
|
title: "Imposta una nuova password",
|
|
112
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ r("form", {
|
|
113
113
|
className: "set-password-modal-form",
|
|
114
114
|
onSubmit: (e) => {
|
|
115
|
-
if (e.preventDefault(),
|
|
115
|
+
if (e.preventDefault(), s === "" || l === "") {
|
|
116
116
|
m("Inserisci ed conferma la nuova password.");
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
|
-
if (
|
|
119
|
+
if (s !== l) {
|
|
120
120
|
m("Le password non coincidono.");
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
m(""),
|
|
123
|
+
m(""), o(s);
|
|
124
124
|
},
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ n(f, {
|
|
127
127
|
label: "Nuova password",
|
|
128
|
-
value:
|
|
129
|
-
onChange: (e) =>
|
|
128
|
+
value: s,
|
|
129
|
+
onChange: (e) => c(e.target.value),
|
|
130
130
|
autoFocus: !0
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ n(f, {
|
|
133
133
|
label: "Conferma password",
|
|
134
|
-
value:
|
|
135
|
-
onChange: (e) =>
|
|
134
|
+
value: l,
|
|
135
|
+
onChange: (e) => u(e.target.value)
|
|
136
136
|
}),
|
|
137
|
-
p && /* @__PURE__ */
|
|
137
|
+
p && /* @__PURE__ */ n("p", {
|
|
138
138
|
className: "set-password-modal-error",
|
|
139
139
|
children: p
|
|
140
140
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ n(i, {
|
|
142
142
|
label: "Salva password",
|
|
143
143
|
type: "submit",
|
|
144
144
|
style: { width: "100%" }
|
|
@@ -148,4 +148,4 @@ var i = ({ copyright: e = "© 2026 My Company", href: r = "#", links: i = [] })
|
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
150
|
//#endregion
|
|
151
|
-
export {
|
|
151
|
+
export { u as Authenticator, i as Button, a as Footer, c as Header, s as SGFooter, l 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-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}.
|
|
1
|
+
.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)}.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}.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*/
|