tldraw/components/panel.tsx

88 lines
1.6 KiB
TypeScript
Raw Normal View History

2021-05-17 10:01:11 +00:00
import styled from "styles"
export const Root = styled("div", {
position: "relative",
backgroundColor: "$panel",
borderRadius: "4px",
overflow: "hidden",
border: "1px solid $border",
pointerEvents: "all",
userSelect: "none",
zIndex: 200,
boxShadow: "0px 2px 25px rgba(0,0,0,.16)",
variants: {
2021-05-17 21:27:18 +00:00
isOpen: {
2021-05-26 10:34:10 +00:00
true: {
width: "auto",
minWidth: 300,
},
2021-05-17 21:27:18 +00:00
false: {
height: 34,
width: 34,
},
2021-05-17 10:01:11 +00:00
},
},
})
export const Layout = styled("div", {
display: "grid",
gridTemplateColumns: "1fr",
gridTemplateRows: "auto 1fr",
gridAutoRows: "28px",
height: "100%",
2021-05-27 17:59:40 +00:00
width: "auto",
2021-05-17 10:01:11 +00:00
minWidth: "100%",
maxWidth: 560,
overflow: "hidden",
userSelect: "none",
pointerEvents: "all",
})
export const Header = styled("div", {
pointerEvents: "all",
2021-05-27 17:59:40 +00:00
display: "flex",
width: "100%",
2021-05-17 10:01:11 +00:00
alignItems: "center",
2021-05-27 17:59:40 +00:00
justifyContent: "space-between",
2021-05-17 10:01:11 +00:00
borderBottom: "1px solid $border",
2021-05-27 17:59:40 +00:00
position: "relative",
2021-05-17 10:01:11 +00:00
"& h3": {
2021-05-27 17:59:40 +00:00
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
2021-05-17 10:01:11 +00:00
textAlign: "center",
2021-05-27 17:59:40 +00:00
padding: 0,
margin: 0,
display: "flex",
justifyContent: "center",
alignItems: "center",
2021-05-17 10:01:11 +00:00
fontSize: "13px",
2021-05-27 17:59:40 +00:00
pointerEvents: "none",
userSelect: "none",
2021-05-17 10:01:11 +00:00
},
})
export const ButtonsGroup = styled("div", {
display: "flex",
})
export const Content = styled("div", {
position: "relative",
pointerEvents: "all",
overflowY: "scroll",
})
export const Footer = styled("div", {
overflowX: "scroll",
color: "$text",
font: "$debug",
padding: "0 12px",
display: "flex",
alignItems: "center",
borderTop: "1px solid $border",
})