@alpic-ai/ui 0.0.0-dev.g378c8b6 → 0.0.0-dev.g380fab7
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/dist/components/accordion-card.d.mts +5 -5
- package/dist/components/accordion.d.mts +5 -5
- package/dist/components/alert.d.mts +8 -8
- package/dist/components/area-chart.d.mts +62 -0
- package/dist/components/area-chart.mjs +269 -0
- package/dist/components/attachment-tile.d.mts +1 -1
- package/dist/components/avatar.d.mts +7 -7
- package/dist/components/badge.d.mts +1 -1
- package/dist/components/bar-chart.d.mts +48 -0
- package/dist/components/bar-chart.mjs +245 -0
- package/dist/components/bar-list.d.mts +28 -0
- package/dist/components/bar-list.mjs +98 -0
- package/dist/components/breadcrumb.d.mts +10 -10
- package/dist/components/button.d.mts +5 -5
- package/dist/components/card.d.mts +9 -9
- package/dist/components/chart-card.d.mts +25 -0
- package/dist/components/chart-card.mjs +48 -0
- package/dist/components/chart-container.d.mts +20 -0
- package/dist/components/chart-container.mjs +37 -0
- package/dist/components/chart-legend.d.mts +16 -0
- package/dist/components/chart-legend.mjs +26 -0
- package/dist/components/chart-tooltip.d.mts +33 -0
- package/dist/components/chart-tooltip.mjs +52 -0
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/collapsible.d.mts +4 -4
- package/dist/components/combobox.d.mts +10 -10
- package/dist/components/command.d.mts +9 -9
- package/dist/components/copyable.d.mts +2 -2
- package/dist/components/description-list.d.mts +5 -5
- package/dist/components/dialog.d.mts +13 -13
- package/dist/components/donut-chart.d.mts +46 -0
- package/dist/components/donut-chart.mjs +185 -0
- package/dist/components/dropdown-menu.d.mts +17 -17
- package/dist/components/form.d.mts +18 -18
- package/dist/components/form.mjs +6 -6
- package/dist/components/github-button.d.mts +1 -1
- package/dist/components/grid-fx.d.mts +13 -0
- package/dist/components/grid-fx.mjs +188 -0
- package/dist/components/heatmap-chart.d.mts +40 -0
- package/dist/components/heatmap-chart.mjs +198 -0
- package/dist/components/input-group.d.mts +4 -4
- package/dist/components/input.d.mts +4 -4
- package/dist/components/input.mjs +2 -2
- package/dist/components/label.d.mts +2 -2
- package/dist/components/line-chart.d.mts +55 -0
- package/dist/components/line-chart.mjs +211 -0
- package/dist/components/page-loader.d.mts +1 -1
- package/dist/components/pagination.d.mts +3 -3
- package/dist/components/popover.d.mts +5 -5
- package/dist/components/radio-group.d.mts +3 -3
- package/dist/components/scroll-area.d.mts +3 -3
- package/dist/components/select.d.mts +9 -9
- package/dist/components/separator.d.mts +2 -2
- package/dist/components/sheet.d.mts +11 -11
- package/dist/components/shimmer-text.d.mts +3 -1
- package/dist/components/sidebar.d.mts +33 -33
- package/dist/components/sidebar.mjs +10 -10
- package/dist/components/skeleton.d.mts +1 -1
- package/dist/components/sonner.d.mts +5 -5
- package/dist/components/spinner.d.mts +2 -2
- package/dist/components/stat.d.mts +30 -0
- package/dist/components/stat.mjs +107 -0
- package/dist/components/status-dot.d.mts +1 -1
- package/dist/components/switch.d.mts +2 -2
- package/dist/components/table.d.mts +10 -10
- package/dist/components/tabs.d.mts +10 -10
- package/dist/components/tag.d.mts +3 -3
- package/dist/components/task-progress.d.mts +1 -1
- package/dist/components/textarea.d.mts +3 -3
- package/dist/components/textarea.mjs +2 -2
- package/dist/components/toggle-group.d.mts +3 -3
- package/dist/components/toggle-group.mjs +3 -3
- package/dist/components/tooltip.d.mts +5 -5
- package/dist/components/typography.d.mts +4 -4
- package/dist/components/wizard.d.mts +4 -4
- package/dist/hooks/use-chart-theme.d.mts +18 -0
- package/dist/hooks/use-chart-theme.mjs +57 -0
- package/dist/hooks/use-mobile.mjs +3 -3
- package/dist/hooks/use-reduced-motion.d.mts +4 -0
- package/dist/hooks/use-reduced-motion.mjs +16 -0
- package/dist/lib/chart-palette.d.mts +4 -0
- package/dist/lib/chart-palette.mjs +95 -0
- package/dist/lib/chart.d.mts +14 -0
- package/dist/lib/chart.mjs +27 -0
- package/package.json +30 -29
- package/src/components/area-chart.tsx +339 -0
- package/src/components/bar-chart.tsx +300 -0
- package/src/components/bar-list.tsx +150 -0
- package/src/components/chart-card.tsx +63 -0
- package/src/components/chart-container.tsx +49 -0
- package/src/components/chart-legend.tsx +41 -0
- package/src/components/chart-tooltip.tsx +93 -0
- package/src/components/donut-chart.tsx +217 -0
- package/src/components/grid-fx.tsx +238 -0
- package/src/components/heatmap-chart.tsx +287 -0
- package/src/components/line-chart.tsx +264 -0
- package/src/components/stat.tsx +109 -0
- package/src/hooks/use-chart-theme.ts +75 -0
- package/src/hooks/use-reduced-motion.ts +17 -0
- package/src/lib/chart-palette.ts +110 -0
- package/src/lib/chart.ts +56 -0
- package/src/stories/area-chart.stories.tsx +200 -0
- package/src/stories/bar-chart.stories.tsx +169 -0
- package/src/stories/bar-list.stories.tsx +85 -0
- package/src/stories/donut-chart.stories.tsx +112 -0
- package/src/stories/heatmap-chart.stories.tsx +107 -0
- package/src/stories/line-chart.stories.tsx +146 -0
- package/src/stories/stat.stories.tsx +64 -0
- package/src/styles/tokens.css +63 -0
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/select.d.ts
|
|
7
7
|
declare function Select({
|
|
8
8
|
...props
|
|
9
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>):
|
|
9
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Root>): React$1.JSX.Element;
|
|
10
10
|
declare function SelectGroup({
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>):
|
|
12
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Group>): React$1.JSX.Element;
|
|
13
13
|
declare function SelectValue({
|
|
14
14
|
...props
|
|
15
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>):
|
|
15
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Value>): React$1.JSX.Element;
|
|
16
16
|
declare function SelectTrigger({
|
|
17
17
|
className,
|
|
18
18
|
size,
|
|
19
19
|
children,
|
|
20
20
|
...props
|
|
21
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & VariantProps<typeof selectTriggerVariants>):
|
|
21
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Trigger> & VariantProps<typeof selectTriggerVariants>): React$1.JSX.Element;
|
|
22
22
|
declare function SelectContent({
|
|
23
23
|
className,
|
|
24
24
|
children,
|
|
25
25
|
position,
|
|
26
26
|
...props
|
|
27
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>):
|
|
27
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Content>): React$1.JSX.Element;
|
|
28
28
|
declare function SelectLabel({
|
|
29
29
|
className,
|
|
30
30
|
...props
|
|
31
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>):
|
|
31
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Label>): React$1.JSX.Element;
|
|
32
32
|
declare function SelectItem({
|
|
33
33
|
className,
|
|
34
34
|
children,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>):
|
|
36
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Item>): React$1.JSX.Element;
|
|
37
37
|
declare function SelectSeparator({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>):
|
|
40
|
+
}: React$1.ComponentProps<typeof SelectPrimitive.Separator>): React$1.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, selectTriggerVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
@@ -7,6 +7,6 @@ declare function Separator({
|
|
|
7
7
|
orientation,
|
|
8
8
|
decorative,
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>):
|
|
10
|
+
}: React$1.ComponentProps<typeof SeparatorPrimitive.Root>): React$1.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Separator };
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sheet.d.ts
|
|
5
5
|
declare function Sheet({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof SheetPrimitive.Root>):
|
|
7
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Root>): React$1.JSX.Element;
|
|
8
8
|
declare function SheetTrigger({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>):
|
|
10
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Trigger>): React$1.JSX.Element;
|
|
11
11
|
declare function SheetClose({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>):
|
|
13
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Close>): React$1.JSX.Element;
|
|
14
14
|
declare function SheetPortal({
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>):
|
|
16
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Portal>): React$1.JSX.Element;
|
|
17
17
|
declare function SheetContent({
|
|
18
18
|
className,
|
|
19
19
|
children,
|
|
20
20
|
side,
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
22
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
23
23
|
side?: "top" | "right" | "bottom" | "left";
|
|
24
|
-
}):
|
|
24
|
+
}): React$1.JSX.Element;
|
|
25
25
|
declare function SheetHeader({
|
|
26
26
|
className,
|
|
27
27
|
...props
|
|
28
|
-
}: React.ComponentProps<"div">):
|
|
28
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
29
29
|
declare function SheetFooter({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<"div">):
|
|
32
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
33
33
|
declare function SheetTitle({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>):
|
|
36
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Title>): React$1.JSX.Element;
|
|
37
37
|
declare function SheetDescription({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof SheetPrimitive.Description>):
|
|
40
|
+
}: React$1.ComponentProps<typeof SheetPrimitive.Description>): React$1.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
1
3
|
//#region src/components/shimmer-text.d.ts
|
|
2
4
|
declare function ShimmerText({
|
|
3
5
|
children,
|
|
@@ -5,6 +7,6 @@ declare function ShimmerText({
|
|
|
5
7
|
}: {
|
|
6
8
|
children: string | number;
|
|
7
9
|
className?: string;
|
|
8
|
-
}):
|
|
10
|
+
}): React.JSX.Element;
|
|
9
11
|
//#endregion
|
|
10
12
|
export { ShimmerText };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "./button.mjs";
|
|
2
2
|
import { TooltipContent } from "./tooltip.mjs";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
-
import * as React from "react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/sidebar.d.ts
|
|
7
7
|
type SidebarContextProps = {
|
|
@@ -22,11 +22,11 @@ declare function SidebarProvider({
|
|
|
22
22
|
style,
|
|
23
23
|
children,
|
|
24
24
|
...props
|
|
25
|
-
}: React.ComponentProps<"div"> & {
|
|
25
|
+
}: React$1.ComponentProps<"div"> & {
|
|
26
26
|
defaultOpen?: boolean;
|
|
27
27
|
open?: boolean;
|
|
28
28
|
onOpenChange?: (open: boolean) => void;
|
|
29
|
-
}):
|
|
29
|
+
}): React$1.JSX.Element;
|
|
30
30
|
declare function Sidebar({
|
|
31
31
|
side,
|
|
32
32
|
variant,
|
|
@@ -34,26 +34,26 @@ declare function Sidebar({
|
|
|
34
34
|
className,
|
|
35
35
|
children,
|
|
36
36
|
...props
|
|
37
|
-
}: React.ComponentProps<"div"> & {
|
|
37
|
+
}: React$1.ComponentProps<"div"> & {
|
|
38
38
|
side?: "left" | "right";
|
|
39
39
|
variant?: "sidebar" | "floating" | "inset";
|
|
40
40
|
collapsible?: "offcanvas" | "icon" | "none";
|
|
41
|
-
}):
|
|
41
|
+
}): React$1.JSX.Element;
|
|
42
42
|
declare function SidebarTrigger({
|
|
43
43
|
className,
|
|
44
44
|
onClick,
|
|
45
45
|
...props
|
|
46
|
-
}: React.ComponentProps<typeof Button>):
|
|
46
|
+
}: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
47
47
|
declare function SidebarRail({
|
|
48
48
|
className,
|
|
49
49
|
...props
|
|
50
|
-
}: React.ComponentProps<"button">):
|
|
50
|
+
}: React$1.ComponentProps<"button">): React$1.JSX.Element;
|
|
51
51
|
declare function SidebarInset({
|
|
52
52
|
className,
|
|
53
53
|
...props
|
|
54
|
-
}: React.ComponentProps<"main">):
|
|
55
|
-
interface SidebarHeaderProps extends React.ComponentProps<"div"> {
|
|
56
|
-
icon?: React.ReactNode;
|
|
54
|
+
}: React$1.ComponentProps<"main">): React$1.JSX.Element;
|
|
55
|
+
interface SidebarHeaderProps extends React$1.ComponentProps<"div"> {
|
|
56
|
+
icon?: React$1.ReactNode;
|
|
57
57
|
title?: string;
|
|
58
58
|
}
|
|
59
59
|
declare function SidebarHeader({
|
|
@@ -62,48 +62,48 @@ declare function SidebarHeader({
|
|
|
62
62
|
title,
|
|
63
63
|
children,
|
|
64
64
|
...props
|
|
65
|
-
}: SidebarHeaderProps):
|
|
65
|
+
}: SidebarHeaderProps): React$1.JSX.Element;
|
|
66
66
|
declare function SidebarFooter({
|
|
67
67
|
className,
|
|
68
68
|
...props
|
|
69
|
-
}: React.ComponentProps<"div">):
|
|
69
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
70
70
|
declare function SidebarSeparator({
|
|
71
71
|
className
|
|
72
|
-
}: React.ComponentProps<"div">):
|
|
72
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
73
73
|
declare function SidebarContent({
|
|
74
74
|
className,
|
|
75
75
|
...props
|
|
76
|
-
}: React.ComponentProps<"div">):
|
|
76
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
77
77
|
declare function SidebarGroup({
|
|
78
78
|
className,
|
|
79
79
|
...props
|
|
80
|
-
}: React.ComponentProps<"div">):
|
|
80
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
81
81
|
declare function SidebarGroupLabel({
|
|
82
82
|
className,
|
|
83
83
|
asChild,
|
|
84
84
|
...props
|
|
85
|
-
}: React.ComponentProps<"div"> & {
|
|
85
|
+
}: React$1.ComponentProps<"div"> & {
|
|
86
86
|
asChild?: boolean;
|
|
87
|
-
}):
|
|
87
|
+
}): React$1.JSX.Element;
|
|
88
88
|
declare function SidebarGroupAction({
|
|
89
89
|
className,
|
|
90
90
|
asChild,
|
|
91
91
|
...props
|
|
92
|
-
}: React.ComponentProps<"button"> & {
|
|
92
|
+
}: React$1.ComponentProps<"button"> & {
|
|
93
93
|
asChild?: boolean;
|
|
94
|
-
}):
|
|
94
|
+
}): React$1.JSX.Element;
|
|
95
95
|
declare function SidebarGroupContent({
|
|
96
96
|
className,
|
|
97
97
|
...props
|
|
98
|
-
}: React.ComponentProps<"div">):
|
|
98
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
99
99
|
declare function SidebarMenu({
|
|
100
100
|
className,
|
|
101
101
|
...props
|
|
102
|
-
}: React.ComponentProps<"ul">):
|
|
102
|
+
}: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
103
103
|
declare function SidebarMenuItem({
|
|
104
104
|
className,
|
|
105
105
|
...props
|
|
106
|
-
}: React.ComponentProps<"li">):
|
|
106
|
+
}: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
107
107
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
108
108
|
variant?: "default" | "outline" | null | undefined;
|
|
109
109
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
@@ -116,46 +116,46 @@ declare function SidebarMenuButton({
|
|
|
116
116
|
tooltip,
|
|
117
117
|
className,
|
|
118
118
|
...props
|
|
119
|
-
}: React.ComponentProps<"button"> & {
|
|
119
|
+
}: React$1.ComponentProps<"button"> & {
|
|
120
120
|
asChild?: boolean;
|
|
121
121
|
isActive?: boolean;
|
|
122
|
-
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
123
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
122
|
+
tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
|
|
123
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): React$1.JSX.Element;
|
|
124
124
|
declare function SidebarMenuAction({
|
|
125
125
|
className,
|
|
126
126
|
asChild,
|
|
127
127
|
showOnHover,
|
|
128
128
|
...props
|
|
129
|
-
}: React.ComponentProps<"button"> & {
|
|
129
|
+
}: React$1.ComponentProps<"button"> & {
|
|
130
130
|
asChild?: boolean;
|
|
131
131
|
showOnHover?: boolean;
|
|
132
|
-
}):
|
|
132
|
+
}): React$1.JSX.Element;
|
|
133
133
|
declare function SidebarMenuBadge({
|
|
134
134
|
className,
|
|
135
135
|
...props
|
|
136
|
-
}: React.ComponentProps<"div">):
|
|
136
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
137
137
|
declare function SidebarMenuSkeleton({
|
|
138
138
|
className,
|
|
139
139
|
...props
|
|
140
|
-
}: React.ComponentProps<"div">):
|
|
140
|
+
}: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
141
141
|
declare function SidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<"ul">):
|
|
144
|
+
}: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
145
145
|
declare function SidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<"li">):
|
|
148
|
+
}: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
149
149
|
declare function SidebarMenuSubButton({
|
|
150
150
|
asChild,
|
|
151
151
|
size,
|
|
152
152
|
isActive,
|
|
153
153
|
className,
|
|
154
154
|
...props
|
|
155
|
-
}: React.ComponentProps<"a"> & {
|
|
155
|
+
}: React$1.ComponentProps<"a"> & {
|
|
156
156
|
asChild?: boolean;
|
|
157
157
|
size?: "sm" | "md";
|
|
158
158
|
isActive?: boolean;
|
|
159
|
-
}):
|
|
159
|
+
}): React$1.JSX.Element;
|
|
160
160
|
//#endregion
|
|
161
161
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, sidebarMenuButtonVariants, useSidebar };
|
|
@@ -8,7 +8,7 @@ import { useIsMobile } from "../hooks/use-mobile.mjs";
|
|
|
8
8
|
import { Skeleton } from "./skeleton.mjs";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
11
|
-
import * as React from "react";
|
|
11
|
+
import * as React$1 from "react";
|
|
12
12
|
import { Slot } from "@radix-ui/react-slot";
|
|
13
13
|
//#region src/components/sidebar.tsx
|
|
14
14
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
@@ -29,27 +29,27 @@ const INTERACTIVE_SIDEBAR_ELEMENT_SELECTOR = [
|
|
|
29
29
|
"[contenteditable='true']",
|
|
30
30
|
"[tabindex]:not([tabindex='-1'])"
|
|
31
31
|
].join(", ");
|
|
32
|
-
const SidebarContext = React.createContext(null);
|
|
32
|
+
const SidebarContext = React$1.createContext(null);
|
|
33
33
|
function useSidebar() {
|
|
34
|
-
const context = React.useContext(SidebarContext);
|
|
34
|
+
const context = React$1.useContext(SidebarContext);
|
|
35
35
|
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
36
36
|
return context;
|
|
37
37
|
}
|
|
38
38
|
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
39
39
|
const isMobile = useIsMobile();
|
|
40
|
-
const [openMobile, setOpenMobile] = React.useState(false);
|
|
41
|
-
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
40
|
+
const [openMobile, setOpenMobile] = React$1.useState(false);
|
|
41
|
+
const [_open, _setOpen] = React$1.useState(defaultOpen);
|
|
42
42
|
const open = openProp ?? _open;
|
|
43
|
-
const setOpen = React.useCallback((value) => {
|
|
43
|
+
const setOpen = React$1.useCallback((value) => {
|
|
44
44
|
const openState = typeof value === "function" ? value(open) : value;
|
|
45
45
|
if (setOpenProp) setOpenProp(openState);
|
|
46
46
|
else _setOpen(openState);
|
|
47
47
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
48
48
|
}, [setOpenProp, open]);
|
|
49
|
-
const toggleSidebar = React.useCallback(() => {
|
|
49
|
+
const toggleSidebar = React$1.useCallback(() => {
|
|
50
50
|
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
51
51
|
}, [isMobile, setOpen]);
|
|
52
|
-
React.useEffect(() => {
|
|
52
|
+
React$1.useEffect(() => {
|
|
53
53
|
const handleKeyDown = (event) => {
|
|
54
54
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
55
55
|
event.preventDefault();
|
|
@@ -60,7 +60,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
60
60
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
61
61
|
}, [toggleSidebar]);
|
|
62
62
|
const state = open ? "expanded" : "collapsed";
|
|
63
|
-
const contextValue = React.useMemo(() => ({
|
|
63
|
+
const contextValue = React$1.useMemo(() => ({
|
|
64
64
|
state,
|
|
65
65
|
open,
|
|
66
66
|
setOpen,
|
|
@@ -380,7 +380,7 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
function SidebarMenuSkeleton({ className, ...props }) {
|
|
383
|
-
const [width] = React.useState(() => `${Math.floor(Math.random() * 40) + 50}%`);
|
|
383
|
+
const [width] = React$1.useState(() => `${Math.floor(Math.random() * 40) + 50}%`);
|
|
384
384
|
return /* @__PURE__ */ jsx("div", {
|
|
385
385
|
"data-slot": "sidebar-menu-skeleton",
|
|
386
386
|
"data-sidebar": "menu-skeleton",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import { Toaster as Toaster$1, toast } from "sonner";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sonner.d.ts
|
|
5
|
-
type ToasterProps = React.ComponentProps<typeof Toaster$1>;
|
|
6
|
-
declare function Toaster(props: ToasterProps):
|
|
5
|
+
type ToasterProps = React$1.ComponentProps<typeof Toaster$1>;
|
|
6
|
+
declare function Toaster(props: ToasterProps): React$1.JSX.Element;
|
|
7
7
|
interface ActionToastProps {
|
|
8
8
|
toastId: string | number;
|
|
9
9
|
title: string;
|
|
@@ -11,7 +11,7 @@ interface ActionToastProps {
|
|
|
11
11
|
onDismiss?: () => void;
|
|
12
12
|
confirm: {
|
|
13
13
|
label: string;
|
|
14
|
-
icon?: React.ReactNode;
|
|
14
|
+
icon?: React$1.ReactNode;
|
|
15
15
|
onClick: () => void;
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
disabled?: boolean;
|
|
@@ -23,6 +23,6 @@ declare function ActionToast({
|
|
|
23
23
|
description,
|
|
24
24
|
onDismiss,
|
|
25
25
|
confirm
|
|
26
|
-
}: ActionToastProps):
|
|
26
|
+
}: ActionToastProps): React$1.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { ActionToast, type ActionToastProps, Toaster, type ToasterProps, toast };
|
|
@@ -11,7 +11,7 @@ declare function Spinner({
|
|
|
11
11
|
variant,
|
|
12
12
|
size,
|
|
13
13
|
...props
|
|
14
|
-
}: SpinnerProps): import("react
|
|
14
|
+
}: SpinnerProps): import("react").JSX.Element;
|
|
15
15
|
interface SpinnerBlockProps extends VariantProps<typeof spinnerVariants> {
|
|
16
16
|
className?: string;
|
|
17
17
|
fullscreen?: boolean;
|
|
@@ -23,6 +23,6 @@ declare function SpinnerBlock({
|
|
|
23
23
|
size,
|
|
24
24
|
fullscreen,
|
|
25
25
|
withLabel
|
|
26
|
-
}: SpinnerBlockProps): import("react
|
|
26
|
+
}: SpinnerBlockProps): import("react").JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Spinner, SpinnerBlock, type SpinnerBlockProps, type SpinnerProps, spinnerVariants };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/stat.d.ts
|
|
4
|
+
declare const statDeltaVariants: (props?: ({
|
|
5
|
+
sentiment?: "positive" | "negative" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
interface StatDelta {
|
|
8
|
+
value: number;
|
|
9
|
+
direction: "up" | "down";
|
|
10
|
+
invert?: boolean;
|
|
11
|
+
label?: React$1.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface StatProps extends React$1.ComponentProps<"div"> {
|
|
14
|
+
value: React$1.ReactNode;
|
|
15
|
+
unit?: string;
|
|
16
|
+
delta?: StatDelta;
|
|
17
|
+
sparkline?: number[] | Array<{
|
|
18
|
+
value: number;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
declare function Stat({
|
|
22
|
+
value,
|
|
23
|
+
unit,
|
|
24
|
+
delta,
|
|
25
|
+
sparkline,
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: StatProps): React$1.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Stat, StatDelta, StatProps, statDeltaVariants };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { useChartContext } from "./chart-container.mjs";
|
|
4
|
+
import { ArrowDown, ArrowUp } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { Area, AreaChart, ResponsiveContainer } from "recharts";
|
|
9
|
+
//#region src/components/stat.tsx
|
|
10
|
+
const statDeltaVariants = cva("inline-flex items-center gap-0.5 rounded-md px-1.5 py-0.5 font-mono text-[11px] font-medium leading-none", {
|
|
11
|
+
variants: { sentiment: {
|
|
12
|
+
positive: "text-success bg-success/12",
|
|
13
|
+
negative: "text-destructive bg-destructive/12"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { sentiment: "positive" }
|
|
16
|
+
});
|
|
17
|
+
const toSparkData = (sparkline) => (sparkline ?? []).map((point, index) => typeof point === "number" ? {
|
|
18
|
+
index,
|
|
19
|
+
value: point
|
|
20
|
+
} : {
|
|
21
|
+
index,
|
|
22
|
+
value: point.value
|
|
23
|
+
});
|
|
24
|
+
function Stat({ value, unit, delta, sparkline, className, ...props }) {
|
|
25
|
+
const { palette } = useChartContext();
|
|
26
|
+
const gradientId = React$1.useId().replace(/:/g, "");
|
|
27
|
+
const sparkData = React$1.useMemo(() => toSparkData(sparkline), [sparkline]);
|
|
28
|
+
const sparkColor = palette[0];
|
|
29
|
+
const sentiment = delta && (delta.invert ? delta.direction === "down" : delta.direction === "up") ? "positive" : "negative";
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
"data-slot": "stat",
|
|
32
|
+
className: cn("flex flex-col gap-2.5", className),
|
|
33
|
+
...props,
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "flex items-baseline gap-3",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "type-display-sm font-bold leading-none tracking-tight tabular-nums text-foreground",
|
|
39
|
+
children: value
|
|
40
|
+
}),
|
|
41
|
+
unit && /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "font-mono text-[11px] leading-none text-quaternary-foreground mb-0.5",
|
|
43
|
+
children: unit
|
|
44
|
+
}),
|
|
45
|
+
delta && /* @__PURE__ */ jsxs(DeltaPill, {
|
|
46
|
+
sentiment,
|
|
47
|
+
className: "mb-0.5",
|
|
48
|
+
children: [delta.direction === "up" ? /* @__PURE__ */ jsx(ArrowUp, { className: "size-3" }) : /* @__PURE__ */ jsx(ArrowDown, { className: "size-3" }), delta.label ?? `${delta.value}%`]
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}), sparkData.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "h-9 w-full",
|
|
53
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
54
|
+
width: "100%",
|
|
55
|
+
height: "100%",
|
|
56
|
+
children: /* @__PURE__ */ jsxs(AreaChart, {
|
|
57
|
+
data: sparkData,
|
|
58
|
+
margin: {
|
|
59
|
+
top: 4,
|
|
60
|
+
right: 2,
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 2
|
|
63
|
+
},
|
|
64
|
+
children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
65
|
+
id: gradientId,
|
|
66
|
+
x1: "0",
|
|
67
|
+
y1: "0",
|
|
68
|
+
x2: "0",
|
|
69
|
+
y2: "1",
|
|
70
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
71
|
+
offset: "0%",
|
|
72
|
+
stopColor: sparkColor,
|
|
73
|
+
stopOpacity: .4
|
|
74
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
75
|
+
offset: "100%",
|
|
76
|
+
stopColor: sparkColor,
|
|
77
|
+
stopOpacity: 0
|
|
78
|
+
})]
|
|
79
|
+
}) }), /* @__PURE__ */ jsx(Area, {
|
|
80
|
+
type: "monotone",
|
|
81
|
+
dataKey: "value",
|
|
82
|
+
stroke: sparkColor,
|
|
83
|
+
strokeWidth: 1.6,
|
|
84
|
+
fill: `url(#${gradientId})`,
|
|
85
|
+
isAnimationActive: false,
|
|
86
|
+
dot: ({ cx, cy, index }) => {
|
|
87
|
+
return index === sparkData.length - 1 && cx != null && cy != null ? /* @__PURE__ */ jsx("circle", {
|
|
88
|
+
cx,
|
|
89
|
+
cy,
|
|
90
|
+
r: 2.5,
|
|
91
|
+
fill: sparkColor
|
|
92
|
+
}, index) : /* @__PURE__ */ jsx("g", {}, index);
|
|
93
|
+
}
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function DeltaPill({ sentiment, className, ...props }) {
|
|
101
|
+
return /* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: cn(statDeltaVariants({ sentiment }), className),
|
|
103
|
+
...props
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { Stat, statDeltaVariants };
|
|
@@ -11,7 +11,7 @@ declare function StatusDot({
|
|
|
11
11
|
variant,
|
|
12
12
|
pulse,
|
|
13
13
|
...props
|
|
14
|
-
}: StatusDotProps): import("react
|
|
14
|
+
}: StatusDotProps): import("react").JSX.Element;
|
|
15
15
|
type StatusDotVariantProps = Required<Pick<VariantProps<typeof statusDotVariants>, "variant" | "pulse">>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { StatusDot, type StatusDotVariantProps, statusDotVariants };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
5
5
|
declare function Switch({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof SwitchPrimitive.Root>):
|
|
8
|
+
}: React$1.ComponentProps<typeof SwitchPrimitive.Root>): React$1.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Switch };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/table.d.ts
|
|
4
4
|
declare function Table({
|
|
5
5
|
className,
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<"table">):
|
|
7
|
+
}: React$1.ComponentProps<"table">): React$1.JSX.Element;
|
|
8
8
|
declare function TableHeader({
|
|
9
9
|
className,
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<"thead">):
|
|
11
|
+
}: React$1.ComponentProps<"thead">): React$1.JSX.Element;
|
|
12
12
|
declare function TableBody({
|
|
13
13
|
className,
|
|
14
14
|
...props
|
|
15
|
-
}: React.ComponentProps<"tbody">):
|
|
15
|
+
}: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
|
|
16
16
|
declare function TableFooter({
|
|
17
17
|
className,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<"tfoot">):
|
|
19
|
+
}: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
|
|
20
20
|
declare function TableRow({
|
|
21
21
|
className,
|
|
22
22
|
...props
|
|
23
|
-
}: React.ComponentProps<"tr">):
|
|
23
|
+
}: React$1.ComponentProps<"tr">): React$1.JSX.Element;
|
|
24
24
|
declare function TableHead({
|
|
25
25
|
className,
|
|
26
26
|
...props
|
|
27
|
-
}: React.ComponentProps<"th">):
|
|
28
|
-
interface TableCellProps extends React.ComponentProps<"td"> {
|
|
27
|
+
}: React$1.ComponentProps<"th">): React$1.JSX.Element;
|
|
28
|
+
interface TableCellProps extends React$1.ComponentProps<"td"> {
|
|
29
29
|
/**
|
|
30
30
|
* When true, the cell renders edge-to-edge so the child can act as the
|
|
31
31
|
* interactive surface (e.g. a button or popover trigger filling the cell).
|
|
@@ -37,10 +37,10 @@ declare function TableCell({
|
|
|
37
37
|
className,
|
|
38
38
|
interactive,
|
|
39
39
|
...props
|
|
40
|
-
}: TableCellProps):
|
|
40
|
+
}: TableCellProps): React$1.JSX.Element;
|
|
41
41
|
declare function TableCaption({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: React.ComponentProps<"caption">):
|
|
44
|
+
}: React$1.ComponentProps<"caption">): React$1.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|