@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
71 lines • 4.34 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasePrimitive = exports.PRIMITIVE_PROPS = void 0;
const react_1 = __importDefault(require("react"));
const Slot_1 = require("../../utils/components/slot/Slot");
const helpers_1 = require("../../utils/helpers");
const css_1 = require("../utilities/css");
exports.PRIMITIVE_PROPS = [
"padding",
"paddingInline",
"paddingBlock",
"margin",
"marginInline",
"marginBlock",
"width",
"minWidth",
"maxWidth",
"height",
"minHeight",
"maxHeight",
"position",
"inset",
"top",
"right",
"bottom",
"left",
"overflow",
"overflowX",
"overflowY",
"flexBasis",
"flexGrow",
"flexShrink",
"gridColumn",
];
const BasePrimitive = ({ children, className, padding, paddingInline, paddingBlock, margin, marginInline, marginBlock, width, minWidth, maxWidth, height, minHeight, maxHeight, position, inset, top, right, left, bottom, overflow, overflowX, overflowY, flexBasis, flexGrow, flexShrink, gridColumn, }) => {
const style = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, css_1.getResponsiveProps)("r", "p", "space", padding)), (0, css_1.getResponsiveProps)("r", "pi", "space", paddingInline)), (0, css_1.getResponsiveProps)("r", "pb", "space", paddingBlock)), (0, css_1.getResponsiveProps)("r", "m", "space", margin)), (0, css_1.getResponsiveProps)("r", "mi", "space", marginInline)), (0, css_1.getResponsiveProps)("r", "mb", "space", marginBlock)), (0, css_1.getResponsiveValue)("r", "w", width)), (0, css_1.getResponsiveValue)("r", "minw", minWidth)), (0, css_1.getResponsiveValue)("r", "maxw", maxWidth)), (0, css_1.getResponsiveValue)("r", "h", height)), (0, css_1.getResponsiveValue)("r", "minh", minHeight)), (0, css_1.getResponsiveValue)("r", "maxh", maxHeight)), (0, css_1.getResponsiveValue)("r", "position", position)), (0, css_1.getResponsiveProps)("r", "inset", "space", inset)), (0, css_1.getResponsiveProps)("r", "top", "space", top)), (0, css_1.getResponsiveProps)("r", "right", "space", right)), (0, css_1.getResponsiveProps)("r", "bottom", "space", bottom)), (0, css_1.getResponsiveProps)("r", "left", "space", left)), (0, css_1.getResponsiveValue)("r", "overflow", overflow)), (0, css_1.getResponsiveValue)("r", "overflowx", overflowX)), (0, css_1.getResponsiveValue)("r", "overflowy", overflowY)), (0, css_1.getResponsiveValue)("r", "flex-basis", flexBasis)), (0, css_1.getResponsiveValue)("r", "flex-grow", flexGrow)), (0, css_1.getResponsiveValue)("r", "flex-shrink", flexShrink)), (0, css_1.getResponsiveValue)("r", "grid-column", gridColumn));
return (react_1.default.createElement(Slot_1.Slot, { className: (0, helpers_1.cl)({
className,
"aksel-r-p": padding,
"aksel-r-pi": paddingInline,
"aksel-r-pb": paddingBlock,
"aksel-r-m": margin,
"aksel-r-mi": marginInline,
"aksel-r-mb": marginBlock,
"aksel-r-w": width,
"aksel-r-minw": minWidth,
"aksel-r-maxw": maxWidth,
"aksel-r-h": height,
"aksel-r-minh": minHeight,
"aksel-r-maxh": maxHeight,
"aksel-r-position": position,
"aksel-r-inset": inset,
"aksel-r-top": top,
"aksel-r-right": right,
"aksel-r-bottom": bottom,
"aksel-r-left": left,
"aksel-r-overflow": overflow,
"aksel-r-overflowx": overflowX,
"aksel-r-overflowy": overflowY,
"aksel-r-flex-basis": flexBasis,
"aksel-r-flex-grow": flexGrow,
"aksel-r-flex-shrink": flexShrink,
"aksel-r-grid-column": gridColumn,
}), style: style }, children));
};
exports.BasePrimitive = BasePrimitive;
exports.default = exports.BasePrimitive;
//# sourceMappingURL=BasePrimitive.js.map