|
@@ -501,7 +501,7 @@ export function InventoryPartForm({
|
|
|
<Dialog open={open} onOpenChange={handleOpenChange}>
|
|
<Dialog open={open} onOpenChange={handleOpenChange}>
|
|
|
<DialogContent className="max-h-[90vh] sm:max-w-3xl">
|
|
<DialogContent className="max-h-[90vh] sm:max-w-3xl">
|
|
|
<DialogHeader>
|
|
<DialogHeader>
|
|
|
- <div className="flex items-center justify-between gap-4 pr-6">
|
|
|
|
|
|
|
+ <div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-2 pr-6">
|
|
|
<DialogTitle>{part ? t('form.editPart') : t('form.addNewPart')}</DialogTitle>
|
|
<DialogTitle>{part ? t('form.editPart') : t('form.addNewPart')}</DialogTitle>
|
|
|
<DocsLink href="/docs/features/inventory" className="ml-auto" />
|
|
<DocsLink href="/docs/features/inventory" className="ml-auto" />
|
|
|
{/* Only meaningful for a saved part — a new one has no history yet.
|
|
{/* Only meaningful for a saved part — a new one has no history yet.
|
|
@@ -662,7 +662,7 @@ export function InventoryPartForm({
|
|
|
) : (
|
|
) : (
|
|
|
<>
|
|
<>
|
|
|
<ImageIcon className="h-8 w-8 text-muted-foreground" />
|
|
<ImageIcon className="h-8 w-8 text-muted-foreground" />
|
|
|
- <span className="mt-2 text-xs text-muted-foreground">
|
|
|
|
|
|
|
+ <span className="mt-2 px-2 text-center text-xs text-muted-foreground">
|
|
|
{t('form.dropOrClick')}
|
|
{t('form.dropOrClick')}
|
|
|
</span>
|
|
</span>
|
|
|
</>
|
|
</>
|
|
@@ -686,7 +686,9 @@ export function InventoryPartForm({
|
|
|
className="hidden"
|
|
className="hidden"
|
|
|
onChange={handleFileChange}
|
|
onChange={handleFileChange}
|
|
|
/>
|
|
/>
|
|
|
- <div className="mt-2 flex gap-1">
|
|
|
|
|
|
|
+ {/* Side by side while both fit the photo column, one under the
|
|
|
|
|
+ other when the words are longer than it. */}
|
|
|
|
|
+ <div className="mt-2 flex flex-wrap gap-1">
|
|
|
<Button
|
|
<Button
|
|
|
type="button"
|
|
type="button"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
@@ -737,9 +739,11 @@ export function InventoryPartForm({
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- {/* Fields */}
|
|
|
|
|
- <div className="flex-1 space-y-4">
|
|
|
|
|
- <div className="grid grid-cols-1 gap-3 sm:grid-cols-3 sm:gap-4">
|
|
|
|
|
|
|
+ {/* Fields. The rows count their columns from the width this
|
|
|
|
|
+ column really has (a container), not the window's: beside
|
|
|
|
|
+ the photo it is far narrower than the dialog. */}
|
|
|
|
|
+ <div className="@container min-w-0 flex-1 space-y-4">
|
|
|
|
|
+ <div className="grid grid-cols-1 items-end gap-3 @md:grid-cols-3 sm:gap-4">
|
|
|
<div className="space-y-2">
|
|
<div className="space-y-2">
|
|
|
<Label htmlFor="partNumber">{t('form.partNumber')}</Label>
|
|
<Label htmlFor="partNumber">{t('form.partNumber')}</Label>
|
|
|
<Input
|
|
<Input
|
|
@@ -770,7 +774,7 @@ export function InventoryPartForm({
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div className="grid grid-cols-2 gap-3 sm:gap-4">
|
|
|
|
|
|
|
+ <div className="grid grid-cols-1 items-end gap-3 @md:grid-cols-2 sm:gap-4">
|
|
|
<div className="space-y-2">
|
|
<div className="space-y-2">
|
|
|
<Label>{t('form.category')}</Label>
|
|
<Label>{t('form.category')}</Label>
|
|
|
<Popover open={categoryOpen} onOpenChange={setCategoryOpen} modal>
|
|
<Popover open={categoryOpen} onOpenChange={setCategoryOpen} modal>
|
|
@@ -782,7 +786,7 @@ export function InventoryPartForm({
|
|
|
aria-expanded={categoryOpen}
|
|
aria-expanded={categoryOpen}
|
|
|
className="w-full justify-between font-normal h-9"
|
|
className="w-full justify-between font-normal h-9"
|
|
|
>
|
|
>
|
|
|
- <span className={category ? '' : 'text-muted-foreground'}>
|
|
|
|
|
|
|
+ <span className={cn('truncate', !category && 'text-muted-foreground')}>
|
|
|
{category || t('form.categoryPlaceholder')}
|
|
{category || t('form.categoryPlaceholder')}
|
|
|
</span>
|
|
</span>
|
|
|
<ChevronsUpDown className="ml-2 h-3.5 w-3.5 shrink-0 opacity-50" />
|
|
<ChevronsUpDown className="ml-2 h-3.5 w-3.5 shrink-0 opacity-50" />
|
|
@@ -901,12 +905,7 @@ export function InventoryPartForm({
|
|
|
<Switch id="trackStock" checked={trackStock} onCheckedChange={setTrackStock} />
|
|
<Switch id="trackStock" checked={trackStock} onCheckedChange={setTrackStock} />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div
|
|
|
|
|
- className={cn(
|
|
|
|
|
- 'grid grid-cols-2 gap-3 sm:gap-4',
|
|
|
|
|
- trackStock ? 'sm:grid-cols-5' : 'sm:grid-cols-3'
|
|
|
|
|
- )}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div className="grid grid-cols-1 items-end gap-3 @[16rem]:grid-cols-2 @md:grid-cols-3 sm:gap-4">
|
|
|
{trackStock && (
|
|
{trackStock && (
|
|
|
<div className="space-y-2">
|
|
<div className="space-y-2">
|
|
|
<Label htmlFor="quantity">{t('form.quantity')}</Label>
|
|
<Label htmlFor="quantity">{t('form.quantity')}</Label>
|