@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
|
@@ -7,7 +7,7 @@ const tabsTheme = {
|
|
|
7
7
|
// TabsList styles with proper design tokens
|
|
8
8
|
listStyle: "relative inline-flex items-center flex-row border-b border-[var(--color-border)] gap-6",
|
|
9
9
|
// TabsTrigger base styles - no individual borders, underline will be handled separately
|
|
10
|
-
triggerStyle: "relative inline-flex items-center justify-center whitespace-nowrap font-semibold transition-all duration-
|
|
10
|
+
triggerStyle: "relative inline-flex items-center justify-center whitespace-nowrap font-semibold transition-all duration-[var(--motion-duration-slow)] 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-muted)] hover:text-[var(--color-text-primary)] data-[state=active]:text-[var(--color-primary)]",
|
|
11
11
|
// TabsTrigger size variants using CSS variables where applicable
|
|
12
12
|
triggerSizes: {
|
|
13
13
|
sm: "px-0 py-1.5 text-sm",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { motion } from 'motion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { X } from '@phosphor-icons/react';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { Avatar } from '../Avatar/Avatar.js';
|
|
8
8
|
import { tagTheme } from './Tag.theme.js';
|
|
@@ -64,7 +64,7 @@ const Tag = React__default.forwardRef(({ children, size = "md", removable = true
|
|
|
64
64
|
}
|
|
65
65
|
return null;
|
|
66
66
|
};
|
|
67
|
-
const content = (jsxs(Fragment, { children: [renderLeadingContent(), children, showRemoveButton && (jsx("button", { type: "button", onClick: handleRemove, className: theme.removeButtonStyle, "aria-label": `Remove ${typeof children === "string" ? children : "tag"}`, children: jsx(
|
|
67
|
+
const content = (jsxs(Fragment, { children: [renderLeadingContent(), children, showRemoveButton && (jsx("button", { type: "button", onClick: handleRemove, className: theme.removeButtonStyle, "aria-label": `Remove ${typeof children === "string" ? children : "tag"}`, children: jsx(X, { className: theme.removeIconSizes[size] }) }))] }));
|
|
68
68
|
const sharedProps = {
|
|
69
69
|
ref,
|
|
70
70
|
className: cn(theme.baseStyle, theme.sizes[size], hasLeadingContent && "pl-1", showRemoveButton && "pr-0.5", disabled && theme.disabledStyle, className),
|
|
@@ -2,9 +2,11 @@ const tagTheme = {
|
|
|
2
2
|
baseStyle: "inline-flex items-center gap-1.5 font-medium rounded-full " +
|
|
3
3
|
"bg-[var(--color-surface-raised)] border border-[var(--color-border)] " +
|
|
4
4
|
"text-[var(--color-text-primary)]",
|
|
5
|
+
// Paddings tokenised (--tag-px-*/--tag-py-*, + --tag-pl-md for md's larger
|
|
6
|
+
// left inset) so a theme can grow the chip tier — defaults px-2/px-2+pl-2.5.
|
|
5
7
|
sizes: {
|
|
6
|
-
sm: "text-xs px-
|
|
7
|
-
md: "text-sm px-
|
|
8
|
+
sm: "text-xs px-[var(--tag-px-sm)] py-[var(--tag-py-sm)]",
|
|
9
|
+
md: "text-sm px-[var(--tag-px-md)] pl-[var(--tag-pl-md)] py-[var(--tag-py-md)]",
|
|
8
10
|
},
|
|
9
11
|
// No left margin here: the avatar/icon's left inset is owned by the tag's
|
|
10
12
|
// `pl-1` (applied when there's leading content), not by a per-size `ml-*`.
|
|
@@ -23,7 +25,7 @@ const tagTheme = {
|
|
|
23
25
|
removeButtonStyle: "inline-flex items-center justify-center rounded-full p-0.5 -ml-1 " +
|
|
24
26
|
"hover:bg-[var(--color-surface-hover)] " +
|
|
25
27
|
"text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] " +
|
|
26
|
-
"transition-all duration-
|
|
28
|
+
"transition-all duration-[var(--motion-duration-slow)] cursor-pointer focus:outline-none " +
|
|
27
29
|
"focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]",
|
|
28
30
|
removeIconSizes: {
|
|
29
31
|
sm: "size-3",
|
|
@@ -6,7 +6,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
6
6
|
import { useSurfaceElevation, SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
7
7
|
import { toastTheme } from './Toast.theme.js';
|
|
8
8
|
import { getToastStackingAnimation, toastAnimations } from './Toast.animations.js';
|
|
9
|
-
import {
|
|
9
|
+
import { ArrowsClockwise, Info, X } from '@phosphor-icons/react';
|
|
10
10
|
import { Link } from '../Link/Link.js';
|
|
11
11
|
|
|
12
12
|
const isToastAction = (action) => typeof action === "object" &&
|
|
@@ -40,7 +40,7 @@ const Toast = React__default.forwardRef(({ toast, className, onDismiss, index =
|
|
|
40
40
|
// so assistive tech announces it exactly once, using this more specific
|
|
41
41
|
// role/urgency rather than the container's generic "polite" default.
|
|
42
42
|
const toastRole = color === "danger" || color === "warning" ? "alert" : "status";
|
|
43
|
-
const defaultIcon = state === "loading" ? (jsx(motion.div, { animate: { rotate: 360 }, transition: { repeat: Infinity, duration: 1, ease: "linear" }, children: jsx(
|
|
43
|
+
const defaultIcon = state === "loading" ? (jsx(motion.div, { animate: { rotate: 360 }, transition: { repeat: Infinity, duration: 1, ease: "linear" }, children: jsx(ArrowsClockwise, { className: "w-5 h-5" }) })) : (jsx(Info, { className: "w-5 h-5" }));
|
|
44
44
|
const resolvedIcon = icon || defaultIcon;
|
|
45
45
|
// Auto-dismiss after duration (pauses when hovered/expanded, then RESUMES the remaining
|
|
46
46
|
// time rather than restarting the full countdown — otherwise intermittent hover keeps
|
|
@@ -108,7 +108,7 @@ const Toast = React__default.forwardRef(({ toast, className, onDismiss, index =
|
|
|
108
108
|
}, [stackingStyle.zIndex, index, position]);
|
|
109
109
|
const toastNode = (jsx(motion.div, { ref: setRefs, role: toastRole, layout: true, initial: shouldReduceMotion ? false : toastAnimations.initial, animate: animateValue, exit: shouldReduceMotion
|
|
110
110
|
? { ...toastAnimations.exit, transition: { duration: 0 } }
|
|
111
|
-
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: true }), toastTheme.baseStyle, isTextOnly && "items-center", "pointer-events-auto", index > 0 && !isExpanded && "absolute top-0 left-0", className), style: styleValue, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [jsx("div", { className: cn(toastTheme.iconStyle, !isTextOnly && "mt-0.5"), children: resolvedIcon }), jsxs("div", { className: "flex-1 min-w-0", children: [title && jsx("div", { className: toastTheme.titleStyle, children: title }), subtitle && (jsx("div", { className: toastTheme.subtitleStyle, children: subtitle })), action && (jsx("div", { className: "mt-4", children: isToastAction(action) ? (jsx(Link, { color: "primary", size: "sm", onClick: handleActionClick, children: action.label })) : (action) })), children] }), dismissible && (jsx("button", { type: "button", className: cn(toastTheme.closeButtonStyle, !isTextOnly && "mt-0.5"), onClick: handleDismiss, "aria-label": "Dismiss notification", children: jsx(
|
|
111
|
+
: toastAnimations.exit, transition: shouldReduceMotion ? { duration: 0 } : toastAnimations.transition, className: cn(surfaceClasses(surfaceLevel, { translucent: true, shadow: true }), toastTheme.baseStyle, isTextOnly && "items-center", "pointer-events-auto", index > 0 && !isExpanded && "absolute top-0 left-0", className), style: styleValue, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [jsx("div", { className: cn(toastTheme.iconStyle, !isTextOnly && "mt-0.5"), children: resolvedIcon }), jsxs("div", { className: "flex-1 min-w-0", children: [title && jsx("div", { className: toastTheme.titleStyle, children: title }), subtitle && (jsx("div", { className: toastTheme.subtitleStyle, children: subtitle })), action && (jsx("div", { className: "mt-4", children: isToastAction(action) ? (jsx(Link, { color: "primary", size: "sm", onClick: handleActionClick, children: action.label })) : (action) })), children] }), dismissible && (jsx("button", { type: "button", className: cn(toastTheme.closeButtonStyle, !isTextOnly && "mt-0.5"), onClick: handleDismiss, "aria-label": "Dismiss notification", children: jsx(X, { className: "size-5" }) }))] }) }));
|
|
112
112
|
if (darkMode) {
|
|
113
113
|
return jsx("div", { className: "dark", children: toastNode });
|
|
114
114
|
}
|
|
@@ -25,7 +25,7 @@ export interface ToastData {
|
|
|
25
25
|
* Semantic severity of the toast. Drives the per-toast live-region role
|
|
26
26
|
* (`danger`/`warning` -> `role="alert"`, everything else -> `role="status"`)
|
|
27
27
|
* as well as `useToast()`'s convenience-method icon color.
|
|
28
|
-
* @default "
|
|
28
|
+
* @default "mono"
|
|
29
29
|
*/
|
|
30
30
|
color?: SemanticColor;
|
|
31
31
|
title?: ReactNode;
|
|
@@ -93,7 +93,7 @@ const ToastProvider = ({ children, position = 'top-right', maxToasts = 5, defaul
|
|
|
93
93
|
removeAllToasts,
|
|
94
94
|
}), [toasts, addToast, removeToast, removeAllToasts]);
|
|
95
95
|
const portalTarget = isClient ? document.body : null;
|
|
96
|
-
return (jsxs(ToastContext.Provider, { value: contextValue, children: [children, portalTarget ? createPortal(jsx("div", { className: cn(toastTheme.containerStyle, positionStyles[position]), "aria-live": "polite", "aria-label": "Notifications", children: jsx("div", { className: "relative w-80", style: {
|
|
96
|
+
return (jsxs(ToastContext.Provider, { value: contextValue, children: [children, portalTarget ? createPortal(jsx("div", { "data-flikkui-portal": "", className: cn(toastTheme.containerStyle, positionStyles[position]), "aria-live": "polite", "aria-label": "Notifications", children: jsx("div", { className: "relative w-80", style: {
|
|
97
97
|
paddingBottom: !position.startsWith("bottom") && isHovered && toasts.length > 1 ? totalExpandedHeight : undefined,
|
|
98
98
|
paddingTop: position.startsWith("bottom") && isHovered && toasts.length > 1 ? totalExpandedHeight : undefined,
|
|
99
99
|
}, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: jsx(AnimatePresence, { mode: "popLayout", children: toasts.map((toast, index) => (jsx(Toast, { toast: toast, onDismiss: removeToast, index: index, isExpanded: isHovered, totalToasts: toasts.length, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onHeightChange: handleToastHeight, expandedOffset: getExpandedOffset(index), darkMode: darkMode, position: position }, toast.id))) }) }) }), portalTarget) : null] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React__default, { useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Info, Warning, XCircle, CheckCircle } from '@phosphor-icons/react';
|
|
4
4
|
import { useToastContext } from './ToastProvider.js';
|
|
5
5
|
|
|
6
6
|
const createSemanticIcon = (IconComponent, colorClass) => {
|
|
@@ -30,7 +30,7 @@ const useToast = () => {
|
|
|
30
30
|
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
31
31
|
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
32
32
|
action: options === null || options === void 0 ? void 0 : options.action,
|
|
33
|
-
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(
|
|
33
|
+
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(CheckCircle, 'text-[var(--color-success)]'),
|
|
34
34
|
});
|
|
35
35
|
}, [addToast]);
|
|
36
36
|
const error = useCallback((title, options) => {
|
|
@@ -42,7 +42,7 @@ const useToast = () => {
|
|
|
42
42
|
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
43
43
|
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
44
44
|
action: options === null || options === void 0 ? void 0 : options.action,
|
|
45
|
-
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(
|
|
45
|
+
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(XCircle, 'text-[var(--color-danger)]'),
|
|
46
46
|
});
|
|
47
47
|
}, [addToast]);
|
|
48
48
|
const warning = useCallback((title, options) => {
|
|
@@ -54,7 +54,7 @@ const useToast = () => {
|
|
|
54
54
|
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
55
55
|
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
56
56
|
action: options === null || options === void 0 ? void 0 : options.action,
|
|
57
|
-
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(
|
|
57
|
+
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(Warning, 'text-[var(--color-warning)]'),
|
|
58
58
|
});
|
|
59
59
|
}, [addToast]);
|
|
60
60
|
const info = useCallback((title, options) => {
|
|
@@ -66,7 +66,7 @@ const useToast = () => {
|
|
|
66
66
|
duration: options === null || options === void 0 ? void 0 : options.duration,
|
|
67
67
|
dismissible: options === null || options === void 0 ? void 0 : options.dismissible,
|
|
68
68
|
action: options === null || options === void 0 ? void 0 : options.action,
|
|
69
|
-
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(
|
|
69
|
+
icon: (options === null || options === void 0 ? void 0 : options.icon) || createSemanticIcon(Info, 'text-[var(--color-primary)]'),
|
|
70
70
|
});
|
|
71
71
|
}, [addToast]);
|
|
72
72
|
const loading = useCallback((title, options) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TooltipProps } from "./Tooltip.types";
|
|
2
2
|
declare const Tooltip: {
|
|
3
|
-
({ content, children, placement, delay, disabled, className, triggerClassName, maxWidth, minWidth, showOnFocus, wrapText, id, theme: themeOverrides, "aria-label": ariaLabel, role, offset, darkMode, elevation, lift, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ content, children, placement, delay, disabled, className, triggerClassName, maxWidth, minWidth, showOnFocus, wrapText, id, theme: themeOverrides, "aria-label": ariaLabel, role, offset, darkMode, elevation, lift, isOpen, defaultIsOpen, onOpenChange, recalcTrigger, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export { Tooltip };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import React__default, { useId, useState,
|
|
3
|
+
import React__default, { useId, useState, useCallback, useRef, useEffect } from 'react';
|
|
4
4
|
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
@@ -11,7 +11,7 @@ import { useIsClient } from '../../../hooks/useIsClient.js';
|
|
|
11
11
|
import { useDarkMode } from '../../../hooks/useDarkMode.js';
|
|
12
12
|
import { useSurfaceElevation, SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
13
13
|
|
|
14
|
-
const Tooltip = ({ content, children, placement = "top", delay = 300, disabled = false, className, triggerClassName, maxWidth = "360px", minWidth = "fit-content", showOnFocus = true, wrapText = false, id, theme: themeOverrides, "aria-label": ariaLabel, role = "tooltip", offset = 8, darkMode = false, elevation, lift, }) => {
|
|
14
|
+
const Tooltip = ({ content, children, placement = "top", delay = 300, disabled = false, className, triggerClassName, maxWidth = "360px", minWidth = "fit-content", showOnFocus = true, wrapText = false, id, theme: themeOverrides, "aria-label": ariaLabel, role = "tooltip", offset = 8, darkMode = false, elevation, lift, isOpen, defaultIsOpen = false, onOpenChange, recalcTrigger, }) => {
|
|
15
15
|
// Relative elevation: lift above the host surface (overlay base = 5).
|
|
16
16
|
const surfaceLevel = useSurfaceElevation({ baseRung: 5, offset: 2, elevation, lift });
|
|
17
17
|
// Stable id for the aria-describedby linkage — auto-generated via useId()
|
|
@@ -20,7 +20,14 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
20
20
|
// when the consumer doesn't pass an explicit `id`.
|
|
21
21
|
const generatedId = useId();
|
|
22
22
|
const tooltipId = id || `tooltip-${generatedId}`;
|
|
23
|
-
const
|
|
23
|
+
const isControlled = isOpen !== undefined;
|
|
24
|
+
const [internalVisible, setInternalVisible] = useState(defaultIsOpen);
|
|
25
|
+
const isVisible = isControlled ? isOpen : internalVisible;
|
|
26
|
+
const setVisible = useCallback((next) => {
|
|
27
|
+
if (!isControlled)
|
|
28
|
+
setInternalVisible(next);
|
|
29
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(next);
|
|
30
|
+
}, [isControlled, onOpenChange]);
|
|
24
31
|
const tooltipRef = useRef(null);
|
|
25
32
|
const triggerRef = useRef(null);
|
|
26
33
|
const timerRef = useRef(null);
|
|
@@ -40,25 +47,42 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
40
47
|
placement: placement,
|
|
41
48
|
offset,
|
|
42
49
|
autoWidth: true,
|
|
50
|
+
recalcTrigger,
|
|
43
51
|
});
|
|
44
|
-
//
|
|
52
|
+
// Dev warning (§9): controlled + uncontrolled props together — controlled wins.
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (process.env.NODE_ENV !== "production") {
|
|
55
|
+
if (isControlled && defaultIsOpen) {
|
|
56
|
+
console.warn("[Tooltip]: Both `isOpen` and `defaultIsOpen` provided. Tooltip is controlled — `defaultIsOpen` is ignored.");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
+
}, []);
|
|
61
|
+
// Event handlers - simplified timer management.
|
|
62
|
+
// In controlled mode visibility is driven ENTIRELY by `isOpen` (see
|
|
63
|
+
// Tooltip.types.ts) — hover/focus/Escape must not fight the consumer's
|
|
64
|
+
// state, so both handlers bail. (`isOpen` without `onOpenChange` is a
|
|
65
|
+
// first-class display-only pattern — e.g. Slider's drag bubble — so no
|
|
66
|
+
// missing-handler warning here, unlike form controls.)
|
|
45
67
|
const handleShowTooltip = useCallback(() => {
|
|
46
|
-
if (disabled)
|
|
68
|
+
if (disabled || isControlled)
|
|
47
69
|
return;
|
|
48
70
|
if (timerRef.current) {
|
|
49
71
|
clearTimeout(timerRef.current);
|
|
50
72
|
}
|
|
51
73
|
timerRef.current = setTimeout(() => {
|
|
52
|
-
|
|
74
|
+
setVisible(true);
|
|
53
75
|
}, delay);
|
|
54
|
-
}, [disabled, delay]);
|
|
76
|
+
}, [disabled, isControlled, delay, setVisible]);
|
|
55
77
|
const handleHideTooltip = useCallback(() => {
|
|
78
|
+
if (isControlled)
|
|
79
|
+
return;
|
|
56
80
|
if (timerRef.current) {
|
|
57
81
|
clearTimeout(timerRef.current);
|
|
58
82
|
}
|
|
59
83
|
// Immediate hide for better responsiveness
|
|
60
|
-
|
|
61
|
-
}, []);
|
|
84
|
+
setVisible(false);
|
|
85
|
+
}, [isControlled, setVisible]);
|
|
62
86
|
// Clean up timeout on unmount
|
|
63
87
|
useEffect(() => {
|
|
64
88
|
return () => {
|
|
@@ -118,6 +142,14 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
118
142
|
// valid element to clone (e.g. plain text) and there is no other place to
|
|
119
143
|
// put the attribute.
|
|
120
144
|
const isElementChild = React__default.isValidElement(children);
|
|
145
|
+
// Merge with any aria-describedby the child already carries (e.g. a form
|
|
146
|
+
// control describing itself via its own helper/error text) instead of
|
|
147
|
+
// clobbering it — ARIA allows a space-separated list of ids.
|
|
148
|
+
const existingDescribedBy = isElementChild
|
|
149
|
+
? children.props["aria-describedby"]
|
|
150
|
+
: undefined;
|
|
151
|
+
const mergedDescribedBy = [existingDescribedBy, isVisible ? tooltipId : undefined].filter(Boolean).join(" ") ||
|
|
152
|
+
undefined;
|
|
121
153
|
const childWithFocusHandlers = isElementChild
|
|
122
154
|
? React__default.cloneElement(children, {
|
|
123
155
|
...(childCanReceiveFocus && {
|
|
@@ -132,7 +164,7 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
132
164
|
(_b = (_a = children.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
133
165
|
},
|
|
134
166
|
}),
|
|
135
|
-
"aria-describedby":
|
|
167
|
+
"aria-describedby": mergedDescribedBy,
|
|
136
168
|
})
|
|
137
169
|
: children;
|
|
138
170
|
return (jsxs("div", { className: cn("relative inline-block", triggerClassName), ref: triggerRef, ...triggerHandlers, "aria-describedby": !isElementChild && isVisible ? tooltipId : undefined, children: [childWithFocusHandlers, isClient &&
|
|
@@ -107,4 +107,29 @@ export interface TooltipProps {
|
|
|
107
107
|
elevation?: SurfaceElevation;
|
|
108
108
|
/** `false` opts out of the relative lift — paints at the tooltip's base rung. */
|
|
109
109
|
lift?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Controlled visibility — when provided, visibility is driven entirely by
|
|
112
|
+
* this prop instead of internal hover/focus state (delay is bypassed).
|
|
113
|
+
* Use for triggers whose "show tooltip" moment isn't a plain hover, e.g. a
|
|
114
|
+
* value bubble shown only while dragging a Slider thumb.
|
|
115
|
+
*/
|
|
116
|
+
isOpen?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Initial visibility for uncontrolled usage.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
defaultIsOpen?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Called when internal hover/focus logic changes visibility (uncontrolled
|
|
124
|
+
* mode). In controlled mode visibility is owned by `isOpen` and the
|
|
125
|
+
* internal triggers are bypassed entirely, so this never fires — update
|
|
126
|
+
* your own state instead.
|
|
127
|
+
*/
|
|
128
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Opt-in escape hatch for triggers that move on their own (e.g. a dragged
|
|
131
|
+
* slider thumb) without a scroll/resize/content-resize event to key off
|
|
132
|
+
* of. Position recalculates whenever this value changes.
|
|
133
|
+
*/
|
|
134
|
+
recalcTrigger?: unknown;
|
|
110
135
|
}
|
|
@@ -5,7 +5,7 @@ import { motion, AnimatePresence, useReducedMotion } from 'motion/react';
|
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { treeTheme } from './Tree.theme.js';
|
|
7
7
|
import { Checkbox } from '../../forms/Checkbox/Checkbox.js';
|
|
8
|
-
import {
|
|
8
|
+
import { CaretRight, File } from '@phosphor-icons/react';
|
|
9
9
|
import { getReducedMotionVariants, treeNodeVariants, expandIconVariants, childNodeVariants } from './Tree.animations.js';
|
|
10
10
|
|
|
11
11
|
// Build a flat ordered list of visible (non-collapsed) node ids via depth-first traversal.
|
|
@@ -200,7 +200,7 @@ const InternalTreeNode = React__default.memo(({ node, level, expanded, selected,
|
|
|
200
200
|
const labelStyle = cn(theme.labelStyle, {
|
|
201
201
|
'text-[var(--color-text-muted)]': node.disabled,
|
|
202
202
|
});
|
|
203
|
-
return (jsxs("div", { children: [jsxs("div", { ref: itemRef, className: nodeStyle, style: { paddingLeft: `calc(${level} * ${theme.indentSize} + 0.25rem)` }, onClick: handleNodeClick, onKeyDown: handleKeyDown, onFocus: handleFocus, tabIndex: tabIndexValue, role: "treeitem", "aria-expanded": isExpandable ? expanded : undefined, "aria-selected": selectable ? selected : undefined, "aria-disabled": node.disabled, children: [isExpandable ? (jsx(motion.span, { className: cn(theme.expandIconStyle), variants: iconVariants, initial: "collapsed", animate: expanded ? "expanded" : "collapsed", onClick: handleExpandClick, "aria-label": expanded ? 'Collapse' : 'Expand', "aria-hidden": "true", tabIndex: -1, children: jsx(
|
|
203
|
+
return (jsxs("div", { children: [jsxs("div", { ref: itemRef, className: nodeStyle, style: { paddingLeft: `calc(${level} * ${theme.indentSize} + 0.25rem)` }, onClick: handleNodeClick, onKeyDown: handleKeyDown, onFocus: handleFocus, tabIndex: tabIndexValue, role: "treeitem", "aria-expanded": isExpandable ? expanded : undefined, "aria-selected": selectable ? selected : undefined, "aria-disabled": node.disabled, children: [isExpandable ? (jsx(motion.span, { className: cn(theme.expandIconStyle), variants: iconVariants, initial: "collapsed", animate: expanded ? "expanded" : "collapsed", onClick: handleExpandClick, "aria-label": expanded ? 'Collapse' : 'Expand', "aria-hidden": "true", tabIndex: -1, children: jsx(CaretRight, { className: "size-4", weight: "bold" }) })) : (jsx("span", { className: "w-4 mr-1" })), checkable && (jsx(Checkbox, { size: 'sm', id: `tree-checkbox-${node.id}`, name: `tree-checkbox-${node.id}`, value: node.id, checked: selected, indeterminate: hierarchicalSelection && isIndeterminate, onChange: () => onNodeClick(node), state: node.disabled ? "disabled" : "default", className: "flex-shrink-0", onClick: (e) => e.stopPropagation() })), (node.icon || !isExpandable) && (jsx("span", { className: cn(theme.iconStyle), children: node.icon || jsx(File, { className: "w-4 h-4" }) })), jsx("span", { className: labelStyle, title: node.label, children: node.label })] }), hasChildren && (jsx(AnimatePresence, { initial: false, children: expanded && (jsx(motion.div, { role: "group", variants: nodeVariants, initial: "collapsed", animate: "expanded", exit: "collapsed", style: { overflow: 'hidden' }, children: (_a = node.children) === null || _a === void 0 ? void 0 : _a.map((childNode) => (
|
|
204
204
|
// No initial/animate/exit here on purpose: the child inherits its
|
|
205
205
|
// animation state from the container above so staggerChildren can
|
|
206
206
|
// cascade them in/out one after another.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const treeTheme = {
|
|
2
2
|
baseStyle: 'flex flex-col w-full',
|
|
3
|
-
nodeStyle: 'flex items-center py-1 pr-1 rounded-[calc(var(--radius-base)*0.75)] hover:bg-[var(--color-
|
|
3
|
+
nodeStyle: 'flex items-center py-1 pr-1 rounded-[calc(var(--radius-base)*0.75)] hover:bg-[var(--color-surface)] cursor-pointer transition-colors select-none gap-2',
|
|
4
4
|
labelStyle: 'flex-1 text-base text-[var(--color-text-primary)] truncate',
|
|
5
5
|
iconStyle: 'flex-shrink-0 text-[var(--color-text-muted)]',
|
|
6
6
|
expandIconStyle: 'flex-shrink-0 mr-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] transition-colors cursor-pointer size-4 flex items-center justify-center',
|
|
@@ -9,9 +9,7 @@ export * from "./Button";
|
|
|
9
9
|
export * from "./ButtonGroup";
|
|
10
10
|
export * from "./Calendar";
|
|
11
11
|
export * from "./Card";
|
|
12
|
-
export * from "./CardStack";
|
|
13
12
|
export * from "./HeroCard";
|
|
14
|
-
export * from "./Carousel";
|
|
15
13
|
export * from "./CommandPalette";
|
|
16
14
|
export * from "./Separator";
|
|
17
15
|
export * from "./Drawer";
|
|
@@ -7,7 +7,6 @@ export { Badge } from './Badge/Badge.js';
|
|
|
7
7
|
export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs.js';
|
|
8
8
|
export { breadcrumbsTheme, breadcrumbsVariants, defaultSeparator } from './Breadcrumbs/Breadcrumbs.theme.js';
|
|
9
9
|
export { Button } from './Button/Button.js';
|
|
10
|
-
export { getRippleAnimation, getRippleColorClass, useRipple } from './Button/Button.ripple.js';
|
|
11
10
|
export { ButtonGroup } from './ButtonGroup/ButtonGroup.js';
|
|
12
11
|
export { ButtonGroupSeparator } from './ButtonGroup/ButtonGroupSeparator.js';
|
|
13
12
|
export { ButtonGroupText } from './ButtonGroup/ButtonGroupText.js';
|
|
@@ -16,11 +15,8 @@ export { calendarTheme } from './Calendar/Calendar.theme.js';
|
|
|
16
15
|
export { calendarAnimations } from './Calendar/Calendar.animations.js';
|
|
17
16
|
export { CalendarMini } from './Calendar/CalendarMini/CalendarMini.js';
|
|
18
17
|
export { Card } from './Card/Card.js';
|
|
19
|
-
export { CardStack } from './CardStack/CardStack.js';
|
|
20
18
|
export { HERO_CARD_DEFAULT_IMAGE, HeroCard } from './HeroCard/HeroCard.js';
|
|
21
19
|
export { heroCardTheme } from './HeroCard/HeroCard.theme.js';
|
|
22
|
-
export { Carousel } from './Carousel/Carousel.js';
|
|
23
|
-
export { CarouselBody } from './Carousel/CarouselBody.js';
|
|
24
20
|
export { CommandPalette } from './CommandPalette/CommandPalette.js';
|
|
25
21
|
export { commandPaletteTheme } from './CommandPalette/CommandPalette.theme.js';
|
|
26
22
|
export { Separator } from './Separator/Separator.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Moved with ChartTooltip out of charts/utils/animation-utils.ts when the
|
|
2
|
+
// component was lifted to core/shared (it is consumed by data-display too).
|
|
3
|
+
// These transitions are ChartTooltip-only; chart-wide animation values stay
|
|
4
|
+
// in charts/utils/animation-utils.ts per CLAUDE.md §19.
|
|
5
|
+
/** Tooltip pop-in: springy position/scale with a quick opacity/scale settle. */
|
|
6
|
+
const TOOLTIP_ENTER_TRANSITION = {
|
|
7
|
+
type: "spring",
|
|
8
|
+
stiffness: 400,
|
|
9
|
+
damping: 30,
|
|
10
|
+
opacity: { duration: 0.15 },
|
|
11
|
+
scale: { duration: 0.15 },
|
|
12
|
+
};
|
|
13
|
+
const TOOLTIP_EXIT_TRANSITION = {
|
|
14
|
+
type: "spring",
|
|
15
|
+
stiffness: 300,
|
|
16
|
+
damping: 25,
|
|
17
|
+
duration: 0.15,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { TOOLTIP_ENTER_TRANSITION, TOOLTIP_EXIT_TRANSITION };
|
|
@@ -5,7 +5,7 @@ import { AnimatePresence, motion } from 'motion/react';
|
|
|
5
5
|
import { cn } from '../../../../utils/cn.js';
|
|
6
6
|
import { chartTooltipTheme } from './ChartTooltip.theme.js';
|
|
7
7
|
import { useIsClient } from '../../../../hooks/useIsClient.js';
|
|
8
|
-
import { TOOLTIP_EXIT_TRANSITION, TOOLTIP_ENTER_TRANSITION } from '
|
|
8
|
+
import { TOOLTIP_EXIT_TRANSITION, TOOLTIP_ENTER_TRANSITION } from './ChartTooltip.animations.js';
|
|
9
9
|
|
|
10
10
|
// Helper function to check if content is MultiSeriesData
|
|
11
11
|
const isMultiSeriesData = (content) => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RippleProps {
|
|
3
|
+
/**
|
|
4
|
+
* Suppress ripples without unmounting. Only needed for hosts that signal
|
|
5
|
+
* disabled via `aria-disabled` — a natively `disabled` element does not
|
|
6
|
+
* dispatch pointer events at all, so it needs nothing here.
|
|
7
|
+
*/
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Tint override for the ripple circles. Defaults to `bg-current`, which
|
|
11
|
+
* resolves to the host's own text colour and therefore adapts to every
|
|
12
|
+
* variant, surface, theme, and colour scheme without configuration.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Ripple: React.FC<RippleProps>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shared press ripple for interactive surfaces (Button, NavItem, MenuItem,
|
|
9
|
+
* Pill, SelectableCard). One source of truth so every pressable surface in the
|
|
10
|
+
* library ripples with the same character — the sibling of `createPressVariants`
|
|
11
|
+
* in `interaction.animations.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Drop it in as the LAST child of a host that is `relative`:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <button className="relative">
|
|
17
|
+
* Save
|
|
18
|
+
* <Ripple />
|
|
19
|
+
* </button>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* It wires itself: the layer reads its own `parentElement` and listens there,
|
|
23
|
+
* so the host never threads a handler or a ref. Clipping lives on the layer
|
|
24
|
+
* (`overflow-hidden rounded-[inherit]`), so the host does not need
|
|
25
|
+
* `overflow-hidden` of its own.
|
|
26
|
+
*/
|
|
27
|
+
/** Interactive elements that earn a ripple. See `isInteractive` below. */
|
|
28
|
+
const INTERACTIVE_SELECTOR = [
|
|
29
|
+
"button",
|
|
30
|
+
"a[href]",
|
|
31
|
+
'[role="button"]',
|
|
32
|
+
'[role="menuitem"]',
|
|
33
|
+
'[role="menuitemcheckbox"]',
|
|
34
|
+
'[role="menuitemradio"]',
|
|
35
|
+
'[role="option"]',
|
|
36
|
+
'[role="tab"]',
|
|
37
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
38
|
+
].join(", ");
|
|
39
|
+
/**
|
|
40
|
+
* A ripple is a press affordance, so it must only appear on something a user
|
|
41
|
+
* can actually press — including by keyboard. A bare `<div onClick>` has no
|
|
42
|
+
* role and no tab stop, so advertising interactivity on it would be the exact
|
|
43
|
+
* pattern CLAUDE.md §8b describes when it explains why Badge's click path was
|
|
44
|
+
* removed. Gating on the DOM (rather than on the presence of a handler) keeps
|
|
45
|
+
* that guarantee self-correcting: a host becomes rippleable by becoming
|
|
46
|
+
* accessible, not by passing a prop.
|
|
47
|
+
*/
|
|
48
|
+
function isInteractive(element) {
|
|
49
|
+
return element.matches(INTERACTIVE_SELECTOR);
|
|
50
|
+
}
|
|
51
|
+
/** Duration scales with reach — a fixed value crosses a large surface far too fast. */
|
|
52
|
+
const MIN_DURATION = 0.35;
|
|
53
|
+
const MAX_DURATION = 0.7;
|
|
54
|
+
const DURATION_DIVISOR = 500;
|
|
55
|
+
function durationForRadius(radius) {
|
|
56
|
+
return Math.min(MAX_DURATION, Math.max(MIN_DURATION, radius / DURATION_DIVISOR));
|
|
57
|
+
}
|
|
58
|
+
const Ripple = ({ disabled = false, className }) => {
|
|
59
|
+
const layerRef = useRef(null);
|
|
60
|
+
const [ripples, setRipples] = useState([]);
|
|
61
|
+
const shouldReduceMotion = useReducedMotion();
|
|
62
|
+
// Monotonic ids. Date.now() collides when two presses land in the same
|
|
63
|
+
// millisecond, which produced duplicate React keys in the previous
|
|
64
|
+
// Button-only implementation.
|
|
65
|
+
const nextId = useRef(0);
|
|
66
|
+
// Read through refs inside the listener so the effect below subscribes once
|
|
67
|
+
// per host rather than re-subscribing whenever these flip.
|
|
68
|
+
const disabledRef = useRef(disabled);
|
|
69
|
+
disabledRef.current = disabled;
|
|
70
|
+
const reducedMotionRef = useRef(shouldReduceMotion);
|
|
71
|
+
reducedMotionRef.current = shouldReduceMotion;
|
|
72
|
+
// Dev warning fires at most once per host, not once per press.
|
|
73
|
+
const warnedRef = useRef(false);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const layer = layerRef.current;
|
|
76
|
+
const host = layer === null || layer === void 0 ? void 0 : layer.parentElement;
|
|
77
|
+
if (!host)
|
|
78
|
+
return;
|
|
79
|
+
// NOTE: no runtime check that the host is positioned. jsdom does not
|
|
80
|
+
// process Tailwind, so `getComputedStyle(host).position` reads "static"
|
|
81
|
+
// for a `relative` host in every test — a warning there is pure noise for
|
|
82
|
+
// us and for consumers. The `relative` contract is documented above and
|
|
83
|
+
// enforced by review.
|
|
84
|
+
// `pointerdown` rather than `click` on purpose: it fires on press instead
|
|
85
|
+
// of release, and a keyboard Enter/Space never produces one — so ripples
|
|
86
|
+
// are pointer-only without any synthetic-click sniffing.
|
|
87
|
+
const handlePointerDown = (event) => {
|
|
88
|
+
if (disabledRef.current || reducedMotionRef.current)
|
|
89
|
+
return;
|
|
90
|
+
if (host.hasAttribute("disabled") || host.getAttribute("aria-disabled") === "true")
|
|
91
|
+
return;
|
|
92
|
+
// Checked per press, not once on mount: a host's interactivity is not
|
|
93
|
+
// static (SelectableCard drops to tabIndex={-1} while disabled), and a
|
|
94
|
+
// mount-time gate would leave the listener permanently detached for any
|
|
95
|
+
// host that starts non-interactive and later becomes pressable.
|
|
96
|
+
if (!isInteractive(host)) {
|
|
97
|
+
if (process.env.NODE_ENV !== "production" && !warnedRef.current) {
|
|
98
|
+
warnedRef.current = true;
|
|
99
|
+
// eslint-disable-next-line no-console
|
|
100
|
+
console.warn("[Ripple]: host is not an interactive element (needs a button/link role or a tab stop) — no ripple will render.");
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const rect = host.getBoundingClientRect();
|
|
105
|
+
const x = event.clientX - rect.left;
|
|
106
|
+
const y = event.clientY - rect.top;
|
|
107
|
+
// Reach the farthest corner, so the ripple always covers the host.
|
|
108
|
+
const dx = Math.max(x, rect.width - x);
|
|
109
|
+
const dy = Math.max(y, rect.height - y);
|
|
110
|
+
const radius = Math.hypot(dx, dy);
|
|
111
|
+
if (radius === 0)
|
|
112
|
+
return;
|
|
113
|
+
setRipples((prev) => [...prev, { id: nextId.current++, x, y, radius }]);
|
|
114
|
+
};
|
|
115
|
+
host.addEventListener("pointerdown", handlePointerDown);
|
|
116
|
+
return () => host.removeEventListener("pointerdown", handlePointerDown);
|
|
117
|
+
}, []);
|
|
118
|
+
const removeRipple = useCallback((id) => {
|
|
119
|
+
setRipples((prev) => prev.filter((ripple) => ripple.id !== id));
|
|
120
|
+
}, []);
|
|
121
|
+
// The layer always mounts, even under reduced motion — the listener bails on
|
|
122
|
+
// `reducedMotionRef` instead. Returning null here would leave the effect
|
|
123
|
+
// above bound against a null ref, so a user turning reduced motion off
|
|
124
|
+
// mid-session would get no ripple until the host remounted.
|
|
125
|
+
return (jsx("span", { ref: layerRef, "aria-hidden": "true", "data-flikkui-ripple": "", className: "absolute inset-0 overflow-hidden rounded-[inherit] pointer-events-none", children: ripples.map((ripple) => (jsx(motion.span, { "data-flikkui-ripple-circle": "", initial: { scale: 0, opacity: 0.2 }, animate: { scale: 1, opacity: 0 }, transition: {
|
|
126
|
+
duration: durationForRadius(ripple.radius),
|
|
127
|
+
ease: "easeOut",
|
|
128
|
+
}, onAnimationComplete: () => removeRipple(ripple.id),
|
|
129
|
+
// Geometry is per-press, so it goes through `style` — an
|
|
130
|
+
// interpolated class name would not exist in the shipped CSS
|
|
131
|
+
// (CLAUDE.md §3).
|
|
132
|
+
style: {
|
|
133
|
+
width: ripple.radius * 2,
|
|
134
|
+
height: ripple.radius * 2,
|
|
135
|
+
left: ripple.x - ripple.radius,
|
|
136
|
+
top: ripple.y - ripple.radius,
|
|
137
|
+
}, className: cn("absolute rounded-full bg-current", className) }, ripple.id))) }));
|
|
138
|
+
};
|
|
139
|
+
Ripple.displayName = "Ripple";
|
|
140
|
+
|
|
141
|
+
export { Ripple };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Variants, Transition } from "motion/react";
|
|
2
|
+
/**
|
|
3
|
+
* Shared press/hover interaction physics for clickable core components
|
|
4
|
+
* (Button, Pill, Badge dismiss). One source of truth so every pressable
|
|
5
|
+
* surface in the library reacts with the same speed and character.
|
|
6
|
+
*
|
|
7
|
+
* Press-down is a fast tween — feedback must land within ~1 frame of the
|
|
8
|
+
* pointer, so no spring ramp-up on the way in. Release is a stiff spring
|
|
9
|
+
* with a hint of overshoot for tactile character on the way out.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: pair with CSS transitions that do NOT include `transform`
|
|
12
|
+
* (no `transition-all`) — motion drives transform directly every frame,
|
|
13
|
+
* and a CSS transition on transform re-interpolates those per-frame
|
|
14
|
+
* values and makes the press feel mushy.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PRESS_TRANSITION: Transition;
|
|
17
|
+
export declare const RELEASE_TRANSITION: Transition;
|
|
18
|
+
export declare const HOVER_TRANSITION: Transition;
|
|
19
|
+
/**
|
|
20
|
+
* Build press variants for a pressable component.
|
|
21
|
+
* Use with `animate="rest"` (so release uses RELEASE_TRANSITION) and
|
|
22
|
+
* `whileTap="press"`; pass `hoverScale` and `whileHover="hover"` for
|
|
23
|
+
* components that should also lift on hover.
|
|
24
|
+
*/
|
|
25
|
+
export declare const createPressVariants: (pressScale?: number, hoverScale?: number) => Variants;
|
|
26
|
+
/**
|
|
27
|
+
* Selection ripple for choice controls (Checkbox, Radio): a soft primary
|
|
28
|
+
* pulse that expands out of the control when it becomes checked.
|
|
29
|
+
*
|
|
30
|
+
* Spread onto a `motion.div` rendered inside `<AnimatePresence initial={false}>`
|
|
31
|
+
* gated on the checked state — `initial={false}` is required so a control
|
|
32
|
+
* that MOUNTS already checked (controlled/defaultChecked) doesn't fire the
|
|
33
|
+
* burst; only user-visible state changes do.
|
|
34
|
+
*/
|
|
35
|
+
export declare const CHECK_RIPPLE_MOTION: {
|
|
36
|
+
readonly initial: {
|
|
37
|
+
readonly scale: 0.5;
|
|
38
|
+
readonly opacity: 0.8;
|
|
39
|
+
};
|
|
40
|
+
readonly animate: {
|
|
41
|
+
readonly scale: 2;
|
|
42
|
+
readonly opacity: 0;
|
|
43
|
+
};
|
|
44
|
+
readonly exit: {
|
|
45
|
+
readonly opacity: 0;
|
|
46
|
+
};
|
|
47
|
+
readonly transition: {
|
|
48
|
+
duration: number;
|
|
49
|
+
ease: "easeOut";
|
|
50
|
+
};
|
|
51
|
+
};
|