Compare commits

..

5 Commits

Author SHA1 Message Date
1370e22bd7 Merge pull request 'fix: Add document modal file input bottom padding (#19)' (#20) from issue-19-document-modal-padding into main
All checks were successful
Deploy to Staging / Build Images (push) Successful in 2m37s
Deploy to Staging / Deploy to Staging (push) Successful in 38s
Deploy to Staging / Verify Staging (push) Successful in 6s
Deploy to Staging / Notify Staging Ready (push) Successful in 5s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
Reviewed-on: #20
2026-01-05 00:52:45 +00:00
Eric Gullickson
0e9d94dafa fix: Wrap file input in flex container for vertical centering (refs #19)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m42s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 38s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
File inputs are replaced elements that ignore CSS centering properties.
The only reliable solution is to wrap the input in a flex container
with items-center.

Changes:
- Added wrapper div with `flex items-center h-11`
- Moved border/background/focus styles to the wrapper
- Input now uses flex-1 to fill available space
- Used focus-within for focus ring on wrapper

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 18:45:25 -06:00
Eric Gullickson
75d1a421d4 fix: Use line-height for file input vertical centering (refs #19)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m41s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
Use leading-[44px] to match the h-11 height, which should vertically
center the file input content. Removed padding that was conflicting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 18:36:45 -06:00
Eric Gullickson
1534f33232 fix: Vertically center file input content (refs #19)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m39s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
The "Choose File" button and "No file chosen" text were not vertically
centered within the file input box.

Fixed by:
- Using py-2.5 for input padding (10px top/bottom)
- Adding file:my-auto to center the button vertically
- Adjusting file:py-1.5 for button internal padding

Note: flex/items-center don't work on <input> elements as they are
replaced elements. Using padding and margin-auto instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 18:28:09 -06:00
Eric Gullickson
510420e4fd fix: Vertically center file input content (refs #19)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m39s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
The "Choose File" button and "No file chosen" text were not vertically
centered within the file input. This was caused by:
1. Browser default `align-items: baseline` for file inputs
2. Conflicting `py-2` padding on the input container

Fixed by:
- Removing `py-2` (conflicting vertical padding)
- Adding `flex items-center` (explicit vertical centering)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 18:21:14 -06:00
2 changed files with 63 additions and 7 deletions

View File

@@ -162,7 +162,7 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({ onSuccess, onCancel
return ( return (
<LocalizationProvider dateAdapter={AdapterDayjs}> <LocalizationProvider dateAdapter={AdapterDayjs}>
<form onSubmit={handleSubmit} className="w-full"> <form onSubmit={handleSubmit} className="w-full">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 gap-4 pb-4">
<div className="flex flex-col"> <div className="flex flex-col">
<label className="text-sm font-medium text-slate-700 dark:text-avus mb-1">Vehicle</label> <label className="text-sm font-medium text-slate-700 dark:text-avus mb-1">Vehicle</label>
<select <select
@@ -394,12 +394,14 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({ onSuccess, onCancel
<div className="flex flex-col md:col-span-2"> <div className="flex flex-col md:col-span-2">
<label className="text-sm font-medium text-slate-700 dark:text-avus mb-1">Upload image/PDF</label> <label className="text-sm font-medium text-slate-700 dark:text-avus mb-1">Upload image/PDF</label>
<input <div className="flex items-center h-11 min-h-[44px] rounded-lg border px-3 bg-white border-slate-300 focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-500 dark:bg-scuro dark:border-silverstone dark:focus-within:ring-abudhabi dark:focus-within:border-abudhabi">
className="h-11 min-h-[44px] rounded-lg border px-3 py-2 bg-white text-gray-900 border-slate-300 focus:outline-none focus:ring-2 focus:ring-primary-500 dark:bg-scuro dark:text-avus dark:border-silverstone dark:focus:ring-abudhabi dark:focus:border-abudhabi file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-primary-500/10 file:text-primary-600 dark:file:bg-abudhabi/20 dark:file:text-abudhabi" <input
type="file" className="flex-1 text-gray-900 dark:text-avus file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-primary-500/10 file:text-primary-600 dark:file:bg-abudhabi/20 dark:file:text-abudhabi file:cursor-pointer cursor-pointer"
accept="image/jpeg,image/png,application/pdf" type="file"
onChange={(e) => setFile(e.target.files?.[0] || null)} accept="image/jpeg,image/png,application/pdf"
/> onChange={(e) => setFile(e.target.files?.[0] || null)}
/>
</div>
{uploadProgress > 0 && uploadProgress < 100 && ( {uploadProgress > 0 && uploadProgress < 100 && (
<div className="text-sm text-slate-600 dark:text-titanio mt-1">Uploading... {uploadProgress}%</div> <div className="text-sm text-slate-600 dark:text-titanio mt-1">Uploading... {uploadProgress}%</div>
)} )}

54
padding-issue.html Normal file
View File

@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark">
<title>MotoVaultPro</title>
<!-- Dark mode initialization - MUST run before any other scripts -->
<!-- This prevents iOS 26 Safari from overriding our dark mode preference -->
<script>
(function() {
try {
const stored = localStorage.getItem('motovaultpro-mobile-settings');
const settings = stored ? JSON.parse(stored) : {};
// Check user preference, fall back to system preference
const prefersDark = settings.darkMode !== undefined
? settings.darkMode
: window.matchMedia('(prefers-color-scheme: dark)').matches;
if (prefersDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
} catch (e) {
// Fallback to system preference on error
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
}
})();
</script>
<!-- Runtime config MUST load synchronously before any module scripts -->
<script src="/config.js"></script>
<script type="module" crossorigin src="/assets/index-BBzsRBvQ.js"></script>
<link rel="modulepreload" crossorigin href="/assets/react-vendor-ByzCDbub.js">
<link rel="modulepreload" crossorigin href="/assets/react-router-DaYFPv1Q.js">
<link rel="modulepreload" crossorigin href="/assets/utils-CzZZcuDR.js">
<link rel="modulepreload" crossorigin href="/assets/mui-core-CMlEYYIm.js">
<link rel="modulepreload" crossorigin href="/assets/data-CpPzLLzI.js">
<link rel="modulepreload" crossorigin href="/assets/animation-_z1WwDHu.js">
<link rel="modulepreload" crossorigin href="/assets/auth-DXZD2WD1.js">
<link rel="modulepreload" crossorigin href="/assets/mui-icons-C3PV0RzG.js">
<link rel="modulepreload" crossorigin href="/assets/forms-CxneQeFQ.js">
<link rel="stylesheet" crossorigin href="/assets/index-D1by4rQs.css">
</head>
<body>
<div id="root"></div>
</body>
</html>