From 6b39aa4e70d52e68e20f2ccc53a096489aaa9675 Mon Sep 17 00:00:00 2001 From: pheralb Date: Thu, 25 Jan 2024 13:40:12 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Add=20dialog=20UI=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/dialog/dialog-content.svelte | 38 +++++++++++++++++++++++++ src/ui/dialog/dialog-description.svelte | 13 +++++++++ src/ui/dialog/dialog-footer.svelte | 16 +++++++++++ src/ui/dialog/dialog-header.svelte | 13 +++++++++ src/ui/dialog/dialog-overlay.svelte | 24 ++++++++++++++++ src/ui/dialog/dialog-portal.svelte | 8 ++++++ src/ui/dialog/dialog-title.svelte | 16 +++++++++++ src/ui/dialog/index.ts | 34 ++++++++++++++++++++++ 8 files changed, 162 insertions(+) create mode 100644 src/ui/dialog/dialog-content.svelte create mode 100644 src/ui/dialog/dialog-description.svelte create mode 100644 src/ui/dialog/dialog-footer.svelte create mode 100644 src/ui/dialog/dialog-header.svelte create mode 100644 src/ui/dialog/dialog-overlay.svelte create mode 100644 src/ui/dialog/dialog-portal.svelte create mode 100644 src/ui/dialog/dialog-title.svelte create mode 100644 src/ui/dialog/index.ts diff --git a/src/ui/dialog/dialog-content.svelte b/src/ui/dialog/dialog-content.svelte new file mode 100644 index 0000000..2a83cc4 --- /dev/null +++ b/src/ui/dialog/dialog-content.svelte @@ -0,0 +1,38 @@ + + + + + + + + + Close + + + diff --git a/src/ui/dialog/dialog-description.svelte b/src/ui/dialog/dialog-description.svelte new file mode 100644 index 0000000..89cd271 --- /dev/null +++ b/src/ui/dialog/dialog-description.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/src/ui/dialog/dialog-footer.svelte b/src/ui/dialog/dialog-footer.svelte new file mode 100644 index 0000000..ee5263f --- /dev/null +++ b/src/ui/dialog/dialog-footer.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/src/ui/dialog/dialog-header.svelte b/src/ui/dialog/dialog-header.svelte new file mode 100644 index 0000000..2432973 --- /dev/null +++ b/src/ui/dialog/dialog-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/src/ui/dialog/dialog-overlay.svelte b/src/ui/dialog/dialog-overlay.svelte new file mode 100644 index 0000000..fb1314f --- /dev/null +++ b/src/ui/dialog/dialog-overlay.svelte @@ -0,0 +1,24 @@ + + + diff --git a/src/ui/dialog/dialog-portal.svelte b/src/ui/dialog/dialog-portal.svelte new file mode 100644 index 0000000..45112b7 --- /dev/null +++ b/src/ui/dialog/dialog-portal.svelte @@ -0,0 +1,8 @@ + + + + + diff --git a/src/ui/dialog/dialog-title.svelte b/src/ui/dialog/dialog-title.svelte new file mode 100644 index 0000000..a4b54aa --- /dev/null +++ b/src/ui/dialog/dialog-title.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/dialog/index.ts b/src/ui/dialog/index.ts new file mode 100644 index 0000000..676a771 --- /dev/null +++ b/src/ui/dialog/index.ts @@ -0,0 +1,34 @@ +import { Dialog as DialogPrimitive } from 'bits-ui'; + +const Root = DialogPrimitive.Root; +const Trigger = DialogPrimitive.Trigger; + +import Title from './dialog-title.svelte'; +import Portal from './dialog-portal.svelte'; +import Footer from './dialog-footer.svelte'; +import Header from './dialog-header.svelte'; +import Overlay from './dialog-overlay.svelte'; +import Content from './dialog-content.svelte'; +import Description from './dialog-description.svelte'; + +export { + Root, + Title, + Portal, + Footer, + Header, + Trigger, + Overlay, + Content, + Description, + // + Root as Dialog, + Title as DialogTitle, + Portal as DialogPortal, + Footer as DialogFooter, + Header as DialogHeader, + Trigger as DialogTrigger, + Overlay as DialogOverlay, + Content as DialogContent, + Description as DialogDescription +};