@sikka/hawa 0.0.163 → 0.0.164

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.163",
3
+ "version": "0.0.164",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -7,16 +7,18 @@ type TabsTypes = {
7
7
  defaultValue?: any
8
8
  contents?: any
9
9
  orientation?: "horizontal" | "vertical"
10
+ direction?: "rtl" | "ltr"
10
11
  }
11
12
  export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
12
13
  orientation = "horizontal",
14
+ direction = "ltr",
13
15
  ...props
14
16
  }) => {
15
17
  const [selectedOption, setSelectedOption] = useState(props.options[0]?.value)
16
18
  // const [selectedOption, setSelectedOption] = useState(props.defaultValue - 1)
17
19
  let activeTabStyle = {
18
20
  vertical:
19
- "inline-block py-2 px-4 text-white bg-buttonPrimary-default rounded-lg rounded-tl-none rounded-bl-none active",
21
+ "inline-block py-2 px-4 text-white bg-buttonPrimary-default active",
20
22
  horizontal:
21
23
  "inline-block py-2 px-4 text-white bg-buttonPrimary-default rounded-lg rounded-br-none rounded-bl-none active",
22
24
  }
@@ -44,12 +46,13 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
44
46
  }
45
47
  let tabsStyle = {
46
48
  vertical:
47
- "flex flex-col w-fit flex-wrap rounded-lg border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
49
+ "sticky top-2 h-fit flex flex-col w-fit flex-wrap rounded-lg border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
48
50
  horizontal:
49
51
  "flex w-fit flex-wrap rounded-lg rounded-br-none rounded-bl-none border-b-primary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
50
52
  }
51
53
  return (
52
54
  <div
55
+ dir={direction}
53
56
  className={clsx(
54
57
  containerStyle[orientation],
55
58
  props.options[selectedOption] ? "border-b-2" : "border-b-0"
@@ -58,9 +61,24 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
58
61
  <ul
59
62
  className={clsx(
60
63
  tabsStyle[orientation],
61
- props.options[selectedOption] ? "border-b-2" : "border-b-0"
64
+ "border-buttonPrimary-default",
65
+ orientation === "vertical"
66
+ ? direction === "rtl"
67
+ ? "rounded-none rounded-r-lg border-l-2"
68
+ : "rounded-none rounded-l-lg border-r-2"
69
+ : "border-b-2"
62
70
  )}
63
71
  >
72
+ {/*
73
+ if selected option
74
+ if vertical
75
+ if rtl
76
+ border left
77
+ else
78
+ border right
79
+ else
80
+ border bottom
81
+ */}
64
82
  {props.options?.map((opt: any, o) => (
65
83
  <li key={o}>
66
84
  <button
@@ -72,9 +90,13 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
72
90
  className={clsx(
73
91
  opt.value === selectedOption
74
92
  ? // props.options[selectedOption].value === opt.value
75
- activeTabStyle[orientation]
93
+ [
94
+ activeTabStyle[orientation],
95
+ direction === "rtl" ? "rounded-r-lg" : "rounded-l-lg",
96
+ ]
76
97
  : inactiveTabStyle[orientation],
77
- "transition-all"
98
+ "w-full transition-all"
99
+ // direction === "rtl" ? "bg-yellow-400" : "bg-yellow-400"
78
100
  )}
79
101
  >
80
102
  {opt.label}
@@ -87,7 +109,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
87
109
  {props.options.map((tab) => (
88
110
  <div
89
111
  key={tab.value}
90
- className={`${selectedOption === tab.value ? "" : "hidden"}`}
112
+ className={clsx(selectedOption === tab.value ? "" : "hidden")}
91
113
  >
92
114
  {tab.content}
93
115
  </div>
package/src/styles.css CHANGED
@@ -605,6 +605,9 @@ video {
605
605
  .bottom-4 {
606
606
  bottom: 1rem;
607
607
  }
608
+ .top-2 {
609
+ top: 0.5rem;
610
+ }
608
611
  .left-3 {
609
612
  left: 0.75rem;
610
613
  }
@@ -629,9 +632,6 @@ video {
629
632
  .-left-1 {
630
633
  left: -0.25rem;
631
634
  }
632
- .top-2 {
633
- top: 0.5rem;
634
- }
635
635
  .right-2\.5 {
636
636
  right: 0.625rem;
637
637
  }
@@ -1102,6 +1102,9 @@ video {
1102
1102
  .gap-1 {
1103
1103
  gap: 0.25rem;
1104
1104
  }
1105
+ .gap-9 {
1106
+ gap: 2.25rem;
1107
+ }
1105
1108
  .gap-x-3 {
1106
1109
  -moz-column-gap: 0.75rem;
1107
1110
  column-gap: 0.75rem;
@@ -1221,6 +1224,10 @@ video {
1221
1224
  border-top-left-radius: 0px;
1222
1225
  border-bottom-left-radius: 0px;
1223
1226
  }
1227
+ .rounded-r-lg {
1228
+ border-top-right-radius: 0.5rem;
1229
+ border-bottom-right-radius: 0.5rem;
1230
+ }
1224
1231
  .rounded-tr-none {
1225
1232
  border-top-right-radius: 0px;
1226
1233
  }
@@ -1239,12 +1246,12 @@ video {
1239
1246
  .rounded-br-lg {
1240
1247
  border-bottom-right-radius: 0.5rem;
1241
1248
  }
1242
- .rounded-tl-none {
1243
- border-top-left-radius: 0px;
1244
- }
1245
1249
  .rounded-br-none {
1246
1250
  border-bottom-right-radius: 0px;
1247
1251
  }
1252
+ .rounded-tl-none {
1253
+ border-top-left-radius: 0px;
1254
+ }
1248
1255
  .border {
1249
1256
  border-width: 1px;
1250
1257
  }
@@ -1290,6 +1297,12 @@ video {
1290
1297
  .border-l-0 {
1291
1298
  border-left-width: 0px;
1292
1299
  }
1300
+ .border-l-2 {
1301
+ border-left-width: 2px;
1302
+ }
1303
+ .border-r-2 {
1304
+ border-right-width: 2px;
1305
+ }
1293
1306
  .border-dashed {
1294
1307
  border-style: dashed;
1295
1308
  }
@@ -1347,6 +1360,9 @@ video {
1347
1360
  --tw-border-opacity: 1;
1348
1361
  border-color: rgb(37 99 235 / var(--tw-border-opacity));
1349
1362
  }
1363
+ .border-buttonPrimary-default {
1364
+ border-color: var(--button-primary);
1365
+ }
1350
1366
  .border-t-white {
1351
1367
  --tw-border-opacity: 1;
1352
1368
  border-top-color: rgb(255 255 255 / var(--tw-border-opacity));
@@ -1439,6 +1455,10 @@ video {
1439
1455
  --tw-bg-opacity: 1;
1440
1456
  background-color: rgb(37 99 235 / var(--tw-bg-opacity));
1441
1457
  }
1458
+ .bg-yellow-400 {
1459
+ --tw-bg-opacity: 1;
1460
+ background-color: rgb(250 204 21 / var(--tw-bg-opacity));
1461
+ }
1442
1462
  .bg-primary-200 {
1443
1463
  --tw-bg-opacity: 1;
1444
1464
  background-color: rgb(196 222 253 / var(--tw-bg-opacity));