1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 09:33:27 +00:00
Files
browser/libs/components/src/search/search.stories.ts
Bryan Cunningham 5eb8d7b181 [CL-208][CL-339] Enhance Storybook docs pages (#14838)
* rearrange button docs

* Enhance avatar docs

* Enhance badge  docs

* Enhance banner docs

* add util to format args for snippets

* update banner snippets

* WIP

* bind boolean args so they work correctly in Storybook

* simplify button stories

* Update callout docs

* use title component for checkbox docs

* use title and description  component for chip select docs

* update color password story docs

* update disclosure docs

* add import to icon docs

* updated icon-button docs

* update link docs

* Update prgress docs

* updated search field docs

* remove html type definitions

* add import for progress

* updated toast docs

* remove example from docs. format args for snippet

* Update badges docs

* handle array arg values correctly

* Update badges list docs

* fix dupe key error from taost story

* remove unnecessary typeof check

* remove banner usage example

* add breadcrumbs import statement and jsdoc

* add color password import statement

* fixing type mismaches

* fix typos

* Add missing generics to format function

* fix typo

* update callout icon spacing to match Figma

* add back max width container
2025-05-30 12:38:40 -04:00

48 lines
1.3 KiB
TypeScript

import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { Meta, StoryObj, moduleMetadata } from "@storybook/angular";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { formatArgsForCodeSnippet } from "../../../../.storybook/format-args-for-code-snippet";
import { InputModule } from "../input/input.module";
import { SharedModule } from "../shared";
import { I18nMockService } from "../utils/i18n-mock.service";
import { SearchComponent } from "./search.component";
export default {
title: "Component Library/Form/Search",
component: SearchComponent,
decorators: [
moduleMetadata({
imports: [SharedModule, InputModule, FormsModule, ReactiveFormsModule],
providers: [
{
provide: I18nService,
useFactory: () => {
return new I18nMockService({
search: "Search",
});
},
},
],
}),
],
args: {
placeholder: "search",
disabled: false,
},
} as Meta;
type Story = StoryObj<SearchComponent>;
export const Default: Story = {
render: (args) => ({
props: args,
template: `
<bit-search [(ngModel)]="searchText"${formatArgsForCodeSnippet<SearchComponent>(args)}></bit-search>
`,
}),
args: {},
};