Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static className = 'ui-text'
static displayName = 'Text'
static propTypes = {
...commonPropTypes.createCommon({ color: true }),
atMention: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['me'])]),
disabled: PropTypes.bool,
error: PropTypes.bool,
important: PropTypes.bool,
size: customPropTypes.size,
weight: PropTypes.oneOf(['light', 'semilight', 'regular', 'semibold', 'bold']),
success: PropTypes.bool,
temporary: PropTypes.bool,
align: customPropTypes.align,
timestamp: PropTypes.bool,
truncated: PropTypes.bool,
}
static defaultProps = {
as: 'span',
}
renderComponent({ accessibility, ElementType, classes, unhandledProps }): React.ReactNode {
const { children, content } = this.props
return (
class Header extends UIComponent, any> {
static displayName = 'Header'
static className = 'ui-header'
static slotClassNames: HeaderSlotClassNames = {
description: `${Header.className}__description`,
}
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({ color: true }),
description: customPropTypes.itemShorthand,
align: customPropTypes.align,
rtlAttributes: PropTypes.func,
}
static defaultProps = {
as: 'h1',
}
static Description = HeaderDescription
renderComponent({ accessibility, ElementType, classes, variables: v, unhandledProps }) {
const { children, description, content } = this.props
const hasChildren = childrenExist(children)
const contentElement = childrenExist(children) ? children : content
return (