@yorkjs/hive-ui 0.1.4 → 0.1.5
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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@import '../../styles/mixin.styl'
|
|
2
|
+
@import '../../styles/variable.styl'
|
|
3
|
+
|
|
4
|
+
.card
|
|
5
|
+
border-radius 10PX
|
|
6
|
+
overflow hidden
|
|
7
|
+
background-color var(--containerCard)
|
|
8
|
+
margin 0 $WING_BLANK
|
|
9
|
+
&.show-top-gutter
|
|
10
|
+
margin-top $GUTTER_BLANK
|
|
11
|
+
&.show-bottom-gutter
|
|
12
|
+
margin-bottom $GUTTER_BLANK
|
|
13
|
+
&.show-top-blank
|
|
14
|
+
margin-top $CARD_BLANK
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from '@tarojs/components'
|
|
3
|
+
import { formatClassNames } from '../../util/function'
|
|
4
|
+
|
|
5
|
+
import styles from './index.module.styl'
|
|
6
|
+
|
|
7
|
+
export interface CardProps {
|
|
8
|
+
className?: string
|
|
9
|
+
showTopGutter?: boolean
|
|
10
|
+
showBottomGutter?: boolean
|
|
11
|
+
showTopBlank?: boolean
|
|
12
|
+
children?: React.ReactNode
|
|
13
|
+
onClick?: () => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CellCard: React.FC<CardProps> = ({
|
|
17
|
+
showTopGutter = false,
|
|
18
|
+
showBottomGutter = false,
|
|
19
|
+
showTopBlank = false,
|
|
20
|
+
onClick,
|
|
21
|
+
className,
|
|
22
|
+
children
|
|
23
|
+
}) => {
|
|
24
|
+
const combinedClass = formatClassNames(
|
|
25
|
+
styles['card'],
|
|
26
|
+
{
|
|
27
|
+
[styles['show-top-gutter']]: showTopGutter,
|
|
28
|
+
[styles['show-bottom-gutter']]: showBottomGutter,
|
|
29
|
+
[styles['show-top-blank']]: showTopBlank,
|
|
30
|
+
},
|
|
31
|
+
className
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View
|
|
36
|
+
className={combinedClass}
|
|
37
|
+
onClick={onClick}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</View>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default CellCard
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Checkbox } from './components/Checkbox'
|
|
|
7
7
|
export { default as Tag } from './components/Tag'
|
|
8
8
|
export { default as FieldCard } from './components/FieldCard'
|
|
9
9
|
export { default as DisplayCard } from './components/DisplayCard'
|
|
10
|
+
export { default as Card } from './components/Card'
|
|
10
11
|
|
|
11
12
|
export { default as FlowItem } from './item/FlowItem'
|
|
12
13
|
export { default as ProductItem, setProductItemConfig } from './item/ProductItem'
|