mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-19 21:11:32 +01:00
search input component
This commit is contained in:
parent
361c29f4cc
commit
eb65ea870a
0
frontend/app/element/searchinput.less
Normal file
0
frontend/app/element/searchinput.less
Normal file
32
frontend/app/element/searchinput.stories.tsx
Normal file
32
frontend/app/element/searchinput.stories.tsx
Normal file
@ -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<typeof SearchInput> = {
|
||||
title: "Elements/SearchInput",
|
||||
component: SearchInput,
|
||||
argTypes: {
|
||||
className: {
|
||||
description: "Custom class for styling the input group",
|
||||
control: { type: "text" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof SearchInput>;
|
||||
|
||||
export const DefaultSearchInput: Story = {
|
||||
render: (args) => {
|
||||
const handleSearch = () => {
|
||||
console.log("Search triggered");
|
||||
};
|
||||
|
||||
return <SearchInput />;
|
||||
},
|
||||
args: {
|
||||
className: "custom-search-input",
|
||||
},
|
||||
};
|
20
frontend/app/element/searchinput.tsx
Normal file
20
frontend/app/element/searchinput.tsx
Normal file
@ -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 (
|
||||
<InputGroup className="search-input-group">
|
||||
<Input placeholder="Search..." />
|
||||
<InputRightElement>
|
||||
<Button className="search-button ghost grey">
|
||||
<i className="fa-sharp fa-solid fa-magnifying-glass"></i>
|
||||
</Button>
|
||||
</InputRightElement>
|
||||
</InputGroup>
|
||||
);
|
||||
};
|
||||
|
||||
export { SearchInput };
|
Loading…
Reference in New Issue
Block a user