-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
CSF Factories: Add parameters/globals types, extend
API, portable stories
#30601
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
57c2c8c
WIP: Add support for parameters
kasperpeulen cf87f2a
Merge remote-tracking branch 'origin/next' into kasper/csf-parameters
kasperpeulen 59b9d5d
Fix
kasperpeulen 526ce10
Rollback preview changes
kasperpeulen 07fbadc
Fix tests
kasperpeulen ec29949
Pass parameters to story and meta
kasperpeulen 238df1b
Fix type tests
kasperpeulen dee1f12
Merge remote-tracking branch 'origin/next' into kasper/csf-parameters
kasperpeulen 8050a06
Don't export in addon-outline
kasperpeulen f7a85a7
Don't export in addon-backgrounds
kasperpeulen 793a49b
Get all addons in shape
kasperpeulen 5af7f47
Fix next as well
kasperpeulen 70c0641
Fix check
kasperpeulen 9eb7abe
Just test the parameters
kasperpeulen 9733393
Fix
kasperpeulen e77a51f
Merge remote-tracking branch 'origin/next' into kasper/csf-parameters
kasperpeulen 1e25c44
Remove shared csf4 file
kasperpeulen e8fbce4
Restructure core annotations in csf export
kasperpeulen bfc9665
Fix check
kasperpeulen 0a804a5
Add test of mrginglymus
kasperpeulen 9cb16c1
Merge remote-tracking branch 'refs/remotes/origin/next' into kasper/c…
kasperpeulen a402c19
Fix
kasperpeulen 1401cce
Merge branch 'next' into kasper/csf-parameters
kasperpeulen 82e2e1b
Fix composed
kasperpeulen 4f8d020
Fix input.args type
kasperpeulen d13935a
Fix core types
kasperpeulen 4f06e56
Fix core parameter types
kasperpeulen f090c08
Add globals
kasperpeulen 9f2b655
Fix
kasperpeulen fa988c0
Fix
kasperpeulen 224683b
Fix type
kasperpeulen a667e87
Make grid optional
kasperpeulen dcb271d
Fix a11y type
kasperpeulen 0cdccd7
Add portable stories support to factories
kasperpeulen 4ba962a
Get local preview
kasperpeulen 5736c48
Implement extends API
kasperpeulen b613883
Implement extends API
kasperpeulen 84d090f
Add CSF1-like story
kasperpeulen 7813e8c
Add CSF1-like story
kasperpeulen 93ac519
Fix unit tests
kasperpeulen 40d66b1
Fix extend
kasperpeulen 825a252
Fix check
kasperpeulen e96aede
Add unit test for extend
kasperpeulen 4e391ab
Fix viewport type
kasperpeulen 69ee7af
Fix core options
kasperpeulen 5fdc6ab
Change codemod for new CSF1 support
kasperpeulen 3ecf70c
Fix nextjs router types
kasperpeulen 9ecff97
Fix name
kasperpeulen 2182afc
Improve types
kasperpeulen 295e5ca
@ts-expect-error hard
kasperpeulen 29e4d59
Fix portable stories
kasperpeulen b41ef60
Remove some type casts
kasperpeulen cc6bc62
Empty story objects have shortcut
kasperpeulen dda04ad
Resolve require.resolve to config dir
kasperpeulen 276ddde
Fix react parameter types
kasperpeulen e20b842
Fix nextjs-vite types
kasperpeulen 411c198
Always provide configDir
kasperpeulen 4f24c5e
Fix tests
kasperpeulen be60407
Fix types
kasperpeulen 66d8f42
Fix next types
kasperpeulen 1bd4318
Remove old definePreview
kasperpeulen 2b9a7be
Merge branch 'next' into kasper/csf-parameters
kasperpeulen 111e2b4
Merge branch 'next' into kasper/csf-parameters
kasperpeulen d524e95
Implement composed for stories
kasperpeulen a1170d7
Merge remote-tracking branch 'origin/kasper/csf-parameters' into kasp…
kasperpeulen da74e17
Refactor and explain
kasperpeulen bdc40b3
Remove csf factory docs
kasperpeulen 7dd5736
Fix react addon inference
kasperpeulen 9c22424
Address feedback
kasperpeulen 9ab9f8b
Merge remote-tracking branch 'origin/next' into kasper/csf-parameters
kasperpeulen d70f67e
Roll back docs changes
kasperpeulen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,9 +1,10 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { A11yTypes } from './types'; | ||
|
||
export { PARAM_KEY } from './constants'; | ||
export * from './params'; | ||
export type { A11yParameters } from './types'; | ||
export type { A11yTypes } from './types'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<A11yTypes>(addonAnnotations); |
This file contains hidden or 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 hidden or 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,11 +1,12 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { ActionsTypes } from './types'; | ||
|
||
export * from './constants'; | ||
export * from './models'; | ||
export * from './runtime'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<ActionsTypes>(addonAnnotations); | ||
|
||
export type { ActionsParameters } from './types'; | ||
export type { ActionsTypes }; |
This file contains hidden or 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 hidden or 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,7 +1,9 @@ | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { BackgroundTypes } from './types'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<BackgroundTypes>(addonAnnotations); | ||
|
||
export type { BackgroundsParameters, BackgroundsGlobals } from './types'; | ||
export type { BackgroundTypes }; |
This file contains hidden or 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 hidden or 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,7 +1,9 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import type { ControlsTypes } from './types'; | ||
|
||
export { PARAM_KEY } from './constants'; | ||
|
||
export default () => definePreview({}); | ||
export default () => definePreviewAddon<ControlsTypes>({}); | ||
|
||
export type { ControlsParameters } from './types'; | ||
export type { ControlsTypes }; |
This file contains hidden or 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 hidden or 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,9 +1,10 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { DocsTypes } from './types'; | ||
|
||
export * from '@storybook/blocks'; | ||
export { DocsRenderer } from './DocsRenderer'; | ||
export type { DocsParameters } from './types'; | ||
export type { DocsTypes }; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<DocsTypes>(addonAnnotations); |
This file contains hidden or 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 hidden or 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,5 +1,8 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import addonAnnotations from './preview'; | ||
import type { EssentialsTypes } from './types'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export type { EssentialsTypes }; | ||
|
||
export default () => definePreviewAddon<EssentialsTypes>(addonAnnotations); |
This file contains hidden or 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,16 +1,15 @@ | ||
import type { ActionsParameters } from '@storybook/addon-actions'; | ||
import type { BackgroundsParameters } from '@storybook/addon-backgrounds'; | ||
import type { DocsParameters } from '@storybook/addon-docs'; | ||
import type { HighlightParameters } from '@storybook/addon-highlight'; | ||
import type { MeasureParameters } from '@storybook/addon-measure'; | ||
import type { OutlineParameters } from '@storybook/addon-outline'; | ||
import type { ViewportParameters } from '@storybook/addon-viewport'; | ||
import type { ActionsTypes } from '@storybook/addon-actions'; | ||
import type { BackgroundTypes } from '@storybook/addon-backgrounds'; | ||
import type { DocsTypes } from '@storybook/addon-docs'; | ||
import type { HighLightTypes } from '@storybook/addon-highlight'; | ||
import type { MeasureTypes } from '@storybook/addon-measure'; | ||
kasperpeulen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import type { OutlineTypes } from '@storybook/addon-outline'; | ||
import type { ViewportTypes } from '@storybook/addon-viewport'; | ||
|
||
export interface EssentialsParameters | ||
extends ActionsParameters, | ||
BackgroundsParameters, | ||
DocsParameters, | ||
HighlightParameters, | ||
MeasureParameters, | ||
OutlineParameters, | ||
ViewportParameters {} | ||
export type EssentialsTypes = ActionsTypes & | ||
BackgroundTypes & | ||
DocsTypes & | ||
HighLightTypes & | ||
MeasureTypes & | ||
OutlineTypes & | ||
ViewportTypes; |
This file contains hidden or 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,8 +1,9 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import './preview'; | ||
import type { HighLightTypes } from './types'; | ||
|
||
export { HIGHLIGHT, RESET_HIGHLIGHT } from './constants'; | ||
export type { HighlightParameters } from './types'; | ||
export type { HighLightTypes }; | ||
|
||
export default () => definePreview({}); | ||
export default () => definePreviewAddon<HighLightTypes>({}); |
This file contains hidden or 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 hidden or 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,5 +1,9 @@ | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
kasperpeulen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import * as addonAnnotations from './preview'; | ||
import type { InteractionsTypes } from './types'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export type { InteractionsTypes }; | ||
|
||
export default () => definePreviewAddon<InteractionsTypes>(addonAnnotations); |
This file contains hidden or 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 hidden or 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,7 +1,7 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
|
||
export { linkTo, hrefTo, withLinks, navigate } from './utils'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon(addonAnnotations); |
This file contains hidden or 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,7 +1,8 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { MeasureTypes } from './types'; | ||
|
||
export type { MeasureParameters } from './types'; | ||
export type { MeasureTypes }; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<MeasureTypes>(addonAnnotations); |
This file contains hidden or 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 hidden or 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,7 +1,9 @@ | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
kasperpeulen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import * as addonAnnotations from './preview'; | ||
import type { OutlineTypes } from './types'; | ||
|
||
export type { OutlineParameters } from './types'; | ||
export type { OutlineTypes }; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<OutlineTypes>(addonAnnotations); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,9 +1,11 @@ | ||||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||||
import { definePreview } from 'storybook/internal/preview-api'; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: definePreview is imported but never used after the changes - this import can be removed
Suggested change
|
||||
|
||||
import * as addonAnnotations from './preview'; | ||||
import type { ThemesTypes } from './types'; | ||||
|
||||
export type { ThemesGlobals, ThemesParameters } from './types'; | ||||
export type { ThemesTypes } from './types'; | ||||
|
||||
export default () => definePreview(addonAnnotations); | ||||
export default () => definePreviewAddon<ThemesTypes>(addonAnnotations); | ||||
|
||||
export * from './decorators'; |
This file contains hidden or 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 hidden or 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,8 +1,9 @@ | ||
import { definePreview } from 'storybook/internal/preview-api'; | ||
import { definePreviewAddon } from 'storybook/internal/csf'; | ||
|
||
import * as addonAnnotations from './preview'; | ||
import type { ViewportTypes } from './types'; | ||
|
||
export * from './defaults'; | ||
export type * from './types'; | ||
|
||
export default () => definePreview(addonAnnotations); | ||
export default () => definePreviewAddon<ViewportTypes>(addonAnnotations); |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.