Skip to content

Commit

Permalink
Merge pull request #497 from team-monite/feat/DEV-13434-new-styles-fo…
Browse files Browse the repository at this point in the history
…r-display-components

feat(DEV-13434): new styles for display components and form controls
  • Loading branch information
saladNights authored Dec 20, 2024
2 parents bd71671 + 06da3d0 commit d210da6
Show file tree
Hide file tree
Showing 32 changed files with 439 additions and 229 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-jokes-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@monite/sdk-react': minor
---

feat(DEV-13434): new styles for display components and form controls
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const RHFAutocomplete = <
return (params: AutocompleteRenderInputParams) => (
<TextField
{...params}
variant="standard"
required={required}
label={label}
error={!!error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const RHFDatePicker = <T extends FieldValues>({
container: root,
},
textField: {
variant: 'standard',
...slotProps?.textField,
id: name,
error: isInvalid && !!error?.message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const RHFTextField = <T extends FieldValues>({
{...field}
{...other}
id={name}
variant="standard"
value={field.value ?? ''} // This makes component controlled https://mui.com/material-ui/react-text-field/#uncontrolled-vs-controlled otherwise there are warnings in console
error={isInvalid && !!error?.message}
helperText={isInvalid && error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const RHFTextFieldPhone = <T extends FieldValues>({
{...otherField}
{...other}
id={name}
variant="standard"
onChange={(value) => onChange(value)}
value={value ?? ''} // This makes component controlled https://mui.com/material-ui/react-text-field/#uncontrolled-vs-controlled otherwise there are warnings in console
error={isInvalid && !!error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const RHFTimePicker = <T extends FieldValues>({
<TimeField
{...field}
{...other}
variant="standard"
required={required}
fullWidth={fullWidth}
value={date}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const AutocompleteTags = ({
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const CounterpartAddressForm = ({
<TextField
id={field.name}
label={t(i18n)`Address line 1`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -65,7 +65,7 @@ export const CounterpartAddressForm = ({
<TextField
id={field.name}
label={t(i18n)`Address line 2`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -80,7 +80,7 @@ export const CounterpartAddressForm = ({
<TextField
id={field.name}
label={t(i18n)`City`}
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand All @@ -96,7 +96,7 @@ export const CounterpartAddressForm = ({
<TextField
id={field.name}
label={t(i18n)`ZIP code`}
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand All @@ -112,7 +112,7 @@ export const CounterpartAddressForm = ({
<TextField
id={field.name}
label={t(i18n)`State / Area / Province`}
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand All @@ -126,7 +126,7 @@ export const CounterpartAddressForm = ({
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const CounterpartAddressFormUpdate = (
<TextField
id={field.name}
label={t(i18n)`Address line 1`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -81,7 +81,7 @@ export const CounterpartAddressFormUpdate = (
<TextField
id={field.name}
label={t(i18n)`Address line 2`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -96,7 +96,7 @@ export const CounterpartAddressFormUpdate = (
<TextField
id={field.name}
label={t(i18n)`City`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -112,7 +112,7 @@ export const CounterpartAddressFormUpdate = (
<TextField
id={field.name}
label={t(i18n)`ZIP code`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -128,7 +128,7 @@ export const CounterpartAddressFormUpdate = (
<TextField
id={field.name}
label={t(i18n)`State / Area / Province`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -142,7 +142,7 @@ export const CounterpartAddressFormUpdate = (
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Account name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -113,7 +113,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Bank account holder name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -128,7 +128,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`IBAN`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -143,7 +143,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Account number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -158,7 +158,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Sort code`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -173,7 +173,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Routing number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -188,7 +188,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
<TextField
id={field.name}
label={t(i18n)`BIC`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -201,7 +201,7 @@ export const CounterpartBankForm = (props: CounterpartBankFormProps) => {
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
required
error={Boolean(error)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const CounterpartContactForm = (props: CounterpartContactFormProps) => {
<TextField
id={field.name}
label={t(i18n)`First name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -99,7 +99,7 @@ export const CounterpartContactForm = (props: CounterpartContactFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Last name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -119,7 +119,7 @@ export const CounterpartContactForm = (props: CounterpartContactFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Email`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -137,7 +137,7 @@ export const CounterpartContactForm = (props: CounterpartContactFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Phone number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`First name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -224,7 +224,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Last name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down Expand Up @@ -312,7 +312,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Email`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -336,7 +336,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Phone number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down Expand Up @@ -367,7 +367,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Tax ID`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const CounterpartOrganizationForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Company name`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down Expand Up @@ -296,7 +296,7 @@ export const CounterpartOrganizationForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Email`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -320,7 +320,7 @@ export const CounterpartOrganizationForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Phone number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down Expand Up @@ -370,7 +370,7 @@ export const CounterpartOrganizationForm = (props: CounterpartsFormProps) => {
<TextField
id={field.name}
label={t(i18n)`Tax ID`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ const PayableDetailsFormBase = forwardRef<
{...field}
id={field.name}
label={t(i18n)`Number`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand All @@ -426,7 +426,7 @@ const PayableDetailsFormBase = forwardRef<
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
required={
Expand Down Expand Up @@ -479,7 +479,7 @@ const PayableDetailsFormBase = forwardRef<
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
required={
Expand Down Expand Up @@ -609,7 +609,7 @@ const PayableDetailsFormBase = forwardRef<
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
variant="outlined"
variant="standard"
fullWidth
disabled={isTagsDisabled}
required={isFieldRequired(
Expand Down Expand Up @@ -639,7 +639,7 @@ const PayableDetailsFormBase = forwardRef<
<TextField
{...params}
label={t(i18n)`Tags`}
variant="outlined"
variant="standard"
fullWidth
error={Boolean(error)}
helperText={error?.message}
Expand Down
Loading

0 comments on commit d210da6

Please sign in to comment.