@zauru-sdk/components 1.0.12 → 1.0.14
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 +16 -0
- package/dist/Alerts/index.d.ts +0 -1
- package/dist/Alerts/index.js +0 -1
- package/dist/Chat/ChatLayout.d.ts +2 -2
- package/dist/Chat/ChatLayout.js +4 -3
- package/dist/Chat/ChatMessageHistory.js +1 -1
- package/dist/ConnectionState/ConnectionState.d.ts +2 -0
- package/dist/ConnectionState/ConnectionState.js +22 -0
- package/dist/ConnectionState/index.d.ts +1 -0
- package/dist/ConnectionState/index.js +1 -0
- package/dist/DynamicTable/BasicPrintDynamicTable.d.ts +10 -0
- package/dist/DynamicTable/BasicPrintDynamicTable.js +27 -0
- package/dist/DynamicTable/DynamicPrintTable.d.ts +23 -0
- package/dist/DynamicTable/DynamicPrintTable.js +132 -0
- package/dist/DynamicTable/GenericDynamicTable.d.ts +21 -0
- package/dist/DynamicTable/GenericDynamicTable.js +195 -0
- package/dist/DynamicTable/index.d.ts +24 -0
- package/dist/DynamicTable/index.js +193 -0
- package/dist/Footer/Footer.js +2 -2
- package/dist/Form/Checkbox/index.d.ts +17 -0
- package/dist/Form/Checkbox/index.js +34 -0
- package/dist/Form/Checklist/index.d.ts +14 -0
- package/dist/Form/Checklist/index.js +10 -0
- package/dist/Form/DatePicker/index.d.ts +18 -0
- package/dist/Form/DatePicker/index.js +31 -0
- package/dist/Form/DynamicBaculoForm/index.d.ts +18 -0
- package/dist/Form/DynamicBaculoForm/index.js +138 -0
- package/dist/Form/FieldContainer/DoubleFieldContainer.d.ts +8 -0
- package/dist/Form/FieldContainer/DoubleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/QuadrupleFieldContainer.d.ts +7 -0
- package/dist/Form/FieldContainer/QuadrupleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/TripleFieldContainer.d.ts +7 -0
- package/dist/Form/FieldContainer/TripleFieldContainer.js +14 -0
- package/dist/Form/FieldContainer/index.d.ts +3 -0
- package/dist/Form/FieldContainer/index.js +3 -0
- package/dist/Form/FileUpload/index.d.ts +21 -0
- package/dist/Form/FileUpload/index.js +54 -0
- package/dist/Form/FormButtons/index.d.ts +16 -0
- package/dist/Form/FormButtons/index.js +5 -0
- package/dist/Form/FormLayout/index.d.ts +11 -0
- package/dist/Form/FormLayout/index.js +7 -0
- package/dist/Form/SelectField/index.d.ts +27 -0
- package/dist/Form/SelectField/index.js +74 -0
- package/dist/Form/TextArea/index.d.ts +23 -0
- package/dist/Form/TextArea/index.js +36 -0
- package/dist/Form/TextField/index.d.ts +25 -0
- package/dist/Form/TextField/index.js +70 -0
- package/dist/Form/TimePicker/index.d.ts +16 -0
- package/dist/Form/TimePicker/index.js +31 -0
- package/dist/Form/YesNo/index.d.ts +12 -0
- package/dist/Form/YesNo/index.js +19 -0
- package/dist/Form/index.d.ts +13 -0
- package/dist/Form/index.js +13 -0
- package/dist/NavBar/NavBar.js +2 -2
- package/dist/Table/ZauruTable.js +1 -1
- package/dist/Zendesk/Chat.d.ts +2 -2
- package/dist/Zendesk/Chat.js +2 -1
- package/dist/Zendesk/zendesk.config.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -2
- package/package.json +9 -8
- package/src/Alerts/index.ts +0 -1
- package/src/Chat/ChatLayout.tsx +133 -0
- package/src/Chat/ChatMessageHistory.tsx +142 -0
- package/src/Chat/index.ts +2 -0
- package/src/ConnectionState/ConnectionState.tsx +29 -0
- package/src/ConnectionState/index.tsx +1 -0
- package/src/DynamicTable/BasicPrintDynamicTable.tsx +73 -0
- package/src/DynamicTable/DynamicPrintTable.tsx +290 -0
- package/src/DynamicTable/GenericDynamicTable.tsx +455 -0
- package/src/DynamicTable/index.tsx +407 -0
- package/src/Footer/Footer.tsx +3 -3
- package/src/Form/Checkbox/index.tsx +96 -0
- package/src/Form/Checklist/index.tsx +35 -0
- package/src/Form/DatePicker/index.tsx +132 -0
- package/src/Form/DynamicBaculoForm/index.tsx +359 -0
- package/src/Form/FieldContainer/DoubleFieldContainer.tsx +35 -0
- package/src/Form/FieldContainer/QuadrupleFieldContainer.tsx +36 -0
- package/src/Form/FieldContainer/TripleFieldContainer.tsx +35 -0
- package/src/Form/FieldContainer/index.ts +3 -0
- package/src/Form/FileUpload/index.tsx +184 -0
- package/src/Form/FormButtons/index.tsx +78 -0
- package/src/Form/FormLayout/index.tsx +37 -0
- package/src/Form/SelectField/index.tsx +237 -0
- package/src/Form/TextArea/index.tsx +125 -0
- package/src/Form/TextField/index.tsx +194 -0
- package/src/Form/TimePicker/index.tsx +127 -0
- package/src/Form/YesNo/index.tsx +79 -0
- package/src/Form/index.ts +13 -0
- package/src/NavBar/NavBar.tsx +2 -2
- package/src/Table/ZauruTable.tsx +1 -1
- package/src/Zendesk/Chat.tsx +85 -0
- package/src/Zendesk/index.ts +2 -0
- package/src/Zendesk/zendesk.config.ts +40 -0
- package/src/index.ts +4 -2
- package/dist/Alerts/Alert.d.ts +0 -9
- package/dist/Alerts/Alert.js +0 -97
- package/dist/Icons/Icons.d.ts +0 -47
- package/dist/Icons/Icons.js +0 -110
- package/dist/Icons/StylesConstants.d.ts +0 -26
- package/dist/Icons/StylesConstants.js +0 -34
- package/src/Alerts/Alert.tsx +0 -149
- package/src/Icons/Icons.tsx +0 -782
- package/src/Icons/StylesConstants.tsx +0 -66
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DownloadIconSVG, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
3
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
export const FileUploadFieldWithoutValidation = (props) => {
|
|
6
|
+
const { id, name, title, helpText, hint, onChange, disabled = false, readOnly = false, error, fileTypes = [], showAvailableTypes = false, className, defaultValue = undefined, download = false, } = props;
|
|
7
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
8
|
+
if (typeof defaultValue == "string") {
|
|
9
|
+
if (download) {
|
|
10
|
+
return (_jsxs("div", { role: "button", tabIndex: 0, onClick: () => {
|
|
11
|
+
window.open(defaultValue, "_blank");
|
|
12
|
+
}, onKeyDown: (event) => {
|
|
13
|
+
// Permite que el evento se active con la tecla Enter
|
|
14
|
+
if (event.key === "Enter") {
|
|
15
|
+
window.open(defaultValue, "_blank");
|
|
16
|
+
}
|
|
17
|
+
}, children: [title && (_jsx("label", { htmlFor: name, className: "block mb-1 text-sm font-medium text-gray-700", children: title })), " ", _jsx(DownloadIconSVG, {})] }));
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs("div", { className: `col-span-6 sm:col-span-3 ${className}`, children: [title && (_jsx("label", { htmlFor: name, className: `block mb-1 text-sm font-medium text-gray-700`, children: title })), " ", _jsx("div", { role: "button", tabIndex: 0, onClick: () => {
|
|
20
|
+
window.open(defaultValue, "_blank");
|
|
21
|
+
}, onKeyDown: (event) => {
|
|
22
|
+
// Permite que el evento se active con la tecla Enter
|
|
23
|
+
if (event.key === "Enter") {
|
|
24
|
+
window.open(defaultValue, "_blank");
|
|
25
|
+
}
|
|
26
|
+
}, children: _jsx("img", { src: defaultValue, alt: name, className: `h-48 w-48 inline mr-1 pb-1`, style: {
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: 2,
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
fill: "none",
|
|
32
|
+
backgroundColor: "transparent",
|
|
33
|
+
} }) })] }));
|
|
34
|
+
}
|
|
35
|
+
const handleInputChange = (event) => {
|
|
36
|
+
onChange && onChange(event);
|
|
37
|
+
};
|
|
38
|
+
let hintMessage = hint;
|
|
39
|
+
if (showAvailableTypes && fileTypes.length > 0) {
|
|
40
|
+
hintMessage = `${hint} Archivos permitidos: ${fileTypes.join(", ")}`;
|
|
41
|
+
}
|
|
42
|
+
const color = error ? "red" : "gray";
|
|
43
|
+
const isReadOnly = disabled || readOnly;
|
|
44
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
45
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-900`;
|
|
46
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-500`;
|
|
47
|
+
return (_jsxs("div", { className: `col-span-6 sm:col-span-3 ${className}`, children: [title && (_jsx("label", { htmlFor: name, className: `block mb-1 text-sm font-medium text-${color}-700`, children: title })), _jsxs("div", { className: "flex relative items-center", children: [_jsx("input", { type: "file", name: name, id: id ?? name, disabled: disabled, readOnly: readOnly, accept: fileTypes.map((ft) => `.${ft}`).join(", "), onChange: handleInputChange, className: `block w-full rounded-md ${bgColor} ${borderColor} ${textColor} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm` }), helpText && (_jsx("div", { className: "flex items-center relative ml-3", children: _jsxs("div", { className: "relative cursor-pointer", onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: [_jsx(IdeaIconSVG, {}), showTooltip && (_jsx("div", { className: "absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50", children: helpText }))] }) }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hintMessage && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500`, children: hintMessage }))] }));
|
|
48
|
+
};
|
|
49
|
+
export const FileUploadField = (props) => {
|
|
50
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
51
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
52
|
+
props = { ...props, error };
|
|
53
|
+
return _jsx(FileUploadFieldWithoutValidation, { ...props });
|
|
54
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
saveTitle?: string;
|
|
4
|
+
saveName?: string;
|
|
5
|
+
onClickSave?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
6
|
+
showCancel?: boolean;
|
|
7
|
+
cancelTitle?: string;
|
|
8
|
+
cancelName?: string;
|
|
9
|
+
showClear?: boolean;
|
|
10
|
+
clearTitle?: string;
|
|
11
|
+
clearName?: string;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
loadingSaveText?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const FormButtons: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const FormButtons = (props) => {
|
|
3
|
+
const { saveTitle = "Guardar", saveName = "save", cancelTitle = "Cancelar", cancelName = "cancel", showCancel = true, showClear = false, clearName = "clear", clearTitle = "Limpiar", loading = false, onClickSave, loadingSaveText = "Guardando...", } = props;
|
|
4
|
+
return (_jsxs(_Fragment, { children: [showClear && (_jsx("button", { type: "reset", name: "action", disabled: loading, value: clearName, className: `ml-5 ${loading ? " bg-opacity-25 cursor-progress" : ""} rounded-md border border-gray-300 bg-white py-2 px-3 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`, children: clearTitle })), showCancel && (_jsx("button", { type: "button", name: "action", disabled: loading, value: cancelName, className: `${showClear ? "ml-2" : "ml-5"} ${loading ? " bg-opacity-25 cursor-progress" : ""} rounded-md border border-gray-300 bg-white py-2 px-3 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`, children: cancelTitle })), _jsx("button", { type: "submit", name: "action", disabled: loading, value: saveName, onClick: onClickSave, className: `ml-2 ${loading ? " bg-opacity-25 cursor-progress" : "hover:bg-indigo-700"} inline-flex justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`, children: loading ? loadingSaveText : saveTitle })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FormMethod } from "@remix-run/react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
type Props = {
|
|
4
|
+
formId: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
buttons?: ReactNode;
|
|
8
|
+
method?: FormMethod;
|
|
9
|
+
};
|
|
10
|
+
export declare const FormLayout: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from "@remix-run/react";
|
|
3
|
+
import { ButtonSectionContainer } from "src";
|
|
4
|
+
export const FormLayout = (props) => {
|
|
5
|
+
const { title, children, buttons, method, formId } = props;
|
|
6
|
+
return (_jsxs(Form, { id: formId, name: formId, method: method ?? "post", children: [title && (_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-3", children: title })), _jsxs("div", { className: "shadow sm:overflow-hidden sm:rounded-md", children: [_jsx("div", { className: "space-y-6 bg-white px-4 py-5 sm:p-6", children: children }), buttons && (_jsx(ButtonSectionContainer, { children: buttons }))] })] }, formId));
|
|
7
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SelectFieldOption } from "@zauru-sdk/types";
|
|
2
|
+
import type { SingleValue, InputActionMeta } from "react-select";
|
|
3
|
+
type Props = {
|
|
4
|
+
id?: string;
|
|
5
|
+
formName?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
defaultValue?: SingleValue<SelectFieldOption>;
|
|
9
|
+
defaultValueMulti?: SingleValue<SelectFieldOption>[];
|
|
10
|
+
helpText?: string;
|
|
11
|
+
options: Array<SelectFieldOption>;
|
|
12
|
+
onChange?: (value: SingleValue<SelectFieldOption>) => void;
|
|
13
|
+
onChangeMulti?: (value: Array<SingleValue<SelectFieldOption>>) => void;
|
|
14
|
+
onInputChange?: (newValue: string, actionMeta: InputActionMeta) => void;
|
|
15
|
+
isClearable?: boolean;
|
|
16
|
+
error?: string | undefined;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
menuIsOpen?: boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
isMulti?: boolean;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
hint?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const SelectFieldWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const SelectField: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IdeaIconSVG } from "@zauru-sdk/icons";
|
|
3
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import Select, { components } from "react-select";
|
|
6
|
+
import { LoadingInputSkeleton } from "src";
|
|
7
|
+
const Input = (props) => (_jsx(components.Input, { ...props, readOnly: props.selectProps.isReadOnly }));
|
|
8
|
+
export const SelectFieldWithoutValidation = (props) => {
|
|
9
|
+
const { id, name, title, defaultValue, defaultValueMulti = [], helpText, hint, options, onChange, onChangeMulti, isClearable = false, error = false, disabled = false, readOnly = false, isMulti = false, loading = false, className = "", onInputChange, } = props;
|
|
10
|
+
const [value, setValue] = useState(defaultValue || null);
|
|
11
|
+
const [valueMulti, setValueMulti] = useState(defaultValueMulti);
|
|
12
|
+
const [inputValue, setInputValue] = useState("");
|
|
13
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
14
|
+
const [isClient, setIsClient] = useState(typeof window !== "undefined");
|
|
15
|
+
const menuIsOpen = readOnly ? false : props?.menuIsOpen;
|
|
16
|
+
const color = error ? "red" : "gray";
|
|
17
|
+
let documentRef = null;
|
|
18
|
+
const isReadOnly = disabled || readOnly;
|
|
19
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
20
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-900`;
|
|
21
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-500`;
|
|
22
|
+
if (typeof window !== "undefined") {
|
|
23
|
+
documentRef = document;
|
|
24
|
+
}
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setValue(defaultValue || null);
|
|
27
|
+
}, [defaultValue]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setIsClient(true);
|
|
30
|
+
}, []);
|
|
31
|
+
if (!isClient || loading || !documentRef) {
|
|
32
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block text-sm font-medium text-${color}-700 dark:text-${color}-500`, children: title })), _jsx(LoadingInputSkeleton, {}), helpText && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: helpText }))] }));
|
|
33
|
+
}
|
|
34
|
+
const handleOnChange = (selection) => {
|
|
35
|
+
// Verificar si el valor de selección es un objeto con propiedades 'value' y 'label'
|
|
36
|
+
if (typeof selection === "object" &&
|
|
37
|
+
selection !== null &&
|
|
38
|
+
"value" in selection &&
|
|
39
|
+
"label" in selection) {
|
|
40
|
+
setValue(selection);
|
|
41
|
+
onChange && onChange(selection);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
setValue(null);
|
|
45
|
+
onChange && onChange(null);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const handleOnChangeMulti = (selection) => {
|
|
49
|
+
if (Array.isArray(selection)) {
|
|
50
|
+
setValueMulti(selection);
|
|
51
|
+
onChangeMulti &&
|
|
52
|
+
onChangeMulti(selection);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
setValueMulti([]);
|
|
56
|
+
onChangeMulti && onChangeMulti([]);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const selectComponent = (_jsxs(_Fragment, { children: [_jsx(Select, { className: `block w-full rounded-md ${bgColor} ${borderColor} ${textColor} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm`, id: isMulti ? undefined : id, instanceId: isMulti ? undefined : id, isDisabled: disabled, name: isMulti ? undefined : name, options: options, onChange: isMulti ? handleOnChangeMulti : handleOnChange, defaultValue: isMulti ? valueMulti : value, onInputChange: (newValue, actionMeta) => {
|
|
60
|
+
setInputValue(newValue);
|
|
61
|
+
onInputChange && onInputChange(newValue, actionMeta);
|
|
62
|
+
}, inputValue: inputValue, onMenuOpen: () => { }, onMenuClose: () => { }, menuPortalTarget: documentRef?.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 9999 }) }, isClearable: isClearable, isSearchable: true, components: { Input }, menuIsOpen: menuIsOpen,
|
|
63
|
+
//windowThreshold={50}
|
|
64
|
+
isMulti: isMulti }), isMulti && (_jsx("input", { hidden: true, readOnly: true, name: name, value: valueMulti.map((x) => x?.value).join(","), id: id }))] }));
|
|
65
|
+
return (_jsxs("div", { className: `col-span-6 sm:col-span-3 ${className}`, children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block text-sm font-medium ${color === "red"
|
|
66
|
+
? "text-red-700 dark:text-red-500"
|
|
67
|
+
: "text-gray-700 dark:text-gray-500"}`, children: title })), _jsxs("div", { className: "flex relative items-center", children: [selectComponent, helpText && (_jsx("div", { className: "flex items-center relative ml-3", children: _jsxs("div", { className: "relative cursor-pointer", onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: [_jsx(IdeaIconSVG, {}), showTooltip && (_jsx("div", { className: "absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50", children: helpText }))] }) }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hint && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: hint }))] }));
|
|
68
|
+
};
|
|
69
|
+
export const SelectField = (props) => {
|
|
70
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
71
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
72
|
+
props = { ...props, error };
|
|
73
|
+
return _jsx(SelectFieldWithoutValidation, { ...props });
|
|
74
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
formName?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
defaultValue?: string | number;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
hint?: string;
|
|
10
|
+
helpText?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
error?: string | undefined;
|
|
16
|
+
rows?: number;
|
|
17
|
+
cols?: number;
|
|
18
|
+
stopChangeEvents?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const TextAreaWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const TextArea: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
export const TextAreaWithoutValidation = (props) => {
|
|
5
|
+
const { id, name, title, defaultValue = "", hidden, hint, onChange, onKeyDown, disabled = false, error = false, readOnly = false, rows, cols, stopChangeEvents, className = "", } = props;
|
|
6
|
+
const [value, setValue] = useState(defaultValue);
|
|
7
|
+
const color = error ? "red" : "gray";
|
|
8
|
+
const isReadOnly = disabled || readOnly;
|
|
9
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
10
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-900`;
|
|
11
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-500`;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setValue(defaultValue);
|
|
14
|
+
}, [defaultValue]);
|
|
15
|
+
if (hidden) {
|
|
16
|
+
return (_jsx("textarea", { id: id ?? name, name: name, value: defaultValue, readOnly: true, hidden: true }));
|
|
17
|
+
}
|
|
18
|
+
const handleInputChange = (event) => {
|
|
19
|
+
if (stopChangeEvents) {
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
}
|
|
23
|
+
setValue(event.target.value);
|
|
24
|
+
onChange && onChange(event.target.value);
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("div", { className: `col-span-6 sm:col-span-3 ${className}`, children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block text-sm font-medium text-${color}-700 dark:text-${color}-500`, children: title })), _jsx("textarea", { name: name, readOnly: readOnly, disabled: disabled, id: id ?? name, autoComplete: "given-name", value: value, rows: rows, cols: cols, onChange: handleInputChange, onKeyDown: (event) => {
|
|
27
|
+
onKeyDown && onKeyDown(event);
|
|
28
|
+
}, className: `mt-1 block w-full rounded-md ${bgColor} ${borderColor} ${textColor} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm` }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hint && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: hint }))] }));
|
|
29
|
+
};
|
|
30
|
+
//<reference> https://tailwindui.com/components/application-ui/forms/form-layouts
|
|
31
|
+
export const TextArea = (props) => {
|
|
32
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
33
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
34
|
+
props = { ...props, error };
|
|
35
|
+
return _jsx(TextAreaWithoutValidation, { ...props });
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
formName?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
defaultValue?: string | number;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
type?: React.HTMLInputTypeAttribute;
|
|
10
|
+
helpText?: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
min?: string | number;
|
|
18
|
+
integer?: boolean;
|
|
19
|
+
stopChangeEvents?: boolean;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const TextFieldWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const TextField: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IdeaIconSVG } from "@zauru-sdk/icons";
|
|
3
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
export const TextFieldWithoutValidation = (props) => {
|
|
6
|
+
const { id, name, defaultValue = "", hidden, type = "text", onChange, onKeyDown, disabled = false, readOnly = false, min, integer = false, stopChangeEvents, style, error, title, helpText, className, hint, } = props;
|
|
7
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
8
|
+
const [value, setValue] = useState(defaultValue);
|
|
9
|
+
const color = error ? "red" : "gray";
|
|
10
|
+
const isReadOnly = disabled || readOnly;
|
|
11
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
12
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-900`;
|
|
13
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-500`;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setValue(defaultValue);
|
|
16
|
+
}, [defaultValue]);
|
|
17
|
+
if (hidden) {
|
|
18
|
+
return (_jsx("input", { type: type, id: id ?? name, name: name, value: defaultValue, readOnly: true, hidden: true }));
|
|
19
|
+
}
|
|
20
|
+
const handleInputChange = (event) => {
|
|
21
|
+
if (stopChangeEvents) {
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
}
|
|
25
|
+
if (integer && type === "number") {
|
|
26
|
+
const value = event.target.value;
|
|
27
|
+
const isInteger = /^[0-9]*$/.test(value);
|
|
28
|
+
if (isInteger || value === "") {
|
|
29
|
+
setValue(value);
|
|
30
|
+
onChange && onChange(value, event);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
setValue(event.target.value);
|
|
35
|
+
onChange && onChange(event.target.value, event);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleKeyDown = (event) => {
|
|
39
|
+
if (integer && type === "number") {
|
|
40
|
+
// Permitir solo números y teclas de control
|
|
41
|
+
const allowedKeys = [
|
|
42
|
+
"Backspace",
|
|
43
|
+
"ArrowLeft",
|
|
44
|
+
"ArrowRight",
|
|
45
|
+
"Delete",
|
|
46
|
+
"Enter",
|
|
47
|
+
"Tab",
|
|
48
|
+
];
|
|
49
|
+
if (!allowedKeys.includes(event.key) && !/^[0-9]$/.test(event.key)) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const inputComponent = (_jsx("input", { type: type, name: name, readOnly: readOnly, disabled: disabled, id: id ?? name, autoComplete: "given-name", value: value, onWheel: (e) => {
|
|
55
|
+
e.currentTarget.blur();
|
|
56
|
+
}, step: type === "number" ? 0.01 : undefined, onChange: handleInputChange, onKeyDown: (event) => {
|
|
57
|
+
handleKeyDown(event);
|
|
58
|
+
onKeyDown && onKeyDown(event);
|
|
59
|
+
}, min: min, style: style, className: `block w-full rounded-md ${bgColor} ${borderColor} ${textColor} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm` }));
|
|
60
|
+
if (!error && !title) {
|
|
61
|
+
return _jsx("div", { className: `${className}`, children: inputComponent });
|
|
62
|
+
}
|
|
63
|
+
return (_jsxs("div", { className: `col-span-6 sm:col-span-3 ${className}`, children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block mb-1 text-sm font-medium text-${color}-700 dark:text-${color}-500`, children: title })), _jsxs("div", { className: "flex relative items-center", children: [inputComponent, helpText && (_jsx("div", { className: "flex items-center relative ml-3", children: _jsxs("div", { className: "relative cursor-pointer", onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: [_jsx(IdeaIconSVG, {}), showTooltip && (_jsx("div", { className: "absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50", children: helpText }))] }) }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hint && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: hint }))] }));
|
|
64
|
+
};
|
|
65
|
+
export const TextField = (props) => {
|
|
66
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
67
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
68
|
+
props = { ...props, error };
|
|
69
|
+
return _jsx(TextFieldWithoutValidation, { ...props });
|
|
70
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
formName?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
helpText?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
error?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const FormTimePickerWithoutValidation: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const FormTimePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ClockIconSVG, CloseSvgIcon, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
3
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
export const FormTimePickerWithoutValidation = (props) => {
|
|
6
|
+
const { id, name, title, defaultValue = "", hint, helpText, onChange, tabIndex, error, disabled = false, } = props;
|
|
7
|
+
const [value, setValue] = useState(defaultValue);
|
|
8
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
9
|
+
const color = error ? "red" : "gray";
|
|
10
|
+
const isReadOnly = disabled;
|
|
11
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
12
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-500`;
|
|
13
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-200`;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setValue(defaultValue);
|
|
16
|
+
}, [defaultValue]);
|
|
17
|
+
const clearValue = () => {
|
|
18
|
+
setValue("");
|
|
19
|
+
onChange && onChange("");
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx("label", { htmlFor: error ? `${name}-error` : `${name}-success`, className: `block text-sm font-medium ${textColor}`, children: title })), _jsxs("div", { className: "flex relative items-center", children: [_jsx("div", { className: "absolute left-0 flex items-center pl-3 pointer-events-none", children: _jsx(ClockIconSVG, {}) }), _jsx("input", { id: id, name: name, tabIndex: tabIndex, type: "time", onChange: (e) => {
|
|
22
|
+
setValue(e.target.value);
|
|
23
|
+
onChange && onChange(e.target.value);
|
|
24
|
+
}, value: value, pattern: "\\d{2}:\\d{2}", className: `${bgColor} ${borderColor} ${textColor} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5` }), value && (_jsx("button", { type: "button", onClick: clearValue, className: "absolute right-0 mr-10", children: _jsx(CloseSvgIcon, {}) })), helpText && (_jsx("div", { className: "flex items-center relative ml-3", children: _jsxs("div", { className: "relative cursor-pointer", onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: [_jsx(IdeaIconSVG, {}), showTooltip && (_jsx("div", { className: "absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black", children: helpText }))] }) }))] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && hint && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: hint }))] }));
|
|
25
|
+
};
|
|
26
|
+
export const FormTimePicker = (props) => {
|
|
27
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
28
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
29
|
+
props = { ...props, error };
|
|
30
|
+
return _jsx(FormTimePickerWithoutValidation, { ...props });
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
formName?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
defaultValue?: boolean;
|
|
7
|
+
helpText?: string;
|
|
8
|
+
onChange?: (value: boolean) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const YesNo: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default YesNo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const YesNo = (props) => {
|
|
5
|
+
const { id, name, title, defaultValue = false, helpText, onChange, disabled, } = props;
|
|
6
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
7
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
8
|
+
const [value, setValue] = useState(defaultValue);
|
|
9
|
+
const color = error ? "red" : "gray";
|
|
10
|
+
const handleOnChange = () => {
|
|
11
|
+
if (disabled)
|
|
12
|
+
return; // No hacer nada si está deshabilitado
|
|
13
|
+
const newValue = !value;
|
|
14
|
+
setValue(newValue);
|
|
15
|
+
onChange && onChange(newValue);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsxs("label", { className: `relative inline-flex items-center cursor-pointer ${disabled ? "opacity-50" : ""}`, children: [_jsx("input", { type: "checkbox", id: id ?? name, name: name, checked: value, value: value.toString(), className: "sr-only peer", onChange: handleOnChange, disabled: disabled }), value.toString() === "false" && (_jsx("input", { type: "hidden", name: name, value: "false" })), _jsx("div", { className: "w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600" }), _jsx("span", { className: "ml-3 text-sm font-medium text-gray-900", children: title })] }), error && (_jsxs("p", { className: `mt-2 text-sm text-${color}-600 dark:text-${color}-500`, children: [_jsx("span", { className: "font-medium", children: "Oops!" }), " ", error] })), !error && helpText && (_jsx("p", { className: `mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`, children: helpText }))] }));
|
|
18
|
+
};
|
|
19
|
+
export default YesNo;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./Checkbox";
|
|
2
|
+
export * from "./Checklist";
|
|
3
|
+
export * from "./DatePicker";
|
|
4
|
+
export * from "./DynamicBaculoForm";
|
|
5
|
+
export * from "./FieldContainer";
|
|
6
|
+
export * from "./FileUpload";
|
|
7
|
+
export * from "./FormButtons";
|
|
8
|
+
export * from "./FormLayout";
|
|
9
|
+
export * from "./SelectField";
|
|
10
|
+
export * from "./TextArea";
|
|
11
|
+
export * from "./TextField";
|
|
12
|
+
export * from "./TimePicker";
|
|
13
|
+
export * from "./YesNo";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./Checkbox";
|
|
2
|
+
export * from "./Checklist";
|
|
3
|
+
export * from "./DatePicker";
|
|
4
|
+
export * from "./DynamicBaculoForm";
|
|
5
|
+
export * from "./FieldContainer";
|
|
6
|
+
export * from "./FileUpload";
|
|
7
|
+
export * from "./FormButtons";
|
|
8
|
+
export * from "./FormLayout";
|
|
9
|
+
export * from "./SelectField";
|
|
10
|
+
export * from "./TextArea";
|
|
11
|
+
export * from "./TextField";
|
|
12
|
+
export * from "./TimePicker";
|
|
13
|
+
export * from "./YesNo";
|
package/dist/NavBar/NavBar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { DropDownArrowSvgIcon, LogoutDropDownSvgIcon, MenuAlt4Svg, OpcionButtonSvgIcon, } from "
|
|
3
|
+
import { DropDownArrowSvgIcon, LogoutDropDownSvgIcon, MenuAlt4Svg, OpcionButtonSvgIcon, } from "@zauru-sdk/icons";
|
|
4
4
|
import { COLORS } from "./NavBar.utils";
|
|
5
5
|
import { Link } from "@remix-run/react";
|
|
6
6
|
const DropDownLinkButton = ({ text, path, icon, buttonHover, }) => (_jsx(Link, { className: `block px-4 py-3 text-sm text-gray-600 capitalize transition-colors duration-200 transform dark:text-gray-300 ${buttonHover ?? ""} dark:hover:bg-gray-700 dark:hover:text-white`, to: path, prefetch: "none", children: _jsxs("div", { className: "mx-auto pt-2", children: [icon, _jsx("span", { children: text })] }) }));
|
|
@@ -28,5 +28,5 @@ export const NavBar = ({ title, loggedIn, items, selectedColor, }) => {
|
|
|
28
28
|
.map((item, index) => {
|
|
29
29
|
return (_jsx(NavItem, { name: item.name, link: item.link, icon: item.icon, color: color }, index));
|
|
30
30
|
})) })] }));
|
|
31
|
-
return (_jsx("nav", { className: `py-3 ${color.bg600}`, children: _jsxs("div", { className: "flex items-center justify-between ml-5 mr-5", children: [_jsxs("div", { className: "flex justify-between w-full lg:w-auto", children: [_jsx(Link, { className: "text-sm font-bold leading-relaxed inline-block mr-4 py-2 whitespace-nowrap uppercase text-white", to: "/home", prefetch: "none", children: _jsxs(_Fragment, { children: [_jsx("div", { className: "inline-block mr-2 mb-2 align-middle", children: _jsx("img", { className: "w-auto h-7", src: "/logo.png", alt: "logo-zauru" }) }), title] }) }), _jsx("button", { className: `rounded lg:hidden focus:outline-none focus:ring focus:${color.ring600} focus:ring-opacity-50`, "aria-label": "Toggle mobile menu", type: "button", onClick: () => setNavBarOpen(!NavBarOpen), children: _jsx(MenuAlt4Svg, {
|
|
31
|
+
return (_jsx("nav", { className: `py-3 ${color.bg600}`, children: _jsxs("div", { className: "flex items-center justify-between ml-5 mr-5", children: [_jsxs("div", { className: "flex justify-between w-full lg:w-auto", children: [_jsx(Link, { className: "text-sm font-bold leading-relaxed inline-block mr-4 py-2 whitespace-nowrap uppercase text-white", to: "/home", prefetch: "none", children: _jsxs(_Fragment, { children: [_jsx("div", { className: "inline-block mr-2 mb-2 align-middle", children: _jsx("img", { className: "w-auto h-7", src: "/logo.png", alt: "logo-zauru" }) }), title] }) }), _jsx("button", { className: `rounded lg:hidden focus:outline-none focus:ring focus:${color.ring600} focus:ring-opacity-50`, "aria-label": "Toggle mobile menu", type: "button", onClick: () => setNavBarOpen(!NavBarOpen), children: _jsx(MenuAlt4Svg, { open: NavBarOpen }) })] }), _jsx("div", { className: `lg:hidden absolute top-0 left-0 z-50 w-64 h-full ${color.bg700} shadow-lg transform ${NavBarOpen ? "translate-x-0" : "-translate-x-full"} transition-transform duration-300 ease-in-out`, children: options }), _jsx("div", { className: "hidden lg:flex w-full lg:w-auto", children: options })] }) }));
|
|
32
32
|
};
|
package/dist/Table/ZauruTable.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useSearchParams } from "@remix-run/react";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import DataTable, { createTheme } from "react-data-table-component";
|
|
5
|
-
import { SearchSVG } from "
|
|
5
|
+
import { SearchSVG } from "@zauru-sdk/icons";
|
|
6
6
|
const customStyles = {
|
|
7
7
|
headCells: {
|
|
8
8
|
style: {
|
package/dist/Zendesk/Chat.d.ts
CHANGED
package/dist/Zendesk/Chat.js
CHANGED
|
@@ -23,7 +23,7 @@ export const ZendeskAPI = (...args) => {
|
|
|
23
23
|
console.warn("Zendesk is not initialized yet");
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const Zendesk = (props) => {
|
|
27
27
|
const { defer, configuration, token, ...other } = props;
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
const insertScript = () => {
|
|
@@ -61,3 +61,4 @@ export const Zendesk = (props) => {
|
|
|
61
61
|
}, [props, defer, other, configuration, token]);
|
|
62
62
|
return null;
|
|
63
63
|
};
|
|
64
|
+
export default Zendesk;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ export * from "./Alerts";
|
|
|
2
2
|
export * from "./BlockUI";
|
|
3
3
|
export * from "./Buttons";
|
|
4
4
|
export * from "./Card";
|
|
5
|
+
export * from "./ConnectionState";
|
|
6
|
+
export * from "./Chat";
|
|
5
7
|
export * from "./Containers";
|
|
6
8
|
export * from "./Footer";
|
|
9
|
+
export * from "./Form";
|
|
7
10
|
export * from "./Labels";
|
|
8
11
|
export * from "./Layouts";
|
|
9
12
|
export * from "./LineSeparator";
|
|
@@ -17,3 +20,4 @@ export * from "./Titles";
|
|
|
17
20
|
export * from "./Tooltip";
|
|
18
21
|
export * from "./WithTooltip";
|
|
19
22
|
export * from "./Wizards";
|
|
23
|
+
export * from "./Zendesk";
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,11 @@ export * from "./Alerts";
|
|
|
2
2
|
export * from "./BlockUI";
|
|
3
3
|
export * from "./Buttons";
|
|
4
4
|
export * from "./Card";
|
|
5
|
-
|
|
5
|
+
export * from "./ConnectionState";
|
|
6
|
+
export * from "./Chat";
|
|
6
7
|
export * from "./Containers";
|
|
7
8
|
export * from "./Footer";
|
|
9
|
+
export * from "./Form";
|
|
8
10
|
export * from "./Labels";
|
|
9
11
|
export * from "./Layouts";
|
|
10
12
|
export * from "./LineSeparator";
|
|
@@ -18,4 +20,4 @@ export * from "./Titles";
|
|
|
18
20
|
export * from "./Tooltip";
|
|
19
21
|
export * from "./WithTooltip";
|
|
20
22
|
export * from "./Wizards";
|
|
21
|
-
|
|
23
|
+
export * from "./Zendesk";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Componentes reutilizables en las WebApps de Zauru.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"author": "Oscar Cuéllar",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"devDependencies": {
|
|
18
|
+
"@types/jsonwebtoken": "^9.0.2",
|
|
18
19
|
"@types/react": "^18.2.20",
|
|
19
20
|
"@types/react-dom": "^18.2.7",
|
|
20
21
|
"eslint": "^8.38.0",
|
|
@@ -31,13 +32,13 @@
|
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@reduxjs/toolkit": "^2.2.1",
|
|
33
34
|
"@remix-run/react": "^2.8.1",
|
|
34
|
-
"@zauru-sdk/common": "^1.0.
|
|
35
|
-
"@zauru-sdk/
|
|
36
|
-
"@zauru-sdk/
|
|
37
|
-
"@zauru-sdk/types": "^1.0.
|
|
38
|
-
"@zauru-sdk/utils": "^1.0.
|
|
35
|
+
"@zauru-sdk/common": "^1.0.13",
|
|
36
|
+
"@zauru-sdk/hooks": "^1.0.13",
|
|
37
|
+
"@zauru-sdk/icons": "^1.0.13",
|
|
38
|
+
"@zauru-sdk/types": "^1.0.13",
|
|
39
|
+
"@zauru-sdk/utils": "^1.0.13",
|
|
39
40
|
"framer-motion": "^11.0.8",
|
|
40
|
-
"jsonwebtoken": "9.0.2",
|
|
41
|
+
"jsonwebtoken": "^9.0.2",
|
|
41
42
|
"react": "^18.2.0",
|
|
42
43
|
"react-dom": "^18.2.0",
|
|
43
44
|
"react-is": "^18.2.0",
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"engines": {
|
|
48
49
|
"node": ">=18.0.0"
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "47cb7f76fbc0d2b66e4caf7294ed1cc067a19f0f"
|
|
51
52
|
}
|
package/src/Alerts/index.ts
CHANGED