@yorkjs/hive-ui 2.0.0 → 2.0.2
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,20 +1,25 @@
|
|
|
1
1
|
@import '../../styles/mixin.styl'
|
|
2
2
|
@import '../../styles/variable.styl'
|
|
3
3
|
|
|
4
|
-
.card
|
|
4
|
+
.card-container
|
|
5
5
|
border-radius 10PX
|
|
6
6
|
overflow hidden
|
|
7
7
|
background-color var(--containerCard)
|
|
8
8
|
margin-left $WING_BLANK
|
|
9
9
|
margin-right $WING_BLANK
|
|
10
|
-
transition background-color 0.1s
|
|
11
10
|
&.show-top-gutter
|
|
12
11
|
margin-top $GUTTER_BLANK
|
|
13
12
|
&.show-bottom-gutter
|
|
14
13
|
margin-bottom $GUTTER_BLANK
|
|
15
14
|
&.show-top-blank
|
|
16
15
|
margin-top $CARD_BLANK
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
background-color
|
|
16
|
+
|
|
17
|
+
:global
|
|
18
|
+
.card-inner
|
|
19
|
+
background-color var(--containerCard)
|
|
20
|
+
transition background-color 0.1s
|
|
21
|
+
|
|
22
|
+
&.is-clickable
|
|
23
|
+
cursor pointer
|
|
24
|
+
&:active
|
|
25
|
+
background-color rgba(0, 0, 0, 0.03)
|
|
@@ -5,6 +5,7 @@ import { formatClassNames } from '../../util/function'
|
|
|
5
5
|
import styles from './index.module.styl'
|
|
6
6
|
|
|
7
7
|
export interface CardProps {
|
|
8
|
+
warpClassName?: string
|
|
8
9
|
className?: string
|
|
9
10
|
showTopGutter?: boolean
|
|
10
11
|
showBottomGutter?: boolean
|
|
@@ -14,36 +15,46 @@ export interface CardProps {
|
|
|
14
15
|
onClick?: () => void
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
+
const Card: React.FC<CardProps> = ({
|
|
18
19
|
showTopGutter = false,
|
|
19
20
|
showBottomGutter = false,
|
|
20
21
|
showTopBlank = false,
|
|
21
22
|
clickable,
|
|
22
23
|
onClick,
|
|
24
|
+
warpClassName,
|
|
23
25
|
className,
|
|
24
26
|
children
|
|
25
27
|
}) => {
|
|
26
28
|
const isClickable = clickable !== undefined ? clickable : !!onClick
|
|
27
29
|
|
|
28
|
-
const
|
|
29
|
-
styles['card'],
|
|
30
|
+
const containerClass = formatClassNames(
|
|
31
|
+
styles['card-container'],
|
|
30
32
|
{
|
|
31
|
-
[styles['is-clickable']]: isClickable,
|
|
32
33
|
[styles['show-top-gutter']]: showTopGutter,
|
|
33
34
|
[styles['show-bottom-gutter']]: showBottomGutter,
|
|
34
35
|
[styles['show-top-blank']]: showTopBlank,
|
|
35
36
|
},
|
|
37
|
+
warpClassName
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const innerClass = formatClassNames(
|
|
41
|
+
'card-inner',
|
|
42
|
+
{
|
|
43
|
+
'is-clickable': isClickable,
|
|
44
|
+
},
|
|
36
45
|
className
|
|
37
46
|
)
|
|
38
47
|
|
|
39
48
|
return (
|
|
40
|
-
<View
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
<View className={containerClass}>
|
|
50
|
+
<View
|
|
51
|
+
className={innerClass}
|
|
52
|
+
onClick={onClick}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</View>
|
|
45
56
|
</View>
|
|
46
57
|
)
|
|
47
58
|
}
|
|
48
59
|
|
|
49
|
-
export default
|
|
60
|
+
export default Card
|
|
@@ -194,7 +194,7 @@ const ProductItem: React.FC<IProductCardProps> = (props) => {
|
|
|
194
194
|
<Tag
|
|
195
195
|
type='light-warning'
|
|
196
196
|
text={item.text}
|
|
197
|
-
className=
|
|
197
|
+
className="product-tag"
|
|
198
198
|
style={{ backgroundColor: item.color, color: '#fff' }}
|
|
199
199
|
/>
|
|
200
200
|
</View>
|
|
@@ -232,7 +232,7 @@ const ProductItem: React.FC<IProductCardProps> = (props) => {
|
|
|
232
232
|
key={type}
|
|
233
233
|
text={tagProps.text}
|
|
234
234
|
style={{ color: tagProps.color, backgroundColor: tagProps.bg, borderColor: tagProps.color }}
|
|
235
|
-
className=
|
|
235
|
+
className="delivery-tag"
|
|
236
236
|
/>
|
|
237
237
|
)
|
|
238
238
|
})
|
|
@@ -434,7 +434,7 @@ const ProductItem: React.FC<IProductCardProps> = (props) => {
|
|
|
434
434
|
<Icon
|
|
435
435
|
name='trash'
|
|
436
436
|
size={13}
|
|
437
|
-
className=
|
|
437
|
+
className="delete-icon"
|
|
438
438
|
/>
|
|
439
439
|
</View>
|
|
440
440
|
)
|
|
@@ -97,13 +97,13 @@ $F_BUY_COUNT = 14PX // RN 14
|
|
|
97
97
|
margin-right 5PX
|
|
98
98
|
flex-shrink 0
|
|
99
99
|
line-height 1
|
|
100
|
-
|
|
101
|
-
.product-tag
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
:global
|
|
101
|
+
.product-tag
|
|
102
|
+
height 15PX
|
|
103
|
+
line-height 15PX
|
|
104
|
+
padding 1PX 3PX
|
|
105
|
+
border-radius 3PX
|
|
106
|
+
font-size 10PX
|
|
107
107
|
|
|
108
108
|
.title
|
|
109
109
|
flex 1
|
|
@@ -156,13 +156,13 @@ $F_BUY_COUNT = 14PX // RN 14
|
|
|
156
156
|
flex-wrap wrap
|
|
157
157
|
gap 5PX
|
|
158
158
|
margin-top 5PX
|
|
159
|
-
|
|
160
|
-
.delivery-tag
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
:global
|
|
160
|
+
.delivery-tag
|
|
161
|
+
padding 1PX 5PX
|
|
162
|
+
border-radius 3PX
|
|
163
|
+
font-size $F_TAG_NORMAL
|
|
164
|
+
height 15PX
|
|
165
|
+
line-height 15PX
|
|
166
166
|
|
|
167
167
|
.activity-tag
|
|
168
168
|
display flex
|
|
@@ -257,9 +257,9 @@ $F_BUY_COUNT = 14PX // RN 14
|
|
|
257
257
|
right 11PX
|
|
258
258
|
padding 5PX
|
|
259
259
|
z-index 10
|
|
260
|
-
|
|
261
|
-
.delete-icon
|
|
262
|
-
|
|
260
|
+
:global
|
|
261
|
+
.delete-icon
|
|
262
|
+
color var(--textContent)
|
|
263
263
|
|
|
264
264
|
.card-footer
|
|
265
265
|
width 100%
|