@sikka/hawa 0.0.117 → 0.0.118

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.117",
3
+ "version": "0.0.118",
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"
package/src/styles.css CHANGED
@@ -752,6 +752,9 @@ video {
752
752
  .h-2 {
753
753
  height: 0.5rem;
754
754
  }
755
+ .h-4 {
756
+ height: 1rem;
757
+ }
755
758
  .h-32 {
756
759
  height: 8rem;
757
760
  }
@@ -814,6 +817,9 @@ video {
814
817
  .w-10 {
815
818
  width: 2.5rem;
816
819
  }
820
+ .w-4 {
821
+ width: 1rem;
822
+ }
817
823
  .w-11 {
818
824
  width: 2.75rem;
819
825
  }