@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
47 lines (43 loc) • 1.31 kB
JavaScript
import { filterUndefined } from "../utils/object.js";
import { cs } from "../utils/styles.js";
import styled from "../core/styled.js";
import vui from "../core/vui.js";
import { CLASS } from "./stepperConsts.js";
import { StepperProvider } from "./stepperContext.js";
import { useMemo } from "react";
import { jsx } from "react/jsx-runtime";
//#region src/stepper/stepper.tsx
const StepperHorizontalBase = styled.divBox`
display: flex;
overflow: hidden;
width: 100%;
.${CLASS.step}:last-of-type .${CLASS.tail} {
display: none;
}
`;
const StepperVerticalBase = styled.divBox`
width: 100%;
.${CLASS.step}:last-of-type > .${CLASS.tail} {
display: none;
}
`;
const Stepper = vui((props, ref) => {
const { children, className, orientation = "horizontal", size, ...rest } = props;
return /* @__PURE__ */ jsx(StepperProvider, {
value: useMemo(() => filterUndefined({
orientation,
size
}), [orientation, size]),
children: /* @__PURE__ */ jsx(orientation === "vertical" ? StepperVerticalBase : StepperHorizontalBase, {
className: cs("vui-stepper", className),
ref,
...rest,
children
})
});
});
Stepper.displayName = "Stepper";
//#endregion
export { Stepper, Stepper as default };
globalThis.__vuiVersion__ = "5.3.0-alpha.2"
//# sourceMappingURL=stepper.js.map