import * as React from 'react'; import { css } from '@patternfly/react-styles'; import styles from '@patternfly/react-styles/css/components/Brand/brand'; import { setBreakpointCssVars } from '../../helpers'; import cssBrandHeight from '@patternfly/react-tokens/dist/esm/c_brand_Height'; import cssBrandWidth from '@patternfly/react-tokens/dist/esm/c_brand_Width'; export interface BrandProps extends React.DetailedHTMLProps, HTMLImageElement> { /** Transforms the Brand into a element from an element. Container for child elements. */ children?: React.ReactNode; /** Additional classes added to the either type of Brand. */ className?: string; /** Attribute that specifies the URL of a Brand. For a Brand this specifies the fallback URL. */ src?: string; /** Attribute that specifies the alt text of a Brand. For a Brand this specifies the fallback alt text. */ alt: string; /** Widths at various breakpoints for a Brand. */ widths?: { default?: string; sm?: string; md?: string; lg?: string; xl?: string; '2xl'?: string; }; /** Heights at various breakpoints for a Brand. */ heights?: { default?: string; sm?: string; md?: string; lg?: string; xl?: string; '2xl'?: string; }; } export const Brand: React.FunctionComponent = ({ className = '', src = '', alt, children, widths, heights, style, ...props }: BrandProps) => { let responsiveStyles; if (widths !== undefined) { responsiveStyles = { ...setBreakpointCssVars(widths, cssBrandWidth.name) }; } if (heights !== undefined) { responsiveStyles = { ...responsiveStyles, ...setBreakpointCssVars(heights, cssBrandHeight.name) }; } return ( /** the brand component currently contains no styling the 'pf-v6-c-brand' string will be used for the className */ children !== undefined ? ( {children} {alt} ) : ( {alt} ) ); }; Brand.displayName = 'Brand';