An open source design system that's fully customizable and agent ready
TypeScript
fix(stepper): non-visual hygiene — sync theme targets, localize Optional, tokenize bar width (#4872)
Ernest89db883a63db
diff --git a/.changeset/stepper-nonvisual-hygiene.md b/.changeset/stepper-nonvisual-hygiene.mdnew file mode 100644index 0000000000..3afe79d61e--- /dev/null+++ b/.changeset/stepper-nonvisual-hygiene.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[fix] Stepper: localize the "Optional" step affordance via the new `@astryx.step.optional` message key so it translates like the rest of the component. No visual change in English.++@ernesttdiff --git a/packages/core/locales/en.json b/packages/core/locales/en.jsonindex ab83efdfd3..ac23e64b41 100644--- a/packages/core/locales/en.json+++ b/packages/core/locales/en.json@@ -923,6 +923,10 @@"defaultMessage": "Go to step {stepNumber, number}: {label}, {status}","description": "Accessible name for a clickable lab Stepper step that also carries a status. {status} is one of the translated `step.status.*` words (completed/warning/error). Keep the pattern parallel to `step.goToStep`."},+ "@astryx.step.optional": {+ "defaultMessage": "Optional",+ "description": "Visible indicator appended after a lab Stepper step's label when the step is optional (isOptional). Very short; appears inline after the label text."+ },"@astryx.step.status.completed": {"defaultMessage": "completed","description": "Screen-reader-only status word rendered next to a lab Stepper step label when the step is done (either progress-completed or status=success). Lowercase adjective; it is read mid-sentence after the step label."diff --git a/packages/lab/src/Stepper/Step.tsx b/packages/lab/src/Stepper/Step.tsxindex 0c35e0a49b..dfe16d9733 100644--- a/packages/lab/src/Stepper/Step.tsx+++ b/packages/lab/src/Stepper/Step.tsx@@ -162,7 +162,7 @@ function CurrentIcon() {// --- Styles ----const BAR_WIDTH = '4px';+const BAR_WIDTH = spacingVars['--spacing-1'];const ICON_SIZE = spacingVars['--spacing-4'];const NUMBER_SIZE = spacingVars['--spacing-5'];@@ -869,7 +869,9 @@ export function Step({{isOptional && (<><span {...stylex.props(styles.optionalDot)}>•</span>- <span {...stylex.props(styles.optionalText)}>Optional</span>+ <span {...stylex.props(styles.optionalText)}>+ {t('@astryx.step.optional')}+ </span></>)}{endContent}@@ -943,7 +945,9 @@ export function Step({{isOptional && (<><span {...stylex.props(styles.optionalDot)}>•</span>- <span {...stylex.props(styles.optionalText)}>Optional</span>+ <span {...stylex.props(styles.optionalText)}>+ {t('@astryx.step.optional')}+ </span></>)}{endContent}diff --git a/packages/lab/src/Stepper/Stepper.doc.mjs b/packages/lab/src/Stepper/Stepper.doc.mjsindex aa81f7bba7..f0df3038c2 100644--- a/packages/lab/src/Stepper/Stepper.doc.mjs+++ b/packages/lab/src/Stepper/Stepper.doc.mjs@@ -28,9 +28,10 @@ export const docs = {},theming: {targets: [- {className: 'astryx-stepper', visualProps: ['orientation']},+ {className: 'astryx-stepper', visualProps: ['orientation', 'indicatorPosition']},{className: 'astryx-step', visualProps: ['progress', 'status']},{className: 'astryx-step-bar'},+ {className: 'astryx-step-connector'},],},components: [@@ -125,7 +126,7 @@ export const docs = {{name: 'status',type: "'accent' | 'success' | 'warning' | 'error'",- description: 'Semantic color for the step. Controls color only and maps to the global XDS semantic tokens. Leave unset for the progress-derived default coloring.',+ description: 'Semantic color for the step. Controls color only and maps to the global Astryx semantic tokens. Leave unset for the progress-derived default coloring.',},{name: 'indicator',@@ -230,9 +231,10 @@ export const docsZh = {},theming: {targets: [- {className: 'astryx-stepper', visualProps: ['orientation']},+ {className: 'astryx-stepper', visualProps: ['orientation', 'indicatorPosition']},{className: 'astryx-step', visualProps: ['progress', 'status']},{className: 'astryx-step-bar'},+ {className: 'astryx-step-connector'},],},components: [