Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ export default function TypographyPanel( {
<TextIndentControl
value={ textIndent }
onChange={ setTextIndentValue }
size="__unstable-large"
__unstableInputWidth="auto"
withSlider
hasBottomMargin={ isGlobalStyles }
Expand Down
26 changes: 10 additions & 16 deletions packages/block-editor/src/components/text-indent-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,17 @@ import { useSettings } from '../../components/use-settings';
/**
* Control for line text indent.
*
* @param {Object} props Component props.
* @param {boolean} props.__next40pxDefaultSize Start opting into the larger default height that will become the default size in a future version.
* @param {string} props.value Currently selected text indent.
* @param {Function} props.onChange Handles change in text indent selection.
* @param {string|number|undefined} props.__unstableInputWidth Input width to pass through to inner UnitControl. Should be a valid CSS value.
* @param {boolean} props.withSlider Whether to show the slider control.
* @param {boolean} props.hasBottomMargin Whether to add bottom margin below the control.
* @param {string} props.help Help text to display below the control.
* @param {Object} props Component props.
* @param {string} props.value Currently selected text indent.
* @param {Function} props.onChange Handles change in text indent selection.
* @param {string|number|undefined} props.__unstableInputWidth Input width to pass through to inner UnitControl. Should be a valid CSS value.
* @param {boolean} props.withSlider Whether to show the slider control.
* @param {boolean} props.hasBottomMargin Whether to add bottom margin below the control.
* @param {string} props.help Help text to display below the control.
*
* @return {Element} Text indent control.
*/
export default function TextIndentControl( {
__next40pxDefaultSize = false,
value,
onChange,
__unstableInputWidth = '60px',
Expand Down Expand Up @@ -68,9 +66,8 @@ export default function TextIndentControl( {
if ( ! withSlider ) {
return (
<UnitControl
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize
{ ...otherProps }
__next40pxDefaultSize
label={ __( 'Line indent' ) }
value={ value }
__unstableInputWidth={ __unstableInputWidth }
Expand All @@ -89,14 +86,12 @@ export default function TextIndentControl( {
<Flex>
<FlexItem isBlock>
<UnitControl
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize
__next40pxDefaultSize
label={ __( 'Line indent' ) }
labelPosition="top"
hideLabelFromVision
value={ value }
onChange={ onChange }
size={ otherProps.size }
units={ units }
__unstableInputWidth={ __unstableInputWidth }
min={ 0 }
Expand All @@ -106,8 +101,7 @@ export default function TextIndentControl( {
<FlexItem isBlock>
<Spacer marginX={ 2 } marginBottom={ 0 }>
<RangeControl
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize
__next40pxDefaultSize
label={ __( 'Line indent' ) }
hideLabelFromVision
value={ valueQuantity }
Expand Down
1 change: 1 addition & 0 deletions tools/eslint/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const restrictedSyntax = [
'QueryControls',
'SearchControl',
'TextControl',
'TextIndentControl',
'TreeSelect',
].map( ( componentName ) => ( {
selector: `JSXElement[openingElement.name.name="${ componentName }"] JSXAttribute[name.name="__next40pxDefaultSize"]`,
Expand Down
Loading