Skip to content

Commit 8545dce

Browse files
committed
Improve the block editing UX
- Label the None icon setting - Add help text to block settings - Remove button focus styles - Add border support to the group.
1 parent b34d875 commit 8545dce

File tree

7 files changed

+21
-6
lines changed

7 files changed

+21
-6
lines changed

docs/reference-guides/core-blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ A single accordion that displays a header and expandable content. ([Source](http
3939
- **Category:** design
4040
- **Parent:** core/accordion-group
4141
- **Allowed Blocks:** core/accordion-trigger, core/accordion-content
42-
- **Supports:** align (full, wide), border, color (background, gradient, text), interactivity, layout, shadow, spacing (blockGap, margin)
42+
- **Supports:** align (full, wide), color (background, gradient, text), interactivity, layout, shadow, spacing (blockGap, margin)
4343
- **Attributes:** openByDefault
4444

4545
## Trigger

packages/block-library/src/accordion-group/block.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
"background": true,
2222
"gradient": true
2323
},
24+
"__experimentalBorder": {
25+
"color": true,
26+
"radius": true,
27+
"style": true,
28+
"width": true,
29+
"__experimentalDefaultControls": {
30+
"color": true,
31+
"radius": true,
32+
"style": true,
33+
"width": true
34+
}
35+
},
2436
"spacing": {
2537
"padding": true,
2638
"margin": [ "top", "bottom" ],

packages/block-library/src/accordion-group/edit.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ export default function Edit( { attributes: { autoclose }, setAttributes } ) {
2929
<PanelBody title={ __( 'Settings' ) } initialOpen>
3030
<ToggleControl
3131
isBlock
32-
label={ __( 'Autoclose' ) }
32+
label={ __( 'Close automatically' ) }
3333
onChange={ ( value ) => {
3434
setAttributes( {
3535
autoclose: value,
3636
} );
3737
} }
3838
checked={ autoclose }
39+
help={ __(
40+
'Clicking one accordion section automatically closes all other open sections.'
41+
) }
3942
/>
4043
</PanelBody>
4144
</InspectorControls>

packages/block-library/src/accordion-group/style.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
flex-direction: row-reverse;
5858
}
5959

60-
.accordion-item__toggle:focus,
6160
.accordion-item__toggle:focus-visible {
6261
outline: 2px solid -webkit-focus-ring-color;
6362
outline-offset: 2px;

packages/block-library/src/accordion-item/block.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"background": true,
1717
"gradient": true
1818
},
19-
"border": true,
2019
"interactivity": true,
2120
"spacing": {
2221
"margin": [ "top", "bottom" ],

packages/block-library/src/accordion-item/edit.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export default function Edit( {
9797
}
9898
} }
9999
checked={ openByDefault }
100+
help={ __(
101+
'Accordion content will be displayed by default.'
102+
) }
100103
/>
101104
</PanelBody>
102105
</InspectorControls>

packages/block-library/src/accordion-trigger/edit.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ export default function Edit( { attributes, setAttributes } ) {
103103
icon={ chevronRight }
104104
value="chevronRight"
105105
/>
106-
<ToggleGroupControlOptionIcon
106+
<ToggleGroupControlOption
107107
label="None"
108-
icon={ false }
109108
value={ false }
110109
/>
111110
</ToggleGroupControl>

0 commit comments

Comments
 (0)