@codefast/ui 0.3.11-canary.1 → 0.3.11
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 +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/pagination.d.ts
|
|
4
6
|
type PaginationProps = ComponentProps<"nav">;
|
|
5
|
-
declare function Pagination({
|
|
7
|
+
declare function Pagination({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: PaginationProps): JSX.Element;
|
|
6
11
|
type PaginationContentProps = ComponentProps<"ul">;
|
|
7
|
-
declare function PaginationContent({
|
|
12
|
+
declare function PaginationContent({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: PaginationContentProps): JSX.Element;
|
|
8
16
|
type PaginationItemProps = ComponentProps<"li">;
|
|
9
17
|
declare function PaginationItem(props: PaginationItemProps): JSX.Element;
|
|
10
18
|
interface PaginationLinkProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
11
|
-
|
|
19
|
+
isActive?: boolean;
|
|
12
20
|
}
|
|
13
|
-
declare function PaginationLink({
|
|
21
|
+
declare function PaginationLink({
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
isActive,
|
|
25
|
+
size,
|
|
26
|
+
...props
|
|
27
|
+
}: PaginationLinkProps): JSX.Element;
|
|
14
28
|
interface PaginationPreviousProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
15
|
-
|
|
29
|
+
isActive?: boolean;
|
|
16
30
|
}
|
|
17
|
-
declare function PaginationPrevious({
|
|
31
|
+
declare function PaginationPrevious({
|
|
32
|
+
...props
|
|
33
|
+
}: PaginationPreviousProps): JSX.Element;
|
|
18
34
|
interface PaginationNextProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
19
|
-
|
|
35
|
+
isActive?: boolean;
|
|
20
36
|
}
|
|
21
|
-
declare function PaginationNext({
|
|
37
|
+
declare function PaginationNext({
|
|
38
|
+
...props
|
|
39
|
+
}: PaginationNextProps): JSX.Element;
|
|
22
40
|
type PaginationEllipsisProps = ComponentProps<"span">;
|
|
23
|
-
declare function PaginationEllipsis({
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
declare function PaginationEllipsis({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: PaginationEllipsisProps): JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps };
|
|
@@ -1,86 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
2
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon, EllipsisIcon } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/pagination.tsx
|
|
5
6
|
function Pagination({ className, ...props }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
8
|
+
"aria-label": "pagination",
|
|
9
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
10
|
+
"data-slot": "pagination",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
12
13
|
}
|
|
13
14
|
function PaginationContent({ className, ...props }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
16
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
17
|
+
"data-slot": "pagination-content",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
21
|
function PaginationItem(props) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
return /* @__PURE__ */ jsx("li", {
|
|
23
|
+
"data-slot": "pagination-item",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
25
26
|
}
|
|
26
27
|
function PaginationLink({ children, className, isActive, size = "icon", ...props }) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
});
|
|
38
39
|
}
|
|
39
40
|
function PaginationPrevious({ ...props }) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
className: "size-4"
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ jsx("span", {
|
|
50
|
-
children: "Previous"
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
});
|
|
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
|
+
});
|
|
54
48
|
}
|
|
55
49
|
function PaginationNext({ ...props }) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
children: "Next"
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ jsx(ChevronRightIcon, {})
|
|
66
|
-
]
|
|
67
|
-
});
|
|
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
|
+
});
|
|
68
57
|
}
|
|
69
58
|
function PaginationEllipsis({ className, ...props }) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
className: "sr-only",
|
|
81
|
-
children: "More pages"
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
});
|
|
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
|
+
});
|
|
85
69
|
}
|
|
70
|
+
//#endregion
|
|
86
71
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
|
|
4
|
+
//#region src/components/popover.d.ts
|
|
3
5
|
type PopoverProps = ComponentProps<typeof PopoverPrimitive.Root>;
|
|
4
|
-
declare function Popover({
|
|
6
|
+
declare function Popover({
|
|
7
|
+
...props
|
|
8
|
+
}: PopoverProps): JSX.Element;
|
|
5
9
|
type PopoverTriggerProps = ComponentProps<typeof PopoverPrimitive.Trigger>;
|
|
6
|
-
declare function PopoverTrigger({
|
|
10
|
+
declare function PopoverTrigger({
|
|
11
|
+
...props
|
|
12
|
+
}: PopoverTriggerProps): JSX.Element;
|
|
7
13
|
type PopoverAnchorProps = ComponentProps<typeof PopoverPrimitive.Anchor>;
|
|
8
|
-
declare function PopoverAnchor({
|
|
14
|
+
declare function PopoverAnchor({
|
|
15
|
+
...props
|
|
16
|
+
}: PopoverAnchorProps): JSX.Element;
|
|
9
17
|
type PopoverContentProps = ComponentProps<typeof PopoverPrimitive.Content>;
|
|
10
|
-
declare function PopoverContent({
|
|
18
|
+
declare function PopoverContent({
|
|
19
|
+
align,
|
|
20
|
+
className,
|
|
21
|
+
sideOffset,
|
|
22
|
+
...props
|
|
23
|
+
}: PopoverContentProps): JSX.Element;
|
|
11
24
|
type PopoverArrowProps = ComponentProps<typeof PopoverPrimitive.Arrow>;
|
|
12
|
-
declare function PopoverArrow({
|
|
13
|
-
|
|
14
|
-
|
|
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 };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import {
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
|
+
//#region src/components/popover.tsx
|
|
5
6
|
function Popover({ ...props }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
8
|
+
"data-slot": "popover",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
10
11
|
}
|
|
11
12
|
function PopoverTrigger({ ...props }) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
16
17
|
}
|
|
17
18
|
function PopoverAnchor({ ...props }) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, {
|
|
20
|
+
"data-slot": "popover-anchor",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
22
23
|
}
|
|
23
24
|
function PopoverContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
});
|
|
25
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
26
|
+
align,
|
|
27
|
+
className: cn("z-50 min-w-32 origin-(--radix-popover-content-transform-origin) rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg outline-hidden ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
28
|
+
"data-slot": "popover-content",
|
|
29
|
+
sideOffset,
|
|
30
|
+
...props
|
|
31
|
+
}) });
|
|
33
32
|
}
|
|
34
33
|
function PopoverArrow({ className, ...props }) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Arrow, {
|
|
35
|
+
className: cn("fill-popover", className),
|
|
36
|
+
"data-slot": "popover-arrow",
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
40
39
|
}
|
|
40
|
+
//#endregion
|
|
41
41
|
export { Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger };
|
|
@@ -1,106 +1,124 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
lg: {
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
xl: {
|
|
16
|
-
label: string;
|
|
17
|
-
};
|
|
18
|
-
"2xl": {
|
|
19
|
-
label: string;
|
|
20
|
-
};
|
|
1
|
+
import { ProgressCircleProvider } from "../primitives/progress-circle.js";
|
|
2
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
3
|
+
import { VariantProps } 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;
|
|
21
11
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
thick: {};
|
|
25
|
-
thin: {};
|
|
12
|
+
md: {
|
|
13
|
+
label: string;
|
|
26
14
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
indicator: string;
|
|
30
|
-
track: string;
|
|
31
|
-
};
|
|
32
|
-
destructive: {
|
|
33
|
-
indicator: string;
|
|
34
|
-
track: string;
|
|
35
|
-
};
|
|
15
|
+
lg: {
|
|
16
|
+
label: string;
|
|
36
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
|
+
};
|
|
37
40
|
}, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
indicator: string;
|
|
42
|
+
label: string;
|
|
43
|
+
root: string;
|
|
44
|
+
svg: string;
|
|
45
|
+
track: string;
|
|
43
46
|
}>;
|
|
44
|
-
interface ProgressCircleProps extends Omit<ComponentProps<typeof
|
|
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?: {
|
|
45
64
|
/**
|
|
46
|
-
*
|
|
65
|
+
* Class for the progress indicator
|
|
47
66
|
*/
|
|
48
|
-
|
|
67
|
+
indicator?: string;
|
|
49
68
|
/**
|
|
50
|
-
*
|
|
69
|
+
* Class for the label in the center of the circle
|
|
51
70
|
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* CSS class to customize the entire component
|
|
55
|
-
*/
|
|
56
|
-
className?: string;
|
|
57
|
-
/**
|
|
58
|
-
* CSS classes to customize specific parts of the component
|
|
59
|
-
*/
|
|
60
|
-
classNames?: {
|
|
61
|
-
/**
|
|
62
|
-
* Class for the progress indicator
|
|
63
|
-
*/
|
|
64
|
-
indicator?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Class for the label in the center of the circle
|
|
67
|
-
*/
|
|
68
|
-
label?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Class for the root element of the component
|
|
71
|
-
*/
|
|
72
|
-
root?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Class for the SVG element
|
|
75
|
-
*/
|
|
76
|
-
svg?: string;
|
|
77
|
-
/**
|
|
78
|
-
* Class for the circle track
|
|
79
|
-
*/
|
|
80
|
-
track?: string;
|
|
81
|
-
};
|
|
71
|
+
label?: string;
|
|
82
72
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @param value - Current value of the component
|
|
85
|
-
* @returns React element to display in the center of the circle
|
|
73
|
+
* Class for the root element of the component
|
|
86
74
|
*/
|
|
87
|
-
|
|
88
|
-
value: number;
|
|
89
|
-
}) => JSX.Element;
|
|
75
|
+
root?: string;
|
|
90
76
|
/**
|
|
91
|
-
*
|
|
77
|
+
* Class for the SVG element
|
|
92
78
|
*/
|
|
93
|
-
|
|
79
|
+
svg?: string;
|
|
94
80
|
/**
|
|
95
|
-
*
|
|
96
|
-
* When provided, this value overrides the size variant option
|
|
81
|
+
* Class for the circle track
|
|
97
82
|
*/
|
|
98
|
-
|
|
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;
|
|
99
104
|
}
|
|
100
|
-
declare function ProgressCircle({
|
|
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;
|
|
101
120
|
declare namespace ProgressCircle {
|
|
102
|
-
|
|
121
|
+
var displayName: string;
|
|
103
122
|
}
|
|
104
|
-
|
|
105
|
-
export { ProgressCircle };
|
|
106
|
-
export type { ProgressCircleProps };
|
|
123
|
+
//#endregion
|
|
124
|
+
export { ProgressCircle, type ProgressCircleProps, progressCircleVariants };
|