From 88a367ba60cdc9083742ddefaf99f73db30f67ab Mon Sep 17 00:00:00 2001 From: Tucker McCoy Date: Thu, 12 Feb 2026 10:07:01 -0500 Subject: [PATCH] fix(ui): fixed title and description spacing and dialog icon placement --- packages/ui/package.json | 2 +- .../src/components/dialog/dialog.module.css | 8 ++++- packages/ui/src/components/dialog/dialog.tsx | 31 ++++++++++++++----- .../ui/src/components/sheet/sheet.module.css | 2 +- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index 4328588..f7a7730 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -2,7 +2,7 @@ "name": "@eqtylab/equality", "description": "EQTYLab's component and token-based design system", "homepage": "https://equality.eqtylab.io/", - "version": "1.1.8", + "version": "1.1.9", "license": "Apache-2.0", "keywords": [ "component library", diff --git a/packages/ui/src/components/dialog/dialog.module.css b/packages/ui/src/components/dialog/dialog.module.css index 0c73098..0682bbc 100644 --- a/packages/ui/src/components/dialog/dialog.module.css +++ b/packages/ui/src/components/dialog/dialog.module.css @@ -28,14 +28,20 @@ } .dialog-header { - @apply flex shrink-0 items-start justify-between gap-4; + @apply flex shrink-0 items-center gap-4; @apply text-left; @apply border-b-1 border-border; @apply px-6 py-3; } +.dialog-header-icon { + @apply shrink-0; + @apply flex items-center justify-center; +} + .dialog-header-content { @apply flex min-w-0 flex-1 flex-col; + @apply space-y-0.5; } .dialog-title { diff --git a/packages/ui/src/components/dialog/dialog.tsx b/packages/ui/src/components/dialog/dialog.tsx index bd9c17f..d34b67b 100644 --- a/packages/ui/src/components/dialog/dialog.tsx +++ b/packages/ui/src/components/dialog/dialog.tsx @@ -52,14 +52,30 @@ const DialogContainer = React.forwardRef< )); DialogContainer.displayName = DialogPrimitive.Content.displayName; -const DialogHeader = ({ className, children, ...props }: React.HTMLAttributes) => ( -
-
{children}
- - - -
+const DialogHeaderIcon = ({ className, ...props }: React.HTMLAttributes) => ( +
); +DialogHeaderIcon.displayName = 'DialogHeaderIcon'; + +const DialogHeader = ({ className, children, ...props }: React.HTMLAttributes) => { + const childrenArray = React.Children.toArray(children); + const icon = childrenArray.find( + (child) => React.isValidElement(child) && child.type === DialogHeaderIcon + ); + const otherChildren = childrenArray.filter( + (child) => !(React.isValidElement(child) && child.type === DialogHeaderIcon) + ); + + return ( +
+ {icon} +
{otherChildren}
+ + + +
+ ); +}; DialogHeader.displayName = 'DialogHeader'; const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => ( @@ -100,6 +116,7 @@ export { DialogDescription, DialogFooter, DialogHeader, + DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, diff --git a/packages/ui/src/components/sheet/sheet.module.css b/packages/ui/src/components/sheet/sheet.module.css index 3d55b2d..233eb44 100644 --- a/packages/ui/src/components/sheet/sheet.module.css +++ b/packages/ui/src/components/sheet/sheet.module.css @@ -62,7 +62,7 @@ .sheet-header-text-content { @apply flex min-w-0 flex-1 flex-col; - @apply space-y-2; + @apply space-y-0.5; } .sheet-body {