@votodigital-onpeui/react 0.1.44 → 0.1.45

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.
@@ -104,7 +104,6 @@ var ModalConfirm = ({
104
104
  const titleId = "modal-confirm-title";
105
105
  const messageId = "modal-confirm-message";
106
106
  const effectiveTitle = title ?? defaultTitleByType[type] ?? "";
107
- const effectiveMessage = message ?? content;
108
107
  const effectiveColorClass = color ? colorOverrideMap[color] ?? "text-onpe-skyblue" : "text-onpe-skyblue";
109
108
  const effectiveButtonMode = buttonMode ?? (type === "question" ? "confirm" : "single");
110
109
  const isConfirmMode = effectiveButtonMode === "confirm";
@@ -152,21 +151,29 @@ var ModalConfirm = ({
152
151
  children: effectiveTitle
153
152
  }
154
153
  ),
155
- effectiveMessage && (typeof effectiveMessage === "string" ? /* @__PURE__ */ jsx(
154
+ message && (typeof message === "string" ? /* @__PURE__ */ jsx(
156
155
  "div",
157
156
  {
158
157
  id: messageId,
159
158
  className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
160
- dangerouslySetInnerHTML: { __html: effectiveMessage }
159
+ dangerouslySetInnerHTML: { __html: message }
161
160
  }
162
161
  ) : /* @__PURE__ */ jsx(
163
162
  "div",
164
163
  {
165
164
  id: messageId,
166
165
  className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
167
- children: effectiveMessage
166
+ children: message
168
167
  }
169
168
  )),
169
+ content && /* @__PURE__ */ jsx(
170
+ "div",
171
+ {
172
+ id: message ? void 0 : messageId,
173
+ className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
174
+ children: content
175
+ }
176
+ ),
170
177
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center w-full gap-5 mt-11 md:hidden", children: [
171
178
  /* @__PURE__ */ jsx(
172
179
  Button,
@@ -275,5 +282,5 @@ var ModalLoading = ({
275
282
  };
276
283
 
277
284
  export { Button, ModalConfirm, ModalLoading };
278
- //# sourceMappingURL=chunk-7CXCLAZB.mjs.map
279
- //# sourceMappingURL=chunk-7CXCLAZB.mjs.map
285
+ //# sourceMappingURL=chunk-OP5VLP34.mjs.map
286
+ //# sourceMappingURL=chunk-OP5VLP34.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,EACP,cAAA,EAAgB,sBAAA;AAAA,EAChB,OAAA,EAAS;AACX,CAAA;AAEA,IAAM,WAAA,GAA0C;AAAA,EAC9C,KAAA,EAAO,cAAA;AAAA,EACP,MAAA,EAAQ,gBAAA;AAAA,EACR,KAAA,EAAO;AACT,CAAA;AAEO,SAAS,MAAA,CAAO;AAAA,EACrB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA,GAAO,QAAA;AAAA,EACP,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,EAAgB;AACd,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW;AAAA,QACT,yCAAA;AAAA,QACA,2BAAA;AAAA,QACA,yCAAA;AAAA,QACA,yCAAA;AAAA,QACA,gDAAA;A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AC,CAAA;AAEpB,EAAA,uBACEC,IAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,IAAA;AAAA,MACZ,WAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,aAAA,EAAa,IAAA;AAAA,MACb,iBAAA,EAAmB,IAAA;AAAA,MACnB,QAAA;AAAA,MACA,iBAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAAD,GAAAA,CAAC,SAAI,SAAA,EAAU,SAAA,EAAU,aAAU,WAAA,EAAY,aAAA,EAAY,QACxD,QAAA,EAAA,eAAA,EACH,CAAA;AAAA,QACC,OAAA,oBACCC,IAAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAAD,GAAAA;AAAA,YAAC,kBAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,yCAAA;AAAA,cACV,aAAA,EAAY;AAAA;AAAA,WACd;AAAA,0BACAA,GAAAA;AAAA,YAAC,iBAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,yCAAA;AAAA,cACV,aAAA,EAAY;AAAA;AAAA;AACd,SAAA,EACF,CAAA;AAAA,wBAEFA,GAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,gFACV,QAAA,EAAA,OAAA,EACH;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-OP5VLP34.mjs","sourcesContent":["type ButtonColor =\n | \"blue\"\n | \"skyblue\"\n | \"skyblue-light\"\n | \"yellow\"\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\nconst defaultTitleByType: Record<string, string> = {\r\n success: \"Confirmación\",\r\n warning: \"Advertencia\",\r\n question: \"Atención\",\r\n info: \"Información\",\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 /**\r\n * \"single\" → un botón \"Confirmar\".\r\n * \"double\" → \"Cancelar\" + \"Confirmar\".\r\n * \"confirm\" → \"No\" + \"Sí\" (diálogo de confirmación Sí/No).\r\n */\r\n buttonMode?: \"single\" | \"double\" | \"confirm\";\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 /** Muestra el botón X para cerrar el modal */\r\n closeButton?: boolean;\r\n /** Alinea el texto del mensaje a la izquierda (justify) en vez de centrado */\r\n alignJustify?: boolean;\r\n /** Alinea el modal al tope de la pantalla en vez de al centro */\r\n alignTop?: boolean;\r\n /** Habilita animación de entrada/salida (default: true) */\r\n animated?: boolean;\r\n /** Bloquea el scroll del body mientras el modal está abierto (default: true) */\r\n preventBodyScroll?: 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,\r\n textButtonCancel,\r\n className = \"\",\r\n zIndexLevel = 100,\r\n disableFocus = false,\r\n closeButton = false,\r\n alignJustify = false,\r\n alignTop = false,\r\n animated = true,\r\n preventBodyScroll = true,\r\n}: ModalConfirmProps) => {\r\n const titleId = \"modal-confirm-title\";\r\n const messageId = \"modal-confirm-message\";\r\n\r\n const effectiveTitle = title ?? defaultTitleByType[type] ?? \"\";\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 effectiveButtonMode = buttonMode ?? (type === \"question\" ? \"confirm\" : \"single\");\r\n const isConfirmMode = effectiveButtonMode === \"confirm\";\r\n const showTwoButtons = effectiveButtonMode === \"double\" || isConfirmMode;\r\n const confirmLabel = textButtonConfirm ?? (isConfirmMode ? \"Sí\" : effectiveButtonMode === \"double\" ? \"Confirmar\" : \"Aceptar\");\r\n const cancelLabel = textButtonCancel ?? (isConfirmMode ? \"No\" : \"Cancelar\");\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={`bg-white pt-[30px] pb-[30px] px-[30px] max-w-[719px]! ${className}`}\r\n closeButton={closeButton}\r\n closeDisabled={closeDisabled}\r\n zIndexLevel={zIndexLevel}\r\n aria-labelledby={titleId}\r\n aria-describedby={messageId}\r\n disableFocus={disableFocus}\r\n alignTop={alignTop}\r\n animated={animated}\r\n preventBodyScroll={preventBodyScroll}\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 {effectiveTitle}\r\n </p>\r\n\r\n {/* Mensaje / Contenido */}\r\n {message && (\r\n typeof message === \"string\" ? (\r\n <div\r\n id={messageId}\r\n className={`mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? \"text-justify\" : \"text-center\"}`}\r\n dangerouslySetInnerHTML={{ __html: message }}\r\n />\r\n ) : (\r\n <div\r\n id={messageId}\r\n className={`mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? \"text-justify\" : \"text-center\"}`}\r\n >\r\n {message}\r\n </div>\r\n )\r\n )}\r\n {content && (\r\n <div\r\n id={message ? undefined : messageId}\r\n className={`mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? \"text-justify\" : \"text-center\"}`}\r\n >\r\n {content}\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={confirmLabel}\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={cancelLabel}\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={cancelLabel}\r\n onClick={handleCancel}\r\n />\r\n )}\r\n <Button\r\n className=\"w-[200px]\"\r\n color=\"red\"\r\n title={confirmLabel}\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 { type ReactNode, 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 animated?: boolean;\r\n preventBodyScroll?: boolean;\r\n /** Spinner personalizado. Si no se provee, se usa el spinner por defecto de la librería. */\r\n spinner?: ReactNode;\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 animated = true,\r\n preventBodyScroll = true,\r\n spinner,\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 animated={animated}\r\n preventBodyScroll={preventBodyScroll}\r\n >\r\n <div className=\"sr-only\" aria-live=\"assertive\" aria-atomic=\"true\">\r\n {announceMessage}\r\n </div>\r\n {spinner ?? (\r\n <>\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 </>\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"]}
@@ -1213,7 +1213,6 @@ var ModalConfirm = ({
1213
1213
  const titleId = "modal-confirm-title";
1214
1214
  const messageId = "modal-confirm-message";
1215
1215
  const effectiveTitle = title ?? defaultTitleByType[type] ?? "";
1216
- const effectiveMessage = message ?? content;
1217
1216
  const effectiveColorClass = color ? colorOverrideMap[color] ?? "text-onpe-skyblue" : "text-onpe-skyblue";
1218
1217
  const effectiveButtonMode = buttonMode ?? (type === "question" ? "confirm" : "single");
1219
1218
  const isConfirmMode = effectiveButtonMode === "confirm";
@@ -1261,21 +1260,29 @@ var ModalConfirm = ({
1261
1260
  children: effectiveTitle
1262
1261
  }
1263
1262
  ),
1264
- effectiveMessage && (typeof effectiveMessage === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1263
+ message && (typeof message === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1265
1264
  "div",
1266
1265
  {
1267
1266
  id: messageId,
1268
1267
  className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
1269
- dangerouslySetInnerHTML: { __html: effectiveMessage }
1268
+ dangerouslySetInnerHTML: { __html: message }
1270
1269
  }
1271
1270
  ) : /* @__PURE__ */ jsxRuntime.jsx(
1272
1271
  "div",
1273
1272
  {
1274
1273
  id: messageId,
1275
1274
  className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
1276
- children: effectiveMessage
1275
+ children: message
1277
1276
  }
1278
1277
  )),
1278
+ content && /* @__PURE__ */ jsxRuntime.jsx(
1279
+ "div",
1280
+ {
1281
+ id: message ? void 0 : messageId,
1282
+ className: `mt-7 text-sm md:text-lg max-w-full text-black ${alignJustify ? "text-justify" : "text-center"}`,
1283
+ children: content
1284
+ }
1285
+ ),
1279
1286
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-full gap-5 mt-11 md:hidden", children: [
1280
1287
  /* @__PURE__ */ jsxRuntime.jsx(
1281
1288
  Button,