Skip to content

Commit

Permalink
fix: add input type search
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Jun 21, 2024
1 parent 613af59 commit d07a319
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/input-elements/BaseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getSelectButtonColors, hasValue } from "components/input-elements/selec
import { mergeRefs, tremorTwMerge } from "lib";

export interface BaseInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
type?: "text" | "password" | "email" | "url" | "number";
type?: "text" | "password" | "email" | "url" | "number" | "search";
defaultValue?: string | number;
value?: string | number;
icon?: React.ElementType | React.JSXElementConstructor<any>;
Expand Down
1 change: 0 additions & 1 deletion src/components/input-elements/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { makeClassName } from "lib";
import BaseInput, { BaseInputProps } from "../BaseInput";

export type TextInputProps = Omit<BaseInputProps, "stepper" | "makeInputClassName"> & {
type?: "text" | "password" | "email" | "url";
defaultValue?: string;
value?: string;
onValueChange?: (value: string) => void;
Expand Down
7 changes: 7 additions & 0 deletions src/stories/input-elements/TextInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ export const WithTypeUrl: Story = {
type: "url",
},
};

export const WithTypeSearch: Story = {
render: SimpleTextInput,
args: {
type: "search",
},
};

0 comments on commit d07a319

Please sign in to comment.