-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add design system for Modal (#5206)
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { ShoppingBagIcon } from '@heroicons/react/24/outline'; | ||
import { Button, Card, CardHeader, Modal } from '@hey/ui'; | ||
import { type FC, useState } from 'react'; | ||
|
||
const ModalDesign: FC = () => { | ||
const [showXsModal, setShowXsModal] = useState(false); | ||
const [showSmModal, setShowSmModal] = useState(false); | ||
const [showMdModal, setShowMdModal] = useState(false); | ||
const [showLgModal, setShowLgModal] = useState(false); | ||
|
||
const children = ( | ||
<div className="p-5">The quick brown fox jumps over the lazy dog.</div> | ||
); | ||
|
||
return ( | ||
<Card> | ||
<CardHeader title="Modals" /> | ||
<Modal | ||
icon={<ShoppingBagIcon className="size-5" />} | ||
onClose={() => setShowXsModal(false)} | ||
show={showXsModal} | ||
size="xs" | ||
title="Extra small modal" | ||
> | ||
{children} | ||
</Modal> | ||
<Modal | ||
icon={<ShoppingBagIcon className="size-5" />} | ||
onClose={() => setShowSmModal(false)} | ||
show={showSmModal} | ||
size="sm" | ||
title="Small modal" | ||
> | ||
{children} | ||
</Modal> | ||
<Modal | ||
icon={<ShoppingBagIcon className="size-5" />} | ||
onClose={() => setShowMdModal(false)} | ||
show={showMdModal} | ||
size="md" | ||
title="Medium modal" | ||
> | ||
{children} | ||
</Modal> | ||
<Modal | ||
icon={<ShoppingBagIcon className="size-5" />} | ||
onClose={() => setShowLgModal(false)} | ||
show={showLgModal} | ||
size="lg" | ||
title="Large modal" | ||
> | ||
{children} | ||
</Modal> | ||
<div className="m-5 flex gap-5"> | ||
<Button onClick={() => setShowXsModal(true)} outline> | ||
Show extra small modal | ||
</Button> | ||
<Button onClick={() => setShowSmModal(true)} outline> | ||
Show small modal | ||
</Button> | ||
<Button onClick={() => setShowMdModal(true)} outline> | ||
Show medium modal | ||
</Button> | ||
<Button onClick={() => setShowLgModal(true)} outline> | ||
Show large modal | ||
</Button> | ||
</div> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default ModalDesign; |
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
e989b15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./
web-git-main-heyxyz.vercel.app
heyxyz.vercel.app
hey.xyz
web-heyxyz.vercel.app