@hanzo/ui 5.3.35 → 5.3.36

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 (254) hide show
  1. package/bin/create-registry.js +0 -0
  2. package/bin/npx-registry-mcp.js +0 -0
  3. package/bin/registry-mcp-wrapper.sh +0 -0
  4. package/bin/registry-mcp.js +0 -0
  5. package/bin/start-mcp-server.sh +0 -0
  6. package/bin/test-mcp.sh +0 -0
  7. package/dist/3d/button.js +1 -297
  8. package/dist/3d/button.mjs +1 -272
  9. package/dist/3d/card.js +1 -233
  10. package/dist/3d/card.mjs +1 -206
  11. package/dist/3d/carousel.js +1 -370
  12. package/dist/3d/carousel.mjs +1 -343
  13. package/dist/3d/grid.js +1 -361
  14. package/dist/3d/grid.mjs +1 -336
  15. package/dist/3d/index.js +1 -1517
  16. package/dist/3d/index.mjs +1 -1471
  17. package/dist/3d/marquee.js +1 -351
  18. package/dist/3d/marquee.mjs +1 -326
  19. package/dist/3d/pin.js +1 -45
  20. package/dist/3d/pin.mjs +1 -23
  21. package/dist/accordion.js +1 -79
  22. package/dist/accordion.mjs +1 -54
  23. package/dist/alert-dialog.js +1 -224
  24. package/dist/alert-dialog.mjs +1 -191
  25. package/dist/alert.js +1 -97
  26. package/dist/alert.mjs +1 -91
  27. package/dist/animation/animated-background.js +1 -423
  28. package/dist/animation/animated-background.mjs +1 -417
  29. package/dist/animation/animated-beam.js +1 -118
  30. package/dist/animation/animated-beam.mjs +1 -96
  31. package/dist/animation/animated-cursor.js +1 -274
  32. package/dist/animation/animated-cursor.mjs +1 -269
  33. package/dist/animation/animated-icon.js +2 -356
  34. package/dist/animation/animated-icon.mjs +2 -350
  35. package/dist/animation/animated-list.js +1 -338
  36. package/dist/animation/animated-list.mjs +1 -332
  37. package/dist/animation/animated-number.js +1 -282
  38. package/dist/animation/animated-number.mjs +1 -276
  39. package/dist/animation/animated-testimonials.js +1 -96
  40. package/dist/animation/animated-testimonials.mjs +1 -74
  41. package/dist/animation/animated-tooltip.js +1 -66
  42. package/dist/animation/animated-tooltip.mjs +1 -44
  43. package/dist/animation/apple-cards-carousel.js +1 -307
  44. package/dist/animation/apple-cards-carousel.mjs +1 -284
  45. package/dist/animation/apple-hello-effect.js +1 -59
  46. package/dist/animation/apple-hello-effect.mjs +1 -37
  47. package/dist/animation/index.js +2 -1951
  48. package/dist/animation/index.mjs +2 -1920
  49. package/dist/avatar.js +1 -70
  50. package/dist/avatar.mjs +1 -46
  51. package/dist/badge.js +1 -60
  52. package/dist/badge.mjs +1 -54
  53. package/dist/blocks/index.js +2 -1684
  54. package/dist/blocks/index.mjs +2 -1645
  55. package/dist/breadcrumb.js +1 -106
  56. package/dist/breadcrumb.mjs +1 -98
  57. package/dist/calendar-ext/index.js +1 -207
  58. package/dist/calendar-ext/index.mjs +1 -169
  59. package/dist/calendar.js +1 -193
  60. package/dist/calendar.mjs +1 -168
  61. package/dist/carousel.js +1 -282
  62. package/dist/carousel.mjs +1 -253
  63. package/dist/charts/index.js +6 -5840
  64. package/dist/charts/index.mjs +6 -5749
  65. package/dist/checkbox.js +1 -59
  66. package/dist/checkbox.mjs +1 -34
  67. package/dist/code/block.js +2 -225
  68. package/dist/code/block.mjs +2 -202
  69. package/dist/code/compare.js +5 -444
  70. package/dist/code/compare.mjs +5 -421
  71. package/dist/code/diff.js +12 -429
  72. package/dist/code/diff.mjs +11 -405
  73. package/dist/code/editor.js +1 -242
  74. package/dist/code/editor.mjs +1 -217
  75. package/dist/code/explorer.js +1 -290
  76. package/dist/code/explorer.mjs +1 -267
  77. package/dist/code/index.js +26 -2514
  78. package/dist/code/index.mjs +24 -2471
  79. package/dist/code/preview.js +6 -363
  80. package/dist/code/preview.mjs +6 -340
  81. package/dist/code/snippet.js +2 -273
  82. package/dist/code/snippet.mjs +2 -249
  83. package/dist/code/tabs.js +1 -74
  84. package/dist/code/tabs.mjs +1 -52
  85. package/dist/code/terminal.js +3 -436
  86. package/dist/code/terminal.mjs +3 -413
  87. package/dist/collapsible.js +1 -32
  88. package/dist/collapsible.mjs +1 -8
  89. package/dist/command.js +1 -282
  90. package/dist/command.mjs +1 -251
  91. package/dist/context-menu.js +1 -206
  92. package/dist/context-menu.mjs +1 -170
  93. package/dist/desktop/hooks.js +1 -223
  94. package/dist/desktop/hooks.mjs +1 -198
  95. package/dist/desktop/index.js +1 -685
  96. package/dist/desktop/index.mjs +1 -657
  97. package/dist/desktop/spotlight.js +1 -260
  98. package/dist/desktop/spotlight.mjs +1 -235
  99. package/dist/desktop/window.js +1 -273
  100. package/dist/desktop/window.mjs +1 -247
  101. package/dist/device/index.js +1 -2
  102. package/dist/device/index.mjs +0 -1
  103. package/dist/dialog.js +1 -245
  104. package/dist/dialog.mjs +1 -213
  105. package/dist/dock/basic.js +1 -173
  106. package/dist/dock/basic.mjs +1 -150
  107. package/dist/dock/index.js +1 -647
  108. package/dist/dock/index.mjs +1 -620
  109. package/dist/dock/limelight-nav.js +1 -314
  110. package/dist/dock/limelight-nav.mjs +1 -293
  111. package/dist/dock/macos.js +1 -140
  112. package/dist/dock/macos.mjs +1 -117
  113. package/dist/dock/menu.js +1 -69
  114. package/dist/dock/menu.mjs +1 -47
  115. package/dist/dock/message.js +1 -148
  116. package/dist/dock/message.mjs +1 -126
  117. package/dist/drawer.js +1 -114
  118. package/dist/drawer.mjs +1 -102
  119. package/dist/dropdown-menu.js +1 -201
  120. package/dist/dropdown-menu.mjs +1 -165
  121. package/dist/finance/AdvancedChart.js +2 -47
  122. package/dist/finance/AdvancedChart.mjs +2 -45
  123. package/dist/finance/CompanyProfile.js +2 -47
  124. package/dist/finance/CompanyProfile.mjs +2 -45
  125. package/dist/finance/CryptoScreener.js +2 -44
  126. package/dist/finance/CryptoScreener.mjs +2 -42
  127. package/dist/finance/Financials.js +2 -51
  128. package/dist/finance/Financials.mjs +2 -49
  129. package/dist/finance/ForexScreener.js +2 -45
  130. package/dist/finance/ForexScreener.mjs +2 -43
  131. package/dist/finance/MarketOverview.js +2 -103
  132. package/dist/finance/MarketOverview.mjs +2 -101
  133. package/dist/finance/NewsTimeline.js +2 -43
  134. package/dist/finance/NewsTimeline.mjs +2 -41
  135. package/dist/finance/OrderEntry.js +1 -130
  136. package/dist/finance/OrderEntry.mjs +1 -128
  137. package/dist/finance/OrdersHistory.js +1 -63
  138. package/dist/finance/OrdersHistory.mjs +1 -61
  139. package/dist/finance/PositionsList.js +1 -79
  140. package/dist/finance/PositionsList.mjs +1 -77
  141. package/dist/finance/StockScreener.js +2 -45
  142. package/dist/finance/StockScreener.mjs +2 -43
  143. package/dist/finance/SymbolInfo.js +2 -45
  144. package/dist/finance/SymbolInfo.mjs +2 -43
  145. package/dist/finance/TechnicalAnalysis.js +2 -53
  146. package/dist/finance/TechnicalAnalysis.mjs +2 -51
  147. package/dist/finance/TickerTape.js +2 -55
  148. package/dist/finance/TickerTape.mjs +2 -53
  149. package/dist/finance/TradingPanel.js +1 -190
  150. package/dist/finance/TradingPanel.mjs +1 -188
  151. package/dist/finance/index.js +2 -929
  152. package/dist/finance/index.mjs +2 -913
  153. package/dist/form/index.js +1 -153
  154. package/dist/form/index.mjs +1 -123
  155. package/dist/form.js +1 -171
  156. package/dist/form.mjs +1 -141
  157. package/dist/hover-card.js +1 -57
  158. package/dist/hover-card.mjs +1 -33
  159. package/dist/index.js +192 -9618
  160. package/dist/index.mjs +192 -9202
  161. package/dist/input-otp.js +1 -78
  162. package/dist/input-otp.mjs +1 -53
  163. package/dist/kanban/index.js +1 -593
  164. package/dist/kanban/index.mjs +1 -571
  165. package/dist/lib/utils.js +1 -28
  166. package/dist/lib/utils.mjs +1 -24
  167. package/dist/mermaid/index.js +1 -280
  168. package/dist/mermaid/index.mjs +1 -253
  169. package/dist/navigation/index.js +1 -97
  170. package/dist/navigation/index.mjs +1 -78
  171. package/dist/navigation-menu.js +1 -148
  172. package/dist/navigation-menu.mjs +1 -115
  173. package/dist/pattern/grid-pattern.js +3 -325
  174. package/dist/pattern/grid-pattern.mjs +3 -302
  175. package/dist/pattern/index.js +3 -325
  176. package/dist/pattern/index.mjs +3 -302
  177. package/dist/popover.js +1 -62
  178. package/dist/popover.mjs +1 -36
  179. package/dist/progress.js +1 -61
  180. package/dist/progress.mjs +1 -36
  181. package/dist/project/gantt.js +1 -64
  182. package/dist/project/gantt.mjs +1 -42
  183. package/dist/project/index.js +1 -635
  184. package/dist/project/index.mjs +1 -610
  185. package/dist/project/kanban.js +1 -596
  186. package/dist/project/kanban.mjs +1 -571
  187. package/dist/project/list.js +1 -34
  188. package/dist/project/list.mjs +1 -11
  189. package/dist/radio-group.js +1 -67
  190. package/dist/radio-group.mjs +1 -44
  191. package/dist/resizable.js +1 -71
  192. package/dist/resizable.mjs +1 -47
  193. package/dist/scroll-area.js +1 -88
  194. package/dist/scroll-area.mjs +1 -65
  195. package/dist/select.js +1 -139
  196. package/dist/select.mjs +1 -110
  197. package/dist/separator.js +1 -58
  198. package/dist/separator.mjs +1 -33
  199. package/dist/sheet.js +1 -147
  200. package/dist/sheet.mjs +1 -116
  201. package/dist/skeleton.js +1 -31
  202. package/dist/skeleton.mjs +1 -26
  203. package/dist/slider.js +1 -98
  204. package/dist/slider.mjs +1 -72
  205. package/dist/sonner.js +1 -33
  206. package/dist/sonner.mjs +1 -28
  207. package/dist/spline/index.js +1 -210
  208. package/dist/spline/index.mjs +1 -201
  209. package/dist/spline/media-stack.js +1 -192
  210. package/dist/spline/media-stack.mjs +1 -184
  211. package/dist/spline/player.js +1 -36
  212. package/dist/spline/player.mjs +1 -30
  213. package/dist/switch.js +1 -61
  214. package/dist/switch.mjs +1 -36
  215. package/dist/table.js +1 -109
  216. package/dist/table.mjs +1 -100
  217. package/dist/tabs.js +1 -127
  218. package/dist/tabs.mjs +1 -101
  219. package/dist/tailwind/index.mjs +1 -2011
  220. package/dist/textarea.js +1 -77
  221. package/dist/textarea.mjs +1 -55
  222. package/dist/toggle-group.js +1 -117
  223. package/dist/toggle-group.mjs +1 -92
  224. package/dist/toggle.js +1 -70
  225. package/dist/toggle.mjs +1 -47
  226. package/dist/tooltip.js +1 -66
  227. package/dist/tooltip.mjs +1 -39
  228. package/dist/types/index.mjs +1 -51
  229. package/dist/ui/announcement.js +1 -133
  230. package/dist/ui/announcement.mjs +1 -111
  231. package/dist/ui/avatar-group.js +1 -87
  232. package/dist/ui/avatar-group.mjs +1 -64
  233. package/dist/ui/banner.js +1 -84
  234. package/dist/ui/banner.mjs +1 -61
  235. package/dist/ui/cursor.js +1 -77
  236. package/dist/ui/cursor.mjs +1 -55
  237. package/dist/ui/index.js +1 -494
  238. package/dist/ui/index.mjs +1 -461
  239. package/dist/ui/marquee.js +1 -73
  240. package/dist/ui/marquee.mjs +1 -51
  241. package/dist/ui/pill.js +1 -84
  242. package/dist/ui/pill.mjs +1 -61
  243. package/dist/ui/spinner.js +1 -27
  244. package/dist/ui/spinner.mjs +1 -25
  245. package/dist/ui/tags.js +1 -116
  246. package/dist/ui/tags.mjs +1 -94
  247. package/dist/ui/ticker.js +1 -72
  248. package/dist/ui/ticker.mjs +1 -50
  249. package/dist/util/index.mjs +1 -404
  250. package/package.json +28 -27
  251. package/dist/primitives/index.js +0 -9619
  252. package/dist/primitives/index.mjs +0 -9203
  253. package/dist/primitives-export.js +0 -9619
  254. package/dist/primitives-export.mjs +0 -9203
@@ -1,572 +1,2 @@
1
1
  "use client";
2
- import * as React from 'react';
3
- import { useSensors, useSensor, PointerSensor, DndContext, closestCorners, DragOverlay } from '@dnd-kit/core';
4
- import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
5
- import { CSS } from '@dnd-kit/utilities';
6
- import { cva } from 'class-variance-authority';
7
- import { Search, User, Calendar, MoreHorizontal, Edit3, X, Plus } from 'lucide-react';
8
- import { cn } from '@hanzo/ui/lib/utils';
9
- import { Badge } from '@hanzo/ui/primitives/badge';
10
- import { Button } from '@hanzo/ui/primitives/button';
11
- import { Card, CardHeader } from '@hanzo/ui/primitives/card';
12
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@hanzo/ui/primitives/dialog';
13
- import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@hanzo/ui/primitives/dropdown-menu';
14
- import { Input } from '@hanzo/ui/primitives/input';
15
- import { Label } from '@hanzo/ui/primitives/label';
16
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@hanzo/ui/primitives/select';
17
- import { Textarea } from '@hanzo/ui/primitives/textarea';
18
- import { jsxs, jsx } from 'react/jsx-runtime';
19
-
20
- var __defProp = Object.defineProperty;
21
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
22
- var priorityVariants = cva(
23
- "inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-semibold",
24
- {
25
- variants: {
26
- priority: {
27
- low: "border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-400",
28
- medium: "border-yellow-200 bg-yellow-50 text-yellow-700 dark:border-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-400",
29
- high: "border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-400",
30
- urgent: "border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-400"
31
- }
32
- },
33
- defaultVariants: {
34
- priority: "low"
35
- }
36
- }
37
- );
38
- function SortableCard({
39
- card,
40
- onEdit,
41
- onDelete
42
- }) {
43
- const {
44
- attributes,
45
- listeners,
46
- setNodeRef,
47
- transform,
48
- transition,
49
- isDragging
50
- } = useSortable({ id: card.id });
51
- const style = {
52
- transform: CSS.Transform.toString(transform),
53
- transition
54
- };
55
- return /* @__PURE__ */ jsx(
56
- "div",
57
- {
58
- ref: setNodeRef,
59
- style,
60
- ...attributes,
61
- ...listeners,
62
- className: cn(
63
- "cursor-grab active:cursor-grabbing",
64
- isDragging && "opacity-50"
65
- ),
66
- children: /* @__PURE__ */ jsx(KanbanCardComponent, { card, onEdit, onDelete })
67
- }
68
- );
69
- }
70
- __name(SortableCard, "SortableCard");
71
- function KanbanCardComponent({
72
- card,
73
- onEdit,
74
- onDelete
75
- }) {
76
- return /* @__PURE__ */ jsx(Card, { className: "mb-3 group hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
77
- /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm leading-tight mb-2 break-words", children: card.title }),
78
- card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mb-2", children: card.description }),
79
- card.labels && card.labels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.labels.map((label) => /* @__PURE__ */ jsx(
80
- Badge,
81
- {
82
- variant: "outline",
83
- className: "text-xs h-5",
84
- style: {
85
- backgroundColor: `${label.color}20`,
86
- borderColor: label.color,
87
- color: label.color
88
- },
89
- children: label.name
90
- },
91
- label.id
92
- )) }),
93
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
94
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
95
- card.priority && /* @__PURE__ */ jsx(
96
- "span",
97
- {
98
- className: cn(
99
- priorityVariants({ priority: card.priority })
100
- ),
101
- children: card.priority
102
- }
103
- ),
104
- card.assignee && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-muted-foreground", children: [
105
- /* @__PURE__ */ jsx(User, { className: "h-3 w-3" }),
106
- /* @__PURE__ */ jsx("span", { children: card.assignee })
107
- ] })
108
- ] }),
109
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
110
- card.dueDate && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-muted-foreground", children: [
111
- /* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
112
- /* @__PURE__ */ jsx("span", { children: new Date(card.dueDate).toLocaleDateString() })
113
- ] }),
114
- /* @__PURE__ */ jsxs(DropdownMenu, { children: [
115
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
116
- Button,
117
- {
118
- variant: "ghost",
119
- size: "icon",
120
- className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
121
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-3 w-3" })
122
- }
123
- ) }),
124
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
125
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => onEdit(card), children: [
126
- /* @__PURE__ */ jsx(Edit3, { className: "h-4 w-4 mr-2" }),
127
- "Edit"
128
- ] }),
129
- /* @__PURE__ */ jsxs(
130
- DropdownMenuItem,
131
- {
132
- onClick: () => onDelete(card.id),
133
- className: "text-destructive",
134
- children: [
135
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4 mr-2" }),
136
- "Delete"
137
- ]
138
- }
139
- )
140
- ] })
141
- ] })
142
- ] })
143
- ] })
144
- ] }) }) }) });
145
- }
146
- __name(KanbanCardComponent, "KanbanCardComponent");
147
- function KanbanColumnComponent({
148
- column,
149
- onAddCard,
150
- onEditCard,
151
- onDeleteCard
152
- }) {
153
- const { setNodeRef } = useSortable({ id: column.id });
154
- return /* @__PURE__ */ jsxs(
155
- "div",
156
- {
157
- ref: setNodeRef,
158
- className: "bg-muted/50 rounded-lg p-4 min-w-[280px] max-w-[280px] flex flex-col",
159
- children: [
160
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
161
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
162
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: column.title }),
163
- /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "text-xs", children: [
164
- column.cards.length,
165
- column.limit && `/${column.limit}`
166
- ] })
167
- ] }),
168
- /* @__PURE__ */ jsx(
169
- Button,
170
- {
171
- variant: "ghost",
172
- size: "icon",
173
- className: "h-8 w-8",
174
- onClick: () => onAddCard(column.id),
175
- children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
176
- }
177
- )
178
- ] }),
179
- /* @__PURE__ */ jsx(
180
- SortableContext,
181
- {
182
- items: column.cards.map((card) => card.id),
183
- strategy: verticalListSortingStrategy,
184
- children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-[200px]", children: column.cards.map((card) => /* @__PURE__ */ jsx(
185
- SortableCard,
186
- {
187
- card,
188
- onEdit: onEditCard,
189
- onDelete: onDeleteCard
190
- },
191
- card.id
192
- )) })
193
- }
194
- )
195
- ]
196
- }
197
- );
198
- }
199
- __name(KanbanColumnComponent, "KanbanColumnComponent");
200
- function CardFormDialog({
201
- open,
202
- onOpenChange,
203
- card,
204
- onSave,
205
- labels
206
- }) {
207
- const [formData, setFormData] = React.useState({
208
- title: card?.title || "",
209
- description: card?.description || "",
210
- priority: card?.priority || "low",
211
- assignee: card?.assignee || "",
212
- dueDate: card?.dueDate || "",
213
- labels: card?.labels?.map((l) => l.id) || []
214
- });
215
- const handleSubmit = /* @__PURE__ */ __name((e) => {
216
- e.preventDefault();
217
- if (!formData.title.trim()) return;
218
- onSave({
219
- ...card,
220
- ...formData,
221
- labels: labels.filter((l) => formData.labels.includes(l.id)),
222
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
223
- });
224
- onOpenChange(false);
225
- }, "handleSubmit");
226
- React.useEffect(() => {
227
- if (card) {
228
- setFormData({
229
- title: card.title,
230
- description: card.description || "",
231
- priority: card.priority || "low",
232
- assignee: card.assignee || "",
233
- dueDate: card.dueDate || "",
234
- labels: card.labels?.map((l) => l.id) || []
235
- });
236
- } else {
237
- setFormData({
238
- title: "",
239
- description: "",
240
- priority: "low",
241
- assignee: "",
242
- dueDate: "",
243
- labels: []
244
- });
245
- }
246
- }, [card]);
247
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md", children: [
248
- /* @__PURE__ */ jsxs(DialogHeader, { children: [
249
- /* @__PURE__ */ jsx(DialogTitle, { children: card ? "Edit Card" : "Create Card" }),
250
- /* @__PURE__ */ jsx(DialogDescription, { children: card ? "Update the card details below." : "Create a new card for your kanban board." })
251
- ] }),
252
- /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
253
- /* @__PURE__ */ jsxs("div", { children: [
254
- /* @__PURE__ */ jsx(Label, { htmlFor: "title", children: "Title *" }),
255
- /* @__PURE__ */ jsx(
256
- Input,
257
- {
258
- id: "title",
259
- value: formData.title,
260
- onChange: (e) => setFormData((prev) => ({ ...prev, title: e.target.value })),
261
- placeholder: "Enter card title...",
262
- required: true
263
- }
264
- )
265
- ] }),
266
- /* @__PURE__ */ jsxs("div", { children: [
267
- /* @__PURE__ */ jsx(Label, { htmlFor: "description", children: "Description" }),
268
- /* @__PURE__ */ jsx(
269
- Textarea,
270
- {
271
- id: "description",
272
- value: formData.description,
273
- onChange: (e) => setFormData((prev) => ({
274
- ...prev,
275
- description: e.target.value
276
- })),
277
- placeholder: "Enter card description...",
278
- rows: 3
279
- }
280
- )
281
- ] }),
282
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
283
- /* @__PURE__ */ jsxs("div", { children: [
284
- /* @__PURE__ */ jsx(Label, { htmlFor: "priority", children: "Priority" }),
285
- /* @__PURE__ */ jsxs(
286
- Select,
287
- {
288
- value: formData.priority,
289
- onValueChange: (value) => setFormData((prev) => ({ ...prev, priority: value })),
290
- children: [
291
- /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
292
- /* @__PURE__ */ jsxs(SelectContent, { children: [
293
- /* @__PURE__ */ jsx(SelectItem, { value: "low", children: "Low" }),
294
- /* @__PURE__ */ jsx(SelectItem, { value: "medium", children: "Medium" }),
295
- /* @__PURE__ */ jsx(SelectItem, { value: "high", children: "High" }),
296
- /* @__PURE__ */ jsx(SelectItem, { value: "urgent", children: "Urgent" })
297
- ] })
298
- ]
299
- }
300
- )
301
- ] }),
302
- /* @__PURE__ */ jsxs("div", { children: [
303
- /* @__PURE__ */ jsx(Label, { htmlFor: "assignee", children: "Assignee" }),
304
- /* @__PURE__ */ jsx(
305
- Input,
306
- {
307
- id: "assignee",
308
- value: formData.assignee,
309
- onChange: (e) => setFormData((prev) => ({ ...prev, assignee: e.target.value })),
310
- placeholder: "Assign to..."
311
- }
312
- )
313
- ] })
314
- ] }),
315
- /* @__PURE__ */ jsxs("div", { children: [
316
- /* @__PURE__ */ jsx(Label, { htmlFor: "dueDate", children: "Due Date" }),
317
- /* @__PURE__ */ jsx(
318
- Input,
319
- {
320
- id: "dueDate",
321
- type: "date",
322
- value: formData.dueDate,
323
- onChange: (e) => setFormData((prev) => ({ ...prev, dueDate: e.target.value }))
324
- }
325
- )
326
- ] }),
327
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
328
- /* @__PURE__ */ jsx(
329
- Button,
330
- {
331
- type: "button",
332
- variant: "outline",
333
- onClick: () => onOpenChange(false),
334
- children: "Cancel"
335
- }
336
- ),
337
- /* @__PURE__ */ jsxs(Button, { type: "submit", children: [
338
- card ? "Update" : "Create",
339
- " Card"
340
- ] })
341
- ] })
342
- ] })
343
- ] }) });
344
- }
345
- __name(CardFormDialog, "CardFormDialog");
346
- function KanbanBoard({
347
- board,
348
- onUpdateBoard,
349
- className
350
- }) {
351
- const [activeCard, setActiveCard] = React.useState(null);
352
- const [searchQuery, setSearchQuery] = React.useState("");
353
- const [cardFormOpen, setCardFormOpen] = React.useState(false);
354
- const [editingCard, setEditingCard] = React.useState(
355
- void 0
356
- );
357
- const [activeColumnId, setActiveColumnId] = React.useState("");
358
- const sensors = useSensors(
359
- useSensor(PointerSensor, {
360
- activationConstraint: {
361
- distance: 8
362
- }
363
- })
364
- );
365
- const filteredBoard = React.useMemo(() => {
366
- if (!searchQuery.trim()) return board;
367
- const filtered = {
368
- ...board,
369
- columns: board.columns.map((column) => ({
370
- ...column,
371
- cards: column.cards.filter(
372
- (card) => card.title.toLowerCase().includes(searchQuery.toLowerCase()) || card.description?.toLowerCase().includes(searchQuery.toLowerCase()) || card.labels?.some(
373
- (label) => label.name.toLowerCase().includes(searchQuery.toLowerCase())
374
- )
375
- )
376
- }))
377
- };
378
- return filtered;
379
- }, [board, searchQuery]);
380
- const handleDragStart = /* @__PURE__ */ __name((event) => {
381
- const { active } = event;
382
- const card = board.columns.flatMap((col) => col.cards).find((card2) => card2.id === active.id);
383
- setActiveCard(card || null);
384
- }, "handleDragStart");
385
- const handleDragOver = /* @__PURE__ */ __name((event) => {
386
- const { active, over } = event;
387
- if (!over) return;
388
- const activeId = active.id;
389
- const overId = over.id;
390
- const activeContainer = findContainer(activeId);
391
- const overContainer = findContainer(overId);
392
- if (!activeContainer || !overContainer || activeContainer === overContainer) {
393
- return;
394
- }
395
- const updatedBoard = { ...board };
396
- const activeColumnIndex = updatedBoard.columns.findIndex(
397
- (col) => col.id === activeContainer
398
- );
399
- const overColumnIndex = updatedBoard.columns.findIndex(
400
- (col) => col.id === overContainer
401
- );
402
- const activeColumn = updatedBoard.columns[activeColumnIndex];
403
- const overColumn = updatedBoard.columns[overColumnIndex];
404
- const activeCardIndex = activeColumn.cards.findIndex(
405
- (card) => card.id === activeId
406
- );
407
- const [movedCard] = activeColumn.cards.splice(activeCardIndex, 1);
408
- if (overColumn.limit && overColumn.cards.length >= overColumn.limit) {
409
- return;
410
- }
411
- overColumn.cards.push(movedCard);
412
- onUpdateBoard(updatedBoard);
413
- }, "handleDragOver");
414
- const handleDragEnd = /* @__PURE__ */ __name((event) => {
415
- const { active, over } = event;
416
- setActiveCard(null);
417
- if (!over) return;
418
- const activeId = active.id;
419
- const overId = over.id;
420
- const activeContainer = findContainer(activeId);
421
- const overContainer = findContainer(overId);
422
- if (!activeContainer || !overContainer) return;
423
- const activeColumnIndex = board.columns.findIndex(
424
- (col) => col.id === activeContainer
425
- );
426
- const activeColumn = board.columns[activeColumnIndex];
427
- if (activeContainer === overContainer) {
428
- const oldIndex = activeColumn.cards.findIndex(
429
- (card) => card.id === activeId
430
- );
431
- const newIndex = activeColumn.cards.findIndex(
432
- (card) => card.id === overId
433
- );
434
- if (oldIndex !== newIndex) {
435
- const updatedBoard = { ...board };
436
- updatedBoard.columns[activeColumnIndex].cards = arrayMove(
437
- activeColumn.cards,
438
- oldIndex,
439
- newIndex
440
- );
441
- onUpdateBoard(updatedBoard);
442
- }
443
- }
444
- }, "handleDragEnd");
445
- const findContainer = /* @__PURE__ */ __name((id) => {
446
- if (board.columns.some((col) => col.id === id)) {
447
- return id;
448
- }
449
- return board.columns.find((col) => col.cards.some((card) => card.id === id))?.id;
450
- }, "findContainer");
451
- const handleAddCard = /* @__PURE__ */ __name((columnId) => {
452
- setActiveColumnId(columnId);
453
- setEditingCard(void 0);
454
- setCardFormOpen(true);
455
- }, "handleAddCard");
456
- const handleEditCard = /* @__PURE__ */ __name((card) => {
457
- setEditingCard(card);
458
- setActiveColumnId("");
459
- setCardFormOpen(true);
460
- }, "handleEditCard");
461
- const handleSaveCard = /* @__PURE__ */ __name((cardData) => {
462
- const updatedBoard = { ...board };
463
- if (editingCard) {
464
- const columnIndex = updatedBoard.columns.findIndex(
465
- (col) => col.cards.some((card) => card.id === editingCard.id)
466
- );
467
- if (columnIndex !== -1) {
468
- const cardIndex = updatedBoard.columns[columnIndex].cards.findIndex(
469
- (card) => card.id === editingCard.id
470
- );
471
- if (cardIndex !== -1) {
472
- updatedBoard.columns[columnIndex].cards[cardIndex] = {
473
- ...editingCard,
474
- ...cardData
475
- };
476
- }
477
- }
478
- } else {
479
- const columnIndex = updatedBoard.columns.findIndex(
480
- (col) => col.id === activeColumnId
481
- );
482
- if (columnIndex !== -1) {
483
- const newCard = {
484
- id: `card-${Date.now()}`,
485
- title: cardData.title,
486
- description: cardData.description,
487
- labels: cardData.labels,
488
- priority: cardData.priority,
489
- assignee: cardData.assignee,
490
- dueDate: cardData.dueDate,
491
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
492
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
493
- };
494
- updatedBoard.columns[columnIndex].cards.push(newCard);
495
- }
496
- }
497
- onUpdateBoard(updatedBoard);
498
- }, "handleSaveCard");
499
- const handleDeleteCard = /* @__PURE__ */ __name((cardId) => {
500
- const updatedBoard = { ...board };
501
- const columnIndex = updatedBoard.columns.findIndex(
502
- (col) => col.cards.some((card) => card.id === cardId)
503
- );
504
- if (columnIndex !== -1) {
505
- updatedBoard.columns[columnIndex].cards = updatedBoard.columns[columnIndex].cards.filter((card) => card.id !== cardId);
506
- onUpdateBoard(updatedBoard);
507
- }
508
- }, "handleDeleteCard");
509
- return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col h-full", className), children: [
510
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
511
- /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: board.title }),
512
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
513
- /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
514
- /* @__PURE__ */ jsx(
515
- Input,
516
- {
517
- placeholder: "Search cards...",
518
- value: searchQuery,
519
- onChange: (e) => setSearchQuery(e.target.value),
520
- className: "pl-9 w-64"
521
- }
522
- )
523
- ] }) })
524
- ] }),
525
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-x-auto", children: /* @__PURE__ */ jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ jsxs(
526
- DndContext,
527
- {
528
- sensors,
529
- collisionDetection: closestCorners,
530
- onDragStart: handleDragStart,
531
- onDragOver: handleDragOver,
532
- onDragEnd: handleDragEnd,
533
- children: [
534
- /* @__PURE__ */ jsx("div", { className: "flex gap-6 h-full pb-4", children: filteredBoard.columns.map((column) => /* @__PURE__ */ jsx(
535
- KanbanColumnComponent,
536
- {
537
- column,
538
- onAddCard: handleAddCard,
539
- onEditCard: handleEditCard,
540
- onDeleteCard: handleDeleteCard
541
- },
542
- column.id
543
- )) }),
544
- /* @__PURE__ */ jsx(DragOverlay, { children: activeCard ? /* @__PURE__ */ jsx(
545
- KanbanCardComponent,
546
- {
547
- card: activeCard,
548
- onEdit: () => {
549
- },
550
- onDelete: () => {
551
- }
552
- }
553
- ) : null })
554
- ]
555
- }
556
- ) }) }),
557
- /* @__PURE__ */ jsx(
558
- CardFormDialog,
559
- {
560
- open: cardFormOpen,
561
- onOpenChange: setCardFormOpen,
562
- card: editingCard,
563
- onSave: handleSaveCard,
564
- labels: board.labels
565
- }
566
- )
567
- ] });
568
- }
569
- __name(KanbanBoard, "KanbanBoard");
570
- var kanban_default = KanbanBoard;
571
-
572
- export { kanban_default as KanbanBoard };
2
+ import*as f from'react';import {useSensors,useSensor,PointerSensor,DndContext,closestCorners,DragOverlay}from'@dnd-kit/core';import {arrayMove,useSortable,SortableContext,verticalListSortingStrategy}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import {cva}from'class-variance-authority';import {Search,User,Calendar,MoreHorizontal,Edit3,X,Plus}from'lucide-react';import {cn}from'@hanzo/ui/lib/utils';import {Badge}from'@hanzo/ui/primitives/badge';import {Button}from'@hanzo/ui/primitives/button';import {Card,CardHeader}from'@hanzo/ui/primitives/card';import {Dialog,DialogContent,DialogHeader,DialogTitle,DialogDescription,DialogFooter}from'@hanzo/ui/primitives/dialog';import {DropdownMenu,DropdownMenuTrigger,DropdownMenuContent,DropdownMenuItem}from'@hanzo/ui/primitives/dropdown-menu';import {Input}from'@hanzo/ui/primitives/input';import {Label}from'@hanzo/ui/primitives/label';import {Select,SelectTrigger,SelectValue,SelectContent,SelectItem}from'@hanzo/ui/primitives/select';import {Textarea}from'@hanzo/ui/primitives/textarea';import {jsxs,jsx}from'react/jsx-runtime';var Y=Object.defineProperty;var u=(t,m)=>Y(t,"name",{value:m,configurable:true});var Me=cva("inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-semibold",{variants:{priority:{low:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-400",medium:"border-yellow-200 bg-yellow-50 text-yellow-700 dark:border-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-400",high:"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-400",urgent:"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-900/20 dark:text-red-400"}},defaultVariants:{priority:"low"}});function Ae({card:t,onEdit:m,onDelete:i}){let{attributes:g,listeners:C,setNodeRef:d,transform:p,transition:y,isDragging:l}=useSortable({id:t.id}),c={transform:CSS.Transform.toString(p),transition:y};return jsx("div",{ref:d,style:c,...g,...C,className:cn("cursor-grab active:cursor-grabbing",l&&"opacity-50"),children:jsx(P,{card:t,onEdit:m,onDelete:i})})}u(Ae,"SortableCard");function P({card:t,onEdit:m,onDelete:i}){return jsx(Card,{className:"mb-3 group hover:shadow-md transition-shadow",children:jsx(CardHeader,{className:"pb-3",children:jsx("div",{className:"flex items-start justify-between",children:jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h4",{className:"font-medium text-sm leading-tight mb-2 break-words",children:t.title}),t.description&&jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:t.description}),t.labels&&t.labels.length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:t.labels.map(g=>jsx(Badge,{variant:"outline",className:"text-xs h-5",style:{backgroundColor:`${g.color}20`,borderColor:g.color,color:g.color},children:g.name},g.id))}),jsxs("div",{className:"flex items-center justify-between text-xs",children:[jsxs("div",{className:"flex items-center gap-2",children:[t.priority&&jsx("span",{className:cn(Me({priority:t.priority})),children:t.priority}),t.assignee&&jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[jsx(User,{className:"h-3 w-3"}),jsx("span",{children:t.assignee})]})]}),jsxs("div",{className:"flex items-center gap-1",children:[t.dueDate&&jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[jsx(Calendar,{className:"h-3 w-3"}),jsx("span",{children:new Date(t.dueDate).toLocaleDateString()})]}),jsxs(DropdownMenu,{children:[jsx(DropdownMenuTrigger,{asChild:true,children:jsx(Button,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",children:jsx(MoreHorizontal,{className:"h-3 w-3"})})}),jsxs(DropdownMenuContent,{align:"end",children:[jsxs(DropdownMenuItem,{onClick:()=>m(t),children:[jsx(Edit3,{className:"h-4 w-4 mr-2"}),"Edit"]}),jsxs(DropdownMenuItem,{onClick:()=>i(t.id),className:"text-destructive",children:[jsx(X,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})]})]})})})})}u(P,"KanbanCardComponent");function Fe({column:t,onAddCard:m,onEditCard:i,onDeleteCard:g}){let{setNodeRef:C}=useSortable({id:t.id});return jsxs("div",{ref:C,className:"bg-muted/50 rounded-lg p-4 min-w-[280px] max-w-[280px] flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("h3",{className:"font-semibold text-sm",children:t.title}),jsxs(Badge,{variant:"secondary",className:"text-xs",children:[t.cards.length,t.limit&&`/${t.limit}`]})]}),jsx(Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(t.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(SortableContext,{items:t.cards.map(d=>d.id),strategy:verticalListSortingStrategy,children:jsx("div",{className:"flex-1 min-h-[200px]",children:t.cards.map(d=>jsx(Ae,{card:d,onEdit:i,onDelete:g},d.id))})})]})}u(Fe,"KanbanColumnComponent");function Oe({open:t,onOpenChange:m,card:i,onSave:g,labels:C}){let[d,p]=f.useState({title:i?.title||"",description:i?.description||"",priority:i?.priority||"low",assignee:i?.assignee||"",dueDate:i?.dueDate||"",labels:i?.labels?.map(l=>l.id)||[]}),y=u(l=>{l.preventDefault(),d.title.trim()&&(g({...i,...d,labels:C.filter(c=>d.labels.includes(c.id)),updatedAt:new Date().toISOString()}),m(false));},"handleSubmit");return f.useEffect(()=>{p(i?{title:i.title,description:i.description||"",priority:i.priority||"low",assignee:i.assignee||"",dueDate:i.dueDate||"",labels:i.labels?.map(l=>l.id)||[]}:{title:"",description:"",priority:"low",assignee:"",dueDate:"",labels:[]});},[i]),jsx(Dialog,{open:t,onOpenChange:m,children:jsxs(DialogContent,{className:"max-w-md",children:[jsxs(DialogHeader,{children:[jsx(DialogTitle,{children:i?"Edit Card":"Create Card"}),jsx(DialogDescription,{children:i?"Update the card details below.":"Create a new card for your kanban board."})]}),jsxs("form",{onSubmit:y,className:"space-y-4",children:[jsxs("div",{children:[jsx(Label,{htmlFor:"title",children:"Title *"}),jsx(Input,{id:"title",value:d.title,onChange:l=>p(c=>({...c,title:l.target.value})),placeholder:"Enter card title...",required:true})]}),jsxs("div",{children:[jsx(Label,{htmlFor:"description",children:"Description"}),jsx(Textarea,{id:"description",value:d.description,onChange:l=>p(c=>({...c,description:l.target.value})),placeholder:"Enter card description...",rows:3})]}),jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx(Label,{htmlFor:"priority",children:"Priority"}),jsxs(Select,{value:d.priority,onValueChange:l=>p(c=>({...c,priority:l})),children:[jsx(SelectTrigger,{children:jsx(SelectValue,{})}),jsxs(SelectContent,{children:[jsx(SelectItem,{value:"low",children:"Low"}),jsx(SelectItem,{value:"medium",children:"Medium"}),jsx(SelectItem,{value:"high",children:"High"}),jsx(SelectItem,{value:"urgent",children:"Urgent"})]})]})]}),jsxs("div",{children:[jsx(Label,{htmlFor:"assignee",children:"Assignee"}),jsx(Input,{id:"assignee",value:d.assignee,onChange:l=>p(c=>({...c,assignee:l.target.value})),placeholder:"Assign to..."})]})]}),jsxs("div",{children:[jsx(Label,{htmlFor:"dueDate",children:"Due Date"}),jsx(Input,{id:"dueDate",type:"date",value:d.dueDate,onChange:l=>p(c=>({...c,dueDate:l.target.value}))})]}),jsxs(DialogFooter,{children:[jsx(Button,{type:"button",variant:"outline",onClick:()=>m(false),children:"Cancel"}),jsxs(Button,{type:"submit",children:[i?"Update":"Create"," Card"]})]})]})]})})}u(Oe,"CardFormDialog");function Re({board:t,onUpdateBoard:m,className:i}){let[g,C]=f.useState(null),[d,p]=f.useState(""),[y,l]=f.useState(false),[c,A]=f.useState(void 0),[H,F]=f.useState(""),V=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),U=f.useMemo(()=>d.trim()?{...t,columns:t.columns.map(r=>({...r,cards:r.cards.filter(o=>o.title.toLowerCase().includes(d.toLowerCase())||o.description?.toLowerCase().includes(d.toLowerCase())||o.labels?.some(s=>s.name.toLowerCase().includes(d.toLowerCase())))}))}:t,[t,d]),j=u(n=>{let{active:r}=n,o=t.columns.flatMap(s=>s.cards).find(s=>s.id===r.id);C(o||null);},"handleDragStart"),q=u(n=>{let{active:r,over:o}=n;if(!o)return;let s=r.id,b=o.id,D=E(s),h=E(b);if(!D||!h||D===h)return;let x={...t},S=x.columns.findIndex(I=>I.id===D),w=x.columns.findIndex(I=>I.id===h),N=x.columns[S],v=x.columns[w],J=N.cards.findIndex(I=>I.id===s),[W]=N.cards.splice(J,1);v.limit&&v.cards.length>=v.limit||(v.cards.push(W),m(x));},"handleDragOver"),z=u(n=>{let{active:r,over:o}=n;if(C(null),!o)return;let s=r.id,b=o.id,D=E(s),h=E(b);if(!D||!h)return;let x=t.columns.findIndex(w=>w.id===D),S=t.columns[x];if(D===h){let w=S.cards.findIndex(v=>v.id===s),N=S.cards.findIndex(v=>v.id===b);if(w!==N){let v={...t};v.columns[x].cards=arrayMove(S.cards,w,N),m(v);}}},"handleDragEnd"),E=u(n=>t.columns.some(r=>r.id===n)?n:t.columns.find(r=>r.cards.some(o=>o.id===n))?.id,"findContainer"),$=u(n=>{F(n),A(void 0),l(true);},"handleAddCard"),Q=u(n=>{A(n),F(""),l(true);},"handleEditCard"),X=u(n=>{let r={...t};if(c){let o=r.columns.findIndex(s=>s.cards.some(b=>b.id===c.id));if(o!==-1){let s=r.columns[o].cards.findIndex(b=>b.id===c.id);s!==-1&&(r.columns[o].cards[s]={...c,...n});}}else {let o=r.columns.findIndex(s=>s.id===H);if(o!==-1){let s={id:`card-${Date.now()}`,title:n.title,description:n.description,labels:n.labels,priority:n.priority,assignee:n.assignee,dueDate:n.dueDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};r.columns[o].cards.push(s);}}m(r);},"handleSaveCard"),G=u(n=>{let r={...t},o=r.columns.findIndex(s=>s.cards.some(b=>b.id===n));o!==-1&&(r.columns[o].cards=r.columns[o].cards.filter(s=>s.id!==n),m(r));},"handleDeleteCard");return jsxs("div",{className:cn("flex flex-col h-full",i),children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h1",{className:"text-2xl font-bold",children:t.title}),jsx("div",{className:"flex items-center gap-3",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(Input,{placeholder:"Search cards...",value:d,onChange:n=>p(n.target.value),className:"pl-9 w-64"})]})})]}),jsx("div",{className:"flex-1 overflow-x-auto",children:jsx("div",{className:"h-full p-4",children:jsxs(DndContext,{sensors:V,collisionDetection:closestCorners,onDragStart:j,onDragOver:q,onDragEnd:z,children:[jsx("div",{className:"flex gap-6 h-full pb-4",children:U.columns.map(n=>jsx(Fe,{column:n,onAddCard:$,onEditCard:Q,onDeleteCard:G},n.id))}),jsx(DragOverlay,{children:g?jsx(P,{card:g,onEdit:()=>{},onDelete:()=>{}}):null})]})})}),jsx(Oe,{open:y,onOpenChange:l,card:c,onSave:X,labels:t.labels})]})}u(Re,"KanbanBoard");var Te=Re;export{Te as KanbanBoard};
package/dist/lib/utils.js CHANGED
@@ -1,28 +1 @@
1
- 'use strict';
2
-
3
- var clsx = require('clsx');
4
- var tailwindMerge = require('tailwind-merge');
5
-
6
- var __defProp = Object.defineProperty;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- function cn(...inputs) {
9
- return tailwindMerge.twMerge(clsx.clsx(inputs));
10
- }
11
- __name(cn, "cn");
12
- function formatDate(input) {
13
- const date = new Date(input);
14
- return date.toLocaleDateString("en-US", {
15
- month: "long",
16
- day: "numeric",
17
- year: "numeric"
18
- });
19
- }
20
- __name(formatDate, "formatDate");
21
- function absoluteUrl(path) {
22
- return `${process.env.NEXT_PUBLIC_APP_URL || ""}${path}`;
23
- }
24
- __name(absoluteUrl, "absoluteUrl");
25
-
26
- exports.absoluteUrl = absoluteUrl;
27
- exports.cn = cn;
28
- exports.formatDate = formatDate;
1
+ 'use strict';var clsx=require('clsx'),tailwindMerge=require('tailwind-merge');var n=Object.defineProperty;var e=(t,r)=>n(t,"name",{value:r,configurable:true});function c(...t){return tailwindMerge.twMerge(clsx.clsx(t))}e(c,"cn");function l(t){return new Date(t).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}e(l,"formatDate");function m(t){return `${process.env.NEXT_PUBLIC_APP_URL||""}${t}`}e(m,"absoluteUrl");exports.absoluteUrl=m;exports.cn=c;exports.formatDate=l;
@@ -1,24 +1 @@
1
- import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- function cn(...inputs) {
7
- return twMerge(clsx(inputs));
8
- }
9
- __name(cn, "cn");
10
- function formatDate(input) {
11
- const date = new Date(input);
12
- return date.toLocaleDateString("en-US", {
13
- month: "long",
14
- day: "numeric",
15
- year: "numeric"
16
- });
17
- }
18
- __name(formatDate, "formatDate");
19
- function absoluteUrl(path) {
20
- return `${process.env.NEXT_PUBLIC_APP_URL || ""}${path}`;
21
- }
22
- __name(absoluteUrl, "absoluteUrl");
23
-
24
- export { absoluteUrl, cn, formatDate };
1
+ import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var n=Object.defineProperty;var e=(t,r)=>n(t,"name",{value:r,configurable:true});function c(...t){return twMerge(clsx(t))}e(c,"cn");function l(t){return new Date(t).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}e(l,"formatDate");function m(t){return `${process.env.NEXT_PUBLIC_APP_URL||""}${t}`}e(m,"absoluteUrl");export{m as absoluteUrl,c as cn,l as formatDate};