@newhighsco/chipset 6.13.8 → 6.14.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 +26 -30
- package/src/components/Card/CardImage.jsx +13 -3
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.2",
|
|
5
5
|
"author": "New High Score <hello@newhighsco.re>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"config": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"url": "https://main--6004028a0df11e0021f58df8.chromatic.com"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
+
"prepare": "is-ci || husky install",
|
|
28
29
|
"start": "start-storybook --docs --no-manager-cache",
|
|
29
30
|
"prebuild": "rm -rf build",
|
|
30
31
|
"build": "build-storybook --output-dir build --docs --quiet",
|
|
@@ -41,51 +42,52 @@
|
|
|
41
42
|
"format:css": "yarn lint:css --fix"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@dr.pogodin/react-themes": "1.4.
|
|
45
|
+
"@dr.pogodin/react-themes": "1.4.2",
|
|
45
46
|
"classnames": "2.3.1",
|
|
46
|
-
"react-device-detect": "2.
|
|
47
|
+
"react-device-detect": "2.2.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "7.17.
|
|
50
|
+
"@babel/core": "7.17.9",
|
|
50
51
|
"@babel/polyfill": "7.12.1",
|
|
51
52
|
"@babel/preset-env": "7.16.11",
|
|
52
53
|
"@babel/preset-react": "7.16.7",
|
|
53
54
|
"@commitlint/cli": "16.2.3",
|
|
54
55
|
"@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.
|
|
59
|
-
"@newhighsco/postcss-config": "3.4
|
|
60
|
-
"@newhighsco/prettier-config": "2.
|
|
61
|
-
"@newhighsco/release-config": "1.
|
|
62
|
-
"@newhighsco/storybook-preset": "4.
|
|
63
|
-
"@newhighsco/stylelint-config": "3.
|
|
64
|
-
"@storybook/builder-webpack5": "6.4.
|
|
65
|
-
"@storybook/manager-webpack5": "6.4.
|
|
66
|
-
"@storybook/react": "6.4.
|
|
56
|
+
"@newhighsco/browserslist-config": "1.1.0",
|
|
57
|
+
"@newhighsco/commitlint-config": "1.1.0",
|
|
58
|
+
"@newhighsco/editor-config": "1.2.0",
|
|
59
|
+
"@newhighsco/eslint-config": "3.2.4",
|
|
60
|
+
"@newhighsco/postcss-config": "3.5.4",
|
|
61
|
+
"@newhighsco/prettier-config": "2.1.1",
|
|
62
|
+
"@newhighsco/release-config": "1.3.4",
|
|
63
|
+
"@newhighsco/storybook-preset": "4.5.2",
|
|
64
|
+
"@newhighsco/stylelint-config": "3.1.1",
|
|
65
|
+
"@storybook/builder-webpack5": "6.4.21",
|
|
66
|
+
"@storybook/manager-webpack5": "6.4.21",
|
|
67
|
+
"@storybook/react": "6.4.21",
|
|
67
68
|
"@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
|
|
68
69
|
"babel-jest": "27.5.1",
|
|
69
70
|
"babel-loader": "8.2.4",
|
|
70
|
-
"chromatic": "6.5.
|
|
71
|
+
"chromatic": "6.5.4",
|
|
71
72
|
"enzyme": "3.11.0",
|
|
72
|
-
"eslint": "8.
|
|
73
|
+
"eslint": "8.13.0",
|
|
73
74
|
"husky": "7.0.4",
|
|
75
|
+
"is-ci": "3.0.1",
|
|
74
76
|
"identity-obj-proxy": "3.0.0",
|
|
75
77
|
"jest": "27.5.1",
|
|
76
78
|
"npm-run-all": "4.1.5",
|
|
77
79
|
"postcss": "8.4.12",
|
|
78
|
-
"prettier": "2.6.
|
|
79
|
-
"react": "
|
|
80
|
-
"react-dom": "
|
|
80
|
+
"prettier": "2.6.2",
|
|
81
|
+
"react": "18.0.0",
|
|
82
|
+
"react-dom": "18.0.0",
|
|
81
83
|
"sass-true": "6.1.0",
|
|
82
84
|
"semantic-release": "19.0.2",
|
|
83
85
|
"stylelint": "14.6.1",
|
|
84
|
-
"webpack": "5.
|
|
86
|
+
"webpack": "5.72.0"
|
|
85
87
|
},
|
|
86
88
|
"peerDependencies": {
|
|
87
|
-
"react": "
|
|
88
|
-
"react-dom": "
|
|
89
|
+
"react": "18.0.0",
|
|
90
|
+
"react-dom": "18.0.0"
|
|
89
91
|
},
|
|
90
92
|
"browserslist": [
|
|
91
93
|
"extends @newhighsco/browserslist-config"
|
|
@@ -100,12 +102,6 @@
|
|
|
100
102
|
"@newhighsco/eslint-config"
|
|
101
103
|
]
|
|
102
104
|
},
|
|
103
|
-
"husky": {
|
|
104
|
-
"hooks": {
|
|
105
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
106
|
-
"pre-commit": "npm run lint"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
105
|
"prettier": "@newhighsco/prettier-config",
|
|
110
106
|
"release": {
|
|
111
107
|
"extends": "@newhighsco/release-config",
|
|
@@ -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]),
|