-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polishing Sparkle and Adding ContentMessage (#2377)
* Polishing Sparkle and Adding ContentMessage * Bumping Version --------- Co-authored-by: édouard wautier <[email protected]>
- Loading branch information
Showing
6 changed files
with
155 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
|
||
import { classNames } from "@sparkle/lib/utils"; | ||
|
||
import { Icon, InformationCircleIcon } from ".."; | ||
|
||
export interface ContentMessageProps { | ||
title: string; | ||
message: string; | ||
className?: string; | ||
} | ||
|
||
export function ContentMessage({ | ||
title, | ||
message, | ||
className = "", | ||
}: ContentMessageProps) { | ||
return ( | ||
<div | ||
className={classNames( | ||
"s-flex s-max-w-[500px] s-gap-2 s-rounded-2xl s-border s-border-amber-100 s-bg-amber-50 s-p-4", | ||
className | ||
)} | ||
> | ||
<Icon | ||
size="md" | ||
visual={InformationCircleIcon} | ||
className="s-text-amber-600" | ||
/> | ||
<div className="s-flex s-flex-col s-gap-1"> | ||
<div className="s-text-base s-font-semibold s-text-amber-600"> | ||
{title} | ||
</div> | ||
<div className="s-text-sm s-text-element-800">{message}</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Meta } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import { ContentMessage } from "../index_with_tw_base"; | ||
|
||
const meta = { | ||
title: "Atoms/ContentMessage", | ||
component: ContentMessage, | ||
} satisfies Meta<typeof ContentMessage>; | ||
|
||
export default meta; | ||
|
||
export const PopupExample = () => ( | ||
<div className="s-flex s-flex-col s-gap-4"> | ||
<ContentMessage | ||
title="This is a title" | ||
message="This is a message. It can be multiple lines long." | ||
/> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters