File tree 2 files changed +5
-0
lines changed
packages/snaps-sdk/src/ui/components
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ describe('Input', () => {
10
10
inputType : InputType . Text ,
11
11
placeholder : 'Type here...' ,
12
12
label : 'Hello' ,
13
+ error : 'Invalid input' ,
13
14
} ) ,
14
15
) . toStrictEqual ( {
15
16
type : NodeType . Input ,
@@ -18,6 +19,7 @@ describe('Input', () => {
18
19
inputType : InputType . Text ,
19
20
placeholder : 'Type here...' ,
20
21
label : 'Hello' ,
22
+ error : 'Invalid input' ,
21
23
} ) ;
22
24
23
25
expect (
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export const InputStruct = assign(
32
32
) ,
33
33
placeholder : optional ( string ( ) ) ,
34
34
label : optional ( string ( ) ) ,
35
+ error : optional ( string ( ) ) ,
35
36
} ) ,
36
37
) ;
37
38
@@ -44,6 +45,7 @@ export const InputStruct = assign(
44
45
* @property inputType - An optional type, either `text`, `password` or `number`.
45
46
* @property placeholder - An optional input placeholder.
46
47
* @property label - An optional input label.
48
+ * @property error - An optional error text.
47
49
*/
48
50
export type Input = Infer < typeof InputStruct > ;
49
51
@@ -57,6 +59,7 @@ export type Input = Infer<typeof InputStruct>;
57
59
* @param args.inputType - An optional type, either `text`, `password` or `number`.
58
60
* @param args.placeholder - An optional input placeholder.
59
61
* @param args.label - An optional input label.
62
+ * @param args.error - An optional error text.
60
63
* @returns The input node as an object.
61
64
* @example
62
65
* const node = input('myInput');
You can’t perform that action at this time.
0 commit comments