catchup-library-web 2.6.10 → 2.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +718 -662
- package/dist/index.mjs +582 -527
- package/package.json +1 -1
- package/src/components/buttons/StartButton.tsx +65 -0
- package/src/components/tabs/SelectionTab.tsx +5 -5
- package/src/components/tabs/SelectionTabPill.tsx +6 -2
- package/src/index.ts +1 -0
- package/src/properties/TabProperties.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import BaseLoading from "../loading/BaseLoading";
|
|
3
|
+
import { IButtonProps } from "../../properties/ButtonProperties";
|
|
4
|
+
|
|
5
|
+
const StartButton = ({
|
|
6
|
+
title,
|
|
7
|
+
size,
|
|
8
|
+
onClick,
|
|
9
|
+
disabled,
|
|
10
|
+
}: IButtonProps) => {
|
|
11
|
+
const [loading, setLoading] = useState(false);
|
|
12
|
+
|
|
13
|
+
const internalOnClick = async (e: any) => {
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
if (loading) return;
|
|
16
|
+
if (disabled) return;
|
|
17
|
+
setLoading(true);
|
|
18
|
+
await onClick();
|
|
19
|
+
setLoading(false);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let currentHeightClassName;
|
|
23
|
+
let currentLoadingSize;
|
|
24
|
+
if (size === "small") {
|
|
25
|
+
currentHeightClassName = "h-8";
|
|
26
|
+
currentLoadingSize = 14;
|
|
27
|
+
} else if (size === "medium") {
|
|
28
|
+
currentHeightClassName = "h-10";
|
|
29
|
+
currentLoadingSize = 16;
|
|
30
|
+
} else if (size === "large") {
|
|
31
|
+
currentHeightClassName = "h-12";
|
|
32
|
+
currentLoadingSize = 18;
|
|
33
|
+
} else if (size === "unlimited") {
|
|
34
|
+
currentLoadingSize = 14;
|
|
35
|
+
currentHeightClassName = "h-8";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<button
|
|
40
|
+
className={`px-8 py-2.5 bg-gradient-to-r from-catchup-green to-catchup-hover-green text-catchup-white font-bold text-lg rounded-catchup-full shadow-card ${
|
|
41
|
+
loading
|
|
42
|
+
? ""
|
|
43
|
+
: disabled
|
|
44
|
+
? "opacity-50"
|
|
45
|
+
: "hover:from-catchup-hover-green hover:to-catchup-green hover:shadow-full-card hover:scale-105"
|
|
46
|
+
} transition-all duration-300 transform ${currentHeightClassName}`}
|
|
47
|
+
onClick={internalOnClick}
|
|
48
|
+
>
|
|
49
|
+
{loading ? (
|
|
50
|
+
<BaseLoading
|
|
51
|
+
height={currentLoadingSize}
|
|
52
|
+
width={currentLoadingSize}
|
|
53
|
+
primaryColor="#ffffff"
|
|
54
|
+
secondaryColor="#ffffff"
|
|
55
|
+
/>
|
|
56
|
+
) : (
|
|
57
|
+
<div className="flex flex-row justify-center items-center gap-x-2">
|
|
58
|
+
<p>{title}</p>
|
|
59
|
+
</div>
|
|
60
|
+
)}
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default StartButton;
|
|
@@ -20,17 +20,17 @@ const SelectionTab = ({
|
|
|
20
20
|
? selectedTextColor
|
|
21
21
|
: "text-catchup-blue-500"
|
|
22
22
|
: textColor
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
? textColor
|
|
24
|
+
: "text-catchup-gray-300"
|
|
25
25
|
} ${
|
|
26
26
|
selectedId === option.id
|
|
27
27
|
? selectedBorderColor
|
|
28
28
|
? selectedBorderColor
|
|
29
29
|
: "border-catchup-blue-500"
|
|
30
30
|
: borderColor
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} border-b-2 transition-all duration-300
|
|
31
|
+
? borderColor
|
|
32
|
+
: "border-catchup-gray-50"
|
|
33
|
+
} border-b-2 transition-all duration-300 px-4 py-2 cursor-pointer`}
|
|
34
34
|
onClick={() => {
|
|
35
35
|
handleSelectOnClick(option.id);
|
|
36
36
|
}}
|
|
@@ -4,6 +4,8 @@ const SelectionTabPill = ({
|
|
|
4
4
|
optionList,
|
|
5
5
|
selectedId,
|
|
6
6
|
handleSelectOnClick,
|
|
7
|
+
selectedClassName,
|
|
8
|
+
unselectedClassName,
|
|
7
9
|
}: ISelectionTabPillProps) => {
|
|
8
10
|
return (
|
|
9
11
|
<div className="flex flex-wrap items-center gap-3 my-2">
|
|
@@ -13,8 +15,10 @@ const SelectionTabPill = ({
|
|
|
13
15
|
onClick={() => handleSelectOnClick(option.id)}
|
|
14
16
|
className={`px-4 py-2 rounded-catchup-full transition-all duration-200 cursor-pointer ${
|
|
15
17
|
selectedId === option.id
|
|
16
|
-
?
|
|
17
|
-
|
|
18
|
+
? selectedClassName ||
|
|
19
|
+
"bg-catchup-blue text-catchup-white shadow-card"
|
|
20
|
+
: unselectedClassName ||
|
|
21
|
+
"bg-catchup-blue-100 text-catchup-blue-800 hover:bg-catchup-blue-200"
|
|
18
22
|
}`}
|
|
19
23
|
>
|
|
20
24
|
<span className="text-base font-semibold">{option.title}</span>
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { default as CreateButton } from "./components/buttons/CreateButton";
|
|
|
8
8
|
export { default as DeleteButton } from "./components/buttons/DeleteButton";
|
|
9
9
|
export { default as CancelButton } from "./components/buttons/CancelButton";
|
|
10
10
|
export { default as ApproveButton } from "./components/buttons/ApproveButton";
|
|
11
|
+
export { default as StartButton } from "./components/buttons/StartButton";
|
|
11
12
|
|
|
12
13
|
export { default as FullCard } from "./components/cards/FullCard";
|
|
13
14
|
export { default as BaseCard } from "./components/cards/BaseCard";
|