@votodigital-onpeui/react 0.1.26 → 0.1.27
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/{ModalConfirm-C4BK0cGl.d.mts → ModalConfirm-DsE7awHb.d.mts} +1 -1
- package/dist/{ModalConfirm-C4BK0cGl.d.ts → ModalConfirm-DsE7awHb.d.ts} +1 -1
- package/dist/{chunk-426NZGHO.mjs → chunk-6LCT7D6I.mjs} +9 -6
- package/dist/chunk-6LCT7D6I.mjs.map +1 -0
- package/dist/{chunk-CPJUTDYS.mjs → chunk-M2KQXQLY.mjs} +21 -3
- package/dist/chunk-M2KQXQLY.mjs.map +1 -0
- package/dist/{chunk-GQ2JGOWC.mjs → chunk-SS5NPQU6.mjs} +3 -3
- package/dist/{chunk-GQ2JGOWC.mjs.map → chunk-SS5NPQU6.mjs.map} +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +24 -3
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +3 -3
- package/dist/icons.d.mts +3 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.js +19 -0
- package/dist/icons.js.map +1 -1
- package/dist/icons.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/modal.d.mts +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/modal.js +24 -3
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-426NZGHO.mjs.map +0 -1
- package/dist/chunk-CPJUTDYS.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type ModalType = "
|
|
4
|
+
type ModalType = "warning" | "success" | "question" | "info" | "none";
|
|
5
5
|
interface ModalConfirmProps {
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
onClose: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type ModalType = "
|
|
4
|
+
type ModalType = "warning" | "success" | "question" | "info" | "none";
|
|
5
5
|
interface ModalConfirmProps {
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
onClose: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconSpinnerDesktop, IconSpinnerMobile, IconCheck, IconInfo, IconWarningNotRecommended } from './chunk-
|
|
1
|
+
import { IconSpinnerDesktop, IconSpinnerMobile, IconCheck, IconQuestion, IconInfo, IconWarningNotRecommended } from './chunk-M2KQXQLY.mjs';
|
|
2
2
|
import { Modal } from './chunk-EZQGWVW2.mjs';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
@@ -55,10 +55,14 @@ var colorOverrideMap = {
|
|
|
55
55
|
yellow: "text-onpe-yellow"
|
|
56
56
|
};
|
|
57
57
|
function renderIcon(type, colorClass) {
|
|
58
|
+
if (type === "none") return null;
|
|
58
59
|
if (type === "success") {
|
|
59
60
|
return /* @__PURE__ */ jsx(IconCheck, { role: "presentation", className: `w-16 h-16 ${colorClass}` });
|
|
60
61
|
}
|
|
61
62
|
if (type === "question") {
|
|
63
|
+
return /* @__PURE__ */ jsx(IconQuestion, { role: "presentation", className: `w-16 h-16 ${colorClass}` });
|
|
64
|
+
}
|
|
65
|
+
if (type === "info") {
|
|
62
66
|
return /* @__PURE__ */ jsx(IconInfo, { role: "presentation", className: `w-16 h-16 ${colorClass}` });
|
|
63
67
|
}
|
|
64
68
|
return /* @__PURE__ */ jsx(IconWarningNotRecommended, { role: "presentation", className: `w-16 h-16 ${colorClass}` });
|
|
@@ -71,7 +75,7 @@ var ModalConfirm = ({
|
|
|
71
75
|
title,
|
|
72
76
|
message,
|
|
73
77
|
content,
|
|
74
|
-
type = "
|
|
78
|
+
type = "warning",
|
|
75
79
|
buttonMode,
|
|
76
80
|
disabledConfirmButton = false,
|
|
77
81
|
closeDisabled = false,
|
|
@@ -123,8 +127,7 @@ var ModalConfirm = ({
|
|
|
123
127
|
{
|
|
124
128
|
id: titleId,
|
|
125
129
|
className: [
|
|
126
|
-
|
|
127
|
-
"text-lg md:text-2xl font-semibold text-center",
|
|
130
|
+
"text-lg md:text-2xl font-semibold text-center mt-0 md:mt-4",
|
|
128
131
|
effectiveColorClass
|
|
129
132
|
].join(" "),
|
|
130
133
|
children: title
|
|
@@ -239,5 +242,5 @@ var ModalLoading = ({
|
|
|
239
242
|
};
|
|
240
243
|
|
|
241
244
|
export { Button, ModalConfirm, ModalLoading };
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
245
|
+
//# sourceMappingURL=chunk-6LCT7D6I.mjs.map
|
|
246
|
+
//# sourceMappingURL=chunk-6LCT7D6I.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.tsx","../src/components/Feedback/ModalConfirm/ModalConfirm.tsx","../src/components/Feedback/ModalLoading/ModalLoading.tsx"],"names":["jsx","jsxs"],"mappings":";;;;;AAwBA,IAAM,YAAA,GAA4C;AAAA,EAChD,IAAA,EAAM,cAAA;AAAA,EACN,OAAA,EAAS,iBAAA;AAAA,EACT,eAAA,EAAiB,uBAAA;AAAA,EACjB,MAAA,EAAQ,gBAAA;AAAA,EACR,eAAA,EAAiB,uBAAA;AAAA,EACjB,IAAA,EAAM,cAAA;AAAA,EACN,YAAA,EAAc,oBAAA;AAAA,EACd,kBAAA,EAAoB,0BAAA;AAAA,EACpB,GAAA,EAAK,aAAA;AAAA,EACL,WAAA,EAAa,mBAAA;AAAA,EACb,KAAA,EAAO,eAAA;AAAA,EAC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\n | \"light-skyblue\"\n | \"gray\"\n | \"gray-light\"\n | \"gray-extra-light\"\n | \"red\"\n | \"dark-gray\"\n | \"green\"\n | \"yellow-light\"\n | \"primary\";\n\ntype ButtonSize = \"small\" | \"normal\" | \"large\";\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n color: ButtonColor;\n title: string;\n size?: ButtonSize;\n}\n\nconst colorClasses: Record<ButtonColor, string> = {\n blue: \"bg-onpe-blue\",\n skyblue: \"bg-onpe-skyblue\",\n \"skyblue-light\": \"bg-onpe-skyblue-light\",\n yellow: \"bg-onpe-yellow\",\n \"light-skyblue\": \"bg-onpe-light-skyblue\",\n gray: \"bg-onpe-gray\",\n \"gray-light\": \"bg-onpe-gray-light\",\n \"gray-extra-light\": \"bg-onpe-gray-extra-light\",\n red: \"bg-onpe-red\",\n \"dark-gray\": \"bg-onpe-dark-gray\",\n green: \"bg-onpe-green\",\n \"yellow-light\": \"bg-onpe-yellow-light\",\n primary: \"bg-onpe-blue\",\n};\n\nconst sizeClasses: Record<ButtonSize, string> = {\n small: \"h-10 text-sm\",\n normal: \"h-12 text-base\",\n large: \"h-14 text-lg\",\n};\n\nexport function Button({\n color,\n title,\n size = \"normal\",\n className = \"\",\n ...props\n}: ButtonProps) {\n return (\n <button\n className={[\n \"inline-flex items-center justify-center\",\n \"min-w-[200px] border-none\",\n \"text-white font-semibold cursor-pointer\",\n \"transition-all duration-300 ease-in-out\",\n \"disabled:cursor-default disabled:!bg-onpe-gray\",\n colorClasses[color],\n sizeClasses[size],\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n {...props}\n >\n {title}\n </button>\n );\n}\n\nexport default Button;\n","import { type ReactNode } from \"react\";\r\nimport { Modal } from \"../../Modal/Modal\";\r\nimport { Button } from \"../../Button/Button\";\r\nimport { IconCheck } from \"../../../icons/Actions/IconCheck\";\r\nimport { IconWarningNotRecommended } from \"../../../icons\";\r\nimport { IconQuestion } from \"../../../icons/Actions/IconQuestion\";\r\nimport { IconInfo } from \"../../../icons/Actions/IconInfo\";\r\n\r\nexport type ModalType = \"warning\" | \"success\" | \"question\" | \"info\" | \"none\";\r\n\r\n/** Mapa de override de color a clase CSS (icono + título) */\r\nconst colorOverrideMap: Record<string, string> = {\r\n red: \"text-onpe-red\",\r\n blue: \"text-onpe-blue\",\r\n skyblue: \"text-onpe-skyblue\",\r\n yellow: \"text-onpe-yellow\",\r\n};\r\n\r\nfunction renderIcon(type: ModalType, colorClass: string): ReactNode {\r\n if (type === \"none\") return null;\r\n if (type === \"success\") {\r\n return <IconCheck role=\"presentation\" className={`w-16 h-16 ${colorClass}`} />;\r\n }\r\n if (type === \"question\") {\r\n return <IconQuestion role=\"presentation\" className={`w-16 h-16 ${colorClass}`} />;\r\n }\r\n if (type === \"info\") {\r\n return <IconInfo role=\"presentation\" className={`w-16 h-16 ${colorClass}`} />;\r\n }\r\n // error | warning\r\n return <IconWarningNotRecommended role=\"presentation\" className={`w-16 h-16 ${colorClass}`} />;\r\n}\r\n\r\nexport interface ModalConfirmProps {\r\n isOpen: boolean;\r\n onClose: () => void;\r\n title: string;\r\n /** Contenido del modal (string o JSX) */\r\n message?: ReactNode;\r\n /** Alias de message */\r\n content?: ReactNode;\r\n /** Tipo semántico: determina icono, color de título y color de botón confirmar */\r\n type?: ModalType;\r\n /** \"double\" muestra el botón cancelar */\r\n buttonMode?: \"single\" | \"double\";\r\n /** Deshabilita el botón confirmar */\r\n disabledConfirmButton?: boolean;\r\n /** Deshabilita el cierre del modal */\r\n closeDisabled?: boolean;\r\n /**\r\n * Override del color del icono y título.\r\n * Si no se provee, se deriva automáticamente del `type`.\r\n */\r\n color?: \"red\" | \"blue\" | \"skyblue\" | \"yellow\";\r\n onConfirm?: () => void | Promise<void>;\r\n onCancel?: () => void | Promise<void>;\r\n textButtonConfirm?: string;\r\n textButtonCancel?: string;\r\n className?: string;\r\n zIndexLevel?: number;\r\n withoutAutoClose?: boolean;\r\n disableFocus?: boolean;\r\n}\r\n\r\nexport const ModalConfirm = ({\r\n isOpen = false,\r\n onClose = () => {},\r\n withoutAutoClose = false,\r\n title,\r\n message,\r\n content,\r\n type = \"warning\",\r\n buttonMode,\r\n disabledConfirmButton = false,\r\n closeDisabled = false,\r\n color,\r\n onConfirm = () => {},\r\n onCancel = () => {},\r\n textButtonConfirm = \"Confirmar\",\r\n textButtonCancel = \"Cancelar\",\r\n className = \"\",\r\n zIndexLevel = 100,\r\n disableFocus = false,\r\n}: ModalConfirmProps) => {\r\n const titleId = \"modal-confirm-title\";\r\n const messageId = \"modal-confirm-message\";\r\n\r\n const effectiveMessage = message ?? content;\r\n // Título e ícono siempre skyblue por defecto; `color` es el único override\r\n const effectiveColorClass = color\r\n ? (colorOverrideMap[color] ?? \"text-onpe-skyblue\")\r\n : \"text-onpe-skyblue\";\r\n const showTwoButtons = buttonMode === \"double\";\r\n\r\n const handleConfirm = async () => {\r\n try {\r\n await onConfirm();\r\n if (!withoutAutoClose) onClose();\r\n } catch (error) {\r\n console.error(\"Error en handleConfirm:\", error);\r\n if (!withoutAutoClose) onClose();\r\n }\r\n };\r\n\r\n const handleCancel = () => {\r\n onCancel();\r\n if (!withoutAutoClose) onClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n isOpen={isOpen}\r\n onClose={onClose}\r\n className={`max-w-[719px]! pt-[30px]! pb-[30px]! px-[30px]! ${className}`}\r\n closeButton={false}\r\n closeDisabled={closeDisabled}\r\n zIndexLevel={zIndexLevel}\r\n aria-labelledby={titleId}\r\n aria-describedby={messageId}\r\n disableFocus={disableFocus}\r\n >\r\n {/* Icono */}\r\n <div className=\"flex items-center justify-center\">\r\n {renderIcon(type, effectiveColorClass)}\r\n </div>\r\n\r\n {/* Título */}\r\n <p\r\n id={titleId}\r\n className={[\r\n \"text-lg md:text-2xl font-semibold text-center mt-0 md:mt-4\",\r\n effectiveColorClass,\r\n ].join(\" \")}\r\n >\r\n {title}\r\n </p>\r\n\r\n {/* Mensaje / Contenido */}\r\n {effectiveMessage && (\r\n <div\r\n id={messageId}\r\n className=\"mt-7 text-sm md:text-lg text-center max-w-full text-onpe-dark-gray\"\r\n >\r\n {effectiveMessage}\r\n </div>\r\n )}\r\n\r\n {/* Mobile: apilado */}\r\n <div className=\"flex flex-col items-center justify-center w-full gap-5 mt-11 md:hidden\">\r\n <Button\r\n className=\"w-full max-w-[200px]\"\r\n color=\"red\"\r\n title={textButtonConfirm}\r\n onClick={handleConfirm}\r\n disabled={disabledConfirmButton}\r\n />\r\n {showTwoButtons && (\r\n <Button\r\n className=\"w-full max-w-[200px]\"\r\n color=\"skyblue\"\r\n title={textButtonCancel}\r\n onClick={handleCancel}\r\n />\r\n )}\r\n </div>\r\n\r\n {/* Desktop: fila */}\r\n <div className=\"hidden md:flex md:flex-row items-center justify-center w-full gap-5 mt-11\">\r\n {showTwoButtons && (\r\n <Button\r\n className=\"w-[200px]\"\r\n color=\"skyblue\"\r\n title={textButtonCancel}\r\n onClick={handleCancel}\r\n />\r\n )}\r\n <Button\r\n className=\"w-[200px]\"\r\n color=\"red\"\r\n title={textButtonConfirm}\r\n onClick={handleConfirm}\r\n disabled={disabledConfirmButton}\r\n />\r\n </div>\r\n </Modal>\r\n );\r\n};\r\n\r\nexport default ModalConfirm;\r\n","import { useEffect, useState } from \"react\";\r\nimport { Modal } from \"../../Modal/Modal\";\r\nimport { IconSpinnerDesktop } from \"../../../icons/Actions/IconSpinnerDesktop\";\r\nimport { IconSpinnerMobile } from \"../../../icons/Actions/IconSpinnerMobile\";\r\n\r\nexport interface ModalLoadingProps {\r\n isOpen: boolean;\r\n onClose?: () => void;\r\n message?: string;\r\n className?: string;\r\n zIndexLevel?: number;\r\n}\r\n\r\nexport const ModalLoading = ({\r\n isOpen = false,\r\n onClose = () => {},\r\n message = \"Cargando...\",\r\n className = \"\",\r\n zIndexLevel = 100,\r\n}: ModalLoadingProps) => {\r\n const [announceMessage, setAnnounceMessage] = useState(\"\");\r\n\r\n useEffect(() => {\r\n if (!isOpen) {\r\n setAnnounceMessage(\"\");\r\n return;\r\n }\r\n setAnnounceMessage(\"\");\r\n const t = globalThis.setTimeout(() => {\r\n setAnnounceMessage(message);\r\n }, 150);\r\n return () => {\r\n globalThis.clearTimeout(t);\r\n };\r\n }, [isOpen, message]);\r\n\r\n return (\r\n <Modal\r\n disableFocus\r\n zIndexLevel={zIndexLevel}\r\n isOpen={isOpen}\r\n onClose={onClose}\r\n className={className}\r\n closeDisabled\r\n whitoutBackground={true}\r\n >\r\n <div className=\"sr-only\" aria-live=\"assertive\" aria-atomic=\"true\">\r\n {announceMessage}\r\n </div>\r\n <IconSpinnerDesktop\r\n className=\"hidden md:block text-white animate-spin\"\r\n aria-hidden=\"true\"\r\n />\r\n <IconSpinnerMobile\r\n className=\"block md:hidden text-white animate-spin\"\r\n aria-hidden=\"true\"\r\n />\r\n <p className=\"text-white leading-normal text-2xl md:text-[64px] text-center mt-10 md:mt-20\">\r\n {message}\r\n </p>\r\n </Modal>\r\n );\r\n};\r\n\r\nexport default ModalLoading;\r\n"]}
|
|
@@ -36,6 +36,24 @@ var IconPhone = ({ ...props }) => {
|
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
};
|
|
39
|
+
var IconQuestion = (props) => /* @__PURE__ */ jsx(
|
|
40
|
+
"svg",
|
|
41
|
+
{
|
|
42
|
+
width: "64",
|
|
43
|
+
height: "64",
|
|
44
|
+
viewBox: "0 0 64 64",
|
|
45
|
+
fill: "none",
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
...props,
|
|
48
|
+
children: /* @__PURE__ */ jsx(
|
|
49
|
+
"path",
|
|
50
|
+
{
|
|
51
|
+
d: "M31.9997 5.33325C46.7277 5.33325 58.6663 17.2719 58.6663 31.9999C58.6663 46.7279 46.7277 58.6666 31.9997 58.6666C17.2717 58.6666 5.33301 46.7279 5.33301 31.9999C5.33301 17.2719 17.2717 5.33325 31.9997 5.33325ZM31.9997 10.6666C26.3417 10.6666 20.9155 12.9142 16.9147 16.915C12.914 20.9157 10.6663 26.342 10.6663 31.9999C10.6663 37.6579 12.914 43.0841 16.9147 47.0849C20.9155 51.0856 26.3417 53.3332 31.9997 53.3332C37.6576 53.3332 43.0838 51.0856 47.0846 47.0849C51.0854 43.0841 53.333 37.6579 53.333 31.9999C53.333 26.342 51.0854 20.9157 47.0846 16.915C43.0838 12.9142 37.6576 10.6666 31.9997 10.6666ZM31.9997 42.6666C32.7069 42.6666 33.3852 42.9475 33.8853 43.4476C34.3854 43.9477 34.6663 44.626 34.6663 45.3332C34.6663 46.0405 34.3854 46.7188 33.8853 47.2189C33.3852 47.719 32.7069 47.9999 31.9997 47.9999C31.2924 47.9999 30.6142 47.719 30.1141 47.2189C29.614 46.7188 29.333 46.0405 29.333 45.3332C29.333 44.626 29.614 43.9477 30.1141 43.4476C30.6142 42.9475 31.2924 42.6666 31.9997 42.6666ZM31.9997 17.3333C34.2458 17.3333 36.4217 18.1155 38.1538 19.5455C39.8858 20.9755 41.0658 22.964 41.4912 25.1695C41.9165 27.3749 41.5605 29.6596 40.4844 31.6311C39.4084 33.6027 37.6793 35.1379 35.5943 35.9732C35.2855 36.0868 35.0072 36.2703 34.781 36.5093C34.6637 36.6426 34.645 36.8133 34.6477 36.9893L34.6663 37.3333C34.6656 38.0129 34.4053 38.6667 33.9387 39.1609C33.4722 39.6551 32.8345 39.9525 32.156 39.9924C31.4774 40.0322 31.8093 39.8115 30.2881 39.3752C29.7669 38.939 29.4319 38.3202 29.3517 37.6452L29.333 37.3333V36.6666C29.333 33.5919 31.813 31.7466 33.6103 31.0239C34.3418 30.7318 34.98 30.246 35.4562 29.6185C35.9324 28.9911 36.2287 28.2458 36.3133 27.4627C36.3979 26.6796 36.2675 25.8883 35.9363 25.1736C35.605 24.459 35.0854 23.8481 34.4331 23.4065C33.7808 22.965 33.0206 22.7094 32.2341 22.6673C31.4475 22.6252 30.6644 22.7982 29.9687 23.1676C29.2731 23.537 28.6912 24.0889 28.2855 24.7641C27.8799 25.4393 27.6658 26.2122 27.6663 26.9999C27.6663 27.7072 27.3854 28.3854 26.8853 28.8855C26.3852 29.3856 25.7069 29.6666 24.9997 29.6666C24.2924 29.6666 23.6142 29.3856 23.1141 28.8855C22.614 28.3854 22.333 27.7072 22.333 26.9999C22.333 24.4362 23.3515 21.9774 25.1643 20.1646C26.9772 18.3517 29.4359 17.3333 31.9997 17.3333Z",
|
|
52
|
+
fill: "currentColor"
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
39
57
|
var IconSpinnerDesktop = (props) => /* @__PURE__ */ jsx("svg", { width: 102, height: 102, viewBox: "0 0 102 102", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
|
|
40
58
|
"path",
|
|
41
59
|
{
|
|
@@ -1269,6 +1287,6 @@ var YoutubeIcon = (props) => /* @__PURE__ */ jsxs(
|
|
|
1269
1287
|
}
|
|
1270
1288
|
);
|
|
1271
1289
|
|
|
1272
|
-
export { FaceBookIcon, IconAndroid, IconApple, IconCheck, IconChrome, IconChromeColor, IconClose, IconEdge, IconEdgeColor, IconElectionsGeneral, IconElectionsRegionalesYMunicipales, IconHome, IconHuawei, IconInfo, IconLogoONPE, IconMozilla, IconMozillaColor, IconPhone, IconSafari, IconSafariColor, IconSpinnerDesktop, IconSpinnerMobile, IconVotoDigital, IconWarning, IconWarningNotRecommended, IconWindow, InstagramIcon, TikTokIcon, WhatsappIcon, XIcon, YoutubeIcon };
|
|
1273
|
-
//# sourceMappingURL=chunk-
|
|
1274
|
-
//# sourceMappingURL=chunk-
|
|
1290
|
+
export { FaceBookIcon, IconAndroid, IconApple, IconCheck, IconChrome, IconChromeColor, IconClose, IconEdge, IconEdgeColor, IconElectionsGeneral, IconElectionsRegionalesYMunicipales, IconHome, IconHuawei, IconInfo, IconLogoONPE, IconMozilla, IconMozillaColor, IconPhone, IconQuestion, IconSafari, IconSafariColor, IconSpinnerDesktop, IconSpinnerMobile, IconVotoDigital, IconWarning, IconWarningNotRecommended, IconWindow, InstagramIcon, TikTokIcon, WhatsappIcon, XIcon, YoutubeIcon };
|
|
1291
|
+
//# sourceMappingURL=chunk-M2KQXQLY.mjs.map
|
|
1292
|
+
//# sourceMappingURL=chunk-M2KQXQLY.mjs.map
|