@codefast/ui 0.3.13-canary.3 → 0.3.13-canary.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/CHANGELOG.md +19 -0
- package/dist/components/accordion.d.mts +37 -0
- package/dist/components/accordion.mjs +53 -0
- package/dist/components/alert-dialog.d.mts +74 -0
- package/dist/components/alert-dialog.mjs +92 -0
- package/dist/components/alert.d.mts +30 -0
- package/dist/components/alert.mjs +49 -0
- package/dist/components/aspect-ratio.d.mts +10 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +21 -0
- package/dist/components/avatar.mjs +28 -0
- package/dist/components/badge.d.mts +24 -0
- package/dist/components/badge.mjs +56 -0
- package/dist/components/breadcrumb.d.mts +44 -0
- package/dist/components/breadcrumb.mjs +67 -0
- package/dist/components/button-group.d.mts +34 -0
- package/dist/components/button-group.mjs +53 -0
- package/dist/components/button.d.mts +38 -0
- package/dist/components/button.mjs +99 -0
- package/dist/components/calendar.d.mts +27 -0
- package/dist/components/calendar.mjs +114 -0
- package/dist/components/card.d.mts +41 -0
- package/dist/components/card.mjs +55 -0
- package/dist/components/carousel.d.mts +68 -0
- package/dist/components/carousel.mjs +135 -0
- package/dist/components/chart.d.mts +93 -0
- package/dist/components/chart.mjs +189 -0
- package/dist/components/checkbox-cards.d.mts +17 -0
- package/dist/components/checkbox-cards.mjs +30 -0
- package/dist/components/checkbox-group.d.mts +16 -0
- package/dist/components/checkbox-group.mjs +27 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +20 -0
- package/dist/components/collapsible.d.mts +18 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/command.d.mts +57 -0
- package/dist/components/command.mjs +92 -0
- package/dist/components/context-menu.d.mts +91 -0
- package/dist/components/context-menu.mjs +122 -0
- package/dist/components/dialog.d.mts +65 -0
- package/dist/components/dialog.mjs +93 -0
- package/dist/components/drawer.d.mts +65 -0
- package/dist/components/drawer.mjs +78 -0
- package/dist/components/dropdown-menu.d.mts +92 -0
- package/dist/components/dropdown-menu.mjs +129 -0
- package/dist/components/empty.d.mts +44 -0
- package/dist/components/empty.mjs +64 -0
- package/dist/components/field.d.mts +79 -0
- package/dist/components/field.mjs +132 -0
- package/dist/components/form.d.mts +48 -0
- package/dist/components/form.mjs +92 -0
- package/dist/components/hover-card.d.mts +26 -0
- package/dist/components/hover-card.mjs +35 -0
- package/dist/components/input-group.d.mts +61 -0
- package/dist/components/input-group.mjs +142 -0
- package/dist/components/input-number.d.mts +28 -0
- package/dist/components/input-number.mjs +61 -0
- package/dist/components/input-otp.d.mts +29 -0
- package/dist/components/input-otp.mjs +48 -0
- package/dist/components/input-password.d.mts +13 -0
- package/dist/components/input-password.mjs +38 -0
- package/dist/components/input-search.d.mts +20 -0
- package/dist/components/input-search.mjs +50 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +82 -0
- package/dist/components/item.mjs +137 -0
- package/dist/components/kbd.d.mts +15 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +14 -0
- package/dist/components/menubar.d.mts +100 -0
- package/dist/components/menubar.mjs +133 -0
- package/dist/components/native-select.d.mts +19 -0
- package/dist/components/native-select.mjs +34 -0
- package/dist/components/navigation-menu.d.mts +44 -0
- package/dist/components/navigation-menu.mjs +79 -0
- package/dist/components/pagination.d.mts +46 -0
- package/dist/components/pagination.mjs +71 -0
- package/dist/components/popover.d.mts +30 -0
- package/dist/components/popover.mjs +41 -0
- package/dist/components/progress-circle.d.mts +124 -0
- package/dist/components/progress-circle.mjs +120 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +19 -0
- package/dist/components/{radio-cards.d.ts → radio-cards.d.mts} +10 -5
- package/dist/components/radio-cards.mjs +29 -0
- package/dist/components/radio-group.d.mts +16 -0
- package/dist/components/radio-group.mjs +25 -0
- package/dist/components/radio.d.mts +14 -0
- package/dist/components/radio.mjs +16 -0
- package/dist/components/resizable.d.mts +23 -0
- package/dist/components/resizable.mjs +32 -0
- package/dist/components/scroll-area.d.mts +40 -0
- package/dist/components/scroll-area.mjs +101 -0
- package/dist/components/select.d.mts +62 -0
- package/dist/components/select.mjs +101 -0
- package/dist/components/separator.d.mts +32 -0
- package/dist/components/separator.mjs +45 -0
- package/dist/components/sheet.d.mts +75 -0
- package/dist/components/sheet.mjs +134 -0
- package/dist/components/sidebar.d.mts +195 -0
- package/dist/components/sidebar.mjs +375 -0
- package/dist/components/skeleton.d.mts +10 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +40 -0
- package/dist/components/sonner.d.mts +10 -0
- package/dist/components/sonner.mjs +21 -0
- package/dist/components/spinner.d.mts +14 -0
- package/dist/components/spinner.mjs +40 -0
- package/dist/components/switch.d.mts +11 -0
- package/dist/components/switch.mjs +18 -0
- package/dist/components/table.d.mts +45 -0
- package/dist/components/table.mjs +65 -0
- package/dist/components/tabs.d.mts +26 -0
- package/dist/components/tabs.mjs +35 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +12 -0
- package/dist/components/toggle-group.d.mts +30 -0
- package/dist/components/toggle-group.mjs +53 -0
- package/dist/components/toggle.d.mts +28 -0
- package/dist/components/toggle.mjs +53 -0
- package/dist/components/tooltip.d.mts +30 -0
- package/dist/components/tooltip.mjs +42 -0
- package/dist/hooks/{use-animated-value.d.ts → use-animated-value.d.mts} +4 -2
- package/dist/hooks/use-animated-value.mjs +62 -0
- package/dist/hooks/{use-copy-to-clipboard.d.ts → use-copy-to-clipboard.d.mts} +11 -6
- package/dist/hooks/use-copy-to-clipboard.mjs +43 -0
- package/dist/hooks/{use-is-mobile.d.ts → use-is-mobile.d.mts} +4 -2
- package/dist/hooks/use-is-mobile.mjs +26 -0
- package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +4 -2
- package/dist/hooks/use-media-query.mjs +50 -0
- package/dist/hooks/{use-mutation-observer.d.ts → use-mutation-observer.d.mts} +6 -3
- package/dist/hooks/use-mutation-observer.mjs +41 -0
- package/dist/hooks/use-pagination.d.mts +44 -0
- package/dist/hooks/use-pagination.mjs +107 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.mjs +69 -0
- package/dist/lib/utils.d.mts +13 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +6 -0
- package/dist/primitives/checkbox-group.d.mts +144 -0
- package/dist/primitives/checkbox-group.mjs +126 -0
- package/dist/primitives/input-number.d.mts +73 -0
- package/dist/primitives/input-number.mjs +514 -0
- package/dist/primitives/input.d.mts +72 -0
- package/dist/primitives/input.mjs +75 -0
- package/dist/primitives/progress-circle.d.mts +146 -0
- package/dist/primitives/progress-circle.mjs +178 -0
- package/package.json +164 -170
- package/dist/components/accordion.d.ts +0 -19
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -26
- package/dist/components/alert-dialog.d.ts +0 -39
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -39
- package/dist/components/alert.d.ts +0 -19
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -41
- package/dist/components/aspect-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio.d.ts.map +0 -1
- package/dist/components/aspect-ratio.js +0 -10
- package/dist/components/avatar.d.ts +0 -11
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -17
- package/dist/components/badge.d.ts +0 -18
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -59
- package/dist/components/breadcrumb.d.ts +0 -22
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb.js +0 -31
- package/dist/components/button-group.d.ts +0 -20
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -48
- package/dist/components/button.d.ts +0 -29
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -92
- package/dist/components/calendar.d.ts +0 -13
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/calendar.js +0 -104
- package/dist/components/card.d.ts +0 -18
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -27
- package/dist/components/carousel.d.ts +0 -38
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -103
- package/dist/components/chart.d.ts +0 -58
- package/dist/components/chart.d.ts.map +0 -1
- package/dist/components/chart.js +0 -198
- package/dist/components/checkbox-cards.d.ts +0 -11
- package/dist/components/checkbox-cards.d.ts.map +0 -1
- package/dist/components/checkbox-cards.js +0 -16
- package/dist/components/checkbox-group.d.ts +0 -9
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox-group.js +0 -15
- package/dist/components/checkbox.d.ts +0 -7
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox.js +0 -12
- package/dist/components/collapsible.d.ts +0 -11
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -16
- package/dist/components/command.d.ts +0 -26
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -41
- package/dist/components/context-menu.d.ts +0 -42
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -54
- package/dist/components/dialog.d.ts +0 -35
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -41
- package/dist/components/drawer.d.ts +0 -34
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -36
- package/dist/components/dropdown-menu.d.ts +0 -42
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -54
- package/dist/components/empty.d.ts +0 -23
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -47
- package/dist/components/field.d.ts +0 -42
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -85
- package/dist/components/form.d.ts +0 -27
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -76
- package/dist/components/hover-card.d.ts +0 -13
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -20
- package/dist/components/input-group.d.ts +0 -37
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -127
- package/dist/components/input-number.d.ts +0 -8
- package/dist/components/input-number.d.ts.map +0 -1
- package/dist/components/input-number.js +0 -20
- package/dist/components/input-otp.d.ts +0 -16
- package/dist/components/input-otp.d.ts.map +0 -1
- package/dist/components/input-otp.js +0 -25
- package/dist/components/input-password.d.ts +0 -7
- package/dist/components/input-password.d.ts.map +0 -1
- package/dist/components/input-password.js +0 -17
- package/dist/components/input-search.d.ts +0 -11
- package/dist/components/input-search.d.ts.map +0 -1
- package/dist/components/input-search.js +0 -22
- package/dist/components/input.d.ts +0 -6
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -10
- package/dist/components/item.d.ts +0 -46
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/item.js +0 -94
- package/dist/components/kbd.d.ts +0 -8
- package/dist/components/kbd.d.ts.map +0 -1
- package/dist/components/kbd.js +0 -12
- package/dist/components/label.d.ts +0 -7
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -11
- package/dist/components/menubar.d.ts +0 -44
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/menubar.js +0 -57
- package/dist/components/native-select.d.ts +0 -10
- package/dist/components/native-select.d.ts.map +0 -1
- package/dist/components/native-select.js +0 -16
- package/dist/components/navigation-menu.d.ts +0 -21
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/navigation-menu.js +0 -43
- package/dist/components/pagination.d.ts +0 -26
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -29
- package/dist/components/popover.d.ts +0 -15
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress-circle.d.ts +0 -107
- package/dist/components/progress-circle.d.ts.map +0 -1
- package/dist/components/progress-circle.js +0 -83
- package/dist/components/progress.d.ts +0 -7
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -13
- package/dist/components/radio-cards.d.ts.map +0 -1
- package/dist/components/radio-cards.js +0 -15
- package/dist/components/radio-group.d.ts +0 -9
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -14
- package/dist/components/radio.d.ts +0 -8
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/radio.js +0 -11
- package/dist/components/resizable.d.ts +0 -13
- package/dist/components/resizable.d.ts.map +0 -1
- package/dist/components/resizable.js +0 -18
- package/dist/components/scroll-area.d.ts +0 -28
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -77
- package/dist/components/select.d.ts +0 -29
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -49
- package/dist/components/separator.d.ts +0 -23
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -36
- package/dist/components/sheet.d.ts +0 -43
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -90
- package/dist/components/sidebar.d.ts +0 -102
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -241
- package/dist/components/skeleton.d.ts +0 -6
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -9
- package/dist/components/slider.d.ts +0 -7
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/slider.js +0 -18
- package/dist/components/sonner.d.ts +0 -8
- package/dist/components/sonner.d.ts.map +0 -1
- package/dist/components/sonner.js +0 -18
- package/dist/components/spinner.d.ts +0 -8
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -27
- package/dist/components/switch.d.ts +0 -7
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -11
- package/dist/components/table.d.ts +0 -20
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -30
- package/dist/components/tabs.d.ts +0 -13
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -20
- package/dist/components/textarea.d.ts +0 -6
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -9
- package/dist/components/toggle-group.d.ts +0 -16
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle-group.js +0 -35
- package/dist/components/toggle.d.ts +0 -21
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -49
- package/dist/components/tooltip.d.ts +0 -15
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -23
- package/dist/hooks/use-animated-value.d.ts.map +0 -1
- package/dist/hooks/use-animated-value.js +0 -71
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.js +0 -46
- package/dist/hooks/use-is-mobile.d.ts.map +0 -1
- package/dist/hooks/use-is-mobile.js +0 -23
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-media-query.js +0 -53
- package/dist/hooks/use-mutation-observer.d.ts.map +0 -1
- package/dist/hooks/use-mutation-observer.js +0 -40
- package/dist/hooks/use-pagination.d.ts +0 -37
- package/dist/hooks/use-pagination.d.ts.map +0 -1
- package/dist/hooks/use-pagination.js +0 -107
- package/dist/index.d.ts +0 -131
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -68
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -10
- package/dist/primitives/checkbox-group.d.ts +0 -123
- package/dist/primitives/checkbox-group.d.ts.map +0 -1
- package/dist/primitives/checkbox-group.js +0 -112
- package/dist/primitives/input-number.d.ts +0 -63
- package/dist/primitives/input-number.d.ts.map +0 -1
- package/dist/primitives/input-number.js +0 -458
- package/dist/primitives/input.d.ts +0 -67
- package/dist/primitives/input.d.ts.map +0 -1
- package/dist/primitives/input.js +0 -76
- package/dist/primitives/progress-circle.d.ts +0 -116
- package/dist/primitives/progress-circle.d.ts.map +0 -1
- package/dist/primitives/progress-circle.js +0 -163
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { buttonVariants } from "./button.mjs";
|
|
3
|
+
import { ChevronLeftIcon, ChevronRightIcon, EllipsisIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/pagination.tsx
|
|
6
|
+
function Pagination({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
8
|
+
"aria-label": "pagination",
|
|
9
|
+
className: cn("flex w-full justify-center", "mx-auto", className),
|
|
10
|
+
"data-slot": "pagination",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function PaginationContent({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
16
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
17
|
+
"data-slot": "pagination-content",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function PaginationItem(props) {
|
|
22
|
+
return /* @__PURE__ */ jsx("li", {
|
|
23
|
+
"data-slot": "pagination-item",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function PaginationLink({ children, className, isActive, size = "icon", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("a", {
|
|
29
|
+
"aria-current": isActive ? "page" : void 0,
|
|
30
|
+
className: buttonVariants({
|
|
31
|
+
className,
|
|
32
|
+
size,
|
|
33
|
+
variant: isActive ? "outline" : "ghost"
|
|
34
|
+
}),
|
|
35
|
+
"data-slot": "pagination-link",
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function PaginationPrevious({ ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
42
|
+
"aria-label": "Go to previous page",
|
|
43
|
+
"data-slot": "pagination-previous",
|
|
44
|
+
size: "md",
|
|
45
|
+
...props,
|
|
46
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", { children: "Previous" })]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function PaginationNext({ ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
51
|
+
"aria-label": "Go to next page",
|
|
52
|
+
"data-slot": "pagination-next",
|
|
53
|
+
size: "md",
|
|
54
|
+
...props,
|
|
55
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Next" }), /* @__PURE__ */ jsx(ChevronRightIcon, {})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
className: cn("flex size-10 items-center justify-center", className),
|
|
62
|
+
"data-slot": "pagination-ellipsis",
|
|
63
|
+
...props,
|
|
64
|
+
children: [/* @__PURE__ */ jsx(EllipsisIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: "sr-only",
|
|
66
|
+
children: "More pages"
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
|
|
4
|
+
//#region src/components/popover.d.ts
|
|
5
|
+
type PopoverProps = ComponentProps<typeof PopoverPrimitive.Root>;
|
|
6
|
+
declare function Popover({
|
|
7
|
+
...props
|
|
8
|
+
}: PopoverProps): JSX.Element;
|
|
9
|
+
type PopoverTriggerProps = ComponentProps<typeof PopoverPrimitive.Trigger>;
|
|
10
|
+
declare function PopoverTrigger({
|
|
11
|
+
...props
|
|
12
|
+
}: PopoverTriggerProps): JSX.Element;
|
|
13
|
+
type PopoverAnchorProps = ComponentProps<typeof PopoverPrimitive.Anchor>;
|
|
14
|
+
declare function PopoverAnchor({
|
|
15
|
+
...props
|
|
16
|
+
}: PopoverAnchorProps): JSX.Element;
|
|
17
|
+
type PopoverContentProps = ComponentProps<typeof PopoverPrimitive.Content>;
|
|
18
|
+
declare function PopoverContent({
|
|
19
|
+
align,
|
|
20
|
+
className,
|
|
21
|
+
sideOffset,
|
|
22
|
+
...props
|
|
23
|
+
}: PopoverContentProps): JSX.Element;
|
|
24
|
+
type PopoverArrowProps = ComponentProps<typeof PopoverPrimitive.Arrow>;
|
|
25
|
+
declare function PopoverArrow({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: PopoverArrowProps): JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Popover, PopoverAnchor, type PopoverAnchorProps, PopoverArrow, type PopoverArrowProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
|
+
//#region src/components/popover.tsx
|
|
6
|
+
function Popover({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
8
|
+
"data-slot": "popover",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function PopoverTrigger({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function PopoverAnchor({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, {
|
|
20
|
+
"data-slot": "popover-anchor",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function PopoverContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
26
|
+
align,
|
|
27
|
+
className: cn("z-50", "min-w-32 p-4", "rounded-lg border", "bg-popover shadow-lg outline-hidden", "text-popover-foreground", "ease-ui data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", "data-open:data-side-top:slide-in-from-bottom-2", "data-open:data-side-right:slide-in-from-left-2", "data-open:data-side-bottom:slide-in-from-top-2", "data-open:data-side-left:slide-in-from-right-2", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-closed:data-side-top:slide-out-to-bottom-2", "data-closed:data-side-right:slide-out-to-left-2", "data-closed:data-side-bottom:slide-out-to-top-2", "data-closed:data-side-left:slide-out-to-right-2", "origin-(--radix-popover-content-transform-origin)", className),
|
|
28
|
+
"data-slot": "popover-content",
|
|
29
|
+
sideOffset,
|
|
30
|
+
...props
|
|
31
|
+
}) });
|
|
32
|
+
}
|
|
33
|
+
function PopoverArrow({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Arrow, {
|
|
35
|
+
className: cn("fill-popover", className),
|
|
36
|
+
"data-slot": "popover-arrow",
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
import { ProgressCircleProvider } from "../primitives/progress-circle.mjs";
|
|
3
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
4
|
+
import { ComponentProps, JSX } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/progress-circle.d.ts
|
|
7
|
+
declare const progressCircleVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
8
|
+
size: {
|
|
9
|
+
sm: {
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
md: {
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
lg: {
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
xl: {
|
|
19
|
+
label: string;
|
|
20
|
+
};
|
|
21
|
+
"2xl": {
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
thickness: {
|
|
26
|
+
regular: {};
|
|
27
|
+
thick: {};
|
|
28
|
+
thin: {};
|
|
29
|
+
};
|
|
30
|
+
variant: {
|
|
31
|
+
default: {
|
|
32
|
+
indicator: string;
|
|
33
|
+
track: string;
|
|
34
|
+
};
|
|
35
|
+
destructive: {
|
|
36
|
+
indicator: string;
|
|
37
|
+
track: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
indicator: string;
|
|
42
|
+
label: string[];
|
|
43
|
+
root: string;
|
|
44
|
+
svg: string;
|
|
45
|
+
track: string;
|
|
46
|
+
}>;
|
|
47
|
+
interface ProgressCircleProps extends Omit<ComponentProps<typeof ProgressCircleProvider>, "children" | "size">, VariantProps<typeof progressCircleVariants> {
|
|
48
|
+
/**
|
|
49
|
+
* Enables animation effect when value changes
|
|
50
|
+
*/
|
|
51
|
+
animate?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Duration of the animation in milliseconds
|
|
54
|
+
*/
|
|
55
|
+
animationDuration?: number;
|
|
56
|
+
/**
|
|
57
|
+
* CSS class to customize the entire component
|
|
58
|
+
*/
|
|
59
|
+
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* CSS classes to customize specific parts of the component
|
|
62
|
+
*/
|
|
63
|
+
classNames?: {
|
|
64
|
+
/**
|
|
65
|
+
* Class for the progress indicator
|
|
66
|
+
*/
|
|
67
|
+
indicator?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Class for the label in the center of the circle
|
|
70
|
+
*/
|
|
71
|
+
label?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Class for the root element of the component
|
|
74
|
+
*/
|
|
75
|
+
root?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Class for the SVG element
|
|
78
|
+
*/
|
|
79
|
+
svg?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Class for the circle track
|
|
82
|
+
*/
|
|
83
|
+
track?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Custom function to render content in the center of the circle
|
|
87
|
+
* @param value - Current value of the component
|
|
88
|
+
* @returns React element to display in the center of the circle
|
|
89
|
+
*/
|
|
90
|
+
customLabel?: ({
|
|
91
|
+
value
|
|
92
|
+
}: {
|
|
93
|
+
value: number;
|
|
94
|
+
}) => JSX.Element;
|
|
95
|
+
/**
|
|
96
|
+
* Display the numeric value in the center of the circle
|
|
97
|
+
*/
|
|
98
|
+
showValue?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Custom size in pixels
|
|
101
|
+
* When provided, this value overrides the size variant option
|
|
102
|
+
*/
|
|
103
|
+
sizeInPixels?: number;
|
|
104
|
+
}
|
|
105
|
+
declare function ProgressCircle({
|
|
106
|
+
animate,
|
|
107
|
+
animationDuration,
|
|
108
|
+
className,
|
|
109
|
+
classNames,
|
|
110
|
+
customLabel,
|
|
111
|
+
showValue,
|
|
112
|
+
size,
|
|
113
|
+
sizeInPixels,
|
|
114
|
+
strokeWidth,
|
|
115
|
+
thickness,
|
|
116
|
+
value,
|
|
117
|
+
variant,
|
|
118
|
+
...props
|
|
119
|
+
}: ProgressCircleProps): JSX.Element;
|
|
120
|
+
declare namespace ProgressCircle {
|
|
121
|
+
var displayName: string;
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { ProgressCircle, type ProgressCircleProps, progressCircleVariants };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { tv } from "../lib/utils.mjs";
|
|
3
|
+
import { useAnimatedValue } from "../hooks/use-animated-value.mjs";
|
|
4
|
+
import { Indicator as ProgressCircleIndicator, ProgressCircle as ProgressCircle$1, ProgressCircleProvider, ProgressCircleSVG, ProgressCircleTrack, ProgressCircleValue } from "../primitives/progress-circle.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback, useMemo } from "react";
|
|
7
|
+
//#region src/components/progress-circle.tsx
|
|
8
|
+
const progressCircleVariants = tv({
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
size: "md",
|
|
11
|
+
thickness: "regular",
|
|
12
|
+
variant: "default"
|
|
13
|
+
},
|
|
14
|
+
slots: {
|
|
15
|
+
indicator: "origin-center",
|
|
16
|
+
label: [
|
|
17
|
+
"absolute flex items-center justify-center",
|
|
18
|
+
"inset-0",
|
|
19
|
+
"text-xs font-medium"
|
|
20
|
+
],
|
|
21
|
+
root: "relative inline-flex items-center justify-center",
|
|
22
|
+
svg: "size-full",
|
|
23
|
+
track: "origin-center"
|
|
24
|
+
},
|
|
25
|
+
variants: {
|
|
26
|
+
size: {
|
|
27
|
+
sm: { label: "text-[0.625rem]" },
|
|
28
|
+
md: { label: "text-xs" },
|
|
29
|
+
lg: { label: "text-sm" },
|
|
30
|
+
xl: { label: "text-base" },
|
|
31
|
+
"2xl": { label: "text-lg" }
|
|
32
|
+
},
|
|
33
|
+
thickness: {
|
|
34
|
+
regular: {},
|
|
35
|
+
thick: {},
|
|
36
|
+
thin: {}
|
|
37
|
+
},
|
|
38
|
+
variant: {
|
|
39
|
+
default: {
|
|
40
|
+
indicator: "text-primary",
|
|
41
|
+
track: "text-primary/20"
|
|
42
|
+
},
|
|
43
|
+
destructive: {
|
|
44
|
+
indicator: "text-destructive",
|
|
45
|
+
track: "text-destructive/20"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
function ProgressCircle({ animate = true, animationDuration = 1e3, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
51
|
+
const displayValue = useAnimatedValue(value, animationDuration, animate);
|
|
52
|
+
const actualSize = useMemo(() => sizeInPixels ?? getActualSize(size), [sizeInPixels, size]);
|
|
53
|
+
const actualThickness = useMemo(() => strokeWidth ?? getStrokeWidth(thickness, actualSize), [
|
|
54
|
+
strokeWidth,
|
|
55
|
+
thickness,
|
|
56
|
+
actualSize
|
|
57
|
+
]);
|
|
58
|
+
const slots = useMemo(() => progressCircleVariants({
|
|
59
|
+
size,
|
|
60
|
+
thickness,
|
|
61
|
+
variant
|
|
62
|
+
}), [
|
|
63
|
+
variant,
|
|
64
|
+
size,
|
|
65
|
+
thickness
|
|
66
|
+
]);
|
|
67
|
+
const shouldShowLabel = showValue || Boolean(customLabel);
|
|
68
|
+
const renderLabel = useCallback(() => {
|
|
69
|
+
if (customLabel) return customLabel({ value: displayValue });
|
|
70
|
+
return `${displayValue.toString()}%`;
|
|
71
|
+
}, [customLabel, displayValue]);
|
|
72
|
+
return /* @__PURE__ */ jsx(ProgressCircleProvider, {
|
|
73
|
+
size: actualSize,
|
|
74
|
+
strokeWidth: actualThickness,
|
|
75
|
+
value,
|
|
76
|
+
...props,
|
|
77
|
+
children: /* @__PURE__ */ jsxs(ProgressCircle$1, {
|
|
78
|
+
className: slots.root({ className: [className, classNames?.root] }),
|
|
79
|
+
children: [/* @__PURE__ */ jsxs(ProgressCircleSVG, {
|
|
80
|
+
className: slots.svg({ className: classNames?.svg }),
|
|
81
|
+
children: [/* @__PURE__ */ jsx(ProgressCircleTrack, { className: slots.track({ className: classNames?.track }) }), /* @__PURE__ */ jsx(ProgressCircleIndicator, {
|
|
82
|
+
className: slots.indicator({ className: classNames?.indicator }),
|
|
83
|
+
style: {
|
|
84
|
+
transitionDuration: `${animationDuration.toString()}ms`,
|
|
85
|
+
transitionProperty: "stroke-dashoffset"
|
|
86
|
+
}
|
|
87
|
+
})]
|
|
88
|
+
}), shouldShowLabel ? /* @__PURE__ */ jsx(ProgressCircleValue, {
|
|
89
|
+
className: slots.label({ className: classNames?.label }),
|
|
90
|
+
children: renderLabel()
|
|
91
|
+
}) : null]
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
ProgressCircle.displayName = "ProgressCircle";
|
|
96
|
+
/**
|
|
97
|
+
* Maps size variants to actual pixel sizes
|
|
98
|
+
*/
|
|
99
|
+
const getActualSize = (size) => {
|
|
100
|
+
return size ? {
|
|
101
|
+
"2xl": 128,
|
|
102
|
+
lg: 64,
|
|
103
|
+
md: 48,
|
|
104
|
+
sm: 32,
|
|
105
|
+
xl: 96
|
|
106
|
+
}[size] : 48;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Calculates stroke width based on thickness variant and circle size
|
|
110
|
+
*/
|
|
111
|
+
const getStrokeWidth = (thickness, size) => {
|
|
112
|
+
const thicknessMap = {
|
|
113
|
+
regular: Math.max(3, size * .05),
|
|
114
|
+
thick: Math.max(4, size * .075),
|
|
115
|
+
thin: Math.max(2, size * .025)
|
|
116
|
+
};
|
|
117
|
+
return thickness ? thicknessMap[thickness] : Math.max(3, size * .05);
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
export { ProgressCircle, progressCircleVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
+
|
|
4
|
+
//#region src/components/progress.d.ts
|
|
5
|
+
type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
|
|
6
|
+
declare function Progress({
|
|
7
|
+
className,
|
|
8
|
+
value,
|
|
9
|
+
...props
|
|
10
|
+
}: ProgressProps): JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Progress, type ProgressProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5
|
+
//#region src/components/progress.tsx
|
|
6
|
+
function Progress({ className, value, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(ProgressPrimitive.Root, {
|
|
8
|
+
className: cn("relative", "h-2 w-full overflow-hidden", "rounded-full", "bg-primary/20", className),
|
|
9
|
+
"data-slot": "progress",
|
|
10
|
+
...props,
|
|
11
|
+
children: /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
|
|
12
|
+
className: cn("size-full flex-1", "bg-primary", "transition-all"),
|
|
13
|
+
"data-slot": "progress-indicator",
|
|
14
|
+
style: { transform: `translateX(-${(100 - (value ?? 0)).toString()}%)` }
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Progress };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
|
|
4
|
+
//#region src/components/radio-cards.d.ts
|
|
3
5
|
type RadioCardsProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
4
6
|
declare function RadioCards(props: RadioCardsProps): JSX.Element;
|
|
5
7
|
type RadioCardsItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
6
|
-
declare function RadioCardsItem({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
declare function RadioCardsItem({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: RadioCardsItemProps): JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { RadioCards, RadioCardsItem, type RadioCardsItemProps, type RadioCardsProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Label } from "./label.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
6
|
+
//#region src/components/radio-cards.tsx
|
|
7
|
+
function RadioCards(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
9
|
+
"data-slot": "radio-cards",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function RadioCardsItem({ children, className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Label, {
|
|
15
|
+
className: cn("flex items-start gap-3", "p-3", "rounded-lg border border-input", "transition", "hover:not-has-disabled:not-has-aria-checked:bg-secondary", "has-focus-visible:border-ring", "has-disabled:opacity-50", "has-aria-checked:border-primary has-aria-checked:bg-primary/10"),
|
|
16
|
+
"data-slot": "radio-card",
|
|
17
|
+
children: [/* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
18
|
+
className: cn("peer flex size-4 shrink-0 items-center justify-center", "rounded-full border border-input shadow-xs outline-hidden", "text-primary-foreground", "transition", "focus-visible:ring-3 focus-visible:ring-ring/50", "focus-visible:not-aria-checked:border-ring", "aria-checked:border-primary aria-checked:bg-primary", "focus-visible:aria-checked:ring-primary/20", "dark:bg-input/30", "dark:focus-visible:aria-checked:ring-primary/40", className),
|
|
19
|
+
"data-slot": "radio-card-item",
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
22
|
+
className: cn("size-1", "rounded-full", "bg-background"),
|
|
23
|
+
"data-slot": "radio-card-indicator"
|
|
24
|
+
})
|
|
25
|
+
}), children]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { RadioCards, RadioCardsItem };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
|
|
4
|
+
//#region src/components/radio-group.d.ts
|
|
5
|
+
type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
6
|
+
declare function RadioGroup({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: RadioGroupProps): JSX.Element;
|
|
10
|
+
type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
11
|
+
declare function RadioGroupItem({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: RadioGroupItemProps): JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
+
//#region src/components/radio-group.tsx
|
|
6
|
+
function RadioGroup({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
8
|
+
className: cn("grid gap-2", className),
|
|
9
|
+
"data-slot": "radio-group",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function RadioGroupItem({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
15
|
+
className: cn("peer inline-flex size-4 shrink-0 items-center justify-center", "rounded-full border border-input shadow-xs outline-hidden", "transition", "hover:not-disabled:not-aria-checked:border-ring/60", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:opacity-50", "aria-checked:border-primary aria-checked:bg-primary", "focus-visible:aria-checked:ring-primary/20", "aria-invalid:border-destructive aria-invalid:ring-destructive/20", "hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60", "aria-checked:aria-invalid:bg-destructive", "dark:bg-input/30", "dark:focus-visible:aria-checked:ring-primary/40", "dark:aria-invalid:ring-destructive/40", className),
|
|
16
|
+
"data-slot": "radio-group-item",
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
19
|
+
className: cn("size-1", "rounded-full", "bg-background"),
|
|
20
|
+
"data-slot": "radio-group-indicator"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/radio.d.ts
|
|
4
|
+
interface RadioProps extends Omit<ComponentProps<"input">, "type"> {
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare function Radio({
|
|
8
|
+
className,
|
|
9
|
+
onChange,
|
|
10
|
+
onValueChange,
|
|
11
|
+
...props
|
|
12
|
+
}: RadioProps): JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Radio, type RadioProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
5
|
+
//#region src/components/radio.tsx
|
|
6
|
+
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("input", {
|
|
8
|
+
className: cn("peer inline-flex size-4 shrink-0 items-center justify-center", "rounded-full border border-input shadow-xs outline-hidden", "appearance-none", "after:size-full after:rounded-full after:bg-background after:transition-[width,height]", "checked:border-primary checked:bg-primary", "checked:after:size-1", "hover:not-disabled:not-checked:border-ring/60", "focus-visible:ring-3 focus-visible:ring-ring/50", "focus-visible:not-checked:border-ring", "focus-visible:checked:ring-primary/20", "disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20", "checked:aria-invalid:bg-destructive", "hover:not-disabled:not-checked:aria-invalid:border-destructive/60", "dark:not-checked:after:bg-input/30", "dark:focus-visible:checked:ring-primary/40", "dark:aria-invalid:ring-destructive/40", className),
|
|
9
|
+
"data-slot": "radio",
|
|
10
|
+
type: "radio",
|
|
11
|
+
onChange: composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value)),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Radio };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
+
|
|
4
|
+
//#region src/components/resizable.d.ts
|
|
5
|
+
type ResizableGroupProps = ComponentProps<typeof ResizablePrimitive.Group>;
|
|
6
|
+
declare function ResizableGroup({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: ResizableGroupProps): JSX.Element;
|
|
10
|
+
type ResizablePanelProps = ComponentProps<typeof ResizablePrimitive.Panel>;
|
|
11
|
+
declare function ResizablePanel({
|
|
12
|
+
...props
|
|
13
|
+
}: ResizablePanelProps): JSX.Element;
|
|
14
|
+
interface ResizableSeparatorProps extends ComponentProps<typeof ResizablePrimitive.Separator> {
|
|
15
|
+
withHandle?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function ResizableSeparator({
|
|
18
|
+
className,
|
|
19
|
+
withHandle,
|
|
20
|
+
...props
|
|
21
|
+
}: ResizableSeparatorProps): JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ResizableGroup, type ResizableGroupProps, ResizablePanel, type ResizablePanelProps, ResizableSeparator, type ResizableSeparatorProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { GripVerticalIcon } from "lucide-react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
6
|
+
//#region src/components/resizable.tsx
|
|
7
|
+
function ResizableGroup({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Group, {
|
|
9
|
+
className: cn("flex size-full", className),
|
|
10
|
+
"data-slot": "resizable-group",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function ResizablePanel({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, {
|
|
16
|
+
"data-slot": "resizable-panel",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function ResizableSeparator({ className, withHandle, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(ResizablePrimitive.Separator, {
|
|
22
|
+
className: cn("flex items-center justify-center", "bg-border outline-hidden", "focus-visible:bg-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-[orientation=horizontal]:h-px", "aria-[orientation=vertical]:w-px", className),
|
|
23
|
+
"data-slot": "resizable-separator",
|
|
24
|
+
...props,
|
|
25
|
+
children: withHandle ? /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: cn("z-10 flex h-4 w-3 items-center justify-center", "rounded-sm border", "bg-border"),
|
|
27
|
+
children: /* @__PURE__ */ jsx(GripVerticalIcon, { className: "size-2.5" })
|
|
28
|
+
}) : null
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ResizableGroup, ResizablePanel, ResizableSeparator };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
import { Scope } from "@radix-ui/react-context";
|
|
5
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6
|
+
|
|
7
|
+
//#region src/components/scroll-area.d.ts
|
|
8
|
+
declare const scrollAreaScrollbarVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
9
|
+
orientation: {
|
|
10
|
+
horizontal: string[];
|
|
11
|
+
vertical: string[];
|
|
12
|
+
};
|
|
13
|
+
size: {
|
|
14
|
+
none: string;
|
|
15
|
+
sm: string;
|
|
16
|
+
md: string;
|
|
17
|
+
lg: string;
|
|
18
|
+
};
|
|
19
|
+
}, Record<string, never>>;
|
|
20
|
+
type ScopedProps<P> = P & {
|
|
21
|
+
__scopeScrollArea?: Scope;
|
|
22
|
+
};
|
|
23
|
+
type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>, "size">;
|
|
24
|
+
type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue>;
|
|
25
|
+
declare function ScrollArea({
|
|
26
|
+
__scopeScrollArea,
|
|
27
|
+
children,
|
|
28
|
+
className,
|
|
29
|
+
size,
|
|
30
|
+
...props
|
|
31
|
+
}: ScrollAreaProps): JSX.Element;
|
|
32
|
+
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>>;
|
|
33
|
+
declare function ScrollAreaScrollbar({
|
|
34
|
+
__scopeScrollArea,
|
|
35
|
+
className,
|
|
36
|
+
orientation,
|
|
37
|
+
...props
|
|
38
|
+
}: ScrollAreaScrollbarProps): JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, scrollAreaScrollbarVariants };
|