-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move components in wp.blocks.InspectorControls.* to wp.components.*.
The components were not inspector controls specific, they were just generic input elements. This move will allow other parts of the Gutenberg besides blocks, e.g: document sidebar to take advantage of this reusable components.
- Loading branch information
1 parent
13b181b
commit 2a7ad80
Showing
37 changed files
with
301 additions
and
87 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
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
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
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
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
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
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
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,63 @@ | ||
BaseControl | ||
======= | ||
|
||
BaseControl component is used to generate labels and help text for components handling user inputs. | ||
|
||
|
||
## Usage | ||
|
||
Render a BaseControl for a textarea input: | ||
```jsx | ||
<BaseControl | ||
id="textarea-1" | ||
label="Text" | ||
help="Enter some text" | ||
> | ||
<textarea | ||
id="textarea-1" | ||
onChange={ onChangeValue } | ||
value={ value } | ||
/> | ||
</BaseControl> | ||
``` | ||
|
||
## Props | ||
|
||
The component accepts the following props: | ||
|
||
### id | ||
|
||
The id of the element to which labels and help text are being generated. That element should be passed as a child. | ||
|
||
- Type: `String` | ||
- Required: Yes | ||
|
||
|
||
### label | ||
|
||
If this property is added, a label will be generated using label property as the content. | ||
|
||
- Type: `String` | ||
- Required: No | ||
|
||
### help | ||
|
||
If this property is added, a help text will be generated using help property as the content. | ||
|
||
- Type: `String` | ||
- Required: No | ||
|
||
### className | ||
|
||
The class that will be added with "blocks-base-control" to the classes of the wrapper div. | ||
If no className is passed only blocks-base-control is used. | ||
|
||
- Type: `String` | ||
- Required: No | ||
|
||
### children | ||
|
||
The content to be displayed within the BaseControl. | ||
|
||
- Type: `Element` | ||
- Required: Yes |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.