From 8a8796738215217f89d3877edcf2776fdd480869 Mon Sep 17 00:00:00 2001 From: "hrynevych.romann" Date: Wed, 17 Jan 2024 22:32:41 +0200 Subject: [PATCH] feat(dialog-with-scroll-overlay): add demos with overlay scroll for Dialog component --- apps/www/__registry__/index.ts | 18 +++++++- .../www/src/content/docs/components/dialog.md | 4 ++ .../example/DialogScrollOverlayDemo.vue | 40 +++++++++++++++++ .../default/ui/dialog/DialogScrollContent.vue | 45 +++++++++++++++++++ .../lib/registry/default/ui/dialog/index.ts | 1 + .../example/DialogScrollOverlayDemo.vue | 40 +++++++++++++++++ .../ui/dialog/DialogScrollContent.vue | 45 +++++++++++++++++++ .../lib/registry/new-york/ui/dialog/index.ts | 1 + apps/www/src/public/registry/index.json | 1 + .../registry/styles/default/dialog.json | 6 ++- .../registry/styles/new-york/dialog.json | 6 ++- 11 files changed, 203 insertions(+), 4 deletions(-) create mode 100644 apps/www/src/lib/registry/default/example/DialogScrollOverlayDemo.vue create mode 100644 apps/www/src/lib/registry/default/ui/dialog/DialogScrollContent.vue create mode 100644 apps/www/src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/dialog/DialogScrollContent.vue diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 668de866..64603a1a 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -383,10 +383,17 @@ export const Index = { DialogScrollContentDemo: { name: 'DialogScrollContentDemo', type: 'components:example', - registryDependencies: ['button', 'dialog', 'input', 'label'], + registryDependencies: ['button', 'dialog'], component: () => import('../src/lib/registry/default/example/DialogScrollContentDemo.vue').then(m => m.default), files: ['../src/lib/registry/default/example/DialogScrollContentDemo.vue'], }, + DialogScrollOverlayDemo: { + name: 'DialogScrollOverlayDemo', + type: 'components:example', + registryDependencies: ['button', 'dialog'], + component: () => import('../src/lib/registry/default/example/DialogScrollOverlayDemo.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/DialogScrollOverlayDemo.vue'], + }, DropdownMenuDemo: { name: 'DropdownMenuDemo', type: 'components:example', @@ -1274,10 +1281,17 @@ export const Index = { DialogScrollContentDemo: { name: 'DialogScrollContentDemo', type: 'components:example', - registryDependencies: ['button', 'dialog', 'input', 'label'], + registryDependencies: ['button', 'dialog'], component: () => import('../src/lib/registry/new-york/example/DialogScrollContentDemo.vue').then(m => m.default), files: ['../src/lib/registry/new-york/example/DialogScrollContentDemo.vue'], }, + DialogScrollOverlayDemo: { + name: 'DialogScrollOverlayDemo', + type: 'components:example', + registryDependencies: ['button', 'dialog'], + component: () => import('../src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue'], + }, DropdownMenuDemo: { name: 'DropdownMenuDemo', type: 'components:example', diff --git a/apps/www/src/content/docs/components/dialog.md b/apps/www/src/content/docs/components/dialog.md index 4c1b9f6d..84518f72 100644 --- a/apps/www/src/content/docs/components/dialog.md +++ b/apps/www/src/content/docs/components/dialog.md @@ -59,6 +59,10 @@ import { +### Dialog with Scroll Overlay + + + ## Notes To activate the `Dialog` component from within a `Context Menu` or `Dropdown Menu`, you must encase the `Context Menu` or `Dropdown Menu` component in the `Dialog` component. For more information, refer to the linked issue [here](https://github.com/radix-ui/primitives/issues/1836). diff --git a/apps/www/src/lib/registry/default/example/DialogScrollOverlayDemo.vue b/apps/www/src/lib/registry/default/example/DialogScrollOverlayDemo.vue new file mode 100644 index 00000000..02fc9b8c --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DialogScrollOverlayDemo.vue @@ -0,0 +1,40 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/dialog/DialogScrollContent.vue b/apps/www/src/lib/registry/default/ui/dialog/DialogScrollContent.vue new file mode 100644 index 00000000..275020bb --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/dialog/DialogScrollContent.vue @@ -0,0 +1,45 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/dialog/index.ts b/apps/www/src/lib/registry/default/ui/dialog/index.ts index 303347eb..847e999f 100644 --- a/apps/www/src/lib/registry/default/ui/dialog/index.ts +++ b/apps/www/src/lib/registry/default/ui/dialog/index.ts @@ -5,4 +5,5 @@ export { default as DialogHeader } from './DialogHeader.vue' export { default as DialogTitle } from './DialogTitle.vue' export { default as DialogDescription } from './DialogDescription.vue' export { default as DialogContent } from './DialogContent.vue' +export { default as DialogScrollContent } from './DialogScrollContent.vue' export { default as DialogFooter } from './DialogFooter.vue' diff --git a/apps/www/src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue b/apps/www/src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue new file mode 100644 index 00000000..fae163fd --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/DialogScrollOverlayDemo.vue @@ -0,0 +1,40 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/dialog/DialogScrollContent.vue b/apps/www/src/lib/registry/new-york/ui/dialog/DialogScrollContent.vue new file mode 100644 index 00000000..49692c21 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/ui/dialog/DialogScrollContent.vue @@ -0,0 +1,45 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/dialog/index.ts b/apps/www/src/lib/registry/new-york/ui/dialog/index.ts index 303347eb..847e999f 100644 --- a/apps/www/src/lib/registry/new-york/ui/dialog/index.ts +++ b/apps/www/src/lib/registry/new-york/ui/dialog/index.ts @@ -5,4 +5,5 @@ export { default as DialogHeader } from './DialogHeader.vue' export { default as DialogTitle } from './DialogTitle.vue' export { default as DialogDescription } from './DialogDescription.vue' export { default as DialogContent } from './DialogContent.vue' +export { default as DialogScrollContent } from './DialogScrollContent.vue' export { default as DialogFooter } from './DialogFooter.vue' diff --git a/apps/www/src/public/registry/index.json b/apps/www/src/public/registry/index.json index ee1339ec..ab301206 100644 --- a/apps/www/src/public/registry/index.json +++ b/apps/www/src/public/registry/index.json @@ -236,6 +236,7 @@ "ui/dialog/DialogDescription.vue", "ui/dialog/DialogFooter.vue", "ui/dialog/DialogHeader.vue", + "ui/dialog/DialogScrollContent.vue", "ui/dialog/DialogTitle.vue", "ui/dialog/DialogTrigger.vue", "ui/dialog/index.ts" diff --git a/apps/www/src/public/registry/styles/default/dialog.json b/apps/www/src/public/registry/styles/default/dialog.json index 76ff177f..507cf559 100644 --- a/apps/www/src/public/registry/styles/default/dialog.json +++ b/apps/www/src/public/registry/styles/default/dialog.json @@ -29,6 +29,10 @@ "name": "DialogHeader.vue", "content": "\n\n\n" }, + { + "name": "DialogScrollContent.vue", + "content": "\n\n\n" + }, { "name": "DialogTitle.vue", "content": "\n\n\n" @@ -39,7 +43,7 @@ }, { "name": "index.ts", - "content": "export { default as Dialog } from './Dialog.vue'\nexport { default as DialogClose } from './DialogClose.vue'\nexport { default as DialogTrigger } from './DialogTrigger.vue'\nexport { default as DialogHeader } from './DialogHeader.vue'\nexport { default as DialogTitle } from './DialogTitle.vue'\nexport { default as DialogDescription } from './DialogDescription.vue'\nexport { default as DialogContent } from './DialogContent.vue'\nexport { default as DialogFooter } from './DialogFooter.vue'\n" + "content": "export { default as Dialog } from './Dialog.vue'\nexport { default as DialogClose } from './DialogClose.vue'\nexport { default as DialogTrigger } from './DialogTrigger.vue'\nexport { default as DialogHeader } from './DialogHeader.vue'\nexport { default as DialogTitle } from './DialogTitle.vue'\nexport { default as DialogDescription } from './DialogDescription.vue'\nexport { default as DialogContent } from './DialogContent.vue'\nexport { default as DialogScrollContent } from './DialogScrollContent.vue'\nexport { default as DialogFooter } from './DialogFooter.vue'\n" } ], "type": "components:ui" diff --git a/apps/www/src/public/registry/styles/new-york/dialog.json b/apps/www/src/public/registry/styles/new-york/dialog.json index cb379fd1..4919d20c 100644 --- a/apps/www/src/public/registry/styles/new-york/dialog.json +++ b/apps/www/src/public/registry/styles/new-york/dialog.json @@ -29,6 +29,10 @@ "name": "DialogHeader.vue", "content": "\n\n\n" }, + { + "name": "DialogScrollContent.vue", + "content": "\n\n\n" + }, { "name": "DialogTitle.vue", "content": "\n\n\n" @@ -39,7 +43,7 @@ }, { "name": "index.ts", - "content": "export { default as Dialog } from './Dialog.vue'\nexport { default as DialogClose } from './DialogClose.vue'\nexport { default as DialogTrigger } from './DialogTrigger.vue'\nexport { default as DialogHeader } from './DialogHeader.vue'\nexport { default as DialogTitle } from './DialogTitle.vue'\nexport { default as DialogDescription } from './DialogDescription.vue'\nexport { default as DialogContent } from './DialogContent.vue'\nexport { default as DialogFooter } from './DialogFooter.vue'\n" + "content": "export { default as Dialog } from './Dialog.vue'\nexport { default as DialogClose } from './DialogClose.vue'\nexport { default as DialogTrigger } from './DialogTrigger.vue'\nexport { default as DialogHeader } from './DialogHeader.vue'\nexport { default as DialogTitle } from './DialogTitle.vue'\nexport { default as DialogDescription } from './DialogDescription.vue'\nexport { default as DialogContent } from './DialogContent.vue'\nexport { default as DialogScrollContent } from './DialogScrollContent.vue'\nexport { default as DialogFooter } from './DialogFooter.vue'\n" } ], "type": "components:ui"