import * as React from 'react'; import { styled, extendTheme } from '@mui/joy/styles'; import Box from '@mui/joy/Box'; import Link from '@mui/joy/Link'; import Typography from '@mui/joy/Typography'; import Sheet from '@mui/joy/Sheet'; import LightMode from '@mui/icons-material/LightModeOutlined'; import DarkMode from '@mui/icons-material/DarkModeOutlined'; import Check from '@mui/icons-material/CheckCircle'; import { useClipboardCopy } from '@mui/docs/CodeCopy'; const Table = styled('table')(({ theme }) => ({ border: '1px solid', borderColor: theme.vars.palette.divider, borderRadius: theme.vars.radius.md, borderCollapse: 'separate', borderSpacing: 0, width: '100%', overflowY: 'scroll', th: { textAlign: 'left', padding: 12, position: 'sticky', top: 0, zIndex: 1, ...theme.variants.soft.neutral, }, td: { verticalAlign: 'top', padding: '8px 12px', }, tr: { '&:hover': { backgroundColor: theme.vars.palette.background.level1, }, '&:first-of-type': { '& td': { paddingTop: 6 }, }, }, })); const defaultTheme = extendTheme(); export default function ShadowThemeViewer() { const { copy, isCopied } = useClipboardCopy(); const tokens = Object.keys(defaultTheme.shadow); const formatShadowLayers = (shadow) => React.Children.toArray( shadow .split(', ') .reduce( (result, curr, index, array) => array.length - 1 !== index ? [...result, `${curr},`,
] : [...result, curr], [], ), ); return ( }> Copied {tokens.map((token) => ( ))}
Token Value } sx={{ fontSize: 'sm' }}> Light } sx={{ fontSize: 'sm' }}> Dark
{token} copy(token)} sx={{ textAlign: 'left', fontSize: 'xs', fontFamily: 'code' }} > {formatShadowLayers(defaultTheme.shadow[token])} theme.shadow[token], borderRadius: 'xs', mr: 2, }} /> theme.shadow[token], borderRadius: 'xs', }} />
); }