Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Add a collapsible list & table views to the API content display #38265

Merged
merged 65 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ba64754
docs api colapse experiment
alexfauquette Aug 1, 2023
12f7913
align
alexfauquette Aug 1, 2023
1e9ceae
Merge remote-tracking branch 'upstream/master' into test-expendable-docs
alexfauquette Aug 4, 2023
d6d197a
experiment
alexfauquette Aug 7, 2023
435c1ce
save state
alexfauquette Aug 16, 2023
35360b6
typo fix
alexfauquette Aug 16, 2023
589c9e9
make design okish
alexfauquette Aug 16, 2023
ab6e8bb
fix hydratation missmatch
alexfauquette Aug 16, 2023
262116a
send analytics
alexfauquette Aug 16, 2023
f2a21ca
fix lint
alexfauquette Aug 16, 2023
a887eae
Some cleaning
alexfauquette Aug 16, 2023
d3f7db1
joy add space in class name
alexfauquette Aug 16, 2023
0f8d075
continue migration
alexfauquette Aug 16, 2023
b4db787
fix lint
alexfauquette Aug 17, 2023
c80c694
docs:api
alexfauquette Aug 17, 2023
9fce708
continue reorganisation
alexfauquette Aug 17, 2023
edf1aa4
add API to the experiment navigation
alexfauquette Aug 17, 2023
1ce5f7a
Merge remote-tracking branch 'upstream/master' into test-expendable-docs
alexfauquette Sep 26, 2023
16d6c19
introduce table
alexfauquette Sep 26, 2023
f1f785a
fix daa grid
alexfauquette Sep 26, 2023
0b036c1
toggle button edits (styles + add tooltip wrapper)
danilo-leal Sep 29, 2023
19f2987
list design refinements
danilo-leal Sep 29, 2023
d67b1a8
start tweaking the table design
danilo-leal Sep 29, 2023
fa1e45d
Fix highlight
alexfauquette Oct 4, 2023
ed5230b
Move Css section
alexfauquette Oct 4, 2023
0e13164
move classes
alexfauquette Oct 4, 2023
b87d933
Move slots
alexfauquette Oct 4, 2023
f537b15
Add a bit od space to simplify pages structure reading
alexfauquette Oct 4, 2023
ec6d181
move sections components into sections folder
alexfauquette Oct 4, 2023
ebb0d1f
remove relative imports
alexfauquette Oct 4, 2023
9bc9625
prettier
alexfauquette Oct 4, 2023
f172587
fix build
alexfauquette Oct 4, 2023
6a9a642
move files in their respective folders
alexfauquette Oct 4, 2023
8376815
move early returns
alexfauquette Oct 4, 2023
1c8a3e9
fix typo
alexfauquette Oct 4, 2023
3ef9fbf
add styles to the className list title
danilo-leal Oct 5, 2023
b2631db
CSS tables design adjustments
danilo-leal Oct 5, 2023
4305c16
prop tables design adjustments
danilo-leal Oct 5, 2023
ac3e524
prop and CSS table adjustments
danilo-leal Oct 5, 2023
1bda76d
experiment with min widths for columns
danilo-leal Oct 5, 2023
db1a721
adjustments to the alert within the description column
danilo-leal Oct 5, 2023
9c5165c
alert icon fine-tune spacing tweak
danilo-leal Oct 5, 2023
f9f9e24
add hover state to the table rows
danilo-leal Oct 6, 2023
02eabe6
slots table and list tweaks
danilo-leal Oct 10, 2023
2f442bc
classes table tweaks
danilo-leal Oct 10, 2023
d17de0a
standardize color usage
danilo-leal Oct 10, 2023
84cddad
tiny color polish
danilo-leal Oct 10, 2023
9ca5ca6
Merge remote-tracking branch 'upstream/master' into test-expendable-docs
alexfauquette Oct 10, 2023
4e5ad85
renaming
alexfauquette Oct 10, 2023
af262ca
Ensure their is no typo in the keys
alexfauquette Oct 10, 2023
06d0c45
update analytics
alexfauquette Oct 10, 2023
a0a1b93
fixes
alexfauquette Oct 10, 2023
3815c31
Merge branch 'test-expendable-docs' of github.com:alexfauquette/mater…
alexfauquette Oct 10, 2023
7b4f0e1
lint fix
alexfauquette Oct 10, 2023
504d7f4
use tags accepted by GA
alexfauquette Oct 11, 2023
5f88a02
alert tweaks and other fixes
danilo-leal Oct 12, 2023
2fc78f8
title spacing
danilo-leal Oct 12, 2023
5bf0f91
ref hint alert tweak + remove unnecessary divider
danilo-leal Oct 12, 2023
6decf87
align it to the baseline
danilo-leal Oct 12, 2023
de6e28f
fix slot name in the table view weight
danilo-leal Oct 12, 2023
50d98c7
ensure design consistency between table and list view
danilo-leal Oct 12, 2023
20e3f65
further consistency between all "Default" items design
danilo-leal Oct 12, 2023
96a5a08
fix lint
danilo-leal Oct 12, 2023
980dfb2
remove unnecessary divider on the Hooks API page
danilo-leal Oct 12, 2023
e8bdb3f
fix lint
alexfauquette Oct 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
alert tweaks and other fixes
  • Loading branch information
danilo-leal committed Oct 12, 2023
commit 5f88a0223808908becb9f5ede60c05db238c89fb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const Root = styled('div')<{ ownerState: { type?: DescriptionType } }>(
fontWeight: theme.typography.fontWeightMedium,
border: '1px solid',
borderColor: `var(--muidocs-palette-warning-300, ${lightTheme.palette.warning[300]})`,
borderRadius: 8,
borderRadius: 12,
backgroundColor: `var(--muidocs-palette-warning-50, ${lightTheme.palette.warning[50]})`,
color: `var(--muidocs-palette-warning-800, ${lightTheme.palette.warning[800]})`,
marginBottom: 16,
Expand Down
39 changes: 14 additions & 25 deletions docs/src/modules/components/ApiPage/list/PropertiesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { styled } from '@mui/material/styles';
import Alert from '@mui/material/Alert';
import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import {
brandingDarkTheme as darkTheme,
Expand Down Expand Up @@ -157,18 +158,12 @@ export default function PropertiesList(props: PropertiesListProps) {
{requiresRef && (
<Alert
severity="warning"
sx={{ mb: 1, py: 0 }}
iconMapping={{
warning: (
<svg
width="14"
height="12"
viewBox="0 0 14 12"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M1.98012 11.9997H12.0201C13.0468 11.9997 13.6868 10.8864 13.1735 9.99971L8.15345 1.32638C7.64012 0.43971 6.36012 0.43971 5.84679 1.32638L0.826788 9.99971C0.313455 10.8864 0.953455 11.9997 1.98012 11.9997ZM7.00012 7.33304C6.63345 7.33304 6.33345 7.03304 6.33345 6.66638V5.33304C6.33345 4.96638 6.63345 4.66638 7.00012 4.66638C7.36679 4.66638 7.66679 4.96638 7.66679 5.33304V6.66638C7.66679 7.03304 7.36679 7.33304 7.00012 7.33304ZM7.66679 9.99971H6.33345V8.66638H7.66679V9.99971Z" />
</svg>
),
icon={<WarningRoundedIcon fontSize="small" />}
sx={{
'& .MuiAlert-icon': {
height: 'fit-content',
py: '8px',
},
}}
>
<span
Expand All @@ -190,20 +185,14 @@ export default function PropertiesList(props: PropertiesListProps) {
))}
{isDeprecated && (
<Alert
severity="warning"
sx={{ mb: 1, py: 0 }}
className="MuiApi-collapsible"
iconMapping={{
warning: (
<svg
width="14"
height="12"
viewBox="0 0 14 12"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M1.98012 11.9997H12.0201C13.0468 11.9997 13.6868 10.8864 13.1735 9.99971L8.15345 1.32638C7.64012 0.43971 6.36012 0.43971 5.84679 1.32638L0.826788 9.99971C0.313455 10.8864 0.953455 11.9997 1.98012 11.9997ZM7.00012 7.33304C6.63345 7.33304 6.33345 7.03304 6.33345 6.66638V5.33304C6.33345 4.96638 6.63345 4.66638 7.00012 4.66638C7.36679 4.66638 7.66679 4.96638 7.66679 5.33304V6.66638C7.66679 7.03304 7.36679 7.33304 7.00012 7.33304ZM7.66679 9.99971H6.33345V8.66638H7.66679V9.99971Z" />
</svg>
),
severity="warning"
icon={<WarningRoundedIcon fontSize="small" />}
sx={{
'& .MuiAlert-icon': {
height: 'fit-content',
py: '8px',
},
}}
>
{t('api-docs.deprecated')}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ApiPage/list/SlotsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import ExpendableApiItem, {
const StyledApiItem = styled(ExpendableApiItem)(
({ theme }) => ({
'.slot-classname, .slot-default-element': {
marginBottom: 8,
'& .prop-list-title': {
...theme.typography.body2,
fontWeight: theme.typography.fontWeightSemiBold,
color: theme.palette.text.primary,
},
marginBottom: 8,
},
'& .default-slot-value': {
...theme.typography.caption,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/ApiPage/table/CSSTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const StyledTable = styled('table')(
},
},
'& .MuiApi-table-rule-name': {
fontWeight: theme.typography.fontWeightSemiBold,
fontFamily: theme.typography.fontFamilyCode,
fontWeight: theme.typography.fontWeightSemiBold,
fontSize: theme.typography.pxToRem(13),
color: `var(--muidocs-palette-primary-700, ${lightTheme.palette.primary[700]})`,
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
},
'& .MuiApi-table-className': {
padding: '0 4px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const StyledTable = styled('table')(
fontFamily: theme.typography.fontFamilyCode,
fontWeight: theme.typography.fontWeightSemiBold,
fontSize: theme.typography.pxToRem(13),
color: `var(--muidocs-palette-primary-700, ${lightTheme.palette.primary[700]})`,
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
},
'& .MuiApi-table-item-type': {
padding: '0 4px',
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ApiPage/table/SlotsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const StyledTable = styled('table')(
fontFamily: theme.typography.fontFamilyCode,
fontWeight: theme.typography.fontWeightSemiBold,
fontSize: theme.typography.pxToRem(13),
color: `var(--muidocs-palette-primary-700, ${lightTheme.palette.primary[700]})`,
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
},
'& .class-name': {
padding: '0 4px',
Expand Down