Skip to content

Commit ceae83c

Browse files
dchaudhari7177ascorbic
authored andcommitted
fix(admin): center empty-state placeholder in Image/File/media picker fields (emdash-cms#1940)
* fix(admin): center empty-state placeholder in image/file/media picker fields The kumo Button's base classes are 'flex w-max items-center' with no horizontal justification — fine when the button hugs its content, but the image/file placeholder buttons stretch it with w-full, leaving the icon and label pinned to the left edge. SeoImageField already carried an explicit justify-center for exactly this reason; apply the same class to the three placeholders that lacked it (image field, file field, and the block-kit media picker). Fixes emdash-cms#1934 * chore: add changeset for the placeholder centering fix --------- Co-authored-by: Matt Kane <mkane@cloudflare.com>
1 parent 2f4decf commit ceae83c

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@emdash-cms/admin": patch
3+
---
4+
5+
Centers the empty-state placeholder labels in Image, File, and media picker fields.

packages/admin/src/components/BlockKitMediaPickerField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function BlockKitMediaPickerField({
123123
<Button
124124
type="button"
125125
variant="outline"
126-
className="w-full h-24 border-dashed"
126+
className="w-full h-24 justify-center border-dashed"
127127
onClick={() => setPickerOpen(true)}
128128
>
129129
<div className="flex flex-col items-center gap-1.5 text-kumo-subtle">

packages/admin/src/components/ContentEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ function FileFieldRenderer({
16621662
<Button
16631663
type="button"
16641664
variant="outline"
1665-
className="mt-2 w-full h-32 border-dashed"
1665+
className="mt-2 w-full h-32 justify-center border-dashed"
16661666
onClick={() => setPickerOpen(true)}
16671667
aria-label={t`Select ${label}`}
16681668
>

packages/admin/src/components/ImageFieldRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function ImageFieldRenderer({
167167
<Button
168168
type="button"
169169
variant="outline"
170-
className="mt-2 w-full h-32 border-dashed"
170+
className="mt-2 w-full h-32 justify-center border-dashed"
171171
onClick={() => setPickerOpen(true)}
172172
>
173173
<div className="flex flex-col items-center gap-2 text-kumo-subtle">

0 commit comments

Comments
 (0)