Skip to content

Commit

Permalink
Merge branch 'next' into schema-8
Browse files Browse the repository at this point in the history
  • Loading branch information
jthrilly authored Dec 5, 2024
2 parents ae6953b + 58629b4 commit 5a5dcb9
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 142 deletions.
6 changes: 3 additions & 3 deletions components/ui/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const alertVariants = cva(
variants: {
variant: {
default: '',
info: 'border-info bg-info/10 [--link:var(--info)] [&>svg]:text-info',
info: 'bg-info/5 border-info text-info [--color-link:var(--color-info)] [&>svg]:text-info',
destructive:
'border-destructive bg-destructive/5 text-destructive dark:border-destructive [&>svg]:text-destructive [--link:var(--destructive)]',
'bg-destructive/5 border-destructive text-destructive [&>svg]:text-destructive [--color-link:var(--color-destructive)]',
success:
'border-success bg-success/10 text-success-foreground [&>svg]:text-success-foreground [--link:var(--success-foreground)]',
'bg-success/5 border-success text-success [&>svg]:text-success [--color-link:var(--color-success)]',
},
},
defaultVariants: {
Expand Down
11 changes: 3 additions & 8 deletions components/ui/AlertDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as React from 'react';
import { type VariantProps } from 'class-variance-authority';
import { buttonVariants } from '~/components/ui/Button';
import { cn } from '~/utils/shadcn';
import { dialogContentClasses, dialogOverlayClasses } from './dialog';
import Heading from './typography/Heading';
import { paragraphVariants } from './typography/Paragraph';

Expand All @@ -24,10 +25,7 @@ const AlertDialogOverlay = React.forwardRef<
// eslint-disable-next-line @typescript-eslint/no-unused-vars
>(({ className, children, ...props }, ref) => (
<AlertDialogPrimitive.Overlay
className={cn(
'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className,
)}
className={dialogOverlayClasses(className)}
{...props}
ref={ref}
/>
Expand All @@ -42,10 +40,7 @@ const AlertDialogContent = React.forwardRef<
<AlertDialogOverlay />
<AlertDialogPrimitive.Content
ref={ref}
className={cn(
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full',
className,
)}
className={dialogContentClasses(className)}
{...props}
/>
</AlertDialogPortal>
Expand Down
26 changes: 17 additions & 9 deletions components/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,32 @@ const DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (
);
DialogPortal.displayName = DialogPrimitive.Portal.displayName;

export const dialogOverlayClasses = (className?: string) =>
cn(
'bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm',
className,
);

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
ref={ref}
className={cn(
'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
className,
)}
className={dialogOverlayClasses(className)}
{...props}
/>
));
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;

export const dialogContentClasses = (className?: string) =>
cn(
'fixed top-[50%] left-[50%] z-50 max-h-screen w-full max-w-2xl translate-x-[-50%] translate-y-[-50%] md:w-full',
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-85 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[10%] data-[state=open]:slide-in-from-top-[10%] duration-300',
'bg-card flex flex-col gap-4 border p-6 shadow-lg sm:rounded-lg',
className,
);

const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
Expand All @@ -40,14 +51,11 @@ const DialogContent = React.forwardRef<
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
className={cn(
'fixed left-[50%] top-[50%] z-50 flex max-h-screen w-full max-w-2xl translate-x-[-50%] translate-y-[-50%] flex-col gap-4 border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full',
className,
)}
className={dialogContentClasses(className)}
{...props}
>
{children}
<DialogPrimitive.Close className="focus:ring-ring absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
<DialogPrimitive.Close className="focus:ring-ring ring-offset-background data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
Expand Down
8 changes: 4 additions & 4 deletions components/ui/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef<
<ToastPrimitives.Viewport
ref={ref}
className={cn(
'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]',
className,
)}
{...props}
Expand All @@ -35,7 +35,7 @@ const toastVariants = cva(toastBaseClasses, {
destructive:
'destructive group border-destructive bg-destructive text-destructive-foreground',
success:
'success group border-success bg-success/10 text-success-foreground backdrop-blur',
'success group border-success bg-success text-success-foreground',
},
},
defaultVariants: {
Expand Down Expand Up @@ -65,7 +65,7 @@ const ToastAction = React.forwardRef<
<ToastPrimitives.Action
ref={ref}
className={cn(
'focus:ring-ring inline-flex h-8 shrink-0 items-center justify-center rounded-md border px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
'focus:ring-ring ring-offset-background hover:bg-secondary group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none disabled:opacity-50',
className,
)}
{...props}
Expand All @@ -80,7 +80,7 @@ const ToastClose = React.forwardRef<
<ToastPrimitives.Close
ref={ref}
className={cn(
'absolute right-2 top-2 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100',
'absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100 focus:ring-2 focus:outline-hidden',
className,
)}
toast-close=""
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fresco",
"version": "2.0.1",
"version": "2.0.2",
"private": true,
"type": "module",
"packageManager": "[email protected]+sha256.9551e803dcb7a1839fdf5416153a844060c7bce013218ce823410532504ac10b",
Expand Down Expand Up @@ -69,17 +69,17 @@
"lucia": "^2.7.7",
"lucide-react": "^0.314.0",
"luxon": "^3.5.0",
"motion": "^11.11.17",
"motion": "^11.12.0",
"next": "^14.2.16",
"nuqs": "^1.19.1",
"ohash": "^1.1.4",
"papaparse": "^5.4.1",
"react": "18.3.1",
"react-compound-slider": "^3.4.0",
"react-dom": "18.3.1",
"react-dropzone": "^14.2.3",
"react-dropzone": "^14.3.5",
"react-flip-toolkit": "^7.2.4",
"react-hook-form": "^7.53.0",
"react-hook-form": "^7.53.2",
"react-markdown": "^9.0.1",
"react-redux": "^8.1.3",
"react-resize-aware": "^4.0.0",
Expand Down Expand Up @@ -141,12 +141,12 @@
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.9",
"prisma": "^5.22.0",
"sass": "^1.79.1",
"sass": "^1.81.0",
"tailwindcss": "4.0.0-beta.3",
"tailwindcss-animate": "^1.0.7",
"tsx": "^4.19.2",
"typescript": "5.6.3",
"vite-tsconfig-paths": "^5.1.2",
"vitest": "^2.1.5"
"vitest": "^2.1.7"
}
}
Loading

0 comments on commit 5a5dcb9

Please sign in to comment.