chore: publish current DataStack updates
Publish the current application, design, and Phase 1 deployment updates. Excludes ignored personal notes, local MCP config, and generated TypeScript build info.
This commit is contained in:
1 parent
d39d9f92f9
commit
fcc4f4db2d
88 files changed
+21248
-2213
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
|
||||
const sampleRows = [
|
||||
{ time: '14:28:01', source: 'Source A', payload: '{ metric: "temperature", value: 22.4 }', size: '42 B' },
|
||||
{ time: '14:28:01', source: 'Source B', payload: '{ action: "package_received", count: 3 }', size: '38 B' },
|
||||
{ time: '14:28:02', source: 'Source A', payload: '{ metric: "humidity", value: 61 }', size: '40 B' },
|
||||
{ time: '14:28:02', source: 'Source C', payload: '{ status: "complete", duration_ms: 184 }', size: '44 B' },
|
||||
];
|
||||
|
||||
export const ActivityPreview: React.FC = () => (
|
||||
<section aria-label="Example activity" className="mt-8 overflow-hidden border border-[var(--border)] bg-[var(--surface)]">
|
||||
<div className="flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-2.5 sm:px-4">
|
||||
<div className="flex items-center gap-2 text-[12px] text-[var(--text-muted)]">
|
||||
<span className="h-1.5 w-1.5 bg-[var(--accent)]" />
|
||||
Example activity
|
||||
</div>
|
||||
<span className="text-[11px] text-[var(--text-faint)]">Sample records</span>
|
||||
</div>
|
||||
<div className="divide-y divide-[var(--border)]">
|
||||
{sampleRows.map((row) => (
|
||||
<div
|
||||
key={`${row.time}-${row.source}-${row.payload}`}
|
||||
className="grid grid-cols-[4.5rem_minmax(0,1fr)_3rem] items-center gap-x-3 px-3 py-2 font-mono text-[11px] sm:grid-cols-[5rem_6rem_minmax(0,1fr)_3.5rem] sm:px-4"
|
||||
>
|
||||
<span className="text-[var(--text-faint)]">{row.time}</span>
|
||||
<span className="hidden text-[var(--accent)] sm:block">{row.source}</span>
|
||||
<span className="truncate text-[var(--text)]">{row.payload}</span>
|
||||
<span className="text-right text-[var(--text-faint)]">{row.size}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
export default ActivityPreview;
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
@@ -30,7 +30,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
|
||||
const variantStyles = {
|
||||
primary:
|
||||
'bg-[var(--accent)] text-[var(--text-on-accent)] hover:bg-[var(--accent-hover)] border-[var(--accent)]',
|
||||
'bg-[var(--text)] text-[var(--bg)] hover:opacity-90 border-[var(--text)]',
|
||||
secondary:
|
||||
'bg-[var(--bg-elevated)] text-[var(--text)] border-[var(--border-strong)] hover:bg-[var(--bg-hover)]',
|
||||
ghost:
|
||||
@@ -42,10 +42,10 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
};
|
||||
|
||||
const sizeStyles = {
|
||||
default: 'h-[32px] px-[14px] text-[12.5px] gap-[7px]',
|
||||
sm: 'h-[27px] px-[10px] text-[11.5px] gap-[5px]',
|
||||
xs: 'h-[24px] px-[7px] text-[10.5px] gap-[4px]',
|
||||
icon: 'w-[30px] h-[30px] p-0',
|
||||
default: 'min-h-10 px-4 text-[13.5px] gap-2',
|
||||
sm: 'h-9 px-3 text-[12.5px] gap-1.5',
|
||||
xs: 'h-8 px-2.5 text-[12px] gap-1.5',
|
||||
icon: 'w-9 h-9 p-0',
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
variant?: 'default' | 'subtle' | 'dashed' | 'active';
|
||||
@@ -25,8 +25,8 @@ export const Card: React.FC<CardProps> = ({
|
||||
className={cn(
|
||||
'transition-colors',
|
||||
variantStyles[variant],
|
||||
compact ? 'p-2.5' : 'p-3.5 sm:p-4',
|
||||
className
|
||||
className,
|
||||
compact ? 'p-4' : 'p-5 sm:p-6'
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
@@ -42,7 +42,7 @@ export const CardHeader: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
}) => (
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center justify-between gap-2.5 pb-2.5 mb-2.5 border-b border-[var(--border)]',
|
||||
'flex items-center justify-between gap-3 pb-3 mb-3 border-b border-[var(--border)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -56,7 +56,7 @@ export const CardTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<h3 className={cn('text-[13px] font-semibold text-[var(--text)] leading-tight', className)} {...props}>
|
||||
<h3 className={cn('text-[15px] font-semibold text-[var(--text)] leading-snug', className)} {...props}>
|
||||
{children}
|
||||
</h3>
|
||||
);
|
||||
@@ -66,7 +66,7 @@ export const CardDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<p className={cn('text-[11px] text-[var(--text-muted)] leading-normal', className)} {...props}>
|
||||
<p className={cn('text-[13px] text-[var(--text-muted)] leading-relaxed', className)} {...props}>
|
||||
{children}
|
||||
</p>
|
||||
);
|
||||
@@ -76,7 +76,7 @@ export const CardContent: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('text-[12px]', className)} {...props}>
|
||||
<div className={cn('text-[14px]', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -88,7 +88,7 @@ export const CardFooter: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
}) => (
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center justify-between gap-2 pt-2.5 mt-2.5 border-t border-[var(--border)] text-[11px]',
|
||||
'flex items-center justify-between gap-3 pt-3 mt-3 border-t border-[var(--border)] text-[13px]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
|
||||
export interface ClientListItem {
|
||||
clientId: string;
|
||||
name: string;
|
||||
status: 'active' | 'revoked';
|
||||
totalEvents: number;
|
||||
}
|
||||
|
||||
interface ClientListProps {
|
||||
clients: ClientListItem[];
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export const ClientList: React.FC<ClientListProps> = ({ clients, limit = 4 }) => (
|
||||
<div className="divide-y divide-[var(--border)]">
|
||||
{clients.slice(0, limit).map((client) => (
|
||||
<div key={client.clientId} className="flex min-w-0 items-center justify-between gap-3 px-4 py-2">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<span className={client.status === 'active' ? 'h-1.5 w-1.5 shrink-0 bg-[var(--accent)]' : 'h-1.5 w-1.5 shrink-0 bg-[var(--text-faint)]'} />
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-[12px] font-medium text-[var(--text)]">{client.name}</p>
|
||||
<p className="truncate font-mono text-[10px] text-[var(--text-faint)]">{client.clientId}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="shrink-0 font-mono text-[11px] text-[var(--text-muted)]">
|
||||
{client.totalEvents.toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
{clients.length === 0 && (
|
||||
<p className="px-4 py-5 text-[12px] text-[var(--text-faint)]">No registered clients.</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
export default ClientList;
|
||||
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
interface CodeBlockProps {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const CodeBlock: React.FC<CodeBlockProps> = ({ children, className = '' }) => (
|
||||
<pre className={`overflow-x-auto bg-[var(--surface)] p-4 font-mono text-[12px] leading-relaxed text-[var(--text-muted)] ${className}`}>
|
||||
<code>{children}</code>
|
||||
</pre>
|
||||
);
|
||||
|
||||
export default CodeBlock;
|
||||
@@ -0,0 +1,49 @@
|
||||
'use client';
|
||||
|
||||
import { Check, Copy } from 'lucide-react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
type CopyState = 'idle' | 'copied' | 'failed';
|
||||
|
||||
export function CopyButton({ value }: { value: string }) {
|
||||
const [state, setState] = useState<CopyState>('idle');
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => () => {
|
||||
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
||||
}, []);
|
||||
|
||||
const copyValue = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(value);
|
||||
setState('copied');
|
||||
} catch {
|
||||
setState('failed');
|
||||
}
|
||||
|
||||
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
||||
timeoutRef.current = setTimeout(() => setState('idle'), 1200);
|
||||
};
|
||||
|
||||
const label = state === 'copied'
|
||||
? 'Copied to clipboard'
|
||||
: state === 'failed'
|
||||
? 'Clipboard unavailable'
|
||||
: 'Copy to clipboard';
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={copyValue}
|
||||
aria-label={label}
|
||||
title={label}
|
||||
className="grid h-5 w-5 shrink-0 place-items-center text-[var(--text-faint)] transition-colors hover:text-[var(--text)]"
|
||||
>
|
||||
{state === 'copied'
|
||||
? <Check className="h-3 w-3" aria-hidden="true" />
|
||||
: <Copy className="h-3 w-3" aria-hidden="true" />}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
export default CopyButton;
|
||||
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
interface FeatureItemProps {
|
||||
icon: string;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export const FeatureItem: React.FC<FeatureItemProps> = ({ icon, title, description }) => (
|
||||
<article className="min-h-full bg-[var(--surface)] p-5">
|
||||
<div className="mb-3 grid h-[22px] w-[22px] place-items-center border border-[var(--border-strong)] text-[var(--accent)]">
|
||||
<Icon name={icon} size={13} />
|
||||
</div>
|
||||
<h3 className="mb-1 text-[13px] font-medium text-[var(--text)]">{title}</h3>
|
||||
<p className="text-[12px] leading-relaxed text-[var(--text-muted)]">{description}</p>
|
||||
</article>
|
||||
);
|
||||
|
||||
export default FeatureItem;
|
||||
@@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
export const Form: React.FC<React.FormHTMLAttributes<HTMLFormElement>> = ({
|
||||
className,
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<form className={cn('flex flex-col gap-3', className)} {...props}>
|
||||
<form className={cn('flex flex-col gap-5', className)} {...props}>
|
||||
{children}
|
||||
</form>
|
||||
);
|
||||
@@ -16,7 +16,7 @@ export const FormField: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('flex flex-col gap-1 w-full', className)} {...props}>
|
||||
<div className={cn('flex flex-col gap-2 w-full', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -26,7 +26,7 @@ export const FormRow: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<div className={cn('grid grid-cols-1 sm:grid-cols-2 gap-3 w-full', className)} {...props}>
|
||||
<div className={cn('grid grid-cols-1 sm:grid-cols-2 gap-4 w-full', className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -40,20 +40,20 @@ export const FormSwitch: React.FC<{
|
||||
}> = ({ label, checked, onChange, description, disabled = false }) => (
|
||||
<label
|
||||
className={cn(
|
||||
'flex items-center justify-between p-2.5 border border-[var(--border)] bg-[var(--bg-main)] cursor-pointer select-none transition-colors hover:bg-[var(--bg-hover)]',
|
||||
'flex items-center justify-between gap-4 p-4 border border-[var(--border)] bg-[var(--bg-main)] cursor-pointer select-none transition-colors hover:bg-[var(--bg-hover)]',
|
||||
disabled && 'opacity-50 cursor-not-allowed'
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-col">
|
||||
<span className="text-[12px] font-medium text-[var(--text)]">{label}</span>
|
||||
{description && <span className="text-[10.5px] text-[var(--text-dim)]">{description}</span>}
|
||||
<span className="text-[14px] font-medium text-[var(--text)]">{label}</span>
|
||||
{description && <span className="text-[12px] text-[var(--text-muted)]">{description}</span>}
|
||||
</div>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
disabled={disabled}
|
||||
onChange={(e) => onChange(e.target.checked)}
|
||||
className="w-4 h-4 accent-[var(--accent)] cursor-pointer"
|
||||
className="w-5 h-5 accent-[var(--accent)] cursor-pointer shrink-0"
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
@@ -18,7 +18,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={inputId}
|
||||
className="text-[10.5px] font-semibold text-[var(--text-muted)] uppercase tracking-wider"
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
@@ -34,7 +34,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] placeholder:text-[var(--text-dim)] transition-colors focus:outline-none focus:border-[var(--accent)] disabled:opacity-50 disabled:cursor-not-allowed',
|
||||
compact ? 'h-[28px] px-2 text-[11px]' : 'h-[32px] px-2.5 text-[12px]',
|
||||
compact ? 'h-9 px-3 text-[13px]' : 'h-10 px-3.5 text-[14px]',
|
||||
icon && 'pl-8',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
@@ -42,7 +42,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
{error && <span className="text-[10.5px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={textareaId}
|
||||
className="text-[10.5px] font-semibold text-[var(--text-muted)] uppercase tracking-wider"
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
@@ -73,13 +73,13 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
id={textareaId}
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] p-2.5 text-[12px] placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--accent)] min-h-[64px] resize-y font-mono',
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] p-3.5 text-[14px] placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--accent)] min-h-[96px] resize-y font-mono',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
{error && <span className="text-[10.5px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -103,7 +103,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
{label && (
|
||||
<label
|
||||
htmlFor={selectId}
|
||||
className="text-[10.5px] font-semibold text-[var(--text-muted)] uppercase tracking-wider"
|
||||
className="text-[12px] font-medium text-[var(--text-muted)]"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
@@ -113,7 +113,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-main)] text-[var(--text)] border border-[var(--border-strong)] focus:outline-none focus:border-[var(--accent)] cursor-pointer',
|
||||
compact ? 'h-[28px] px-1.5 text-[11px]' : 'h-[32px] px-2 text-[11.5px]',
|
||||
compact ? 'h-9 px-2.5 text-[13px]' : 'h-10 px-3 text-[14px]',
|
||||
error && 'border-[var(--danger)]',
|
||||
className
|
||||
)}
|
||||
@@ -127,7 +127,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
||||
))
|
||||
: children}
|
||||
</select>
|
||||
{error && <span className="text-[10.5px] text-[var(--danger)]">{error}</span>}
|
||||
{error && <span className="text-[12px] text-[var(--danger)]">{error}</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+15
-14
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { Icon } from './Icon';
|
||||
import React, { useEffect } from 'react';
|
||||
import { Button } from './Button';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
export interface ModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -10,7 +10,7 @@ export interface ModalProps {
|
||||
description?: string;
|
||||
children: React.ReactNode;
|
||||
footer?: React.ReactNode;
|
||||
maxWidth?: 'sm' | 'md' | 'lg';
|
||||
maxWidth?: 'xs' | 'sm' | 'md' | 'lg';
|
||||
}
|
||||
|
||||
export const Modal: React.FC<ModalProps> = ({
|
||||
@@ -41,24 +41,25 @@ export const Modal: React.FC<ModalProps> = ({
|
||||
if (!isOpen) return null;
|
||||
|
||||
const maxWidthStyles = {
|
||||
sm: 'max-w-[440px]',
|
||||
md: 'max-w-[520px]',
|
||||
lg: 'max-w-[640px]',
|
||||
xs: 'max-w-[440px]',
|
||||
sm: 'max-w-[480px]',
|
||||
md: 'max-w-[640px]',
|
||||
lg: 'max-w-[800px]',
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-3.5 bg-black/60 backdrop-blur-[1px]">
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-6 bg-black/60">
|
||||
<div
|
||||
className={cn(
|
||||
'w-full bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] flex flex-col max-h-[min(84dvh,680px)] overflow-hidden animate-in fade-in zoom-in-95 duration-100',
|
||||
'w-full bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] flex flex-col max-h-[calc(100dvh-1.5rem)] sm:max-h-[min(88dvh,800px)] overflow-hidden animate-in fade-in zoom-in-95 duration-150',
|
||||
maxWidthStyles[maxWidth]
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-3 p-3.5 sm:px-4 sm:py-3.5 border-b border-[var(--border)] shrink-0">
|
||||
<div className="flex items-start justify-between gap-4 p-4 sm:px-6 sm:py-5 border-b border-[var(--border)] shrink-0">
|
||||
<div className="min-w-0">
|
||||
<h2 className="text-[14px] font-semibold text-[var(--text)] leading-tight">{title}</h2>
|
||||
<h2 className="text-[18px] font-semibold text-[var(--text)] leading-snug">{title}</h2>
|
||||
{description && (
|
||||
<p className="text-[11px] text-[var(--text-muted)] mt-1">{description}</p>
|
||||
<p className="text-[13px] text-[var(--text-muted)] mt-1.5">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
@@ -66,18 +67,18 @@ export const Modal: React.FC<ModalProps> = ({
|
||||
variant="ghost"
|
||||
onClick={onClose}
|
||||
aria-label="Close dialog"
|
||||
className="w-7 h-7 text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||
className="w-9 h-9 text-[var(--text-dim)] hover:text-[var(--text)]"
|
||||
>
|
||||
<Icon name="X" size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="p-3.5 sm:p-4 overflow-y-auto flex-1 text-[12px] flex flex-col gap-3">
|
||||
<div className="p-4 sm:p-6 overflow-y-auto flex-1 text-[14px] flex flex-col gap-4">
|
||||
{children}
|
||||
</div>
|
||||
|
||||
{footer && (
|
||||
<div className="flex items-center justify-end gap-2 p-3 sm:px-4 border-t border-[var(--border)] bg-[var(--bg-sidebar)] shrink-0">
|
||||
<div className="flex flex-wrap items-center justify-end gap-2 p-4 sm:px-6 border-t border-[var(--border)] bg-[var(--bg-sidebar)] shrink-0">
|
||||
{footer}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
interface PanelProps extends React.HTMLAttributes<HTMLElement> {
|
||||
title: string;
|
||||
action?: React.ReactNode;
|
||||
meta?: string;
|
||||
children: React.ReactNode;
|
||||
bodyClassName?: string;
|
||||
}
|
||||
|
||||
export const Panel: React.FC<PanelProps> = ({
|
||||
title,
|
||||
action,
|
||||
meta,
|
||||
children,
|
||||
className,
|
||||
bodyClassName,
|
||||
...props
|
||||
}) => (
|
||||
<section className={cn('flex min-w-0 flex-col border border-[var(--border)] bg-[var(--surface)]', className)} {...props}>
|
||||
<header className="flex min-h-11 items-center justify-between gap-3 border-b border-[var(--border)] px-4 py-2.5">
|
||||
<h2 className="text-[12px] font-medium text-[var(--text)]">{title}</h2>
|
||||
<div className="flex items-center gap-3">
|
||||
{meta && <span className="text-[11px] text-[var(--text-faint)]">{meta}</span>}
|
||||
{action}
|
||||
</div>
|
||||
</header>
|
||||
<div className={cn('min-w-0', bodyClassName)}>{children}</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
export default Panel;
|
||||
@@ -0,0 +1,29 @@
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
export interface PillProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
active?: boolean;
|
||||
}
|
||||
|
||||
export const Pill = React.forwardRef<HTMLButtonElement, PillProps>(
|
||||
({ active = false, className, children, type = 'button', ...props }, ref) => (
|
||||
<button
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn(
|
||||
'inline-flex h-[26px] shrink-0 items-center gap-1.5 border px-2.5 text-[11.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-50',
|
||||
active
|
||||
? 'border-[var(--border-strong)] bg-[var(--surface-2)] text-[var(--text)]'
|
||||
: 'border-[var(--border)] bg-transparent text-[var(--text-muted)] hover:bg-[var(--surface-2)] hover:text-[var(--text)]',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
);
|
||||
|
||||
Pill.displayName = 'Pill';
|
||||
|
||||
export default Pill;
|
||||
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
interface SectionHeadingProps {
|
||||
index: string;
|
||||
label: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export const SectionHeading: React.FC<SectionHeadingProps> = ({ index, label, title }) => (
|
||||
<div className="mb-5 flex items-baseline justify-between gap-4">
|
||||
<h2 className="text-[16px] font-medium text-[var(--text)]">{title}</h2>
|
||||
<span className="shrink-0 text-[11px] uppercase text-[var(--text-faint)]">
|
||||
{index} / {label}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default SectionHeading;
|
||||
@@ -0,0 +1,72 @@
|
||||
import React from 'react';
|
||||
|
||||
export interface SettingsTabItem {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export function SettingsTabs({
|
||||
items,
|
||||
value,
|
||||
onChange,
|
||||
}: {
|
||||
items: SettingsTabItem[];
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex overflow-x-auto border-b border-[var(--border)]" role="tablist" aria-label="Settings categories">
|
||||
{items.map((item) => (
|
||||
<button
|
||||
key={item.id}
|
||||
id={`settings-tab-${item.id}`}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={value === item.id}
|
||||
aria-controls={`settings-panel-${item.id}`}
|
||||
className={`mb-[-1px] shrink-0 border-b-2 px-3.5 py-2.5 text-xs transition-colors ${value === item.id ? 'border-[var(--accent)] text-[var(--text)]' : 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'}`}
|
||||
onClick={() => onChange(item.id)}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SettingsGroup({
|
||||
title,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<section className="border-b border-[var(--border)] p-4 last:border-b-0">
|
||||
<h2 className="mb-3 flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
{title}
|
||||
</h2>
|
||||
<div className="flex flex-col">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function SettingsField({
|
||||
label,
|
||||
hint,
|
||||
children,
|
||||
}: {
|
||||
label: string;
|
||||
hint?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="grid grid-cols-1 items-start gap-1.5 py-2 sm:grid-cols-[1fr_2fr] sm:gap-5">
|
||||
<div className="min-w-0 pt-px">
|
||||
<div className="text-[12.5px] leading-snug text-[var(--text)]">{label}</div>
|
||||
{hint && <div className="mt-0.5 text-[11px] leading-normal text-[var(--text-faint)]">{hint}</div>}
|
||||
</div>
|
||||
<div className="min-w-0">{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { Card } from './Card';
|
||||
|
||||
interface StatCardProps {
|
||||
label: string;
|
||||
value: string | number;
|
||||
unit?: string;
|
||||
meta: string;
|
||||
}
|
||||
|
||||
export const StatCard: React.FC<StatCardProps> = ({ label, value, unit, meta }) => (
|
||||
<Card compact className="bg-[var(--surface)]">
|
||||
<div className="mb-1.5 text-[10px] uppercase text-[var(--text-faint)]">{label}</div>
|
||||
<div className="text-[22px] font-medium leading-tight text-[var(--text)]">
|
||||
{value}
|
||||
{unit && <span className="ml-1 text-[11px] font-normal text-[var(--text-muted)]">{unit}</span>}
|
||||
</div>
|
||||
<div className="mt-2 text-[11px] text-[var(--text-muted)]">{meta}</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
export default StatCard;
|
||||
@@ -0,0 +1,28 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
type Dot = 'ok' | 'off' | 'pending';
|
||||
type Item = { label: string; value: ReactNode; dot?: Dot };
|
||||
|
||||
const DOT_CLASS: Record<Dot, string> = {
|
||||
ok: 'bg-[var(--accent)]',
|
||||
off: 'bg-[var(--text-faint)]',
|
||||
pending: 'bg-[var(--warning)]',
|
||||
};
|
||||
|
||||
export function StatStrip({ items }: { items: Item[] }) {
|
||||
return (
|
||||
<div className="mb-4 grid grid-cols-2 gap-px border border-[var(--border)] bg-[var(--border)] md:grid-cols-4">
|
||||
{items.map((item) => (
|
||||
<div key={item.label} className="bg-[var(--surface)] px-4 py-3">
|
||||
<div className="mb-1 text-[10px] uppercase tracking-wider text-[var(--text-faint)]">
|
||||
{item.label}
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-lg font-medium leading-none tracking-tight text-[var(--text)]">
|
||||
{item.dot && <span aria-hidden="true" className={`h-1.5 w-1.5 ${DOT_CLASS[item.dot]}`} />}
|
||||
{item.value}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
export const TableWrap: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
className,
|
||||
@@ -24,7 +24,7 @@ export const Table: React.FC<React.TableHTMLAttributes<HTMLTableElement>> = ({
|
||||
}) => (
|
||||
<table
|
||||
className={cn(
|
||||
'w-full min-w-[540px] border-collapse text-left text-[11px] whitespace-nowrap',
|
||||
'w-full min-w-[680px] border-collapse text-left text-[13px] whitespace-nowrap',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -40,7 +40,7 @@ export const TableHeader: React.FC<React.HTMLAttributes<HTMLTableSectionElement>
|
||||
}) => (
|
||||
<thead
|
||||
className={cn(
|
||||
'bg-[var(--bg-sidebar)] border-b border-[var(--border)] text-[9.5px] font-semibold text-[var(--text-dim)] uppercase tracking-wider',
|
||||
'bg-[var(--bg-sidebar)] border-b border-[var(--border)] text-[12px] font-medium text-[var(--text-muted)] uppercase',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -76,7 +76,7 @@ export const TableHead: React.FC<React.ThHTMLAttributes<HTMLTableCellElement>> =
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<th className={cn('px-2.5 py-1.5 font-medium', className)} {...props}>
|
||||
<th className={cn('px-3 py-2.5 font-medium', className)} {...props}>
|
||||
{children}
|
||||
</th>
|
||||
);
|
||||
@@ -86,7 +86,7 @@ export const TableCell: React.FC<React.TdHTMLAttributes<HTMLTableCellElement>> =
|
||||
children,
|
||||
...props
|
||||
}) => (
|
||||
<td className={cn('px-2.5 py-1.5 text-[var(--text-muted)] align-middle', className)} {...props}>
|
||||
<td className={cn('px-3 py-2.5 text-[var(--text-muted)] align-middle', className)} {...props}>
|
||||
{children}
|
||||
</td>
|
||||
);
|
||||
@@ -98,7 +98,7 @@ export const TableEmpty: React.FC<{ colSpan: number; message?: string }> = ({
|
||||
<tr>
|
||||
<td
|
||||
colSpan={colSpan}
|
||||
className="px-3 py-6 text-center text-[10.5px] text-[var(--text-dim)] italic"
|
||||
className="px-4 py-10 text-center text-[13px] text-[var(--text-dim)]"
|
||||
>
|
||||
{message}
|
||||
</td>
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React from 'react';
|
||||
|
||||
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
||||
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'label' | 'code' | 'div';
|
||||
@@ -15,15 +15,15 @@ export const Text: React.FC<TextProps> = ({
|
||||
...props
|
||||
}) => {
|
||||
const variantStyles = {
|
||||
h1: 'text-[18px] font-semibold tracking-tight text-[var(--text)]',
|
||||
h2: 'text-[15px] font-semibold text-[var(--text)]',
|
||||
h3: 'text-[13px] font-medium text-[var(--text)]',
|
||||
body: 'text-[12.5px] font-normal text-[var(--text)]',
|
||||
muted: 'text-[11.5px] font-normal text-[var(--text-muted)]',
|
||||
dim: 'text-[10.5px] font-normal text-[var(--text-dim)]',
|
||||
label: 'text-[11px] font-medium uppercase tracking-wider text-[var(--text-dim)]',
|
||||
code: 'text-[11px] font-mono text-[var(--accent)] bg-[var(--bg-hover)] px-1.5 py-0.5 border border-[var(--border)]',
|
||||
badge: 'text-[10px] font-medium px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-muted)] inline-flex items-center gap-1',
|
||||
h1: 'text-[24px] font-semibold text-[var(--text)]',
|
||||
h2: 'text-[20px] font-semibold text-[var(--text)]',
|
||||
h3: 'text-[17px] font-medium text-[var(--text)]',
|
||||
body: 'text-[14px] font-normal text-[var(--text)]',
|
||||
muted: 'text-[13px] font-normal text-[var(--text-muted)]',
|
||||
dim: 'text-[12px] font-normal text-[var(--text-dim)]',
|
||||
label: 'text-[12px] font-medium uppercase text-[var(--text-muted)]',
|
||||
code: 'text-[12px] font-mono text-[var(--accent)] bg-[var(--bg-hover)] px-2 py-1 border border-[var(--border)]',
|
||||
badge: 'text-[11.5px] font-medium px-2 py-1 border border-[var(--border)] text-[var(--text-muted)] inline-flex items-center gap-1',
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import React, { createContext, useContext, useState, useCallback } from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import React, { createContext, useCallback, useContext, useState } from 'react';
|
||||
import { Icon } from './Icon';
|
||||
|
||||
export type ToastType = 'success' | 'error' | 'warning' | 'info';
|
||||
@@ -53,7 +53,7 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
|
||||
return (
|
||||
<ToastContext.Provider value={{ toast: addToast, success, error, warning, info }}>
|
||||
{children}
|
||||
<div className="fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-[340px] pointer-events-none">
|
||||
<div className="fixed bottom-4 left-4 right-4 sm:left-auto sm:right-6 sm:bottom-6 z-[9999] flex flex-col gap-2 max-w-[420px] pointer-events-none">
|
||||
{toasts.map((t) => {
|
||||
const typeBorder = {
|
||||
success: 'border-l-[3px] border-l-[var(--success)]',
|
||||
@@ -80,17 +80,17 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
|
||||
<div
|
||||
key={t.id}
|
||||
className={cn(
|
||||
'pointer-events-auto flex items-start gap-2.5 p-3 bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] text-[12px] transition-all',
|
||||
'pointer-events-auto flex items-start gap-3 p-4 bg-[var(--bg-elevated)] border border-[var(--border-strong)] text-[var(--text)] text-[13px] transition-all',
|
||||
typeBorder
|
||||
)}
|
||||
>
|
||||
<div className="mt-0.5 shrink-0">
|
||||
<Icon name={typeIcon} size={14} color={iconColor} />
|
||||
<Icon name={typeIcon} size={17} color={iconColor} />
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="font-medium text-[var(--text)] leading-tight">{t.title}</div>
|
||||
{t.message && (
|
||||
<div className="text-[11px] text-[var(--text-muted)] mt-0.5 leading-normal break-words">
|
||||
<div className="text-[12px] text-[var(--text-muted)] mt-1 leading-normal break-words">
|
||||
{t.message}
|
||||
</div>
|
||||
)}
|
||||
|
||||
+20
-9
@@ -1,9 +1,20 @@
|
||||
export * from './Button';
|
||||
export * from './Input';
|
||||
export * from './Card';
|
||||
export * from './Modal';
|
||||
export * from './Table';
|
||||
export * from './Form';
|
||||
export * from './Text';
|
||||
export * from './Icon';
|
||||
export * from './Toast';
|
||||
export * from "./ActivityPreview";
|
||||
export * from "./Button";
|
||||
export * from "./Card";
|
||||
export * from "./ClientList";
|
||||
export * from "./CodeBlock";
|
||||
export * from "./CopyButton";
|
||||
export * from "./FeatureItem";
|
||||
export * from "./Form";
|
||||
export * from "./Icon";
|
||||
export * from "./Input";
|
||||
export * from "./Modal";
|
||||
export * from "./Panel";
|
||||
export * from "./Pill";
|
||||
export * from "./SectionHeading";
|
||||
export * from "./SettingsLayout";
|
||||
export * from "./StatCard";
|
||||
export * from "./StatStrip";
|
||||
export * from "./Table";
|
||||
export * from "./Text";
|
||||
export * from "./Toast";
|
||||
Reference in new issue
Block a user