gbs-add-block 0.0.16 → 0.0.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gbs-add-block",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "React Component Library",
5
5
  "files": [
6
6
  "index.js",
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ "use client";
8
9
  import React from "react";
9
10
  import { useToastStore } from "./toastAtom";
10
11
  import Toast from "./Toast";
@@ -6,15 +6,19 @@ export type Toast = {
6
6
  id: number;
7
7
  type: ToastType;
8
8
  message: string | ReactNode;
9
+ title: string | ReactNode;
9
10
  dismissible: boolean;
10
11
  timeout: number;
12
+ action?: any;
11
13
  };
12
14
 
13
15
  export type ToastOptions = {
14
16
  message: string | ReactNode;
17
+ title?: string | ReactNode;
15
18
  type?: ToastType;
16
19
  dismissible?: boolean;
17
20
  timeout?: number;
21
+ action?: any;
18
22
  };
19
23
 
20
24
  export type ToastPosition =
@@ -6,16 +6,20 @@ const useToast = () => {
6
6
 
7
7
  return {
8
8
  addToast: ({
9
+ title,
9
10
  message,
10
11
  type = "info",
11
12
  dismissible = false,
12
13
  timeout = 3000,
14
+ action,
13
15
  }: ToastOptions) =>
14
16
  addToast({
17
+ title,
15
18
  message,
16
19
  type,
17
20
  dismissible,
18
21
  timeout,
22
+ action,
19
23
  }),
20
24
  dismissToast,
21
25
  };
@@ -7,20 +7,28 @@
7
7
 
8
8
  import React from "react";
9
9
 
10
- const AestheticProcessingAnimation = () => {
10
+ type AestheticProcessingAnimationProps = {
11
+ progressPercentage: number;
12
+ };
13
+
14
+ const AestheticProcessingAnimation = ({
15
+ progressPercentage,
16
+ }: AestheticProcessingAnimationProps) => {
11
17
  return (
12
18
  <div className="w-full max-w-md mx-auto p-2">
13
19
  <div className="w-full h-1 bg-gray-200 rounded-full overflow-hidden">
14
20
  <div className="h-full w-1/3 bg-black rounded-full animate-processing"></div>
15
21
  </div>
16
22
  <p className="text-xs mt-2 text-center">
17
- Uploading in Progress, Please Wait...
23
+ Uploading in Progress {Math.floor(progressPercentage)}%, Please Wait...
18
24
  </p>
19
25
  </div>
20
26
  );
21
27
  };
22
28
 
23
- const AestheticProcessingAnimationWithStyles = () => (
29
+ const AestheticProcessingAnimationWithStyles = ({
30
+ progressPercentage,
31
+ }: AestheticProcessingAnimationProps) => (
24
32
  <>
25
33
  <style jsx global>{`
26
34
  @keyframes processing {
@@ -35,7 +43,7 @@ const AestheticProcessingAnimationWithStyles = () => (
35
43
  animation: processing 2s ease-in-out infinite;
36
44
  }
37
45
  `}</style>
38
- <AestheticProcessingAnimation />
46
+ <AestheticProcessingAnimation progressPercentage={progressPercentage} />
39
47
  </>
40
48
  );
41
49