Skip to content

Commit 751366b

Browse files
Add progress stepper tour step, updates per review meeting
1 parent bd7eb72 commit 751366b

3 files changed

Lines changed: 70 additions & 33 deletions

File tree

packages/react-core/src/demos/Animations/AnimationsStartTourModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export const AnimationsStartTourModal: FunctionComponent<Props> = ({ onClose })
1313
aria-labelledby="guided-tour-title"
1414
aria-describedby="guided-tour-description"
1515
>
16-
<ModalHeader title="Explore PatternFly’s new animations" labelId="guided-tour-title" />
16+
<ModalHeader
17+
title={<div style={{ whiteSpace: 'initial' }}>Explore PatternFly’s new animations</div>}
18+
labelId="guided-tour-title"
19+
/>
1720
<ModalBody id="guided-tour-description">
1821
<Content component="p">
1922
Welcome! Many of our components now use motion to engage users, provide clear feedback, and improve usability.

packages/react-core/src/demos/Animations/Spotlight.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ const Spotlight: React.FC<SpotlightProps> = ({ selector, resizeSelector }) => {
9191
borderWidth: 3,
9292
borderStyle: 'solid',
9393
borderColor: 'var(--pf-t--global--background--color--highlight--default)',
94+
borderRadius: 'var(--pf-t--global--border--radius--small)',
9495
background: 'transparent',
9596
pointerEvents: 'none'
9697
}
9798
: {};
9899

99-
return clientRect ? <div className="ocs-spotlight ocs-spotlight__element-highlight-noanimate" style={style} /> : null;
100+
return clientRect ? <div style={style} /> : null;
100101
};
101102

102103
export default Spotlight;

packages/react-core/src/demos/Animations/examples/Animations.tsx

Lines changed: 64 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,24 @@ export const GuidedTourSteps: GuidedTourStep[] = [
196196
<Content component="p">Reduced-motion users will only see the fade, not the jiggle.</Content>
197197
</>
198198
),
199+
popoverWidth: '550px',
200+
mobilePopoverWidth: '275px',
199201
spotlightSelector: '#create-database-submit',
200202
spotlightResizeSelector: '#create-database-form'
201-
// },
202-
// {
203-
// stepId: 'progressStepper',
204-
// header: <div>In process indicator</div>,
205-
// content: (
206-
// <>
207-
// <Content component="p">
208-
// Watch as a process starts for step 2.
209-
// </Content>
210-
// <Content component="p">
211-
// When a task is running, the in-process icon now spins in place, providing clear and continuous feedback that the system is working.
212-
// </Content>
213-
// </>
214-
// )
203+
},
204+
{
205+
stepId: 'progressStepper',
206+
header: <div>In process indicator</div>,
207+
content: (
208+
<>
209+
<Content component="p">Watch as a process starts for step 2.</Content>
210+
<Content component="p">
211+
When a task is running, the in-process icon now spins in place, providing clear and continuous feedback that
212+
the system is working.
213+
</Content>
214+
</>
215+
),
216+
spotlightSelector: '#progress-stepper-1'
215217
}
216218
];
217219

@@ -370,16 +372,34 @@ const AnimationsPage: FunctionComponent = () => {
370372
</Button>
371373
</Td>
372374
<Td>
373-
<ProgressStepper isCompact>
374-
{activity.progress.map((stepVariant, stepIndex) => (
375-
<ProgressStep
376-
key={stepIndex}
377-
variant={stepVariant}
378-
icon={iconMap[stepVariant]}
379-
aria-label={`Step ${stepIndex + 1} is ${stepVariant}`}
380-
/>
381-
))}
382-
</ProgressStepper>
375+
{rowIndex === 1 ? (
376+
renderTourStepElement(
377+
'progressStepper',
378+
<ProgressStepper isCompact id={`progress-stepper-${rowIndex}`}>
379+
{activity.progress.map((stepVariant, stepIndex) => (
380+
<ProgressStep
381+
id={`${rowIndex}-${stepVariant}-${stepIndex}`}
382+
key={stepIndex}
383+
variant={stepVariant}
384+
icon={iconMap[stepVariant]}
385+
aria-label={`Step ${stepIndex + 1} is ${stepVariant}`}
386+
/>
387+
))}
388+
</ProgressStepper>
389+
)
390+
) : (
391+
<ProgressStepper isCompact>
392+
{activity.progress.map((stepVariant, stepIndex) => (
393+
<ProgressStep
394+
id={`progress-step-${rowIndex}-${stepVariant}-${stepIndex}`}
395+
key={stepIndex}
396+
variant={stepVariant}
397+
icon={iconMap[stepVariant]}
398+
aria-label={`Step ${stepIndex + 1} is ${stepVariant}`}
399+
/>
400+
))}
401+
</ProgressStepper>
402+
)}
383403
</Td>
384404
<Td isActionCell>
385405
<Dropdown
@@ -423,15 +443,15 @@ const AnimationsPage: FunctionComponent = () => {
423443
<Content component="p">
424444
Click <strong>Add alert</strong>. In a moment, a new toast alert will appear.
425445
</Content>
426-
<Content component="p">
427-
Notice how it slides smoothly into view to draw your eye to critical information, and then slides out just
428-
as smoothly once it expires.
429-
</Content>
430446
<Content component="p">
431447
<Button variant="link" isInline onClick={() => addNotification(true)}>
432448
Add alert
433449
</Button>
434450
</Content>
451+
<Content component="p">
452+
Notice how it slides smoothly into view to draw your eye to critical information, and then slides out just
453+
as smoothly once it expires.
454+
</Content>
435455
</>
436456
);
437457
}
@@ -456,14 +476,14 @@ const AnimationsPage: FunctionComponent = () => {
456476
<Content component="p">
457477
Click <strong>Add notification</strong>. Watch for a new notification to arrive.
458478
</Content>
459-
<Content component="p">
460-
The bell icon "rings" with a subtle rotation to quickly catch your attention as a message comes in.
461-
</Content>
462479
<Content component="p">
463480
<Button variant="link" isInline onClick={() => addNotification(false)}>
464481
Add notification
465482
</Button>
466483
</Content>
484+
<Content component="p">
485+
The bell icon "rings" with a subtle rotation to quickly catch your attention as a message comes in.
486+
</Content>
467487
</>
468488
);
469489
}
@@ -474,6 +494,19 @@ const AnimationsPage: FunctionComponent = () => {
474494
setSelectedTab(2);
475495
setShowForm(true);
476496
}
497+
if (tourStep?.stepId === 'progressStepper') {
498+
setSelectedTab(0);
499+
setTimeout(() => {
500+
const element = document.getElementById('progress-stepper-1');
501+
if (element) {
502+
element.scrollIntoView({
503+
behavior: 'smooth', // Smooth scrolling animation
504+
block: 'center', // Align element to the center of the viewport
505+
inline: 'nearest' // Horizontal alignment (optional)
506+
});
507+
}
508+
}, 100);
509+
}
477510
}, [tourStep?.stepId, setCustomStepContent, addNotification, isMobile]);
478511

479512
useEffect(() => {

0 commit comments

Comments
 (0)