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 committed Jul 7, 2023
1 parent 4f34462 commit 46e9fd8
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--leftIcon']: size !== 'tiny' && icon,
['Input--rightIcon']: !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--leftIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -89,7 +89,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular"
class="Input Input--regular Input--leftIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -382,7 +382,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--leftIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -443,7 +443,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--leftIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -502,7 +502,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--error"
class="Input Input--regular Input--error Input--leftIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand Down Expand Up @@ -561,7 +561,7 @@ exports[`Input component
<body>
<div>
<div
class="Input Input--regular Input--disabled"
class="Input Input--regular Input--disabled Input--leftIcon"
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 @@ -5157,7 +5157,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--leftIcon Input--rightIcon"
data-test="DesignSystem-InputWrapper"
role="presentation"
style="min-width: 256px;"
Expand All @@ -5182,7 +5182,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-round Icon Input-icon--right"
Expand Down
Loading

0 comments on commit 46e9fd8

Please sign in to comment.