@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
|
@@ -15,8 +15,9 @@ const PROGRESS_SPRING_TRANSITION = {
|
|
|
15
15
|
* Progress component - Linear progress bar for tracking completion
|
|
16
16
|
*
|
|
17
17
|
* Features:
|
|
18
|
-
* - Determinate mode: Shows specific progress value (0
|
|
18
|
+
* - Determinate mode: Shows specific progress value (0 to max)
|
|
19
19
|
* - Indeterminate mode: Animated loading state when value is undefined
|
|
20
|
+
* - Continuous bar, or a discrete LED-style meter via `segments`
|
|
20
21
|
* - Multiple sizes with default primary color
|
|
21
22
|
* - className controls the fill bar color (the primary styling target)
|
|
22
23
|
* - wrapperClassName controls the outer container
|
|
@@ -33,10 +34,25 @@ const PROGRESS_SPRING_TRANSITION = {
|
|
|
33
34
|
* // With label
|
|
34
35
|
* <Progress value={75} showLabel labelPosition="right" />
|
|
35
36
|
*
|
|
37
|
+
* // Segmented meter over an arbitrary range
|
|
38
|
+
* <Progress value={214} max={300} segments={24} />
|
|
39
|
+
*
|
|
36
40
|
* // Indeterminate (loading)
|
|
37
41
|
* <Progress />
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
/** Cells within this distance of the leading edge fade out when segmentFade is on */
|
|
44
|
+
const SEGMENT_FADE_DISTANCE = 3;
|
|
45
|
+
/** Opacity of the outermost faded cell */
|
|
46
|
+
const SEGMENT_FADE_MIN_OPACITY = 0.4;
|
|
47
|
+
/** Per-cell entrance stagger, seconds */
|
|
48
|
+
const SEGMENT_STAGGER = 0.03;
|
|
49
|
+
/** Per-cell offset of the indeterminate chase, seconds */
|
|
50
|
+
const SEGMENT_CHASE_STAGGER = 0.06;
|
|
51
|
+
const SEGMENT_ENTRANCE_TRANSITION = {
|
|
52
|
+
duration: 0.25,
|
|
53
|
+
ease: "easeOut",
|
|
54
|
+
};
|
|
55
|
+
const Progress = React__default.forwardRef(({ value, max = 100, segments, segmentFade = false, size = "md", showLabel = false, labelPosition = "right", formatLabel, animated = true, wrapperClassName, className, theme: customTheme, 'aria-label': consumerAriaLabel, ...props }, ref) => {
|
|
40
56
|
const shouldReduceMotion = useReducedMotion();
|
|
41
57
|
// Merge custom theme with default theme
|
|
42
58
|
const theme = useMemo(() => {
|
|
@@ -46,16 +62,38 @@ const Progress = React__default.forwardRef(({ value, size = "md", showLabel = fa
|
|
|
46
62
|
...progressTheme,
|
|
47
63
|
...customTheme,
|
|
48
64
|
sizes: { ...progressTheme.sizes, ...customTheme.sizes },
|
|
65
|
+
segmentSizes: { ...progressTheme.segmentSizes, ...customTheme.segmentSizes },
|
|
49
66
|
};
|
|
50
67
|
}, [customTheme]);
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
// Dev-time warnings for common issues
|
|
69
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
if (segments !== undefined && (!Number.isInteger(segments) || segments < 1)) {
|
|
71
|
+
// eslint-disable-next-line no-console
|
|
72
|
+
console.warn(`Progress: 'segments' must be a positive integer, received ${segments}. Falling back to the continuous bar.`);
|
|
73
|
+
}
|
|
74
|
+
if (max <= 0) {
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.warn(`Progress: 'max' must be greater than 0, received ${max}.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Segmented rendering is opted into by passing a usable cell count.
|
|
80
|
+
const segmentCount = segments !== undefined && Number.isInteger(segments) && segments >= 1
|
|
81
|
+
? segments
|
|
82
|
+
: undefined;
|
|
83
|
+
const isSegmented = segmentCount !== undefined;
|
|
57
84
|
// Determine if this is indeterminate mode
|
|
58
85
|
const isIndeterminate = value === undefined || value === null;
|
|
86
|
+
// The value clamped into [0, max]. Rounded, matching the historical behaviour
|
|
87
|
+
// of the 0-100 form.
|
|
88
|
+
const clampedValue = useMemo(() => {
|
|
89
|
+
if (value === undefined || value === null)
|
|
90
|
+
return 0;
|
|
91
|
+
return Math.min(Math.max(Math.round(value), 0), Math.max(max, 0));
|
|
92
|
+
}, [value, max]);
|
|
93
|
+
// Position within the range, 0-1
|
|
94
|
+
const ratio = max > 0 ? clampedValue / max : 0;
|
|
95
|
+
// Calculate percentage (0-100) for labels and the continuous fill
|
|
96
|
+
const percentage = useMemo(() => Math.round(ratio * 100), [ratio]);
|
|
59
97
|
// Format the label
|
|
60
98
|
const label = useMemo(() => {
|
|
61
99
|
if (formatLabel)
|
|
@@ -86,6 +124,10 @@ const Progress = React__default.forwardRef(({ value, size = "md", showLabel = fa
|
|
|
86
124
|
if (!showLabel || isIndeterminate)
|
|
87
125
|
return null;
|
|
88
126
|
if (labelPosition === "inside") {
|
|
127
|
+
// No continuous track to sit inside, and a label straddling the cells
|
|
128
|
+
// would be unreadable
|
|
129
|
+
if (isSegmented)
|
|
130
|
+
return null;
|
|
89
131
|
// Only show inside label for lg size (enough height)
|
|
90
132
|
if (size !== "lg")
|
|
91
133
|
return null;
|
|
@@ -100,10 +142,36 @@ const Progress = React__default.forwardRef(({ value, size = "md", showLabel = fa
|
|
|
100
142
|
// Indeterminate animation
|
|
101
143
|
jsx("div", { className: cn(theme.fillStyle, "absolute", theme.indeterminateStyle, className) })) : shouldAnimate ? (
|
|
102
144
|
// Animated determinate progress with spring animation (scaleX avoids layout recalculation)
|
|
103
|
-
jsx(motion.div, { className: cn(theme.fillStyle, className), style: { width: '100%', transformOrigin: 'left' }, initial: { scaleX: 0 }, animate: { scaleX:
|
|
145
|
+
jsx(motion.div, { className: cn(theme.fillStyle, className), style: { width: '100%', transformOrigin: 'left' }, initial: { scaleX: 0 }, animate: { scaleX: ratio }, transition: PROGRESS_SPRING_TRANSITION })) : (
|
|
104
146
|
// Static determinate progress
|
|
105
|
-
jsx("div", { className: cn(theme.fillStyle, className), style: { width: `${
|
|
106
|
-
|
|
147
|
+
jsx("div", { className: cn(theme.fillStyle, className), style: { width: `${ratio * 100}%` } })), showLabel && labelPosition === "inside" && size === "lg" && !isIndeterminate && (jsx("span", { className: theme.insideLabelStyle, children: label }))] }));
|
|
148
|
+
// Discrete cell row — the LED-style meter. Each cell paints the empty fill,
|
|
149
|
+
// and lit cells stack a coloured overlay on top so the base stays visible
|
|
150
|
+
// underneath while the overlay fades in.
|
|
151
|
+
const renderSegmentedTrack = () => {
|
|
152
|
+
const { height, gap } = theme.segmentSizes[size];
|
|
153
|
+
const litCount = Math.round(ratio * segmentCount);
|
|
154
|
+
return (jsx("div", { className: cn(theme.segmentTrackStyle, gap, wrapperClassName), children: Array.from({ length: segmentCount }, (_, i) => {
|
|
155
|
+
const isLit = !isIndeterminate && i < litCount;
|
|
156
|
+
// Cells nearest the leading edge dim toward it
|
|
157
|
+
const distanceFromEdge = litCount - i;
|
|
158
|
+
const fillOpacity = segmentFade && distanceFromEdge <= SEGMENT_FADE_DISTANCE
|
|
159
|
+
? SEGMENT_FADE_MIN_OPACITY +
|
|
160
|
+
(distanceFromEdge / SEGMENT_FADE_DISTANCE) *
|
|
161
|
+
(1 - SEGMENT_FADE_MIN_OPACITY)
|
|
162
|
+
: 1;
|
|
163
|
+
// While indeterminate every cell carries the overlay so the chase
|
|
164
|
+
// reads in the fill colour rather than in the muted empty fill.
|
|
165
|
+
const isChasing = isIndeterminate && shouldAnimate;
|
|
166
|
+
const fillClassName = cn(theme.segmentFillStyle, className, isChasing && theme.segmentChaseStyle);
|
|
167
|
+
return (jsx("div", { "data-progress-segment": "", "data-state": isLit ? "filled" : "empty", className: cn(theme.segmentStyle, height, theme.segmentEmptyStyle), children: isChasing ? (jsx("div", { className: fillClassName, style: { animationDelay: `${i * SEGMENT_CHASE_STAGGER}s` } })) : isLit && shouldAnimate ? (jsx(motion.div, { className: fillClassName, initial: { opacity: 0 }, animate: { opacity: fillOpacity }, transition: {
|
|
168
|
+
...SEGMENT_ENTRANCE_TRANSITION,
|
|
169
|
+
delay: i * SEGMENT_STAGGER,
|
|
170
|
+
} })) : isLit ? (jsx("div", { className: fillClassName, style: { opacity: fillOpacity } })) : null }, i));
|
|
171
|
+
}) }));
|
|
172
|
+
};
|
|
173
|
+
const trackNode = isSegmented ? renderSegmentedTrack() : renderTrack();
|
|
174
|
+
return (jsxs("div", { ref: ref, className: cn(theme.containerStyle, containerLayoutClass), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": isIndeterminate ? undefined : clampedValue, "aria-label": consumerAriaLabel !== null && consumerAriaLabel !== void 0 ? consumerAriaLabel : (isIndeterminate ? "Loading" : `${percentage}% complete`), ...props, children: [labelPosition === "top" && renderLabel(), labelPosition === "right" ? (jsxs(Fragment, { children: [jsx("div", { className: "flex-1", children: trackNode }), renderLabel()] })) : (trackNode), labelPosition === "bottom" && renderLabel()] }));
|
|
107
175
|
});
|
|
108
176
|
Progress.displayName = "Progress";
|
|
109
177
|
|
|
@@ -20,6 +20,23 @@ const progressTheme = {
|
|
|
20
20
|
},
|
|
21
21
|
// Indeterminate animation styles
|
|
22
22
|
indeterminateStyle: "animate-[progress-indeterminate_1.8s_linear_infinite]",
|
|
23
|
+
// Row holding the segment cells — no track fill, rounding or clipping here;
|
|
24
|
+
// each cell paints its own background.
|
|
25
|
+
segmentTrackStyle: "flex items-end w-full",
|
|
26
|
+
// A single segment cell. flex-1 so the row always fills its container
|
|
27
|
+
// regardless of how many cells were asked for.
|
|
28
|
+
segmentStyle: "relative rounded-sm flex-1",
|
|
29
|
+
// Lit overlay — `className` lands here, so it carries the fill colour.
|
|
30
|
+
segmentFillStyle: "absolute inset-0 rounded-sm bg-[var(--color-primary)]",
|
|
31
|
+
segmentEmptyStyle: "bg-[var(--color-surface-sunken)]",
|
|
32
|
+
// Deliberately NOT the continuous `sizes` ramp (h-1.5/h-2.5/h-4) — at that
|
|
33
|
+
// height a cell reads as noise rather than a lit segment.
|
|
34
|
+
segmentSizes: {
|
|
35
|
+
sm: { height: "h-4", gap: "gap-[2px]" },
|
|
36
|
+
md: { height: "h-6", gap: "gap-[3px]" },
|
|
37
|
+
lg: { height: "h-8", gap: "gap-1" },
|
|
38
|
+
},
|
|
39
|
+
segmentChaseStyle: "animate-[progress-segment-chase_1.2s_ease-in-out_infinite]",
|
|
23
40
|
};
|
|
24
41
|
|
|
25
42
|
export { progressTheme };
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type ProgressSize = "sm" | "md" | "lg";
|
|
3
3
|
export type ProgressLabelPosition = "right" | "top" | "bottom" | "inside";
|
|
4
|
+
/**
|
|
5
|
+
* Per-size geometry for the segmented form.
|
|
6
|
+
*
|
|
7
|
+
* Two keys rather than a single class string because the two values land on
|
|
8
|
+
* different elements: `height` on each cell, `gap` on the row that holds them.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProgressSegmentSize {
|
|
11
|
+
/** Height of a single segment cell */
|
|
12
|
+
height: string;
|
|
13
|
+
/** Gap between segment cells (applied to the row) */
|
|
14
|
+
gap: string;
|
|
15
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* Theme configuration for Progress component
|
|
6
18
|
*/
|
|
@@ -19,6 +31,18 @@ export interface ProgressTheme {
|
|
|
19
31
|
sizes: Record<ProgressSize, string>;
|
|
20
32
|
/** Indeterminate animation styles */
|
|
21
33
|
indeterminateStyle: string;
|
|
34
|
+
/** Row that holds the segment cells (segmented form only) */
|
|
35
|
+
segmentTrackStyle: string;
|
|
36
|
+
/** Base styles for a single segment cell */
|
|
37
|
+
segmentStyle: string;
|
|
38
|
+
/** The lit overlay painted inside a segment cell */
|
|
39
|
+
segmentFillStyle: string;
|
|
40
|
+
/** Fill for an unlit segment cell */
|
|
41
|
+
segmentEmptyStyle: string;
|
|
42
|
+
/** Per-size segment geometry */
|
|
43
|
+
segmentSizes: Record<ProgressSize, ProgressSegmentSize>;
|
|
44
|
+
/** Indeterminate chase animation applied to each segment cell */
|
|
45
|
+
segmentChaseStyle: string;
|
|
22
46
|
}
|
|
23
47
|
/**
|
|
24
48
|
* Theme overrides for Progress component
|
|
@@ -31,13 +55,35 @@ export interface ProgressThemeOverrides {
|
|
|
31
55
|
insideLabelStyle?: string;
|
|
32
56
|
sizes?: Partial<Record<ProgressSize, string>>;
|
|
33
57
|
indeterminateStyle?: string;
|
|
58
|
+
segmentTrackStyle?: string;
|
|
59
|
+
segmentStyle?: string;
|
|
60
|
+
segmentFillStyle?: string;
|
|
61
|
+
segmentEmptyStyle?: string;
|
|
62
|
+
segmentSizes?: Partial<Record<ProgressSize, ProgressSegmentSize>>;
|
|
63
|
+
segmentChaseStyle?: string;
|
|
34
64
|
}
|
|
35
65
|
export interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
36
66
|
/**
|
|
37
|
-
* Progress value from 0 to
|
|
67
|
+
* Progress value, from 0 to `max`.
|
|
38
68
|
* If undefined, the progress bar will be in indeterminate mode.
|
|
39
69
|
*/
|
|
40
70
|
value?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Upper bound of the range `value` is measured against.
|
|
73
|
+
* @default 100
|
|
74
|
+
*/
|
|
75
|
+
max?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Number of cells to render the bar as an LED-style segmented meter.
|
|
78
|
+
*
|
|
79
|
+
* Omitted renders the continuous fill.
|
|
80
|
+
*/
|
|
81
|
+
segments?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Fade the meter out across its last few lit cells (segmented form only).
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
segmentFade?: boolean;
|
|
41
87
|
/**
|
|
42
88
|
* The size of the progress bar
|
|
43
89
|
* @default 'md'
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useState, useMemo, useCallback } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { StarIcon as StarIcon$1 } from '@heroicons/react/24/outline';
|
|
4
|
+
import { Star } from '@phosphor-icons/react';
|
|
6
5
|
import { cn } from '../../../utils/cn.js';
|
|
7
6
|
import { ratingTheme } from './Rating.theme.js';
|
|
8
7
|
|
|
@@ -147,14 +146,14 @@ const Rating = React__default.memo(React__default.forwardRef(({ value: controlle
|
|
|
147
146
|
// Determine which icon to render based on fill state
|
|
148
147
|
const renderStarIcon = () => {
|
|
149
148
|
if (fillState === "full") {
|
|
150
|
-
return iconFilled ? (jsx("span", { className: cn(starSizeClass, filledColorClass), "aria-hidden": "true", children: iconFilled })) : (jsx(
|
|
149
|
+
return iconFilled ? (jsx("span", { className: cn(starSizeClass, filledColorClass), "aria-hidden": "true", children: iconFilled })) : (jsx(Star, { className: cn(starSizeClass, filledColorClass), "aria-hidden": "true" }));
|
|
151
150
|
}
|
|
152
151
|
if (fillState === "half") {
|
|
153
152
|
// Half star: clip a filled star to the left half, overlay on empty star
|
|
154
|
-
return (jsxs("span", { className: cn("relative inline-flex", starSizeClass), "aria-hidden": "true", children: [iconEmpty ? (jsx("span", { className: cn("absolute inset-0", emptyColorClass), children: iconEmpty })) : (jsx(
|
|
153
|
+
return (jsxs("span", { className: cn("relative inline-flex", starSizeClass), "aria-hidden": "true", children: [iconEmpty ? (jsx("span", { className: cn("absolute inset-0", emptyColorClass), children: iconEmpty })) : (jsx(Star, { className: cn("absolute inset-0", starSizeClass, emptyColorClass) })), jsx("span", { className: "absolute inset-0 overflow-hidden", style: { width: "50%" }, children: iconFilled ? (jsx("span", { className: cn(filledColorClass), children: iconFilled })) : (jsx(Star, { className: cn(starSizeClass, filledColorClass) })) })] }));
|
|
155
154
|
}
|
|
156
155
|
// Empty star
|
|
157
|
-
return iconEmpty ? (jsx("span", { className: cn(starSizeClass, emptyColorClass), "aria-hidden": "true", children: iconEmpty })) : (jsx(
|
|
156
|
+
return iconEmpty ? (jsx("span", { className: cn(starSizeClass, emptyColorClass), "aria-hidden": "true", children: iconEmpty })) : (jsx(Star, { className: cn(starSizeClass, emptyColorClass), "aria-hidden": "true" }));
|
|
158
157
|
};
|
|
159
158
|
if (!isInteractive) {
|
|
160
159
|
// Read-only or disabled: render as a non-interactive span
|
|
@@ -6,7 +6,7 @@ const ratingTheme = {
|
|
|
6
6
|
// Base container styles
|
|
7
7
|
baseStyle: "inline-flex items-center",
|
|
8
8
|
// Individual star button styles
|
|
9
|
-
starStyle: "relative inline-flex items-center justify-center shrink-0 transition-transform duration-
|
|
9
|
+
starStyle: "relative inline-flex items-center justify-center shrink-0 transition-transform duration-[var(--motion-duration-fast)] cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1 rounded-sm",
|
|
10
10
|
// Star icon sizes per rating size
|
|
11
11
|
starSizes: {
|
|
12
12
|
sm: "size-4",
|
|
@@ -27,7 +27,7 @@ const ratingTheme = {
|
|
|
27
27
|
danger: "text-[var(--color-danger)]",
|
|
28
28
|
},
|
|
29
29
|
// Empty star color
|
|
30
|
-
emptyColor: "text-[var(--color-
|
|
30
|
+
emptyColor: "text-[var(--color-mono-300)]",
|
|
31
31
|
// State styles
|
|
32
32
|
states: {
|
|
33
33
|
disabled: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
@@ -97,11 +97,12 @@ export interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
97
97
|
*/
|
|
98
98
|
onChange?: (value: number) => void;
|
|
99
99
|
/**
|
|
100
|
-
* Custom filled star icon
|
|
100
|
+
* Custom filled star icon. Defaults to Phosphor `Star` — the built-in filled
|
|
101
|
+
* and empty stars are the same glyph, distinguished by color, not by shape.
|
|
101
102
|
*/
|
|
102
103
|
iconFilled?: ReactNode;
|
|
103
104
|
/**
|
|
104
|
-
* Custom empty star icon
|
|
105
|
+
* Custom empty star icon. Defaults to Phosphor `Star` — see `iconFilled`.
|
|
105
106
|
*/
|
|
106
107
|
iconEmpty?: ReactNode;
|
|
107
108
|
/**
|
|
@@ -393,7 +393,7 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size =
|
|
|
393
393
|
'[&::-webkit-scrollbar-thumb]:bg-transparent',
|
|
394
394
|
'[&[data-scrolling]::-webkit-scrollbar-thumb]:bg-[var(--color-border)]',
|
|
395
395
|
'[&::-webkit-scrollbar-thumb]:transition-colors',
|
|
396
|
-
'[&::-webkit-scrollbar-thumb]:duration-
|
|
396
|
+
'[&::-webkit-scrollbar-thumb]:duration-[var(--motion-duration-slow)]',
|
|
397
397
|
].join(' ');
|
|
398
398
|
case 'hover':
|
|
399
399
|
return [
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const scrollAreaTheme = {
|
|
6
6
|
baseStyle: 'relative h-full w-full',
|
|
7
|
-
scrollbarStyle: 'flex touch-none select-none transition-colors duration-
|
|
7
|
+
scrollbarStyle: 'flex touch-none select-none transition-colors duration-[var(--motion-duration-fast)]',
|
|
8
8
|
thumbStyle: 'relative flex-1 rounded-full bg-[var(--color-border)]/60',
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const segmentedTheme = {
|
|
5
5
|
// Base styles for the segmented container
|
|
6
|
-
baseStyle: "relative flex rounded-[var(--segmented-radius)] bg-
|
|
6
|
+
baseStyle: "relative flex w-fit gap-0.5 rounded-[var(--segmented-radius)] bg-[var(--color-surface-sunken)] border border-[var(--color-border)] p-[var(--segmented-padding)] shadow-inner-real-sm",
|
|
7
7
|
// Size variants using CSS variables
|
|
8
8
|
sizes: {
|
|
9
9
|
sm: "min-h-[var(--segmented-min-h-sm)]",
|
|
@@ -15,19 +15,22 @@ const segmentedTheme = {
|
|
|
15
15
|
// Disabled style
|
|
16
16
|
disabledStyle: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
17
17
|
// Sliding background style with CSS variables
|
|
18
|
-
slidingBackgroundStyle: "absolute top-[0px] left-[0px] rounded-[var(--segmented-inner-radius)] transition-transform duration-
|
|
18
|
+
slidingBackgroundStyle: "absolute top-[0px] left-[0px] rounded-[var(--segmented-inner-radius)] transition-transform duration-[var(--motion-duration-base)] ease-out pointer-events-none z-0 bg-[var(--color-surface)] shadow-real-md",
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Default theme for the SegmentedItem component
|
|
22
22
|
*/
|
|
23
23
|
const segmentedItemTheme = {
|
|
24
24
|
// Base styles for the segmented item
|
|
25
|
-
baseStyle: "relative flex min-w-fit flex-1 items-center justify-center whitespace-nowrap transition-all duration-
|
|
26
|
-
// Size variants using CSS variables
|
|
25
|
+
baseStyle: "relative flex min-w-fit flex-1 items-center justify-center whitespace-nowrap transition-all duration-[var(--motion-duration-base)] rounded-[var(--segmented-inner-radius)] font-medium cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary-500)] focus-visible:ring-offset-1",
|
|
26
|
+
// Size variants using CSS variables. Type reads --segmented-text-size-*
|
|
27
|
+
// (which aliases the shared --form-text-size-* ramp) so lg steps up with its
|
|
28
|
+
// box — it was pinned at text-sm across all three sizes while Button/Input,
|
|
29
|
+
// whose height tokens Segmented literally aliases, both stepped up at lg.
|
|
27
30
|
sizes: {
|
|
28
|
-
sm: "text-sm px-[var(--segmented-px-sm)]",
|
|
29
|
-
md: "text-
|
|
30
|
-
lg: "text-
|
|
31
|
+
sm: "text-[length:var(--segmented-text-size-sm)]/[var(--segmented-line-height-sm)] px-[var(--segmented-px-sm)]",
|
|
32
|
+
md: "text-[length:var(--segmented-text-size-md)]/[var(--segmented-line-height-md)] px-[var(--segmented-px-md)]",
|
|
33
|
+
lg: "text-[length:var(--segmented-text-size-lg)]/[var(--segmented-line-height-lg)] px-[var(--segmented-px-lg)]",
|
|
31
34
|
},
|
|
32
35
|
// Selected state
|
|
33
36
|
selectedStyle: "text-[var(--color-text-primary)] z-10",
|
|
@@ -20,8 +20,11 @@ import { SidebarCard } from './SidebarCard.js';
|
|
|
20
20
|
|
|
21
21
|
// Subtle spring on the sidebar's width animation. Stiffness/damping picked so
|
|
22
22
|
// the effective duration sits in the same ~200ms window as the internal CSS
|
|
23
|
-
// transitions on padding/gap (
|
|
24
|
-
// organic settle instead of a linear cubic-bezier.
|
|
23
|
+
// transitions on padding/gap (`--motion-duration-base`), but with a soft
|
|
24
|
+
// organic settle instead of a linear cubic-bezier. NOTE: this spring is a JS
|
|
25
|
+
// motion/react value and does NOT read that token — a theme retuning
|
|
26
|
+
// --motion-duration-base will shift the CSS transitions but not this spring,
|
|
27
|
+
// so the two would need adjusting together. Damping ratio ≈ 0.9 — a
|
|
25
28
|
// hair under critical so there's a barely-perceptible easing-into-final
|
|
26
29
|
// rather than an overshoot/bounce.
|
|
27
30
|
const SIDEBAR_TRANSITION = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const sidebarTheme = {
|
|
2
|
-
baseStyle: 'group flex flex-col h-full bg-[var(--color-background)] overflow-visible transition-colors duration-
|
|
2
|
+
baseStyle: 'group flex flex-col h-full bg-[var(--color-background)] overflow-visible transition-colors duration-[var(--motion-duration-base)] relative',
|
|
3
3
|
variants: {
|
|
4
4
|
sidebar: 'relative',
|
|
5
5
|
floating: 'relative m-3 h-[calc(100%-1.5rem)] rounded-xl border border-[var(--color-border)] bg-[color-mix(in_oklab,var(--color-background)_85%,transparent)] backdrop-blur-md shadow-[0_8px_30px_rgba(0,0,0,0.03),inset_0_1px_0_rgba(255,255,255,0.05)]',
|
|
6
|
-
inset: 'relative m-3 h-[calc(100%-1.5rem)] rounded-xl bg-[var(--color-
|
|
6
|
+
inset: 'relative m-3 h-[calc(100%-1.5rem)] rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)] shadow-sm',
|
|
7
7
|
},
|
|
8
8
|
sides: {
|
|
9
9
|
left: 'border-r border-[var(--color-border)]',
|
|
@@ -133,11 +133,13 @@ export interface SidebarNavGroupProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
133
133
|
}
|
|
134
134
|
export interface SidebarToggleProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* Icon shown while the sidebar is COLLAPSED — clicking it expands.
|
|
137
|
+
* Falls back to the default chevron.
|
|
137
138
|
*/
|
|
138
139
|
expandIcon?: ReactNode;
|
|
139
140
|
/**
|
|
140
|
-
*
|
|
141
|
+
* Icon shown while the sidebar is EXPANDED — clicking it collapses.
|
|
142
|
+
* Falls back to the default chevron.
|
|
141
143
|
*/
|
|
142
144
|
collapseIcon?: ReactNode;
|
|
143
145
|
}
|
|
@@ -9,7 +9,7 @@ import '../ScrollArea/smooth/SmoothScrollEngine.js';
|
|
|
9
9
|
const SidebarContent = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
10
10
|
const { isCollapsedView } = useSidebarCollapsed();
|
|
11
11
|
const density = useSidebarDensity();
|
|
12
|
-
return (jsx(ScrollArea, { ref: ref, type: "none", size: "thin", className: "flex-1 min-h-0", ...props, children: jsx("div", { className: cn("py-3 transition-[padding] duration-
|
|
12
|
+
return (jsx(ScrollArea, { ref: ref, type: "none", size: "thin", className: "flex-1 min-h-0", ...props, children: jsx("div", { className: cn("py-3 transition-[padding] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)]", density === "compact" && "py-2",
|
|
13
13
|
// Collapsed px-3 (12) on a 60px rail leaves a 36px interior — every
|
|
14
14
|
// child row (NavItem, Sidebar.Search) is exactly 36px wide, matching
|
|
15
15
|
// the 36×36 hit-area target.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { X } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useSidebarContext, useSidebarCollapsed } from './SidebarContext.js';
|
|
7
7
|
import { SidebarToggle } from './SidebarToggle.js';
|
|
@@ -14,7 +14,7 @@ const SidebarHeader = React__default.forwardRef(({ logo, showToggle = true, cust
|
|
|
14
14
|
if (children) {
|
|
15
15
|
return (jsx("div", { ref: ref, className: cn("flex-shrink-0 border-b border-[var(--color-border)]", className), ...props, children: children }));
|
|
16
16
|
}
|
|
17
|
-
return (jsxs("div", { ref: ref, className: cn("flex items-center flex-shrink-0 h-14 border-b border-[var(--color-border)] overflow-visible relative transition-[padding,background-color,border-color] duration-
|
|
17
|
+
return (jsxs("div", { ref: ref, className: cn("flex items-center flex-shrink-0 h-14 border-b border-[var(--color-border)] overflow-visible relative transition-[padding,background-color,border-color] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
18
18
|
// Padding mirrors Sidebar.Content so the header logo sits on the
|
|
19
19
|
// same horizontal track as the NavItem rows below it. px-3 (12px)
|
|
20
20
|
// on the 60px collapsed rail leaves a 36px interior — a 32px logo
|
|
@@ -22,7 +22,7 @@ const SidebarHeader = React__default.forwardRef(({ logo, showToggle = true, cust
|
|
|
22
22
|
// fills the interior exactly. Left-pinned in both states (no
|
|
23
23
|
// `justify-*` toggle) so nothing jumps mid-animation. Same value
|
|
24
24
|
// for collapsed + expanded → no padding transition needed.
|
|
25
|
-
"px-3", className), ...props, children: [jsx("div", { className: "flex items-center min-w-0 flex-1", children: logo }), isMobile && isMobileOpen && (jsx(Button, { variant: "ghost", size: "sm", className: "size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)]", onClick: () => sidebarContext === null || sidebarContext === void 0 ? void 0 : sidebarContext.setMobileOpen(false), "aria-label": "Close navigation", children: jsx(
|
|
25
|
+
"px-3", className), ...props, children: [jsx("div", { className: "flex items-center min-w-0 flex-1", children: logo }), isMobile && isMobileOpen && (jsx(Button, { variant: "ghost", size: "sm", className: "size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)]", onClick: () => sidebarContext === null || sidebarContext === void 0 ? void 0 : sidebarContext.setMobileOpen(false), "aria-label": "Close navigation", children: jsx(X, { className: "size-4" }) })), !isMobile && showToggle && (customToggle || jsx(SidebarToggle, {}))] }));
|
|
26
26
|
});
|
|
27
27
|
SidebarHeader.displayName = "SidebarHeader";
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { List } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useSidebarContext } from './SidebarContext.js';
|
|
7
7
|
import { Button } from '../Button/Button.js';
|
|
@@ -23,7 +23,7 @@ const SidebarMobileTrigger = React__default.forwardRef(({ icon, className, onCli
|
|
|
23
23
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
24
24
|
};
|
|
25
25
|
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, color: _color, ...buttonProps } = props;
|
|
26
|
-
return (jsx(Button, { ref: ref, variant: "soft", size: "sm", className: cn("size-9 p-0", className), onClick: handleClick, "aria-label": "Open navigation menu", ...buttonProps, children: icon || jsx(
|
|
26
|
+
return (jsx(Button, { ref: ref, variant: "soft", size: "sm", className: cn("size-9 p-0", className), onClick: handleClick, "aria-label": "Open navigation menu", ...buttonProps, children: icon || jsx(List, { className: "size-5" }) }));
|
|
27
27
|
});
|
|
28
28
|
SidebarMobileTrigger.displayName = "SidebarMobileTrigger";
|
|
29
29
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { motion, AnimatePresence } from 'motion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { MagnifyingGlass } from '@phosphor-icons/react';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
8
8
|
import '../Tooltip/Tooltip.animations.js';
|
|
@@ -106,7 +106,7 @@ const SidebarSearch = React__default.forwardRef(({ value: controlledValue, defau
|
|
|
106
106
|
// width) and the input fading in/out via AnimatePresence. Adding
|
|
107
107
|
// a justify-* toggle here would snap the icon by 4px on frame 0
|
|
108
108
|
// of every transition.
|
|
109
|
-
"transition-[background-color,box-shadow] duration-
|
|
109
|
+
"transition-[background-color,box-shadow] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)]", "overflow-hidden", isCollapsedView ? shellCollapsed : shellExpanded, inputGroupClassName), children: [jsx("span", { className: cn("flex items-center justify-center flex-shrink-0 pl-2", "text-[var(--color-text-muted)] transition-colors duration-[var(--motion-duration-base)]"), "aria-hidden": !isCollapsedView || undefined, children: iconStart !== null && iconStart !== void 0 ? iconStart : jsx(MagnifyingGlass, { className: "size-5" }) }), jsx(AnimatePresence, { initial: false, children: !isCollapsedView && (jsx(motion.div, { initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -4 }, transition: {
|
|
110
110
|
opacity: { duration: 0.15, ease: [0.4, 0, 0.2, 1] },
|
|
111
111
|
x: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
|
|
112
112
|
}, className: "flex-1 min-w-0 flex items-center overflow-hidden", children: jsx("input", { ref: setInputRef, type: "search", value: value, onChange: handleChange, placeholder: placeholder, "aria-label": collapsedLabel, className: cn(
|
|
@@ -114,7 +114,7 @@ const SidebarSearch = React__default.forwardRef(({ value: controlledValue, defau
|
|
|
114
114
|
// Input pl-3 (12) → text starts at field-x = 28 + 12 = 40,
|
|
115
115
|
// giving a 12px icon→text gap (matches <Input iconStart>'s
|
|
116
116
|
// pl-3 + pl-10 = 12px convention).
|
|
117
|
-
"w-full bg-transparent border-0 outline-none text-sm py-2 pl-3 pr-3", "text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)]"
|
|
117
|
+
"w-full bg-transparent border-0 outline-none text-sm py-2 pl-3 pr-3", "text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)]") }) }, "search-input")) })] }));
|
|
118
118
|
return (
|
|
119
119
|
// Outer horizontal padding mirrors Sidebar.Content (px-3 collapsed,
|
|
120
120
|
// px-2.5 expanded) so the search row sits on the exact same horizontal
|
|
@@ -123,7 +123,7 @@ const SidebarSearch = React__default.forwardRef(({ value: controlledValue, defau
|
|
|
123
123
|
jsx("div", { className: cn(
|
|
124
124
|
// py-1 keeps the search row in the same vertical rhythm as the
|
|
125
125
|
// NavGroup's `space-y-1` between nav rows.
|
|
126
|
-
"py-1 transition-[padding] duration-
|
|
126
|
+
"py-1 transition-[padding] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)]", isCollapsedView ? "px-3" : "px-2.5", className), ...props, children: isCollapsedView ? (
|
|
127
127
|
// `triggerClassName="block w-full"` makes the Tooltip's wrapping div
|
|
128
128
|
// a full-width block instead of its default `inline-block` — without
|
|
129
129
|
// this, the field collapses to icon-width and sits left-aligned,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { CaretLeft } from '@phosphor-icons/react';
|
|
5
5
|
import { motion } from 'motion/react';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { useSidebarContext } from './SidebarContext.js';
|
|
8
8
|
import { Button } from '../Button/Button.js';
|
|
9
9
|
|
|
10
10
|
const SidebarToggle = React__default.forwardRef(({ expandIcon, collapseIcon, className, onClick, ...props }, ref) => {
|
|
11
|
-
var _a;
|
|
11
|
+
var _a, _b;
|
|
12
12
|
const sidebarContext = useSidebarContext();
|
|
13
13
|
if (!sidebarContext) {
|
|
14
14
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -26,7 +26,7 @@ const SidebarToggle = React__default.forwardRef(({ expandIcon, collapseIcon, cla
|
|
|
26
26
|
const positionClasses = side === "left"
|
|
27
27
|
? "absolute right-0 translate-x-1/2 top-4 z-50"
|
|
28
28
|
: "absolute left-0 -translate-x-1/2 top-4 z-50";
|
|
29
|
-
return (jsx(Button, { ref: ref, iconOnly: true, variant: "ghost", className: cn("size-6 p-0 rounded-full border border-[var(--color-border)] bg-[var(--color-background)]/50 backdrop-blur-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] hover:shadow-md hover:bg-[var(--color-surface-hover)] opacity-100 transition-all duration-
|
|
29
|
+
return (jsx(Button, { ref: ref, iconOnly: true, variant: "ghost", className: cn("size-6 p-0 rounded-full border border-[var(--color-border)] bg-[var(--color-background)]/50 backdrop-blur-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] hover:shadow-md hover:bg-[var(--color-surface-hover)] opacity-100 transition-all duration-[var(--motion-duration-slower)]", positionClasses, className), onClick: handleClick, "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar", title: collapsed ? "Expand sidebar" : "Collapse sidebar", ...buttonProps, children: (_b = (collapsed ? expandIcon : collapseIcon)) !== null && _b !== void 0 ? _b : (jsx(motion.div, { initial: false, animate: { rotate: collapsed ? 180 : 0 }, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] }, className: "flex items-center justify-center", children: jsx(CaretLeft, { className: "size-3", weight: "bold" }) })) }));
|
|
30
30
|
});
|
|
31
31
|
SidebarToggle.displayName = "SidebarToggle";
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { CaretUpDown } from '@phosphor-icons/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { motion, AnimatePresence } from 'motion/react';
|
|
7
7
|
import { useSidebarCollapsed } from './SidebarContext.js';
|
|
@@ -21,7 +21,7 @@ const SidebarUserProfile = React__default.forwardRef(({ name, email, avatar, sta
|
|
|
21
21
|
// Strip drag/animation DOM handlers that collide with motion's prop types
|
|
22
22
|
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, ...motionSafeProps } = props;
|
|
23
23
|
const avatarElement = (jsx(Avatar, { src: avatar, name: name, status: status !== null && status !== void 0 ? status : "none", className: "size-9" }));
|
|
24
|
-
const content = (jsxs(motion.div, { ref: ref, className: cn("flex w-full items-center rounded-[var(--radius-base)] cursor-pointer border border-transparent transition-[padding,gap,background-color,border-color,color,box-shadow] duration-
|
|
24
|
+
const content = (jsxs(motion.div, { ref: ref, className: cn("flex w-full items-center rounded-[var(--radius-base)] cursor-pointer border border-transparent transition-[padding,gap,background-color,border-color,color,box-shadow] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)] ", isCollapsedView ? "justify-center gap-0 px-1" : "gap-2 ", className), role: "button", tabIndex: 0, onClick: onClick, onKeyDown: (e) => {
|
|
25
25
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
26
26
|
e.preventDefault();
|
|
27
27
|
e.currentTarget.click();
|
|
@@ -37,7 +37,7 @@ const SidebarUserProfile = React__default.forwardRef(({ name, email, avatar, sta
|
|
|
37
37
|
className: "flex-shrink-0", children: avatarElement }), jsx(AnimatePresence, { initial: false, children: !isCollapsedView && (jsxs(motion.div, { className: "flex flex-row items-center gap-2 flex-1 min-w-0 overflow-hidden whitespace-nowrap", initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -4 }, transition: {
|
|
38
38
|
opacity: { duration: 0.15, ease: [0.4, 0, 0.2, 1] },
|
|
39
39
|
x: { duration: 0.2, ease: [0.4, 0, 0.2, 1] }
|
|
40
|
-
}, children: [children !== null && children !== void 0 ? children : (jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: name }), email && (jsx("div", { className: "text-xs text-[var(--color-text-secondary)]/80 truncate", children: email }))] })), dropdownContent && (jsx(
|
|
40
|
+
}, children: [children !== null && children !== void 0 ? children : (jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: name }), email && (jsx("div", { className: "text-xs text-[var(--color-text-secondary)]/80 truncate", children: email }))] })), dropdownContent && (jsx(CaretUpDown, { className: "size-4 flex-shrink-0 text-[var(--color-text-muted)]" }))] }, "profile-text")) })] }));
|
|
41
41
|
// When dropdownContent is provided, the profile acts as a menu trigger.
|
|
42
42
|
if (dropdownContent) {
|
|
43
43
|
return (jsxs(Dropdown, { placement: "right-end", offset: 8, children: [jsx(Dropdown.Trigger, { children: content }), jsx(Dropdown.Menu, { "aria-label": `${name} menu`, children: dropdownContent })] }));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { createContext, useState, useRef, useId, useMemo, useCallback, useEffect, useContext } from 'react';
|
|
4
4
|
import { Reorder, useDragControls, motion } from 'motion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { Lock, List } from '@phosphor-icons/react';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { sortableTheme } from './Sortable.theme.js';
|
|
8
8
|
import { sortableAnimations } from './Sortable.animations.js';
|
|
@@ -212,7 +212,7 @@ const SortableItem = React__default.forwardRef(({ id, children, className, theme
|
|
|
212
212
|
}
|
|
213
213
|
}, value: value || id, id: id, dragListener: !context.showDragHandle && !disabled, dragControls: context.showDragHandle ? dragControls : undefined, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onPointerDown: handlePointerDown, tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), className: cn(theme.itemStyle, context.showDragHandle && 'flex items-center gap-2', disabled && 'opacity-50 cursor-not-allowed', !disabled && !context.showDragHandle && 'cursor-grab active:cursor-grabbing', isBeingDragged && 'shadow-lg z-50', isFocused && !disabled && 'ring-2 ring-blue-500 ring-offset-2', className), style: {
|
|
214
214
|
position: 'relative',
|
|
215
|
-
}, variants: sortableAnimations.variants, animate: isBeingDragged ? 'dragging' : 'idle', transition: sortableAnimations.layout.layout, children: [context.showDragHandle && (jsx(motion.div, { onPointerDown: handleDragHandlePointerDown, className: cn(theme.dragHandleStyle, disabled && 'cursor-not-allowed opacity-60', !disabled && 'cursor-grab active:cursor-grabbing'), whileHover: !disabled ? sortableAnimations.dragHandle.hover : undefined, whileTap: !disabled ? sortableAnimations.dragHandle.tap : undefined, children: disabled ? (jsx(
|
|
215
|
+
}, variants: sortableAnimations.variants, animate: isBeingDragged ? 'dragging' : 'idle', transition: sortableAnimations.layout.layout, children: [context.showDragHandle && (jsx(motion.div, { onPointerDown: handleDragHandlePointerDown, className: cn(theme.dragHandleStyle, disabled && 'cursor-not-allowed opacity-60', !disabled && 'cursor-grab active:cursor-grabbing'), whileHover: !disabled ? sortableAnimations.dragHandle.hover : undefined, whileTap: !disabled ? sortableAnimations.dragHandle.tap : undefined, children: disabled ? (jsx(Lock, { className: "w-4 h-4 text-gray-500" })) : (jsx(List, { className: "w-4 h-4" })) })), jsx("div", { className: "flex-1", children: children })] }));
|
|
216
216
|
});
|
|
217
217
|
SortableItem.displayName = 'SortableItem';
|
|
218
218
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const sortableTheme = {
|
|
2
2
|
containerStyle: "relative list-none",
|
|
3
3
|
itemStyle: "relative cursor-move select-none relative focus-within:z-10 list-none",
|
|
4
|
-
dragHandleStyle: "cursor-grab active:cursor-grabbing p-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] flex items-center justify-center rounded transition-colors duration-
|
|
4
|
+
dragHandleStyle: "cursor-grab active:cursor-grabbing p-1 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] flex items-center justify-center rounded transition-colors duration-[var(--motion-duration-base)]",
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export { sortableTheme };
|