@moontra/moonui-pro 2.20.1 → 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 (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. 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
- }