@sikka/hawa 0.0.229 → 0.0.230

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.229",
3
+ "version": "0.0.230",
4
4
  "description": "SaaS Oriented UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -0,0 +1,86 @@
1
+ import React from "react"
2
+
3
+ import { FaArrowLeft, FaArrowRight } from "react-icons/fa"
4
+
5
+ type Item = {
6
+ label?: string
7
+ icon?: JSX.Element
8
+ }
9
+
10
+ type ComponentTypes = {
11
+ items: Item[]
12
+ index?: number
13
+ arrowSize?: number
14
+ labelSize?: "small" | "medium" | "big"
15
+ }
16
+
17
+ const Arrow = (props: {
18
+ icon: any
19
+ size: number
20
+ onClick?: () => void
21
+ disabled?: boolean
22
+ }) => {
23
+ return (
24
+ <props.icon
25
+ className={
26
+ props.disabled || false ? "text-gray-300" : "hover:text-gray-500"
27
+ }
28
+ size={props.size}
29
+ onClick={props.onClick || (() => {})}
30
+ />
31
+ )
32
+ }
33
+
34
+ export const ArrowCarousel: React.FunctionComponent<ComponentTypes> = (
35
+ props
36
+ ) => {
37
+ const [index, setIndex] = React.useState(props.index || 0)
38
+
39
+ React.useEffect(() => {
40
+ console.log(`INDEX CHANGED TO: ${index}`)
41
+ }, [index])
42
+
43
+ const sizes = {
44
+ small: ["", -8],
45
+ medium: ["2", -11],
46
+ big: ["3", -16],
47
+ }
48
+
49
+ return (
50
+ <div className="align-center box-boorder relative flex h-min w-min flex-row items-center justify-center rounded bg-white p-4 py-6 shadow-md">
51
+ <Arrow
52
+ icon={FaArrowLeft}
53
+ size={props.arrowSize || 48}
54
+ disabled={index == 0}
55
+ onClick={() => {
56
+ if (index != 0) setIndex(index - 1)
57
+ }}
58
+ />
59
+
60
+ <div
61
+ className={`relative box-border flex h-min flex-col items-center justify-center p-5`}
62
+ >
63
+ <div>{props.items[index].icon}</div>
64
+ <div
65
+ className={`absolute bottom-0 text-${
66
+ sizes[props.labelSize || "small"][0]
67
+ }xl `}
68
+ style={{
69
+ marginBottom: sizes[props.labelSize || "small"][1],
70
+ }}
71
+ >
72
+ {props.items[index].label}
73
+ </div>
74
+ </div>
75
+
76
+ <Arrow
77
+ icon={FaArrowRight}
78
+ size={props.arrowSize || 48}
79
+ disabled={index == props.items.length - 1}
80
+ onClick={() => {
81
+ if (index != props.items.length - 1) setIndex(index + 1)
82
+ }}
83
+ />
84
+ </div>
85
+ )
86
+ }
@@ -31,6 +31,7 @@ export * from "./UsageCard"
31
31
  export * from "./InvoiceAccordion"
32
32
  export * from "./HawaDatepicker"
33
33
  export * from "./UserFeedback"
34
+ export * from "./ArrowCarousel"
34
35
  // Inputs
35
36
  export * from "./HawaTextField"
36
37
  export * from "./HawaCardInput"
package/src/styles.css CHANGED
@@ -798,6 +798,9 @@ video {
798
798
  .mt-8 {
799
799
  margin-top: 2rem;
800
800
  }
801
+ .box-border {
802
+ box-sizing: border-box;
803
+ }
801
804
  .block {
802
805
  display: block;
803
806
  }
@@ -901,6 +904,10 @@ video {
901
904
  .h-full {
902
905
  height: 100%;
903
906
  }
907
+ .h-min {
908
+ height: -moz-min-content;
909
+ height: min-content;
910
+ }
904
911
  .h-screen {
905
912
  height: 100vh;
906
913
  }
@@ -996,6 +1003,10 @@ video {
996
1003
  .w-full {
997
1004
  width: 100%;
998
1005
  }
1006
+ .w-min {
1007
+ width: -moz-min-content;
1008
+ width: min-content;
1009
+ }
999
1010
  .min-w-\[24px\] {
1000
1011
  min-width: 24px;
1001
1012
  }
@@ -1687,6 +1698,10 @@ video {
1687
1698
  padding-top: 1.25rem;
1688
1699
  padding-bottom: 1.25rem;
1689
1700
  }
1701
+ .py-6 {
1702
+ padding-top: 1.5rem;
1703
+ padding-bottom: 1.5rem;
1704
+ }
1690
1705
  .pb-2 {
1691
1706
  padding-bottom: 0.5rem;
1692
1707
  }
@@ -2178,6 +2193,11 @@ body {
2178
2193
  color: rgb(156 163 175 / var(--tw-text-opacity));
2179
2194
  }
2180
2195
 
2196
+ .hover\:text-gray-500:hover {
2197
+ --tw-text-opacity: 1;
2198
+ color: rgb(107 114 128 / var(--tw-text-opacity));
2199
+ }
2200
+
2181
2201
  .hover\:text-gray-900:hover {
2182
2202
  --tw-text-opacity: 1;
2183
2203
  color: rgb(17 24 39 / var(--tw-text-opacity));