Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit d378a50

Browse files
author
Alan
authored
Merge pull request #61 from Ultimaker/input-fields
Refactoring input fields
2 parents 1890dd0 + 21d9678 commit d378a50

File tree

69 files changed

+2610
-1036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2610
-1036
lines changed

src/components/__tests__/__snapshots__/file_upload.test.tsx.snap

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`The FileUpload component should render 1`] = `
99
id="testFileUpload"
1010
name="testFileUpload"
1111
onChange={[Function]}
12+
placeholder="A text placeholder"
1213
type="file"
1314
/>
1415
<div
@@ -29,7 +30,11 @@ exports[`The FileUpload component should render 1`] = `
2930
className="btn btn--primary"
3031
htmlFor="testFileUpload"
3132
>
32-
Choose file
33+
<span
34+
className="text"
35+
>
36+
Choose file
37+
</span>
3338
</label>
3439
</div>
3540
</div>

src/components/__tests__/__snapshots__/form.test.tsx.snap

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,65 @@ exports[`The Form component should render with a form item 1`] = `
4646
labelLayoutWidth="1/1"
4747
labelWidthBreakpoint="sm"
4848
onChangeHandler={[MockFunction]}
49+
staticField={false}
4950
type="text"
5051
value={null}
5152
>
52-
<div
53-
className="input-field input-field--text layout"
53+
<TextField
54+
id="test"
55+
labelLayoutWidth="1/1"
56+
labelWidthBreakpoint="sm"
57+
onChangeHandler={[MockFunction]}
58+
staticField={false}
59+
type="text"
60+
value={null}
5461
>
55-
<InputFieldInput
62+
<DefaultInputField
5663
id="test"
5764
labelLayoutWidth="1/1"
5865
labelWidthBreakpoint="sm"
59-
onChangeHandler={[Function]}
66+
onChangeHandler={[MockFunction]}
67+
staticField={false}
6068
type="text"
6169
value={null}
6270
>
63-
<div
64-
className="layout__item u-fill layout__item--middle"
71+
<InputFieldWrapper
72+
id="test"
73+
labelLayoutWidth="1/1"
74+
labelWidthBreakpoint="sm"
75+
onChangeHandler={[MockFunction]}
76+
staticField={false}
77+
touched={false}
6578
>
6679
<div
67-
className="input-container layout layout--gutter-xs"
80+
className="input-field layout"
6881
>
6982
<div
70-
className="layout__item u-fill"
83+
className="layout__item u-fill layout__item--middle"
7184
>
72-
<input
73-
className="input"
74-
id="test"
75-
max={null}
76-
min={null}
77-
name="test"
78-
onChange={[Function]}
79-
type="text"
80-
value=""
81-
/>
85+
<div
86+
className="input-container layout layout--gutter-xs"
87+
>
88+
<div
89+
className="layout__item u-fill"
90+
>
91+
<input
92+
className="input"
93+
id="test"
94+
max={null}
95+
min={null}
96+
name="test"
97+
onChange={[Function]}
98+
type="text"
99+
value=""
100+
/>
101+
</div>
102+
</div>
82103
</div>
83104
</div>
84-
</div>
85-
</InputFieldInput>
86-
</div>
105+
</InputFieldWrapper>
106+
</DefaultInputField>
107+
</TextField>
87108
</InputField>
88109
</div>
89110
<div

src/components/__tests__/__snapshots__/image_upload.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`The ImageFile component should render 1`] = `
3+
exports[`The image upload component should render 1`] = `
44
<div>
55
<t
66
accept="image/jpeg, image/png"
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`The InputField component should render 1`] = `
4-
<div
5-
className="input-field input-field--text layout"
6-
>
7-
<InputFieldInput
8-
id="testInputField"
9-
labelLayoutWidth="1/1"
10-
labelWidthBreakpoint="sm"
11-
onChangeHandler={[Function]}
12-
type="text"
13-
value="Test input"
14-
/>
15-
</div>
4+
<TextField
5+
id="testInputField"
6+
labelLayoutWidth="1/1"
7+
labelWidthBreakpoint="sm"
8+
onChangeHandler={[MockFunction]}
9+
staticField={false}
10+
type="text"
11+
value="Test input"
12+
/>
1613
`;

src/components/__tests__/__snapshots__/input_field_input.test.tsx.snap

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/components/__tests__/__snapshots__/popup_prompt.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ exports[`The PopupPrompt component should render a prompt popup 1`] = `
1414
labelLayoutWidth="1/1"
1515
labelWidthBreakpoint="sm"
1616
onChangeHandler={[Function]}
17+
staticField={false}
1718
type="text"
1819
/>
1920
</Popup>

0 commit comments

Comments
 (0)