@codefast/ui 0.3.10 → 0.3.11-canary.0
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/README.md +277 -167
- package/dist/components/accordion.cjs +5 -5
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.cjs +9 -9
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.cjs +5 -5
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.cjs +3 -3
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.cjs +7 -7
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.cjs +6 -8
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.cjs +8 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.cjs +17 -17
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.cjs +35 -35
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.cjs +7 -7
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.cjs +20 -20
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.cjs +42 -42
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.cjs +2 -2
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.cjs +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.cjs +10 -10
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.cjs +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.cjs +12 -12
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.cjs +9 -9
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.cjs +10 -10
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.cjs +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.cjs +17 -17
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.cjs +8 -8
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.cjs +3 -3
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.cjs +20 -20
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.cjs +7 -7
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.cjs +4 -4
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.cjs +6 -6
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.cjs +4 -4
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.cjs +23 -23
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.cjs +2 -2
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.cjs +13 -13
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.cjs +2 -2
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.cjs +10 -10
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.cjs +6 -6
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.cjs +3 -3
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.cjs +22 -22
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.cjs +2 -2
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.cjs +3 -3
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.cjs +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.cjs +3 -3
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.cjs +31 -31
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.cjs +9 -9
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.cjs +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.cjs +17 -17
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.cjs +65 -65
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.cjs +4 -4
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.cjs +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.cjs +5 -5
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.cjs +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.cjs +8 -8
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.cjs +4 -4
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.cjs +5 -5
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.cjs +8 -8
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.cjs +2 -2
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.cjs +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.cjs +3 -3
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.cjs +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.cjs +3 -3
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.cjs +46 -46
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.cjs +7 -7
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.cjs +8 -8
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +38 -42
|
@@ -39,13 +39,13 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
39
39
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
40
40
|
const navigationMenuTriggerVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
41
41
|
base: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
42
|
-
className:
|
|
43
|
-
variant:
|
|
42
|
+
className: "data-[state=open]:bg-secondary/50 data-[state=open]:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary",
|
|
43
|
+
variant: "ghost"
|
|
44
44
|
})
|
|
45
45
|
});
|
|
46
46
|
function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
47
47
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.Root, {
|
|
48
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
48
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
49
49
|
"data-slot": "navigation-menu",
|
|
50
50
|
"data-viewport": viewport,
|
|
51
51
|
...props,
|
|
@@ -57,7 +57,7 @@ function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
|
57
57
|
}
|
|
58
58
|
function NavigationMenuList({ children, className, ...props }) {
|
|
59
59
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.List, {
|
|
60
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
60
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-1 list-none items-center justify-center gap-1", className),
|
|
61
61
|
"data-slot": "navigation-menu-list",
|
|
62
62
|
...props,
|
|
63
63
|
children: [
|
|
@@ -70,7 +70,7 @@ function NavigationMenuList({ children, className, ...props }) {
|
|
|
70
70
|
}
|
|
71
71
|
function NavigationMenuItem({ className, ...props }) {
|
|
72
72
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Item, {
|
|
73
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
73
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group-data-[viewport=false]/navigation-menu:relative", className),
|
|
74
74
|
"data-slot": "navigation-menu-item",
|
|
75
75
|
...props
|
|
76
76
|
});
|
|
@@ -93,14 +93,14 @@ function NavigationMenuTrigger({ children, className, ...props }) {
|
|
|
93
93
|
}
|
|
94
94
|
function NavigationMenuContent({ className, ...props }) {
|
|
95
95
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Content, {
|
|
96
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
96
|
+
className: (0, tailwind_variants_namespaceObject.cn)("top-0 left-0 w-full ease-ui group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-2 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:p-1 group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=true]/navigation-menu:p-2 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in-0 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 md:absolute md:w-auto", className),
|
|
97
97
|
"data-slot": "navigation-menu-content",
|
|
98
98
|
...props
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
function NavigationMenuLink({ className, ...props }) {
|
|
102
102
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Link, {
|
|
103
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
103
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-1 rounded-sm p-2 text-sm outline-hidden transition hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
|
|
104
104
|
"data-slot": "navigation-menu-link",
|
|
105
105
|
...props
|
|
106
106
|
});
|
|
@@ -109,7 +109,7 @@ function NavigationMenuViewport({ className, ...props }) {
|
|
|
109
109
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
110
110
|
className: "absolute top-full left-0 z-30 flex justify-center perspective-distant",
|
|
111
111
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Viewport, {
|
|
112
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
112
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full origin-[top_center] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg transition-[width,height] ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-90 sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]", className),
|
|
113
113
|
"data-slot": "navigation-menu-viewport",
|
|
114
114
|
...props
|
|
115
115
|
})
|
|
@@ -117,11 +117,11 @@ function NavigationMenuViewport({ className, ...props }) {
|
|
|
117
117
|
}
|
|
118
118
|
function NavigationMenuIndicator({ className, ...props }) {
|
|
119
119
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Indicator, {
|
|
120
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
120
|
+
className: (0, tailwind_variants_namespaceObject.cn)("top-full z-10 flex h-2 items-center justify-center overflow-hidden ease-ui data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:animate-in data-[state=visible]:fade-in-0", className),
|
|
121
121
|
"data-slot": "navigation-menu-indicator",
|
|
122
122
|
...props,
|
|
123
123
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
124
|
-
className: "
|
|
124
|
+
className: "relative top-[60%] size-2.5 rotate-45 rounded-tl-xs bg-popover text-popover-foreground"
|
|
125
125
|
})
|
|
126
126
|
});
|
|
127
127
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as NavigationMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
3
3
|
declare const navigationMenuTriggerVariants: import("@codefast/tailwind-variants").VariantFunctionType<import("@codefast/tailwind-variants").ConfigurationSchema, Record<string, never>>;
|
|
4
4
|
interface NavigationMenuProps extends ComponentProps<typeof NavigationMenuPrimitive.Root> {
|
|
5
5
|
viewport?: boolean;
|
|
@@ -5,13 +5,13 @@ import { ChevronDownIcon } from "lucide-react";
|
|
|
5
5
|
import { buttonVariants } from "./button.js";
|
|
6
6
|
const navigationMenuTriggerVariants = tv({
|
|
7
7
|
base: buttonVariants({
|
|
8
|
-
className:
|
|
9
|
-
variant:
|
|
8
|
+
className: "data-[state=open]:bg-secondary/50 data-[state=open]:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary",
|
|
9
|
+
variant: "ghost"
|
|
10
10
|
})
|
|
11
11
|
});
|
|
12
12
|
function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
13
13
|
return /*#__PURE__*/ jsxs(Root, {
|
|
14
|
-
className: cn(
|
|
14
|
+
className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
15
15
|
"data-slot": "navigation-menu",
|
|
16
16
|
"data-viewport": viewport,
|
|
17
17
|
...props,
|
|
@@ -23,7 +23,7 @@ function NavigationMenu({ children, className, viewport = true, ...props }) {
|
|
|
23
23
|
}
|
|
24
24
|
function NavigationMenuList({ children, className, ...props }) {
|
|
25
25
|
return /*#__PURE__*/ jsxs(List, {
|
|
26
|
-
className: cn(
|
|
26
|
+
className: cn("flex flex-1 list-none items-center justify-center gap-1", className),
|
|
27
27
|
"data-slot": "navigation-menu-list",
|
|
28
28
|
...props,
|
|
29
29
|
children: [
|
|
@@ -36,7 +36,7 @@ function NavigationMenuList({ children, className, ...props }) {
|
|
|
36
36
|
}
|
|
37
37
|
function NavigationMenuItem({ className, ...props }) {
|
|
38
38
|
return /*#__PURE__*/ jsx(Item, {
|
|
39
|
-
className: cn(
|
|
39
|
+
className: cn("group-data-[viewport=false]/navigation-menu:relative", className),
|
|
40
40
|
"data-slot": "navigation-menu-item",
|
|
41
41
|
...props
|
|
42
42
|
});
|
|
@@ -59,14 +59,14 @@ function NavigationMenuTrigger({ children, className, ...props }) {
|
|
|
59
59
|
}
|
|
60
60
|
function NavigationMenuContent({ className, ...props }) {
|
|
61
61
|
return /*#__PURE__*/ jsx(Content, {
|
|
62
|
-
className: cn(
|
|
62
|
+
className: cn("top-0 left-0 w-full ease-ui group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-2 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:p-1 group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=true]/navigation-menu:p-2 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in-0 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 md:absolute md:w-auto", className),
|
|
63
63
|
"data-slot": "navigation-menu-content",
|
|
64
64
|
...props
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function NavigationMenuLink({ className, ...props }) {
|
|
68
68
|
return /*#__PURE__*/ jsx(Link, {
|
|
69
|
-
className: cn("
|
|
69
|
+
className: cn("flex flex-col gap-1 rounded-sm p-2 text-sm outline-hidden transition hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
|
|
70
70
|
"data-slot": "navigation-menu-link",
|
|
71
71
|
...props
|
|
72
72
|
});
|
|
@@ -75,7 +75,7 @@ function NavigationMenuViewport({ className, ...props }) {
|
|
|
75
75
|
return /*#__PURE__*/ jsx("div", {
|
|
76
76
|
className: "absolute top-full left-0 z-30 flex justify-center perspective-distant",
|
|
77
77
|
children: /*#__PURE__*/ jsx(Viewport, {
|
|
78
|
-
className: cn(
|
|
78
|
+
className: cn("relative mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full origin-[top_center] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg transition-[width,height] ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-90 sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]", className),
|
|
79
79
|
"data-slot": "navigation-menu-viewport",
|
|
80
80
|
...props
|
|
81
81
|
})
|
|
@@ -83,11 +83,11 @@ function NavigationMenuViewport({ className, ...props }) {
|
|
|
83
83
|
}
|
|
84
84
|
function NavigationMenuIndicator({ className, ...props }) {
|
|
85
85
|
return /*#__PURE__*/ jsx(Indicator, {
|
|
86
|
-
className: cn(
|
|
86
|
+
className: cn("top-full z-10 flex h-2 items-center justify-center overflow-hidden ease-ui data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:animate-in data-[state=visible]:fade-in-0", className),
|
|
87
87
|
"data-slot": "navigation-menu-indicator",
|
|
88
88
|
...props,
|
|
89
89
|
children: /*#__PURE__*/ jsx("div", {
|
|
90
|
-
className: "
|
|
90
|
+
className: "relative top-[60%] size-2.5 rotate-45 rounded-tl-xs bg-popover text-popover-foreground"
|
|
91
91
|
})
|
|
92
92
|
});
|
|
93
93
|
}
|
|
@@ -39,14 +39,14 @@ const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
|
39
39
|
function Pagination({ className, ...props }) {
|
|
40
40
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("nav", {
|
|
41
41
|
"aria-label": "pagination",
|
|
42
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
42
|
+
className: (0, tailwind_variants_namespaceObject.cn)("mx-auto flex w-full justify-center", className),
|
|
43
43
|
"data-slot": "pagination",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function PaginationContent({ className, ...props }) {
|
|
48
48
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
49
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
49
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-row items-center gap-1", className),
|
|
50
50
|
"data-slot": "pagination-content",
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
@@ -57,13 +57,13 @@ function PaginationItem(props) {
|
|
|
57
57
|
...props
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function PaginationLink({ children, className, isActive, size =
|
|
60
|
+
function PaginationLink({ children, className, isActive, size = "icon", ...props }) {
|
|
61
61
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
62
|
-
"aria-current": isActive ?
|
|
62
|
+
"aria-current": isActive ? "page" : void 0,
|
|
63
63
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
64
64
|
className,
|
|
65
65
|
size,
|
|
66
|
-
variant: isActive ?
|
|
66
|
+
variant: isActive ? "outline" : "ghost"
|
|
67
67
|
}),
|
|
68
68
|
"data-slot": "pagination-link",
|
|
69
69
|
...props,
|
|
@@ -103,7 +103,7 @@ function PaginationNext({ ...props }) {
|
|
|
103
103
|
function PaginationEllipsis({ className, ...props }) {
|
|
104
104
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
105
105
|
"aria-hidden": true,
|
|
106
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
106
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex size-10 items-center justify-center", className),
|
|
107
107
|
"data-slot": "pagination-ellipsis",
|
|
108
108
|
...props,
|
|
109
109
|
children: [
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { buttonVariants } from
|
|
4
|
-
type PaginationProps = ComponentProps<
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { buttonVariants } from "./button";
|
|
4
|
+
type PaginationProps = ComponentProps<"nav">;
|
|
5
5
|
declare function Pagination({ className, ...props }: PaginationProps): JSX.Element;
|
|
6
|
-
type PaginationContentProps = ComponentProps<
|
|
6
|
+
type PaginationContentProps = ComponentProps<"ul">;
|
|
7
7
|
declare function PaginationContent({ className, ...props }: PaginationContentProps): JSX.Element;
|
|
8
|
-
type PaginationItemProps = ComponentProps<
|
|
8
|
+
type PaginationItemProps = ComponentProps<"li">;
|
|
9
9
|
declare function PaginationItem(props: PaginationItemProps): JSX.Element;
|
|
10
|
-
interface PaginationLinkProps extends ComponentProps<
|
|
10
|
+
interface PaginationLinkProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
11
11
|
isActive?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare function PaginationLink({ children, className, isActive, size, ...props }: PaginationLinkProps): JSX.Element;
|
|
14
|
-
interface PaginationPreviousProps extends ComponentProps<
|
|
14
|
+
interface PaginationPreviousProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
15
15
|
isActive?: boolean;
|
|
16
16
|
}
|
|
17
17
|
declare function PaginationPrevious({ ...props }: PaginationPreviousProps): JSX.Element;
|
|
18
|
-
interface PaginationNextProps extends ComponentProps<
|
|
18
|
+
interface PaginationNextProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
|
|
19
19
|
isActive?: boolean;
|
|
20
20
|
}
|
|
21
21
|
declare function PaginationNext({ ...props }: PaginationNextProps): JSX.Element;
|
|
22
|
-
type PaginationEllipsisProps = ComponentProps<
|
|
22
|
+
type PaginationEllipsisProps = ComponentProps<"span">;
|
|
23
23
|
declare function PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): JSX.Element;
|
|
24
24
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
|
|
25
25
|
export type { PaginationContentProps, PaginationEllipsisProps, PaginationItemProps, PaginationLinkProps, PaginationNextProps, PaginationPreviousProps, PaginationProps, };
|
|
@@ -5,14 +5,14 @@ import { buttonVariants } from "./button.js";
|
|
|
5
5
|
function Pagination({ className, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ jsx("nav", {
|
|
7
7
|
"aria-label": "pagination",
|
|
8
|
-
className: cn(
|
|
8
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
9
9
|
"data-slot": "pagination",
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function PaginationContent({ className, ...props }) {
|
|
14
14
|
return /*#__PURE__*/ jsx("ul", {
|
|
15
|
-
className: cn(
|
|
15
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
16
16
|
"data-slot": "pagination-content",
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
@@ -23,13 +23,13 @@ function PaginationItem(props) {
|
|
|
23
23
|
...props
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function PaginationLink({ children, className, isActive, size =
|
|
26
|
+
function PaginationLink({ children, className, isActive, size = "icon", ...props }) {
|
|
27
27
|
return /*#__PURE__*/ jsx("a", {
|
|
28
|
-
"aria-current": isActive ?
|
|
28
|
+
"aria-current": isActive ? "page" : void 0,
|
|
29
29
|
className: buttonVariants({
|
|
30
30
|
className,
|
|
31
31
|
size,
|
|
32
|
-
variant: isActive ?
|
|
32
|
+
variant: isActive ? "outline" : "ghost"
|
|
33
33
|
}),
|
|
34
34
|
"data-slot": "pagination-link",
|
|
35
35
|
...props,
|
|
@@ -69,7 +69,7 @@ function PaginationNext({ ...props }) {
|
|
|
69
69
|
function PaginationEllipsis({ className, ...props }) {
|
|
70
70
|
return /*#__PURE__*/ jsxs("span", {
|
|
71
71
|
"aria-hidden": true,
|
|
72
|
-
className: cn(
|
|
72
|
+
className: cn("flex size-10 items-center justify-center", className),
|
|
73
73
|
"data-slot": "pagination-ellipsis",
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
@@ -52,11 +52,11 @@ function PopoverAnchor({ ...props }) {
|
|
|
52
52
|
...props
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function PopoverContent({ align =
|
|
55
|
+
function PopoverContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
56
56
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_popover_namespaceObject.Portal, {
|
|
57
57
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_popover_namespaceObject.Content, {
|
|
58
58
|
align: align,
|
|
59
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
59
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
60
60
|
"data-slot": "popover-content",
|
|
61
61
|
sideOffset: sideOffset,
|
|
62
62
|
...props
|
|
@@ -65,7 +65,7 @@ function PopoverContent({ align = 'center', className, sideOffset = 4, ...props
|
|
|
65
65
|
}
|
|
66
66
|
function PopoverArrow({ className, ...props }) {
|
|
67
67
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_popover_namespaceObject.Arrow, {
|
|
68
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
68
|
+
className: (0, tailwind_variants_namespaceObject.cn)("fill-popover", className),
|
|
69
69
|
"data-slot": "popover-arrow",
|
|
70
70
|
...props
|
|
71
71
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as PopoverPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
3
|
type PopoverProps = ComponentProps<typeof PopoverPrimitive.Root>;
|
|
4
4
|
declare function Popover({ ...props }: PopoverProps): JSX.Element;
|
|
5
5
|
type PopoverTriggerProps = ComponentProps<typeof PopoverPrimitive.Trigger>;
|
|
@@ -11,4 +11,4 @@ declare function PopoverContent({ align, className, sideOffset, ...props }: Popo
|
|
|
11
11
|
type PopoverArrowProps = ComponentProps<typeof PopoverPrimitive.Arrow>;
|
|
12
12
|
declare function PopoverArrow({ className, ...props }: PopoverArrowProps): JSX.Element;
|
|
13
13
|
export { Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger };
|
|
14
|
-
export type { PopoverAnchorProps, PopoverArrowProps, PopoverContentProps, PopoverProps, PopoverTriggerProps };
|
|
14
|
+
export type { PopoverAnchorProps, PopoverArrowProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, };
|
|
@@ -20,11 +20,11 @@ function PopoverAnchor({ ...props }) {
|
|
|
20
20
|
...props
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function PopoverContent({ align =
|
|
23
|
+
function PopoverContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
24
24
|
return /*#__PURE__*/ jsx(Portal, {
|
|
25
25
|
children: /*#__PURE__*/ jsx(Content, {
|
|
26
26
|
align: align,
|
|
27
|
-
className: cn(
|
|
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
28
|
"data-slot": "popover-content",
|
|
29
29
|
sideOffset: sideOffset,
|
|
30
30
|
...props
|
|
@@ -33,7 +33,7 @@ function PopoverContent({ align = 'center', className, sideOffset = 4, ...props
|
|
|
33
33
|
}
|
|
34
34
|
function PopoverArrow({ className, ...props }) {
|
|
35
35
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
36
|
-
className: cn(
|
|
36
|
+
className: cn("fill-popover", className),
|
|
37
37
|
"data-slot": "popover-arrow",
|
|
38
38
|
...props
|
|
39
39
|
});
|
|
@@ -35,33 +35,33 @@ const use_animated_value_cjs_namespaceObject = require("../hooks/use-animated-va
|
|
|
35
35
|
const progress_circle_cjs_namespaceObject = require("../primitives/progress-circle.cjs");
|
|
36
36
|
const progressCircleVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
size:
|
|
39
|
-
thickness:
|
|
40
|
-
variant:
|
|
38
|
+
size: "md",
|
|
39
|
+
thickness: "regular",
|
|
40
|
+
variant: "default"
|
|
41
41
|
},
|
|
42
42
|
slots: {
|
|
43
|
-
indicator:
|
|
44
|
-
label:
|
|
45
|
-
root:
|
|
46
|
-
svg:
|
|
47
|
-
track:
|
|
43
|
+
indicator: "origin-center",
|
|
44
|
+
label: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
45
|
+
root: "relative inline-flex items-center justify-center",
|
|
46
|
+
svg: "size-full",
|
|
47
|
+
track: "origin-center"
|
|
48
48
|
},
|
|
49
49
|
variants: {
|
|
50
50
|
size: {
|
|
51
51
|
sm: {
|
|
52
|
-
label:
|
|
52
|
+
label: "text-[0.625rem]"
|
|
53
53
|
},
|
|
54
54
|
md: {
|
|
55
|
-
label:
|
|
55
|
+
label: "text-xs"
|
|
56
56
|
},
|
|
57
57
|
lg: {
|
|
58
|
-
label:
|
|
58
|
+
label: "text-sm"
|
|
59
59
|
},
|
|
60
60
|
xl: {
|
|
61
|
-
label:
|
|
61
|
+
label: "text-base"
|
|
62
62
|
},
|
|
63
|
-
|
|
64
|
-
label:
|
|
63
|
+
"2xl": {
|
|
64
|
+
label: "text-lg"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
thickness: {
|
|
@@ -71,17 +71,17 @@ const progressCircleVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
|
71
71
|
},
|
|
72
72
|
variant: {
|
|
73
73
|
default: {
|
|
74
|
-
indicator:
|
|
75
|
-
track:
|
|
74
|
+
indicator: "text-primary",
|
|
75
|
+
track: "text-primary/20"
|
|
76
76
|
},
|
|
77
77
|
destructive: {
|
|
78
|
-
indicator:
|
|
79
|
-
track:
|
|
78
|
+
indicator: "text-destructive",
|
|
79
|
+
track: "text-destructive/20"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness =
|
|
84
|
+
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
85
85
|
const displayValue = (0, use_animated_value_cjs_namespaceObject.useAnimatedValue)(value, animationDuration, animate);
|
|
86
86
|
const actualSize = (0, external_react_namespaceObject.useMemo)(()=>sizeInPixels ?? getActualSize(size), [
|
|
87
87
|
sizeInPixels,
|
|
@@ -140,7 +140,7 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
140
140
|
}),
|
|
141
141
|
style: {
|
|
142
142
|
transitionDuration: `${animationDuration.toString()}ms`,
|
|
143
|
-
transitionProperty:
|
|
143
|
+
transitionProperty: "stroke-dashoffset"
|
|
144
144
|
}
|
|
145
145
|
})
|
|
146
146
|
]
|
|
@@ -155,10 +155,10 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
155
155
|
})
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
ProgressCircle.displayName =
|
|
158
|
+
ProgressCircle.displayName = "ProgressCircle";
|
|
159
159
|
const getActualSize = (size)=>{
|
|
160
160
|
const sizeMap = {
|
|
161
|
-
|
|
161
|
+
"2xl": 128,
|
|
162
162
|
lg: 64,
|
|
163
163
|
md: 48,
|
|
164
164
|
sm: 32,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as ProgressCirclePrimitive from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as ProgressCirclePrimitive from "../primitives/progress-circle";
|
|
4
4
|
declare const progressCircleVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
size: {
|
|
6
6
|
sm: {
|
|
@@ -15,7 +15,7 @@ declare const progressCircleVariants: import("@codefast/tailwind-variants").Vari
|
|
|
15
15
|
xl: {
|
|
16
16
|
label: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
"2xl": {
|
|
19
19
|
label: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -41,7 +41,7 @@ declare const progressCircleVariants: import("@codefast/tailwind-variants").Vari
|
|
|
41
41
|
svg: string;
|
|
42
42
|
track: string;
|
|
43
43
|
}>;
|
|
44
|
-
interface ProgressCircleProps extends Omit<ComponentProps<typeof ProgressCirclePrimitive.Provider>,
|
|
44
|
+
interface ProgressCircleProps extends Omit<ComponentProps<typeof ProgressCirclePrimitive.Provider>, "children" | "size">, VariantProps<typeof progressCircleVariants> {
|
|
45
45
|
/**
|
|
46
46
|
* Enables animation effect when value changes
|
|
47
47
|
*/
|
|
@@ -6,33 +6,33 @@ import { useAnimatedValue } from "../hooks/use-animated-value.js";
|
|
|
6
6
|
import { Indicator, Provider, Root, SVG, Track, Value } from "../primitives/progress-circle.js";
|
|
7
7
|
const progressCircleVariants = tv({
|
|
8
8
|
defaultVariants: {
|
|
9
|
-
size:
|
|
10
|
-
thickness:
|
|
11
|
-
variant:
|
|
9
|
+
size: "md",
|
|
10
|
+
thickness: "regular",
|
|
11
|
+
variant: "default"
|
|
12
12
|
},
|
|
13
13
|
slots: {
|
|
14
|
-
indicator:
|
|
15
|
-
label:
|
|
16
|
-
root:
|
|
17
|
-
svg:
|
|
18
|
-
track:
|
|
14
|
+
indicator: "origin-center",
|
|
15
|
+
label: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
16
|
+
root: "relative inline-flex items-center justify-center",
|
|
17
|
+
svg: "size-full",
|
|
18
|
+
track: "origin-center"
|
|
19
19
|
},
|
|
20
20
|
variants: {
|
|
21
21
|
size: {
|
|
22
22
|
sm: {
|
|
23
|
-
label:
|
|
23
|
+
label: "text-[0.625rem]"
|
|
24
24
|
},
|
|
25
25
|
md: {
|
|
26
|
-
label:
|
|
26
|
+
label: "text-xs"
|
|
27
27
|
},
|
|
28
28
|
lg: {
|
|
29
|
-
label:
|
|
29
|
+
label: "text-sm"
|
|
30
30
|
},
|
|
31
31
|
xl: {
|
|
32
|
-
label:
|
|
32
|
+
label: "text-base"
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
label:
|
|
34
|
+
"2xl": {
|
|
35
|
+
label: "text-lg"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
thickness: {
|
|
@@ -42,17 +42,17 @@ const progressCircleVariants = tv({
|
|
|
42
42
|
},
|
|
43
43
|
variant: {
|
|
44
44
|
default: {
|
|
45
|
-
indicator:
|
|
46
|
-
track:
|
|
45
|
+
indicator: "text-primary",
|
|
46
|
+
track: "text-primary/20"
|
|
47
47
|
},
|
|
48
48
|
destructive: {
|
|
49
|
-
indicator:
|
|
50
|
-
track:
|
|
49
|
+
indicator: "text-destructive",
|
|
50
|
+
track: "text-destructive/20"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness =
|
|
55
|
+
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
56
56
|
const displayValue = useAnimatedValue(value, animationDuration, animate);
|
|
57
57
|
const actualSize = useMemo(()=>sizeInPixels ?? getActualSize(size), [
|
|
58
58
|
sizeInPixels,
|
|
@@ -111,7 +111,7 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
111
111
|
}),
|
|
112
112
|
style: {
|
|
113
113
|
transitionDuration: `${animationDuration.toString()}ms`,
|
|
114
|
-
transitionProperty:
|
|
114
|
+
transitionProperty: "stroke-dashoffset"
|
|
115
115
|
}
|
|
116
116
|
})
|
|
117
117
|
]
|
|
@@ -126,10 +126,10 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
126
126
|
})
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
ProgressCircle.displayName =
|
|
129
|
+
ProgressCircle.displayName = "ProgressCircle";
|
|
130
130
|
const getActualSize = (size)=>{
|
|
131
131
|
const sizeMap = {
|
|
132
|
-
|
|
132
|
+
"2xl": 128,
|
|
133
133
|
lg: 64,
|
|
134
134
|
md: 48,
|
|
135
135
|
sm: 32,
|
|
@@ -32,11 +32,11 @@ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants")
|
|
|
32
32
|
const react_progress_namespaceObject = require("@radix-ui/react-progress");
|
|
33
33
|
function Progress({ className, value, ...props }) {
|
|
34
34
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Root, {
|
|
35
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
35
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
|
|
36
36
|
"data-slot": "progress",
|
|
37
37
|
...props,
|
|
38
38
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Indicator, {
|
|
39
|
-
className: "
|
|
39
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
40
40
|
"data-slot": "progress-indicator",
|
|
41
41
|
style: {
|
|
42
42
|
transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as ProgressPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
3
|
type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
|
|
4
4
|
declare function Progress({ className, value, ...props }: ProgressProps): JSX.Element;
|
|
5
5
|
export { Progress };
|