@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.
48 lines (47 loc) • 1.21 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { createStyles, Title as Title$1 } from "@mantine/core";
import { ComponentErrorBoundary } from "../errorBoundary/ComponentErrorBoundary.js";
import { useCommonLayoutStyle } from "../layout/useCommonLayoutStyle.js";
const titleOrderToGrayShade = {
1: 9,
2: 8,
3: 8,
4: 7,
5: 7,
6: 7
};
const useStyles = createStyles((theme, {
order
}) => ({
root: {
...theme.other.typography.headingPreset[order],
"&:first-child": {
marginTop: 0
}
}
}));
const TitleComponent = ({
className,
style,
order = 1,
color,
...props
}) => {
const {
classes,
cx
} = useStyles({
order
});
const {
classes: layoutClasses
} = useCommonLayoutStyle(props);
return /* @__PURE__ */ jsx(Title$1, { order, style, className: cx(classes.root, layoutClasses.style, className), color: color ?? `gray.${titleOrderToGrayShade[order]}`, ...props });
};
const Title = (props) => /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Title.displayName, children: /* @__PURE__ */ jsx(TitleComponent, { ...props }) });
Title.displayName = "Title";
export {
Title,
TitleComponent
};
//# sourceMappingURL=Title.js.map