@flikk/ui 1.0.0-beta.26 → 1.0.0-beta.29
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/dist/bg/1.webp +0 -0
- package/dist/bg/10.webp +0 -0
- package/dist/bg/11.webp +0 -0
- package/dist/bg/12.webp +0 -0
- package/dist/bg/13.webp +0 -0
- package/dist/bg/14.webp +0 -0
- package/dist/bg/15.webp +0 -0
- package/dist/bg/16.webp +0 -0
- package/dist/bg/17.webp +0 -0
- package/dist/bg/18.webp +0 -0
- package/dist/bg/19.webp +0 -0
- package/dist/bg/2.webp +0 -0
- package/dist/bg/20.webp +0 -0
- package/dist/bg/21.webp +0 -0
- package/dist/bg/22.webp +0 -0
- package/dist/bg/3.webp +0 -0
- package/dist/bg/4.webp +0 -0
- package/dist/bg/5.webp +0 -0
- package/dist/bg/6.webp +0 -0
- package/dist/bg/7.webp +0 -0
- package/dist/bg/8.webp +0 -0
- package/dist/bg/9.webp +0 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +7 -140
- package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -85
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/canvas/Background.d.ts +19 -0
- package/dist/components/canvas/Background.js +23 -0
- package/dist/components/canvas/BaseNode.d.ts +15 -0
- package/dist/components/canvas/BaseNode.js +20 -0
- package/dist/components/canvas/CanvasToolbar.d.ts +34 -0
- package/dist/components/canvas/CanvasToolbar.js +34 -0
- package/dist/components/canvas/Edge.d.ts +35 -0
- package/dist/components/canvas/Edge.js +97 -0
- package/dist/components/canvas/EdgeLayer.d.ts +18 -0
- package/dist/components/canvas/EdgeLayer.js +111 -0
- package/dist/components/canvas/Handle.d.ts +11 -0
- package/dist/components/canvas/Handle.js +63 -0
- package/dist/components/canvas/MiniMap.d.ts +22 -0
- package/dist/components/canvas/MiniMap.js +105 -0
- package/dist/components/canvas/NodeCanvas.d.ts +10 -0
- package/dist/components/canvas/NodeCanvas.js +477 -0
- package/dist/components/canvas/NodeCanvas.theme.d.ts +7 -0
- package/dist/components/canvas/NodeCanvas.theme.js +9 -0
- package/dist/components/canvas/NodeCanvas.types.d.ts +187 -0
- package/dist/components/canvas/NodeControls.d.ts +25 -0
- package/dist/components/canvas/NodeControls.js +40 -0
- package/dist/components/canvas/NodeRenderer.d.ts +19 -0
- package/dist/components/canvas/NodeRenderer.js +117 -0
- package/dist/components/canvas/changes.d.ts +11 -0
- package/dist/components/canvas/changes.js +76 -0
- package/dist/components/canvas/context/CanvasContext.d.ts +32 -0
- package/dist/components/canvas/context/CanvasContext.js +14 -0
- package/dist/components/canvas/context/ConnectionContext.d.ts +33 -0
- package/dist/components/canvas/context/ConnectionContext.js +13 -0
- package/dist/components/canvas/context/HandleRegistry.d.ts +24 -0
- package/dist/components/canvas/context/HandleRegistry.js +15 -0
- package/dist/components/canvas/context/InteractionContext.d.ts +18 -0
- package/dist/components/canvas/context/InteractionContext.js +14 -0
- package/dist/components/canvas/context/NodeIdContext.d.ts +3 -0
- package/dist/components/canvas/context/NodeIdContext.js +15 -0
- package/dist/components/canvas/hooks/useConnection.d.ts +17 -0
- package/dist/components/canvas/hooks/useConnection.js +29 -0
- package/dist/components/canvas/hooks/useMarquee.d.ts +25 -0
- package/dist/components/canvas/hooks/useMarquee.js +91 -0
- package/dist/components/canvas/hooks/useNodeDrag.d.ts +23 -0
- package/dist/components/canvas/hooks/useNodeDrag.js +110 -0
- package/dist/components/canvas/hooks/usePanZoom.d.ts +30 -0
- package/dist/components/canvas/hooks/usePanZoom.js +189 -0
- package/dist/components/canvas/hooks/useViewport.d.ts +21 -0
- package/dist/components/canvas/hooks/useViewport.js +35 -0
- package/dist/components/canvas/index.d.ts +14 -0
- package/dist/components/canvas/index.js +12 -0
- package/dist/components/canvas/layout.d.ts +22 -0
- package/dist/components/canvas/layout.js +67 -0
- package/dist/components/canvas/utils.d.ts +4 -0
- package/dist/components/canvas/utils.js +16 -0
- package/dist/components/charts/AreaChart/AreaChart.js +136 -101
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +5 -5
- package/dist/components/charts/AreaChart/AreaChart.types.js +1 -0
- package/dist/components/charts/BarChart/BarChart.js +207 -143
- package/dist/components/charts/BarChart/BarChart.types.d.ts +4 -4
- package/dist/components/charts/BarChart/BarChart.types.js +1 -0
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +2 -2
- package/dist/components/charts/LineChart/LineChart.js +88 -72
- package/dist/components/charts/LineChart/LineChart.types.d.ts +3 -3
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +5 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +62 -72
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +10 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +3 -9
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +33 -33
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +2 -2
- package/dist/components/charts/hooks/index.d.ts +2 -0
- package/dist/components/charts/hooks/useChartDimensions.d.ts +29 -0
- package/dist/components/charts/hooks/useChartDimensions.js +42 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +1 -1
- package/dist/components/charts/types/chart.types.d.ts +11 -2
- package/dist/components/charts/types/chart.types.js +10 -3
- package/dist/components/core/Avatar/Avatar.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +4 -2
- package/dist/components/core/Badge/Badge.js +1 -1
- package/dist/components/core/Badge/Badge.theme.js +16 -15
- package/dist/components/core/Button/Button.js +1 -1
- package/dist/components/core/Button/Button.theme.js +3 -3
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Card/Card.js +7 -3
- package/dist/components/core/Card/Card.theme.js +3 -3
- package/dist/components/core/Card/Card.types.d.ts +27 -2
- package/dist/components/core/CommandPalette/CommandItem.js +4 -5
- package/dist/components/core/CommandPalette/CommandPalette.js +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +11 -13
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +0 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +14 -15
- package/dist/components/core/ContextMenu/ContextMenuItem.js +1 -1
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +1 -1
- package/dist/components/core/DotSeparator/DotSeparator.d.ts +3 -0
- package/dist/components/core/DotSeparator/DotSeparator.js +19 -0
- package/dist/components/core/DotSeparator/DotSeparator.theme.d.ts +2 -0
- package/dist/components/core/DotSeparator/DotSeparator.theme.js +10 -0
- package/dist/components/core/DotSeparator/DotSeparator.types.d.ts +25 -0
- package/dist/components/core/DotSeparator/index.d.ts +3 -0
- package/dist/components/core/Dropdown/Dropdown.theme.js +5 -6
- package/dist/components/core/Dropdown/DropdownItem.js +1 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +58 -30
- package/dist/components/core/HeroCard/HeroCard.d.ts +5 -0
- package/dist/components/core/HeroCard/HeroCard.js +99 -0
- package/dist/components/core/HeroCard/HeroCard.theme.d.ts +3 -0
- package/dist/components/core/HeroCard/HeroCard.theme.js +8 -0
- package/dist/components/core/HeroCard/HeroCard.types.d.ts +70 -0
- package/dist/components/core/HeroCard/index.d.ts +4 -0
- package/dist/components/core/Kbd/Kbd.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +5 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +6 -0
- package/dist/components/core/MenuItem/MenuItem.theme.js +19 -16
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +2 -7
- package/dist/components/core/Modal/Modal.theme.js +4 -8
- package/dist/components/core/Modal/Modal.types.d.ts +0 -10
- package/dist/components/core/Modal/index.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.types.d.ts +1 -2
- package/dist/components/core/ModalStack/ModalStackModal.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +2 -7
- package/dist/components/core/NavItem/NavItem.js +20 -4
- package/dist/components/core/NavItem/NavItem.theme.js +13 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +2 -2
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Popover/Popover.types.d.ts +6 -2
- package/dist/components/core/Popover/PopoverBody.js +10 -3
- package/dist/components/core/ScrollArea/ScrollArea.js +242 -4
- package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -1
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.d.ts +4 -0
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.js +23 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.js +4 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.types.d.ts +5 -0
- package/dist/components/core/Segmented/Segmented.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.d.ts +2 -0
- package/dist/components/core/Sidebar/Sidebar.js +15 -7
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +92 -4
- package/dist/components/core/Sidebar/SidebarCard.d.ts +25 -0
- package/dist/components/core/Sidebar/SidebarCard.js +68 -0
- package/dist/components/core/Sidebar/SidebarCard.theme.d.ts +8 -0
- package/dist/components/core/Sidebar/SidebarCard.theme.js +18 -0
- package/dist/components/core/Sidebar/SidebarContent.js +5 -1
- package/dist/components/core/Sidebar/SidebarContext.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +10 -2
- package/dist/components/core/Sidebar/SidebarLogo.js +38 -3
- package/dist/components/core/Sidebar/SidebarSearch.d.ts +22 -0
- package/dist/components/core/Sidebar/SidebarSearch.js +135 -0
- package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +2 -2
- package/dist/components/core/Sidebar/index.d.ts +3 -1
- package/dist/components/core/Tag/Tag.js +29 -5
- package/dist/components/core/Tag/Tag.theme.js +13 -8
- package/dist/components/core/Tag/Tag.types.d.ts +7 -0
- package/dist/components/core/Tooltip/Tooltip.js +1 -1
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -2
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +6 -0
- package/dist/components/data-display/DescriptionList/DescriptionList.js +23 -7
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +10 -3
- package/dist/components/data-display/DescriptionList/DescriptionList.types.d.ts +49 -10
- package/dist/components/data-display/DescriptionList/index.d.ts +1 -1
- package/dist/components/data-display/Feed/Feed.js +28 -5
- package/dist/components/data-display/Feed/Feed.theme.js +1 -1
- package/dist/components/data-display/Feed/Feed.types.d.ts +32 -1
- package/dist/components/data-display/Feed/index.d.ts +1 -1
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +1 -1
- package/dist/components/data-display/GanttChart/GanttChart.js +31 -4
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +19 -17
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +19 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +1 -1
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +1 -1
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +3 -3
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +7 -4
- package/dist/components/data-display/GanttChart/GanttMilestone.js +5 -5
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +37 -16
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +2 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +35 -11
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -2
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +3 -2
- package/dist/components/data-display/GanttChart/index.d.ts +1 -1
- package/dist/components/data-display/Metric/Metric.js +8 -8
- package/dist/components/data-display/Metric/Metric.theme.d.ts +3 -2
- package/dist/components/data-display/Metric/Metric.theme.js +50 -68
- package/dist/components/data-display/Metric/Metric.types.d.ts +19 -21
- package/dist/components/data-display/Table/Table.js +2 -2
- package/dist/components/data-display/Table/Table.theme.js +27 -9
- package/dist/components/data-display/Table/Table.types.d.ts +8 -0
- package/dist/components/data-display/Table/TableBody.js +2 -2
- package/dist/components/data-display/Table/TableCell.js +1 -1
- package/dist/components/data-display/Table/TableRow.d.ts +1 -1
- package/dist/components/data-display/Table/TableRow.js +9 -2
- package/dist/components/data-display/Timeline/Timeline.js +27 -5
- package/dist/components/data-display/Timeline/Timeline.theme.d.ts +10 -2
- package/dist/components/data-display/Timeline/Timeline.theme.js +14 -8
- package/dist/components/data-display/Timeline/Timeline.types.d.ts +48 -16
- package/dist/components/data-display/Timeline/Timeline.utils.d.ts +6 -0
- package/dist/components/data-display/Timeline/Timeline.utils.js +11 -0
- package/dist/components/data-display/Timeline/TimelineItem.js +13 -20
- package/dist/components/data-display/Timeline/TimelineMarker.js +10 -8
- package/dist/components/data-display/Timeline/index.d.ts +2 -2
- package/dist/components/effects/3d/index.d.ts +0 -2
- package/dist/components/effects/3d/index.js +0 -1
- package/dist/components/effects/Aurora/Aurora.d.ts +6 -17
- package/dist/components/effects/Aurora/Aurora.js +297 -131
- package/dist/components/effects/Aurora/Aurora.types.d.ts +6 -0
- package/dist/components/effects/DotPattern/DotPattern.js +1 -1
- package/dist/components/effects/Overlay/Overlay.theme.js +1 -2
- package/dist/components/effects/Preloader/Preloader.animations.d.ts +23 -0
- package/dist/components/effects/Preloader/Preloader.animations.js +150 -0
- package/dist/components/effects/Preloader/Preloader.d.ts +3 -0
- package/dist/components/effects/Preloader/Preloader.js +119 -0
- package/dist/components/effects/Preloader/Preloader.types.d.ts +63 -0
- package/dist/components/effects/Preloader/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +25 -14
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +2 -0
- package/dist/components/effects/TiltCard/TiltCard.d.ts +12 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.d.ts +28 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.js +114 -0
- package/dist/components/effects/TiltCard/TiltCard.js +177 -0
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.d.ts → TiltCard/TiltCard.shaders.d.ts} +1 -1
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.js → TiltCard/TiltCard.shaders.js} +1 -1
- package/dist/components/effects/TiltCard/TiltCard.types.d.ts +88 -0
- package/dist/components/effects/TiltCard/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +4 -12
- package/dist/components/effects/index.js +2 -6
- package/dist/components/forms/Checkbox/Checkbox.js +7 -1
- package/dist/components/forms/Combobox/Combobox.js +1 -1
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -4
- package/dist/components/forms/DatePicker/DatePicker.theme.js +11 -18
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +6 -13
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.animations.d.ts +29 -0
- package/dist/components/forms/FileUpload/FileUpload.animations.js +19 -0
- package/dist/components/forms/FileUpload/FileUpload.js +85 -134
- package/dist/components/forms/FileUpload/FileUpload.theme.d.ts +2 -10
- package/dist/components/forms/FileUpload/FileUpload.theme.js +16 -30
- package/dist/components/forms/FileUpload/FileUpload.types.d.ts +26 -10
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.theme.js +13 -10
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.js +152 -57
- package/dist/components/forms/Mention/Mention.theme.js +16 -23
- package/dist/components/forms/Mention/Mention.types.d.ts +12 -12
- package/dist/components/forms/Mention/Mention.utils.js +32 -4
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +5 -5
- package/dist/components/forms/Select/Select.js +2 -2
- package/dist/components/forms/Select/Select.theme.js +3 -3
- package/dist/components/forms/Slider/Slider.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.js +27 -15
- package/dist/components/forms/Switch/Switch.theme.d.ts +36 -6
- package/dist/components/forms/Switch/Switch.theme.js +33 -4
- package/dist/components/forms/Switch/Switch.types.d.ts +12 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -87
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
- package/dist/components/forms/forms.theme.js +21 -16
- package/dist/components/forms/index.d.ts +0 -4
- package/dist/components/forms/index.js +0 -89
- package/dist/components/generative/GenerativeView.d.ts +21 -0
- package/dist/components/generative/GenerativeView.js +116 -0
- package/dist/components/generative/actions.d.ts +26 -0
- package/dist/components/generative/actions.js +51 -0
- package/dist/components/generative/index.d.ts +11 -0
- package/dist/components/generative/index.js +9 -0
- package/dist/components/generative/registry.d.ts +43 -0
- package/dist/components/generative/registry.js +114 -0
- package/dist/components/generative/resolvers.d.ts +35 -0
- package/dist/components/generative/resolvers.js +93 -0
- package/dist/components/generative/schema.generated.d.ts +2 -0
- package/dist/components/generative/schema.generated.js +1639 -0
- package/dist/components/generative/schemaTypes.d.ts +30 -0
- package/dist/components/generative/streaming.d.ts +39 -0
- package/dist/components/generative/streaming.js +283 -0
- package/dist/components/generative/tools.d.ts +21 -0
- package/dist/components/generative/tools.js +54 -0
- package/dist/components/generative/types.d.ts +41 -0
- package/dist/components/generative/useGenerativeStream.d.ts +37 -0
- package/dist/components/generative/useGenerativeStream.js +36 -0
- package/dist/components/generative/validate.d.ts +24 -0
- package/dist/components/generative/validate.js +259 -0
- package/dist/components/layout/AppShell/AppShell.d.ts +10 -0
- package/dist/components/layout/AppShell/AppShell.js +84 -0
- package/dist/components/layout/AppShell/AppShell.theme.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShell.theme.js +42 -0
- package/dist/components/layout/AppShell/AppShell.types.d.ts +127 -0
- package/dist/components/layout/AppShell/AppShellContext.d.ts +14 -0
- package/dist/components/layout/AppShell/AppShellContext.js +19 -0
- package/dist/components/layout/AppShell/AppShellFooter.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellFooter.js +12 -0
- package/dist/components/layout/AppShell/AppShellHeader.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellHeader.js +12 -0
- package/dist/components/layout/AppShell/AppShellMain.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellMain.js +19 -0
- package/dist/components/layout/AppShell/AppShellRightPanel.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellRightPanel.js +16 -0
- package/dist/components/layout/AppShell/AppShellSidebar.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellSidebar.js +16 -0
- package/dist/components/layout/AppShell/AppShellTopbar.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellTopbar.js +12 -0
- package/dist/components/layout/AppShell/index.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayout.js +1 -87
- package/dist/components/layout/Grid/Grid.d.ts +3 -0
- package/dist/components/layout/Grid/Grid.js +50 -0
- package/dist/components/layout/Grid/Grid.theme.d.ts +2 -0
- package/dist/components/layout/Grid/Grid.theme.js +35 -0
- package/dist/components/layout/Grid/Grid.types.d.ts +57 -0
- package/dist/components/layout/Grid/index.d.ts +3 -0
- package/dist/components/layout/Section/Section.d.ts +3 -0
- package/dist/components/layout/Section/Section.js +18 -0
- package/dist/components/layout/Section/Section.theme.d.ts +2 -0
- package/dist/components/layout/Section/Section.theme.js +10 -0
- package/dist/components/layout/Section/Section.types.d.ts +34 -0
- package/dist/components/layout/Section/index.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.js +19 -0
- package/dist/components/layout/Stack/Stack.theme.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.theme.js +10 -0
- package/dist/components/layout/Stack/Stack.types.d.ts +39 -0
- package/dist/components/layout/Stack/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.js +8 -0
- package/dist/generative.schema.json +1637 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +45 -24
- package/dist/index.js +180 -174
- package/dist/registry.json +10205 -0
- package/dist/styles.css +1 -1
- package/dist/tools.json +1731 -0
- package/dist/utils/dateUtils.js +11 -1
- package/package.json +19 -4
- package/src/global.scss +82 -109
- package/src/styles/theme.css +707 -474
- package/dist/bg/1.jpg +0 -0
- package/dist/bg/10.jpg +0 -0
- package/dist/bg/11.jpg +0 -0
- package/dist/bg/14.jpg +0 -0
- package/dist/bg/15.jpg +0 -0
- package/dist/bg/16.jpg +0 -0
- package/dist/bg/17.jpg +0 -0
- package/dist/bg/18.jpg +0 -0
- package/dist/bg/19.jpg +0 -0
- package/dist/bg/2.jpg +0 -0
- package/dist/bg/20.jpg +0 -0
- package/dist/bg/21.jpg +0 -0
- package/dist/bg/22.jpg +0 -0
- package/dist/bg/23.jpg +0 -0
- package/dist/bg/24.jpg +0 -0
- package/dist/bg/3.jpg +0 -0
- package/dist/bg/4.jpg +0 -0
- package/dist/bg/5.jpg +0 -0
- package/dist/bg/6.jpg +0 -0
- package/dist/bg/7.jpg +0 -0
- package/dist/bg/8.jpg +0 -0
- package/dist/bg/9.jpg +0 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +0 -17
- package/dist/components/effects/MorphingText/MorphingText.js +0 -125
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +0 -18
- package/dist/components/effects/MorphingText/index.d.ts +0 -2
- package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +0 -8
- package/dist/components/effects/PageTransition/PageTransition.animations.js +0 -53
- package/dist/components/effects/PageTransition/PageTransition.d.ts +0 -3
- package/dist/components/effects/PageTransition/PageTransition.js +0 -82
- package/dist/components/effects/PageTransition/PageTransition.types.d.ts +0 -15
- package/dist/components/effects/PageTransition/index.d.ts +0 -2
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +0 -26
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +0 -71
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +0 -11
- package/dist/components/effects/ParallaxSection/index.d.ts +0 -2
- package/dist/components/effects/Spotlight/Spotlight.d.ts +0 -36
- package/dist/components/effects/Spotlight/Spotlight.js +0 -112
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +0 -29
- package/dist/components/effects/Spotlight/index.d.ts +0 -2
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.d.ts +0 -18
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.js +0 -213
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.d.ts +0 -61
- package/dist/components/effects/SpotlightBorder/index.d.ts +0 -2
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +0 -30
- package/dist/components/effects/StickyScroll/StickyScroll.js +0 -128
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +0 -19
- package/dist/components/effects/StickyScroll/index.d.ts +0 -2
- package/dist/components/forms/CronInput/CronInput.d.ts +0 -3
- package/dist/components/forms/CronInput/CronInput.js +0 -113
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +0 -6
- package/dist/components/forms/CronInput/CronInput.theme.js +0 -84
- package/dist/components/forms/CronInput/CronInput.types.d.ts +0 -109
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +0 -67
- package/dist/components/forms/CronInput/CronInput.utils.js +0 -505
- package/dist/components/forms/CronInput/index.d.ts +0 -4
- /package/dist/components/effects/{SpotlightBorder/SpotlightBorder.types.js → TiltCard/TiltCard.types.js} +0 -0
|
@@ -25,7 +25,7 @@ import { useSmoothScroll } from './smooth/useSmoothScroll.js';
|
|
|
25
25
|
* </ScrollArea>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size = 'default', orientation = 'vertical', snap, snapAlign = 'start', smooth =
|
|
28
|
+
const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size = 'default', orientation = 'vertical', dragToScroll = false, snap, snapAlign = 'start', smooth = true, smoothConfig, onScrollProgress, onPerformanceUpdate, className, theme, ...props }, ref) => {
|
|
29
29
|
// Internal ref for the scrollable element
|
|
30
30
|
const internalRef = useRef(null);
|
|
31
31
|
// Determine scroll orientation for smooth scroll
|
|
@@ -58,14 +58,244 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size =
|
|
|
58
58
|
const extendedRef = element;
|
|
59
59
|
// Add smooth scroll methods if smooth is enabled
|
|
60
60
|
if (smooth && smoothAPI) {
|
|
61
|
-
extendedRef.smoothScrollTo =
|
|
61
|
+
extendedRef.smoothScrollTo = (position, options) => {
|
|
62
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
63
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
64
|
+
inertiaFrameIdRef.current = null;
|
|
65
|
+
}
|
|
66
|
+
smoothAPI.scrollTo(position, options);
|
|
67
|
+
};
|
|
62
68
|
extendedRef.getScrollVelocity = smoothAPI.getVelocity;
|
|
63
69
|
extendedRef.pauseSmoothScroll = smoothAPI.stop;
|
|
64
70
|
extendedRef.resumeSmoothScroll = smoothAPI.start;
|
|
65
71
|
extendedRef.refreshSnapPoints = smoothAPI.refreshSnapPoints;
|
|
66
72
|
}
|
|
73
|
+
extendedRef.setPosition = (position) => {
|
|
74
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
75
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
76
|
+
inertiaFrameIdRef.current = null;
|
|
77
|
+
}
|
|
78
|
+
if (smooth && smoothAPI) {
|
|
79
|
+
smoothAPI.setPosition(position);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const max = orientation === 'horizontal'
|
|
83
|
+
? element.scrollWidth - element.clientWidth
|
|
84
|
+
: element.scrollHeight - element.clientHeight;
|
|
85
|
+
const clamped = Math.max(0, Math.min(max, position));
|
|
86
|
+
if (orientation === 'horizontal') {
|
|
87
|
+
element.scrollLeft = clamped;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
element.scrollTop = clamped;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
67
94
|
return extendedRef;
|
|
68
|
-
}, [smooth, smoothAPI]);
|
|
95
|
+
}, [smooth, smoothAPI, orientation]);
|
|
96
|
+
// Drag-to-scroll (mouse panning) with inertia.
|
|
97
|
+
const dragRef = useRef(null);
|
|
98
|
+
const suppressClickRef = useRef(false);
|
|
99
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
100
|
+
const inertiaFrameIdRef = useRef(null);
|
|
101
|
+
// Cancel inertia animation on unmount
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
return () => {
|
|
104
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
105
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}, []);
|
|
109
|
+
const startDragInertia = (vx, vy) => {
|
|
110
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
111
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
112
|
+
}
|
|
113
|
+
let lastTime = performance.now();
|
|
114
|
+
const el = internalRef.current;
|
|
115
|
+
if (!el)
|
|
116
|
+
return;
|
|
117
|
+
const tick = (now) => {
|
|
118
|
+
const dt = now - lastTime;
|
|
119
|
+
lastTime = now;
|
|
120
|
+
// Prevent frame skip issues when tab is backgrounded
|
|
121
|
+
if (dt > 100) {
|
|
122
|
+
inertiaFrameIdRef.current = requestAnimationFrame(tick);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Apply friction decay (0.95 per 16.67ms frame)
|
|
126
|
+
const friction = 0.95;
|
|
127
|
+
const timeFactor = dt / 16.67;
|
|
128
|
+
const currentFriction = Math.pow(friction, timeFactor);
|
|
129
|
+
let activeVx = vx;
|
|
130
|
+
let activeVy = vy;
|
|
131
|
+
if (orientation === 'vertical') {
|
|
132
|
+
activeVx = 0;
|
|
133
|
+
}
|
|
134
|
+
else if (orientation === 'horizontal') {
|
|
135
|
+
activeVy = 0;
|
|
136
|
+
}
|
|
137
|
+
const deltaX = activeVx * dt;
|
|
138
|
+
const deltaY = activeVy * dt;
|
|
139
|
+
const nextLeft = el.scrollLeft + deltaX;
|
|
140
|
+
const nextTop = el.scrollTop + deltaY;
|
|
141
|
+
// Apply positions
|
|
142
|
+
if (smooth && smoothAPI) {
|
|
143
|
+
if (smoothOrientation === 'horizontal') {
|
|
144
|
+
smoothAPI.setPosition(nextLeft);
|
|
145
|
+
if (orientation === 'both') {
|
|
146
|
+
el.scrollTop = nextTop;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
smoothAPI.setPosition(nextTop);
|
|
151
|
+
if (orientation === 'both') {
|
|
152
|
+
el.scrollLeft = nextLeft;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
if (orientation !== 'vertical')
|
|
158
|
+
el.scrollLeft = nextLeft;
|
|
159
|
+
if (orientation !== 'horizontal')
|
|
160
|
+
el.scrollTop = nextTop;
|
|
161
|
+
}
|
|
162
|
+
// Decay velocity
|
|
163
|
+
vx *= currentFriction;
|
|
164
|
+
vy *= currentFriction;
|
|
165
|
+
// If we hit scroll boundaries, stop inertia on that axis
|
|
166
|
+
const maxScrollLeft = el.scrollWidth - el.clientWidth;
|
|
167
|
+
const maxScrollTop = el.scrollHeight - el.clientHeight;
|
|
168
|
+
if (el.scrollLeft <= 0 || el.scrollLeft >= maxScrollLeft)
|
|
169
|
+
vx = 0;
|
|
170
|
+
if (el.scrollTop <= 0 || el.scrollTop >= maxScrollTop)
|
|
171
|
+
vy = 0;
|
|
172
|
+
const currentSpeed = Math.sqrt(vx * vx + vy * vy);
|
|
173
|
+
if (currentSpeed > 0.05) {
|
|
174
|
+
inertiaFrameIdRef.current = requestAnimationFrame(tick);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
inertiaFrameIdRef.current = null;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
inertiaFrameIdRef.current = requestAnimationFrame(tick);
|
|
181
|
+
};
|
|
182
|
+
const onDragPointerDown = (e) => {
|
|
183
|
+
if (e.pointerType !== 'mouse' || e.button !== 0)
|
|
184
|
+
return;
|
|
185
|
+
// Stop any running inertia animation on fresh interaction
|
|
186
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
187
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
188
|
+
inertiaFrameIdRef.current = null;
|
|
189
|
+
}
|
|
190
|
+
suppressClickRef.current = false;
|
|
191
|
+
if (e.target.closest('input, textarea, select, [contenteditable="true"]'))
|
|
192
|
+
return;
|
|
193
|
+
const el = internalRef.current;
|
|
194
|
+
if (!el)
|
|
195
|
+
return;
|
|
196
|
+
dragRef.current = {
|
|
197
|
+
startX: e.clientX,
|
|
198
|
+
startY: e.clientY,
|
|
199
|
+
scrollLeft: el.scrollLeft,
|
|
200
|
+
scrollTop: el.scrollTop,
|
|
201
|
+
dragging: false,
|
|
202
|
+
pointerId: e.pointerId,
|
|
203
|
+
history: [{ time: performance.now(), x: e.clientX, y: e.clientY }]
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
const onDragPointerMove = (e) => {
|
|
207
|
+
const drag = dragRef.current;
|
|
208
|
+
const el = internalRef.current;
|
|
209
|
+
if (!drag || !el)
|
|
210
|
+
return;
|
|
211
|
+
const now = performance.now();
|
|
212
|
+
drag.history.push({ time: now, x: e.clientX, y: e.clientY });
|
|
213
|
+
// Keep only the last 100ms of history for velocity calculation
|
|
214
|
+
while (drag.history.length > 0 && now - drag.history[0].time > 100) {
|
|
215
|
+
drag.history.shift();
|
|
216
|
+
}
|
|
217
|
+
const dx = e.clientX - drag.startX;
|
|
218
|
+
const dy = e.clientY - drag.startY;
|
|
219
|
+
if (!drag.dragging) {
|
|
220
|
+
if (Math.abs(dx) < 4 && Math.abs(dy) < 4)
|
|
221
|
+
return;
|
|
222
|
+
drag.dragging = true;
|
|
223
|
+
setIsDragging(true);
|
|
224
|
+
el.setPointerCapture(drag.pointerId);
|
|
225
|
+
}
|
|
226
|
+
const targetLeft = drag.scrollLeft - dx;
|
|
227
|
+
const targetTop = drag.scrollTop - dy;
|
|
228
|
+
if (smooth && smoothAPI) {
|
|
229
|
+
if (smoothOrientation === 'horizontal') {
|
|
230
|
+
smoothAPI.setPosition(targetLeft);
|
|
231
|
+
if (orientation === 'both') {
|
|
232
|
+
el.scrollTop = targetTop;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
smoothAPI.setPosition(targetTop);
|
|
237
|
+
if (orientation === 'both') {
|
|
238
|
+
el.scrollLeft = targetLeft;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
if (orientation !== 'vertical')
|
|
244
|
+
el.scrollLeft = targetLeft;
|
|
245
|
+
if (orientation !== 'horizontal')
|
|
246
|
+
el.scrollTop = targetTop;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const onDragPointerEnd = (e) => {
|
|
250
|
+
var _a;
|
|
251
|
+
const drag = dragRef.current;
|
|
252
|
+
if (!drag)
|
|
253
|
+
return;
|
|
254
|
+
if (drag.dragging) {
|
|
255
|
+
suppressClickRef.current = e.type === 'pointerup';
|
|
256
|
+
setIsDragging(false);
|
|
257
|
+
const el = internalRef.current;
|
|
258
|
+
if (el) {
|
|
259
|
+
(_a = el.releasePointerCapture) === null || _a === void 0 ? void 0 : _a.call(el, drag.pointerId);
|
|
260
|
+
// Calculate release velocity
|
|
261
|
+
const now = performance.now();
|
|
262
|
+
const recentHistory = drag.history.filter(h => now - h.time < 100);
|
|
263
|
+
if (recentHistory.length >= 2) {
|
|
264
|
+
const first = recentHistory[0];
|
|
265
|
+
const last = recentHistory[recentHistory.length - 1];
|
|
266
|
+
const dt = last.time - first.time;
|
|
267
|
+
if (dt > 10) {
|
|
268
|
+
const vx = (last.x - first.x) / dt;
|
|
269
|
+
const vy = (last.y - first.y) / dt;
|
|
270
|
+
const speed = Math.sqrt(vx * vx + vy * vy);
|
|
271
|
+
// Only trigger inertia if speed is high enough AND smooth scrolling is enabled
|
|
272
|
+
if (speed > 0.15 && smooth) {
|
|
273
|
+
startDragInertia(-vx, -vy);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
dragRef.current = null;
|
|
280
|
+
};
|
|
281
|
+
const onDragClickCapture = (e) => {
|
|
282
|
+
if (!suppressClickRef.current)
|
|
283
|
+
return;
|
|
284
|
+
suppressClickRef.current = false;
|
|
285
|
+
e.preventDefault();
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
};
|
|
288
|
+
const dragHandlers = dragToScroll
|
|
289
|
+
? {
|
|
290
|
+
onPointerDown: onDragPointerDown,
|
|
291
|
+
onPointerMove: onDragPointerMove,
|
|
292
|
+
onPointerUp: onDragPointerEnd,
|
|
293
|
+
onPointerCancel: onDragPointerEnd,
|
|
294
|
+
onClickCapture: onDragClickCapture,
|
|
295
|
+
// Native HTML5 drag (images, links) hijacks the gesture mid-pan
|
|
296
|
+
onDragStart: (e) => e.preventDefault(),
|
|
297
|
+
}
|
|
298
|
+
: undefined;
|
|
69
299
|
// Scroll-detection state for type='scroll' (overlay scrollbar)
|
|
70
300
|
const [isScrolling, setIsScrolling] = useState(false);
|
|
71
301
|
const scrollTimerRef = useRef(undefined);
|
|
@@ -181,7 +411,15 @@ const ScrollArea = React__default.forwardRef(({ children, type = 'hover', size =
|
|
|
181
411
|
].join(' ');
|
|
182
412
|
}
|
|
183
413
|
}, [type]);
|
|
184
|
-
|
|
414
|
+
const onWheel = (e) => {
|
|
415
|
+
var _a;
|
|
416
|
+
if (inertiaFrameIdRef.current !== null) {
|
|
417
|
+
cancelAnimationFrame(inertiaFrameIdRef.current);
|
|
418
|
+
inertiaFrameIdRef.current = null;
|
|
419
|
+
}
|
|
420
|
+
(_a = props.onWheel) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
421
|
+
};
|
|
422
|
+
return (jsx("div", { ref: internalRef, className: cn(resolvedTheme.baseStyle, overflowClasses, snapClasses, scrollbarBase, scrollbarVisibility, dragToScroll && 'cursor-grab', isDragging && 'cursor-grabbing select-none', className), "data-orientation": orientation, "data-type": type, "data-smooth": smooth, "data-scrolling": isScrolling || undefined, "data-dragging": isDragging || undefined, ...props, ...dragHandlers, onWheel: onWheel, children: children }));
|
|
185
423
|
});
|
|
186
424
|
ScrollArea.displayName = 'ScrollArea';
|
|
187
425
|
|
|
@@ -43,6 +43,8 @@ export interface ScrollAreaRef extends HTMLDivElement {
|
|
|
43
43
|
pauseSmoothScroll?: () => void;
|
|
44
44
|
/** Resume smooth scrolling */
|
|
45
45
|
resumeSmoothScroll?: () => void;
|
|
46
|
+
/** Set scroll position immediately without animation */
|
|
47
|
+
setPosition?: (position: number) => void;
|
|
46
48
|
/** Refresh snap points */
|
|
47
49
|
refreshSnapPoints?: () => void;
|
|
48
50
|
}
|
|
@@ -89,9 +91,18 @@ export interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
89
91
|
*/
|
|
90
92
|
snapAlign?: 'start' | 'center' | 'end';
|
|
91
93
|
/**
|
|
92
|
-
* Enable
|
|
94
|
+
* Enable mouse drag-to-scroll panning (grab the content and drag, like touch).
|
|
95
|
+
* Mouse-only — touch input already pans natively. A real drag needs ~4px of
|
|
96
|
+
* movement first, so plain clicks on content (cards, buttons) still work; the
|
|
97
|
+
* click that would follow a completed drag is suppressed. Drags never start
|
|
98
|
+
* from text fields, so selection inside inputs/textareas is unaffected.
|
|
93
99
|
* @default false
|
|
94
100
|
*/
|
|
101
|
+
dragToScroll?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Enable smooth momentum-based scrolling
|
|
104
|
+
* @default true
|
|
105
|
+
*/
|
|
95
106
|
smooth?: boolean;
|
|
96
107
|
/**
|
|
97
108
|
* Configuration for smooth scrolling
|
|
@@ -98,6 +98,10 @@ export declare class SmoothScrollEngine {
|
|
|
98
98
|
* Scroll to element
|
|
99
99
|
*/
|
|
100
100
|
scrollToElement(element: HTMLElement, options?: ScrollToOptions): void;
|
|
101
|
+
/**
|
|
102
|
+
* Set scroll position immediately without animation, updating internal state
|
|
103
|
+
*/
|
|
104
|
+
setPosition(position: number): void;
|
|
101
105
|
/**
|
|
102
106
|
* Get current velocity
|
|
103
107
|
*/
|
|
@@ -447,6 +447,29 @@ class SmoothScrollEngine {
|
|
|
447
447
|
}
|
|
448
448
|
this.scrollTo(position, options);
|
|
449
449
|
}
|
|
450
|
+
/**
|
|
451
|
+
* Set scroll position immediately without animation, updating internal state
|
|
452
|
+
*/
|
|
453
|
+
setPosition(position) {
|
|
454
|
+
const max = getMaxScroll(this.element, this.orientation);
|
|
455
|
+
const clamped = clampScroll(position, 0, max);
|
|
456
|
+
this.state.current = clamped;
|
|
457
|
+
this.state.target = clamped;
|
|
458
|
+
this.previousPosition = clamped;
|
|
459
|
+
this.state.velocity.current = 0;
|
|
460
|
+
this.state.velocity.previous = 0;
|
|
461
|
+
// Sync to DOM
|
|
462
|
+
if (this.orientation === 'horizontal') {
|
|
463
|
+
this.element.scrollLeft = clamped;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
this.element.scrollTop = clamped;
|
|
467
|
+
}
|
|
468
|
+
// Stop any ongoing programmatic scroll or snapping
|
|
469
|
+
this.state.isSnapping = false;
|
|
470
|
+
this.state.targetSnapPoint = null;
|
|
471
|
+
this.animationOnComplete = null;
|
|
472
|
+
}
|
|
450
473
|
/**
|
|
451
474
|
* Get current velocity
|
|
452
475
|
*/
|
|
@@ -106,6 +106,10 @@ function useSmoothScroll(elementRef, config = {}, orientation = 'vertical') {
|
|
|
106
106
|
var _a;
|
|
107
107
|
(_a = engineRef.current) === null || _a === void 0 ? void 0 : _a.updateConfig(newConfig);
|
|
108
108
|
},
|
|
109
|
+
setPosition: (position) => {
|
|
110
|
+
var _a;
|
|
111
|
+
(_a = engineRef.current) === null || _a === void 0 ? void 0 : _a.setPosition(position);
|
|
112
|
+
},
|
|
109
113
|
refreshSnapPoints: () => {
|
|
110
114
|
var _a;
|
|
111
115
|
(_a = engineRef.current) === null || _a === void 0 ? void 0 : _a.refreshSnapPoints();
|
|
@@ -39,6 +39,11 @@ export interface SmoothScrollAPI {
|
|
|
39
39
|
* @param config - Partial configuration to update
|
|
40
40
|
*/
|
|
41
41
|
update: (config: SmoothScrollConfigUpdate) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Set scroll position immediately without animation, updating internal state
|
|
44
|
+
* @param position - Target scroll position in pixels
|
|
45
|
+
*/
|
|
46
|
+
setPosition: (position: number) => void;
|
|
42
47
|
/**
|
|
43
48
|
* Refresh snap points (call when DOM changes)
|
|
44
49
|
*/
|
|
@@ -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 rounded-[var(--segmented-radius)] bg-neutral-100 dark:bg-neutral-900 border border-[var(--color-border)] p-[var(--segmented-padding)] shadow-inner-real-md",
|
|
7
7
|
// Size variants using CSS variables
|
|
8
8
|
sizes: {
|
|
9
9
|
sm: "min-h-[var(--segmented-min-h-sm)]",
|
|
@@ -15,7 +15,7 @@ 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-200 ease-out pointer-events-none z-0 bg-
|
|
18
|
+
slidingBackgroundStyle: "absolute top-[0px] left-[0px] rounded-[var(--segmented-inner-radius)] transition-transform duration-200 ease-out pointer-events-none z-0 bg-[var(--color-surface)] shadow-real-md dark:bg-neutral-800",
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Default theme for the SegmentedItem component
|
|
@@ -11,4 +11,6 @@ export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & Rea
|
|
|
11
11
|
MobileTrigger: React.ForwardRefExoticComponent<import("./Sidebar.types").SidebarMobileTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
UserProfile: React.ForwardRefExoticComponent<import("./Sidebar.types").SidebarUserProfileProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
Logo: React.ForwardRefExoticComponent<import("./Sidebar.types").SidebarLogoProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Search: React.ForwardRefExoticComponent<import("./Sidebar.types").SidebarSearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
Card: React.ForwardRefExoticComponent<import("./Sidebar.types").SidebarCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
16
|
};
|
|
@@ -14,21 +14,27 @@ import { SidebarToggle } from './SidebarToggle.js';
|
|
|
14
14
|
import { SidebarMobileTrigger } from './SidebarMobileTrigger.js';
|
|
15
15
|
import { SidebarUserProfile } from './SidebarUserProfile.js';
|
|
16
16
|
import { SidebarLogo } from './SidebarLogo.js';
|
|
17
|
+
import { SidebarSearch } from './SidebarSearch.js';
|
|
18
|
+
import { SidebarCard } from './SidebarCard.js';
|
|
17
19
|
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
20
|
+
// Subtle spring on the sidebar's width animation. Stiffness/damping picked so
|
|
21
|
+
// the effective duration sits in the same ~200ms window as the internal CSS
|
|
22
|
+
// transitions on padding/gap (Tailwind `duration-200`), but with a soft
|
|
23
|
+
// organic settle instead of a linear cubic-bezier. Damping ratio ≈ 0.9 — a
|
|
24
|
+
// hair under critical so there's a barely-perceptible easing-into-final
|
|
25
|
+
// rather than an overshoot/bounce.
|
|
21
26
|
const SIDEBAR_TRANSITION = {
|
|
22
|
-
type: "
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
type: "spring",
|
|
28
|
+
stiffness: 320,
|
|
29
|
+
damping: 34,
|
|
30
|
+
mass: 1,
|
|
25
31
|
};
|
|
26
32
|
const SidebarDesktop = React__default.forwardRef(({ side = "left", variant = "sidebar", density, width, children, className, theme: customTheme = {}, ...props }, ref) => {
|
|
27
33
|
var _a, _b, _c, _d;
|
|
28
34
|
const context = useSidebarContext();
|
|
29
35
|
const collapsed = (_a = context === null || context === void 0 ? void 0 : context.collapsed) !== null && _a !== void 0 ? _a : false;
|
|
30
36
|
const expandedWidth = (width === null || width === void 0 ? void 0 : width.expanded) || ((_b = context === null || context === void 0 ? void 0 : context.width) === null || _b === void 0 ? void 0 : _b.expanded) || 280;
|
|
31
|
-
const collapsedWidth = (width === null || width === void 0 ? void 0 : width.collapsed) || ((_c = context === null || context === void 0 ? void 0 : context.width) === null || _c === void 0 ? void 0 : _c.collapsed) ||
|
|
37
|
+
const collapsedWidth = (width === null || width === void 0 ? void 0 : width.collapsed) || ((_c = context === null || context === void 0 ? void 0 : context.width) === null || _c === void 0 ? void 0 : _c.collapsed) || 60;
|
|
32
38
|
const theme = useMemo(() => ({
|
|
33
39
|
...sidebarTheme,
|
|
34
40
|
...customTheme,
|
|
@@ -104,6 +110,8 @@ const Sidebar = Object.assign(SidebarRoot, {
|
|
|
104
110
|
MobileTrigger: SidebarMobileTrigger,
|
|
105
111
|
UserProfile: SidebarUserProfile,
|
|
106
112
|
Logo: SidebarLogo,
|
|
113
|
+
Search: SidebarSearch,
|
|
114
|
+
Card: SidebarCard,
|
|
107
115
|
});
|
|
108
116
|
|
|
109
117
|
export { Sidebar };
|
|
@@ -72,7 +72,7 @@ export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
72
72
|
/**
|
|
73
73
|
* Children components
|
|
74
74
|
*/
|
|
75
|
-
children
|
|
75
|
+
children?: ReactNode;
|
|
76
76
|
/**
|
|
77
77
|
* Custom theme overrides
|
|
78
78
|
*/
|
|
@@ -176,11 +176,99 @@ export interface SidebarUserProfileProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
176
176
|
children?: ReactNode;
|
|
177
177
|
}
|
|
178
178
|
export interface SidebarLogoProps extends HTMLAttributes<HTMLDivElement> {
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Logo shown when the sidebar is **expanded**. Accepts any node — an `<img>`,
|
|
181
|
+
* an inline `<svg>`, or composed JSX (e.g. a mark + wordmark). Preferred
|
|
182
|
+
* over the legacy `icon` + `text` API.
|
|
183
|
+
*/
|
|
184
|
+
expanded?: ReactNode;
|
|
185
|
+
/**
|
|
186
|
+
* Logo shown when the sidebar is **collapsed**. Typically a square mark
|
|
187
|
+
* (image, SVG, or JSX). If omitted, falls back to `expanded`, then to the
|
|
188
|
+
* legacy `icon` prop.
|
|
189
|
+
*/
|
|
190
|
+
collapsed?: ReactNode;
|
|
191
|
+
/**
|
|
192
|
+
* Convenience: image URL for the expanded logo. Rendered as an `<img>` with
|
|
193
|
+
* sensible defaults (`h-8 w-auto object-contain`). Use `expandedImageClassName`
|
|
194
|
+
* to override sizing / object-fit. Ignored when `expanded` (ReactNode) is set.
|
|
195
|
+
*/
|
|
196
|
+
expandedSrc?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Convenience: image URL for the collapsed logo. Rendered as an `<img>` in a
|
|
199
|
+
* 36×36 (`size-9`) slot — matching the nav icon track — with `object-cover`
|
|
200
|
+
* by default. Use `collapsedImageClassName` to switch to `object-contain`,
|
|
201
|
+
* adjust border-radius, etc. Ignored when `collapsed` (ReactNode) is set.
|
|
202
|
+
*/
|
|
203
|
+
collapsedSrc?: string;
|
|
204
|
+
/** ClassName forwarded to the auto-rendered `<img>` for `expandedSrc`. */
|
|
205
|
+
expandedImageClassName?: string;
|
|
206
|
+
/** ClassName forwarded to the auto-rendered `<img>` for `collapsedSrc`. */
|
|
207
|
+
collapsedImageClassName?: string;
|
|
208
|
+
/** Alt text for any auto-rendered `<img>` (both `expandedSrc` and `collapsedSrc`). */
|
|
209
|
+
alt?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Legacy: always-visible icon/mark. Shown in both states; the `text` prop
|
|
212
|
+
* fades in alongside it when expanded. Use `expanded` / `collapsed` instead
|
|
213
|
+
* for full control (especially for image/SVG logos that differ per state).
|
|
214
|
+
*/
|
|
215
|
+
icon?: ReactNode;
|
|
216
|
+
/**
|
|
217
|
+
* Legacy: text rendered to the right of `icon` when expanded — animates
|
|
218
|
+
* in/out on collapse. Use `expanded` instead for full control.
|
|
219
|
+
*/
|
|
182
220
|
text?: ReactNode;
|
|
183
221
|
}
|
|
222
|
+
export interface SidebarSearchProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
223
|
+
/** Controlled value */
|
|
224
|
+
value?: string;
|
|
225
|
+
/** Uncontrolled initial value */
|
|
226
|
+
defaultValue?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Fires on every keystroke. Consumers wire this to render results wherever
|
|
229
|
+
* they like (popover, command palette, side panel). The Sidebar tree itself
|
|
230
|
+
* is NOT filtered.
|
|
231
|
+
*/
|
|
232
|
+
onChange?: (value: string) => void;
|
|
233
|
+
/** @default "Search…" */
|
|
234
|
+
placeholder?: string;
|
|
235
|
+
/** @default 'sm' */
|
|
236
|
+
size?: "sm" | "md";
|
|
237
|
+
/** Override the leading icon (defaults to MagnifyingGlassIcon). */
|
|
238
|
+
iconStart?: ReactNode;
|
|
239
|
+
/** Tooltip + aria-label for the collapsed-mode icon button. @default "Search" */
|
|
240
|
+
collapsedLabel?: string;
|
|
241
|
+
/** Hide the collapsed-mode icon button entirely. @default false */
|
|
242
|
+
hideWhenCollapsed?: boolean;
|
|
243
|
+
/** Forwarded to the underlying Input's group wrapper — use for background
|
|
244
|
+
* overrides on custom sidebar surfaces (e.g. `bg-transparent`). */
|
|
245
|
+
inputGroupClassName?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface SidebarCardTheme {
|
|
248
|
+
/** Outer wrapper applied in both styled and unstyled modes — must carry
|
|
249
|
+
* `overflow-hidden` so the height collapse animation clips children. */
|
|
250
|
+
wrapperStyle: string;
|
|
251
|
+
/** Default container chrome (rounded / surface bg / border / padding).
|
|
252
|
+
* Skipped when the consumer sets `unstyled`. */
|
|
253
|
+
baseStyle: string;
|
|
254
|
+
}
|
|
255
|
+
export interface SidebarCardThemeOverrides {
|
|
256
|
+
wrapperStyle?: string;
|
|
257
|
+
baseStyle?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface SidebarCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
260
|
+
children: ReactNode;
|
|
261
|
+
className?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Drop the default container styling (rounded / bg / border / padding)
|
|
264
|
+
* so consumers can put an edge-to-edge image, a custom panel, or any
|
|
265
|
+
* non-card-shaped content inside without fighting the default chrome.
|
|
266
|
+
* The disappear-on-collapse animation is unchanged.
|
|
267
|
+
* @default false
|
|
268
|
+
*/
|
|
269
|
+
unstyled?: boolean;
|
|
270
|
+
theme?: SidebarCardThemeOverrides;
|
|
271
|
+
}
|
|
184
272
|
export interface SidebarProviderProps {
|
|
185
273
|
children: React.ReactNode;
|
|
186
274
|
defaultCollapsed?: boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SidebarCardProps } from "./Sidebar.types";
|
|
3
|
+
/**
|
|
4
|
+
* A collapse-aware container for arbitrary sidebar content — promo CTAs,
|
|
5
|
+
* storage meters, tip-of-the-day, banner images, anything. Renders its
|
|
6
|
+
* children when the sidebar is expanded and **disappears entirely** when
|
|
7
|
+
* the sidebar collapses (smooth height + opacity exit via AnimatePresence).
|
|
8
|
+
*
|
|
9
|
+
* Composition is open: drop in raw text, an `<img>`, a `<Button>`,
|
|
10
|
+
* `<Progress>`, or any custom JSX. There are intentionally no sub-parts
|
|
11
|
+
* (`Sidebar.Card.Header`/`.Body`/…) because the whole card vanishes
|
|
12
|
+
* together — granular slots add ceremony with no payoff.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Sidebar.Card>
|
|
16
|
+
* <p className="text-sm">Upgrade for unlimited projects.</p>
|
|
17
|
+
* <Button size="sm" className="mt-2 w-full">Upgrade</Button>
|
|
18
|
+
* </Sidebar.Card>
|
|
19
|
+
*
|
|
20
|
+
* @example Edge-to-edge image (no default container chrome):
|
|
21
|
+
* <Sidebar.Card unstyled>
|
|
22
|
+
* <img src="/promo.jpg" alt="" className="w-full rounded-[var(--card-radius)]" />
|
|
23
|
+
* </Sidebar.Card>
|
|
24
|
+
*/
|
|
25
|
+
export declare const SidebarCard: React.ForwardRefExoticComponent<SidebarCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useMemo, useState, useEffect } from 'react';
|
|
3
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { sidebarCardTheme } from './SidebarCard.theme.js';
|
|
6
|
+
import { useSidebarCollapsed } from './SidebarContext.js';
|
|
7
|
+
|
|
8
|
+
// Sidebar.Card mount is sequenced relative to the sidebar's collapse/expand
|
|
9
|
+
// animation. On collapse → the card exits immediately (popLayout + slide/fade
|
|
10
|
+
// in parallel with the rail narrowing). On expand → the card mount is delayed
|
|
11
|
+
// until the sidebar's spring has settled, so the card lays out at its FINAL
|
|
12
|
+
// expanded width on first render and the text never reflows mid-animation.
|
|
13
|
+
// 260ms ≈ the spring's 99% settle time (stiffness 320, damping 34) — see
|
|
14
|
+
// Sidebar.tsx's SIDEBAR_TRANSITION comment for the underlying math.
|
|
15
|
+
const MOUNT_DELAY_MS = 260;
|
|
16
|
+
/**
|
|
17
|
+
* A collapse-aware container for arbitrary sidebar content — promo CTAs,
|
|
18
|
+
* storage meters, tip-of-the-day, banner images, anything. Renders its
|
|
19
|
+
* children when the sidebar is expanded and **disappears entirely** when
|
|
20
|
+
* the sidebar collapses (smooth height + opacity exit via AnimatePresence).
|
|
21
|
+
*
|
|
22
|
+
* Composition is open: drop in raw text, an `<img>`, a `<Button>`,
|
|
23
|
+
* `<Progress>`, or any custom JSX. There are intentionally no sub-parts
|
|
24
|
+
* (`Sidebar.Card.Header`/`.Body`/…) because the whole card vanishes
|
|
25
|
+
* together — granular slots add ceremony with no payoff.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <Sidebar.Card>
|
|
29
|
+
* <p className="text-sm">Upgrade for unlimited projects.</p>
|
|
30
|
+
* <Button size="sm" className="mt-2 w-full">Upgrade</Button>
|
|
31
|
+
* </Sidebar.Card>
|
|
32
|
+
*
|
|
33
|
+
* @example Edge-to-edge image (no default container chrome):
|
|
34
|
+
* <Sidebar.Card unstyled>
|
|
35
|
+
* <img src="/promo.jpg" alt="" className="w-full rounded-[var(--card-radius)]" />
|
|
36
|
+
* </Sidebar.Card>
|
|
37
|
+
*/
|
|
38
|
+
const SidebarCard = React__default.forwardRef(({ children, className, unstyled = false, theme: customTheme, ...props }, ref) => {
|
|
39
|
+
const { isCollapsedView } = useSidebarCollapsed();
|
|
40
|
+
const theme = useMemo(() => ({ ...sidebarCardTheme, ...customTheme }), [customTheme]);
|
|
41
|
+
// Card is visible when expanded. Hide immediately on collapse (so the
|
|
42
|
+
// AnimatePresence exit + popLayout reflow happens in parallel with the
|
|
43
|
+
// rail narrowing). On expand, wait for the sidebar spring to settle
|
|
44
|
+
// before mounting — see `MOUNT_DELAY_MS` rationale.
|
|
45
|
+
const [shouldShow, setShouldShow] = useState(!isCollapsedView);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (isCollapsedView) {
|
|
48
|
+
setShouldShow(false);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const id = setTimeout(() => setShouldShow(true), MOUNT_DELAY_MS);
|
|
52
|
+
return () => clearTimeout(id);
|
|
53
|
+
}, [isCollapsedView]);
|
|
54
|
+
// Strip drag/animation DOM handlers that collide with motion's prop types
|
|
55
|
+
// (same pattern the other Sidebar pieces use, e.g. Sidebar.tsx:54-61).
|
|
56
|
+
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, ...motionSafeProps } = props;
|
|
57
|
+
return (
|
|
58
|
+
// `mode="popLayout"` removes the exiting card from the layout flow
|
|
59
|
+
// immediately so siblings (footer, nav rows below) snap into their new
|
|
60
|
+
// positions without waiting on the card's exit animation.
|
|
61
|
+
jsx(AnimatePresence, { initial: false, mode: "popLayout", children: shouldShow && (jsx(motion.div, { ref: ref, initial: { opacity: 0, x: -16 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -16 }, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] }, className: cn(theme.wrapperStyle,
|
|
62
|
+
// Default card chrome (rounded / bg / border / p-3) unless the
|
|
63
|
+
// consumer opts out. className wins per shadcn rules.
|
|
64
|
+
!unstyled && theme.baseStyle, className), ...motionSafeProps, children: children }, "sidebar-card")) }));
|
|
65
|
+
});
|
|
66
|
+
SidebarCard.displayName = "SidebarCard";
|
|
67
|
+
|
|
68
|
+
export { SidebarCard };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SidebarCardTheme } from "./Sidebar.types";
|
|
2
|
+
/**
|
|
3
|
+
* Default theme for `<Sidebar.Card>`. Small surface — the component itself
|
|
4
|
+
* only renders a single styled wrapper that disappears on collapse, so the
|
|
5
|
+
* theme just holds the default outer chrome. Set `unstyled` on the card to
|
|
6
|
+
* skip it entirely (e.g. for full-bleed images).
|
|
7
|
+
*/
|
|
8
|
+
export declare const sidebarCardTheme: SidebarCardTheme;
|