funuicss 2.5.8 → 2.5.9

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 (214) hide show
  1. package/dist/assets/colors/colors.d.ts +347 -0
  2. package/dist/assets/colors/colors.js +348 -0
  3. package/dist/index.d.ts +37 -0
  4. package/dist/index.js +80 -0
  5. package/dist/js/Fun.d.ts +38 -0
  6. package/dist/js/Fun.js +235 -0
  7. package/dist/js/Theme.d.ts +2 -0
  8. package/dist/js/Theme.js +42 -0
  9. package/dist/tsconfig.tsbuildinfo +1 -0
  10. package/dist/ui/alert/Alert.d.ts +24 -0
  11. package/dist/ui/alert/Alert.js +48 -0
  12. package/dist/ui/aos/AOS.d.ts +9 -0
  13. package/dist/ui/aos/AOS.js +30 -0
  14. package/dist/ui/appbar/AppBar.d.ts +17 -0
  15. package/dist/ui/appbar/AppBar.js +43 -0
  16. package/dist/ui/appbar/Hamburger.d.ts +7 -0
  17. package/dist/ui/appbar/Hamburger.js +20 -0
  18. package/dist/ui/avatar/Avatar.d.ts +10 -0
  19. package/dist/ui/avatar/Avatar.js +12 -0
  20. package/dist/ui/blob/Blob.d.ts +10 -0
  21. package/dist/ui/blob/Blob.js +16 -0
  22. package/dist/ui/breadcrumb/BreadCrumb.d.ts +7 -0
  23. package/dist/ui/breadcrumb/BreadCrumb.js +10 -0
  24. package/dist/ui/button/Button.d.ts +39 -0
  25. package/dist/ui/button/Button.js +66 -0
  26. package/dist/ui/card/Card.d.ts +32 -0
  27. package/dist/ui/card/Card.js +39 -0
  28. package/dist/ui/card/CardBody.d.ts +7 -0
  29. package/dist/ui/card/CardBody.js +30 -0
  30. package/dist/ui/card/CardFab.d.ts +8 -0
  31. package/dist/ui/card/CardFab.js +31 -0
  32. package/dist/ui/card/CardFooter.d.ts +7 -0
  33. package/dist/ui/card/CardFooter.js +30 -0
  34. package/dist/ui/card/CardHeader.d.ts +7 -0
  35. package/dist/ui/card/CardHeader.js +30 -0
  36. package/dist/ui/container/Container.d.ts +11 -0
  37. package/dist/ui/container/Container.js +31 -0
  38. package/dist/ui/div/Div.d.ts +19 -0
  39. package/dist/ui/div/Div.js +31 -0
  40. package/dist/ui/drop/Action.d.ts +7 -0
  41. package/dist/ui/drop/Action.js +8 -0
  42. package/dist/ui/drop/Down.d.ts +9 -0
  43. package/dist/ui/drop/Down.js +8 -0
  44. package/dist/ui/drop/Dropdown.d.ts +18 -0
  45. package/dist/ui/drop/Dropdown.js +31 -0
  46. package/dist/ui/drop/Item.d.ts +8 -0
  47. package/dist/ui/drop/Item.js +8 -0
  48. package/dist/ui/drop/Menu.d.ts +12 -0
  49. package/dist/ui/drop/Menu.js +11 -0
  50. package/dist/ui/drop/Up.d.ts +9 -0
  51. package/dist/ui/drop/Up.js +8 -0
  52. package/dist/ui/grid/Col.d.ts +14 -0
  53. package/dist/ui/grid/Col.js +40 -0
  54. package/dist/ui/grid/Grid.d.ts +12 -0
  55. package/dist/ui/grid/Grid.js +34 -0
  56. package/dist/ui/input/Iconic.d.ts +11 -0
  57. package/dist/ui/input/Iconic.js +15 -0
  58. package/dist/ui/input/Input.d.ts +35 -0
  59. package/dist/ui/input/Input.js +110 -0
  60. package/dist/ui/list/Item.d.ts +7 -0
  61. package/dist/ui/list/Item.js +30 -0
  62. package/dist/ui/list/List.d.ts +14 -0
  63. package/dist/ui/list/List.js +30 -0
  64. package/dist/ui/loader/Loader.d.ts +10 -0
  65. package/dist/ui/loader/Loader.js +37 -0
  66. package/dist/ui/modal/Action.d.ts +7 -0
  67. package/dist/ui/modal/Action.js +30 -0
  68. package/dist/ui/modal/Close.d.ts +6 -0
  69. package/dist/ui/modal/Close.js +31 -0
  70. package/dist/ui/modal/Content.d.ts +7 -0
  71. package/dist/ui/modal/Content.js +8 -0
  72. package/dist/ui/modal/Header.d.ts +9 -0
  73. package/dist/ui/modal/Header.js +30 -0
  74. package/dist/ui/modal/Modal.d.ts +32 -0
  75. package/dist/ui/modal/Modal.js +61 -0
  76. package/dist/ui/notification/Content.d.ts +7 -0
  77. package/dist/ui/notification/Content.js +8 -0
  78. package/dist/ui/notification/Footer.d.ts +7 -0
  79. package/dist/ui/notification/Footer.js +8 -0
  80. package/dist/ui/notification/Header.d.ts +7 -0
  81. package/dist/ui/notification/Header.js +8 -0
  82. package/dist/ui/notification/Notification.d.ts +15 -0
  83. package/dist/ui/notification/Notification.js +23 -0
  84. package/dist/ui/page/NotFound.d.ts +9 -0
  85. package/dist/ui/page/NotFound.js +23 -0
  86. package/dist/ui/page/UnAuthorized.d.ts +9 -0
  87. package/dist/ui/page/UnAuthorized.js +21 -0
  88. package/dist/ui/progress/Bar.d.ts +17 -0
  89. package/dist/ui/progress/Bar.js +87 -0
  90. package/dist/ui/sidebar/SideBar.d.ts +14 -0
  91. package/dist/ui/sidebar/SideBar.js +42 -0
  92. package/dist/ui/sidebar/SideContent.d.ts +6 -0
  93. package/dist/ui/sidebar/SideContent.js +8 -0
  94. package/dist/ui/snackbar/SnackBar.d.ts +16 -0
  95. package/dist/ui/snackbar/SnackBar.js +53 -0
  96. package/dist/ui/specials/Circle.d.ts +15 -0
  97. package/dist/ui/specials/Circle.js +34 -0
  98. package/dist/ui/specials/FullCenteredPage.d.ts +8 -0
  99. package/dist/ui/specials/FullCenteredPage.js +30 -0
  100. package/dist/ui/specials/Hr.d.ts +7 -0
  101. package/dist/ui/specials/Hr.js +8 -0
  102. package/dist/ui/specials/RowFlex.d.ts +14 -0
  103. package/dist/ui/specials/RowFlex.js +34 -0
  104. package/dist/ui/specials/Section.d.ts +8 -0
  105. package/dist/ui/specials/Section.js +30 -0
  106. package/dist/ui/step/Container.d.ts +9 -0
  107. package/dist/ui/step/Container.js +8 -0
  108. package/dist/ui/step/Header.d.ts +7 -0
  109. package/dist/ui/step/Header.js +8 -0
  110. package/dist/ui/step/Line.d.ts +7 -0
  111. package/dist/ui/step/Line.js +9 -0
  112. package/dist/ui/step/Step.d.ts +7 -0
  113. package/dist/ui/step/Step.js +9 -0
  114. package/dist/ui/table/Body.d.ts +7 -0
  115. package/dist/ui/table/Body.js +8 -0
  116. package/dist/ui/table/Data.d.ts +8 -0
  117. package/dist/ui/table/Data.js +8 -0
  118. package/dist/ui/table/Head.d.ts +7 -0
  119. package/dist/ui/table/Head.js +8 -0
  120. package/dist/ui/table/Row.d.ts +9 -0
  121. package/dist/ui/table/Row.js +8 -0
  122. package/dist/ui/table/Table.d.ts +33 -0
  123. package/dist/ui/table/Table.js +133 -0
  124. package/dist/ui/text/Text.d.ts +44 -0
  125. package/dist/ui/text/Text.js +63 -0
  126. package/dist/ui/theme/dark.d.ts +5 -0
  127. package/dist/ui/theme/dark.js +34 -0
  128. package/dist/ui/theme/theme.d.ts +7 -0
  129. package/dist/ui/theme/theme.js +34 -0
  130. package/dist/ui/tooltip/Tip.d.ts +12 -0
  131. package/dist/ui/tooltip/Tip.js +31 -0
  132. package/dist/ui/tooltip/ToolTip.d.ts +7 -0
  133. package/dist/ui/tooltip/ToolTip.js +30 -0
  134. package/dist/ui/video/FunPlayer.d.ts +0 -0
  135. package/dist/ui/video/FunPlayer.js +203 -0
  136. package/dist/webpack.config.d.ts +23 -0
  137. package/package.json +13 -12
  138. package/tsconfig.json +12 -10
  139. package/tsconfig.tsbuildinfo +1 -1
  140. package/types/next-env.d.ts +3 -0
  141. package/types/react-easy-export.d.ts +4 -0
  142. package/ui/alert/Alert.js +18 -8
  143. package/ui/alert/Alert.tsx +1 -1
  144. package/ui/aos/AOS.js +18 -8
  145. package/ui/appbar/AppBar.js +23 -19
  146. package/ui/appbar/AppBar.tsx +5 -12
  147. package/ui/appbar/Hamburger.js +17 -7
  148. package/ui/avatar/Avatar.js +19 -8
  149. package/ui/avatar/Avatar.tsx +1 -0
  150. package/ui/blob/Blob.js +17 -7
  151. package/ui/breadcrumb/BreadCrumb.js +19 -8
  152. package/ui/breadcrumb/BreadCrumb.tsx +1 -0
  153. package/ui/button/Button.js +19 -8
  154. package/ui/button/Button.tsx +5 -6
  155. package/ui/card/Card.js +2 -1
  156. package/ui/card/Card.tsx +1 -0
  157. package/ui/card/CardBody.js +1 -1
  158. package/ui/card/CardFab.js +1 -1
  159. package/ui/card/CardFooter.js +1 -1
  160. package/ui/card/CardHeader.js +1 -1
  161. package/ui/container/Container.js +17 -7
  162. package/ui/container/Container.tsx +1 -1
  163. package/ui/div/Div.js +18 -7
  164. package/ui/div/Div.tsx +1 -0
  165. package/ui/drop/Action.js +17 -7
  166. package/ui/drop/Down.js +17 -7
  167. package/ui/drop/Dropdown.js +17 -7
  168. package/ui/drop/Dropdown.tsx +1 -2
  169. package/ui/drop/Item.js +18 -8
  170. package/ui/drop/Menu.js +18 -8
  171. package/ui/drop/Up.js +17 -7
  172. package/ui/grid/Col.js +18 -8
  173. package/ui/grid/Grid.js +18 -8
  174. package/ui/input/Iconic.js +1 -1
  175. package/ui/input/Input.js +17 -7
  176. package/ui/list/Item.js +18 -8
  177. package/ui/list/List.js +18 -8
  178. package/ui/loader/Loader.js +18 -8
  179. package/ui/modal/Action.js +18 -8
  180. package/ui/modal/Close.js +18 -8
  181. package/ui/modal/Content.js +18 -8
  182. package/ui/modal/Header.js +18 -8
  183. package/ui/modal/Modal.js +18 -8
  184. package/ui/notification/Content.js +18 -8
  185. package/ui/notification/Footer.js +18 -8
  186. package/ui/notification/Header.js +18 -8
  187. package/ui/notification/Notification.js +19 -8
  188. package/ui/notification/Notification.tsx +1 -0
  189. package/ui/page/NotFound.js +18 -8
  190. package/ui/page/UnAuthorized.js +18 -8
  191. package/ui/progress/Bar.js +19 -8
  192. package/ui/progress/Bar.tsx +1 -0
  193. package/ui/sidebar/SideBar.js +18 -8
  194. package/ui/sidebar/SideContent.js +1 -1
  195. package/ui/snackbar/SnackBar.js +17 -7
  196. package/ui/specials/Circle.js +18 -8
  197. package/ui/specials/FullCenteredPage.js +17 -7
  198. package/ui/specials/Hr.js +17 -7
  199. package/ui/specials/RowFlex.js +18 -8
  200. package/ui/specials/Section.js +17 -7
  201. package/ui/step/Line.js +1 -0
  202. package/ui/step/Line.tsx +1 -0
  203. package/ui/step/Step.js +1 -0
  204. package/ui/step/Step.tsx +1 -0
  205. package/ui/table/Body.js +18 -8
  206. package/ui/table/Data.js +18 -8
  207. package/ui/table/Head.js +18 -8
  208. package/ui/table/Row.js +18 -8
  209. package/ui/table/Table.js +21 -9
  210. package/ui/table/Table.tsx +4 -1
  211. package/ui/theme/dark.js +1 -1
  212. package/ui/theme/theme.js +17 -7
  213. package/ui/tooltip/Tip.js +18 -8
  214. package/ui/tooltip/ToolTip.js +18 -8
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var StepLine = function (_a) {
6
+ var children = _a.children, funcss = _a.funcss;
7
+ return ((0, jsx_runtime_1.jsx)("div", { className: "stepLined ".concat(funcss ? funcss : ''), children: children }));
8
+ };
9
+ exports.default = StepLine;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface StepProps {
3
+ children?: ReactNode;
4
+ funcss?: string;
5
+ }
6
+ declare const Step: React.FC<StepProps>;
7
+ export default Step;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var Step = function (_a) {
6
+ var children = _a.children, funcss = _a.funcss;
7
+ return ((0, jsx_runtime_1.jsx)("div", { className: "step ".concat(funcss ? funcss : ''), children: children }));
8
+ };
9
+ exports.default = Step;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ type TableBodyProps = {
3
+ children?: React.ReactNode;
4
+ funcss?: string;
5
+ };
6
+ export default function TableBody({ children, funcss }: TableBodyProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TableBody;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ function TableBody(_a) {
6
+ var children = _a.children, funcss = _a.funcss;
7
+ return (0, jsx_runtime_1.jsx)("tbody", { className: "".concat(funcss ? funcss : ''), children: children ? children : '' });
8
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface TableDataProps {
3
+ children?: React.ReactNode;
4
+ funcss?: string;
5
+ key?: string;
6
+ }
7
+ export default function TableData({ children, funcss, key }: TableDataProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TableData;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ function TableData(_a) {
6
+ var children = _a.children, funcss = _a.funcss, key = _a.key;
7
+ return ((0, jsx_runtime_1.jsx)("td", { className: "".concat(funcss), children: children }, key));
8
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ type TableHeadProps = {
3
+ children?: React.ReactNode;
4
+ funcss?: string;
5
+ };
6
+ export default function TableHead({ children, funcss }: TableHeadProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TableHead;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ function TableHead(_a) {
6
+ var children = _a.children, funcss = _a.funcss;
7
+ return (0, jsx_runtime_1.jsx)("thead", { className: "".concat(funcss ? funcss : ''), children: children });
8
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ type TableRowProps = {
3
+ children?: React.ReactNode;
4
+ funcss?: string;
5
+ rowKey?: React.Key;
6
+ key?: React.Key;
7
+ };
8
+ export default function TableRow({ children, funcss, rowKey, key }: TableRowProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TableRow;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ function TableRow(_a) {
6
+ var children = _a.children, funcss = _a.funcss, rowKey = _a.rowKey, key = _a.key;
7
+ return ((0, jsx_runtime_1.jsx)("tr", { className: "".concat(funcss ? funcss : ''), children: children }, key ? key : rowKey));
8
+ }
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ type TableProps = {
3
+ children?: React.ReactNode;
4
+ funcss?: string;
5
+ title?: string;
6
+ bordered?: boolean;
7
+ noStripped?: boolean;
8
+ hoverable?: boolean;
9
+ showTotal?: boolean;
10
+ light?: boolean;
11
+ isLoading?: boolean;
12
+ dark?: boolean;
13
+ data?: {
14
+ "fields": string[];
15
+ "data": any[];
16
+ "titles": string[];
17
+ };
18
+ head?: React.ReactNode;
19
+ right?: React.ReactNode;
20
+ body?: React.ReactNode;
21
+ height?: number;
22
+ pageSize?: number;
23
+ customColumns?: {
24
+ title: string;
25
+ render: (data: any) => React.ReactNode;
26
+ onClick?: (data: any) => void;
27
+ }[];
28
+ filterableFields?: string[];
29
+ };
30
+ export default function Table({ children, funcss, bordered, noStripped, hoverable, title, showTotal, light, dark, head, body, data, isLoading, right, height, pageSize, // Default page size,
31
+ customColumns, filterableFields, // New prop
32
+ ...rest }: TableProps): import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __rest = (this && this.__rest) || function (s, e) {
15
+ var t = {};
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
17
+ t[p] = s[p];
18
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
19
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
21
+ t[p[i]] = s[p[i]];
22
+ }
23
+ return t;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.default = Table;
30
+ var jsx_runtime_1 = require("react/jsx-runtime");
31
+ var Head_1 = __importDefault(require("./Head"));
32
+ var Body_1 = __importDefault(require("./Body"));
33
+ var Row_1 = __importDefault(require("./Row"));
34
+ var Data_1 = __importDefault(require("./Data"));
35
+ var react_1 = require("react");
36
+ var RowFlex_1 = __importDefault(require("../specials/RowFlex"));
37
+ var Button_1 = __importDefault(require("../button/Button"));
38
+ var pi_1 = require("react-icons/pi");
39
+ var Circle_1 = __importDefault(require("../specials/Circle"));
40
+ var Text_1 = __importDefault(require("../text/Text"));
41
+ var react_easy_export_1 = require("react-easy-export");
42
+ function Table(_a) {
43
+ var _b, _c;
44
+ var children = _a.children, funcss = _a.funcss, bordered = _a.bordered, noStripped = _a.noStripped, hoverable = _a.hoverable, title = _a.title, showTotal = _a.showTotal, light = _a.light, dark = _a.dark, head = _a.head, body = _a.body, data = _a.data, isLoading = _a.isLoading, right = _a.right, height = _a.height, _d = _a.pageSize, pageSize = _d === void 0 ? data ? 10 : 0 : _d, // Default page size,
45
+ customColumns = _a.customColumns, filterableFields = _a.filterableFields, // New prop
46
+ rest = __rest(_a, ["children", "funcss", "bordered", "noStripped", "hoverable", "title", "showTotal", "light", "dark", "head", "body", "data", "isLoading", "right", "height", "pageSize", "customColumns", "filterableFields"]);
47
+ // Check if data is null or undefined before accessing its properties
48
+ var _e = (0, react_1.useState)((data === null || data === void 0 ? void 0 : data.data) ? "" : ""), search = _e[0], setSearch = _e[1];
49
+ var _f = (0, react_1.useState)(1), currentPage = _f[0], setCurrentPage = _f[1];
50
+ // Determine the total number of pages based on data length and page size
51
+ var totalPages = data ? Math.ceil((((_b = data === null || data === void 0 ? void 0 : data.data) === null || _b === void 0 ? void 0 : _b.length) || 0) / pageSize) : 0;
52
+ // Calculate start and end indices for data pagination
53
+ var startIndex = data ? (currentPage - 1) * pageSize : 0;
54
+ var endIndex = data ? Math.min(startIndex + pageSize, ((_c = data === null || data === void 0 ? void 0 : data.data) === null || _c === void 0 ? void 0 : _c.length) || 0) : 0;
55
+ var _g = (0, react_1.useState)(null), selectedField = _g[0], setSelectedField = _g[1];
56
+ var _h = (0, react_1.useState)(null), selectedValue = _h[0], setSelectedValue = _h[1];
57
+ // Function to handle page change
58
+ var handleChangePage = function (page) {
59
+ if (data) {
60
+ setCurrentPage(page);
61
+ }
62
+ };
63
+ var handleFieldChange = function (field) {
64
+ setSelectedField(field);
65
+ setSelectedValue(null); // Reset selected value when field changes
66
+ };
67
+ var handleValueChange = function (value) {
68
+ setSelectedValue(value);
69
+ };
70
+ var filteredData = data ? data === null || data === void 0 ? void 0 : data.data.filter(function (item) {
71
+ if (!search && !selectedField && !selectedValue)
72
+ return true;
73
+ if (selectedField && selectedValue) {
74
+ var value = item[selectedField];
75
+ if (value) {
76
+ return value.toString().toLowerCase() === selectedValue.toString().toLowerCase();
77
+ }
78
+ }
79
+ if (selectedField) {
80
+ var value = item[selectedField];
81
+ if (value) {
82
+ return value.toString().toLowerCase().includes(search.toString().toLowerCase());
83
+ }
84
+ }
85
+ return Object.values(item).some(function (value) {
86
+ if (value) {
87
+ return value.toString().toLowerCase().includes(search.toString().toLowerCase());
88
+ }
89
+ });
90
+ })
91
+ : [];
92
+ // Maximum number of visible pages for pagination
93
+ var maxVisiblePages = 5;
94
+ // Determine which pages to display
95
+ var startPage = data ? Math.max(1, currentPage - Math.floor(maxVisiblePages / 2)) : 0;
96
+ var endPage = data ? Math.min(startPage + maxVisiblePages - 1, totalPages) : 0;
97
+ // Adjust startPage and endPage if there are not enough pages to fill maxVisiblePages
98
+ if (endPage - startPage + 1 < maxVisiblePages) {
99
+ startPage = Math.max(1, endPage - maxVisiblePages + 1);
100
+ }
101
+ // Function to export data to CSV
102
+ var Export = function () {
103
+ (0, react_easy_export_1.exportToCSV)(filteredData, title ? "".concat(title, " ").concat(selectedField ? "_".concat(selectedField) : '', ".csv") : 'data.csv');
104
+ };
105
+ // Extract the data array
106
+ var dataArray = data ? data.data : [];
107
+ // Remove duplicate values
108
+ var uniqueValues = selectedField
109
+ ? Array.from(new Set(dataArray.map(function (item) { return item[selectedField]; })))
110
+ : [];
111
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "".concat(funcss ? funcss : '', " roundEdge"), children: [data &&
112
+ (0, jsx_runtime_1.jsx)("div", { className: "padding bb", children: (0, jsx_runtime_1.jsxs)(RowFlex_1.default, { justify: 'space-between', children: [(0, jsx_runtime_1.jsxs)("div", { children: [title &&
113
+ (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Text_1.default, { text: title || "", size: 'h4' }) }), showTotal && data &&
114
+ (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { text: 'Records:', size: 'sm', color: 'primary' }), (0, jsx_runtime_1.jsx)(Text_1.default, { text: filteredData.length, size: 'h6' })] })] }), data && filterableFields ?
115
+ (0, jsx_runtime_1.jsx)("div", { className: "col width-200-max", children: (0, jsx_runtime_1.jsxs)(RowFlex_1.default, { gap: 0.7, children: [(0, jsx_runtime_1.jsxs)("select", { className: " input borderedInput roundEdgeSmall smallInput", value: selectedField || '', onChange: function (e) {
116
+ handleFieldChange(e.target.value);
117
+ }, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "\uD83D\uDD0D Filter" }), (0, jsx_runtime_1.jsx)("option", { value: "", children: "All*" }), filterableFields === null || filterableFields === void 0 ? void 0 : filterableFields.map(function (field) { return ((0, jsx_runtime_1.jsx)("option", { value: field, children: field }, field)); })] }), selectedField && (0, jsx_runtime_1.jsx)("div", { children: "=" }), selectedField && ((0, jsx_runtime_1.jsxs)("select", { className: " input borderedInput width-200-max roundEdgeSmall smallInput", value: selectedValue || '', onChange: function (e) {
118
+ handleValueChange(e.target.value);
119
+ handleChangePage(1);
120
+ }, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "All*" }), uniqueValues.map(function (item) { return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: item &&
121
+ (0, jsx_runtime_1.jsx)("option", { value: item, children: item.toString() }, item[selectedField]) })); })] }))] }) })
122
+ : '', (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(RowFlex_1.default, { gap: 0.5, children: [right && right, (0, jsx_runtime_1.jsx)(Button_1.default, { small: true, bold: true, text: 'Export', startIcon: (0, jsx_runtime_1.jsx)(pi_1.PiFileCsv, {}), color: 'gradient', onClick: Export })] }) })] }) }), (0, jsx_runtime_1.jsxs)("table", __assign({ className: "table ".concat(bordered ? 'border' : '', " ").concat(noStripped ? '' : 'stripped', " ").concat(hoverable ? 'hoverableTr' : '', " ").concat(light ? 'light' : '', " ").concat(dark ? 'dark' : ''), style: {
123
+ height: height ? height + "px" : ""
124
+ } }, rest, { children: [data &&
125
+ (data === null || data === void 0 ? void 0 : data.titles) &&
126
+ (0, jsx_runtime_1.jsx)(Head_1.default, { children: data.titles.map(function (mdoc) { return ((0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(Text_1.default, { text: mdoc, bold: true, color: 'primary' }) }, mdoc)); }) }), head && (0, jsx_runtime_1.jsx)(Head_1.default, { children: head }), body && (0, jsx_runtime_1.jsx)(Body_1.default, { children: body }), data &&
127
+ filteredData.slice(startIndex, endIndex).map(function (mdoc, index) { return ((0, jsx_runtime_1.jsxs)(Row_1.default, { rowKey: index, children: [data.fields.map(function (fdoc) { return ((0, jsx_runtime_1.jsx)(Data_1.default, { children: mdoc[fdoc] }, fdoc)); }), customColumns ?
128
+ customColumns.map(function (column, columnIndex) { return ((0, jsx_runtime_1.jsxs)("td", { children: [column.render && column.render(mdoc), column.onClick && ((0, jsx_runtime_1.jsx)(Button_1.default, { onClick: function () { return column.onClick && column.onClick(mdoc); }, children: column.title }))] }, columnIndex)); }) : ""] })); }), isLoading &&
129
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function () { return ((0, jsx_runtime_1.jsx)(Row_1.default, { funcss: 'skeleton' })); }), children ? children : ''] })), data &&
130
+ (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: pageSize &&
131
+ (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: filteredData.length > pageSize &&
132
+ (0, jsx_runtime_1.jsx)("div", { className: "padding bt", children: (0, jsx_runtime_1.jsx)(RowFlex_1.default, { gap: 1, justify: 'center', children: (0, jsx_runtime_1.jsx)("div", { className: "pagination", children: Array.from({ length: endPage - startPage + 1 }, function (_, i) { return ((0, jsx_runtime_1.jsx)(Circle_1.default, { size: 2.5, onClick: function () { return handleChangePage(startPage + i); }, funcss: currentPage === startPage + i ? 'primary pageCircle' : 'dark800 pageCircle text-primary', children: (0, jsx_runtime_1.jsx)(Text_1.default, { text: "".concat(startPage + i), bold: true, size: 'sm' }) }, startPage + i)); }) }) }) }) }) })] }));
133
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ type TypographyProps = {
3
+ id?: string;
4
+ text?: React.ReactNode;
5
+ funcss?: string;
6
+ bg?: string;
7
+ color?: string;
8
+ hoverBg?: string;
9
+ hoverText?: string;
10
+ monospace?: boolean;
11
+ emp?: boolean;
12
+ bold?: boolean;
13
+ block?: boolean;
14
+ body?: boolean;
15
+ article?: boolean;
16
+ light?: boolean;
17
+ lighter?: boolean;
18
+ italic?: boolean;
19
+ underline?: boolean;
20
+ weight?: number;
21
+ quote?: boolean;
22
+ align?: "left" | "center" | "right" | "justify";
23
+ lineHeight?: string;
24
+ letterSpacing?: string;
25
+ uppercase?: boolean;
26
+ lowercase?: boolean;
27
+ capitalize?: boolean;
28
+ textDecoration?: "none" | "underline" | "overline" | "line-through";
29
+ textTransform?: "none" | "capitalize" | "uppercase" | "lowercase";
30
+ whiteSpace?: "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
31
+ wordBreak?: "normal" | "break-all" | "keep-all" | "break-word";
32
+ fontFamily?: string;
33
+ textShadow?: string;
34
+ textAlign?: "left" | "center" | "right" | "justify";
35
+ opacity?: number;
36
+ zIndex?: number;
37
+ transform?: string;
38
+ customStyles?: React.CSSProperties;
39
+ onClick?: () => void;
40
+ children?: React.ReactNode;
41
+ size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
42
+ };
43
+ declare const Text: React.FC<TypographyProps>;
44
+ export default Text;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var pi_1 = require("react-icons/pi");
27
+ var Text = function (_a) {
28
+ var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, _b = _a.size, size = _b === void 0 ? 'base' : _b, // default
29
+ rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "textShadow", "textAlign", "customStyles", "monospace", "quote", "size"]);
30
+ var Tag = block ? 'div' : 'span';
31
+ var sizeClass = "".concat(size === 'h1' ? "h1" :
32
+ size === 'h2' ? "h2" :
33
+ size === 'h3' ? "h3" :
34
+ size === 'h4' ? "h4" :
35
+ size === 'h5' ? "h5" :
36
+ size === 'h6' ? "h6" :
37
+ "text-".concat(size));
38
+ var mergedStyles = __assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : weight ? weight : undefined, lineHeight: lineHeight, letterSpacing: letterSpacing, textTransform: textTransform, textDecoration: textDecoration, fontFamily: fontFamily, textShadow: textShadow, textAlign: textAlign, whiteSpace: whiteSpace, wordBreak: wordBreak, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles);
39
+ var classNames = [
40
+ funcss || '',
41
+ sizeClass,
42
+ color ? "text-".concat(color) : '',
43
+ align ? "text-".concat(align) : '',
44
+ monospace ? 'monospace' : '',
45
+ bg || '',
46
+ hoverText ? "hover-text-".concat(hoverText) : '',
47
+ hoverBg ? "hover-".concat(hoverBg) : '',
48
+ light ? 'lightText' : lighter ? 'lighterText' : '',
49
+ italic ? 'italicText' : '',
50
+ underline ? 'underlineText' : '',
51
+ body ? 'body' : '',
52
+ article ? 'article' : '',
53
+ emp ? 'emp' : '',
54
+ bold ? 'bold' : '',
55
+ uppercase ? 'uppercase' : '',
56
+ lowercase ? 'lowercase' : '',
57
+ capitalize ? 'capitalize' : '',
58
+ ]
59
+ .filter(Boolean)
60
+ .join(' ');
61
+ return ((0, jsx_runtime_1.jsxs)(Tag, __assign({ id: id, className: classNames, style: mergedStyles }, rest, { children: [quote && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(pi_1.PiQuotesLight, {}) })), children, text] })));
62
+ };
63
+ exports.default = Text;
@@ -0,0 +1,5 @@
1
+ type DarkModeProps = {
2
+ state: boolean;
3
+ };
4
+ export default function DarkMode({ state }: DarkModeProps): void;
5
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = DarkMode;
4
+ function DarkMode(_a) {
5
+ var state = _a.state;
6
+ if (state) {
7
+ var root = document.querySelector(':root'); // Properly declare the type of root
8
+ var bdColor = "#FFFFFFD9";
9
+ var borderColor = void 0;
10
+ var raiseColor = void 0;
11
+ borderColor = "#444654";
12
+ raiseColor = "#1e1e1e";
13
+ root.style.setProperty('--bd-theme', "#141414");
14
+ root.style.setProperty('--bd-color', bdColor);
15
+ root.style.setProperty('--borderColor', borderColor);
16
+ root.style.setProperty('--raiseThemes', raiseColor);
17
+ root.style.setProperty('--lighter', "#33333349");
18
+ root.style.setProperty('--inputOutline', "#1e1e1e");
19
+ root.style.setProperty('--lightThemeDark', bdColor);
20
+ // Dark theme for all the colors
21
+ root.style.setProperty('--success', "#1d6640");
22
+ root.style.setProperty('--successLight', " #c7e6c8");
23
+ root.style.setProperty('--info', "#2471a3");
24
+ root.style.setProperty('--infoLight', "#b3d9ed");
25
+ root.style.setProperty('--warning', "#8c3d00");
26
+ root.style.setProperty('--warningLight', "#d8b69c");
27
+ root.style.setProperty('--danger', "#6b0600");
28
+ root.style.setProperty('--dangerLight', "#bfbfbf");
29
+ // root.style.setProperty('--info', "#2471a3");
30
+ // root.style.setProperty('--infoLight', "#b3d9ed");
31
+ root.style.setProperty('--light', "#c5d8e0");
32
+ root.style.setProperty('--deepLight', "#154556");
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ThemeProviderProps {
3
+ theme: 'light' | 'dark';
4
+ children: React.ReactNode;
5
+ }
6
+ declare const ThemeProvider: React.FC<ThemeProviderProps>;
7
+ export default ThemeProvider;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var react_1 = require("react");
6
+ var ThemeProvider = function (_a) {
7
+ var theme = _a.theme, children = _a.children;
8
+ (0, react_1.useEffect)(function () {
9
+ var root = document.documentElement;
10
+ var lightTheme = {
11
+ '--page-bg': '#FFFFFF',
12
+ '--text-color': '#000000',
13
+ '--raiseThemes': '#FFFFFF',
14
+ };
15
+ var darkTheme = {
16
+ '--page-bg': '#121212',
17
+ '--text-color': '#FFFFFF',
18
+ '--raiseThemes': '#202020',
19
+ '--borderColor': '#333333',
20
+ '--lighter': '#202020',
21
+ };
22
+ var selectedTheme = theme === 'dark' ? darkTheme : lightTheme;
23
+ Object.entries(selectedTheme).forEach(function (_a) {
24
+ var key = _a[0], value = _a[1];
25
+ root.style.setProperty(key, value);
26
+ });
27
+ }, [theme]);
28
+ return ((0, jsx_runtime_1.jsx)("div", { className: "theme-".concat(theme), style: {
29
+ backgroundColor: 'var(--page-bg)',
30
+ color: 'var(--text-color)',
31
+ minHeight: '100vh',
32
+ }, children: children }));
33
+ };
34
+ exports.default = ThemeProvider;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ interface TipProps {
3
+ tip: string;
4
+ funcss?: string;
5
+ children?: React.ReactNode;
6
+ content?: React.ReactNode;
7
+ message?: React.ReactNode;
8
+ animation?: string;
9
+ duration?: number;
10
+ }
11
+ export default function Tip({ tip, funcss, children, content, message, animation, duration, ...rest }: TipProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.default = Tip;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ function Tip(_a) {
28
+ var tip = _a.tip, funcss = _a.funcss, children = _a.children, content = _a.content, message = _a.message, animation = _a.animation, duration = _a.duration, rest = __rest(_a, ["tip", "funcss", "children", "content", "message", "animation", "duration"]);
29
+ var text = message || content || children;
30
+ return ((0, jsx_runtime_1.jsx)("span", __assign({ className: "tip-".concat(tip, " tip ").concat(funcss ? funcss : ''), style: { animation: " ".concat(duration ? duration : 0, "s ").concat(animation ? animation : '') } }, rest, { children: text })));
31
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ interface ToolTipProps {
3
+ funcss?: string;
4
+ children?: React.ReactNode;
5
+ }
6
+ export default function ToolTip({ funcss, children, ...rest }: ToolTipProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.default = ToolTip;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ function ToolTip(_a) {
28
+ var funcss = _a.funcss, children = _a.children, rest = __rest(_a, ["funcss", "children"]);
29
+ return ((0, jsx_runtime_1.jsx)("span", __assign({ className: "tooltip ".concat(funcss !== null && funcss !== void 0 ? funcss : '') }, rest, { children: children })));
30
+ }
File without changes