@brainfish-ai/components 0.31.0 → 0.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/esm/chunks/{ChatSearch.CcpQJlxZ.js → ChatSearch.EEO6qq9U.js} +2 -2
  2. package/dist/esm/chunks/{ChatSearch.CcpQJlxZ.js.map → ChatSearch.EEO6qq9U.js.map} +1 -1
  3. package/dist/esm/chunks/{font-picker.YAE99idL.js → font-picker.B9GPXyK4.js} +6 -6
  4. package/dist/esm/chunks/{font-picker.YAE99idL.js.map → font-picker.B9GPXyK4.js.map} +1 -1
  5. package/dist/esm/chunks/{header-nav.BfblRKoS.js → header-nav.DmlIUqml.js} +5 -5
  6. package/dist/esm/chunks/{header-nav.BfblRKoS.js.map → header-nav.DmlIUqml.js.map} +1 -1
  7. package/dist/esm/chunks/{header-pane.D7hpI7mt.js → header-pane.DNUhMK2x.js} +2 -2
  8. package/dist/esm/chunks/{header-pane.D7hpI7mt.js.map → header-pane.DNUhMK2x.js.map} +1 -1
  9. package/dist/esm/chunks/{two-level-combobox.DJYP--W9.js → two-level-combobox.BVZfsNSN.js} +3 -3
  10. package/dist/esm/chunks/{two-level-combobox.DJYP--W9.js.map → two-level-combobox.BVZfsNSN.js.map} +1 -1
  11. package/dist/esm/components/chart-radial-stacked.js +2 -2
  12. package/dist/esm/components/chat-search.js +1 -1
  13. package/dist/esm/components/font-picker.js +1 -1
  14. package/dist/esm/components/metric-card.js +2 -2
  15. package/dist/esm/components/two-level-combobox.js +1 -1
  16. package/dist/esm/global.css +1 -1
  17. package/dist/esm/index.js +5 -1
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/layouts/full-layout.js +1 -1
  20. package/dist/esm/layouts/header-nav.js +1 -1
  21. package/dist/esm/scenes/knowledge-review.js +8 -8
  22. package/dist/index.d.ts +25 -0
  23. package/dist/stats.html +1 -1
  24. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -1,2 +1,6 @@
1
- import './global.css';/* empty css */export{BrainfishColors}from"./colors.js";export{C as ChatSearch,a as ChatSearchProvider,R as ResolvedConversationFooter,u as useChatSearch,b as useIsChatSearchDirty}from"./chunks/ChatSearch.CcpQJlxZ.js";export{C as ContextPillBadge,a as Conversation,b as ConversationActions,c as ConversationInput,d as ConversationMessageAssistant,e as ConversationMessageUser,f as ConversationMessages,g as ConversationProvider,h as ConversationStatus,i as ConversationSuggestions,j as getConversationStatusLabel,u as useConversation}from"./chunks/Conversation.DpHoC6se.js";export{C as CodeBlock,F as FormattedMessage,M as MemoizedReactMarkdown,Z as ZoomableImage,a as addPopupWidgetUtm,b as addUtmParameters}from"./chunks/FormattedMessage.D_knqVl-.js";export{MermaidDiagram}from"./chunks/MermaidDiagram.PRgXQ5Yh.js";export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage}from"./components/ui/avatar.js";export{B as Button,b as buttonVariants}from"./chunks/button.D_2SonNs.js";export{Collapsible,CollapsibleContent,CollapsibleTrigger}from"./components/ui/collapsible.js";export{DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger}from"./components/ui/dropdown-menu.js";export{Switch}from"./components/ui/switch.js";export{Tooltip,TooltipContent,TooltipProvider,TooltipTrigger}from"./components/ui/tooltip.js";export{Textarea}from"./components/ui/textarea.js";export{ScrollArea,ScrollBar}from"./components/ui/scroll-area.js";export{Label}from"./components/ui/label.js";export{Input}from"./components/ui/input.js";export{Popover,PopoverAnchor,PopoverContent,PopoverTrigger}from"./components/ui/popover.js";export{Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut}from"./components/ui/command.js";export{Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger}from"./components/ui/dialog.js";export{Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle}from"./components/ui/card.js";export{Table,TableBody,TableCaption,TableCell,TableFooter,TableHead,TableHeader,TableRow}from"./components/ui/table.js";export{Badge,badgeVariants}from"./components/ui/badge.js";export{Progress}from"./components/ui/progress.js";export{Accordion,AccordionContent,AccordionItem,AccordionTrigger}from"./components/ui/accordion.js";export{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogOverlay,AlertDialogPortal,AlertDialogTitle,AlertDialogTrigger}from"./components/ui/alert-dialog.js";export{Alert,AlertAction,AlertContent,AlertDescription,AlertTitle}from"./components/ui/alert.js";export{ButtonGroup,ButtonGroupSeparator,ButtonGroupText,buttonGroupVariants}from"./components/ui/button-group.js";export{Calendar}from"./components/ui/calendar.js";export{DivButton,divButtonVariants}from"./components/ui/div-button.js";export{Icon,MemoizedIcon}from"./components/ui/icon.js";export{Item,ItemActions,ItemContent,ItemDescription,ItemFooter,ItemGroup,ItemHeader,ItemMedia,ItemSeparator,ItemTitle}from"./components/ui/item.js";export{Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectSeparator,SelectTrigger,SelectValue}from"./components/ui/select.js";export{Separator}from"./components/ui/separator.js";export{Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger}from"./components/ui/sheet.js";export{Spinner}from"./components/ui/spinner.js";export{R as Ripple,a as RippleStatus,S as SweepText}from"./chunks/ripple-status.C20jzXjF.js";export{S as SimpleSelect}from"./chunks/simpleSelect.CEUUfl3O.js";export{D as DatePicker}from"./chunks/date-picker.C2VT_rZ9.js";export{C as Combobox}from"./chunks/combobox.MyoPH18G.js";export{T as TwoLevelCombobox}from"./chunks/two-level-combobox.DJYP--W9.js";export{F as Filter,a as Filters,O as Operator}from"./chunks/filters.BHp3ukNW.js";export{F as FileUpload,a as FileUploadStatus,f as formatFileSize}from"./chunks/file-upload-status.D8RhMcbO.js";export{D as DataTable}from"./chunks/data-table.bjvbLk2u.js";export{I as InputWithTags}from"./chunks/input-with-tags.DLv9e0XI.js";export{L as Logo}from"./chunks/logo.DtwFGMBj.js";export{C as ChatLogo}from"./chunks/chat-logo.CqPppEb9.js";export{A as AILogo,a as AILogoPaths}from"./chunks/ai-logo.Bh2bhNcG.js";export{T as Trend,a as TrendValue}from"./chunks/trend-value.BPBDBsk2.js";export{F as FontPicker,a as FontPickerItem,c as clearFontCache,g as getCachedFonts,l as loadFont,s as setCachedFonts,u as useFontOptions}from"./chunks/font-picker.YAE99idL.js";export{F as FullLayout,a as FullLayoutHeader,b as FullLayoutLeftSidebar,c as FullLayoutNavStateContext,d as FullLayoutProvider,e as FullLayoutRightSidebar,u as useFullLayoutContext,f as useRightSidebar}from"./chunks/header-pane.D7hpI7mt.js";export{H as HEADER_NAV_HEIGHT,a as HeaderNav}from"./chunks/header-nav.BfblRKoS.js";export{S as Sidebar,u as useSidebar}from"./chunks/sidebar.DNJ1Iufi.js";export{MicrosoftTeamsLogo}from"./logos/microsoft-teams-logo.js";export{SlackLogo}from"./logos/slack-logo.js";export{MicrosoftLogo}from"./logos/microsoft-logo.js";export{R as ReviewList,a as ReviewListItem,b as ReviewsSelectionProvider,S as SuggestionCard,u as useReviewsSelection}from"./chunks/suggestion-card.D-AsG_yB.js";
1
+ import './global.css';/* empty css */export{BrainfishColors}from"./colors.js";export{C as ChatSearch,a as ChatSearchProvider,R as ResolvedConversationFooter,u as useChatSearch,b as useIsChatSearchDirty}from"./chunks/ChatSearch.EEO6qq9U.js";export{C as ContextPillBadge,a as Conversation,b as ConversationActions,c as ConversationInput,d as ConversationMessageAssistant,e as ConversationMessageUser,f as ConversationMessages,g as ConversationProvider,h as ConversationStatus,i as ConversationSuggestions,j as getConversationStatusLabel,u as useConversation}from"./chunks/Conversation.DpHoC6se.js";export{C as CodeBlock,F as FormattedMessage,M as MemoizedReactMarkdown,Z as ZoomableImage,a as addPopupWidgetUtm,b as addUtmParameters}from"./chunks/FormattedMessage.D_knqVl-.js";export{MermaidDiagram}from"./chunks/MermaidDiagram.PRgXQ5Yh.js";export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage}from"./components/ui/avatar.js";export{B as Button,b as buttonVariants}from"./chunks/button.D_2SonNs.js";export{Collapsible,CollapsibleContent,CollapsibleTrigger}from"./components/ui/collapsible.js";import{DropdownMenu as o,DropdownMenuTrigger as t,DropdownMenuContent as r,DropdownMenuItem as n}from"./components/ui/dropdown-menu.js";export{DropdownMenuCheckboxItem,DropdownMenuGroup,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger}from"./components/ui/dropdown-menu.js";export{Switch}from"./components/ui/switch.js";export{Tooltip,TooltipContent,TooltipProvider,TooltipTrigger}from"./components/ui/tooltip.js";export{Textarea}from"./components/ui/textarea.js";export{ScrollArea,ScrollBar}from"./components/ui/scroll-area.js";export{Label}from"./components/ui/label.js";export{Input}from"./components/ui/input.js";export{Popover,PopoverAnchor,PopoverContent,PopoverTrigger}from"./components/ui/popover.js";export{Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut}from"./components/ui/command.js";export{Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger}from"./components/ui/dialog.js";export{Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle}from"./components/ui/card.js";export{Table,TableBody,TableCaption,TableCell,TableFooter,TableHead,TableHeader,TableRow}from"./components/ui/table.js";export{Badge,badgeVariants}from"./components/ui/badge.js";export{Progress}from"./components/ui/progress.js";export{Accordion,AccordionContent,AccordionItem,AccordionTrigger}from"./components/ui/accordion.js";export{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogOverlay,AlertDialogPortal,AlertDialogTitle,AlertDialogTrigger}from"./components/ui/alert-dialog.js";export{Alert,AlertAction,AlertContent,AlertDescription,AlertTitle}from"./components/ui/alert.js";export{ButtonGroup,ButtonGroupSeparator,ButtonGroupText,buttonGroupVariants}from"./components/ui/button-group.js";export{Calendar}from"./components/ui/calendar.js";export{DivButton,divButtonVariants}from"./components/ui/div-button.js";export{Icon,MemoizedIcon}from"./components/ui/icon.js";export{Item,ItemActions,ItemContent,ItemDescription,ItemFooter,ItemGroup,ItemHeader,ItemMedia,ItemSeparator,ItemTitle}from"./components/ui/item.js";export{Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectSeparator,SelectTrigger,SelectValue}from"./components/ui/select.js";export{Separator}from"./components/ui/separator.js";export{Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger}from"./components/ui/sheet.js";export{Spinner}from"./components/ui/spinner.js";export{R as Ripple,a as RippleStatus,S as SweepText}from"./chunks/ripple-status.C20jzXjF.js";export{S as SimpleSelect}from"./chunks/simpleSelect.CEUUfl3O.js";export{D as DatePicker}from"./chunks/date-picker.C2VT_rZ9.js";export{C as Combobox}from"./chunks/combobox.MyoPH18G.js";export{T as TwoLevelCombobox}from"./chunks/two-level-combobox.BVZfsNSN.js";export{F as Filter,a as Filters,O as Operator}from"./chunks/filters.BHp3ukNW.js";export{F as FileUpload,a as FileUploadStatus,f as formatFileSize}from"./chunks/file-upload-status.D8RhMcbO.js";export{D as DataTable}from"./chunks/data-table.bjvbLk2u.js";export{I as InputWithTags}from"./chunks/input-with-tags.DLv9e0XI.js";export{L as Logo}from"./chunks/logo.DtwFGMBj.js";export{C as ChatLogo}from"./chunks/chat-logo.CqPppEb9.js";export{A as AILogo,a as AILogoPaths}from"./chunks/ai-logo.Bh2bhNcG.js";export{T as Trend,a as TrendValue}from"./chunks/trend-value.BPBDBsk2.js";export{F as FontPicker,a as FontPickerItem,c as clearFontCache,g as getCachedFonts,l as loadFont,s as setCachedFonts,u as useFontOptions}from"./chunks/font-picker.B9GPXyK4.js";export{F as FullLayout,a as FullLayoutHeader,b as FullLayoutLeftSidebar,c as FullLayoutNavStateContext,d as FullLayoutProvider,e as FullLayoutRightSidebar,u as useFullLayoutContext,f as useRightSidebar}from"./chunks/header-pane.DNUhMK2x.js";export{H as HEADER_NAV_HEIGHT,a as HeaderNav}from"./chunks/header-nav.DmlIUqml.js";export{S as Sidebar,u as useSidebar}from"./chunks/sidebar.DNJ1Iufi.js";export{MicrosoftTeamsLogo}from"./logos/microsoft-teams-logo.js";export{SlackLogo}from"./logos/slack-logo.js";export{MicrosoftLogo}from"./logos/microsoft-logo.js";export{R as ReviewList,a as ReviewListItem,b as ReviewsSelectionProvider,S as SuggestionCard,u as useReviewsSelection}from"./chunks/suggestion-card.D-AsG_yB.js";import{ChartBar as p,CreditCard as m}from"@phosphor-icons/react";import*as x from"react";import{c as v}from"./chunks/utils.C6Qu-kwd.js";function k({percentage:e,label:a="Queries",status:s,onViewPlan:i,onViewBilling:l}){/* @__PURE__ */
2
+ return x.createElement(o,null,/* @__PURE__ */x.createElement(t,{asChild:!0},/* @__PURE__ */x.createElement("button",{type:"button",className:v("flex items-center gap-1.5 rounded border bg-surface py-1 pl-2 pr-2.5","text-xs font-normal text-dark-900 cursor-pointer","hover:bg-dark-200 active:bg-dark-400","focus-visible:outline-none","transition-colors",{"border-yellow-500/50":"warning"===s,"border-red-500/50":"reached"===s}),"aria-label":`${a} usage: ${e}%`},
3
+ /* @__PURE__ */x.createElement("span",{className:v("h-2 w-2 shrink-0 rounded-full",{"bg-yellow-500":"warning"===s,"bg-red-500":"reached"===s}),"aria-hidden":"true"}),
4
+ /* @__PURE__ */x.createElement("span",{className:"whitespace-nowrap"},e,"% of ",a," used"),
5
+ /* @__PURE__ */x.createElement("span",{className:"opacity-60 whitespace-nowrap"},"View plan"))),/* @__PURE__ */x.createElement(r,{align:"end",className:"w-52"},/* @__PURE__ */x.createElement(n,{onClick:i,className:"flex items-center gap-2"},/* @__PURE__ */x.createElement(p,{size:16,"aria-hidden":"true"}),"View plan"),/* @__PURE__ */x.createElement(n,{onClick:l,className:"flex items-center gap-2"},/* @__PURE__ */x.createElement(m,{size:16,"aria-hidden":"true"}),"View billing settings")))}export{o as DropdownMenu,r as DropdownMenuContent,n as DropdownMenuItem,t as DropdownMenuTrigger,k as UsageIndicatorPill};
2
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/usage-indicator-pill/usage-indicator-pill.tsx"],"sourcesContent":["import { ChartBar, CreditCard } from '@phosphor-icons/react';\nimport * as React from 'react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { cn } from '@/lib/utils';\n\nexport type UsageIndicatorStatus = 'warning' | 'reached';\n\nexport interface UsageIndicatorPillProps {\n /** Current usage as a percentage 0–100 */\n percentage: number;\n /** Name of the usage metric being displayed */\n label?: string;\n /** Visual state of the pill */\n status: UsageIndicatorStatus;\n /** Called when the user selects \"View plan\" */\n onViewPlan?: () => void;\n /** Called when the user selects \"View billing settings\" */\n onViewBilling?: () => void;\n}\n\n/**\n * Gives an indication of query usage in the platform.\n *\n * A pill button for the top navigation bar that shows the team's monthly usage\n * usage percentage. At ≥80% it renders in warning (yellow) state; at 100% in\n * reached (red) state. Clicking it opens a dropdown with links to the plan and\n * billing settings pages.\n */\nexport function UsageIndicatorPill({\n percentage,\n label = 'Queries',\n status,\n onViewPlan,\n onViewBilling,\n}: UsageIndicatorPillProps) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n 'flex items-center gap-1.5 rounded border bg-surface py-1 pl-2 pr-2.5',\n 'text-xs font-normal text-dark-900 cursor-pointer',\n 'hover:bg-dark-200 active:bg-dark-400',\n 'focus-visible:outline-none',\n 'transition-colors',\n {\n 'border-yellow-500/50': status === 'warning',\n 'border-red-500/50': status === 'reached',\n },\n )}\n aria-label={`${label} usage: ${percentage}%`}\n >\n <span\n className={cn('h-2 w-2 shrink-0 rounded-full', {\n 'bg-yellow-500': status === 'warning',\n 'bg-red-500': status === 'reached',\n })}\n aria-hidden=\"true\"\n />\n <span className=\"whitespace-nowrap\">\n {percentage}% of {label} used\n </span>\n <span className=\"opacity-60 whitespace-nowrap\">View plan</span>\n </button>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"end\" className=\"w-52\">\n <DropdownMenuItem onClick={onViewPlan} className=\"flex items-center gap-2\">\n <ChartBar size={16} aria-hidden=\"true\" />\n View plan\n </DropdownMenuItem>\n <DropdownMenuItem onClick={onViewBilling} className=\"flex items-center gap-2\">\n <CreditCard size={16} aria-hidden=\"true\" />\n View billing settings\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"names":["UsageIndicatorPill","percentage","label","status","onViewPlan","onViewBilling","React","createElement","DropdownMenu","DropdownMenuTrigger","asChild","type","className","cn","DropdownMenuContent","align","DropdownMenuItem","onClick","ChartBar","size","CreditCard"],"mappings":"2tLAkCO,SAASA,GAAmBC,WACjCA,EAAAC,MACAA,EAAQ,UAAAC,OACRA,EAAAC,WACAA,EAAAC,cACAA;AAEA,OACEC,EAAAC,cAACC,EAAA,oBACCF,EAAAC,cAACE,EAAA,CAAoBC,SAAO,kBAC1BJ,EAAAC,cAAC,SAAA,CACCI,KAAK,SACLC,UAAWC,EACT,uEACA,mDACA,uCACA,6BACA,oBACA,CACE,uBAAmC,YAAXV,EACxB,oBAAgC,YAAXA,IAGzB,aAAY,GAAGD,YAAgBD;eAE/BK,EAAAC,cAAC,OAAA,CACCK,UAAWC,EAAG,gCAAiC,CAC7C,gBAA4B,YAAXV,EACjB,aAAyB,YAAXA,IAEhB,cAAY;+BAEb,OAAA,CAAKS,UAAU,qBACbX,EAAW,QAAMC,EAAM;eAE1BI,EAAAC,cAAC,OAAA,CAAKK,UAAU,gCAA+B,8BAInDN,EAAAC,cAACO,EAAA,CAAoBC,MAAM,MAAMH,UAAU,uBACzCN,EAAAC,cAACS,EAAA,CAAiBC,QAASb,EAAYQ,UAAU,0CAC/CN,EAAAC,cAACW,EAAA,CAASC,KAAM,GAAI,cAAY,SAAS,4BAG3Cb,EAAAC,cAACS,EAAA,CAAiBC,QAASZ,EAAeO,UAAU,0CAClDN,EAAAC,cAACa,EAAA,CAAWD,KAAM,GAAI,cAAY,SAAS,0BAMrD"}
@@ -1,2 +1,2 @@
1
- export{F as FullLayout,a as FullLayoutHeader,b as FullLayoutLeftSidebar,c as FullLayoutNavStateContext,d as FullLayoutProvider,e as FullLayoutRightSidebar,u as useFullLayoutContext,f as useRightSidebar}from"../chunks/header-pane.D7hpI7mt.js";
1
+ export{F as FullLayout,a as FullLayoutHeader,b as FullLayoutLeftSidebar,c as FullLayoutNavStateContext,d as FullLayoutProvider,e as FullLayoutRightSidebar,u as useFullLayoutContext,f as useRightSidebar}from"../chunks/header-pane.DNUhMK2x.js";
2
2
  //# sourceMappingURL=full-layout.js.map
@@ -1,2 +1,2 @@
1
- export{H as HEADER_NAV_HEIGHT,a as HeaderNav}from"../chunks/header-nav.BfblRKoS.js";
1
+ export{H as HEADER_NAV_HEIGHT,a as HeaderNav}from"../chunks/header-nav.DmlIUqml.js";
2
2
  //# sourceMappingURL=header-nav.js.map
@@ -1,18 +1,18 @@
1
- import*as e from"react";import t,{useCallback as n,useEffect as l,useRef as r,useState as c,useImperativeHandle as a}from"react";import{u as i,c as s,b as o,R as d}from"../chunks/suggestion-card.D-AsG_yB.js";import '../knowledge-review.css';export{S as SuggestionCard}from"../chunks/suggestion-card.D-AsG_yB.js";import u from"html-react-parser";import{CaretDown as m,CaretUp as p,Lightbulb as f,Backspace as g,CheckCircle as A,Globe as h,LockKey as b,HandsClapping as E}from"@phosphor-icons/react";import{Card as N,CardHeader as v,CardTitle as x,CardContent as w}from"../components/ui/card.js";import{ScrollArea as y}from"../components/ui/scroll-area.js";import{Spinner as k}from"../components/ui/spinner.js";import{B as C,a as I}from"../chunks/button.D_2SonNs.js";import{Tooltip as P,TooltipTrigger as j,TooltipContent as R}from"../components/ui/tooltip.js";import{Popover as L,PopoverTrigger as z,PopoverContent as D}from"../components/ui/popover.js";import{DropdownMenu as B,DropdownMenuTrigger as O,DropdownMenuContent as T,DropdownMenuItem as F}from"../components/ui/dropdown-menu.js";import{ButtonGroup as $}from"../components/ui/button-group.js";import{c as q}from"../chunks/utils.C6Qu-kwd.js";function M({fetchDiffForItem:e}){const{selectedItem:t,setLoadedDiffDoc:r,setLoadingDiff:c}=i(),a=n(async(t,n)=>{c(!0),r(null);try{const l=await e(t);if(n.aborted)return;r(l)}catch(l){if(n.aborted)return;console.error("Failed to fetch diff:",l),r(null)}finally{n.aborted||c(!1)}},[e,r,c]),s=t?.id;return l(()=>{if(!s)return r(null),void c(!1);const e=new AbortController;return a(s,e.signal),()=>{e.abort()}},[s,a]),null}function W({title:t,breadcrumb:n,onOpenArticleLink:l,currentArticleIndex:r,totalArticles:c,displayTotalArticles:a,onNextArticle:i,onPreviousArticle:s}){const o=c>0&&r<c-1,d=r>0,u=0===c?0:r+1,f=a??c,g=f>0;/* @__PURE__ */
1
+ import*as e from"react";import t,{useCallback as n,useEffect as l,useRef as r,useState as c,useImperativeHandle as a}from"react";import{u as i,c as s,b as o,R as d}from"../chunks/suggestion-card.D-AsG_yB.js";import '../knowledge-review.css';export{S as SuggestionCard}from"../chunks/suggestion-card.D-AsG_yB.js";import u from"html-react-parser";import{CaretDown as m,CaretUp as p,Lightbulb as f,Backspace as g,CheckCircle as A,Globe as h,LockKey as b,HandsClapping as E}from"@phosphor-icons/react";import{Card as N,CardHeader as v,CardTitle as x,CardContent as w}from"../components/ui/card.js";import{ScrollArea as y}from"../components/ui/scroll-area.js";import{Spinner as k}from"../components/ui/spinner.js";import{B as C,a as I}from"../chunks/button.D_2SonNs.js";import{Tooltip as P,TooltipTrigger as j,TooltipContent as R}from"../components/ui/tooltip.js";import{Popover as L,PopoverTrigger as z,PopoverContent as D}from"../components/ui/popover.js";import{DropdownMenu as B,DropdownMenuTrigger as O,DropdownMenuContent as T,DropdownMenuItem as q}from"../components/ui/dropdown-menu.js";import{ButtonGroup as F}from"../components/ui/button-group.js";import{c as $}from"../chunks/utils.C6Qu-kwd.js";function M({fetchDiffForItem:e}){const{selectedItem:t,setLoadedDiffDoc:r,setLoadingDiff:c}=i(),a=n(async(t,n)=>{c(!0),r(null);try{const l=await e(t);if(n.aborted)return;r(l)}catch(l){if(n.aborted)return;console.error("Failed to fetch diff:",l),r(null)}finally{n.aborted||c(!1)}},[e,r,c]),s=t?.id;return l(()=>{if(!s)return r(null),void c(!1);const e=new AbortController;return a(s,e.signal),()=>{e.abort()}},[s,a]),null}function W({title:t,breadcrumb:n,onOpenArticleLink:l,currentArticleIndex:r,totalArticles:c,displayTotalArticles:a,onNextArticle:i,onPreviousArticle:s}){const o=c>0&&r<c-1,d=r>0,u=0===c?0:r+1,f=a??c,g=f>0;/* @__PURE__ */
2
2
  return e.createElement("div",{className:"flex justify-between items-center"},/* @__PURE__ */e.createElement("h1",{className:"heading-lg"},t,l&&n&&/* @__PURE__ */e.createElement(C,{variant:"link",size:"sm",onClick:l,"aria-label":"Open article",className:"block px-0 text-subtle text-xs"},n)),/* @__PURE__ */e.createElement("div",{className:"flex items-center"},/* @__PURE__ */e.createElement("p",{className:"text-xs text-foreground pr-2"},/* @__PURE__ */e.createElement("span",{"aria-hidden":"true"},g?`${u}/${f}`:"0"),/* @__PURE__ */e.createElement("span",{className:"sr-only","aria-live":"polite"},g?`Article ${u} of ${f}`:"No articles")),/* @__PURE__ */e.createElement(P,null,/* @__PURE__ */e.createElement(j,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost",size:"icon",disabled:!o,onClick:i,"aria-label":"Go to next article"},
3
3
  /* @__PURE__ */e.createElement(m,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"bottom",bgColor:"--bfc-foreground",className:"text-background"},"Next Article")),/* @__PURE__ */e.createElement(P,null,/* @__PURE__ */e.createElement(j,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost",size:"icon",disabled:!d,onClick:s,"aria-label":"Go to previous article"},
4
4
  /* @__PURE__ */e.createElement(p,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"top",bgColor:"--bfc-foreground",className:"text-background"},"Previous Article"))))}function _({isNew:t,isAccepted:n=!1,suggestionsCount:l,sourceIcon:r,sourceDescription:c,onSourceLinkClick:a,showActionButtons:i=!0,suggestionReasonBody:o,hideAcceptAndPublishPublic:d=!1,pendingAction:u=null,onAcceptAndPublish:p,onRejectAll:E,onAcceptAll:N,onAcceptAndPublishAction:v}){const[x,w]=e.useState(!1),y=null!=u,P="reject"===u,S="accept-draft"===u||"accept-publish-public"===u||"accept-publish-internal"===u;/* @__PURE__ */
5
- return e.createElement("div",{className:"flex-1 px-2 pb-2 flex justify-between items-center"},/* @__PURE__ */e.createElement(s,{isNew:t,isAccepted:n,editCount:l,sourceIcon:r,sourceDescription:c,onSourceLinkClick:a}),i&&/* @__PURE__ */e.createElement($,{orientation:"horizontal",rounded:!1,"aria-label":"Suggestion actions","aria-busy":y,className:"gap-1"},o&&/* @__PURE__ */e.createElement(L,{open:x,onOpenChange:w},/* @__PURE__ */e.createElement(z,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost","aria-label":G,disabled:y},/* @__PURE__ */e.createElement(f,{"aria-hidden":"true"}),"Why")),/* @__PURE__ */e.createElement(D,{align:"start",side:"bottom",className:"z-above-modal shadow-md dark:shadow-md-invert border-dark-300"},
5
+ return e.createElement("div",{className:"flex-1 px-2 pb-2 flex justify-between items-center"},/* @__PURE__ */e.createElement(s,{isNew:t,isAccepted:n,editCount:l,sourceIcon:r,sourceDescription:c,onSourceLinkClick:a}),i&&/* @__PURE__ */e.createElement(F,{orientation:"horizontal",rounded:!1,"aria-label":"Suggestion actions","aria-busy":y,className:"gap-1"},o&&/* @__PURE__ */e.createElement(L,{open:x,onOpenChange:w},/* @__PURE__ */e.createElement(z,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost","aria-label":G,disabled:y},/* @__PURE__ */e.createElement(f,{"aria-hidden":"true"}),"Why")),/* @__PURE__ */e.createElement(D,{align:"start",side:"bottom",className:"z-above-modal shadow-md dark:shadow-md-invert border-dark-300"},
6
6
  /* @__PURE__ */e.createElement("div",{className:"font-bold text-sm"},G),
7
7
  /* @__PURE__ */e.createElement("div",{className:"text-sm text-subtle mt-1"},o))),
8
- /* @__PURE__ */e.createElement(C,{variant:"ghost",disabled:y,onClick:()=>{E()}},P?/* @__PURE__ */e.createElement(k,{className:"size-5"}):/* @__PURE__ */e.createElement(g,{"aria-hidden":"true"}),t?"Reject":"Reject all"),p?/* @__PURE__ */e.createElement(B,null,/* @__PURE__ */e.createElement("div",{className:q("flex items-center rounded border border-border bg-primary",I)},/* @__PURE__ */e.createElement(C,{variant:"default",elevation:"shadow",className:"gap-1 rounded-none border-0 bg-transparent shadow-none",disabled:y,onClick:()=>{N()}},S?/* @__PURE__ */e.createElement(k,{className:"size-5"}):/* @__PURE__ */e.createElement(A,{"aria-hidden":"true"}),t?"Accept as draft":"Accept all as draft"),/* @__PURE__ */e.createElement("span",{className:"h-full w-px self-stretch bg-foreground","aria-hidden":"true"}),/* @__PURE__ */e.createElement(O,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"default",size:"icon",className:"size-9 rounded-none border-0 bg-transparent shadow-none","aria-label":"More accept options",disabled:y},
9
- /* @__PURE__ */e.createElement(m,{className:"size-4","aria-hidden":"true"})))),/* @__PURE__ */e.createElement(T,{align:"end",className:"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1 "},!d&&/* @__PURE__ */e.createElement(F,{className:"p-3",disabled:y,onClick:()=>{v("public")}},
8
+ /* @__PURE__ */e.createElement(C,{variant:"ghost",disabled:y,onClick:()=>{E()}},P?/* @__PURE__ */e.createElement(k,{className:"size-5"}):/* @__PURE__ */e.createElement(g,{"aria-hidden":"true"}),t?"Reject":"Reject all"),p?/* @__PURE__ */e.createElement(B,null,/* @__PURE__ */e.createElement("div",{className:$("flex items-center rounded border border-border bg-primary",I)},/* @__PURE__ */e.createElement(C,{variant:"default",elevation:"shadow",className:"gap-1 rounded-none border-0 bg-transparent shadow-none",disabled:y,onClick:()=>{N()}},S?/* @__PURE__ */e.createElement(k,{className:"size-5"}):/* @__PURE__ */e.createElement(A,{"aria-hidden":"true"}),t?"Accept as draft":"Accept all as draft"),/* @__PURE__ */e.createElement("span",{className:"h-full w-px self-stretch bg-foreground","aria-hidden":"true"}),/* @__PURE__ */e.createElement(O,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"default",size:"icon",className:"size-9 rounded-none border-0 bg-transparent shadow-none","aria-label":"More accept options",disabled:y},
9
+ /* @__PURE__ */e.createElement(m,{className:"size-4","aria-hidden":"true"})))),/* @__PURE__ */e.createElement(T,{align:"end",className:"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1 "},!d&&/* @__PURE__ */e.createElement(q,{className:"p-3",disabled:y,onClick:()=>{v("public")}},
10
10
  /* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),t?"Accept & publish publicly":"Accept all & publish publicly"),
11
- /* @__PURE__ */e.createElement(F,{className:"p-3",disabled:y,onClick:()=>{v("internal")}},
11
+ /* @__PURE__ */e.createElement(q,{className:"p-3",disabled:y,onClick:()=>{v("internal")}},
12
12
  /* @__PURE__ */e.createElement(b,{"aria-hidden":"true"}),t?"Accept & publish internally":"Accept all & publish internally"))):/* @__PURE__ */e.createElement(C,{variant:"default",elevation:"shadow",disabled:y,onClick:()=>{N()}},S?/* @__PURE__ */e.createElement(k,{className:"size-5"}):/* @__PURE__ */e.createElement(A,{"aria-hidden":"true"}),t?"Accept as draft":"Accept all as draft")))}const G="Why is Brainfish suggesting this?",K=e.forwardRef(function({title:t,isNew:n,isAccepted:l=!1,suggestionsCount:r,sourceIcon:c,sourceDescription:a,currentArticleIndex:s,totalArticles:o,displayTotalArticles:d,showActionButtons:u=!0,onNextArticle:m,onPreviousArticle:p,className:f,...g},A){const{onApproveAllSuggestions:h,onRejectAllSuggestions:b,onAcceptAndPublish:E,onApplyAllInEditor:N,onRejectAllInEditor:v,onOpenArticleLink:x,onSourceLinkClick:w,breadcrumb:y,suggestionReasonBody:k,hideAcceptAndPublishPublic:C=!1}=i(),[I,P]=e.useState(null),S=e.useRef(null),j=e.useCallback(async(e,t)=>{if(!S.current){S.current=e,P(e);try{await t()}finally{S.current=null,P(null)}}},[]),R=e.useCallback(async()=>{await j("reject",async()=>{v&&await v(),await Promise.resolve(b())})},[v,b,j]),L=e.useCallback(async()=>{await j("accept-draft",async()=>{N&&await N(),await Promise.resolve(h())})},[N,h,j]),z=e.useCallback(async e=>{if(!E)return;const t="public"===e?"accept-publish-public":"accept-publish-internal";await j(t,async()=>{N&&await N(),await Promise.resolve(E(e))})},[N,E,j]);/* @__PURE__ */
13
- return e.createElement("div",{ref:A,className:q("flex flex-col gap-4",f),...g},/* @__PURE__ */e.createElement(W,{title:t,breadcrumb:y,onOpenArticleLink:x,currentArticleIndex:s,totalArticles:o,displayTotalArticles:d,onNextArticle:m,onPreviousArticle:p}),/* @__PURE__ */e.createElement(_,{isNew:n,isAccepted:l,suggestionsCount:r,sourceIcon:c,sourceDescription:a,onSourceLinkClick:w,showActionButtons:u,suggestionReasonBody:k,hideAcceptAndPublishPublic:C,pendingAction:I,onAcceptAndPublish:E,onRejectAll:R,onAcceptAll:L,onAcceptAndPublishAction:z}))});function H(e){const t=e.querySelectorAll("del + ins"),n=e.querySelectorAll("ins:not(del + ins)"),l=e.querySelectorAll("del"),r=Array.from(l).filter(e=>"INS"!==e.nextElementSibling?.tagName);return t.length+n.length+r.length}function J({diffTitle:e,items:a,isLoading:s,totalItemsCount:o,showActionButtons:d=!0,children:m,sourceIcon:p,sourceDescription:f}){const{selectedItem:g,setSelectedItem:A,loadedDiffDoc:h,loadingDiff:b}=i(),C=a.length>0,I=s??!C,P=I&&!C,S=!I&&!C,j=b?"":u(h?.diffTitle??e??""),R=b?/* @__PURE__ */t.createElement("div",{className:"text-muted-foreground"},"Loading diff…"):h?.diffContent,L=b?0:(z=h?.diffTitle??e)&&"undefined"!=typeof DOMParser?H((new DOMParser).parseFromString(z,"text/html")):0;var z;const D=r(null),[B,O]=c(0);l(()=>{if(b||!h)return void O(0);const e=D.current;if(!e)return;const t=requestAnimationFrame(()=>{var t;O((t=e)?H(t):0)});return()=>cancelAnimationFrame(t)},[b,h]);const T=L+B,F=a.length,$=o??F,q=g?Math.max(0,a.findIndex(e=>e.id===g.id)):0,M=n(()=>{q<F-1&&A(a[q+1]??null)},[q,a,A,F]),W=n(()=>{q>0&&A(a[q-1]??null)},[q,a,A]),_=g?a.find(e=>e.id===g.id)??g:null,G=_?.icon??p,J=_?.description??f,Q=_?.isAccepted??!1;/* @__PURE__ */
14
- return t.createElement(N,{className:"py-6 pl-4","data-name":"knowledge-reviews"},/* @__PURE__ */t.createElement(y,{className:"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8"},/* @__PURE__ */t.createElement(v,{className:"p-0"},C&&/* @__PURE__ */t.createElement(x,{className:"border-b border-dark-300 mb-6 pb-2 font-normal"},/* @__PURE__ */t.createElement(K,{title:j,isNew:h?.isNew??!1,isAccepted:Q,suggestionsCount:T,sourceIcon:G,sourceDescription:J,currentArticleIndex:q,totalArticles:F,displayTotalArticles:$,showActionButtons:d,onNextArticle:M,onPreviousArticle:W}))),/* @__PURE__ */t.createElement(w,{className:"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16"},/* @__PURE__ */t.createElement("div",{"aria-hidden":"true",className:"sr-only",hidden:!0},m),P?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground"},/* @__PURE__ */t.createElement(k,{className:"size-8"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium"},"Loading suggestions...")):S?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]"},/* @__PURE__ */t.createElement(E,{className:"text-muted-foreground",size:32,weight:"fill"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium text-foreground"},"All up to date. Well done, mate.")):/* @__PURE__ */t.createElement("div",{ref:D,className:"pl-12"},R))))}const Q="--knowledge-review-scroll-height",U=t.forwardRef(function({diffTitle:e="Knowledge Review",children:n,items:c,isLoading:s,totalItemsCount:o,showActionButtons:u=!0,className:m,onApproveAllSuggestions:p,onRejectAllSuggestions:f,onOpenArticleLink:g,onAcceptAndPublish:A,onApplyAllInEditor:h,onRejectAllInEditor:b,onSourceLinkClick:E,breadcrumb:v,sourceIcon:x,sourceDescription:C,suggestionReasonBody:I,hideAcceptAndPublishPublic:P,...S},j){const R=r(null),{selectedItem:L,setSelectedItem:z}=i();a(j,()=>({selectedItem:L,setSelectedItem:z}),[L,z]),l(()=>{const e=R.current;if(!e)return;const t=()=>{const{height:t}=e.getBoundingClientRect();e.style.setProperty(Q,`${t}px`)};if(t(),"function"!=typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const D=s??0===c.length,B=D&&0===c.length;/* @__PURE__ */
15
- return t.createElement(N,{className:q("h-full",m)},/* @__PURE__ */t.createElement(w,{className:"p-4 lg:p-8 h-full"},/* @__PURE__ */t.createElement("div",{ref:R,className:"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full",style:{[Q]:"100px"},...S},
13
+ return e.createElement("div",{ref:A,className:$("flex flex-col gap-4",f),...g},/* @__PURE__ */e.createElement(W,{title:t,breadcrumb:y,onOpenArticleLink:x,currentArticleIndex:s,totalArticles:o,displayTotalArticles:d,onNextArticle:m,onPreviousArticle:p}),/* @__PURE__ */e.createElement(_,{isNew:n,isAccepted:l,suggestionsCount:r,sourceIcon:c,sourceDescription:a,onSourceLinkClick:w,showActionButtons:u,suggestionReasonBody:k,hideAcceptAndPublishPublic:C,pendingAction:I,onAcceptAndPublish:E,onRejectAll:R,onAcceptAll:L,onAcceptAndPublishAction:z}))});function H(e){const t=e.querySelectorAll("del + ins"),n=e.querySelectorAll("ins:not(del + ins)"),l=e.querySelectorAll("del"),r=Array.from(l).filter(e=>"INS"!==e.nextElementSibling?.tagName);return t.length+n.length+r.length}function J({diffTitle:e,items:a,isLoading:s,totalItemsCount:o,showActionButtons:d=!0,children:m,sourceIcon:p,sourceDescription:f}){const{selectedItem:g,setSelectedItem:A,loadedDiffDoc:h,loadingDiff:b}=i(),C=a.length>0,I=s??!C,P=I&&!C,S=!I&&!C,j=b?"":u(h?.diffTitle??e??""),R=b?/* @__PURE__ */t.createElement("div",{className:"text-muted-foreground"},"Loading diff…"):h?.diffContent,L=b?0:(z=h?.diffTitle??e)&&"undefined"!=typeof DOMParser?H((new DOMParser).parseFromString(z,"text/html")):0;var z;const D=r(null),[B,O]=c(0);l(()=>{if(b||!h)return void O(0);const e=D.current;if(!e)return;const t=requestAnimationFrame(()=>{var t;O((t=e)?H(t):0)});return()=>cancelAnimationFrame(t)},[b,h]);const T=L+B,q=a.length,F=o??q,$=g?Math.max(0,a.findIndex(e=>e.id===g.id)):0,M=n(()=>{$<q-1&&A(a[$+1]??null)},[$,a,A,q]),W=n(()=>{$>0&&A(a[$-1]??null)},[$,a,A]),_=g?a.find(e=>e.id===g.id)??g:null,G=_?.icon??p,J=_?.description??f,Q=_?.isAccepted??!1;/* @__PURE__ */
14
+ return t.createElement(N,{className:"py-6 pl-4","data-name":"knowledge-reviews"},/* @__PURE__ */t.createElement(y,{className:"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8"},/* @__PURE__ */t.createElement(v,{className:"p-0"},C&&/* @__PURE__ */t.createElement(x,{className:"border-b border-dark-300 mb-6 pb-2 font-normal"},/* @__PURE__ */t.createElement(K,{title:j,isNew:h?.isNew??!1,isAccepted:Q,suggestionsCount:T,sourceIcon:G,sourceDescription:J,currentArticleIndex:$,totalArticles:q,displayTotalArticles:F,showActionButtons:d,onNextArticle:M,onPreviousArticle:W}))),/* @__PURE__ */t.createElement(w,{className:"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16"},/* @__PURE__ */t.createElement("div",{"aria-hidden":"true",className:"sr-only",hidden:!0},m),P?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground"},/* @__PURE__ */t.createElement(k,{className:"size-8"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium"},"Loading suggestions...")):S?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]"},/* @__PURE__ */t.createElement(E,{className:"text-muted-foreground",size:32,weight:"fill"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium text-foreground"},"All up to date. Well done, mate.")):/* @__PURE__ */t.createElement("div",{ref:D,className:"pl-12"},R))))}const Q="--knowledge-review-scroll-height",U=t.forwardRef(function({diffTitle:e="Knowledge Review",children:n,items:c,isLoading:s,totalItemsCount:o,showActionButtons:u=!0,className:m,onApproveAllSuggestions:p,onRejectAllSuggestions:f,onOpenArticleLink:g,onAcceptAndPublish:A,onApplyAllInEditor:h,onRejectAllInEditor:b,onSourceLinkClick:E,breadcrumb:v,sourceIcon:x,sourceDescription:C,suggestionReasonBody:I,hideAcceptAndPublishPublic:P,...S},j){const R=r(null),{selectedItem:L,setSelectedItem:z}=i();a(j,()=>({selectedItem:L,setSelectedItem:z}),[L,z]),l(()=>{const e=R.current;if(!e)return;const t=()=>{const{height:t}=e.getBoundingClientRect();e.style.setProperty(Q,`${t}px`)};if(t(),"function"!=typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const D=s??0===c.length,B=D&&0===c.length;/* @__PURE__ */
15
+ return t.createElement(N,{className:$("h-full",m)},/* @__PURE__ */t.createElement(w,{className:"p-4 lg:p-8 h-full"},/* @__PURE__ */t.createElement("div",{ref:R,className:"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full",style:{[Q]:"100px"},...S},
16
16
  /* @__PURE__ */t.createElement(y,{className:"h-[calc(var(--knowledge-review-scroll-height))] min-w-80 lg:block hidden"},B?/* @__PURE__ */t.createElement("div",{className:"flex h-full min-h-96 items-center justify-center text-muted-foreground"},/* @__PURE__ */t.createElement(k,{className:"size-6"})):/* @__PURE__ */t.createElement(d,{items:c})),
17
17
  /* @__PURE__ */t.createElement(J,{diffTitle:e,items:c,isLoading:D,totalItemsCount:o,showActionButtons:u,sourceIcon:x,sourceDescription:C},n))))}),V=t.forwardRef(function(e,n){const{items:l,onApproveAllSuggestions:r,onRejectAllSuggestions:c,onAcceptAndPublish:a,onApplyAllInEditor:i,onRejectAllInEditor:s,onOpenArticleLink:d,onSourceLinkClick:u,breadcrumb:m,suggestionReasonBody:p,hideAcceptAndPublishPublic:f}=e;/* @__PURE__ */
18
18
  return t.createElement(o,{defaultSelectedItem:l.find(e=>e.isSelected)??null,onApproveAllSuggestions:r,onRejectAllSuggestions:c,onAcceptAndPublish:a,onApplyAllInEditor:i,onRejectAllInEditor:s,onOpenArticleLink:d,onSourceLinkClick:u,breadcrumb:m,suggestionReasonBody:p,hideAcceptAndPublishPublic:f},
package/dist/index.d.ts CHANGED
@@ -2444,6 +2444,31 @@ declare type UrlString = string & {
2444
2444
  __url: never;
2445
2445
  };
2446
2446
 
2447
+ /**
2448
+ * Gives an indication of query usage in the platform.
2449
+ *
2450
+ * A pill button for the top navigation bar that shows the team's monthly usage
2451
+ * usage percentage. At ≥80% it renders in warning (yellow) state; at 100% in
2452
+ * reached (red) state. Clicking it opens a dropdown with links to the plan and
2453
+ * billing settings pages.
2454
+ */
2455
+ export declare function UsageIndicatorPill({ percentage, label, status, onViewPlan, onViewBilling, }: UsageIndicatorPillProps): React_2.JSX.Element;
2456
+
2457
+ export declare interface UsageIndicatorPillProps {
2458
+ /** Current usage as a percentage 0–100 */
2459
+ percentage: number;
2460
+ /** Name of the usage metric being displayed */
2461
+ label?: string;
2462
+ /** Visual state of the pill */
2463
+ status: UsageIndicatorStatus;
2464
+ /** Called when the user selects "View plan" */
2465
+ onViewPlan?: () => void;
2466
+ /** Called when the user selects "View billing settings" */
2467
+ onViewBilling?: () => void;
2468
+ }
2469
+
2470
+ export declare type UsageIndicatorStatus = 'warning' | 'reached';
2471
+
2447
2472
  export declare const useChatSearch: () => ChatSearchContextProps;
2448
2473
 
2449
2474
  export declare function useConversation(): ConversationContextValue;