Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { useState } from 'react'
|
||||
import { TextField } from 'react-aria-components'
|
||||
import { useState } from "react"
|
||||
import { TextField } from "react-aria-components"
|
||||
import {
|
||||
Controller,
|
||||
type RegisterOptions,
|
||||
useFormContext,
|
||||
} from 'react-hook-form'
|
||||
import { useIntl, type IntlShape } from 'react-intl'
|
||||
} from "react-hook-form"
|
||||
import { useIntl, type IntlShape } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { Input } from '../Input'
|
||||
import { Typography } from '../Typography'
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||
import { Input } from "../Input"
|
||||
import { Typography } from "../Typography"
|
||||
|
||||
import { NewPasswordValidation } from './NewPasswordValidation'
|
||||
import { NewPasswordValidation } from "./NewPasswordValidation"
|
||||
|
||||
import styles from './passwordInput.module.css'
|
||||
import styles from "./passwordInput.module.css"
|
||||
|
||||
const defaultErrorFormatter = (
|
||||
_intl: IntlShape,
|
||||
errorMessage?: string
|
||||
): string => errorMessage ?? ''
|
||||
): string => errorMessage ?? ""
|
||||
|
||||
interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string
|
||||
@@ -31,15 +31,15 @@ interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
||||
}
|
||||
|
||||
export const PasswordInput = ({
|
||||
name = 'password',
|
||||
name = "password",
|
||||
label,
|
||||
'aria-label': ariaLabel,
|
||||
"aria-label": ariaLabel,
|
||||
disabled = false,
|
||||
placeholder,
|
||||
registerOptions = {},
|
||||
visibilityToggleable = true,
|
||||
isNewPassword = false,
|
||||
className = '',
|
||||
className = "",
|
||||
errorFormatter,
|
||||
}: PasswordInputProps) => {
|
||||
const { control } = useFormContext()
|
||||
@@ -71,7 +71,7 @@ export const PasswordInput = ({
|
||||
isNewPassword && field.value ? requirementsId : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ') || undefined
|
||||
.join(" ") || undefined
|
||||
|
||||
const hasError = !!fieldState.error
|
||||
const showRequirements = isNewPassword && !!field.value
|
||||
@@ -91,7 +91,7 @@ export const PasswordInput = ({
|
||||
validationBehavior="aria"
|
||||
value={field.value}
|
||||
type={
|
||||
visibilityToggleable && isPasswordVisible ? 'text' : 'password'
|
||||
visibilityToggleable && isPasswordVisible ? "text" : "password"
|
||||
}
|
||||
>
|
||||
<div className={styles.inputWrapper}>
|
||||
@@ -102,19 +102,19 @@ export const PasswordInput = ({
|
||||
label ||
|
||||
(isNewPassword
|
||||
? intl.formatMessage({
|
||||
id: 'passwordInput.newPasswordLabel',
|
||||
defaultMessage: 'New password',
|
||||
id: "passwordInput.newPasswordLabel",
|
||||
defaultMessage: "New password",
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'common.password',
|
||||
defaultMessage: 'Password',
|
||||
id: "common.password",
|
||||
defaultMessage: "Password",
|
||||
}))
|
||||
}
|
||||
placeholder={placeholder}
|
||||
type={
|
||||
visibilityToggleable && isPasswordVisible
|
||||
? 'text'
|
||||
: 'password'
|
||||
? "text"
|
||||
: "password"
|
||||
}
|
||||
/>
|
||||
{visibilityToggleable ? (
|
||||
@@ -124,12 +124,12 @@ export const PasswordInput = ({
|
||||
aria-label={
|
||||
isPasswordVisible
|
||||
? intl.formatMessage({
|
||||
id: 'passwordInput.hidePassword',
|
||||
defaultMessage: 'Hide password',
|
||||
id: "passwordInput.hidePassword",
|
||||
defaultMessage: "Hide password",
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'passwordInput.showPassword',
|
||||
defaultMessage: 'Show password',
|
||||
id: "passwordInput.showPassword",
|
||||
defaultMessage: "Show password",
|
||||
})
|
||||
}
|
||||
aria-controls={inputId}
|
||||
@@ -137,7 +137,7 @@ export const PasswordInput = ({
|
||||
className={styles.toggleButton}
|
||||
>
|
||||
<MaterialIcon
|
||||
icon={isPasswordVisible ? 'visibility_off' : 'visibility'}
|
||||
icon={isPasswordVisible ? "visibility_off" : "visibility"}
|
||||
size={24}
|
||||
/>
|
||||
</button>
|
||||
@@ -186,8 +186,8 @@ function ErrorMessage({
|
||||
icon="info"
|
||||
color="Icon/Feedback/Error"
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'common.error',
|
||||
defaultMessage: 'Error',
|
||||
id: "common.error",
|
||||
defaultMessage: "Error",
|
||||
})}
|
||||
/>
|
||||
{formatErrorMessage(intl, errorMessage)}
|
||||
|
||||
Reference in New Issue
Block a user