@sikka/hawa 0.0.169 → 0.0.170

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.169",
3
+ "version": "0.0.170",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -108,7 +108,7 @@ export function HawaButton({
108
108
  type={props.type}
109
109
  {...props}
110
110
  >
111
- {!isLoading ? children : <HawaSpinner />}
111
+ {!isLoading ? children : <HawaSpinner size="button" />}
112
112
  </button>
113
113
  {tooltip && (
114
114
  <HawaTooltip
@@ -1,10 +1,29 @@
1
+ import clsx from "clsx"
1
2
  import React from "react"
3
+ // TODO: Add different sizes
4
+ type SpinnerTypes = {
5
+ size?: "button" | "sm" | "normal" | "lg" | "xl"
6
+ }
2
7
 
3
- type SpinnerTypes = {}
4
- export const HawaSpinner: React.FunctionComponent<SpinnerTypes> = (props) => {
8
+ export const HawaSpinner: React.FunctionComponent<SpinnerTypes> = ({
9
+ size = "sm",
10
+ ...props
11
+ }) => {
12
+ let sizeStyles = {
13
+ button: "h-4 w-4",
14
+ sm: "h-6 w-6",
15
+ normal: "h-8 w-8",
16
+ lg: "h-14 w-14",
17
+ xl: "h-24 w-24",
18
+ }
5
19
  return (
6
20
  <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>
21
+ <div
22
+ className={clsx(
23
+ sizeStyles[size],
24
+ "animate-spin rounded-full border-2 border-gray-400 border-t-white text-white"
25
+ )}
26
+ ></div>
8
27
  </div>
9
28
  )
10
29
  }
@@ -2,7 +2,7 @@ import React from "react"
2
2
  import { HawaButton } from "./HawaButton"
3
3
  import { FaTrash, FaExclamationCircle, FaPen } from "react-icons/fa"
4
4
  import clsx from "clsx"
5
- // import { HiOutlineEye } from "react-icons/hi2"
5
+
6
6
  type TableTypes = {
7
7
  lang?: any
8
8
  columns: any[string]
@@ -12,12 +12,14 @@ type TableTypes = {
12
12
  handleActionClick?: any
13
13
  end?: any
14
14
  size?: "normal" | "small"
15
+ highlightFirst?: boolean
15
16
  customColor?: string
16
17
  }
17
18
 
18
19
  export const HawaTable: React.FunctionComponent<TableTypes> = ({
19
20
  size = "normal",
20
21
  customColor = "white",
22
+ highlightFirst = false,
21
23
  ...props
22
24
  }) => {
23
25
  let isArabic = props.lang === "ar"
@@ -27,7 +29,7 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
27
29
  small: "px-3 py-1",
28
30
  }
29
31
  return (
30
- <div className="relative overflow-x-visible rounded-xl">
32
+ <div className="relative overflow-x-clip rounded-lg">
31
33
  <table className="w-full text-left text-sm text-gray-500 dark:text-gray-400">
32
34
  <thead className="bg-layoutPrimary-default text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400">
33
35
  <tr>
@@ -49,8 +51,9 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
49
51
  <tr
50
52
  key={j}
51
53
  className={clsx(
52
- "border-b dark:border-gray-700 dark:bg-gray-800",
53
- "bg-" + customColor
54
+ "dark:border-gray-700 dark:bg-gray-800",
55
+ "bg-" + customColor,
56
+ j == props.rows.length - 1 ? "" : "border-b"
54
57
  )}
55
58
  >
56
59
  {singleRow.map((r: any, i: any) => {
@@ -61,7 +64,8 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
61
64
  scope="row"
62
65
  className={clsx(
63
66
  sizeStyles[size],
64
- "whitespace-nowrap font-medium text-gray-900 dark:text-white"
67
+ "whitespace-nowrap dark:text-white",
68
+ highlightFirst ? "font-bold" : "font-normal"
65
69
  )}
66
70
  >
67
71
  {r}{" "}
package/src/styles.css CHANGED
@@ -880,6 +880,9 @@ video {
880
880
  .h-4 {
881
881
  height: 1rem;
882
882
  }
883
+ .h-24 {
884
+ height: 6rem;
885
+ }
883
886
  .h-32 {
884
887
  height: 8rem;
885
888
  }
@@ -1204,9 +1207,6 @@ video {
1204
1207
  .overflow-y-clip {
1205
1208
  overflow-y: clip;
1206
1209
  }
1207
- .overflow-x-visible {
1208
- overflow-x: visible;
1209
- }
1210
1210
  .truncate {
1211
1211
  overflow: hidden;
1212
1212
  text-overflow: ellipsis;