@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,329 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function DropdownMenu({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
12
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function DropdownMenuPortal({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
-
return (
|
|
19
|
-
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function DropdownMenuTrigger({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
26
|
-
return (
|
|
27
|
-
<DropdownMenuPrimitive.Trigger
|
|
28
|
-
data-slot="dropdown-menu-trigger"
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function DropdownMenuContent({
|
|
35
|
-
className,
|
|
36
|
-
sideOffset = 4,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
39
|
-
return (
|
|
40
|
-
<DropdownMenuPrimitive.Portal>
|
|
41
|
-
<DropdownMenuPrimitive.Content
|
|
42
|
-
data-slot="dropdown-menu-content"
|
|
43
|
-
sideOffset={sideOffset}
|
|
44
|
-
className={cn(
|
|
45
|
-
"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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
</DropdownMenuPrimitive.Portal>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function DropdownMenuGroup({
|
|
55
|
-
...props
|
|
56
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
57
|
-
return (
|
|
58
|
-
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function DropdownMenuItem({
|
|
63
|
-
className,
|
|
64
|
-
inset,
|
|
65
|
-
variant = "default",
|
|
66
|
-
disabled,
|
|
67
|
-
onClick,
|
|
68
|
-
onMouseDown,
|
|
69
|
-
onKeyDown,
|
|
70
|
-
onKeyUp,
|
|
71
|
-
onPointerDown,
|
|
72
|
-
...props
|
|
73
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
74
|
-
inset?: boolean
|
|
75
|
-
variant?: "default" | "destructive"
|
|
76
|
-
}) {
|
|
77
|
-
return (
|
|
78
|
-
<DropdownMenuPrimitive.Item
|
|
79
|
-
data-slot="dropdown-menu-item"
|
|
80
|
-
data-inset={inset}
|
|
81
|
-
data-variant={variant}
|
|
82
|
-
className={cn(
|
|
83
|
-
"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 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",
|
|
84
|
-
className
|
|
85
|
-
)}
|
|
86
|
-
disabled={disabled}
|
|
87
|
-
onClick={(event) => {
|
|
88
|
-
if (disabled) {
|
|
89
|
-
event.preventDefault()
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
onClick?.(event)
|
|
93
|
-
}}
|
|
94
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
95
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
96
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
97
|
-
onPointerDown={(event) => {
|
|
98
|
-
if (disabled) {
|
|
99
|
-
event.preventDefault()
|
|
100
|
-
return
|
|
101
|
-
}
|
|
102
|
-
onPointerDown?.(event)
|
|
103
|
-
}}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function DropdownMenuCheckboxItem({
|
|
110
|
-
className,
|
|
111
|
-
children,
|
|
112
|
-
checked,
|
|
113
|
-
disabled,
|
|
114
|
-
onClick,
|
|
115
|
-
onMouseDown,
|
|
116
|
-
onKeyDown,
|
|
117
|
-
onKeyUp,
|
|
118
|
-
onPointerDown,
|
|
119
|
-
...props
|
|
120
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
121
|
-
return (
|
|
122
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
123
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
124
|
-
className={cn(
|
|
125
|
-
"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",
|
|
126
|
-
className
|
|
127
|
-
)}
|
|
128
|
-
checked={checked}
|
|
129
|
-
disabled={disabled}
|
|
130
|
-
onClick={(event) => {
|
|
131
|
-
if (disabled) {
|
|
132
|
-
event.preventDefault()
|
|
133
|
-
return
|
|
134
|
-
}
|
|
135
|
-
onClick?.(event)
|
|
136
|
-
}}
|
|
137
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
138
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
139
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
140
|
-
onPointerDown={(event) => {
|
|
141
|
-
if (disabled) {
|
|
142
|
-
event.preventDefault()
|
|
143
|
-
return
|
|
144
|
-
}
|
|
145
|
-
onPointerDown?.(event)
|
|
146
|
-
}}
|
|
147
|
-
{...props}
|
|
148
|
-
>
|
|
149
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
150
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
151
|
-
<CheckIcon className="size-4" />
|
|
152
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
153
|
-
</span>
|
|
154
|
-
{children}
|
|
155
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function DropdownMenuRadioGroup({
|
|
160
|
-
...props
|
|
161
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
162
|
-
return (
|
|
163
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
164
|
-
data-slot="dropdown-menu-radio-group"
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function DropdownMenuRadioItem({
|
|
171
|
-
className,
|
|
172
|
-
children,
|
|
173
|
-
disabled,
|
|
174
|
-
onClick,
|
|
175
|
-
onMouseDown,
|
|
176
|
-
onKeyDown,
|
|
177
|
-
onKeyUp,
|
|
178
|
-
onPointerDown,
|
|
179
|
-
...props
|
|
180
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
181
|
-
return (
|
|
182
|
-
<DropdownMenuPrimitive.RadioItem
|
|
183
|
-
data-slot="dropdown-menu-radio-item"
|
|
184
|
-
className={cn(
|
|
185
|
-
"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",
|
|
186
|
-
className
|
|
187
|
-
)}
|
|
188
|
-
disabled={disabled}
|
|
189
|
-
onClick={(event) => {
|
|
190
|
-
if (disabled) {
|
|
191
|
-
event.preventDefault()
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
|
-
onClick?.(event)
|
|
195
|
-
}}
|
|
196
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
197
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
198
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
199
|
-
onPointerDown={(event) => {
|
|
200
|
-
if (disabled) {
|
|
201
|
-
event.preventDefault()
|
|
202
|
-
return
|
|
203
|
-
}
|
|
204
|
-
onPointerDown?.(event)
|
|
205
|
-
}}
|
|
206
|
-
{...props}
|
|
207
|
-
>
|
|
208
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
209
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
210
|
-
<CircleIcon className="size-2 fill-current" />
|
|
211
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
212
|
-
</span>
|
|
213
|
-
{children}
|
|
214
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
215
|
-
)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function DropdownMenuLabel({
|
|
219
|
-
className,
|
|
220
|
-
inset,
|
|
221
|
-
...props
|
|
222
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
223
|
-
inset?: boolean
|
|
224
|
-
}) {
|
|
225
|
-
return (
|
|
226
|
-
<DropdownMenuPrimitive.Label
|
|
227
|
-
data-slot="dropdown-menu-label"
|
|
228
|
-
data-inset={inset}
|
|
229
|
-
className={cn(
|
|
230
|
-
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
231
|
-
className
|
|
232
|
-
)}
|
|
233
|
-
{...props}
|
|
234
|
-
/>
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function DropdownMenuSeparator({
|
|
239
|
-
className,
|
|
240
|
-
...props
|
|
241
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
242
|
-
return (
|
|
243
|
-
<DropdownMenuPrimitive.Separator
|
|
244
|
-
data-slot="dropdown-menu-separator"
|
|
245
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
246
|
-
{...props}
|
|
247
|
-
/>
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function DropdownMenuShortcut({
|
|
252
|
-
className,
|
|
253
|
-
...props
|
|
254
|
-
}: React.ComponentProps<"span">) {
|
|
255
|
-
return (
|
|
256
|
-
<span
|
|
257
|
-
data-slot="dropdown-menu-shortcut"
|
|
258
|
-
className={cn(
|
|
259
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
260
|
-
className
|
|
261
|
-
)}
|
|
262
|
-
{...props}
|
|
263
|
-
/>
|
|
264
|
-
)
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function DropdownMenuSub({
|
|
268
|
-
...props
|
|
269
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
270
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
function DropdownMenuSubTrigger({
|
|
274
|
-
className,
|
|
275
|
-
inset,
|
|
276
|
-
children,
|
|
277
|
-
...props
|
|
278
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
279
|
-
inset?: boolean
|
|
280
|
-
}) {
|
|
281
|
-
return (
|
|
282
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
283
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
284
|
-
data-inset={inset}
|
|
285
|
-
className={cn(
|
|
286
|
-
"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 gap-2 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",
|
|
287
|
-
className
|
|
288
|
-
)}
|
|
289
|
-
{...props}
|
|
290
|
-
>
|
|
291
|
-
{children}
|
|
292
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
293
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
294
|
-
)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function DropdownMenuSubContent({
|
|
298
|
-
className,
|
|
299
|
-
...props
|
|
300
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
301
|
-
return (
|
|
302
|
-
<DropdownMenuPrimitive.SubContent
|
|
303
|
-
data-slot="dropdown-menu-sub-content"
|
|
304
|
-
className={cn(
|
|
305
|
-
"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-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
306
|
-
className
|
|
307
|
-
)}
|
|
308
|
-
{...props}
|
|
309
|
-
/>
|
|
310
|
-
)
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export {
|
|
314
|
-
DropdownMenu,
|
|
315
|
-
DropdownMenuPortal,
|
|
316
|
-
DropdownMenuTrigger,
|
|
317
|
-
DropdownMenuContent,
|
|
318
|
-
DropdownMenuGroup,
|
|
319
|
-
DropdownMenuLabel,
|
|
320
|
-
DropdownMenuItem,
|
|
321
|
-
DropdownMenuCheckboxItem,
|
|
322
|
-
DropdownMenuRadioGroup,
|
|
323
|
-
DropdownMenuRadioItem,
|
|
324
|
-
DropdownMenuSeparator,
|
|
325
|
-
DropdownMenuShortcut,
|
|
326
|
-
DropdownMenuSub,
|
|
327
|
-
DropdownMenuSubTrigger,
|
|
328
|
-
DropdownMenuSubContent,
|
|
329
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function HoverCard({
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
|
11
|
-
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function HoverCardTrigger({
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
|
17
|
-
return (
|
|
18
|
-
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function HoverCardContent({
|
|
23
|
-
className,
|
|
24
|
-
align = "center",
|
|
25
|
-
sideOffset = 4,
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
|
|
28
|
-
return (
|
|
29
|
-
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
|
30
|
-
<HoverCardPrimitive.Content
|
|
31
|
-
data-slot="hover-card-content"
|
|
32
|
-
align={align}
|
|
33
|
-
sideOffset={sideOffset}
|
|
34
|
-
className={cn(
|
|
35
|
-
"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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
36
|
-
className
|
|
37
|
-
)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
</HoverCardPrimitive.Portal>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { HoverCard, HoverCardTrigger, HoverCardContent }
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
import { Button } from "@/components/ui/button"
|
|
8
|
-
import { Input } from "@/components/ui/input"
|
|
9
|
-
import { Textarea } from "@/components/ui/textarea"
|
|
10
|
-
|
|
11
|
-
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
12
|
-
return (
|
|
13
|
-
<div
|
|
14
|
-
data-slot="input-group"
|
|
15
|
-
role="group"
|
|
16
|
-
className={cn(
|
|
17
|
-
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border transition-[color,box-shadow] outline-none",
|
|
18
|
-
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
19
|
-
|
|
20
|
-
// Variants based on alignment.
|
|
21
|
-
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
22
|
-
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
23
|
-
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
24
|
-
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
25
|
-
|
|
26
|
-
// Focus state.
|
|
27
|
-
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/20 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
28
|
-
|
|
29
|
-
// Error state.
|
|
30
|
-
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
31
|
-
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const inputGroupAddonVariants = cva(
|
|
40
|
-
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
41
|
-
{
|
|
42
|
-
variants: {
|
|
43
|
-
align: {
|
|
44
|
-
"inline-start":
|
|
45
|
-
"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
46
|
-
"inline-end":
|
|
47
|
-
"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
48
|
-
"block-start":
|
|
49
|
-
"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
50
|
-
"block-end":
|
|
51
|
-
"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
defaultVariants: {
|
|
55
|
-
align: "inline-start",
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
function InputGroupAddon({
|
|
61
|
-
className,
|
|
62
|
-
align = "inline-start",
|
|
63
|
-
...props
|
|
64
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
65
|
-
return (
|
|
66
|
-
<div
|
|
67
|
-
role="group"
|
|
68
|
-
data-slot="input-group-addon"
|
|
69
|
-
data-align={align}
|
|
70
|
-
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
71
|
-
onClick={(e) => {
|
|
72
|
-
if ((e.target as HTMLElement).closest("button")) {
|
|
73
|
-
return
|
|
74
|
-
}
|
|
75
|
-
e.currentTarget.parentElement?.querySelector("input")?.focus()
|
|
76
|
-
}}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const inputGroupButtonVariants = cva("text-sm flex gap-2 items-center", {
|
|
83
|
-
variants: {
|
|
84
|
-
size: {
|
|
85
|
-
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
86
|
-
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
87
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
88
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
defaultVariants: {
|
|
92
|
-
size: "xs",
|
|
93
|
-
},
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
function InputGroupButton({
|
|
97
|
-
className,
|
|
98
|
-
type = "button",
|
|
99
|
-
variant = "ghost",
|
|
100
|
-
size = "xs",
|
|
101
|
-
...props
|
|
102
|
-
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
|
103
|
-
VariantProps<typeof inputGroupButtonVariants>) {
|
|
104
|
-
return (
|
|
105
|
-
<Button
|
|
106
|
-
type={type}
|
|
107
|
-
data-size={size}
|
|
108
|
-
variant={variant}
|
|
109
|
-
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
116
|
-
return (
|
|
117
|
-
<span
|
|
118
|
-
className={cn(
|
|
119
|
-
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
120
|
-
className
|
|
121
|
-
)}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function InputGroupInput({
|
|
128
|
-
className,
|
|
129
|
-
...props
|
|
130
|
-
}: React.ComponentProps<"input">) {
|
|
131
|
-
return (
|
|
132
|
-
<Input
|
|
133
|
-
data-slot="input-group-control"
|
|
134
|
-
className={cn(
|
|
135
|
-
"flex-1 rounded-none border-0 bg-transparent focus-visible:ring-0 dark:bg-transparent",
|
|
136
|
-
className
|
|
137
|
-
)}
|
|
138
|
-
{...props}
|
|
139
|
-
/>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function InputGroupTextarea({
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}: React.ComponentProps<"textarea">) {
|
|
147
|
-
return (
|
|
148
|
-
<Textarea
|
|
149
|
-
data-slot="input-group-control"
|
|
150
|
-
className={cn(
|
|
151
|
-
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 focus-visible:ring-0 dark:bg-transparent",
|
|
152
|
-
className
|
|
153
|
-
)}
|
|
154
|
-
{...props}
|
|
155
|
-
/>
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export {
|
|
160
|
-
InputGroup,
|
|
161
|
-
InputGroupAddon,
|
|
162
|
-
InputGroupButton,
|
|
163
|
-
InputGroupText,
|
|
164
|
-
InputGroupInput,
|
|
165
|
-
InputGroupTextarea,
|
|
166
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { OTPInput, OTPInputContext } from "input-otp"
|
|
5
|
-
import { MinusIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function InputOTP({
|
|
10
|
-
className,
|
|
11
|
-
containerClassName,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof OTPInput> & {
|
|
14
|
-
containerClassName?: string
|
|
15
|
-
}) {
|
|
16
|
-
return (
|
|
17
|
-
<OTPInput
|
|
18
|
-
data-slot="input-otp"
|
|
19
|
-
containerClassName={cn(
|
|
20
|
-
"flex items-center gap-2 has-disabled:opacity-50",
|
|
21
|
-
containerClassName
|
|
22
|
-
)}
|
|
23
|
-
className={cn("disabled:cursor-not-allowed", className)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
data-slot="input-otp-group"
|
|
33
|
-
className={cn("flex items-center", className)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function InputOTPSlot({
|
|
40
|
-
index,
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentProps<"div"> & {
|
|
44
|
-
index: number
|
|
45
|
-
}) {
|
|
46
|
-
const inputOTPContext = React.useContext(OTPInputContext)
|
|
47
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div
|
|
51
|
-
data-slot="input-otp-slot"
|
|
52
|
-
data-active={isActive}
|
|
53
|
-
className={cn(
|
|
54
|
-
"data-[active=true]:border-ring data-[active=true]:ring-ring/20 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
55
|
-
className
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
{char}
|
|
60
|
-
{hasFakeCaret && (
|
|
61
|
-
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
62
|
-
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
</div>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
70
|
-
return (
|
|
71
|
-
<div data-slot="input-otp-separator" role="separator" {...props}>
|
|
72
|
-
<MinusIcon />
|
|
73
|
-
</div>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
-
return (
|
|
7
|
-
<input
|
|
8
|
-
type={type}
|
|
9
|
-
data-slot="input"
|
|
10
|
-
className={cn(
|
|
11
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
"enabled:hover:border-ring focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[3px]",
|
|
13
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
|
-
className
|
|
15
|
-
)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { Input }
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Label({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<LabelPrimitive.Root
|
|
14
|
-
data-slot="label"
|
|
15
|
-
className={cn(
|
|
16
|
-
"flex items-center gap-2 text-sm leading-none font-normal select-none group-data-[disabled=true]:cursor-not-allowed group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { Label }
|