-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5380 from gaetanmaisse/ts-migration/addon-cssreso…
…urces Migrate addon cssresources to TS
- Loading branch information
Showing
9 changed files
with
87 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface CssResource { | ||
id: string; | ||
code: string; | ||
picked: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
addons/cssresources/src/register.js → addons/cssresources/src/register.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import React from 'react'; | ||
import addons, { types } from '@storybook/addons'; | ||
import { addons, types } from '@storybook/addons'; | ||
|
||
import { ADDON_ID, PANEL_ID } from './constants'; | ||
|
||
import CssResourcePanel from './css-resource-panel'; | ||
import { CssResourcePanel } from './css-resource-panel'; | ||
|
||
addons.register(ADDON_ID, api => { | ||
const channel = addons.getChannel(); | ||
// Need to cast as any as it's not matching Addon type, to investigate | ||
addons.add(PANEL_ID, { | ||
type: types.PANEL, | ||
title: 'CSS resources', | ||
// eslint-disable-next-line react/prop-types | ||
render: ({ active, key }) => ( | ||
render: ({ active, key }: any) => ( | ||
<CssResourcePanel key={key} channel={channel} api={api} active={active} /> | ||
), | ||
}); | ||
} as any); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// TODO: following packages need definition files or a TS migration | ||
declare module '@storybook/components'; | ||
declare module 'global'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"types": ["webpack-env"] | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"src/__tests__/**/*" | ||
] | ||
} |