@xscriptor/xcomponents 0.1.0
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/CODE_OF_CONDUCT.md +35 -0
- package/CONTRIBUTING.md +64 -0
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/SECURITY.md +25 -0
- package/dist/chunk-2OAXRRVQ.mjs +150 -0
- package/dist/chunk-2OAXRRVQ.mjs.map +1 -0
- package/dist/chunk-42XPBYTL.mjs +186 -0
- package/dist/chunk-42XPBYTL.mjs.map +1 -0
- package/dist/chunk-5G4P2E76.mjs +66 -0
- package/dist/chunk-5G4P2E76.mjs.map +1 -0
- package/dist/chunk-FZRTAML3.mjs +1 -0
- package/dist/chunk-FZRTAML3.mjs.map +1 -0
- package/dist/chunk-NY22GB3E.mjs +311 -0
- package/dist/chunk-NY22GB3E.mjs.map +1 -0
- package/dist/chunk-QCMWPIG7.mjs +320 -0
- package/dist/chunk-QCMWPIG7.mjs.map +1 -0
- package/dist/chunk-U27ZVCP7.mjs +247 -0
- package/dist/chunk-U27ZVCP7.mjs.map +1 -0
- package/dist/components/content/index.css +132 -0
- package/dist/components/content/index.css.map +1 -0
- package/dist/components/content/index.d.mts +17 -0
- package/dist/components/content/index.d.ts +17 -0
- package/dist/components/content/index.js +102 -0
- package/dist/components/content/index.js.map +1 -0
- package/dist/components/content/index.mjs +7 -0
- package/dist/components/content/index.mjs.map +1 -0
- package/dist/components/forms/index.css +307 -0
- package/dist/components/forms/index.css.map +1 -0
- package/dist/components/forms/index.d.mts +68 -0
- package/dist/components/forms/index.d.ts +68 -0
- package/dist/components/forms/index.js +357 -0
- package/dist/components/forms/index.js.map +1 -0
- package/dist/components/forms/index.mjs +9 -0
- package/dist/components/forms/index.mjs.map +1 -0
- package/dist/components/gallery/index.css +229 -0
- package/dist/components/gallery/index.css.map +1 -0
- package/dist/components/gallery/index.d.mts +29 -0
- package/dist/components/gallery/index.d.ts +29 -0
- package/dist/components/gallery/index.js +187 -0
- package/dist/components/gallery/index.js.map +1 -0
- package/dist/components/gallery/index.mjs +9 -0
- package/dist/components/gallery/index.mjs.map +1 -0
- package/dist/components/index.css +1181 -0
- package/dist/components/index.css.map +1 -0
- package/dist/components/index.d.mts +8 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +1317 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +50 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/layout/index.css +168 -0
- package/dist/components/layout/index.css.map +1 -0
- package/dist/components/layout/index.d.mts +55 -0
- package/dist/components/layout/index.d.ts +55 -0
- package/dist/components/layout/index.js +224 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/index.mjs +11 -0
- package/dist/components/layout/index.mjs.map +1 -0
- package/dist/components/navigation/index.css +229 -0
- package/dist/components/navigation/index.css.map +1 -0
- package/dist/components/navigation/index.d.mts +76 -0
- package/dist/components/navigation/index.d.ts +76 -0
- package/dist/components/navigation/index.js +347 -0
- package/dist/components/navigation/index.js.map +1 -0
- package/dist/components/navigation/index.mjs +7 -0
- package/dist/components/navigation/index.mjs.map +1 -0
- package/dist/components/social/index.css +116 -0
- package/dist/components/social/index.css.map +1 -0
- package/dist/components/social/index.d.mts +55 -0
- package/dist/components/social/index.d.ts +55 -0
- package/dist/components/social/index.js +280 -0
- package/dist/components/social/index.js.map +1 -0
- package/dist/components/social/index.mjs +21 -0
- package/dist/components/social/index.mjs.map +1 -0
- package/dist/index.css +1181 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1317 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +50 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,1317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/index.ts
|
|
31
|
+
var components_exports = {};
|
|
32
|
+
__export(components_exports, {
|
|
33
|
+
XContactForm: () => XContactForm,
|
|
34
|
+
XEmailIcon: () => XEmailIcon,
|
|
35
|
+
XFooter: () => XFooter,
|
|
36
|
+
XGitHubIcon: () => XGitHubIcon,
|
|
37
|
+
XInstagramIcon: () => XInstagramIcon,
|
|
38
|
+
XInteractivePhrase: () => XInteractivePhrase,
|
|
39
|
+
XLinkedInIcon: () => XLinkedInIcon,
|
|
40
|
+
XMicroGalleryText: () => XMicroGalleryText_default2,
|
|
41
|
+
XNavbar: () => XNavbar,
|
|
42
|
+
XNewsletter: () => XNewsletter,
|
|
43
|
+
XSeparator: () => XSeparator,
|
|
44
|
+
XSocialContact: () => XSocialContact,
|
|
45
|
+
XStaticGallery: () => XStaticGallery,
|
|
46
|
+
XTelegramIcon: () => XTelegramIcon,
|
|
47
|
+
XTwitterIcon: () => XTwitterIcon,
|
|
48
|
+
XWhatsappIcon: () => XWhatsappIcon,
|
|
49
|
+
XZigZagLayout: () => XZigZagLayout
|
|
50
|
+
});
|
|
51
|
+
module.exports = __toCommonJS(components_exports);
|
|
52
|
+
|
|
53
|
+
// src/components/forms/xcontactform/XContactForm.tsx
|
|
54
|
+
var import_react = require("react");
|
|
55
|
+
|
|
56
|
+
// src/components/forms/xcontactform/XContactForm.module.css
|
|
57
|
+
var XContactForm_default = {};
|
|
58
|
+
|
|
59
|
+
// src/components/forms/xcontactform/XContactForm.tsx
|
|
60
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
+
function XContactForm({
|
|
62
|
+
showName = true,
|
|
63
|
+
showEmail = true,
|
|
64
|
+
showPhone = true,
|
|
65
|
+
showSubject = true,
|
|
66
|
+
showMessage = true,
|
|
67
|
+
namePlaceholder = "Tu nombre",
|
|
68
|
+
emailPlaceholder = "tucorreo@ejemplo.com",
|
|
69
|
+
phonePlaceholder = "+34 600 000 000",
|
|
70
|
+
subjectPlaceholder = "Tema del mensaje",
|
|
71
|
+
messagePlaceholder = "Cu\xE9ntame qu\xE9 necesitas\u2026",
|
|
72
|
+
labelColor,
|
|
73
|
+
wrapperBackgroundColor,
|
|
74
|
+
wrapperBorderColor,
|
|
75
|
+
wrapperBorderWidth,
|
|
76
|
+
wrapperBorderRadius = "rounded",
|
|
77
|
+
wrapperBorderStyle = "solid",
|
|
78
|
+
fieldBorderColor,
|
|
79
|
+
fieldBorderWidth,
|
|
80
|
+
fieldBorderRadius = "rounded",
|
|
81
|
+
fieldBorderStyle = "solid",
|
|
82
|
+
buttonColor,
|
|
83
|
+
buttonBorderColor,
|
|
84
|
+
buttonBorderWidth,
|
|
85
|
+
buttonBorderRadius = "rounded",
|
|
86
|
+
buttonBorderStyle = "solid",
|
|
87
|
+
buttonHoverColor,
|
|
88
|
+
buttonHoverTextColor,
|
|
89
|
+
buttonHoverBorderColor,
|
|
90
|
+
buttonTextColor,
|
|
91
|
+
buttonAlignment = "left",
|
|
92
|
+
requiredFieldsMessage = "Rellena los campos obligatorios.",
|
|
93
|
+
honeypotMessage = "Gracias.",
|
|
94
|
+
submitSuccessMessage = "Abriendo tu aplicaci\xF3n de correo\u2026",
|
|
95
|
+
statusSuccessColor,
|
|
96
|
+
statusErrorColor,
|
|
97
|
+
decorativeX = false,
|
|
98
|
+
decorativeXColor = "currentColor",
|
|
99
|
+
size = "medium",
|
|
100
|
+
layout = "grid"
|
|
101
|
+
}) {
|
|
102
|
+
const [status, setStatus] = (0, import_react.useState)(null);
|
|
103
|
+
function onSubmit(e) {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
setStatus(null);
|
|
106
|
+
const form = e.currentTarget;
|
|
107
|
+
const fd = new FormData(form);
|
|
108
|
+
if (fd.get("website")?.length) {
|
|
109
|
+
setStatus({ ok: true, msg: honeypotMessage });
|
|
110
|
+
form.reset();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const name = showName ? String(fd.get("name") || "").trim() : "";
|
|
114
|
+
const email = showEmail ? String(fd.get("email") || "").trim() : "";
|
|
115
|
+
const phone = showPhone ? String(fd.get("phone") || "").trim() : "";
|
|
116
|
+
const subject = showSubject ? String(fd.get("subject") || "Contacto desde web").trim() : "Contacto desde web";
|
|
117
|
+
const message = showMessage ? String(fd.get("message") || "").trim() : "";
|
|
118
|
+
if (showName && !name || showEmail && !email || showPhone && !phone || showMessage && !message) {
|
|
119
|
+
setStatus({ ok: false, msg: requiredFieldsMessage });
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const bodyLines = [];
|
|
123
|
+
if (showName) bodyLines.push(`Nombre: ${name}`);
|
|
124
|
+
if (showEmail) bodyLines.push(`Email: ${email}`);
|
|
125
|
+
if (showPhone) bodyLines.push(`Tel\xE9fono: ${phone}`);
|
|
126
|
+
bodyLines.push("");
|
|
127
|
+
if (showMessage) bodyLines.push(message);
|
|
128
|
+
const body = bodyLines.join("\n");
|
|
129
|
+
const to = "x@xscriptor.com";
|
|
130
|
+
const mailto = `mailto:${encodeURIComponent(to)}?subject=${encodeURIComponent(
|
|
131
|
+
subject
|
|
132
|
+
)}&body=${encodeURIComponent(body)}`;
|
|
133
|
+
window.location.href = mailto;
|
|
134
|
+
setStatus({ ok: true, msg: submitSuccessMessage });
|
|
135
|
+
}
|
|
136
|
+
const radiusMap = {
|
|
137
|
+
rounded: "0.5rem",
|
|
138
|
+
square: "0"
|
|
139
|
+
};
|
|
140
|
+
const alignmentMap = {
|
|
141
|
+
left: "flex-start",
|
|
142
|
+
right: "flex-end"
|
|
143
|
+
};
|
|
144
|
+
const customStyles = {
|
|
145
|
+
...decorativeXColor && { "--decorative-x-color": decorativeXColor },
|
|
146
|
+
...labelColor && { "--label-color": labelColor },
|
|
147
|
+
...wrapperBackgroundColor && { "--wrapper-bg-color": wrapperBackgroundColor },
|
|
148
|
+
...wrapperBorderColor && { "--wrapper-border-color": wrapperBorderColor },
|
|
149
|
+
...wrapperBorderWidth && { "--wrapper-border-width": wrapperBorderWidth },
|
|
150
|
+
"--wrapper-radius": radiusMap[wrapperBorderRadius],
|
|
151
|
+
"--wrapper-border-style": wrapperBorderStyle,
|
|
152
|
+
...fieldBorderColor && { "--field-border-color": fieldBorderColor },
|
|
153
|
+
...fieldBorderWidth && { "--field-border-width": fieldBorderWidth },
|
|
154
|
+
"--field-radius": radiusMap[fieldBorderRadius],
|
|
155
|
+
"--field-border-style": fieldBorderStyle,
|
|
156
|
+
...buttonColor && { "--btn-bg-color": buttonColor },
|
|
157
|
+
...buttonBorderColor && { "--btn-border-color": buttonBorderColor },
|
|
158
|
+
...buttonBorderWidth && { "--btn-border-width": buttonBorderWidth },
|
|
159
|
+
"--btn-radius": radiusMap[buttonBorderRadius],
|
|
160
|
+
"--btn-border-style": buttonBorderStyle,
|
|
161
|
+
"--btn-alignment": alignmentMap[buttonAlignment],
|
|
162
|
+
...buttonHoverColor && { "--btn-hover-bg-color": buttonHoverColor },
|
|
163
|
+
...buttonHoverTextColor && { "--btn-hover-text-color": buttonHoverTextColor },
|
|
164
|
+
...buttonHoverBorderColor && { "--btn-hover-border-color": buttonHoverBorderColor },
|
|
165
|
+
...buttonTextColor && { "--btn-text-color": buttonTextColor },
|
|
166
|
+
...statusSuccessColor && { "--status-ok-color": statusSuccessColor },
|
|
167
|
+
...statusErrorColor && { "--status-error-color": statusErrorColor }
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${XContactForm_default.wrapper} ${XContactForm_default[size]} ${decorativeX ? XContactForm_default.withDecorativeX : ""}`, style: customStyles, children: [
|
|
170
|
+
decorativeX && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: XContactForm_default.decorativeXTop, children: "\u2715" }),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit, className: `${XContactForm_default.form} ${XContactForm_default[layout]}`, noValidate: true, children: [
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.honeypot, "aria-hidden": "true", children: [
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "website", children: "Tu web" }),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "website", name: "website", type: "text", tabIndex: -1, autoComplete: "off" })
|
|
175
|
+
] }),
|
|
176
|
+
(showName || showEmail || showPhone) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.row, children: [
|
|
177
|
+
showName && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.field, children: [
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "name", children: "Nombre" }),
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "name", name: "name", type: "text", placeholder: namePlaceholder, required: true, maxLength: 80 })
|
|
180
|
+
] }),
|
|
181
|
+
showEmail && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.field, children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "email", children: "Email" }),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "email", name: "email", type: "email", inputMode: "email", placeholder: emailPlaceholder, required: true })
|
|
184
|
+
] }),
|
|
185
|
+
showPhone && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.field, children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "phone", children: "Tel\xE9fono" }),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "phone", name: "phone", type: "tel", inputMode: "tel", placeholder: phonePlaceholder, required: true, maxLength: 20 })
|
|
188
|
+
] })
|
|
189
|
+
] }),
|
|
190
|
+
showSubject && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.field, children: [
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "subject", children: "Asunto" }),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "subject", name: "subject", type: "text", placeholder: subjectPlaceholder, required: true, maxLength: 120 })
|
|
193
|
+
] }),
|
|
194
|
+
showMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: XContactForm_default.field, children: [
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "message", children: "Mensaje" }),
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { id: "message", name: "message", rows: 6, placeholder: messagePlaceholder, required: true, maxLength: 3e3 })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: XContactForm_default.buttoncontainer, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className: XContactForm_default.button, children: "Enviar" }) }),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `${XContactForm_default.status} ${status?.ok ? XContactForm_default.statusOk : status === null ? "" : XContactForm_default.statusError}`, role: "status", "aria-live": "polite", children: status?.msg })
|
|
200
|
+
] }),
|
|
201
|
+
decorativeX && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: XContactForm_default.decorativeXBottom, children: "\u2715" })
|
|
202
|
+
] });
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/components/forms/xnewsletter/XNewsletter.tsx
|
|
206
|
+
var import_react2 = require("react");
|
|
207
|
+
var import_link = __toESM(require("next/link"));
|
|
208
|
+
|
|
209
|
+
// src/components/forms/xnewsletter/XNewsletter.module.css
|
|
210
|
+
var XNewsletter_default = {};
|
|
211
|
+
|
|
212
|
+
// src/components/forms/xnewsletter/XNewsletter.tsx
|
|
213
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
214
|
+
function XNewsletter({
|
|
215
|
+
title = "Recibe poes\xEDa y reflexiones",
|
|
216
|
+
placeholder = "tu@email.com",
|
|
217
|
+
buttonText = "Suscribirse",
|
|
218
|
+
termsText = "Acepto",
|
|
219
|
+
termsLinkText = "t\xE9rminos",
|
|
220
|
+
successMessage = "\xA1Bienvenido(a)!",
|
|
221
|
+
errorMessage = "Algo sali\xF3 mal. Por favor, intenta de nuevo.",
|
|
222
|
+
termsErrorMessage = "Debes aceptar los t\xE9rminos y condiciones para suscribirte...",
|
|
223
|
+
termsLink = "/terminos-y-condiciones",
|
|
224
|
+
apiRoute,
|
|
225
|
+
method = "POST",
|
|
226
|
+
payloadType = "formData",
|
|
227
|
+
layout = "horizontal",
|
|
228
|
+
accentColor = "var(--accent)",
|
|
229
|
+
textColor = "var(--text)",
|
|
230
|
+
borderColor = "var(--border)",
|
|
231
|
+
buttonTextColor = "var(--accent-text)",
|
|
232
|
+
containerClassName = "w-full max-w-4xl mx-auto px-4 py-6"
|
|
233
|
+
}) {
|
|
234
|
+
const [email, setEmail] = (0, import_react2.useState)("");
|
|
235
|
+
const [acceptedTerms, setAcceptedTerms] = (0, import_react2.useState)(false);
|
|
236
|
+
const [message, setMessage] = (0, import_react2.useState)("");
|
|
237
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
|
|
238
|
+
const handleSubmit = async (e) => {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
setMessage("");
|
|
241
|
+
if (!acceptedTerms) {
|
|
242
|
+
setMessage(termsErrorMessage);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
setIsLoading(true);
|
|
246
|
+
try {
|
|
247
|
+
let bodyData = null;
|
|
248
|
+
let headers = {};
|
|
249
|
+
if (payloadType === "formData") {
|
|
250
|
+
const formData = new FormData();
|
|
251
|
+
formData.append("email", email);
|
|
252
|
+
bodyData = formData;
|
|
253
|
+
} else if (payloadType === "json") {
|
|
254
|
+
bodyData = JSON.stringify({ email });
|
|
255
|
+
headers = { "Content-Type": "application/json" };
|
|
256
|
+
}
|
|
257
|
+
const response = await fetch(apiRoute, {
|
|
258
|
+
method,
|
|
259
|
+
headers,
|
|
260
|
+
body: method !== "GET" ? bodyData : void 0,
|
|
261
|
+
cache: "no-store"
|
|
262
|
+
});
|
|
263
|
+
const data = await response.json();
|
|
264
|
+
if (response.ok && data.success) {
|
|
265
|
+
setMessage(data.message || successMessage);
|
|
266
|
+
setEmail("");
|
|
267
|
+
setAcceptedTerms(false);
|
|
268
|
+
} else {
|
|
269
|
+
setMessage(data.error || errorMessage);
|
|
270
|
+
}
|
|
271
|
+
} catch {
|
|
272
|
+
setMessage(errorMessage);
|
|
273
|
+
} finally {
|
|
274
|
+
setIsLoading(false);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const customCssVariables = {
|
|
278
|
+
"--nws-accent": accentColor,
|
|
279
|
+
"--nws-text": textColor,
|
|
280
|
+
"--nws-border": borderColor,
|
|
281
|
+
"--nws-btn-text": buttonTextColor
|
|
282
|
+
};
|
|
283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
className: `${XNewsletter_default.container} ${containerClassName}`,
|
|
287
|
+
style: customCssVariables,
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
290
|
+
"form",
|
|
291
|
+
{
|
|
292
|
+
onSubmit: handleSubmit,
|
|
293
|
+
className: `${XNewsletter_default.form} ${XNewsletter_default[layout]}`,
|
|
294
|
+
children: [
|
|
295
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: XNewsletter_default.title, children: title }),
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
297
|
+
"input",
|
|
298
|
+
{
|
|
299
|
+
type: "email",
|
|
300
|
+
placeholder,
|
|
301
|
+
className: XNewsletter_default.input,
|
|
302
|
+
"aria-label": "email",
|
|
303
|
+
value: email,
|
|
304
|
+
onChange: (e) => setEmail(e.target.value),
|
|
305
|
+
required: true,
|
|
306
|
+
disabled: isLoading
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
className: `${XNewsletter_default.actions} ${layout === "horizontal" ? XNewsletter_default.actionsHorizontal : XNewsletter_default.actionsVertical}`,
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: XNewsletter_default.checkboxLabel, children: [
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
316
|
+
"input",
|
|
317
|
+
{
|
|
318
|
+
type: "checkbox",
|
|
319
|
+
className: XNewsletter_default.checkbox,
|
|
320
|
+
checked: acceptedTerms,
|
|
321
|
+
onChange: (e) => setAcceptedTerms(e.target.checked),
|
|
322
|
+
required: true,
|
|
323
|
+
disabled: isLoading
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
|
|
327
|
+
termsText,
|
|
328
|
+
" ",
|
|
329
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
330
|
+
import_link.default,
|
|
331
|
+
{
|
|
332
|
+
href: termsLink,
|
|
333
|
+
target: "_blank",
|
|
334
|
+
rel: "noopener noreferrer",
|
|
335
|
+
className: XNewsletter_default.termsLink,
|
|
336
|
+
children: termsLinkText
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
] })
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
342
|
+
"button",
|
|
343
|
+
{
|
|
344
|
+
type: "submit",
|
|
345
|
+
disabled: isLoading,
|
|
346
|
+
className: XNewsletter_default.button,
|
|
347
|
+
children: isLoading ? "Enviando..." : buttonText
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
357
|
+
"p",
|
|
358
|
+
{
|
|
359
|
+
className: `${XNewsletter_default.message} ${layout === "horizontal" ? XNewsletter_default.messageHorizontal : XNewsletter_default.messageVertical}`,
|
|
360
|
+
children: message
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// src/components/navigation/xnavbar/XNavbar.tsx
|
|
369
|
+
var import_react3 = require("react");
|
|
370
|
+
var import_framer_motion = require("framer-motion");
|
|
371
|
+
var import_link2 = __toESM(require("next/link"));
|
|
372
|
+
var import_navigation = require("next/navigation");
|
|
373
|
+
|
|
374
|
+
// src/components/navigation/xnavbar/XNavbar.module.css
|
|
375
|
+
var XNavbar_default = {};
|
|
376
|
+
|
|
377
|
+
// src/components/navigation/xnavbar/XNavbar.tsx
|
|
378
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
379
|
+
var iconTrayRightVariants = {
|
|
380
|
+
hidden: { opacity: 0, x: -6, pointerEvents: "none" },
|
|
381
|
+
visible: { opacity: 1, x: 0, pointerEvents: "none", transition: { duration: 0.18 } }
|
|
382
|
+
};
|
|
383
|
+
var iconTrayLeftVariants = {
|
|
384
|
+
hidden: { opacity: 0, x: 6, pointerEvents: "none" },
|
|
385
|
+
visible: { opacity: 1, x: 0, pointerEvents: "none", transition: { duration: 0.18 } }
|
|
386
|
+
};
|
|
387
|
+
var topVariants = { closed: { rotate: 0 }, opened: { rotate: 45 } };
|
|
388
|
+
var centerVariants = { closed: { opacity: 1 }, opened: { opacity: 0 } };
|
|
389
|
+
var bottomVariants = { closed: { rotate: 0 }, opened: { rotate: -45 } };
|
|
390
|
+
var listVariants = {
|
|
391
|
+
closed: { x: "100vw" },
|
|
392
|
+
opened: { x: 0, transition: { when: "beforeChildren", staggerChildren: 0.02 } }
|
|
393
|
+
};
|
|
394
|
+
var itemVariants = {
|
|
395
|
+
closed: { x: -10, opacity: 0 },
|
|
396
|
+
opened: { x: 0, opacity: 1 }
|
|
397
|
+
};
|
|
398
|
+
function renderIcon(icon, size, color) {
|
|
399
|
+
if (typeof icon === "function") return icon(size, color);
|
|
400
|
+
return icon;
|
|
401
|
+
}
|
|
402
|
+
function XNavLink({ link, onClick, mobile }) {
|
|
403
|
+
const pathname = (0, import_navigation.usePathname)();
|
|
404
|
+
const isActive = link.url === "/" ? pathname === "/" : pathname?.startsWith(link.url);
|
|
405
|
+
const baseClass = mobile ? XNavbar_default.mobileNavLink : XNavbar_default.navLink;
|
|
406
|
+
const activeClass = mobile ? XNavbar_default.mobileNavLinkActive : XNavbar_default.navLinkActive;
|
|
407
|
+
const externalClass = link.external ? XNavbar_default.navLinkExternal : "";
|
|
408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
409
|
+
import_link2.default,
|
|
410
|
+
{
|
|
411
|
+
href: link.url,
|
|
412
|
+
onClick,
|
|
413
|
+
target: link.external ? "_blank" : void 0,
|
|
414
|
+
rel: link.external ? "noopener noreferrer" : void 0,
|
|
415
|
+
"aria-label": `Ir a ${link.title}`,
|
|
416
|
+
"aria-current": isActive ? "page" : void 0,
|
|
417
|
+
className: [baseClass, isActive ? activeClass : "", externalClass].filter(Boolean).join(" "),
|
|
418
|
+
children: link.title
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function XNavbar({
|
|
423
|
+
linksLeft = [],
|
|
424
|
+
linksRight = [],
|
|
425
|
+
logo = "X",
|
|
426
|
+
logoAsThemeToggle = true,
|
|
427
|
+
onLogoClick,
|
|
428
|
+
themeIcons,
|
|
429
|
+
defaultTheme = "light",
|
|
430
|
+
storageKey = "theme",
|
|
431
|
+
linkColor,
|
|
432
|
+
linkHoverColor,
|
|
433
|
+
linkActiveColor,
|
|
434
|
+
iconColor,
|
|
435
|
+
iconHoverColor,
|
|
436
|
+
iconSize = 22,
|
|
437
|
+
hamburgerColor,
|
|
438
|
+
hamburgerBarWidth,
|
|
439
|
+
hamburgerBarThickness,
|
|
440
|
+
cssVars,
|
|
441
|
+
labelOpen = "Abrir men\xFA",
|
|
442
|
+
labelClose = "Cerrar men\xFA",
|
|
443
|
+
labelDark = "Oscuro",
|
|
444
|
+
labelLight = "Claro",
|
|
445
|
+
className
|
|
446
|
+
}) {
|
|
447
|
+
const [open, setOpen] = (0, import_react3.useState)(false);
|
|
448
|
+
const [hoverX, setHoverX] = (0, import_react3.useState)(false);
|
|
449
|
+
const [theme, setTheme] = (0, import_react3.useState)(defaultTheme);
|
|
450
|
+
(0, import_react3.useEffect)(() => {
|
|
451
|
+
const saved = typeof window !== "undefined" && localStorage.getItem(storageKey);
|
|
452
|
+
applyTheme(saved ?? defaultTheme);
|
|
453
|
+
}, []);
|
|
454
|
+
function applyTheme(t) {
|
|
455
|
+
setTheme(t);
|
|
456
|
+
const root = document.documentElement;
|
|
457
|
+
if (t === "dark") root.setAttribute("data-theme", "dark");
|
|
458
|
+
else root.removeAttribute("data-theme");
|
|
459
|
+
localStorage.setItem(storageKey, t);
|
|
460
|
+
}
|
|
461
|
+
function toggleTheme() {
|
|
462
|
+
applyTheme(theme === "dark" ? "light" : "dark");
|
|
463
|
+
}
|
|
464
|
+
(0, import_react3.useEffect)(() => {
|
|
465
|
+
document.documentElement.style.overflow = open ? "hidden" : "";
|
|
466
|
+
return () => {
|
|
467
|
+
document.documentElement.style.overflow = "";
|
|
468
|
+
};
|
|
469
|
+
}, [open]);
|
|
470
|
+
(0, import_react3.useEffect)(() => {
|
|
471
|
+
if (!open) return;
|
|
472
|
+
const onKey = (e) => {
|
|
473
|
+
if (e.key === "Escape") setOpen(false);
|
|
474
|
+
};
|
|
475
|
+
window.addEventListener("keydown", onKey);
|
|
476
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
477
|
+
}, [open]);
|
|
478
|
+
const allLinks = [...linksLeft, ...linksRight];
|
|
479
|
+
const headerStyle = {
|
|
480
|
+
...linkColor && { "--xnav-link-color": linkColor },
|
|
481
|
+
...linkHoverColor && { "--xnav-link-hover": linkHoverColor },
|
|
482
|
+
...linkActiveColor && { "--xnav-link-active": linkActiveColor },
|
|
483
|
+
...iconColor && { "--xnav-icon-color": iconColor },
|
|
484
|
+
...iconHoverColor && { "--xnav-icon-hover": iconHoverColor },
|
|
485
|
+
...hamburgerColor && { "--xnav-bar-color": hamburgerColor },
|
|
486
|
+
...hamburgerBarWidth && { "--xnav-bar-w": hamburgerBarWidth },
|
|
487
|
+
...hamburgerBarThickness && { "--xnav-bar-h": hamburgerBarThickness },
|
|
488
|
+
...cssVars
|
|
489
|
+
};
|
|
490
|
+
const handleLogoClick = () => {
|
|
491
|
+
if (logoAsThemeToggle) {
|
|
492
|
+
toggleTheme();
|
|
493
|
+
} else {
|
|
494
|
+
onLogoClick?.();
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
const logoAriaLabel = logoAsThemeToggle ? `Cambiar a tema ${theme === "dark" ? "claro" : "oscuro"}` : void 0;
|
|
498
|
+
const logoTitle = logoAsThemeToggle ? theme === "dark" ? "Cambiar a tema claro" : "Cambiar a tema oscuro" : void 0;
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
500
|
+
"header",
|
|
501
|
+
{
|
|
502
|
+
className: [XNavbar_default.header, className].filter(Boolean).join(" "),
|
|
503
|
+
style: headerStyle,
|
|
504
|
+
role: "banner",
|
|
505
|
+
children: [
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("nav", { className: XNavbar_default.desktopNav, "aria-label": "Navegaci\xF3n principal", children: [
|
|
507
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: XNavbar_default.desktopLinksLeft, children: linksLeft.map((link) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(XNavLink, { link }, link.url + link.title)) }),
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: XNavbar_default.logoSlot, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
509
|
+
"div",
|
|
510
|
+
{
|
|
511
|
+
className: XNavbar_default.logoWrapper,
|
|
512
|
+
onMouseEnter: () => setHoverX(true),
|
|
513
|
+
onMouseLeave: () => setHoverX(false),
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
type: "button",
|
|
519
|
+
onClick: handleLogoClick,
|
|
520
|
+
"aria-label": logoAriaLabel,
|
|
521
|
+
title: logoTitle,
|
|
522
|
+
className: XNavbar_default.logoBtn,
|
|
523
|
+
children: logo
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
logoAsThemeToggle && themeIcons && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: theme === "light" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
527
|
+
import_framer_motion.motion.div,
|
|
528
|
+
{
|
|
529
|
+
initial: false,
|
|
530
|
+
animate: hoverX ? "visible" : "hidden",
|
|
531
|
+
variants: iconTrayRightVariants,
|
|
532
|
+
className: `${XNavbar_default.iconTray} ${XNavbar_default.iconTrayRight}`,
|
|
533
|
+
style: {
|
|
534
|
+
color: (hoverX ? iconHoverColor ?? iconColor : iconColor) || void 0
|
|
535
|
+
},
|
|
536
|
+
"aria-hidden": true,
|
|
537
|
+
children: renderIcon(themeIcons.toDark, iconSize, iconColor)
|
|
538
|
+
}
|
|
539
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
540
|
+
import_framer_motion.motion.div,
|
|
541
|
+
{
|
|
542
|
+
initial: false,
|
|
543
|
+
animate: hoverX ? "visible" : "hidden",
|
|
544
|
+
variants: iconTrayLeftVariants,
|
|
545
|
+
className: `${XNavbar_default.iconTray} ${XNavbar_default.iconTrayLeft}`,
|
|
546
|
+
style: {
|
|
547
|
+
color: (hoverX ? iconHoverColor ?? iconColor : iconColor) || void 0
|
|
548
|
+
},
|
|
549
|
+
"aria-hidden": true,
|
|
550
|
+
children: renderIcon(themeIcons.toLight, iconSize, iconColor)
|
|
551
|
+
}
|
|
552
|
+
) })
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
) }),
|
|
556
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: XNavbar_default.desktopLinksRight, children: linksRight.map((link) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(XNavLink, { link }, link.url + link.title)) })
|
|
557
|
+
] }),
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: XNavbar_default.mobileToggle, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
559
|
+
"button",
|
|
560
|
+
{
|
|
561
|
+
"aria-label": open ? labelClose : labelOpen,
|
|
562
|
+
"aria-expanded": open,
|
|
563
|
+
"aria-controls": "xnavbar-mobile-menu",
|
|
564
|
+
onClick: () => setOpen((p) => !p),
|
|
565
|
+
className: XNavbar_default.hamburgerBtn,
|
|
566
|
+
title: open ? labelClose : labelOpen,
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
569
|
+
import_framer_motion.motion.div,
|
|
570
|
+
{
|
|
571
|
+
variants: topVariants,
|
|
572
|
+
initial: "closed",
|
|
573
|
+
animate: open ? "opened" : "closed",
|
|
574
|
+
className: XNavbar_default.bar,
|
|
575
|
+
style: { originX: "left" },
|
|
576
|
+
"aria-hidden": true
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
580
|
+
import_framer_motion.motion.div,
|
|
581
|
+
{
|
|
582
|
+
variants: centerVariants,
|
|
583
|
+
initial: "closed",
|
|
584
|
+
animate: open ? "opened" : "closed",
|
|
585
|
+
className: XNavbar_default.bar,
|
|
586
|
+
"aria-hidden": true
|
|
587
|
+
}
|
|
588
|
+
),
|
|
589
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
590
|
+
import_framer_motion.motion.div,
|
|
591
|
+
{
|
|
592
|
+
variants: bottomVariants,
|
|
593
|
+
initial: "closed",
|
|
594
|
+
animate: open ? "opened" : "closed",
|
|
595
|
+
className: XNavbar_default.bar,
|
|
596
|
+
style: { originX: "left" },
|
|
597
|
+
"aria-hidden": true
|
|
598
|
+
}
|
|
599
|
+
)
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
) }),
|
|
603
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
604
|
+
import_framer_motion.motion.div,
|
|
605
|
+
{
|
|
606
|
+
id: "xnavbar-mobile-menu",
|
|
607
|
+
variants: listVariants,
|
|
608
|
+
initial: "closed",
|
|
609
|
+
animate: "opened",
|
|
610
|
+
className: XNavbar_default.mobileOverlay,
|
|
611
|
+
role: "dialog",
|
|
612
|
+
"aria-modal": "true",
|
|
613
|
+
"aria-label": "Men\xFA de navegaci\xF3n",
|
|
614
|
+
children: [
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
616
|
+
"button",
|
|
617
|
+
{
|
|
618
|
+
"aria-label": labelClose,
|
|
619
|
+
onClick: () => setOpen(false),
|
|
620
|
+
className: XNavbar_default.mobileCloseBtn,
|
|
621
|
+
style: { WebkitTapHighlightColor: "transparent" },
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
624
|
+
"span",
|
|
625
|
+
{
|
|
626
|
+
"aria-hidden": true,
|
|
627
|
+
className: XNavbar_default.closeBar,
|
|
628
|
+
style: { transform: "rotate(45deg)" }
|
|
629
|
+
}
|
|
630
|
+
),
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
632
|
+
"span",
|
|
633
|
+
{
|
|
634
|
+
"aria-hidden": true,
|
|
635
|
+
className: XNavbar_default.closeBar,
|
|
636
|
+
style: { transform: "rotate(-45deg)" }
|
|
637
|
+
}
|
|
638
|
+
),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: labelClose })
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_framer_motion.motion.div, { variants: itemVariants, className: XNavbar_default.mobileLogo, children: logo }),
|
|
644
|
+
allLinks.map((link) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_framer_motion.motion.div, { variants: itemVariants, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
645
|
+
XNavLink,
|
|
646
|
+
{
|
|
647
|
+
link,
|
|
648
|
+
onClick: () => setOpen(false),
|
|
649
|
+
mobile: true
|
|
650
|
+
}
|
|
651
|
+
) }, link.url + link.title)),
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
653
|
+
import_framer_motion.motion.button,
|
|
654
|
+
{
|
|
655
|
+
variants: itemVariants,
|
|
656
|
+
onClick: toggleTheme,
|
|
657
|
+
className: XNavbar_default.themeToggleMobile,
|
|
658
|
+
children: themeIcons ? theme === "light" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
659
|
+
renderIcon(themeIcons.toDark, iconSize, iconColor),
|
|
660
|
+
labelDark
|
|
661
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
662
|
+
renderIcon(themeIcons.toLight, iconSize, iconColor),
|
|
663
|
+
labelLight
|
|
664
|
+
] }) : theme === "light" ? labelDark : labelLight
|
|
665
|
+
}
|
|
666
|
+
)
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
)
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// src/components/layout/xfooter/XFooter.tsx
|
|
676
|
+
var import_link3 = __toESM(require("next/link"));
|
|
677
|
+
|
|
678
|
+
// src/components/layout/xfooter/XFooter.module.css
|
|
679
|
+
var XFooter_default = {};
|
|
680
|
+
|
|
681
|
+
// src/components/layout/xfooter/XFooter.tsx
|
|
682
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
683
|
+
function XFooter({
|
|
684
|
+
links,
|
|
685
|
+
copyright,
|
|
686
|
+
layout = "horizontal",
|
|
687
|
+
columns = 1,
|
|
688
|
+
colors,
|
|
689
|
+
className = ""
|
|
690
|
+
}) {
|
|
691
|
+
const customStyles = {
|
|
692
|
+
"--xf-bg": colors?.bg,
|
|
693
|
+
"--xf-text": colors?.text,
|
|
694
|
+
"--xf-accent": colors?.accent,
|
|
695
|
+
"--xf-border": colors?.border,
|
|
696
|
+
"--xf-cols": layout === "horizontal" ? columns : 1
|
|
697
|
+
};
|
|
698
|
+
const currentYear = copyright?.customYear || (/* @__PURE__ */ new Date()).getFullYear();
|
|
699
|
+
const copyLabel = copyright?.text || "Xscriptor";
|
|
700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("footer", { className: `${XFooter_default.XFooter} ${className}`, style: customStyles, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: XFooter_default.container, children: [
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: layout === "vertical" ? XFooter_default.navVertical : XFooter_default.nav, children: links.map((link, idx) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_link3.default, { href: link.href, className: XFooter_default.link, children: link.label }, idx)) }),
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: XFooter_default.copyright, children: [
|
|
703
|
+
"\xA9 ",
|
|
704
|
+
copyright?.yearFirst ? `${currentYear} ${copyLabel}` : `${copyLabel} ${currentYear}`
|
|
705
|
+
] })
|
|
706
|
+
] }) });
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// src/components/layout/xseparator/XSeparator.module.css
|
|
710
|
+
var XSeparator_default = {};
|
|
711
|
+
|
|
712
|
+
// src/components/layout/xseparator/XSeparator.tsx
|
|
713
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
714
|
+
function XSeparator({
|
|
715
|
+
orientation = "horizontal",
|
|
716
|
+
variant = "solid",
|
|
717
|
+
isFaded = false,
|
|
718
|
+
hasX = false,
|
|
719
|
+
xColor,
|
|
720
|
+
xBg = "white",
|
|
721
|
+
thickness = "1px",
|
|
722
|
+
color = "#e2e8f0",
|
|
723
|
+
gap = "1rem",
|
|
724
|
+
className = ""
|
|
725
|
+
}) {
|
|
726
|
+
const dynamicStyles = {
|
|
727
|
+
"--separator-color": color,
|
|
728
|
+
"--separator-thickness": thickness,
|
|
729
|
+
"--separator-margin": gap,
|
|
730
|
+
"--x-color": xColor || color,
|
|
731
|
+
// Si no se define xColor, usa el color de la línea
|
|
732
|
+
"--x-bg": xBg
|
|
733
|
+
};
|
|
734
|
+
const classes = [
|
|
735
|
+
XSeparator_default.separator,
|
|
736
|
+
orientation === "vertical" ? XSeparator_default.vertical : XSeparator_default.horizontal,
|
|
737
|
+
variant !== "solid" && XSeparator_default[variant],
|
|
738
|
+
isFaded && XSeparator_default.faded
|
|
739
|
+
].filter(Boolean).join(" ");
|
|
740
|
+
const line = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", { className: classes, style: dynamicStyles });
|
|
741
|
+
if (!hasX) return line;
|
|
742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `${XSeparator_default.separatorContainer} ${className}`, style: dynamicStyles, children: [
|
|
743
|
+
line,
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: XSeparator_default.iconWrapper, children: "\u2715" })
|
|
745
|
+
] });
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// src/components/layout/xzigzaglayout/XZigZagLayout.tsx
|
|
749
|
+
var import_react4 = require("react");
|
|
750
|
+
|
|
751
|
+
// src/components/layout/xzigzaglayout/XZigZagLayout.module.css
|
|
752
|
+
var XZigZagLayout_default = {};
|
|
753
|
+
|
|
754
|
+
// src/components/layout/xzigzaglayout/XZigZagLayout.tsx
|
|
755
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
756
|
+
function XZigZagLayout({
|
|
757
|
+
children,
|
|
758
|
+
className,
|
|
759
|
+
style,
|
|
760
|
+
startSide = "left",
|
|
761
|
+
gap,
|
|
762
|
+
offset,
|
|
763
|
+
textAlign = "inherit",
|
|
764
|
+
showLine = false,
|
|
765
|
+
lineColor = "#cccccc",
|
|
766
|
+
lineThickness = 2,
|
|
767
|
+
...rest
|
|
768
|
+
}) {
|
|
769
|
+
const items = import_react4.Children.toArray(children).filter(Boolean);
|
|
770
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
771
|
+
const itemsRef = (0, import_react4.useRef)([]);
|
|
772
|
+
const pathRef = (0, import_react4.useRef)(null);
|
|
773
|
+
const [points, setPoints] = (0, import_react4.useState)([]);
|
|
774
|
+
const [pathLength, setPathLength] = (0, import_react4.useState)(0);
|
|
775
|
+
const [drawProgress, setDrawProgress] = (0, import_react4.useState)(0);
|
|
776
|
+
const calculatePoints = (0, import_react4.useCallback)(() => {
|
|
777
|
+
if (!containerRef.current) return;
|
|
778
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
779
|
+
const newPoints = itemsRef.current.filter(Boolean).map((el) => {
|
|
780
|
+
const rect = el.getBoundingClientRect();
|
|
781
|
+
return {
|
|
782
|
+
x: rect.left + rect.width / 2 - containerRect.left,
|
|
783
|
+
y: rect.top + rect.height / 2 - containerRect.top
|
|
784
|
+
};
|
|
785
|
+
});
|
|
786
|
+
if (newPoints.length > 0) {
|
|
787
|
+
newPoints.unshift({ x: newPoints[0].x, y: 0 });
|
|
788
|
+
newPoints.push({ x: newPoints[newPoints.length - 1].x, y: containerRect.height });
|
|
789
|
+
}
|
|
790
|
+
setPoints(newPoints);
|
|
791
|
+
}, []);
|
|
792
|
+
(0, import_react4.useEffect)(() => {
|
|
793
|
+
if (!showLine || !containerRef.current) return;
|
|
794
|
+
const observer = new ResizeObserver(() => calculatePoints());
|
|
795
|
+
observer.observe(containerRef.current);
|
|
796
|
+
calculatePoints();
|
|
797
|
+
return () => observer.disconnect();
|
|
798
|
+
}, [showLine, calculatePoints]);
|
|
799
|
+
(0, import_react4.useEffect)(() => {
|
|
800
|
+
if (pathRef.current) setPathLength(pathRef.current.getTotalLength());
|
|
801
|
+
}, [points]);
|
|
802
|
+
(0, import_react4.useEffect)(() => {
|
|
803
|
+
if (!showLine) return;
|
|
804
|
+
const handleScroll = () => {
|
|
805
|
+
if (!containerRef.current) return;
|
|
806
|
+
const { top, height } = containerRef.current.getBoundingClientRect();
|
|
807
|
+
const windowHeight = window.innerHeight;
|
|
808
|
+
const start = windowHeight / 2;
|
|
809
|
+
const progress = (start - top) / height;
|
|
810
|
+
setDrawProgress(Math.min(Math.max(progress, 0), 1));
|
|
811
|
+
};
|
|
812
|
+
window.addEventListener("scroll", handleScroll);
|
|
813
|
+
handleScroll();
|
|
814
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
815
|
+
}, [showLine]);
|
|
816
|
+
const cssVars = {};
|
|
817
|
+
if (gap !== void 0) cssVars["--x-zigzag-gap"] = typeof gap === "number" ? `${gap}px` : gap;
|
|
818
|
+
if (offset !== void 0) cssVars["--x-zigzag-offset"] = typeof offset === "number" ? `${offset}px` : offset;
|
|
819
|
+
const mergedStyle = { ...style, ...cssVars };
|
|
820
|
+
const pathD = points.length > 0 ? `M ${points[0].x} ${points[0].y} ` + points.slice(1).map((p) => `L ${p.x} ${p.y}`).join(" ") : "";
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
822
|
+
"div",
|
|
823
|
+
{
|
|
824
|
+
ref: containerRef,
|
|
825
|
+
...rest,
|
|
826
|
+
className: [XZigZagLayout_default.layout, className].filter(Boolean).join(" "),
|
|
827
|
+
style: mergedStyle,
|
|
828
|
+
children: [
|
|
829
|
+
showLine && points.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: XZigZagLayout_default.svgLine, xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
830
|
+
"path",
|
|
831
|
+
{
|
|
832
|
+
ref: pathRef,
|
|
833
|
+
d: pathD,
|
|
834
|
+
fill: "none",
|
|
835
|
+
stroke: lineColor,
|
|
836
|
+
strokeWidth: lineThickness,
|
|
837
|
+
strokeDasharray: pathLength,
|
|
838
|
+
strokeDashoffset: pathLength - pathLength * drawProgress,
|
|
839
|
+
style: { transition: "stroke-dashoffset 0.1s ease-out" }
|
|
840
|
+
}
|
|
841
|
+
) }),
|
|
842
|
+
items.map((child, index) => {
|
|
843
|
+
const isStartLeft = startSide === "left";
|
|
844
|
+
const alignLeft = isStartLeft ? index % 2 === 0 : index % 2 !== 0;
|
|
845
|
+
const alignmentClass = textAlign === "side" ? alignLeft ? XZigZagLayout_default.textLeft : XZigZagLayout_default.textRight : textAlign === "left" ? XZigZagLayout_default.textLeft : textAlign === "right" ? XZigZagLayout_default.textRight : "";
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${XZigZagLayout_default.item} ${alignLeft ? XZigZagLayout_default.left : XZigZagLayout_default.right} ${alignmentClass}`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: (el) => {
|
|
847
|
+
itemsRef.current[index] = el;
|
|
848
|
+
}, className: XZigZagLayout_default.contentWrapper, children: child }) }, index);
|
|
849
|
+
})
|
|
850
|
+
]
|
|
851
|
+
}
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/components/content/xinteractivephrase/XInteractivePhrase.tsx
|
|
856
|
+
var import_react5 = __toESM(require("react"));
|
|
857
|
+
|
|
858
|
+
// src/components/content/xinteractivephrase/XInteractivePhrase.module.css
|
|
859
|
+
var XInteractivePhrase_default = {};
|
|
860
|
+
|
|
861
|
+
// src/components/content/xinteractivephrase/XInteractivePhrase.tsx
|
|
862
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
863
|
+
function XInteractivePhrase({
|
|
864
|
+
words,
|
|
865
|
+
as: Tag = "p",
|
|
866
|
+
className = ""
|
|
867
|
+
}) {
|
|
868
|
+
const [active1, setActive1] = (0, import_react5.useState)(false);
|
|
869
|
+
const [active2, setActive2] = (0, import_react5.useState)(false);
|
|
870
|
+
const handleAction = (type) => {
|
|
871
|
+
if (type === "underline") setActive1(!active1);
|
|
872
|
+
if (type === "button") setActive2(!active2);
|
|
873
|
+
};
|
|
874
|
+
const onKeyDown = (e, type) => {
|
|
875
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
876
|
+
e.preventDefault();
|
|
877
|
+
handleAction(type);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `${XInteractivePhrase_default.container} ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tag, { className: XInteractivePhrase_default.title, children: words.map((word, index) => {
|
|
881
|
+
let dynamicClass = "";
|
|
882
|
+
let clickHandler = void 0;
|
|
883
|
+
let keyHandler = void 0;
|
|
884
|
+
if (word.type === "underline") {
|
|
885
|
+
dynamicClass = XInteractivePhrase_default.underlineEffect;
|
|
886
|
+
clickHandler = () => handleAction("underline");
|
|
887
|
+
keyHandler = (e) => onKeyDown(e, "underline");
|
|
888
|
+
} else if (word.type === "button") {
|
|
889
|
+
dynamicClass = XInteractivePhrase_default.buttonEffect;
|
|
890
|
+
clickHandler = () => handleAction("button");
|
|
891
|
+
keyHandler = (e) => onKeyDown(e, "button");
|
|
892
|
+
} else if (word.type === "blur1") {
|
|
893
|
+
dynamicClass = `${XInteractivePhrase_default.blurEffect} ${active1 ? XInteractivePhrase_default.isVisible : XInteractivePhrase_default.isHidden}`;
|
|
894
|
+
} else if (word.type === "blur2") {
|
|
895
|
+
dynamicClass = `${XInteractivePhrase_default.blurEffect} ${active2 ? XInteractivePhrase_default.isVisible : XInteractivePhrase_default.isHidden}`;
|
|
896
|
+
}
|
|
897
|
+
let content = word.text;
|
|
898
|
+
if (word.italic) content = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("em", { children: content });
|
|
899
|
+
if (word.bold) content = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: content });
|
|
900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react5.default.Fragment, { children: [
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
902
|
+
"span",
|
|
903
|
+
{
|
|
904
|
+
className: dynamicClass,
|
|
905
|
+
onClick: clickHandler,
|
|
906
|
+
onKeyDown: keyHandler,
|
|
907
|
+
role: clickHandler ? "button" : void 0,
|
|
908
|
+
tabIndex: clickHandler ? 0 : void 0,
|
|
909
|
+
children: content
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
word.breakAfter ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: XInteractivePhrase_default.lineBreak }) : " "
|
|
913
|
+
] }, index);
|
|
914
|
+
}) }) });
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// src/components/gallery/xmicrogallerytext/XMicroGalleryText.tsx
|
|
918
|
+
var import_react6 = __toESM(require("react"));
|
|
919
|
+
var import_image = __toESM(require("next/image"));
|
|
920
|
+
var import_framer_motion2 = require("framer-motion");
|
|
921
|
+
|
|
922
|
+
// src/components/gallery/xmicrogallerytext/XMicroGalleryText.module.css
|
|
923
|
+
var XMicroGalleryText_default = {};
|
|
924
|
+
|
|
925
|
+
// src/components/gallery/xmicrogallerytext/XMicroGalleryText.tsx
|
|
926
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
927
|
+
var DISPLAY_COUNT = 3;
|
|
928
|
+
var XMicroGalleryText = ({
|
|
929
|
+
images,
|
|
930
|
+
text,
|
|
931
|
+
textPosition = "left",
|
|
932
|
+
textAlign = "left",
|
|
933
|
+
autoShuffle = false,
|
|
934
|
+
shuffleInterval = 5e3
|
|
935
|
+
}) => {
|
|
936
|
+
const containerRef = (0, import_react6.useRef)(null);
|
|
937
|
+
const [startIndex, setStartIndex] = import_react6.default.useState(0);
|
|
938
|
+
const visibleImages = import_react6.default.useMemo(() => {
|
|
939
|
+
const result = [];
|
|
940
|
+
for (let i = 0; i < DISPLAY_COUNT; i++) {
|
|
941
|
+
result.push(images[(startIndex + i) % images.length]);
|
|
942
|
+
}
|
|
943
|
+
return result;
|
|
944
|
+
}, [images, startIndex]);
|
|
945
|
+
import_react6.default.useEffect(() => {
|
|
946
|
+
if (!autoShuffle || images.length <= DISPLAY_COUNT) return;
|
|
947
|
+
const intervalId = setInterval(() => {
|
|
948
|
+
setStartIndex((prev) => (prev + 1) % images.length);
|
|
949
|
+
}, shuffleInterval);
|
|
950
|
+
return () => clearInterval(intervalId);
|
|
951
|
+
}, [autoShuffle, shuffleInterval, images.length]);
|
|
952
|
+
const [isVisible, setIsVisible] = import_react6.default.useState(false);
|
|
953
|
+
(0, import_react6.useEffect)(() => {
|
|
954
|
+
const observer = new IntersectionObserver(
|
|
955
|
+
([entry]) => {
|
|
956
|
+
if (entry.isIntersecting) {
|
|
957
|
+
setIsVisible(true);
|
|
958
|
+
observer.disconnect();
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
threshold: 0.1,
|
|
963
|
+
rootMargin: "0px 0px -50px 0px"
|
|
964
|
+
}
|
|
965
|
+
);
|
|
966
|
+
if (containerRef.current) {
|
|
967
|
+
observer.observe(containerRef.current);
|
|
968
|
+
}
|
|
969
|
+
return () => observer.disconnect();
|
|
970
|
+
}, []);
|
|
971
|
+
const isTextRight = textPosition === "right";
|
|
972
|
+
const alignClass = {
|
|
973
|
+
left: XMicroGalleryText_default.textLeft,
|
|
974
|
+
right: XMicroGalleryText_default.textRight,
|
|
975
|
+
center: XMicroGalleryText_default.textCenter
|
|
976
|
+
}[textAlign];
|
|
977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: containerRef, className: `${XMicroGalleryText_default.container} ${isTextRight ? XMicroGalleryText_default.reverse : ""}`, children: [
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${XMicroGalleryText_default.textContent} ${alignClass} ${isVisible ? XMicroGalleryText_default.visible : ""}`, children: typeof text === "string" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { dangerouslySetInnerHTML: { __html: text } }) : text }),
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: XMicroGalleryText_default.gallery, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: XMicroGalleryText_default.artisticGrid, children: visibleImages.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
980
|
+
import_framer_motion2.motion.div,
|
|
981
|
+
{
|
|
982
|
+
layout: true,
|
|
983
|
+
className: `${XMicroGalleryText_default.imageWrapper} ${XMicroGalleryText_default[`artistic${index + 1}`]} ${isVisible ? XMicroGalleryText_default.visible : ""}`,
|
|
984
|
+
style: { transitionProperty: "opacity, box-shadow" },
|
|
985
|
+
transition: {
|
|
986
|
+
layout: { type: "spring", stiffness: 80, damping: 20 }
|
|
987
|
+
},
|
|
988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
989
|
+
import_image.default,
|
|
990
|
+
{
|
|
991
|
+
src: image.src,
|
|
992
|
+
alt: image.alt,
|
|
993
|
+
fill: true,
|
|
994
|
+
className: XMicroGalleryText_default.previewImage,
|
|
995
|
+
sizes: "(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
|
996
|
+
}
|
|
997
|
+
)
|
|
998
|
+
},
|
|
999
|
+
image.src
|
|
1000
|
+
)) }) })
|
|
1001
|
+
] });
|
|
1002
|
+
};
|
|
1003
|
+
var XMicroGalleryText_default2 = XMicroGalleryText;
|
|
1004
|
+
|
|
1005
|
+
// src/components/gallery/xstaticgallery/XStaticGallery.tsx
|
|
1006
|
+
var import_react7 = require("react");
|
|
1007
|
+
var import_image2 = __toESM(require("next/image"));
|
|
1008
|
+
|
|
1009
|
+
// src/components/gallery/xstaticgallery/XStaticGallery.module.css
|
|
1010
|
+
var XStaticGallery_default = {};
|
|
1011
|
+
|
|
1012
|
+
// src/components/gallery/xstaticgallery/XStaticGallery.tsx
|
|
1013
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1014
|
+
var COLUMN_CLASSES = {
|
|
1015
|
+
1: XStaticGallery_default.cols1,
|
|
1016
|
+
2: XStaticGallery_default.cols2,
|
|
1017
|
+
3: XStaticGallery_default.cols3,
|
|
1018
|
+
4: XStaticGallery_default.cols4,
|
|
1019
|
+
5: XStaticGallery_default.cols5
|
|
1020
|
+
};
|
|
1021
|
+
function XStaticGallery({ images, columns = 4, title }) {
|
|
1022
|
+
const containerRef = (0, import_react7.useRef)(null);
|
|
1023
|
+
(0, import_react7.useEffect)(() => {
|
|
1024
|
+
const observer = new IntersectionObserver(
|
|
1025
|
+
(entries) => {
|
|
1026
|
+
entries.forEach((entry) => {
|
|
1027
|
+
if (entry.isIntersecting) {
|
|
1028
|
+
entry.target.classList.add(XStaticGallery_default.visible);
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
threshold: 0.1,
|
|
1034
|
+
rootMargin: "0px 0px -50px 0px"
|
|
1035
|
+
}
|
|
1036
|
+
);
|
|
1037
|
+
const items = containerRef.current?.querySelectorAll(`.${XStaticGallery_default.masonryItem}`);
|
|
1038
|
+
items?.forEach((el) => observer.observe(el));
|
|
1039
|
+
return () => observer.disconnect();
|
|
1040
|
+
}, []);
|
|
1041
|
+
const colClass = COLUMN_CLASSES[columns] || COLUMN_CLASSES[4];
|
|
1042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: containerRef, className: XStaticGallery_default.galleryContainer, children: [
|
|
1043
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: XStaticGallery_default.galleryTitle, children: title }),
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${XStaticGallery_default.masonryGrid} ${colClass}`, children: images.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: XStaticGallery_default.masonryItem, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: XStaticGallery_default.imageContainer, children: [
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1046
|
+
import_image2.default,
|
|
1047
|
+
{
|
|
1048
|
+
src: image.src,
|
|
1049
|
+
alt: image.alt,
|
|
1050
|
+
width: 600,
|
|
1051
|
+
height: 600,
|
|
1052
|
+
className: XStaticGallery_default.galleryImage,
|
|
1053
|
+
loading: "lazy",
|
|
1054
|
+
sizes: "(max-width: 640px) 100vw, (max-width: 768px) 50vw, (max-width: 1280px) 33vw, 25vw"
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: XStaticGallery_default.imageOverlay })
|
|
1058
|
+
] }) }, index)) })
|
|
1059
|
+
] });
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
// src/components/social/xsocialcontact/XSocialContact.module.css
|
|
1063
|
+
var XSocialContact_default = {};
|
|
1064
|
+
|
|
1065
|
+
// src/components/social/xsocialcontact/XSocialContact.tsx
|
|
1066
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1067
|
+
function XSocialContact({
|
|
1068
|
+
items,
|
|
1069
|
+
columns = 3,
|
|
1070
|
+
rows,
|
|
1071
|
+
size = "medium",
|
|
1072
|
+
alignment = "center",
|
|
1073
|
+
gap,
|
|
1074
|
+
backgroundColor,
|
|
1075
|
+
iconDefaultColor,
|
|
1076
|
+
iconDefaultHoverColor,
|
|
1077
|
+
borderColor,
|
|
1078
|
+
borderWidth,
|
|
1079
|
+
borderStyle = "solid",
|
|
1080
|
+
borderRadius = "rounded",
|
|
1081
|
+
padding,
|
|
1082
|
+
textAlign = "center",
|
|
1083
|
+
textColor,
|
|
1084
|
+
textSize
|
|
1085
|
+
}) {
|
|
1086
|
+
const sizeMap = {
|
|
1087
|
+
small: "1rem",
|
|
1088
|
+
medium: "1.5rem",
|
|
1089
|
+
large: "2rem"
|
|
1090
|
+
};
|
|
1091
|
+
const alignmentMap = {
|
|
1092
|
+
left: "flex-start",
|
|
1093
|
+
center: "center",
|
|
1094
|
+
right: "flex-end"
|
|
1095
|
+
};
|
|
1096
|
+
const textAlignMap = {
|
|
1097
|
+
left: "left",
|
|
1098
|
+
center: "center",
|
|
1099
|
+
right: "right"
|
|
1100
|
+
};
|
|
1101
|
+
const radiusMap = {
|
|
1102
|
+
rounded: "0.5rem",
|
|
1103
|
+
square: "0"
|
|
1104
|
+
};
|
|
1105
|
+
const defaultGap = gap || (size === "small" ? "1rem" : size === "medium" ? "1.5rem" : "2rem");
|
|
1106
|
+
const defaultPadding = padding || (size === "small" ? "1rem" : size === "medium" ? "1.5rem" : "2rem");
|
|
1107
|
+
const defaultTextSize = textSize || (size === "small" ? "0.875rem" : size === "medium" ? "1rem" : "1.125rem");
|
|
1108
|
+
const customStyles = {
|
|
1109
|
+
"--columns": columns.toString(),
|
|
1110
|
+
"--gap": defaultGap,
|
|
1111
|
+
"--padding": defaultPadding,
|
|
1112
|
+
"--text-size": defaultTextSize,
|
|
1113
|
+
"--alignment": alignmentMap[alignment],
|
|
1114
|
+
"--text-align": textAlignMap[textAlign],
|
|
1115
|
+
"--icon-gap": sizeMap[size],
|
|
1116
|
+
"--border-radius": radiusMap[borderRadius],
|
|
1117
|
+
...backgroundColor && { "--bg-color": backgroundColor },
|
|
1118
|
+
...iconDefaultColor && { "--icon-color": iconDefaultColor },
|
|
1119
|
+
...iconDefaultHoverColor && { "--icon-hover-color": iconDefaultHoverColor },
|
|
1120
|
+
...borderColor && { "--border-color": borderColor },
|
|
1121
|
+
...borderWidth && { "--border-width": borderWidth },
|
|
1122
|
+
...textColor && { "--text-color": textColor },
|
|
1123
|
+
"--border-style": borderStyle
|
|
1124
|
+
};
|
|
1125
|
+
let containerClass = XSocialContact_default.container;
|
|
1126
|
+
if (rows) {
|
|
1127
|
+
containerClass += ` ${XSocialContact_default[`rows${rows}`]}`;
|
|
1128
|
+
}
|
|
1129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1130
|
+
"div",
|
|
1131
|
+
{
|
|
1132
|
+
className: `${containerClass} ${XSocialContact_default[size]}`,
|
|
1133
|
+
style: customStyles,
|
|
1134
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1135
|
+
"a",
|
|
1136
|
+
{
|
|
1137
|
+
href: item.href,
|
|
1138
|
+
target: "_blank",
|
|
1139
|
+
rel: "noopener noreferrer",
|
|
1140
|
+
className: XSocialContact_default.item,
|
|
1141
|
+
title: item.label,
|
|
1142
|
+
style: {
|
|
1143
|
+
...item.iconColor && { "--item-icon-color": item.iconColor },
|
|
1144
|
+
...item.iconHoverColor && { "--item-icon-hover-color": item.iconHoverColor }
|
|
1145
|
+
},
|
|
1146
|
+
children: [
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: XSocialContact_default.iconWrapper, children: item.icon }),
|
|
1148
|
+
item.text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: XSocialContact_default.text, children: item.text })
|
|
1149
|
+
]
|
|
1150
|
+
},
|
|
1151
|
+
item.id
|
|
1152
|
+
))
|
|
1153
|
+
}
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// src/components/social/xsocialcontact/XSocialIcons.tsx
|
|
1158
|
+
var import_react8 = require("react");
|
|
1159
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1160
|
+
function XSocialIconShell({
|
|
1161
|
+
size = 24,
|
|
1162
|
+
color = "currentColor",
|
|
1163
|
+
hoverColor,
|
|
1164
|
+
fillColor,
|
|
1165
|
+
hoverFillColor,
|
|
1166
|
+
backgroundColor,
|
|
1167
|
+
badgeColor,
|
|
1168
|
+
badgeBackgroundColor,
|
|
1169
|
+
strokeWidth = 1.8,
|
|
1170
|
+
showBadge = true,
|
|
1171
|
+
title,
|
|
1172
|
+
style,
|
|
1173
|
+
children,
|
|
1174
|
+
...rest
|
|
1175
|
+
}) {
|
|
1176
|
+
const [isHovered, setIsHovered] = (0, import_react8.useState)(false);
|
|
1177
|
+
const stroke = isHovered && hoverColor ? hoverColor : color;
|
|
1178
|
+
const fill = isHovered && hoverFillColor ? hoverFillColor : fillColor || stroke;
|
|
1179
|
+
const badgeStroke = badgeColor || stroke;
|
|
1180
|
+
const badgeFill = badgeBackgroundColor || "transparent";
|
|
1181
|
+
const palette = {
|
|
1182
|
+
stroke,
|
|
1183
|
+
fill,
|
|
1184
|
+
badgeStroke,
|
|
1185
|
+
badgeFill
|
|
1186
|
+
};
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1188
|
+
"svg",
|
|
1189
|
+
{
|
|
1190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1191
|
+
width: size,
|
|
1192
|
+
height: size,
|
|
1193
|
+
viewBox: "0 0 24 24",
|
|
1194
|
+
fill: "none",
|
|
1195
|
+
role: title ? "img" : "presentation",
|
|
1196
|
+
"aria-label": title,
|
|
1197
|
+
"aria-hidden": title ? void 0 : true,
|
|
1198
|
+
onPointerEnter: () => setIsHovered(true),
|
|
1199
|
+
onPointerLeave: () => setIsHovered(false),
|
|
1200
|
+
style: { color: stroke, ...style ?? {} },
|
|
1201
|
+
...rest,
|
|
1202
|
+
children: [
|
|
1203
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("title", { children: title }) : null,
|
|
1204
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1205
|
+
"circle",
|
|
1206
|
+
{
|
|
1207
|
+
cx: "12",
|
|
1208
|
+
cy: "12",
|
|
1209
|
+
r: "10.5",
|
|
1210
|
+
fill: backgroundColor || "none",
|
|
1211
|
+
stroke: backgroundColor ? "none" : stroke,
|
|
1212
|
+
strokeOpacity: backgroundColor ? void 0 : 0.14,
|
|
1213
|
+
strokeWidth: backgroundColor ? void 0 : strokeWidth
|
|
1214
|
+
}
|
|
1215
|
+
),
|
|
1216
|
+
children({ palette }),
|
|
1217
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("g", { children: [
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "18", cy: "18", r: "2.6", fill: badgeFill, stroke: badgeStroke, strokeWidth: "1" }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M17.05 17.05L18.95 18.95M18.95 17.05L17.05 18.95", stroke: badgeStroke, strokeWidth: "1.15", strokeLinecap: "round" })
|
|
1220
|
+
] })
|
|
1221
|
+
]
|
|
1222
|
+
}
|
|
1223
|
+
);
|
|
1224
|
+
}
|
|
1225
|
+
function XTelegramIcon(props) {
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.8, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1228
|
+
"path",
|
|
1229
|
+
{
|
|
1230
|
+
d: "M9.2 12.4l2.15 2.15 5.1-5.1M20.6 4.2L4 12l6.45 1.8 1.8 6.45 2.55-4.2 4.2 2.55 1.6-14.4z",
|
|
1231
|
+
stroke: palette.stroke,
|
|
1232
|
+
strokeWidth: "1.8",
|
|
1233
|
+
strokeLinecap: "round",
|
|
1234
|
+
strokeLinejoin: "round",
|
|
1235
|
+
fill: "none"
|
|
1236
|
+
}
|
|
1237
|
+
),
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "12", cy: "12", r: "9.75", fill: "none", stroke: palette.stroke, strokeOpacity: "0.18", strokeWidth: "1" })
|
|
1239
|
+
] }) });
|
|
1240
|
+
}
|
|
1241
|
+
function XInstagramIcon(props) {
|
|
1242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.6, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("rect", { x: "6.2", y: "6.2", width: "11.6", height: "11.6", rx: "3.2", ry: "3.2", stroke: palette.stroke, strokeWidth: "1.6", fill: "none" }),
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "12", cy: "12", r: "3.15", stroke: palette.stroke, strokeWidth: "1.6", fill: "none" }),
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "16.3", cy: "7.7", r: "0.7", fill: palette.fill })
|
|
1246
|
+
] }) });
|
|
1247
|
+
}
|
|
1248
|
+
function XWhatsappIcon(props) {
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.5, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1251
|
+
"path",
|
|
1252
|
+
{
|
|
1253
|
+
d: "M16.72 13.06c-.29-.15-1.71-.84-1.98-.94-.26-.1-.45-.15-.64.14-.19.29-.74.94-.9 1.13-.16.19-.33.22-.62.08-.29-.15-1.23-.45-2.35-1.45-.87-.77-1.45-1.72-1.62-2.01-.16-.29-.02-.45.12-.59.13-.13.29-.33.43-.49.14-.16.18-.28.27-.47.09-.19.04-.36-.02-.51-.07-.15-.64-1.54-.88-2.1-.23-.55-.47-.48-.64-.49-.16-.01-.36-.01-.55-.01-.19 0-.5.07-.76.36-.26.29-1 1.01-1 2.47 0 1.45 1.04 2.85 1.19 3.05.15.19 2.05 3.12 5.2 4.38.73.31 1.3.49 1.74.63.73.23 1.4.2 1.92.12.59-.09 1.71-.7 1.95-1.37.24-.67.24-1.25.17-1.37-.07-.11-.26-.18-.55-.32z",
|
|
1254
|
+
fill: palette.fill
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1258
|
+
"path",
|
|
1259
|
+
{
|
|
1260
|
+
d: "M12 3.2C7.13 3.2 3.2 7.13 3.2 12c0 1.56.41 3.02 1.13 4.29L3.2 20.8l4.59-1.09A8.77 8.77 0 0 0 12 20.8c4.87 0 8.8-3.93 8.8-8.8s-3.93-8.8-8.8-8.8z",
|
|
1261
|
+
stroke: palette.stroke,
|
|
1262
|
+
strokeWidth: "1.2",
|
|
1263
|
+
fill: "none",
|
|
1264
|
+
opacity: "0.18"
|
|
1265
|
+
}
|
|
1266
|
+
)
|
|
1267
|
+
] }) });
|
|
1268
|
+
}
|
|
1269
|
+
function XEmailIcon(props) {
|
|
1270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.6, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("rect", { x: "4.5", y: "7", width: "15", height: "10", rx: "1.4", stroke: palette.stroke, strokeWidth: "1.6", fill: "none" }),
|
|
1272
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M4.6 7.1l7.4 5.5 7.4-5.5", stroke: palette.stroke, strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" })
|
|
1273
|
+
] }) });
|
|
1274
|
+
}
|
|
1275
|
+
function XLinkedInIcon(props) {
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.6, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M8.1 9.1l2.6 2.6 4.1-4.1", stroke: palette.stroke, strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }),
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M6.8 10.2c1.6-1.6 4.3-1.6 5.9 0", stroke: palette.stroke, strokeWidth: "1.6", strokeLinecap: "round", fill: "none" }),
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("rect", { x: "5", y: "5", width: "14", height: "14", rx: "3", ry: "3", stroke: palette.stroke, strokeWidth: "1.4", fill: "none", opacity: "0.12" })
|
|
1280
|
+
] }) });
|
|
1281
|
+
}
|
|
1282
|
+
function XTwitterIcon(props) {
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.6, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M7 4l7 8.7L7 21h2.2l7-8.7L21 4h-2.2l-7 8.7L7 4z", fill: palette.fill }),
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M8 4h2.2l6.2 7.7", stroke: palette.stroke, strokeWidth: "1.2", strokeLinecap: "round", fill: "none", opacity: "0.2" })
|
|
1286
|
+
] }) });
|
|
1287
|
+
}
|
|
1288
|
+
function XGitHubIcon(props) {
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XSocialIconShell, { ...props, strokeWidth: props.strokeWidth ?? 1.35, children: ({ palette }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1290
|
+
"path",
|
|
1291
|
+
{
|
|
1292
|
+
d: "M12 2c5.52 0 10 4.48 10 10 0 4.42-2.87 8.17-6.84 9.49.5.09.68-.22.68-.48 0-.24-.01-.87-.01-1.7 2.78.6 3.37-1.34 3.37-1.34.45-1.16 1.11-1.46 1.11-1.46.91-.62-.07-.61-.07-.61-1 .07-1.53 1.03-1.53 1.03-.89 1.53-2.34 1.54-2.91 1.19-.09-.92-.35-1.54-.63-1.9 2.22-.25 4.55-1.11 4.55-4.94 0-1.09-.39-1.98-1.03-2.68.1-.25.45-1.27-.1-2.65 0 0-.84-.27-2.75 1.03A9.58 9.58 0 0 0 12 6.84c-.85 0-1.7.12-2.51.34-1.91-1.3-2.75-1.03-2.75-1.03-.54 1.38-.2 2.4-.1 2.65-.63.7-1.03 1.59-1.03 2.68 0 3.84 2.33 4.69 4.54 4.94-.29.36-.55.97-.64 1.9-.57.35-2.02.34-2.91-1.19 0 0-.52-.96-1.53-1.03 0 0-.98-.01-.07.61 0 0 .66.3 1.11 1.46 0 0 .59 1.94 3.37 1.34 0 .83-.01 1.46-.01 1.7 0 .26.18.57.68.48C5.87 20.17 3 16.42 3 12 3 6.48 7.48 2 12 2z",
|
|
1293
|
+
fill: palette.fill
|
|
1294
|
+
}
|
|
1295
|
+
) }) });
|
|
1296
|
+
}
|
|
1297
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1298
|
+
0 && (module.exports = {
|
|
1299
|
+
XContactForm,
|
|
1300
|
+
XEmailIcon,
|
|
1301
|
+
XFooter,
|
|
1302
|
+
XGitHubIcon,
|
|
1303
|
+
XInstagramIcon,
|
|
1304
|
+
XInteractivePhrase,
|
|
1305
|
+
XLinkedInIcon,
|
|
1306
|
+
XMicroGalleryText,
|
|
1307
|
+
XNavbar,
|
|
1308
|
+
XNewsletter,
|
|
1309
|
+
XSeparator,
|
|
1310
|
+
XSocialContact,
|
|
1311
|
+
XStaticGallery,
|
|
1312
|
+
XTelegramIcon,
|
|
1313
|
+
XTwitterIcon,
|
|
1314
|
+
XWhatsappIcon,
|
|
1315
|
+
XZigZagLayout
|
|
1316
|
+
});
|
|
1317
|
+
//# sourceMappingURL=index.js.map
|