diff --git a/docs/src/componentDocs/AppBar/playground/PlaygroundPage.tsx b/docs/src/componentDocs/AppBar/playground/PlaygroundPage.tsx index 446994b08..11508d6a3 100644 --- a/docs/src/componentDocs/AppBar/playground/PlaygroundPage.tsx +++ b/docs/src/componentDocs/AppBar/playground/PlaygroundPage.tsx @@ -148,6 +148,7 @@ const generateSnippet: CodeSnippetFunction = (data) => ` .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' ') .replace(/^/, ''); export const AppBarPlaygroundComponent = (): JSX.Element => ( diff --git a/docs/src/componentDocs/ChannelValue/playground/PlaygroundPage.tsx b/docs/src/componentDocs/ChannelValue/playground/PlaygroundPage.tsx index 66377d6d8..3ddafef6e 100644 --- a/docs/src/componentDocs/ChannelValue/playground/PlaygroundPage.tsx +++ b/docs/src/componentDocs/ChannelValue/playground/PlaygroundPage.tsx @@ -133,7 +133,9 @@ const generateSnippet: CodeSnippetFunction = (data) => })}}` : '' } -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const ChannelValuePlaygroundComponent = (): JSX.Element => ( -`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerPlaygroundComponent = (): JSX.Element => ( ${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['open'] })} > Footer Content Here -`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerFooterPlaygroundComponent = (): JSX.Element => ( ${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['icon', 'backgroundImage'] })} ${data.icon && data.icon !== 'undefined' ? `icon={${getIconSnippetWithProps(data.icon as string)}}` : ''} ${data.backgroundImage !== 'undefined' ? `backgroundImage={'../images/${data.backgroundImage as string}.png'}` : ''} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerHeaderPlaygroundComponent = (): JSX.Element => ( ${data.collapseIcon !== 'undefined' ? `collapseIcon={${getIconSnippetWithProps(data.collapseIcon as string)}}` : ''} ${data.expandIcon !== 'undefined' ? `expandIcon={${getIconSnippetWithProps(data.expandIcon as string)}}` : ''} items={navGroupItems} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerNavGroupPlaygroundComponent = (): JSX.Element => ( ${data.icon !== 'undefined' ? `icon={${getIconSnippetWithProps(data.icon as string)}}` : ''} ${data.collapseIcon !== 'undefined' ? `collapseIcon={${getIconSnippetWithProps(data.collapseIcon as string)}}` : ''} ${data.expandIcon !== 'undefined' ? `expandIcon={${getIconSnippetWithProps(data.expandIcon as string)}}` : ''} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerNavItemPlaygroundComponent = (): JSX.Element => ( ``.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerRailItemPlaygroundComponent = (): JSX.Element => ( ${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['open'] })} > Subheader Content Here -`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const DrawerSubheaderPlaygroundComponent = (): JSX.Element => ( }` : '' } -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const EmptyStatePlaygroundComponent = (): JSX.Element => ( : '' } }} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const HeroPlaygroundComponent = (): JSX.Element => ( ${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['icon', 'clickable'] })} ${data.icon && data.icon !== 'undefined' ? `icon={${getIconSnippetWithProps(data.icon as string)}}` : ''} ${data.clickable ? `onClick={(): void => {}}` : ``} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const InfoListItemPlaygroundComponent = (): JSX.Element => ( { const generateSnippet: CodeSnippetFunction = (data) => ``.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const ListItemTagPlaygroundComponent = (): JSX.Element => ( icon={} /> -`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const ScoreCardPlaygroundComponent = (): JSX.Element => ( { const generateSnippet: CodeSnippetFunction = (data) => ``.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const ThreeLinerPlaygroundComponent = (): JSX.Element => ( }, ], }]} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const ToolbarMenuPlaygroundComponent = (): JSX.Element => ( ], }, ]} -/>`.replace(/^\s*$(?:\r\n?|\n)/gm, ''); +/>` + .replace(/^\s*$(?:\r\n?|\n)/gm, '') + .replace(/(?:^|)( {4}|\t)/gm, ' '); export const UserMenuPlaygroundComponent = (): JSX.Element => (