Skip to content
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

Apply __next40pxDefaultSize to TextControl and Button component in renaming UIs #56933

Merged
merged 2 commits into from
Dec 11, 2023
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 @@ -88,6 +88,7 @@ export default function BlockRenameModal( {
<VStack spacing="3">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
value={ editedBlockName }
label={ __( 'Block name' ) }
hideLabelFromVision={ true }
Expand All @@ -96,11 +97,16 @@ export default function BlockRenameModal( {
onFocus={ autoSelectInputText }
/>
<HStack justify="right">
<Button variant="tertiary" onClick={ onClose }>
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ onClose }
>
{ __( 'Cancel' ) }
</Button>

<Button
__next40pxDefaultSize
aria-disabled={ ! isNameValid }
variant="primary"
type="submit"
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/hooks/block-renaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function BlockRenameControlPure( { metadata, setAttributes } ) {
<InspectorControls group="advanced">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Block name' ) }
value={ metadata?.name || '' }
onChange={ ( newName ) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default function RenameMenuItem( { item, onClose } ) {
<VStack spacing="5">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Name' ) }
value={ title }
onChange={ setTitle }
Expand All @@ -104,6 +105,7 @@ export default function RenameMenuItem( { item, onClose } ) {

<HStack justify="right">
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ () => {
setIsModalOpen( false );
Expand All @@ -113,7 +115,11 @@ export default function RenameMenuItem( { item, onClose } ) {
{ __( 'Cancel' ) }
</Button>

<Button variant="primary" type="submit">
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
>
{ __( 'Save' ) }
</Button>
</HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ export default function RenameModal( { menuTitle, onClose, onSave } ) {
<VStack spacing="3">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
value={ editedMenuTitle }
placeholder={ __( 'Navigation title' ) }
onChange={ setEditedMenuTitle }
/>
<HStack justify="right">
<Button variant="tertiary" onClick={ onClose }>
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ onClose }
>
{ __( 'Cancel' ) }
</Button>

<Button
__next40pxDefaultSize
disabled={ ! isEditedMenuTitleValid }
variant="primary"
type="submit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default function RenameMenuItem( { template, onClose } ) {
<VStack spacing="5">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Name' ) }
value={ editedTitle }
onChange={ setEditedTitle }
Expand All @@ -115,6 +116,7 @@ export default function RenameMenuItem( { template, onClose } ) {

<HStack justify="right">
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ () => {
setIsModalOpen( false );
Expand All @@ -123,7 +125,11 @@ export default function RenameMenuItem( { template, onClose } ) {
{ __( 'Cancel' ) }
</Button>

<Button variant="primary" type="submit">
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
>
{ __( 'Save' ) }
</Button>
</HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default function RenamePatternCategoryModal( {
<TextControl
ref={ textControlRef }
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Name' ) }
value={ name }
onChange={ onChange }
Expand All @@ -154,10 +155,15 @@ export default function RenamePatternCategoryModal( {
) }
</VStack>
<HStack justify="right">
<Button variant="tertiary" onClick={ onRequestClose }>
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ onRequestClose }
>
{ __( 'Cancel' ) }
</Button>
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
aria-disabled={
Expand Down
13 changes: 11 additions & 2 deletions packages/patterns/src/components/rename-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,27 @@ export default function RenamePatternModal( {
<VStack spacing="5">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Name' ) }
value={ name }
onChange={ setName }
required
/>

<HStack justify="right">
<Button variant="tertiary" onClick={ onRequestClose }>
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ onRequestClose }
>
{ __( 'Cancel' ) }
</Button>

<Button variant="primary" type="submit">
<Button
__next40pxDefaultSize
variant="primary"
type="submit"
>
{ __( 'Save' ) }
</Button>
</HStack>
Expand Down
Loading