@lark-apaas/coding-templates 0.1.2 → 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-html/README.md +1 -1
- 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,213 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import {
|
|
5
|
-
ChevronDownIcon,
|
|
6
|
-
ChevronLeftIcon,
|
|
7
|
-
ChevronRightIcon,
|
|
8
|
-
} from "lucide-react"
|
|
9
|
-
import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker"
|
|
10
|
-
|
|
11
|
-
import { cn } from "@/lib/utils"
|
|
12
|
-
import { Button, buttonVariants } from "@/components/ui/button"
|
|
13
|
-
|
|
14
|
-
function Calendar({
|
|
15
|
-
className,
|
|
16
|
-
classNames,
|
|
17
|
-
showOutsideDays = true,
|
|
18
|
-
captionLayout = "label",
|
|
19
|
-
buttonVariant = "ghost",
|
|
20
|
-
formatters,
|
|
21
|
-
components,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
24
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
25
|
-
}) {
|
|
26
|
-
const defaultClassNames = getDefaultClassNames()
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<DayPicker
|
|
30
|
-
showOutsideDays={showOutsideDays}
|
|
31
|
-
className={cn(
|
|
32
|
-
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
33
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
34
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
35
|
-
className
|
|
36
|
-
)}
|
|
37
|
-
captionLayout={captionLayout}
|
|
38
|
-
formatters={{
|
|
39
|
-
formatMonthDropdown: (date) =>
|
|
40
|
-
date.toLocaleString("default", { month: "short" }),
|
|
41
|
-
...formatters,
|
|
42
|
-
}}
|
|
43
|
-
classNames={{
|
|
44
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
45
|
-
months: cn(
|
|
46
|
-
"flex gap-4 flex-col md:flex-row relative",
|
|
47
|
-
defaultClassNames.months
|
|
48
|
-
),
|
|
49
|
-
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
50
|
-
nav: cn(
|
|
51
|
-
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
52
|
-
defaultClassNames.nav
|
|
53
|
-
),
|
|
54
|
-
button_previous: cn(
|
|
55
|
-
buttonVariants({ variant: buttonVariant }),
|
|
56
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
57
|
-
defaultClassNames.button_previous
|
|
58
|
-
),
|
|
59
|
-
button_next: cn(
|
|
60
|
-
buttonVariants({ variant: buttonVariant }),
|
|
61
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
62
|
-
defaultClassNames.button_next
|
|
63
|
-
),
|
|
64
|
-
month_caption: cn(
|
|
65
|
-
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
66
|
-
defaultClassNames.month_caption
|
|
67
|
-
),
|
|
68
|
-
dropdowns: cn(
|
|
69
|
-
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
70
|
-
defaultClassNames.dropdowns
|
|
71
|
-
),
|
|
72
|
-
dropdown_root: cn(
|
|
73
|
-
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
74
|
-
defaultClassNames.dropdown_root
|
|
75
|
-
),
|
|
76
|
-
dropdown: cn(
|
|
77
|
-
"absolute bg-popover inset-0 opacity-0",
|
|
78
|
-
defaultClassNames.dropdown
|
|
79
|
-
),
|
|
80
|
-
caption_label: cn(
|
|
81
|
-
"select-none font-medium",
|
|
82
|
-
captionLayout === "label"
|
|
83
|
-
? "text-sm"
|
|
84
|
-
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
85
|
-
defaultClassNames.caption_label
|
|
86
|
-
),
|
|
87
|
-
table: "w-full border-collapse",
|
|
88
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
89
|
-
weekday: cn(
|
|
90
|
-
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
91
|
-
defaultClassNames.weekday
|
|
92
|
-
),
|
|
93
|
-
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
94
|
-
week_number_header: cn(
|
|
95
|
-
"select-none w-(--cell-size)",
|
|
96
|
-
defaultClassNames.week_number_header
|
|
97
|
-
),
|
|
98
|
-
week_number: cn(
|
|
99
|
-
"text-[0.8rem] select-none text-muted-foreground",
|
|
100
|
-
defaultClassNames.week_number
|
|
101
|
-
),
|
|
102
|
-
day: cn(
|
|
103
|
-
"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
104
|
-
defaultClassNames.day
|
|
105
|
-
),
|
|
106
|
-
range_start: cn(
|
|
107
|
-
"rounded-l-md bg-accent",
|
|
108
|
-
defaultClassNames.range_start
|
|
109
|
-
),
|
|
110
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
111
|
-
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
112
|
-
today: cn(
|
|
113
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
114
|
-
defaultClassNames.today
|
|
115
|
-
),
|
|
116
|
-
outside: cn(
|
|
117
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
118
|
-
defaultClassNames.outside
|
|
119
|
-
),
|
|
120
|
-
disabled: cn(
|
|
121
|
-
"text-muted-foreground opacity-50",
|
|
122
|
-
defaultClassNames.disabled
|
|
123
|
-
),
|
|
124
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
125
|
-
...classNames,
|
|
126
|
-
}}
|
|
127
|
-
components={{
|
|
128
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
129
|
-
return (
|
|
130
|
-
<div
|
|
131
|
-
data-slot="calendar"
|
|
132
|
-
ref={rootRef}
|
|
133
|
-
className={cn(className)}
|
|
134
|
-
{...props}
|
|
135
|
-
/>
|
|
136
|
-
)
|
|
137
|
-
},
|
|
138
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
139
|
-
if (orientation === "left") {
|
|
140
|
-
return (
|
|
141
|
-
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (orientation === "right") {
|
|
146
|
-
return (
|
|
147
|
-
<ChevronRightIcon
|
|
148
|
-
className={cn("size-4", className)}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
156
|
-
)
|
|
157
|
-
},
|
|
158
|
-
DayButton: CalendarDayButton,
|
|
159
|
-
WeekNumber: ({ children, ...props }) => {
|
|
160
|
-
return (
|
|
161
|
-
<td {...props}>
|
|
162
|
-
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
163
|
-
{children}
|
|
164
|
-
</div>
|
|
165
|
-
</td>
|
|
166
|
-
)
|
|
167
|
-
},
|
|
168
|
-
...components,
|
|
169
|
-
}}
|
|
170
|
-
{...props}
|
|
171
|
-
/>
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function CalendarDayButton({
|
|
176
|
-
className,
|
|
177
|
-
day,
|
|
178
|
-
modifiers,
|
|
179
|
-
...props
|
|
180
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
181
|
-
const defaultClassNames = getDefaultClassNames()
|
|
182
|
-
|
|
183
|
-
const ref = React.useRef<HTMLButtonElement>(null)
|
|
184
|
-
React.useEffect(() => {
|
|
185
|
-
if (modifiers.focused) ref.current?.focus()
|
|
186
|
-
}, [modifiers.focused])
|
|
187
|
-
|
|
188
|
-
return (
|
|
189
|
-
<Button
|
|
190
|
-
ref={ref}
|
|
191
|
-
variant="ghost"
|
|
192
|
-
size="icon"
|
|
193
|
-
data-day={day.date.toLocaleDateString()}
|
|
194
|
-
data-selected-single={
|
|
195
|
-
modifiers.selected &&
|
|
196
|
-
!modifiers.range_start &&
|
|
197
|
-
!modifiers.range_end &&
|
|
198
|
-
!modifiers.range_middle
|
|
199
|
-
}
|
|
200
|
-
data-range-start={modifiers.range_start}
|
|
201
|
-
data-range-end={modifiers.range_end}
|
|
202
|
-
data-range-middle={modifiers.range_middle}
|
|
203
|
-
className={cn(
|
|
204
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
205
|
-
defaultClassNames.day,
|
|
206
|
-
className
|
|
207
|
-
)}
|
|
208
|
-
{...props}
|
|
209
|
-
/>
|
|
210
|
-
)
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export { Calendar, CalendarDayButton }
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
const Card = React.forwardRef<
|
|
6
|
-
HTMLDivElement,
|
|
7
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<div
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn(
|
|
12
|
-
"rounded-xl border bg-card border-card-border text-card-foreground shadow-sm",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
));
|
|
18
|
-
Card.displayName = "Card"
|
|
19
|
-
|
|
20
|
-
const CardHeader = React.forwardRef<
|
|
21
|
-
HTMLDivElement,
|
|
22
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
-
>(({ className, ...props }, ref) => (
|
|
24
|
-
<div
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
));
|
|
30
|
-
CardHeader.displayName = "CardHeader"
|
|
31
|
-
|
|
32
|
-
const CardTitle = React.forwardRef<
|
|
33
|
-
HTMLDivElement,
|
|
34
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
-
>(({ className, ...props }, ref) => (
|
|
36
|
-
<div
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
))
|
|
45
|
-
CardTitle.displayName = "CardTitle"
|
|
46
|
-
|
|
47
|
-
const CardDescription = React.forwardRef<
|
|
48
|
-
HTMLDivElement,
|
|
49
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<div
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
));
|
|
57
|
-
CardDescription.displayName = "CardDescription"
|
|
58
|
-
|
|
59
|
-
const CardContent = React.forwardRef<
|
|
60
|
-
HTMLDivElement,
|
|
61
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
62
|
-
>(({ className, ...props }, ref) => (
|
|
63
|
-
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
64
|
-
))
|
|
65
|
-
CardContent.displayName = "CardContent"
|
|
66
|
-
|
|
67
|
-
const CardFooter = React.forwardRef<
|
|
68
|
-
HTMLDivElement,
|
|
69
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
70
|
-
>(({ className, ...props }, ref) => (
|
|
71
|
-
<div
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={cn("flex items-center p-6 pt-0", className)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
))
|
|
77
|
-
CardFooter.displayName = "CardFooter"
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle
|
|
81
|
-
};
|
|
82
|
-
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as RechartsPrimitive from "recharts"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
9
|
-
const THEMES = { light: "", dark: ".dark" } as const
|
|
10
|
-
|
|
11
|
-
export type ChartConfig = {
|
|
12
|
-
[k in string]: {
|
|
13
|
-
label?: React.ReactNode
|
|
14
|
-
icon?: React.ComponentType
|
|
15
|
-
} & (
|
|
16
|
-
| { color?: string; theme?: never }
|
|
17
|
-
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type ChartContextProps = {
|
|
22
|
-
config: ChartConfig
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const ChartContext = React.createContext<ChartContextProps | null>(null)
|
|
26
|
-
|
|
27
|
-
function useChart() {
|
|
28
|
-
const context = React.useContext(ChartContext)
|
|
29
|
-
|
|
30
|
-
if (!context) {
|
|
31
|
-
throw new Error("useChart must be used within a <ChartContainer />")
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return context
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function ChartContainer({
|
|
38
|
-
id,
|
|
39
|
-
className,
|
|
40
|
-
children,
|
|
41
|
-
config,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentProps<"div"> & {
|
|
44
|
-
config: ChartConfig
|
|
45
|
-
children: React.ComponentProps<
|
|
46
|
-
typeof RechartsPrimitive.ResponsiveContainer
|
|
47
|
-
>["children"]
|
|
48
|
-
}) {
|
|
49
|
-
const uniqueId = React.useId()
|
|
50
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<ChartContext.Provider value={{ config }}>
|
|
54
|
-
<div
|
|
55
|
-
data-slot="chart"
|
|
56
|
-
data-chart={chartId}
|
|
57
|
-
className={cn(
|
|
58
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<ChartStyle id={chartId} config={config} />
|
|
64
|
-
<RechartsPrimitive.ResponsiveContainer>
|
|
65
|
-
{children}
|
|
66
|
-
</RechartsPrimitive.ResponsiveContainer>
|
|
67
|
-
</div>
|
|
68
|
-
</ChartContext.Provider>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
73
|
-
const colorConfig = Object.entries(config).filter(
|
|
74
|
-
([, config]) => config.theme || config.color
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
if (!colorConfig.length) {
|
|
78
|
-
return null
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<style
|
|
83
|
-
dangerouslySetInnerHTML={{
|
|
84
|
-
__html: Object.entries(THEMES)
|
|
85
|
-
.map(
|
|
86
|
-
([theme, prefix]) => `
|
|
87
|
-
${prefix} [data-chart=${id}] {
|
|
88
|
-
${colorConfig
|
|
89
|
-
.map(([key, itemConfig]) => {
|
|
90
|
-
const color =
|
|
91
|
-
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
92
|
-
itemConfig.color
|
|
93
|
-
return color ? ` --color-${key}: ${color};` : null
|
|
94
|
-
})
|
|
95
|
-
.join("\n")}
|
|
96
|
-
}
|
|
97
|
-
`
|
|
98
|
-
)
|
|
99
|
-
.join("\n"),
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
106
|
-
|
|
107
|
-
function ChartTooltipContent({
|
|
108
|
-
active,
|
|
109
|
-
payload,
|
|
110
|
-
className,
|
|
111
|
-
indicator = "dot",
|
|
112
|
-
hideLabel = false,
|
|
113
|
-
hideIndicator = false,
|
|
114
|
-
label,
|
|
115
|
-
labelFormatter,
|
|
116
|
-
labelClassName,
|
|
117
|
-
formatter,
|
|
118
|
-
color,
|
|
119
|
-
nameKey,
|
|
120
|
-
labelKey,
|
|
121
|
-
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
|
122
|
-
React.ComponentProps<"div"> & {
|
|
123
|
-
hideLabel?: boolean
|
|
124
|
-
hideIndicator?: boolean
|
|
125
|
-
indicator?: "line" | "dot" | "dashed"
|
|
126
|
-
nameKey?: string
|
|
127
|
-
labelKey?: string
|
|
128
|
-
}) {
|
|
129
|
-
const { config } = useChart()
|
|
130
|
-
|
|
131
|
-
const tooltipLabel = React.useMemo(() => {
|
|
132
|
-
if (hideLabel || !payload?.length) {
|
|
133
|
-
return null
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const [item] = payload
|
|
137
|
-
const key = `${labelKey || item?.dataKey || item?.name || "value"}`
|
|
138
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
139
|
-
const value =
|
|
140
|
-
!labelKey && typeof label === "string"
|
|
141
|
-
? config[label as keyof typeof config]?.label || label
|
|
142
|
-
: itemConfig?.label
|
|
143
|
-
|
|
144
|
-
if (labelFormatter) {
|
|
145
|
-
return (
|
|
146
|
-
<div className={cn("font-medium", labelClassName)}>
|
|
147
|
-
{labelFormatter(value, payload)}
|
|
148
|
-
</div>
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (!value) {
|
|
153
|
-
return null
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return <div className={cn("font-medium", labelClassName)}>{value}</div>
|
|
157
|
-
}, [
|
|
158
|
-
label,
|
|
159
|
-
labelFormatter,
|
|
160
|
-
payload,
|
|
161
|
-
hideLabel,
|
|
162
|
-
labelClassName,
|
|
163
|
-
config,
|
|
164
|
-
labelKey,
|
|
165
|
-
])
|
|
166
|
-
|
|
167
|
-
if (!active || !payload?.length) {
|
|
168
|
-
return null
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const nestLabel = payload.length === 1 && indicator !== "dot"
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<div
|
|
175
|
-
className={cn(
|
|
176
|
-
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
177
|
-
className
|
|
178
|
-
)}
|
|
179
|
-
>
|
|
180
|
-
{!nestLabel ? tooltipLabel : null}
|
|
181
|
-
<div className="grid gap-1.5">
|
|
182
|
-
{payload
|
|
183
|
-
.filter((item) => item.type !== "none")
|
|
184
|
-
.map((item, index) => {
|
|
185
|
-
const key = `${nameKey || item.name || item.dataKey || "value"}`
|
|
186
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
187
|
-
const indicatorColor = color || item.payload.fill || item.color
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<div
|
|
191
|
-
key={item.dataKey}
|
|
192
|
-
className={cn(
|
|
193
|
-
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
194
|
-
indicator === "dot" && "items-center"
|
|
195
|
-
)}
|
|
196
|
-
>
|
|
197
|
-
{formatter && item?.value !== undefined && item.name ? (
|
|
198
|
-
formatter(item.value, item.name, item, index, item.payload)
|
|
199
|
-
) : (
|
|
200
|
-
<>
|
|
201
|
-
{itemConfig?.icon ? (
|
|
202
|
-
<itemConfig.icon />
|
|
203
|
-
) : (
|
|
204
|
-
!hideIndicator && (
|
|
205
|
-
<div
|
|
206
|
-
className={cn(
|
|
207
|
-
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
208
|
-
{
|
|
209
|
-
"h-2.5 w-2.5": indicator === "dot",
|
|
210
|
-
"w-1": indicator === "line",
|
|
211
|
-
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
212
|
-
indicator === "dashed",
|
|
213
|
-
"my-0.5": nestLabel && indicator === "dashed",
|
|
214
|
-
}
|
|
215
|
-
)}
|
|
216
|
-
style={
|
|
217
|
-
{
|
|
218
|
-
"--color-bg": indicatorColor,
|
|
219
|
-
"--color-border": indicatorColor,
|
|
220
|
-
} as React.CSSProperties
|
|
221
|
-
}
|
|
222
|
-
/>
|
|
223
|
-
)
|
|
224
|
-
)}
|
|
225
|
-
<div
|
|
226
|
-
className={cn(
|
|
227
|
-
"flex flex-1 justify-between leading-none",
|
|
228
|
-
nestLabel ? "items-end" : "items-center"
|
|
229
|
-
)}
|
|
230
|
-
>
|
|
231
|
-
<div className="grid gap-1.5">
|
|
232
|
-
{nestLabel ? tooltipLabel : null}
|
|
233
|
-
<span className="text-muted-foreground">
|
|
234
|
-
{itemConfig?.label || item.name}
|
|
235
|
-
</span>
|
|
236
|
-
</div>
|
|
237
|
-
{item.value && (
|
|
238
|
-
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
239
|
-
{item.value.toLocaleString()}
|
|
240
|
-
</span>
|
|
241
|
-
)}
|
|
242
|
-
</div>
|
|
243
|
-
</>
|
|
244
|
-
)}
|
|
245
|
-
</div>
|
|
246
|
-
)
|
|
247
|
-
})}
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const ChartLegend = RechartsPrimitive.Legend
|
|
254
|
-
|
|
255
|
-
function ChartLegendContent({
|
|
256
|
-
className,
|
|
257
|
-
hideIcon = false,
|
|
258
|
-
payload,
|
|
259
|
-
verticalAlign = "bottom",
|
|
260
|
-
nameKey,
|
|
261
|
-
}: React.ComponentProps<"div"> &
|
|
262
|
-
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
263
|
-
hideIcon?: boolean
|
|
264
|
-
nameKey?: string
|
|
265
|
-
}) {
|
|
266
|
-
const { config } = useChart()
|
|
267
|
-
|
|
268
|
-
if (!payload?.length) {
|
|
269
|
-
return null
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
return (
|
|
273
|
-
<div
|
|
274
|
-
className={cn(
|
|
275
|
-
"flex items-center justify-center gap-4",
|
|
276
|
-
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
277
|
-
className
|
|
278
|
-
)}
|
|
279
|
-
>
|
|
280
|
-
{payload
|
|
281
|
-
.filter((item) => item.type !== "none")
|
|
282
|
-
.map((item) => {
|
|
283
|
-
const key = `${nameKey || item.dataKey || "value"}`
|
|
284
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key)
|
|
285
|
-
|
|
286
|
-
return (
|
|
287
|
-
<div
|
|
288
|
-
key={item.value}
|
|
289
|
-
className={cn(
|
|
290
|
-
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
291
|
-
)}
|
|
292
|
-
>
|
|
293
|
-
{itemConfig?.icon && !hideIcon ? (
|
|
294
|
-
<itemConfig.icon />
|
|
295
|
-
) : (
|
|
296
|
-
<div
|
|
297
|
-
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
298
|
-
style={{
|
|
299
|
-
backgroundColor: item.color,
|
|
300
|
-
}}
|
|
301
|
-
/>
|
|
302
|
-
)}
|
|
303
|
-
{itemConfig?.label}
|
|
304
|
-
</div>
|
|
305
|
-
)
|
|
306
|
-
})}
|
|
307
|
-
</div>
|
|
308
|
-
)
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// Helper to extract item config from a payload.
|
|
312
|
-
function getPayloadConfigFromPayload(
|
|
313
|
-
config: ChartConfig,
|
|
314
|
-
payload: unknown,
|
|
315
|
-
key: string
|
|
316
|
-
) {
|
|
317
|
-
if (typeof payload !== "object" || payload === null) {
|
|
318
|
-
return undefined
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const payloadPayload =
|
|
322
|
-
"payload" in payload &&
|
|
323
|
-
typeof payload.payload === "object" &&
|
|
324
|
-
payload.payload !== null
|
|
325
|
-
? payload.payload
|
|
326
|
-
: undefined
|
|
327
|
-
|
|
328
|
-
let configLabelKey: string = key
|
|
329
|
-
|
|
330
|
-
if (
|
|
331
|
-
key in payload &&
|
|
332
|
-
typeof payload[key as keyof typeof payload] === "string"
|
|
333
|
-
) {
|
|
334
|
-
configLabelKey = payload[key as keyof typeof payload] as string
|
|
335
|
-
} else if (
|
|
336
|
-
payloadPayload &&
|
|
337
|
-
key in payloadPayload &&
|
|
338
|
-
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
|
|
339
|
-
) {
|
|
340
|
-
configLabelKey = payloadPayload[
|
|
341
|
-
key as keyof typeof payloadPayload
|
|
342
|
-
] as string
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return configLabelKey in config
|
|
346
|
-
? config[configLabelKey]
|
|
347
|
-
: config[key as keyof typeof config]
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export {
|
|
351
|
-
ChartContainer,
|
|
352
|
-
ChartTooltip,
|
|
353
|
-
ChartTooltipContent,
|
|
354
|
-
ChartLegend,
|
|
355
|
-
ChartLegendContent,
|
|
356
|
-
ChartStyle,
|
|
357
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
5
|
-
import { CheckIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Checkbox({
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<CheckboxPrimitive.Root
|
|
15
|
-
data-slot="checkbox"
|
|
16
|
-
className={cn(
|
|
17
|
-
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-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 size-4 shrink-0 rounded-[4px] border transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
<CheckboxPrimitive.Indicator
|
|
23
|
-
data-slot="checkbox-indicator"
|
|
24
|
-
className="grid place-content-center text-current transition-none"
|
|
25
|
-
>
|
|
26
|
-
<CheckIcon className="size-3.5" />
|
|
27
|
-
</CheckboxPrimitive.Indicator>
|
|
28
|
-
</CheckboxPrimitive.Root>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { Checkbox }
|