Skip to content

Commit

Permalink
Shadows: Unlock private components and hooks at the file level (#61790)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
  • Loading branch information
4 people committed May 20, 2024
1 parent 6b5d388 commit c464a35
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import { unlock } from '../../lock-unlock';
* @type {Array}
*/
const EMPTY_ARRAY = [];
const {
CompositeItemV2: CompositeItem,
CompositeV2: Composite,
useCompositeStoreV2: useCompositeStore,
} = unlock( componentsPrivateApis );

export function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {
const shadows = useShadowPresets( settings );
Expand Down Expand Up @@ -59,8 +64,6 @@ export function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {
}

export function ShadowPresets( { presets, activeShadow, onSelect } ) {
const { CompositeV2: Composite, useCompositeStoreV2: useCompositeStore } =
unlock( componentsPrivateApis );
const compositeStore = useCompositeStore();
return ! presets ? null : (
<Composite
Expand All @@ -86,7 +89,6 @@ export function ShadowPresets( { presets, activeShadow, onSelect } ) {
}

export function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {
const { CompositeItemV2: CompositeItem } = unlock( componentsPrivateApis );
return (
<CompositeItem
role="option"
Expand Down

0 comments on commit c464a35

Please sign in to comment.