@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
|
@@ -5,7 +5,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
5
5
|
import '../Modal/Modal.js';
|
|
6
6
|
import { modalTheme, modalSizeVariants } from '../Modal/Modal.theme.js';
|
|
7
7
|
import { SurfaceProvider, surfaceClasses } from '../../../theme/SurfaceContext.js';
|
|
8
|
-
import {
|
|
8
|
+
import { ArrowLeft } from '@phosphor-icons/react';
|
|
9
9
|
import { modalStackTheme } from './ModalStack.theme.js';
|
|
10
10
|
import { Link } from '../Link/Link.js';
|
|
11
11
|
import { ModalContext } from '../Modal/ModalContext.js';
|
|
@@ -47,7 +47,9 @@ const ModalStackModal = ({ size = "md", showCloseButton = true, showBackButton =
|
|
|
47
47
|
titleId,
|
|
48
48
|
subtitleId,
|
|
49
49
|
}), [closeHandler, size, isSizeToken, showCloseButton, theme, isBodyScrollable, setIsBodyScrollable, titleId, subtitleId]);
|
|
50
|
-
return (jsx(ModalContext.Provider, { value: contextValue, children: jsx("div", { className: cn(
|
|
50
|
+
return (jsx(ModalContext.Provider, { value: contextValue, children: jsx("div", { className: cn(
|
|
51
|
+
// Opaque — same reason as Modal: behind the shared scrim, no blur on the panel.
|
|
52
|
+
surfaceClasses(surfaceLevel, { translucent: false, shadow: false }), theme.container, modalSizeVariants[size], className), role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": subtitleId, children: jsxs(SurfaceProvider, { level: surfaceLevel, children: [showBackButton && (jsx("div", { className: cn(modalStackTheme.backButton), children: jsxs(Link, { onClick: backHandler, "aria-label": "Go back", size: "sm", children: [jsx(ArrowLeft, { className: "size-4" }), "Back"] }) })), children] }) }) }));
|
|
51
53
|
};
|
|
52
54
|
ModalStackModal.displayName = "ModalStack.Modal";
|
|
53
55
|
|
|
@@ -14,7 +14,8 @@ import { useSidebarContext, useAccordionNavContext, useSidebarDensity } from '..
|
|
|
14
14
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
15
15
|
import '../Tooltip/Tooltip.animations.js';
|
|
16
16
|
import { Badge } from '../Badge/Badge.js';
|
|
17
|
-
import {
|
|
17
|
+
import { CaretDown } from '@phosphor-icons/react';
|
|
18
|
+
import { Ripple } from '../shared/Ripple.js';
|
|
18
19
|
import { AnimatePresence, motion } from 'motion/react';
|
|
19
20
|
|
|
20
21
|
const NavItem = React__default.forwardRef(({ children, startContent, endContent, notification, description, shortcut, href, onClick, active = false, isDisabled = false, hasSubmenu: propHasSubmenu = false, expanded: controlledExpanded, onToggleExpanded, items, defaultExpanded = false, level = 0, showTooltipWhenCollapsed = true, className, theme: customTheme = {}, ...props }, ref) => {
|
|
@@ -125,7 +126,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
125
126
|
return (jsx("span", { className: cn(navItemTheme.notificationDot, customTheme.notificationDot) }));
|
|
126
127
|
}
|
|
127
128
|
if (typeof notification === "number" && notification > 0) {
|
|
128
|
-
return (jsx(Badge, { color: "
|
|
129
|
+
return (jsx(Badge, { color: "mono", variant: "soft", size: "sm", children: notification > 99 ? "99+" : notification }));
|
|
129
130
|
}
|
|
130
131
|
return null;
|
|
131
132
|
}, [notification, customTheme.notificationDot]);
|
|
@@ -186,7 +187,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
186
187
|
const iconClasses = cn(theme.icon, getIconStateClasses(), hasSubmenu && isExpanded && !isActive && "opacity-100", isCollapsedView && ((_b = theme.collapsed) === null || _b === void 0 ? void 0 : _b.icon), isHoveredOrDropdownOpen && "opacity-100");
|
|
187
188
|
const textClasses = cn(theme.text);
|
|
188
189
|
// Chevron for submenu
|
|
189
|
-
const chevron = hasSubmenu && !isCollapsedView ? (jsx(
|
|
190
|
+
const chevron = hasSubmenu && !isCollapsedView ? (jsx(CaretDown, { weight: "bold", className: cn("size-4 transition-transform duration-[var(--motion-duration-base)] text-[var(--color-text-muted)]", isExpanded && "text-[var(--color-text-primary)]", isExpanded && "rotate-180") })) : null;
|
|
190
191
|
// Strip drag/animation DOM handlers that collide with motion's prop types.
|
|
191
192
|
// `onSubmit`/`onSubmitCapture` are stripped too: NavItem renders as either
|
|
192
193
|
// `motion.a` or `motion.button`, but `NavItemProps extends HTMLAttributes<HTMLElement>`
|
|
@@ -230,7 +231,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
230
231
|
? ` (${notification} unread)`
|
|
231
232
|
: notification === true
|
|
232
233
|
? " (unread)"
|
|
233
|
-
: null] }))] }));
|
|
234
|
+
: null] })), jsx(Ripple, { disabled: isDisabled })] }));
|
|
234
235
|
// Content component
|
|
235
236
|
const content = href && !hasSubmenu ? (jsx(motion.a, { ref: ref, href: isDisabled ? undefined : href, tabIndex: isDisabled ? -1 : undefined, ...interactionProps, children: innerContent })) : (jsx(motion.button, { ref: ref, type: "button", disabled: isDisabled, ...interactionProps, children: innerContent }));
|
|
236
237
|
// Self-contained submenu
|
|
@@ -255,7 +256,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
255
256
|
delay: idx * 0.055,
|
|
256
257
|
duration: 0.16,
|
|
257
258
|
ease: "easeOut",
|
|
258
|
-
}, className: "absolute left-[-6px] top-1/2 h-[calc(100%+0.125rem)] w-px origin-top bg-[var(--color-
|
|
259
|
+
}, className: "absolute left-[-6px] top-1/2 h-[calc(100%+0.125rem)] w-px origin-top bg-[var(--color-mono-400)] dark:bg-[var(--color-mono-600)]", "aria-hidden": "true" })), jsx(motion.span, { initial: { opacity: 0, scale: 0.5 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.5 }, transition: {
|
|
259
260
|
delay: idx * 0.055,
|
|
260
261
|
type: "spring",
|
|
261
262
|
stiffness: 520,
|
|
@@ -263,7 +264,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
263
264
|
mass: 0.6,
|
|
264
265
|
}, className: cn("absolute left-[-8.5px] top-1/2 z-10 size-1.5 -translate-y-1/2 rounded-full", item.active
|
|
265
266
|
? "bg-[var(--color-primary)]"
|
|
266
|
-
: "bg-[var(--color-
|
|
267
|
+
: "bg-[var(--color-mono-400)] dark:bg-[var(--color-mono-600)]"), "aria-hidden": "true" }), jsx(motion.div, { initial: { opacity: 0, x: -6 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -6 }, transition: {
|
|
267
268
|
delay: idx * 0.055 + 0.035,
|
|
268
269
|
type: "spring",
|
|
269
270
|
stiffness: 460,
|
|
@@ -291,7 +292,7 @@ const NavItem = React__default.forwardRef(({ children, startContent, endContent,
|
|
|
291
292
|
return (jsx("span", { className: cn(theme.notificationDot, customTheme.notificationDot) }));
|
|
292
293
|
}
|
|
293
294
|
if (typeof item.notification === "number" && item.notification > 0) {
|
|
294
|
-
return (jsx(Badge, { color: "
|
|
295
|
+
return (jsx(Badge, { color: "mono", variant: "soft", size: "sm", children: item.notification > 99 ? "99+" : item.notification }));
|
|
295
296
|
}
|
|
296
297
|
return null;
|
|
297
298
|
})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const navItemTheme = {
|
|
2
|
-
baseStyle: "group relative flex items-center gap-3 px-2.5 py-2 text-sm font-medium cursor-pointer select-none w-full rounded-[var(--nav-item-radius)] outline-none overflow-hidden transition-[padding,gap,height,background-color,border-color,color,box-shadow] duration-
|
|
2
|
+
baseStyle: "group relative flex items-center gap-3 px-2.5 py-2 text-sm font-medium cursor-pointer select-none w-full rounded-[var(--nav-item-radius)] outline-none overflow-hidden transition-[padding,gap,height,background-color,border-color,color,box-shadow] duration-[var(--motion-duration-base)] ease-[cubic-bezier(0.4,0,0.2,1)] text-left",
|
|
3
3
|
icon: "size-5",
|
|
4
4
|
text: "flex-1 min-w-0 truncate",
|
|
5
5
|
// State styling resolved in JS to plain utility classes so `className` overrides win
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Variants } from "motion/react";
|
|
2
|
+
import type { OfflineIndicatorPosition, OfflineIndicatorVariant } from "./OfflineIndicator.types";
|
|
3
|
+
/**
|
|
4
|
+
* Custom spring preset for offline indicator to give it a satisfying, subtle bounce.
|
|
5
|
+
*/
|
|
6
|
+
export declare const indicatorSpring: {
|
|
7
|
+
type: "spring";
|
|
8
|
+
stiffness: number;
|
|
9
|
+
damping: number;
|
|
10
|
+
mass: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Generates context-aware animation variants for OfflineIndicator.
|
|
14
|
+
* Dynamically adjusts translation side/axis based on screen placement.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Fade-only variants for prefers-reduced-motion users — the status pill
|
|
18
|
+
* still appears/disappears (it's a role="status" signal), just without
|
|
19
|
+
* translation, scale, or bounce.
|
|
20
|
+
*/
|
|
21
|
+
export declare const reducedMotionIndicatorVariants: Variants;
|
|
22
|
+
export declare const getOfflineIndicatorVariants: (position: OfflineIndicatorPosition, variant: OfflineIndicatorVariant) => Variants;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* Custom spring preset for offline indicator to give it a satisfying, subtle bounce.
|
|
4
|
+
*/
|
|
5
|
+
const indicatorSpring = {
|
|
6
|
+
type: "spring",
|
|
7
|
+
stiffness: 260,
|
|
8
|
+
damping: 26,
|
|
9
|
+
mass: 1,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Generates context-aware animation variants for OfflineIndicator.
|
|
13
|
+
* Dynamically adjusts translation side/axis based on screen placement.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Fade-only variants for prefers-reduced-motion users — the status pill
|
|
17
|
+
* still appears/disappears (it's a role="status" signal), just without
|
|
18
|
+
* translation, scale, or bounce.
|
|
19
|
+
*/
|
|
20
|
+
const reducedMotionIndicatorVariants = {
|
|
21
|
+
initial: { opacity: 0 },
|
|
22
|
+
animate: { opacity: 1, transition: { duration: 0.15 } },
|
|
23
|
+
exit: { opacity: 0, transition: { duration: 0.15 } },
|
|
24
|
+
};
|
|
25
|
+
const getOfflineIndicatorVariants = (position, variant) => {
|
|
26
|
+
const isTop = position.startsWith("top");
|
|
27
|
+
// Toast variants slide and scale, Banner variants just slide to maintain bleed styling
|
|
28
|
+
const yOffset = isTop ? -24 : 24;
|
|
29
|
+
const initialScale = variant === "banner" ? 1 : 0.92;
|
|
30
|
+
return {
|
|
31
|
+
initial: {
|
|
32
|
+
opacity: 0,
|
|
33
|
+
y: yOffset,
|
|
34
|
+
scale: initialScale,
|
|
35
|
+
},
|
|
36
|
+
animate: {
|
|
37
|
+
opacity: 1,
|
|
38
|
+
y: 0,
|
|
39
|
+
scale: 1,
|
|
40
|
+
transition: indicatorSpring,
|
|
41
|
+
},
|
|
42
|
+
exit: {
|
|
43
|
+
opacity: 0,
|
|
44
|
+
y: yOffset,
|
|
45
|
+
scale: initialScale,
|
|
46
|
+
transition: {
|
|
47
|
+
duration: 0.18,
|
|
48
|
+
ease: "easeIn",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getOfflineIndicatorVariants, indicatorSpring, reducedMotionIndicatorVariants };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { useState, useEffect, useMemo } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { AnimatePresence, motion } from 'motion/react';
|
|
4
|
+
import { WifiSlash, CheckCircle } from '@phosphor-icons/react';
|
|
5
|
+
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
6
6
|
import { cn } from '../../../utils/cn.js';
|
|
7
7
|
import { useNetworkStatus } from '../../../hooks/useNetworkStatus.js';
|
|
8
8
|
import { getDefaultQueue } from '../../../utils/actionQueue.js';
|
|
9
|
+
import { Link } from '../Link/Link.js';
|
|
10
|
+
import { reducedMotionIndicatorVariants, getOfflineIndicatorVariants } from './OfflineIndicator.animations.js';
|
|
9
11
|
import { offlineIndicatorTheme } from './OfflineIndicator.theme.js';
|
|
10
12
|
|
|
13
|
+
const isOfflineIndicatorAction = (action) => typeof action === "object" &&
|
|
14
|
+
action !== null &&
|
|
15
|
+
"label" in action &&
|
|
16
|
+
"onClick" in action;
|
|
11
17
|
/**
|
|
12
18
|
* OfflineIndicator - Visual indicator for offline status
|
|
13
19
|
*
|
|
@@ -21,9 +27,10 @@ import { offlineIndicatorTheme } from './OfflineIndicator.theme.js';
|
|
|
21
27
|
* // Custom position and variant
|
|
22
28
|
* <OfflineIndicator position="bottom-right" variant="badge" />
|
|
23
29
|
*/
|
|
24
|
-
const OfflineIndicator = React__default.forwardRef(({ position = "top", showQueueCount = false, queue, variant = "toast", autoHideOnline = true, autoHideDelay = 5000, offlineMessage = "You're offline", onlineMessage = "Back online", className, }, ref) => {
|
|
25
|
-
var _a, _b;
|
|
30
|
+
const OfflineIndicator = React__default.forwardRef(({ position = "top", showQueueCount = false, queue, variant = "toast", autoHideOnline = true, autoHideDelay = 5000, offlineMessage = "You're offline", onlineMessage = "Back online", action, className, }, ref) => {
|
|
31
|
+
var _a, _b, _c;
|
|
26
32
|
const theme = offlineIndicatorTheme;
|
|
33
|
+
const shouldReduceMotion = useReducedMotion();
|
|
27
34
|
const { isOnline, wasOffline } = useNetworkStatus();
|
|
28
35
|
const [isVisible, setIsVisible] = useState(false);
|
|
29
36
|
const [queueSize, setQueueSize] = useState(0);
|
|
@@ -73,29 +80,21 @@ const OfflineIndicator = React__default.forwardRef(({ position = "top", showQueu
|
|
|
73
80
|
autoHideOnline,
|
|
74
81
|
autoHideDelay,
|
|
75
82
|
]);
|
|
76
|
-
// Animation variants
|
|
77
|
-
const animationVariants = useMemo(() =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
y: position.startsWith("top") ? -20 : 20,
|
|
81
|
-
scale: 0.95,
|
|
82
|
-
},
|
|
83
|
-
animate: {
|
|
84
|
-
opacity: 1,
|
|
85
|
-
y: 0,
|
|
86
|
-
scale: 1,
|
|
87
|
-
},
|
|
88
|
-
exit: {
|
|
89
|
-
opacity: 0,
|
|
90
|
-
y: position.startsWith("top") ? -20 : 20,
|
|
91
|
-
scale: 0.95,
|
|
92
|
-
},
|
|
93
|
-
}), [position]);
|
|
83
|
+
// Animation variants — fade-only under prefers-reduced-motion (§12)
|
|
84
|
+
const animationVariants = useMemo(() => shouldReduceMotion
|
|
85
|
+
? reducedMotionIndicatorVariants
|
|
86
|
+
: getOfflineIndicatorVariants(position, variant), [shouldReduceMotion, position, variant]);
|
|
94
87
|
const isOffline = !isOnline;
|
|
95
|
-
const Icon = isOffline ?
|
|
88
|
+
const Icon = isOffline ? WifiSlash : CheckCircle;
|
|
96
89
|
const message = isOffline ? offlineMessage : onlineMessage;
|
|
97
90
|
const stateStyle = isOffline ? theme.offline : theme.online;
|
|
98
|
-
|
|
91
|
+
// No `layout` on the root motion.div: its FLIP transform would fight the
|
|
92
|
+
// y/scale enter/exit variants on the same element (the documented
|
|
93
|
+
// concurrent layout+transform trap). Content-size changes animate via the
|
|
94
|
+
// children's layout="position" instead.
|
|
95
|
+
return (jsx(AnimatePresence, { children: isVisible && (jsxs(motion.div, { ref: ref, initial: "initial", animate: "animate", exit: "exit", variants: animationVariants, className: cn(theme.base, variant === "banner"
|
|
96
|
+
? (_a = theme.bannerPositions) === null || _a === void 0 ? void 0 : _a[position]
|
|
97
|
+
: (_b = theme.positions) === null || _b === void 0 ? void 0 : _b[position], (_c = theme.variants) === null || _c === void 0 ? void 0 : _c[variant], stateStyle, className), role: "status", "aria-live": "polite", children: [jsx("div", { className: "relative size-3.5 flex-shrink-0", children: jsx(AnimatePresence, { mode: "popLayout", children: jsx(motion.div, { initial: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.5, rotate: -45 }, animate: shouldReduceMotion ? { opacity: 1 } : { opacity: 1, scale: 1, rotate: 0 }, exit: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.5, rotate: 45 }, transition: { duration: 0.25 }, className: "absolute inset-0 flex items-center justify-center", children: jsx(Icon, { className: "size-full", "aria-hidden": "true" }) }, isOffline ? "offline" : "online") }) }), jsxs(motion.span, { layout: shouldReduceMotion ? false : "position", className: theme.message, children: [message, jsx(AnimatePresence, { mode: "popLayout", children: showQueueCount && queueSize > 0 && isOffline && (jsxs(motion.span, { initial: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.8 }, animate: shouldReduceMotion ? { opacity: 1 } : { opacity: 1, scale: 1 }, exit: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.8 }, transition: { duration: 0.18 }, className: theme.queueCount, children: ["(", queueSize, " action", queueSize !== 1 ? "s" : "", " queued)"] })) })] }), jsx(AnimatePresence, { children: action != null && isOffline && (jsx(motion.div, { layout: shouldReduceMotion ? false : "position", initial: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.9 }, animate: shouldReduceMotion ? { opacity: 1 } : { opacity: 1, scale: 1 }, exit: shouldReduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.9 }, transition: { duration: 0.2 }, className: "inline-flex items-center flex-shrink-0", children: isOfflineIndicatorAction(action) ? (jsx(Link, { size: "sm", onClick: action.onClick, className: theme.action, children: action.label })) : (action) })) })] })) }));
|
|
99
98
|
});
|
|
100
99
|
OfflineIndicator.displayName = "OfflineIndicator";
|
|
101
100
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const offlineIndicatorTheme = {
|
|
2
|
-
base: "fixed z-50 flex items-center gap-
|
|
2
|
+
base: "fixed z-50 flex items-center gap-1.5 transition-colors duration-[var(--motion-duration-slow)] select-none",
|
|
3
3
|
positions: {
|
|
4
4
|
top: "top-4 left-1/2 -translate-x-1/2",
|
|
5
5
|
bottom: "bottom-4 left-1/2 -translate-x-1/2",
|
|
@@ -8,14 +8,35 @@ const offlineIndicatorTheme = {
|
|
|
8
8
|
"bottom-left": "bottom-4 left-4",
|
|
9
9
|
"bottom-right": "bottom-4 right-4",
|
|
10
10
|
},
|
|
11
|
+
// Banner is an edge-to-edge bar, so it collapses every position to the
|
|
12
|
+
// flush viewport edge — only the top/bottom half of `position` matters.
|
|
13
|
+
bannerPositions: {
|
|
14
|
+
top: "top-0",
|
|
15
|
+
bottom: "bottom-0",
|
|
16
|
+
"top-left": "top-0",
|
|
17
|
+
"top-right": "top-0",
|
|
18
|
+
"bottom-left": "bottom-0",
|
|
19
|
+
"bottom-right": "bottom-0",
|
|
20
|
+
},
|
|
11
21
|
variants: {
|
|
12
|
-
|
|
13
|
-
|
|
22
|
+
// translate-x-0 cancels the centered positions' -translate-x-1/2 (cn's
|
|
23
|
+
// tailwind-merge lets the variant win) — without it the full-width bar
|
|
24
|
+
// is dragged left by half its own width and clips off-screen.
|
|
25
|
+
banner: "w-full left-0 right-0 translate-x-0 px-4 py-1 justify-center rounded-none shadow-real-lg",
|
|
26
|
+
toast: "px-3 py-2 rounded-[var(--toast-radius)] shadow-real-xl",
|
|
14
27
|
},
|
|
15
|
-
|
|
28
|
+
// Filled-neutral pill: the bare neutral token flips light/dark on its own
|
|
29
|
+
// (dark near-black pill in light mode, light pill in dark mode) and
|
|
30
|
+
// -contrast auto-derives — no hand-picked rungs or dark: inversions (§3).
|
|
31
|
+
offline: "bg-[var(--color-mono)]/90 backdrop-blur-sm text-[var(--color-mono-contrast)]",
|
|
16
32
|
online: "bg-[var(--color-success)]/90 backdrop-blur-sm text-[var(--color-success-contrast)]",
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
// text-inherit keeps the link legible on the inverse pill in BOTH modes
|
|
34
|
+
// (near-black in light, near-white in dark) — a fixed Link color can't.
|
|
35
|
+
action: "text-xs font-semibold text-inherit",
|
|
36
|
+
icon: "size-3.5 flex-shrink-0",
|
|
37
|
+
// tracking-tight IS -0.025em — byte-identical to the arbitrary value it
|
|
38
|
+
// replaces, but routed through --tracking-tight so a theme can retune it.
|
|
39
|
+
message: "text-xs font-medium tracking-tight",
|
|
19
40
|
queueCount: "text-xs opacity-80 ml-1",
|
|
20
41
|
};
|
|
21
42
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import type { ActionQueue } from "../../../utils/actionQueue";
|
|
3
|
+
/**
|
|
4
|
+
* Declarative action rendered after the offline message (e.g. a retry link)
|
|
5
|
+
*/
|
|
6
|
+
export interface OfflineIndicatorAction {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* Position options for OfflineIndicator
|
|
4
12
|
*/
|
|
@@ -27,6 +35,11 @@ export interface OfflineIndicatorProps {
|
|
|
27
35
|
offlineMessage?: string;
|
|
28
36
|
/** Custom online message (shown briefly when reconnecting) */
|
|
29
37
|
onlineMessage?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Action shown next to the message while offline — pass `{ label, onClick }`
|
|
40
|
+
* for a link-styled button (mirrors Toast's `action`), or any ReactNode.
|
|
41
|
+
*/
|
|
42
|
+
action?: OfflineIndicatorAction | ReactNode;
|
|
30
43
|
/** Additional class names */
|
|
31
44
|
className?: string;
|
|
32
45
|
}
|
|
@@ -38,6 +51,8 @@ export interface OfflineIndicatorTheme {
|
|
|
38
51
|
base?: string;
|
|
39
52
|
/** Position-specific styles */
|
|
40
53
|
positions?: Record<OfflineIndicatorPosition, string>;
|
|
54
|
+
/** Position overrides for the full-bleed banner variant (flush to the viewport edge, no inset) */
|
|
55
|
+
bannerPositions?: Record<OfflineIndicatorPosition, string>;
|
|
41
56
|
/** Variant-specific styles */
|
|
42
57
|
variants?: {
|
|
43
58
|
banner?: string;
|
|
@@ -48,6 +63,8 @@ export interface OfflineIndicatorTheme {
|
|
|
48
63
|
offline?: string;
|
|
49
64
|
/** Online (reconnected) state styles */
|
|
50
65
|
online?: string;
|
|
66
|
+
/** Action link styles */
|
|
67
|
+
action?: string;
|
|
51
68
|
/** Icon styles */
|
|
52
69
|
icon?: string;
|
|
53
70
|
/** Message text styles */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const pageHeadingTheme = {
|
|
2
2
|
baseStyle: "flex flex-col pb-6 mb-6",
|
|
3
3
|
headerStyle: "flex flex-col items-start sm:flex-row sm:items-center gap-4",
|
|
4
|
-
titleStyle: "text-
|
|
4
|
+
titleStyle: "text-[length:var(--page-heading-title-size)]/[var(--page-heading-title-line-height)] font-bold text-[var(--color-text-primary)]",
|
|
5
5
|
subtitleStyle: "text-sm text-[var(--color-text-secondary)] mt-1",
|
|
6
6
|
actionsStyle: "sm:ml-auto flex items-center gap-2 shrink-0",
|
|
7
7
|
iconStyle: "flex items-center justify-center shrink-0 text-[var(--color-text-muted)]",
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ArrowLeft } from '@phosphor-icons/react';
|
|
6
6
|
import { Link } from '../Link/Link.js';
|
|
7
7
|
|
|
8
8
|
const PageHeadingBackButton = React__default.forwardRef(({ label = "Back", onClick, className, ...props }, ref) => {
|
|
9
|
-
return (jsxs(Link, { ref: ref, color: "
|
|
9
|
+
return (jsxs(Link, { ref: ref, color: "mono", size: "sm", onClick: onClick, className: cn("mb-2 w-fit", className), ...props, children: [jsx(ArrowLeft, { className: "size-4" }), typeof label === 'string'
|
|
10
10
|
? jsx("span", { children: label })
|
|
11
11
|
: label] }));
|
|
12
12
|
});
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import React__default, { useMemo, useCallback } from 'react';
|
|
4
4
|
import { paginationTheme } from './Pagination.theme.js';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CaretDoubleLeft, CaretLeft, CaretRight, CaretDoubleRight } from '@phosphor-icons/react';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal PaginationItem component for page numbers and ellipsis
|
|
@@ -83,14 +83,14 @@ const Pagination = React__default.forwardRef(({ currentPage, totalPages, onPageC
|
|
|
83
83
|
// on page 1, or "(totalPages + 1)" on the last page).
|
|
84
84
|
const previousPageLabelNumber = Math.max(currentPage - 1, 1);
|
|
85
85
|
const nextPageLabelNumber = Math.min(currentPage + 1, totalPages);
|
|
86
|
-
return (jsxs("nav", { ref: ref, role: "navigation", "aria-label": "Pagination Navigation", className: cn(theme.baseStyle, className), ...props, children: [showFirstLast && (jsxs(PaginationItem, { size: size, isDisabled: isFirstPage, onClick: () => handlePageChange(1), "aria-label": "Go to first page", children: [jsx(
|
|
86
|
+
return (jsxs("nav", { ref: ref, role: "navigation", "aria-label": "Pagination Navigation", className: cn(theme.baseStyle, className), ...props, children: [showFirstLast && (jsxs(PaginationItem, { size: size, isDisabled: isFirstPage, onClick: () => handlePageChange(1), "aria-label": "Go to first page", children: [jsx(CaretDoubleLeft, { className: "w-4 h-4" }), jsx("span", { className: "sr-only", children: "First" })] })), showPrevNext && (jsxs(PaginationItem, { size: size, isDisabled: isFirstPage, onClick: () => handlePageChange(currentPage - 1), "aria-label": `Go to previous page (${previousPageLabelNumber})`, children: [jsx(CaretLeft, { className: "w-4 h-4" }), jsx("span", { className: "sr-only", children: "Previous" })] })), paginationRange.map((pageNumber, index) => {
|
|
87
87
|
if (pageNumber === "...") {
|
|
88
88
|
return (jsx("span", { role: "separator", "aria-hidden": "true", children: "\u2026" }, `ellipsis-${index}`));
|
|
89
89
|
}
|
|
90
90
|
const page = pageNumber;
|
|
91
91
|
const isActive = page === currentPage;
|
|
92
92
|
return (jsxs(PaginationItem, { size: size, variant: "page", isActive: isActive, onClick: () => handlePageChange(page), "aria-label": isActive ? `Page ${page}, current page` : `Go to page ${page}`, children: [page, isActive && jsx("span", { className: "sr-only", children: "(current)" })] }, page));
|
|
93
|
-
}), showPrevNext && (jsxs(PaginationItem, { size: size, isDisabled: isLastPage, onClick: () => handlePageChange(currentPage + 1), "aria-label": `Go to next page (${nextPageLabelNumber})`, children: [jsx(
|
|
93
|
+
}), showPrevNext && (jsxs(PaginationItem, { size: size, isDisabled: isLastPage, onClick: () => handlePageChange(currentPage + 1), "aria-label": `Go to next page (${nextPageLabelNumber})`, children: [jsx(CaretRight, { className: "w-4 h-4" }), jsx("span", { className: "sr-only", children: "Next" })] })), showFirstLast && (jsxs(PaginationItem, { size: size, isDisabled: isLastPage, onClick: () => handlePageChange(totalPages), "aria-label": "Go to last page", children: [jsx(CaretDoubleRight, { className: "w-4 h-4" }), jsx("span", { className: "sr-only", children: "Last" })] }))] }));
|
|
94
94
|
});
|
|
95
95
|
Pagination.displayName = "Pagination";
|
|
96
96
|
|
|
@@ -7,21 +7,21 @@ const paginationTheme = {
|
|
|
7
7
|
// Unified item styles for all pagination elements (pages, navigation, etc.)
|
|
8
8
|
// Light mode: white background, muted text, neutral borders
|
|
9
9
|
// Dark mode: neutral-800 background, lighter text, neutral-600 borders
|
|
10
|
-
itemStyle: "inline-flex items-center justify-center font-medium rounded-[var(--form-radius)] transition-all duration-
|
|
10
|
+
itemStyle: "inline-flex items-center justify-center font-medium rounded-[var(--form-radius)] transition-all duration-[var(--motion-duration-base)] ease-in-out " +
|
|
11
11
|
// Focus styles
|
|
12
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 dark:focus-visible:ring-offset-[var(--color-
|
|
12
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 dark:focus-visible:ring-offset-[var(--color-mono-900)] " +
|
|
13
13
|
// Base state - light
|
|
14
14
|
"cursor-pointer bg-white border border-transparent text-[var(--color-text-muted)] " +
|
|
15
15
|
// Base state - dark
|
|
16
16
|
"dark:bg-transparent dark:text-[var(--color-text-secondary)] dark:border-transparent " +
|
|
17
17
|
// Hover state - light
|
|
18
|
-
"hover:text-[var(--color-text-primary)] hover:bg-[var(--color-
|
|
18
|
+
"hover:text-[var(--color-text-primary)] hover:bg-[var(--color-surface)] hover:border-[var(--color-border)] " +
|
|
19
19
|
// Hover state - dark
|
|
20
20
|
"dark:hover:bg-[var(--color-surface-hover)] dark:hover:text-[var(--color-text-primary)] dark:hover:border-[var(--color-border)]/0 " +
|
|
21
21
|
// Active state - light
|
|
22
22
|
"data-[active=true]:bg-white data-[active=true]:border-[var(--color-border)] data-[active=true]:text-[var(--color-text-primary)] " +
|
|
23
23
|
// Active state - dark (uses primary color accent)
|
|
24
|
-
"dark:data-[active=true]:bg-[var(--color-
|
|
24
|
+
"dark:data-[active=true]:bg-[var(--color-mono-800)] dark:data-[active=true]:border-none dark:data-[active=true]:text-[var(--color-text-primary)] " +
|
|
25
25
|
// Disabled state
|
|
26
26
|
"data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:pointer-events-none",
|
|
27
27
|
// Unified item sizes
|
|
@@ -30,7 +30,7 @@ const paginationTheme = {
|
|
|
30
30
|
md: "size-10 min-w-[2.5rem] text-sm",
|
|
31
31
|
},
|
|
32
32
|
// Ellipsis styles
|
|
33
|
-
ellipsisStyle: "inline-flex items-center justify-center font-medium text-[var(--color-text-muted)]
|
|
33
|
+
ellipsisStyle: "inline-flex items-center justify-center font-medium text-[var(--color-text-muted)] cursor-default pointer-events-none",
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export { paginationTheme };
|
|
@@ -3,9 +3,12 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import React__default, { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { useReducedMotion, motion } from 'motion/react';
|
|
5
5
|
import { pillTheme } from './Pill.theme.js';
|
|
6
|
-
import {
|
|
6
|
+
import { createPressVariants } from '../shared/interaction.animations.js';
|
|
7
|
+
import { Ripple } from '../shared/Ripple.js';
|
|
7
8
|
import { cn } from '../../../utils/cn.js';
|
|
8
9
|
|
|
10
|
+
// Shared press physics + subtle hover lift (module-level constant)
|
|
11
|
+
const PILL_PRESS_VARIANTS = createPressVariants(0.97, 1.02);
|
|
9
12
|
/**
|
|
10
13
|
* Pill component - Simplified selectable chip for filters and tags
|
|
11
14
|
*
|
|
@@ -120,7 +123,7 @@ const Pill = React__default.forwardRef((props, ref) => {
|
|
|
120
123
|
// Accessibility
|
|
121
124
|
role: isSelectable && !readOnly ? "button" : undefined, tabIndex: isInteractive ? 0 : undefined, "aria-pressed": isSelectable && !readOnly ? isSelected : undefined, "aria-readonly": readOnly || undefined,
|
|
122
125
|
// Animation
|
|
123
|
-
whileTap: isInteractive && !shouldReduceMotion ?
|
|
126
|
+
variants: PILL_PRESS_VARIANTS, animate: "rest", whileHover: isInteractive && !shouldReduceMotion ? "hover" : undefined, whileTap: isInteractive && !shouldReduceMotion ? "press" : undefined, ...restProps, children: [renderStartIcon(), children, isInteractive && jsx(Ripple, {})] }));
|
|
124
127
|
});
|
|
125
128
|
Pill.displayName = "Pill";
|
|
126
129
|
|
|
@@ -8,8 +8,10 @@ const pillTheme = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Base pill style - structure and default colors (no hover)
|
|
10
10
|
*/
|
|
11
|
-
baseStyle:
|
|
12
|
-
|
|
11
|
+
baseStyle:
|
|
12
|
+
// `relative` positions the press <Ripple /> layer (selectable pills only).
|
|
13
|
+
"relative inline-flex items-center justify-center font-medium rounded-full select-none whitespace-nowrap " +
|
|
14
|
+
"ring-1 bg-[var(--color-surface)] transition-[color,background-color,box-shadow] duration-[var(--motion-duration-fast)] ease-out " +
|
|
13
15
|
"text-[var(--color-text-primary)] ring-[var(--color-border)] " +
|
|
14
16
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]",
|
|
15
17
|
/**
|
|
@@ -26,10 +28,12 @@ const pillTheme = {
|
|
|
26
28
|
/**
|
|
27
29
|
* Size variants
|
|
28
30
|
*/
|
|
31
|
+
// Paddings tokenised (--pill-px-*/--pill-py-*) so a theme can grow the chip
|
|
32
|
+
// tier alongside its controls — defaults are px-2.5/px-3 + py-0.5/py-1.
|
|
29
33
|
sizes: {
|
|
30
|
-
sm: "text-xs px-
|
|
31
|
-
md: "text-sm px-
|
|
32
|
-
lg: "text-sm px-
|
|
34
|
+
sm: "text-xs px-[var(--pill-px-sm)] py-[var(--pill-py-sm)] gap-0.5",
|
|
35
|
+
md: "text-sm px-[var(--pill-px-md)] py-[var(--pill-py-md)] gap-1",
|
|
36
|
+
lg: "text-sm px-[var(--pill-px-lg)] py-[var(--pill-py-lg)] gap-1.5",
|
|
33
37
|
},
|
|
34
38
|
/**
|
|
35
39
|
* Icon sizes for iconStart and CheckIcon
|
|
@@ -45,11 +45,22 @@ const PopoverBody = React__default.forwardRef(({ children, className, animation
|
|
|
45
45
|
((_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
// Ignore clicks that land inside
|
|
49
|
-
// Select/Tooltip/Dropdown/Popover renders to document.body,
|
|
50
|
-
// content ref — without this it would count as an outside
|
|
51
|
-
// dismiss the popover). See the `data-flikkui-portal`
|
|
52
|
-
|
|
48
|
+
// Ignore clicks that land inside a DESCENDANT FlikkUI overlay portal (a
|
|
49
|
+
// nested Select/Tooltip/Dropdown/Popover renders to document.body,
|
|
50
|
+
// outside our content ref — without this it would count as an outside
|
|
51
|
+
// click and dismiss the popover). See the `data-flikkui-portal`
|
|
52
|
+
// convention.
|
|
53
|
+
//
|
|
54
|
+
// The bail only protects against a DESCENDANT portal, not an ANCESTOR
|
|
55
|
+
// one: when this popover's own trigger lives inside another overlay
|
|
56
|
+
// (e.g. a Popover opened from inside a Modal), a click on that host
|
|
57
|
+
// overlay's body content also matches `closest("[data-flikkui-portal]")`
|
|
58
|
+
// — it finds the Modal's portal wrapper, which contains our trigger.
|
|
59
|
+
// That's a real outside click and must still close the popover. Only
|
|
60
|
+
// bail when the matched portal does NOT contain our trigger — i.e.
|
|
61
|
+
// it's a portal we opened ourselves, not the one hosting us.
|
|
62
|
+
const portalEl = (_c = (_b = e.target) === null || _b === void 0 ? void 0 : _b.closest) === null || _c === void 0 ? void 0 : _c.call(_b, "[data-flikkui-portal]");
|
|
63
|
+
if (portalEl && !portalEl.contains(triggerRef.current)) {
|
|
53
64
|
return;
|
|
54
65
|
}
|
|
55
66
|
if (closeOnClickOutside && !preventClose) {
|
|
@@ -1,29 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ProgressProps } from "./Progress.types";
|
|
3
|
-
/**
|
|
4
|
-
* Progress component - Linear progress bar for tracking completion
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - Determinate mode: Shows specific progress value (0-100)
|
|
8
|
-
* - Indeterminate mode: Animated loading state when value is undefined
|
|
9
|
-
* - Multiple sizes with default primary color
|
|
10
|
-
* - className controls the fill bar color (the primary styling target)
|
|
11
|
-
* - wrapperClassName controls the outer container
|
|
12
|
-
* - Flexible label positioning (right, top, bottom, inside)
|
|
13
|
-
* - Respects reduced motion preferences
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // Default (primary color)
|
|
17
|
-
* <Progress value={60} />
|
|
18
|
-
*
|
|
19
|
-
* // Custom fill color via className
|
|
20
|
-
* <Progress value={70} className="bg-[var(--color-success)]" />
|
|
21
|
-
*
|
|
22
|
-
* // With label
|
|
23
|
-
* <Progress value={75} showLabel labelPosition="right" />
|
|
24
|
-
*
|
|
25
|
-
* // Indeterminate (loading)
|
|
26
|
-
* <Progress />
|
|
27
|
-
*/
|
|
28
3
|
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
4
|
export { Progress };
|