next-helios-fe 1.0.0
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/@types/index.d.ts +2 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/calendar/big-calendar/event.d.ts +7 -0
- package/dist/components/calendar/big-calendar/index.d.ts +14 -0
- package/dist/components/calendar/big-calendar/toolbar.d.ts +8 -0
- package/dist/components/calendar/calendar/index.d.ts +11 -0
- package/dist/components/chart/index.d.ts +17 -0
- package/dist/components/chip/index.d.ts +12 -0
- package/dist/components/content-container/accordion/index.d.ts +10 -0
- package/dist/components/content-container/accordion/item.d.ts +6 -0
- package/dist/components/content-container/card.d.ts +10 -0
- package/dist/components/content-container/carousel.d.ts +10 -0
- package/dist/components/content-container/drawer.d.ts +8 -0
- package/dist/components/content-container/modal/index.d.ts +21 -0
- package/dist/components/content-container/sortable/index.d.ts +14 -0
- package/dist/components/content-container/sortable/item.d.ts +8 -0
- package/dist/components/content-container/sortable/knob.d.ts +5 -0
- package/dist/components/content-container/tab/index.d.ts +17 -0
- package/dist/components/content-container/tab/window.d.ts +5 -0
- package/dist/components/data-tree/index.d.ts +6 -0
- package/dist/components/dialog/index.d.ts +16 -0
- package/dist/components/dropdown/header.d.ts +5 -0
- package/dist/components/dropdown/index.d.ts +15 -0
- package/dist/components/dropdown/item.d.ts +7 -0
- package/dist/components/form/index.d.ts +44 -0
- package/dist/components/form/input/checkbox.d.ts +9 -0
- package/dist/components/form/input/color.d.ts +10 -0
- package/dist/components/form/input/email.d.ts +9 -0
- package/dist/components/form/input/file.d.ts +14 -0
- package/dist/components/form/input/number.d.ts +9 -0
- package/dist/components/form/input/password.d.ts +9 -0
- package/dist/components/form/input/radio.d.ts +9 -0
- package/dist/components/form/input/range.d.ts +9 -0
- package/dist/components/form/input/search.d.ts +8 -0
- package/dist/components/form/input/text.d.ts +9 -0
- package/dist/components/form/input/time.d.ts +9 -0
- package/dist/components/form/other/autocomplete.d.ts +15 -0
- package/dist/components/form/other/multipleSelect.d.ts +23 -0
- package/dist/components/form/other/phoneNumber.d.ts +10 -0
- package/dist/components/form/other/pin.d.ts +10 -0
- package/dist/components/form/other/secret.d.ts +11 -0
- package/dist/components/form/other/select.d.ts +15 -0
- package/dist/components/form/other/textarea.d.ts +9 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/map/index.d.ts +13 -0
- package/dist/components/map/marker.d.ts +8 -0
- package/dist/components/syntax-highlighter/index.d.ts +9 -0
- package/dist/components/table/action.d.ts +5 -0
- package/dist/components/table/index.d.ts +24 -0
- package/dist/components/timeline/index.d.ts +10 -0
- package/dist/components/timeline/item.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +62 -0
- package/package.json +72 -0
- package/src/components/button/index.tsx +74 -0
- package/src/components/calendar/big-calendar/event.tsx +46 -0
- package/src/components/calendar/big-calendar/index.tsx +102 -0
- package/src/components/calendar/big-calendar/toolbar.tsx +98 -0
- package/src/components/calendar/calendar/index.tsx +26 -0
- package/src/components/chart/index.tsx +121 -0
- package/src/components/chip/index.tsx +47 -0
- package/src/components/content-container/accordion/index.tsx +28 -0
- package/src/components/content-container/accordion/item.tsx +40 -0
- package/src/components/content-container/card.tsx +21 -0
- package/src/components/content-container/carousel.tsx +35 -0
- package/src/components/content-container/drawer.tsx +78 -0
- package/src/components/content-container/modal/index.tsx +127 -0
- package/src/components/content-container/sortable/index.tsx +47 -0
- package/src/components/content-container/sortable/item.tsx +20 -0
- package/src/components/content-container/sortable/knob.tsx +11 -0
- package/src/components/content-container/tab/index.tsx +94 -0
- package/src/components/content-container/tab/window.tsx +10 -0
- package/src/components/data-tree/index.tsx +60 -0
- package/src/components/dialog/index.tsx +88 -0
- package/src/components/dropdown/header.tsx +11 -0
- package/src/components/dropdown/index.tsx +69 -0
- package/src/components/dropdown/item.tsx +22 -0
- package/src/components/form/index.tsx +81 -0
- package/src/components/form/input/checkbox.tsx +49 -0
- package/src/components/form/input/color.tsx +104 -0
- package/src/components/form/input/email.tsx +40 -0
- package/src/components/form/input/file.tsx +189 -0
- package/src/components/form/input/number.tsx +93 -0
- package/src/components/form/input/password.tsx +57 -0
- package/src/components/form/input/radio.tsx +49 -0
- package/src/components/form/input/range.tsx +67 -0
- package/src/components/form/input/search.tsx +50 -0
- package/src/components/form/input/text.tsx +39 -0
- package/src/components/form/input/time.tsx +315 -0
- package/src/components/form/other/autocomplete.tsx +199 -0
- package/src/components/form/other/multipleSelect.tsx +211 -0
- package/src/components/form/other/phoneNumber.tsx +1668 -0
- package/src/components/form/other/pin.tsx +56 -0
- package/src/components/form/other/secret.tsx +74 -0
- package/src/components/form/other/select.tsx +187 -0
- package/src/components/form/other/textarea.tsx +44 -0
- package/src/components/index.ts +29 -0
- package/src/components/map/index.tsx +72 -0
- package/src/components/map/marker.tsx +40 -0
- package/src/components/syntax-highlighter/index.tsx +45 -0
- package/src/components/table/action.tsx +22 -0
- package/src/components/table/index.tsx +431 -0
- package/src/components/timeline/index.tsx +28 -0
- package/src/components/timeline/item.tsx +25 -0
- package/src/index.css +1 -0
- package/src/index.ts +3 -0
- package/src/styles/big-calendar.scss +810 -0
- package/src/styles/calendar.scss +195 -0
- package/src/styles/index.css +2 -0
- package/tsconfig.json +17 -0
- package/webpack.config.js +35 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Copyright (c) 2018 Jed Watson.
|
|
3
|
+
Licensed under the MIT License (MIT), see
|
|
4
|
+
http://jedwatson.github.io/classnames
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* ApexCharts v3.51.0
|
|
9
|
+
* (c) 2018-2024 ApexCharts
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*!
|
|
14
|
+
* tabbable 6.2.0
|
|
15
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/*! *****************************************************************************
|
|
19
|
+
Copyright (c) Microsoft Corporation.
|
|
20
|
+
|
|
21
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
+
purpose with or without fee is hereby granted.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
+
***************************************************************************** */
|
|
32
|
+
|
|
33
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
34
|
+
|
|
35
|
+
/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
36
|
+
|
|
37
|
+
/*! svg.draggable.js - v2.2.2 - 2019-01-08
|
|
38
|
+
* https://github.com/svgdotjs/svg.draggable.js
|
|
39
|
+
* Copyright (c) 2019 Wout Fierens; Licensed MIT */
|
|
40
|
+
|
|
41
|
+
/*! svg.filter.js - v2.0.2 - 2016-02-24
|
|
42
|
+
* https://github.com/wout/svg.filter.js
|
|
43
|
+
* Copyright (c) 2016 Wout Fierens; Licensed MIT */
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @license React
|
|
47
|
+
* react-jsx-runtime.production.min.js
|
|
48
|
+
*
|
|
49
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the MIT license found in the
|
|
52
|
+
* LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
57
|
+
*
|
|
58
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
59
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
60
|
+
* @namespace
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "next-helios-fe",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build:css": "npx postcss src/index.css -o dist/index.css",
|
|
10
|
+
"build:ts": "tsc",
|
|
11
|
+
"build": "webpack"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"apexcharts": "^3.51.0",
|
|
18
|
+
"array-move": "^4.0.0",
|
|
19
|
+
"autoprefixer": "^10.4.19",
|
|
20
|
+
"file-saver": "^2.0.5",
|
|
21
|
+
"leaflet": "^1.9.4",
|
|
22
|
+
"leaflet-defaulticon-compatibility": "^0.1.2",
|
|
23
|
+
"otplib": "^12.0.1",
|
|
24
|
+
"qrcode": "^1.5.3",
|
|
25
|
+
"react-apexcharts": "^1.4.1",
|
|
26
|
+
"react-big-calendar": "^1.13.1",
|
|
27
|
+
"react-calendar": "^5.0.0",
|
|
28
|
+
"react-easy-sort": "^1.6.0",
|
|
29
|
+
"react-google-recaptcha": "^3.1.0",
|
|
30
|
+
"react-google-recaptcha-v3": "^1.10.1",
|
|
31
|
+
"react-json-to-excel": "^1.0.8",
|
|
32
|
+
"react-leaflet": "^4.2.1",
|
|
33
|
+
"react-pin-field": "^3.1.5",
|
|
34
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
35
|
+
"sass": "^1.77.8",
|
|
36
|
+
"xlsx": "^0.18.5"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@iconify/react": "^5.0.1",
|
|
40
|
+
"flowbite-react": "^0.10.1",
|
|
41
|
+
"next": "14.2.4",
|
|
42
|
+
"postcss": "^8",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"tailwindcss": "^3.4.1",
|
|
46
|
+
"typescript": "^5",
|
|
47
|
+
"dayjs": "^1.11.11"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@iconify/react": "^5.0.1",
|
|
51
|
+
"@types/leaflet": "^1.9.12",
|
|
52
|
+
"@types/react": "^18",
|
|
53
|
+
"@types/react-big-calendar": "^1.8.9",
|
|
54
|
+
"@types/react-dom": "^18",
|
|
55
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
56
|
+
"css-loader": "^7.1.2",
|
|
57
|
+
"flowbite-react": "^0.10.1",
|
|
58
|
+
"next": "^14.2.4",
|
|
59
|
+
"postcss": "^8",
|
|
60
|
+
"postcss-cli": "^11.0.0",
|
|
61
|
+
"react": "^18.2.0",
|
|
62
|
+
"react-dom": "^18.2.0",
|
|
63
|
+
"sass-loader": "^16.0.0",
|
|
64
|
+
"style-loader": "^4.0.0",
|
|
65
|
+
"tailwindcss": "^3.4.1",
|
|
66
|
+
"ts-loader": "^9.5.1",
|
|
67
|
+
"typescript": "^5",
|
|
68
|
+
"webpack": "^5.93.0",
|
|
69
|
+
"webpack-cli": "^5.1.4",
|
|
70
|
+
"dayjs": "^1.11.11"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
|
|
5
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
options?: {
|
|
8
|
+
variant?:
|
|
9
|
+
| "basic"
|
|
10
|
+
| "primary"
|
|
11
|
+
| "secondary"
|
|
12
|
+
| "success"
|
|
13
|
+
| "warning"
|
|
14
|
+
| "danger";
|
|
15
|
+
width?: "full" | "fit";
|
|
16
|
+
height?: "short" | "medium" | "high";
|
|
17
|
+
position?: "left" | "center" | "right";
|
|
18
|
+
border?: boolean;
|
|
19
|
+
};
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
active?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Button: React.FC<ButtonProps> = ({
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
options,
|
|
28
|
+
loading,
|
|
29
|
+
active,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
|
+
const variant =
|
|
33
|
+
options?.variant === "primary"
|
|
34
|
+
? "text-white bg-primary shadow-sm shadow-primary hover:bg-primary-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
|
|
35
|
+
: options?.variant === "secondary"
|
|
36
|
+
? "text-white bg-secondary shadow-sm shadow-secondary hover:bg-secondary-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
|
|
37
|
+
: options?.variant === "success"
|
|
38
|
+
? "text-white bg-success shadow-sm shadow-success hover:bg-success-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
|
|
39
|
+
: options?.variant === "warning"
|
|
40
|
+
? "text-white bg-warning shadow-sm shadow-warning hover:bg-warning-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
|
|
41
|
+
: options?.variant === "danger"
|
|
42
|
+
? "text-white bg-danger shadow-sm shadow-danger hover:bg-danger-dark disabled:bg-secondary-dark disabled:shadow-secondary-dark"
|
|
43
|
+
: "text-default hover:bg-secondary-light disabled:bg-primary disabled:text-white disabled:shadow-sm disabled:shadow-primary";
|
|
44
|
+
const width = options?.width === "fit" ? "w-fit" : "w-full";
|
|
45
|
+
const height =
|
|
46
|
+
options?.height === "short"
|
|
47
|
+
? "py-1 gap-2"
|
|
48
|
+
: options?.height === "high"
|
|
49
|
+
? "py-2 gap-4"
|
|
50
|
+
: "py-1.5 gap-2";
|
|
51
|
+
const position =
|
|
52
|
+
options?.position === "center"
|
|
53
|
+
? "justify-center"
|
|
54
|
+
: options?.position === "right"
|
|
55
|
+
? "justify-end"
|
|
56
|
+
: "justify-start";
|
|
57
|
+
const border = options?.border ? "border" : "";
|
|
58
|
+
const isActive = active
|
|
59
|
+
? "bg-secondary-light shadow-sm shadow-secondary-light"
|
|
60
|
+
: "";
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<button
|
|
64
|
+
className={`group/button flex ${position} items-center ${width} px-3 ${height} rounded-md text-left ${variant} ${border} ${isActive} select-none disabled:pointer-events-none active:opacity-70 active:duration-300 active:ease-out ${className}`}
|
|
65
|
+
{...rest}
|
|
66
|
+
>
|
|
67
|
+
{loading ? (
|
|
68
|
+
<Icon icon="mingcute:loading-fill" className="text-2xl animate-spin" />
|
|
69
|
+
) : (
|
|
70
|
+
children
|
|
71
|
+
)}
|
|
72
|
+
</button>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Form } from "../../../components";
|
|
4
|
+
|
|
5
|
+
export interface EventProps {
|
|
6
|
+
eventList: any[];
|
|
7
|
+
hiddenEvent: any[];
|
|
8
|
+
setHiddenEvent: (event: any) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Event: React.FC<EventProps> = ({
|
|
12
|
+
eventList,
|
|
13
|
+
hiddenEvent,
|
|
14
|
+
setHiddenEvent,
|
|
15
|
+
}) => {
|
|
16
|
+
const eventArr = eventList?.map((item) => {
|
|
17
|
+
return (
|
|
18
|
+
<Form.Checkbox
|
|
19
|
+
key={item.id}
|
|
20
|
+
label={item.title}
|
|
21
|
+
theme={item.color}
|
|
22
|
+
checked={!hiddenEvent.includes(item.id)}
|
|
23
|
+
onChange={(e) => {
|
|
24
|
+
if (e.target.value && hiddenEvent.includes(item.id)) {
|
|
25
|
+
setHiddenEvent((prev: any) =>
|
|
26
|
+
prev.filter((id: any) => id !== item.id)
|
|
27
|
+
);
|
|
28
|
+
} else {
|
|
29
|
+
setHiddenEvent((prev: any) => [...prev, item.id]);
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
eventList.length !== 0 && (
|
|
38
|
+
<div className="flex-1 flex flex-col gap-4 h-full px-6 py-6 overflow-hidden">
|
|
39
|
+
<span className="text-lg">Event Filter</span>
|
|
40
|
+
<div className="flex flex-col gap-2 h-full overflow-auto">
|
|
41
|
+
{eventArr}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useState, useEffect } from "react";
|
|
3
|
+
import { Toolbar } from "./toolbar";
|
|
4
|
+
import { Event, type EventProps } from "./event";
|
|
5
|
+
import { Calendar as Bc, dayjsLocalizer } from "react-big-calendar";
|
|
6
|
+
import dayjs from "dayjs";
|
|
7
|
+
import "../../../styles";
|
|
8
|
+
|
|
9
|
+
const localizer = dayjsLocalizer(dayjs);
|
|
10
|
+
|
|
11
|
+
interface BigCalendarProps {
|
|
12
|
+
eventList: any[];
|
|
13
|
+
setEventList: (event: any) => void;
|
|
14
|
+
hiddenEvent: any[];
|
|
15
|
+
onSelectEvent?: (event: any) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface BigCalendarComponent extends React.FC<BigCalendarProps> {
|
|
19
|
+
Event: React.FC<EventProps>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const BigCalendar: BigCalendarComponent = ({
|
|
23
|
+
eventList,
|
|
24
|
+
setEventList,
|
|
25
|
+
hiddenEvent,
|
|
26
|
+
onSelectEvent,
|
|
27
|
+
}) => {
|
|
28
|
+
const [active, setActive] = useState<string>("month");
|
|
29
|
+
|
|
30
|
+
const colorList = [
|
|
31
|
+
{ id: 1, label: "Blue", value: "#2196f3" },
|
|
32
|
+
{ id: 2, label: "Purple", value: "#673ab7" },
|
|
33
|
+
{ id: 3, label: "Green", value: "#4caf50" },
|
|
34
|
+
{ id: 4, label: "Red", value: "#f44336" },
|
|
35
|
+
{ id: 5, label: "Orange", value: "#ff9800" },
|
|
36
|
+
{ id: 6, label: "Pink", value: "#e91e63" },
|
|
37
|
+
{ id: 7, label: "Yellow", value: "#ffc338" },
|
|
38
|
+
{ id: 8, label: "Brown", value: "#795548" },
|
|
39
|
+
{ id: 9, label: "Grey", value: "#9e9e9e" },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const tempEvent = eventList;
|
|
44
|
+
|
|
45
|
+
setEventList(
|
|
46
|
+
tempEvent?.map((item) => {
|
|
47
|
+
return {
|
|
48
|
+
...item,
|
|
49
|
+
color: colorList[Math.floor(Math.random() * colorList.length)].value,
|
|
50
|
+
};
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
const eventPropGetter = (item: any) => {
|
|
56
|
+
var custStyle = {
|
|
57
|
+
backgroundColor: item.color,
|
|
58
|
+
opacity: 0.8,
|
|
59
|
+
color: "white",
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
style: custStyle,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className="flex-1 overflow-hidden">
|
|
68
|
+
<Bc
|
|
69
|
+
localizer={localizer}
|
|
70
|
+
events={eventList.filter((item) => {
|
|
71
|
+
return !hiddenEvent.includes(item.id);
|
|
72
|
+
})}
|
|
73
|
+
startAccessor="start"
|
|
74
|
+
endAccessor="end"
|
|
75
|
+
components={{
|
|
76
|
+
toolbar: (toolbar: any) => {
|
|
77
|
+
return (
|
|
78
|
+
<Toolbar
|
|
79
|
+
toolbar={toolbar}
|
|
80
|
+
active={active}
|
|
81
|
+
setActive={setActive}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
}}
|
|
86
|
+
onView={(view) => {
|
|
87
|
+
setActive(view);
|
|
88
|
+
}}
|
|
89
|
+
// onRangeChange={(range) => console.log(range)}
|
|
90
|
+
popup
|
|
91
|
+
tooltipAccessor={(event) => event.desc}
|
|
92
|
+
eventPropGetter={eventPropGetter}
|
|
93
|
+
// selected={selected}
|
|
94
|
+
onSelectEvent={(event) => {
|
|
95
|
+
onSelectEvent && onSelectEvent(event);
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
BigCalendar.Event = Event;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
|
|
6
|
+
interface ToolbarProps {
|
|
7
|
+
toolbar: any;
|
|
8
|
+
active: string;
|
|
9
|
+
setActive: (active: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Toolbar: React.FC<ToolbarProps> = ({
|
|
13
|
+
toolbar,
|
|
14
|
+
active,
|
|
15
|
+
setActive,
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex justify-between items-center gap-6 p-6 bg-secondary-bg border-b overflow-auto [&::-webkit-scrollbar]:hidden">
|
|
19
|
+
<div className="flex items-center gap-4">
|
|
20
|
+
<div className="flex gap-2">
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
className="p-2 rounded-full hover:bg-secondary-light"
|
|
24
|
+
onClick={() => {
|
|
25
|
+
toolbar.onNavigate("PREV");
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<Icon icon="gravity-ui:chevron-left" className="text-lg" />
|
|
29
|
+
</button>
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
className="p-2 rounded-full hover:bg-secondary-light"
|
|
33
|
+
onClick={() => {
|
|
34
|
+
toolbar.onNavigate("NEXT");
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<Icon icon="gravity-ui:chevron-right" className="text-lg" />
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
<span className="text-2xl whitespace-nowrap">
|
|
41
|
+
{`${dayjs(toolbar.date).format("MMMM")} ${dayjs(toolbar.date).format(
|
|
42
|
+
"YYYY"
|
|
43
|
+
)}`}
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div className="flex">
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
className={`px-4 py-1.5 rounded-l-md text-primary hover:bg-primary-light ${
|
|
50
|
+
active === "month" ? "bg-primary-light" : "bg-primary-transparent"
|
|
51
|
+
}`}
|
|
52
|
+
onClick={() => {
|
|
53
|
+
toolbar.onView("month");
|
|
54
|
+
setActive("month");
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
Month
|
|
58
|
+
</button>
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
className={`px-4 py-1.5 border-x border-primary/30 text-primary hover:bg-primary-light ${
|
|
62
|
+
active === "week" ? "bg-primary-light" : "bg-primary-transparent"
|
|
63
|
+
}`}
|
|
64
|
+
onClick={() => {
|
|
65
|
+
toolbar.onView("week");
|
|
66
|
+
setActive("week");
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
Week
|
|
70
|
+
</button>
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
className={`px-4 py-1.5 border-r border-primary/30 text-primary hover:bg-primary-light ${
|
|
74
|
+
active === "day" ? "bg-primary-light" : "bg-primary-transparent"
|
|
75
|
+
}`}
|
|
76
|
+
onClick={() => {
|
|
77
|
+
toolbar.onView("day");
|
|
78
|
+
setActive("day");
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
Day
|
|
82
|
+
</button>
|
|
83
|
+
<button
|
|
84
|
+
type="button"
|
|
85
|
+
className={`px-3 py-1.5 rounded-r-md text-primary hover:bg-primary-light ${
|
|
86
|
+
active === "agenda" ? "bg-primary-light" : "bg-primary-transparent"
|
|
87
|
+
}`}
|
|
88
|
+
onClick={() => {
|
|
89
|
+
toolbar.onView("agenda");
|
|
90
|
+
setActive("agenda");
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
List
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Cl from "react-calendar";
|
|
4
|
+
import "../../../styles";
|
|
5
|
+
|
|
6
|
+
interface CalendarProps {
|
|
7
|
+
options?: {
|
|
8
|
+
enableSelectRange?: boolean;
|
|
9
|
+
};
|
|
10
|
+
value?: any;
|
|
11
|
+
onChange?: (date: any) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Calendar: React.FC<CalendarProps> = ({
|
|
15
|
+
options,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
}) => {
|
|
19
|
+
return (
|
|
20
|
+
<Cl
|
|
21
|
+
selectRange={options?.enableSelectRange || false}
|
|
22
|
+
value={value}
|
|
23
|
+
onChange={onChange}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import dynamic from "next/dynamic";
|
|
4
|
+
const Ch = dynamic(() => import("react-apexcharts"), { ssr: false });
|
|
5
|
+
|
|
6
|
+
interface ChartProps {
|
|
7
|
+
type: "line" | "area" | "bar" | "pie" | "donut" | "radialBar" | "heatmap";
|
|
8
|
+
theme?: "light" | "dark" | "system";
|
|
9
|
+
id?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
subTitle?: string;
|
|
12
|
+
series: any;
|
|
13
|
+
labels?: string[];
|
|
14
|
+
xaxis?: {
|
|
15
|
+
categories: string[];
|
|
16
|
+
};
|
|
17
|
+
height?: number;
|
|
18
|
+
sparkline?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Chart: React.FC<ChartProps> = ({
|
|
22
|
+
type,
|
|
23
|
+
theme,
|
|
24
|
+
id,
|
|
25
|
+
title,
|
|
26
|
+
subTitle,
|
|
27
|
+
series,
|
|
28
|
+
labels,
|
|
29
|
+
xaxis,
|
|
30
|
+
height,
|
|
31
|
+
sparkline,
|
|
32
|
+
}) => {
|
|
33
|
+
const areaOptions = type === "area" && {
|
|
34
|
+
fill: {
|
|
35
|
+
type: "gradient",
|
|
36
|
+
gradient: {
|
|
37
|
+
shadeIntensity: 1,
|
|
38
|
+
opacityFrom: 0.7,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Ch
|
|
45
|
+
type={type}
|
|
46
|
+
id={id}
|
|
47
|
+
series={series}
|
|
48
|
+
height={height}
|
|
49
|
+
options={{
|
|
50
|
+
title: {
|
|
51
|
+
text: title,
|
|
52
|
+
align: "left",
|
|
53
|
+
},
|
|
54
|
+
subtitle: {
|
|
55
|
+
text: subTitle,
|
|
56
|
+
align: "left",
|
|
57
|
+
},
|
|
58
|
+
xaxis: {
|
|
59
|
+
categories: xaxis?.categories ?? [],
|
|
60
|
+
labels: {
|
|
61
|
+
maxHeight: 40,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
labels: labels ?? [],
|
|
65
|
+
colors: [
|
|
66
|
+
"#2196f3",
|
|
67
|
+
"#673ab7",
|
|
68
|
+
"#4caf50",
|
|
69
|
+
"#f44336",
|
|
70
|
+
"#ff9800",
|
|
71
|
+
"#e91e63",
|
|
72
|
+
"#ffc338",
|
|
73
|
+
"#795548",
|
|
74
|
+
"#9e9e9e",
|
|
75
|
+
],
|
|
76
|
+
chart: {
|
|
77
|
+
toolbar: {
|
|
78
|
+
show: false,
|
|
79
|
+
},
|
|
80
|
+
zoom: {
|
|
81
|
+
enabled: false,
|
|
82
|
+
},
|
|
83
|
+
sparkline: {
|
|
84
|
+
enabled: sparkline ?? true,
|
|
85
|
+
},
|
|
86
|
+
events: {
|
|
87
|
+
mounted: (chart) => {
|
|
88
|
+
chart.windowResizeHandler();
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
foreColor: theme === "light" ? "#475569" : "#ffffff",
|
|
92
|
+
},
|
|
93
|
+
dataLabels: {
|
|
94
|
+
enabled: false,
|
|
95
|
+
},
|
|
96
|
+
stroke: {
|
|
97
|
+
curve: "smooth",
|
|
98
|
+
width: 2,
|
|
99
|
+
},
|
|
100
|
+
plotOptions: {
|
|
101
|
+
bar: {
|
|
102
|
+
borderRadius: 4,
|
|
103
|
+
columnWidth: "30%",
|
|
104
|
+
},
|
|
105
|
+
pie: {
|
|
106
|
+
donut: {
|
|
107
|
+
size: "70%",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
tooltip: {
|
|
112
|
+
theme: theme === "light" ? "light" : "dark",
|
|
113
|
+
},
|
|
114
|
+
grid: {
|
|
115
|
+
borderColor: theme === "light" ? "#e5e6e8" : "#545869",
|
|
116
|
+
},
|
|
117
|
+
...areaOptions,
|
|
118
|
+
}}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
|
|
5
|
+
interface ChipProps {
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
options?: {
|
|
9
|
+
variant?: "primary" | "secondary" | "success" | "warning" | "danger";
|
|
10
|
+
bordered?: boolean;
|
|
11
|
+
borderRadius?: "basic" | "full";
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Chip: React.FC<ChipProps> = ({ label, icon, options }) => {
|
|
16
|
+
const variant =
|
|
17
|
+
options?.bordered !== true
|
|
18
|
+
? options?.variant === "secondary"
|
|
19
|
+
? "bg-secondary-transparent text-secondary"
|
|
20
|
+
: options?.variant === "success"
|
|
21
|
+
? "bg-success-transparent text-success"
|
|
22
|
+
: options?.variant === "warning"
|
|
23
|
+
? "bg-warning-transparent text-warning"
|
|
24
|
+
: options?.variant === "danger"
|
|
25
|
+
? "bg-danger-transparent text-danger"
|
|
26
|
+
: "bg-primary-transparent text-primary"
|
|
27
|
+
: options?.variant === "secondary"
|
|
28
|
+
? "border border-secondary text-secondary"
|
|
29
|
+
: options?.variant === "success"
|
|
30
|
+
? "border border-success text-success"
|
|
31
|
+
: options?.variant === "warning"
|
|
32
|
+
? "border border-warning text-warning"
|
|
33
|
+
: options?.variant === "danger"
|
|
34
|
+
? "border border-danger text-danger"
|
|
35
|
+
: "border border-primary text-primary";
|
|
36
|
+
const borderRadius =
|
|
37
|
+
options?.borderRadius === "full" ? "rounded-full" : "rounded-md";
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
className={`flex items-center gap-1.5 w-fit px-3 py-1 font-medium select-none ${variant} ${borderRadius}`}
|
|
42
|
+
>
|
|
43
|
+
{icon && <Icon icon={icon} className="text-lg" />}
|
|
44
|
+
<span className="text-sm">{label}</span>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Item, type ItemProps } from "./item";
|
|
4
|
+
|
|
5
|
+
interface AccordionProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface AccordionComponent extends React.FC<AccordionProps> {
|
|
10
|
+
Item: React.FC<ItemProps>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Accordion: AccordionComponent = ({ children }) => {
|
|
14
|
+
const childrenList = React.Children.toArray(children);
|
|
15
|
+
const itemList = childrenList.filter((child) => {
|
|
16
|
+
return (child as React.ReactElement).type === Accordion.Item;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className="flex flex-col gap-2 w-full">
|
|
21
|
+
{itemList.map((item) => {
|
|
22
|
+
return item;
|
|
23
|
+
})}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
Accordion.Item = Item;
|