Skip to content

OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.

TypeScript

feat: migrate to shadcn/ui component library

Augustus Otue5abf42dfab8
diff --git a/apps/web/components.json b/apps/web/components.json
new file mode 100644
index 00000000..cbe91b57
--- /dev/null
+++ b/apps/web/components.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "default",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "tailwind.config.js",
+ "css": "src/index.css",
+ "baseColor": "neutral"
+ },
+ "aliases": {
+ "components": "@/components",
+ "ui": "@openreel/ui/components",
+ "utils": "@openreel/ui/lib/utils",
+ "hooks": "@openreel/ui/hooks",
+ "lib": "@openreel/ui/lib"
+ }
+}
diff --git a/apps/web/package.json b/apps/web/package.json
index 8333a843..92f5df11 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -17,6 +17,7 @@
},
"dependencies": {
"@openreel/core": "workspace:*",
+ "@openreel/ui": "workspace:*",
"@radix-ui/react-context-menu": "^2.2.16",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
@@ -57,6 +58,7 @@
"jsdom": "^24.1.0",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.4",
+ "tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5",
"vite": "^5.3.1",
"vitest": "^1.6.0",
diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx
index db446bfe..c03d3796 100644
--- a/apps/web/src/App.tsx
+++ b/apps/web/src/App.tsx
@@ -11,6 +11,7 @@ import { useProjectStore } from "./stores/project-store";
import { useRouter } from "./hooks/use-router";
import { useProjectRecovery } from "./hooks/useProjectRecovery";
import { SOCIAL_MEDIA_PRESETS, type SocialMediaCategory } from "@openreel/core";
+import { TooltipProvider } from "@openreel/ui";
const EditorInterface = lazy(() =>
import("./components/editor/EditorInterface").then((m) => ({
@@ -129,34 +130,36 @@ function App() {
const isSharePage = route === "share" && params.shareId;
return (
- <div className="h-screen w-screen bg-background text-text-primary overflow-hidden">
- <MobileBlocker />
- {isSharePage ? (
- <SharePage shareId={params.shareId!} />
- ) : showWelcome ? (
- <WelcomeScreen initialTab={initialTab} />
- ) : (
- <Suspense fallback={<LoadingSpinner message="Loading editor..." />}>
- <EditorInterface />
- </Suspense>
- )}
- <ToastContainer />
- <ScriptViewDialog
- isOpen={activeModal === "scriptView"}
- onClose={closeModal}
- />
- <SearchModal isOpen={activeModal === "search"} onClose={closeModal} />
- {showDialog && availableSaves.length > 0 && (
- <RecoveryDialog
- saves={availableSaves}
- onRecover={async (saveId) => {
- const success = await recover(saveId);
- if (success) navigate("editor");
- }}
- onDismiss={dismiss}
+ <TooltipProvider>
+ <div className="h-screen w-screen bg-background text-text-primary overflow-hidden">
+ <MobileBlocker />
+ {isSharePage ? (
+ <SharePage shareId={params.shareId!} />
+ ) : showWelcome ? (
+ <WelcomeScreen initialTab={initialTab} />
+ ) : (
+ <Suspense fallback={<LoadingSpinner message="Loading editor..." />}>
+ <EditorInterface />
+ </Suspense>
+ )}
+ <ToastContainer />
+ <ScriptViewDialog
+ isOpen={activeModal === "scriptView"}
+ onClose={closeModal}
/>
- )}
- </div>
+ <SearchModal isOpen={activeModal === "search"} onClose={closeModal} />
+ {showDialog && availableSaves.length > 0 && (
+ <RecoveryDialog
+ saves={availableSaves}
+ onRecover={async (saveId) => {
+ const success = await recover(saveId);
+ if (success) navigate("editor");
+ }}
+ onDismiss={dismiss}
+ />
+ )}
+ </div>
+ </TooltipProvider>
);
}
diff --git a/apps/web/src/components/editor/AssetsPanel.tsx b/apps/web/src/components/editor/AssetsPanel.tsx
index c5dcbe12..3adadd98 100644
--- a/apps/web/src/components/editor/AssetsPanel.tsx
+++ b/apps/web/src/components/editor/AssetsPanel.tsx
@@ -36,26 +36,7 @@ import { MusicLibraryPanel } from "./inspector/MusicLibraryPanel";
import { MultiCameraPanel } from "./inspector/MultiCameraPanel";
import { TextToSpeechPanel } from "./inspector/TextToSpeechPanel";
import { AspectRatioMatchDialog } from "./dialogs/AspectRatioMatchDialog";
-
-const IconButton = ({
- icon: Icon,
- className = "",
- onClick,
- title,
-}: {
- icon: React.ElementType;
- className?: string;
- onClick?: () => void;
- title?: string;
-}) => (
- <button
- onClick={onClick}
- title={title}
- className={`p-1.5 rounded-lg hover:bg-background-tertiary text-text-secondary hover:text-text-primary transition-colors ${className}`}
- >
- <Icon size={14} />
- </button>
-);
+import { IconButton, Input } from "@openreel/ui";
const formatDuration = (seconds: number): string => {
const mins = Math.floor(seconds / 60);
@@ -679,14 +660,14 @@ export const AssetsPanel: React.FC = () => {
{/* Search - only show for media tab */}
{activeTab === "media" && (
<div className="px-5 mb-3">
- <div className="bg-background-tertiary h-9 rounded-lg border border-border flex items-center px-3 gap-2 focus-within:border-primary/50 focus-within:shadow-[0_0_0_1px_rgba(34,197,94,0.2)] transition-all">
- <Search size={14} className="text-text-muted" />
- <input
+ <div className="relative">
+ <Search size={14} className="absolute left-3 top-1/2 -translate-y-1/2 text-text-muted z-10" />
+ <Input
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder="Search media"
- className="flex-1 bg-transparent text-xs text-text-primary placeholder:text-text-muted outline-none border-none p-0 focus:ring-0"
+ className="pl-9 text-xs bg-background-tertiary border-border text-text-primary h-9"
/>
</div>
</div>
@@ -1111,8 +1092,9 @@ export const AssetsPanel: React.FC = () => {
</div>
)}
- {showAspectRatioDialog && aspectRatioDialogData && (
+ {aspectRatioDialogData && (
<AspectRatioMatchDialog
+ isOpen={showAspectRatioDialog}
videoWidth={aspectRatioDialogData.videoWidth}
videoHeight={aspectRatioDialogData.videoHeight}
currentWidth={project.settings.width}
diff --git a/apps/web/src/components/editor/ExportDialog.tsx b/apps/web/src/components/editor/ExportDialog.tsx
index 7c106fb1..70c57c1d 100644
--- a/apps/web/src/components/editor/ExportDialog.tsx
+++ b/apps/web/src/components/editor/ExportDialog.tsx
@@ -1,6 +1,5 @@
import React, { useState, useEffect, useCallback } from "react";
import {
- X,
Download,
Settings,
Monitor,
@@ -20,6 +19,26 @@ import {
CheckCircle,
Info,
} from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Button,
+ Input,
+ Tabs,
+ TabsList,
+ TabsTrigger,
+ TabsContent,
+ Slider,
+ Switch,
+ Label,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
import {
exportPresetsManager,
type PlatformExportPreset,
@@ -254,51 +273,40 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="w-full max-w-4xl max-h-[85vh] bg-background-secondary rounded-xl border border-border shadow-2xl overflow-hidden flex flex-col">
- <div className="flex items-center justify-between p-4 border-b border-border bg-background-tertiary">
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-4xl max-h-[85vh] p-0 gap-0 bg-background-secondary border-border overflow-hidden flex flex-col">
+ <DialogHeader className="p-4 border-b border-border bg-background-tertiary space-y-0">
<div className="flex items-center gap-3">
<Download size={20} className="text-primary" />
- <h2 className="text-lg font-bold text-text-primary">
+ <DialogTitle className="text-lg font-bold text-text-primary">
Export Video
- </h2>
+ </DialogTitle>
</div>
- <button
- onClick={onClose}
- className="p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-secondary transition-colors"
- >
- <X size={20} />
- </button>
- </div>
-
- <div className="flex border-b border-border">
- <button
- onClick={() => setActiveTab("presets")}
- className={`flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium transition-colors ${
- activeTab === "presets"
- ? "text-primary border-b-2 border-primary"
- : "text-text-secondary hover:text-text-primary"
- }`}
- >
- <Star size={16} />
- Presets
- </button>
- <button
- onClick={() => setActiveTab("custom")}
- className={`flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium transition-colors ${
- activeTab === "custom"
- ? "text-primary border-b-2 border-primary"
- : "text-text-secondary hover:text-text-primary"
- }`}
- >
- <Settings size={16} />
- Custom
- </button>
- </div>
+ </DialogHeader>
+
+ <Tabs
+ value={activeTab}
+ onValueChange={(v) => setActiveTab(v as "presets" | "custom")}
+ className="flex-1 flex flex-col overflow-hidden"
+ >
+ <TabsList className="flex border-b border-border bg-transparent rounded-none">
+ <TabsTrigger
+ value="presets"
+ className="flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-primary text-text-secondary hover:text-text-primary"
+ >
+ <Star size={16} />
+ Presets
+ </TabsTrigger>
+ <TabsTrigger
+ value="custom"
+ className="flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-primary text-text-secondary hover:text-text-primary"
+ >
+ <Settings size={16} />
+ Custom
+ </TabsTrigger>
+ </TabsList>
- <div className="flex-1 overflow-hidden flex">
- {activeTab === "presets" ? (
- <>
+ <TabsContent value="presets" className="flex-1 overflow-hidden flex mt-0">
<div className="w-48 border-r border-border overflow-y-auto">
<button
onClick={() => setSelectedPlatform("recommended")}
@@ -385,105 +393,121 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
))}
</div>
</div>
- </>
- ) : (
- <div className="flex-1 overflow-y-auto p-4">
+ </TabsContent>
+
+ <TabsContent value="custom" className="flex-1 overflow-y-auto p-4 mt-0">
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-xs font-medium text-text-secondary mb-2">
Format
</label>
- <select
+ <Select
value={customSettings.format}
- onChange={(e) =>
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
- format: e.target.value as "mp4" | "webm" | "mov",
+ format: value as "mp4" | "webm" | "mov",
})
}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary"
>
- <option value="mp4">MP4</option>
- <option value="webm">WebM</option>
- <option value="mov">MOV</option>
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="mp4">MP4</SelectItem>
+ <SelectItem value="webm">WebM</SelectItem>
+ <SelectItem value="mov">MOV</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div>
<label className="block text-xs font-medium text-text-secondary mb-2">
Codec
</label>
- <select
+ <Select
value={customSettings.codec}
- onChange={(e) =>
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
- codec: e.target.value as VideoExportSettings["codec"],
+ codec: value as VideoExportSettings["codec"],
})
}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary"
>
- <option value="h264">H.264</option>
- <option value="h265">H.265 (HEVC)</option>
- <option value="prores">ProRes</option>
- <option value="vp9">VP9</option>
- <option value="av1">AV1</option>
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="h264">H.264</SelectItem>
+ <SelectItem value="h265">H.265 (HEVC)</SelectItem>
+ <SelectItem value="prores">ProRes</SelectItem>
+ <SelectItem value="vp9">VP9</SelectItem>
+ <SelectItem value="av1">AV1</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div>
<label className="block text-xs font-medium text-text-secondary mb-2">
Resolution
</label>
- <select
+ <Select
value={`${customSettings.width}x${customSettings.height}`}
- onChange={(e) => {
- const [w, h] = e.target.value.split("x").map(Number);
+ onValueChange={(value) => {
+ const [w, h] = value.split("x").map(Number);
setCustomSettings({
...customSettings,
width: w,
height: h,
});
}}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary"
>
- <option value="3840x2160">4K (3840x2160)</option>
- <option value="2560x1440">2K (2560x1440)</option>
- <option value="1920x1080">1080p (1920x1080)</option>
- <option value="1280x720">720p (1280x720)</option>
- <option value="854x480">480p (854x480)</option>
- <option value="1080x1920">Vertical 1080p</option>
- <option value="1080x1080">Square 1080</option>
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="3840x2160">4K (3840x2160)</SelectItem>
+ <SelectItem value="2560x1440">2K (2560x1440)</SelectItem>
+ <SelectItem value="1920x1080">1080p (1920x1080)</SelectItem>
+ <SelectItem value="1280x720">720p (1280x720)</SelectItem>
+ <SelectItem value="854x480">480p (854x480)</SelectItem>
+ <SelectItem value="1080x1920">Vertical 1080p</SelectItem>
+ <SelectItem value="1080x1080">Square 1080</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div>
<label className="block text-xs font-medium text-text-secondary mb-2">
Frame Rate
</label>
- <select
- value={customSettings.frameRate}
- onChange={(e) =>
+ <Select
+ value={String(customSettings.frameRate)}
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
- frameRate: Number(e.target.value),
+ frameRate: Number(value),
})
}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary"
>
- <option value={24}>24 fps</option>
- <option value={25}>25 fps</option>
- <option value={30}>30 fps</option>
- <option value={50}>50 fps</option>
- <option value={60}>60 fps</option>
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="24">24 fps</SelectItem>
+ <SelectItem value="25">25 fps</SelectItem>
+ <SelectItem value="30">30 fps</SelectItem>
+ <SelectItem value="50">50 fps</SelectItem>
+ <SelectItem value="60">60 fps</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div>
- <label className="block text-xs font-medium text-text-secondary mb-2">
+ <Label className="block text-xs font-medium text-text-secondary mb-2">
Bitrate (kbps)
- </label>
- <input
+ </Label>
+ <Input
type="number"
value={customSettings.bitrate}
onChange={(e) =>
@@ -492,7 +516,7 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
bitrate: Number(e.target.value),
})
}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary"
+ className="bg-background-tertiary border-border text-text-primary"
min={1000}
max={150000}
step={1000}
@@ -500,23 +524,23 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
</div>
<div>
- <label className="block text-xs font-medium text-text-secondary mb-2">
+ <Label className="block text-xs font-medium text-text-secondary mb-2">
Quality
- </label>
- <input
- type="range"
- value={customSettings.quality}
- onChange={(e) =>
+ </Label>
+ <Slider
+ value={[customSettings.quality]}
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
- quality: Number(e.target.value),
+ quality: value[0],
})
}
- className="w-full"
min={50}
max={100}
+ step={1}
+ className="w-full"
/>
- <div className="flex justify-between text-[10px] text-text-muted">
+ <div className="flex justify-between text-[10px] text-text-muted mt-1">
<span>Smaller</span>
<span>{customSettings.quality}%</span>
<span>Better</span>
@@ -528,14 +552,14 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
Audio Settings
</label>
<div className="grid grid-cols-3 gap-2">
- <select
+ <Select
value={customSettings.audioSettings.format}
- onChange={(e) =>
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
audioSettings: {
...customSettings.audioSettings,
- format: e.target.value as
+ format: value as
| "mp3"
| "wav"
| "aac"
@@ -544,50 +568,62 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
},
})
}
- className="px-2 py-1.5 bg-background-tertiary border border-border rounded text-xs text-text-primary"
>
- <option value="aac">AAC</option>
- <option value="mp3">MP3</option>
- <option value="wav">WAV</option>
- </select>
- <select
- value={customSettings.audioSettings.sampleRate}
- onChange={(e) =>
+ <SelectTrigger className="bg-background-tertiary border-border text-text-primary text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="aac">AAC</SelectItem>
+ <SelectItem value="mp3">MP3</SelectItem>
+ <SelectItem value="wav">WAV</SelectItem>
+ </SelectContent>
+ </Select>
+ <Select
+ value={String(customSettings.audioSettings.sampleRate)}
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
audioSettings: {
...customSettings.audioSettings,
- sampleRate: Number(e.target.value) as
+ sampleRate: Number(value) as
| 44100
| 48000
| 96000,
},
})
}
- className="px-2 py-1.5 bg-background-tertiary border border-border rounded text-xs text-text-primary"
>
- <option value={44100}>44.1 kHz</option>
- <option value={48000}>48 kHz</option>
- <option value={96000}>96 kHz</option>
- </select>
- <select
- value={customSettings.audioSettings.bitrate}
- onChange={(e) =>
+ <SelectTrigger className="bg-background-tertiary border-border text-text-primary text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="44100">44.1 kHz</SelectItem>
+ <SelectItem value="48000">48 kHz</SelectItem>
+ <SelectItem value="96000">96 kHz</SelectItem>
+ </SelectContent>
+ </Select>
+ <Select
+ value={String(customSettings.audioSettings.bitrate)}
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
audioSettings: {
...customSettings.audioSettings,
- bitrate: Number(e.target.value),
+ bitrate: Number(value),
},
})
}
- className="px-2 py-1.5 bg-background-tertiary border border-border rounded text-xs text-text-primary"
>
- <option value={128}>128 kbps</option>
- <option value={192}>192 kbps</option>
- <option value={256}>256 kbps</option>
- <option value={320}>320 kbps</option>
- </select>
+ <SelectTrigger className="bg-background-tertiary border-border text-text-primary text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="128">128 kbps</SelectItem>
+ <SelectItem value="192">192 kbps</SelectItem>
+ <SelectItem value="256">256 kbps</SelectItem>
+ <SelectItem value="320">320 kbps</SelectItem>
+ </SelectContent>
+ </Select>
</div>
</div>
@@ -595,35 +631,23 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
<div className="flex items-center justify-between mb-3">
<div className="flex items-center gap-2">
<Sparkles size={14} className="text-primary" />
- <label className="text-xs font-medium text-text-secondary">
+ <Label htmlFor="upscaling-switch" className="text-xs font-medium text-text-secondary">
Enhance Quality (Upscaling)
- </label>
+ </Label>
</div>
- <button
- type="button"
- onClick={() =>
+ <Switch
+ id="upscaling-switch"
+ checked={customSettings.upscaling?.enabled ?? false}
+ onCheckedChange={(checked) =>
setCustomSettings({
...customSettings,
upscaling: {
...customSettings.upscaling!,
- enabled: !customSettings.upscaling?.enabled,
+ enabled: checked,
},
})
}
- className={`relative w-10 h-5 rounded-full transition-colors ${
- customSettings.upscaling?.enabled
- ? "bg-primary"
- : "bg-background-tertiary border border-border"
- }`}
- >
- <span
- className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${
- customSettings.upscaling?.enabled
- ? "translate-x-5"
- : ""
- }`}
- />
- </button>
+ />
</div>
{customSettings.upscaling?.enabled && (
@@ -661,28 +685,26 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
</div>
<div>
- <label className="block text-[10px] text-text-muted mb-1.5">
+ <Label className="block text-[10px] text-text-muted mb-1.5">
Sharpening
- </label>
- <input
- type="range"
- value={Math.round(
- (customSettings.upscaling?.sharpening ?? 0.3) * 100,
- )}
- onChange={(e) =>
+ </Label>
+ <Slider
+ value={[Math.round((customSettings.upscaling?.sharpening ?? 0.3) * 100)]}
+ onValueChange={(value) =>
setCustomSettings({
...customSettings,
upscaling: {
...customSettings.upscaling!,
- sharpening: Number(e.target.value) / 100,
+ sharpening: value[0] / 100,
},
})
}
- className="w-full"
min={0}
max={100}
+ step={1}
+ className="w-full"
/>
- <div className="flex justify-between text-[10px] text-text-muted">
+ <div className="flex justify-between text-[10px] text-text-muted mt-1">
<span>None</span>
<span>
{Math.round(
@@ -704,9 +726,8 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
)}
</div>
</div>
- </div>
- )}
- </div>
+ </TabsContent>
+ </Tabs>
{deviceProfile && (
<div className="px-4 py-3 border-t border-border bg-background-tertiary/50">
@@ -830,24 +851,20 @@ export const ExportDialog: React.FC<ExportDialogProps> = ({
)}
</div>
<div className="flex items-center gap-2">
- <button
- onClick={onClose}
- className="px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
- >
+ <Button variant="ghost" onClick={onClose}>
Cancel
- </button>
- <button
+ </Button>
+ <Button
onClick={handleExport}
disabled={activeTab === "presets" && !selectedPreset}
- className="flex items-center gap-2 px-4 py-2 bg-primary text-black rounded-lg text-sm font-medium hover:bg-primary/80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Play size={16} />
Start Export
- </button>
+ </Button>
</div>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/InspectorPanel.tsx b/apps/web/src/components/editor/InspectorPanel.tsx
index acc979af..9eaf4fd8 100644
--- a/apps/web/src/components/editor/InspectorPanel.tsx
+++ b/apps/web/src/components/editor/InspectorPanel.tsx
@@ -45,6 +45,18 @@ import {
initializeAudioBridgeEffects,
DEFAULT_EQ_BANDS,
} from "../../bridges/audio-bridge-effects";
+import {
+ Input,
+ LabeledSlider,
+ Switch,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+ SelectGroup,
+ SelectLabel,
+} from "@openreel/ui";
// Initialize engines as singletons
const chromaKeyEngine = new ChromaKeyEngine({ width: 1920, height: 1080 });
@@ -80,104 +92,6 @@ const Section: React.FC<{
);
};
-const LabeledSlider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary bg-background-tertiary px-1.5 py-0.5 rounded border border-border">
- {step < 1 ? value.toFixed(1) : Math.round(value)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${Math.max(0, Math.min(100, percentage))}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{
- left: `calc(${Math.max(0, Math.min(100, percentage))}% - 5px)`,
- }}
- />
- </div>
- </div>
- );
-};
-
-const Slider: React.FC<{
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
-}> = ({ value, onChange, min = 0, max = 100 }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="flex items-center gap-3">
- <div className="flex-1 h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-3 h-3 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 6px)` }}
- />
- </div>
- <span className="text-[10px] font-mono text-text-primary w-8 text-right bg-background-tertiary px-1 py-0.5 rounded border border-border">
- {Math.round(value)}
- </span>
- </div>
- );
-};
-
-const Toggle: React.FC<{
- value: boolean;
- onChange: (value: boolean) => void;
-}> = ({ value, onChange }) => (
- <button
- onClick={() => onChange(!value)}
- className={`w-10 h-5 rounded-full transition-colors ${
- value ? "bg-primary" : "bg-background-tertiary border border-border"
- }`}
- >
- <div
- className={`w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${
- value ? "translate-x-5" : "translate-x-0.5"
- }`}
- />
- </button>
-);
-
const EmptyState: React.FC = () => (
<div className="flex-1 flex flex-col items-center justify-center p-8 text-center opacity-50">
<p className="text-sm text-text-secondary mb-2">No selection</p>
@@ -633,22 +547,22 @@ export const InspectorPanel: React.FC = () => {
<label className="text-[10px] text-text-secondary block mb-1">
Animation Style
</label>
- <select
+ <Select
value={defaultAnimationStyle}
- onChange={(e) =>
- setDefaultAnimationStyle(
- e.target.value as CaptionAnimationStyle,
- )
- }
+ onValueChange={(v) => setDefaultAnimationStyle(v as CaptionAnimationStyle)}
disabled={isTranscribing}
- className="w-full px-2 py-1.5 text-[11px] text-text-primary bg-background-secondary border border-border rounded outline-none focus:border-primary cursor-pointer disabled:opacity-50"
>
- {CAPTION_ANIMATION_STYLES.map((style) => (
- <option key={style} value={style}>
- {getAnimationStyleDisplayName(style)}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-secondary border-border text-text-primary text-[11px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {CAPTION_ANIMATION_STYLES.map((style) => (
+ <SelectItem key={style} value={style}>
+ {getAnimationStyleDisplayName(style)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
{transcriptionProgress ? (
@@ -943,9 +857,9 @@ export const InspectorPanel: React.FC = () => {
<span className="text-[10px] text-text-secondary">
Enable
</span>
- <Toggle
- value={chromaKeyEnabled}
- onChange={handleChromaKeyToggle}
+ <Switch
+ checked={chromaKeyEnabled}
+ onCheckedChange={handleChromaKeyToggle}
/>
</div>
{chromaKeyEnabled && (
@@ -961,20 +875,12 @@ export const InspectorPanel: React.FC = () => {
className="w-8 h-6 rounded border border-border cursor-pointer"
/>
</div>
- <div>
- <div className="flex items-center justify-between mb-1">
- <span className="text-[10px] text-text-secondary">
- Tolerance
- </span>
- <span className="text-[10px] font-mono">
- {Math.round(tolerance)}%
- </span>
- </div>
- <Slider
- value={tolerance}
- onChange={handleToleranceChange}
- />
- </div>
+ <LabeledSlider
+ label="Tolerance"
+ value={tolerance}
+ onChange={handleToleranceChange}
+ unit="%"
+ />
</>
)}
</div>
@@ -1171,7 +1077,7 @@ export const InspectorPanel: React.FC = () => {
<span className="text-[10px] text-text-secondary">
Start Time
</span>
- <input
+ <Input
type="number"
step="0.1"
value={selectedSubtitle.startTime.toFixed(2)}
@@ -1180,14 +1086,14 @@ export const InspectorPanel: React.FC = () => {
startTime: parseFloat(e.target.value) || 0,
})
}
- className="w-20 px-2 py-1 bg-background-tertiary border border-border rounded text-[10px] text-text-primary text-right focus:outline-none focus:border-primary"
+ className="w-20 h-7 text-[10px] bg-background-tertiary border-border text-text-primary text-right"
/>
</div>
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">
End Time
</span>
- <input
+ <Input
type="number"
step="0.1"
value={selectedSubtitle.endTime.toFixed(2)}
@@ -1196,7 +1102,7 @@ export const InspectorPanel: React.FC = () => {
endTime: parseFloat(e.target.value) || 0,
})
}
- className="w-20 px-2 py-1 bg-background-tertiary border border-border rounded text-[10px] text-text-primary text-right focus:outline-none focus:border-primary"
+ className="w-20 h-7 text-[10px] bg-background-tertiary border-border text-text-primary text-right"
/>
</div>
</div>
@@ -1233,21 +1139,25 @@ export const InspectorPanel: React.FC = () => {
<div className="space-y-3">
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">Style</span>
- <select
+ <Select
value={selectedSubtitle.animationStyle || "none"}
- onChange={(e) =>
+ onValueChange={(v) =>
updateSubtitle(selectedSubtitle.id, {
- animationStyle: e.target.value as CaptionAnimationStyle,
+ animationStyle: v as CaptionAnimationStyle,
})
}
- className="px-2 py-1 text-[10px] text-text-primary bg-background-tertiary border border-border rounded outline-none focus:border-primary cursor-pointer"
>
- {CAPTION_ANIMATION_STYLES.map((style) => (
- <option key={style} value={style}>
- {getAnimationStyleDisplayName(style)}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-auto min-w-[100px] bg-background-tertiary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {CAPTION_ANIMATION_STYLES.map((style) => (
+ <SelectItem key={style} value={style}>
+ {getAnimationStyleDisplayName(style)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<p className="text-[9px] text-text-muted">
{selectedSubtitle.animationStyle === "karaoke" &&
@@ -1345,96 +1255,61 @@ export const InspectorPanel: React.FC = () => {
<span className="text-[10px] text-text-secondary">
Font Family
</span>
- <select
+ <Select
value={selectedSubtitle.style?.fontFamily || "Inter"}
- onChange={(e) =>
+ onValueChange={(v) =>
updateSubtitle(selectedSubtitle.id, {
style: {
...(selectedSubtitle.style || {}),
- fontFamily: e.target.value,
+ fontFamily: v,
} as typeof selectedSubtitle.style,
})
}
- className="px-2 py-1 text-[10px] text-text-primary bg-background-tertiary border border-border rounded outline-none focus:border-primary cursor-pointer max-w-[120px]"
>
- <optgroup label="Popular">
- {[
- "Inter",
- "Poppins",
- "Montserrat",
- "Roboto",
- "Open Sans",
- "Lato",
- "DM Sans",
- ].map((font) => (
- <option
- key={font}
- value={font}
- style={{ fontFamily: font }}
- >
- {font}
- </option>
- ))}
- </optgroup>
- <optgroup label="Display">
- {[
- "Bebas Neue",
- "Anton",
- "Oswald",
- "Teko",
- "Staatliches",
- "Alfa Slab One",
- ].map((font) => (
- <option
- key={font}
- value={font}
- style={{ fontFamily: font }}
- >
- {font}
- </option>
- ))}
- </optgroup>
- <optgroup label="Elegant">
- {[
- "Playfair Display",
- "Cinzel",
- "Lora",
- "Merriweather",
- "DM Serif Display",
- ].map((font) => (
- <option
- key={font}
- value={font}
- style={{ fontFamily: font }}
- >
- {font}
- </option>
- ))}
- </optgroup>
- <optgroup label="Handwritten">
- {[
- "Pacifico",
- "Lobster",
- "Dancing Script",
- "Caveat",
- "Permanent Marker",
- ].map((font) => (
- <option
- key={font}
- value={font}
- style={{ fontFamily: font }}
- >
- {font}
- </option>
- ))}
- </optgroup>
- </select>
+ <SelectTrigger className="max-w-[120px] bg-background-tertiary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border max-h-60">
+ <SelectGroup>
+ <SelectLabel className="text-text-muted text-[10px] font-medium">Popular</SelectLabel>
+ {["Inter", "Poppins", "Montserrat", "Roboto", "Open Sans", "Lato", "DM Sans"].map((font) => (
+ <SelectItem key={font} value={font} style={{ fontFamily: font }}>
+ {font}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ <SelectGroup>
+ <SelectLabel className="text-text-muted text-[10px] font-medium">Display</SelectLabel>
+ {["Bebas Neue", "Anton", "Oswald", "Teko", "Staatliches", "Alfa Slab One"].map((font) => (
+ <SelectItem key={font} value={font} style={{ fontFamily: font }}>
+ {font}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ <SelectGroup>
+ <SelectLabel className="text-text-muted text-[10px] font-medium">Elegant</SelectLabel>
+ {["Playfair Display", "Cinzel", "Lora", "Merriweather", "DM Serif Display"].map((font) => (
+ <SelectItem key={font} value={font} style={{ fontFamily: font }}>
+ {font}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ <SelectGroup>
+ <SelectLabel className="text-text-muted text-[10px] font-medium">Handwritten</SelectLabel>
+ {["Pacifico", "Lobster", "Dancing Script", "Caveat", "Permanent Marker"].map((font) => (
+ <SelectItem key={font} value={font} style={{ fontFamily: font }}>
+ {font}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ </SelectContent>
+ </Select>
</div>
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">
Font Size
</span>
- <input
+ <Input
type="number"
min={12}
max={72}
@@ -1447,7 +1322,7 @@ export const InspectorPanel: React.FC = () => {
} as typeof selectedSubtitle.style,
})
}
- className="w-16 px-2 py-1 bg-background-tertiary border border-border rounded text-[10px] text-text-primary text-right focus:outline-none focus:border-primary"
+ className="w-16 h-7 text-[10px] bg-background-tertiary border-border text-text-primary text-right"
/>
</div>
</div>
@@ -1506,23 +1381,21 @@ export const InspectorPanel: React.FC = () => {
}}
className="w-6 h-6 rounded border border-border cursor-pointer"
/>
- <select
+ <Select
value={
selectedSubtitle.style?.backgroundColor?.includes("0.7")
? "0.7"
- : selectedSubtitle.style?.backgroundColor?.includes(
- "0.5",
- )
+ : selectedSubtitle.style?.backgroundColor?.includes("0.5")
? "0.5"
: "1"
}
- onChange={(e) => {
+ onValueChange={(v) => {
const currentBg =
selectedSubtitle.style?.backgroundColor ||
"rgba(0, 0, 0, 0.7)";
const newBg = currentBg.replace(
/[\d.]+\)$/,
- `${e.target.value})`,
+ `${v})`,
);
updateSubtitle(selectedSubtitle.id, {
style: {
@@ -1531,13 +1404,17 @@ export const InspectorPanel: React.FC = () => {
} as typeof selectedSubtitle.style,
});
}}
- className="px-1 py-0.5 text-[9px] text-text-primary bg-background-tertiary border border-border rounded outline-none"
>
- <option value="0">None</option>
- <option value="0.5">50%</option>
- <option value="0.7">70%</option>
- <option value="1">100%</option>
- </select>
+ <SelectTrigger className="w-auto min-w-[50px] bg-background-tertiary border-border text-text-primary text-[9px] h-6">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="0">None</SelectItem>
+ <SelectItem value="0.5">50%</SelectItem>
+ <SelectItem value="0.7">70%</SelectItem>
+ <SelectItem value="1">100%</SelectItem>
+ </SelectContent>
+ </Select>
</div>
</div>
</div>
diff --git a/apps/web/src/components/editor/KeyboardShortcutsOverlay.tsx b/apps/web/src/components/editor/KeyboardShortcutsOverlay.tsx
index 533abae8..37ce2c08 100644
--- a/apps/web/src/components/editor/KeyboardShortcutsOverlay.tsx
+++ b/apps/web/src/components/editor/KeyboardShortcutsOverlay.tsx
@@ -1,5 +1,12 @@
import React, { useState, useEffect, useCallback } from "react";
-import { X, Keyboard, Search, RotateCcw, ChevronDown } from "lucide-react";
+import { Keyboard, Search, RotateCcw, ChevronDown } from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Input,
+} from "@openreel/ui";
import {
keyboardShortcuts,
formatKeyComboDisplay,
@@ -128,35 +135,29 @@ export const KeyboardShortcutsOverlay: React.FC<
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="w-full max-w-3xl max-h-[80vh] bg-background-secondary rounded-xl border border-border shadow-2xl overflow-hidden flex flex-col">
- <div className="flex items-center justify-between p-4 border-b border-border bg-background-tertiary">
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-3xl max-h-[80vh] p-0 gap-0 bg-background-secondary border-border overflow-hidden flex flex-col">
+ <DialogHeader className="p-4 border-b border-border bg-background-tertiary space-y-0">
<div className="flex items-center gap-3">
<Keyboard size={20} className="text-primary" />
- <h2 className="text-lg font-bold text-text-primary">
+ <DialogTitle className="text-lg font-bold text-text-primary">
Keyboard Shortcuts
- </h2>
+ </DialogTitle>
</div>
- <button
- onClick={onClose}
- className="p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-secondary transition-colors"
- >
- <X size={20} />
- </button>
- </div>
+ </DialogHeader>
<div className="flex items-center gap-3 p-4 border-b border-border">
<div className="flex-1 relative">
<Search
size={16}
- className="absolute left-3 top-1/2 -translate-y-1/2 text-text-muted"
+ className="absolute left-3 top-1/2 -translate-y-1/2 text-text-muted z-10"
/>
- <input
+ <Input
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder="Search shortcuts..."
- className="w-full pl-9 pr-4 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"
+ className="pl-9 bg-background-tertiary border-border text-text-primary"
/>
</div>
@@ -302,8 +303,8 @@ export const KeyboardShortcutsOverlay: React.FC<
to toggle this overlay
</p>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/OnboardingOverlay.tsx b/apps/web/src/components/editor/OnboardingOverlay.tsx
index 69060996..15542c4b 100644
--- a/apps/web/src/components/editor/OnboardingOverlay.tsx
+++ b/apps/web/src/components/editor/OnboardingOverlay.tsx
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import {
- X,
ChevronRight,
ChevronLeft,
Play,
@@ -11,6 +10,7 @@ import {
HelpCircle,
Sparkles,
} from "lucide-react";
+import { Dialog, DialogContent } from "@openreel/ui";
interface OnboardingOverlayProps {
isOpen: boolean;
@@ -143,15 +143,9 @@ export const OnboardingOverlay: React.FC<OnboardingOverlayProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/90 backdrop-blur-sm">
- <div className="w-full max-w-lg bg-background-secondary rounded-2xl border border-border shadow-2xl overflow-hidden">
+ <Dialog open onOpenChange={(open) => !open && handleSkip()}>
+ <DialogContent className="max-w-lg p-0 gap-0 bg-background-secondary border-border overflow-hidden">
<div className="relative p-8 text-center">
- <button
- onClick={handleSkip}
- className="absolute top-4 right-4 p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-tertiary transition-colors"
- >
- <X size={20} />
- </button>
<div className="flex justify-center mb-6">{step.icon}</div>
@@ -213,8 +207,8 @@ export const OnboardingOverlay: React.FC<OnboardingOverlayProps> = ({
{!isLastStep && <ChevronRight size={16} />}
</button>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/Preview.tsx b/apps/web/src/components/editor/Preview.tsx
index 4c5fddf4..4647f714 100644
--- a/apps/web/src/components/editor/Preview.tsx
+++ b/apps/web/src/components/editor/Preview.tsx
@@ -18,6 +18,7 @@ import {
Move,
Loader2,
} from "lucide-react";
+import { IconButton } from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import { useTimelineStore } from "../../stores/timeline-store";
import { useUIStore } from "../../stores/ui-store";
@@ -46,7 +47,6 @@ import {
type ClipTransform,
DEFAULT_TRANSFORM,
formatTime,
- IconButton,
renderTextClipToCanvas,
getActiveTextClips,
getActiveShapeClips,
diff --git a/apps/web/src/components/editor/ProjectDialog.tsx b/apps/web/src/components/editor/ProjectDialog.tsx
index 8fbfebdf..de282591 100644
--- a/apps/web/src/components/editor/ProjectDialog.tsx
+++ b/apps/web/src/components/editor/ProjectDialog.tsx
@@ -1,6 +1,5 @@
-import React, { useState, useEffect, useCallback } from "react";
+import { useState, useEffect, useCallback } from "react";
import {
- X,
Plus,
FolderOpen,
Clock,
@@ -12,6 +11,19 @@ import {
ChevronRight,
FileVideo,
} from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Button,
+ Input,
+ Label,
+ Tabs,
+ TabsList,
+ TabsTrigger,
+ TabsContent,
+} from "@openreel/ui";
import {
projectManager,
type RecentProject,
@@ -135,68 +147,58 @@ export const ProjectDialog: React.FC<ProjectDialogProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="w-full max-w-3xl max-h-[80vh] bg-background-secondary rounded-xl border border-border shadow-2xl overflow-hidden flex flex-col">
- <div className="flex items-center justify-between p-4 border-b border-border bg-background-tertiary">
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-3xl max-h-[80vh] p-0 gap-0 bg-background-secondary border-border overflow-hidden flex flex-col">
+ <DialogHeader className="p-4 border-b border-border bg-background-tertiary space-y-0">
<div className="flex items-center gap-3">
<FileVideo size={20} className="text-primary" />
- <h2 className="text-lg font-bold text-text-primary">
+ <DialogTitle className="text-lg font-bold text-text-primary">
{mode === "open" ? "Open Project" : "Project"}
- </h2>
+ </DialogTitle>
</div>
- <button
- onClick={onClose}
- className="p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-secondary transition-colors"
- >
- <X size={20} />
- </button>
- </div>
+ </DialogHeader>
- <div className="flex border-b border-border">
- <button
- onClick={() => setActiveTab("new")}
- className={`flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium transition-colors ${
- activeTab === "new"
- ? "text-primary border-b-2 border-primary"
- : "text-text-secondary hover:text-text-primary"
- }`}
- >
- <Plus size={16} />
- New Project
- </button>
- <button
- onClick={() => setActiveTab("recent")}
- className={`flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium transition-colors ${
- activeTab === "recent"
- ? "text-primary border-b-2 border-primary"
- : "text-text-secondary hover:text-text-primary"
- }`}
- >
- <Clock size={16} />
- Recent ({recentProjects.length})
- </button>
- </div>
+ <Tabs
+ value={activeTab}
+ onValueChange={(v) => setActiveTab(v as "new" | "recent")}
+ className="flex-1 flex flex-col overflow-hidden"
+ >
+ <TabsList className="flex border-b border-border bg-transparent rounded-none">
+ <TabsTrigger
+ value="new"
+ className="flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-primary text-text-secondary hover:text-text-primary"
+ >
+ <Plus size={16} />
+ New Project
+ </TabsTrigger>
+ <TabsTrigger
+ value="recent"
+ className="flex-1 flex items-center justify-center gap-2 p-3 text-sm font-medium rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-primary text-text-secondary hover:text-text-primary"
+ >
+ <Clock size={16} />
+ Recent ({recentProjects.length})
+ </TabsTrigger>
+ </TabsList>
- <div className="flex-1 overflow-y-auto p-4">
- {activeTab === "new" ? (
+ <TabsContent value="new" className="flex-1 overflow-y-auto p-4 mt-0">
<div className="space-y-6">
<div>
- <label className="block text-xs font-medium text-text-secondary mb-2">
+ <Label className="block text-xs font-medium text-text-secondary mb-2">
Project Name
- </label>
- <input
+ </Label>
+ <Input
type="text"
value={projectName}
onChange={(e) => setProjectName(e.target.value)}
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"
+ className="bg-background-tertiary border-border text-text-primary"
placeholder="Enter project name"
/>
</div>
<div>
- <label className="block text-xs font-medium text-text-secondary mb-3">
+ <Label className="block text-xs font-medium text-text-secondary mb-3">
Choose a Template
- </label>
+ </Label>
<div className="space-y-4">
{Array.from(templates.entries()).map(
([category, categoryTemplates]) => (
@@ -247,88 +249,84 @@ export const ProjectDialog: React.FC<ProjectDialogProps> = ({
</div>
</div>
</div>
- ) : (
- <div>
- {recentProjects.length === 0 ? (
- <div className="flex flex-col items-center justify-center py-12 text-text-muted">
- <Clock size={32} className="mb-3 opacity-30" />
- <p className="text-sm">No recent projects</p>
- <p className="text-xs mt-1">
- Projects you open will appear here
- </p>
- </div>
- ) : (
- <div className="space-y-2">
- {recentProjects.map((project) => (
+ </TabsContent>
+
+ <TabsContent value="recent" className="flex-1 overflow-y-auto p-4 mt-0">
+ {recentProjects.length === 0 ? (
+ <div className="flex flex-col items-center justify-center py-12 text-text-muted">
+ <Clock size={32} className="mb-3 opacity-30" />
+ <p className="text-sm">No recent projects</p>
+ <p className="text-xs mt-1">
+ Projects you open will appear here
+ </p>
+ </div>
+ ) : (
+ <div className="space-y-2">
+ {recentProjects.map((project) => (
+ <button
+ key={project.id}
+ onClick={() => handleOpenRecent(project)}
+ disabled={isLoading}
+ className="w-full flex items-center gap-3 p-3 rounded-lg border border-border hover:border-primary/50 hover:bg-background-tertiary transition-colors group disabled:opacity-50"
+ >
+ <div className="w-12 h-12 bg-background-tertiary rounded-lg flex items-center justify-center">
+ <FileVideo size={20} className="text-text-muted" />
+ </div>
+ <div className="flex-1 text-left min-w-0">
+ <p className="text-sm font-medium text-text-primary truncate">
+ {project.name}
+ </p>
+ <p className="text-[10px] text-text-muted">
+ {formatDate(project.lastOpened)}
+ {project.trackCount !== undefined && (
+ <> · {project.trackCount} tracks</>
+ )}
+ </p>
+ </div>
+ <ChevronRight
+ size={16}
+ className="text-text-muted group-hover:text-primary transition-colors"
+ />
<button
- key={project.id}
- onClick={() => handleOpenRecent(project)}
- disabled={isLoading}
- className="w-full flex items-center gap-3 p-3 rounded-lg border border-border hover:border-primary/50 hover:bg-background-tertiary transition-colors group disabled:opacity-50"
+ onClick={(e) => handleRemoveRecent(project.id, e)}
+ className="p-1 rounded hover:bg-red-500/20 text-text-muted hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all"
+ title="Remove from recent"
>
- <div className="w-12 h-12 bg-background-tertiary rounded-lg flex items-center justify-center">
- <FileVideo size={20} className="text-text-muted" />
- </div>
- <div className="flex-1 text-left min-w-0">
- <p className="text-sm font-medium text-text-primary truncate">
- {project.name}
- </p>
- <p className="text-[10px] text-text-muted">
- {formatDate(project.lastOpened)}
- {project.trackCount !== undefined && (
- <> · {project.trackCount} tracks</>
- )}
- </p>
- </div>
- <ChevronRight
- size={16}
- className="text-text-muted group-hover:text-primary transition-colors"
- />
- <button
- onClick={(e) => handleRemoveRecent(project.id, e)}
- className="p-1 rounded hover:bg-red-500/20 text-text-muted hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all"
- title="Remove from recent"
- >
- <Trash2 size={14} />
- </button>
+ <Trash2 size={14} />
</button>
- ))}
- </div>
- )}
- </div>
- )}
- </div>
+ </button>
+ ))}
+ </div>
+ )}
+ </TabsContent>
+ </Tabs>
<div className="flex items-center justify-between p-4 border-t border-border bg-background-tertiary">
- <button
+ <Button
+ variant="ghost"
onClick={handleOpenProject}
disabled={isLoading}
- className="flex items-center gap-2 px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50"
>
<FolderOpen size={16} />
Open from File...
- </button>
+ </Button>
<div className="flex items-center gap-2">
- <button
- onClick={onClose}
- className="px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
- >
+ <Button variant="ghost" onClick={onClose}>
Cancel
- </button>
+ </Button>
{activeTab === "new" && (
- <button
+ <Button
onClick={handleCreateProject}
disabled={isLoading || !projectName.trim()}
- className="flex items-center gap-2 px-4 py-2 bg-primary text-black rounded-lg text-sm font-medium hover:bg-primary/80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Plus size={16} />
Create Project
- </button>
+ </Button>
)}
</div>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/ProjectSwitcher.tsx b/apps/web/src/components/editor/ProjectSwitcher.tsx
index 289cdf41..686a0fa4 100644
--- a/apps/web/src/components/editor/ProjectSwitcher.tsx
+++ b/apps/web/src/components/editor/ProjectSwitcher.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect, useRef, useCallback } from "react";
+import React, { useState, useEffect, useCallback, useRef } from "react";
import {
ChevronDown,
Plus,
@@ -8,6 +8,7 @@ import {
Pencil,
FileVideo,
} from "lucide-react";
+import { Input } from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import { autoSaveManager, type AutoSaveMetadata } from "../../services/auto-save";
@@ -149,14 +150,14 @@ export const ProjectSwitcher: React.FC = () => {
</div>
{isEditing ? (
<div className="flex items-center gap-2">
- <input
+ <Input
ref={inputRef}
type="text"
value={editName}
onChange={(e) => setEditName(e.target.value)}
onBlur={handleSaveName}
onKeyDown={handleKeyDown}
- className="flex-1 px-3 py-2 bg-background-secondary border border-primary rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
+ className="flex-1 bg-background-secondary border-primary text-text-primary"
/>
<button
onClick={handleSaveName}
diff --git a/apps/web/src/components/editor/SaveTemplateDialog.tsx b/apps/web/src/components/editor/SaveTemplateDialog.tsx
index 5a8750ee..97c8d8c0 100644
--- a/apps/web/src/components/editor/SaveTemplateDialog.tsx
+++ b/apps/web/src/components/editor/SaveTemplateDialog.tsx
@@ -1,5 +1,19 @@
-import React, { useState, useCallback } from "react";
-import { X, Upload, Cloud, HardDrive, Check, AlertCircle } from "lucide-react";
+import { useState, useCallback } from "react";
+import { Upload, Cloud, HardDrive, Check, AlertCircle } from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Button,
+ Input,
+ Label,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import { useEngineStore } from "../../stores/engine-store";
import {
@@ -141,19 +155,13 @@ export const SaveTemplateDialog: React.FC<SaveTemplateDialogProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 backdrop-blur-sm">
- <div className="bg-background border border-border rounded-xl shadow-2xl w-full max-w-lg mx-4">
- <div className="flex items-center justify-between p-4 border-b border-border">
- <h2 className="text-lg font-semibold text-text-primary">
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-lg p-0 gap-0 bg-background border-border overflow-hidden">
+ <DialogHeader className="p-4 border-b border-border space-y-0">
+ <DialogTitle className="text-lg font-semibold text-text-primary">
Save as Template
- </h2>
- <button
- onClick={onClose}
- className="p-1 hover:bg-background-secondary rounded-lg transition-colors"
- >
- <X size={18} className="text-text-muted" />
- </button>
- </div>
+ </DialogTitle>
+ </DialogHeader>
<div className="p-4 space-y-4 max-h-[70vh] overflow-y-auto">
{success && (
@@ -173,15 +181,15 @@ export const SaveTemplateDialog: React.FC<SaveTemplateDialogProps> = ({
)}
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Template Name <span className="text-red-400">*</span>
- </label>
- <input
+ </Label>
+ <Input
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
placeholder="My Awesome Template"
- className="w-full px-3 py-2 text-sm bg-background-secondary border border-border rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary/50"
+ className="bg-background-secondary border-border text-text-primary"
maxLength={50}
/>
<p className="text-[10px] text-text-muted">
@@ -190,9 +198,9 @@ export const SaveTemplateDialog: React.FC<SaveTemplateDialogProps> = ({
</div>
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Description <span className="text-red-400">*</span>
- </label>
+ </Label>
<textarea
value={description}
onChange={(e) => setDescription(e.target.value)}
@@ -207,52 +215,53 @@ export const SaveTemplateDialog: React.FC<SaveTemplateDialogProps> = ({
</div>
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Category
- </label>
- <select
- value={category}
- onChange={(e) => setCategory(e.target.value as TemplateCategory)}
- className="w-full px-3 py-2 text-sm bg-background-secondary border border-border rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/50"
- >
- {TEMPLATE_CATEGORIES.map((cat) => (
- <option key={cat.id} value={cat.id}>
- {cat.name}
- </option>
- ))}
- </select>
+ </Label>
+ <Select value={category} onValueChange={(value) => setCategory(value as TemplateCategory)}>
+ <SelectTrigger className="w-full bg-background-secondary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {TEMPLATE_CATEGORIES.map((cat) => (
+ <SelectItem key={cat.id} value={cat.id}>
+ {cat.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Tags (comma-separated)
- </label>
- <input
+ </Label>
+ <Input
type="text"
value={tags}
onChange={(e) => setTags(e.target.value)}
placeholder="intro, animated, youtube"
- className="w-full px-3 py-2 text-sm bg-background-secondary border border-border rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary/50"
+ className="bg-background-secondary border-border text-text-primary"
/>
</div>
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Author Name
- </label>
- <input
+ </Label>
+ <Input
type="text"
value={author}
onChange={(e) => setAuthor(e.target.value)}
placeholder="Your name or username"
- className="w-full px-3 py-2 text-sm bg-background-secondary border border-border rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary/50"
+ className="bg-background-secondary border-border text-text-primary"
/>
</div>
<div className="space-y-2">
- <label className="block text-xs font-medium text-text-secondary">
+ <Label className="text-xs font-medium text-text-secondary">
Save Location
- </label>
+ </Label>
<div className="grid grid-cols-2 gap-2">
<button
onClick={() => setSaveLocation("cloud")}
@@ -286,32 +295,27 @@ export const SaveTemplateDialog: React.FC<SaveTemplateDialogProps> = ({
</div>
<div className="flex items-center justify-end gap-2 p-4 border-t border-border">
- <button
- onClick={onClose}
- disabled={isSaving}
- className="px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary bg-background-secondary rounded-lg transition-colors disabled:opacity-50"
- >
+ <Button variant="ghost" onClick={onClose} disabled={isSaving}>
Cancel
- </button>
- <button
+ </Button>
+ <Button
onClick={handleSave}
disabled={isSaving || !name.trim() || !description.trim()}
- className="flex items-center gap-2 px-4 py-2 text-sm font-medium bg-primary text-white rounded-lg hover:bg-primary-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
{isSaving ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent" />
- <span>Saving...</span>
+ Saving...
</>
) : (
<>
<Upload size={16} />
- <span>Save Template</span>
+ Save Template
</>
)}
- </button>
+ </Button>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/ScreenRecorder.tsx b/apps/web/src/components/editor/ScreenRecorder.tsx
index edd5a5d8..9f574536 100644
--- a/apps/web/src/components/editor/ScreenRecorder.tsx
+++ b/apps/web/src/components/editor/ScreenRecorder.tsx
@@ -1,6 +1,5 @@
import React, { useEffect, useRef } from "react";
import {
- X,
Monitor,
Mic,
MicOff,
@@ -20,6 +19,17 @@ import {
} from "../../services/screen-recorder";
import { RecordingCountdown } from "./RecordingCountdown";
import { RecordingControls } from "./RecordingControls";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
interface ScreenRecorderProps {
isOpen: boolean;
@@ -128,22 +138,16 @@ export const ScreenRecorder: React.FC<ScreenRecorderProps> = ({
}
return (
- <div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="w-full max-w-2xl bg-background-secondary rounded-xl border border-border shadow-2xl overflow-hidden">
- <div className="flex items-center justify-between p-4 border-b border-border bg-background-tertiary">
+ <Dialog open onOpenChange={(open) => !open && handleCancel()}>
+ <DialogContent className="max-w-2xl p-0 gap-0 bg-background-secondary border-border overflow-hidden">
+ <DialogHeader className="p-4 border-b border-border bg-background-tertiary space-y-0">
<div className="flex items-center gap-3">
<Circle size={20} className="text-error fill-error animate-pulse" />
- <h2 className="text-lg font-bold text-text-primary">
+ <DialogTitle className="text-lg font-bold text-text-primary">
Screen Recording
- </h2>
+ </DialogTitle>
</div>
- <button
- onClick={handleCancel}
- className="p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-secondary transition-colors"
- >
- <X size={20} />
- </button>
- </div>
+ </DialogHeader>
<div className="p-6 space-y-6">
{!isSupported && (
@@ -190,23 +194,22 @@ export const ScreenRecorder: React.FC<ScreenRecorderProps> = ({
<label className="block text-xs text-text-muted mb-2">
Resolution
</label>
- <select
+ <Select
value={options.video.resolution}
- onChange={(e) =>
- setVideoOption(
- "resolution",
- e.target.value as VideoResolution,
- )
- }
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary focus:outline-none focus:border-primary"
+ onValueChange={(v) => setVideoOption("resolution", v as VideoResolution)}
disabled={!isSupported}
>
- {RESOLUTION_OPTIONS.map((opt) => (
- <option key={opt.value} value={opt.value}>
- {opt.label}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {RESOLUTION_OPTIONS.map((opt) => (
+ <SelectItem key={opt.value} value={opt.value}>
+ {opt.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<p className="text-[10px] text-text-muted mt-1">
{
RESOLUTION_OPTIONS.find(
@@ -220,23 +223,22 @@ export const ScreenRecorder: React.FC<ScreenRecorderProps> = ({
<label className="block text-xs text-text-muted mb-2">
Frame Rate
</label>
- <select
- value={options.video.frameRate}
- onChange={(e) =>
- setVideoOption(
- "frameRate",
- parseInt(e.target.value) as FrameRate,
- )
- }
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary focus:outline-none focus:border-primary"
+ <Select
+ value={String(options.video.frameRate)}
+ onValueChange={(v) => setVideoOption("frameRate", parseInt(v) as FrameRate)}
disabled={!isSupported}
>
- {FRAMERATE_OPTIONS.map((opt) => (
- <option key={opt.value} value={opt.value}>
- {opt.label}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {FRAMERATE_OPTIONS.map((opt) => (
+ <SelectItem key={opt.value} value={String(opt.value)}>
+ {opt.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
</div>
@@ -326,22 +328,21 @@ export const ScreenRecorder: React.FC<ScreenRecorderProps> = ({
<label className="block text-xs text-text-muted mb-2">
Webcam Resolution
</label>
- <select
+ <Select
value={options.webcam.resolution}
- onChange={(e) =>
- setWebcamOption(
- "resolution",
- e.target.value as WebcamResolution,
- )
- }
- className="w-full px-3 py-2 bg-background-tertiary border border-border rounded-lg text-sm text-text-primary focus:outline-none focus:border-primary"
+ onValueChange={(v) => setWebcamOption("resolution", v as WebcamResolution)}
>
- {WEBCAM_RESOLUTION_OPTIONS.map((opt) => (
- <option key={opt.value} value={opt.value}>
- {opt.label}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {WEBCAM_RESOLUTION_OPTIONS.map((opt) => (
+ <SelectItem key={opt.value} value={opt.value}>
+ {opt.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
{webcamStream && (
@@ -396,7 +397,7 @@ export const ScreenRecorder: React.FC<ScreenRecorderProps> = ({
</button>
</div>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/ScriptViewDialog.tsx b/apps/web/src/components/editor/ScriptViewDialog.tsx
index 18b3d7a0..64ac2c86 100644
--- a/apps/web/src/components/editor/ScriptViewDialog.tsx
+++ b/apps/web/src/components/editor/ScriptViewDialog.tsx
@@ -1,6 +1,5 @@
-import React, { useState, useCallback, useMemo } from "react";
+import { useState, useCallback, useMemo } from "react";
import {
- X,
Copy,
Download,
FileCode,
@@ -12,6 +11,18 @@ import {
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json";
import { vs2015 } from "react-syntax-highlighter/dist/esm/styles/hljs";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ Button,
+ Tabs,
+ TabsList,
+ TabsTrigger,
+ TabsContent,
+} from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import { createProjectSerializer, createStorageEngine } from "@openreel/core";
import type { ValidationResult } from "@openreel/core/storage/schema-types";
@@ -23,14 +34,11 @@ interface ScriptViewDialogProps {
onClose: () => void;
}
-type TabType = "view" | "import";
-
export const ScriptViewDialog: React.FC<ScriptViewDialogProps> = ({
isOpen,
onClose,
}) => {
const { project } = useProjectStore();
- const [activeTab, setActiveTab] = useState<TabType>("view");
const [importJson, setImportJson] = useState("");
const [validation, setValidation] = useState<ValidationResult | null>(null);
const [isValidating, setIsValidating] = useState(false);
@@ -111,206 +119,169 @@ export const ScriptViewDialog: React.FC<ScriptViewDialogProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="bg-background-secondary border border-border rounded-lg shadow-2xl w-full max-w-6xl max-h-[90vh] flex flex-col">
- {/* Header */}
- <div className="flex items-center justify-between p-4 border-b border-border">
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-6xl max-h-[90vh] p-0 gap-0 bg-background-secondary border-border overflow-hidden flex flex-col">
+ <DialogHeader className="p-4 border-b border-border space-y-0">
<div className="flex items-center gap-3">
<FileCode size={20} className="text-primary" />
<div>
- <h2 className="text-lg font-semibold text-text-primary">
+ <DialogTitle className="text-lg font-semibold text-text-primary">
Script View
- </h2>
- <p className="text-xs text-text-muted">
+ </DialogTitle>
+ <DialogDescription className="text-xs text-text-muted">
View and import project JSON
- </p>
+ </DialogDescription>
</div>
</div>
- <button
- onClick={onClose}
- className="p-2 rounded-lg hover:bg-background-tertiary text-text-secondary hover:text-text-primary transition-colors"
- >
- <X size={18} />
- </button>
- </div>
+ </DialogHeader>
- {/* Tabs */}
- <div className="flex gap-1 p-2 border-b border-border">
- <button
- onClick={() => setActiveTab("view")}
- className={`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${
- activeTab === "view"
- ? "bg-background-tertiary text-text-primary"
- : "text-text-secondary hover:text-text-primary hover:bg-background-elevated"
- }`}
- >
- View & Export
- </button>
- <button
- onClick={() => setActiveTab("import")}
- className={`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${
- activeTab === "import"
- ? "bg-background-tertiary text-text-primary"
- : "text-text-secondary hover:text-text-primary hover:bg-background-elevated"
- }`}
- >
- Import
- </button>
- </div>
+ <Tabs defaultValue="view" className="flex-1 flex flex-col overflow-hidden">
+ <TabsList className="flex gap-1 p-2 border-b border-border bg-transparent rounded-none justify-start">
+ <TabsTrigger
+ value="view"
+ className="px-4 py-2 rounded-lg text-sm font-medium data-[state=active]:bg-background-tertiary data-[state=active]:text-text-primary text-text-secondary hover:text-text-primary hover:bg-background-elevated"
+ >
+ View & Export
+ </TabsTrigger>
+ <TabsTrigger
+ value="import"
+ className="px-4 py-2 rounded-lg text-sm font-medium data-[state=active]:bg-background-tertiary data-[state=active]:text-text-primary text-text-secondary hover:text-text-primary hover:bg-background-elevated"
+ >
+ Import
+ </TabsTrigger>
+ </TabsList>
- {/* Tab Content */}
- <div className="flex-1 overflow-hidden">
- {activeTab === "view" && (
- <div className="h-full flex flex-col">
- {/* Actions */}
- <div className="flex gap-2 p-3 border-b border-border">
- <button
- onClick={handleCopy}
- className="flex items-center gap-2 px-3 py-2 bg-background-tertiary hover:bg-background-elevated text-text-primary rounded-lg text-sm transition-colors"
- >
- {copySuccess ? (
- <>
- <CheckCircle2 size={16} className="text-primary" />
- Copied!
- </>
- ) : (
- <>
- <Copy size={16} />
- Copy
- </>
- )}
- </button>
- <button
- onClick={handleDownload}
- className="flex items-center gap-2 px-3 py-2 bg-background-tertiary hover:bg-background-elevated text-text-primary rounded-lg text-sm transition-colors"
- >
- <Download size={16} />
- Download
- </button>
- <div className="flex-1" />
- <a
- href="/llm.txt"
- download="openreel-llm-documentation.txt"
- className="flex items-center gap-2 px-3 py-2 bg-primary/10 hover:bg-primary/20 text-primary rounded-lg text-sm transition-colors"
+ <TabsContent value="view" className="flex-1 flex flex-col overflow-hidden mt-0">
+ <div className="flex gap-2 p-3 border-b border-border">
+ <Button variant="outline" size="sm" onClick={handleCopy}>
+ {copySuccess ? (
+ <>
+ <CheckCircle2 size={16} className="text-primary" />
+ Copied!
+ </>
+ ) : (
+ <>
+ <Copy size={16} />
+ Copy
+ </>
+ )}
+ </Button>
+ <Button variant="outline" size="sm" onClick={handleDownload}>
+ <Download size={16} />
+ Download
+ </Button>
+ <div className="flex-1" />
+ <a
+ href="/llm.txt"
+ download="openreel-llm-documentation.txt"
+ className="flex items-center gap-2 px-3 py-2 bg-primary/10 hover:bg-primary/20 text-primary rounded-lg text-sm transition-colors"
+ >
+ <FileCode size={16} />
+ Download LLM.txt
+ </a>
+ </div>
+
+ <div className="flex-1 overflow-auto custom-scrollbar p-4">
+ <div className="rounded-lg overflow-hidden border border-border">
+ <SyntaxHighlighter
+ language="json"
+ style={vs2015}
+ showLineNumbers
+ customStyle={{
+ margin: 0,
+ padding: "1rem",
+ background: "#1e1e1e",
+ fontSize: "12px",
+ }}
>
- <FileCode size={16} />
- Download LLM.txt
- </a>
+ {exportedJson}
+ </SyntaxHighlighter>
</div>
+ </div>
+ </TabsContent>
- {/* JSON Display */}
- <div className="flex-1 overflow-auto custom-scrollbar p-4">
- <div className="rounded-lg overflow-hidden border border-border">
- <SyntaxHighlighter
- language="json"
- style={vs2015}
- showLineNumbers
- customStyle={{
- margin: 0,
- padding: "1rem",
- background: "#1e1e1e",
- fontSize: "12px",
- }}
- >
- {exportedJson}
- </SyntaxHighlighter>
- </div>
- </div>
+ <TabsContent value="import" className="flex-1 flex flex-col gap-4 p-4 overflow-auto mt-0">
+ <div className="flex-1 flex flex-col gap-2">
+ <label className="text-sm font-medium text-text-secondary">
+ Paste JSON
+ </label>
+ <textarea
+ value={importJson}
+ onChange={(e) => setImportJson(e.target.value)}
+ placeholder="Paste project JSON here..."
+ className="flex-1 p-3 bg-background-tertiary border border-border rounded-lg text-text-primary font-mono text-xs resize-none focus:outline-none focus:border-primary"
+ />
</div>
- )}
- {activeTab === "import" && (
- <div className="h-full flex flex-col gap-4 p-4">
- {/* Textarea */}
- <div className="flex-1 flex flex-col gap-2">
- <label className="text-sm font-medium text-text-secondary">
- Paste JSON
- </label>
- <textarea
- value={importJson}
- onChange={(e) => setImportJson(e.target.value)}
- placeholder="Paste project JSON here..."
- className="flex-1 p-3 bg-background-tertiary border border-border rounded-lg text-text-primary font-mono text-xs resize-none focus:outline-none focus:border-primary"
- />
- </div>
+ <Button
+ variant="outline"
+ onClick={handleValidate}
+ disabled={!importJson || isValidating}
+ >
+ {isValidating ? "Validating..." : "Validate"}
+ </Button>
- {/* Validation Button */}
- <button
- onClick={handleValidate}
- disabled={!importJson || isValidating}
- className="px-4 py-2 bg-background-tertiary hover:bg-background-elevated text-text-primary rounded-lg text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
- >
- {isValidating ? "Validating..." : "Validate"}
- </button>
+ {validation && (
+ <div className="space-y-2">
+ {validation.valid && (
+ <div className="flex items-center gap-2 p-3 bg-primary/10 border border-primary/30 rounded-lg">
+ <CheckCircle2 size={16} className="text-primary" />
+ <span className="text-sm text-primary">
+ Valid JSON - Ready to import
+ </span>
+ </div>
+ )}
- {/* Validation Results */}
- {validation && (
- <div className="space-y-2">
- {validation.valid && (
- <div className="flex items-center gap-2 p-3 bg-primary/10 border border-primary/30 rounded-lg">
- <CheckCircle2 size={16} className="text-primary" />
- <span className="text-sm text-primary">
- Valid JSON - Ready to import
- </span>
+ {validation.errors.length > 0 && (
+ <div className="p-3 bg-error/10 border border-error/30 rounded-lg space-y-1">
+ <div className="flex items-center gap-2 text-error font-medium text-sm">
+ <AlertCircle size={16} />
+ Errors
</div>
- )}
+ <ul className="list-disc list-inside text-xs text-error/80 space-y-0.5">
+ {validation.errors.map((err, i) => (
+ <li key={i}>{err}</li>
+ ))}
+ </ul>
+ </div>
+ )}
- {validation.errors.length > 0 && (
- <div className="p-3 bg-error/10 border border-error/30 rounded-lg space-y-1">
- <div className="flex items-center gap-2 text-error font-medium text-sm">
- <AlertCircle size={16} />
- Errors
- </div>
- <ul className="list-disc list-inside text-xs text-error/80 space-y-0.5">
- {validation.errors.map((error, i) => (
- <li key={i}>{error}</li>
- ))}
- </ul>
+ {validation.warnings.length > 0 && (
+ <div className="p-3 bg-warning/10 border border-warning/30 rounded-lg space-y-1">
+ <div className="flex items-center gap-2 text-warning font-medium text-sm">
+ <AlertTriangle size={16} />
+ Warnings
</div>
- )}
+ <ul className="list-disc list-inside text-xs text-warning/80 space-y-0.5">
+ {validation.warnings.map((warning, i) => (
+ <li key={i}>{warning}</li>
+ ))}
+ </ul>
+ </div>
+ )}
- {validation.warnings.length > 0 && (
- <div className="p-3 bg-warning/10 border border-warning/30 rounded-lg space-y-1">
- <div className="flex items-center gap-2 text-warning font-medium text-sm">
- <AlertTriangle size={16} />
- Warnings
+ {validation.missingAssets &&
+ validation.missingAssets.length > 0 && (
+ <div className="p-3 bg-background-tertiary border border-border rounded-lg space-y-1">
+ <div className="text-sm font-medium text-text-secondary">
+ Missing Assets ({validation.missingAssets.length})
</div>
- <ul className="list-disc list-inside text-xs text-warning/80 space-y-0.5">
- {validation.warnings.map((warning, i) => (
- <li key={i}>{warning}</li>
- ))}
- </ul>
+ <p className="text-xs text-text-muted">
+ These assets will be imported as placeholders and can
+ be replaced later.
+ </p>
</div>
)}
+ </div>
+ )}
- {validation.missingAssets &&
- validation.missingAssets.length > 0 && (
- <div className="p-3 bg-background-tertiary border border-border rounded-lg space-y-1">
- <div className="text-sm font-medium text-text-secondary">
- Missing Assets ({validation.missingAssets.length})
- </div>
- <p className="text-xs text-text-muted">
- These assets will be imported as placeholders and can
- be replaced later.
- </p>
- </div>
- )}
- </div>
- )}
-
- {/* Import Button */}
- <button
- onClick={handleImport}
- disabled={!validation?.valid}
- className="px-4 py-2 bg-primary hover:bg-primary-hover text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
- >
- <Upload size={16} className="inline mr-2" />
- Import Project
- </button>
- </div>
- )}
- </div>
- </div>
- </div>
+ <Button onClick={handleImport} disabled={!validation?.valid}>
+ <Upload size={16} />
+ Import Project
+ </Button>
+ </TabsContent>
+ </Tabs>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/SearchModal.tsx b/apps/web/src/components/editor/SearchModal.tsx
index a8e437a2..4f73e990 100644
--- a/apps/web/src/components/editor/SearchModal.tsx
+++ b/apps/web/src/components/editor/SearchModal.tsx
@@ -23,6 +23,7 @@ import {
Sliders,
Sparkles,
} from "lucide-react";
+import { Dialog, DialogContent, Input } from "@openreel/ui";
import { useUIStore } from "../../stores/ui-store";
interface SearchItem {
@@ -414,19 +415,11 @@ export const SearchModal: React.FC<SearchModalProps> = ({
if (!isOpen) return null;
return (
- <div
- className="fixed inset-0 z-[100] flex items-start justify-center pt-[15vh]"
- onClick={onClose}
- >
- <div className="fixed inset-0 bg-black/60 backdrop-blur-sm" />
-
- <div
- className="relative w-full max-w-2xl bg-background-secondary border border-border rounded-2xl shadow-2xl overflow-hidden animate-in fade-in slide-in-from-top-4 duration-200"
- onClick={(e) => e.stopPropagation()}
- >
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-2xl p-0 gap-0 top-[15vh] translate-y-0 bg-background-secondary border-border rounded-2xl overflow-hidden">
<div className="flex items-center gap-3 px-4 py-3 border-b border-border">
<Search size={18} className="text-text-muted" />
- <input
+ <Input
ref={inputRef}
type="text"
value={query}
@@ -436,7 +429,7 @@ export const SearchModal: React.FC<SearchModalProps> = ({
? `Search effects for ${selectedClipType} clip...`
: "Search all effects and tools..."
}
- className="flex-1 bg-transparent text-text-primary placeholder:text-text-muted text-sm outline-none"
+ className="flex-1 bg-transparent border-0 text-text-primary focus-visible:ring-0"
/>
{query && (
<button
@@ -542,8 +535,8 @@ export const SearchModal: React.FC<SearchModalProps> = ({
<span>ESC Close</span>
</div>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/ShareDialog.tsx b/apps/web/src/components/editor/ShareDialog.tsx
index 66224e03..33ea9148 100644
--- a/apps/web/src/components/editor/ShareDialog.tsx
+++ b/apps/web/src/components/editor/ShareDialog.tsx
@@ -1,6 +1,5 @@
-import React, { useState, useCallback } from "react";
+import { useState, useCallback } from "react";
import {
- X,
Upload,
Link,
Check,
@@ -11,6 +10,14 @@ import {
AlertCircle,
Loader2,
} from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ Button,
+ Input,
+} from "@openreel/ui";
import {
uploadForSharing,
getSharePageUrl,
@@ -101,20 +108,16 @@ export const ShareDialog: React.FC<ShareDialogProps> = ({
if (!isOpen) return null;
return (
- <div className="fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm">
- <div className="w-full max-w-md bg-background-secondary rounded-xl border border-border shadow-2xl overflow-hidden">
- <div className="flex items-center justify-between p-4 border-b border-border bg-background-tertiary">
+ <Dialog open onOpenChange={(open) => !open && handleClose()}>
+ <DialogContent className="max-w-md p-0 gap-0 bg-background-secondary border-border overflow-hidden">
+ <DialogHeader className="p-4 border-b border-border bg-background-tertiary space-y-0">
<div className="flex items-center gap-3">
<Upload size={20} className="text-primary" />
- <h2 className="text-lg font-bold text-text-primary">Share Video</h2>
+ <DialogTitle className="text-lg font-bold text-text-primary">
+ Share Video
+ </DialogTitle>
</div>
- <button
- onClick={handleClose}
- className="p-2 text-text-muted hover:text-text-primary rounded-lg hover:bg-background-secondary transition-colors"
- >
- <X size={20} />
- </button>
- </div>
+ </DialogHeader>
<div className="p-6 space-y-6">
{status === "idle" && (
@@ -146,13 +149,13 @@ export const ShareDialog: React.FC<ShareDialogProps> = ({
</div>
</div>
- <button
+ <Button
onClick={handleUpload}
disabled={!videoBlob}
- className="w-full py-3 bg-primary hover:bg-primary-hover text-white font-bold rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+ className="w-full"
>
Generate Share Link
- </button>
+ </Button>
</>
)}
@@ -191,11 +194,11 @@ export const ShareDialog: React.FC<ShareDialogProps> = ({
<div className="p-3 bg-background-tertiary rounded-lg">
<div className="flex items-center gap-2">
- <input
+ <Input
type="text"
value={shareUrl}
readOnly
- className="flex-1 bg-transparent text-sm text-text-primary outline-none truncate"
+ className="flex-1 bg-transparent border-0 text-text-primary focus-visible:ring-0 truncate"
/>
<button
onClick={handleCopy}
@@ -244,27 +247,21 @@ export const ShareDialog: React.FC<ShareDialogProps> = ({
<p className="text-xs text-text-muted">{error}</p>
</div>
- <button
- onClick={handleUpload}
- className="w-full py-3 bg-primary hover:bg-primary-hover text-white font-bold rounded-lg transition-colors"
- >
+ <Button onClick={handleUpload} className="w-full">
Try Again
- </button>
+ </Button>
</div>
)}
</div>
{status === "success" && (
<div className="px-6 py-4 border-t border-border bg-background-tertiary">
- <button
- onClick={handleClose}
- className="w-full py-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
- >
+ <Button variant="ghost" onClick={handleClose} className="w-full">
Done
- </button>
+ </Button>
</div>
)}
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/Timeline.tsx b/apps/web/src/components/editor/Timeline.tsx
index fde081fa..97dfbf49 100644
--- a/apps/web/src/components/editor/Timeline.tsx
+++ b/apps/web/src/components/editor/Timeline.tsx
@@ -26,8 +26,8 @@ import { useTimelineStore } from "../../stores/timeline-store";
import { useUIStore } from "../../stores/ui-store";
import { useEngineStore } from "../../stores/engine-store";
import { getPlaybackBridge } from "../../bridges/playback-bridge";
+import { IconButton } from "@openreel/ui";
import {
- IconButton,
Playhead,
TimeRuler,
TrackHeader,
diff --git a/apps/web/src/components/editor/Toolbar.tsx b/apps/web/src/components/editor/Toolbar.tsx
index 8d73c752..43b076e5 100644
--- a/apps/web/src/components/editor/Toolbar.tsx
+++ b/apps/web/src/components/editor/Toolbar.tsx
@@ -1,4 +1,4 @@
-import React, { useCallback, useState, useRef, useEffect } from "react";
+import React, { useCallback, useState, useEffect } from "react";
import {
Search,
Command,
@@ -37,6 +37,16 @@ import { ScreenRecorder } from "./ScreenRecorder";
import { HistoryPanel } from "./inspector/HistoryPanel";
import { ProjectSwitcher } from "./ProjectSwitcher";
import { toast } from "../../stores/notification-store";
+import {
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ Tooltip,
+ TooltipTrigger,
+ TooltipContent,
+} from "@openreel/ui";
type ExportType =
| "mp4"
@@ -132,8 +142,6 @@ export const Toolbar: React.FC = () => {
setExportEstimates(estimates);
}, [deviceProfile, project.timeline?.duration, project.settings.width, project.settings.height]);
- const exportMenuRef = useRef<HTMLDivElement>(null);
-
const handleSearch = useCallback(() => {
openModal("search");
}, [openModal]);
@@ -568,19 +576,6 @@ export const Toolbar: React.FC = () => {
[project],
);
- useEffect(() => {
- const handleClickOutside = (event: MouseEvent) => {
- if (
- exportMenuRef.current &&
- !exportMenuRef.current.contains(event.target as Node)
- ) {
- setIsExportOpen(false);
- }
- };
-
- document.addEventListener("mousedown", handleClickOutside);
- return () => document.removeEventListener("mousedown", handleClickOutside);
- }, []);
const handleRecordingComplete = useCallback(
async (screenBlob: Blob, webcamBlob?: Blob) => {
@@ -839,50 +834,74 @@ export const Toolbar: React.FC = () => {
</div>
<div className="flex items-center gap-4">
- <button
- onClick={toggleTheme}
- className="p-2 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors"
- title={`Theme: ${themeMode}`}
- >
- {themeMode === "light" ? (
- <Sun size={16} />
- ) : themeMode === "dark" ? (
- <Moon size={16} />
- ) : (
- <SunMoon size={16} />
- )}
- </button>
-
- <button
- onClick={() => useUIStore.getState().openModal("scriptView")}
- className="p-2 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors"
- title="Script View - View/Import JSON"
- >
- <FileCode size={16} />
- </button>
-
- <button
- onClick={() => setIsHistoryOpen(!isHistoryOpen)}
- className={`p-2 rounded-lg transition-colors ${
- isHistoryOpen
- ? "bg-primary/20 text-primary"
- : "hover:bg-background-elevated text-text-secondary hover:text-text-primary"
- }`}
- title="History - Undo/Redo actions"
- >
- <History size={16} />
- </button>
-
- <button
- onClick={() => setIsRecorderOpen(true)}
- className="flex items-center gap-2 px-3 py-2 bg-error/10 hover:bg-error/20 text-error rounded-lg transition-colors"
- title="Screen Recording"
- >
- <Circle size={14} className="fill-current" />
- <span className="text-sm font-medium">Record</span>
- </button>
-
- <div className="relative" ref={exportMenuRef}>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ onClick={toggleTheme}
+ className="p-2 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors"
+ >
+ {themeMode === "light" ? (
+ <Sun size={16} />
+ ) : themeMode === "dark" ? (
+ <Moon size={16} />
+ ) : (
+ <SunMoon size={16} />
+ )}
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Theme: {themeMode}</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ onClick={() => useUIStore.getState().openModal("scriptView")}
+ className="p-2 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors"
+ >
+ <FileCode size={16} />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Script View - View/Import JSON</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ onClick={() => setIsHistoryOpen(!isHistoryOpen)}
+ className={`p-2 rounded-lg transition-colors ${
+ isHistoryOpen
+ ? "bg-primary/20 text-primary"
+ : "hover:bg-background-elevated text-text-secondary hover:text-text-primary"
+ }`}
+ >
+ <History size={16} />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>History - Undo/Redo</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ onClick={() => setIsRecorderOpen(true)}
+ className="flex items-center gap-2 px-3 py-2 bg-error/10 hover:bg-error/20 text-error rounded-lg transition-colors"
+ >
+ <Circle size={14} className="fill-current" />
+ <span className="text-sm font-medium">Record</span>
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Screen Recording</p>
+ </TooltipContent>
+ </Tooltip>
+
+ <div className="relative">
{exportState.isExporting ? (
<div className="h-10 px-4 bg-background-secondary border border-border rounded-lg flex items-center gap-3 min-w-[200px]">
<Loader2 size={14} className="text-primary animate-spin" />
@@ -922,111 +941,102 @@ export const Toolbar: React.FC = () => {
<span className="text-xs text-primary">Downloaded!</span>
</div>
) : (
- <>
- <button
- onClick={() => setIsExportOpen(!isExportOpen)}
- className={`h-10 px-4 bg-primary hover:bg-primary-hover active:bg-primary-active text-white font-bold rounded-lg flex items-center gap-2 transition-all shadow-[0_0_20px_rgba(34,197,94,0.3)] hover:shadow-[0_0_30px_rgba(34,197,94,0.5)] transform hover:-translate-y-0.5 ${
- isExportOpen ? "translate-y-0 shadow-none" : ""
- }`}
- >
- <span className="text-sm tracking-wider">EXPORT</span>
- <ChevronDown
- size={14}
- className={`transition-transform duration-200 ${
- isExportOpen ? "rotate-180" : ""
+ <DropdownMenu open={isExportOpen} onOpenChange={setIsExportOpen}>
+ <DropdownMenuTrigger asChild>
+ <button
+ className={`h-10 px-4 bg-primary hover:bg-primary-hover active:bg-primary-active text-white font-bold rounded-lg flex items-center gap-2 transition-all shadow-[0_0_20px_rgba(34,197,94,0.3)] hover:shadow-[0_0_30px_rgba(34,197,94,0.5)] transform hover:-translate-y-0.5 ${
+ isExportOpen ? "translate-y-0 shadow-none" : ""
}`}
- />
- </button>
-
- {isExportOpen && (
- <div className="absolute top-full right-0 mt-2 w-72 bg-background-secondary border border-border rounded-xl shadow-2xl overflow-hidden z-50">
- <div className="p-3 space-y-1 max-h-[400px] overflow-y-auto">
- {exportOptions.map((option, index) =>
- option.separator ? (
+ >
+ <span className="text-sm tracking-wider">EXPORT</span>
+ <ChevronDown
+ size={14}
+ className={`transition-transform duration-200 ${
+ isExportOpen ? "rotate-180" : ""
+ }`}
+ />
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-72 p-0 rounded-xl bg-background-secondary border-border">
+ <div className="p-3 space-y-1 max-h-[400px] overflow-y-auto">
+ {exportOptions.map((option, index) =>
+ option.separator ? (
+ <DropdownMenuSeparator key={`sep-${index}`} />
+ ) : (
+ <DropdownMenuItem
+ key={option.type + index}
+ className={`flex items-center gap-3 p-3 rounded-lg cursor-pointer ${
+ option.recommended
+ ? "bg-primary/10 hover:bg-primary/20 border border-primary/30"
+ : ""
+ }`}
+ onClick={() => handleExport(option.type)}
+ >
<div
- key={`sep-${index}`}
- className="border-t border-border my-2"
- />
- ) : (
- <button
- key={option.type + index}
- className={`w-full flex items-center gap-3 p-3 rounded-lg transition-colors text-left group ${
+ className={`p-2 rounded-lg transition-colors ${
option.recommended
- ? "bg-primary/10 hover:bg-primary/20 border border-primary/30"
- : "hover:bg-background-tertiary"
+ ? "bg-primary/20 text-primary"
+ : "bg-background-tertiary group-hover:bg-background-elevated text-text-secondary group-hover:text-primary"
}`}
- onClick={() => handleExport(option.type)}
>
+ <option.icon size={18} />
+ </div>
+ <div className="flex-1">
<div
- className={`p-2 rounded-lg transition-colors ${
+ className={`text-sm font-medium transition-colors ${
option.recommended
- ? "bg-primary/20 text-primary"
- : "bg-background-tertiary group-hover:bg-background-elevated text-text-secondary group-hover:text-primary"
+ ? "text-primary"
+ : "text-text-primary"
}`}
>
- <option.icon size={18} />
- </div>
- <div className="flex-1">
- <div
- className={`text-sm font-medium transition-colors ${
- option.recommended
- ? "text-primary"
- : "text-text-primary group-hover:text-primary"
- }`}
- >
- {option.label}
- {option.recommended && (
- <span className="ml-2 text-[10px] bg-primary/20 text-primary px-1.5 py-0.5 rounded">
- Best Match
- </span>
- )}
- </div>
- <div className="text-xs text-text-muted mt-0.5">
- {option.desc}
- </div>
- {exportEstimates.get(option.type) && (
- <div className="text-[10px] text-text-secondary mt-1">
- Est. {exportEstimates.get(option.type)?.formatted}
- </div>
+ {option.label}
+ {option.recommended && (
+ <span className="ml-2 text-[10px] bg-primary/20 text-primary px-1.5 py-0.5 rounded">
+ Best Match
+ </span>
)}
</div>
- </button>
- ),
- )}
-
- <div className="border-t border-border pt-2 mt-2">
- <button
- className="w-full flex items-center gap-3 p-3 hover:bg-primary/10 rounded-lg transition-colors text-left group"
- onClick={() => {
- setIsExportOpen(false);
- setIsExportDialogOpen(true);
- }}
- >
- <div className="p-2 bg-primary/10 group-hover:bg-primary/20 rounded-lg text-primary transition-colors">
- <Sparkles size={18} />
- </div>
- <div className="flex-1">
- <div className="text-sm font-medium text-primary transition-colors">
- Custom Export...
- </div>
<div className="text-xs text-text-muted mt-0.5">
- Full settings with AI upscaling
+ {option.desc}
</div>
+ {exportEstimates.get(option.type) && (
+ <div className="text-[10px] text-text-secondary mt-1">
+ Est. {exportEstimates.get(option.type)?.formatted}
+ </div>
+ )}
</div>
- <Settings
- size={14}
- className="text-text-muted group-hover:text-primary transition-colors"
- />
- </button>
+ </DropdownMenuItem>
+ ),
+ )}
+
+ <DropdownMenuSeparator />
+ <DropdownMenuItem
+ className="flex items-center gap-3 p-3 rounded-lg cursor-pointer"
+ onClick={() => setIsExportDialogOpen(true)}
+ >
+ <div className="p-2 bg-primary/10 rounded-lg text-primary transition-colors">
+ <Sparkles size={18} />
</div>
- </div>
- <div className="bg-background-tertiary px-3 py-2.5 text-xs text-center text-text-muted border-t border-border">
- {project.settings.width}×{project.settings.height} •{" "}
- {project.settings.frameRate}fps
- </div>
+ <div className="flex-1">
+ <div className="text-sm font-medium text-primary transition-colors">
+ Custom Export...
+ </div>
+ <div className="text-xs text-text-muted mt-0.5">
+ Full settings with AI upscaling
+ </div>
+ </div>
+ <Settings
+ size={14}
+ className="text-text-muted"
+ />
+ </DropdownMenuItem>
</div>
- )}
- </>
+ <div className="bg-background-tertiary px-3 py-2.5 text-xs text-center text-text-muted border-t border-border">
+ {project.settings.width}×{project.settings.height} •{" "}
+ {project.settings.frameRate}fps
+ </div>
+ </DropdownMenuContent>
+ </DropdownMenu>
)}
</div>
</div>
diff --git a/apps/web/src/components/editor/dialogs/AspectRatioMatchDialog.tsx b/apps/web/src/components/editor/dialogs/AspectRatioMatchDialog.tsx
index df5cd263..d28f30ae 100644
--- a/apps/web/src/components/editor/dialogs/AspectRatioMatchDialog.tsx
+++ b/apps/web/src/components/editor/dialogs/AspectRatioMatchDialog.tsx
@@ -1,7 +1,16 @@
import React from "react";
-import { Maximize2, X } from "lucide-react";
+import { Maximize2 } from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ Button,
+} from "@openreel/ui";
interface AspectRatioMatchDialogProps {
+ isOpen: boolean;
videoWidth: number;
videoHeight: number;
currentWidth: number;
@@ -11,6 +20,7 @@ interface AspectRatioMatchDialogProps {
}
export const AspectRatioMatchDialog: React.FC<AspectRatioMatchDialogProps> = ({
+ isOpen,
videoWidth,
videoHeight,
currentWidth,
@@ -22,31 +32,23 @@ export const AspectRatioMatchDialog: React.FC<AspectRatioMatchDialogProps> = ({
const currentAspect = (currentWidth / currentHeight).toFixed(2);
return (
- <div className="fixed inset-0 z-[10000] flex items-center justify-center bg-black/50 backdrop-blur-sm">
- <div className="bg-background-secondary border border-border rounded-xl shadow-2xl max-w-md w-full mx-4 overflow-hidden">
- <div className="flex items-center justify-between p-4 border-b border-border">
+ <Dialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
+ <DialogContent className="max-w-md">
+ <DialogHeader>
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
<Maximize2 size={20} className="text-primary" />
</div>
- <h2 className="text-lg font-semibold text-text-primary">
- Match Video Dimensions?
- </h2>
+ <div>
+ <DialogTitle>Match Video Dimensions?</DialogTitle>
+ <DialogDescription className="mt-1">
+ The video you're adding has different dimensions than your current project settings.
+ </DialogDescription>
+ </div>
</div>
- <button
- onClick={onCancel}
- className="p-1 rounded-lg hover:bg-background-tertiary text-text-secondary hover:text-text-primary transition-colors"
- >
- <X size={18} />
- </button>
- </div>
-
- <div className="p-6 space-y-4">
- <p className="text-sm text-text-secondary">
- The video you're adding has different dimensions than your current
- project settings.
- </p>
+ </DialogHeader>
+ <div className="space-y-4 py-4">
<div className="space-y-3">
<div className="flex items-center justify-between p-3 rounded-lg bg-background-tertiary">
<div>
@@ -83,21 +85,15 @@ export const AspectRatioMatchDialog: React.FC<AspectRatioMatchDialogProps> = ({
</p>
</div>
- <div className="flex gap-3 p-4 border-t border-border bg-background-tertiary/30">
- <button
- onClick={onCancel}
- className="flex-1 px-4 py-2.5 rounded-lg bg-background-secondary border border-border hover:bg-background-tertiary text-text-secondary hover:text-text-primary transition-colors text-sm font-medium"
- >
+ <div className="flex gap-3">
+ <Button variant="outline" className="flex-1" onClick={onCancel}>
Keep Current
- </button>
- <button
- onClick={onConfirm}
- className="flex-1 px-4 py-2.5 rounded-lg bg-primary hover:bg-primary-hover text-white transition-colors text-sm font-medium shadow-lg shadow-primary/20"
- >
+ </Button>
+ <Button className="flex-1" onClick={onConfirm}>
Match Video
- </button>
+ </Button>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/editor/inspector/AdjustmentLayerSection.tsx b/apps/web/src/components/editor/inspector/AdjustmentLayerSection.tsx
index 2926415c..e204fa4f 100644
--- a/apps/web/src/components/editor/inspector/AdjustmentLayerSection.tsx
+++ b/apps/web/src/components/editor/inspector/AdjustmentLayerSection.tsx
@@ -11,6 +11,7 @@ import {
Droplet,
Copy,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useEngineStore } from "../../../stores/engine-store";
import { useProjectStore } from "../../../stores/project-store";
import type { AdjustmentLayer, BlendMode, Effect } from "@openreel/core";
@@ -306,15 +307,14 @@ export const AdjustmentLayerSection: React.FC<AdjustmentLayerSectionProps> = ({
{Math.round(layer.opacity * 100)}%
</span>
</div>
- <input
- type="range"
- min="0"
- max="100"
- value={layer.opacity * 100}
- onChange={(e) =>
- handleOpacityChange(layer.id, parseInt(e.target.value) / 100)
+ <Slider
+ min={0}
+ max={100}
+ step={1}
+ value={[layer.opacity * 100]}
+ onValueChange={(value) =>
+ handleOpacityChange(layer.id, value[0] / 100)
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-indigo-500"
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/AudioDuckingSection.tsx b/apps/web/src/components/editor/inspector/AudioDuckingSection.tsx
index e8c64265..5daee7fa 100644
--- a/apps/web/src/components/editor/inspector/AudioDuckingSection.tsx
+++ b/apps/web/src/components/editor/inspector/AudioDuckingSection.tsx
@@ -9,6 +9,7 @@ import {
Check,
RefreshCw,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import type { Track } from "@openreel/core";
@@ -243,16 +244,14 @@ export const AudioDuckingSection: React.FC<AudioDuckingSectionProps> = ({
{settings.threshold} dB
</span>
</div>
- <input
- type="range"
- min="-50"
- max="-10"
- step="1"
- value={settings.threshold}
- onChange={(e) =>
- updateSetting("threshold", parseInt(e.target.value))
+ <Slider
+ min={-50}
+ max={-10}
+ step={1}
+ value={[settings.threshold]}
+ onValueChange={(value) =>
+ updateSetting("threshold", value[0])
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-orange-500"
/>
<p className="text-[8px] text-text-muted">
Voice level that triggers ducking
@@ -268,16 +267,14 @@ export const AudioDuckingSection: React.FC<AudioDuckingSectionProps> = ({
{Math.round(settings.reduction * 100)}%
</span>
</div>
- <input
- type="range"
- min="0"
- max="100"
- step="5"
- value={settings.reduction * 100}
- onChange={(e) =>
- updateSetting("reduction", parseInt(e.target.value) / 100)
+ <Slider
+ min={0}
+ max={100}
+ step={5}
+ value={[settings.reduction * 100]}
+ onValueChange={(value) =>
+ updateSetting("reduction", value[0] / 100)
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-orange-500"
/>
<p className="text-[8px] text-text-muted">
How much to lower background music
@@ -308,16 +305,14 @@ export const AudioDuckingSection: React.FC<AudioDuckingSectionProps> = ({
{settings.attack.toFixed(2)}s
</span>
</div>
- <input
- type="range"
- min="0.01"
- max="0.5"
- step="0.01"
- value={settings.attack}
- onChange={(e) =>
- updateSetting("attack", parseFloat(e.target.value))
+ <Slider
+ min={0.01}
+ max={0.5}
+ step={0.01}
+ value={[settings.attack]}
+ onValueChange={(value) =>
+ updateSetting("attack", value[0])
}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-orange-500"
/>
<p className="text-[8px] text-text-muted">
How fast volume drops when voice starts
@@ -333,16 +328,14 @@ export const AudioDuckingSection: React.FC<AudioDuckingSectionProps> = ({
{settings.release.toFixed(2)}s
</span>
</div>
- <input
- type="range"
- min="0.1"
- max="1"
- step="0.05"
- value={settings.release}
- onChange={(e) =>
- updateSetting("release", parseFloat(e.target.value))
+ <Slider
+ min={0.1}
+ max={1}
+ step={0.05}
+ value={[settings.release]}
+ onValueChange={(value) =>
+ updateSetting("release", value[0])
}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-orange-500"
/>
<p className="text-[8px] text-text-muted">
How fast volume returns after voice stops
@@ -358,16 +351,14 @@ export const AudioDuckingSection: React.FC<AudioDuckingSectionProps> = ({
{settings.holdTime.toFixed(2)}s
</span>
</div>
- <input
- type="range"
- min="0"
- max="0.5"
- step="0.05"
- value={settings.holdTime}
- onChange={(e) =>
- updateSetting("holdTime", parseFloat(e.target.value))
+ <Slider
+ min={0}
+ max={0.5}
+ step={0.05}
+ value={[settings.holdTime]}
+ onValueChange={(value) =>
+ updateSetting("holdTime", value[0])
}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-orange-500"
/>
<p className="text-[8px] text-text-muted">
Minimum time to stay ducked between words
diff --git a/apps/web/src/components/editor/inspector/AudioEffectsSection.tsx b/apps/web/src/components/editor/inspector/AudioEffectsSection.tsx
index 7928cfe7..3cacaff0 100644
--- a/apps/web/src/components/editor/inspector/AudioEffectsSection.tsx
+++ b/apps/web/src/components/editor/inspector/AudioEffectsSection.tsx
@@ -10,6 +10,7 @@ import {
DEFAULT_EQ_BANDS,
} from "../../../bridges/audio-bridge-effects";
import { useProjectStore } from "../../../stores/project-store";
+import { LabeledSlider as Slider } from "@openreel/ui";
const SubSection: React.FC<{
title: string;
@@ -63,49 +64,6 @@ const SubSection: React.FC<{
);
};
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
-
const EQBand: React.FC<{
frequency: string;
gain: number;
diff --git a/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx b/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
index 8ed261c0..dd492974 100644
--- a/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
+++ b/apps/web/src/components/editor/inspector/AutoCaptionPanel.tsx
@@ -7,6 +7,13 @@ import type {
TranscriptionProgress,
TranscriptionSegment,
} from "@openreel/core";
+import {
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
const CAPTION_STYLE_PRESETS = [
{
@@ -151,34 +158,42 @@ export const AutoCaptionPanel: React.FC = () => {
<Languages size={14} className="text-text-secondary" />
<span className="text-[10px] text-text-secondary">Language</span>
</div>
- <select
+ <Select
value={selectedLanguage}
- onChange={(e) => setSelectedLanguage(e.target.value)}
+ onValueChange={setSelectedLanguage}
disabled={isTranscribing}
- className="px-2 py-1 text-[10px] text-text-primary bg-background-secondary border border-border rounded outline-none focus:border-primary cursor-pointer disabled:opacity-50"
>
- {languages.map((lang) => (
- <option key={lang.code} value={lang.code}>
- {lang.name}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-auto min-w-[100px] bg-background-secondary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {languages.map((lang) => (
+ <SelectItem key={lang.code} value={lang.code}>
+ {lang.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">Caption Style</span>
- <select
+ <Select
value={selectedStyle}
- onChange={(e) => setSelectedStyle(e.target.value)}
+ onValueChange={setSelectedStyle}
disabled={isTranscribing}
- className="px-2 py-1 text-[10px] text-text-primary bg-background-secondary border border-border rounded outline-none focus:border-primary cursor-pointer disabled:opacity-50"
>
- {CAPTION_STYLE_PRESETS.map((preset) => (
- <option key={preset.id} value={preset.id}>
- {preset.name}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-auto min-w-[100px] bg-background-secondary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {CAPTION_STYLE_PRESETS.map((preset) => (
+ <SelectItem key={preset.id} value={preset.id}>
+ {preset.name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
diff --git a/apps/web/src/components/editor/inspector/AutoReframeSection.tsx b/apps/web/src/components/editor/inspector/AutoReframeSection.tsx
index 9cdd12ba..ecfa6cc0 100644
--- a/apps/web/src/components/editor/inspector/AutoReframeSection.tsx
+++ b/apps/web/src/components/editor/inspector/AutoReframeSection.tsx
@@ -8,6 +8,7 @@ import {
Play,
CheckCircle,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import {
getAutoReframeEngine,
initializeAutoReframeEngine,
@@ -271,17 +272,16 @@ export const AutoReframeSection: React.FC<AutoReframeSectionProps> = ({
{Math.round(reframeSettings.trackingSpeed * 100)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={100}
- value={reframeSettings.trackingSpeed * 100}
- onChange={(e) =>
+ step={1}
+ value={[reframeSettings.trackingSpeed * 100]}
+ onValueChange={(value) =>
updateLocalSettings({
- trackingSpeed: parseInt(e.target.value) / 100,
+ trackingSpeed: value[0] / 100,
})
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-blue-500"
/>
</div>
@@ -292,15 +292,14 @@ export const AutoReframeSection: React.FC<AutoReframeSectionProps> = ({
{Math.round(reframeSettings.smoothing * 100)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={100}
- value={reframeSettings.smoothing * 100}
- onChange={(e) =>
- updateLocalSettings({ smoothing: parseInt(e.target.value) / 100 })
+ step={1}
+ value={[reframeSettings.smoothing * 100]}
+ onValueChange={(value) =>
+ updateLocalSettings({ smoothing: value[0] / 100 })
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-blue-500"
/>
</div>
@@ -313,17 +312,16 @@ export const AutoReframeSection: React.FC<AutoReframeSectionProps> = ({
{Math.round(reframeSettings.centerBias * 100)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={100}
- value={reframeSettings.centerBias * 100}
- onChange={(e) =>
+ step={1}
+ value={[reframeSettings.centerBias * 100]}
+ onValueChange={(value) =>
updateLocalSettings({
- centerBias: parseInt(e.target.value) / 100,
+ centerBias: value[0] / 100,
})
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-blue-500"
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/BackgroundRemovalSection.tsx b/apps/web/src/components/editor/inspector/BackgroundRemovalSection.tsx
index f16f0234..8b6a9d09 100644
--- a/apps/web/src/components/editor/inspector/BackgroundRemovalSection.tsx
+++ b/apps/web/src/components/editor/inspector/BackgroundRemovalSection.tsx
@@ -7,6 +7,7 @@ import {
Loader2,
Info,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import {
getBackgroundRemovalEngine,
initializeBackgroundRemovalEngine,
@@ -216,15 +217,14 @@ export const BackgroundRemovalSection: React.FC<
{settings.blurAmount}px
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={50}
- value={settings.blurAmount}
- onChange={(e) =>
- updateSettings({ blurAmount: parseInt(e.target.value) })
+ step={1}
+ value={[settings.blurAmount]}
+ onValueChange={(value) =>
+ updateSettings({ blurAmount: value[0] })
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-purple-500"
/>
</div>
)}
@@ -304,15 +304,14 @@ export const BackgroundRemovalSection: React.FC<
{settings.edgeBlur}
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={10}
- value={settings.edgeBlur}
- onChange={(e) =>
- updateSettings({ edgeBlur: parseInt(e.target.value) })
+ step={1}
+ value={[settings.edgeBlur]}
+ onValueChange={(value) =>
+ updateSettings({ edgeBlur: value[0] })
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-purple-500"
/>
</div>
@@ -325,15 +324,14 @@ export const BackgroundRemovalSection: React.FC<
{Math.round(settings.threshold * 100)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={100}
- value={settings.threshold * 100}
- onChange={(e) =>
- updateSettings({ threshold: parseInt(e.target.value) / 100 })
+ step={1}
+ value={[settings.threshold * 100]}
+ onValueChange={(value) =>
+ updateSettings({ threshold: value[0] / 100 })
}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-purple-500"
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/BlendingSection.tsx b/apps/web/src/components/editor/inspector/BlendingSection.tsx
index cabfb3af..052db4a7 100644
--- a/apps/web/src/components/editor/inspector/BlendingSection.tsx
+++ b/apps/web/src/components/editor/inspector/BlendingSection.tsx
@@ -5,49 +5,14 @@ import {
getBlendModeName,
type BlendMode,
} from "@openreel/core";
-
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "%" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
+import {
+ LabeledSlider as Slider,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
interface BlendingSectionProps {
clipId: string;
@@ -118,17 +83,21 @@ export const BlendingSection: React.FC<BlendingSectionProps> = ({ clipId }) => {
<div className="space-y-3">
<div className="space-y-1">
<span className="text-[10px] text-text-secondary">Blend Mode</span>
- <select
+ <Select
value={blendMode}
- onChange={(e) => handleBlendModeChange(e.target.value as BlendMode)}
- className="w-full px-3 py-2 text-sm text-text-primary bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary cursor-pointer"
+ onValueChange={(v) => handleBlendModeChange(v as BlendMode)}
>
- {availableBlendModes.map((mode) => (
- <option key={mode} value={mode}>
- {getBlendModeName(mode)}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {availableBlendModes.map((mode) => (
+ <SelectItem key={mode} value={mode}>
+ {getBlendModeName(mode)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<p className="text-[9px] text-text-muted">
{blendMode === "normal" && "Default blending, no special effect"}
{blendMode === "multiply" && "Darkens by multiplying colors"}
diff --git a/apps/web/src/components/editor/inspector/ClipTransitionSection.tsx b/apps/web/src/components/editor/inspector/ClipTransitionSection.tsx
index 6f4eb1e8..52c56cee 100644
--- a/apps/web/src/components/editor/inspector/ClipTransitionSection.tsx
+++ b/apps/web/src/components/editor/inspector/ClipTransitionSection.tsx
@@ -23,6 +23,13 @@ import type {
import { useProjectStore } from "../../../stores/project-store";
import { useEngineStore } from "../../../stores/engine-store";
import { toast } from "../../../stores/notification-store";
+import {
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
type MutableGraphicClip = {
-readonly [K in keyof GraphicClip]: GraphicClip[K];
@@ -1081,17 +1088,18 @@ export const ClipTransitionSection: React.FC<ClipTransitionSectionProps> = ({
</div>
<div className="flex-1">
<label className="text-[9px] text-text-muted">Easing</label>
- <select
- value={entryEasing}
- onChange={(e) => setEntryEasing(e.target.value as EasingType)}
- className="w-full px-2 py-1 text-[10px] bg-background-tertiary border border-border rounded"
- >
- {EASINGS.map((e) => (
- <option key={e.id} value={e.id}>
- {e.label}
- </option>
- ))}
- </select>
+ <Select value={entryEasing} onValueChange={(v) => setEntryEasing(v as EasingType)}>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary text-[10px] h-7">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {EASINGS.map((e) => (
+ <SelectItem key={e.id} value={e.id}>
+ {e.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
)}
@@ -1136,17 +1144,18 @@ export const ClipTransitionSection: React.FC<ClipTransitionSectionProps> = ({
</div>
<div className="flex-1">
<label className="text-[9px] text-text-muted">Easing</label>
- <select
- value={exitEasing}
- onChange={(e) => setExitEasing(e.target.value as EasingType)}
- className="w-full px-2 py-1 text-[10px] bg-background-tertiary border border-border rounded"
- >
- {EASINGS.map((e) => (
- <option key={e.id} value={e.id}>
- {e.label}
- </option>
- ))}
- </select>
+ <Select value={exitEasing} onValueChange={(v) => setExitEasing(v as EasingType)}>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary text-[10px] h-7">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {EASINGS.map((e) => (
+ <SelectItem key={e.id} value={e.id}>
+ {e.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
)}
diff --git a/apps/web/src/components/editor/inspector/EmphasisAnimationSection.tsx b/apps/web/src/components/editor/inspector/EmphasisAnimationSection.tsx
index c325d5be..dd0e8127 100644
--- a/apps/web/src/components/editor/inspector/EmphasisAnimationSection.tsx
+++ b/apps/web/src/components/editor/inspector/EmphasisAnimationSection.tsx
@@ -1,5 +1,6 @@
import React, { useCallback, useMemo } from "react";
import { RotateCcw, Target, Zap, Clock } from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import { useEngineStore } from "../../../stores/engine-store";
import type { EmphasisAnimation, EmphasisAnimationType } from "@openreel/core";
@@ -309,16 +310,14 @@ export const EmphasisAnimationSection: React.FC<
{currentAnimation.speed.toFixed(1)}x
</span>
</div>
- <input
- type="range"
+ <Slider
min={0.1}
max={3}
step={0.1}
- value={currentAnimation.speed}
- onChange={(e) =>
- handleAnimationChange({ speed: parseFloat(e.target.value) })
+ value={[currentAnimation.speed]}
+ onValueChange={(value) =>
+ handleAnimationChange({ speed: value[0] })
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
</div>
@@ -331,18 +330,16 @@ export const EmphasisAnimationSection: React.FC<
{Math.round(currentAnimation.intensity * 100)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0.1}
max={2}
step={0.1}
- value={currentAnimation.intensity}
- onChange={(e) =>
+ value={[currentAnimation.intensity]}
+ onValueChange={(value) =>
handleAnimationChange({
- intensity: parseFloat(e.target.value),
+ intensity: value[0],
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
</div>
@@ -387,18 +384,16 @@ export const EmphasisAnimationSection: React.FC<
{formatTime(currentAnimation.startTime ?? 0)}
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={clipDuration}
step={0.1}
- value={currentAnimation.startTime ?? 0}
- onChange={(e) =>
+ value={[currentAnimation.startTime ?? 0]}
+ onValueChange={(value) =>
handleAnimationChange({
- startTime: parseFloat(e.target.value),
+ startTime: value[0],
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
</div>
@@ -413,22 +408,20 @@ export const EmphasisAnimationSection: React.FC<
: "Full clip"}
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={clipDuration - (currentAnimation.startTime ?? 0)}
step={0.1}
- value={
+ value={[
currentAnimation.animationDuration ??
clipDuration - (currentAnimation.startTime ?? 0)
- }
- onChange={(e) => {
- const val = parseFloat(e.target.value);
+ ]}
+ onValueChange={(value) => {
+ const val = value[0];
handleAnimationChange({
animationDuration: val > 0 ? val : undefined,
});
}}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
<div className="flex justify-between text-[9px] text-text-muted">
<span>0s</span>
@@ -468,18 +461,16 @@ export const EmphasisAnimationSection: React.FC<
{(currentAnimation.zoomScale || 1.5).toFixed(1)}x
</span>
</div>
- <input
- type="range"
+ <Slider
min={1.1}
max={3}
step={0.1}
- value={currentAnimation.zoomScale || 1.5}
- onChange={(e) =>
+ value={[currentAnimation.zoomScale || 1.5]}
+ onValueChange={(value) =>
handleAnimationChange({
- zoomScale: parseFloat(e.target.value),
+ zoomScale: value[0],
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
</div>
@@ -492,18 +483,16 @@ export const EmphasisAnimationSection: React.FC<
{((currentAnimation.holdDuration || 0.3) * 100).toFixed(0)}%
</span>
</div>
- <input
- type="range"
+ <Slider
min={0}
max={1}
step={0.05}
- value={currentAnimation.holdDuration || 0.3}
- onChange={(e) =>
+ value={[currentAnimation.holdDuration || 0.3]}
+ onValueChange={(value) =>
handleAnimationChange({
- holdDuration: parseFloat(e.target.value),
+ holdDuration: value[0],
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm"
/>
</div>
@@ -516,42 +505,38 @@ export const EmphasisAnimationSection: React.FC<
<span className="text-[9px] text-text-muted">
X Position
</span>
- <input
- type="range"
+ <Slider
min={0}
max={1}
step={0.05}
- value={currentAnimation.focusPoint?.x || 0.5}
- onChange={(e) =>
+ value={[currentAnimation.focusPoint?.x || 0.5]}
+ onValueChange={(value) =>
handleAnimationChange({
focusPoint: {
- x: parseFloat(e.target.value),
+ x: value[0],
y: currentAnimation.focusPoint?.y || 0.5,
},
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-2.5 [&::-webkit-slider-thumb]:h-2.5 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:rounded-full"
/>
</div>
<div className="space-y-1">
<span className="text-[9px] text-text-muted">
Y Position
</span>
- <input
- type="range"
+ <Slider
min={0}
max={1}
step={0.05}
- value={currentAnimation.focusPoint?.y || 0.5}
- onChange={(e) =>
+ value={[currentAnimation.focusPoint?.y || 0.5]}
+ onValueChange={(value) =>
handleAnimationChange({
focusPoint: {
x: currentAnimation.focusPoint?.x || 0.5,
- y: parseFloat(e.target.value),
+ y: value[0],
},
})
}
- className="w-full h-1.5 bg-background-tertiary rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-2.5 [&::-webkit-slider-thumb]:h-2.5 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:rounded-full"
/>
</div>
</div>
diff --git a/apps/web/src/components/editor/inspector/FilterPresetsPanel.tsx b/apps/web/src/components/editor/inspector/FilterPresetsPanel.tsx
index a753b226..55591dba 100644
--- a/apps/web/src/components/editor/inspector/FilterPresetsPanel.tsx
+++ b/apps/web/src/components/editor/inspector/FilterPresetsPanel.tsx
@@ -1,5 +1,6 @@
import React, { useState, useCallback, useMemo } from "react";
import { Film, Camera, Moon, Palette, Sparkles, Check } from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import { useUIStore } from "../../../stores/ui-store";
import { toast } from "../../../stores/notification-store";
@@ -198,21 +199,13 @@ export const FilterPresetsPanel: React.FC<FilterPresetsPanelProps> = ({
{intensityValue}%
</span>
</div>
- <div className="relative h-1.5">
- <input
- type="range"
- min={0}
- max={100}
- value={intensityValue}
- onChange={(e) => setIntensityValue(parseInt(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div className="absolute inset-0 bg-background-secondary rounded-full" />
- <div
- className="absolute top-0 left-0 h-full bg-primary rounded-full transition-all"
- style={{ width: `${intensityValue}%` }}
- />
- </div>
+ <Slider
+ min={0}
+ max={100}
+ step={1}
+ value={[intensityValue]}
+ onValueChange={(value) => setIntensityValue(value[0])}
+ />
<button
onClick={handleClearEffects}
className="w-full py-2 text-[10px] text-red-400 hover:text-red-300 bg-red-500/10 rounded-lg transition-colors"
diff --git a/apps/web/src/components/editor/inspector/HistoryPanel.tsx b/apps/web/src/components/editor/inspector/HistoryPanel.tsx
index a9deebf6..29b7d7ab 100644
--- a/apps/web/src/components/editor/inspector/HistoryPanel.tsx
+++ b/apps/web/src/components/editor/inspector/HistoryPanel.tsx
@@ -13,6 +13,7 @@ import {
FileCode,
Smile,
} from "lucide-react";
+import { Input } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import type { HistorySnapshot } from "@openreel/core";
@@ -199,7 +200,7 @@ export const HistoryPanel: React.FC = () => {
{isCreatingSnapshot ? (
<div className="flex items-center gap-2 p-2">
- <input
+ <Input
type="text"
value={newSnapshotName}
onChange={(e) => setNewSnapshotName(e.target.value)}
@@ -208,7 +209,7 @@ export const HistoryPanel: React.FC = () => {
if (e.key === "Escape") setIsCreatingSnapshot(false);
}}
placeholder="Snapshot name..."
- className="flex-1 px-2 py-1 bg-background-tertiary border border-border rounded text-xs text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"
+ className="flex-1 h-7 text-xs bg-background-tertiary border-border text-text-primary"
autoFocus
/>
<button
diff --git a/apps/web/src/components/editor/inspector/LUTLoader.tsx b/apps/web/src/components/editor/inspector/LUTLoader.tsx
index b39a07d0..ab4f15b8 100644
--- a/apps/web/src/components/editor/inspector/LUTLoader.tsx
+++ b/apps/web/src/components/editor/inspector/LUTLoader.tsx
@@ -1,5 +1,6 @@
import React, { useCallback, useRef, useState } from "react";
import { Upload, X, AlertCircle } from "lucide-react";
+import { Slider } from "@openreel/ui";
import type { LUTData } from "@openreel/core";
interface LUTLoaderProps {
@@ -12,35 +13,23 @@ const IntensitySlider: React.FC<{
value: number;
onChange: (value: number) => void;
}> = ({ value, onChange }) => {
- const percentage = value * 100;
+ const percentage = Math.round(value * 100);
return (
<div className="space-y-1">
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">Intensity</span>
<span className="text-[10px] font-mono text-text-primary">
- {Math.round(percentage)}%
+ {percentage}%
</span>
</div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={0}
- max={100}
- step={1}
- value={percentage}
- onChange={(e) => onChange(parseFloat(e.target.value) / 100)}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
+ <Slider
+ min={0}
+ max={100}
+ step={1}
+ value={[percentage]}
+ onValueChange={(v) => onChange(v[0] / 100)}
+ />
</div>
);
};
diff --git a/apps/web/src/components/editor/inspector/MarkersPanel.tsx b/apps/web/src/components/editor/inspector/MarkersPanel.tsx
index 65c7364e..9cf0f303 100644
--- a/apps/web/src/components/editor/inspector/MarkersPanel.tsx
+++ b/apps/web/src/components/editor/inspector/MarkersPanel.tsx
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import { Flag, Plus, Trash2, Edit2, Check, X } from "lucide-react";
+import { Input } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import { getPlaybackBridge } from "../../../bridges/playback-bridge";
import type { Marker } from "@openreel/core";
@@ -101,11 +102,11 @@ export const MarkersPanel: React.FC = () => {
{editingId === marker.id ? (
<div className="flex-1 space-y-2">
- <input
+ <Input
type="text"
value={editLabel}
onChange={(e) => setEditLabel(e.target.value)}
- className="w-full px-2 py-1 bg-background-secondary border border-border rounded text-xs text-text-primary focus:outline-none focus:border-primary"
+ className="h-7 text-xs bg-background-secondary border-border text-text-primary"
placeholder="Marker label"
/>
<div className="flex gap-1">
diff --git a/apps/web/src/components/editor/inspector/MaskSection.tsx b/apps/web/src/components/editor/inspector/MaskSection.tsx
index d83ef2d2..8cf86126 100644
--- a/apps/web/src/components/editor/inspector/MaskSection.tsx
+++ b/apps/web/src/components/editor/inspector/MaskSection.tsx
@@ -13,6 +13,7 @@ import {
RefreshCw,
type LucideIcon,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useEngineStore } from "../../../stores/engine-store";
import { useProjectStore } from "../../../stores/project-store";
import type { Mask, MaskShape } from "@openreel/core";
@@ -129,14 +130,12 @@ const MaskItem: React.FC<{
{mask.feathering}px
</span>
</div>
- <input
- type="range"
- min="0"
- max="100"
- step="1"
- value={mask.feathering}
- onChange={(e) => onUpdateFeathering(parseFloat(e.target.value))}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={0}
+ max={100}
+ step={1}
+ value={[mask.feathering]}
+ onValueChange={(value) => onUpdateFeathering(value[0])}
/>
</div>
@@ -147,14 +146,12 @@ const MaskItem: React.FC<{
{mask.expansion}px
</span>
</div>
- <input
- type="range"
- min="-100"
- max="100"
- step="1"
- value={mask.expansion}
- onChange={(e) => onUpdateExpansion(parseFloat(e.target.value))}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={-100}
+ max={100}
+ step={1}
+ value={[mask.expansion]}
+ onValueChange={(value) => onUpdateExpansion(value[0])}
/>
</div>
@@ -165,14 +162,12 @@ const MaskItem: React.FC<{
{Math.round(mask.opacity * 100)}%
</span>
</div>
- <input
- type="range"
- min="0"
- max="1"
- step="0.01"
- value={mask.opacity}
- onChange={(e) => onUpdateOpacity(parseFloat(e.target.value))}
- className="w-full h-1 bg-background-secondary rounded-full appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={0}
+ max={100}
+ step={1}
+ value={[mask.opacity * 100]}
+ onValueChange={(value) => onUpdateOpacity(value[0] / 100)}
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/MotionTrackingSection.tsx b/apps/web/src/components/editor/inspector/MotionTrackingSection.tsx
index c254eb80..6918a09e 100644
--- a/apps/web/src/components/editor/inspector/MotionTrackingSection.tsx
+++ b/apps/web/src/components/editor/inspector/MotionTrackingSection.tsx
@@ -12,6 +12,7 @@ import {
Settings2,
RefreshCw,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import {
getMotionTrackingBridge,
type MotionTrackingState,
@@ -280,16 +281,12 @@ export const MotionTrackingSection: React.FC<MotionTrackingSectionProps> = ({
{confidenceThreshold}%
</span>
</div>
- <input
- type="range"
- min="30"
- max="95"
- step="5"
- value={confidenceThreshold}
- onChange={(e) =>
- setConfidenceThreshold(parseInt(e.target.value))
- }
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={30}
+ max={95}
+ step={5}
+ value={[confidenceThreshold]}
+ onValueChange={(value) => setConfidenceThreshold(value[0])}
/>
<p className="text-[8px] text-text-muted">
Higher = more accurate but may lose track easier
@@ -305,14 +302,12 @@ export const MotionTrackingSection: React.FC<MotionTrackingSectionProps> = ({
{smoothing}
</span>
</div>
- <input
- type="range"
- min="0"
- max="10"
- step="1"
- value={smoothing}
- onChange={(e) => setSmoothing(parseInt(e.target.value))}
- className="w-full h-1.5 bg-background-secondary rounded-full appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={0}
+ max={10}
+ step={1}
+ value={[smoothing]}
+ onValueChange={(value) => setSmoothing(value[0])}
/>
<p className="text-[8px] text-text-muted">
Reduces jitter in tracking path
diff --git a/apps/web/src/components/editor/inspector/MusicLibraryPanel.tsx b/apps/web/src/components/editor/inspector/MusicLibraryPanel.tsx
index b8561020..315eb1cb 100644
--- a/apps/web/src/components/editor/inspector/MusicLibraryPanel.tsx
+++ b/apps/web/src/components/editor/inspector/MusicLibraryPanel.tsx
@@ -9,6 +9,7 @@ import {
Clock,
Volume2,
} from "lucide-react";
+import { Input } from "@openreel/ui";
import { useEngineStore } from "../../../stores/engine-store";
import { useProjectStore } from "../../../stores/project-store";
import {
@@ -296,14 +297,14 @@ export const MusicLibraryPanel: React.FC = () => {
<div className="relative">
<Search
size={14}
- className="absolute left-2 top-1/2 -translate-y-1/2 text-text-muted"
+ className="absolute left-2 top-1/2 -translate-y-1/2 text-text-muted z-10"
/>
- <input
+ <Input
type="text"
placeholder="Search sounds..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
- className="w-full pl-8 pr-3 py-2 text-[10px] bg-background-secondary rounded-lg border border-border focus:border-primary focus:outline-none"
+ className="pl-8 text-[10px] bg-background-secondary border-border h-8"
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/NoiseReductionSection.tsx b/apps/web/src/components/editor/inspector/NoiseReductionSection.tsx
index d7b1f1a8..e1959170 100644
--- a/apps/web/src/components/editor/inspector/NoiseReductionSection.tsx
+++ b/apps/web/src/components/editor/inspector/NoiseReductionSection.tsx
@@ -8,52 +8,7 @@ import {
DEFAULT_NOISE_REDUCTION,
} from "../../../bridges/audio-bridge-effects";
import { useProjectStore } from "../../../stores/project-store";
-
-/**
- * Slider Component
- */
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
+import { LabeledSlider as Slider } from "@openreel/ui";
/**
* NoiseReductionSection Props
diff --git a/apps/web/src/components/editor/inspector/PhotoLayersSection.tsx b/apps/web/src/components/editor/inspector/PhotoLayersSection.tsx
index 1697830f..ea97c728 100644
--- a/apps/web/src/components/editor/inspector/PhotoLayersSection.tsx
+++ b/apps/web/src/components/editor/inspector/PhotoLayersSection.tsx
@@ -12,10 +12,14 @@ import {
ChevronDown,
} from "lucide-react";
import type { PhotoBlendMode, PhotoLayer } from "@openreel/core";
+import {
+ LabeledSlider as Slider,
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+} from "@openreel/ui";
-/**
- * Available blend modes
- */
const BLEND_MODES: { value: PhotoBlendMode; label: string }[] = [
{ value: "normal", label: "Normal" },
{ value: "multiply", label: "Multiply" },
@@ -33,96 +37,37 @@ const BLEND_MODES: { value: PhotoBlendMode; label: string }[] = [
{ value: "luminosity", label: "Luminosity" },
];
-/**
- * Slider Component
- */
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
-
-/**
- * Blend Mode Selector Component
- */
const BlendModeSelector: React.FC<{
value: PhotoBlendMode;
onChange: (mode: PhotoBlendMode) => void;
}> = ({ value, onChange }) => {
- const [isOpen, setIsOpen] = useState(false);
-
const selectedMode =
BLEND_MODES.find((m) => m.value === value) || BLEND_MODES[0];
return (
- <div className="relative">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">Blend Mode</span>
- <button
- onClick={() => setIsOpen(!isOpen)}
- className="flex items-center gap-1 px-2 py-1 text-[10px] bg-background-tertiary border border-border rounded hover:border-primary transition-colors"
- >
- <span className="text-text-primary">{selectedMode.label}</span>
- <ChevronDown size={12} className="text-text-muted" />
- </button>
- </div>
- {isOpen && (
- <div className="absolute right-0 top-full mt-1 w-32 max-h-48 overflow-y-auto bg-background-secondary border border-border rounded-lg shadow-lg z-20">
+ <div className="flex items-center justify-between">
+ <span className="text-[10px] text-text-secondary">Blend Mode</span>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <button className="flex items-center gap-1 px-2 py-1 text-[10px] bg-background-tertiary border border-border rounded hover:border-primary transition-colors">
+ <span className="text-text-primary">{selectedMode.label}</span>
+ <ChevronDown size={12} className="text-text-muted" />
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-32 max-h-48 overflow-y-auto">
{BLEND_MODES.map((mode) => (
- <button
+ <DropdownMenuItem
key={mode.value}
- onClick={() => {
- onChange(mode.value);
- setIsOpen(false);
- }}
- className={`w-full px-3 py-1.5 text-left text-[10px] hover:bg-background-tertiary transition-colors ${
- mode.value === value
- ? "text-primary bg-background-tertiary"
- : "text-text-primary"
+ onClick={() => onChange(mode.value)}
+ className={`text-[10px] ${
+ mode.value === value ? "text-primary bg-background-tertiary" : ""
}`}
>
{mode.label}
- </button>
+ </DropdownMenuItem>
))}
- </div>
- )}
+ </DropdownMenuContent>
+ </DropdownMenu>
</div>
);
};
diff --git a/apps/web/src/components/editor/inspector/RetouchingSection.tsx b/apps/web/src/components/editor/inspector/RetouchingSection.tsx
index 177a8088..26c46aa6 100644
--- a/apps/web/src/components/editor/inspector/RetouchingSection.tsx
+++ b/apps/web/src/components/editor/inspector/RetouchingSection.tsx
@@ -1,5 +1,6 @@
import React, { useMemo } from "react";
import { Eraser, Copy, Eye, Target, MousePointer2 } from "lucide-react";
+import { LabeledSlider as Slider } from "@openreel/ui";
export type RetouchingTool = "spotHeal" | "cloneStamp" | "redEyeRemoval";
@@ -16,52 +17,6 @@ export interface CloneSource {
layerId: string | null;
}
-/**
- * Slider Component
- */
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
-
/**
* Tool Button Component
*/
diff --git a/apps/web/src/components/editor/inspector/SVGSection.tsx b/apps/web/src/components/editor/inspector/SVGSection.tsx
index 9de5ff68..f42fe969 100644
--- a/apps/web/src/components/editor/inspector/SVGSection.tsx
+++ b/apps/web/src/components/editor/inspector/SVGSection.tsx
@@ -2,6 +2,14 @@ import React, { useCallback, useMemo } from "react";
import { useProjectStore } from "../../../stores/project-store";
import type { GraphicAnimation, GraphicAnimationType } from "@openreel/core";
import { SVG_ANIMATION_PRESETS } from "@openreel/core";
+import {
+ LabeledSlider as Slider,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
const ColorPicker: React.FC<{
label: string;
@@ -24,47 +32,6 @@ const ColorPicker: React.FC<{
</div>
);
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
-}> = ({ label, value, onChange, min = 0, max = 1, step = 0.1 }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
-
const ANIMATION_PRESETS = SVG_ANIMATION_PRESETS.map((preset) => ({
value: preset.id,
label: preset.name,
@@ -237,23 +204,21 @@ export const SVGSection: React.FC<SVGSectionProps> = ({ clipId }) => {
<span className="text-[10px] font-medium text-text-secondary">
Entry Animation
</span>
- <select
+ <Select
value={entryAnimation?.type || "none"}
- onChange={(e) =>
- handleEntryAnimationChange(e.target.value as GraphicAnimationType)
- }
- className="w-full px-3 py-2 text-sm text-text-primary bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary cursor-pointer"
+ onValueChange={(v) => handleEntryAnimationChange(v as GraphicAnimationType)}
>
- {ANIMATION_PRESETS.map((preset) => (
- <option
- key={preset.value}
- value={preset.value}
- title={preset.description}
- >
- {preset.label}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {ANIMATION_PRESETS.map((preset) => (
+ <SelectItem key={preset.value} value={preset.value}>
+ {preset.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
{entryAnimation && entryAnimation.type !== "none" && (
<Slider
@@ -271,23 +236,21 @@ export const SVGSection: React.FC<SVGSectionProps> = ({ clipId }) => {
<span className="text-[10px] font-medium text-text-secondary">
Exit Animation
</span>
- <select
+ <Select
value={exitAnimation?.type || "none"}
- onChange={(e) =>
- handleExitAnimationChange(e.target.value as GraphicAnimationType)
- }
- className="w-full px-3 py-2 text-sm text-text-primary bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary cursor-pointer"
+ onValueChange={(v) => handleExitAnimationChange(v as GraphicAnimationType)}
>
- {ANIMATION_PRESETS.map((preset) => (
- <option
- key={preset.value}
- value={preset.value}
- title={preset.description}
- >
- {preset.label}
- </option>
- ))}
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {ANIMATION_PRESETS.map((preset) => (
+ <SelectItem key={preset.value} value={preset.value}>
+ {preset.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
{exitAnimation && exitAnimation.type !== "none" && (
<Slider
diff --git a/apps/web/src/components/editor/inspector/ShapeSection.tsx b/apps/web/src/components/editor/inspector/ShapeSection.tsx
index b8d83739..5aef261f 100644
--- a/apps/web/src/components/editor/inspector/ShapeSection.tsx
+++ b/apps/web/src/components/editor/inspector/ShapeSection.tsx
@@ -9,6 +9,7 @@ import {
} from "lucide-react";
import { useProjectStore } from "../../../stores/project-store";
import type { ShapeStyle, FillStyle, StrokeStyle } from "@openreel/core";
+import { LabeledSlider as Slider } from "@openreel/ui";
const ColorPicker: React.FC<{
label: string;
@@ -57,49 +58,6 @@ const NumberInput: React.FC<{
</div>
);
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
-
const StrokeStyleSelector: React.FC<{
value: number[] | undefined;
onChange: (dashArray: number[] | undefined) => void;
diff --git a/apps/web/src/components/editor/inspector/SpeedRampSection.tsx b/apps/web/src/components/editor/inspector/SpeedRampSection.tsx
index d4fb6f7d..ca770a08 100644
--- a/apps/web/src/components/editor/inspector/SpeedRampSection.tsx
+++ b/apps/web/src/components/editor/inspector/SpeedRampSection.tsx
@@ -15,6 +15,7 @@ import {
ChevronDown,
ChevronRight,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import { useTimelineStore } from "../../../stores/timeline-store";
import {
@@ -364,16 +365,12 @@ export const SpeedRampSection: React.FC<SpeedRampSectionProps> = ({ clip }) => {
{currentSpeed.toFixed(2)}x
</span>
</div>
- <input
- type="range"
+ <Slider
min={Math.log(SPEED_MIN)}
max={Math.log(SPEED_MAX)}
step={0.01}
- value={Math.log(currentSpeed)}
- onChange={(e) =>
- handleSpeedChange(Math.exp(parseFloat(e.target.value)))
- }
- className="w-full h-2 bg-background-tertiary rounded-lg appearance-none cursor-pointer accent-primary"
+ value={[Math.log(currentSpeed)]}
+ onValueChange={(value) => handleSpeedChange(Math.exp(value[0]))}
/>
<div className="flex justify-between text-[8px] text-text-muted">
<span>0.1x</span>
diff --git a/apps/web/src/components/editor/inspector/StickerPicker.tsx b/apps/web/src/components/editor/inspector/StickerPicker.tsx
index bf2a3852..bac0b486 100644
--- a/apps/web/src/components/editor/inspector/StickerPicker.tsx
+++ b/apps/web/src/components/editor/inspector/StickerPicker.tsx
@@ -1,5 +1,6 @@
import React, { useCallback, useState, useMemo } from "react";
import { Smile, Sticker, Search, Plus, X } from "lucide-react";
+import { Input } from "@openreel/ui";
import { getGraphicsBridge } from "../../../bridges";
import type { StickerItem, EmojiItem } from "@openreel/core";
@@ -215,19 +216,19 @@ export const StickerPicker: React.FC<StickerPickerProps> = ({
<div className="relative">
<Search
size={14}
- className="absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted"
+ className="absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted z-10"
/>
- <input
+ <Input
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder={`Search ${activeTab}...`}
- className="w-full pl-8 pr-8 py-1.5 text-[10px] bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary text-text-primary placeholder:text-text-muted"
+ className="pl-8 pr-8 text-[10px] bg-background-tertiary border-border h-7 text-text-primary"
/>
{searchQuery && (
<button
onClick={clearSearch}
- className="absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-background-secondary"
+ className="absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-background-secondary z-10"
>
<X size={12} className="text-text-muted" />
</button>
diff --git a/apps/web/src/components/editor/inspector/StickerPickerPanel.tsx b/apps/web/src/components/editor/inspector/StickerPickerPanel.tsx
index 2a92729a..4546d341 100644
--- a/apps/web/src/components/editor/inspector/StickerPickerPanel.tsx
+++ b/apps/web/src/components/editor/inspector/StickerPickerPanel.tsx
@@ -1,5 +1,6 @@
import React, { useState, useCallback, useMemo } from "react";
import { Smile, Sticker, Search, Plus } from "lucide-react";
+import { Input } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
import {
stickerLibrary,
@@ -178,16 +179,16 @@ export const StickerPickerPanel: React.FC = () => {
<div className="relative">
<Search
size={14}
- className="absolute left-2 top-1/2 -translate-y-1/2 text-text-muted"
+ className="absolute left-2 top-1/2 -translate-y-1/2 text-text-muted z-10"
/>
- <input
+ <Input
type="text"
placeholder={
activeTab === "emojis" ? "Search emojis..." : "Search stickers..."
}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
- className="w-full pl-8 pr-3 py-2 text-[10px] bg-background-secondary rounded-lg border border-border focus:border-primary focus:outline-none"
+ className="pl-8 text-[10px] bg-background-secondary border-border h-8"
/>
</div>
diff --git a/apps/web/src/components/editor/inspector/TextAnimationSection.tsx b/apps/web/src/components/editor/inspector/TextAnimationSection.tsx
index 0d276211..f241e4fb 100644
--- a/apps/web/src/components/editor/inspector/TextAnimationSection.tsx
+++ b/apps/web/src/components/editor/inspector/TextAnimationSection.tsx
@@ -2,6 +2,14 @@ import React, { useCallback } from "react";
import { Sparkles, Clock, Play } from "lucide-react";
import { useProjectStore } from "../../../stores/project-store";
import type { TextAnimationPreset, TextAnimationParams } from "@openreel/core";
+import {
+ LabeledSlider,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
interface PresetInfo {
value: TextAnimationPreset;
@@ -58,34 +66,7 @@ const ANIMATION_PRESETS: PresetInfo[] = [
},
];
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min: number;
- max: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min, max, step = 0.1, unit = "s" }) => (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-muted">
- {value.toFixed(1)}
- {unit}
- </span>
- </div>
- <input
- type="range"
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- min={min}
- max={max}
- step={step}
- className="w-full h-1 bg-background-tertiary rounded-lg appearance-none cursor-pointer accent-primary"
- />
- </div>
-);
+const Slider = LabeledSlider;
const PresetSelector: React.FC<{
value: TextAnimationPreset;
@@ -93,17 +74,18 @@ const PresetSelector: React.FC<{
}> = ({ value, onChange }) => (
<div className="space-y-2">
<span className="text-[10px] text-text-secondary">Animation Preset</span>
- <select
- value={value}
- onChange={(e) => onChange(e.target.value as TextAnimationPreset)}
- className="w-full px-3 py-2 text-sm text-text-primary bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary cursor-pointer"
- >
- {ANIMATION_PRESETS.map((preset) => (
- <option key={preset.value} value={preset.value}>
- {preset.label}
- </option>
- ))}
- </select>
+ <Select value={value} onValueChange={(v) => onChange(v as TextAnimationPreset)}>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border max-h-60">
+ {ANIMATION_PRESETS.map((preset) => (
+ <SelectItem key={preset.value} value={preset.value}>
+ {preset.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<p className="text-[9px] text-text-muted">
{ANIMATION_PRESETS.find((p) => p.value === value)?.description}
</p>
@@ -124,17 +106,18 @@ const EasingSelector: React.FC<{
return (
<div className="space-y-1">
<span className="text-[10px] text-text-secondary">Easing</span>
- <select
- value={value}
- onChange={(e) => onChange(e.target.value)}
- className="w-full px-2 py-1 text-[10px] text-text-primary bg-background-tertiary border border-border rounded outline-none focus:border-primary cursor-pointer"
- >
- {easingOptions.map((option) => (
- <option key={option.value} value={option.value}>
- {option.label}
- </option>
- ))}
- </select>
+ <Select value={value} onValueChange={onChange}>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ {easingOptions.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
);
};
diff --git a/apps/web/src/components/editor/inspector/TextSection.tsx b/apps/web/src/components/editor/inspector/TextSection.tsx
index 45a183aa..f80867d9 100644
--- a/apps/web/src/components/editor/inspector/TextSection.tsx
+++ b/apps/web/src/components/editor/inspector/TextSection.tsx
@@ -13,6 +13,15 @@ import {
} from "lucide-react";
import { useProjectStore } from "../../../stores/project-store";
import type { TextStyle, FontWeight } from "@openreel/core";
+import {
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+ SelectGroup,
+ SelectLabel,
+} from "@openreel/ui";
const ColorPicker: React.FC<{
label: string;
@@ -155,22 +164,25 @@ const FontSelector: React.FC<{
return (
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">Font</span>
- <select
- value={value}
- onChange={(e) => onChange(e.target.value)}
- className="px-2 py-1 text-[10px] text-text-primary bg-background-tertiary border border-border rounded outline-none focus:border-primary cursor-pointer max-w-[140px]"
- style={{ fontFamily: value }}
- >
- {Object.entries(FONT_CATEGORIES).map(([category, fonts]) => (
- <optgroup key={category} label={category}>
- {fonts.map((font) => (
- <option key={font} value={font} style={{ fontFamily: font }}>
- {font}
- </option>
- ))}
- </optgroup>
- ))}
- </select>
+ <Select value={value} onValueChange={onChange}>
+ <SelectTrigger className="max-w-[140px] bg-background-tertiary border-border text-text-primary text-[10px]">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border max-h-80">
+ {Object.entries(FONT_CATEGORIES).map(([category, fonts]) => (
+ <SelectGroup key={category}>
+ <SelectLabel className="text-text-muted text-[10px] font-medium">
+ {category}
+ </SelectLabel>
+ {fonts.map((font) => (
+ <SelectItem key={font} value={font} style={{ fontFamily: font }}>
+ {font}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ))}
+ </SelectContent>
+ </Select>
</div>
);
};
diff --git a/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx b/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
index fdd72994..59f2bc5f 100644
--- a/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
+++ b/apps/web/src/components/editor/inspector/TextToSpeechPanel.tsx
@@ -9,6 +9,7 @@ import {
User,
Download,
} from "lucide-react";
+import { Slider } from "@openreel/ui";
import { useProjectStore } from "../../../stores/project-store";
const TTS_API_URL = "https://transcribe.openreel.video";
@@ -261,14 +262,12 @@ export const TextToSpeechPanel: React.FC = () => {
{speed.toFixed(1)}x
</span>
</div>
- <input
- type="range"
- min="0.5"
- max="2.0"
- step="0.1"
- value={speed}
- onChange={(e) => setSpeed(parseFloat(e.target.value))}
- className="w-full h-1.5 bg-background-tertiary rounded-lg appearance-none cursor-pointer accent-primary"
+ <Slider
+ min={0.5}
+ max={2.0}
+ step={0.1}
+ value={[speed]}
+ onValueChange={(value) => setSpeed(value[0])}
/>
<div className="flex justify-between text-[8px] text-text-muted">
<span>0.5x</span>
diff --git a/apps/web/src/components/editor/inspector/Transform3DSection.tsx b/apps/web/src/components/editor/inspector/Transform3DSection.tsx
index 87873169..725d7edf 100644
--- a/apps/web/src/components/editor/inspector/Transform3DSection.tsx
+++ b/apps/web/src/components/editor/inspector/Transform3DSection.tsx
@@ -1,48 +1,13 @@
import React, { useCallback, useMemo } from "react";
import { useProjectStore } from "../../../stores/project-store";
-
-const Slider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- );
-};
+import {
+ LabeledSlider as Slider,
+ Select,
+ SelectTrigger,
+ SelectValue,
+ SelectContent,
+ SelectItem,
+} from "@openreel/ui";
interface Transform3DSectionProps {
clipId: string;
@@ -178,18 +143,18 @@ export const Transform3DSection: React.FC<Transform3DSectionProps> = ({
<span className="text-[10px] text-text-secondary">
Transform Style
</span>
- <select
+ <Select
value={transformStyle}
- onChange={(e) =>
- handleTransformStyleChange(
- e.target.value as "flat" | "preserve-3d",
- )
- }
- className="w-full px-3 py-2 text-sm text-text-primary bg-background-tertiary border border-border rounded-lg outline-none focus:border-primary cursor-pointer"
+ onValueChange={(v) => handleTransformStyleChange(v as "flat" | "preserve-3d")}
>
- <option value="flat">Flat</option>
- <option value="preserve-3d">Preserve 3D</option>
- </select>
+ <SelectTrigger className="w-full bg-background-tertiary border-border text-text-primary">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="bg-background-secondary border-border">
+ <SelectItem value="flat">Flat</SelectItem>
+ <SelectItem value="preserve-3d">Preserve 3D</SelectItem>
+ </SelectContent>
+ </Select>
<p className="text-[9px] text-text-muted">
{transformStyle === "flat" &&
"Flattens children into the plane of this element"}
diff --git a/apps/web/src/components/editor/inspector/TransitionInspector.tsx b/apps/web/src/components/editor/inspector/TransitionInspector.tsx
index 45e04e56..6efe93e0 100644
--- a/apps/web/src/components/editor/inspector/TransitionInspector.tsx
+++ b/apps/web/src/components/editor/inspector/TransitionInspector.tsx
@@ -14,62 +14,9 @@ import {
import type { Transition, Clip } from "@openreel/core";
import type { TransitionType } from "@openreel/core";
import { toast } from "../../../stores/notification-store";
+import { LabeledSlider, Switch } from "@openreel/ui";
-/**
- * Slider Component for transition parameters
- */
-const TransitionSlider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({
- label,
- value,
- onChange,
- min = 0,
- max = 100,
- step = 0.1,
- unit = "",
-}) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary bg-background-tertiary px-1.5 py-0.5 rounded border border-border">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="flex items-center gap-2">
- <div className="flex-1 h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- </div>
- );
-};
+const TransitionSlider = LabeledSlider;
/**
* Direction Selector Component
@@ -109,9 +56,6 @@ const DirectionSelector: React.FC<{
);
};
-/**
- * Toggle Switch Component
- */
const Toggle: React.FC<{
label: string;
value: boolean;
@@ -119,18 +63,7 @@ const Toggle: React.FC<{
}> = ({ label, value, onChange }) => (
<div className="flex items-center justify-between">
<span className="text-[10px] text-text-secondary">{label}</span>
- <button
- onClick={() => onChange(!value)}
- className={`w-10 h-5 rounded-full transition-colors ${
- value ? "bg-primary" : "bg-background-tertiary border border-border"
- }`}
- >
- <div
- className={`w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${
- value ? "translate-x-5" : "translate-x-0.5"
- }`}
- />
- </button>
+ <Switch checked={value} onCheckedChange={onChange} />
</div>
);
diff --git a/apps/web/src/components/editor/inspector/VideoEffectsSection.tsx b/apps/web/src/components/editor/inspector/VideoEffectsSection.tsx
index 134c463c..268b9e5b 100644
--- a/apps/web/src/components/editor/inspector/VideoEffectsSection.tsx
+++ b/apps/web/src/components/editor/inspector/VideoEffectsSection.tsx
@@ -11,51 +11,16 @@ import type {
VideoEffect,
VideoEffectType,
} from "../../../bridges/effects-bridge";
+import {
+ LabeledSlider,
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+} from "@openreel/ui";
-const EffectSlider: React.FC<{
- label: string;
- value: number;
- onChange: (value: number) => void;
- min?: number;
- max?: number;
- step?: number;
- unit?: string;
-}> = ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "" }) => {
- const percentage = ((value - min) / (max - min)) * 100;
-
- return (
- <div className="space-y-1">
- <div className="flex items-center justify-between">
- <span className="text-[10px] text-text-secondary">{label}</span>
- <span className="text-[10px] font-mono text-text-primary bg-background-tertiary px-1.5 py-0.5 rounded border border-border">
- {value.toFixed(step < 1 ? 1 : 0)}
- {unit}
- </span>
- </div>
- <div className="flex items-center gap-2">
- <div className="flex-1 h-1.5 bg-background-tertiary rounded-full relative overflow-hidden">
- <input
- type="range"
- min={min}
- max={max}
- step={step}
- value={value}
- onChange={(e) => onChange(parseFloat(e.target.value))}
- className="absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"
- />
- <div
- className="absolute top-0 left-0 h-full bg-text-secondary rounded-full transition-all"
- style={{ width: `${percentage}%` }}
- />
- <div
- className="absolute top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-white rounded-full shadow-sm pointer-events-none transition-all"
- style={{ left: `calc(${percentage}% - 5px)` }}
- />
- </div>
- </div>
- </div>
- );
-};
+const EffectSlider = LabeledSlider;
/**
* Effect Item Component - displays a single effect with controls
@@ -402,81 +367,60 @@ const EffectItem: React.FC<{
);
};
-/**
- * Effect Type Selector - dropdown to add new effects
- */
+const EFFECT_TYPES: {
+ type: VideoEffectType;
+ label: string;
+ category: string;
+}[] = [
+ { type: "brightness", label: "Brightness", category: "Basic" },
+ { type: "contrast", label: "Contrast", category: "Basic" },
+ { type: "saturation", label: "Saturation", category: "Basic" },
+ { type: "temperature", label: "Temperature", category: "Color" },
+ { type: "tint", label: "Tint", category: "Color" },
+ { type: "blur", label: "Blur", category: "Blur" },
+ { type: "motion-blur", label: "Motion Blur", category: "Blur" },
+ { type: "radial-blur", label: "Radial Blur", category: "Blur" },
+ { type: "sharpen", label: "Sharpen", category: "Creative" },
+ { type: "vignette", label: "Vignette", category: "Creative" },
+ { type: "grain", label: "Film Grain", category: "Creative" },
+ { type: "shadow", label: "Drop Shadow", category: "Stylize" },
+ { type: "glow", label: "Glow", category: "Stylize" },
+ { type: "chromatic-aberration", label: "Chromatic Aberration", category: "Stylize" },
+];
+
+const EFFECT_CATEGORIES = [...new Set(EFFECT_TYPES.map((e) => e.category))];
+
const EffectTypeSelector: React.FC<{
onSelect: (type: VideoEffectType) => void;
}> = ({ onSelect }) => {
- const [isOpen, setIsOpen] = React.useState(false);
-
- const effectTypes: {
- type: VideoEffectType;
- label: string;
- category: string;
- }[] = [
- { type: "brightness", label: "Brightness", category: "Basic" },
- { type: "contrast", label: "Contrast", category: "Basic" },
- { type: "saturation", label: "Saturation", category: "Basic" },
- { type: "temperature", label: "Temperature", category: "Color" },
- { type: "tint", label: "Tint", category: "Color" },
- { type: "blur", label: "Blur", category: "Blur" },
- { type: "motion-blur", label: "Motion Blur", category: "Blur" },
- { type: "radial-blur", label: "Radial Blur", category: "Blur" },
- { type: "sharpen", label: "Sharpen", category: "Creative" },
- { type: "vignette", label: "Vignette", category: "Creative" },
- { type: "grain", label: "Film Grain", category: "Creative" },
- { type: "shadow", label: "Drop Shadow", category: "Stylize" },
- { type: "glow", label: "Glow", category: "Stylize" },
- {
- type: "chromatic-aberration",
- label: "Chromatic Aberration",
- category: "Stylize",
- },
- ];
-
- const categories = [...new Set(effectTypes.map((e) => e.category))];
-
return (
- <div className="relative">
- <button
- onClick={() => setIsOpen(!isOpen)}
- className="w-full py-2 bg-primary/10 border border-primary/30 rounded-lg text-[10px] text-primary hover:bg-primary/20 transition-colors"
- >
- + Add Effect
- </button>
- {isOpen && (
- <>
- <div
- className="fixed inset-0 z-10"
- onClick={() => setIsOpen(false)}
- />
- <div className="absolute top-full left-0 right-0 mt-1 bg-background-secondary border border-border rounded-lg shadow-lg z-20 max-h-64 overflow-y-auto">
- {categories.map((category) => (
- <div key={category}>
- <div className="px-3 py-1.5 text-[9px] font-medium text-text-muted uppercase tracking-wider bg-background-tertiary">
- {category}
- </div>
- {effectTypes
- .filter((e) => e.category === category)
- .map((effect) => (
- <button
- key={effect.type}
- onClick={() => {
- onSelect(effect.type);
- setIsOpen(false);
- }}
- className="w-full px-3 py-2 text-left text-[10px] text-text-primary hover:bg-background-tertiary transition-colors"
- >
- {effect.label}
- </button>
- ))}
- </div>
- ))}
- </div>
- </>
- )}
- </div>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <button className="w-full py-2 bg-primary/10 border border-primary/30 rounded-lg text-[10px] text-primary hover:bg-primary/20 transition-colors">
+ + Add Effect
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start" className="w-48 max-h-64 overflow-y-auto">
+ {EFFECT_CATEGORIES.map((category) => (
+ <React.Fragment key={category}>
+ <DropdownMenuLabel className="text-[9px] uppercase tracking-wider text-text-muted">
+ {category}
+ </DropdownMenuLabel>
+ {EFFECT_TYPES
+ .filter((e) => e.category === category)
+ .map((effect) => (
+ <DropdownMenuItem
+ key={effect.type}
+ onClick={() => onSelect(effect.type)}
+ className="text-[10px]"
+ >
+ {effect.label}
+ </DropdownMenuItem>
+ ))}
+ </React.Fragment>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
);
};
diff --git a/apps/web/src/components/editor/preview/IconButton.tsx b/apps/web/src/components/editor/preview/IconButton.tsx
deleted file mode 100644
index 4356f84e..00000000
--- a/apps/web/src/components/editor/preview/IconButton.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import React from "react";
-
-interface IconButtonProps {
- icon: React.ElementType;
- className?: string;
- onClick?: () => void;
- title?: string;
-}
-
-export const IconButton: React.FC<IconButtonProps> = ({
- icon: Icon,
- className = "",
- onClick,
- title,
-}) => (
- <button
- onClick={onClick}
- title={title}
- className={`p-2 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors ${className}`}
- >
- <Icon size={16} />
- </button>
-);
diff --git a/apps/web/src/components/editor/preview/index.ts b/apps/web/src/components/editor/preview/index.ts
index 661c4ce8..64aaa126 100644
--- a/apps/web/src/components/editor/preview/index.ts
+++ b/apps/web/src/components/editor/preview/index.ts
@@ -1,5 +1,4 @@
export * from "./types";
export * from "./utils";
export * from "./canvas-renderers";
-export { IconButton } from "./IconButton";
export { CropModeView } from "./CropModeView";
diff --git a/apps/web/src/components/editor/timeline/ClipComponent.tsx b/apps/web/src/components/editor/timeline/ClipComponent.tsx
index 52d769cd..2bb41ef2 100644
--- a/apps/web/src/components/editor/timeline/ClipComponent.tsx
+++ b/apps/web/src/components/editor/timeline/ClipComponent.tsx
@@ -6,6 +6,7 @@ import { useUIStore } from "../../../stores/ui-store";
import { useTimelineStore } from "../../../stores/timeline-store";
import { calculateSnap, generateWaveformPath, getClipStyle } from "./utils";
import { ClipContextMenu } from "./ClipContextMenu";
+import { ContextMenu, ContextMenuTrigger } from "@openreel/ui";
interface ClipComponentProps {
clip: Clip;
@@ -50,8 +51,6 @@ export const ClipComponent: React.FC<ClipComponentProps> = ({
const [dragOffset, setDragOffset] = useState(0);
const [isTrimming, setIsTrimming] = useState(false);
const [trimEdge, setTrimEdge] = useState<"left" | "right" | null>(null);
- const [showContextMenu, setShowContextMenu] = useState(false);
- const [contextMenuPos, setContextMenuPos] = useState({ x: 0, y: 0 });
const trimStartRef = useRef<{
mouseX: number;
startTime: number;
@@ -92,18 +91,6 @@ export const ClipComponent: React.FC<ClipComponentProps> = ({
onSelect(clip.id, e.shiftKey || e.metaKey);
};
- const handleContextMenu = (e: React.MouseEvent) => {
- e.preventDefault();
- e.stopPropagation();
-
- if (!isSelected) {
- onSelect(clip.id, false);
- }
-
- setContextMenuPos({ x: e.clientX, y: e.clientY });
- setShowContextMenu(true);
- };
-
const handleTrimMouseDown =
(edge: "left" | "right") => (e: React.MouseEvent) => {
if (track.locked || !onTrimClip) return;
@@ -234,27 +221,28 @@ export const ClipComponent: React.FC<ClipComponentProps> = ({
const isInteracting = isDragging || isTrimming;
return (
- <div
- ref={clipRef}
- onClick={handleClick}
- onMouseDown={handleMouseDown}
- onContextMenu={handleContextMenu}
- className={`group absolute top-1 bottom-1 rounded-lg overflow-hidden shadow-sm ${
- isDragging ? "cursor-grabbing opacity-80 z-20" : "cursor-grab"
- } ${
- isSelected
- ? "ring-2 ring-primary border-primary z-10"
- : "border-opacity-30 hover:border-opacity-60 hover:brightness-110"
- } ${clipStyle.bg} border ${clipStyle.border} ${
- track.locked ? "cursor-not-allowed opacity-60" : ""
- }`}
- style={{
- transform: `translateX(${left}px)`,
- width: `${width}px`,
- willChange: isInteracting ? 'transform, width' : 'auto',
- transition: isInteracting ? 'none' : 'opacity 150ms, box-shadow 150ms',
- }}
- >
+ <ContextMenu>
+ <ContextMenuTrigger asChild>
+ <div
+ ref={clipRef}
+ onClick={handleClick}
+ onMouseDown={handleMouseDown}
+ className={`group absolute top-1 bottom-1 rounded-lg overflow-hidden shadow-sm ${
+ isDragging ? "cursor-grabbing opacity-80 z-20" : "cursor-grab"
+ } ${
+ isSelected
+ ? "ring-2 ring-primary border-primary z-10"
+ : "border-opacity-30 hover:border-opacity-60 hover:brightness-110"
+ } ${clipStyle.bg} border ${clipStyle.border} ${
+ track.locked ? "cursor-not-allowed opacity-60" : ""
+ }`}
+ style={{
+ transform: `translateX(${left}px)`,
+ width: `${width}px`,
+ willChange: isInteracting ? 'transform, width' : 'auto',
+ transition: isInteracting ? 'none' : 'opacity 150ms, box-shadow 150ms',
+ }}
+ >
{isVideo &&
(mediaItem?.filmstripThumbnails?.length || mediaItem?.thumbnailUrl) && (
<div className="absolute inset-0 flex pointer-events-none">
@@ -410,14 +398,9 @@ export const ClipComponent: React.FC<ClipComponentProps> = ({
</>
)}
- {showContextMenu && (
- <ClipContextMenu
- clip={clip}
- x={contextMenuPos.x}
- y={contextMenuPos.y}
- onClose={() => setShowContextMenu(false)}
- />
- )}
- </div>
+ </div>
+ </ContextMenuTrigger>
+ <ClipContextMenu clip={clip} />
+ </ContextMenu>
);
};
diff --git a/apps/web/src/components/editor/timeline/ClipContextMenu.tsx b/apps/web/src/components/editor/timeline/ClipContextMenu.tsx
index 547fec93..23f5acab 100644
--- a/apps/web/src/components/editor/timeline/ClipContextMenu.tsx
+++ b/apps/web/src/components/editor/timeline/ClipContextMenu.tsx
@@ -1,35 +1,24 @@
-import React, { useEffect, useRef } from "react";
-import { createPortal } from "react-dom";
+import React from "react";
import { Copy, Clipboard, Trash2, Scissors } from "lucide-react";
-import type { LucideIcon } from "lucide-react";
import type { Clip } from "@openreel/core";
import { useProjectStore } from "../../../stores/project-store";
import { useTimelineStore } from "../../../stores/timeline-store";
+import {
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuSeparator,
+ ContextMenuShortcut,
+} from "@openreel/ui";
interface ClipContextMenuProps {
clip: Clip;
- x: number;
- y: number;
- onClose: () => void;
-}
-
-interface MenuItem {
- id: string;
- label: string;
- icon?: LucideIcon;
- shortcut?: string;
- onClick: () => void;
- disabled?: boolean;
- separator?: boolean;
+ onClose?: () => void;
}
export const ClipContextMenu: React.FC<ClipContextMenuProps> = ({
clip,
- x,
- y,
onClose,
}) => {
- const menuRef = useRef<HTMLDivElement>(null);
const { copyClips, duplicateClip, removeClip, rippleDeleteClip, splitClip } =
useProjectStore();
const { playheadPosition } = useTimelineStore();
@@ -40,156 +29,58 @@ export const ClipContextMenu: React.FC<ClipContextMenuProps> = ({
const handleCopy = () => {
copyClips([clip.id]);
- onClose();
+ onClose?.();
};
const handleDuplicate = async () => {
await duplicateClip(clip.id);
- onClose();
+ onClose?.();
};
const handleDelete = async () => {
await removeClip(clip.id);
- onClose();
+ onClose?.();
};
const handleRippleDelete = async () => {
await rippleDeleteClip(clip.id);
- onClose();
+ onClose?.();
};
const handleSplit = async () => {
if (isPlayheadOnClip) {
await splitClip(clip.id, playheadPosition);
}
- onClose();
+ onClose?.();
};
- const menuItems: MenuItem[] = [
- {
- id: "copy",
- label: "Copy",
- icon: Copy,
- shortcut: "⌘C",
- onClick: handleCopy,
- },
- {
- id: "duplicate",
- label: "Duplicate",
- icon: Clipboard,
- shortcut: "⌘D",
- onClick: handleDuplicate,
- },
- {
- id: "ripple-delete",
- label: "Ripple Delete",
- icon: Trash2,
- shortcut: "⌫",
- onClick: handleRippleDelete,
- },
- {
- id: "delete",
- label: "Delete",
- icon: Trash2,
- onClick: handleDelete,
- },
- {
- id: "separator-1",
- label: "",
- onClick: () => {},
- separator: true,
- },
- {
- id: "split",
- label: "Split at Playhead",
- icon: Scissors,
- shortcut: "S",
- onClick: handleSplit,
- disabled: !isPlayheadOnClip,
- },
- ];
-
- useEffect(() => {
- const handleClickOutside = (e: MouseEvent) => {
- if (menuRef.current && !menuRef.current.contains(e.target as Node)) {
- onClose();
- }
- };
-
- const handleEscape = (e: KeyboardEvent) => {
- if (e.key === "Escape") {
- onClose();
- }
- };
-
- document.addEventListener("mousedown", handleClickOutside);
- document.addEventListener("keydown", handleEscape);
-
- return () => {
- document.removeEventListener("mousedown", handleClickOutside);
- document.removeEventListener("keydown", handleEscape);
- };
- }, [onClose]);
-
- useEffect(() => {
- if (menuRef.current) {
- const menu = menuRef.current;
- const rect = menu.getBoundingClientRect();
- const viewportWidth = window.innerWidth;
- const viewportHeight = window.innerHeight;
-
- let adjustedX = x;
- let adjustedY = y;
-
- if (x + rect.width > viewportWidth) {
- adjustedX = viewportWidth - rect.width - 10;
- }
-
- if (y + rect.height > viewportHeight) {
- adjustedY = viewportHeight - rect.height - 10;
- }
-
- menu.style.left = `${adjustedX}px`;
- menu.style.top = `${adjustedY}px`;
- }
- }, [x, y]);
-
- const menu = (
- <div
- ref={menuRef}
- className="fixed z-[9999] min-w-[200px] rounded-lg bg-background-secondary border border-border shadow-lg py-1 pointer-events-auto"
- style={{ left: x, top: y }}
- >
- {menuItems.map((item) => {
- if (item.separator) {
- return <div key={item.id} className="h-px bg-border my-1" />;
- }
-
- const Icon = item.icon;
-
- return (
- <button
- key={item.id}
- onClick={item.onClick}
- disabled={item.disabled}
- className={`w-full px-3 py-2 flex items-center gap-3 text-sm hover:bg-background-tertiary transition-colors ${
- item.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
- }`}
- >
- {Icon && <Icon size={16} className="text-text-secondary" />}
- <span className="flex-1 text-left text-text-primary">
- {item.label}
- </span>
- {item.shortcut && (
- <span className="text-xs text-text-tertiary">
- {item.shortcut}
- </span>
- )}
- </button>
- );
- })}
- </div>
+ return (
+ <ContextMenuContent className="min-w-[200px]">
+ <ContextMenuItem onClick={handleCopy}>
+ <Copy className="mr-2 h-4 w-4" />
+ Copy
+ <ContextMenuShortcut>⌘C</ContextMenuShortcut>
+ </ContextMenuItem>
+ <ContextMenuItem onClick={handleDuplicate}>
+ <Clipboard className="mr-2 h-4 w-4" />
+ Duplicate
+ <ContextMenuShortcut>⌘D</ContextMenuShortcut>
+ </ContextMenuItem>
+ <ContextMenuItem onClick={handleRippleDelete}>
+ <Trash2 className="mr-2 h-4 w-4" />
+ Ripple Delete
+ <ContextMenuShortcut>⌫</ContextMenuShortcut>
+ </ContextMenuItem>
+ <ContextMenuItem onClick={handleDelete}>
+ <Trash2 className="mr-2 h-4 w-4" />
+ Delete
+ </ContextMenuItem>
+ <ContextMenuSeparator />
+ <ContextMenuItem onClick={handleSplit} disabled={!isPlayheadOnClip}>
+ <Scissors className="mr-2 h-4 w-4" />
+ Split at Playhead
+ <ContextMenuShortcut>S</ContextMenuShortcut>
+ </ContextMenuItem>
+ </ContextMenuContent>
);
-
- return createPortal(menu, document.body);
};
diff --git a/apps/web/src/components/editor/timeline/IconButton.tsx b/apps/web/src/components/editor/timeline/IconButton.tsx
deleted file mode 100644
index 10f0185d..00000000
--- a/apps/web/src/components/editor/timeline/IconButton.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import React from "react";
-
-interface IconButtonProps {
- icon: React.ElementType;
- className?: string;
- onClick?: () => void;
- disabled?: boolean;
- title?: string;
-}
-
-export const IconButton: React.FC<IconButtonProps> = ({
- icon: Icon,
- className = "",
- onClick,
- disabled,
- title,
-}) => (
- <button
- onClick={onClick}
- disabled={disabled}
- title={title}
- className={`p-1.5 rounded-lg hover:bg-background-elevated text-text-secondary hover:text-text-primary transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${className}`}
- >
- <Icon size={14} />
- </button>
-);
diff --git a/apps/web/src/components/editor/timeline/TrackHeader.tsx b/apps/web/src/components/editor/timeline/TrackHeader.tsx
index 663de385..d96a5c16 100644
--- a/apps/web/src/components/editor/timeline/TrackHeader.tsx
+++ b/apps/web/src/components/editor/timeline/TrackHeader.tsx
@@ -1,8 +1,14 @@
-import React, { useState, useEffect } from "react";
+import React from "react";
import { Eye, EyeOff, Volume2, Lock, Trash2 } from "lucide-react";
import type { Track } from "@openreel/core";
import { useProjectStore } from "../../../stores/project-store";
import { getTrackInfo } from "./utils";
+import {
+ ContextMenu,
+ ContextMenuTrigger,
+ ContextMenuContent,
+ ContextMenuItem,
+} from "@openreel/ui";
interface TrackHeaderProps {
track: Track;
@@ -20,8 +26,6 @@ export const TrackHeader: React.FC<TrackHeaderProps> = ({
onDrop,
}) => {
const { lockTrack, hideTrack, muteTrack, removeTrack } = useProjectStore();
- const [showContextMenu, setShowContextMenu] = useState(false);
- const [contextMenuPos, setContextMenuPos] = useState({ x: 0, y: 0 });
const trackInfo = getTrackInfo(track, index);
const TrackIcon = trackInfo.icon;
@@ -31,105 +35,85 @@ export const TrackHeader: React.FC<TrackHeaderProps> = ({
track.type === "text" ||
track.type === "graphics";
- const handleContextMenu = (e: React.MouseEvent) => {
- e.preventDefault();
- setContextMenuPos({ x: e.clientX, y: e.clientY });
- setShowContextMenu(true);
- };
-
const handleRemoveTrack = async () => {
- setShowContextMenu(false);
await removeTrack(track.id);
};
- useEffect(() => {
- const handleClickOutside = () => setShowContextMenu(false);
- if (showContextMenu) {
- document.addEventListener("click", handleClickOutside);
- return () => document.removeEventListener("click", handleClickOutside);
- }
- }, [showContextMenu]);
-
return (
- <>
- <div
- draggable
- onDragStart={(e) => onDragStart(e, track.id)}
- onDragOver={onDragOver}
- onDrop={(e) => onDrop(e, track.id)}
- onContextMenu={handleContextMenu}
- className={`h-20 border-b border-border flex items-center px-3 justify-between relative group transition-colors cursor-grab active:cursor-grabbing ${
- track.hidden ? "opacity-50" : ""
- } ${
- track.locked ? "bg-background-secondary/50" : "bg-background-tertiary"
- }`}
- >
- <div className="flex flex-col gap-1">
- <span className={`text-xs font-bold ${trackInfo.textColor}`}>
- {track.name || trackInfo.label}
- </span>
- <div className="flex gap-1 text-text-muted">
- <TrackIcon size={10} />
+ <ContextMenu>
+ <ContextMenuTrigger asChild>
+ <div
+ draggable
+ onDragStart={(e) => onDragStart(e, track.id)}
+ onDragOver={onDragOver}
+ onDrop={(e) => onDrop(e, track.id)}
+ className={`h-20 border-b border-border flex items-center px-3 justify-between relative group transition-colors cursor-grab active:cursor-grabbing ${
+ track.hidden ? "opacity-50" : ""
+ } ${
+ track.locked ? "bg-background-secondary/50" : "bg-background-tertiary"
+ }`}
+ >
+ <div className="flex flex-col gap-1">
+ <span className={`text-xs font-bold ${trackInfo.textColor}`}>
+ {track.name || trackInfo.label}
+ </span>
+ <div className="flex gap-1 text-text-muted">
+ <TrackIcon size={10} />
+ </div>
</div>
- </div>
- <div className="flex flex-col gap-1 text-text-secondary opacity-0 group-hover:opacity-100 transition-opacity">
- {isVisual && (
+ <div className="flex flex-col gap-1 text-text-secondary opacity-0 group-hover:opacity-100 transition-opacity">
+ {isVisual && (
+ <button
+ onClick={() => hideTrack(track.id, !track.hidden)}
+ className={`p-1 rounded hover:bg-background-elevated ${
+ track.hidden ? "text-yellow-500" : ""
+ }`}
+ title={track.hidden ? "Show track" : "Hide track"}
+ >
+ {track.hidden ? <EyeOff size={12} /> : <Eye size={12} />}
+ </button>
+ )}
<button
- onClick={() => hideTrack(track.id, !track.hidden)}
+ onClick={() => muteTrack(track.id, !track.muted)}
className={`p-1 rounded hover:bg-background-elevated ${
- track.hidden ? "text-yellow-500" : ""
+ track.muted ? "text-red-500" : ""
}`}
- title={track.hidden ? "Show track" : "Hide track"}
+ title={track.muted ? "Unmute" : "Mute"}
>
- {track.hidden ? <EyeOff size={12} /> : <Eye size={12} />}
+ <Volume2 size={12} />
</button>
- )}
- <button
- onClick={() => muteTrack(track.id, !track.muted)}
- className={`p-1 rounded hover:bg-background-elevated ${
- track.muted ? "text-red-500" : ""
- }`}
- title={track.muted ? "Unmute" : "Mute"}
- >
- <Volume2 size={12} />
- </button>
- <button
- onClick={() => lockTrack(track.id, !track.locked)}
- className={`p-1 rounded hover:bg-background-elevated ${
- track.locked ? "text-yellow-500" : ""
- }`}
- title={track.locked ? "Unlock" : "Lock"}
- >
- <Lock size={12} />
- </button>
- <button
- onClick={handleRemoveTrack}
- className="p-1 rounded hover:bg-red-500/20 text-text-muted hover:text-red-400"
- title="Delete track"
- >
- <Trash2 size={12} />
- </button>
+ <button
+ onClick={() => lockTrack(track.id, !track.locked)}
+ className={`p-1 rounded hover:bg-background-elevated ${
+ track.locked ? "text-yellow-500" : ""
+ }`}
+ title={track.locked ? "Unlock" : "Lock"}
+ >
+ <Lock size={12} />
+ </button>
+ <button
+ onClick={handleRemoveTrack}
+ className="p-1 rounded hover:bg-red-500/20 text-text-muted hover:text-red-400"
+ title="Delete track"
+ >
+ <Trash2 size={12} />
+ </button>
+ </div>
+ <div
+ className={`absolute left-0 w-1 h-full ${trackInfo.color} opacity-50 group-hover:opacity-100 transition-opacity`}
+ />
</div>
- <div
- className={`absolute left-0 w-1 h-full ${trackInfo.color} opacity-50 group-hover:opacity-100 transition-opacity`}
- />
- </div>
-
- {showContextMenu && (
- <div
- className="fixed z-50 bg-background-secondary border border-border rounded-lg shadow-xl py-1 min-w-[150px]"
- style={{ left: contextMenuPos.x, top: contextMenuPos.y }}
+ </ContextMenuTrigger>
+ <ContextMenuContent className="min-w-[150px]">
+ <ContextMenuItem
+ onClick={handleRemoveTrack}
+ className="text-red-400 focus:text-red-400"
>
- <button
- onClick={handleRemoveTrack}
- className="w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-background-elevated flex items-center gap-2"
- >
- <Trash2 size={14} />
- Delete Track
- </button>
- </div>
- )}
- </>
+ <Trash2 className="mr-2 h-4 w-4" />
+ Delete Track
+ </ContextMenuItem>
+ </ContextMenuContent>
+ </ContextMenu>
);
};
diff --git a/apps/web/src/components/editor/timeline/index.ts b/apps/web/src/components/editor/timeline/index.ts
index 2dd4724b..90f6c7a0 100644
--- a/apps/web/src/components/editor/timeline/index.ts
+++ b/apps/web/src/components/editor/timeline/index.ts
@@ -1,6 +1,5 @@
export * from "./types";
export * from "./utils";
-export { IconButton } from "./IconButton";
export { Playhead } from "./Playhead";
export { TimeRuler } from "./TimeRuler";
export { TrackHeader } from "./TrackHeader";
diff --git a/apps/web/src/components/welcome/RecoveryDialog.test.tsx b/apps/web/src/components/welcome/RecoveryDialog.test.tsx
index 4ecfd251..ccb11995 100644
--- a/apps/web/src/components/welcome/RecoveryDialog.test.tsx
+++ b/apps/web/src/components/welcome/RecoveryDialog.test.tsx
@@ -58,24 +58,18 @@ describe("RecoveryDialog", () => {
<RecoveryDialog saves={saves} onRecover={mockOnRecover} onDismiss={mockOnDismiss} />
);
- const closeButtons = screen.getAllByRole("button");
- const closeButton = closeButtons.find((btn) => btn.querySelector("svg"));
- if (closeButton) {
- fireEvent.click(closeButton);
- }
+ const closeButton = screen.getByRole("button", { name: /close/i });
+ fireEvent.click(closeButton);
expect(mockOnDismiss).toHaveBeenCalled();
});
- it("calls onDismiss when backdrop is clicked", () => {
+ it("calls onDismiss when Escape key is pressed", () => {
const saves = [createSave()];
- const { container } = render(
+ render(
<RecoveryDialog saves={saves} onRecover={mockOnRecover} onDismiss={mockOnDismiss} />
);
- const backdrop = container.querySelector(".bg-black\\/80");
- if (backdrop) {
- fireEvent.click(backdrop);
- }
+ fireEvent.keyDown(document, { key: "Escape" });
expect(mockOnDismiss).toHaveBeenCalled();
});
diff --git a/apps/web/src/components/welcome/RecoveryDialog.tsx b/apps/web/src/components/welcome/RecoveryDialog.tsx
index a978d66d..082ca079 100644
--- a/apps/web/src/components/welcome/RecoveryDialog.tsx
+++ b/apps/web/src/components/welcome/RecoveryDialog.tsx
@@ -1,5 +1,16 @@
-import React, { useState } from "react";
-import { RotateCcw, X, Clock, FileVideo, ChevronDown } from "lucide-react";
+import { useState } from "react";
+import { RotateCcw, Clock, FileVideo, ChevronDown } from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ Button,
+ Collapsible,
+ CollapsibleTrigger,
+ CollapsibleContent,
+} from "@openreel/ui";
import type { AutoSaveMetadata } from "../../services/auto-save";
interface RecoveryDialogProps {
@@ -49,36 +60,23 @@ export const RecoveryDialog: React.FC<RecoveryDialogProps> = ({
};
return (
- <div className="fixed inset-0 z-50 flex items-center justify-center p-4">
- <div
- className="absolute inset-0 bg-black/80 backdrop-blur-sm"
- onClick={onDismiss}
- />
-
- <div className="relative bg-background-secondary border border-border rounded-xl shadow-2xl w-full max-w-md overflow-hidden">
- <div className="p-5 border-b border-border">
- <div className="flex items-start justify-between gap-4">
- <div className="flex items-center gap-3">
- <div className="p-2.5 bg-primary/10 rounded-xl shrink-0">
- <RotateCcw className="w-5 h-5 text-primary" />
- </div>
- <div>
- <h2 className="text-base font-semibold text-text-primary">
- Recover Your Work
- </h2>
- <p className="text-sm text-text-secondary mt-0.5">
- We found an unsaved project
- </p>
- </div>
+ <Dialog open onOpenChange={(open) => !open && onDismiss()}>
+ <DialogContent className="max-w-md p-0 gap-0 bg-background-secondary border-border overflow-hidden">
+ <DialogHeader className="p-5 border-b border-border space-y-0">
+ <div className="flex items-center gap-3">
+ <div className="p-2.5 bg-primary/10 rounded-xl shrink-0">
+ <RotateCcw className="w-5 h-5 text-primary" />
+ </div>
+ <div>
+ <DialogTitle className="text-base font-semibold text-text-primary">
+ Recover Your Work
+ </DialogTitle>
+ <DialogDescription className="text-sm text-text-secondary mt-0.5">
+ We found an unsaved project
+ </DialogDescription>
</div>
- <button
- onClick={onDismiss}
- className="p-2 rounded-lg text-text-muted hover:text-text-primary hover:bg-background-tertiary transition-colors shrink-0"
- >
- <X className="w-4 h-4" />
- </button>
</div>
- </div>
+ </DialogHeader>
<div className="p-5">
<button
@@ -103,65 +101,65 @@ export const RecoveryDialog: React.FC<RecoveryDialogProps> = ({
</button>
<div className="flex gap-3">
- <button
+ <Button
+ variant="outline"
onClick={onDismiss}
- className="flex-1 px-4 py-2.5 rounded-lg font-medium text-sm text-text-secondary bg-background-tertiary border border-border hover:bg-background-elevated hover:text-text-primary active:scale-[0.98] transition-all"
+ className="flex-1"
>
Start Fresh
- </button>
- <button
+ </Button>
+ <Button
onClick={() => handleRecover(mostRecent.id)}
disabled={selectedSave === mostRecent.id}
- className="flex-1 px-4 py-2.5 rounded-lg font-medium text-sm text-white bg-primary hover:bg-primary-hover active:scale-[0.98] transition-all disabled:opacity-70 disabled:cursor-not-allowed"
+ className="flex-1"
>
{selectedSave === mostRecent.id ? "Recovering..." : "Recover Project"}
- </button>
+ </Button>
</div>
{olderSaves.length > 0 && (
- <div className="mt-4 pt-4 border-t border-border">
- <button
- onClick={() => setShowOlderSaves(!showOlderSaves)}
- className="flex items-center gap-2 text-sm text-text-muted hover:text-text-secondary transition-colors w-full"
- >
+ <Collapsible
+ open={showOlderSaves}
+ onOpenChange={setShowOlderSaves}
+ className="mt-4 pt-4 border-t border-border"
+ >
+ <CollapsibleTrigger className="flex items-center gap-2 text-sm text-text-muted hover:text-text-secondary transition-colors w-full">
<ChevronDown
className={`w-4 h-4 transition-transform duration-200 ${showOlderSaves ? "rotate-180" : ""}`}
/>
<span>
{olderSaves.length} older {olderSaves.length === 1 ? "save" : "saves"} available
</span>
- </button>
+ </CollapsibleTrigger>
- {showOlderSaves && (
- <div className="mt-3 space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin">
- {olderSaves.map((save) => (
- <button
- key={save.id}
- onClick={() => handleRecover(save.id)}
- disabled={selectedSave === save.id}
- className="w-full text-left p-3 rounded-lg bg-background-tertiary border border-border hover:border-border-hover hover:bg-background-elevated transition-all group disabled:opacity-70"
- >
- <div className="flex items-center justify-between gap-2">
- <div className="flex-1 min-w-0">
- <div className="text-sm font-medium text-text-primary truncate group-hover:text-primary transition-colors">
- {save.projectName}
- </div>
- <div className="text-xs text-text-muted mt-1">
- {formatDate(save.timestamp)}
- </div>
+ <CollapsibleContent className="mt-3 space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin">
+ {olderSaves.map((save) => (
+ <button
+ key={save.id}
+ onClick={() => handleRecover(save.id)}
+ disabled={selectedSave === save.id}
+ className="w-full text-left p-3 rounded-lg bg-background-tertiary border border-border hover:border-border-hover hover:bg-background-elevated transition-all group disabled:opacity-70"
+ >
+ <div className="flex items-center justify-between gap-2">
+ <div className="flex-1 min-w-0">
+ <div className="text-sm font-medium text-text-primary truncate group-hover:text-primary transition-colors">
+ {save.projectName}
</div>
- <div className="text-xs text-text-muted/70 shrink-0">
- {formatTimeAgo(save.timestamp)}
+ <div className="text-xs text-text-muted mt-1">
+ {formatDate(save.timestamp)}
</div>
</div>
- </button>
- ))}
- </div>
- )}
- </div>
+ <div className="text-xs text-text-muted/70 shrink-0">
+ {formatTimeAgo(save.timestamp)}
+ </div>
+ </div>
+ </button>
+ ))}
+ </CollapsibleContent>
+ </Collapsible>
)}
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/apps/web/src/components/welcome/StartFromScratch.tsx b/apps/web/src/components/welcome/StartFromScratch.tsx
index 2ef58dad..98ea07fd 100644
--- a/apps/web/src/components/welcome/StartFromScratch.tsx
+++ b/apps/web/src/components/welcome/StartFromScratch.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useCallback } from "react";
+import { useState, useCallback } from "react";
import {
Smartphone,
Monitor,
@@ -7,6 +7,7 @@ import {
Check,
Info,
} from "lucide-react";
+import { Button, Input, Label } from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import {
SOCIAL_MEDIA_PRESETS,
@@ -91,15 +92,15 @@ export const StartFromScratch: React.FC<StartFromScratchProps> = ({
return (
<div className="space-y-6">
<div>
- <h3 className="text-sm font-medium text-text-primary mb-2">
+ <Label className="text-sm font-medium text-text-primary mb-2 block">
Project Name
- </h3>
- <input
+ </Label>
+ <Input
type="text"
value={projectName}
onChange={(e) => setProjectName(e.target.value)}
placeholder="My Awesome Video"
- className="w-full max-w-md px-4 py-2.5 text-sm bg-background-tertiary border border-border rounded-lg focus:border-primary focus:outline-none text-text-primary placeholder:text-text-muted transition-all"
+ className="max-w-md bg-background-tertiary border-border text-text-primary"
/>
</div>
@@ -188,10 +189,10 @@ export const StartFromScratch: React.FC<StartFromScratchProps> = ({
</div>
<div className="flex items-center justify-end gap-3">
- <button
+ <Button
onClick={handleCreate}
disabled={isCreating}
- className="px-6 py-2.5 bg-primary text-black text-sm font-medium rounded-lg hover:bg-primary-hover active:bg-primary-active transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 shadow-glow"
+ className="shadow-glow"
>
{isCreating ? (
<>
@@ -204,7 +205,7 @@ export const StartFromScratch: React.FC<StartFromScratchProps> = ({
<ChevronRight size={16} />
</>
)}
- </button>
+ </Button>
</div>
</div>
);
diff --git a/apps/web/src/components/welcome/TemplateGallery.tsx b/apps/web/src/components/welcome/TemplateGallery.tsx
index 0d40fd57..86486f09 100644
--- a/apps/web/src/components/welcome/TemplateGallery.tsx
+++ b/apps/web/src/components/welcome/TemplateGallery.tsx
@@ -1,5 +1,6 @@
import React, { useState, useCallback, useMemo, useEffect } from "react";
import { Search, Loader2, Sparkles } from "lucide-react";
+import { Input } from "@openreel/ui";
import { useEngineStore } from "../../stores/engine-store";
import {
SOCIAL_MEDIA_CATEGORY_INFO,
@@ -170,14 +171,14 @@ export const TemplateGallery: React.FC<TemplateGalleryProps> = ({
<div className="relative flex-1 max-w-md">
<Search
size={18}
- className="absolute left-4 top-1/2 -translate-y-1/2 text-text-muted"
+ className="absolute left-4 top-1/2 -translate-y-1/2 text-text-muted z-10"
/>
- <input
+ <Input
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder="Search templates..."
- className="w-full pl-11 pr-4 py-3 text-sm bg-background-tertiary border border-border rounded-xl focus:border-primary focus:outline-none text-text-primary placeholder:text-text-muted transition-all duration-200"
+ className="pl-11 bg-background-tertiary border-border rounded-xl text-text-primary"
/>
</div>
</div>
diff --git a/apps/web/src/components/welcome/TemplatePreviewModal.tsx b/apps/web/src/components/welcome/TemplatePreviewModal.tsx
index baedc0c3..2fa527b5 100644
--- a/apps/web/src/components/welcome/TemplatePreviewModal.tsx
+++ b/apps/web/src/components/welcome/TemplatePreviewModal.tsx
@@ -1,6 +1,5 @@
-import React, { useState, useCallback, useMemo } from "react";
+import { useState, useCallback, useMemo } from "react";
import {
- X,
Play,
Clock,
Layers,
@@ -13,6 +12,21 @@ import {
Hash,
Music,
} from "lucide-react";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ Button,
+ Collapsible,
+ CollapsibleTrigger,
+ CollapsibleContent,
+ Input,
+ Switch,
+ Label,
+ Slider,
+} from "@openreel/ui";
import { useEngineStore } from "../../stores/engine-store";
import { useProjectStore } from "../../stores/project-store";
import type {
@@ -56,6 +70,7 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
const [values, setValues] = useState<ScriptableTemplateReplacements>({});
const [isApplying, setIsApplying] = useState(false);
const [error, setError] = useState<string | null>(null);
+ const [showAdvanced, setShowAdvanced] = useState(false);
const groupedPlaceholders = useMemo(() => {
const groups: Record<string, ExtendedPlaceholder[]> = {
@@ -178,13 +193,13 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
};
return (
- <div className="fixed inset-0 bg-black/70 z-[60] flex items-center justify-center p-4">
- <div className="bg-background-secondary rounded-2xl border border-border max-w-3xl w-full max-h-[90vh] overflow-hidden flex flex-col shadow-2xl">
- <div className="flex items-center justify-between p-5 border-b border-border">
- <div>
- <h2 className="text-lg font-semibold text-text-primary">
- {template.name}
- </h2>
+ <Dialog open onOpenChange={(open) => !open && onClose()}>
+ <DialogContent className="max-w-3xl max-h-[90vh] p-0 gap-0 bg-background-secondary border-border overflow-hidden flex flex-col">
+ <DialogHeader className="p-5 border-b border-border space-y-0 shrink-0">
+ <DialogTitle className="text-lg font-semibold text-text-primary">
+ {template.name}
+ </DialogTitle>
+ <DialogDescription asChild>
<div className="flex items-center gap-4 mt-1.5">
<div className="flex items-center gap-1.5 text-xs text-text-muted">
<Clock size={12} />
@@ -195,14 +210,8 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
<span>{template.placeholders.length} editable fields</span>
</div>
</div>
- </div>
- <button
- onClick={onClose}
- className="p-2 text-text-muted hover:text-text-primary transition-colors rounded-lg hover:bg-background-tertiary"
- >
- <X size={20} />
- </button>
- </div>
+ </DialogDescription>
+ </DialogHeader>
<div className="flex-1 overflow-y-auto p-5">
<div className="grid md:grid-cols-2 gap-6">
@@ -280,15 +289,15 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
)}
{groupedPlaceholders.advanced.length > 0 && (
- <details className="group">
- <summary className="text-xs text-text-muted cursor-pointer hover:text-text-secondary transition-colors flex items-center gap-1">
+ <Collapsible open={showAdvanced} onOpenChange={setShowAdvanced}>
+ <CollapsibleTrigger className="text-xs text-text-muted cursor-pointer hover:text-text-secondary transition-colors flex items-center gap-1">
<ChevronRight
size={12}
- className="group-open:rotate-90 transition-transform"
+ className={`transition-transform ${showAdvanced ? "rotate-90" : ""}`}
/>
Advanced Options ({groupedPlaceholders.advanced.length})
- </summary>
- <div className="mt-4 space-y-4 pl-4 border-l border-border">
+ </CollapsibleTrigger>
+ <CollapsibleContent className="mt-4 space-y-4 pl-4 border-l border-border">
{groupedPlaceholders.advanced.map((placeholder) => (
<PlaceholderInput
key={placeholder.id}
@@ -303,8 +312,8 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
}
/>
))}
- </div>
- </details>
+ </CollapsibleContent>
+ </Collapsible>
)}
{error && (
@@ -316,17 +325,14 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
</div>
</div>
- <div className="p-5 border-t border-border flex items-center justify-end gap-3">
- <button
- onClick={onClose}
- className="px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors rounded-lg hover:bg-background-tertiary"
- >
+ <div className="p-5 border-t border-border flex items-center justify-end gap-3 shrink-0">
+ <Button variant="ghost" onClick={onClose}>
Cancel
- </button>
- <button
+ </Button>
+ <Button
onClick={handleApply}
disabled={isApplying}
- className="px-6 py-2.5 bg-primary text-black text-sm font-medium rounded-lg hover:bg-primary-hover active:bg-primary-active transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 shadow-glow"
+ className="shadow-glow"
>
{isApplying ? (
<>
@@ -339,10 +345,10 @@ export const TemplatePreviewModal: React.FC<TemplatePreviewModalProps> = ({
<ChevronRight size={16} />
</>
)}
- </button>
+ </Button>
</div>
- </div>
- </div>
+ </DialogContent>
+ </Dialog>
);
};
@@ -363,7 +369,7 @@ const PlaceholderInput: React.FC<PlaceholderInputProps> = ({
const renderInput = () => {
switch (placeholder.type) {
case "text":
- case "subtitle":
+ case "subtitle": {
const maxLength = placeholder.constraints?.maxLength;
return (
<div className="space-y-1">
@@ -382,24 +388,24 @@ const PlaceholderInput: React.FC<PlaceholderInputProps> = ({
)}
</div>
);
+ }
- case "number":
- const min = placeholder.constraints?.min;
- const max = placeholder.constraints?.max;
+ case "number": {
+ const min = placeholder.constraints?.min ?? 0;
+ const max = placeholder.constraints?.max ?? 100;
const step = placeholder.constraints?.step || 1;
const inputType = placeholder.uiHints?.inputType;
if (inputType === "slider") {
return (
<div className="flex items-center gap-3">
- <input
- type="range"
- value={Number(displayValue) || 0}
- onChange={(e) => onChange(Number(e.target.value))}
+ <Slider
+ value={[Number(displayValue) || 0]}
+ onValueChange={(vals) => onChange(vals[0])}
min={min}
max={max}
step={step}
- className="flex-1 accent-primary"
+ className="flex-1"
/>
<span className="text-xs text-text-muted w-12 text-right font-mono">
{Number(displayValue).toFixed(step < 1 ? 1 : 0)}
@@ -409,33 +415,29 @@ const PlaceholderInput: React.FC<PlaceholderInputProps> = ({
}
return (
- <input
+ <Input
type="number"
value={Number(displayValue) || 0}
onChange={(e) => onChange(Number(e.target.value))}
min={min}
max={max}
step={step}
- className="w-full px-3 py-2.5 text-sm bg-background-tertiary border border-border rounded-lg focus:border-primary focus:outline-none text-text-primary transition-colors"
+ className="bg-background-tertiary border-border text-text-primary"
/>
);
+ }
case "boolean":
return (
- <label className="flex items-center gap-3 cursor-pointer">
- <div className="relative inline-flex items-center">
- <input
- type="checkbox"
- checked={Boolean(displayValue)}
- onChange={(e) => onChange(e.target.checked)}
- className="sr-only peer"
- />
- <div className="w-9 h-5 bg-background-tertiary peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-text-muted after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary peer-checked:after:bg-black" />
- </div>
- <span className="text-sm text-text-secondary">
+ <div className="flex items-center gap-3">
+ <Switch
+ checked={Boolean(displayValue)}
+ onCheckedChange={(checked) => onChange(checked)}
+ />
+ <Label className="text-sm text-text-secondary cursor-pointer">
{placeholder.description || "Enabled"}
- </span>
- </label>
+ </Label>
+ </div>
);
case "color":
@@ -447,24 +449,24 @@ const PlaceholderInput: React.FC<PlaceholderInputProps> = ({
onChange={(e) => onChange(e.target.value)}
className="w-10 h-10 rounded-lg cursor-pointer border border-border"
/>
- <input
+ <Input
type="text"
value={String(displayValue) || "#000000"}
onChange={(e) => onChange(e.target.value)}
placeholder="#000000"
- className="flex-1 px-3 py-2.5 text-sm bg-background-tertiary border border-border rounded-lg focus:border-primary focus:outline-none text-text-primary font-mono transition-colors"
+ className="flex-1 bg-background-tertiary border-border text-text-primary font-mono"
/>
</div>
);
default:
return (
- <input
+ <Input
type="text"
value={String(displayValue)}
onChange={(e) => onChange(e.target.value)}
placeholder={String(placeholder.defaultValue || "")}
- className="w-full px-3 py-2.5 text-sm bg-background-tertiary border border-border rounded-lg focus:border-primary focus:outline-none text-text-primary transition-colors"
+ className="bg-background-tertiary border-border text-text-primary"
/>
);
}
diff --git a/apps/web/src/components/welcome/WelcomeScreen.tsx b/apps/web/src/components/welcome/WelcomeScreen.tsx
index 3378a4a1..e93be62b 100644
--- a/apps/web/src/components/welcome/WelcomeScreen.tsx
+++ b/apps/web/src/components/welcome/WelcomeScreen.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useCallback, useEffect } from "react";
+import { useState, useCallback, useEffect } from "react";
import {
Clock,
Sparkles,
@@ -8,6 +8,7 @@ import {
Square,
FolderOpen,
} from "lucide-react";
+import { Button, Switch, Label } from "@openreel/ui";
import { useProjectStore } from "../../stores/project-store";
import { useUIStore } from "../../stores/ui-store";
import { SOCIAL_MEDIA_PRESETS, type SocialMediaCategory } from "@openreel/core";
@@ -189,13 +190,14 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({ initialTab }) => {
return (
<div className="fixed inset-0 z-50 bg-background flex flex-col">
<header className="flex items-center justify-between px-6 py-4 border-b border-border">
- <button
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => setViewMode("home")}
- className="flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
>
<ArrowRight className="rotate-180" size={16} />
Back
- </button>
+ </Button>
<h2 className="text-sm font-medium text-text-primary">Templates</h2>
<div className="w-16" />
</header>
@@ -210,13 +212,14 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({ initialTab }) => {
return (
<div className="fixed inset-0 z-50 bg-background flex flex-col">
<header className="flex items-center justify-between px-6 py-4 border-b border-border">
- <button
+ <Button
+ variant="ghost"
+ size="sm"
onClick={() => setViewMode("home")}
- className="flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
>
<ArrowRight className="rotate-180" size={16} />
Back
- </button>
+ </Button>
<h2 className="text-sm font-medium text-text-primary">
Recent Projects
</h2>
@@ -325,46 +328,47 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({ initialTab }) => {
</div>
<div className="flex items-center justify-center gap-3">
- <button
+ <Button
+ variant="outline"
onClick={() => setViewMode("templates")}
- className="flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-text-secondary hover:text-text-primary bg-background-secondary hover:bg-background-tertiary border border-border hover:border-border-hover rounded-xl transition-all duration-150"
+ className="rounded-xl"
>
<Sparkles size={16} />
Browse templates
- </button>
- <button
+ </Button>
+ <Button
+ variant="outline"
onClick={() => setViewMode("recent")}
- className="flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-text-secondary hover:text-text-primary bg-background-secondary hover:bg-background-tertiary border border-border hover:border-border-hover rounded-xl transition-all duration-150"
+ className="rounded-xl"
>
<Clock size={16} />
Recent projects
- </button>
- <button
+ </Button>
+ <Button
+ variant="outline"
onClick={() => navigate("editor")}
- className="flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-text-secondary hover:text-text-primary bg-background-secondary hover:bg-background-tertiary border border-border hover:border-border-hover rounded-xl transition-all duration-150"
+ className="rounded-xl"
>
<FolderOpen size={16} />
Open editor
- </button>
+ </Button>
</div>
</div>
<div className="absolute bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-4">
- <label className="flex items-center gap-2 cursor-pointer group">
- <div className="relative">
- <input
- type="checkbox"
- checked={skipWelcomeScreen}
- onChange={(e) => setSkipWelcomeScreen(e.target.checked)}
- className="sr-only peer"
- />
- <div className="w-8 h-[18px] bg-background-tertiary rounded-full peer-checked:bg-primary/80 transition-colors border border-border" />
- <div className="absolute top-[3px] left-[3px] w-[12px] h-[12px] bg-text-muted rounded-full peer-checked:translate-x-[14px] peer-checked:bg-white transition-all" />
- </div>
- <span className="text-xs text-text-muted group-hover:text-text-secondary transition-colors">
+ <div className="flex items-center gap-2">
+ <Switch
+ id="skip-welcome"
+ checked={skipWelcomeScreen}
+ onCheckedChange={setSkipWelcomeScreen}
+ />
+ <Label
+ htmlFor="skip-welcome"
+ className="text-xs text-text-muted cursor-pointer"
+ >
Skip on startup
- </span>
- </label>
+ </Label>
+ </div>
<span className="text-text-muted/30">·</span>
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 7c606065..a232b88d 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -5,59 +5,107 @@
@tailwind components;
@tailwind utilities;
-:root {
- font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
- sans-serif;
- line-height: 1.5;
- font-weight: 400;
-
- /* Light theme colors */
- --color-background: 255 255 255; /* White */
- --color-background-secondary: 249 250 251; /* Gray-50 */
- --color-background-tertiary: 243 244 246; /* Gray-100 */
- --color-background-elevated: 229 231 235; /* Gray-200 */
-
- --color-text-primary: 24 24 27; /* Zinc-900 */
- --color-text-secondary: 113 113 122; /* Zinc-500 */
- --color-text-muted: 161 161 170; /* Zinc-400 */
-
- --color-border: 228 228 231; /* Zinc-200 */
- --color-border-hover: 212 212 216; /* Zinc-300 */
- --color-border-active: 161 161 170; /* Zinc-400 */
-
- color-scheme: light;
- color: rgb(var(--color-text-primary));
- background-color: rgb(var(--color-background));
-}
-
-/* Dark theme colors */
-.dark {
- --color-background: 15 15 17; /* Very dark */
- --color-background-secondary: 24 24 27; /* Zinc-900 */
- --color-background-tertiary: 39 39 42; /* Zinc-800 */
- --color-background-elevated: 63 63 70; /* Zinc-700 */
-
- --color-text-primary: 244 244 245; /* Zinc-100 */
- --color-text-secondary: 161 161 170; /* Zinc-400 */
- --color-text-muted: 113 113 122; /* Zinc-500 */
-
- --color-border: 39 39 42; /* Zinc-800 */
- --color-border-hover: 63 63 70; /* Zinc-700 */
- --color-border-active: 82 82 91; /* Zinc-600 */
-
- color-scheme: dark;
- color: rgb(var(--color-text-primary));
- background-color: rgb(var(--color-background));
+@layer base {
+ :root {
+ font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
+ sans-serif;
+ line-height: 1.5;
+ font-weight: 400;
+
+ /* OpenReel custom colors */
+ --color-background: 255 255 255;
+ --color-background-secondary: 249 250 251;
+ --color-background-tertiary: 243 244 246;
+ --color-background-elevated: 229 231 235;
+
+ --color-text-primary: 24 24 27;
+ --color-text-secondary: 113 113 122;
+ --color-text-muted: 161 161 170;
+
+ --color-border: 228 228 231;
+ --color-border-hover: 212 212 216;
+ --color-border-active: 161 161 170;
+
+ /* shadcn/ui CSS variables */
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 240 10% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+ --primary: 142 71% 45%;
+ --primary-foreground: 0 0% 100%;
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: 240 5.9% 10%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+ --ring: 142 71% 45%;
+ --radius: 0.5rem;
+
+ color-scheme: light;
+ color: rgb(var(--color-text-primary));
+ background-color: rgb(var(--color-background));
+ }
+
+ .dark {
+ /* OpenReel custom colors */
+ --color-background: 15 15 17;
+ --color-background-secondary: 24 24 27;
+ --color-background-tertiary: 39 39 42;
+ --color-background-elevated: 63 63 70;
+
+ --color-text-primary: 244 244 245;
+ --color-text-secondary: 161 161 170;
+ --color-text-muted: 113 113 122;
+
+ --color-border: 39 39 42;
+ --color-border-hover: 63 63 70;
+ --color-border-active: 82 82 91;
+
+ /* shadcn/ui CSS variables */
+ --background: 240 6% 6%;
+ --foreground: 0 0% 95%;
+ --card: 240 6% 10%;
+ --card-foreground: 0 0% 95%;
+ --popover: 240 6% 10%;
+ --popover-foreground: 0 0% 95%;
+ --primary: 142 71% 45%;
+ --primary-foreground: 0 0% 100%;
+ --secondary: 240 4% 16%;
+ --secondary-foreground: 0 0% 95%;
+ --muted: 240 4% 16%;
+ --muted-foreground: 240 5% 65%;
+ --accent: 240 4% 16%;
+ --accent-foreground: 0 0% 95%;
+ --destructive: 0 62% 50%;
+ --destructive-foreground: 0 0% 95%;
+ --border: 240 4% 20%;
+ --input: 240 4% 20%;
+ --ring: 142 71% 45%;
+
+ color-scheme: dark;
+ color: rgb(var(--color-text-primary));
+ background-color: rgb(var(--color-background));
+ }
+
+ * {
+ @apply border-border;
+ }
}
body {
margin: 0;
min-width: 320px;
min-height: 100vh;
- overflow: hidden; /* App-like feel */
+ overflow: hidden;
}
-/* Custom Scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
@@ -76,7 +124,6 @@ body {
background: rgb(var(--color-border-active));
}
-/* Base Input Styles */
input,
select,
textarea {
@@ -96,7 +143,6 @@ textarea:focus {
box-shadow: 0 0 0 1px #22c55e;
}
-/* Base Button Styles */
button {
cursor: pointer;
}
diff --git a/apps/web/tailwind.config.js b/apps/web/tailwind.config.js
index d2d3fcac..4fcb2a5c 100644
--- a/apps/web/tailwind.config.js
+++ b/apps/web/tailwind.config.js
@@ -1,37 +1,64 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
- darkMode: 'class', // Enable dark mode with class strategy
+ content: [
+ "./index.html",
+ "./src/**/*.{js,ts,jsx,tsx}",
+ "../../packages/ui/src/**/*.{js,ts,jsx,tsx}",
+ ],
+ darkMode: 'class',
theme: {
extend: {
colors: {
- // Background palette (adapts to theme)
background: {
- DEFAULT: "rgb(var(--color-background) / <alpha-value>)",
+ DEFAULT: "hsl(var(--background))",
secondary: "rgb(var(--color-background-secondary) / <alpha-value>)",
tertiary: "rgb(var(--color-background-tertiary) / <alpha-value>)",
elevated: "rgb(var(--color-background-elevated) / <alpha-value>)",
},
- // Primary accent color (Green)
+ foreground: "hsl(var(--foreground))",
+ card: {
+ DEFAULT: "hsl(var(--card))",
+ foreground: "hsl(var(--card-foreground))",
+ },
+ popover: {
+ DEFAULT: "hsl(var(--popover))",
+ foreground: "hsl(var(--popover-foreground))",
+ },
primary: {
- DEFAULT: "#22c55e", // Green-500
- hover: "#16a34a", // Green-600
- active: "#15803d", // Green-700
+ DEFAULT: "hsl(var(--primary))",
+ foreground: "hsl(var(--primary-foreground))",
+ hover: "#16a34a",
+ active: "#15803d",
glow: "rgba(34, 197, 94, 0.5)",
},
- // Text colors (adapts to theme)
- text: {
- primary: "rgb(var(--color-text-primary) / <alpha-value>)",
- secondary: "rgb(var(--color-text-secondary) / <alpha-value>)",
- muted: "rgb(var(--color-text-muted) / <alpha-value>)",
+ secondary: {
+ DEFAULT: "hsl(var(--secondary))",
+ foreground: "hsl(var(--secondary-foreground))",
+ },
+ muted: {
+ DEFAULT: "hsl(var(--muted))",
+ foreground: "hsl(var(--muted-foreground))",
+ },
+ accent: {
+ DEFAULT: "hsl(var(--accent))",
+ foreground: "hsl(var(--accent-foreground))",
+ },
+ destructive: {
+ DEFAULT: "hsl(var(--destructive))",
+ foreground: "hsl(var(--destructive-foreground))",
},
- // Border colors (adapts to theme)
border: {
- DEFAULT: "rgb(var(--color-border) / <alpha-value>)",
+ DEFAULT: "hsl(var(--border))",
hover: "rgb(var(--color-border-hover) / <alpha-value>)",
active: "rgb(var(--color-border-active) / <alpha-value>)",
},
- // Status colors
+ input: "hsl(var(--input))",
+ ring: "hsl(var(--ring))",
+ text: {
+ primary: "rgb(var(--color-text-primary) / <alpha-value>)",
+ secondary: "rgb(var(--color-text-secondary) / <alpha-value>)",
+ muted: "rgb(var(--color-text-muted) / <alpha-value>)",
+ },
status: {
success: "#22c55e",
warning: "#eab308",
@@ -49,10 +76,27 @@ export default {
'panel': '0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15)',
},
borderRadius: {
+ lg: "var(--radius)",
+ md: "calc(var(--radius) - 2px)",
+ sm: "calc(var(--radius) - 4px)",
'xl': '0.75rem',
'2xl': '1rem',
- }
+ },
+ keyframes: {
+ "accordion-down": {
+ from: { height: "0" },
+ to: { height: "var(--radix-accordion-content-height)" },
+ },
+ "accordion-up": {
+ from: { height: "var(--radix-accordion-content-height)" },
+ to: { height: "0" },
+ },
+ },
+ animation: {
+ "accordion-down": "accordion-down 0.2s ease-out",
+ "accordion-up": "accordion-up 0.2s ease-out",
+ },
},
},
- plugins: [],
+ plugins: [require("tailwindcss-animate")],
};
diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json
index 3c8d313e..6d55ce47 100644
--- a/apps/web/tsconfig.json
+++ b/apps/web/tsconfig.json
@@ -10,7 +10,9 @@
"paths": {
"@/*": ["./src/*"],
"@openreel/core": ["../../packages/core/src/index.ts"],
- "@openreel/core/*": ["../../packages/core/src/*"]
+ "@openreel/core/*": ["../../packages/core/src/*"],
+ "@openreel/ui": ["../../packages/ui/src/index.ts"],
+ "@openreel/ui/*": ["../../packages/ui/src/*"]
}
},
"include": ["src"]
diff --git a/packages/ui/components.json b/packages/ui/components.json
new file mode 100644
index 00000000..42edfd97
--- /dev/null
+++ b/packages/ui/components.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "default",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "",
+ "css": "src/styles/globals.css",
+ "baseColor": "neutral"
+ },
+ "aliases": {
+ "components": "@openreel/ui/components",
+ "utils": "@openreel/ui/lib/utils",
+ "hooks": "@openreel/ui/hooks",
+ "ui": "@openreel/ui/components",
+ "lib": "@openreel/ui/lib"
+ }
+}
diff --git a/packages/ui/package.json b/packages/ui/package.json
new file mode 100644
index 00000000..8547c1ee
--- /dev/null
+++ b/packages/ui/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "@openreel/ui",
+ "version": "0.0.1",
+ "private": true,
+ "type": "module",
+ "main": "./src/index.ts",
+ "types": "./src/index.ts",
+ "exports": {
+ ".": {
+ "import": "./src/index.ts",
+ "types": "./src/index.ts"
+ },
+ "./components/*": {
+ "import": "./src/components/*.tsx",
+ "types": "./src/components/*.tsx"
+ },
+ "./hooks/*": {
+ "import": "./src/hooks/*.tsx",
+ "types": "./src/hooks/*.tsx"
+ },
+ "./lib/*": {
+ "import": "./src/lib/*.ts",
+ "types": "./src/lib/*.ts"
+ },
+ "./styles/*": "./src/styles/*"
+ },
+ "scripts": {
+ "typecheck": "tsc --noEmit"
+ },
+ "peerDependencies": {
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ },
+ "dependencies": {
+ "@radix-ui/react-collapsible": "^1.1.12",
+ "@radix-ui/react-context-menu": "^2.2.16",
+ "@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
+ "@radix-ui/react-label": "^2.1.8",
+ "@radix-ui/react-popover": "^1.1.15",
+ "@radix-ui/react-select": "^2.2.6",
+ "@radix-ui/react-slider": "^1.3.6",
+ "@radix-ui/react-slot": "^1.2.3",
+ "@radix-ui/react-switch": "^1.2.6",
+ "@radix-ui/react-tabs": "^1.1.13",
+ "@radix-ui/react-toggle": "^1.1.10",
+ "@radix-ui/react-toggle-group": "^1.1.11",
+ "@radix-ui/react-tooltip": "^1.2.8",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "lucide-react": "^0.555.0",
+ "tailwind-merge": "^3.4.0"
+ },
+ "devDependencies": {
+ "@types/react": "^18.3.3",
+ "@types/react-dom": "^18.3.0",
+ "typescript": "^5.4.5"
+ }
+}
diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsx
new file mode 100644
index 00000000..b265351e
--- /dev/null
+++ b/packages/ui/src/components/button.tsx
@@ -0,0 +1,58 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-white hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ "icon-sm": "h-8 w-8 [&_svg]:size-4",
+ "icon-xs": "h-6 w-6 [&_svg]:size-3.5",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean
+}
+
+const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+ <Comp
+ className={cn(buttonVariants({ variant, size, className }))}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Button.displayName = "Button"
+
+export { Button, buttonVariants }
diff --git a/packages/ui/src/components/collapsible.tsx b/packages/ui/src/components/collapsible.tsx
new file mode 100644
index 00000000..9fa48946
--- /dev/null
+++ b/packages/ui/src/components/collapsible.tsx
@@ -0,0 +1,11 @@
+"use client"
+
+import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
+
+const Collapsible = CollapsiblePrimitive.Root
+
+const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
+
+const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
+
+export { Collapsible, CollapsibleTrigger, CollapsibleContent }
diff --git a/packages/ui/src/components/context-menu.tsx b/packages/ui/src/components/context-menu.tsx
new file mode 100644
index 00000000..8dfc5792
--- /dev/null
+++ b/packages/ui/src/components/context-menu.tsx
@@ -0,0 +1,198 @@
+import * as React from "react"
+import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
+import { Check, ChevronRight, Circle } from "lucide-react"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const ContextMenu = ContextMenuPrimitive.Root
+
+const ContextMenuTrigger = ContextMenuPrimitive.Trigger
+
+const ContextMenuGroup = ContextMenuPrimitive.Group
+
+const ContextMenuPortal = ContextMenuPrimitive.Portal
+
+const ContextMenuSub = ContextMenuPrimitive.Sub
+
+const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
+
+const ContextMenuSubTrigger = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
+ inset?: boolean
+ }
+>(({ className, inset, children, ...props }, ref) => (
+ <ContextMenuPrimitive.SubTrigger
+ ref={ref}
+ className={cn(
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRight className="ml-auto h-4 w-4" />
+ </ContextMenuPrimitive.SubTrigger>
+))
+ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
+
+const ContextMenuSubContent = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
+>(({ className, ...props }, ref) => (
+ <ContextMenuPrimitive.SubContent
+ ref={ref}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+))
+ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
+
+const ContextMenuContent = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
+>(({ className, ...props }, ref) => (
+ <ContextMenuPrimitive.Portal>
+ <ContextMenuPrimitive.Content
+ ref={ref}
+ className={cn(
+ "z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+ </ContextMenuPrimitive.Portal>
+))
+ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
+
+const ContextMenuItem = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
+ inset?: boolean
+ }
+>(({ className, inset, ...props }, ref) => (
+ <ContextMenuPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+))
+ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
+
+const ContextMenuCheckboxItem = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
+>(({ className, children, checked, ...props }, ref) => (
+ <ContextMenuPrimitive.CheckboxItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <ContextMenuPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </ContextMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </ContextMenuPrimitive.CheckboxItem>
+))
+ContextMenuCheckboxItem.displayName =
+ ContextMenuPrimitive.CheckboxItem.displayName
+
+const ContextMenuRadioItem = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
+>(({ className, children, ...props }, ref) => (
+ <ContextMenuPrimitive.RadioItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <ContextMenuPrimitive.ItemIndicator>
+ <Circle className="h-2 w-2 fill-current" />
+ </ContextMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </ContextMenuPrimitive.RadioItem>
+))
+ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
+
+const ContextMenuLabel = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
+ inset?: boolean
+ }
+>(({ className, inset, ...props }, ref) => (
+ <ContextMenuPrimitive.Label
+ ref={ref}
+ className={cn(
+ "px-2 py-1.5 text-sm font-semibold text-foreground",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+))
+ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
+
+const ContextMenuSeparator = React.forwardRef<
+ React.ElementRef<typeof ContextMenuPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <ContextMenuPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
+ {...props}
+ />
+))
+ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
+
+const ContextMenuShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+ContextMenuShortcut.displayName = "ContextMenuShortcut"
+
+export {
+ ContextMenu,
+ ContextMenuTrigger,
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuCheckboxItem,
+ ContextMenuRadioItem,
+ ContextMenuLabel,
+ ContextMenuSeparator,
+ ContextMenuShortcut,
+ ContextMenuGroup,
+ ContextMenuPortal,
+ ContextMenuSub,
+ ContextMenuSubContent,
+ ContextMenuSubTrigger,
+ ContextMenuRadioGroup,
+}
diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx
new file mode 100644
index 00000000..3a5b3ada
--- /dev/null
+++ b/packages/ui/src/components/dialog.tsx
@@ -0,0 +1,125 @@
+import * as React from "react"
+import * as DialogPrimitive from "@radix-ui/react-dialog"
+import { X } from "lucide-react"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Dialog = DialogPrimitive.Root
+
+const DialogTrigger = DialogPrimitive.Trigger
+
+const DialogPortal = DialogPrimitive.Portal
+
+const DialogClose = DialogPrimitive.Close
+
+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-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ className
+ )}
+ {...props}
+ />
+))
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+
+const DialogContent = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <DialogPortal>
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed z-50 grid w-full max-w-lg gap-4 border bg-background 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 sm:rounded-lg",
+ className
+ )}
+ style={{
+ left: '50%',
+ top: '50%',
+ transform: 'translate(-50%, -50%)',
+ }}
+ {...props}
+ >
+ {children}
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
+ <X className="h-4 w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ </DialogPrimitive.Content>
+ </DialogPortal>
+))
+DialogContent.displayName = DialogPrimitive.Content.displayName
+
+const DialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-1.5 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+)
+DialogHeader.displayName = "DialogHeader"
+
+const DialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+)
+DialogFooter.displayName = "DialogFooter"
+
+const DialogTitle = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Title
+ ref={ref}
+ className={cn(
+ "text-lg font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+))
+DialogTitle.displayName = DialogPrimitive.Title.displayName
+
+const DialogDescription = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+))
+DialogDescription.displayName = DialogPrimitive.Description.displayName
+
+export {
+ Dialog,
+ DialogPortal,
+ DialogOverlay,
+ DialogClose,
+ DialogTrigger,
+ DialogContent,
+ DialogHeader,
+ DialogFooter,
+ DialogTitle,
+ DialogDescription,
+}
diff --git a/packages/ui/src/components/dropdown-menu.tsx b/packages/ui/src/components/dropdown-menu.tsx
new file mode 100644
index 00000000..f19d01ce
--- /dev/null
+++ b/packages/ui/src/components/dropdown-menu.tsx
@@ -0,0 +1,200 @@
+"use client"
+
+import * as React from "react"
+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
+import { Check, ChevronRight, Circle } from "lucide-react"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const DropdownMenu = DropdownMenuPrimitive.Root
+
+const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
+
+const DropdownMenuGroup = DropdownMenuPrimitive.Group
+
+const DropdownMenuPortal = DropdownMenuPrimitive.Portal
+
+const DropdownMenuSub = DropdownMenuPrimitive.Sub
+
+const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
+
+const DropdownMenuSubTrigger = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
+ inset?: boolean
+ }
+>(({ className, inset, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubTrigger
+ ref={ref}
+ className={cn(
+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRight className="ml-auto" />
+ </DropdownMenuPrimitive.SubTrigger>
+))
+DropdownMenuSubTrigger.displayName =
+ DropdownMenuPrimitive.SubTrigger.displayName
+
+const DropdownMenuSubContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubContent
+ ref={ref}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+))
+DropdownMenuSubContent.displayName =
+ DropdownMenuPrimitive.SubContent.displayName
+
+const DropdownMenuContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <DropdownMenuPrimitive.Portal>
+ <DropdownMenuPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+ </DropdownMenuPrimitive.Portal>
+))
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
+
+const DropdownMenuItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
+ inset?: boolean
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+))
+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
+
+const DropdownMenuCheckboxItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
+>(({ className, children, checked, ...props }, ref) => (
+ <DropdownMenuPrimitive.CheckboxItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.CheckboxItem>
+))
+DropdownMenuCheckboxItem.displayName =
+ DropdownMenuPrimitive.CheckboxItem.displayName
+
+const DropdownMenuRadioItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
+>(({ className, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.RadioItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Circle className="h-2 w-2 fill-current" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.RadioItem>
+))
+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
+
+const DropdownMenuLabel = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
+ inset?: boolean
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Label
+ ref={ref}
+ className={cn(
+ "px-2 py-1.5 text-sm font-semibold",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+))
+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
+
+const DropdownMenuSeparator = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+))
+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
+
+const DropdownMenuShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
+ {...props}
+ />
+ )
+}
+DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
+
+export {
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuGroup,
+ DropdownMenuPortal,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuRadioGroup,
+}
diff --git a/packages/ui/src/components/icon-button.tsx b/packages/ui/src/components/icon-button.tsx
new file mode 100644
index 00000000..e41c463a
--- /dev/null
+++ b/packages/ui/src/components/icon-button.tsx
@@ -0,0 +1,30 @@
+import * as React from "react"
+import { Button, type ButtonProps } from "./button"
+import { cn } from "@openreel/ui/lib/utils"
+
+export interface IconButtonProps extends Omit<ButtonProps, 'children'> {
+ icon: React.ElementType
+ iconSize?: number
+}
+
+const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
+ ({ icon: Icon, iconSize = 14, className, variant = "ghost", size = "icon-xs", ...props }, ref) => {
+ return (
+ <Button
+ ref={ref}
+ variant={variant}
+ size={size}
+ className={cn(
+ "text-text-secondary hover:text-text-primary hover:bg-background-elevated",
+ className
+ )}
+ {...props}
+ >
+ <Icon size={iconSize} />
+ </Button>
+ )
+ }
+)
+IconButton.displayName = "IconButton"
+
+export { IconButton }
diff --git a/packages/ui/src/components/input.tsx b/packages/ui/src/components/input.tsx
new file mode 100644
index 00000000..c418cfcd
--- /dev/null
+++ b/packages/ui/src/components/input.tsx
@@ -0,0 +1,22 @@
+import * as React from "react"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
+ ({ className, type, ...props }, ref) => {
+ return (
+ <input
+ type={type}
+ className={cn(
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Input.displayName = "Input"
+
+export { Input }
diff --git a/packages/ui/src/components/label.tsx b/packages/ui/src/components/label.tsx
new file mode 100644
index 00000000..e59082de
--- /dev/null
+++ b/packages/ui/src/components/label.tsx
@@ -0,0 +1,24 @@
+import * as React from "react"
+import * as LabelPrimitive from "@radix-ui/react-label"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const labelVariants = cva(
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+)
+
+const Label = React.forwardRef<
+ React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
+ VariantProps<typeof labelVariants>
+>(({ className, ...props }, ref) => (
+ <LabelPrimitive.Root
+ ref={ref}
+ className={cn(labelVariants(), className)}
+ {...props}
+ />
+))
+Label.displayName = LabelPrimitive.Root.displayName
+
+export { Label }
diff --git a/packages/ui/src/components/labeled-slider.tsx b/packages/ui/src/components/labeled-slider.tsx
new file mode 100644
index 00000000..b3a26c2c
--- /dev/null
+++ b/packages/ui/src/components/labeled-slider.tsx
@@ -0,0 +1,73 @@
+import * as React from "react"
+import { Slider } from "./slider"
+import { cn } from "@openreel/ui/lib/utils"
+
+export interface LabeledSliderProps {
+ label: string
+ value: number
+ onChange: (value: number) => void
+ min?: number
+ max?: number
+ step?: number
+ unit?: string
+ className?: string
+}
+
+const LabeledSlider = React.forwardRef<HTMLDivElement, LabeledSliderProps>(
+ ({ label, value, onChange, min = 0, max = 100, step = 1, unit = "", className }, ref) => {
+ const displayValue = step < 1 ? value.toFixed(1) : Math.round(value)
+
+ return (
+ <div ref={ref} className={cn("space-y-1", className)}>
+ <div className="flex items-center justify-between">
+ <span className="text-[10px] text-text-secondary">{label}</span>
+ <span className="text-[10px] font-mono text-text-primary bg-background-tertiary px-1.5 py-0.5 rounded border border-border">
+ {displayValue}
+ {unit}
+ </span>
+ </div>
+ <Slider
+ value={[value]}
+ onValueChange={(values) => onChange(values[0])}
+ min={min}
+ max={max}
+ step={step}
+ className="h-1.5"
+ />
+ </div>
+ )
+ }
+)
+LabeledSlider.displayName = "LabeledSlider"
+
+export interface InspectorSliderProps {
+ value: number
+ onChange: (value: number) => void
+ min?: number
+ max?: number
+ step?: number
+ className?: string
+}
+
+const InspectorSlider = React.forwardRef<HTMLDivElement, InspectorSliderProps>(
+ ({ value, onChange, min = 0, max = 100, step = 1, className }, ref) => {
+ return (
+ <div ref={ref} className={cn("flex items-center gap-3", className)}>
+ <Slider
+ value={[value]}
+ onValueChange={(values) => onChange(values[0])}
+ min={min}
+ max={max}
+ step={step}
+ className="flex-1 h-1.5"
+ />
+ <span className="text-[10px] font-mono text-text-primary w-8 text-right bg-background-tertiary px-1 py-0.5 rounded border border-border">
+ {Math.round(value)}
+ </span>
+ </div>
+ )
+ }
+)
+InspectorSlider.displayName = "InspectorSlider"
+
+export { LabeledSlider, InspectorSlider }
diff --git a/packages/ui/src/components/popover.tsx b/packages/ui/src/components/popover.tsx
new file mode 100644
index 00000000..9c5d27e5
--- /dev/null
+++ b/packages/ui/src/components/popover.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as PopoverPrimitive from "@radix-ui/react-popover"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Popover = PopoverPrimitive.Root
+
+const PopoverTrigger = PopoverPrimitive.Trigger
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ ref={ref}
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+))
+PopoverContent.displayName = PopoverPrimitive.Content.displayName
+
+export { Popover, PopoverTrigger, PopoverContent }
diff --git a/packages/ui/src/components/select.tsx b/packages/ui/src/components/select.tsx
new file mode 100644
index 00000000..0c442c48
--- /dev/null
+++ b/packages/ui/src/components/select.tsx
@@ -0,0 +1,158 @@
+import * as React from "react"
+import * as SelectPrimitive from "@radix-ui/react-select"
+import { Check, ChevronDown, ChevronUp } from "lucide-react"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Select = SelectPrimitive.Root
+
+const SelectGroup = SelectPrimitive.Group
+
+const SelectValue = SelectPrimitive.Value
+
+const SelectTrigger = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <SelectPrimitive.Icon asChild>
+ <ChevronDown className="h-4 w-4 opacity-50" />
+ </SelectPrimitive.Icon>
+ </SelectPrimitive.Trigger>
+))
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
+
+const SelectScrollUpButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollUpButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronUp className="h-4 w-4" />
+ </SelectPrimitive.ScrollUpButton>
+))
+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
+
+const SelectScrollDownButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollDownButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronDown className="h-4 w-4" />
+ </SelectPrimitive.ScrollDownButton>
+))
+SelectScrollDownButton.displayName =
+ SelectPrimitive.ScrollDownButton.displayName
+
+const SelectContent = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
+>(({ className, children, position = "popper", ...props }, ref) => (
+ <SelectPrimitive.Portal>
+ <SelectPrimitive.Content
+ ref={ref}
+ className={cn(
+ "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
+ position === "popper" &&
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
+ className
+ )}
+ position={position}
+ {...props}
+ >
+ <SelectScrollUpButton />
+ <SelectPrimitive.Viewport
+ className={cn(
+ "p-1",
+ position === "popper" &&
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
+ )}
+ >
+ {children}
+ </SelectPrimitive.Viewport>
+ <SelectScrollDownButton />
+ </SelectPrimitive.Content>
+ </SelectPrimitive.Portal>
+))
+SelectContent.displayName = SelectPrimitive.Content.displayName
+
+const SelectLabel = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Label
+ ref={ref}
+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
+ {...props}
+ />
+))
+SelectLabel.displayName = SelectPrimitive.Label.displayName
+
+const SelectItem = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
+
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
+ </SelectPrimitive.Item>
+))
+SelectItem.displayName = SelectPrimitive.Item.displayName
+
+const SelectSeparator = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+))
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName
+
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+ SelectScrollUpButton,
+ SelectScrollDownButton,
+}
diff --git a/packages/ui/src/components/slider.tsx b/packages/ui/src/components/slider.tsx
new file mode 100644
index 00000000..686e91ae
--- /dev/null
+++ b/packages/ui/src/components/slider.tsx
@@ -0,0 +1,26 @@
+import * as React from "react"
+import * as SliderPrimitive from "@radix-ui/react-slider"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Slider = React.forwardRef<
+ React.ElementRef<typeof SliderPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <SliderPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative flex w-full touch-none select-none items-center",
+ className
+ )}
+ {...props}
+ >
+ <SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-background-tertiary">
+ <SliderPrimitive.Range className="absolute h-full bg-text-secondary" />
+ </SliderPrimitive.Track>
+ <SliderPrimitive.Thumb className="block h-2.5 w-2.5 rounded-full bg-white shadow-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
+ </SliderPrimitive.Root>
+))
+Slider.displayName = SliderPrimitive.Root.displayName
+
+export { Slider }
diff --git a/packages/ui/src/components/switch.tsx b/packages/ui/src/components/switch.tsx
new file mode 100644
index 00000000..1136a02e
--- /dev/null
+++ b/packages/ui/src/components/switch.tsx
@@ -0,0 +1,29 @@
+"use client"
+
+import * as React from "react"
+import * as SwitchPrimitives from "@radix-ui/react-switch"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Switch = React.forwardRef<
+ React.ElementRef<typeof SwitchPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
+>(({ className, ...props }, ref) => (
+ <SwitchPrimitives.Root
+ className={cn(
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
+ className
+ )}
+ {...props}
+ ref={ref}
+ >
+ <SwitchPrimitives.Thumb
+ className={cn(
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
+ )}
+ />
+ </SwitchPrimitives.Root>
+))
+Switch.displayName = SwitchPrimitives.Root.displayName
+
+export { Switch }
diff --git a/packages/ui/src/components/tabs.tsx b/packages/ui/src/components/tabs.tsx
new file mode 100644
index 00000000..99b980db
--- /dev/null
+++ b/packages/ui/src/components/tabs.tsx
@@ -0,0 +1,55 @@
+"use client"
+
+import * as React from "react"
+import * as TabsPrimitive from "@radix-ui/react-tabs"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const Tabs = TabsPrimitive.Root
+
+const TabsList = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.List
+ ref={ref}
+ className={cn(
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+TabsList.displayName = TabsPrimitive.List.displayName
+
+const TabsTrigger = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
+ className
+ )}
+ {...props}
+ />
+))
+TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
+
+const TabsContent = React.forwardRef<
+ React.ElementRef<typeof TabsPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
+>(({ className, ...props }, ref) => (
+ <TabsPrimitive.Content
+ ref={ref}
+ className={cn(
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
+ className
+ )}
+ {...props}
+ />
+))
+TabsContent.displayName = TabsPrimitive.Content.displayName
+
+export { Tabs, TabsList, TabsTrigger, TabsContent }
diff --git a/packages/ui/src/components/toggle-group.tsx b/packages/ui/src/components/toggle-group.tsx
new file mode 100644
index 00000000..588996f0
--- /dev/null
+++ b/packages/ui/src/components/toggle-group.tsx
@@ -0,0 +1,61 @@
+"use client"
+
+import * as React from "react"
+import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
+import { type VariantProps } from "class-variance-authority"
+
+import { cn } from "@openreel/ui/lib/utils"
+import { toggleVariants } from "@openreel/ui/components/toggle"
+
+const ToggleGroupContext = React.createContext<
+ VariantProps<typeof toggleVariants>
+>({
+ size: "default",
+ variant: "default",
+})
+
+const ToggleGroup = React.forwardRef<
+ React.ElementRef<typeof ToggleGroupPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
+ VariantProps<typeof toggleVariants>
+>(({ className, variant, size, children, ...props }, ref) => (
+ <ToggleGroupPrimitive.Root
+ ref={ref}
+ className={cn("flex items-center justify-center gap-1", className)}
+ {...props}
+ >
+ <ToggleGroupContext.Provider value={{ variant, size }}>
+ {children}
+ </ToggleGroupContext.Provider>
+ </ToggleGroupPrimitive.Root>
+))
+
+ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
+
+const ToggleGroupItem = React.forwardRef<
+ React.ElementRef<typeof ToggleGroupPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
+ VariantProps<typeof toggleVariants>
+>(({ className, children, variant, size, ...props }, ref) => {
+ const context = React.useContext(ToggleGroupContext)
+
+ return (
+ <ToggleGroupPrimitive.Item
+ ref={ref}
+ className={cn(
+ toggleVariants({
+ variant: context.variant || variant,
+ size: context.size || size,
+ }),
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </ToggleGroupPrimitive.Item>
+ )
+})
+
+ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
+
+export { ToggleGroup, ToggleGroupItem }
diff --git a/packages/ui/src/components/toggle.tsx b/packages/ui/src/components/toggle.tsx
new file mode 100644
index 00000000..2182e521
--- /dev/null
+++ b/packages/ui/src/components/toggle.tsx
@@ -0,0 +1,43 @@
+import * as React from "react"
+import * as TogglePrimitive from "@radix-ui/react-toggle"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const toggleVariants = cva(
+ "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
+ {
+ variants: {
+ variant: {
+ default: "bg-transparent",
+ outline:
+ "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
+ },
+ size: {
+ default: "h-10 px-3 min-w-10",
+ sm: "h-9 px-2.5 min-w-9",
+ lg: "h-11 px-5 min-w-11",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+const Toggle = React.forwardRef<
+ React.ElementRef<typeof TogglePrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
+ VariantProps<typeof toggleVariants>
+>(({ className, variant, size, ...props }, ref) => (
+ <TogglePrimitive.Root
+ ref={ref}
+ className={cn(toggleVariants({ variant, size, className }))}
+ {...props}
+ />
+))
+
+Toggle.displayName = TogglePrimitive.Root.displayName
+
+export { Toggle, toggleVariants }
diff --git a/packages/ui/src/components/tooltip.tsx b/packages/ui/src/components/tooltip.tsx
new file mode 100644
index 00000000..a42887c1
--- /dev/null
+++ b/packages/ui/src/components/tooltip.tsx
@@ -0,0 +1,28 @@
+import * as React from "react"
+import * as TooltipPrimitive from "@radix-ui/react-tooltip"
+
+import { cn } from "@openreel/ui/lib/utils"
+
+const TooltipProvider = TooltipPrimitive.Provider
+
+const Tooltip = TooltipPrimitive.Root
+
+const TooltipTrigger = TooltipPrimitive.Trigger
+
+const TooltipContent = React.forwardRef<
+ React.ElementRef<typeof TooltipPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <TooltipPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
+ className
+ )}
+ {...props}
+ />
+))
+TooltipContent.displayName = TooltipPrimitive.Content.displayName
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts
new file mode 100644
index 00000000..af621c41
--- /dev/null
+++ b/packages/ui/src/index.ts
@@ -0,0 +1,73 @@
+export { cn } from "./lib/utils"
+
+export { Button, buttonVariants, type ButtonProps } from "./components/button"
+export { IconButton, type IconButtonProps } from "./components/icon-button"
+export { Collapsible, CollapsibleTrigger, CollapsibleContent } from "./components/collapsible"
+export {
+ ContextMenu,
+ ContextMenuTrigger,
+ ContextMenuContent,
+ ContextMenuItem,
+ ContextMenuCheckboxItem,
+ ContextMenuRadioItem,
+ ContextMenuLabel,
+ ContextMenuSeparator,
+ ContextMenuShortcut,
+ ContextMenuGroup,
+ ContextMenuPortal,
+ ContextMenuSub,
+ ContextMenuSubContent,
+ ContextMenuSubTrigger,
+ ContextMenuRadioGroup,
+} from "./components/context-menu"
+export {
+ Dialog,
+ DialogPortal,
+ DialogOverlay,
+ DialogTrigger,
+ DialogClose,
+ DialogContent,
+ DialogHeader,
+ DialogFooter,
+ DialogTitle,
+ DialogDescription,
+} from "./components/dialog"
+export {
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuGroup,
+ DropdownMenuPortal,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuRadioGroup,
+} from "./components/dropdown-menu"
+export { Input } from "./components/input"
+export { Label } from "./components/label"
+export { Popover, PopoverTrigger, PopoverContent } from "./components/popover"
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+ SelectScrollUpButton,
+ SelectScrollDownButton,
+} from "./components/select"
+export { Slider } from "./components/slider"
+export { LabeledSlider, InspectorSlider, type LabeledSliderProps, type InspectorSliderProps } from "./components/labeled-slider"
+export { Switch } from "./components/switch"
+export { Tabs, TabsList, TabsTrigger, TabsContent } from "./components/tabs"
+export { Toggle, toggleVariants } from "./components/toggle"
+export { ToggleGroup, ToggleGroupItem } from "./components/toggle-group"
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "./components/tooltip"
diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts
new file mode 100644
index 00000000..5d400e70
--- /dev/null
+++ b/packages/ui/src/lib/utils.ts
@@ -0,0 +1,6 @@
+import { type ClassValue, clsx } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]): string {
+ return twMerge(clsx(inputs))
+}
diff --git a/packages/ui/src/styles/globals.css b/packages/ui/src/styles/globals.css
new file mode 100644
index 00000000..c8df8a47
--- /dev/null
+++ b/packages/ui/src/styles/globals.css
@@ -0,0 +1,59 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 240 10% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+ --primary: 142 71% 45%;
+ --primary-foreground: 0 0% 0%;
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: 240 5.9% 10%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+ --ring: 142 71% 45%;
+ --radius: 0.5rem;
+ }
+
+ .dark {
+ --background: 240 6% 6%;
+ --foreground: 0 0% 95%;
+ --card: 240 6% 10%;
+ --card-foreground: 0 0% 95%;
+ --popover: 240 6% 10%;
+ --popover-foreground: 0 0% 95%;
+ --primary: 142 71% 45%;
+ --primary-foreground: 0 0% 0%;
+ --secondary: 240 4% 16%;
+ --secondary-foreground: 0 0% 95%;
+ --muted: 240 4% 16%;
+ --muted-foreground: 240 5% 65%;
+ --accent: 240 4% 16%;
+ --accent-foreground: 0 0% 95%;
+ --destructive: 0 62% 50%;
+ --destructive-foreground: 0 0% 95%;
+ --border: 240 4% 20%;
+ --input: 240 4% 20%;
+ --ring: 142 71% 45%;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+ body {
+ @apply bg-background text-foreground;
+ }
+}
diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json
new file mode 100644
index 00000000..3368db0d
--- /dev/null
+++ b/packages/ui/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "jsx": "react-jsx",
+ "rootDir": "src",
+ "outDir": "dist",
+ "baseUrl": ".",
+ "paths": {
+ "@openreel/ui": ["./src/index.ts"],
+ "@openreel/ui/*": ["./src/*"]
+ }
+ },
+ "include": ["src"]
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index af1cfd69..16a1b734 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -39,6 +39,9 @@ importers:
'@openreel/core':
specifier: workspace:*
version: link:../../packages/core
+ '@openreel/ui':
+ specifier: workspace:*
+ version: link:../../packages/ui
'@radix-ui/react-context-menu':
specifier: ^2.2.16
@@ -154,6 +157,9 @@ importers:
tailwindcss:
specifier: ^3.4.4
version: 3.4.18
+ tailwindcss-animate:
+ specifier: ^1.0.7
+ version: 1.0.7([email protected])
typescript:
specifier: ^5.4.5
version: 5.9.3
@@ -204,6 +210,79 @@ importers:
specifier: ^1.6.0
version: 1.6.1(@types/[email protected])([email protected])
+ packages/ui:
+ dependencies:
+ '@radix-ui/react-collapsible':
+ specifier: ^1.1.12
+ '@radix-ui/react-context-menu':
+ specifier: ^2.2.16
+ '@radix-ui/react-dialog':
+ specifier: ^1.1.15
+ '@radix-ui/react-dropdown-menu':
+ specifier: ^2.1.16
+ '@radix-ui/react-label':
+ specifier: ^2.1.8
+ '@radix-ui/react-popover':
+ specifier: ^1.1.15
+ '@radix-ui/react-select':
+ specifier: ^2.2.6
+ '@radix-ui/react-slider':
+ specifier: ^1.3.6
+ '@radix-ui/react-slot':
+ specifier: ^1.2.3
+ version: 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-switch':
+ specifier: ^1.2.6
+ '@radix-ui/react-tabs':
+ specifier: ^1.1.13
+ '@radix-ui/react-toggle':
+ specifier: ^1.1.10
+ '@radix-ui/react-toggle-group':
+ specifier: ^1.1.11
+ '@radix-ui/react-tooltip':
+ specifier: ^1.2.8
+ class-variance-authority:
+ specifier: ^0.7.1
+ version: 0.7.1
+ clsx:
+ specifier: ^2.1.1
+ version: 2.1.1
+ lucide-react:
+ specifier: ^0.555.0
+ version: 0.555.0([email protected])
+ react:
+ specifier: ^18.0.0
+ version: 18.3.1
+ react-dom:
+ specifier: ^18.0.0
+ version: 18.3.1([email protected])
+ tailwind-merge:
+ specifier: ^3.4.0
+ version: 3.4.0
+ devDependencies:
+ '@types/react':
+ specifier: ^18.3.3
+ version: 18.3.27
+ '@types/react-dom':
+ specifier: ^18.3.0
+ version: 18.3.7(@types/[email protected])
+ typescript:
+ specifier: ^5.4.5
+ version: 5.9.3
+
packages:
@@ -919,6 +998,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==}
peerDependencies:
@@ -1042,6 +1134,19 @@ packages:
'@types/react':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-FmXs37I6hSBVDlO4y764TNz1rLgKwjJMQ0EGte6F3Cb3f4bIuHB/iLa/8I9VKkmOy+gNHq8rql3j686ACVV21A==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==}
peerDependencies:
@@ -1120,6 +1225,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-9hQc4+GNVtJAIEPEqlYqW5RiYdrr8ea5XQ0ZOnD6fgru+83kqT15mq2OCcbe8KnjRZl5vF3ks69AKz3kh1jrhg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA==}
peerDependencies:
@@ -1168,6 +1286,28 @@ packages:
'@types/react':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-bByzr1+ep1zk4VubeEVViV592vu2lHE2BZY5OnzehZqOOgogN80+mNtCqPkhn2gklJqOpxWgPoYTSnhBCqpOXQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A==}
peerDependencies:
@@ -1181,6 +1321,32 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-5umnS0T8JQzQT6HbPyO7Hh9dgd82NmS36DQr+X/YJ9ctFNCiiQd6IJAYYZ33LUwm8M+taCz5t2ui29fHZc4Y6Q==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg==}
peerDependencies:
@@ -2828,6 +2994,11 @@ packages:
resolution: {integrity: sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==}
+ resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==}
+ peerDependencies:
+ tailwindcss: '>=3.0.0 || insiders'
+
resolution: {integrity: sha512-6A2rnmW5xZMdw11LYjhcI5846rt9pbLSabY5XPxo+XWdxwZaFEn47Go4NzFiHu9sNNmr/kXivP1vStfvMaK1GQ==}
engines: {node: '>=14.0.0'}
@@ -3685,6 +3856,22 @@ snapshots:
'@types/react': 18.3.27
'@types/react-dom': 18.3.7(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
dependencies:
'@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
@@ -3803,6 +3990,15 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.27
+ dependencies:
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
dependencies:
'@radix-ui/primitive': 1.1.3
@@ -3899,6 +4095,15 @@ snapshots:
'@types/react': 18.3.27
'@types/react-dom': 18.3.7(@types/[email protected])
+ dependencies:
+ '@radix-ui/react-slot': 1.2.4(@types/[email protected])([email protected])
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
dependencies:
'@radix-ui/primitive': 1.1.3
@@ -3971,6 +4176,28 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.27
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ react: 18.3.1
+ optionalDependencies:
+ '@types/react': 18.3.27
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.1.1(@types/[email protected])([email protected])
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
dependencies:
'@radix-ui/primitive': 1.1.3
@@ -3987,6 +4214,32 @@ snapshots:
'@types/react': 18.3.27
'@types/react-dom': 18.3.7(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+
dependencies:
'@radix-ui/primitive': 1.1.3
@@ -5658,6 +5911,10 @@ snapshots:
+ dependencies:
+ tailwindcss: 3.4.18
+
dependencies:
'@alloc/quick-lru': 5.2.0
diff --git a/tsconfig.base.json b/tsconfig.base.json
index d495443c..d5ed444a 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -20,7 +20,9 @@
"forceConsistentCasingInFileNames": true,
"paths": {
"@openreel/core": ["./packages/core/src/index.ts"],
- "@openreel/core/*": ["./packages/core/src/*"]
+ "@openreel/core/*": ["./packages/core/src/*"],
+ "@openreel/ui": ["./packages/ui/src/index.ts"],
+ "@openreel/ui/*": ["./packages/ui/src/*"]
}
},
"exclude": ["node_modules", "dist", "build"]