@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
|
@@ -4,12 +4,13 @@ import { approvalCardTheme } from './ApprovalCard.theme.js';
|
|
|
4
4
|
import { Card } from '../../core/Card/Card.js';
|
|
5
5
|
import { Badge } from '../../core/Badge/Badge.js';
|
|
6
6
|
import { Button } from '../../core/Button/Button.js';
|
|
7
|
+
import 'react';
|
|
7
8
|
import { cn } from '../../../utils/cn.js';
|
|
8
9
|
|
|
9
|
-
const ApprovalCard = ({ title,
|
|
10
|
+
const ApprovalCard = ({ title, subtitle, variant = "default", riskLevel = "medium", onApprove, onDeny, children, isApproving = false, className, }) => {
|
|
10
11
|
const riskColor = approvalCardTheme.badgeColors[riskLevel];
|
|
11
12
|
const riskIcon = riskLevel === "critical" || riskLevel === "high" ? (jsx(ExclamationTriangleIcon, { className: "" })) : (jsx(CheckCircleIcon, { className: "" }));
|
|
12
|
-
return (jsxs(Card, { className: cn(approvalCardTheme.baseStyle, approvalCardTheme.variants[variant], className), children: [jsx(Card.Header, { children: jsx("div", { className: "flex flex-col items-start", children: jsxs(Badge, { variant: "outline", color: riskColor, size: "sm", iconStart: riskIcon, className: "font-semibold shadow", children: [riskLevel.toUpperCase(), " RISK"] }) }) }), jsxs(Card.Content, { className: "space-y-3", children: [jsxs("div", { className: "space-y-1", children: [jsx(Card.Title, { className: "
|
|
13
|
+
return (jsxs(Card, { className: cn(approvalCardTheme.baseStyle, approvalCardTheme.variants[variant], className), children: [jsx(Card.Header, { children: jsx("div", { className: "flex flex-col items-start", children: jsxs(Badge, { variant: "outline", color: riskColor, size: "sm", iconStart: riskIcon, className: "font-semibold shadow", children: [riskLevel.toUpperCase(), " RISK"] }) }) }), jsxs(Card.Content, { className: "space-y-3", children: [jsxs("div", { className: "space-y-1", children: [jsx(Card.Title, { className: "", children: title }), subtitle && (jsx("p", { className: "text-sm md:text-base text-[var(--color-text-secondary)]/80", children: subtitle }))] }), children && (jsx("div", { className: "bg-[var(--color-background-secondary)] rounded-md p-3 text-sm font-mono border border-[var(--color-border)] overflow-x-auto", children: children }))] }), jsxs(Card.Footer, { className: "justify-end gap-2 mt-3", children: [jsx(Button, { variant: "outline", color: "neutral", size: "sm", onClick: onDeny, children: "Deny" }), jsx(Button, { color: riskColor, size: "sm", state: isApproving ? "loading" : "default", onClick: onApprove, children: "Approve" })] })] }));
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export { ApprovalCard };
|
|
@@ -7,9 +7,9 @@ export interface ApprovalCardProps {
|
|
|
7
7
|
*/
|
|
8
8
|
title: string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Subtitle or context for the user
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
subtitle?: string;
|
|
13
13
|
/**
|
|
14
14
|
* Risk level determining visual severity
|
|
15
15
|
* @default "medium"
|
|
@@ -3,8 +3,8 @@ const codeBlockTheme = {
|
|
|
3
3
|
header: "flex items-center justify-between px-3 py-1.5 bg-[var(--color-background-secondary)] 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
|
-
filename: "text-
|
|
7
|
-
languageLabel: "text-
|
|
6
|
+
filename: "text-base font-medium text-[var(--color-text-secondary)] truncate",
|
|
7
|
+
languageLabel: "text-sm uppercase tracking-wider font-semibold text-[var(--color-text-muted)]",
|
|
8
8
|
codeWrapper: "overflow-x-auto",
|
|
9
9
|
lineNumber: "text-[var(--color-text-muted)] select-none text-right tabular-nums min-w-[2.5rem] pr-4 opacity-50",
|
|
10
10
|
highlightedLine: " -mx-4 px-4 bg-[var(--color-primary-50)] border-l-2 border-l-[var(--color-primary)] dark:bg-neutral-400/5 dark:border-l-neutral-200",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Variants } from "motion/react";
|
|
2
|
+
/**
|
|
3
|
+
* Voice recorder enter/exit animation (replaces textarea area)
|
|
4
|
+
*/
|
|
5
|
+
export declare const voiceRecorderVariants: Variants;
|
|
6
|
+
/**
|
|
7
|
+
* Textarea enter/exit animation (when swapping with voice recorder)
|
|
8
|
+
*/
|
|
9
|
+
export declare const textareaSwapVariants: Variants;
|
|
10
|
+
/**
|
|
11
|
+
* Submit/Stop icon swap animation
|
|
12
|
+
*/
|
|
13
|
+
export declare const iconSwapVariants: Variants;
|
|
14
|
+
/**
|
|
15
|
+
* Enhanced dropzone container animation
|
|
16
|
+
*/
|
|
17
|
+
export declare const dropzoneContainerVariants: Variants;
|
|
18
|
+
/**
|
|
19
|
+
* Dropzone child elements stagger animation
|
|
20
|
+
*/
|
|
21
|
+
export declare const dropzoneChildVariants: Variants;
|
|
22
|
+
/**
|
|
23
|
+
* Dropzone action icons stagger animation
|
|
24
|
+
*/
|
|
25
|
+
export declare const dropzoneActionIconVariants: Variants;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice recorder enter/exit animation (replaces textarea area)
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Textarea enter/exit animation (when swapping with voice recorder)
|
|
6
|
+
*/
|
|
7
|
+
const textareaSwapVariants = {
|
|
8
|
+
initial: { opacity: 0, y: -8 },
|
|
9
|
+
animate: { opacity: 1, y: 0, transition: { duration: 0.2, ease: "easeOut" } },
|
|
10
|
+
exit: { opacity: 0, y: 8, transition: { duration: 0.15, ease: "easeIn" } },
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Submit/Stop icon swap animation
|
|
14
|
+
*/
|
|
15
|
+
const iconSwapVariants = {
|
|
16
|
+
initial: { opacity: 0, scale: 0.5, rotate: -90 },
|
|
17
|
+
animate: {
|
|
18
|
+
opacity: 1,
|
|
19
|
+
scale: 1,
|
|
20
|
+
rotate: 0,
|
|
21
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
22
|
+
},
|
|
23
|
+
exit: {
|
|
24
|
+
opacity: 0,
|
|
25
|
+
scale: 0.5,
|
|
26
|
+
rotate: 90,
|
|
27
|
+
transition: { duration: 0.15, ease: "easeIn" },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Enhanced dropzone container animation
|
|
32
|
+
*/
|
|
33
|
+
const dropzoneContainerVariants = {
|
|
34
|
+
initial: { opacity: 0 },
|
|
35
|
+
animate: {
|
|
36
|
+
opacity: 1,
|
|
37
|
+
transition: {
|
|
38
|
+
duration: 0.2,
|
|
39
|
+
staggerChildren: 0.05,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
exit: { opacity: 0, transition: { duration: 0.15 } },
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Dropzone child elements stagger animation
|
|
46
|
+
*/
|
|
47
|
+
const dropzoneChildVariants = {
|
|
48
|
+
initial: { opacity: 0, y: 8 },
|
|
49
|
+
animate: { opacity: 1, y: 0, transition: { duration: 0.2, ease: "easeOut" } },
|
|
50
|
+
exit: { opacity: 0, transition: { duration: 0.1 } },
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Dropzone action icons stagger animation
|
|
54
|
+
*/
|
|
55
|
+
const dropzoneActionIconVariants = {
|
|
56
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
57
|
+
animate: { opacity: 1, scale: 1, transition: { duration: 0.15 } },
|
|
58
|
+
exit: { opacity: 0, scale: 0.8, transition: { duration: 0.1 } },
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { dropzoneActionIconVariants, dropzoneChildVariants, dropzoneContainerVariants, iconSwapVariants, textareaSwapVariants };
|
|
@@ -1,10 +1,43 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useState, useRef, useId, useEffect, useCallback } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
4
|
+
import '../../forms/Input/Input.js';
|
|
5
|
+
import '../../forms/Input/Input.theme.js';
|
|
6
|
+
import '../../forms/Select/Select.js';
|
|
7
|
+
import '../../forms/Select/Select.theme.js';
|
|
6
8
|
import { Textarea } from '../../forms/Textarea/Textarea.js';
|
|
7
9
|
import '../../forms/Textarea/Textarea.theme.js';
|
|
10
|
+
import '../../forms/FormLabel/FormLabel.js';
|
|
11
|
+
import '../../forms/Radio/Radio.js';
|
|
12
|
+
import '../../forms/Checkbox/Checkbox.js';
|
|
13
|
+
import '../../forms/Switch/Switch.js';
|
|
14
|
+
import '../../forms/DatePicker/DatePicker.js';
|
|
15
|
+
import '../../forms/DatePicker/DatePicker.theme.js';
|
|
16
|
+
import '../../forms/FileUpload/FileUpload.js';
|
|
17
|
+
import '../../forms/TimePicker/TimePicker.js';
|
|
18
|
+
import { CloudArrowUpIcon, MicrophoneIcon, PaperClipIcon, LinkIcon, DocumentIcon, XMarkIcon, PlusIcon, AdjustmentsHorizontalIcon, ChevronDownIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
19
|
+
import { cn } from '../../../utils/cn.js';
|
|
20
|
+
import 'react-dom';
|
|
21
|
+
import '../../core/Accordion/Accordion.js';
|
|
22
|
+
import '../../core/AlertDialog/AlertDialog.js';
|
|
23
|
+
import '../../core/AspectRatio/AspectRatio.js';
|
|
24
|
+
import '../../core/Avatar/Avatar.js';
|
|
25
|
+
import '../../core/AvatarGroup/AvatarGroup.js';
|
|
26
|
+
import '../../core/Badge/Badge.js';
|
|
27
|
+
import '../../core/Breadcrumbs/Breadcrumbs.js';
|
|
28
|
+
import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
|
|
29
|
+
import { Button } from '../../core/Button/Button.js';
|
|
30
|
+
import '../../core/ButtonGroup/ButtonGroup.js';
|
|
31
|
+
import '../../core/ButtonGroup/ButtonGroupSeparator.js';
|
|
32
|
+
import '../../core/ButtonGroup/ButtonGroupText.js';
|
|
33
|
+
import '../../core/Calendar/Calendar.js';
|
|
34
|
+
import '../../core/Calendar/CalendarMini/CalendarMini.js';
|
|
35
|
+
import '../../core/Card/Card.js';
|
|
36
|
+
import '../../core/CardStack/CardStack.js';
|
|
37
|
+
import '../../core/Carousel/Carousel.js';
|
|
38
|
+
import '../../core/CommandPalette/CommandPalette.js';
|
|
39
|
+
import '../../core/Separator/Separator.js';
|
|
40
|
+
import '../../core/Drawer/Drawer.js';
|
|
8
41
|
import { Dropdown } from '../../core/Dropdown/Dropdown.js';
|
|
9
42
|
import '../../core/Dropdown/DropdownTrigger.js';
|
|
10
43
|
import '../../core/Dropdown/DropdownMenu.js';
|
|
@@ -12,7 +45,96 @@ import '../../core/Dropdown/DropdownItem.js';
|
|
|
12
45
|
import '../../core/Dropdown/DropdownSection.js';
|
|
13
46
|
import '../../core/Dropdown/DropdownSeparator.js';
|
|
14
47
|
import '../../core/Dropdown/Dropdown.theme.js';
|
|
15
|
-
import
|
|
48
|
+
import '../../core/Kbd/Kbd.js';
|
|
49
|
+
import '../../core/MenuItem/MenuItem.js';
|
|
50
|
+
import '../../core/Link/Link.js';
|
|
51
|
+
import '../../core/Loader/Loader.js';
|
|
52
|
+
import '../../core/Modal/Modal.js';
|
|
53
|
+
import '../../core/ModalStack/ModalStack.js';
|
|
54
|
+
import '../../core/PageHeading/PageHeading.js';
|
|
55
|
+
import '../../core/Pagination/Pagination.js';
|
|
56
|
+
import '../../core/Popover/Popover.js';
|
|
57
|
+
import '../../core/Popover/PopoverContext.js';
|
|
58
|
+
import '../../core/Progress/Progress.js';
|
|
59
|
+
import '../../core/Rating/Rating.js';
|
|
60
|
+
import '../../core/ScrollArea/ScrollArea.js';
|
|
61
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
62
|
+
import '../../core/Segmented/Segmented.js';
|
|
63
|
+
import '../../core/Skeleton/Skeleton.js';
|
|
64
|
+
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
65
|
+
import '../../core/Tabs/Tabs.js';
|
|
66
|
+
import '../../core/Tabs/TabsList.js';
|
|
67
|
+
import '../../core/Tabs/TabsTrigger.js';
|
|
68
|
+
import '../../core/Tabs/TabsContent.js';
|
|
69
|
+
import '../../core/Tabs/TabsContext.js';
|
|
70
|
+
import '../../core/Tooltip/Tooltip.js';
|
|
71
|
+
import '../../core/Tooltip/Tooltip.animations.js';
|
|
72
|
+
import '../../core/Tree/Tree.js';
|
|
73
|
+
import '../../core/Tag/Tag.js';
|
|
74
|
+
import '../../core/Alert/Alert.js';
|
|
75
|
+
import '../../core/Toast/Toast.js';
|
|
76
|
+
import '../../core/Toast/ToastProvider.js';
|
|
77
|
+
import { StopIcon } from '@heroicons/react/24/solid';
|
|
78
|
+
import '../../core/Spinner/Spinner.js';
|
|
79
|
+
import '../../core/Message/Message.js';
|
|
80
|
+
import '../../core/Message/TypeWriter.js';
|
|
81
|
+
import '../../core/Empty/Empty.js';
|
|
82
|
+
import '../../core/Masonry/Masonry.js';
|
|
83
|
+
import '../../core/DragDrop/DragDrop.js';
|
|
84
|
+
import '../../core/Sortable/Sortable.js';
|
|
85
|
+
import '../../core/NavItem/NavItem.js';
|
|
86
|
+
import '../../core/Sidebar/Sidebar.js';
|
|
87
|
+
import '../../core/Sidebar/SidebarHeader.js';
|
|
88
|
+
import '../../core/Sidebar/SidebarContent.js';
|
|
89
|
+
import '../../core/Sidebar/SidebarFooter.js';
|
|
90
|
+
import '../../core/Sidebar/SidebarNav.js';
|
|
91
|
+
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
92
|
+
import '../../core/Sidebar/SidebarToggle.js';
|
|
93
|
+
import '../../core/Sidebar/SidebarContext.js';
|
|
94
|
+
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
95
|
+
import '../../core/ContextMenu/ContextMenu.js';
|
|
96
|
+
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
97
|
+
import '../../core/Pill/Pill.js';
|
|
98
|
+
import '../../core/SocialIcon/SocialIcon.js';
|
|
99
|
+
import '../../forms/TimePicker/WheelColumn.js';
|
|
100
|
+
import '../../forms/TimePicker/TimePicker.theme.js';
|
|
101
|
+
import '../../forms/Slider/Slider.js';
|
|
102
|
+
import '../../forms/Slider/Slider.theme.js';
|
|
103
|
+
import '../../forms/Signature/Signature.js';
|
|
104
|
+
import '../../forms/Signature/Signature.theme.js';
|
|
105
|
+
import '../../forms/RichTextEditor/RichTextEditor.js';
|
|
106
|
+
import '../../forms/RichTextEditor/RichTextEditor.theme.js';
|
|
107
|
+
import '../../forms/InputOTP/InputOTP.js';
|
|
108
|
+
import '../../forms/InputOTP/InputOTP.theme.js';
|
|
109
|
+
import '../../forms/InputCreditCard/InputCreditCard.js';
|
|
110
|
+
import '../../forms/InputCreditCard/InputCreditCard.theme.js';
|
|
111
|
+
import '../../forms/InputAddress/InputAddress.js';
|
|
112
|
+
import '../../forms/InputAddress/InputAddress.theme.js';
|
|
113
|
+
import '../../forms/InputDate/InputDate.js';
|
|
114
|
+
import '../../forms/InputCounter/InputCounter.js';
|
|
115
|
+
import '../../forms/InputTag/InputTag.js';
|
|
116
|
+
import '../../forms/InputTag/InputTag.theme.js';
|
|
117
|
+
import '../../forms/Combobox/Combobox.js';
|
|
118
|
+
import '../../forms/Combobox/Combobox.theme.js';
|
|
119
|
+
import '../../forms/ColorPicker/ColorPicker.js';
|
|
120
|
+
import '../../forms/ColorPicker/ColorPickerTrigger.js';
|
|
121
|
+
import '../../forms/ColorPicker/ColorPickerContent.js';
|
|
122
|
+
import '../../forms/ColorPicker/ColorPicker2DCanvas.js';
|
|
123
|
+
import '../../forms/ColorPicker/ColorPickerSwatch.js';
|
|
124
|
+
import '../../forms/ColorPicker/ColorPickerSliders.js';
|
|
125
|
+
import '../../forms/ColorPicker/ColorPickerInput.js';
|
|
126
|
+
import '../../forms/ColorPicker/ColorPickerFormatSelector.js';
|
|
127
|
+
import '../../forms/ColorPicker/ColorPickerEyeDropper.js';
|
|
128
|
+
import '../../forms/ColorPicker/ColorPickerPresets.js';
|
|
129
|
+
import '../../forms/SelectableCard/SelectableCard.js';
|
|
130
|
+
import '../../forms/TransferList/TransferList.js';
|
|
131
|
+
import '../../forms/Mention/Mention.js';
|
|
132
|
+
import '../../forms/Mention/Mention.theme.js';
|
|
133
|
+
import '../../forms/CronInput/CronInput.js';
|
|
134
|
+
import '../../forms/CronInput/CronInput.theme.js';
|
|
135
|
+
import { promptInputTheme } from './PromptInput.theme.js';
|
|
136
|
+
import { VoiceRecorder } from './VoiceRecorder.js';
|
|
137
|
+
import { dropzoneContainerVariants, dropzoneChildVariants, dropzoneActionIconVariants, textareaSwapVariants, iconSwapVariants } from './PromptInput.animations.js';
|
|
16
138
|
|
|
17
139
|
/**
|
|
18
140
|
* Default model options for the model selector
|
|
@@ -47,35 +169,48 @@ const PromptInput = React__default.forwardRef(({
|
|
|
47
169
|
// Value control
|
|
48
170
|
value, defaultValue = "", onChange,
|
|
49
171
|
// Textarea props
|
|
50
|
-
placeholder = "How may I assist you today?", maxLength, minHeight
|
|
172
|
+
placeholder = "How may I assist you today?", maxLength, minHeight: minHeightProp, maxHeight = "120px", rows,
|
|
51
173
|
// State
|
|
52
174
|
state = "default", disabled = false, helperText, showCharCount = false,
|
|
53
175
|
// Model selection
|
|
54
176
|
selectedModel: controlledModel, defaultSelectedModel, models = DEFAULT_MODELS, onModelChange,
|
|
55
177
|
// Event handlers
|
|
56
178
|
onSubmit, onAttachmentClick, onVoiceClick, onSettingsClick, onKeyDown,
|
|
179
|
+
// Stop generation
|
|
180
|
+
onStop,
|
|
181
|
+
// Voice recording
|
|
182
|
+
enableVoiceRecording = false, onRecordingComplete, onRecordingCancel, maxRecordingDuration = 120,
|
|
183
|
+
// Dropzone
|
|
184
|
+
enableDropzone = true, dropzoneText = "Drop files here to add to chat", dropzoneTitle, dropzoneSubtitle,
|
|
57
185
|
// Multimodal attachments
|
|
58
186
|
attachments: controlledAttachments, onAttachmentsChange, acceptedFileTypes = ["image/*", "application/pdf"], maxFileSize = 10 * 1024 * 1024, maxAttachments = 10, compressImages = true, maxImageDimension = 1024, imageQuality = 0.8, onAttachmentError,
|
|
59
187
|
// Button visibility
|
|
60
188
|
showAttachmentButton = true, showVoiceButton = true, showSettingsButton = true, showModelSelector = true,
|
|
61
189
|
// Submit button
|
|
62
190
|
submitButtonLabel = "Submit prompt", submitButtonIcon = (jsx(ArrowRightIcon, { className: "size-4", strokeWidth: 2.5 })), submitShortcut,
|
|
191
|
+
// Variant
|
|
192
|
+
variant = "default",
|
|
63
193
|
// Styling
|
|
64
194
|
className, textareaClassName, footerClassName, theme = {},
|
|
65
195
|
// Accessibility
|
|
66
196
|
"aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, id: propId, ...props }, ref) => {
|
|
67
|
-
// ========== State Management ==========
|
|
68
197
|
var _a, _b;
|
|
198
|
+
// Derive minHeight: simple variant defaults to a compact single-line height
|
|
199
|
+
const minHeight = minHeightProp !== null && minHeightProp !== void 0 ? minHeightProp : (variant === "simple" ? "32px" : "48px");
|
|
200
|
+
// ========== State Management ==========
|
|
69
201
|
// Internal state for uncontrolled mode
|
|
70
202
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
71
203
|
const [internalAttachments, setInternalAttachments] = useState([]);
|
|
72
204
|
const [internalModel, setInternalModel] = useState([
|
|
73
205
|
defaultSelectedModel || ((_a = models[0]) === null || _a === void 0 ? void 0 : _a.key) || "",
|
|
74
206
|
]);
|
|
207
|
+
const [isRecording, setIsRecording] = useState(false);
|
|
75
208
|
// Ref for textarea element
|
|
76
209
|
const internalTextareaRef = useRef(null);
|
|
77
210
|
const textareaRef = ref || internalTextareaRef;
|
|
78
211
|
const fileInputRef = useRef(null);
|
|
212
|
+
const dragCounterRef = useRef(0);
|
|
213
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
79
214
|
const uniqueId = useId();
|
|
80
215
|
// Determine if component is controlled
|
|
81
216
|
const isControlled = value !== undefined;
|
|
@@ -94,6 +229,7 @@ className, textareaClassName, footerClassName, theme = {},
|
|
|
94
229
|
const isDisabled = state === "disabled" || disabled;
|
|
95
230
|
const isInvalid = state === "invalid";
|
|
96
231
|
const isLoading = state === "loading";
|
|
232
|
+
const showStopButton = isLoading && onStop !== undefined;
|
|
97
233
|
const canSubmit = (currentValue.trim().length > 0 || currentAttachments.length > 0) &&
|
|
98
234
|
!isDisabled;
|
|
99
235
|
// Model key to display name mapping
|
|
@@ -145,6 +281,32 @@ className, textareaClassName, footerClassName, theme = {},
|
|
|
145
281
|
// Call user's handler
|
|
146
282
|
onModelChange === null || onModelChange === void 0 ? void 0 : onModelChange(newModel);
|
|
147
283
|
}, [isModelControlled, onModelChange]);
|
|
284
|
+
// ========== Voice Recording Handlers ==========
|
|
285
|
+
/**
|
|
286
|
+
* Handle voice button click — either start inline recording or call onVoiceClick
|
|
287
|
+
*/
|
|
288
|
+
const handleVoiceClick = useCallback(() => {
|
|
289
|
+
if (enableVoiceRecording) {
|
|
290
|
+
setIsRecording(true);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
onVoiceClick === null || onVoiceClick === void 0 ? void 0 : onVoiceClick();
|
|
294
|
+
}
|
|
295
|
+
}, [enableVoiceRecording, onVoiceClick]);
|
|
296
|
+
/**
|
|
297
|
+
* Handle recording complete
|
|
298
|
+
*/
|
|
299
|
+
const handleRecordingComplete = useCallback((audioBlob) => {
|
|
300
|
+
setIsRecording(false);
|
|
301
|
+
onRecordingComplete === null || onRecordingComplete === void 0 ? void 0 : onRecordingComplete(audioBlob);
|
|
302
|
+
}, [onRecordingComplete]);
|
|
303
|
+
/**
|
|
304
|
+
* Handle recording cancel
|
|
305
|
+
*/
|
|
306
|
+
const handleRecordingCancel = useCallback(() => {
|
|
307
|
+
setIsRecording(false);
|
|
308
|
+
onRecordingCancel === null || onRecordingCancel === void 0 ? void 0 : onRecordingCancel();
|
|
309
|
+
}, [onRecordingCancel]);
|
|
148
310
|
// ========== Multimodal Handlers ==========
|
|
149
311
|
/**
|
|
150
312
|
* Validate file type
|
|
@@ -315,6 +477,36 @@ className, textareaClassName, footerClassName, theme = {},
|
|
|
315
477
|
processFiles(files);
|
|
316
478
|
}
|
|
317
479
|
}, [processFiles]);
|
|
480
|
+
// ========== Drag & Drop Handlers ==========
|
|
481
|
+
const handleDragEnter = useCallback((e) => {
|
|
482
|
+
e.preventDefault();
|
|
483
|
+
e.stopPropagation();
|
|
484
|
+
dragCounterRef.current++;
|
|
485
|
+
if (dragCounterRef.current === 1 && !isDisabled && enableDropzone) {
|
|
486
|
+
setIsDragOver(true);
|
|
487
|
+
}
|
|
488
|
+
}, [isDisabled, enableDropzone]);
|
|
489
|
+
const handleDragOver = useCallback((e) => {
|
|
490
|
+
e.preventDefault();
|
|
491
|
+
e.stopPropagation();
|
|
492
|
+
}, []);
|
|
493
|
+
const handleDragLeave = useCallback((e) => {
|
|
494
|
+
e.preventDefault();
|
|
495
|
+
e.stopPropagation();
|
|
496
|
+
dragCounterRef.current--;
|
|
497
|
+
if (dragCounterRef.current === 0) {
|
|
498
|
+
setIsDragOver(false);
|
|
499
|
+
}
|
|
500
|
+
}, []);
|
|
501
|
+
const handleDrop = useCallback((e) => {
|
|
502
|
+
e.preventDefault();
|
|
503
|
+
e.stopPropagation();
|
|
504
|
+
dragCounterRef.current = 0;
|
|
505
|
+
setIsDragOver(false);
|
|
506
|
+
if (!isDisabled && e.dataTransfer.files.length > 0) {
|
|
507
|
+
processFiles(e.dataTransfer.files);
|
|
508
|
+
}
|
|
509
|
+
}, [isDisabled, processFiles]);
|
|
318
510
|
/**
|
|
319
511
|
* Remove attachment
|
|
320
512
|
*/
|
|
@@ -402,42 +594,83 @@ className, textareaClassName, footerClassName, theme = {},
|
|
|
402
594
|
footerStyle: theme.footerStyle || promptInputTheme.footerStyle,
|
|
403
595
|
actionsStyle: theme.actionsStyle || promptInputTheme.actionsStyle,
|
|
404
596
|
submitButtonStyle: theme.submitButtonStyle || promptInputTheme.submitButtonStyle,
|
|
597
|
+
dropzoneStyle: theme.dropzoneStyle || promptInputTheme.dropzoneStyle,
|
|
598
|
+
dropzoneTitleStyle: theme.dropzoneTitleStyle || promptInputTheme.dropzoneTitleStyle,
|
|
599
|
+
dropzoneSubtitleStyle: theme.dropzoneSubtitleStyle || promptInputTheme.dropzoneSubtitleStyle,
|
|
600
|
+
dropzoneActionsStyle: theme.dropzoneActionsStyle || promptInputTheme.dropzoneActionsStyle,
|
|
601
|
+
voiceRecorderStyle: theme.voiceRecorderStyle || promptInputTheme.voiceRecorderStyle,
|
|
405
602
|
stateStyle: ((_b = theme.states) === null || _b === void 0 ? void 0 : _b[state]) || promptInputTheme.states[state],
|
|
406
603
|
};
|
|
407
604
|
// ========== Character Count ==========
|
|
408
605
|
const displayHelperText = showCharCount
|
|
409
606
|
? `${currentValue.length}${maxLength ? `/${maxLength}` : ""} characters${helperText ? ` • ${helperText}` : ""}`
|
|
410
607
|
: helperText;
|
|
608
|
+
// ========== Dropzone Helpers ==========
|
|
609
|
+
const resolvedDropzoneTitle = dropzoneTitle || dropzoneText;
|
|
610
|
+
/**
|
|
611
|
+
* Handle "browse" click within the dropzone overlay
|
|
612
|
+
*/
|
|
613
|
+
const handleDropzoneBrowse = useCallback(() => {
|
|
614
|
+
setIsDragOver(false);
|
|
615
|
+
dragCounterRef.current = 0;
|
|
616
|
+
if (fileInputRef.current) {
|
|
617
|
+
fileInputRef.current.accept = acceptedFileTypes.join(",");
|
|
618
|
+
fileInputRef.current.click();
|
|
619
|
+
}
|
|
620
|
+
}, [acceptedFileTypes]);
|
|
621
|
+
// ========== Submit/Stop Button Renderer ==========
|
|
622
|
+
/**
|
|
623
|
+
* Renders the submit or stop button with animated icon swap.
|
|
624
|
+
* Used by both default and simple variants.
|
|
625
|
+
*/
|
|
626
|
+
const renderSubmitButton = (buttonSize, buttonVariant, buttonColor, extraClassName) => {
|
|
627
|
+
if (showStopButton) {
|
|
628
|
+
return (jsx(Button, { iconOnly: true, className: cn(mergedTheme.submitButtonStyle, extraClassName), size: buttonSize, variant: buttonVariant, color: "danger", onClick: onStop, "aria-label": "Stop generation", title: "Stop generation", showReflection: false, children: jsx(AnimatePresence, { mode: "wait", initial: false, children: jsx(motion.span, { variants: iconSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: "flex items-center justify-center", children: jsx(StopIcon, { className: "size-4" }) }, "stop") }) }));
|
|
629
|
+
}
|
|
630
|
+
return (jsx(Button, { iconOnly: true, className: cn(mergedTheme.submitButtonStyle, extraClassName), size: buttonSize, variant: buttonVariant, color: buttonColor, onClick: handleSubmit, disabled: !canSubmit, state: isLoading ? "loading" : "default", "aria-label": submitButtonLabel, title: submitShortcut ? `Submit (${submitShortcut})` : undefined, showReflection: buttonVariant === "filled" ? false : undefined, children: jsx(AnimatePresence, { mode: "wait", initial: false, children: jsx(motion.span, { variants: iconSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: "flex items-center justify-center", children: submitButtonIcon }, "submit") }) }));
|
|
631
|
+
};
|
|
411
632
|
// ========== Render ==========
|
|
412
633
|
return (jsxs("div", { className: cn("min-w-xl mx-auto", className), ...props, children: [jsx("input", { ref: fileInputRef, type: "file", accept: acceptedFileTypes.join(","), multiple: true, onChange: (e) => {
|
|
413
634
|
if (e.target.files)
|
|
414
635
|
processFiles(e.target.files);
|
|
415
636
|
e.target.value = "";
|
|
416
|
-
}, className: "sr-only", "aria-label": "Attach files" }), jsxs("div", { className: cn(mergedTheme.baseStyle, mergedTheme.stateStyle
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
637
|
+
}, className: "sr-only", "aria-label": "Attach files" }), jsxs("div", { className: cn("relative", mergedTheme.baseStyle, mergedTheme.stateStyle, variant === "simple" ? "p-3 rounded-full pl-5" : ""), onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [jsx(AnimatePresence, { children: isDragOver && enableDropzone && (jsxs(motion.div, { variants: dropzoneContainerVariants, initial: "initial", animate: "animate", exit: "exit", className: mergedTheme.dropzoneStyle, children: [jsx(motion.div, { variants: dropzoneChildVariants, children: jsx(CloudArrowUpIcon, { className: "size-8 text-[var(--color-primary)] mx-auto" }) }), jsx(motion.p, { variants: dropzoneChildVariants, className: mergedTheme.dropzoneTitleStyle, children: dropzoneTitle ? (
|
|
638
|
+
// Parse **browse** as clickable button
|
|
639
|
+
jsx(Fragment, { children: resolvedDropzoneTitle.split(/\*\*(.*?)\*\*/).map((part, i) => i % 2 === 1 ? (jsx("button", { type: "button", onClick: handleDropzoneBrowse, className: "font-bold underline underline-offset-2 cursor-pointer hover:opacity-80", children: part }, i)) : (jsx("span", { children: part }, i))) })) : (resolvedDropzoneTitle) }), dropzoneSubtitle && (jsx(motion.p, { variants: dropzoneChildVariants, className: mergedTheme.dropzoneSubtitleStyle, children: dropzoneSubtitle })), dropzoneTitle && (jsx(motion.div, { variants: dropzoneChildVariants, className: mergedTheme.dropzoneActionsStyle, children: [
|
|
640
|
+
CloudArrowUpIcon,
|
|
641
|
+
MicrophoneIcon,
|
|
642
|
+
PaperClipIcon,
|
|
643
|
+
LinkIcon,
|
|
644
|
+
].map((Icon, i) => (jsx(motion.div, { variants: dropzoneActionIconVariants, className: "size-8 rounded-full bg-white/30 dark:bg-white/10 flex items-center justify-center", children: jsx(Icon, { className: "size-4 text-[var(--color-primary)]" }) }, i))) }))] })) }), currentAttachments.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 py-2 px-1", children: currentAttachments.map((attachment) => {
|
|
420
645
|
var _a;
|
|
421
|
-
return (jsxs("div", { className: "relative group rounded-lg border border-[var(--color-border)] bg-white", children: [attachment.type === "image" ? (attachment.isCompressing ? (jsx("div", { className: "size-12 flex items-center justify-center bg-gray-100 rounded-lg", children: jsx("div", { className: "w-4 h-4 border-2 border-gray-300 border-t-[var(--color-primary)] rounded-full animate-spin" }) })) : (jsx("img", { src: attachment.previewUrl, alt: attachment.file.name, className: "size-12 object-cover rounded-lg" }))) : (jsxs("div", { className: "size-12 flex flex-col items-center justify-center text-center p-1 rounded-lg", children: [jsx(DocumentIcon, { className: "w-5 h-5 text-[var(--color-text-muted)]" }), jsx("span", { className: "text-[10px] text-[var(--color-text-secondary)] truncate w-full", children: (_a = attachment.file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase() })] })), jsx("button", { onClick: () => removeAttachment(attachment.id), className: "absolute -top-1.5 -right-1.5 size-5 rounded-full bg-[var(--color-danger)] text-
|
|
422
|
-
}) })), jsxs("div", { className: cn(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
646
|
+
return (jsxs("div", { className: "relative group rounded-lg border border-[var(--color-border)] bg-white", children: [attachment.type === "image" ? (attachment.isCompressing ? (jsx("div", { className: "size-12 flex items-center justify-center bg-gray-100 rounded-lg", children: jsx("div", { className: "w-4 h-4 border-2 border-gray-300 border-t-[var(--color-primary)] rounded-full animate-spin" }) })) : (jsx("img", { src: attachment.previewUrl, alt: attachment.file.name, className: "size-12 object-cover rounded-lg" }))) : (jsxs("div", { className: "size-12 flex flex-col items-center justify-center text-center p-1 rounded-lg", children: [jsx(DocumentIcon, { className: "w-5 h-5 text-[var(--color-text-muted)]" }), jsx("span", { className: "text-[10px] text-[var(--color-text-secondary)] truncate w-full", children: (_a = attachment.file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase() })] })), jsx("button", { onClick: () => removeAttachment(attachment.id), className: "absolute -top-1.5 -right-1.5 size-5 rounded-full bg-[var(--color-danger)] text-[var(--color-danger-contrast)] flex items-center justify-center opacity-0 translate-y-1 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-300 ease-in-out cursor-pointer shadow-md", "aria-label": `Remove ${attachment.file.name}`, children: jsx(XMarkIcon, { className: "size-3", strokeWidth: 3 }) })] }, attachment.id));
|
|
647
|
+
}) })), jsxs("div", { className: cn("flex gap-2", variant === "simple" ? "items-end" : "items-start"), children: [jsx(AnimatePresence, { mode: "wait", initial: false, children: isRecording && enableVoiceRecording ? (jsx(motion.div, { variants: textareaSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: "flex-1 min-w-0", children: jsx("p", { className: "text-center text-sm text-[var(--color-text-placeholder)]", children: placeholder }) }, "voice-recorder")) : (jsx(motion.div, { variants: textareaSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: cn("flex-1 min-w-0", variant === "simple" && "flex items-end"), children: jsx(Textarea, { ref: textareaRef, id: id, unstyled: true, value: currentValue, onChange: handleChange, onKeyDown: handleKeyDown, onPaste: handlePaste, placeholder: placeholder, disabled: isDisabled, maxLength: maxLength, rows: rows, "aria-label": ariaLabel || "Prompt input", "aria-describedby": helperTextId, "aria-invalid": isInvalid, "aria-disabled": isDisabled, className: cn(mergedTheme.textareaStyle, variant === "simple" &&
|
|
648
|
+
"!w-auto flex-1 min-w-0 justify-center", textareaClassName), style: {
|
|
649
|
+
minHeight,
|
|
650
|
+
maxHeight,
|
|
651
|
+
} }) }, "textarea")) }), variant === "simple" &&
|
|
652
|
+
renderSubmitButton("md", "filled", "neutral", "shrink-0")] }), variant !== "simple" && (jsx("div", { className: cn(mergedTheme.footerStyle, footerClassName), children: jsx(AnimatePresence, { mode: "wait", initial: false, children: isRecording && enableVoiceRecording ? (jsx(motion.div, { variants: textareaSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: "w-full", children: jsx(VoiceRecorder, { onComplete: handleRecordingComplete, onCancel: handleRecordingCancel, maxDuration: maxRecordingDuration, className: mergedTheme.voiceRecorderStyle }) }, "recorder-controls")) : (jsxs(motion.div, { variants: textareaSwapVariants, initial: "initial", animate: "animate", exit: "exit", className: "flex justify-between items-end w-full", children: [jsxs("div", { className: mergedTheme.actionsStyle, children: [showAttachmentButton && (jsxs(Dropdown, { selectionMode: "none", children: [jsx(Dropdown.Trigger, { children: jsx(Button, { iconOnly: true, variant: "outline", color: "neutral", size: "sm", className: "rounded-full !border-0.5", "aria-label": "Add attachment", disabled: isDisabled, children: jsx(PlusIcon, { className: "size-4", strokeWidth: 2 }) }) }), jsxs(Dropdown.Menu, { children: [jsx(Dropdown.Item, { itemKey: "upload-image", onAction: () => {
|
|
653
|
+
// Set accept to images only and trigger file input
|
|
654
|
+
if (fileInputRef.current) {
|
|
655
|
+
fileInputRef.current.accept = "image/*";
|
|
656
|
+
fileInputRef.current.click();
|
|
657
|
+
}
|
|
658
|
+
onAttachmentClick === null || onAttachmentClick === void 0 ? void 0 : onAttachmentClick();
|
|
659
|
+
}, children: "Upload Image" }, "upload-image"), jsx(Dropdown.Item, { itemKey: "add-link", onAction: () => {
|
|
660
|
+
// For now, just call the attachment callback
|
|
661
|
+
// A link input modal could be added later
|
|
662
|
+
onAttachmentClick === null || onAttachmentClick === void 0 ? void 0 : onAttachmentClick();
|
|
663
|
+
}, children: "Add Link" }, "add-link"), jsx(Dropdown.Item, { itemKey: "upload-pdf", onAction: () => {
|
|
664
|
+
// Set accept to PDF and trigger file input
|
|
665
|
+
if (fileInputRef.current) {
|
|
666
|
+
fileInputRef.current.accept =
|
|
667
|
+
"application/pdf,.pdf";
|
|
668
|
+
fileInputRef.current.click();
|
|
669
|
+
}
|
|
670
|
+
onAttachmentClick === null || onAttachmentClick === void 0 ? void 0 : onAttachmentClick();
|
|
671
|
+
}, children: "Upload PDF" }, "upload-pdf")] })] })), showSettingsButton && (jsx(Button, { iconOnly: true, variant: "outline", color: "neutral", size: "sm", className: "rounded-full !border-0.5", onClick: onSettingsClick, "aria-label": "Open settings", disabled: isDisabled, children: jsx(AdjustmentsHorizontalIcon, { className: "size-4 text-[var(--color-text-muted)]", strokeWidth: 2 }) })), showVoiceButton && (jsxs(Button, { variant: "outline", color: "neutral", size: "sm", className: "bg-transparent rounded-full border-0 font-medium text-[var(--color-text-secondary)]", onClick: handleVoiceClick, "aria-label": "Voice input", disabled: isDisabled || isRecording, children: [jsx(MicrophoneIcon, { className: "size-4", strokeWidth: 2 }), " ", "Voice"] })), showModelSelector && (jsxs(Dropdown, { selectionMode: "single", selectedKeys: isModelControlled
|
|
672
|
+
? [controlledModel]
|
|
673
|
+
: internalModel, onSelectionChange: handleModelChange, children: [jsx(Dropdown.Trigger, { children: jsxs(Button, { variant: "outline", color: "neutral", size: "sm", className: "bg-transparent rounded-full border-0 font-medium text-[var(--color-text-secondary)]", "aria-label": "Select AI model", disabled: isDisabled, children: [modelMap[currentModel] || "Select Model", jsx(ChevronDownIcon, { className: "size-3 opacity-80", strokeWidth: 2 })] }) }), jsx(Dropdown.Menu, { children: models.map((model) => (jsxs(Dropdown.Item, { itemKey: model.key, children: [model.icon && (jsx("span", { className: "mr-2", children: model.icon })), model.label] }, model.key))) })] }))] }), jsx("div", { children: renderSubmitButton("sm", "outline", "neutral") })] }, "footer-controls")) }) }))] }), displayHelperText && (jsx("div", { id: helperTextId, className: cn("mt-1 text-sm", isInvalid
|
|
441
674
|
? "text-[var(--color-danger)]"
|
|
442
675
|
: "text-[var(--color-text-muted)]"), role: isInvalid ? "alert" : undefined, "aria-live": isInvalid ? "polite" : undefined, children: displayHelperText }))] }));
|
|
443
676
|
});
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
const promptInputTheme = {
|
|
2
2
|
baseStyle: "rounded-[var(--card-radius)] border-[1px] border-[var(--color-border)] flex flex-col gap-2 shadow-real-md p-4 outline-2 outline-[var(--color-border)]/30 bg-white dark:bg-[var(--color-background-secondary)] ",
|
|
3
|
-
textareaStyle: "w-full bg-transparent text-
|
|
3
|
+
textareaStyle: "w-full bg-transparent text-base text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] focus:outline-none resize-none overflow-y-auto transition-[height] duration-200 ease-in-out",
|
|
4
4
|
footerStyle: "flex justify-between items-end",
|
|
5
5
|
actionsStyle: "flex gap-1",
|
|
6
6
|
submitButtonStyle: "rounded-full",
|
|
7
|
+
dropzoneStyle: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 rounded-[var(--card-radius)] border-2 border-dashed border-[var(--color-primary)] bg-[var(--color-primary-200)]/80 backdrop-blur-sm dark:bg-[var(--color-primary-900)]/80",
|
|
8
|
+
dropzoneTitleStyle: "text-base font-medium text-[var(--color-primary)]",
|
|
9
|
+
dropzoneSubtitleStyle: "text-sm text-[var(--color-primary)]/70",
|
|
10
|
+
dropzoneActionsStyle: "flex items-center gap-3 mt-1",
|
|
11
|
+
voiceRecorderStyle: "",
|
|
7
12
|
states: {
|
|
8
13
|
default: "",
|
|
9
14
|
disabled: "opacity-50 cursor-not-allowed",
|