@lark-apaas/coding-templates 0.1.3 → 0.1.4
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 +17 -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 +17 -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,31 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Progress({
|
|
9
|
-
className,
|
|
10
|
-
value,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<ProgressPrimitive.Root
|
|
15
|
-
data-slot="progress"
|
|
16
|
-
className={cn(
|
|
17
|
-
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
<ProgressPrimitive.Indicator
|
|
23
|
-
data-slot="progress-indicator"
|
|
24
|
-
className="bg-primary h-full w-full flex-1 transition-all"
|
|
25
|
-
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
-
/>
|
|
27
|
-
</ProgressPrimitive.Root>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Progress }
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
5
|
-
import { CircleIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function RadioGroup({
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<RadioGroupPrimitive.Root
|
|
15
|
-
data-slot="radio-group"
|
|
16
|
-
className={cn("grid gap-3", className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function RadioGroupItem({
|
|
23
|
-
className,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
26
|
-
return (
|
|
27
|
-
<RadioGroupPrimitive.Item
|
|
28
|
-
data-slot="radio-group-item"
|
|
29
|
-
className={cn(
|
|
30
|
-
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
>
|
|
35
|
-
<RadioGroupPrimitive.Indicator
|
|
36
|
-
data-slot="radio-group-indicator"
|
|
37
|
-
className="relative flex items-center justify-center"
|
|
38
|
-
>
|
|
39
|
-
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
40
|
-
</RadioGroupPrimitive.Indicator>
|
|
41
|
-
</RadioGroupPrimitive.Item>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { RadioGroup, RadioGroupItem }
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { GripVerticalIcon } from "lucide-react"
|
|
5
|
-
import * as ResizablePrimitive from "react-resizable-panels"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function ResizablePanelGroup({
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
|
|
13
|
-
return (
|
|
14
|
-
<ResizablePrimitive.PanelGroup
|
|
15
|
-
data-slot="resizable-panel-group"
|
|
16
|
-
className={cn(
|
|
17
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function ResizablePanel({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
|
|
28
|
-
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function ResizableHandle({
|
|
32
|
-
withHandle,
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
36
|
-
withHandle?: boolean
|
|
37
|
-
}) {
|
|
38
|
-
return (
|
|
39
|
-
<ResizablePrimitive.PanelResizeHandle
|
|
40
|
-
data-slot="resizable-handle"
|
|
41
|
-
className={cn(
|
|
42
|
-
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
43
|
-
className
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
{withHandle && (
|
|
48
|
-
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
|
49
|
-
<GripVerticalIcon className="size-2.5" />
|
|
50
|
-
</div>
|
|
51
|
-
)}
|
|
52
|
-
</ResizablePrimitive.PanelResizeHandle>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
const EMPTY_SENTINEL = "__dont__use__this__empty__value__"
|
|
9
|
-
|
|
10
|
-
function Select({
|
|
11
|
-
value,
|
|
12
|
-
defaultValue,
|
|
13
|
-
onValueChange,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
16
|
-
const mappedValue = value === "" ? EMPTY_SENTINEL : value
|
|
17
|
-
const mappedDefaultValue = defaultValue === "" ? EMPTY_SENTINEL : defaultValue
|
|
18
|
-
const handleChange = (val: string) => {
|
|
19
|
-
onValueChange?.(val === EMPTY_SENTINEL ? "" : val)
|
|
20
|
-
}
|
|
21
|
-
return (
|
|
22
|
-
<SelectPrimitive.Root
|
|
23
|
-
data-slot="select"
|
|
24
|
-
value={mappedValue}
|
|
25
|
-
defaultValue={mappedDefaultValue}
|
|
26
|
-
onValueChange={handleChange}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function SelectGroup({
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
35
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function SelectValue({
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
41
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function SelectTrigger({
|
|
45
|
-
className,
|
|
46
|
-
size = "default",
|
|
47
|
-
children,
|
|
48
|
-
...props
|
|
49
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
50
|
-
size?: "sm" | "default"
|
|
51
|
-
}) {
|
|
52
|
-
return (
|
|
53
|
-
<SelectPrimitive.Trigger
|
|
54
|
-
data-slot="select-trigger"
|
|
55
|
-
data-size={size}
|
|
56
|
-
className={cn(
|
|
57
|
-
"border-input data-[placeholder]:text-muted-foreground data-[state=open]:border-ring [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] enabled:hover:border-ring disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:transition-transform [&_svg]:duration-200 data-[state=open]:[&_svg]:rotate-180",
|
|
58
|
-
className
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
{props.asChild ? (
|
|
63
|
-
children
|
|
64
|
-
) : (
|
|
65
|
-
<>
|
|
66
|
-
{children}
|
|
67
|
-
<SelectPrimitive.Icon asChild>
|
|
68
|
-
<ChevronDownIcon className="h-4 w-4 opacity-50" />
|
|
69
|
-
</SelectPrimitive.Icon>
|
|
70
|
-
</>
|
|
71
|
-
)}
|
|
72
|
-
</SelectPrimitive.Trigger>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function SelectContent({
|
|
77
|
-
className,
|
|
78
|
-
children,
|
|
79
|
-
position = "popper",
|
|
80
|
-
align = "center",
|
|
81
|
-
...props
|
|
82
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
83
|
-
return (
|
|
84
|
-
<SelectPrimitive.Portal>
|
|
85
|
-
<SelectPrimitive.Content
|
|
86
|
-
data-slot="select-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
89
|
-
position === "popper" &&
|
|
90
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
91
|
-
className
|
|
92
|
-
)}
|
|
93
|
-
position={position}
|
|
94
|
-
align={align}
|
|
95
|
-
{...props}
|
|
96
|
-
>
|
|
97
|
-
<SelectScrollUpButton />
|
|
98
|
-
<SelectPrimitive.Viewport
|
|
99
|
-
className={cn(
|
|
100
|
-
"p-1",
|
|
101
|
-
position === "popper" &&
|
|
102
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
103
|
-
)}
|
|
104
|
-
>
|
|
105
|
-
{children}
|
|
106
|
-
</SelectPrimitive.Viewport>
|
|
107
|
-
<SelectScrollDownButton />
|
|
108
|
-
</SelectPrimitive.Content>
|
|
109
|
-
</SelectPrimitive.Portal>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function SelectLabel({
|
|
114
|
-
className,
|
|
115
|
-
...props
|
|
116
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
117
|
-
return (
|
|
118
|
-
<SelectPrimitive.Label
|
|
119
|
-
data-slot="select-label"
|
|
120
|
-
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
121
|
-
{...props}
|
|
122
|
-
/>
|
|
123
|
-
)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
type SelectItemProps = Omit<
|
|
127
|
-
React.ComponentProps<typeof SelectPrimitive.Item>,
|
|
128
|
-
"value"
|
|
129
|
-
> & {
|
|
130
|
-
value: string
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function SelectItem({
|
|
134
|
-
className,
|
|
135
|
-
children,
|
|
136
|
-
disabled,
|
|
137
|
-
onClick,
|
|
138
|
-
onMouseDown,
|
|
139
|
-
onKeyDown,
|
|
140
|
-
onKeyUp,
|
|
141
|
-
onPointerDown,
|
|
142
|
-
value,
|
|
143
|
-
...props
|
|
144
|
-
}: SelectItemProps) {
|
|
145
|
-
return (
|
|
146
|
-
<SelectPrimitive.Item
|
|
147
|
-
data-slot="select-item"
|
|
148
|
-
className={cn(
|
|
149
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=checked]:text-primary data-[state=checked]:[&_svg:not([class*='text-'])]:text-primary relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
150
|
-
className
|
|
151
|
-
)}
|
|
152
|
-
value={value === "" ? EMPTY_SENTINEL : value}
|
|
153
|
-
disabled={disabled}
|
|
154
|
-
onClick={(event) => {
|
|
155
|
-
if (disabled) {
|
|
156
|
-
event.preventDefault()
|
|
157
|
-
return
|
|
158
|
-
}
|
|
159
|
-
onClick?.(event)
|
|
160
|
-
}}
|
|
161
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
162
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
163
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
164
|
-
onPointerDown={(event) => {
|
|
165
|
-
if (disabled) {
|
|
166
|
-
event.preventDefault()
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
onPointerDown?.(event)
|
|
170
|
-
}}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
174
|
-
<SelectPrimitive.ItemIndicator>
|
|
175
|
-
<CheckIcon className="size-4" />
|
|
176
|
-
</SelectPrimitive.ItemIndicator>
|
|
177
|
-
</span>
|
|
178
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
179
|
-
</SelectPrimitive.Item>
|
|
180
|
-
)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function SelectSeparator({
|
|
184
|
-
className,
|
|
185
|
-
...props
|
|
186
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
187
|
-
return (
|
|
188
|
-
<SelectPrimitive.Separator
|
|
189
|
-
data-slot="select-separator"
|
|
190
|
-
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
191
|
-
{...props}
|
|
192
|
-
/>
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function SelectScrollUpButton({
|
|
197
|
-
className,
|
|
198
|
-
...props
|
|
199
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
200
|
-
return (
|
|
201
|
-
<SelectPrimitive.ScrollUpButton
|
|
202
|
-
data-slot="select-scroll-up-button"
|
|
203
|
-
className={cn(
|
|
204
|
-
"flex cursor-default items-center justify-center py-1",
|
|
205
|
-
className
|
|
206
|
-
)}
|
|
207
|
-
{...props}
|
|
208
|
-
>
|
|
209
|
-
<ChevronUpIcon className="size-4" />
|
|
210
|
-
</SelectPrimitive.ScrollUpButton>
|
|
211
|
-
)
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function SelectScrollDownButton({
|
|
215
|
-
className,
|
|
216
|
-
...props
|
|
217
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
218
|
-
return (
|
|
219
|
-
<SelectPrimitive.ScrollDownButton
|
|
220
|
-
data-slot="select-scroll-down-button"
|
|
221
|
-
className={cn(
|
|
222
|
-
"flex cursor-default items-center justify-center py-1",
|
|
223
|
-
className
|
|
224
|
-
)}
|
|
225
|
-
{...props}
|
|
226
|
-
>
|
|
227
|
-
<ChevronDownIcon className="size-4" />
|
|
228
|
-
</SelectPrimitive.ScrollDownButton>
|
|
229
|
-
)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export {
|
|
233
|
-
Select,
|
|
234
|
-
SelectContent,
|
|
235
|
-
SelectGroup,
|
|
236
|
-
SelectItem,
|
|
237
|
-
SelectLabel,
|
|
238
|
-
SelectScrollDownButton,
|
|
239
|
-
SelectScrollUpButton,
|
|
240
|
-
SelectSeparator,
|
|
241
|
-
SelectTrigger,
|
|
242
|
-
SelectValue,
|
|
243
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = "horizontal",
|
|
11
|
-
decorative = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
-
return (
|
|
15
|
-
<SeparatorPrimitive.Root
|
|
16
|
-
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
|
-
orientation={orientation}
|
|
19
|
-
className={cn(
|
|
20
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Separator }
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { XIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SheetTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function SheetClose({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
22
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function SheetPortal({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
28
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function SheetOverlay({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
35
|
-
return (
|
|
36
|
-
<SheetPrimitive.Overlay
|
|
37
|
-
data-slot="sheet-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"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",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function SheetContent({
|
|
48
|
-
className,
|
|
49
|
-
children,
|
|
50
|
-
side = "right",
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
53
|
-
side?: "top" | "right" | "bottom" | "left"
|
|
54
|
-
}) {
|
|
55
|
-
return (
|
|
56
|
-
<SheetPortal>
|
|
57
|
-
<SheetOverlay />
|
|
58
|
-
<SheetPrimitive.Content
|
|
59
|
-
data-slot="sheet-content"
|
|
60
|
-
className={cn(
|
|
61
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 p-6",
|
|
62
|
-
side === "right" &&
|
|
63
|
-
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
64
|
-
side === "left" &&
|
|
65
|
-
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
66
|
-
side === "top" &&
|
|
67
|
-
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
68
|
-
side === "bottom" &&
|
|
69
|
-
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary 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">
|
|
76
|
-
<XIcon className="size-4" />
|
|
77
|
-
<span className="sr-only">Close</span>
|
|
78
|
-
</SheetPrimitive.Close>
|
|
79
|
-
</SheetPrimitive.Content>
|
|
80
|
-
</SheetPortal>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
data-slot="sheet-header"
|
|
88
|
-
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
95
|
-
return (
|
|
96
|
-
<div
|
|
97
|
-
data-slot="sheet-footer"
|
|
98
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function SheetTitle({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
108
|
-
return (
|
|
109
|
-
<SheetPrimitive.Title
|
|
110
|
-
data-slot="sheet-title"
|
|
111
|
-
className={cn("text-foreground font-semibold", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function SheetDescription({
|
|
118
|
-
className,
|
|
119
|
-
...props
|
|
120
|
-
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
121
|
-
return (
|
|
122
|
-
<SheetPrimitive.Description
|
|
123
|
-
data-slot="sheet-description"
|
|
124
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
Sheet,
|
|
132
|
-
SheetTrigger,
|
|
133
|
-
SheetClose,
|
|
134
|
-
SheetContent,
|
|
135
|
-
SheetHeader,
|
|
136
|
-
SheetFooter,
|
|
137
|
-
SheetTitle,
|
|
138
|
-
SheetDescription,
|
|
139
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils"
|
|
2
|
-
|
|
3
|
-
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
4
|
-
return (
|
|
5
|
-
<div
|
|
6
|
-
data-slot="skeleton"
|
|
7
|
-
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
8
|
-
{...props}
|
|
9
|
-
/>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Skeleton }
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SliderPrimitive from "@radix-ui/react-slider"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Slider({
|
|
9
|
-
className,
|
|
10
|
-
defaultValue,
|
|
11
|
-
value,
|
|
12
|
-
min = 0,
|
|
13
|
-
max = 100,
|
|
14
|
-
disabled,
|
|
15
|
-
onClick,
|
|
16
|
-
onMouseDown,
|
|
17
|
-
onKeyDown,
|
|
18
|
-
onKeyUp,
|
|
19
|
-
onPointerDown,
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
22
|
-
const _values = React.useMemo(
|
|
23
|
-
() =>
|
|
24
|
-
Array.isArray(value)
|
|
25
|
-
? value
|
|
26
|
-
: Array.isArray(defaultValue)
|
|
27
|
-
? defaultValue
|
|
28
|
-
: [min, max],
|
|
29
|
-
[value, defaultValue, min, max]
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<SliderPrimitive.Root
|
|
34
|
-
data-slot="slider"
|
|
35
|
-
defaultValue={defaultValue}
|
|
36
|
-
value={value}
|
|
37
|
-
min={min}
|
|
38
|
-
max={max}
|
|
39
|
-
className={cn(
|
|
40
|
-
"relative flex w-full touch-none items-center select-none cursor-pointer data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
disabled={disabled}
|
|
44
|
-
onClick={(event) => {
|
|
45
|
-
if (disabled) {
|
|
46
|
-
event.preventDefault()
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
onClick?.(event)
|
|
50
|
-
}}
|
|
51
|
-
onMouseDown={disabled ? undefined : onMouseDown}
|
|
52
|
-
onKeyDown={disabled ? undefined : onKeyDown}
|
|
53
|
-
onKeyUp={disabled ? undefined : onKeyUp}
|
|
54
|
-
onPointerDown={(event) => {
|
|
55
|
-
if (disabled) {
|
|
56
|
-
event.preventDefault()
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
onPointerDown?.(event)
|
|
60
|
-
}}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<SliderPrimitive.Track
|
|
64
|
-
data-slot="slider-track"
|
|
65
|
-
className={cn(
|
|
66
|
-
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
67
|
-
)}
|
|
68
|
-
>
|
|
69
|
-
<SliderPrimitive.Range
|
|
70
|
-
data-slot="slider-range"
|
|
71
|
-
className={cn(
|
|
72
|
-
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
73
|
-
)}
|
|
74
|
-
/>
|
|
75
|
-
</SliderPrimitive.Track>
|
|
76
|
-
{Array.from({ length: _values.length }, (_, index) => (
|
|
77
|
-
<SliderPrimitive.Thumb
|
|
78
|
-
data-slot="slider-thumb"
|
|
79
|
-
key={index}
|
|
80
|
-
className="border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] not-data-disabled:hover:ring-4 not-data-disabled:focus-visible:ring-4 not-data-disabled:focus-visible:outline-hidden disabled:cursor-not-allowed data-[disabled]:cursor-not-allowed disabled:opacity-50"
|
|
81
|
-
/>
|
|
82
|
-
))}
|
|
83
|
-
</SliderPrimitive.Root>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { Slider }
|