diff --git a/packages/dataviews/src/field-types/datetime.tsx b/packages/dataviews/src/field-types/datetime.tsx
index 7caf7bb23f191..ea8968a51120a 100644
--- a/packages/dataviews/src/field-types/datetime.tsx
+++ b/packages/dataviews/src/field-types/datetime.tsx
@@ -1,8 +1,21 @@
+/**
+ * External dependencies
+ */
+import type { ComponentType } from 'react';
+
/**
* WordPress dependencies
*/
-import { DateTimePicker } from '@wordpress/components';
+import {
+ Button,
+ DateTimePicker,
+ Dropdown,
+ __experimentalHStack as HStack,
+ __experimentalVStack as VStack,
+} from '@wordpress/components';
import { useCallback } from '@wordpress/element';
+import { closeSmall } from '@wordpress/icons';
+import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
@@ -28,12 +41,44 @@ function isValid( value: any, context?: ValidationContext ) {
return true;
}
+interface DateTimePickerControlProps {
+ title: string;
+ value: string;
+ onChange: ( newValue: string | null ) => void;
+ onClose: () => void;
+}
+
+const DateTimePickerForm: ComponentType< DateTimePickerControlProps > = ( {
+ title,
+ value,
+ onChange,
+ onClose,
+} ) => {
+ return (
+
+
+ { title }
+
+
+
+
+ );
+};
+
function Edit< Item >( {
data,
field,
onChange,
}: DataFormControlProps< Item > ) {
- const { id } = field;
+ const { id, label, description } = field;
const value = field.getValue( { item: data } ) ?? '';
const onChangeControl = useCallback(
( newValue: string | null ) =>
@@ -45,10 +90,27 @@ function Edit< Item >( {
);
return (
- (
+
+ ) }
+ renderContent={ ( { onClose } ) => (
+
+ ) }
/>
);
}
diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js
index 846d00d27723c..7aef18ccb2ec6 100644
--- a/packages/edit-site/src/components/post-edit/index.js
+++ b/packages/edit-site/src/components/post-edit/index.js
@@ -10,7 +10,11 @@ import { __ } from '@wordpress/i18n';
import { DataForm, isItemValid } from '@wordpress/dataviews';
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
import { store as coreDataStore } from '@wordpress/core-data';
-import { Button } from '@wordpress/components';
+import {
+ Button,
+ __experimentalVStack as VStack,
+ __experimentalHStack as HStack,
+} from '@wordpress/components';
import { useState, useMemo } from '@wordpress/element';
/**
@@ -72,20 +76,24 @@ function PostEditForm( { postType, postId } ) {
const isUpdateDisabled = ! isItemValid( itemWithEdits, fields, form );
return (
);
}