UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

17 lines 1.17 kB
import React from "react"; import { cl } from "../../utils/helpers/index.js"; import { useI18n } from "../../utils/i18n/i18n.hooks.js"; import { ariaLabel, getConditionalClasses } from "../utils/period.js"; const NonClickablePeriod = ({ start, end, status, cropped, direction, left, width, icon, statusLabel, restProps, periodRef, }) => { var _a; const translate = useI18n("Timeline"); return (React.createElement("div", Object.assign({ ref: periodRef }, restProps, { "data-color": (_a = restProps === null || restProps === void 0 ? void 0 : restProps["data-color"]) !== null && _a !== void 0 ? _a : status, className: cl(getConditionalClasses(cropped, direction, status), restProps === null || restProps === void 0 ? void 0 : restProps.className), style: { width: `${width}%`, [direction]: `${left}%`, } }), React.createElement("span", { className: "aksel-timeline__period--inner" }, icon, React.createElement("span", { className: "aksel-sr-only" }, ariaLabel(start, end, status, statusLabel, translate))))); }; export default NonClickablePeriod; //# sourceMappingURL=NonClickablePeriod.js.map