move sdk packages to its own folder and rename api & dashboard

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-11 13:15:44 +01:00
parent 1ca95442b9
commit 6d4f9010d4
318 changed files with 350 additions and 351 deletions

View File

@@ -0,0 +1,45 @@
'use client';
import * as React from 'react';
import { cn } from '@/utils/cn';
import type { VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
const inputVariant = cva(
'flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50',
{
variants: {
size: {
default: 'h-8 px-3 py-2 text-sm',
large: 'h-12 px-4 py-3 text-lg',
},
},
defaultVariants: {
size: 'default',
},
}
);
export type InputProps = VariantProps<typeof inputVariant> &
Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
error?: string | undefined;
};
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, error, type, size, ...props }, ref) => {
return (
<input
type={type}
className={cn(
inputVariant({ size, className }),
!!error && 'border-destructive'
)}
ref={ref}
{...props}
/>
);
}
);
Input.displayName = 'Input';
export { Input };