Skip to content

Commit

Permalink
feat: add search bar component
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed May 30, 2024
1 parent 0e65cf7 commit 5b1b176
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/scss/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
@forward "callout/callout";
@forward "card/card";
@forward "icon/icon";
@forward "search-bar/search-bar";
@forward "table/table";
23 changes: 23 additions & 0 deletions src/scss/components/search-bar/_search-bar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@use "../../tokens/color" as *;
@use "../../tokens/spacing" as *;

.iati-search-bar {
display: flex;
flex-flow: row nowrap;

& input[type="text"] {
flex-grow: 1;
padding: $padding-block;
border: 1px solid $color-grey-20;
border-right: none;

&::placeholder {
color: $color-grey-40;
}

&:focus {
outline: none;
border-color: $color-grey-30;
}
}
}
19 changes: 19 additions & 0 deletions src/scss/components/search-bar/search-bar.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Meta, StoryObj } from "@storybook/web-components";

import { html } from "lit";

const meta: Meta = {
title: "Components/Search Bar",
};

export default meta;
type Story = StoryObj;

export const Search: Story = {
render: () => html`
<div class="iati-search-bar">
<input type="text" placeholder="Search" />
<button type="submit" class="iati-button">Go</button>
</div>
`,
};

0 comments on commit 5b1b176

Please sign in to comment.