From d744530321626198478368ca61e9ad5ece8a9189 Mon Sep 17 00:00:00 2001 From: Tucker McCoy Date: Mon, 9 Feb 2026 11:00:07 -0500 Subject: [PATCH] fix(ui): allow prefix and suffix icons --- .../src/content/components/alert-dialog.mdx | 20 ++++++++----- packages/ui/package.json | 2 +- .../components/alert-dialog/alert-dialog.tsx | 30 ++++++++++++++----- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/packages/demo/src/content/components/alert-dialog.mdx b/packages/demo/src/content/components/alert-dialog.mdx index 601e229..27536c8 100644 --- a/packages/demo/src/content/components/alert-dialog.mdx +++ b/packages/demo/src/content/components/alert-dialog.mdx @@ -105,14 +105,18 @@ const [open, setOpen] = useState(false); ### AlertDialogAction -| Name | Description | Type | Default | Required | -| --------- | -------------------- | ------------------------------------------------------------------ | --------- | -------- | -| `variant` | Button style variant | `primary`, `danger`, `secondary`, `tertiary`, `link`, `navigation` | `primary` | ❌ | -| `size` | Button size | `sm`, `md`, `lg` | `sm` | ❌ | +| Name | Description | Type | Default | Required | +| --------- | -------------------------------- | ------------------------------------------------------------------ | --------- | -------- | +| `variant` | Button style variant | `primary`, `danger`, `secondary`, `tertiary`, `link`, `navigation` | `primary` | ❌ | +| `size` | Button size | `sm`, `md`, `lg` | `sm` | ❌ | +| `prefix` | Content rendered before children | `ReactNode` | - | ❌ | +| `suffix` | Content rendered after children | `ReactNode` | - | ❌ | ### AlertDialogCancel -| Name | Description | Type | Default | Required | -| --------- | -------------------- | ------------------------------------------------------------------ | ---------- | -------- | -| `variant` | Button style variant | `primary`, `danger`, `secondary`, `tertiary`, `link`, `navigation` | `tertiary` | ❌ | -| `size` | Button size | `sm`, `md`, `lg` | `sm` | ❌ | +| Name | Description | Type | Default | Required | +| --------- | -------------------------------- | ------------------------------------------------------------------ | ---------- | -------- | +| `variant` | Button style variant | `primary`, `danger`, `secondary`, `tertiary`, `link`, `navigation` | `tertiary` | ❌ | +| `size` | Button size | `sm`, `md`, `lg` | `sm` | ❌ | +| `prefix` | Content rendered before children | `ReactNode` | - | ❌ | +| `suffix` | Content rendered after children | `ReactNode` | - | ❌ | diff --git a/packages/ui/package.json b/packages/ui/package.json index e9ccd5d..093bfb4 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.6", + "version": "1.1.7", "license": "Apache-2.0", "keywords": [ "component library", diff --git a/packages/ui/src/components/alert-dialog/alert-dialog.tsx b/packages/ui/src/components/alert-dialog/alert-dialog.tsx index 4df1922..3d98208 100644 --- a/packages/ui/src/components/alert-dialog/alert-dialog.tsx +++ b/packages/ui/src/components/alert-dialog/alert-dialog.tsx @@ -79,27 +79,41 @@ AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayNam const AlertDialogAction = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps ->(({ className, variant = 'primary', size = 'sm', ...props }, ref) => ( + Omit, 'prefix'> & + VariantProps & { + prefix?: React.ReactNode; + suffix?: React.ReactNode; + } +>(({ className, variant = 'primary', size = 'sm', prefix, suffix, children, ...props }, ref) => ( + > + {prefix} + {children} + {suffix} + )); AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName; const AlertDialogCancel = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps ->(({ className, variant = 'tertiary', size = 'sm', ...props }, ref) => ( + Omit, 'prefix'> & + VariantProps & { + prefix?: React.ReactNode; + suffix?: React.ReactNode; + } +>(({ className, variant = 'tertiary', size = 'sm', prefix, suffix, children, ...props }, ref) => ( + > + {prefix} + {children} + {suffix} + )); AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;