@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.11
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/components/ai/ApprovalCard/ApprovalCard.js +3 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.animations.d.ts +25 -0
- package/dist/components/ai/PromptInput/PromptInput.animations.js +61 -0
- package/dist/components/ai/PromptInput/PromptInput.js +264 -31
- package/dist/components/ai/PromptInput/PromptInput.theme.js +6 -1
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +68 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.d.ts +10 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.js +258 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.types.d.ts +17 -0
- package/dist/components/ai/PromptInput/index.d.ts +1 -0
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +1 -1
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +51 -27
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +4 -5
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +5 -12
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +20 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +2 -2
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +2 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +27 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +134 -0
- package/dist/components/ai/StreamingResponse/index.d.ts +3 -1
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +6 -6
- package/dist/components/ai/index.js +1 -0
- package/dist/components/charts/ActivityRings/ActivityRings.js +1 -1
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +2 -2
- package/dist/components/charts/BarChart/BarChart.js +3 -3
- package/dist/components/charts/ChartContainer.js +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +2 -2
- package/dist/components/charts/DonutChart/DonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/DonutChart.types.d.ts +1 -2
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.types.d.ts +1 -2
- package/dist/components/charts/FunnelChart/FunnelChart.js +7 -7
- package/dist/components/charts/Heatmap/Heatmap.theme.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapCell.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapLegend.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +2 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +1 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +2 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +2 -2
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +4 -4
- package/dist/components/core/Accordion/Accordion.animations.d.ts +6 -1
- package/dist/components/core/Accordion/Accordion.animations.js +15 -1
- package/dist/components/core/Accordion/Accordion.theme.js +5 -5
- package/dist/components/core/Accordion/Accordion.types.d.ts +25 -0
- package/dist/components/core/Accordion/AccordionContent.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +11 -6
- package/dist/components/core/Alert/Alert.js +3 -2
- package/dist/components/core/Alert/Alert.theme.js +4 -8
- package/dist/components/core/Alert/Alert.types.d.ts +4 -3
- package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/core/Avatar/Avatar.theme.js +5 -5
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.d.ts +1 -1
- package/dist/components/core/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +24 -20
- package/dist/components/core/Badge/Badge.types.d.ts +10 -5
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/core/Button/Button.d.ts +1 -1
- package/dist/components/core/Button/Button.js +21 -18
- package/dist/components/core/Button/Button.ripple.d.ts +5 -1
- package/dist/components/core/Button/Button.ripple.js +27 -17
- package/dist/components/core/Button/Button.theme.d.ts +1 -2
- package/dist/components/core/Button/Button.theme.js +46 -41
- package/dist/components/core/Button/Button.types.d.ts +3 -3
- package/dist/components/core/Button/index.d.ts +2 -0
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +1 -1
- package/dist/components/core/Calendar/Calendar.js +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +9 -9
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +1 -1
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +6 -7
- package/dist/components/core/Card/Card.theme.js +2 -2
- package/dist/components/core/Card/Card.types.d.ts +7 -27
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- package/dist/components/core/Card/CardTitle.d.ts +1 -1
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +6 -6
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +3 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +3 -3
- package/dist/components/core/Drawer/Drawer.d.ts +13 -1
- package/dist/components/core/Drawer/Drawer.js +23 -10
- package/dist/components/core/Drawer/Drawer.theme.d.ts +2 -0
- package/dist/components/core/Drawer/Drawer.theme.js +15 -13
- package/dist/components/core/Drawer/Drawer.types.d.ts +26 -9
- package/dist/components/core/Drawer/DrawerContent.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +15 -0
- package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
- package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerTitle.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.theme.js +1 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +1 -0
- package/dist/components/core/Empty/Empty.js +2 -2
- package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
- package/dist/components/core/Empty/Empty.theme.js +3 -3
- package/dist/components/core/Empty/Empty.types.d.ts +2 -2
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.types.d.ts +2 -2
- package/dist/components/core/Loader/Loader.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +9 -11
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +3 -2
- package/dist/components/core/Message/Message.js +30 -24
- package/dist/components/core/Message/Message.theme.d.ts +1 -1
- package/dist/components/core/Message/Message.theme.js +22 -24
- package/dist/components/core/Message/Message.types.d.ts +0 -7
- package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
- package/dist/components/core/Message/MessageList.animations.js +32 -0
- package/dist/components/core/Message/MessageList.d.ts +5 -0
- package/dist/components/core/Message/MessageList.js +78 -0
- package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
- package/dist/components/core/Message/MessageList.theme.js +6 -0
- package/dist/components/core/Message/MessageList.types.d.ts +32 -0
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +2 -2
- package/dist/components/core/Modal/Modal.js +5 -5
- package/dist/components/core/Modal/Modal.theme.js +6 -6
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- package/dist/components/core/Modal/ModalHeader.js +1 -0
- package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
- package/dist/components/core/Modal/ModalSubtitle.js +11 -0
- package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
- package/dist/components/core/NavItem/NavItem.js +1 -1
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +3 -3
- package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
- package/dist/components/core/PageHeading/PageHeading.js +28 -0
- package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
- package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
- package/dist/components/core/PageHeading/index.d.ts +2 -0
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.theme.js +3 -3
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Popover/Popover.types.d.ts +6 -0
- package/dist/components/core/Popover/PopoverContent.js +8 -2
- package/dist/components/core/Progress/Progress.theme.js +10 -7
- package/dist/components/core/Progress/Progress.types.d.ts +2 -1
- package/dist/components/core/Segmented/Segmented.theme.js +5 -5
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- package/dist/components/core/Sidebar/SidebarNavGroup.js +1 -1
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
- package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
- package/dist/components/core/SocialIcon/index.d.ts +2 -0
- package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
- package/dist/components/core/SocialIcon/platforms.js +234 -0
- package/dist/components/core/Spinner/Spinner.theme.js +3 -5
- package/dist/components/core/Spinner/Spinner.types.d.ts +2 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tag/Tag.d.ts +2 -2
- package/dist/components/core/Tag/Tag.js +21 -4
- package/dist/components/core/Tag/Tag.theme.js +12 -4
- package/dist/components/core/Tag/Tag.types.d.ts +24 -1
- package/dist/components/core/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +4 -4
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +10 -19
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +8 -0
- package/dist/components/{core → data-display}/Feed/Feed.js +3 -3
- package/dist/components/{core → data-display}/Feed/Feed.theme.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
- package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.js +29 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
- package/dist/components/data-display/GanttChart/index.d.ts +3 -0
- package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
- package/dist/components/{core → data-display}/KPI/KPI.theme.js +12 -12
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +6 -5
- package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
- package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
- package/dist/components/{core → data-display}/Metric/Metric.theme.js +17 -13
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +8 -7
- package/dist/components/{core → data-display}/Table/Table.theme.js +4 -4
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableActionsMenu.js +1 -1
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +6 -5
- package/dist/components/{core → data-display}/Table/TableFilter.js +6 -6
- package/dist/components/{core → data-display}/Table/TableHeader.js +1 -1
- package/dist/components/data-display/Table/TablePagination.js +25 -0
- package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
- package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +3 -3
- package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +2 -2
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -0
- package/dist/components/effects/3d/index.d.ts +6 -0
- package/dist/components/effects/3d/index.js +3 -0
- package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
- package/dist/components/effects/Aurora/Aurora.js +119 -0
- package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
- package/dist/components/effects/Aurora/index.d.ts +2 -0
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +3 -1
- package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +5 -4
- package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
- package/dist/components/effects/DotPattern/DotPattern.js +65 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
- package/dist/components/effects/DotPattern/index.d.ts +2 -0
- package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
- package/dist/components/effects/GridPattern/GridPattern.js +64 -0
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
- package/dist/components/effects/GridPattern/index.d.ts +2 -0
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
- package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
- package/dist/components/effects/MagneticElement/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
- package/dist/components/effects/MorphingText/MorphingText.js +91 -0
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
- package/dist/components/effects/MorphingText/index.d.ts +2 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
- package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
- package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
- package/dist/components/effects/Particles/Particles.d.ts +22 -0
- package/dist/components/effects/Particles/Particles.js +33 -0
- package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
- package/dist/components/effects/Particles/Particles.scene.js +284 -0
- package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
- package/dist/components/effects/Particles/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
- package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
- package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
- package/dist/components/effects/Spotlight/Spotlight.js +112 -0
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
- package/dist/components/effects/Spotlight/index.d.ts +2 -0
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
- package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
- package/dist/components/effects/StickyScroll/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +22 -4
- package/dist/components/effects/index.js +11 -2
- package/dist/components/forms/Checkbox/Checkbox.d.ts +3 -4
- package/dist/components/forms/Checkbox/Checkbox.js +36 -12
- package/dist/components/forms/Checkbox/Checkbox.theme.js +9 -5
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +28 -2
- package/dist/components/forms/Checkbox/CheckboxContext.d.ts +14 -0
- package/dist/components/forms/Checkbox/CheckboxContext.js +12 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.js +40 -0
- package/dist/components/forms/Checkbox/index.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +7 -7
- package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
- package/dist/components/forms/CronInput/CronInput.js +107 -0
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
- package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
- package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
- package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
- package/dist/components/forms/CronInput/index.d.ts +4 -0
- package/dist/components/forms/DatePicker/DatePicker.theme.js +3 -3
- package/dist/components/forms/DatePicker/DatePickerContent.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +80 -2
- package/dist/components/forms/FileUpload/FileUpload.theme.js +4 -4
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.d.ts +1 -1
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +3 -2
- package/dist/components/forms/InputOTP/InputOTP.theme.js +2 -2
- package/dist/components/forms/InputTag/InputTag.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +607 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +55 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +151 -0
- package/dist/components/forms/Mention/Mention.utils.d.ts +42 -0
- package/dist/components/forms/Mention/Mention.utils.js +285 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.d.ts +3 -4
- package/dist/components/forms/Radio/Radio.js +25 -12
- package/dist/components/forms/Radio/Radio.theme.js +34 -5
- package/dist/components/forms/Radio/Radio.types.d.ts +30 -4
- package/dist/components/forms/Radio/RadioContext.d.ts +14 -0
- package/dist/components/forms/Radio/RadioContext.js +12 -0
- package/dist/components/forms/Radio/RadioGroup.d.ts +3 -0
- package/dist/components/forms/Radio/RadioGroup.js +36 -0
- package/dist/components/forms/Radio/index.d.ts +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +1 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
- package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
- package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +33 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
- package/dist/components/forms/SelectableCard/index.d.ts +3 -0
- package/dist/components/forms/Signature/Signature.theme.js +1 -1
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
- package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
- package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
- package/dist/components/forms/TransferList/TransferList.js +199 -0
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
- package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
- package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
- package/dist/components/forms/TransferList/index.d.ts +3 -0
- package/dist/components/forms/forms.theme.js +6 -6
- package/dist/components/forms/index.d.ts +15 -2
- package/dist/components/forms/index.js +87 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
- package/dist/components/layout/FormLayout/FormLayout.js +22 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
- package/dist/components/layout/FormLayout/index.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
- package/dist/components/layout/PageLayout/PageLayout.js +33 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
- package/dist/components/layout/PageLayout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/hooks/useSelectPortal.d.ts +4 -2
- package/dist/hooks/useSelectPortal.js +139 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.js +206 -167
- package/dist/styles.css +1 -1
- package/dist/utils/colorUtils.d.ts +23 -0
- package/dist/utils/colorUtils.js +45 -0
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +38 -26
- package/src/global.scss +673 -0
- package/src/styles/theme.css +378 -0
- package/src/theme-plugin.css +11 -0
- package/dist/components/core/Button/Button.animations.d.ts +0 -5
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- package/dist/components/core/DescriptionList/DescriptionList.theme.js +0 -8
- package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
- package/dist/components/core/Modal/ModalDescription.js +0 -11
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
- package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
- package/dist/components/core/Table/TablePagination.js +0 -25
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
- /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/index.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useMemo } from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { cardTheme } from './Card.theme.js';
|
|
5
5
|
import { CardHeader } from './CardHeader.js';
|
|
6
6
|
import { CardTitle } from './CardTitle.js';
|
|
7
|
-
import {
|
|
7
|
+
import { CardSubtitle } from './CardSubtitle.js';
|
|
8
8
|
import { CardContent } from './CardContent.js';
|
|
9
9
|
import { CardFooter } from './CardFooter.js';
|
|
10
10
|
|
|
11
|
-
const CardRoot = React__default.forwardRef(({ children, className, theme: customTheme = {},
|
|
11
|
+
const CardRoot = React__default.forwardRef(({ children, className, theme: customTheme = {}, darkMode = false, ...props }, ref) => {
|
|
12
12
|
const theme = useMemo(() => ({
|
|
13
13
|
...cardTheme,
|
|
14
14
|
...customTheme,
|
|
15
15
|
}), [customTheme]);
|
|
16
|
-
|
|
17
|
-
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, darkMode && "dark", className), ...props, children: [hasHeader && (jsxs("div", { className: theme.headerStyle, children: [title && jsx("div", { className: theme.titleStyle, children: title }), description && jsx("div", { className: theme.descriptionStyle, children: description })] })), hasHeader ? (jsx("div", { className: theme.contentStyle, children: children })) : (children), footer && jsx("div", { className: theme.footerStyle, children: footer })] }));
|
|
16
|
+
return (jsx("div", { ref: ref, className: cn(theme.baseStyle, darkMode && "dark", className), ...props, children: children }));
|
|
18
17
|
});
|
|
19
18
|
CardRoot.displayName = 'Card';
|
|
20
19
|
// Create compound component with proper typing
|
|
21
20
|
const Card = Object.assign(CardRoot, {
|
|
22
21
|
Header: CardHeader,
|
|
23
22
|
Title: CardTitle,
|
|
24
|
-
|
|
23
|
+
Subtitle: CardSubtitle,
|
|
25
24
|
Content: CardContent,
|
|
26
25
|
Footer: CardFooter,
|
|
27
26
|
});
|
|
28
27
|
|
|
29
|
-
export { Card, CardContent,
|
|
28
|
+
export { Card, CardContent, CardFooter, CardHeader, CardSubtitle, CardTitle };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const cardTheme = {
|
|
2
2
|
baseStyle: "rounded-[var(--card-radius)] overflow-hidden bg-white border border-[var(--color-border)] shadow-xs dark:bg-[var(--color-background-secondary)]",
|
|
3
3
|
headerStyle: "flex flex-col space-y-1.5 p-6",
|
|
4
|
-
titleStyle: "text-
|
|
5
|
-
|
|
4
|
+
titleStyle: "text-lg font-semibold leading-none text-[var(--color-text-primary)]",
|
|
5
|
+
subtitleStyle: "text-sm text-[var(--color-text-muted)]",
|
|
6
6
|
contentStyle: "p-6 pt-0",
|
|
7
7
|
footerStyle: "flex items-center p-6 pt-0",
|
|
8
8
|
};
|
|
@@ -3,7 +3,7 @@ export interface CardTheme {
|
|
|
3
3
|
baseStyle: string;
|
|
4
4
|
headerStyle: string;
|
|
5
5
|
titleStyle: string;
|
|
6
|
-
|
|
6
|
+
subtitleStyle: string;
|
|
7
7
|
contentStyle: string;
|
|
8
8
|
footerStyle: string;
|
|
9
9
|
}
|
|
@@ -11,11 +11,11 @@ export interface CardThemeOverrides {
|
|
|
11
11
|
baseStyle?: string;
|
|
12
12
|
headerStyle?: string;
|
|
13
13
|
titleStyle?: string;
|
|
14
|
-
|
|
14
|
+
subtitleStyle?: string;
|
|
15
15
|
contentStyle?: string;
|
|
16
16
|
footerStyle?: string;
|
|
17
17
|
}
|
|
18
|
-
export interface CardProps extends
|
|
18
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
19
|
/**
|
|
20
20
|
* The content to be displayed inside the card
|
|
21
21
|
*/
|
|
@@ -28,21 +28,6 @@ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>
|
|
|
28
28
|
* Component-level theme overrides
|
|
29
29
|
*/
|
|
30
30
|
theme?: CardThemeOverrides;
|
|
31
|
-
/**
|
|
32
|
-
* Card title - auto-generates header when provided
|
|
33
|
-
* Use this for simple cards instead of Card.Header/Card.Title
|
|
34
|
-
*/
|
|
35
|
-
title?: ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* Card description - displayed below title in auto-generated header
|
|
38
|
-
* Use this for simple cards instead of Card.Header/Card.Description
|
|
39
|
-
*/
|
|
40
|
-
description?: ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Card footer content - auto-generates footer when provided
|
|
43
|
-
* Use this for simple cards instead of Card.Footer
|
|
44
|
-
*/
|
|
45
|
-
footer?: ReactNode;
|
|
46
31
|
/**
|
|
47
32
|
* Force dark mode styling for the component. Use when placing the component
|
|
48
33
|
* on a dark background while the page is in light mode. This applies the
|
|
@@ -54,28 +39,23 @@ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>
|
|
|
54
39
|
}
|
|
55
40
|
export interface CardComponent extends ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>> {
|
|
56
41
|
Header: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
57
|
-
Title: ForwardRefExoticComponent<CardTitleProps & RefAttributes<
|
|
58
|
-
|
|
42
|
+
Title: ForwardRefExoticComponent<CardTitleProps & RefAttributes<HTMLDivElement>>;
|
|
43
|
+
Subtitle: ForwardRefExoticComponent<CardSubtitleProps & RefAttributes<HTMLDivElement>>;
|
|
59
44
|
Content: ForwardRefExoticComponent<CardContentProps & RefAttributes<HTMLDivElement>>;
|
|
60
45
|
Footer: ForwardRefExoticComponent<CardFooterProps & RefAttributes<HTMLDivElement>>;
|
|
61
46
|
}
|
|
62
47
|
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
-
children: ReactNode;
|
|
64
48
|
className?: string;
|
|
65
49
|
}
|
|
66
50
|
export interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
67
|
-
children: ReactNode;
|
|
68
51
|
className?: string;
|
|
69
52
|
}
|
|
70
53
|
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
71
|
-
children: ReactNode;
|
|
72
54
|
className?: string;
|
|
73
55
|
}
|
|
74
|
-
export interface CardTitleProps extends HTMLAttributes<
|
|
75
|
-
children: ReactNode;
|
|
56
|
+
export interface CardTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
76
57
|
className?: string;
|
|
77
58
|
}
|
|
78
|
-
export interface
|
|
79
|
-
children: ReactNode;
|
|
59
|
+
export interface CardSubtitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
80
60
|
className?: string;
|
|
81
61
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { cardTheme } from './Card.theme.js';
|
|
5
|
+
|
|
6
|
+
const CardSubtitle = React__default.forwardRef(({ children, className, ...props }, ref) => {
|
|
7
|
+
return (jsx("div", { ref: ref, className: cn(cardTheme.subtitleStyle, className), ...props, children: children }));
|
|
8
|
+
});
|
|
9
|
+
CardSubtitle.displayName = 'CardSubtitle';
|
|
10
|
+
|
|
11
|
+
export { CardSubtitle };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardTitleProps } from './Card.types';
|
|
3
|
-
export declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<
|
|
3
|
+
export declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Card, CardHeader, CardTitle,
|
|
2
|
-
export type { CardProps, CardHeaderProps, CardTitleProps,
|
|
1
|
+
export { Card, CardHeader, CardTitle, CardSubtitle, CardContent, CardFooter } from './Card';
|
|
2
|
+
export type { CardProps, CardHeaderProps, CardTitleProps, CardSubtitleProps, CardContentProps, CardFooterProps, CardTheme, CardThemeOverrides } from './Card.types';
|
|
@@ -36,7 +36,7 @@ export interface CommandItemProps {
|
|
|
36
36
|
* command={{
|
|
37
37
|
* id: 'user-profile',
|
|
38
38
|
* label: 'John Doe',
|
|
39
|
-
*
|
|
39
|
+
* subtitle: 'View profile',
|
|
40
40
|
* contentStart: <Avatar src="..." />,
|
|
41
41
|
* contentEnd: <Badge>Admin</Badge>,
|
|
42
42
|
* onSelect: () => navigate('/profile')
|
|
@@ -88,7 +88,7 @@ const Shortcut = ({ keys }) => {
|
|
|
88
88
|
* command={{
|
|
89
89
|
* id: 'user-profile',
|
|
90
90
|
* label: 'John Doe',
|
|
91
|
-
*
|
|
91
|
+
* subtitle: 'View profile',
|
|
92
92
|
* contentStart: <Avatar src="..." />,
|
|
93
93
|
* contentEnd: <Badge>Admin</Badge>,
|
|
94
94
|
* onSelect: () => navigate('/profile')
|
|
@@ -126,7 +126,7 @@ const CommandItem = ({ command, index, isHighlighted, contentStart, contentEnd,
|
|
|
126
126
|
}
|
|
127
127
|
return null;
|
|
128
128
|
};
|
|
129
|
-
return (jsxs("div", { "data-command-index": index, "data-highlighted": isHighlighted, "data-disabled": command.disabled || false, className: cn(theme.commandItem, className), onClick: handleClick, onMouseEnter: handleMouseEnter, children: [finalContentStart && (jsx("div", { className: "flex-shrink-0", children: finalContentStart })), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-
|
|
129
|
+
return (jsxs("div", { "data-command-index": index, "data-highlighted": isHighlighted, "data-disabled": command.disabled || false, className: cn(theme.commandItem, className), onClick: handleClick, onMouseEnter: handleMouseEnter, children: [finalContentStart && (jsx("div", { className: "flex-shrink-0", children: finalContentStart })), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("div", { className: "text-base truncate", children: command.label }), command.subtitle && (jsx("div", { className: "text-base opacity-70 truncate mt-0", children: command.subtitle }))] }), renderContentEnd()] }));
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
export { CommandItem };
|
|
@@ -14,9 +14,9 @@ const defaultFilterFunction = (command, searchValue) => {
|
|
|
14
14
|
var _a, _b;
|
|
15
15
|
const search = searchValue.toLowerCase();
|
|
16
16
|
const labelMatch = command.label.toLowerCase().includes(search);
|
|
17
|
-
const
|
|
17
|
+
const subtitleMatch = (_a = command.subtitle) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(search);
|
|
18
18
|
const keywordsMatch = (_b = command.keywords) === null || _b === void 0 ? void 0 : _b.some((keyword) => keyword.toLowerCase().includes(search));
|
|
19
|
-
return labelMatch ||
|
|
19
|
+
return labelMatch || subtitleMatch || keywordsMatch || false;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Check if commands array is grouped
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
const commandPaletteTheme = {
|
|
2
2
|
overlay: "fixed inset-0 bg-[var(--overlay-bg)] backdrop-blur-[var(--overlay-blur)] z-50 " +
|
|
3
|
-
"flex items-start justify-center pt-[10vh] px-4",
|
|
4
|
-
container: "relative w-full max-h-[calc(100vh-2rem)]
|
|
3
|
+
"flex items-start justify-center pt-[min(10vh,4rem)] px-4",
|
|
4
|
+
container: "relative w-full max-h-[calc(100vh-2rem)] max-w-lg " +
|
|
5
5
|
"bg-[var(--color-background)] rounded-[var(--modal-radius)] shadow-2xl shadow-black/30 " +
|
|
6
6
|
"border border-[var(--color-border)] ring-4 ring-[var(--color-background)]/20 " +
|
|
7
7
|
"flex flex-col my-4 min-h-0 overflow-hidden " +
|
|
8
8
|
// Dark mode
|
|
9
9
|
"dark:ring-black/30",
|
|
10
10
|
searchWrapper: "border-b border-[var(--color-border)] px-4 py-3 " + "",
|
|
11
|
-
searchInput: "w-full px-0 py-0 text-
|
|
11
|
+
searchInput: "w-full px-0 py-0 text-base bg-transparent border-none outline-none " +
|
|
12
12
|
"text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] " +
|
|
13
13
|
"focus:outline-none focus:ring-0 " +
|
|
14
14
|
// Dark mode
|
|
15
15
|
"dark:text-[var(--color-neutral-200)] dark:placeholder:text-[var(--color-neutral-500)]",
|
|
16
|
-
groupLabel: "px-4 py-1 text-
|
|
16
|
+
groupLabel: "px-4 py-1 text-sm font-semibold text-[var(--color-text-muted)]/50 uppercase " +
|
|
17
17
|
"dark:text-[var(--color-neutral-500)]",
|
|
18
18
|
commandItem: "flex items-center gap-3 px-4 py-2 rounded-[var(--radius-base)] cursor-pointer transition-colors " +
|
|
19
19
|
"hover:bg-[var(--color-primary)] " +
|
|
20
20
|
"data-[highlighted=true]:bg-[var(--color-primary)] data-[highlighted=true]:hover:bg-[var(--color-primary)] " +
|
|
21
|
-
"data-[highlighted=true]:text-
|
|
21
|
+
"data-[highlighted=true]:text-[var(--color-primary-contrast)] " +
|
|
22
22
|
"data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:hover:bg-transparent " +
|
|
23
23
|
// Dark mode - adjust hover state
|
|
24
24
|
"dark:text-[var(--color-neutral-200)] dark:hover:bg-[var(--color-primary-600)] " +
|
|
25
25
|
"dark:data-[highlighted=true]:bg-[var(--color-primary-600)]",
|
|
26
|
-
emptyState: "px-4 py-12 text-center text-
|
|
26
|
+
emptyState: "px-4 py-12 text-center text-base text-[var(--color-text-muted)] " +
|
|
27
27
|
"dark:text-[var(--color-neutral-500)]",
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -7,8 +7,8 @@ export interface CommandItem {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** Display label for the command */
|
|
9
9
|
label: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/** Subtitle for the command */
|
|
11
|
+
subtitle?: string;
|
|
12
12
|
/** Content to display at the start (icon, avatar, etc.) */
|
|
13
13
|
contentStart?: React.ReactNode;
|
|
14
14
|
/** Content to display at the end (keyboard shortcuts, badges, etc.) */
|
|
@@ -13,10 +13,10 @@ const contextMenuTheme = {
|
|
|
13
13
|
// Submenu trigger - based on Dropdown item style with chevron space
|
|
14
14
|
subTriggerStyle: `${dropdownTheme.itemBaseStyle} pr-8 data-[state=open]:bg-[var(--color-background-tertiary)] ` +
|
|
15
15
|
"dark:data-[state=open]:bg-[var(--color-neutral-700)]",
|
|
16
|
-
// Submenu content -
|
|
16
|
+
// Submenu content - matches main dropdown menu style
|
|
17
17
|
subContentStyle: "min-w-[180px] max-h-[400px] overflow-y-auto rounded-[var(--dropdown-radius)] border border-[var(--color-border)] " +
|
|
18
|
-
"bg-[var(--color-background
|
|
19
|
-
"dark:bg-[var(--color-
|
|
18
|
+
"bg-[var(--color-background)] shadow-real-xl flex flex-col p-1 focus:outline-none " +
|
|
19
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
20
20
|
// Separator - horizontal divider
|
|
21
21
|
separatorStyle: "h-px bg-[var(--color-border)] my-1 -mx-1 " +
|
|
22
22
|
"dark:bg-[var(--color-neutral-700)]",
|
|
@@ -42,7 +42,7 @@ export interface ContextMenuItemProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
42
42
|
onSelect?: () => void;
|
|
43
43
|
startContent?: ReactNode;
|
|
44
44
|
endContent?: ReactNode;
|
|
45
|
-
|
|
45
|
+
subtitle?: string;
|
|
46
46
|
}
|
|
47
47
|
export interface ContextMenuSubProps {
|
|
48
48
|
children: ReactNode;
|
|
@@ -9,7 +9,7 @@ import { MenuItem } from '../MenuItem/MenuItem.js';
|
|
|
9
9
|
* ContextMenuItem - Individual menu item with optional check indicator.
|
|
10
10
|
* Built on shared MenuItem, adds checked state and ContextMenu context integration.
|
|
11
11
|
*/
|
|
12
|
-
const ContextMenuItem = React__default.forwardRef(({ children, className, checked = false, disabled = false, isDanger = false, shortcut, onSelect, startContent, endContent,
|
|
12
|
+
const ContextMenuItem = React__default.forwardRef(({ children, className, checked = false, disabled = false, isDanger = false, shortcut, onSelect, startContent, endContent, subtitle, ...props }, ref) => {
|
|
13
13
|
const { onOpenChange, theme } = useContextMenuContext();
|
|
14
14
|
const handleActivate = useCallback(() => {
|
|
15
15
|
if (disabled)
|
|
@@ -22,8 +22,8 @@ const ContextMenuItem = React__default.forwardRef(({ children, className, checke
|
|
|
22
22
|
const resolvedStartContent = hasPrefix ? (jsxs(Fragment, { children: [checked && (jsx(CheckIcon, { className: theme.itemCheckedStyle, "aria-hidden": "true" })), startContent] })) : undefined;
|
|
23
23
|
// Build end content: user's endContent OR shortcut display
|
|
24
24
|
const resolvedEndContent = endContent ||
|
|
25
|
-
(shortcut ? (jsx("span", { className: "text-
|
|
26
|
-
return (jsx(MenuItem, { ref: ref, role: "menuitem", disabled: disabled, isDanger: isDanger, startContent: resolvedStartContent, endContent: resolvedEndContent,
|
|
25
|
+
(shortcut ? (jsx("span", { className: "text-sm text-[var(--color-text-muted)] font-mono", children: shortcut })) : undefined);
|
|
26
|
+
return (jsx(MenuItem, { ref: ref, role: "menuitem", disabled: disabled, isDanger: isDanger, startContent: resolvedStartContent, endContent: resolvedEndContent, subtitle: subtitle, onActivate: handleActivate, "data-checked": checked, "aria-checked": checked ? "true" : undefined, className: cn(checked && "pl-8", className), theme: {
|
|
27
27
|
baseStyle: theme.itemStyle,
|
|
28
28
|
dangerStyle: theme.itemDangerStyle,
|
|
29
29
|
focusStyle: theme.itemFocusStyle,
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { DrawerProps, DrawerContextValue } from "./Drawer.types";
|
|
2
2
|
export declare const useDrawerContext: () => DrawerContextValue;
|
|
3
3
|
export declare const Drawer: {
|
|
4
|
-
({ isOpen, onClose, title,
|
|
4
|
+
({ isOpen, onClose, title, subtitle, icon, position, size, closeOnOverlayClick, closeOnEsc, showCloseButton, children, className, theme: themeOverrides, scale, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
|
+
Header: {
|
|
8
|
+
({ children, icon, showCloseButton, className, ...props }: import("./Drawer.types").DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Title: {
|
|
12
|
+
({ children, className, ...props }: import("./Drawer.types").DrawerTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Subtitle: {
|
|
16
|
+
({ children, className, ...props }: import("./Drawer.types").DrawerSubtitleProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
7
19
|
Content: {
|
|
8
20
|
({ children, className, ...props }: import("./Drawer.types").DrawerContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
21
|
displayName: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useId, useMemo, useContext } from 'react';
|
|
2
|
+
import React__default, { createContext, useId, useMemo, useContext } from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { useScaleBackground } from '../../../hooks/useScaleBackground.js';
|
|
5
|
-
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
6
5
|
import { Overlay } from '../../effects/Overlay/Overlay.js';
|
|
7
6
|
import { drawerTheme, drawerSizeVariants, drawerPositionVariantsFullWidth, drawerPositionVariantsWithMargin } from './Drawer.theme.js';
|
|
8
7
|
import { drawerOverlayAnimations, getDrawerContentAnimations } from './Drawer.animations.js';
|
|
8
|
+
import { DrawerHeader } from './DrawerHeader.js';
|
|
9
|
+
import { DrawerTitle } from './DrawerTitle.js';
|
|
10
|
+
import { DrawerSubtitle } from './DrawerSubtitle.js';
|
|
9
11
|
import { DrawerContent } from './DrawerContent.js';
|
|
10
12
|
import { DrawerFooter } from './DrawerFooter.js';
|
|
11
|
-
import { Button } from '../Button/Button.js';
|
|
12
13
|
|
|
13
14
|
// Create context for Drawer components
|
|
14
15
|
const DrawerContext = createContext(undefined);
|
|
@@ -18,13 +19,13 @@ const useDrawerContext = () => {
|
|
|
18
19
|
throw new Error("Drawer compound components must be used within <Drawer>");
|
|
19
20
|
return ctx;
|
|
20
21
|
};
|
|
21
|
-
const DrawerRoot = ({ isOpen, onClose, title,
|
|
22
|
+
const DrawerRoot = ({ isOpen, onClose, title, subtitle, icon, position = "right", size = "md", closeOnOverlayClick = true, closeOnEsc = true, showCloseButton = true, children, className, theme: themeOverrides, scale = 0.94, ...props }) => {
|
|
22
23
|
// iOS-style scale background effect
|
|
23
24
|
useScaleBackground({ isOpen, scale, position });
|
|
24
25
|
// Generate unique IDs for ARIA linkage
|
|
25
26
|
const id = useId();
|
|
26
27
|
const titleId = `${id}-title`;
|
|
27
|
-
const
|
|
28
|
+
const subtitleId = `${id}-subtitle`;
|
|
28
29
|
// Merge theme with overrides
|
|
29
30
|
const theme = useMemo(() => ({
|
|
30
31
|
...drawerTheme,
|
|
@@ -38,8 +39,19 @@ const DrawerRoot = ({ isOpen, onClose, title, description, icon, position = "rig
|
|
|
38
39
|
size,
|
|
39
40
|
closeOnOverlayClick,
|
|
40
41
|
closeOnEsc,
|
|
42
|
+
showCloseButton,
|
|
41
43
|
theme,
|
|
42
|
-
|
|
44
|
+
titleId,
|
|
45
|
+
subtitleId,
|
|
46
|
+
}), [isOpen, onClose, position, size, closeOnOverlayClick, closeOnEsc, showCloseButton, theme, titleId, subtitleId]);
|
|
47
|
+
// Detect if children contain a compound Drawer.Header
|
|
48
|
+
const hasCompoundHeader = React__default.Children.toArray(children).some((child) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return React__default.isValidElement(child) &&
|
|
51
|
+
((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === "Drawer.Header";
|
|
52
|
+
});
|
|
53
|
+
// Auto-generate header when using prop shorthand (backward compat)
|
|
54
|
+
const shouldAutoRenderHeader = !hasCompoundHeader && (title || showCloseButton);
|
|
43
55
|
// Get size variant based on position
|
|
44
56
|
const isHorizontal = position === "left" || position === "right";
|
|
45
57
|
const sizeVariant = isHorizontal
|
|
@@ -49,16 +61,17 @@ const DrawerRoot = ({ isOpen, onClose, title, description, icon, position = "rig
|
|
|
49
61
|
const positionVariant = size === "full"
|
|
50
62
|
? drawerPositionVariantsFullWidth[position]
|
|
51
63
|
: drawerPositionVariantsWithMargin[position];
|
|
52
|
-
|
|
53
|
-
const shouldRenderHeader = title || showCloseButton;
|
|
54
|
-
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "none", role: "dialog", ariaModal: true, ariaLabelledBy: title ? titleId : undefined, ariaDescribedBy: description ? descriptionId : undefined, contentClassName: cn(theme.container, positionVariant, size !== "full" && sizeVariant, className), animations: {
|
|
64
|
+
return (jsx(Overlay, { isOpen: isOpen, onClose: onClose, closeOnOverlayClick: closeOnOverlayClick, closeOnEsc: closeOnEsc, position: "none", role: "dialog", ariaModal: true, ariaLabelledBy: titleId, ariaDescribedBy: subtitleId, contentClassName: cn(theme.container, positionVariant, size !== "full" && sizeVariant, className), animations: {
|
|
55
65
|
overlay: drawerOverlayAnimations,
|
|
56
66
|
content: getDrawerContentAnimations(position),
|
|
57
|
-
}, ...props, children: jsx(DrawerContext.Provider, { value: contextValue, children: jsxs("div", { className: theme.
|
|
67
|
+
}, ...props, children: jsx(DrawerContext.Provider, { value: contextValue, children: jsxs("div", { className: theme.inner, children: [shouldAutoRenderHeader && (jsxs(DrawerHeader, { icon: icon, children: [title && jsx(DrawerTitle, { children: title }), subtitle && jsx(DrawerSubtitle, { children: subtitle })] })), children] }) }) }));
|
|
58
68
|
};
|
|
59
69
|
DrawerRoot.displayName = "Drawer";
|
|
60
70
|
// Attach compound subcomponents
|
|
61
71
|
const Drawer = Object.assign(DrawerRoot, {
|
|
72
|
+
Header: DrawerHeader,
|
|
73
|
+
Title: DrawerTitle,
|
|
74
|
+
Subtitle: DrawerSubtitle,
|
|
62
75
|
Content: DrawerContent,
|
|
63
76
|
Footer: DrawerFooter,
|
|
64
77
|
});
|
|
@@ -20,11 +20,13 @@ export declare const drawerPositionVariantsFullWidth: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const drawerSizeVariants: {
|
|
22
22
|
horizontal: {
|
|
23
|
+
sm: string;
|
|
23
24
|
md: string;
|
|
24
25
|
lg: string;
|
|
25
26
|
full: string;
|
|
26
27
|
};
|
|
27
28
|
vertical: {
|
|
29
|
+
sm: string;
|
|
28
30
|
md: string;
|
|
29
31
|
lg: string;
|
|
30
32
|
full: string;
|
|
@@ -5,39 +5,41 @@ const drawerTheme = {
|
|
|
5
5
|
"border border-[var(--color-border)] ring-4 ring-white/10 " +
|
|
6
6
|
"flex flex-col overflow-hidden rounded-[var(--drawer-radius)] " +
|
|
7
7
|
"dark:bg-[var(--color-background-secondary)] dark:ring-white/5",
|
|
8
|
-
|
|
8
|
+
inner: "h-full flex flex-col",
|
|
9
9
|
header: "flex items-start justify-between p-4 border-b border-[var(--color-border)] shrink-0 text-[var(--color-text-primary)] gap-4",
|
|
10
10
|
headerContent: "flex items-start gap-3 flex-1 min-w-0",
|
|
11
|
-
title: "text-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
title: "text-lg font-semibold leading-6 text-[var(--color-text-primary)]",
|
|
12
|
+
subtitle: "text-base text-[var(--color-text-secondary)] mt-0.5",
|
|
13
|
+
content: "flex-1 overflow-y-auto p-4",
|
|
14
14
|
footer: "flex items-center justify-end gap-3 p-4 border-t border-[var(--color-border)] shrink-0 " +
|
|
15
|
-
"dark:border-[var(--color-
|
|
15
|
+
"dark:border-[var(--color-border)]",
|
|
16
16
|
};
|
|
17
17
|
// Position variants with margin support
|
|
18
18
|
const drawerPositionVariantsWithMargin = {
|
|
19
|
-
left: "left-
|
|
20
|
-
right: "right-
|
|
21
|
-
top: "top-
|
|
22
|
-
bottom: "bottom-
|
|
19
|
+
left: "left-0 top-0 h-full", // 100vh - 1.5rem top - 1.5rem bottom
|
|
20
|
+
right: "right-0 top-0 h-full",
|
|
21
|
+
top: "top-0 left-0 w-full",
|
|
22
|
+
bottom: "bottom-0 left-0 w-full",
|
|
23
23
|
};
|
|
24
24
|
// Position variants for full-width/height drawers with consistent margins
|
|
25
25
|
const drawerPositionVariantsFullWidth = {
|
|
26
|
-
left: "left-
|
|
27
|
-
right: "right-
|
|
28
|
-
top: "top-
|
|
29
|
-
bottom: "bottom-
|
|
26
|
+
left: "left-0 top-0 right-0 bottom-0", // Consistent margins on all sides
|
|
27
|
+
right: "right-0 top-0 left-0 bottom-0",
|
|
28
|
+
top: "top-0 left-0 right-0 bottom-0",
|
|
29
|
+
bottom: "bottom-0 left-0 right-0 top-0",
|
|
30
30
|
};
|
|
31
31
|
// Size variants based on position
|
|
32
32
|
const drawerSizeVariants = {
|
|
33
33
|
// Horizontal drawers (left/right)
|
|
34
34
|
horizontal: {
|
|
35
|
+
sm: "w-[min(320px,90vw)]", // 320px on large screens, max 90% on small
|
|
35
36
|
md: "w-[min(420px,90vw)]", // 420px on large screens, max 90% on small
|
|
36
37
|
lg: "w-[min(560px,85vw)]", // 560px on large screens, max 85% on small
|
|
37
38
|
full: "w-full", // Full width - positioning handles margins
|
|
38
39
|
},
|
|
39
40
|
// Vertical drawers (top/bottom)
|
|
40
41
|
vertical: {
|
|
42
|
+
sm: "h-[min(240px,90vh)]", // 240px on large screens, max 90% on small
|
|
41
43
|
md: "h-[min(320px,90vh)]", // 320px on large screens, max 90% on small
|
|
42
44
|
lg: "h-[min(448px,85vh)]", // 448px on large screens, max 85% on small
|
|
43
45
|
full: "h-full", // Full height - positioning handles margins
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
3
|
-
export type DrawerSize = "md" | "lg" | "full";
|
|
3
|
+
export type DrawerSize = "sm" | "md" | "lg" | "full";
|
|
4
4
|
export interface DrawerTheme {
|
|
5
5
|
overlay: string;
|
|
6
6
|
container: string;
|
|
7
|
-
|
|
7
|
+
inner: string;
|
|
8
8
|
header: string;
|
|
9
9
|
headerContent: string;
|
|
10
10
|
title: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
subtitle: string;
|
|
12
|
+
content: string;
|
|
13
13
|
footer: string;
|
|
14
14
|
}
|
|
15
15
|
export interface DrawerThemeOverrides {
|
|
16
16
|
overlay?: string;
|
|
17
17
|
container?: string;
|
|
18
|
-
|
|
18
|
+
inner?: string;
|
|
19
19
|
header?: string;
|
|
20
20
|
headerContent?: string;
|
|
21
21
|
title?: string;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
content?: string;
|
|
24
24
|
footer?: string;
|
|
25
25
|
}
|
|
26
26
|
export interface DrawerContextValue {
|
|
@@ -30,15 +30,18 @@ export interface DrawerContextValue {
|
|
|
30
30
|
size: DrawerSize;
|
|
31
31
|
closeOnOverlayClick: boolean;
|
|
32
32
|
closeOnEsc: boolean;
|
|
33
|
+
showCloseButton: boolean;
|
|
33
34
|
theme: DrawerTheme;
|
|
35
|
+
titleId: string;
|
|
36
|
+
subtitleId: string;
|
|
34
37
|
}
|
|
35
38
|
export interface DrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClose" | "onAnimationStart" | "onDragStart" | "title"> {
|
|
36
39
|
isOpen: boolean;
|
|
37
40
|
onClose: () => void;
|
|
38
41
|
/** Title text displayed in the drawer header */
|
|
39
42
|
title?: string;
|
|
40
|
-
/**
|
|
41
|
-
|
|
43
|
+
/** Subtitle text displayed below the title */
|
|
44
|
+
subtitle?: string;
|
|
42
45
|
/** Icon displayed to the left of the title/description */
|
|
43
46
|
icon?: React.ReactNode;
|
|
44
47
|
position?: DrawerPosition;
|
|
@@ -58,6 +61,20 @@ export interface DrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
58
61
|
*/
|
|
59
62
|
scale?: number;
|
|
60
63
|
}
|
|
64
|
+
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
icon?: React.ReactNode;
|
|
67
|
+
showCloseButton?: boolean;
|
|
68
|
+
className?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface DrawerTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
71
|
+
children: React.ReactNode;
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface DrawerSubtitleProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
className?: string;
|
|
77
|
+
}
|
|
61
78
|
export interface DrawerContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
62
79
|
children: React.ReactNode;
|
|
63
80
|
className?: string;
|
|
@@ -4,7 +4,7 @@ import { useDrawerContext } from './Drawer.js';
|
|
|
4
4
|
|
|
5
5
|
const DrawerContent = ({ children, className, ...props }) => {
|
|
6
6
|
const { theme } = useDrawerContext();
|
|
7
|
-
return (jsx("div", { className: cn(theme.
|
|
7
|
+
return (jsx("div", { className: cn(theme.content, className), ...props, children: children }));
|
|
8
8
|
};
|
|
9
9
|
DrawerContent.displayName = "Drawer.Content";
|
|
10
10
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useDrawerContext } from './Drawer.js';
|
|
4
|
+
import { Button } from '../Button/Button.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
7
|
+
|
|
8
|
+
const DrawerHeader = ({ children, icon, showCloseButton, className, ...props }) => {
|
|
9
|
+
const { onClose, showCloseButton: contextShowCloseButton, theme, } = useDrawerContext();
|
|
10
|
+
const shouldShowCloseButton = showCloseButton !== null && showCloseButton !== void 0 ? showCloseButton : contextShowCloseButton;
|
|
11
|
+
return (jsxs("div", { className: cn(theme.header, className), ...props, children: [jsxs("div", { className: cn(theme.headerContent), children: [icon && (jsx("div", { className: "flex-shrink-0 text-[var(--color-text-secondary)]", children: icon })), jsx("div", { className: "flex-1 min-w-0", children: children })] }), shouldShowCloseButton && (jsx(Button, { color: "neutral", variant: "ghost", iconOnly: true, size: "sm", onClick: onClose, "aria-label": "Close drawer", className: "rounded-full shrink-0", children: jsx(XMarkIcon, { className: "size-5" }) }))] }));
|
|
12
|
+
};
|
|
13
|
+
DrawerHeader.displayName = "Drawer.Header";
|
|
14
|
+
|
|
15
|
+
export { DrawerHeader };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useDrawerContext } from './Drawer.js';
|
|
4
|
+
|
|
5
|
+
const DrawerSubtitle = ({ children, className, ...props }) => {
|
|
6
|
+
const { theme, subtitleId } = useDrawerContext();
|
|
7
|
+
return (jsx("p", { id: subtitleId, className: cn(theme.subtitle, className), ...props, children: children }));
|
|
8
|
+
};
|
|
9
|
+
DrawerSubtitle.displayName = "Drawer.Subtitle";
|
|
10
|
+
|
|
11
|
+
export { DrawerSubtitle };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useDrawerContext } from './Drawer.js';
|
|
4
|
+
|
|
5
|
+
const DrawerTitle = ({ children, className, ...props }) => {
|
|
6
|
+
const { theme, titleId } = useDrawerContext();
|
|
7
|
+
return (jsx("h2", { id: titleId, className: cn(theme.title, className), ...props, children: children }));
|
|
8
|
+
};
|
|
9
|
+
DrawerTitle.displayName = "Drawer.Title";
|
|
10
|
+
|
|
11
|
+
export { DrawerTitle };
|