Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
d4d3e18
docs: add Stepper component design spec
bogiii May 25, 2026
70c3709
docs: add Stepper implementation plan
bogiii May 25, 2026
a74e54a
chore(ui): add @base-ui/react dependency for Stepper
bogiii May 25, 2026
0cf2e7b
feat(ui/stepper): add shared TypeScript types
bogiii May 25, 2026
fb6c7a4
feat(ui/stepper): add step registration hook
bogiii May 25, 2026
b2fe24a
feat(ui/stepper): add Stepper.Root
bogiii May 25, 2026
6f6659a
feat(ui/stepper): add Stepper.Step
bogiii May 25, 2026
562afee
test(ui/stepper): add Stepper.Step attribute and priority tests
bogiii May 25, 2026
3ce7454
refactor(ui/stepper): use updateStep for metadata sync in Stepper.Step
bogiii May 25, 2026
401a9a0
feat(ui/stepper): add Stepper.Indicator, Title, Description
bogiii May 25, 2026
606e8b5
refactor(ui/stepper): simplify Indicator and fix ReactNode import
bogiii May 25, 2026
a653763
feat(ui/stepper): add Stepper.Trigger
bogiii May 25, 2026
ddf7dfe
feat(ui/stepper): add Stepper.Panel
bogiii May 25, 2026
d7111c5
feat(ui/stepper): add Stepper.List — Tier 2 primitives complete
bogiii May 25, 2026
5900073
fix(ui/stepper): use aria-disabled on disabled triggers for accessibi…
bogiii May 25, 2026
a64d503
fix(ui/stepper): fix Trigger className asymmetry and clarify Panel ne…
bogiii May 25, 2026
fb0a6f5
feat(ui/stepper): add full CSS for Tier 2 primitives
bogiii May 25, 2026
404313e
feat(ui/stepper): add Tier 2 Storybook stories
bogiii May 25, 2026
eea0f91
feat(ui/stepper): add VerticalStepper (Tier 1)
bogiii May 25, 2026
cb314a0
feat(ui/stepper): add VerticalStepper stories
bogiii May 25, 2026
cd60b92
feat(ui/stepper): add HorizontalStepper (Tier 1)
bogiii May 25, 2026
ac3707b
feat(ui/stepper): add HorizontalStepper stories
bogiii May 25, 2026
9bb9cc3
fix(ui/stepper): add className prop to HorizontalStepper.Step
bogiii May 25, 2026
e7bb073
feat(ui/stepper): export Stepper, VerticalStepper, HorizontalStepper …
bogiii May 25, 2026
6842b8a
fix(ui/stepper): register step with neutral defaults to avoid stale i…
bogiii May 25, 2026
896d114
style(ui/stepper): fix Prettier formatting in SCSS files
bogiii May 26, 2026
3e62073
style: fix CI code style failures
bogiii May 26, 2026
d654fb7
packages/ui/stepper: apply code review fixes
bogiii May 27, 2026
6d24d73
packages/ui/stepper: resolve remaining review items
bogiii May 27, 2026
2c11519
packages/ui/stepper: fix test type error after XOR aria-label type ch…
bogiii May 27, 2026
bcc7969
packages/ui/stepper: enable Storybook controls and fix completion ind…
bogiii May 27, 2026
0725241
packages/ui/stepper: add Storybook docs explaining Tier 1 vs Tier 2
bogiii May 27, 2026
8089e36
packages/ui/stepper: add StepVariants story showing all step states
bogiii May 27, 2026
24f79dc
packages/ui/storybook: consolidate all stories under UI group
bogiii May 27, 2026
ec53cc8
packages/ui/storybook: group stepper stories under UI/Stepper
bogiii May 27, 2026
17a7e2f
packages/ui/storybook: order stepper group as Horizontal, Vertical, H…
bogiii May 27, 2026
54d6b66
packages/ui/storybook: add LandmarkThreshold story to VerticalStepper
bogiii May 27, 2026
b2451a3
packages/ui/storybook: add StepVariants story to HorizontalStepper
bogiii May 27, 2026
dd9b65a
packages/ui/storybook: add BackNavigation story to VerticalStepper
bogiii May 27, 2026
9f52dff
docs(storybook): rewrite Headless (Tier 2) stepper stories for clarity
bogiii May 27, 2026
d5836f8
docs(storybook): add explicit source code to Headless (Tier 2) stories
bogiii May 27, 2026
2dc0a88
docs(storybook): add explicit source code to Vertical and Horizontal …
bogiii May 27, 2026
94c58a5
docs(storybook): use dynamic source extraction instead of manual code…
bogiii May 27, 2026
1e65d25
refactor(stepper): use @wordpress/ui Icon in Stepper.Indicator
bogiii May 27, 2026
0b65212
refactor(stepper): use @wordpress/ui Stack for trigger label layout
bogiii May 27, 2026
51a845c
packages/ui: use Stack from @wordpress/ui in HorizontalStepper trigger
bogiii May 27, 2026
7a0207f
packages/ui: update yarn.lock after adding @wordpress/ui dependency
bogiii May 27, 2026
6d9ce5a
packages/ui: add indicatorVariant prop to Stepper ('bullet' | 'number')
bogiii May 27, 2026
46ea7fa
packages/ui: fix TypeScript 5.9 story type errors in stepper stories
bogiii May 27, 2026
67bce38
packages/ui: remove connector line between HorizontalStepper steps
bogiii May 27, 2026
fe0be68
packages/ui: redesign bullet indicator variant per design spec
bogiii May 27, 2026
ad3cda1
packages/ui: refine bullet current indicator and set 2px border globally
bogiii May 28, 2026
b55cf47
packages/ui: refine stepper indicator sizes, icons, and bullet varian…
bogiii May 28, 2026
1a2f369
packages/ui: increase horizontal stepper trigger padding and gap
bogiii May 28, 2026
6a08424
packages/ui: fix horizontal stepper icon and text vertical alignment
bogiii May 28, 2026
2beac01
packages/ui: add mobile icon-only layout with connector lines to hori…
bogiii May 28, 2026
416ffb4
packages/ui: prevent layout shift when bullet step transitions to cur…
bogiii May 28, 2026
3c8ca75
packages/ui: use container query for horizontal stepper mobile layout
bogiii May 28, 2026
ecf8aba
packages/ui: unify number and bullet variant indicator and title colors
bogiii May 28, 2026
ffa2b79
packages/ui: replace error icon with plain exclamation mark in steppe…
bogiii May 28, 2026
80850af
packages/ui: wire StepVariants story controls in horizontal stepper
bogiii May 28, 2026
e08be69
packages/ui: remove green/red color overrides from vertical stepper c…
bogiii May 28, 2026
d42d618
packages/ui: remove red color override from error step indicator
bogiii May 28, 2026
011f29b
packages/ui: center vertical stepper trigger content vertically
bogiii May 28, 2026
f8df32d
packages/ui: remove headingLevel from HorizontalStepper public API
bogiii May 28, 2026
a047816
packages/ui: remove bold style from selected step description
bogiii May 28, 2026
fc30734
packages/ui: rename headless stepper story to Primitives
bogiii May 28, 2026
9515aee
packages/ui: update cross-reference links to Primitives story
bogiii May 28, 2026
0db753d
packages/ui: improve Primitives stories with fixes and new example
bogiii May 28, 2026
0621ea2
packages/ui: fix stepper issues surfaced in code review
bogiii May 28, 2026
a14cd45
packages/ui: add missing stepper test coverage
bogiii May 28, 2026
4738e3c
packages/ui: address post-review fixes for Stepper
bogiii May 28, 2026
2c8fedf
packages/ui: fix vertical stepper panel close animation
bogiii May 28, 2026
044b0e3
packages/ui: fix stale JSDoc and add missing Panel warning test
bogiii May 28, 2026
93046c9
packages/ui: document useLayoutEffect/useEffect asymmetry and panel a…
bogiii May 28, 2026
91dc28c
packages/ui: improve stepper test quality — delete, rewrite, and fill…
bogiii May 28, 2026
da3dacf
packages/ui: fix TS2322 in HorizontalStepper caused by Omit on union …
bogiii May 29, 2026
fc22f06
packages/ui: fix icon usage in stepper indicator
bogiii May 29, 2026
8336284
chore: remove implementation plan and design spec from tracked files
bogiii May 29, 2026
8d143bf
packages/ui: replace custom visually-hidden CSS with VisuallyHidden c…
bogiii Jun 1, 2026
b43f0e6
packages/ui: use Text component for stepper title and description
bogiii Jun 1, 2026
b7dfcb9
packages/ui: use --wpds-border-width-xs token for horizontal stepper …
bogiii Jun 1, 2026
65669d9
packages/ui: replace grid-unit spacing with wpds dimension tokens
bogiii Jun 1, 2026
fbbad92
packages/ui: use wpds stroke token for horizontal stepper connector c…
bogiii Jun 1, 2026
453553f
packages/ui: replace font-size-small with wpds typography token in in…
bogiii Jun 1, 2026
5b15820
packages/ui: fix TypeScript error in stepper story metas
bogiii Jun 1, 2026
eba35db
packages/ui: code review safe-auto fixes
bogiii Jun 1, 2026
00ae56c
packages/ui: add dark-theme mixin to horizontal-stepper connector line
bogiii Jun 1, 2026
0135815
packages/ui: fix updateStep equality check to union keys from both ob…
bogiii Jun 1, 2026
3cfac88
packages/ui: allow error steps to be navigable in linear mode
bogiii Jun 2, 2026
5bdc4fa
packages/ui: add JSDoc notes to StepProps and formatStepLabel
bogiii Jun 2, 2026
d0c2d22
packages/ui: add missing stepper test coverage for linear mode, landm…
bogiii Jun 2, 2026
28ae9cf
packages/ui: apply review fixes — clean up exports, add coverage, fix…
bogiii Jun 2, 2026
25ef2ea
packages/ui: fix updateStep ReactNode equality bail-out — prevent spu…
bogiii Jun 2, 2026
7f8220c
packages/ui: fix accordion collapse flash, guard indicator label, wid…
bogiii Jun 2, 2026
994410a
packages/ui: test audit — delete framework testers, rewrite impl-coup…
bogiii Jun 2, 2026
7befa0b
packages/ui: revert @wordpress/ui pin widening — lockfile update out …
bogiii Jun 2, 2026
2c45b1d
packages/ui: fix Storybook 9 Docs page ordering and generation
bogiii Jun 4, 2026
39d547c
packages/ui: update stepper indicator and title colors on hover
bogiii Jun 4, 2026
4a1e94d
packages/ui: remove description prop from HorizontalStepper
bogiii Jun 4, 2026
71bb92b
packages/ui: top-align indicator with trigger label in both steppers
bogiii Jun 4, 2026
6dc41c8
packages/ui: hide vertical stepper connector line on desktop
bogiii Jun 4, 2026
8b2f730
packages/ui: use interactive color tokens for stepper trigger states
bogiii Jun 5, 2026
dec2953
packages/ui: use --wpds-typography-font-size-md token for trigger fon…
bogiii Jun 5, 2026
655c813
packages/ui: use --wpds-* tokens with theme fallbacks for stepper colors
bogiii Jun 5, 2026
3471923
packages/ui: use Button as render element for stepper triggers and fi…
bogiii Jun 8, 2026
5749c98
packages/ui: forward ref in StepperIndicator for composition consistency
bogiii Jun 8, 2026
e7c70ad
packages/ui: merge internal and external classNames in stepper compon…
bogiii Jun 8, 2026
7377c36
packages/ui: fix misleading warning message in StepperRoot
bogiii Jun 8, 2026
591a161
packages/ui: omit activationMode from VerticalStepper props
bogiii Jun 8, 2026
195373f
packages/ui: replace HorizontalStepper registration pattern with dire…
bogiii Jun 8, 2026
88d2068
packages/ui: remove manual fallbacks from --wpds-* CSS custom properties
bogiii Jun 8, 2026
4d8f144
packages/ui: replace display:none on stepper title with visually hidden
bogiii Jun 9, 2026
23d4ac5
packages/ui: replace 21px magic number in connector line with named v…
bogiii Jun 9, 2026
343cd29
packages/ui: derive horizontal stepper connector offset from shared v…
bogiii Jun 9, 2026
57e8930
packages/ui: derive vertical stepper connector offset from shared var…
bogiii Jun 9, 2026
f191689
packages/ui: consolidate stepper variables and fix vertical panel indent
bogiii Jun 9, 2026
3df6fed
packages/ui: define indicator size tokens once on StepperRoot
bogiii Jun 9, 2026
81bef3d
packages/ui: load wpds design tokens in Storybook
bogiii Jun 9, 2026
6253cde
packages/ui: use wpds motion tokens for vertical stepper panel transi…
bogiii Jun 9, 2026
d6a99b9
packages/ui: replace --stepper-trigger-height leftover with token calc
bogiii Jun 9, 2026
0b2ee6f
packages/ui: revert badge test changes — unrelated to stepper work
bogiii Jun 9, 2026
7da0d23
packages/ui: remove explicit stepper story sort order from preview.js
bogiii Jun 9, 2026
010c858
packages/ui: use sprintf/__() for i18n in defaultFormatStepLabel
bogiii Jun 9, 2026
33c0049
packages/ui: mark 'Optional' label for translation in VerticalStepper…
bogiii Jun 9, 2026
2316f37
packages/ui: rename forceMount to keepMounted and export StepperPanel…
bogiii Jun 9, 2026
8eee3eb
packages/ui: fix stale comment on halfCircleIcon in StepperIndicator
bogiii Jun 9, 2026
dcbeaba
packages/ui: centralize dev warnings behind a warning() helper
bogiii Jun 9, 2026
6895061
packages/ui: remove dark-mode overrides from stepper styles
bogiii Jun 9, 2026
1b18d11
packages/ui: add Stepper changelog entry
bogiii Jun 9, 2026
d9d0b92
packages/ui: bump version to 1.1.0
bogiii Jun 9, 2026
0f2fa5b
packages/ui: update yarn.lock after rebase onto trunk
bogiii Jun 9, 2026
0c187e0
packages/ui: keep number color unchanged on hover for current step in…
bogiii Jun 9, 2026
bd39be2
chore: dedupe yarn.lock after rebase onto trunk
bogiii Jun 9, 2026
8854d1d
packages/ui: apply code review safe-auto fixes for Stepper
bogiii Jun 10, 2026
d9acdce
packages/ui: remove redundant ref field from StepperBaseProps
bogiii Jun 10, 2026
fefada0
packages/ui: suppress accent border on hover for filled number indicator
bogiii Jun 10, 2026
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
14 changes: 9 additions & 5 deletions packages/ui/.storybook/preview.js
Comment thread
bogiii marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ const parameters = {
return aIndex - bIndex;
}

// If they're in the same section, put MDX files first
const aIsMdx = a.importPath.endsWith( '.mdx' );
const bIsMdx = b.importPath.endsWith( '.mdx' );
// If they're in the same section, put docs entries first (MDX files or
// autodocs-generated pages). Storybook 9 no longer auto-pins Docs to the
// top of each component group, so we need to handle it here.
// Autodocs entries have type === 'docs' but importPath ending in .stories.*
const aIsDocs = a.type === 'docs' || a.importPath.endsWith( '.mdx' );
const bIsDocs = b.type === 'docs' || b.importPath.endsWith( '.mdx' );

if ( aIsMdx && ! bIsMdx ) return -1;
if ( ! aIsMdx && bIsMdx ) return 1;
if ( aIsDocs && ! bIsDocs ) return -1;
if ( ! aIsDocs && bIsDocs ) return 1;

// If both are MDX or both are not MDX, maintain original order
return 0;
Expand All @@ -38,4 +41,5 @@ const parameters = {

export default {
parameters,
tags: [ 'autodocs' ],
};
1 change: 1 addition & 0 deletions packages/ui/.storybook/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "@wordpress/base-styles/variables";
@import "@wordpress/theme/design-tokens.css";

body {
font-family: variables.$font-family-body;
Expand Down
6 changes: 6 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Unreleased

## 1.1.0
Comment thread
bogiii marked this conversation as resolved.

### Enhancements

- `Stepper`, `VerticalStepper`, `HorizontalStepper`: Add Stepper component suite with vertical and horizontal orientations, step indicators, linear flow support, and accessible ARIA semantics ([#111036](https://github.com/Automattic/wp-calypso/pull/111036)).

## 1.0.2

### Enhancements
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/ui",
"version": "1.0.2",
"version": "1.1.0",
"description": "Automattic Design System UI components.",
"homepage": "https://github.com/Automattic/wp-calypso",
"license": "GPL-2.0-or-later",
Expand Down Expand Up @@ -40,12 +40,14 @@
],
"types": "dist",
"dependencies": {
"@base-ui/react": "^1.5.0",
"@wordpress/base-styles": "9.1.0",
"@wordpress/compose": "patch:@wordpress/compose@npm%3A8.1.0#~/.yarn/patches/@wordpress-compose-npm-8.1.0-ea108e3129.patch",
"@wordpress/element": "^8.0.0",
"@wordpress/i18n": "^6.21.0",
"@wordpress/icons": "^13.3.0",
"@wordpress/primitives": "^4.48.0",
"@wordpress/ui": "0.13.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"react-day-picker": "^9.7.0"
Expand Down
11 changes: 11 additions & 0 deletions packages/ui/src/horizontal-stepper/horizontal-stepper-step.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// packages/ui/src/horizontal-stepper/horizontal-stepper-step.tsx
import type { StepProps } from '../stepper/types';

export type HorizontalStepperStepProps = Omit< StepProps, 'description' >;

/**
* Step descriptor for HorizontalStepper.
* Renders nothing — HorizontalStepper reads props from this element directly
* at render time to build the tab list and panels.
*/
export const HorizontalStepperStep: ( props: HorizontalStepperStepProps ) => null = () => null;
83 changes: 83 additions & 0 deletions packages/ui/src/horizontal-stepper/horizontal-stepper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// packages/ui/src/horizontal-stepper/horizontal-stepper.tsx
import { Children, forwardRef, isValidElement } from '@wordpress/element';
import clsx from 'clsx';
import { Stepper } from '../stepper';
import { HorizontalStepperStep, type HorizontalStepperStepProps } from './horizontal-stepper-step';
import styles from './style.module.scss';
import type { AriaLabelXOR, StepperBaseProps, StepperRef } from '../stepper/types';
import type { ReactNode, Ref } from 'react';

// Omit is applied to StepperBaseProps (a plain object type) before intersecting
// with AriaLabelXOR so that the XOR union constraint is preserved. Applying
// Omit directly to StepperProps (which is StepperBaseProps & AriaLabelXOR)
// flattens the union and widens aria-label/aria-labelledby to string|undefined,
// breaking TypeScript's ability to verify the constraint downstream.
type HorizontalStepperProps = Omit< StepperBaseProps, 'headingLevel' > & AriaLabelXOR;

/**
* Extracts step descriptors from children at render time.
* Only direct HorizontalStepperStep children are collected — deeply nested
* or wrapped steps are not supported (use Stepper primitives for those).
*/
function getStepperSteps( children: ReactNode ): HorizontalStepperStepProps[] {
const steps: HorizontalStepperStepProps[] = [];
Children.forEach( children, ( child ) => {
if ( isValidElement( child ) && child.type === HorizontalStepperStep ) {
steps.push( child.props as HorizontalStepperStepProps );
}
} );
return steps;
}

function HorizontalStepperInner(
{ children, className, ...props }: HorizontalStepperProps,
ref: Ref< StepperRef >
) {
const steps = getStepperSteps( children );

return (
<Stepper.Root
orientation="horizontal"
ref={ ref }
className={ clsx( styles[ 'root' ], className ) }
{ ...props }
>
<Stepper.List className={ styles[ 'list' ] }>
{ steps.map( ( step ) => (
<Stepper.Step
key={ step.value }
value={ step.value }
status={ step.status }
optional={ step.optional }
disabled={ step.disabled }
className={ clsx( styles[ 'step' ], step.className ) }
>
<Stepper.Trigger className={ styles[ 'trigger' ] }>
<Stepper.Indicator>{ step.indicator }</Stepper.Indicator>
<Stepper.Title className={ styles[ 'text-block' ] }>{ step.title }</Stepper.Title>
</Stepper.Trigger>
</Stepper.Step>
) ) }
</Stepper.List>

{ steps.map( ( step ) => (
<Stepper.Panel
key={ step.value }
value={ step.value }
keepMounted={ step.keepMounted }
className={ styles[ 'panel' ] }
>
{ step.children }
</Stepper.Panel>
) ) }
</Stepper.Root>
);
}

const HorizontalStepperBase = forwardRef< StepperRef, HorizontalStepperProps >(
HorizontalStepperInner
);

export const HorizontalStepper = Object.assign( HorizontalStepperBase, {
Step: HorizontalStepperStep,
} );
2 changes: 2 additions & 0 deletions packages/ui/src/horizontal-stepper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// packages/ui/src/horizontal-stepper/index.ts
export { HorizontalStepper } from './horizontal-stepper';
Loading
Loading