forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving forward with Fabian's slotfill method for handling tab activat…
…ion/element-grouping. Will come back in later this week to add key handlers
- Loading branch information
1 parent
d0e886a
commit bf5d44f
Showing
8 changed files
with
437 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createSlotFill } from '@wordpress/components'; | ||
|
||
/** | ||
* Props to @fabiankaegy for the SlotFill implementation https://github.com/WordPress/gutenberg/pull/63689#issuecomment-2268555989 | ||
*/ | ||
const { Fill, Slot } = createSlotFill( 'TabsList' ); | ||
|
||
export const TabFill = ( { children, tabsClientId } ) => { | ||
return <Fill name={ `TabsList-${ tabsClientId }` }>{ children }</Fill>; | ||
}; | ||
|
||
export const TabsListSlot = ( { tabsClientId } ) => { | ||
return ( | ||
<Slot | ||
name={ `TabsList-${ tabsClientId }` } | ||
bubblesVirtually | ||
as="ul" | ||
role="tablist" | ||
className="tabs__list" | ||
/> | ||
); | ||
}; |
Oops, something went wrong.