@minutemailer/kit 1.4.1 → 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 (202) hide show
  1. package/components/details-content.js +1 -1
  2. package/components/details.js +2 -2
  3. package/components/donut-chart.js +16 -4
  4. package/components/engagement-chart.js +2 -2
  5. package/components/index.d.ts +11 -0
  6. package/components/index.js +19 -0
  7. package/components/more.d.ts +2 -2
  8. package/components/more.js +2 -2
  9. package/components/page-tabs.js +2 -2
  10. package/components/ui/accordion.d.ts +5 -5
  11. package/components/ui/accordion.js +1 -1
  12. package/components/ui/alert.d.ts +4 -4
  13. package/components/ui/avatar.d.ts +4 -4
  14. package/components/ui/avatar.js +22 -2
  15. package/components/ui/badge.d.ts +2 -2
  16. package/components/ui/badge.js +2 -2
  17. package/components/ui/button.d.ts +2 -2
  18. package/components/ui/button.js +3 -3
  19. package/components/ui/calendar.d.ts +4 -4
  20. package/components/ui/calendar.js +34 -24
  21. package/components/ui/card.d.ts +8 -0
  22. package/components/ui/card.js +21 -0
  23. package/components/ui/chart.d.ts +7 -7
  24. package/components/ui/chart.js +7 -7
  25. package/components/ui/checkbox.d.ts +2 -2
  26. package/components/ui/checkbox.js +1 -1
  27. package/components/ui/dialog.d.ts +11 -11
  28. package/components/ui/dialog.js +1 -1
  29. package/components/ui/dropdown-menu.d.ts +16 -16
  30. package/components/ui/dropdown-menu.js +7 -7
  31. package/components/ui/field.d.ts +12 -11
  32. package/components/ui/field.js +2 -2
  33. package/components/ui/file-input.d.ts +8 -0
  34. package/components/ui/file-input.js +26 -0
  35. package/components/ui/form.d.ts +6 -6
  36. package/components/ui/form.js +6 -6
  37. package/components/ui/index.d.ts +30 -0
  38. package/components/ui/index.js +61 -0
  39. package/components/ui/input.d.ts +2 -2
  40. package/components/ui/input.js +2 -1
  41. package/components/ui/label.d.ts +2 -2
  42. package/components/ui/nav-menu.d.ts +14 -0
  43. package/components/ui/nav-menu.js +19 -0
  44. package/components/ui/pagination.d.ts +8 -8
  45. package/components/ui/pagination.js +5 -5
  46. package/components/ui/popover.d.ts +5 -5
  47. package/components/ui/popover.js +1 -1
  48. package/components/ui/separator.d.ts +2 -2
  49. package/components/ui/sheet.d.ts +9 -9
  50. package/components/ui/sidebar.d.ts +25 -25
  51. package/components/ui/sidebar.js +28 -28
  52. package/components/ui/skeleton.d.ts +2 -1
  53. package/components/ui/skeleton.js +1 -1
  54. package/components/ui/sonner.js +3 -3
  55. package/components/ui/spinner.d.ts +2 -1
  56. package/components/ui/spinner.js +1 -1
  57. package/components/ui/switch.d.ts +6 -0
  58. package/components/ui/switch.js +7 -0
  59. package/components/ui/table.d.ts +9 -9
  60. package/components/ui/tabs.d.ts +5 -5
  61. package/components/ui/tabs.js +7 -5
  62. package/components/ui/textarea.js +1 -1
  63. package/components/ui/tooltip.d.ts +5 -5
  64. package/components/ui/tooltip.js +2 -2
  65. package/components/ui/typography.d.ts +1 -5
  66. package/icons/Alert.js +1 -1
  67. package/icons/AlertFilled.js +1 -1
  68. package/icons/Arrow.js +1 -1
  69. package/icons/ArrowDown.js +1 -1
  70. package/icons/Attachment.js +1 -1
  71. package/icons/Automate.js +1 -1
  72. package/icons/Bold.js +1 -1
  73. package/icons/BorderBottom.js +1 -1
  74. package/icons/BorderLeft.js +1 -1
  75. package/icons/BorderRight.js +1 -1
  76. package/icons/BorderTop.js +1 -1
  77. package/icons/BottomAlign.js +1 -1
  78. package/icons/BottomLeftCorner.js +1 -1
  79. package/icons/BottomRightCorner.js +1 -1
  80. package/icons/Button.js +1 -1
  81. package/icons/Calendar.js +1 -1
  82. package/icons/Center.js +1 -1
  83. package/icons/Check.js +1 -1
  84. package/icons/CheckFilled.js +1 -1
  85. package/icons/Checkmark.js +1 -1
  86. package/icons/Chevron.js +1 -1
  87. package/icons/ChevronDown.js +1 -1
  88. package/icons/ChevronLeft.js +1 -1
  89. package/icons/ChevronUp.js +1 -1
  90. package/icons/Close.js +1 -1
  91. package/icons/CloseBold.js +1 -1
  92. package/icons/CloseCircle.js +1 -1
  93. package/icons/Column1.js +1 -1
  94. package/icons/Column12.js +1 -1
  95. package/icons/Column13.js +1 -1
  96. package/icons/Column2.js +1 -1
  97. package/icons/Column21.js +1 -1
  98. package/icons/Column3.js +1 -1
  99. package/icons/Column31.js +1 -1
  100. package/icons/Column4.js +1 -1
  101. package/icons/Contacts.js +1 -1
  102. package/icons/Crop.js +1 -1
  103. package/icons/Divider.js +1 -1
  104. package/icons/Download.js +1 -1
  105. package/icons/Duplicate.js +1 -1
  106. package/icons/Email.js +1 -1
  107. package/icons/Feedback.js +1 -1
  108. package/icons/File.js +1 -1
  109. package/icons/Filter.js +1 -1
  110. package/icons/Flip.js +1 -1
  111. package/icons/Flop.js +1 -1
  112. package/icons/Form.js +1 -1
  113. package/icons/Gift.js +1 -1
  114. package/icons/HeartRound.js +1 -1
  115. package/icons/Home.js +1 -1
  116. package/icons/HorizontalCenter.d.ts +3 -0
  117. package/icons/HorizontalCenter.js +3 -0
  118. package/icons/Image.js +1 -1
  119. package/icons/Images.js +1 -1
  120. package/icons/Info.js +1 -1
  121. package/icons/Integrations.js +1 -1
  122. package/icons/Italics.js +1 -1
  123. package/icons/Justified.js +1 -1
  124. package/icons/Left.js +1 -1
  125. package/icons/LeftAlign.js +1 -1
  126. package/icons/LetterSpacing.js +1 -1
  127. package/icons/LineHeight.js +1 -1
  128. package/icons/LineThickness.js +1 -1
  129. package/icons/Link.js +1 -1
  130. package/icons/List.js +1 -1
  131. package/icons/ListMenu.js +1 -1
  132. package/icons/ListNumbered.js +1 -1
  133. package/icons/Location.js +1 -1
  134. package/icons/LockChain.js +1 -1
  135. package/icons/Locked.js +1 -1
  136. package/icons/Logo.js +1 -1
  137. package/icons/Logout.js +1 -1
  138. package/icons/Lowercase.js +1 -1
  139. package/icons/Magic.js +1 -1
  140. package/icons/MarginBottom.js +1 -1
  141. package/icons/MarginLeft.js +1 -1
  142. package/icons/MarginRight.js +1 -1
  143. package/icons/MarginTop.js +1 -1
  144. package/icons/Menu.js +1 -1
  145. package/icons/Minus.js +1 -1
  146. package/icons/MinusBold.js +1 -1
  147. package/icons/MinutemailerLogo.js +1 -1
  148. package/icons/More.js +1 -1
  149. package/icons/Move.js +1 -1
  150. package/icons/MoveDirections.js +1 -1
  151. package/icons/MoveVertical.js +1 -1
  152. package/icons/Openclose.js +1 -1
  153. package/icons/Pen.js +1 -1
  154. package/icons/Phone.js +1 -1
  155. package/icons/Plane.js +1 -1
  156. package/icons/PlaneOutline.js +1 -1
  157. package/icons/Plus.js +1 -1
  158. package/icons/PlusBold.js +1 -1
  159. package/icons/PlusCircle.js +1 -1
  160. package/icons/Result.js +1 -1
  161. package/icons/Right.js +1 -1
  162. package/icons/RightAlign.js +1 -1
  163. package/icons/Rotate.js +1 -1
  164. package/icons/Search.js +1 -1
  165. package/icons/Settings.js +1 -1
  166. package/icons/Sms.js +1 -1
  167. package/icons/Spacing.js +1 -1
  168. package/icons/Spinner.js +1 -1
  169. package/icons/StarFilled.js +1 -1
  170. package/icons/StarOutline.js +1 -1
  171. package/icons/Stars.js +1 -1
  172. package/icons/Stats.js +1 -1
  173. package/icons/Stop.js +1 -1
  174. package/icons/Strikethrough.js +1 -1
  175. package/icons/Support.js +1 -1
  176. package/icons/Tags.js +1 -1
  177. package/icons/Team.js +1 -1
  178. package/icons/Text.js +1 -1
  179. package/icons/Thumbsdown.js +1 -1
  180. package/icons/Thumbsup.js +1 -1
  181. package/icons/TopAlign.js +1 -1
  182. package/icons/TopLeftCorner.js +1 -1
  183. package/icons/TopRightCorner.js +1 -1
  184. package/icons/Trash.js +1 -1
  185. package/icons/Underscore.js +1 -1
  186. package/icons/Unlink.js +1 -1
  187. package/icons/UnlockChain.js +1 -1
  188. package/icons/Unlocked.js +1 -1
  189. package/icons/Upload.js +1 -1
  190. package/icons/Uppercase.js +1 -1
  191. package/icons/VerticalCenter.js +1 -1
  192. package/icons/Video.js +1 -1
  193. package/icons/Warning.js +1 -1
  194. package/icons/Website.js +1 -1
  195. package/icons/Width.js +1 -1
  196. package/icons/Write.js +1 -1
  197. package/icons/index.d.ts +1 -1
  198. package/icons/index.js +1 -1
  199. package/package.json +32 -31
  200. package/styles.css +143 -51
  201. package/icons/HorisontalCenter.d.ts +0 -3
  202. package/icons/HorisontalCenter.js +0 -3
@@ -13,5 +13,5 @@ export function DetailsContent({ children, onClose = () => { }, close = false, }
13
13
  if (!mountNode) {
14
14
  return null;
15
15
  }
16
- return createPortal(_jsxs("div", { className: "p-4", children: [close && (_jsx("div", { className: "absolute top-4 right-4", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, children: _jsx(Close, {}) }) })), _jsx("div", { children: children })] }), mountNode);
16
+ return createPortal(_jsxs("div", { className: "p-4", children: [close && (_jsx("div", { className: "absolute top-4 right-4", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, "aria-label": "Close", children: _jsx(Close, {}) }) })), _jsx("div", { children: children })] }), mountNode);
17
17
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from 'react';
3
- import { motion } from 'motion/react';
3
+ import { cn } from '../utils/utils.js';
4
4
  import { useDetails } from './minutemailer-kit.js';
5
5
  export function Details({ children }) {
6
6
  const ref = useRef(null);
@@ -11,5 +11,5 @@ export function Details({ children }) {
11
11
  }
12
12
  return () => setMountNode(null);
13
13
  }, [setMountNode]);
14
- return (_jsx(motion.div, { initial: { translateX: visible ? 0 : '100%', translateY: 0 }, animate: { translateX: visible ? 0 : '100%', translateY: 0 }, className: "fixed top-(--header-height) right-0 bottom-0 z-25 bg-background w-full max-w-[658px] shadow-md", ref: ref, children: children }, "details"));
14
+ return (_jsx("div", { ref: ref, className: cn('fixed top-(--header-height) right-0 bottom-0 z-25 bg-background w-full max-w-[658px] shadow-md transition-transform duration-300 ease-out', visible ? 'translate-x-0' : 'translate-x-full'), children: children }));
15
15
  }
@@ -3,8 +3,20 @@ import { Cell, Label, Pie, PieChart } from 'recharts';
3
3
  import { ChartContainer } from '../components/ui/chart.js';
4
4
  export function DonutChart({ percentage, size = 120 }) {
5
5
  const COLORS = {
6
- filled: 'oklch(0.683 0.178 158.484)', // Primary green
7
- unfilled: 'oklch(0.922 0 0 / 0.3)', // Light gray transparent
6
+ filled: 'var(--primary)',
7
+ unfilled: 'var(--muted)',
8
+ };
9
+ // Determine font size class based on chart size
10
+ const getFontClass = () => {
11
+ if (size < 80)
12
+ return 'text-xs';
13
+ if (size < 120)
14
+ return 'text-sm';
15
+ if (size < 160)
16
+ return 'text-base';
17
+ if (size < 200)
18
+ return 'text-xl';
19
+ return 'text-2xl';
8
20
  };
9
21
  // Include both filled and unfilled portions in the same data
10
22
  const chartData = [
@@ -24,8 +36,8 @@ export function DonutChart({ percentage, size = 120 }) {
24
36
  return (_jsx(ChartContainer, { config: chartConfig, className: "aspect-square", style: { width: `${size}px`, height: `${size}px` }, children: _jsx(PieChart, { children: _jsxs(Pie, { data: chartData, dataKey: "value", nameKey: "name", innerRadius: "60%", outerRadius: "80%", startAngle: 90, endAngle: 450, paddingAngle: 0, stroke: "none", isAnimationActive: false, children: [_jsx(Cell, { fill: COLORS.filled, stroke: "none" }), _jsx(Cell, { fill: COLORS.unfilled, stroke: "none" }), _jsx(Label, { content: ({ viewBox }) => {
25
37
  if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
26
38
  const centerX = Number(viewBox.cx);
27
- const centerY = Number(viewBox.cy) + 4;
28
- return (_jsx("text", { x: centerX, y: centerY, textAnchor: "middle", dominantBaseline: "middle", children: _jsxs("tspan", { x: centerX, y: centerY, fill: COLORS.filled, className: "text-base font-semibold", children: [percentage, "%"] }) }));
39
+ const centerY = Number(viewBox.cy);
40
+ return (_jsx("text", { x: centerX, y: centerY, textAnchor: "middle", dominantBaseline: "middle", children: _jsxs("tspan", { x: centerX, y: centerY, fill: COLORS.filled, className: `${getFontClass()} font-semibold`, children: [percentage, "%"] }) }));
29
41
  }
30
42
  } })] }) }) }));
31
43
  }
@@ -15,11 +15,11 @@ const defaultData = [
15
15
  const chartConfig = {
16
16
  opens: {
17
17
  label: 'Opens',
18
- color: 'oklch(0.683 0.178 158.484)', // Primary green
18
+ color: 'var(--primary)',
19
19
  },
20
20
  clicks: {
21
21
  label: 'Clicks',
22
- color: 'oklch(0.656 0.173 256.68)', // Secondary purple
22
+ color: 'var(--secondary)',
23
23
  },
24
24
  };
25
25
  export function EngagementChart({ data = defaultData }) {
@@ -0,0 +1,11 @@
1
+ export { Confirm } from './confirm.js';
2
+ export { Details } from './details.js';
3
+ export { DetailsContent } from './details-content.js';
4
+ export { DonutChart, type DonutChartProps } from './donut-chart.js';
5
+ export { EngagementChart, type EngagementChartProps } from './engagement-chart.js';
6
+ export { ImageSlot, type ImageSlotAction, type ImageSlotProps } from './image-slot.js';
7
+ export { S3Image, type S3ImageProps } from './s3-image.js';
8
+ export { Context, MinutemailerKit, useMinutemailerKit, useS3Config, useDetails, } from './minutemailer-kit.js';
9
+ export { More, type MoreOption, type MoreProps } from './more.js';
10
+ export { PageTabs, type PageTab, type PageTabsProps } from './page-tabs.js';
11
+ export { ViewTitle, type ViewTitleProps } from './view-title.js';
@@ -0,0 +1,19 @@
1
+ // Barrel export for composite/application-level components
2
+ // Confirm Dialog
3
+ export { Confirm } from './confirm.js';
4
+ // Details
5
+ export { Details } from './details.js';
6
+ export { DetailsContent } from './details-content.js';
7
+ // Charts
8
+ export { DonutChart } from './donut-chart.js';
9
+ export { EngagementChart } from './engagement-chart.js';
10
+ // Image components
11
+ export { ImageSlot } from './image-slot.js';
12
+ export { S3Image } from './s3-image.js';
13
+ // Minutemailer Kit (Context & Providers)
14
+ export { Context, MinutemailerKit, useMinutemailerKit, useS3Config, useDetails, } from './minutemailer-kit.js';
15
+ // More (Dropdown actions)
16
+ export { More } from './more.js';
17
+ // Page components
18
+ export { PageTabs } from './page-tabs.js';
19
+ export { ViewTitle } from './view-title.js';
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
1
+ import { type ComponentType } from 'react';
2
2
  export type MoreOption = {
3
3
  value: string;
4
4
  name: string;
5
- icon?: React.ComponentType<any>;
5
+ icon?: ComponentType<Record<string, unknown>>;
6
6
  variant?: 'default' | 'destructive';
7
7
  disabled?: boolean;
8
8
  separator?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
2
+ import { Fragment } from 'react';
3
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../components/ui/dropdown-menu.js';
4
4
  import { Button } from '../components/ui/button.js';
5
5
  import MoreIcon from '../icons/More.js';
@@ -10,5 +10,5 @@ export function More({ options, loading = false, onChange, disabled = false, })
10
10
  onChange(value);
11
11
  }
12
12
  };
13
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", disabled: disabled || loading, "aria-label": "More options", children: loading ? _jsx(Spinner, {}) : _jsx(MoreIcon, {}) }) }), _jsx(DropdownMenuContent, { align: "end", children: options.map((option, index) => (_jsxs(React.Fragment, { children: [option.separator && _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "py-2.5", variant: option.variant, disabled: option.disabled, onSelect: () => handleSelect(option.value), children: [option.icon && _jsx(option.icon, {}), option.name] })] }, option.value))) })] }));
13
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", disabled: disabled || loading, "aria-label": "More options", children: loading ? _jsx(Spinner, {}) : _jsx(MoreIcon, {}) }) }), _jsx(DropdownMenuContent, { align: "end", children: options.map((option, index) => (_jsxs(Fragment, { children: [option.separator && _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "py-2.5", variant: option.variant, disabled: option.disabled, onSelect: () => handleSelect(option.value), children: [option.icon && _jsx(option.icon, {}), option.name] })] }, option.value))) })] }));
14
14
  }
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Button } from '../components/ui/button.js';
3
3
  import { cn } from '../utils/utils.js';
4
4
  export function PageTabs({ tabs, activeTab, onTabChange, className, }) {
5
- return (_jsx("div", { className: cn('flex items-center border-b bg-background px-6', className), children: _jsx("div", { className: "flex h-12 items-center gap-6", children: tabs.map((tab) => (_jsx(Button, { variant: "ghost", className: cn('h-12 rounded-none border-b-2 px-2 font-medium hover:bg-transparent hover:text-foreground text-base', activeTab === tab.id
6
- ? 'border-black text-foreground'
5
+ return (_jsx("div", { className: cn('flex items-center border-b bg-background px-6', className), children: _jsx("div", { role: "tablist", className: "flex h-12 items-center gap-6", children: tabs.map((tab) => (_jsx(Button, { role: "tab", "aria-selected": activeTab === tab.id, variant: "ghost", className: cn('h-12 rounded-none border-b-2 px-2 font-medium hover:bg-transparent hover:text-foreground text-base', activeTab === tab.id
6
+ ? 'border-foreground text-foreground'
7
7
  : 'border-transparent text-muted-foreground'), onClick: () => onTabChange?.(tab.id), children: tab.label }, tab.id))) }) }));
8
8
  }
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
- declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
- declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
- declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Accordion({ ...props }: ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function AccordionItem({ className, ...props }: ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AccordionContent({ className, children, ...props }: ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
7
  export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -9,7 +9,7 @@ function AccordionItem({ className, ...props }) {
9
9
  return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('border-b', className), ...props }));
10
10
  }
11
11
  function AccordionTrigger({ className, children, ...props }) {
12
- return (_jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-header", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('flex flex-1 cursor-pointer items-center justify-between rounded-md px-4 py-5 font-medium transition-all hover:bg-accent/50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })] }) }));
12
+ return (_jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-header", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('flex flex-1 cursor-pointer items-center justify-between rounded-md px-4 py-5 font-medium transition-all hover:bg-muted/50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "size-4 shrink-0 transition-transform duration-200", "aria-hidden": "true" })] }) }));
13
13
  }
14
14
  function AccordionContent({ className, children, ...props }) {
15
15
  return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden px-4 py-4 text-sm transition-all", ...props, children: _jsx("div", { className: cn('pb-4 pt-0', className), children: children }) }));
@@ -1,9 +1,9 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const alertVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function Alert({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
- declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
- declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
6
+ declare function Alert({ className, variant, ...props }: ComponentProps<'div'> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
+ declare function AlertTitle({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDescription({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
9
  export { Alert, AlertTitle, AlertDescription };
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
- declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
- declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Avatar({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function AvatarImage({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AvatarFallback({ className, children, ...props }: ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
6
6
  export { Avatar, AvatarImage, AvatarFallback };
@@ -7,7 +7,27 @@ function Avatar({ className, ...props }) {
7
7
  function AvatarImage({ className, ...props }) {
8
8
  return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
9
9
  }
10
- function AvatarFallback({ className, ...props }) {
11
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
10
+ // Avatar color combinations using design system tokens
11
+ // Light mode: light bg (100) + dark text (500)
12
+ // Dark mode: dark bg (500) + light text (100)
13
+ const avatarColors = [
14
+ 'bg-green-100 text-green-500 dark:bg-green-500 dark:text-green-100',
15
+ 'bg-blue-100 text-blue-500 dark:bg-blue-500 dark:text-blue-100',
16
+ 'bg-red-100 text-red-500 dark:bg-red-500 dark:text-red-100',
17
+ 'bg-orange-100 text-orange-500 dark:bg-orange-500 dark:text-orange-100',
18
+ 'bg-purple-100 text-purple-500 dark:bg-purple-500 dark:text-purple-100',
19
+ ];
20
+ function getColorIndex(text) {
21
+ let hash = 0;
22
+ for (let i = 0; i < text.length; i++) {
23
+ hash = text.charCodeAt(i) + ((hash << 5) - hash);
24
+ }
25
+ return Math.abs(hash) % avatarColors.length;
26
+ }
27
+ function AvatarFallback({ className, children, ...props }) {
28
+ // Extract text content from children for color determination
29
+ const text = typeof children === 'string' ? children : '';
30
+ const colorClass = text ? avatarColors[getColorIndex(text)] : '';
31
+ return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('flex size-full items-center justify-center rounded-full font-medium', text ? colorClass : 'bg-muted', className), ...props, children: children }));
12
32
  }
13
33
  export { Avatar, AvatarImage, AvatarFallback };
@@ -1,9 +1,9 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
6
+ declare function Badge({ className, variant, asChild, ...props }: ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
7
  asChild?: boolean;
8
8
  }): import("react/jsx-runtime").JSX.Element;
9
9
  export { Badge, badgeVariants };
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Slot } from '@radix-ui/react-slot';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { cn } from '../../utils/utils.js';
5
- const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-4 py-2 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
5
+ const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-4 py-2 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 [&>svg]:[stroke-width:2.5] gap-1.5 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
6
6
  variants: {
7
7
  variant: {
8
8
  default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
9
9
  secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
10
10
  destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
11
- outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
11
+ outline: 'text-foreground [a&]:hover:bg-muted [a&]:hover:text-foreground',
12
12
  },
13
13
  },
14
14
  defaultVariants: {
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
7
+ declare function Button({ className, variant, size, asChild, ...props }: ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
10
  export { Button, buttonVariants };
@@ -7,9 +7,9 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
7
7
  variant: {
8
8
  default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
9
9
  destructive: 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
10
- outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
10
+ outline: 'border bg-background shadow-xs hover:bg-muted hover:text-foreground dark:bg-border/30 dark:border-border dark:hover:bg-border/50',
11
11
  secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
12
- ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
12
+ ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50',
13
13
  link: 'text-primary underline-offset-4 hover:underline',
14
14
  },
15
15
  size: {
@@ -26,6 +26,6 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
26
26
  });
27
27
  function Button({ className, variant, size, asChild = false, ...props }) {
28
28
  const Comp = asChild ? Slot : 'button';
29
- return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
29
+ return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size }), className), ...props }));
30
30
  }
31
31
  export { Button, buttonVariants };
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import { DayButton, DayPicker } from 'react-day-picker';
3
3
  import { Button } from '../../components/ui/button.js';
4
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
5
- buttonVariant?: React.ComponentProps<typeof Button>['variant'];
4
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: ComponentProps<typeof DayPicker> & {
5
+ buttonVariant?: ComponentProps<typeof Button>['variant'];
6
6
  }): import("react/jsx-runtime").JSX.Element;
7
- declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
7
+ declare function CalendarDayButton({ className, day, modifiers, ...props }: ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
8
8
  export { Calendar, CalendarDayButton };
@@ -1,39 +1,36 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useEffect, } from 'react';
3
3
  import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from 'lucide-react';
4
- import { DayPicker, getDefaultClassNames } from 'react-day-picker';
4
+ import { DayPicker, getDefaultClassNames, } from 'react-day-picker';
5
5
  import { cn } from '../../utils/utils.js';
6
6
  import { Button, buttonVariants } from '../../components/ui/button.js';
7
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../../components/ui/dropdown-menu.js';
7
8
  function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }) {
8
9
  const defaultClassNames = getDefaultClassNames();
9
- return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[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: {
10
+ return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-5 [--cell-size:--spacing(8)] [[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: {
10
11
  formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
11
12
  ...formatters,
12
13
  }, classNames: {
13
14
  root: cn('w-fit', defaultClassNames.root),
14
15
  months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
15
16
  month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
16
- nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
17
- button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
18
- button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
19
- month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
20
- dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
21
- dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root),
22
- dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
23
- caption_label: cn('select-none font-medium', captionLayout === 'label'
24
- ? 'text-sm'
25
- : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
17
+ nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between pointer-events-none', defaultClassNames.nav),
18
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none pointer-events-auto', defaultClassNames.button_previous),
19
+ button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none pointer-events-auto', defaultClassNames.button_next),
20
+ month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size) relative z-10', defaultClassNames.month_caption),
21
+ dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-0', defaultClassNames.dropdowns),
22
+ caption_label: cn('select-none font-medium text-sm', defaultClassNames.caption_label),
26
23
  table: 'w-full border-collapse',
27
- weekdays: cn('flex', defaultClassNames.weekdays),
28
- weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
29
- week: cn('flex w-full mt-2', defaultClassNames.week),
24
+ weekdays: cn('flex gap-1', defaultClassNames.weekdays),
25
+ weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-xs select-none', defaultClassNames.weekday),
26
+ week: cn('flex w-full mt-1 gap-1', defaultClassNames.week),
30
27
  week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
31
- week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
28
+ week_number: cn('text-xs select-none text-muted-foreground', defaultClassNames.week_number),
32
29
  day: cn('relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', defaultClassNames.day),
33
- range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
30
+ range_start: cn('rounded-l-md bg-muted', defaultClassNames.range_start),
34
31
  range_middle: cn('rounded-none', defaultClassNames.range_middle),
35
- range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
36
- today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
32
+ range_end: cn('rounded-r-md bg-muted', defaultClassNames.range_end),
33
+ today: cn('bg-muted text-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
37
34
  outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
38
35
  disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
39
36
  hidden: cn('invisible', defaultClassNames.hidden),
@@ -55,19 +52,32 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
55
52
  WeekNumber: ({ children, ...props }) => {
56
53
  return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
57
54
  },
55
+ Dropdown: CalendarDropdown,
58
56
  ...components,
59
57
  }, ...props }));
60
58
  }
59
+ function CalendarDropdown({ value, options, onChange, 'aria-label': ariaLabel, }) {
60
+ const selectedOption = options?.find((option) => option.value === value);
61
+ const handleSelect = (newValue) => {
62
+ if (onChange) {
63
+ const syntheticEvent = {
64
+ target: { value: String(newValue) },
65
+ };
66
+ onChange(syntheticEvent);
67
+ }
68
+ };
69
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "gap-1 font-medium", "aria-label": ariaLabel, children: [selectedOption?.label, _jsx(ChevronDownIcon, { className: "size-3.5 text-muted-foreground", "aria-hidden": "true" })] }) }), _jsx(DropdownMenuContent, { align: "center", className: "max-h-64 overflow-y-auto", children: options?.map((option) => (_jsx(DropdownMenuItem, { onSelect: () => handleSelect(option.value), className: cn(option.value === value && 'bg-muted font-medium'), children: option.label }, option.value))) })] }));
70
+ }
61
71
  function CalendarDayButton({ className, day, modifiers, ...props }) {
62
72
  const defaultClassNames = getDefaultClassNames();
63
- const ref = React.useRef(null);
64
- React.useEffect(() => {
73
+ const ref = useRef(null);
74
+ useEffect(() => {
65
75
  if (modifiers.focused)
66
76
  ref.current?.focus();
67
77
  }, [modifiers.focused]);
68
78
  return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
69
79
  !modifiers.range_start &&
70
80
  !modifiers.range_end &&
71
- !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 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
81
+ !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-muted data-[range-middle=true]:text-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 dark:hover:text-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
72
82
  }
73
83
  export { Calendar, CalendarDayButton };
@@ -0,0 +1,8 @@
1
+ import type { ComponentProps } from 'react';
2
+ declare function Card({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
3
+ declare function CardHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
4
+ declare function CardTitle({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
5
+ declare function CardDescription({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
6
+ declare function CardContent({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
7
+ declare function CardFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
+ export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../utils/utils.js';
3
+ function Card({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "card", className: cn('rounded-lg bg-card text-card-foreground', className), ...props }));
5
+ }
6
+ function CardHeader({ className, ...props }) {
7
+ return (_jsx("div", { "data-slot": "card-header", className: cn('flex flex-col gap-1.5 p-6', className), ...props }));
8
+ }
9
+ function CardTitle({ className, ...props }) {
10
+ return (_jsx("div", { "data-slot": "card-title", className: cn('font-semibold leading-none tracking-tight', className), ...props }));
11
+ }
12
+ function CardDescription({ className, ...props }) {
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn('text-sm text-muted-foreground', className), ...props }));
14
+ }
15
+ function CardContent({ className, ...props }) {
16
+ return (_jsx("div", { "data-slot": "card-content", className: cn('p-6 pt-0', className), ...props }));
17
+ }
18
+ function CardFooter({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center p-6 pt-0', className), ...props }));
20
+ }
21
+ export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
2
2
  import * as RechartsPrimitive from "recharts";
3
3
  export type ChartConfig = {
4
4
  [k in string]: {
5
- label?: React.ReactNode;
6
- icon?: React.ComponentType;
5
+ label?: ReactNode;
6
+ icon?: ComponentType;
7
7
  } & ({
8
8
  color?: string;
9
9
  theme?: never;
@@ -16,12 +16,12 @@ declare const THEMES: {
16
16
  readonly light: "";
17
17
  readonly dark: "";
18
18
  };
19
- export interface ChartContainerProps extends React.ComponentProps<"div"> {
19
+ export interface ChartContainerProps extends ComponentProps<"div"> {
20
20
  config: ChartConfig;
21
- children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
21
+ children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
22
22
  }
23
23
  export declare function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps): import("react/jsx-runtime").JSX.Element;
24
- export interface ChartTooltipProps extends React.ComponentProps<typeof RechartsPrimitive.Tooltip> {
24
+ export interface ChartTooltipProps extends ComponentProps<typeof RechartsPrimitive.Tooltip> {
25
25
  hideLabel?: boolean;
26
26
  hideIndicator?: boolean;
27
27
  indicator?: "line" | "dot" | "dashed";
@@ -29,7 +29,7 @@ export interface ChartTooltipProps extends React.ComponentProps<typeof RechartsP
29
29
  labelKey?: string;
30
30
  }
31
31
  export declare function ChartTooltip({ ...props }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
32
- export interface ChartTooltipContentProps extends Omit<React.ComponentProps<typeof RechartsPrimitive.Tooltip>, "content">, React.ComponentProps<"div"> {
32
+ export interface ChartTooltipContentProps extends Omit<ComponentProps<typeof RechartsPrimitive.Tooltip>, "content">, ComponentProps<"div"> {
33
33
  hideLabel?: boolean;
34
34
  hideIndicator?: boolean;
35
35
  indicator?: "line" | "dot" | "dashed";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import * as React from "react";
3
+ import { createContext, useContext, useId, useMemo, } from "react";
4
4
  import * as RechartsPrimitive from "recharts";
5
5
  import { cn } from "../../utils/utils.js";
6
6
  const THEMES = { light: "", dark: "" };
7
7
  export function ChartContainer({ id, className, children, config, ...props }) {
8
- const uniqueId = React.useId();
8
+ const uniqueId = useId();
9
9
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
10
10
  return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
11
11
  }
@@ -19,7 +19,7 @@ function ChartStyle({ id, config }) {
19
19
  [data-chart=${id}] {
20
20
  ${colorConfig
21
21
  .map(([key, itemConfig]) => {
22
- const color = itemConfig.theme?.light || itemConfig.color || `hsl(var(--chart-${key.charAt(key.length - 1)}))`;
22
+ const color = itemConfig.theme?.light || itemConfig.color || `var(--primary)`;
23
23
  return ` --color-${key}: ${color};`;
24
24
  })
25
25
  .join("\n")}
@@ -32,7 +32,7 @@ export function ChartTooltip({ ...props }) {
32
32
  }
33
33
  export function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
34
34
  const { config } = useChart();
35
- const tooltipLabel = React.useMemo(() => {
35
+ const tooltipLabel = useMemo(() => {
36
36
  if (hideLabel || !payload?.length) {
37
37
  return null;
38
38
  }
@@ -62,7 +62,7 @@ export function ChartTooltipContent({ active, payload, className, indicator = "d
62
62
  return null;
63
63
  }
64
64
  const nestLabel = payload.length === 1 && indicator !== "dot";
65
- return (_jsxs("div", { className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
65
+ return (_jsxs("div", { role: "tooltip", className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
66
66
  const key = `${nameKey || item.name || item.dataKey || "value"}`;
67
67
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
68
68
  const indicatorColor = color || item.payload.fill || item.color;
@@ -78,9 +78,9 @@ export function ChartTooltipContent({ active, payload, className, indicator = "d
78
78
  }) })] }));
79
79
  }
80
80
  // Chart Context
81
- const ChartContext = React.createContext(null);
81
+ const ChartContext = createContext(null);
82
82
  function useChart() {
83
- const context = React.useContext(ChartContext);
83
+ const context = useContext(ChartContext);
84
84
  if (!context) {
85
85
  throw new Error("useChart must be used within a <ChartContainer />");
86
86
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
- declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Checkbox({ className, ...props }: ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
4
  export { Checkbox };
@@ -4,6 +4,6 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
4
  import { CheckIcon } from 'lucide-react';
5
5
  import { cn } from '../../utils/utils.js';
6
6
  function Checkbox({ className, ...props }) {
7
- return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer border-black/20 cursor-pointer hover:border-foreground/40 dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border-2 shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center transition-none", children: _jsx(CheckIcon, { className: "size-3.5 !text-white" }) }) }));
7
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer border-border cursor-pointer hover:border-foreground/40 dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border-2 shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center transition-none", children: _jsx(CheckIcon, { className: "size-3.5 text-primary-foreground", strokeWidth: 3 }) }) }));
8
8
  }
9
9
  export { Checkbox };
@@ -1,15 +1,15 @@
1
- import * as React from 'react';
1
+ import { type ComponentProps } from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
- declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
- declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
- declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
3
+ declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogClose({ ...props }: ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
9
9
  showCloseButton?: boolean;
10
10
  }): import("react/jsx-runtime").JSX.Element;
11
- declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
- declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
13
- declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
- declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
13
+ declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
15
15
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };