-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Composite: fix Storybook docgen (#64682)
* Move subcomponents to separate files, add default export * Remove custom Storybook args info * Remove subcomponents folder * Do not export `useCompositeStore` in the index.tsx file * CHANGELOG * Update contributing guidelines * Remove unnecessary displayName override on top level composite * Remove default exports * Move CHANGELOG entry under right section * Remove JSDoc prop types * CHANGELOG update * typo --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
- Loading branch information
1 parent
2a7c3e6
commit 2cbba93
Showing
15 changed files
with
301 additions
and
430 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
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,31 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import * as Ariakit from '@ariakit/react'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { forwardRef } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { WordPressComponentProps } from '../context'; | ||
import { useCompositeContext } from './context'; | ||
import type { CompositeGroupLabelProps } from './types'; | ||
|
||
export const CompositeGroupLabel = forwardRef< | ||
HTMLDivElement, | ||
WordPressComponentProps< CompositeGroupLabelProps, 'div', false > | ||
>( function CompositeGroupLabel( props, ref ) { | ||
const context = useCompositeContext(); | ||
return ( | ||
<Ariakit.CompositeGroupLabel | ||
store={ context?.store } | ||
{ ...props } | ||
ref={ ref } | ||
/> | ||
); | ||
} ); | ||
CompositeGroupLabel.displayName = 'Composite.GroupLabel'; |
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,31 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import * as Ariakit from '@ariakit/react'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { forwardRef } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { WordPressComponentProps } from '../context'; | ||
import { useCompositeContext } from './context'; | ||
import type { CompositeGroupProps } from './types'; | ||
|
||
export const CompositeGroup = forwardRef< | ||
HTMLDivElement, | ||
WordPressComponentProps< CompositeGroupProps, 'div', false > | ||
>( function CompositeGroup( props, ref ) { | ||
const context = useCompositeContext(); | ||
return ( | ||
<Ariakit.CompositeGroup | ||
store={ context?.store } | ||
{ ...props } | ||
ref={ ref } | ||
/> | ||
); | ||
} ); | ||
CompositeGroup.displayName = 'Composite.Group'; |
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,31 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import * as Ariakit from '@ariakit/react'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { forwardRef } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { WordPressComponentProps } from '../context'; | ||
import { useCompositeContext } from './context'; | ||
import type { CompositeHoverProps } from './types'; | ||
|
||
export const CompositeHover = forwardRef< | ||
HTMLDivElement, | ||
WordPressComponentProps< CompositeHoverProps, 'div', false > | ||
>( function CompositeHover( props, ref ) { | ||
const context = useCompositeContext(); | ||
return ( | ||
<Ariakit.CompositeHover | ||
store={ context?.store } | ||
{ ...props } | ||
ref={ ref } | ||
/> | ||
); | ||
} ); | ||
CompositeHover.displayName = 'Composite.Hover'; |
Oops, something went wrong.