mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Fix svelte types
This commit is contained in:
parent
c8c7e7b200
commit
8ddbffcbfa
@ -54,7 +54,7 @@ const getCaptionForLocale = (locale: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const CSF2StoryWithLocale: CSF2Story = (args, { globals }) => ({
|
||||
export const CSF2StoryWithLocale: CSF2Story<StoryWithLocaleComponent> = (args, { globals }) => ({
|
||||
Component: StoryWithLocaleComponent,
|
||||
props: {
|
||||
...args,
|
||||
@ -102,17 +102,19 @@ export const CSF3Button: CSF3Story = {
|
||||
args: { label: 'foo' },
|
||||
};
|
||||
|
||||
export const CSF3ButtonWithRender: CSF3Story = {
|
||||
...CSF3Button,
|
||||
export const CSF3ButtonWithRender: StoryObj<CustomRenderComponent> = {
|
||||
args: {
|
||||
buttonProps: CSF3Button.args,
|
||||
},
|
||||
render: (args) => ({
|
||||
Component: CustomRenderComponent,
|
||||
props: {
|
||||
args,
|
||||
buttonProps: args.buttonProps,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
export const CSF3InputFieldFilled: CSF3Story = {
|
||||
export const CSF3InputFieldFilled: StoryObj<InputFilledStoryComponent> = {
|
||||
render: () => ({
|
||||
Component: InputFilledStoryComponent,
|
||||
}),
|
||||
@ -127,7 +129,7 @@ export const CSF3InputFieldFilled: CSF3Story = {
|
||||
};
|
||||
|
||||
const mockFn = fn();
|
||||
export const LoaderStory: StoryObj<{ mockFn: (val: string) => string }> = {
|
||||
export const LoaderStory: StoryObj<LoaderStoryComponent> = {
|
||||
args: {
|
||||
mockFn,
|
||||
},
|
||||
|
@ -1,10 +1,11 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import Button from './Button.svelte';
|
||||
import { ComponentProps } from 'svelte';
|
||||
|
||||
export let args;
|
||||
export let buttonProps: ComponentProps<Button>;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<p data-testid="custom-render">I am a custom render function</p>
|
||||
<Button {...args} />
|
||||
</div>
|
||||
<Button {...buttonProps} />
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user