shinkansen-sprockets 1.1.309 → 1.1.311
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/babel.config.cjs +1 -0
- package/package.json +17 -16
- package/src/common/index.mjs +7 -0
- package/src/components/error-message/index.jsx +3 -1
- package/src/components/group/index.jsx +5 -1
- package/src/sprockets/check-answers/group/index.jsx +3 -1
- package/src/sprockets/check-answers/index.jsx +2 -2
- package/src/sprockets/error-summary/group/index.jsx +3 -1
- package/src/sprockets/error-summary/index.jsx +2 -2
- package/src/sprockets/fieldset/index.jsx +8 -3
- package/src/sprockets/index.jsx +6 -6
package/babel.config.cjs
CHANGED
@@ -47,6 +47,7 @@ const plugins = [
|
|
47
47
|
/**
|
48
48
|
* Storybook
|
49
49
|
*/
|
50
|
+
'shinkansen-sprockets/common': './src/common/index.mjs',
|
50
51
|
'shinkansen-sprockets/sprockets/check-answers/group/answer-item': './src/sprockets/check-answers/group/answer-item.jsx',
|
51
52
|
'shinkansen-sprockets/sprockets/check-answers/group/answer-title': './src/sprockets/check-answers/group/answer-title.jsx',
|
52
53
|
'shinkansen-sprockets/sprockets/check-answers/group/answer-value': './src/sprockets/check-answers/group/answer-value.jsx',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-sprockets",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.311",
|
4
4
|
"description": "Shinkansen Sprockets",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"email": "modernpoacher@modernpoacher.com",
|
19
19
|
"url": "https://modernpoacher.com"
|
20
20
|
},
|
21
|
-
"license": "
|
21
|
+
"license": "ISC",
|
22
22
|
"engines": {
|
23
23
|
"node": ">=18.12.0"
|
24
24
|
},
|
@@ -56,20 +56,20 @@
|
|
56
56
|
"@babel/preset-env": "^7.24.7",
|
57
57
|
"@babel/preset-react": "^7.24.7",
|
58
58
|
"@babel/register": "^7.24.6",
|
59
|
-
"@modernpoacher/design-system": "1.0.
|
60
|
-
"@modernpoacher/hooks": "^1.0.
|
59
|
+
"@modernpoacher/design-system": "1.0.166",
|
60
|
+
"@modernpoacher/hooks": "^1.0.481",
|
61
61
|
"@sequencemedia/gulp": "^1.1.194",
|
62
|
-
"@sequencemedia/gulp-clean-css": "^1.0.
|
63
|
-
"@sequencemedia/gulp-css-purge": "^1.1.
|
64
|
-
"@sequencemedia/gulp-debug": "^1.0.
|
65
|
-
"@sequencemedia/gulp-postcss": "^1.0.
|
66
|
-
"@sequencemedia/gulp-sass": "^1.0.
|
62
|
+
"@sequencemedia/gulp-clean-css": "^1.0.106",
|
63
|
+
"@sequencemedia/gulp-css-purge": "^1.1.107",
|
64
|
+
"@sequencemedia/gulp-debug": "^1.0.109",
|
65
|
+
"@sequencemedia/gulp-postcss": "^1.0.120",
|
66
|
+
"@sequencemedia/gulp-sass": "^1.0.105",
|
67
67
|
"@sequencemedia/gulp-sourcemaps": "^1.0.109",
|
68
|
-
"@storybook/addon-actions": "
|
69
|
-
"@storybook/addon-essentials": "
|
70
|
-
"@storybook/addon-links": "
|
71
|
-
"@storybook/react": "
|
72
|
-
"@storybook/react-webpack5": "
|
68
|
+
"@storybook/addon-actions": "7.6.20",
|
69
|
+
"@storybook/addon-essentials": "7.6.20",
|
70
|
+
"@storybook/addon-links": "7.6.20",
|
71
|
+
"@storybook/react": "7.6.20",
|
72
|
+
"@storybook/react-webpack5": "7.6.20",
|
73
73
|
"@types/react": "^18.3.3",
|
74
74
|
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
75
75
|
"@typescript-eslint/parser": "^7.14.1",
|
@@ -87,7 +87,7 @@
|
|
87
87
|
"glob-all": "^3.3.1",
|
88
88
|
"husky": "^9.0.11",
|
89
89
|
"jest": "^29.7.0",
|
90
|
-
"postcss": "^8.4.
|
90
|
+
"postcss": "^8.4.39",
|
91
91
|
"postcss-easy-import": "^4.0.0",
|
92
92
|
"postcss-map": "^0.11.0",
|
93
93
|
"postcss-normalize": "^10.0.1",
|
@@ -100,7 +100,7 @@
|
|
100
100
|
"react-test-renderer": "^18.3.1",
|
101
101
|
"regenerator-runtime": "^0.14.1",
|
102
102
|
"sass": "^1.77.6",
|
103
|
-
"storybook": "
|
103
|
+
"storybook": "7.6.20",
|
104
104
|
"vinyl-paths": "^5.0.0"
|
105
105
|
},
|
106
106
|
"imports": {
|
@@ -115,6 +115,7 @@
|
|
115
115
|
"require": "./src/index.cjs",
|
116
116
|
"import": "./src/index.mjs"
|
117
117
|
},
|
118
|
+
"./common": "./src/common/index.mjs",
|
118
119
|
"./components/common/text-content": "./src/components/common/text-content/index.cjs",
|
119
120
|
"./components/common/visually-hidden-text": "./src/components/common/visually-hidden-text/index.cjs",
|
120
121
|
"./components/description": "./src/components/description/index.cjs",
|
@@ -11,7 +11,9 @@ import transform from 'shinkansen-sprockets/transformers/error-message'
|
|
11
11
|
import TextContent from 'shinkansen-sprockets/components/common/text-content'
|
12
12
|
|
13
13
|
export default class ErrorMessage extends Component {
|
14
|
-
state = {
|
14
|
+
state = {
|
15
|
+
errorMessage: {}
|
16
|
+
}
|
15
17
|
|
16
18
|
hasTextContent () {
|
17
19
|
const { errorMessage } = this.props
|
@@ -7,6 +7,10 @@
|
|
7
7
|
import React, { Component } from 'react'
|
8
8
|
import PropTypes from 'prop-types'
|
9
9
|
|
10
|
+
import {
|
11
|
+
DEFAULT_HANDLE_CHANGE
|
12
|
+
} from 'shinkansen-sprockets/common'
|
13
|
+
|
10
14
|
export default class Group extends Component {
|
11
15
|
getClassName () {
|
12
16
|
return 'group'
|
@@ -25,7 +29,7 @@ export default class Group extends Component {
|
|
25
29
|
|
26
30
|
render () {
|
27
31
|
const {
|
28
|
-
onChange,
|
32
|
+
onChange = DEFAULT_HANDLE_CHANGE,
|
29
33
|
groupRef,
|
30
34
|
children
|
31
35
|
} = this.props
|
@@ -22,9 +22,9 @@ export default class CheckAnswersSprocket extends Sprocket {
|
|
22
22
|
* @param {SprocketProps} props
|
23
23
|
* @returns {boolean}
|
24
24
|
*/
|
25
|
-
shouldComponentUpdate (props) {
|
25
|
+
shouldComponentUpdate (props, state) {
|
26
26
|
return (
|
27
|
-
super.shouldComponentUpdate(props) ||
|
27
|
+
super.shouldComponentUpdate(props, state) ||
|
28
28
|
(props.checkAnswers !== this.props.checkAnswers)
|
29
29
|
)
|
30
30
|
}
|
@@ -22,9 +22,9 @@ export default class ErrorSummarySprocket extends Sprocket {
|
|
22
22
|
* @param {SprocketProps} props
|
23
23
|
* @returns {boolean}
|
24
24
|
*/
|
25
|
-
shouldComponentUpdate (props) {
|
25
|
+
shouldComponentUpdate (props, state) {
|
26
26
|
return (
|
27
|
-
super.shouldComponentUpdate(props) ||
|
27
|
+
super.shouldComponentUpdate(props, state) ||
|
28
28
|
(props.errorSummary !== this.props.errorSummary)
|
29
29
|
)
|
30
30
|
}
|
@@ -10,6 +10,11 @@ import PropTypes from 'prop-types'
|
|
10
10
|
import classnames from 'classnames'
|
11
11
|
|
12
12
|
import Sprocket from 'shinkansen-sprockets/sprockets'
|
13
|
+
|
14
|
+
import {
|
15
|
+
DEFAULT_HANDLE_CHANGE
|
16
|
+
} from 'shinkansen-sprockets/common'
|
17
|
+
|
13
18
|
import Title from './title/index.jsx'
|
14
19
|
import Description from './description/index.jsx'
|
15
20
|
import ErrorMessage from './error-message/index.jsx'
|
@@ -28,9 +33,9 @@ export default class FieldsetSprocket extends Sprocket {
|
|
28
33
|
* @param {SprocketProps} props
|
29
34
|
* @returns {boolean}
|
30
35
|
*/
|
31
|
-
shouldComponentUpdate (props) {
|
36
|
+
shouldComponentUpdate (props, state) {
|
32
37
|
return (
|
33
|
-
super.shouldComponentUpdate(props) ||
|
38
|
+
super.shouldComponentUpdate(props, state) ||
|
34
39
|
(props.description !== this.props.description) ||
|
35
40
|
(props.errorMessage !== this.props.errorMessage)
|
36
41
|
)
|
@@ -74,7 +79,7 @@ export default class FieldsetSprocket extends Sprocket {
|
|
74
79
|
|
75
80
|
renderGroup () {
|
76
81
|
const {
|
77
|
-
onChange,
|
82
|
+
onChange = DEFAULT_HANDLE_CHANGE,
|
78
83
|
children
|
79
84
|
} = this.props
|
80
85
|
|
package/src/sprockets/index.jsx
CHANGED
@@ -7,13 +7,13 @@
|
|
7
7
|
import React, { Component } from 'react'
|
8
8
|
import PropTypes from 'prop-types'
|
9
9
|
|
10
|
+
import {
|
11
|
+
DEFAULT_HANDLE_CHANGE
|
12
|
+
} from 'shinkansen-sprockets/common'
|
13
|
+
|
10
14
|
import Title from 'shinkansen-sprockets/components/title'
|
11
15
|
import Group from 'shinkansen-sprockets/components/group'
|
12
16
|
|
13
|
-
function onChange () {
|
14
|
-
/* */
|
15
|
-
}
|
16
|
-
|
17
17
|
export default class Sprocket extends Component {
|
18
18
|
getClassName () {
|
19
19
|
return 'sprocket'
|
@@ -45,7 +45,7 @@ export default class Sprocket extends Component {
|
|
45
45
|
|
46
46
|
renderGroup () {
|
47
47
|
const {
|
48
|
-
onChange,
|
48
|
+
onChange = DEFAULT_HANDLE_CHANGE,
|
49
49
|
groupRef,
|
50
50
|
children
|
51
51
|
} = this.props
|
@@ -86,5 +86,5 @@ Sprocket.propTypes = {
|
|
86
86
|
}
|
87
87
|
|
88
88
|
Sprocket.defaultProps = {
|
89
|
-
onChange
|
89
|
+
onChange: DEFAULT_HANDLE_CHANGE
|
90
90
|
}
|