Skip to content

Commit a83388a

Browse files
authored
fix(alert): mark description optional & revise styles when only children is provided (#4447)
* fix(alert): mark description as optional and update description * fix(theme): alignment when only children is provided * feat(changeset): add changeset
1 parent ab9ad9b commit a83388a

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.changeset/neat-badgers-beam.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nextui-org/alert": patch
3+
---
4+
5+
mark description prop as optional (#4445)

.changeset/new-cups-tan.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nextui-org/theme": patch
3+
---
4+
5+
fix the alignment when only alert children is provided

packages/components/alert/src/use-alert.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ interface Props extends HTMLNextUIProps<"div"> {
1919
*/
2020
title?: string;
2121
/**
22-
* Main body of the alert message
22+
* description of the alert message
2323
*/
24-
description: ReactNode;
24+
description?: ReactNode;
2525
/**
2626
* Icon to be displayed in the alert - overrides the default icon
2727
*/

packages/core/theme/src/components/alert.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {colorVariants} from "../utils";
2525
const alert = tv({
2626
slots: {
2727
base: "flex flex-grow flex-row w-full items-start py-3 px-4 gap-x-1",
28-
mainWrapper: "h-full flex-grow min-h-10 ms-2 flex flex-col box-border items-start text-inherit",
28+
mainWrapper:
29+
"h-full flex-grow min-h-10 ms-2 flex flex-col box-border items-start text-inherit justify-center",
2930
title: "text-small w-full font-medium block text-inherit leading-5",
3031
description: "pl-[1px] text-small font-normal text-inherit",
3132
closeButton: "relative text-inherit translate-x-1 -translate-y-1",

0 commit comments

Comments
 (0)