@flamingo-stack/openframe-frontend-core 0.0.279 → 0.0.280-snapshot.20260617173924

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 (64) hide show
  1. package/dist/{chunk-SZG56DA3.js → chunk-3QMJ6OX6.js} +3 -3
  2. package/dist/{chunk-HR4CVAVH.cjs → chunk-6QZ656YE.cjs} +12 -10
  3. package/dist/chunk-6QZ656YE.cjs.map +1 -0
  4. package/dist/{chunk-7XUBAK5K.cjs → chunk-AUVMURC5.cjs} +12 -12
  5. package/dist/{chunk-7XUBAK5K.cjs.map → chunk-AUVMURC5.cjs.map} +1 -1
  6. package/dist/{chunk-R6SHY6ZQ.js → chunk-AWFHDRRT.js} +2 -2
  7. package/dist/{chunk-Z53YSXDD.cjs → chunk-DEDJY6TG.cjs} +337 -305
  8. package/dist/chunk-DEDJY6TG.cjs.map +1 -0
  9. package/dist/{chunk-776ZURDZ.cjs → chunk-DKHWVF6S.cjs} +15 -15
  10. package/dist/{chunk-776ZURDZ.cjs.map → chunk-DKHWVF6S.cjs.map} +1 -1
  11. package/dist/{chunk-XBTQK32O.cjs → chunk-FAKJMITR.cjs} +27 -27
  12. package/dist/{chunk-XBTQK32O.cjs.map → chunk-FAKJMITR.cjs.map} +1 -1
  13. package/dist/{chunk-6ZMD3KBP.js → chunk-GQS4ZRL3.js} +3 -3
  14. package/dist/{chunk-7XVVRE53.cjs → chunk-HIFAGJQU.cjs} +10 -10
  15. package/dist/{chunk-7XVVRE53.cjs.map → chunk-HIFAGJQU.cjs.map} +1 -1
  16. package/dist/{chunk-QP4H2JJN.cjs → chunk-LAXKEA5S.cjs} +38 -38
  17. package/dist/{chunk-QP4H2JJN.cjs.map → chunk-LAXKEA5S.cjs.map} +1 -1
  18. package/dist/{chunk-7ECI5ZVO.js → chunk-ODKT35W6.js} +3 -3
  19. package/dist/{chunk-YK6FFIVG.js → chunk-PWPRJKCY.js} +3 -3
  20. package/dist/{chunk-RGCVYGA2.js → chunk-UV55CG7P.js} +12 -10
  21. package/dist/chunk-UV55CG7P.js.map +1 -0
  22. package/dist/{chunk-AVLSICZO.js → chunk-Z4RUSQES.js} +36 -4
  23. package/dist/chunk-Z4RUSQES.js.map +1 -0
  24. package/dist/components/chat/chat-ticket-list.d.ts +2 -0
  25. package/dist/components/chat/chat-ticket-list.d.ts.map +1 -1
  26. package/dist/components/chat/entity-cards/chat-ticket-item.d.ts +4 -1
  27. package/dist/components/chat/entity-cards/chat-ticket-item.d.ts.map +1 -1
  28. package/dist/components/chat/index.cjs +3 -3
  29. package/dist/components/chat/index.js +2 -2
  30. package/dist/components/contact/index.cjs +4 -4
  31. package/dist/components/contact/index.js +3 -3
  32. package/dist/components/faq/index.cjs +4 -4
  33. package/dist/components/faq/index.js +3 -3
  34. package/dist/components/features/index.cjs +3 -3
  35. package/dist/components/features/index.js +2 -2
  36. package/dist/components/index.cjs +85 -85
  37. package/dist/components/index.js +6 -6
  38. package/dist/components/navigation/index.cjs +3 -3
  39. package/dist/components/navigation/index.js +2 -2
  40. package/dist/components/onboarding-guides/index.cjs +22 -22
  41. package/dist/components/onboarding-guides/index.js +2 -2
  42. package/dist/components/related-content/index.cjs +4 -4
  43. package/dist/components/related-content/index.js +3 -3
  44. package/dist/components/tickets/index.cjs +61 -61
  45. package/dist/components/tickets/index.js +4 -4
  46. package/dist/components/ui/index.cjs +3 -3
  47. package/dist/components/ui/index.js +2 -2
  48. package/dist/components/ui/square-avatar.d.ts.map +1 -1
  49. package/dist/index.cjs +3 -3
  50. package/dist/index.js +2 -2
  51. package/package.json +1 -1
  52. package/src/components/chat/chat-ticket-list.tsx +20 -1
  53. package/src/components/chat/entity-cards/chat-ticket-item.tsx +32 -2
  54. package/src/components/ui/square-avatar.tsx +11 -9
  55. package/src/stories/ChatTicketList.stories.tsx +9 -0
  56. package/dist/chunk-AVLSICZO.js.map +0 -1
  57. package/dist/chunk-HR4CVAVH.cjs.map +0 -1
  58. package/dist/chunk-RGCVYGA2.js.map +0 -1
  59. package/dist/chunk-Z53YSXDD.cjs.map +0 -1
  60. /package/dist/{chunk-SZG56DA3.js.map → chunk-3QMJ6OX6.js.map} +0 -0
  61. /package/dist/{chunk-R6SHY6ZQ.js.map → chunk-AWFHDRRT.js.map} +0 -0
  62. /package/dist/{chunk-6ZMD3KBP.js.map → chunk-GQS4ZRL3.js.map} +0 -0
  63. /package/dist/{chunk-7ECI5ZVO.js.map → chunk-ODKT35W6.js.map} +0 -0
  64. /package/dist/{chunk-YK6FFIVG.js.map → chunk-PWPRJKCY.js.map} +0 -0
@@ -7,8 +7,13 @@ import { ChatTicketItem, type ChatTicketItemData } from './entity-cards/chat-tic
7
7
  export interface ChatTicketListProps extends React.HTMLAttributes<HTMLDivElement> {
8
8
  tickets: ChatTicketItemData[]
9
9
  onTicketClick?: (ticketId: string) => void
10
+ /** Show skeleton placeholder rows instead of tickets while loading. */
11
+ isLoading?: boolean
10
12
  }
11
13
 
14
+ /** Number of skeleton rows rendered while `isLoading`. */
15
+ const SKELETON_ROW_COUNT = 4
16
+
12
17
  function getMask(top: boolean, bottom: boolean) {
13
18
  if (top && bottom) return 'linear-gradient(to bottom, transparent, black 64px, black calc(100% - 64px), transparent)'
14
19
  if (top) return 'linear-gradient(to bottom, transparent, black 64px)'
@@ -17,7 +22,7 @@ function getMask(top: boolean, bottom: boolean) {
17
22
  }
18
23
 
19
24
  const ChatTicketList = React.forwardRef<HTMLDivElement, ChatTicketListProps>(
20
- ({ className, tickets, onTicketClick, ...props }, ref) => {
25
+ ({ className, tickets, onTicketClick, isLoading = false, ...props }, ref) => {
21
26
  const scrollRef = React.useRef<HTMLDivElement>(null)
22
27
  const [fadeTop, setFadeTop] = React.useState(false)
23
28
  const [fadeBottom, setFadeBottom] = React.useState(false)
@@ -34,6 +39,20 @@ const ChatTicketList = React.forwardRef<HTMLDivElement, ChatTicketListProps>(
34
39
  updateFade()
35
40
  }, [ticketCount, updateFade])
36
41
 
42
+ if (isLoading) {
43
+ return (
44
+ <div ref={ref} className={cn("flex flex-col gap-2 min-h-0", className)} {...props}>
45
+ <p className="text-h5 text-ods-text-secondary shrink-0">Your Chats:</p>
46
+ <div className="border border-ods-border rounded-md flex-1 min-h-0 overflow-hidden">
47
+ {Array.from({ length: SKELETON_ROW_COUNT }).map((_, i) => (
48
+ // eslint-disable-next-line react/no-array-index-key
49
+ <ChatTicketItem key={i} isLoading />
50
+ ))}
51
+ </div>
52
+ </div>
53
+ )
54
+ }
55
+
37
56
  if (tickets.length === 0) return null
38
57
 
39
58
  const mask = getMask(fadeTop, fadeBottom)
@@ -5,6 +5,7 @@ import { cn } from '../../../utils/cn'
5
5
  import { ChevronRight } from 'lucide-react'
6
6
  import { TicketStatusTag, resolveStatusTagProps, resolveTicketStatus } from '../../ui/ticket-status-tag'
7
7
  import { Tag } from '../../ui/tag'
8
+ import { Skeleton } from '../../ui/skeleton'
8
9
  import { WrenchIcon } from '../../icons-v2-generated/household/wrench-icon'
9
10
 
10
11
  export interface ChatTicketItemData {
@@ -36,12 +37,41 @@ export interface ChatTicketItemData {
36
37
  }
37
38
 
38
39
  export interface ChatTicketItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
39
- ticket: ChatTicketItemData
40
+ /** Optional while `isLoading` — the skeleton placeholder needs no data. */
41
+ ticket?: ChatTicketItemData
40
42
  onClick?: (ticketId: string) => void
43
+ /** Render a non-interactive skeleton placeholder sized to a real row. */
44
+ isLoading?: boolean
41
45
  }
42
46
 
43
47
  const ChatTicketItem = React.forwardRef<HTMLButtonElement, ChatTicketItemProps>(
44
- ({ className, ticket, onClick, ...props }, ref) => {
48
+ ({ className, ticket, onClick, isLoading = false, ...props }, ref) => {
49
+ if (isLoading) {
50
+ return (
51
+ <div
52
+ aria-hidden
53
+ className={cn(
54
+ "flex items-center gap-4 w-full h-20 px-4",
55
+ "bg-ods-card border-b border-ods-border",
56
+ className,
57
+ )}
58
+ >
59
+ <div className="flex flex-col justify-center flex-1 min-w-0 gap-2">
60
+ {/* title line */}
61
+ <Skeleton className="h-5 w-1/2" />
62
+ {/* subtitle line */}
63
+ <Skeleton className="h-4 w-1/3" />
64
+ </div>
65
+ {/* status tag */}
66
+ <Skeleton className="h-7 w-20 rounded-full shrink-0" />
67
+ {/* chevron box */}
68
+ <Skeleton className="size-12 rounded-md shrink-0" />
69
+ </div>
70
+ )
71
+ }
72
+
73
+ if (!ticket) return null
74
+
45
75
  const statusTagProps = resolveStatusTagProps({
46
76
  status: ticket.status,
47
77
  statusKind: ticket.statusKind,
@@ -50,15 +50,17 @@ const SquareAvatar = React.memo(React.forwardRef<HTMLDivElement, SquareAvatarPro
50
50
  {...props}
51
51
  >
52
52
  <div className={cn(
53
- // Initials use `text-ods-text-primary` so they stay readable
54
- // both on the default `bg-ods-bg` AND on accent-fill backgrounds
55
- // (`bg-ods-flamingo-pink` for the current user, `bg-ods-flamingo-cyan`
56
- // for Mingo). With `text-ods-text-secondary` (#888) on a pink fill
57
- // (#F357BB) the initials clocked ~2.0:1 contrast — failing WCAG AA
58
- // and visually rendering as a blank colored dot. Primary text
59
- // (#fafafa) on the same pink yields ~3.5:1 (AA Large) and on the
60
- // dark default bg yields ~15:1.
61
- 'flex items-center justify-center text-xs font-medium text-ods-text-primary',
53
+ // Initials default to `--color-text-primary` (the old
54
+ // `text-ods-text-primary` value) so they stay readable on the default
55
+ // `bg-ods-bg` AND on the brand accent fills (`bg-ods-flamingo-pink`
56
+ // for the current user, `bg-ods-flamingo-cyan` for Mingo). The color
57
+ // resolves through `--ods-avatar-initials` with that fallback, so a
58
+ // host themed with a custom avatar fill can override the var with a
59
+ // contrast-correct value (e.g. `getReadableTextColor(accent)`) WITHOUT
60
+ // regressing any avatar that leaves the var unset. A caller passing
61
+ // its own `initialsClassName` text color still wins (tailwind-merge
62
+ // keeps the later class).
63
+ 'flex items-center justify-center text-xs font-medium text-[color:var(--ods-avatar-initials,var(--color-text-primary))]',
62
64
  initialsClassName,
63
65
  src && 'hidden'
64
66
  )}>
@@ -194,3 +194,12 @@ export const ScrollFadingCompact: Story = {
194
194
  },
195
195
  decorators: [constrainedDecorator(280)],
196
196
  };
197
+
198
+ /** Loading state — skeleton placeholder rows shown while tickets load. */
199
+ export const Loading: Story = {
200
+ args: {
201
+ tickets: [],
202
+ isLoading: true,
203
+ },
204
+ decorators: [constrainedDecorator()],
205
+ };