@12-apps/ui 6.39.4 → 6.39.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/index.js +4 -4
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.helpers.js +3 -1
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.js +4 -4
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.parts.js +2 -2
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStepRow.js +3 -3
- package/dist/_internal/components/utility/index.js +4 -4
- package/dist/{chunk-WDVNRW3Q.js → chunk-7OO3BELX.js} +2 -2
- package/dist/{chunk-GFQ4U6WZ.js → chunk-KJID4PRD.js} +3 -3
- package/dist/chunk-KJID4PRD.js.map +1 -0
- package/dist/{chunk-VXQOSADY.js → chunk-RXNIOPOA.js} +8 -2
- package/dist/{chunk-VXQOSADY.js.map → chunk-RXNIOPOA.js.map} +1 -1
- package/dist/{chunk-VLOUXTEM.js → chunk-Y2C2S4R7.js} +5 -4
- package/dist/chunk-Y2C2S4R7.js.map +1 -0
- package/dist/types/components/utility/WorkflowStep/WorkflowStep.helpers.d.ts +7 -0
- package/dist/types/components/utility/WorkflowStep/WorkflowStep.helpers.d.ts.map +1 -1
- package/dist/utility/WorkflowStep.js +4 -4
- package/package.json +1 -1
- package/src/components/utility/WorkflowStep/WorkflowStep.helpers.ts +15 -0
- package/src/components/utility/WorkflowStep/WorkflowStep.parts.tsx +1 -1
- package/src/components/utility/WorkflowStep/WorkflowStep.tsx +2 -2
- package/dist/chunk-GFQ4U6WZ.js.map +0 -1
- package/dist/chunk-VLOUXTEM.js.map +0 -1
- /package/dist/{chunk-WDVNRW3Q.js.map → chunk-7OO3BELX.js.map} +0 -0
|
@@ -13,10 +13,10 @@ import "../../chunk-SS4MHTGU.js";
|
|
|
13
13
|
import "../../chunk-IO36MEBD.js";
|
|
14
14
|
import {
|
|
15
15
|
WorkflowStep
|
|
16
|
-
} from "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
16
|
+
} from "../../chunk-Y2C2S4R7.js";
|
|
17
|
+
import "../../chunk-7OO3BELX.js";
|
|
18
|
+
import "../../chunk-KJID4PRD.js";
|
|
19
|
+
import "../../chunk-RXNIOPOA.js";
|
|
20
20
|
import "../../chunk-H2PTB6FD.js";
|
|
21
21
|
import {
|
|
22
22
|
AnimatedIcon
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
indicatorSizeFor,
|
|
3
|
+
progressValueText,
|
|
3
4
|
resolveWorkflowStepProps,
|
|
4
5
|
stepColors,
|
|
5
6
|
stepPalette,
|
|
6
7
|
withDerivedStatus
|
|
7
|
-
} from "../../../../chunk-
|
|
8
|
+
} from "../../../../chunk-RXNIOPOA.js";
|
|
8
9
|
import "../../../../chunk-TCAQOUIB.js";
|
|
9
10
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
10
11
|
import "../../../../chunk-PT6TCWIW.js";
|
|
@@ -25,6 +26,7 @@ import "../../../../chunk-YKCAJ2TN.js";
|
|
|
25
26
|
import "../../../../chunk-PZ5AY32C.js";
|
|
26
27
|
export {
|
|
27
28
|
indicatorSizeFor,
|
|
29
|
+
progressValueText,
|
|
28
30
|
resolveWorkflowStepProps,
|
|
29
31
|
stepColors,
|
|
30
32
|
stepPalette,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowStep,
|
|
3
3
|
WorkflowStep_default
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
6
|
-
import "../../../../chunk-
|
|
7
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-Y2C2S4R7.js";
|
|
5
|
+
import "../../../../chunk-7OO3BELX.js";
|
|
6
|
+
import "../../../../chunk-KJID4PRD.js";
|
|
7
|
+
import "../../../../chunk-RXNIOPOA.js";
|
|
8
8
|
import "../../../../chunk-TCAQOUIB.js";
|
|
9
9
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
10
10
|
import "../../../../chunk-PT6TCWIW.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
StepContentComponent,
|
|
4
4
|
StepIndicatorComponent,
|
|
5
5
|
StepItemRow
|
|
6
|
-
} from "../../../../chunk-
|
|
7
|
-
import "../../../../chunk-
|
|
6
|
+
} from "../../../../chunk-KJID4PRD.js";
|
|
7
|
+
import "../../../../chunk-RXNIOPOA.js";
|
|
8
8
|
import "../../../../chunk-TCAQOUIB.js";
|
|
9
9
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
10
10
|
import "../../../../chunk-PT6TCWIW.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StepRow
|
|
3
|
-
} from "../../../../chunk-
|
|
4
|
-
import "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
3
|
+
} from "../../../../chunk-7OO3BELX.js";
|
|
4
|
+
import "../../../../chunk-KJID4PRD.js";
|
|
5
|
+
import "../../../../chunk-RXNIOPOA.js";
|
|
6
6
|
import "../../../../chunk-TCAQOUIB.js";
|
|
7
7
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
8
8
|
import "../../../../chunk-PT6TCWIW.js";
|
|
@@ -2,10 +2,10 @@ import "../../../chunk-SS4MHTGU.js";
|
|
|
2
2
|
import "../../../chunk-IO36MEBD.js";
|
|
3
3
|
import {
|
|
4
4
|
WorkflowStep
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
8
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-Y2C2S4R7.js";
|
|
6
|
+
import "../../../chunk-7OO3BELX.js";
|
|
7
|
+
import "../../../chunk-KJID4PRD.js";
|
|
8
|
+
import "../../../chunk-RXNIOPOA.js";
|
|
9
9
|
import "../../../chunk-H2PTB6FD.js";
|
|
10
10
|
import {
|
|
11
11
|
AnimatedIcon
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
StepContentComponent,
|
|
4
4
|
StepIndicatorComponent,
|
|
5
5
|
StepItemRow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KJID4PRD.js";
|
|
7
7
|
|
|
8
8
|
// src/components/utility/WorkflowStep/WorkflowStepRow.tsx
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -78,4 +78,4 @@ var StepRow = ({
|
|
|
78
78
|
export {
|
|
79
79
|
StepRow
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-7OO3BELX.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
indicatorSizeFor,
|
|
3
3
|
stepColors,
|
|
4
4
|
stepPalette
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RXNIOPOA.js";
|
|
6
6
|
import {
|
|
7
7
|
neutralTones
|
|
8
8
|
} from "./chunk-FQ6UW7IY.js";
|
|
@@ -46,7 +46,7 @@ var StepItem = styled(Box, {
|
|
|
46
46
|
// Allow content to shrink
|
|
47
47
|
}));
|
|
48
48
|
var StepIndicator = styled(Box, {
|
|
49
|
-
shouldForwardProp: (prop) => !["size", "variant", "color", "isActive", "isCompleted", "isError", "interactive", "disabled"].includes(prop)
|
|
49
|
+
shouldForwardProp: (prop) => !["size", "variant", "color", "isActive", "isCompleted", "isError", "interactive", "animated", "disabled"].includes(prop)
|
|
50
50
|
})(({ theme, size, variant, color, isActive, isCompleted, isError, interactive, animated, disabled }) => {
|
|
51
51
|
const indicatorSize = indicatorSizeFor(size);
|
|
52
52
|
const palette = stepPalette(theme, color);
|
|
@@ -294,4 +294,4 @@ export {
|
|
|
294
294
|
StepContentComponent,
|
|
295
295
|
StepItemRow
|
|
296
296
|
};
|
|
297
|
-
//# sourceMappingURL=chunk-
|
|
297
|
+
//# sourceMappingURL=chunk-KJID4PRD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.parts.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport type { CSSObject, Theme } from '@mui/material/styles/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback } from 'react';\n\nimport type { StepColors } from './WorkflowStep.helpers';\nimport { indicatorSizeFor, stepColors, stepPalette } from './WorkflowStep.helpers';\nimport type {\n StepConnectorProps,\n StepContentProps,\n StepIndicatorProps,\n WorkflowStepProps,\n} from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { rem } from '../../../tokens/relative';\n\n// `outlined` shows the surface through a coloured rim; the other three fill it and\n// differ only in what border they keep.\nconst indicatorVariantStyles = (\n theme: Theme,\n variant: WorkflowStepProps['variant'],\n { backgroundColor, borderColor, textColor }: StepColors,\n): CSSObject => {\n if (variant === 'outlined') {\n return {\n border: `${rem(theme, 2)} solid ${borderColor}`,\n backgroundColor: theme.palette.background.paper,\n };\n }\n\n const filled = { backgroundColor, color: textColor };\n\n switch (variant) {\n case 'filled':\n return filled;\n case 'minimal':\n return { ...filled, border: 'none' };\n case 'default':\n return { ...filled, border: `1px solid ${borderColor}` };\n default:\n return {};\n }\n};\n\nconst StepItem = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isLast'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n}>(({ orientation, isLast }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n flex: orientation === 'horizontal' && !isLast ? 1 : 'none',\n position: 'relative',\n minWidth: 0, // Allow content to shrink\n}));\n\nconst StepIndicator = styled(Box, {\n shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'animated', 'disabled'].includes(prop as string),\n})<{\n size: WorkflowStepProps['size'];\n variant: WorkflowStepProps['variant'];\n color: WorkflowStepProps['color'];\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n interactive: boolean;\n animated: boolean;\n disabled: boolean;\n}>(({ theme, size, variant, color, isActive, isCompleted, isError, interactive, animated, disabled }) => {\n const indicatorSize = indicatorSizeFor(size);\n const palette = stepPalette(theme, color);\n const { backgroundColor, borderColor, textColor } = stepColors(theme, palette, {\n isActive,\n isCompleted,\n isError,\n variant,\n });\n\n return {\n width: rem(theme, indicatorSize),\n height: rem(theme, indicatorSize),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: rem(theme, 12),\n fontWeight: theme.typography.fontWeightMedium,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n transition: animated\n ? theme.transitions.create(['background-color', 'border-color', 'transform'], {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n flexShrink: 0,\n\n ...indicatorVariantStyles(theme, variant, { backgroundColor, borderColor, textColor }),\n\n // Interactive states\n ...(interactive && !disabled && {\n '&:hover': {\n transform: 'scale(1.1)',\n boxShadow: theme.shadows[2],\n },\n '&:focus-visible': {\n outline: `${rem(theme, 2)} solid ${palette.main}`,\n outlineOffset: rem(theme, 2),\n },\n }),\n\n // Disabled state\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n }),\n };\n});\n\nconst StepContent = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'interactive', 'disabled'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n interactive: boolean;\n disabled: boolean;\n}>(({ theme, orientation, interactive, disabled }) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n textAlign: orientation === 'vertical' ? 'left' : 'center',\n marginTop: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n marginLeft: orientation === 'horizontal' ? theme.spacing(1) : 0,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n minWidth: 0,\n flex: 1,\n\n '& .step-title': {\n fontSize: rem(theme, 14),\n fontWeight: theme.typography.fontWeightMedium,\n color: theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n '& .step-description': {\n fontSize: rem(theme, 12),\n color: theme.palette.text.secondary,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n ...(disabled && {\n opacity: 0.5,\n }),\n}));\n\nconst StepConnector = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isCompleted', 'color', 'variant'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isCompleted: boolean;\n color: WorkflowStepProps['color'];\n variant: WorkflowStepProps['variant'];\n}>(({ theme, orientation, isCompleted, color, variant }) => {\n const connectorColor = isCompleted ? stepPalette(theme, color).main : neutralTones(theme).track;\n\n return {\n flex: 1,\n position: 'relative',\n \n ...(orientation === 'horizontal' && {\n height: rem(theme, 2),\n backgroundColor: connectorColor,\n margin: `0 ${theme.spacing(1)}`,\n minWidth: theme.spacing(2),\n }),\n \n ...(orientation === 'vertical' && {\n width: rem(theme, 2),\n backgroundColor: connectorColor,\n minHeight: theme.spacing(3),\n marginLeft: theme.spacing(2),\n position: 'absolute',\n left: '50%',\n transform: 'translateX(-50%)',\n top: '100%',\n }),\n\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.short,\n }),\n\n ...(variant === 'minimal' && {\n opacity: 0.6,\n }),\n };\n});\n\n/**\n * Individual step indicator component\n */\nconst StepIndicatorComponent = forwardRef<HTMLDivElement, StepIndicatorProps>(({\n step,\n index,\n isActive,\n isCompleted,\n isError,\n variant,\n color,\n size,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n interactive,\n animated,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const handleClick = useCallback(() => {\n if (interactive && !disabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const renderIndicatorContent = () => {\n if (isError && errorIcon) {\n return errorIcon;\n }\n if (isCompleted && completedIcon) {\n return completedIcon;\n }\n if (showIcons && step.icon) {\n return step.icon;\n }\n if (showNumbers) {\n return index + 1;\n }\n return null;\n };\n\n return (\n <StepIndicator\n ref={ref}\n size={size}\n variant={variant}\n color={color}\n isActive={isActive}\n isCompleted={isCompleted}\n isError={isError}\n interactive={interactive}\n animated={animated}\n disabled={Boolean(disabled || step.disabled)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled && !step.disabled ? 0 : -1}\n aria-label={`Step ${index + 1}: ${step.title}`}\n aria-current={isActive ? 'step' : undefined}\n data-testid={dataTestId}\n >\n {renderIndicatorContent()}\n </StepIndicator>\n );\n});\n\nStepIndicatorComponent.displayName = 'StepIndicator';\n\n/**\n * Step connector component\n */\nconst StepConnectorComponent = forwardRef<HTMLDivElement, StepConnectorProps>(({\n isCompleted,\n orientation,\n variant,\n color,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepConnector\n ref={ref}\n orientation={orientation}\n isCompleted={isCompleted}\n color={color}\n variant={variant}\n data-testid={dataTestId}\n />\n));\n\nStepConnectorComponent.displayName = 'StepConnector';\n\n/**\n * Step content component\n */\nconst StepContentComponent = forwardRef<HTMLDivElement, StepContentProps>(({\n step,\n index,\n orientation,\n interactive,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const handleClick = useCallback(() => {\n if (interactive && !disabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, disabled, onClick, index, step]);\n\n return (\n <StepContent\n ref={ref}\n orientation={orientation}\n interactive={interactive}\n disabled={Boolean(disabled || step.disabled)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled && !step.disabled ? 0 : -1}\n data-testid={dataTestId}\n >\n <div className=\"step-title\">{step.title}</div>\n {step.description && (\n <div className=\"step-description\">{step.description}</div>\n )}\n </StepContent>\n );\n});\n\nStepContentComponent.displayName = 'StepContent';\n\n/**\n * A plain wrapper around the styled row. Exporting the styled component itself\n * trips TS2742 — its inferred type names a pnpm-internal @mui/system path.\n */\nexport const StepItemRow: React.FC<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n children: React.ReactNode;\n}> = ({ orientation, isLast, children }) => (\n <StepItem orientation={orientation} isLast={isLast}>\n {children}\n </StepItem>\n);\n\nexport { StepConnectorComponent, StepContentComponent, StepIndicatorComponent };\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,SAAS;AAEhB,SAAS,cAAc;AACvB,SAAgB,YAAY,mBAAmB;AA8P3C,cA4EA,YA5EA;AA/OJ,IAAM,yBAAyB,CAC7B,OACA,SACA,EAAE,iBAAiB,aAAa,UAAU,MAC5B;AACd,MAAI,YAAY,YAAY;AAC1B,WAAO;AAAA,MACL,QAAQ,GAAG,IAAI,OAAO,CAAC,CAAC,UAAU,WAAW;AAAA,MAC7C,iBAAiB,MAAM,QAAQ,WAAW;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,SAAS,EAAE,iBAAiB,OAAO,UAAU;AAEnD,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,EAAE,GAAG,QAAQ,QAAQ,OAAO;AAAA,IACrC,KAAK;AACH,aAA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AA,QACvC,KAAK,eACJ,oBAAC,SAAI,WAAU,oBAAoB,eAAK,aAAY;AAAA;AAAA;AAAA,EAExD;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAM5B,IAAM,cAIR,CAAC,EAAE,aAAa,QAAQ,SAAS,MACpC,oBAAC,YAAS,aAA0B,QACjC,UACH;","names":[]}
|
|
@@ -78,12 +78,18 @@ var definedProps = (props) => Object.fromEntries(
|
|
|
78
78
|
Object.entries(props).filter(([, value]) => value !== void 0)
|
|
79
79
|
);
|
|
80
80
|
var resolveWorkflowStepProps = (props) => ({ ...WORKFLOW_DEFAULTS, ...definedProps(props) });
|
|
81
|
+
var progressValueText = (steps, currentStep) => {
|
|
82
|
+
const position = `Step ${currentStep + 1} of ${steps.length}`;
|
|
83
|
+
const step = steps[currentStep];
|
|
84
|
+
return step === void 0 ? position : `${position}: ${step.title}`;
|
|
85
|
+
};
|
|
81
86
|
|
|
82
87
|
export {
|
|
83
88
|
indicatorSizeFor,
|
|
84
89
|
stepPalette,
|
|
85
90
|
stepColors,
|
|
86
91
|
withDerivedStatus,
|
|
87
|
-
resolveWorkflowStepProps
|
|
92
|
+
resolveWorkflowStepProps,
|
|
93
|
+
progressValueText
|
|
88
94
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-RXNIOPOA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.helpers.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles/index.js';\n\nimport type { WorkflowStepItem, WorkflowStepProps } from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { paletteKey } from '../../../tokens/scales';\n\ntype StepColor = NonNullable<WorkflowStepProps['color']>;\ntype StepSize = NonNullable<WorkflowStepProps['size']>;\n\nconst INDICATOR_SIZE: Record<StepSize, number> = {\n xs: 20,\n sm: 24,\n md: 32,\n lg: 40,\n xl: 48,\n};\n\nexport const indicatorSizeFor = (size?: StepSize): number =>\n INDICATOR_SIZE[size as StepSize] ?? INDICATOR_SIZE.md;\n\ninterface StepPalette {\n main: string;\n contrastText: string;\n}\n\n/**\n * The step's colour pair, keyed through `paletteKey` so `danger` reads MUI's\n * `error` (the palette has no `danger`). `neutral` lands on `grey`, a ramp with\n * no `main`, so its pair is derived from the ramp — with the contrast computed,\n * not assumed.\n */\nexport const stepPalette = (theme: Theme, color?: StepColor): StepPalette => {\n const key = paletteKey(color || 'primary');\n if (key === 'grey') {\n const main = neutralTones(theme).emphasis;\n return {\n main,\n contrastText: theme.palette.getContrastText(main),\n };\n }\n\n return theme.palette[key];\n};\n\nexport interface StepColors {\n backgroundColor: string;\n borderColor: string;\n textColor: string;\n}\n\ninterface StepState {\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n variant?: WorkflowStepProps['variant'];\n}\n\n/**\n * An indicator is one of four things, in priority order: failed, done, the step\n * you are on, or still ahead. Only the active one respects `variant` — an active\n * outlined step stays hollow with a coloured rim.\n */\nexport const stepColors = (\n theme: Theme,\n palette: StepPalette,\n { isActive, isCompleted, isError, variant }: StepState,\n): StepColors => {\n if (isError) {\n return {\n backgroundColor: theme.palette.error.main,\n borderColor: theme.palette.error.main,\n textColor: theme.palette.error.contrastText,\n };\n }\n\n if (isCompleted) {\n return {\n backgroundColor: palette.main,\n borderColor: palette.main,\n textColor: palette.contrastText,\n };\n }\n\n if (isActive) {\n const filled = variant === 'filled';\n return {\n backgroundColor: filled ? palette.main : theme.palette.background.paper,\n borderColor: palette.main,\n textColor: filled ? palette.contrastText : palette.main,\n };\n }\n\n return {\n backgroundColor: neutralTones(theme).track,\n borderColor: neutralTones(theme).track,\n textColor: theme.palette.text.secondary,\n };\n};\n\n/**\n * A step that declares `error` keeps it; the rest are positioned against\n * `currentStep`, so a caller only has to move one number to advance the workflow.\n */\nexport const withDerivedStatus = (\n steps: WorkflowStepItem[],\n currentStep: number,\n): WorkflowStepItem[] =>\n steps.map((step, index) => {\n const derivable =\n step.status === 'pending' || step.status === 'current' || step.status === 'completed';\n\n if (!derivable) return { ...step, status: step.status };\n\n if (index < currentStep) return { ...step, status: 'completed' as const };\n if (index === currentStep) return { ...step, status: 'current' as const };\n return { ...step, status: 'pending' as const };\n });\n\ntype WorkflowDefaultedKeys =\n | 'currentStep'\n | 'variant'\n | 'orientation'\n | 'color'\n | 'size'\n | 'showProgress'\n | 'animated'\n | 'interactive'\n | 'showNumbers'\n | 'showIcons'\n | 'disabled';\n\ntype ResolvedWorkflowStepProps = WorkflowStepProps &\n Required<Pick<WorkflowStepProps, WorkflowDefaultedKeys>>;\n\nconst WORKFLOW_DEFAULTS: Pick<WorkflowStepProps, WorkflowDefaultedKeys> = {\n currentStep: 0,\n variant: 'default',\n orientation: 'horizontal',\n color: 'primary',\n size: 'md',\n showProgress: true,\n animated: true,\n interactive: false,\n showNumbers: true,\n showIcons: false,\n disabled: false,\n};\n\n// Strips explicitly-undefined props before the merge, so `size={undefined}` still\n// falls back to the default exactly as a destructuring default would.\nconst definedProps = (props: WorkflowStepProps): Partial<WorkflowStepProps> =>\n Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Partial<WorkflowStepProps>;\n\nexport const resolveWorkflowStepProps = (\n props: WorkflowStepProps,\n): ResolvedWorkflowStepProps =>\n ({ ...WORKFLOW_DEFAULTS, ...definedProps(props) }) as ResolvedWorkflowStepProps;\n"],"mappings":";;;;;;;;AASA,IAAM,iBAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,IAAM,mBAAmB,CAAC,SAC/B,eAAe,IAAgB,KAAK,eAAe;AAa9C,IAAM,cAAc,CAAC,OAAc,UAAmC;AAC3E,QAAM,MAAM,WAAW,SAAS,SAAS;AACzC,MAAI,QAAQ,QAAQ;AAClB,UAAM,OAAO,aAAa,KAAK,EAAE;AACjC,WAAO;AAAA,MAC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AAA,EACxE,aAAa;AAAA,EACb,SAAS;AAAA,EACT,aAAa;AAAA,EACb,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,UAAU;AAAA,EACV,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AACZ;AAIA,IAAM,eAAe,CAAC,UACpB,OAAO;AAAA,EACL,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS;AACjE;AAEK,IAAM,2BAA2B,CACtC,WAEC,EAAE,GAAG,mBAAmB,GAAG,aAAa,KAAK,EAAE;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.helpers.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles/index.js';\n\nimport type { WorkflowStepItem, WorkflowStepProps } from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { paletteKey } from '../../../tokens/scales';\n\ntype StepColor = NonNullable<WorkflowStepProps['color']>;\ntype StepSize = NonNullable<WorkflowStepProps['size']>;\n\nconst INDICATOR_SIZE: Record<StepSize, number> = {\n xs: 20,\n sm: 24,\n md: 32,\n lg: 40,\n xl: 48,\n};\n\nexport const indicatorSizeFor = (size?: StepSize): number =>\n INDICATOR_SIZE[size as StepSize] ?? INDICATOR_SIZE.md;\n\ninterface StepPalette {\n main: string;\n contrastText: string;\n}\n\n/**\n * The step's colour pair, keyed through `paletteKey` so `danger` reads MUI's\n * `error` (the palette has no `danger`). `neutral` lands on `grey`, a ramp with\n * no `main`, so its pair is derived from the ramp — with the contrast computed,\n * not assumed.\n */\nexport const stepPalette = (theme: Theme, color?: StepColor): StepPalette => {\n const key = paletteKey(color || 'primary');\n if (key === 'grey') {\n const main = neutralTones(theme).emphasis;\n return {\n main,\n contrastText: theme.palette.getContrastText(main),\n };\n }\n\n return theme.palette[key];\n};\n\nexport interface StepColors {\n backgroundColor: string;\n borderColor: string;\n textColor: string;\n}\n\ninterface StepState {\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n variant?: WorkflowStepProps['variant'];\n}\n\n/**\n * An indicator is one of four things, in priority order: failed, done, the step\n * you are on, or still ahead. Only the active one respects `variant` — an active\n * outlined step stays hollow with a coloured rim.\n */\nexport const stepColors = (\n theme: Theme,\n palette: StepPalette,\n { isActive, isCompleted, isError, variant }: StepState,\n): StepColors => {\n if (isError) {\n return {\n backgroundColor: theme.palette.error.main,\n borderColor: theme.palette.error.main,\n textColor: theme.palette.error.contrastText,\n };\n }\n\n if (isCompleted) {\n return {\n backgroundColor: palette.main,\n borderColor: palette.main,\n textColor: palette.contrastText,\n };\n }\n\n if (isActive) {\n const filled = variant === 'filled';\n return {\n backgroundColor: filled ? palette.main : theme.palette.background.paper,\n borderColor: palette.main,\n textColor: filled ? palette.contrastText : palette.main,\n };\n }\n\n return {\n backgroundColor: neutralTones(theme).track,\n borderColor: neutralTones(theme).track,\n textColor: theme.palette.text.secondary,\n };\n};\n\n/**\n * A step that declares `error` keeps it; the rest are positioned against\n * `currentStep`, so a caller only has to move one number to advance the workflow.\n */\nexport const withDerivedStatus = (\n steps: WorkflowStepItem[],\n currentStep: number,\n): WorkflowStepItem[] =>\n steps.map((step, index) => {\n const derivable =\n step.status === 'pending' || step.status === 'current' || step.status === 'completed';\n\n if (!derivable) return { ...step, status: step.status };\n\n if (index < currentStep) return { ...step, status: 'completed' as const };\n if (index === currentStep) return { ...step, status: 'current' as const };\n return { ...step, status: 'pending' as const };\n });\n\ntype WorkflowDefaultedKeys =\n | 'currentStep'\n | 'variant'\n | 'orientation'\n | 'color'\n | 'size'\n | 'showProgress'\n | 'animated'\n | 'interactive'\n | 'showNumbers'\n | 'showIcons'\n | 'disabled';\n\ntype ResolvedWorkflowStepProps = WorkflowStepProps &\n Required<Pick<WorkflowStepProps, WorkflowDefaultedKeys>>;\n\nconst WORKFLOW_DEFAULTS: Pick<WorkflowStepProps, WorkflowDefaultedKeys> = {\n currentStep: 0,\n variant: 'default',\n orientation: 'horizontal',\n color: 'primary',\n size: 'md',\n showProgress: true,\n animated: true,\n interactive: false,\n showNumbers: true,\n showIcons: false,\n disabled: false,\n};\n\n// Strips explicitly-undefined props before the merge, so `size={undefined}` still\n// falls back to the default exactly as a destructuring default would.\nconst definedProps = (props: WorkflowStepProps): Partial<WorkflowStepProps> =>\n Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n ) as Partial<WorkflowStepProps>;\n\nexport const resolveWorkflowStepProps = (\n props: WorkflowStepProps,\n): ResolvedWorkflowStepProps =>\n ({ ...WORKFLOW_DEFAULTS, ...definedProps(props) }) as ResolvedWorkflowStepProps;\n\n/**\n * The progressbar's `aria-valuetext`: `Step N of M: <title>` while `currentStep`\n * names a step, and `Step N of M` when it does not (past the end, below zero, or\n * no steps at all), so a screen reader never reads a missing title as\n * \"undefined\". The index itself is not clamped (FUT-2671).\n */\nexport const progressValueText = (\n steps: readonly WorkflowStepItem[],\n currentStep: number,\n): string => {\n const position = `Step ${currentStep + 1} of ${steps.length}`;\n const step = steps[currentStep];\n return step === undefined ? position : `${position}: ${step.title}`;\n};\n"],"mappings":";;;;;;;;AASA,IAAM,iBAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,IAAM,mBAAmB,CAAC,SAC/B,eAAe,IAAgB,KAAK,eAAe;AAa9C,IAAM,cAAc,CAAC,OAAc,UAAmC;AAC3E,QAAM,MAAM,WAAW,SAAS,SAAS;AACzC,MAAI,QAAQ,QAAQ;AAClB,UAAM,OAAO,aAAa,KAAK,EAAE;AACjC,WAAO;AAAA,MACL;AAAA,MACA,cAAc,MAAM,QAAQ,gBAAgB,IAAI;AAAA,IAClD;AAAA,EACF;AAEA,SAAO,MAAM,QAAQ,GAAG;AAC1B;AAoBO,IAAM,aAAa,CACxB,OACA,SACA,EAAE,UAAU,aAAa,SAAS,QA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AAA,EACX,UAAU;AACZ;AAIA,IAAM,eAAe,CAAC,UACpB,OAAO;AAAA,EACL,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS;AACjE;AAEK,IAAM,2BAA2B,CACtC,WAEC,EAAE,GAAG,mBAAmB,GAAG,aAAa,KAAK,EAAE;AAQ3C,IAAM,oBAAoB,CAC/B,OACA,gBACW;AACX,QAAM,WAAW,QAAQ,cAAc,CAAC,OAAO,MAAM,MAAM;AAC3D,QAAM,OAAO,MAAM,WAAW;AAC9B,SAAO,SAAS,SAAY,WAAW,GAAG,QAAQ,KAAK,KAAK,KAAK;AACnE;","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StepRow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7OO3BELX.js";
|
|
4
4
|
import {
|
|
5
|
+
progressValueText,
|
|
5
6
|
resolveWorkflowStepProps,
|
|
6
7
|
withDerivedStatus
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RXNIOPOA.js";
|
|
8
9
|
|
|
9
10
|
// src/components/utility/WorkflowStep/WorkflowStep.tsx
|
|
10
11
|
import Box from "@mui/material/Box/index.js";
|
|
@@ -68,7 +69,7 @@ var WorkflowStep = forwardRef((rawProps, ref) => {
|
|
|
68
69
|
"aria-valuemin": 0,
|
|
69
70
|
"aria-valuemax": steps.length - 1,
|
|
70
71
|
"aria-valuenow": currentStep,
|
|
71
|
-
"aria-valuetext":
|
|
72
|
+
"aria-valuetext": progressValueText(steps, currentStep),
|
|
72
73
|
"data-testid": dataTestId,
|
|
73
74
|
...other,
|
|
74
75
|
children: stepsWithStatus.map((step, index) => /* @__PURE__ */ jsx(
|
|
@@ -104,4 +105,4 @@ export {
|
|
|
104
105
|
WorkflowStep,
|
|
105
106
|
WorkflowStep_default
|
|
106
107
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-Y2C2S4R7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport { progressValueText, resolveWorkflowStepProps, withDerivedStatus } from './WorkflowStep.helpers';\nimport { StepRow } from './WorkflowStepRow';\nimport type { WorkflowStepItem, WorkflowStepProps } from './WorkflowStep.types';\n\n// Styled Components\nconst StepContainer = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'variant'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n variant: WorkflowStepProps['variant'];\n}>(({ theme, orientation, variant }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n gap: orientation === 'vertical' ? theme.spacing(2) : theme.spacing(1),\n width: '100%',\n position: 'relative',\n \n // Variant-specific styles\n ...(variant === 'minimal' && {\n gap: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n }),\n}));\n\n/**\n * WorkflowStep component for displaying multi-step workflows with visual progression\n */\nexport const WorkflowStep = forwardRef<HTMLDivElement, WorkflowStepProps>((rawProps, ref) => {\n const {\n steps,\n currentStep,\n variant,\n orientation,\n color,\n size,\n showProgress,\n animated,\n interactive,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n onStepClick,\n disabled,\n className,\n style,\n 'data-testid': dataTestId,\n ...other\n } = resolveWorkflowStepProps(rawProps);\n const handleStepClick = useCallback((stepIndex: number, step: WorkflowStepItem) => {\n if (onStepClick && !disabled && !step.disabled) {\n onStepClick(stepIndex, step);\n }\n }, [onStepClick, disabled]);\n\n const stepsWithStatus = useMemo(\n () => withDerivedStatus(steps, currentStep),\n [steps, currentStep],\n );\n\n return (\n <StepContainer\n ref={ref}\n orientation={orientation}\n variant={variant}\n className={className}\n style={style}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={steps.length - 1}\n aria-valuenow={currentStep}\n aria-valuetext={progressValueText(steps, currentStep)}\n data-testid={dataTestId}\n {...other}\n >\n {stepsWithStatus.map((step, index) => (\n <StepRow\n key={index}\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n orientation={orientation}\n variant={variant}\n color={color}\n size={size}\n showNumbers={showNumbers}\n showIcons={showIcons}\n showProgress={showProgress}\n completedIcon={completedIcon}\n errorIcon={errorIcon}\n interactive={interactive}\n animated={animated}\n disabled={disabled}\n onClick={handleStepClick}\n dataTestId={dataTestId}\n />\n ))}\n </StepContainer>\n );\n});\n\nWorkflowStep.displayName = 'WorkflowStep';\n\nexport default WorkflowStep;"],"mappings":";;;;;;;;;;AAAA,OAAO,SAAS;AAChB,SAAS,cAAc;AACvB,SAAgB,YAAY,aAAa,eAAe;AA8EhD;AAvER,IAAM,gBAAgB,OAAO,KAAK;AAAA,EAChC,mBAAmB,CAAC,SAAS,CAAC,CAAC,eAAe,SAAS,EAAE,SAAS,IAAc;AAClF,CAAC,EAGE,CAAC,EAAE,OAAO,aAAa,QAAQ,OAAO;AAAA,EACvC,SAAS;AAAA,EACT,eAAe,gBAAgB,aAAa,WAAW;AAAA,EACvD,YAAY,gBAAgB,aAAa,eAAe;AAAA,EACxD,KAAK,gBAAgB,aAAa,MAAM,QAAQ,CAAC,IAAI,MAAM,QAAQ,CAAC;AAAA,EACpE,OAAO;AAAA,EACP,UAAU;AAAA;AAAA,EAGV,GAAI,YAAY,aAAa;AAAA,IAC3B,KAAK,gBAAgB,aAAa,MAAM,QAAQ,CAAC,IAAI,MAAM,QAAQ,GAAG;AAAA,EACxE;AACF,EAAE;AAKK,IAAM,eAAe,WAA8C,CAAC,UAAU,QAAQ;AAC3F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,GAAG;AAAA,EACL,IAAI,yBAAyB,QAAQ;AACrC,QAAM,kBAAkB,YAAY,CAAC,WAAmB,SAA2B;AACjF,QAAI,eAAe,CAAC,YAAY,CAAC,KAAK,UAAU;AAC9C,kBAAY,WAAW,IAAI;AAAA,IAC7B;AAAA,EACF,GAAG,CAAC,aAAa,QAAQ,CAAC;AAE1B,QAAM,kBAAkB;AAAA,IACtB,MAAM,kBAAkB,OAAO,WAAW;AAAA,IAC1C,CAAC,OAAO,WAAW;AAAA,EACrB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,iBAAe;AAAA,MACf,iBAAe,MAAM,SAAS;AAAA,MAC9B,iBAAe;AAAA,MACf,kBAAgB,kBAAkB,OAAO,WAAW;AAAA,MACpD,eAAa;AAAA,MACZ,GAAG;AAAA,MAEH,0BAAgB,IAAI,CAAC,MAAM,UAC1B;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA,QAAQ,UAAU,MAAM,SAAS;AAAA,UACjC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT;AAAA;AAAA,QAjBK;AAAA,MAkBP,CACD;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,aAAa,cAAc;AAE3B,IAAO,uBAAQ;","names":[]}
|
|
@@ -39,5 +39,12 @@ export declare const withDerivedStatus: (steps: WorkflowStepItem[], currentStep:
|
|
|
39
39
|
type WorkflowDefaultedKeys = 'currentStep' | 'variant' | 'orientation' | 'color' | 'size' | 'showProgress' | 'animated' | 'interactive' | 'showNumbers' | 'showIcons' | 'disabled';
|
|
40
40
|
type ResolvedWorkflowStepProps = WorkflowStepProps & Required<Pick<WorkflowStepProps, WorkflowDefaultedKeys>>;
|
|
41
41
|
export declare const resolveWorkflowStepProps: (props: WorkflowStepProps) => ResolvedWorkflowStepProps;
|
|
42
|
+
/**
|
|
43
|
+
* The progressbar's `aria-valuetext`: `Step N of M: <title>` while `currentStep`
|
|
44
|
+
* names a step, and `Step N of M` when it does not (past the end, below zero, or
|
|
45
|
+
* no steps at all), so a screen reader never reads a missing title as
|
|
46
|
+
* "undefined". The index itself is not clamped (FUT-2671).
|
|
47
|
+
*/
|
|
48
|
+
export declare const progressValueText: (steps: readonly WorkflowStepItem[], currentStep: number) => string;
|
|
42
49
|
export {};
|
|
43
50
|
//# sourceMappingURL=WorkflowStep.helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowStep.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/utility/WorkflowStep/WorkflowStep.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIhF,KAAK,SAAS,GAAG,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,KAAK,QAAQ,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAUvD,eAAO,MAAM,gBAAgB,GAAI,OAAO,QAAQ,KAAG,MACI,CAAC;AAExD,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,EAAE,QAAQ,SAAS,KAAG,WAW7D,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,SAAS;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,SAAS,WAAW,EACpB,6CAA6C,SAAS,KACrD,UA+BF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,gBAAgB,EAAE,EACzB,aAAa,MAAM,KAClB,gBAAgB,EAUf,CAAC;AAEL,KAAK,qBAAqB,GACtB,aAAa,GACb,SAAS,GACT,aAAa,GACb,OAAO,GACP,MAAM,GACN,cAAc,GACd,UAAU,GACV,aAAa,GACb,aAAa,GACb,WAAW,GACX,UAAU,CAAC;AAEf,KAAK,yBAAyB,GAAG,iBAAiB,GAChD,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAuB3D,eAAO,MAAM,wBAAwB,GACnC,OAAO,iBAAiB,KACvB,yBAC8E,CAAC"}
|
|
1
|
+
{"version":3,"file":"WorkflowStep.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/utility/WorkflowStep/WorkflowStep.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIhF,KAAK,SAAS,GAAG,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,KAAK,QAAQ,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAUvD,eAAO,MAAM,gBAAgB,GAA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2
|
import {
|
|
3
3
|
WorkflowStep
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-Y2C2S4R7.js";
|
|
5
|
+
import "../chunk-7OO3BELX.js";
|
|
6
|
+
import "../chunk-KJID4PRD.js";
|
|
7
|
+
import "../chunk-RXNIOPOA.js";
|
|
8
8
|
import "../chunk-TCAQOUIB.js";
|
|
9
9
|
import "../chunk-7ZPUN7TV.js";
|
|
10
10
|
import "../chunk-PT6TCWIW.js";
|
package/package.json
CHANGED
|
@@ -157,3 +157,18 @@ export const resolveWorkflowStepProps = (
|
|
|
157
157
|
props: WorkflowStepProps,
|
|
158
158
|
): ResolvedWorkflowStepProps =>
|
|
159
159
|
({ ...WORKFLOW_DEFAULTS, ...definedProps(props) }) as ResolvedWorkflowStepProps;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The progressbar's `aria-valuetext`: `Step N of M: <title>` while `currentStep`
|
|
163
|
+
* names a step, and `Step N of M` when it does not (past the end, below zero, or
|
|
164
|
+
* no steps at all), so a screen reader never reads a missing title as
|
|
165
|
+
* "undefined". The index itself is not clamped (FUT-2671).
|
|
166
|
+
*/
|
|
167
|
+
export const progressValueText = (
|
|
168
|
+
steps: readonly WorkflowStepItem[],
|
|
169
|
+
currentStep: number,
|
|
170
|
+
): string => {
|
|
171
|
+
const position = `Step ${currentStep + 1} of ${steps.length}`;
|
|
172
|
+
const step = steps[currentStep];
|
|
173
|
+
return step === undefined ? position : `${position}: ${step.title}`;
|
|
174
|
+
};
|
|
@@ -57,7 +57,7 @@ const StepItem = styled(Box, {
|
|
|
57
57
|
}));
|
|
58
58
|
|
|
59
59
|
const StepIndicator = styled(Box, {
|
|
60
|
-
shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'disabled'].includes(prop as string),
|
|
60
|
+
shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'animated', 'disabled'].includes(prop as string),
|
|
61
61
|
})<{
|
|
62
62
|
size: WorkflowStepProps['size'];
|
|
63
63
|
variant: WorkflowStepProps['variant'];
|
|
@@ -2,7 +2,7 @@ import Box from '@mui/material/Box/index.js';
|
|
|
2
2
|
import { styled } from '@mui/material/styles/index.js';
|
|
3
3
|
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
-
import { resolveWorkflowStepProps, withDerivedStatus } from './WorkflowStep.helpers';
|
|
5
|
+
import { progressValueText, resolveWorkflowStepProps, withDerivedStatus } from './WorkflowStep.helpers';
|
|
6
6
|
import { StepRow } from './WorkflowStepRow';
|
|
7
7
|
import type { WorkflowStepItem, WorkflowStepProps } from './WorkflowStep.types';
|
|
8
8
|
|
|
@@ -73,7 +73,7 @@ export const WorkflowStep = forwardRef<HTMLDivElement, WorkflowStepProps>((rawPr
|
|
|
73
73
|
aria-valuemin={0}
|
|
74
74
|
aria-valuemax={steps.length - 1}
|
|
75
75
|
aria-valuenow={currentStep}
|
|
76
|
-
aria-valuetext={
|
|
76
|
+
aria-valuetext={progressValueText(steps, currentStep)}
|
|
77
77
|
data-testid={dataTestId}
|
|
78
78
|
{...other}
|
|
79
79
|
>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.parts.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport type { CSSObject, Theme } from '@mui/material/styles/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback } from 'react';\n\nimport type { StepColors } from './WorkflowStep.helpers';\nimport { indicatorSizeFor, stepColors, stepPalette } from './WorkflowStep.helpers';\nimport type {\n StepConnectorProps,\n StepContentProps,\n StepIndicatorProps,\n WorkflowStepProps,\n} from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { rem } from '../../../tokens/relative';\n\n// `outlined` shows the surface through a coloured rim; the other three fill it and\n// differ only in what border they keep.\nconst indicatorVariantStyles = (\n theme: Theme,\n variant: WorkflowStepProps['variant'],\n { backgroundColor, borderColor, textColor }: StepColors,\n): CSSObject => {\n if (variant === 'outlined') {\n return {\n border: `${rem(theme, 2)} solid ${borderColor}`,\n backgroundColor: theme.palette.background.paper,\n };\n }\n\n const filled = { backgroundColor, color: textColor };\n\n switch (variant) {\n case 'filled':\n return filled;\n case 'minimal':\n return { ...filled, border: 'none' };\n case 'default':\n return { ...filled, border: `1px solid ${borderColor}` };\n default:\n return {};\n }\n};\n\nconst StepItem = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isLast'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n}>(({ orientation, isLast }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n flex: orientation === 'horizontal' && !isLast ? 1 : 'none',\n position: 'relative',\n minWidth: 0, // Allow content to shrink\n}));\n\nconst StepIndicator = styled(Box, {\n shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'disabled'].includes(prop as string),\n})<{\n size: WorkflowStepProps['size'];\n variant: WorkflowStepProps['variant'];\n color: WorkflowStepProps['color'];\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n interactive: boolean;\n animated: boolean;\n disabled: boolean;\n}>(({ theme, size, variant, color, isActive, isCompleted, isError, interactive, animated, disabled }) => {\n const indicatorSize = indicatorSizeFor(size);\n const palette = stepPalette(theme, color);\n const { backgroundColor, borderColor, textColor } = stepColors(theme, palette, {\n isActive,\n isCompleted,\n isError,\n variant,\n });\n\n return {\n width: rem(theme, indicatorSize),\n height: rem(theme, indicatorSize),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: rem(theme, 12),\n fontWeight: theme.typography.fontWeightMedium,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n transition: animated\n ? theme.transitions.create(['background-color', 'border-color', 'transform'], {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n flexShrink: 0,\n\n ...indicatorVariantStyles(theme, variant, { backgroundColor, borderColor, textColor }),\n\n // Interactive states\n ...(interactive && !disabled && {\n '&:hover': {\n transform: 'scale(1.1)',\n boxShadow: theme.shadows[2],\n },\n '&:focus-visible': {\n outline: `${rem(theme, 2)} solid ${palette.main}`,\n outlineOffset: rem(theme, 2),\n },\n }),\n\n // Disabled state\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n }),\n };\n});\n\nconst StepContent = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'interactive', 'disabled'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n interactive: boolean;\n disabled: boolean;\n}>(({ theme, orientation, interactive, disabled }) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n textAlign: orientation === 'vertical' ? 'left' : 'center',\n marginTop: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n marginLeft: orientation === 'horizontal' ? theme.spacing(1) : 0,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n minWidth: 0,\n flex: 1,\n\n '& .step-title': {\n fontSize: rem(theme, 14),\n fontWeight: theme.typography.fontWeightMedium,\n color: theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n '& .step-description': {\n fontSize: rem(theme, 12),\n color: theme.palette.text.secondary,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n ...(disabled && {\n opacity: 0.5,\n }),\n}));\n\nconst StepConnector = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isCompleted', 'color', 'variant'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isCompleted: boolean;\n color: WorkflowStepProps['color'];\n variant: WorkflowStepProps['variant'];\n}>(({ theme, orientation, isCompleted, color, variant }) => {\n const connectorColor = isCompleted ? stepPalette(theme, color).main : neutralTones(theme).track;\n\n return {\n flex: 1,\n position: 'relative',\n \n ...(orientation === 'horizontal' && {\n height: rem(theme, 2),\n backgroundColor: connectorColor,\n margin: `0 ${theme.spacing(1)}`,\n minWidth: theme.spacing(2),\n }),\n \n ...(orientation === 'vertical' && {\n width: rem(theme, 2),\n backgroundColor: connectorColor,\n minHeight: theme.spacing(3),\n marginLeft: theme.spacing(2),\n position: 'absolute',\n left: '50%',\n transform: 'translateX(-50%)',\n top: '100%',\n }),\n\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.short,\n }),\n\n ...(variant === 'minimal' && {\n opacity: 0.6,\n }),\n };\n});\n\n/**\n * Individual step indicator component\n */\nconst StepIndicatorComponent = forwardRef<HTMLDivElement, StepIndicatorProps>(({\n step,\n index,\n isActive,\n isCompleted,\n isError,\n variant,\n color,\n size,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n interactive,\n animated,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const handleClick = useCallback(() => {\n if (interactive && !disabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const renderIndicatorContent = () => {\n if (isError && errorIcon) {\n return errorIcon;\n }\n if (isCompleted && completedIcon) {\n return completedIcon;\n }\n if (showIcons && step.icon) {\n return step.icon;\n }\n if (showNumbers) {\n return index + 1;\n }\n return null;\n };\n\n return (\n <StepIndicator\n ref={ref}\n size={size}\n variant={variant}\n color={color}\n isActive={isActive}\n isCompleted={isCompleted}\n isError={isError}\n interactive={interactive}\n animated={animated}\n disabled={Boolean(disabled || step.disabled)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled && !step.disabled ? 0 : -1}\n aria-label={`Step ${index + 1}: ${step.title}`}\n aria-current={isActive ? 'step' : undefined}\n data-testid={dataTestId}\n >\n {renderIndicatorContent()}\n </StepIndicator>\n );\n});\n\nStepIndicatorComponent.displayName = 'StepIndicator';\n\n/**\n * Step connector component\n */\nconst StepConnectorComponent = forwardRef<HTMLDivElement, StepConnectorProps>(({\n isCompleted,\n orientation,\n variant,\n color,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepConnector\n ref={ref}\n orientation={orientation}\n isCompleted={isCompleted}\n color={color}\n variant={variant}\n data-testid={dataTestId}\n />\n));\n\nStepConnectorComponent.displayName = 'StepConnector';\n\n/**\n * Step content component\n */\nconst StepContentComponent = forwardRef<HTMLDivElement, StepContentProps>(({\n step,\n index,\n orientation,\n interactive,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const handleClick = useCallback(() => {\n if (interactive && !disabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, disabled, onClick, index, step]);\n\n return (\n <StepContent\n ref={ref}\n orientation={orientation}\n interactive={interactive}\n disabled={Boolean(disabled || step.disabled)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled && !step.disabled ? 0 : -1}\n data-testid={dataTestId}\n >\n <div className=\"step-title\">{step.title}</div>\n {step.description && (\n <div className=\"step-description\">{step.description}</div>\n )}\n </StepContent>\n );\n});\n\nStepContentComponent.displayName = 'StepContent';\n\n/**\n * A plain wrapper around the styled row. Exporting the styled component itself\n * trips TS2742 — its inferred type names a pnpm-internal @mui/system path.\n */\nexport const StepItemRow: React.FC<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n children: React.ReactNode;\n}> = ({ orientation, isLast, children }) => (\n <StepItem orientation={orientation} isLast={isLast}>\n {children}\n </StepItem>\n);\n\nexport { StepConnectorComponent, StepContentComponent, StepIndicatorComponent };\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,SAAS;AAEhB,SAAS,cAAc;AACvB,SAAgB,YAAY,mBAAmB;AA8P3C,cA4EA,YA5EA;AA/OJ,IAAM,yBAAyB,CAC7B,OACA,SACA,EAAE,iBAAiB,aAAa,UAAU,MAC5B;AACd,MAAI,YAAY,YAAY;AAC1B,WAAO;AAAA,MACL,QAAQ,GAAG,IAAI,OAAO,CAAC,CAAC,UAAU,WAAW;AAAA,MAC7C,iBAAiB,MAAM,QAAQ,WAAW;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,SAAS,EAAE,iBAAiB,OAAO,UAAU;AAEnD,UAAQ,SAAS;AAAA,IACf,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,EAAE,GAAG,QAAQ,QAAQ,OAAO;AAAA,IACrC,KAAK;AACH,aAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,WAAW,GAAG;AAAA,IACzD;AACE,aAAO,CAAC;AAAA,EACZ;AACF;AAEA,IAAM,WAAW,OAAO,KAAK;AAAA,EAC3B,mBAAmB,CAAC,SAAS,CAAC,CAAC,eAAe,QAAQ,EAAE,SAAS,IAAc;AACjF,CAAC,EAGE,CAAC,EAAE,aAAa,OAAO,OAAO;AAAA,EAC/B,SAAS;AAAA,EACT,eAAe,gBAAgB,aAAa,WAAW;AAAA,EACvD,YAAY,gBAAgB,aAAa,eAAe;AAAA,EACxD,MAAM,gBAAgB,gBAAgB,CAAC,SAAS,IAAI;AAAA,EACpD,UAAU;AAAA,EACV,UAAU;AAAA;AACZ,EAAE;AAEF,IAAM,gBAAgB,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AA,EACA,eAAe;AACjB,GAAG,QAAQ;AACT,QAAM,cAAc,YAAY,MAAM;AACpC,QAAI,eAAe,CAAC,YAAY,SAAS;AACvC,cAAQ,OAAO,IAAI;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,SAAS,OAAO,IAAI,CAAC;AAEhD,QAAM,gBAAgB,YAAY,CAAC,UAA+B;AAChE,QAAI,eAAe,CAAC,aAAa,MAAM,QAAQ,WAAW,MAAM,QAAQ,MAAM;AAC5E,YAAM,eAAe;AACrB,UAAI,SAAS;AACX,gBAAQ,OAAO,IAAI;AAAA,MACrB;AAAA,IACF;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,SAAS,OAAO,IAAI,CAAC;AAEhD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,QAAQ,YAAY,KAAK,QAAQ;AAAA,MAC3C,SAAS;AAAA,MACT,WAAW;AAAA,MACX,MAAM,cAAc,WAAW;AAAA,MAC/B,UAAU,eAAe,CAAC,YAAY,CAAC,KAAK,WAAW,IAAI;AAAA,MAC3D,eAAa;AAAA,MAEb;AAAA,4BAAC,SAAI,WAAU,cAAc,eAAK,OAAM;AAAA,QACvC,KAAK,eACJ,oBAAC,SAAI,WAAU,oBAAoB,eAAK,aAAY;AAAA;AAAA;AAAA,EAExD;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAM5B,IAAM,cAIR,CAAC,EAAE,aAAa,QAAQ,SAAS,MACpC,oBAAC,YAAS,aAA0B,QACjC,UACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport { resolveWorkflowStepProps, withDerivedStatus } from './WorkflowStep.helpers';\nimport { StepRow } from './WorkflowStepRow';\nimport type { WorkflowStepItem, WorkflowStepProps } from './WorkflowStep.types';\n\n// Styled Components\nconst StepContainer = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'variant'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n variant: WorkflowStepProps['variant'];\n}>(({ theme, orientation, variant }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n gap: orientation === 'vertical' ? theme.spacing(2) : theme.spacing(1),\n width: '100%',\n position: 'relative',\n \n // Variant-specific styles\n ...(variant === 'minimal' && {\n gap: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n }),\n}));\n\n/**\n * WorkflowStep component for displaying multi-step workflows with visual progression\n */\nexport const WorkflowStep = forwardRef<HTMLDivElement, WorkflowStepProps>((rawProps, ref) => {\n const {\n steps,\n currentStep,\n variant,\n orientation,\n color,\n size,\n showProgress,\n animated,\n interactive,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n onStepClick,\n disabled,\n className,\n style,\n 'data-testid': dataTestId,\n ...other\n } = resolveWorkflowStepProps(rawProps);\n const handleStepClick = useCallback((stepIndex: number, step: WorkflowStepItem) => {\n if (onStepClick && !disabled && !step.disabled) {\n onStepClick(stepIndex, step);\n }\n }, [onStepClick, disabled]);\n\n const stepsWithStatus = useMemo(\n () => withDerivedStatus(steps, currentStep),\n [steps, currentStep],\n );\n\n return (\n <StepContainer\n ref={ref}\n orientation={orientation}\n variant={variant}\n className={className}\n style={style}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={steps.length - 1}\n aria-valuenow={currentStep}\n aria-valuetext={`Step ${currentStep + 1} of ${steps.length}: ${steps[currentStep]?.title}`}\n data-testid={dataTestId}\n {...other}\n >\n {stepsWithStatus.map((step, index) => (\n <StepRow\n key={index}\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n orientation={orientation}\n variant={variant}\n color={color}\n size={size}\n showNumbers={showNumbers}\n showIcons={showIcons}\n showProgress={showProgress}\n completedIcon={completedIcon}\n errorIcon={errorIcon}\n interactive={interactive}\n animated={animated}\n disabled={disabled}\n onClick={handleStepClick}\n dataTestId={dataTestId}\n />\n ))}\n </StepContainer>\n );\n});\n\nWorkflowStep.displayName = 'WorkflowStep';\n\nexport default WorkflowStep;"],"mappings":";;;;;;;;;AAAA,OAAO,SAAS;AAChB,SAAS,cAAc;AACvB,SAAgB,YAAY,aAAa,eAAe;AA8EhD;AAvER,IAAM,gBAAgB,OAAO,KAAK;AAAA,EAChC,mBAAmB,CAAC,SAAS,CAAC,CAAC,eAAe,SAAS,EAAE,SAAS,IAAc;AAClF,CAAC,EAGE,CAAC,EAAE,OAAO,aAAa,QAAQ,OAAO;AAAA,EACvC,SAAS;AAAA,EACT,eAAe,gBAAgB,aAAa,WAAW;AAAA,EACvD,YAAY,gBAAgB,aAAa,eAAe;AAAA,EACxD,KAAK,gBAAgB,aAAa,MAAM,QAAQ,CAAC,IAAI,MAAM,QAAQ,CAAC;AAAA,EACpE,OAAO;AAAA,EACP,UAAU;AAAA;AAAA,EAGV,GAAI,YAAY,aAAa;AAAA,IAC3B,KAAK,gBAAgB,aAAa,MAAM,QAAQ,CAAC,IAAI,MAAM,QAAQ,GAAG;AAAA,EACxE;AACF,EAAE;AAKK,IAAM,eAAe,WAA8C,CAAC,UAAU,QAAQ;AAC3F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,GAAG;AAAA,EACL,IAAI,yBAAyB,QAAQ;AACrC,QAAM,kBAAkB,YAAY,CAAC,WAAmB,SAA2B;AACjF,QAAI,eAAe,CAAC,YAAY,CAAC,KAAK,UAAU;AAC9C,kBAAY,WAA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