@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.
Files changed (74) hide show
  1. package/dist/styles.css +108 -51
  2. package/es/blocks/AuthForms/AppLanding.d.ts +1 -0
  3. package/es/blocks/AuthForms/CodeConfirmation.d.ts +6 -1
  4. package/es/blocks/AuthForms/NewPasswordForm.d.ts +0 -5
  5. package/es/blocks/AuthForms/ResetPasswordForm.d.ts +0 -3
  6. package/es/blocks/Referral/ReferralAccount.d.ts +7 -0
  7. package/es/blocks/Referral/ReferralSettlement.d.ts +8 -0
  8. package/es/blocks/Referral/ReferralStats.d.ts +8 -0
  9. package/es/blocks/Referral/index.d.ts +3 -0
  10. package/es/blocks/index.d.ts +1 -0
  11. package/es/elements/HawaChip.d.ts +1 -0
  12. package/es/elements/HawaCopyrights.d.ts +5 -5
  13. package/es/elements/HawaItemCard.d.ts +14 -6
  14. package/es/elements/HawaMenu.d.ts +2 -3
  15. package/es/elements/HawaModal.d.ts +1 -0
  16. package/es/elements/HawaSelect.d.ts +2 -1
  17. package/es/elements/HawaTable.d.ts +2 -2
  18. package/es/index.es.js +1 -1
  19. package/lib/blocks/AuthForms/AppLanding.d.ts +1 -0
  20. package/lib/blocks/AuthForms/CodeConfirmation.d.ts +6 -1
  21. package/lib/blocks/AuthForms/NewPasswordForm.d.ts +0 -5
  22. package/lib/blocks/AuthForms/ResetPasswordForm.d.ts +0 -3
  23. package/lib/blocks/Referral/ReferralAccount.d.ts +7 -0
  24. package/lib/blocks/Referral/ReferralSettlement.d.ts +8 -0
  25. package/lib/blocks/Referral/ReferralStats.d.ts +8 -0
  26. package/lib/blocks/Referral/index.d.ts +3 -0
  27. package/lib/blocks/index.d.ts +1 -0
  28. package/lib/elements/HawaChip.d.ts +1 -0
  29. package/lib/elements/HawaCopyrights.d.ts +5 -5
  30. package/lib/elements/HawaItemCard.d.ts +14 -6
  31. package/lib/elements/HawaMenu.d.ts +2 -3
  32. package/lib/elements/HawaModal.d.ts +1 -0
  33. package/lib/elements/HawaSelect.d.ts +2 -1
  34. package/lib/elements/HawaTable.d.ts +2 -2
  35. package/lib/index.js +1 -1
  36. package/package.json +1 -1
  37. package/src/blocks/AuthForms/AppLanding.tsx +2 -1
  38. package/src/blocks/AuthForms/CodeConfirmation.tsx +7 -2
  39. package/src/blocks/AuthForms/NewPasswordForm.tsx +1 -6
  40. package/src/blocks/AuthForms/ResetPasswordForm.tsx +1 -4
  41. package/src/blocks/AuthForms/SignInForm.tsx +1 -1
  42. package/src/blocks/AuthForms/SignInPhone.tsx +1 -1
  43. package/src/blocks/AuthForms/SignUpForm.tsx +1 -1
  44. package/src/blocks/Payment/CheckoutForm.tsx +9 -0
  45. package/src/blocks/Referral/ReferralAccount.tsx +49 -0
  46. package/src/blocks/Referral/ReferralSettlement.tsx +110 -0
  47. package/src/blocks/Referral/ReferralStats.tsx +94 -0
  48. package/src/blocks/Referral/index.ts +3 -0
  49. package/src/blocks/index.ts +5 -4
  50. package/src/elements/HawaButton.tsx +21 -21
  51. package/src/elements/HawaChip.tsx +17 -6
  52. package/src/elements/HawaCopyrights.tsx +5 -5
  53. package/src/elements/HawaItemCard.tsx +83 -58
  54. package/src/elements/HawaMenu.tsx +49 -54
  55. package/src/elements/HawaModal.tsx +58 -52
  56. package/src/elements/HawaSelect.tsx +4 -2
  57. package/src/elements/HawaTable.tsx +2 -2
  58. package/src/elements/HawaTooltip.tsx +23 -16
  59. package/src/layout/HawaContainer.tsx +2 -2
  60. package/src/styles.css +108 -51
  61. package/storybook-static/209.d29fd715.iframe.bundle.js +2 -0
  62. package/storybook-static/{209.70afd616.iframe.bundle.js.LICENSE.txt → 209.d29fd715.iframe.bundle.js.LICENSE.txt} +11 -15
  63. package/storybook-static/{767.888009dba401078f3f72.manager.bundle.js → 767.2f9c96fa3338c8d16078.manager.bundle.js} +2 -2
  64. package/storybook-static/{767.888009dba401078f3f72.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +19 -22
  65. package/storybook-static/iframe.html +1 -1
  66. package/storybook-static/index.html +1 -1
  67. package/storybook-static/main.a1546405.iframe.bundle.js +1 -0
  68. package/storybook-static/project.json +1 -1
  69. package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
  70. package/tailwind.config.js +1 -1
  71. package/storybook-static/209.70afd616.iframe.bundle.js +0 -2
  72. package/storybook-static/745.4b81597c.iframe.bundle.js +0 -1
  73. package/storybook-static/main.ff0dd517.iframe.bundle.js +0 -1
  74. 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
- type ItemCardTypes = {
5
- actions: any
6
- content: any
7
- headerActions: any
8
- // label: PropTypes.string,
9
- // action: PropTypes.func,
10
- header: any
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="relative block max-w-sm rounded-lg border border-gray-200 bg-white pt-6 shadow-md dark:border-gray-700 dark:bg-gray-800 "
68
+ className={clsx(defaultStyle, orientationStyles[orientation])}
41
69
  {...props}
42
70
  >
43
- {headerActions && (
44
- <div className="absolute right-0 top-0 flex justify-end pt-3 pr-3">
45
- <button
46
- id="dropdownButton"
47
- data-dropdown-toggle="dropdown"
48
- className="inline-block rounded-lg 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"
49
- type="button"
50
- onClick={handleOpenActionHeader}
51
- >
52
- <span className="sr-only">Open dropdown</span>
53
- <svg
54
- className="h-6 w-6"
55
- aria-hidden="true"
56
- fill="currentColor"
57
- viewBox="0 0 20 20"
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
- <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>
61
- </svg>
62
- </button>
63
- <div
64
- id="dropdown"
65
- className={`absolute ${
66
- openActionHeader ? "block" : "hidden"
67
- } right-0 top-7 z-10 w-44 list-none divide-y divide-gray-100 rounded bg-white text-base shadow dark:bg-gray-700`}
68
- >
69
- <ul className="py-1" aria-labelledby="dropdownButton">
70
- {headerActions.map((singleAction: any) => {
71
- return (
72
- <li onClick={singleAction.action}>
73
- <a
74
- href="#"
75
- className="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white"
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
- </div>
85
- )}
86
- <div className="px-6">
87
- <h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
88
- {header}{" "}
89
- </h5>
90
- <p className="font-normal text-gray-700 dark:text-gray-400">
91
- {content}
92
- </p>
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: boolean
17
- handleClose: (e : boolean) => void
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 ?: JSX.Element,
25
- label : string,
26
- action ?: (e : React.MouseEvent<HTMLLIElement, MouseEvent>,item : string) => void
27
- isButton ?: boolean
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
- <div className="relative w-fit" onClick={() => handleClose(!open)}>
56
- {children}
51
+ <div className="relative w-fit " onClick={() => handleClose(!open)}>
52
+ {children}
57
53
 
58
- <div
59
- className={clsx(
60
- defaultStyles,
61
- positionStyles[buttonPosition],
62
- open ? animationStyles.opened : animationStyles.closed
63
- )}
64
- >
65
- {withHeader && (
66
- <div className="py-3 px-4 text-sm text-gray-900 dark:text-white">
67
- <div>{headerTitle}</div>
68
- <div className="truncate font-medium">{headerSubtitle}</div>
69
- </div>
70
- )}
71
- {menuItems.map((group) => {
72
- return (
73
- <ul className="py-1 text-sm text-gray-700 dark:text-gray-200">
74
- {group.map((item) => {
75
- return (
76
- <li
77
- onClick={(e) => item.action(e, item.label)}
78
- className={
79
- item.isButton
80
- ? "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"
81
- : "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"
82
- }
83
- >
84
- {withIcons && (
85
- <div className="mr-2 rtl:ml-2">{item.icon}</div>
86
- )}
87
- {item.label}
88
- </li>
89
- )
90
- })}
91
- </ul>
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
- // closeOnClickOutside: any
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
- // useEffect((): any => {
19
- // if (closeOnClickOutside) {
20
- // window.onclick = () => {
21
- // console.log("open : ", open)
22
- // if (open) {
23
- // console.log("Im clicing")
24
- // onClose()
25
- // }
26
- // }
27
- // }
28
- // return () => (window.onclick = null)
29
- // }, [open])
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
- id={props.modalID}
33
- tabIndex={-1}
34
- aria-hidden="true"
35
- className={`${
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 className="relative h-full w-full max-w-2xl p-4 md:h-auto">
40
- <div className="relative rounded-lg bg-white shadow dark:bg-gray-700">
41
- <div className="flex items-start justify-between rounded-t border-b p-4 dark:border-gray-600">
42
- <h3 className="text-xl font-semibold text-gray-900 dark:text-white">
43
- {title}
44
- </h3>
45
- <button
46
- type="button"
47
- className="ml-auto 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"
48
- data-modal-toggle="defaultModal"
49
- onClick={(e) => {
50
- onClose()
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
- <svg
54
- aria-hidden="true"
55
- className="h-5 w-5"
56
- fill="currentColor"
57
- viewBox="0 0 20 20"
58
- xmlns="http://www.w3.org/2000/svg"
59
- >
60
- <path
61
- fill-rule="evenodd"
62
- 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"
63
- clip-rule="evenodd"
64
- ></path>
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 && (
@@ -3,9 +3,9 @@ import { HawaButton } from "./HawaButton"
3
3
 
4
4
  type TableTypes = {
5
5
  lang?: any
6
- columns?: any
6
+ columns: any[string]
7
7
  actions?: any
8
- rows?: any
8
+ rows?: any[any]
9
9
  noDataText?: any
10
10
  handleActionClick?: any
11
11
  end?: any
@@ -1,35 +1,42 @@
1
- import React, { useState } from "react";
2
-
1
+ import clsx from "clsx"
2
+ import React, { useState } from "react"
3
3
 
4
4
  type THawaToolTip = {
5
- children : React.ReactElement
6
- content : string
5
+ children: React.ReactElement
6
+ content: string
7
7
  }
8
8
 
9
- export const HawaTooltip : React.FunctionComponent<THawaToolTip> = ({children, content}) => {
10
- const [isHovered, setIsHovered] = useState<boolean>(false);
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
- ? "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-100 shadow-sm transition-opacity duration-300 dark:bg-gray-700"
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
  )