@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
42 lines (41 loc) • 1.39 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Anchor, Tooltip, factory, useProps } from '@mantine/core';
import { InfoToken } from '../../InfoToken/InfoToken.js';
import { useHeaderContext } from '../Header.context.js';
const defaultProps = {
position: 'right',
children: /*#__PURE__*/ _jsx(InfoToken.Question, {})
};
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
})
});
});
HeaderDocAnchor.displayName = 'Header.DocAnchor';
//# sourceMappingURL=HeaderDocAnchor.js.map