shinkansen-sprockets 1.1.95 → 1.1.98
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 +23 -23
- package/package.json +31 -29
- package/src/components/common/text-content/index.jsx +7 -7
- package/src/components/common/visually-hidden-text/index.cjs +17 -0
- package/src/{sprockets/check-answers/group/visually-hidden-text.jsx → components/common/visually-hidden-text/index.jsx} +1 -1
- package/src/index.d.cts +22 -24
- package/src/sprockets/check-answers/group/change-answer.jsx +1 -1
- package/tsconfig.json +11 -0
- package/src/sprockets/check-answers/group/visually-hidden-text.cjs +0 -13
package/babel.config.cjs
CHANGED
@@ -54,29 +54,29 @@ const plugins = [
|
|
54
54
|
/**
|
55
55
|
* Storybook
|
56
56
|
*/
|
57
|
-
'shinkansen-sprockets/sprockets/check-answers/group/answer-item': './src/sprockets/
|
58
|
-
'shinkansen-sprockets/sprockets/check-answers/group/answer-title': './src/sprockets/
|
59
|
-
'shinkansen-sprockets/sprockets/check-answers/group/answer-value': './src/sprockets/
|
60
|
-
'shinkansen-sprockets/sprockets/check-answers/group/change-answer': './src/sprockets/
|
61
|
-
'shinkansen-sprockets/sprockets/check-answers/group/visually-hidden-text': './src/sprockets/
|
62
|
-
'shinkansen-sprockets/sprockets/check-answers/group': './src/sprockets/check-answers/group/index.
|
63
|
-
'shinkansen-sprockets/sprockets/check-answers/title': './src/sprockets/check-answers/title/index.
|
64
|
-
'shinkansen-sprockets/sprockets/check-answers': './src/sprockets/check-answers/index.
|
65
|
-
'shinkansen-sprockets/sprockets/error-summary/group/error-item': './src/sprockets/
|
66
|
-
'shinkansen-sprockets/sprockets/error-summary/group': './src/sprockets/error-summary/group/index.
|
67
|
-
'shinkansen-sprockets/sprockets/error-summary/title': './src/sprockets/error-summary/title/index.
|
68
|
-
'shinkansen-sprockets/sprockets/error-summary': './src/sprockets/error-summary/index.
|
69
|
-
'shinkansen-sprockets/sprockets/fieldset/description': './src/sprockets/description/
|
70
|
-
'shinkansen-sprockets/sprockets/fieldset/error-message': './src/sprockets/error-message/
|
71
|
-
'shinkansen-sprockets/sprockets/fieldset/group': './src/sprockets/group/
|
72
|
-
'shinkansen-sprockets/sprockets/fieldset/title': './src/sprockets/title/
|
73
|
-
'shinkansen-sprockets/sprockets/fieldset': './src/sprockets/fieldset/index.
|
74
|
-
'shinkansen-sprockets/sprockets': './src/sprockets/index.
|
75
|
-
'shinkansen-sprockets/components/common/text-content': './src/components/common/text-content/index.
|
76
|
-
'shinkansen-sprockets/components/description': './src/components/description/index.
|
77
|
-
'shinkansen-sprockets/components/error-message': './src/components/error-message/index.
|
78
|
-
'shinkansen-sprockets/components/title': './src/components/title/index.
|
79
|
-
'shinkansen-sprockets/components/group': './src/components/group/index.
|
57
|
+
'shinkansen-sprockets/sprockets/check-answers/group/answer-item': './src/sprockets/check-answers/group/answer-item.jsx',
|
58
|
+
'shinkansen-sprockets/sprockets/check-answers/group/answer-title': './src/sprockets/check-answers/group/answer-title.jsx',
|
59
|
+
'shinkansen-sprockets/sprockets/check-answers/group/answer-value': './src/sprockets/check-answers/group/answer-value.jsx',
|
60
|
+
'shinkansen-sprockets/sprockets/check-answers/group/change-answer': './src/sprockets/check-answers/group/change-answer.jsx',
|
61
|
+
'shinkansen-sprockets/sprockets/check-answers/group/visually-hidden-text': './src/sprockets/check-answers/group/visually-hidden-text.jsx',
|
62
|
+
'shinkansen-sprockets/sprockets/check-answers/group': './src/sprockets/check-answers/group/index.jsx',
|
63
|
+
'shinkansen-sprockets/sprockets/check-answers/title': './src/sprockets/check-answers/title/index.jsx',
|
64
|
+
'shinkansen-sprockets/sprockets/check-answers': './src/sprockets/check-answers/index.jsx',
|
65
|
+
'shinkansen-sprockets/sprockets/error-summary/group/error-item': './src/sprockets/error-summary/group/error-item.jsx',
|
66
|
+
'shinkansen-sprockets/sprockets/error-summary/group': './src/sprockets/error-summary/group/index.jsx',
|
67
|
+
'shinkansen-sprockets/sprockets/error-summary/title': './src/sprockets/error-summary/title/index.jsx',
|
68
|
+
'shinkansen-sprockets/sprockets/error-summary': './src/sprockets/error-summary/index.jsx',
|
69
|
+
'shinkansen-sprockets/sprockets/fieldset/description': './src/sprockets/fieldset/description/index.jsx',
|
70
|
+
'shinkansen-sprockets/sprockets/fieldset/error-message': './src/sprockets/fieldset/error-message/index.jsx',
|
71
|
+
'shinkansen-sprockets/sprockets/fieldset/group': './src/sprockets/fieldset/group/index.jsx',
|
72
|
+
'shinkansen-sprockets/sprockets/fieldset/title': './src/sprockets/fieldset/title/index.jsx',
|
73
|
+
'shinkansen-sprockets/sprockets/fieldset': './src/sprockets/fieldset/index.jsx',
|
74
|
+
'shinkansen-sprockets/sprockets': './src/sprockets/index.jsx',
|
75
|
+
'shinkansen-sprockets/components/common/text-content': './src/components/common/text-content/index.jsx',
|
76
|
+
'shinkansen-sprockets/components/description': './src/components/description/index.jsx',
|
77
|
+
'shinkansen-sprockets/components/error-message': './src/components/error-message/index.jsx',
|
78
|
+
'shinkansen-sprockets/components/title': './src/components/title/index.jsx',
|
79
|
+
'shinkansen-sprockets/components/group': './src/components/group/index.jsx',
|
80
80
|
'#stories': './stories'
|
81
81
|
}
|
82
82
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-sprockets",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.98",
|
4
4
|
"description": "Shinkansen Sprockets",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -12,14 +12,15 @@
|
|
12
12
|
],
|
13
13
|
"main": "./src/index.cjs",
|
14
14
|
"type": "module",
|
15
|
+
"types": "./src/index.d.cts",
|
15
16
|
"author": {
|
16
17
|
"name": "Jonathan Perry for Modern Poacher Limited",
|
17
18
|
"email": "modernpoacher@modernpoacher.com",
|
18
|
-
"url": "
|
19
|
+
"url": "https://modernpoacher.com"
|
19
20
|
},
|
20
21
|
"license": "MIT",
|
21
22
|
"engines": {
|
22
|
-
"node": ">=18.
|
23
|
+
"node": ">=18.12.0"
|
23
24
|
},
|
24
25
|
"repository": {
|
25
26
|
"type": "git",
|
@@ -60,21 +61,21 @@
|
|
60
61
|
"@babel/register": "^7.22.15",
|
61
62
|
"@modernpoacher/design-system": "1.0.72",
|
62
63
|
"@modernpoacher/hooks": "^1.0.434",
|
63
|
-
"@sequencemedia/gulp": "^1.1.
|
64
|
-
"@sequencemedia/gulp-clean-css": "^1.0.
|
65
|
-
"@sequencemedia/gulp-css-purge": "^1.1.
|
66
|
-
"@sequencemedia/gulp-debug": "^1.0.
|
67
|
-
"@sequencemedia/gulp-postcss": "^1.0.
|
68
|
-
"@sequencemedia/gulp-sass": "^1.0.
|
69
|
-
"@sequencemedia/gulp-sourcemaps": "^1.0.
|
70
|
-
"@storybook/addon-actions": "^7.4.
|
71
|
-
"@storybook/addon-essentials": "^7.4.
|
72
|
-
"@storybook/addon-links": "^7.4.
|
73
|
-
"@storybook/react": "^7.4.
|
74
|
-
"@storybook/react-webpack5": "^7.4.
|
64
|
+
"@sequencemedia/gulp": "^1.1.76",
|
65
|
+
"@sequencemedia/gulp-clean-css": "^1.0.34",
|
66
|
+
"@sequencemedia/gulp-css-purge": "^1.1.27",
|
67
|
+
"@sequencemedia/gulp-debug": "^1.0.38",
|
68
|
+
"@sequencemedia/gulp-postcss": "^1.0.37",
|
69
|
+
"@sequencemedia/gulp-sass": "^1.0.33",
|
70
|
+
"@sequencemedia/gulp-sourcemaps": "^1.0.34",
|
71
|
+
"@storybook/addon-actions": "^7.4.1",
|
72
|
+
"@storybook/addon-essentials": "^7.4.1",
|
73
|
+
"@storybook/addon-links": "^7.4.1",
|
74
|
+
"@storybook/react": "^7.4.1",
|
75
|
+
"@storybook/react-webpack5": "^7.4.1",
|
75
76
|
"@types/react": "^18.2.21",
|
76
|
-
"@typescript-eslint/eslint-plugin": "
|
77
|
-
"@typescript-eslint/parser": "
|
77
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
78
|
+
"@typescript-eslint/parser": "^6.7.0",
|
78
79
|
"autoprefixer": "^10.4.15",
|
79
80
|
"babel-plugin-module-resolver": "^5.0.0",
|
80
81
|
"core-js": "^3.32.2",
|
@@ -83,7 +84,7 @@
|
|
83
84
|
"del": "^7.1.0",
|
84
85
|
"eslint": "^8.49.0",
|
85
86
|
"eslint-config-standard": "^17.1.0",
|
86
|
-
"eslint-config-standard-with-typescript": "
|
87
|
+
"eslint-config-standard-with-typescript": "^39.0.0",
|
87
88
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
88
89
|
"eslint-plugin-react": "^7.33.2",
|
89
90
|
"glob-all": "^3.3.1",
|
@@ -102,7 +103,7 @@
|
|
102
103
|
"react-test-renderer": "^18.2.0",
|
103
104
|
"regenerator-runtime": "^0.14.0",
|
104
105
|
"sass": "^1.66.1",
|
105
|
-
"storybook": "^7.4.
|
106
|
+
"storybook": "^7.4.1",
|
106
107
|
"vinyl-paths": "^5.0.0"
|
107
108
|
},
|
108
109
|
"imports": {
|
@@ -117,21 +118,22 @@
|
|
117
118
|
"require": "./src/index.cjs",
|
118
119
|
"import": "./src/index.mjs"
|
119
120
|
},
|
120
|
-
"./sprockets/check-answers/group/*": "./src/
|
121
|
-
"./sprockets/check-answers/group": "./src/
|
122
|
-
"./sprockets/check-answers/title": "./src/
|
121
|
+
"./sprockets/check-answers/group/*": "./src/sprockets/check-answers/group/*.cjs",
|
122
|
+
"./sprockets/check-answers/group": "./src/sprockets/check-answers/group/index.cjs",
|
123
|
+
"./sprockets/check-answers/title": "./src/sprockets/check-answers/title/index.cjs",
|
123
124
|
"./sprockets/check-answers": "./src/sprockets/check-answers/index.cjs",
|
124
|
-
"./sprockets/error-summary/group/*": "./src/
|
125
|
-
"./sprockets/error-summary/group": "./src/
|
126
|
-
"./sprockets/error-summary/title": "./src/
|
125
|
+
"./sprockets/error-summary/group/*": "./src/sprockets/error-summary/group/*.cjs",
|
126
|
+
"./sprockets/error-summary/group": "./src/sprockets/error-summary/group/index.cjs",
|
127
|
+
"./sprockets/error-summary/title": "./src/sprockets/error-summary/title/index.cjs",
|
127
128
|
"./sprockets/error-summary": "./src/sprockets/error-summary/index.cjs",
|
128
|
-
"./sprockets/fieldset/description": "./src/
|
129
|
-
"./sprockets/fieldset/error-message": "./src/
|
130
|
-
"./sprockets/fieldset/group": "./src/
|
131
|
-
"./sprockets/fieldset/title": "./src/
|
129
|
+
"./sprockets/fieldset/description": "./src/sprockets/fieldset/description/index.cjs",
|
130
|
+
"./sprockets/fieldset/error-message": "./src/sprockets/fieldset/error-message/index.cjs",
|
131
|
+
"./sprockets/fieldset/group": "./src/sprockets/fieldset/group/index.cjs",
|
132
|
+
"./sprockets/fieldset/title": "./src/sprockets/fieldset/title/index.cjs",
|
132
133
|
"./sprockets/fieldset": "./src/sprockets/fieldset/index.cjs",
|
133
134
|
"./sprockets": "./src/sprockets/index.cjs",
|
134
135
|
"./components/common/text-content": "./src/components/common/text-content/index.cjs",
|
136
|
+
"./components/common/visually-hidden-text": "./src/components/common/visually-hidden-text/index.cjs",
|
135
137
|
"./components/description": "./src/components/description/index.cjs",
|
136
138
|
"./components/error-message": "./src/components/error-message/index.cjs",
|
137
139
|
"./components/group": "./src/components/group/index.cjs",
|
@@ -11,14 +11,14 @@ import PropTypes from 'prop-types'
|
|
11
11
|
* @param {TextContentProps}
|
12
12
|
* @returns {React.JSX.Element}
|
13
13
|
*/
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
export default function TextContent ({ textContent }) {
|
15
|
+
return (
|
16
|
+
<span className='text-content'>
|
17
|
+
{textContent}
|
18
|
+
</span>
|
19
|
+
)
|
20
|
+
}
|
19
21
|
|
20
22
|
TextContent.propTypes = {
|
21
23
|
textContent: PropTypes.string.isRequired
|
22
24
|
}
|
23
|
-
|
24
|
-
export default TextContent
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require('@babel/register')({
|
2
|
+
ignore: [
|
3
|
+
/node_modules\/(?!shinkansen|@modernpoacher)/
|
4
|
+
]
|
5
|
+
})
|
6
|
+
|
7
|
+
const debug = require('debug')
|
8
|
+
|
9
|
+
const log = debug('shinkansen-sprockets/components/common/visually-hidden-text')
|
10
|
+
|
11
|
+
log('`shinkansen` is awake')
|
12
|
+
|
13
|
+
const {
|
14
|
+
default: component
|
15
|
+
} = require('./index.jsx')
|
16
|
+
|
17
|
+
module.exports = component
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
import debug from 'debug'
|
4
4
|
|
5
|
-
const log = debug('shinkansen-sprockets/
|
5
|
+
const log = debug('shinkansen-sprockets/components/common/visually-hidden-text')
|
6
6
|
|
7
7
|
export default function VisuallyHiddenText ({ visuallyHiddenText }) {
|
8
8
|
log('VisuallyHiddenText')
|
package/src/index.d.cts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
declare namespace SprocketsTypes {
|
2
2
|
export type OnChangeType = () => void
|
3
3
|
|
4
|
-
export
|
4
|
+
export interface AnswerDefinitionType {
|
5
5
|
answer: {
|
6
6
|
title: string
|
7
7
|
value: string | string[]
|
@@ -13,41 +13,39 @@ declare namespace SprocketsTypes {
|
|
13
13
|
}
|
14
14
|
}
|
15
15
|
|
16
|
-
export
|
17
|
-
type: string
|
18
|
-
uri: string
|
16
|
+
export interface ErrorDefinitionType {
|
17
|
+
type: string
|
18
|
+
uri: string
|
19
19
|
params: {
|
20
20
|
expectedType: string
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
export
|
25
|
-
|
26
|
-
export type FieldChangeType = {
|
27
|
-
text: string,
|
24
|
+
export interface FieldChangeType {
|
25
|
+
text: string
|
28
26
|
href: string
|
29
27
|
}
|
30
28
|
|
31
|
-
export
|
32
|
-
text: string
|
29
|
+
export interface FieldErrorType {
|
30
|
+
text: string
|
33
31
|
href: string
|
34
32
|
}
|
35
33
|
}
|
36
34
|
|
37
35
|
declare module 'shinkansen-sprockets/components/common/text-content' {
|
38
|
-
import React from 'react'
|
36
|
+
import type React from 'react'
|
39
37
|
|
40
|
-
export
|
38
|
+
export interface TextContentProps {
|
41
39
|
textContent: string
|
42
40
|
}
|
43
41
|
|
44
|
-
export default function TextContent(props: TextContentProps): React.JSX.Element
|
42
|
+
export default function TextContent (props: TextContentProps): React.JSX.Element
|
45
43
|
}
|
46
44
|
|
47
45
|
declare module 'shinkansen-sprockets/components/description' {
|
48
46
|
import React from 'react'
|
49
47
|
|
50
|
-
export
|
48
|
+
export interface DescriptionProps {
|
51
49
|
description: string
|
52
50
|
}
|
53
51
|
|
@@ -57,7 +55,7 @@ declare module 'shinkansen-sprockets/components/description' {
|
|
57
55
|
declare module 'shinkansen-sprockets/components/error-message' {
|
58
56
|
import React from 'react'
|
59
57
|
|
60
|
-
export
|
58
|
+
export interface ErrorMessageProps {
|
61
59
|
errorMessage: string
|
62
60
|
}
|
63
61
|
|
@@ -67,7 +65,7 @@ declare module 'shinkansen-sprockets/components/error-message' {
|
|
67
65
|
declare module 'shinkansen-sprockets/components/title' {
|
68
66
|
import React from 'react'
|
69
67
|
|
70
|
-
export
|
68
|
+
export interface TitleProps {
|
71
69
|
title: string
|
72
70
|
}
|
73
71
|
|
@@ -77,9 +75,9 @@ declare module 'shinkansen-sprockets/components/title' {
|
|
77
75
|
declare module 'shinkansen-sprockets/components/group' {
|
78
76
|
import React from 'react'
|
79
77
|
|
80
|
-
export
|
81
|
-
onChange: SprocketsTypes.OnChangeType
|
82
|
-
groupRef: object
|
78
|
+
export interface GroupProps {
|
79
|
+
onChange: SprocketsTypes.OnChangeType
|
80
|
+
groupRef: object
|
83
81
|
children: React.JSX.Element | React.JSX.Element[]
|
84
82
|
}
|
85
83
|
|
@@ -155,10 +153,10 @@ declare module 'shinkansen-sprockets/sprockets/fieldset' {
|
|
155
153
|
declare module 'shinkansen-sprockets/sprockets' {
|
156
154
|
import React from 'react'
|
157
155
|
|
158
|
-
export
|
159
|
-
title: string
|
160
|
-
onChange: SprocketsTypes.OnChangeType
|
161
|
-
groupRef: object
|
156
|
+
export interface SprocketProps {
|
157
|
+
title: string
|
158
|
+
onChange: SprocketsTypes.OnChangeType
|
159
|
+
groupRef: object
|
162
160
|
children: React.JSX.Element | React.JSX.Element[]
|
163
161
|
}
|
164
162
|
|
@@ -178,7 +176,7 @@ declare module 'shinkansen-sprockets/transformers/error-summary' {
|
|
178
176
|
}
|
179
177
|
|
180
178
|
declare module 'shinkansen-sprockets/transformers/common' {
|
181
|
-
export function getKey(href: string, text: string, index: number): string
|
179
|
+
export function getKey (href: string, text: string, index: number): string
|
182
180
|
}
|
183
181
|
|
184
182
|
declare module 'shinkansen-sprockets' {
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
|
9
9
|
import TextContent from 'shinkansen-sprockets/components/common/text-content'
|
10
10
|
|
11
|
-
import VisuallyHiddenText from '
|
11
|
+
import VisuallyHiddenText from 'shinkansen-sprockets/components/common/visually-hidden-text'
|
12
12
|
|
13
13
|
const log = debug('shinkansen-sprockets/sprockets/check-answers/group/change-answer')
|
14
14
|
|
package/tsconfig.json
ADDED
@@ -1,13 +0,0 @@
|
|
1
|
-
require('@babel/register')({
|
2
|
-
ignore: [
|
3
|
-
/node_modules\/(?!shinkansen|@modernpoacher)/
|
4
|
-
]
|
5
|
-
})
|
6
|
-
|
7
|
-
const debug = require('debug')
|
8
|
-
|
9
|
-
const log = debug('shinkansen-sprockets/sprockets/check-answers/group/visually-hidden-text')
|
10
|
-
|
11
|
-
log('`shinkansen` is awake')
|
12
|
-
|
13
|
-
module.exports = require('./visually-hidden-text.jsx')
|