-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
333 additions
and
557 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
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
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,42 @@ | ||
"use client" | ||
|
||
import React from "react" | ||
|
||
import { Button, Drawer } from "ui" | ||
|
||
type Sides = "bottom" | "top" | "left" | "right" | ||
|
||
export default function DrawerDirectionDemo() { | ||
const [isOpen, setIsOpen] = React.useState(false) | ||
const [openSide, setOpenSide] = React.useState<Sides>("bottom") | ||
const sides: Sides[] = ["bottom", "top", "left", "right"] | ||
const handlePress = (side: Sides) => { | ||
setOpenSide(side) | ||
setIsOpen(true) | ||
} | ||
return ( | ||
<div> | ||
<div className="flex gap-2 flex-wrap"> | ||
{sides.map((side) => ( | ||
<Button key={side} appearance="outline" onPress={() => handlePress(side)}> | ||
{side} | ||
</Button> | ||
))} | ||
</div> | ||
|
||
<Drawer side={openSide} isOpen={isOpen} onOpenChange={setIsOpen}> | ||
<Drawer.Content> | ||
<Drawer.Header> | ||
<Drawer.Title className="capitalize">{openSide}</Drawer.Title> | ||
<Drawer.Description>The drawer will slide in from the {openSide}.</Drawer.Description> | ||
</Drawer.Header> | ||
<Drawer.Footer> | ||
<Drawer.Close shape="circle" className="w-full"> | ||
Close | ||
</Drawer.Close> | ||
</Drawer.Footer> | ||
</Drawer.Content> | ||
</Drawer> | ||
</div> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
components/docs/overlays/drawer/drawer-hide-notch-demo.tsx
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,23 @@ | ||
"use client" | ||
|
||
import { Button, buttonStyles, Drawer } from "ui" | ||
|
||
export default function DrawerHideNotchDemo() { | ||
return ( | ||
<Drawer hideNotch> | ||
<Drawer.Trigger className={buttonStyles({ appearance: "outline" })}> | ||
Open Drawer | ||
</Drawer.Trigger> | ||
<Drawer.Content> | ||
<Drawer.Header> | ||
<Drawer.Title>Drawer</Drawer.Title> | ||
<Drawer.Description>A slide-in overlay for extra content or options.</Drawer.Description> | ||
</Drawer.Header> | ||
<Drawer.Footer> | ||
<Drawer.Close>Close</Drawer.Close> | ||
<Button>Done</Button> | ||
</Drawer.Footer> | ||
</Drawer.Content> | ||
</Drawer> | ||
) | ||
} |
24 changes: 24 additions & 0 deletions
24
components/docs/overlays/drawer/drawer-is-not-centered-demo.tsx
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,24 @@ | ||
"use client" | ||
|
||
import { Button, buttonStyles, Drawer } from "ui" | ||
|
||
export default function DrawerIsNotCenteredDemo() { | ||
return ( | ||
<Drawer isCentered={false}> | ||
<Drawer.Trigger className={buttonStyles({ appearance: "outline" })}> | ||
Open Drawer | ||
</Drawer.Trigger> | ||
<Drawer.Content> | ||
<Drawer.Header> | ||
<Drawer.Title>Drawer</Drawer.Title> | ||
<Drawer.Description>A slide-in overlay for extra content or options.</Drawer.Description> | ||
</Drawer.Header> | ||
<Drawer.Body>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sus</Drawer.Body> | ||
<Drawer.Footer> | ||
<Drawer.Close>Close</Drawer.Close> | ||
<Button>Done</Button> | ||
</Drawer.Footer> | ||
</Drawer.Content> | ||
</Drawer> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.