@zauru-sdk/components 1.0.11 → 1.0.12
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/CHANGELOG.md +8 -0
- package/dist/Alerts/index.d.ts +3 -0
- package/dist/Alerts/index.js +3 -0
- package/dist/BlockUI/BlockUI.d.ts +8 -0
- package/dist/BlockUI/BlockUI.js +8 -0
- package/dist/BlockUI/index.d.ts +1 -0
- package/dist/BlockUI/index.js +1 -0
- package/dist/Buttons/Button.d.ts +15 -0
- package/dist/Buttons/Button.js +43 -0
- package/dist/Buttons/index.d.ts +1 -0
- package/dist/Buttons/index.js +1 -0
- package/dist/Card/Card.d.ts +8 -0
- package/dist/Card/Card.js +5 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Card/index.js +1 -0
- package/dist/Chat/ChatLayout.d.ts +17 -0
- package/dist/Chat/ChatLayout.js +27 -0
- package/dist/Chat/ChatMessageHistory.d.ts +12 -0
- package/dist/Chat/ChatMessageHistory.js +53 -0
- package/dist/Chat/index.d.ts +2 -0
- package/dist/Chat/index.js +2 -0
- package/dist/Containers/BodyContainer.d.ts +6 -0
- package/dist/Containers/BodyContainer.js +5 -0
- package/dist/Containers/ButtonSectionContainer.d.ts +8 -0
- package/dist/Containers/ButtonSectionContainer.js +5 -0
- package/dist/Containers/Container.d.ts +10 -0
- package/dist/Containers/Container.js +6 -0
- package/dist/Containers/DoubleContainer.d.ts +9 -0
- package/dist/Containers/DoubleContainer.js +14 -0
- package/dist/Containers/MainContainer.d.ts +6 -0
- package/dist/Containers/MainContainer.js +5 -0
- package/dist/Containers/OutletContainer.d.ts +6 -0
- package/dist/Containers/OutletContainer.js +5 -0
- package/dist/Containers/SubContainer.d.ts +10 -0
- package/dist/Containers/SubContainer.js +6 -0
- package/dist/Containers/index.d.ts +7 -0
- package/dist/Containers/index.js +7 -0
- package/dist/Footer/Footer.d.ts +7 -0
- package/dist/Footer/Footer.js +25 -0
- package/dist/Footer/index.d.ts +1 -0
- package/dist/Footer/index.js +1 -0
- package/dist/Labels/InfoLabel/index.d.ts +7 -0
- package/dist/Labels/InfoLabel/index.js +5 -0
- package/dist/Labels/index.d.ts +1 -0
- package/dist/Labels/index.js +1 -0
- package/dist/Layouts/homeLayout/index.d.ts +6 -0
- package/dist/Layouts/homeLayout/index.js +10 -0
- package/dist/Layouts/index.d.ts +1 -0
- package/dist/Layouts/index.js +1 -0
- package/dist/LineSeparator/LineSeparator.d.ts +1 -0
- package/dist/LineSeparator/LineSeparator.js +4 -0
- package/dist/LineSeparator/index.d.ts +1 -0
- package/dist/LineSeparator/index.js +1 -0
- package/dist/Modal/Modal.d.ts +10 -0
- package/dist/Modal/Modal.js +32 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Modal/index.js +1 -0
- package/dist/NavBar/index.d.ts +3 -0
- package/dist/NavBar/index.js +3 -0
- package/dist/ProgressBar/ProgressBar.d.ts +6 -0
- package/dist/ProgressBar/ProgressBar.js +5 -0
- package/dist/ProgressBar/ProgressCircle.d.ts +6 -0
- package/dist/ProgressBar/ProgressCircle.js +22 -0
- package/dist/ProgressBar/index.d.ts +2 -0
- package/dist/ProgressBar/index.js +2 -0
- package/dist/Skeletons/LoadingInputSkeleton.d.ts +1 -0
- package/dist/Skeletons/LoadingInputSkeleton.js +8 -0
- package/dist/Skeletons/index.d.ts +1 -0
- package/dist/Skeletons/index.js +1 -0
- package/dist/Tab/Tab.d.ts +9 -0
- package/dist/Tab/Tab.js +19 -0
- package/dist/Tab/index.d.ts +1 -0
- package/dist/Tab/index.js +1 -0
- package/dist/Table/ZauruTable.d.ts +25 -0
- package/dist/Table/ZauruTable.js +148 -0
- package/dist/Table/index.d.ts +1 -0
- package/dist/Table/index.js +1 -0
- package/dist/TaskList/TaskList.d.ts +14 -0
- package/dist/TaskList/TaskList.js +35 -0
- package/dist/TaskList/index.d.ts +1 -0
- package/dist/TaskList/index.js +1 -0
- package/dist/Titles/LabelArray.d.ts +4 -0
- package/dist/Titles/LabelArray.js +7 -0
- package/dist/Titles/TableColumnTitle.d.ts +4 -0
- package/dist/Titles/TableColumnTitle.js +5 -0
- package/dist/Titles/TitleH1.d.ts +1 -0
- package/dist/Titles/TitleH1.js +5 -0
- package/dist/Titles/TitleH2.d.ts +1 -0
- package/dist/Titles/TitleH2.js +5 -0
- package/dist/Titles/TitleH3.d.ts +1 -0
- package/dist/Titles/TitleH3.js +5 -0
- package/dist/Titles/index.d.ts +5 -0
- package/dist/Titles/index.js +5 -0
- package/dist/Tooltip/Tooltip.d.ts +7 -0
- package/dist/Tooltip/Tooltip.js +14 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Tooltip/index.js +1 -0
- package/dist/WithTooltip/WithTooltip.d.ts +7 -0
- package/dist/WithTooltip/WithTooltip.js +5 -0
- package/dist/WithTooltip/index.d.ts +1 -0
- package/dist/WithTooltip/index.js +1 -0
- package/dist/Wizards/StepWizard.d.ts +14 -0
- package/dist/Wizards/StepWizard.js +14 -0
- package/dist/Wizards/index.d.ts +1 -0
- package/dist/Wizards/index.js +1 -0
- package/dist/Zendesk/Chat.d.ts +14 -0
- package/dist/Zendesk/Chat.js +63 -0
- package/dist/Zendesk/index.d.ts +2 -0
- package/dist/Zendesk/index.js +2 -0
- package/dist/Zendesk/zendesk.config.d.ts +9 -0
- package/dist/Zendesk/zendesk.config.js +24 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +21 -1
- package/package.json +4 -2
- package/src/Alerts/index.ts +3 -0
- package/src/BlockUI/BlockUI.tsx +50 -0
- package/src/BlockUI/index.tsx +1 -0
- package/src/Buttons/Button.tsx +90 -0
- package/src/Buttons/index.ts +1 -0
- package/src/Card/Card.tsx +24 -0
- package/src/Card/index.ts +1 -0
- package/src/Containers/BodyContainer.tsx +14 -0
- package/src/Containers/ButtonSectionContainer.tsx +21 -0
- package/src/Containers/Container.tsx +39 -0
- package/src/Containers/DoubleContainer.tsx +48 -0
- package/src/Containers/MainContainer.tsx +17 -0
- package/src/Containers/OutletContainer.tsx +14 -0
- package/src/Containers/SubContainer.tsx +37 -0
- package/src/Containers/index.ts +7 -0
- package/src/Footer/Footer.tsx +61 -0
- package/src/Footer/index.tsx +1 -0
- package/src/Labels/InfoLabel/index.tsx +21 -0
- package/src/Labels/index.tsx +1 -0
- package/src/Layouts/homeLayout/index.tsx +34 -0
- package/src/Layouts/index.ts +1 -0
- package/src/LineSeparator/LineSeparator.tsx +3 -0
- package/src/LineSeparator/index.tsx +1 -0
- package/src/Modal/Modal.tsx +104 -0
- package/src/Modal/index.tsx +1 -0
- package/src/NavBar/index.tsx +5 -0
- package/src/ProgressBar/ProgressBar.tsx +25 -0
- package/src/ProgressBar/ProgressCircle.tsx +75 -0
- package/src/ProgressBar/index.tsx +2 -0
- package/src/Skeletons/LoadingInputSkeleton.tsx +12 -0
- package/src/Skeletons/index.ts +1 -0
- package/src/Tab/Tab.tsx +63 -0
- package/src/Tab/index.ts +1 -0
- package/src/Table/ZauruTable.tsx +263 -0
- package/src/Table/index.tsx +1 -0
- package/src/TaskList/TaskList.tsx +88 -0
- package/src/TaskList/index.ts +1 -0
- package/src/Titles/LabelArray.tsx +17 -0
- package/src/Titles/TableColumnTitle.tsx +9 -0
- package/src/Titles/TitleH1.tsx +11 -0
- package/src/Titles/TitleH2.tsx +10 -0
- package/src/Titles/TitleH3.tsx +10 -0
- package/src/Titles/index.ts +5 -0
- package/src/Tooltip/Tooltip.tsx +42 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/WithTooltip/WithTooltip.tsx +21 -0
- package/src/WithTooltip/index.tsx +1 -0
- package/src/Wizards/StepWizard.tsx +88 -0
- package/src/Wizards/index.ts +1 -0
- package/src/index.ts +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.12](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.11...v1.0.12) (2024-03-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zauru-sdk/components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.0.11](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.10...v1.0.11) (2024-03-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @zauru-sdk/components
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const BlockUI = (props) => {
|
|
3
|
+
const { children, active, loadingText } = props;
|
|
4
|
+
if (!active) {
|
|
5
|
+
return _jsx(_Fragment, { children: children });
|
|
6
|
+
}
|
|
7
|
+
return (_jsx("div", { children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: "absolute bg-gray-100 bg-opacity-20 z-10 h-full w-full flex items-center justify-center", children: _jsxs("div", { className: "flex items-center", children: [_jsx("span", { className: "text-3xl mr-4", children: loadingText }), _jsxs("svg", { className: "animate-spin h-5 w-5 text-gray-600", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] })] }) }), children] }) }));
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./BlockUI";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./BlockUI";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Props = {
|
|
3
|
+
type?: "reset" | "button" | "submit" | undefined;
|
|
4
|
+
title?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
onClickSave?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
loadingText?: string;
|
|
9
|
+
selectedColor?: "indigo" | "green" | "red" | "yellow";
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const Button: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const Button = (props) => {
|
|
3
|
+
const { type = "submit", loading = false, loadingText = "Guardando...", title = "Guardar", name = "save", onClickSave, selectedColor = "indigo", children, className = "", disabled = false, } = props;
|
|
4
|
+
const COLORS = {
|
|
5
|
+
green: {
|
|
6
|
+
bg900: "bg-green-900",
|
|
7
|
+
bg700: "bg-green-700",
|
|
8
|
+
bg600: "bg-green-600",
|
|
9
|
+
bg500: "bg-green-500",
|
|
10
|
+
ring600: "ring-green-600",
|
|
11
|
+
ring500: "ring-green-500",
|
|
12
|
+
},
|
|
13
|
+
indigo: {
|
|
14
|
+
bg900: "bg-indigo-900",
|
|
15
|
+
bg700: "bg-indigo-700",
|
|
16
|
+
bg600: "bg-indigo-600",
|
|
17
|
+
bg500: "bg-indigo-500",
|
|
18
|
+
ring600: "ring-indigo-600",
|
|
19
|
+
ring500: "ring-indigo-500",
|
|
20
|
+
},
|
|
21
|
+
red: {
|
|
22
|
+
bg900: "bg-red-900",
|
|
23
|
+
bg700: "bg-red-700",
|
|
24
|
+
bg600: "bg-red-600",
|
|
25
|
+
bg500: "bg-red-500",
|
|
26
|
+
ring600: "ring-red-600",
|
|
27
|
+
ring500: "ring-red-500",
|
|
28
|
+
},
|
|
29
|
+
yellow: {
|
|
30
|
+
bg900: "bg-yellow-900",
|
|
31
|
+
bg700: "bg-yellow-700",
|
|
32
|
+
bg600: "bg-yellow-600",
|
|
33
|
+
bg500: "bg-yellow-500",
|
|
34
|
+
ring600: "ring-yellow-600",
|
|
35
|
+
ring500: "ring-yellow-500",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const color = COLORS[selectedColor];
|
|
39
|
+
const inside = children ?? title;
|
|
40
|
+
return (_jsx("button", { type: type, name: "action", disabled: loading || disabled, value: name, onClick: onClickSave, className: `ml-2 ${loading || disabled ? " bg-opacity-25 " : ""} ${loading
|
|
41
|
+
? " cursor-progress"
|
|
42
|
+
: `${disabled ? "" : `hover:${color.bg700}`}`} inline-flex justify-center rounded-md border border-transparent ${color.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${color.ring500} focus:ring-offset-2 ${className}`, children: loading ? loadingText : inside }));
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const Card = (props) => {
|
|
3
|
+
const { children, title, className } = props;
|
|
4
|
+
return (_jsxs("div", { className: `p-4 space-y-3 shadow sm:overflow-hidden sm:rounded-md ${className}`, children: [title && (_jsx("label", { className: "inline text-lg font-medium text-gray-700", children: `${title.toUpperCase()}` })), children] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Card";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Card";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormDocumentType } from "@zauru-sdk/types";
|
|
3
|
+
interface ChatLayoutProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
sendingMessage?: boolean;
|
|
6
|
+
formConfig?: {
|
|
7
|
+
document_type: FormDocumentType;
|
|
8
|
+
form_id: number;
|
|
9
|
+
document_id: number;
|
|
10
|
+
id_number?: string;
|
|
11
|
+
reference?: string;
|
|
12
|
+
attachmentFieldId: number;
|
|
13
|
+
messageFieldId: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare const ChatLayout: React.FC<ChatLayoutProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { AttachmentIconSVG, SendMessageIcon, SpinnerSvg } from "../Icons/Icons";
|
|
4
|
+
import LoadingInputSkeleton from "../Skeletons/LoadingInputSkeleton";
|
|
5
|
+
import { TextField } from "../Form";
|
|
6
|
+
import { Form } from "@remix-run/react";
|
|
7
|
+
export const ChatLayout = ({ children, sendingMessage = false, formConfig = undefined, }) => {
|
|
8
|
+
const refAttachment = useRef(null);
|
|
9
|
+
const [formValues, setFormValues] = useState({ image: null });
|
|
10
|
+
const handleAttachmentClick = () => {
|
|
11
|
+
if (refAttachment.current) {
|
|
12
|
+
refAttachment.current.click();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsxs("div", { className: "flex flex-col h-full", children: [_jsx("div", { className: "flex flex-col-reverse overflow-y-auto p-4 bg-gray-100 border border-gray-200 rounded-lg grow max-h-[65vh]", children: children }), _jsxs(Form, { id: "formRef", encType: "multipart/form-data", method: "post", children: [formConfig ? (_jsxs(_Fragment, { children: [_jsx(TextField, { hidden: true, name: "reference", defaultValue: formConfig.reference ?? "" }), _jsx(TextField, { hidden: true, name: "form_id", defaultValue: formConfig.form_id }), _jsx(TextField, { hidden: true, name: "document_id", defaultValue: formConfig.document_id }), _jsx(TextField, { hidden: true, name: "document_type", defaultValue: formConfig.document_type }), _jsx(TextField, { hidden: true, name: "id_number", defaultValue: formConfig?.id_number ?? "" })] })) : (_jsx(_Fragment, {})), _jsxs("div", { className: "mt-4 flex", children: [sendingMessage ? (_jsx(LoadingInputSkeleton, {})) : (_jsx("input", { name: `message${formConfig?.messageFieldId
|
|
16
|
+
? `_${formConfig?.messageFieldId}`
|
|
17
|
+
: ""}`, type: "text", placeholder: "Escribe un mensaje...", className: "form-input px-4 py-2 border border-gray-300 rounded-l-lg grow" })), _jsx("button", { onClick: handleAttachmentClick, className: `${formValues?.image ? "bg-blue-500" : ""} hover:bg-blue-700 text-white font-bold py-2 px-4`, type: "button", children: _jsx(AttachmentIconSVG, {}) }), _jsx("button", { className: "bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-r-lg", type: "submit", name: "action", value: "sendMessage", children: sendingMessage ? _jsx(SpinnerSvg, {}) : _jsx(SendMessageIcon, {}) })] }), _jsx("input", { ref: refAttachment, hidden: true, name: `attachment${formConfig?.attachmentFieldId
|
|
18
|
+
? `_${formConfig?.attachmentFieldId}`
|
|
19
|
+
: ""}`, type: "file", accept: ".jpg, .png, .jpeg, .png", onChange: (e) => {
|
|
20
|
+
if (e.target.value && e.target.value !== "") {
|
|
21
|
+
setFormValues({ ...formValues, image: e.target.value });
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setFormValues({ ...formValues, image: null });
|
|
25
|
+
}
|
|
26
|
+
} })] })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
author: string;
|
|
3
|
+
content: string;
|
|
4
|
+
date?: string;
|
|
5
|
+
onLike?: (like: boolean) => void;
|
|
6
|
+
onUpdateComment?: (text: string, itsNew?: boolean) => void;
|
|
7
|
+
id: string;
|
|
8
|
+
commentOwner?: boolean;
|
|
9
|
+
imageLink?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const ChatMessageHistory: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useRef } from "react";
|
|
3
|
+
import { CheckIconSVG, PencilSvg } from "../Icons/Icons";
|
|
4
|
+
export const ChatMessageHistory = (props) => {
|
|
5
|
+
const { author, content, onLike, onUpdateComment, id, commentOwner = false, date, imageLink, } = props;
|
|
6
|
+
const initials = author ? author[0].toUpperCase() : "A";
|
|
7
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
8
|
+
const [updatedContent, setUpdatedContent] = useState(content);
|
|
9
|
+
const textAreaRef = useRef(null);
|
|
10
|
+
const [shouldPulse, setShouldPulse] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (isUpdating && textAreaRef.current) {
|
|
13
|
+
textAreaRef.current.style.height = "auto";
|
|
14
|
+
textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight}px`;
|
|
15
|
+
textAreaRef.current.focus();
|
|
16
|
+
}
|
|
17
|
+
}, [isUpdating]);
|
|
18
|
+
// Efecto secundario que se ejecuta cada vez que 'isUpdating' cambia
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// Activar la animación
|
|
21
|
+
setShouldPulse(true);
|
|
22
|
+
// Establecer un temporizador para eliminar la clase después de que la animación se haya completado
|
|
23
|
+
const timer = setTimeout(() => {
|
|
24
|
+
setShouldPulse(false);
|
|
25
|
+
}, 15000); // Tiempo total de la animación
|
|
26
|
+
// Limpiar el temporizador si el componente se desmonta o si 'isUpdating' cambia de nuevo antes de que la animación se complete
|
|
27
|
+
return () => clearTimeout(timer);
|
|
28
|
+
}, [isUpdating]);
|
|
29
|
+
const handleUpdate = (e) => {
|
|
30
|
+
if (e.target.value.length <= 254) {
|
|
31
|
+
setUpdatedContent(e.target.value);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleUpdateClick = () => {
|
|
35
|
+
if (isUpdating) {
|
|
36
|
+
if (textAreaRef.current) {
|
|
37
|
+
textAreaRef.current.blur();
|
|
38
|
+
}
|
|
39
|
+
//onUpdateComment && onUpdateComment(updatedContent, itsNew);
|
|
40
|
+
}
|
|
41
|
+
setIsUpdating(!isUpdating);
|
|
42
|
+
};
|
|
43
|
+
return (_jsxs("div", { className: "p-1 rounded-xl flex items-center space-x-4 relative", children: [commentOwner && (_jsx("div", { className: "absolute top-2 right-2", children: _jsx("button", { onClick: handleUpdateClick, className: `${shouldPulse ? "animate-custom-pulse" : ""}`, children: isUpdating ? _jsx(CheckIconSVG, {}) : _jsx(PencilSvg, {}) }) })), _jsx("div", { className: `w-[0%] lg:w-[8%] h-16 bg-purple-300 rounded-full flex items-center justify-center overflow-hidden text-white text-xl font-bold`, children: initials }), _jsxs("div", { className: "flex flex-col justify-between h-full w-[92%]", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex flex-row space-x-2", children: [_jsx("div", { className: "text-xl font-medium text-black", children: author }), _jsx("div", { className: "text-xl font-medium text-gray-500", children: date && _jsxs(_Fragment, { children: [" - ", date] }) })] }), isUpdating ? (_jsx("textarea", { ref: textAreaRef, className: "bg-gray-100 rounded p-2 w-full resize-none", value: updatedContent, onChange: handleUpdate, maxLength: 254, placeholder: "Deja tus buenos deseos..." })) : (_jsx("p", { className: "text-gray-500", children: updatedContent }))] }), _jsx("div", { className: "flex justify-end items-center", children: _jsx("button", { onClick: () => { }, children: _jsx(_Fragment, {}) }) })] }), imageLink && (_jsx("div", { className: `w-[25%] flex items-center justify-center overflow-hidden text-white text-xl font-bold`, children: _jsx("div", { onClick: () => {
|
|
44
|
+
return window.open(imageLink, "_blank");
|
|
45
|
+
}, children: _jsx("img", { src: imageLink, alt: "IMG_CHAT", className: `h-48 w-48 inline mr-1 pb-1`, style: {
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
strokeWidth: 2,
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round",
|
|
50
|
+
fill: "none",
|
|
51
|
+
backgroundColor: "transparent",
|
|
52
|
+
} }) }) }))] }));
|
|
53
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
export const BodyContainer = (props) => {
|
|
3
|
+
const { children } = props;
|
|
4
|
+
return (_jsx(_Fragment, { children: _jsx("body", { className: "flex flex-col min-h-screen m-0", children: children }) }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const ButtonSectionContainer = (props) => {
|
|
3
|
+
const { children, className, whitBg = true } = props;
|
|
4
|
+
return (_jsx("div", { className: `${whitBg ? "bg-gray-50" : ""} px-4 py-3 text-right sm:px-6 ${className}`, children: children }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
rightContent?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const Container: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const Container = (props) => {
|
|
3
|
+
const { title, description, children, className = "", rightContent } = props;
|
|
4
|
+
const titleInfo = (_jsxs(_Fragment, { children: [title && (_jsx("h3", { className: "text-3xl font-bold leading-8 text-gray-900", children: title })), description && (_jsx("p", { className: "mt-1 text-md text-gray-600", children: description }))] }));
|
|
5
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `mx-2 ${className}`, children: [rightContent && (_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("div", { children: titleInfo }), _jsx("div", { children: rightContent })] })), !rightContent && titleInfo, _jsx("div", { className: "mt-5 space-y-5", children: children })] }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const DoubleContainer = (props) => {
|
|
3
|
+
const { title, description, className = "", children } = props;
|
|
4
|
+
const getChildren = (index) => {
|
|
5
|
+
if (children && Array.isArray(children) && children[index]) {
|
|
6
|
+
return children[index];
|
|
7
|
+
}
|
|
8
|
+
if (children && index === 0) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
11
|
+
return _jsx(_Fragment, {});
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `mx-2 ${className}`, children: [title && (_jsx("h3", { className: "text-3xl font-bold leading-8 text-gray-900", children: title })), description && (_jsx("p", { className: "mt-1 text-md text-gray-600", children: description })), _jsxs("div", { className: "grid xl:grid-cols-3 md:grid-cols-1 gap-4", children: [_jsx("div", { className: "xl:col-span-2 md:col-span-1 mt-5", children: getChildren(0) }), _jsx("div", { className: "xl:col-span-1 md:col-span-1 mt-5", children: getChildren(1) })] })] }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
export const MainContainer = (props) => {
|
|
3
|
+
const { children } = props;
|
|
4
|
+
return (_jsx(_Fragment, { children: _jsx("div", { className: "md:p-10 p-0 mt-10 ml-2 mr-2 mb-10 md:mt-0 md:ml-0 md:mr-0 md:mb-0", children: children }) }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
rightContent?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const SubContainer: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const SubContainer = (props) => {
|
|
3
|
+
const { title, description, children, className = "", rightContent } = props;
|
|
4
|
+
const titleInfo = (_jsxs(_Fragment, { children: [title && (_jsx("h3", { className: "text-xl font-bold leading-8 text-gray-900", children: title })), description && (_jsx("p", { className: "mt-1 text-md text-gray-600", children: description }))] }));
|
|
5
|
+
return (_jsxs("div", { className: `${className}`, children: [rightContent && (_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("div", { children: titleInfo }), _jsx("div", { children: rightContent })] })), !rightContent && titleInfo, _jsx("div", { className: "mt-5 space-y-3", children: children })] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type FooterProps = {
|
|
2
|
+
href: string;
|
|
3
|
+
showConnection?: boolean;
|
|
4
|
+
selectedColor: "purple" | "pink" | "indigo" | "cyan" | "slate" | "green" | "red" | "sky";
|
|
5
|
+
};
|
|
6
|
+
export declare const Footer: ({ href, selectedColor, showConnection, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
//import ConnectionState from "../ConnectionState";
|
|
4
|
+
import { LoadingInputSkeleton } from "src";
|
|
5
|
+
const COLORS = {
|
|
6
|
+
purple: "bg-purple-500",
|
|
7
|
+
pink: "bg-pink-500",
|
|
8
|
+
indigo: "bg-indigo-500",
|
|
9
|
+
cyan: "bg-cyan-500",
|
|
10
|
+
slate: "bg-slate-500",
|
|
11
|
+
green: "bg-green-500",
|
|
12
|
+
red: "bg-red-500",
|
|
13
|
+
sky: "bg-sky-500",
|
|
14
|
+
};
|
|
15
|
+
export const Footer = ({ href, selectedColor, showConnection = false, }) => {
|
|
16
|
+
const [client, setIsClient] = useState(false);
|
|
17
|
+
const color = COLORS[selectedColor];
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setIsClient(true);
|
|
20
|
+
}, []);
|
|
21
|
+
if (!client) {
|
|
22
|
+
return _jsx(LoadingInputSkeleton, {});
|
|
23
|
+
}
|
|
24
|
+
return (_jsx("footer", { className: `inset-x-0 bottom-0 px-2 py-[20px] ${color}`, children: _jsx("div", { className: "px-4 mx-auto flex flex-wrap items-center justify-center", children: _jsxs("p", { className: "text-white text-[1.2rem]", children: [`Creado en `, " ", _jsx("a", { href: href, children: "Zauru" }), " ", `con ❤️ ${new Date().getFullYear()} v.3.2`] }) }) }));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Footer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Footer";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const InfoLabel = (props) => {
|
|
3
|
+
const { description, title, className } = props;
|
|
4
|
+
return (_jsxs("div", { className: `block ${className}`, children: [_jsx("label", { className: "inline text-sm font-medium text-gray-700", children: `${title.toUpperCase()} ` }), _jsx("label", { className: "inline text-sm font-medium text-gray-500", children: description })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InfoLabel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InfoLabel";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const HomeLayout = ({ title, description }) => {
|
|
3
|
+
return (_jsx("div", { className: "bg-cover bg-center h-screen", style: { backgroundImage: 'url("/wallpaper.webp")' }, children: _jsxs("div", { className: "flex flex-col h-screen justify-center items-center", children: [_jsx("h1", { className: "text-6xl md:text-7xl lg:text-8xl text-white font-bold mb-6 text-center", style: {
|
|
4
|
+
textShadow: "0.5px 0.5px 1px #000000",
|
|
5
|
+
WebkitTextStroke: "2px #000000",
|
|
6
|
+
}, children: title ?? _jsx(_Fragment, { children: "Bienvenido, inicie sesi\u00F3n para continuar." }) }), _jsx("p", { className: "text-xl md:text-2xl lg:text-3xl text-white text-center max-w-md mb-12", style: {
|
|
7
|
+
textShadow: "0.5px 0.5px 1px #000000",
|
|
8
|
+
WebkitTextStroke: "1px #000000",
|
|
9
|
+
}, children: description ?? _jsx(_Fragment, { children: "Web app, realizada en Zauru." }) })] }) }));
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./homeLayout";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./homeLayout";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LineSeparator: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LineSeparator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LineSeparator";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type ModalOption = "OK" | "CANCEL" | null;
|
|
3
|
+
type ModalParams = {
|
|
4
|
+
title: string;
|
|
5
|
+
description: React.ReactNode;
|
|
6
|
+
okButtonText?: string;
|
|
7
|
+
showOptions?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const createModal: ({ title, description, okButtonText, showOptions, }: ModalParams) => Promise<ModalOption>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
export const createModal = ({ title, description, okButtonText, showOptions = true, }) => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
const handleClose = () => {
|
|
6
|
+
resolve(null);
|
|
7
|
+
removeModal();
|
|
8
|
+
};
|
|
9
|
+
const handleOk = () => {
|
|
10
|
+
resolve("OK");
|
|
11
|
+
removeModal();
|
|
12
|
+
};
|
|
13
|
+
const handleCancel = () => {
|
|
14
|
+
resolve("CANCEL");
|
|
15
|
+
removeModal();
|
|
16
|
+
};
|
|
17
|
+
const removeModal = () => {
|
|
18
|
+
document.body.removeChild(modalWrapper);
|
|
19
|
+
document.body.removeChild(modalOverlay);
|
|
20
|
+
};
|
|
21
|
+
const modalWrapper = document.createElement("div");
|
|
22
|
+
modalWrapper.classList.add("justify-center", "items-center", "flex", "overflow-x-hidden", "overflow-y-auto", "fixed", "inset-0", "z-50", "outline-none", "focus:outline-none");
|
|
23
|
+
// Crear capa de fondo detrás del modal
|
|
24
|
+
const modalOverlay = document.createElement("div");
|
|
25
|
+
modalOverlay.classList.add("fixed", "inset-0", "bg-black", "opacity-50", "z-40");
|
|
26
|
+
document.body.appendChild(modalOverlay);
|
|
27
|
+
document.body.appendChild(modalWrapper);
|
|
28
|
+
const ModalContent = () => (_jsx("div", { className: "relative w-auto my-6 mx-auto max-w-3xl", children: _jsxs("div", { className: "border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none", children: [_jsxs("div", { className: "flex items-start justify-between p-5 border-b border-solid border-slate-200 rounded-t", children: [_jsx("h3", { className: "text-3xl font-semibold", children: title }), _jsx("button", { className: "p-1 ml-auto bg-transparent border-0 text-black float-right text-3xl leading-none font-semibold outline-none focus:outline-none", children: _jsx("span", { className: "close-button", onClick: handleClose, children: "\u00D7" }) })] }), _jsx("div", { className: "relative p-6 flex-auto", children: description }), showOptions && (_jsxs("div", { className: "flex items-center justify-end p-6 border-t border-solid border-slate-200 rounded-b", children: [_jsx("button", { className: "cancel-button text-red-700 background-transparent font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150", type: "button", onClick: handleCancel, children: "Cancelar" }), _jsx("button", { className: "ok-button bg-emerald-700 text-white active:bg-emerald-600 font-bold uppercase text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150", type: "button", onClick: handleOk, children: okButtonText ?? "Aceptar" })] }))] }) }));
|
|
29
|
+
const root = createRoot(modalWrapper);
|
|
30
|
+
root.render(_jsx(ModalContent, {}));
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Modal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Modal";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const ProgressBar = (props) => {
|
|
3
|
+
const { title, percent } = props;
|
|
4
|
+
return (_jsx(_Fragment, { children: percent && (_jsxs(_Fragment, { children: [title && _jsx("div", { className: "mb-1 text-lg font-medium", children: title }), _jsx("div", { className: "w-full h-6 bg-gray-200 rounded-full", children: _jsx("div", { className: "h-6 bg-blue-600 rounded-full", style: { width: `${percent}%` } }) })] })) }));
|
|
5
|
+
};
|