@sikka/hawa 0.0.135 → 0.0.137
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 +19 -42
- package/es/elements/HawaDrawer.d.ts +4 -14
- 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/HawaDrawer.d.ts +4 -14
- 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 +61 -45
- 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 +3 -3
- package/src/layout/HawaSiteLayout.tsx +16 -21
- package/src/styles.css +19 -42
- package/storybook-static/{669.d0879212.iframe.bundle.js → 103.af0e0958.iframe.bundle.js} +2 -2
- package/storybook-static/{669.d0879212.iframe.bundle.js.LICENSE.txt → 103.af0e0958.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.3b2c2bdd.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.2d33731c.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>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactElement, ReactNode, useEffect, useState } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { FaChevronLeft, FaChevronRight } from "react-icons/fa"
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
5
|
type TDrawerTypes = {
|
|
@@ -8,6 +8,9 @@ type TDrawerTypes = {
|
|
|
8
8
|
position: any
|
|
9
9
|
heading: any
|
|
10
10
|
children?: ReactNode
|
|
11
|
+
drawerHeader?: any
|
|
12
|
+
drawerBody?: any
|
|
13
|
+
drawerFooter?: any
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
@@ -19,55 +22,49 @@ export const HawaDrawer: React.FunctionComponent<TDrawerTypes> = ({
|
|
|
19
22
|
...props
|
|
20
23
|
}) => {
|
|
21
24
|
const leftDrawer =
|
|
22
|
-
"w-60 z-50 h-full absolute overflow-x-
|
|
25
|
+
"w-60 z-50 h-full absolute overflow-x-clip top-0 left-0 border-r bg-white"
|
|
23
26
|
const rightDrawer =
|
|
24
|
-
"w-60 z-50 h-full absolute overflow-x-
|
|
27
|
+
"w-60 z-50 h-full absolute overflow-x-clip top-0 right-0 border-l bg-white"
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
case "DrawerBody":
|
|
41
|
-
return <DrawerBody children={child.props.children} />
|
|
42
|
-
|
|
43
|
-
case "DrawerFooter":
|
|
44
|
-
return <DrawerFooter children={child.props.children} />
|
|
45
|
-
}
|
|
46
|
-
return React.cloneElement(child, {
|
|
47
|
-
// setOpen: setOpen,
|
|
48
|
-
// children: child.props.children,
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const drawerClass =
|
|
54
|
-
open && position == "left"
|
|
55
|
-
? clsx("block", leftDrawer)
|
|
56
|
-
: open && position == "right"
|
|
57
|
-
? clsx("block", rightDrawer)
|
|
58
|
-
: "hidden"
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
className={clsx(
|
|
32
|
+
position == "left" ? leftDrawer : rightDrawer,
|
|
33
|
+
position == "left" ? "flex-row-reverse" : "flex-row",
|
|
34
|
+
"overflow-x-clip transition-all",
|
|
35
|
+
open ? "w-60" : "w-0"
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{props.drawerHeader && (
|
|
39
|
+
<DrawerHeader direction={position} setOpen={setOpen}>
|
|
40
|
+
{props.drawerHeader}
|
|
41
|
+
</DrawerHeader>
|
|
42
|
+
)}
|
|
59
43
|
|
|
60
|
-
|
|
44
|
+
{props.drawerBody && (
|
|
45
|
+
<DrawerBody direction={position}>{props.drawerBody}</DrawerBody>
|
|
46
|
+
)}
|
|
47
|
+
{props.drawerFooter && (
|
|
48
|
+
<DrawerFooter direction={position}>{props.drawerFooter}</DrawerFooter>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
61
52
|
}
|
|
62
53
|
|
|
63
54
|
type TDrawerHeader = {
|
|
64
55
|
setOpen: any
|
|
65
56
|
children: ReactElement
|
|
57
|
+
direction: any
|
|
66
58
|
}
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
69
61
|
return (
|
|
70
|
-
<div
|
|
62
|
+
<div
|
|
63
|
+
className={clsx(
|
|
64
|
+
"flex w-full flex-row items-center justify-between border-b p-4",
|
|
65
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse"
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
71
68
|
{props.children}
|
|
72
69
|
<div
|
|
73
70
|
className="justify-self-end rounded border p-1 hover:cursor-pointer"
|
|
@@ -76,7 +73,11 @@ export const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
|
76
73
|
props.setOpen(false)
|
|
77
74
|
}}
|
|
78
75
|
>
|
|
79
|
-
|
|
76
|
+
{props.direction == "left" ? (
|
|
77
|
+
<FaChevronLeft size={20} strokeWidth={2} />
|
|
78
|
+
) : (
|
|
79
|
+
<FaChevronRight size={20} strokeWidth={2} />
|
|
80
|
+
)}
|
|
80
81
|
</div>
|
|
81
82
|
</div>
|
|
82
83
|
)
|
|
@@ -84,19 +85,34 @@ export const DrawerHeader: FC<TDrawerHeader> = (props) => {
|
|
|
84
85
|
|
|
85
86
|
type TDrawerBody = {
|
|
86
87
|
children: ReactElement
|
|
88
|
+
direction: any
|
|
87
89
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
const DrawerBody = (props: TDrawerBody) => {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
className={clsx(
|
|
94
|
+
"overflow-clip whitespace-nowrap p-4",
|
|
95
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse text-right"
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
{props.children}
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
91
101
|
}
|
|
92
102
|
|
|
93
103
|
type TDrawerFooter = {
|
|
94
104
|
children: ReactElement
|
|
105
|
+
direction: any
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
const DrawerFooter = (props: TDrawerFooter) => {
|
|
98
109
|
return (
|
|
99
|
-
<div
|
|
110
|
+
<div
|
|
111
|
+
className={clsx(
|
|
112
|
+
"absolute bottom-0 w-full whitespace-nowrap border-t p-4",
|
|
113
|
+
props.direction == "left" ? "flex-row" : "flex-row-reverse text-right"
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
100
116
|
{props.children}
|
|
101
117
|
</div>
|
|
102
118
|
)
|
|
@@ -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
|
|
@@ -57,9 +57,9 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
57
57
|
xmlns="http://www.w3.org/2000/svg"
|
|
58
58
|
>
|
|
59
59
|
<path
|
|
60
|
-
|
|
60
|
+
fillRule="evenodd"
|
|
61
61
|
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
62
|
-
|
|
62
|
+
clipRule="evenodd"
|
|
63
63
|
></path>
|
|
64
64
|
</svg>
|
|
65
65
|
</div>
|
|
@@ -124,7 +124,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
124
124
|
// "overflow-scroll",
|
|
125
125
|
"w-[calc(100%-3rem)]",
|
|
126
126
|
"translate-x-[3rem]",
|
|
127
|
-
"bg-red-900 text-white",
|
|
127
|
+
// "bg-red-900 text-white",
|
|
128
128
|
"m-0",
|
|
129
129
|
props.topBar ? "mt-14" : ""
|
|
130
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>{" "}
|