shinkansen-sprockets 2.1.15 → 2.1.17
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/index.d.mts +13 -12
- package/package.json +13 -13
- package/src/js/components/index.cjs +20 -4
- package/src/js/sprockets/check-answers/group/answer-title.jsx +1 -1
- package/src/js/sprockets/check-answers/group/answer-value.jsx +1 -1
- package/src/js/sprockets/check-answers/group/change-answer.jsx +1 -1
- package/src/js/sprockets/check-answers/group/index.jsx +2 -2
- package/src/js/sprockets/error-summary/group/index.jsx +3 -1
- package/src/js/super/components/index.cjs +20 -4
- package/src/sass/_sprockets.scss +3 -6
- package/src/sass/sprockets/_check-answers.scss +1 -2
- package/src/sass/sprockets/_error-summary.scss +1 -2
- package/src/sass/sprockets/_error.scss +2 -4
- package/.publish/README.md +0 -20
package/index.d.mts
CHANGED
@@ -38,9 +38,10 @@ declare global {
|
|
38
38
|
export namespace Super {
|
39
39
|
export namespace Sprockets {
|
40
40
|
export interface SprocketProps extends React.PropsWithChildren {
|
41
|
-
|
42
|
-
groupRe?: React.RefObject<any> // eslint-disable-line @typescript-eslint/no-explicit-any -- Simplicity
|
41
|
+
groupRef?: React.RefObject<any> // eslint-disable-line @typescript-eslint/no-explicit-any -- Simplicity
|
43
42
|
}
|
43
|
+
|
44
|
+
export type SprocketState = Record<PropertyKey, unknown>
|
44
45
|
}
|
45
46
|
|
46
47
|
export namespace Components {
|
@@ -61,11 +62,9 @@ declare global {
|
|
61
62
|
}
|
62
63
|
|
63
64
|
export namespace Group {
|
64
|
-
export
|
65
|
-
groupRef?: React.RefObject<any> // eslint-disable-line @typescript-eslint/no-explicit-any -- Simplicity
|
66
|
-
}
|
65
|
+
export type GroupProps = Sprockets.SprocketProps
|
67
66
|
|
68
|
-
export type GroupState =
|
67
|
+
export type GroupState = Sprockets.SprocketState
|
69
68
|
}
|
70
69
|
|
71
70
|
export namespace Title {
|
@@ -115,8 +114,10 @@ declare global {
|
|
115
114
|
export namespace Sprockets {
|
116
115
|
export type SprocketProps = Super.Sprockets.SprocketProps
|
117
116
|
|
117
|
+
export type SprocketState = Super.Sprockets.SprocketState
|
118
|
+
|
118
119
|
export namespace CheckAnswers {
|
119
|
-
export interface CheckAnswersProps extends
|
120
|
+
export interface CheckAnswersProps extends SprocketProps {
|
120
121
|
checkAnswers?: AnswerDefinitionType[]
|
121
122
|
}
|
122
123
|
|
@@ -136,7 +137,7 @@ declare global {
|
|
136
137
|
}
|
137
138
|
|
138
139
|
export namespace ErrorSummary {
|
139
|
-
export interface ErrorSummaryProps extends
|
140
|
+
export interface ErrorSummaryProps extends SprocketProps {
|
140
141
|
errorSummary?: ErrorDefinitionType[]
|
141
142
|
}
|
142
143
|
|
@@ -156,13 +157,13 @@ declare global {
|
|
156
157
|
}
|
157
158
|
|
158
159
|
export namespace Fieldset {
|
159
|
-
export
|
160
|
-
|
161
|
-
|
162
|
-
}
|
160
|
+
export type FieldsetProps = SprocketProps
|
161
|
+
|
162
|
+
export type FieldsetState = SprocketState
|
163
163
|
|
164
164
|
export namespace Group {
|
165
165
|
export type FieldsetProps = Super.Components.Group.GroupProps
|
166
|
+
|
166
167
|
export type FieldsetState = Super.Components.Group.GroupState
|
167
168
|
}
|
168
169
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-sprockets",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.17",
|
4
4
|
"description": "Shinkansen Sprockets",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -63,16 +63,16 @@
|
|
63
63
|
"@babel/register": "^7.25.9",
|
64
64
|
"@modernpoacher/design-system": "2.0.2",
|
65
65
|
"@sequencemedia/eslint-config-standard": "^0.2.47",
|
66
|
-
"@sequencemedia/eslint-config-typescript": "^0.1.
|
67
|
-
"@storybook/addon-actions": "^8.6.
|
68
|
-
"@storybook/addon-essentials": "^8.6.
|
69
|
-
"@storybook/addon-links": "^8.6.
|
66
|
+
"@sequencemedia/eslint-config-typescript": "^0.1.69",
|
67
|
+
"@storybook/addon-actions": "^8.6.11",
|
68
|
+
"@storybook/addon-essentials": "^8.6.11",
|
69
|
+
"@storybook/addon-links": "^8.6.11",
|
70
70
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
71
|
-
"@storybook/manager-api": "^8.6.
|
72
|
-
"@storybook/react": "^8.6.
|
73
|
-
"@storybook/react-webpack5": "^8.6.
|
74
|
-
"@storybook/test": "^8.6.
|
75
|
-
"@storybook/theming": "^8.6.
|
71
|
+
"@storybook/manager-api": "^8.6.11",
|
72
|
+
"@storybook/react": "^8.6.11",
|
73
|
+
"@storybook/react-webpack5": "^8.6.11",
|
74
|
+
"@storybook/test": "^8.6.11",
|
75
|
+
"@storybook/theming": "^8.6.11",
|
76
76
|
"@testing-library/jest-dom": "^6.6.3",
|
77
77
|
"@testing-library/react": "^16.2.0",
|
78
78
|
"@types/babel__register": "^7.17.3",
|
@@ -108,14 +108,14 @@
|
|
108
108
|
"prettier": "^3.5.3",
|
109
109
|
"prop-types": "^15.8.1",
|
110
110
|
"react": "^19.0.0",
|
111
|
-
"react-component-instance": "^0.0.
|
112
|
-
"react-component-snapshot": "^0.0.
|
111
|
+
"react-component-instance": "^0.0.16",
|
112
|
+
"react-component-snapshot": "^0.0.17",
|
113
113
|
"react-dom": "^19.0.0",
|
114
114
|
"react-router": "^7.4.0",
|
115
115
|
"remove-files-webpack-plugin": "^1.5.0",
|
116
116
|
"sass": "^1.86.0",
|
117
117
|
"sass-loader": "^16.0.5",
|
118
|
-
"storybook": "^8.6.
|
118
|
+
"storybook": "^8.6.11",
|
119
119
|
"stylelint": "^16.17.0",
|
120
120
|
"stylelint-config-recommended-scss": "^14.1.0",
|
121
121
|
"stylelint-scss": "^6.11.1",
|
@@ -10,7 +10,23 @@ const log = debug('shinkansen-sprockets/components')
|
|
10
10
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
const {
|
14
|
+
default: Description
|
15
|
+
} = require('./description/index.jsx')
|
16
|
+
|
17
|
+
const {
|
18
|
+
default: ErrorMessage
|
19
|
+
} = require('./error-message/index.jsx')
|
20
|
+
|
21
|
+
const {
|
22
|
+
default: Group
|
23
|
+
} = require('./group/index.jsx')
|
24
|
+
|
25
|
+
const {
|
26
|
+
default: Title
|
27
|
+
} = require('./title/index.jsx')
|
28
|
+
|
29
|
+
module.exports.Description = Description
|
30
|
+
module.exports.ErrorMessage = ErrorMessage
|
31
|
+
module.exports.Group = Group
|
32
|
+
module.exports.Title = Title
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
|
4
4
|
/**
|
5
|
-
* @param {{ answer: { title: string } }}
|
5
|
+
* @param {{ answer: { title: string } }} props
|
6
6
|
* @returns {React.JSX.Element}
|
7
7
|
*/
|
8
8
|
export default function AnswerTitle ({ answer: { title } }) {
|
@@ -42,7 +42,7 @@ function getAnswerValue (value) {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
/**
|
45
|
-
* @param {{ answer: { value: string | string[] } }}
|
45
|
+
* @param {{ answer: { value: string | string[] } }} props
|
46
46
|
* @returns {React.JSX.Element}
|
47
47
|
*/
|
48
48
|
export default function AnswerValue ({ answer: { value } }) {
|
@@ -53,7 +53,7 @@ LinkText.propTypes = {
|
|
53
53
|
}
|
54
54
|
|
55
55
|
/**
|
56
|
-
* @param {{ changeAnswer: { href: string, text: string, visuallyHiddenText?: string } }}
|
56
|
+
* @param {{ changeAnswer: { href: string, text: string, visuallyHiddenText?: string } }} props
|
57
57
|
* @returns {React.JSX.Element}
|
58
58
|
*/
|
59
59
|
export default function ChangeAnswer ({ changeAnswer: { href, text, visuallyHiddenText } }) {
|
@@ -38,7 +38,7 @@ const log = debug('shinkansen-sprockets/components/group/check-answers')
|
|
38
38
|
* @param {number} index
|
39
39
|
* @returns {React.JSX.Element}
|
40
40
|
*/
|
41
|
-
function render ({ params: { answer, changeAnswer: { href, text,
|
41
|
+
function render ({ params: { answer, changeAnswer: { href, text, visuallyHiddenText } } }, index) {
|
42
42
|
log('render')
|
43
43
|
|
44
44
|
return (
|
@@ -52,7 +52,7 @@ function render ({ params: { answer, changeAnswer: { href, text, ...changeAnswer
|
|
52
52
|
/>
|
53
53
|
|
54
54
|
<ChangeAnswer
|
55
|
-
changeAnswer={{
|
55
|
+
changeAnswer={{ href, text, visuallyHiddenText }}
|
56
56
|
/>
|
57
57
|
</div>
|
58
58
|
)
|
@@ -10,7 +10,23 @@ const log = debug('shinkansen-sprockets/super/components')
|
|
10
10
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
const {
|
14
|
+
default: Description
|
15
|
+
} = require('./description/index.jsx')
|
16
|
+
|
17
|
+
const {
|
18
|
+
default: ErrorMessage
|
19
|
+
} = require('./error-message/index.jsx')
|
20
|
+
|
21
|
+
const {
|
22
|
+
default: Group
|
23
|
+
} = require('./group/index.jsx')
|
24
|
+
|
25
|
+
const {
|
26
|
+
default: Title
|
27
|
+
} = require('./title/index.jsx')
|
28
|
+
|
29
|
+
module.exports.Description = Description
|
30
|
+
module.exports.ErrorMessage = ErrorMessage
|
31
|
+
module.exports.Group = Group
|
32
|
+
module.exports.Title = Title
|
package/src/sass/_sprockets.scss
CHANGED
@@ -31,8 +31,7 @@
|
|
31
31
|
legend {
|
32
32
|
@include typography.heading-m;
|
33
33
|
|
34
|
-
|
35
|
-
& {
|
34
|
+
& /* stylelint-disable-line no-duplicate-selectors */ {
|
36
35
|
padding: 0;
|
37
36
|
margin-top: 0;
|
38
37
|
}
|
@@ -47,8 +46,7 @@
|
|
47
46
|
.description {
|
48
47
|
@include typography.secondary-text;
|
49
48
|
|
50
|
-
|
51
|
-
& {
|
49
|
+
& /* stylelint-disable-line no-duplicate-selectors */ {
|
52
50
|
display: block;
|
53
51
|
padding: 0;
|
54
52
|
margin: 0 0 0.25rem 0;
|
@@ -58,8 +56,7 @@
|
|
58
56
|
.error-message {
|
59
57
|
@include typography.error-standard;
|
60
58
|
|
61
|
-
|
62
|
-
& {
|
59
|
+
& /* stylelint-disable-line no-duplicate-selectors */ {
|
63
60
|
display: block;
|
64
61
|
padding: 0;
|
65
62
|
margin: 0 0 0.25rem 0;
|
@@ -18,13 +18,11 @@
|
|
18
18
|
&.checkbox {
|
19
19
|
padding-left: 4rem;
|
20
20
|
|
21
|
-
|
22
|
-
input {
|
21
|
+
input /* stylelint-disable-line no-descending-specificity */ {
|
23
22
|
left: 1.5rem;
|
24
23
|
}
|
25
24
|
|
26
|
-
|
27
|
-
label:before {
|
25
|
+
label:before /* stylelint-disable-line no-descending-specificity */ {
|
28
26
|
left: 1rem;
|
29
27
|
|
30
28
|
border: 2px solid palette.$error-standard;
|
package/.publish/README.md
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# Publish to NPM
|
2
|
-
|
3
|
-
For CircleCI or the shell
|
4
|
-
|
5
|
-
If you need an _authentication token_ to publish then you should resolve that before executing this script
|
6
|
-
|
7
|
-
```bash
|
8
|
-
echo ".publish/publish.sh" >> .npmignore
|
9
|
-
git clone https://github.com/modernpoacher/publish.git .publish
|
10
|
-
.publish/publish.sh
|
11
|
-
```
|
12
|
-
|
13
|
-
A Gist with the same content as `publish.sh` may need an additional step
|
14
|
-
|
15
|
-
```bash
|
16
|
-
echo ".publish/publish.sh" >> .npmignore
|
17
|
-
git clone https://gist.github.com/efd85e2b8da1ee830dd637f134994a9d.git .publish
|
18
|
-
chmod +x .publish/publish.sh
|
19
|
-
.publish/publish.sh
|
20
|
-
```
|