UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

61 lines (60 loc) 2.24 kB
"use client"; import { getRadius } from "../../../core/utils/get-size/get-size.mjs"; import { getThemeColor } from "../../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.mjs"; import { useMantineTheme } from "../../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs"; import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs"; import { factory } from "../../../core/factory/factory.mjs"; import { Box } from "../../../core/Box/Box.mjs"; import { useTimelineContext } from "../Timeline.context.mjs"; import Timeline_module_default from "../Timeline.module.mjs"; import { jsx, jsxs } from "react/jsx-runtime"; //#region packages/@mantine/core/src/components/Timeline/TimelineItem/TimelineItem.tsx const TimelineItem = factory((_props) => { const { classNames, className, style, styles, vars, __active, __align, __lineActive, __vars, bullet, radius, color, lineVariant, children, title, mod, ...others } = useProps("TimelineItem", null, _props); const ctx = useTimelineContext(); const theme = useMantineTheme(); const stylesApiProps = { classNames, styles }; return /* @__PURE__ */ jsxs(Box, { ...ctx.getStyles("item", { ...stylesApiProps, className, style }), mod: [{ "line-active": __lineActive, active: __active }, mod], __vars: { "--tli-radius": radius !== void 0 ? getRadius(radius) : void 0, "--tli-color": color ? getThemeColor(color, theme) : void 0, "--tli-border-style": lineVariant || void 0 }, ...others, children: [/* @__PURE__ */ jsx(Box, { ...ctx.getStyles("itemBullet", stylesApiProps), mod: { "with-child": !!bullet, align: __align, active: __active }, children: bullet }), /* @__PURE__ */ jsxs("div", { ...ctx.getStyles("itemBody", stylesApiProps), children: [title && /* @__PURE__ */ jsx("div", { ...ctx.getStyles("itemTitle", stylesApiProps), children: title }), /* @__PURE__ */ jsx("div", { ...ctx.getStyles("itemContent", stylesApiProps), children })] })] }); }); TimelineItem.classes = Timeline_module_default; TimelineItem.displayName = "@mantine/core/TimelineItem"; //#endregion export { TimelineItem }; //# sourceMappingURL=TimelineItem.mjs.map