-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
842a72d
commit 4330133
Showing
8 changed files
with
49 additions
and
0 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,14 @@ | ||
import React, { FC } from 'react'; | ||
import { | ||
StoryConfig as BaseStoryConfig, | ||
StoryConfigProps, | ||
} from '@component-controls/blocks'; | ||
import { ControlsProvider } from '../context/ControlsProvider'; | ||
|
||
export const StorySource: FC<StoryConfigProps> = props => { | ||
return ( | ||
<ControlsProvider> | ||
<BaseStoryConfig {...props} /> | ||
</ControlsProvider> | ||
); | ||
}; |
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,9 @@ | ||
import React from 'react'; | ||
import { StoryConfig } from '@component-controls/blocks'; | ||
import { AddonPanel, AddonPanelProps } from './AddonPanel'; | ||
|
||
export const StoryConfigPanel: React.FC<AddonPanelProps> = props => ( | ||
<AddonPanel {...props}> | ||
<StoryConfig id="." /> | ||
</AddonPanel> | ||
); |
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,3 +1,4 @@ | ||
export const CONTROLS_PANEL_ID = 'controls/panels/controls'; | ||
export const STORYSOURCE_PANEL_ID = 'controls/panels/storysource'; | ||
export const PROPS_PANEL_ID = 'controls/panels/props'; | ||
export const STORYCONFIG_PANEL_ID = 'controls/panels/storyconfig'; |
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,14 @@ | ||
/* eslint-disable react/display-name */ | ||
import * as React from 'react'; | ||
import addons from '@storybook/addons'; | ||
import { StoryConfigPanel } from './panel/StoryConfigPanel'; | ||
import { STORYCONFIG_PANEL_ID } from './panel/constants'; | ||
|
||
addons.register(STORYCONFIG_PANEL_ID, api => { | ||
addons.addPanel(`${STORYCONFIG_PANEL_ID}_panel`, { | ||
title: 'Story config', | ||
render: ({ active, key }) => ( | ||
<StoryConfigPanel key={key} active={active} api={api} /> | ||
), | ||
}); | ||
}); |
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