@arbidocs/react 0.5.172 → 0.5.174
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/chat/ChatBubble.js +1 -6
- package/dist/chat/ChatBubble.js.map +2 -2
- package/dist/chat/useConversationActions.js +4 -1
- package/dist/chat/useConversationActions.js.map +2 -2
- package/dist/chat/useMessageTimer.js +4 -2
- package/dist/chat/useMessageTimer.js.map +2 -2
- package/dist/{chunk-W4W75MSO.cjs → chunk-UR5F4DNJ.cjs} +43 -45
- package/dist/chunk-UR5F4DNJ.cjs.map +1 -0
- package/dist/directmessages/DmComposer.js +5 -2
- package/dist/directmessages/DmComposer.js.map +2 -2
- package/dist/entities/EntityPill.js +2 -1
- package/dist/entities/EntityPill.js.map +2 -2
- package/dist/entities/UserEntity.js +11 -2
- package/dist/entities/UserEntity.js.map +2 -2
- package/dist/icons/ArbiBotHeadIcon.js +28 -41
- package/dist/icons/ArbiBotHeadIcon.js.map +2 -2
- package/dist/index.cjs +232 -229
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-BaZUctD1.d.ts → index.d-DIQCjS20.d.ts} +9 -2
- package/dist/index.d.ts +7 -11
- package/dist/ui/index.cjs +156 -152
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +2 -2
- package/package.json +3 -3
- package/dist/chunk-W4W75MSO.cjs.map +0 -1
|
@@ -28,6 +28,7 @@ function DmComposer({
|
|
|
28
28
|
const [attachError, setAttachError] = useState(null);
|
|
29
29
|
const [dragging, setDragging] = useState(false);
|
|
30
30
|
const inputRef = useRef(null);
|
|
31
|
+
const composerRef = useRef(null);
|
|
31
32
|
const fileInputRef = useRef(null);
|
|
32
33
|
const addFiles = (added) => {
|
|
33
34
|
if (!allowAttachments || added.length === 0) return;
|
|
@@ -53,7 +54,8 @@ function DmComposer({
|
|
|
53
54
|
setAttachError(null);
|
|
54
55
|
try {
|
|
55
56
|
await onSend(text, sending);
|
|
56
|
-
|
|
57
|
+
if (!floating || composerRef.current?.contains(document.activeElement))
|
|
58
|
+
inputRef.current?.focus();
|
|
57
59
|
} catch {
|
|
58
60
|
setDraft(text);
|
|
59
61
|
setFiles(sending);
|
|
@@ -94,8 +96,9 @@ function DmComposer({
|
|
|
94
96
|
return /* @__PURE__ */ jsxs(
|
|
95
97
|
"div",
|
|
96
98
|
{
|
|
99
|
+
ref: composerRef,
|
|
97
100
|
className: cn(
|
|
98
|
-
floating ? "
|
|
101
|
+
floating ? "border-t border-border/50 bg-transparent px-3 py-2" : "border-t border-border p-3",
|
|
99
102
|
dragging && "bg-muted/60 outline-dashed outline-2 -outline-offset-4 outline-primary"
|
|
100
103
|
),
|
|
101
104
|
"data-testid": "arbi-dm-composer",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/directmessages/DmComposer.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The message composer: an auto-sizing textarea + send button. Enter sends,\n * Shift+Enter inserts a newline.\n *\n * With `allowAttachments`, files can be added with the paperclip, pasted (an\n * image copied to the clipboard) or dropped onto the composer. They show as\n * removable chips and are handed to `onSend` alongside the text; the host\n * encrypts and uploads them. The DM limits (10 files, 15 MB each) are checked\n * here so an oversized file is refused before any work starts.\n */\n\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { ArrowUp, Loader2, Paperclip, Send, X } from 'lucide-react'\nimport { chats, formatFileSize } from '@arbidocs/sdk/browser'\nimport { Button } from '../ui/button'\nimport { Textarea } from '../ui/textarea'\nimport { cn } from '../lib/utils'\nimport type { DmClassNames } from './types'\n\nexport interface DmComposerProps {\n /** Retain unsent content when the host changes portal placement. */\n draftRef?: { current: { text: string; files: File[] } | null }\n /** A single integrated surface for chat floating over a page. */\n appearance?: 'standard' | 'floating'\n leading?: React.ReactNode\n /** Placeholder, e.g. \"Message Eleanor\u2026\". */\n placeholder?: string\n disabled?: boolean\n /**\n * A send is in flight: swaps the icon for a spinner and blocks a second\n * submit, so a slow encrypt-and-post can't be fired twice by an impatient\n * Enter.\n */\n busy?: boolean\n /**\n * Called with the trimmed text and any attached files when the user sends.\n * The text may be empty when files are attached. May reject if the send\n * fails, in which case the text and files are given back.\n */\n onSend: (text: string, files: File[]) => void | Promise<void>\n /** Offer attaching files (button, paste, drag-and-drop). Off by default. */\n allowAttachments?: boolean\n /** Shown under the box when the last send failed. */\n error?: string | null\n /** Controls beside the send button. */\n actions?: React.ReactNode\n /** Extra content above the input. */\n children?: React.ReactNode\n classNames?: Pick<DmClassNames, 'sendButton'>\n}\n\nexport function DmComposer({\n draftRef,\n appearance = 'standard',\n leading,\n placeholder,\n disabled,\n busy,\n onSend,\n allowAttachments,\n error,\n children,\n actions,\n classNames,\n}: DmComposerProps) {\n const floating = appearance === 'floating'\n const [draft, setDraft] = useState(() => draftRef?.current?.text ?? '')\n const [files, setFiles] = useState<File[]>(() => draftRef?.current?.files ?? [])\n useLayoutEffect(() => {\n if (draftRef) draftRef.current = { text: draft, files }\n }, [draftRef, draft, files])\n const [attachError, setAttachError] = useState<string | null>(null)\n const [dragging, setDragging] = useState(false)\n const inputRef = useRef<HTMLTextAreaElement>(null)\n const fileInputRef = useRef<HTMLInputElement>(null)\n\n const addFiles = (added: File[]) => {\n if (!allowAttachments || added.length === 0) return\n const next = [...files, ...added]\n try {\n chats.checkChatAttachmentLimits(next)\n setFiles(next)\n setAttachError(null)\n } catch (err) {\n setAttachError(err instanceof Error ? err.message : 'Could not attach the file')\n }\n }\n\n const removeFile = (index: number) => {\n setFiles((current) => current.filter((_, i) => i !== index))\n setAttachError(null)\n }\n\n const submit = async () => {\n const text = draft.trim()\n if ((!text && files.length === 0) || disabled || busy) return\n const sending = files\n setDraft('')\n setFiles([])\n setAttachError(null)\n try {\n await onSend(text, sending)\n // Keep the caret in the box so a reply can follow straight on.\n inputRef.current?.focus()\n } catch {\n // The send failed (the error surfaces via `error`) \u2014 give the text and\n // files back rather than losing what the user wrote.\n setDraft(text)\n setFiles(sending)\n }\n }\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault()\n void submit()\n }\n }\n\n const onPaste = (e: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (!allowAttachments) return\n const pasted = Array.from(e.clipboardData?.files ?? [])\n if (pasted.length === 0) return\n e.preventDefault()\n addFiles(pasted)\n }\n\n const hasFiles = (e: React.DragEvent) => Array.from(e.dataTransfer?.types ?? []).includes('Files')\n\n const dropHandlers = allowAttachments\n ? {\n onDragOver: (e: React.DragEvent) => {\n if (!hasFiles(e) || disabled) return\n e.preventDefault()\n setDragging(true)\n },\n onDragLeave: (e: React.DragEvent) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return\n setDragging(false)\n },\n onDrop: (e: React.DragEvent) => {\n setDragging(false)\n const dropped = Array.from(e.dataTransfer?.files ?? [])\n if (dropped.length === 0 || disabled) return\n e.preventDefault()\n addFiles(dropped)\n },\n }\n : {}\n\n return (\n <div\n className={cn(\n floating\n ? '
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * The message composer: an auto-sizing textarea + send button. Enter sends,\n * Shift+Enter inserts a newline.\n *\n * With `allowAttachments`, files can be added with the paperclip, pasted (an\n * image copied to the clipboard) or dropped onto the composer. They show as\n * removable chips and are handed to `onSend` alongside the text; the host\n * encrypts and uploads them. The DM limits (10 files, 15 MB each) are checked\n * here so an oversized file is refused before any work starts.\n */\n\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { ArrowUp, Loader2, Paperclip, Send, X } from 'lucide-react'\nimport { chats, formatFileSize } from '@arbidocs/sdk/browser'\nimport { Button } from '../ui/button'\nimport { Textarea } from '../ui/textarea'\nimport { cn } from '../lib/utils'\nimport type { DmClassNames } from './types'\n\nexport interface DmComposerProps {\n /** Retain unsent content when the host changes portal placement. */\n draftRef?: { current: { text: string; files: File[] } | null }\n /** A single integrated surface for chat floating over a page. */\n appearance?: 'standard' | 'floating'\n leading?: React.ReactNode\n /** Placeholder, e.g. \"Message Eleanor\u2026\". */\n placeholder?: string\n disabled?: boolean\n /**\n * A send is in flight: swaps the icon for a spinner and blocks a second\n * submit, so a slow encrypt-and-post can't be fired twice by an impatient\n * Enter.\n */\n busy?: boolean\n /**\n * Called with the trimmed text and any attached files when the user sends.\n * The text may be empty when files are attached. May reject if the send\n * fails, in which case the text and files are given back.\n */\n onSend: (text: string, files: File[]) => void | Promise<void>\n /** Offer attaching files (button, paste, drag-and-drop). Off by default. */\n allowAttachments?: boolean\n /** Shown under the box when the last send failed. */\n error?: string | null\n /** Controls beside the send button. */\n actions?: React.ReactNode\n /** Extra content above the input. */\n children?: React.ReactNode\n classNames?: Pick<DmClassNames, 'sendButton'>\n}\n\nexport function DmComposer({\n draftRef,\n appearance = 'standard',\n leading,\n placeholder,\n disabled,\n busy,\n onSend,\n allowAttachments,\n error,\n children,\n actions,\n classNames,\n}: DmComposerProps) {\n const floating = appearance === 'floating'\n const [draft, setDraft] = useState(() => draftRef?.current?.text ?? '')\n const [files, setFiles] = useState<File[]>(() => draftRef?.current?.files ?? [])\n useLayoutEffect(() => {\n if (draftRef) draftRef.current = { text: draft, files }\n }, [draftRef, draft, files])\n const [attachError, setAttachError] = useState<string | null>(null)\n const [dragging, setDragging] = useState(false)\n const inputRef = useRef<HTMLTextAreaElement>(null)\n const composerRef = useRef<HTMLDivElement>(null)\n const fileInputRef = useRef<HTMLInputElement>(null)\n\n const addFiles = (added: File[]) => {\n if (!allowAttachments || added.length === 0) return\n const next = [...files, ...added]\n try {\n chats.checkChatAttachmentLimits(next)\n setFiles(next)\n setAttachError(null)\n } catch (err) {\n setAttachError(err instanceof Error ? err.message : 'Could not attach the file')\n }\n }\n\n const removeFile = (index: number) => {\n setFiles((current) => current.filter((_, i) => i !== index))\n setAttachError(null)\n }\n\n const submit = async () => {\n const text = draft.trim()\n if ((!text && files.length === 0) || disabled || busy) return\n const sending = files\n setDraft('')\n setFiles([])\n setAttachError(null)\n try {\n await onSend(text, sending)\n // Keep the caret in the box so a reply can follow straight on.\n if (!floating || composerRef.current?.contains(document.activeElement))\n inputRef.current?.focus()\n } catch {\n // The send failed (the error surfaces via `error`) \u2014 give the text and\n // files back rather than losing what the user wrote.\n setDraft(text)\n setFiles(sending)\n }\n }\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault()\n void submit()\n }\n }\n\n const onPaste = (e: React.ClipboardEvent<HTMLTextAreaElement>) => {\n if (!allowAttachments) return\n const pasted = Array.from(e.clipboardData?.files ?? [])\n if (pasted.length === 0) return\n e.preventDefault()\n addFiles(pasted)\n }\n\n const hasFiles = (e: React.DragEvent) => Array.from(e.dataTransfer?.types ?? []).includes('Files')\n\n const dropHandlers = allowAttachments\n ? {\n onDragOver: (e: React.DragEvent) => {\n if (!hasFiles(e) || disabled) return\n e.preventDefault()\n setDragging(true)\n },\n onDragLeave: (e: React.DragEvent) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return\n setDragging(false)\n },\n onDrop: (e: React.DragEvent) => {\n setDragging(false)\n const dropped = Array.from(e.dataTransfer?.files ?? [])\n if (dropped.length === 0 || disabled) return\n e.preventDefault()\n addFiles(dropped)\n },\n }\n : {}\n\n return (\n <div\n ref={composerRef}\n className={cn(\n floating\n ? 'border-t border-border/50 bg-transparent px-3 py-2'\n : 'border-t border-border p-3',\n dragging && 'bg-muted/60 outline-dashed outline-2 -outline-offset-4 outline-primary'\n )}\n data-testid=\"arbi-dm-composer\"\n {...dropHandlers}\n >\n {children}\n {files.length > 0 && (\n <ul className=\"mb-2 flex flex-wrap gap-2\" aria-label=\"Attached files\">\n {files.map((f, index) => (\n <li\n key={`${f.name}-${index}`}\n data-testid=\"arbi-dm-attachment-chip\"\n className=\"flex max-w-full items-center gap-2 rounded-md border border-border/70 bg-muted/30 px-2.5 py-1.5 text-xs\"\n >\n <Paperclip className=\"size-3 shrink-0\" aria-hidden=\"true\" />\n <span className=\"truncate\">{f.name}</span>\n <span className=\"shrink-0 text-muted-foreground\">{formatFileSize(f.size)}</span>\n <button\n type=\"button\"\n disabled={busy}\n aria-label={`Remove ${f.name}`}\n onClick={() => removeFile(index)}\n className=\"shrink-0 rounded focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n >\n <X className=\"size-3\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n <div className={cn('flex gap-1.5', floating ? 'items-center' : 'items-end')}>\n {leading}\n {allowAttachments && (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={disabled || busy}\n onClick={() => fileInputRef.current?.click()}\n aria-label=\"Attach files\"\n title=\"Attach files (or paste / drop them here)\"\n data-testid=\"arbi-dm-attach\"\n className=\"min-h-[44px] shrink-0\"\n >\n <Paperclip className=\"size-4\" />\n </Button>\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n hidden\n data-testid=\"arbi-dm-file-input\"\n onChange={(e) => {\n addFiles(Array.from(e.target.files ?? []))\n // Let the same file be picked again after it was removed.\n e.target.value = ''\n }}\n />\n </>\n )}\n <Textarea\n ref={inputRef}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n onPaste={onPaste}\n placeholder={placeholder}\n rows={1}\n disabled={disabled}\n className={cn(\n 'max-h-40 min-h-[44px] resize-none',\n floating &&\n 'min-w-0 flex-1 border-0 bg-transparent px-2 py-3 text-[13px] leading-5 shadow-none placeholder:text-muted-foreground/70 focus-visible:ring-0 focus-visible:ring-offset-0'\n )}\n data-testid=\"arbi-dm-input\"\n />\n {actions}\n <Button\n type=\"button\"\n onClick={() => void submit()}\n disabled={disabled || busy || (!draft.trim() && files.length === 0)}\n className={cn(\n classNames?.sendButton,\n floating &&\n 'size-9 min-h-9 shrink-0 rounded-full p-0 shadow-sm transition-transform hover:scale-105 active:scale-95 disabled:bg-muted disabled:text-muted-foreground disabled:opacity-60'\n )}\n data-testid=\"arbi-dm-send\"\n aria-label=\"Send message\"\n >\n {busy ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : floating ? (\n <ArrowUp className=\"size-4\" strokeWidth={2} />\n ) : (\n <Send className=\"size-4\" />\n )}\n {!floating && 'Send'}\n </Button>\n </div>\n {attachError && (\n <p\n className=\"mt-2 text-xs text-destructive\"\n role=\"alert\"\n data-testid=\"arbi-dm-attach-error\"\n >\n {attachError}\n </p>\n )}\n {error && (\n <p className=\"mt-2 text-xs text-destructive\" data-testid=\"arbi-dm-error\">\n {error}\n </p>\n )}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAwKY,SAwBF,UAnBI,KALF;AA7JZ,SAAS,iBAAiB,QAAQ,gBAAgB;AAClD,SAAS,SAAS,SAAS,WAAW,MAAM,SAAS;AACrD,SAAS,OAAO,sBAAsB;AACtC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,UAAU;AAmCZ,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,WAAW,eAAe;AAChC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,MAAM,UAAU,SAAS,QAAQ,EAAE;AACtE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAiB,MAAM,UAAU,SAAS,SAAS,CAAC,CAAC;AAC/E,kBAAgB,MAAM;AACpB,QAAI,SAAU,UAAS,UAAU,EAAE,MAAM,OAAO,MAAM;AAAA,EACxD,GAAG,CAAC,UAAU,OAAO,KAAK,CAAC;AAC3B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,IAAI;AAClE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,WAAW,OA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,gBACT,YAAY;AAAA,gBACZ,YACE;AAAA,cACJ;AAAA,cACA,eAAY;AAAA,cACZ,cAAW;AAAA,cAEV;AAAA,uBACC,oBAAC,WAAQ,WAAU,uBAAsB,IACvC,WACF,oBAAC,WAAQ,WAAU,UAAS,aAAa,GAAG,IAE5C,oBAAC,QAAK,WAAU,UAAS;AAAA,gBAE1B,CAAC,YAAY;AAAA;AAAA;AAAA,UAChB;AAAA,WACF;AAAA,QACC,eACC;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,eAAY;AAAA,YAEX;AAAA;AAAA,QACH;AAAA,QAED,SACC,oBAAC,OAAE,WAAU,iCAAgC,eAAY,iBACtD,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -68,7 +68,8 @@ const EntityPill = forwardRef(function EntityPill2({
|
|
|
68
68
|
{
|
|
69
69
|
className: cn(
|
|
70
70
|
textSizeClass,
|
|
71
|
-
"font-medium tracking-[0.01em] truncate leading-tight min-w-0
|
|
71
|
+
"font-medium tracking-[0.01em] truncate leading-tight min-w-0 decoration-dotted decoration-current/35 underline-offset-4",
|
|
72
|
+
!disabled && (onClick || href) && "group-hover/pill:underline group-focus-visible/pill:underline",
|
|
72
73
|
labelMaxWidth,
|
|
73
74
|
labelClassName
|
|
74
75
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/entities/EntityPill.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * EntityPill Component\n *\n * Base component for pill-style entity displays. Provides consistent styling and\n * interaction patterns. It is plain icon + text (no fill, no border); a\n * dotted underline identifies an in-platform content link; hover reveals extra actions.\n *\n * Pattern: [Icon] [Label] [Optional: secondary text] [MoreVertical when interactive]\n */\n\nimport { useEntityHref } from './links'\nimport React, { forwardRef } from 'react'\nimport { EntityActionsMenu, type EntityAction } from './EntityActionsMenu'\nimport { MoreVertical } from 'lucide-react'\nimport { cn } from '../lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'\n\n/**\n * The one size scale of the entity pills and avatars (`UserEntity`, `TagEntity`, `EntityPill`,\n * `DocumentEntity`, the call tiles...). Each takes the steps it draws: the pill itself has two,\n * `sm` for compact rows and `md` for a primary column or a tab header.\n */\nexport type EntitySize = 'xs' | 'sm' | 'md' | 'lg'\n\ninterface EntityPillProps {\n /** The icon element (Avatar, ShieldIcon, FileIcon, etc.) */\n icon: React.ReactNode\n /** Primary label text */\n label: string\n /** Optional secondary text (e.g., page notation \"p.1\") */\n secondaryText?: React.ReactNode\n\n // Styling\n /** `sm` (default) for compact rows, `md` for a primary column or a tab header. */\n size?: Extract<EntitySize, 'sm' | 'md'>\n /** Shape variant: 'pill' for rounded-full, 'rounded' for rounded-md */\n shape?: 'pill' | 'rounded'\n /** Additional CSS classes */\n className?: string\n style?: React.CSSProperties\n /** Max width for label truncation */\n labelMaxWidth?: string\n /** Extra classes on the label text (e.g. a heavier weight on a card face). */\n labelClassName?: string\n /** When true, the pill fills its container width (`flex w-full`) and the main\n * area flexes + truncates so the trailing control (\u22EF menu) pins to the right\n * edge \u2014 used by the documents table's Document column. Default: shrink-to-fit. */\n fullWidth?: boolean\n /** Emphasise the active reference with text colour and weight. */\n highlight?: boolean\n\n // Behavior\n /** Click handler for main area (icon + label) - primary action */\n onClick?: (e: React.MouseEvent) => void\n /** Click handler for icon only \u2014 when set, only the icon is clickable (not the label) */\n onIconClick?: (e: React.MouseEvent) => void\n /** Click handler for MoreVertical - opens popover/menu. When provided, shows MoreVertical icon */\n onMoreClick?: (e: React.MouseEvent) => void\n /** Custom trailing element (e.g. a \u22EF dropdown menu). Rendered in the same\n * trailing zone as MoreVertical, but as-is \u2014 so it stays outside the pill's\n * primary click area. Takes precedence over `onMoreClick`. */\n moreContent?: React.ReactNode\n /** Link URL - makes the main area an anchor tag */\n href?: string\n /** Copyable entity address when navigation is handled in place. */\n copyHref?: string\n /** A reference whose canonical URL comes from the host entities domain. */\n entityId?: string\n /** Additional contextual operations, alongside the standard Copy link. */\n actions?: EntityAction[]\n /** Whether the pill is disabled */\n disabled?: boolean\n /** For a pill that toggles a state on click: that state, exposed as `aria-pressed`. */\n pressed?: boolean\n\n // Tooltip\n /** Tooltip for main area (describes primary action, e.g., \"View document\") */\n tooltipContent?: React.ReactNode\n\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\n/** Coarse pointers: a 44x44 (or wider, as wide as the pill) hit area centred on the pill. */\nconst PILL_TOUCH_HIT =\n \"pointer-coarse:after:absolute pointer-coarse:after:left-1/2 pointer-coarse:after:top-1/2 pointer-coarse:after:h-11 pointer-coarse:after:w-[max(100%,2.75rem)] pointer-coarse:after:-translate-x-1/2 pointer-coarse:after:-translate-y-1/2 pointer-coarse:after:content-['']\"\n\n/**\n * The main area of a pill with a separate \"more\" control: 44px tall but only as wide as the area,\n * so it never reaches over the \"more\" control and swallows its taps.\n */\nconst MAIN_AREA_TOUCH_HIT =\n \"relative pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:top-1/2 pointer-coarse:after:h-11 pointer-coarse:after:-translate-y-1/2 pointer-coarse:after:content-['']\"\n\nexport const EntityPill = forwardRef<HTMLElement, EntityPillProps>(function EntityPill(\n {\n icon,\n label,\n secondaryText,\n size = 'sm',\n shape = 'rounded',\n className,\n style,\n labelMaxWidth = 'max-w-[320px]',\n labelClassName,\n fullWidth = false,\n highlight = false,\n onClick,\n onIconClick,\n onMoreClick,\n moreContent,\n href,\n copyHref,\n entityId,\n actions,\n disabled = false,\n pressed,\n tooltipContent,\n 'data-testid': testId,\n },\n ref\n) {\n const hostHref = useEntityHref(entityId)\n const primaryRef = React.useRef<HTMLElement | null>(null)\n const shapeClass = shape === 'pill' ? 'rounded-full' : 'rounded-md'\n\n // Size-based classes\n const sizeClasses = size === 'md' ? 'gap-1.5 px-1.5 py-0.5' : 'gap-1 px-1'\n const textSizeClass = size === 'md' ? 'text-base' : 'text-sm'\n\n const baseClasses = cn(\n 'group/pill items-center',\n fullWidth ? 'flex w-full' : 'inline-flex',\n sizeClasses,\n shapeClass,\n 'min-w-0 max-w-full align-middle',\n 'transition-colors',\n className\n )\n\n // Coarse pointers: an invisible hit area of at least 44x44 centred on the pill (the pill itself\n // stays compact). Centred and sized, not inset: an absolute box is laid out against the padding\n // box, so `-inset-y-3` on a bordered 20px pill gave 42px, and an icon-only pill stayed 22px wide.\n const interactiveClasses = cn('relative cursor-pointer', PILL_TOUCH_HIT)\n const disabledClasses = 'cursor-default opacity-60'\n const highlightClasses = 'text-primary font-semibold'\n\n // Main content (icon + label + secondary text)\n const mainContent = (\n <>\n {onIconClick ? (\n <span\n role=\"button\"\n tabIndex={0}\n className=\"flex-shrink-0 cursor-pointer hover:opacity-70 transition-opacity\"\n onClick={(e) => {\n e.stopPropagation()\n onIconClick(e)\n }}\n >\n {icon}\n </span>\n ) : (\n icon\n )}\n <span\n className={cn(\n textSizeClass,\n 'font-medium tracking-[0.01em] truncate leading-tight min-w-0 underline decoration-dotted decoration-current/35 underline-offset-4',\n labelMaxWidth,\n labelClassName\n )}\n >\n {label}\n </span>\n {secondaryText && (\n <span className=\"text-xs text-muted-foreground flex-shrink-0 leading-none\">\n {secondaryText}\n </span>\n )}\n </>\n )\n\n // Helper: wrap any content in a Tooltip (no asChild \u2014 TooltipTrigger renders its own button)\n const tooltipWrap = (\n content: React.ReactNode,\n tip: React.ReactNode,\n side: 'top' | 'bottom' | 'left' | 'right' = 'bottom',\n triggerClassName?: string,\n triggerProps?: Record<string, unknown>\n ) => (\n <Tooltip>\n <TooltipTrigger\n onFocusCapture={(e) => e.stopPropagation()}\n className={triggerClassName}\n {...triggerProps}\n >\n {content}\n </TooltipTrigger>\n <TooltipContent side={side} className=\"p-2\">\n {tip}\n </TooltipContent>\n </Tooltip>\n )\n\n // With a separate \"more\" control the touch hit area must grow on the MAIN area only: an overlay on\n // the whole pill would sit above both inner buttons and swallow their taps.\n const mainAreaClass = cn('inline-flex min-w-0 items-center gap-1', fullWidth && 'flex-1')\n const mainAreaTouchClass = cn(\n mainAreaClass,\n (onClick || href) && !disabled && MAIN_AREA_TOUCH_HIT\n )\n\n const entityHref = copyHref ?? href ?? hostHref\n const defaultMenu =\n entityHref && !disabled ? (\n <EntityActionsMenu\n label={label}\n href={entityHref}\n actions={[\n ...(onClick || href\n ? [\n {\n id: 'open',\n label: 'Open',\n onSelect: () => {\n if (onClick) primaryRef.current?.click()\n else if (href) window.open(href, '_blank', 'noopener,noreferrer')\n },\n },\n ]\n : []),\n ...(actions ?? []),\n ]}\n />\n ) : null\n const trailing = moreContent ?? (onMoreClick ? null : defaultMenu)\n if (onMoreClick || trailing) {\n let mainArea: React.ReactNode\n if (tooltipContent && !href) {\n mainArea = tooltipWrap(\n mainContent,\n tooltipContent,\n 'bottom',\n cn(mainAreaTouchClass, disabled && 'opacity-60'),\n {\n ref: (el: HTMLElement | null) => {\n primaryRef.current = el\n },\n type: 'button',\n onClick: href ? onClick : disabled ? undefined : onClick,\n disabled: disabled || undefined,\n 'aria-pressed': href ? undefined : pressed,\n }\n )\n } else if (href) {\n mainArea = (\n <a\n ref={(el) => {\n primaryRef.current = el\n }}\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={mainAreaTouchClass}\n onClick={onClick}\n >\n {mainContent}\n </a>\n )\n } else if (onClick) {\n mainArea = (\n <button\n ref={(el) => {\n primaryRef.current = el\n }}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n aria-pressed={pressed}\n className={cn(mainAreaClass, MAIN_AREA_TOUCH_HIT, disabled && 'opacity-60')}\n >\n {mainContent}\n </button>\n )\n } else {\n mainArea = <span className={mainAreaTouchClass}>{mainContent}</span>\n }\n\n const moreArea = trailing ? (\n <span className=\"flex-shrink-0 leading-none opacity-0 transition-opacity group-hover/pill:opacity-100 group-focus-within/pill:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100\">\n {trailing}\n </span>\n ) : (\n tooltipWrap(\n <MoreVertical className=\"w-3.5 h-3.5\" />,\n 'Click for more',\n 'bottom',\n 'flex-shrink-0 leading-none text-muted-foreground hover:text-foreground opacity-0 group-hover/pill:opacity-100 group-focus-within/pill:opacity-100 pointer-coarse:opacity-100',\n {\n type: 'button',\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onMoreClick?.(e)\n },\n }\n )\n )\n\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(\n baseClasses,\n (onClick || href) && !disabled && 'cursor-pointer',\n highlight && highlightClasses\n )}\n style={style}\n data-testid={testId}\n >\n {mainArea}\n {moreArea}\n </span>\n )\n }\n\n if (tooltipContent) {\n if (href) {\n return tooltipWrap(\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={mainAreaClass}\n onClick={onClick}\n >\n {mainContent}\n </a>,\n tooltipContent,\n 'bottom',\n cn(baseClasses, interactiveClasses),\n { 'data-testid': testId, style }\n )\n }\n\n return tooltipWrap(\n mainContent,\n tooltipContent,\n 'bottom',\n cn(\n baseClasses,\n onClick && !disabled ? interactiveClasses : '',\n disabled ? disabledClasses : '',\n highlight && highlightClasses\n ),\n {\n type: 'button',\n ref: ref as React.Ref<HTMLButtonElement>,\n onClick: onClick && !disabled ? onClick : undefined,\n disabled: disabled || undefined,\n 'aria-pressed': pressed,\n 'data-testid': testId,\n style,\n }\n )\n }\n\n if (href) {\n return (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(baseClasses, interactiveClasses)}\n style={style}\n data-testid={testId}\n onClick={onClick}\n >\n {mainContent}\n </a>\n )\n }\n\n if (onClick) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n aria-pressed={pressed}\n className={cn(\n baseClasses,\n disabled ? disabledClasses : interactiveClasses,\n highlight && highlightClasses\n )}\n style={style}\n data-testid={testId}\n >\n {mainContent}\n </button>\n )\n }\n\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(baseClasses, highlight && highlightClasses)}\n style={style}\n data-testid={testId}\n >\n {mainContent}\n </span>\n )\n})\n"],
|
|
5
|
-
"mappings": "AAqJI,mBAEI,KAFJ;AA3IJ,SAAS,qBAAqB;AAC9B,OAAO,SAAS,kBAAkB;AAClC,SAAS,yBAA4C;AACrD,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,SAAS,gBAAgB,sBAAsB;AAqExD,MAAM,iBACJ;AAMF,MAAM,sBACJ;AAEK,MAAM,aAAa,WAAyC,SAASA,YAC1E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GACA,KACA;AACA,QAAM,WAAW,cAAc,QAAQ;AACvC,QAAM,aAAa,MAAM,OAA2B,IAAI;AACxD,QAAM,aAAa,UAAU,SAAS,iBAAiB;AAGvD,QAAM,cAAc,SAAS,OAAO,0BAA0B;AAC9D,QAAM,gBAAgB,SAAS,OAAO,cAAc;AAEpD,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,YAAY,gBAAgB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAKA,QAAM,qBAAqB,GAAG,2BAA2B,cAAc;AACvE,QAAM,kBAAkB;AACxB,QAAM,mBAAmB;AAGzB,QAAM,cACJ,iCACG;AAAA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;AAAA,UAC7B,aAAa;AAAA,QACf;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QAEZ;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,aAAa,gBAAgB;AAAA,MACxD;AAAA,MACA,eAAa;AAAA,MAEZ;AAAA;AAAA,EACH;AAEJ,CAAC;",
|
|
4
|
+
"sourcesContent": ["/**\n * EntityPill Component\n *\n * Base component for pill-style entity displays. Provides consistent styling and\n * interaction patterns. It is plain icon + text (no fill, no border); a\n * hover underlines an actionable content link and reveals extra actions.\n *\n * Pattern: [Icon] [Label] [Optional: secondary text] [MoreVertical when interactive]\n */\n\nimport { useEntityHref } from './links'\nimport React, { forwardRef } from 'react'\nimport { EntityActionsMenu, type EntityAction } from './EntityActionsMenu'\nimport { MoreVertical } from 'lucide-react'\nimport { cn } from '../lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'\n\n/**\n * The one size scale of the entity pills and avatars (`UserEntity`, `TagEntity`, `EntityPill`,\n * `DocumentEntity`, the call tiles...). Each takes the steps it draws: the pill itself has two,\n * `sm` for compact rows and `md` for a primary column or a tab header.\n */\nexport type EntitySize = 'xs' | 'sm' | 'md' | 'lg'\n\ninterface EntityPillProps {\n /** The icon element (Avatar, ShieldIcon, FileIcon, etc.) */\n icon: React.ReactNode\n /** Primary label text */\n label: string\n /** Optional secondary text (e.g., page notation \"p.1\") */\n secondaryText?: React.ReactNode\n\n // Styling\n /** `sm` (default) for compact rows, `md` for a primary column or a tab header. */\n size?: Extract<EntitySize, 'sm' | 'md'>\n /** Shape variant: 'pill' for rounded-full, 'rounded' for rounded-md */\n shape?: 'pill' | 'rounded'\n /** Additional CSS classes */\n className?: string\n style?: React.CSSProperties\n /** Max width for label truncation */\n labelMaxWidth?: string\n /** Extra classes on the label text (e.g. a heavier weight on a card face). */\n labelClassName?: string\n /** When true, the pill fills its container width (`flex w-full`) and the main\n * area flexes + truncates so the trailing control (\u22EF menu) pins to the right\n * edge \u2014 used by the documents table's Document column. Default: shrink-to-fit. */\n fullWidth?: boolean\n /** Emphasise the active reference with text colour and weight. */\n highlight?: boolean\n\n // Behavior\n /** Click handler for main area (icon + label) - primary action */\n onClick?: (e: React.MouseEvent) => void\n /** Click handler for icon only \u2014 when set, only the icon is clickable (not the label) */\n onIconClick?: (e: React.MouseEvent) => void\n /** Click handler for MoreVertical - opens popover/menu. When provided, shows MoreVertical icon */\n onMoreClick?: (e: React.MouseEvent) => void\n /** Custom trailing element (e.g. a \u22EF dropdown menu). Rendered in the same\n * trailing zone as MoreVertical, but as-is \u2014 so it stays outside the pill's\n * primary click area. Takes precedence over `onMoreClick`. */\n moreContent?: React.ReactNode\n /** Link URL - makes the main area an anchor tag */\n href?: string\n /** Copyable entity address when navigation is handled in place. */\n copyHref?: string\n /** A reference whose canonical URL comes from the host entities domain. */\n entityId?: string\n /** Additional contextual operations, alongside the standard Copy link. */\n actions?: EntityAction[]\n /** Whether the pill is disabled */\n disabled?: boolean\n /** For a pill that toggles a state on click: that state, exposed as `aria-pressed`. */\n pressed?: boolean\n\n // Tooltip\n /** Tooltip for main area (describes primary action, e.g., \"View document\") */\n tooltipContent?: React.ReactNode\n\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\n/** Coarse pointers: a 44x44 (or wider, as wide as the pill) hit area centred on the pill. */\nconst PILL_TOUCH_HIT =\n \"pointer-coarse:after:absolute pointer-coarse:after:left-1/2 pointer-coarse:after:top-1/2 pointer-coarse:after:h-11 pointer-coarse:after:w-[max(100%,2.75rem)] pointer-coarse:after:-translate-x-1/2 pointer-coarse:after:-translate-y-1/2 pointer-coarse:after:content-['']\"\n\n/**\n * The main area of a pill with a separate \"more\" control: 44px tall but only as wide as the area,\n * so it never reaches over the \"more\" control and swallows its taps.\n */\nconst MAIN_AREA_TOUCH_HIT =\n \"relative pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:top-1/2 pointer-coarse:after:h-11 pointer-coarse:after:-translate-y-1/2 pointer-coarse:after:content-['']\"\n\nexport const EntityPill = forwardRef<HTMLElement, EntityPillProps>(function EntityPill(\n {\n icon,\n label,\n secondaryText,\n size = 'sm',\n shape = 'rounded',\n className,\n style,\n labelMaxWidth = 'max-w-[320px]',\n labelClassName,\n fullWidth = false,\n highlight = false,\n onClick,\n onIconClick,\n onMoreClick,\n moreContent,\n href,\n copyHref,\n entityId,\n actions,\n disabled = false,\n pressed,\n tooltipContent,\n 'data-testid': testId,\n },\n ref\n) {\n const hostHref = useEntityHref(entityId)\n const primaryRef = React.useRef<HTMLElement | null>(null)\n const shapeClass = shape === 'pill' ? 'rounded-full' : 'rounded-md'\n\n // Size-based classes\n const sizeClasses = size === 'md' ? 'gap-1.5 px-1.5 py-0.5' : 'gap-1 px-1'\n const textSizeClass = size === 'md' ? 'text-base' : 'text-sm'\n\n const baseClasses = cn(\n 'group/pill items-center',\n fullWidth ? 'flex w-full' : 'inline-flex',\n sizeClasses,\n shapeClass,\n 'min-w-0 max-w-full align-middle',\n 'transition-colors',\n className\n )\n\n // Coarse pointers: an invisible hit area of at least 44x44 centred on the pill (the pill itself\n // stays compact). Centred and sized, not inset: an absolute box is laid out against the padding\n // box, so `-inset-y-3` on a bordered 20px pill gave 42px, and an icon-only pill stayed 22px wide.\n const interactiveClasses = cn('relative cursor-pointer', PILL_TOUCH_HIT)\n const disabledClasses = 'cursor-default opacity-60'\n const highlightClasses = 'text-primary font-semibold'\n\n // Main content (icon + label + secondary text)\n const mainContent = (\n <>\n {onIconClick ? (\n <span\n role=\"button\"\n tabIndex={0}\n className=\"flex-shrink-0 cursor-pointer hover:opacity-70 transition-opacity\"\n onClick={(e) => {\n e.stopPropagation()\n onIconClick(e)\n }}\n >\n {icon}\n </span>\n ) : (\n icon\n )}\n <span\n className={cn(\n textSizeClass,\n 'font-medium tracking-[0.01em] truncate leading-tight min-w-0 decoration-dotted decoration-current/35 underline-offset-4',\n !disabled &&\n (onClick || href) &&\n 'group-hover/pill:underline group-focus-visible/pill:underline',\n labelMaxWidth,\n labelClassName\n )}\n >\n {label}\n </span>\n {secondaryText && (\n <span className=\"text-xs text-muted-foreground flex-shrink-0 leading-none\">\n {secondaryText}\n </span>\n )}\n </>\n )\n\n // Helper: wrap any content in a Tooltip (no asChild \u2014 TooltipTrigger renders its own button)\n const tooltipWrap = (\n content: React.ReactNode,\n tip: React.ReactNode,\n side: 'top' | 'bottom' | 'left' | 'right' = 'bottom',\n triggerClassName?: string,\n triggerProps?: Record<string, unknown>\n ) => (\n <Tooltip>\n <TooltipTrigger\n onFocusCapture={(e) => e.stopPropagation()}\n className={triggerClassName}\n {...triggerProps}\n >\n {content}\n </TooltipTrigger>\n <TooltipContent side={side} className=\"p-2\">\n {tip}\n </TooltipContent>\n </Tooltip>\n )\n\n // With a separate \"more\" control the touch hit area must grow on the MAIN area only: an overlay on\n // the whole pill would sit above both inner buttons and swallow their taps.\n const mainAreaClass = cn('inline-flex min-w-0 items-center gap-1', fullWidth && 'flex-1')\n const mainAreaTouchClass = cn(\n mainAreaClass,\n (onClick || href) && !disabled && MAIN_AREA_TOUCH_HIT\n )\n\n const entityHref = copyHref ?? href ?? hostHref\n const defaultMenu =\n entityHref && !disabled ? (\n <EntityActionsMenu\n label={label}\n href={entityHref}\n actions={[\n ...(onClick || href\n ? [\n {\n id: 'open',\n label: 'Open',\n onSelect: () => {\n if (onClick) primaryRef.current?.click()\n else if (href) window.open(href, '_blank', 'noopener,noreferrer')\n },\n },\n ]\n : []),\n ...(actions ?? []),\n ]}\n />\n ) : null\n const trailing = moreContent ?? (onMoreClick ? null : defaultMenu)\n if (onMoreClick || trailing) {\n let mainArea: React.ReactNode\n if (tooltipContent && !href) {\n mainArea = tooltipWrap(\n mainContent,\n tooltipContent,\n 'bottom',\n cn(mainAreaTouchClass, disabled && 'opacity-60'),\n {\n ref: (el: HTMLElement | null) => {\n primaryRef.current = el\n },\n type: 'button',\n onClick: href ? onClick : disabled ? undefined : onClick,\n disabled: disabled || undefined,\n 'aria-pressed': href ? undefined : pressed,\n }\n )\n } else if (href) {\n mainArea = (\n <a\n ref={(el) => {\n primaryRef.current = el\n }}\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={mainAreaTouchClass}\n onClick={onClick}\n >\n {mainContent}\n </a>\n )\n } else if (onClick) {\n mainArea = (\n <button\n ref={(el) => {\n primaryRef.current = el\n }}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n aria-pressed={pressed}\n className={cn(mainAreaClass, MAIN_AREA_TOUCH_HIT, disabled && 'opacity-60')}\n >\n {mainContent}\n </button>\n )\n } else {\n mainArea = <span className={mainAreaTouchClass}>{mainContent}</span>\n }\n\n const moreArea = trailing ? (\n <span className=\"flex-shrink-0 leading-none opacity-0 transition-opacity group-hover/pill:opacity-100 group-focus-within/pill:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100\">\n {trailing}\n </span>\n ) : (\n tooltipWrap(\n <MoreVertical className=\"w-3.5 h-3.5\" />,\n 'Click for more',\n 'bottom',\n 'flex-shrink-0 leading-none text-muted-foreground hover:text-foreground opacity-0 group-hover/pill:opacity-100 group-focus-within/pill:opacity-100 pointer-coarse:opacity-100',\n {\n type: 'button',\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onMoreClick?.(e)\n },\n }\n )\n )\n\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(\n baseClasses,\n (onClick || href) && !disabled && 'cursor-pointer',\n highlight && highlightClasses\n )}\n style={style}\n data-testid={testId}\n >\n {mainArea}\n {moreArea}\n </span>\n )\n }\n\n if (tooltipContent) {\n if (href) {\n return tooltipWrap(\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={mainAreaClass}\n onClick={onClick}\n >\n {mainContent}\n </a>,\n tooltipContent,\n 'bottom',\n cn(baseClasses, interactiveClasses),\n { 'data-testid': testId, style }\n )\n }\n\n return tooltipWrap(\n mainContent,\n tooltipContent,\n 'bottom',\n cn(\n baseClasses,\n onClick && !disabled ? interactiveClasses : '',\n disabled ? disabledClasses : '',\n highlight && highlightClasses\n ),\n {\n type: 'button',\n ref: ref as React.Ref<HTMLButtonElement>,\n onClick: onClick && !disabled ? onClick : undefined,\n disabled: disabled || undefined,\n 'aria-pressed': pressed,\n 'data-testid': testId,\n style,\n }\n )\n }\n\n if (href) {\n return (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(baseClasses, interactiveClasses)}\n style={style}\n data-testid={testId}\n onClick={onClick}\n >\n {mainContent}\n </a>\n )\n }\n\n if (onClick) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n aria-pressed={pressed}\n className={cn(\n baseClasses,\n disabled ? disabledClasses : interactiveClasses,\n highlight && highlightClasses\n )}\n style={style}\n data-testid={testId}\n >\n {mainContent}\n </button>\n )\n }\n\n return (\n <span\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(baseClasses, highlight && highlightClasses)}\n style={style}\n data-testid={testId}\n >\n {mainContent}\n </span>\n )\n})\n"],
|
|
5
|
+
"mappings": "AAqJI,mBAEI,KAFJ;AA3IJ,SAAS,qBAAqB;AAC9B,OAAO,SAAS,kBAAkB;AAClC,SAAS,yBAA4C;AACrD,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,SAAS,gBAAgB,sBAAsB;AAqExD,MAAM,iBACJ;AAMF,MAAM,sBACJ;AAEK,MAAM,aAAa,WAAyC,SAASA,YAC1E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ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AAAA,MACf;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN;AAAA,QACA,SAAS,WAAW,CAAC,WAAW,UAAU;AAAA,QAC1C,UAAU,YAAY;AAAA,QACtB,gBAAgB;AAAA,QAChB,eAAe;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,MAAM;AACR,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAW,GAAG,aAAa,kBAAkB;AAAA,QAC7C;AAAA,QACA,eAAa;AAAA,QACb;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,SAAS,WAAW,SAAY;AAAA,QAChC;AAAA,QACA,gBAAc;AAAA,QACd,WAAW;AAAA,UACT;AAAA,UACA,WAAW,kBAAkB;AAAA,UAC7B,aAAa;AAAA,QACf;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QAEZ;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,aAAa,gBAAgB;AAAA,MACxD;AAAA,MACA,eAAa;AAAA,MAEZ;AAAA;AAAA,EACH;AAEJ,CAAC;",
|
|
6
6
|
"names": ["EntityPill"]
|
|
7
7
|
}
|
|
@@ -173,14 +173,23 @@ const UserEntity = memo(function UserEntity2({
|
|
|
173
173
|
}
|
|
174
174
|
) });
|
|
175
175
|
if (variant === "pill") {
|
|
176
|
+
const clickable = interactive && !!onClick;
|
|
176
177
|
const row = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
178
|
pillAvatar,
|
|
178
|
-
displayName && /* @__PURE__ */ jsx(
|
|
179
|
+
displayName && /* @__PURE__ */ jsx(
|
|
180
|
+
"span",
|
|
181
|
+
{
|
|
182
|
+
className: cn(
|
|
183
|
+
"min-w-0 max-w-[320px] truncate text-sm font-medium tracking-[0.01em] decoration-dotted decoration-current/35 underline-offset-4 leading-tight",
|
|
184
|
+
clickable && "group-hover/pill:underline group-focus-visible/pill:underline"
|
|
185
|
+
),
|
|
186
|
+
children: displayName
|
|
187
|
+
}
|
|
188
|
+
),
|
|
179
189
|
isVerified && !isAgent && /* @__PURE__ */ jsx(VerifiedBadge, {}),
|
|
180
190
|
agentBadge
|
|
181
191
|
] });
|
|
182
192
|
const rowClass = "group/pill inline-flex min-w-0 items-center gap-2";
|
|
183
|
-
const clickable = interactive && !!onClick;
|
|
184
193
|
const clickableClass = "relative cursor-pointer rounded-md px-1 py-0.5 -mx-1 transition-colors pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
185
194
|
if (resolvedTooltip) {
|
|
186
195
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/entities/UserEntity.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * UserEntity Component\n *\n * Single source of truth for the user pill/avatar visual, promoted from the ARBI\n * app and DECOUPLED from the app store/API. It renders purely from injected,\n * already-resolved props \u2014 the app-coupled bits (current user, WebSocket presence\n * status, shared-workspace / agent-owner lookups) are resolved by the app adapter\n * and passed in as `isMe` / `displayStatus` / `tooltipContent` / `onClick`.\n *\n * Variants:\n * - pill: Avatar + name in a rounded container (default)\n * - icon: Avatar circle with hover tooltip\n *\n * Status-dot colours use the semantic `--color-status-*` token contract (see the\n * consuming app's @theme); they are seeded to the app's prior palette so the dots\n * stay pixel-identical.\n */\n\nimport React, { memo } from 'react'\nimport { MessageCircleMore } from 'lucide-react'\nimport { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar'\nimport { ArbiBotHeadIcon } from '../icons/ArbiBotHeadIcon'\nimport { VerifiedBadge } from './VerifiedBadge'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'\nimport { cn } from '../lib/utils'\nimport { useEntityHref } from './links'\nimport { EntityPill, type EntitySize } from './EntityPill'\n\n/** Presence display status - WebSocket states plus 'hidden' for when status is intentionally not shown */\nexport type PresenceDisplayStatus = 'connected' | 'connecting' | 'disconnected' | 'error' | 'hidden'\n\nexport interface UserEntityProps {\n size?: EntitySize\n variant?: 'icon' | 'pill'\n className?: string\n /** When true (default), shows tooltip on hover */\n showTooltip?: boolean\n /** When true (default), clicking triggers the injected action. Set false to disable interaction. */\n interactive?: boolean\n\n /** Two-letter initials shown in the avatar fallback (resolved by the app). */\n initials?: string\n /** Display label \u2014 \"You\" for the current user, else the real name. */\n displayName?: string\n /** Avatar image URL, if any. */\n picture?: string | null\n /** Optional image treatment for platform logos inside the normal avatar. */\n avatarImageClassName?: string\n /** Avatar background colour class for non-agents (e.g. 'bg-blue-500'). */\n colorClass?: string\n /** Whether this user is an agent \u2014 drives the dashed ring + bot badge. */\n isAgent?: boolean\n /** Verified tick (passed an ID check under this name): a badge after the name in the pill. */\n isVerified?: boolean\n /** Inline border/text colour for agent avatars (from the app's agentAvatarColors). */\n agentStyle?: React.CSSProperties\n /**\n * Inline avatar colours for ANY user, not only agents \u2014 e.g. the deterministic\n * tint the DM rows derive from the user id. Takes precedence over\n * `agentStyle`, which predates it and is the same mechanism under a narrower\n * name.\n */\n avatarStyle?: React.CSSProperties\n /** Whether this pill represents the current user \u2014 hides the chat icon and drives\n * which action `onClick` performs. */\n isMe?: boolean\n /** Resolved presence dot state; undefined hides the dot. */\n displayStatus?: PresenceDisplayStatus\n /** Resolved click handler (open settings for me, DM for others). */\n onClick?: (e: React.MouseEvent) => void\n /** Injected rich tooltip content (built by the app adapter). */\n tooltipContent?: React.ReactNode\n /** Render the empty \"no user\" avatar. */\n empty?: boolean\n copyHref?: string\n entityId?: string\n}\n\nconst sizeClasses = {\n xs: 'h-5 w-5',\n sm: 'h-6 w-6',\n md: 'h-8 w-8',\n lg: 'h-10 w-10',\n}\n\nconst textSizeClasses = {\n xs: 'text-xs',\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm',\n}\n\n// Presence dot sizes proportional to avatar size (larger for better visibility)\nconst presenceDotClasses = {\n xs: 'w-2 h-2 border',\n sm: 'w-2.5 h-2.5 border',\n md: 'w-3 h-3 border-2',\n lg: 'w-3.5 h-3.5 border-2',\n}\n\n// Position the presence dot at edge of avatar\nconst presencePositionClasses = {\n xs: '-right-1 bottom-0',\n sm: '-right-1 bottom-0',\n md: '-right-1.5 -bottom-0.5',\n lg: '-right-1.5 -bottom-0.5',\n}\n\n// Presence colours \u2014 semantic status tokens seeded to the app's prior palette\n// (matches the sidebar's connection-status colours).\n/** Accessible name for each dot state \u2014 the same wording PresenceLabel prints. */\nconst PRESENCE_LABELS: Record<PresenceDisplayStatus, string> = {\n connected: 'Online',\n connecting: 'Connecting',\n disconnected: 'Offline',\n error: 'Connection problem',\n hidden: 'Status hidden',\n}\n\nconst presenceColorClasses: Record<PresenceDisplayStatus, string> = {\n connected: 'bg-status-online',\n connecting: 'bg-status-connecting',\n disconnected: 'bg-status-away',\n error: 'bg-status-busy',\n hidden: 'bg-status-offline',\n}\n\nexport const UserEntity = memo(function UserEntity({\n size = 'md',\n variant = 'pill',\n className,\n showTooltip = true,\n interactive = true,\n initials = '',\n displayName = '',\n picture,\n avatarImageClassName,\n colorClass = '',\n isAgent = false,\n isVerified = false,\n agentStyle,\n avatarStyle,\n isMe = false,\n displayStatus,\n onClick,\n tooltipContent,\n empty = false,\n copyHref,\n entityId,\n}: UserEntityProps) {\n const entityHref = useEntityHref(entityId)\n // Empty state - no user\n if (empty) {\n return (\n <Avatar\n className={cn(sizeClasses[size], 'border border-border', className)}\n data-testid=\"user-entity\"\n >\n <AvatarFallback className=\"bg-status-empty text-muted-foreground text-xs font-semibold\">\n ?\n </AvatarFallback>\n </Avatar>\n )\n }\n\n const agentBadge = isAgent ? (\n <ArbiBotHeadIcon className=\"w-3.5 h-3.5 text-muted-foreground\" />\n ) : undefined\n\n // Messaging another user: the pill avatar doubles as the affordance \u2014 on hover it\n // swaps to a chat icon (see pillAvatar below).\n const canMessage = interactive && !isMe && !isAgent\n\n // One resolved inline style for the avatar surface. `agentStyle` was always\n // applied regardless of `isAgent`; `avatarStyle` is the same thing named for\n // what it does, so a non-agent tint no longer has to masquerade as one.\n const surfaceStyle = avatarStyle ?? agentStyle\n\n // Core avatar element - used in both icon and pill variants\n const avatarCore = (\n <Avatar\n className={cn(\n sizeClasses[size],\n isAgent ? 'rounded-full border-2 border-dashed' : 'border border-white'\n )}\n style={surfaceStyle}\n data-testid=\"user-entity\"\n >\n {picture && <AvatarImage src={picture} alt={initials} className={avatarImageClassName} />}\n <AvatarFallback\n className={cn(\n textSizeClasses[size],\n 'font-semibold leading-none',\n isAgent ? 'rounded-full bg-transparent' : `text-white ${colorClass}`\n )}\n style={surfaceStyle}\n >\n {initials}\n </AvatarFallback>\n </Avatar>\n )\n\n // Bottom-right avatar dot: the presence colour (green/grey/\u2026).\n const statusDot = displayStatus ? (\n <span\n className={cn(\n 'absolute rounded-full border-white',\n presenceDotClasses[size],\n presencePositionClasses[size],\n presenceColorClasses[displayStatus]\n )}\n data-testid=\"user-entity-presence\"\n // Named, not just coloured: a colour is legible only to someone who\n // already knows the convention, and to nobody using a screen reader.\n role=\"img\"\n aria-label={PRESENCE_LABELS[displayStatus]}\n title={PRESENCE_LABELS[displayStatus]}\n />\n ) : null\n\n // Icon variant avatar (used in stacks/columns) \u2014 avatar + optional status dot.\n // Inline-block at avatar size so a parent ring stays circular.\n const avatarElement = statusDot ? (\n <div\n className={cn(\n 'relative inline-block',\n sizeClasses[size],\n variant === 'pill' ? '' : className\n )}\n >\n {avatarCore}\n {statusDot}\n </div>\n ) : (\n <div className={cn('inline-block', variant === 'pill' ? '' : className)}>{avatarCore}</div>\n )\n\n // Pill variant avatar \u2014 the avatar itself IS the message affordance: on hover it\n // swaps to a chat icon (for other users), with the status dot pinned bottom-right.\n const pillAvatar = (\n // shrink-0: when the pill is squeezed the NAME truncates away \u2014 the avatar\n // must never collapse under it and overflow onto neighbouring text.\n <span className={cn('relative inline-block shrink-0', sizeClasses[size])}>\n <span className={cn('block transition-opacity', canMessage && 'group-hover/pill:opacity-0')}>\n {avatarCore}\n </span>\n {canMessage && (\n <span\n aria-hidden\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-muted text-foreground opacity-0 transition-opacity group-hover/pill:opacity-100\"\n >\n <MessageCircleMore className={size === 'xs' ? 'h-3 w-3' : 'h-4 w-4'} />\n </span>\n )}\n {statusDot}\n </span>\n )\n\n const resolvedTooltip = showTooltip ? tooltipContent : undefined\n\n // Pill variant \u2014 clean, borderless avatar + name (no container chrome). The avatar\n // itself is the message affordance (hover \u2192 chat icon); unread + presence share one\n // bottom-right dot. Only the agent badge trails the name. Interactivity + tooltip\n // are layered with no resting background \u2014 a subtle hover fill signals the target.\n if (variant === 'pill' && (copyHref || entityHref))\n return (\n <span data-variant=\"pill\">\n <EntityPill\n icon={pillAvatar}\n label={displayName || 'Person'}\n secondaryText={\n <>\n {isVerified && !isAgent && <VerifiedBadge />}\n {agentBadge}\n </>\n }\n copyHref={copyHref || entityHref}\n onClick={interactive ? onClick : undefined}\n tooltipContent={resolvedTooltip}\n className={className}\n data-testid=\"user-entity-pill\"\n />\n </span>\n )\n if (variant === 'pill') {\n const row = (\n <>\n {pillAvatar}\n {displayName && (\n <span className=\"min-w-0 max-w-[320px] truncate text-sm font-medium tracking-[0.01em] underline decoration-dotted decoration-current/35 underline-offset-4 leading-tight\">\n {displayName}\n </span>\n )}\n {isVerified && !isAgent && <VerifiedBadge />}\n {agentBadge}\n </>\n )\n const rowClass = 'group/pill inline-flex min-w-0 items-center gap-2'\n const clickable = interactive && !!onClick\n const clickableClass =\n \"relative cursor-pointer rounded-md px-1 py-0.5 -mx-1 transition-colors pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n\n if (resolvedTooltip) {\n return (\n <Tooltip>\n <TooltipTrigger\n type=\"button\"\n onClick={clickable ? onClick : undefined}\n onFocusCapture={(e) => e.stopPropagation()}\n className={cn(rowClass, clickable && clickableClass, className)}\n data-testid=\"user-entity-pill\"\n >\n {row}\n </TooltipTrigger>\n <TooltipContent className=\"p-2\">{resolvedTooltip}</TooltipContent>\n </Tooltip>\n )\n }\n\n if (clickable) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(rowClass, clickableClass, className)}\n data-testid=\"user-entity-pill\"\n >\n {row}\n </button>\n )\n }\n\n return (\n <span className={cn(rowClass, className)} data-testid=\"user-entity-pill\">\n {row}\n </span>\n )\n }\n\n // Icon variant - always non-interactive, just show avatar with optional tooltip\n // Note: avoid asChild here \u2014 Radix ref merging with Avatar's internal refs causes infinite loops\n if (showTooltip) {\n return (\n <Tooltip>\n <TooltipTrigger\n onFocusCapture={(e) => e.stopPropagation()}\n className=\"touch-hit inline-flex\"\n >\n {avatarElement}\n </TooltipTrigger>\n <TooltipContent className=\"p-2\">{tooltipContent}</TooltipContent>\n </Tooltip>\n )\n }\n\n return avatarElement\n})\n"],
|
|
5
|
-
"mappings": "AA8JQ,SAiHI,UAjHJ,KAsBJ,YAtBI;AA5IR,SAAgB,YAAY;AAC5B,SAAS,yBAAyB;AAClC,SAAS,QAAQ,gBAAgB,mBAAmB;AACpD,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAC9B,SAAS,kBAAmC;AAoD5C,MAAM,cAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAkB;AAAA,EACtB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA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,iBAAiB;AAMvD,MAAI,YAAY,WAAW,YAAY;AACrC,WACE,oBAAC,UAAK,gBAAa,QACjB;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,OAAO,eAAe;AAAA,QACtB,eACE,iCACG;AAAA,wBAAc,CAAC,WAAW,oBAAC,iBAAc;AAAA,UACzC;AAAA,WACH;AAAA,QAEF,UAAU,YAAY;AAAA,QACtB,SAAS,cAAc,UAAU;AAAA,QACjC,gBAAgB;AAAA,QAChB;AAAA,QACA,eAAY;AAAA;AAAA,IACd,GACF;AAEJ,MAAI,YAAY,QAAQ;AACtB,UAAM,MACJ,iCACG;AAAA;AAAA,MACA,eACC,
|
|
4
|
+
"sourcesContent": ["/**\n * UserEntity Component\n *\n * Single source of truth for the user pill/avatar visual, promoted from the ARBI\n * app and DECOUPLED from the app store/API. It renders purely from injected,\n * already-resolved props \u2014 the app-coupled bits (current user, WebSocket presence\n * status, shared-workspace / agent-owner lookups) are resolved by the app adapter\n * and passed in as `isMe` / `displayStatus` / `tooltipContent` / `onClick`.\n *\n * Variants:\n * - pill: Avatar + name in a rounded container (default)\n * - icon: Avatar circle with hover tooltip\n *\n * Status-dot colours use the semantic `--color-status-*` token contract (see the\n * consuming app's @theme); they are seeded to the app's prior palette so the dots\n * stay pixel-identical.\n */\n\nimport React, { memo } from 'react'\nimport { MessageCircleMore } from 'lucide-react'\nimport { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar'\nimport { ArbiBotHeadIcon } from '../icons/ArbiBotHeadIcon'\nimport { VerifiedBadge } from './VerifiedBadge'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'\nimport { cn } from '../lib/utils'\nimport { useEntityHref } from './links'\nimport { EntityPill, type EntitySize } from './EntityPill'\n\n/** Presence display status - WebSocket states plus 'hidden' for when status is intentionally not shown */\nexport type PresenceDisplayStatus = 'connected' | 'connecting' | 'disconnected' | 'error' | 'hidden'\n\nexport interface UserEntityProps {\n size?: EntitySize\n variant?: 'icon' | 'pill'\n className?: string\n /** When true (default), shows tooltip on hover */\n showTooltip?: boolean\n /** When true (default), clicking triggers the injected action. Set false to disable interaction. */\n interactive?: boolean\n\n /** Two-letter initials shown in the avatar fallback (resolved by the app). */\n initials?: string\n /** Display label \u2014 \"You\" for the current user, else the real name. */\n displayName?: string\n /** Avatar image URL, if any. */\n picture?: string | null\n /** Optional image treatment for platform logos inside the normal avatar. */\n avatarImageClassName?: string\n /** Avatar background colour class for non-agents (e.g. 'bg-blue-500'). */\n colorClass?: string\n /** Whether this user is an agent \u2014 drives the dashed ring + bot badge. */\n isAgent?: boolean\n /** Verified tick (passed an ID check under this name): a badge after the name in the pill. */\n isVerified?: boolean\n /** Inline border/text colour for agent avatars (from the app's agentAvatarColors). */\n agentStyle?: React.CSSProperties\n /**\n * Inline avatar colours for ANY user, not only agents \u2014 e.g. the deterministic\n * tint the DM rows derive from the user id. Takes precedence over\n * `agentStyle`, which predates it and is the same mechanism under a narrower\n * name.\n */\n avatarStyle?: React.CSSProperties\n /** Whether this pill represents the current user \u2014 hides the chat icon and drives\n * which action `onClick` performs. */\n isMe?: boolean\n /** Resolved presence dot state; undefined hides the dot. */\n displayStatus?: PresenceDisplayStatus\n /** Resolved click handler (open settings for me, DM for others). */\n onClick?: (e: React.MouseEvent) => void\n /** Injected rich tooltip content (built by the app adapter). */\n tooltipContent?: React.ReactNode\n /** Render the empty \"no user\" avatar. */\n empty?: boolean\n copyHref?: string\n entityId?: string\n}\n\nconst sizeClasses = {\n xs: 'h-5 w-5',\n sm: 'h-6 w-6',\n md: 'h-8 w-8',\n lg: 'h-10 w-10',\n}\n\nconst textSizeClasses = {\n xs: 'text-xs',\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm',\n}\n\n// Presence dot sizes proportional to avatar size (larger for better visibility)\nconst presenceDotClasses = {\n xs: 'w-2 h-2 border',\n sm: 'w-2.5 h-2.5 border',\n md: 'w-3 h-3 border-2',\n lg: 'w-3.5 h-3.5 border-2',\n}\n\n// Position the presence dot at edge of avatar\nconst presencePositionClasses = {\n xs: '-right-1 bottom-0',\n sm: '-right-1 bottom-0',\n md: '-right-1.5 -bottom-0.5',\n lg: '-right-1.5 -bottom-0.5',\n}\n\n// Presence colours \u2014 semantic status tokens seeded to the app's prior palette\n// (matches the sidebar's connection-status colours).\n/** Accessible name for each dot state \u2014 the same wording PresenceLabel prints. */\nconst PRESENCE_LABELS: Record<PresenceDisplayStatus, string> = {\n connected: 'Online',\n connecting: 'Connecting',\n disconnected: 'Offline',\n error: 'Connection problem',\n hidden: 'Status hidden',\n}\n\nconst presenceColorClasses: Record<PresenceDisplayStatus, string> = {\n connected: 'bg-status-online',\n connecting: 'bg-status-connecting',\n disconnected: 'bg-status-away',\n error: 'bg-status-busy',\n hidden: 'bg-status-offline',\n}\n\nexport const UserEntity = memo(function UserEntity({\n size = 'md',\n variant = 'pill',\n className,\n showTooltip = true,\n interactive = true,\n initials = '',\n displayName = '',\n picture,\n avatarImageClassName,\n colorClass = '',\n isAgent = false,\n isVerified = false,\n agentStyle,\n avatarStyle,\n isMe = false,\n displayStatus,\n onClick,\n tooltipContent,\n empty = false,\n copyHref,\n entityId,\n}: UserEntityProps) {\n const entityHref = useEntityHref(entityId)\n // Empty state - no user\n if (empty) {\n return (\n <Avatar\n className={cn(sizeClasses[size], 'border border-border', className)}\n data-testid=\"user-entity\"\n >\n <AvatarFallback className=\"bg-status-empty text-muted-foreground text-xs font-semibold\">\n ?\n </AvatarFallback>\n </Avatar>\n )\n }\n\n const agentBadge = isAgent ? (\n <ArbiBotHeadIcon className=\"w-3.5 h-3.5 text-muted-foreground\" />\n ) : undefined\n\n // Messaging another user: the pill avatar doubles as the affordance \u2014 on hover it\n // swaps to a chat icon (see pillAvatar below).\n const canMessage = interactive && !isMe && !isAgent\n\n // One resolved inline style for the avatar surface. `agentStyle` was always\n // applied regardless of `isAgent`; `avatarStyle` is the same thing named for\n // what it does, so a non-agent tint no longer has to masquerade as one.\n const surfaceStyle = avatarStyle ?? agentStyle\n\n // Core avatar element - used in both icon and pill variants\n const avatarCore = (\n <Avatar\n className={cn(\n sizeClasses[size],\n isAgent ? 'rounded-full border-2 border-dashed' : 'border border-white'\n )}\n style={surfaceStyle}\n data-testid=\"user-entity\"\n >\n {picture && <AvatarImage src={picture} alt={initials} className={avatarImageClassName} />}\n <AvatarFallback\n className={cn(\n textSizeClasses[size],\n 'font-semibold leading-none',\n isAgent ? 'rounded-full bg-transparent' : `text-white ${colorClass}`\n )}\n style={surfaceStyle}\n >\n {initials}\n </AvatarFallback>\n </Avatar>\n )\n\n // Bottom-right avatar dot: the presence colour (green/grey/\u2026).\n const statusDot = displayStatus ? (\n <span\n className={cn(\n 'absolute rounded-full border-white',\n presenceDotClasses[size],\n presencePositionClasses[size],\n presenceColorClasses[displayStatus]\n )}\n data-testid=\"user-entity-presence\"\n // Named, not just coloured: a colour is legible only to someone who\n // already knows the convention, and to nobody using a screen reader.\n role=\"img\"\n aria-label={PRESENCE_LABELS[displayStatus]}\n title={PRESENCE_LABELS[displayStatus]}\n />\n ) : null\n\n // Icon variant avatar (used in stacks/columns) \u2014 avatar + optional status dot.\n // Inline-block at avatar size so a parent ring stays circular.\n const avatarElement = statusDot ? (\n <div\n className={cn(\n 'relative inline-block',\n sizeClasses[size],\n variant === 'pill' ? '' : className\n )}\n >\n {avatarCore}\n {statusDot}\n </div>\n ) : (\n <div className={cn('inline-block', variant === 'pill' ? '' : className)}>{avatarCore}</div>\n )\n\n // Pill variant avatar \u2014 the avatar itself IS the message affordance: on hover it\n // swaps to a chat icon (for other users), with the status dot pinned bottom-right.\n const pillAvatar = (\n // shrink-0: when the pill is squeezed the NAME truncates away \u2014 the avatar\n // must never collapse under it and overflow onto neighbouring text.\n <span className={cn('relative inline-block shrink-0', sizeClasses[size])}>\n <span className={cn('block transition-opacity', canMessage && 'group-hover/pill:opacity-0')}>\n {avatarCore}\n </span>\n {canMessage && (\n <span\n aria-hidden\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-muted text-foreground opacity-0 transition-opacity group-hover/pill:opacity-100\"\n >\n <MessageCircleMore className={size === 'xs' ? 'h-3 w-3' : 'h-4 w-4'} />\n </span>\n )}\n {statusDot}\n </span>\n )\n\n const resolvedTooltip = showTooltip ? tooltipContent : undefined\n\n // Pill variant \u2014 clean, borderless avatar + name (no container chrome). The avatar\n // itself is the message affordance (hover \u2192 chat icon); unread + presence share one\n // bottom-right dot. Only the agent badge trails the name. Interactivity + tooltip\n // are layered with no resting background \u2014 a subtle hover fill signals the target.\n if (variant === 'pill' && (copyHref || entityHref))\n return (\n <span data-variant=\"pill\">\n <EntityPill\n icon={pillAvatar}\n label={displayName || 'Person'}\n secondaryText={\n <>\n {isVerified && !isAgent && <VerifiedBadge />}\n {agentBadge}\n </>\n }\n copyHref={copyHref || entityHref}\n onClick={interactive ? onClick : undefined}\n tooltipContent={resolvedTooltip}\n className={className}\n data-testid=\"user-entity-pill\"\n />\n </span>\n )\n if (variant === 'pill') {\n const clickable = interactive && !!onClick\n const row = (\n <>\n {pillAvatar}\n {displayName && (\n <span\n className={cn(\n 'min-w-0 max-w-[320px] truncate text-sm font-medium tracking-[0.01em] decoration-dotted decoration-current/35 underline-offset-4 leading-tight',\n clickable && 'group-hover/pill:underline group-focus-visible/pill:underline'\n )}\n >\n {displayName}\n </span>\n )}\n {isVerified && !isAgent && <VerifiedBadge />}\n {agentBadge}\n </>\n )\n const rowClass = 'group/pill inline-flex min-w-0 items-center gap-2'\n const clickableClass =\n \"relative cursor-pointer rounded-md px-1 py-0.5 -mx-1 transition-colors pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n\n if (resolvedTooltip) {\n return (\n <Tooltip>\n <TooltipTrigger\n type=\"button\"\n onClick={clickable ? onClick : undefined}\n onFocusCapture={(e) => e.stopPropagation()}\n className={cn(rowClass, clickable && clickableClass, className)}\n data-testid=\"user-entity-pill\"\n >\n {row}\n </TooltipTrigger>\n <TooltipContent className=\"p-2\">{resolvedTooltip}</TooltipContent>\n </Tooltip>\n )\n }\n\n if (clickable) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(rowClass, clickableClass, className)}\n data-testid=\"user-entity-pill\"\n >\n {row}\n </button>\n )\n }\n\n return (\n <span className={cn(rowClass, className)} data-testid=\"user-entity-pill\">\n {row}\n </span>\n )\n }\n\n // Icon variant - always non-interactive, just show avatar with optional tooltip\n // Note: avoid asChild here \u2014 Radix ref merging with Avatar's internal refs causes infinite loops\n if (showTooltip) {\n return (\n <Tooltip>\n <TooltipTrigger\n onFocusCapture={(e) => e.stopPropagation()}\n className=\"touch-hit inline-flex\"\n >\n {avatarElement}\n </TooltipTrigger>\n <TooltipContent className=\"p-2\">{tooltipContent}</TooltipContent>\n </Tooltip>\n )\n }\n\n return avatarElement\n})\n"],
|
|
5
|
+
"mappings": "AA8JQ,SAiHI,UAjHJ,KAsBJ,YAtBI;AA5IR,SAAgB,YAAY;AAC5B,SAAS,yBAAyB;AAClC,SAAS,QAAQ,gBAAgB,mBAAmB;AACpD,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAC9B,SAAS,kBAAmC;AAoD5C,MAAM,cAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAkB;AAAA,EACtB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,qBAAqB;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,0BAA0B;AAAA,EAC9B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAKA,MAAM,kBAAyD;AAAA,EAC7D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AA,OAClD;AAAA,EAEJ;AAEA,SAAO;AACT,CAAC;",
|
|
6
6
|
"names": ["UserEntity"]
|
|
7
7
|
}
|
|
@@ -1,45 +1,32 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
children: /* @__PURE__ */ jsx("path", { d: "M1038 2434 c-217 -39 -406 -154 -522 -318 -121 -170 -176 -376 -103 -384 l27 -3 0 -106 c0 -88 -3 -108 -17 -118 -15 -11 -16 -18 -5 -66 44 -188 209 -369 420 -459 l65 -28 -74 -7 c-283 -26 -444 -152 -535 -418 -70 -204 -73 -507 -5 -507 4 0 12 75 19 168 18 263 68 419 167 530 78 87 224 162 263 134 9 -6 43 -26 76 -43 224 -117 802 -95 948 38 38 34 165 -22 253 -111 117 -119 168 -268 187 -549 6 -92 15 -167 19 -167 89 0 53 415 -54 627 -88 173 -238 270 -458 295 l-99 11 75 32 c201 88 367 274 406 454 10 47 9 56 -5 66 -13 10 -16 32 -16 118 l0 106 28 3 c91 10 -12 297 -165 459 -202 214 -544 307 -895 243z m472 -84 c170 -43 323 -140 416 -264 47 -61 117 -197 128 -248 l6 -28 -65 0 c-64 0 -65 1 -78 33 -43 102 -109 136 -262 137 l-110 0 -38 -40 c-25 -27 -46 -40 -65 -41 -134 -5 -394 1 -410 10 -11 6 -30 24 -42 41 l-21 30 -112 0 c-156 -1 -219 -33 -262 -136 -14 -34 -14 -34 -80 -34 -76 0 -74 -7 -30 103 96 243 311 406 595 452 118 20 319 13 430 -15z m-561 -505 c97 -50 126 -174 61 -263 -118 -163 -380 -23 -309 165 35 93 162 143 248 98z m799 -15 c129 -96 69 -304 -92 -318 -189 -16 -265 218 -106 326 48 33 149 29 198 -8z m272 -389 c0 -23 -45 -110 -86 -168 -245 -343 -856 -408 -1231 -130 -90 67 -213 236 -213 294 0 11 132 13 765 13 457 0 765 -4 765 -9z" })
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
/* @__PURE__ */ jsxs("g", { transform: "translate(0,250) scale(0.1,-0.1)", fill: "currentColor", stroke: "none", children: [
|
|
34
|
-
/* @__PURE__ */ jsx("path", { d: "M785 1777 c-60 -60 -59 -134 1 -186 92 -82 236 9 204 128 -25 93 -138 125 -205 58z m161 -29 c7 -22 -19 -52 -40 -45 -21 7 -30 35 -17 51 19 23 48 20 57 -6z" }),
|
|
35
|
-
/* @__PURE__ */ jsx("path", { d: "M1591 1803 c-128 -67 -85 -243 60 -243 83 0 141 99 105 178 -32 69 -103 97 -165 65z m127 -59 c4 -25 -19 -47 -41 -38 -22 8 -30 34 -16 51 17 20 53 12 57 -13z" }),
|
|
36
|
-
/* @__PURE__ */ jsx("path", { d: "M843 1347 c-9 -15 9 -63 41 -108 148 -202 565 -209 730 -12 37 44 60 103 47 116 -13 13 -810 17 -818 4z" })
|
|
37
|
-
] })
|
|
38
|
-
] })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
2
|
+
const ArbiBotHeadIcon = ({ size = 24, className = "" }) => /* @__PURE__ */ jsxs(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: size,
|
|
7
|
+
height: size,
|
|
8
|
+
viewBox: "0 0 32 32",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: "2.5",
|
|
12
|
+
strokeLinecap: "round",
|
|
13
|
+
strokeLinejoin: "round",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
focusable: "false",
|
|
16
|
+
className,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx("path", { d: "M4.5 14C4.5 7.65 9.65 4 16 4s11.5 3.65 11.5 10v4c0 6-5.15 10-11.5 10S4.5 24 4.5 18Z" }),
|
|
19
|
+
/* @__PURE__ */ jsx("path", { d: "M4.5 13h2m19 0h2m-13 1h3" }),
|
|
20
|
+
/* @__PURE__ */ jsx("rect", { x: "6.5", y: "10.5", width: "8", height: "7", rx: "3.5" }),
|
|
21
|
+
/* @__PURE__ */ jsx("rect", { x: "17.5", y: "10.5", width: "8", height: "7", rx: "3.5" }),
|
|
22
|
+
/* @__PURE__ */ jsxs("g", { fill: "currentColor", stroke: "none", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("circle", { cx: "10.5", cy: "14", r: "1.25" }),
|
|
24
|
+
/* @__PURE__ */ jsx("circle", { cx: "21.5", cy: "14", r: "1.25" })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx("path", { d: "M11.5 21.5c2.5 2 6.5 2 9 0" })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
43
30
|
export {
|
|
44
31
|
ArbiBotHeadIcon
|
|
45
32
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/icons/ArbiBotHeadIcon.tsx"],
|
|
4
|
-
"sourcesContent": ["import React
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\ninterface ArbiBotHeadIconProps {\n size?: number\n className?: string\n}\n\n/** ARBI's familiar domed head and glasses, simplified for small interface sizes. */\nexport const ArbiBotHeadIcon: React.FC<ArbiBotHeadIconProps> = ({ size = 24, className = '' }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n className={className}\n >\n <path d=\"M4.5 14C4.5 7.65 9.65 4 16 4s11.5 3.65 11.5 10v4c0 6-5.15 10-11.5 10S4.5 24 4.5 18Z\" />\n <path d=\"M4.5 13h2m19 0h2m-13 1h3\" />\n <rect x=\"6.5\" y=\"10.5\" width=\"8\" height=\"7\" rx=\"3.5\" />\n <rect x=\"17.5\" y=\"10.5\" width=\"8\" height=\"7\" rx=\"3.5\" />\n <g fill=\"currentColor\" stroke=\"none\">\n <circle cx=\"10.5\" cy=\"14\" r=\"1.25\" />\n <circle cx=\"21.5\" cy=\"14\" r=\"1.25\" />\n </g>\n <path d=\"M11.5 21.5c2.5 2 6.5 2 9 0\" />\n </svg>\n)\n"],
|
|
5
|
+
"mappings": "AAuBI,cAIA,YAJA;AAfG,MAAM,kBAAkD,CAAC,EAAE,OAAO,IAAI,YAAY,GAAG,MAC1F;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,eAAY;AAAA,IACZ,WAAU;AAAA,IACV;AAAA,IAEA;AAAA,0BAAC,UAAK,GAAE,uFAAsF;AAAA,MAC9F,oBAAC,UAAK,GAAE,4BAA2B;AAAA,MACnC,oBAAC,UAAK,GAAE,OAAM,GAAE,QAAO,OAAM,KAAI,QAAO,KAAI,IAAG,OAAM;AAAA,MACrD,oBAAC,UAAK,GAAE,QAAO,GAAE,QAAO,OAAM,KAAI,QAAO,KAAI,IAAG,OAAM;AAAA,MACtD,qBAAC,OAAE,MAAK,gBAAe,QAAO,QAC5B;AAAA,4BAAC,YAAO,IAAG,QAAO,IAAG,MAAK,GAAE,QAAO;AAAA,QACnC,oBAAC,YAAO,IAAG,QAAO,IAAG,MAAK,GAAE,QAAO;AAAA,SACrC;AAAA,MACA,oBAAC,UAAK,GAAE,8BAA6B;AAAA;AAAA;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|