Skip to content

Commit

Permalink
Rename innerContentScroll prop to innerContentOverflow (#1490)
Browse files Browse the repository at this point in the history
* Rename innerContentScroll prop to innerContentOverflow
  • Loading branch information
pcln-james committed May 6, 2024
1 parent cfad423 commit 528ef5a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "Rename innerContentScroll prop to innerContentOverflow",
"type": "patch"
}
],
"packageName": "pcln-design-system"
}
14 changes: 7 additions & 7 deletions packages/core/src/Dialog/Dialog.styled.tsx
Expand Up @@ -147,7 +147,7 @@ export const DialogOverlay = ({ scrimColor, sheet, children, zIndex }: Partial<D
}

const SmoothTransitionBox = styled(Box)`
overflow: ${(props) => (props.innerContentScroll ? 'scroll' : 'auto')};
overflow: ${(props) => props.innerContentOverflow ?? 'auto'};
transition: all 0.3s ease-in-out;
`

Expand All @@ -164,16 +164,16 @@ export const DialogContent = ({
headerIcon,
headerShowCloseButton,
hugColor,
innerContentOverflow,
overflowX,
overflowY,
scrimDismiss,
sheet,
showCloseButton,
showScrollShadow,
size,
zIndex,
onOpenChange,
overflowX,
overflowY,
showScrollShadow,
innerContentScroll,
}: DialogProps) => {
const headerSizeArray = [
headerIcon ? 'heading5' : 'heading4', // xs
Expand Down Expand Up @@ -248,7 +248,7 @@ export const DialogContent = ({
)}
{showScrollShadow ? (
<SmoothTransitionBox
innerContentScroll={innerContentScroll}
innerContentOverflow={innerContentOverflow}
style={{ boxShadow }}
height='100%'
onScroll={onScrollHandler}
Expand All @@ -260,7 +260,7 @@ export const DialogContent = ({
)}
</SmoothTransitionBox>
) : (
<Box height='100%' style={innerContentScroll ? { overflowY: 'scroll' } : undefined}>
<Box height='100%' style={innerContentOverflow ? { overflowY: innerContentOverflow } : undefined}>
{children}
</Box>
)}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/Dialog/Dialog.tsx
Expand Up @@ -24,6 +24,7 @@ export type DialogProps = Omit<OverflowProps, 'overflow'> & {
headerIcon?: React.ReactNode
headerShowCloseButton?: boolean
hugColor?: PaletteColor
innerContentOverflow?: 'auto' | 'clip' | 'hidden' | 'scroll' | 'visible'
open?: boolean
scrimColor?: 'dark' | 'medium' | 'light' | (string & {})
scrimDismiss?: boolean
Expand All @@ -33,7 +34,6 @@ export type DialogProps = Omit<OverflowProps, 'overflow'> & {
triggerNode?: React.ReactNode
zIndex?: ZIndex
onOpenChange?: (open: boolean) => void
innerContentScroll?: boolean
showScrollShadow?: boolean
}

Expand All @@ -54,19 +54,19 @@ const PclnDialog = ({
headerIcon,
headerShowCloseButton = false,
hugColor,
innerContentOverflow = 'scroll',
open,
scrimColor = 'dark',
scrimDismiss = true,
sheet = false,
showCloseButton = true,
showScrollShadow,
size = 'md',
triggerNode,
zIndex = 'overlay',
overflowX = 'auto',
overflowY = 'auto',
onOpenChange,
showScrollShadow,
innerContentScroll = true,
}: DialogProps) => {
const [_open, setOpen] = React.useState(open ?? defaultOpen)

Expand All @@ -84,7 +84,6 @@ const PclnDialog = ({
{_open && (
<DialogOverlay scrimDismiss={scrimDismiss} scrimColor={scrimColor} sheet={sheet} zIndex={zIndex}>
<DialogContent
innerContentScroll={innerContentScroll}
overflowX={overflowX}
overflowY={overflowY}
ariaDescription={ariaDescription}
Expand All @@ -98,6 +97,7 @@ const PclnDialog = ({
headerIcon={headerIcon}
headerShowCloseButton={headerShowCloseButton}
hugColor={hugColor}
innerContentOverflow={innerContentOverflow}
onOpenChange={handleOpenChange}
scrimDismiss={scrimDismiss}
sheet={sheet}
Expand Down

0 comments on commit 528ef5a

Please sign in to comment.