@appcorp/shadcn 1.1.99 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/components/app-sidebar.js +16 -23
  2. package/components/audio.js +11 -19
  3. package/components/dashboard.js +27 -65
  4. package/components/drawer-generic.js +20 -28
  5. package/components/enhanced-checkbox.js +10 -57
  6. package/components/enhanced-combobox.js +99 -143
  7. package/components/enhanced-drawer-footer.js +22 -31
  8. package/components/enhanced-drawer-header.js +6 -14
  9. package/components/enhanced-dropzone-impl.d.ts +32 -0
  10. package/components/enhanced-dropzone-impl.js +218 -0
  11. package/components/enhanced-dropzone.d.ts +2 -63
  12. package/components/enhanced-dropzone.js +6 -294
  13. package/components/enhanced-input.js +10 -57
  14. package/components/enhanced-label.js +6 -52
  15. package/components/enhanced-radio.js +12 -20
  16. package/components/enhanced-select.js +13 -61
  17. package/components/enhanced-slider.js +11 -58
  18. package/components/enhanced-switch.js +11 -58
  19. package/components/enhanced-table-footer-action.js +11 -19
  20. package/components/enhanced-table-footer-page.js +16 -24
  21. package/components/enhanced-table-footer-pagination.js +11 -21
  22. package/components/enhanced-table-header-action.js +22 -30
  23. package/components/enhanced-table-header-search.js +9 -17
  24. package/components/enhanced-table.js +125 -153
  25. package/components/enhanced-textarea.js +10 -57
  26. package/components/field.d.ts +1 -1
  27. package/components/field.js +31 -88
  28. package/components/image-resize-dialog.js +61 -159
  29. package/components/nav-main.js +32 -78
  30. package/components/nav-projects.js +37 -48
  31. package/components/nav-user.js +41 -51
  32. package/components/show-toast.d.ts +2 -0
  33. package/components/show-toast.js +7 -0
  34. package/components/sidebar.d.ts +1 -1
  35. package/components/sidebar.js +115 -184
  36. package/components/team-switcher.js +36 -47
  37. package/components/theme-provider.js +36 -84
  38. package/components/timeline.d.ts +12 -0
  39. package/components/timeline.js +13 -0
  40. package/components/tooltip.js +10 -59
  41. package/components/ui/accordion.js +17 -67
  42. package/components/ui/alert-dialog.js +32 -89
  43. package/components/ui/alert.d.ts +1 -1
  44. package/components/ui/alert.js +14 -63
  45. package/components/ui/area-chart-v1-impl.d.ts +19 -0
  46. package/components/ui/area-chart-v1-impl.js +75 -0
  47. package/components/ui/area-chart-v1.d.ts +2 -19
  48. package/components/ui/area-chart-v1.js +4 -113
  49. package/components/ui/aspect-ratio.js +3 -39
  50. package/components/ui/avatar.js +13 -62
  51. package/components/ui/badge.d.ts +2 -2
  52. package/components/ui/badge.js +7 -55
  53. package/components/ui/breadcrumb.js +27 -80
  54. package/components/ui/button.d.ts +2 -2
  55. package/components/ui/button.js +10 -58
  56. package/components/ui/calendar-impl.d.ts +8 -0
  57. package/components/ui/calendar-impl.js +55 -0
  58. package/components/ui/calendar.d.ts +2 -8
  59. package/components/ui/calendar.js +5 -108
  60. package/components/ui/card.js +21 -73
  61. package/components/ui/carousel-impl.d.ts +18 -0
  62. package/components/ui/carousel-impl.js +117 -0
  63. package/components/ui/carousel.d.ts +6 -18
  64. package/components/ui/carousel.js +8 -170
  65. package/components/ui/chart-impl.d.ts +62 -0
  66. package/components/ui/chart-impl.js +162 -0
  67. package/components/ui/chart.d.ts +7 -62
  68. package/components/ui/chart.js +9 -219
  69. package/components/ui/checkbox.js +10 -57
  70. package/components/ui/collapsible.js +5 -43
  71. package/components/ui/combobox.js +22 -58
  72. package/components/ui/command-impl.d.ts +80 -0
  73. package/components/ui/command-impl.js +63 -0
  74. package/components/ui/command.d.ts +9 -80
  75. package/components/ui/command.js +12 -117
  76. package/components/ui/context-menu.js +41 -102
  77. package/components/ui/dialog.js +28 -84
  78. package/components/ui/drawer-impl.d.ts +22 -0
  79. package/components/ui/drawer-impl.js +56 -0
  80. package/components/ui/drawer.d.ts +10 -22
  81. package/components/ui/drawer.js +13 -111
  82. package/components/ui/dropdown-menu.js +41 -102
  83. package/components/ui/form.d.ts +4 -2
  84. package/components/ui/form.js +41 -95
  85. package/components/ui/hover-card.js +9 -58
  86. package/components/ui/input-otp-impl.d.ts +34 -0
  87. package/components/ui/input-otp-impl.js +43 -0
  88. package/components/ui/input-otp.d.ts +4 -34
  89. package/components/ui/input-otp.js +7 -92
  90. package/components/ui/input.js +6 -53
  91. package/components/ui/label.d.ts +1 -1
  92. package/components/ui/label.js +9 -56
  93. package/components/ui/language-selector.js +17 -55
  94. package/components/ui/menubar.js +46 -108
  95. package/components/ui/navigation-menu.d.ts +1 -1
  96. package/components/ui/navigation-menu.js +29 -84
  97. package/components/ui/pagination.js +30 -83
  98. package/components/ui/popover.js +10 -60
  99. package/components/ui/progress.js +8 -55
  100. package/components/ui/radio-group.js +12 -60
  101. package/components/ui/resizable-impl.d.ts +24 -0
  102. package/components/ui/resizable-impl.js +27 -0
  103. package/components/ui/resizable.d.ts +3 -24
  104. package/components/ui/resizable.js +6 -78
  105. package/components/ui/scroll-area.js +10 -58
  106. package/components/ui/select.js +34 -90
  107. package/components/ui/separator.js +7 -54
  108. package/components/ui/sheet.d.ts +1 -1
  109. package/components/ui/sheet.js +30 -86
  110. package/components/ui/skeleton.js +5 -21
  111. package/components/ui/slider.js +10 -57
  112. package/components/ui/sonner.js +7 -24
  113. package/components/ui/switch.js +8 -55
  114. package/components/ui/table.js +27 -81
  115. package/components/ui/tabs.js +14 -64
  116. package/components/ui/textarea.js +6 -53
  117. package/components/ui/theme-switcher.js +41 -91
  118. package/components/ui/toggle.d.ts +2 -2
  119. package/components/ui/toggle.js +9 -57
  120. package/data/admin-dashboard.js +16 -19
  121. package/hooks/use-enhanced-combobox.js +47 -124
  122. package/hooks/use-mobile.js +8 -44
  123. package/hooks/use-outside-click.js +6 -10
  124. package/lib/themes.js +1 -4
  125. package/lib/toast-utils.js +78 -120
  126. package/lib/utils.js +4 -11
  127. package/package.json +9 -90
  128. package/utils/transform-breadcrumbs.js +4 -8
  129. package/utils/transform-navitems.js +7 -22
  130. package/components/aceternity-ui/apple-cards-carousel.d.ts +0 -35
  131. package/components/aceternity-ui/apple-cards-carousel.js +0 -263
  132. package/components/shadcn-example/ai-chat/chat-interface.d.ts +0 -11
  133. package/components/shadcn-example/ai-chat/chat-interface.js +0 -70
  134. package/components/shadcn-example/ai-chat/index.d.ts +0 -38
  135. package/components/shadcn-example/ai-chat/index.js +0 -66
  136. package/components/shadcn-example/ai-chat/sidebar.d.ts +0 -15
  137. package/components/shadcn-example/ai-chat/sidebar.js +0 -68
  138. package/components/shadcn-example/ai-chat/welcome-section.d.ts +0 -12
  139. package/components/shadcn-example/ai-chat/welcome-section.js +0 -26
  140. package/components/shadcn-example/authentication/index.d.ts +0 -24
  141. package/components/shadcn-example/authentication/index.js +0 -59
  142. package/components/shadcn-example/authentication/user-auth-form.d.ts +0 -11
  143. package/components/shadcn-example/authentication/user-auth-form.js +0 -54
  144. package/components/shadcn-example/blog-detail-page/comment-section.d.ts +0 -15
  145. package/components/shadcn-example/blog-detail-page/comment-section.js +0 -83
  146. package/components/shadcn-example/blog-detail-page/content.d.ts +0 -7
  147. package/components/shadcn-example/blog-detail-page/content.js +0 -15
  148. package/components/shadcn-example/blog-detail-page/header.d.ts +0 -11
  149. package/components/shadcn-example/blog-detail-page/header.js +0 -36
  150. package/components/shadcn-example/blog-detail-page/index.d.ts +0 -25
  151. package/components/shadcn-example/blog-detail-page/index.js +0 -74
  152. package/components/shadcn-example/blog-page/blog-post-card.d.ts +0 -13
  153. package/components/shadcn-example/blog-page/blog-post-card.js +0 -30
  154. package/components/shadcn-example/blog-page/featured-post-sidebar-item.d.ts +0 -10
  155. package/components/shadcn-example/blog-page/featured-post-sidebar-item.js +0 -19
  156. package/components/shadcn-example/blog-page/index.d.ts +0 -20
  157. package/components/shadcn-example/blog-page/index.js +0 -36
  158. package/components/shadcn-example/coming-soon/countdown.d.ts +0 -2
  159. package/components/shadcn-example/coming-soon/countdown.js +0 -82
  160. package/components/shadcn-example/coming-soon/index.d.ts +0 -10
  161. package/components/shadcn-example/coming-soon/index.js +0 -41
  162. package/components/shadcn-io/color-picker/index.d.ts +0 -43
  163. package/components/shadcn-io/color-picker/index.js +0 -304
  164. package/components/shadcn-io/copy-button/index.d.ts +0 -16
  165. package/components/shadcn-io/copy-button/index.js +0 -121
  166. package/components/shadcn-io/dropzone/index.d.ts +0 -19
  167. package/components/shadcn-io/dropzone/index.js +0 -131
  168. package/components/shadcn-io/gantt/index.d.ts +0 -145
  169. package/components/shadcn-io/gantt/index.js +0 -766
  170. package/components/shadcn-io/table/index.d.ts +0 -60
  171. package/components/shadcn-io/table/index.js +0 -138
  172. package/templates/appcorp-v1/footer/bottom-bar.d.ts +0 -6
  173. package/templates/appcorp-v1/footer/bottom-bar.js +0 -25
  174. package/templates/appcorp-v1/footer/cta.d.ts +0 -6
  175. package/templates/appcorp-v1/footer/cta.js +0 -21
  176. package/templates/appcorp-v1/footer/footer-grid.d.ts +0 -14
  177. package/templates/appcorp-v1/footer/footer-grid.js +0 -52
  178. package/templates/appcorp-v1/footer/index.d.ts +0 -3
  179. package/templates/appcorp-v1/footer/index.js +0 -28
  180. package/templates/appcorp-v1/footer/newsletter.d.ts +0 -11
  181. package/templates/appcorp-v1/footer/newsletter.js +0 -28
  182. package/templates/appcorp-v1/footer/stats.d.ts +0 -6
  183. package/templates/appcorp-v1/footer/stats.js +0 -15
  184. package/templates/appcorp-v1/header/announcement-bar.d.ts +0 -3
  185. package/templates/appcorp-v1/header/announcement-bar.js +0 -15
  186. package/templates/appcorp-v1/header/dropdown-panel.d.ts +0 -8
  187. package/templates/appcorp-v1/header/dropdown-panel.js +0 -72
  188. package/templates/appcorp-v1/header/index.d.ts +0 -12
  189. package/templates/appcorp-v1/header/index.js +0 -16
  190. package/templates/appcorp-v1/header/mobile-menu.d.ts +0 -14
  191. package/templates/appcorp-v1/header/mobile-menu.js +0 -101
  192. package/templates/appcorp-v1/header/navigation-bar.d.ts +0 -3
  193. package/templates/appcorp-v1/header/navigation-bar.js +0 -117
  194. package/templates/appcorp-v1/header/social-button.d.ts +0 -7
  195. package/templates/appcorp-v1/header/social-button.js +0 -48
  196. package/templates/appcorp-v1/home.d.ts +0 -3
  197. package/templates/appcorp-v1/home.js +0 -27
  198. package/templates/data/appcorp-v1.d.ts +0 -93
  199. package/templates/data/appcorp-v1.js +0 -348
  200. package/templates/data/edupilotpro-v1.d.ts +0 -33
  201. package/templates/data/edupilotpro-v1.js +0 -116
  202. package/templates/data/school-v1.d.ts +0 -328
  203. package/templates/data/school-v1.js +0 -1563
  204. package/templates/edupilotpro-v1/feature-card.d.ts +0 -13
  205. package/templates/edupilotpro-v1/feature-card.js +0 -28
  206. package/templates/edupilotpro-v1/mockups/dashboard-mockup.d.ts +0 -3
  207. package/templates/edupilotpro-v1/mockups/dashboard-mockup.js +0 -55
  208. package/templates/school-v1/footer.d.ts +0 -3
  209. package/templates/school-v1/footer.js +0 -75
  210. package/templates/school-v1/index.d.ts +0 -18
  211. package/templates/school-v1/index.js +0 -60
  212. package/templates/school-v1/navigation.d.ts +0 -3
  213. package/templates/school-v1/navigation.js +0 -123
  214. package/templates/school-v1/sections/about.d.ts +0 -3
  215. package/templates/school-v1/sections/about.js +0 -49
  216. package/templates/school-v1/sections/admissions.d.ts +0 -3
  217. package/templates/school-v1/sections/admissions.js +0 -77
  218. package/templates/school-v1/sections/contact.d.ts +0 -3
  219. package/templates/school-v1/sections/contact.js +0 -67
  220. package/templates/school-v1/sections/faqs.d.ts +0 -3
  221. package/templates/school-v1/sections/faqs.js +0 -50
  222. package/templates/school-v1/sections/hero.d.ts +0 -3
  223. package/templates/school-v1/sections/hero.js +0 -132
  224. package/templates/school-v1/sections/management.d.ts +0 -3
  225. package/templates/school-v1/sections/management.js +0 -34
  226. package/templates/school-v1/sections/policies.d.ts +0 -3
  227. package/templates/school-v1/sections/policies.js +0 -127
  228. package/templates/school-v1/sections/programs.d.ts +0 -3
  229. package/templates/school-v1/sections/programs.js +0 -107
  230. package/templates/school-v1/sections/testimonials.d.ts +0 -3
  231. package/templates/school-v1/sections/testimonials.js +0 -46
  232. package/templates/school-v1/sections/why-choose-us.d.ts +0 -3
  233. package/templates/school-v1/sections/why-choose-us.js +0 -57
@@ -1,48 +1,3 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
1
  var __rest = (this && this.__rest) || function (s, e) {
47
2
  var t = {};
48
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -54,12 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
54
9
  }
55
10
  return t;
56
11
  };
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- exports.AlertDescription = exports.AlertTitle = exports.Alert = void 0;
59
- var React = __importStar(require("react"));
60
- var class_variance_authority_1 = require("class-variance-authority");
61
- var utils_1 = require("../../lib/utils");
62
- var alertVariants = (0, class_variance_authority_1.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", {
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", {
63
16
  variants: {
64
17
  variant: {
65
18
  default: "bg-background text-foreground",
@@ -70,21 +23,19 @@ var alertVariants = (0, class_variance_authority_1.cva)("relative w-full rounded
70
23
  variant: "default",
71
24
  },
72
25
  });
73
- var Alert = React.forwardRef(function (_a, ref) {
74
- var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
75
- return (React.createElement("div", __assign({ ref: ref, role: "alert", className: (0, utils_1.cn)(alertVariants({ variant: variant }), className) }, props)));
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)));
76
29
  });
77
- exports.Alert = Alert;
78
30
  Alert.displayName = "Alert";
79
- var AlertTitle = React.forwardRef(function (_a, ref) {
80
- var className = _a.className, props = __rest(_a, ["className"]);
81
- return (React.createElement("h5", __assign({ ref: ref, className: (0, utils_1.cn)("mb-1 font-medium leading-none tracking-tight", className) }, props)));
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)));
82
34
  });
83
- exports.AlertTitle = AlertTitle;
84
35
  AlertTitle.displayName = "AlertTitle";
85
- var AlertDescription = React.forwardRef(function (_a, ref) {
86
- var className = _a.className, props = __rest(_a, ["className"]);
87
- return (React.createElement("div", __assign({ ref: ref, className: (0, utils_1.cn)("text-sm [&_p]:leading-relaxed", className) }, props)));
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)));
88
39
  });
89
- exports.AlertDescription = AlertDescription;
90
40
  AlertDescription.displayName = "AlertDescription";
41
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ interface ChartDataItem {
3
+ date: string;
4
+ [key: string]: number | string;
5
+ }
6
+ export interface AreaChartV1Props {
7
+ dates: ChartDataItem[];
8
+ description: string;
9
+ legends: string[];
10
+ title: string;
11
+ selectors: {
12
+ label: string;
13
+ value: string;
14
+ }[];
15
+ locale?: string;
16
+ onSelectorChange: (value: string) => void;
17
+ }
18
+ export declare const AreaChartV1: ({ dates, description, legends, title, selectors, locale, onSelectorChange, }: AreaChartV1Props) => React.JSX.Element;
19
+ export {};
@@ -0,0 +1,75 @@
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,19 +1,2 @@
1
- import * as React from "react";
2
- interface ChartDataItem {
3
- date: string;
4
- [key: string]: number | string;
5
- }
6
- export interface AreaChartV1Props {
7
- dates: ChartDataItem[];
8
- description: string;
9
- legends: string[];
10
- title: string;
11
- selectors: {
12
- label: string;
13
- value: string;
14
- }[];
15
- locale?: string;
16
- onSelectorChange: (value: string) => void;
17
- }
18
- export declare const AreaChartV1: ({ dates, description, legends, title, selectors, locale, onSelectorChange, }: AreaChartV1Props) => React.JSX.Element;
19
- export {};
1
+ export type { AreaChartV1Props } from "./area-chart-v1-impl";
2
+ export declare const AreaChartV1: typeof import("./area-chart-v1-impl")["AreaChartV1"];
@@ -1,114 +1,5 @@
1
1
  "use client";
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.AreaChartV1 = void 0;
38
- var React = __importStar(require("react"));
39
- var recharts_1 = require("recharts");
40
- var card_1 = require("../../components/ui/card");
41
- var chart_1 = require("../../components/ui/chart");
42
- var select_1 = require("../../components/ui/select");
43
- // Utility function to create ChartConfig from legends array
44
- var createChartConfig = function (legends) {
45
- return legends.reduce(function (acc, legend, index) {
46
- acc[legend.toLowerCase()] = {
47
- label: legend,
48
- color: "var(--chart-".concat(index + 1, ")"),
49
- };
50
- return acc;
51
- }, {});
52
- };
53
- var AreaChartV1 = function (_a) {
54
- var dates = _a.dates, description = _a.description, legends = _a.legends, title = _a.title, selectors = _a.selectors, _b = _a.locale, locale = _b === void 0 ? "en-US" : _b, onSelectorChange = _a.onSelectorChange;
55
- var _c = React.useState("30d"), timeRange = _c[0], setTimeRange = _c[1];
56
- var dynamicChartConfig = createChartConfig(legends);
57
- var handleValueChange = function (value) {
58
- setTimeRange(value);
59
- onSelectorChange(value);
60
- };
61
- var filteredData = React.useMemo(function () {
62
- var _a;
63
- var daysMap = {
64
- "7d": 7,
65
- "30d": 30,
66
- "90d": 90,
67
- };
68
- var daysToSubtract = (_a = daysMap[timeRange]) !== null && _a !== void 0 ? _a : 90;
69
- var referenceDate = new Date(dates[dates.length - 1].date);
70
- var startDate = new Date(referenceDate);
71
- startDate.setDate(referenceDate.getDate() - daysToSubtract);
72
- var startTime = startDate.getTime();
73
- return dates.filter(function (item) { return new Date(item.date).getTime() >= startTime; });
74
- }, [dates, timeRange]);
75
- return (React.createElement(card_1.Card, { className: "pt-0" },
76
- React.createElement(card_1.CardHeader, { className: "flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row" },
77
- React.createElement("div", { className: "grid flex-1 gap-1" },
78
- React.createElement(card_1.CardTitle, null, title),
79
- React.createElement(card_1.CardDescription, null, description)),
80
- React.createElement(select_1.Select, { value: timeRange, onValueChange: handleValueChange },
81
- React.createElement(select_1.SelectTrigger, { className: "hidden w-40 rounded-lg sm:ml-auto sm:flex", "aria-label": "Select a value" },
82
- React.createElement(select_1.SelectValue, { placeholder: "Last 3 months" })),
83
- React.createElement(select_1.SelectContent, { className: "rounded-xl" }, selectors.map(function (selector) { return (React.createElement(select_1.SelectItem, { key: selector.label, value: selector.value }, selector.label)); })))),
84
- React.createElement(card_1.CardContent, { className: "px-2 pt-4 sm:px-6 sm:pt-6" },
85
- React.createElement(chart_1.ChartContainer, { config: dynamicChartConfig, className: "aspect-auto h-[250px] w-full" },
86
- React.createElement(recharts_1.AreaChart, { data: filteredData },
87
- React.createElement("defs", null, legends.map(function (legend) {
88
- var key = legend.toLowerCase();
89
- return (React.createElement("linearGradient", { key: key, id: "fill".concat(legend), x1: "0", y1: "0", x2: "0", y2: "1" },
90
- React.createElement("stop", { offset: "5%", stopColor: "var(--color-".concat(key, ")"), stopOpacity: 0.8 }),
91
- React.createElement("stop", { offset: "95%", stopColor: "var(--color-".concat(key, ")"), stopOpacity: 0.1 })));
92
- })),
93
- React.createElement(recharts_1.CartesianGrid, { vertical: false }),
94
- React.createElement(recharts_1.YAxis, { domain: [0, "auto"], hide: true }),
95
- React.createElement(recharts_1.XAxis, { dataKey: "date", tickLine: false, axisLine: false, tickMargin: 8, minTickGap: 32, tickFormatter: function (value) {
96
- var date = new Date(value);
97
- return date.toLocaleDateString(locale, {
98
- month: "short",
99
- day: "numeric",
100
- });
101
- } }),
102
- React.createElement(chart_1.ChartTooltip, { cursor: false, content: React.createElement(chart_1.ChartTooltipContent, { labelFormatter: function (value) {
103
- return new Date(value).toLocaleDateString(locale, {
104
- month: "short",
105
- day: "numeric",
106
- });
107
- }, indicator: "dot" }) }),
108
- legends.map(function (legend) {
109
- var key = legend.toLowerCase();
110
- return (React.createElement(recharts_1.Area, { key: key, dataKey: key, type: "monotone", fill: "url(#fill".concat(legend, ")"), stroke: "var(--color-".concat(key, ")"), stackId: "a" }));
111
- }),
112
- React.createElement(chart_1.ChartLegend, { content: React.createElement(chart_1.ChartLegendContent, null) }))))));
113
- };
114
- exports.AreaChartV1 = AreaChartV1;
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,40 +1,4 @@
1
1
  "use client";
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.AspectRatio = void 0;
38
- var AspectRatioPrimitive = __importStar(require("@radix-ui/react-aspect-ratio"));
39
- var AspectRatio = AspectRatioPrimitive.Root;
40
- exports.AspectRatio = AspectRatio;
2
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
3
+ const AspectRatio = AspectRatioPrimitive.Root;
4
+ export { AspectRatio };
@@ -1,49 +1,4 @@
1
1
  "use client";
2
- "use strict";
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
- Object.defineProperty(o, "default", { enumerable: true, value: v });
27
- }) : function(o, v) {
28
- o["default"] = v;
29
- });
30
- var __importStar = (this && this.__importStar) || (function () {
31
- var ownKeys = function(o) {
32
- ownKeys = Object.getOwnPropertyNames || function (o) {
33
- var ar = [];
34
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
- return ar;
36
- };
37
- return ownKeys(o);
38
- };
39
- return function (mod) {
40
- if (mod && mod.__esModule) return mod;
41
- var result = {};
42
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
- __setModuleDefault(result, mod);
44
- return result;
45
- };
46
- })();
47
2
  var __rest = (this && this.__rest) || function (s, e) {
48
3
  var t = {};
49
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -55,26 +10,22 @@ var __rest = (this && this.__rest) || function (s, e) {
55
10
  }
56
11
  return t;
57
12
  };
58
- Object.defineProperty(exports, "__esModule", { value: true });
59
- exports.AvatarFallback = exports.AvatarImage = exports.Avatar = void 0;
60
- var React = __importStar(require("react"));
61
- var AvatarPrimitive = __importStar(require("@radix-ui/react-avatar"));
62
- var utils_1 = require("../../lib/utils");
63
- var Avatar = React.forwardRef(function (_a, ref) {
64
- var className = _a.className, props = __rest(_a, ["className"]);
65
- return (React.createElement(AvatarPrimitive.Root, __assign({ ref: ref, className: (0, utils_1.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className) }, props)));
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)));
66
19
  });
67
- exports.Avatar = Avatar;
68
20
  Avatar.displayName = AvatarPrimitive.Root.displayName;
69
- var AvatarImage = React.forwardRef(function (_a, ref) {
70
- var className = _a.className, props = __rest(_a, ["className"]);
71
- return (React.createElement(AvatarPrimitive.Image, __assign({ ref: ref, className: (0, utils_1.cn)("aspect-square h-full w-full", className) }, props)));
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)));
72
24
  });
73
- exports.AvatarImage = AvatarImage;
74
25
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
75
- var AvatarFallback = React.forwardRef(function (_a, ref) {
76
- var className = _a.className, props = __rest(_a, ["className"]);
77
- return (React.createElement(AvatarPrimitive.Fallback, __assign({ ref: ref, className: (0, utils_1.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted", className) }, props)));
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)));
78
29
  });
79
- exports.AvatarFallback = AvatarFallback;
80
30
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
31
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "secondary" | "default" | "destructive" | "outline" | null | undefined;
5
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
7
  }
8
8
  declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
@@ -1,48 +1,3 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
1
  var __rest = (this && this.__rest) || function (s, e) {
47
2
  var t = {};
48
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -54,13 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
54
9
  }
55
10
  return t;
56
11
  };
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- exports.badgeVariants = void 0;
59
- exports.Badge = Badge;
60
- var React = __importStar(require("react"));
61
- var class_variance_authority_1 = require("class-variance-authority");
62
- var utils_1 = require("../../lib/utils");
63
- var badgeVariants = (0, class_variance_authority_1.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", {
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", {
64
16
  variants: {
65
17
  variant: {
66
18
  default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
@@ -73,8 +25,8 @@ var badgeVariants = (0, class_variance_authority_1.cva)("inline-flex items-cente
73
25
  variant: "default",
74
26
  },
75
27
  });
76
- exports.badgeVariants = badgeVariants;
77
28
  function Badge(_a) {
78
- var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
79
- return (React.createElement("div", __assign({ className: (0, utils_1.cn)(badgeVariants({ variant: variant }), className) }, props)));
29
+ var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
30
+ return (React.createElement("div", Object.assign({ className: cn(badgeVariants({ variant }), className) }, props)));
80
31
  }
32
+ export { Badge, badgeVariants };