@sikka/hawa 0.0.144 → 0.0.146

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 (42) hide show
  1. package/dist/styles.css +86 -58
  2. package/es/blocks/Misc/EmptyState.d.ts +3 -1
  3. package/es/blocks/Misc/NotFound.d.ts +3 -1
  4. package/es/index.es.js +1 -1
  5. package/es/layout/HawaAppLayout.d.ts +1 -1
  6. package/es/layout/HawaContainer.d.ts +1 -1
  7. package/es/util.d.ts +8 -4
  8. package/lib/blocks/Misc/EmptyState.d.ts +3 -1
  9. package/lib/blocks/Misc/NotFound.d.ts +3 -1
  10. package/lib/index.js +1 -1
  11. package/lib/layout/HawaAppLayout.d.ts +1 -1
  12. package/lib/layout/HawaContainer.d.ts +1 -1
  13. package/lib/util.d.ts +8 -4
  14. package/package.json +3 -2
  15. package/src/blocks/Misc/EmptyState.tsx +13 -11
  16. package/src/blocks/Misc/NotFound.tsx +11 -16
  17. package/src/blocks/Payment/SelectPayment.tsx +0 -1
  18. package/src/elements/DraggableCard.tsx +1 -1
  19. package/src/elements/HawaButton.tsx +6 -5
  20. package/src/elements/HawaLogoButton.tsx +1 -1
  21. package/src/elements/HawaMenu.tsx +5 -2
  22. package/src/elements/HawaPanelTabs.tsx +2 -2
  23. package/src/elements/HawaPricingCard.tsx +2 -2
  24. package/src/elements/HawaRadio.tsx +2 -2
  25. package/src/elements/HawaTabs.tsx +2 -2
  26. package/src/layout/HawaAppLayout.tsx +148 -89
  27. package/src/layout/HawaContainer.tsx +6 -4
  28. package/src/layout/HawaSiteLayout.tsx +4 -4
  29. package/src/styles.css +86 -58
  30. package/src/tailwind.css +4 -0
  31. package/src/util.ts +142 -29
  32. package/storybook-static/{767.232e4e4c88bb0a2ed02d.manager.bundle.js → 767.8e4ffb17eae12c283b3b.manager.bundle.js} +2 -2
  33. package/storybook-static/{767.232e4e4c88bb0a2ed02d.manager.bundle.js.LICENSE.txt → 767.8e4ffb17eae12c283b3b.manager.bundle.js.LICENSE.txt} +0 -0
  34. package/storybook-static/870.c002064e.iframe.bundle.js +2 -0
  35. package/storybook-static/{870.32eb3abe.iframe.bundle.js.LICENSE.txt → 870.c002064e.iframe.bundle.js.LICENSE.txt} +0 -0
  36. package/storybook-static/iframe.html +1 -1
  37. package/storybook-static/index.html +1 -1
  38. package/storybook-static/main.8977634c.iframe.bundle.js +1 -0
  39. package/storybook-static/project.json +1 -1
  40. package/tailwind.config.js +63 -0
  41. package/storybook-static/870.32eb3abe.iframe.bundle.js +0 -2
  42. package/storybook-static/main.f25e7d6a.iframe.bundle.js +0 -1
@@ -5,7 +5,7 @@ type HawaAppLayoutTypes = {
5
5
  icon: any;
6
6
  slug: string;
7
7
  action: () => void;
8
- }[];
8
+ }[][];
9
9
  currentPage: string;
10
10
  pageTitle?: string;
11
11
  logoSymbol?: any;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  type ContainerTypes = {
3
3
  maxWidth?: "full" | "small" | "normal";
4
4
  children: React.ReactNode;
5
- variant?: "contained" | "outlined";
5
+ variant?: "contained" | "outlined" | "neobrutalism";
6
6
  centered?: boolean;
7
7
  };
8
8
  export declare const HawaContainer: React.FunctionComponent<ContainerTypes>;
package/lib/util.d.ts CHANGED
@@ -1,4 +1,8 @@
1
- declare const hexToRgb: (hex: any) => number[];
2
- declare const getTextColor: (backColor: any) => "#000000" | "#ffffff";
3
- declare const replaceAt: (string: any, index: any, replacement: any) => any;
4
- export { hexToRgb, getTextColor, replaceAt };
1
+ type Palette = {
2
+ name: string;
3
+ colors: {
4
+ [key: number]: string;
5
+ };
6
+ };
7
+ declare function getPallette(baseColor: string): Palette;
8
+ export { getPallette };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.144",
3
+ "version": "0.0.146",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -37,6 +37,7 @@
37
37
  "@types/react-dom": "^18.0.9",
38
38
  "babel-loader": "^8.2.2",
39
39
  "clsx": "^1.2.1",
40
+ "color": "^4.2.3",
40
41
  "crypto-js": "^4.1.1",
41
42
  "framer-motion": "^4.1.7",
42
43
  "html-webpack-plugin": "^5.5.0",
@@ -60,8 +61,8 @@
60
61
  "rollup-plugin-cleaner": "^1.0.0",
61
62
  "rollup-plugin-peer-deps-external": "^2.2.4",
62
63
  "rollup-plugin-postcss": "^4.0.0",
63
- "rollup-plugin-terser": "^7.0.2",
64
64
  "rollup-plugin-swc": "^0.2.1",
65
+ "rollup-plugin-terser": "^7.0.2",
65
66
  "tailwindcss": "^3.2.1",
66
67
  "tinycolor2": "^1.4.2",
67
68
  "tslib": "^2.4.1",
@@ -2,19 +2,21 @@ import React from "react"
2
2
  import { HawaButton } from "../../elements"
3
3
  import { HawaContainer } from "../../layout"
4
4
  import { FaCheck } from "react-icons/fa"
5
- type TEmptyState = {}
5
+ type TEmptyState = {
6
+ variant?: "outlined" | "contained" | "neobrutalism"
7
+ }
6
8
 
7
- export const EmptyState: React.FunctionComponent<TEmptyState> = (props) => {
9
+ export const EmptyState: React.FunctionComponent<TEmptyState> = ({
10
+ variant = "contained",
11
+ }) => {
8
12
  return (
9
- <HawaContainer variant="outlined" centered={true}>
10
- <div className="flex h-20 w-20 flex-col items-center justify-center rounded-3xl bg-primary-400 text-6xl font-bold">
11
- <FaCheck size={30} />
12
- </div>
13
- <div className="m-2 text-center text-xl font-bold">
14
- You're all caught up
15
- </div>
16
- <div className="text-center">
17
- If you're lost please contact us help@sikka.io{" "}
13
+ <HawaContainer variant={variant} centered={true}>
14
+ <div className="flex flex-col items-center justify-center text-center dark:text-white">
15
+ <div className="flex h-10 w-10 flex-col items-center justify-center rounded-3xl bg-primary-400 text-6xl font-bold">
16
+ <FaCheck size={20} />
17
+ </div>
18
+ <div className="m-2 text-xl font-bold">You're all caught up</div>
19
+ <div>If you're lost, please contact us help@sikka.io </div>
18
20
  </div>
19
21
  <HawaButton color="primary" width="full">
20
22
  Action
@@ -2,29 +2,24 @@ import React from "react"
2
2
  import { HawaButton } from "../../elements"
3
3
  import { HawaContainer } from "../../layout"
4
4
 
5
- type NotFoundTypes = {}
5
+ type NotFoundTypes = {
6
+ variant?: "outlined" | "contained" | "neobrutalism"
7
+ }
6
8
 
7
- export const NotFound: React.FunctionComponent<NotFoundTypes> = (props) => {
9
+ export const NotFound: React.FunctionComponent<NotFoundTypes> = ({
10
+ variant,
11
+ }) => {
8
12
  return (
9
- <HawaContainer variant="outlined">
10
- <div
11
- // style={{
12
- // display: "flex",
13
- // flexDirection: "column",
14
- // alignItems: "center",
15
- // }}
16
- className="flex flex-col items-center"
17
- >
18
- <div className="text-center text-6xl font-bold">404</div>
19
- <div className="m-2 text-center text-xl font-bold">Page Not Found</div>
20
- <div className="text-center">
13
+ <HawaContainer variant={variant}>
14
+ <div className="flex flex-col items-center dark:text-white">
15
+ <div className="text-center text-6xl font-bold ">404</div>
16
+ <div className="m-2 text-center text-xl font-bold ">Page Not Found</div>
17
+ <div className="text-center ">
21
18
  If you're lost please contact us help@sikka.io{" "}
22
19
  </div>
23
- {/* <div className="flex flex-col content-center items-stretch bg-red-200"> */}
24
20
  <HawaButton color="primary" width="full">
25
21
  Home
26
22
  </HawaButton>
27
- {/* </div> */}
28
23
  </div>
29
24
  </HawaContainer>
30
25
  )
@@ -31,7 +31,6 @@ export const SelectPayment: React.FunctionComponent<SelectPaymentTypes> = (
31
31
  ) => {
32
32
  return (
33
33
  <HawaContainer>
34
- {/* // <div className="flex flex-col w-1/3 bg-blue-300 rounded-xl p-4"> */}
35
34
  <HawaTypography>Choose Payment Method</HawaTypography>
36
35
  {props.viaWallet && (
37
36
  <HawaLogoButton
@@ -7,7 +7,7 @@ export const DraggableCard: React.FunctionComponent<DraggableCardTypes> = (
7
7
  props
8
8
  ) => {
9
9
  return (
10
- <div className="flex flex-row rounded-xl bg-blue-300 p-4">
10
+ <div className="bg-layoutPrimary-default flex flex-row rounded-xl p-4">
11
11
  <button
12
12
  className="inline-flex items-center rounded-lg bg-white p-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-50 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-600"
13
13
  type="button"
@@ -24,7 +24,7 @@ const sizeStyles = {
24
24
  const widthStyles = {
25
25
  full: "w-full flex justify-center px-5 py-2.5 text-center inline-flex items-center",
26
26
  normal:
27
- "w-fit dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",
27
+ "w-fit dark:bg-buttonPrimary-dark dark:hover:bg-buttonPrimary-dark dark:hover:brightness-90 dark:focus:ring-primary-800",
28
28
  half: "w-1/2",
29
29
  }
30
30
  const variantStyles = {
@@ -34,11 +34,11 @@ const variantStyles = {
34
34
 
35
35
  const colorStyles = {
36
36
  contained: {
37
- default: "text-neutral-900 bg-gray-200 hover:bg-gray-300",
37
+ default: "text-neutral-900 hover:bg-gray-300 bg-buttonPrimary-default text-white",
38
38
  primary:
39
- "text-white bg-primary-default hover:bg-primary-700 hover:text-white",
39
+ "text-white bg-buttonPrimary-default hover:bg-buttonPrimary-darker transition-all",
40
40
  secondary:
41
- "text-neutral-900 bg-secondary-default hover:text-white hover:bg-secondary-700",
41
+ "text-neutral-900 bg-buttonPrimary-default hover:text-white hover:bg-secondary-700",
42
42
  },
43
43
  outlined: {
44
44
  default: "text-gray-600 border-gray-600 hover:bg-gray-200",
@@ -67,7 +67,6 @@ export function HawaButton({
67
67
  ...props
68
68
  }: ButtonProps) {
69
69
  const [isHovered, setIsHovered] = React.useState(false)
70
-
71
70
  return (
72
71
  <div
73
72
  className={clsx(
@@ -75,6 +74,7 @@ export function HawaButton({
75
74
  margins !== "none" ? `my-${margins}` : "my-0"
76
75
  )}
77
76
  >
77
+ {/* <div className="bg-buttonPrimary-default h-32">test</div> */}
78
78
  <button
79
79
  onMouseEnter={() => {
80
80
  setIsHovered(true)
@@ -85,6 +85,7 @@ export function HawaButton({
85
85
  className={
86
86
  disabled
87
87
  ? clsx(
88
+ // "brightne",
88
89
  className,
89
90
  baseStyles,
90
91
  variantStyles[variant],
@@ -150,7 +150,7 @@ export const HawaLogoButton: React.FunctionComponent<LogoButtonTypes> = (
150
150
  <button
151
151
  style={{ direction: isArabic ? "rtl" : "ltr" }}
152
152
  onClick={props.onClick}
153
- className="my-2 flex h-11 w-full flex-row justify-center rounded-xl bg-white align-middle"
153
+ className="my-2 flex h-11 w-full flex-row justify-center rounded-xl bg-white hover:ring-1 hover:ring-buttonPrimary-default hover:brightness-90 align-middle"
154
154
  >
155
155
  <div className="flex h-full flex-row items-center justify-end">
156
156
  {logoElement}
@@ -89,9 +89,12 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
89
89
  <div className="truncate font-medium">{headerSubtitle}</div>
90
90
  </div>
91
91
  )}
92
- {menuItems.map((group) => {
92
+ {menuItems.map((group, o) => {
93
93
  return (
94
- <ul className="py-1 text-sm text-gray-700 dark:text-gray-200">
94
+ <ul
95
+ key={o}
96
+ className="py-1 bg-layout-1200 text-sm text-gray-700 dark:text-gray-200"
97
+ >
95
98
  {group?.map((item) => {
96
99
  return (
97
100
  <li
@@ -26,9 +26,9 @@ export const HawaPanelTabs: React.FunctionComponent<PanelTabsTypes> = (
26
26
  data-tabs-toggle="#myTabContent"
27
27
  role="tablist"
28
28
  >
29
- {props.options.map((option: any) => {
29
+ {props.options.map((option: any, o) => {
30
30
  return (
31
- <li className="mr-2" role="presentation">
31
+ <li key={o} className="mr-2" role="presentation">
32
32
  <button
33
33
  className="inline-block rounded-t-lg border-b-2 border-blue-600 p-4 text-blue-600 hover:text-blue-600 dark:border-blue-500 dark:text-blue-500 dark:hover:text-blue-500"
34
34
  id={`${option.value}-tab`}
@@ -95,9 +95,9 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = (
95
95
  </span>
96
96
  </div>
97
97
  <ul role="list" className="my-7 space-y-0">
98
- {featuresMapping?.map((feature) => {
98
+ {featuresMapping?.map((feature, o) => {
99
99
  return (
100
- <li className="flex ">
100
+ <li key={o} className="flex ">
101
101
  <svg
102
102
  aria-hidden="true"
103
103
  className="m-2 h-5 w-5 flex-shrink-0 text-blue-600 dark:text-blue-500"
@@ -28,8 +28,8 @@ export const HawaRadio: React.FunctionComponent<RadioTypes> = (props) => {
28
28
  "flex max-w-fit flex-row whitespace-nowrap rounded-lg bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400"
29
29
  )}
30
30
  >
31
- {props.options?.map((opt: any) => (
32
- <li className="w-full">
31
+ {props.options?.map((opt: any, o) => (
32
+ <li className="w-full" key={o}>
33
33
  <button
34
34
  aria-current="page"
35
35
  onClick={() => {
@@ -21,8 +21,8 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = (props) => {
21
21
  selectedOption ? "border-b-2" : "border-b-0"
22
22
  )}
23
23
  >
24
- {props.options?.map((opt: any) => (
25
- <li>
24
+ {props.options?.map((opt: any, o) => (
25
+ <li key={o}>
26
26
  <button
27
27
  aria-current="page"
28
28
  onClick={() => {
@@ -4,8 +4,14 @@ import useDiscloser from "../hooks/useDiscloser"
4
4
  import { HawaMenu } from "../elements"
5
5
  import { HiMenu } from "react-icons/hi"
6
6
  import useBreakpoint from "../hooks/useBreakpoint"
7
+ import { FaChevronRight } from "react-icons/fa"
7
8
  type HawaAppLayoutTypes = {
8
- drawerItems: { label: string; icon: any; slug: string; action: () => void }[]
9
+ drawerItems: {
10
+ label: string
11
+ icon: any
12
+ slug: string
13
+ action: () => void
14
+ }[][]
9
15
  currentPage: string
10
16
  pageTitle?: string
11
17
  logoSymbol?: any
@@ -28,6 +34,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
28
34
  props: any
29
35
  ) => {
30
36
  const [openSideMenu, setOpenSideMenu] = useState(false)
37
+ const [openSubItem, setOpenSubItem] = useState(false)
31
38
  const { isOpen, onClose, onOpen } = useDiscloser(false)
32
39
  const ref = useRef(null)
33
40
 
@@ -37,10 +44,11 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
37
44
  } else {
38
45
  size = 1200
39
46
  }
47
+ const [keepOpen, setKeepOpen] = useState(size > 600 ? true : false)
40
48
  console.log("size is ", size)
41
49
  useEffect(() => {
42
50
  const handleClickOutside = (event) => {
43
- if (ref.current && !ref.current.contains(event.target)) {
51
+ if (ref.current && !ref.current.contains(event.target) && !keepOpen) {
44
52
  // onClickOutside && onClickOutside()
45
53
  setOpenSideMenu(false)
46
54
  }
@@ -49,28 +57,49 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
49
57
  return () => {
50
58
  document.removeEventListener("click", handleClickOutside, true)
51
59
  }
52
- }, [])
60
+ }, [keepOpen])
53
61
 
62
+ //States of the side menu
63
+ //larger than 600
64
+ //as a bar and expands when hover
65
+ //less than 600
66
+ //as nothing and expands as button is clicked
54
67
  return (
55
- <>
68
+ <div className="fixed left-0 h-full bg-green-400">
56
69
  {props.topBar && (
57
70
  <div
58
71
  className={clsx(
59
- "fixed top-0 z-40 flex h-14 flex-row items-center justify-between bg-primary-400",
60
- size > 600 ? "w-[calc(100%-3rem)] translate-x-[3rem]" : "w-full",
61
- "p-2",
62
- "pr-5"
72
+ "fixed top-0 z-40 flex h-14 flex-row items-center justify-between bg-layoutPrimary-default",
73
+ // size > 600 ? "w-[calc(100%-3rem)] translate-x-[3rem]" : "w-full",
74
+ "w-full",
75
+ "p-2"
76
+ // "pr-5"
63
77
  )}
64
78
  >
65
- {size > 600 ? null : (
66
- <div
67
- onClick={() => setOpenSideMenu(true)}
68
- className=" cursor-pointer rounded-lg p-2 transition-all hover:bg-gray-100"
69
- >
70
- <HiMenu size={30} />
79
+ {size > 600 ? (
80
+ props.pageTitle ? (
81
+ <div
82
+ className={clsx(
83
+ size > 600 ? "ml-14" : "ml-2",
84
+ "bg-red-300",
85
+ keepOpen ? "ml-40" : ""
86
+ )}
87
+ >
88
+ {props.pageTitle}
89
+ </div>
90
+ ) : null
91
+ ) : (
92
+ <div className="flex items-center justify-center">
93
+ <div
94
+ onClick={() => setOpenSideMenu(true)}
95
+ className=" cursor-pointer rounded-lg p-2 transition-all hover:bg-gray-100"
96
+ >
97
+ <HiMenu size={25} />
98
+ </div>
99
+ {props.pageTitle ? <div>{props.pageTitle}</div> : <div></div>}
71
100
  </div>
72
101
  )}
73
- {props.pageTitle ? <div>{props.pageTitle}</div> : <div></div>}
102
+
74
103
  <HawaMenu
75
104
  buttonPosition="top-right"
76
105
  menuItems={props.profileMenuItems}
@@ -97,95 +126,125 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
97
126
  )}
98
127
  <div
99
128
  onMouseEnter={() => setOpenSideMenu(true)}
100
- onMouseLeave={() => setOpenSideMenu(false)}
129
+ onMouseLeave={() =>
130
+ keepOpen ? setOpenSideMenu(true) : setOpenSideMenu(false)
131
+ }
101
132
  ref={ref}
102
133
  className={clsx(
103
- "fixed top-0 left-0 z-50 flex h-full flex-col bg-primary-400 transition-all hover:w-40 hover:overflow-auto",
104
- size > 600 ? "w-12" : "w-0",
105
- openSideMenu ? "w-40" : ""
134
+ "fixed top-0 left-0 z-50 flex h-full flex-col justify-between overflow-x-clip bg-layoutPrimary-default transition-all hover:overflow-auto",
135
+ size > 600 ? "w-14 hover:w-40" : "w-0",
136
+ openSideMenu ? "w-40" : "w-14"
106
137
  )}
107
138
  >
108
- <div className=" mb-9 h-12 w-12 p-2">
109
- <img
110
- className={clsx(
111
- "fixed top-2 h-9",
112
- !openSideMenu ? "invisible" : "visible"
113
- )}
114
- height={10}
115
- src={props.logoLink}
116
- // src={"https://beta-my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"}
117
- />
118
-
119
- <img
120
- className={clsx(
121
- // " bg-green-500",
122
- "fixed top-2 h-9",
123
- openSideMenu ? "invisible" : "visible"
124
- )}
125
- src={props.logoSymbol}
126
- // src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
127
- />
128
-
129
- {/* {openSideMenu ? (
139
+ <div>
140
+ <div className="mb-9 h-12 w-12 p-2">
130
141
  <img
131
- className={clsx("h-10", !openSideMenu ? "invisible" : "visible")}
132
- src="https://beta-my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"
142
+ className={clsx(
143
+ "fixed top-2 h-9",
144
+ !openSideMenu ? "invisible" : "visible"
145
+ )}
146
+ height={10}
147
+ src={props.logoLink}
148
+ // src={"https://beta-my.qawaim.app/_next/image?url=%2Fqawaim-logo.svg&w=256&q=75"}
133
149
  />
134
- ) : (
135
- <img
136
- className={clsx("h-10", openSideMenu ? "invisible" : "visible")}
137
- src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
138
- />
139
- )} */}
140
- </div>
141
150
 
142
- {props.drawerItems.map((dSection, j) => (
143
- <div className="flex flex-col items-stretch justify-center">
144
- {dSection.map((dItem, i) => {
145
- return (
146
- <div
147
- key={i}
148
- onClick={() => dItem.action(dItem.slug)}
149
- className={clsx(
150
- "m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all hover:bg-primary-500",
151
- props.currentPage === dItem.slug
152
- ? "bg-primary-600 text-white hover:bg-primary-600"
153
- : ""
154
- )}
155
- >
156
- <div className="flex items-center justify-center">
157
- {dItem.icon}
158
- </div>
159
- <div
160
- className={clsx(
161
- "mx-2 whitespace-nowrap text-sm transition-all",
162
- openSideMenu ? "opacity-100" : "opacity-0"
163
- )}
164
- >
165
- {dItem.label}
166
- </div>
167
- </div>
168
- )
169
- })}
170
- {j !== props.drawerItems.length - 1 && (
171
- <div className="my-2 h-[1px] w-10/12 self-center bg-primary-600 text-center "></div>
172
- )}{" "}
151
+ {size > 600 ? (
152
+ <img
153
+ className={clsx(
154
+ // " bg-green-500",
155
+ "fixed top-2 h-9",
156
+ openSideMenu ? "invisible" : "visible"
157
+ )}
158
+ src={props.logoSymbol}
159
+ // src="https://beta-admin.qawaim.app/_next/image?url=%2Fqawaim-symbol.svg&w=128&q=75"
160
+ />
161
+ ) : null}
173
162
  </div>
174
- ))}
163
+
164
+ {props.drawerItems.map((dSection, j) => (
165
+ <div
166
+ key={j}
167
+ className={clsx(
168
+ "flex flex-col items-stretch justify-center"
169
+ // !openSideMenu ? "invisible" : "visible"
170
+ )}
171
+ >
172
+ {dSection.map((dItem, i) => {
173
+ return (
174
+ <div className="flex flex-col">
175
+ <div
176
+ key={i}
177
+ onClick={() => {
178
+ // if()
179
+ dItem.action(dItem.slug)
180
+ }}
181
+ className={clsx(
182
+ props.currentPage === dItem.slug
183
+ ? "bg-buttonPrimary-default text-white"
184
+ : "hover:bg-buttonPrimary-lighter",
185
+ // !openSideMenu ? " h-0 w-0" : ""
186
+ "m-2 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all "
187
+ )}
188
+ >
189
+ <div className="flex items-center justify-center">
190
+ {dItem.icon}
191
+ </div>
192
+ <div
193
+ className={clsx(
194
+ "mx-2 whitespace-nowrap text-sm transition-all",
195
+ openSideMenu ? "opacity-100" : "opacity-0"
196
+ )}
197
+ >
198
+ {dItem.label}
199
+ </div>
200
+ </div>
201
+ {dItem.subItems && (openSideMenu || isOpen) ? (
202
+ <div className="flex flex-col gap-2">
203
+ {dItem.subItems.map((subIt) => (
204
+ <div className="bg-red-100 p-2 px-4">subItems</div>
205
+ ))}
206
+ </div>
207
+ ) : null}
208
+ </div>
209
+ )
210
+ })}
211
+ {j !== props.drawerItems.length - 1 && (
212
+ <div className="my-2 h-[1px] w-10/12 self-center bg-buttonPrimary-default text-center "></div>
213
+ )}{" "}
214
+ </div>
215
+ ))}
216
+ </div>
217
+ <div className={clsx("flex items-center justify-end")}>
218
+ {openSideMenu && !keepOpen ? (
219
+ <div
220
+ onClick={() => setKeepOpen(true)}
221
+ className="m-2 w-fit cursor-pointer rounded-lg bg-gray-300 p-2"
222
+ >
223
+ <FaChevronRight />
224
+ </div>
225
+ ) : null}
226
+ {keepOpen && (
227
+ <div
228
+ onClick={() => setKeepOpen(false)}
229
+ className="m-2 w-fit rotate-180 cursor-pointer rounded-lg bg-gray-300 p-2"
230
+ >
231
+ <FaChevronRight />
232
+ </div>
233
+ )}
234
+ </div>
175
235
  </div>
236
+
176
237
  <div
177
238
  className={clsx(
178
- // "overflow-scroll",
179
- "w-[calc(100%-3rem)]",
180
- "translate-x-[3rem]",
181
- // "bg-red-900 text-white",
182
- "m-0",
183
- props.topBar ? "mt-14" : ""
239
+ size > 600 ? "w-[calc(100%-3rem)] translate-x-[3.54rem]" : "",
240
+ props.topBar ? "mt-[3.6rem]" : "mt-0 ",
241
+ " fixed top-0 h-full overflow-auto p-4",
242
+ keepOpen ? "w-[calc(100%-10rem)] translate-x-[10.54rem]" : ""
184
243
  )}
185
244
  >
186
245
  {props.children}
187
246
  </div>
188
247
  {/* <div className="top-0 w-[calc(100%-1rem)] -translate-y-[1rem] translate-x-8 overflow-scroll bg-yellow-300 "> */}
189
- </>
248
+ </div>
190
249
  )
191
250
  }
@@ -4,7 +4,7 @@ import clsx from "clsx"
4
4
  type ContainerTypes = {
5
5
  maxWidth?: "full" | "small" | "normal"
6
6
  children: React.ReactNode
7
- variant?: "contained" | "outlined"
7
+ variant?: "contained" | "outlined" | "neobrutalism"
8
8
  centered?: boolean
9
9
  }
10
10
  export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
@@ -13,21 +13,23 @@ export const HawaContainer: React.FunctionComponent<ContainerTypes> = ({
13
13
  centered = false,
14
14
  ...props
15
15
  }) => {
16
- let defaultStyle = "flex w-full flex-col rounded-xl p-4 dark:bg-gray-600"
16
+ let defaultStyle = "flex w-full flex-col rounded-xl p-4"
17
17
  let maxWidthStyles: any = {
18
18
  full: "md:max-w-xl",
19
19
  small: "md:max-w-sm w-1/3 min-w-min",
20
20
  normal: "max-w-sm md:max-w-md",
21
21
  }
22
22
  let variantStyles = {
23
- contained: "bg-primary-300",
24
- outlined: "bg-transparent border-2 border-primary-200 w-fit",
23
+ contained: "bg-layoutPrimary-default dark:bg-layoutPrimary-dark",
24
+ outlined: "bg-transparent border-2 border-black w-fit",
25
+ neobrutalism: "shadow-neobrutalism border-4 border-black bg-white",
25
26
  }
26
27
 
27
28
  return (
28
29
  <div
29
30
  className={clsx(
30
31
  defaultStyle,
32
+ // "shadow-3xl",
31
33
  maxWidthStyles[maxWidth],
32
34
  variantStyles[variant],
33
35
  centered ? "flex items-center text-center" : ""
@@ -46,8 +46,8 @@ const ProfileDropdown = (props: any) => {
46
46
  className="py-1 text-sm text-gray-700 dark:text-gray-200"
47
47
  aria-labelledby="avatarButton"
48
48
  >
49
- {props.profileItems.map((it: any) => {
50
- return <ProfileItem text={it.text} link={it.slug} />
49
+ {props.profileItems.map((it: any, o) => {
50
+ return <ProfileItem key={o} text={it.text} link={it.slug} />
51
51
  })}
52
52
  </ul>
53
53
  <div className="py-1">
@@ -85,7 +85,7 @@ const DrawerContent = (props: any) => {
85
85
  <div className="overflow-y-auto py-4">
86
86
  <ul className="space-y-2">
87
87
  {props.drawerItems.map((item: any, i: any) => {
88
- return <div>{item.text}</div>
88
+ return <div key={i}>{item.text}</div>
89
89
  })}
90
90
  </ul>
91
91
  </div>
@@ -236,7 +236,7 @@ export const HawaSiteLayout: React.FunctionComponent<LayoutTypes> = (
236
236
  <div className="overflow-y-auto py-4">
237
237
  <ul className="space-y-2">
238
238
  {props.drawerItems.map((item: any, i: any) => {
239
- return <div>{item.text}</div>
239
+ return <div key={i}>{item.text}</div>
240
240
  })}
241
241
  </ul>
242
242
  </div>