@sikka/hawa 0.0.242 → 0.0.243
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/dist/styles.css +12 -12
- package/es/elements/HawaIconCount.d.ts +7 -0
- package/es/elements/HawaItemCard.d.ts +9 -0
- package/es/elements/index.d.ts +1 -0
- package/es/index.es.js +2 -2
- package/lib/elements/HawaIconCount.d.ts +7 -0
- package/lib/elements/HawaItemCard.d.ts +9 -0
- package/lib/elements/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/elements/HawaIconCount.tsx +17 -0
- package/src/elements/HawaItemCard.tsx +54 -12
- package/src/elements/index.ts +1 -0
- package/src/styles.css +12 -12
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
type IconCountTypes = {
|
|
4
|
+
icon: any
|
|
5
|
+
count?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const HawaIconCount: React.FunctionComponent<IconCountTypes> = (
|
|
9
|
+
props
|
|
10
|
+
) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex h-fit flex-row items-center gap-2 px-2">
|
|
13
|
+
<div>{props.icon}</div>
|
|
14
|
+
<div className="text-sm">{props.count}</div>
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
3
|
import { HawaMenu } from "./HawaMenu"
|
|
4
|
+
import { HawaButton } from "./HawaButton"
|
|
5
|
+
import { FaReply } from "react-icons/fa"
|
|
4
6
|
|
|
5
7
|
interface ItemCardTypes {
|
|
6
8
|
actions?: any
|
|
@@ -10,7 +12,16 @@ interface ItemCardTypes {
|
|
|
10
12
|
lang?: string
|
|
11
13
|
cardImage?: string
|
|
12
14
|
onCardClick?: any
|
|
15
|
+
counts?: any
|
|
13
16
|
orientation?: "horizontal" | "vertical"
|
|
17
|
+
/** Enabling this blurs the image on hover and shows an action button */
|
|
18
|
+
clickableImage?: boolean
|
|
19
|
+
/** The function of the action button on the image of the card */
|
|
20
|
+
clickableImageAction?: () => void
|
|
21
|
+
/** The text of the action button on the image of the card */
|
|
22
|
+
clickableImageActionText: string
|
|
23
|
+
/** The icon of the action button on the image of the card */
|
|
24
|
+
clickableImageActionIcon?: any
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
type THeaderActions = {
|
|
@@ -21,8 +32,13 @@ type THeaderActions = {
|
|
|
21
32
|
}
|
|
22
33
|
export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
23
34
|
actions,
|
|
35
|
+
counts,
|
|
24
36
|
content,
|
|
25
37
|
headerActions,
|
|
38
|
+
clickableImage,
|
|
39
|
+
clickableImageAction,
|
|
40
|
+
clickableImageActionText,
|
|
41
|
+
clickableImageActionIcon,
|
|
26
42
|
header,
|
|
27
43
|
cardImage,
|
|
28
44
|
orientation = "vertical",
|
|
@@ -64,17 +80,32 @@ export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
|
64
80
|
{...props}
|
|
65
81
|
>
|
|
66
82
|
{cardImage && (
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
<div className="group relative overflow-clip rounded-t">
|
|
84
|
+
<img
|
|
85
|
+
src={"https://via.placeholder.com/50"}
|
|
86
|
+
className={clsx(
|
|
87
|
+
imageStyles[orientation],
|
|
88
|
+
clickableImage
|
|
89
|
+
? "overflow-clip transition-all group-hover:blur-lg"
|
|
90
|
+
: ""
|
|
91
|
+
)}
|
|
92
|
+
/>
|
|
93
|
+
{clickableImage && (
|
|
94
|
+
<div className="absolute left-0 top-0 flex h-full w-full items-center justify-center opacity-0 transition-all group-hover:opacity-100 ">
|
|
95
|
+
<HawaButton
|
|
96
|
+
startIcon={clickableImageActionIcon}
|
|
97
|
+
variant="outlined"
|
|
98
|
+
onClick={clickableImageAction}
|
|
99
|
+
>
|
|
100
|
+
{clickableImageActionText}
|
|
101
|
+
</HawaButton>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
74
105
|
)}
|
|
75
|
-
<div className="relative w-full
|
|
106
|
+
<div className="relative w-full p-6">
|
|
76
107
|
{headerActions && (
|
|
77
|
-
<div className="max-h- bg-red absolute right-0 top-0 flex justify-end
|
|
108
|
+
<div className="max-h- bg-red absolute right-0 top-0 flex justify-end pr-3 pt-3">
|
|
78
109
|
<HawaMenu position="top-right" menuItems={headerActions}>
|
|
79
110
|
<div
|
|
80
111
|
className={clsx(headerActionsButtonStyle)}
|
|
@@ -105,9 +136,20 @@ export const HawaItemCard: React.FunctionComponent<ItemCardTypes> = ({
|
|
|
105
136
|
{content}
|
|
106
137
|
</p>
|
|
107
138
|
)}
|
|
108
|
-
{actions
|
|
109
|
-
<div
|
|
110
|
-
|
|
139
|
+
{actions || counts ? (
|
|
140
|
+
<div
|
|
141
|
+
className={clsx(
|
|
142
|
+
"mt-3 flex items-center rounded-b-lg ",
|
|
143
|
+
actions && counts ? "justify-between" : "justify-end"
|
|
144
|
+
)}
|
|
145
|
+
>
|
|
146
|
+
{counts}
|
|
147
|
+
{actions}
|
|
148
|
+
</div>
|
|
149
|
+
) : null}
|
|
150
|
+
{/* {counts && (
|
|
151
|
+
<div className="flex justify-end rounded-b-lg">{counts}</div>
|
|
152
|
+
)} */}
|
|
111
153
|
</div>
|
|
112
154
|
</div>
|
|
113
155
|
)
|
package/src/elements/index.ts
CHANGED
package/src/styles.css
CHANGED
|
@@ -1659,18 +1659,9 @@ video {
|
|
|
1659
1659
|
.bg-opacity-75 {
|
|
1660
1660
|
--tw-bg-opacity: 0.75;
|
|
1661
1661
|
}
|
|
1662
|
-
.bg-\[url\(\'https\:\/\/via\.placeholder\.com\/50\'\)\] {
|
|
1663
|
-
background-image: url('https://via.placeholder.com/50');
|
|
1664
|
-
}
|
|
1665
1662
|
.bg-none {
|
|
1666
1663
|
background-image: none;
|
|
1667
1664
|
}
|
|
1668
|
-
.bg-cover {
|
|
1669
|
-
background-size: cover;
|
|
1670
|
-
}
|
|
1671
|
-
.bg-no-repeat {
|
|
1672
|
-
background-repeat: no-repeat;
|
|
1673
|
-
}
|
|
1674
1665
|
.object-cover {
|
|
1675
1666
|
-o-object-fit: cover;
|
|
1676
1667
|
object-fit: cover;
|
|
@@ -1705,6 +1696,9 @@ video {
|
|
|
1705
1696
|
.p-5 {
|
|
1706
1697
|
padding: 1.25rem;
|
|
1707
1698
|
}
|
|
1699
|
+
.p-6 {
|
|
1700
|
+
padding: 1.5rem;
|
|
1701
|
+
}
|
|
1708
1702
|
.px-1 {
|
|
1709
1703
|
padding-left: 0.25rem;
|
|
1710
1704
|
padding-right: 0.25rem;
|
|
@@ -1806,9 +1800,6 @@ video {
|
|
|
1806
1800
|
.pt-4 {
|
|
1807
1801
|
padding-top: 1rem;
|
|
1808
1802
|
}
|
|
1809
|
-
.pt-6 {
|
|
1810
|
-
padding-top: 1.5rem;
|
|
1811
|
-
}
|
|
1812
1803
|
.text-left {
|
|
1813
1804
|
text-align: left;
|
|
1814
1805
|
}
|
|
@@ -2387,6 +2378,15 @@ body {
|
|
|
2387
2378
|
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
2388
2379
|
}
|
|
2389
2380
|
|
|
2381
|
+
.group:hover .group-hover\:opacity-100 {
|
|
2382
|
+
opacity: 1;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
.group:hover .group-hover\:blur-lg {
|
|
2386
|
+
--tw-blur: blur(16px);
|
|
2387
|
+
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);
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
2390
|
.peer:checked ~ .peer-checked\:bg-buttonPrimary-500 {
|
|
2391
2391
|
background-color: var(--button-primary-500);
|
|
2392
2392
|
}
|