Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 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
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/block-directory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@wordpress/notices": "file:../notices",
"@wordpress/plugins": "file:../plugins",
"@wordpress/private-apis": "file:../private-apis",
"@wordpress/ui": "file:../ui",
"@wordpress/url": "file:../url",
"change-case": "^4.1.2",
"clsx": "^2.1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { __, _n, sprintf } from '@wordpress/i18n';
import {
Tooltip,
Spinner,
VisuallyHidden,
Composite,
} from '@wordpress/components';
import { Tooltip, Spinner, Composite } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';
import { getBlockType } from '@wordpress/blocks';
import { useSelect } from '@wordpress/data';
import { VisuallyHidden } from '@wordpress/ui';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
FlexBlock,
FocalPointPicker,
MenuItem,
VisuallyHidden,
__experimentalHStack as HStack,
__experimentalTruncate as Truncate,
Dropdown,
Expand All @@ -25,6 +24,7 @@ import {
__experimentalDropdownContentWrapper as DropdownContentWrapper,
Button,
} from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { reset as resetIcon } from '@wordpress/icons';
import { __, _x, sprintf } from '@wordpress/i18n';
import { store as noticesStore } from '@wordpress/notices';
Expand Down Expand Up @@ -162,7 +162,7 @@ function InspectorImagePreviewItem( {
>
{ label }
</Truncate>
<VisuallyHidden as="span">
<VisuallyHidden render={ <span /> }>
{ imgUrl
? sprintf(
/* translators: %s: file name */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { getBlockType } from '@wordpress/blocks';
import { Button, VisuallyHidden } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { useInstanceId } from '@wordpress/compose';
import { useSelect, useDispatch } from '@wordpress/data';
import { forwardRef } from '@wordpress/element';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*/
import { useDispatch } from '@wordpress/data';
import { cloneBlock } from '@wordpress/blocks';
import { Composite, VisuallyHidden } from '@wordpress/components';
import { Composite } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';

import { useState } from '@wordpress/element';
import { useInstanceId } from '@wordpress/compose';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { cloneBlock } from '@wordpress/blocks';
import { useEffect, useState, forwardRef, useMemo } from '@wordpress/element';
import {
Composite,
VisuallyHidden,
Tooltip,
__experimentalHStack as HStack,
} from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { useInstanceId } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { Icon, symbol } from '@wordpress/icons';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ import { useState } from '@wordpress/element';
import { useInstanceId, useViewportMatch } from '@wordpress/compose';
import { chevronRight } from '@wordpress/icons';

import {
Composite,
MenuGroup,
MenuItem,
Popover,
VisuallyHidden,
} from '@wordpress/components';
import { Composite, MenuGroup, MenuItem, Popover } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
Button,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
VisuallyHidden,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { useSelect, useDispatch } from '@wordpress/data';
import { useMemo } from '@wordpress/element';

Expand All @@ -30,7 +30,7 @@ function VariationsButtons( {
} ) {
return (
<fieldset className={ className }>
<VisuallyHidden as="legend">
<VisuallyHidden render={ <legend /> }>
{ __( 'Transform to variation' ) }
</VisuallyHidden>
{ variations.map( ( variation ) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { useState, createInterpolateElement } from '@wordpress/element';
import {
TextControl,
ExternalLink,
VisuallyHidden,
ToggleControl,
__experimentalVStack as VStack,
CustomSelectControl,
} from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';

// So that we illustrate the different formats in the dropdown properly, show a date that is
// somewhat recent, has a day greater than 12, and a month with more than three letters.
Expand Down Expand Up @@ -45,7 +45,9 @@ export default function DateFormatPicker( {
spacing={ 4 }
className="block-editor-date-format-picker"
>
<VisuallyHidden as="legend">{ __( 'Date format' ) }</VisuallyHidden>
<VisuallyHidden render={ <legend /> }>
{ __( 'Date format' ) }
</VisuallyHidden>
<ToggleControl
label={ __( 'Default format' ) }
help={ `${ __( 'Example:' ) } ${ dateI18n(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { __, isRTL } from '@wordpress/i18n';
import {
VisuallyHidden,
ToolbarButton,
ToolbarGroup,
} from '@wordpress/components';
import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import {
chevronLeft,
chevronUp,
Expand Down
5 changes: 3 additions & 2 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
useRef,
useLayoutEffect,
} from '@wordpress/element';
import { VisuallyHidden, SearchControl, Popover } from '@wordpress/components';
import { SearchControl, Popover } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { __ } from '@wordpress/i18n';
import { useDebouncedInput, useViewportMatch } from '@wordpress/compose';
import { useSelect } from '@wordpress/data';
Expand Down Expand Up @@ -235,7 +236,7 @@ function InserterMenu(
</div>
{ showInserterHelpPanel && (
<div className="block-editor-inserter__tips">
<VisuallyHidden as="h2">
<VisuallyHidden render={ <h2 /> }>
{ __( 'A tip for using the block editor' ) }
</VisuallyHidden>
<Tips />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useMemo, useEffect } from '@wordpress/element';
import { __, _n, sprintf } from '@wordpress/i18n';
import { VisuallyHidden } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { useDebounce, useAsyncList } from '@wordpress/compose';
import { speak } from '@wordpress/a11y';
import { useSelect } from '@wordpress/data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { CheckboxControl, VisuallyHidden } from '@wordpress/components';
import { CheckboxControl } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';

const noop = () => {};

Expand Down Expand Up @@ -58,7 +59,7 @@ const LinkControlSettings = ( { value, onChange = noop, settings } ) => {

return (
<fieldset className="block-editor-link-control__settings">
<VisuallyHidden as="legend">
<VisuallyHidden render={ <legend /> }>
{ __( 'Currently selected link settings' ) }
</VisuallyHidden>
{ theSettings }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
BaseControl,
Button,
Popover,
VisuallyHidden,
useBaseControlProps,
} from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { useState, useId, useRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

Expand Down
6 changes: 2 additions & 4 deletions packages/block-editor/src/components/list-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import {
useMergeRefs,
__experimentalUseFixedWindowList as useFixedWindowList,
} from '@wordpress/compose';
import {
__experimentalTreeGrid as TreeGrid,
VisuallyHidden,
} from '@wordpress/components';
import { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { AsyncModeProvider, useSelect } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { useInstanceId } from '@wordpress/compose';
import { VisuallyHidden } from '@wordpress/components';
import { VisuallyHidden } from '@wordpress/ui';
import { _x, sprintf } from '@wordpress/i18n';

export default function ResponsiveBlockControlLabel( {
Expand All @@ -27,7 +27,10 @@ export default function ResponsiveBlockControlLabel( {
<span aria-describedby={ `rbc-desc-${ instanceId }` }>
{ viewport.label }
</span>
<VisuallyHidden as="span" id={ `rbc-desc-${ instanceId }` }>
<VisuallyHidden
id={ `rbc-desc-${ instanceId }` }
render={ <span /> }
>
{ accessibleLabel }
</VisuallyHidden>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/utils/test/dom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
// eslint-disable-next-line @wordpress/use-recommended-components -- Required for testing
import { VisuallyHidden as WCVisuallyHidden } from '@wordpress/components';
// eslint-disable-next-line @wordpress/use-recommended-components -- Only for testing
import { VisuallyHidden } from '@wordpress/ui';
import {
getElementBounds,
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"@wordpress/reusable-blocks": "file:../reusable-blocks",
"@wordpress/rich-text": "file:../rich-text",
"@wordpress/server-side-render": "file:../server-side-render",
"@wordpress/ui": "file:../ui",
"@wordpress/upload-media": "file:../upload-media",
"@wordpress/url": "file:../url",
"@wordpress/viewport": "file:../viewport",
Expand Down
5 changes: 3 additions & 2 deletions packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
SelectControl,
Spinner,
ToggleControl,
VisuallyHidden,
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
Expand All @@ -26,6 +25,7 @@ import { __, sprintf } from '@wordpress/i18n';
import { pin } from '@wordpress/icons';
import { useEntityRecords } from '@wordpress/core-data';
import { useDispatch } from '@wordpress/data';
import { VisuallyHidden } from '@wordpress/ui';
import { store as noticeStore } from '@wordpress/notices';

/**
Expand Down Expand Up @@ -146,7 +146,8 @@ export default function CategoriesEdit( {
}
/>
) : (
<VisuallyHidden as="label" htmlFor={ selectId }>
// eslint-disable-next-line jsx-a11y/label-has-associated-control
<VisuallyHidden render={ <label htmlFor={ selectId } /> }>
{ label ? label : taxonomy?.name }
</VisuallyHidden>
) }
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import clsx from 'clsx';
*/
import { createBlock } from '@wordpress/blocks';
import { useSelect, useDispatch } from '@wordpress/data';
import {
ToolbarButton,
ToolbarGroup,
VisuallyHidden,
} from '@wordpress/components';
import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
import { __, sprintf } from '@wordpress/i18n';
import {
Expand All @@ -26,6 +22,7 @@ import {
} from '@wordpress/block-editor';
import { isURL, prependHTTP } from '@wordpress/url';
import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
import { VisuallyHidden } from '@wordpress/ui';
import { link as linkIcon, addSubmenu } from '@wordpress/icons';
import { useMergeRefs, useInstanceId } from '@wordpress/compose';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* WordPress dependencies
*/
import { Button, VisuallyHidden } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { __, isRTL } from '@wordpress/i18n';
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
import { VisuallyHidden } from '@wordpress/ui';

/**
* Shared BackButton component for consistent navigation across LinkUI sub-components.
Expand Down
Loading
Loading