From 451bd3ed786ee7d7371432760e434ed547f92efd Mon Sep 17 00:00:00 2001 From: "Kendall_Gassner@intuit.com" Date: Fri, 10 Jul 2020 12:03:16 -0600 Subject: [PATCH 1/4] remove z-index --- lib/components/src/ActionBar/ActionBar.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/src/ActionBar/ActionBar.tsx b/lib/components/src/ActionBar/ActionBar.tsx index 93ac23669ca..7872ddd450f 100644 --- a/lib/components/src/ActionBar/ActionBar.tsx +++ b/lib/components/src/ActionBar/ActionBar.tsx @@ -9,7 +9,6 @@ const Container = styled.div<{}>(({ theme }) => ({ maxWidth: '100%', display: 'flex', background: theme.background.content, - zIndex: 1, })); export const ActionButton = styled.button<{ disabled: boolean }>( From 4fc6f7174c95fbfde3e016f89950c834d6c12fe9 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 15 Jul 2020 18:31:28 +0800 Subject: [PATCH 2/4] Addon-docs: Make Meta block subcomponents optional --- addons/docs/src/blocks/Meta.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/docs/src/blocks/Meta.tsx b/addons/docs/src/blocks/Meta.tsx index f3f5f49a3a0..6acfe44b844 100644 --- a/addons/docs/src/blocks/Meta.tsx +++ b/addons/docs/src/blocks/Meta.tsx @@ -10,7 +10,7 @@ type Decorator = (...args: any) => any; interface MetaProps { title: string; component?: Component; - subcomponents: Record; + subcomponents?: Record; decorators?: [Decorator]; parameters?: any; } From 55952dc1328259b5cc98622bd4e539f2d2af6234 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 15 Jul 2020 12:36:47 +0200 Subject: [PATCH 3/4] docs(MIGRATION): update hierarchy separator section Updated the command to work in any scenario and added a note about mdx. --- MIGRATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 9f25925dfb8..6b470db097d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -383,10 +383,10 @@ The story store no longer emits `renderCurrentStory`/`RENDER_CURRENT_STORY` to t We've removed the ability to specify the hierarchy separators (how you control the grouping of story kinds in the sidebar). From Storybook 6.0 we have a single separator `/`, which cannot be configured. -If you are currently using using custom separators, we encourage you to migrate to using `/` as the sole separator. If you are using `|` or `.` as a separator currently, we provide a codemod, [`upgrade-hierarchy-separators`](https://github.com/storybookjs/storybook/blob/next/lib/codemod/README.md#upgrade-hierarchy-separators), that can be used to rename all your components. +If you are currently using using custom separators, we encourage you to migrate to using `/` as the sole separator. If you are using `|` or `.` as a separator currently, we provide a codemod, [`upgrade-hierarchy-separators`](https://github.com/storybookjs/storybook/blob/next/lib/codemod/README.md#upgrade-hierarchy-separators), that can be used to rename your components. **Note: the codemod will not work for `.mdx` components, you will need to make the changes by hand.** ``` -yarn sb migrate upgrade-hierarchy-separators --glob="*.stories.js" +npx sb@next migrate upgrade-hierarchy-separators --glob="*/**/*.stories.@(tsx|jsx|ts|js)" ``` We also now default to showing "roots", which are non-expandable groupings in the sidebar for the top-level groups. If you'd like to disable this, set the `showRoots` option in `.storybook/manager.js`: From ae5fef075dc27277f13312a316d5dd4f51db8f50 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Wed, 15 Jul 2020 21:20:56 +1000 Subject: [PATCH 4/4] Add `argTypes` to `StoryContext` --- addons/docs/src/blocks/enhanceSource.test.ts | 1 + addons/docs/src/frameworks/common/enhanceArgTypes.test.ts | 1 + app/vue/src/client/preview/index.ts | 1 + lib/addons/src/types.ts | 1 + lib/client-api/src/decorators.ts | 1 + lib/client-api/src/story_store.ts | 3 +++ lib/client-api/src/types.ts | 1 + 7 files changed, 9 insertions(+) diff --git a/addons/docs/src/blocks/enhanceSource.test.ts b/addons/docs/src/blocks/enhanceSource.test.ts index e0e683fe2cf..4f977884858 100644 --- a/addons/docs/src/blocks/enhanceSource.test.ts +++ b/addons/docs/src/blocks/enhanceSource.test.ts @@ -6,6 +6,7 @@ const emptyContext: StoryContext = { kind: 'foo', name: 'bar', args: {}, + argTypes: {}, globals: {}, parameters: {}, }; diff --git a/addons/docs/src/frameworks/common/enhanceArgTypes.test.ts b/addons/docs/src/frameworks/common/enhanceArgTypes.test.ts index 934be6c8cdc..f00fadc243c 100644 --- a/addons/docs/src/frameworks/common/enhanceArgTypes.test.ts +++ b/addons/docs/src/frameworks/common/enhanceArgTypes.test.ts @@ -35,6 +35,7 @@ const enhance = ({ }, }, args: {}, + argTypes: {}, globals: {}, }; return enhanceArgTypes(context); diff --git a/app/vue/src/client/preview/index.ts b/app/vue/src/client/preview/index.ts index 63e9cf97e5b..b00eb4385d1 100644 --- a/app/vue/src/client/preview/index.ts +++ b/app/vue/src/client/preview/index.ts @@ -69,6 +69,7 @@ const defaultContext: StoryContext = { kind: 'unspecified', parameters: {}, args: {}, + argTypes: {}, globals: {}, }; diff --git a/lib/addons/src/types.ts b/lib/addons/src/types.ts index beb4a63e603..503f6275fd4 100644 --- a/lib/addons/src/types.ts +++ b/lib/addons/src/types.ts @@ -56,6 +56,7 @@ export type StoryContext = StoryIdentifier & { [key: string]: any; parameters: Parameters; args: Args; + argTypes: ArgTypes; globals: Args; hooks?: HooksContext; }; diff --git a/lib/client-api/src/decorators.ts b/lib/client-api/src/decorators.ts index 27bbd0d6dcb..5a4d6339ed0 100644 --- a/lib/client-api/src/decorators.ts +++ b/lib/client-api/src/decorators.ts @@ -11,6 +11,7 @@ const defaultContext: StoryContext = { kind: 'unspecified', parameters: {}, args: {}, + argTypes: {}, globals: {}, }; diff --git a/lib/client-api/src/story_store.ts b/lib/client-api/src/story_store.ts index a9b757b1334..43cbfbc2798 100644 --- a/lib/client-api/src/story_store.ts +++ b/lib/client-api/src/story_store.ts @@ -375,6 +375,7 @@ export default class StoryStore { storyFn: original, parameters: accumlatedParameters, args: {}, + argTypes: {}, globals: {}, }), }), @@ -391,6 +392,7 @@ export default class StoryStore { parameters: this.combineStoryParameters(storyParametersWithArgTypes, kind), hooks, args: _stories[id].args, + argTypes, globals: this._globals, }); @@ -414,6 +416,7 @@ export default class StoryStore { parameters: { ...storyParameters, argTypes }, args: initialArgs, + argTypes, initialArgs, }; } diff --git a/lib/client-api/src/types.ts b/lib/client-api/src/types.ts index 77a69d16d04..5c3188b1741 100644 --- a/lib/client-api/src/types.ts +++ b/lib/client-api/src/types.ts @@ -55,6 +55,7 @@ export type StoreItem = StoryIdentifier & { hooks: HooksContext; args: Args; initialArgs: Args; + argTypes: ArgTypes; }; export type PublishedStoreItem = StoreItem & {