init
This commit is contained in:
7
src/components/ui/Badge.tsx
Normal file
7
src/components/ui/Badge.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
export const Badge = ({ children }: PropsWithChildren) => (
|
||||
<span className='px-2 py-0.5 rounded-full border text-xs bg-gray-50'>{children}</span>
|
||||
);
|
||||
|
||||
|
||||
21
src/components/ui/Button.tsx
Normal file
21
src/components/ui/Button.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { ButtonHTMLAttributes, PropsWithChildren } from 'react';
|
||||
|
||||
import { cls } from '../../utils/cls';
|
||||
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, PropsWithChildren {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Button = ({ className = '', children, ...rest }: ButtonProps) => (
|
||||
<button
|
||||
className={cls(
|
||||
'inline-flex items-center gap-2 px-4 py-2 rounded-2xl border text-sm bg-white hover:bg-gray-50 transition-colors',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
|
||||
|
||||
21
src/components/ui/Card.tsx
Normal file
21
src/components/ui/Card.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
import { cls } from '../../utils/cls';
|
||||
|
||||
interface CardProps extends PropsWithChildren {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Card = ({ className = '', children }: CardProps) => (
|
||||
<div className={cls('rounded-2xl border bg-white shadow-sm', className)}>{children}</div>
|
||||
);
|
||||
|
||||
export const CardHeader = ({ children }: PropsWithChildren) => (
|
||||
<div className='px-5 pt-4 pb-2 font-medium flex items-center justify-between'>{children}</div>
|
||||
);
|
||||
|
||||
export const CardContent = ({ children }: PropsWithChildren) => (
|
||||
<div className='px-5 pb-5'>{children}</div>
|
||||
);
|
||||
|
||||
|
||||
13
src/components/ui/InfoCard.tsx
Normal file
13
src/components/ui/InfoCard.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
interface InfoCardProps {
|
||||
label: React.ReactNode;
|
||||
value: React.ReactNode;
|
||||
}
|
||||
|
||||
export const InfoCard = ({ label, value }: InfoCardProps) => (
|
||||
<div className='p-3 rounded-xl border flex items-center justify-between text-sm'>
|
||||
<span>{label}</span>
|
||||
<span className='text-lg font-semibold'>{value}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
19
src/components/ui/Input.tsx
Normal file
19
src/components/ui/Input.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { InputHTMLAttributes } from 'react';
|
||||
|
||||
import { cls } from '../../utils/cls';
|
||||
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Input = ({ className = '', ...rest }: InputProps) => (
|
||||
<input
|
||||
className={cls(
|
||||
'w-full rounded-2xl border px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-gray-200',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
7
src/components/ui/index.ts
Normal file
7
src/components/ui/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './Badge';
|
||||
export * from './Button';
|
||||
export * from './Card';
|
||||
export * from './InfoCard';
|
||||
export * from './Input';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user