diff --git a/client/src/components/Widgets/IvansAlerts.jsx b/client/src/components/Widgets/IvansAlerts.jsx index 33a54af..d857f2d 100644 --- a/client/src/components/Widgets/IvansAlerts.jsx +++ b/client/src/components/Widgets/IvansAlerts.jsx @@ -112,16 +112,16 @@ export default function IvansAlerts({ settings, widgetID }) { {/* This box needs to be at h="100%" for the pdf toolbar to appear */} - Preparer: {item?.preparer} + Preparer: {item?.preparer} {item?.summary} {item?.files?.map((file, index) => { return ( - + - File: + File: - + {file?.name} @@ -131,12 +131,12 @@ export default function IvansAlerts({ settings, widgetID }) { type="application/pdf" style={{ width: '100%', height: '100%', display: 'block' }} > - + Your browser cannot display this PDF directly. - Download PDF Instead + Download PDF Instead diff --git a/client/src/components/Widgets/settings/AlertChangeSettings.jsx b/client/src/components/Widgets/settings/AlertChangeSettings.jsx index 34340fd..106aa21 100644 --- a/client/src/components/Widgets/settings/AlertChangeSettings.jsx +++ b/client/src/components/Widgets/settings/AlertChangeSettings.jsx @@ -13,20 +13,22 @@ import { useFilter, useListCollection, Wrap, - Badge + Badge, Separator, HStack, useSlotRecipe } from "@chakra-ui/react"; import { useDashboardStore } from "@/store/useDashboardStore.jsx"; import { useState, useMemo } from "react"; export default function AlertChangeSettings({ widgetId, currentSettings }) { + // STYLING + const popoverRecipe = useSlotRecipe({ key: "glassPopover" }); + const popoverStyles = popoverRecipe(); + + // STATE MANAGEMENT const updateSettings = useDashboardStore( (state) => state.updateWidgetSettings, ); const [startError, setStartError] = useState(null); const [endError, setEndError] = useState(null); - - console.log("currentSettings:", currentSettings); - const [selectedVolcanoes, setSelectedVolcanoes] = useState([]); const { startsWith } = useFilter({ sensitivity: "base" }); @@ -36,6 +38,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { limit: 10, }); + // FUNCTIONS const handleValueChange = (details) => { setSelectedVolcanoes(details.value) } @@ -45,14 +48,11 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { {/* SELECTING DATE RANGE */} - - - - Date Range Selection - -
{/*line seperator*/} -
- + + Date Range Selection + {/*line seperator*/} + + {/* start date */} { const value = e.target.value; @@ -109,8 +108,8 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { { const value = e.target.value; @@ -137,18 +136,15 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { {/* FILTERS */} - - - Filters - -
{/*line seperator*/} -
+ + Filters + {/*line seperator*/} + {/* level increases */} { updateSettings(widgetId, { @@ -167,15 +163,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { Level Increases - + {/* level decreases */} { updateSettings(widgetId, { @@ -194,15 +189,14 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { Level Decreases - + {/* elevated levels */} { updateSettings(widgetId, { @@ -221,7 +215,7 @@ export default function AlertChangeSettings({ widgetId, currentSettings }) { Only Elevated Levels - +
diff --git a/client/src/components/Widgets/settings/CommCoorReportSettings.jsx b/client/src/components/Widgets/settings/CommCoorReportSettings.jsx index 4e52fde..ff82e98 100644 --- a/client/src/components/Widgets/settings/CommCoorReportSettings.jsx +++ b/client/src/components/Widgets/settings/CommCoorReportSettings.jsx @@ -1,12 +1,18 @@ -import {Button, Field, Flex, Input, Switch, Text, Fieldset, Separator, HStack} from "@chakra-ui/react"; +import {Button, Field, Flex, Input, Switch, Text, Fieldset, Separator, HStack, useSlotRecipe} from "@chakra-ui/react"; import {useDashboardStore} from "@/store/useDashboardStore.jsx"; import {useState} from "react"; export default function CommCoorReportSettings({ widgetId, currentSettings }) { + // STYLING + const popoverRecipe = useSlotRecipe({ key: "glassPopover" }); + const popoverStyles = popoverRecipe(); + + // STATE MANAGEMENT const updateSettings = useDashboardStore(state => state.updateWidgetSettings); const [startError, setStartError] = useState(null); const [endError, setEndError] = useState(null); + // FUNCTIONS const handleCopyToClipboard = () => { updateSettings(widgetId, {copyToClipboard: true}); } @@ -19,12 +25,13 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) { + {/* SELECTING DATE RANGE */} Date Range Selection {/*line seperator*/} - {/* SELECTING DATE RANGE */} - + + {/* start date */} @@ -33,6 +40,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) { { @@ -51,6 +59,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) { + {/* end date */} @@ -59,6 +68,7 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) { { @@ -85,9 +95,9 @@ export default function CommCoorReportSettings({ widgetId, currentSettings }) { {/* COPY TO CLIPBOARD */} - + {/* DOWNLOAD REPORT */} - + diff --git a/client/src/components/Widgets/settings/IvansAlertsSettings.jsx b/client/src/components/Widgets/settings/IvansAlertsSettings.jsx index d64da90..2b3939d 100644 --- a/client/src/components/Widgets/settings/IvansAlertsSettings.jsx +++ b/client/src/components/Widgets/settings/IvansAlertsSettings.jsx @@ -15,14 +15,16 @@ import {useDashboardStore} from "../../../store/useDashboardStore.jsx"; import {useState} from "react"; export default function IvansAlertsSettings({ widgetId, currentSettings }) { + // STYLING + const popoverRecipe = useSlotRecipe({ key: "glassPopover" }); + const popoverStyles = popoverRecipe(); + + // STATE MANAGEMENT const updateSettings = useDashboardStore(state => state.updateWidgetSettings); const [startError, setStartError] = useState(null); const [endError, setEndError] = useState(null); - const popoverRecipe = useSlotRecipe({ key: "glassPopover" }); - const popoverStyles = popoverRecipe(); - - + // FUNCTIONS const handleCopyToClipboard = () => { updateSettings(widgetId, {copyToClipboard: true}); } @@ -40,13 +42,11 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) { {/* SELECTING DATE RANGE */} - - - {/*line seperator*/} - Date Range Selection - {/*line seperator*/} + + Date Range Selection + {/*line seperator*/} - + {/* start date */} { const value = e.target.value; @@ -106,7 +106,7 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) { type="date" w="100%" borderRadius="lg" - bg="widgetBadgeBg" + css={popoverStyles.date} value={currentSettings?.endDate || ""} onChange={(e) => { const value = e.target.value; @@ -132,20 +132,18 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) { {/* SORTS */} - {/*line seperator*/} Sorts - {/*line seperator*/} + {/*line seperator*/} {/* time sort */} - - + + Oldest to Newest @@ -154,26 +152,23 @@ export default function IvansAlertsSettings({ widgetId, currentSettings }) { - - + + Alphabetically by Volcano - {/*line seperator*/} Filters - {/*line seperator*/} + {/*line seperator*/} {/* elevated levels */} - + {/* COPY TO CLIPBOARD */} - {/*line seperator*/} Tools - {/*line seperator*/} + {/*line seperator*/} - + diff --git a/client/src/components/Widgets/settings/RemoteSensingSettings.jsx b/client/src/components/Widgets/settings/RemoteSensingSettings.jsx index 15ebb7e..d08bf73 100644 --- a/client/src/components/Widgets/settings/RemoteSensingSettings.jsx +++ b/client/src/components/Widgets/settings/RemoteSensingSettings.jsx @@ -1,12 +1,18 @@ -import {Button, Field, Flex, Input, Switch, Text} from "@chakra-ui/react"; +import {Button, Field, Flex, HStack, Input, Separator, Switch, Text, useSlotRecipe, Fieldset} from "@chakra-ui/react"; import {useDashboardStore} from "@/store/useDashboardStore.jsx"; import {useState} from "react"; export default function RemoteSensingSettings({ widgetId, currentSettings }) { + // STYLING + const popoverRecipe = useSlotRecipe({ key: "glassPopover" }); + const popoverStyles = popoverRecipe(); + + // STATE MANAGEMENT const updateSettings = useDashboardStore(state => state.updateWidgetSettings); const [startError, setStartError] = useState(null); const [endError, setEndError] = useState(null); + // FUNCTIONS const handleCopyToClipboard = () => { updateSettings(widgetId, {copyToClipboard: true}); } @@ -21,88 +27,111 @@ export default function RemoteSensingSettings({ widgetId, currentSettings }) { return ( - {/* COPYING TO CLIPBOARD */} - + + + {/* SELECTING DATE RANGE */} + + Date Range Selection + {/*line seperator*/} + + + {/* start date */} + + + + Start Date + + + - - - - - Sort Oldest to Newest - - - - - - - Sort by Volcano - + value={currentSettings?.startDate || ""} + onChange={(e) => { + const value = e.target.value; + updateSettings(widgetId, {...currentSettings, startDate: value}); - {/* SELECTING DATE RANGE */} - - - - - Start Date - - - { - const value = e.target.value; - updateSettings(widgetId, {...currentSettings, startDate: value}); + const dateSelected = new Date(value); + const today = new Date(); + today.setHours(0, 0, 0, 0); - const dateSelected = new Date(value); - const today = new Date(); - today.setHours(0, 0, 0, 0); + if (value && (dateSelected > today)) setStartError("Can't Choose a Future Date"); + else setStartError(""); + }} + /> + {startError && {startError}} + + + - if (value && (dateSelected > today)) setStartError("Can't Choose a Future Date"); - else setStartError(""); - }} - /> - {startError && {startError}} - + {/* end date */} + + + + End Date + + + { + const value = e.target.value; + updateSettings(widgetId, {...currentSettings, endDate: value}); + + const dateSelected = new Date(value); + const today = new Date(); + today.setHours(0, 0, 0, 0); + + if (value && (dateSelected > today)) setEndError("Can't Choose a Future Date"); + else setEndError(""); + }} + /> + {endError && {endError}} + + + - - - - - End Date - - - { - const value = e.target.value; - updateSettings(widgetId, {...currentSettings, endDate: value}); - const dateSelected = new Date(value); - const today = new Date(); - today.setHours(0, 0, 0, 0); + {/* SORTING */} + + Sorting + {/*line seperator*/} + + + + + + + Oldest to Newest + - if (value && (dateSelected > today)) setEndError("Can't Choose a Future Date"); - else setEndError(""); - }} - /> - {endError && {endError}} - - - - + + + + + + By Volcano + + + {/* COPYING TO CLIPBOARD */} + + Tools + {/*line seperator*/} + + + + ) } \ No newline at end of file diff --git a/client/src/theme.js b/client/src/theme.js index 7dd4d5d..1252976 100644 --- a/client/src/theme.js +++ b/client/src/theme.js @@ -68,8 +68,8 @@ const sidebarRecipe = defineSlotRecipe({ root: { // 1. Semi-transparent backgrounds bg: { - base: "linear-gradient(to bottom right, #97282880 20%, #EB7F3160 60%, #FCAD3840 100%)", - _dark: "linear-gradient(to bottom right, #9900003C 20%, #FF66003C 60%, #FFC0003C 100%)" + base: "linear-gradient(to bottom right, #B63B1F88 20%, #FF990060 70%, #FFBF0040 90%)", + _dark: "linear-gradient(to bottom right, #9900004C 20%, #FF66003C 60%, #FFAE003C 100%)" }, // 2. The glass blur effect @@ -346,7 +346,7 @@ const widgetRecipe = defineSlotRecipe({ // 6. TRUE POPOVER: Compact floating card for 3-dots menus const glassPopoverRecipe = defineSlotRecipe({ - slots: ["content", "arrow", "positioner", "checkboxcard", "checkbox"], + slots: ["content", "arrow", "positioner", "date", "checkboxcard", "checkbox", "switch", "button"], base: { content: { ...glassSurface, @@ -357,31 +357,90 @@ const glassPopoverRecipe = defineSlotRecipe({ backdropFilter: "blur(15px)", WebkitBackdropFilter: "blur(15px)", }, + date: { + color: "text", + bg: "widgetBadgeBg", + borderRadius: "lg", + h: "2rem", + _focus: { + borderStyle: "none", + } + }, checkboxcard: { + // applies to both dark & lt modes + w: "100%", + borderRadius: "lg", + color: "text", + + "& div[data-part='control']": { + alignItems: "center", + padding: "6px", + }, + bg: "widgetItemBg", - _hover: { - bg: "widgetBadgeBg" - }, _checked: { - bg: "orange.700" + boxShadow: "none", + bg: "rgb(182 59 31 / 0.2)", + borderColor: "#B63B1F" }, + _dark: { bg: "widgetBadgeBg", - _hover: { - bg: "widgetInnerBadgeBg" - }, _checked: { - bg: "orange.700", - _hover: { - bg: "orange.700/50" - } + boxShadow: "none", + color: "text", + bg: "#503D40", + borderColor: "#B55038" } } }, checkbox: { bg: "widgetInnerBadgeBg", _checked: { - bg: "orange" + bg: "#B63B1F", + borderColor: "#B63B1F" + }, + + _dark: { + bg: "widgetBadgeBg", + _checked: { + color: "text", + bg: "#B55038", + borderColor: "#B55038" + } + } + }, + switch: { + color: "text", + bg: "widgetBadgeBg", + + _checked: { + bg: "#B63B1F", + + _dark: { + bg: "#b55038" + } + }, + }, + button: { + w: "100%", + fontSize: "xs", + h: "2rem", + borderRadius: "lg", + + color: "white", + bg: "#B63B1F", + _hover: { + color: "text", + bg: "#B63B1F32" + }, + + _dark: { + bg: "#b55038", + color: "text", + _hover: { + bg: "#503D40" + } } } }, @@ -620,7 +679,7 @@ const config = defineConfig({ widgetItemBg: { value: { base: "rgb(115 132 166 / 0.17)", _dark: "rgb(51 53 64)" } }, widgetItemExpandedBg: { value: { base: "rgb(184 197 220 / 0.17)", _dark: "rgb(59 61 73)" } }, widgetBadgeBg: { value: { base: "rgb(154 163 179 / 0.45)", _dark: "rgb(75 77 90)" } }, - widgetInnerBadgeBg: { value: { base: "rgb(154 163 179 / 0.45)", _dark: "rgb(100 103 119)" } }, + widgetInnerBadgeBg: { value: { base: "rgb(224 226 232)", _dark: "rgb(100 103 119)" } }, widgetTextMuted: { value: { base: "#262627", _dark: "rgb(236 236 236 / 0.9)" } }, // ALERT COLORS