@mbao01/common 0.8.0 → 0.9.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 (276) hide show
  1. package/dist/types/components/ActivityFeed/ActivityFeed.d.ts +6 -0
  2. package/dist/types/components/ActivityFeed/constants.d.ts +6 -0
  3. package/dist/types/components/ActivityFeed/index.d.ts +2 -0
  4. package/dist/types/components/ActivityFeed/types.d.ts +21 -0
  5. package/dist/types/components/Amount/Amount.d.ts +6 -0
  6. package/dist/types/components/Amount/index.d.ts +2 -0
  7. package/dist/types/components/Amount/types.d.ts +19 -0
  8. package/dist/types/components/AnimatedCounter/AnimatedCounter.d.ts +6 -0
  9. package/dist/types/components/AnimatedCounter/index.d.ts +2 -0
  10. package/dist/types/components/AnimatedCounter/types.d.ts +13 -0
  11. package/dist/types/components/AnimatedGroup/AnimatedGroup.d.ts +6 -0
  12. package/dist/types/components/AnimatedGroup/index.d.ts +2 -0
  13. package/dist/types/components/AnimatedGroup/types.d.ts +22 -0
  14. package/dist/types/components/AnimatedList/AnimatedList.d.ts +6 -0
  15. package/dist/types/components/AnimatedList/index.d.ts +2 -0
  16. package/dist/types/components/AnimatedList/types.d.ts +13 -0
  17. package/dist/types/components/BorderBeam/BorderBeam.d.ts +6 -0
  18. package/dist/types/components/BorderBeam/index.d.ts +2 -0
  19. package/dist/types/components/BorderBeam/types.d.ts +13 -0
  20. package/dist/types/components/Box/Box.d.ts +4 -0
  21. package/dist/types/components/Box/constants.d.ts +4 -0
  22. package/dist/types/components/CalendarHeatmap/CalendarHeatmap.d.ts +6 -0
  23. package/dist/types/components/CalendarHeatmap/index.d.ts +2 -0
  24. package/dist/types/components/CalendarHeatmap/types.d.ts +25 -0
  25. package/dist/types/components/Chart/components/ChartLegend.d.ts +1 -2
  26. package/dist/types/components/Chart/stories/args/index.d.ts +1 -1
  27. package/dist/types/components/Chart/stories/examples/AreaChart.d.ts +6 -0
  28. package/dist/types/components/Chart/stories/examples/BarChart.d.ts +11 -0
  29. package/dist/types/components/Chart/stories/examples/LineChart.d.ts +10 -0
  30. package/dist/types/components/Chart/stories/examples/PieChart.d.ts +5 -0
  31. package/dist/types/components/Chart/stories/examples/RadialChart.d.ts +5 -0
  32. package/dist/types/components/Chart/types.d.ts +1 -1
  33. package/dist/types/components/CircularProgress/CircularProgress.d.ts +6 -0
  34. package/dist/types/components/CircularProgress/constants.d.ts +5 -0
  35. package/dist/types/components/CircularProgress/index.d.ts +2 -0
  36. package/dist/types/components/CircularProgress/types.d.ts +17 -0
  37. package/dist/types/components/ComparisonBar/ComparisonBar.d.ts +6 -0
  38. package/dist/types/components/ComparisonBar/constants.d.ts +4 -0
  39. package/dist/types/components/ComparisonBar/index.d.ts +2 -0
  40. package/dist/types/components/ComparisonBar/types.d.ts +21 -0
  41. package/dist/types/components/Confetti/Confetti.d.ts +6 -0
  42. package/dist/types/components/Confetti/index.d.ts +2 -0
  43. package/dist/types/components/Confetti/types.d.ts +19 -0
  44. package/dist/types/components/CountdownTimer/CountdownTimer.d.ts +6 -0
  45. package/dist/types/components/CountdownTimer/index.d.ts +2 -0
  46. package/dist/types/components/CountdownTimer/types.d.ts +13 -0
  47. package/dist/types/components/DataList/DataList.d.ts +6 -0
  48. package/dist/types/components/DataList/constants.d.ts +12 -0
  49. package/dist/types/components/DataList/index.d.ts +2 -0
  50. package/dist/types/components/DataList/types.d.ts +15 -0
  51. package/dist/types/components/DatePicker/DateRangePresetPicker.d.ts +2 -0
  52. package/dist/types/components/DatePicker/index.d.ts +1 -0
  53. package/dist/types/components/DatePicker/types.d.ts +19 -0
  54. package/dist/types/components/Description/Description.d.ts +2 -1
  55. package/dist/types/components/Description/DescriptionGroup.d.ts +6 -0
  56. package/dist/types/components/Description/constants.d.ts +23 -0
  57. package/dist/types/components/Description/index.d.ts +2 -0
  58. package/dist/types/components/Description/types.d.ts +28 -3
  59. package/dist/types/components/Form/DatetimeInput/DatetimeInput.d.ts +1 -1
  60. package/dist/types/components/GlowCard/GlowCard.d.ts +6 -0
  61. package/dist/types/components/GlowCard/index.d.ts +2 -0
  62. package/dist/types/components/GlowCard/types.d.ts +8 -0
  63. package/dist/types/components/GradientText/GradientText.d.ts +6 -0
  64. package/dist/types/components/GradientText/index.d.ts +2 -0
  65. package/dist/types/components/GradientText/types.d.ts +14 -0
  66. package/dist/types/components/Greeting/Greeting.d.ts +6 -0
  67. package/dist/types/components/Greeting/index.d.ts +2 -0
  68. package/dist/types/components/Greeting/types.d.ts +9 -0
  69. package/dist/types/components/KPICard/KPICard.d.ts +6 -0
  70. package/dist/types/components/KPICard/index.d.ts +2 -0
  71. package/dist/types/components/KPICard/types.d.ts +21 -0
  72. package/dist/types/components/Marquee/Marquee.d.ts +6 -0
  73. package/dist/types/components/Marquee/index.d.ts +2 -0
  74. package/dist/types/components/Marquee/types.d.ts +12 -0
  75. package/dist/types/components/Meteors/Meteors.d.ts +6 -0
  76. package/dist/types/components/Meteors/index.d.ts +2 -0
  77. package/dist/types/components/Meteors/types.d.ts +5 -0
  78. package/dist/types/components/MiniAreaChart/MiniAreaChart.d.ts +6 -0
  79. package/dist/types/components/MiniAreaChart/index.d.ts +2 -0
  80. package/dist/types/components/MiniAreaChart/types.d.ts +10 -0
  81. package/dist/types/components/MiniBarChart/MiniBarChart.d.ts +6 -0
  82. package/dist/types/components/MiniBarChart/index.d.ts +2 -0
  83. package/dist/types/components/MiniBarChart/types.d.ts +15 -0
  84. package/dist/types/components/MiniDonutChart/MiniDonutChart.d.ts +6 -0
  85. package/dist/types/components/MiniDonutChart/index.d.ts +2 -0
  86. package/dist/types/components/MiniDonutChart/types.d.ts +15 -0
  87. package/dist/types/components/MiniStackedBar/MiniStackedBar.d.ts +6 -0
  88. package/dist/types/components/MiniStackedBar/index.d.ts +2 -0
  89. package/dist/types/components/MiniStackedBar/types.d.ts +13 -0
  90. package/dist/types/components/NumberTicker/NumberTicker.d.ts +6 -0
  91. package/dist/types/components/NumberTicker/index.d.ts +2 -0
  92. package/dist/types/components/NumberTicker/types.d.ts +11 -0
  93. package/dist/types/components/Pulse/Pulse.d.ts +6 -0
  94. package/dist/types/components/Pulse/constants.d.ts +10 -0
  95. package/dist/types/components/Pulse/index.d.ts +2 -0
  96. package/dist/types/components/Pulse/types.d.ts +11 -0
  97. package/dist/types/components/Resizable/Resizable.d.ts +1 -1
  98. package/dist/types/components/ShinyButton/ShinyButton.d.ts +6 -0
  99. package/dist/types/components/ShinyButton/index.d.ts +2 -0
  100. package/dist/types/components/ShinyButton/types.d.ts +4 -0
  101. package/dist/types/components/Sparkline/Sparkline.d.ts +6 -0
  102. package/dist/types/components/Sparkline/index.d.ts +2 -0
  103. package/dist/types/components/Sparkline/types.d.ts +17 -0
  104. package/dist/types/components/SpotlightCard/SpotlightCard.d.ts +6 -0
  105. package/dist/types/components/SpotlightCard/index.d.ts +2 -0
  106. package/dist/types/components/SpotlightCard/types.d.ts +7 -0
  107. package/dist/types/components/StatCard/StatCard.d.ts +6 -0
  108. package/dist/types/components/StatCard/index.d.ts +2 -0
  109. package/dist/types/components/StatCard/types.d.ts +15 -0
  110. package/dist/types/components/TextShimmer/TextShimmer.d.ts +6 -0
  111. package/dist/types/components/TextShimmer/index.d.ts +2 -0
  112. package/dist/types/components/TextShimmer/types.d.ts +7 -0
  113. package/dist/types/components/TrendBadge/TrendBadge.d.ts +6 -0
  114. package/dist/types/components/TrendBadge/constants.d.ts +7 -0
  115. package/dist/types/components/TrendBadge/index.d.ts +2 -0
  116. package/dist/types/components/TrendBadge/types.d.ts +15 -0
  117. package/dist/types/components/WidgetShell/WidgetShell.d.ts +6 -0
  118. package/dist/types/components/WidgetShell/index.d.ts +2 -0
  119. package/dist/types/components/WidgetShell/types.d.ts +20 -0
  120. package/dist/types/index.d.ts +33 -0
  121. package/package.json +58 -58
  122. package/src/components/Accordion/constants.ts +1 -1
  123. package/src/components/ActivityFeed/ActivityFeed.tsx +51 -0
  124. package/src/components/ActivityFeed/constants.ts +19 -0
  125. package/src/components/ActivityFeed/index.ts +2 -0
  126. package/src/components/ActivityFeed/types.ts +23 -0
  127. package/src/components/Alert/constants.ts +1 -1
  128. package/src/components/AlertDialog/constants.ts +1 -1
  129. package/src/components/Amount/Amount.tsx +50 -0
  130. package/src/components/Amount/index.ts +2 -0
  131. package/src/components/Amount/types.ts +20 -0
  132. package/src/components/AnimatedCounter/AnimatedCounter.tsx +68 -0
  133. package/src/components/AnimatedCounter/index.ts +2 -0
  134. package/src/components/AnimatedCounter/types.ts +14 -0
  135. package/src/components/AnimatedGroup/AnimatedGroup.tsx +97 -0
  136. package/src/components/AnimatedGroup/index.ts +2 -0
  137. package/src/components/AnimatedGroup/types.ts +21 -0
  138. package/src/components/AnimatedList/AnimatedList.tsx +42 -0
  139. package/src/components/AnimatedList/index.ts +2 -0
  140. package/src/components/AnimatedList/types.ts +15 -0
  141. package/src/components/Badge/constants.ts +1 -1
  142. package/src/components/Banner/constants.ts +1 -1
  143. package/src/components/BorderBeam/BorderBeam.tsx +41 -0
  144. package/src/components/BorderBeam/index.ts +2 -0
  145. package/src/components/BorderBeam/types.ts +14 -0
  146. package/src/components/Box/Box.tsx +8 -2
  147. package/src/components/Box/constants.ts +35 -0
  148. package/src/components/Button/constants.ts +66 -63
  149. package/src/components/CalendarHeatmap/CalendarHeatmap.tsx +141 -0
  150. package/src/components/CalendarHeatmap/index.ts +2 -0
  151. package/src/components/CalendarHeatmap/types.ts +27 -0
  152. package/src/components/Card/constants.ts +24 -21
  153. package/src/components/Carousel/constants.ts +2 -2
  154. package/src/components/Chart/components/ChartTooltip.tsx +1 -1
  155. package/src/components/Chart/stories/args/index.ts +2 -1
  156. package/src/components/Chart/stories/examples/AreaChart.tsx +55 -0
  157. package/src/components/Chart/stories/examples/BarChart.tsx +104 -6
  158. package/src/components/Chart/stories/examples/LineChart.tsx +111 -0
  159. package/src/components/Chart/stories/examples/PieChart.tsx +55 -0
  160. package/src/components/Chart/stories/examples/RadialChart.tsx +65 -0
  161. package/src/components/Chart/types.ts +1 -1
  162. package/src/components/CircularProgress/CircularProgress.tsx +46 -0
  163. package/src/components/CircularProgress/constants.ts +32 -0
  164. package/src/components/CircularProgress/index.ts +2 -0
  165. package/src/components/CircularProgress/types.ts +18 -0
  166. package/src/components/Command/constants.ts +1 -1
  167. package/src/components/ComparisonBar/ComparisonBar.tsx +65 -0
  168. package/src/components/ComparisonBar/constants.ts +23 -0
  169. package/src/components/ComparisonBar/index.ts +2 -0
  170. package/src/components/ComparisonBar/types.ts +23 -0
  171. package/src/components/Confetti/Confetti.tsx +82 -0
  172. package/src/components/Confetti/index.ts +2 -0
  173. package/src/components/Confetti/types.ts +20 -0
  174. package/src/components/CountdownTimer/CountdownTimer.tsx +91 -0
  175. package/src/components/CountdownTimer/index.ts +2 -0
  176. package/src/components/CountdownTimer/types.ts +14 -0
  177. package/src/components/DataList/DataList.tsx +32 -0
  178. package/src/components/DataList/constants.ts +47 -0
  179. package/src/components/DataList/index.ts +2 -0
  180. package/src/components/DataList/types.ts +17 -0
  181. package/src/components/DatePicker/DateRangePresetPicker.tsx +122 -0
  182. package/src/components/DatePicker/index.ts +1 -0
  183. package/src/components/DatePicker/types.ts +22 -0
  184. package/src/components/Description/Description.tsx +67 -5
  185. package/src/components/Description/DescriptionGroup.tsx +39 -0
  186. package/src/components/Description/constants.ts +128 -0
  187. package/src/components/Description/index.ts +10 -0
  188. package/src/components/Description/types.ts +31 -3
  189. package/src/components/Dialog/constants.ts +2 -2
  190. package/src/components/Dock/constants.ts +2 -2
  191. package/src/components/Drawer/constants.ts +2 -2
  192. package/src/components/Form/Checkbox/constants.ts +1 -1
  193. package/src/components/Form/DatetimeInput/constants.ts +1 -1
  194. package/src/components/Form/Input/constants.ts +1 -1
  195. package/src/components/Form/MultiSelect/constants.ts +1 -1
  196. package/src/components/Form/NativeSelect/constants.ts +1 -1
  197. package/src/components/Form/Radio/constants.ts +1 -1
  198. package/src/components/Form/Select/constants.ts +1 -1
  199. package/src/components/Form/Slider/constants.ts +1 -1
  200. package/src/components/Form/Switch/constants.ts +1 -1
  201. package/src/components/Form/Textarea/constants.ts +1 -1
  202. package/src/components/GlowCard/GlowCard.tsx +46 -0
  203. package/src/components/GlowCard/index.ts +2 -0
  204. package/src/components/GlowCard/types.ts +9 -0
  205. package/src/components/GradientText/GradientText.tsx +36 -0
  206. package/src/components/GradientText/index.ts +2 -0
  207. package/src/components/GradientText/types.ts +15 -0
  208. package/src/components/Greeting/Greeting.tsx +46 -0
  209. package/src/components/Greeting/index.ts +2 -0
  210. package/src/components/Greeting/types.ts +10 -0
  211. package/src/components/KPICard/KPICard.tsx +85 -0
  212. package/src/components/KPICard/index.ts +2 -0
  213. package/src/components/KPICard/types.ts +22 -0
  214. package/src/components/Marquee/Marquee.tsx +45 -0
  215. package/src/components/Marquee/index.ts +2 -0
  216. package/src/components/Marquee/types.ts +13 -0
  217. package/src/components/Menu/Menubar/constants.ts +2 -2
  218. package/src/components/Menu/NavigationMenu/constants.ts +2 -2
  219. package/src/components/Meteors/Meteors.tsx +38 -0
  220. package/src/components/Meteors/index.ts +2 -0
  221. package/src/components/Meteors/types.ts +6 -0
  222. package/src/components/MiniAreaChart/MiniAreaChart.tsx +68 -0
  223. package/src/components/MiniAreaChart/index.ts +2 -0
  224. package/src/components/MiniAreaChart/types.ts +11 -0
  225. package/src/components/MiniBarChart/MiniBarChart.tsx +49 -0
  226. package/src/components/MiniBarChart/index.ts +2 -0
  227. package/src/components/MiniBarChart/types.ts +16 -0
  228. package/src/components/MiniDonutChart/MiniDonutChart.tsx +87 -0
  229. package/src/components/MiniDonutChart/index.ts +2 -0
  230. package/src/components/MiniDonutChart/types.ts +17 -0
  231. package/src/components/MiniStackedBar/MiniStackedBar.tsx +61 -0
  232. package/src/components/MiniStackedBar/index.ts +2 -0
  233. package/src/components/MiniStackedBar/types.ts +15 -0
  234. package/src/components/NumberTicker/NumberTicker.tsx +58 -0
  235. package/src/components/NumberTicker/index.ts +2 -0
  236. package/src/components/NumberTicker/types.ts +12 -0
  237. package/src/components/Pagination/constants.ts +2 -2
  238. package/src/components/Progress/constants.ts +1 -1
  239. package/src/components/Pulse/Pulse.tsx +26 -0
  240. package/src/components/Pulse/constants.ts +55 -0
  241. package/src/components/Pulse/index.ts +2 -0
  242. package/src/components/Pulse/types.ts +12 -0
  243. package/src/components/Resizable/constants.ts +1 -1
  244. package/src/components/Sheet/constants.ts +1 -1
  245. package/src/components/ShinyButton/ShinyButton.tsx +57 -0
  246. package/src/components/ShinyButton/index.ts +2 -0
  247. package/src/components/ShinyButton/types.ts +8 -0
  248. package/src/components/Skeleton/constants.ts +1 -1
  249. package/src/components/Sonner/constants.ts +1 -1
  250. package/src/components/Sparkline/Sparkline.tsx +108 -0
  251. package/src/components/Sparkline/index.ts +2 -0
  252. package/src/components/Sparkline/types.ts +18 -0
  253. package/src/components/SpotlightCard/SpotlightCard.tsx +56 -0
  254. package/src/components/SpotlightCard/index.ts +2 -0
  255. package/src/components/SpotlightCard/types.ts +8 -0
  256. package/src/components/Stat/constants.ts +1 -1
  257. package/src/components/StatCard/StatCard.tsx +59 -0
  258. package/src/components/StatCard/index.ts +2 -0
  259. package/src/components/StatCard/types.ts +16 -0
  260. package/src/components/Tabs/constants.ts +1 -1
  261. package/src/components/TextShimmer/TextShimmer.tsx +34 -0
  262. package/src/components/TextShimmer/index.ts +2 -0
  263. package/src/components/TextShimmer/types.ts +8 -0
  264. package/src/components/Timeline/constants.ts +1 -1
  265. package/src/components/Toggle/constants.ts +1 -1
  266. package/src/components/Tooltip/constants.ts +1 -1
  267. package/src/components/TrendBadge/TrendBadge.tsx +40 -0
  268. package/src/components/TrendBadge/constants.ts +38 -0
  269. package/src/components/TrendBadge/index.ts +2 -0
  270. package/src/components/TrendBadge/types.ts +16 -0
  271. package/src/components/WidgetShell/WidgetShell.tsx +101 -0
  272. package/src/components/WidgetShell/index.ts +2 -0
  273. package/src/components/WidgetShell/types.ts +22 -0
  274. package/src/index.ts +35 -0
  275. package/src/stylesheets/tailwind.css +210 -0
  276. package/src/utilities/getSubpaths/getSubpaths.ts +1 -2
@@ -0,0 +1,42 @@
1
+ "use client";
2
+
3
+ import { AnimatePresence, motion } from "framer-motion";
4
+ import { cn } from "../../utilities";
5
+ import type { AnimatedListProps } from "./types";
6
+
7
+ const AnimatedList = ({
8
+ items,
9
+ className,
10
+ maxItems,
11
+ staggerDelay = 100,
12
+ ...props
13
+ }: AnimatedListProps) => {
14
+ const visibleItems = maxItems ? items.slice(-maxItems) : items;
15
+
16
+ return (
17
+ <div className={cn("flex flex-col gap-2 overflow-hidden", className)} {...props}>
18
+ <AnimatePresence initial={false}>
19
+ {visibleItems.map((item, index) => (
20
+ <motion.div
21
+ key={item.id}
22
+ layout
23
+ initial={{ opacity: 0, y: 20, scale: 0.95 }}
24
+ animate={{ opacity: 1, y: 0, scale: 1 }}
25
+ exit={{ opacity: 0, y: -20, scale: 0.95 }}
26
+ transition={{
27
+ duration: 0.3,
28
+ delay: index * (staggerDelay / 1000),
29
+ ease: [0.16, 1, 0.3, 1],
30
+ }}
31
+ >
32
+ {item.content}
33
+ </motion.div>
34
+ ))}
35
+ </AnimatePresence>
36
+ </div>
37
+ );
38
+ };
39
+
40
+ AnimatedList.displayName = "AnimatedList";
41
+
42
+ export { AnimatedList };
@@ -0,0 +1,2 @@
1
+ export { AnimatedList } from "./AnimatedList";
2
+ export type { AnimatedListProps, AnimatedListItem } from "./types";
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+
3
+ export type AnimatedListItem = {
4
+ id: string;
5
+ content: ReactNode;
6
+ };
7
+
8
+ export type AnimatedListProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
9
+ /** Items to display */
10
+ items: AnimatedListItem[];
11
+ /** Maximum visible items */
12
+ maxItems?: number;
13
+ /** Delay between each item appearing (ms) */
14
+ staggerDelay?: number;
15
+ };
@@ -1,7 +1,7 @@
1
1
  import { cva } from "../../libs";
2
2
  import { createVariants } from "../../utilities";
3
3
 
4
- export const getBadgeClasses = cva("badge", {
4
+ export const getBadgeClasses = cva("badge transition-colors duration-200", {
5
5
  variants: createVariants({
6
6
  variant: {
7
7
  accent: "badge-accent",
@@ -1,7 +1,7 @@
1
1
  import { cva } from "../../libs";
2
2
  import { createVariants } from "../../utilities";
3
3
 
4
- export const getBannerClasses = cva("alert alert-vertical sm:alert-horizontal", {
4
+ export const getBannerClasses = cva("alert alert-vertical sm:alert-horizontal shadow-sm", {
5
5
  variants: createVariants({
6
6
  variant: {
7
7
  info: "alert-info",
@@ -0,0 +1,41 @@
1
+ import type { CSSProperties } from "react";
2
+ import { cn } from "../../utilities";
3
+ import type { BorderBeamProps } from "./types";
4
+
5
+ const BorderBeam = ({
6
+ className,
7
+ size = 200,
8
+ duration = 4,
9
+ delay = 0,
10
+ colorFrom = "oklch(0.7 0.25 250)",
11
+ colorTo = "oklch(0.7 0.2 330)",
12
+ ...props
13
+ }: BorderBeamProps) => {
14
+ return (
15
+ <div
16
+ className={cn(
17
+ "pointer-events-none absolute inset-0 rounded-[inherit] border border-transparent",
18
+ "[mask-clip:padding-box,border-box] [mask-composite:intersect]",
19
+ "[mask-image:linear-gradient(transparent,transparent),linear-gradient(#fff,#fff)]",
20
+ "after:absolute after:aspect-square after:animate-border-beam",
21
+ "after:bg-[linear-gradient(var(--beam-color-from),var(--beam-color-to),transparent)]",
22
+ "after:[offset-path:rect(0_auto_auto_0_round_var(--beam-size))]",
23
+ className
24
+ )}
25
+ style={
26
+ {
27
+ "--beam-size": `${size}px`,
28
+ "--beam-color-from": colorFrom,
29
+ "--beam-color-to": colorTo,
30
+ "--tw-duration": `${duration}s`,
31
+ animationDelay: `${delay}s`,
32
+ } as CSSProperties
33
+ }
34
+ {...props}
35
+ />
36
+ );
37
+ };
38
+
39
+ BorderBeam.displayName = "BorderBeam";
40
+
41
+ export { BorderBeam };
@@ -0,0 +1,2 @@
1
+ export { BorderBeam } from "./BorderBeam";
2
+ export type { BorderBeamProps } from "./types";
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes } from "react";
2
+
3
+ export type BorderBeamProps = HTMLAttributes<HTMLDivElement> & {
4
+ /** Size of the beam in pixels */
5
+ size?: number;
6
+ /** Duration of the animation in seconds */
7
+ duration?: number;
8
+ /** Delay before animation starts in seconds */
9
+ delay?: number;
10
+ /** Start color of the beam gradient */
11
+ colorFrom?: string;
12
+ /** End color of the beam gradient */
13
+ colorTo?: string;
14
+ };
@@ -4,11 +4,17 @@ import { getBoxClasses } from "./constants";
4
4
  import { type BoxProps } from "./types";
5
5
 
6
6
  export const Box = React.forwardRef<HTMLDivElement, BoxProps>(
7
- ({ className, display, position, overflow, children, ...props }, ref) => {
7
+ (
8
+ { className, style, display, position, overflow, rounded, padding, shadow, children, ...props },
9
+ ref
10
+ ) => {
8
11
  return (
9
12
  <div
10
13
  ref={ref}
11
- className={cn(getBoxClasses({ display, position, overflow }), className)}
14
+ className={cn(
15
+ getBoxClasses({ style, display, position, overflow, rounded, padding, shadow }),
16
+ className
17
+ )}
12
18
  {...props}
13
19
  >
14
20
  {children}
@@ -3,6 +3,18 @@ import { createVariants } from "../../utilities";
3
3
 
4
4
  export const getBoxClasses = cva("", {
5
5
  variants: createVariants({
6
+ style: {
7
+ default: "",
8
+ outlined: "border border-base-200",
9
+ bordered: "border-[4px] border-double border-base-200",
10
+ elevated: "border border-base-200 bg-base-100 shadow-md",
11
+ ghost: "bg-base-200/40",
12
+ gradient:
13
+ "relative border-0 bg-base-100 before:absolute before:inset-0 before:-z-10 before:-m-[2px] before:rounded-[inherit] before:bg-linear-to-br before:from-primary before:via-secondary before:to-accent",
14
+ strip: "border border-base-300 ring-1 ring-base-300 ring-offset-[2px] ring-offset-base-200",
15
+ glass: "border border-white/20 bg-white/10 shadow-lg backdrop-blur-md",
16
+ inset: "border border-base-200 bg-base-200/20 shadow-inner",
17
+ },
6
18
  display: {
7
19
  block: "block",
8
20
  inline: "inline",
@@ -30,5 +42,28 @@ export const getBoxClasses = cva("", {
30
42
  "x-hidden": "overflow-x-hidden",
31
43
  "y-hidden": "overflow-y-hidden",
32
44
  },
45
+ rounded: {
46
+ none: "rounded-none",
47
+ sm: "rounded-sm",
48
+ md: "rounded-md",
49
+ lg: "rounded-lg",
50
+ xl: "rounded-xl",
51
+ "2xl": "rounded-2xl",
52
+ full: "rounded-full",
53
+ },
54
+ padding: {
55
+ none: "p-0",
56
+ sm: "p-2",
57
+ md: "p-4",
58
+ lg: "p-6",
59
+ xl: "p-8",
60
+ },
61
+ shadow: {
62
+ none: "shadow-none",
63
+ sm: "shadow-sm",
64
+ md: "shadow-md",
65
+ lg: "shadow-lg",
66
+ xl: "shadow-xl",
67
+ },
33
68
  }),
34
69
  });
@@ -1,66 +1,69 @@
1
1
  import { cva } from "../../libs";
2
2
  import { createVariants } from "../../utilities";
3
3
 
4
- export const getButtonClasses = cva("btn", {
5
- variants: createVariants({
6
- variant: {
7
- accent: "btn-accent",
8
- default: "btn-default",
9
- error: "btn-error",
10
- ghost: "btn-ghost",
11
- info: "btn-info",
12
- neutral: "btn-neutral",
13
- primary: "btn-primary",
14
- secondary: "btn-secondary",
15
- success: "btn-success",
16
- warning: "btn-warning",
17
- },
18
- outline: {
19
- true: "btn-outline",
20
- },
21
- link: {
22
- true: "btn-link",
23
- },
24
- rounded: {
25
- xs: "rounded-xs",
26
- sm: "rounded-sm",
27
- md: "rounded-md",
28
- lg: "rounded-lg",
29
- },
30
- wide: {
31
- true: "btn-wide",
32
- },
33
- size: {
34
- xs: "btn-xs",
35
- sm: "btn-sm",
36
- md: "btn-md",
37
- lg: "btn-lg",
38
- },
39
- isLoading: {
40
- true: "relative overflow-hidden",
41
- },
42
- disabled: {
43
- true: "",
44
- },
45
- }),
46
- compoundVariants: [
47
- {
48
- size: undefined,
49
- className: "min-h-fit h-10",
50
- },
51
- {
52
- rounded: undefined,
53
- className: "rounded-md",
54
- },
55
- {
56
- disabled: true,
57
- isLoading: true,
58
- className: "text-transparent",
59
- },
60
- {
61
- variant: undefined,
62
- outline: true,
63
- className: "border-base-content/20",
64
- },
65
- ],
66
- });
4
+ export const getButtonClasses = cva(
5
+ "btn transition-all duration-200 ease-out active:scale-[0.97]",
6
+ {
7
+ variants: createVariants({
8
+ variant: {
9
+ accent: "btn-accent shadow-sm hover:shadow-md hover:shadow-accent/20",
10
+ default: "btn-default shadow-sm hover:shadow-md",
11
+ error: "btn-error shadow-sm hover:shadow-md hover:shadow-error/20",
12
+ ghost: "btn-ghost hover:bg-base-200/80",
13
+ info: "btn-info shadow-sm hover:shadow-md hover:shadow-info/20",
14
+ neutral: "btn-neutral shadow-sm hover:shadow-md hover:shadow-neutral/20",
15
+ primary: "btn-primary shadow-sm hover:shadow-md hover:shadow-primary/25",
16
+ secondary: "btn-secondary shadow-sm hover:shadow-md hover:shadow-secondary/20",
17
+ success: "btn-success shadow-sm hover:shadow-md hover:shadow-success/20",
18
+ warning: "btn-warning shadow-sm hover:shadow-md hover:shadow-warning/20",
19
+ },
20
+ outline: {
21
+ true: "btn-outline",
22
+ },
23
+ link: {
24
+ true: "btn-link !shadow-none active:scale-100",
25
+ },
26
+ rounded: {
27
+ xs: "rounded-xs",
28
+ sm: "rounded-sm",
29
+ md: "rounded-md",
30
+ lg: "rounded-lg",
31
+ },
32
+ wide: {
33
+ true: "btn-wide",
34
+ },
35
+ size: {
36
+ xs: "btn-xs",
37
+ sm: "btn-sm",
38
+ md: "btn-md",
39
+ lg: "btn-lg",
40
+ },
41
+ isLoading: {
42
+ true: "relative overflow-hidden",
43
+ },
44
+ disabled: {
45
+ true: "",
46
+ },
47
+ }),
48
+ compoundVariants: [
49
+ {
50
+ size: undefined,
51
+ className: "min-h-fit h-10",
52
+ },
53
+ {
54
+ rounded: undefined,
55
+ className: "rounded-md",
56
+ },
57
+ {
58
+ disabled: true,
59
+ isLoading: true,
60
+ className: "text-transparent",
61
+ },
62
+ {
63
+ variant: undefined,
64
+ outline: true,
65
+ className: "border-base-content/20",
66
+ },
67
+ ],
68
+ }
69
+ );
@@ -0,0 +1,141 @@
1
+ import { useMemo } from "react";
2
+ import { cn } from "../../utilities";
3
+ import type { CalendarHeatmapProps } from "./types";
4
+
5
+ const DEFAULT_COLORS: [string, string, string, string, string] = [
6
+ "oklch(0.9 0.02 250)",
7
+ "oklch(0.8 0.08 250)",
8
+ "oklch(0.7 0.12 250)",
9
+ "oklch(0.6 0.16 250)",
10
+ "oklch(0.5 0.2 250)",
11
+ ];
12
+
13
+ const MONTH_LABELS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
14
+ const DAY_LABELS = ["", "Mon", "", "Wed", "", "Fri", ""];
15
+
16
+ const CalendarHeatmap = ({
17
+ data,
18
+ className,
19
+ startDate,
20
+ endDate,
21
+ colors = DEFAULT_COLORS,
22
+ cellSize = 12,
23
+ cellGap = 2,
24
+ showMonthLabels = true,
25
+ showDayLabels = true,
26
+ formatTooltip = (date, value) => `${date}: ${value}`,
27
+ ...props
28
+ }: CalendarHeatmapProps) => {
29
+ const { weeks, monthPositions, maxValue } = useMemo(() => {
30
+ const end = endDate ?? new Date();
31
+ const start = startDate ?? new Date(end.getFullYear() - 1, end.getMonth(), end.getDate() + 1);
32
+
33
+ const dataMap = new Map(data.map((d) => [d.date, d.value]));
34
+ const max = Math.max(1, ...data.map((d) => d.value));
35
+
36
+ const weeksArr: { date: string; value: number; day: number }[][] = [];
37
+ const months: { label: string; x: number }[] = [];
38
+ let currentWeek: { date: string; value: number; day: number }[] = [];
39
+ let lastMonth = -1;
40
+
41
+ const cursor = new Date(start);
42
+ // Align to Sunday
43
+ while (cursor.getDay() !== 0) {
44
+ cursor.setDate(cursor.getDate() - 1);
45
+ }
46
+
47
+ while (cursor <= end) {
48
+ const dateStr = cursor.toISOString().split("T")[0];
49
+ const day = cursor.getDay();
50
+ const month = cursor.getMonth();
51
+
52
+ if (day === 0 && currentWeek.length > 0) {
53
+ weeksArr.push(currentWeek);
54
+ currentWeek = [];
55
+ }
56
+
57
+ if (month !== lastMonth) {
58
+ months.push({ label: MONTH_LABELS[month], x: weeksArr.length });
59
+ lastMonth = month;
60
+ }
61
+
62
+ currentWeek.push({
63
+ date: dateStr,
64
+ value: dataMap.get(dateStr) ?? 0,
65
+ day,
66
+ });
67
+
68
+ cursor.setDate(cursor.getDate() + 1);
69
+ }
70
+ if (currentWeek.length > 0) weeksArr.push(currentWeek);
71
+
72
+ return { weeks: weeksArr, monthPositions: months, maxValue: max };
73
+ }, [data, startDate, endDate]);
74
+
75
+ const getColor = (value: number) => {
76
+ if (value === 0) return "oklch(0.95 0 0)";
77
+ const level = Math.min(4, Math.floor((value / maxValue) * 4));
78
+ return colors[level];
79
+ };
80
+
81
+ const labelWidth = showDayLabels ? 28 : 0;
82
+
83
+ return (
84
+ <div className={cn("inline-flex flex-col gap-1", className)} {...props}>
85
+ {showMonthLabels && (
86
+ <div className="flex" style={{ paddingLeft: labelWidth }}>
87
+ {monthPositions.map((m, i) => (
88
+ <span
89
+ key={i}
90
+ className="text-[10px] text-base-content/50"
91
+ style={{
92
+ position: "relative",
93
+ left: m.x * (cellSize + cellGap),
94
+ width: 0,
95
+ whiteSpace: "nowrap",
96
+ }}
97
+ >
98
+ {m.label}
99
+ </span>
100
+ ))}
101
+ </div>
102
+ )}
103
+ <div className="flex gap-0">
104
+ {showDayLabels && (
105
+ <div
106
+ className="flex flex-col justify-between shrink-0"
107
+ style={{ width: labelWidth, height: 7 * (cellSize + cellGap) - cellGap }}
108
+ >
109
+ {DAY_LABELS.map((label, i) => (
110
+ <span key={i} className="text-[10px] text-base-content/50 leading-none" style={{ height: cellSize }}>
111
+ {label}
112
+ </span>
113
+ ))}
114
+ </div>
115
+ )}
116
+ <div className="flex" style={{ gap: cellGap }}>
117
+ {weeks.map((week, wi) => (
118
+ <div key={wi} className="flex flex-col" style={{ gap: cellGap }}>
119
+ {week.map((cell) => (
120
+ <div
121
+ key={cell.date}
122
+ className="rounded-[2px] transition-colors duration-150"
123
+ style={{
124
+ width: cellSize,
125
+ height: cellSize,
126
+ backgroundColor: getColor(cell.value),
127
+ }}
128
+ title={formatTooltip(cell.date, cell.value)}
129
+ />
130
+ ))}
131
+ </div>
132
+ ))}
133
+ </div>
134
+ </div>
135
+ </div>
136
+ );
137
+ };
138
+
139
+ CalendarHeatmap.displayName = "CalendarHeatmap";
140
+
141
+ export { CalendarHeatmap };
@@ -0,0 +1,2 @@
1
+ export { CalendarHeatmap } from "./CalendarHeatmap";
2
+ export type { CalendarHeatmapProps, HeatmapDataPoint } from "./types";
@@ -0,0 +1,27 @@
1
+ import type { HTMLAttributes } from "react";
2
+
3
+ export type HeatmapDataPoint = {
4
+ date: string; // ISO date string (YYYY-MM-DD)
5
+ value: number;
6
+ };
7
+
8
+ export type CalendarHeatmapProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
9
+ /** Data points with date and value */
10
+ data: HeatmapDataPoint[];
11
+ /** Start date (defaults to 1 year ago) */
12
+ startDate?: Date;
13
+ /** End date (defaults to today) */
14
+ endDate?: Date;
15
+ /** Color scale — array of 5 colors from low to high */
16
+ colors?: [string, string, string, string, string];
17
+ /** Cell size in pixels */
18
+ cellSize?: number;
19
+ /** Gap between cells in pixels */
20
+ cellGap?: number;
21
+ /** Whether to show month labels */
22
+ showMonthLabels?: boolean;
23
+ /** Whether to show day-of-week labels */
24
+ showDayLabels?: boolean;
25
+ /** Tooltip formatter */
26
+ formatTooltip?: (date: string, value: number) => string;
27
+ };
@@ -1,24 +1,27 @@
1
1
  import { cva } from "../../libs";
2
2
  import { createVariants } from "../../utilities";
3
3
 
4
- export const getCardClasses = cva("card", {
5
- variants: createVariants({
6
- border: {
7
- solid: "card-border",
8
- dash: "card-dash",
9
- },
10
- size: {
11
- xs: "card-xs",
12
- sm: "card-sm",
13
- md: "card-md",
14
- lg: "card-lg",
15
- xl: "card-xl",
16
- },
17
- horizontal: {
18
- true: "card-side",
19
- },
20
- overlay: {
21
- true: "image-full",
22
- },
23
- }),
24
- });
4
+ export const getCardClasses = cva(
5
+ "card transition-all duration-300 ease-out hover:shadow-lg",
6
+ {
7
+ variants: createVariants({
8
+ border: {
9
+ solid: "card-border",
10
+ dash: "card-dash",
11
+ },
12
+ size: {
13
+ xs: "card-xs",
14
+ sm: "card-sm",
15
+ md: "card-md",
16
+ lg: "card-lg",
17
+ xl: "card-xl",
18
+ },
19
+ horizontal: {
20
+ true: "card-side",
21
+ },
22
+ overlay: {
23
+ true: "image-full",
24
+ },
25
+ }),
26
+ }
27
+ );
@@ -26,7 +26,7 @@ export const getCarouselItemClasses = cva("min-w-0 shrink-0 grow-0 basis-full",
26
26
  });
27
27
 
28
28
  export const getCarouselNextClasses = cva(
29
- "absolute h-8 w-8 rounded-full p-0 disabled:bg-transparent",
29
+ "absolute h-8 w-8 rounded-full p-0 transition-all duration-200 hover:scale-110 disabled:bg-transparent",
30
30
  {
31
31
  variants: createVariants({
32
32
  orientation: {
@@ -41,7 +41,7 @@ export const getCarouselNextClasses = cva(
41
41
  );
42
42
 
43
43
  export const getCarouselPreviousClasses = cva(
44
- "absolute h-8 w-8 rounded-full p-0 disabled:bg-transparent",
44
+ "absolute h-8 w-8 rounded-full p-0 transition-all duration-200 hover:scale-110 disabled:bg-transparent",
45
45
  {
46
46
  variants: createVariants({
47
47
  orientation: {
@@ -83,7 +83,7 @@ export const ChartTooltipContent = forwardRef<HTMLDivElement, ChartTooltipConten
83
83
  (item as { fill: string }).fill;
84
84
 
85
85
  return (
86
- <div key={item.dataKey} className={getChartTooltipItemClasses({ indicator })}>
86
+ <div key={item.graphicalItemId} className={getChartTooltipItemClasses({ indicator })}>
87
87
  {formatter && item?.value !== undefined && item.name ? (
88
88
  formatter(item.value, item.name, item, index, payload)
89
89
  ) : (
@@ -91,7 +91,8 @@ export const lineChartArgs: ArgTypes = {
91
91
  type AreaArgKey = "area" | "areaChart" | "xAxis" | "yAxis";
92
92
 
93
93
  export type AreaChartProps = {
94
- area: OmitSVGElement<AreaProps>;
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ area: OmitSVGElement<AreaProps<any, any>>;
95
96
  areaChart: CartesianChartProps;
96
97
  } & AxisProps;
97
98
 
@@ -154,3 +154,58 @@ export const WithLegendAreaChartExample = (props: Partial<AreaChartProps>) => {
154
154
  </Chart>
155
155
  );
156
156
  };
157
+
158
+ /**
159
+ * Smooth gradient area chart — a single data series with a lush gradient fill,
160
+ * smooth natural curve, and a tooltip with a value callout. Matches the style
161
+ * of the "Total Sales" chart in premium dashboards.
162
+ */
163
+ export const GradientAreaChartExample = (props: Partial<AreaChartProps>) => {
164
+ const chartConfig = {
165
+ value: {
166
+ label: "Revenue",
167
+ color: "hsl(var(--chart-1))",
168
+ },
169
+ } satisfies ChartConfig;
170
+
171
+ return (
172
+ <Chart config={chartConfig} className="h-[250px] w-full">
173
+ <AreaChart {...props.areaChart}>
174
+ <defs>
175
+ <linearGradient id="gradientFill" x1="0" y1="0" x2="0" y2="1">
176
+ <stop offset="0%" stopColor="var(--color-value)" stopOpacity={0.3} />
177
+ <stop offset="100%" stopColor="var(--color-value)" stopOpacity={0.02} />
178
+ </linearGradient>
179
+ </defs>
180
+ <CartesianGrid vertical={false} strokeDasharray="3 3" />
181
+ <XAxis
182
+ dataKey="month"
183
+ tickLine={false}
184
+ axisLine={false}
185
+ tickMargin={8}
186
+ {...props.xAxis}
187
+ />
188
+ <YAxis
189
+ tickLine={false}
190
+ axisLine={false}
191
+ tickMargin={8}
192
+ tickFormatter={(v: number) => `$${(v / 1000).toFixed(0)}k`}
193
+ {...props.yAxis}
194
+ />
195
+ <ChartTooltip
196
+ content={<ChartTooltipContent indicator="line" />}
197
+ />
198
+ <Area
199
+ dataKey="value"
200
+ type="natural"
201
+ fill="url(#gradientFill)"
202
+ stroke="var(--color-value)"
203
+ strokeWidth={2.5}
204
+ dot={false}
205
+ activeDot={{ r: 5, strokeWidth: 2, fill: "var(--color-value)" }}
206
+ {...props.area}
207
+ />
208
+ </AreaChart>
209
+ </Chart>
210
+ );
211
+ };