@zauru-sdk/components 1.0.54 → 1.0.61
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 +56 -0
- package/LICENCE.md +11 -11
- package/package.json +7 -7
- package/src/Alerts/ErrorBoundaryAlert/ErrorBoundaryAlert.tsx +66 -66
- package/src/Alerts/StaticAlert.tsx +121 -121
- package/src/Alerts/index.ts +2 -2
- package/src/BlockUI/BlockUI.tsx +50 -50
- package/src/BlockUI/index.tsx +1 -1
- package/src/Buttons/Button.tsx +90 -90
- package/src/Buttons/index.ts +1 -1
- package/src/Card/Card.tsx +24 -24
- package/src/Card/index.ts +1 -1
- package/src/Chat/ChatLayout.tsx +131 -131
- package/src/Chat/ChatMessageHistory.tsx +142 -142
- package/src/Chat/index.ts +2 -2
- package/src/ConnectionState/ConnectionState.tsx +27 -27
- package/src/ConnectionState/index.tsx +1 -1
- package/src/Containers/BodyContainer.tsx +14 -14
- package/src/Containers/ButtonSectionContainer.tsx +21 -21
- package/src/Containers/Container.tsx +39 -39
- package/src/Containers/DoubleContainer.tsx +48 -48
- package/src/Containers/MainContainer.tsx +17 -17
- package/src/Containers/OutletContainer.tsx +14 -14
- package/src/Containers/SubContainer.tsx +37 -37
- package/src/Containers/index.ts +7 -7
- package/src/DynamicTable/BasicPrintDynamicTable.tsx +73 -73
- package/src/DynamicTable/DynamicPrintTable.tsx +288 -288
- package/src/DynamicTable/DynamicTable.tsx +405 -405
- package/src/DynamicTable/GenericDynamicTable.tsx +456 -456
- package/src/DynamicTable/index.tsx +4 -4
- package/src/Footer/Footer.tsx +50 -50
- package/src/Footer/index.tsx +1 -1
- package/src/Form/Checkbox/index.tsx +96 -96
- package/src/Form/Checklist/index.tsx +35 -35
- package/src/Form/DatePicker/index.tsx +132 -132
- package/src/Form/DynamicBaculoForm/index.tsx +361 -361
- package/src/Form/FieldContainer/DoubleFieldContainer.tsx +35 -35
- package/src/Form/FieldContainer/QuadrupleFieldContainer.tsx +36 -36
- package/src/Form/FieldContainer/TripleFieldContainer.tsx +35 -35
- package/src/Form/FieldContainer/index.ts +3 -3
- package/src/Form/FileUpload/index.tsx +184 -184
- package/src/Form/FormButtons/index.tsx +78 -78
- package/src/Form/FormLayout/index.tsx +37 -37
- package/src/Form/SelectField/index.tsx +237 -237
- package/src/Form/TextArea/index.tsx +125 -125
- package/src/Form/TextField/index.tsx +194 -194
- package/src/Form/TimePicker/index.tsx +127 -127
- package/src/Form/YesNo/index.tsx +77 -77
- package/src/Form/index.ts +13 -13
- package/src/Labels/InfoLabel/index.tsx +21 -21
- package/src/Labels/index.tsx +1 -1
- package/src/Layouts/homeLayout/index.tsx +34 -34
- package/src/Layouts/index.ts +1 -1
- package/src/LineSeparator/LineSeparator.tsx +3 -3
- package/src/LineSeparator/index.tsx +1 -1
- package/src/Modal/Modal.tsx +104 -104
- package/src/Modal/index.tsx +1 -1
- package/src/NavBar/NavBar.tsx +223 -223
- package/src/NavBar/NavBar.types.ts +64 -64
- package/src/NavBar/NavBar.utils.ts +58 -58
- package/src/NavBar/index.tsx +5 -5
- package/src/ProgressBar/ProgressBar.tsx +25 -25
- package/src/ProgressBar/ProgressCircle.tsx +75 -75
- package/src/ProgressBar/index.tsx +2 -2
- package/src/Skeletons/LoadingInputSkeleton.tsx +12 -12
- package/src/Skeletons/index.ts +1 -1
- package/src/Tab/Tab.tsx +63 -63
- package/src/Tab/index.ts +1 -1
- package/src/Table/ZauruTable.tsx +265 -265
- package/src/Table/index.tsx +1 -1
- package/src/TaskList/TaskList.tsx +88 -88
- package/src/TaskList/index.ts +1 -1
- package/src/Titles/LabelArray.tsx +17 -17
- package/src/Titles/TableColumnTitle.tsx +9 -9
- package/src/Titles/TitleH1.tsx +10 -10
- package/src/Titles/TitleH2.tsx +10 -10
- package/src/Titles/TitleH3.tsx +10 -10
- package/src/Titles/index.ts +5 -5
- package/src/Tooltip/Tooltip.tsx +42 -42
- package/src/Tooltip/index.ts +1 -1
- package/src/WithTooltip/WithTooltip.tsx +21 -21
- package/src/WithTooltip/index.tsx +1 -1
- package/src/Wizards/StepWizard.tsx +88 -88
- package/src/Wizards/index.ts +1 -1
- package/src/Zendesk/Chat.tsx +83 -83
- package/src/Zendesk/index.ts +2 -2
- package/src/Zendesk/zendesk.config.ts +40 -40
- package/src/index.ts +24 -24
- package/src/postcss.config.mjs +5 -5
- package/src/tailwind.config.ts +10 -10
- package/src/tailwind.css +3 -3
- package/tsconfig.cjs.json +8 -8
- package/tsconfig.esm.json +11 -11
- package/tsconfig.json +17 -17
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
export type TaskType = {
|
|
4
|
-
title: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
status: "waiting" | "processing" | "done" | "error";
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type TaskProps = {
|
|
10
|
-
task: TaskType;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const Task = ({ task }: TaskProps) => {
|
|
14
|
-
const [isDescriptionOpen, setIsDescriptionOpen] = useState(false);
|
|
15
|
-
let statusIcon;
|
|
16
|
-
let taskStyle = {};
|
|
17
|
-
let bgColor;
|
|
18
|
-
|
|
19
|
-
switch (task.status) {
|
|
20
|
-
case "waiting":
|
|
21
|
-
statusIcon = "🕗"; // Icono de reloj (como un ejemplo, puedes reemplazarlo con un ícono o SVG real)
|
|
22
|
-
taskStyle = { opacity: 0.5 }; // estilo disabled
|
|
23
|
-
bgColor = "bg-gray-200"; // Color de fondo gris
|
|
24
|
-
break;
|
|
25
|
-
case "processing":
|
|
26
|
-
statusIcon = "⏳"; // Icono de reloj de arena
|
|
27
|
-
taskStyle = { fontWeight: "bold" }; // estilo negrita
|
|
28
|
-
bgColor = "bg-blue-200"; // Color de fondo azul
|
|
29
|
-
break;
|
|
30
|
-
case "done":
|
|
31
|
-
statusIcon = "✅"; // Icono de check
|
|
32
|
-
bgColor = "bg-green-200"; // Color de fondo verde
|
|
33
|
-
break;
|
|
34
|
-
case "error":
|
|
35
|
-
statusIcon = "❌"; // Icono de cruz
|
|
36
|
-
taskStyle = { color: "red" }; // estilo color rojo
|
|
37
|
-
bgColor = "bg-red-200"; // Color de fondo rojo
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div
|
|
43
|
-
style={taskStyle}
|
|
44
|
-
className={`${bgColor} rounded-lg p-3 mb-3 ${
|
|
45
|
-
task.description ? "cursor-pointer" : ""
|
|
46
|
-
}`}
|
|
47
|
-
onClick={() =>
|
|
48
|
-
task.description && setIsDescriptionOpen(!isDescriptionOpen)
|
|
49
|
-
}
|
|
50
|
-
>
|
|
51
|
-
<div className="flex justify-between">
|
|
52
|
-
<div>
|
|
53
|
-
{statusIcon} {task.title}{" "}
|
|
54
|
-
{`${task.status === "processing" ? "..." : ""}`}
|
|
55
|
-
</div>
|
|
56
|
-
{task.description && <div>▼</div>}
|
|
57
|
-
</div>
|
|
58
|
-
{task.description && isDescriptionOpen && (
|
|
59
|
-
<div className="mt-2">{task.description}</div>
|
|
60
|
-
)}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
type TaskModalProps = {
|
|
66
|
-
tasks: TaskType[];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const TaskList = ({ tasks }: TaskModalProps) => {
|
|
70
|
-
const completedTasks = tasks.filter(
|
|
71
|
-
(task) => task.status === "done" || task.status === "error"
|
|
72
|
-
).length;
|
|
73
|
-
const progressPercentage = (completedTasks / tasks.length) * 100;
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<div>
|
|
77
|
-
{tasks.map((task, index) => (
|
|
78
|
-
<Task key={index} task={task} />
|
|
79
|
-
))}
|
|
80
|
-
<div className="h-2 bg-gray-200 rounded-lg mt-3">
|
|
81
|
-
<div
|
|
82
|
-
className="bg-green-500 h-full rounded-lg"
|
|
83
|
-
style={{ width: `${progressPercentage}%`, transition: "width 0.5s" }}
|
|
84
|
-
></div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
export type TaskType = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
status: "waiting" | "processing" | "done" | "error";
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type TaskProps = {
|
|
10
|
+
task: TaskType;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Task = ({ task }: TaskProps) => {
|
|
14
|
+
const [isDescriptionOpen, setIsDescriptionOpen] = useState(false);
|
|
15
|
+
let statusIcon;
|
|
16
|
+
let taskStyle = {};
|
|
17
|
+
let bgColor;
|
|
18
|
+
|
|
19
|
+
switch (task.status) {
|
|
20
|
+
case "waiting":
|
|
21
|
+
statusIcon = "🕗"; // Icono de reloj (como un ejemplo, puedes reemplazarlo con un ícono o SVG real)
|
|
22
|
+
taskStyle = { opacity: 0.5 }; // estilo disabled
|
|
23
|
+
bgColor = "bg-gray-200"; // Color de fondo gris
|
|
24
|
+
break;
|
|
25
|
+
case "processing":
|
|
26
|
+
statusIcon = "⏳"; // Icono de reloj de arena
|
|
27
|
+
taskStyle = { fontWeight: "bold" }; // estilo negrita
|
|
28
|
+
bgColor = "bg-blue-200"; // Color de fondo azul
|
|
29
|
+
break;
|
|
30
|
+
case "done":
|
|
31
|
+
statusIcon = "✅"; // Icono de check
|
|
32
|
+
bgColor = "bg-green-200"; // Color de fondo verde
|
|
33
|
+
break;
|
|
34
|
+
case "error":
|
|
35
|
+
statusIcon = "❌"; // Icono de cruz
|
|
36
|
+
taskStyle = { color: "red" }; // estilo color rojo
|
|
37
|
+
bgColor = "bg-red-200"; // Color de fondo rojo
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
style={taskStyle}
|
|
44
|
+
className={`${bgColor} rounded-lg p-3 mb-3 ${
|
|
45
|
+
task.description ? "cursor-pointer" : ""
|
|
46
|
+
}`}
|
|
47
|
+
onClick={() =>
|
|
48
|
+
task.description && setIsDescriptionOpen(!isDescriptionOpen)
|
|
49
|
+
}
|
|
50
|
+
>
|
|
51
|
+
<div className="flex justify-between">
|
|
52
|
+
<div>
|
|
53
|
+
{statusIcon} {task.title}{" "}
|
|
54
|
+
{`${task.status === "processing" ? "..." : ""}`}
|
|
55
|
+
</div>
|
|
56
|
+
{task.description && <div>▼</div>}
|
|
57
|
+
</div>
|
|
58
|
+
{task.description && isDescriptionOpen && (
|
|
59
|
+
<div className="mt-2">{task.description}</div>
|
|
60
|
+
)}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type TaskModalProps = {
|
|
66
|
+
tasks: TaskType[];
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const TaskList = ({ tasks }: TaskModalProps) => {
|
|
70
|
+
const completedTasks = tasks.filter(
|
|
71
|
+
(task) => task.status === "done" || task.status === "error"
|
|
72
|
+
).length;
|
|
73
|
+
const progressPercentage = (completedTasks / tasks.length) * 100;
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
{tasks.map((task, index) => (
|
|
78
|
+
<Task key={index} task={task} />
|
|
79
|
+
))}
|
|
80
|
+
<div className="h-2 bg-gray-200 rounded-lg mt-3">
|
|
81
|
+
<div
|
|
82
|
+
className="bg-green-500 h-full rounded-lg"
|
|
83
|
+
style={{ width: `${progressPercentage}%`, transition: "width 0.5s" }}
|
|
84
|
+
></div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
};
|
package/src/TaskList/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./TaskList.js";
|
|
1
|
+
export * from "./TaskList.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { SelectFieldOption } from "@zauru-sdk/types";
|
|
2
|
-
|
|
3
|
-
//Component to show all information in an array
|
|
4
|
-
export const LabelArray = ({ info }: { info: SelectFieldOption[] }) => {
|
|
5
|
-
return (
|
|
6
|
-
<div className="divide-y divide-gray-100">
|
|
7
|
-
{info?.map((x: any) => {
|
|
8
|
-
return (
|
|
9
|
-
<div key={x?.label} className="my-1 pt-2">
|
|
10
|
-
<p className="inline font-bold text-lg">{x?.label}: </p>
|
|
11
|
-
<p className="inline text-lg">{x?.value}</p>
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
})}
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
1
|
+
import { SelectFieldOption } from "@zauru-sdk/types";
|
|
2
|
+
|
|
3
|
+
//Component to show all information in an array
|
|
4
|
+
export const LabelArray = ({ info }: { info: SelectFieldOption[] }) => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="divide-y divide-gray-100">
|
|
7
|
+
{info?.map((x: any) => {
|
|
8
|
+
return (
|
|
9
|
+
<div key={x?.label} className="my-1 pt-2">
|
|
10
|
+
<p className="inline font-bold text-lg">{x?.label}: </p>
|
|
11
|
+
<p className="inline text-lg">{x?.value}</p>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
})}
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type tableColumnTitleProps = {
|
|
2
|
-
textContent: String;
|
|
3
|
-
};
|
|
4
|
-
//column title for datatables
|
|
5
|
-
export const TableColumnTitle = ({ textContent }: tableColumnTitleProps) => {
|
|
6
|
-
return (
|
|
7
|
-
<p className="font-bold text-sm line-clamp-3 text-center">{textContent}</p>
|
|
8
|
-
);
|
|
9
|
-
};
|
|
1
|
+
export type tableColumnTitleProps = {
|
|
2
|
+
textContent: String;
|
|
3
|
+
};
|
|
4
|
+
//column title for datatables
|
|
5
|
+
export const TableColumnTitle = ({ textContent }: tableColumnTitleProps) => {
|
|
6
|
+
return (
|
|
7
|
+
<p className="font-bold text-sm line-clamp-3 text-center">{textContent}</p>
|
|
8
|
+
);
|
|
9
|
+
};
|
package/src/Titles/TitleH1.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//H1 Title Component
|
|
2
|
-
export const TitleH1 = ({ texto }: any) => {
|
|
3
|
-
return (
|
|
4
|
-
<div className="mb-1">
|
|
5
|
-
<h1 className="text-4xl font-bold leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
-
{texto}
|
|
7
|
-
</h1>
|
|
8
|
-
</div>
|
|
9
|
-
);
|
|
10
|
-
};
|
|
1
|
+
//H1 Title Component
|
|
2
|
+
export const TitleH1 = ({ texto }: any) => {
|
|
3
|
+
return (
|
|
4
|
+
<div className="mb-1">
|
|
5
|
+
<h1 className="text-4xl font-bold leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
+
{texto}
|
|
7
|
+
</h1>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
};
|
package/src/Titles/TitleH2.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//H2 Title Component
|
|
2
|
-
export const TitleH2 = ({ texto }: any) => {
|
|
3
|
-
return (
|
|
4
|
-
<div className="py-1 ">
|
|
5
|
-
<h2 className="text-2xl font-bold leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
-
{texto}
|
|
7
|
-
</h2>
|
|
8
|
-
</div>
|
|
9
|
-
);
|
|
10
|
-
};
|
|
1
|
+
//H2 Title Component
|
|
2
|
+
export const TitleH2 = ({ texto }: any) => {
|
|
3
|
+
return (
|
|
4
|
+
<div className="py-1 ">
|
|
5
|
+
<h2 className="text-2xl font-bold leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
+
{texto}
|
|
7
|
+
</h2>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
};
|
package/src/Titles/TitleH3.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//H3 Title Component
|
|
2
|
-
export const TitleH3 = ({ texto }: any) => {
|
|
3
|
-
return (
|
|
4
|
-
<div className="py-1 ">
|
|
5
|
-
<h3 className="text-xl leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
-
{texto}
|
|
7
|
-
</h3>
|
|
8
|
-
</div>
|
|
9
|
-
);
|
|
10
|
-
};
|
|
1
|
+
//H3 Title Component
|
|
2
|
+
export const TitleH3 = ({ texto }: any) => {
|
|
3
|
+
return (
|
|
4
|
+
<div className="py-1 ">
|
|
5
|
+
<h3 className="text-xl leading-normal mt-0 mb-2 text-zinc-800">
|
|
6
|
+
{texto}
|
|
7
|
+
</h3>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
};
|
package/src/Titles/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./LabelArray.js";
|
|
2
|
-
export * from "./TableColumnTitle.js";
|
|
3
|
-
export * from "./TitleH1.js";
|
|
4
|
-
export * from "./TitleH2.js";
|
|
5
|
-
export * from "./TitleH3.js";
|
|
1
|
+
export * from "./LabelArray.js";
|
|
2
|
+
export * from "./TableColumnTitle.js";
|
|
3
|
+
export * from "./TitleH1.js";
|
|
4
|
+
export * from "./TitleH2.js";
|
|
5
|
+
export * from "./TitleH3.js";
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
text: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const Tooltip = ({ children, text }: Props) => {
|
|
11
|
-
const [show, setShow] = useState(false);
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div className="relative inline-block">
|
|
15
|
-
<div
|
|
16
|
-
onMouseEnter={() => setShow(true)}
|
|
17
|
-
onMouseLeave={() => setShow(false)}
|
|
18
|
-
>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
{show && (
|
|
22
|
-
<div
|
|
23
|
-
className="absolute z-10 bg-gray-700 text-white px-2 py-1 rounded-md bottom-full left-1/2 transform -translate-x-1/2"
|
|
24
|
-
style={{ whiteSpace: "nowrap", height: "2rem" }}
|
|
25
|
-
>
|
|
26
|
-
{text}
|
|
27
|
-
<div
|
|
28
|
-
className="absolute top-full left-1/2 transform -translate-x-1/2"
|
|
29
|
-
style={{
|
|
30
|
-
width: "0",
|
|
31
|
-
height: "0",
|
|
32
|
-
borderTop: "6px solid transparent",
|
|
33
|
-
borderLeft: "6px solid transparent",
|
|
34
|
-
borderRight: "6px solid transparent",
|
|
35
|
-
borderBottom: "6px solid gray",
|
|
36
|
-
}}
|
|
37
|
-
></div>
|
|
38
|
-
</div>
|
|
39
|
-
)}
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Tooltip = ({ children, text }: Props) => {
|
|
11
|
+
const [show, setShow] = useState(false);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className="relative inline-block">
|
|
15
|
+
<div
|
|
16
|
+
onMouseEnter={() => setShow(true)}
|
|
17
|
+
onMouseLeave={() => setShow(false)}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
{show && (
|
|
22
|
+
<div
|
|
23
|
+
className="absolute z-10 bg-gray-700 text-white px-2 py-1 rounded-md bottom-full left-1/2 transform -translate-x-1/2"
|
|
24
|
+
style={{ whiteSpace: "nowrap", height: "2rem" }}
|
|
25
|
+
>
|
|
26
|
+
{text}
|
|
27
|
+
<div
|
|
28
|
+
className="absolute top-full left-1/2 transform -translate-x-1/2"
|
|
29
|
+
style={{
|
|
30
|
+
width: "0",
|
|
31
|
+
height: "0",
|
|
32
|
+
borderTop: "6px solid transparent",
|
|
33
|
+
borderLeft: "6px solid transparent",
|
|
34
|
+
borderRight: "6px solid transparent",
|
|
35
|
+
borderBottom: "6px solid gray",
|
|
36
|
+
}}
|
|
37
|
+
></div>
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
package/src/Tooltip/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Tooltip.js";
|
|
1
|
+
export * from "./Tooltip.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const WithTooltip = (props: Props) => {
|
|
9
|
-
const { children, text } = props;
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<span className="group relative">
|
|
14
|
-
{children}
|
|
15
|
-
<span className="pointer-events-none absolute -top-10 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-black px-2 py-1 text-white opacity-0 transition z-50 before:absolute before:left-1/2 before:top-full before:-translate-x-1/2 before:border-4 before:border-transparent before:border-t-black before:content-[''] group-hover:opacity-100 before:z-50">
|
|
16
|
-
{text}
|
|
17
|
-
</span>
|
|
18
|
-
</span>
|
|
19
|
-
</>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const WithTooltip = (props: Props) => {
|
|
9
|
+
const { children, text } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<span className="group relative">
|
|
14
|
+
{children}
|
|
15
|
+
<span className="pointer-events-none absolute -top-10 left-1/2 -translate-x-1/2 whitespace-nowrap rounded bg-black px-2 py-1 text-white opacity-0 transition z-50 before:absolute before:left-1/2 before:top-full before:-translate-x-1/2 before:border-4 before:border-transparent before:border-t-black before:content-[''] group-hover:opacity-100 before:z-50">
|
|
16
|
+
{text}
|
|
17
|
+
</span>
|
|
18
|
+
</span>
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./WithTooltip.js";
|
|
1
|
+
export * from "./WithTooltip.js";
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { LoadingInputSkeleton } from "../Skeletons/index.js";
|
|
4
|
-
|
|
5
|
-
export type StepWizard = {
|
|
6
|
-
index: number;
|
|
7
|
-
stepName: string;
|
|
8
|
-
component: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
interface StepWizardProps {
|
|
12
|
-
steps: StepWizard[];
|
|
13
|
-
showStepName?: boolean;
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const StepWizardComponent: React.FC<StepWizardProps> = ({
|
|
18
|
-
steps,
|
|
19
|
-
showStepName = false,
|
|
20
|
-
loading = false,
|
|
21
|
-
}) => {
|
|
22
|
-
const [currentStep, setCurrentStep] = useState(0);
|
|
23
|
-
|
|
24
|
-
if (loading) {
|
|
25
|
-
return (
|
|
26
|
-
<div className="lg:grid lg:grid-cols-10 gap-4">
|
|
27
|
-
<div className="lg:col-span-2">
|
|
28
|
-
<select className="lg:hidden mb-5 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
|
|
29
|
-
<option></option>
|
|
30
|
-
</select>
|
|
31
|
-
<div className="hidden lg:block">
|
|
32
|
-
<LoadingInputSkeleton />
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<div className="lg:col-span-8">
|
|
36
|
-
<LoadingInputSkeleton />
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="lg:grid lg:grid-cols-10 gap-4">
|
|
44
|
-
<div className="lg:col-span-2">
|
|
45
|
-
<select
|
|
46
|
-
className="lg:hidden mb-5 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
|
|
47
|
-
onChange={(e) => setCurrentStep(parseInt(e.target.value))}
|
|
48
|
-
value={currentStep}
|
|
49
|
-
>
|
|
50
|
-
{steps.map((step, index) => (
|
|
51
|
-
<option key={index} value={index}>
|
|
52
|
-
{showStepName ? step.stepName : `Step ${index + 1}`}
|
|
53
|
-
</option>
|
|
54
|
-
))}
|
|
55
|
-
</select>
|
|
56
|
-
<div className="scroll-hidden hidden lg:block">
|
|
57
|
-
{steps.map((step, index) => (
|
|
58
|
-
<div
|
|
59
|
-
key={index}
|
|
60
|
-
onClick={() => setCurrentStep(index)}
|
|
61
|
-
className={`py-2 px-4 mt-5 cursor-pointer rounded ${
|
|
62
|
-
currentStep === index
|
|
63
|
-
? "bg-blue-500 text-white"
|
|
64
|
-
: "text-blue-500 hover:bg-gray-100 border border-gray-300"
|
|
65
|
-
} ${
|
|
66
|
-
showStepName
|
|
67
|
-
? "text-wrap break-words"
|
|
68
|
-
: "rounded-full w-8 h-8 flex items-center justify-center"
|
|
69
|
-
}`}
|
|
70
|
-
>
|
|
71
|
-
{showStepName ? step.stepName : index + 1}
|
|
72
|
-
</div>
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
<div className="lg:col-span-8">
|
|
77
|
-
{steps.map((step, index) => (
|
|
78
|
-
<div
|
|
79
|
-
key={index}
|
|
80
|
-
className={currentStep === index ? "block" : "hidden"}
|
|
81
|
-
>
|
|
82
|
-
{step.component}
|
|
83
|
-
</div>
|
|
84
|
-
))}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { LoadingInputSkeleton } from "../Skeletons/index.js";
|
|
4
|
+
|
|
5
|
+
export type StepWizard = {
|
|
6
|
+
index: number;
|
|
7
|
+
stepName: string;
|
|
8
|
+
component: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
interface StepWizardProps {
|
|
12
|
+
steps: StepWizard[];
|
|
13
|
+
showStepName?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const StepWizardComponent: React.FC<StepWizardProps> = ({
|
|
18
|
+
steps,
|
|
19
|
+
showStepName = false,
|
|
20
|
+
loading = false,
|
|
21
|
+
}) => {
|
|
22
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
23
|
+
|
|
24
|
+
if (loading) {
|
|
25
|
+
return (
|
|
26
|
+
<div className="lg:grid lg:grid-cols-10 gap-4">
|
|
27
|
+
<div className="lg:col-span-2">
|
|
28
|
+
<select className="lg:hidden mb-5 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
|
|
29
|
+
<option></option>
|
|
30
|
+
</select>
|
|
31
|
+
<div className="hidden lg:block">
|
|
32
|
+
<LoadingInputSkeleton />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="lg:col-span-8">
|
|
36
|
+
<LoadingInputSkeleton />
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="lg:grid lg:grid-cols-10 gap-4">
|
|
44
|
+
<div className="lg:col-span-2">
|
|
45
|
+
<select
|
|
46
|
+
className="lg:hidden mb-5 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
|
|
47
|
+
onChange={(e) => setCurrentStep(parseInt(e.target.value))}
|
|
48
|
+
value={currentStep}
|
|
49
|
+
>
|
|
50
|
+
{steps.map((step, index) => (
|
|
51
|
+
<option key={index} value={index}>
|
|
52
|
+
{showStepName ? step.stepName : `Step ${index + 1}`}
|
|
53
|
+
</option>
|
|
54
|
+
))}
|
|
55
|
+
</select>
|
|
56
|
+
<div className="scroll-hidden hidden lg:block">
|
|
57
|
+
{steps.map((step, index) => (
|
|
58
|
+
<div
|
|
59
|
+
key={index}
|
|
60
|
+
onClick={() => setCurrentStep(index)}
|
|
61
|
+
className={`py-2 px-4 mt-5 cursor-pointer rounded ${
|
|
62
|
+
currentStep === index
|
|
63
|
+
? "bg-blue-500 text-white"
|
|
64
|
+
: "text-blue-500 hover:bg-gray-100 border border-gray-300"
|
|
65
|
+
} ${
|
|
66
|
+
showStepName
|
|
67
|
+
? "text-wrap break-words"
|
|
68
|
+
: "rounded-full w-8 h-8 flex items-center justify-center"
|
|
69
|
+
}`}
|
|
70
|
+
>
|
|
71
|
+
{showStepName ? step.stepName : index + 1}
|
|
72
|
+
</div>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="lg:col-span-8">
|
|
77
|
+
{steps.map((step, index) => (
|
|
78
|
+
<div
|
|
79
|
+
key={index}
|
|
80
|
+
className={currentStep === index ? "block" : "hidden"}
|
|
81
|
+
>
|
|
82
|
+
{step.component}
|
|
83
|
+
</div>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
};
|
package/src/Wizards/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./StepWizard.js";
|
|
1
|
+
export * from "./StepWizard.js";
|