flikkui 0.1.0-beta.11 → 0.1.0-beta.12
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/README.md +174 -86
- package/dist/components/ai/ApprovalCard/ApprovalCard.d.ts +3 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.js +43 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.d.ts +15 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.theme.js +17 -0
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +43 -0
- package/dist/components/ai/ApprovalCard/index.d.ts +2 -0
- package/dist/components/ai/ArtifactContainer/ArtifactContainer.d.ts +6 -0
- package/dist/components/ai/ArtifactContainer/ArtifactContainer.js +136 -0
- package/dist/components/ai/ArtifactContainer/ArtifactContainer.theme.d.ts +6 -0
- package/dist/components/ai/ArtifactContainer/ArtifactContainer.theme.js +14 -0
- package/dist/components/ai/ArtifactContainer/ArtifactContainer.types.d.ts +57 -0
- package/dist/components/ai/ArtifactContainer/index.d.ts +3 -0
- package/dist/components/ai/ChatInterface/ChatInterface.d.ts +26 -0
- package/dist/components/ai/ChatInterface/ChatInterface.js +79 -0
- package/dist/components/ai/ChatInterface/ChatInterface.theme.d.ts +2 -0
- package/dist/components/ai/ChatInterface/ChatInterface.theme.js +8 -0
- package/dist/components/ai/ChatInterface/ChatInterface.types.d.ts +68 -0
- package/dist/components/ai/ChatInterface/ChatInterface.types.js +19 -0
- package/dist/components/ai/ChatInterface/index.d.ts +4 -0
- package/dist/components/ai/CodeBlock/CodeBlock.d.ts +34 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +207 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.d.ts +2 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +17 -0
- package/dist/components/ai/CodeBlock/CodeBlock.types.d.ts +108 -0
- package/dist/components/ai/CodeBlock/LanguageIcon.d.ts +10 -0
- package/dist/components/ai/CodeBlock/LanguageIcon.js +103 -0
- package/dist/components/ai/CodeBlock/index.d.ts +3 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.animations.d.ts +31 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.animations.js +115 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.d.ts +35 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.js +93 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.theme.d.ts +2 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.theme.js +13 -0
- package/dist/components/ai/EditingIndicator/EditingIndicator.types.d.ts +54 -0
- package/dist/components/ai/EditingIndicator/index.d.ts +9 -0
- package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.d.ts +3 -0
- package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.js +104 -0
- package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.theme.d.ts +2 -0
- package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.theme.js +8 -0
- package/dist/components/ai/GenerativeRenderer/GenerativeRenderer.types.d.ts +45 -0
- package/dist/components/ai/GenerativeRenderer/index.d.ts +3 -0
- package/dist/components/ai/MessageHistory/MessageHistory.d.ts +18 -0
- package/dist/components/ai/MessageHistory/MessageHistory.js +107 -0
- package/dist/components/ai/MessageHistory/MessageHistory.theme.d.ts +2 -0
- package/dist/components/ai/MessageHistory/MessageHistory.theme.js +8 -0
- package/dist/components/ai/MessageHistory/MessageHistory.types.d.ts +94 -0
- package/dist/components/ai/MessageHistory/index.d.ts +3 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.animations.d.ts +17 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.animations.js +56 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.d.ts +38 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.js +109 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.theme.d.ts +2 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.theme.js +13 -0
- package/dist/components/ai/PresenceIndicator/PresenceIndicator.types.d.ts +53 -0
- package/dist/components/ai/PresenceIndicator/index.d.ts +8 -0
- package/dist/components/ai/PresenceProvider/PresenceContext.d.ts +24 -0
- package/dist/components/ai/PresenceProvider/PresenceContext.js +34 -0
- package/dist/components/ai/PresenceProvider/PresenceProvider.d.ts +32 -0
- package/dist/components/ai/PresenceProvider/PresenceProvider.js +345 -0
- package/dist/components/ai/PresenceProvider/PresenceProvider.types.d.ts +140 -0
- package/dist/components/ai/PresenceProvider/adapters/MockAdapter.d.ts +102 -0
- package/dist/components/ai/PresenceProvider/adapters/MockAdapter.js +353 -0
- package/dist/components/ai/PresenceProvider/adapters/PresenceAdapter.d.ts +93 -0
- package/dist/components/ai/PresenceProvider/adapters/SupabaseAdapter.d.ts +134 -0
- package/dist/components/ai/PresenceProvider/adapters/WebSocketAdapter.d.ts +149 -0
- package/dist/components/ai/PresenceProvider/adapters/index.d.ts +11 -0
- package/dist/components/ai/PresenceProvider/index.d.ts +10 -0
- package/dist/components/ai/PromptInput/PromptInput.js +613 -0
- package/dist/components/ai/PromptInput/PromptInput.theme.d.ts +1 -7
- package/dist/components/ai/PromptInput/PromptInput.theme.js +15 -0
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +72 -5
- package/dist/components/ai/PromptInput/index.d.ts +3 -3
- package/dist/components/ai/PromptSuggestions/PromptSuggestions.d.ts +27 -0
- package/dist/components/ai/PromptSuggestions/PromptSuggestions.js +66 -0
- package/dist/components/ai/PromptSuggestions/PromptSuggestions.types.d.ts +65 -0
- package/dist/components/ai/PromptSuggestions/index.d.ts +2 -0
- package/dist/components/ai/StreamingResponse/ErrorDisplay.d.ts +23 -0
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +50 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +17 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +138 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.d.ts +22 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +84 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.d.ts +2 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +101 -0
- package/dist/components/ai/StreamingResponse/index.d.ts +9 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.d.ts +10 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.animations.js +47 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.d.ts +20 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.js +58 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.d.ts +2 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +20 -0
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.types.d.ts +67 -0
- package/dist/components/ai/ThinkingIndicator/index.d.ts +3 -0
- package/dist/components/ai/TokenCounter/TokenCounter.d.ts +21 -0
- package/dist/components/ai/TokenCounter/TokenCounter.js +74 -0
- package/dist/components/ai/TokenCounter/TokenCounter.theme.d.ts +2 -0
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +28 -0
- package/dist/components/ai/TokenCounter/TokenCounter.types.d.ts +104 -0
- package/dist/components/ai/TokenCounter/index.d.ts +4 -0
- package/dist/components/ai/TokenCounter/tokenUtils.d.ts +23 -0
- package/dist/components/ai/TokenCounter/tokenUtils.js +108 -0
- package/dist/components/ai/VersionSlider/VersionSlider.d.ts +3 -0
- package/dist/components/ai/VersionSlider/VersionSlider.js +99 -0
- package/dist/components/ai/VersionSlider/VersionSlider.theme.d.ts +2 -0
- package/dist/components/ai/VersionSlider/VersionSlider.theme.js +18 -0
- package/dist/components/ai/VersionSlider/VersionSlider.types.d.ts +77 -0
- package/dist/components/ai/VersionSlider/index.d.ts +3 -0
- package/dist/components/ai/index.d.ts +33 -0
- package/dist/components/charts/ActivityRings/ActivityRings.js +164 -0
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +27 -0
- package/dist/components/charts/ActivityRings/ActivityRings.types.js +8 -0
- package/dist/components/charts/AreaChart/AreaChart.js +490 -0
- package/dist/components/charts/AreaChart/AreaChart.theme.js +45 -0
- package/dist/components/charts/AreaChart/AreaChart.types.js +7 -0
- package/dist/components/charts/BarChart/BarChart.js +470 -0
- package/dist/components/charts/BarChart/BarChart.types.d.ts +4 -4
- package/dist/components/charts/BarChart/BarChart.types.js +7 -0
- package/dist/components/charts/ChartContainer.js +38 -0
- package/dist/components/charts/ComboChart/ComboChart.js +164 -0
- package/dist/components/charts/ComboChart/ComboChart.types.js +7 -0
- package/dist/components/charts/DonutChart/DonutChart.js +169 -0
- package/dist/components/charts/DonutChart/DonutChart.theme.js +24 -0
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +252 -0
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +36 -0
- package/dist/components/charts/DonutChart/donut-utils.js +117 -0
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +106 -0
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +2 -2
- package/dist/components/charts/FunnelChart/FunnelChart.js +486 -0
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +12 -0
- package/dist/components/charts/Heatmap/Heatmap.js +166 -0
- package/dist/components/charts/Heatmap/Heatmap.theme.js +18 -0
- package/dist/components/charts/Heatmap/HeatmapCell.js +91 -0
- package/dist/components/charts/Heatmap/HeatmapLegend.js +23 -0
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +174 -0
- package/dist/components/charts/LineChart/LineChart.js +443 -0
- package/dist/components/charts/LineChart/LineChart.types.js +7 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +222 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +38 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +9 -0
- package/dist/components/charts/StackedBarChart/StackedBarChart.d.ts +3 -0
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +314 -0
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +34 -0
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +7 -0
- package/dist/components/charts/StackedBarChart/index.d.ts +3 -0
- package/dist/components/charts/hooks/useChartAccessibility.js +127 -0
- package/dist/components/charts/hooks/useChartScales.js +180 -0
- package/dist/components/charts/hooks/useChartTheme.js +86 -0
- package/dist/components/charts/hooks/useChartValidation.js +59 -0
- package/dist/components/charts/hooks/useTooltipPosition.js +304 -0
- package/dist/components/charts/index.d.ts +52 -49
- package/dist/components/charts/index.js +40 -0
- package/dist/components/charts/shared/BarRenderer/BarRenderer.js +295 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +40 -0
- package/dist/components/charts/shared/ChartAxis/YAxis.js +97 -0
- package/dist/components/charts/shared/ChartContainer/ChartContainer.js +172 -0
- package/dist/components/charts/shared/ChartCrosshair/ChartCrosshair.js +34 -0
- package/dist/components/charts/shared/ChartCrosshair/ChartCrosshair.theme.js +11 -0
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +66 -0
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +22 -0
- package/dist/components/charts/shared/ChartLegend/ChartLegend.js +30 -0
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +22 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +23 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.theme.js +9 -0
- package/dist/components/charts/shared/ChartText/ChartText.js +33 -0
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +9 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.js +71 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +18 -0
- package/dist/components/charts/shared/LineRenderer/LineRenderer.js +314 -0
- package/dist/components/charts/theme/chart.theme.js +73 -0
- package/dist/components/charts/types/chart.types.js +31 -0
- package/dist/components/charts/utils/animation-utils.js +115 -0
- package/dist/components/charts/utils/chart-validation.js +301 -0
- package/dist/components/charts/utils/color-utils.js +144 -0
- package/dist/components/core/Accordion/Accordion.js +1 -1
- package/dist/components/core/Accordion/Accordion.theme.js +1 -1
- package/dist/components/core/Accordion/AccordionContent.js +2 -3
- package/dist/components/core/Accordion/AccordionItem.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +4 -4
- package/dist/components/core/Alert/Alert.js +14 -18
- package/dist/components/core/Alert/Alert.theme.js +1 -9
- package/dist/components/core/Alert/Alert.types.d.ts +2 -10
- package/dist/components/core/AlertDialog/AlertDialog.js +29 -0
- package/dist/components/core/Avatar/Avatar.js +15 -15
- package/dist/components/core/Avatar/Avatar.theme.d.ts +1 -1
- package/dist/components/core/Avatar/Avatar.theme.js +11 -11
- package/dist/components/core/AvatarGroup/AvatarGroup.animations.d.ts +5 -4
- package/dist/components/core/AvatarGroup/AvatarGroup.animations.js +60 -32
- package/dist/components/core/AvatarGroup/AvatarGroup.js +24 -16
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +8 -8
- package/dist/components/core/Badge/Badge.js +23 -19
- package/dist/components/core/Badge/Badge.theme.d.ts +2 -2
- package/dist/components/core/Badge/Badge.theme.js +88 -59
- package/dist/components/core/Badge/Badge.types.d.ts +10 -9
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +2 -2
- package/dist/components/core/Button/Button.js +57 -35
- package/dist/components/core/Button/Button.ripple.js +1 -1
- package/dist/components/core/Button/Button.theme.d.ts +8 -2
- package/dist/components/core/Button/Button.theme.js +109 -12
- package/dist/components/core/Button/Button.types.d.ts +2 -0
- package/dist/components/core/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.d.ts +1 -0
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +2 -0
- package/dist/components/core/ButtonGroup/ButtonGroupSeparator.js +1 -1
- package/dist/components/core/ButtonGroup/ButtonGroupText.js +1 -1
- package/dist/components/core/Calendar/Calendar.animations.js +12 -0
- package/dist/components/core/Calendar/Calendar.js +6 -78
- package/dist/components/core/Calendar/Calendar.theme.d.ts +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +37 -4
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.animations.js +27 -0
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +269 -0
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +9 -0
- package/dist/components/core/Calendar/calendar.utils.js +10 -1
- package/dist/components/core/Card/Card.js +1 -1
- package/dist/components/core/Card/Card.theme.d.ts +1 -1
- package/dist/components/core/Card/Card.theme.js +6 -6
- package/dist/components/core/Card/Card.types.d.ts +2 -2
- package/dist/components/core/Card/CardContent.js +1 -1
- package/dist/components/core/Card/CardDescription.js +1 -1
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +1 -1
- package/dist/components/core/Card/CardTitle.js +1 -1
- package/dist/components/core/CardStack/CardStack.animations.d.ts +47 -0
- package/dist/components/core/CardStack/CardStack.d.ts +3 -0
- package/dist/components/core/CardStack/CardStack.js +189 -0
- package/dist/components/core/CardStack/CardStack.theme.d.ts +6 -0
- package/dist/components/core/CardStack/CardStack.theme.js +33 -0
- package/dist/components/core/CardStack/CardStack.types.d.ts +139 -0
- package/dist/components/core/CardStack/index.d.ts +7 -0
- package/dist/components/core/Carousel/Carousel.js +1 -1
- package/dist/components/core/Carousel/CarouselContent.js +2 -2
- package/dist/components/core/Carousel/CarouselItem.js +1 -1
- package/dist/components/core/Carousel/CarouselNext.js +3 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +3 -4
- package/dist/components/core/CommandPalette/CommandItem.js +145 -0
- package/dist/components/core/CommandPalette/CommandPalette.animations.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.animations.js +51 -0
- package/dist/components/core/CommandPalette/CommandPalette.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +236 -0
- package/dist/components/core/CommandPalette/CommandPalette.theme.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +30 -0
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +4 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.d.ts +1 -0
- package/dist/components/core/Divider/Divider.js +1 -1
- package/dist/components/core/DragDrop/DragDrop.js +30 -3
- package/dist/components/core/Drawer/Drawer.js +8 -4
- package/dist/components/core/Drawer/Drawer.theme.js +12 -4
- package/dist/components/core/Drawer/DrawerContent.js +1 -1
- package/dist/components/core/Drawer/DrawerFooter.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.js +3 -3
- package/dist/components/core/Dropdown/Dropdown.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.d.ts +1 -0
- package/dist/components/core/Dropdown/Dropdown.theme.js +21 -4
- package/dist/components/core/Dropdown/DropdownItem.js +6 -3
- package/dist/components/core/Dropdown/DropdownMenu.js +53 -12
- package/dist/components/core/Dropdown/DropdownSection.js +1 -1
- package/dist/components/core/Dropdown/DropdownSeparator.js +1 -1
- package/dist/components/core/Empty/Empty.js +1 -1
- package/dist/components/core/Kbd/Kbd.js +1 -1
- package/dist/components/core/Link/Link.js +6 -7
- package/dist/components/core/Loader/Loader.js +64 -0
- package/dist/components/core/Loader/Loader.theme.js +60 -0
- package/dist/components/core/Masonry/Masonry.js +2 -3
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/{ai → core}/Message/Message.d.ts +1 -1
- package/dist/components/core/Message/Message.js +136 -0
- package/dist/components/core/Message/Message.theme.d.ts +6 -0
- package/dist/components/core/Message/Message.theme.js +46 -0
- package/dist/components/core/Message/Message.types.d.ts +169 -0
- package/dist/components/core/Message/MessageActions.js +21 -0
- package/dist/components/{ai → core}/Message/MessageAvatar.d.ts +2 -2
- package/dist/components/core/Message/MessageAvatar.js +18 -0
- package/dist/components/core/Message/MessageContent.js +26 -0
- package/dist/components/{ai → core}/Message/MessageContext.d.ts +3 -2
- package/dist/components/core/Message/MessageContext.js +12 -0
- package/dist/components/core/Message/MessageTimestamp.js +23 -0
- package/dist/components/core/Message/TypeWriter.js +28 -0
- package/dist/components/core/Message/index.d.ts +5 -0
- package/dist/components/core/Metric/Metric.js +6 -4
- package/dist/components/core/Metric/index.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +8 -4
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/ModalBody.js +1 -1
- package/dist/components/core/Modal/ModalDescription.js +1 -1
- package/dist/components/core/Modal/ModalFooter.js +1 -1
- package/dist/components/core/Modal/ModalHeader.js +6 -5
- package/dist/components/core/Modal/ModalTitle.js +1 -1
- package/dist/components/core/NavItem/NavItem.js +42 -21
- package/dist/components/core/NavItem/NavItem.theme.js +11 -11
- package/dist/components/core/NavItem/NavItem.types.d.ts +59 -4
- package/dist/components/core/Notification/Notification.js +33 -42
- package/dist/components/core/Notification/Notification.theme.js +7 -11
- package/dist/components/core/OfflineIndicator/OfflineIndicator.d.ts +20 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +113 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.d.ts +2 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +57 -0
- package/dist/components/core/OfflineIndicator/index.d.ts +3 -0
- package/dist/components/core/Pagination/Pagination.js +6 -9
- package/dist/components/core/Pagination/Pagination.theme.js +20 -2
- package/dist/components/core/Pill/Pill.animations.js +25 -0
- package/dist/components/core/Pill/Pill.js +150 -0
- package/dist/components/core/Pill/Pill.theme.d.ts +1 -1
- package/dist/components/core/Pill/Pill.theme.js +65 -0
- package/dist/components/core/Pill/Pill.types.d.ts +5 -5
- package/dist/components/core/Popover/Popover.js +1 -1
- package/dist/components/core/Popover/PopoverContent.js +2 -4
- package/dist/components/core/Popover/PopoverTrigger.js +1 -1
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +31 -4
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +223 -33
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -6
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +8 -2
- package/dist/components/core/ProgressiveBlur/index.d.ts +2 -2
- package/dist/components/core/RetryBoundary/RetryBoundary.d.ts +35 -0
- package/dist/components/core/RetryBoundary/RetryBoundary.js +160 -0
- package/dist/components/core/RetryBoundary/RetryBoundary.theme.d.ts +2 -0
- package/dist/components/core/RetryBoundary/RetryBoundary.theme.js +7 -0
- package/dist/components/core/RetryBoundary/RetryBoundary.types.d.ts +51 -0
- package/dist/components/core/RetryBoundary/index.d.ts +3 -0
- package/dist/components/core/Segmented/Segmented.js +4 -1
- package/dist/components/core/Segmented/Segmented.theme.d.ts +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +4 -4
- package/dist/components/core/Segmented/SegmentedItem.js +1 -1
- package/dist/components/core/Sidebar/Sidebar.d.ts +2 -2
- package/dist/components/core/Sidebar/Sidebar.js +14 -9
- package/dist/components/core/Sidebar/SidebarContent.d.ts +2 -2
- package/dist/components/core/Sidebar/SidebarContent.js +6 -4
- package/dist/components/core/Sidebar/SidebarFooter.d.ts +2 -2
- package/dist/components/core/Sidebar/SidebarFooter.js +6 -3
- package/dist/components/core/Sidebar/SidebarHeader.d.ts +2 -2
- package/dist/components/core/Sidebar/SidebarHeader.js +6 -7
- package/dist/components/core/Sidebar/SidebarNav.js +1 -1
- package/dist/components/core/Sidebar/SidebarNavGroup.d.ts +2 -2
- package/dist/components/core/Sidebar/SidebarNavGroup.js +7 -7
- package/dist/components/core/Sidebar/SidebarSubmenu.d.ts +7 -0
- package/dist/components/core/Sidebar/SidebarSubmenu.js +13 -0
- package/dist/components/core/Sidebar/SidebarToggle.d.ts +2 -2
- package/dist/components/core/Sidebar/SidebarToggle.js +11 -9
- package/dist/components/core/Sidebar/index.d.ts +10 -9
- package/dist/components/core/Skeleton/Skeleton.js +61 -0
- package/dist/components/core/Skeleton/Skeleton.theme.js +18 -0
- package/dist/components/core/SlidingNumber/SlidingNumber.d.ts +2 -2
- package/dist/components/core/SlidingNumber/SlidingNumber.js +40 -32
- package/dist/components/core/SlidingNumber/SlidingNumber.types.d.ts +3 -3
- package/dist/components/core/Sortable/Sortable.animations.d.ts +48 -0
- package/dist/components/core/Sortable/Sortable.animations.js +1 -1
- package/dist/components/core/Sortable/Sortable.js +6 -10
- package/dist/components/core/Spinner/Spinner.js +4 -1
- package/dist/components/core/Stepper/Stepper.js +1 -1
- package/dist/components/core/Stepper/Stepper.theme.d.ts +26 -4
- package/dist/components/core/Stepper/Stepper.theme.js +42 -9
- package/dist/components/core/Stepper/StepperItem.js +39 -15
- package/dist/components/core/Table/Table.js +6 -3
- package/dist/components/core/Table/Table.theme.js +49 -14
- package/dist/components/core/Table/components/DeclarativeComponents.js +4 -1
- package/dist/components/core/Table/components/TableActions/TableActions.d.ts +3 -3
- package/dist/components/core/Table/components/TableActions/TableActions.js +44 -22
- package/dist/components/core/Table/components/TableActions/TableActionsMenu.js +4 -1
- package/dist/components/core/Table/components/TablePagination/TablePagination.js +4 -1
- package/dist/components/core/Table/components/TableSelectionHeader/TableSelectionHeader.js +6 -3
- package/dist/components/core/Table/components/core/TableBody.js +1 -1
- package/dist/components/core/Table/components/core/TableCell.js +4 -1
- package/dist/components/core/Table/components/core/TableHeader.js +1 -1
- package/dist/components/core/Table/components/core/TableRow.js +2 -3
- package/dist/components/core/Table/index.js +6 -1
- package/dist/components/core/Tabs/Tabs.js +1 -1
- package/dist/components/core/Tabs/TabsContent.js +2 -4
- package/dist/components/core/Tabs/TabsList.js +2 -3
- package/dist/components/core/Tabs/TabsTrigger.js +2 -3
- package/dist/components/core/Toast/Toast.js +11 -16
- package/dist/components/core/Toast/ToastProvider.js +2 -2
- package/dist/components/core/Tooltip/Tooltip.animations.js +18 -2
- package/dist/components/core/Tooltip/Tooltip.js +48 -11
- package/dist/components/core/Tooltip/Tooltip.theme.js +2 -1
- package/dist/components/core/Tree/Tree.animations.js +1 -1
- package/dist/components/core/Tree/Tree.js +5 -8
- package/dist/components/core/index.d.ts +4 -1
- package/dist/components/core/index.js +94 -0
- package/dist/components/effects/CustomCursor/CustomCursor.js +4 -8
- package/dist/components/effects/GlassEffect/GlassEffect.js +4 -1
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +8 -0
- package/dist/components/effects/GlassSurface/GlassSurface.js +218 -0
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +57 -0
- package/dist/components/effects/GlassSurface/index.d.ts +2 -0
- package/dist/components/effects/Overlay/Overlay.d.ts +2 -2
- package/dist/components/effects/Overlay/Overlay.js +26 -17
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.d.ts +18 -0
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.js +195 -0
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.shaders.d.ts +7 -0
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.shaders.js +9 -0
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.d.ts +61 -0
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.js +8 -0
- package/dist/components/effects/SpotlightBorder/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +10 -6
- package/dist/components/effects/index.js +5 -0
- package/dist/components/forms/Checkbox/Checkbox.js +4 -5
- package/dist/components/forms/Checkbox/Checkbox.theme.d.ts +1 -0
- package/dist/components/forms/Checkbox/Checkbox.theme.js +31 -4
- package/dist/components/forms/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/forms/DatePicker/DatePicker.js +19 -13
- package/dist/components/forms/DatePicker/DatePicker.theme.d.ts +1 -1
- package/dist/components/forms/DatePicker/DatePicker.theme.js +26 -7
- package/dist/components/forms/DatePicker/DatePicker.types.d.ts +11 -13
- package/dist/components/forms/DatePicker/DatePickerContent.d.ts +2 -2
- package/dist/components/forms/DatePicker/DatePickerContent.js +85 -36
- package/dist/components/forms/DatePicker/DatePickerTrigger.d.ts +2 -2
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +8 -7
- package/dist/components/forms/FileUpload/FileUpload.js +299 -0
- package/dist/components/forms/FileUpload/FileUpload.theme.js +36 -0
- package/dist/components/forms/FileUpload/FileUpload.types.d.ts +4 -0
- package/dist/components/forms/FileUpload/index.d.ts +1 -1
- package/dist/components/forms/FormLabel/FormLabel.js +4 -1
- package/dist/components/forms/Input/Input.js +7 -6
- package/dist/components/forms/Input/Input.theme.js +23 -16
- package/dist/components/forms/InputAddress/InputAddress.js +1 -1
- package/dist/components/forms/InputAddress/InputAddress.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +172 -0
- package/dist/components/forms/InputCounter/InputCounter.theme.js +11 -0
- package/dist/components/forms/InputCreditCard/InputCreditCard.js +1 -1
- package/dist/components/forms/InputCreditCard/InputCreditCard.theme.js +1 -1
- package/dist/components/forms/InputDate/InputDate.js +1 -1
- package/dist/components/forms/InputOTP/InputOTP.js +1 -1
- package/dist/components/forms/OptimisticForm/OptimisticForm.d.ts +33 -0
- package/dist/components/forms/OptimisticForm/OptimisticForm.js +88 -0
- package/dist/components/forms/OptimisticForm/OptimisticForm.theme.d.ts +2 -0
- package/dist/components/forms/OptimisticForm/OptimisticForm.theme.js +8 -0
- package/dist/components/forms/OptimisticForm/OptimisticForm.types.d.ts +74 -0
- package/dist/components/forms/OptimisticForm/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +16 -22
- package/dist/components/forms/Select/Select.js +103 -36
- package/dist/components/forms/Select/Select.theme.d.ts +1 -1
- package/dist/components/forms/Select/Select.theme.js +18 -8
- package/dist/components/forms/Select/Select.types.d.ts +8 -4
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +29 -11
- package/dist/components/forms/Slider/Slider.theme.js +1 -1
- package/dist/components/forms/StepperForm/StepperForm.d.ts +7 -0
- package/dist/components/forms/StepperForm/StepperForm.js +105 -0
- package/dist/components/forms/StepperForm/StepperForm.theme.d.ts +2 -0
- package/dist/components/forms/StepperForm/StepperForm.theme.js +19 -0
- package/dist/components/forms/StepperForm/StepperForm.types.d.ts +65 -0
- package/dist/components/forms/StepperForm/StepperForm.types.js +12 -0
- package/dist/components/forms/StepperForm/index.d.ts +3 -0
- package/dist/components/forms/Switch/Switch.js +5 -2
- package/dist/components/forms/Switch/Switch.types.d.ts +1 -1
- package/dist/components/forms/Textarea/Textarea.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerContent.js +2 -3
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +4 -6
- package/dist/components/forms/forms.theme.js +32 -9
- package/dist/components/forms/index.d.ts +59 -55
- package/dist/components/forms/index.js +52 -0
- package/dist/hooks/index.d.ts +14 -5
- package/dist/hooks/useFormStateMachine.d.ts +31 -0
- package/dist/hooks/useFormStateMachine.js +72 -0
- package/dist/hooks/useNetworkStatus.d.ts +40 -0
- package/dist/hooks/useNetworkStatus.js +88 -0
- package/dist/hooks/useOptimisticMutation.d.ts +109 -0
- package/dist/hooks/useOptimisticMutation.js +196 -0
- package/dist/hooks/usePresence.d.ts +88 -0
- package/dist/hooks/useSlidingNumber.js +67 -0
- package/dist/hooks/useStreamingSSE.d.ts +80 -0
- package/dist/hooks/useStreamingSSE.js +236 -0
- package/dist/hooks/useTypewriter.js +117 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/core/ChevronUpDown.js +1 -1
- package/dist/icons/core/DollarIcon.js +1 -1
- package/dist/icons/core/LockIcon.js +1 -1
- package/dist/icons/core/MinusIcon.js +1 -1
- package/dist/icons/core/PlusIcon.js +1 -1
- package/dist/icons/core/SearchIcon.js +1 -1
- package/dist/icons/core/TickIcon.js +1 -1
- package/dist/index.d.ts +11 -124
- package/dist/index.js +150 -35
- package/dist/styles.css +1 -1
- package/dist/utils/actionQueue.d.ts +113 -0
- package/dist/utils/actionQueue.js +233 -0
- package/dist/utils/cn.js +2 -2
- package/dist/utils/dateUtils.js +1 -1
- package/dist/utils/formValidation.d.ts +20 -0
- package/dist/utils/formValidation.js +33 -0
- package/dist/utils/index.d.ts +14 -6
- package/dist/utils/optimisticErrors.d.ts +79 -0
- package/dist/utils/optimisticErrors.js +111 -0
- package/dist/utils/presenceUtils.d.ts +66 -0
- package/dist/utils/presenceUtils.js +110 -0
- package/dist/utils/retryUtils.d.ts +49 -0
- package/dist/utils/retryUtils.js +53 -0
- package/dist/utils/sseFormatParsers.d.ts +64 -0
- package/dist/utils/sseFormatParsers.js +124 -0
- package/dist/utils/stateMachine.d.ts +43 -0
- package/dist/utils/stateMachine.js +45 -0
- package/dist/utils/streamingErrors.d.ts +70 -0
- package/dist/utils/streamingErrors.js +110 -0
- package/package.json +69 -20
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.js +0 -3
- package/dist/_virtual/react-jsx-runtime.development.js +0 -3
- package/dist/_virtual/react-jsx-runtime.production.js +0 -3
- package/dist/components/ai/Message/Message.theme.d.ts +0 -2
- package/dist/components/ai/Message/Message.types.d.ts +0 -110
- package/dist/components/ai/Message/index.d.ts +0 -9
- package/dist/components/core/ChatMessage/ChatMessage.d.ts +0 -3
- package/dist/components/core/ChatMessage/ChatMessage.js +0 -62
- package/dist/components/core/ChatMessage/ChatMessage.theme.d.ts +0 -6
- package/dist/components/core/ChatMessage/ChatMessage.theme.js +0 -31
- package/dist/components/core/ChatMessage/ChatMessage.types.d.ts +0 -120
- package/dist/components/core/ChatMessage/index.d.ts +0 -2
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.js +0 -17
- package/dist/node_modules/@heroicons/react/16/solid/esm/CheckIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/16/solid/esm/LockClosedIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronRightIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/20/solid/esm/PaperAirplaneIcon.js +0 -24
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowTrendingDownIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowTrendingUpIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowUturnLeftIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowUturnRightIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/Bars3BottomLeftIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/Bars3BottomRightIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/Bars3Icon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/BoldIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/CalendarIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronDoubleLeftIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronDoubleRightIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronDownIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronLeftIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronRightIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronUpDownIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChevronUpIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/Cog6ToothIcon.js +0 -32
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/EllipsisVerticalIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/ItalicIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/LockClosedIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/MinusIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/PlusIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/UnderlineIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/solid/esm/ArrowPathIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/BellIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/ExclamationTriangleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/EyeIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/solid/esm/EyeSlashIcon.js +0 -28
- package/dist/node_modules/@heroicons/react/24/solid/esm/InformationCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/LockClosedIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/PaintBrushIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XMarkIcon.js +0 -26
- package/dist/node_modules/clsx/dist/clsx.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js +0 -103
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js +0 -85
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js +0 -26
- package/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/animation/utils/calc-child-stagger.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -87
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -63
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -165
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -44
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +0 -52
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/events/add-dom-event.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -501
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -27
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +0 -116
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -129
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -41
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -30
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -157
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -50
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/motion/features/Feature.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -36
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -147
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -72
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -49
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -107
- package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -38
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -139
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -79
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -57
- package/dist/node_modules/framer-motion/dist/es/projection/animation/mix-values.js +0 -91
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/copy.js +0 -31
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js +0 -119
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.js +0 -52
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.js +0 -54
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/models.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/utils.js +0 -31
- package/dist/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js +0 -27
- package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js +0 -1582
- package/dist/node_modules/framer-motion/dist/es/projection/node/state.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -112
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js +0 -41
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js +0 -35
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/projection/styles/transform.js +0 -49
- package/dist/node_modules/framer-motion/dist/es/projection/utils/each-axis.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.js +0 -26
- package/dist/node_modules/framer-motion/dist/es/projection/utils/measure.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/render/VisualElement.js +0 -489
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js +0 -43
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -30
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -44
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -57
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -65
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -62
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/render.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/render/store.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -57
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js +0 -30
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -32
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/render.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.js +0 -357
- package/dist/node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/render/utils/flat-tree.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/utils/get-variant-context.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/render/utils/is-variant-label.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/utils/motion-values.js +0 -51
- package/dist/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js +0 -36
- package/dist/node_modules/framer-motion/dist/es/render/utils/setters.js +0 -31
- package/dist/node_modules/framer-motion/dist/es/render/utils/variant-props.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/utils/delay.js +0 -20
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/state.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -47
- package/dist/node_modules/framer-motion/dist/es/utils/shallow-compare.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +0 -37
- package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +0 -38
- package/dist/node_modules/framer-motion/dist/es/value/use-spring.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +0 -29
- package/dist/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.js +0 -20
- package/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -176
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -341
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -158
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -65
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -87
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -51
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.js +0 -86
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.js +0 -176
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -131
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -147
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -36
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -42
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -42
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -43
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -71
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -81
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -83
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -83
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -79
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -47
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -93
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/transform.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -325
- package/dist/node_modules/motion-dom/dist/es/value/spring-value.js +0 -54
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -40
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -42
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -32
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -91
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -50
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/array.js +0 -21
- package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -9
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -9
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -51
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -41
- package/dist/node_modules/motion-utils/dist/es/errors.js +0 -18
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/memo.js +0 -11
- package/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -11
- package/dist/node_modules/motion-utils/dist/es/progress.js +0 -19
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -40
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -12
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -11
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -11
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -368
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -44
- package/dist/node_modules/react/jsx-runtime.js +0 -19
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -2956
- package/dist/node_modules/tslib/tslib.es6.js +0 -56
- /package/dist/components/{ai → core}/Message/MessageActions.d.ts +0 -0
- /package/dist/components/{ai → core}/Message/MessageContent.d.ts +0 -0
- /package/dist/components/{ai → core}/Message/MessageTimestamp.d.ts +0 -0
- /package/dist/components/{ai → core}/Message/TypeWriter.d.ts +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { __rest, __assign, __spreadArray } from '/Users/ggn/Development/ui-flik/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import React__default, { useRef, useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
|
|
6
|
+
import { useChartAccessibility } from '../hooks/useChartAccessibility.js';
|
|
7
|
+
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
8
|
+
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
9
|
+
import { ChartTooltip } from '../shared/ChartTooltip/ChartTooltip.js';
|
|
10
|
+
import { SCATTER_PLOT_DEFAULTS } from './ScatterPlot.types.js';
|
|
11
|
+
import { scatterPlotTheme, getCategoryColor } from './ScatterPlot.theme.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ScatterPlot Component
|
|
15
|
+
*
|
|
16
|
+
* Displays correlation between two variables with optional bubble sizing.
|
|
17
|
+
* Now uses shared axis components with tick marks and value labels like other charts.
|
|
18
|
+
*/
|
|
19
|
+
var ScatterPlot = function (_a) {
|
|
20
|
+
var _b;
|
|
21
|
+
var data = _a.data, xLabel = _a.xLabel, yLabel = _a.yLabel, propDotRadius = _a.dotRadius, pointSize = _a.pointSize, // @deprecated
|
|
22
|
+
_c = _a.showGrid, // @deprecated
|
|
23
|
+
showGrid = _c === void 0 ? SCATTER_PLOT_DEFAULTS.showGrid : _c, _d = _a.showXAxis, showXAxis = _d === void 0 ? SCATTER_PLOT_DEFAULTS.showXAxis : _d, _e = _a.showYAxis, showYAxis = _e === void 0 ? SCATTER_PLOT_DEFAULTS.showYAxis : _e, _f = _a.showTooltip, showTooltip = _f === void 0 ? SCATTER_PLOT_DEFAULTS.showTooltip : _f, colors = _a.colors, propMinValue = _a.minValue, propMaxValue = _a.maxValue, themeOverrides = _a.theme, className = _a.className, svgClassName = _a.svgClassName, dotClassName = _a.dotClassName; _a.gridClassName; var axisClassName = _a.axisClassName, title = _a.title, description = _a.description, _g = _a.enableKeyboardNavigation, enableKeyboardNavigation = _g === void 0 ? SCATTER_PLOT_DEFAULTS.enableKeyboardNavigation : _g, props = __rest(_a, ["data", "xLabel", "yLabel", "dotRadius", "pointSize", "showGrid", "showXAxis", "showYAxis", "showTooltip", "colors", "minValue", "maxValue", "theme", "className", "svgClassName", "dotClassName", "gridClassName", "axisClassName", "title", "description", "enableKeyboardNavigation"]);
|
|
24
|
+
var theme = __assign(__assign({}, scatterPlotTheme), (themeOverrides || {}));
|
|
25
|
+
var chartColors = colors || theme.colors || scatterPlotTheme.colors;
|
|
26
|
+
// Use dotRadius, fallback to pointSize for backward compatibility
|
|
27
|
+
var dotRadiusValue = (_b = propDotRadius !== null && propDotRadius !== void 0 ? propDotRadius : pointSize) !== null && _b !== void 0 ? _b : SCATTER_PLOT_DEFAULTS.dotRadius;
|
|
28
|
+
// Responsive container dimensions
|
|
29
|
+
var containerRef = useRef(null);
|
|
30
|
+
var _h = useState({ width: 600, height: 400 }), dimensions = _h[0], setDimensions = _h[1];
|
|
31
|
+
// Update dimensions on mount and resize
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
if (!containerRef.current)
|
|
34
|
+
return;
|
|
35
|
+
var updateDimensions = function () {
|
|
36
|
+
if (containerRef.current) {
|
|
37
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
38
|
+
setDimensions({
|
|
39
|
+
width: rect.width || 600,
|
|
40
|
+
height: rect.height || 400,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// Initial measurement
|
|
45
|
+
updateDimensions();
|
|
46
|
+
// Setup ResizeObserver
|
|
47
|
+
var resizeObserver = new ResizeObserver(updateDimensions);
|
|
48
|
+
resizeObserver.observe(containerRef.current);
|
|
49
|
+
return function () {
|
|
50
|
+
resizeObserver.disconnect();
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
// Calculate ranges and categories
|
|
54
|
+
var _j = useMemo(function () {
|
|
55
|
+
// Filter out invalid data points
|
|
56
|
+
var valid = data.filter(function (d) {
|
|
57
|
+
return typeof d.x === 'number' &&
|
|
58
|
+
typeof d.y === 'number' &&
|
|
59
|
+
!isNaN(d.x) &&
|
|
60
|
+
!isNaN(d.y) &&
|
|
61
|
+
isFinite(d.x) &&
|
|
62
|
+
isFinite(d.y);
|
|
63
|
+
});
|
|
64
|
+
if (valid.length === 0) {
|
|
65
|
+
return {
|
|
66
|
+
xMin: propMinValue !== null && propMinValue !== void 0 ? propMinValue : 0,
|
|
67
|
+
xMax: propMaxValue !== null && propMaxValue !== void 0 ? propMaxValue : 100,
|
|
68
|
+
yMin: propMinValue !== null && propMinValue !== void 0 ? propMinValue : 0,
|
|
69
|
+
yMax: propMaxValue !== null && propMaxValue !== void 0 ? propMaxValue : 100,
|
|
70
|
+
categories: [],
|
|
71
|
+
validData: [],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
var xValues = valid.map(function (d) { return d.x; });
|
|
75
|
+
var yValues = valid.map(function (d) { return d.y; });
|
|
76
|
+
var cats = Array.from(new Set(valid.map(function (d) { return d.category; }).filter(Boolean)));
|
|
77
|
+
var minX = propMinValue !== null && propMinValue !== void 0 ? propMinValue : Math.min.apply(Math, xValues);
|
|
78
|
+
var maxX = propMaxValue !== null && propMaxValue !== void 0 ? propMaxValue : Math.max.apply(Math, xValues);
|
|
79
|
+
var minY = propMinValue !== null && propMinValue !== void 0 ? propMinValue : Math.min.apply(Math, yValues);
|
|
80
|
+
var maxY = propMaxValue !== null && propMaxValue !== void 0 ? propMaxValue : Math.max.apply(Math, yValues);
|
|
81
|
+
return {
|
|
82
|
+
xMin: minX,
|
|
83
|
+
xMax: maxX === minX ? minX + 1 : maxX, // Avoid same min/max
|
|
84
|
+
yMin: minY,
|
|
85
|
+
yMax: maxY === minY ? minY + 1 : maxY, // Avoid same min/max
|
|
86
|
+
categories: cats,
|
|
87
|
+
validData: valid,
|
|
88
|
+
};
|
|
89
|
+
}, [data, propMinValue, propMaxValue]), xMin = _j.xMin, xMax = _j.xMax, yMin = _j.yMin, yMax = _j.yMax, categories = _j.categories, validData = _j.validData;
|
|
90
|
+
// Chart dimensions with margins (pixel-based like other charts)
|
|
91
|
+
var margin = {
|
|
92
|
+
top: 20,
|
|
93
|
+
right: 20,
|
|
94
|
+
bottom: showXAxis ? 60 : 20,
|
|
95
|
+
left: showYAxis ? 60 : 20,
|
|
96
|
+
};
|
|
97
|
+
var innerWidth = dimensions.width - margin.left - margin.right;
|
|
98
|
+
var innerHeight = dimensions.height - margin.top - margin.bottom;
|
|
99
|
+
// Scale functions (pixel-based)
|
|
100
|
+
var scaleX = function (value) {
|
|
101
|
+
var ratio = (value - xMin) / (xMax - xMin);
|
|
102
|
+
return margin.left + ratio * innerWidth;
|
|
103
|
+
};
|
|
104
|
+
var scaleY = function (value) {
|
|
105
|
+
var ratio = (value - yMin) / (yMax - yMin);
|
|
106
|
+
return margin.top + innerHeight - ratio * innerHeight;
|
|
107
|
+
};
|
|
108
|
+
// Get color for category
|
|
109
|
+
var getColor = function (category) {
|
|
110
|
+
if (!category)
|
|
111
|
+
return chartColors[0];
|
|
112
|
+
var index = categories.indexOf(category);
|
|
113
|
+
return getCategoryColor(chartColors, index);
|
|
114
|
+
};
|
|
115
|
+
// Tooltip setup
|
|
116
|
+
var isMobile = typeof window !== 'undefined' && window.innerWidth < 768;
|
|
117
|
+
var _k = useTooltipPosition({
|
|
118
|
+
containerRef: containerRef,
|
|
119
|
+
isMobile: isMobile,
|
|
120
|
+
}), tooltipData = _k.tooltipData, tooltipRef = _k.tooltipRef, handleMouseEnter = _k.handleMouseEnter, handleMouseMove = _k.handleMouseMove, handleMouseLeave = _k.handleMouseLeave;
|
|
121
|
+
// Accessibility setup (create config from data for accessibility)
|
|
122
|
+
var config = useMemo(function () {
|
|
123
|
+
var configObj = {};
|
|
124
|
+
categories.forEach(function (cat, idx) {
|
|
125
|
+
configObj[cat] = {
|
|
126
|
+
label: cat,
|
|
127
|
+
color: getCategoryColor(chartColors, idx),
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
return configObj;
|
|
131
|
+
}, [categories, chartColors]);
|
|
132
|
+
var chartDataForAccessibility = useMemo(function () {
|
|
133
|
+
return validData.map(function (point) { return ({
|
|
134
|
+
category: point.category || 'Point',
|
|
135
|
+
x: point.x,
|
|
136
|
+
y: point.y,
|
|
137
|
+
size: point.size,
|
|
138
|
+
label: point.label,
|
|
139
|
+
}); });
|
|
140
|
+
}, [validData]);
|
|
141
|
+
var _l = useChartAccessibility({
|
|
142
|
+
chartType: 'scatter',
|
|
143
|
+
data: chartDataForAccessibility,
|
|
144
|
+
config: config,
|
|
145
|
+
title: title,
|
|
146
|
+
description: description,
|
|
147
|
+
enableKeyboardNavigation: enableKeyboardNavigation,
|
|
148
|
+
}), chartAccessibilityProps = _l.chartAccessibilityProps, descriptionProps = _l.descriptionProps, handleMouseInteraction = _l.handleMouseInteraction;
|
|
149
|
+
// Generate X-axis data for axis component
|
|
150
|
+
var xAxisData = useMemo(function () {
|
|
151
|
+
// Create tick marks for X axis
|
|
152
|
+
var tickCount = 5;
|
|
153
|
+
var range = xMax - xMin;
|
|
154
|
+
var step = range / (tickCount - 1);
|
|
155
|
+
return Array.from({ length: tickCount }, function (_, i) { return ({
|
|
156
|
+
name: (xMin + i * step).toFixed(0),
|
|
157
|
+
value: xMin + i * step,
|
|
158
|
+
}); });
|
|
159
|
+
}, [xMin, xMax]);
|
|
160
|
+
// Return empty state if no data
|
|
161
|
+
if (validData.length === 0) {
|
|
162
|
+
return (React__default.createElement("div", __assign({ ref: containerRef, className: cn(theme.containerStyle, className), style: { minHeight: '400px' } }, props),
|
|
163
|
+
React__default.createElement("div", { className: theme.emptyStateStyle }, data.length === 0 ? 'No data available' : 'No valid data points')));
|
|
164
|
+
}
|
|
165
|
+
return (React__default.createElement("div", __assign({ ref: containerRef, className: cn(theme.containerStyle, className), style: { minHeight: '400px' } }, chartAccessibilityProps, props),
|
|
166
|
+
React__default.createElement("svg", __assign({ width: dimensions.width, height: dimensions.height, className: cn(theme.svgStyle, svgClassName) }, descriptionProps),
|
|
167
|
+
React__default.createElement(YAxis, { show: showYAxis, min: yMin, max: yMax, x: margin.left, y: margin.top, height: innerHeight, showGrid: showGrid, gridWidth: innerWidth, tickCount: 5, className: cn(axisClassName) }),
|
|
168
|
+
validData.map(function (point, index) {
|
|
169
|
+
var cx = scaleX(point.x);
|
|
170
|
+
var cy = scaleY(point.y);
|
|
171
|
+
var size = point.size ? Math.sqrt(point.size) / 2 : dotRadiusValue;
|
|
172
|
+
var pointColor = getColor(point.category);
|
|
173
|
+
return (React__default.createElement(motion.circle, { key: index, cx: cx, cy: cy, r: size, fill: pointColor, className: cn(theme.dotStyle, dotClassName), strokeWidth: "0.5", initial: { scale: 0, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { delay: index * 0.01, duration: 0.3 }, whileHover: { scale: 1.5, opacity: 1 }, onMouseEnter: function (e) {
|
|
174
|
+
if (showTooltip) {
|
|
175
|
+
var content = {
|
|
176
|
+
category: point.label || point.category || "Point ".concat(index + 1),
|
|
177
|
+
series: __spreadArray([
|
|
178
|
+
{
|
|
179
|
+
key: 'x',
|
|
180
|
+
label: xLabel || 'X',
|
|
181
|
+
value: point.x.toFixed(2),
|
|
182
|
+
color: pointColor,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: 'y',
|
|
186
|
+
label: yLabel || 'Y',
|
|
187
|
+
value: point.y.toFixed(2),
|
|
188
|
+
color: pointColor,
|
|
189
|
+
}
|
|
190
|
+
], (point.size
|
|
191
|
+
? [
|
|
192
|
+
{
|
|
193
|
+
key: 'size',
|
|
194
|
+
label: 'Size',
|
|
195
|
+
value: point.size.toFixed(2),
|
|
196
|
+
color: pointColor,
|
|
197
|
+
},
|
|
198
|
+
]
|
|
199
|
+
: []), true),
|
|
200
|
+
};
|
|
201
|
+
// Pass SVG coordinates for proper positioning (especially in mobile/constrained containers)
|
|
202
|
+
var svgCoordinates = isMobile ? {
|
|
203
|
+
x: cx,
|
|
204
|
+
y: cy,
|
|
205
|
+
dimensions: dimensions
|
|
206
|
+
} : undefined;
|
|
207
|
+
handleMouseEnter(e, content, svgCoordinates);
|
|
208
|
+
}
|
|
209
|
+
handleMouseInteraction();
|
|
210
|
+
}, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave }));
|
|
211
|
+
}),
|
|
212
|
+
React__default.createElement(XAxis, { show: showXAxis, data: xAxisData, x: margin.left, y: margin.top + innerHeight, width: innerWidth, categoryWidth: innerWidth / (xAxisData.length - 1), categoryGap: 0, alignWithEdge: true, className: cn(axisClassName) }),
|
|
213
|
+
xLabel && showXAxis && (React__default.createElement("text", { x: margin.left + innerWidth / 2, y: dimensions.height - 5, textAnchor: "middle", className: "text-xs fill-[var(--color-text-secondary)]" }, xLabel)),
|
|
214
|
+
yLabel && showYAxis && (React__default.createElement("text", { x: 15, y: margin.top + innerHeight / 2, textAnchor: "middle", className: "text-xs fill-[var(--color-text-secondary)]", transform: "rotate(-90 15 ".concat(margin.top + innerHeight / 2, ")") }, yLabel))),
|
|
215
|
+
categories.length > 0 && (React__default.createElement("div", { className: theme.legendContainerStyle }, categories.map(function (cat, index) { return (React__default.createElement("div", { key: cat, className: theme.legendItemStyle },
|
|
216
|
+
React__default.createElement("div", { className: theme.legendDotStyle, style: { backgroundColor: getCategoryColor(chartColors, index) } }),
|
|
217
|
+
React__default.createElement("span", { className: theme.legendLabelStyle }, cat))); }))),
|
|
218
|
+
showTooltip && (React__default.createElement(ChartTooltip, { active: !!tooltipData, position: tooltipData ? { x: tooltipData.x, y: tooltipData.y } : { x: 0, y: 0 }, tooltipRef: tooltipRef, content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content, chartType: "scatter" }))));
|
|
219
|
+
};
|
|
220
|
+
ScatterPlot.displayName = 'ScatterPlot';
|
|
221
|
+
|
|
222
|
+
export { ScatterPlot };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScatterPlot Theme - Uses CSS variables for production-ready styling
|
|
3
|
+
*/
|
|
4
|
+
var scatterPlotTheme = {
|
|
5
|
+
containerStyle: 'relative inline-flex flex-col items-center w-full',
|
|
6
|
+
svgStyle: 'overflow-visible',
|
|
7
|
+
emptyStateStyle: 'flex items-center justify-center h-full text-[var(--color-text-muted)] text-sm',
|
|
8
|
+
// Grid styles
|
|
9
|
+
gridLineStyle: 'stroke-[var(--color-border)]',
|
|
10
|
+
// Axis styles
|
|
11
|
+
axisLineStyle: 'stroke-[var(--color-text-secondary)]',
|
|
12
|
+
axisLabelStyle: 'fill-[var(--color-text-secondary)]',
|
|
13
|
+
// Data point styles
|
|
14
|
+
dotStyle: 'fill-opacity-70 stroke-white',
|
|
15
|
+
dotHoverStyle: 'fill-opacity-100',
|
|
16
|
+
// Legend styles
|
|
17
|
+
legendContainerStyle: 'flex flex-wrap gap-3 mt-4 justify-center',
|
|
18
|
+
legendItemStyle: 'flex items-center gap-2',
|
|
19
|
+
legendDotStyle: 'w-3 h-3 rounded-full',
|
|
20
|
+
legendLabelStyle: 'text-sm text-[var(--color-text-secondary)]',
|
|
21
|
+
// Default category colors using CSS variables
|
|
22
|
+
colors: [
|
|
23
|
+
'var(--color-primary)',
|
|
24
|
+
'var(--color-success)',
|
|
25
|
+
'var(--color-warning)',
|
|
26
|
+
'var(--color-danger)',
|
|
27
|
+
'hsl(262, 83%, 58%)', // violet
|
|
28
|
+
'hsl(328, 86%, 70%)', // pink
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Get fill color for category (supports both CSS variables and direct colors)
|
|
33
|
+
*/
|
|
34
|
+
function getCategoryColor(colors, categoryIndex) {
|
|
35
|
+
return colors[categoryIndex % colors.length];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { getCategoryColor, scatterPlotTheme };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __assign } from '/Users/ggn/Development/ui-flik/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { CHART_DEFAULTS } from '../types/chart.types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default values using centralized defaults
|
|
6
|
+
*/
|
|
7
|
+
var SCATTER_PLOT_DEFAULTS = __assign(__assign({}, CHART_DEFAULTS), { dotRadius: 4, pointSize: 4, showTooltip: true });
|
|
8
|
+
|
|
9
|
+
export { SCATTER_PLOT_DEFAULTS };
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { __rest, __assign } from '/Users/ggn/Development/ui-flik/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import React__default, { useState, useEffect, useRef, useMemo } from 'react';
|
|
3
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
|
|
6
|
+
import { useChartAccessibility } from '../hooks/useChartAccessibility.js';
|
|
7
|
+
import { useChartValidation } from '../hooks/useChartValidation.js';
|
|
8
|
+
import { ChartErrorBoundary } from '../shared/ChartErrorBoundary/ChartErrorBoundary.js';
|
|
9
|
+
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
10
|
+
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
11
|
+
import { HorizontalGrid } from '../shared/ChartGrid/HorizontalGrid.js';
|
|
12
|
+
import { ChartTooltip } from '../shared/ChartTooltip/ChartTooltip.js';
|
|
13
|
+
import { STACKED_BAR_CHART_DEFAULTS } from './StackedBarChart.types.js';
|
|
14
|
+
import { ExclamationTriangleIcon } from '@heroicons/react/20/solid';
|
|
15
|
+
|
|
16
|
+
var StackedBarChart = function (_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var data = _a.data, config = _a.config,
|
|
19
|
+
// Standardized display props with defaults
|
|
20
|
+
_c = _a.showGrid,
|
|
21
|
+
// Standardized display props with defaults
|
|
22
|
+
showGrid = _c === void 0 ? STACKED_BAR_CHART_DEFAULTS.showGrid : _c, _d = _a.showXAxis, showXAxis = _d === void 0 ? STACKED_BAR_CHART_DEFAULTS.showXAxis : _d, _e = _a.showYAxis, showYAxis = _e === void 0 ? STACKED_BAR_CHART_DEFAULTS.showYAxis : _e, propMinValue = _a.minValue, propMaxValue = _a.maxValue, _f = _a.variant; _f === void 0 ? STACKED_BAR_CHART_DEFAULTS.variant : _f; _a.theme;
|
|
23
|
+
var // Bar visual props
|
|
24
|
+
_g = _a.barRadius,
|
|
25
|
+
// Bar visual props
|
|
26
|
+
barRadius = _g === void 0 ? STACKED_BAR_CHART_DEFAULTS.barRadius : _g, _h = _a.categoryGap, categoryGap = _h === void 0 ? STACKED_BAR_CHART_DEFAULTS.categoryGap : _h,
|
|
27
|
+
// Stacking behavior
|
|
28
|
+
_j = _a.stackOffset,
|
|
29
|
+
// Stacking behavior
|
|
30
|
+
stackOffset = _j === void 0 ? STACKED_BAR_CHART_DEFAULTS.stackOffset : _j,
|
|
31
|
+
// Animation props
|
|
32
|
+
_k = _a.showAnimation,
|
|
33
|
+
// Animation props
|
|
34
|
+
showAnimation = _k === void 0 ? STACKED_BAR_CHART_DEFAULTS.showAnimation : _k,
|
|
35
|
+
// Base props
|
|
36
|
+
className = _a.className, title = _a.title, description = _a.description, _l = _a.enableKeyboardNavigation, enableKeyboardNavigation = _l === void 0 ? STACKED_BAR_CHART_DEFAULTS.enableKeyboardNavigation : _l, _m = _a.showValidationWarnings, showValidationWarnings = _m === void 0 ? process.env.NODE_ENV === "development" : _m, children = _a.children, props = __rest(_a, ["data", "config", "showGrid", "showXAxis", "showYAxis", "minValue", "maxValue", "variant", "theme", "barRadius", "categoryGap", "stackOffset", "showAnimation", "className", "title", "description", "enableKeyboardNavigation", "showValidationWarnings", "children"]);
|
|
37
|
+
// Animation state
|
|
38
|
+
var shouldReduceMotion = useReducedMotion();
|
|
39
|
+
var _o = useState(false); _o[0]; var setHasAnimated = _o[1];
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
if (!shouldReduceMotion && showAnimation) {
|
|
42
|
+
setHasAnimated(true);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
setHasAnimated(true);
|
|
46
|
+
}
|
|
47
|
+
}, [shouldReduceMotion, showAnimation]);
|
|
48
|
+
// Validate data and config with error handling
|
|
49
|
+
var _p = useChartValidation(data, config, {
|
|
50
|
+
autoSanitize: true,
|
|
51
|
+
logWarnings: true,
|
|
52
|
+
}), validation = _p.validation, sanitizedData = _p.sanitizedData, isValid = _p.isValid, hasWarnings = _p.hasWarnings; _p.safeScale; var safeMath = _p.safeMath;
|
|
53
|
+
// Early return for invalid data
|
|
54
|
+
if (!isValid) {
|
|
55
|
+
return (React__default.createElement("div", __assign({ className: cn("chart-container flex flex-col items-center justify-center p-6 border border-border rounded-lg text-xl", className), role: "alert", "aria-live": "polite" }, props),
|
|
56
|
+
React__default.createElement("div", { className: "flex flex-col items-center gap-4 mb-1" },
|
|
57
|
+
React__default.createElement(ExclamationTriangleIcon, { className: "size-6 text-[var(--color-danger)]" }),
|
|
58
|
+
React__default.createElement("div", { className: "text-sm font-semibold text-[var(--color-text-secondary)]" }, "Invalid Chart Data")),
|
|
59
|
+
React__default.createElement("p", { className: "text-sm text-[var(--color-text-secondary)]/70 mb-2" }, ((_b = validation.errors[0]) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
60
|
+
"Unable to render chart due to data validation errors")));
|
|
61
|
+
}
|
|
62
|
+
// Early return for empty data
|
|
63
|
+
if (!sanitizedData || sanitizedData.length === 0) {
|
|
64
|
+
return (React__default.createElement("div", __assign({ className: cn("chart-container flex items-center justify-center text-[var(--color-text-muted)]", className), role: "img", "aria-label": "Empty stacked bar chart" }, props),
|
|
65
|
+
React__default.createElement("span", null, "No data available")));
|
|
66
|
+
}
|
|
67
|
+
// Color palette using CSS variables
|
|
68
|
+
var getSeriesFillColor = function (index) {
|
|
69
|
+
var colorVars = [
|
|
70
|
+
"var(--color-primary)",
|
|
71
|
+
"var(--color-primary-400)",
|
|
72
|
+
"var(--color-primary-300)",
|
|
73
|
+
"var(--color-primary-200)",
|
|
74
|
+
"var(--color-warning)",
|
|
75
|
+
"var(--color-success)",
|
|
76
|
+
];
|
|
77
|
+
return colorVars[index % colorVars.length];
|
|
78
|
+
};
|
|
79
|
+
var containerRef = useRef(null);
|
|
80
|
+
var _q = useState({ width: 600, height: 400 }), dimensions = _q[0], setDimensions = _q[1];
|
|
81
|
+
var _r = useState(null), hoveredCategory = _r[0], setHoveredCategory = _r[1];
|
|
82
|
+
var isMobile = typeof window !== "undefined" &&
|
|
83
|
+
("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
84
|
+
var _s = useTooltipPosition({
|
|
85
|
+
containerRef: containerRef,
|
|
86
|
+
isMobile: isMobile,
|
|
87
|
+
}), tooltipData = _s.tooltipData, tooltipRef = _s.tooltipRef, handleMouseEnter = _s.handleMouseEnter, handleMouseMove = _s.handleMouseMove, handleMouseLeave = _s.handleMouseLeave;
|
|
88
|
+
var _t = useChartAccessibility({
|
|
89
|
+
chartType: "bar",
|
|
90
|
+
data: sanitizedData,
|
|
91
|
+
config: config,
|
|
92
|
+
title: title,
|
|
93
|
+
description: description,
|
|
94
|
+
enableKeyboardNavigation: enableKeyboardNavigation,
|
|
95
|
+
}), chartAccessibilityProps = _t.chartAccessibilityProps, descriptionProps = _t.descriptionProps, focusedElementIndex = _t.focusedElementIndex, isKeyboardMode = _t.isKeyboardMode, handleMouseInteraction = _t.handleMouseInteraction;
|
|
96
|
+
// Measure container dimensions
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
var updateDimensions = function () {
|
|
99
|
+
if (containerRef.current) {
|
|
100
|
+
var _a = containerRef.current.getBoundingClientRect(), width = _a.width, height = _a.height;
|
|
101
|
+
setDimensions({
|
|
102
|
+
width: width || 600,
|
|
103
|
+
height: height || 400,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
updateDimensions();
|
|
108
|
+
var resizeObserver = new ResizeObserver(updateDimensions);
|
|
109
|
+
if (containerRef.current) {
|
|
110
|
+
resizeObserver.observe(containerRef.current);
|
|
111
|
+
}
|
|
112
|
+
return function () {
|
|
113
|
+
resizeObserver.disconnect();
|
|
114
|
+
};
|
|
115
|
+
}, []);
|
|
116
|
+
// Calculate dimensions
|
|
117
|
+
var margin = {
|
|
118
|
+
top: 15,
|
|
119
|
+
right: showYAxis ? 20 : 0,
|
|
120
|
+
bottom: showXAxis ? 20 : 0,
|
|
121
|
+
left: showYAxis ? 60 : 0,
|
|
122
|
+
};
|
|
123
|
+
var innerWidth = Math.max(0, dimensions.width - margin.left - margin.right);
|
|
124
|
+
var innerHeight = Math.max(0, dimensions.height - margin.top - margin.bottom);
|
|
125
|
+
// Get all data keys from config
|
|
126
|
+
var dataKeys = Object.keys(config || {});
|
|
127
|
+
// Animation timing
|
|
128
|
+
var BAR_STAGGER = 0.08;
|
|
129
|
+
// Calculate stacked values for each data point
|
|
130
|
+
var getStackedValues = useMemo(function () {
|
|
131
|
+
var stackedData = {};
|
|
132
|
+
sanitizedData.forEach(function (item, dataIndex) {
|
|
133
|
+
var cumulativeValue = 0;
|
|
134
|
+
dataKeys.forEach(function (key) {
|
|
135
|
+
if (!stackedData[key]) {
|
|
136
|
+
stackedData[key] = [];
|
|
137
|
+
}
|
|
138
|
+
var rawValue = item[key];
|
|
139
|
+
var value = typeof rawValue === "number" && isFinite(rawValue) ? rawValue : 0;
|
|
140
|
+
stackedData[key][dataIndex] = {
|
|
141
|
+
base: cumulativeValue,
|
|
142
|
+
top: cumulativeValue + value,
|
|
143
|
+
};
|
|
144
|
+
cumulativeValue += value;
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
return stackedData;
|
|
148
|
+
}, [sanitizedData, dataKeys]);
|
|
149
|
+
// Calculate max stacked value for scale
|
|
150
|
+
var maxStackedValue = useMemo(function () {
|
|
151
|
+
var max = 0;
|
|
152
|
+
sanitizedData.forEach(function (item) {
|
|
153
|
+
var sum = 0;
|
|
154
|
+
dataKeys.forEach(function (key) {
|
|
155
|
+
var rawValue = item[key];
|
|
156
|
+
var value = typeof rawValue === "number" && isFinite(rawValue) ? rawValue : 0;
|
|
157
|
+
sum += value;
|
|
158
|
+
});
|
|
159
|
+
if (sum > max)
|
|
160
|
+
max = sum;
|
|
161
|
+
});
|
|
162
|
+
return max;
|
|
163
|
+
}, [sanitizedData, dataKeys]);
|
|
164
|
+
// Apply stackOffset if needed
|
|
165
|
+
var getScaledMaxValue = function () {
|
|
166
|
+
if (stackOffset === "expand") {
|
|
167
|
+
return 100; // Normalize to 100%
|
|
168
|
+
}
|
|
169
|
+
return propMaxValue !== null && propMaxValue !== void 0 ? propMaxValue : maxStackedValue;
|
|
170
|
+
};
|
|
171
|
+
var minValue = propMinValue !== null && propMinValue !== void 0 ? propMinValue : 0;
|
|
172
|
+
var maxValue = getScaledMaxValue();
|
|
173
|
+
// Safe bar width calculations
|
|
174
|
+
var totalCategoryGap = Math.max(0, (sanitizedData.length - 1) * categoryGap);
|
|
175
|
+
var availableWidth = Math.max(0, innerWidth - totalCategoryGap);
|
|
176
|
+
var barWidth = safeMath.divide(availableWidth, sanitizedData.length, 0);
|
|
177
|
+
// Helper function to create a path for bars with only top corners rounded
|
|
178
|
+
var createRoundedTopBarPath = function (x, y, width, height, radius) {
|
|
179
|
+
var r = Math.min(radius, width / 2, height / 2);
|
|
180
|
+
return "\n M ".concat(x, ",").concat(y + height, "\n L ").concat(x, ",").concat(y + r, "\n Q ").concat(x, ",").concat(y, " ").concat(x + r, ",").concat(y, "\n L ").concat(x + width - r, ",").concat(y, "\n Q ").concat(x + width, ",").concat(y, " ").concat(x + width, ",").concat(y + r, "\n L ").concat(x + width, ",").concat(y + height, "\n Z\n ").trim();
|
|
181
|
+
};
|
|
182
|
+
// Helper function to create a rectangular path (no rounded corners)
|
|
183
|
+
var createRectPath = function (x, y, width, height) {
|
|
184
|
+
return "\n M ".concat(x, ",").concat(y + height, "\n L ").concat(x, ",").concat(y, "\n L ").concat(x + width, ",").concat(y, "\n L ").concat(x + width, ",").concat(y + height, "\n Z\n ").trim();
|
|
185
|
+
};
|
|
186
|
+
// Render stacked bars
|
|
187
|
+
var renderStackedBar = function (item, categoryIndex, x) {
|
|
188
|
+
var isHovered = hoveredCategory === categoryIndex;
|
|
189
|
+
var isAnyBarHovered = hoveredCategory !== null;
|
|
190
|
+
var shouldReduceOpacity = isAnyBarHovered && !isHovered;
|
|
191
|
+
var isFocused = isKeyboardMode && focusedElementIndex === categoryIndex;
|
|
192
|
+
var range = maxValue - minValue;
|
|
193
|
+
return (React__default.createElement("g", { key: categoryIndex }, dataKeys.map(function (key, keyIndex) {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
var stackData = (_a = getStackedValues[key]) === null || _a === void 0 ? void 0 : _a[categoryIndex];
|
|
196
|
+
if (!stackData)
|
|
197
|
+
return null;
|
|
198
|
+
var baseValue = stackData.base;
|
|
199
|
+
var topValue = stackData.top;
|
|
200
|
+
// Apply expand offset (normalize to percentage)
|
|
201
|
+
if (stackOffset === "expand") {
|
|
202
|
+
var totalForCategory = dataKeys.reduce(function (sum, k) {
|
|
203
|
+
var rawVal = item[k];
|
|
204
|
+
return (sum +
|
|
205
|
+
(typeof rawVal === "number" && isFinite(rawVal) ? rawVal : 0));
|
|
206
|
+
}, 0);
|
|
207
|
+
if (totalForCategory > 0) {
|
|
208
|
+
baseValue = (stackData.base / totalForCategory) * 100;
|
|
209
|
+
topValue = (stackData.top / totalForCategory) * 100;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
var barHeight = range > 0
|
|
213
|
+
? safeMath.scale(topValue - baseValue, 0, range, 0, innerHeight)
|
|
214
|
+
: 0;
|
|
215
|
+
var barY = margin.top +
|
|
216
|
+
innerHeight -
|
|
217
|
+
safeMath.scale(topValue, minValue, maxValue, 0, innerHeight);
|
|
218
|
+
var isTopSegment = keyIndex === dataKeys.length - 1;
|
|
219
|
+
var pathD = isTopSegment
|
|
220
|
+
? createRoundedTopBarPath(x, barY, barWidth, barHeight, barRadius)
|
|
221
|
+
: createRectPath(x, barY, barWidth, barHeight);
|
|
222
|
+
var fillColor = ((_b = config[key]) === null || _b === void 0 ? void 0 : _b.color) || getSeriesFillColor(keyIndex);
|
|
223
|
+
var delay = categoryIndex * BAR_STAGGER;
|
|
224
|
+
return (React__default.createElement(motion.path, { key: key, d: pathD, initial: showAnimation && !shouldReduceMotion
|
|
225
|
+
? { scaleY: 0, opacity: 0 }
|
|
226
|
+
: { scaleY: 1, opacity: 1 }, animate: {
|
|
227
|
+
scaleY: 1,
|
|
228
|
+
opacity: 1,
|
|
229
|
+
}, transition: {
|
|
230
|
+
type: "spring",
|
|
231
|
+
stiffness: 100,
|
|
232
|
+
damping: 20,
|
|
233
|
+
delay: delay,
|
|
234
|
+
}, className: cn("transition-colors duration-200 cursor-pointer", isFocused && "stroke-2"), style: {
|
|
235
|
+
originY: 1,
|
|
236
|
+
transformOrigin: "bottom",
|
|
237
|
+
fill: shouldReduceOpacity
|
|
238
|
+
? "var(--color-background-tertiary)"
|
|
239
|
+
: fillColor,
|
|
240
|
+
opacity: shouldReduceOpacity ? 0.9 : 1,
|
|
241
|
+
stroke: isFocused ? "var(--color-primary)" : "none",
|
|
242
|
+
}, onMouseEnter: function (e) {
|
|
243
|
+
setHoveredCategory(categoryIndex);
|
|
244
|
+
// Create tooltip content with all series
|
|
245
|
+
var series = dataKeys.map(function (dataKey, idx) {
|
|
246
|
+
var _a, _b;
|
|
247
|
+
var rawValue = item[dataKey];
|
|
248
|
+
var value = typeof rawValue === "number" && isFinite(rawValue)
|
|
249
|
+
? rawValue
|
|
250
|
+
: 0;
|
|
251
|
+
return {
|
|
252
|
+
key: dataKey,
|
|
253
|
+
label: ((_a = config[dataKey]) === null || _a === void 0 ? void 0 : _a.label) || dataKey,
|
|
254
|
+
value: value,
|
|
255
|
+
color: ((_b = config[dataKey]) === null || _b === void 0 ? void 0 : _b.color) || getSeriesFillColor(idx),
|
|
256
|
+
};
|
|
257
|
+
});
|
|
258
|
+
// Calculate total
|
|
259
|
+
var total = series.reduce(function (sum, s) { return sum + s.value; }, 0);
|
|
260
|
+
var content = {
|
|
261
|
+
category: item.name || "Category ".concat(categoryIndex + 1),
|
|
262
|
+
series: series,
|
|
263
|
+
total: total,
|
|
264
|
+
};
|
|
265
|
+
var svgCoordinates = {
|
|
266
|
+
x: x + barWidth / 2,
|
|
267
|
+
y: barY,
|
|
268
|
+
dimensions: dimensions,
|
|
269
|
+
};
|
|
270
|
+
handleMouseEnter(e, content, svgCoordinates);
|
|
271
|
+
}, onMouseMove: function (e) {
|
|
272
|
+
if (hoveredCategory === categoryIndex) {
|
|
273
|
+
var svgCoordinates = {
|
|
274
|
+
x: x + barWidth / 2,
|
|
275
|
+
y: barY,
|
|
276
|
+
dimensions: dimensions,
|
|
277
|
+
};
|
|
278
|
+
handleMouseMove(e, svgCoordinates);
|
|
279
|
+
}
|
|
280
|
+
}, onMouseLeave: function () {
|
|
281
|
+
setHoveredCategory(null);
|
|
282
|
+
handleMouseLeave();
|
|
283
|
+
} }));
|
|
284
|
+
})));
|
|
285
|
+
};
|
|
286
|
+
return (React__default.createElement(ChartErrorBoundary, { className: className, showErrorDetails: process.env.NODE_ENV === "development" },
|
|
287
|
+
React__default.createElement("div", __assign({ ref: containerRef, className: cn("chart-container w-full h-full", className) }, chartAccessibilityProps, { onMouseEnter: handleMouseInteraction, onMouseMove: handleMouseInteraction }, props),
|
|
288
|
+
descriptionProps && React__default.createElement("div", __assign({}, descriptionProps)),
|
|
289
|
+
showValidationWarnings && hasWarnings && (React__default.createElement("div", { className: "absolute top-2 left-2 right-2 z-10 p-2 bg-[var(--color-warning-50)] border border-[var(--color-warning-200)] rounded text-xs text-[var(--color-warning)] shadow-sm" },
|
|
290
|
+
React__default.createElement("strong", null, "Chart Warnings:"),
|
|
291
|
+
React__default.createElement("ul", { className: "mt-1" }, validation.warnings.map(function (warning, index) { return (React__default.createElement("li", { key: index },
|
|
292
|
+
"\u2022 ",
|
|
293
|
+
warning.message)); })))),
|
|
294
|
+
React__default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 ".concat(dimensions.width, " ").concat(dimensions.height) },
|
|
295
|
+
React__default.createElement(HorizontalGrid, { show: showGrid, x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, lineCount: 5 }),
|
|
296
|
+
React__default.createElement(YAxis, { show: showYAxis, min: minValue, max: maxValue, x: margin.left, y: margin.top, height: innerHeight, showGrid: false, gridWidth: innerWidth, tickFormatter: function (value) {
|
|
297
|
+
if (stackOffset === "expand")
|
|
298
|
+
return "".concat(value, "%");
|
|
299
|
+
if (value >= 1000)
|
|
300
|
+
return "".concat((value / 1000).toFixed(0), "k");
|
|
301
|
+
return value.toString();
|
|
302
|
+
} }),
|
|
303
|
+
React__default.createElement("g", { className: "chart-bars" }, sanitizedData.map(function (item, index) {
|
|
304
|
+
var x = margin.left + index * (barWidth + categoryGap);
|
|
305
|
+
return renderStackedBar(item, index, x);
|
|
306
|
+
})),
|
|
307
|
+
React__default.createElement(XAxis, { show: showXAxis, data: sanitizedData, x: margin.left, y: margin.top + innerHeight, width: innerWidth, categoryWidth: barWidth, categoryGap: categoryGap })),
|
|
308
|
+
React__default.createElement(ChartTooltip, { tooltipRef: tooltipRef, content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content, active: !!tooltipData, position: tooltipData
|
|
309
|
+
? { x: tooltipData.x, y: tooltipData.y }
|
|
310
|
+
: { x: 0, y: 0 } }),
|
|
311
|
+
children)));
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export { StackedBarChart };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseChartProps, StandardChartDisplayProps, StandardVisualProps, BarChartSpecificProps } from "../types/chart.types";
|
|
2
|
+
export type StackOffset = "none" | "expand" | "wiggle" | "silhouette";
|
|
3
|
+
export interface StackedBarChartProps extends BaseChartProps, StandardChartDisplayProps, StandardVisualProps, BarChartSpecificProps {
|
|
4
|
+
barRadius?: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
categoryGap?: number;
|
|
7
|
+
stackOffset?: StackOffset;
|
|
8
|
+
showAnimation?: boolean;
|
|
9
|
+
showValidationWarnings?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const STACKED_BAR_CHART_DEFAULTS: {
|
|
12
|
+
readonly barRadius: 32;
|
|
13
|
+
readonly gap: 4;
|
|
14
|
+
readonly categoryGap: 16;
|
|
15
|
+
readonly orientation: "horizontal" | "vertical";
|
|
16
|
+
readonly stackOffset: StackOffset;
|
|
17
|
+
readonly showAnimation: true;
|
|
18
|
+
readonly showGrid: true;
|
|
19
|
+
readonly showXAxis: true;
|
|
20
|
+
readonly showYAxis: true;
|
|
21
|
+
readonly dotRadius: 4;
|
|
22
|
+
readonly cellRadius: 4;
|
|
23
|
+
readonly radius: 20;
|
|
24
|
+
readonly strokeWidth: 2;
|
|
25
|
+
readonly curved: true;
|
|
26
|
+
readonly curveType: import("../types/chart.types").CurveType;
|
|
27
|
+
readonly fillOpacity: 0.3;
|
|
28
|
+
readonly showStroke: true;
|
|
29
|
+
readonly showDots: true;
|
|
30
|
+
readonly stacked: false;
|
|
31
|
+
readonly variant: import("../types/chart.types").ChartVariant;
|
|
32
|
+
readonly enableKeyboardNavigation: true;
|
|
33
|
+
};
|
|
34
|
+
export type StackedBarChartData = BaseChartProps["data"][0];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from '/Users/ggn/Development/ui-flik/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { CHART_DEFAULTS } from '../types/chart.types.js';
|
|
3
|
+
|
|
4
|
+
// Default values using centralized defaults
|
|
5
|
+
var STACKED_BAR_CHART_DEFAULTS = __assign(__assign({}, CHART_DEFAULTS), { barRadius: CHART_DEFAULTS.barRadius, gap: CHART_DEFAULTS.gap, categoryGap: CHART_DEFAULTS.categoryGap, orientation: CHART_DEFAULTS.orientation, stackOffset: "none", showAnimation: true });
|
|
6
|
+
|
|
7
|
+
export { STACKED_BAR_CHART_DEFAULTS };
|