@flamingo-stack/openframe-frontend-core 0.0.264 → 0.0.265

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 (53) hide show
  1. package/dist/{chunk-JOUI6TQY.js → chunk-266DUZ6D.js} +2 -2
  2. package/dist/{chunk-SIYHXLFH.cjs → chunk-2P6V2EWZ.cjs} +38 -3
  3. package/dist/chunk-2P6V2EWZ.cjs.map +1 -0
  4. package/dist/{chunk-SSUUMPAQ.js → chunk-6A2YQ5CY.js} +2 -2
  5. package/dist/{chunk-3LWUHLPK.cjs → chunk-D4TWJNO5.cjs} +25 -25
  6. package/dist/{chunk-3LWUHLPK.cjs.map → chunk-D4TWJNO5.cjs.map} +1 -1
  7. package/dist/{chunk-VYTU7JZR.js → chunk-EXU5N5RM.js} +37 -2
  8. package/dist/chunk-EXU5N5RM.js.map +1 -0
  9. package/dist/{chunk-P67D545X.cjs → chunk-HMHMK6U6.cjs} +11 -11
  10. package/dist/{chunk-P67D545X.cjs.map → chunk-HMHMK6U6.cjs.map} +1 -1
  11. package/dist/{chunk-ZOOTBYZO.cjs → chunk-J5BBBDNA.cjs} +30 -30
  12. package/dist/{chunk-ZOOTBYZO.cjs.map → chunk-J5BBBDNA.cjs.map} +1 -1
  13. package/dist/{chunk-6ZEKKAAL.js → chunk-Z5YEQWLC.js} +2 -2
  14. package/dist/components/chat/index.cjs +2 -2
  15. package/dist/components/chat/index.js +1 -1
  16. package/dist/components/contact/index.cjs +3 -3
  17. package/dist/components/contact/index.js +2 -2
  18. package/dist/components/features/board/ticket-card.d.ts.map +1 -1
  19. package/dist/components/features/board/types.d.ts +1 -0
  20. package/dist/components/features/board/types.d.ts.map +1 -1
  21. package/dist/components/features/index.cjs +2 -2
  22. package/dist/components/features/index.js +1 -1
  23. package/dist/components/index.cjs +48 -48
  24. package/dist/components/index.js +3 -3
  25. package/dist/components/navigation/index.cjs +2 -2
  26. package/dist/components/navigation/index.js +1 -1
  27. package/dist/components/related-content/index.cjs +3 -3
  28. package/dist/components/related-content/index.js +2 -2
  29. package/dist/components/tickets/index.cjs +55 -55
  30. package/dist/components/tickets/index.js +3 -3
  31. package/dist/components/ui/index.cjs +2 -2
  32. package/dist/components/ui/index.js +1 -1
  33. package/dist/index.cjs +6 -2
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +5 -1
  36. package/dist/utils/date-utils.d.ts +9 -0
  37. package/dist/utils/date-utils.d.ts.map +1 -1
  38. package/dist/utils/index.cjs +29 -0
  39. package/dist/utils/index.cjs.map +1 -1
  40. package/dist/utils/index.d.ts +1 -1
  41. package/dist/utils/index.d.ts.map +1 -1
  42. package/dist/utils/index.js +28 -1
  43. package/dist/utils/index.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/features/board/ticket-card.tsx +15 -0
  46. package/src/components/features/board/types.ts +1 -0
  47. package/src/utils/date-utils.ts +36 -0
  48. package/src/utils/index.ts +2 -0
  49. package/dist/chunk-SIYHXLFH.cjs.map +0 -1
  50. package/dist/chunk-VYTU7JZR.js.map +0 -1
  51. /package/dist/{chunk-JOUI6TQY.js.map → chunk-266DUZ6D.js.map} +0 -0
  52. /package/dist/{chunk-SSUUMPAQ.js.map → chunk-6A2YQ5CY.js.map} +0 -0
  53. /package/dist/{chunk-6ZEKKAAL.js.map → chunk-Z5YEQWLC.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.264",
3
+ "version": "0.0.265",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -7,7 +7,9 @@ import * as React from 'react'
7
7
  import { LaptopIcon, Flag02Icon } from '../../icons-v2-generated'
8
8
  import { SquareAvatar } from '../../ui/square-avatar'
9
9
  import { Tag } from '../../ui/tag'
10
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip'
10
11
  import { cn } from '../../../utils/cn'
12
+ import { formatTicketRelativeTime, formatTicketFullTimestamp } from '../../../utils/date-utils'
11
13
  import type { BoardPriority, BoardTicket } from './types'
12
14
 
13
15
  const PRIORITY_COLOR_CLASS: Record<BoardPriority, string> = {
@@ -96,6 +98,9 @@ export function TicketCard({
96
98
  </div>
97
99
  ) : null
98
100
 
101
+ const timestampLabel = ticket.createdAt ? formatTicketRelativeTime(ticket.createdAt) : null
102
+ const tooltipLabel = ticket.createdAt ? formatTicketFullTimestamp(ticket.createdAt) : null
103
+
99
104
  const body = (
100
105
  <>
101
106
  <div className="flex items-start gap-[var(--spacing-system-sf)]">
@@ -111,6 +116,16 @@ export function TicketCard({
111
116
  {rightSection}
112
117
  </div>
113
118
  {ticket.tags?.length ? <TicketTagRow tags={ticket.tags} /> : null}
119
+ {timestampLabel && tooltipLabel && (
120
+ <TooltipProvider>
121
+ <Tooltip>
122
+ <TooltipTrigger asChild>
123
+ <p className="pointer-events-auto text-h6 truncate text-ods-text-secondary">{timestampLabel}</p>
124
+ </TooltipTrigger>
125
+ <TooltipContent>{tooltipLabel}</TooltipContent>
126
+ </Tooltip>
127
+ </TooltipProvider>
128
+ )}
114
129
  </>
115
130
  )
116
131
 
@@ -20,6 +20,7 @@ export interface BoardTicket {
20
20
  priority?: BoardPriority
21
21
  assignees?: BoardTicketAssignee[]
22
22
  tags?: string[]
23
+ createdAt?: string
23
24
  }
24
25
 
25
26
  export interface BoardColumnDef {
@@ -3,6 +3,42 @@
3
3
  * Provides consistent date formatting across all components
4
4
  */
5
5
 
6
+ /**
7
+ * Relative display label for a ticket timestamp (ISO string).
8
+ * < 1 min → "Just now" | 1-59 min → "X min ago" | 1-23 h → "X hour(s) ago" | 24+ h → "MM/DD/YYYY"
9
+ */
10
+ export function formatTicketRelativeTime(iso: string): string {
11
+ const now = new Date()
12
+ const date = new Date(iso)
13
+ if (Number.isNaN(date.getTime())) return ''
14
+ const diffMs = now.getTime() - date.getTime()
15
+ const diffMin = Math.floor(diffMs / 60_000)
16
+ if (diffMin < 1) return 'Just now'
17
+ if (diffMin < 60) return `${diffMin} min ago`
18
+ const diffHours = Math.floor(diffMin / 60)
19
+ if (diffHours < 24) return diffHours === 1 ? '1 hour ago' : `${diffHours} hours ago`
20
+ const mm = String(date.getMonth() + 1).padStart(2, '0')
21
+ const dd = String(date.getDate()).padStart(2, '0')
22
+ const yyyy = date.getFullYear()
23
+ return `${mm}/${dd}/${yyyy}`
24
+ }
25
+
26
+ /**
27
+ * Full tooltip timestamp in "MM/DD/YYYY, H:MM AM/PM" format.
28
+ */
29
+ export function formatTicketFullTimestamp(iso: string): string {
30
+ const date = new Date(iso)
31
+ if (Number.isNaN(date.getTime())) return ''
32
+ const mm = String(date.getMonth() + 1).padStart(2, '0')
33
+ const dd = String(date.getDate()).padStart(2, '0')
34
+ const yyyy = date.getFullYear()
35
+ let hours = date.getHours()
36
+ const minutes = String(date.getMinutes()).padStart(2, '0')
37
+ const ampm = hours >= 12 ? 'PM' : 'AM'
38
+ hours = hours % 12 || 12
39
+ return `${mm}/${dd}/${yyyy}, ${hours}:${minutes} ${ampm}`
40
+ }
41
+
6
42
  /**
7
43
  * Format relative time from ISO timestamp
8
44
  * This is the single source of truth for all relative time formatting
@@ -113,6 +113,8 @@ export {
113
113
  isToday,
114
114
  isWithinMinutes,
115
115
  createUTCTimestamp,
116
+ formatTicketRelativeTime,
117
+ formatTicketFullTimestamp,
116
118
  } from './date-utils'
117
119
 
118
120
  // Chat source-icons + labels (server-safe — lives here in src/utils/