shinkansen-sprockets 1.2.20 → 1.3.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/babel.config.cjs +2 -1
- package/eslint.config.mjs +16 -3
- package/index.d.mts +84 -59
- package/package.json +29 -7
- package/src/components/common/text-content/index.cjs +5 -2
- package/src/components/common/text-content/index.jsx +1 -1
- package/src/components/common/visually-hidden-text/index.cjs +5 -2
- package/src/components/common/visually-hidden-text/index.jsx +1 -1
- package/src/components/description/index.cjs +5 -2
- package/src/components/description/index.d.mts +2 -11
- package/src/components/description/index.jsx +2 -44
- package/src/components/error-message/index.cjs +5 -2
- package/src/components/error-message/index.d.mts +2 -20
- package/src/components/error-message/index.jsx +2 -118
- package/src/components/group/index.cjs +5 -2
- package/src/components/group/index.d.mts +2 -12
- package/src/components/group/index.jsx +2 -49
- package/src/components/index.cjs +1 -1
- package/src/components/index.d.cts +4 -4
- package/src/components/index.d.mts +4 -4
- package/src/components/index.mjs +4 -4
- package/src/components/title/index.cjs +5 -2
- package/src/components/title/index.d.mts +2 -17
- package/src/components/title/index.jsx +2 -70
- package/src/sprockets/check-answers/group/change-answer.jsx +4 -4
- package/src/sprockets/check-answers/group/index.cjs +5 -2
- package/src/sprockets/check-answers/group/index.d.mts +3 -3
- package/src/sprockets/check-answers/group/index.jsx +9 -9
- package/src/sprockets/check-answers/index.cjs +5 -2
- package/src/sprockets/check-answers/index.d.mts +1 -1
- package/src/sprockets/check-answers/index.jsx +3 -3
- package/src/sprockets/check-answers/title/index.cjs +5 -2
- package/src/sprockets/check-answers/title/index.d.mts +2 -2
- package/src/sprockets/check-answers/title/index.jsx +5 -4
- package/src/sprockets/error-summary/group/index.cjs +5 -2
- package/src/sprockets/error-summary/group/index.d.mts +3 -3
- package/src/sprockets/error-summary/group/index.jsx +9 -9
- package/src/sprockets/error-summary/index.cjs +5 -2
- package/src/sprockets/error-summary/index.d.mts +1 -1
- package/src/sprockets/error-summary/index.jsx +3 -3
- package/src/sprockets/error-summary/title/index.cjs +5 -2
- package/src/sprockets/error-summary/title/index.d.mts +2 -2
- package/src/sprockets/error-summary/title/index.jsx +5 -4
- package/src/sprockets/fieldset/description/index.cjs +5 -2
- package/src/sprockets/fieldset/description/index.d.mts +1 -1
- package/src/sprockets/fieldset/description/index.jsx +2 -2
- package/src/sprockets/fieldset/error-message/index.cjs +5 -2
- package/src/sprockets/fieldset/error-message/index.d.mts +1 -1
- package/src/sprockets/fieldset/error-message/index.jsx +2 -2
- package/src/sprockets/fieldset/group/index.cjs +5 -2
- package/src/sprockets/fieldset/group/index.d.mts +3 -3
- package/src/sprockets/fieldset/group/index.jsx +6 -6
- package/src/sprockets/fieldset/index.cjs +5 -2
- package/src/sprockets/fieldset/index.d.mts +1 -1
- package/src/sprockets/fieldset/index.jsx +3 -3
- package/src/sprockets/fieldset/title/index.cjs +5 -2
- package/src/sprockets/fieldset/title/index.d.mts +2 -2
- package/src/sprockets/fieldset/title/index.jsx +5 -4
- package/src/sprockets/index.cjs +5 -2
- package/src/sprockets/index.d.mts +2 -15
- package/src/sprockets/index.jsx +2 -76
- package/src/super/components/description/index.cjs +20 -0
- package/src/super/components/description/index.d.cts +2 -0
- package/src/super/components/description/index.d.mts +18 -0
- package/src/super/components/description/index.jsx +47 -0
- package/src/super/components/error-message/index.cjs +20 -0
- package/src/super/components/error-message/index.d.cts +2 -0
- package/src/super/components/error-message/index.d.mts +27 -0
- package/src/super/components/error-message/index.jsx +121 -0
- package/src/super/components/group/index.cjs +20 -0
- package/src/super/components/group/index.d.cts +2 -0
- package/src/super/components/group/index.d.mts +19 -0
- package/src/super/components/group/index.jsx +52 -0
- package/src/super/components/index.cjs +16 -0
- package/src/super/components/index.d.cts +4 -0
- package/src/super/components/index.d.mts +4 -0
- package/src/super/components/index.mjs +10 -0
- package/src/super/components/title/index.cjs +20 -0
- package/src/super/components/title/index.d.cts +2 -0
- package/src/super/components/title/index.d.mts +24 -0
- package/src/super/components/title/index.jsx +73 -0
- package/src/super/sprockets/index.cjs +20 -0
- package/src/super/sprockets/index.d.cts +2 -0
- package/src/super/sprockets/index.d.mts +22 -0
- package/src/super/sprockets/index.jsx +79 -0
- package/src/common/index.d.mts +0 -1
- package/src/common/index.mjs +0 -1
@@ -1,16 +1,6 @@
|
|
1
1
|
declare module '#sprockets/components/group' {
|
2
|
-
|
3
|
-
|
4
|
-
export type GroupProps = SprocketsTypes.Components.Group.GroupProps
|
5
|
-
export type GroupState = SprocketsTypes.Components.Group.GroupState
|
6
|
-
|
7
|
-
export default class Group<P extends GroupProps, S extends GroupState> extends React.Component<P, S> {
|
8
|
-
static propTypes: object
|
9
|
-
|
10
|
-
getClassName (): string
|
11
|
-
|
12
|
-
shouldComponentUpdate (props: GroupProps, state: GroupState): boolean
|
13
|
-
}
|
2
|
+
export { default } from '#sprockets/super/components/group'
|
3
|
+
export * from '#sprockets/super/components/group'
|
14
4
|
}
|
15
5
|
|
16
6
|
declare module 'shinkansen-sprockets/components/group' {
|
@@ -1,52 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* Group component
|
3
3
|
*/
|
4
4
|
|
5
|
-
|
6
|
-
* Group component
|
7
|
-
*/
|
8
|
-
import React, { Component } from 'react'
|
9
|
-
import PropTypes from 'prop-types'
|
10
|
-
|
11
|
-
export default class Group extends Component {
|
12
|
-
getClassName () {
|
13
|
-
return 'group'
|
14
|
-
}
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @param {GroupProps} props
|
18
|
-
* @returns {boolean}
|
19
|
-
*/
|
20
|
-
shouldComponentUpdate (props) {
|
21
|
-
return (
|
22
|
-
(props.children !== this.props.children)
|
23
|
-
)
|
24
|
-
}
|
25
|
-
|
26
|
-
render () {
|
27
|
-
const {
|
28
|
-
groupRef,
|
29
|
-
children
|
30
|
-
} = this.props
|
31
|
-
|
32
|
-
return (
|
33
|
-
<fieldset
|
34
|
-
className={this.getClassName()}
|
35
|
-
ref={groupRef}>
|
36
|
-
{children}
|
37
|
-
</fieldset>
|
38
|
-
)
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
Group.propTypes = {
|
43
|
-
children: PropTypes.oneOfType([
|
44
|
-
PropTypes.node,
|
45
|
-
PropTypes.arrayOf(
|
46
|
-
PropTypes.node
|
47
|
-
)
|
48
|
-
]),
|
49
|
-
groupRef: PropTypes.shape({
|
50
|
-
current: PropTypes.shape({}).isRequired
|
51
|
-
})
|
52
|
-
}
|
5
|
+
export { default } from '#sprockets/super/components/group'
|
package/src/components/index.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export { default as Description } from '#sprockets/components/description'
|
2
|
+
export { default as ErrorMessage } from '#sprockets/components/error-message'
|
3
|
+
export { default as Group } from '#sprockets/components/group'
|
4
|
+
export { default as Title } from '#sprockets/components/title'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export { default as Description } from '#sprockets/components/description'
|
2
|
+
export { default as ErrorMessage } from '#sprockets/components/error-message'
|
3
|
+
export { default as Group } from '#sprockets/components/group'
|
4
|
+
export { default as Title } from '#sprockets/components/title'
|
package/src/components/index.mjs
CHANGED
@@ -4,7 +4,7 @@ const log = debug('shinkansen-sprockets/components')
|
|
4
4
|
|
5
5
|
log('`shinkansen` is awake')
|
6
6
|
|
7
|
-
export
|
8
|
-
export
|
9
|
-
export
|
10
|
-
export
|
7
|
+
export { default as Description } from './description/index.cjs'
|
8
|
+
export { default as ErrorMessage } from './error-message/index.cjs'
|
9
|
+
export { default as Group } from './group/index.cjs'
|
10
|
+
export { default as Title } from './title/index.cjs'
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/components/title')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Title // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Title
|
@@ -1,21 +1,6 @@
|
|
1
1
|
declare module '#sprockets/components/title' {
|
2
|
-
|
3
|
-
|
4
|
-
export type TitleProps = SprocketsTypes.Components.Title.TitleProps
|
5
|
-
|
6
|
-
export default class Title<P extends TitleProps> extends React.Component<P> {
|
7
|
-
static propTypes: object
|
8
|
-
|
9
|
-
hasTextContent (): boolean
|
10
|
-
|
11
|
-
getTextContent (): string
|
12
|
-
|
13
|
-
getClassName (): string
|
14
|
-
|
15
|
-
shouldComponentUpdate (props: TitleProps): boolean
|
16
|
-
|
17
|
-
renderTextContent (): React.JSX.Element | null
|
18
|
-
}
|
2
|
+
export { default } from '#sprockets/super/components/title'
|
3
|
+
export * from '#sprockets/super/components/title'
|
19
4
|
}
|
20
5
|
|
21
6
|
declare module 'shinkansen-sprockets/components/title' {
|
@@ -1,73 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* Title component
|
3
3
|
*/
|
4
4
|
|
5
|
-
|
6
|
-
* Title component
|
7
|
-
*/
|
8
|
-
import React, { Component } from 'react'
|
9
|
-
import PropTypes from 'prop-types'
|
10
|
-
|
11
|
-
import TextContent from '#sprockets/components/common/text-content'
|
12
|
-
|
13
|
-
export default class Title extends Component {
|
14
|
-
hasTextContent () {
|
15
|
-
const {
|
16
|
-
title
|
17
|
-
} = this.props
|
18
|
-
|
19
|
-
return !!title
|
20
|
-
}
|
21
|
-
|
22
|
-
getTextContent () {
|
23
|
-
const {
|
24
|
-
title
|
25
|
-
} = this.props
|
26
|
-
|
27
|
-
return title
|
28
|
-
}
|
29
|
-
|
30
|
-
getClassName () {
|
31
|
-
return 'title'
|
32
|
-
}
|
33
|
-
|
34
|
-
/**
|
35
|
-
* @param {TitleProps} props
|
36
|
-
* @returns {boolean}
|
37
|
-
*/
|
38
|
-
shouldComponentUpdate (props) {
|
39
|
-
return (
|
40
|
-
(props.title !== this.props.title)
|
41
|
-
)
|
42
|
-
}
|
43
|
-
|
44
|
-
renderTextContent () {
|
45
|
-
if (this.hasTextContent()) {
|
46
|
-
const textContent = this.getTextContent()
|
47
|
-
|
48
|
-
return (
|
49
|
-
<TextContent
|
50
|
-
textContent={textContent}
|
51
|
-
/>
|
52
|
-
)
|
53
|
-
}
|
54
|
-
|
55
|
-
return null
|
56
|
-
}
|
57
|
-
|
58
|
-
render () {
|
59
|
-
if (this.hasTextContent()) {
|
60
|
-
return (
|
61
|
-
<legend className={this.getClassName()}>
|
62
|
-
{this.renderTextContent()}
|
63
|
-
</legend>
|
64
|
-
)
|
65
|
-
}
|
66
|
-
|
67
|
-
return null
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
Title.propTypes = {
|
72
|
-
title: PropTypes.string
|
73
|
-
}
|
5
|
+
export { default } from '#sprockets/super/components/title'
|
@@ -13,8 +13,8 @@ import VisuallyHiddenText from '#sprockets/components/common/visually-hidden-tex
|
|
13
13
|
const log = debug('shinkansen-sprockets/sprockets/check-answers/group/change-answer')
|
14
14
|
|
15
15
|
/**
|
16
|
-
*
|
17
|
-
*
|
16
|
+
* @param {{ textContent?: string, visuallyHiddenText: string }} props
|
17
|
+
* @returns {React.JSX.Element | null}
|
18
18
|
*/
|
19
19
|
function TextContentWithVisuallyHiddenText ({ textContent, visuallyHiddenText }) {
|
20
20
|
return (
|
@@ -32,8 +32,8 @@ TextContentWithVisuallyHiddenText.propTypes = {
|
|
32
32
|
}
|
33
33
|
|
34
34
|
/**
|
35
|
-
*
|
36
|
-
*
|
35
|
+
* @param {{ textContent?: string, visuallyHiddenText?: string }} props
|
36
|
+
* @returns {React.JSX.Element | null}
|
37
37
|
*/
|
38
38
|
function LinkText ({ textContent, visuallyHiddenText }) {
|
39
39
|
if (textContent) {
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/check-answers/group')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Group // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Group
|
@@ -1,8 +1,8 @@
|
|
1
1
|
declare module '#sprockets/sprockets/check-answers/group' {
|
2
|
-
import Group from '#sprockets/components/group'
|
2
|
+
import Group from '#sprockets/super/components/group'
|
3
3
|
|
4
|
-
export type CheckAnswersProps = SprocketsTypes.
|
5
|
-
export type CheckAnswersState = SprocketsTypes.
|
4
|
+
export type CheckAnswersProps = SprocketsTypes.Sprockets.CheckAnswers.Group.CheckAnswersProps
|
5
|
+
export type CheckAnswersState = SprocketsTypes.Sprockets.CheckAnswers.Group.CheckAnswersState
|
6
6
|
|
7
7
|
export default class CheckAnswersGroup<P extends CheckAnswersProps, S extends CheckAnswersState> extends Group<P, S> {}
|
8
8
|
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @typedef {SprocketsTypes.AnswerDefinitionType} AnswerDefinitionType
|
3
|
-
* @typedef {SprocketsTypes.Components.Group.GroupProps} GroupProps
|
4
|
-
* @typedef {SprocketsTypes.Components.Group.GroupState} GroupState
|
5
|
-
* @typedef {SprocketsTypes.
|
6
|
-
* @typedef {SprocketsTypes.
|
3
|
+
* @typedef {SprocketsTypes.Super.Components.Group.GroupProps} GroupProps
|
4
|
+
* @typedef {SprocketsTypes.Super.Components.Group.GroupState} GroupState
|
5
|
+
* @typedef {SprocketsTypes.Sprockets.CheckAnswers.Group.CheckAnswersProps} CheckAnswersProps
|
6
|
+
* @typedef {SprocketsTypes.Sprockets.CheckAnswers.Group.CheckAnswersState} CheckAnswersState
|
7
7
|
*/
|
8
8
|
|
9
9
|
/**
|
10
|
-
*
|
10
|
+
* CheckAnswersGroup component
|
11
11
|
*/
|
12
12
|
import React from 'react'
|
13
13
|
import PropTypes from 'prop-types'
|
@@ -16,7 +16,7 @@ import classnames from 'classnames'
|
|
16
16
|
|
17
17
|
import debug from 'debug'
|
18
18
|
|
19
|
-
import Group from '#sprockets/components/group'
|
19
|
+
import Group from '#sprockets/super/components/group'
|
20
20
|
|
21
21
|
import {
|
22
22
|
getKey
|
@@ -34,9 +34,9 @@ const DEFAULT_CHECK_ANSWERS = []
|
|
34
34
|
const log = debug('shinkansen-sprockets/components/group/check-answers')
|
35
35
|
|
36
36
|
/**
|
37
|
-
*
|
38
|
-
*
|
39
|
-
*
|
37
|
+
* @param {AnswerDefinitionType} answer
|
38
|
+
* @param {number} index
|
39
|
+
* @returns {React.JSX.Element}
|
40
40
|
*/
|
41
41
|
function render ({ params: { answer, changeAnswer: { href, text, ...changeAnswer } } }, index) {
|
42
42
|
log('render')
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/check-answers')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: CheckAnswers // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = CheckAnswers
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare module '#sprockets/sprockets/check-answers' {
|
2
2
|
import Sprocket from '#sprockets/sprockets'
|
3
3
|
|
4
|
-
export type CheckAnswersProps = SprocketsTypes.Sprockets.
|
4
|
+
export type CheckAnswersProps = SprocketsTypes.Sprockets.CheckAnswers.CheckAnswersProps
|
5
5
|
|
6
6
|
export default class CheckAnswersSprocket<P extends CheckAnswersProps> extends Sprocket<P> {}
|
7
7
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/**
|
2
2
|
* @typedef {SprocketsTypes.AnswerDefinitionType} AnswerDefinitionType
|
3
|
-
* @typedef {SprocketsTypes.Sprockets.
|
4
|
-
* @typedef {SprocketsTypes.Sprockets.
|
3
|
+
* @typedef {SprocketsTypes.Sprockets.SprocketProps} SprocketProps
|
4
|
+
* @typedef {SprocketsTypes.Sprockets.CheckAnswers.CheckAnswersProps} CheckAnswersProps
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
8
|
-
*
|
8
|
+
* CheckAnswersSprocket component
|
9
9
|
*/
|
10
10
|
import React from 'react'
|
11
11
|
import PropTypes from 'prop-types'
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/check-answers/title')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Title // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Title
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare module '#sprockets/sprockets/check-answers/title' {
|
2
|
-
import Title from '#sprockets/components/title'
|
2
|
+
import Title from '#sprockets/super/components/title'
|
3
3
|
|
4
|
-
export type CheckAnswersProps = SprocketsTypes.
|
4
|
+
export type CheckAnswersProps = SprocketsTypes.Sprockets.CheckAnswers.Title.CheckAnswersProps
|
5
5
|
|
6
6
|
export default class CheckAnswersTitle<P extends CheckAnswersProps> extends Title<P> {}
|
7
7
|
}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
/**
|
2
|
-
* @typedef {SprocketsTypes.Components.Title.TitleProps} TitleProps
|
3
|
-
* @typedef {SprocketsTypes.
|
2
|
+
* @typedef {SprocketsTypes.Super.Components.Title.TitleProps} TitleProps
|
3
|
+
* @typedef {SprocketsTypes.Sprockets.CheckAnswers.Title.CheckAnswersProps} CheckAnswersProps
|
4
4
|
*/
|
5
5
|
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* CheckAnswersTitle component
|
8
8
|
*/
|
9
9
|
import React from 'react'
|
10
10
|
import classnames from 'classnames'
|
11
|
-
|
11
|
+
|
12
|
+
import Title from '#sprockets/super/components/title'
|
12
13
|
|
13
14
|
/**
|
14
15
|
* @extends {Title<TitleProps & CheckAnswersProps>}
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/error-summary/group')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Group // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Group
|
@@ -1,8 +1,8 @@
|
|
1
1
|
declare module '#sprockets/sprockets/error-summary/group' {
|
2
|
-
import Group from '#sprockets/components/group'
|
2
|
+
import Group from '#sprockets/super/components/group'
|
3
3
|
|
4
|
-
export type ErrorSummaryProps = SprocketsTypes.
|
5
|
-
export type ErrorSummaryState = SprocketsTypes.
|
4
|
+
export type ErrorSummaryProps = SprocketsTypes.Sprockets.ErrorSummary.Group.ErrorSummaryProps
|
5
|
+
export type ErrorSummaryState = SprocketsTypes.Sprockets.ErrorSummary.Group.ErrorSummaryState
|
6
6
|
|
7
7
|
export default class ErrorSummaryGroup<P extends ErrorSummaryProps, S extends ErrorSummaryState> extends Group<P, S> {}
|
8
8
|
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @typedef {SprocketsTypes.ErrorDefinitionType} ErrorDefinitionType
|
3
|
-
* @typedef {SprocketsTypes.Components.Group.GroupProps} GroupProps
|
4
|
-
* @typedef {SprocketsTypes.Components.Group.GroupState} GroupState
|
5
|
-
* @typedef {SprocketsTypes.
|
6
|
-
* @typedef {SprocketsTypes.
|
3
|
+
* @typedef {SprocketsTypes.Super.Components.Group.GroupProps} GroupProps
|
4
|
+
* @typedef {SprocketsTypes.Super.Components.Group.GroupState} GroupState
|
5
|
+
* @typedef {SprocketsTypes.Sprockets.ErrorSummary.Group.ErrorSummaryProps} ErrorSummaryProps
|
6
|
+
* @typedef {SprocketsTypes.Sprockets.ErrorSummary.Group.ErrorSummaryState} ErrorSummaryState
|
7
7
|
*/
|
8
8
|
|
9
9
|
/**
|
10
|
-
*
|
10
|
+
* ErrorSummaryGroup component
|
11
11
|
*/
|
12
12
|
import React from 'react'
|
13
13
|
import PropTypes from 'prop-types'
|
@@ -17,7 +17,7 @@ import classnames from 'classnames'
|
|
17
17
|
|
18
18
|
import debug from 'debug'
|
19
19
|
|
20
|
-
import Group from '#sprockets/components/group'
|
20
|
+
import Group from '#sprockets/super/components/group'
|
21
21
|
|
22
22
|
import transform from '#sprockets/transformers/error-summary'
|
23
23
|
import {
|
@@ -34,9 +34,9 @@ const DEFAULT_ERROR_SUMMARY = []
|
|
34
34
|
const log = debug('shinkansen-sprockets/sprockets/error-summary/group')
|
35
35
|
|
36
36
|
/**
|
37
|
-
*
|
38
|
-
*
|
39
|
-
*
|
37
|
+
* @param {ErrorDefinitionType} error
|
38
|
+
* @param {number} index
|
39
|
+
* @returns {React.JSX.Element}
|
40
40
|
*/
|
41
41
|
function render (error, index) {
|
42
42
|
log('render')
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/error-summary')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: ErrorSummary // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = ErrorSummary
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare module '#sprockets/sprockets/error-summary' {
|
2
2
|
import Sprocket from '#sprockets/sprockets'
|
3
3
|
|
4
|
-
export type ErrorSummaryProps = SprocketsTypes.Sprockets.
|
4
|
+
export type ErrorSummaryProps = SprocketsTypes.Sprockets.ErrorSummary.ErrorSummaryProps
|
5
5
|
|
6
6
|
export default class ErrorSummarySprocket<P extends ErrorSummaryProps> extends Sprocket<P> {}
|
7
7
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/**
|
2
2
|
* @typedef {SprocketsTypes.ErrorDefinitionType} ErrorDefinitionType
|
3
|
-
* @typedef {SprocketsTypes.Sprockets.
|
4
|
-
* @typedef {SprocketsTypes.Sprockets.
|
3
|
+
* @typedef {SprocketsTypes.Sprockets.SprocketProps} SprocketProps
|
4
|
+
* @typedef {SprocketsTypes.Sprockets.ErrorSummary.ErrorSummaryProps} ErrorSummaryProps
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
8
|
-
*
|
8
|
+
* ErrorSummarySprocket component
|
9
9
|
*/
|
10
10
|
import React from 'react'
|
11
11
|
import PropTypes from 'prop-types'
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/error-summary/title')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Title // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Title
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare module '#sprockets/sprockets/error-summary/title' {
|
2
|
-
import Title from '#sprockets/components/title'
|
2
|
+
import Title from '#sprockets/super/components/title'
|
3
3
|
|
4
|
-
export type ErrorSummaryProps = SprocketsTypes.
|
4
|
+
export type ErrorSummaryProps = SprocketsTypes.Sprockets.ErrorSummary.Title.ErrorSummaryProps
|
5
5
|
|
6
6
|
export default class ErrorSummaryTitle<P extends ErrorSummaryProps> extends Title<P> {}
|
7
7
|
}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
/**
|
2
|
-
* @typedef {SprocketsTypes.Components.Title.TitleProps} TitleProps
|
3
|
-
* @typedef {SprocketsTypes.
|
2
|
+
* @typedef {SprocketsTypes.Super.Components.Title.TitleProps} TitleProps
|
3
|
+
* @typedef {SprocketsTypes.Sprockets.ErrorSummary.Title.ErrorSummaryProps} ErrorSummaryProps
|
4
4
|
*/
|
5
5
|
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* ErrorSummaryTitle component
|
8
8
|
*/
|
9
9
|
import React from 'react'
|
10
10
|
import classnames from 'classnames'
|
11
|
-
|
11
|
+
|
12
|
+
import Title from '#sprockets/super/components/title'
|
12
13
|
|
13
14
|
/**
|
14
15
|
* @extends {Title<TitleProps & ErrorSummaryProps>}
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/fieldset/description')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Description // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Description
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* FieldsetDescription component
|
3
3
|
*/
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import Description from '#sprockets/components/description'
|
5
|
+
import Description from '#sprockets/super/components/description'
|
6
6
|
|
7
7
|
export default class FieldsetDescription extends Description {
|
8
8
|
getClassName () {
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/fieldset/error-message')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: ErrorMessage // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = ErrorMessage
|
@@ -1,5 +1,5 @@
|
|
1
1
|
declare module '#sprockets/sprockets/fieldset/error-message' {
|
2
|
-
import ErrorMessage from '#sprockets/components/error-message'
|
2
|
+
import ErrorMessage from '#sprockets/super/components/error-message'
|
3
3
|
|
4
4
|
export default class FieldsetErrorMessage extends ErrorMessage {}
|
5
5
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* FieldsetErrorMessage component
|
3
3
|
*/
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import ErrorMessage from '#sprockets/components/error-message'
|
5
|
+
import ErrorMessage from '#sprockets/super/components/error-message'
|
6
6
|
|
7
7
|
export default class FieldsetErrorMessage extends ErrorMessage {
|
8
8
|
getClassName () {
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-sprockets/sprockets/fieldset/group')
|
|
11
11
|
log('`shinkansen` is awake')
|
12
12
|
|
13
13
|
const {
|
14
|
-
default:
|
14
|
+
default: Group // @ts-expect-error
|
15
15
|
} = require('./index.jsx')
|
16
16
|
|
17
|
-
|
17
|
+
/**
|
18
|
+
* Exports only default
|
19
|
+
*/
|
20
|
+
module.exports = Group
|