From eb65ea870acd80959552ad8b15ac60de16bbb866 Mon Sep 17 00:00:00 2001 From: Red Adaya Date: Thu, 17 Oct 2024 23:00:05 +0800 Subject: [PATCH] search input component --- frontend/app/element/searchinput.less | 0 frontend/app/element/searchinput.stories.tsx | 32 ++++++++++++++++++++ frontend/app/element/searchinput.tsx | 20 ++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 frontend/app/element/searchinput.less create mode 100644 frontend/app/element/searchinput.stories.tsx create mode 100644 frontend/app/element/searchinput.tsx diff --git a/frontend/app/element/searchinput.less b/frontend/app/element/searchinput.less new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/app/element/searchinput.stories.tsx b/frontend/app/element/searchinput.stories.tsx new file mode 100644 index 000000000..359b0d8e3 --- /dev/null +++ b/frontend/app/element/searchinput.stories.tsx @@ -0,0 +1,32 @@ +// Copyright 2024, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Meta, StoryObj } from "@storybook/react"; +import { SearchInput } from "./searchinput"; + +const meta: Meta = { + title: "Elements/SearchInput", + component: SearchInput, + argTypes: { + className: { + description: "Custom class for styling the input group", + control: { type: "text" }, + }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const DefaultSearchInput: Story = { + render: (args) => { + const handleSearch = () => { + console.log("Search triggered"); + }; + + return ; + }, + args: { + className: "custom-search-input", + }, +}; diff --git a/frontend/app/element/searchinput.tsx b/frontend/app/element/searchinput.tsx new file mode 100644 index 000000000..b977a5197 --- /dev/null +++ b/frontend/app/element/searchinput.tsx @@ -0,0 +1,20 @@ +// Copyright 2024, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { Button } from "./button"; +import { Input, InputGroup, InputRightElement } from "./input"; + +const SearchInput = () => { + return ( + + + + + + + ); +}; + +export { SearchInput };