@sikka/hawa 0.1.10 → 0.1.12

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.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -6,7 +6,7 @@ import { cn } from "../util"
6
6
  import { HawaLoading } from "./HawaLoading"
7
7
 
8
8
  const buttonVariants = cva(
9
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9
+ "inline-flex items-center justify-center select-none rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
10
10
  {
11
11
  variants: {
12
12
  variant: {
@@ -168,7 +168,7 @@ export const HawaAlert: React.FunctionComponent<AlertTypes> = ({
168
168
  <button
169
169
  type="button"
170
170
  className={clsx(
171
- "absolute top-2 inline-flex h-9 w-9 items-center justify-center rounded-inner p-1.5 text-gray-400 transition-all hover:text-gray-900 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white",
171
+ "absolute top-2 inline-flex h-9 w-9 items-center justify-center rounded-inner p-1.5 text-gray-400 transition-all hover:text-gray-900",
172
172
  closeButtonStyle[props.severity],
173
173
  direction === "rtl" ? "left-2" : "right-2"
174
174
  )}
@@ -22,9 +22,9 @@ export const HawaRadio: FC<RadioTypes> = ({
22
22
  }) => {
23
23
  const [selectedOption, setSelectedOption] = useState(props.defaultValue)
24
24
  let activeTabStyle =
25
- "inline-block py-2 px-4 w-full text-white bg-primary rounded active dark:bg-primary dark:text-black"
25
+ "inline-block py-2 px-4 w-full text-primary-foreground bg-primary active dark:bg-primary "
26
26
  let inactiveTabStyle =
27
- "inline-block py-2 px-4 w-full dark:bg-background bg-gray-100 rounded hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white"
27
+ "inline-block py-2 px-4 w-full transition-all hover:bg-primary/10 dark:bg-background bg-primary/5 hover:text-gray-900 dark:hover:bg-primary/10 dark:hover:text-white dark:bg-primary/5"
28
28
  let orientationStyle = {
29
29
  horizontal: "flex flex-row",
30
30
  vertical: "flex flex-col",
@@ -32,38 +32,39 @@ export const HawaRadio: FC<RadioTypes> = ({
32
32
  switch (design) {
33
33
  case "tabs":
34
34
  return (
35
- <div>
36
- <ul
37
- className={clsx(
38
- props.options?.length > 2
39
- ? "flex-wrap xs:max-w-full xs:flex-nowrap"
40
- : "",
41
- " max-w-fit whitespace-nowrap rounded border bg-gray-100 text-center text-sm font-medium text-gray-500 dark:bg-background dark:text-gray-400",
42
- orientationStyle[orientation]
43
- )}
44
- >
45
- {props.options?.map((opt: any, o) => (
46
- <li className="w-full" key={o}>
47
- <button
48
- aria-current="page"
49
- onClick={() => {
50
- setSelectedOption(opt.value)
51
- props.onChangeTab(opt.value)
52
- }}
53
- className={clsx(
54
- "flex flex-row items-center justify-center gap-2",
55
- selectedOption === opt.value
56
- ? activeTabStyle
57
- : inactiveTabStyle
58
- )}
59
- >
60
- {opt.icon && opt.icon}
61
- {opt.label}
62
- </button>
63
- </li>
64
- ))}
65
- </ul>
66
- </div>
35
+ <ul
36
+ className={clsx(
37
+ props.options?.length > 2
38
+ ? "flex-wrap xs:max-w-full xs:flex-nowrap"
39
+ : "",
40
+ " max-w-fit whitespace-nowrap rounded border text-center text-sm font-medium select-none",
41
+ orientationStyle[orientation]
42
+ )}
43
+ >
44
+ {props.options?.map((opt: any, o) => (
45
+ <li
46
+ aria-current="page"
47
+ onClick={() => {
48
+ setSelectedOption(opt.value)
49
+ props.onChangeTab(opt.value)
50
+ }}
51
+ className={clsx(
52
+ "w-full cursor-pointer",
53
+ orientation === "horizontal" &&
54
+ "rounded-none first:rounded-l last:rounded-r",
55
+ orientation === "vertical" &&
56
+ "rounded-none first:rounded-t last:rounded-b",
57
+
58
+ "last flex flex-row items-center justify-center gap-2 ",
59
+ selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
60
+ )}
61
+ key={o}
62
+ >
63
+ {opt.icon && opt.icon}
64
+ {opt.label}
65
+ </li>
66
+ ))}
67
+ </ul>
67
68
  )
68
69
  case "bordered":
69
70
  return (
@@ -1,7 +1,6 @@
1
1
  import React, { FC } from "react"
2
- import clsx from "clsx"
3
- import { HawaLoading } from "./HawaLoading"
4
2
  import { Card, CardContent, CardHeader, CardTitle } from "./Card"
3
+ import { Skeleton } from "./Skeleton"
5
4
 
6
5
  type StatTypes = {
7
6
  label?: string
@@ -28,41 +27,19 @@ export const HawaStats: FC<StatTypes> = ({ variant = "default", ...props }) => {
28
27
  {props.icon && props.icon}
29
28
  </CardHeader>
30
29
  <CardContent>
31
- <div className="text-2xl font-bold">{props.number}</div>
32
- {props.helperText && (
33
- <p className="text-xs text-muted-foreground">{props.helperText}</p>
30
+ {props.isLoading ? (
31
+ <Skeleton className="h-8 w-3/4" />
32
+ ) : (
33
+ <div className="text-2xl font-bold">{props.number}</div>
34
+ )}
35
+ {props.isLoading ? (
36
+ <Skeleton className="mt-2 h-4 w-1/2" />
37
+ ) : (
38
+ props.helperText && (
39
+ <p className="text-xs text-muted-foreground">{props.helperText}</p>
40
+ )
34
41
  )}
35
42
  </CardContent>
36
43
  </Card>
37
-
38
- // <Card>
39
-
40
- // <CardContent
41
- // // headless
42
- // className={clsx(
43
- // // defaultStyle,
44
- // // widthStyles[props.width],
45
- // statStyles[variant],
46
- // props.handleClick ? "cursor-pointer" : "cursor-default",
47
- // props.handleClick && variant === "dropshadow"
48
- // ? "hover:drop-shadow-lg"
49
- // : ""
50
- // )}
51
- // onClick={props.handleClick}
52
- // >
53
- // {props.icon && <div className="mb-2">{props.icon} </div>}
54
- // {/* <div>{props.label}</div> */}
55
- // {props.isLoading ? (
56
- // <HawaLoading />
57
- // ) : (
58
- // <div className="text-2xl font-bold">{props.number}</div>
59
- // )}
60
- // {props.helperText ? (
61
- // <div className="text-xs text-muted-foreground">
62
- // {props.helperText}
63
- // </div>
64
- // ) : null}
65
- // </CardContent>
66
- // </Card>
67
44
  )
68
45
  }
@@ -53,7 +53,7 @@ export const HawaTextField: FC<TextFieldTypes> = ({
53
53
 
54
54
  let defaultStyle = "flex max-h-fit flex-col justify-center gap-2"
55
55
  let defaultInputStyle =
56
- "block w-full rounded border bg-background p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500"
56
+ "block w-full rounded border bg-background p-2 text-sm text-black dark:text-white focus:border-blue-500 focus:ring-blue-500"
57
57
  let previewInputStyle =
58
58
  "block w-full rounded bg-gray-50 p-2 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"
59
59
  // "mb-0 block w-full rounded border border-gray-300 bg-gray-50 p-2 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,4 +60,5 @@ export * from "./Label"
60
60
  export * from "./Input"
61
61
  export * from "./Tooltip"
62
62
  export * from "./Card"
63
+ export * from "./Skeleton"
63
64
  export * from "./InterfaceSettings"
package/src/styles.css CHANGED
@@ -1171,6 +1171,9 @@ video {
1171
1171
  .w-3 {
1172
1172
  width: 0.75rem;
1173
1173
  }
1174
+ .w-3\/4 {
1175
+ width: 75%;
1176
+ }
1174
1177
  .w-32 {
1175
1178
  width: 8rem;
1176
1179
  }
@@ -1942,6 +1945,9 @@ video {
1942
1945
  .bg-primary\/20 {
1943
1946
  background-color: hsl(var(--primary) / 0.2);
1944
1947
  }
1948
+ .bg-primary\/5 {
1949
+ background-color: hsl(var(--primary) / 0.05);
1950
+ }
1945
1951
  .bg-red-100 {
1946
1952
  --tw-bg-opacity: 1;
1947
1953
  background-color: rgb(254 226 226 / var(--tw-bg-opacity));
@@ -2649,6 +2655,53 @@ video {
2649
2655
  scrollbar-width: none; /* Firefox */
2650
2656
  }
2651
2657
  @import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;700&display=swap");
2658
+ /*
2659
+ @layer base {
2660
+ :root {
2661
+ --background: 0 0% 100%;
2662
+ --foreground: 240 10% 3.9%;
2663
+ --card: 0 0% 100%;
2664
+ --card-foreground: 240 10% 3.9%;
2665
+ --popover: 0 0% 100%;
2666
+ --popover-foreground: 240 10% 3.9%;
2667
+ --primary: 346.8 77.2% 49.8%;
2668
+ --primary-foreground: 355.7 100% 97.3%;
2669
+ --secondary: 240 4.8% 95.9%;
2670
+ --secondary-foreground: 240 5.9% 10%;
2671
+ --muted: 240 4.8% 95.9%;
2672
+ --muted-foreground: 240 3.8% 46.1%;
2673
+ --accent: 240 4.8% 95.9%;
2674
+ --accent-foreground: 240 5.9% 10%;
2675
+ --destructive: 0 84.2% 60.2%;
2676
+ --destructive-foreground: 0 0% 98%;
2677
+ --border: 240 5.9% 90%;
2678
+ --input: 240 5.9% 90%;
2679
+ --ring: 346.8 77.2% 49.8%;
2680
+ --radius: 1rem;
2681
+ }
2682
+
2683
+ .dark {
2684
+ --background: 20 14.3% 4.1%;
2685
+ --foreground: 0 0% 95%;
2686
+ --card: 24 9.8% 10%;
2687
+ --card-foreground: 0 0% 95%;
2688
+ --popover: 0 0% 9%;
2689
+ --popover-foreground: 0 0% 95%;
2690
+ --primary: 346.8 77.2% 49.8%;
2691
+ --primary-foreground: 355.7 100% 97.3%;
2692
+ --secondary: 240 3.7% 15.9%;
2693
+ --secondary-foreground: 0 0% 98%;
2694
+ --muted: 0 0% 15%;
2695
+ --muted-foreground: 240 5% 64.9%;
2696
+ --accent: 12 6.5% 15.1%;
2697
+ --accent-foreground: 0 0% 98%;
2698
+ --destructive: 0 62.8% 30.6%;
2699
+ --destructive-foreground: 0 85.7% 97.3%;
2700
+ --border: 240 3.7% 15.9%;
2701
+ --input: 240 3.7% 15.9%;
2702
+ --ring: 346.8 77.2% 49.8%;
2703
+ }
2704
+ } */
2652
2705
  body {
2653
2706
  font-family: "IBM Plex Sans Arabic", sans-serif;
2654
2707
  }
@@ -2758,6 +2811,22 @@ body {
2758
2811
  --tw-content: '';
2759
2812
  content: var(--tw-content);
2760
2813
  }
2814
+ .first\:rounded-l:first-child {
2815
+ border-top-left-radius: var(--radius);
2816
+ border-bottom-left-radius: var(--radius);
2817
+ }
2818
+ .first\:rounded-t:first-child {
2819
+ border-top-left-radius: var(--radius);
2820
+ border-top-right-radius: var(--radius);
2821
+ }
2822
+ .last\:rounded-b:last-child {
2823
+ border-bottom-right-radius: var(--radius);
2824
+ border-bottom-left-radius: var(--radius);
2825
+ }
2826
+ .last\:rounded-r:last-child {
2827
+ border-top-right-radius: var(--radius);
2828
+ border-bottom-right-radius: var(--radius);
2829
+ }
2761
2830
  .hover\:w-40:hover {
2762
2831
  width: 10rem;
2763
2832
  }
@@ -2835,6 +2904,9 @@ body {
2835
2904
  .hover\:bg-primary-foreground:hover {
2836
2905
  background-color: hsl(var(--primary-foreground));
2837
2906
  }
2907
+ .hover\:bg-primary\/10:hover {
2908
+ background-color: hsl(var(--primary) / 0.1);
2909
+ }
2838
2910
  .hover\:bg-primary\/90:hover {
2839
2911
  background-color: hsl(var(--primary) / 0.9);
2840
2912
  }
@@ -3264,6 +3336,9 @@ body {
3264
3336
  :is(.dark .dark\:bg-primary) {
3265
3337
  background-color: hsl(var(--primary));
3266
3338
  }
3339
+ :is(.dark .dark\:bg-primary\/5) {
3340
+ background-color: hsl(var(--primary) / 0.05);
3341
+ }
3267
3342
  :is(.dark .dark\:bg-red-200) {
3268
3343
  --tw-bg-opacity: 1;
3269
3344
  background-color: rgb(254 202 202 / var(--tw-bg-opacity));
@@ -3372,6 +3447,9 @@ body {
3372
3447
  :is(.dark .dark\:hover\:bg-layoutPrimary-700:hover) {
3373
3448
  background-color: var(--layout-primary-700);
3374
3449
  }
3450
+ :is(.dark .dark\:hover\:bg-primary\/10:hover) {
3451
+ background-color: hsl(var(--primary) / 0.1);
3452
+ }
3375
3453
  :is(.dark .dark\:hover\:text-blue-500:hover) {
3376
3454
  --tw-text-opacity: 1;
3377
3455
  color: rgb(59 130 246 / var(--tw-text-opacity));
package/src/tailwind.css CHANGED
@@ -2,6 +2,53 @@
2
2
  @import "tailwindcss/components";
3
3
  @import "tailwindcss/utilities";
4
4
  @import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;700&display=swap");
5
+ /*
6
+ @layer base {
7
+ :root {
8
+ --background: 0 0% 100%;
9
+ --foreground: 240 10% 3.9%;
10
+ --card: 0 0% 100%;
11
+ --card-foreground: 240 10% 3.9%;
12
+ --popover: 0 0% 100%;
13
+ --popover-foreground: 240 10% 3.9%;
14
+ --primary: 346.8 77.2% 49.8%;
15
+ --primary-foreground: 355.7 100% 97.3%;
16
+ --secondary: 240 4.8% 95.9%;
17
+ --secondary-foreground: 240 5.9% 10%;
18
+ --muted: 240 4.8% 95.9%;
19
+ --muted-foreground: 240 3.8% 46.1%;
20
+ --accent: 240 4.8% 95.9%;
21
+ --accent-foreground: 240 5.9% 10%;
22
+ --destructive: 0 84.2% 60.2%;
23
+ --destructive-foreground: 0 0% 98%;
24
+ --border: 240 5.9% 90%;
25
+ --input: 240 5.9% 90%;
26
+ --ring: 346.8 77.2% 49.8%;
27
+ --radius: 1rem;
28
+ }
29
+
30
+ .dark {
31
+ --background: 20 14.3% 4.1%;
32
+ --foreground: 0 0% 95%;
33
+ --card: 24 9.8% 10%;
34
+ --card-foreground: 0 0% 95%;
35
+ --popover: 0 0% 9%;
36
+ --popover-foreground: 0 0% 95%;
37
+ --primary: 346.8 77.2% 49.8%;
38
+ --primary-foreground: 355.7 100% 97.3%;
39
+ --secondary: 240 3.7% 15.9%;
40
+ --secondary-foreground: 0 0% 98%;
41
+ --muted: 0 0% 15%;
42
+ --muted-foreground: 240 5% 64.9%;
43
+ --accent: 12 6.5% 15.1%;
44
+ --accent-foreground: 0 0% 98%;
45
+ --destructive: 0 62.8% 30.6%;
46
+ --destructive-foreground: 0 85.7% 97.3%;
47
+ --border: 240 3.7% 15.9%;
48
+ --input: 240 3.7% 15.9%;
49
+ --ring: 346.8 77.2% 49.8%;
50
+ }
51
+ } */
5
52
 
6
53
  @layer base {
7
54
  :root {
@@ -165,7 +212,7 @@
165
212
 
166
213
  @layer components {
167
214
  .clickable-link {
168
- @apply cursor-pointer text-primary/80 underline underline-offset-4 hover:text-primary transition-all;
215
+ @apply cursor-pointer text-primary/80 underline underline-offset-4 transition-all hover:text-primary;
169
216
  }
170
217
  }
171
218
  @layer utilities {