kineto 0.1.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 (277) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/base.css +46 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.js +161 -0
  6. package/dist/accordion.js.map +1 -0
  7. package/dist/alert.d.ts +20 -0
  8. package/dist/alert.js +137 -0
  9. package/dist/alert.js.map +1 -0
  10. package/dist/animated-number.d.ts +16 -0
  11. package/dist/animated-number.js +40 -0
  12. package/dist/animated-number.js.map +1 -0
  13. package/dist/area-chart.d.ts +16 -0
  14. package/dist/area-chart.js +138 -0
  15. package/dist/area-chart.js.map +1 -0
  16. package/dist/aspect-ratio.d.ts +6 -0
  17. package/dist/aspect-ratio.js +9 -0
  18. package/dist/aspect-ratio.js.map +1 -0
  19. package/dist/avatar.d.ts +18 -0
  20. package/dist/avatar.js +202 -0
  21. package/dist/avatar.js.map +1 -0
  22. package/dist/badge.d.ts +14 -0
  23. package/dist/badge.js +54 -0
  24. package/dist/badge.js.map +1 -0
  25. package/dist/bar-chart.d.ts +19 -0
  26. package/dist/bar-chart.js +139 -0
  27. package/dist/bar-chart.js.map +1 -0
  28. package/dist/bento-grid.d.ts +24 -0
  29. package/dist/bento-grid.js +129 -0
  30. package/dist/bento-grid.js.map +1 -0
  31. package/dist/breadcrumbs.d.ts +13 -0
  32. package/dist/breadcrumbs.js +50 -0
  33. package/dist/breadcrumbs.js.map +1 -0
  34. package/dist/button-group.d.ts +9 -0
  35. package/dist/button-group.js +29 -0
  36. package/dist/button-group.js.map +1 -0
  37. package/dist/button.d.ts +16 -0
  38. package/dist/button.js +131 -0
  39. package/dist/button.js.map +1 -0
  40. package/dist/calendar.d.ts +11 -0
  41. package/dist/calendar.js +185 -0
  42. package/dist/calendar.js.map +1 -0
  43. package/dist/card.d.ts +15 -0
  44. package/dist/card.js +131 -0
  45. package/dist/card.js.map +1 -0
  46. package/dist/carousel.d.ts +14 -0
  47. package/dist/carousel.js +143 -0
  48. package/dist/carousel.js.map +1 -0
  49. package/dist/chart-tooltip.d.ts +18 -0
  50. package/dist/chart-tooltip.js +30 -0
  51. package/dist/chart-tooltip.js.map +1 -0
  52. package/dist/checkbox.d.ts +6 -0
  53. package/dist/checkbox.js +88 -0
  54. package/dist/checkbox.js.map +1 -0
  55. package/dist/cn.d.ts +10 -0
  56. package/dist/cn.js +10 -0
  57. package/dist/cn.js.map +1 -0
  58. package/dist/code-block.d.ts +25 -0
  59. package/dist/code-block.js +155 -0
  60. package/dist/code-block.js.map +1 -0
  61. package/dist/collapsible.d.ts +12 -0
  62. package/dist/collapsible.js +125 -0
  63. package/dist/collapsible.js.map +1 -0
  64. package/dist/color-picker.d.ts +12 -0
  65. package/dist/color-picker.js +180 -0
  66. package/dist/color-picker.js.map +1 -0
  67. package/dist/command.d.ts +88 -0
  68. package/dist/command.js +277 -0
  69. package/dist/command.js.map +1 -0
  70. package/dist/confetti.d.ts +25 -0
  71. package/dist/confetti.js +109 -0
  72. package/dist/confetti.js.map +1 -0
  73. package/dist/container.d.ts +19 -0
  74. package/dist/container.js +41 -0
  75. package/dist/container.js.map +1 -0
  76. package/dist/content-divider.d.ts +7 -0
  77. package/dist/content-divider.js +35 -0
  78. package/dist/content-divider.js.map +1 -0
  79. package/dist/context-menu.d.ts +30 -0
  80. package/dist/context-menu.js +213 -0
  81. package/dist/context-menu.js.map +1 -0
  82. package/dist/copy-button.d.ts +17 -0
  83. package/dist/copy-button.js +107 -0
  84. package/dist/copy-button.js.map +1 -0
  85. package/dist/dashboard-showcase.d.ts +7 -0
  86. package/dist/dashboard-showcase.js +2560 -0
  87. package/dist/dashboard-showcase.js.map +1 -0
  88. package/dist/data-table.d.ts +130 -0
  89. package/dist/data-table.js +1620 -0
  90. package/dist/data-table.js.map +1 -0
  91. package/dist/date-picker.d.ts +12 -0
  92. package/dist/date-picker.js +261 -0
  93. package/dist/date-picker.js.map +1 -0
  94. package/dist/dialog.d.ts +23 -0
  95. package/dist/dialog.js +188 -0
  96. package/dist/dialog.js.map +1 -0
  97. package/dist/dock.d.ts +17 -0
  98. package/dist/dock.js +77 -0
  99. package/dist/dock.js.map +1 -0
  100. package/dist/donut-chart.d.ts +18 -0
  101. package/dist/donut-chart.js +92 -0
  102. package/dist/donut-chart.js.map +1 -0
  103. package/dist/drawer.d.ts +26 -0
  104. package/dist/drawer.js +166 -0
  105. package/dist/drawer.js.map +1 -0
  106. package/dist/dropdown-menu.d.ts +22 -0
  107. package/dist/dropdown-menu.js +163 -0
  108. package/dist/dropdown-menu.js.map +1 -0
  109. package/dist/empty-state.d.ts +13 -0
  110. package/dist/empty-state.js +149 -0
  111. package/dist/empty-state.js.map +1 -0
  112. package/dist/featured-icon.d.ts +16 -0
  113. package/dist/featured-icon.js +56 -0
  114. package/dist/featured-icon.js.map +1 -0
  115. package/dist/file-uploader.d.ts +11 -0
  116. package/dist/file-uploader.js +212 -0
  117. package/dist/file-uploader.js.map +1 -0
  118. package/dist/flex.d.ts +30 -0
  119. package/dist/flex.js +89 -0
  120. package/dist/flex.js.map +1 -0
  121. package/dist/form.d.ts +28 -0
  122. package/dist/form.js +139 -0
  123. package/dist/form.js.map +1 -0
  124. package/dist/format-time.d.ts +18 -0
  125. package/dist/format-time.js +54 -0
  126. package/dist/format-time.js.map +1 -0
  127. package/dist/gap.d.ts +9 -0
  128. package/dist/gap.js +34 -0
  129. package/dist/gap.js.map +1 -0
  130. package/dist/gradient-border.d.ts +15 -0
  131. package/dist/gradient-border.js +79 -0
  132. package/dist/gradient-border.js.map +1 -0
  133. package/dist/gradient-text.d.ts +12 -0
  134. package/dist/gradient-text.js +43 -0
  135. package/dist/gradient-text.js.map +1 -0
  136. package/dist/grid.d.ts +25 -0
  137. package/dist/grid.js +77 -0
  138. package/dist/grid.js.map +1 -0
  139. package/dist/hover-card.d.ts +8 -0
  140. package/dist/hover-card.js +93 -0
  141. package/dist/hover-card.js.map +1 -0
  142. package/dist/index.d.ts +93 -0
  143. package/dist/index.js +93 -0
  144. package/dist/inline-edit.d.ts +20 -0
  145. package/dist/inline-edit.js +107 -0
  146. package/dist/inline-edit.js.map +1 -0
  147. package/dist/input.d.ts +6 -0
  148. package/dist/input.js +31 -0
  149. package/dist/input.js.map +1 -0
  150. package/dist/kbd.d.ts +16 -0
  151. package/dist/kbd.js +35 -0
  152. package/dist/kbd.js.map +1 -0
  153. package/dist/label.d.ts +6 -0
  154. package/dist/label.js +31 -0
  155. package/dist/label.js.map +1 -0
  156. package/dist/line-chart.d.ts +17 -0
  157. package/dist/line-chart.js +120 -0
  158. package/dist/line-chart.js.map +1 -0
  159. package/dist/logo-cloud.d.ts +14 -0
  160. package/dist/logo-cloud.js +106 -0
  161. package/dist/logo-cloud.js.map +1 -0
  162. package/dist/masonry.d.ts +15 -0
  163. package/dist/masonry.js +63 -0
  164. package/dist/masonry.js.map +1 -0
  165. package/dist/menubar.d.ts +31 -0
  166. package/dist/menubar.js +250 -0
  167. package/dist/menubar.js.map +1 -0
  168. package/dist/motion-presets.d.ts +70 -0
  169. package/dist/motion-presets.js +71 -0
  170. package/dist/motion-presets.js.map +1 -0
  171. package/dist/navigation-menu.d.ts +15 -0
  172. package/dist/navigation-menu.js +181 -0
  173. package/dist/navigation-menu.js.map +1 -0
  174. package/dist/notification-center.d.ts +35 -0
  175. package/dist/notification-center.js +384 -0
  176. package/dist/notification-center.js.map +1 -0
  177. package/dist/page-header.d.ts +13 -0
  178. package/dist/page-header.js +37 -0
  179. package/dist/page-header.js.map +1 -0
  180. package/dist/pagination.d.ts +13 -0
  181. package/dist/pagination.js +103 -0
  182. package/dist/pagination.js.map +1 -0
  183. package/dist/popover.d.ts +9 -0
  184. package/dist/popover.js +93 -0
  185. package/dist/popover.js.map +1 -0
  186. package/dist/progress-steps.d.ts +17 -0
  187. package/dist/progress-steps.js +158 -0
  188. package/dist/progress-steps.js.map +1 -0
  189. package/dist/progress.d.ts +13 -0
  190. package/dist/progress.js +98 -0
  191. package/dist/progress.js.map +1 -0
  192. package/dist/radio-group.d.ts +7 -0
  193. package/dist/radio-group.js +94 -0
  194. package/dist/radio-group.js.map +1 -0
  195. package/dist/rating.d.ts +18 -0
  196. package/dist/rating.js +122 -0
  197. package/dist/rating.js.map +1 -0
  198. package/dist/relative-time.d.ts +19 -0
  199. package/dist/relative-time.js +187 -0
  200. package/dist/relative-time.js.map +1 -0
  201. package/dist/resizable.d.ts +27 -0
  202. package/dist/resizable.js +50 -0
  203. package/dist/resizable.js.map +1 -0
  204. package/dist/scroll-area.d.ts +20 -0
  205. package/dist/scroll-area.js +94 -0
  206. package/dist/scroll-area.js.map +1 -0
  207. package/dist/segmented-control.d.ts +16 -0
  208. package/dist/segmented-control.js +139 -0
  209. package/dist/segmented-control.js.map +1 -0
  210. package/dist/select.d.ts +13 -0
  211. package/dist/select.js +153 -0
  212. package/dist/select.js.map +1 -0
  213. package/dist/separator.d.ts +6 -0
  214. package/dist/separator.js +36 -0
  215. package/dist/separator.js.map +1 -0
  216. package/dist/sidebar.d.ts +24 -0
  217. package/dist/sidebar.js +150 -0
  218. package/dist/sidebar.js.map +1 -0
  219. package/dist/skeleton.d.ts +6 -0
  220. package/dist/skeleton.js +42 -0
  221. package/dist/skeleton.js.map +1 -0
  222. package/dist/slider.d.ts +6 -0
  223. package/dist/slider.js +44 -0
  224. package/dist/slider.js.map +1 -0
  225. package/dist/social-button.d.ts +14 -0
  226. package/dist/social-button.js +203 -0
  227. package/dist/social-button.js.map +1 -0
  228. package/dist/spacer.d.ts +19 -0
  229. package/dist/spacer.js +52 -0
  230. package/dist/spacer.js.map +1 -0
  231. package/dist/spinner.d.ts +15 -0
  232. package/dist/spinner.js +48 -0
  233. package/dist/spinner.js.map +1 -0
  234. package/dist/stack.d.ts +27 -0
  235. package/dist/stack.js +77 -0
  236. package/dist/stack.js.map +1 -0
  237. package/dist/stat-card.d.ts +26 -0
  238. package/dist/stat-card.js +198 -0
  239. package/dist/stat-card.js.map +1 -0
  240. package/dist/status-dot.d.ts +26 -0
  241. package/dist/status-dot.js +68 -0
  242. package/dist/status-dot.js.map +1 -0
  243. package/dist/switch.d.ts +6 -0
  244. package/dist/switch.js +108 -0
  245. package/dist/switch.js.map +1 -0
  246. package/dist/tabs.d.ts +13 -0
  247. package/dist/tabs.js +167 -0
  248. package/dist/tabs.js.map +1 -0
  249. package/dist/tag.d.ts +16 -0
  250. package/dist/tag.js +53 -0
  251. package/dist/tag.js.map +1 -0
  252. package/dist/textarea.d.ts +6 -0
  253. package/dist/textarea.js +30 -0
  254. package/dist/textarea.js.map +1 -0
  255. package/dist/theme-switcher.d.ts +16 -0
  256. package/dist/theme-switcher.js +170 -0
  257. package/dist/theme-switcher.js.map +1 -0
  258. package/dist/toast.d.ts +20 -0
  259. package/dist/toast.js +162 -0
  260. package/dist/toast.js.map +1 -0
  261. package/dist/tooltip.d.ts +14 -0
  262. package/dist/tooltip.js +98 -0
  263. package/dist/tooltip.js.map +1 -0
  264. package/dist/tree-view.d.ts +16 -0
  265. package/dist/tree-view.js +123 -0
  266. package/dist/tree-view.js.map +1 -0
  267. package/dist/truncate.d.ts +16 -0
  268. package/dist/truncate.js +151 -0
  269. package/dist/truncate.js.map +1 -0
  270. package/dist/use-reduced-motion.d.ts +15 -0
  271. package/dist/use-reduced-motion.js +11 -0
  272. package/dist/use-reduced-motion.js.map +1 -0
  273. package/dist/verification-code-input.d.ts +12 -0
  274. package/dist/verification-code-input.js +90 -0
  275. package/dist/verification-code-input.js.map +1 -0
  276. package/package.json +131 -0
  277. package/theme.css +343 -0
@@ -0,0 +1,93 @@
1
+ /* GENERATED by scripts/finalize-dist.mjs — do not edit. Source of truth: src/index.ts */
2
+ /* Re-export barrel: keeps each component its own module so bundlers can tree-shake, and
3
+ lets each file keep its own "use client" directive. See writeBarrel() for the numbers. */
4
+ export * from "./cn.js";
5
+ export * from "./use-reduced-motion.js";
6
+ export * from "./gap.js";
7
+ export * from "./format-time.js";
8
+ export * from "./motion-presets.js";
9
+ export * from "./accordion.js";
10
+ export * from "./alert.js";
11
+ export * from "./animated-number.js";
12
+ export * from "./aspect-ratio.js";
13
+ export * from "./avatar.js";
14
+ export * from "./badge.js";
15
+ export * from "./bento-grid.js";
16
+ export * from "./breadcrumbs.js";
17
+ export * from "./button.js";
18
+ export * from "./button-group.js";
19
+ export * from "./calendar.js";
20
+ export * from "./card.js";
21
+ export * from "./carousel.js";
22
+ export * from "./checkbox.js";
23
+ export * from "./code-block.js";
24
+ export * from "./collapsible.js";
25
+ export * from "./color-picker.js";
26
+ export * from "./command.js";
27
+ export * from "./confetti.js";
28
+ export * from "./container.js";
29
+ export * from "./content-divider.js";
30
+ export * from "./context-menu.js";
31
+ export * from "./copy-button.js";
32
+ export * from "./date-picker.js";
33
+ export * from "./dialog.js";
34
+ export * from "./dock.js";
35
+ export * from "./drawer.js";
36
+ export * from "./dropdown-menu.js";
37
+ export * from "./empty-state.js";
38
+ export * from "./featured-icon.js";
39
+ export * from "./file-uploader.js";
40
+ export * from "./flex.js";
41
+ export * from "./form.js";
42
+ export * from "./gradient-border.js";
43
+ export * from "./gradient-text.js";
44
+ export * from "./grid.js";
45
+ export * from "./hover-card.js";
46
+ export * from "./inline-edit.js";
47
+ export * from "./input.js";
48
+ export * from "./kbd.js";
49
+ export * from "./label.js";
50
+ export * from "./masonry.js";
51
+ export * from "./menubar.js";
52
+ export * from "./navigation-menu.js";
53
+ export * from "./notification-center.js";
54
+ export * from "./page-header.js";
55
+ export * from "./pagination.js";
56
+ export * from "./popover.js";
57
+ export * from "./progress.js";
58
+ export * from "./progress-steps.js";
59
+ export * from "./radio-group.js";
60
+ export * from "./rating.js";
61
+ export * from "./relative-time.js";
62
+ export * from "./resizable.js";
63
+ export * from "./scroll-area.js";
64
+ export * from "./segmented-control.js";
65
+ export * from "./select.js";
66
+ export * from "./separator.js";
67
+ export * from "./skeleton.js";
68
+ export * from "./slider.js";
69
+ export * from "./social-button.js";
70
+ export * from "./spacer.js";
71
+ export * from "./stack.js";
72
+ export * from "./spinner.js";
73
+ export * from "./status-dot.js";
74
+ export * from "./switch.js";
75
+ export * from "./tabs.js";
76
+ export * from "./tag.js";
77
+ export * from "./textarea.js";
78
+ export * from "./theme-switcher.js";
79
+ export * from "./toast.js";
80
+ export * from "./tooltip.js";
81
+ export * from "./tree-view.js";
82
+ export * from "./truncate.js";
83
+ export * from "./verification-code-input.js";
84
+ export * from "./logo-cloud.js";
85
+ export * from "./area-chart.js";
86
+ export * from "./bar-chart.js";
87
+ export * from "./chart-tooltip.js";
88
+ export * from "./dashboard-showcase.js";
89
+ export * from "./data-table.js";
90
+ export * from "./donut-chart.js";
91
+ export * from "./line-chart.js";
92
+ export * from "./sidebar.js";
93
+ export * from "./stat-card.js";
package/dist/index.js ADDED
@@ -0,0 +1,93 @@
1
+ /* GENERATED by scripts/finalize-dist.mjs — do not edit. Source of truth: src/index.ts */
2
+ /* Re-export barrel: keeps each component its own module so bundlers can tree-shake, and
3
+ lets each file keep its own "use client" directive. See writeBarrel() for the numbers. */
4
+ export * from "./cn.js";
5
+ export * from "./use-reduced-motion.js";
6
+ export * from "./gap.js";
7
+ export * from "./format-time.js";
8
+ export * from "./motion-presets.js";
9
+ export * from "./accordion.js";
10
+ export * from "./alert.js";
11
+ export * from "./animated-number.js";
12
+ export * from "./aspect-ratio.js";
13
+ export * from "./avatar.js";
14
+ export * from "./badge.js";
15
+ export * from "./bento-grid.js";
16
+ export * from "./breadcrumbs.js";
17
+ export * from "./button.js";
18
+ export * from "./button-group.js";
19
+ export * from "./calendar.js";
20
+ export * from "./card.js";
21
+ export * from "./carousel.js";
22
+ export * from "./checkbox.js";
23
+ export * from "./code-block.js";
24
+ export * from "./collapsible.js";
25
+ export * from "./color-picker.js";
26
+ export * from "./command.js";
27
+ export * from "./confetti.js";
28
+ export * from "./container.js";
29
+ export * from "./content-divider.js";
30
+ export * from "./context-menu.js";
31
+ export * from "./copy-button.js";
32
+ export * from "./date-picker.js";
33
+ export * from "./dialog.js";
34
+ export * from "./dock.js";
35
+ export * from "./drawer.js";
36
+ export * from "./dropdown-menu.js";
37
+ export * from "./empty-state.js";
38
+ export * from "./featured-icon.js";
39
+ export * from "./file-uploader.js";
40
+ export * from "./flex.js";
41
+ export * from "./form.js";
42
+ export * from "./gradient-border.js";
43
+ export * from "./gradient-text.js";
44
+ export * from "./grid.js";
45
+ export * from "./hover-card.js";
46
+ export * from "./inline-edit.js";
47
+ export * from "./input.js";
48
+ export * from "./kbd.js";
49
+ export * from "./label.js";
50
+ export * from "./masonry.js";
51
+ export * from "./menubar.js";
52
+ export * from "./navigation-menu.js";
53
+ export * from "./notification-center.js";
54
+ export * from "./page-header.js";
55
+ export * from "./pagination.js";
56
+ export * from "./popover.js";
57
+ export * from "./progress.js";
58
+ export * from "./progress-steps.js";
59
+ export * from "./radio-group.js";
60
+ export * from "./rating.js";
61
+ export * from "./relative-time.js";
62
+ export * from "./resizable.js";
63
+ export * from "./scroll-area.js";
64
+ export * from "./segmented-control.js";
65
+ export * from "./select.js";
66
+ export * from "./separator.js";
67
+ export * from "./skeleton.js";
68
+ export * from "./slider.js";
69
+ export * from "./social-button.js";
70
+ export * from "./spacer.js";
71
+ export * from "./stack.js";
72
+ export * from "./spinner.js";
73
+ export * from "./status-dot.js";
74
+ export * from "./switch.js";
75
+ export * from "./tabs.js";
76
+ export * from "./tag.js";
77
+ export * from "./textarea.js";
78
+ export * from "./theme-switcher.js";
79
+ export * from "./toast.js";
80
+ export * from "./tooltip.js";
81
+ export * from "./tree-view.js";
82
+ export * from "./truncate.js";
83
+ export * from "./verification-code-input.js";
84
+ export * from "./logo-cloud.js";
85
+ export * from "./area-chart.js";
86
+ export * from "./bar-chart.js";
87
+ export * from "./chart-tooltip.js";
88
+ export * from "./dashboard-showcase.js";
89
+ export * from "./data-table.js";
90
+ export * from "./donut-chart.js";
91
+ export * from "./line-chart.js";
92
+ export * from "./sidebar.js";
93
+ export * from "./stat-card.js";
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+
3
+ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit"> {
4
+ /** The current value. */
5
+ value: string;
6
+ /** Persist a new value. May be async; if it rejects, the edit is rolled back. */
7
+ onSave?: (value: string) => void | Promise<void>;
8
+ placeholder?: string;
9
+ /** Use a multi-line textarea instead of a single-line input. */
10
+ multiline?: boolean;
11
+ inputClassName?: string;
12
+ }
13
+ /**
14
+ * Click-to-edit text that swaps to an input in place and saves optimistically — the new value shows
15
+ * immediately and only rolls back if `onSave` rejects. Removes a whole class of one-off edit modals.
16
+ * Enter (or blur) saves; Escape cancels. Shift+Enter inserts a newline in multiline mode.
17
+ */
18
+ declare const InlineEdit: React.ForwardRefExoticComponent<InlineEditProps & React.RefAttributes<HTMLDivElement>>;
19
+
20
+ export { InlineEdit, type InlineEditProps };
@@ -0,0 +1,107 @@
1
+ "use client";
2
+
3
+ // src/components/ui/inline-edit.tsx
4
+ import * as React from "react";
5
+ import { Pencil } from "lucide-react";
6
+
7
+ // src/lib/cn.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
14
+ // src/components/ui/inline-edit.tsx
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ var InlineEdit = React.forwardRef(
17
+ ({ className, value, onSave, placeholder = "Empty", multiline = false, inputClassName, ...props }, ref) => {
18
+ const [committed, setCommitted] = React.useState(value);
19
+ const [editing, setEditing] = React.useState(false);
20
+ const [draft, setDraft] = React.useState(value);
21
+ const [error, setError] = React.useState(false);
22
+ const inputRef = React.useRef(null);
23
+ React.useEffect(() => {
24
+ if (!editing) setCommitted(value);
25
+ }, [value, editing]);
26
+ const begin = () => {
27
+ setDraft(committed);
28
+ setError(false);
29
+ setEditing(true);
30
+ };
31
+ React.useEffect(() => {
32
+ if (editing) inputRef.current?.select();
33
+ }, [editing]);
34
+ const commit = async () => {
35
+ const next = draft.trim();
36
+ setEditing(false);
37
+ if (next === committed) return;
38
+ const previous = committed;
39
+ setCommitted(next);
40
+ try {
41
+ await onSave?.(next);
42
+ setError(false);
43
+ } catch {
44
+ setCommitted(previous);
45
+ setError(true);
46
+ }
47
+ };
48
+ const cancel = () => {
49
+ setDraft(committed);
50
+ setEditing(false);
51
+ };
52
+ const onKeyDown = (e) => {
53
+ if (e.key === "Enter" && !(multiline && e.shiftKey)) {
54
+ e.preventDefault();
55
+ void commit();
56
+ } else if (e.key === "Escape") {
57
+ e.preventDefault();
58
+ cancel();
59
+ }
60
+ };
61
+ const sharedInputClass = cn(
62
+ "w-full rounded-md border border-input bg-background px-2 py-1 text-inherit outline-none ring-ring focus-visible:ring-2",
63
+ inputClassName
64
+ );
65
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("min-w-0", className), ...props, children: editing ? multiline ? /* @__PURE__ */ jsx(
66
+ "textarea",
67
+ {
68
+ ref: inputRef,
69
+ value: draft,
70
+ rows: 3,
71
+ onChange: (e) => setDraft(e.target.value),
72
+ onBlur: () => void commit(),
73
+ onKeyDown,
74
+ className: cn(sharedInputClass, "resize-none")
75
+ }
76
+ ) : /* @__PURE__ */ jsx(
77
+ "input",
78
+ {
79
+ ref: inputRef,
80
+ value: draft,
81
+ onChange: (e) => setDraft(e.target.value),
82
+ onBlur: () => void commit(),
83
+ onKeyDown,
84
+ className: sharedInputClass
85
+ }
86
+ ) : /* @__PURE__ */ jsxs(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ onClick: begin,
91
+ className: cn(
92
+ "group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
93
+ error && "ring-2 ring-destructive"
94
+ ),
95
+ children: [
96
+ /* @__PURE__ */ jsx("span", { className: cn("truncate", !committed && "text-muted-foreground"), children: committed || placeholder }),
97
+ /* @__PURE__ */ jsx(Pencil, { className: "size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100" })
98
+ ]
99
+ }
100
+ ) });
101
+ }
102
+ );
103
+ InlineEdit.displayName = "InlineEdit";
104
+ export {
105
+ InlineEdit
106
+ };
107
+ //# sourceMappingURL=inline-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/inline-edit.tsx","../src/lib/cn.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Pencil } from \"lucide-react\";\n\nimport { cn } from \"@/lib/cn\";\n\nexport interface InlineEditProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\" | \"onSubmit\"> {\n /** The current value. */\n value: string;\n /** Persist a new value. May be async; if it rejects, the edit is rolled back. */\n onSave?: (value: string) => void | Promise<void>;\n placeholder?: string;\n /** Use a multi-line textarea instead of a single-line input. */\n multiline?: boolean;\n inputClassName?: string;\n}\n\n/**\n * Click-to-edit text that swaps to an input in place and saves optimistically — the new value shows\n * immediately and only rolls back if `onSave` rejects. Removes a whole class of one-off edit modals.\n * Enter (or blur) saves; Escape cancels. Shift+Enter inserts a newline in multiline mode.\n */\nconst InlineEdit = React.forwardRef<HTMLDivElement, InlineEditProps>(\n ({ className, value, onSave, placeholder = \"Empty\", multiline = false, inputClassName, ...props }, ref) => {\n const [committed, setCommitted] = React.useState(value);\n const [editing, setEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n const [error, setError] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n\n // Keep in sync if the value changes externally while not editing.\n React.useEffect(() => {\n if (!editing) setCommitted(value);\n }, [value, editing]);\n\n const begin = () => {\n setDraft(committed);\n setError(false);\n setEditing(true);\n };\n\n React.useEffect(() => {\n if (editing) inputRef.current?.select();\n }, [editing]);\n\n const commit = async () => {\n const next = draft.trim();\n setEditing(false);\n if (next === committed) return;\n const previous = committed;\n setCommitted(next); // optimistic\n try {\n await onSave?.(next);\n setError(false);\n } catch {\n setCommitted(previous); // roll back\n setError(true);\n }\n };\n\n const cancel = () => {\n setDraft(committed);\n setEditing(false);\n };\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" && !(multiline && e.shiftKey)) {\n e.preventDefault();\n void commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n cancel();\n }\n };\n\n const sharedInputClass = cn(\n \"w-full rounded-md border border-input bg-background px-2 py-1 text-inherit outline-none ring-ring focus-visible:ring-2\",\n inputClassName\n );\n\n return (\n <div ref={ref} className={cn(\"min-w-0\", className)} {...props}>\n {editing ? (\n multiline ? (\n <textarea\n ref={inputRef}\n value={draft}\n rows={3}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={() => void commit()}\n onKeyDown={onKeyDown}\n className={cn(sharedInputClass, \"resize-none\")}\n />\n ) : (\n <input\n ref={inputRef}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={() => void commit()}\n onKeyDown={onKeyDown}\n className={sharedInputClass}\n />\n )\n ) : (\n <button\n type=\"button\"\n onClick={begin}\n className={cn(\n \"group inline-flex max-w-full items-center gap-1.5 rounded-md px-2 py-1 text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n error && \"ring-2 ring-destructive\"\n )}\n >\n <span className={cn(\"truncate\", !committed && \"text-muted-foreground\")}>\n {committed || placeholder}\n </span>\n <Pencil className=\"size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100\" />\n </button>\n )}\n </div>\n );\n }\n);\nInlineEdit.displayName = \"InlineEdit\";\n\nexport { InlineEdit };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAEA,YAAY,WAAW;AACvB,SAAS,cAAc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;AACjB,aAAK,OAAO;AAAA,MACd,WAAW,EAAE,QAAQ,UAAU;AAC7B,UAAE,eAAe;AACjB,eAAO;AAAA,MACT;AAAA,IACF;AAEA,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,IACF;AAEA,WACE,oBAAC,SAAI,KAAU,WAAW,GAAG,WAAW,SAAS,GAAI,GAAG,OACrD,oBACC,YACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,QACxC,QAAQ,MAAM,KAAK,OAAO;AAAA,QAC1B;AAAA,QACA,WAAW,GAAG,kBAAkB,aAAa;AAAA;AAAA,IAC/C,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,QACxC,QAAQ,MAAM,KAAK,OAAO;AAAA,QAC1B;AAAA,QACA,WAAW;AAAA;AAAA,IACb,IAGF;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,SAAS;AAAA,QACX;AAAA,QAEA;AAAA,8BAAC,UAAK,WAAW,GAAG,YAAY,CAAC,aAAa,uBAAuB,GAClE,uBAAa,aAChB;AAAA,UACA,oBAAC,UAAO,WAAU,gGAA+F;AAAA;AAAA;AAAA,IACnH,GAEJ;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+
3
+ type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
4
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
5
+
6
+ export { Input, type InputProps };
package/dist/input.js ADDED
@@ -0,0 +1,31 @@
1
+ // src/components/ui/input.tsx
2
+ import * as React from "react";
3
+
4
+ // src/lib/cn.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
11
+ // src/components/ui/input.tsx
12
+ import { jsx } from "react/jsx-runtime";
13
+ var Input = React.forwardRef(
14
+ ({ className, type = "text", ...props }, ref) => /* @__PURE__ */ jsx(
15
+ "input",
16
+ {
17
+ ref,
18
+ type,
19
+ className: cn(
20
+ "flex h-10 w-full rounded-lg border border-input bg-card px-3.5 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium",
21
+ className
22
+ ),
23
+ ...props
24
+ }
25
+ )
26
+ );
27
+ Input.displayName = "Input";
28
+ export {
29
+ Input
30
+ };
31
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/input.tsx","../src/lib/cn.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/lib/cn\";\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = \"text\", ...props }, ref) => (\n <input\n ref={ref}\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-lg border border-input bg-card px-3.5 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium\",\n className\n )}\n {...props}\n />\n )\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADFI;AAFJ,IAAM,QAAc;AAAA,EAClB,CAAC,EAAE,WAAW,OAAO,QAAQ,GAAG,MAAM,GAAG,QACvC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;","names":[]}
package/dist/kbd.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const kbdVariants: (props?: ({
6
+ size?: "sm" | "md" | "lg" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ interface KbdProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof kbdVariants> {
9
+ }
10
+ /**
11
+ * Canonical keyboard-key display — `⌘`, `K`, `Esc`. Compose several for a chord
12
+ * (`<Kbd>⌘</Kbd><Kbd>K</Kbd>`); pairs naturally with the Command menu.
13
+ */
14
+ declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
15
+
16
+ export { Kbd, type KbdProps, kbdVariants };
package/dist/kbd.js ADDED
@@ -0,0 +1,35 @@
1
+ // src/components/ui/kbd.tsx
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+
5
+ // src/lib/cn.ts
6
+ import { clsx } from "clsx";
7
+ import { twMerge } from "tailwind-merge";
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+
12
+ // src/components/ui/kbd.tsx
13
+ import { jsx } from "react/jsx-runtime";
14
+ var kbdVariants = cva(
15
+ "inline-flex select-none items-center justify-center gap-1 rounded border border-border border-b-2 bg-muted font-mono font-medium text-muted-foreground shadow-xs",
16
+ {
17
+ variants: {
18
+ size: {
19
+ sm: "h-5 min-w-5 px-1 text-[10px]",
20
+ md: "h-6 min-w-6 px-1.5 text-xs",
21
+ lg: "h-7 min-w-7 px-2 text-sm"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ size: "md"
26
+ }
27
+ }
28
+ );
29
+ var Kbd = React.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("kbd", { ref, className: cn(kbdVariants({ size }), className), ...props }));
30
+ Kbd.displayName = "Kbd";
31
+ export {
32
+ Kbd,
33
+ kbdVariants
34
+ };
35
+ //# sourceMappingURL=kbd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/kbd.tsx","../src/lib/cn.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/cn\";\n\nconst kbdVariants = cva(\n \"inline-flex select-none items-center justify-center gap-1 rounded border border-border border-b-2 bg-muted font-mono font-medium text-muted-foreground shadow-xs\",\n {\n variants: {\n size: {\n sm: \"h-5 min-w-5 px-1 text-[10px]\",\n md: \"h-6 min-w-6 px-1.5 text-xs\",\n lg: \"h-7 min-w-7 px-2 text-sm\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nexport interface KbdProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof kbdVariants> {}\n\n/**\n * Canonical keyboard-key display — `⌘`, `K`, `Esc`. Compose several for a chord\n * (`<Kbd>⌘</Kbd><Kbd>K</Kbd>`); pairs naturally with the Command menu.\n */\nconst Kbd = React.forwardRef<HTMLElement, KbdProps>(({ className, size, ...props }, ref) => (\n <kbd ref={ref} className={cn(kbdVariants({ size }), className)} {...props} />\n));\nKbd.displayName = \"Kbd\";\n\nexport { Kbd, kbdVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,WAA8B;;;ACDvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADoBE;AAzBF,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAUA,IAAM,MAAY,iBAAkC,CAAC,EAAE,WAAW,MAAM,GAAG,MAAM,GAAG,QAClF,oBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,EAAE,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO,CAC5E;AACD,IAAI,cAAc;","names":[]}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import * as LabelPrimitive from '@radix-ui/react-label';
3
+
4
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
5
+
6
+ export { Label };
package/dist/label.js ADDED
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ // src/components/ui/label.tsx
4
+ import * as React from "react";
5
+ import * as LabelPrimitive from "@radix-ui/react-label";
6
+
7
+ // src/lib/cn.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
14
+ // src/components/ui/label.tsx
15
+ import { jsx } from "react/jsx-runtime";
16
+ var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
17
+ LabelPrimitive.Root,
18
+ {
19
+ ref,
20
+ className: cn(
21
+ "text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
22
+ className
23
+ ),
24
+ ...props
25
+ }
26
+ ));
27
+ Label.displayName = "Label";
28
+ export {
29
+ Label
30
+ };
31
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/label.tsx","../src/lib/cn.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\n\nimport { cn } from \"@/lib/cn\";\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n));\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAEA,YAAY,WAAW;AACvB,YAAY,oBAAoB;;;ACHhC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADCE;AAJF,IAAM,QAAc,iBAGlB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAgB;AAAA,EAAf;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc;","names":[]}
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ data: Array<Record<string, string | number>>;
5
+ index: string;
6
+ categories: string[];
7
+ colors?: string[];
8
+ height?: number;
9
+ valueFormat?: (value: number) => string;
10
+ showGrid?: boolean;
11
+ showLegend?: boolean;
12
+ showYAxis?: boolean;
13
+ curved?: boolean;
14
+ }
15
+ declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<HTMLDivElement>>;
16
+
17
+ export { LineChart, type LineChartProps };
@@ -0,0 +1,120 @@
1
+ "use client";
2
+
3
+ // src/components/charts/line-chart.tsx
4
+ import * as React from "react";
5
+ import { useReducedMotion } from "motion/react";
6
+ import {
7
+ CartesianGrid,
8
+ Legend,
9
+ Line,
10
+ LineChart as RechartsLineChart,
11
+ ResponsiveContainer,
12
+ Tooltip,
13
+ XAxis,
14
+ YAxis
15
+ } from "recharts";
16
+
17
+ // src/lib/cn.ts
18
+ import { clsx } from "clsx";
19
+ import { twMerge } from "tailwind-merge";
20
+ function cn(...inputs) {
21
+ return twMerge(clsx(inputs));
22
+ }
23
+
24
+ // src/components/charts/chart-tooltip.tsx
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ function ChartTooltip({
27
+ active,
28
+ payload,
29
+ label,
30
+ valueFormat
31
+ }) {
32
+ if (!active || !payload || payload.length === 0) return null;
33
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border bg-popover px-3 py-2 text-xs shadow-lift", children: [
34
+ label != null ? /* @__PURE__ */ jsx("p", { className: "mb-1.5 font-medium text-foreground", children: label }) : null,
35
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: payload.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
36
+ /* @__PURE__ */ jsx(
37
+ "span",
38
+ {
39
+ className: "size-2 shrink-0 rounded-full",
40
+ style: { background: item.color }
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx("span", { className: "capitalize", children: item.name }),
44
+ /* @__PURE__ */ jsx("span", { className: "ml-auto font-medium text-foreground", children: typeof item.value === "number" && valueFormat ? valueFormat(item.value) : item.value })
45
+ ] }, i)) })
46
+ ] });
47
+ }
48
+
49
+ // src/components/charts/line-chart.tsx
50
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
51
+ var DEFAULT_COLORS = ["--chart-1", "--chart-2", "--chart-3", "--chart-4", "--chart-5"];
52
+ var color = (v) => `hsl(var(${v}))`;
53
+ var LineChart = React.forwardRef(
54
+ ({
55
+ className,
56
+ data,
57
+ index,
58
+ categories,
59
+ colors = DEFAULT_COLORS,
60
+ height = 240,
61
+ valueFormat = (n) => n.toLocaleString(),
62
+ showGrid = true,
63
+ showLegend = false,
64
+ showYAxis = false,
65
+ curved = true,
66
+ ...props
67
+ }, ref) => {
68
+ const reduced = useReducedMotion();
69
+ return /* @__PURE__ */ jsx2("div", { ref, className: cn("w-full", className), style: { height }, ...props, children: /* @__PURE__ */ jsx2(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(RechartsLineChart, { data, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
70
+ showGrid ? /* @__PURE__ */ jsx2(CartesianGrid, { vertical: false, stroke: "hsl(var(--border))", strokeDasharray: "3 6" }) : null,
71
+ /* @__PURE__ */ jsx2(
72
+ XAxis,
73
+ {
74
+ dataKey: index,
75
+ tickLine: false,
76
+ axisLine: false,
77
+ tick: { fill: "hsl(var(--muted-foreground))", fontSize: 12 },
78
+ dy: 8
79
+ }
80
+ ),
81
+ showYAxis ? /* @__PURE__ */ jsx2(
82
+ YAxis,
83
+ {
84
+ tickLine: false,
85
+ axisLine: false,
86
+ width: 40,
87
+ tick: { fill: "hsl(var(--muted-foreground))", fontSize: 12 },
88
+ tickFormatter: (v) => valueFormat(Number(v))
89
+ }
90
+ ) : null,
91
+ /* @__PURE__ */ jsx2(
92
+ Tooltip,
93
+ {
94
+ cursor: { stroke: "hsl(var(--muted-foreground))", strokeDasharray: "3 4" },
95
+ content: /* @__PURE__ */ jsx2(ChartTooltip, { valueFormat })
96
+ }
97
+ ),
98
+ showLegend ? /* @__PURE__ */ jsx2(Legend, { iconType: "circle" }) : null,
99
+ categories.map((cat, i) => /* @__PURE__ */ jsx2(
100
+ Line,
101
+ {
102
+ type: curved ? "monotone" : "linear",
103
+ dataKey: cat,
104
+ stroke: color(colors[i % colors.length] ?? "--chart-1"),
105
+ strokeWidth: 2.5,
106
+ dot: false,
107
+ activeDot: { r: 4, strokeWidth: 2, stroke: "hsl(var(--card))" },
108
+ isAnimationActive: !reduced,
109
+ animationDuration: 900
110
+ },
111
+ cat
112
+ ))
113
+ ] }) }) });
114
+ }
115
+ );
116
+ LineChart.displayName = "LineChart";
117
+ export {
118
+ LineChart
119
+ };
120
+ //# sourceMappingURL=line-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/charts/line-chart.tsx","../src/lib/cn.ts","../src/components/charts/chart-tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useReducedMotion } from \"motion/react\";\nimport {\n CartesianGrid,\n Legend,\n Line,\n LineChart as RechartsLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\n\nimport { cn } from \"@/lib/cn\";\nimport { ChartTooltip } from \"@/components/charts/chart-tooltip\";\n\nconst DEFAULT_COLORS = [\"--chart-1\", \"--chart-2\", \"--chart-3\", \"--chart-4\", \"--chart-5\"];\nconst color = (v: string) => `hsl(var(${v}))`;\n\nexport interface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {\n data: Array<Record<string, string | number>>;\n index: string;\n categories: string[];\n colors?: string[];\n height?: number;\n valueFormat?: (value: number) => string;\n showGrid?: boolean;\n showLegend?: boolean;\n showYAxis?: boolean;\n curved?: boolean;\n}\n\nexport const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n className,\n data,\n index,\n categories,\n colors = DEFAULT_COLORS,\n height = 240,\n valueFormat = (n) => n.toLocaleString(),\n showGrid = true,\n showLegend = false,\n showYAxis = false,\n curved = true,\n ...props\n },\n ref\n ) => {\n const reduced = useReducedMotion();\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)} style={{ height }} {...props}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsLineChart data={data} margin={{ top: 8, right: 8, bottom: 0, left: 0 }}>\n {showGrid ? (\n <CartesianGrid vertical={false} stroke=\"hsl(var(--border))\" strokeDasharray=\"3 6\" />\n ) : null}\n <XAxis\n dataKey={index}\n tickLine={false}\n axisLine={false}\n tick={{ fill: \"hsl(var(--muted-foreground))\", fontSize: 12 }}\n dy={8}\n />\n {showYAxis ? (\n <YAxis\n tickLine={false}\n axisLine={false}\n width={40}\n tick={{ fill: \"hsl(var(--muted-foreground))\", fontSize: 12 }}\n tickFormatter={(v) => valueFormat(Number(v))}\n />\n ) : null}\n <Tooltip\n cursor={{ stroke: \"hsl(var(--muted-foreground))\", strokeDasharray: \"3 4\" }}\n content={<ChartTooltip valueFormat={valueFormat} />}\n />\n {showLegend ? <Legend iconType=\"circle\" /> : null}\n {categories.map((cat, i) => (\n <Line\n key={cat}\n type={curved ? \"monotone\" : \"linear\"}\n dataKey={cat}\n stroke={color(colors[i % colors.length] ?? \"--chart-1\")}\n strokeWidth={2.5}\n dot={false}\n activeDot={{ r: 4, strokeWidth: 2, stroke: \"hsl(var(--card))\" }}\n isAnimationActive={!reduced}\n animationDuration={900}\n />\n ))}\n </RechartsLineChart>\n </ResponsiveContainer>\n </div>\n );\n }\n);\nLineChart.displayName = \"LineChart\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * Every Kineto component accepts `className` and merges it through `cn()`,\n * so consumer overrides always win over the component's defaults.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ChartTooltipItem {\n name?: string | number;\n value?: string | number;\n color?: string;\n dataKey?: string | number;\n}\n\nexport interface ChartTooltipProps {\n active?: boolean;\n payload?: ChartTooltipItem[];\n label?: string | number;\n valueFormat?: (value: number) => string;\n}\n\n/** Themed Recharts tooltip — pass as `<Tooltip content={<ChartTooltip />} />`. */\nexport function ChartTooltip({\n active,\n payload,\n label,\n valueFormat,\n}: ChartTooltipProps) {\n if (!active || !payload || payload.length === 0) return null;\n\n return (\n <div className=\"rounded-lg border border-border bg-popover px-3 py-2 text-xs shadow-lift\">\n {label != null ? (\n <p className=\"mb-1.5 font-medium text-foreground\">{label}</p>\n ) : null}\n <div className=\"flex flex-col gap-1\">\n {payload.map((item, i) => (\n <div key={i} className=\"flex items-center gap-2 text-muted-foreground\">\n <span\n className=\"size-2 shrink-0 rounded-full\"\n style={{ background: item.color }}\n />\n <span className=\"capitalize\">{item.name}</span>\n <span className=\"ml-auto font-medium text-foreground\">\n {typeof item.value === \"number\" && valueFormat\n ? valueFormat(item.value)\n : item.value}\n </span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAEA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACbP,SAAS,YAA6B;AACtC,SAAS,eAAe;AAOjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACoBQ,cAIE,YAJF;AAXD,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA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string;
6
+ icon?: LucideIcon;
7
+ }
8
+ interface LogoCloudProps extends React.HTMLAttributes<HTMLElement> {
9
+ title?: string;
10
+ logos: LogoCloudItem[];
11
+ }
12
+ declare const LogoCloud: React.ForwardRefExoticComponent<LogoCloudProps & React.RefAttributes<HTMLElement>>;
13
+
14
+ export { LogoCloud, type LogoCloudItem, type LogoCloudProps };