shinkansen-sprockets 1.2.11 → 1.2.12
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 +4 -1
- package/package.json +13 -7
- package/src/components/common/text-content/index.d.cts +2 -0
- package/src/components/common/visually-hidden-text/index.d.cts +2 -0
- package/src/components/description/index.d.cts +2 -0
- package/src/components/error-message/index.d.cts +2 -0
- package/src/components/group/index.d.cts +2 -0
- package/src/components/title/index.d.cts +2 -0
- package/src/index.d.cts +8 -0
- package/src/sprockets/check-answers/group/answer-title.d.cts +1 -0
- package/src/sprockets/check-answers/group/answer-title.d.mts +9 -0
- package/src/sprockets/check-answers/group/answer-value.d.cts +1 -0
- package/src/sprockets/check-answers/group/answer-value.d.mts +9 -0
- package/src/sprockets/check-answers/group/change-answer.d.cts +1 -0
- package/src/sprockets/check-answers/group/change-answer.d.mts +9 -0
- package/src/sprockets/check-answers/group/index.d.cts +2 -0
- package/src/sprockets/check-answers/group/index.jsx +3 -3
- package/src/sprockets/check-answers/index.d.cts +2 -0
- package/src/sprockets/check-answers/index.jsx +2 -2
- package/src/sprockets/check-answers/title/index.d.cts +2 -0
- package/src/sprockets/error-summary/group/index.d.cts +2 -0
- package/src/sprockets/error-summary/index.d.cts +2 -0
- package/src/sprockets/error-summary/index.jsx +7 -3
- package/src/sprockets/error-summary/title/index.d.cts +2 -0
- package/src/sprockets/fieldset/description/index.d.cts +1 -0
- package/src/sprockets/fieldset/error-message/index.d.cts +1 -0
- package/src/sprockets/fieldset/group/index.d.cts +2 -0
- package/src/sprockets/fieldset/index.d.cts +2 -0
- package/src/sprockets/fieldset/index.jsx +4 -4
- package/src/sprockets/fieldset/title/index.d.cts +2 -0
- package/src/sprockets/index.d.cts +2 -0
package/index.d.mts
CHANGED
@@ -136,7 +136,10 @@ declare global {
|
|
136
136
|
}
|
137
137
|
|
138
138
|
export namespace Fieldset {
|
139
|
-
export
|
139
|
+
export interface FieldsetProps extends SprocketProps {
|
140
|
+
description?: string
|
141
|
+
errorMessage?: ErrorDefinitionType[]
|
142
|
+
}
|
140
143
|
}
|
141
144
|
}
|
142
145
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-sprockets",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.12",
|
4
4
|
"description": "Shinkansen Sprockets",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -101,13 +101,19 @@
|
|
101
101
|
},
|
102
102
|
"imports": {
|
103
103
|
"#build/paths": "./build/paths.mjs",
|
104
|
-
"#sprockets":
|
104
|
+
"#sprockets": {
|
105
|
+
"require": "./src/index.cjs",
|
106
|
+
"import": "./src/index.mjs"
|
107
|
+
},
|
105
108
|
"#sprockets/common": "./src/common/index.mjs",
|
106
|
-
"#sprockets/components/*":
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
"#sprockets/sprockets
|
109
|
+
"#sprockets/components/*": {
|
110
|
+
"require": "./src/components/*/index.cjs",
|
111
|
+
"import": "./src/components/*/index.cjs"
|
112
|
+
},
|
113
|
+
"#sprockets/sprockets": "./src/sprockets/index.cjs",
|
114
|
+
"#sprockets/sprockets/*": "./src/sprockets/*/index.cjs",
|
115
|
+
"#sprockets/sprockets/check-answers/group/*": "./src/sprockets/check-answers/group/*.cjs",
|
116
|
+
"#sprockets/sprockets/error-summary/group/*": "./src/sprockets/error-summary/group/*.cjs",
|
111
117
|
"#sprockets/transformers/*": "./src/transformers/*/index.mjs",
|
112
118
|
"#stories/definitions/*": "./stories/definitions/*.json",
|
113
119
|
"#stories/errors": "./stories/errors.mjs",
|
package/src/index.d.cts
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
export type AnswerDefinitionType = SprocketsTypes.AnswerDefinitionType
|
2
|
+
export type FieldChangeType = SprocketsTypes.FieldChangeType
|
3
|
+
export type ErrorDefinitionType = SprocketsTypes.ErrorDefinitionType
|
4
|
+
export type FieldErrorType = SprocketsTypes.FieldErrorType
|
5
|
+
|
6
|
+
export { default as CheckAnswersSprocket } from '#sprockets/sprockets/check-answers'
|
7
|
+
export { default as ErrorSummarySprocket } from '#sprockets/sprockets/error-summary'
|
8
|
+
export { default as FieldsetSprocket } from '#sprockets/sprockets/fieldset'
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from '#sprockets/sprockets/check-answers/group/answer-title'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare module '#sprockets/sprockets/check-answers/group/answer-title' {
|
2
|
+
import type React from 'react'
|
3
|
+
|
4
|
+
export default function AnswerTitle (props: { answer: { title: string } }): React.JSX.Element
|
5
|
+
}
|
6
|
+
|
7
|
+
declare module 'shinkansen-sprockets/sprockets/check-answers/group/answer-title' {
|
8
|
+
export { default } from '#sprockets/sprockets/check-answers/group/answer-title'
|
9
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from '#sprockets/sprockets/check-answers/group/answer-value'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare module '#sprockets/sprockets/check-answers/group/answer-value' {
|
2
|
+
import type React from 'react'
|
3
|
+
|
4
|
+
export default function AnswerValue (props: { answer: { value: string | string[] } }): React.JSX.Element
|
5
|
+
}
|
6
|
+
|
7
|
+
declare module 'shinkansen-sprockets/sprockets/check-answers/group/answer-value' {
|
8
|
+
export { default } from '#sprockets/sprockets/check-answers/group/answer-value'
|
9
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from '#sprockets/sprockets/check-answers/group/answer-value'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare module '#sprockets/sprockets/check-answers/group/change-answer' {
|
2
|
+
import type React from 'react'
|
3
|
+
|
4
|
+
export default function ChangeAnswer (props: { changeAnswer: { href: string; text: string; visuallyHiddenText?: string } }): React.JSX.Element
|
5
|
+
}
|
6
|
+
|
7
|
+
declare module 'shinkansen-sprockets/sprockets/check-answers/group/change-answer' {
|
8
|
+
export { default } from '#sprockets/sprockets/check-answers/group/change-answer'
|
9
|
+
}
|
@@ -22,9 +22,9 @@ import {
|
|
22
22
|
getKey
|
23
23
|
} from '#sprockets/transformers/common'
|
24
24
|
|
25
|
-
import AnswerTitle from '
|
26
|
-
import AnswerValue from '
|
27
|
-
import ChangeAnswer from '
|
25
|
+
import AnswerTitle from '#sprockets/sprockets/check-answers/group/answer-title'
|
26
|
+
import AnswerValue from '#sprockets/sprockets/check-answers/group/answer-value'
|
27
|
+
import ChangeAnswer from '#sprockets/sprockets/check-answers/group/change-answer'
|
28
28
|
|
29
29
|
/**
|
30
30
|
* @type {AnswerDefinitionType[]}
|
@@ -13,8 +13,8 @@ import PropTypes from 'prop-types'
|
|
13
13
|
import classnames from 'classnames'
|
14
14
|
|
15
15
|
import Sprocket from '#sprockets/sprockets'
|
16
|
-
import Title from '
|
17
|
-
import Group from '
|
16
|
+
import Title from '#sprockets/sprockets/check-answers/title'
|
17
|
+
import Group from '#sprockets/sprockets/check-answers/group'
|
18
18
|
|
19
19
|
/**
|
20
20
|
* @type {AnswerDefinitionType[]}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
/**
|
2
|
+
* @typedef {SprocketsTypes.ErrorDefinitionType} ErrorDefinitionType
|
2
3
|
* @typedef {SprocketsTypes.Sprockets.Sprocket.SprocketProps} SprocketProps
|
3
4
|
* @typedef {SprocketsTypes.Sprockets.Sprocket.ErrorSummary.ErrorSummaryProps} ErrorSummaryProps
|
4
5
|
*/
|
@@ -12,9 +13,12 @@ import PropTypes from 'prop-types'
|
|
12
13
|
import classnames from 'classnames'
|
13
14
|
|
14
15
|
import Sprocket from '#sprockets/sprockets'
|
15
|
-
import Title from '
|
16
|
-
import Group from '
|
16
|
+
import Title from '#sprockets/sprockets/error-summary/title'
|
17
|
+
import Group from '#sprockets/sprockets/error-summary/group'
|
17
18
|
|
19
|
+
/**
|
20
|
+
* @type {ErrorDefinitionType[]}
|
21
|
+
*/
|
18
22
|
const DEFAULT_ERROR_SUMMARY = []
|
19
23
|
|
20
24
|
/**
|
@@ -74,7 +78,7 @@ export default class ErrorSummarySprocket extends Sprocket {
|
|
74
78
|
const className = this.getClassName()
|
75
79
|
|
76
80
|
return (
|
77
|
-
<div tabIndex=
|
81
|
+
<div tabIndex={-1} className={className}>
|
78
82
|
{this.renderTitle()}
|
79
83
|
{this.renderGroup()}
|
80
84
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from '#sprockets/sprockets/fieldset/description'
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from '#sprockets/sprockets/fieldset/error-message'
|
@@ -13,10 +13,10 @@ import classnames from 'classnames'
|
|
13
13
|
|
14
14
|
import Sprocket from '#sprockets/sprockets'
|
15
15
|
|
16
|
-
import Title from '
|
17
|
-
import Description from '
|
18
|
-
import ErrorMessage from '
|
19
|
-
import Group from '
|
16
|
+
import Title from '#sprockets/sprockets/fieldset/title'
|
17
|
+
import Description from '#sprockets/sprockets/fieldset/description'
|
18
|
+
import ErrorMessage from '#sprockets/sprockets/fieldset/error-message'
|
19
|
+
import Group from '#sprockets/sprockets/fieldset/group'
|
20
20
|
|
21
21
|
/**
|
22
22
|
* @extends {Sprocket<SprocketProps & FieldsetProps>}
|