@yorkjs/hive-ui 0.1.6 → 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.6",
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",
@@ -22,7 +22,7 @@ export interface AlertProps {
22
22
  onClose?: () => void
23
23
  showAnimation?: boolean
24
24
  duration?: number
25
- onChange?: () => void
25
+ onClick?: () => void
26
26
  showArrow?: boolean
27
27
  borderRadius?: number
28
28
  className?: string
@@ -47,7 +47,7 @@ const Alert: React.FC<AlertProps> = ({
47
47
  onClose,
48
48
  showAnimation = false,
49
49
  duration = 0,
50
- onChange,
50
+ onClick,
51
51
  showArrow = false,
52
52
  borderRadius = 0,
53
53
  className,
@@ -110,7 +110,7 @@ const Alert: React.FC<AlertProps> = ({
110
110
  handleClose()
111
111
  }
112
112
 
113
- onChange?.()
113
+ onClick?.()
114
114
  }
115
115
 
116
116
  useEffect(() => {
@@ -125,7 +125,7 @@ const Alert: React.FC<AlertProps> = ({
125
125
  return (
126
126
  <View
127
127
  className={formatClassNames(styles['alert-container'], className, {
128
- [styles['is-pressable']]: !!onChange,
128
+ [styles['is-pressable']]: !!onClick,
129
129
  [styles['show-animation']]: showAnimation,
130
130
  [styles['is-leaving']]: isLeaving
131
131
  })}
@@ -249,7 +249,7 @@ const Alert: React.FC<AlertProps> = ({
249
249
  </View>
250
250
  )}
251
251
 
252
- {(showArrow || (!showArrow && onChange)) && !closable && (
252
+ {(showArrow || (!showArrow && onClick)) && !closable && (
253
253
  <Icon
254
254
  name="right"
255
255
  color={config.color}
@@ -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,
@@ -71,10 +71,13 @@
71
71
  width 100%
72
72
  lineClamp(1)
73
73
 
74
+ .flow-item-time-container
75
+ display flex
76
+ margin-top 5PX
77
+
74
78
  .flow-item-time
75
79
  font-size 12PX
76
80
  color var(--textMuted)
77
- margin-top 5PX
78
81
  text-align left
79
82
 
80
83
  .flow-item-right
@@ -14,7 +14,7 @@ interface IProps {
14
14
  /** 标题 */
15
15
  title?: string
16
16
  /** 时间或下方副标题 */
17
- time?: string
17
+ time?: string | React.ReactNode
18
18
  /** 右侧金额 */
19
19
  amount?: string | number
20
20
  /** 金额颜色,不传默认 */
@@ -80,9 +80,17 @@ const FlowItem: React.FC<IProps> = (props) => {
80
80
  {
81
81
  !isEmpty(time)
82
82
  ? (
83
- <Text className="flow-item-time">
84
- {time}
85
- </Text>
83
+ <View className="flow-item-time-container">
84
+ {
85
+ typeof time === 'string'
86
+ ? (
87
+ <Text className="flow-item-time">{time}</Text>
88
+ )
89
+ : (
90
+ time
91
+ )
92
+ }
93
+ </View>
86
94
  )
87
95
  : undefined
88
96
  }
@@ -147,7 +147,6 @@ export default function getResponsiveImage(options: IGetResponsiveImageOptions):
147
147
  const mode = noCrop ? 2 : 1
148
148
  finalUrl += `?imageView2/${mode}/${suffix.join('/')}`
149
149
  }
150
- console.log("🚀 ~ getResponsiveImage ~ finalUrl:", finalUrl)
151
150
 
152
151
  return formatAssetUrl(finalUrl)
153
152
  }