@vectara/vectara-ui 9.1.1 → 9.1.2
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.
|
@@ -17,8 +17,8 @@ import { VuiSpinner } from "../spinner/Spinner";
|
|
|
17
17
|
import { VuiStep } from "./Step";
|
|
18
18
|
const statusToColor = {
|
|
19
19
|
complete: "success",
|
|
20
|
-
current: "
|
|
21
|
-
incomplete: "
|
|
20
|
+
current: "primary",
|
|
21
|
+
incomplete: "subdued",
|
|
22
22
|
disabled: "neutral",
|
|
23
23
|
warning: "warning",
|
|
24
24
|
danger: "danger",
|
|
@@ -30,6 +30,7 @@ export const VuiSteps = (_a) => {
|
|
|
30
30
|
[`vuiSteps--${size}`]: size
|
|
31
31
|
});
|
|
32
32
|
const totalSteps = steps.length;
|
|
33
|
+
const currentStepIndex = steps.findIndex((step) => step.status === "current");
|
|
33
34
|
return (_jsx("div", Object.assign({ className: classes }, rest, { children: _jsx("div", Object.assign({ className: "vuiSteps__container" }, { children: steps.map((step, index) => {
|
|
34
35
|
var _a, _b, _c;
|
|
35
36
|
const isFirstStep = index === 0;
|
|
@@ -40,7 +41,7 @@ export const VuiSteps = (_a) => {
|
|
|
40
41
|
});
|
|
41
42
|
const icon = (_a = step.icon) !== null && _a !== void 0 ? _a : (step.status === "complete" ? (_jsx(BiCheck, {})) : step.status === "danger" ? (_jsx(BiError, {})) : step.status === "warning" ? (_jsx(BiSolidHand, {})) : null);
|
|
42
43
|
return (_jsxs("div", Object.assign({ className: stepContainerClasses }, { children: [!isLastStep && (_jsx("div", { className: classNames("vuiSteps__connector", {
|
|
43
|
-
"vuiSteps__connector--complete":
|
|
44
|
-
}) })), _jsx(VuiStep, { title: step.title, status: step.status, onClick: step.onClick, stepNode: step.status === "loading" ? (_jsx("div", { children: _jsx(VuiSpinner, {}) })) : icon ? (_jsx(VuiIcon, Object.assign({ color: statusToColor[(_b = step.status) !== null && _b !== void 0 ? _b : "
|
|
44
|
+
"vuiSteps__connector--complete": index < currentStepIndex
|
|
45
|
+
}) })), _jsx(VuiStep, { title: step.title, status: step.status, onClick: step.onClick, stepNode: step.status === "loading" ? (_jsx("div", { children: _jsx(VuiSpinner, {}) })) : icon ? (_jsx(VuiIcon, Object.assign({ color: statusToColor[(_b = step.status) !== null && _b !== void 0 ? _b : "incomplete"], size: size === "xs" ? undefined : size }, { children: icon }))) : size === "xs" ? null : (_jsx("span", Object.assign({ className: "vuiStep__numberText" }, { children: (_c = step.value) !== null && _c !== void 0 ? _c : index + 1 }))), size: size, subTitle: step.subTitle })] }), index));
|
|
45
46
|
}) })) })));
|
|
46
47
|
};
|