@sikka/hawa 0.0.103 → 0.0.104
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 +108 -51
- package/es/blocks/AuthForms/AppLanding.d.ts +1 -0
- package/es/blocks/AuthForms/CodeConfirmation.d.ts +6 -1
- package/es/blocks/AuthForms/NewPasswordForm.d.ts +0 -5
- package/es/blocks/AuthForms/ResetPasswordForm.d.ts +0 -3
- package/es/blocks/Referral/ReferralAccount.d.ts +7 -0
- package/es/blocks/Referral/ReferralSettlement.d.ts +8 -0
- package/es/blocks/Referral/ReferralStats.d.ts +8 -0
- package/es/blocks/Referral/index.d.ts +3 -0
- package/es/blocks/index.d.ts +1 -0
- package/es/elements/HawaChip.d.ts +1 -0
- package/es/elements/HawaCopyrights.d.ts +5 -5
- package/es/elements/HawaItemCard.d.ts +14 -6
- package/es/elements/HawaMenu.d.ts +2 -3
- package/es/elements/HawaModal.d.ts +1 -0
- package/es/elements/HawaSelect.d.ts +2 -1
- package/es/elements/HawaTable.d.ts +2 -2
- package/es/index.es.js +1 -1
- package/lib/blocks/AuthForms/AppLanding.d.ts +1 -0
- package/lib/blocks/AuthForms/CodeConfirmation.d.ts +6 -1
- package/lib/blocks/AuthForms/NewPasswordForm.d.ts +0 -5
- package/lib/blocks/AuthForms/ResetPasswordForm.d.ts +0 -3
- package/lib/blocks/Referral/ReferralAccount.d.ts +7 -0
- package/lib/blocks/Referral/ReferralSettlement.d.ts +8 -0
- package/lib/blocks/Referral/ReferralStats.d.ts +8 -0
- package/lib/blocks/Referral/index.d.ts +3 -0
- package/lib/blocks/index.d.ts +1 -0
- package/lib/elements/HawaChip.d.ts +1 -0
- package/lib/elements/HawaCopyrights.d.ts +5 -5
- package/lib/elements/HawaItemCard.d.ts +14 -6
- package/lib/elements/HawaMenu.d.ts +2 -3
- package/lib/elements/HawaModal.d.ts +1 -0
- package/lib/elements/HawaSelect.d.ts +2 -1
- package/lib/elements/HawaTable.d.ts +2 -2
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/AppLanding.tsx +2 -1
- package/src/blocks/AuthForms/CodeConfirmation.tsx +7 -2
- package/src/blocks/AuthForms/NewPasswordForm.tsx +1 -6
- package/src/blocks/AuthForms/ResetPasswordForm.tsx +1 -4
- package/src/blocks/AuthForms/SignInForm.tsx +1 -1
- package/src/blocks/AuthForms/SignInPhone.tsx +1 -1
- package/src/blocks/AuthForms/SignUpForm.tsx +1 -1
- package/src/blocks/Payment/CheckoutForm.tsx +9 -0
- package/src/blocks/Referral/ReferralAccount.tsx +49 -0
- package/src/blocks/Referral/ReferralSettlement.tsx +110 -0
- package/src/blocks/Referral/ReferralStats.tsx +94 -0
- package/src/blocks/Referral/index.ts +3 -0
- package/src/blocks/index.ts +5 -4
- package/src/elements/HawaButton.tsx +21 -21
- package/src/elements/HawaChip.tsx +17 -6
- package/src/elements/HawaCopyrights.tsx +5 -5
- package/src/elements/HawaItemCard.tsx +83 -58
- package/src/elements/HawaMenu.tsx +49 -54
- package/src/elements/HawaModal.tsx +58 -52
- package/src/elements/HawaSelect.tsx +4 -2
- package/src/elements/HawaTable.tsx +2 -2
- package/src/elements/HawaTooltip.tsx +23 -16
- package/src/layout/HawaContainer.tsx +2 -2
- package/src/styles.css +108 -51
- package/storybook-static/209.d29fd715.iframe.bundle.js +2 -0
- package/storybook-static/{209.70afd616.iframe.bundle.js.LICENSE.txt → 209.d29fd715.iframe.bundle.js.LICENSE.txt} +11 -15
- package/storybook-static/{767.888009dba401078f3f72.manager.bundle.js → 767.2f9c96fa3338c8d16078.manager.bundle.js} +2 -2
- package/storybook-static/{767.888009dba401078f3f72.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +19 -22
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.a1546405.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
- package/tailwind.config.js +1 -1
- package/storybook-static/209.70afd616.iframe.bundle.js +0 -2
- package/storybook-static/745.4b81597c.iframe.bundle.js +0 -1
- package/storybook-static/main.ff0dd517.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.968bd8b6.iframe.bundle.js +0 -1
|
@@ -1,25 +1,53 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
1
2
|
import React, { useEffect } from "react"
|
|
2
3
|
import { useState } from "react"
|
|
4
|
+
import { HawaMenu } from "./HawaMenu"
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
actions
|
|
6
|
-
content
|
|
7
|
-
headerActions
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
lang: string
|
|
6
|
+
interface ItemCardTypes {
|
|
7
|
+
actions?: any
|
|
8
|
+
content?: any
|
|
9
|
+
headerActions?: THeaderActions[][]
|
|
10
|
+
header?: any
|
|
11
|
+
lang?: string
|
|
12
|
+
cardImage?: string
|
|
12
13
|
onCardClick?: any
|
|
14
|
+
orientation?: "horizontal" | "vertical"
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
type THeaderActions = {
|
|
18
|
+
icon?: JSX.Element
|
|
19
|
+
label: string
|
|
20
|
+
action?: (
|
|
21
|
+
e: React.MouseEvent<HTMLLIElement, MouseEvent>,
|
|
22
|
+
item: string
|
|
23
|
+
) => void
|
|
24
|
+
isButton?: boolean
|
|
25
|
+
}
|
|
15
26
|
export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
16
27
|
actions,
|
|
17
28
|
content,
|
|
18
29
|
headerActions,
|
|
19
30
|
header,
|
|
31
|
+
cardImage,
|
|
32
|
+
orientation = "vertical",
|
|
20
33
|
...props
|
|
21
34
|
}) => {
|
|
35
|
+
let defaultStyle =
|
|
36
|
+
"block rounded-lg border border-gray-200 bg-white shadow-sm hover:shadow-lg transition-all dark:border-gray-700 dark:bg-gray-800 "
|
|
37
|
+
|
|
38
|
+
let orientationStyles = {
|
|
39
|
+
vertical: "max-w-sm",
|
|
40
|
+
horizontal: "flex flex-row w-full",
|
|
41
|
+
}
|
|
42
|
+
let imageStyles = {
|
|
43
|
+
vertical: "w-full rounded-tr-lg rounded-tl-lg",
|
|
44
|
+
horizontal: "h-40 w-fit rounded-tl-lg rounded-bl-lg",
|
|
45
|
+
}
|
|
46
|
+
let headerActionsButtonStyle =
|
|
47
|
+
"inline-block rounded-lg p-1 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-700"
|
|
48
|
+
|
|
22
49
|
const [openActionHeader, setOpenActionHeader] = useState(false)
|
|
50
|
+
const [openDropDown, setOpenDropDown] = useState(false)
|
|
23
51
|
|
|
24
52
|
function handleOpenActionHeader() {
|
|
25
53
|
setOpenActionHeader(!openActionHeader)
|
|
@@ -37,61 +65,58 @@ export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
|
37
65
|
|
|
38
66
|
return (
|
|
39
67
|
<div
|
|
40
|
-
className=
|
|
68
|
+
className={clsx(defaultStyle, orientationStyles[orientation])}
|
|
41
69
|
{...props}
|
|
42
70
|
>
|
|
43
|
-
{
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
71
|
+
{cardImage && (
|
|
72
|
+
<img
|
|
73
|
+
src={"https://via.placeholder.com/50"}
|
|
74
|
+
// className=" h-full w-full max-w-sm bg-red-500 bg-[url('https://via.placeholder.com/50')] bg-cover bg-no-repeat"
|
|
75
|
+
className={clsx(imageStyles[orientation])}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
<div className="relative w-full px-6 pt-6">
|
|
79
|
+
{headerActions && (
|
|
80
|
+
<div className="max-h- bg-red absolute right-0 top-0 flex justify-end pt-3 pr-3">
|
|
81
|
+
<HawaMenu
|
|
82
|
+
buttonPosition="top-right"
|
|
83
|
+
menuItems={headerActions}
|
|
84
|
+
handleClose={setOpenDropDown}
|
|
85
|
+
open={openDropDown}
|
|
59
86
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
>
|
|
77
|
-
{singleAction.label}
|
|
78
|
-
</a>
|
|
79
|
-
</li>
|
|
80
|
-
)
|
|
81
|
-
})}
|
|
82
|
-
</ul>
|
|
87
|
+
<div
|
|
88
|
+
className={clsx(headerActionsButtonStyle)}
|
|
89
|
+
onClick={handleOpenActionHeader}
|
|
90
|
+
>
|
|
91
|
+
<span className="sr-only">Open dropdown</span>
|
|
92
|
+
<svg
|
|
93
|
+
className="h-6 w-6"
|
|
94
|
+
aria-hidden="true"
|
|
95
|
+
fill="currentColor"
|
|
96
|
+
viewBox="0 0 20 20"
|
|
97
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
98
|
+
>
|
|
99
|
+
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path>
|
|
100
|
+
</svg>
|
|
101
|
+
</div>
|
|
102
|
+
</HawaMenu>
|
|
83
103
|
</div>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
104
|
+
)}
|
|
105
|
+
|
|
106
|
+
{header && (
|
|
107
|
+
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
|
|
108
|
+
{header}
|
|
109
|
+
</h5>
|
|
110
|
+
)}
|
|
111
|
+
{content && (
|
|
112
|
+
<p className="w-full font-normal text-gray-700 dark:text-gray-400">
|
|
113
|
+
{content}
|
|
114
|
+
</p>
|
|
115
|
+
)}
|
|
116
|
+
{actions && (
|
|
117
|
+
<div className="flex justify-end rounded-b-lg p-3">{actions}</div>
|
|
118
|
+
)}
|
|
93
119
|
</div>
|
|
94
|
-
<div className="mt-6 flex justify-end rounded-b-lg p-3">{actions}</div>
|
|
95
120
|
</div>
|
|
96
121
|
)
|
|
97
122
|
}
|
|
@@ -2,29 +2,26 @@ import clsx from "clsx"
|
|
|
2
2
|
import React, { ReactNode } from "react"
|
|
3
3
|
|
|
4
4
|
interface TMenuTypes {
|
|
5
|
-
popMenuID: any
|
|
6
5
|
menuItems: MenuItems[][]
|
|
7
|
-
//
|
|
8
|
-
// icon: PropTypes.element,
|
|
9
|
-
// label: PropTypes.string,
|
|
10
|
-
// action: PropTypes.func,
|
|
11
|
-
//
|
|
12
6
|
withHeader?: boolean
|
|
13
7
|
withIcons?: boolean
|
|
14
8
|
headerTitle?: string
|
|
15
9
|
headerSubtitle?: string
|
|
16
|
-
open
|
|
17
|
-
handleClose
|
|
10
|
+
open?: boolean
|
|
11
|
+
handleClose?: (e: boolean) => void
|
|
18
12
|
anchor?: any
|
|
19
13
|
children?: ReactNode
|
|
20
14
|
buttonPosition?: "top-right" | "top-left" | "bottom-right" | "bottom-left"
|
|
21
15
|
}
|
|
22
16
|
|
|
23
|
-
type MenuItems =
|
|
24
|
-
icon
|
|
25
|
-
label
|
|
26
|
-
action
|
|
27
|
-
|
|
17
|
+
type MenuItems = {
|
|
18
|
+
icon?: JSX.Element
|
|
19
|
+
label: string
|
|
20
|
+
action?: (
|
|
21
|
+
e: React.MouseEvent<HTMLLIElement, MouseEvent>,
|
|
22
|
+
item: string
|
|
23
|
+
) => void
|
|
24
|
+
isButton?: boolean
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
@@ -39,7 +36,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
39
36
|
children,
|
|
40
37
|
}) => {
|
|
41
38
|
let defaultStyles =
|
|
42
|
-
"absolute z-10 w-44 divide-y divide-gray-100 overflow-y-clip rounded-lg bg-white shadow transition-all dark:bg-gray-700"
|
|
39
|
+
"border-2 border-blue-400 border-opacity-20 ring-offset-1 absolute z-10 w-44 divide-y divide-gray-100 overflow-y-clip rounded-lg bg-white shadow transition-all dark:bg-gray-700"
|
|
43
40
|
let positionStyles = {
|
|
44
41
|
"top-right": "top-30 right-0",
|
|
45
42
|
"top-left": "top-30 left-0",
|
|
@@ -51,47 +48,45 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
51
48
|
closed: "max-h-0 opacity-0 animate-expandUp",
|
|
52
49
|
}
|
|
53
50
|
return (
|
|
54
|
-
<div className="">
|
|
55
|
-
|
|
56
|
-
{children}
|
|
51
|
+
<div className="relative w-fit " onClick={() => handleClose(!open)}>
|
|
52
|
+
{children}
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</div>
|
|
54
|
+
<div
|
|
55
|
+
className={clsx(
|
|
56
|
+
defaultStyles,
|
|
57
|
+
positionStyles[buttonPosition],
|
|
58
|
+
open ? animationStyles.opened : animationStyles.closed
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
61
|
+
{withHeader && (
|
|
62
|
+
<div className="py-3 px-4 text-sm text-gray-900 dark:text-white">
|
|
63
|
+
<div>{headerTitle}</div>
|
|
64
|
+
<div className="truncate font-medium">{headerSubtitle}</div>
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
{menuItems.map((group) => {
|
|
68
|
+
return (
|
|
69
|
+
<ul className="py-1 text-sm text-gray-700 dark:text-gray-200">
|
|
70
|
+
{group?.map((item) => {
|
|
71
|
+
return (
|
|
72
|
+
<li
|
|
73
|
+
onClick={(e) => item.action(e, item.label)}
|
|
74
|
+
className={
|
|
75
|
+
item.isButton
|
|
76
|
+
? "mx-1 flex cursor-pointer flex-row items-center rounded-lg bg-primary-500 py-2 px-4 text-white hover:bg-primary-600 rtl:flex-row-reverse dark:hover:bg-primary-600 dark:hover:text-white"
|
|
77
|
+
: "mx-1 flex cursor-pointer flex-row items-center rounded-lg py-2 px-4 hover:bg-gray-100 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white"
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
{withIcons && (
|
|
81
|
+
<div className="mr-2 rtl:ml-2">{item.icon}</div>
|
|
82
|
+
)}
|
|
83
|
+
{item.label}
|
|
84
|
+
</li>
|
|
85
|
+
)
|
|
86
|
+
})}
|
|
87
|
+
</ul>
|
|
88
|
+
)
|
|
89
|
+
})}
|
|
95
90
|
</div>
|
|
96
91
|
</div>
|
|
97
92
|
)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
1
2
|
import React, { ReactElement, useEffect } from "react"
|
|
2
3
|
|
|
3
4
|
type ModalTypes = {
|
|
4
5
|
open: boolean
|
|
5
6
|
title: string
|
|
6
7
|
onClose: () => void
|
|
7
|
-
|
|
8
|
+
closeOnClickOutside?: boolean
|
|
8
9
|
modalID?: string
|
|
9
10
|
children: ReactElement
|
|
10
11
|
actions: any
|
|
@@ -13,63 +14,68 @@ export const HawaModal: React.FunctionComponent<ModalTypes> = ({
|
|
|
13
14
|
open,
|
|
14
15
|
title,
|
|
15
16
|
onClose,
|
|
17
|
+
closeOnClickOutside = true,
|
|
16
18
|
...props
|
|
17
19
|
}) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
let defaultStyle =
|
|
21
|
+
"absolute top-1/2 left-1/2 w-full h-screen flex flex-col justify-center items-center -translate-x-1/2 -translate-y-1/2 transition-all"
|
|
22
|
+
useEffect((): any => {
|
|
23
|
+
if (closeOnClickOutside && open) {
|
|
24
|
+
window.onclick = (e) => {
|
|
25
|
+
e.stopPropagation()
|
|
26
|
+
console.log("open : ", open)
|
|
27
|
+
console.log("Im clicing")
|
|
28
|
+
onClose()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return () => (window.onclick = null)
|
|
32
|
+
}, [open])
|
|
30
33
|
return (
|
|
31
34
|
<div
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
open ? "block" : "hidden"
|
|
37
|
-
} h-modal fixed top-0 right-0 left-0 z-50 w-full items-center justify-center overflow-y-auto overflow-x-hidden md:inset-0 md:h-full`}
|
|
35
|
+
className={clsx(
|
|
36
|
+
defaultStyle,
|
|
37
|
+
open ? "z-10 opacity-100 " : "invisible -z-10 opacity-0"
|
|
38
|
+
)}
|
|
38
39
|
>
|
|
39
|
-
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
<div
|
|
41
|
+
className={clsx(
|
|
42
|
+
"absolute h-screen w-full bg-gray-500 opacity-50",
|
|
43
|
+
open ? "opacity-50" : "opacity-0"
|
|
44
|
+
)}
|
|
45
|
+
></div>
|
|
46
|
+
|
|
47
|
+
<div className="relative w-1/2 max-w-md rounded-lg bg-white p-1 shadow-lg dark:bg-gray-700">
|
|
48
|
+
<div className="flex items-start justify-between rounded-t p-3 dark:border-gray-600">
|
|
49
|
+
<h3 className="text-xl font-semibold text-gray-900 dark:text-white">
|
|
50
|
+
{title}
|
|
51
|
+
</h3>
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
className="inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
55
|
+
data-modal-toggle="defaultModal"
|
|
56
|
+
onClick={(e) => {
|
|
57
|
+
onClose()
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
<svg
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
className="h-5 w-5"
|
|
63
|
+
fill="currentColor"
|
|
64
|
+
viewBox="0 0 20 20"
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
52
66
|
>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</svg>
|
|
66
|
-
<span className="sr-only">Close modal</span>
|
|
67
|
-
</button>
|
|
68
|
-
</div>
|
|
69
|
-
<div className="space-y-6 p-6">{props.children}</div>
|
|
70
|
-
<div className="flex items-center space-x-2 rounded-b border-t border-gray-200 p-6 dark:border-gray-600">
|
|
71
|
-
{props.actions}
|
|
72
|
-
</div>
|
|
67
|
+
<path
|
|
68
|
+
fill-rule="evenodd"
|
|
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
|
+
clip-rule="evenodd"
|
|
71
|
+
></path>
|
|
72
|
+
</svg>
|
|
73
|
+
<span className="sr-only">Close modal</span>
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="space-y-6 p-3">{props.children}</div>
|
|
77
|
+
<div className="mx-2 flex items-center justify-end space-x-1 p-0 dark:border-gray-600">
|
|
78
|
+
{props.actions}
|
|
73
79
|
</div>
|
|
74
80
|
</div>
|
|
75
81
|
</div>
|
|
@@ -68,7 +68,7 @@ const Menu: React.FunctionComponent<MenuTypes> = ({
|
|
|
68
68
|
}) => {
|
|
69
69
|
return (
|
|
70
70
|
<div
|
|
71
|
-
className="absolute mt-2 w-full rounded-lg bg-white"
|
|
71
|
+
className="absolute z-10 mt-2 w-full rounded-lg bg-white ring-1 ring-blue-200"
|
|
72
72
|
ref={innerRef}
|
|
73
73
|
{...innerProps}
|
|
74
74
|
// {...props}
|
|
@@ -81,7 +81,7 @@ const Menu: React.FunctionComponent<MenuTypes> = ({
|
|
|
81
81
|
type SelectTypes = {
|
|
82
82
|
label?: any
|
|
83
83
|
isCreatable?: any
|
|
84
|
-
options?: any
|
|
84
|
+
options?: any[any]
|
|
85
85
|
isClearable?: any
|
|
86
86
|
isMulti?: any
|
|
87
87
|
isSearchable?: any
|
|
@@ -92,6 +92,7 @@ type SelectTypes = {
|
|
|
92
92
|
fullWidth?: any
|
|
93
93
|
value?: any
|
|
94
94
|
children?: any
|
|
95
|
+
getOptionLabel?: any
|
|
95
96
|
}
|
|
96
97
|
export const HawaSelect: React.FunctionComponent<SelectTypes> = (props) => {
|
|
97
98
|
return (
|
|
@@ -115,6 +116,7 @@ export const HawaSelect: React.FunctionComponent<SelectTypes> = (props) => {
|
|
|
115
116
|
Option,
|
|
116
117
|
Menu,
|
|
117
118
|
}}
|
|
119
|
+
getOptionLabel={props.getOptionLabel}
|
|
118
120
|
/>
|
|
119
121
|
)}
|
|
120
122
|
{props.isCreatable && (
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import clsx from "clsx"
|
|
2
|
+
import React, { useState } from "react"
|
|
3
3
|
|
|
4
4
|
type THawaToolTip = {
|
|
5
|
-
children
|
|
6
|
-
content
|
|
5
|
+
children: React.ReactElement
|
|
6
|
+
content: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const HawaTooltip
|
|
10
|
-
|
|
9
|
+
export const HawaTooltip: React.FunctionComponent<THawaToolTip> = ({
|
|
10
|
+
children,
|
|
11
|
+
content,
|
|
12
|
+
}) => {
|
|
13
|
+
const [isHovered, setIsHovered] = useState<boolean>(false)
|
|
14
|
+
let tooltipStyles = {
|
|
15
|
+
default:
|
|
16
|
+
"absolute top-5 opacity-0 left-0 z-10 inline-block w-fit max-w-xs rounded-lg bg-gray-900 py-2 px-3 text-center text-sm font-medium text-white opacity-100 shadow-sm transition-all duration-300 dark:bg-gray-700",
|
|
17
|
+
hovered:
|
|
18
|
+
"absolute top-5 opacity-100 left-0 z-10 inline-block w-fit max-w-xs rounded-lg bg-gray-900 py-2 px-3 text-center text-sm font-medium text-white opacity-100 shadow-sm transition-all duration-300 dark:bg-gray-700",
|
|
19
|
+
}
|
|
11
20
|
return (
|
|
12
21
|
<div className="relative">
|
|
13
22
|
<div
|
|
14
|
-
className="w-fit"
|
|
23
|
+
className="flex h-fit w-fit items-center justify-center"
|
|
15
24
|
onMouseEnter={() => {
|
|
16
|
-
setIsHovered(true)
|
|
25
|
+
setIsHovered(true)
|
|
17
26
|
}}
|
|
18
27
|
onMouseLeave={() => {
|
|
19
|
-
setIsHovered(false)
|
|
28
|
+
setIsHovered(false)
|
|
20
29
|
}}
|
|
21
30
|
>
|
|
22
31
|
{children}
|
|
23
32
|
</div>
|
|
24
33
|
<div
|
|
25
|
-
className={
|
|
26
|
-
isHovered
|
|
27
|
-
|
|
28
|
-
: "absolute top-10 left-0 z-10 inline-block w-fit max-w-xs rounded-lg bg-gray-900 py-2 px-3 text-center text-sm font-medium text-white opacity-0 shadow-sm transition-opacity duration-300 dark:bg-gray-700"
|
|
29
|
-
}
|
|
34
|
+
className={clsx(
|
|
35
|
+
isHovered ? tooltipStyles["hovered"] : tooltipStyles["default"]
|
|
36
|
+
)}
|
|
30
37
|
>
|
|
31
38
|
{content}
|
|
32
39
|
</div>
|
|
33
40
|
</div>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -13,11 +13,11 @@ export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
|
|
|
13
13
|
"flex w-full max-w-sm flex-col rounded-xl bg-primary-300 p-4 dark:bg-gray-600"
|
|
14
14
|
let maxWidthStyles: any = {
|
|
15
15
|
full: "md:max-w-xl",
|
|
16
|
-
small: "md:max-w-sm",
|
|
16
|
+
small: "md:max-w-sm w-1/3 min-w-min",
|
|
17
17
|
normal: "md:max-w-md",
|
|
18
18
|
}
|
|
19
19
|
return (
|
|
20
|
-
<div className={clsx(defaultStyle, maxWidthStyles[maxWidth])}>
|
|
20
|
+
<div className={clsx(defaultStyle, maxWidthStyles[maxWidth], "")}>
|
|
21
21
|
{props.children}
|
|
22
22
|
</div>
|
|
23
23
|
)
|