diff --git a/packages/react/src/components/money-input/money-input.test.tsx.snap b/packages/react/src/components/money-input/money-input.test.tsx.snap index 8f48aa6938..1a7338f42d 100644 --- a/packages/react/src/components/money-input/money-input.test.tsx.snap +++ b/packages/react/src/components/money-input/money-input.test.tsx.snap @@ -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); @@ -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; @@ -100,15 +123,19 @@ exports[`CurrencyInput Component matches snapshot (en-CA) 1`] = ` class="c1" data-testid="field-container" > - + > + + `; @@ -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); @@ -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; @@ -213,15 +263,19 @@ exports[`CurrencyInput Component matches snapshot (en-US) 1`] = ` class="c1" data-testid="field-container" > - + > + + `; @@ -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); @@ -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; @@ -326,15 +403,19 @@ exports[`CurrencyInput Component matches snapshot (fr-CA) 1`] = ` class="c1" data-testid="field-container" > - + > + + `; diff --git a/packages/react/src/components/password-creation-input/password-creation-input.tsx b/packages/react/src/components/password-creation-input/password-creation-input.tsx index 6f0219ddc3..86bcb8e333 100644 --- a/packages/react/src/components/password-creation-input/password-creation-input.tsx +++ b/packages/react/src/components/password-creation-input/password-creation-input.tsx @@ -3,7 +3,6 @@ import styled from 'styled-components'; import { useDeviceContext } from '../device-context-provider/device-context-provider'; import { IconButton } from '../buttons/icon-button'; import { FieldContainer } from '../field-container/field-container'; -import { Input } from '../text-input/text-input'; import { useTranslation } from '../../i18n/use-translation'; import { Tooltip } from '../tooltip/tooltip'; import { getPasswordStrength } from './password-strength'; @@ -12,6 +11,7 @@ import { getDefaultValidationConditions, ValidationCondition } from './validatio import { v4 as uuid } from '../../utils/uuid'; import { PasswordStrengthContainer } from './password-strength-container'; import { useDataAttributes } from '../../hooks/use-data-attributes'; +import { inputsStyle } from '../text-input/styles/inputs'; const StyledUl = styled.ul` font-size: 0.75rem; @@ -26,7 +26,8 @@ const PasswordInputContainer = styled.div` position: relative; `; -const StyledInput = styled(Input)` +const StyledInput = styled.input<{ isMobile: boolean }>` + ${({ theme, isMobile }) => inputsStyle({ theme, isMobile, isFocusable: false })}; padding-right: var(--size-2x); `; diff --git a/packages/react/src/components/password-input/password-input.test.tsx.snap b/packages/react/src/components/password-input/password-input.test.tsx.snap index 459d17d005..69c406502f 100644 --- a/packages/react/src/components/password-input/password-input.test.tsx.snap +++ b/packages/react/src/components/password-input/password-input.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` -.c6 { +.c5 { -webkit-align-items: center; -webkit-box-align: center; -ms-flex-align: center; @@ -41,23 +41,23 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` user-select: none; } -.c6 { +.c5 { outline: 2px solid transparent; outline-offset: -2px; } -.c6:focus { +.c5:focus { box-shadow: 0 0 0 2px #006296; outline: 2px solid #84C6EA; outline-offset: -2px; } -.c6 > svg { +.c5 > svg { height: var(--size-1x); width: var(--size-1x); } -.c7 { +.c6 { background-color: transparent; border-color: transparent; color: #60666E; @@ -66,43 +66,43 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: var(--size-1halfx); } -.c7 { +.c6 { outline: 2px solid transparent; outline-offset: -2px; } -.c7:focus { +.c6:focus { box-shadow: 0 0 0 2px #006296; outline: 2px solid #84C6EA; outline-offset: -2px; } -.c7:hover, -.c7[aria-expanded='true'] { +.c6:hover, +.c6[aria-expanded='true'] { background-color: rgb(0 0 0 / 0.15); border-color: transparent; color: #000000; } -.c7[aria-disabled='true'] { +.c6[aria-disabled='true'] { background-color: transparent; border-color: transparent; color: #B7BBC2; cursor: not-allowed; } -.c7 > svg { +.c6 > svg { height: var(--size-1x); width: var(--size-1x); } -.c10 { +.c9 { height: 1.25rem; position: absolute; width: 1rem; } -.c10::before { +.c9::before { border-style: solid; content: ''; display: block; @@ -111,7 +111,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: 0; } -.c10::after { +.c9::after { border-style: solid; content: ''; display: block; @@ -121,7 +121,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: 0; } -.c8 { +.c7 { background-color: #60666E; border: 1px solid #FFFFFF; border-radius: var(--border-radius-half); @@ -147,7 +147,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` z-index: 1000; } -.c8[data-popper-placement*="bottom"] > .c9 { +.c7[data-popper-placement*="bottom"] > .c8 { height: 1rem; left: 0; margin-top: -0.375rem; @@ -155,19 +155,19 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: 1rem; } -.c8[data-popper-placement*="bottom"] > .c9::before { +.c7[data-popper-placement*="bottom"] > .c8::before { border-color: transparent transparent #FFFFFF transparent; border-width: 0 0.5rem 0.5rem; position: absolute; top: -2px; } -.c8[data-popper-placement*="bottom"] > .c9::after { +.c7[data-popper-placement*="bottom"] > .c8::after { border-color: transparent transparent #60666E transparent; border-width: 0 0.5rem 0.5rem; } -.c8[data-popper-placement*="top"] > .c9 { +.c7[data-popper-placement*="top"] > .c8 { bottom: 0; height: 0; left: 0; @@ -175,58 +175,58 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: 1rem; } -.c8[data-popper-placement*="top"] > .c9::before { +.c7[data-popper-placement*="top"] > .c8::before { border-color: #FFFFFF transparent transparent transparent; border-width: 0.5rem 0.5rem 0; position: absolute; top: 0; } -.c8[data-popper-placement*="top"] > .c9::after { +.c7[data-popper-placement*="top"] > .c8::after { border-color: #60666E transparent transparent transparent; border-width: 0.5rem 0.5rem 0; top: -0.1rem; } -.c8[data-popper-placement*="right"] > .c9 { +.c7[data-popper-placement*="right"] > .c8 { height: 1rem; left: 0; margin-left: -0.8rem; width: 1rem; } -.c8[data-popper-placement*="right"] > .c9::before { +.c7[data-popper-placement*="right"] > .c8::before { border-color: transparent #FFFFFF transparent transparent; border-width: 0.5rem 0.5rem 0.5rem 0; } -.c8[data-popper-placement*="right"] > .c9::after { +.c7[data-popper-placement*="right"] > .c8::after { border-color: transparent #60666E transparent transparent; border-width: 0.5rem 0.5rem 0.5rem 0; left: 0.375rem; top: 0; } -.c8[data-popper-placement*="left"] > .c9 { +.c7[data-popper-placement*="left"] > .c8 { height: 1rem; margin-right: -0.7rem; right: -1px; width: 1rem; } -.c8[data-popper-placement*="left"] > .c9::before { +.c7[data-popper-placement*="left"] > .c8::before { border-color: transparent transparent transparent #FFFFFF; border-width: 0.5rem 0 0.5rem 0.5rem; } -.c8[data-popper-placement*="left"] > .c9::after { +.c7[data-popper-placement*="left"] > .c8::after { border-color: transparent transparent transparent #60666E; border-width: 0.5rem 0 0.5rem 0.5rem; left: 0.17rem; top: 0; } -.c11 { +.c10 { -webkit-align-items: center; -webkit-box-align: center; -ms-flex-align: center; @@ -237,7 +237,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` display: flex; } -.c5 { +.c4 { -webkit-align-items: center; -webkit-box-align: center; -ms-flex-align: center; @@ -251,12 +251,12 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` width: fit-content; } -.c5 { +.c4 { outline: 2px solid transparent; outline-offset: -2px; } -.c5:focus { +.c4:focus { box-shadow: 0 0 0 2px #006296; outline: 2px solid #84C6EA; outline-offset: -2px; @@ -276,6 +276,18 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` margin-bottom: var(--spacing-half); } +.c1 { + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; +} + .c2 { background: #FFFFFF; border: 1px solid #60666E; @@ -294,6 +306,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` outline: none; padding: 0 var(--spacing-1x); width: 100%; + padding-right: var(--size-2x); } .c2::-webkit-input-placeholder { @@ -338,34 +351,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = ` color: #B7BBC2; } -.c2 { - outline: 2px solid transparent; - outline-offset: -2px; -} - -.c2:focus { - box-shadow: 0 0 0 2px #006296; - outline: 2px solid #84C6EA; - outline-offset: -2px; -} - -.c1 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - position: relative; -} - .c3 { - padding-right: var(--size-2x); -} - -.c4 { position: absolute; right: 0.25rem; } @@ -379,7 +365,7 @@ exports[`PasswordInput matches the snapshot (Disabled) 1`] = `