Skip to content

Commit

Permalink
chore: Removing prop theme from input and updating snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosViniciusPC committed Oct 4, 2024
1 parent c5fc830 commit 0645544
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 35 deletions.
2 changes: 1 addition & 1 deletion components/Form/__snapshots__/Form.unit.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ exports[`Form component should match the snapshot 1`] = `
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="ClearIcon"
description=""
Expand Down
26 changes: 3 additions & 23 deletions components/Input/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
RequiredMark,
InputErrorMessage,
} from './sub-components';
import { spacing, colors, baseFontSize } from '../shared/theme';
import styles from './Input.module.css';

const uniqId = createUniqId('input-');
Expand Down Expand Up @@ -107,7 +106,6 @@ class Input extends Component {
helperText,
required,
onClean,
theme,
disabled,
skin,
...rest
Expand Down Expand Up @@ -142,9 +140,7 @@ class Input extends Component {
<span className={descriptionLabelClass}>{descriptionLabel}</span>
)}
<div className={inputWrapperClass}>
{_isSearchType && (
<InputSearchIcon description={descriptionLabel} theme={theme} />
)}
{_isSearchType && <InputSearchIcon description={descriptionLabel} />}
<MaskedInput
{...rest}
disabled={disabled}
Expand All @@ -167,35 +163,25 @@ class Input extends Component {
)}
/>
{error && !_isPassword && (
<InputErrorIcon
description={descriptionLabel}
theme={theme}
skin={skin}
/>
<InputErrorIcon description={descriptionLabel} skin={skin} />
)}
{_isPassword && (
<InputIcon
theme={theme}
name={typeState === 'password' ? 'visibility' : 'visibility_off'}
description={descriptionLabel}
onClick={this._toggleInputType}
/>
)}
{hasValue && !_isPassword && !error && !disabled && (
<InputIcon
theme={theme}
name="clear"
description={descriptionLabel}
onClick={onCleanClick}
/>
)}
</div>
{helperText && <HelperText>{helperText}</HelperText>}
{error && (
<InputErrorMessage theme={theme} skin={skin}>
{error}
</InputErrorMessage>
)}
{error && <InputErrorMessage skin={skin}>{error}</InputErrorMessage>}
</FieldGroup>
);
}
Expand Down Expand Up @@ -235,11 +221,6 @@ Input.propTypes = {
]),
onClean: PropTypes.func,
onChange: PropTypes.func,
theme: PropTypes.shape({
spacing: PropTypes.object,
colors: PropTypes.object,
baseFontSize: PropTypes.number,
}),
minLength: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
maxLength: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
skin: PropTypes.oneOf(['default', 'dark']),
Expand All @@ -259,7 +240,6 @@ Input.defaultProps = {
placeholder: '',
onClean: () => {},
onChange: () => {},
theme: { spacing, colors, baseFontSize },
minLength: 0,
maxLength: 255,
skin: 'default',
Expand Down
11 changes: 5 additions & 6 deletions components/Input/__snapshots__/Input.mask.unit.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ exports[`Input component should match snapshots 2`] = `
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="ClearIcon"
description=""
Expand Down Expand Up @@ -275,7 +275,7 @@ exports[`Input component should match snapshots 4`] = `
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__error-icon-default___eeNn1 css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__error-icon-default___eeNn1 css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="ErrorIcon"
description=""
Expand All @@ -290,7 +290,6 @@ exports[`Input component should match snapshots 4`] = `
</div>
<span
class="ErrorMessage-module__error-message___MWbU-"
theme="[object Object]"
>
Error message
</span>
Expand Down Expand Up @@ -401,7 +400,7 @@ exports[`Input component should match snapshots 6`] = `
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__search-icon___s5j0Q css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__search-icon___s5j0Q css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="SearchIcon"
description=""
Expand Down Expand Up @@ -679,7 +678,7 @@ exports[`Input component should match snapshots 10`] = `
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__search-icon___s5j0Q css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN Input-module__search-icon___s5j0Q css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="SearchIcon"
description="this is a description label"
Expand Down Expand Up @@ -1069,7 +1068,7 @@ exports[`Input component should match snapshots 17`] = `
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-1696fkf-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium Input-module__input-icon___gieRN css-i4bv87-MuiSvgIcon-root"
data-qtm-preloader="icon"
data-testid="VisibilityIcon"
description=""
Expand Down
5 changes: 0 additions & 5 deletions components/Input/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
minLength?: number;
maxLength?: number;
skin?: 'default' | 'dark';
theme?: {
spacing?: {};
colors?: {};
baseFontSize?: number;
};
}

declare const Input: FC<InputProps> & {
Expand Down

0 comments on commit 0645544

Please sign in to comment.