diff --git a/packages/ui/src/components/Badge.tsx b/packages/ui/src/components/Badge.tsx new file mode 100644 index 0000000..05baa96 --- /dev/null +++ b/packages/ui/src/components/Badge.tsx @@ -0,0 +1,27 @@ +import type { HTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface BadgeProps extends HTMLAttributes { + variant?: 'default' | 'accent' | 'danger' | 'warning' | 'success' | 'muted'; + children: ReactNode; +} + +export function Badge({ variant = 'default', className, children, ...props }: BadgeProps) { + return ( + + {children} + + ); +} diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsx new file mode 100644 index 0000000..4493aa9 --- /dev/null +++ b/packages/ui/src/components/Button.tsx @@ -0,0 +1,30 @@ +import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface ButtonProps extends ButtonHTMLAttributes { + variant?: 'ghost' | 'primary' | 'danger'; + size?: 'sm' | 'md'; + children: ReactNode; +} + +export function Button({ variant = 'ghost', size = 'sm', className, children, ...props }: ButtonProps) { + return ( + + ); +} diff --git a/packages/ui/src/components/IconButton.tsx b/packages/ui/src/components/IconButton.tsx new file mode 100644 index 0000000..585005c --- /dev/null +++ b/packages/ui/src/components/IconButton.tsx @@ -0,0 +1,27 @@ +import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface IconButtonProps extends ButtonHTMLAttributes { + active?: boolean; + size?: 'sm' | 'md'; + children: ReactNode; +} + +export function IconButton({ active, size = 'md', className, children, ...props }: IconButtonProps) { + return ( + + ); +} diff --git a/packages/ui/src/components/ListItem.tsx b/packages/ui/src/components/ListItem.tsx new file mode 100644 index 0000000..852414b --- /dev/null +++ b/packages/ui/src/components/ListItem.tsx @@ -0,0 +1,26 @@ +import type { HTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface ListItemProps extends HTMLAttributes { + selected?: boolean; + highlighted?: boolean; + children: ReactNode; +} + +export function ListItem({ selected, highlighted, className, children, ...props }: ListItemProps) { + return ( +
+ {children} +
+ ); +} diff --git a/packages/ui/src/components/Panel.tsx b/packages/ui/src/components/Panel.tsx new file mode 100644 index 0000000..1fac0ae --- /dev/null +++ b/packages/ui/src/components/Panel.tsx @@ -0,0 +1,24 @@ +import type { HTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface PanelProps extends HTMLAttributes { + glass?: boolean; + children: ReactNode; +} + +export function Panel({ glass = true, className, children, ...props }: PanelProps) { + return ( +
+ {children} +
+ ); +} diff --git a/packages/ui/src/components/Section.tsx b/packages/ui/src/components/Section.tsx new file mode 100644 index 0000000..542008c --- /dev/null +++ b/packages/ui/src/components/Section.tsx @@ -0,0 +1,29 @@ +import type { HTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface SectionProps extends Omit, 'title'> { + title: ReactNode; + actions?: ReactNode; + defaultOpen?: boolean; + children: ReactNode; +} + +export function Section({ title, actions, defaultOpen = true, className, children, ...props }: SectionProps) { + return ( +
+ + + {title} + + {actions && ( + e.preventDefault()} className="flex items-center gap-1.5"> + {actions} + + )} + +
+ {children} +
+
+ ); +} diff --git a/packages/ui/src/components/TextInput.tsx b/packages/ui/src/components/TextInput.tsx new file mode 100644 index 0000000..b389dbf --- /dev/null +++ b/packages/ui/src/components/TextInput.tsx @@ -0,0 +1,18 @@ +import type { InputHTMLAttributes } from 'react'; +import { cn } from '../utils/cn.ts'; + +type TextInputProps = InputHTMLAttributes; + +export function TextInput({ className, ...props }: TextInputProps) { + return ( + + ); +} diff --git a/packages/ui/src/components/ToggleButton.tsx b/packages/ui/src/components/ToggleButton.tsx new file mode 100644 index 0000000..19108f5 --- /dev/null +++ b/packages/ui/src/components/ToggleButton.tsx @@ -0,0 +1,24 @@ +import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import { cn } from '../utils/cn.ts'; + +interface ToggleButtonProps extends ButtonHTMLAttributes { + on?: boolean; + children: ReactNode; +} + +export function ToggleButton({ on, className, children, ...props }: ToggleButtonProps) { + return ( + + ); +} diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index b110510..e254c67 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -1 +1,8 @@ -// Components will be added in Step 2 +export { Button } from './Button.tsx'; +export { IconButton } from './IconButton.tsx'; +export { ToggleButton } from './ToggleButton.tsx'; +export { Badge } from './Badge.tsx'; +export { Panel } from './Panel.tsx'; +export { Section } from './Section.tsx'; +export { ListItem } from './ListItem.tsx'; +export { TextInput } from './TextInput.tsx';