shinkansen-sprockets 1.1.243 → 1.1.244
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/package.json +3 -3
- package/src/components/common/text-content/index.d.mts +9 -0
- package/src/components/description/index.d.mts +9 -0
- package/src/components/error-message/index.d.mts +9 -0
- package/src/components/group/index.d.mts +11 -0
- package/src/components/title/index.d.mts +9 -0
- package/src/index.d.mts +39 -0
- package/src/sprockets/check-answers/group/index.d.mts +5 -0
- package/src/sprockets/check-answers/index.d.mts +5 -0
- package/src/sprockets/check-answers/title/index.d.mts +5 -0
- package/src/sprockets/error-summary/group/index.d.mts +5 -0
- package/src/sprockets/error-summary/index.d.mts +5 -0
- package/src/sprockets/error-summary/title/index.d.mts +5 -0
- package/src/sprockets/fieldset/description/index.d.mts +5 -0
- package/src/sprockets/fieldset/error-message/index.d.mts +5 -0
- package/src/sprockets/fieldset/group/index.d.mts +5 -0
- package/src/sprockets/fieldset/index.d.mts +5 -0
- package/src/sprockets/fieldset/title/index.d.mts +5 -0
- package/src/sprockets/index.d.mts +12 -0
- package/src/transformers/check-answers/index.d.mts +3 -0
- package/src/transformers/common/index.d.mts +3 -0
- package/src/transformers/error-message/index.d.mts +3 -0
- package/src/transformers/error-summary/index.d.mts +3 -0
- package/src/index.d.cts +0 -186
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-sprockets",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.244",
|
4
4
|
"description": "Shinkansen Sprockets",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
],
|
13
13
|
"main": "./src/index.cjs",
|
14
14
|
"type": "module",
|
15
|
-
"types": "./src/index.d.
|
15
|
+
"types": "./src/index.d.mts",
|
16
16
|
"author": {
|
17
17
|
"name": "Jonathan Perry for Modern Poacher Limited",
|
18
18
|
"email": "modernpoacher@modernpoacher.com",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"pregulp": "npm run nvm",
|
36
36
|
"gulp": "gulp --color",
|
37
37
|
"prelint": "npm run nvm",
|
38
|
-
"lint": "
|
38
|
+
"lint": "eslint . .storybook --ext .mjs,.cjs,.jsx,.mts,.cts",
|
39
39
|
"lint:fix": "npm run lint -- --fix",
|
40
40
|
"pretest": "npm run nvm",
|
41
41
|
"test": "cross-env NODE_ENV=test jest --collect-coverage false --run-in-band",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
declare module 'shinkansen-sprockets/components/group' {
|
2
|
+
import React from 'react'
|
3
|
+
|
4
|
+
export interface GroupProps {
|
5
|
+
onChange: SprocketsTypes.OnChangeType
|
6
|
+
groupRef: object
|
7
|
+
children: React.JSX.Element | React.JSX.Element[]
|
8
|
+
}
|
9
|
+
|
10
|
+
export default class Group extends React.Component<GroupProps> {}
|
11
|
+
}
|
package/src/index.d.mts
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
declare namespace SprocketsTypes {
|
2
|
+
export type OnChangeType = () => void
|
3
|
+
|
4
|
+
export interface AnswerDefinitionType {
|
5
|
+
answer: {
|
6
|
+
title: string
|
7
|
+
value: string | string[]
|
8
|
+
}
|
9
|
+
changeAnswer: {
|
10
|
+
text: string
|
11
|
+
href: string
|
12
|
+
visuallyHiddenText?: string
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface ErrorDefinitionType {
|
17
|
+
type: string
|
18
|
+
uri: string
|
19
|
+
params: {
|
20
|
+
expectedType: string
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
export interface FieldChangeType {
|
25
|
+
text: string
|
26
|
+
href: string
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface FieldErrorType {
|
30
|
+
text: string
|
31
|
+
href: string
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
declare module 'shinkansen-sprockets' {
|
36
|
+
export { default as CheckAnswersSprocket } from 'shinkansen-sprockets/sprockets/check-answers'
|
37
|
+
export { default as ErrorSummarySprocket } from 'shinkansen-sprockets/sprockets/error-summary'
|
38
|
+
export { default as FieldsetSprocket } from 'shinkansen-sprockets/sprockets/fieldset'
|
39
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare module 'shinkansen-sprockets/sprockets' {
|
2
|
+
import React from 'react'
|
3
|
+
|
4
|
+
export interface SprocketProps {
|
5
|
+
title: string
|
6
|
+
onChange: SprocketsTypes.OnChangeType
|
7
|
+
groupRef: object
|
8
|
+
children: React.JSX.Element | React.JSX.Element[]
|
9
|
+
}
|
10
|
+
|
11
|
+
export default class Sprocket extends React.Component<SprocketProps> {}
|
12
|
+
}
|
package/src/index.d.cts
DELETED
@@ -1,186 +0,0 @@
|
|
1
|
-
declare namespace SprocketsTypes {
|
2
|
-
export type OnChangeType = () => void
|
3
|
-
|
4
|
-
export interface AnswerDefinitionType {
|
5
|
-
answer: {
|
6
|
-
title: string
|
7
|
-
value: string | string[]
|
8
|
-
}
|
9
|
-
changeAnswer: {
|
10
|
-
text: string
|
11
|
-
href: string
|
12
|
-
visuallyHiddenText?: string
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
export interface ErrorDefinitionType {
|
17
|
-
type: string
|
18
|
-
uri: string
|
19
|
-
params: {
|
20
|
-
expectedType: string
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
export interface FieldChangeType {
|
25
|
-
text: string
|
26
|
-
href: string
|
27
|
-
}
|
28
|
-
|
29
|
-
export interface FieldErrorType {
|
30
|
-
text: string
|
31
|
-
href: string
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
declare module 'shinkansen-sprockets/components/common/text-content' {
|
36
|
-
import type React from 'react'
|
37
|
-
|
38
|
-
export interface TextContentProps {
|
39
|
-
textContent: string
|
40
|
-
}
|
41
|
-
|
42
|
-
export default function TextContent (props: TextContentProps): React.JSX.Element
|
43
|
-
}
|
44
|
-
|
45
|
-
declare module 'shinkansen-sprockets/components/description' {
|
46
|
-
import React from 'react'
|
47
|
-
|
48
|
-
export interface DescriptionProps {
|
49
|
-
description: string
|
50
|
-
}
|
51
|
-
|
52
|
-
export default class Description extends React.Component<DescriptionProps> {}
|
53
|
-
}
|
54
|
-
|
55
|
-
declare module 'shinkansen-sprockets/components/error-message' {
|
56
|
-
import React from 'react'
|
57
|
-
|
58
|
-
export interface ErrorMessageProps {
|
59
|
-
errorMessage: string
|
60
|
-
}
|
61
|
-
|
62
|
-
export default class ErrorMessage extends React.Component<ErrorMessageProps> {}
|
63
|
-
}
|
64
|
-
|
65
|
-
declare module 'shinkansen-sprockets/components/title' {
|
66
|
-
import React from 'react'
|
67
|
-
|
68
|
-
export interface TitleProps {
|
69
|
-
title: string
|
70
|
-
}
|
71
|
-
|
72
|
-
export default class Title extends React.Component<TitleProps> {}
|
73
|
-
}
|
74
|
-
|
75
|
-
declare module 'shinkansen-sprockets/components/group' {
|
76
|
-
import React from 'react'
|
77
|
-
|
78
|
-
export interface GroupProps {
|
79
|
-
onChange: SprocketsTypes.OnChangeType
|
80
|
-
groupRef: object
|
81
|
-
children: React.JSX.Element | React.JSX.Element[]
|
82
|
-
}
|
83
|
-
|
84
|
-
export default class Group extends React.Component<GroupProps> {}
|
85
|
-
}
|
86
|
-
|
87
|
-
declare module 'shinkansen-sprockets/sprockets/check-answers/title' {
|
88
|
-
import Title from 'shinkansen-sprockets/components/title'
|
89
|
-
|
90
|
-
export default class CheckAnswersTitle extends Title {}
|
91
|
-
}
|
92
|
-
|
93
|
-
declare module 'shinkansen-sprockets/sprockets/check-answers/group' {
|
94
|
-
import Group from 'shinkansen-sprockets/components/group'
|
95
|
-
|
96
|
-
export default class CheckAnswersGroup extends Group {}
|
97
|
-
}
|
98
|
-
|
99
|
-
declare module 'shinkansen-sprockets/sprockets/check-answers' {
|
100
|
-
import Sprocket from 'shinkansen-sprockets/sprockets'
|
101
|
-
|
102
|
-
export default class ErrorSummarySprocket extends Sprocket {}
|
103
|
-
}
|
104
|
-
|
105
|
-
declare module 'shinkansen-sprockets/sprockets/error-summary/title' {
|
106
|
-
import Title from 'shinkansen-sprockets/components/title'
|
107
|
-
|
108
|
-
export default class ErrorSummaryTitle extends Title {}
|
109
|
-
}
|
110
|
-
|
111
|
-
declare module 'shinkansen-sprockets/sprockets/error-summary/group' {
|
112
|
-
import Group from 'shinkansen-sprockets/components/group'
|
113
|
-
|
114
|
-
export default class ErrorSummaryGroup extends Group {}
|
115
|
-
}
|
116
|
-
|
117
|
-
declare module 'shinkansen-sprockets/sprockets/error-summary' {
|
118
|
-
import Sprocket from 'shinkansen-sprockets/sprockets'
|
119
|
-
|
120
|
-
export default class CheckAnswersSprocket extends Sprocket {}
|
121
|
-
}
|
122
|
-
|
123
|
-
declare module 'shinkansen-sprockets/sprockets/fieldset/description' {
|
124
|
-
import Description from 'shinkansen-sprockets/components/description'
|
125
|
-
|
126
|
-
export default class FieldsetDescription extends Description {}
|
127
|
-
}
|
128
|
-
|
129
|
-
declare module 'shinkansen-sprockets/sprockets/fieldset/error-message' {
|
130
|
-
import ErrorMessage from 'shinkansen-sprockets/components/error-message'
|
131
|
-
|
132
|
-
export default class FieldsetErrorMessage extends ErrorMessage {}
|
133
|
-
}
|
134
|
-
|
135
|
-
declare module 'shinkansen-sprockets/sprockets/fieldset/title' {
|
136
|
-
import Title from 'shinkansen-sprockets/components/title'
|
137
|
-
|
138
|
-
export default class FieldsetTitle extends Title {}
|
139
|
-
}
|
140
|
-
|
141
|
-
declare module 'shinkansen-sprockets/sprockets/fieldset/group' {
|
142
|
-
import Group from 'shinkansen-sprockets/components/group'
|
143
|
-
|
144
|
-
export default class FieldsetGroup extends Group {}
|
145
|
-
}
|
146
|
-
|
147
|
-
declare module 'shinkansen-sprockets/sprockets/fieldset' {
|
148
|
-
import Sprocket from 'shinkansen-sprockets/sprockets'
|
149
|
-
|
150
|
-
export default class FieldsetSprocket extends Sprocket {}
|
151
|
-
}
|
152
|
-
|
153
|
-
declare module 'shinkansen-sprockets/sprockets' {
|
154
|
-
import React from 'react'
|
155
|
-
|
156
|
-
export interface SprocketProps {
|
157
|
-
title: string
|
158
|
-
onChange: SprocketsTypes.OnChangeType
|
159
|
-
groupRef: object
|
160
|
-
children: React.JSX.Element | React.JSX.Element[]
|
161
|
-
}
|
162
|
-
|
163
|
-
export default class Sprocket extends React.Component<SprocketProps> {}
|
164
|
-
}
|
165
|
-
|
166
|
-
declare module 'shinkansen-sprockets/transformers/check-answers' {
|
167
|
-
export default function transform (answer: SprocketsTypes.AnswerDefinitionType): SprocketsTypes.FieldChangeType
|
168
|
-
}
|
169
|
-
|
170
|
-
declare module 'shinkansen-sprockets/transformers/error-message' {
|
171
|
-
export default function transform (error: SprocketsTypes.ErrorDefinitionType): SprocketsTypes.FieldErrorType
|
172
|
-
}
|
173
|
-
|
174
|
-
declare module 'shinkansen-sprockets/transformers/error-summary' {
|
175
|
-
export default function transform (error: SprocketsTypes.ErrorDefinitionType): SprocketsTypes.FieldErrorType
|
176
|
-
}
|
177
|
-
|
178
|
-
declare module 'shinkansen-sprockets/transformers/common' {
|
179
|
-
export function getKey (href: string, text: string, index: number): string
|
180
|
-
}
|
181
|
-
|
182
|
-
declare module 'shinkansen-sprockets' {
|
183
|
-
export { default as CheckAnswersSprocket } from 'shinkansen-sprockets/sprockets/check-answers'
|
184
|
-
export { default as ErrorSummarySprocket } from 'shinkansen-sprockets/sprockets/error-summary'
|
185
|
-
export { default as FieldsetSprocket } from 'shinkansen-sprockets/sprockets/fieldset'
|
186
|
-
}
|