@sikka/hawa 0.0.134 → 0.0.136
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 +18 -13
- package/es/elements/HawaSnackbar.d.ts +2 -0
- package/es/elements/index.d.ts +1 -2
- package/es/hooks/useBreakpoint.d.ts +2 -0
- package/es/index.es.js +1 -1
- package/lib/elements/HawaSnackbar.d.ts +2 -0
- package/lib/elements/index.d.ts +1 -2
- package/lib/hooks/useBreakpoint.d.ts +2 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/Pricing/ComparingPlans.tsx +4 -4
- package/src/elements/DragDropImages.tsx +3 -3
- package/src/elements/HawaAccordian.tsx +5 -3
- package/src/elements/HawaDrawer.tsx +48 -8
- package/src/elements/HawaModal.tsx +2 -2
- package/src/elements/HawaPricingCard.tsx +2 -22
- package/src/elements/HawaSnackbar.tsx +76 -41
- package/src/elements/index.ts +1 -2
- package/src/hooks/useBreakpoint.ts +20 -0
- package/src/hooks/useDiscloser.ts +5 -9
- package/src/layout/HawaAppLayout.tsx +35 -25
- package/src/layout/HawaSiteLayout.tsx +16 -21
- package/src/styles.css +18 -13
- package/storybook-static/{669.d0879212.iframe.bundle.js → 103.d48f1210.iframe.bundle.js} +2 -2
- package/storybook-static/{669.d0879212.iframe.bundle.js.LICENSE.txt → 103.d48f1210.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.237a650d.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/es/elements/HawaDrawerItem.d.ts +0 -8
- package/lib/elements/HawaDrawerItem.d.ts +0 -8
- package/src/elements/HawaDrawerItem.tsx +0 -33
- package/storybook-static/main.b801e3dc.iframe.bundle.js +0 -1
package/package.json
CHANGED
|
@@ -10,9 +10,9 @@ const CheckMark = () => (
|
|
|
10
10
|
xmlns="http://www.w3.org/2000/svg"
|
|
11
11
|
>
|
|
12
12
|
<path
|
|
13
|
-
|
|
13
|
+
fillRule="evenodd"
|
|
14
14
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
|
15
|
-
|
|
15
|
+
clipRule="evenodd"
|
|
16
16
|
></path>
|
|
17
17
|
</svg>
|
|
18
18
|
)
|
|
@@ -26,9 +26,9 @@ const UncheckMark = () => (
|
|
|
26
26
|
xmlns="http://www.w3.org/2000/svg"
|
|
27
27
|
>
|
|
28
28
|
<path
|
|
29
|
-
|
|
29
|
+
fillRule="evenodd"
|
|
30
30
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
31
|
-
|
|
31
|
+
clipRule="evenodd"
|
|
32
32
|
></path>
|
|
33
33
|
</svg>
|
|
34
34
|
)
|
|
@@ -124,9 +124,9 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
124
124
|
xmlns="http://www.w3.org/2000/svg"
|
|
125
125
|
>
|
|
126
126
|
<path
|
|
127
|
-
|
|
127
|
+
fillRule="evenodd"
|
|
128
128
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
129
|
-
|
|
129
|
+
clipRule="evenodd"
|
|
130
130
|
></path>
|
|
131
131
|
</svg>
|
|
132
132
|
<span className="sr-only">Close modal</span>
|
|
@@ -157,7 +157,7 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
157
157
|
<div
|
|
158
158
|
// variant="drop-area"
|
|
159
159
|
{...getRootProps({
|
|
160
|
-
style: {backgroundColor
|
|
160
|
+
style: { backgroundColor: isDragActive ? "white" : "inherit" },
|
|
161
161
|
})}
|
|
162
162
|
// style={{ backgroundColor: isDragActive ? "white" : "inherit" }}
|
|
163
163
|
className="flex flex-col justify-center rounded-xl border border-dashed border-black"
|
|
@@ -38,15 +38,17 @@ const AccordionItem: React.FunctionComponent<AccordionItemTypes> = (props) => {
|
|
|
38
38
|
<span>{props.title}</span>
|
|
39
39
|
<svg
|
|
40
40
|
data-accordion-icon=""
|
|
41
|
-
className={`h-6 w-6 ${
|
|
41
|
+
className={`h-6 w-6 ${
|
|
42
|
+
collapse ? "" : "rotate-180"
|
|
43
|
+
} shrink-0 transition-all`}
|
|
42
44
|
fill="currentColor"
|
|
43
45
|
viewBox="0 0 20 20"
|
|
44
46
|
xmlns="http://www.w3.org/2000/svg"
|
|
45
47
|
>
|
|
46
48
|
<path
|
|
47
|
-
|
|
49
|
+
fillRule="evenodd"
|
|
48
50
|
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
49
|
-
|
|
51
|
+
clipRule="evenodd"
|
|
50
52
|
></path>
|
|
51
53
|
</svg>
|
|
52
54
|
</button>
|
|
@@ -50,14 +50,24 @@ export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
52
|
|
|
53
|
-
const drawerClass =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return
|
|
53
|
+
// const drawerClass =
|
|
54
|
+
// open && position == "left"
|
|
55
|
+
// ? clsx("block", leftDrawer)
|
|
56
|
+
// : open && position == "right"
|
|
57
|
+
// ? clsx("block", rightDrawer)
|
|
58
|
+
// : "hidden w-0 "
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
className={clsx(
|
|
63
|
+
position == "left" ? leftDrawer : rightDrawer,
|
|
64
|
+
"overflow-y-clip transition-all",
|
|
65
|
+
open ? "w-60" : "w-0"
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{childrenWithProps}
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
type TDrawerHeader = {
|
|
@@ -101,3 +111,33 @@ export const DrawerFooter = (props: TDrawerFooter) => {
|
|
|
101
111
|
</div>
|
|
102
112
|
)
|
|
103
113
|
}
|
|
114
|
+
|
|
115
|
+
type DrawerItemTypes = {
|
|
116
|
+
action: any
|
|
117
|
+
icon?: any
|
|
118
|
+
text: any
|
|
119
|
+
}
|
|
120
|
+
const HawaDrawerItem: React.FunctionComponent<DrawerItemTypes> = (props) => {
|
|
121
|
+
let withIcon =
|
|
122
|
+
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
123
|
+
let withoutIcon =
|
|
124
|
+
"flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<li onClick={props.action}>
|
|
128
|
+
<div className={props.icon ? withIcon : withoutIcon}>
|
|
129
|
+
{/* <svg
|
|
130
|
+
aria-hidden="true"
|
|
131
|
+
className="w-6 h-6 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
|
132
|
+
fill="currentColor"
|
|
133
|
+
viewBox="0 0 20 20"
|
|
134
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
135
|
+
>
|
|
136
|
+
<path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
|
|
137
|
+
<path d="M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"></path>
|
|
138
|
+
</svg> */}
|
|
139
|
+
<span className="ml-3">{props.text}</span>
|
|
140
|
+
</div>
|
|
141
|
+
</li>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
@@ -65,9 +65,9 @@ export const HawaModal: React.FunctionComponent<ModalTypes> = ({
|
|
|
65
65
|
xmlns="http://www.w3.org/2000/svg"
|
|
66
66
|
>
|
|
67
67
|
<path
|
|
68
|
-
|
|
68
|
+
fillRule="evenodd"
|
|
69
69
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
70
|
-
|
|
70
|
+
clipRule="evenodd"
|
|
71
71
|
></path>
|
|
72
72
|
</svg>
|
|
73
73
|
<span className="sr-only">Close modal</span>
|
|
@@ -107,9 +107,9 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
|
|
|
107
107
|
>
|
|
108
108
|
<title>Check icon</title>
|
|
109
109
|
<path
|
|
110
|
-
|
|
110
|
+
fillRule="evenodd"
|
|
111
111
|
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
|
|
112
|
-
|
|
112
|
+
clipRule="evenodd"
|
|
113
113
|
></path>
|
|
114
114
|
</svg>
|
|
115
115
|
<span className="flex items-center text-center font-normal leading-tight text-gray-500 dark:text-gray-400">
|
|
@@ -118,26 +118,6 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
|
|
|
118
118
|
</li>
|
|
119
119
|
)
|
|
120
120
|
})}
|
|
121
|
-
|
|
122
|
-
{/* <li className="flex space-x-3 line-through decoration-gray-500">
|
|
123
|
-
<svg
|
|
124
|
-
aria-hidden="true"
|
|
125
|
-
className="flex-shrink-0 w-5 h-5 text-gray-400 dark:text-gray-500"
|
|
126
|
-
fill="currentColor"
|
|
127
|
-
viewBox="0 0 20 20"
|
|
128
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
-
>
|
|
130
|
-
<title>Check icon</title>
|
|
131
|
-
<path
|
|
132
|
-
fill-rule="evenodd"
|
|
133
|
-
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
|
|
134
|
-
clip-rule="evenodd"
|
|
135
|
-
></path>
|
|
136
|
-
</svg>
|
|
137
|
-
<span className="text-base font-normal leading-tight text-gray-500">
|
|
138
|
-
Sketch Files
|
|
139
|
-
</span>
|
|
140
|
-
</li> */}
|
|
141
121
|
</ul>
|
|
142
122
|
<button
|
|
143
123
|
type="button"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import clsx from "clsx"
|
|
2
|
-
import React, { FC } from "react"
|
|
2
|
+
import React, { FC, useEffect, useRef, useState } from "react"
|
|
3
3
|
import { HawaButton } from "./HawaButton"
|
|
4
4
|
|
|
5
5
|
type THawaSnackBar = {
|
|
6
6
|
severity: "info" | "warning" | "error" | "success" | "none"
|
|
7
7
|
title: string
|
|
8
8
|
description: string
|
|
9
|
+
handleClose?: () => void
|
|
10
|
+
duration?: number
|
|
9
11
|
position?:
|
|
10
12
|
| "top-left"
|
|
11
13
|
| "top-center"
|
|
@@ -28,6 +30,8 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
|
|
|
28
30
|
severity = "info",
|
|
29
31
|
position = "bottom-left",
|
|
30
32
|
actions,
|
|
33
|
+
handleClose,
|
|
34
|
+
duration,
|
|
31
35
|
}) => {
|
|
32
36
|
let defaultStyle =
|
|
33
37
|
"fixed flex flex-row items-top p-1 w-full max-w-xs rounded-lg shadow dark:text-gray-400 dark:bg-gray-800"
|
|
@@ -46,50 +50,81 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
|
|
|
46
50
|
"bottom-right": "bottom-4 right-4",
|
|
47
51
|
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
48
52
|
}
|
|
53
|
+
|
|
54
|
+
const [closed, setClosed] = useState(false)
|
|
55
|
+
const toastRef = useRef(null)
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (duration) {
|
|
58
|
+
//To change opacity and hide the component
|
|
59
|
+
const timeoutHide = setTimeout(() => {
|
|
60
|
+
setClosed(true)
|
|
61
|
+
}, duration)
|
|
62
|
+
//To destroy the component after hiding it
|
|
63
|
+
const timeoutDestroy = setTimeout(() => {
|
|
64
|
+
setClosed(true)
|
|
65
|
+
toastRef.current.removeChild(toastRef.current.children[0])
|
|
66
|
+
}, duration + 1000)
|
|
67
|
+
|
|
68
|
+
return () => {
|
|
69
|
+
clearTimeout(timeoutHide)
|
|
70
|
+
clearTimeout(timeoutDestroy)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [duration])
|
|
74
|
+
|
|
49
75
|
return (
|
|
50
|
-
<div
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{actions.map((act) => (
|
|
61
|
-
<HawaButton
|
|
62
|
-
variant={act.variant}
|
|
63
|
-
onClick={act.onClick()}
|
|
64
|
-
margins="none"
|
|
65
|
-
>
|
|
66
|
-
{act.label}
|
|
67
|
-
</HawaButton>
|
|
68
|
-
))}
|
|
69
|
-
</div>
|
|
76
|
+
<div ref={toastRef}>
|
|
77
|
+
<div
|
|
78
|
+
id="toast-default"
|
|
79
|
+
role="alert"
|
|
80
|
+
className={clsx(
|
|
81
|
+
defaultStyle,
|
|
82
|
+
severities[severity],
|
|
83
|
+
positions[position],
|
|
84
|
+
"p-2 transition-all",
|
|
85
|
+
closed ? "opacity-0" : "opacity-100"
|
|
70
86
|
)}
|
|
71
|
-
</div>
|
|
72
|
-
<button
|
|
73
|
-
type="button"
|
|
74
|
-
className="inline-flex h-8 w-8 rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
75
|
-
data-dismiss-target="#toast-default"
|
|
76
|
-
aria-label="Close"
|
|
77
87
|
>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
<div className="p-3">
|
|
89
|
+
<div className="text-sm font-bold">{title}</div>
|
|
90
|
+
<div className="text-sm font-normal">{description}</div>
|
|
91
|
+
{actions && (
|
|
92
|
+
<div className="mt-2 flex flex-row gap-2">
|
|
93
|
+
{actions.map((act) => (
|
|
94
|
+
<HawaButton
|
|
95
|
+
variant={act.variant}
|
|
96
|
+
onClick={act.onClick()}
|
|
97
|
+
margins="none"
|
|
98
|
+
>
|
|
99
|
+
{act.label}
|
|
100
|
+
</HawaButton>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
className="inline-flex h-8 w-8 rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
108
|
+
data-dismiss-target="#toast-default"
|
|
109
|
+
aria-label="Close"
|
|
110
|
+
onClick={() => setClosed(true)}
|
|
85
111
|
>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
<span className="sr-only">Close</span>
|
|
113
|
+
<svg
|
|
114
|
+
aria-hidden="true"
|
|
115
|
+
className="h-5 w-5"
|
|
116
|
+
fill="currentColor"
|
|
117
|
+
viewBox="0 0 20 20"
|
|
118
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
119
|
+
>
|
|
120
|
+
<path
|
|
121
|
+
fillRule="evenodd"
|
|
122
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
123
|
+
clipRule="evenodd"
|
|
124
|
+
></path>
|
|
125
|
+
</svg>
|
|
126
|
+
</button>
|
|
127
|
+
</div>
|
|
93
128
|
</div>
|
|
94
129
|
)
|
|
95
130
|
}
|
package/src/elements/index.ts
CHANGED
|
@@ -15,18 +15,17 @@ export * from "./HawaAccordian"
|
|
|
15
15
|
export * from "./DragDropImages"
|
|
16
16
|
export * from "./DraggableCard"
|
|
17
17
|
export * from "./HawaPhoneInput"
|
|
18
|
-
export * from "./HawaDrawerItem"
|
|
19
18
|
export * from "./HawaTooltip"
|
|
20
19
|
export * from "./HawaTabs"
|
|
21
20
|
export * from "./HawaModal"
|
|
22
21
|
export * from "./HawaMenu"
|
|
23
|
-
export * from "./HawaDrawer"
|
|
24
22
|
export * from "./HawaCopyrights"
|
|
25
23
|
export * from "./HawaTimeline"
|
|
26
24
|
export * from "./Breadcrumb"
|
|
27
25
|
export * from "./HawaStats"
|
|
28
26
|
export * from "./HawaSpinner"
|
|
29
27
|
export * from "./HawaRadio"
|
|
28
|
+
export * from "./HawaDrawer"
|
|
30
29
|
// Inputs
|
|
31
30
|
export * from "./HawaTextField"
|
|
32
31
|
export * from "./HawaCardInput"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useState, useEffect } from "react"
|
|
2
|
+
|
|
3
|
+
const useBreakpoint = () => {
|
|
4
|
+
const [breakpoint, setBreakpoint] = useState(1200)
|
|
5
|
+
const resize = () => {
|
|
6
|
+
setBreakpoint(window.innerWidth)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
window.addEventListener("resize", resize)
|
|
11
|
+
|
|
12
|
+
return () => {
|
|
13
|
+
window.removeEventListener("resize", resize)
|
|
14
|
+
}
|
|
15
|
+
}, [])
|
|
16
|
+
|
|
17
|
+
return breakpoint
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default useBreakpoint
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
type TUseDiscloser = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
isOpen: boolean
|
|
5
|
+
onOpen: () => void
|
|
6
|
+
onClose: () => void
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
const useDiscloser = (value: boolean = false)
|
|
9
|
+
const useDiscloser = (value: boolean = false): TUseDiscloser => {
|
|
11
10
|
const [open, setOpen] = useState<boolean>(value)
|
|
12
|
-
|
|
13
11
|
const onOpen = () => setOpen(true)
|
|
14
|
-
|
|
15
12
|
const onClose = () => setOpen(false)
|
|
16
13
|
|
|
17
14
|
return {
|
|
@@ -21,5 +18,4 @@ const useDiscloser = (value: boolean = false) : TUseDiscloser => {
|
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
export default useDiscloser;
|
|
21
|
+
export default useDiscloser
|
|
@@ -42,7 +42,6 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
42
42
|
)}
|
|
43
43
|
>
|
|
44
44
|
{props.pageTitle ? <div>{props.pageTitle}</div> : <div></div>}
|
|
45
|
-
{/* <div>currentPage</div> */}
|
|
46
45
|
<HawaMenu
|
|
47
46
|
buttonPosition="top-right"
|
|
48
47
|
menuItems={props.profileMenuItems}
|
|
@@ -58,9 +57,9 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
58
57
|
xmlns="http://www.w3.org/2000/svg"
|
|
59
58
|
>
|
|
60
59
|
<path
|
|
61
|
-
|
|
60
|
+
fillRule="evenodd"
|
|
62
61
|
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
63
|
-
|
|
62
|
+
clipRule="evenodd"
|
|
64
63
|
></path>
|
|
65
64
|
</svg>
|
|
66
65
|
</div>
|
|
@@ -70,7 +69,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
70
69
|
<div
|
|
71
70
|
onMouseEnter={() => setOpenSideMenu(true)}
|
|
72
71
|
onMouseLeave={() => setOpenSideMenu(false)}
|
|
73
|
-
className="fixed top-0 left-0 z-50 flex h-full w-12 flex-col bg-primary-400 transition-all hover:w-40"
|
|
72
|
+
className="fixed top-0 left-0 z-50 flex h-full w-12 flex-col overflow-auto bg-primary-400 transition-all hover:w-40"
|
|
74
73
|
>
|
|
75
74
|
<div className="flex flex-row p-2">
|
|
76
75
|
{/* full logo */}
|
|
@@ -86,26 +85,37 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
86
85
|
/>
|
|
87
86
|
)}
|
|
88
87
|
</div>
|
|
89
|
-
{props.drawerItems.map((
|
|
90
|
-
<div
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
88
|
+
{props.drawerItems.map((dSection, j) => (
|
|
89
|
+
<div className="flex flex-col items-stretch justify-center">
|
|
90
|
+
{dSection.map((dItem, i) => {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
key={i}
|
|
94
|
+
onClick={() => dItem.action(dItem.slug)}
|
|
95
|
+
className={clsx(
|
|
96
|
+
"m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all hover:bg-primary-500",
|
|
97
|
+
props.currentPage === dItem.slug
|
|
98
|
+
? "bg-primary-600 text-white hover:bg-primary-600"
|
|
99
|
+
: ""
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
<div className="flex items-center justify-center">
|
|
103
|
+
{dItem.icon}
|
|
104
|
+
</div>
|
|
105
|
+
<div
|
|
106
|
+
className={clsx(
|
|
107
|
+
"mx-2 whitespace-nowrap text-sm transition-all",
|
|
108
|
+
openSideMenu ? "opacity-100" : "opacity-0"
|
|
109
|
+
)}
|
|
110
|
+
>
|
|
111
|
+
{dItem.label}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
)
|
|
115
|
+
})}
|
|
116
|
+
{j !== props.drawerItems.length - 1 && (
|
|
117
|
+
<div className="my-2 h-[1px] w-10/12 self-center bg-primary-600 text-center "></div>
|
|
118
|
+
)}{" "}
|
|
109
119
|
</div>
|
|
110
120
|
))}
|
|
111
121
|
</div>
|
|
@@ -114,7 +124,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
114
124
|
// "overflow-scroll",
|
|
115
125
|
"w-[calc(100%-3rem)]",
|
|
116
126
|
"translate-x-[3rem]",
|
|
117
|
-
"bg-red-900 text-white",
|
|
127
|
+
// "bg-red-900 text-white",
|
|
118
128
|
"m-0",
|
|
119
129
|
props.topBar ? "mt-14" : ""
|
|
120
130
|
)}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import clsx from "clsx"
|
|
2
2
|
import React, { useState } from "react"
|
|
3
|
-
import HawaDrawerItem from "../elements/HawaDrawerItem"
|
|
4
3
|
|
|
5
4
|
const MenuButton = ({ handleClick }) => {
|
|
6
5
|
return (
|
|
@@ -21,9 +20,9 @@ const MenuButton = ({ handleClick }) => {
|
|
|
21
20
|
xmlns="http://www.w3.org/2000/svg"
|
|
22
21
|
>
|
|
23
22
|
<path
|
|
24
|
-
|
|
23
|
+
fillRule="evenodd"
|
|
25
24
|
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
26
|
-
|
|
25
|
+
clipRule="evenodd"
|
|
27
26
|
></path>
|
|
28
27
|
</svg>
|
|
29
28
|
</button>
|
|
@@ -86,9 +85,7 @@ const DrawerContent = (props: any) => {
|
|
|
86
85
|
<div className="overflow-y-auto py-4">
|
|
87
86
|
<ul className="space-y-2">
|
|
88
87
|
{props.drawerItems.map((item: any, i: any) => {
|
|
89
|
-
return
|
|
90
|
-
<HawaDrawerItem action={item.action} key={i} text={item.text} />
|
|
91
|
-
)
|
|
88
|
+
return <div>{item.text}</div>
|
|
92
89
|
})}
|
|
93
90
|
</ul>
|
|
94
91
|
</div>
|
|
@@ -124,9 +121,9 @@ const CloseButton = () => {
|
|
|
124
121
|
xmlns="http://www.w3.org/2000/svg"
|
|
125
122
|
>
|
|
126
123
|
<path
|
|
127
|
-
|
|
124
|
+
fillRule="evenodd"
|
|
128
125
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
129
|
-
|
|
126
|
+
clipRule="evenodd"
|
|
130
127
|
></path>
|
|
131
128
|
</svg>
|
|
132
129
|
</button>
|
|
@@ -159,9 +156,9 @@ export const HawaSiteLayout: React.FunctionComponent<LayoutTypes> = (
|
|
|
159
156
|
xmlns="http://www.w3.org/2000/svg"
|
|
160
157
|
>
|
|
161
158
|
<path
|
|
162
|
-
|
|
159
|
+
fillRule="evenodd"
|
|
163
160
|
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
164
|
-
|
|
161
|
+
clipRule="evenodd"
|
|
165
162
|
></path>
|
|
166
163
|
</svg>
|
|
167
164
|
</div>
|
|
@@ -186,9 +183,9 @@ export const HawaSiteLayout: React.FunctionComponent<LayoutTypes> = (
|
|
|
186
183
|
xmlns="http://www.w3.org/2000/svg"
|
|
187
184
|
>
|
|
188
185
|
<path
|
|
189
|
-
|
|
186
|
+
fillRule="evenodd"
|
|
190
187
|
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
191
|
-
|
|
188
|
+
clipRule="evenodd"
|
|
192
189
|
></path>
|
|
193
190
|
</svg>
|
|
194
191
|
</button>{" "}
|
|
@@ -230,18 +227,16 @@ export const HawaSiteLayout: React.FunctionComponent<LayoutTypes> = (
|
|
|
230
227
|
xmlns="http://www.w3.org/2000/svg"
|
|
231
228
|
>
|
|
232
229
|
<path
|
|
233
|
-
|
|
230
|
+
fillRule="evenodd"
|
|
234
231
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
235
|
-
|
|
232
|
+
clipRule="evenodd"
|
|
236
233
|
></path>
|
|
237
234
|
</svg>
|
|
238
235
|
</button>{" "}
|
|
239
236
|
<div className="overflow-y-auto py-4">
|
|
240
237
|
<ul className="space-y-2">
|
|
241
238
|
{props.drawerItems.map((item: any, i: any) => {
|
|
242
|
-
return
|
|
243
|
-
<HawaDrawerItem action={item.action} key={i} text={item.text} />
|
|
244
|
-
)
|
|
239
|
+
return <div>{item.text}</div>
|
|
245
240
|
})}
|
|
246
241
|
</ul>
|
|
247
242
|
</div>
|
|
@@ -266,9 +261,9 @@ const AppLayoutNav = (props) => (
|
|
|
266
261
|
xmlns="http://www.w3.org/2000/svg"
|
|
267
262
|
>
|
|
268
263
|
<path
|
|
269
|
-
|
|
264
|
+
fillRule="evenodd"
|
|
270
265
|
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
271
|
-
|
|
266
|
+
clipRule="evenodd"
|
|
272
267
|
></path>
|
|
273
268
|
</svg>
|
|
274
269
|
</div>
|
|
@@ -290,9 +285,9 @@ const AppLayoutNav = (props) => (
|
|
|
290
285
|
xmlns="http://www.w3.org/2000/svg"
|
|
291
286
|
>
|
|
292
287
|
<path
|
|
293
|
-
|
|
288
|
+
fillRule="evenodd"
|
|
294
289
|
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
295
|
-
|
|
290
|
+
clipRule="evenodd"
|
|
296
291
|
></path>
|
|
297
292
|
</svg>
|
|
298
293
|
</button>{" "}
|