Repository navigation
Components: Add usage guidance for agents and Storybook #74815
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
Changes from 11 commits
4d2cd51
8a6b129
3ce6e92
a2333ea
e1ddc2b
ac32313
d161721
d70ed83
d518c12
f697d49
4902fa6
15395b0
ed46fc5
831c352
3082069
7310901
4081dd0
5de7126
c21cb9d
7643788
ffef2dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ## Status | ||
|
|
||
| This package contains UI components that are intended to be used anywhere in a general way (global), or specifically in the block editor. | ||
|
|
||
| We are currently in the process of rewriting the global components to be in the new `@wordpress/ui` package. However, this is a work in progress and `@wordpress/components` should continue to be used until further notice. | ||
|
|
||
| Due to the nature of the transition, some components may be deprecated or removed in the future. Check the component status documentation in each Storybook file for up-to-date usage guidance on each component. The component status given in the Storybook file should be considered the most accurate signal, above the `experimental` tag or component prefix. | ||
|
|
||
| ## Forms | ||
|
|
||
| Is the form going to edit items of a dataset, rather than simply submitting data somewhere? If so, consider using `DataForm` from the `@wordpress/dataviews` package. | ||
|
|
||
| For adding validation, consider using the [Validated Form Components](./src/validated-form-controls). | ||
|
|
||
| ## Storybook | ||
|
|
||
| Don't forget to check a components's Storybook documentation for additional usage guidance. The Storybook links ([public base URL](https://wordpress.github.io/gutenberg/)) are also useful to present to a human when they are asking for help with a component. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ const UnforwardedVisualLabel = ( | |
| export const VisualLabel = forwardRef( UnforwardedVisualLabel ); | ||
|
|
||
| /** | ||
| * `BaseControl` is a component used to generate labels and help text for components handling user inputs. | ||
| * `BaseControl` is a low-level component used to generate labels and help text for components handling user inputs. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only tangentially related to this PR, but this hints to coding agents that direct use of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessarily a need for this PR, but we could think of a hierarchy for this, ie. from "low-level" all the way to "high-level pattern", and then instruct AI agents to prioritize higher-level components, and only resort to lower-level if the higher-level didn't satisfy the requirements. |
||
| * | ||
| * ```jsx | ||
| * import { BaseControl, useBaseControlProps } from '@wordpress/components'; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whereUsedmetadata is unused at the moment, but adding here since we have this information and can be useful for coding agents, or classification later.