-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update title to support 'of' prop
Partially implements #22490
- Loading branch information
Showing
4 changed files
with
119 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Title } from './Title'; | ||
import * as DefaultButtonStories from '../examples/Button.stories'; | ||
|
||
const meta: Meta<typeof Title> = { | ||
component: Title, | ||
title: 'Blocks/Title', | ||
parameters: { | ||
controls: { | ||
include: [], | ||
hideNoControlsWarning: true, | ||
}, | ||
// workaround for https://github.com/storybookjs/storybook/issues/20505 | ||
docs: { source: { type: 'code' } }, | ||
attached: false, | ||
docsStyles: true, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const OfCSFFileInComponentTitle: Story = { | ||
name: 'Of CSF File with title', | ||
args: { | ||
of: DefaultButtonStories, | ||
}, | ||
parameters: { relativeCsfPaths: ['../examples/Button.stories'] }, | ||
}; | ||
|
||
export const OfMetaInComponentTitle: Story = { | ||
name: 'Of meta with title', | ||
args: { | ||
of: DefaultButtonStories, | ||
}, | ||
parameters: { relativeCsfPaths: ['../examples/Button.stories'] }, | ||
}; | ||
|
||
export const OfStringMetaAttached: Story = { | ||
name: 'Of attached "meta"', | ||
args: { | ||
of: 'meta', | ||
}, | ||
parameters: { relativeCsfPaths: ['../examples/Button.stories'], attached: true }, | ||
}; | ||
|
||
export const Children: Story = { | ||
args: { | ||
children: 'Custom title', | ||
}, | ||
}; | ||
|
||
export const DefaultAttached: Story = { | ||
args: {}, | ||
parameters: { relativeCsfPaths: ['../examples/Button.stories'], attached: true }, | ||
}; |
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