1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-28 18:43:26 +00:00
Files
browser/libs/components/src/search/search.stories.ts
Oscar Hinton 9ca3d0653d Fix strict typescript for Component Library stories (#12423)
Fixing some low hanging fruits for moving CL to strict typescript.

This primarily removes the types from args since TS infers them differently. We previously needed them since storybook would use any for args but now provides proper typings
2025-01-07 17:28:35 +01:00

43 lines
1.1 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 { 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",
});
},
},
],
}),
],
} as Meta;
type Story = StoryObj<SearchComponent>;
export const Default: Story = {
render: (args) => ({
props: args,
template: `
<bit-search [(ngModel)]="searchText" [placeholder]="placeholder" [disabled]="disabled"></bit-search>
`,
}),
args: {},
};