@sikka/hawa 0.1.5 → 0.1.7

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.5",
3
+ "version": "0.1.7",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -1,19 +1,24 @@
1
1
  import * as React from "react"
2
2
  import { cn } from "../util"
3
3
 
4
- const Card = React.forwardRef<
5
- HTMLDivElement,
6
- React.HTMLAttributes<HTMLDivElement>
7
- >(({ className, ...props }, ref) => (
8
- <div
9
- ref={ref}
10
- className={cn(
11
- "rounded-lg border bg-card text-card-foreground shadow-sm",
12
- className
13
- )}
14
- {...props}
15
- />
16
- ))
4
+ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ clickable?: boolean
6
+ }
7
+
8
+ const Card = React.forwardRef<HTMLDivElement, CardProps>(
9
+ ({ className, clickable = false, ...props }, ref) => (
10
+ <div
11
+ ref={ref}
12
+ className={cn(
13
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
14
+ clickable &&
15
+ "cursor-pointer transition-all hover:drop-shadow-md dark:hover:shadow-dark",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ )
17
22
  Card.displayName = "Card"
18
23
 
19
24
  const CardHeader = React.forwardRef<
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from "react"
2
2
  import clsx from "clsx"
3
3
  import { HawaLoading } from "./HawaLoading"
4
- // import { BsFilesAlt } from "react-icons/bs"
4
+ import { Card, CardContent, CardHeader, CardTitle } from "./Card"
5
5
 
6
6
  type StatTypes = {
7
7
  label?: string
@@ -21,52 +21,48 @@ type StatTypes = {
21
21
  handleClick?: () => void
22
22
  }
23
23
  export const HawaStats: FC<StatTypes> = ({ variant = "default", ...props }) => {
24
- let defaultStyle =
25
- "flex transition-all flex-col gap-1 rounded p-4 text-sm h-fit max-h-fit"
26
- let statStyles = {
27
- plain: "",
28
- default: "border bg-card text-card-foreground shadow-sm",
29
- contained: "bg-layoutPrimary-500",
30
- outlined: "ring-2 w-fit",
31
- neobrutalism: "shadow-neobrutalism border-4 border-black bg-white",
32
- dropshadow: "bg-white drop-shadow-md",
33
- }
34
- let widthStyles = {
35
- full: "w-full",
36
- min: "w-fit",
37
- normal: "w-full max-w-[200px]",
38
- }
39
-
40
24
  return (
41
- <div
42
- onClick={props.handleClick}
43
- className={clsx(
44
- defaultStyle,
45
- widthStyles[props.width],
46
- statStyles[variant],
47
- props.handleClick ? "cursor-pointer" : "cursor-default",
48
- props.handleClick && variant === "dropshadow"
49
- ? "hover:drop-shadow-lg"
50
- : ""
51
- )}
52
- style={{
53
- backgroundColor: props.color
54
- ? props.color
55
- : variant === "contained"
56
- ? "var(--layout-primary-500)"
57
- : "",
58
- }}
59
- >
60
- {props.icon && <div className="mb-2">{props.icon} </div>}
61
- <div>{props.label}</div>
62
- {props.isLoading ? (
63
- <HawaLoading />
64
- ) : (
25
+ <Card onClick={props.handleClick} clickable={Boolean(props.handleClick)}>
26
+ <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
27
+ <CardTitle className="text-sm font-medium">{props.label}</CardTitle>
28
+ {props.icon && props.icon}
29
+ </CardHeader>
30
+ <CardContent>
65
31
  <div className="text-2xl font-bold">{props.number}</div>
66
- )}
67
- {props.helperText ? (
68
- <div className="text-xs text-muted-foreground">{props.helperText}</div>
69
- ) : null}
70
- </div>
32
+ {props.helperText && (
33
+ <p className="text-xs text-muted-foreground">{props.helperText}</p>
34
+ )}
35
+ </CardContent>
36
+ </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>
71
67
  )
72
68
  }
@@ -0,0 +1,15 @@
1
+ import { cn } from "../util"
2
+
3
+ function Skeleton({
4
+ className,
5
+ ...props
6
+ }: React.HTMLAttributes<HTMLDivElement>) {
7
+ return (
8
+ <div
9
+ className={cn("animate-pulse rounded-md bg-muted", className)}
10
+ {...props}
11
+ />
12
+ )
13
+ }
14
+
15
+ export { Skeleton }
@@ -53,3 +53,10 @@ export * from "./HawaLandingCard"
53
53
  export * from "./HawaButton"
54
54
  export * from "./HawaStoreButtons"
55
55
  export * from "./HawaLogoButton"
56
+
57
+ // v0.1
58
+ export * from "./Button"
59
+ export * from "./Label"
60
+ export * from "./Input"
61
+ export * from "./Tooltip"
62
+ export * from "./Card"
package/src/styles.css CHANGED
@@ -1383,6 +1383,15 @@ video {
1383
1383
  .animate-bounce {
1384
1384
  animation: bounce 1s infinite;
1385
1385
  }
1386
+ @keyframes pulse {
1387
+
1388
+ 50% {
1389
+ opacity: .5;
1390
+ }
1391
+ }
1392
+ .animate-pulse {
1393
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
1394
+ }
1386
1395
  @keyframes spin {
1387
1396
 
1388
1397
  to {
@@ -1914,6 +1923,9 @@ video {
1914
1923
  .bg-layoutPrimary-600 {
1915
1924
  background-color: var(--layout-primary-600);
1916
1925
  }
1926
+ .bg-muted {
1927
+ background-color: hsl(var(--muted));
1928
+ }
1917
1929
  .bg-orange-400 {
1918
1930
  --tw-bg-opacity: 1;
1919
1931
  background-color: rgb(251 146 60 / var(--tw-bg-opacity));
@@ -2538,10 +2550,6 @@ video {
2538
2550
  --tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
2539
2551
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2540
2552
  }
2541
- .drop-shadow-md {
2542
- --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
2543
- filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2544
- }
2545
2553
  .filter {
2546
2554
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2547
2555
  }
@@ -2905,6 +2913,10 @@ body {
2905
2913
  --tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
2906
2914
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2907
2915
  }
2916
+ .hover\:drop-shadow-md:hover {
2917
+ --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
2918
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2919
+ }
2908
2920
  .focus\:border-blue-500:focus {
2909
2921
  --tw-border-opacity: 1;
2910
2922
  border-color: rgb(59 130 246 / var(--tw-border-opacity));
@@ -3366,6 +3378,11 @@ body {
3366
3378
  --tw-text-opacity: 1;
3367
3379
  color: rgb(255 255 255 / var(--tw-text-opacity));
3368
3380
  }
3381
+ :is(.dark .dark\:hover\:shadow-dark:hover) {
3382
+ --tw-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
3383
+ --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -2px var(--tw-shadow-color);
3384
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
3385
+ }
3369
3386
  :is(.dark .dark\:hover\:brightness-90:hover) {
3370
3387
  --tw-brightness: brightness(.9);
3371
3388
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
@@ -3505,6 +3522,10 @@ body {
3505
3522
  columns: 3;
3506
3523
  }
3507
3524
 
3525
+ .md\:grid-cols-2 {
3526
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3527
+ }
3528
+
3508
3529
  .md\:flex-row {
3509
3530
  flex-direction: row;
3510
3531
  }
@@ -3560,6 +3581,10 @@ body {
3560
3581
  -moz-columns: 4;
3561
3582
  columns: 4;
3562
3583
  }
3584
+
3585
+ .lg\:grid-cols-4 {
3586
+ grid-template-columns: repeat(4, minmax(0, 1fr));
3587
+ }
3563
3588
  }
3564
3589
  @media (min-width: 1280px) {
3565
3590
 
@@ -19,7 +19,8 @@ module.exports = {
19
19
  },
20
20
  extend: {
21
21
  boxShadow: {
22
- neobrutalism: "5px 5px 0px 0px rgba(0,0,0,1);"
22
+ neobrutalism: "5px 5px 0px 0px rgba(0,0,0,1);",
23
+ dark: "0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05)"
23
24
  },
24
25
  maxWidth: {
25
26
  "2xs": "250px"