Skip to content
Open
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
5 changes: 2 additions & 3 deletions packages/block-library/src/tab/add-tab-toolbar-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ToolbarGroup, ToolbarButton } from '@wordpress/components';
import { useDispatch, useSelect } from '@wordpress/data';

/**
* "Add Tab" button in the block toolbar for the tab block.
* "Add tab" button in the block toolbar for the tab block.
* Inserts new tabs into the tab-panels block.
*
* @param {Object} props
Expand Down Expand Up @@ -61,10 +61,9 @@ export default function AddTabToolbarControl( { tabsClientId } ) {
<ToolbarGroup>
<ToolbarButton
className="components-toolbar__control"
label={ __( 'Add a new tab' ) }
onClick={ addTab }
showTooltip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
showTooltip

Nit: the shouTooltip prop does nothing in this case.

text={ __( 'Add Tab' ) }
text={ __( 'Add tab' ) }
/>
</ToolbarGroup>
</BlockControls>
Expand Down
11 changes: 4 additions & 7 deletions packages/block-library/src/tab/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
InspectorControls,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { PanelBody, TextControl, ToggleControl } from '@wordpress/components';
import { PanelBody, TextControl, CheckboxControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
import { decodeEntities } from '@wordpress/html-entities';
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function Controls( {
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<TextControl
label={ __( 'Tab Label' ) }
label={ __( 'Label' ) }
value={ decodeEntities( label ) }
onChange={ ( value ) => {
setAttributes( {
Expand All @@ -45,17 +45,14 @@ export default function Controls( {
} }
__next40pxDefaultSize
/>
<ToggleControl
label={ __( 'Default Tab' ) }
<CheckboxControl
label={ __( 'Default tab' ) }
checked={ isDefaultTab }
onChange={ ( value ) => {
updateBlockAttributes( tabsClientId, {
activeTabIndex: value ? blockIndex : 0,
} );
} }
help={ __(
'If toggled, this tab will be selected when the page loads.'
) }
/>
</PanelBody>
</InspectorControls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function RemoveTabToolbarControl( { tabsClientId } ) {
label={ __( 'Remove the current tab' ) }
onClick={ removeTab }
showTooltip
text={ __( 'Remove Tab' ) }
text={ __( 'Remove tab' ) }
Comment on lines 94 to +97
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the unnecessary label and showTooltip prop?

disabled={ isDisabled }
/>
</ToolbarGroup>
Expand Down
8 changes: 4 additions & 4 deletions packages/block-library/src/tabs-menu-item/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default function Controls( {
<ColorGradientSettingsDropdown
settings={ [
{
label: __( 'Active Background' ),
label: __( 'Active background' ),
colorValue:
activeBackgroundColor?.color ??
customActiveBackgroundColor,
Expand All @@ -216,7 +216,7 @@ export default function Controls( {
},
},
{
label: __( 'Active Text' ),
label: __( 'Active text' ),
colorValue:
activeTextColor?.color ?? customActiveTextColor,
onColorChange: ( value ) => {
Expand All @@ -227,7 +227,7 @@ export default function Controls( {
},
},
{
label: __( 'Hover Background' ),
label: __( 'Hover background' ),
colorValue:
hoverBackgroundColor?.color ??
customHoverBackgroundColor,
Expand All @@ -239,7 +239,7 @@ export default function Controls( {
},
},
{
label: __( 'Hover Text' ),
label: __( 'Hover text' ),
colorValue:
hoverTextColor?.color ?? customHoverTextColor,
onColorChange: ( value ) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/tabs-menu-item/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function Edit( {
withoutInteractiveFormatting
placeholder={ sprintf(
/* translators: %d is the tab index + 1 */
__( 'Tab %d…' ),
__( 'Tab title %d' ),
tabIndex + 1
) }
value={ decodeEntities( editingLabel ) }
Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/src/tabs/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ export default function Controls( { attributes, setAttributes, clientId } ) {
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<TextControl
label={ __( 'Tabs Title' ) }
label={ __( 'Title' ) }
help={ __(
'The tabs title is used by screen readers to describe the purpose and content of the tabs.'
'The tabs title is used by screen readers to describe the purpose and content of the tab panel.'
) }
value={ metadata.name }
placeholder={ __( 'Tab Contents' ) }
onChange={ ( value ) => {
setAttributes( {
metadata: { ...metadata, name: value },
Expand Down
10 changes: 1 addition & 9 deletions packages/block-library/src/tabs/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import {
useBlockProps,
useInnerBlocksProps,
Expand Down Expand Up @@ -39,14 +38,7 @@ const TABS_TEMPLATE = [
anchor: 'tab-1',
label: 'Tab 1',
},
[
[
'core/paragraph',
{
placeholder: __( 'Type / to add a block to tab' ),
},
],
],
[ [ 'core/paragraph' ] ],
],
],
],
Expand Down
Loading