Skip to content

Commit

Permalink
fix(inputtext): removed min-width from InputText and InputSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
masoudmanson committed Oct 1, 2024
1 parent c1b736c commit 3ee8760
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`<Autocomplete /> ControlledOpen story renders snapshot 1`] = `
Search by label
</label>
<div
class="MuiFormControl-root MuiTextField-root css-1p7z5as-MuiFormControl-root-MuiTextField-root"
class="MuiFormControl-root MuiTextField-root css-1dk6d19-MuiFormControl-root-MuiTextField-root"
>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart MuiInputBase-adornedEnd css-2ehmn7-MuiInputBase-root-MuiOutlinedInput-root"
Expand Down Expand Up @@ -141,7 +141,7 @@ exports[`<Autocomplete /> ControlledOpen story renders snapshot 1`] = `
<div
aria-hidden="true"
aria-label="Search Input"
class="MuiFormControl-root MuiTextField-root css-1o2qh3k-MuiFormControl-root-MuiTextField-root"
class="MuiFormControl-root MuiTextField-root css-undfwx-MuiFormControl-root-MuiTextField-root"
tabindex="-1"
>
<div
Expand Down Expand Up @@ -556,7 +556,7 @@ exports[`<Autocomplete /> ControlledOpen story renders snapshot 1`] = `
<div
aria-hidden="true"
aria-label="Search Input"
class="MuiFormControl-root MuiTextField-root css-1o2qh3k-MuiFormControl-root-MuiTextField-root"
class="MuiFormControl-root MuiTextField-root css-undfwx-MuiFormControl-root-MuiTextField-root"
tabindex="-1"
>
<div
Expand Down Expand Up @@ -982,7 +982,7 @@ exports[`<Autocomplete /> Default story renders snapshot 1`] = `
<div
aria-hidden="false"
aria-label="Search Input"
class="MuiFormControl-root MuiTextField-root css-1vdkloj-MuiFormControl-root-MuiTextField-root"
class="MuiFormControl-root MuiTextField-root css-hmaycg-MuiFormControl-root-MuiTextField-root"
tabindex="0"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const InputSearch = (props: Args): JSX.Element => {
intent={intent}
handleSubmit={handleSubmit}
name="input-search-name"
sx={{ width: "200px" }}
/>
);
};
10 changes: 10 additions & 0 deletions packages/components/src/core/InputSearch/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ export const StyledSearchBase = styled(TextField, {
.${outlinedInputClasses.root} {
padding: 0 ${spaces?.m}px;
background-color: ${semanticColors?.base?.surfacePrimary};
width: 100%;
.${outlinedInputClasses.input} {
padding-right: ${spaces?.l}px;
}
.MuiInputAdornment-positionEnd {
position: absolute;
right: ${spaces?.m}px;
}
.${outlinedInputClasses.notchedOutline} {
border: 1px solid ${semanticColors?.base?.border};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const InputText = (props: Args): JSX.Element => {
disabled={disabled}
name="input-text-name"
autoComplete="off"
sx={{ width: "200px" }}
/>
);
};
6 changes: 5 additions & 1 deletion packages/components/src/core/InputText/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ export const StyledInputBase = styled(TextField, {
return css`
margin-bottom: ${spaces?.l}px;
margin-right: ${spaces?.m}px;
min-width: 160px;
display: block;
.${outlinedInputClasses.root} {
width: 100%;
}
.${outlinedInputClasses.inputSizeSmall} {
${fontBodyXs(props)}
padding: ${spaces?.xs}px ${spaces?.m}px;
Expand All @@ -144,6 +147,7 @@ export const StyledInputBase = styled(TextField, {
.${outlinedInputClasses.input} {
outline: none;
border-radius: 4px;
width: 100%;
}
&.user-is-tabbing .${outlinedInputClasses.input} {
Expand Down

0 comments on commit 3ee8760

Please sign in to comment.