@lark-apaas/coding-templates 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/template-vite-react/_gitignore +24 -0
- package/template-vite-react/client/index.html +13 -0
- package/template-vite-react/client/public/favicon.svg +1 -0
- package/template-vite-react/client/public/icons.svg +24 -0
- package/template-vite-react/client/src/api/index.ts +7 -0
- package/template-vite-react/client/src/app.tsx +19 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/header.tsx +5 -13
- package/template-vite-react/client/src/components/layout.tsx +13 -0
- package/template-vite-react/client/src/components/theme-provider.tsx +45 -0
- package/template-vite-react/client/src/components/ui/accordion.tsx +72 -0
- package/template-vite-react/client/src/components/ui/alert-dialog.tsx +187 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/alert.tsx +15 -10
- package/template-vite-react/client/src/components/ui/aspect-ratio.tsx +22 -0
- package/template-vite-react/client/src/components/ui/avatar.tsx +109 -0
- package/template-vite-react/client/src/components/ui/badge.tsx +52 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/breadcrumb.tsx +39 -23
- package/template-vite-react/client/src/components/ui/button.tsx +58 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/calendar.tsx +43 -37
- package/template-vite-react/client/src/components/ui/card.tsx +103 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/carousel.tsx +8 -7
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/chart.tsx +49 -35
- package/template-vite-react/client/src/components/ui/checkbox.tsx +29 -0
- package/template-vite-react/client/src/components/ui/collapsible.tsx +19 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/command.tsx +40 -52
- package/template-vite-react/client/src/components/ui/context-menu.tsx +271 -0
- package/template-vite-react/client/src/components/ui/dialog.tsx +158 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/drawer.tsx +9 -12
- package/template-vite-react/client/src/components/ui/dropdown-menu.tsx +268 -0
- package/template-vite-react/client/src/components/ui/hover-card.tsx +49 -0
- package/template-vite-react/client/src/components/ui/input-group.tsx +156 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/input-otp.tsx +17 -7
- package/template-vite-react/client/src/components/ui/input.tsx +20 -0
- package/template-vite-react/client/src/components/ui/label.tsx +18 -0
- package/template-vite-react/client/src/components/ui/menubar.tsx +280 -0
- package/template-vite-react/client/src/components/ui/navigation-menu.tsx +168 -0
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/pagination.tsx +35 -32
- package/template-vite-react/client/src/components/ui/popover.tsx +90 -0
- package/template-vite-react/client/src/components/ui/progress.tsx +81 -0
- package/template-vite-react/client/src/components/ui/radio-group.tsx +38 -0
- package/template-vite-react/client/src/components/ui/resizable.tsx +48 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/scroll-area.tsx +10 -13
- package/template-vite-react/client/src/components/ui/select.tsx +199 -0
- package/template-vite-react/client/src/components/ui/separator.tsx +25 -0
- package/template-vite-react/client/src/components/ui/sheet.tsx +138 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/sidebar.tsx +156 -162
- package/{template-nextjs-static → template-vite-react/client}/src/components/ui/skeleton.tsx +1 -1
- package/template-vite-react/client/src/components/ui/slider.tsx +57 -0
- package/template-vite-react/client/src/components/ui/sonner.tsx +49 -0
- package/template-vite-react/client/src/components/ui/switch.tsx +30 -0
- package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/table.tsx +5 -5
- package/template-vite-react/client/src/components/ui/tabs.tsx +80 -0
- package/template-vite-react/client/src/components/ui/textarea.tsx +18 -0
- package/template-vite-react/client/src/components/ui/toggle-group.tsx +89 -0
- package/template-vite-react/client/src/components/ui/toggle.tsx +44 -0
- package/template-vite-react/client/src/components/ui/tooltip.tsx +64 -0
- package/template-vite-react/client/src/index.css +1 -0
- package/template-vite-react/client/src/main.tsx +13 -0
- package/template-vite-react/client/src/pages/home/index.tsx +12 -0
- package/template-vite-react/client/src/pages/not-found/index.tsx +11 -0
- package/template-vite-react/client/src/types/index.ts +1 -0
- package/{template-nextjs-static → template-vite-react}/components.json +2 -2
- package/template-vite-react/eslint.config.js +23 -0
- package/template-vite-react/package.json +58 -0
- package/template-vite-react/scripts/build.sh +40 -0
- package/template-vite-react/shared/types.ts +1 -0
- package/template-vite-react/tsconfig.app.json +33 -0
- package/template-vite-react/tsconfig.json +14 -0
- package/template-vite-react/tsconfig.node.json +26 -0
- package/template-vite-react/vite.config.ts +22 -0
- package/template-nextjs-fullstack/README.md +0 -169
- package/template-nextjs-fullstack/_env.local.example +0 -1
- package/template-nextjs-fullstack/_gitignore +0 -41
- package/template-nextjs-fullstack/components.json +0 -25
- package/template-nextjs-fullstack/drizzle.config.ts +0 -10
- package/template-nextjs-fullstack/eslint.config.js +0 -15
- package/template-nextjs-fullstack/next.config.ts +0 -5
- package/template-nextjs-fullstack/package.json +0 -85
- package/template-nextjs-fullstack/postcss.config.js +0 -8
- package/template-nextjs-fullstack/scripts/build.sh +0 -37
- package/template-nextjs-fullstack/src/app/favicon.ico +0 -0
- package/template-nextjs-fullstack/src/app/globals.css +0 -130
- package/template-nextjs-fullstack/src/app/layout.tsx +0 -24
- package/template-nextjs-fullstack/src/app/page.tsx +0 -69
- package/template-nextjs-fullstack/src/app/todos/actions.ts +0 -37
- package/template-nextjs-fullstack/src/app/todos/page.tsx +0 -26
- package/template-nextjs-fullstack/src/app/todos/todo-form.tsx +0 -27
- package/template-nextjs-fullstack/src/app/todos/todo-list.tsx +0 -44
- package/template-nextjs-fullstack/src/components/header.tsx +0 -32
- package/template-nextjs-fullstack/src/components/theme-provider.tsx +0 -8
- package/template-nextjs-fullstack/src/components/ui/README.md +0 -134
- package/template-nextjs-fullstack/src/components/ui/accordion.tsx +0 -66
- package/template-nextjs-fullstack/src/components/ui/alert-dialog.tsx +0 -157
- package/template-nextjs-fullstack/src/components/ui/aspect-ratio.tsx +0 -11
- package/template-nextjs-fullstack/src/components/ui/avatar.tsx +0 -53
- package/template-nextjs-fullstack/src/components/ui/badge.tsx +0 -42
- package/template-nextjs-fullstack/src/components/ui/button.tsx +0 -69
- package/template-nextjs-fullstack/src/components/ui/calendar.tsx +0 -213
- package/template-nextjs-fullstack/src/components/ui/card.tsx +0 -82
- package/template-nextjs-fullstack/src/components/ui/chart.tsx +0 -357
- package/template-nextjs-fullstack/src/components/ui/checkbox.tsx +0 -32
- package/template-nextjs-fullstack/src/components/ui/collapsible.tsx +0 -33
- package/template-nextjs-fullstack/src/components/ui/context-menu.tsx +0 -324
- package/template-nextjs-fullstack/src/components/ui/dialog.tsx +0 -143
- package/template-nextjs-fullstack/src/components/ui/drawer.tsx +0 -135
- package/template-nextjs-fullstack/src/components/ui/dropdown-menu.tsx +0 -329
- package/template-nextjs-fullstack/src/components/ui/hover-card.tsx +0 -44
- package/template-nextjs-fullstack/src/components/ui/input-group.tsx +0 -166
- package/template-nextjs-fullstack/src/components/ui/input-otp.tsx +0 -77
- package/template-nextjs-fullstack/src/components/ui/input.tsx +0 -21
- package/template-nextjs-fullstack/src/components/ui/label.tsx +0 -24
- package/template-nextjs-fullstack/src/components/ui/menubar.tsx +0 -348
- package/template-nextjs-fullstack/src/components/ui/navigation-menu.tsx +0 -168
- package/template-nextjs-fullstack/src/components/ui/pagination.tsx +0 -127
- package/template-nextjs-fullstack/src/components/ui/popover.tsx +0 -48
- package/template-nextjs-fullstack/src/components/ui/progress.tsx +0 -31
- package/template-nextjs-fullstack/src/components/ui/radio-group.tsx +0 -45
- package/template-nextjs-fullstack/src/components/ui/resizable.tsx +0 -56
- package/template-nextjs-fullstack/src/components/ui/select.tsx +0 -243
- package/template-nextjs-fullstack/src/components/ui/separator.tsx +0 -28
- package/template-nextjs-fullstack/src/components/ui/sheet.tsx +0 -139
- package/template-nextjs-fullstack/src/components/ui/skeleton.tsx +0 -13
- package/template-nextjs-fullstack/src/components/ui/slider.tsx +0 -87
- package/template-nextjs-fullstack/src/components/ui/sonner.tsx +0 -67
- package/template-nextjs-fullstack/src/components/ui/switch.tsx +0 -31
- package/template-nextjs-fullstack/src/components/ui/tabs.tsx +0 -66
- package/template-nextjs-fullstack/src/components/ui/textarea.tsx +0 -18
- package/template-nextjs-fullstack/src/components/ui/toggle-group.tsx +0 -83
- package/template-nextjs-fullstack/src/components/ui/toggle.tsx +0 -47
- package/template-nextjs-fullstack/src/components/ui/tooltip.tsx +0 -61
- package/template-nextjs-fullstack/src/db/index.ts +0 -8
- package/template-nextjs-fullstack/src/db/schema.ts +0 -11
- package/template-nextjs-fullstack/tailwind.config.ts +0 -10
- package/template-nextjs-fullstack/tsconfig.json +0 -34
- package/template-nextjs-static/README.md +0 -80
- package/template-nextjs-static/_gitignore +0 -41
- package/template-nextjs-static/eslint.config.js +0 -15
- package/template-nextjs-static/next.config.ts +0 -8
- package/template-nextjs-static/package.json +0 -77
- package/template-nextjs-static/postcss.config.js +0 -8
- package/template-nextjs-static/public/favicon.ico +0 -0
- package/template-nextjs-static/scripts/build.sh +0 -36
- package/template-nextjs-static/src/components/theme-provider.tsx +0 -6
- package/template-nextjs-static/src/components/ui/README.md +0 -134
- package/template-nextjs-static/src/components/ui/accordion.tsx +0 -66
- package/template-nextjs-static/src/components/ui/alert-dialog.tsx +0 -157
- package/template-nextjs-static/src/components/ui/alert.tsx +0 -71
- package/template-nextjs-static/src/components/ui/aspect-ratio.tsx +0 -11
- package/template-nextjs-static/src/components/ui/avatar.tsx +0 -53
- package/template-nextjs-static/src/components/ui/badge.tsx +0 -42
- package/template-nextjs-static/src/components/ui/breadcrumb.tsx +0 -109
- package/template-nextjs-static/src/components/ui/button-group.tsx +0 -83
- package/template-nextjs-static/src/components/ui/button.tsx +0 -69
- package/template-nextjs-static/src/components/ui/card.tsx +0 -82
- package/template-nextjs-static/src/components/ui/carousel.tsx +0 -241
- package/template-nextjs-static/src/components/ui/checkbox.tsx +0 -32
- package/template-nextjs-static/src/components/ui/collapsible.tsx +0 -33
- package/template-nextjs-static/src/components/ui/command.tsx +0 -208
- package/template-nextjs-static/src/components/ui/context-menu.tsx +0 -324
- package/template-nextjs-static/src/components/ui/dialog.tsx +0 -143
- package/template-nextjs-static/src/components/ui/dropdown-menu.tsx +0 -329
- package/template-nextjs-static/src/components/ui/empty.tsx +0 -104
- package/template-nextjs-static/src/components/ui/field.tsx +0 -248
- package/template-nextjs-static/src/components/ui/form.tsx +0 -167
- package/template-nextjs-static/src/components/ui/hover-card.tsx +0 -44
- package/template-nextjs-static/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -36
- package/template-nextjs-static/src/components/ui/icons/file-android-colorful-icon.tsx +0 -33
- package/template-nextjs-static/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-code-colorful-icon.tsx +0 -28
- package/template-nextjs-static/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -25
- package/template-nextjs-static/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -29
- package/template-nextjs-static/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -23
- package/template-nextjs-static/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -27
- package/template-nextjs-static/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -20
- package/template-nextjs-static/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -12
- package/template-nextjs-static/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -14
- package/template-nextjs-static/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -23
- package/template-nextjs-static/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -38
- package/template-nextjs-static/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -21
- package/template-nextjs-static/src/components/ui/image.tsx +0 -183
- package/template-nextjs-static/src/components/ui/input-group.tsx +0 -166
- package/template-nextjs-static/src/components/ui/input.tsx +0 -21
- package/template-nextjs-static/src/components/ui/item.tsx +0 -193
- package/template-nextjs-static/src/components/ui/kbd.tsx +0 -28
- package/template-nextjs-static/src/components/ui/label.tsx +0 -24
- package/template-nextjs-static/src/components/ui/menubar.tsx +0 -348
- package/template-nextjs-static/src/components/ui/native-select.tsx +0 -48
- package/template-nextjs-static/src/components/ui/navigation-menu.tsx +0 -168
- package/template-nextjs-static/src/components/ui/popover.tsx +0 -48
- package/template-nextjs-static/src/components/ui/progress.tsx +0 -31
- package/template-nextjs-static/src/components/ui/radio-group.tsx +0 -45
- package/template-nextjs-static/src/components/ui/resizable.tsx +0 -56
- package/template-nextjs-static/src/components/ui/scroll-area.tsx +0 -58
- package/template-nextjs-static/src/components/ui/select.tsx +0 -243
- package/template-nextjs-static/src/components/ui/separator.tsx +0 -28
- package/template-nextjs-static/src/components/ui/sheet.tsx +0 -139
- package/template-nextjs-static/src/components/ui/sidebar.tsx +0 -727
- package/template-nextjs-static/src/components/ui/slider.tsx +0 -87
- package/template-nextjs-static/src/components/ui/sonner.tsx +0 -67
- package/template-nextjs-static/src/components/ui/spinner.tsx +0 -16
- package/template-nextjs-static/src/components/ui/streamdown.tsx +0 -186
- package/template-nextjs-static/src/components/ui/switch.tsx +0 -31
- package/template-nextjs-static/src/components/ui/table.tsx +0 -116
- package/template-nextjs-static/src/components/ui/tabs.tsx +0 -66
- package/template-nextjs-static/src/components/ui/textarea.tsx +0 -18
- package/template-nextjs-static/src/components/ui/toggle-group.tsx +0 -83
- package/template-nextjs-static/src/components/ui/toggle.tsx +0 -47
- package/template-nextjs-static/src/components/ui/tooltip.tsx +0 -61
- package/template-nextjs-static/src/hooks/use-mobile.ts +0 -19
- package/template-nextjs-static/src/lib/utils.ts +0 -6
- package/template-nextjs-static/src/pages/_app.tsx +0 -11
- package/template-nextjs-static/src/pages/_document.tsx +0 -13
- package/template-nextjs-static/src/pages/hello.tsx +0 -32
- package/template-nextjs-static/src/pages/index.tsx +0 -76
- package/template-nextjs-static/src/styles/globals.css +0 -143
- package/template-nextjs-static/tailwind.config.ts +0 -10
- package/template-nextjs-static/tsconfig.json +0 -34
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/button-group.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/empty.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/field.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/form.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-android-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-code-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/image.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/item.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/kbd.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/native-select.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/spinner.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/components/ui/streamdown.tsx +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/hooks/use-mobile.ts +0 -0
- /package/{template-nextjs-fullstack → template-vite-react/client}/src/lib/utils.ts +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
|
4
|
-
|
|
5
|
-
function Collapsible({
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
8
|
-
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function CollapsibleTrigger({
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
14
|
-
return (
|
|
15
|
-
<CollapsiblePrimitive.CollapsibleTrigger
|
|
16
|
-
data-slot="collapsible-trigger"
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function CollapsibleContent({
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
25
|
-
return (
|
|
26
|
-
<CollapsiblePrimitive.CollapsibleContent
|
|
27
|
-
data-slot="collapsible-content"
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function ContextMenu({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
12
|
-
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function ContextMenuTrigger({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
18
|
-
return (
|
|
19
|
-
<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function ContextMenuGroup({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
26
|
-
return (
|
|
27
|
-
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function ContextMenuPortal({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
34
|
-
return (
|
|
35
|
-
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function ContextMenuSub({
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
42
|
-
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function ContextMenuRadioGroup({
|
|
46
|
-
...props
|
|
47
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
48
|
-
return (
|
|
49
|
-
<ContextMenuPrimitive.RadioGroup
|
|
50
|
-
data-slot="context-menu-radio-group"
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function ContextMenuSubTrigger({
|
|
57
|
-
className,
|
|
58
|
-
inset,
|
|
59
|
-
children,
|
|
60
|
-
...props
|
|
61
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
62
|
-
inset?: boolean
|
|
63
|
-
}) {
|
|
64
|
-
return (
|
|
65
|
-
<ContextMenuPrimitive.SubTrigger
|
|
66
|
-
data-slot="context-menu-sub-trigger"
|
|
67
|
-
data-inset={inset}
|
|
68
|
-
className={cn(
|
|
69
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<ChevronRightIcon className="ml-auto" />
|
|
76
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function ContextMenuSubContent({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
84
|
-
return (
|
|
85
|
-
<ContextMenuPrimitive.SubContent
|
|
86
|
-
data-slot="context-menu-sub-content"
|
|
87
|
-
className={cn(
|
|
88
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function ContextMenuContent({
|
|
97
|
-
className,
|
|
98
|
-
...props
|
|
99
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
100
|
-
return (
|
|
101
|
-
<ContextMenuPrimitive.Portal>
|
|
102
|
-
<ContextMenuPrimitive.Content
|
|
103
|
-
data-slot="context-menu-content"
|
|
104
|
-
className={cn(
|
|
105
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
106
|
-
className
|
|
107
|
-
)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
</ContextMenuPrimitive.Portal>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function ContextMenuItem({
|
|
115
|
-
className,
|
|
116
|
-
inset,
|
|
117
|
-
variant = "default",
|
|
118
|
-
disabled,
|
|
119
|
-
onClick,
|
|
120
|
-
onMouseDown,
|
|
121
|
-
onKeyDown,
|
|
122
|
-
onKeyUp,
|
|
123
|
-
onPointerDown,
|
|
124
|
-
...props
|
|
125
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
126
|
-
inset?: boolean
|
|
127
|
-
variant?: "default" | "destructive"
|
|
128
|
-
}) {
|
|
129
|
-
return (
|
|
130
|
-
<ContextMenuPrimitive.Item
|
|
131
|
-
data-slot="context-menu-item"
|
|
132
|
-
data-inset={inset}
|
|
133
|
-
data-variant={variant}
|
|
134
|
-
className={cn(
|
|
135
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
136
|
-
className
|
|
137
|
-
)}
|
|
138
|
-
disabled={disabled}
|
|
139
|
-
onClick={(event) => {
|
|
140
|
-
if (disabled) {
|
|
141
|
-
event.preventDefault()
|
|
142
|
-
return
|
|
143
|
-
}
|
|
144
|
-
onClick?.(event)
|
|
145
|
-
}}
|
|
146
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
147
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
148
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
149
|
-
onPointerDown={(event) => {
|
|
150
|
-
if (disabled) {
|
|
151
|
-
event.preventDefault()
|
|
152
|
-
return
|
|
153
|
-
}
|
|
154
|
-
onPointerDown?.(event)
|
|
155
|
-
}}
|
|
156
|
-
{...props}
|
|
157
|
-
/>
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function ContextMenuCheckboxItem({
|
|
162
|
-
className,
|
|
163
|
-
children,
|
|
164
|
-
checked,
|
|
165
|
-
disabled,
|
|
166
|
-
onClick,
|
|
167
|
-
onMouseDown,
|
|
168
|
-
onKeyDown,
|
|
169
|
-
onKeyUp,
|
|
170
|
-
onPointerDown,
|
|
171
|
-
...props
|
|
172
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
173
|
-
return (
|
|
174
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
175
|
-
data-slot="context-menu-checkbox-item"
|
|
176
|
-
className={cn(
|
|
177
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
178
|
-
className
|
|
179
|
-
)}
|
|
180
|
-
checked={checked}
|
|
181
|
-
disabled={disabled}
|
|
182
|
-
onClick={(event) => {
|
|
183
|
-
if (disabled) {
|
|
184
|
-
event.preventDefault()
|
|
185
|
-
return
|
|
186
|
-
}
|
|
187
|
-
onClick?.(event)
|
|
188
|
-
}}
|
|
189
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
190
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
191
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
192
|
-
onPointerDown={(event) => {
|
|
193
|
-
if (disabled) {
|
|
194
|
-
event.preventDefault()
|
|
195
|
-
return
|
|
196
|
-
}
|
|
197
|
-
onPointerDown?.(event)
|
|
198
|
-
}}
|
|
199
|
-
{...props}
|
|
200
|
-
>
|
|
201
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
202
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
203
|
-
<CheckIcon className="size-4" />
|
|
204
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
205
|
-
</span>
|
|
206
|
-
{children}
|
|
207
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function ContextMenuRadioItem({
|
|
212
|
-
className,
|
|
213
|
-
children,
|
|
214
|
-
disabled,
|
|
215
|
-
onClick,
|
|
216
|
-
onMouseDown,
|
|
217
|
-
onKeyDown,
|
|
218
|
-
onKeyUp,
|
|
219
|
-
onPointerDown,
|
|
220
|
-
...props
|
|
221
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
222
|
-
return (
|
|
223
|
-
<ContextMenuPrimitive.RadioItem
|
|
224
|
-
data-slot="context-menu-radio-item"
|
|
225
|
-
className={cn(
|
|
226
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
227
|
-
className
|
|
228
|
-
)}
|
|
229
|
-
disabled={disabled}
|
|
230
|
-
onClick={(event) => {
|
|
231
|
-
if (disabled) {
|
|
232
|
-
event.preventDefault()
|
|
233
|
-
return
|
|
234
|
-
}
|
|
235
|
-
onClick?.(event)
|
|
236
|
-
}}
|
|
237
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
238
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
239
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
240
|
-
onPointerDown={(event) => {
|
|
241
|
-
if (disabled) {
|
|
242
|
-
event.preventDefault()
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
onPointerDown?.(event)
|
|
246
|
-
}}
|
|
247
|
-
{...props}
|
|
248
|
-
>
|
|
249
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
250
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
251
|
-
<CircleIcon className="size-2 fill-current" />
|
|
252
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
253
|
-
</span>
|
|
254
|
-
{children}
|
|
255
|
-
</ContextMenuPrimitive.RadioItem>
|
|
256
|
-
)
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function ContextMenuLabel({
|
|
260
|
-
className,
|
|
261
|
-
inset,
|
|
262
|
-
...props
|
|
263
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
264
|
-
inset?: boolean
|
|
265
|
-
}) {
|
|
266
|
-
return (
|
|
267
|
-
<ContextMenuPrimitive.Label
|
|
268
|
-
data-slot="context-menu-label"
|
|
269
|
-
data-inset={inset}
|
|
270
|
-
className={cn(
|
|
271
|
-
"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
272
|
-
className
|
|
273
|
-
)}
|
|
274
|
-
{...props}
|
|
275
|
-
/>
|
|
276
|
-
)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function ContextMenuSeparator({
|
|
280
|
-
className,
|
|
281
|
-
...props
|
|
282
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
283
|
-
return (
|
|
284
|
-
<ContextMenuPrimitive.Separator
|
|
285
|
-
data-slot="context-menu-separator"
|
|
286
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
287
|
-
{...props}
|
|
288
|
-
/>
|
|
289
|
-
)
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
function ContextMenuShortcut({
|
|
293
|
-
className,
|
|
294
|
-
...props
|
|
295
|
-
}: React.ComponentProps<"span">) {
|
|
296
|
-
return (
|
|
297
|
-
<span
|
|
298
|
-
data-slot="context-menu-shortcut"
|
|
299
|
-
className={cn(
|
|
300
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
301
|
-
className
|
|
302
|
-
)}
|
|
303
|
-
{...props}
|
|
304
|
-
/>
|
|
305
|
-
)
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export {
|
|
309
|
-
ContextMenu,
|
|
310
|
-
ContextMenuTrigger,
|
|
311
|
-
ContextMenuContent,
|
|
312
|
-
ContextMenuItem,
|
|
313
|
-
ContextMenuCheckboxItem,
|
|
314
|
-
ContextMenuRadioItem,
|
|
315
|
-
ContextMenuLabel,
|
|
316
|
-
ContextMenuSeparator,
|
|
317
|
-
ContextMenuShortcut,
|
|
318
|
-
ContextMenuGroup,
|
|
319
|
-
ContextMenuPortal,
|
|
320
|
-
ContextMenuSub,
|
|
321
|
-
ContextMenuSubContent,
|
|
322
|
-
ContextMenuSubTrigger,
|
|
323
|
-
ContextMenuRadioGroup,
|
|
324
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { XIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Dialog({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
12
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function DialogTrigger({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
18
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function DialogPortal({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
24
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function DialogClose({
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
30
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function DialogOverlay({
|
|
34
|
-
className,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
37
|
-
return (
|
|
38
|
-
<DialogPrimitive.Overlay
|
|
39
|
-
data-slot="dialog-overlay"
|
|
40
|
-
className={cn(
|
|
41
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function DialogContent({
|
|
50
|
-
className,
|
|
51
|
-
children,
|
|
52
|
-
showCloseButton = true,
|
|
53
|
-
...props
|
|
54
|
-
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
55
|
-
showCloseButton?: boolean
|
|
56
|
-
}) {
|
|
57
|
-
return (
|
|
58
|
-
<DialogPortal data-slot="dialog-portal">
|
|
59
|
-
<DialogOverlay />
|
|
60
|
-
<DialogPrimitive.Content
|
|
61
|
-
data-slot="dialog-content"
|
|
62
|
-
className={cn(
|
|
63
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-sm:max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 max-w-lg",
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
{showCloseButton && (
|
|
70
|
-
<DialogPrimitive.Close
|
|
71
|
-
data-slot="dialog-close"
|
|
72
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity enabled:hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
73
|
-
>
|
|
74
|
-
<XIcon />
|
|
75
|
-
<span className="sr-only">Close</span>
|
|
76
|
-
</DialogPrimitive.Close>
|
|
77
|
-
)}
|
|
78
|
-
</DialogPrimitive.Content>
|
|
79
|
-
</DialogPortal>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
data-slot="dialog-header"
|
|
87
|
-
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
94
|
-
return (
|
|
95
|
-
<div
|
|
96
|
-
data-slot="dialog-footer"
|
|
97
|
-
className={cn(
|
|
98
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
99
|
-
className
|
|
100
|
-
)}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function DialogTitle({
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
110
|
-
return (
|
|
111
|
-
<DialogPrimitive.Title
|
|
112
|
-
data-slot="dialog-title"
|
|
113
|
-
className={cn("text-lg leading-none font-semibold", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function DialogDescription({
|
|
120
|
-
className,
|
|
121
|
-
...props
|
|
122
|
-
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
123
|
-
return (
|
|
124
|
-
<DialogPrimitive.Description
|
|
125
|
-
data-slot="dialog-description"
|
|
126
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export {
|
|
133
|
-
Dialog,
|
|
134
|
-
DialogClose,
|
|
135
|
-
DialogContent,
|
|
136
|
-
DialogDescription,
|
|
137
|
-
DialogFooter,
|
|
138
|
-
DialogHeader,
|
|
139
|
-
DialogOverlay,
|
|
140
|
-
DialogPortal,
|
|
141
|
-
DialogTitle,
|
|
142
|
-
DialogTrigger,
|
|
143
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Drawer as DrawerPrimitive } from "vaul"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Drawer({
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
11
|
-
return <DrawerPrimitive.Root data-slot="drawer" {...props} />
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function DrawerTrigger({
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
17
|
-
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function DrawerPortal({
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
23
|
-
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function DrawerClose({
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
29
|
-
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function DrawerOverlay({
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
|
36
|
-
return (
|
|
37
|
-
<DrawerPrimitive.Overlay
|
|
38
|
-
data-slot="drawer-overlay"
|
|
39
|
-
className={cn(
|
|
40
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function DrawerContent({
|
|
49
|
-
className,
|
|
50
|
-
children,
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
|
53
|
-
return (
|
|
54
|
-
<DrawerPortal data-slot="drawer-portal">
|
|
55
|
-
<DrawerOverlay />
|
|
56
|
-
<DrawerPrimitive.Content
|
|
57
|
-
data-slot="drawer-content"
|
|
58
|
-
className={cn(
|
|
59
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
60
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
61
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
62
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
63
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
<div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
69
|
-
{children}
|
|
70
|
-
</DrawerPrimitive.Content>
|
|
71
|
-
</DrawerPortal>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
76
|
-
return (
|
|
77
|
-
<div
|
|
78
|
-
data-slot="drawer-header"
|
|
79
|
-
className={cn(
|
|
80
|
-
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
81
|
-
className
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
89
|
-
return (
|
|
90
|
-
<div
|
|
91
|
-
data-slot="drawer-footer"
|
|
92
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function DrawerTitle({
|
|
99
|
-
className,
|
|
100
|
-
...props
|
|
101
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
102
|
-
return (
|
|
103
|
-
<DrawerPrimitive.Title
|
|
104
|
-
data-slot="drawer-title"
|
|
105
|
-
className={cn("text-foreground font-semibold", className)}
|
|
106
|
-
{...props}
|
|
107
|
-
/>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function DrawerDescription({
|
|
112
|
-
className,
|
|
113
|
-
...props
|
|
114
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
|
115
|
-
return (
|
|
116
|
-
<DrawerPrimitive.Description
|
|
117
|
-
data-slot="drawer-description"
|
|
118
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
119
|
-
{...props}
|
|
120
|
-
/>
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export {
|
|
125
|
-
Drawer,
|
|
126
|
-
DrawerPortal,
|
|
127
|
-
DrawerOverlay,
|
|
128
|
-
DrawerTrigger,
|
|
129
|
-
DrawerClose,
|
|
130
|
-
DrawerContent,
|
|
131
|
-
DrawerHeader,
|
|
132
|
-
DrawerFooter,
|
|
133
|
-
DrawerTitle,
|
|
134
|
-
DrawerDescription,
|
|
135
|
-
}
|