@sikka/hawa 0.0.113 → 0.0.116

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 (69) hide show
  1. package/dist/styles.css +58 -14
  2. package/es/blocks/AuthForms/AppLanding.d.ts +3 -3
  3. package/es/blocks/AuthForms/NewPasswordForm.d.ts +1 -2
  4. package/es/blocks/AuthForms/ResetPasswordForm.d.ts +1 -1
  5. package/es/blocks/AuthForms/SignInForm.d.ts +6 -6
  6. package/es/blocks/AuthForms/SignInPhone.d.ts +1 -0
  7. package/es/blocks/AuthForms/SignUpForm.d.ts +5 -5
  8. package/es/elements/HawaAlert.d.ts +1 -0
  9. package/es/elements/HawaChip.d.ts +1 -0
  10. package/es/elements/HawaPinInput.d.ts +8 -0
  11. package/es/elements/HawaStats.d.ts +9 -0
  12. package/es/elements/index.d.ts +2 -0
  13. package/es/index.es.js +1 -1
  14. package/es/layout/HawaAppLayout.d.ts +9 -0
  15. package/es/layout/{HawaLayout.d.ts → HawaSiteLayout.d.ts} +1 -1
  16. package/es/layout/index.d.ts +2 -1
  17. package/lib/blocks/AuthForms/AppLanding.d.ts +3 -3
  18. package/lib/blocks/AuthForms/NewPasswordForm.d.ts +1 -2
  19. package/lib/blocks/AuthForms/ResetPasswordForm.d.ts +1 -1
  20. package/lib/blocks/AuthForms/SignInForm.d.ts +6 -6
  21. package/lib/blocks/AuthForms/SignInPhone.d.ts +1 -0
  22. package/lib/blocks/AuthForms/SignUpForm.d.ts +5 -5
  23. package/lib/elements/HawaAlert.d.ts +1 -0
  24. package/lib/elements/HawaChip.d.ts +1 -0
  25. package/lib/elements/HawaPinInput.d.ts +8 -0
  26. package/lib/elements/HawaStats.d.ts +9 -0
  27. package/lib/elements/index.d.ts +2 -0
  28. package/lib/index.js +1 -1
  29. package/lib/layout/HawaAppLayout.d.ts +9 -0
  30. package/lib/layout/{HawaLayout.d.ts → HawaSiteLayout.d.ts} +1 -1
  31. package/lib/layout/index.d.ts +2 -1
  32. package/package.json +1 -2
  33. package/src/blocks/AuthForms/AppLanding.tsx +3 -3
  34. package/src/blocks/AuthForms/NewPasswordForm.tsx +1 -2
  35. package/src/blocks/AuthForms/ResetPasswordForm.tsx +1 -1
  36. package/src/blocks/AuthForms/SignInForm.tsx +6 -6
  37. package/src/blocks/AuthForms/SignInPhone.tsx +8 -10
  38. package/src/blocks/AuthForms/SignUpForm.tsx +7 -7
  39. package/src/elements/HawaAlert.tsx +59 -2
  40. package/src/elements/HawaChip.tsx +9 -5
  41. package/src/elements/HawaPinInput.tsx +55 -0
  42. package/src/elements/HawaSearchBar.tsx +1 -1
  43. package/src/elements/HawaStats.tsx +25 -0
  44. package/src/elements/HawaTextField.tsx +17 -4
  45. package/src/elements/index.ts +2 -0
  46. package/src/layout/HawaAppLayout.tsx +60 -0
  47. package/src/layout/HawaSiteLayout.tsx +302 -0
  48. package/src/layout/index.ts +6 -6
  49. package/src/styles.css +58 -14
  50. package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
  51. package/storybook-static/{51.8ca217c6882b6d3971a8.manager.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
  52. package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
  53. package/storybook-static/{51.aeae4f67.iframe.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
  54. package/storybook-static/733.b57425fc.iframe.bundle.js +2 -0
  55. package/storybook-static/{669.31ae8ecc.iframe.bundle.js.LICENSE.txt → 733.b57425fc.iframe.bundle.js.LICENSE.txt} +0 -0
  56. package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
  57. package/storybook-static/{767.294896b3de4a98c7bd38.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -0
  58. package/storybook-static/iframe.html +1 -1
  59. package/storybook-static/index.html +2 -2
  60. package/storybook-static/main.4c317f06.iframe.bundle.js +1 -0
  61. package/storybook-static/project.json +1 -1
  62. package/storybook-static/{runtime~main.118c8621e276a271ad89.manager.bundle.js → runtime~main.25eae181fe0f96887a15.manager.bundle.js} +1 -1
  63. package/storybook-static/{runtime~main.4a2964ac.iframe.bundle.js → runtime~main.4d0bf318.iframe.bundle.js} +1 -1
  64. package/src/layout/HawaLayout.tsx +0 -212
  65. package/storybook-static/51.8ca217c6882b6d3971a8.manager.bundle.js +0 -2
  66. package/storybook-static/51.aeae4f67.iframe.bundle.js +0 -2
  67. package/storybook-static/669.31ae8ecc.iframe.bundle.js +0 -2
  68. package/storybook-static/767.294896b3de4a98c7bd38.manager.bundle.js +0 -2
  69. package/storybook-static/main.5ddcc678.iframe.bundle.js +0 -1
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type HawaAppLayoutTypes = {
3
+ logoLink: string;
4
+ username: string;
5
+ userEmail: string;
6
+ drawerItems: any;
7
+ };
8
+ export declare const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes>;
9
+ export {};
@@ -5,5 +5,5 @@ type LayoutTypes = {
5
5
  userEmail: string;
6
6
  drawerItems: any;
7
7
  };
8
- export declare const HawaLayout: React.FunctionComponent<LayoutTypes>;
8
+ export declare const HawaSiteLayout: React.FunctionComponent<LayoutTypes>;
9
9
  export {};
@@ -1,5 +1,6 @@
1
1
  export * from "./Box";
2
2
  export * from "./HawaBottomAppBar";
3
- export * from "./HawaLayout";
3
+ export * from "./HawaSiteLayout";
4
+ export * from "./HawaAppLayout";
4
5
  export * from "./HawaContainer";
5
6
  export * from "./SimpleGrid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.113",
3
+ "version": "0.0.116",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -38,7 +38,6 @@
38
38
  "babel-loader": "^8.2.2",
39
39
  "clsx": "^1.2.1",
40
40
  "crypto-js": "^4.1.1",
41
- "emotion-theming": "^11.0.0",
42
41
  "framer-motion": "^4.1.7",
43
42
  "html-webpack-plugin": "^5.5.0",
44
43
  "next-scripts": "^0.3.4",
@@ -3,9 +3,9 @@ import { HawaButton } from "../../elements"
3
3
  import { HawaContainer } from "../../layout/HawaContainer"
4
4
 
5
5
  type AppLandingTypes = {
6
- handleSignIn: any
7
- handleSignUp: any
8
- handleLanguage: any
6
+ handleSignIn: () => void
7
+ handleSignUp: () => void
8
+ handleLanguage: () => void
9
9
  texts: {
10
10
  signIn: string
11
11
  signUp: string
@@ -4,7 +4,7 @@ import { Controller, FormProvider, useForm } from "react-hook-form"
4
4
  import { HawaContainer } from "../../layout"
5
5
 
6
6
  type NewPasswordTypes = {
7
- handleNewPassword: any
7
+ handleNewPassword: () => void
8
8
  passwordChanged: any
9
9
  texts: {
10
10
  passwordPlaceholder: string
@@ -17,7 +17,6 @@ type NewPasswordTypes = {
17
17
  passwordMatchError: string
18
18
  passwordChanged: string
19
19
  }
20
- handleSignIn: any
21
20
  }
22
21
 
23
22
  export const NewPasswordForm: React.FunctionComponent<NewPasswordTypes> = (
@@ -4,7 +4,7 @@ import { HawaButton, HawaTextField } from "../../elements"
4
4
  import { HawaContainer } from "../../layout"
5
5
 
6
6
  type ResetPasswordType = {
7
- handleResetPassword: any
7
+ handleResetPassword: () => void
8
8
  sent: any
9
9
  texts: {
10
10
  emailLabel: string
@@ -41,12 +41,12 @@ type SignInFormTypes = {
41
41
  viaGoogle: boolean
42
42
  viaGithub: boolean
43
43
  viaTwitter: boolean
44
- handleSignIn: any
45
- handleRouteToSignUp: any
46
- handleForgotPassword: any
47
- handleGoogleSignIn: any
48
- handleGithubSignIn: any
49
- handleTwitterSignIn: any
44
+ handleSignIn: (e: any) => void
45
+ handleRouteToSignUp: () => void
46
+ handleForgotPassword: () => void
47
+ handleGoogleSignIn: () => void
48
+ handleGithubSignIn: () => void
49
+ handleTwitterSignIn: () => void
50
50
  }
51
51
 
52
52
  export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
@@ -11,29 +11,27 @@ type SignInPhoneTypes = {
11
11
  handlePhoneChange: any
12
12
  phoneRequiredText: any
13
13
  SignInButtonText: any
14
+ handleSignIn: any
14
15
  }
15
16
 
16
17
  export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
17
18
  props
18
19
  ) => {
20
+ const methods = useForm()
19
21
  const {
20
22
  formState: { errors },
21
23
  handleSubmit,
22
24
  control,
23
- } = useForm()
25
+ } = methods
24
26
 
25
27
  const [userPhone, setUserPhone] = useState("")
26
- const handlingSubmit = () => {
27
- console.log("submitting ", userPhone)
28
- }
29
28
  return (
30
29
  <HawaContainer>
31
30
  <form
32
- onSubmit={handleSubmit(() => console.log("testing submit"))}
33
- // onSubmit={(e) => {
34
- // e.preventDefault()
35
- // console.log("testing submit")
36
- // }}
31
+ onSubmit={(e) => {
32
+ e.preventDefault()
33
+ props.handleSignIn(userPhone)
34
+ }}
37
35
  >
38
36
  <Controller
39
37
  control={control}
@@ -42,11 +40,11 @@ export const SignInPhone: React.FunctionComponent<SignInPhoneTypes> = (
42
40
  <HawaPhoneInput
43
41
  country={props.country ?? ""}
44
42
  label={props.label ?? ""}
45
- {...field}
46
43
  handleChange={(e: any) => {
47
44
  console.log("test")
48
45
  setUserPhone(e.target.value)
49
46
  }}
47
+ {...field}
50
48
  // handleChange={(e: any) => {
51
49
  // // props.handlePhoneChange(e.target.value)
52
50
  // setUserPhone(e.target.value)
@@ -49,11 +49,11 @@ type SignUpFormTypes = {
49
49
  showNewsletterOption: boolean
50
50
  showRefCode: boolean
51
51
  showTermsOption: boolean
52
- handleSignUp: any
53
- handleRouteToSignIn: any
54
- handleGoogleSignUp: any
55
- handleGithubSignUp: any
56
- handleTwitterSignUp: any
52
+ handleSignUp: (e: any) => void
53
+ handleRouteToSignIn: () => void
54
+ handleGoogleSignUp: () => void
55
+ handleGithubSignUp: () => void
56
+ handleTwitterSignUp: () => void
57
57
  showError: any
58
58
  errorTitle: any
59
59
  errorText: any
@@ -78,7 +78,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
78
78
  />
79
79
  )}
80
80
  <FormProvider {...methods}>
81
- <form onSubmit={handleSubmit(props.handleSignUp)}>
81
+ <form onSubmit={handleSubmit((e) => props.handleSignUp(e))}>
82
82
  <Controller
83
83
  control={control}
84
84
  name="fullName"
@@ -228,7 +228,6 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
228
228
  render={({ field }) => (
229
229
  <HawaCheckbox
230
230
  helperText={errors.terms_accepted?.message}
231
- {...field}
232
231
  onChange={() => console.log("te")}
233
232
  label={
234
233
  <span>
@@ -238,6 +237,7 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
238
237
  </a>
239
238
  </span>
240
239
  }
240
+ {...field}
241
241
  />
242
242
  )}
243
243
  rules={{ required: props.texts.termsRequiredText }}
@@ -12,6 +12,13 @@ let severities = {
12
12
  type AlertTypes = {
13
13
  severity: keyof typeof severities
14
14
  title?: any
15
+ variant?:
16
+ | "normal"
17
+ | "solid"
18
+ | "top-accent"
19
+ | "left-accent"
20
+ | "right-accent"
21
+ | "bottom-accent"
15
22
  text: any
16
23
  hideIcon?: any
17
24
  actions?: [
@@ -22,12 +29,62 @@ type AlertTypes = {
22
29
  }
23
30
  ]
24
31
  }
25
- export const HawaAlert: React.FunctionComponent<AlertTypes> = (props) => {
32
+ export const HawaAlert: React.FunctionComponent<AlertTypes> = ({
33
+ variant = "normal",
34
+ ...props
35
+ }) => {
36
+ let styleVariant = {
37
+ normal: {
38
+ info: "text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
39
+ warning:
40
+ "text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
41
+ error: "text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
42
+ success:
43
+ "text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
44
+ },
45
+ "top-accent": {
46
+ info: "border-t-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
47
+ warning:
48
+ "border-t-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
49
+ error:
50
+ "border-t-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
51
+ success:
52
+ "border-t-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
53
+ },
54
+ "left-accent": {
55
+ info: "border-l-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
56
+ warning:
57
+ "border-l-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
58
+ error:
59
+ "border-l-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
60
+ success:
61
+ "border-l-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
62
+ },
63
+ "right-accent": {
64
+ info: "border-r-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
65
+ warning:
66
+ "border-r-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
67
+ error:
68
+ "border-r-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
69
+ success:
70
+ "border-r-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
71
+ },
72
+ "bottom-accent": {
73
+ info: "border-b-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
74
+ warning:
75
+ "border-b-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
76
+ error:
77
+ "border-b-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
78
+ success:
79
+ "border-b-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
80
+ },
81
+ }
26
82
  return (
27
83
  <div
28
84
  className={clsx(
29
85
  "mb-4 flex flex-col rounded-lg p-4 text-sm",
30
- severities[props.severity]
86
+ // severities[props.severity],
87
+ styleVariant[variant][props.severity]
31
88
  )}
32
89
  role="alert"
33
90
  >
@@ -4,20 +4,24 @@ import React from "react"
4
4
  type TChipTypes = {
5
5
  label: string
6
6
  size: "small" | "normal" | "large"
7
+ icon?: JSX.Element
7
8
  }
8
9
  export const HawaChip: React.FunctionComponent<TChipTypes> = ({
9
10
  size = "normal",
10
11
  label,
12
+ icon,
11
13
  }) => {
12
- // small: "text-xs px-2.5 py-1.5",
13
- // medium: "text-sm leading-4 px-3 py-2",
14
- // large: "text-sm px-4 py-2",
15
14
  let defaultStyles =
16
- "rounded-lg bg-blue-200 px-2.5 py-0.5 font-bold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
15
+ "flex flex-row w-fit gap-1 items-center rounded-lg bg-blue-200 px-2.5 py-0.5 font-bold text-blue-800 dark:bg-blue-200 dark:text-blue-800"
17
16
  let sizeStyles = {
18
17
  small: "h-fit text-xs",
19
18
  normal: "h-full leading-4 px-3 py-2 text-xs ",
20
19
  large: "",
21
20
  }
22
- return <span className={clsx(defaultStyles, sizeStyles[size])}>{label}</span>
21
+ return (
22
+ <span className={clsx(defaultStyles, sizeStyles[size])}>
23
+ {icon && icon}
24
+ {label}
25
+ </span>
26
+ )
23
27
  }
@@ -0,0 +1,55 @@
1
+ import clsx from "clsx"
2
+ import React from "react"
3
+
4
+ type PinInputTypes = {
5
+ label: string
6
+ icon?: JSX.Element
7
+ digits?: number
8
+ }
9
+ export const HawaPinInput: React.FunctionComponent<PinInputTypes> = ({
10
+ label,
11
+ icon,
12
+ }) => {
13
+ const validate = (evt) => {
14
+ var theEvent = evt || window.event
15
+
16
+ // Handle paste
17
+ if (theEvent.type === "paste") {
18
+ key = evt.clipboardData.getData("text/plain")
19
+ } else {
20
+ // Handle key press
21
+ var key = theEvent.keyCode || theEvent.which
22
+ key = String.fromCharCode(key)
23
+ }
24
+ var regex = /[0-9]|\./
25
+ if (!regex.test(key)) {
26
+ theEvent.returnValue = false
27
+ if (theEvent.preventDefault) theEvent.preventDefault()
28
+ }
29
+ }
30
+ return (
31
+ <div className="flex flex-row gap-2">
32
+ <SinglePinInput
33
+ onInput={
34
+ (v) =>
35
+ v.target.value.replace(/[^0-9.]/g, "").replace(/(\..*?)\..*/g, "$1")
36
+ // .replace(/[^0-9.]/g, "")
37
+ // .replace(/(..*?)..*/g, "$1")
38
+ // .replace(/^0[^.]/, "0")
39
+ }
40
+ />
41
+ <SinglePinInput />
42
+ <SinglePinInput />
43
+ <SinglePinInput />
44
+ </div>
45
+ )
46
+ }
47
+
48
+ const SinglePinInput = (props) => (
49
+ <input
50
+ type="text"
51
+ maxLength={1}
52
+ className="h-10 w-10 bg-gray-200 text-center"
53
+ {...props}
54
+ />
55
+ )
@@ -5,5 +5,5 @@ type SearchBarTypes = {}
5
5
  export const HawaSearchBar: React.FunctionComponent<SearchBarTypes> = (
6
6
  props
7
7
  ) => {
8
- return <HawaTextField {...props} />
8
+ return <HawaTextField type={"search"} {...props} />
9
9
  }
@@ -0,0 +1,25 @@
1
+ import React from "react"
2
+ import clsx from "clsx"
3
+
4
+ type StatTypes = {
5
+ label?: string
6
+ number?: string
7
+ helperText?: string
8
+ variant?: "plain" | "contained" | "outlined"
9
+ }
10
+ export const HawaStats: React.FunctionComponent<StatTypes> = (props) => {
11
+ let defaultStyle = "flex flex-col gap-1 rounded-lg p-4 text-sm"
12
+ let statStyles = {
13
+ plain: "",
14
+ contained: "bg-primary-200 w-fit",
15
+ // outlined: "border-2 border-primary-200 w-fit",
16
+ outlined: "ring-2 w-fit",
17
+ }
18
+ return (
19
+ <div className={clsx(defaultStyle, statStyles[props.variant])}>
20
+ <div>{props.label}</div>
21
+ <div className="text-2xl font-bold">{props.number}</div>
22
+ <div className="text-xs">{props.helperText}</div>
23
+ </div>
24
+ )
25
+ }
@@ -1,6 +1,7 @@
1
1
  import React from "react"
2
2
  import clsx from "clsx"
3
3
 
4
+ import { FaSearch } from "react-icons/fa"
4
5
  type TextFieldTypes = {
5
6
  margin?: "none" | "normal" | "large"
6
7
  width?: "small" | "normal" | "full"
@@ -53,11 +54,23 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
53
54
  className="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
54
55
  placeholder="Your message..."
55
56
  />
57
+ ) : props.type === "search" ? (
58
+ <div className="relative">
59
+ <div className="absolute top-1/2 left-3 -translate-y-1/2">
60
+ <FaSearch color="gray" />
61
+ </div>
62
+ <input
63
+ {...props}
64
+ className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 pl-10 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
65
+ />
66
+ </div>
56
67
  ) : (
57
- <input
58
- {...props}
59
- className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
60
- />
68
+ <div>
69
+ <input
70
+ {...props}
71
+ className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
72
+ />
73
+ </div>
61
74
  )}
62
75
 
63
76
  {props.helperText && (
@@ -24,9 +24,11 @@ export * from "./HawaDrawer"
24
24
  export * from "./HawaCopyrights"
25
25
  export * from "./HawaTimeline"
26
26
  export * from "./Breadcrumb"
27
+ export * from "./HawaStats"
27
28
  // Inputs
28
29
  export * from "./HawaTextField"
29
30
  export * from "./HawaCardInput"
31
+ export * from "./HawaPinInput"
30
32
  // Cards
31
33
  export * from "./HawaItemCard"
32
34
  export * from "./HawaPricingCard"
@@ -0,0 +1,60 @@
1
+ import clsx from "clsx"
2
+ import React, { useState } from "react"
3
+ import { FaAddressCard } from "react-icons/fa"
4
+ type HawaAppLayoutTypes = {
5
+ logoLink: string
6
+ username: string
7
+ userEmail: string
8
+ drawerItems: any
9
+ }
10
+ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
11
+ props: any
12
+ ) => {
13
+ const [openSideMenu, setOpenSideMenu] = useState(false)
14
+
15
+ return (
16
+ <div className="fixed top-0 left-0 m-0 w-full p-0">
17
+ {/* navbar */}
18
+ <div className="m-0 flex flex-row justify-between bg-red-300 p-2">
19
+ <div>logo</div>
20
+ <div>page title</div>
21
+ <div className="relative mr-2 h-10 w-10 overflow-hidden rounded-full bg-gray-100 dark:bg-gray-600">
22
+ <AvatarIcon />
23
+ </div>
24
+ </div>
25
+
26
+ {/* side menu */}
27
+ <div
28
+ onMouseEnter={() => setOpenSideMenu(true)}
29
+ onMouseLeave={() => setOpenSideMenu(false)}
30
+ className="fixed top-0 flex h-full w-10 flex-col gap-2 bg-blue-300 transition-all hover:w-60"
31
+ >
32
+ {props.drawerItems.map((dItem) => (
33
+ <div className="flex flex-row items-start justify-start bg-yellow-300 p-2">
34
+ {dItem.icon}
35
+ <div className={clsx(openSideMenu ? "visible" : "invisible")}>
36
+ {dItem.text}
37
+ </div>
38
+ </div>
39
+ ))}
40
+ </div>
41
+ {/* page content */}
42
+ {props.children}
43
+ </div>
44
+ )
45
+ }
46
+
47
+ const AvatarIcon = () => (
48
+ <svg
49
+ className="absolute -left-1 h-12 w-12 text-gray-400"
50
+ fill="currentColor"
51
+ viewBox="0 0 20 20"
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ >
54
+ <path
55
+ fill-rule="evenodd"
56
+ d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
57
+ clip-rule="evenodd"
58
+ ></path>
59
+ </svg>
60
+ )