Files
supabase/apps/design-system/registry/default/example/dialog-close-button.tsx
T
Jonathan Summers-Muir 972773ca87 [Dashboard] Chore: update Modal component to use new components (#26844)
* init

* add more examples

* update modal

* update modals

* more modals updated

* update modal

* Update NewAccessTokenButton.tsx

* Update NewAccessTokenButton.tsx

* fix: issue with scale on dialog opening. chore: added bg-dialog color

* fix modals

* add deprecation notices

* revert bg

* revert

* Update Modal.tsx

* Update PITRSelection.tsx

* update dialog docs

* fix: issue with payment method modal

* update terminal instructions

* update padding defaults
2024-06-05 10:06:55 +00:00

58 lines
1.7 KiB
TypeScript

import { Copy } from 'lucide-react'
import { Button, DialogSection, DialogSectionSeparator } from 'ui'
import {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from 'ui'
import { Input_Shadcn_ } from 'ui'
import { Label_Shadcn_ } from 'ui'
export default function DialogCloseButton() {
return (
<Dialog>
<DialogTrigger asChild>
<Button type="default">Share</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-md">
<DialogHeader padding={'small'}>
<DialogTitle>Share link</DialogTitle>
<DialogDescription>Anyone who has this link will be able to view this.</DialogDescription>
</DialogHeader>
<DialogSectionSeparator />
<DialogSection padding={'small'}>
<div className="flex items-center space-x-2">
<div className="grid flex-1 gap-2">
<Label_Shadcn_ htmlFor="link" className="sr-only">
Link
</Label_Shadcn_>
<Input_Shadcn_
id="link"
defaultValue="https://ui.shadcn.com/docs/installation"
readOnly
/>
</div>
<Button htmlType="submit" size="small" type="secondary" className="px-3">
<span className="sr-only">Copy</span>
<Copy className="h-4 w-4" />
</Button>
</div>
</DialogSection>
<DialogFooter className="sm:justify-start" padding={'small'}>
<DialogClose asChild>
<Button type="default" htmlType="button">
Custom Close Button
</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>
)
}