Skip to content

Commit

Permalink
fix(input): update right icon margin and padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Satyam Chatterjee authored and saty2103 committed Sep 7, 2023
1 parent f89b6b3 commit 4c88f9f
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 67 deletions.
5 changes: 4 additions & 1 deletion core/components/atoms/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export interface InputProps extends BaseProps, BaseHtmlProps<HTMLInputElement> {
const sizeMapping = {
tiny: 12,
regular: 16,
large: 20,
large: 16,
};

/**
Expand Down Expand Up @@ -192,6 +192,8 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>((props, forw
[`Input--${size}`]: size,
['Input--disabled']: disabled || readOnly,
['Input--error']: error,
['Input--withIcon--left']: size !== 'tiny' && icon,
['Input--withIcon--right']: !disabled && (info || ((actionIcon || onClear) && (value || defaultValue))),
},
className
);
Expand All @@ -211,6 +213,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>((props, forw
const rightIconClass = classNames({
['Input-icon']: true,
['Input-iconWrapper--right']: true,
['ml-4']: true,
});

const trigger = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular"
class="Input Input--regular Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -90,7 +90,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular"
class="Input Input--regular Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -384,7 +384,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -446,7 +446,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -506,7 +506,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--error"
class="Input Input--regular Input--error Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -566,7 +566,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--withIcon--left"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down
1 change: 1 addition & 0 deletions core/components/atoms/input/actionButton/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const ActionButton = (props: ActionButtonProps) => {
[`material-icons-${type}`]: type && type !== 'filled',
['ActionButton']: true,
[`${className}`]: className,
['ml-4']: true,
});

const styles = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons material-icons-round ActionButton"
class="material-icons material-icons-round ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand All @@ -24,7 +24,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons ActionButton"
class="material-icons ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand All @@ -42,7 +42,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons material-icons-outlined ActionButton"
class="material-icons material-icons-outlined ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand All @@ -60,7 +60,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons material-icons-round ActionButton"
class="material-icons material-icons-round ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand All @@ -78,7 +78,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons material-icons-sharp ActionButton"
class="material-icons material-icons-sharp ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand All @@ -96,7 +96,7 @@ exports[`ActionButton component
<body>
<div>
<i
class="material-icons material-icons-two-tone ActionButton"
class="material-icons material-icons-two-tone ActionButton ml-4"
data-test="DesignSystem-Input-ActionButton"
role="button"
style="font-size: 16px; width: 16px;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5172,7 +5172,7 @@ exports[`DatePicker component snapshots renders snapshot for prop:withInput
data-test="DesignSystem-InputMask--Wrapper"
>
<div
class="Input Input--regular"
class="Input Input--regular Input--withIcon--left Input--withIcon--right"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand All @@ -5198,7 +5198,7 @@ exports[`DatePicker component snapshots renders snapshot for prop:withInput
value="03/01/2020"
/>
<div
class="Input-icon Input-iconWrapper--right"
class="Input-icon Input-iconWrapper--right ml-4"
>
<i
class="material-icons material-icons-rounded Icon Input-icon--right"
Expand Down
Loading

0 comments on commit 4c88f9f

Please sign in to comment.