-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextControl: Fix remaining 40px size violations #64594
Changes from 21 commits
29fd789
6257d8d
2b0b2d6
8324c68
29012b0
4f207fe
72388c0
eeb5420
fd4c152
8f2a453
c88015e
c1af253
27ebd82
c84c59f
16d6568
545f025
53e6ec3
7b208b5
1dcb2c5
e42dd71
6cfbf62
bc7ee44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,8 +150,7 @@ function NonDefaultControls( { format, onChange } ) { | |
/> | ||
{ isCustom && ( | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Custom format' ) } | ||
hideLabelFromVision | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,16 +227,14 @@ const ImageURLInputUI = ( { | |
checked={ linkTarget === '_blank' } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Link rel' ) } | ||
value={ rel ?? '' } | ||
onChange={ onSetLinkRel } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
label={ __( 'Link CSS class' ) } | ||
value={ linkClass || '' } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,8 +380,7 @@ function ButtonEdit( props ) { | |
<InspectorControls group="advanced"> | ||
{ isLinkTag && ( | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Link rel' ) } | ||
value={ rel || '' } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,8 +63,7 @@ function InputFieldBlock( { attributes, setAttributes, className } ) { | |
) } | ||
<InspectorControls group="advanced"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
autoComplete="off" | ||
label={ __( 'Name' ) } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,8 +130,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => { | |
{ submissionMethod !== 'email' && ( | ||
<InspectorControls group="advanced"> | ||
<SelectControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Method' ) } | ||
options={ [ | ||
|
@@ -147,8 +146,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => { | |
) } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
autoComplete="off" | ||
label={ __( 'Form action' ) } | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -690,8 +690,7 @@ export default function Image( { | |||||
) } | ||||||
renderContent={ () => ( | ||||||
<TextControl | ||||||
// TODO: Switch to `true` (40px size) if possible | ||||||
__next40pxDefaultSize={ false } | ||||||
__next40pxDefaultSize | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kind of hard to get to this state. See testing instructions for #58998 if you're interested 😅
|
||||||
className="wp-block-image__toolbar_content_textarea" | ||||||
__nextHasNoMarginBottom | ||||||
label={ __( 'Title attribute' ) } | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,7 @@ export default function NavigationMenuNameControl() { | |
|
||
return ( | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Menu name' ) } | ||
value={ title } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,7 @@ export default function Edit( { attributes: { commentId }, setAttributes } ) { | |
) } | ||
> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
value={ commentId } | ||
onChange={ ( val ) => | ||
|
@@ -44,6 +43,7 @@ export default function Edit( { attributes: { commentId }, setAttributes } ) { | |
/> | ||
|
||
<Button | ||
__next40pxDefaultSize | ||
variant="primary" | ||
onClick={ () => { | ||
setAttributes( { commentId: commentIdInput } ); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,8 +230,7 @@ export default function PostFeaturedImageEdit( { | |
checked={ linkTarget === '_blank' } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Link rel' ) } | ||
value={ rel } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,8 +83,7 @@ export default function PostTermsEdit( { | |
</BlockControls> | ||
<InspectorControls group="advanced"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
autoComplete="off" | ||
label={ __( 'Separator' ) } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,8 +162,7 @@ export default function PostTitleEdit( { | |
checked={ linkTarget === '_blank' } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Link rel' ) } | ||
value={ rel } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,8 +139,7 @@ const SocialLinkEdit = ( { | |
<PanelBody title={ __( 'Settings' ) }> | ||
<PanelRow> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Text' ) } | ||
help={ __( | ||
|
@@ -157,8 +156,7 @@ const SocialLinkEdit = ( { | |
</InspectorControls> | ||
<InspectorControls group="advanced"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
label={ __( 'Link rel' ) } | ||
value={ rel || '' } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,7 @@ export function TemplatePartAdvancedControls( { | |
{ isEntityAvailable && ( | ||
<> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Title' ) } | ||
value={ title } | ||
|
@@ -85,8 +84,7 @@ export function TemplatePartAdvancedControls( { | |
/> | ||
|
||
<SelectControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
label={ __( 'Area' ) } | ||
labelPosition="top" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,8 +99,7 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) { | |
</span> | ||
<Grid columns={ 2 } gap={ 4 }> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
/* eslint-disable jsx-a11y/no-autofocus */ | ||
autoFocus | ||
|
@@ -116,8 +115,7 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) { | |
help={ __( 'Title of track' ) } | ||
/> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
onChange={ ( newSrcLang ) => | ||
onChange( { | ||
|
@@ -132,8 +130,7 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) { | |
</Grid> | ||
<VStack spacing="8"> | ||
<SelectControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
className="block-library-video-tracks-editor__single-track-editor-kind-select" | ||
options={ KIND_OPTIONS } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,8 +78,7 @@ function AddNewItemModalContent( { type, setIsAdding } ) { | |
> | ||
<VStack spacing="5"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Name' ) } | ||
value={ title } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,7 @@ function RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) { | |
> | ||
<VStack spacing="5"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Name' ) } | ||
value={ title } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ const getFuturePostUrl = ( post ) => { | |
function CopyButton( { text, onCopy, children } ) { | ||
const ref = useCopyToClipboard( text, onCopy ); | ||
return ( | ||
<Button variant="secondary" ref={ ref }> | ||
<Button __next40pxDefaultSize variant="secondary" ref={ ref }> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{ children } | ||
</Button> | ||
); | ||
|
@@ -122,8 +122,7 @@ class PostPublishPanelPostpublish extends Component { | |
</p> | ||
<div className="post-publish-panel__postpublish-post-address-container"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
className="post-publish-panel__postpublish-post-address" | ||
readOnly | ||
|
@@ -147,12 +146,17 @@ class PostPublishPanelPostpublish extends Component { | |
|
||
<div className="post-publish-panel__postpublish-buttons"> | ||
{ ! isScheduled && ( | ||
<Button variant="primary" href={ link }> | ||
<Button | ||
variant="primary" | ||
href={ link } | ||
__next40pxDefaultSize | ||
> | ||
{ viewPostLabel } | ||
</Button> | ||
) } | ||
<Button | ||
variant={ isScheduled ? 'primary' : 'secondary' } | ||
__next40pxDefaultSize | ||
href={ addLink } | ||
> | ||
{ addNewPostLabel } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,7 @@ function PostSlugControl() { | |
|
||
return ( | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't appear anywhere in the app anymore, but code-wise it looks safe to change. |
||
__nextHasNoMarginBottom | ||
label={ __( 'Slug' ) } | ||
autoComplete="off" | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -407,8 +407,7 @@ export function HierarchicalTermSelector( { slug } ) { | |||||
<Flex direction="column" gap="4"> | ||||||
{ showFilter && ( | ||||||
<TextControl | ||||||
// TODO: Switch to `true` (40px size) if possible | ||||||
__next40pxDefaultSize={ false } | ||||||
__next40pxDefaultSize | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The category filter that appears in the post sidebar when there are many categories.
May want to switch to a SearchControl (#64593). |
||||||
__nextHasNoMarginBottom | ||||||
label={ filterLabel } | ||||||
value={ filterValue } | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,8 +169,7 @@ export default function ReusableBlockConvertButton( { | |
> | ||
<VStack spacing="5"> | ||
<TextControl | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't appear in the app anymore, but should be safe (same as #64213 (comment)). |
||
__nextHasNoMarginBottom | ||
label={ __( 'Name' ) } | ||
value={ title } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the stricter rule that doesn't allow
__next40pxDefaultSize={ false }
, now that we're done migrating.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!