@appcorp/shadcn 2.0.0 → 2.0.1
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/components/app-sidebar.js +1 -34
- package/components/audio.js +1 -13
- package/components/dashboard.js +1 -29
- package/components/drawer-generic.js +1 -39
- package/components/enhanced-checkbox.js +1 -39
- package/components/enhanced-combobox.js +1 -271
- package/components/enhanced-drawer-footer.js +1 -30
- package/components/enhanced-drawer-header.js +1 -7
- package/components/enhanced-dropzone-impl.js +1 -218
- package/components/enhanced-dropzone.js +1 -8
- package/components/enhanced-input.js +1 -40
- package/components/enhanced-label.js +1 -22
- package/components/enhanced-radio.js +1 -15
- package/components/enhanced-select.js +1 -33
- package/components/enhanced-slider.js +1 -33
- package/components/enhanced-switch.js +1 -42
- package/components/enhanced-table-footer-action.js +1 -102
- package/components/enhanced-table-footer-page.js +1 -124
- package/components/enhanced-table-footer-pagination.js +1 -108
- package/components/enhanced-table-header-action.js +1 -32
- package/components/enhanced-table-header-search.js +1 -10
- package/components/enhanced-table.js +1 -301
- package/components/enhanced-textarea.js +1 -40
- package/components/field.js +1 -96
- package/components/image-resize-dialog.js +1 -82
- package/components/nav-main.js +1 -40
- package/components/nav-projects.js +1 -39
- package/components/nav-user.js +1 -52
- package/components/show-toast.js +1 -7
- package/components/sidebar.js +1 -257
- package/components/team-switcher.js +1 -42
- package/components/theme-provider.js +1 -112
- package/components/timeline.js +1 -13
- package/components/tooltip.js +1 -36
- package/components/ui/accordion.js +1 -37
- package/components/ui/alert-dialog.js +1 -63
- package/components/ui/alert.js +1 -41
- package/components/ui/area-chart-v1-impl.js +1 -75
- package/components/ui/area-chart-v1.js +1 -5
- package/components/ui/aspect-ratio.js +1 -4
- package/components/ui/avatar.js +1 -31
- package/components/ui/badge.js +1 -32
- package/components/ui/breadcrumb.js +1 -54
- package/components/ui/button.js +1 -44
- package/components/ui/calendar-impl.js +1 -55
- package/components/ui/calendar.js +1 -6
- package/components/ui/card.js +1 -44
- package/components/ui/carousel-impl.js +1 -117
- package/components/ui/carousel.js +1 -9
- package/components/ui/chart-impl.js +6 -161
- package/components/ui/chart.js +1 -10
- package/components/ui/checkbox.js +1 -24
- package/components/ui/collapsible.js +1 -6
- package/components/ui/combobox.js +1 -52
- package/components/ui/command-impl.js +1 -63
- package/components/ui/command.js +1 -13
- package/components/ui/context-menu.js +1 -80
- package/components/ui/dialog.js +1 -57
- package/components/ui/drawer-impl.js +1 -56
- package/components/ui/drawer.js +1 -14
- package/components/ui/dropdown-menu.js +1 -82
- package/components/ui/form.d.ts +1 -1
- package/components/ui/form.js +1 -78
- package/components/ui/hover-card.js +1 -23
- package/components/ui/input-otp-impl.js +1 -43
- package/components/ui/input-otp.js +1 -8
- package/components/ui/input.js +1 -19
- package/components/ui/label.js +1 -23
- package/components/ui/language-selector.js +1 -25
- package/components/ui/menubar.js +1 -103
- package/components/ui/navigation-menu.js +1 -59
- package/components/ui/pagination.js +1 -60
- package/components/ui/popover.js +1 -25
- package/components/ui/progress.js +1 -22
- package/components/ui/radio-group.js +1 -29
- package/components/ui/resizable-impl.js +1 -27
- package/components/ui/resizable.js +1 -7
- package/components/ui/scroll-area.js +1 -32
- package/components/ui/select.js +1 -71
- package/components/ui/separator.js +1 -21
- package/components/ui/sheet.js +1 -71
- package/components/ui/skeleton.js +1 -18
- package/components/ui/slider.js +1 -32
- package/components/ui/sonner.js +1 -28
- package/components/ui/switch.js +1 -22
- package/components/ui/table.js +1 -55
- package/components/ui/tabs.js +1 -32
- package/components/ui/textarea.js +1 -19
- package/components/ui/theme-switcher.js +1 -102
- package/components/ui/toggle.js +1 -39
- package/data/admin-dashboard.js +1 -301
- package/hooks/use-enhanced-combobox.js +1 -73
- package/hooks/use-mobile.js +1 -15
- package/hooks/use-outside-click.js +1 -19
- package/lib/themes.js +1 -147
- package/lib/toast-utils.js +1 -170
- package/lib/utils.js +1 -5
- package/package.json +2 -2
- package/utils/transform-breadcrumbs.js +1 -7
- package/utils/transform-navitems.js +1 -18
|
@@ -1,63 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
15
|
-
import { cn } from "../../lib/utils";
|
|
16
|
-
import { buttonVariants } from "../ui/button";
|
|
17
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
18
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
19
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
20
|
-
const AlertDialogOverlay = React.forwardRef((_a, ref) => {
|
|
21
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
-
return (React.createElement(AlertDialogPrimitive.Overlay, Object.assign({ className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props, { ref: ref })));
|
|
23
|
-
});
|
|
24
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
25
|
-
const AlertDialogContent = React.forwardRef((_a, ref) => {
|
|
26
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
27
|
-
return (React.createElement(AlertDialogPortal, null,
|
|
28
|
-
React.createElement(AlertDialogOverlay, null),
|
|
29
|
-
React.createElement(AlertDialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className) }, props))));
|
|
30
|
-
});
|
|
31
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
32
|
-
const AlertDialogHeader = (_a) => {
|
|
33
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
34
|
-
return (React.createElement("div", Object.assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
|
|
35
|
-
};
|
|
36
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
37
|
-
const AlertDialogFooter = (_a) => {
|
|
38
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
39
|
-
return (React.createElement("div", Object.assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
|
|
40
|
-
};
|
|
41
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
42
|
-
const AlertDialogTitle = React.forwardRef((_a, ref) => {
|
|
43
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
-
return (React.createElement(AlertDialogPrimitive.Title, Object.assign({ ref: ref, className: cn("text-lg font-semibold", className) }, props)));
|
|
45
|
-
});
|
|
46
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
47
|
-
const AlertDialogDescription = React.forwardRef((_a, ref) => {
|
|
48
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
-
return (React.createElement(AlertDialogPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
|
|
50
|
-
});
|
|
51
|
-
AlertDialogDescription.displayName =
|
|
52
|
-
AlertDialogPrimitive.Description.displayName;
|
|
53
|
-
const AlertDialogAction = React.forwardRef((_a, ref) => {
|
|
54
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
55
|
-
return (React.createElement(AlertDialogPrimitive.Action, Object.assign({ ref: ref, className: cn(buttonVariants(), className) }, props)));
|
|
56
|
-
});
|
|
57
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
58
|
-
const AlertDialogCancel = React.forwardRef((_a, ref) => {
|
|
59
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
60
|
-
return (React.createElement(AlertDialogPrimitive.Cancel, Object.assign({ ref: ref, className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className) }, props)));
|
|
61
|
-
});
|
|
62
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
63
|
-
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
1
|
+
"use strict";"use client";var o=function(e,s){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&s.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)s.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(t[a[i]]=e[a[i]]);return t};import*as r from"react";import*as l from"@radix-ui/react-alert-dialog";import{cn as n}from"../../lib/utils";import{buttonVariants as m}from"../ui/button";const v=l.Root,O=l.Trigger,d=l.Portal,c=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(l.Overlay,Object.assign({className:n("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},a,{ref:s}))});c.displayName=l.Overlay.displayName;const p=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(d,null,r.createElement(c,null),r.createElement(l.Content,Object.assign({ref:s,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t)},a)))});p.displayName=l.Content.displayName;const f=e=>{var{className:s}=e,t=o(e,["className"]);return r.createElement("div",Object.assign({className:n("flex flex-col space-y-2 text-center sm:text-left",s)},t))};f.displayName="AlertDialogHeader";const g=e=>{var{className:s}=e,t=o(e,["className"]);return r.createElement("div",Object.assign({className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s)},t))};g.displayName="AlertDialogFooter";const N=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(l.Title,Object.assign({ref:s,className:n("text-lg font-semibold",t)},a))});N.displayName=l.Title.displayName;const u=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(l.Description,Object.assign({ref:s,className:n("text-sm text-muted-foreground",t)},a))});u.displayName=l.Description.displayName;const y=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(l.Action,Object.assign({ref:s,className:n(m(),t)},a))});y.displayName=l.Action.displayName;const b=r.forwardRef((e,s)=>{var{className:t}=e,a=o(e,["className"]);return r.createElement(l.Cancel,Object.assign({ref:s,className:n(m({variant:"outline"}),"mt-2 sm:mt-0",t)},a))});b.displayName=l.Cancel.displayName;export{v as AlertDialog,d as AlertDialogPortal,c as AlertDialogOverlay,O as AlertDialogTrigger,p as AlertDialogContent,f as AlertDialogHeader,g as AlertDialogFooter,N as AlertDialogTitle,u as AlertDialogDescription,y as AlertDialogAction,b as AlertDialogCancel};
|
package/components/ui/alert.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { cva } from "class-variance-authority";
|
|
14
|
-
import { cn } from "../../lib/utils";
|
|
15
|
-
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", {
|
|
16
|
-
variants: {
|
|
17
|
-
variant: {
|
|
18
|
-
default: "bg-background text-foreground",
|
|
19
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
const Alert = React.forwardRef((_a, ref) => {
|
|
27
|
-
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
28
|
-
return (React.createElement("div", Object.assign({ ref: ref, role: "alert", className: cn(alertVariants({ variant }), className) }, props)));
|
|
29
|
-
});
|
|
30
|
-
Alert.displayName = "Alert";
|
|
31
|
-
const AlertTitle = React.forwardRef((_a, ref) => {
|
|
32
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return (React.createElement("h5", Object.assign({ ref: ref, className: cn("mb-1 font-medium leading-none tracking-tight", className) }, props)));
|
|
34
|
-
});
|
|
35
|
-
AlertTitle.displayName = "AlertTitle";
|
|
36
|
-
const AlertDescription = React.forwardRef((_a, ref) => {
|
|
37
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("text-sm [&_p]:leading-relaxed", className) }, props)));
|
|
39
|
-
});
|
|
40
|
-
AlertDescription.displayName = "AlertDescription";
|
|
41
|
-
export { Alert, AlertTitle, AlertDescription };
|
|
1
|
+
"use strict";var n=function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(e);s<t.length;s++)a.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(e,t[s])&&(r[t[s]]=e[t[s]]);return r};import*as l from"react";import{cva as f}from"class-variance-authority";import{cn as o}from"../../lib/utils";const m=f("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),i=l.forwardRef((e,a)=>{var{className:r,variant:t}=e,s=n(e,["className","variant"]);return l.createElement("div",Object.assign({ref:a,role:"alert",className:o(m({variant:t}),r)},s))});i.displayName="Alert";const c=l.forwardRef((e,a)=>{var{className:r}=e,t=n(e,["className"]);return l.createElement("h5",Object.assign({ref:a,className:o("mb-1 font-medium leading-none tracking-tight",r)},t))});c.displayName="AlertTitle";const d=l.forwardRef((e,a)=>{var{className:r}=e,t=n(e,["className"]);return l.createElement("div",Object.assign({ref:a,className:o("text-sm [&_p]:leading-relaxed",r)},t))});d.displayName="AlertDescription";export{i as Alert,c as AlertTitle,d as AlertDescription};
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../components/ui/card";
|
|
5
|
-
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "../../components/ui/chart";
|
|
6
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../../components/ui/select";
|
|
7
|
-
const createChartConfig = (legends) => {
|
|
8
|
-
return legends.reduce((acc, legend, index) => {
|
|
9
|
-
acc[legend.toLowerCase()] = {
|
|
10
|
-
label: legend,
|
|
11
|
-
color: `var(--chart-${index + 1})`,
|
|
12
|
-
};
|
|
13
|
-
return acc;
|
|
14
|
-
}, {});
|
|
15
|
-
};
|
|
16
|
-
export const AreaChartV1 = ({ dates, description, legends, title, selectors, locale = "en-US", onSelectorChange, }) => {
|
|
17
|
-
const [timeRange, setTimeRange] = React.useState("30d");
|
|
18
|
-
const dynamicChartConfig = createChartConfig(legends);
|
|
19
|
-
const handleValueChange = (value) => {
|
|
20
|
-
setTimeRange(value);
|
|
21
|
-
onSelectorChange(value);
|
|
22
|
-
};
|
|
23
|
-
const filteredData = React.useMemo(() => {
|
|
24
|
-
var _a;
|
|
25
|
-
const daysMap = {
|
|
26
|
-
"7d": 7,
|
|
27
|
-
"30d": 30,
|
|
28
|
-
"90d": 90,
|
|
29
|
-
};
|
|
30
|
-
const daysToSubtract = (_a = daysMap[timeRange]) !== null && _a !== void 0 ? _a : 90;
|
|
31
|
-
const referenceDate = new Date(dates[dates.length - 1].date);
|
|
32
|
-
const startDate = new Date(referenceDate);
|
|
33
|
-
startDate.setDate(referenceDate.getDate() - daysToSubtract);
|
|
34
|
-
const startTime = startDate.getTime();
|
|
35
|
-
return dates.filter((item) => new Date(item.date).getTime() >= startTime);
|
|
36
|
-
}, [dates, timeRange]);
|
|
37
|
-
return (React.createElement(Card, { className: "pt-0" },
|
|
38
|
-
React.createElement(CardHeader, { className: "flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row" },
|
|
39
|
-
React.createElement("div", { className: "grid flex-1 gap-1" },
|
|
40
|
-
React.createElement(CardTitle, null, title),
|
|
41
|
-
React.createElement(CardDescription, null, description)),
|
|
42
|
-
React.createElement(Select, { value: timeRange, onValueChange: handleValueChange },
|
|
43
|
-
React.createElement(SelectTrigger, { className: "hidden w-40 rounded-lg sm:ml-auto sm:flex", "aria-label": "Select a value" },
|
|
44
|
-
React.createElement(SelectValue, { placeholder: "Last 3 months" })),
|
|
45
|
-
React.createElement(SelectContent, { className: "rounded-xl" }, selectors.map((selector) => (React.createElement(SelectItem, { key: selector.label, value: selector.value }, selector.label)))))),
|
|
46
|
-
React.createElement(CardContent, { className: "px-2 pt-4 sm:px-6 sm:pt-6" },
|
|
47
|
-
React.createElement(ChartContainer, { config: dynamicChartConfig, className: "aspect-auto h-[250px] w-full" },
|
|
48
|
-
React.createElement(AreaChart, { data: filteredData },
|
|
49
|
-
React.createElement("defs", null, legends.map((legend) => {
|
|
50
|
-
const key = legend.toLowerCase();
|
|
51
|
-
return (React.createElement("linearGradient", { key: key, id: `fill${legend}`, x1: "0", y1: "0", x2: "0", y2: "1" },
|
|
52
|
-
React.createElement("stop", { offset: "5%", stopColor: `var(--color-${key})`, stopOpacity: 0.8 }),
|
|
53
|
-
React.createElement("stop", { offset: "95%", stopColor: `var(--color-${key})`, stopOpacity: 0.1 })));
|
|
54
|
-
})),
|
|
55
|
-
React.createElement(CartesianGrid, { vertical: false }),
|
|
56
|
-
React.createElement(YAxis, { domain: [0, "auto"], hide: true }),
|
|
57
|
-
React.createElement(XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, minTickGap: 32, tickFormatter: (value) => {
|
|
58
|
-
const date = new Date(value);
|
|
59
|
-
return date.toLocaleDateString(locale, {
|
|
60
|
-
month: "short",
|
|
61
|
-
day: "numeric",
|
|
62
|
-
});
|
|
63
|
-
} }),
|
|
64
|
-
React.createElement(ChartTooltip, { cursor: false, content: React.createElement(ChartTooltipContent, { labelFormatter: (value) => {
|
|
65
|
-
return new Date(value).toLocaleDateString(locale, {
|
|
66
|
-
month: "short",
|
|
67
|
-
day: "numeric",
|
|
68
|
-
});
|
|
69
|
-
}, indicator: "dot" }) }),
|
|
70
|
-
legends.map((legend) => {
|
|
71
|
-
const key = legend.toLowerCase();
|
|
72
|
-
return (React.createElement(Area, { key: key, dataKey: key, type: "monotone", fill: `url(#fill${legend})`, stroke: `var(--color-${key})`, stackId: "a" }));
|
|
73
|
-
}),
|
|
74
|
-
React.createElement(ChartLegend, { content: React.createElement(ChartLegendContent, null) }))))));
|
|
75
|
-
};
|
|
1
|
+
"use strict";"use client";import*as e from"react";import{Area as x,AreaChart as D,CartesianGrid as k,XAxis as v,YAxis as w}from"recharts";import{Card as S,CardContent as L,CardDescription as T,CardHeader as b,CardTitle as N}from"../../components/ui/card";import{ChartContainer as $,ChartLegend as A,ChartLegendContent as M,ChartTooltip as V,ChartTooltipContent as G}from"../../components/ui/chart";import{Select as R,SelectContent as F,SelectItem as I,SelectTrigger as K,SelectValue as O}from"../../components/ui/select";const H=r=>r.reduce((l,n,o)=>(l[n.toLowerCase()]={label:n,color:`var(--chart-${o+1})`},l),{});export const AreaChartV1=({dates:r,description:l,legends:n,title:o,selectors:d,locale:m="en-US",onSelectorChange:p})=>{const[c,u]=e.useState("30d"),C=H(n),f=t=>{u(t),p(t)},E=e.useMemo(()=>{var t;const h=(t={"7d":7,"30d":30,"90d":90}[c])!==null&&t!==void 0?t:90,s=new Date(r[r.length-1].date),i=new Date(s);i.setDate(s.getDate()-h);const y=i.getTime();return r.filter(g=>new Date(g.date).getTime()>=y)},[r,c]);return e.createElement(S,{className:"pt-0"},e.createElement(b,{className:"flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row"},e.createElement("div",{className:"grid flex-1 gap-1"},e.createElement(N,null,o),e.createElement(T,null,l)),e.createElement(R,{value:c,onValueChange:f},e.createElement(K,{className:"hidden w-40 rounded-lg sm:ml-auto sm:flex","aria-label":"Select a value"},e.createElement(O,{placeholder:"Last 3 months"})),e.createElement(F,{className:"rounded-xl"},d.map(t=>e.createElement(I,{key:t.label,value:t.value},t.label))))),e.createElement(L,{className:"px-2 pt-4 sm:px-6 sm:pt-6"},e.createElement($,{config:C,className:"aspect-auto h-[250px] w-full"},e.createElement(D,{data:E},e.createElement("defs",null,n.map(t=>{const a=t.toLowerCase();return e.createElement("linearGradient",{key:a,id:`fill${t}`,x1:"0",y1:"0",x2:"0",y2:"1"},e.createElement("stop",{offset:"5%",stopColor:`var(--color-${a})`,stopOpacity:.8}),e.createElement("stop",{offset:"95%",stopColor:`var(--color-${a})`,stopOpacity:.1}))})),e.createElement(k,{vertical:!1}),e.createElement(w,{domain:[0,"auto"],hide:!0}),e.createElement(v,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,minTickGap:32,tickFormatter:t=>new Date(t).toLocaleDateString(m,{month:"short",day:"numeric"})}),e.createElement(V,{cursor:!1,content:e.createElement(G,{labelFormatter:t=>new Date(t).toLocaleDateString(m,{month:"short",day:"numeric"}),indicator:"dot"})}),n.map(t=>{const a=t.toLowerCase();return e.createElement(x,{key:a,dataKey:a,type:"monotone",fill:`url(#fill${t})`,stroke:`var(--color-${a})`,stackId:"a"})}),e.createElement(A,{content:e.createElement(M,null)})))))};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
const module = import("./area-chart-v1-impl");
|
|
4
|
-
const lazy = (name) => React.lazy(() => module.then((m) => ({ default: m[name] })));
|
|
5
|
-
export const AreaChartV1 = lazy("AreaChartV1");
|
|
1
|
+
"use strict";"use client";import*as e from"react";const o=import("./area-chart-v1-impl"),r=t=>e.lazy(()=>o.then(a=>({default:a[t]})));export const AreaChartV1=r("AreaChartV1");
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
3
|
-
const AspectRatio = AspectRatioPrimitive.Root;
|
|
4
|
-
export { AspectRatio };
|
|
1
|
+
"use strict";"use client";import*as t from"@radix-ui/react-aspect-ratio";const o=t.Root;export{o as AspectRatio};
|
package/components/ui/avatar.js
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
15
|
-
import { cn } from "../../lib/utils";
|
|
16
|
-
const Avatar = React.forwardRef((_a, ref) => {
|
|
17
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
-
return (React.createElement(AvatarPrimitive.Root, Object.assign({ ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className) }, props)));
|
|
19
|
-
});
|
|
20
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
21
|
-
const AvatarImage = React.forwardRef((_a, ref) => {
|
|
22
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (React.createElement(AvatarPrimitive.Image, Object.assign({ ref: ref, className: cn("aspect-square h-full w-full", className) }, props)));
|
|
24
|
-
});
|
|
25
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
26
|
-
const AvatarFallback = React.forwardRef((_a, ref) => {
|
|
27
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
28
|
-
return (React.createElement(AvatarPrimitive.Fallback, Object.assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className) }, props)));
|
|
29
|
-
});
|
|
30
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
31
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
|
1
|
+
"use strict";"use client";var c=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(r[a[l]]=e[a[l]]);return r};import*as s from"react";import*as o from"@radix-ui/react-avatar";import{cn as n}from"../../lib/utils";const m=s.forwardRef((e,t)=>{var{className:r}=e,a=c(e,["className"]);return s.createElement(o.Root,Object.assign({ref:t,className:n("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",r)},a))});m.displayName=o.Root.displayName;const f=s.forwardRef((e,t)=>{var{className:r}=e,a=c(e,["className"]);return s.createElement(o.Image,Object.assign({ref:t,className:n("aspect-square h-full w-full",r)},a))});f.displayName=o.Image.displayName;const i=s.forwardRef((e,t)=>{var{className:r}=e,a=c(e,["className"]);return s.createElement(o.Fallback,Object.assign({ref:t,className:n("flex h-full w-full items-center justify-center rounded-full bg-muted",r)},a))});i.displayName=o.Fallback.displayName;export{m as Avatar,f as AvatarImage,i as AvatarFallback};
|
package/components/ui/badge.js
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { cva } from "class-variance-authority";
|
|
14
|
-
import { cn } from "../../lib/utils";
|
|
15
|
-
const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
16
|
-
variants: {
|
|
17
|
-
variant: {
|
|
18
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
19
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
20
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
21
|
-
outline: "text-foreground",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
variant: "default",
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
function Badge(_a) {
|
|
29
|
-
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
30
|
-
return (React.createElement("div", Object.assign({ className: cn(badgeVariants({ variant }), className) }, props)));
|
|
31
|
-
}
|
|
32
|
-
export { Badge, badgeVariants };
|
|
1
|
+
"use strict";var s=function(e,n){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,r=Object.getOwnPropertySymbols(e);t<r.length;t++)n.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(o[r[t]]=e[r[t]]);return o};import*as i from"react";import{cva as c}from"class-variance-authority";import{cn as d}from"../../lib/utils";const a=c("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f(e){var{className:n,variant:o}=e,r=s(e,["className","variant"]);return i.createElement("div",Object.assign({className:d(a({variant:o}),n)},r))}export{f as Badge,a as badgeVariants};
|
|
@@ -1,54 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
-
import { cn } from "../../lib/utils";
|
|
15
|
-
import { ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons";
|
|
16
|
-
const Breadcrumb = React.forwardRef((_a, ref) => {
|
|
17
|
-
var props = __rest(_a, []);
|
|
18
|
-
return React.createElement("nav", Object.assign({ ref: ref, "aria-label": "breadcrumb" }, props));
|
|
19
|
-
});
|
|
20
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
21
|
-
const BreadcrumbList = React.forwardRef((_a, ref) => {
|
|
22
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (React.createElement("ol", Object.assign({ ref: ref, className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className) }, props)));
|
|
24
|
-
});
|
|
25
|
-
BreadcrumbList.displayName = "BreadcrumbList";
|
|
26
|
-
const BreadcrumbItem = React.forwardRef((_a, ref) => {
|
|
27
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
28
|
-
return (React.createElement("li", Object.assign({ ref: ref, className: cn("inline-flex items-center gap-1.5", className) }, props)));
|
|
29
|
-
});
|
|
30
|
-
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
31
|
-
const BreadcrumbLink = React.forwardRef((_a, ref) => {
|
|
32
|
-
var { asChild, className } = _a, props = __rest(_a, ["asChild", "className"]);
|
|
33
|
-
const Comp = asChild ? Slot : "a";
|
|
34
|
-
return (React.createElement(Comp, Object.assign({ ref: ref, className: cn("transition-colors hover:text-foreground", className) }, props)));
|
|
35
|
-
});
|
|
36
|
-
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
37
|
-
const BreadcrumbPage = React.forwardRef((_a, ref) => {
|
|
38
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
39
|
-
return (React.createElement("span", Object.assign({ ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className) }, props)));
|
|
40
|
-
});
|
|
41
|
-
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
42
|
-
const BreadcrumbSeparator = (_a) => {
|
|
43
|
-
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
44
|
-
return (React.createElement("li", Object.assign({ role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className) }, props), children !== null && children !== void 0 ? children : React.createElement(ChevronRightIcon, null)));
|
|
45
|
-
};
|
|
46
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
47
|
-
const BreadcrumbEllipsis = (_a) => {
|
|
48
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
-
return (React.createElement("span", Object.assign({ role: "presentation", "aria-hidden": "true", className: cn("flex h-9 w-9 items-center justify-center", className) }, props),
|
|
50
|
-
React.createElement(DotsHorizontalIcon, { className: "h-4 w-4" }),
|
|
51
|
-
React.createElement("span", { className: "sr-only" }, "More")));
|
|
52
|
-
};
|
|
53
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
54
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
1
|
+
"use strict";var c=function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]]);return t};import*as s from"react";import{Slot as N}from"@radix-ui/react-slot";import{cn as l}from"../../lib/utils";import{ChevronRightIcon as g,DotsHorizontalIcon as y}from"@radix-ui/react-icons";const o=s.forwardRef((e,a)=>{var t=c(e,[]);return s.createElement("nav",Object.assign({ref:a,"aria-label":"breadcrumb"},t))});o.displayName="Breadcrumb";const m=s.forwardRef((e,a)=>{var{className:t}=e,r=c(e,["className"]);return s.createElement("ol",Object.assign({ref:a,className:l("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t)},r))});m.displayName="BreadcrumbList";const i=s.forwardRef((e,a)=>{var{className:t}=e,r=c(e,["className"]);return s.createElement("li",Object.assign({ref:a,className:l("inline-flex items-center gap-1.5",t)},r))});i.displayName="BreadcrumbItem";const p=s.forwardRef((e,a)=>{var{asChild:t,className:r}=e,n=c(e,["asChild","className"]);const b=t?N:"a";return s.createElement(b,Object.assign({ref:a,className:l("transition-colors hover:text-foreground",r)},n))});p.displayName="BreadcrumbLink";const d=s.forwardRef((e,a)=>{var{className:t}=e,r=c(e,["className"]);return s.createElement("span",Object.assign({ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:l("font-normal text-foreground",t)},r))});d.displayName="BreadcrumbPage";const f=e=>{var{children:a,className:t}=e,r=c(e,["children","className"]);return s.createElement("li",Object.assign({role:"presentation","aria-hidden":"true",className:l("[&>svg]:w-3.5 [&>svg]:h-3.5",t)},r),a??s.createElement(g,null))};f.displayName="BreadcrumbSeparator";const u=e=>{var{className:a}=e,t=c(e,["className"]);return s.createElement("span",Object.assign({role:"presentation","aria-hidden":"true",className:l("flex h-9 w-9 items-center justify-center",a)},t),s.createElement(y,{className:"h-4 w-4"}),s.createElement("span",{className:"sr-only"},"More"))};u.displayName="BreadcrumbElipssis";export{o as Breadcrumb,m as BreadcrumbList,i as BreadcrumbItem,p as BreadcrumbLink,d as BreadcrumbPage,f as BreadcrumbSeparator,u as BreadcrumbEllipsis};
|
package/components/ui/button.js
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
-
import { cva } from "class-variance-authority";
|
|
15
|
-
import { cn } from "../../lib/utils";
|
|
16
|
-
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
17
|
-
variants: {
|
|
18
|
-
variant: {
|
|
19
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
20
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
21
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
22
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
23
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
24
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
default: "h-9 px-4 py-2",
|
|
28
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
29
|
-
lg: "h-10 rounded-md px-8",
|
|
30
|
-
icon: "h-9 w-9",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
variant: "default",
|
|
35
|
-
size: "default",
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const Button = React.forwardRef((_a, ref) => {
|
|
39
|
-
var { className, variant, size, asChild = false } = _a, props = __rest(_a, ["className", "variant", "size", "asChild"]);
|
|
40
|
-
const Comp = asChild ? Slot : "button";
|
|
41
|
-
return (React.createElement(Comp, Object.assign({ className: cn(buttonVariants({ variant, size, className })), ref: ref }, props)));
|
|
42
|
-
});
|
|
43
|
-
Button.displayName = "Button";
|
|
44
|
-
export { Button, buttonVariants };
|
|
1
|
+
"use strict";var u=function(t,n){var o={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.indexOf(e)<0&&(o[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(t);r<e.length;r++)n.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(t,e[r])&&(o[e[r]]=t[e[r]]);return o};import*as a from"react";import{Slot as f}from"@radix-ui/react-slot";import{cva as m}from"class-variance-authority";import{cn as p}from"../../lib/utils";const s=m("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef((t,n)=>{var{className:o,variant:e,size:r,asChild:d=!1}=t,c=u(t,["className","variant","size","asChild"]);const l=d?f:"button";return a.createElement(l,Object.assign({className:p(s({variant:e,size:r,className:o})),ref:n},c))});i.displayName="Button";export{i as Button,s as buttonVariants};
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-react";
|
|
15
|
-
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
16
|
-
import { cn } from "../../lib/utils";
|
|
17
|
-
import { Button, buttonVariants } from "../ui/button";
|
|
18
|
-
function Calendar(_a) {
|
|
19
|
-
var { className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components"]);
|
|
20
|
-
const defaultClassNames = getDefaultClassNames();
|
|
21
|
-
return (React.createElement(DayPicker, Object.assign({ showOutsideDays: showOutsideDays, className: cn("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: Object.assign({ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }) }, formatters), classNames: Object.assign({ root: cn("w-fit", defaultClassNames.root), months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months), month: cn("flex w-full flex-col gap-4", defaultClassNames.month), nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav), button_previous: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_previous), button_next: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_next), month_caption: cn("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]", defaultClassNames.month_caption), dropdowns: cn("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns), dropdown_root: cn("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border", defaultClassNames.dropdown_root), dropdown: cn("bg-popover absolute inset-0 opacity-0", defaultClassNames.dropdown), caption_label: cn("select-none font-medium", captionLayout === "label"
|
|
22
|
-
? "text-sm"
|
|
23
|
-
: "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5", defaultClassNames.caption_label), table: "w-full border-collapse", weekdays: cn("flex", defaultClassNames.weekdays), weekday: cn("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal", defaultClassNames.weekday), week: cn("mt-2 flex w-full", defaultClassNames.week), week_number_header: cn("w-[--cell-size] select-none", defaultClassNames.week_number_header), week_number: cn("text-muted-foreground select-none text-[0.8rem]", defaultClassNames.week_number), day: cn("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md", defaultClassNames.day), range_start: cn("bg-accent rounded-l-md", defaultClassNames.range_start), range_middle: cn("rounded-none", defaultClassNames.range_middle), range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end), today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today), outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside), disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled), hidden: cn("invisible", defaultClassNames.hidden) }, classNames), components: Object.assign({ Root: (_a) => {
|
|
24
|
-
var { className, rootRef } = _a, props = __rest(_a, ["className", "rootRef"]);
|
|
25
|
-
return (React.createElement("div", Object.assign({ "data-slot": "calendar", ref: rootRef, className: cn(className) }, props)));
|
|
26
|
-
}, Chevron: (_a) => {
|
|
27
|
-
var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
28
|
-
if (orientation === "left") {
|
|
29
|
-
return (React.createElement(ChevronLeftIcon, Object.assign({ className: cn("size-4", className) }, props)));
|
|
30
|
-
}
|
|
31
|
-
if (orientation === "right") {
|
|
32
|
-
return (React.createElement(ChevronRightIcon, Object.assign({ className: cn("size-4", className) }, props)));
|
|
33
|
-
}
|
|
34
|
-
return (React.createElement(ChevronDownIcon, Object.assign({ className: cn("size-4", className) }, props)));
|
|
35
|
-
}, DayButton: CalendarDayButton, WeekNumber: (_a) => {
|
|
36
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
37
|
-
return (React.createElement("td", Object.assign({}, props),
|
|
38
|
-
React.createElement("div", { className: "flex size-[--cell-size] items-center justify-center text-center" }, children)));
|
|
39
|
-
} }, components) }, props)));
|
|
40
|
-
}
|
|
41
|
-
function CalendarDayButton(_a) {
|
|
42
|
-
var { className, day, modifiers } = _a, props = __rest(_a, ["className", "day", "modifiers"]);
|
|
43
|
-
const defaultClassNames = getDefaultClassNames();
|
|
44
|
-
const ref = React.useRef(null);
|
|
45
|
-
React.useEffect(() => {
|
|
46
|
-
var _a;
|
|
47
|
-
if (modifiers.focused)
|
|
48
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
49
|
-
}, [modifiers.focused]);
|
|
50
|
-
return (React.createElement(Button, Object.assign({ ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
51
|
-
!modifiers.range_start &&
|
|
52
|
-
!modifiers.range_end &&
|
|
53
|
-
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className) }, props)));
|
|
54
|
-
}
|
|
55
|
-
export { Calendar, CalendarDayButton };
|
|
1
|
+
"use strict";"use client";var g=function(r,i){var d={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0&&(d[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(r);n<a.length;n++)i.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(r,a[n])&&(d[a[n]]=r[a[n]]);return d};import*as s from"react";import{ChevronDownIcon as w,ChevronLeftIcon as v,ChevronRightIcon as _}from"lucide-react";import{DayPicker as N,getDefaultClassNames as b}from"react-day-picker";import{cn as e}from"../../lib/utils";import{Button as O,buttonVariants as y}from"../ui/button";function j(r){var{className:i,classNames:d,showOutsideDays:a=!0,captionLayout:n="label",buttonVariant:f="ghost",formatters:p,components:u}=r,h=g(r,["className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components"]);const t=b();return s.createElement(N,Object.assign({showOutsideDays:a,className:e("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,i),captionLayout:n,formatters:Object.assign({formatMonthDropdown:o=>o.toLocaleString("default",{month:"short"})},p),classNames:Object.assign({root:e("w-fit",t.root),months:e("relative flex flex-col gap-4 md:flex-row",t.months),month:e("flex w-full flex-col gap-4",t.month),nav:e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",t.nav),button_previous:e(y({variant:f}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",t.button_previous),button_next:e(y({variant:f}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",t.button_next),month_caption:e("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",t.month_caption),dropdowns:e("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",t.dropdowns),dropdown_root:e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",t.dropdown_root),dropdown:e("bg-popover absolute inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-medium",n==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex",t.weekdays),weekday:e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",t.weekday),week:e("mt-2 flex w-full",t.week),week_number_header:e("w-[--cell-size] select-none",t.week_number_header),week_number:e("text-muted-foreground select-none text-[0.8rem]",t.week_number),day:e("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",t.day),range_start:e("bg-accent rounded-l-md",t.range_start),range_middle:e("rounded-none",t.range_middle),range_end:e("bg-accent rounded-r-md",t.range_end),today:e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",t.today),outside:e("text-muted-foreground aria-selected:text-muted-foreground",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden)},d),components:Object.assign({Root:o=>{var{className:l,rootRef:c}=o,m=g(o,["className","rootRef"]);return s.createElement("div",Object.assign({"data-slot":"calendar",ref:c,className:e(l)},m))},Chevron:o=>{var{className:l,orientation:c}=o,m=g(o,["className","orientation"]);return c==="left"?s.createElement(v,Object.assign({className:e("size-4",l)},m)):c==="right"?s.createElement(_,Object.assign({className:e("size-4",l)},m)):s.createElement(w,Object.assign({className:e("size-4",l)},m))},DayButton:x,WeekNumber:o=>{var{children:l}=o,c=g(o,["children"]);return s.createElement("td",Object.assign({},c),s.createElement("div",{className:"flex size-[--cell-size] items-center justify-center text-center"},l))}},u)},h))}function x(r){var{className:i,day:d,modifiers:a}=r,n=g(r,["className","day","modifiers"]);const f=b(),p=s.useRef(null);return s.useEffect(()=>{var u;a.focused&&((u=p.current)===null||u===void 0||u.focus())},[a.focused]),s.createElement(O,Object.assign({ref:p,variant:"ghost",size:"icon","data-day":d.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",f.day,i)},n))}export{j as Calendar,x as CalendarDayButton};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
const module = import("./calendar-impl");
|
|
4
|
-
const lazy = (name) => React.lazy(() => module.then((m) => ({ default: m[name] })));
|
|
5
|
-
export const Calendar = lazy("Calendar");
|
|
6
|
-
export const CalendarDayButton = lazy("CalendarDayButton");
|
|
1
|
+
"use strict";"use client";import*as n from"react";const o=import("./calendar-impl"),t=a=>n.lazy(()=>o.then(e=>({default:e[a]})));export const Calendar=t("Calendar"),CalendarDayButton=t("CalendarDayButton");
|
package/components/ui/card.js
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { cn } from "../../lib/utils";
|
|
14
|
-
const Card = React.forwardRef((_a, ref) => {
|
|
15
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow", className) }, props)));
|
|
17
|
-
});
|
|
18
|
-
Card.displayName = "Card";
|
|
19
|
-
const CardHeader = React.forwardRef((_a, ref) => {
|
|
20
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className) }, props)));
|
|
22
|
-
});
|
|
23
|
-
CardHeader.displayName = "CardHeader";
|
|
24
|
-
const CardTitle = React.forwardRef((_a, ref) => {
|
|
25
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("font-semibold leading-none tracking-tight", className) }, props)));
|
|
27
|
-
});
|
|
28
|
-
CardTitle.displayName = "CardTitle";
|
|
29
|
-
const CardDescription = React.forwardRef((_a, ref) => {
|
|
30
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
31
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
|
|
32
|
-
});
|
|
33
|
-
CardDescription.displayName = "CardDescription";
|
|
34
|
-
const CardContent = React.forwardRef((_a, ref) => {
|
|
35
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
36
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("p-6 pt-0", className) }, props)));
|
|
37
|
-
});
|
|
38
|
-
CardContent.displayName = "CardContent";
|
|
39
|
-
const CardFooter = React.forwardRef((_a, ref) => {
|
|
40
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cn("flex items-center p-6 pt-0", className) }, props)));
|
|
42
|
-
});
|
|
43
|
-
CardFooter.displayName = "CardFooter";
|
|
44
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
1
|
+
"use strict";var c=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a};import*as s from"react";import{cn as n}from"../../lib/utils";const l=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("rounded-xl border bg-card text-card-foreground shadow",a)},r))});l.displayName="Card";const d=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("flex flex-col space-y-1.5 p-6",a)},r))});d.displayName="CardHeader";const m=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("font-semibold leading-none tracking-tight",a)},r))});m.displayName="CardTitle";const p=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("text-sm text-muted-foreground",a)},r))});p.displayName="CardDescription";const f=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("p-6 pt-0",a)},r))});f.displayName="CardContent";const i=s.forwardRef((e,t)=>{var{className:a}=e,r=c(e,["className"]);return s.createElement("div",Object.assign({ref:t,className:n("flex items-center p-6 pt-0",a)},r))});i.displayName="CardFooter";export{l as Card,d as CardHeader,i as CardFooter,m as CardTitle,p as CardDescription,f as CardContent};
|