@cognite/aura 1.48155.0 → 1.48322.0
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/components/index.d.ts +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/ui/core/message/message-response-table-footer.d.ts +19 -0
- package/dist/components/ui/core/message/message-response-table-footer.js +82 -0
- package/dist/components/ui/core/message/message-response-table-footer.js.map +1 -0
- package/dist/components/ui/core/message/message-response-table-labels.d.ts +11 -0
- package/dist/components/ui/core/message/message-response-table-labels.js +6 -0
- package/dist/components/ui/core/message/message-response-table-labels.js.map +1 -0
- package/dist/components/ui/core/message/message-response-table.d.ts +9 -3
- package/dist/components/ui/core/message/message-response-table.js +51 -6
- package/dist/components/ui/core/message/message-response-table.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ export { EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, Emp
|
|
|
46
46
|
export { Message, MessageContent, MessageActions, MessageAction, MessageResponse } from "./ui/core/message/message";
|
|
47
47
|
export { MESSAGE_RESPONSE_MATH_PLUGIN } from "./ui/core/message/message-response-math-plugin";
|
|
48
48
|
export { MessageResponseTable } from "./ui/core/message/message-response-table";
|
|
49
|
+
export type { MessageResponseTableLabels } from "./ui/core/message/message-response-table-labels";
|
|
49
50
|
export { usePromptInputController, PromptInputProvider, PromptInput, PromptInputBody, PromptInputTextarea, PromptInputHeader, PromptInputFooter, PromptInputTools, PromptInputButton, PromptInputActionMenu, PromptInputActionMenuTrigger, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputSubmit, PromptInputModelSelect, PromptInputModelSelectTrigger, PromptInputModelSelectContent, PromptInputModelSelectItem, PromptInputModelSelectValue, PromptInputHoverCard, PromptInputHoverCardTrigger, PromptInputHoverCardContent, PromptInputTabsList, PromptInputTab, PromptInputTabLabel, PromptInputTabBody, PromptInputTabItem, PromptInputCommand, PromptInputCommandInput, PromptInputCommandList, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandItem, PromptInputCommandSeparator } from "./ui/core/prompt-input/prompt-input";
|
|
50
51
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./ui/core/dialog/dialog";
|
|
51
52
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./ui/core/command/command";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './ui/core/accordion/accordion';\nexport {\n ActionToolbar,\n ActionToolbarAction,\n ActionToolbarActionClear,\n ActionToolbarActions,\n ActionToolbarPrimaryAction,\n ActionToolbarSelection,\n ActionToolbarSelectionSummary,\n} from './ui/core/action-toolbar/action-toolbar';\nexport {\n Card,\n CardHeader,\n CardHeaderStart,\n CardHeaderCenter,\n CardHeaderEnd,\n CardFooter,\n CardFooterStart,\n CardFooterEnd,\n CardTitle,\n CardActions,\n CardDescription,\n CardContent,\n} from './ui/core/card/card';\nexport { Button, buttonVariants } from './ui/core/button/button';\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n} from './ui/core/button-group/button-group';\nexport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n AvatarIcon,\n} from './ui/core/avatar/avatar';\nexport { Label } from './ui/core/label/label';\nexport {\n CheckboxGroup,\n CheckboxItem,\n CheckboxItemControl,\n CheckboxItemDescription,\n CheckboxItemLabel,\n} from './ui/core/checkbox/checkbox';\nexport { CheckboxMetadata } from './ui/core/checkbox/checkbox.metadata';\nexport { HelperText } from './ui/core/helper-text/helper-text';\nexport { Loader } from './ui/core/loader/loader';\nexport { Shimmer } from './ui/core/shimmer/shimmer';\nexport {\n CodeBlock,\n CodeBlockCollapseButton,\n CodeBlockCopyButton,\n CodeBlockDownloadButton,\n} from './ui/core/code-block/code-block';\nexport { Separator } from './ui/core/separator/separator';\nexport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from './ui/core/tooltip/tooltip';\nexport {\n Tool,\n ToolHeader,\n ToolContent,\n ToolInput,\n ToolOutput,\n} from './ui/core/tool/tool';\nexport {\n Toolbar,\n ToolbarButton,\n ToolbarGroup,\n ToolbarSegmentedControl,\n ToolbarSegmentedControlButton,\n ToolbarSeparator,\n ToolbarTitle,\n toolbarVariants,\n} from './ui/core/toolbar/toolbar';\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuHeader,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuSectionLabel,\n} from './ui/core/dropdown-menu/dropdown-menu';\nexport {\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemControl,\n RadioGroupItemDescription,\n RadioGroupItemLabel,\n} from './ui/core/radio-group/radio-group';\nexport { Badge, badgeVariants } from './ui/core/badge/badge';\nexport {\n Banner,\n BannerAction,\n BannerActions,\n BannerClose,\n BannerIcon,\n BannerStatus,\n BannerTitle,\n} from './ui/core/banner/banner';\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbEllipsisButton,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbPageButton,\n BreadcrumbSeparator,\n} from './ui/core/breadcrumb/breadcrumb';\nexport { type CollapseStrategy } from './ui/core/overflow-list/overflow-list.utils';\nexport {\n OverflowList,\n type OverflowListProps,\n} from './ui/core/overflow-list/overflow-list';\nexport {\n Topbar,\n TopbarAction,\n TopbarBreadcrumbs,\n TopbarCenter,\n TopbarIcon,\n TopbarLeft,\n TopbarMetadata,\n TopbarRight,\n TopbarThemeSwitcher,\n type TopbarTheme,\n} from './ui/core/topbar/topbar';\nexport { Tree } from './ui/core/tree/tree';\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from './ui/core/collapsible/collapsible';\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n} from './ui/core/hover-card/hover-card';\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from './ui/core/select/select';\nexport {\n SegmentedControl,\n SegmentedControlButton,\n SegmentedControlContent,\n SegmentedControlIndicator,\n SegmentedControlList,\n segmentedControlButtonVariants,\n segmentedControlListVariants,\n type SegmentedControlSize,\n} from './ui/core/segmented-control/segmented-control';\nexport { Skeleton } from './ui/core/skeleton/skeleton';\nexport { Slider } from './ui/core/slider/slider';\nexport { Switch } from './ui/core/switch/switch';\nexport { Toaster, toast } from './ui/core/sonner-toast/sonner-toast';\nexport { Combobox } from './ui/core/combobox/combobox';\nexport { Input } from './ui/core/input/input';\nexport {\n Item,\n ItemActions,\n ItemCheckbox,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemSectionHeader,\n ItemSectionHeaderChevron,\n ItemSectionHeaderTitle,\n ItemTitle,\n} from './ui/core/item/item';\nexport { Kbd, KbdGroup } from './ui/core/kbd/kbd';\nexport { Progress } from './ui/core/progress/progress';\nexport { Textarea } from './ui/core/textarea/textarea';\nexport {\n Tabs,\n TabsLabel,\n TabsList,\n TabsPanel,\n TabsTrigger,\n tabsListVariants,\n tabsTriggerVariants,\n} from './ui/core/tabs/tabs';\nexport { Toggle, toggleVariants } from './ui/core/toggle/toggle';\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupStepper,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n} from './ui/core/input-group/input-group';\nexport {\n Alert,\n AlertTitle,\n AlertDescription,\n AlertActions,\n AlertButton,\n AlertClose,\n} from './ui/core/alert/alert';\nexport {\n EmptyState,\n EmptyStateIcon,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n} from './ui/core/empty-state/empty-state';\nexport {\n Message,\n MessageContent,\n MessageActions,\n MessageAction,\n MessageResponse,\n} from './ui/core/message/message';\nexport { MESSAGE_RESPONSE_MATH_PLUGIN } from './ui/core/message/message-response-math-plugin';\nexport { MessageResponseTable } from './ui/core/message/message-response-table';\nexport {\n usePromptInputController,\n PromptInputProvider,\n PromptInput,\n PromptInputBody,\n PromptInputTextarea,\n PromptInputHeader,\n PromptInputFooter,\n PromptInputTools,\n PromptInputButton,\n PromptInputActionMenu,\n PromptInputActionMenuTrigger,\n PromptInputActionMenuContent,\n PromptInputActionMenuItem,\n PromptInputSubmit,\n PromptInputModelSelect,\n PromptInputModelSelectTrigger,\n PromptInputModelSelectContent,\n PromptInputModelSelectItem,\n PromptInputModelSelectValue,\n PromptInputHoverCard,\n PromptInputHoverCardTrigger,\n PromptInputHoverCardContent,\n PromptInputTabsList,\n PromptInputTab,\n PromptInputTabLabel,\n PromptInputTabBody,\n PromptInputTabItem,\n PromptInputCommand,\n PromptInputCommandInput,\n PromptInputCommandList,\n PromptInputCommandEmpty,\n PromptInputCommandGroup,\n PromptInputCommandItem,\n PromptInputCommandSeparator,\n} from './ui/core/prompt-input/prompt-input';\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from './ui/core/dialog/dialog';\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n} from './ui/core/command/command';\nexport {\n Conversation,\n ConversationContent,\n ConversationScrollButton,\n ConversationTurn,\n useStickToBottomContext,\n} from './ui/core/conversation/conversation';\nexport {\n Count,\n CountUnit,\n CountValue,\n countVariants,\n} from './ui/core/count/count';\nexport {\n InlineCitation,\n InlineCitationGroup,\n InlineCitationText,\n InlineCitationCard,\n InlineCitationCardTrigger,\n InlineCitationCardBody,\n InlineCitationSource,\n InlineCitationQuote,\n InlineCitationLink,\n type InlineCitationLinkProps,\n} from './ui/core/inline-citation/inline-citation';\nexport {\n Reasoning,\n ReasoningContent,\n ReasoningHeader,\n ReasoningItem,\n} from './ui/core/reasoning/reasoning';\nexport { ScrollArea, ScrollBar } from './ui/core/scroll-area/scroll-area';\nexport { Search } from './ui/core/search/search';\nexport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n} from './ui/core/popover/popover';\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationFirst,\n PaginationItem,\n PaginationLast,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n PaginationResultsPerPage,\n PaginationResultsPerPageLabel,\n PaginationSelectTrigger,\n PaginationStatus,\n PaginationTeleport,\n} from './ui/core/pagination/pagination';\nexport { Sources, SourcesTitle, Source } from './ui/core/sources/sources';\nexport {\n DatePicker,\n DateRangePicker,\n DateTimePicker,\n DateTimeRangePicker,\n TimePicker,\n TimeRangePicker,\n} from './ui/core/date-time-pickers';\nexport type {\n AmPm,\n DateInput,\n DatePickerProps,\n DateRangePickerProps,\n DateRangeValueProps,\n DateTimePickerProps,\n DateTimeRangePickerProps,\n DateValueProps,\n DateValueType,\n ShortcutItem,\n TimeFormat,\n TimePickerProps,\n TimeRangePickerProps,\n} from './ui/core/date-time-pickers';\nexport { PortalContainerContext } from '../lib/portal-container-context';\nexport type { ComponentMeta, ComponentStatusType } from '../lib/types';\n"],"names":["Accordion","AccordionContent","AccordionItem","AccordionTrigger","ActionToolbar","ActionToolbarAction","ActionToolbarActionClear","ActionToolbarActions","ActionToolbarPrimaryAction","ActionToolbarSelection","ActionToolbarSelectionSummary","Card","CardHeader","CardHeaderStart","CardHeaderCenter","CardHeaderEnd","CardFooter","CardFooterStart","CardFooterEnd","CardTitle","CardActions","CardDescription","CardContent","Button","buttonVariants","ButtonGroup","ButtonGroupSeparator","ButtonGroupText","buttonGroupVariants","Avatar","AvatarImage","AvatarFallback","AvatarIcon","Label","CheckboxGroup","CheckboxItem","CheckboxItemControl","CheckboxItemDescription","CheckboxItemLabel","CheckboxMetadata","HelperText","Loader","Shimmer","CodeBlock","CodeBlockCollapseButton","CodeBlockCopyButton","CodeBlockDownloadButton","Separator","Tooltip","TooltipContent","TooltipProvider","TooltipTrigger","Tool","ToolHeader","ToolContent","ToolInput","ToolOutput","Toolbar","ToolbarButton","ToolbarGroup","ToolbarSegmentedControl","ToolbarSegmentedControlButton","ToolbarSeparator","ToolbarTitle","toolbarVariants","DropdownMenu","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuGroup","DropdownMenuLabel","DropdownMenuHeader","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","DropdownMenuSectionLabel","RadioGroup","RadioGroupItem","RadioGroupItemControl","RadioGroupItemDescription","RadioGroupItemLabel","Badge","badgeVariants","Banner","BannerAction","BannerActions","BannerClose","BannerIcon","BannerStatus","BannerTitle","Breadcrumb","BreadcrumbEllipsis","BreadcrumbEllipsisButton","BreadcrumbItem","BreadcrumbLink","BreadcrumbList","BreadcrumbPage","BreadcrumbPageButton","BreadcrumbSeparator","OverflowList","Topbar","TopbarAction","TopbarBreadcrumbs","TopbarCenter","TopbarIcon","TopbarLeft","TopbarMetadata","TopbarRight","TopbarThemeSwitcher","Tree","Collapsible","CollapsibleContent","CollapsibleTrigger","HoverCard","HoverCardTrigger","HoverCardContent","Select","SelectContent","SelectGroup","SelectItem","SelectLabel","SelectScrollDownButton","SelectScrollUpButton","SelectSeparator","SelectTrigger","SelectValue","SegmentedControl","SegmentedControlButton","SegmentedControlContent","SegmentedControlIndicator","SegmentedControlList","segmentedControlButtonVariants","segmentedControlListVariants","Skeleton","Slider","Switch","Toaster","toast","Combobox","Input","Item","ItemActions","ItemCheckbox","ItemContent","ItemDescription","ItemGroup","ItemMedia","ItemSectionHeader","ItemSectionHeaderChevron","ItemSectionHeaderTitle","ItemTitle","Kbd","KbdGroup","Progress","Textarea","Tabs","TabsLabel","TabsList","TabsPanel","TabsTrigger","tabsListVariants","tabsTriggerVariants","Toggle","toggleVariants","InputGroup","InputGroupAddon","InputGroupButton","InputGroupStepper","InputGroupText","InputGroupInput","InputGroupTextarea","Alert","AlertTitle","AlertDescription","AlertActions","AlertButton","AlertClose","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","Message","MessageContent","MessageActions","MessageAction","MessageResponse","MESSAGE_RESPONSE_MATH_PLUGIN","MessageResponseTable","usePromptInputController","PromptInputProvider","PromptInput","PromptInputBody","PromptInputTextarea","PromptInputHeader","PromptInputFooter","PromptInputTools","PromptInputButton","PromptInputActionMenu","PromptInputActionMenuTrigger","PromptInputActionMenuContent","PromptInputActionMenuItem","PromptInputSubmit","PromptInputModelSelect","PromptInputModelSelectTrigger","PromptInputModelSelectContent","PromptInputModelSelectItem","PromptInputModelSelectValue","PromptInputHoverCard","PromptInputHoverCardTrigger","PromptInputHoverCardContent","PromptInputTabsList","PromptInputTab","PromptInputTabLabel","PromptInputTabBody","PromptInputTabItem","PromptInputCommand","PromptInputCommandInput","PromptInputCommandList","PromptInputCommandEmpty","PromptInputCommandGroup","PromptInputCommandItem","PromptInputCommandSeparator","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogOverlay","DialogPortal","DialogTitle","DialogTrigger","Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","Conversation","ConversationContent","ConversationScrollButton","ConversationTurn","useStickToBottomContext","Count","CountUnit","CountValue","countVariants","InlineCitation","InlineCitationGroup","InlineCitationText","InlineCitationCard","InlineCitationCardTrigger","InlineCitationCardBody","InlineCitationSource","InlineCitationQuote","InlineCitationLink","Reasoning","ReasoningContent","ReasoningHeader","ReasoningItem","ScrollArea","ScrollBar","Search","Popover","PopoverClose","PopoverContent","PopoverDescription","PopoverHeader","PopoverHeaderContent","PopoverSlot","PopoverTitle","PopoverTrigger","Pagination","PaginationContent","PaginationEllipsis","PaginationFirst","PaginationItem","PaginationLast","PaginationLink","PaginationNext","PaginationPrevious","PaginationResultsPerPage","PaginationResultsPerPageLabel","PaginationSelectTrigger","PaginationStatus","PaginationTeleport","Sources","SourcesTitle","Source","DatePicker","DateRangePicker","DateTimePicker","DateTimeRangePicker","TimePicker","TimeRangePicker","PortalContainerContext"],"mappings":"AAAA,SACEA,SAAS,EACTC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,mCAAgC;AACvC,SACEC,aAAa,EACbC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,0BAA0B,EAC1BC,sBAAsB,EACtBC,6BAA6B,QACxB,6CAA0C;AACjD,SACEC,IAAI,EACJC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,UAAU,EACVC,eAAe,EACfC,aAAa,EACbC,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,WAAW,QACN,yBAAsB;AAC7B,SAASC,MAAM,EAAEC,cAAc,QAAQ,6BAA0B;AACjE,SACEC,WAAW,EACXC,oBAAoB,EACpBC,eAAe,EACfC,mBAAmB,QACd,yCAAsC;AAC7C,SACEC,MAAM,EACNC,WAAW,EACXC,cAAc,EACdC,UAAU,QACL,6BAA0B;AACjC,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SACEC,aAAa,EACbC,YAAY,EACZC,mBAAmB,EACnBC,uBAAuB,E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EACZC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,eAAe,QACV,+BAA4B;AACnC,SACEC,YAAY,EACZC,mBAAmB,EACnBC,wBAAwB,EACxBC,gBAAgB,EAChBC,uBAAuB,QAClB,yCAAsC;AAC7C,SACEC,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,aAAa,QACR,2BAAwB;AAC/B,SACEC,cAAc,EACdC,mBAAmB,EACnBC,kBAAkB,EAClBC,kBAAkB,EAClBC,yBAAyB,EACzBC,sBAAsB,EACtBC,oBAAoB,EACpBC,mBAAmB,EACnBC,kBAAkB,QAEb,+CAA4C;AACnD,SACEC,SAAS,EACTC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,QACR,mCAAgC;AACvC,SAASC,UAAU,EAAEC,SAAS,QAAQ,uCAAoC;AAC1E,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SACEC,OAAO,EACPC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,aAAa,EACbC,oBAAoB,EACpBC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,+BAA4B;AACnC,SACEC,UAAU,EACVC,iBAAiB,EACjBC,kBAAkB,EAClBC,eAAe,EACfC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,uBAAuB,EACvBC,gBAAgB,EAChBC,kBAAkB,QACb,qCAAkC;AACzC,SAASC,OAAO,EAAEC,YAAY,EAAEC,MAAM,QAAQ,+BAA4B;AAC1E,SACEC,UAAU,EACVC,eAAe,EACfC,cAAc,EACdC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,QACV,uCAA8B;AAgBrC,SAASC,sBAAsB,QAAQ,qCAAkC"}
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './ui/core/accordion/accordion';\nexport {\n ActionToolbar,\n ActionToolbarAction,\n ActionToolbarActionClear,\n ActionToolbarActions,\n ActionToolbarPrimaryAction,\n ActionToolbarSelection,\n ActionToolbarSelectionSummary,\n} from './ui/core/action-toolbar/action-toolbar';\nexport {\n Card,\n CardHeader,\n CardHeaderStart,\n CardHeaderCenter,\n CardHeaderEnd,\n CardFooter,\n CardFooterStart,\n CardFooterEnd,\n CardTitle,\n CardActions,\n CardDescription,\n CardContent,\n} from './ui/core/card/card';\nexport { Button, buttonVariants } from './ui/core/button/button';\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n} from './ui/core/button-group/button-group';\nexport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n AvatarIcon,\n} from './ui/core/avatar/avatar';\nexport { Label } from './ui/core/label/label';\nexport {\n CheckboxGroup,\n CheckboxItem,\n CheckboxItemControl,\n CheckboxItemDescription,\n CheckboxItemLabel,\n} from './ui/core/checkbox/checkbox';\nexport { CheckboxMetadata } from './ui/core/checkbox/checkbox.metadata';\nexport { HelperText } from './ui/core/helper-text/helper-text';\nexport { Loader } from './ui/core/loader/loader';\nexport { Shimmer } from './ui/core/shimmer/shimmer';\nexport {\n CodeBlock,\n CodeBlockCollapseButton,\n CodeBlockCopyButton,\n CodeBlockDownloadButton,\n} from './ui/core/code-block/code-block';\nexport { Separator } from './ui/core/separator/separator';\nexport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from './ui/core/tooltip/tooltip';\nexport {\n Tool,\n ToolHeader,\n ToolContent,\n ToolInput,\n ToolOutput,\n} from './ui/core/tool/tool';\nexport {\n Toolbar,\n ToolbarButton,\n ToolbarGroup,\n ToolbarSegmentedControl,\n ToolbarSegmentedControlButton,\n ToolbarSeparator,\n ToolbarTitle,\n toolbarVariants,\n} from './ui/core/toolbar/toolbar';\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuHeader,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuSectionLabel,\n} from './ui/core/dropdown-menu/dropdown-menu';\nexport {\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemControl,\n RadioGroupItemDescription,\n RadioGroupItemLabel,\n} from './ui/core/radio-group/radio-group';\nexport { Badge, badgeVariants } from './ui/core/badge/badge';\nexport {\n Banner,\n BannerAction,\n BannerActions,\n BannerClose,\n BannerIcon,\n BannerStatus,\n BannerTitle,\n} from './ui/core/banner/banner';\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbEllipsisButton,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbPageButton,\n BreadcrumbSeparator,\n} from './ui/core/breadcrumb/breadcrumb';\nexport { type CollapseStrategy } from './ui/core/overflow-list/overflow-list.utils';\nexport {\n OverflowList,\n type OverflowListProps,\n} from './ui/core/overflow-list/overflow-list';\nexport {\n Topbar,\n TopbarAction,\n TopbarBreadcrumbs,\n TopbarCenter,\n TopbarIcon,\n TopbarLeft,\n TopbarMetadata,\n TopbarRight,\n TopbarThemeSwitcher,\n type TopbarTheme,\n} from './ui/core/topbar/topbar';\nexport { Tree } from './ui/core/tree/tree';\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from './ui/core/collapsible/collapsible';\nexport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n} from './ui/core/hover-card/hover-card';\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from './ui/core/select/select';\nexport {\n SegmentedControl,\n SegmentedControlButton,\n SegmentedControlContent,\n SegmentedControlIndicator,\n SegmentedControlList,\n segmentedControlButtonVariants,\n segmentedControlListVariants,\n type SegmentedControlSize,\n} from './ui/core/segmented-control/segmented-control';\nexport { Skeleton } from './ui/core/skeleton/skeleton';\nexport { Slider } from './ui/core/slider/slider';\nexport { Switch } from './ui/core/switch/switch';\nexport { Toaster, toast } from './ui/core/sonner-toast/sonner-toast';\nexport { Combobox } from './ui/core/combobox/combobox';\nexport { Input } from './ui/core/input/input';\nexport {\n Item,\n ItemActions,\n ItemCheckbox,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemMedia,\n ItemSectionHeader,\n ItemSectionHeaderChevron,\n ItemSectionHeaderTitle,\n ItemTitle,\n} from './ui/core/item/item';\nexport { Kbd, KbdGroup } from './ui/core/kbd/kbd';\nexport { Progress } from './ui/core/progress/progress';\nexport { Textarea } from './ui/core/textarea/textarea';\nexport {\n Tabs,\n TabsLabel,\n TabsList,\n TabsPanel,\n TabsTrigger,\n tabsListVariants,\n tabsTriggerVariants,\n} from './ui/core/tabs/tabs';\nexport { Toggle, toggleVariants } from './ui/core/toggle/toggle';\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupStepper,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n} from './ui/core/input-group/input-group';\nexport {\n Alert,\n AlertTitle,\n AlertDescription,\n AlertActions,\n AlertButton,\n AlertClose,\n} from './ui/core/alert/alert';\nexport {\n EmptyState,\n EmptyStateIcon,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n} from './ui/core/empty-state/empty-state';\nexport {\n Message,\n MessageContent,\n MessageActions,\n MessageAction,\n MessageResponse,\n} from './ui/core/message/message';\nexport { MESSAGE_RESPONSE_MATH_PLUGIN } from './ui/core/message/message-response-math-plugin';\nexport { MessageResponseTable } from './ui/core/message/message-response-table';\nexport type { MessageResponseTableLabels } from './ui/core/message/message-response-table-labels';\nexport {\n usePromptInputController,\n PromptInputProvider,\n PromptInput,\n PromptInputBody,\n PromptInputTextarea,\n PromptInputHeader,\n PromptInputFooter,\n PromptInputTools,\n PromptInputButton,\n PromptInputActionMenu,\n PromptInputActionMenuTrigger,\n PromptInputActionMenuContent,\n PromptInputActionMenuItem,\n PromptInputSubmit,\n PromptInputModelSelect,\n PromptInputModelSelectTrigger,\n PromptInputModelSelectContent,\n PromptInputModelSelectItem,\n PromptInputModelSelectValue,\n PromptInputHoverCard,\n PromptInputHoverCardTrigger,\n PromptInputHoverCardContent,\n PromptInputTabsList,\n PromptInputTab,\n PromptInputTabLabel,\n PromptInputTabBody,\n PromptInputTabItem,\n PromptInputCommand,\n PromptInputCommandInput,\n PromptInputCommandList,\n PromptInputCommandEmpty,\n PromptInputCommandGroup,\n PromptInputCommandItem,\n PromptInputCommandSeparator,\n} from './ui/core/prompt-input/prompt-input';\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from './ui/core/dialog/dialog';\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n} from './ui/core/command/command';\nexport {\n Conversation,\n ConversationContent,\n ConversationScrollButton,\n ConversationTurn,\n useStickToBottomContext,\n} from './ui/core/conversation/conversation';\nexport {\n Count,\n CountUnit,\n CountValue,\n countVariants,\n} from './ui/core/count/count';\nexport {\n InlineCitation,\n InlineCitationGroup,\n InlineCitationText,\n InlineCitationCard,\n InlineCitationCardTrigger,\n InlineCitationCardBody,\n InlineCitationSource,\n InlineCitationQuote,\n InlineCitationLink,\n type InlineCitationLinkProps,\n} from './ui/core/inline-citation/inline-citation';\nexport {\n Reasoning,\n ReasoningContent,\n ReasoningHeader,\n ReasoningItem,\n} from './ui/core/reasoning/reasoning';\nexport { ScrollArea, ScrollBar } from './ui/core/scroll-area/scroll-area';\nexport { Search } from './ui/core/search/search';\nexport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverHeaderContent,\n PopoverSlot,\n PopoverTitle,\n PopoverTrigger,\n} from './ui/core/popover/popover';\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationFirst,\n PaginationItem,\n PaginationLast,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n PaginationResultsPerPage,\n PaginationResultsPerPageLabel,\n PaginationSelectTrigger,\n PaginationStatus,\n PaginationTeleport,\n} from './ui/core/pagination/pagination';\nexport { Sources, SourcesTitle, Source } from './ui/core/sources/sources';\nexport {\n DatePicker,\n DateRangePicker,\n DateTimePicker,\n DateTimeRangePicker,\n TimePicker,\n TimeRangePicker,\n} from './ui/core/date-time-pickers';\nexport type {\n AmPm,\n DateInput,\n DatePickerProps,\n DateRangePickerProps,\n DateRangeValueProps,\n DateTimePickerProps,\n DateTimeRangePickerProps,\n DateValueProps,\n DateValueType,\n ShortcutItem,\n TimeFormat,\n TimePickerProps,\n TimeRangePickerProps,\n} from './ui/core/date-time-pickers';\nexport { PortalContainerContext } from '../lib/portal-container-context';\nexport type { ComponentMeta, ComponentStatusType } from '../lib/types';\n"],"names":["Accordion","AccordionContent","AccordionItem","AccordionTrigger","ActionToolbar","ActionToolbarAction","ActionToolbarActionClear","ActionToolbarActions","ActionToolbarPrimaryAction","ActionToolbarSelection","ActionToolbarSelectionSummary","Card","CardHeader","CardHeaderStart","CardHeaderCenter","CardHeaderEnd","CardFooter","CardFooterStart","CardFooterEnd","CardTitle","CardActions","CardDescription","CardContent","Button","buttonVariants","ButtonGroup","ButtonGroupSeparator","ButtonGroupText","buttonGroupVariants","Avatar","AvatarImage","AvatarFallback","AvatarIcon","Label","CheckboxGroup","CheckboxItem","CheckboxItemControl","CheckboxItemDescription","CheckboxItemLabel","CheckboxMetadata","HelperText","Loader","Shimmer","CodeBlock","CodeBlockCollapseButton","CodeBlockCopyButton","CodeBlockDownloadButton","Separator","Tooltip","TooltipContent","TooltipProvider","TooltipTrigger","Tool","ToolHeader","ToolContent","ToolInput","ToolOutput","Toolbar","ToolbarButton","ToolbarGroup","ToolbarSegmentedControl","ToolbarSegmentedControlButton","ToolbarSeparator","ToolbarTitle","toolbarVariants","DropdownMenu","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuGroup","DropdownMenuLabel","DropdownMenuHeader","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","DropdownMenuSectionLabel","RadioGroup","RadioGroupItem","RadioGroupItemControl","RadioGroupItemDescription","RadioGroupItemLabel","Badge","badgeVariants","Banner","BannerAction","BannerActions","BannerClose","BannerIcon","BannerStatus","BannerTitle","Breadcrumb","BreadcrumbEllipsis","BreadcrumbEllipsisButton","BreadcrumbItem","BreadcrumbLink","BreadcrumbList","BreadcrumbPage","BreadcrumbPageButton","BreadcrumbSeparator","OverflowList","Topbar","TopbarAction","TopbarBreadcrumbs","TopbarCenter","TopbarIcon","TopbarLeft","TopbarMetadata","TopbarRight","TopbarThemeSwitcher","Tree","Collapsible","CollapsibleContent","CollapsibleTrigger","HoverCard","HoverCardTrigger","HoverCardContent","Select","SelectContent","SelectGroup","SelectItem","SelectLabel","SelectScrollDownButton","SelectScrollUpButton","SelectSeparator","SelectTrigger","SelectValue","SegmentedControl","SegmentedControlButton","SegmentedControlContent","SegmentedControlIndicator","SegmentedControlList","segmentedControlButtonVariants","segmentedControlListVariants","Skeleton","Slider","Switch","Toaster","toast","Combobox","Input","Item","ItemActions","ItemCheckbox","ItemContent","ItemDescription","ItemGroup","ItemMedia","ItemSectionHeader","ItemSectionHeaderChevron","ItemSectionHeaderTitle","ItemTitle","Kbd","KbdGroup","Progress","Textarea","Tabs","TabsLabel","TabsList","TabsPanel","TabsTrigger","tabsListVariants","tabsTriggerVariants","Toggle","toggleVariants","InputGroup","InputGroupAddon","InputGroupButton","InputGroupStepper","InputGroupText","InputGroupInput","InputGroupTextarea","Alert","AlertTitle","AlertDescription","AlertActions","AlertButton","AlertClose","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","Message","MessageContent","MessageActions","MessageAction","MessageResponse","MESSAGE_RESPONSE_MATH_PLUGIN","MessageResponseTable","usePromptInputController","PromptInputProvider","PromptInput","PromptInputBody","PromptInputTextarea","PromptInputHeader","PromptInputFooter","PromptInputTools","PromptInputButton","PromptInputActionMenu","PromptInputActionMenuTrigger","PromptInputActionMenuContent","PromptInputActionMenuItem","PromptInputSubmit","PromptInputModelSelect","PromptInputModelSelectTrigger","PromptInputModelSelectContent","PromptInputModelSelectItem","PromptInputModelSelectValue","PromptInputHoverCard","PromptInputHoverCardTrigger","PromptInputHoverCardContent","PromptInputTabsList","PromptInputTab","PromptInputTabLabel","PromptInputTabBody","PromptInputTabItem","PromptInputCommand","PromptInputCommandInput","PromptInputCommandList","PromptInputCommandEmpty","PromptInputCommandGroup","PromptInputCommandItem","PromptInputCommandSeparator","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogOverlay","DialogPortal","DialogTitle","DialogTrigger","Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","Conversation","ConversationContent","ConversationScrollButton","ConversationTurn","useStickToBottomContext","Count","CountUnit","CountValue","countVariants","InlineCitation","InlineCitationGroup","InlineCitationText","InlineCitationCard","InlineCitationCardTrigger","InlineCitationCardBody","InlineCitationSource","InlineCitationQuote","InlineCitationLink","Reasoning","ReasoningContent","ReasoningHeader","ReasoningItem","ScrollArea","ScrollBar","Search","Popover","PopoverClose","PopoverContent","PopoverDescription","PopoverHeader","PopoverHeaderContent","PopoverSlot","PopoverTitle","PopoverTrigger","Pagination","PaginationContent","PaginationEllipsis","PaginationFirst","PaginationItem","PaginationLast","PaginationLink","PaginationNext","PaginationPrevious","PaginationResultsPerPage","PaginationResultsPerPageLabel","PaginationSelectTrigger","PaginationStatus","PaginationTeleport","Sources","SourcesTitle","Source","DatePicker","DateRangePicker","DateTimePicker","DateTimeRangePicker","TimePicker","TimeRangePicker","PortalContainerContext"],"mappings":"AAAA,SACEA,SAAS,EACTC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,mCAAgC;AACvC,SACEC,aAAa,EACbC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,0BAA0B,EAC1BC,sBAAsB,EACtBC,6BAA6B,QACxB,6CAA0C;AACjD,SACEC,IAAI,EACJC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,UAAU,EACVC,eAAe,EACfC,aAAa,EACbC,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,WAAW,QACN,yBAAsB;AAC7B,SAASC,MAAM,EAAEC,cAAc,QAAQ,6BAA0B;AACjE,SACEC,WAAW,EACXC,oBAAoB,EACpBC,eAAe,EACfC,mBAAmB,QACd,yCAAsC;AAC7C,SACEC,MAAM,EACNC,WAAW,EACXC,cAAc,EACdC,UAAU,QACL,6BAA0B;AACjC,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SACEC,aAAa,EACbC,YAAY,EACZC,mBAAmB,EACnBC,uBAAuB,EACvBC,iBAAiB,QACZ,iCAA8B;AACrC,SAASC,gBAAgB,QAAQ,0CAAuC;AACxE,SAASC,UAAU,QAAQ,uCAAoC;AAC/D,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SAASC,OAAO,QAAQ,+BAA4B;AACpD,SACEC,SAAS,EACTC,uBAAuB,EACvBC,mBAAmB,EACnBC,uBAAuB,QAClB,qCAAkC;AACzC,SAASC,SAAS,QAAQ,mCAAgC;AAC1D,SACEC,OAAO,EACPC,cAAc,EACdC,eAAe,EACfC,cAAc,QACT,+BAA4B;AACnC,SACEC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,UAAU,QACL,yBAAsB;AAC7B,S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C,aAAa,QACR,mCAAgC;AACvC,SAASC,UAAU,EAAEC,SAAS,QAAQ,uCAAoC;AAC1E,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SACEC,OAAO,EACPC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,aAAa,EACbC,oBAAoB,EACpBC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,+BAA4B;AACnC,SACEC,UAAU,EACVC,iBAAiB,EACjBC,kBAAkB,EAClBC,eAAe,EACfC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,uBAAuB,EACvBC,gBAAgB,EAChBC,kBAAkB,QACb,qCAAkC;AACzC,SAASC,OAAO,EAAEC,YAAY,EAAEC,MAAM,QAAQ,+BAA4B;AAC1E,SACEC,UAAU,EACVC,eAAe,EACfC,cAAc,EACdC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,QACV,uCAA8B;AAgBrC,SAASC,sBAAsB,QAAQ,qCAAkC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { MessageResponseTableLabels } from "./message-response-table-labels";
|
|
3
|
+
/**
|
|
4
|
+
* Up to this many pages, the footer uses Aura's numbered pagination layout and
|
|
5
|
+
* lists every page; beyond it, the teleport layout (`1/12` input). Five pages
|
|
6
|
+
* all fit without ellipses, and at 50 rows per page most chat tables stay below it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_NUMBERED_PAGES = 5;
|
|
9
|
+
type MessageTableFooterProps = {
|
|
10
|
+
pageIndex: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
totalPages: number;
|
|
13
|
+
totalRows: number;
|
|
14
|
+
onPageIndexChange: (pageIndex: number) => void;
|
|
15
|
+
labels: Pick<MessageResponseTableLabels, "currentPage" | "paginationStatus">;
|
|
16
|
+
};
|
|
17
|
+
/** Pagination footer for `MessageResponseTable`: page links or the teleport input, plus a "Showing x–y of n" status. */
|
|
18
|
+
export declare const MessageTableFooter: ({ pageIndex, pageSize, totalPages, totalRows, onPageIndexChange, labels }: MessageTableFooterProps) => ReactNode;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DataGridFooter } from "../data-grid/data-grid.js";
|
|
3
|
+
import { Pagination, PaginationContent, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationStatus } from "../pagination/pagination.js";
|
|
4
|
+
import { PaginationTeleport } from "../pagination/pagination-teleport.js";
|
|
5
|
+
/**
|
|
6
|
+
* Up to this many pages, the footer uses Aura's numbered pagination layout and
|
|
7
|
+
* lists every page; beyond it, the teleport layout (`1/12` input). Five pages
|
|
8
|
+
* all fit without ellipses, and at 50 rows per page most chat tables stay below it.
|
|
9
|
+
*/ export const MAX_NUMBERED_PAGES = 5;
|
|
10
|
+
/** Pagination footer for `MessageResponseTable`: page links or the teleport input, plus a "Showing x–y of n" status. */ export const MessageTableFooter = ({ pageIndex, pageSize, totalPages, totalRows, onPageIndexChange, labels })=>{
|
|
11
|
+
const pageStart = pageIndex * pageSize + 1;
|
|
12
|
+
const pageEnd = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
13
|
+
const isFirstPage = pageIndex === 0;
|
|
14
|
+
const isLastPage = pageIndex >= totalPages - 1;
|
|
15
|
+
const goToPage = (nextPageIndex)=>(event)=>{
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
onPageIndexChange(nextPageIndex);
|
|
18
|
+
};
|
|
19
|
+
return /*#__PURE__*/ _jsx(DataGridFooter, {
|
|
20
|
+
children: /*#__PURE__*/ _jsxs(Pagination, {
|
|
21
|
+
size: "small",
|
|
22
|
+
className: "items-center justify-between",
|
|
23
|
+
children: [
|
|
24
|
+
totalPages > 1 && /*#__PURE__*/ _jsxs(PaginationContent, {
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ _jsx(PaginationItem, {
|
|
27
|
+
children: /*#__PURE__*/ _jsx(PaginationFirst, {
|
|
28
|
+
href: "#",
|
|
29
|
+
isDisabled: isFirstPage,
|
|
30
|
+
onClick: goToPage(0)
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ _jsx(PaginationItem, {
|
|
34
|
+
children: /*#__PURE__*/ _jsx(PaginationPrevious, {
|
|
35
|
+
href: "#",
|
|
36
|
+
isDisabled: isFirstPage,
|
|
37
|
+
onClick: goToPage(pageIndex - 1)
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
totalPages <= MAX_NUMBERED_PAGES ? Array.from({
|
|
41
|
+
length: totalPages
|
|
42
|
+
}, (_, index)=>/*#__PURE__*/ _jsx(PaginationItem, {
|
|
43
|
+
children: /*#__PURE__*/ _jsx(PaginationLink, {
|
|
44
|
+
href: "#",
|
|
45
|
+
isActive: index === pageIndex,
|
|
46
|
+
onClick: goToPage(index),
|
|
47
|
+
children: index + 1
|
|
48
|
+
})
|
|
49
|
+
}, index)) : /*#__PURE__*/ _jsx(PaginationItem, {
|
|
50
|
+
children: /*#__PURE__*/ _jsx(PaginationTeleport, {
|
|
51
|
+
"aria-label": labels.currentPage,
|
|
52
|
+
currentPage: pageIndex + 1,
|
|
53
|
+
totalPages: totalPages,
|
|
54
|
+
onPageChange: (page)=>onPageIndexChange(page - 1)
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ _jsx(PaginationItem, {
|
|
58
|
+
children: /*#__PURE__*/ _jsx(PaginationNext, {
|
|
59
|
+
href: "#",
|
|
60
|
+
isDisabled: isLastPage,
|
|
61
|
+
onClick: goToPage(pageIndex + 1)
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ _jsx(PaginationItem, {
|
|
65
|
+
children: /*#__PURE__*/ _jsx(PaginationLast, {
|
|
66
|
+
href: "#",
|
|
67
|
+
isDisabled: isLastPage,
|
|
68
|
+
onClick: goToPage(totalPages - 1)
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ _jsx(PaginationStatus, {
|
|
74
|
+
className: "ml-auto",
|
|
75
|
+
children: labels.paginationStatus(pageStart, pageEnd, totalRows)
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=message-response-table-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-table-footer.tsx"],"sourcesContent":["import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react';\n\nimport { DataGridFooter } from '../data-grid/data-grid';\nimport {\n Pagination,\n PaginationContent,\n PaginationFirst,\n PaginationItem,\n PaginationLast,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n PaginationStatus,\n} from '../pagination/pagination';\nimport { PaginationTeleport } from '../pagination/pagination-teleport';\n\nimport type { MessageResponseTableLabels } from './message-response-table-labels';\n\n/**\n * Up to this many pages, the footer uses Aura's numbered pagination layout and\n * lists every page; beyond it, the teleport layout (`1/12` input). Five pages\n * all fit without ellipses, and at 50 rows per page most chat tables stay below it.\n */\nexport const MAX_NUMBERED_PAGES = 5;\n\ntype MessageTableFooterProps = {\n pageIndex: number;\n pageSize: number;\n totalPages: number;\n totalRows: number;\n onPageIndexChange: (pageIndex: number) => void;\n labels: Pick<MessageResponseTableLabels, 'currentPage' | 'paginationStatus'>;\n};\n\n/** Pagination footer for `MessageResponseTable`: page links or the teleport input, plus a \"Showing x–y of n\" status. */\nexport const MessageTableFooter = ({\n pageIndex,\n pageSize,\n totalPages,\n totalRows,\n onPageIndexChange,\n labels,\n}: MessageTableFooterProps): ReactNode => {\n const pageStart = pageIndex * pageSize + 1;\n const pageEnd = Math.min((pageIndex + 1) * pageSize, totalRows);\n const isFirstPage = pageIndex === 0;\n const isLastPage = pageIndex >= totalPages - 1;\n\n const goToPage =\n (nextPageIndex: number) =>\n (event: ReactMouseEvent<HTMLAnchorElement>): void => {\n event.preventDefault();\n onPageIndexChange(nextPageIndex);\n };\n\n return (\n <DataGridFooter>\n <Pagination size=\"small\" className=\"items-center justify-between\">\n {totalPages > 1 && (\n <PaginationContent>\n <PaginationItem>\n <PaginationFirst\n href=\"#\"\n isDisabled={isFirstPage}\n onClick={goToPage(0)}\n />\n </PaginationItem>\n <PaginationItem>\n <PaginationPrevious\n href=\"#\"\n isDisabled={isFirstPage}\n onClick={goToPage(pageIndex - 1)}\n />\n </PaginationItem>\n {totalPages <= MAX_NUMBERED_PAGES ? (\n Array.from({ length: totalPages }, (_, index) => (\n <PaginationItem key={index}>\n <PaginationLink\n href=\"#\"\n isActive={index === pageIndex}\n onClick={goToPage(index)}\n >\n {index + 1}\n </PaginationLink>\n </PaginationItem>\n ))\n ) : (\n <PaginationItem>\n <PaginationTeleport\n aria-label={labels.currentPage}\n currentPage={pageIndex + 1}\n totalPages={totalPages}\n onPageChange={(page) => onPageIndexChange(page - 1)}\n />\n </PaginationItem>\n )}\n <PaginationItem>\n <PaginationNext\n href=\"#\"\n isDisabled={isLastPage}\n onClick={goToPage(pageIndex + 1)}\n />\n </PaginationItem>\n <PaginationItem>\n <PaginationLast\n href=\"#\"\n isDisabled={isLastPage}\n onClick={goToPage(totalPages - 1)}\n />\n </PaginationItem>\n </PaginationContent>\n )}\n <PaginationStatus className=\"ml-auto\">\n {labels.paginationStatus(pageStart, pageEnd, totalRows)}\n </PaginationStatus>\n </Pagination>\n </DataGridFooter>\n );\n};\n"],"names":["DataGridFooter","Pagination","PaginationContent","PaginationFirst","PaginationItem","PaginationLast","PaginationLink","PaginationNext","PaginationPrevious","PaginationStatus","PaginationTeleport","MAX_NUMBERED_PAGES","MessageTableFooter","pageIndex","pageSize","totalPages","totalRows","onPageIndexChange","labels","pageStart","pageEnd","Math","min","isFirstPage","isLastPage","goToPage","nextPageIndex","event","preventDefault","size","className","href","isDisabled","onClick","Array","from","length","_","index","isActive","aria-label","currentPage","onPageChange","page","paginationStatus"],"mappings":";AAEA,SAASA,cAAc,QAAQ,4BAAyB;AACxD,SACEC,UAAU,EACVC,iBAAiB,EACjBC,eAAe,EACfC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,QACX,8BAA2B;AAClC,SAASC,kBAAkB,QAAQ,uCAAoC;AAIvE;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,EAAE;AAWpC,sHAAsH,GACtH,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,iBAAiB,EACjBC,MAAM,EACkB;IACxB,MAAMC,YAAYN,YAAYC,WAAW;IACzC,MAAMM,UAAUC,KAAKC,GAAG,CAAC,AAACT,CAAAA,YAAY,CAAA,IAAKC,UAAUE;IACrD,MAAMO,cAAcV,cAAc;IAClC,MAAMW,aAAaX,aAAaE,aAAa;IAE7C,MAAMU,WACJ,CAACC,gBACD,CAACC;YACCA,MAAMC,cAAc;YACpBX,kBAAkBS;QACpB;IAEF,qBACE,KAAC1B;kBACC,cAAA,MAACC;YAAW4B,MAAK;YAAQC,WAAU;;gBAChCf,aAAa,mBACZ,MAACb;;sCACC,KAACE;sCACC,cAAA,KAACD;gCACC4B,MAAK;gCACLC,YAAYT;gCACZU,SAASR,SAAS;;;sCAGtB,KAACrB;sCACC,cAAA,KAACI;gCACCuB,MAAK;gCACLC,YAAYT;gCACZU,SAASR,SAASZ,YAAY;;;wBAGjCE,cAAcJ,qBACbuB,MAAMC,IAAI,CAAC;4BAAEC,QAAQrB;wBAAW,GAAG,CAACsB,GAAGC,sBACrC,KAAClC;0CACC,cAAA,KAACE;oCACCyB,MAAK;oCACLQ,UAAUD,UAAUzB;oCACpBoB,SAASR,SAASa;8CAEjBA,QAAQ;;+BANQA,wBAWvB,KAAClC;sCACC,cAAA,KAACM;gCACC8B,cAAYtB,OAAOuB,WAAW;gCAC9BA,aAAa5B,YAAY;gCACzBE,YAAYA;gCACZ2B,cAAc,CAACC,OAAS1B,kBAAkB0B,OAAO;;;sCAIvD,KAACvC;sCACC,cAAA,KAACG;gCACCwB,MAAK;gCACLC,YAAYR;gCACZS,SAASR,SAASZ,YAAY;;;sCAGlC,KAACT;sCACC,cAAA,KAACC;gCACC0B,MAAK;gCACLC,YAAYR;gCACZS,SAASR,SAASV,aAAa;;;;;8BAKvC,KAACN;oBAAiBqB,WAAU;8BACzBZ,OAAO0B,gBAAgB,CAACzB,WAAWC,SAASJ;;;;;AAKvD,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Formats the pagination status line for the rows on the current page (1-based, inclusive). */
|
|
3
|
+
export type FormatPaginationStatus = (pageStart: number, pageEnd: number, totalRows: number) => ReactNode;
|
|
4
|
+
/** User-facing text in `MessageResponseTable`. Aura has no translations, so consumers pass translated labels. */
|
|
5
|
+
export type MessageResponseTableLabels = {
|
|
6
|
+
/** Accessible name of the page number input that long tables show instead of page links. */
|
|
7
|
+
currentPage: string;
|
|
8
|
+
/** Status line in the pagination footer, e.g. "Showing 1–50 of 120". */
|
|
9
|
+
paginationStatus: FormatPaginationStatus;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS: MessageResponseTableLabels;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-table-labels.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/** Formats the pagination status line for the rows on the current page (1-based, inclusive). */\nexport type FormatPaginationStatus = (\n pageStart: number,\n pageEnd: number,\n totalRows: number\n) => ReactNode;\n\n/** User-facing text in `MessageResponseTable`. Aura has no translations, so consumers pass translated labels. */\nexport type MessageResponseTableLabels = {\n /** Accessible name of the page number input that long tables show instead of page links. */\n currentPage: string;\n /** Status line in the pagination footer, e.g. \"Showing 1–50 of 120\". */\n paginationStatus: FormatPaginationStatus;\n};\n\nexport const DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS: MessageResponseTableLabels =\n {\n currentPage: 'Current page',\n paginationStatus: (pageStart, pageEnd, totalRows) =>\n `Showing ${pageStart}–${pageEnd} of ${totalRows}`,\n };\n"],"names":["DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS","currentPage","paginationStatus","pageStart","pageEnd","totalRows"],"mappings":"AAiBA,OAAO,MAAMA,wCACX;IACEC,aAAa;IACbC,kBAAkB,CAACC,WAAWC,SAASC,YACrC,CAAC,QAAQ,EAAEF,UAAU,CAAC,EAAEC,QAAQ,IAAI,EAAEC,WAAW;AACrD,EAAE"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { JSX } from "react/jsx-runtime";
|
|
3
3
|
import type { ExtraProps } from "streamdown";
|
|
4
|
-
type
|
|
4
|
+
import { type MessageResponseTableLabels } from "./message-response-table-labels";
|
|
5
|
+
type MessageResponseTableProps = JSX.IntrinsicElements["table"] & ExtraProps & {
|
|
6
|
+
/** Translated text for the table's controls; any label left out falls back to English. */
|
|
7
|
+
labels?: Partial<MessageResponseTableLabels>;
|
|
8
|
+
};
|
|
9
|
+
export declare const MESSAGE_TABLE_PAGE_SIZE = 50;
|
|
5
10
|
/**
|
|
6
11
|
* Renders a Markdown table from a chat response as a DataGrid.
|
|
7
12
|
* Not the default `table` renderer yet; opt in with `<MessageResponse components={{ table: MessageResponseTable }}>`.
|
|
8
|
-
* Aura has no translations, so pass a translated `aria-label` to name the table
|
|
13
|
+
* Aura has no translations, so pass a translated `aria-label` to name the table (it defaults to "Atlas AI Chat Table")
|
|
14
|
+
* and `labels` to translate its controls.
|
|
9
15
|
*/
|
|
10
|
-
export declare const MessageResponseTable: ({ children, "aria-label": ariaLabel }: MessageResponseTableProps) => ReactNode;
|
|
16
|
+
export declare const MessageResponseTable: ({ children, "aria-label": ariaLabel, labels }: MessageResponseTableProps) => ReactNode;
|
|
11
17
|
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Children, isValidElement } from "react";
|
|
2
|
+
import { Children, isValidElement, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Card } from "../card/card.js";
|
|
4
4
|
import { DataGrid } from "../data-grid/data-grid.js";
|
|
5
|
+
import { MessageTableFooter } from "./message-response-table-footer.js";
|
|
6
|
+
import { DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS } from "./message-response-table-labels.js";
|
|
5
7
|
const DEFAULT_TABLE_LABEL = 'Atlas AI Chat Table';
|
|
8
|
+
export const MESSAGE_TABLE_PAGE_SIZE = 50;
|
|
9
|
+
const clamp = (value, min, max)=>Math.min(Math.max(value, min), max);
|
|
6
10
|
const getTagName = (element)=>element.props.node?.tagName ?? (typeof element.type === 'string' ? element.type : undefined);
|
|
7
11
|
const getChildren = (element)=>element.props.children;
|
|
8
12
|
/**
|
|
@@ -76,9 +80,34 @@ const buildColumns = (headers)=>headers.map((header, index)=>({
|
|
|
76
80
|
/**
|
|
77
81
|
* Renders a Markdown table from a chat response as a DataGrid.
|
|
78
82
|
* Not the default `table` renderer yet; opt in with `<MessageResponse components={{ table: MessageResponseTable }}>`.
|
|
79
|
-
* Aura has no translations, so pass a translated `aria-label` to name the table
|
|
80
|
-
|
|
83
|
+
* Aura has no translations, so pass a translated `aria-label` to name the table (it defaults to "Atlas AI Chat Table")
|
|
84
|
+
* and `labels` to translate its controls.
|
|
85
|
+
*/ export const MessageResponseTable = ({ children, 'aria-label': ariaLabel = DEFAULT_TABLE_LABEL, labels })=>{
|
|
86
|
+
const resolvedLabels = {
|
|
87
|
+
...DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS,
|
|
88
|
+
...labels
|
|
89
|
+
};
|
|
81
90
|
const parsed = parseTableChildren(children);
|
|
91
|
+
const allRows = parsed.isParsed ? parsed.rows : [];
|
|
92
|
+
const totalRows = allRows.length;
|
|
93
|
+
const totalPages = Math.max(1, Math.ceil(totalRows / MESSAGE_TABLE_PAGE_SIZE));
|
|
94
|
+
const [pageIndex, setPageIndex] = useState(0);
|
|
95
|
+
const gridRef = useRef(null);
|
|
96
|
+
// Clamp the page while rows stream in or shrink.
|
|
97
|
+
const currentPageIndex = clamp(pageIndex, 0, totalPages - 1);
|
|
98
|
+
// Pages are sliced here rather than by the grid: its client pagination resets
|
|
99
|
+
// to the first page whenever `data` changes identity, which happens on every
|
|
100
|
+
// re-render of the streamed Markdown.
|
|
101
|
+
const pageRows = allRows.slice(currentPageIndex * MESSAGE_TABLE_PAGE_SIZE, (currentPageIndex + 1) * MESSAGE_TABLE_PAGE_SIZE);
|
|
102
|
+
// Show the top of each new page.
|
|
103
|
+
useEffect(()=>{
|
|
104
|
+
gridRef.current?.scrollToRow(0);
|
|
105
|
+
}, [
|
|
106
|
+
currentPageIndex
|
|
107
|
+
]);
|
|
108
|
+
const handlePageIndexChange = (nextPageIndex)=>{
|
|
109
|
+
setPageIndex(clamp(nextPageIndex, 0, totalPages - 1));
|
|
110
|
+
};
|
|
82
111
|
if (!parsed.isParsed) {
|
|
83
112
|
return /*#__PURE__*/ _jsx("div", {
|
|
84
113
|
"data-slot": "message-table",
|
|
@@ -98,18 +127,34 @@ const buildColumns = (headers)=>headers.map((header, index)=>({
|
|
|
98
127
|
children: /*#__PURE__*/ _jsx(Card, {
|
|
99
128
|
className: "w-full bg-transparent",
|
|
100
129
|
children: /*#__PURE__*/ _jsx(DataGrid, {
|
|
101
|
-
data:
|
|
130
|
+
data: pageRows,
|
|
102
131
|
columns: buildColumns(parsed.headers),
|
|
103
132
|
getRowId: (row)=>row.id,
|
|
133
|
+
rowCount: totalRows,
|
|
134
|
+
manualPagination: true,
|
|
135
|
+
pagination: {
|
|
136
|
+
pageIndex: currentPageIndex,
|
|
137
|
+
pageSize: MESSAGE_TABLE_PAGE_SIZE
|
|
138
|
+
},
|
|
139
|
+
onPaginationChange: (next)=>handlePageIndexChange(next.pageIndex),
|
|
104
140
|
// Read-only tables are scanned rather than edited, so stripe rows instead of drawing column dividers.
|
|
105
141
|
striped: true,
|
|
106
142
|
// Header and rows share one background, so the titles carry the distinction.
|
|
107
143
|
emphasizeHeader: true,
|
|
108
144
|
// Chat answers often put sentences in cells; show them in full rather than truncated.
|
|
109
145
|
wrapCells: true,
|
|
146
|
+
gridRef: gridRef,
|
|
110
147
|
"aria-label": ariaLabel,
|
|
111
|
-
// max-h-131 (524px)
|
|
112
|
-
className: "max-h-131 w-full"
|
|
148
|
+
// max-h-131 (524px) fits the column header plus 10 single-line rows (36px each) and the footer; the rest scrolls. `w-full` lets the table fill the card's full width.
|
|
149
|
+
className: "max-h-131 w-full",
|
|
150
|
+
children: totalRows > 0 && /*#__PURE__*/ _jsx(MessageTableFooter, {
|
|
151
|
+
pageIndex: currentPageIndex,
|
|
152
|
+
pageSize: MESSAGE_TABLE_PAGE_SIZE,
|
|
153
|
+
labels: resolvedLabels,
|
|
154
|
+
totalPages: totalPages,
|
|
155
|
+
totalRows: totalRows,
|
|
156
|
+
onPageIndexChange: handlePageIndexChange
|
|
157
|
+
})
|
|
113
158
|
})
|
|
114
159
|
})
|
|
115
160
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-table.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, isValidElement } from 'react';\n\nimport type { ColumnDef } from '@tanstack/react-table';\nimport type { JSX } from 'react/jsx-runtime';\nimport type { ExtraProps } from 'streamdown';\n\nimport { Card } from '../card/card';\nimport { DataGrid } from '../data-grid/data-grid';\n\ntype MessageResponseTableProps = JSX.IntrinsicElements['table'] & ExtraProps;\n\nconst DEFAULT_TABLE_LABEL = 'Atlas AI Chat Table';\n\ntype MessageTableRow = {\n id: string;\n /** Rendered Markdown content of each cell, so links and formatting survive. */\n cells: ReactNode[];\n /** Plain text of each cell. */\n text: string[];\n};\n\ntype ParsedTable =\n | { isParsed: true; headers: string[]; rows: MessageTableRow[] }\n | { isParsed: false };\n\nconst getTagName = (element: ReactElement): string | undefined =>\n (element.props as ExtraProps).node?.tagName ??\n (typeof element.type === 'string' ? element.type : undefined);\n\nconst getChildren = (element: ReactElement): ReactNode =>\n (element.props as { children?: ReactNode }).children;\n\n/**\n * Flattens rendered Markdown children into an indexable element array.\n * Streamdown hands us an opaque `ReactNode` tree, so there is no alternative API for this.\n */\nconst toElementArray = (node: ReactNode): ReactElement[] =>\n // eslint-disable-next-line @eslint-react/no-children-to-array -- The grid needs Streamdown's rendered table sections, rows and cells as indexable arrays\n Children.toArray(node).filter((child): child is ReactElement =>\n isValidElement(child)\n );\n\nconst extractText = (node: ReactNode): string => {\n if (node === null || node === undefined || typeof node === 'boolean') {\n return '';\n }\n if (typeof node === 'string' || typeof node === 'number') {\n return String(node);\n }\n if (Array.isArray(node)) {\n return node.map(extractText).join('');\n }\n if (isValidElement(node)) {\n return extractText(getChildren(node));\n }\n return '';\n};\n\nconst getCellContents = (row: ReactElement): ReactNode[] =>\n toElementArray(getChildren(row)).map(getChildren);\n\nconst parseTableChildren = (children: ReactNode): ParsedTable => {\n const sections = toElementArray(children);\n\n let header: ReactElement | null = null;\n let body: ReactElement | null = null;\n\n for (const section of sections) {\n const tagName = getTagName(section);\n if (tagName === 'thead' && !header) {\n header = section;\n } else if (tagName === 'tbody' && !body) {\n body = section;\n }\n }\n\n // Fallback for renderers that do not forward hast `node` metadata:\n // a table is conventionally [thead, tbody].\n if (!header && !body && sections.length <= 2) {\n [header = null, body = null] = sections;\n }\n\n const headerRow = header ? toElementArray(getChildren(header))[0] : undefined;\n if (!headerRow) return { isParsed: false };\n\n const headers = getCellContents(headerRow).map((cell) =>\n extractText(cell).trim()\n );\n if (headers.length === 0) return { isParsed: false };\n\n // While the response streams, the header arrives before any body rows.\n const rows = body\n ? toElementArray(getChildren(body)).map((row, index) => {\n const cells = getCellContents(row);\n return {\n id: String(index),\n cells,\n text: cells.map((cell) => extractText(cell).trim()),\n };\n })\n : [];\n\n return { isParsed: true, headers, rows };\n};\n\nconst getColumnId = (index: number): string => `column-${index}`;\n\nconst buildColumns = (headers: string[]): ColumnDef<MessageTableRow>[] =>\n headers.map((header, index) => ({\n id: getColumnId(index),\n header,\n accessorFn: (row) => row.text[index] ?? '',\n cell: ({ row }) => row.original.cells[index] ?? null,\n }));\n\n/**\n * Renders a Markdown table from a chat response as a DataGrid.\n * Not the default `table` renderer yet; opt in with `<MessageResponse components={{ table: MessageResponseTable }}>`.\n * Aura has no translations, so pass a translated `aria-label` to name the table; it defaults to \"Atlas AI Chat Table\".\n */\nexport const MessageResponseTable = ({\n children,\n 'aria-label': ariaLabel = DEFAULT_TABLE_LABEL,\n}: MessageResponseTableProps): ReactNode => {\n const parsed = parseTableChildren(children);\n\n if (!parsed.isParsed) {\n return (\n <div\n data-slot=\"message-table\"\n className=\"my-4 overflow-x-auto\"\n tabIndex={0}\n role=\"group\"\n aria-label={ariaLabel}\n >\n <table className=\"w-full\">{children}</table>\n </div>\n );\n }\n\n return (\n <div data-slot=\"message-table\" className=\"my-4\">\n {/* The Card keeps its shape and padding but drops its grey surface, so the grid sits on its default base background and muted stripes. */}\n <Card className=\"w-full bg-transparent\">\n <DataGrid<MessageTableRow>\n data={parsed.rows}\n columns={buildColumns(parsed.headers)}\n getRowId={(row) => row.id}\n // Read-only tables are scanned rather than edited, so stripe rows instead of drawing column dividers.\n striped\n // Header and rows share one background, so the titles carry the distinction.\n emphasizeHeader\n // Chat answers often put sentences in cells; show them in full rather than truncated.\n wrapCells\n aria-label={ariaLabel}\n // max-h-131 (524px) caps tall tables so they scroll instead of pushing the conversation down. `w-full` lets the table fill the card's full width.\n className=\"max-h-131 w-full\"\n />\n </Card>\n </div>\n );\n};\n"],"names":["Children","isValidElement","Card","DataGrid","DEFAULT_TABLE_LABEL","getTagName","element","props","node","tagName","type","undefined","getChildren","children","toElementArray","toArray","filter","child","extractText","String","Array","isArray","map","join","getCellContents","row","parseTableChildren","sections","header","body","section","length","headerRow","isParsed","headers","cell","trim","rows","index","cells","id","text","getColumnId","buildColumns","accessorFn","original","MessageResponseTable","ariaLabel","parsed","div","data-slot","className","tabIndex","role","aria-label","table","data","columns","getRowId","striped","emphasizeHeader","wrapCells"],"mappings":";AACA,SAASA,QAAQ,EAAEC,cAAc,QAAQ,QAAQ;AAMjD,SAASC,IAAI,QAAQ,kBAAe;AACpC,SAASC,QAAQ,QAAQ,4BAAyB;AAIlD,MAAMC,sBAAsB;AAc5B,MAAMC,aAAa,CAACC,UAClB,AAACA,QAAQC,KAAK,CAAgBC,IAAI,EAAEC,WACnC,CAAA,OAAOH,QAAQI,IAAI,KAAK,WAAWJ,QAAQI,IAAI,GAAGC,SAAQ;AAE7D,MAAMC,cAAc,CAACN,UACnB,AAACA,QAAQC,KAAK,CAA8BM,QAAQ;AAEtD;;;CAGC,GACD,MAAMC,iBAAiB,CAACN,OACtB,yJAAyJ;IACzJR,SAASe,OAAO,CAACP,MAAMQ,MAAM,CAAC,CAACC,sBAC7BhB,eAAegB;AAGnB,MAAMC,cAAc,CAACV;IACnB,IAAIA,SAAS,QAAQA,SAASG,aAAa,OAAOH,SAAS,WAAW;QACpE,OAAO;IACT;IACA,IAAI,OAAOA,SAAS,YAAY,OAAOA,SAAS,UAAU;QACxD,OAAOW,OAAOX;IAChB;IACA,IAAIY,MAAMC,OAAO,CAACb,OAAO;QACvB,OAAOA,KAAKc,GAAG,CAACJ,aAAaK,IAAI,CAAC;IACpC;IACA,kBAAItB,eAAeO,OAAO;QACxB,OAAOU,YAAYN,YAAYJ;IACjC;IACA,OAAO;AACT;AAEA,MAAMgB,kBAAkB,CAACC,MACvBX,eAAeF,YAAYa,MAAMH,GAAG,CAACV;AAEvC,MAAMc,qBAAqB,CAACb;IAC1B,MAAM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EAAEV,GAAG,EAAE,GAAKA,IAAIoB,QAAQ,CAACN,KAAK,CAACD,MAAM,IAAI;QAClD,CAAA;AAEF;;;;CAIC,GACD,OAAO,MAAMQ,uBAAuB,CAAC,EACnCjC,QAAQ,EACR,cAAckC,YAAY3C,mBAAmB,EACnB;IAC1B,MAAM4C,SAAStB,mBAAmBb;IAElC,IAAI,CAACmC,OAAOf,QAAQ,EAAE;QACpB,qBACE,KAACgB;YACCC,aAAU;YACVC,WAAU;YACVC,UAAU;YACVC,MAAK;YACLC,cAAYP;sBAEZ,cAAA,KAACQ;gBAAMJ,WAAU;0BAAUtC;;;IAGjC;IAEA,qBACE,KAACoC;QAAIC,aAAU;QAAgBC,WAAU;kBAEvC,cAAA,KAACjD;YAAKiD,WAAU;sBACd,cAAA,KAAChD;gBACCqD,MAAMR,OAAOX,IAAI;gBACjBoB,SAASd,aAAaK,OAAOd,OAAO;gBACpCwB,UAAU,CAACjC,MAAQA,IAAIe,EAAE;gBACzB,sGAAsG;gBACtGmB,OAAO;gBACP,6EAA6E;gBAC7EC,eAAe;gBACf,sFAAsF;gBACtFC,SAAS;gBACTP,cAAYP;gBACZ,kJAAkJ;gBAClJI,WAAU;;;;AAKpB,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-table.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, isValidElement, useEffect, useRef, useState } from 'react';\n\nimport type { ColumnDef } from '@tanstack/react-table';\nimport type { JSX } from 'react/jsx-runtime';\nimport type { ExtraProps } from 'streamdown';\n\nimport { Card } from '../card/card';\nimport { DataGrid, type DataGridHandle } from '../data-grid/data-grid';\n\nimport { MessageTableFooter } from './message-response-table-footer';\nimport {\n DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS,\n type MessageResponseTableLabels,\n} from './message-response-table-labels';\n\ntype MessageResponseTableProps = JSX.IntrinsicElements['table'] &\n ExtraProps & {\n /** Translated text for the table's controls; any label left out falls back to English. */\n labels?: Partial<MessageResponseTableLabels>;\n };\n\nconst DEFAULT_TABLE_LABEL = 'Atlas AI Chat Table';\n\ntype MessageTableRow = {\n id: string;\n /** Rendered Markdown content of each cell, so links and formatting survive. */\n cells: ReactNode[];\n /** Plain text of each cell. */\n text: string[];\n};\n\ntype ParsedTable =\n | { isParsed: true; headers: string[]; rows: MessageTableRow[] }\n | { isParsed: false };\n\nexport const MESSAGE_TABLE_PAGE_SIZE = 50;\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(Math.max(value, min), max);\n\nconst getTagName = (element: ReactElement): string | undefined =>\n (element.props as ExtraProps).node?.tagName ??\n (typeof element.type === 'string' ? element.type : undefined);\n\nconst getChildren = (element: ReactElement): ReactNode =>\n (element.props as { children?: ReactNode }).children;\n\n/**\n * Flattens rendered Markdown children into an indexable element array.\n * Streamdown hands us an opaque `ReactNode` tree, so there is no alternative API for this.\n */\nconst toElementArray = (node: ReactNode): ReactElement[] =>\n // eslint-disable-next-line @eslint-react/no-children-to-array -- The grid needs Streamdown's rendered table sections, rows and cells as indexable arrays\n Children.toArray(node).filter((child): child is ReactElement =>\n isValidElement(child)\n );\n\nconst extractText = (node: ReactNode): string => {\n if (node === null || node === undefined || typeof node === 'boolean') {\n return '';\n }\n if (typeof node === 'string' || typeof node === 'number') {\n return String(node);\n }\n if (Array.isArray(node)) {\n return node.map(extractText).join('');\n }\n if (isValidElement(node)) {\n return extractText(getChildren(node));\n }\n return '';\n};\n\nconst getCellContents = (row: ReactElement): ReactNode[] =>\n toElementArray(getChildren(row)).map(getChildren);\n\nconst parseTableChildren = (children: ReactNode): ParsedTable => {\n const sections = toElementArray(children);\n\n let header: ReactElement | null = null;\n let body: ReactElement | null = null;\n\n for (const section of sections) {\n const tagName = getTagName(section);\n if (tagName === 'thead' && !header) {\n header = section;\n } else if (tagName === 'tbody' && !body) {\n body = section;\n }\n }\n\n // Fallback for renderers that do not forward hast `node` metadata:\n // a table is conventionally [thead, tbody].\n if (!header && !body && sections.length <= 2) {\n [header = null, body = null] = sections;\n }\n\n const headerRow = header ? toElementArray(getChildren(header))[0] : undefined;\n if (!headerRow) return { isParsed: false };\n\n const headers = getCellContents(headerRow).map((cell) =>\n extractText(cell).trim()\n );\n if (headers.length === 0) return { isParsed: false };\n\n // While the response streams, the header arrives before any body rows.\n const rows = body\n ? toElementArray(getChildren(body)).map((row, index) => {\n const cells = getCellContents(row);\n return {\n id: String(index),\n cells,\n text: cells.map((cell) => extractText(cell).trim()),\n };\n })\n : [];\n\n return { isParsed: true, headers, rows };\n};\n\nconst getColumnId = (index: number): string => `column-${index}`;\n\nconst buildColumns = (headers: string[]): ColumnDef<MessageTableRow>[] =>\n headers.map((header, index) => ({\n id: getColumnId(index),\n header,\n accessorFn: (row) => row.text[index] ?? '',\n cell: ({ row }) => row.original.cells[index] ?? null,\n }));\n\n/**\n * Renders a Markdown table from a chat response as a DataGrid.\n * Not the default `table` renderer yet; opt in with `<MessageResponse components={{ table: MessageResponseTable }}>`.\n * Aura has no translations, so pass a translated `aria-label` to name the table (it defaults to \"Atlas AI Chat Table\")\n * and `labels` to translate its controls.\n */\nexport const MessageResponseTable = ({\n children,\n 'aria-label': ariaLabel = DEFAULT_TABLE_LABEL,\n labels,\n}: MessageResponseTableProps): ReactNode => {\n const resolvedLabels = {\n ...DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS,\n ...labels,\n };\n const parsed = parseTableChildren(children);\n const allRows = parsed.isParsed ? parsed.rows : [];\n const totalRows = allRows.length;\n const totalPages = Math.max(\n 1,\n Math.ceil(totalRows / MESSAGE_TABLE_PAGE_SIZE)\n );\n\n const [pageIndex, setPageIndex] = useState(0);\n const gridRef = useRef<DataGridHandle>(null);\n\n // Clamp the page while rows stream in or shrink.\n const currentPageIndex = clamp(pageIndex, 0, totalPages - 1);\n // Pages are sliced here rather than by the grid: its client pagination resets\n // to the first page whenever `data` changes identity, which happens on every\n // re-render of the streamed Markdown.\n const pageRows = allRows.slice(\n currentPageIndex * MESSAGE_TABLE_PAGE_SIZE,\n (currentPageIndex + 1) * MESSAGE_TABLE_PAGE_SIZE\n );\n\n // Show the top of each new page.\n useEffect(() => {\n gridRef.current?.scrollToRow(0);\n }, [currentPageIndex]);\n\n const handlePageIndexChange = (nextPageIndex: number): void => {\n setPageIndex(clamp(nextPageIndex, 0, totalPages - 1));\n };\n\n if (!parsed.isParsed) {\n return (\n <div\n data-slot=\"message-table\"\n className=\"my-4 overflow-x-auto\"\n tabIndex={0}\n role=\"group\"\n aria-label={ariaLabel}\n >\n <table className=\"w-full\">{children}</table>\n </div>\n );\n }\n\n return (\n <div data-slot=\"message-table\" className=\"my-4\">\n {/* The Card keeps its shape and padding but drops its grey surface, so the grid sits on its default base background and muted stripes. */}\n <Card className=\"w-full bg-transparent\">\n <DataGrid<MessageTableRow>\n data={pageRows}\n columns={buildColumns(parsed.headers)}\n getRowId={(row) => row.id}\n rowCount={totalRows}\n manualPagination\n pagination={{\n pageIndex: currentPageIndex,\n pageSize: MESSAGE_TABLE_PAGE_SIZE,\n }}\n onPaginationChange={(next) => handlePageIndexChange(next.pageIndex)}\n // Read-only tables are scanned rather than edited, so stripe rows instead of drawing column dividers.\n striped\n // Header and rows share one background, so the titles carry the distinction.\n emphasizeHeader\n // Chat answers often put sentences in cells; show them in full rather than truncated.\n wrapCells\n gridRef={gridRef}\n aria-label={ariaLabel}\n // max-h-131 (524px) fits the column header plus 10 single-line rows (36px each) and the footer; the rest scrolls. `w-full` lets the table fill the card's full width.\n className=\"max-h-131 w-full\"\n >\n {totalRows > 0 && (\n <MessageTableFooter\n pageIndex={currentPageIndex}\n pageSize={MESSAGE_TABLE_PAGE_SIZE}\n labels={resolvedLabels}\n totalPages={totalPages}\n totalRows={totalRows}\n onPageIndexChange={handlePageIndexChange}\n />\n )}\n </DataGrid>\n </Card>\n </div>\n );\n};\n"],"names":["Children","isValidElement","useEffect","useRef","useState","Card","DataGrid","MessageTableFooter","DEFAULT_MESSAGE_RESPONSE_TABLE_LABELS","DEFAULT_TABLE_LABEL","MESSAGE_TABLE_PAGE_SIZE","clamp","value","min","max","Math","getTagName","element","props","node","tagName","type","undefined","getChildren","children","toElementArray","toArray","filter","child","extractText","String","Array","isArray","map","join","getCellContents","row","parseTableChildren","sections","header","body","section","length","headerRow","isParsed","headers","cell","trim","rows","index","cells","id","text","getColumnId","buildColumns","accessorFn","original","MessageResponseTable","ariaLabel","labels","resolvedLabels","parsed","allRows","totalRows","totalPages","ceil","pageIndex","setPageIndex","gridRef","currentPageIndex","pageRows","slice","current","scrollToRow","handlePageIndexChange","nextPageIndex","div","data-slot","className","tabIndex","role","aria-label","table","data","columns","getRowId","rowCount","manualPagination","pagination","pageSize","onPaginationChange","next","striped","emphasizeHeader","wrapCells","onPageIndexChange"],"mappings":";AACA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAM9E,SAASC,IAAI,QAAQ,kBAAe;AACpC,SAASC,QAAQ,QAA6B,4BAAyB;AAEvE,SAASC,kBAAkB,QAAQ,qCAAkC;AACrE,SACEC,qCAAqC,QAEhC,qCAAkC;AAQzC,MAAMC,sBAAsB;AAc5B,OAAO,MAAMC,0BAA0B,GAAG;AAE1C,MAAMC,QAAQ,CAACC,OAAeC,KAAaC,MACzCC,KAAKF,GAAG,CAACE,KAAKD,GAAG,CAACF,OAAOC,MAAMC;AAEjC,MAAME,aAAa,CAACC,UAClB,AAACA,QAAQC,KAAK,CAAgBC,IAAI,EAAEC,WACnC,CAAA,OAAOH,QAAQI,IAAI,KAAK,WAAWJ,QAAQI,IAAI,GAAGC,SAAQ;AAE7D,MAAMC,cAAc,CAACN,UACnB,AAACA,QAAQC,KAAK,CAA8BM,QAAQ;AAEtD;;;CAGC,GACD,MAAMC,iBAAiB,CAACN,OACtB,yJAAyJ;IACzJnB,SAAS0B,OAAO,CAACP,MAAMQ,MAAM,CAAC,CAACC,sBAC7B3B,eAAe2B;AAGnB,MAAMC,cAAc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