Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions src/steps/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,35 @@ const CustomStep = ({
}) => {
const { status, statusIconAriaLabel } = step;
const { header, details, icon } = renderStep(step);
const iconNode = icon ? icon : <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />;

if (orientation === 'horizontal') {
return (
<li className={styles.container}>
<div className={styles.header}>
{iconNode}
<hr className={styles.connector} role="none" />
</div>
<div className={styles['horizontal-header']}>{header}</div>
{details && <div className={styles.details}>{details}</div>}
</li>
);
}

// Vertical orientation: render the icon and the connector together in a column-1 "rail" so the
// connector starts directly beneath the icon and stretches the full height of the step. Unlike
// placing the header in the same row as the icon, this keeps the vertical line continuous even
// when the custom header wraps onto multiple lines.
return (
<li className={styles.container}>
<div className={styles.header}>
{icon ? icon : <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />}
{orientation === 'vertical' ? header : <hr className={styles.connector} role="none" />}
</div>
{orientation === 'vertical' ? (
<li className={clsx(styles.container, styles['custom-vertical'])}>
<div className={styles.rail}>
{iconNode}
<hr className={styles.connector} role="none" />
) : (
<div className={styles['horizontal-header']}>{header}</div>
)}
{details && <div className={styles.details}>{details}</div>}
</div>
<div className={styles.content}>
<div className={styles.header}>{header}</div>
{details && <div className={styles.details}>{details}</div>}
</div>
</li>
);
};
Expand Down
39 changes: 39 additions & 0 deletions src/steps/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,42 @@
}
}
}

// Vertical custom steps: a column-1 "rail" stacks the icon above a connector that grows to fill
// the full height of the step (header + details), keeping the vertical line continuous and
// connecting consecutive steps regardless of header height. Placed after `.horizontal` so
// selectors stay in ascending specificity order.
.root > .list > .container.custom-vertical {
// The rail stretches to the row height (default `align-items: stretch`), which is driven by the
// content column, so the connector always spans the full step.
> .rail {
grid-column: 1;
display: flex;
flex-direction: column;
align-items: center;

> .connector {
grid-row: auto;
grid-column: auto;
flex: 1 1 auto;
background-color: awsui.$color-border-divider-default;
border-block: 0;
border-inline: 0;
inline-size: awsui.$border-divider-list-width;
block-size: auto;
min-block-size: awsui.$space-static-xs;
inset-inline-end: 0;
margin-block: awsui.$space-static-xxs 0;
}
}

> .content {
grid-column: 2;
// Allow long header/details text to wrap instead of stretching the grid column.
min-inline-size: 0;
}
}

.root > .list > .container.custom-vertical:last-of-type > .rail > .connector {
display: none;
}
Loading