Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript error: '"args"' does not exist in type 'StoryProps' #96

Closed
silveltman opened this issue Mar 31, 2023 · 0 comments · Fixed by #100
Closed

typescript error: '"args"' does not exist in type 'StoryProps' #96

silveltman opened this issue Mar 31, 2023 · 0 comments · Fixed by #100
Labels
bug Something isn't working

Comments

@silveltman
Copy link

I use sveltekit (library). I get a typescript error and don't know why.

Eyebrow.svelte

<script lang="ts">
	let className = ''
	export { className as class }
	export let size: 'sm' | 'md' | 'lg' = 'md'
	export let color: boolean = true
</script>

<div
	class="inline-block rounded-eyebrow border leading-none
	
	{size === 'sm' && 'py-1 px-2 text-body-sm'}
	{size === 'md' && 'py-2 px-3 text-body-md'}
	{size === 'lg' && 'py-3 px-4 text-body-lg'}

    {color
		? 'border-primary-100 bg-primary-50 text-primary-800'
		: 'border-primary-200 bg-neutral-100 text-neutral-1000'}
	
	{className}
	"
	{...$$restProps}
>
	<slot />
</div>

Eyebrow.stories.svelte

<script lang="ts">
	import { Meta, Template, Story } from '@storybook/addon-svelte-csf'
	import Eyebrow from './Eyebrow.svelte'
</script>

<Meta
	title="Eyebrow"
	component={Eyebrow}
/>

<Template let:args>
	<Eyebrow {...args}>Hello world</Eyebrow>
</Template>

<Story
	name="Color"
	args={{ color: true, size: 'sm' }}
/>

Error/warning:
image

@silveltman silveltman added the bug Something isn't working label Mar 31, 2023
andrescera added a commit to andrescera/addon-svelte-csf that referenced this issue Apr 11, 2023
This should fix storybookjs#96 as the types don't exist anymore in '@storybook/addons'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant