@sikka/hawa 0.0.145 → 0.0.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles.css +86 -58
- package/es/blocks/Misc/EmptyState.d.ts +3 -1
- package/es/blocks/Misc/NotFound.d.ts +3 -1
- package/es/index.es.js +1 -1
- package/es/layout/HawaContainer.d.ts +1 -1
- package/es/util.d.ts +8 -4
- package/lib/blocks/Misc/EmptyState.d.ts +3 -1
- package/lib/blocks/Misc/NotFound.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/layout/HawaContainer.d.ts +1 -1
- package/lib/util.d.ts +8 -4
- package/package.json +3 -2
- package/src/blocks/Misc/EmptyState.tsx +13 -11
- package/src/blocks/Misc/NotFound.tsx +11 -16
- package/src/blocks/Payment/SelectPayment.tsx +0 -1
- package/src/elements/DraggableCard.tsx +1 -1
- package/src/elements/HawaButton.tsx +6 -5
- package/src/elements/HawaLogoButton.tsx +1 -1
- package/src/elements/HawaMenu.tsx +1 -1
- package/src/layout/HawaAppLayout.tsx +137 -95
- package/src/layout/HawaContainer.tsx +6 -4
- package/src/styles.css +86 -58
- package/src/tailwind.css +4 -0
- package/src/util.ts +142 -29
- package/storybook-static/{767.232e4e4c88bb0a2ed02d.manager.bundle.js → 767.8e4ffb17eae12c283b3b.manager.bundle.js} +2 -2
- package/storybook-static/{767.232e4e4c88bb0a2ed02d.manager.bundle.js.LICENSE.txt → 767.8e4ffb17eae12c283b3b.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/870.c002064e.iframe.bundle.js +2 -0
- package/storybook-static/{870.32eb3abe.iframe.bundle.js.LICENSE.txt → 870.c002064e.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.8977634c.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/tailwind.config.js +63 -0
- package/storybook-static/870.32eb3abe.iframe.bundle.js +0 -2
- package/storybook-static/main.caad440f.iframe.bundle.js +0 -1
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
type ContainerTypes = {
|
|
3
3
|
maxWidth?: "full" | "small" | "normal";
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
variant?: "contained" | "outlined";
|
|
5
|
+
variant?: "contained" | "outlined" | "neobrutalism";
|
|
6
6
|
centered?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const HawaContainer: React.FunctionComponent<ContainerTypes>;
|
package/lib/util.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type Palette = {
|
|
2
|
+
name: string;
|
|
3
|
+
colors: {
|
|
4
|
+
[key: number]: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
declare function getPallette(baseColor: string): Palette;
|
|
8
|
+
export { getPallette };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.146",
|
|
4
4
|
"description": "UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/react-dom": "^18.0.9",
|
|
38
38
|
"babel-loader": "^8.2.2",
|
|
39
39
|
"clsx": "^1.2.1",
|
|
40
|
+
"color": "^4.2.3",
|
|
40
41
|
"crypto-js": "^4.1.1",
|
|
41
42
|
"framer-motion": "^4.1.7",
|
|
42
43
|
"html-webpack-plugin": "^5.5.0",
|
|
@@ -60,8 +61,8 @@
|
|
|
60
61
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
61
62
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
62
63
|
"rollup-plugin-postcss": "^4.0.0",
|
|
63
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
64
64
|
"rollup-plugin-swc": "^0.2.1",
|
|
65
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
65
66
|
"tailwindcss": "^3.2.1",
|
|
66
67
|
"tinycolor2": "^1.4.2",
|
|
67
68
|
"tslib": "^2.4.1",
|
|
@@ -2,19 +2,21 @@ import React from "react"
|
|
|
2
2
|
import { HawaButton } from "../../elements"
|
|
3
3
|
import { HawaContainer } from "../../layout"
|
|
4
4
|
import { FaCheck } from "react-icons/fa"
|
|
5
|
-
type TEmptyState = {
|
|
5
|
+
type TEmptyState = {
|
|
6
|
+
variant?: "outlined" | "contained" | "neobrutalism"
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
export const EmptyState: React.FunctionComponent<TEmptyState> = (
|
|
9
|
+
export const EmptyState: React.FunctionComponent<TEmptyState> = ({
|
|
10
|
+
variant = "contained",
|
|
11
|
+
}) => {
|
|
8
12
|
return (
|
|
9
|
-
<HawaContainer variant=
|
|
10
|
-
<div className="flex
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
You're all caught up
|
|
15
|
-
|
|
16
|
-
<div className="text-center">
|
|
17
|
-
If you're lost please contact us help@sikka.io{" "}
|
|
13
|
+
<HawaContainer variant={variant} centered={true}>
|
|
14
|
+
<div className="flex flex-col items-center justify-center text-center dark:text-white">
|
|
15
|
+
<div className="flex h-10 w-10 flex-col items-center justify-center rounded-3xl bg-primary-400 text-6xl font-bold">
|
|
16
|
+
<FaCheck size={20} />
|
|
17
|
+
</div>
|
|
18
|
+
<div className="m-2 text-xl font-bold">You're all caught up</div>
|
|
19
|
+
<div>If you're lost, please contact us help@sikka.io </div>
|
|
18
20
|
</div>
|
|
19
21
|
<HawaButton color="primary" width="full">
|
|
20
22
|
Action
|
|
@@ -2,29 +2,24 @@ import React from "react"
|
|
|
2
2
|
import { HawaButton } from "../../elements"
|
|
3
3
|
import { HawaContainer } from "../../layout"
|
|
4
4
|
|
|
5
|
-
type NotFoundTypes = {
|
|
5
|
+
type NotFoundTypes = {
|
|
6
|
+
variant?: "outlined" | "contained" | "neobrutalism"
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
export const NotFound: React.FunctionComponent<NotFoundTypes> = (
|
|
9
|
+
export const NotFound: React.FunctionComponent<NotFoundTypes> = ({
|
|
10
|
+
variant,
|
|
11
|
+
}) => {
|
|
8
12
|
return (
|
|
9
|
-
<HawaContainer variant=
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// alignItems: "center",
|
|
15
|
-
// }}
|
|
16
|
-
className="flex flex-col items-center"
|
|
17
|
-
>
|
|
18
|
-
<div className="text-center text-6xl font-bold">404</div>
|
|
19
|
-
<div className="m-2 text-center text-xl font-bold">Page Not Found</div>
|
|
20
|
-
<div className="text-center">
|
|
13
|
+
<HawaContainer variant={variant}>
|
|
14
|
+
<div className="flex flex-col items-center dark:text-white">
|
|
15
|
+
<div className="text-center text-6xl font-bold ">404</div>
|
|
16
|
+
<div className="m-2 text-center text-xl font-bold ">Page Not Found</div>
|
|
17
|
+
<div className="text-center ">
|
|
21
18
|
If you're lost please contact us help@sikka.io{" "}
|
|
22
19
|
</div>
|
|
23
|
-
{/* <div className="flex flex-col content-center items-stretch bg-red-200"> */}
|
|
24
20
|
<HawaButton color="primary" width="full">
|
|
25
21
|
Home
|
|
26
22
|
</HawaButton>
|
|
27
|
-
{/* </div> */}
|
|
28
23
|
</div>
|
|
29
24
|
</HawaContainer>
|
|
30
25
|
)
|
|
@@ -31,7 +31,6 @@ export const SelectPayment: React.FunctionComponent<SelectPaymentTypes> = (
|
|
|
31
31
|
) => {
|
|
32
32
|
return (
|
|
33
33
|
<HawaContainer>
|
|
34
|
-
{/* // <div className="flex flex-col w-1/3 bg-blue-300 rounded-xl p-4"> */}
|
|
35
34
|
<HawaTypography>Choose Payment Method</HawaTypography>
|
|
36
35
|
{props.viaWallet && (
|
|
37
36
|
<HawaLogoButton
|
|
@@ -7,7 +7,7 @@ export const DraggableCard: React.FunctionComponent<DraggableCardTypes> = (
|
|
|
7
7
|
props
|
|
8
8
|
) => {
|
|
9
9
|
return (
|
|
10
|
-
<div className="flex flex-row rounded-xl
|
|
10
|
+
<div className="bg-layoutPrimary-default flex flex-row rounded-xl p-4">
|
|
11
11
|
<button
|
|
12
12
|
className="inline-flex items-center rounded-lg bg-white p-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-50 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-600"
|
|
13
13
|
type="button"
|
|
@@ -24,7 +24,7 @@ const sizeStyles = {
|
|
|
24
24
|
const widthStyles = {
|
|
25
25
|
full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
|
|
26
26
|
normal:
|
|
27
|
-
"w-fit dark:bg-
|
|
27
|
+
"w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-dark dark:hover:brightness-90 dark:focus:ring-primary-800",
|
|
28
28
|
half: "w-1/2",
|
|
29
29
|
}
|
|
30
30
|
const variantStyles = {
|
|
@@ -34,11 +34,11 @@ const variantStyles = {
|
|
|
34
34
|
|
|
35
35
|
const colorStyles = {
|
|
36
36
|
contained: {
|
|
37
|
-
default: "text-neutral-900 bg-gray-
|
|
37
|
+
default: "text-neutral-900 hover:bg-gray-300 bg-buttonPrimary-default text-white",
|
|
38
38
|
primary:
|
|
39
|
-
"text-white bg-
|
|
39
|
+
"text-white bg-buttonPrimary-default hover:bg-buttonPrimary-darker transition-all",
|
|
40
40
|
secondary:
|
|
41
|
-
"text-neutral-900 bg-
|
|
41
|
+
"text-neutral-900 bg-buttonPrimary-default hover:text-white hover:bg-secondary-700",
|
|
42
42
|
},
|
|
43
43
|
outlined: {
|
|
44
44
|
default: "text-gray-600 border-gray-600 hover:bg-gray-200",
|
|
@@ -67,7 +67,6 @@ export function HawaButton({
|
|
|
67
67
|
...props
|
|
68
68
|
}: ButtonProps) {
|
|
69
69
|
const [isHovered, setIsHovered] = React.useState(false)
|
|
70
|
-
|
|
71
70
|
return (
|
|
72
71
|
<div
|
|
73
72
|
className={clsx(
|
|
@@ -75,6 +74,7 @@ export function HawaButton({
|
|
|
75
74
|
margins !== "none" ? `my-${margins}` : "my-0"
|
|
76
75
|
)}
|
|
77
76
|
>
|
|
77
|
+
{/* <div className="bg-buttonPrimary-default h-32">test</div> */}
|
|
78
78
|
<button
|
|
79
79
|
onMouseEnter={() => {
|
|
80
80
|
setIsHovered(true)
|
|
@@ -85,6 +85,7 @@ export function HawaButton({
|
|
|
85
85
|
className={
|
|
86
86
|
disabled
|
|
87
87
|
? clsx(
|
|
88
|
+
// "brightne",
|
|
88
89
|
className,
|
|
89
90
|
baseStyles,
|
|
90
91
|
variantStyles[variant],
|
|
@@ -150,7 +150,7 @@ export const HawaLogoButton: React.FunctionComponent<LogoButtonTypes> = (
|
|
|
150
150
|
<button
|
|
151
151
|
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
152
152
|
onClick={props.onClick}
|
|
153
|
-
className="my-2 flex h-11 w-full flex-row justify-center rounded-xl bg-white align-middle"
|
|
153
|
+
className="my-2 flex h-11 w-full flex-row justify-center rounded-xl bg-white hover:ring-1 hover:ring-buttonPrimary-default hover:brightness-90 align-middle"
|
|
154
154
|
>
|
|
155
155
|
<div className="flex h-full flex-row items-center justify-end">
|
|
156
156
|
{logoElement}
|
|
@@ -93,7 +93,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
93
93
|
return (
|
|
94
94
|
<ul
|
|
95
95
|
key={o}
|
|
96
|
-
className="py-1 text-sm text-gray-700 dark:text-gray-200"
|
|
96
|
+
className="py-1 bg-layout-1200 text-sm text-gray-700 dark:text-gray-200"
|
|
97
97
|
>
|
|
98
98
|
{group?.map((item) => {
|
|
99
99
|
return (
|
|
@@ -4,6 +4,7 @@ import useDiscloser from "../hooks/useDiscloser"
|
|
|
4
4
|
import { HawaMenu } from "../elements"
|
|
5
5
|
import { HiMenu } from "react-icons/hi"
|
|
6
6
|
import useBreakpoint from "../hooks/useBreakpoint"
|
|
7
|
+
import { FaChevronRight } from "react-icons/fa"
|
|
7
8
|
type HawaAppLayoutTypes = {
|
|
8
9
|
drawerItems: {
|
|
9
10
|
label: string
|
|
@@ -33,6 +34,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
33
34
|
props: any
|
|
34
35
|
) => {
|
|
35
36
|
const [openSideMenu, setOpenSideMenu] = useState(false)
|
|
37
|
+
const [openSubItem, setOpenSubItem] = useState(false)
|
|
36
38
|
const { isOpen, onClose, onOpen } = useDiscloser(false)
|
|
37
39
|
const ref = useRef(null)
|
|
38
40
|
|
|
@@ -42,10 +44,11 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
42
44
|
} else {
|
|
43
45
|
size = 1200
|
|
44
46
|
}
|
|
47
|
+
const [keepOpen, setKeepOpen] = useState(size > 600 ? true : false)
|
|
45
48
|
console.log("size is ", size)
|
|
46
49
|
useEffect(() => {
|
|
47
50
|
const handleClickOutside = (event) => {
|
|
48
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
51
|
+
if (ref.current && !ref.current.contains(event.target) && !keepOpen) {
|
|
49
52
|
// onClickOutside && onClickOutside()
|
|
50
53
|
setOpenSideMenu(false)
|
|
51
54
|
}
|
|
@@ -54,7 +57,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
54
57
|
return () => {
|
|
55
58
|
document.removeEventListener("click", handleClickOutside, true)
|
|
56
59
|
}
|
|
57
|
-
}, [])
|
|
60
|
+
}, [keepOpen])
|
|
58
61
|
|
|
59
62
|
//States of the side menu
|
|
60
63
|
//larger than 600
|
|
@@ -62,25 +65,41 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
62
65
|
//less than 600
|
|
63
66
|
//as nothing and expands as button is clicked
|
|
64
67
|
return (
|
|
65
|
-
|
|
68
|
+
<div className="fixed left-0 h-full bg-green-400">
|
|
66
69
|
{props.topBar && (
|
|
67
70
|
<div
|
|
68
71
|
className={clsx(
|
|
69
|
-
"fixed top-0 z-40 flex h-14 flex-row items-center justify-between bg-
|
|
70
|
-
size > 600 ? "w-[calc(100%-3rem)] translate-x-[3rem]" : "w-full",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
72
|
+
"fixed top-0 z-40 flex h-14 flex-row items-center justify-between bg-layoutPrimary-default",
|
|
73
|
+
// size > 600 ? "w-[calc(100%-3rem)] translate-x-[3rem]" : "w-full",
|
|
74
|
+
"w-full",
|
|
75
|
+
"p-2"
|
|
76
|
+
// "pr-5"
|
|
73
77
|
)}
|
|
74
78
|
>
|
|
75
|
-
{size > 600 ?
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
{size > 600 ? (
|
|
80
|
+
props.pageTitle ? (
|
|
81
|
+
<div
|
|
82
|
+
className={clsx(
|
|
83
|
+
size > 600 ? "ml-14" : "ml-2",
|
|
84
|
+
"bg-red-300",
|
|
85
|
+
keepOpen ? "ml-40" : ""
|
|
86
|
+
)}
|
|
87
|
+
>
|
|
88
|
+
{props.pageTitle}
|
|
89
|
+
</div>
|
|
90
|
+
) : null
|
|
91
|
+
) : (
|
|
92
|
+
<div className="flex items-center justify-center">
|
|
93
|
+
<div
|
|
94
|
+
onClick={() => setOpenSideMenu(true)}
|
|
95
|
+
className=" cursor-pointer rounded-lg p-2 transition-all hover:bg-gray-100"
|
|
96
|
+
>
|
|
97
|
+
<HiMenu size={25} />
|
|
98
|
+
</div>
|
|
99
|
+
{props.pageTitle ? <div>{props.pageTitle}</div> : <div></div>}
|
|
81
100
|
</div>
|
|
82
101
|
)}
|
|
83
|
-
|
|
102
|
+
|
|
84
103
|
<HawaMenu
|
|
85
104
|
buttonPosition="top-right"
|
|
86
105
|
menuItems={props.profileMenuItems}
|
|
@@ -107,102 +126,125 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
107
126
|
)}
|
|
108
127
|
<div
|
|
109
128
|
onMouseEnter={() => setOpenSideMenu(true)}
|
|
110
|
-
onMouseLeave={() =>
|
|
129
|
+
onMouseLeave={() =>
|
|
130
|
+
keepOpen ? setOpenSideMenu(true) : setOpenSideMenu(false)
|
|
131
|
+
}
|
|
111
132
|
ref={ref}
|
|
112
133
|
className={clsx(
|
|
113
|
-
"fixed top-0 left-0 z-50 flex h-full flex-col overflow-x-clip bg-
|
|
114
|
-
size > 600 ? "w-
|
|
115
|
-
openSideMenu ? "w-40" : "w-
|
|
134
|
+
"fixed top-0 left-0 z-50 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-default transition-all hover:overflow-auto",
|
|
135
|
+
size > 600 ? "w-14 hover:w-40" : "w-0",
|
|
136
|
+
openSideMenu ? "w-40" : "w-14"
|
|
116
137
|
)}
|
|
117
138
|
>
|
|
118
|
-
<div
|
|
119
|
-
<
|
|
120
|
-
className={clsx(
|
|
121
|
-
"fixed top-2 h-9",
|
|
122
|
-
!openSideMenu ? "invisible" : "visible"
|
|
123
|
-
)}
|
|
124
|
-
height={10}
|
|
125
|
-
src={props.logoLink}
|
|
126
|
-
// src={"https://beta-my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"}
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
|
-
<img
|
|
130
|
-
className={clsx(
|
|
131
|
-
// " bg-green-500",
|
|
132
|
-
"fixed top-2 h-9",
|
|
133
|
-
openSideMenu ? "invisible" : "visible"
|
|
134
|
-
)}
|
|
135
|
-
src={props.logoSymbol}
|
|
136
|
-
// src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
|
|
137
|
-
/>
|
|
138
|
-
|
|
139
|
-
{/* {openSideMenu ? (
|
|
139
|
+
<div>
|
|
140
|
+
<div className="mb-9 h-12 w-12 p-2">
|
|
140
141
|
<img
|
|
141
|
-
className={clsx(
|
|
142
|
-
|
|
142
|
+
className={clsx(
|
|
143
|
+
"fixed top-2 h-9",
|
|
144
|
+
!openSideMenu ? "invisible" : "visible"
|
|
145
|
+
)}
|
|
146
|
+
height={10}
|
|
147
|
+
src={props.logoLink}
|
|
148
|
+
// src={"https://beta-my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"}
|
|
143
149
|
/>
|
|
144
|
-
) : (
|
|
145
|
-
<img
|
|
146
|
-
className={clsx("h-10", openSideMenu ? "invisible" : "visible")}
|
|
147
|
-
src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
|
|
148
|
-
/>
|
|
149
|
-
)} */}
|
|
150
|
-
</div>
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
key={i}
|
|
164
|
-
onClick={() => dItem.action(dItem.slug)}
|
|
165
|
-
className={clsx(
|
|
166
|
-
"m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all hover:bg-primary-500",
|
|
167
|
-
props.currentPage === dItem.slug
|
|
168
|
-
? "bg-primary-600 text-white hover:bg-primary-600"
|
|
169
|
-
: ""
|
|
170
|
-
// !openSideMenu ? " h-0 w-0" : ""
|
|
171
|
-
)}
|
|
172
|
-
>
|
|
173
|
-
<div className="flex items-center justify-center">
|
|
174
|
-
{dItem.icon}
|
|
175
|
-
</div>
|
|
176
|
-
<div
|
|
177
|
-
className={clsx(
|
|
178
|
-
"mx-2 whitespace-nowrap text-sm transition-all",
|
|
179
|
-
openSideMenu ? "opacity-100" : "opacity-0"
|
|
180
|
-
)}
|
|
181
|
-
>
|
|
182
|
-
{dItem.label}
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
|
-
)
|
|
186
|
-
})}
|
|
187
|
-
{j !== props.drawerItems.length - 1 && (
|
|
188
|
-
<div className="my-2 h-[1px] w-10/12 self-center bg-primary-600 text-center "></div>
|
|
189
|
-
)}{" "}
|
|
151
|
+
{size > 600 ? (
|
|
152
|
+
<img
|
|
153
|
+
className={clsx(
|
|
154
|
+
// " bg-green-500",
|
|
155
|
+
"fixed top-2 h-9",
|
|
156
|
+
openSideMenu ? "invisible" : "visible"
|
|
157
|
+
)}
|
|
158
|
+
src={props.logoSymbol}
|
|
159
|
+
// src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
|
|
160
|
+
/>
|
|
161
|
+
) : null}
|
|
190
162
|
</div>
|
|
191
|
-
|
|
163
|
+
|
|
164
|
+
{props.drawerItems.map((dSection, j) => (
|
|
165
|
+
<div
|
|
166
|
+
key={j}
|
|
167
|
+
className={clsx(
|
|
168
|
+
"flex flex-col items-stretch justify-center"
|
|
169
|
+
// !openSideMenu ? "invisible" : "visible"
|
|
170
|
+
)}
|
|
171
|
+
>
|
|
172
|
+
{dSection.map((dItem, i) => {
|
|
173
|
+
return (
|
|
174
|
+
<div className="flex flex-col">
|
|
175
|
+
<div
|
|
176
|
+
key={i}
|
|
177
|
+
onClick={() => {
|
|
178
|
+
// if()
|
|
179
|
+
dItem.action(dItem.slug)
|
|
180
|
+
}}
|
|
181
|
+
className={clsx(
|
|
182
|
+
props.currentPage === dItem.slug
|
|
183
|
+
? "bg-buttonPrimary-default text-white"
|
|
184
|
+
: "hover:bg-buttonPrimary-lighter",
|
|
185
|
+
// !openSideMenu ? " h-0 w-0" : ""
|
|
186
|
+
"m-2 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all "
|
|
187
|
+
)}
|
|
188
|
+
>
|
|
189
|
+
<div className="flex items-center justify-center">
|
|
190
|
+
{dItem.icon}
|
|
191
|
+
</div>
|
|
192
|
+
<div
|
|
193
|
+
className={clsx(
|
|
194
|
+
"mx-2 whitespace-nowrap text-sm transition-all",
|
|
195
|
+
openSideMenu ? "opacity-100" : "opacity-0"
|
|
196
|
+
)}
|
|
197
|
+
>
|
|
198
|
+
{dItem.label}
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
{dItem.subItems && (openSideMenu || isOpen) ? (
|
|
202
|
+
<div className="flex flex-col gap-2">
|
|
203
|
+
{dItem.subItems.map((subIt) => (
|
|
204
|
+
<div className="bg-red-100 p-2 px-4">subItems</div>
|
|
205
|
+
))}
|
|
206
|
+
</div>
|
|
207
|
+
) : null}
|
|
208
|
+
</div>
|
|
209
|
+
)
|
|
210
|
+
})}
|
|
211
|
+
{j !== props.drawerItems.length - 1 && (
|
|
212
|
+
<div className="my-2 h-[1px] w-10/12 self-center bg-buttonPrimary-default text-center "></div>
|
|
213
|
+
)}{" "}
|
|
214
|
+
</div>
|
|
215
|
+
))}
|
|
216
|
+
</div>
|
|
217
|
+
<div className={clsx("flex items-center justify-end")}>
|
|
218
|
+
{openSideMenu && !keepOpen ? (
|
|
219
|
+
<div
|
|
220
|
+
onClick={() => setKeepOpen(true)}
|
|
221
|
+
className="m-2 w-fit cursor-pointer rounded-lg bg-gray-300 p-2"
|
|
222
|
+
>
|
|
223
|
+
<FaChevronRight />
|
|
224
|
+
</div>
|
|
225
|
+
) : null}
|
|
226
|
+
{keepOpen && (
|
|
227
|
+
<div
|
|
228
|
+
onClick={() => setKeepOpen(false)}
|
|
229
|
+
className="m-2 w-fit rotate-180 cursor-pointer rounded-lg bg-gray-300 p-2"
|
|
230
|
+
>
|
|
231
|
+
<FaChevronRight />
|
|
232
|
+
</div>
|
|
233
|
+
)}
|
|
234
|
+
</div>
|
|
192
235
|
</div>
|
|
236
|
+
|
|
193
237
|
<div
|
|
194
238
|
className={clsx(
|
|
195
|
-
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
"m-0",
|
|
200
|
-
props.topBar ? "mt-14" : ""
|
|
239
|
+
size > 600 ? "w-[calc(100%-3rem)] translate-x-[3.54rem]" : "",
|
|
240
|
+
props.topBar ? "mt-[3.6rem]" : "mt-0 ",
|
|
241
|
+
" fixed top-0 h-full overflow-auto p-4",
|
|
242
|
+
keepOpen ? "w-[calc(100%-10rem)] translate-x-[10.54rem]" : ""
|
|
201
243
|
)}
|
|
202
244
|
>
|
|
203
245
|
{props.children}
|
|
204
246
|
</div>
|
|
205
247
|
{/* <div className="top-0 w-[calc(100%-1rem)] -translate-y-[1rem] translate-x-8 overflow-scroll bg-yellow-300 "> */}
|
|
206
|
-
|
|
248
|
+
</div>
|
|
207
249
|
)
|
|
208
250
|
}
|
|
@@ -4,7 +4,7 @@ import clsx from "clsx"
|
|
|
4
4
|
type ContainerTypes = {
|
|
5
5
|
maxWidth?: "full" | "small" | "normal"
|
|
6
6
|
children: React.ReactNode
|
|
7
|
-
variant?: "contained" | "outlined"
|
|
7
|
+
variant?: "contained" | "outlined" | "neobrutalism"
|
|
8
8
|
centered?: boolean
|
|
9
9
|
}
|
|
10
10
|
export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
|
|
@@ -13,21 +13,23 @@ export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
|
|
|
13
13
|
centered = false,
|
|
14
14
|
...props
|
|
15
15
|
}) => {
|
|
16
|
-
let defaultStyle = "flex w-full flex-col rounded-xl p-4
|
|
16
|
+
let defaultStyle = "flex w-full flex-col rounded-xl p-4"
|
|
17
17
|
let maxWidthStyles: any = {
|
|
18
18
|
full: "md:max-w-xl",
|
|
19
19
|
small: "md:max-w-sm w-1/3 min-w-min",
|
|
20
20
|
normal: "max-w-sm md:max-w-md",
|
|
21
21
|
}
|
|
22
22
|
let variantStyles = {
|
|
23
|
-
contained: "bg-
|
|
24
|
-
outlined: "bg-transparent border-2 border-
|
|
23
|
+
contained: "bg-layoutPrimary-default dark:bg-layoutPrimary-dark",
|
|
24
|
+
outlined: "bg-transparent border-2 border-black w-fit",
|
|
25
|
+
neobrutalism: "shadow-neobrutalism border-4 border-black bg-white",
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
29
|
<div
|
|
29
30
|
className={clsx(
|
|
30
31
|
defaultStyle,
|
|
32
|
+
// "shadow-3xl",
|
|
31
33
|
maxWidthStyles[maxWidth],
|
|
32
34
|
variantStyles[variant],
|
|
33
35
|
centered ? "flex items-center text-center" : ""
|