@sikka/hawa 0.0.117 → 0.0.119

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.
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ interface Props {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ items: {
6
+ label: string;
7
+ onClick: () => void;
8
+ }[];
9
+ }
10
+ export declare const AppSidebar: React.FC<Props>;
11
+ export {};
@@ -1,9 +1,13 @@
1
1
  import React from "react";
2
2
  type HawaAppLayoutTypes = {
3
3
  logoLink: string;
4
- username: string;
5
- userEmail: string;
6
- drawerItems: any;
4
+ drawerItems: {
5
+ label: string;
6
+ icon: any;
7
+ slug: string;
8
+ action: () => void;
9
+ }[];
10
+ currentPage?: string;
7
11
  };
8
12
  export declare const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes>;
9
13
  export {};
@@ -4,3 +4,4 @@ export * from "./HawaSiteLayout";
4
4
  export * from "./HawaAppLayout";
5
5
  export * from "./HawaContainer";
6
6
  export * from "./SimpleGrid";
7
+ export * from "./AppSidebar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.117",
3
+ "version": "0.0.119",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -1,5 +1,6 @@
1
1
  import * as React from "react"
2
2
  import clsx from "clsx"
3
+ import { HawaSpinner } from "./HawaSpinner"
3
4
 
4
5
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
6
  variant?: "contained" | "outlined"
@@ -108,9 +109,10 @@ export function HawaButton({
108
109
  {!isLoading ? (
109
110
  children
110
111
  ) : (
111
- <div className="flex flex-row gap-x-3">
112
- <div className="h-5 w-5 animate-spin rounded-full border-2 border-gray-400 border-t-white text-white"></div>
113
- </div>
112
+ // <div className="flex flex-row gap-x-3">
113
+ // <div className="h-5 w-5 animate-spin rounded-full border-2 border-gray-400 border-t-white text-white"></div>
114
+ // </div>
115
+ <HawaSpinner />
114
116
  )}
115
117
  </button>
116
118
  {tooltip && (
@@ -0,0 +1,10 @@
1
+ import React from "react"
2
+
3
+ type SpinnerTypes = {}
4
+ export const HawaSpinner: React.FunctionComponent<SpinnerTypes> = (props) => {
5
+ return (
6
+ <div className="flex flex-row gap-x-3">
7
+ <div className="h-4 w-4 animate-spin rounded-full border-2 border-gray-400 border-t-white text-white"></div>
8
+ </div>
9
+ )
10
+ }
@@ -1,11 +1,14 @@
1
1
  import React from "react"
2
2
  import clsx from "clsx"
3
+ import { HawaSpinner } from "./HawaSpinner"
3
4
 
4
5
  type StatTypes = {
5
6
  label?: string
6
7
  number?: string
7
8
  helperText?: string
8
9
  variant?: "plain" | "contained" | "outlined"
10
+ isLoading?: boolean
11
+ handleClick?: () => void
9
12
  }
10
13
  export const HawaStats: React.FunctionComponent<StatTypes> = (props) => {
11
14
  let defaultStyle = "flex flex-col gap-1 rounded-lg p-4 text-sm"
@@ -16,9 +19,16 @@ export const HawaStats: React.FunctionComponent<StatTypes> = (props) => {
16
19
  outlined: "ring-2 w-fit",
17
20
  }
18
21
  return (
19
- <div className={clsx(defaultStyle, statStyles[props.variant])}>
22
+ <div
23
+ onClick={props.handleClick}
24
+ className={clsx(defaultStyle, statStyles[props.variant])}
25
+ >
20
26
  <div>{props.label}</div>
21
- <div className="text-2xl font-bold">{props.number}</div>
27
+ {props.isLoading ? (
28
+ <HawaSpinner />
29
+ ) : (
30
+ <div className="text-2xl font-bold">{props.number}</div>
31
+ )}{" "}
22
32
  <div className="text-xs">{props.helperText}</div>
23
33
  </div>
24
34
  )
@@ -25,6 +25,7 @@ export * from "./HawaCopyrights"
25
25
  export * from "./HawaTimeline"
26
26
  export * from "./Breadcrumb"
27
27
  export * from "./HawaStats"
28
+ export * from "./HawaSpinner"
28
29
  // Inputs
29
30
  export * from "./HawaTextField"
30
31
  export * from "./HawaCardInput"
@@ -0,0 +1,38 @@
1
+ import * as React from "react"
2
+
3
+ interface Props {
4
+ isOpen: boolean
5
+ onClose: () => void
6
+ items: { label: string; onClick: () => void }[]
7
+ }
8
+
9
+ export const AppSidebar: React.FC<Props> = ({ isOpen, onClose, items }) => {
10
+ if (!isOpen) {
11
+ return null
12
+ }
13
+
14
+ return (
15
+ <div className="fixed inset-0 z-40 flex bg-gray-600 bg-opacity-75">
16
+ <div className="w-1/3 rounded-l-lg bg-gray-800 shadow-2xl">
17
+ <button
18
+ onClick={onClose}
19
+ className="p-4 text-gray-400 hover:text-white focus:text-white focus:outline-none"
20
+ >
21
+ Close
22
+ </button>
23
+ <nav>
24
+ {items.map((item) => (
25
+ <a
26
+ href="#"
27
+ onClick={item.onClick}
28
+ className="block p-4 font-bold text-white hover:bg-gray-700 hover:text-gray-400"
29
+ >
30
+ {item.label}
31
+ </a>
32
+ ))}
33
+ </nav>
34
+ </div>
35
+ <div className="w-2/3 bg-gray-50"></div>
36
+ </div>
37
+ )
38
+ }
@@ -3,9 +3,8 @@ import React, { useState } from "react"
3
3
 
4
4
  type HawaAppLayoutTypes = {
5
5
  logoLink: string
6
- username: string
7
- userEmail: string
8
- drawerItems: any
6
+ drawerItems: { label: string; icon: any; slug: string; action: () => void }[]
7
+ currentPage?: string
9
8
  }
10
9
  export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
11
10
  props: any
@@ -21,7 +20,15 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
21
20
  >
22
21
  <div className="m-1 bg-red-300 p-2">logo</div>
23
22
  {props.drawerItems.map((dItem) => (
24
- <div className="pl-3 m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg bg-orange-400 p-2 transition-all hover:bg-green-300">
23
+ <div
24
+ onClick={() => dItem.action(dItem.slug)}
25
+ className={clsx(
26
+ "m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg p-2 pl-3 transition-all hover:bg-green-300",
27
+ props.currentPage === dItem.slug
28
+ ? "bg-primary-400"
29
+ : "bg-yellow-300"
30
+ )}
31
+ >
25
32
  <div className="flex items-center justify-center">{dItem.icon}</div>
26
33
  <div
27
34
  className={clsx(
@@ -29,7 +36,7 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
29
36
  openSideMenu ? "opacity-100" : "opacity-0"
30
37
  )}
31
38
  >
32
- {dItem.text}
39
+ {dItem.label}
33
40
  </div>
34
41
  </div>
35
42
  ))}
@@ -4,3 +4,4 @@ export * from "./HawaSiteLayout"
4
4
  export * from "./HawaAppLayout"
5
5
  export * from "./HawaContainer"
6
6
  export * from "./SimpleGrid"
7
+ export * from "./AppSidebar"
package/src/styles.css CHANGED
@@ -508,6 +508,12 @@ video {
508
508
  .relative {
509
509
  position: relative;
510
510
  }
511
+ .inset-0 {
512
+ top: 0px;
513
+ right: 0px;
514
+ bottom: 0px;
515
+ left: 0px;
516
+ }
511
517
  .left-0 {
512
518
  left: 0px;
513
519
  }
@@ -752,6 +758,9 @@ video {
752
758
  .h-2 {
753
759
  height: 0.5rem;
754
760
  }
761
+ .h-4 {
762
+ height: 1rem;
763
+ }
755
764
  .h-32 {
756
765
  height: 8rem;
757
766
  }
@@ -814,18 +823,24 @@ video {
814
823
  .w-10 {
815
824
  width: 2.5rem;
816
825
  }
826
+ .w-4 {
827
+ width: 1rem;
828
+ }
817
829
  .w-11 {
818
830
  width: 2.75rem;
819
831
  }
820
832
  .w-1 {
821
833
  width: 0.25rem;
822
834
  }
823
- .w-12 {
824
- width: 3rem;
825
- }
826
835
  .w-1\/3 {
827
836
  width: 33.333333%;
828
837
  }
838
+ .w-2\/3 {
839
+ width: 66.666667%;
840
+ }
841
+ .w-12 {
842
+ width: 3rem;
843
+ }
829
844
  .w-80 {
830
845
  width: 20rem;
831
846
  }
@@ -1306,9 +1321,13 @@ video {
1306
1321
  --tw-bg-opacity: 1;
1307
1322
  background-color: rgb(116 177 251 / var(--tw-bg-opacity));
1308
1323
  }
1309
- .bg-orange-400 {
1324
+ .bg-gray-600 {
1325
+ --tw-bg-opacity: 1;
1326
+ background-color: rgb(75 85 99 / var(--tw-bg-opacity));
1327
+ }
1328
+ .bg-gray-800 {
1310
1329
  --tw-bg-opacity: 1;
1311
- background-color: rgb(251 146 60 / var(--tw-bg-opacity));
1330
+ background-color: rgb(31 41 55 / var(--tw-bg-opacity));
1312
1331
  }
1313
1332
  .bg-yellow-300 {
1314
1333
  --tw-bg-opacity: 1;
@@ -1322,6 +1341,9 @@ video {
1322
1341
  --tw-bg-opacity: 1;
1323
1342
  background-color: rgb(156 199 252 / var(--tw-bg-opacity));
1324
1343
  }
1344
+ .bg-opacity-75 {
1345
+ --tw-bg-opacity: 0.75;
1346
+ }
1325
1347
  .bg-\[url\(\'https\:\/\/via\.placeholder\.com\/50\'\)\] {
1326
1348
  background-image: url('https://via.placeholder.com/50');
1327
1349
  }
@@ -1644,6 +1666,11 @@ video {
1644
1666
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
1645
1667
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1646
1668
  }
1669
+ .shadow-2xl {
1670
+ --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
1671
+ --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
1672
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1673
+ }
1647
1674
  .ring-1 {
1648
1675
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1649
1676
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
@@ -1800,6 +1827,10 @@ body {
1800
1827
  --tw-bg-opacity: 1;
1801
1828
  background-color: rgb(29 78 216 / var(--tw-bg-opacity));
1802
1829
  }
1830
+ .hover\:bg-gray-700:hover {
1831
+ --tw-bg-opacity: 1;
1832
+ background-color: rgb(55 65 81 / var(--tw-bg-opacity));
1833
+ }
1803
1834
  .hover\:bg-green-300:hover {
1804
1835
  --tw-bg-opacity: 1;
1805
1836
  background-color: rgb(134 239 172 / var(--tw-bg-opacity));
@@ -1816,6 +1847,10 @@ body {
1816
1847
  --tw-text-opacity: 1;
1817
1848
  color: rgb(37 99 235 / var(--tw-text-opacity));
1818
1849
  }
1850
+ .hover\:text-gray-400:hover {
1851
+ --tw-text-opacity: 1;
1852
+ color: rgb(156 163 175 / var(--tw-text-opacity));
1853
+ }
1819
1854
  .hover\:underline:hover {
1820
1855
  -webkit-text-decoration-line: underline;
1821
1856
  text-decoration-line: underline;
@@ -1832,6 +1867,10 @@ body {
1832
1867
  --tw-border-opacity: 1;
1833
1868
  border-color: rgb(59 130 246 / var(--tw-border-opacity));
1834
1869
  }
1870
+ .focus\:text-white:focus {
1871
+ --tw-text-opacity: 1;
1872
+ color: rgb(255 255 255 / var(--tw-text-opacity));
1873
+ }
1835
1874
  .focus\:outline-none:focus {
1836
1875
  outline: 2px solid transparent;
1837
1876
  outline-offset: 2px;