import { h } from '@stencil/core'; import { CalloutAsideType, HeadingLevel, HeadingLevelOptions, HeadingContentType, HighlightColours, HighlightColourOptions, } from './callout-aside.interface'; export const isValidHighlightColour = (colour: HighlightColourOptions): colour is HighlightColourOptions => HighlightColours.includes(colour); export const isValidHeadingLevel = (level: HeadingLevelOptions): level is HeadingLevelOptions => HeadingLevel.includes(level); const generateClasses = (type: CalloutAsideType, highlightColor?: HighlightColourOptions) => { const componentType = type === 'callout' ? `ontario-callout` : `ontario-aside`; const borderColor = `ontario-border-highlight--${highlightColor}`; return highlightColor ? `${componentType} ${borderColor}` : `${componentType}`; }; const generateHeading = ( type: CalloutAsideType, headingType: HeadingLevelOptions | undefined, headingContentType: HeadingContentType, headingContent: string, ) => { const headingContentIsHTML = headingContentType === 'html'; switch (headingType) { case 'h2': return headingContentIsHTML ? (
) : ({content}
: