@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +375 -5
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +40 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +73 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +3 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +14 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +6 -2
- package/dist/components/ai/index.js +10 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +2 -3
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -3
- package/dist/components/canvas/NodeRenderer.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +24 -35
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +10 -22
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +13 -32
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +10 -7
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +16 -11
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +11 -28
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +151 -133
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +12 -6
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +10 -8
- package/dist/components/charts/index.js +8 -4
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +21 -26
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -21
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +3 -3
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -3
- package/dist/components/core/Alert/Alert.animations.js +30 -8
- package/dist/components/core/Alert/Alert.js +23 -9
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -82
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +33 -65
- package/dist/components/core/Badge/Badge.theme.js +26 -24
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +6 -6
- package/dist/components/core/Button/Button.js +14 -58
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +35 -22
- package/dist/components/core/Button/Button.types.d.ts +26 -13
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +15 -23
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +40 -4
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +22 -9
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -3
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +7 -5
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +4 -2
- package/dist/components/core/Message/Message.theme.js +8 -10
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +6 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +4 -2
- package/dist/components/core/NavItem/NavItem.js +8 -7
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +27 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +5 -5
- package/dist/components/core/Pill/Pill.js +5 -2
- package/dist/components/core/Pill/Pill.theme.js +9 -5
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +2 -2
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +10 -7
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +3 -3
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +4 -4
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +3 -3
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +5 -3
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +7 -7
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -3
- package/dist/components/data-display/KPI/KPI.js +12 -21
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +11 -11
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -3
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +13 -6
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +4 -4
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +3 -3
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +4 -4
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +7 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1681
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +14 -13
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +74 -8
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +3 -2
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/TimePicker/TimePicker.theme.js +7 -8
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +38 -13
- package/dist/components/forms/index.js +2 -1
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +197 -4
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2522 -328
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +2522 -328
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +2 -5
- package/dist/registry.json +3262 -2464
- package/dist/shadcn-compat.css +6 -6
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +2557 -328
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/dist/utils/index.d.ts +0 -1
- package/package.json +39 -6
- package/src/global.scss +32 -28
- package/src/styles/theme.css +547 -176
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +66 -38
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -207
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -65
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -12
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -144,21 +144,6 @@ const CROSSHAIR_FOLLOW_TRANSITION = {
|
|
|
144
144
|
duration: 0.2,
|
|
145
145
|
ease: "easeOut",
|
|
146
146
|
};
|
|
147
|
-
/** Tooltip pop-in: springy position/scale with a quick opacity/scale settle. */
|
|
148
|
-
const TOOLTIP_ENTER_TRANSITION = {
|
|
149
|
-
type: "spring",
|
|
150
|
-
stiffness: 400,
|
|
151
|
-
damping: 30,
|
|
152
|
-
opacity: { duration: 0.15 },
|
|
153
|
-
scale: { duration: 0.15 },
|
|
154
|
-
};
|
|
155
|
-
/** Tooltip pop-out. */
|
|
156
|
-
const TOOLTIP_EXIT_TRANSITION = {
|
|
157
|
-
type: "spring",
|
|
158
|
-
stiffness: 300,
|
|
159
|
-
damping: 25,
|
|
160
|
-
duration: 0.15,
|
|
161
|
-
};
|
|
162
147
|
/** Circular-chart segment hover dim/lift (opacity fade + scale pop). */
|
|
163
148
|
const SEGMENT_HOVER_TRANSITION = {
|
|
164
149
|
scale: { duration: 0.2 },
|
|
@@ -178,15 +163,10 @@ const CARTESIAN_ENTRANCE_DURATION = 0.7;
|
|
|
178
163
|
const LINE_DOT_STAGGER = 0.06;
|
|
179
164
|
/** Grouped-bar stagger (BarChart + shared BarRenderer grouped path). */
|
|
180
165
|
const BAR_GROUP_STAGGER = 0.05;
|
|
181
|
-
/** Stacked-bar per-category stagger (StackedBarChart). */
|
|
182
|
-
const STACKED_BAR_STAGGER = 0.08;
|
|
183
166
|
/** Shared BarRenderer stacked-mode per-category delay. */
|
|
184
167
|
const BAR_STACK_CATEGORY_DELAY = 0.25;
|
|
185
168
|
/** Shared BarRenderer stacked-mode per-segment stagger. */
|
|
186
169
|
const BAR_STACK_SEGMENT_STAGGER = 0.12;
|
|
187
|
-
/** ScatterPlot per-point stagger + grow duration. */
|
|
188
|
-
const SCATTER_POINT_STAGGER = 0.01;
|
|
189
|
-
const SCATTER_POINT_DURATION = 0.3;
|
|
190
170
|
/** Marker pop-in spring (line/area dots). */
|
|
191
171
|
const DOT_SPRING = { type: "spring", stiffness: 260, damping: 20 };
|
|
192
172
|
/** Bar grow spring (grouped bars / stacked columns). */
|
|
@@ -260,5 +240,23 @@ function stackedSegmentTransition(delay, hasAnimated) {
|
|
|
260
240
|
},
|
|
261
241
|
};
|
|
262
242
|
}
|
|
243
|
+
/* ── Heatmap ───────────────────────────────────────────────────────────────
|
|
244
|
+
* Cells fade in along the (row + col) diagonal. Deterministic on purpose: the
|
|
245
|
+
* delay used to come from Math.random(), which mismatched between the server
|
|
246
|
+
* and client renders and made every snapshot non-reproducible. */
|
|
247
|
+
/** Heatmap cell fade-in duration (seconds). */
|
|
248
|
+
const HEATMAP_CELL_FADE_DURATION = 0.35;
|
|
249
|
+
/** Per-diagonal stagger for the heatmap cell entrance (seconds). */
|
|
250
|
+
const HEATMAP_CELL_STAGGER = 0.02;
|
|
251
|
+
/** Cap on the entrance stagger, so a large grid still settles quickly (seconds). */
|
|
252
|
+
const HEATMAP_CELL_MAX_DELAY = 0.3;
|
|
253
|
+
/** Deterministic entrance delay for the cell at (row, col). */
|
|
254
|
+
function heatmapCellDelay(row, col) {
|
|
255
|
+
return Math.min((row + col) * HEATMAP_CELL_STAGGER, HEATMAP_CELL_MAX_DELAY);
|
|
256
|
+
}
|
|
257
|
+
/** Cell hover scale-up (`whileHover`). */
|
|
258
|
+
const HEATMAP_CELL_HOVER_TRANSITION = { duration: 0.15, ease: "easeOut" };
|
|
259
|
+
/** Cell press scale-down (`whileTap`). */
|
|
260
|
+
const HEATMAP_CELL_TAP_TRANSITION = { duration: 0.1, ease: "easeOut" };
|
|
263
261
|
|
|
264
|
-
export { BAR_GROUP_STAGGER, BAR_SPRING, BAR_STACK_CATEGORY_DELAY, BAR_STACK_SEGMENT_STAGGER, CARTESIAN_ENTRANCE_DURATION, CIRCULAR_CHART_ANIMATIONS, CROSSHAIR_FADE_TRANSITION, CROSSHAIR_FOLLOW_TRANSITION, DOT_SPRING, HALO_FADE_TRANSITION,
|
|
262
|
+
export { BAR_GROUP_STAGGER, BAR_SPRING, BAR_STACK_CATEGORY_DELAY, BAR_STACK_SEGMENT_STAGGER, CARTESIAN_ENTRANCE_DURATION, CIRCULAR_CHART_ANIMATIONS, CROSSHAIR_FADE_TRANSITION, CROSSHAIR_FOLLOW_TRANSITION, DOT_SPRING, HALO_FADE_TRANSITION, HEATMAP_CELL_FADE_DURATION, HEATMAP_CELL_HOVER_TRANSITION, HEATMAP_CELL_MAX_DELAY, HEATMAP_CELL_STAGGER, HEATMAP_CELL_TAP_TRANSITION, LINE_DOT_STAGGER, RING_FADE_TRANSITION, RISE_FROM_BASELINE, SCALE_FROM_CENTER, SEGMENT_HOVER_TRANSITION, SPRING_PRESETS, barEntranceTransition, dotEntranceTransition, getSpringAnimation, getStaggerDelay, heatmapCellDelay, riseTransition, stackedSegmentTransition };
|
|
@@ -25,6 +25,16 @@ export interface BarEmphasisInput {
|
|
|
25
25
|
isFocused: boolean;
|
|
26
26
|
isAnyBarHovered: boolean;
|
|
27
27
|
isGradientVariant: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether hover/focus gets the premium emphasis (glow ring + colored stroke + the
|
|
30
|
+
* stronger sibling dim). Defaults to `isGradientVariant`, since for column bars the
|
|
31
|
+
* two travel together — so BarChart and ComboChart are unaffected.
|
|
32
|
+
*
|
|
33
|
+
* Pass it explicitly for a chart whose fills are flat but which still wants the
|
|
34
|
+
* premium hover (HorizontalBarChart). The two really are separate axes: "how the bar
|
|
35
|
+
* is painted" vs "how it responds to hover".
|
|
36
|
+
*/
|
|
37
|
+
premiumEmphasis?: boolean;
|
|
28
38
|
}
|
|
29
39
|
export interface BarEmphasisState {
|
|
30
40
|
/** Hover OR keyboard focus, gradient variant only — drives ring + stroke. */
|
|
@@ -32,7 +42,7 @@ export interface BarEmphasisState {
|
|
|
32
42
|
/** A sibling is hovered and this bar isn't — drives the dim. */
|
|
33
43
|
shouldReduceOpacity: boolean;
|
|
34
44
|
}
|
|
35
|
-
export declare function deriveBarEmphasis({ isHovered, isFocused, isAnyBarHovered, isGradientVariant, }: BarEmphasisInput): BarEmphasisState;
|
|
45
|
+
export declare function deriveBarEmphasis({ isHovered, isFocused, isAnyBarHovered, isGradientVariant, premiumEmphasis, }: BarEmphasisInput): BarEmphasisState;
|
|
36
46
|
/**
|
|
37
47
|
* Animated hover-dim opacity. Belongs in the motion `animate` prop, not
|
|
38
48
|
* `style` — motion.path freezes plain style values at mount.
|
|
@@ -46,17 +56,36 @@ export declare function barFill({ isGradientVariant, gradientFill, isNull, shoul
|
|
|
46
56
|
shouldReduceOpacity: boolean;
|
|
47
57
|
fillColor: string;
|
|
48
58
|
}): string;
|
|
49
|
-
/**
|
|
50
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Stroke cascade: keyboard-focus ring › emphasis › resting hairline › none.
|
|
61
|
+
*
|
|
62
|
+
* `showRestingStroke` (default `true`) keeps the resting white hairline that gradient
|
|
63
|
+
* column bars carry. Set it `false` for bars that should read as flat shapes with no
|
|
64
|
+
* outline at rest — the focus and emphasis strokes still apply, so keyboard focus stays
|
|
65
|
+
* visible either way. Prefer this flag over re-deriving the cascade at a call site:
|
|
66
|
+
* the two hand-copies of this logic drifted once already (§19).
|
|
67
|
+
*/
|
|
68
|
+
export declare function barStrokeStyle({ isFocused, isEmphasized, isGradientVariant, fillColor, showRestingStroke, }: {
|
|
51
69
|
isFocused: boolean;
|
|
52
70
|
isEmphasized: boolean;
|
|
53
71
|
isGradientVariant: boolean;
|
|
54
72
|
fillColor: string;
|
|
73
|
+
showRestingStroke?: boolean;
|
|
55
74
|
}): {
|
|
56
75
|
stroke: string;
|
|
57
76
|
strokeWidth: number | undefined;
|
|
58
77
|
strokeOpacity: number;
|
|
59
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* The hover glow-ring filter alone. Split out of `BarSeriesDefs` so a chart with FLAT
|
|
81
|
+
* fills can still render the premium hover ring without emitting a gradient def it
|
|
82
|
+
* never references — `BarSeriesDefs` composes it, so both paths stay single-sourced
|
|
83
|
+
* and the ring can't drift between them.
|
|
84
|
+
*/
|
|
85
|
+
export declare const BarRingDef: React.FC<{
|
|
86
|
+
ringId: string;
|
|
87
|
+
color: string;
|
|
88
|
+
}>;
|
|
60
89
|
/**
|
|
61
90
|
* Per-series SVG defs for the gradient variant: vertical gradient fill,
|
|
62
91
|
* colored drop shadow, and the hover glow-ring filter. Render inside <defs>.
|
|
@@ -16,9 +16,9 @@ const BAR_RING_STROKE_OPACITY = 0.24;
|
|
|
16
16
|
function barRingStrokeWidth(barWidth) {
|
|
17
17
|
return Math.min(14, Math.max(8, barWidth * 0.08));
|
|
18
18
|
}
|
|
19
|
-
function deriveBarEmphasis({ isHovered, isFocused, isAnyBarHovered, isGradientVariant, }) {
|
|
19
|
+
function deriveBarEmphasis({ isHovered, isFocused, isAnyBarHovered, isGradientVariant, premiumEmphasis = isGradientVariant, }) {
|
|
20
20
|
return {
|
|
21
|
-
isEmphasized:
|
|
21
|
+
isEmphasized: premiumEmphasis && (isHovered || isFocused),
|
|
22
22
|
shouldReduceOpacity: isAnyBarHovered && !isHovered,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -41,29 +41,45 @@ function barFill({ isGradientVariant, gradientFill, isNull, shouldReduceOpacity,
|
|
|
41
41
|
? "var(--color-surface-sunken)"
|
|
42
42
|
: fillColor;
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Stroke cascade: keyboard-focus ring › emphasis › resting hairline › none.
|
|
46
|
+
*
|
|
47
|
+
* `showRestingStroke` (default `true`) keeps the resting white hairline that gradient
|
|
48
|
+
* column bars carry. Set it `false` for bars that should read as flat shapes with no
|
|
49
|
+
* outline at rest — the focus and emphasis strokes still apply, so keyboard focus stays
|
|
50
|
+
* visible either way. Prefer this flag over re-deriving the cascade at a call site:
|
|
51
|
+
* the two hand-copies of this logic drifted once already (§19).
|
|
52
|
+
*/
|
|
53
|
+
function barStrokeStyle({ isFocused, isEmphasized, isGradientVariant, fillColor, showRestingStroke = true, }) {
|
|
54
|
+
const hasRestingStroke = isGradientVariant && showRestingStroke;
|
|
46
55
|
return {
|
|
47
56
|
stroke: isFocused
|
|
48
57
|
? "var(--color-primary)"
|
|
49
58
|
: isEmphasized
|
|
50
59
|
? fillColor
|
|
51
|
-
:
|
|
60
|
+
: hasRestingStroke
|
|
52
61
|
? BAR_RESTING_STROKE
|
|
53
62
|
: "none",
|
|
54
|
-
strokeWidth: isFocused ? 3 : isEmphasized ? 2 :
|
|
63
|
+
strokeWidth: isFocused ? 3 : isEmphasized ? 2 : hasRestingStroke ? 1 : undefined,
|
|
55
64
|
strokeOpacity: isEmphasized ? BAR_EMPHASIS_STROKE_OPACITY : 1,
|
|
56
65
|
};
|
|
57
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The hover glow-ring filter alone. Split out of `BarSeriesDefs` so a chart with FLAT
|
|
69
|
+
* fills can still render the premium hover ring without emitting a gradient def it
|
|
70
|
+
* never references — `BarSeriesDefs` composes it, so both paths stay single-sourced
|
|
71
|
+
* and the ring can't drift between them.
|
|
72
|
+
*/
|
|
73
|
+
const BarRingDef = ({ ringId, color, }) => (jsxs("filter", { id: ringId, x: "-25%", y: "-25%", width: "150%", height: "165%", colorInterpolationFilters: "sRGB", children: [jsx("feDropShadow", { dx: "0", dy: "0", stdDeviation: "4", floodColor: color, floodOpacity: "0.42" }), jsx("feDropShadow", { dx: "0", dy: "10", stdDeviation: "8", floodColor: color, floodOpacity: "0.18" })] }));
|
|
58
74
|
/**
|
|
59
75
|
* Per-series SVG defs for the gradient variant: vertical gradient fill,
|
|
60
76
|
* colored drop shadow, and the hover glow-ring filter. Render inside <defs>.
|
|
61
77
|
*/
|
|
62
|
-
const BarSeriesDefs = ({ gradientId, shadowId, ringId, color }) => (jsxs(Fragment, { children: [jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [jsx("stop", { offset: "0%", stopColor: color, stopOpacity: "0.46" }), jsx("stop", { offset: "14%", stopColor: color, stopOpacity: "0.9" }), jsx("stop", { offset: "42%", stopColor: color, stopOpacity: "1" }), jsx("stop", { offset: "72%", stopColor: color, stopOpacity: "0.96" }), jsx("stop", { offset: "100%", stopColor: color, stopOpacity: "0.82" })] }), jsx("filter", { id: shadowId, x: "-35%", y: "-35%", width: "170%", height: "190%", colorInterpolationFilters: "sRGB", children: jsx("feDropShadow", { dx: "0", dy: "10", stdDeviation: "8", floodColor: color, floodOpacity: "0.22" }) }),
|
|
78
|
+
const BarSeriesDefs = ({ gradientId, shadowId, ringId, color }) => (jsxs(Fragment, { children: [jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [jsx("stop", { offset: "0%", stopColor: color, stopOpacity: "0.46" }), jsx("stop", { offset: "14%", stopColor: color, stopOpacity: "0.9" }), jsx("stop", { offset: "42%", stopColor: color, stopOpacity: "1" }), jsx("stop", { offset: "72%", stopColor: color, stopOpacity: "0.96" }), jsx("stop", { offset: "100%", stopColor: color, stopOpacity: "0.82" })] }), jsx("filter", { id: shadowId, x: "-35%", y: "-35%", width: "170%", height: "190%", colorInterpolationFilters: "sRGB", children: jsx("feDropShadow", { dx: "0", dy: "10", stdDeviation: "8", floodColor: color, floodOpacity: "0.22" }) }), jsx(BarRingDef, { ringId: ringId, color: color })] }));
|
|
63
79
|
/**
|
|
64
80
|
* Hover/focus glow ring behind an emphasized bar. Mount/unmount it via
|
|
65
81
|
* `show` — enter/exit fades are handled internally.
|
|
66
82
|
*/
|
|
67
83
|
const BarGlowRing = ({ show, pathD, color, barWidth, filter }) => (jsx(AnimatePresence, { children: show && (jsx(motion.path, { d: pathD, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: RING_FADE_TRANSITION, fill: "none", stroke: color, strokeWidth: barRingStrokeWidth(barWidth), strokeOpacity: BAR_RING_STROKE_OPACITY, strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", filter: filter, style: { pointerEvents: "none" } })) }));
|
|
68
84
|
|
|
69
|
-
export { BAR_DIM_OPACITY_FLAT, BAR_DIM_OPACITY_GRADIENT, BAR_EMPHASIS_STROKE_OPACITY, BAR_RESTING_STROKE, BAR_RING_STROKE_OPACITY, BarGlowRing, BarSeriesDefs, barDimOpacity, barFill, barRingStrokeWidth, barStrokeStyle, deriveBarEmphasis };
|
|
85
|
+
export { BAR_DIM_OPACITY_FLAT, BAR_DIM_OPACITY_GRADIENT, BAR_EMPHASIS_STROKE_OPACITY, BAR_RESTING_STROKE, BAR_RING_STROKE_OPACITY, BarGlowRing, BarRingDef, BarSeriesDefs, barDimOpacity, barFill, barRingStrokeWidth, barStrokeStyle, deriveBarEmphasis };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { resolveSeriesColor } from "./series-color";
|
|
1
2
|
export { extractFillClass, extractStrokeClass, colorClassToVariable, combineClasses, createColorClass, generateSeriesColors, DEFAULT_CHART_COLORS, EXTENDED_CHART_COLORS, MINIMAL_CHART_COLORS, generateColorPalette, getContrastColor, } from './color-utils';
|
|
2
3
|
export { SafeMath, validateChart, validateChartData, validateChartConfig, validateDataConfigCompatibility, sanitizeChartData, calculateSafeScaleRange, niceNum, generateNiceTicks, type ChartValidationError, type ChartValidationResult, } from './chart-validation';
|
|
3
4
|
export { getSpringAnimation, getUseSpringConfig, getStaggerDelay, SPRING_PRESETS, CIRCULAR_CHART_ANIMATIONS, type SpringConfig, type NoAnimationConfig, type AnimationPreset, } from './animation-utils';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartConfig } from "../types/chart.types";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the paint color for series `key` at position `index`.
|
|
4
|
+
* Priority: explicit config[key].color (preserving the bare-token DX,
|
|
5
|
+
* e.g. "success" -> "var(--color-success)"), then palette[index % length].
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveSeriesColor(index: number, key: string | undefined, config: ChartConfig | undefined, palette: readonly string[]): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the paint color for series `key` at position `index`.
|
|
3
|
+
* Priority: explicit config[key].color (preserving the bare-token DX,
|
|
4
|
+
* e.g. "success" -> "var(--color-success)"), then palette[index % length].
|
|
5
|
+
*/
|
|
6
|
+
function resolveSeriesColor(index, key, config, palette) {
|
|
7
|
+
var _a;
|
|
8
|
+
const raw = key ? (_a = config === null || config === void 0 ? void 0 : config[key]) === null || _a === void 0 ? void 0 : _a.color : undefined;
|
|
9
|
+
if (raw) {
|
|
10
|
+
const isBareToken = !raw.startsWith("var(") &&
|
|
11
|
+
!raw.startsWith("#") &&
|
|
12
|
+
!raw.startsWith("rgb") &&
|
|
13
|
+
!raw.startsWith("hsl") &&
|
|
14
|
+
raw.includes("-");
|
|
15
|
+
return isBareToken ? `var(--color-${raw})` : raw;
|
|
16
|
+
}
|
|
17
|
+
return palette.length > 0 ? palette[index % palette.length] : "var(--color-chart-1)";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { resolveSeriesColor };
|
|
@@ -4,11 +4,11 @@ const accordionTheme = {
|
|
|
4
4
|
// Base container styles for stacked variant (unified card)
|
|
5
5
|
baseStyleStacked: "w-full border border-[var(--color-border)] rounded-[var(--form-radius)] overflow-hidden",
|
|
6
6
|
// Item styles for separated variant (individual cards with spacing)
|
|
7
|
-
itemStyle: "border border-[var(--color-border)] rounded-[var(--form-radius)] bg-
|
|
7
|
+
itemStyle: "border border-[var(--color-border)] rounded-[var(--form-radius)] bg-[var(--color-surface)] overflow-hidden mb-2 last-of-type:mb-0",
|
|
8
8
|
// Item styles for stacked variant (shared borders, no spacing)
|
|
9
|
-
itemStyleStacked: "bg-
|
|
9
|
+
itemStyleStacked: "bg-[var(--color-surface)] border-t border-[var(--color-border)] first-of-type:border-t-0",
|
|
10
10
|
// Trigger styles (shared across variants)
|
|
11
|
-
triggerStyle: "flex w-full gap-3 items-center px-4 py-2.5 text-left font-medium transition-all duration-
|
|
11
|
+
triggerStyle: "flex w-full gap-3 items-center px-4 py-2.5 text-left font-medium transition-all duration-[var(--motion-duration-base)] cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 text-[var(--color-text-primary)] text-sm",
|
|
12
12
|
// Body styles (shared across variants)
|
|
13
13
|
bodyStyle: "data-[state=closed]:max-h-0 data-[state=open]:max-h-[320px] accordion-content overflow-hidden text-sm",
|
|
14
14
|
// Body inner wrapper styles
|
|
@@ -5,7 +5,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
5
5
|
import { useAccordionContext } from './AccordionContext.js';
|
|
6
6
|
import { useAccordionItemContext } from './AccordionItem.js';
|
|
7
7
|
import { motion } from 'motion/react';
|
|
8
|
-
import {
|
|
8
|
+
import { Plus } from '@phosphor-icons/react';
|
|
9
9
|
import { createTriggerIconVariants } from './Accordion.animations.js';
|
|
10
10
|
|
|
11
11
|
const AccordionTrigger = React__default.forwardRef(({ children, className, chevron, chevronRotation, iconRotation, chevronPosition = "right", ...props }, ref) => {
|
|
@@ -14,7 +14,7 @@ const AccordionTrigger = React__default.forwardRef(({ children, className, chevr
|
|
|
14
14
|
const { isOpen, disabled, toggle, triggerId, contentId } = useAccordionItemContext();
|
|
15
15
|
const resolvedChevronRotation = (_a = chevronRotation !== null && chevronRotation !== void 0 ? chevronRotation : iconRotation) !== null && _a !== void 0 ? _a : 45;
|
|
16
16
|
// Resolve the indicator icon
|
|
17
|
-
const defaultChevronIcon = jsx(
|
|
17
|
+
const defaultChevronIcon = jsx(Plus, { className: "size-4", weight: "bold" });
|
|
18
18
|
const resolvedChevron = chevron === null
|
|
19
19
|
? null
|
|
20
20
|
: chevron !== undefined
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { Variants } from "motion/react";
|
|
2
2
|
/**
|
|
3
|
-
* Alert
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Alert dismiss animation variants.
|
|
4
|
+
*
|
|
5
|
+
* `visible` is the RESTING state, not an entrance — Alert mounts with
|
|
6
|
+
* `initial={false}` so it paints straight into `visible` and never plays these
|
|
7
|
+
* on mount. Only the `visible -> hidden` direction runs, when the alert is
|
|
8
|
+
* dismissed: fade + slide out while collapsing height/padding/margin so
|
|
9
|
+
* surrounding content closes the gap smoothly.
|
|
10
|
+
*
|
|
11
|
+
* `hidden` therefore keeps its full collapse geometry (that IS the dismiss),
|
|
12
|
+
* and `visible` keeps `y`/`opacity` so the collapse has somewhere to travel
|
|
13
|
+
* from. Uses library spring presets for a premium feel.
|
|
6
14
|
*/
|
|
7
15
|
export declare const alertVariants: Variants;
|
|
8
16
|
/**
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import '../../../theme/ThemeContext.js';
|
|
3
|
+
import '../../../theme/SurfaceContext.js';
|
|
4
|
+
import { springs } from '../../../theme/animations.js';
|
|
5
|
+
|
|
2
6
|
/**
|
|
3
|
-
* Alert
|
|
4
|
-
*
|
|
5
|
-
*
|
|
7
|
+
* Alert dismiss animation variants.
|
|
8
|
+
*
|
|
9
|
+
* `visible` is the RESTING state, not an entrance — Alert mounts with
|
|
10
|
+
* `initial={false}` so it paints straight into `visible` and never plays these
|
|
11
|
+
* on mount. Only the `visible -> hidden` direction runs, when the alert is
|
|
12
|
+
* dismissed: fade + slide out while collapsing height/padding/margin so
|
|
13
|
+
* surrounding content closes the gap smoothly.
|
|
14
|
+
*
|
|
15
|
+
* `hidden` therefore keeps its full collapse geometry (that IS the dismiss),
|
|
16
|
+
* and `visible` keeps `y`/`opacity` so the collapse has somewhere to travel
|
|
17
|
+
* from. Uses library spring presets for a premium feel.
|
|
6
18
|
*/
|
|
7
19
|
const alertVariants = {
|
|
8
20
|
hidden: {
|
|
9
21
|
opacity: 0,
|
|
10
|
-
y: -
|
|
22
|
+
y: -12,
|
|
11
23
|
height: 0,
|
|
12
24
|
paddingTop: 0,
|
|
13
25
|
paddingBottom: 0,
|
|
@@ -15,8 +27,13 @@ const alertVariants = {
|
|
|
15
27
|
marginBottom: 0,
|
|
16
28
|
overflow: "hidden",
|
|
17
29
|
transition: {
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
height: springs.smooth,
|
|
31
|
+
paddingTop: springs.smooth,
|
|
32
|
+
paddingBottom: springs.smooth,
|
|
33
|
+
marginTop: springs.smooth,
|
|
34
|
+
marginBottom: springs.smooth,
|
|
35
|
+
y: springs.premium,
|
|
36
|
+
opacity: { duration: 0.15 },
|
|
20
37
|
},
|
|
21
38
|
},
|
|
22
39
|
visible: {
|
|
@@ -29,8 +46,13 @@ const alertVariants = {
|
|
|
29
46
|
marginBottom: undefined,
|
|
30
47
|
overflow: "visible",
|
|
31
48
|
transition: {
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
y: springs.premium,
|
|
50
|
+
height: springs.smooth,
|
|
51
|
+
paddingTop: springs.smooth,
|
|
52
|
+
paddingBottom: springs.smooth,
|
|
53
|
+
marginTop: springs.smooth,
|
|
54
|
+
marginBottom: springs.smooth,
|
|
55
|
+
opacity: { duration: 0.25 },
|
|
34
56
|
},
|
|
35
57
|
},
|
|
36
58
|
};
|
|
@@ -5,15 +5,15 @@ import { useReducedMotion, motion } from 'motion/react';
|
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { alertTheme } from './Alert.theme.js';
|
|
7
7
|
import { reducedMotionAlertVariants, alertVariants } from './Alert.animations.js';
|
|
8
|
-
import {
|
|
8
|
+
import { X, XCircle, Warning, CheckCircle, Info, Bell } from '@phosphor-icons/react';
|
|
9
9
|
import { Button } from '../Button/Button.js';
|
|
10
10
|
|
|
11
11
|
const defaultIcons = {
|
|
12
|
-
|
|
13
|
-
primary:
|
|
14
|
-
success:
|
|
15
|
-
warning:
|
|
16
|
-
danger:
|
|
12
|
+
mono: Bell,
|
|
13
|
+
primary: Info,
|
|
14
|
+
success: CheckCircle,
|
|
15
|
+
warning: Warning,
|
|
16
|
+
danger: XCircle,
|
|
17
17
|
};
|
|
18
18
|
const Alert = React__default.forwardRef(({ color = "primary", title, subtitle, dismissible, icon, showIcon = true, avatar, actions, onDismiss, className, children, darkMode = false, ...props }, ref) => {
|
|
19
19
|
var _a;
|
|
@@ -36,7 +36,15 @@ const Alert = React__default.forwardRef(({ color = "primary", title, subtitle, d
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
if (React__default.isValidElement(icon)) {
|
|
39
|
-
|
|
39
|
+
// A custom icon gets the SAME size + semantic color the default icon
|
|
40
|
+
// gets, applied as defaults so a consumer className still wins (§4).
|
|
41
|
+
// Without this the element inherited neither: Phosphor icons default to
|
|
42
|
+
// `1em`, so a custom icon rendered at the root's `text-sm` (14px) inside
|
|
43
|
+
// this 24px box, in the ambient text color rather than the intent color.
|
|
44
|
+
const customIcon = icon;
|
|
45
|
+
return (jsx("div", { className: "flex-shrink-0 w-6 h-6 mt-1", "aria-hidden": "true", children: React__default.cloneElement(customIcon, {
|
|
46
|
+
className: cn("w-6 h-6", iconColor, customIcon.props.className),
|
|
47
|
+
}) }));
|
|
40
48
|
}
|
|
41
49
|
const IconComponent = defaultIcons[color];
|
|
42
50
|
return (jsx("div", { className: "flex-shrink-0 w-6 h-6 mt-1", "aria-hidden": "true", children: jsx(IconComponent, { className: cn("w-6 h-6", iconColor) }) }));
|
|
@@ -46,8 +54,14 @@ const Alert = React__default.forwardRef(({ color = "primary", title, subtitle, d
|
|
|
46
54
|
? jsx("div", { className: cn("font-semibold text-[var(--color-text-primary)]"), children: title })
|
|
47
55
|
: title), subtitle && (typeof subtitle === 'string'
|
|
48
56
|
? jsx("div", { className: "text-[var(--color-text-secondary)]/90 mt-1", children: subtitle })
|
|
49
|
-
: subtitle), children && jsx("div", { className: "mt-2", children: children }), actions && (jsx("div", { className: "flex items-center gap-2 mt-6", children: actions }))] }), showDismiss && (jsx(Button, { variant: "ghost", color: "
|
|
50
|
-
const alertNode = (jsx(motion.div, { variants: shouldReduceMotion ? reducedMotionAlertVariants : alertVariants,
|
|
57
|
+
: subtitle), children && jsx("div", { className: "mt-2", children: children }), actions && (jsx("div", { className: "flex items-center gap-2 mt-6", children: actions }))] }), showDismiss && (jsx(Button, { variant: "ghost", color: "mono", size: "sm", iconOnly: true, onClick: handleDismiss, "aria-label": "Dismiss alert", className: "rounded-full absolute top-2 right-2 flex-shrink-0", children: jsx(X, { className: "size-4", weight: "bold" }) }))] }));
|
|
58
|
+
const alertNode = (jsx(motion.div, { variants: shouldReduceMotion ? reducedMotionAlertVariants : alertVariants,
|
|
59
|
+
// No mount animation. An Alert is page content, not a transient
|
|
60
|
+
// notification (that's Toast) — it is usually present at first paint, so
|
|
61
|
+
// animating `hidden -> visible` on mount meant every page load played an
|
|
62
|
+
// expand. `initial={false}` starts at the `visible` variant and animates
|
|
63
|
+
// only on a later state change, which is what the collapse below needs.
|
|
64
|
+
initial: false, animate: isDismissing ? "hidden" : "visible", onAnimationComplete: (definition) => {
|
|
51
65
|
if (definition === "hidden" && isDismissing) {
|
|
52
66
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
53
67
|
}
|
|
@@ -6,7 +6,7 @@ import { semanticTextColors } from '../../../utils/colorUtils.js';
|
|
|
6
6
|
*/
|
|
7
7
|
const alertTheme = {
|
|
8
8
|
// Base styles applied to all alerts
|
|
9
|
-
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-sm border border-[var(--color-border)] backdrop-blur-md bg-white dark:bg-[var(--color-
|
|
9
|
+
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-sm border border-[var(--color-border)] backdrop-blur-md bg-white dark:bg-[var(--color-surface)]/80",
|
|
10
10
|
// Icon color styles per color
|
|
11
11
|
iconColors: semanticTextColors,
|
|
12
12
|
// State styles
|
|
@@ -28,9 +28,11 @@ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"
|
|
|
28
28
|
dismissible?: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Custom icon for the alert
|
|
31
|
-
* - Provide custom icon: overrides the default
|
|
31
|
+
* - Provide custom icon: overrides the default color icon. It inherits the
|
|
32
|
+
* default icon's size and semantic color; pass a `className` on the element
|
|
33
|
+
* to override either (e.g. `icon={<Fire className="size-5 text-purple-500" />}`).
|
|
32
34
|
* - Set to null: hides icon completely
|
|
33
|
-
* - Leave undefined: shows default
|
|
35
|
+
* - Leave undefined: shows default color icon
|
|
34
36
|
*/
|
|
35
37
|
icon?: ReactNode | null;
|
|
36
38
|
/** Whether to show the default icon for the variant */
|
|
@@ -15,7 +15,7 @@ import { useModalContext } from '../Modal/ModalContext.js';
|
|
|
15
15
|
*/
|
|
16
16
|
function AlertDialogSubtitle({ children }) {
|
|
17
17
|
const { subtitleId } = useModalContext();
|
|
18
|
-
return (jsx("div", { id: subtitleId, className: "text-[var(--color-text-secondary)] text-
|
|
18
|
+
return (jsx("div", { id: subtitleId, className: "text-[var(--color-text-secondary)] text-sm", children: children }));
|
|
19
19
|
}
|
|
20
20
|
const AlertDialog = ({ trigger, icon, title, subtitle, footer, className, }) => {
|
|
21
21
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -24,7 +24,7 @@ const AlertDialog = ({ trigger, icon, title, subtitle, footer, className, }) =>
|
|
|
24
24
|
const triggerElement = isValidElement(trigger)
|
|
25
25
|
? cloneElement(trigger, { onClick: handleOpen })
|
|
26
26
|
: null;
|
|
27
|
-
return (jsxs(Fragment, { children: [triggerElement, jsxs(Modal, { isOpen: isOpen, onClose: handleClose, size: "sm", closeOnOverlayClick: false, closeOnEsc: !footer, showCloseButton: false, role: "alertdialog", className: cn("!overflow-visible", className), children: [jsxs(Modal.Header, { children: [icon && (jsx("div", { className: "text-2xl rounded-
|
|
27
|
+
return (jsxs(Fragment, { children: [triggerElement, jsxs(Modal, { isOpen: isOpen, onClose: handleClose, size: "sm", closeOnOverlayClick: false, closeOnEsc: !footer, showCloseButton: false, role: "alertdialog", className: cn("!overflow-visible", className), children: [jsxs(Modal.Header, { children: [icon && (jsx("div", { className: "text-2xl rounded-[var(--modal-radius)] p-3 mb-[var(--modal-py)] w-fit border border-[var(--color-border-secondary)]", "aria-hidden": "true", children: icon })), jsx(Modal.Title, { children: title })] }), jsx(Modal.Body, { className: "pt-2", children: jsx(AlertDialogSubtitle, { children: subtitle }) }), footer && (jsx(Modal.Footer, { className: "pt-6 pb-[var(--modal-py)]", children: footer(handleClose) }))] })] }));
|
|
28
28
|
};
|
|
29
29
|
AlertDialog.displayName = "AlertDialog";
|
|
30
30
|
|
|
@@ -7,25 +7,64 @@ import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
|
7
7
|
import '../Tooltip/Tooltip.animations.js';
|
|
8
8
|
import { MeshGradient } from '../../effects/MeshGradient/MeshGradient.js';
|
|
9
9
|
import { MESH_PALETTE_BY_NAME, DEFAULT_MESH_COLORS, getMeshTextTone } from '../../effects/MeshGradient/MeshGradient.utils.js';
|
|
10
|
-
import {
|
|
10
|
+
import { SealCheck, User } from '@phosphor-icons/react';
|
|
11
11
|
|
|
12
12
|
// Number of marble shapes the gradient renders — shared by the render and the
|
|
13
13
|
// text-tone calc so both read the same deterministic field. The gradient's blur
|
|
14
14
|
// is resolution-independent (SVG viewBox units), so no per-size tuning is needed.
|
|
15
15
|
const MESH_COUNT = 2;
|
|
16
|
+
// Each token's geometry, as the CSS variable that carries its px value. Keeping
|
|
17
|
+
// the indirection means a themed `--avatar-size-*` still flows through.
|
|
18
|
+
const SIZE_TOKEN_VAR = {
|
|
19
|
+
xs: "var(--avatar-size-xs)",
|
|
20
|
+
sm: "var(--avatar-size-sm)",
|
|
21
|
+
md: "var(--avatar-size-md)",
|
|
22
|
+
lg: "var(--avatar-size-lg)",
|
|
23
|
+
xl: "var(--avatar-size-xl)",
|
|
24
|
+
};
|
|
25
|
+
// The default px ladder from `theme.css`, mirrored here for ONE purpose: picking
|
|
26
|
+
// which rung a numeric size's decorations (glyph, status dot, verified badge,
|
|
27
|
+
// text gap) should borrow. Geometry never reads this — it always resolves
|
|
28
|
+
// through the CSS variable above — so a theme that retunes the ladder still
|
|
29
|
+
// sizes correctly; only the rung chosen for a numeric size reads the defaults.
|
|
30
|
+
const SIZE_TOKEN_PX = {
|
|
31
|
+
xs: 24,
|
|
32
|
+
sm: 32,
|
|
33
|
+
md: 40,
|
|
34
|
+
lg: 48,
|
|
35
|
+
xl: 64,
|
|
36
|
+
};
|
|
37
|
+
const isSizeToken = (size) => typeof size === "string";
|
|
38
|
+
/** The rung a size sits closest to. Identity for tokens. */
|
|
39
|
+
const nearestSizeToken = (size) => {
|
|
40
|
+
if (isSizeToken(size))
|
|
41
|
+
return size;
|
|
42
|
+
return Object.keys(SIZE_TOKEN_PX).reduce((best, token) => Math.abs(SIZE_TOKEN_PX[token] - size) < Math.abs(SIZE_TOKEN_PX[best] - size)
|
|
43
|
+
? token
|
|
44
|
+
: best);
|
|
45
|
+
};
|
|
16
46
|
const Avatar = React__default.forwardRef(({ src, name, size = "md", status = "none", fallback, gradient = false, gradientVariant = "marble", gradientColors, className, role, lazyLoad = true, retryCount = 0, retryDelay = 1000, contextualLabel, groupPosition, showTooltip = false, initialsCount = 2, title, subtitle, verified = false, ...props }, ref) => {
|
|
17
47
|
var _a;
|
|
18
48
|
const [imageError, setImageError] = useState(false);
|
|
19
49
|
const [retries, setRetries] = useState(0);
|
|
20
50
|
const retryTimerRef = useRef(null);
|
|
51
|
+
if (process.env.NODE_ENV !== "production" &&
|
|
52
|
+
typeof size === "number" &&
|
|
53
|
+
(!Number.isFinite(size) || size <= 0)) {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.warn(`[Avatar]: \`size\` must be a positive number of pixels; received ${size}.`);
|
|
56
|
+
}
|
|
57
|
+
// Exact geometry for the circle; nearest rung for everything hung off it.
|
|
58
|
+
const sizeValue = isSizeToken(size) ? SIZE_TOKEN_VAR[size] : `${size}px`;
|
|
59
|
+
const sizeToken = nearestSizeToken(size);
|
|
21
60
|
// Normalize null to undefined for internal use
|
|
22
61
|
const resolvedName = name !== null && name !== void 0 ? name : undefined;
|
|
23
|
-
// Initials derived from the name (xs shows a single initial).
|
|
62
|
+
// Initials derived from the name (the xs rung shows a single initial).
|
|
24
63
|
const initials = resolvedName
|
|
25
64
|
? resolvedName
|
|
26
65
|
.split(" ")
|
|
27
66
|
.map((part) => part[0])
|
|
28
|
-
.slice(0,
|
|
67
|
+
.slice(0, sizeToken === "xs" ? 1 : initialsCount)
|
|
29
68
|
.join("")
|
|
30
69
|
.toUpperCase()
|
|
31
70
|
: "";
|
|
@@ -40,8 +79,8 @@ const Avatar = React__default.forwardRef(({ src, name, size = "md", status = "no
|
|
|
40
79
|
// theme-stable neutral tokens (so the choice holds in light AND dark mode).
|
|
41
80
|
const gradientTextColor = gradient
|
|
42
81
|
? getMeshTextTone(gradientSeed, gradientPalette, MESH_COUNT) === "dark"
|
|
43
|
-
? "text-[var(--color-
|
|
44
|
-
: "text-[var(--color-
|
|
82
|
+
? "text-[var(--color-mono-950)]"
|
|
83
|
+
: "text-[var(--color-mono-50)]"
|
|
45
84
|
: undefined;
|
|
46
85
|
// Glyph shown over the gradient: explicit fallback, else initials, else none
|
|
47
86
|
// (a clean gradient — no default user icon when there's no name).
|
|
@@ -88,41 +127,7 @@ const Avatar = React__default.forwardRef(({ src, name, size = "md", status = "no
|
|
|
88
127
|
return jsx("span", { "aria-hidden": "true", children: initials });
|
|
89
128
|
}
|
|
90
129
|
// 3. Default placeholder icon
|
|
91
|
-
return jsx(
|
|
92
|
-
};
|
|
93
|
-
// Determine status indicator size based on avatar size
|
|
94
|
-
const getStatusSize = () => {
|
|
95
|
-
switch (size) {
|
|
96
|
-
case "xs":
|
|
97
|
-
return "size-1.5 left-0 bottom-0.5";
|
|
98
|
-
case "sm":
|
|
99
|
-
return "size-2 left-0 bottom-0";
|
|
100
|
-
case "md":
|
|
101
|
-
return "size-2 left-0 bottom-0";
|
|
102
|
-
case "lg":
|
|
103
|
-
return "size-2.5 left-0 bottom-0";
|
|
104
|
-
case "xl":
|
|
105
|
-
return "size-3 left-0 bottom-0";
|
|
106
|
-
default:
|
|
107
|
-
return "size-2 left-0 bottom-0";
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
// Determine verified badge size based on avatar size
|
|
111
|
-
const getVerifiedBadgeSize = () => {
|
|
112
|
-
switch (size) {
|
|
113
|
-
case "xs":
|
|
114
|
-
return "size-2.5 -right-0.5 -bottom-0.5";
|
|
115
|
-
case "sm":
|
|
116
|
-
return "size-3.5 -right-0.5 -bottom-0.5";
|
|
117
|
-
case "md":
|
|
118
|
-
return "size-4 -right-0.5 -bottom-0.5";
|
|
119
|
-
case "lg":
|
|
120
|
-
return "size-5 -right-1 -bottom-1";
|
|
121
|
-
case "xl":
|
|
122
|
-
return "size-6 -right-1.5 -bottom-1.5";
|
|
123
|
-
default:
|
|
124
|
-
return "size-4 -right-0.5 -bottom-0.5";
|
|
125
|
-
}
|
|
130
|
+
return jsx(User, { className: "w-1/2 h-1/2" });
|
|
126
131
|
};
|
|
127
132
|
// Create full accessibility label including context if provided
|
|
128
133
|
const accessibilityLabel = contextualLabel
|
|
@@ -133,7 +138,10 @@ const Avatar = React__default.forwardRef(({ src, name, size = "md", status = "no
|
|
|
133
138
|
const resolvedTitle = title !== null && title !== void 0 ? title : (subtitle ? resolvedName : undefined);
|
|
134
139
|
const hasTextSection = !!(resolvedTitle || subtitle);
|
|
135
140
|
// The avatar circle with status indicator
|
|
136
|
-
const avatarCircle = (jsxs("div", { className: cn("relative inline-flex avatar-wrapper shrink-0", groupPosition), children: [jsxs("div", { className: cn(avatarTheme.baseStyle, avatarTheme.
|
|
141
|
+
const avatarCircle = (jsxs("div", { className: cn("relative inline-flex avatar-wrapper shrink-0", groupPosition), children: [jsxs("div", { className: cn(avatarTheme.baseStyle, avatarTheme.sizeStyle, avatarTheme.glyphSizes[sizeToken], className), style: { "--avatar-size": sizeValue }, "aria-hidden": ariaRole === "presentation" ? "true" : undefined, "data-size": size, children: [gradient && (jsx(MeshGradient, { seed: gradientSeed, colors: gradientPalette, count: MESH_COUNT })), src && !imageError ? (jsx("img", { src: src, alt: resolvedName !== null && resolvedName !== void 0 ? resolvedName : "Avatar", className: "relative z-10 size-full object-cover object-top", onError: handleImageError, loading: lazyLoad ? "lazy" : undefined, "aria-hidden": ariaRole === "presentation" ? "true" : undefined, "data-loaded": "true" })) : (jsx("div", { className: cn("avatar-fallback relative z-10 flex items-center justify-center size-full", gradient && cn(gradientTextColor, "drop-shadow")), children: gradient ? gradientGlyph : getFallbackContent() }))] }), status !== "none" && (jsx("span", { className: cn(
|
|
142
|
+
// Ring WIDTH ramps per size (see `statusSizes`); only its colour
|
|
143
|
+
// is shared here.
|
|
144
|
+
"absolute rounded-full ring-[var(--color-background)]", avatarTheme.statusPositionStyle, avatarTheme.statusSizes[sizeToken], avatarTheme.statuses[status]), "aria-label": `Status: ${status}`, role: "status", "data-status": status })), verified && (jsx("span", { className: cn("absolute rounded-full z-10 inline-grid place-items-center ring-2 ring-[var(--color-background)] bg-white dark:bg-[var(--color-surface)] shadow-sm", avatarTheme.verifiedSizes[sizeToken]), "aria-label": "Verified", children: jsx(SealCheck, { className: "size-full text-[var(--color-primary)]" }) }))] }));
|
|
137
145
|
// Wrap circle in tooltip if needed
|
|
138
146
|
const avatarWithTooltip = showTooltip && resolvedName ? (jsx(Tooltip, { content: resolvedName, placement: "top", children: avatarCircle })) : (avatarCircle);
|
|
139
147
|
// If no text section, render just the avatar
|
|
@@ -145,7 +153,7 @@ const Avatar = React__default.forwardRef(({ src, name, size = "md", status = "no
|
|
|
145
153
|
className: "inline-flex", role: ariaRole, "aria-label": ariaRole === "presentation" ? undefined : accessibilityLabel, "data-size": size, "data-status": status, "data-error": imageError ? "true" : "false", ...props, children: avatarWithTooltip }));
|
|
146
154
|
}
|
|
147
155
|
// Render avatar with text section
|
|
148
|
-
return (jsxs("div", { ref: ref, className: cn("inline-flex items-center", avatarTheme.gapSizes[
|
|
156
|
+
return (jsxs("div", { ref: ref, className: cn("inline-flex items-center", avatarTheme.gapSizes[sizeToken]), role: ariaRole, "aria-label": ariaRole === "presentation" ? undefined : accessibilityLabel, "data-size": size, "data-status": status, "data-error": imageError ? "true" : "false", ...props, children: [avatarWithTooltip, jsxs("div", { className: "min-w-0", children: [resolvedTitle && (jsx("div", { className: cn(avatarTheme.titleStyle, avatarTheme.textSizes[sizeToken]), children: resolvedTitle })), subtitle && (jsx("div", { className: cn(avatarTheme.subtitleStyle, avatarTheme.textSizes[sizeToken]), children: subtitle }))] })] }));
|
|
149
157
|
});
|
|
150
158
|
// Set display name for dev tools and Storybook
|
|
151
159
|
Avatar.displayName = "Avatar";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AvatarSizeToken, AvatarStatus } from "./Avatar.types";
|
|
2
2
|
interface AvatarTheme {
|
|
3
3
|
baseStyle: string;
|
|
4
|
-
|
|
4
|
+
sizeStyle: string;
|
|
5
|
+
glyphSizes: Record<AvatarSizeToken, string>;
|
|
5
6
|
statuses: Record<AvatarStatus, string>;
|
|
7
|
+
statusPositionStyle: string;
|
|
8
|
+
statusSizes: Record<AvatarSizeToken, string>;
|
|
9
|
+
verifiedSizes: Record<AvatarSizeToken, string>;
|
|
6
10
|
titleStyle: string;
|
|
7
11
|
subtitleStyle: string;
|
|
8
|
-
textSizes: Record<
|
|
9
|
-
gapSizes: Record<
|
|
12
|
+
textSizes: Record<AvatarSizeToken, string>;
|
|
13
|
+
gapSizes: Record<AvatarSizeToken, string>;
|
|
10
14
|
}
|
|
11
15
|
export declare const avatarTheme: AvatarTheme;
|
|
12
16
|
export {};
|