Skip to content

Commit

Permalink
feat(minimizable-dialog): add elevation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PixeledCode committed Jan 29, 2025
1 parent 9014fdc commit 8f156b5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,12 @@ const MinimizableDialogHeader = React.forwardRef<HTMLDivElement, MinimizableDial
display="grid"
gridTemplateColumns="1fr auto auto"
columnGap="space30"
backgroundColor="colorBackground"
backgroundColor={minimized ? "colorBackgroundBodyElevation" : "colorBackgroundWeaker"}
paddingX="space70"
paddingY="space40"
color="colorTextWeak"
overflow="hidden"
borderBottomWidth="borderWidth10"
borderBottomStyle="solid"
borderBottomColor="colorBorderWeaker"
borderTopRightRadius="borderRadius20"
borderTopLeftRadius="borderRadius20"
boxShadow={minimized ? "shadowElevation10" : "none"}
element={element}
>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@ import { Box } from "@twilio-paste/box";
import type { BoxProps } from "@twilio-paste/box";
import * as React from "react";

import { MinimizableDialogContext } from "./MinimizableDialogContext";

export const StyledMinimizableDialog: React.FC<React.PropsWithChildren<Pick<BoxProps, "element">>> = ({
element,
children,
}) => (
<Box
element={element}
borderRadius="borderRadius20"
display="flex"
flexDirection="column"
backgroundColor="colorBackgroundBody"
width="size40"
boxShadow="shadow"
>
{children}
</Box>
);
}) => {
const { minimized } = React.useContext(MinimizableDialogContext);

return (
<Box
element={element}
borderRadius="borderRadius20"
display="flex"
flexDirection="column"
backgroundColor="colorBackgroundWeaker"
width="size40"
boxShadow="shadowElevation20"
>
{children}
</Box>
);
};

StyledMinimizableDialog.displayName = "StyledMinimizableDialog";

0 comments on commit 8f156b5

Please sign in to comment.