Skip to content

Commit

Permalink
fix(alert): add max-w property to make alert responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav700 committed Oct 16, 2024
1 parent 22c6a51 commit 427c4fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions packages/components/alert/stories/alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ const defaultProps = {
description: "You will get a reply soon",
};

const Template = (args) => <Alert {...args} />;
const Template = (args) => (
<div className="w-full">
<Alert {...args} />
</div>
);

const ColorTemplate = (args) => {
return (
<div className="flex flex-col">
<div className="flex flex-col w-full">
{["default", "primary", "secondary", "success", "warning", "danger"].map((color) => (
<div key={color} className="w-full flex justify-between items-center my-3">
<span className="mx-4 text-md">{color}</span>
Expand All @@ -58,7 +62,7 @@ const ColorTemplate = (args) => {

const RadiusTemplate = (args) => {
return (
<div className="flex flex-col">
<div className="flex flex-col w-full">
{["none", "sm", "md", "lg", "full"].map((radius) => (
<div key={radius} className="w-full flex justify-between items-center my-3">
<span className="mx-4 text-md">{radius}</span>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/theme/src/components/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {tv} from "../utils/tv";
*/
const alert = tv({
slots: {
base: ["flex flex-row w-[260px] sm:w-[342px] h-17 p-3"],
base: ["flex flex-row max-w-[342px] h-17 p-3"],
title: ["text-medium font-normal block h-6"],
description: ["text-small font-normal h-5"],
mainWrapper: ["sm:w-[268px] w-[186px] h-11 ms-5 flex flex-col box-border items-start"],
mainWrapper: ["max-w-[268px] h-11 ms-5 flex flex-col box-border items-start"],
closeButton: ["w-6 h-6 cursor-pointer relative"],
closeIcon: ["fill-current"],
},
Expand Down

0 comments on commit 427c4fe

Please sign in to comment.