File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
packages/js/ui/src/wp/fieldset-as-label Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,36 @@ import { __experimentalView as View } from '@wordpress/components';
22import clsx from 'clsx' ;
33import styles from './styles.module.scss' ;
44
5- export type FieldsetAsLabelProps = {
5+ export type FieldsetAsLabelProps = React . HTMLAttributes < HTMLFieldSetElement > & {
66 label : React . ReactNode ;
7- children ?: React . ReactNode ;
7+ labelProps ?: React . HTMLAttributes < HTMLLegendElement > ;
8+ description ?: React . ReactNode ;
89} ;
910
10- export function FieldsetAsLabel ( { label, children } : FieldsetAsLabelProps ) {
11+ export function FieldsetAsLabel ( {
12+ label,
13+ children,
14+ labelProps,
15+ description,
16+ ...props
17+ } : FieldsetAsLabelProps ) {
1118 return (
12- < fieldset >
19+ < fieldset { ... props } >
1320 < View
21+ { ...labelProps }
1422 as = "legend"
1523 className = { clsx ( 'components-base-control__label' , styles . label ) }
1624 >
1725 { label }
1826 </ View >
1927 < View > { children } </ View >
28+ { description ? (
29+ < View
30+ className = { clsx ( 'components-base-control__help' , styles . description ) }
31+ >
32+ { description }
33+ </ View >
34+ ) : null }
2035 </ fieldset >
2136 ) ;
2237}
Original file line number Diff line number Diff line change 77 margin-bottom : calc (8px );
88 padding : 0px ;
99}
10+
11+ .description {
12+ margin-top : calc (8px );
13+ margin-bottom : 0px ;
14+ font-size : 12px ;
15+ font-style : normal ;
16+ color : rgb (117 , 117 , 117 );
17+ }
You can’t perform that action at this time.
0 commit comments