@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
43 lines (42 loc) • 1.37 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { QuestionSize16Px } from '@coveord/plasma-react-icons';
import { Anchor, Tooltip, factory, useProps } from '@mantine/core';
import { useHeaderContext } from '../Header.context';
const defaultProps = {
position: 'right',
children: /*#__PURE__*/ _jsx(QuestionSize16Px, {
height: 16
})
};
export const HeaderDocAnchor = factory((_props, ref)=>{
const props = useProps('PlasmaHeaderActions', defaultProps, _props);
const { className, classNames, styles, style, children, label, position, vars, ...others } = props;
const ctx = useHeaderContext();
return /*#__PURE__*/ _jsx(Tooltip, {
label: label,
disabled: !label,
position: position,
classNames: {
tooltip: ctx.getStyles('docAnchorTooltip', {
classNames,
styles,
props
}).className
},
children: /*#__PURE__*/ _jsx(Anchor, {
ref: ref,
inline: true,
target: "_blank",
...ctx.getStyles('docAnchor', {
classNames,
styles,
props,
style,
className
}),
...others,
children: children
})
});
});
//# sourceMappingURL=HeaderDocAnchor.js.map