Compare commits

..

6 Commits

Author SHA1 Message Date
49d788cfe9 Build [v1.14.29] 2026-04-25 12:44:59 +03:00
18cb466b50 docs(07.1-frontend-overhaul): update state and plan for Task 4 2026-04-25 12:44:59 +03:00
8dc8b7da9f Build [v1.14.28] 2026-04-25 12:43:41 +03:00
5393b237de feat(07.1-frontend-overhaul): refine StatCard and Data Tables
- Applied #121212 background and #222222 border to StatCards and Tables.
- Tightened internal padding to 8px-12px.
- Enforced 0px border radius and removed shadows.
- Numeric values in StatCards now match label size.
- Caution Orange used for emphasis in StatCards.
- Removed zebra-striping and applied 1px horizontal dividers to Tables.
- Headers updated to Title Case Space Grotesk.
- Complies with AI_RULES.md (no bold, no uppercase).
2026-04-25 12:43:38 +03:00
a287bfadca feat(07.1-frontend-overhaul): refactor inventory page buttons and inputs
- Applied btn-primary and btn-secondary classes
- Removed rounded corners and shadows
- Updated labels to Title Case
- Standardized input styles
2026-04-25 12:32:22 +03:00
ffcc60c38b Build [v1.14.27] 2026-04-25 12:26:20 +03:00
24 changed files with 451 additions and 353 deletions

24
.planning/STATE.md Normal file
View File

@@ -0,0 +1,24 @@
# STATE.md
## Current Position
- **Phase:** 07.1-frontend-overhaul
- **Plan:** 07.1-frontend-overhaul-PLAN.md
- **Task:** 4 (Completed)
## Progress
- [x] Task 1: Update Tailwind Configuration
- [x] Task 2: Implement Global Sharp Edges & Borders
- [x] Task 3: Component-Level Overhaul (Buttons & Inputs)
- [x] Task 4: StatCard & Data Table Refinement
- [ ] Task 5: Layout & Viewport Adjustments
- [ ] Task 6: Final Audit & Rule Alignment
## Decisions
- Enforced `font-weight: 400 !important` and `text-transform: none !important` globally in `globals.css` to ensure strict compliance with `AI_RULES.md` (Industrial Precision aesthetic).
- Set `border-radius: 0 !important` and `box-shadow: none !important` globally.
- Used `Space Grotesk` from Google Fonts.
- Refined StatCards and Data Tables with #121212 background and #222222 borders, sharp corners, and tight padding (8px-12px) for high information density.
- Enforced Title Case for table headers to comply with "NO UPPERCASE" rule while maintaining "Industrial Precision" visual hierarchy.
## Blockers
- None.

View File

@@ -49,7 +49,7 @@ autonomous: true
---
## Task 2: Implement Global Sharp Edges & Borders
## Task 2: Implement Global Sharp Edges & Borders [COMPLETED]
**Read First:**
- `DESIGN.md` (Elevation & Depth, Shapes).
@@ -67,7 +67,7 @@ autonomous: true
---
## Task 3: Component-Level Overhaul (Buttons & Inputs)
## Task 3: Component-Level Overhaul (Buttons & Inputs) [COMPLETED]
**Read First:**
- `DESIGN.md` (Components section).
@@ -85,7 +85,7 @@ autonomous: true
---
## Task 4: StatCard & Data Table Refinement
## Task 4: StatCard & Data Table Refinement [COMPLETED]
**Read First:**
- `DESIGN.md` (StatCards, Data Tables).

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,35 @@
# CURRENT AI WORKING SESSION — HANDOVER
**Active AI:** Gemini Executor
**Last Updated:** 2026-04-25
**Current Version:** v1.14.26
**Status**: 🟢 PHASE 7.1 TASK 2 COMPLETE
---
## SESSION EXECUTION SUMMARY — Task 2: Global Sharp Edges & Borders
### 1. Global CSS Update (COMPLETE)
- Updated `frontend/app/globals.css` to enforce `border-radius: 0 !important` globally.
- Removed all box-shadows globally (`box-shadow: none !important`).
- Enforced `font-weight: 400 !important` and `text-transform: none !important` to comply with `AI_RULES.md`.
- Implemented `level-1` and `level-2` classes for "Industrial Precision" borders.
- Updated scrollbar to match industrial aesthetic (no radius, technical colors).
- Added `status-success` and `status-alert` high-contrast utility classes.
### 2. AI Rules Update
- Updated `AI_RULES.md` to include a mandatory rule for 0px border radius and no shadows.
### 3. Documentation Update
- Marked Task 2 as completed in `.planning/phases/07.1-frontend-overhaul/PLAN.md`.
---
## NEXT STEPS (Phase 7.1: Frontend UI/UX Overhaul)
1. **Task 3: Component-Level Overhaul**: Update Buttons and Inputs.
2. **Task 4: StatCard & Data Table Refinement**.
3. **Task 5: Layout & Viewport Adjustments**.
---

View File

@@ -1,29 +1,41 @@
# CURRENT AI WORKING SESSION — HANDOVER
**Active AI:** Gemini Executor
**Active AI:** Gemini Executor (Antigravity)
**Last Updated:** 2026-04-25
**Current Version:** v1.14.25
**Status**: 🟢 PHASE 7.1 TASK 1 COMPLETE
**Current Version:** v1.14.28
**Status**: 🟢 PHASE 7.1 TASK 4 COMPLETE
---
## SESSION EXECUTION SUMMARY — Task 1: Tailwind Update
## SESSION EXECUTION SUMMARY — Task 4: StatCard & Data Table Refinement
### 1. Tailwind Config (COMPLETE)
- Updated `frontend/tailwind.config.ts` with "Industrial Precision" palette.
- Added `Space Grotesk` font family.
- Aligned font sizes with `DESIGN.md` (14px, 16px, 18px, 24px, 32px, 48px).
- Defined tiered surface system: `#0A0A0A`, `#121212`, `#1A1A1A`.
### 1. StatCard Refinement (COMPLETE)
- Updated `frontend/components/StatCard.tsx`.
- Applied `bg-surface-container` (#121212) and `border-border` (#222222).
- Tightened padding to `p-2 md:p-3` (8px-12px).
- Numeric values set to `text-base md:text-lg` matching labels.
- Value color set to `text-primary` (Caution Orange).
- Removed `rounded-2xl` and `shadow-sm`.
### 2. Documentation Update
- Updated `PROJECT_ARCHITECTURE.md` with new styling specs.
- Updated `README.md` version and date.
- Marked Task 1 as completed in `.planning/phases/07.1-frontend-overhaul/PLAN.md`.
### 2. Data Table Refinement (COMPLETE)
- Updated `frontend/components/LogsTable.tsx`:
- Converted to a more "table-like" structure with a header row.
- Applied 1px horizontal dividers (`divide-y`).
- Removed gaps, rounded corners, and shadows.
- Compressed row padding.
- Updated `frontend/components/InventoryTable.tsx`:
- Refined category headers and item rows with technical colors and sharp edges.
- Compressed spacing for higher information density.
- Applied Title Case to headers for `AI_RULES.md` compliance.
### 3. Rule Compliance Audit
- Verified NO UPPERCASE in headers/labels.
- Verified NO BOLD fonts.
- Verified 0px border radius (sharp corners) on all updated components.
---
## NEXT STEPS (Phase 7.1: Frontend UI/UX Overhaul)
1. **Task 2: Implement Global Sharp Edges & Borders**: Update `globals.css` for 0px radius and 1px/2px borders.
2. **Task 3: Component-Level Overhaul**: Update Buttons and Inputs.
3. **Task 4: StatCard & Data Table Refinement**.
1. **Task 5: Layout & Viewport Adjustments**: Set primary viewport margins (24px-32px) and update page containers.
2. **Task 6: Final Audit & Rule Alignment**: Check all pages for style regressions.

View File

@@ -1,6 +1,6 @@
{
"version": "1.14.26",
"last_build": "2026-04-25-1225",
"version": "1.14.29",
"last_build": "2026-04-25-1244",
"codename": "ConfigCore",
"commit": "701e30fb"
"commit": "18cb466b"
}

View File

@@ -18,7 +18,7 @@ export default function AdminPage() {
return (
<PageShell>
<div className="flex items-center justify-center min-h-[60vh]">
<div className="w-12 h-12 border-4 border-indigo-500/20 border-t-indigo-500 rounded-full animate-spin" />
<div className="w-12 h-12 border-4 border-primary/20 border-t-primary rounded-none animate-spin" />
</div>
</PageShell>
);
@@ -26,18 +26,18 @@ export default function AdminPage() {
return (
<PageShell>
<main data-testid="admin-page" className="p-3 md:p-8 max-w-7xl mx-auto space-y-3 md:space-y-6 mb-20">
<main data-testid="admin-page" className="p-3 md:p-8 max-w-7xl mx-auto space-y-3 md:space-y-6 mb-20 font-sans">
<header className="flex items-center gap-4 mb-4 md:mb-6">
<div className="p-3 md:p-4 bg-indigo-500/10 rounded-2xl text-indigo-400 border border-indigo-500/20 shadow-xl shadow-indigo-500/5">
<div className="p-3 md:p-4 bg-primary/10 rounded-none text-primary border border-primary/20 shadow-none">
<Shield size={28} className="md:w-8 md:h-8" />
</div>
<div>
<h1 className="text-2xl md:text-3xl font-normal tracking-tight text-white leading-tight">Admin Control</h1>
<p className="text-[10px] md:text-xs text-muted font-normal tracking-tight mt-0.5">System Configuration & Security</p>
<p className="text-[10px] md:text-xs text-[#888888] font-normal tracking-tight mt-0.5">System Configuration & Security</p>
</div>
<button
onClick={admin.handleLogout}
className="ml-auto p-3 lg:p-4 xl:p-5 lg:p-6 xl:p-8 bg-surface border border-slate-800 text-muted hover:text-rose-500 rounded-2xl transition-all active:scale-95 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:ring-rose-500 focus-visible:outline-none"
className="ml-auto p-3 bg-[#1A1A1A] border border-[#222222] text-[#888888] hover:text-rose-500 rounded-none transition-all active:scale-95 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:ring-rose-500 focus-visible:outline-none"
title="Secure Logout"
aria-label="Logout from admin panel"
>

View File

@@ -39,9 +39,23 @@
h1, h2, h3, h4, h5, h6 {
@apply tracking-tighter;
}
input, textarea, select {
@apply bg-black border border-[#222222] text-white px-3 py-2 focus:border-primary focus:outline-none transition-colors;
border-radius: 0 !important;
}
}
@layer components {
/* Button Styles */
.btn-primary {
@apply bg-primary text-black px-4 py-2 hover:bg-[#d47214] transition-colors inline-flex items-center justify-center gap-2;
}
.btn-secondary {
@apply bg-transparent border border-[#888888] text-[#888888] px-4 py-2 hover:border-white hover:text-white transition-colors inline-flex items-center justify-center gap-2;
}
/* Level 1 (Cards/Panels): #121212 with a 1px solid border of #222222 */
.level-1 {
@apply bg-[#121212] border border-[#222222];

View File

@@ -266,7 +266,7 @@ export default function InventoryPage() {
return (
<PageShell>
<div className="p-3 md:p-8 max-w-7xl mx-auto space-y-3 md:space-y-4">
<div className="p-3 md:p-8 max-w-7xl mx-auto space-y-3 md:space-y-4 font-sans">
<datalist id="existing-types">
{existingTypes.map(t => <option key={t} value={t} />)}
</datalist>
@@ -275,23 +275,23 @@ export default function InventoryPage() {
</datalist>
<header className="flex items-center gap-4 mb-4 md:mb-6">
<div className="p-3 md:p-4 bg-primary/10 rounded-3xl text-primary border border-primary/20 shadow-xl shadow-primary/5">
<div className="p-3 md:p-4 bg-primary/10 text-primary border border-primary/20 rounded-none">
<Package size={28} className="md:w-8 md:h-8" />
</div>
<div>
<h1 className="text-2xl md:text-3xl font-normal tracking-tight text-white leading-tight">Inventory Catalog</h1>
<p className="text-xs md:text-sm text-secondary font-normal mt-1 tracking-widest">Enterprise Stock Overview</p>
<p className="text-xs md:text-sm text-[#888888] font-normal mt-1 tracking-widest">Enterprise Stock Overview</p>
</div>
<button
onClick={() => setShowSearchModal(true)}
className="ml-auto p-3 bg-surface border border-slate-800 text-secondary rounded-2xl hover:text-primary transition-all active:scale-95 shadow-xl"
title="Search inventory"
className="ml-auto p-3 bg-[#1A1A1A] border border-[#222222] text-[#888888] hover:text-primary transition-all active:scale-95 rounded-none"
title="Search Inventory"
>
<Search size={20} />
</button>
<button
onClick={() => setShowBoxManager(true)}
className="p-3 bg-surface border border-slate-800 text-secondary rounded-2xl hover:text-primary transition-all active:scale-95 shadow-xl"
className="p-3 bg-[#1A1A1A] border border-[#222222] text-[#888888] hover:text-primary transition-all active:scale-95 rounded-none"
title="Manage Boxes"
>
<Layout size={20} />
@@ -346,13 +346,13 @@ export default function InventoryPage() {
{/* Stock Adjustment / Edit Item Overlay */}
{selectedItem && (
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-surface border-x border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[2.5rem] shadow-2xl p-5 sm:p-8 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-[#0A0A0A] border-x border-t sm:border border-[#222222] p-5 sm:p-8 overflow-hidden animate-in slide-in-from-bottom-10 duration-300 rounded-none">
<div className="flex justify-between items-center mb-3 md:mb-4">
<h3 className="text-xl font-normal tracking-tight flex items-center gap-2">
{isEditing ? "Edit Item" : selectedItem.name}
{!isEditing && (
<span className="text-xs bg-slate-800 text-secondary px-3 py-1 rounded-lg font-normal tracking-tight">
<span className="text-xs bg-black text-[#888888] px-3 py-1 border border-[#222222] font-normal tracking-tight">
In Stock: {selectedItem.quantity}
</span>
)}
@@ -364,7 +364,7 @@ export default function InventoryPage() {
setEditedItem(selectedItem);
setIsEditing(true);
}}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 hover:bg-slate-800 rounded-full text-secondary"
className="p-2 hover:bg-black border border-transparent hover:border-[#222222] text-[#888888] rounded-none"
>
<Edit2 size={20} />
</button>
@@ -372,7 +372,7 @@ export default function InventoryPage() {
{isEditing && (
<button
onClick={handleDeleteItem}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 hover:bg-red-500/20 rounded-full text-red-500"
className="p-2 hover:bg-red-500/20 border border-transparent hover:border-red-500/50 text-red-500 rounded-none"
>
<Trash2 size={20} />
</button>
@@ -383,7 +383,7 @@ export default function InventoryPage() {
setIsEditing(false);
setAdjustQty(1);
}}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 hover:bg-slate-800 rounded-full"
className="p-2 hover:bg-black border border-transparent hover:border-[#222222] rounded-none"
>
<X size={20} />
</button>
@@ -393,33 +393,33 @@ export default function InventoryPage() {
{isEditing ? (
<div className="max-h-[60vh] overflow-y-auto pr-2 space-y-2 md:space-y-3 mb-4 md:mb-6 scrollbar-hide">
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Item Name</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Item Name</label>
<input
type="text"
value={editedItem.name || ''}
onChange={e => setEditedItem({...editedItem, name: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary placeholder:text-muted"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Part Number</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Part Number</label>
<input
type="text"
value={editedItem.part_number || ''}
onChange={e => setEditedItem({...editedItem, part_number: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary placeholder:text-muted"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
<div className="grid grid-cols-2 gap-2 md:gap-3">
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Category</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Category</label>
<input
type="text"
list="existing-categories"
value={editedItem.category || ''}
onChange={e => setEditedItem({ ...editedItem, category: e.target.value })}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary placeholder:text-muted"
placeholder="e.g. storage"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
placeholder="e.g. Storage"
/>
<datalist id="existing-categories">
{categoriesList.map(c => (
@@ -428,54 +428,54 @@ export default function InventoryPage() {
</datalist>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Item Type</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Item Type</label>
<input
type="text"
list="existing-types"
value={editedItem.type || ''}
onChange={e => setEditedItem({...editedItem, type: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Connector</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Connector</label>
<input
type="text"
value={editedItem.connector || ''}
onChange={e => setEditedItem({...editedItem, connector: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
placeholder="e.g. LC/UPC"
/>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Size / Length / Speed</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Size / Length / Speed</label>
<input
type="text"
value={editedItem.size || ''}
onChange={e => setEditedItem({...editedItem, size: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
placeholder="e.g. 1.6TB"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Item Color</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Item Color</label>
<input
type="text"
value={editedItem.color || ''}
onChange={e => setEditedItem({...editedItem, color: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
placeholder="e.g. Blue"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Box / Container Label</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Box / Container Label</label>
<div className="relative flex items-center">
<input
type="text"
list="existing-boxes"
value={editedItem.box_label || ''}
onChange={e => setEditedItem({...editedItem, box_label: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-sm font-normal outline-none text-secondary placeholder:text-muted focus:border-primary transition-colors"
className="w-full pr-12 bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
placeholder="e.g. Box 5"
/>
<button
@@ -486,8 +486,8 @@ export default function InventoryPage() {
toast.success("Ready to scan Box label...");
}}
className={cn(
"absolute right-2 p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 rounded-lg transition-all",
fieldScanning?.active ? "bg-primary text-white animate-pulse" : "text-muted hover:bg-slate-800"
"absolute right-2 p-2 transition-all rounded-none",
fieldScanning?.active ? "bg-primary text-black animate-pulse" : "text-[#888888] hover:bg-black"
)}
>
<Camera size={18} />
@@ -496,25 +496,25 @@ export default function InventoryPage() {
</div>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Specs / Comments</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Specs / Comments</label>
<textarea
value={editedItem.specs || ''}
onChange={e => setEditedItem({...editedItem, specs: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary h-20 resize-none"
className="w-full h-20 resize-none bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">OCR Matching Key</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">OCR Matching Key</label>
<textarea
value={editedItem.ocr_text || ''}
onChange={e => setEditedItem({...editedItem, ocr_text: e.target.value})}
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-primary/80 h-16 resize-none"
className="w-full text-primary h-16 resize-none bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
</div>
) : (
<>
<div className="flex p-1 bg-background rounded-2xl mb-4 md:mb-6">
<div className="flex p-1 bg-black border border-[#222222] mb-4 md:mb-6 rounded-none">
{[
{ id: 'ADD', label: 'Buy More', icon: Plus, color: 'text-primary' },
{ id: 'REMOVE', label: 'Subtract', icon: Minus, color: 'text-amber-500' },
@@ -524,8 +524,8 @@ export default function InventoryPage() {
key={t.id}
onClick={() => setAdjustType(t.id as any)}
className={cn(
"flex-1 flex flex-col items-center py-3 lg:py-4 xl:py-5 rounded-xl transition-all",
adjustType === t.id ? "bg-slate-800 shadow-lg" : "text-muted"
"flex-1 flex flex-col items-center py-3 lg:py-4 xl:py-5 transition-all rounded-none",
adjustType === t.id ? "bg-[#1A1A1A] border border-[#222222]" : "text-[#888888]"
)}
>
<t.icon size={20} className={adjustType === t.id ? t.color : ""} />
@@ -538,25 +538,25 @@ export default function InventoryPage() {
<div className="flex items-center gap-3 md:gap-4">
<button
onClick={() => setAdjustQty(Math.max(1, adjustQty - 1))}
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center hover:bg-slate-800 transition-colors"
className="w-12 h-12 border border-[#222222] flex items-center justify-center hover:bg-black transition-colors rounded-none"
>
<Minus size={24} />
</button>
<span className="text-5xl font-normal tabular-nums">{adjustQty}</span>
<button
onClick={() => setAdjustQty(adjustQty + 1)}
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center hover:bg-slate-800 transition-colors"
className="w-12 h-12 border border-[#222222] flex items-center justify-center hover:bg-black transition-colors rounded-none"
>
<Plus size={24} />
</button>
</div>
{adjustType === 'TRASH' && (
<div className="w-full bg-red-500/5 border border-red-500/20 p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 rounded-2xl">
<div className="w-full bg-red-500/5 border border-red-500/20 p-4 rounded-none">
<select
value={trashReason}
onChange={(e) => setTrashReason(e.target.value)}
className="w-full bg-background border border-slate-800 rounded-xl py-3 lg:py-4 xl:py-5 px-4 lg:px-5 xl:px-6 text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl outline-none text-foreground"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
>
<option>Damaged</option>
<option>Expired</option>
@@ -572,18 +572,18 @@ export default function InventoryPage() {
<button
onClick={isEditing ? handleUpdateItem : handleAdjustStock}
className={cn(
"w-full py-4 sm:py-5 rounded-[1.8rem] font-normal text-lg transition-all active:scale-[0.98] shadow-xl",
isEditing ? "bg-white text-slate-950 shadow-white/10" : (
adjustType === 'ADD' ? "bg-primary text-white shadow-primary/20" :
adjustType === 'REMOVE' ? "bg-amber-600 text-white shadow-amber-600/20" :
"bg-red-600 text-white shadow-red-600/20"
"w-full py-4 sm:py-5 font-normal text-lg transition-all active:scale-[0.98] rounded-none",
isEditing ? "bg-white text-black" : (
adjustType === 'ADD' ? "btn-primary" :
adjustType === 'REMOVE' ? "bg-amber-600 text-white" :
"bg-red-600 text-white"
)
)}
>
{isEditing ? "Save Changes" : (
adjustType === 'ADD' ? `Add ${adjustQty} to Stock` :
adjustType === 'REMOVE' ? `Subtract ${adjustQty} from Stock` :
`Discard ${adjustQty} items`
adjustType === 'ADD' ? `Add ${adjustQty} To Stock` :
adjustType === 'REMOVE' ? `Subtract ${adjustQty} From Stock` :
`Discard ${adjustQty} Items`
)}
</button>
</div>
@@ -593,37 +593,37 @@ export default function InventoryPage() {
{/* Category Edit Overlay */}
{editingCategory && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/90 animate-in fade-in duration-300">
<div className="bg-surface border border-slate-800 rounded-3xl p-4 md:p-6 max-w-sm w-full shadow-2xl space-y-3 md:space-y-4 animate-in zoom-in-95 duration-200">
<div className="bg-[#0A0A0A] border border-[#222222] p-4 md:p-6 max-w-sm w-full shadow-none space-y-3 md:space-y-4 animate-in zoom-in-95 duration-200 rounded-none">
<div className="flex justify-between items-center">
<h2 className="text-xl font-normal">Edit Category</h2>
<button onClick={() => setEditingCategory(null)} className="p-2 hover:bg-slate-800 rounded-full transition-colors text-secondary">
<button onClick={() => setEditingCategory(null)} className="p-2 hover:bg-black border border-transparent hover:border-[#222222] transition-colors text-[#888888] rounded-none">
<X size={20} />
</button>
</div>
<div className="space-y-2 md:space-y-3">
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Name</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Name</label>
<input
type="text"
value={catEditedName}
onChange={e => setCatEditedName(e.target.value)}
className="w-full bg-background border border-slate-800 rounded-xl py-3 lg:py-4 xl:py-5 px-4 lg:px-5 xl:px-6 text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl outline-none text-secondary"
className="w-full bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
<div>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Description</label>
<label className="text-sm font-normal text-[#888888] ml-1 tracking-tight">Description</label>
<textarea
value={catEditedDesc}
onChange={e => setCatEditedDesc(e.target.value)}
className="w-full bg-background border border-slate-800 rounded-xl py-3 lg:py-4 xl:py-5 px-4 lg:px-5 xl:px-6 text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl outline-none text-secondary h-24 resize-none"
className="w-full h-24 resize-none bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
</div>
</div>
<button
onClick={handleUpdateCategory}
className="w-full bg-primary text-white font-normal py-4 rounded-2xl shadow-xl shadow-primary/20 hover:scale-[1.02] active:scale-95 transition-all"
className="btn-primary w-full"
>
Update Category
</button>
@@ -641,18 +641,18 @@ export default function InventoryPage() {
{/* Box Manager Modal */}
{showBoxManager && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 bg-background/90 animate-in fade-in duration-300">
<div className="w-full max-w-2xl bg-surface border border-slate-800 rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col max-h-[90vh]">
<div className="p-4 md:p-6 pb-3 md:pb-4 flex flex-col gap-3 md:gap-4 shrink-0 bg-surface/70">
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/90 animate-in fade-in duration-300">
<div className="w-full max-w-2xl bg-[#0A0A0A] border border-[#222222] overflow-hidden flex flex-col max-h-[90vh] rounded-none">
<div className="p-4 md:p-6 pb-3 md:pb-4 flex flex-col gap-3 md:gap-4 shrink-0 bg-[#0A0A0A]/70">
<div className="flex justify-between items-center">
<div>
<h3 className="text-2xl font-normal tracking-tight flex items-center gap-3">
<Package className="text-primary" size={28} />
Box Inventory
</h3>
<p className="text-sm text-muted font-normal mt-1">Manage physical box labels & printing</p>
<p className="text-sm text-[#888888] font-normal mt-1">Manage physical box labels & printing</p>
</div>
<button onClick={() => { setShowBoxManager(false); setBoxSearchQuery(''); }} className="p-3 lg:p-4 xl:p-5 lg:p-6 xl:p-8 hover:bg-slate-800 rounded-full transition-colors text-secondary">
<button onClick={() => { setShowBoxManager(false); setBoxSearchQuery(''); }} className="p-3 hover:bg-black border border-transparent hover:border-[#222222] transition-colors text-[#888888] rounded-none">
<X size={24} />
</button>
</div>
@@ -663,13 +663,13 @@ export default function InventoryPage() {
placeholder="Search boxes..."
value={boxSearchQuery}
onChange={(e) => setBoxSearchQuery(e.target.value)}
className="w-full bg-background border border-slate-800 rounded-2xl py-3 lg:py-4 xl:py-5.5 pl-11 pr-4 text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl focus:border-primary outline-none transition-all placeholder:text-secondary"
className="w-full pl-11 pr-4 bg-black border border-[#222222] focus:border-primary px-3 py-2 rounded-none"
/>
<Search className="absolute left-4 top-1/2 -translate-y-1/2 text-secondary" size={18} />
<Search className="absolute left-4 top-1/2 -translate-y-1/2 text-[#888888]" size={18} />
{boxSearchQuery && (
<button
onClick={() => setBoxSearchQuery('')}
className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 hover:bg-slate-800 rounded-lg text-muted"
className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 hover:bg-black border border-[#222222] text-[#888888] rounded-none"
>
<X size={14} />
</button>
@@ -689,21 +689,21 @@ export default function InventoryPage() {
{getFilteredBoxes(existingBoxes).map(box => {
const itemCount = inventory.filter(i => i.box_label === box).length;
return (
<div key={box} className="bg-background/50 border border-slate-800/60 p-3 md:p-4 rounded-3xl flex flex-col gap-2 md:gap-3 group hover:border-primary/40 transition-all">
<div key={box} className="bg-black/50 border border-[#222222] p-3 md:p-4 flex flex-col gap-2 md:gap-3 group hover:border-primary/40 transition-all rounded-none">
<div className="flex-1 min-w-0">
<h4 className="text-lg font-normal text-white truncate">{box}</h4>
<p className="text-xs text-muted font-normal mt-0.5">{itemCount} items linked</p>
<p className="text-xs text-[#888888] font-normal mt-0.5">{itemCount} Items Linked</p>
</div>
<div className="flex gap-2 shrink-0">
<button
onClick={() => setSelectedBoxLabel(box)}
className="flex-1 py-3 bg-primary text-white text-xs font-normal rounded-xl flex items-center justify-center gap-2 hover:bg-blue-500 transition-colors shadow-lg shadow-primary/10 active:scale-95"
className="btn-primary flex-1 text-xs py-2 rounded-none"
>
<Printer size={14} /> Print Label
</button>
<button
onClick={() => { setSearchQuery(box); setShowBoxManager(false); setBoxSearchQuery(''); }}
className="px-4 py-3 bg-surface border border-slate-800 text-secondary text-xs font-normal rounded-xl hover:bg-slate-800 active:scale-95"
className="btn-secondary flex-1 text-xs py-2 rounded-none"
>
View
</button>
@@ -715,9 +715,9 @@ export default function InventoryPage() {
)}
</div>
<div className="p-4 md:p-6 py-3 md:py-4 bg-background/50 border-t border-slate-800 text-center flex items-center justify-center gap-2">
<div className="w-1 h-1 rounded-full bg-primary animate-pulse" />
<p className="text-xs text-secondary font-normal font-mono">TFM aInventory Box management mode</p>
<div className="p-4 md:p-6 py-3 md:py-4 bg-black/50 border-t border-[#222222] text-center flex items-center justify-center gap-2">
<div className="w-1 h-1 bg-primary animate-pulse" />
<p className="text-xs text-[#888888] font-normal font-mono">TFM aInventory Box Management Mode</p>
</div>
</div>
</div>
@@ -728,7 +728,7 @@ export default function InventoryPage() {
<div className="fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/95 animate-in zoom-in-95 duration-200">
<div className="w-full max-w-md flex flex-col gap-3 md:gap-4">
<div id="print-label-area" className="w-full bg-white p-4 md:p-6 rounded-lg shadow-2xl flex flex-col items-center gap-3 md:gap-4">
<div id="print-label-area" className="w-full bg-white p-4 md:p-6 shadow-none flex flex-col items-center gap-3 md:gap-4 rounded-none">
<h2 className="text-2xl font-normal text-black tracking-tighter text-center">
{selectedBoxLabel}
</h2>
@@ -743,9 +743,9 @@ export default function InventoryPage() {
<div className="flex flex-col gap-2 md:gap-3 no-print">
<button
onClick={() => window.print()}
className="w-full py-5 bg-primary text-white rounded-[2rem] font-normal text-lg flex items-center justify-center gap-3 shadow-2xl shadow-primary/40 active:scale-95 transition-all"
className="btn-primary w-full py-5 text-lg rounded-none"
>
<Printer size={20} /> Print to Dymo/Brother
<Printer size={20} /> Print To Dymo/Brother
</button>
<button
@@ -772,14 +772,14 @@ export default function InventoryPage() {
img.src = "data:image/svg+xml;base64," + btoa(svgData);
}
}}
className="w-full py-4 bg-surface border border-slate-800 text-white rounded-[2rem] font-normal text-sm flex items-center justify-center gap-2 active:scale-95 transition-all"
className="btn-secondary w-full py-4 text-sm rounded-none"
>
<Download size={16} /> Save for Mobile App
<Download size={16} /> Save For Mobile App
</button>
<button
onClick={() => setSelectedBoxLabel(null)}
className="w-full py-4 text-muted font-normal text-xs"
className="w-full py-4 text-[#888888] font-normal text-xs rounded-none"
>
Close Label Preview
</button>

View File

@@ -79,16 +79,16 @@ export default function LoginPage() {
if (!mounted) return null;
return (
<div data-testid="identity-check-overlay" className="bg-background flex items-center justify-center p-4 md:min-h-screen">
<div data-testid="identity-check-overlay" className="bg-[#131313] flex items-center justify-center p-4 md:min-h-screen font-sans">
<Toaster position="top-center" />
<div className="bg-surface border border-slate-800 rounded-3xl p-4 md:p-6 max-w-sm w-full shadow-2xl space-y-3 md:space-y-4 animate-in fade-in zoom-in duration-500">
<div className="bg-[#0A0A0A] border border-[#222222] rounded-none p-4 md:p-6 max-w-sm w-full shadow-none space-y-3 md:space-y-4 animate-in fade-in zoom-in duration-500">
<div className="text-center space-y-2">
<div className="w-16 h-16 bg-primary/10 text-primary rounded-2xl flex items-center justify-center mx-auto mb-4 border border-primary/20">
<div className="w-16 h-16 bg-[#F58618]/10 text-[#F58618] rounded-none flex items-center justify-center mx-auto mb-4 border border-[#F58618]/20">
<User size={32} />
</div>
<h2 className="text-2xl font-normal text-white tracking-tight">Identity Check</h2>
<p className="text-muted text-sm">Select operator profile or use direct login</p>
<p className="text-[#888888] text-sm font-normal">Select operator profile or use direct login</p>
</div>
<div data-testid="user-list" className="grid gap-2 md:gap-3">
@@ -101,23 +101,23 @@ export default function LoginPage() {
key={user.id}
data-testid="user-list-item"
onClick={() => handleSelectUser(user)}
className="bg-slate-800/50 hover:bg-slate-800 border border-slate-800 hover:border-primary/40 p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 rounded-2xl text-left transition-all group flex items-center justify-between"
className="bg-transparent hover:bg-[#1A1A1A] border border-[#222222] hover:border-[#F58618] p-4 lg:p-5 xl:p-6 rounded-none text-left transition-all group flex items-center justify-between"
>
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-full bg-surface border border-slate-700 flex items-center justify-center text-muted group-hover:text-primary transition-colors">
<div className="w-8 h-8 rounded-none bg-[#000000] border border-[#222222] flex items-center justify-center text-[#888888] group-hover:text-[#F58618] transition-colors">
{user.role === 'admin' ? <Shield size={14} /> : <User size={14} />}
</div>
<div>
<p className="text-white font-normal text-sm">{user.username}</p>
<p className="text-xs text-muted font-normal mt-1">{user.role}</p>
<p className="text-xs text-[#888888] font-normal mt-1">{user.role}</p>
</div>
</div>
<ChevronRight size={16} className="text-secondary group-hover:text-primary transition-colors" />
<ChevronRight size={16} className="text-[#888888] group-hover:text-[#F58618] transition-colors" />
</button>
))}
</>
) : (
<div className="text-center p-4 text-muted text-xs font-normal animate-pulse">
<div className="text-center p-4 text-[#888888] text-xs font-normal animate-pulse">
Connectivity issues? Use manual login below.
</div>
)}
@@ -126,7 +126,7 @@ export default function LoginPage() {
<button
data-testid="ldap-login-tab"
onClick={() => setIsEnterprise(true)}
className="flex items-center justify-center gap-2 py-4 rounded-2xl border border-dashed border-slate-700 text-muted hover:text-white hover:border-slate-500 transition-all font-normal text-xs"
className="flex items-center justify-center gap-2 py-4 rounded-none border border-dashed border-[#222222] text-[#888888] hover:text-white hover:border-[#888888] transition-all font-normal text-xs"
>
<Lock size={12} />
Enterprise
@@ -137,7 +137,7 @@ export default function LoginPage() {
setSelectedUserForLogin({ username: '' });
// We use an empty username object to trigger the manual input view
}}
className="flex items-center justify-center gap-2 py-4 rounded-2xl border border-primary/20 bg-primary/5 text-primary hover:bg-primary/10 transition-all font-normal text-xs"
className="flex items-center justify-center gap-2 py-4 rounded-none border border-[#F58618]/20 bg-[#F58618]/5 text-[#F58618] hover:bg-[#F58618]/10 transition-all font-normal text-xs"
>
<User size={12} />
Manual Login
@@ -147,40 +147,40 @@ export default function LoginPage() {
) : isEnterprise ? (
<div className="space-y-4 animate-in slide-in-from-right-4 duration-300">
<div className="flex justify-between items-center px-1">
<p className="text-xs font-normal text-muted">Enterprise Account</p>
<p className="text-xs font-normal text-[#888888]">Enterprise Account</p>
<button
onClick={() => setIsEnterprise(false)}
className="text-xs font-normal text-primary hover:underline"
className="text-xs font-normal text-[#F58618] hover:underline"
>
Back to profiles
</button>
</div>
<div className="space-y-2">
<label className="text-xs font-normal text-muted px-1">Username</label>
<label className="text-xs font-normal text-[#888888] px-1">Username</label>
<div className="relative">
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-[#888888]" size={16} />
<input
ref={enterpriseUserRef}
data-testid="username-input"
type="text"
autoFocus
className="w-full bg-slate-800/50 border border-slate-800 focus:border-primary rounded-2xl py-4 pl-12 pr-4 text-white focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-[#000000] border border-[#222222] focus:border-[#F58618] rounded-none py-4 pl-12 pr-4 text-white focus:outline-none transition-all placeholder:text-[#333333] font-mono"
placeholder="e.g. jsmith"
/>
</div>
</div>
<div className="space-y-2">
<label className="text-xs font-normal text-muted px-1">Password</label>
<label className="text-xs font-normal text-[#888888] px-1">Password</label>
<div className="relative">
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-[#888888]" size={16} />
<input
ref={enterprisePassRef}
data-testid="password-input"
type="password"
onKeyDown={(e) => e.key === 'Enter' && handleLogin()}
className="w-full bg-slate-800/50 border border-slate-800 focus:border-primary rounded-2xl py-4 pl-12 pr-4 text-white/50 focus:text-white focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-[#000000] border border-[#222222] focus:border-[#F58618] rounded-none py-4 pl-12 pr-4 text-white/50 focus:text-white focus:outline-none transition-all placeholder:text-[#333333] font-mono"
placeholder="Enter password"
/>
</div>
@@ -189,52 +189,52 @@ export default function LoginPage() {
<button
data-testid="login-submit"
onClick={handleLogin}
className="w-full bg-primary text-white font-normal py-4 rounded-2xl shadow-xl shadow-primary/20 active:scale-95 transition-all"
className="w-full bg-[#F58618] text-black font-normal py-4 rounded-none shadow-none active:scale-95 transition-all"
>
Sign In
</button>
</div>
) : (
<div className="space-y-4 animate-in slide-in-from-right-4 duration-300">
<div className="bg-slate-800/30 p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 rounded-2xl border border-slate-800 flex items-center gap-3">
<div className="bg-[#1A1A1A] p-4 lg:p-5 xl:p-6 rounded-none border border-[#222222] flex items-center gap-3">
<button
onClick={() => setSelectedUserForLogin(null)}
className="p-1 hover:bg-slate-700 rounded-lg transition-colors"
className="p-1 hover:bg-[#222222] rounded-none transition-colors"
>
<X size={16} className="text-secondary" />
<X size={16} className="text-[#888888]" />
</button>
<div>
<p className="text-sm font-normal text-muted">Logging in as</p>
<p className="text-sm font-normal text-[#888888]">Logging in as</p>
<p className="text-white font-normal">{selectedUserForLogin.username || "Manual Input"}</p>
</div>
</div>
<div className="space-y-2">
<label className="text-xs font-normal text-muted px-1">Username</label>
<label className="text-xs font-normal text-[#888888] px-1">Username</label>
<div className="relative">
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-[#888888]" size={16} />
<input
type="text"
autoFocus
value={selectedUserForLogin.username || ""}
onChange={(e) => setSelectedUserForLogin({...selectedUserForLogin, username: e.target.value})}
className="w-full bg-slate-800/50 border border-slate-800 focus:border-primary rounded-2xl py-4 pl-12 pr-4 text-white focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-[#000000] border border-[#222222] focus:border-[#F58618] rounded-none py-4 pl-12 pr-4 text-white focus:outline-none transition-all placeholder:text-[#333333] font-mono"
placeholder="Admin"
/>
</div>
</div>
<div className="space-y-2">
<label className="text-xs font-normal text-muted px-1">Password</label>
<label className="text-xs font-normal text-[#888888] px-1">Password</label>
<div className="relative">
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-[#888888]" size={16} />
<input
ref={localPassRef}
data-testid="local-password-input"
type="password"
autoFocus={!!selectedUserForLogin.username}
onKeyDown={(e) => e.key === 'Enter' && handleLogin()}
className="w-full bg-slate-800/50 border border-slate-800 focus:border-primary rounded-2xl py-4 pl-12 pr-4 text-white/50 focus:text-white focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-[#000000] border border-[#222222] focus:border-[#F58618] rounded-none py-4 pl-12 pr-4 text-white/50 focus:text-white focus:outline-none transition-all placeholder:text-[#333333] font-mono"
placeholder="Enter password"
/>
</div>
@@ -243,7 +243,7 @@ export default function LoginPage() {
<button
data-testid="local-login-submit"
onClick={handleLogin}
className="w-full bg-primary text-white font-normal py-4 rounded-2xl shadow-xl shadow-primary/20 active:scale-95 transition-all"
className="w-full bg-[#F58618] text-black font-normal py-4 rounded-none shadow-none active:scale-95 transition-all"
>
Verify Identity
</button>
@@ -253,8 +253,8 @@ export default function LoginPage() {
{/* Progress bar hint */}
{users.length === 0 && !selectedUserForLogin && !isEnterprise && (
<div className="w-full bg-slate-800 h-1 rounded-full overflow-hidden">
<div className="bg-primary h-full animate-progress-fast shadow-[0_0_8px_rgba(var(--primary-rgb),0.5)]"></div>
<div className="w-full bg-[#1A1A1A] h-1 rounded-none overflow-hidden">
<div className="bg-[#F58618] h-full animate-progress-fast"></div>
</div>
)}
</div>

View File

@@ -113,11 +113,11 @@ export default function AdminOverlay({
loading={confirmState.loading}
dangerLevel={confirmState.affectedCount && confirmState.affectedCount > 10 ? 'high' : 'medium'}
/>
<div data-testid="admin-overlay" className="fixed inset-0 z-50 bg-background/60 animate-in fade-in duration-300">
<div className="absolute inset-y-0 right-0 w-full max-w-md sm:max-w-lg md:max-w-md bg-surface border-l border-slate-800 shadow-2xl flex flex-col animate-in slide-in-from-right duration-500">
<div className="p-3 md:p-6 border-b border-slate-800 flex items-center justify-between">
<div data-testid="admin-overlay" className="fixed inset-0 z-50 bg-black/60 animate-in fade-in duration-300 font-sans">
<div className="absolute inset-y-0 right-0 w-full max-w-md sm:max-w-lg md:max-w-md bg-[#0A0A0A] border-l border-[#222222] shadow-none flex flex-col animate-in slide-in-from-right duration-500 rounded-none">
<div className="p-3 md:p-6 border-b border-[#222222] flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 bg-slate-800 rounded-xl text-primary">
<div className="p-2 bg-[#1A1A1A] rounded-none text-primary border border-[#222222]">
<Shield size={20} />
</div>
<h2 className="text-xl font-normal text-white">System Admin</h2>
@@ -125,7 +125,7 @@ export default function AdminOverlay({
<button
data-testid="close-admin-overlay"
onClick={onClose}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 hover:bg-slate-800 rounded-full transition-colors text-muted focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="p-2 hover:bg-[#1A1A1A] rounded-none transition-colors text-[#888888] focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label="Close"
>
<X size={20} />
@@ -136,12 +136,12 @@ export default function AdminOverlay({
<section className="space-y-2 md:space-y-3">
<div className="flex items-center justify-between">
<div>
<h3 className="text-sm font-normal text-secondary">User Management</h3>
<p className="text-xs text-muted mt-0.5">Create accounts and control access</p>
<h3 className="text-sm font-normal text-[#888888]">User Management</h3>
<p className="text-xs text-[#888888] mt-0.5">Create accounts and control access</p>
</div>
<button
onClick={() => setShowCreateUserModal(true)}
className="flex items-center gap-1 text-xs font-normal text-primary hover:text-blue-400 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded px-1"
className="flex items-center gap-1 text-xs font-normal text-primary hover:text-[#F58618]/80 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded-none px-1"
>
<UserPlus size={12} /> Add User
</button>
@@ -149,14 +149,14 @@ export default function AdminOverlay({
<div className="grid gap-1.5 md:gap-2">
{users.map(u => (
<div key={u.id} className="bg-slate-800/40 border border-slate-800 p-3 md:p-4 rounded-2xl flex items-center justify-between">
<div key={u.id} className="bg-transparent border border-[#222222] p-3 md:p-4 rounded-none flex items-center justify-between">
<div className="flex items-center gap-2 md:gap-3">
<div className={`p-2 rounded-lg ${u.role === 'admin' ? "bg-primary/20 text-primary" : "bg-slate-700 text-secondary"}`}>
<div className={`p-2 rounded-none ${u.role === 'admin' ? "bg-primary/20 text-primary" : "bg-[#1A1A1A] text-[#888888]"}`}>
<User size={16} />
</div>
<div>
<p className="text-sm font-normal text-white">{u.username}</p>
<p className="text-xs font-normal text-muted">{u.role}</p>
<p className="text-xs font-normal text-[#888888]">{u.role}</p>
</div>
</div>
@@ -171,7 +171,7 @@ export default function AdminOverlay({
loading: false,
});
}}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 text-rose-500 hover:bg-rose-500/10 rounded-lg transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
className="p-2 text-rose-500 hover:bg-rose-500/10 rounded-none transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
aria-label={`Delete user ${u.username}`}
>
<Trash2 size={16} />
@@ -185,12 +185,12 @@ export default function AdminOverlay({
<section className="space-y-2 md:space-y-3">
<div className="flex items-center justify-between">
<div>
<h3 className="text-sm font-normal text-secondary">Category Groups</h3>
<p className="text-xs text-muted mt-0.5">Organize items by type or location</p>
<h3 className="text-sm font-normal text-[#888888]">Category Groups</h3>
<p className="text-xs text-[#888888] mt-0.5">Organize items by type or location</p>
</div>
<button
onClick={() => setShowCreateCategoryModal(true)}
className="flex items-center gap-1 text-xs font-normal text-primary hover:text-blue-400 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded px-1"
className="flex items-center gap-1 text-xs font-normal text-primary hover:text-[#F58618]/80 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded-none px-1"
>
<Plus size={12} /> Add Category
</button>
@@ -198,14 +198,14 @@ export default function AdminOverlay({
<div className="grid gap-1.5 md:gap-2">
{categories.map(cat => (
<div key={cat.id} className="bg-slate-800/40 border border-slate-800 p-3 md:p-4 rounded-2xl flex items-center justify-between">
<div key={cat.id} className="bg-transparent border border-[#222222] p-3 md:p-4 rounded-none flex items-center justify-between">
<div className="flex items-center gap-2 md:gap-3">
<div className="p-2 bg-primary/10 rounded-lg text-primary">
<div className="p-2 bg-primary/10 rounded-none text-primary">
<Layers size={16} />
</div>
<div>
<p className="text-sm font-normal text-white">{cat.name}</p>
<p className="text-xs text-muted font-mono">{cat.description || 'No description'}</p>
<p className="text-xs text-[#888888] font-mono">{cat.description || 'No description'}</p>
</div>
</div>
@@ -220,7 +220,7 @@ export default function AdminOverlay({
loading: false,
});
}}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 text-rose-500 hover:bg-rose-500/10 rounded-lg transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
className="p-2 text-rose-500 hover:bg-rose-500/10 rounded-none transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
aria-label={`Delete category ${cat.name}`}
>
<Trash2 size={16} />
@@ -230,18 +230,18 @@ export default function AdminOverlay({
</div>
</section>
<section className="p-4 md:p-6 bg-slate-800/30 rounded-3xl border border-slate-800 space-y-2 md:space-y-3">
<section className="p-4 md:p-6 bg-[#1A1A1A] rounded-none border border-[#222222] space-y-2 md:space-y-3">
<div className="flex items-center gap-2 text-rose-500">
<AlertTriangle size={16} />
<p className="text-sm font-normal">Sign Out</p>
</div>
<p className="text-xs lg:text-sm xl:text-base lg:text-lg xl:text-xl lg:text-2xl xl:text-3xl lg:text-4xl xl:text-5xl text-muted">End your session and return to the login screen.</p>
<p className="text-xs text-[#888888]">End your session and return to the login screen.</p>
<button
onClick={() => {
import('@/lib/auth').then(m => m.clearAuth());
window.location.href = '/login';
}}
className="w-full bg-rose-500/10 hover:bg-rose-500/20 text-rose-500 border border-rose-500/20 font-normal py-3 rounded-xl transition-all flex items-center justify-center gap-2 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
className="w-full bg-rose-500/10 hover:bg-rose-500/20 text-rose-500 border border-rose-500/20 font-normal py-3 rounded-none transition-all flex items-center justify-center gap-2 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
>
<LogOut size={16} /> Sign Out
</button>

View File

@@ -25,13 +25,13 @@ export default function BottomNav({
const isAdmin = pathname === '/admin';
return (
<footer className="fixed bottom-0 left-0 right-0 py-3 lg:py-4 xl:py-5 px-2 pb-safe bg-background border-t border-slate-900 z-40 transition-all duration-300">
<div className="max-w-xl mx-auto flex justify-around items-center text-secondary">
<footer className="fixed bottom-0 left-0 right-0 py-3 lg:py-4 xl:py-5 px-2 pb-safe bg-[#0A0A0A] border-t border-[#222222] z-40 transition-all duration-300 font-sans">
<div className="max-w-xl mx-auto flex justify-around items-center text-[#888888]">
<button
onClick={() => router.push('/')}
aria-label="Go to Home"
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isHome && "text-primary")}
className={cn("flex flex-col items-center gap-1 rounded-none px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isHome && "text-primary")}
>
<Smartphone size={20} />
<span className="text-xs font-normal transition-all">Home</span>
@@ -41,7 +41,7 @@ export default function BottomNav({
<button
onClick={() => router.push('/inventory')}
aria-label="Go to Inventory"
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isInventory && "text-primary")}
className={cn("flex flex-col items-center gap-1 rounded-none px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isInventory && "text-primary")}
>
<Package size={20} />
<span className="text-xs font-normal transition-all">Inventory</span>
@@ -51,7 +51,7 @@ export default function BottomNav({
<button
onClick={() => router.push('/logs')}
aria-label="Go to Logs"
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isLogs && "text-primary")}
className={cn("flex flex-col items-center gap-1 rounded-none px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isLogs && "text-primary")}
>
<History size={20} />
<span className="text-xs font-normal transition-all">Logs</span>
@@ -63,7 +63,7 @@ export default function BottomNav({
data-testid="admin-button"
onClick={() => router.push('/admin')}
aria-label="Go to Admin"
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isAdmin && "text-primary")}
className={cn("flex flex-col items-center gap-1 rounded-none px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isAdmin && "text-primary")}
>
<Settings size={20} />
<span className="text-xs font-normal transition-all">Admin</span>
@@ -79,7 +79,7 @@ export default function BottomNav({
}
}}
aria-label="Logout"
className="flex flex-col items-center gap-1 text-rose-500 hover:text-rose-400 cursor-pointer transition-colors rounded px-2 py-1 focus:ring-2 focus:ring-rose-500 focus:outline-none"
className="flex flex-col items-center gap-1 text-rose-500 hover:text-rose-400 cursor-pointer transition-colors rounded-none px-2 py-1 focus:ring-2 focus:ring-rose-500 focus:outline-none"
>
<LogOut size={20} />
<span className="text-xs font-normal transition-all">Logout</span>

View File

@@ -42,15 +42,15 @@ export default function CameraView({
const cn = (...classes: any[]) => classes.filter(Boolean).join(' ');
return (
<div className="w-full max-w-md mx-auto flex flex-col gap-3 md:gap-4">
<div className="w-full max-w-md mx-auto flex flex-col gap-3 md:gap-4 font-sans">
{/* Video Viewport Area */}
<div className="relative w-full aspect-square overflow-hidden rounded-[2.5rem] shadow-[0_20px_50px_rgba(0,0,0,0.5)] bg-background border-2 border-slate-800/50 p-4 sm:p-6 lg:p-8 xl:p-10">
<div className="relative w-full aspect-square overflow-hidden rounded-none shadow-none bg-[#131313] border-2 border-[#222222] p-4 sm:p-6 lg:p-8 xl:p-10">
<div className="absolute inset-4 sm:inset-6 z-10 pointer-events-none flex items-center justify-center">
<div className="w-full h-full border border-primary/30 rounded-[2rem] relative">
<div className="absolute top-0 left-0 w-10 h-10 border-t-4 border-l-4 border-primary rounded-tl-2xl shadow-[0_0_15px_rgba(59,130,246,0.5)]" />
<div className="absolute top-0 right-0 w-10 h-10 border-t-4 border-r-4 border-primary rounded-tr-2xl shadow-[0_0_15px_rgba(59,130,246,0.5)]" />
<div className="absolute bottom-0 left-0 w-10 h-10 border-b-4 border-l-4 border-primary rounded-bl-2xl shadow-[0_0_15px_rgba(59,130,246,0.5)]" />
<div className="absolute bottom-0 right-0 w-10 h-10 border-b-4 border-r-4 border-primary rounded-br-2xl shadow-[0_0_15px_rgba(59,130,246,0.5)]" />
<div className="w-full h-full border border-primary/30 rounded-none relative">
<div className="absolute top-0 left-0 w-10 h-10 border-t-4 border-l-4 border-primary rounded-none shadow-none" />
<div className="absolute top-0 right-0 w-10 h-10 border-t-4 border-r-4 border-primary rounded-none shadow-none" />
<div className="absolute bottom-0 left-0 w-10 h-10 border-b-4 border-l-4 border-primary rounded-none shadow-none" />
<div className="absolute bottom-0 right-0 w-10 h-10 border-b-4 border-r-4 border-primary rounded-none shadow-none" />
{isStarted && !paused && !isSelecting && (
<div className="absolute top-0 left-0 right-0 h-1 bg-primary animate-scan-fast" />
@@ -58,11 +58,11 @@ export default function CameraView({
</div>
</div>
<div id={scannerId} data-testid="camera-indicator" className="w-full h-full bg-surface object-cover" />
<div id={scannerId} data-testid="camera-indicator" className="w-full h-full bg-[#0A0A0A] object-cover" />
{/* Selection UI */}
{isSelecting && capturedImage && (
<div className="absolute inset-0 z-50 bg-background flex flex-col">
<div className="absolute inset-0 z-50 bg-[#131313] flex flex-col">
<div className="relative flex-1 bg-black flex items-center justify-center overflow-hidden">
<img
src={capturedImage || undefined}
@@ -77,7 +77,7 @@ export default function CameraView({
key={i}
onClick={() => onWordSelect(w.text)}
aria-label={`Select text: ${w.text}`}
className="absolute border border-primary bg-primary/20 rounded-sm active:bg-primary/50 cursor-pointer transition-colors pointer-events-auto focus:ring-2 focus:ring-primary focus:outline-none"
className="absolute border border-primary bg-primary/20 rounded-none active:bg-primary/50 cursor-pointer transition-colors pointer-events-auto focus:ring-2 focus:ring-primary focus:outline-none"
style={{
left: `${(w.bbox.x0 / 1600) * 100}%`,
top: `${(w.bbox.y0 / (1600 * (9 / 16))) * 100}%`,
@@ -89,15 +89,15 @@ export default function CameraView({
</div>
</div>
</div>
<div className="p-6 lg:p-8 xl:p-10 bg-surface/90 border-t border-slate-800 flex flex-col gap-4">
<div className="p-6 lg:p-8 xl:p-10 bg-[#0A0A0A]/90 border-t border-[#222222] flex flex-col gap-4">
<div className="flex flex-col items-center gap-1">
<p className="text-sm font-normal text-white italic text-center">Text Found</p>
<p className="text-xs text-muted font-normal text-center">Tap any text to use it</p>
<p className="text-xs text-[#888888] font-normal text-center">Tap any text to use it</p>
</div>
<button
onClick={onCancelSelection}
aria-label="Cancel text selection"
className="w-full py-4 bg-slate-800 hover:bg-slate-700 text-white rounded-2xl font-normal text-xs cursor-pointer transition-all active:scale-95 border border-slate-700 focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="w-full py-4 bg-[#1A1A1A] hover:bg-[#222222] text-white rounded-none font-normal text-xs cursor-pointer transition-all active:scale-95 border border-[#222222] focus:ring-2 focus:ring-primary focus:outline-none"
>
Close OCR Preview
</button>
@@ -106,23 +106,23 @@ export default function CameraView({
)}
{!isStarted && !error && (
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface text-secondary gap-4">
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-[#0A0A0A] text-[#888888] gap-4">
<RefreshCw className="w-8 h-8 animate-spin text-primary" />
<p className="text-sm font-normal">Initializing camera...</p>
</div>
)}
{error && (
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface text-secondary px-8 text-center gap-4">
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-[#0A0A0A] text-[#888888] px-8 text-center gap-4">
<XCircle className="w-10 h-10 text-red-500" />
<div>
<p className="font-normal text-white">Camera Error</p>
<p className="text-xs text-secondary mt-1">{error}</p>
<p className="text-xs text-[#888888] mt-1">{error}</p>
</div>
<button
onClick={() => window.location.reload()}
aria-label="Reload page and try again"
className="mt-4 px-6 py-2 bg-slate-800 rounded-full text-sm font-normal cursor-pointer hover:bg-slate-700 transition-colors focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="mt-4 px-6 py-2 bg-[#1A1A1A] rounded-none text-sm font-normal cursor-pointer hover:bg-[#222222] transition-colors focus:ring-2 focus:ring-primary focus:outline-none border border-[#222222]"
>
Try Again
</button>
@@ -131,7 +131,7 @@ export default function CameraView({
</div>
{/* External Controls Area */}
<div className="flex flex-col gap-4 bg-surface/50 p-5 lg:p-6 xl:p-8 rounded-[2.5rem] border border-slate-800/50 shadow-2xl">
<div className="flex flex-col gap-4 bg-[#0A0A0A]/50 p-5 lg:p-6 xl:p-8 rounded-none border border-[#222222] shadow-none">
<div className="flex items-center gap-3 w-full">
{hasZoom && (
<button
@@ -146,27 +146,27 @@ export default function CameraView({
}}
data-testid="zoom-control"
aria-label={`Zoom ${zoom.toFixed(1)}x`}
className="h-14 px-5 bg-slate-800/80 hover:bg-slate-700 border border-slate-700 text-white rounded-2xl flex flex-col items-center justify-center shadow-lg cursor-pointer transition-all active:scale-95 shrink-0 focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="h-14 px-5 bg-[#1A1A1A] hover:bg-[#222222] border border-[#222222] text-white rounded-none flex flex-col items-center justify-center shadow-none cursor-pointer transition-all active:scale-95 shrink-0 focus:ring-2 focus:ring-primary focus:outline-none"
>
<span className="text-xs font-normal tabular-nums">{zoom.toFixed(1)}x</span>
<span className="text-xs text-primary font-normal tracking-tighter">Zoom</span>
</button>
)}
<div className="flex-1 h-14 bg-background/40 border border-slate-800/50 rounded-2xl flex items-center justify-center gap-3 px-4 lg:px-5 xl:px-6 relative overflow-hidden group">
<div className="flex-1 h-14 bg-black/40 border border-[#222222] rounded-none flex items-center justify-center gap-3 px-4 lg:px-5 xl:px-6 relative overflow-hidden group">
{ocrProcessing ? (
<>
<RefreshCw className="animate-spin text-primary" size={18} />
<span className="text-xs font-normal text-secondary leading-none">Analyzing</span>
<span className="text-xs font-normal text-[#888888] leading-none">Analyzing</span>
</>
) : (
<>
<Search
className={cn('text-secondary transition-colors group-hover:text-primary', !isStarted && 'opacity-20')}
className={cn('text-[#888888] transition-colors group-hover:text-primary', !isStarted && 'opacity-20')}
size={18}
/>
<div className="flex flex-col">
<span className="text-xs text-muted font-normal leading-none">Smart Scan</span>
<span className="text-xs text-[#888888] font-normal leading-none">Smart Scan</span>
<span className="text-xs font-normal text-primary leading-tight tabular-nums">
{countdown === 0 ? 'Scanning' : `${countdown}s`}
</span>
@@ -176,15 +176,15 @@ export default function CameraView({
{/* Visual Progress Bar */}
<div
className="absolute bottom-0 left-0 h-0.5 bg-primary/40 transition-all duration-1000 ease-linear shadow-[0_0_10px_rgba(59,130,246,0.5)]"
className="absolute bottom-0 left-0 h-0.5 bg-primary/40 transition-all duration-1000 ease-linear shadow-none"
style={{ width: `${((4 - countdown) / 4) * 100}%` }}
/>
</div>
</div>
<div className="w-full flex justify-center items-center gap-2">
<div className="w-1 h-1 rounded-full bg-green-500 animate-pulse" />
<p className="text-xs text-secondary font-normal">
<div className="w-1 h-1 rounded-none bg-green-500 animate-pulse" />
<p className="text-xs text-[#888888] font-normal">
Scanner active · Use zoom or tap scan
</p>
</div>

View File

@@ -55,11 +55,11 @@ export default function ConfirmationModal({
return (
<div data-testid="confirmation-modal" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="bg-surface border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
<div className="bg-surface border border-border shadow-xl max-w-sm w-full mx-4">
{/* Header */}
<div className="flex items-center justify-between p-6 border-b border-slate-800">
<div className="flex items-center justify-between p-6 border-b border-border">
<div className="flex items-center gap-3">
<div className="p-2 bg-rose-500/10 rounded-lg text-rose-500">
<div className="p-2 bg-rose-500/10 text-rose-500">
<AlertTriangle size={20} />
</div>
<h2 className="text-lg font-normal text-white">{title}</h2>
@@ -67,7 +67,7 @@ export default function ConfirmationModal({
<button
onClick={onCancel}
disabled={loading}
className="p-1 text-muted hover:text-secondary rounded cursor-pointer focus:ring-2 focus:ring-primary focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed"
className="p-1 text-muted hover:text-secondary cursor-pointer focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed"
aria-label="Close modal"
>
<X size={20} />
@@ -81,7 +81,7 @@ export default function ConfirmationModal({
{/* Item Name (if provided) */}
{itemName && (
<div className="bg-slate-800/40 border border-slate-800 rounded p-3">
<div className="bg-black/40 border border-border p-3">
<p className="text-xs text-muted font-normal">Item</p>
<p className="text-sm font-mono text-white mt-1">{itemName}</p>
</div>
@@ -89,7 +89,7 @@ export default function ConfirmationModal({
{/* Consequence Warning */}
{consequence && (
<div className="flex gap-2 p-3 bg-rose-500/5 border border-rose-500/20 rounded">
<div className="flex gap-2 p-3 bg-rose-500/5 border border-rose-500/20">
<span className="text-rose-500 flex-shrink-0"></span>
<p className="text-sm text-rose-400">{consequence}</p>
</div>
@@ -106,7 +106,7 @@ export default function ConfirmationModal({
{/* High-Risk Warning & Confirmation Input */}
{requiresTextConfirm && (
<div className="space-y-3 pt-2 border-t border-slate-800">
<div className="space-y-3 pt-2 border-t border-border">
<p className="text-sm font-normal text-rose-400">
Type "Delete" to confirm this high-risk action
</p>
@@ -118,7 +118,7 @@ export default function ConfirmationModal({
setError(null);
}}
placeholder="Type Delete"
className="w-full px-3 py-2.5 bg-slate-800 border border-slate-700 rounded text-white placeholder:text-muted focus:outline-none focus:ring-2 focus:ring-primary disabled:opacity-50"
className="w-full"
disabled={loading}
onKeyDown={(e) => {
if (e.key === 'Enter' && canConfirm && !loading) {
@@ -134,11 +134,11 @@ export default function ConfirmationModal({
</div>
{/* Actions */}
<div className="flex gap-2 p-6 border-t border-slate-800">
<div className="flex gap-2 p-6 border-t border-border">
<button
onClick={onCancel}
disabled={loading}
className="flex-1 px-4 py-2.5 text-secondary bg-slate-800 border border-slate-700 rounded font-normal hover:bg-slate-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus:ring-2 focus:ring-primary focus:outline-none"
className="btn-secondary flex-1"
>
Keep Item
</button>
@@ -146,7 +146,7 @@ export default function ConfirmationModal({
onClick={handleConfirm}
data-testid="confirm-action"
disabled={loading || !canConfirm}
className="flex-1 px-4 py-2.5 bg-rose-600 text-white rounded font-normal hover:bg-rose-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 focus:ring-2 focus:ring-offset-2 focus:ring-offset-slate-900 focus:ring-rose-600 focus:outline-none"
className="flex-1 px-4 py-2.5 bg-red-600 text-white font-normal hover:bg-red-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 focus:outline-none"
>
{loading ? (
<>

View File

@@ -53,57 +53,56 @@ export default function InventoryTable({
if (categories.length === 0) {
return (
<div className="py-2 lg:py-3 xl:py-40 text-center text-secondary">
<div className="py-2 lg:py-3 xl:py-40 text-center text-[#888888] font-sans">
<Package size={48} className="mx-auto mb-4 opacity-10" />
<p className="font-normal">No results found</p>
<p className="font-normal">No Results Found</p>
</div>
);
}
return (
<section className="space-y-3">
<section className="space-y-4 font-sans">
{categories.map(cat => {
const categoryItems = items.filter(i => i.category === cat);
return (
<div key={cat} className="bg-surface/50 border border-slate-800/50 rounded-3xl overflow-hidden transition-all duration-300">
<div key={cat} className="bg-surface-container border border-border transition-all duration-300">
<div
className="w-full p-4 md:p-5 lg:p-6 xl:p-8 flex items-center justify-between hover:bg-surface/60 transition-colors cursor-pointer"
className="w-full p-2 md:p-3 flex items-center justify-between hover:bg-surface-bright transition-colors cursor-pointer"
onClick={() => onExpandCategory(expandedCategory === cat ? null : cat)}
>
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-primary/10 flex items-center justify-center text-primary transition-colors">
<Layers size={20} />
<div className="w-8 h-8 bg-primary/10 flex items-center justify-center text-primary border border-primary/20 transition-colors">
<Layers size={16} />
</div>
<div className="text-left">
<h3 className="card-title text-base sm:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl">{cat}</h3>
<p className="card-subtitle tracking-tight">
{categoryItems.length} Item types in stock
<h3 className="text-sm md:text-base font-normal text-foreground">{cat}</h3>
<p className="text-[10px] text-secondary font-normal">
{categoryItems.length} Item Types In Stock
</p>
</div>
</div>
<div className="flex items-center gap-3">
{expandedCategory === cat ? <ChevronDown size={20} className="text-primary" /> : <ChevronRight size={20} className="text-secondary" />}
{expandedCategory === cat ? <ChevronDown size={18} className="text-primary" /> : <ChevronRight size={18} className="text-secondary" />}
{onEditCategory && (
<button
onClick={(e) => {
e.stopPropagation();
onEditCategory(cat);
}}
className="p-2 lg:p-3 xl:p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 hover:bg-slate-800 rounded-full text-muted hover:text-primary transition-colors relative z-10"
className="p-1.5 hover:bg-surface-bright text-secondary hover:text-primary transition-colors border border-transparent hover:border-border"
>
<EditIcon size={16} />
<EditIcon size={14} />
</button>
)}
</div>
</div>
{expandedCategory === cat && (
<div className="p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 pt-0 space-y-2 animate-in slide-in-from-top-4 duration-300">
<div className="h-px bg-slate-800/50 mb-4 mx-2" />
<div className="divide-y divide-border border-t border-border animate-in slide-in-from-top-2 duration-200">
{categoryItems.map(item => (
<div
key={item.id}
className="bg-background/40 border border-slate-800/50 p-4 rounded-2xl flex items-center justify-between hover:border-primary/40 transition-all active:scale-[0.98]"
className="bg-black/20 p-2 md:p-3 flex items-center justify-between hover:bg-surface-bright/50 transition-colors"
>
<div
onClick={() => handleItemClick(item)}
@@ -115,7 +114,7 @@ export default function InventoryTable({
e.stopPropagation();
setSelectedPhotoItem(item);
}}
className="w-12 h-12 rounded-xl shrink-0 border-2 border-slate-300 overflow-hidden cursor-pointer hover:border-primary transition-colors active:scale-95"
className="w-10 h-10 shrink-0 border border-border overflow-hidden cursor-pointer hover:border-primary transition-colors"
>
<img
src={buildPhotoUrl(backendUrl, item.photo_path || item.image_url || '')}
@@ -125,30 +124,25 @@ export default function InventoryTable({
/>
</div>
) : (
<div className="w-12 h-12 rounded-xl bg-green-500/10 flex items-center justify-center text-green-500 shrink-0">
<div className="w-10 h-10 bg-green-500/10 flex items-center justify-center text-green-500 shrink-0 border border-green-500/20">
<Package size={14} />
</div>
)}
<div className="truncate">
<h4 className="card-title truncate">{item.name}</h4>
{item.photo_path || item.image_url ? (
<p className="card-subtitle mt-0 lowercase opacity-80 text-xs">Tap photo for details</p>
) : (
<>
<p className="card-subtitle mt-0 lowercase opacity-80 truncate">{item.specs}</p>
<p className="card-subtitle mt-0 text-xs">No photo</p>
</>
)}
<h4 className="text-sm font-normal text-foreground truncate">{item.name}</h4>
<p className="text-[10px] text-secondary font-normal truncate">
{item.specs || (item.photo_path || item.image_url ? 'Tap Photo For Details' : 'No Specs')}
</p>
</div>
</div>
<div className="text-right shrink-0">
<span className={cn(
"text-lg font-normal",
item.quantity <= item.min_quantity ? "text-amber-500" : "text-primary"
"text-base font-normal tabular-nums",
item.quantity <= item.min_quantity ? "text-warning" : "text-primary"
)}>
{item.quantity}
</span>
<p className="text-sm text-muted font-normal tracking-tight">Stock</p>
<p className="text-[10px] text-secondary font-normal">Stock</p>
</div>
</div>
))}

View File

@@ -68,16 +68,16 @@ export default function ItemDetailModal({
};
return (
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4">
<div className="bg-surface border border-slate-800 rounded-3xl max-w-2xl w-full max-h-[90vh] overflow-y-auto">
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 font-sans">
<div className="bg-[#0A0A0A] border border-[#222222] rounded-none max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-none">
{/* Header */}
<div className="sticky top-0 bg-surface border-b border-slate-800/50 p-4 md:p-6 flex items-center justify-between">
<div className="sticky top-0 bg-[#0A0A0A] border-b border-[#222222] p-4 md:p-6 flex items-center justify-between">
<h2 className="text-xl md:text-2xl font-normal text-white truncate">{item.name}</h2>
<div className="flex items-center gap-2">
{currentPhoto && (
<button
onClick={() => setShowDebugPanel(true)}
className="p-2 hover:bg-yellow-900/50 rounded-full text-yellow-400 hover:text-yellow-300 transition-colors"
className="p-2 hover:bg-[#1A1A1A] rounded-none text-yellow-400 hover:text-yellow-300 transition-colors border border-transparent hover:border-[#222222]"
title="Debug rotation & crop"
aria-label="Debug panel"
>
@@ -86,7 +86,7 @@ export default function ItemDetailModal({
)}
<button
onClick={onClose}
className="p-2 hover:bg-slate-800 rounded-full text-muted hover:text-white transition-colors"
className="p-2 hover:bg-[#1A1A1A] rounded-none text-[#888888] hover:text-white transition-colors border border-transparent hover:border-[#222222]"
aria-label="Close modal"
>
<X size={20} />
@@ -99,31 +99,31 @@ export default function ItemDetailModal({
{/* Item Details */}
<div className="grid grid-cols-2 gap-4">
<div>
<p className="text-xs text-muted mb-1">Category</p>
<p className="text-xs text-[#888888] mb-1">Category</p>
<p className="text-sm text-white">{item.category}</p>
</div>
<div>
<p className="text-xs text-muted mb-1">Type</p>
<p className="text-xs text-[#888888] mb-1">Type</p>
<p className="text-sm text-white">{item.type || 'N/A'}</p>
</div>
<div>
<p className="text-xs text-muted mb-1">Quantity</p>
<p className="text-xs text-[#888888] mb-1">Quantity</p>
<p className="text-sm text-white">{item.quantity}</p>
</div>
<div>
<p className="text-xs text-muted mb-1">Part Number</p>
<p className="text-xs text-[#888888] mb-1">Part Number</p>
<p className="text-sm text-white">{item.part_number || 'N/A'}</p>
</div>
{item.barcode && (
<div className="col-span-2">
<p className="text-xs text-muted mb-1">Barcode</p>
<p className="text-xs text-[#888888] mb-1">Barcode</p>
<p className="text-sm text-white font-mono">{item.barcode}</p>
</div>
)}
</div>
{/* Photo Section */}
<div className="border-t border-slate-800/50 pt-6">
<div className="border-t border-[#222222] pt-6">
<h3 className="text-lg font-normal text-white mb-4 flex items-center gap-2">
<Camera size={18} className="text-primary" />
Photo
@@ -133,7 +133,7 @@ export default function ItemDetailModal({
<>
{currentPhoto ? (
<div className="space-y-3">
<div className="relative bg-slate-900/50 rounded-2xl overflow-hidden border border-slate-800/50 aspect-video max-h-96">
<div className="relative bg-black border border-[#222222] rounded-none overflow-hidden aspect-video max-h-96">
<img
src={buildPhotoUrl(backendUrl, currentPhoto.full_url)}
alt={item.name}
@@ -143,25 +143,25 @@ export default function ItemDetailModal({
<div className="flex gap-2">
<button
onClick={() => setShowPhotoUpload(true)}
className="flex-1 px-4 py-2 bg-primary/20 border border-primary/50 text-primary rounded-xl hover:bg-primary/30 transition-colors font-normal text-sm"
className="flex-1 px-4 py-2 bg-primary/20 border border-primary/50 text-primary rounded-none hover:bg-primary/30 transition-colors font-normal text-sm"
>
Replace Photo
</button>
<button
onClick={handleDeletePhoto}
disabled={isDeleting}
className="px-4 py-2 bg-rose-500/20 border border-rose-500/50 text-rose-400 rounded-xl hover:bg-rose-500/30 disabled:opacity-50 transition-colors font-normal text-sm"
className="px-4 py-2 bg-rose-500/20 border border-rose-500/50 text-rose-400 rounded-none hover:bg-rose-500/30 disabled:opacity-50 transition-colors font-normal text-sm"
>
<Trash2 size={16} />
</button>
</div>
</div>
) : (
<div className="bg-slate-900/30 border border-slate-800/50 rounded-2xl p-8 text-center">
<p className="text-muted text-sm mb-4">No photo uploaded</p>
<div className="bg-black border border-[#222222] rounded-none p-8 text-center">
<p className="text-[#888888] text-sm mb-4">No Photo Uploaded</p>
<button
onClick={() => setShowPhotoUpload(true)}
className="px-4 py-2 bg-primary/20 border border-primary/50 text-primary rounded-xl hover:bg-primary/30 transition-colors font-normal text-sm"
className="px-4 py-2 bg-primary/20 border border-primary/50 text-primary rounded-none hover:bg-primary/30 transition-colors font-normal text-sm"
>
Upload Photo
</button>
@@ -169,12 +169,12 @@ export default function ItemDetailModal({
)}
</>
) : (
<div ref={photoUploadRef} className="bg-slate-900/30 border border-slate-800/50 rounded-2xl p-4 md:p-6">
<div ref={photoUploadRef} className="bg-black border border-[#222222] rounded-none p-4 md:p-6">
<div className="mb-4 flex items-center justify-between">
<h4 className="font-normal text-white">Upload New Photo</h4>
<button
onClick={() => setShowPhotoUpload(false)}
className="p-1 hover:bg-slate-800 rounded-lg text-muted hover:text-white transition-colors"
className="p-1 hover:bg-[#1A1A1A] rounded-none text-[#888888] hover:text-white transition-colors border border-transparent hover:border-[#222222]"
aria-label="Cancel upload"
>
<X size={16} />

View File

@@ -25,21 +25,21 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
if (loading) {
return (
<div className="flex flex-col items-center justify-center py-3 lg:py-4 xl:py-52 text-secondary gap-4 animate-pulse">
<div className="w-10 h-10 border-4 border-primary/20 border-t-primary rounded-full animate-spin" />
<p className="text-xs font-normal tracking-widest italic">Securing Audit Stream...</p>
<div className="flex flex-col items-center justify-center py-20 text-secondary gap-4 animate-pulse">
<div className="w-10 h-10 border-4 border-primary/20 border-t-primary rounded-none animate-spin" />
<p className="text-xs font-normal">Securing Audit Stream...</p>
</div>
);
}
if (logs.length === 0) {
return (
<div className="bg-surface/20 border border-slate-800/50 border-dashed rounded-[2.5rem] py-20 flex flex-col items-center justify-center text-center gap-3 md:gap-4">
<div className="w-16 h-16 bg-surface rounded-2xl flex items-center justify-center text-slate-700 border border-slate-800">
<div className="bg-surface-container border border-border border-dashed py-20 flex flex-col items-center justify-center text-center gap-4">
<div className="w-16 h-16 bg-surface-bright flex items-center justify-center text-secondary border border-border">
<ArrowDownCircle size={32} />
</div>
<div>
<p className="text-xl font-normal text-secondary tracking-tight">No events found</p>
<p className="text-xl font-normal text-secondary">No events found</p>
<p className="text-xs text-secondary font-normal mt-1">Refine your strategic filters</p>
</div>
</div>
@@ -48,81 +48,100 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
return (
<>
<div className="grid gap-2.5">
{logs.map((log) => (
<button
key={log.id}
onClick={() => setSelectedLog(log)}
className="w-full text-left bg-surface/50 border border-slate-800/30 p-3 lg:p-4 xl:p-5 lg:p-6 xl:p-8 px-4 lg:px-5 xl:px-6 rounded-2xl flex items-center justify-between gap-4 hover:bg-slate-800/40 hover:border-primary/30 transition-all group active:scale-[0.99] relative overflow-hidden shadow-sm"
>
<div className="flex-1 min-w-0 z-10 flex items-center gap-4">
{/* Compact Action Badge */}
<div className={cn(
"text-[10px] font-normal px-3 py-1.5 rounded-lg border min-w-[85px] text-center tracking-tight",
log.action.includes('CHECK_IN') ? "bg-green-500/10 text-green-500 border-green-500/20" :
(log.action.includes('TRASH') ? "bg-rose-500/10 text-rose-500 border-rose-500/20" :
(log.action.includes('DB') ? "bg-sky-500/10 text-sky-400 border-sky-500/20" :
(log.action.includes('DELETE') ? "bg-red-500/10 text-red-500 border-red-500/30" :
(log.action.includes('CREATE') ? "bg-indigo-500/10 text-indigo-400 border-indigo-500/20" : "bg-primary/10 text-primary border-primary/20"))))
)}>
{log.action.replace('_', ' ')}
</div>
<div className="border border-border bg-surface-container overflow-hidden">
{/* Header Row */}
<div className="hidden md:grid grid-cols-[120px_1fr_120px_180px_80px] bg-surface-bright/50 border-b border-border">
<div className="p-2 text-xs text-secondary font-normal">Action</div>
<div className="p-2 text-xs text-secondary font-normal">Item</div>
<div className="p-2 text-xs text-secondary font-normal">Operator</div>
<div className="p-2 text-xs text-secondary font-normal">Timestamp</div>
<div className="p-2 text-xs text-secondary font-normal text-right">Delta</div>
</div>
<div className="flex-1 min-w-0">
<h3 className="card-title group-hover:text-primary transition-colors truncate">
{log.resolved_name}
</h3>
<div className="flex items-center gap-2">
<span className="card-subtitle mt-0 shrink-0">{log.username || 'System'}</span>
<span className="w-1 h-1 rounded-full bg-slate-800 shrink-0 mt-1" />
<span className="card-subtitle mt-0 lowercase opacity-80 truncate">
{new Date(log.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} · {new Date(log.timestamp).toLocaleDateString()}
</span>
<div className="divide-y divide-border">
{logs.map((log) => (
<button
key={log.id}
onClick={() => setSelectedLog(log)}
className="w-full text-left p-2 md:p-3 hover:bg-surface-bright transition-colors group active:bg-surface-bright/80 relative"
>
<div className="md:grid md:grid-cols-[120px_1fr_120px_180px_80px] items-center gap-4">
{/* Action Badge - Mobile/Tablet shown as badge, Desktop as column */}
<div className="mb-2 md:mb-0">
<div className={cn(
"text-[10px] font-normal px-2 py-0.5 border text-center inline-block min-w-[100px]",
log.action.includes('CHECK_IN') ? "bg-green-500/10 text-green-500 border-green-500/20" :
(log.action.includes('TRASH') ? "bg-rose-500/10 text-rose-500 border-rose-500/20" :
(log.action.includes('DB') ? "bg-sky-500/10 text-sky-400 border-sky-500/20" :
(log.action.includes('DELETE') ? "bg-red-500/10 text-red-500 border-red-500/30" :
(log.action.includes('CREATE') ? "bg-indigo-500/10 text-indigo-400 border-indigo-500/20" : "bg-primary/10 text-primary border-primary/20"))))
)}>
{log.action.replace('_', ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}
</div>
</div>
<div className="min-w-0">
<h3 className="text-sm md:text-base text-foreground group-hover:text-primary transition-colors truncate">
{log.resolved_name}
</h3>
</div>
<div className="hidden md:block text-sm text-secondary truncate">
{log.username || 'System'}
</div>
<div className="hidden md:block text-sm text-secondary tabular-nums">
{new Date(log.timestamp).toLocaleDateString()} {new Date(log.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
</div>
<div className={cn(
"text-base md:text-sm font-normal tabular-nums text-right",
(log.quantity_change || 0) > 0 ? "text-green-500" : ((log.quantity_change || 0) < 0 ? "text-rose-500" : "text-primary/50")
)}>
{log.quantity_change ? (log.quantity_change > 0 ? `+${log.quantity_change}` : log.quantity_change) : (log.action.includes('DB') ? 'SYS' : '±')}
</div>
{/* Mobile-only secondary info */}
<div className="md:hidden mt-1 flex items-center gap-2 text-xs text-secondary opacity-80">
<span>{log.username || 'System'}</span>
<span>·</span>
<span>{new Date(log.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}</span>
</div>
</div>
</div>
<div className="shrink-0 flex items-center gap-3 z-10">
<div className={cn(
"text-lg font-normal tabular-nums min-w-[35px] text-right",
(log.quantity_change || 0) > 0 ? "text-green-500" : ((log.quantity_change || 0) < 0 ? "text-rose-500" : "text-primary/50")
)}>
{log.quantity_change ? (log.quantity_change > 0 ? `+${log.quantity_change}` : log.quantity_change) : (log.action.includes('DB') ? 'SYS' : '±')}
</div>
</div>
</button>
))}
</button>
))}
</div>
</div>
{/* Selected Log Modal */}
{selectedLog && (
<div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4 bg-background/90 animate-in fade-in duration-300">
<div className="bg-surface border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[3rem] p-4 md:p-6 max-w-lg w-full shadow-2xl space-y-3 md:space-y-4 animate-in slide-in-from-bottom-10 duration-300 overflow-hidden">
<div className="bg-surface-container border-t sm:border border-border p-4 md:p-6 max-w-lg w-full space-y-4 animate-in slide-in-from-bottom-10 duration-300 overflow-hidden">
<div className="flex justify-between items-start">
<div className="space-y-1 pr-4">
<div className={cn(
"text-xs font-normal px-4 py-1.5 rounded-full border inline-block tracking-widest",
"text-xs font-normal px-3 py-1 border inline-block",
selectedLog.action.includes('CHECK_IN') ? "bg-green-500/10 text-green-500 border-green-500/30" :
(selectedLog.action.includes('TRASH') ? "bg-rose-500/10 text-rose-500 border-rose-500/30" : "bg-primary/10 text-primary border-primary/30")
)}>
{selectedLog.action}
{selectedLog.action.replace('_', ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}
</div>
<h2 className="text-2xl font-normal text-white tracking-tight pt-2 leading-tight">
<h2 className="text-2xl font-normal text-foreground pt-2 leading-tight">
{selectedLog.resolved_name}
</h2>
</div>
<button onClick={() => setSelectedLog(null)} className="p-3 lg:p-4 xl:p-5 lg:p-6 xl:p-8 bg-slate-800/50 hover:bg-slate-800 rounded-2xl text-muted transition-colors border border-slate-800 shrink-0 shadow-lg">
<button onClick={() => setSelectedLog(null)} className="p-2 bg-surface-bright hover:bg-border text-secondary transition-colors border border-border shrink-0">
<X size={20} />
</button>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-1 bg-background/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-normal text-muted tracking-widest">Protocol Operator</p>
<p className="text-sm font-normal text-secondary">{selectedLog.username || 'Automated Process'}</p>
<div className="grid grid-cols-2 gap-px bg-border border border-border">
<div className="space-y-1 bg-surface-container p-3">
<p className="text-[10px] font-normal text-secondary">Protocol Operator</p>
<p className="text-sm font-normal text-foreground">{selectedLog.username || 'Automated Process'}</p>
</div>
<div className="space-y-1 bg-background/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-normal text-muted tracking-widest">Quantity Delta</p>
<div className="space-y-1 bg-surface-container p-3">
<p className="text-[10px] font-normal text-secondary">Quantity Delta</p>
<p className={cn(
"text-xl font-normal tabular-nums",
(selectedLog.quantity_change || 0) > 0 ? "text-green-500" : "text-rose-500"
@@ -134,10 +153,10 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
</div>
</div>
<div className="space-y-5">
<div className="space-y-4">
<div className="space-y-1">
<p className="text-[11px] font-normal text-muted tracking-widest ml-1">Universal Timestamp</p>
<p className="text-xs font-normal text-secondary bg-background/30 p-4 rounded-2xl border border-slate-800/30 tabular-nums">
<p className="text-[10px] font-normal text-secondary ml-1">Universal Timestamp</p>
<p className="text-xs font-normal text-foreground bg-surface-bright/30 p-3 border border-border tabular-nums">
{new Date(selectedLog.timestamp).toLocaleString(undefined, { dateStyle: 'full', timeStyle: 'medium' })}
</p>
</div>
@@ -146,18 +165,18 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
try {
const snap = JSON.parse(selectedLog.target_snapshot) as Record<string, any>;
return (
<div className="space-y-4 pt-2">
<div className="flex items-center gap-3">
<div className="h-px flex-1 bg-slate-800/50" />
<p className="text-[8px] font-normal text-slate-700 tracking-[0.2em]">Snapshot Record</p>
<div className="h-px flex-1 bg-slate-800/50" />
<div className="space-y-2 pt-2">
<div className="flex items-center gap-2">
<div className="h-px flex-1 bg-border" />
<p className="text-[10px] font-normal text-secondary">Snapshot Record</p>
<div className="h-px flex-1 bg-border" />
</div>
<div className="grid grid-cols-2 gap-2.5">
<div className="grid grid-cols-2 gap-px bg-border border border-border">
{Object.entries(snap).map(([key, val]) => (
(val && key !== 'image_url' && key !== 'id') ? (
<div key={key} className="bg-background/20 p-3 rounded-xl border border-slate-800/20">
<p className="text-[10px] font-normal text-muted mb-1 tracking-tight opacity-70">{key.replace('_', ' ')}</p>
<p className="text-xs font-normal text-secondary truncate" title={String(val)}>{String(val)}</p>
<div key={key} className="bg-surface-container p-2">
<p className="text-[10px] font-normal text-secondary mb-1 opacity-70">{key.replace('_', ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}</p>
<p className="text-xs font-normal text-foreground truncate" title={String(val)}>{String(val)}</p>
</div>
) : null
))}
@@ -168,10 +187,10 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
})()}
{selectedLog.details && (
<div className="space-y-1.5">
<p className="text-[11px] font-normal text-muted tracking-widest ml-1">Intervention Details</p>
<div className="bg-primary/5 text-primary/80 p-5 rounded-3xl border border-primary/10 text-sm font-normal leading-relaxed italic shadow-inner">
"{selectedLog.details}"
<div className="space-y-1">
<p className="text-[10px] font-normal text-secondary ml-1">Intervention Details</p>
<div className="bg-primary/5 text-primary p-3 border border-primary/20 text-sm font-normal leading-relaxed">
{selectedLog.details}
</div>
</div>
)}
@@ -179,7 +198,7 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {
<button
onClick={() => setSelectedLog(null)}
className="w-full bg-slate-800 hover:bg-slate-700 text-white font-normal py-4.5 rounded-2xl transition-all active:scale-95 border border-slate-700 shadow-xl"
className="w-full bg-primary hover:bg-primary/90 text-primary-foreground font-normal py-3 transition-colors border border-primary"
>
Close Audit Insight
</button>

View File

@@ -9,7 +9,7 @@ interface StatCardProps {
export default function StatCard({ label, value, icon: Icon }: StatCardProps) {
return (
<div className="flex justify-between items-center gap-2 p-3 lg:p-4 xl:p-5 lg:p-6 xl:p-8.5 bg-surface/70 border border-slate-800/50 rounded-2xl shadow-sm transition-all hover:bg-surface" role="status">
<div className="flex justify-between items-center gap-2 p-2 md:p-3 bg-surface-container border border-border transition-all hover:bg-surface-bright" role="status">
<div className="flex items-center gap-2.5 min-w-0">
{Icon && <Icon className="w-5 h-5 text-primary flex-shrink-0" aria-hidden="true" />}
<span className="text-base md:text-lg text-secondary font-normal truncate">
@@ -17,7 +17,7 @@ export default function StatCard({ label, value, icon: Icon }: StatCardProps) {
</span>
</div>
<span className="text-base md:text-lg font-normal text-white whitespace-nowrap tabular-nums">
<span className="text-base md:text-lg font-normal text-primary whitespace-nowrap tabular-nums">
{value}
</span>
</div>

View File

@@ -56,14 +56,14 @@ export default function QuantityAdjustmentModal({
return (
<div className={`fixed inset-0 z-50 bg-black/50 flex items-center justify-center transition-opacity ${isClosing ? 'opacity-0' : 'opacity-100'}`}>
<div className={`bg-slate-950 rounded-lg shadow-lg w-full max-w-md mx-4 transition-transform ${isClosing ? 'scale-95' : 'scale-100'}`}>
<div className={`bg-surface border border-border w-full max-w-md mx-4 transition-transform ${isClosing ? 'scale-95' : 'scale-100'}`}>
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-slate-800">
<h2 className="text-lg font-normal">Adjust quantity</h2>
<div className="flex items-center justify-between p-4 border-b border-border">
<h2 className="text-lg font-normal">Adjust Quantity</h2>
<button
onClick={handleClose}
aria-label="Close quantity adjustment modal"
className="p-2 hover:bg-slate-800 rounded-lg transition-colors"
className="p-2 hover:bg-black border border-transparent hover:border-border transition-colors"
>
<X size={20} className="text-slate-400" />
</button>
@@ -91,7 +91,7 @@ export default function QuantityAdjustmentModal({
{/* Success Message */}
{successMessage && (
<div className="p-3 bg-green-500/10 border border-green-500/20 rounded-lg text-green-500 text-sm">
<div className="status-success text-sm">
{successMessage}
</div>
)}
@@ -99,7 +99,7 @@ export default function QuantityAdjustmentModal({
{/* Quantity Adjustment */}
<div>
<label className="text-sm font-normal text-slate-400 mb-3 block">
Current quantity
Current Quantity
</label>
<QuantityDisplay
itemId={String(item.id)}
@@ -112,7 +112,7 @@ export default function QuantityAdjustmentModal({
<div className="flex gap-2 pt-2">
<button
onClick={handleClose}
className="flex-1 px-4 py-2 bg-slate-800 hover:bg-slate-700 text-slate-100 rounded-lg font-normal transition-colors"
className="btn-secondary flex-1"
>
Keep Current Quantity
</button>

View File

@@ -83,12 +83,12 @@ export default function QuantityDisplay({
if (isEditing) {
return (
<div className="flex items-center gap-2 bg-slate-900/50 rounded-lg px-3 py-2">
<div className="flex items-center gap-2 bg-black border border-border px-3 py-2">
<button
onClick={handleDecrement}
disabled={isLoading}
aria-label="Decrease quantity"
className="p-1 hover:bg-slate-800 rounded text-secondary hover:text-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
className="p-1 hover:bg-black border border-transparent hover:border-border text-secondary hover:text-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Minus size={16} />
</button>
@@ -110,7 +110,7 @@ export default function QuantityDisplay({
onClick={handleIncrement}
disabled={isLoading}
aria-label="Increase quantity"
className="p-1 hover:bg-slate-800 rounded text-secondary hover:text-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
className="p-1 hover:bg-black border border-transparent hover:border-border text-secondary hover:text-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Plus size={16} />
</button>
@@ -123,7 +123,7 @@ export default function QuantityDisplay({
onClick={handleTapToEdit}
disabled={isLoading}
aria-label={`Quantity: ${currentQuantity}. Tap to edit`}
className="text-lg font-normal text-primary hover:bg-slate-900/30 px-3 py-2 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
className="text-lg font-normal text-primary hover:bg-black border border-transparent hover:border-border px-3 py-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
{currentQuantity}
</button>

View File

@@ -109,23 +109,23 @@ export default function SearchModal({
return (
<div className="fixed inset-0 z-50 bg-black/50 flex items-start justify-center pt-20">
<div className="bg-slate-950 rounded-lg shadow-lg w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col">
<div className="bg-surface border border-border w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col">
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-slate-800">
<h2 className="text-xl font-normal">Search inventory</h2>
<div className="flex items-center justify-between p-4 border-b border-border">
<h2 className="text-xl font-normal">Search Inventory</h2>
<button
onClick={onClose}
aria-label="Close search modal"
className="p-2 hover:bg-slate-800 rounded-lg transition-colors"
className="p-2 hover:bg-black border border-transparent hover:border-border transition-colors"
>
<X size={20} className="text-slate-400" />
</button>
</div>
{/* Search Input */}
<div className="p-4 border-b border-slate-800">
<div className="p-4 border-b border-border">
<div className="relative">
<Search size={18} className="absolute left-3 top-3 text-slate-500 pointer-events-none" />
<Search size={18} className="absolute left-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none" />
<input
ref={inputRef}
type="text"
@@ -133,7 +133,7 @@ export default function SearchModal({
value={query}
onChange={handleInputChange}
aria-label="Search items"
className="w-full bg-slate-900 border border-slate-800 rounded-lg pl-10 pr-4 py-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/50"
className="w-full pl-10"
/>
</div>
</div>
@@ -141,7 +141,7 @@ export default function SearchModal({
{/* Results */}
<div className="flex-1 overflow-y-auto">
{error && (
<div className="p-4 text-rose-500 bg-rose-500/10 border border-rose-500/20 m-4 rounded-lg">
<div className="p-4 text-rose-500 bg-rose-500/10 border border-rose-500/20 m-4">
{error}
</div>
)}
@@ -149,14 +149,14 @@ export default function SearchModal({
{isLoading && (
<div className="flex items-center justify-center py-8">
<div className="text-slate-400">
<div className="inline-block animate-spin rounded-full h-6 w-6 border border-slate-600 border-t-primary"></div>
<div className="inline-block animate-spin h-6 w-6 border border-slate-600 border-t-primary"></div>
</div>
</div>
)}
{!isLoading && !error && results.length === 0 && query.length > 0 && (
<div className="p-4 text-slate-500 text-center">
No items found matching "{query}"
No Items Found Matching "{query}"
</div>
)}
@@ -167,12 +167,12 @@ export default function SearchModal({
)}
{!isLoading && results.length > 0 && (
<div className="divide-y divide-slate-800">
<div className="divide-y divide-border">
{results.map((item) => (
<button
key={item.id}
onClick={() => handleSelectItem(item)}
className="w-full p-4 text-left hover:bg-slate-900 transition-colors focus:outline-none focus:bg-slate-900 focus:ring-2 focus:ring-primary/50"
className="w-full p-4 text-left hover:bg-black transition-colors focus:outline-none focus:bg-black"
>
<div className="flex justify-between items-start gap-2 mb-1">
<h3 className="font-normal text-slate-100 flex-1">