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

[Feature Request]: Upgrade Primary, Title, Subtitle and Stories blocks to the new v7 blocks API #22490

Open
4 of 19 tasks
JReinhold opened this issue May 10, 2023 · 14 comments
Open
4 of 19 tasks

Comments

@JReinhold
Copy link
Contributor

JReinhold commented May 10, 2023

Is your feature request related to a problem? Please describe

Storybook v7 introduced a new API for doc blocks that is based on an of prop and change in parameters location. See https://storybook.js.org/blog/storybook-7-docs/#doc-blocks-api-is-powerful-yet-simple

However the blocks Primary, Title and Subtitle were not fully migrated to the new API.

Describe the solution you'd like

Each block should be changed to match the general blocks API, similar to how eg. the Description block is implemented: https://github.com/storybookjs/storybook/blob/next/code/ui/blocks/src/blocks/Description.tsx
It's important that the changes are backwards compatible, and the current usage is still supported, but with a deprecation warning.

Primary

  • Add support for of prop via useOf - only the "meta" type is valid here
  • Document changes
  • Add stories
  • Make sure it is backwards compatible - should still work with name prop, or no prop at all (infers the current component)

Title

  • Add support for of prop via useOf - only the "meta" type is valid here
  • Document changes
  • Add stories
  • Make sure it is backwards compatible - children prop should not be deprecated

Subtitle#22552 by @joaonunomota

  • Add support for of prop via useOf - only the "meta" type is valid here
  • Default to extracting content from parameters.docs.subtitle
  • Deprecate extracting content from parameters.componentSubtitle
  • Document changes
  • Add stories
  • Make sure it is backwards compatible - children prop should not be deprecated.

Stories

  • Add support for of prop via useOf - only the "meta" type is valid here
  • Default to get title from parameters.docs.stories.title
  • Default to get includePrimaryStory from parameters.docs.stories.includePrimaryStory
  • Document changes
  • Add stories

Additional context

These changes are rather small, so they can be made in one PR or in 4 different PRs. Any new or experienced contributor is free to pick these up.

Note
Anyone are free to work on these issues, you don't need to "reserve" it by asking here, just open a pull request with your work when you're done.

@yannbf
Copy link
Member

yannbf commented May 10, 2023

@italoteix this is something you might like to contribute to!

@imevanc
Copy link

imevanc commented May 11, 2023

@yannbf is this issue open to anyone who wants to contribute?

@imevanc
Copy link

imevanc commented May 13, 2023

@yannbf is this issue open to anyone who wants to contribute?

@yannbf @JReinhold

@kylegach
Copy link
Contributor

@yannbf is this issue open to anyone who wants to contribute?

Yes, absolutely! Let us know if you need any assistance.

Someone already tackled Subtitle, btw. #22552

@JReinhold JReinhold changed the title [Feature Request]: Upgrade Primary, Title and Subtitle blocks to the new v7 blocks API [Feature Request]: Upgrade Primary, Title, Subtitle and Stories blocks to the new v7 blocks API May 15, 2023
@imevanc
Copy link

imevanc commented May 15, 2023

@yannbf is this issue open to anyone who wants to contribute?

Yes, absolutely! Let us know if you need any assistance.

Someone already tackled Subtitle, btw. #22552

Fab! Will raise a PR later this week.

@Beadko
Copy link

Beadko commented May 19, 2023

May I pick up the Title?

@JReinhold
Copy link
Contributor Author

Go ahead @Beadko

@ssingh3856
Copy link

May i pick up Primary / Stories?

@Idan-Garay
Copy link

May I pick the Primary block?

@JReinhold
Copy link
Contributor Author

I've assigned @ssingh3856 to Stories and @Idan-Garay to Primary.

@Arpan3323
Copy link

I see that there are people already working on each of the blocks but if there is something else that needs to be taken care of feel free to assign it to me.

@Dvinod28
Copy link

Hi, is this issue still open, Can I work on this issue?

@Dvinod28
Copy link

@JReinhold can I work on this issue, is this still open?

@JReinhold
Copy link
Contributor Author

@Dvinod1 and anyone else, you're free to open a pull request that fixes any of this. From now on no one is "reserving" a block here, anyone can open a PR.

Sidnioulz added a commit to Sidnioulz/storybook that referenced this issue Aug 5, 2023
Sidnioulz added a commit to Sidnioulz/storybook that referenced this issue Aug 7, 2023
Sidnioulz added a commit to Sidnioulz/storybook that referenced this issue Aug 7, 2023
Haprog added a commit to fintraffic-design/fds-coreui-components that referenced this issue Nov 16, 2023
Enable `*.stories.mdx` in Storybook config.
Comment out Subtitle from Icons story to avoid error: "Error: No primary story defined for docs entry. Did you forget to use `<Meta>`?"
This error seems to be related to:
storybookjs/storybook#19964
storybookjs/storybook#22490
Haprog added a commit to fintraffic-design/fds-coreui-components that referenced this issue Nov 16, 2023
Enable `*.stories.mdx` in Storybook config.
Comment out Subtitle from Icons story to avoid error: "Error: No primary story defined for docs entry. Did you forget to use `<Meta>`?"
This error seems to be related to:
storybookjs/storybook#19964
storybookjs/storybook#22490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants