@newhighsco/chipset 6.13.8 → 6.14.0
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newhighsco/chipset",
|
|
3
3
|
"description": "Shareable, theme-able component library by New High Score",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.14.0",
|
|
5
5
|
"author": "New High Score <hello@newhighsco.re>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"config": {
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@babel/preset-react": "7.16.7",
|
|
53
53
|
"@commitlint/cli": "16.2.3",
|
|
54
54
|
"@fullhuman/postcss-purgecss": "4.1.3",
|
|
55
|
-
"@newhighsco/browserslist-config": "1.0
|
|
56
|
-
"@newhighsco/commitlint-config": "1.0
|
|
57
|
-
"@newhighsco/editor-config": "1.
|
|
58
|
-
"@newhighsco/eslint-config": "3.1.
|
|
59
|
-
"@newhighsco/postcss-config": "3.4.
|
|
55
|
+
"@newhighsco/browserslist-config": "1.1.0",
|
|
56
|
+
"@newhighsco/commitlint-config": "1.1.0",
|
|
57
|
+
"@newhighsco/editor-config": "1.2.0",
|
|
58
|
+
"@newhighsco/eslint-config": "3.1.22",
|
|
59
|
+
"@newhighsco/postcss-config": "3.4.74",
|
|
60
60
|
"@newhighsco/prettier-config": "2.0.18",
|
|
61
|
-
"@newhighsco/release-config": "1.1
|
|
62
|
-
"@newhighsco/storybook-preset": "4.4.
|
|
61
|
+
"@newhighsco/release-config": "1.3.1",
|
|
62
|
+
"@newhighsco/storybook-preset": "4.4.27",
|
|
63
63
|
"@newhighsco/stylelint-config": "3.0.23",
|
|
64
64
|
"@storybook/builder-webpack5": "6.4.19",
|
|
65
65
|
"@storybook/manager-webpack5": "6.4.19",
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { number, object, oneOfType, string } from 'prop-types'
|
|
2
|
+
import { func, number, object, oneOfType, string } from 'prop-types'
|
|
3
3
|
import Image from '../Image'
|
|
4
4
|
import ResponsiveMedia from '../ResponsiveMedia'
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const renderImage = ({ render, src, ...rest }) => {
|
|
7
|
+
if (render) return render()
|
|
7
8
|
if (!src) return null
|
|
8
9
|
|
|
10
|
+
return <Image src={src} {...rest} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const CardImage = ({ ratio, theme, ...rest }) => {
|
|
14
|
+
const image = renderImage({ ...rest })
|
|
15
|
+
|
|
16
|
+
if (!image) return null
|
|
17
|
+
|
|
9
18
|
return (
|
|
10
19
|
<ResponsiveMedia ratio={ratio} className={theme?.image}>
|
|
11
|
-
|
|
20
|
+
{image}
|
|
12
21
|
</ResponsiveMedia>
|
|
13
22
|
)
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
CardImage.propTypes = {
|
|
26
|
+
render: func,
|
|
17
27
|
src: string,
|
|
18
28
|
alt: string,
|
|
19
29
|
ratio: oneOfType([number, string]),
|