UNPKG

@yamada-ui/stepper

Version:

Yamada UI stepper component

40 lines (38 loc) 1.2 kB
"use client" import { useStep, useStepperContext } from "./chunk-CGZP2FXU.mjs"; // src/step.tsx import { forwardRef, ui } from "@yamada-ui/core"; import { createContext, cx, dataAttr } from "@yamada-ui/utils"; import { jsx } from "react/jsx-runtime"; var [StepProvider, useStepContext] = createContext({ name: "StepperContext", errorMessage: `useStepContext returned is 'undefined'. Seems you forgot to wrap the components in "<Step />"` }); var Step = forwardRef( ({ className, ...rest }, ref) => { const { orientation, showLastSeparator, styles } = useStepperContext(); const { index, isFirst, isLast, status, getStepProps } = useStep(); const css = { ...styles.step }; return /* @__PURE__ */ jsx(StepProvider, { value: { index, isFirst, isLast, status }, children: /* @__PURE__ */ jsx( ui.div, { className: cx("ui-step", className), "data-orientation": orientation, "data-stretch": dataAttr(showLastSeparator), __css: css, ...getStepProps(rest, ref) } ) }); } ); Step.displayName = "Step"; Step.__ui__ = "Step"; export { StepProvider, useStepContext, Step }; //# sourceMappingURL=chunk-ABUIE4CG.mjs.map