Repository navigation
Storybook: Add illustrated package cards to the Design System intro page - #85482
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.71 MB
|
b42b150 to
f7647a3
Compare
| - **Consistent visual language**: Drawn to a shared style so icons feel coherent wherever they appear across WordPress. | ||
|
|
||
| See the [`@wordpress/icons` README](https://github.com/WordPress/gutenberg/tree/trunk/packages/icons) for usage details. | ||
| <PackageCards only={ [ 'theming', 'components', 'icons' ] } /> |
There was a problem hiding this comment.
@ciampo 's feedback at #84864 (comment) got me thinking about how .mdx as its used to represent content can create issues when that content is obfuscated behind components. I don't know that we do or would use this page as raw content, but in a general sense it feels like Markdown is where the human text should live, not in the component implementation. And that we could use (sub-)components to handle the structuring. What would you think about moving some of that content back into this file?
There was a problem hiding this comment.
I moved the back copy to the content and kept component structure separate a80cfb0
d6b3fef to
7097d20
Compare
|
@aduth think this visual improvement/simplification would still make sense alongside the landing page? I could also see only simplification here needed without the visuals, since the landing page now carries more of the visual candy. |
|
Personally I don't see WordPress/wporg-main-2022#762 as superseding this in any way, I think they both independently bring value. Storybook will still be a primary resource and we should optimize its readability. If we could reuse content and assets, that'd be great, especially just for having a consistent way that we talk about these things. But I don't think either one is a direct substitute for the other. In particular, we might choose to have more detailed content in Storybook than on the landing page, as the landing page is intentionally designed to be more marketing-oriented and introductory, with Storybook being the more complete resource. |
aduth
left a comment
There was a problem hiding this comment.
This looks really great 👍 As with my other review, this has a lot of little comments, since it's important we get this right as the introductory content of the design system. But overall I find this much easier to follow.
| Rather than building UI elements from scratch each time, a design system provides pre-built, themeable components built on a foundation of design tokens. Design tokens encode design decisions like colors, spacing, and typography and can be customized to match different contexts while maintaining consistency. | ||
| It is what WordPress itself is built with, and it is available to plugin developers too. Interfaces made from the same components and tokens look and behave like the rest of WordPress, so your plugin's screens feel native to the dashboard instead of bolted on. |
There was a problem hiding this comment.
I like this rewording 👍 It makes it especially clear that one of the primary goals is extending user experience continuity across the core WordPress experience into plugins.
| Most often, you'll be interested in using components of the design system, like those provided through [the `@wordpress/ui` package](https://github.com/WordPress/gutenberg/blob/trunk/packages/ui/README.md) and other packages described below in "Parts of the Design System". | ||
| Use [Admin UI](?path=/docs/admin-ui-page--docs), [DataViews](?path=/docs/dataviews-dataviews--docs) and [DataForm](?path=/docs/dataviews-dataform--docs) to build new table and form based interfaces. Use the [components](?path=/docs/design-system-components-introduction--docs) to build completely new custom interfaces. |
There was a problem hiding this comment.
I like this phrasing in how it prioritizes higher-level abstractions as the primary entry point for common use-cases and components for more discrete control in custom cases. Something about it reads a bit too much as emphasizing the former as the design system, and not the low-level components. Maybe we could be clearer about this structure between levels of abstraction, like the design system including both UI primitives as well as components that combine other components for more advanced / common experiences.
There was a problem hiding this comment.
I attempted to go from high level > components > tokens in that order but I can see how it also makes sense to emphasize lower level components a bit more.
Change this to emphasize how we have low level components, and how compositional packages combine those primitives. Left the custom components mention as last, since that should be more rare to need.
Build with the Design System
Foundational packages provide the primitives for building any interface: components, icons and design tokens.
Compositional packages combine those primitives into complete experiences. Use Admin UI, DataViews and DataForm to build table and form based interfaces quickly and consistently.
When building your own components, use design tokens in your component styles to stay aligned with the design system's own components. The theming system exposes these tokens as custom CSS properties you can use in your own stylesheet.
Tokens are mentioned twice but I think it's fine as both cases are making slight different point (you need tokens even when building with components vs creating entirely new components).
| The [WordPress Design System MCP Server](?path=/docs/design-system-using-with-ai--docs) is recommended when working with AI agents for design or development in a project that uses the design system. It provides AI agents with component documentation, usage examples, and design tokens, so they correctly follow the latest design system guidance. | ||
| When working with AI agents, use the [WordPress Design System MCP Server](?path=/docs/design-system-using-with-ai--docs). It gives agents the latest component documentation, usage examples, and design tokens. |
There was a problem hiding this comment.
Good simplified language all around 👍 Same detail in much fewer words 😄
| } ) => { | ||
| const Art = illustrations[ illustration ]; | ||
| return ( | ||
| <Card.Root className={ `sb-unstyled ${ styles.card }` }> |
There was a problem hiding this comment.
I love how this came together so well using all existing design system pieces ❤️
…ction Show Theming, Components, Icons, DataViews and Admin UI as cards with abstract SVG headers, a short description, and links to the Storybook page and the developer handbook.
Rework the copy, show the principles as cards, and tune the package cards.
Pass the card descriptions to the card components as children instead of holding them in component data, so the human-readable text lives in the Markdown.
The storybook tsconfig already gets the *.module.scss typings from the style-imports types.
Use "Learn more about <title>" instead of "See more", since the title is already known.
Co-authored-by: Andrew Duthie <1779930+aduth@users.noreply.github.com>
Move the package and principle cards, the shared illustration wrapper and each illustration into storybook/stories/design-system/intro-cards.
…ction Describe foundational packages as primitives for custom interfaces and compositional packages as complete experiences built from them.
Use "Read the <title> package documentation" so it is clear where the link goes and how it differs from the Storybook link.
…mpositional packages (dataviews/forms/admin-ui)
39c2173 to
157c594
Compare
Render the link row through Text so the links use the body-md size instead of inheriting the larger docs font size.
…age (WordPress#85482) Co-authored-by: Andrew Duthie <1779930+aduth@users.noreply.github.com>
What?
Essentially, trying to condense this as an "introduction" page that is easy to skim.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Use of AI Tools
yes