@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
18 lines • 1.21 kB
JavaScript
import React from "react";
import { useRenameCSS } from "../../theme/Theme.js";
import { useI18n } from "../../util/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");
const { cn } = useRenameCSS();
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: cn(getConditionalClasses(cropped, direction, status), restProps === null || restProps === void 0 ? void 0 : restProps.className), style: {
width: `${width}%`,
[direction]: `${left}%`,
} }),
React.createElement("span", { className: cn("navds-timeline__period--inner") },
icon,
React.createElement("span", { className: cn("navds-sr-only") }, ariaLabel(start, end, status, statusLabel, translate)))));
};
export default NonClickablePeriod;
//# sourceMappingURL=NonClickablePeriod.js.map