Skip to content

Commit

Permalink
build(deps): bump react-day-picker from 8.10.1 to 9.2.0 in /autogpt_p…
Browse files Browse the repository at this point in the history
…latform/frontend (#8442)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
  • Loading branch information
dependabot[bot] and ntindle authored Oct 25, 2024
1 parent e990a9d commit 4730bf6
Show file tree
Hide file tree
Showing 4 changed files with 685 additions and 519 deletions.
2 changes: 1 addition & 1 deletion autogpt_platform/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"next": "^14.2.13",
"next-themes": "^0.3.0",
"react": "^18",
"react-day-picker": "^8.10.1",
"react-day-picker": "^9.2.0",
"react-dom": "^18",
"react-hook-form": "^7.52.1",
"react-icons": "^5.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const FlowRunsStatus: React.FC<{
/* "dateMin": since the first flow in the dataset
* number > 0: custom date (unix timestamp)
* number < 0: offset relative to Date.now() (in seconds) */
const [selected, setSelected] = useState<Date>();
const [statsSince, setStatsSince] = useState<number | "dataMin">(-24 * 3600);
const statsSinceTimestamp = // unix timestamp or null
typeof statsSince == "string"
Expand Down Expand Up @@ -74,10 +75,11 @@ export const FlowRunsStatus: React.FC<{
<PopoverContent className="w-auto p-0" align="start">
<Calendar
mode="single"
onSelect={(_, selectedDay) =>
setStatsSince(selectedDay.getTime())
}
initialFocus
selected={selected}
onSelect={(_, selectedDay) => {
setSelected(selectedDay);
setStatsSince(selectedDay.getTime());
}}
/>
</PopoverContent>
</Popover>
Expand Down
62 changes: 37 additions & 25 deletions autogpt_platform/frontend/src/components/ui/calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"use client";

import * as React from "react";
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
import {
ChevronDownIcon,
ChevronLeftIcon,
ChevronRightIcon,
ChevronUpIcon,
} from "@radix-ui/react-icons";
import { DayPicker } from "react-day-picker";

import { cn } from "@/lib/utils";
Expand All @@ -22,47 +27,54 @@ function Calendar({
classNames={{
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
month: "space-y-4",
caption: "flex justify-center pt-1 relative items-center",
month_caption: "flex justify-center pt-1 relative items-center",
caption_label: "text-sm font-medium",
nav: "space-x-1 flex items-center",
nav_button: cn(
buttonVariants({ variant: "outline" }),
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
),
nav_button_previous: "absolute left-1",
nav_button_next: "absolute right-1",
table: "w-full border-collapse space-y-1",
head_row: "flex",
head_cell:
button_previous:
"absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
button_next:
"absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
month_grid: "w-full border-collapse space-y-1",
weekdays: "flex",
weekday:
"text-neutral-500 rounded-md w-8 font-normal text-[0.8rem] dark:text-neutral-400",
row: "flex w-full mt-2",
cell: cn(
week: "flex w-full mt-2",
day: cn(
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-neutral-100 [&:has([aria-selected].day-outside)]:bg-neutral-100/50 [&:has([aria-selected].day-range-end)]:rounded-r-md dark:[&:has([aria-selected])]:bg-neutral-800 dark:[&:has([aria-selected].day-outside)]:bg-neutral-800/50",
props.mode === "range"
? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md"
: "[&:has([aria-selected])]:rounded-md",
),
day: cn(
day_button: cn(
buttonVariants({ variant: "ghost" }),
"h-8 w-8 p-0 font-normal aria-selected:opacity-100",
),
day_range_start: "day-range-start",
day_range_end: "day-range-end",
day_selected:
"bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
day_today:
range_start: "range-start",
range_end: "range-end",
selected:
"bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-700 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
today:
"bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50",
day_outside:
outside:
"day-outside text-neutral-500 opacity-50 aria-selected:bg-neutral-100/50 aria-selected:text-neutral-500 aria-selected:opacity-30 dark:text-neutral-400 dark:aria-selected:bg-neutral-800/50 dark:aria-selected:text-neutral-400",
day_disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
day_range_middle:
disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
range_middle:
"aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50",
day_hidden: "invisible",
hidden: "invisible",
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4" />,
Chevron: (props) => {
if (props.orientation === "left") {
return <ChevronLeftIcon className="h-4 w-4" />;
} else if (props.orientation === "right") {
return <ChevronRightIcon className="h-4 w-4" />;
} else if (props.orientation === "down") {
return <ChevronDownIcon className="h-4 w-4" />;
} else {
return <ChevronUpIcon className="h-4 w-4" />;
}
},
}}
{...props}
/>
Expand Down
Loading

0 comments on commit 4730bf6

Please sign in to comment.