@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.32
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/CHANGELOG.md +375 -5
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +40 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +73 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +3 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +14 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +6 -2
- package/dist/components/ai/index.js +10 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +2 -3
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -3
- package/dist/components/canvas/NodeRenderer.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +24 -35
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +10 -22
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +13 -32
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +10 -7
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +16 -11
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +11 -28
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +151 -133
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +12 -6
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +10 -8
- package/dist/components/charts/index.js +8 -4
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +21 -26
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -21
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +3 -3
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -3
- package/dist/components/core/Alert/Alert.animations.js +30 -8
- package/dist/components/core/Alert/Alert.js +23 -9
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -82
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +33 -65
- package/dist/components/core/Badge/Badge.theme.js +26 -24
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +6 -6
- package/dist/components/core/Button/Button.js +14 -58
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +35 -22
- package/dist/components/core/Button/Button.types.d.ts +26 -13
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +15 -23
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +40 -4
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +22 -9
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -3
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +7 -5
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +4 -2
- package/dist/components/core/Message/Message.theme.js +8 -10
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +6 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +4 -2
- package/dist/components/core/NavItem/NavItem.js +8 -7
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +27 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +5 -5
- package/dist/components/core/Pill/Pill.js +5 -2
- package/dist/components/core/Pill/Pill.theme.js +9 -5
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +2 -2
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +10 -7
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +3 -3
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +4 -4
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +3 -3
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +5 -3
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +7 -7
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -3
- package/dist/components/data-display/KPI/KPI.js +12 -21
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +11 -11
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -3
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +13 -6
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +4 -4
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +3 -3
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +4 -4
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +7 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1681
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +14 -13
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +74 -8
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +3 -2
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/TimePicker/TimePicker.theme.js +7 -8
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +38 -13
- package/dist/components/forms/index.js +2 -1
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +197 -4
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2522 -328
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +2522 -328
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +2 -5
- package/dist/registry.json +3262 -2464
- package/dist/shadcn-compat.css +6 -6
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +2557 -328
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/dist/utils/index.d.ts +0 -1
- package/package.json +39 -6
- package/src/global.scss +32 -28
- package/src/styles/theme.css +547 -176
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +66 -38
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -207
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -65
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -12
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* What the agent is asking for.
|
|
4
|
+
*
|
|
5
|
+
* - `approval` — a permission gate. Approve / Deny (+ optional "always allow").
|
|
6
|
+
* - `choice` — pick one of `options`.
|
|
7
|
+
* - `input` — free text.
|
|
8
|
+
*/
|
|
9
|
+
export type AgentRequestKind = "approval" | "choice" | "input";
|
|
10
|
+
/**
|
|
11
|
+
* How consequential the action is.
|
|
12
|
+
*
|
|
13
|
+
* The library paints NOTHING for this by default: a destructive question
|
|
14
|
+
* already reads as destructive through its `meta` line and the danger-outlined
|
|
15
|
+
* Deny action, and a coloured accent on top of those was noise. `destructive`
|
|
16
|
+
* lands on the row as `data-risk="destructive"` so a consumer can style it.
|
|
17
|
+
*/
|
|
18
|
+
export type AgentRequestRisk = "normal" | "destructive";
|
|
19
|
+
/**
|
|
20
|
+
* How a question was settled.
|
|
21
|
+
*
|
|
22
|
+
* `deferred` is the escape hatch: the user declined to answer here (Skip). It
|
|
23
|
+
* is a first-class outcome, not a cancel — a composer takeover that cannot be
|
|
24
|
+
* escaped traps a user whose real answer isn't one of the offered options,
|
|
25
|
+
* which is also why a choice question can carry `allowOther`.
|
|
26
|
+
*/
|
|
27
|
+
export type AgentRequestOutcome = "resolved" | "rejected" | "deferred";
|
|
28
|
+
export interface AgentRequestOption {
|
|
29
|
+
/** Serializable value handed back to `onAnswer`. */
|
|
30
|
+
value: string;
|
|
31
|
+
label: React.ReactNode;
|
|
32
|
+
/** Secondary line under the label — the trade-off, cost, or consequence. */
|
|
33
|
+
description?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/** Fields every question kind shares. */
|
|
36
|
+
export interface AgentRequestQuestionBase {
|
|
37
|
+
/** Stable identity. Required — answers are keyed by it, not by index. */
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Short summary shown in the collapsed row once answered, and in the
|
|
41
|
+
* dimmed row while pending. Keep it to a few words.
|
|
42
|
+
*/
|
|
43
|
+
label: React.ReactNode;
|
|
44
|
+
/** The full question. Falls back to `label` when omitted. */
|
|
45
|
+
question?: React.ReactNode;
|
|
46
|
+
/** Secondary context line under the question. */
|
|
47
|
+
meta?: React.ReactNode;
|
|
48
|
+
/** @default "normal" */
|
|
49
|
+
risk?: AgentRequestRisk;
|
|
50
|
+
/**
|
|
51
|
+
* What is actually being approved — a command, a diff, a params list.
|
|
52
|
+
* Rendered in a monospace well. `ReactNode` on purpose: this is the one slot
|
|
53
|
+
* where a consumer legitimately needs to render their own component
|
|
54
|
+
* (a diff view, a table), so it is NOT part of the serializable schema.
|
|
55
|
+
*/
|
|
56
|
+
payload?: React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export interface AgentRequestApprovalQuestion extends AgentRequestQuestionBase {
|
|
59
|
+
/** @default "approval" */
|
|
60
|
+
kind?: "approval";
|
|
61
|
+
/** Overrides for the built-in action labels (i18n — §6: never trap strings). */
|
|
62
|
+
approveLabel?: string;
|
|
63
|
+
denyLabel?: string;
|
|
64
|
+
alwaysAllowLabel?: string;
|
|
65
|
+
/** Show the "always allow" action. @default false */
|
|
66
|
+
allowAlways?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Renders a Skip action, recorded as `deferred`. @default false
|
|
69
|
+
*
|
|
70
|
+
* An approval has no free-text row to fall back on — Approve and Deny are
|
|
71
|
+
* both real answers — so this is its ONLY escape hatch, and a permission gate
|
|
72
|
+
* the user can neither approve, deny, nor step away from is the trap the
|
|
73
|
+
* `deferred` outcome exists to prevent.
|
|
74
|
+
*/
|
|
75
|
+
optional?: boolean;
|
|
76
|
+
skipLabel?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Fields shared by both choice shapes. */
|
|
79
|
+
export interface AgentRequestChoiceBase extends AgentRequestQuestionBase {
|
|
80
|
+
kind: "choice";
|
|
81
|
+
options: AgentRequestOption[];
|
|
82
|
+
/**
|
|
83
|
+
* Append a free-text "something else" row to the bottom of the option list.
|
|
84
|
+
* Opt-in per question, NOT on by default: a closed question ("before or
|
|
85
|
+
* during the rollout?") is closed on purpose, and only the author of the
|
|
86
|
+
* question knows whether an answer off the list is meaningful. The typed
|
|
87
|
+
* answer is recorded as `resolved` with the text as its value.
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
allowOther?: boolean;
|
|
91
|
+
/** Placeholder for the "something else" row. @default "Something else" */
|
|
92
|
+
otherPlaceholder?: string;
|
|
93
|
+
/** Label for the action that submits the "something else" text. @default "Send" */
|
|
94
|
+
otherSubmitLabel?: string;
|
|
95
|
+
/** Renders a Skip action. @default false */
|
|
96
|
+
optional?: boolean;
|
|
97
|
+
skipLabel?: string;
|
|
98
|
+
}
|
|
99
|
+
/** Pick exactly one — answers on selection. */
|
|
100
|
+
export interface AgentRequestSingleChoiceQuestion extends AgentRequestChoiceBase {
|
|
101
|
+
multiple?: false;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Pick any number.
|
|
105
|
+
*
|
|
106
|
+
* Unlike single-choice this CANNOT auto-advance on click (the user isn't done
|
|
107
|
+
* until they say so), so it always renders an explicit confirm action.
|
|
108
|
+
*/
|
|
109
|
+
export interface AgentRequestMultiChoiceQuestion extends AgentRequestChoiceBase {
|
|
110
|
+
multiple: true;
|
|
111
|
+
/** Minimum selections before confirm enables. @default 0 */
|
|
112
|
+
minSelected?: number;
|
|
113
|
+
/** Maximum selections; further boxes disable once reached. */
|
|
114
|
+
maxSelected?: number;
|
|
115
|
+
confirmLabel?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface AgentRequestInputQuestion extends AgentRequestQuestionBase {
|
|
118
|
+
kind: "input";
|
|
119
|
+
placeholder?: string;
|
|
120
|
+
/** Renders a Skip action. @default false */
|
|
121
|
+
optional?: boolean;
|
|
122
|
+
submitLabel?: string;
|
|
123
|
+
skipLabel?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 🔴 A discriminated union, not one widened interface — `multiple` genuinely
|
|
127
|
+
* changes the shape of the ANSWER (`string` vs `string[]`), which §9 requires
|
|
128
|
+
* be modelled as a union rather than widened-and-cast. It also means `options`
|
|
129
|
+
* is required on a choice and meaningless on an approval, enforced by the
|
|
130
|
+
* compiler instead of by convention.
|
|
131
|
+
*/
|
|
132
|
+
export type AgentRequestQuestion = AgentRequestApprovalQuestion | AgentRequestSingleChoiceQuestion | AgentRequestMultiChoiceQuestion | AgentRequestInputQuestion;
|
|
133
|
+
export interface AgentRequestAnswer {
|
|
134
|
+
/** The `id` of the question this answers. */
|
|
135
|
+
id: string;
|
|
136
|
+
/**
|
|
137
|
+
* Serializable answer value. `string[]` for a multi-choice question, `string`
|
|
138
|
+
* for every other kind — narrow with `Array.isArray`.
|
|
139
|
+
*/
|
|
140
|
+
value: string | string[];
|
|
141
|
+
/** Human-readable answer, shown in the collapsed row. */
|
|
142
|
+
label: string;
|
|
143
|
+
outcome: AgentRequestOutcome;
|
|
144
|
+
}
|
|
145
|
+
export interface AgentRequestTheme {
|
|
146
|
+
baseStyle: string;
|
|
147
|
+
/**
|
|
148
|
+
* Geometry only. The panel's surface paint (rung background, elevation
|
|
149
|
+
* shadow, `--field-fill` for the controls inside) comes from `Card` and the
|
|
150
|
+
* relative-elevation engine, not from here.
|
|
151
|
+
*/
|
|
152
|
+
panelStyle: string;
|
|
153
|
+
navStyle: string;
|
|
154
|
+
navButtonStyle: string;
|
|
155
|
+
navCountStyle: string;
|
|
156
|
+
/** The question-as-heading block. */
|
|
157
|
+
headerStyle: string;
|
|
158
|
+
/** Horizontal inset + bottom inset for the swapping question. */
|
|
159
|
+
contentStyle: string;
|
|
160
|
+
questionStyle: string;
|
|
161
|
+
metaStyle: string;
|
|
162
|
+
bodyStyle: string;
|
|
163
|
+
scrollAreaStyle: string;
|
|
164
|
+
fadeStyle: string;
|
|
165
|
+
fadeTopStyle: string;
|
|
166
|
+
fadeBottomStyle: string;
|
|
167
|
+
bodyInnerStyle: string;
|
|
168
|
+
answeredChipStyle: string;
|
|
169
|
+
badgeStyle: string;
|
|
170
|
+
/**
|
|
171
|
+
* Keyed by OUTCOME only. There are no `pending`/`active` badges any more —
|
|
172
|
+
* one question is on screen at a time, so there is no list of other
|
|
173
|
+
* questions to mark up.
|
|
174
|
+
*/
|
|
175
|
+
badgeStates: Record<AgentRequestOutcome, string>;
|
|
176
|
+
answerStyle: string;
|
|
177
|
+
payloadStyle: string;
|
|
178
|
+
actionsStyle: string;
|
|
179
|
+
/** Left-anchored group inside the actions row (Skip). */
|
|
180
|
+
actionsStartStyle: string;
|
|
181
|
+
optionListStyle: string;
|
|
182
|
+
optionStyle: string;
|
|
183
|
+
otherInputStyle: string;
|
|
184
|
+
inputStyle: string;
|
|
185
|
+
}
|
|
186
|
+
export type AgentRequestThemeOverrides = Omit<Partial<AgentRequestTheme>, "badgeStates"> & {
|
|
187
|
+
badgeStates?: Partial<AgentRequestTheme["badgeStates"]>;
|
|
188
|
+
};
|
|
189
|
+
export interface AgentRequestProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "children" | "value" | "defaultValue" | "title"> {
|
|
190
|
+
/**
|
|
191
|
+
* The questions to ask, in order. Data-driven and serializable (except
|
|
192
|
+
* `payload`), so an LLM can emit a whole sequence as JSON.
|
|
193
|
+
*/
|
|
194
|
+
questions?: AgentRequestQuestion[];
|
|
195
|
+
/**
|
|
196
|
+
* Escape hatch for a bespoke single-question body. Ignored when `questions`
|
|
197
|
+
* is provided (dev-warns if both).
|
|
198
|
+
*/
|
|
199
|
+
children?: React.ReactNode;
|
|
200
|
+
/**
|
|
201
|
+
* The panel's accessible name, and only that — it is never painted. The
|
|
202
|
+
* QUESTION is the visible heading, so a second title line would be a heading
|
|
203
|
+
* competing with a heading. Pass a string; this is the i18n override for the
|
|
204
|
+
* default "Agent needs {n} decisions".
|
|
205
|
+
*/
|
|
206
|
+
title?: React.ReactNode;
|
|
207
|
+
/** Controlled answers. */
|
|
208
|
+
value?: AgentRequestAnswer[];
|
|
209
|
+
/** Uncontrolled initial answers. @default [] */
|
|
210
|
+
defaultValue?: AgentRequestAnswer[];
|
|
211
|
+
/** Fires with the full answer list on every change. */
|
|
212
|
+
onValueChange?: (answers: AgentRequestAnswer[]) => void;
|
|
213
|
+
/** Fires once per answered question. */
|
|
214
|
+
onAnswer?: (answer: AgentRequestAnswer) => void;
|
|
215
|
+
/** Fires when the last question is answered. */
|
|
216
|
+
onComplete?: (answers: AgentRequestAnswer[]) => void;
|
|
217
|
+
/**
|
|
218
|
+
* Optional ceiling on the answering controls, as any CSS length. Unset by
|
|
219
|
+
* default: one question is on screen at a time, so the panel simply grows
|
|
220
|
+
* and shrinks to fit it. Set this when a question can be long enough to bury
|
|
221
|
+
* the conversation behind the composer (many options, a large `payload`) —
|
|
222
|
+
* beyond it the options scroll instead of growing, while the question itself
|
|
223
|
+
* stays put above them.
|
|
224
|
+
*/
|
|
225
|
+
maxHeight?: string;
|
|
226
|
+
/** Accessible name for the back arrow. @default "Previous question" */
|
|
227
|
+
previousLabel?: string;
|
|
228
|
+
/** Accessible name for the forward arrow. @default "Next question" */
|
|
229
|
+
nextLabel?: string;
|
|
230
|
+
/**
|
|
231
|
+
* The progress line in the footer. A function rather than a string because it
|
|
232
|
+
* interpolates two numbers, and every visible string in the library has to be
|
|
233
|
+
* overridable for i18n. Whatever it returns is measured, and the actions row
|
|
234
|
+
* insets itself to clear it — a longer label is a layout choice, not a
|
|
235
|
+
* collision.
|
|
236
|
+
* @default "{current} of {total}"
|
|
237
|
+
*/
|
|
238
|
+
progressLabel?: (current: number, total: number) => React.ReactNode;
|
|
239
|
+
className?: string;
|
|
240
|
+
theme?: AgentRequestThemeOverrides;
|
|
241
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AgentRequest } from "./AgentRequest";
|
|
2
|
+
export { agentRequestTheme } from "./AgentRequest.theme";
|
|
3
|
+
export type { AgentRequestProps, AgentRequestKind, AgentRequestRisk, AgentRequestOutcome, AgentRequestOption, AgentRequestQuestion, AgentRequestAnswer, AgentRequestTheme, AgentRequestThemeOverrides, } from "./AgentRequest.types";
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import React__default, { useMemo, useId, useState, useEffect } from 'react';
|
|
4
|
+
import { CaretRight } from '@phosphor-icons/react';
|
|
5
|
+
import { useReducedMotion, motion, AnimatePresence } from 'motion/react';
|
|
6
|
+
import { cn } from '../../../utils/cn.js';
|
|
7
|
+
import { useElapsedTime } from '../../../hooks/useElapsedTime.js';
|
|
8
|
+
import { Shimmer } from '../../effects/Shimmer/Shimmer.js';
|
|
9
|
+
import { AIStatusIndicator } from '../shared/StatusIndicator.js';
|
|
10
|
+
import { createTriggerIconVariants, accordionAnimations, accordionContentAnimations } from '../../core/Accordion/Accordion.animations.js';
|
|
11
|
+
import { agentStatusTheme } from './AgentStatus.theme.js';
|
|
12
|
+
|
|
13
|
+
const formatDuration = (duration) => {
|
|
14
|
+
const safe = Math.max(0, duration);
|
|
15
|
+
// Round once, up front. Rounding the minutes and seconds halves independently
|
|
16
|
+
// lets a value like 119.7 render as "1m 60s".
|
|
17
|
+
const rounded = safe < 60 ? Math.round(safe * 10) / 10 : Math.round(safe);
|
|
18
|
+
if (rounded < 60) {
|
|
19
|
+
return `${rounded.toFixed(Number.isInteger(rounded) ? 0 : 1)}s`;
|
|
20
|
+
}
|
|
21
|
+
return `${Math.floor(rounded / 60)}m ${rounded % 60}s`;
|
|
22
|
+
};
|
|
23
|
+
// The indicator + shimmering label + duration, without a root element. Both the
|
|
24
|
+
// standalone status row (a <div role="status">) and the reasoning summary (a
|
|
25
|
+
// phrasing <span> inside the trigger <button>) render this, so the visual row is
|
|
26
|
+
// identical while each host picks a content-model-valid wrapper — a <div> may not
|
|
27
|
+
// nest inside a <button>.
|
|
28
|
+
const StatusRowInner = ({ theme, status, label, isActive, indicator, icon, wrap, activeSuffix, shimmerDuration, shimmerSpread, shimmerColor, shimmerHighlightColor, shownDuration, }) => {
|
|
29
|
+
const labelClass = cn(theme.labelStyle, wrap ? "" : "truncate");
|
|
30
|
+
return (jsxs(Fragment, { children: [indicator && (jsx("span", { className: theme.iconStyle, "aria-hidden": "true", children: icon !== null && icon !== void 0 ? icon : (jsx(AIStatusIndicator, { state: status, className: theme.indicatorStyles[status] })) })), isActive ? (jsx(Shimmer, { active: true, duration: shimmerDuration, spread: shimmerSpread, color: shimmerColor, highlightColor: shimmerHighlightColor, className: labelClass, children: jsxs(Fragment, { children: [label, activeSuffix] }) })) : (jsx("span", { className: labelClass, children: label })), shownDuration !== undefined && (
|
|
31
|
+
// aria-hidden: inside an aria-atomic live region a ticking timer would
|
|
32
|
+
// re-announce the whole label on every tick.
|
|
33
|
+
jsx("span", { className: theme.durationStyle, "aria-hidden": "true", children: formatDuration(shownDuration) }))] }));
|
|
34
|
+
};
|
|
35
|
+
const AgentStatus = React__default.forwardRef(({ mode = "status", status = "active", label, duration, startedAt, icon, indicator, wrap = false, activeSuffix = "…", shimmerDuration = 2, shimmerSpread = 16, shimmerColor = "color-mix(in oklab, var(--color-text-muted) 75%, transparent)", shimmerHighlightColor = "var(--color-text-primary)", live = "polite", steps, children, open, defaultOpen = false, onOpenChange, divider = true, className, theme: themeOverrides, ...rest }, ref) => {
|
|
36
|
+
// All hooks run unconditionally, before the mode branch.
|
|
37
|
+
const theme = useMemo(() => ({
|
|
38
|
+
...agentStatusTheme,
|
|
39
|
+
...themeOverrides,
|
|
40
|
+
stateStyles: {
|
|
41
|
+
...agentStatusTheme.stateStyles,
|
|
42
|
+
...themeOverrides === null || themeOverrides === void 0 ? void 0 : themeOverrides.stateStyles,
|
|
43
|
+
},
|
|
44
|
+
indicatorStyles: {
|
|
45
|
+
...agentStatusTheme.indicatorStyles,
|
|
46
|
+
...themeOverrides === null || themeOverrides === void 0 ? void 0 : themeOverrides.indicatorStyles,
|
|
47
|
+
},
|
|
48
|
+
}), [themeOverrides]);
|
|
49
|
+
const isReasoning = mode === "reasoning";
|
|
50
|
+
const isActive = status === "active";
|
|
51
|
+
// Ticks while active, freezes on settle. An explicit `duration` wins outright, so
|
|
52
|
+
// don't read the clock at all in that case — passing `startedAt` anyway would leave
|
|
53
|
+
// an interval re-rendering this row 10x/second only to discard every reading.
|
|
54
|
+
const ticked = useElapsedTime(duration === undefined ? startedAt : undefined, {
|
|
55
|
+
active: isActive,
|
|
56
|
+
});
|
|
57
|
+
const shownDuration = duration !== null && duration !== void 0 ? duration : ticked;
|
|
58
|
+
// A status row always carries an indicator; a reasoning summary drops it once
|
|
59
|
+
// settled, because the chevron carries the affordance from there. Either default
|
|
60
|
+
// yields to an explicit `indicator`, and a custom `icon` opts back in — you only
|
|
61
|
+
// pass an icon in order to see it.
|
|
62
|
+
const showIndicator = indicator !== null && indicator !== void 0 ? indicator : (isReasoning ? isActive || icon !== undefined : true);
|
|
63
|
+
const reactId = useId();
|
|
64
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
65
|
+
const shouldReduceMotion = useReducedMotion();
|
|
66
|
+
const isControlled = open !== undefined;
|
|
67
|
+
const hasOnOpenChange = onOpenChange !== undefined;
|
|
68
|
+
const hasSteps = steps !== undefined;
|
|
69
|
+
const hasChildren = children !== undefined;
|
|
70
|
+
// Dev warnings belong in an effect, not the render body: `startedAt` re-renders this
|
|
71
|
+
// component ten times a second, and a render-body warning reprints on every tick.
|
|
72
|
+
// The deps are booleans on purpose — depending on `steps`/`children`/`onOpenChange`
|
|
73
|
+
// directly would re-fire on every parent render and bring the flood back.
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (process.env.NODE_ENV === "production" || !isReasoning)
|
|
76
|
+
return;
|
|
77
|
+
/* eslint-disable no-console */
|
|
78
|
+
if (isControlled && defaultOpen) {
|
|
79
|
+
console.warn("[AgentStatus]: both `open` and `defaultOpen` were provided — `open` (controlled) wins.");
|
|
80
|
+
}
|
|
81
|
+
if (isControlled && !hasOnOpenChange) {
|
|
82
|
+
console.warn("[AgentStatus]: `open` was provided without `onOpenChange`, so the reasoning block can never be toggled. Pass `defaultOpen` for uncontrolled usage.");
|
|
83
|
+
}
|
|
84
|
+
if (hasSteps && hasChildren) {
|
|
85
|
+
console.warn("[AgentStatus]: both `steps` and `children` were provided — `steps` takes precedence.");
|
|
86
|
+
}
|
|
87
|
+
/* eslint-enable no-console */
|
|
88
|
+
}, [
|
|
89
|
+
isReasoning,
|
|
90
|
+
isControlled,
|
|
91
|
+
defaultOpen,
|
|
92
|
+
hasOnOpenChange,
|
|
93
|
+
hasSteps,
|
|
94
|
+
hasChildren,
|
|
95
|
+
]);
|
|
96
|
+
// Shimmer + theme config shared with the nested rows a reasoning block renders.
|
|
97
|
+
// Memoized so a ticking summary duration doesn't churn the step list's props.
|
|
98
|
+
const sharedRowProps = useMemo(() => ({
|
|
99
|
+
activeSuffix,
|
|
100
|
+
shimmerDuration,
|
|
101
|
+
shimmerSpread,
|
|
102
|
+
shimmerColor,
|
|
103
|
+
shimmerHighlightColor,
|
|
104
|
+
theme: themeOverrides,
|
|
105
|
+
}), [
|
|
106
|
+
activeSuffix,
|
|
107
|
+
shimmerDuration,
|
|
108
|
+
shimmerSpread,
|
|
109
|
+
shimmerColor,
|
|
110
|
+
shimmerHighlightColor,
|
|
111
|
+
themeOverrides,
|
|
112
|
+
]);
|
|
113
|
+
// steps => structured list of rows; otherwise raw children (prose / markdown
|
|
114
|
+
// / mixed). Memoized so it survives the 100ms duration ticks while active —
|
|
115
|
+
// only the summary row's duration should re-render, not the whole step list.
|
|
116
|
+
const reasoningBody = useMemo(() => {
|
|
117
|
+
if (steps) {
|
|
118
|
+
return (jsx("ol", { className: theme.stepsStyle, children: steps.map((step, index) => {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
return (jsx("li", { className: theme.stepItemStyle, children: jsx(AgentStatus, { mode: "status", status: (_a = step.status) !== null && _a !== void 0 ? _a : "complete", label: step.label, duration: step.duration, wrap: true, live: "off", ...sharedRowProps }) }, (_b = step.id) !== null && _b !== void 0 ? _b : index));
|
|
121
|
+
}) }));
|
|
122
|
+
}
|
|
123
|
+
return children !== undefined ? (jsx("div", { className: theme.proseStyle, children: children })) : null;
|
|
124
|
+
}, [steps, children, theme, sharedRowProps]);
|
|
125
|
+
// ===== STATUS MODE: a single activity row =====
|
|
126
|
+
if (!isReasoning) {
|
|
127
|
+
return (jsx("div", { ref: ref, role: "status", "aria-live": live, "aria-atomic": "true", "data-state": status, className: cn(theme.baseStyle, theme.stateStyles[status], className), ...rest, children: jsx(StatusRowInner, { theme: theme, status: status, label: label, isActive: isActive, indicator: showIndicator, icon: icon, wrap: wrap, activeSuffix: activeSuffix, shimmerDuration: shimmerDuration, shimmerSpread: shimmerSpread, shimmerColor: shimmerColor, shimmerHighlightColor: shimmerHighlightColor, shownDuration: shownDuration }) }));
|
|
128
|
+
}
|
|
129
|
+
// ===== REASONING MODE: a collapsible disclosure of the same rows =====
|
|
130
|
+
const contentId = `${reactId}-reasoning`;
|
|
131
|
+
const triggerId = `${contentId}-trigger`;
|
|
132
|
+
const isOpen = isControlled ? open : uncontrolledOpen;
|
|
133
|
+
const instantTransition = shouldReduceMotion ? { duration: 0 } : undefined;
|
|
134
|
+
const toggle = () => {
|
|
135
|
+
const next = !isOpen;
|
|
136
|
+
if (!isControlled)
|
|
137
|
+
setUncontrolledOpen(next);
|
|
138
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(next);
|
|
139
|
+
};
|
|
140
|
+
return (jsxs("div", { ref: ref, "data-state": isOpen ? "open" : "closed", className: cn(theme.reasoningRootStyle, className), ...rest, children: [jsx("button", { id: triggerId, type: "button", className: theme.triggerStyle, "aria-expanded": isOpen, "aria-controls": isOpen ? contentId : undefined, onClick: toggle, children: jsxs("span", { className: theme.triggerContentStyle, children: [jsx("span", { className: cn(theme.baseStyle, theme.stateStyles[status]), "aria-live": live, "aria-atomic": "true", children: jsx(StatusRowInner, { theme: theme, status: status, label: label, isActive: isActive, indicator: showIndicator, icon: icon, wrap: false, activeSuffix: activeSuffix, shimmerDuration: shimmerDuration, shimmerSpread: shimmerSpread, shimmerColor: shimmerColor, shimmerHighlightColor: shimmerHighlightColor, shownDuration: shownDuration }) }), jsx(motion.span, { className: theme.chevronStyle, initial: false, animate: isOpen ? "open" : "closed", variants: createTriggerIconVariants(90), transition: instantTransition, "aria-hidden": "true", children: jsx(CaretRight, { className: "size-full" }) })] }) }), divider && jsx("div", { className: theme.dividerStyle, "aria-hidden": "true" }), jsx(AnimatePresence, { initial: false, children: isOpen && (jsx(motion.div, { id: contentId, role: "region", "aria-labelledby": triggerId, className: theme.contentStyle, "data-state": "open", initial: "collapsed", animate: "open", exit: "collapsed", variants: accordionAnimations, transition: instantTransition, children: jsx(motion.div, { className: theme.contentInnerStyle, initial: "collapsed", animate: "open", exit: "collapsed", variants: accordionContentAnimations, transition: instantTransition, children: reasoningBody }) })) })] }));
|
|
141
|
+
});
|
|
142
|
+
AgentStatus.displayName = "AgentStatus";
|
|
143
|
+
|
|
144
|
+
export { AgentStatus };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const agentStatusTheme = {
|
|
2
|
+
baseStyle: "inline-flex min-w-0 items-center gap-2 text-sm",
|
|
3
|
+
iconStyle: "flex size-4 shrink-0 items-center justify-center",
|
|
4
|
+
// truncate is applied at the call site (only when `wrap` is off) so steps can wrap.
|
|
5
|
+
labelStyle: "min-w-0 font-medium",
|
|
6
|
+
durationStyle: "shrink-0 text-sm tabular-nums text-[var(--color-text-muted)]",
|
|
7
|
+
stateStyles: {
|
|
8
|
+
idle: "text-[var(--color-text-muted)]",
|
|
9
|
+
active: "text-[var(--color-text-secondary)]",
|
|
10
|
+
complete: "text-[var(--color-text-muted)]",
|
|
11
|
+
pending: "text-[var(--color-text-placeholder)]",
|
|
12
|
+
error: "text-[var(--color-danger)]",
|
|
13
|
+
},
|
|
14
|
+
indicatorStyles: {
|
|
15
|
+
idle: "text-[var(--color-text-muted)]",
|
|
16
|
+
active: "text-[var(--color-primary)]",
|
|
17
|
+
complete: "text-[var(--color-success)]",
|
|
18
|
+
pending: "text-[var(--color-text-placeholder)]",
|
|
19
|
+
error: "text-[var(--color-danger)]",
|
|
20
|
+
},
|
|
21
|
+
// --- reasoning mode: borderless inline disclosure ---
|
|
22
|
+
reasoningRootStyle: "w-full min-w-0",
|
|
23
|
+
triggerStyle: "flex w-full items-center py-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-primary)]",
|
|
24
|
+
triggerContentStyle: "inline-flex min-w-0 items-center gap-1.5",
|
|
25
|
+
chevronStyle: "inline-flex size-3.5 shrink-0 items-center justify-center text-[var(--color-text-muted)]",
|
|
26
|
+
dividerStyle: "h-px w-full bg-[var(--color-border)]",
|
|
27
|
+
contentStyle: "w-full min-w-0 overflow-hidden",
|
|
28
|
+
contentInnerStyle: "w-full min-w-0 pt-3",
|
|
29
|
+
stepsStyle: "space-y-2",
|
|
30
|
+
stepItemStyle: "min-w-0",
|
|
31
|
+
// Raw children (prose / markdown / mixed). flex-col so any child — a <p>, a
|
|
32
|
+
// MarkdownRenderer, or an inline-flex AgentStatus row — stacks vertically; the
|
|
33
|
+
// gap lives on the container, so it survives child margin resets.
|
|
34
|
+
proseStyle: "flex flex-col gap-3 text-sm leading-relaxed text-[var(--color-text-secondary)] [&_p]:m-0",
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { agentStatusTheme };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type AgentStatusState = "idle" | "active" | "complete" | "pending" | "error";
|
|
3
|
+
/**
|
|
4
|
+
* Presentation mode. `status` is a single activity row; `reasoning` turns that
|
|
5
|
+
* same row into a collapsible disclosure whose body holds steps and/or prose.
|
|
6
|
+
* The two axes are independent — a `reasoning` block is itself `active`,
|
|
7
|
+
* `complete`, etc.
|
|
8
|
+
*/
|
|
9
|
+
export type AgentStatusMode = "status" | "reasoning";
|
|
10
|
+
/** A single reasoning step — a serializable AgentStatus row. */
|
|
11
|
+
export interface AgentStatusStepData {
|
|
12
|
+
id?: React.Key;
|
|
13
|
+
label: React.ReactNode;
|
|
14
|
+
status?: AgentStatusState;
|
|
15
|
+
/** Elapsed or final step duration in seconds. */
|
|
16
|
+
duration?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AgentStatusTheme {
|
|
19
|
+
baseStyle: string;
|
|
20
|
+
iconStyle: string;
|
|
21
|
+
labelStyle: string;
|
|
22
|
+
durationStyle: string;
|
|
23
|
+
stateStyles: Record<AgentStatusState, string>;
|
|
24
|
+
indicatorStyles: Record<AgentStatusState, string>;
|
|
25
|
+
reasoningRootStyle: string;
|
|
26
|
+
triggerStyle: string;
|
|
27
|
+
triggerContentStyle: string;
|
|
28
|
+
chevronStyle: string;
|
|
29
|
+
dividerStyle: string;
|
|
30
|
+
contentStyle: string;
|
|
31
|
+
contentInnerStyle: string;
|
|
32
|
+
stepsStyle: string;
|
|
33
|
+
stepItemStyle: string;
|
|
34
|
+
proseStyle: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AgentStatusThemeOverrides extends Omit<Partial<AgentStatusTheme>, "stateStyles" | "indicatorStyles"> {
|
|
37
|
+
stateStyles?: Partial<AgentStatusTheme["stateStyles"]>;
|
|
38
|
+
indicatorStyles?: Partial<AgentStatusTheme["indicatorStyles"]>;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentStatusProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/** Single status row (default) or a collapsible reasoning disclosure. @default "status" */
|
|
42
|
+
mode?: AgentStatusMode;
|
|
43
|
+
/** Current execution state. Active labels shimmer; settled labels are static. */
|
|
44
|
+
status?: AgentStatusState;
|
|
45
|
+
/** Human-readable activity, for example "Thinking" or "Searching sources". */
|
|
46
|
+
label: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Elapsed or final duration in seconds. Takes precedence over `startedAt`, so
|
|
49
|
+
* pass it when the duration is authoritative (for example, returned by the server).
|
|
50
|
+
*/
|
|
51
|
+
duration?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Epoch milliseconds the activity began. The duration then ticks on its own
|
|
54
|
+
* while `status` is `"active"` and freezes the moment it settles — no timer
|
|
55
|
+
* wiring in the consumer. Ignored when `duration` is supplied.
|
|
56
|
+
*/
|
|
57
|
+
startedAt?: number;
|
|
58
|
+
/** Optional icon. When omitted, the animated semantic indicator is rendered. */
|
|
59
|
+
icon?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Show the leading status indicator (or custom `icon`). Set `false` for an
|
|
62
|
+
* icon-less, text-only row — the label then sits flush left.
|
|
63
|
+
*
|
|
64
|
+
* Defaults differ by mode: a `status` row always shows one, while a `reasoning`
|
|
65
|
+
* summary shows one only while active (the chevron carries the affordance once
|
|
66
|
+
* settled) — unless an `icon` is supplied, which opts back in. Pass explicitly
|
|
67
|
+
* to override either default.
|
|
68
|
+
* @default true in `status` mode; active-only in `reasoning` mode
|
|
69
|
+
*/
|
|
70
|
+
indicator?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Let the label wrap onto multiple lines instead of truncating. Steps render
|
|
73
|
+
* with this on; the standalone/summary row truncates by default.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
wrap?: boolean;
|
|
77
|
+
/** Text appended while active. @default "…" */
|
|
78
|
+
activeSuffix?: React.ReactNode;
|
|
79
|
+
/** Active shimmer cycle duration in seconds. @default 2 */
|
|
80
|
+
shimmerDuration?: number;
|
|
81
|
+
/** Width of the active shimmer highlight band. @default 16 */
|
|
82
|
+
shimmerSpread?: number;
|
|
83
|
+
/** Base color for the active shimmer text. */
|
|
84
|
+
shimmerColor?: string;
|
|
85
|
+
/** Highlight color for the active shimmer sweep. */
|
|
86
|
+
shimmerHighlightColor?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Accessible announcement behavior. `"polite"` waits for a pause rather than
|
|
89
|
+
* interrupting, which is what a background activity warrants.
|
|
90
|
+
* @default "polite"
|
|
91
|
+
*/
|
|
92
|
+
live?: "off" | "polite" | "assertive";
|
|
93
|
+
/**
|
|
94
|
+
* Structured reasoning steps. Rendered as a list of AgentStatus rows.
|
|
95
|
+
* Ignored unless `mode="reasoning"`.
|
|
96
|
+
*/
|
|
97
|
+
steps?: AgentStatusStepData[];
|
|
98
|
+
/**
|
|
99
|
+
* Free-form reasoning body — prose, a `<MarkdownRenderer>`, or a mix of prose
|
|
100
|
+
* and `<AgentStatus>` rows. Rendered raw (not wrapped in a list), so paragraphs
|
|
101
|
+
* are valid. `steps` takes precedence when both are supplied.
|
|
102
|
+
*/
|
|
103
|
+
children?: React.ReactNode;
|
|
104
|
+
/** Controlled expanded state (reasoning mode). */
|
|
105
|
+
open?: boolean;
|
|
106
|
+
/** Initial expanded state for uncontrolled reasoning usage. @default false */
|
|
107
|
+
defaultOpen?: boolean;
|
|
108
|
+
onOpenChange?: (open: boolean) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Render the full-width hairline under the reasoning trigger.
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
divider?: boolean;
|
|
114
|
+
className?: string;
|
|
115
|
+
theme?: AgentStatusThemeOverrides;
|
|
116
|
+
}
|
|
@@ -3,7 +3,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import React__default, { useState, useMemo, useCallback, useRef } from 'react';
|
|
4
4
|
import { Prism } from 'react-syntax-highlighter';
|
|
5
5
|
import { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
6
|
-
import {
|
|
6
|
+
import { FileText, ListChecks, Copy } from '@phosphor-icons/react';
|
|
7
7
|
import { codeBlockTheme } from './CodeBlock.theme.js';
|
|
8
8
|
import { LanguageIcon } from './LanguageIcon.js';
|
|
9
9
|
import { cn } from '../../../utils/cn.js';
|
|
@@ -177,7 +177,7 @@ const CodeBlock = React__default.forwardRef(({ children, language = "text", show
|
|
|
177
177
|
// `lineProps` starts counting from line 1 every time, regardless of
|
|
178
178
|
// `showLineNumbers`.
|
|
179
179
|
lineCounterRef.current = 0;
|
|
180
|
-
return (jsxs("div", { ref: ref, className: cn(mergedTheme.baseStyle, className), ...props, children: [showHeader && (jsxs("div", { className: mergedTheme.header, children: [jsx("div", { className: mergedTheme.headerLeft, children: filename && (jsxs(Fragment, { children: [jsx(
|
|
180
|
+
return (jsxs("div", { ref: ref, className: cn(mergedTheme.baseStyle, className), ...props, children: [showHeader && (jsxs("div", { className: mergedTheme.header, children: [jsx("div", { className: mergedTheme.headerLeft, children: filename && (jsxs(Fragment, { children: [jsx(FileText, { className: "size-4 text-[var(--color-text-muted)]" }), jsx("span", { className: mergedTheme.filename, children: filename })] })) }), jsxs("div", { className: mergedTheme.headerRight, children: [showLanguage && (jsxs("div", { className: "flex items-center gap-2", children: [jsx(LanguageIcon, { language: language, className: "size-4" }), jsx("span", { className: mergedTheme.languageLabel, children: displayLanguage })] })), copyable && (jsx("button", { onClick: handleCopy, className: cn(mergedTheme.copyButton, copied && mergedTheme.copySuccess), "aria-label": copied ? "Copied!" : "Copy code", title: copied ? "Copied!" : "Copy code", children: copied ? (jsx(ListChecks, { className: "size-4" })) : (jsx(Copy, { className: "size-4" })) }))] })] })), jsx("div", { className: mergedTheme.codeWrapper, style: {
|
|
181
181
|
maxHeight: maxHeight,
|
|
182
182
|
overflowY: maxHeight ? "auto" : undefined,
|
|
183
183
|
}, children: jsx(Prism, { language: language, style: syntaxTheme === "dark" ? oneDark : oneLight, showLineNumbers: showLineNumbers, wrapLines: true, wrapLongLines: wrapLines, lineProps: lineProps, lineNumberStyle: {
|
|
@@ -192,7 +192,7 @@ const CodeBlock = React__default.forwardRef(({ children, language = "text", show
|
|
|
192
192
|
fontSize: "0.875rem",
|
|
193
193
|
lineHeight: "1.5",
|
|
194
194
|
background: "transparent",
|
|
195
|
-
}, children: code }) }), !showHeader && copyable && (jsx("button", { onClick: handleCopy, className: cn("absolute top-2 right-2", mergedTheme.copyButton, copied && mergedTheme.copySuccess), "aria-label": copied ? "Copied!" : "Copy code", title: copied ? "Copied!" : "Copy code", children: copied ? (jsx(
|
|
195
|
+
}, children: code }) }), !showHeader && copyable && (jsx("button", { onClick: handleCopy, className: cn("absolute top-2 right-2", mergedTheme.copyButton, copied && mergedTheme.copySuccess), "aria-label": copied ? "Copied!" : "Copy code", title: copied ? "Copied!" : "Copy code", children: copied ? (jsx(ListChecks, { className: "size-4" })) : (jsx(Copy, { className: "size-4" })) }))] }));
|
|
196
196
|
});
|
|
197
197
|
CodeBlock.displayName = "CodeBlock";
|
|
198
198
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const codeBlockTheme = {
|
|
2
2
|
baseStyle: "relative rounded-[var(--codeblock-radius)] border border-[var(--color-border)] overflow-hidden bg-[var(--color-surface-sunken)] shadow-inner-real-sm",
|
|
3
|
-
header: "flex items-center justify-between px-3 py-1.5 bg-[var(--color-
|
|
3
|
+
header: "flex items-center justify-between px-3 py-1.5 bg-[var(--color-surface)] border-b border-[var(--color-border)]",
|
|
4
4
|
headerLeft: "flex items-center gap-2 min-w-0 flex-1 ",
|
|
5
5
|
headerRight: "flex items-center gap-2 flex-shrink-0",
|
|
6
6
|
filename: "text-sm font-medium text-[var(--color-text-secondary)] truncate",
|
|
7
7
|
languageLabel: "text-xs uppercase tracking-wider font-semibold text-[var(--color-text-muted)]",
|
|
8
8
|
codeWrapper: "overflow-x-auto",
|
|
9
|
-
highlightedLine: " -mx-4 px-4 bg-[var(--color-primary-50)] border-l-2 border-l-[var(--color-primary)] dark:bg-[var(--color-
|
|
9
|
+
highlightedLine: " -mx-4 px-4 bg-[var(--color-primary-50)] border-l-2 border-l-[var(--color-primary)] dark:bg-[var(--color-mono-400)]/5 dark:border-l-[var(--color-mono-200)]",
|
|
10
10
|
diffAddition: "-mx-4 px-4 bg-[var(--color-success-50)] border-l-4 border-l-[var(--color-success)] dark:bg-[var(--color-success-600)]/20 dark:border-l-[var(--color-success-700)]",
|
|
11
11
|
diffDeletion: "-mx-4 px-4 bg-[var(--color-danger-50)] border-l-4 border-l-[var(--color-danger)] dark:bg-[var(--color-danger-600)]/20 dark:border-l-[var(--color-danger-700)]",
|
|
12
12
|
copyButton: "p-1.5 rounded-[calc(var(--radius-base)*0.75)] text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]",
|