Skip to content

Commit

Permalink
chore(alert): add the support for RTL, refactor the code and fix the …
Browse files Browse the repository at this point in the history
…typos
  • Loading branch information
abhinav700 committed Sep 29, 2024
1 parent f4dbcf9 commit 3f3a7d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
12 changes: 5 additions & 7 deletions packages/core/theme/src/components/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import {tv} from "../utils/tv";
* ```js
* const {base, mainWrapper, title, description} = input({...})
*
* <div className={base())}>
* // icon
*
* <div classsName ={mainWrapper()}>
* <div className={base()}>
* <AlertIcon/>
* <div className={mainWrapper()}>
* <div className={title()}>Title</div>
* <div className={description()}>Description</div>
* </div>
*
* <button>
* // close button
* </button>
Expand All @@ -28,15 +26,15 @@ const alert = tv({
base: ["flex flex-row w-[342px] h-17 p-3"],
title: ["text-medium font-normal block h-6"],
description: ["text-small font-normal h-5"],
mainWrapper: ["w-[268px] h-11 ml-5 flex flex-col box-border items-start"],
mainWrapper: ["w-[268px] h-11 ml-5 rtl:mr-5 rtl:ml-0 flex flex-col box-border items-start"],
closeButton: ["w-6 h-6 cursor-pointer relative"],
},
variants: {
color: {
default: {
base: ["bg-default-100"],
title: ["text-foreground"],
description: ["text-[default-600]"],
description: ["text-default-600"],
},
primary: {
base: ["bg-primary-50"],
Expand Down
9 changes: 8 additions & 1 deletion packages/utilities/shared-icons/src/success.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ export const SuccessIcon = (
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d="M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z" />
<path
d="
M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2Z
M16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54
C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64
C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z
"
/>
</svg>
);
};

0 comments on commit 3f3a7d0

Please sign in to comment.