Skip to content

Commit bb7cc37

Browse files
committed
refactor(VerificationCode): migrate to use vanilla extract
1 parent be21b81 commit bb7cc37

File tree

6 files changed

+245
-1835
lines changed

6 files changed

+245
-1835
lines changed

.changeset/tender-flowers-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ultraviolet/ui": minor
3+
---
4+
5+
Refactor `<VerificationCode /> to use vanilla extract`

packages/form/src/components/VerificationCodeField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 6 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -3,93 +3,9 @@
33
exports[`VerificationCodeField > should render correctly 1`] = `
44
<DocumentFragment>
55
.emotion-0 {
6-
border: none;
7-
padding: 0;
8-
margin: 0;
9-
display: -webkit-box;
10-
display: -webkit-flex;
11-
display: -ms-flexbox;
12-
display: flex;
13-
-webkit-flex-direction: column;
14-
-ms-flex-direction: column;
15-
flex-direction: column;
16-
gap: 0.25rem;
17-
}
18-
19-
.emotion-2 {
206
cursor: text;
217
}
228
23-
.emotion-4 {
24-
background: #ffffff;
25-
color: #3f4250;
26-
font-size: 1rem;
27-
font-weight: 400;
28-
text-align: center;
29-
border-radius: 0.25rem;
30-
margin-right: 0.5rem;
31-
width: 2.5rem;
32-
height: 3rem;
33-
outline-style: none;
34-
-webkit-transition: border-color 0.2s ease,box-shadow 0.2s ease;
35-
transition: border-color 0.2s ease,box-shadow 0.2s ease;
36-
border: solid 1px #d9dadd;
37-
}
38-
39-
.emotion-4[aria-invalid='true'] {
40-
border-color: #b3144d;
41-
}
42-
43-
.emotion-4[data-success='true'] {
44-
border-color: #22674e;
45-
}
46-
47-
.emotion-4:hover,
48-
.emotion-4:focus {
49-
border-color: #792dd4;
50-
}
51-
52-
.emotion-4:hover[aria-invalid='true'],
53-
.emotion-4:focus[aria-invalid='true'] {
54-
border-color: #92103f;
55-
}
56-
57-
.emotion-4:hover[data-success='true'],
58-
.emotion-4:focus[data-success='true'] {
59-
border-color: #1b533f;
60-
}
61-
62-
.emotion-4:focus {
63-
box-shadow: 0px 0px 0px 3px #8c40ef40;
64-
}
65-
66-
.emotion-4:last-child {
67-
margin-right: 0;
68-
}
69-
70-
.emotion-4::-webkit-input-placeholder {
71-
color: #727683;
72-
}
73-
74-
.emotion-4::-moz-placeholder {
75-
color: #727683;
76-
}
77-
78-
.emotion-4:-ms-input-placeholder {
79-
color: #727683;
80-
}
81-
82-
.emotion-4::placeholder {
83-
color: #727683;
84-
}
85-
86-
.emotion-4:disabled {
87-
cursor: not-allowed;
88-
background: #f3f3f4;
89-
color: #b5b7bd;
90-
border: solid 1px #e9eaeb;
91-
}
92-
939
<div
9410
data-testid="testing"
9511
>
@@ -98,14 +14,14 @@ exports[`VerificationCodeField > should render correctly 1`] = `
9814
style="display: contents;"
9915
>
10016
<fieldset
101-
class="emotion-0 emotion-1"
17+
class="uv_1k9synd5"
10218
>
10319
<div
10420
class="uv_toi52u0 uv_toi52u3j uv_toi52u2j uv_toi52u7d uv_toi52u1v uv_toi52u5d"
10521
style="--uv_4k0ekn0: var(--uv_4k0ekn0); --uv_4k0ekn1: var(--uv_4k0ekn1); --uv_4k0ekn2: var(--uv_4k0ekn2); --uv_4k0ekn3: var(--uv_4k0ekn3);"
10622
>
10723
<label
108-
class="emotion-2 emotion-3 uv_m4c9ow0 uv_m4c9ow2 uv_m4c9ow4 uv_m4c9ow6 uv_m4c9ow8 uv_m4c9owb uv_m4c9owi uv_m4c9owq uv_m4c9ow1b uv_m4c9ow20 uv_m4c9ow3c"
24+
class="emotion-0 emotion-1 uv_m4c9ow0 uv_m4c9ow2 uv_m4c9ow4 uv_m4c9ow6 uv_m4c9ow8 uv_m4c9owb uv_m4c9owi uv_m4c9owq uv_m4c9ow1b uv_m4c9ow20 uv_m4c9ow3c"
10925
>
11026
Code
11127
</label>
@@ -120,7 +36,7 @@ exports[`VerificationCodeField > should render correctly 1`] = `
12036
aria-invalid="false"
12137
aria-label="Verification code 0"
12238
autocomplete="off"
123-
class="emotion-4 emotion-5"
39+
class="uv_1k9synd2 uv_1k9synd4 emotion-2"
12440
data-success="false"
12541
data-testid="0"
12642
id="verification-code-input-0"
@@ -134,7 +50,7 @@ exports[`VerificationCodeField > should render correctly 1`] = `
13450
aria-invalid="false"
13551
aria-label="Verification code 1"
13652
autocomplete="off"
137-
class="emotion-4 emotion-5"
53+
class="uv_1k9synd2 uv_1k9synd4 emotion-2"
13854
data-success="false"
13955
data-testid="1"
14056
id="verification-code-input-1"
@@ -148,7 +64,7 @@ exports[`VerificationCodeField > should render correctly 1`] = `
14864
aria-invalid="false"
14965
aria-label="Verification code 2"
15066
autocomplete="off"
151-
class="emotion-4 emotion-5"
67+
class="uv_1k9synd2 uv_1k9synd4 emotion-2"
15268
data-success="false"
15369
data-testid="2"
15470
id="verification-code-input-2"
@@ -162,7 +78,7 @@ exports[`VerificationCodeField > should render correctly 1`] = `
16278
aria-invalid="false"
16379
aria-label="Verification code 3"
16480
autocomplete="off"
165-
class="emotion-4 emotion-5"
81+
class="uv_1k9synd2 uv_1k9synd4 emotion-2"
16682
data-success="false"
16783
data-testid="3"
16884
id="verification-code-input-3"

0 commit comments

Comments
 (0)