Skip to content

Commit

Permalink
fix(alert): mark description optional & revise styles when only child…
Browse files Browse the repository at this point in the history
…ren is provided (#4447)

* fix(alert): mark description as optional and update description

* fix(theme): alignment when only children is provided

* feat(changeset): add changeset
  • Loading branch information
wingkwong authored Dec 27, 2024
1 parent ab9ad9b commit a83388a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-badgers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/alert": patch
---

mark description prop as optional (#4445)
5 changes: 5 additions & 0 deletions .changeset/new-cups-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

fix the alignment when only alert children is provided
4 changes: 2 additions & 2 deletions packages/components/alert/src/use-alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ interface Props extends HTMLNextUIProps<"div"> {
*/
title?: string;
/**
* Main body of the alert message
* description of the alert message
*/
description: ReactNode;
description?: ReactNode;
/**
* Icon to be displayed in the alert - overrides the default icon
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/core/theme/src/components/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import {colorVariants} from "../utils";
const alert = tv({
slots: {
base: "flex flex-grow flex-row w-full items-start py-3 px-4 gap-x-1",
mainWrapper: "h-full flex-grow min-h-10 ms-2 flex flex-col box-border items-start text-inherit",
mainWrapper:
"h-full flex-grow min-h-10 ms-2 flex flex-col box-border items-start text-inherit justify-center",
title: "text-small w-full font-medium block text-inherit leading-5",
description: "pl-[1px] text-small font-normal text-inherit",
closeButton: "relative text-inherit translate-x-1 -translate-y-1",
Expand Down

0 comments on commit a83388a

Please sign in to comment.