Skip to content

Commit

Permalink
starts connecting filters and fetching of filters
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Mar 7, 2024
1 parent 1dd2e68 commit e461c46
Show file tree
Hide file tree
Showing 13 changed files with 554 additions and 594 deletions.
6 changes: 4 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test": "start-server-and-test 'yarn build && yarn start' http://localhost:3000/auth/signin 'nyc --reporter nyc-report-lcov-absolute yarn cypress:headless'"
},
"dependencies": {
"@date-fns/utc": "1.1.1",
"@deck.gl/carto": "^8.9.35",
"@deck.gl/core": "8.8.6",
"@deck.gl/extensions": "8.8.6",
Expand All @@ -39,7 +40,7 @@
"@radix-ui/react-collapsible": "1.0.3",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-popover": "1.0.7",
"@radix-ui/react-radio-group": "1.1.3",
"@radix-ui/react-select": "2.0.0",
"@radix-ui/react-slot": "1.0.2",
Expand All @@ -59,7 +60,7 @@
"d3-array": "3.0.2",
"d3-format": "3.0.1",
"d3-scale": "4.0.2",
"date-fns": "2.22.1",
"date-fns": "3.3.1",
"fuse.js": "6.4.6",
"jsona": "1.9.2",
"lodash-es": "4.17.21",
Expand All @@ -73,6 +74,7 @@
"query-string": "8.1.0",
"rc-tree": "5.7.0",
"react": "18.2.0",
"react-day-picker": "8.10.0",
"react-dom": "18.2.0",
"react-dropzone": "14.2.2",
"react-hook-form": "7.43.1",
Expand Down
57 changes: 57 additions & 0 deletions client/src/components/ui/calendar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as React from 'react';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { DayPicker } from 'react-day-picker';

import { cn } from '@/lib/utils';
import { buttonVariants } from '@/components/ui/button';

export type CalendarProps = React.ComponentProps<typeof DayPicker>;

function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
return (
<DayPicker
showOutsideDays={showOutsideDays}
className={cn('p-3', className)}
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',
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: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]',
row: 'flex w-full mt-2',
cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',
day: cn(
buttonVariants({ variant: 'ghost' }),
'h-9 w-9 p-0 font-normal aria-selected:opacity-100',
),
day_range_end: 'day-range-end',
day_selected:
'bg-navy-400 text-primary-foreground hover:bg-navy-600 hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
day_today: 'bg-accent text-accent-foreground',
day_outside:
'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
day_disabled: 'text-muted-foreground opacity-50',
day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
day_hidden: 'invisible',
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
}}
{...props}
/>
);
}
Calendar.displayName = 'Calendar';

export { Calendar };
Loading

0 comments on commit e461c46

Please sign in to comment.