@arbidocs/react 0.5.75 → 0.5.76

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.
@@ -328,6 +328,7 @@ var EntityPill = forwardRef(function EntityPill2({
328
328
  size = "sm",
329
329
  shape = "rounded",
330
330
  className,
331
+ style,
331
332
  labelMaxWidth = "max-w-[320px]",
332
333
  labelClassName,
333
334
  fullWidth = false,
@@ -467,6 +468,7 @@ var EntityPill = forwardRef(function EntityPill2({
467
468
  (onClick || href) && !disabled && "cursor-pointer hover:bg-muted",
468
469
  highlight && highlightClasses
469
470
  ),
471
+ style,
470
472
  "data-testid": testId,
471
473
  children: [
472
474
  mainArea,
@@ -492,7 +494,7 @@ var EntityPill = forwardRef(function EntityPill2({
492
494
  tooltipContent,
493
495
  tooltipSide,
494
496
  cn(baseClasses, interactiveClasses),
495
- { "data-testid": testId }
497
+ { "data-testid": testId, style }
496
498
  );
497
499
  }
498
500
  return tooltipWrap(
@@ -510,7 +512,8 @@ var EntityPill = forwardRef(function EntityPill2({
510
512
  ref,
511
513
  onClick: onClick && !disabled ? onClick : void 0,
512
514
  disabled: disabled || void 0,
513
- "data-testid": testId
515
+ "data-testid": testId,
516
+ style
514
517
  }
515
518
  );
516
519
  }
@@ -523,6 +526,7 @@ var EntityPill = forwardRef(function EntityPill2({
523
526
  target: "_blank",
524
527
  rel: "noopener noreferrer",
525
528
  className: cn(baseClasses, interactiveClasses),
529
+ style,
526
530
  "data-testid": testId,
527
531
  onClick,
528
532
  children: mainContent
@@ -542,6 +546,7 @@ var EntityPill = forwardRef(function EntityPill2({
542
546
  disabled ? disabledClasses : interactiveClasses,
543
547
  highlight && highlightClasses
544
548
  ),
549
+ style,
545
550
  "data-testid": testId,
546
551
  children: mainContent
547
552
  }
@@ -552,6 +557,7 @@ var EntityPill = forwardRef(function EntityPill2({
552
557
  {
553
558
  ref,
554
559
  className: cn(baseClasses, highlight && highlightClasses),
560
+ style,
555
561
  "data-testid": testId,
556
562
  children: mainContent
557
563
  }
@@ -1367,6 +1373,63 @@ function DocumentCard({
1367
1373
  }
1368
1374
  );
1369
1375
  }
1376
+
1377
+ // src/entities/colors.ts
1378
+ var OPACITY_LIGHT = 0.15;
1379
+ var OPACITY_MEDIUM = 1;
1380
+ var OPACITY_BORDER = 0.3;
1381
+ var PLACEHOLDER_COLOR = "#9ca3af";
1382
+ var NEUTRAL_GRAY2 = "#64748b";
1383
+ var BASE_COLORS = {
1384
+ "0": "#10b981",
1385
+ "1": "#3b82f6",
1386
+ "2": "#8b5cf6",
1387
+ "3": "#f43f5e",
1388
+ "4": "#f59e0b",
1389
+ "5": "#84cc16",
1390
+ "6": "#a855f7",
1391
+ "7": "#06b6d4",
1392
+ "8": "#f97316",
1393
+ "9": "#14b8a6",
1394
+ a: "#ef4444",
1395
+ b: "#6366f1",
1396
+ c: "#ec4899",
1397
+ d: "#22c55e",
1398
+ e: "#eab308",
1399
+ f: "#0ea5e9"
1400
+ };
1401
+ function hexToRgba(hex, opacity) {
1402
+ const r = parseInt(hex.slice(1, 3), 16);
1403
+ const g = parseInt(hex.slice(3, 5), 16);
1404
+ const b = parseInt(hex.slice(5, 7), 16);
1405
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
1406
+ }
1407
+ function getEntityColor(entityId, variant = "medium") {
1408
+ const baseColor = BASE_COLORS[entityId[4]] || BASE_COLORS["0"];
1409
+ switch (variant) {
1410
+ case "light":
1411
+ return hexToRgba(baseColor, OPACITY_LIGHT);
1412
+ case "medium":
1413
+ return hexToRgba(baseColor, OPACITY_MEDIUM);
1414
+ case "text":
1415
+ return baseColor;
1416
+ }
1417
+ }
1418
+ function getEntityColorStyles(entityId) {
1419
+ const baseColor = BASE_COLORS[entityId[4]] || BASE_COLORS["0"];
1420
+ return {
1421
+ backgroundColor: getEntityColor(entityId, "light"),
1422
+ color: baseColor,
1423
+ borderColor: hexToRgba(baseColor, OPACITY_BORDER)
1424
+ };
1425
+ }
1426
+ var getWorkspaceColor = (workspaceId, useWorkspaceColors) => {
1427
+ const shouldUseWorkspaceColors = useWorkspaceColors !== void 0 ? useWorkspaceColors : true;
1428
+ if (!shouldUseWorkspaceColors) return "hsl(var(--primary))";
1429
+ const isValidId = workspaceId && workspaceId.startsWith("wrk-") && workspaceId.length >= 5;
1430
+ if (!isValidId) return "hsl(var(--primary))";
1431
+ return getEntityColor(workspaceId, "medium");
1432
+ };
1370
1433
  var badgeVariants = cva(
1371
1434
  "inline-flex items-center rounded-md border px-2.5 py-0.5 text-sm font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1372
1435
  {
@@ -1414,77 +1477,57 @@ function getTagTypeLabel(type) {
1414
1477
  const t = type ?? "text";
1415
1478
  return TAG_TYPE_LABELS[t] || t;
1416
1479
  }
1417
- var BASE_COLORS = {
1418
- "0": "#10b981",
1419
- "1": "#3b82f6",
1420
- "2": "#8b5cf6",
1421
- "3": "#f43f5e",
1422
- "4": "#f59e0b",
1423
- "5": "#84cc16",
1424
- "6": "#a855f7",
1425
- "7": "#06b6d4",
1426
- "8": "#f97316",
1427
- "9": "#14b8a6",
1428
- a: "#ef4444",
1429
- b: "#6366f1",
1430
- c: "#ec4899",
1431
- d: "#22c55e",
1432
- e: "#eab308",
1433
- f: "#0ea5e9"
1434
- };
1435
- function getEntityColor(entityId) {
1436
- return BASE_COLORS[entityId[4]] || BASE_COLORS["0"];
1437
- }
1438
1480
  function TagEntity({
1439
1481
  tag,
1440
1482
  size = "md",
1483
+ checked = true,
1484
+ onCheckedChange,
1441
1485
  className = "",
1486
+ wrap = false,
1442
1487
  onClick,
1443
1488
  showTooltip = true,
1444
1489
  tooltipContent
1445
1490
  }) {
1446
1491
  const tagType = tag.tag_type?.type ?? "text";
1447
1492
  const iconSize = size === "sm" ? 12 : size === "md" ? 14 : 16;
1448
- const Icon2 = getTagTypeIcon(tagType);
1449
- const sizeClasses2 = {
1450
- sm: "p-0.5",
1451
- md: "p-1",
1452
- lg: "p-1.5"
1453
- };
1454
- const tagColor = tag.color ?? getEntityColor(tag.external_id);
1455
- const iconElement = /* @__PURE__ */ jsx(
1493
+ const tagColor = tag.color ?? getEntityColor(tag.external_id, "medium");
1494
+ const iconElement = onCheckedChange ? /* @__PURE__ */ jsx(
1495
+ "input",
1496
+ {
1497
+ type: "checkbox",
1498
+ "aria-label": tag.name,
1499
+ checked,
1500
+ onClick: (e) => e.stopPropagation(),
1501
+ onChange: (e) => onCheckedChange(e.target.checked),
1502
+ className: "shrink-0 cursor-pointer",
1503
+ style: { accentColor: tagColor, width: iconSize, height: iconSize }
1504
+ }
1505
+ ) : /* @__PURE__ */ jsx(
1456
1506
  "span",
1457
1507
  {
1458
- className: `inline-flex items-center justify-center rounded-md text-white flex-shrink-0 ${sizeClasses2[size]}`,
1459
- style: { backgroundColor: tagColor },
1460
- children: /* @__PURE__ */ jsx(Icon2, { size: iconSize, className: "flex-shrink-0" })
1508
+ className: "flex shrink-0 items-center justify-center rounded-sm border",
1509
+ style: {
1510
+ width: iconSize,
1511
+ height: iconSize,
1512
+ borderColor: tagColor,
1513
+ backgroundColor: checked ? tagColor : void 0
1514
+ },
1515
+ "aria-hidden": "true",
1516
+ children: checked && /* @__PURE__ */ jsx(Check, { size: iconSize - 2, color: "#ffffff", strokeWidth: 3 })
1461
1517
  }
1462
1518
  );
1463
1519
  const pillSize = size === "lg" ? "base" : "sm";
1464
- const defaultTooltip = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1520
+ const defaultTooltip = /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 text-sm", children: [
1465
1521
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1466
- /* @__PURE__ */ jsx(
1467
- "span",
1468
- {
1469
- className: "inline-flex items-center justify-center rounded-md text-white p-1",
1470
- style: { backgroundColor: tagColor },
1471
- children: /* @__PURE__ */ jsx(Icon2, { size: 16 })
1472
- }
1473
- ),
1474
- /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: tag.name })
1522
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
1523
+ /* @__PURE__ */ jsx("span", { children: getTagTypeLabel(tagType) })
1475
1524
  ] }),
1476
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 text-sm", children: [
1477
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1478
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
1479
- /* @__PURE__ */ jsx("span", { children: getTagTypeLabel(tagType) })
1480
- ] }),
1481
- tag.doctag_count != null && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1482
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Documents:" }),
1483
- /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "h-5 min-w-[20px] justify-center", children: tag.doctag_count ?? 0 })
1484
- ] }),
1485
- tag.shared != null && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: tag.shared ? "Shared" : "Private" }) })
1486
- ] })
1487
- ] });
1525
+ tag.doctag_count != null && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1526
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Documents:" }),
1527
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "h-5 min-w-[20px] justify-center", children: tag.doctag_count ?? 0 })
1528
+ ] }),
1529
+ tag.shared != null && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: tag.shared ? "Shared" : "Private" }) })
1530
+ ] }) });
1488
1531
  const resolvedTooltip = showTooltip ? tooltipContent ?? defaultTooltip : void 0;
1489
1532
  return /* @__PURE__ */ jsx(
1490
1533
  EntityPill,
@@ -1492,11 +1535,13 @@ function TagEntity({
1492
1535
  icon: iconElement,
1493
1536
  label: tag.name,
1494
1537
  size: pillSize,
1495
- shape: "rounded",
1496
- labelMaxWidth: "max-w-[180px]",
1497
- tooltipContent: resolvedTooltip,
1498
- onClick,
1499
- className,
1538
+ shape: "pill",
1539
+ style: { borderColor: tagColor },
1540
+ labelMaxWidth: wrap ? "max-w-full" : "max-w-[180px]",
1541
+ labelClassName: wrap ? "whitespace-normal! line-clamp-3 break-words text-left" : void 0,
1542
+ tooltipContent: onCheckedChange ? void 0 : resolvedTooltip,
1543
+ onClick: onCheckedChange ? void 0 : onClick,
1544
+ className: `max-w-full px-2! py-0.5! ${className}`,
1500
1545
  "data-testid": `tag-entity-${tag.external_id}`
1501
1546
  }
1502
1547
  );
@@ -3010,63 +3055,6 @@ function RagDot({
3010
3055
  withLabel && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: RAG_LABELS[rag] })
3011
3056
  ] });
3012
3057
  }
3013
-
3014
- // src/entities/colors.ts
3015
- var OPACITY_LIGHT = 0.15;
3016
- var OPACITY_MEDIUM = 1;
3017
- var OPACITY_BORDER = 0.3;
3018
- var PLACEHOLDER_COLOR = "#9ca3af";
3019
- var NEUTRAL_GRAY2 = "#64748b";
3020
- var BASE_COLORS2 = {
3021
- "0": "#10b981",
3022
- "1": "#3b82f6",
3023
- "2": "#8b5cf6",
3024
- "3": "#f43f5e",
3025
- "4": "#f59e0b",
3026
- "5": "#84cc16",
3027
- "6": "#a855f7",
3028
- "7": "#06b6d4",
3029
- "8": "#f97316",
3030
- "9": "#14b8a6",
3031
- a: "#ef4444",
3032
- b: "#6366f1",
3033
- c: "#ec4899",
3034
- d: "#22c55e",
3035
- e: "#eab308",
3036
- f: "#0ea5e9"
3037
- };
3038
- function hexToRgba(hex, opacity) {
3039
- const r = parseInt(hex.slice(1, 3), 16);
3040
- const g = parseInt(hex.slice(3, 5), 16);
3041
- const b = parseInt(hex.slice(5, 7), 16);
3042
- return `rgba(${r}, ${g}, ${b}, ${opacity})`;
3043
- }
3044
- function getEntityColor2(entityId, variant = "medium") {
3045
- const baseColor = BASE_COLORS2[entityId[4]] || BASE_COLORS2["0"];
3046
- switch (variant) {
3047
- case "light":
3048
- return hexToRgba(baseColor, OPACITY_LIGHT);
3049
- case "medium":
3050
- return hexToRgba(baseColor, OPACITY_MEDIUM);
3051
- case "text":
3052
- return baseColor;
3053
- }
3054
- }
3055
- function getEntityColorStyles(entityId) {
3056
- const baseColor = BASE_COLORS2[entityId[4]] || BASE_COLORS2["0"];
3057
- return {
3058
- backgroundColor: getEntityColor2(entityId, "light"),
3059
- color: baseColor,
3060
- borderColor: hexToRgba(baseColor, OPACITY_BORDER)
3061
- };
3062
- }
3063
- var getWorkspaceColor = (workspaceId, useWorkspaceColors) => {
3064
- const shouldUseWorkspaceColors = useWorkspaceColors !== void 0 ? useWorkspaceColors : true;
3065
- if (!shouldUseWorkspaceColors) return "hsl(var(--primary))";
3066
- const isValidId = workspaceId && workspaceId.startsWith("wrk-") && workspaceId.length >= 5;
3067
- if (!isValidId) return "hsl(var(--primary))";
3068
- return getEntityColor2(workspaceId, "medium");
3069
- };
3070
3058
  var ShieldIcon = ({
3071
3059
  char,
3072
3060
  size = 24,
@@ -5212,6 +5200,6 @@ function UserMenu({
5212
5200
  ] });
5213
5201
  }
5214
5202
 
5215
- export { ARBI_MARK_SRC, AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, BASE_COLORS2 as BASE_COLORS, Badge, COLUMN_LABEL_FALLBACKS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClaudeIcon, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_METADATA_TAGS, DebouncedInput, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FireworksIcon, GeminiIcon, GoogleIcon, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label2 as Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY2 as NEUTRAL_GRAY, OpenAIIcon, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, ProviderIcon, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VerifiedToggle, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, buildFolderTree, canonicalFolderPath, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, entityNoun, extensionFromMime, formatCompactLastSeen, formatDocDate, formatElapsed, formatFolderLabel, formatFriendlyDate, friendlyFileType, getDocIcon, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getDocumentTitle, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getFileExtension, getFileTypeIcon, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, isAudioFile, isDocumentAddableToConversation, isDownloadOnlyFile, isImageDocument, isImageFile, isMediaFile, isVideoFile, markdownToPlainText, markdownToPlainTextBlocks, pickRecorderMimeType, returnFocusToMark, tagKindNouns, tagKindTitle, toggleVariants, useAudioRecorder, useDictateContext, usesOriginalBytesForViewer };
5216
- //# sourceMappingURL=chunk-3NBPMR3X.js.map
5217
- //# sourceMappingURL=chunk-3NBPMR3X.js.map
5203
+ export { ARBI_MARK_SRC, AUDIO_MIME_PREFERENCE, AgentBadge, AiMarkdown, ArbiBotHeadIcon, ArbiIcon, AudIcon, BASE_COLORS, Badge, COLUMN_LABEL_FALLBACKS, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClaudeIcon, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_METADATA_TAGS, DebouncedInput, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, FireworksIcon, GeminiIcon, GoogleIcon, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label2 as Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY2 as NEUTRAL_GRAY, OpenAIIcon, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, ProviderIcon, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, ShieldIcon, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VIDEO_MIME_PREFERENCE, VISIBILITY_ICONS, VerifiedBadge, VerifiedToggle, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, agentAvatarColors, badgeVariants, buildFolderTree, canonicalFolderPath, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, createChunkedRecorder, entityNoun, extensionFromMime, formatCompactLastSeen, formatDocDate, formatElapsed, formatFolderLabel, formatFriendlyDate, friendlyFileType, getDocIcon, getDocumentAuthor, getDocumentDate, getDocumentNature, getDocumentSubject, getDocumentTitle, getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getFileExtension, getFileTypeIcon, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, isAudioFile, isDocumentAddableToConversation, isDownloadOnlyFile, isImageDocument, isImageFile, isMediaFile, isVideoFile, markdownToPlainText, markdownToPlainTextBlocks, pickRecorderMimeType, returnFocusToMark, tagKindNouns, tagKindTitle, toggleVariants, useAudioRecorder, useDictateContext, usesOriginalBytesForViewer };
5204
+ //# sourceMappingURL=chunk-LBAGMNGG.js.map
5205
+ //# sourceMappingURL=chunk-LBAGMNGG.js.map