@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.11
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/ai/ApprovalCard/ApprovalCard.js +3 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.animations.d.ts +25 -0
- package/dist/components/ai/PromptInput/PromptInput.animations.js +61 -0
- package/dist/components/ai/PromptInput/PromptInput.js +264 -31
- package/dist/components/ai/PromptInput/PromptInput.theme.js +6 -1
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +68 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.d.ts +10 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.js +258 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.types.d.ts +17 -0
- package/dist/components/ai/PromptInput/index.d.ts +1 -0
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +1 -1
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +51 -27
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +4 -5
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +5 -12
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +20 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +2 -2
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +2 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +27 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +134 -0
- package/dist/components/ai/StreamingResponse/index.d.ts +3 -1
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +6 -6
- package/dist/components/ai/index.js +1 -0
- package/dist/components/charts/ActivityRings/ActivityRings.js +1 -1
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +2 -2
- package/dist/components/charts/BarChart/BarChart.js +3 -3
- package/dist/components/charts/ChartContainer.js +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +2 -2
- package/dist/components/charts/DonutChart/DonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/DonutChart.types.d.ts +1 -2
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.types.d.ts +1 -2
- package/dist/components/charts/FunnelChart/FunnelChart.js +7 -7
- package/dist/components/charts/Heatmap/Heatmap.theme.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapCell.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapLegend.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +2 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +1 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +2 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +2 -2
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +4 -4
- package/dist/components/core/Accordion/Accordion.animations.d.ts +6 -1
- package/dist/components/core/Accordion/Accordion.animations.js +15 -1
- package/dist/components/core/Accordion/Accordion.theme.js +5 -5
- package/dist/components/core/Accordion/Accordion.types.d.ts +25 -0
- package/dist/components/core/Accordion/AccordionContent.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +11 -6
- package/dist/components/core/Alert/Alert.js +3 -2
- package/dist/components/core/Alert/Alert.theme.js +4 -8
- package/dist/components/core/Alert/Alert.types.d.ts +4 -3
- package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/core/Avatar/Avatar.theme.js +5 -5
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.d.ts +1 -1
- package/dist/components/core/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +24 -20
- package/dist/components/core/Badge/Badge.types.d.ts +10 -5
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/core/Button/Button.d.ts +1 -1
- package/dist/components/core/Button/Button.js +21 -18
- package/dist/components/core/Button/Button.ripple.d.ts +5 -1
- package/dist/components/core/Button/Button.ripple.js +27 -17
- package/dist/components/core/Button/Button.theme.d.ts +1 -2
- package/dist/components/core/Button/Button.theme.js +46 -41
- package/dist/components/core/Button/Button.types.d.ts +3 -3
- package/dist/components/core/Button/index.d.ts +2 -0
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +1 -1
- package/dist/components/core/Calendar/Calendar.js +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +9 -9
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +1 -1
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +6 -7
- package/dist/components/core/Card/Card.theme.js +2 -2
- package/dist/components/core/Card/Card.types.d.ts +7 -27
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- package/dist/components/core/Card/CardTitle.d.ts +1 -1
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +6 -6
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +3 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +3 -3
- package/dist/components/core/Drawer/Drawer.d.ts +13 -1
- package/dist/components/core/Drawer/Drawer.js +23 -10
- package/dist/components/core/Drawer/Drawer.theme.d.ts +2 -0
- package/dist/components/core/Drawer/Drawer.theme.js +15 -13
- package/dist/components/core/Drawer/Drawer.types.d.ts +26 -9
- package/dist/components/core/Drawer/DrawerContent.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +15 -0
- package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
- package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerTitle.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.theme.js +1 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +1 -0
- package/dist/components/core/Empty/Empty.js +2 -2
- package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
- package/dist/components/core/Empty/Empty.theme.js +3 -3
- package/dist/components/core/Empty/Empty.types.d.ts +2 -2
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.types.d.ts +2 -2
- package/dist/components/core/Loader/Loader.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +9 -11
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +3 -2
- package/dist/components/core/Message/Message.js +30 -24
- package/dist/components/core/Message/Message.theme.d.ts +1 -1
- package/dist/components/core/Message/Message.theme.js +22 -24
- package/dist/components/core/Message/Message.types.d.ts +0 -7
- package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
- package/dist/components/core/Message/MessageList.animations.js +32 -0
- package/dist/components/core/Message/MessageList.d.ts +5 -0
- package/dist/components/core/Message/MessageList.js +78 -0
- package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
- package/dist/components/core/Message/MessageList.theme.js +6 -0
- package/dist/components/core/Message/MessageList.types.d.ts +32 -0
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +2 -2
- package/dist/components/core/Modal/Modal.js +5 -5
- package/dist/components/core/Modal/Modal.theme.js +6 -6
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- package/dist/components/core/Modal/ModalHeader.js +1 -0
- package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
- package/dist/components/core/Modal/ModalSubtitle.js +11 -0
- package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
- package/dist/components/core/NavItem/NavItem.js +1 -1
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +3 -3
- package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
- package/dist/components/core/PageHeading/PageHeading.js +28 -0
- package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
- package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
- package/dist/components/core/PageHeading/index.d.ts +2 -0
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.theme.js +3 -3
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Popover/Popover.types.d.ts +6 -0
- package/dist/components/core/Popover/PopoverContent.js +8 -2
- package/dist/components/core/Progress/Progress.theme.js +10 -7
- package/dist/components/core/Progress/Progress.types.d.ts +2 -1
- package/dist/components/core/Segmented/Segmented.theme.js +5 -5
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- package/dist/components/core/Sidebar/SidebarNavGroup.js +1 -1
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
- package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
- package/dist/components/core/SocialIcon/index.d.ts +2 -0
- package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
- package/dist/components/core/SocialIcon/platforms.js +234 -0
- package/dist/components/core/Spinner/Spinner.theme.js +3 -5
- package/dist/components/core/Spinner/Spinner.types.d.ts +2 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tag/Tag.d.ts +2 -2
- package/dist/components/core/Tag/Tag.js +21 -4
- package/dist/components/core/Tag/Tag.theme.js +12 -4
- package/dist/components/core/Tag/Tag.types.d.ts +24 -1
- package/dist/components/core/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +4 -4
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +10 -19
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +8 -0
- package/dist/components/{core → data-display}/Feed/Feed.js +3 -3
- package/dist/components/{core → data-display}/Feed/Feed.theme.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
- package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.js +29 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
- package/dist/components/data-display/GanttChart/index.d.ts +3 -0
- package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
- package/dist/components/{core → data-display}/KPI/KPI.theme.js +12 -12
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +6 -5
- package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
- package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
- package/dist/components/{core → data-display}/Metric/Metric.theme.js +17 -13
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +8 -7
- package/dist/components/{core → data-display}/Table/Table.theme.js +4 -4
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableActionsMenu.js +1 -1
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +6 -5
- package/dist/components/{core → data-display}/Table/TableFilter.js +6 -6
- package/dist/components/{core → data-display}/Table/TableHeader.js +1 -1
- package/dist/components/data-display/Table/TablePagination.js +25 -0
- package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
- package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +3 -3
- package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +2 -2
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -0
- package/dist/components/effects/3d/index.d.ts +6 -0
- package/dist/components/effects/3d/index.js +3 -0
- package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
- package/dist/components/effects/Aurora/Aurora.js +119 -0
- package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
- package/dist/components/effects/Aurora/index.d.ts +2 -0
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +3 -1
- package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +5 -4
- package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
- package/dist/components/effects/DotPattern/DotPattern.js +65 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
- package/dist/components/effects/DotPattern/index.d.ts +2 -0
- package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
- package/dist/components/effects/GridPattern/GridPattern.js +64 -0
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
- package/dist/components/effects/GridPattern/index.d.ts +2 -0
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
- package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
- package/dist/components/effects/MagneticElement/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
- package/dist/components/effects/MorphingText/MorphingText.js +91 -0
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
- package/dist/components/effects/MorphingText/index.d.ts +2 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
- package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
- package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
- package/dist/components/effects/Particles/Particles.d.ts +22 -0
- package/dist/components/effects/Particles/Particles.js +33 -0
- package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
- package/dist/components/effects/Particles/Particles.scene.js +284 -0
- package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
- package/dist/components/effects/Particles/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
- package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
- package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
- package/dist/components/effects/Spotlight/Spotlight.js +112 -0
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
- package/dist/components/effects/Spotlight/index.d.ts +2 -0
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
- package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
- package/dist/components/effects/StickyScroll/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +22 -4
- package/dist/components/effects/index.js +11 -2
- package/dist/components/forms/Checkbox/Checkbox.d.ts +3 -4
- package/dist/components/forms/Checkbox/Checkbox.js +36 -12
- package/dist/components/forms/Checkbox/Checkbox.theme.js +9 -5
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +28 -2
- package/dist/components/forms/Checkbox/CheckboxContext.d.ts +14 -0
- package/dist/components/forms/Checkbox/CheckboxContext.js +12 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.js +40 -0
- package/dist/components/forms/Checkbox/index.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +7 -7
- package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
- package/dist/components/forms/CronInput/CronInput.js +107 -0
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
- package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
- package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
- package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
- package/dist/components/forms/CronInput/index.d.ts +4 -0
- package/dist/components/forms/DatePicker/DatePicker.theme.js +3 -3
- package/dist/components/forms/DatePicker/DatePickerContent.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +80 -2
- package/dist/components/forms/FileUpload/FileUpload.theme.js +4 -4
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.d.ts +1 -1
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +3 -2
- package/dist/components/forms/InputOTP/InputOTP.theme.js +2 -2
- package/dist/components/forms/InputTag/InputTag.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +607 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +55 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +151 -0
- package/dist/components/forms/Mention/Mention.utils.d.ts +42 -0
- package/dist/components/forms/Mention/Mention.utils.js +285 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.d.ts +3 -4
- package/dist/components/forms/Radio/Radio.js +25 -12
- package/dist/components/forms/Radio/Radio.theme.js +34 -5
- package/dist/components/forms/Radio/Radio.types.d.ts +30 -4
- package/dist/components/forms/Radio/RadioContext.d.ts +14 -0
- package/dist/components/forms/Radio/RadioContext.js +12 -0
- package/dist/components/forms/Radio/RadioGroup.d.ts +3 -0
- package/dist/components/forms/Radio/RadioGroup.js +36 -0
- package/dist/components/forms/Radio/index.d.ts +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +1 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
- package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
- package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +33 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
- package/dist/components/forms/SelectableCard/index.d.ts +3 -0
- package/dist/components/forms/Signature/Signature.theme.js +1 -1
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
- package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
- package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
- package/dist/components/forms/TransferList/TransferList.js +199 -0
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
- package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
- package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
- package/dist/components/forms/TransferList/index.d.ts +3 -0
- package/dist/components/forms/forms.theme.js +6 -6
- package/dist/components/forms/index.d.ts +15 -2
- package/dist/components/forms/index.js +87 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
- package/dist/components/layout/FormLayout/FormLayout.js +22 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
- package/dist/components/layout/FormLayout/index.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
- package/dist/components/layout/PageLayout/PageLayout.js +33 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
- package/dist/components/layout/PageLayout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/hooks/useSelectPortal.d.ts +4 -2
- package/dist/hooks/useSelectPortal.js +139 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.js +206 -167
- package/dist/styles.css +1 -1
- package/dist/utils/colorUtils.d.ts +23 -0
- package/dist/utils/colorUtils.js +45 -0
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +38 -26
- package/src/global.scss +673 -0
- package/src/styles/theme.css +378 -0
- package/src/theme-plugin.css +11 -0
- package/dist/components/core/Button/Button.animations.d.ts +0 -5
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- package/dist/components/core/DescriptionList/DescriptionList.theme.js +0 -8
- package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
- package/dist/components/core/Modal/ModalDescription.js +0 -11
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
- package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
- package/dist/components/core/Table/TablePagination.js +0 -25
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
- /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/index.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
|
@@ -154,6 +154,59 @@ export interface PromptInputProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
154
154
|
submitButtonIcon?: React.ReactNode;
|
|
155
155
|
/** Visual indicator for keyboard shortcut (not functional) */
|
|
156
156
|
submitShortcut?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Callback when stop button is clicked during loading state.
|
|
159
|
+
* When provided AND state="loading", the submit button becomes a stop button.
|
|
160
|
+
*/
|
|
161
|
+
onStop?: () => void;
|
|
162
|
+
/**
|
|
163
|
+
* Enable inline voice recording mode.
|
|
164
|
+
* When true, clicking the voice button starts an inline recording UI
|
|
165
|
+
* instead of calling onVoiceClick.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
enableVoiceRecording?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Called when the user confirms a voice recording
|
|
171
|
+
* @param audioBlob - The recorded audio as a Blob
|
|
172
|
+
*/
|
|
173
|
+
onRecordingComplete?: (audioBlob: Blob) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Called when the user cancels a voice recording
|
|
176
|
+
*/
|
|
177
|
+
onRecordingCancel?: () => void;
|
|
178
|
+
/**
|
|
179
|
+
* Maximum recording duration in seconds (auto-stops at limit)
|
|
180
|
+
* @default 120
|
|
181
|
+
*/
|
|
182
|
+
maxRecordingDuration?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Enable drag-and-drop file attachment
|
|
185
|
+
* @default true
|
|
186
|
+
*/
|
|
187
|
+
enableDropzone?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Text displayed in the dropzone overlay (legacy, used as fallback for dropzoneTitle)
|
|
190
|
+
* @default "Drop files here to add to chat"
|
|
191
|
+
*/
|
|
192
|
+
dropzoneText?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Title text for the enhanced dropzone overlay.
|
|
195
|
+
* Supports **bold** markdown for the "browse" action word.
|
|
196
|
+
* Falls back to dropzoneText if not provided.
|
|
197
|
+
*/
|
|
198
|
+
dropzoneTitle?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Subtitle text for the enhanced dropzone overlay
|
|
201
|
+
*/
|
|
202
|
+
dropzoneSubtitle?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Layout variant
|
|
205
|
+
* - "default": stacked layout with footer toolbar below textarea
|
|
206
|
+
* - "simple": inline layout with submit button next to textarea, no footer
|
|
207
|
+
* @default "default"
|
|
208
|
+
*/
|
|
209
|
+
variant?: "default" | "simple";
|
|
157
210
|
/** Additional class name for the container (highest priority) */
|
|
158
211
|
className?: string;
|
|
159
212
|
/** Additional class name for the textarea element */
|
|
@@ -203,6 +256,16 @@ export interface PromptInputThemeOverrides {
|
|
|
203
256
|
actionsStyle?: string;
|
|
204
257
|
/** Style for the submit button */
|
|
205
258
|
submitButtonStyle?: string;
|
|
259
|
+
/** Style for the dropzone overlay */
|
|
260
|
+
dropzoneStyle?: string;
|
|
261
|
+
/** Style for the dropzone title text */
|
|
262
|
+
dropzoneTitleStyle?: string;
|
|
263
|
+
/** Style for the dropzone subtitle text */
|
|
264
|
+
dropzoneSubtitleStyle?: string;
|
|
265
|
+
/** Style for the dropzone action icons row */
|
|
266
|
+
dropzoneActionsStyle?: string;
|
|
267
|
+
/** Style for the voice recorder container */
|
|
268
|
+
voiceRecorderStyle?: string;
|
|
206
269
|
/** State-specific styles */
|
|
207
270
|
states?: Partial<Record<PromptInputState, string>>;
|
|
208
271
|
}
|
|
@@ -215,5 +278,10 @@ export interface PromptInputTheme {
|
|
|
215
278
|
footerStyle: string;
|
|
216
279
|
actionsStyle: string;
|
|
217
280
|
submitButtonStyle: string;
|
|
281
|
+
dropzoneStyle: string;
|
|
282
|
+
dropzoneTitleStyle: string;
|
|
283
|
+
dropzoneSubtitleStyle: string;
|
|
284
|
+
dropzoneActionsStyle: string;
|
|
285
|
+
voiceRecorderStyle: string;
|
|
218
286
|
states: Record<PromptInputState, string>;
|
|
219
287
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { VoiceRecorderProps } from "./VoiceRecorder.types";
|
|
3
|
+
/**
|
|
4
|
+
* Internal voice recorder sub-component.
|
|
5
|
+
* Handles MediaRecorder lifecycle, timer display, and recording controls.
|
|
6
|
+
*
|
|
7
|
+
* Recording starts immediately on mount.
|
|
8
|
+
* Not exported from the library's public API.
|
|
9
|
+
*/
|
|
10
|
+
export declare const VoiceRecorder: React.FC<VoiceRecorderProps>;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { PlayIcon, PauseIcon, CheckIcon } from '@heroicons/react/24/outline';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
import '../../core/Accordion/Accordion.js';
|
|
7
|
+
import '../../core/AlertDialog/AlertDialog.js';
|
|
8
|
+
import '../../core/AspectRatio/AspectRatio.js';
|
|
9
|
+
import '../../core/Avatar/Avatar.js';
|
|
10
|
+
import '../../core/AvatarGroup/AvatarGroup.js';
|
|
11
|
+
import '../../core/Badge/Badge.js';
|
|
12
|
+
import '../../core/Breadcrumbs/Breadcrumbs.js';
|
|
13
|
+
import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
|
|
14
|
+
import { Button } from '../../core/Button/Button.js';
|
|
15
|
+
import '../../core/ButtonGroup/ButtonGroup.js';
|
|
16
|
+
import '../../core/ButtonGroup/ButtonGroupSeparator.js';
|
|
17
|
+
import '../../core/ButtonGroup/ButtonGroupText.js';
|
|
18
|
+
import '../../core/Calendar/Calendar.js';
|
|
19
|
+
import '../../core/Calendar/CalendarMini/CalendarMini.js';
|
|
20
|
+
import '../../core/Card/Card.js';
|
|
21
|
+
import '../../core/CardStack/CardStack.js';
|
|
22
|
+
import '../../core/Carousel/Carousel.js';
|
|
23
|
+
import '../../core/CommandPalette/CommandPalette.js';
|
|
24
|
+
import '../../core/Separator/Separator.js';
|
|
25
|
+
import '../../core/Drawer/Drawer.js';
|
|
26
|
+
import '../../core/Dropdown/Dropdown.js';
|
|
27
|
+
import '../../core/Dropdown/DropdownTrigger.js';
|
|
28
|
+
import '../../core/Dropdown/DropdownMenu.js';
|
|
29
|
+
import '../../core/Dropdown/DropdownItem.js';
|
|
30
|
+
import '../../core/Dropdown/DropdownSection.js';
|
|
31
|
+
import '../../core/Dropdown/DropdownSeparator.js';
|
|
32
|
+
import '../../core/Dropdown/Dropdown.theme.js';
|
|
33
|
+
import '../../core/Kbd/Kbd.js';
|
|
34
|
+
import '../../core/MenuItem/MenuItem.js';
|
|
35
|
+
import '../../core/Link/Link.js';
|
|
36
|
+
import '../../core/Loader/Loader.js';
|
|
37
|
+
import '../../core/Modal/Modal.js';
|
|
38
|
+
import '../../core/ModalStack/ModalStack.js';
|
|
39
|
+
import '../../core/PageHeading/PageHeading.js';
|
|
40
|
+
import '../../core/Pagination/Pagination.js';
|
|
41
|
+
import '../../core/Popover/Popover.js';
|
|
42
|
+
import '../../core/Popover/PopoverContext.js';
|
|
43
|
+
import '../../core/Progress/Progress.js';
|
|
44
|
+
import '../../core/Rating/Rating.js';
|
|
45
|
+
import '../../core/ScrollArea/ScrollArea.js';
|
|
46
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
47
|
+
import '../../core/Segmented/Segmented.js';
|
|
48
|
+
import '../../core/Skeleton/Skeleton.js';
|
|
49
|
+
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
50
|
+
import '../../core/Tabs/Tabs.js';
|
|
51
|
+
import '../../core/Tabs/TabsList.js';
|
|
52
|
+
import '../../core/Tabs/TabsTrigger.js';
|
|
53
|
+
import '../../core/Tabs/TabsContent.js';
|
|
54
|
+
import '../../core/Tabs/TabsContext.js';
|
|
55
|
+
import '../../core/Tooltip/Tooltip.js';
|
|
56
|
+
import '../../core/Tooltip/Tooltip.animations.js';
|
|
57
|
+
import '../../core/Tree/Tree.js';
|
|
58
|
+
import '../../core/Tag/Tag.js';
|
|
59
|
+
import '../../core/Alert/Alert.js';
|
|
60
|
+
import '../../core/Toast/Toast.js';
|
|
61
|
+
import '../../core/Toast/ToastProvider.js';
|
|
62
|
+
import '@heroicons/react/24/solid';
|
|
63
|
+
import '../../core/Spinner/Spinner.js';
|
|
64
|
+
import '../../core/Message/Message.js';
|
|
65
|
+
import '../../core/Message/TypeWriter.js';
|
|
66
|
+
import '../../core/Empty/Empty.js';
|
|
67
|
+
import '../../core/Masonry/Masonry.js';
|
|
68
|
+
import '../../core/DragDrop/DragDrop.js';
|
|
69
|
+
import '../../core/Sortable/Sortable.js';
|
|
70
|
+
import '../../core/NavItem/NavItem.js';
|
|
71
|
+
import '../../core/Sidebar/Sidebar.js';
|
|
72
|
+
import '../../core/Sidebar/SidebarHeader.js';
|
|
73
|
+
import '../../core/Sidebar/SidebarContent.js';
|
|
74
|
+
import '../../core/Sidebar/SidebarFooter.js';
|
|
75
|
+
import '../../core/Sidebar/SidebarNav.js';
|
|
76
|
+
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
77
|
+
import '../../core/Sidebar/SidebarToggle.js';
|
|
78
|
+
import '../../core/Sidebar/SidebarContext.js';
|
|
79
|
+
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
80
|
+
import '../../core/ContextMenu/ContextMenu.js';
|
|
81
|
+
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
82
|
+
import '../../core/Pill/Pill.js';
|
|
83
|
+
import '../../core/SocialIcon/SocialIcon.js';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Format seconds into MM:SS display
|
|
87
|
+
*/
|
|
88
|
+
const formatTime = (seconds) => {
|
|
89
|
+
const mins = Math.floor(seconds / 60);
|
|
90
|
+
const secs = seconds % 60;
|
|
91
|
+
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Internal voice recorder sub-component.
|
|
95
|
+
* Handles MediaRecorder lifecycle, timer display, and recording controls.
|
|
96
|
+
*
|
|
97
|
+
* Recording starts immediately on mount.
|
|
98
|
+
* Not exported from the library's public API.
|
|
99
|
+
*/
|
|
100
|
+
const VoiceRecorder = ({ onComplete, onCancel, maxDuration, className, }) => {
|
|
101
|
+
const [recordingState, setRecordingState] = useState("idle");
|
|
102
|
+
const [elapsed, setElapsed] = useState(0);
|
|
103
|
+
const mediaRecorderRef = useRef(null);
|
|
104
|
+
const chunksRef = useRef([]);
|
|
105
|
+
const timerRef = useRef(null);
|
|
106
|
+
const streamRef = useRef(null);
|
|
107
|
+
/**
|
|
108
|
+
* Clean up timer
|
|
109
|
+
*/
|
|
110
|
+
const clearTimer = useCallback(() => {
|
|
111
|
+
if (timerRef.current) {
|
|
112
|
+
clearInterval(timerRef.current);
|
|
113
|
+
timerRef.current = null;
|
|
114
|
+
}
|
|
115
|
+
}, []);
|
|
116
|
+
/**
|
|
117
|
+
* Stop all media tracks and clean up
|
|
118
|
+
*/
|
|
119
|
+
const cleanup = useCallback(() => {
|
|
120
|
+
clearTimer();
|
|
121
|
+
if (mediaRecorderRef.current &&
|
|
122
|
+
mediaRecorderRef.current.state !== "inactive") {
|
|
123
|
+
mediaRecorderRef.current.stop();
|
|
124
|
+
}
|
|
125
|
+
if (streamRef.current) {
|
|
126
|
+
streamRef.current.getTracks().forEach((track) => track.stop());
|
|
127
|
+
streamRef.current = null;
|
|
128
|
+
}
|
|
129
|
+
mediaRecorderRef.current = null;
|
|
130
|
+
}, [clearTimer]);
|
|
131
|
+
/**
|
|
132
|
+
* Start the recording timer
|
|
133
|
+
*/
|
|
134
|
+
const startTimer = useCallback(() => {
|
|
135
|
+
clearTimer();
|
|
136
|
+
timerRef.current = setInterval(() => {
|
|
137
|
+
setElapsed((prev) => prev + 1);
|
|
138
|
+
}, 1000);
|
|
139
|
+
}, [clearTimer]);
|
|
140
|
+
/**
|
|
141
|
+
* Start recording immediately on mount
|
|
142
|
+
*/
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
let cancelled = false;
|
|
145
|
+
const startRecording = async () => {
|
|
146
|
+
try {
|
|
147
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
148
|
+
audio: true,
|
|
149
|
+
});
|
|
150
|
+
if (cancelled) {
|
|
151
|
+
stream.getTracks().forEach((t) => t.stop());
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
streamRef.current = stream;
|
|
155
|
+
// Choose supported MIME type
|
|
156
|
+
const mimeType = MediaRecorder.isTypeSupported("audio/webm;codecs=opus")
|
|
157
|
+
? "audio/webm;codecs=opus"
|
|
158
|
+
: MediaRecorder.isTypeSupported("audio/webm")
|
|
159
|
+
? "audio/webm"
|
|
160
|
+
: "";
|
|
161
|
+
const recorder = new MediaRecorder(stream, mimeType ? { mimeType } : undefined);
|
|
162
|
+
mediaRecorderRef.current = recorder;
|
|
163
|
+
chunksRef.current = [];
|
|
164
|
+
recorder.ondataavailable = (e) => {
|
|
165
|
+
if (e.data.size > 0) {
|
|
166
|
+
chunksRef.current.push(e.data);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
recorder.start(100); // collect data every 100ms
|
|
170
|
+
setRecordingState("recording");
|
|
171
|
+
startTimer();
|
|
172
|
+
}
|
|
173
|
+
catch (_a) {
|
|
174
|
+
if (process.env.NODE_ENV !== "production") {
|
|
175
|
+
// eslint-disable-next-line no-console
|
|
176
|
+
console.warn("[VoiceRecorder] Microphone access denied or unavailable.");
|
|
177
|
+
}
|
|
178
|
+
onCancel();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
startRecording();
|
|
182
|
+
return () => {
|
|
183
|
+
cancelled = true;
|
|
184
|
+
cleanup();
|
|
185
|
+
};
|
|
186
|
+
// Only run on mount/unmount
|
|
187
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
|
+
}, []);
|
|
189
|
+
/**
|
|
190
|
+
* Auto-stop at max duration
|
|
191
|
+
*/
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (elapsed >= maxDuration && recordingState === "recording") {
|
|
194
|
+
handleConfirm();
|
|
195
|
+
}
|
|
196
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
197
|
+
}, [elapsed, maxDuration, recordingState]);
|
|
198
|
+
/**
|
|
199
|
+
* Handle cancel — stop recording and discard
|
|
200
|
+
*/
|
|
201
|
+
const handleCancel = useCallback(() => {
|
|
202
|
+
cleanup();
|
|
203
|
+
chunksRef.current = [];
|
|
204
|
+
setRecordingState("idle");
|
|
205
|
+
onCancel();
|
|
206
|
+
}, [cleanup, onCancel]);
|
|
207
|
+
/**
|
|
208
|
+
* Handle confirm — stop recording and return blob
|
|
209
|
+
*/
|
|
210
|
+
const handleConfirm = useCallback(() => {
|
|
211
|
+
if (!mediaRecorderRef.current) {
|
|
212
|
+
onCancel();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const recorder = mediaRecorderRef.current;
|
|
216
|
+
recorder.onstop = () => {
|
|
217
|
+
const mimeType = recorder.mimeType || "audio/webm";
|
|
218
|
+
const blob = new Blob(chunksRef.current, { type: mimeType });
|
|
219
|
+
chunksRef.current = [];
|
|
220
|
+
if (streamRef.current) {
|
|
221
|
+
streamRef.current.getTracks().forEach((t) => t.stop());
|
|
222
|
+
streamRef.current = null;
|
|
223
|
+
}
|
|
224
|
+
onComplete(blob);
|
|
225
|
+
};
|
|
226
|
+
clearTimer();
|
|
227
|
+
if (recorder.state !== "inactive") {
|
|
228
|
+
recorder.stop();
|
|
229
|
+
}
|
|
230
|
+
setRecordingState("idle");
|
|
231
|
+
}, [clearTimer, onComplete, onCancel]);
|
|
232
|
+
/**
|
|
233
|
+
* Toggle pause/resume
|
|
234
|
+
*/
|
|
235
|
+
const handleTogglePause = useCallback(() => {
|
|
236
|
+
const recorder = mediaRecorderRef.current;
|
|
237
|
+
if (!recorder)
|
|
238
|
+
return;
|
|
239
|
+
if (recordingState === "recording") {
|
|
240
|
+
recorder.pause();
|
|
241
|
+
clearTimer();
|
|
242
|
+
setRecordingState("paused");
|
|
243
|
+
}
|
|
244
|
+
else if (recordingState === "paused") {
|
|
245
|
+
recorder.resume();
|
|
246
|
+
startTimer();
|
|
247
|
+
setRecordingState("recording");
|
|
248
|
+
}
|
|
249
|
+
}, [recordingState, clearTimer, startTimer]);
|
|
250
|
+
return (jsxs("div", { className: cn("flex items-center justify-between w-full", className), children: [jsx(Button, { variant: "ghost", color: "neutral", size: "sm", className: "rounded-full", onClick: handleCancel, "aria-label": "Cancel recording", children: "Cancel" }), jsxs("div", { className: "flex items-center gap-2.5", children: [jsx(motion.div, { className: "size-2.5 rounded-full bg-[var(--color-danger)]", animate: recordingState === "recording"
|
|
251
|
+
? { opacity: [1, 0.3, 1] }
|
|
252
|
+
: { opacity: 0.5 }, transition: recordingState === "recording"
|
|
253
|
+
? { duration: 1.2, repeat: Infinity, ease: "easeInOut" }
|
|
254
|
+
: undefined }), jsx("span", { className: "text-lg font-medium tabular-nums text-[var(--color-text-primary)] min-w-[3.5rem] text-center", children: formatTime(elapsed) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button, { iconOnly: true, variant: "outline", color: "neutral", size: "sm", className: "rounded-full", onClick: handleTogglePause, "aria-label": recordingState === "paused" ? "Resume recording" : "Pause recording", children: recordingState === "paused" ? (jsx(PlayIcon, { className: "size-4", strokeWidth: 2 })) : (jsx(PauseIcon, { className: "size-4", strokeWidth: 2 })) }), jsx(Button, { iconOnly: true, variant: "filled", color: "primary", size: "sm", className: "rounded-full", onClick: handleConfirm, "aria-label": "Confirm recording", children: jsx(CheckIcon, { className: "size-4", strokeWidth: 2.5 }) })] })] }));
|
|
255
|
+
};
|
|
256
|
+
VoiceRecorder.displayName = "VoiceRecorder";
|
|
257
|
+
|
|
258
|
+
export { VoiceRecorder };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recording state machine states
|
|
3
|
+
*/
|
|
4
|
+
export type RecordingState = "idle" | "recording" | "paused";
|
|
5
|
+
/**
|
|
6
|
+
* Props for the internal VoiceRecorder sub-component
|
|
7
|
+
*/
|
|
8
|
+
export interface VoiceRecorderProps {
|
|
9
|
+
/** Called when user confirms the recording */
|
|
10
|
+
onComplete: (audioBlob: Blob) => void;
|
|
11
|
+
/** Called when user cancels the recording */
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
/** Maximum recording duration in seconds (auto-stops at limit) */
|
|
14
|
+
maxDuration: number;
|
|
15
|
+
/** Theme class for the recorder container */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { PromptInput } from "./PromptInput";
|
|
2
2
|
export type { PromptInputProps, PromptInputState, PromptInputTheme, PromptInputThemeOverrides, ModelOption, AttachmentItem, AttachmentError, } from "./PromptInput.types";
|
|
3
|
+
export type { RecordingState } from "./VoiceRecorder.types";
|
|
3
4
|
export { promptInputTheme } from "./PromptInput.theme";
|
|
@@ -2,7 +2,7 @@ const promptSuggestionTheme = {
|
|
|
2
2
|
baseStyle: "inline-flex items-center gap-2 py-2 px-3.5 rounded-full " +
|
|
3
3
|
"bg-white dark:bg-[var(--color-background)] " +
|
|
4
4
|
"border border-[var(--color-border)] " +
|
|
5
|
-
"text-
|
|
5
|
+
"text-base font-medium text-[var(--color-text-primary)] " +
|
|
6
6
|
"cursor-pointer transition-all duration-300 " +
|
|
7
7
|
"hover:bg-[var(--color-background-secondary)] dark:hover:bg-[var(--color-background-secondary)] " +
|
|
8
8
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MarkdownRenderer Component
|
|
3
3
|
* Renders markdown content with syntax highlighting for code blocks
|
|
4
|
-
* Supports
|
|
4
|
+
* Supports word-by-word fade-in animation during streaming
|
|
5
|
+
* and an inline cursor that appears at the end of the last text element
|
|
5
6
|
*/
|
|
6
7
|
import React from 'react';
|
|
7
8
|
import type { MarkdownOptions } from './StreamingResponse.types';
|
|
@@ -16,10 +17,12 @@ export interface MarkdownRendererProps {
|
|
|
16
17
|
animated?: boolean;
|
|
17
18
|
/** Show a blinking cursor at end of content while streaming */
|
|
18
19
|
showCursor?: boolean;
|
|
20
|
+
/** Number of recent words to animate (default: 6) */
|
|
21
|
+
animateLastN?: number;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* MarkdownRenderer component for rendering markdown with syntax highlighting
|
|
22
25
|
* Supports GitHub Flavored Markdown (tables, task lists, strikethrough, etc.)
|
|
23
|
-
*
|
|
26
|
+
* Animates individual words during streaming with a fade-in + blur effect
|
|
24
27
|
*/
|
|
25
28
|
export declare const MarkdownRenderer: React.FC<MarkdownRendererProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
+
import React__default, { useMemo, useRef } from 'react';
|
|
3
3
|
import ReactMarkdown from 'react-markdown';
|
|
4
4
|
import { Prism } from 'react-syntax-highlighter';
|
|
5
5
|
import { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
7
7
|
import { useReducedMotion, motion } from 'motion/react';
|
|
8
8
|
import { blockTransition, blockSlideIn } from './StreamingResponse.animations.js';
|
|
9
|
-
import {
|
|
9
|
+
import { WordAnimationProvider, useWordAnimation } from './WordAnimationContext.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper that optionally animates block-level elements during streaming.
|
|
13
13
|
* Once an element has animated in, it stays static (no re-animation on re-render).
|
|
14
|
+
* Used for structural elements like code blocks and tables.
|
|
14
15
|
*/
|
|
15
16
|
const AnimatedBlock = ({ children, animate, className, as = 'div' }) => {
|
|
16
17
|
const hasAnimatedRef = useRef(false);
|
|
@@ -26,15 +27,38 @@ const AnimatedBlock = ({ children, animate, className, as = 'div' }) => {
|
|
|
26
27
|
const MotionTag = as === 'p' ? motion.p : motion.div;
|
|
27
28
|
return (jsx(MotionTag, { variants: blockSlideIn, initial: "hidden", animate: "visible", transition: blockTransition, className: className, children: children }));
|
|
28
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Prose wrapper — uses word-level animation from context for text elements.
|
|
32
|
+
* Falls back to plain rendering when animation is disabled.
|
|
33
|
+
*/
|
|
34
|
+
const AnimatedProse = ({ children, className, as: tag = 'p', }) => {
|
|
35
|
+
const wordAnim = useWordAnimation();
|
|
36
|
+
const content = wordAnim ? wordAnim.processChildren(children) : children;
|
|
37
|
+
return React__default.createElement(tag, { className }, content);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Skip counter — counts words in non-prose children to keep counter in sync.
|
|
41
|
+
*/
|
|
42
|
+
const SkipWords = ({ children }) => {
|
|
43
|
+
const wordAnim = useWordAnimation();
|
|
44
|
+
if (wordAnim) {
|
|
45
|
+
wordAnim.skipChildren(children);
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
29
49
|
/**
|
|
30
50
|
* MarkdownRenderer component for rendering markdown with syntax highlighting
|
|
31
51
|
* Supports GitHub Flavored Markdown (tables, task lists, strikethrough, etc.)
|
|
32
|
-
*
|
|
52
|
+
* Animates individual words during streaming with a fade-in + blur effect
|
|
33
53
|
*/
|
|
34
|
-
const MarkdownRenderer = ({ content, options = {}, isStreaming = false, animated = true, showCursor = true, }) => {
|
|
54
|
+
const MarkdownRenderer = ({ content, options = {}, isStreaming = false, animated = true, showCursor = true, animateLastN = 6, }) => {
|
|
35
55
|
const { allowHtml = false, syntaxTheme = 'light', renderCodeBlock } = options;
|
|
36
56
|
const shouldReduceMotion = useReducedMotion();
|
|
37
57
|
const shouldAnimate = animated && isStreaming && !shouldReduceMotion;
|
|
58
|
+
// Append cursor character to content so it renders inline within the last element
|
|
59
|
+
const displayContent = isStreaming && showCursor
|
|
60
|
+
? content + ' ▍'
|
|
61
|
+
: content;
|
|
38
62
|
const markdownComponents = useMemo(() => ({
|
|
39
63
|
// Code blocks with syntax highlighting
|
|
40
64
|
code({ inline, className, children, ...props }) {
|
|
@@ -42,59 +66,59 @@ const MarkdownRenderer = ({ content, options = {}, isStreaming = false, animated
|
|
|
42
66
|
const language = match ? match[1] : '';
|
|
43
67
|
// Use custom code block renderer if provided
|
|
44
68
|
if (!inline && renderCodeBlock && language) {
|
|
45
|
-
return (
|
|
69
|
+
return (jsxs(AnimatedBlock, { animate: shouldAnimate, children: [jsx(SkipWords, { children: children }), renderCodeBlock(String(children).replace(/\n$/, ''), language)] }));
|
|
46
70
|
}
|
|
47
71
|
// Render syntax-highlighted code block
|
|
48
72
|
if (!inline && language) {
|
|
49
|
-
return (
|
|
73
|
+
return (jsxs(AnimatedBlock, { animate: shouldAnimate, children: [jsx(SkipWords, { children: children }), jsx(Prism, { style: syntaxTheme === 'dark' ? oneDark : oneLight, language: language, PreTag: "div", className: "rounded-lg my-3", ...props, children: String(children).replace(/\n$/, '') })] }));
|
|
50
74
|
}
|
|
51
|
-
// Inline code
|
|
52
|
-
return (jsx("code", { className: "bg-[var(--color-background-tertiary)] text-[var(--color-primary)] px-1.5 py-0.5 rounded text-
|
|
75
|
+
// Inline code — skip word animation for code tokens
|
|
76
|
+
return (jsxs(Fragment, { children: [jsx(SkipWords, { children: children }), jsx("code", { className: "bg-[var(--color-background-tertiary)] text-[var(--color-primary)] px-1.5 py-0.5 rounded text-base font-mono", ...props, children: children })] }));
|
|
53
77
|
},
|
|
54
|
-
// Paragraphs
|
|
78
|
+
// Paragraphs — word-level animation
|
|
55
79
|
p({ children }) {
|
|
56
|
-
return (jsx(
|
|
80
|
+
return (jsx(AnimatedProse, { as: "p", className: "mb-3 last:mb-0 text-[var(--color-text-primary)] leading-relaxed", children: children }));
|
|
57
81
|
},
|
|
58
|
-
// Headings
|
|
82
|
+
// Headings — word-level animation
|
|
59
83
|
h1({ children }) {
|
|
60
|
-
return (jsx(
|
|
84
|
+
return (jsx(AnimatedProse, { as: "h1", className: "text-2xl font-bold mb-4 text-[var(--color-text-primary)] border-b border-[var(--color-border)] pb-2", children: children }));
|
|
61
85
|
},
|
|
62
86
|
h2({ children }) {
|
|
63
|
-
return (jsx(
|
|
87
|
+
return (jsx(AnimatedProse, { as: "h2", className: "text-2xl font-bold mb-3 text-[var(--color-text-primary)] border-b border-[var(--color-border)] pb-2", children: children }));
|
|
64
88
|
},
|
|
65
89
|
h3({ children }) {
|
|
66
|
-
return (jsx(
|
|
90
|
+
return (jsx(AnimatedProse, { as: "h3", className: "text-xl font-semibold mb-2 text-[var(--color-text-primary)]", children: children }));
|
|
67
91
|
},
|
|
68
92
|
h4({ children }) {
|
|
69
|
-
return (jsx(
|
|
93
|
+
return (jsx(AnimatedProse, { as: "h4", className: "text-lg font-semibold mb-2 text-[var(--color-text-primary)]", children: children }));
|
|
70
94
|
},
|
|
71
95
|
h5({ children }) {
|
|
72
|
-
return (jsx(
|
|
96
|
+
return (jsx(AnimatedProse, { as: "h5", className: "text-base font-semibold mb-2 text-[var(--color-text-primary)]", children: children }));
|
|
73
97
|
},
|
|
74
98
|
h6({ children }) {
|
|
75
|
-
return (jsx(
|
|
99
|
+
return (jsx(AnimatedProse, { as: "h6", className: "text-base font-semibold mb-2 text-[var(--color-text-secondary)]", children: children }));
|
|
76
100
|
},
|
|
77
|
-
// Lists
|
|
101
|
+
// Lists — word-level animation on li
|
|
78
102
|
ul({ children }) {
|
|
79
|
-
return (jsx(
|
|
103
|
+
return (jsx("ul", { className: "list-disc list-inside mb-3 space-y-1 text-[var(--color-text-primary)]", children: children }));
|
|
80
104
|
},
|
|
81
105
|
ol({ children }) {
|
|
82
|
-
return (jsx(
|
|
106
|
+
return (jsx("ol", { className: "list-decimal list-inside mb-3 space-y-1 text-[var(--color-text-primary)]", children: children }));
|
|
83
107
|
},
|
|
84
108
|
li({ children }) {
|
|
85
|
-
return jsx("li",
|
|
109
|
+
return (jsx(AnimatedProse, { as: "li", className: "ml-4", children: children }));
|
|
86
110
|
},
|
|
87
|
-
// Blockquotes
|
|
111
|
+
// Blockquotes — word-level animation
|
|
88
112
|
blockquote({ children }) {
|
|
89
|
-
return (jsx(
|
|
113
|
+
return (jsx("blockquote", { className: "border-l-4 border-[var(--color-primary)] pl-4 py-2 my-3 bg-[var(--color-background-secondary)] italic text-[var(--color-text-secondary)]", children: children }));
|
|
90
114
|
},
|
|
91
115
|
// Links
|
|
92
116
|
a({ href, children }) {
|
|
93
117
|
return (jsx("a", { href: href, className: "text-[var(--color-primary)] hover:text-[var(--color-primary-700)] underline transition-colors", target: "_blank", rel: "noopener noreferrer", children: children }));
|
|
94
118
|
},
|
|
95
|
-
// Tables
|
|
119
|
+
// Tables — block-level slide-in, skip word animation
|
|
96
120
|
table({ children }) {
|
|
97
|
-
return (
|
|
121
|
+
return (jsxs(AnimatedBlock, { animate: shouldAnimate, children: [jsx(SkipWords, { children: children }), jsx("div", { className: "overflow-x-auto my-3", children: jsx("table", { className: "min-w-full border-collapse border border-[var(--color-border)]", children: children }) })] }));
|
|
98
122
|
},
|
|
99
123
|
thead({ children }) {
|
|
100
124
|
return jsx("thead", { className: "bg-[var(--color-background-secondary)]", children: children });
|
|
@@ -115,7 +139,7 @@ const MarkdownRenderer = ({ content, options = {}, isStreaming = false, animated
|
|
|
115
139
|
hr() {
|
|
116
140
|
return jsx("hr", { className: "my-4 border-t border-[var(--color-border)]" });
|
|
117
141
|
},
|
|
118
|
-
// Strong/Bold
|
|
142
|
+
// Strong/Bold — pass through (word animation handles inline elements)
|
|
119
143
|
strong({ children }) {
|
|
120
144
|
return jsx("strong", { className: "font-semibold text-[var(--color-text-primary)]", children: children });
|
|
121
145
|
},
|
|
@@ -128,7 +152,7 @@ const MarkdownRenderer = ({ content, options = {}, isStreaming = false, animated
|
|
|
128
152
|
return jsx("del", { className: "line-through text-[var(--color-text-secondary)]", children: children });
|
|
129
153
|
},
|
|
130
154
|
}), [shouldAnimate, syntaxTheme, renderCodeBlock]);
|
|
131
|
-
return (
|
|
155
|
+
return (jsx(WordAnimationProvider, { content: displayContent, enabled: shouldAnimate, animateLastN: animateLastN, hasCursor: isStreaming && showCursor, children: jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], skipHtml: !allowHtml, components: markdownComponents, children: displayContent }) }));
|
|
132
156
|
};
|
|
133
157
|
MarkdownRenderer.displayName = 'MarkdownRenderer';
|
|
134
158
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* StreamingCursor Component
|
|
3
|
-
*
|
|
3
|
+
* Simple blinking cursor shown at the end of streaming text
|
|
4
4
|
*/
|
|
5
|
-
import React from
|
|
5
|
+
import React from "react";
|
|
6
6
|
export interface StreamingCursorProps {
|
|
7
7
|
/** Whether the cursor is visible (typically while streaming) */
|
|
8
8
|
visible: boolean;
|
|
@@ -14,8 +14,7 @@ export interface StreamingCursorProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* StreamingCursor renders
|
|
18
|
-
*
|
|
19
|
-
* reduced motion preferences.
|
|
17
|
+
* StreamingCursor renders a blinking caret that indicates active streaming.
|
|
18
|
+
* Uses a simple CSS pulse animation — no framer motion, no layout shifts.
|
|
20
19
|
*/
|
|
21
20
|
export declare const StreamingCursor: React.FC<StreamingCursorProps>;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useReducedMotion, motion } from 'motion/react';
|
|
3
|
-
import { cursorPulse } from './StreamingResponse.animations.js';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
|
-
* StreamingCursor renders
|
|
7
|
-
*
|
|
8
|
-
* reduced motion preferences.
|
|
4
|
+
* StreamingCursor renders a blinking caret that indicates active streaming.
|
|
5
|
+
* Uses a simple CSS pulse animation — no framer motion, no layout shifts.
|
|
9
6
|
*/
|
|
10
|
-
const StreamingCursor = ({ visible, enabled = true, cursor =
|
|
11
|
-
const shouldReduceMotion = useReducedMotion();
|
|
7
|
+
const StreamingCursor = ({ visible, enabled = true, cursor = "▍", className, }) => {
|
|
12
8
|
if (!visible)
|
|
13
9
|
return null;
|
|
14
|
-
|
|
15
|
-
return (jsx("span", { className: className || 'text-[var(--color-primary)] font-light ml-0.5', "aria-hidden": "true", children: cursor }));
|
|
16
|
-
}
|
|
17
|
-
return (jsx(motion.span, { variants: cursorPulse, animate: "pulse", className: className || 'text-[var(--color-primary)] font-light ml-0.5 inline-block', "aria-hidden": "true", children: cursor }));
|
|
10
|
+
return (jsx("span", { className: className || `font-extralight ml-0.5 ${enabled ? "animate-pulse" : ""}`, "aria-hidden": "true", children: cursor }));
|
|
18
11
|
};
|
|
19
|
-
StreamingCursor.displayName =
|
|
12
|
+
StreamingCursor.displayName = "StreamingCursor";
|
|
20
13
|
|
|
21
14
|
export { StreamingCursor };
|
|
@@ -20,6 +20,13 @@ export declare const blockTransition: Transition;
|
|
|
20
20
|
* Pulses while streaming is active
|
|
21
21
|
*/
|
|
22
22
|
export declare const cursorPulse: Variants;
|
|
23
|
+
/**
|
|
24
|
+
* Inline token fade-in animation
|
|
25
|
+
* Used for word-by-word animation inside markdown prose elements
|
|
26
|
+
* No y-movement to prevent layout jitter in inline text
|
|
27
|
+
*/
|
|
28
|
+
export declare const inlineTokenFadeIn: Variants;
|
|
29
|
+
export declare const inlineTokenTransition: Transition;
|
|
23
30
|
/**
|
|
24
31
|
* Container animation for staggered children
|
|
25
32
|
*/
|