diff --git a/packages/edit-site/src/components/global-styles/confirm-reset-shadow-dialog.js b/packages/edit-site/src/components/global-styles/confirm-reset-shadow-dialog.js
new file mode 100644
index 00000000000000..b8f5b77010ff6d
--- /dev/null
+++ b/packages/edit-site/src/components/global-styles/confirm-reset-shadow-dialog.js
@@ -0,0 +1,37 @@
+/**
+ * WordPress dependencies
+ */
+import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
+import { __ } from '@wordpress/i18n';
+
+function ConfirmResetShadowDialog( {
+ text,
+ confirmButtonText,
+ isOpen,
+ toggleOpen,
+ onConfirm,
+} ) {
+ const handleConfirm = async () => {
+ toggleOpen();
+ onConfirm();
+ };
+
+ const handleCancel = () => {
+ toggleOpen();
+ };
+
+ return (
+
+ { text }
+
+ );
+}
+
+export default ConfirmResetShadowDialog;
diff --git a/packages/edit-site/src/components/global-styles/shadows-panel.js b/packages/edit-site/src/components/global-styles/shadows-panel.js
index 5df8208ebdb092..8e93ab2b15fb0a 100644
--- a/packages/edit-site/src/components/global-styles/shadows-panel.js
+++ b/packages/edit-site/src/components/global-styles/shadows-panel.js
@@ -8,10 +8,17 @@ import {
Button,
Flex,
FlexItem,
+ privateApis as componentsPrivateApis,
} from '@wordpress/components';
import { __, sprintf, isRTL } from '@wordpress/i18n';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
-import { plus, Icon, chevronLeft, chevronRight } from '@wordpress/icons';
+import {
+ plus,
+ Icon,
+ chevronLeft,
+ chevronRight,
+ moreVertical,
+} from '@wordpress/icons';
/**
* Internal dependencies
@@ -21,8 +28,11 @@ import Subtitle from './subtitle';
import { NavigationButtonAsItem } from './navigation-button';
import ScreenHeader from './header';
import { getNewIndexFromPresets } from './utils';
+import { useState } from '@wordpress/element';
+import ConfirmResetShadowDialog from './confirm-reset-shadow-dialog';
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
+const { Menu } = unlock( componentsPrivateApis );
export const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)';
@@ -40,8 +50,27 @@ export default function ShadowsPanel() {
setCustomShadows( [ ...( customShadows || [] ), shadow ] );
};
+ const handleResetShadows = () => {
+ setCustomShadows( [] );
+ };
+
+ const [ isResetDialogOpen, setIsResetDialogOpen ] = useState( false );
+
+ const toggleResetDialog = () => setIsResetDialogOpen( ! isResetDialogOpen );
+
return (
<>
+ { isResetDialogOpen && (
+
+ ) }
@@ -80,7 +110,14 @@ export default function ShadowsPanel() {
);
}
-function ShadowList( { label, shadows, category, canCreate, onCreate } ) {
+function ShadowList( {
+ label,
+ shadows,
+ category,
+ canCreate,
+ onCreate,
+ onReset,
+} ) {
const handleAddShadow = () => {
const newIndex = getNewIndexFromPresets( shadows, 'shadow-' );
onCreate( {
@@ -115,6 +152,26 @@ function ShadowList( { label, shadows, category, canCreate, onCreate } ) {
/>
) }
+ { !! shadows?.length && category === 'custom' && (
+
+ ) }
{ shadows.length > 0 && (
@@ -138,9 +195,7 @@ function ShadowItem( { shadow, category } ) {
>
{ shadow.name }
-
-
-
+
);