Skip to content

Commit

Permalink
Merge pull request #846 from etn-ccis/fix/blui-5257-remove-tabs
Browse files Browse the repository at this point in the history
update playground replace tabs with spaces
  • Loading branch information
surajeaton authored Feb 8, 2024
2 parents e5bb69a + 1f7e063 commit 1696092
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const generateSnippet: CodeSnippetFunction = (data) =>
</Toolbar>
</AppBar>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ')
.replace(/^<AppBar(\s)+\n>/, '<AppBar>');

export const AppBarPlaygroundComponent = (): JSX.Element => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => (
<Box
Expand Down
4 changes: 3 additions & 1 deletion docs/src/componentDocs/Drawer/playground/PlaygroundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
<DrawerBody>
<DrawerNavGroup {...navGroupProps} />
</DrawerBody>
</Drawer>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
</Drawer>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const DrawerPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['open'] })}
>
<Box sx={{ p: 2 }}>Footer Content Here</Box>
</DrawerFooter>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
</DrawerFooter>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const DrawerFooterPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${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 => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${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 => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${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 => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
`<DrawerRailItem
${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['icon', 'condensed'] })}
${data.icon !== 'undefined' ? `icon={${getIconSnippetWithProps(data.icon as string)}}` : ''}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const DrawerRailItemPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t', skip: ['open'] })}
>
<Box sx={{ p: 2 }}>Subheader Content Here</Box>
</DrawerSubheader>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
</DrawerSubheader>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const DrawerSubheaderPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
}`
: ''
}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const EmptyStatePlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
4 changes: 3 additions & 1 deletion docs/src/componentDocs/Hero/playground/PlaygroundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
: ''
}
}}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const HeroPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
${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 => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ const ListItemTagPreview: PreviewComponent = ({ data }) => {
const generateSnippet: CodeSnippetFunction = (data) =>
`<ListItemTag
${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t' })}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const ListItemTagPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
icon={<Cloud />}
/>
</List>
</ScoreCard>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
</ScoreCard>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const ScoreCardPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const ThreeLinerPreview: PreviewComponent = ({ data }) => {
const generateSnippet: CodeSnippetFunction = (data) =>
`<ThreeLiner
${getPropsToString(getPropsMapping(data, inputConfig), { join: '\n\t' })}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const ThreeLinerPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
},
],
}]}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const ToolbarMenuPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ const generateSnippet: CodeSnippetFunction = (data) =>
],
},
]}
/>`.replace(/^\s*$(?:\r\n?|\n)/gm, '');
/>`
.replace(/^\s*$(?:\r\n?|\n)/gm, '')
.replace(/(?:^|)( {4}|\t)/gm, ' ');

export const UserMenuPlaygroundComponent = (): JSX.Element => (
<Box
Expand Down

0 comments on commit 1696092

Please sign in to comment.