diff --git a/addons/events/package.json b/addons/events/package.json index 1cd94997fd29..e28bd252b6ae 100644 --- a/addons/events/package.json +++ b/addons/events/package.json @@ -19,11 +19,12 @@ }, "license": "MIT", "main": "dist/index.js", - "jsnext:main": "src/index.js", + "types": "dist/index.d.ts", "scripts": { "prepare": "node ../../scripts/prepare.js" }, "dependencies": { + "@storybook/api": "5.2.0-alpha.35", "@storybook/addons": "5.2.0-alpha.35", "@storybook/core-events": "5.2.0-alpha.35", "@storybook/theming": "5.2.0-alpha.35", diff --git a/addons/events/src/components/Event.js b/addons/events/src/components/Event.tsx similarity index 78% rename from addons/events/src/components/Event.js rename to addons/events/src/components/Event.tsx index 7e3634959479..fec6b93aae8f 100644 --- a/addons/events/src/components/Event.js +++ b/addons/events/src/components/Event.tsx @@ -5,10 +5,19 @@ import isEqual from 'lodash/isEqual'; import { styled } from '@storybook/theming'; import json from 'format-json'; - import Textarea from 'react-textarea-autosize'; +import { OnEmitEvent } from '../index'; + +interface StyledTextareaProps { + shown: boolean; + failed: boolean; + value?: string; + onChange?: (event: React.ChangeEvent) => void; +} -const StyledTextarea = styled(Textarea)( +const StyledTextarea = styled(({ shown, failed, ...rest }: StyledTextareaProps) => ( +