Skip to content

Commit

Permalink
fix: Wrong import group for components/
Browse files Browse the repository at this point in the history
  • Loading branch information
im3dabasia committed Feb 28, 2025
1 parent ceb13e2 commit 60926be
Show file tree
Hide file tree
Showing 22 changed files with 28 additions and 31 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/autocomplete/autocompleter-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import clsx from 'clsx';
import { createPortal } from 'react-dom';

/**
* WordPress dependencies
Expand All @@ -14,8 +15,8 @@ import {
} from '@wordpress/element';
import { useAnchor } from '@wordpress/rich-text';
import { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';
import { speak } from '@wordpress/a11y';
import { __, _n, sprintf } from '@wordpress/i18n';
import { speak } from '@wordpress/a11y';

/**
* Internal dependencies
Expand All @@ -24,7 +25,6 @@ import getDefaultUseItems from './get-default-use-items';
import Button from '../button';
import Popover from '../popover';
import { VisuallyHidden } from '../visually-hidden';
import { createPortal } from 'react-dom';
import type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';

type ListBoxProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/box-control/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand All @@ -13,7 +14,6 @@ import type {
CustomValueUnits,
Preset,
} from './types';
import deprecated from '@wordpress/deprecated';

export const CUSTOM_VALUE_SETTINGS: CustomValueUnits = {
px: { max: 300, step: 1 },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/button/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import { render, screen } from '@testing-library/react';
import { press } from '@ariakit/test';

/**
* WordPress dependencies
Expand All @@ -15,7 +16,6 @@ import { plusCircle } from '@wordpress/icons';
import _Button from '..';
import Tooltip from '../../tooltip';
import cleanupTooltip from '../../tooltip/test/utils';
import { press } from '@ariakit/test';

jest.mock( '../../icon', () => () => <div data-testid="test-icon" /> );

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/color-picker/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { fireEvent, screen, render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { click } from '@ariakit/test';

/**
* WordPress dependencies
Expand All @@ -13,7 +14,6 @@ import { useState } from '@wordpress/element';
* Internal dependencies
*/
import { ColorPicker } from '..';
import { click } from '@ariakit/test';

const hslaMatcher = expect.objectContaining( {
h: expect.any( Number ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import clsx from 'clsx';
import type { MouseEventHandler } from 'react';

/**
* WordPress dependencies
Expand All @@ -20,7 +21,6 @@ import type {
CustomGradientBarReducerAction,
CustomGradientBarIdleState,
} from '../types';
import type { MouseEventHandler } from 'react';

const customGradientBarReducer = (
state: CustomGradientBarReducerState,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/dimension-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand All @@ -17,7 +18,6 @@ import sizesTable, { findSizeBySlug } from './sizes';
import type { DimensionControlProps, Size } from './types';
import type { SelectControlSingleSelectionProps } from '../select-control/types';
import { ContextSystemProvider } from '../context';
import deprecated from '@wordpress/deprecated';
import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';

const CONTEXT_VALUE = {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/disabled/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* External dependencies
*/
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

/**
* Internal dependencies
*/
import Disabled from '../';
import userEvent from '@testing-library/user-event';

describe( 'Disabled', () => {
const Form = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { useState } from '@wordpress/element';
import { swatch } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { useInstanceId } from '@wordpress/compose';

/**
* Internal dependencies
Expand All @@ -13,7 +14,6 @@ import ColorPalette from '../../color-palette';
import ColorIndicator from '../../color-indicator';
import Icon from '../../icon';
import type { ColorListPickerProps, ColorOptionProps } from './types';
import { useInstanceId } from '@wordpress/compose';

function ColorOption( {
label,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/focal-point-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import clsx from 'clsx';
import type { KeyboardEventHandler } from 'react';

/**
* WordPress dependencies
Expand Down Expand Up @@ -33,7 +34,6 @@ import type {
FocalPoint as FocalPointType,
FocalPointPickerProps,
} from './types';
import type { KeyboardEventHandler } from 'react';

const GRID_OVERLAY_TIMEOUT = 600;

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/menu/radio-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as Ariakit from '@ariakit/react';
*/
import { forwardRef, useContext } from '@wordpress/element';
import { Icon } from '@wordpress/icons';
import { SVG, Circle } from '@wordpress/primitives';

/**
* Internal dependencies
Expand All @@ -16,7 +17,6 @@ import type { WordPressComponentProps } from '../context';
import { Context } from './context';
import type { RadioItemProps } from './types';
import * as Styled from './styles';
import { SVG, Circle } from '@wordpress/primitives';

const radioCheck = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* External dependencies
*/
import { View, Text, TouchableWithoutFeedback } from 'react-native';
import { useRoute, useNavigation } from '@react-navigation/native';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { useState, useContext } from '@wordpress/element';
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
import { useRoute, useNavigation } from '@react-navigation/native';

/**
* Internal dependencies
Expand All @@ -22,7 +22,6 @@ import { colorsUtils } from './utils';
import PanelBody from '../../panel/body';
import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-context';
import ColorControl from '../../color-control';

import styles from './style.scss';

const HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/modal/use-modal-exit-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
import { useReducedMotion } from '@wordpress/compose';
import { useCallback, useRef, useState } from '@wordpress/element';
import warning from '@wordpress/warning';

/**
* Internal dependencies
*/
import { CONFIG } from '../utils';
import warning from '@wordpress/warning';

// Animation duration (ms) extracted to JS in order to be used on a setTimeout.
const FRAME_ANIMATION_DURATION = CONFIG.transitionDuration;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/navigator/navigator/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ForwardedRef } from 'react';
import { useMemo, useReducer } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';
import warning from '@wordpress/warning';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand All @@ -28,7 +29,6 @@ import type {
Screen,
NavigateToParentOptions,
} from '../types';
import deprecated from '@wordpress/deprecated';

type MatchedPath = ReturnType< typeof patternMatch >;

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/notice/list.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { View } from 'react-native';
*/
import { useSelect, useDispatch } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';
import { useCallback } from '@wordpress/element';

/**
* Internal dependencies
*/
import Notice from './';
import styles from './style.scss';
import { useCallback } from '@wordpress/element';

function NoticeList() {
const { notices } = useSelect( ( select ) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/panel/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* External dependencies
*/
import clsx from 'clsx';
import type { ForwardedRef } from 'react';

/**
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
import type { ForwardedRef } from 'react';

/**
* Internal dependencies
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/query-controls/category-select.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Internal dependencies
* WordPress dependencies
*/
import { buildTermsTree } from './terms';
import TreeSelect from '../tree-select';
import { useMemo } from '@wordpress/element';

/**
* WordPress dependencies
* Internal dependencies
*/
import { useMemo } from '@wordpress/element';
import { buildTermsTree } from './terms';
import TreeSelect from '../tree-select';
import type { CategorySelectProps } from './types';

export default function CategorySelect( {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/search-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import clsx from 'clsx';
import type { ForwardedRef } from 'react';

/**
* WordPress dependencies
Expand All @@ -18,7 +19,6 @@ import deprecated from '@wordpress/deprecated';
import Button from '../button';
import type { WordPressComponentProps } from '../context/wordpress-component';
import type { SearchControlProps, SuffixItemProps } from './types';
import type { ForwardedRef } from 'react';
import { ContextSystemProvider } from '../context';
import { StyledInputControl, SuffixItemWrapper } from './styles';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/slot-fill/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useState } from '@wordpress/element';
import { observableMap } from '@wordpress/compose';

/**
* Internal dependencies
Expand All @@ -15,7 +16,6 @@ import type {
SlotFillProviderProps,
SlotKey,
} from './types';
import { observableMap } from '@wordpress/compose';

function createSlotRegistry(): BaseSlotFillContext {
const slots = observableMap< SlotKey, BaseSlotInstance >();
Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/tabs/tab.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/**
* WordPress dependencies
*/

import { forwardRef } from '@wordpress/element';
import warning from '@wordpress/warning';
import { chevronRight } from '@wordpress/icons';

/**
* Internal dependencies
*/
import type { TabProps } from './types';
import warning from '@wordpress/warning';
import { useTabsContext } from './context';
import {
Tab as StyledTab,
TabChildren as StyledTabChildren,
TabChevron as StyledTabChevron,
} from './styles';
import type { WordPressComponentProps } from '../context';
import { chevronRight } from '@wordpress/icons';

export const Tab = forwardRef<
HTMLButtonElement,
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/tabs/tabpanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import { useStoreState } from '@ariakit/react';
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
import warning from '@wordpress/warning';

/**
* Internal dependencies
*/
import type { TabPanelProps } from './types';
import { TabPanel as StyledTabPanel } from './styles';

import warning from '@wordpress/warning';
import { useTabsContext } from './context';
import type { WordPressComponentProps } from '../context';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/text/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type React from 'react';

/**
* WordPress dependencies
Expand All @@ -23,7 +24,6 @@ import { CONFIG, COLORS } from '../utils';
import { getLineHeight } from './get-line-height';
import { useCx } from '../utils/hooks/use-cx';
import type { Props } from './types';
import type React from 'react';

/**
* @param {import('../context').WordPressComponentProps<import('./types').Props, 'span'>} props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { ForwardedRef } from 'react';
* WordPress dependencies
*/
import { useMemo, useState } from '@wordpress/element';
import { useMergeRefs } from '@wordpress/compose';

/**
* Internal dependencies
Expand All @@ -21,7 +22,6 @@ import * as styles from './styles';
import { ToggleGroupControlAsRadioGroup } from './as-radio-group';
import { ToggleGroupControlAsButtonGroup } from './as-button-group';
import { useTrackElementOffsetRect } from '../../utils/element-rect';
import { useMergeRefs } from '@wordpress/compose';
import { useAnimatedOffsetRect } from '../../utils/hooks/use-animated-offset-rect';
import { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';

Expand Down

0 comments on commit 60926be

Please sign in to comment.