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

Components: Unite inline Ariakit imports #67818

Merged
merged 1 commit into from
Dec 11, 2024
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 @@ -2,7 +2,6 @@
* External dependencies
*/
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';

/**
* WordPress dependencies
Expand Down Expand Up @@ -63,7 +62,7 @@ const CustomSelectButton = ( {
CustomSelectStore,
'onChange'
> ) => {
const { value: currentValue } = useStoreState( store );
const { value: currentValue } = Ariakit.useStoreState( store );

const computedRenderSelectedValue = useMemo(
() => renderSelectedValue ?? defaultRenderSelectedValue,
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';

/**
* WordPress dependencies
Expand Down Expand Up @@ -109,7 +108,7 @@ const UnconnectedMenu = (
// Extract the side from the applied placement — useful for animations.
// Using `currentPlacement` instead of `placement` to make sure that we
// use the final computed placement (including "flips" etc).
const appliedPlacementSide = useStoreState(
const appliedPlacementSide = Ariakit.useStoreState(
menuStore,
'currentPlacement'
).split( '-' )[ 0 ];
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/radio-group/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { forwardRef, useContext } from '@wordpress/element';
* External dependencies
*/
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';

/**
* Internal dependencies
Expand All @@ -28,7 +27,7 @@ function UnforwardedRadio(
) {
const { store, disabled } = useContext( RadioGroupContext );

const selectedValue = useStoreState( store, 'value' );
const selectedValue = Ariakit.useStoreState( store, 'value' );
const isChecked = selectedValue !== undefined && selectedValue === value;

maybeWarnDeprecated36pxSize( {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/tab-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';
import clsx from 'clsx';
import type { ForwardedRef } from 'react';

Expand Down Expand Up @@ -125,7 +124,7 @@ const UnforwardedTabPanel = (
} );

const selectedTabName = extractTabName(
useStoreState( tabStore, 'selectedId' )
Ariakit.useStoreState( tabStore, 'selectedId' )
);

const setTabStoreSelectedId = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import type { ForwardedRef } from 'react';
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';

/**
* WordPress dependencies
Expand Down Expand Up @@ -70,7 +69,7 @@ function UnforwardedToggleGroupControlAsRadioGroup(
rtl: isRTL(),
} );

const selectedValue = useStoreState( radio, 'value' );
const selectedValue = Ariakit.useStoreState( radio, 'value' );
const setValue = radio.setValue;

// Ensures that the active id is also reset after the value is "reset" by the consumer.
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import * as Ariakit from '@ariakit/react';
import { useStoreState } from '@ariakit/react';
import clsx from 'clsx';

/**
Expand Down Expand Up @@ -94,7 +93,7 @@ function UnforwardedTooltip(
placement: computedPlacement,
showTimeout: delay,
} );
const mounted = useStoreState( tooltipStore, 'mounted' );
const mounted = Ariakit.useStoreState( tooltipStore, 'mounted' );

if ( isNestedInTooltip ) {
return isOnlyChild ? (
Expand Down
Loading