@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.
- package/dist/{chunk-JOUI6TQY.js → chunk-266DUZ6D.js} +2 -2
- package/dist/{chunk-SIYHXLFH.cjs → chunk-2P6V2EWZ.cjs} +38 -3
- package/dist/chunk-2P6V2EWZ.cjs.map +1 -0
- package/dist/{chunk-SSUUMPAQ.js → chunk-6A2YQ5CY.js} +2 -2
- package/dist/{chunk-3LWUHLPK.cjs → chunk-D4TWJNO5.cjs} +25 -25
- package/dist/{chunk-3LWUHLPK.cjs.map → chunk-D4TWJNO5.cjs.map} +1 -1
- package/dist/{chunk-VYTU7JZR.js → chunk-EXU5N5RM.js} +37 -2
- package/dist/chunk-EXU5N5RM.js.map +1 -0
- package/dist/{chunk-P67D545X.cjs → chunk-HMHMK6U6.cjs} +11 -11
- package/dist/{chunk-P67D545X.cjs.map → chunk-HMHMK6U6.cjs.map} +1 -1
- package/dist/{chunk-ZOOTBYZO.cjs → chunk-J5BBBDNA.cjs} +30 -30
- package/dist/{chunk-ZOOTBYZO.cjs.map → chunk-J5BBBDNA.cjs.map} +1 -1
- package/dist/{chunk-6ZEKKAAL.js → chunk-Z5YEQWLC.js} +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- package/dist/components/features/board/types.d.ts +1 -0
- package/dist/components/features/board/types.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +48 -48
- package/dist/components/index.js +3 -3
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +55 -55
- package/dist/components/tickets/index.js +3 -3
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/utils/date-utils.d.ts +9 -0
- package/dist/utils/date-utils.d.ts.map +1 -1
- package/dist/utils/index.cjs +29 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +28 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/board/ticket-card.tsx +15 -0
- package/src/components/features/board/types.ts +1 -0
- package/src/utils/date-utils.ts +36 -0
- package/src/utils/index.ts +2 -0
- package/dist/chunk-SIYHXLFH.cjs.map +0 -1
- package/dist/chunk-VYTU7JZR.js.map +0 -1
- /package/dist/{chunk-JOUI6TQY.js.map → chunk-266DUZ6D.js.map} +0 -0
- /package/dist/{chunk-SSUUMPAQ.js.map → chunk-6A2YQ5CY.js.map} +0 -0
- /package/dist/{chunk-6ZEKKAAL.js.map → chunk-Z5YEQWLC.js.map} +0 -0
package/package.json
CHANGED
|
@@ -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
|
|
package/src/utils/date-utils.ts
CHANGED
|
@@ -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
|
package/src/utils/index.ts
CHANGED