UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

43 lines 1.93 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React from "react"; import { Button } from "../../../button/index.js"; import { Box } from "../../../layout/box/index.js"; import { HStack, Spacer } from "../../../layout/stack/index.js"; import { BodyShort } from "../../../typography/index.js"; /** * TODO * * @see 🏷️ {@link DataActionBarProps} * @example * ```tsx * <DataActionBar numOfSelectedRows={selectedRows.length} onClear={handleClear}> * TODO * </DataActionBar> * ``` */ const DataActionBar = React.forwardRef((_a, forwardRef) => { var { children, numOfSelectedRows, onClear } = _a, rest = __rest(_a, ["children", "numOfSelectedRows", "onClear"]); return (React.createElement(Box, { asChild: true, borderWidth: "1", borderRadius: "16", borderColor: "neutral", background: "raised", padding: "space-16", "data-color": "neutral" }, React.createElement(HStack, Object.assign({ gap: "space-16", align: "center", ref: forwardRef }, rest), React.createElement(BodyShort, { textColor: "subtle" }, numOfSelectedRows, " rad", numOfSelectedRows > 1 ? "er" : "", " valgt"), React.createElement(Button, { variant: "secondary", size: "small", onClick: onClear }, "Nullstill valg"), React.createElement(Spacer, null), children))); }); export default DataActionBar; export { DataActionBar }; //# sourceMappingURL=DataActionBarRoot.js.map