-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: [M3-7182] - Update RemovableSelectionsList default maximum he…
…ight to cut off the last list item (#9827) * update removable list height to cut off last item if scrolling is necessary * add changeset * box shadow for removable selections list * fix safari box shadow display (css really really got me ;-;) * cleanup, make dropshadow appear more dynamically
- Loading branch information
1 parent
9cd7af2
commit 55b1205
Showing
6 changed files
with
193 additions
and
105 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-9827-upcoming-features-1698091273479.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Update `RemovableSelectionsList` default maximum height to cut off last list item and indicate scrolling ([#9827](https://github.com/linode/manager/pull/9827)) |
90 changes: 90 additions & 0 deletions
90
packages/manager/src/components/RemovableSelectionsList/RemovableSelectionsList.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { styled } from '@mui/material/styles'; | ||
|
||
import { Box } from 'src/components/Box'; | ||
import { List } from 'src/components/List'; | ||
import { ListItem } from 'src/components/ListItem'; | ||
import { omittedProps } from 'src/utilities/omittedProps'; | ||
|
||
import type { RemovableSelectionsListProps } from './RemovableSelectionsList'; | ||
|
||
export const StyledNoAssignedLinodesBox = styled(Box, { | ||
label: 'StyledNoAssignedLinodesBox', | ||
shouldForwardProp: omittedProps(['maxWidth']), | ||
})(({ maxWidth, theme }) => ({ | ||
background: theme.name === 'light' ? theme.bg.main : theme.bg.app, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
height: '52px', | ||
justifyContent: 'center', | ||
maxWidth: maxWidth ? `${maxWidth}px` : '416px', | ||
paddingLeft: theme.spacing(2), | ||
width: '100%', | ||
})); | ||
|
||
export const SelectedOptionsHeader = styled('h4', { | ||
label: 'SelectedOptionsHeader', | ||
})(({ theme }) => ({ | ||
color: theme.color.headline, | ||
fontFamily: theme.font.bold, | ||
fontSize: '14px', | ||
textTransform: 'initial', | ||
})); | ||
|
||
export const SelectedOptionsList = styled(List, { | ||
label: 'SelectedOptionsList', | ||
shouldForwardProp: omittedProps(['isRemovable']), | ||
})<{ isRemovable?: boolean }>(({ isRemovable, theme }) => ({ | ||
background: theme.name === 'light' ? theme.bg.main : theme.bg.app, | ||
padding: !isRemovable ? `${theme.spacing(2)} 0` : '5px 0', | ||
width: '100%', | ||
})); | ||
|
||
export const SelectedOptionsListItem = styled(ListItem, { | ||
label: 'SelectedOptionsListItem', | ||
})(() => ({ | ||
justifyContent: 'space-between', | ||
paddingBottom: 0, | ||
paddingRight: 4, | ||
paddingTop: 0, | ||
})); | ||
|
||
export const StyledLabel = styled('span', { label: 'StyledLabel' })( | ||
({ theme }) => ({ | ||
color: theme.color.label, | ||
fontFamily: theme.font.semiBold, | ||
fontSize: '14px', | ||
}) | ||
); | ||
|
||
type StyledBoxShadowWrapperBoxProps = Pick< | ||
RemovableSelectionsListProps, | ||
'maxHeight' | 'maxWidth' | ||
>; | ||
|
||
export const StyledBoxShadowWrapper = styled(Box, { | ||
label: 'StyledBoxShadowWrapper', | ||
shouldForwardProp: omittedProps(['displayShadow']), | ||
})<{ displayShadow: boolean; maxWidth: number }>( | ||
({ displayShadow, maxWidth, theme }) => ({ | ||
'&:after': { | ||
bottom: 0, | ||
content: '""', | ||
height: '15px', | ||
position: 'absolute', | ||
width: '100%', | ||
...(displayShadow && { | ||
boxShadow: `${theme.color.boxShadow} 0px -15px 10px -10px inset`, | ||
}), | ||
}, | ||
maxWidth: `${maxWidth}px`, | ||
position: 'relative', | ||
}) | ||
); | ||
|
||
export const StyledScrollBox = styled(Box, { | ||
label: 'StyledScrollBox', | ||
})<StyledBoxShadowWrapperBoxProps>(({ maxHeight, maxWidth }) => ({ | ||
maxHeight: `${maxHeight}px`, | ||
maxWidth: `${maxWidth}px`, | ||
overflow: 'auto', | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters