Skip to content

Commit

Permalink
Update legacy storybook title/id, make sure JSDocs refer to unstable …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
ciampo committed Aug 8, 2024
1 parent b193a37 commit b3e58bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
import { UseCompositeStatePlaceholder, transform } from './utils';

const meta: Meta< typeof UseCompositeStatePlaceholder > = {
// TODO: should we keep this story around? If so, how should we call it?
title: 'Components/Composite/Legacy',
title: 'Components (Deprecated)/Composite (Unstable)',
id: 'components-composite-unstable',
component: UseCompositeStatePlaceholder,
subcomponents: {
// @ts-expect-error Storybook doesn't like overloaded exports as subcomponents
Expand Down
19 changes: 19 additions & 0 deletions packages/components/src/composite/legacy/stories/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ import type { StoryContext } from '@storybook/react';
*/
import type { LegacyStateOptions } from '..';

/**
* Renders a composite widget.
*
* This unstable component is deprecated. Use `Composite` instead.
*
* ```jsx
* import {
* __unstableUseCompositeState as useCompositeState,
* __unstableComposite as Composite,
* __unstableCompositeItem as CompositeItem,
* } from '@wordpress/components';
*
* const state = useCompositeState();
* <Composite state={ state }>
* <CompositeItem>Item 1</CompositeItem>
* <CompositeItem>Item 2</CompositeItem>
* </Composite>;
* ```
*/
export function UseCompositeStatePlaceholder( props: LegacyStateOptions ) {
return (
<dl>
Expand Down

0 comments on commit b3e58bc

Please sign in to comment.