@moontra/moonui-pro 2.20.2 → 2.20.3

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 (153) hide show
  1. package/package.json +8 -3
  2. package/plugin/index.d.ts +86 -0
  3. package/plugin/index.js +308 -0
  4. package/scripts/postinstall.js +176 -23
  5. package/src/components/advanced-chart/index.tsx +0 -1246
  6. package/src/components/advanced-forms/index.tsx +0 -585
  7. package/src/components/animated-button/index.tsx +0 -385
  8. package/src/components/calendar/event-dialog.tsx +0 -377
  9. package/src/components/calendar/index.tsx +0 -1220
  10. package/src/components/calendar-pro/index.tsx +0 -1697
  11. package/src/components/color-picker/index.tsx +0 -432
  12. package/src/components/credit-card-input/index.tsx +0 -406
  13. package/src/components/dashboard/dashboard-grid.tsx +0 -480
  14. package/src/components/dashboard/demo.tsx +0 -425
  15. package/src/components/dashboard/index.tsx +0 -1046
  16. package/src/components/dashboard/time-range-picker.tsx +0 -336
  17. package/src/components/dashboard/types.ts +0 -225
  18. package/src/components/dashboard/widgets/activity-feed.tsx +0 -349
  19. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  20. package/src/components/dashboard/widgets/comparison-widget.tsx +0 -177
  21. package/src/components/dashboard/widgets/index.ts +0 -5
  22. package/src/components/dashboard/widgets/metric-card.tsx +0 -363
  23. package/src/components/dashboard/widgets/progress-widget.tsx +0 -113
  24. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  25. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  26. package/src/components/data-table/data-table-export.ts +0 -156
  27. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  28. package/src/components/data-table/index.tsx +0 -845
  29. package/src/components/draggable-list/index.tsx +0 -100
  30. package/src/components/error-boundary/index.tsx +0 -232
  31. package/src/components/file-upload/index.tsx +0 -1660
  32. package/src/components/floating-action-button/index.tsx +0 -206
  33. package/src/components/form-wizard/form-wizard-context.tsx +0 -335
  34. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  35. package/src/components/form-wizard/form-wizard-progress.tsx +0 -329
  36. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  37. package/src/components/form-wizard/index.tsx +0 -102
  38. package/src/components/form-wizard/types.ts +0 -77
  39. package/src/components/gesture-drawer/index.tsx +0 -551
  40. package/src/components/github-stars/github-api.ts +0 -426
  41. package/src/components/github-stars/hooks.ts +0 -517
  42. package/src/components/github-stars/index.tsx +0 -375
  43. package/src/components/github-stars/types.ts +0 -148
  44. package/src/components/github-stars/variants.tsx +0 -515
  45. package/src/components/health-check/index.tsx +0 -439
  46. package/src/components/hover-card-3d/index.tsx +0 -529
  47. package/src/components/index.ts +0 -130
  48. package/src/components/internal/index.ts +0 -78
  49. package/src/components/kanban/add-card-modal.tsx +0 -502
  50. package/src/components/kanban/card-detail-modal.tsx +0 -761
  51. package/src/components/kanban/index.ts +0 -13
  52. package/src/components/kanban/kanban.tsx +0 -1689
  53. package/src/components/kanban/types.ts +0 -168
  54. package/src/components/lazy-component/index.tsx +0 -823
  55. package/src/components/license-error/index.tsx +0 -31
  56. package/src/components/magnetic-button/index.tsx +0 -216
  57. package/src/components/memory-efficient-data/index.tsx +0 -1018
  58. package/src/components/moonui-quiz-form/index.tsx +0 -817
  59. package/src/components/navbar/index.tsx +0 -781
  60. package/src/components/optimized-image/index.tsx +0 -425
  61. package/src/components/performance-debugger/index.tsx +0 -613
  62. package/src/components/performance-monitor/index.tsx +0 -808
  63. package/src/components/phone-number-input/index.tsx +0 -343
  64. package/src/components/phone-number-input/phone-number-input-simple.tsx +0 -167
  65. package/src/components/pinch-zoom/index.tsx +0 -566
  66. package/src/components/quiz-form/index.tsx +0 -479
  67. package/src/components/rich-text-editor/index.tsx +0 -2322
  68. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -230
  69. package/src/components/rich-text-editor/slash-commands.css +0 -35
  70. package/src/components/rich-text-editor/table-styles.css +0 -65
  71. package/src/components/sidebar/index.tsx +0 -884
  72. package/src/components/spotlight-card/index.tsx +0 -191
  73. package/src/components/swipeable-card/index.tsx +0 -100
  74. package/src/components/timeline/index.tsx +0 -1183
  75. package/src/components/ui/accordion.tsx +0 -581
  76. package/src/components/ui/alert-dialog.tsx +0 -141
  77. package/src/components/ui/alert.tsx +0 -141
  78. package/src/components/ui/aspect-ratio.tsx +0 -245
  79. package/src/components/ui/avatar.tsx +0 -155
  80. package/src/components/ui/badge.tsx +0 -230
  81. package/src/components/ui/breadcrumb.tsx +0 -216
  82. package/src/components/ui/button.tsx +0 -228
  83. package/src/components/ui/calendar.tsx +0 -387
  84. package/src/components/ui/card.tsx +0 -216
  85. package/src/components/ui/checkbox.tsx +0 -259
  86. package/src/components/ui/collapsible.tsx +0 -631
  87. package/src/components/ui/color-picker.tsx +0 -97
  88. package/src/components/ui/command.tsx +0 -948
  89. package/src/components/ui/dialog.tsx +0 -752
  90. package/src/components/ui/dropdown-menu.tsx +0 -706
  91. package/src/components/ui/gesture-drawer.tsx +0 -11
  92. package/src/components/ui/hover-card.tsx +0 -29
  93. package/src/components/ui/index.ts +0 -222
  94. package/src/components/ui/input.tsx +0 -224
  95. package/src/components/ui/label.tsx +0 -29
  96. package/src/components/ui/lightbox.tsx +0 -606
  97. package/src/components/ui/magnetic-button.tsx +0 -129
  98. package/src/components/ui/media-gallery.tsx +0 -611
  99. package/src/components/ui/navigation-menu.tsx +0 -130
  100. package/src/components/ui/pagination.tsx +0 -125
  101. package/src/components/ui/popover.tsx +0 -185
  102. package/src/components/ui/progress.tsx +0 -30
  103. package/src/components/ui/radio-group.tsx +0 -257
  104. package/src/components/ui/scroll-area.tsx +0 -47
  105. package/src/components/ui/select.tsx +0 -378
  106. package/src/components/ui/separator.tsx +0 -145
  107. package/src/components/ui/sheet.tsx +0 -139
  108. package/src/components/ui/skeleton.tsx +0 -20
  109. package/src/components/ui/slider.tsx +0 -354
  110. package/src/components/ui/spotlight-card.tsx +0 -119
  111. package/src/components/ui/switch.tsx +0 -86
  112. package/src/components/ui/table.tsx +0 -331
  113. package/src/components/ui/tabs-pro.tsx +0 -542
  114. package/src/components/ui/tabs.tsx +0 -54
  115. package/src/components/ui/textarea.tsx +0 -28
  116. package/src/components/ui/toast.tsx +0 -317
  117. package/src/components/ui/toggle.tsx +0 -119
  118. package/src/components/ui/tooltip.tsx +0 -151
  119. package/src/components/virtual-list/index.tsx +0 -668
  120. package/src/hooks/use-chart.ts +0 -205
  121. package/src/hooks/use-data-table.ts +0 -182
  122. package/src/hooks/use-docs-pro-access.ts +0 -13
  123. package/src/hooks/use-license-check.ts +0 -65
  124. package/src/hooks/use-subscription.ts +0 -19
  125. package/src/hooks/use-toast.ts +0 -15
  126. package/src/index.ts +0 -22
  127. package/src/lib/ai-providers.ts +0 -377
  128. package/src/lib/component-metadata.ts +0 -18
  129. package/src/lib/micro-interactions.ts +0 -255
  130. package/src/lib/paddle.ts +0 -17
  131. package/src/lib/utils.ts +0 -6
  132. package/src/patterns/login-form/index.tsx +0 -276
  133. package/src/patterns/login-form/types.ts +0 -67
  134. package/src/setupTests.ts +0 -41
  135. package/src/styles/advanced-chart.css +0 -239
  136. package/src/styles/calendar.css +0 -35
  137. package/src/styles/design-system.css +0 -363
  138. package/src/styles/index.css +0 -681
  139. package/src/styles/tailwind.css +0 -7
  140. package/src/styles/tokens.css +0 -455
  141. package/src/types/next-auth.d.ts +0 -21
  142. package/src/use-intersection-observer.tsx +0 -154
  143. package/src/use-local-storage.tsx +0 -71
  144. package/src/use-paddle.ts +0 -138
  145. package/src/use-performance-optimizer.ts +0 -389
  146. package/src/use-pro-access.ts +0 -141
  147. package/src/use-scroll-animation.ts +0 -219
  148. package/src/use-subscription.ts +0 -37
  149. package/src/use-toast.ts +0 -32
  150. package/src/utils/chart-helpers.ts +0 -357
  151. package/src/utils/cn.ts +0 -6
  152. package/src/utils/data-processing.ts +0 -151
  153. package/src/utils/license-validator.tsx +0 -183
@@ -1,78 +0,0 @@
1
- // Internal Components - Used by Pro components internally
2
- // These are not exported to the public API
3
-
4
- // Simple re-exports of basic components for internal use
5
- export {
6
- MoonUIAccordionPro as Accordion,
7
- MoonUIAccordionItemPro as AccordionItem,
8
- MoonUIAccordionTriggerPro as AccordionTrigger,
9
- MoonUIAccordionContentPro as AccordionContent,
10
- } from "../ui/accordion"
11
-
12
- export {
13
- MoonUIAlertPro as Alert,
14
- MoonUIAlertDescriptionPro as AlertDescription,
15
- MoonUIAlertTitlePro as AlertTitle,
16
- } from "../ui/alert"
17
-
18
- export {
19
- MoonUIAspectRatioPro as AspectRatio,
20
- } from "../ui/aspect-ratio"
21
-
22
- export {
23
- MoonUIBreadcrumbPro as Breadcrumb,
24
- MoonUIBreadcrumbListPro as BreadcrumbList,
25
- MoonUIBreadcrumbItemPro as BreadcrumbItem,
26
- MoonUIBreadcrumbLinkPro as BreadcrumbLink,
27
- MoonUIBreadcrumbPagePro as BreadcrumbPage,
28
- MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator,
29
- MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis,
30
- } from "../ui/breadcrumb"
31
-
32
- export {
33
- MoonUICollapsiblePro as Collapsible,
34
- MoonUICollapsibleTriggerPro as CollapsibleTrigger,
35
- MoonUICollapsibleContentPro as CollapsibleContent,
36
- } from "../ui/collapsible"
37
-
38
- export {
39
- MoonUICommandPro as Command,
40
- MoonUICommandDialogPro as CommandDialog,
41
- MoonUICommandInputPro as CommandInput,
42
- MoonUICommandListPro as CommandList,
43
- MoonUICommandEmptyPro as CommandEmpty,
44
- MoonUICommandGroupPro as CommandGroup,
45
- MoonUICommandItemPro as CommandItem,
46
- MoonUICommandShortcutPro as CommandShortcut,
47
- MoonUICommandSeparatorPro as CommandSeparator,
48
- } from "../ui/command"
49
-
50
- export {
51
- MoonUITablePro as Table,
52
- MoonUITableHeaderPro as TableHeader,
53
- MoonUITableBodyPro as TableBody,
54
- MoonUITableFooterPro as TableFooter,
55
- MoonUITableHeadPro as TableHead,
56
- MoonUITableRowPro as TableRow,
57
- MoonUITableCellPro as TableCell,
58
- MoonUITableCaptionPro as TableCaption,
59
- } from "../ui/table"
60
-
61
- export {
62
- MoonUITogglePro as Toggle,
63
- } from "../ui/toggle"
64
-
65
- export {
66
- MoonUIPaginationPro as Pagination,
67
- MoonUIPaginationContentPro as PaginationContent,
68
- MoonUIPaginationEllipsisPro as PaginationEllipsis,
69
- MoonUIPaginationItemPro as PaginationItem,
70
- MoonUIPaginationLinkPro as PaginationLink,
71
- MoonUIPaginationNextPro as PaginationNext,
72
- MoonUIPaginationPreviousPro as PaginationPrevious,
73
- } from "../ui/pagination"
74
-
75
- export {
76
- MoonUIRadioGroupPro as RadioGroup,
77
- MoonUIRadioGroupItemPro as RadioGroupItem,
78
- } from "../ui/radio-group"
@@ -1,502 +0,0 @@
1
- "use client"
2
-
3
- import React, { useState } from 'react'
4
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '../ui/dialog'
5
- import { Button } from '../ui/button'
6
- import { Input } from '../ui/input'
7
- import { Textarea } from '../ui/textarea'
8
- import { Label } from '../ui/label'
9
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
10
- import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
11
- import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '../ui/command'
12
- import { Calendar as CalendarComponent } from '../ui/calendar'
13
- import { MoonUIAvatarPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, AvatarGroup as MoonUIAvatarGroupPro } from '../ui/avatar'
14
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs'
15
- import { Badge } from '../ui/badge'
16
- import {
17
- Calendar,
18
- User,
19
- Tag,
20
- Flag,
21
- Check,
22
- ChevronDown,
23
- FileText,
24
- Star,
25
- Zap,
26
- Clock,
27
- CheckSquare
28
- } from 'lucide-react'
29
- import { format } from 'date-fns'
30
- import { cn } from '../../lib/utils'
31
- import type { KanbanCard, KanbanAssignee, KanbanLabel } from './types'
32
-
33
- interface AddCardModalProps {
34
- isOpen: boolean
35
- onClose: () => void
36
- onAdd: (card: Partial<KanbanCard>) => void
37
- columnId: string
38
- columnTitle: string
39
- availableAssignees?: KanbanAssignee[]
40
- availableLabels?: KanbanLabel[]
41
- templates?: Partial<KanbanCard>[]
42
- }
43
-
44
- const PRIORITY_OPTIONS = [
45
- { value: 'low', label: 'Low Priority', icon: Flag, color: 'text-green-600' },
46
- { value: 'medium', label: 'Medium Priority', icon: Flag, color: 'text-yellow-600' },
47
- { value: 'high', label: 'High Priority', icon: Flag, color: 'text-orange-600' },
48
- { value: 'urgent', label: 'Urgent', icon: Zap, color: 'text-red-600' }
49
- ]
50
-
51
- const CARD_TEMPLATES = [
52
- {
53
- name: 'Bug Report',
54
- icon: Flag,
55
- template: {
56
- title: 'Bug: ',
57
- description: '**Steps to Reproduce:**\n1. \n2. \n3. \n\n**Expected Behavior:**\n\n**Actual Behavior:**',
58
- priority: 'high' as const,
59
- tags: ['bug']
60
- }
61
- },
62
- {
63
- name: 'Feature Request',
64
- icon: Star,
65
- template: {
66
- title: 'Feature: ',
67
- description: '**User Story:**\nAs a [user type], I want [feature] so that [benefit].\n\n**Acceptance Criteria:**\n- [ ] ',
68
- priority: 'medium' as const,
69
- tags: ['feature']
70
- }
71
- },
72
- {
73
- name: 'Task',
74
- icon: CheckSquare,
75
- template: {
76
- title: 'Task: ',
77
- description: '**Objective:**\n\n**Tasks:**\n- [ ] ',
78
- priority: 'medium' as const,
79
- tags: ['task']
80
- }
81
- },
82
- {
83
- name: 'User Story',
84
- icon: User,
85
- template: {
86
- title: 'As a ',
87
- description: '**Story:**\nAs a [user type]\nI want [functionality]\nSo that [benefit]\n\n**Acceptance Criteria:**\n- [ ] ',
88
- priority: 'medium' as const,
89
- tags: ['story']
90
- }
91
- }
92
- ]
93
-
94
- const getInitials = (name: string) => {
95
- return name.split(' ').map(n => n[0]).join('').toUpperCase()
96
- }
97
-
98
- export function AddCardModal({
99
- isOpen,
100
- onClose,
101
- onAdd,
102
- columnId,
103
- columnTitle,
104
- availableAssignees = [],
105
- availableLabels = [],
106
- templates = []
107
- }: AddCardModalProps) {
108
- const [selectedTab, setSelectedTab] = useState('blank')
109
- const [title, setTitle] = useState('')
110
- const [description, setDescription] = useState('')
111
- const [priority, setPriority] = useState<'low' | 'medium' | 'high' | 'urgent'>('medium')
112
- const [assignees, setAssignees] = useState<KanbanAssignee[]>([])
113
- const [labels, setLabels] = useState<KanbanLabel[]>([])
114
- const [dueDate, setDueDate] = useState<Date | undefined>()
115
- const [tags, setTags] = useState<string[]>([])
116
- const [tagInput, setTagInput] = useState('')
117
-
118
- const handleTemplateSelect = (template: Partial<KanbanCard>) => {
119
- setTitle(template.title || '')
120
- setDescription(template.description || '')
121
- setPriority(template.priority || 'medium')
122
- setTags(template.tags || [])
123
- if (template.assignees) setAssignees(template.assignees)
124
- if (template.labels) setLabels(template.labels)
125
- if (template.dueDate) setDueDate(template.dueDate)
126
- }
127
-
128
- const handleSubmit = () => {
129
- if (!title.trim()) return
130
-
131
- const newCard: Partial<KanbanCard> = {
132
- title: title.trim(),
133
- description: description.trim() || undefined,
134
- priority,
135
- assignees: assignees.length > 0 ? assignees : undefined,
136
- labels: labels.length > 0 ? labels : undefined,
137
- dueDate,
138
- tags: tags.length > 0 ? tags : undefined,
139
- position: Date.now()
140
- }
141
-
142
- onAdd(newCard)
143
- resetForm()
144
- onClose()
145
- }
146
-
147
- const resetForm = () => {
148
- setTitle('')
149
- setDescription('')
150
- setPriority('medium')
151
- setAssignees([])
152
- setLabels([])
153
- setDueDate(undefined)
154
- setTags([])
155
- setTagInput('')
156
- setSelectedTab('blank')
157
- }
158
-
159
- const handleAddTag = () => {
160
- if (tagInput.trim() && !tags.includes(tagInput.trim())) {
161
- setTags([...tags, tagInput.trim()])
162
- setTagInput('')
163
- }
164
- }
165
-
166
- const allTemplates = [...CARD_TEMPLATES.map(t => ({ ...t.template, name: t.name, icon: t.icon })), ...templates]
167
-
168
- return (
169
- <Dialog open={isOpen} onOpenChange={onClose}>
170
- <DialogContent className="max-w-2xl">
171
- <DialogHeader>
172
- <DialogTitle>Add Card to {columnTitle}</DialogTitle>
173
- </DialogHeader>
174
-
175
- <Tabs value={selectedTab} onValueChange={setSelectedTab}>
176
- <TabsList className="grid w-full grid-cols-2">
177
- <TabsTrigger value="blank">Blank Card</TabsTrigger>
178
- <TabsTrigger value="template">From Template</TabsTrigger>
179
- </TabsList>
180
-
181
- <TabsContent value="blank" className="space-y-4">
182
- <div className="space-y-4">
183
- {/* Title */}
184
- <div>
185
- <Label htmlFor="title">Title *</Label>
186
- <Input
187
- id="title"
188
- placeholder="Enter card title..."
189
- value={title}
190
- onChange={(e) => setTitle(e.target.value)}
191
- autoFocus
192
- />
193
- </div>
194
-
195
- {/* Description */}
196
- <div>
197
- <Label htmlFor="description">Description</Label>
198
- <Textarea
199
- id="description"
200
- placeholder="Add a more detailed description..."
201
- value={description}
202
- onChange={(e) => setDescription(e.target.value)}
203
- className="min-h-[100px]"
204
- />
205
- </div>
206
-
207
- <div className="grid grid-cols-2 gap-4">
208
- {/* Priority */}
209
- <div>
210
- <Label>Priority</Label>
211
- <Select value={priority} onValueChange={(value: any) => setPriority(value)}>
212
- <SelectTrigger>
213
- <SelectValue />
214
- </SelectTrigger>
215
- <SelectContent>
216
- {PRIORITY_OPTIONS.map((option) => (
217
- <SelectItem key={option.value} value={option.value}>
218
- <div className="flex items-center gap-2">
219
- <option.icon className={cn("h-4 w-4", option.color)} />
220
- <span>{option.label}</span>
221
- </div>
222
- </SelectItem>
223
- ))}
224
- </SelectContent>
225
- </Select>
226
- </div>
227
-
228
- {/* Due Date */}
229
- <div>
230
- <Label>Due Date</Label>
231
- <Popover>
232
- <PopoverTrigger asChild>
233
- <Button variant="outline" className="w-full justify-start">
234
- {dueDate ? (
235
- <>
236
- <Calendar className="mr-2 h-4 w-4" />
237
- {format(dueDate, 'PPP')}
238
- </>
239
- ) : (
240
- <>
241
- <Calendar className="mr-2 h-4 w-4" />
242
- <span className="text-muted-foreground">Pick a date</span>
243
- </>
244
- )}
245
- </Button>
246
- </PopoverTrigger>
247
- <PopoverContent className="w-auto p-0" align="start">
248
- <CalendarComponent
249
- mode="single"
250
- selected={dueDate}
251
- onSelect={(date) => {
252
- if (date instanceof Date) {
253
- setDueDate(date)
254
- } else {
255
- setDueDate(undefined)
256
- }
257
- }}
258
- initialFocus
259
- />
260
- </PopoverContent>
261
- </Popover>
262
- </div>
263
- </div>
264
-
265
- <div className="grid grid-cols-2 gap-4">
266
- {/* Assignees */}
267
- <div>
268
- <Label>Assignees</Label>
269
- <Popover>
270
- <PopoverTrigger asChild>
271
- <Button variant="outline" className="w-full justify-start">
272
- {assignees.length > 0 ? (
273
- <div className="flex items-center gap-2">
274
- <MoonUIAvatarGroupPro max={2} size="xs">
275
- {assignees.map((assignee) => (
276
- <MoonUIAvatarPro key={assignee.id} className="h-5 w-5">
277
- <MoonUIAvatarImagePro src={assignee.avatar} />
278
- <MoonUIAvatarFallbackPro className="text-xs">
279
- {getInitials(assignee.name)}
280
- </MoonUIAvatarFallbackPro>
281
- </MoonUIAvatarPro>
282
- ))}
283
- </MoonUIAvatarGroupPro>
284
- <span className="text-sm truncate">
285
- {assignees.map(a => a.name).join(', ')}
286
- </span>
287
- </div>
288
- ) : (
289
- <>
290
- <User className="mr-2 h-4 w-4" />
291
- <span className="text-muted-foreground">Select assignees</span>
292
- </>
293
- )}
294
- </Button>
295
- </PopoverTrigger>
296
- <PopoverContent className="p-0" align="start">
297
- <Command>
298
- <CommandInput placeholder="Search people..." />
299
- <CommandEmpty>No assignees found.</CommandEmpty>
300
- <CommandGroup>
301
- {availableAssignees.map((assignee) => {
302
- const isSelected = assignees.some(a => a.id === assignee.id)
303
- return (
304
- <CommandItem
305
- key={assignee.id}
306
- onSelect={() => {
307
- if (isSelected) {
308
- setAssignees(assignees.filter(a => a.id !== assignee.id))
309
- } else {
310
- setAssignees([...assignees, assignee])
311
- }
312
- }}
313
- >
314
- <Check
315
- className={cn(
316
- "mr-2 h-4 w-4",
317
- isSelected ? "opacity-100" : "opacity-0"
318
- )}
319
- />
320
- <MoonUIAvatarPro className="h-6 w-6 mr-2">
321
- <MoonUIAvatarImagePro src={assignee.avatar} />
322
- <MoonUIAvatarFallbackPro className="text-xs">
323
- {getInitials(assignee.name)}
324
- </MoonUIAvatarFallbackPro>
325
- </MoonUIAvatarPro>
326
- <span>{assignee.name}</span>
327
- </CommandItem>
328
- )
329
- })}
330
- </CommandGroup>
331
- </Command>
332
- </PopoverContent>
333
- </Popover>
334
- </div>
335
-
336
- {/* Labels */}
337
- <div>
338
- <Label>Labels</Label>
339
- <Popover>
340
- <PopoverTrigger asChild>
341
- <Button variant="outline" className="w-full justify-start">
342
- {labels.length > 0 ? (
343
- <div className="flex items-center gap-1 truncate">
344
- {labels.slice(0, 2).map((label) => (
345
- <div
346
- key={label.id}
347
- className="px-2 py-0.5 rounded text-xs text-white"
348
- style={{ backgroundColor: label.color }}
349
- >
350
- {label.name}
351
- </div>
352
- ))}
353
- {labels.length > 2 && (
354
- <span className="text-sm text-muted-foreground">
355
- +{labels.length - 2} more
356
- </span>
357
- )}
358
- </div>
359
- ) : (
360
- <>
361
- <Tag className="mr-2 h-4 w-4" />
362
- <span className="text-muted-foreground">Select labels</span>
363
- </>
364
- )}
365
- </Button>
366
- </PopoverTrigger>
367
- <PopoverContent className="p-3" align="start">
368
- <div className="space-y-2">
369
- {availableLabels.map((label) => {
370
- const isSelected = labels.some(l => l.id === label.id)
371
- return (
372
- <div
373
- key={label.id}
374
- className={cn(
375
- "flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
376
- isSelected && "bg-muted"
377
- )}
378
- onClick={() => {
379
- if (isSelected) {
380
- setLabels(labels.filter(l => l.id !== label.id))
381
- } else {
382
- setLabels([...labels, label])
383
- }
384
- }}
385
- >
386
- <div
387
- className="w-6 h-6 rounded"
388
- style={{ backgroundColor: label.color }}
389
- />
390
- <span className="text-sm">{label.name}</span>
391
- {isSelected && <Check className="h-4 w-4 ml-auto" />}
392
- </div>
393
- )
394
- })}
395
- </div>
396
- </PopoverContent>
397
- </Popover>
398
- </div>
399
- </div>
400
-
401
- {/* Tags */}
402
- <div>
403
- <Label>Tags</Label>
404
- <div className="space-y-2">
405
- <div className="flex gap-2">
406
- <Input
407
- placeholder="Add a tag..."
408
- value={tagInput}
409
- onChange={(e) => setTagInput(e.target.value)}
410
- onKeyDown={(e) => {
411
- if (e.key === 'Enter') {
412
- e.preventDefault()
413
- handleAddTag()
414
- }
415
- }}
416
- />
417
- <Button
418
- type="button"
419
- variant="outline"
420
- onClick={handleAddTag}
421
- disabled={!tagInput.trim()}
422
- >
423
- Add
424
- </Button>
425
- </div>
426
- {tags.length > 0 && (
427
- <div className="flex flex-wrap gap-2">
428
- {tags.map((tag) => (
429
- <Badge
430
- key={tag}
431
- variant="secondary"
432
- className="cursor-pointer"
433
- onClick={() => setTags(tags.filter(t => t !== tag))}
434
- >
435
- {tag}
436
- <span className="ml-1 hover:text-destructive">×</span>
437
- </Badge>
438
- ))}
439
- </div>
440
- )}
441
- </div>
442
- </div>
443
- </div>
444
- </TabsContent>
445
-
446
- <TabsContent value="template" className="space-y-4">
447
- <div className="grid grid-cols-2 gap-4">
448
- {CARD_TEMPLATES.map((template) => (
449
- <div
450
- key={template.name}
451
- className="p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors"
452
- onClick={() => {
453
- handleTemplateSelect(template.template)
454
- setSelectedTab('blank')
455
- }}
456
- >
457
- <div className="flex items-center gap-3 mb-2">
458
- <template.icon className="h-5 w-5 text-muted-foreground" />
459
- <h4 className="font-medium">{template.name}</h4>
460
- </div>
461
- <p className="text-sm text-muted-foreground">
462
- {template.name === 'Bug Report' && 'Track and fix bugs with detailed information'}
463
- {template.name === 'Feature Request' && 'Plan new features with user stories'}
464
- {template.name === 'Task' && 'Create actionable tasks with clear objectives'}
465
- {template.name === 'User Story' && 'Define user needs and acceptance criteria'}
466
- </p>
467
- </div>
468
- ))}
469
- {templates.map((template, index) => (
470
- <div
471
- key={`custom-${index}`}
472
- className="p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors"
473
- onClick={() => {
474
- handleTemplateSelect(template)
475
- setSelectedTab('blank')
476
- }}
477
- >
478
- <div className="flex items-center gap-3 mb-2">
479
- <Star className="h-5 w-5 text-muted-foreground" />
480
- <h4 className="font-medium">{template.title || `Template ${index + 1}`}</h4>
481
- </div>
482
- <p className="text-sm text-muted-foreground line-clamp-2">
483
- {template.description || 'Custom template'}
484
- </p>
485
- </div>
486
- ))}
487
- </div>
488
- </TabsContent>
489
- </Tabs>
490
-
491
- <DialogFooter>
492
- <Button variant="outline" onClick={onClose}>
493
- Cancel
494
- </Button>
495
- <Button onClick={handleSubmit} disabled={!title.trim()}>
496
- Add Card
497
- </Button>
498
- </DialogFooter>
499
- </DialogContent>
500
- </Dialog>
501
- )
502
- }