4 changed files with 86 additions and 85 deletions
+1 -6
View File
@@ -45,18 +45,13 @@ export default function Sidebar() {
{/* Collapse Sidebar and Theme Footer Buttons */} {/* Collapse Sidebar and Theme Footer Buttons */}
<Flex css={styles.footer}> <Flex css={styles.footer}>
<Flex css={styles.closed_theme_button}>
<ColorModeButton />
</Flex>
<Flex>
<IconButton aria-label="Toggle Sidebar" variant="plain" onClick={toggleSidebar} css={styles.collapse_button}> <IconButton aria-label="Toggle Sidebar" variant="plain" onClick={toggleSidebar} css={styles.collapse_button}>
{isOpen ? <PanelLeftClose /> : <PanelLeftOpen />} {isOpen ? <PanelLeftClose /> : <PanelLeftOpen />}
</IconButton> </IconButton>
<Flex css={styles.opened_theme_button}> <Flex css={styles.color_mode_button}>
<ColorModeButton /> <ColorModeButton />
</Flex> </Flex>
</Flex> </Flex>
</Flex>
</Box> </Box>
); );
} }
+2 -2
View File
@@ -26,7 +26,7 @@ export default function Home() {
return ( return (
<Flex css={homeStyle.root}> <Flex css={homeStyle.root}>
<Flex as="header"> <Flex as="header" css={homeStyle.header}>
{/* TABS CONTAINER */} {/* TABS CONTAINER */}
<Flex> <Flex>
{HOME_TABS.map((tab) => { {HOME_TABS.map((tab) => {
@@ -52,7 +52,7 @@ export default function Home() {
</Flex> </Flex>
{/* TABS CONTENT */} {/* TABS CONTENT */}
<Flex> <Flex css={homeStyle.body}>
<Outlet/> <Outlet/>
</Flex> </Flex>
@@ -141,6 +141,16 @@ export default function MyDashboard() {
{/* THE DELETE BUTTON */} {/* THE DELETE BUTTON */}
{isEditing && ( {isEditing && (
<IconButton <IconButton
position="absolute"
top={2}
right={2}
bg="white"
color="black"
border="1px solid"
borderRadius="xl"
borderColor="gray.200"
_hover={{bg: "red.50", color: "red.500", borderColor: "red.200"}}
zIndex={2}
aria-label="Remove widget" aria-label="Remove widget"
size="xs" size="xs"
onClick={() => removeWidget(widget.id)} onClick={() => removeWidget(widget.id)}
+49 -53
View File
@@ -32,7 +32,7 @@ const headerRecipe = defineSlotRecipe({
// The Text component // The Text component
"& p": { "& p": {
fontWeight: "600", fontWeight: "600",
fontSize: "16px" // equivalent to chakra 'md' fontSize: "md" // equivalent to 16px
} }
} }
}, },
@@ -40,12 +40,13 @@ const headerRecipe = defineSlotRecipe({
// CONSOLIDATED ✔ // CONSOLIDATED ✔
const sidebarRecipe = defineSlotRecipe({ const sidebarRecipe = defineSlotRecipe({
slots: ["root", "logo", "logo_text", "footer", "button_text", "buttons", "collapse_button", "opened_theme_button", "closed_theme_button"], slots: ["root", "logo", "logo_text", "footer", "button_text", "buttons", "collapse_button", "color_mode_button"],
base: { base: {
root: { root: {
// 1. Semi-transparent backgrounds // 1. Semi-transparent backgrounds
bg: { bg: {
base: "linear-gradient(to bottom right, #99000040 20%, #FF660040 60%, #EEEE0040 100%)", // base: "linear-gradient(to bottom right, #99000040 20%, #FF660040 60%, #EEEE0040 100%)", // this is too pale for light mode imo
base: "linear-gradient(to bottom right, #97282880 20%, #EB7F3160 60%, #FCAD3840 100%)", // colors from: https://colorhunt.co/palette/972828e45742eb7f31fcad38
_dark: "linear-gradient(to bottom right, #9900003C 20%, #FF66003C 60%, #FFC0003C 100%)" _dark: "linear-gradient(to bottom right, #9900003C 20%, #FF66003C 60%, #FFC0003C 100%)"
}, },
@@ -160,7 +161,6 @@ const sidebarRecipe = defineSlotRecipe({
}, },
logo: { logo: {
width: "100%", width: "100%",
height: "2.5rem",
justifyContent: "flex-start", justifyContent: "flex-start",
ml: 2, ml: 2,
textStyle: "4xl", textStyle: "4xl",
@@ -175,10 +175,12 @@ const sidebarRecipe = defineSlotRecipe({
textOverflow: "clip", textOverflow: "clip",
}, },
footer: { footer: {
flexDirection: "column", flexDirection: "row",
justifyContent: "space-between",
width: "100%", width: "100%",
mt: "auto", mt: "auto",
ml: 2, pl: 2,
pr: 2,
}, },
button_text: { button_text: {
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease", transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
@@ -190,28 +192,35 @@ const sidebarRecipe = defineSlotRecipe({
collapse_button: { collapse_button: {
"& svg": {flexShrink: "0"}, "& svg": {flexShrink: "0"},
}, },
opened_theme_button: { color_mode_button: {
width: "100%",
align: "center",
justifyContent: "right",
mr: 6,
"& button": { "& button": {
alignSelf: "center",
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
_hover: { _hover: {
bg: "transparent", bg: "transparent",
}
}
}, },
closed_theme_button: {
ml: 0.9,
"& button": {
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
_hover: {
bg: "transparent",
} }
} }
}, // opened_theme_button: {
// width: "100%",
// align: "center",
// justifyContent: "right",
// mr: 6,
// // "& button": {
// // alignSelf: "center",
// // transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
// // _hover: {
// // bg: "transparent",
// // }
// // }
// },
// closed_theme_button: {
// // ml: 0.9,
// // "& button": {
// // transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
// // _hover: {
// // bg: "transparent",
// // }
// // }
// },
}, },
variants: { variants: {
state: { state: {
@@ -219,15 +228,23 @@ const sidebarRecipe = defineSlotRecipe({
root: {width: "190px"}, root: {width: "190px"},
button_text: {ml: 3, opacity: 1, visibility: "visible"}, button_text: {ml: 3, opacity: 1, visibility: "visible"},
logo_text: {ml: 3, opacity: 1, visibility: "visible", transition: "opacity 0.5s ease, visibility 0.5s ease, margin 0.5s ease"}, logo_text: {ml: 3, opacity: 1, visibility: "visible", transition: "opacity 0.5s ease, visibility 0.5s ease, margin 0.5s ease"},
opened_theme_button: {"& button": {opacity: 1, visibility: "visible"}}, color_mode_button: {
closed_theme_button: {"& button": {opacity: 0, visibility: "hidden"}}, "& button": {
position: "static",
},
// the css below is equivalent to chakra's 'truncate' prop
// it makes sure the icon doesn't jump out of the bounds of the sidebar while it's transitioning from closed to open
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "clip",
},
}, },
closed: { closed: {
root: {width: "71px"}, root: {width: "71px"},
button_text: {opacity: 0, visibility: "hidden"}, button_text: {opacity: 0, visibility: "hidden"},
logo_text: {opacity: 0, visibility: "hidden", transition: "opacity 0.2s ease, visibility 0.2s ease, margin 0.2s ease"}, logo_text: {opacity: 0, visibility: "hidden", transition: "opacity 0.2s ease, visibility 0.2s ease, margin 0.2s ease"},
opened_theme_button: {"& button": {opacity: 0, visibility: "hidden"}}, color_mode_button: {"& button": {position: "relative", bottom: "35px", right: "37px",}
closed_theme_button: {"& button": {opacity: 1, visibility: "visible"}}, },
} }
} }
} }
@@ -250,15 +267,15 @@ const dashboardRecipe = defineRecipe({
// CONSOLIDATED ✔ // CONSOLIDATED ✔
const homeRecipe = defineSlotRecipe({ const homeRecipe = defineSlotRecipe({
slots: ["root"], slots: ["root", "header", "body"],
base: { base: {
root: { root: {
flexDirection: "column", flexDirection: "column",
height: "100%", height: "100%",
width: "100%", width: "100%",
},
header: {
// Flex contianer as a header that contains all the tabs // Flex contianer as a header that contains all the tabs
"& header": {
width: "100%", width: "100%",
align: "center", align: "center",
justify: "space-between", justify: "space-between",
@@ -268,6 +285,7 @@ const homeRecipe = defineSlotRecipe({
zIndex: "dropdown", zIndex: "dropdown",
bg: "transparent", bg: "transparent",
// THE TABS
// Flex container renders as div for all the buttons within the header // Flex container renders as div for all the buttons within the header
"& > div": { "& > div": {
alignItems: "center", alignItems: "center",
@@ -279,13 +297,11 @@ const homeRecipe = defineSlotRecipe({
} }
} }
}, },
body: {
"& > div": {
flex: 1, flex: 1,
overflow: "auto", overflow: "auto",
} }
}, },
},
}) })
// const canvasRecipe = defineRecipe({ // const canvasRecipe = defineRecipe({
@@ -364,24 +380,6 @@ const glassPanelRecipe = defineSlotRecipe({
width: "100%", width: "100%",
height: "100%", height: "100%",
borderRadius: "3xl", borderRadius: "3xl",
"& > button": {
position: "absolute",
top: 2,
right: 2,
// size="xs",
bg: "white",
color: "black",
border: "1px solid",
borderRadius: "xl",
borderColor: "gray.200",
_hover: {
bg: "red.50",
color: "red.500",
borderColor: "red.200"
},
zIndex: 2,
}
}, },
header: { header: {
display: "flex", display: "flex",
@@ -447,6 +445,7 @@ const glassPanelRecipe = defineSlotRecipe({
WebkitBackdropFilter: "blur(15px)", WebkitBackdropFilter: "blur(15px)",
// IMPORTANT: everything below is specific to the widget menu found in the settingsButton component
// dialog header // dialog header
"& > div.chakra-dialog__header": { "& > div.chakra-dialog__header": {
bg: "transparent", bg: "transparent",
@@ -471,8 +470,6 @@ const glassPanelRecipe = defineSlotRecipe({
"& > div.chakra-dialog__body": { "& > div.chakra-dialog__body": {
p: 0, p: 0,
// IMPORTANT: everything below is specific to the widget menu found in the settingsButton component
// box container of the widget category menu // box container of the widget category menu
"& div.chakra-tabs__root > div:first-child": { "& div.chakra-tabs__root > div:first-child": {
position: "relative", position: "relative",
@@ -503,7 +500,6 @@ const glassPanelRecipe = defineSlotRecipe({
scrollbarWidth: "none", scrollbarWidth: "none",
"&::-webkit-scrollbar": {display: "none"}, "&::-webkit-scrollbar": {display: "none"},
// the pill shaped menu options // the pill shaped menu options
"& button.chakra-tabs__trigger": { "& button.chakra-tabs__trigger": {
px: 5, px: 5,