Skip to content

Commit

Permalink
[docs-infra] Add a general round of polish to the API content display (
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal authored and Rich Bustos committed Aug 7, 2023
1 parent ad158e4 commit 82e84bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
1 change: 0 additions & 1 deletion docs/src/modules/components/ApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ import { ${pageContent.name} } from '${source}';`}
componentName={pageContent.name}
classDescriptions={classDescriptions}
/>
<Divider />
</React.Fragment>
) : null}
<DesignInfo />
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/components/ApiPage/ApiItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
},
'& .MuiApi-item-description': {
padding: '4px 6px',
flexGrow: 1,
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
Expand All @@ -77,9 +76,10 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
placeItems: 'end',
},
'& .MuiApi-item-note': {
padding: '2px 6px',
paddingTop: 5,
fontSize: 11,
letterSpacing: '1px',
lineHeight: 1.6,
textTransform: 'uppercase',
color: `var(--muidocs-palette-success-800, ${lightTheme.palette.success[800]})`,
fontWeight: theme.typography.fontWeightBold,
Expand Down Expand Up @@ -135,7 +135,7 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
backgroundColor: `var(--muidocs-palette-primary-50, ${lightTheme.palette.primary[50]})`,
},
'&>hr': {
margin: '20px 0',
margin: '18px 0',
},
}),
({ theme }) => ({
Expand Down
25 changes: 8 additions & 17 deletions docs/src/modules/components/ApiPage/SlotsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ const StyledApiItem = styled(ApiItem)(
'.slot-classname, .slot-default-element': {
...theme.typography.body2,
fontWeight: theme.typography.fontWeightSemiBold,
},
'& .slot-description-title': {
...theme.typography.body2,
fontWeight: theme.typography.fontWeightSemiBold,
paddingRight: 5,
whiteSpace: 'nowrap',
marginBottom: 8,
},
}),
({ theme }) => ({
Expand Down Expand Up @@ -50,26 +45,22 @@ export default function SlotsList(props: SlotsListProps) {
note=""
type="slots"
>
{slotDescriptions[name] && (
<p
dangerouslySetInnerHTML={{
__html: slotDescriptions[name] || '',
}}
/>
)}
<p className="slot-default-element">
<span>{t('api-docs.default')}:</span> <code className="Api-code">{defaultValue}</code>
</p>

{className && (
<p className="slot-classname">
<span>{t('api-docs.globalClass')}:</span>{' '}
<code dangerouslySetInnerHTML={{ __html: className }} className="Api-code" />
</p>
)}
{slotDescriptions[name] && (
<p>
<span className="slot-description-title">{t('api-docs.description')}:</span>{' '}
<span
dangerouslySetInnerHTML={{
__html: slotDescriptions[name] || '',
}}
/>
</p>
)}
</StyledApiItem>
);
})}
Expand Down
1 change: 0 additions & 1 deletion docs/src/modules/components/PropertiesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const StyledApiItem = styled(ApiItem)(
backgroundColor: `var(--muidocs-palette-primaryDark-800, ${lightTheme.palette.primaryDark[800]})`,
},
},
marginBottom: 36,
}),
({ theme }) => ({
[`:where(${theme.vars ? '[data-mui-color-scheme="dark"]' : '.mode-dark'}) &`]: {
Expand Down

0 comments on commit 82e84bd

Please sign in to comment.