funuicss 2.0.25 → 2.5.1

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 (86) hide show
  1. package/css/fun.css +1005 -3758
  2. package/index.d.ts +35 -0
  3. package/index.js +76 -0
  4. package/index.tsx +35 -0
  5. package/js/Fun.js +2 -2
  6. package/js/Fun.tsx +9 -8
  7. package/package.json +2 -1
  8. package/tsconfig.tsbuildinfo +1 -1
  9. package/ui/alert/Alert.d.ts +5 -3
  10. package/ui/alert/Alert.js +27 -23
  11. package/ui/alert/Alert.tsx +71 -86
  12. package/ui/aos/AOS.d.ts +1 -1
  13. package/ui/appbar/AppBar.d.ts +1 -1
  14. package/ui/avatar/Avatar.d.ts +2 -1
  15. package/ui/breadcrumb/BreadCrumb.d.ts +2 -1
  16. package/ui/button/Button.d.ts +1 -1
  17. package/ui/card/Card.d.ts +1 -1
  18. package/ui/card/CardBody.d.ts +2 -2
  19. package/ui/card/CardFab.d.ts +2 -2
  20. package/ui/card/CardFooter.d.ts +2 -2
  21. package/ui/card/CardHeader.d.ts +2 -2
  22. package/ui/div/Div.d.ts +1 -1
  23. package/ui/drop/Action.d.ts +1 -1
  24. package/ui/drop/Down.d.ts +1 -1
  25. package/ui/drop/Item.d.ts +1 -1
  26. package/ui/drop/Menu.d.ts +1 -1
  27. package/ui/drop/Up.d.ts +1 -1
  28. package/ui/grid/Col.d.ts +2 -1
  29. package/ui/grid/Grid.d.ts +2 -1
  30. package/ui/input/Iconic.d.ts +2 -2
  31. package/ui/input/Input.d.ts +2 -0
  32. package/ui/input/Input.js +50 -9
  33. package/ui/input/Input.tsx +34 -7
  34. package/ui/list/Item.d.ts +1 -1
  35. package/ui/list/List.d.ts +1 -1
  36. package/ui/loader/Loader.d.ts +2 -1
  37. package/ui/modal/Action.d.ts +1 -1
  38. package/ui/modal/Close.d.ts +2 -1
  39. package/ui/modal/Content.d.ts +1 -1
  40. package/ui/modal/Header.d.ts +2 -2
  41. package/ui/modal/Header.tsx +1 -1
  42. package/ui/modal/Modal.d.ts +8 -2
  43. package/ui/modal/Modal.js +33 -21
  44. package/ui/modal/Modal.tsx +99 -52
  45. package/ui/notification/Content.d.ts +1 -1
  46. package/ui/notification/Footer.d.ts +1 -1
  47. package/ui/notification/Header.d.ts +1 -1
  48. package/ui/notification/Notification.d.ts +1 -1
  49. package/ui/page/NotFound.d.ts +1 -1
  50. package/ui/page/NotFound.js +5 -5
  51. package/ui/page/NotFound.tsx +6 -7
  52. package/ui/page/UnAuthorized.d.ts +1 -1
  53. package/ui/page/UnAuthorized.js +4 -2
  54. package/ui/page/UnAuthorized.tsx +7 -5
  55. package/ui/progress/Bar.d.ts +1 -1
  56. package/ui/sidebar/SideBar.d.ts +2 -1
  57. package/ui/sidebar/SideContent.d.ts +1 -1
  58. package/ui/snackbar/SnackBar.d.ts +4 -1
  59. package/ui/snackbar/SnackBar.js +16 -14
  60. package/ui/snackbar/SnackBar.tsx +41 -25
  61. package/ui/specials/Circle.d.ts +3 -2
  62. package/ui/specials/Circle.js +2 -2
  63. package/ui/specials/Circle.tsx +5 -3
  64. package/ui/specials/FullCenteredPage.d.ts +1 -1
  65. package/ui/specials/Hr.d.ts +1 -1
  66. package/ui/specials/RowFlex.d.ts +1 -1
  67. package/ui/specials/Section.d.ts +1 -1
  68. package/ui/table/Body.d.ts +1 -1
  69. package/ui/table/Data.d.ts +1 -1
  70. package/ui/table/Head.d.ts +1 -1
  71. package/ui/table/Row.d.ts +1 -1
  72. package/ui/table/Table.d.ts +1 -1
  73. package/ui/table/Table.js +11 -7
  74. package/ui/table/Table.tsx +20 -8
  75. package/ui/text/Text.d.ts +5 -5
  76. package/ui/text/Text.js +20 -11
  77. package/ui/text/Text.tsx +62 -33
  78. package/ui/tooltip/Tip.d.ts +2 -1
  79. package/ui/tooltip/Tip.js +9 -5
  80. package/ui/tooltip/Tip.tsx +12 -2
  81. package/ui/tooltip/ToolTip.d.ts +1 -1
  82. package/ui/tooltip/ToolTip.js +1 -1
  83. package/ui/tooltip/ToolTip.tsx +7 -1
  84. package/ui/video/FunPlayer.d.ts +0 -7
  85. package/ui/video/FunPlayer.js +202 -179
  86. package/ui/video/FunPlayer.tsx +218 -218
package/ui/list/List.d.ts CHANGED
@@ -10,5 +10,5 @@ interface ListProps {
10
10
  roundItems?: boolean;
11
11
  gap?: number;
12
12
  }
13
- export default function List({ children, funcss, dark, light, stripped, bordered, hoverable, roundItems, gap, ...rest }: ListProps): any;
13
+ export default function List({ children, funcss, dark, light, stripped, bordered, hoverable, roundItems, gap, ...rest }: ListProps): React.JSX.Element;
14
14
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  interface FunLoaderProps {
2
3
  funcss?: string;
3
4
  size?: number;
@@ -6,5 +7,5 @@ interface FunLoaderProps {
6
7
  color?: string;
7
8
  variant?: 'simple' | 'duotone' | "circle";
8
9
  }
9
- export default function FunLoader({ funcss, size, fixed, backdrop, color, variant, ...rest }: FunLoaderProps): any;
10
+ export default function FunLoader({ funcss, size, fixed, backdrop, color, variant, ...rest }: FunLoaderProps): React.JSX.Element;
10
11
  export {};
@@ -3,5 +3,5 @@ interface ModalActionProps extends React.HTMLProps<HTMLDivElement> {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  }
6
- export default function ModalAction({ funcss, children, ...rest }: ModalActionProps): any;
6
+ export default function ModalAction({ funcss, children, ...rest }: ModalActionProps): React.JSX.Element;
7
7
  export {};
@@ -1,6 +1,7 @@
1
1
  import { HTMLProps } from 'react';
2
+ import * as React from 'react';
2
3
  interface CloseModalProps extends HTMLProps<HTMLDivElement> {
3
4
  funcss?: string;
4
5
  }
5
- export default function CloseModal({ funcss, ...rest }: CloseModalProps): any;
6
+ export default function CloseModal({ funcss, ...rest }: CloseModalProps): React.JSX.Element;
6
7
  export {};
@@ -3,5 +3,5 @@ interface ModalContentProps {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  }
6
- export default function ModalContent({ funcss, children, }: ModalContentProps): any;
6
+ export default function ModalContent({ funcss, children, }: ModalContentProps): React.JSX.Element;
7
7
  export {};
@@ -3,7 +3,7 @@ interface ModalHeaderProps {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  close?: React.ReactNode | '';
6
- title?: string;
6
+ title?: React.ReactNode;
7
7
  }
8
- export default function ModalHeader({ funcss, children, close, title, ...rest }: ModalHeaderProps): any;
8
+ export default function ModalHeader({ funcss, children, close, title, ...rest }: ModalHeaderProps): React.JSX.Element;
9
9
  export {};
@@ -4,7 +4,7 @@ interface ModalHeaderProps {
4
4
  funcss?: string;
5
5
  children?: React.ReactNode;
6
6
  close?: React.ReactNode | '';
7
- title?:string
7
+ title?:React.ReactNode
8
8
  }
9
9
 
10
10
  export default function ModalHeader({ funcss, children, close , title, ...rest }: ModalHeaderProps) {
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  interface ModalProps {
3
- children: React.ReactNode;
3
+ children?: React.ReactNode;
4
4
  funcss?: string;
5
5
  animation?: string;
6
6
  duration?: number;
7
7
  open: boolean;
8
+ setOpen: (val: boolean) => void;
8
9
  maxWidth?: string;
9
10
  maxHeight?: string;
10
11
  height?: string;
@@ -13,6 +14,7 @@ interface ModalProps {
13
14
  body?: React.ReactNode;
14
15
  bodycss?: string;
15
16
  title?: React.ReactNode;
17
+ okIcon?: React.ReactNode;
16
18
  titlecss?: string;
17
19
  footer?: React.ReactNode;
18
20
  footercss?: string;
@@ -21,6 +23,10 @@ interface ModalProps {
21
23
  id?: string;
22
24
  position?: string;
23
25
  flat?: boolean;
26
+ onOk?: () => void;
27
+ onOkText?: string;
24
28
  }
25
- export default function Modal({ children, funcss, animation, duration, open, maxWidth, maxHeight, height, width, backdrop, title, titlecss, body, bodycss, footer, footercss, close, closecss, position, id, flat, ...rest }: ModalProps): any;
29
+ export default function Modal({ children, funcss, animation, duration, open, setOpen, maxWidth, maxHeight, okIcon, height, width, backdrop, title, titlecss, body, bodycss, footer, footercss, close, closecss, position, id, flat, onOk, // 👈 added
30
+ onOkText, // 👈 added
31
+ ...rest }: ModalProps): React.JSX.Element;
26
32
  export {};
package/ui/modal/Modal.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  var __assign = (this && this.__assign) || function () {
3
4
  __assign = Object.assign || function(t) {
@@ -52,27 +53,38 @@ var React = __importStar(require("react"));
52
53
  var Header_1 = __importDefault(require("./Header"));
53
54
  var Content_1 = __importDefault(require("./Content"));
54
55
  var Action_1 = __importDefault(require("./Action"));
56
+ var pi_1 = require("react-icons/pi");
57
+ var Button_1 = __importDefault(require("../button/Button"));
55
58
  function Modal(_a) {
56
- var children = _a.children, funcss = _a.funcss, animation = _a.animation, duration = _a.duration, open = _a.open, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, height = _a.height, width = _a.width, backdrop = _a.backdrop, title = _a.title, titlecss = _a.titlecss, body = _a.body, bodycss = _a.bodycss, footer = _a.footer, footercss = _a.footercss, close = _a.close, closecss = _a.closecss, position = _a.position, id = _a.id, flat = _a.flat, rest = __rest(_a, ["children", "funcss", "animation", "duration", "open", "maxWidth", "maxHeight", "height", "width", "backdrop", "title", "titlecss", "body", "bodycss", "footer", "footercss", "close", "closecss", "position", "id", "flat"]);
57
- if (open) {
58
- return (React.createElement("div", { className: " modal ".concat(backdrop ? 'backdrop' : '', " ").concat(position ? position : ''), id: id ? id : '' },
59
- React.createElement("div", __assign({ className: "modal-content ".concat(funcss, " ").concat(flat ? "flat" : ""), style: {
60
- animation: " ".concat(duration ? duration : 0.2, "s ").concat(animation ? animation : "ScaleUp"),
61
- maxWidth: maxWidth ? maxWidth : null,
62
- maxHeight: maxHeight ? maxHeight : null,
63
- width: width ? width : null,
64
- height: height ? height : null,
65
- } }, rest),
66
- title &&
67
- React.createElement(Header_1.default, { funcss: titlecss ? titlecss : '', title: title ? title : "", close: close ? close : "" }),
68
- body &&
69
- React.createElement(Content_1.default, { funcss: bodycss ? bodycss : '' }, body),
70
- footer &&
71
- React.createElement(Action_1.default, { funcss: footercss ? footercss : '' }, footer),
72
- children)));
73
- }
74
- else {
75
- return React.createElement("div", null);
76
- }
59
+ var children = _a.children, funcss = _a.funcss, animation = _a.animation, duration = _a.duration, open = _a.open, setOpen = _a.setOpen, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, okIcon = _a.okIcon, height = _a.height, width = _a.width, _b = _a.backdrop, backdrop = _b === void 0 ? false : _b, title = _a.title, titlecss = _a.titlecss, body = _a.body, bodycss = _a.bodycss, footer = _a.footer, footercss = _a.footercss, close = _a.close, closecss = _a.closecss, position = _a.position, id = _a.id, flat = _a.flat, onOk = _a.onOk, // 👈 added
60
+ onOkText = _a.onOkText, // 👈 added
61
+ rest = __rest(_a, ["children", "funcss", "animation", "duration", "open", "setOpen", "maxWidth", "maxHeight", "okIcon", "height", "width", "backdrop", "title", "titlecss", "body", "bodycss", "footer", "footercss", "close", "closecss", "position", "id", "flat", "onOk", "onOkText"]);
62
+ var modalId = id || '_mymodal';
63
+ var handleClickOutside = function (e) {
64
+ if (e.target && e.target.id === modalId) {
65
+ setOpen(false);
66
+ }
67
+ };
68
+ var handleOkClick = function () {
69
+ if (onOk)
70
+ onOk();
71
+ else
72
+ setOpen(false); // default behavior if no onOk is provided
73
+ };
74
+ if (!open)
75
+ return null;
76
+ return (React.createElement("div", { className: "modal ".concat(backdrop ? 'backdrop' : '', " ").concat(position || ''), id: modalId, onClick: handleClickOutside },
77
+ React.createElement("div", __assign({ className: "modal-content ".concat(funcss || '', " ").concat(flat ? 'flat' : ''), style: {
78
+ animation: "".concat(duration || 0.2, "s ").concat(animation || 'ScaleUp'),
79
+ maxWidth: maxWidth || undefined,
80
+ maxHeight: maxHeight || undefined,
81
+ width: width || undefined,
82
+ height: height || undefined,
83
+ } }, rest),
84
+ title && (React.createElement(Header_1.default, { funcss: titlecss || '', title: title, close: React.createElement("div", { onClick: function () { return setOpen(false); }, className: "".concat(closecss || '', " pointer hover-text-error") }, close || React.createElement(pi_1.PiX, { size: 30 })) })),
85
+ body && (React.createElement(Content_1.default, { funcss: bodycss || '' }, body)),
86
+ footer ? (React.createElement(Action_1.default, { funcss: footercss || '' }, footer)) : (React.createElement(Action_1.default, { funcss: 'text-right' },
87
+ React.createElement(Button_1.default, { bg: 'success800', endIcon: okIcon || React.createElement(pi_1.PiPaperPlaneRight, null), raised: true, onClick: handleOkClick }, onOkText || 'OK'))),
88
+ children)));
77
89
  }
78
90
  exports.default = Modal;
@@ -1,31 +1,37 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import ModalHeader from './Header';
3
4
  import ModalContent from './Content';
4
5
  import ModalAction from './Action';
5
- import CloseModal from './Close';
6
+ import { PiX , PiPaperPlaneRight} from 'react-icons/pi';
7
+ import Button from '../button/Button';
6
8
 
7
9
  interface ModalProps {
8
- children: React.ReactNode;
10
+ children?: React.ReactNode;
9
11
  funcss?: string;
10
12
  animation?: string;
11
13
  duration?: number;
12
14
  open: boolean;
15
+ setOpen: (val: boolean) => void;
13
16
  maxWidth?: string;
14
17
  maxHeight?: string;
15
18
  height?: string;
16
19
  width?: string;
17
20
  backdrop?: boolean;
18
- body?:React.ReactNode
19
- bodycss?:string
20
- title?:React.ReactNode
21
- titlecss?:string,
22
- footer?:React.ReactNode
23
- footercss?:string
24
- close?:React.ReactNode
25
- closecss?:string ,
26
- id?:string
27
- position?:string
28
- flat?:boolean
21
+ body?: React.ReactNode;
22
+ bodycss?: string;
23
+ title?: React.ReactNode;
24
+ okIcon?: React.ReactNode;
25
+ titlecss?: string;
26
+ footer?: React.ReactNode;
27
+ footercss?: string;
28
+ close?: React.ReactNode;
29
+ closecss?: string;
30
+ id?: string;
31
+ position?: string;
32
+ flat?: boolean;
33
+ onOk?: () => void; // 👈 new
34
+ onOkText?: string; // 👈 new
29
35
  }
30
36
 
31
37
  export default function Modal({
@@ -34,11 +40,13 @@ export default function Modal({
34
40
  animation,
35
41
  duration,
36
42
  open,
43
+ setOpen,
37
44
  maxWidth,
38
45
  maxHeight,
46
+ okIcon,
39
47
  height,
40
48
  width,
41
- backdrop,
49
+ backdrop = false,
42
50
  title,
43
51
  titlecss,
44
52
  body,
@@ -49,45 +57,84 @@ export default function Modal({
49
57
  closecss,
50
58
  position,
51
59
  id,
52
- flat ,
60
+ flat,
61
+ onOk, // 👈 added
62
+ onOkText, // 👈 added
53
63
  ...rest
54
64
  }: ModalProps) {
55
- if (open) {
56
- return (
57
- <div className={` modal ${backdrop ? 'backdrop' : ''} ${position ? position : ''}`} id={id ? id : ''}>
58
- <div
59
- className={`modal-content ${funcss} ${flat ? "flat" : ""}`}
60
- style={{
61
- animation: ` ${duration ? duration : 0.2}s ${animation ? animation : "ScaleUp"}` ,
62
- maxWidth: maxWidth ? maxWidth : null,
63
- maxHeight: maxHeight ? maxHeight : null,
64
- width: width ? width : null,
65
- height: height ? height : null,
66
- }}
67
-
68
- {...rest}
69
- >
70
- {
71
- title &&
72
- <ModalHeader funcss={titlecss ? titlecss : ''} title={title ? title : ""} close={close ? close : ""} />
73
- }
74
- {
75
- body &&
76
- <ModalContent funcss={bodycss ? bodycss : ''} >
77
- {body}
78
- </ModalContent>
79
- }
80
- {
81
- footer &&
82
- <ModalAction funcss={footercss ? footercss : ''}>
83
- {footer}
84
- </ModalAction>
85
- }
86
- {children}
87
- </div>
65
+ const modalId = id || '_mymodal';
66
+
67
+ const handleClickOutside = (e: React.MouseEvent<HTMLDivElement>) => {
68
+ if (e.target && (e.target as HTMLElement).id === modalId) {
69
+ setOpen(false);
70
+ }
71
+ };
72
+
73
+ const handleOkClick = () => {
74
+ if (onOk) onOk();
75
+ else setOpen(false); // default behavior if no onOk is provided
76
+ };
77
+
78
+ if (!open) return null;
79
+
80
+ return (
81
+ <div
82
+ className={`modal ${backdrop ? 'backdrop' : ''} ${position || ''}`}
83
+ id={modalId}
84
+ onClick={handleClickOutside}
85
+ >
86
+ <div
87
+ className={`modal-content ${funcss || ''} ${flat ? 'flat' : ''}`}
88
+ style={{
89
+ animation: `${duration || 0.2}s ${animation || 'ScaleUp'}`,
90
+ maxWidth: maxWidth || undefined,
91
+ maxHeight: maxHeight || undefined,
92
+ width: width || undefined,
93
+ height: height || undefined,
94
+ }}
95
+ {...rest}
96
+ >
97
+ {title && (
98
+ <ModalHeader
99
+ funcss={titlecss || ''}
100
+ title={title}
101
+ close={
102
+ <div
103
+ onClick={() => setOpen(false)}
104
+ className={`${closecss || ''} pointer hover-text-error`}
105
+ >
106
+ {close || <PiX size={30} />}
107
+ </div>
108
+ }
109
+ />
110
+ )}
111
+
112
+ {body && (
113
+ <ModalContent funcss={bodycss || ''}>
114
+ {body}
115
+ </ModalContent>
116
+ )}
117
+
118
+ {/* Show default Ok button if no custom footer */}
119
+ {footer ? (
120
+ <ModalAction funcss={footercss || ''}>
121
+ {footer}
122
+ </ModalAction>
123
+ ) : (
124
+ <ModalAction funcss='text-right'>
125
+ <Button
126
+ bg='success800'
127
+ endIcon={okIcon || <PiPaperPlaneRight />}
128
+ raised
129
+ onClick={handleOkClick}
130
+ >
131
+ {onOkText || 'OK'}
132
+ </Button>
133
+ </ModalAction>
134
+ )}
135
+
136
+ {children}
88
137
  </div>
89
- );
90
- } else {
91
- return <div></div>;
92
- }
138
+ </div>
139
+ );
93
140
  }
@@ -3,5 +3,5 @@ type NotificationContentProps = {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  };
6
- export default function NotificationContent({ funcss, children }: NotificationContentProps): any;
6
+ export default function NotificationContent({ funcss, children }: NotificationContentProps): React.JSX.Element;
7
7
  export {};
@@ -3,5 +3,5 @@ type NotificationFooterProps = {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  };
6
- export default function NotificationFooter({ funcss, children }: NotificationFooterProps): any;
6
+ export default function NotificationFooter({ funcss, children }: NotificationFooterProps): React.JSX.Element;
7
7
  export {};
@@ -3,5 +3,5 @@ type NotificationHeaderProps = {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
5
  };
6
- export default function NotificationHeader({ funcss, children }: NotificationHeaderProps): any;
6
+ export default function NotificationHeader({ funcss, children }: NotificationHeaderProps): React.JSX.Element;
7
7
  export {};
@@ -11,5 +11,5 @@ type NotificationProps = {
11
11
  content?: React.ReactNode;
12
12
  footer?: React.ReactNode;
13
13
  };
14
- export default function Notification({ position, funcss, animation, duration, children, state, width, header, content, footer }: NotificationProps): any;
14
+ export default function Notification({ position, funcss, animation, duration, children, state, width, header, content, footer }: NotificationProps): React.JSX.Element;
15
15
  export {};
@@ -5,5 +5,5 @@ interface NotFoundProps {
5
5
  content?: React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  }
8
- export default function NotFound({ header, code, content, action }: NotFoundProps): any;
8
+ export default function NotFound({ header, code, content, action }: NotFoundProps): React.JSX.Element;
9
9
  export {};
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
4
  if (k2 === undefined) k2 = k;
@@ -41,15 +42,14 @@ function NotFound(_a) {
41
42
  React.createElement("div", { className: "h2 text-warning round-edge" }, "404"),
42
43
  React.createElement("div", { style: { margin: "1.4rem 0px" } }, header ? header
43
44
  :
44
- React.createElement("div", { className: "text-bigger text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Page Not Found")),
45
+ React.createElement("div", { className: "text-big text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Page Not Found")),
45
46
  content ? content :
46
47
  React.createElement("div", { className: "article" },
47
48
  React.createElement(Text_1.default, { article: true, text: "Sorry, we couldn't find the page you're looking for.", color: "dark300", block: true })),
48
49
  React.createElement("div", { style: { margin: "2rem 0px" } }, action ? action :
49
50
  React.createElement("div", { className: "row-flex gap", style: { justifyContent: "center", gap: "0.4rem" } },
50
- React.createElement(Button_1.default, { raised: true, rounded: true, startIcon: React.createElement(pi_1.PiHouse, null), bg: 'primary', onClick: function () {
51
- var previousUrl = '/';
52
- window.location.assign(previousUrl);
53
- } }, "Back To Home"))))))));
51
+ React.createElement(Button_1.default, { raised: true, rounded: true, startIcon: React.createElement(pi_1.PiArrowLeft, null), bg: 'primary', onClick: function () {
52
+ window.history.back();
53
+ } }, "Go Back"))))))));
54
54
  }
55
55
  exports.default = NotFound;
@@ -1,6 +1,7 @@
1
+ 'use client'
1
2
  import * as React from 'react';
2
3
  import Button from '../button/Button';
3
- import {PiHouse} from 'react-icons/pi'
4
+ import {PiArrowLeft} from 'react-icons/pi'
4
5
  import Text from '../text/Text';
5
6
 
6
7
  interface NotFoundProps {
@@ -34,7 +35,7 @@ export default function NotFound(
34
35
  {
35
36
  header ? header
36
37
  :
37
- <div className="text-bigger text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
38
+ <div className="text-big text-bold text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
38
39
  Page Not Found
39
40
  </div>
40
41
  }
@@ -49,12 +50,10 @@ export default function NotFound(
49
50
  {
50
51
  action ? action :
51
52
  <div className="row-flex gap" style={{ justifyContent: "center", gap: "0.4rem" }}>
52
- <Button raised rounded startIcon={<PiHouse />} bg='primary' onClick={() => {
53
- const previousUrl = '/';
54
- window.location.assign(previousUrl)
55
-
53
+ <Button raised rounded startIcon={<PiArrowLeft />} bg='primary' onClick={() => {
54
+ window.history.back()
56
55
  }}>
57
- Back To Home
56
+ Go Back
58
57
  </Button>
59
58
  </div>
60
59
  }
@@ -5,5 +5,5 @@ interface UnAuthorizedProps {
5
5
  content?: React.ReactNode;
6
6
  action?: React.ReactNode;
7
7
  }
8
- export default function UnAuthorized({ header, code, content, action }: UnAuthorizedProps): any;
8
+ export default function UnAuthorized({ header, code, content, action }: UnAuthorizedProps): React.JSX.Element;
9
9
  export {};
@@ -40,11 +40,13 @@ function UnAuthorized(_a) {
40
40
  React.createElement("div", { className: "h2 text-warning round-edge" }, "401"),
41
41
  React.createElement("div", { style: { margin: "1.4rem 0px" } }, header ? header
42
42
  :
43
- React.createElement("div", { className: "text-bigger text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Unauthorized Access")),
43
+ React.createElement("div", { className: "text-bigger text-bold text-dark300", style: { display: "block", transition: "all 0.2s linear 0s" } }, "Unauthorized Access")),
44
44
  content ? content :
45
45
  React.createElement("div", { className: "article" }, "Sorry! You do not have access to this resource."),
46
46
  React.createElement("div", { style: { margin: "2rem 0px" } }, action ? action :
47
47
  React.createElement("div", { className: "row-flex gap", style: { justifyContent: "center", gap: "0.4rem" } },
48
- React.createElement(Button_1.default, { raised: true, startIcon: React.createElement(pi_1.PiHouse, null), bg: 'primary800', onClick: function () { return window.location.assign("/"); } }, "Back To Home"))))))));
48
+ React.createElement(Button_1.default, { raised: true, rounded: true, startIcon: React.createElement(pi_1.PiArrowLeft, null), bg: 'primary', onClick: function () {
49
+ window.history.back();
50
+ } }, "Go Back"))))))));
49
51
  }
50
52
  exports.default = UnAuthorized;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import Button from '../button/Button';
3
- import {PiHouse} from 'react-icons/pi'
3
+ import {PiArrowLeft} from 'react-icons/pi'
4
4
 
5
5
  interface UnAuthorizedProps {
6
6
  header?:React.ReactNode
@@ -33,7 +33,7 @@ export default function UnAuthorized(
33
33
  {
34
34
  header ? header
35
35
  :
36
- <div className="text-bigger text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
36
+ <div className="text-bigger text-bold text-dark300" style={{ display: "block", transition: "all 0.2s linear 0s" }}>
37
37
  Unauthorized Access
38
38
  </div>
39
39
  }
@@ -48,9 +48,11 @@ export default function UnAuthorized(
48
48
  {
49
49
  action ? action :
50
50
  <div className="row-flex gap" style={{ justifyContent: "center", gap: "0.4rem" }}>
51
- <Button raised startIcon={<PiHouse />} bg='primary800' onClick={() => window.location.assign("/")}>
52
- Back To Home
53
- </Button>
51
+ <Button raised rounded startIcon={<PiArrowLeft />} bg='primary' onClick={() => {
52
+ window.history.back()
53
+ }}>
54
+ Go Back
55
+ </Button>
54
56
  </div>
55
57
  }
56
58
  </div>
@@ -10,5 +10,5 @@ interface ProgressBarProps {
10
10
  raised?: boolean;
11
11
  rounded?: boolean;
12
12
  }
13
- export default function ProgressBar({ funcss, progress, height, children, content, raised, rounded, bg, lined, }: ProgressBarProps): any;
13
+ export default function ProgressBar({ funcss, progress, height, children, content, raised, rounded, bg, lined, }: ProgressBarProps): React.JSX.Element;
14
14
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import * as React from 'react';
2
3
  interface FunLoaderProps {
3
4
  funcss?: string;
4
5
  position?: "left" | "right";
@@ -10,5 +11,5 @@ interface FunLoaderProps {
10
11
  footer?: ReactNode;
11
12
  fixed?: boolean;
12
13
  }
13
- export default function SideBar({ funcss, position, glassy, header, open, content, close, footer, fixed, ...rest }: FunLoaderProps): any;
14
+ export default function SideBar({ funcss, position, glassy, header, open, content, close, footer, fixed, ...rest }: FunLoaderProps): React.JSX.Element;
14
15
  export {};
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface NotFoundProps {
3
3
  content?: React.ReactNode;
4
4
  }
5
- export default function SideContent({ content, }: NotFoundProps): any;
5
+ export default function SideContent({ content, }: NotFoundProps): React.JSX.Element;
6
6
  export {};
@@ -1,12 +1,15 @@
1
1
  import * as React from 'react';
2
2
  interface SnackbarProps {
3
3
  message: string;
4
- close: React.ReactNode;
4
+ close?: React.ReactNode;
5
5
  open: boolean;
6
+ setOpen: (val: boolean) => void;
6
7
  position: string;
7
8
  funcss?: string;
8
9
  animation?: string;
9
10
  duration?: number;
11
+ autoHide?: boolean;
12
+ autoHideDuration?: number;
10
13
  flat?: boolean;
11
14
  }
12
15
  declare const SnackBar: React.FC<SnackbarProps>;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
4
  if (k2 === undefined) k2 = k;
@@ -25,19 +26,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
26
  Object.defineProperty(exports, "__esModule", { value: true });
26
27
  var React = __importStar(require("react"));
27
28
  var SnackBar = function (_a) {
28
- var message = _a.message, close = _a.close, open = _a.open, position = _a.position, funcss = _a.funcss, animation = _a.animation, duration = _a.duration, flat = _a.flat;
29
- if (open) {
30
- return (React.createElement("div", null,
31
- React.createElement("div", { className: "snackbar ".concat(position, " ").concat(funcss, " ").concat(flat ? "flat" : ""), style: { animation: " ".concat(duration, "s ").concat(animation) } },
32
- React.createElement("div", { className: "snackbar-content" },
33
- React.createElement("div", { className: "snackbar-body" }, message),
34
- close &&
35
- React.createElement("div", null,
36
- React.createElement("span", { className: "close-snackbar" },
37
- React.createElement("span", null, close)))))));
38
- }
39
- else {
40
- return React.createElement("div", null);
41
- }
29
+ var message = _a.message, close = _a.close, open = _a.open, setOpen = _a.setOpen, position = _a.position, funcss = _a.funcss, animation = _a.animation, _b = _a.duration, duration = _b === void 0 ? 0.3 : _b, _c = _a.autoHide, autoHide = _c === void 0 ? false : _c, _d = _a.autoHideDuration, autoHideDuration = _d === void 0 ? 3000 : _d, flat = _a.flat;
30
+ React.useEffect(function () {
31
+ if (open && autoHide) {
32
+ var timer_1 = setTimeout(function () {
33
+ setOpen(false);
34
+ }, autoHideDuration);
35
+ return function () { return clearTimeout(timer_1); };
36
+ }
37
+ }, [open, autoHide, autoHideDuration, setOpen]);
38
+ if (!open)
39
+ return null;
40
+ return (React.createElement("div", { className: "snackbar ".concat(position, " ").concat(funcss || '', " ").concat(flat ? 'flat' : ''), style: { animation: "".concat(duration, "s ").concat(animation || 'SlideUp') } },
41
+ React.createElement("div", { className: "snackbar-content" },
42
+ React.createElement("div", { className: "snackbar-body" }, message),
43
+ close && (React.createElement("div", { className: "close-snackbar pointer", onClick: function () { return setOpen ? setOpen(false) : null; } }, close)))));
42
44
  };
43
45
  exports.default = SnackBar;