diff --git a/packages/block-editor/src/components/url-popover/stories/index.story.js b/packages/block-editor/src/components/url-popover/stories/index.story.js
index ceed23eed6b841..a66a369e0e2605 100644
--- a/packages/block-editor/src/components/url-popover/stories/index.story.js
+++ b/packages/block-editor/src/components/url-popover/stories/index.story.js
@@ -11,49 +11,111 @@ import { keyboardReturn } from '@wordpress/icons';
*/
import URLPopover from '../';
-export default { title: 'BlockEditor/URLPopover' };
+const meta = {
+ title: 'BlockEditor/URLPopover',
+ component: URLPopover,
+ parameters: {
+ docs: {
+ canvas: { sourceState: 'shown' },
+ description: {
+ component:
+ 'Popover component used for editing and viewing URLs.',
+ },
+ },
+ },
+ argTypes: {
+ onClose: {
+ action: 'onClose',
+ description: 'Callback when the popover is closed.',
+ table: {
+ type: { summary: 'function' },
+ },
+ },
+ renderSettings: {
+ description: 'Callback to render settings inside the popover.',
+ table: {
+ type: { summary: 'function' },
+ },
+ control: false,
+ },
+ placement: {
+ control: { type: 'text' },
+ description: 'Placement of the popover relative to its parent.',
+ defaultValue: 'bottom',
+ table: {
+ type: { summary: 'string' },
+ },
+ },
+ focusOnMount: {
+ control: { type: 'boolean' },
+ description:
+ 'Controls which element is focused when the popover mounts.',
+ defaultValue: true,
+ table: {
+ type: { summary: 'boolean' },
+ },
+ },
+ },
+ args: {
+ placement: 'bottom',
+ focusOnMount: true,
+ },
+};
-const TestURLPopover = () => {
- const [ isVisible, setVisiblility ] = useState( false );
- const [ url, setUrl ] = useState( '' );
+export default meta;
- const close = () => setVisiblility( false );
- const setTarget = () => {};
+export const Default = {
+ render: function Template( { onChange, ...args } ) {
+ const [ isVisible, setIsVisible ] = useState( false );
+ const [ url, setUrl ] = useState( '' );
+ const [ isOpenInNewTab, setIsOpenInNewTab ] = useState( false );
- return (
- <>
-
- { isVisible && (
- (
-
- ) }
- >
-
-
- ) }
- >
- );
-};
+ // Close the popover.
+ const closePopover = () => setIsVisible( false );
-export const _default = () => {
- return ;
+ return (
+ <>
+
+ { isVisible && (
+ (
+
+ ) }
+ >
+
+
+ ) }
+ >
+ );
+ },
+ args: {
+ placement: 'bottom',
+ focusOnMount: true,
+ onClose: () => {},
+ },
};