Skip to content

Commit

Permalink
Merge pull request #1318 from Bynder/GC-3418-contributor-text-input-v…
Browse files Browse the repository at this point in the history
…isual-regression

GC-3418 Contributor text input visual regression
  • Loading branch information
lewishankinson authored Nov 3, 2023
2 parents 9e9047f + a6e7f18 commit 0ee555e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/src/components/personSearch/PersonSearch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
export function PersonSearch(args: any) {
const getPerson = () => ({
name: faker.name.findName(),
subtitle: faker.internet.email(),
email: faker.internet.email(),
avatar: faker.image.avatar(),
selected: faker.random.boolean()
});
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/personSearch/PersonSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function PersonSearch({
onBlur={() => (showContent ? null : toggleShowContent(true))}
onChange={(e: any) => setSearchValue(e.target.value)}
value={searchValue}
size={Input.sizes.md}
/>
</>
)}
Expand Down
15 changes: 8 additions & 7 deletions lib/src/modules/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ import * as React from "react";
import cx from "classnames";
import { InputHelper } from "./InputHelper";

interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
const sizes = {
md: "md",
sm: "sm",
} as const;

interface Props
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
valid?: boolean;
invalid?: boolean;
enhanceNativeSupport?: boolean;
inputRef?: React.RefObject<HTMLInputElement>;
size?: (typeof sizes)[keyof typeof sizes];
}

export function Input({
Expand Down Expand Up @@ -51,10 +58,4 @@ export function Input({
}

Input.Helper = InputHelper;

const sizes = {
md: "md",
sm: "sm",
};

Input.sizes = sizes;

0 comments on commit 0ee555e

Please sign in to comment.