Merge tag '1.14.5_cleaned'

project was cleaned
This commit is contained in:
2026-04-23 11:47:44 +03:00
5758 changed files with 2046069 additions and 16179 deletions

View File

@@ -62,13 +62,13 @@ export default function StockAdjustmentPanel({
if (!selectedItem) return null;
return (
<div data-testid="stock-adjustment-form" className="fixed inset-0 z-50 flex items-end sm:items-center justify-center 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 border-slate-800 rounded-[2.5rem] shadow-2xl p-6 lg:p-8 xl:p-10 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="flex justify-between items-center mb-6">
<h3 className="text-xl lg:text-2xl xl:text-3xl lg:text-4xl xl:text-5xl font-black tracking-tight flex items-center gap-2">
<div data-testid="stock-adjustment-form" className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-surface border border-slate-800 rounded-[2.5rem] shadow-2xl p-4 md:p-6 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<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">
<span data-testid="adjustment-item-name">{isEditing ? "Edit Metadata" : selectedItem.name}</span>
{!isEditing && (
<span data-testid="current-quantity" className="text-[11px] bg-slate-800 text-secondary px-2 py-0.5 rounded-md font-black tracking-tight shadow-sm border border-slate-700/50">
<span data-testid="current-quantity" className="text-[11px] bg-slate-800 text-secondary px-2 py-0.5 rounded-md font-normal tracking-tight shadow-sm border border-slate-700/50">
In Stock: {selectedItem.quantity}
</span>
)}
@@ -101,20 +101,20 @@ export default function StockAdjustmentPanel({
</div>
{isEditing ? (
<div className="space-y-4 mb-8">
<div className="space-y-2 md:space-y-3 mb-4 md:mb-6">
<div>
<div className="bg-surface py-2 lg:py-3 xl:py-4.5 px-4 lg:px-5 xl:px-6 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label 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-secondary font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-secondary font-normal mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<textarea
value={editedItem.name || ''}
onChange={(e) => onEditChange({ ...editedItem, name: e.target.value })}
className="bg-transparent w-full text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold outline-none text-white placeholder:text-muted resize-none h-8 leading-tight selection:bg-primary/30 py-0"
className="bg-transparent w-full text-lg font-normal outline-none text-white placeholder:text-muted resize-none h-8 leading-tight selection:bg-primary/30 py-0"
placeholder="SSD, SFP, Cable..."
/>
</div>
</div>
<div>
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Part Number</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Part Number</label>
<input
type="text"
value={editedItem.part_number || ''}
@@ -125,7 +125,7 @@ export default function StockAdjustmentPanel({
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Category Group</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Category Group</label>
<input
type="text"
list="existing-categories"
@@ -141,7 +141,7 @@ export default function StockAdjustmentPanel({
</datalist>
</div>
<div>
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Item Type</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Item Type</label>
<input
type="text"
list="existing-types"
@@ -152,7 +152,7 @@ export default function StockAdjustmentPanel({
/>
</div>
<div className="col-span-2">
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1">Box / Container Label</label>
<label className="text-sm font-normal text-secondary ml-1">Box / Container Label</label>
<div className="relative flex items-center">
<input
type="text"
@@ -178,7 +178,7 @@ export default function StockAdjustmentPanel({
</div>
</div>
<div>
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Connector</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Connector</label>
<input
type="text"
value={editedItem.connector || ''}
@@ -188,7 +188,7 @@ export default function StockAdjustmentPanel({
/>
</div>
<div>
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Size / Length</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Size / Length</label>
<input
type="text"
value={editedItem.size || ''}
@@ -198,7 +198,7 @@ export default function StockAdjustmentPanel({
/>
</div>
<div className="col-span-2">
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1 tracking-tight">Item Color</label>
<label className="text-sm font-normal text-secondary ml-1 tracking-tight">Item Color</label>
<input
type="text"
value={editedItem.color || ''}
@@ -208,7 +208,7 @@ export default function StockAdjustmentPanel({
/>
</div>
<div className="col-span-2">
<label className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-secondary ml-1">Description</label>
<label className="text-sm font-normal text-secondary ml-1">Description</label>
<textarea
value={editedItem.description || ''}
onChange={e => onEditChange({ ...editedItem, description: e.target.value })}
@@ -216,12 +216,12 @@ export default function StockAdjustmentPanel({
placeholder="Item description..."
/>
</div>
<div className="bg-surface py-2 lg:py-3 xl:py-4.5 px-4 lg:px-5 xl:px-6 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label 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-secondary font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item ID or Code</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-secondary font-normal mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item ID or Code</label>
<textarea
value={editedItem.ocr_text || ''}
onChange={e => onEditChange({ ...editedItem, ocr_text: 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 font-bold outline-none text-secondary resize-none h-12"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-normal outline-none text-secondary resize-none h-12"
placeholder="e.g., SKU-12345 or barcode text..."
/>
</div>
@@ -229,7 +229,7 @@ export default function StockAdjustmentPanel({
</div>
) : (
<>
<div className="flex p-1 bg-background rounded-2xl mb-8">
<div className="flex p-1 bg-background rounded-2xl mb-4 md:mb-6">
{[
{ id: 'ADD', label: 'Buy More', icon: Plus, color: 'text-primary' },
{ id: 'REMOVE', label: 'Subtract', icon: Minus, color: 'text-amber-500' },
@@ -244,13 +244,13 @@ export default function StockAdjustmentPanel({
)}
>
<t.icon size={20} className={adjustType === t.id ? t.color : ""} />
<span 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 font-black mt-1">{t.label}</span>
<span className="text-xs font-normal mt-1">{t.label}</span>
</button>
))}
</div>
<div className="flex flex-col items-center gap-6 mb-8">
<div className="flex items-center gap-8">
<div className="flex flex-col items-center gap-3 md:gap-4 mb-4 md:mb-6">
<div className="flex items-center gap-2 md:gap-4">
<button
onClick={() => onQuantityChange(Math.max(1, adjustQty - 1))}
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center text-secondary active:bg-slate-800"
@@ -258,8 +258,8 @@ export default function StockAdjustmentPanel({
<Minus size={24} />
</button>
<div className="text-center" data-testid="adjustment-quantity-input">
<span 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 font-black tabular-nums">{adjustQty}</span>
<span className="text-[10px] text-primary/80 font-bold tracking-tight">Units</span>
<span className="text-xs font-normal tabular-nums">{adjustQty}</span>
<span className="text-[10px] text-primary/80 font-normal tracking-tight">Units</span>
</div>
<button
onClick={() => onQuantityChange(adjustQty + 1)}
@@ -273,7 +273,7 @@ export default function StockAdjustmentPanel({
<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 animate-in shake duration-500">
<div className="flex items-center gap-2 mb-3">
<AlertTriangle size={16} className="text-red-500" />
<span className="text-sm lg:text-base xl:text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl font-bold text-red-400">Waste Declaration</span>
<span className="text-sm font-normal text-red-400">Waste Declaration</span>
</div>
<select
value={trashReason}
@@ -296,7 +296,7 @@ export default function StockAdjustmentPanel({
onClick={isEditing ? onUpdateItem : onAdjustStock}
data-testid="adjustment-submit"
className={cn(
"w-full py-5 rounded-[1.8rem] font-black text-lg lg:text-xl xl:text-2xl lg:text-3xl xl:text-4xl transition-all active:scale-[0.98] shadow-2xl",
"w-full py-5 rounded-[1.8rem] font-normal text-lg transition-all active:scale-[0.98] shadow-2xl",
isEditing ? "bg-slate-100 text-slate-900" : (
adjustType === 'ADD' ? "bg-primary shadow-primary/20 text-white" :
adjustType === 'REMOVE' ? "bg-amber-600 shadow-amber-500/20 text-white" :