@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default theme for `<Sidebar.Card>`. Small surface — the component itself
|
|
3
|
+
* only renders a single styled wrapper that disappears on collapse, so the
|
|
4
|
+
* theme just holds the default outer chrome. Set `unstyled` on the card to
|
|
5
|
+
* skip it entirely (e.g. for full-bleed images).
|
|
6
|
+
*/
|
|
7
|
+
const sidebarCardTheme = {
|
|
8
|
+
// Card chrome — surface bg, hairline border, sidebar-tuned padding (p-3 is
|
|
9
|
+
// tighter than core/Card's p-6 because the rail is narrow). `overflow-hidden`
|
|
10
|
+
// keeps any children clipped to the rounded corners.
|
|
11
|
+
baseStyle: "rounded-[var(--card-radius)] bg-[var(--color-surface)] border border-[var(--color-border)] p-3 overflow-hidden",
|
|
12
|
+
// Wrapper applied in both styled + unstyled modes. Empty by default —
|
|
13
|
+
// the slide/fade animation lives on motion.div itself, not on this layer,
|
|
14
|
+
// so no overflow trickery needed here.
|
|
15
|
+
wrapperStyle: "",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { sidebarCardTheme };
|
|
@@ -8,7 +8,11 @@ import '../ScrollArea/smooth/SmoothScrollEngine.js';
|
|
|
8
8
|
const SidebarContent = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
9
9
|
const { isCollapsedView } = useSidebarCollapsed();
|
|
10
10
|
const density = useSidebarDensity();
|
|
11
|
-
return (jsx(ScrollArea, { ref: ref, type: "none", size: "thin", className: "flex-1 min-h-0", ...props, children: jsx("div", { className: cn("py-3 transition-[padding] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]", density === "compact" && "py-2",
|
|
11
|
+
return (jsx(ScrollArea, { ref: ref, type: "none", size: "thin", className: "flex-1 min-h-0", ...props, children: jsx("div", { className: cn("py-3 transition-[padding] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]", density === "compact" && "py-2",
|
|
12
|
+
// Collapsed px-3 (12) on a 60px rail leaves a 36px interior — every
|
|
13
|
+
// child row (NavItem, Sidebar.Search) is exactly 36px wide, matching
|
|
14
|
+
// the 36×36 hit-area target.
|
|
15
|
+
isCollapsedView ? "px-3" : "px-2.5", className), children: children }) }));
|
|
12
16
|
});
|
|
13
17
|
SidebarContent.displayName = "SidebarContent";
|
|
14
18
|
|
|
@@ -8,12 +8,20 @@ import { Button } from '../Button/Button.js';
|
|
|
8
8
|
|
|
9
9
|
const SidebarHeader = React__default.forwardRef(({ logo, showToggle = true, customToggle, children, className, ...props }, ref) => {
|
|
10
10
|
const sidebarContext = useSidebarContext();
|
|
11
|
-
const { isMobile, isMobileOpen
|
|
11
|
+
const { isMobile, isMobileOpen } = useSidebarCollapsed();
|
|
12
12
|
// If children are provided, use them instead of default layout
|
|
13
13
|
if (children) {
|
|
14
14
|
return (jsx("div", { ref: ref, className: cn("flex-shrink-0 border-b border-[var(--color-border)]", className), ...props, children: children }));
|
|
15
15
|
}
|
|
16
|
-
return (jsxs("div", { ref: ref, className: cn("flex items-center flex-shrink-0 h-14 border-b border-[var(--color-border)] overflow-visible relative transition-[padding,background-color,border-color] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
16
|
+
return (jsxs("div", { ref: ref, className: cn("flex items-center flex-shrink-0 h-14 border-b border-[var(--color-border)] overflow-visible relative transition-[padding,background-color,border-color] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
17
|
+
// Padding mirrors Sidebar.Content so the header logo sits on the
|
|
18
|
+
// same horizontal track as the NavItem rows below it. px-3 (12px)
|
|
19
|
+
// on the 60px collapsed rail leaves a 36px interior — a 32px logo
|
|
20
|
+
// (size-8) lands with 2px slack on each side; a 36px logo (size-9)
|
|
21
|
+
// fills the interior exactly. Left-pinned in both states (no
|
|
22
|
+
// `justify-*` toggle) so nothing jumps mid-animation. Same value
|
|
23
|
+
// for collapsed + expanded → no padding transition needed.
|
|
24
|
+
"px-3", className), ...props, children: [jsx("div", { className: "flex items-center min-w-0 flex-1", children: logo }), isMobile && isMobileOpen && (jsx(Button, { variant: "ghost", size: "sm", className: "size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)]", onClick: () => sidebarContext === null || sidebarContext === void 0 ? void 0 : sidebarContext.setMobileOpen(false), "aria-label": "Close navigation", children: jsx(XMarkIcon, { className: "size-4" }) })), !isMobile && showToggle && (customToggle || jsx(SidebarToggle, {}))] }));
|
|
17
25
|
});
|
|
18
26
|
SidebarHeader.displayName = "SidebarHeader";
|
|
19
27
|
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { AnimatePresence, motion } from 'motion/react';
|
|
5
5
|
import { useSidebarCollapsed } from './SidebarContext.js';
|
|
6
6
|
|
|
7
|
-
const SidebarLogo = React__default.forwardRef(({ icon, text, className, ...props }, ref) => {
|
|
7
|
+
const SidebarLogo = React__default.forwardRef(({ expanded, collapsed, expandedSrc, collapsedSrc, expandedImageClassName, collapsedImageClassName, alt = "", icon, text, className, ...props }, ref) => {
|
|
8
|
+
var _a, _b;
|
|
8
9
|
const { isCollapsedView } = useSidebarCollapsed();
|
|
9
|
-
|
|
10
|
+
// Auto-render <img> for the src convenience API. ReactNode props still win
|
|
11
|
+
// (full control); src is the easy path for plain image/SVG assets.
|
|
12
|
+
//
|
|
13
|
+
// Defaults:
|
|
14
|
+
// - Collapsed: size-9 (36px) square, object-cover — matches the nav icon
|
|
15
|
+
// track so the collapsed logo aligns visually with NavItem rows below.
|
|
16
|
+
// - Expanded: h-8 w-auto object-contain — typical wordmark sizing.
|
|
17
|
+
// Override via `collapsedImageClassName` / `expandedImageClassName`
|
|
18
|
+
// (tailwind-merge resolves conflicts in favor of the user's classes).
|
|
19
|
+
const expandedNode = expanded !== null && expanded !== void 0 ? expanded : (expandedSrc ? (jsx("img", { src: expandedSrc, alt: alt, className: cn("h-8 w-auto object-contain", expandedImageClassName) })) : undefined);
|
|
20
|
+
const collapsedNode = collapsed !== null && collapsed !== void 0 ? collapsed : (collapsedSrc ? (jsx("img", { src: collapsedSrc, alt: alt, className: cn("size-9 object-cover", collapsedImageClassName) })) : undefined);
|
|
21
|
+
// New API takes precedence: if the user passed `expanded`/`collapsed`
|
|
22
|
+
// (ReactNode) OR their `*Src` shortcuts, render those (cross-faded).
|
|
23
|
+
// Otherwise fall back to the legacy icon-plus-animated-text rendering so
|
|
24
|
+
// existing consumers keep working.
|
|
25
|
+
const hasNewApi = expandedNode !== undefined || collapsedNode !== undefined;
|
|
26
|
+
if (hasNewApi) {
|
|
27
|
+
// Resolve the logo for the current state, falling all the way back to
|
|
28
|
+
// the legacy `icon` so a partial new-API usage still has something to
|
|
29
|
+
// show. Per-state fallback: collapsed → expanded → icon, and vice versa.
|
|
30
|
+
const currentLogo = isCollapsedView
|
|
31
|
+
? (_a = collapsedNode !== null && collapsedNode !== void 0 ? collapsedNode : expandedNode) !== null && _a !== void 0 ? _a : icon
|
|
32
|
+
: (_b = expandedNode !== null && expandedNode !== void 0 ? expandedNode : collapsedNode) !== null && _b !== void 0 ? _b : icon;
|
|
33
|
+
return (jsx("div", { ref: ref,
|
|
34
|
+
// No `overflow-hidden`: would clip wide logos in collapsed mode.
|
|
35
|
+
// Sidebar itself is `overflow-visible`.
|
|
36
|
+
className: cn("flex items-center", className), ...props, children: jsx(AnimatePresence, { mode: "wait", initial: false, children: jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.15, ease: [0.4, 0, 0.2, 1] }, className: "flex items-center", children: currentLogo }, isCollapsedView ? "collapsed" : "expanded") }) }));
|
|
37
|
+
}
|
|
38
|
+
// Legacy API: icon + animated text.
|
|
39
|
+
return (jsxs("div", { ref: ref,
|
|
40
|
+
// No `overflow-hidden` here — that would clip the icon when the
|
|
41
|
+
// sidebar is collapsed and horizontal space is tight. The text
|
|
42
|
+
// collapse animation owns its own `overflow-hidden` on the motion.div
|
|
43
|
+
// below, which is the only place it's actually needed.
|
|
44
|
+
className: cn("flex items-center gap-2", className), ...props, children: [jsx("div", { className: "flex-shrink-0", children: icon }), jsx(AnimatePresence, { initial: false, children: !isCollapsedView && text && (jsx(motion.div, { className: "overflow-hidden whitespace-nowrap", initial: { opacity: 0, x: -8 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -8 }, transition: { duration: 0.15, ease: [0.4, 0, 0.2, 1] }, children: typeof text === "string" ? (jsx("span", { className: "text-base font-semibold tracking-tight text-[var(--color-text-primary)]", children: text })) : (text) }, "logo-text")) })] }));
|
|
10
45
|
});
|
|
11
46
|
SidebarLogo.displayName = "SidebarLogo";
|
|
12
47
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SidebarSearchProps } from "./Sidebar.types";
|
|
3
|
+
/**
|
|
4
|
+
* Optional search field for the Sidebar. Emits the typed query via `onChange`
|
|
5
|
+
* (or via the controlled `value` prop) — does NOT filter the Sidebar tree itself.
|
|
6
|
+
* Consumers wire `onChange` to whatever surfaces results (popover, command palette,
|
|
7
|
+
* side panel, route, …) so the Sidebar stays visually clean.
|
|
8
|
+
*
|
|
9
|
+
* The collapse animation mirrors NavItem (single rendered structure across both
|
|
10
|
+
* states, icon always present in a fixed flex slot, the expanded content
|
|
11
|
+
* animates in/out via AnimatePresence). The field's border + surface fill fade
|
|
12
|
+
* out via a CSS transition so the collapsed rail just shows the icon — same
|
|
13
|
+
* look as the NavItem rows above it. Click the icon to expand the sidebar and
|
|
14
|
+
* focus the input. Opt out of the collapsed affordance with `hideWhenCollapsed`.
|
|
15
|
+
*
|
|
16
|
+
* Implementation note: this uses a small inline field instead of the shared
|
|
17
|
+
* `<Input>` so the icon + animated input can be siblings under one wrapper
|
|
18
|
+
* (Input's internal layout wouldn't permit the NavItem-style animation). The
|
|
19
|
+
* border/focus styling matches `formsBaseTheme.inputGroupBaseStyle` (inset
|
|
20
|
+
* box-shadow + ring) so it reads as a normal form control when expanded.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SidebarSearch: React.ForwardRefExoticComponent<SidebarSearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { motion, AnimatePresence } from 'motion/react';
|
|
4
|
+
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
7
|
+
import '../Tooltip/Tooltip.animations.js';
|
|
8
|
+
import { useSidebarContext, useSidebarCollapsed } from './SidebarContext.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Optional search field for the Sidebar. Emits the typed query via `onChange`
|
|
12
|
+
* (or via the controlled `value` prop) — does NOT filter the Sidebar tree itself.
|
|
13
|
+
* Consumers wire `onChange` to whatever surfaces results (popover, command palette,
|
|
14
|
+
* side panel, route, …) so the Sidebar stays visually clean.
|
|
15
|
+
*
|
|
16
|
+
* The collapse animation mirrors NavItem (single rendered structure across both
|
|
17
|
+
* states, icon always present in a fixed flex slot, the expanded content
|
|
18
|
+
* animates in/out via AnimatePresence). The field's border + surface fill fade
|
|
19
|
+
* out via a CSS transition so the collapsed rail just shows the icon — same
|
|
20
|
+
* look as the NavItem rows above it. Click the icon to expand the sidebar and
|
|
21
|
+
* focus the input. Opt out of the collapsed affordance with `hideWhenCollapsed`.
|
|
22
|
+
*
|
|
23
|
+
* Implementation note: this uses a small inline field instead of the shared
|
|
24
|
+
* `<Input>` so the icon + animated input can be siblings under one wrapper
|
|
25
|
+
* (Input's internal layout wouldn't permit the NavItem-style animation). The
|
|
26
|
+
* border/focus styling matches `formsBaseTheme.inputGroupBaseStyle` (inset
|
|
27
|
+
* box-shadow + ring) so it reads as a normal form control when expanded.
|
|
28
|
+
*/
|
|
29
|
+
const SidebarSearch = React__default.forwardRef(({ value: controlledValue, defaultValue = "", onChange, placeholder = "Search…", size = "md", iconStart, collapsedLabel = "Search", hideWhenCollapsed = false, className, inputGroupClassName, ...props }, ref) => {
|
|
30
|
+
const context = useSidebarContext();
|
|
31
|
+
const { isCollapsedView } = useSidebarCollapsed();
|
|
32
|
+
const isControlled = controlledValue !== undefined;
|
|
33
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
34
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
35
|
+
// Compose the user's forwarded ref with our local ref so we can focus
|
|
36
|
+
// the input after the rail expands.
|
|
37
|
+
const inputRef = useRef(null);
|
|
38
|
+
const setInputRef = (el) => {
|
|
39
|
+
inputRef.current = el;
|
|
40
|
+
if (typeof ref === "function")
|
|
41
|
+
ref(el);
|
|
42
|
+
else if (ref)
|
|
43
|
+
ref.current = el;
|
|
44
|
+
};
|
|
45
|
+
// Focus the input on the frame *after* collapse→expand transitions, but only
|
|
46
|
+
// when the user triggered it from the icon click (not e.g. via Sidebar.Toggle,
|
|
47
|
+
// where stealing focus would be surprising).
|
|
48
|
+
const pendingFocusRef = useRef(false);
|
|
49
|
+
const wasCollapsedRef = useRef(isCollapsedView);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (wasCollapsedRef.current && !isCollapsedView && pendingFocusRef.current) {
|
|
52
|
+
const id = requestAnimationFrame(() => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
53
|
+
pendingFocusRef.current = false;
|
|
54
|
+
wasCollapsedRef.current = isCollapsedView;
|
|
55
|
+
return () => cancelAnimationFrame(id);
|
|
56
|
+
}
|
|
57
|
+
wasCollapsedRef.current = isCollapsedView;
|
|
58
|
+
}, [isCollapsedView]);
|
|
59
|
+
const handleChange = (e) => {
|
|
60
|
+
const next = e.target.value;
|
|
61
|
+
if (!isControlled)
|
|
62
|
+
setInternalValue(next);
|
|
63
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(next);
|
|
64
|
+
};
|
|
65
|
+
const handleExpand = () => {
|
|
66
|
+
if (!isCollapsedView)
|
|
67
|
+
return;
|
|
68
|
+
pendingFocusRef.current = true;
|
|
69
|
+
context === null || context === void 0 ? void 0 : context.setCollapsed(false);
|
|
70
|
+
};
|
|
71
|
+
const handleKeyDown = (e) => {
|
|
72
|
+
if (!isCollapsedView)
|
|
73
|
+
return;
|
|
74
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
handleExpand();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
if (isCollapsedView && hideWhenCollapsed)
|
|
80
|
+
return null;
|
|
81
|
+
// Form-field shell — same inset-shadow border + focus ring as the shared
|
|
82
|
+
// forms.theme.ts (inputGroupBaseStyle), kept in sync intentionally. CSS
|
|
83
|
+
// transitions on background + box-shadow let the field fade out cleanly
|
|
84
|
+
// as the rail collapses; AnimatePresence handles the input itself.
|
|
85
|
+
const shellExpanded = "bg-[var(--color-surface)] shadow-[inset_0_0_0_1px_var(--color-border)] " +
|
|
86
|
+
"focus-within:shadow-[inset_0_0_0_1px_var(--color-primary-600)] " +
|
|
87
|
+
"focus-within:ring-4 focus-within:ring-[var(--color-primary)]/10 " +
|
|
88
|
+
"not-focus-within:hover:shadow-[inset_0_0_0_1px_var(--color-border-secondary)] " +
|
|
89
|
+
"dark:focus-within:shadow-[inset_0_0_0_1px_var(--color-primary-500)] dark:focus-within:ring-[var(--color-primary-500)]/20";
|
|
90
|
+
// Collapsed: keep the surface fill so the icon reads as a search "button"
|
|
91
|
+
// (not a transparent row). Hover lifts to surface-hover.
|
|
92
|
+
const shellCollapsed = "bg-[var(--color-surface)] shadow-[inset_0_0_0_0_transparent] " +
|
|
93
|
+
"hover:bg-[var(--color-surface-hover)] cursor-pointer";
|
|
94
|
+
const tooltipPlacement = (context === null || context === void 0 ? void 0 : context.side) === "right" ? "left" : "right";
|
|
95
|
+
const field = (jsxs(motion.div, { role: isCollapsedView ? "button" : undefined, tabIndex: isCollapsedView ? 0 : undefined, "aria-label": isCollapsedView ? collapsedLabel : undefined, onClick: isCollapsedView ? handleExpand : undefined, onKeyDown: handleKeyDown, className: cn("relative flex items-center rounded-[var(--form-radius)]",
|
|
96
|
+
// 36px (h-9) in BOTH states so the search row sits at the exact
|
|
97
|
+
// same height as the NavItem rows below it — same look expanded,
|
|
98
|
+
// same 36×36 square collapsed. `size` prop is currently a no-op
|
|
99
|
+
// for height; kept on the API surface for forward compatibility.
|
|
100
|
+
"h-9",
|
|
101
|
+
// NOTE: do NOT toggle `justify-center` between states. Combined
|
|
102
|
+
// with the icon span's constant `pl-2`, the icon sits at the same
|
|
103
|
+
// field-x (8) in both states, so the *only* thing that animates
|
|
104
|
+
// on collapse/expand is the field width (via sidebar's motion
|
|
105
|
+
// width) and the input fading in/out via AnimatePresence. Adding
|
|
106
|
+
// a justify-* toggle here would snap the icon by 4px on frame 0
|
|
107
|
+
// of every transition.
|
|
108
|
+
"transition-[background-color,box-shadow] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]", "overflow-hidden", isCollapsedView ? shellCollapsed : shellExpanded, inputGroupClassName), children: [jsx("span", { className: cn("flex items-center justify-center flex-shrink-0 pl-2", "text-[var(--color-text-muted)] transition-colors duration-200"), "aria-hidden": !isCollapsedView || undefined, children: iconStart !== null && iconStart !== void 0 ? iconStart : jsx(MagnifyingGlassIcon, { className: "size-5" }) }), jsx(AnimatePresence, { initial: false, children: !isCollapsedView && (jsx(motion.div, { initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -4 }, transition: {
|
|
109
|
+
opacity: { duration: 0.15, ease: [0.4, 0, 0.2, 1] },
|
|
110
|
+
x: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
|
|
111
|
+
}, className: "flex-1 min-w-0 flex items-center overflow-hidden", children: jsx("input", { ref: setInputRef, type: "search", value: value, onChange: handleChange, placeholder: placeholder, "aria-label": collapsedLabel, className: cn(
|
|
112
|
+
// Icon span pl-2 (8) + icon size-5 (20) = field-x 8-28.
|
|
113
|
+
// Input pl-3 (12) → text starts at field-x = 28 + 12 = 40,
|
|
114
|
+
// giving a 12px icon→text gap (matches <Input iconStart>'s
|
|
115
|
+
// pl-3 + pl-10 = 12px convention).
|
|
116
|
+
"w-full bg-transparent border-0 outline-none text-sm py-2 pl-3 pr-3", "text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)]", "dark:placeholder:text-[var(--color-neutral-500)]") }) }, "search-input")) })] }));
|
|
117
|
+
return (
|
|
118
|
+
// Outer horizontal padding mirrors Sidebar.Content (px-3 collapsed,
|
|
119
|
+
// px-2.5 expanded) so the search row sits on the exact same horizontal
|
|
120
|
+
// track as the NavItem rows below it — both have a 36px interior on
|
|
121
|
+
// the 60px collapsed rail, producing identical 36×36 hit-areas.
|
|
122
|
+
jsx("div", { className: cn(
|
|
123
|
+
// py-1 keeps the search row in the same vertical rhythm as the
|
|
124
|
+
// NavGroup's `space-y-1` between nav rows.
|
|
125
|
+
"py-1 transition-[padding] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]", isCollapsedView ? "px-3" : "px-2.5", className), ...props, children: isCollapsedView ? (
|
|
126
|
+
// `triggerClassName="block w-full"` makes the Tooltip's wrapping div
|
|
127
|
+
// a full-width block instead of its default `inline-block` — without
|
|
128
|
+
// this, the field collapses to icon-width and sits left-aligned,
|
|
129
|
+
// leaving empty space on the right of the rail. Same fix NavItem
|
|
130
|
+
// uses for its collapsed-mode tooltip wrapper.
|
|
131
|
+
jsx(Tooltip, { content: collapsedLabel, placement: tooltipPlacement, triggerClassName: "block w-full", children: field })) : (field) }));
|
|
132
|
+
});
|
|
133
|
+
SidebarSearch.displayName = "SidebarSearch";
|
|
134
|
+
|
|
135
|
+
export { SidebarSearch };
|
|
@@ -25,7 +25,7 @@ const SidebarToggle = React__default.forwardRef(({ expandIcon, collapseIcon, cla
|
|
|
25
25
|
const positionClasses = side === "left"
|
|
26
26
|
? "absolute right-0 translate-x-1/2 top-4 z-50"
|
|
27
27
|
: "absolute left-0 -translate-x-1/2 top-4 z-50";
|
|
28
|
-
return (jsx(Button, { ref: ref, iconOnly: true, variant: "ghost", className: cn("size-6 p-0 rounded-full border border-[var(--color-border)] bg-[var(--color-background)]/50 backdrop-blur-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-
|
|
28
|
+
return (jsx(Button, { ref: ref, iconOnly: true, variant: "ghost", className: cn("size-6 p-0 rounded-full border border-[var(--color-border)] bg-[var(--color-background)]/50 backdrop-blur-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] hover:shadow-md hover:bg-[var(--color-surface-hover)] opacity-100 transition-all duration-400", positionClasses, className), onClick: handleClick, "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar", title: collapsed ? "Expand sidebar" : "Collapse sidebar", ...buttonProps, children: jsx(motion.div, { initial: false, animate: { rotate: collapsed ? 180 : 0 }, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] }, className: "flex items-center justify-center", children: jsx(ChevronLeftIcon, { className: "size-3", strokeWidth: 2.5 }) }) }));
|
|
29
29
|
});
|
|
30
30
|
SidebarToggle.displayName = "SidebarToggle";
|
|
31
31
|
|
|
@@ -19,8 +19,8 @@ const SidebarUserProfile = React__default.forwardRef(({ name, email, avatar, sta
|
|
|
19
19
|
const { isCollapsedView } = useSidebarCollapsed();
|
|
20
20
|
// Strip drag/animation DOM handlers that collide with motion's prop types
|
|
21
21
|
const { onAnimationStart, onAnimationEnd, onDrag, onDragStart, onDragEnd, ...motionSafeProps } = props;
|
|
22
|
-
const avatarElement = (jsx(Avatar, { src: avatar, name: name,
|
|
23
|
-
const content = (jsxs(motion.div, { ref: ref, className: cn("flex w-full items-center rounded-[var(--radius-base)] cursor-pointer border border-transparent transition-[padding,gap,background-color,border-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] ", isCollapsedView ? "justify-center gap-0 px-1
|
|
22
|
+
const avatarElement = (jsx(Avatar, { src: avatar, name: name, status: status !== null && status !== void 0 ? status : "none", className: "size-9" }));
|
|
23
|
+
const content = (jsxs(motion.div, { ref: ref, className: cn("flex w-full items-center rounded-[var(--radius-base)] cursor-pointer border border-transparent transition-[padding,gap,background-color,border-color,color,box-shadow] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] ", isCollapsedView ? "justify-center gap-0 px-1" : "gap-2 ", className), role: "button", tabIndex: 0, onClick: onClick, onKeyDown: (e) => {
|
|
24
24
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
25
25
|
e.preventDefault();
|
|
26
26
|
e.currentTarget.click();
|
|
@@ -8,5 +8,7 @@ export { SidebarToggle } from "./SidebarToggle";
|
|
|
8
8
|
export { SidebarMobileTrigger } from "./SidebarMobileTrigger";
|
|
9
9
|
export { SidebarUserProfile } from "./SidebarUserProfile";
|
|
10
10
|
export { SidebarLogo } from "./SidebarLogo";
|
|
11
|
+
export { SidebarSearch } from "./SidebarSearch";
|
|
12
|
+
export { SidebarCard } from "./SidebarCard";
|
|
11
13
|
export { SidebarProvider, useSidebarContext } from "./SidebarContext";
|
|
12
|
-
export type { SidebarProps, SidebarHeaderProps, SidebarContentProps, SidebarFooterProps, SidebarNavProps, SidebarNavGroupProps, SidebarToggleProps, SidebarMobileTriggerProps, SidebarUserProfileProps, SidebarUserStatus, SidebarSide, SidebarVariant, SidebarDensity, SidebarContextValue, SidebarProviderProps, SidebarTheme, SidebarThemeOverrides, SidebarLogoProps, } from "./Sidebar.types";
|
|
14
|
+
export type { SidebarProps, SidebarHeaderProps, SidebarContentProps, SidebarFooterProps, SidebarNavProps, SidebarNavGroupProps, SidebarToggleProps, SidebarMobileTriggerProps, SidebarUserProfileProps, SidebarUserStatus, SidebarSide, SidebarVariant, SidebarDensity, SidebarContextValue, SidebarProviderProps, SidebarTheme, SidebarThemeOverrides, SidebarLogoProps, SidebarSearchProps, SidebarCardProps, SidebarCardTheme, SidebarCardThemeOverrides, } from "./Sidebar.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { motion } from 'motion/react';
|
|
4
4
|
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
@@ -18,7 +18,7 @@ import { tagVariants, tagLayoutTransition } from './Tag.animations.js';
|
|
|
18
18
|
* <Tag startContent={<CodeIcon className="size-4" />} onRemove={() => {}}>React</Tag>
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
const Tag = React__default.forwardRef(({ children, size = "md", removable = true, onRemove, avatar, startContent, disabled = false, className, theme: customTheme, ...props }, ref) => {
|
|
21
|
+
const Tag = React__default.forwardRef(({ children, size = "md", removable = true, onRemove, avatar, startContent, disabled = false, animated = true, className, theme: customTheme, ...props }, ref) => {
|
|
22
22
|
var _a, _b, _c;
|
|
23
23
|
// Merge default theme with custom theme overrides
|
|
24
24
|
const theme = {
|
|
@@ -47,14 +47,38 @@ const Tag = React__default.forwardRef(({ children, size = "md", removable = true
|
|
|
47
47
|
// Avatar takes precedence over startContent
|
|
48
48
|
const renderLeadingContent = () => {
|
|
49
49
|
if (avatar) {
|
|
50
|
-
return (jsx("span", {
|
|
50
|
+
return (jsx("span", {
|
|
51
|
+
// leading-[0] collapses the inline line-box strut: the Avatar's
|
|
52
|
+
// inner circle is inline-flex, so a non-zero line-height adds
|
|
53
|
+
// descender space below it and pins the circle to the top of a
|
|
54
|
+
// taller line box — the visible photo then renders ~1.75px high.
|
|
55
|
+
// Zeroing the line-height makes the 16px circle define the box exactly.
|
|
56
|
+
className: cn("inline-flex items-center justify-center shrink-0 overflow-hidden rounded-full leading-[0]", theme.avatarSizes[size]), children: jsx(Avatar, { src: avatar.src, name: avatar.name, fallback: avatar.fallback, initialsCount: avatar.initialsCount, size: "xs", className: "bg-[var(--color-surface-hover)] border border-[var(--color-border)]" }) }));
|
|
51
57
|
}
|
|
52
58
|
if (startContent) {
|
|
53
|
-
return (jsx("span", {
|
|
59
|
+
return (jsx("span", {
|
|
60
|
+
// leading-[0]: same line-box collapse as the avatar wrapper above,
|
|
61
|
+
// so inline startContent (icons/emoji) stays vertically centered.
|
|
62
|
+
className: cn("inline-flex items-center justify-center shrink-0 leading-[0]", theme.startContentSizes[size]), children: startContent }));
|
|
54
63
|
}
|
|
55
64
|
return null;
|
|
56
65
|
};
|
|
57
|
-
|
|
66
|
+
const content = (jsxs(Fragment, { children: [renderLeadingContent(), children, showRemoveButton && (jsx("button", { type: "button", onClick: handleRemove, className: theme.removeButtonStyle, "aria-label": `Remove ${typeof children === "string" ? children : "tag"}`, children: jsx(XMarkIcon, { className: theme.removeIconSizes[size] }) }))] }));
|
|
67
|
+
const sharedProps = {
|
|
68
|
+
ref,
|
|
69
|
+
className: cn(theme.baseStyle, theme.sizes[size], hasLeadingContent && "pl-1", showRemoveButton && "pr-0.5", disabled && theme.disabledStyle, className),
|
|
70
|
+
"data-size": size,
|
|
71
|
+
"data-disabled": disabled ? "true" : "false",
|
|
72
|
+
"data-removable": removable ? "true" : "false",
|
|
73
|
+
"data-has-avatar": avatar ? "true" : "false",
|
|
74
|
+
...props,
|
|
75
|
+
};
|
|
76
|
+
// Plain span when animation is opted out (e.g. inside a contentEditable host,
|
|
77
|
+
// where Framer-Motion's layout FLIP fights the caret on every keystroke).
|
|
78
|
+
if (!animated) {
|
|
79
|
+
return jsx("span", { ...sharedProps, children: content });
|
|
80
|
+
}
|
|
81
|
+
return (jsx(motion.span, { ...sharedProps, layout: true, transition: tagLayoutTransition, variants: tagVariants, exit: "exit", children: content }));
|
|
58
82
|
});
|
|
59
83
|
Tag.displayName = "Tag";
|
|
60
84
|
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
const tagTheme = {
|
|
2
|
-
baseStyle: "inline-flex items-center gap-1 font-medium rounded-full " +
|
|
3
|
-
"bg-[var(--color-
|
|
2
|
+
baseStyle: "inline-flex items-center gap-1.5 font-medium rounded-full " +
|
|
3
|
+
"bg-[var(--color-surface-raised)] border border-[var(--color-border)] " +
|
|
4
4
|
"text-[var(--color-text-primary)]",
|
|
5
5
|
sizes: {
|
|
6
|
-
sm: "text-xs px-2
|
|
7
|
-
md: "text-sm px-2
|
|
6
|
+
sm: "text-xs px-2 py-0.5",
|
|
7
|
+
md: "text-sm px-2 py-0.5",
|
|
8
8
|
},
|
|
9
|
+
// No left margin here: the avatar/icon's left inset is owned by the tag's
|
|
10
|
+
// `pl-1` (applied when there's leading content), not by a per-size `ml-*`.
|
|
11
|
+
// Stacking `ml-*` on top of that padding pushed the avatar too far from the
|
|
12
|
+
// left edge and produced a lopsided pill. The avatar-to-text gap is handled
|
|
13
|
+
// by the base `gap-1`, not by this margin.
|
|
9
14
|
avatarSizes: {
|
|
10
|
-
sm: "size-4
|
|
11
|
-
md: "size-5
|
|
15
|
+
sm: "size-4",
|
|
16
|
+
md: "size-5",
|
|
12
17
|
},
|
|
13
18
|
startContentSizes: {
|
|
14
|
-
sm: "
|
|
15
|
-
md: "
|
|
19
|
+
sm: "",
|
|
20
|
+
md: "",
|
|
16
21
|
},
|
|
17
22
|
disabledStyle: "opacity-50 cursor-not-allowed",
|
|
18
23
|
removeButtonStyle: "inline-flex items-center justify-center rounded-full p-1 " +
|
|
@@ -30,6 +30,13 @@ export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "o
|
|
|
30
30
|
startContent?: ReactNode;
|
|
31
31
|
/** Whether the tag is disabled */
|
|
32
32
|
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to render with motion (layout + enter/exit animation). Default true.
|
|
35
|
+
* Set `false` to render a plain `<span>` — required when a Tag lives inside a
|
|
36
|
+
* contentEditable host (e.g. Mention chips), where Framer-Motion's `layout`
|
|
37
|
+
* FLIP re-measurement fights the browser's caret/selection on every keystroke.
|
|
38
|
+
*/
|
|
39
|
+
animated?: boolean;
|
|
33
40
|
/** Additional class name for the tag */
|
|
34
41
|
className?: string;
|
|
35
42
|
/** Theme overrides */
|
|
@@ -115,7 +115,7 @@ const Tooltip = ({ content, children, placement = "top", delay = 300, disabled =
|
|
|
115
115
|
})
|
|
116
116
|
: children;
|
|
117
117
|
return (jsxs("div", { className: cn("relative inline-block", triggerClassName), ref: triggerRef, ...triggerHandlers, "aria-describedby": isVisible && id ? id : undefined, children: [childWithFocusHandlers, isClient &&
|
|
118
|
-
createPortal(jsx("div", { className: darkMode || isDarkMode ? "dark" : undefined, children: tooltipContent }), document.body)] }));
|
|
118
|
+
createPortal(jsx("div", { "data-flikkui-portal": "", className: darkMode || isDarkMode ? "dark" : undefined, children: tooltipContent }), document.body)] }));
|
|
119
119
|
};
|
|
120
120
|
// Set display name for dev tools and Storybook
|
|
121
121
|
Tooltip.displayName = "Tooltip";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const tooltipTheme = {
|
|
2
2
|
// Base style for the tooltip - using fixed positioning for portal rendering
|
|
3
|
-
baseStyle: "fixed z-[99] rounded-[var(--tooltip-radius)] py-1 px-2 text-xs text-[var(--color-text-primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 pointer-events-none bg-
|
|
4
|
-
"dark:bg-[var(--color-neutral-800)]/90 dark:outline-[var(--color-border)]/80 dark:border-[var(--color-border)]",
|
|
3
|
+
baseStyle: "fixed z-[99] rounded-[var(--tooltip-radius)] py-1 px-2 text-xs text-[var(--color-text-primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 pointer-events-none bg-[var(--color-surface-overlay)]/80 backdrop-blur-lg outline outline-[var(--color-border)] shadow-lg",
|
|
5
4
|
};
|
|
6
5
|
|
|
7
6
|
export { tooltipTheme };
|
|
@@ -10,11 +10,13 @@ export * from "./ButtonGroup";
|
|
|
10
10
|
export * from "./Calendar";
|
|
11
11
|
export * from "./Card";
|
|
12
12
|
export * from "./CardStack";
|
|
13
|
+
export * from "./HeroCard";
|
|
13
14
|
export * from "./Carousel";
|
|
14
15
|
export * from "./CommandPalette";
|
|
15
16
|
export * from "./Separator";
|
|
16
17
|
export * from "./Drawer";
|
|
17
18
|
export * from "./Dropdown";
|
|
19
|
+
export * from "./DotSeparator";
|
|
18
20
|
export * from "./Kbd";
|
|
19
21
|
export * from "./MenuItem";
|
|
20
22
|
export * from "./Link";
|
|
@@ -17,6 +17,8 @@ export { calendarAnimations } from './Calendar/Calendar.animations.js';
|
|
|
17
17
|
export { CalendarMini } from './Calendar/CalendarMini/CalendarMini.js';
|
|
18
18
|
export { Card } from './Card/Card.js';
|
|
19
19
|
export { CardStack } from './CardStack/CardStack.js';
|
|
20
|
+
export { HERO_CARD_DEFAULT_IMAGE, HeroCard } from './HeroCard/HeroCard.js';
|
|
21
|
+
export { heroCardTheme } from './HeroCard/HeroCard.theme.js';
|
|
20
22
|
export { Carousel } from './Carousel/Carousel.js';
|
|
21
23
|
export { CarouselBody } from './Carousel/CarouselBody.js';
|
|
22
24
|
export { CommandPalette } from './CommandPalette/CommandPalette.js';
|
|
@@ -32,6 +34,8 @@ export { DropdownItem } from './Dropdown/DropdownItem.js';
|
|
|
32
34
|
export { DropdownSection } from './Dropdown/DropdownSection.js';
|
|
33
35
|
export { DropdownSeparator } from './Dropdown/DropdownSeparator.js';
|
|
34
36
|
export { dropdownTheme } from './Dropdown/Dropdown.theme.js';
|
|
37
|
+
export { DotSeparator } from './DotSeparator/DotSeparator.js';
|
|
38
|
+
export { dotSeparatorTheme } from './DotSeparator/DotSeparator.theme.js';
|
|
35
39
|
export { Kbd } from './Kbd/Kbd.js';
|
|
36
40
|
export { MenuItem } from './MenuItem/MenuItem.js';
|
|
37
41
|
export { menuItemTheme } from './MenuItem/MenuItem.theme.js';
|
|
@@ -100,6 +104,8 @@ export { SidebarToggle } from './Sidebar/SidebarToggle.js';
|
|
|
100
104
|
export { SidebarMobileTrigger } from './Sidebar/SidebarMobileTrigger.js';
|
|
101
105
|
export { SidebarUserProfile } from './Sidebar/SidebarUserProfile.js';
|
|
102
106
|
export { SidebarLogo } from './Sidebar/SidebarLogo.js';
|
|
107
|
+
export { SidebarSearch } from './Sidebar/SidebarSearch.js';
|
|
108
|
+
export { SidebarCard } from './Sidebar/SidebarCard.js';
|
|
103
109
|
export { SidebarProvider, useSidebarContext } from './Sidebar/SidebarContext.js';
|
|
104
110
|
export { OfflineIndicator } from './OfflineIndicator/OfflineIndicator.js';
|
|
105
111
|
export { offlineIndicatorTheme } from './OfflineIndicator/OfflineIndicator.theme.js';
|
|
@@ -17,19 +17,35 @@ function useDescriptionListContext() {
|
|
|
17
17
|
// ──────────────────────────────────────────────
|
|
18
18
|
// DescriptionList (container)
|
|
19
19
|
// ──────────────────────────────────────────────
|
|
20
|
-
const DescriptionListRoot = React__default.forwardRef(({ className, variant = "horizontal", theme: customTheme, children, ...props }, ref) => {
|
|
21
|
-
const theme = useMemo(() => ({
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const DescriptionListRoot = React__default.forwardRef(({ className, variant = "horizontal", padding = "flush", items, theme: customTheme, children, ...props }, ref) => {
|
|
21
|
+
const theme = useMemo(() => ({
|
|
22
|
+
...descriptionListTheme,
|
|
23
|
+
...customTheme,
|
|
24
|
+
paddingStyles: { ...descriptionListTheme.paddingStyles, ...customTheme === null || customTheme === void 0 ? void 0 : customTheme.paddingStyles },
|
|
25
|
+
}), [customTheme]);
|
|
26
|
+
const contextValue = useMemo(() => ({ variant, padding, theme }), [variant, padding, theme]);
|
|
27
|
+
if (process.env.NODE_ENV !== "production" &&
|
|
28
|
+
items &&
|
|
29
|
+
React__default.Children.count(children) > 0) {
|
|
30
|
+
console.warn("[DescriptionList]: both `items` and children were provided — `items` takes precedence and children are ignored.");
|
|
31
|
+
}
|
|
32
|
+
// Data-driven path maps to the same compound primitive as composition.
|
|
33
|
+
const content = items
|
|
34
|
+
? items.map((item, i) => {
|
|
35
|
+
var _a;
|
|
36
|
+
return (jsx(DescriptionListItem, { label: item.label, value: item.value, className: item.className }, (_a = item.key) !== null && _a !== void 0 ? _a : i));
|
|
37
|
+
})
|
|
38
|
+
: children;
|
|
39
|
+
return (jsx(DescriptionListContext.Provider, { value: contextValue, children: jsx("dl", { ref: ref, className: cn(theme.baseStyle, className), ...props, children: content }) }));
|
|
24
40
|
});
|
|
25
41
|
DescriptionListRoot.displayName = "DescriptionList";
|
|
26
42
|
// ──────────────────────────────────────────────
|
|
27
43
|
// DescriptionList.Item
|
|
28
44
|
// ──────────────────────────────────────────────
|
|
29
|
-
const DescriptionListItem = React__default.forwardRef(({
|
|
30
|
-
const { variant, theme } = useDescriptionListContext();
|
|
45
|
+
const DescriptionListItem = React__default.forwardRef(({ label, value, className, ...props }, ref) => {
|
|
46
|
+
const { variant, padding, theme } = useDescriptionListContext();
|
|
31
47
|
const isHorizontal = variant === "horizontal";
|
|
32
|
-
return (jsxs("div", { ref: ref, className: cn(theme.itemStyle, isHorizontal && "sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0", className), ...props, children: [jsx("dt", { className: theme.
|
|
48
|
+
return (jsxs("div", { ref: ref, className: cn(theme.itemStyle, isHorizontal && "sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0", theme.paddingStyles[padding], className), ...props, children: [jsx("dt", { className: theme.labelStyle, children: label }), jsx("dd", { className: cn(theme.valueStyle, isHorizontal && "sm:col-span-2 sm:mt-0"), children: value })] }));
|
|
33
49
|
});
|
|
34
50
|
DescriptionListItem.displayName = "DescriptionList.Item";
|
|
35
51
|
// ──────────────────────────────────────────────
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
const descriptionListTheme = {
|
|
2
2
|
baseStyle: "divide-y divide-[var(--color-border)] min-w-0",
|
|
3
|
-
itemStyle: "
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
itemStyle: "py-2.5",
|
|
4
|
+
// Edge-padding modes (mirrors Table's `flush`): `flush` (default) zeroes the item
|
|
5
|
+
// side padding so values sit flush with the container edges (e.g. inside a Card);
|
|
6
|
+
// `default` adds horizontal padding for standalone use.
|
|
7
|
+
paddingStyles: {
|
|
8
|
+
default: "px-4",
|
|
9
|
+
flush: "px-0",
|
|
10
|
+
},
|
|
11
|
+
labelStyle: "text-sm font-medium text-[var(--color-text-primary)]",
|
|
12
|
+
valueStyle: "text-sm mt-0.5 text-[var(--color-text-secondary)]",
|
|
6
13
|
};
|
|
7
14
|
|
|
8
15
|
export { descriptionListTheme };
|