Skip to content
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

Storybook: Add badges to private components #58123

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"@emotion/babel-plugin": "11.3.0",
"@emotion/jest": "11.7.1",
"@emotion/native": "11.0.0",
"@geometricpanda/storybook-addon-badges": "2.0.1",
"@octokit/rest": "16.26.0",
"@octokit/types": "6.34.0",
"@octokit/webhooks-types": "5.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const meta: Meta< typeof CustomSelect > = {
value: { control: { type: null } },
},
parameters: {
badges: [ 'wip' ],
actions: { argTypesRegex: '^on.*' },
controls: { expanded: true },
docs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const meta: Meta< typeof DropdownMenu > = {
},
parameters: {
actions: { argTypesRegex: '^on.*' },
badges: [ 'private' ],
controls: { expanded: true },
docs: {
canvas: { sourceState: 'shown' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const meta: Meta< typeof ProgressBar > = {
value: { control: { type: 'number', min: 0, max: 100, step: 1 } },
},
parameters: {
badges: [ 'private' ],
controls: {
expanded: true,
},
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/tabs/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const meta: Meta< typeof Tabs > = {
},
parameters: {
actions: { argTypesRegex: '^on.*' },
badges: [ 'private' ],
controls: { expanded: true },
docs: { canvas: { sourceState: 'shown' } },
},
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/theme/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const meta: Meta< typeof Theme > = {
background: { control: { type: 'color' } },
},
parameters: {
badges: [ 'private' ],
controls: { expanded: true },
docs: { canvas: { sourceState: 'shown' } },
},
Expand Down
1 change: 1 addition & 0 deletions storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
'@storybook/addon-toolbars',
'@storybook/addon-actions',
'storybook-source-link',
'@geometricpanda/storybook-addon-badges',
],
framework: {
name: '@storybook/react-webpack5',
Expand Down
24 changes: 24 additions & 0 deletions storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ export const decorators = [
];

export const parameters = {
// For @geometricpanda/storybook-addon-badges
badgesConfig: {
private: {
title: '🔒 Private',
tooltip: {
title: 'Component is locked as a private API',
desc: 'We do not yet recommend using this outside of the Gutenberg codebase.',
links: [
{
title: 'About @wordpress/private-apis',
href: 'https://developer.wordpress.org/block-editor/reference-guides/packages/packages-private-apis/',
},
],
},
},
wip: {
title: '🚧 WIP',
styles: { backgroundColor: '#FFF0BD' },
tooltip: {
title: 'Component is a work in progress',
desc: 'This component is not ready for use in production, including the Gutenberg codebase. DO NOT export outside of @wordpress/components.',
},
},
},
controls: {
sort: 'requiredFirst',
},
Expand Down
Loading