@hhgtech/hhg-components
Version:
Hello Health Group common components
18 lines (15 loc) • 1.04 kB
JavaScript
import { _ as __rest } from './tslib.es6-ea4dfe68.js';
import React__default from 'react';
import { useMantineTheme } from '@mantine/core';
import { T as Text } from './index-9f5659e8.js';
/**
* @deprecated Consider to use import { Title } from '@mantine/core'
* if need to use custom tag, use Text from mantine instead
*/
const Heading = (_a) => {
var { as, tag, color, fontWeight, dataEventCategory, dataEventAction, dataEventLabel } = _a, rest = __rest(_a, ["as", "tag", "color", "fontWeight", "dataEventCategory", "dataEventAction", "dataEventLabel"]);
const asTag = as || tag;
const theme = useMantineTheme();
return (React__default.createElement(Text, Object.assign({ as: asTag, color: color || theme.colors.gray[8], "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel, weight: fontWeight === 'semibold' ? 'semiBold' : 'bold', size: tag, "data-size": tag, "data-font-weight": fontWeight || undefined }, rest)));
};
export { Heading as H };