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

[website] Adjust site to add Toolpad on the homepage #38604

Merged
merged 37 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
597dd3b
Add ToolpadShowcase component
bharatkashyap Aug 23, 2023
28047d4
Merge branch 'next' of github.com:mui-org/material-ui into toolpad-sh…
bharatkashyap Apr 16, 2024
dc33959
iterating on the overall changes
danilo-leal Apr 22, 2024
3042695
test the new Toolpad logo
danilo-leal Apr 22, 2024
9f0cffa
more iteration on the product suite section
danilo-leal Apr 23, 2024
c794721
run pnpm dedupe
danilo-leal Apr 23, 2024
97e5b9f
Merge branch 'next' into pr/38604
danilo-leal Apr 25, 2024
7aacbdf
exploration in reshaping the Products Suite section to add Toolpad
danilo-leal Apr 26, 2024
989e934
Merge branch 'next' into pr/38604
danilo-leal Apr 29, 2024
2471e02
fix types
danilo-leal Apr 29, 2024
13201ca
Merge branch 'next' into pr/38604
danilo-leal May 1, 2024
41c8c86
tweaks and adjustments to the Showcase-related components
danilo-leal May 1, 2024
f1028a1
adjacent fixes that relate to changes in Showcase container
danilo-leal May 1, 2024
8215cf3
feat: GIF with motion blur and zoom
bharatkashyap May 16, 2024
5a64243
fix: Better GIF
bharatkashyap May 16, 2024
73c0846
fix: Renders as a 1px black line without content
bharatkashyap May 20, 2024
6e38326
Merge branch 'next' of github.com:mui-org/material-ui into toolpad-sh…
bharatkashyap Jun 3, 2024
44ce9dd
fix: Upstream merge
bharatkashyap Jun 3, 2024
c2eaae8
feat: Add hotspots
bharatkashyap Jun 3, 2024
1ae074e
return the changes on the CoreShowcase section
danilo-leal Jun 4, 2024
2c3d2ad
experimenting on the Toolpad section
danilo-leal Jun 4, 2024
1eb7a82
change the design/approach to use Tabs instead; remove Popovers
danilo-leal Jun 11, 2024
1ce8826
Merge branch 'next' into pr/38604
danilo-leal Jun 11, 2024
8d2469a
clean ups
danilo-leal Jun 11, 2024
69161d6
fix tangential components
danilo-leal Jun 11, 2024
b3ae86c
fix colors
danilo-leal Jun 11, 2024
c6dfa6a
Merge branch 'next' into pr/38604
danilo-leal Jul 2, 2024
cb6df69
tackle Jan's comment
danilo-leal Jul 2, 2024
3cf8e55
add descriptions
danilo-leal Jul 2, 2024
6a1e302
remove Toolpad-specific content (save for another PR)
danilo-leal Jul 3, 2024
977be0b
fix layout shift on the product suite section
danilo-leal Jul 3, 2024
b920bde
fix type CI
danilo-leal Jul 3, 2024
cd31cd2
fix loading state layout shift
danilo-leal Jul 3, 2024
77ccc3d
fix links and product switcher section
danilo-leal Jul 4, 2024
db9428c
Merge branch 'next' into pr/38604
danilo-leal Jul 4, 2024
e943350
adjust icons/logos sizes
danilo-leal Jul 4, 2024
e7654a1
fix lint
danilo-leal Jul 4, 2024
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
9 changes: 6 additions & 3 deletions docs/src/components/action/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ const FrameInfo = React.forwardRef<HTMLDivElement, BoxProps>(function FrameInfo(
ref={ref}
{...props}
sx={{
color: '#fff',
p: 2,
overflow: 'clip',
position: 'relative',
colorScheme: 'dark',
color: '#fff',
bgcolor: 'common.black',
border: '1px solid',
borderColor: 'primaryDark.700',
borderTop: 0,
colorScheme: 'dark',
overflow: 'clip',
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12,
...props.sx,
}}
/>
Expand Down
10 changes: 3 additions & 7 deletions docs/src/components/action/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,15 @@ export default function Item({
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
alignItems: { xs: 'start', sm: 'center' },
gap: { xs: 2, sm: 0.5 },
gap: { xs: 2, sm: '14px' },
...props.sx,
}}
>
<Box component="span" sx={{ mr: smallerIconDistance ? 1 : 2, lineHeight: 0 }}>
<Box component="span" sx={{ lineHeight: 0 }}>
{icon}
</Box>
<Box sx={{ flexWrap: 'wrap' }}>
<Typography
component="span"
variant="body2"
sx={{ color: 'text.primary', fontWeight: 'bold', display: 'block' }}
>
<Typography color="text.primary" variant="body2" fontWeight="semiBold">
{title}
</Typography>
{description && (
Expand Down
61 changes: 61 additions & 0 deletions docs/src/components/action/MaterialVsCustomToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import * as React from 'react';
import { alpha } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Button, { buttonClasses } from '@mui/material/Button';

interface MaterialVsCustomToggleProps {
customized: boolean;
setCustomized: React.Dispatch<boolean>;
}

export default function MaterialVsCustomToggle({
customized,
setCustomized,
}: MaterialVsCustomToggleProps) {
return (
<Box
sx={(theme) => ({
position: 'absolute',
top: 0,
left: 0,
right: 0,
p: 1.5,
display: 'flex',
gap: 1,
zIndex: 3,
background: `linear-gradient(to bottom, ${
(theme.vars || theme).palette.common.black
} 70%, transparent)`,
[`& .${buttonClasses.root}`]: {
borderRadius: 99,
padding: '1px 8px',
fontSize: theme.typography.pxToRem(12),
},
'& .MuiButton-outlinedPrimary': {
backgroundColor: alpha(theme.palette.primary[900], 0.5),
},
})}
>
<Button
size="small"
variant="outlined"
color={customized ? 'secondary' : 'primary'}
onClick={() => {
setCustomized(false);
}}
>
Material Design
</Button>
<Button
size="small"
variant="outlined"
color={customized ? 'primary' : 'secondary'}
onClick={() => {
setCustomized(true);
}}
>
Custom theme
</Button>
</Box>
);
}
110 changes: 110 additions & 0 deletions docs/src/components/action/MoreInfoBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import * as React from 'react';
import { alpha } from '@mui/material/styles';
import Box, { BoxProps } from '@mui/material/Box';
import Button from '@mui/material/Button';
import { Link } from '@mui/docs/Link';
import IconButton from '@mui/material/IconButton';
import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded';
import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded';

export function AppearingInfoBox({
appeared,
children,
...props
}: { appeared: boolean; children: React.ReactNode } & BoxProps) {
const [hidden, setHidden] = React.useState(false);
return (
<Box
{...props}
sx={{
position: 'absolute',
bottom: 8,
left: 8,
right: 8,
zIndex: 3,
mx: -1,
background: ({ palette }) => alpha(palette.common.black, 0.9),
borderTop: '1px solid',
borderColor: hidden || !appeared ? 'transparent' : 'primaryDark.700',
transform: hidden || !appeared ? 'translateY(100%)' : 'translateY(0)',
transition: '0.2s',
...props.sx,
}}
>
<IconButton
size="small"
aria-label={hidden ? 'show' : 'hide'}
onClick={() => setHidden((bool) => !bool)}
sx={{
position: 'absolute',
zIndex: 2,
transition: '0.3s',
right: 16,
bottom: '100%',
transform: hidden || !appeared ? 'translateY(-10px)' : 'translateY(50%)',
opacity: appeared ? 1 : 0,
color: '#FFF',
backgroundColor: 'primary.500',
'&:hover': {
backgroundColor: 'primary.800',
},
}}
>
{hidden ? (
<KeyboardArrowUpRounded fontSize="small" />
) : (
<KeyboardArrowDownRounded fontSize="small" />
)}
</IconButton>
<Box sx={{ px: 2, py: 1.5 }}>{children}</Box>
</Box>
);
}

export default function MoreInfoBox({
primaryBtnLabel,
primaryBtnHref,
secondaryBtnLabel,
secondaryBtnHref,
...props
}: {
primaryBtnLabel: string;
primaryBtnHref: string;
secondaryBtnLabel: string;
secondaryBtnHref: string;
} & BoxProps) {
return (
<Box
data-mui-color-scheme="dark"
{...props}
sx={{
p: 1.5,
bottom: 0,
left: 0,
right: 0,
background: ({ palette }) => alpha(palette.primaryDark[800], 0.2),
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
gap: { xs: 1.5, sm: 1 },
borderTop: '1px solid',
borderColor: 'divider',
zIndex: 3,
...props.sx,
}}
>
<Button component={Link} noLinkStyle size="small" variant="contained" href={primaryBtnHref}>
{primaryBtnLabel}
</Button>
<Button
component={Link}
noLinkStyle
size="small"
variant="outlined"
color="secondary"
href={secondaryBtnHref}
>
{secondaryBtnLabel}
</Button>
</Box>
);
}
76 changes: 0 additions & 76 deletions docs/src/components/action/StylingInfo.tsx

This file was deleted.

37 changes: 17 additions & 20 deletions docs/src/components/home/AdvancedShowcase.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import * as React from 'react';
import { DataGrid, GridCellParams, GridRenderEditCellParams, GridColDef } from '@mui/x-data-grid';
import { alpha } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Paper from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';
import ShowcaseContainer from 'docs/src/components/home/ShowcaseContainer';
import ShowcaseContainer, { ShowcaseCodeWrapper } from 'docs/src/components/home/ShowcaseContainer';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import XGridGlobalStyles from 'docs/src/components/home/XGridGlobalStyles';
import MoreInfoBox from 'docs/src/components/action/MoreInfoBox';
import ProgressBar from 'docs/src/components/x-grid/ProgressBar';
import EditProgress from 'docs/src/components/x-grid/EditProgress';
import Status from 'docs/src/components/x-grid/Status';
import EditStatus from 'docs/src/components/x-grid/EditStatus';
import ROUTES from 'docs/src/route';

const columns: Array<GridColDef> = [
{
Expand Down Expand Up @@ -1686,13 +1689,13 @@ export default function DataTable() {
sx={(theme) => ({
overflow: 'hidden',
width: '100%',
boxShadow: '0px 4px 16px rgba(61, 71, 82, 0.15)',
boxShadow: `0 4px 8px ${alpha(theme.palette.primaryDark[300], 0.3)}`,
bgcolor: '#fff',
border: '1px solid',
borderColor: 'grey.200',
...theme.applyDarkStyles({
bgcolor: 'primaryDark.800',
boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.4)',
boxShadow: `0 4px 8px ${alpha(theme.palette.common.black, 0.3)}`,
}),
})}
>
Expand All @@ -1716,23 +1719,17 @@ export default function DataTable() {
</Paper>
}
code={
<Box
sx={{
overflow: 'auto',
flexGrow: 1,
'&::-webkit-scrollbar': {
display: 'none',
},
'& pre': {
bgcolor: 'transparent !important',
'&::-webkit-scrollbar': {
display: 'none',
},
},
}}
>
<HighlightedCode copyButtonHidden plainStyle code={code} language="jsx" />
</Box>
<React.Fragment>
<ShowcaseCodeWrapper maxHeight={280}>
<HighlightedCode copyButtonHidden code={code} language="jsx" plainStyle />
</ShowcaseCodeWrapper>
<MoreInfoBox
primaryBtnLabel="Start with the Data Grid"
primaryBtnHref={ROUTES.dataGridOverview}
secondaryBtnLabel="Learn more about MUI X"
secondaryBtnHref={ROUTES.productAdvanced}
/>
</React.Fragment>
}
/>
);
Expand Down
Loading