@freedom-code-compliance/fcc-redesign 0.1.52 → 0.1.53

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.
package/index.d.ts CHANGED
@@ -139,6 +139,7 @@ export interface FCCChatDetailModel {
139
139
  onMessageCopy?: (message: FCCChatMessage) => void
140
140
  composerPlaceholder?: string
141
141
  onSubmit?: (value: string) => void
142
+ composer?: FCCChatComposerProps
142
143
  [key: string]: unknown
143
144
  }
144
145
 
@@ -188,6 +189,19 @@ export interface FCCChatSidebarProps extends Omit<ComponentPropsWithoutRef<'sect
188
189
  filters?: FCCChatFilterState
189
190
  onFiltersChange?: (filters: FCCChatFilterState) => void
190
191
  detail: FCCChatDetailModel | null
192
+ newTicket?: FCCChatNewTicketFormProps & {
193
+ onOpen?: () => void
194
+ onCreated?: (values: FCCChatNewTicketFormValues) => void
195
+ onError?: (error: unknown, values: FCCChatNewTicketFormValues) => void
196
+ }
197
+ newDM?: FCCChatNewDMModalProps & {
198
+ onOpen?: () => void
199
+ onCreated?: (users: FCCChatNewDMUser[], ids: string[]) => void
200
+ onError?: (error: unknown, users: FCCChatNewDMUser[], ids: string[]) => void
201
+ }
202
+ composer?: FCCChatComposerProps & {
203
+ onStartHubUpdate?: () => void
204
+ }
191
205
  slots?: FCCChatSidebarSlots
192
206
  mobilePortalTargetSelector?: string | null
193
207
  }
@@ -216,6 +230,101 @@ export interface FCCChatComposerFrameProps {
216
230
  children?: ReactNode
217
231
  }
218
232
 
233
+ export interface FCCChatComposerSubmitMeta {
234
+ attachments?: FCCChatAttachment[]
235
+ quote?: FCCChatMessage | Record<string, unknown>
236
+ }
237
+
238
+ export interface FCCChatComposerProps {
239
+ placeholder?: string
240
+ value?: string
241
+ onChange?: (value: string) => void
242
+ onSubmit?: (value: string, meta: FCCChatComposerSubmitMeta) => void | Promise<void>
243
+ disabled?: boolean
244
+ attachments?: FCCChatAttachment[]
245
+ onAttach?: (files: File[]) => void
246
+ onRemoveAttachment?: (attachment: FCCChatAttachment, index: number) => void
247
+ quote?: FCCChatMessage | Record<string, unknown>
248
+ onCancelQuote?: () => void
249
+ mentionSuggestions?: FCCChatAvatarGroupItem[]
250
+ departmentSuggestions?: FCCChatAvatarGroupItem[]
251
+ leadingAction?: ReactNode
252
+ sendLabel?: string
253
+ className?: string
254
+ }
255
+
256
+ export interface FCCChatNewTicketFormValues {
257
+ projectId?: string
258
+ projectName?: ReactNode
259
+ departmentCode?: string
260
+ targetType?: string
261
+ title: string
262
+ message?: string
263
+ visibility?: 'internal' | 'public' | string
264
+ files?: File[]
265
+ }
266
+
267
+ export interface FCCChatOption {
268
+ id?: string
269
+ value?: string
270
+ label?: ReactNode
271
+ name?: ReactNode
272
+ title?: ReactNode
273
+ [key: string]: unknown
274
+ }
275
+
276
+ export interface FCCChatNewTicketFormProps {
277
+ title?: ReactNode
278
+ description?: ReactNode
279
+ projects?: FCCChatOption[]
280
+ departments?: FCCChatOption[]
281
+ targetTypes?: FCCChatOption[]
282
+ defaultProjectId?: string
283
+ defaultProjectName?: ReactNode
284
+ lockProject?: boolean
285
+ initialValues?: Partial<FCCChatNewTicketFormValues>
286
+ files?: File[]
287
+ onFilesChange?: (files: File[]) => void
288
+ onAttach?: (files: File[]) => void
289
+ onRemoveFile?: (file: File, index: number) => void
290
+ attachmentAccept?: string
291
+ attachLabel?: ReactNode
292
+ projectLabel?: ReactNode
293
+ departmentLabel?: ReactNode
294
+ targetLabel?: ReactNode
295
+ titleLabel?: ReactNode
296
+ messageLabel?: ReactNode
297
+ titlePlaceholder?: string
298
+ messagePlaceholder?: string
299
+ onSearchProjects?: (query: string) => void
300
+ onSubmit?: (values: FCCChatNewTicketFormValues) => void | Promise<void>
301
+ onClose?: () => void
302
+ isSubmitting?: boolean
303
+ submitLabel?: ReactNode
304
+ }
305
+
306
+ export interface FCCChatNewDMUser extends FCCChatAvatarGroupItem {
307
+ value?: string
308
+ label?: ReactNode
309
+ email?: ReactNode
310
+ role?: ReactNode
311
+ subtitle?: ReactNode
312
+ [key: string]: unknown
313
+ }
314
+
315
+ export interface FCCChatNewDMModalProps {
316
+ open?: boolean
317
+ title?: ReactNode
318
+ users?: FCCChatNewDMUser[]
319
+ selectedUserIds?: string[]
320
+ onSelectedUserIdsChange?: (ids: string[]) => void
321
+ onSearchUsers?: (query: string) => void
322
+ onCreateDM?: (users: FCCChatNewDMUser[], ids: string[]) => void | Promise<void>
323
+ onClose?: () => void
324
+ isSubmitting?: boolean
325
+ emptyLabel?: ReactNode
326
+ }
327
+
219
328
  export interface FCCChatHubFeedProps {
220
329
  updates?: FCCChatHubUpdate[]
221
330
  onSelectUpdate?: (update: FCCChatHubUpdate) => void
@@ -231,7 +340,10 @@ export interface FCCChatTicketStatusTrackerProps {
231
340
 
232
341
  export function FCCChatSidebar(props: FCCChatSidebarProps): JSX.Element
233
342
  export function FCCChatMessageList(props: FCCChatMessageListProps): JSX.Element
343
+ export function FCCChatComposer(props: FCCChatComposerProps): JSX.Element
234
344
  export function FCCChatComposerFrame(props: FCCChatComposerFrameProps): JSX.Element
345
+ export function FCCChatNewTicketForm(props: FCCChatNewTicketFormProps): JSX.Element
346
+ export function FCCChatNewDMModal(props: FCCChatNewDMModalProps): JSX.Element | null
235
347
  export function FCCChatHubFeed(props: FCCChatHubFeedProps): JSX.Element
236
348
  export function FCCChatTicketStatusTracker(props: FCCChatTicketStatusTrackerProps): JSX.Element
237
349
 
@@ -448,6 +560,65 @@ export const KPICard: FCCAnyComponent
448
560
  export const StatCard: FCCAnyComponent
449
561
  export const NotificationsPanel: FCCAnyComponent
450
562
 
563
+ export interface FCCNotificationSidePanelItem {
564
+ id: string
565
+ title?: ReactNode
566
+ body?: ReactNode
567
+ message?: ReactNode
568
+ text?: ReactNode
569
+ detail?: ReactNode
570
+ actorName?: string
571
+ userName?: string
572
+ user?: string
573
+ requesterName?: string
574
+ senderName?: string
575
+ avatarUrl?: string | null
576
+ actorAvatarUrl?: string | null
577
+ userAvatar?: string | null
578
+ imageUrl?: string | null
579
+ avatarInitials?: string
580
+ initials?: string
581
+ timestamp?: string | number | Date | null
582
+ createdAt?: string | number | Date | null
583
+ date?: string | number | Date | null
584
+ timeStamp?: string | number | Date | null
585
+ timeLabel?: ReactNode
586
+ time?: ReactNode
587
+ isRead?: boolean
588
+ read?: boolean
589
+ readAt?: string | null
590
+ groupKey?: 'today' | 'yesterday' | 'thisWeek' | 'older' | string
591
+ [key: string]: unknown
592
+ }
593
+
594
+ export interface FCCNotificationSidePanelProps {
595
+ notifications?: FCCNotificationSidePanelItem[]
596
+ loading?: boolean
597
+ title?: ReactNode
598
+ statusLabel?: ReactNode
599
+ emptyTitle?: ReactNode
600
+ emptyUnreadTitle?: ReactNode
601
+ emptyDescription?: ReactNode
602
+ markAllReadLabel?: ReactNode
603
+ closeLabel?: string
604
+ activeFilter?: 'all' | 'unread' | string
605
+ defaultFilter?: 'all' | 'unread' | string
606
+ onFilterChange?: (filter: string) => void
607
+ onNotificationClick?: (notification: FCCNotificationSidePanelItem) => void
608
+ onMarkRead?: (id: string, notification: FCCNotificationSidePanelItem) => void
609
+ onMarkAllRead?: () => void
610
+ onClose?: () => void
611
+ renderNotification?: (
612
+ notification: FCCNotificationSidePanelItem,
613
+ helpers: { onClick: () => void; defaultNode: ReactNode },
614
+ ) => ReactNode
615
+ showCloseButton?: boolean
616
+ showMarkAllRead?: boolean
617
+ className?: string
618
+ }
619
+
620
+ export const FCCNotificationSidePanel: ComponentType<FCCNotificationSidePanelProps>
621
+
451
622
  export type FCCIconName =
452
623
  | 'inbox'
453
624
  | 'issues'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@freedom-code-compliance/fcc-redesign",
3
3
  "private": false,
4
- "version": "0.1.52",
4
+ "version": "0.1.53",
5
5
  "description": "Reusable FCC design system components and theme for fccPRO and fccOPS.",
6
6
  "type": "module",
7
7
  "repository": {