UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

40 lines (39 loc) 1.13 kB
import { jsx } from "react/jsx-runtime"; import { Card as Card$1 } from "@mantine/core"; import { forwardRef } from "react"; import { ComponentErrorBoundary } from "../errorBoundary/ComponentErrorBoundary.js"; import { useCommonLayoutStyle } from "../layout/useCommonLayoutStyle.js"; const Card = /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: DISPLAY_NAME, children: /* @__PURE__ */ jsx(CardWithoutRef, { ...props, innerRef: ref }) })); const DISPLAY_NAME = "Card"; Card.displayName = DISPLAY_NAME; const CardWithoutRef = ({ children, withBorder = true, p = "lg", radius = "lg", className, style, width, height, grow, ...props }) => { const { innerRef, ...restProps } = props; const { classes: layoutClasses, cx } = useCommonLayoutStyle({ width, height, grow }); return /* @__PURE__ */ jsx(Card$1, { className: cx(layoutClasses.style, className), style, unstyled: true, withBorder, p, radius, ref: innerRef, ...restProps, children }); }; export { Card, CardWithoutRef }; //# sourceMappingURL=Card.js.map