@yorkjs/hive-ui 0.1.7 → 0.1.8

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": "@yorkjs/hive-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Hive UI - Taro React component library",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -12,4 +12,8 @@
12
12
  &.show-bottom-gutter
13
13
  margin-bottom $GUTTER_BLANK
14
14
  &.show-top-blank
15
- margin-top $CARD_BLANK
15
+ margin-top $CARD_BLANK
16
+ &.is-clickable
17
+ cursor pointer
18
+ &:active
19
+ background-color rgba(0, 0, 0, 0.03)
@@ -10,6 +10,7 @@ export interface CardProps {
10
10
  showBottomGutter?: boolean
11
11
  showTopBlank?: boolean
12
12
  children?: React.ReactNode
13
+ clickable?: boolean
13
14
  onClick?: () => void
14
15
  }
15
16
 
@@ -17,13 +18,17 @@ const CellCard: React.FC<CardProps> = ({
17
18
  showTopGutter = false,
18
19
  showBottomGutter = false,
19
20
  showTopBlank = false,
21
+ clickable,
20
22
  onClick,
21
23
  className,
22
24
  children
23
25
  }) => {
26
+ const isClickable = clickable !== undefined ? clickable : !!onClick
27
+
24
28
  const combinedClass = formatClassNames(
25
29
  styles['card'],
26
30
  {
31
+ [styles['is-clickable']]: isClickable,
27
32
  [styles['show-top-gutter']]: showTopGutter,
28
33
  [styles['show-bottom-gutter']]: showBottomGutter,
29
34
  [styles['show-top-blank']]: showTopBlank,