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

1281-properties-ux #1310

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions src/Components/NavTree/NavTreeNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React, {ReactElement} from 'react'
import {reifyName} from '@bldrs-ai/ifclib'
import {useTheme} from '@mui/material/styles'
import HideToggleButton from '../HideToggleButton'
import NodeClosedIcon from '../../assets/icons/NodeClosed.svg'
import NodeOpenIcon from '../../assets/icons/NodeOpened.svg'
import NodeClosedIcon from '@mui/icons-material/KeyboardArrowRight'
import NodeOpenIcon from '@mui/icons-material/KeyboardArrowDown'


/** @return {ReactElement} */
Expand Down Expand Up @@ -59,7 +59,6 @@ export default function NavTreeNode({
role='button'
tabIndex={0}
style={{
margin: '7px 8px 0 0',
display: 'flex',
alignItems: 'center',
}}
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Properties/ExpansionPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Accordion from '@mui/material/Accordion'
import AccordionDetails from '@mui/material/AccordionDetails'
import AccordionSummary from '@mui/material/AccordionSummary'
import Typography from '@mui/material/Typography'
import CaretIcon from '../../assets/icons/Caret.svg'
import PsetOpenIcon from '@mui/icons-material/KeyboardArrowDown'


/**
Expand Down Expand Up @@ -42,9 +42,9 @@ export default function ExpansionPanel({summary, detail, expandState}) {
onChange={() => setExpanded(!expanded)}
>
<AccordionSummary
expandIcon={<CaretIcon className='caretToggle'/>}
aria-controls="panel1a-content"
id="panel1a-header"
expandIcon={<PsetOpenIcon className='icon-share'/>}
aria-controls='panel1a-content'
id='panel1a-header'
>
<Typography sx={{
'maxWidth': '260px',
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Properties/Properties.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import Box from '@mui/material/Box'
import Paper from '@mui/material/Paper'
import Typography from '@mui/material/Typography'
import {useTheme} from '@mui/material/styles'
import {useIsMobile} from '../Hooks'
import Toggle from '../Toggle'
import useStore from '../../store/useStore'
import {hexToRgba} from '../../utils/color'
import {createPropertyTable} from '../../utils/itemProperties'
import ExpansionPanel from './ExpansionPanel'
import {useIsMobile} from '../Hooks'
import Toggle from '../Toggle'
import {createPropertyTable} from './itemProperties'


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, {useState} from 'react'
import debug from './debug'
import Typography from '@mui/material/Typography'
import {deref, decodeIFCString} from '@bldrs-ai/ifclib'
import {stoi} from './strings'
import debug from '../../utils/debug'
import {stoi} from '../../utils/strings'


/**
Expand Down
35 changes: 18 additions & 17 deletions src/Containers/AlertDialogAndSnackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function AlertAndSnackbar() {
setIsSnackOpen(true)
}, [snackMessage, setIsSnackOpen])


return (
<>
<AlertDialog
Expand All @@ -59,24 +60,24 @@ export default function AlertAndSnackbar() {
open={isSnackOpen}
onClose={(event, reason) => setIsSnackOpen(false)}
action={
<IconButton
onClick={() => setIsSnackOpen(false)}
size='small'
sx={{marginRight: '-.5em'}}
>
<CloseIcon color='primary' fontSize="inherit"/>
</IconButton>
}
<IconButton
onClick={() => setIsSnackOpen(false)}
size='small'
sx={{marginRight: '-.5em'}}
>
<CloseIcon color='primary' fontSize='inherit'/>
</IconButton>
}
message={
<Typography
variant='body2'
sx={{
maxWidth: '19em',
overflowWrap: 'break-word',
}}
>
{text}
</Typography>
<Typography
variant='body2'
sx={{
maxWidth: '19em',
overflowWrap: 'break-word',
}}
>
{text}
</Typography>
}
data-testid='snackbar'
/>
Expand Down
3 changes: 0 additions & 3 deletions src/assets/icons/NodeClosed.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/NodeOpened.svg

This file was deleted.

73 changes: 16 additions & 57 deletions src/theme/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,41 +97,6 @@ export function getComponentOverrides(palette, typography) {
},
},
},
MuiChip: {
styleOverrides: {
filled: ({theme}) => ({
'border': `1px solid ${theme.palette.primary.main}`,
'backgroundColor': theme.palette.primary.main,
'&:hover': {
backgroundColor: theme.palette.secondary.main,
},
}),
outlined: ({theme}) => ({
'borderColor': theme.palette.primary.main,
'color': theme.palette.primary.contrastText,
'&&:hover': {
backgroundColor: theme.palette.primary.main,
},
}),
sampleModel: ({theme}) => ({
'borderColor': theme.palette.primary.main,
'backgroundColor': theme.palette.secondary.main,
'color': theme.palette.primary.contrastText,
'width': '11em',
'height': '6em',
'display': 'flex',
'justifyContent': 'center',
'&&:hover': {
backgroundColor: theme.palette.primary.main,
},
'& .MuiChip-label': {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
},
}),
},
},
MuiDialog: {
styleOverrides: {
paper: {
Expand Down Expand Up @@ -179,18 +144,18 @@ export function getComponentOverrides(palette, typography) {
},
MuiMenuItem: {
styleOverrides: {
root: ({theme}) => ({
root: {
'&.Mui-selected': {
backgroundColor: theme.palette.secondary.dark,
backgroundColor: palette.secondary.dark,
fontWeight: 'bold',
},
'&.Mui-selected:hover': {
// TODO(pablo): merge with above. Can't figure out combined selector
backgroundColor: theme.palette.secondary.dark,
backgroundColor: palette.secondary.dark,
fontWeight: 'bold',
fontStyle: 'italic',
},
}),
},
},
},
MuiPaper: {
Expand All @@ -210,49 +175,43 @@ export function getComponentOverrides(palette, typography) {
},
{
props: {variant: 'page-background'},
style: ({theme}) => ({
style: {
padding: '10px',
borderRadius: '0',
}),
},
},
{
props: {variant: 'page'},
style: ({theme}) => ({
style: {
padding: '10px',
borderRadius: '0',
}),
},
},
],
},
MuiSelect: {
styleOverrides: {
root: {
// background: palette.primary.main,
},
},
},
MuiLink: {
styleOverrides: {
root: {
color: palette.primary.contrastText,
color: palette.secondary.contrastText,
textDecoration: 'underline',
},
},
},
MuiSnackbarContent: {
styleOverrides: {
root: {
backgroundColor: palette.secondary.main,
borderRadius: '10px',
},
},
},
MuiSvgIcon: {
styleOverrides: {
root: ({theme}) => ({
root: {
width: '1.5rem',
height: '1.5rem',
color: theme.palette.secondary.contrastText,
}),
color: palette.secondary.contrastText,
},
},
variants: [{
// Used in HelpControl to indicate activity state
Expand Down Expand Up @@ -296,9 +255,9 @@ export function getComponentOverrides(palette, typography) {
},
MuiTypography: {
styleOverrides: {
root: ({theme}) => ({
color: theme.palette.secondary.contrastText,
}),
root: {
color: palette.secondary.contrastText,
},
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/Typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function getTypography() {
body1: {fontSize, lineHeight, letterSpacing, fontWeight},
body2: {fontSize, lineHeight, letterSpacing, fontWeight},
tree: {fontSize, lineHeight, letterSpacing, fontWeight},
propTitle: {fontSize, lineHeight, letterSpacing, fontWeight},
propValue: {fontSize, lineHeight, letterSpacing, fontWeight: 300},
propTitle: {fontSize, lineHeight, letterSpacing, fontWeight: 300},
propValue: {fontSize, lineHeight, letterSpacing, fontWeight},
}
}
Loading