diff --git a/src/css/common/_demo.scss b/src/css/common/_demo.scss index b5ce9765e..1bbc005fc 100644 --- a/src/css/common/_demo.scss +++ b/src/css/common/_demo.scss @@ -77,6 +77,18 @@ } } +.wp-core-ui .button.demo-callout__close { + position: absolute; + inset-block-start: 8px; + inset-inline-end: 8px; + color: var(--cs-color-text-secondary); + text-decoration: none; + + &:hover:not(:disabled) { + color: var(--cs-color-text); + } +} + .demo-callout__step { display: block; margin-block-end: 6px; diff --git a/src/js/components/ManageMenu/AiAgentDemo/AiAgentDemo.tsx b/src/js/components/ManageMenu/AiAgentDemo/AiAgentDemo.tsx index c36bd7794..5dd9ade30 100644 --- a/src/js/components/ManageMenu/AiAgentDemo/AiAgentDemo.tsx +++ b/src/js/components/ManageMenu/AiAgentDemo/AiAgentDemo.tsx @@ -100,7 +100,7 @@ const AiAgentDemoPage: React.FC = () => {
{STAGE_ANNOUNCEMENTS[stage]}
- + diff --git a/src/js/components/ManageMenu/BlueprintsDemo/BlueprintsDemo.tsx b/src/js/components/ManageMenu/BlueprintsDemo/BlueprintsDemo.tsx index f485024a7..4f2eed02b 100644 --- a/src/js/components/ManageMenu/BlueprintsDemo/BlueprintsDemo.tsx +++ b/src/js/components/ManageMenu/BlueprintsDemo/BlueprintsDemo.tsx @@ -102,7 +102,7 @@ const BlueprintsDemoPage: React.FC = () => {
{STAGE_ANNOUNCEMENTS[stage]}
- + diff --git a/src/js/components/ManageMenu/CloudLibraryDemo/CloudLibraryDemo.tsx b/src/js/components/ManageMenu/CloudLibraryDemo/CloudLibraryDemo.tsx index 128efe128..8d574781c 100644 --- a/src/js/components/ManageMenu/CloudLibraryDemo/CloudLibraryDemo.tsx +++ b/src/js/components/ManageMenu/CloudLibraryDemo/CloudLibraryDemo.tsx @@ -76,7 +76,7 @@ export const CloudLibraryDemo: React.FC = () => {
{STAGE_ANNOUNCEMENTS[stage]}
- + diff --git a/src/js/components/common/demo/DemoCallout.tsx b/src/js/components/common/demo/DemoCallout.tsx index 4df0a8c14..69f2746ac 100644 --- a/src/js/components/common/demo/DemoCallout.tsx +++ b/src/js/components/common/demo/DemoCallout.tsx @@ -1,4 +1,6 @@ import React from 'react' +import { __ } from '@wordpress/i18n' +import { Button } from '../Button' export interface CalloutContent { step: string @@ -10,17 +12,24 @@ export interface CalloutContent { * Commentary on what a walkthrough is doing at the current stage, floating in * the corner of the viewport so it stays out of the page's flow. * - * The demo pages announce each stage through their own live region, so this is - * hidden from assistive technology rather than repeating it. + * The demo pages announce each stage through their own live region, so the + * commentary is hidden from assistive technology rather than repeating it. The + * close button stays exposed, since it is the walkthrough's exit. */ -export const DemoCallout: React.FC<{ callout?: CalloutContent }> = ({ callout }) => +export const DemoCallout: React.FC<{ callout?: CalloutContent, onClose: VoidFunction }> = ({ callout, onClose }) => callout // Keyed on the content rather than the stage: consecutive stages can // share a callout, and remounting between them replays the entrance // animation as a flicker. - ?