@zauru-sdk/components 1.0.11 → 1.0.13

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/Alerts/index.d.ts +2 -0
  3. package/dist/Alerts/index.js +2 -0
  4. package/dist/BlockUI/BlockUI.d.ts +8 -0
  5. package/dist/BlockUI/BlockUI.js +8 -0
  6. package/dist/BlockUI/index.d.ts +1 -0
  7. package/dist/BlockUI/index.js +1 -0
  8. package/dist/Buttons/Button.d.ts +15 -0
  9. package/dist/Buttons/Button.js +43 -0
  10. package/dist/Buttons/index.d.ts +1 -0
  11. package/dist/Buttons/index.js +1 -0
  12. package/dist/Card/Card.d.ts +8 -0
  13. package/dist/Card/Card.js +5 -0
  14. package/dist/Card/index.d.ts +1 -0
  15. package/dist/Card/index.js +1 -0
  16. package/dist/Containers/BodyContainer.d.ts +6 -0
  17. package/dist/Containers/BodyContainer.js +5 -0
  18. package/dist/Containers/ButtonSectionContainer.d.ts +8 -0
  19. package/dist/Containers/ButtonSectionContainer.js +5 -0
  20. package/dist/Containers/Container.d.ts +10 -0
  21. package/dist/Containers/Container.js +6 -0
  22. package/dist/Containers/DoubleContainer.d.ts +9 -0
  23. package/dist/Containers/DoubleContainer.js +14 -0
  24. package/dist/Containers/MainContainer.d.ts +6 -0
  25. package/dist/Containers/MainContainer.js +5 -0
  26. package/dist/Containers/OutletContainer.d.ts +6 -0
  27. package/dist/Containers/OutletContainer.js +5 -0
  28. package/dist/Containers/SubContainer.d.ts +10 -0
  29. package/dist/Containers/SubContainer.js +6 -0
  30. package/dist/Containers/index.d.ts +7 -0
  31. package/dist/Containers/index.js +7 -0
  32. package/dist/Footer/Footer.d.ts +7 -0
  33. package/dist/Footer/Footer.js +25 -0
  34. package/dist/Footer/index.d.ts +1 -0
  35. package/dist/Footer/index.js +1 -0
  36. package/dist/Labels/InfoLabel/index.d.ts +7 -0
  37. package/dist/Labels/InfoLabel/index.js +5 -0
  38. package/dist/Labels/index.d.ts +1 -0
  39. package/dist/Labels/index.js +1 -0
  40. package/dist/Layouts/homeLayout/index.d.ts +6 -0
  41. package/dist/Layouts/homeLayout/index.js +10 -0
  42. package/dist/Layouts/index.d.ts +1 -0
  43. package/dist/Layouts/index.js +1 -0
  44. package/dist/LineSeparator/LineSeparator.d.ts +1 -0
  45. package/dist/LineSeparator/LineSeparator.js +4 -0
  46. package/dist/LineSeparator/index.d.ts +1 -0
  47. package/dist/LineSeparator/index.js +1 -0
  48. package/dist/Modal/Modal.d.ts +10 -0
  49. package/dist/Modal/Modal.js +32 -0
  50. package/dist/Modal/index.d.ts +1 -0
  51. package/dist/Modal/index.js +1 -0
  52. package/dist/NavBar/NavBar.js +2 -2
  53. package/dist/NavBar/index.d.ts +3 -0
  54. package/dist/NavBar/index.js +3 -0
  55. package/dist/ProgressBar/ProgressBar.d.ts +6 -0
  56. package/dist/ProgressBar/ProgressBar.js +5 -0
  57. package/dist/ProgressBar/ProgressCircle.d.ts +6 -0
  58. package/dist/ProgressBar/ProgressCircle.js +22 -0
  59. package/dist/ProgressBar/index.d.ts +2 -0
  60. package/dist/ProgressBar/index.js +2 -0
  61. package/dist/Skeletons/LoadingInputSkeleton.d.ts +1 -0
  62. package/dist/Skeletons/LoadingInputSkeleton.js +8 -0
  63. package/dist/Skeletons/index.d.ts +1 -0
  64. package/dist/Skeletons/index.js +1 -0
  65. package/dist/Tab/Tab.d.ts +9 -0
  66. package/dist/Tab/Tab.js +19 -0
  67. package/dist/Tab/index.d.ts +1 -0
  68. package/dist/Tab/index.js +1 -0
  69. package/dist/Table/ZauruTable.d.ts +25 -0
  70. package/dist/Table/ZauruTable.js +148 -0
  71. package/dist/Table/index.d.ts +1 -0
  72. package/dist/Table/index.js +1 -0
  73. package/dist/TaskList/TaskList.d.ts +14 -0
  74. package/dist/TaskList/TaskList.js +35 -0
  75. package/dist/TaskList/index.d.ts +1 -0
  76. package/dist/TaskList/index.js +1 -0
  77. package/dist/Titles/LabelArray.d.ts +4 -0
  78. package/dist/Titles/LabelArray.js +7 -0
  79. package/dist/Titles/TableColumnTitle.d.ts +4 -0
  80. package/dist/Titles/TableColumnTitle.js +5 -0
  81. package/dist/Titles/TitleH1.d.ts +1 -0
  82. package/dist/Titles/TitleH1.js +5 -0
  83. package/dist/Titles/TitleH2.d.ts +1 -0
  84. package/dist/Titles/TitleH2.js +5 -0
  85. package/dist/Titles/TitleH3.d.ts +1 -0
  86. package/dist/Titles/TitleH3.js +5 -0
  87. package/dist/Titles/index.d.ts +5 -0
  88. package/dist/Titles/index.js +5 -0
  89. package/dist/Tooltip/Tooltip.d.ts +7 -0
  90. package/dist/Tooltip/Tooltip.js +14 -0
  91. package/dist/Tooltip/index.d.ts +1 -0
  92. package/dist/Tooltip/index.js +1 -0
  93. package/dist/WithTooltip/WithTooltip.d.ts +7 -0
  94. package/dist/WithTooltip/WithTooltip.js +5 -0
  95. package/dist/WithTooltip/index.d.ts +1 -0
  96. package/dist/WithTooltip/index.js +1 -0
  97. package/dist/Wizards/StepWizard.d.ts +14 -0
  98. package/dist/Wizards/StepWizard.js +14 -0
  99. package/dist/Wizards/index.d.ts +1 -0
  100. package/dist/Wizards/index.js +1 -0
  101. package/dist/index.d.ts +19 -0
  102. package/dist/index.js +21 -1
  103. package/package.json +8 -5
  104. package/src/Alerts/index.ts +2 -0
  105. package/src/BlockUI/BlockUI.tsx +50 -0
  106. package/src/BlockUI/index.tsx +1 -0
  107. package/src/Buttons/Button.tsx +90 -0
  108. package/src/Buttons/index.ts +1 -0
  109. package/src/Card/Card.tsx +24 -0
  110. package/src/Card/index.ts +1 -0
  111. package/src/Containers/BodyContainer.tsx +14 -0
  112. package/src/Containers/ButtonSectionContainer.tsx +21 -0
  113. package/src/Containers/Container.tsx +39 -0
  114. package/src/Containers/DoubleContainer.tsx +48 -0
  115. package/src/Containers/MainContainer.tsx +17 -0
  116. package/src/Containers/OutletContainer.tsx +14 -0
  117. package/src/Containers/SubContainer.tsx +37 -0
  118. package/src/Containers/index.ts +7 -0
  119. package/src/Footer/Footer.tsx +61 -0
  120. package/src/Footer/index.tsx +1 -0
  121. package/src/Labels/InfoLabel/index.tsx +21 -0
  122. package/src/Labels/index.tsx +1 -0
  123. package/src/Layouts/homeLayout/index.tsx +34 -0
  124. package/src/Layouts/index.ts +1 -0
  125. package/src/LineSeparator/LineSeparator.tsx +3 -0
  126. package/src/LineSeparator/index.tsx +1 -0
  127. package/src/Modal/Modal.tsx +104 -0
  128. package/src/Modal/index.tsx +1 -0
  129. package/src/NavBar/NavBar.tsx +2 -2
  130. package/src/NavBar/index.tsx +5 -0
  131. package/src/ProgressBar/ProgressBar.tsx +25 -0
  132. package/src/ProgressBar/ProgressCircle.tsx +75 -0
  133. package/src/ProgressBar/index.tsx +2 -0
  134. package/src/Skeletons/LoadingInputSkeleton.tsx +12 -0
  135. package/src/Skeletons/index.ts +1 -0
  136. package/src/Tab/Tab.tsx +63 -0
  137. package/src/Tab/index.ts +1 -0
  138. package/src/Table/ZauruTable.tsx +263 -0
  139. package/src/Table/index.tsx +1 -0
  140. package/src/TaskList/TaskList.tsx +88 -0
  141. package/src/TaskList/index.ts +1 -0
  142. package/src/Titles/LabelArray.tsx +17 -0
  143. package/src/Titles/TableColumnTitle.tsx +9 -0
  144. package/src/Titles/TitleH1.tsx +11 -0
  145. package/src/Titles/TitleH2.tsx +10 -0
  146. package/src/Titles/TitleH3.tsx +10 -0
  147. package/src/Titles/index.ts +5 -0
  148. package/src/Tooltip/Tooltip.tsx +42 -0
  149. package/src/Tooltip/index.ts +1 -0
  150. package/src/WithTooltip/WithTooltip.tsx +21 -0
  151. package/src/WithTooltip/index.tsx +1 -0
  152. package/src/Wizards/StepWizard.tsx +88 -0
  153. package/src/Wizards/index.ts +1 -0
  154. package/src/index.ts +21 -0
  155. package/dist/Alerts/Alert.d.ts +0 -9
  156. package/dist/Alerts/Alert.js +0 -97
  157. package/dist/Icons/Icons.d.ts +0 -47
  158. package/dist/Icons/Icons.js +0 -110
  159. package/dist/Icons/StylesConstants.d.ts +0 -26
  160. package/dist/Icons/StylesConstants.js +0 -34
  161. package/src/Alerts/Alert.tsx +0 -149
  162. package/src/Icons/Icons.tsx +0 -782
  163. package/src/Icons/StylesConstants.tsx +0 -66
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ title?: string;
6
+ className?: string;
7
+ };
8
+
9
+ export const Card = (props: Props) => {
10
+ const { children, title, className } = props;
11
+
12
+ return (
13
+ <div
14
+ className={`p-4 space-y-3 shadow sm:overflow-hidden sm:rounded-md ${className}`}
15
+ >
16
+ {title && (
17
+ <label className="inline text-lg font-medium text-gray-700">
18
+ {`${title.toUpperCase()}`}
19
+ </label>
20
+ )}
21
+ {children}
22
+ </div>
23
+ );
24
+ };
@@ -0,0 +1 @@
1
+ export * from "./Card";
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ };
6
+
7
+ export const BodyContainer = (props: Props) => {
8
+ const { children } = props;
9
+ return (
10
+ <>
11
+ <body className="flex flex-col min-h-screen m-0">{children}</body>
12
+ </>
13
+ );
14
+ };
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ whitBg?: boolean;
7
+ };
8
+
9
+ export const ButtonSectionContainer = (props: Props) => {
10
+ const { children, className, whitBg = true } = props;
11
+
12
+ return (
13
+ <div
14
+ className={`${
15
+ whitBg ? "bg-gray-50" : ""
16
+ } px-4 py-3 text-right sm:px-6 ${className}`}
17
+ >
18
+ {children}
19
+ </div>
20
+ );
21
+ };
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ title?: string;
5
+ description?: string;
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ rightContent?: React.ReactNode;
9
+ };
10
+
11
+ export const Container = (props: Props) => {
12
+ const { title, description, children, className = "", rightContent } = props;
13
+
14
+ const titleInfo = (
15
+ <>
16
+ {title && (
17
+ <h3 className="text-3xl font-bold leading-8 text-gray-900">{title}</h3>
18
+ )}
19
+ {description && (
20
+ <p className="mt-1 text-md text-gray-600">{description}</p>
21
+ )}
22
+ </>
23
+ );
24
+
25
+ return (
26
+ <>
27
+ <div className={`mx-2 ${className}`}>
28
+ {rightContent && (
29
+ <div className="flex justify-between items-center">
30
+ <div>{titleInfo}</div>
31
+ <div>{rightContent}</div>
32
+ </div>
33
+ )}
34
+ {!rightContent && titleInfo}
35
+ <div className="mt-5 space-y-5">{children}</div>
36
+ </div>
37
+ </>
38
+ );
39
+ };
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ title?: string;
5
+ description?: string;
6
+ className?: string;
7
+ children: React.ReactNode;
8
+ };
9
+
10
+ export const DoubleContainer = (props: Props) => {
11
+ const { title, description, className = "", children } = props;
12
+
13
+ const getChildren = (index: number) => {
14
+ if (children && Array.isArray(children) && children[index]) {
15
+ return children[index];
16
+ }
17
+
18
+ if (children && index === 0) {
19
+ return children;
20
+ }
21
+
22
+ return <></>;
23
+ };
24
+
25
+ return (
26
+ <>
27
+ <div className={`mx-2 ${className}`}>
28
+ {/* Font sizes https://tailwindcss.com/docs/font-size */}
29
+ {title && (
30
+ <h3 className="text-3xl font-bold leading-8 text-gray-900">
31
+ {title}
32
+ </h3>
33
+ )}
34
+ {description && (
35
+ <p className="mt-1 text-md text-gray-600">{description}</p>
36
+ )}
37
+ <div className="grid xl:grid-cols-3 md:grid-cols-1 gap-4">
38
+ <div className="xl:col-span-2 md:col-span-1 mt-5">
39
+ {getChildren(0)}
40
+ </div>
41
+ <div className="xl:col-span-1 md:col-span-1 mt-5">
42
+ {getChildren(1)}
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </>
47
+ );
48
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ };
6
+
7
+ export const MainContainer = (props: Props) => {
8
+ const { children } = props;
9
+
10
+ return (
11
+ <>
12
+ <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">
13
+ {children}
14
+ </div>
15
+ </>
16
+ );
17
+ };
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ };
6
+
7
+ export const OutletContainer = (props: Props) => {
8
+ const { children } = props;
9
+ return (
10
+ <>
11
+ <div className="flex-1 overflow-x-auto">{children}</div>
12
+ </>
13
+ );
14
+ };
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ title?: string;
5
+ description?: string;
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ rightContent?: React.ReactNode;
9
+ };
10
+
11
+ export const SubContainer = (props: Props) => {
12
+ const { title, description, children, className = "", rightContent } = props;
13
+
14
+ const titleInfo = (
15
+ <>
16
+ {title && (
17
+ <h3 className="text-xl font-bold leading-8 text-gray-900">{title}</h3>
18
+ )}
19
+ {description && (
20
+ <p className="mt-1 text-md text-gray-600">{description}</p>
21
+ )}
22
+ </>
23
+ );
24
+
25
+ return (
26
+ <div className={`${className}`}>
27
+ {rightContent && (
28
+ <div className="flex justify-between items-center">
29
+ <div>{titleInfo}</div>
30
+ <div>{rightContent}</div>
31
+ </div>
32
+ )}
33
+ {!rightContent && titleInfo}
34
+ <div className="mt-5 space-y-3">{children}</div>
35
+ </div>
36
+ );
37
+ };
@@ -0,0 +1,7 @@
1
+ export * from "./BodyContainer";
2
+ export * from "./ButtonSectionContainer";
3
+ export * from "./Container";
4
+ export * from "./DoubleContainer";
5
+ export * from "./MainContainer";
6
+ export * from "./OutletContainer";
7
+ export * from "./SubContainer";
@@ -0,0 +1,61 @@
1
+ import React, { useEffect, useState } from "react";
2
+ //import ConnectionState from "../ConnectionState";
3
+ import { LoadingInputSkeleton } from "src";
4
+
5
+ type FooterProps = {
6
+ href: string;
7
+ showConnection?: boolean;
8
+ selectedColor:
9
+ | "purple"
10
+ | "pink"
11
+ | "indigo"
12
+ | "cyan"
13
+ | "slate"
14
+ | "green"
15
+ | "red"
16
+ | "sky";
17
+ };
18
+
19
+ const COLORS = {
20
+ purple: "bg-purple-500",
21
+ pink: "bg-pink-500",
22
+ indigo: "bg-indigo-500",
23
+ cyan: "bg-cyan-500",
24
+ slate: "bg-slate-500",
25
+ green: "bg-green-500",
26
+ red: "bg-red-500",
27
+ sky: "bg-sky-500",
28
+ };
29
+
30
+ export const Footer = ({
31
+ href,
32
+ selectedColor,
33
+ showConnection = false,
34
+ }: FooterProps) => {
35
+ const [client, setIsClient] = useState(false);
36
+ const color = COLORS[selectedColor];
37
+
38
+ useEffect(() => {
39
+ setIsClient(true);
40
+ }, []);
41
+
42
+ if (!client) {
43
+ return <LoadingInputSkeleton />;
44
+ }
45
+
46
+ return (
47
+ <footer className={`inset-x-0 bottom-0 px-2 py-[20px] ${color}`}>
48
+ <div className="px-4 mx-auto flex flex-wrap items-center justify-center">
49
+ <p className="text-white text-[1.2rem]">
50
+ {`Creado en `} <a href={href}>Zauru</a>{" "}
51
+ {`con ❤️ ${new Date().getFullYear()} v.3.2`}
52
+ </p>
53
+ {/* {showConnection && (
54
+ <div className="ml-5">
55
+ <ConnectionState />
56
+ </div>
57
+ )} */}
58
+ </div>
59
+ </footer>
60
+ );
61
+ };
@@ -0,0 +1 @@
1
+ export * from "./Footer";
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ description: string;
5
+ title: string;
6
+ className?: string;
7
+ };
8
+
9
+ export const InfoLabel = (props: Props) => {
10
+ const { description, title, className } = props;
11
+ return (
12
+ <div className={`block ${className}`}>
13
+ <label className="inline text-sm font-medium text-gray-700">
14
+ {`${title.toUpperCase()} `}
15
+ </label>
16
+ <label className="inline text-sm font-medium text-gray-500">
17
+ {description}
18
+ </label>
19
+ </div>
20
+ );
21
+ };
@@ -0,0 +1 @@
1
+ export * from "./InfoLabel";
@@ -0,0 +1,34 @@
1
+ type Props = {
2
+ title?: string;
3
+ description?: string;
4
+ };
5
+
6
+ export const HomeLayout = ({ title, description }: Props) => {
7
+ return (
8
+ <div
9
+ className="bg-cover bg-center h-screen"
10
+ style={{ backgroundImage: 'url("/wallpaper.webp")' }}
11
+ >
12
+ <div className="flex flex-col h-screen justify-center items-center">
13
+ <h1
14
+ className="text-6xl md:text-7xl lg:text-8xl text-white font-bold mb-6 text-center"
15
+ style={{
16
+ textShadow: "0.5px 0.5px 1px #000000",
17
+ WebkitTextStroke: "2px #000000",
18
+ }}
19
+ >
20
+ {title ?? <>Bienvenido, inicie sesión para continuar.</>}
21
+ </h1>
22
+ <p
23
+ className="text-xl md:text-2xl lg:text-3xl text-white text-center max-w-md mb-12"
24
+ style={{
25
+ textShadow: "0.5px 0.5px 1px #000000",
26
+ WebkitTextStroke: "1px #000000",
27
+ }}
28
+ >
29
+ {description ?? <>Web app, realizada en Zauru.</>}
30
+ </p>
31
+ </div>
32
+ </div>
33
+ );
34
+ };
@@ -0,0 +1 @@
1
+ export * from "./homeLayout";
@@ -0,0 +1,3 @@
1
+ export const LineSeparator = () => {
2
+ return <hr className="h-px my-8 bg-gray-200 border-0 dark:bg-gray-400"></hr>;
3
+ };
@@ -0,0 +1 @@
1
+ export * from "./LineSeparator";
@@ -0,0 +1,104 @@
1
+ import React from "react";
2
+ import { createRoot } from "react-dom/client";
3
+
4
+ export type ModalOption = "OK" | "CANCEL" | null;
5
+
6
+ type ModalParams = {
7
+ title: string;
8
+ description: React.ReactNode;
9
+ okButtonText?: string;
10
+ showOptions?: boolean;
11
+ };
12
+
13
+ export const createModal = ({
14
+ title,
15
+ description,
16
+ okButtonText,
17
+ showOptions = true,
18
+ }: ModalParams): Promise<ModalOption> => {
19
+ return new Promise((resolve) => {
20
+ const handleClose = () => {
21
+ resolve(null);
22
+ removeModal();
23
+ };
24
+
25
+ const handleOk = () => {
26
+ resolve("OK");
27
+ removeModal();
28
+ };
29
+
30
+ const handleCancel = () => {
31
+ resolve("CANCEL");
32
+ removeModal();
33
+ };
34
+
35
+ const removeModal = () => {
36
+ document.body.removeChild(modalWrapper);
37
+ document.body.removeChild(modalOverlay);
38
+ };
39
+
40
+ const modalWrapper = document.createElement("div");
41
+ modalWrapper.classList.add(
42
+ "justify-center",
43
+ "items-center",
44
+ "flex",
45
+ "overflow-x-hidden",
46
+ "overflow-y-auto",
47
+ "fixed",
48
+ "inset-0",
49
+ "z-50",
50
+ "outline-none",
51
+ "focus:outline-none"
52
+ );
53
+
54
+ // Crear capa de fondo detrás del modal
55
+ const modalOverlay = document.createElement("div");
56
+ modalOverlay.classList.add(
57
+ "fixed",
58
+ "inset-0",
59
+ "bg-black",
60
+ "opacity-50",
61
+ "z-40"
62
+ );
63
+
64
+ document.body.appendChild(modalOverlay);
65
+ document.body.appendChild(modalWrapper);
66
+
67
+ const ModalContent = () => (
68
+ <div className="relative w-auto my-6 mx-auto max-w-3xl">
69
+ <div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none">
70
+ <div className="flex items-start justify-between p-5 border-b border-solid border-slate-200 rounded-t">
71
+ <h3 className="text-3xl font-semibold">{title}</h3>
72
+ <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">
73
+ <span className="close-button" onClick={handleClose}>
74
+ &times;
75
+ </span>
76
+ </button>
77
+ </div>
78
+ <div className="relative p-6 flex-auto">{description}</div>
79
+ {showOptions && (
80
+ <div className="flex items-center justify-end p-6 border-t border-solid border-slate-200 rounded-b">
81
+ <button
82
+ 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"
83
+ type="button"
84
+ onClick={handleCancel}
85
+ >
86
+ Cancelar
87
+ </button>
88
+ <button
89
+ 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"
90
+ type="button"
91
+ onClick={handleOk}
92
+ >
93
+ {okButtonText ?? "Aceptar"}
94
+ </button>
95
+ </div>
96
+ )}
97
+ </div>
98
+ </div>
99
+ );
100
+
101
+ const root = createRoot(modalWrapper);
102
+ root.render(<ModalContent />);
103
+ });
104
+ };
@@ -0,0 +1 @@
1
+ export * from "./Modal";
@@ -4,7 +4,7 @@ import {
4
4
  LogoutDropDownSvgIcon,
5
5
  MenuAlt4Svg,
6
6
  OpcionButtonSvgIcon,
7
- } from "../Icons/Icons";
7
+ } from "@zauru-sdk/icons";
8
8
  import { COLORS } from "./NavBar.utils";
9
9
  import type {
10
10
  ColorInterface,
@@ -202,7 +202,7 @@ export const NavBar = ({
202
202
  type="button"
203
203
  onClick={() => setNavBarOpen(!NavBarOpen)}
204
204
  >
205
- <MenuAlt4Svg NavBarOpen={NavBarOpen} setNavBarOpen={undefined} />
205
+ <MenuAlt4Svg open={NavBarOpen} />
206
206
  </button>
207
207
  </div>
208
208
  {/* Menú para dispositivos móviles */}
@@ -0,0 +1,5 @@
1
+ export * from "./NavBar";
2
+
3
+ export * from "./NavBar.types";
4
+
5
+ export * from "./NavBar.utils";
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ title?: string;
5
+ percent?: string;
6
+ };
7
+
8
+ export const ProgressBar = (props: Props) => {
9
+ const { title, percent } = props;
10
+ return (
11
+ <>
12
+ {percent && (
13
+ <>
14
+ {title && <div className="mb-1 text-lg font-medium">{title}</div>}
15
+ <div className="w-full h-6 bg-gray-200 rounded-full">
16
+ <div
17
+ className="h-6 bg-blue-600 rounded-full"
18
+ style={{ width: `${percent}%` }}
19
+ ></div>
20
+ </div>
21
+ </>
22
+ )}
23
+ </>
24
+ );
25
+ };
@@ -0,0 +1,75 @@
1
+ import React, { useEffect, useState } from "react";
2
+
3
+ export const ProgressCircle = ({
4
+ total,
5
+ completed,
6
+ description,
7
+ title,
8
+ }: {
9
+ total: number;
10
+ completed: number;
11
+ description: string;
12
+ title?: string;
13
+ }) => {
14
+ const [percentage, setPercentage] = useState(0);
15
+ const strokeDasharray = 2 * Math.PI * 42; // radio del circulo
16
+ const progressColor = `rgba(${255 - 2.55 * percentage}, ${
17
+ 2.55 * percentage
18
+ }, 0)`;
19
+
20
+ useEffect(() => {
21
+ if (total > 0) {
22
+ setPercentage((completed / total) * 100);
23
+ } else {
24
+ setPercentage(100);
25
+ }
26
+ }, [total, completed]);
27
+
28
+ return (
29
+ <div className="flex flex-col items-center justify-center">
30
+ {title && (
31
+ <h2 className="mb-4 text-xl text-center text-gray-700">{title}</h2>
32
+ )}
33
+ <svg width="100" height="100" className="relative">
34
+ <circle
35
+ r="42"
36
+ cx="50"
37
+ cy="50"
38
+ fill="transparent"
39
+ stroke="#eee"
40
+ strokeWidth="8"
41
+ />
42
+ <circle
43
+ r="42"
44
+ cx="50"
45
+ cy="50"
46
+ fill="transparent"
47
+ stroke={progressColor}
48
+ strokeWidth="8"
49
+ strokeDasharray={strokeDasharray}
50
+ strokeDashoffset={
51
+ strokeDasharray - strokeDasharray * (percentage / 100)
52
+ }
53
+ strokeLinecap="round"
54
+ style={{
55
+ transform: "rotate(-90deg)",
56
+ transformOrigin: "50% 50%",
57
+ }}
58
+ />
59
+ <text
60
+ x="50"
61
+ y="55"
62
+ textAnchor="middle"
63
+ fill={progressColor}
64
+ style={{
65
+ fontSize: "16px",
66
+ fontWeight: "bold",
67
+ }}
68
+ >
69
+ {`${Math.round(percentage)}%`}
70
+ </text>
71
+ </svg>
72
+ <p className="mt-2 text-center text-gray-500">{description}</p>
73
+ </div>
74
+ );
75
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./ProgressBar";
2
+ export * from "./ProgressCircle";
@@ -0,0 +1,12 @@
1
+ export const LoadingInputSkeleton = () => {
2
+ return (
3
+ <div
4
+ className="w-full h-full bg-gray-300 animate-pulse rounded"
5
+ style={{
6
+ maxWidth: "100%",
7
+ height: "40px",
8
+ boxShadow: "0px 0px 0px 1px rgba(0, 0, 0, 0.1)",
9
+ }}
10
+ />
11
+ );
12
+ };
@@ -0,0 +1 @@
1
+ export * from "./LoadingInputSkeleton";