11import { Flex , useLocalizations } from '@/customizables' ;
2+ import { useUnsafeModalContext } from '@/elements/Modal' ;
23import { mqu } from '@/styledSystem' ;
34
45import { ProfileCardHeader } from './elements/ProfileCard' ;
@@ -12,6 +13,8 @@ type ConfigureSSOHeaderProps = {
1213export const ConfigureSSOHeader = ( { title } : ConfigureSSOHeaderProps ) : JSX . Element => {
1314 const { activeSteps, currentIndex, goToStep } = useWizard ( ) ;
1415 const { t } = useLocalizations ( ) ;
16+ const { toggle } = useUnsafeModalContext ( ) ;
17+ const isModal = Boolean ( toggle ) ;
1518
1619 // Breadcrumb membership = labelled steps. `select-provider` has no label, so
1720 // it is absent from the visual stepper while remaining a real navigable step.
@@ -22,7 +25,14 @@ export const ConfigureSSOHeader = ({ title }: ConfigureSSOHeaderProps): JSX.Elem
2225 < ProfileCardHeader >
2326 { title }
2427
25- < Flex sx = { title ? { marginInlineStart : 'auto' , [ mqu . md ] : { marginInlineStart : 0 } } : undefined } >
28+ < Flex
29+ sx = { t => ( {
30+ ...( title ? { marginInlineStart : 'auto' , [ mqu . md ] : { marginInlineStart : 0 } } : { } ) ,
31+ // Reserve room for the card's absolute close button (modal only) so the
32+ // stepper doesn't render under it. Steps wrap when space is tight.
33+ ...( isModal ? { marginInlineEnd : t . space . $10 } : { } ) ,
34+ } ) }
35+ >
2636 < Stepper >
2737 { visibleSteps . map ( ( step , index ) => {
2838 const isCurrent = index === currentVisibleIndex ;
0 commit comments