Compare commits
6
Commits
bc9fbaae6e
...
bd5e02ac1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5e02ac1b | ||
|
|
c810056d67 | ||
|
|
56ae6d2e3f | ||
|
|
f43cfb649e | ||
|
|
91af70dbb5 | ||
|
|
64c78cea70 |
@@ -38,9 +38,11 @@ export function SettingsButton() {
|
|||||||
const [canScrollRight, setCanScrollRight] = useState(false);
|
const [canScrollRight, setCanScrollRight] = useState(false);
|
||||||
|
|
||||||
// Pull the glass container styles for the dropdown and modal
|
// Pull the glass container styles for the dropdown and modal
|
||||||
const panelRecipe = useSlotRecipe({key: "glassPanel"});
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
const panelStyles = panelRecipe({layout: "dropdown"});
|
const popoverStyles = popoverRecipe();
|
||||||
const modalStyles = panelRecipe({layout: "popover"});
|
|
||||||
|
const dialogRecipe = useSlotRecipe({ key: "glassDialog" });
|
||||||
|
const dialogStyles = dialogRecipe();
|
||||||
|
|
||||||
const [isLibraryOpen, setIsLibraryOpen] = useState(false);
|
const [isLibraryOpen, setIsLibraryOpen] = useState(false);
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ export function SettingsButton() {
|
|||||||
</Menu.Trigger>
|
</Menu.Trigger>
|
||||||
|
|
||||||
<Menu.Positioner>
|
<Menu.Positioner>
|
||||||
<Menu.Content css={panelStyles.root} zIndex="dropdown" minW="200px">
|
<Menu.Content css={popoverStyles.content} zIndex="dropdown" minW="200px">
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
onClick={enterEditMode}
|
onClick={enterEditMode}
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
@@ -168,12 +170,13 @@ export function SettingsButton() {
|
|||||||
{/* Soft blur can be added to the background behind the modal */}
|
{/* Soft blur can be added to the background behind the modal */}
|
||||||
{/*<Dialog.Backdrop bg="blackAlpha.100" backdropFilter="blur(2px)"/>*/}
|
{/*<Dialog.Backdrop bg="blackAlpha.100" backdropFilter="blur(2px)"/>*/}
|
||||||
<Dialog.Positioner>
|
<Dialog.Positioner>
|
||||||
<Dialog.Content css={modalStyles.root}>
|
<Dialog.Content css={dialogStyles.content}>
|
||||||
<Dialog.Header>
|
|
||||||
|
<Dialog.Header css={dialogStyles.header}>
|
||||||
<Dialog.Title>Widgets Shop</Dialog.Title>
|
<Dialog.Title>Widgets Shop</Dialog.Title>
|
||||||
</Dialog.Header>
|
</Dialog.Header>
|
||||||
|
|
||||||
<Dialog.Body>
|
<Dialog.Body css={dialogStyles.body}>
|
||||||
<Tabs.Root defaultValue={categories[0]} variant="unstyled">
|
<Tabs.Root defaultValue={categories[0]} variant="unstyled">
|
||||||
{/* HORIZONTAL SCROLLABLE MENU OF WIDGET CATEGORIES */}
|
{/* HORIZONTAL SCROLLABLE MENU OF WIDGET CATEGORIES */}
|
||||||
<Box>
|
<Box>
|
||||||
@@ -246,7 +249,6 @@ export function SettingsButton() {
|
|||||||
h="24px"
|
h="24px"
|
||||||
flexShrink={0}
|
flexShrink={0}
|
||||||
borderRadius="full"
|
borderRadius="full"
|
||||||
// bg={{base: "blue.50", _dark: "whiteAlpha.200"}}
|
|
||||||
fontWeight="black"
|
fontWeight="black"
|
||||||
fontSize="xs"
|
fontSize="xs"
|
||||||
bg='transparent'
|
bg='transparent'
|
||||||
|
|||||||
@@ -29,13 +29,14 @@ export default function MyDashboard() {
|
|||||||
const hasHydrated = useRef(false);
|
const hasHydrated = useRef(false);
|
||||||
|
|
||||||
// 1. Pull the global slot recipes
|
// 1. Pull the global slot recipes
|
||||||
const glassPanelRecipe = useSlotRecipe({key: "glassPanel"});
|
const widgetRecipe = useSlotRecipe({ key: "widget" });
|
||||||
const glassPanelStyles = glassPanelRecipe();
|
const popoverRecipe = useSlotRecipe({ key: "glassPopover" });
|
||||||
const widgetStyles = glassPanelRecipe({ layout: "widget" });
|
|
||||||
const widgetSettingsRecipe = useSlotRecipe({ key: "widgetSettings" });
|
|
||||||
const widgetSettingsStyles = widgetSettingsRecipe();
|
|
||||||
|
|
||||||
// 2. Populate widgets
|
// 2. Pass the editing state directly into the widget recipe!
|
||||||
|
const widgetStyles = widgetRecipe({ mode: isEditing ? "editing" : undefined });
|
||||||
|
const popoverStyles = popoverRecipe();
|
||||||
|
|
||||||
|
// 3. Populate widgets
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (user?.preferences?.dashboard_layout && !hasHydrated.current) {
|
if (user?.preferences?.dashboard_layout && !hasHydrated.current) {
|
||||||
const savedLayout = user.preferences.dashboard_layout;
|
const savedLayout = user.preferences.dashboard_layout;
|
||||||
@@ -57,7 +58,7 @@ export default function MyDashboard() {
|
|||||||
isResizable: false // The magic lock! No resizing allowed globally.
|
isResizable: false // The magic lock! No resizing allowed globally.
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 3. The component mapper
|
// 4. The component mapper
|
||||||
const renderWidget = (widget) => {
|
const renderWidget = (widget) => {
|
||||||
const registryEntry = WIDGET_REGISTRY[widget.type];
|
const registryEntry = WIDGET_REGISTRY[widget.type];
|
||||||
|
|
||||||
@@ -84,8 +85,8 @@ export default function MyDashboard() {
|
|||||||
</Popover.Trigger>
|
</Popover.Trigger>
|
||||||
|
|
||||||
{/* NEW: The Positioner lifts the content out of the Flexbox flow */}
|
{/* NEW: The Positioner lifts the content out of the Flexbox flow */}
|
||||||
<Popover.Positioner z-index="1">
|
<Popover.Positioner zIndex={1}>
|
||||||
<Popover.Content css={[widgetSettingsStyles.root, glassPanelStyles.root]}> {/*className={`${glassPanelStyles.root} ${widgetSettingsStyles.root}`}>*/}
|
<Popover.Content css={popoverStyles.content}>
|
||||||
<Suspense fallback={<Spinner size="sm"/>}>
|
<Suspense fallback={<Spinner size="sm"/>}>
|
||||||
<SettingsUI
|
<SettingsUI
|
||||||
widgetId={widget.id}
|
widgetId={widget.id}
|
||||||
@@ -132,12 +133,6 @@ export default function MyDashboard() {
|
|||||||
<Box
|
<Box
|
||||||
key={widget.id}
|
key={widget.id}
|
||||||
css={widgetStyles.root}
|
css={widgetStyles.root}
|
||||||
// Grid-specific state overrides remain inline
|
|
||||||
boxShadow={isEditing ? "outline" : widgetStyles.root.boxShadow}
|
|
||||||
borderStyle={isEditing ? "dashed" : "solid"}
|
|
||||||
borderWidth={isEditing ? "2px" : "1px"}
|
|
||||||
borderColor={isEditing ? "orange.300" : widgetStyles.root.borderColor}
|
|
||||||
cursor={isEditing ? "grab" : "default"}
|
|
||||||
position="relative" // REQUIRED so the absolute button stays inside this box
|
position="relative" // REQUIRED so the absolute button stays inside this box
|
||||||
>
|
>
|
||||||
{/* THE DELETE BUTTON */}
|
{/* THE DELETE BUTTON */}
|
||||||
|
|||||||
+200
-400
@@ -1,11 +1,25 @@
|
|||||||
import {defineSlotRecipe, createSystem, defaultConfig, defineConfig, defineRecipe} from "@chakra-ui/react";
|
import {defineSlotRecipe, createSystem, defaultConfig, defineConfig, defineRecipe} from "@chakra-ui/react";
|
||||||
|
|
||||||
// CONSOLIDATED ✔
|
// REUSABLE GLASS SURFACE
|
||||||
|
const glassSurface = {
|
||||||
|
bg: {base: "rgba(255, 255, 255, 0.4)", _dark: "rgba(255, 255, 255, 0.04)"},
|
||||||
|
backdropFilter: "blur(12px)",
|
||||||
|
WebkitBackdropFilter: "blur(12px)",
|
||||||
|
border: "1px solid",
|
||||||
|
borderColor: {base: "gray.200", _dark: "whiteAlpha.200"},
|
||||||
|
boxShadow: "sm",
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
RECIPES
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
// 1. Header
|
||||||
const headerRecipe = defineSlotRecipe({
|
const headerRecipe = defineSlotRecipe({
|
||||||
slots: ["root", "search_bar", "user_info"],
|
slots: ["root", "search_bar", "user_info"],
|
||||||
base: {
|
base: {
|
||||||
root: {
|
root: {
|
||||||
bg: "{transparent}",
|
bg: "transparent",
|
||||||
color: "text",
|
color: "text",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
@@ -20,7 +34,7 @@ const headerRecipe = defineSlotRecipe({
|
|||||||
// input element in search bar component
|
// input element in search bar component
|
||||||
"& input": {
|
"& input": {
|
||||||
width: "410px",
|
width: "410px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
user_info: {
|
user_info: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
@@ -32,21 +46,29 @@ const headerRecipe = defineSlotRecipe({
|
|||||||
// The Text component
|
// The Text component
|
||||||
"& p": {
|
"& p": {
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
fontSize: "md" // equivalent to 16px
|
fontSize: "md",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// CONSOLIDATED ✔
|
// 2. Sidebar
|
||||||
const sidebarRecipe = defineSlotRecipe({
|
const sidebarRecipe = defineSlotRecipe({
|
||||||
slots: ["root", "logo", "logo_text", "footer", "button_text", "buttons", "collapse_button", "color_mode_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%)", // this is too pale for light mode imo
|
base: "linear-gradient(to bottom right, #97282880 20%, #EB7F3160 60%, #FCAD3840 100%)",
|
||||||
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%)"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -62,8 +84,6 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
borderRight: "none",
|
borderRight: "none",
|
||||||
|
|
||||||
borderRadius: "2xl",
|
borderRadius: "2xl",
|
||||||
// boxShadow: "0 4px 30px rgba(0, 0, 0, 0.1)",
|
|
||||||
// boxShadow: "-10px 4px 30px rgba(0, 0, 0, 0.1)",
|
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "calc(100% - 16px)",
|
height: "calc(100% - 16px)",
|
||||||
margin: "8px",
|
margin: "8px",
|
||||||
@@ -92,18 +112,18 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
|
|
||||||
"& svg": {
|
"& svg": {
|
||||||
transition: "stroke-width 0.4s ease",
|
transition: "stroke-width 0.4s ease",
|
||||||
flexShrink: "0"
|
flexShrink: "0",
|
||||||
},
|
},
|
||||||
|
|
||||||
_hover: {
|
_hover: {
|
||||||
bg: "rgba(255, 255, 255, 0.2)",
|
bg: "rgba(255, 255, 255, 0.2)",
|
||||||
color: "{text}",
|
color: "{text}",
|
||||||
"& svg": {
|
"& svg": {
|
||||||
strokeWidth: "3"
|
strokeWidth: "3",
|
||||||
},
|
},
|
||||||
"& span": {
|
"& span": {
|
||||||
fontWeight: "700",
|
fontWeight: "700",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
fontSize: "l",
|
fontSize: "l",
|
||||||
@@ -122,12 +142,8 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
_hover: {
|
_hover: {
|
||||||
bg: "{MainBackground}",
|
bg: "{MainBackground}",
|
||||||
color: "{textInverted}",
|
color: "{textInverted}",
|
||||||
"& svg": {
|
"& svg": { strokeWidth: "2" },
|
||||||
strokeWidth: "2" // Keeps the active icon at normal thickness on hover
|
"& span": { fontWeight: "500" },
|
||||||
},
|
|
||||||
"& span": {
|
|
||||||
fontWeight: "500",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// The Top Inverted Curve
|
// The Top Inverted Curve
|
||||||
@@ -156,7 +172,7 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
WebkitMaskImage: "radial-gradient(circle at bottom left, transparent 25px, black 25.5px)",
|
WebkitMaskImage: "radial-gradient(circle at bottom left, transparent 25px, black 25.5px)",
|
||||||
maskImage: "radial-gradient(circle at bottom left, transparent 25px, black 25.5px)",
|
maskImage: "radial-gradient(circle at bottom left, transparent 25px, black 25.5px)",
|
||||||
pointerEvents: "none",
|
pointerEvents: "none",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
logo: {
|
logo: {
|
||||||
@@ -197,30 +213,8 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
_hover: {
|
_hover: {
|
||||||
bg: "transparent",
|
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: {
|
||||||
@@ -250,7 +244,7 @@ const sidebarRecipe = defineSlotRecipe({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// CONSOLIDATED ✔
|
// 3. Dashboard Shell
|
||||||
const dashboardRecipe = defineRecipe({
|
const dashboardRecipe = defineRecipe({
|
||||||
base: {
|
base: {
|
||||||
height: "100vh",
|
height: "100vh",
|
||||||
@@ -265,7 +259,7 @@ const dashboardRecipe = defineRecipe({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// CONSOLIDATED ✔
|
// 4. Home Page Tabs
|
||||||
const homeRecipe = defineSlotRecipe({
|
const homeRecipe = defineSlotRecipe({
|
||||||
slots: ["root", "header", "body"],
|
slots: ["root", "header", "body"],
|
||||||
base: {
|
base: {
|
||||||
@@ -290,315 +284,52 @@ const homeRecipe = defineSlotRecipe({
|
|||||||
"& > div": {
|
"& > div": {
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: 2,
|
gap: 2,
|
||||||
|
},
|
||||||
// icon in each tab button
|
|
||||||
"& svg": {
|
|
||||||
// TODO: bring over svg styling
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
const widgetSettingsRecipe = defineSlotRecipe({
|
// 5. Dashboard Widget Card
|
||||||
slots: ["root"],
|
const widgetRecipe = defineSlotRecipe({
|
||||||
base: {
|
|
||||||
root: {
|
|
||||||
w: "100%",
|
|
||||||
h: "500px",
|
|
||||||
bg: "red",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// const canvasRecipe = defineRecipe({
|
|
||||||
// base: {
|
|
||||||
// bg: "{transparent}",
|
|
||||||
// zIndex: "-1",
|
|
||||||
// color: "{text}"
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// const widgetRecipe = defineSlotRecipe({
|
|
||||||
// slots: ["root", "header", "canvas"],
|
|
||||||
// base: {
|
|
||||||
// root: {
|
|
||||||
// flexDirection: "column",
|
|
||||||
// gap: "1",
|
|
||||||
// position: "relative",
|
|
||||||
// bg: "base100",
|
|
||||||
// borderRadius: "md",
|
|
||||||
// p: "1",
|
|
||||||
// paddingBottom: "2",
|
|
||||||
// border: "1px solid",
|
|
||||||
// borderColor: "{base300}",
|
|
||||||
// textAlign: "center",
|
|
||||||
// height: "100%",
|
|
||||||
// // position: "fixed"
|
|
||||||
// },
|
|
||||||
// header: {
|
|
||||||
// flexShrink: "0",
|
|
||||||
// bg: "{base300}",
|
|
||||||
// color: "{text}",
|
|
||||||
// cursor: "move",
|
|
||||||
// borderRadius: "sm",
|
|
||||||
// whiteSpace: "nowrap",
|
|
||||||
// textAlign: "left",
|
|
||||||
// pl: "2"
|
|
||||||
// },
|
|
||||||
// canvas: {
|
|
||||||
// flex: "1 1 auto",
|
|
||||||
// bg: "transparent",
|
|
||||||
// color: "{text}",
|
|
||||||
// cursor: "default",
|
|
||||||
// borderRadius: "md",
|
|
||||||
// overflow: "auto",
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// USED IN COMPONENTS:
|
|
||||||
// * Settings Button
|
|
||||||
// * My Dashboard
|
|
||||||
const glassPanelRecipe = defineSlotRecipe({
|
|
||||||
slots: ["root", "header", "body"],
|
slots: ["root", "header", "body"],
|
||||||
|
|
||||||
// 🧊 THE GLASS MATH (Applies to everything)
|
|
||||||
base: {
|
base: {
|
||||||
root: {
|
root: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
position: "relative",
|
position: "relative",
|
||||||
|
...glassSurface,
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
borderRadius: "3xl",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
bg: {base: "rgba(255, 255, 255, 0.4)", _dark: "rgba(255, 255, 255, 0.04)"},
|
|
||||||
backdropFilter: "blur(12px)",
|
|
||||||
WebkitBackdropFilter: "blur(12px)",
|
|
||||||
border: "1px solid",
|
|
||||||
borderColor: {base: "gray.200", _dark: "whiteAlpha.200"},
|
|
||||||
boxShadow: "sm",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 📏 THE LAYOUTS (Applies selectively)
|
|
||||||
variants: {
|
|
||||||
layout: {
|
|
||||||
widget: {
|
|
||||||
root: {
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
borderRadius: "3xl",
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
alignItems: "center",
|
|
||||||
px: 3,
|
|
||||||
pt: 2,
|
|
||||||
pb: 0,
|
|
||||||
|
|
||||||
"& > p": {
|
|
||||||
color: "titleColor",
|
|
||||||
fontWeight: "500",
|
|
||||||
fontSize: "16px",
|
|
||||||
|
|
||||||
// the following three specifications are equivalent to Chakra's 'truncate' prop
|
|
||||||
whiteSpace: "nowrap",
|
|
||||||
overflow: "hidden",
|
|
||||||
textOverflow: "clip",
|
|
||||||
},
|
|
||||||
|
|
||||||
"& > button": {
|
|
||||||
borderRadius: "xl",
|
|
||||||
|
|
||||||
_hover: {
|
|
||||||
color: "white",
|
|
||||||
bg: "gray.500",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
body: {
|
|
||||||
flex: "1",
|
|
||||||
overflow: "hidden",
|
|
||||||
position: "relative",
|
|
||||||
px: 1,
|
|
||||||
pb: 1,
|
|
||||||
pt: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dropdown: {
|
|
||||||
root: {
|
|
||||||
borderRadius: "xl",
|
|
||||||
p: 1
|
|
||||||
}
|
|
||||||
// (Header and body slots are ignored here because dropdowns don't use them)
|
|
||||||
},
|
|
||||||
popover: {
|
|
||||||
root: {
|
|
||||||
borderRadius: "2xl",
|
|
||||||
p: 2,
|
|
||||||
boxShadow: "xl",
|
|
||||||
minW: "240px",
|
|
||||||
maxW: "60%",
|
|
||||||
minH: "80%",
|
|
||||||
overflow: "hidden",
|
|
||||||
// OVERRIDES: Make the background 85-90% opaque instead of 40%
|
|
||||||
bg: {
|
|
||||||
base: "rgba(255, 255, 255, 0.75)",
|
|
||||||
_dark: "rgba(20, 22, 25, 0.8)"
|
|
||||||
},
|
|
||||||
|
|
||||||
// OVERRIDES: Increase the blur just to smooth out any stubborn gridlines
|
|
||||||
backdropFilter: "blur(15px)",
|
|
||||||
WebkitBackdropFilter: "blur(15px)",
|
|
||||||
|
|
||||||
|
|
||||||
// IMPORTANT: everything below is specific to the widget menu found in the settingsButton component
|
|
||||||
// dialog header
|
|
||||||
"& > div.chakra-dialog__header": {
|
|
||||||
bg: "transparent",
|
|
||||||
color: {
|
|
||||||
base: "gray.800",
|
|
||||||
_dark: "white"
|
|
||||||
},
|
|
||||||
py: 4,
|
|
||||||
borderColor: {
|
|
||||||
base: "gray.200",
|
|
||||||
_dark: "whiteAlpha.200"
|
|
||||||
},
|
|
||||||
|
|
||||||
// title
|
|
||||||
"& h2": {
|
|
||||||
fontSize: "xl",
|
|
||||||
fontWeight: "bold"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// dialog body
|
|
||||||
"& > div.chakra-dialog__body": {
|
|
||||||
p: 0,
|
|
||||||
|
|
||||||
// box container of the widget category menu
|
|
||||||
"& div.chakra-tabs__root > div:first-child": {
|
|
||||||
position: "relative",
|
|
||||||
display: "flex",
|
|
||||||
maxW: "100%",
|
|
||||||
mx: 5,
|
|
||||||
mt: 4,
|
|
||||||
mb: 6
|
|
||||||
},
|
|
||||||
|
|
||||||
// the horizontal widget categories menu
|
|
||||||
"& div.chakra-tabs__list": {
|
|
||||||
bg: {
|
|
||||||
base: "rgba(0, 0, 0, 0.04)",
|
|
||||||
_dark: "rgba(255, 255, 255, 0.05)"
|
|
||||||
},
|
|
||||||
p: 1,
|
|
||||||
borderRadius: "full",
|
|
||||||
display: "flex",
|
|
||||||
flexWrap: "nowrap",
|
|
||||||
overflowX: "auto",
|
|
||||||
maxW: "100%",
|
|
||||||
border: "1px solid",
|
|
||||||
borderColor: {
|
|
||||||
base: "blackAlpha.50",
|
|
||||||
_dark: "whiteAlpha.100"
|
|
||||||
},
|
|
||||||
scrollbarWidth: "none",
|
|
||||||
"&::-webkit-scrollbar": {display: "none"},
|
|
||||||
|
|
||||||
// the pill shaped menu options
|
|
||||||
"& button.chakra-tabs__trigger": {
|
|
||||||
px: 5,
|
|
||||||
py: 2,
|
|
||||||
borderRadius: "full",
|
|
||||||
whiteSpace: "nowrap",
|
|
||||||
flexShrink: 0,
|
|
||||||
color: {
|
|
||||||
base: "gray.500",
|
|
||||||
_dark: "gray.400"
|
|
||||||
},
|
|
||||||
fontWeight: "medium",
|
|
||||||
transition: "background-color 0.2s, color 0.2s, box-shadow 0.2s",
|
|
||||||
_hover: {
|
|
||||||
color: {
|
|
||||||
base: "gray.800",
|
|
||||||
_dark: "gray.200"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
_selected: {
|
|
||||||
bg: {
|
|
||||||
base: "white",
|
|
||||||
_dark: "rgba(255, 255, 255, 0.12)"
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
base: "blue.600",
|
|
||||||
_dark: "blue.200"
|
|
||||||
},
|
|
||||||
boxShadow: "sm",
|
|
||||||
fontWeight: "bold",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// base styling applied to both chevron navigators
|
|
||||||
"& div.chakra-tabs__root > div:first-child div:has(svg)": {
|
|
||||||
position: "absolute",
|
|
||||||
top: "0",
|
|
||||||
bottom: "0",
|
|
||||||
w: "50px",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
zIndex: 2,
|
|
||||||
cursor: "pointer",
|
|
||||||
bg: {
|
|
||||||
base: "rgba(255, 255, 255, 0.7)",
|
|
||||||
_dark: "rgba(30, 30, 30, 0.8)"
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
base: "gray.600",
|
|
||||||
_dark: "gray.300"
|
|
||||||
},
|
|
||||||
backdropFilter: "blur(1px)",
|
|
||||||
transition: "background-color 0.2s",
|
|
||||||
|
|
||||||
_hover: {
|
|
||||||
color: {
|
|
||||||
base: "blue.500",
|
|
||||||
_dark: "blue.300"
|
|
||||||
},
|
|
||||||
bg: {
|
|
||||||
base: "rgba(255, 255, 255, 0.9)",
|
|
||||||
_dark: "rgba(40, 40, 40, 0.95)"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"&:has(.lucide-chevron-left)": {
|
|
||||||
left: 0,
|
|
||||||
borderTopLeftRadius: "full",
|
|
||||||
borderBottomLeftRadius: "full",
|
|
||||||
// Bites a transparent circle out of the flat right side!
|
|
||||||
WebkitMaskImage: "radial-gradient(circle at 100% 50%, transparent 30px, black 19px)",
|
|
||||||
maskImage: "radial-gradient(circle at 100% 50%, transparent 30px, black 35px)",
|
|
||||||
},
|
|
||||||
|
|
||||||
"&:has(.lucide-chevron-right)": {
|
|
||||||
right: 0,
|
|
||||||
borderTopRightRadius: "full",
|
|
||||||
borderBottomRightRadius: "full",
|
|
||||||
// THE MAGIC: Bites a transparent circle out of the flat left side!
|
|
||||||
WebkitMaskImage: "radial-gradient(circle at 0% 50%, transparent 30px, black 19px)",
|
|
||||||
maskImage: "radial-gradient(circle at 0% 50%, transparent 30px, black 35px)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
header: {
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
px: 3,
|
||||||
|
pt: 2,
|
||||||
|
pb: 0,
|
||||||
|
"& > p": {
|
||||||
|
color: "titleColor",
|
||||||
|
fontWeight: "500",
|
||||||
|
fontSize: "16px",
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "clip",
|
||||||
|
},
|
||||||
|
"& > button": {
|
||||||
|
borderRadius: "xl",
|
||||||
|
_hover: {color: "white", bg: "gray.500"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
body: {flex: "1", overflow: "hidden", position: "relative", px: 1, pb: 1, pt: 0},
|
||||||
|
},
|
||||||
|
variants: {
|
||||||
mode: {
|
mode: {
|
||||||
editing: {
|
editing: {
|
||||||
root: {
|
root: {
|
||||||
@@ -607,16 +338,116 @@ const glassPanelRecipe = defineSlotRecipe({
|
|||||||
borderWidth: "2px",
|
borderWidth: "2px",
|
||||||
borderColor: "orange.300",
|
borderColor: "orange.300",
|
||||||
cursor: "grab",
|
cursor: "grab",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultVariants: {
|
|
||||||
layout: "widget"
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 6. TRUE POPOVER: Compact floating card for 3-dots menus
|
||||||
|
const glassPopoverRecipe = defineSlotRecipe({
|
||||||
|
slots: ["content", "arrow", "positioner"],
|
||||||
|
base: {
|
||||||
|
content: {
|
||||||
|
...glassSurface,
|
||||||
|
borderRadius: "xl",
|
||||||
|
p: 3,
|
||||||
|
boxShadow: "lg",
|
||||||
|
bg: {base: "rgba(255, 255, 255, 0.85)", _dark: "rgba(20, 22, 25, 0.85)"},
|
||||||
|
backdropFilter: "blur(15px)",
|
||||||
|
WebkitBackdropFilter: "blur(15px)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 7. MODAL DIALOG: Large view for the Widget Shop
|
||||||
|
const glassDialogRecipe = defineSlotRecipe({
|
||||||
|
slots: ["content", "header", "body", "backdrop"],
|
||||||
|
base: {
|
||||||
|
backdrop: {
|
||||||
|
bg: "rgba(0, 0, 0, 0.4)",
|
||||||
|
backdropFilter: "blur(4px)",
|
||||||
|
WebkitBackdropFilter: "blur(4px)",
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
position: "relative",
|
||||||
|
...glassSurface,
|
||||||
|
borderRadius: "2xl",
|
||||||
|
p: 2,
|
||||||
|
boxShadow: "xl",
|
||||||
|
minW: "240px",
|
||||||
|
maxW: "60%",
|
||||||
|
minH: "80%",
|
||||||
|
overflow: "hidden",
|
||||||
|
bg: {base: "rgba(255, 255, 255, 0.75)", _dark: "rgba(20, 22, 25, 0.8)"},
|
||||||
|
backdropFilter: "blur(15px)",
|
||||||
|
WebkitBackdropFilter: "blur(15px)",
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
bg: "transparent",
|
||||||
|
color: {base: "gray.800", _dark: "white"},
|
||||||
|
py: 4,
|
||||||
|
borderColor: {base: "gray.200", _dark: "whiteAlpha.200"},
|
||||||
|
"& h2": {fontSize: "xl", fontWeight: "bold"},
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
p: 0,
|
||||||
|
"& div.chakra-tabs__root > div:first-child": {
|
||||||
|
position: "relative",
|
||||||
|
display: "flex",
|
||||||
|
maxW: "100%",
|
||||||
|
mx: 5,
|
||||||
|
mt: 4,
|
||||||
|
mb: 6
|
||||||
|
},
|
||||||
|
"& div.chakra-tabs__list": {
|
||||||
|
bg: {base: "rgba(0, 0, 0, 0.04)", _dark: "rgba(255, 255, 255, 0.05)"},
|
||||||
|
p: 1, borderRadius: "full", display: "flex", flexWrap: "nowrap", overflowX: "auto", maxW: "100%",
|
||||||
|
border: "1px solid", borderColor: {base: "blackAlpha.50", _dark: "whiteAlpha.100"},
|
||||||
|
scrollbarWidth: "none", "&::-webkit-scrollbar": {display: "none"},
|
||||||
|
"& button.chakra-tabs__trigger": {
|
||||||
|
px: 5, py: 2, borderRadius: "full", whiteSpace: "nowrap", flexShrink: 0,
|
||||||
|
color: {base: "gray.500", _dark: "gray.400"},
|
||||||
|
fontWeight: "medium", transition: "background-color 0.2s, color 0.2s, box-shadow 0.2s",
|
||||||
|
_hover: {color: {base: "gray.800", _dark: "gray.200"}},
|
||||||
|
_selected: {
|
||||||
|
bg: {base: "white", _dark: "rgba(255, 255, 255, 0.12)"},
|
||||||
|
color: {base: "blue.600", _dark: "blue.200"},
|
||||||
|
boxShadow: "sm",
|
||||||
|
fontWeight: "bold"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"& div.chakra-tabs__root > div:first-child div:has(svg)": {
|
||||||
|
position: "absolute", top: "0", bottom: "0", w: "50px", alignItems: "center", justifyContent: "center",
|
||||||
|
zIndex: 2, cursor: "pointer", bg: {base: "rgba(255, 255, 255, 0.7)", _dark: "rgba(30, 30, 30, 0.8)"},
|
||||||
|
color: {base: "gray.600", _dark: "gray.300"}, backdropFilter: "blur(1px)", transition: "background-color 0.2s",
|
||||||
|
_hover: {
|
||||||
|
color: {base: "blue.500", _dark: "blue.300"},
|
||||||
|
bg: {base: "rgba(255, 255, 255, 0.9)", _dark: "rgba(40, 40, 40, 0.95)"}
|
||||||
|
},
|
||||||
|
"&:has(.lucide-chevron-left)": {
|
||||||
|
left: 0,
|
||||||
|
borderTopLeftRadius: "full",
|
||||||
|
borderBottomLeftRadius: "full",
|
||||||
|
WebkitMaskImage: "radial-gradient(circle at 100% 50%, transparent 30px, black 19px)",
|
||||||
|
maskImage: "radial-gradient(circle at 100% 50%, transparent 30px, black 35px)"
|
||||||
|
},
|
||||||
|
"&:has(.lucide-chevron-right)": {
|
||||||
|
right: 0,
|
||||||
|
borderTopRightRadius: "full",
|
||||||
|
borderBottomRightRadius: "full",
|
||||||
|
WebkitMaskImage: "radial-gradient(circle at 0% 50%, transparent 30px, black 19px)",
|
||||||
|
maskImage: "radial-gradient(circle at 0% 50%, transparent 30px, black 35px)"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 6. Pill/Glass Expanding Tab Button
|
||||||
const glassTabRecipe = defineRecipe({
|
const glassTabRecipe = defineRecipe({
|
||||||
base: {
|
base: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -673,11 +504,14 @@ const glassTabRecipe = defineRecipe({
|
|||||||
bg: "{gooeyButtonBackground}",
|
bg: "{gooeyButtonBackground}",
|
||||||
cursor: "default",
|
cursor: "default",
|
||||||
textDecoration: "none",
|
textDecoration: "none",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
CONFIG & SYSTEM
|
||||||
|
========================================================================== */
|
||||||
const config = defineConfig({
|
const config = defineConfig({
|
||||||
globalCss: {
|
globalCss: {
|
||||||
".react-grid-placeholder": {
|
".react-grid-placeholder": {
|
||||||
@@ -716,36 +550,14 @@ const config = defineConfig({
|
|||||||
"::-webkit-scrollbar-track": {
|
"::-webkit-scrollbar-track": {
|
||||||
background: "transparent",
|
background: "transparent",
|
||||||
},
|
},
|
||||||
// '.leaflet-tile': {
|
".leaflet-control-zoom-in, .leaflet-control-zoom-out, .leaflet-control-attribution, .leaflet-container": {
|
||||||
// _dark: {
|
|
||||||
// filter: "invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%)",
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
'.leaflet-control-zoom-in, .leaflet-control-zoom-out, .leaflet-control-attribution, .leaflet-container': {
|
|
||||||
_dark: {
|
_dark: {
|
||||||
filter: "invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%)",
|
filter: "invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%)",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
'.leaflet-control-attribution': {
|
".leaflet-container": {
|
||||||
_dark: {
|
|
||||||
filter: "invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%)",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'.leaflet-container': {
|
|
||||||
fontFamily: "system-ui, sans-serif !important",
|
fontFamily: "system-ui, sans-serif !important",
|
||||||
_dark: {
|
|
||||||
filter: "invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%)",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// ".leaflet-popup-content": {
|
|
||||||
// fontFamily: "georgia, system-ui, sans-serif !important"
|
|
||||||
// },
|
|
||||||
// ".leaflet-control a": {
|
|
||||||
// fontFamily: "georgia, system-ui, sans-serif !important"
|
|
||||||
// },
|
|
||||||
// ".leaflet-tooltip": {
|
|
||||||
// fontFamily: "georgia, system-ui, sans-serif !important"
|
|
||||||
// },
|
|
||||||
".react-grid-item": {
|
".react-grid-item": {
|
||||||
transition: "none !important"
|
transition: "none !important"
|
||||||
},
|
},
|
||||||
@@ -753,22 +565,13 @@ const config = defineConfig({
|
|||||||
theme: {
|
theme: {
|
||||||
semanticTokens: {
|
semanticTokens: {
|
||||||
colors: {
|
colors: {
|
||||||
// base100: {value: {base: "#f6f9faff", _dark: "#1617199e"}},
|
text: { value: { base: "#000000", _dark: "#FFFFFF" } },
|
||||||
// base200: {value: {base: "#e6ecf1ff", _dark: "#242424"}},
|
textInverted: { value: { base: "#000000", _dark: "#FFFFFF" } }, // Fixed: Properly inverted
|
||||||
// base300: {value: {base: "#d3dae4ff", _dark: "#0a0b0bff"}},
|
MainBackground: { value: { base: "#F9F9F9", _dark: "#141414" } },
|
||||||
// primary: {value: {base: "#2B98F8", _dark: "#2B98F8"}},
|
titleColor: { value: { base: "gray.800", _dark: "#FFFFFF" } },
|
||||||
// primaryLt: {value: {base: "#98cdffff", _dark: "#98cdffff"}},
|
iconColor: { value: { base: "gray.600", _dark: "gray.300" } }, // Fixed: Visible in dark mode
|
||||||
// secondaryBG: {value: {base: "#EDF1F1", _dark: "#121212"}},
|
glassSeperator: { value: { base: "#0000001A", _dark: "#FFFFFF3F" } },
|
||||||
// border: {value: {base: "#000000", _dark: "#cbcbcb84"}},
|
|
||||||
text: {value: {base: "#000000", _dark: "#FFFFFF"}},
|
|
||||||
textInverted: {value: {base: "#000000", _dark: "#FFFFFF"}},
|
|
||||||
// icon: {value: {base: "#000000", _dark: "#FFFFFF"}},
|
|
||||||
|
|
||||||
gooeyButtonBackground: {value: {base: "rgba(255, 255, 255, 0.1)", _dark: "rgba(255, 255, 255, 0.1)"}},
|
gooeyButtonBackground: {value: {base: "rgba(255, 255, 255, 0.1)", _dark: "rgba(255, 255, 255, 0.1)"}},
|
||||||
MainBackground: {value: {base: "#F9F9F9", _dark: "#141414"}},
|
|
||||||
titleColor: {value: {base: "gray.800", _dark: "#FFFFFF"}},
|
|
||||||
iconColor: {value: {base: "gray.600", _dark: "#000000"}},
|
|
||||||
glassSeperator: {value: {base: "#0000001A", _dark: "#FFFFFF3F"}},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tokens: {
|
tokens: {
|
||||||
@@ -778,20 +581,17 @@ const config = defineConfig({
|
|||||||
},
|
},
|
||||||
recipes: {
|
recipes: {
|
||||||
dashboard: dashboardRecipe,
|
dashboard: dashboardRecipe,
|
||||||
// canvas: canvasRecipe,
|
glassTab: glassTabRecipe,
|
||||||
glassTab: glassTabRecipe
|
|
||||||
},
|
},
|
||||||
slotRecipes: {
|
slotRecipes: {
|
||||||
header: headerRecipe,
|
header: headerRecipe,
|
||||||
sidebar: sidebarRecipe,
|
sidebar: sidebarRecipe,
|
||||||
// widget: widgetRecipe,
|
|
||||||
widgetSettings: widgetSettingsRecipe,
|
|
||||||
glassPanel: glassPanelRecipe,
|
|
||||||
home: homeRecipe,
|
home: homeRecipe,
|
||||||
|
widget: widgetRecipe,
|
||||||
|
glassPopover: glassPopoverRecipe,
|
||||||
|
glassDialog: glassDialogRecipe,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Define semantic tokens and export recipes
|
|
||||||
export const system = createSystem(defaultConfig, config);
|
export const system = createSystem(defaultConfig, config);
|
||||||
Reference in New Issue
Block a user