Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(TextInput): ajout adornment (DS-1140) #949

Merged
merged 9 commits into from
Sep 27, 2024
219 changes: 150 additions & 69 deletions packages/react/src/components/money-input/money-input.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`CurrencyInput Component matches snapshot (en-CA) 1`] = `
margin-bottom: var(--spacing-half);
}

.c2 {
.c3 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
Expand All @@ -33,56 +33,79 @@ exports[`CurrencyInput Component matches snapshot (en-CA) 1`] = `
outline: none;
padding: 0 var(--spacing-1x);
width: 100%;
border: 0;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 100%;
}

.c2::-webkit-input-placeholder {
.c3::-webkit-input-placeholder {
color: #60666E;
}

.c2::-moz-placeholder {
.c3::-moz-placeholder {
color: #60666E;
}

.c2:-ms-input-placeholder {
.c3:-ms-input-placeholder {
color: #60666E;
}

.c2::placeholder {
.c3::placeholder {
color: #60666E;
}

.c2:disabled {
.c3:disabled {
background-color: #F1F2F2;
border-color: #B7BBC2;
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-webkit-input-placeholder {
.c3:disabled,
.c3:disabled::-webkit-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-moz-placeholder {
.c3:disabled,
.c3:disabled::-moz-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled:-ms-input-placeholder {
.c3:disabled,
.c3:disabled:-ms-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::placeholder {
.c3:disabled,
.c3:disabled::placeholder {
color: #B7BBC2;
}

.c3:focus,
.c3:disabled {
border: 0;
box-shadow: none;
}

.c2 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-sizing: border-box;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: var(--size-2x);
}

.c2 {
outline: 2px solid transparent;
outline-offset: -2px;
}

.c2:focus {
.c2:focus-within {
box-shadow: 0 0 0 2px #006296;
outline: 2px solid #84C6EA;
outline-offset: -2px;
Expand All @@ -100,15 +123,19 @@ exports[`CurrencyInput Component matches snapshot (en-CA) 1`] = `
class="c1"
data-testid="field-container"
>
<input
<div
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je sais pas si c'est voulu, mais cette div là dans le MoneyInput affecte la longueur du champ. C'est peut-être mieux de même pour pouvoir ajuster plus facilement la longueur du champ par contre.

Copy link
Contributor Author

@WilliamsTardif WilliamsTardif Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne crois pas que sa soit voulu 😅
Mais bien heureux de l'avoir améliorer en quelque sorte 👌

class="c2"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="$100.00"
/>
>
<input
class="c3"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="$100.00"
/>
</div>
</div>
</div>
`;
Expand All @@ -128,7 +155,7 @@ exports[`CurrencyInput Component matches snapshot (en-US) 1`] = `
margin-bottom: var(--spacing-half);
}

.c2 {
.c3 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
Expand All @@ -146,56 +173,79 @@ exports[`CurrencyInput Component matches snapshot (en-US) 1`] = `
outline: none;
padding: 0 var(--spacing-1x);
width: 100%;
border: 0;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 100%;
}

.c2::-webkit-input-placeholder {
.c3::-webkit-input-placeholder {
color: #60666E;
}

.c2::-moz-placeholder {
.c3::-moz-placeholder {
color: #60666E;
}

.c2:-ms-input-placeholder {
.c3:-ms-input-placeholder {
color: #60666E;
}

.c2::placeholder {
.c3::placeholder {
color: #60666E;
}

.c2:disabled {
.c3:disabled {
background-color: #F1F2F2;
border-color: #B7BBC2;
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-webkit-input-placeholder {
.c3:disabled,
.c3:disabled::-webkit-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-moz-placeholder {
.c3:disabled,
.c3:disabled::-moz-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled:-ms-input-placeholder {
.c3:disabled,
.c3:disabled:-ms-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::placeholder {
.c3:disabled,
.c3:disabled::placeholder {
color: #B7BBC2;
}

.c3:focus,
.c3:disabled {
border: 0;
box-shadow: none;
}

.c2 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-sizing: border-box;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: var(--size-2x);
}

.c2 {
outline: 2px solid transparent;
outline-offset: -2px;
}

.c2:focus {
.c2:focus-within {
box-shadow: 0 0 0 2px #006296;
outline: 2px solid #84C6EA;
outline-offset: -2px;
Expand All @@ -213,15 +263,19 @@ exports[`CurrencyInput Component matches snapshot (en-US) 1`] = `
class="c1"
data-testid="field-container"
>
<input
<div
class="c2"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="$100.00"
/>
>
<input
class="c3"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="$100.00"
/>
</div>
</div>
</div>
`;
Expand All @@ -241,7 +295,7 @@ exports[`CurrencyInput Component matches snapshot (fr-CA) 1`] = `
margin-bottom: var(--spacing-half);
}

.c2 {
.c3 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
Expand All @@ -259,56 +313,79 @@ exports[`CurrencyInput Component matches snapshot (fr-CA) 1`] = `
outline: none;
padding: 0 var(--spacing-1x);
width: 100%;
border: 0;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 100%;
}

.c2::-webkit-input-placeholder {
.c3::-webkit-input-placeholder {
color: #60666E;
}

.c2::-moz-placeholder {
.c3::-moz-placeholder {
color: #60666E;
}

.c2:-ms-input-placeholder {
.c3:-ms-input-placeholder {
color: #60666E;
}

.c2::placeholder {
.c3::placeholder {
color: #60666E;
}

.c2:disabled {
.c3:disabled {
background-color: #F1F2F2;
border-color: #B7BBC2;
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-webkit-input-placeholder {
.c3:disabled,
.c3:disabled::-webkit-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::-moz-placeholder {
.c3:disabled,
.c3:disabled::-moz-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled:-ms-input-placeholder {
.c3:disabled,
.c3:disabled:-ms-input-placeholder {
color: #B7BBC2;
}

.c2:disabled,
.c2:disabled::placeholder {
.c3:disabled,
.c3:disabled::placeholder {
color: #B7BBC2;
}

.c3:focus,
.c3:disabled {
border: 0;
box-shadow: none;
}

.c2 {
background: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-sizing: border-box;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: var(--size-2x);
}

.c2 {
outline: 2px solid transparent;
outline-offset: -2px;
}

.c2:focus {
.c2:focus-within {
box-shadow: 0 0 0 2px #006296;
outline: 2px solid #84C6EA;
outline-offset: -2px;
Expand All @@ -326,15 +403,19 @@ exports[`CurrencyInput Component matches snapshot (fr-CA) 1`] = `
class="c1"
data-testid="field-container"
>
<input
<div
class="c2"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="100,00 $"
/>
>
<input
class="c3"
data-testid="text-input"
id="uuid1"
inputmode="numeric"
placeholder="$"
type="text"
value="100,00 $"
/>
</div>
</div>
</div>
`;
Loading