@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +375 -5
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +40 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +73 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +3 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +14 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +6 -2
- package/dist/components/ai/index.js +10 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +2 -3
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -3
- package/dist/components/canvas/NodeRenderer.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +24 -35
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +10 -22
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +13 -32
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +10 -7
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +16 -11
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +11 -28
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +151 -133
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +12 -6
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +10 -8
- package/dist/components/charts/index.js +8 -4
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +21 -26
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -21
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +3 -3
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -3
- package/dist/components/core/Alert/Alert.animations.js +30 -8
- package/dist/components/core/Alert/Alert.js +23 -9
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -82
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +33 -65
- package/dist/components/core/Badge/Badge.theme.js +26 -24
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +6 -6
- package/dist/components/core/Button/Button.js +14 -58
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +35 -22
- package/dist/components/core/Button/Button.types.d.ts +26 -13
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +15 -23
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +40 -4
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +22 -9
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -3
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +7 -5
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +4 -2
- package/dist/components/core/Message/Message.theme.js +8 -10
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +6 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +4 -2
- package/dist/components/core/NavItem/NavItem.js +8 -7
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +27 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +5 -5
- package/dist/components/core/Pill/Pill.js +5 -2
- package/dist/components/core/Pill/Pill.theme.js +9 -5
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +2 -2
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +10 -7
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +3 -3
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +4 -4
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +3 -3
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +5 -3
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +7 -7
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -3
- package/dist/components/data-display/KPI/KPI.js +12 -21
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +11 -11
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -3
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +13 -6
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +4 -4
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +3 -3
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +4 -4
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +7 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1681
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +14 -13
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +74 -8
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +3 -2
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/TimePicker/TimePicker.theme.js +7 -8
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +38 -13
- package/dist/components/forms/index.js +2 -1
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +197 -4
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2522 -328
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +2522 -328
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +2 -5
- package/dist/registry.json +3262 -2464
- package/dist/shadcn-compat.css +6 -6
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +2557 -328
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/dist/utils/index.d.ts +0 -1
- package/package.json +39 -6
- package/src/global.scss +32 -28
- package/src/styles/theme.css +547 -176
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +66 -38
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -207
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -65
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -12
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -1,19 +1,75 @@
|
|
|
1
1
|
const avatarTheme = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
// `isolate` is load-bearing, not decoration: the circle's contents raise
|
|
3
|
+
// themselves above the gradient with `z-10`, and a `relative` box with
|
|
4
|
+
// `z-index: auto` does NOT create a stacking context — so that z-10 escaped
|
|
5
|
+
// into the WRAPPER's context and painted over the sibling status dot, which
|
|
6
|
+
// sits at `z-index: auto`. Isolating keeps the circle's internal layering
|
|
7
|
+
// internal, so the dot and badge stack by DOM order as intended.
|
|
8
|
+
baseStyle: "relative isolate inline-flex items-center justify-center overflow-hidden bg-[var(--color-surface)] text-[var(--color-text-primary)] font-bold tracking-tighter rounded-[var(--avatar-radius)] border border-[var(--color-border)] transition-all duration-[var(--motion-duration-base)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2",
|
|
9
|
+
// One geometry class for EVERY size. The px value arrives through the
|
|
10
|
+
// `--avatar-size` custom property, which Avatar sets inline: a token maps to
|
|
11
|
+
// its `--avatar-size-*` var, a number to `${n}px`. It has to travel as a
|
|
12
|
+
// variable rather than a generated `size-[30px]` class because per-value
|
|
13
|
+
// classes can't be interpolated — Tailwind only ships what it finds in this
|
|
14
|
+
// library's source, so an interpolated class would resolve to nothing.
|
|
15
|
+
sizeStyle: "size-[var(--avatar-size)]",
|
|
16
|
+
// The circle's own glyph (initials) — distinct from `textSizes`, which sizes
|
|
17
|
+
// the adjacent title/subtitle block.
|
|
18
|
+
glyphSizes: {
|
|
19
|
+
xs: "text-xs",
|
|
20
|
+
sm: "text-xs",
|
|
21
|
+
md: "text-sm",
|
|
22
|
+
lg: "text-sm",
|
|
23
|
+
xl: "text-sm",
|
|
9
24
|
},
|
|
10
25
|
statuses: {
|
|
11
26
|
online: "bg-[var(--color-success)]",
|
|
12
|
-
|
|
27
|
+
// NOT `--color-text-muted`: the text tokens are alpha derivations of
|
|
28
|
+
// `--color-text-primary` (57% opaque in light, 50% in dark), so using one
|
|
29
|
+
// as a FILL let the avatar photo show straight through the dot.
|
|
30
|
+
//
|
|
31
|
+
// A ramp rung rather than `--color-mono` (the §3 filled-neutral role) is a
|
|
32
|
+
// deliberate, measured exception — see CLAUDE.md §8. `--color-mono` is
|
|
33
|
+
// mono-900/200, tuned to carry `-contrast` TEXT; a status dot carries none,
|
|
34
|
+
// and at that weight the least-active state out-shouts the active ones.
|
|
35
|
+
// mono-500 is the only rung clearing WCAG 1.4.11's 3:1 against the dot's
|
|
36
|
+
// adjacent colour (its `--color-background` ring) in BOTH modes — 4.54
|
|
37
|
+
// light, 3.78 dark — which also puts it in the same band as its siblings
|
|
38
|
+
// (success 3.52, danger 4.57). One value, no `dark:` variant needed.
|
|
39
|
+
offline: "bg-[var(--color-mono-500)]",
|
|
13
40
|
busy: "bg-[var(--color-danger)]",
|
|
14
41
|
away: "bg-[var(--color-warning)]",
|
|
15
42
|
none: "",
|
|
16
43
|
},
|
|
44
|
+
// Placement, shared by every size. The avatar is a circle
|
|
45
|
+
// (`--avatar-radius: 50%`), so anchoring the dot to the bounding-box corner
|
|
46
|
+
// strands it outside the arc — the corner sits ~41% further from the centre
|
|
47
|
+
// than the edge does. The 45° point of a circle is `r(1 − 1/√2)` ≈ 14.6% of
|
|
48
|
+
// the diameter in from each edge; the half-translates then centre the dot on
|
|
49
|
+
// it, so it reads as attached at EVERY size, including arbitrary numeric ones
|
|
50
|
+
// (a px inset per rung can only ever be right for that rung's exact diameter).
|
|
51
|
+
statusPositionStyle: "left-[14.6%] bottom-[14.6%] -translate-x-1/2 translate-y-1/2",
|
|
52
|
+
// Dot AND ring ramp together, because what the eye reads is the badge's total
|
|
53
|
+
// footprint — and the ring used to be a flat 2px at every rung, making it
|
|
54
|
+
// proportionally 3.3× heavier on xs than on xl. Dot tracks ~20% of the
|
|
55
|
+
// diameter, ring ~5%, so the footprint stays near 30% across the ladder
|
|
56
|
+
// (was 42%→25%). xs is the one deliberate outlier at 33%: 20% of 24px is
|
|
57
|
+
// under 5px, which stops reading as a status colour at all, so the dot holds
|
|
58
|
+
// a 6px legibility floor there rather than scaling honestly.
|
|
59
|
+
statusSizes: {
|
|
60
|
+
xs: "size-1.5 ring-1",
|
|
61
|
+
sm: "size-1.5 ring-[1.5px]",
|
|
62
|
+
md: "size-2 ring-2",
|
|
63
|
+
lg: "size-2.5 ring-2",
|
|
64
|
+
xl: "size-3 ring-[3px]",
|
|
65
|
+
},
|
|
66
|
+
verifiedSizes: {
|
|
67
|
+
xs: "size-2.5 -right-0.5 -bottom-0.5",
|
|
68
|
+
sm: "size-3.5 -right-0.5 -bottom-0.5",
|
|
69
|
+
md: "size-4 -right-0.5 -bottom-0.5",
|
|
70
|
+
lg: "size-5 -right-0.5 -bottom-0.5",
|
|
71
|
+
xl: "size-5 -right-0.5 -bottom-0.5",
|
|
72
|
+
},
|
|
17
73
|
titleStyle: "font-medium leading-tight text-[var(--color-text-primary)] truncate",
|
|
18
74
|
subtitleStyle: "leading-tight text-[var(--color-text-muted)] truncate",
|
|
19
75
|
textSizes: {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import type { MeshPaletteName } from "../../effects/MeshGradient";
|
|
3
|
-
|
|
3
|
+
/** The named rungs of the avatar size ladder (px values live in `theme.css`). */
|
|
4
|
+
export type AvatarSizeToken = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
/**
|
|
6
|
+
* A named rung, or an exact pixel size. A number sizes the circle precisely
|
|
7
|
+
* (`size={30}` → 30px) while its decorations — glyph, status dot, verified
|
|
8
|
+
* badge, text gap — snap to the nearest rung.
|
|
9
|
+
*/
|
|
10
|
+
export type AvatarSize = AvatarSizeToken | number;
|
|
4
11
|
export type AvatarStatus = "online" | "offline" | "busy" | "away" | "none";
|
|
5
12
|
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
13
|
/**
|
|
@@ -14,7 +21,11 @@ export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
14
21
|
*/
|
|
15
22
|
name?: string | null;
|
|
16
23
|
/**
|
|
17
|
-
* The size of the avatar
|
|
24
|
+
* The size of the avatar — a named rung (`"md"`) or an exact pixel size
|
|
25
|
+
* (`30`). Prefer this over a `className="size-[30px]"` override: the shipped
|
|
26
|
+
* stylesheet only contains the classes used by this library's own source, so
|
|
27
|
+
* an arbitrary size utility resolves to nothing for consumers who don't run
|
|
28
|
+
* Tailwind themselves.
|
|
18
29
|
* @default "md"
|
|
19
30
|
*/
|
|
20
31
|
size?: AvatarSize;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Avatar } from './Avatar';
|
|
2
|
-
export type { AvatarProps, AvatarSize, AvatarStatus, } from './Avatar.types';
|
|
2
|
+
export type { AvatarProps, AvatarSize, AvatarSizeToken, AvatarStatus, } from './Avatar.types';
|
|
@@ -7,7 +7,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
7
7
|
import { avatarGroupTheme } from './AvatarGroup.theme.js';
|
|
8
8
|
import { getAnimationState, getAvatarGroupVariants } from './AvatarGroup.animations.js';
|
|
9
9
|
|
|
10
|
-
const AvatarGroup = React__default.forwardRef(({ avatars = [], max = 5, size = "md",
|
|
10
|
+
const AvatarGroup = React__default.forwardRef(({ avatars = [], max = 5, size = "md", direction = "row", overflowIndicator, className, ariaLabel = "Group of users", shouldAnimate = true, ...props }, ref) => {
|
|
11
11
|
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
12
12
|
const shouldReduceMotion = useReducedMotion();
|
|
13
13
|
const enableAnimations = shouldAnimate && !shouldReduceMotion;
|
|
@@ -15,7 +15,6 @@ const AvatarGroup = React__default.forwardRef(({ avatars = [], max = 5, size = "
|
|
|
15
15
|
const memoizedData = useMemo(() => {
|
|
16
16
|
const visibleAvatars = avatars.slice(0, max);
|
|
17
17
|
const overflowCount = avatars.length > max ? avatars.length - max : 0;
|
|
18
|
-
const spacingClass = avatarGroupTheme.spacingStyles[spacing];
|
|
19
18
|
const directionClass = direction === "row-reverse" ? "flex-row-reverse" : "flex-row";
|
|
20
19
|
const totalPeople = avatars.length;
|
|
21
20
|
const groupDescription = avatars
|
|
@@ -24,14 +23,13 @@ const AvatarGroup = React__default.forwardRef(({ avatars = [], max = 5, size = "
|
|
|
24
23
|
return {
|
|
25
24
|
visibleAvatars,
|
|
26
25
|
overflowCount,
|
|
27
|
-
spacingClass,
|
|
28
26
|
directionClass,
|
|
29
27
|
totalPeople,
|
|
30
28
|
groupDescription,
|
|
31
29
|
};
|
|
32
|
-
}, [avatars, max,
|
|
33
|
-
const { visibleAvatars, overflowCount,
|
|
34
|
-
return (jsxs("div", { ref: ref, className: cn(avatarGroupTheme.baseStyle, directionClass, className), role: "group", "aria-label": ariaLabel, "aria-description": `Contains ${totalPeople} users: ${groupDescription}`, "data-size": size, "data-
|
|
30
|
+
}, [avatars, max, direction]);
|
|
31
|
+
const { visibleAvatars, overflowCount, directionClass, totalPeople, groupDescription, } = memoizedData;
|
|
32
|
+
return (jsxs("div", { ref: ref, className: cn(avatarGroupTheme.baseStyle, directionClass, className), role: "group", "aria-label": ariaLabel, "aria-description": `Contains ${totalPeople} users: ${groupDescription}`, "data-size": size, "data-direction": direction, "data-total": totalPeople, "data-visible": visibleAvatars.length, "data-overflow": overflowCount > 0 ? "true" : "false", onMouseLeave: () => enableAnimations && setHoveredIndex(null), ...props, children: [visibleAvatars.map((avatarProps, index) => {
|
|
35
33
|
// Create contextual label for individual avatars in a group
|
|
36
34
|
const position = index + 1;
|
|
37
35
|
const contextLabel = avatarProps.contextualLabel || ` (${position} of ${totalPeople})`;
|
|
@@ -50,10 +48,10 @@ const AvatarGroup = React__default.forwardRef(({ avatars = [], max = 5, size = "
|
|
|
50
48
|
// inflating the row and dropping the self-centered overflow chip.
|
|
51
49
|
"flex",
|
|
52
50
|
// First avatar doesn't need negative margin
|
|
53
|
-
index > 0 ?
|
|
51
|
+
index > 0 ? avatarGroupTheme.spacingStyle : "z-10"), "data-position": position, "data-index": index, ...motionProps, children: jsx(Avatar, { size: size, ...avatarProps, contextualLabel: contextLabel,
|
|
54
52
|
// Ensure that groupPosition is not passed to avoid conflicts
|
|
55
53
|
groupPosition: undefined }) }, index));
|
|
56
|
-
}), overflowCount > 0 && (jsx("div", { className: cn("flex",
|
|
54
|
+
}), overflowCount > 0 && (jsx("div", { className: cn("flex", avatarGroupTheme.spacingStyle), "data-overflow-count": overflowCount, children: overflowIndicator ? (overflowIndicator(overflowCount)) : (jsx(Avatar, { size: size, name: `+${overflowCount} more`, fallback: jsxs("span", { children: ["+", overflowCount] }), className: avatarGroupTheme.overflowAvatarStyle, role: "img", "aria-label": `+ ${overflowCount} more users` })) }))] }));
|
|
57
55
|
});
|
|
58
56
|
// Set display name for dev tools and Storybook
|
|
59
57
|
AvatarGroup.displayName = "AvatarGroup";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AvatarGroupSpacing } from "./AvatarGroup.types";
|
|
2
1
|
/**
|
|
3
2
|
* Internal theme structure for the AvatarGroup component
|
|
4
3
|
*/
|
|
5
4
|
interface AvatarGroupTheme {
|
|
6
5
|
baseStyle: string;
|
|
7
|
-
|
|
6
|
+
spacingStyle: string;
|
|
8
7
|
overflowAvatarStyle: string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
@@ -6,12 +6,8 @@ const avatarGroupTheme = {
|
|
|
6
6
|
baseStyle: "flex items-center",
|
|
7
7
|
// NOTE: items-center only works because Avatar's wrapper no longer leaves a
|
|
8
8
|
// baseline descender below the circle (Avatar.tsx wrapper is inline-flex).
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
tight: "-ml-5 z-10",
|
|
12
|
-
normal: "-ml-3 z-10",
|
|
13
|
-
loose: "-ml-2 z-10",
|
|
14
|
-
},
|
|
9
|
+
// Overlap between stacked avatars — override per call site with className.
|
|
10
|
+
spacingStyle: "-ml-3 z-10",
|
|
15
11
|
// Overflow avatar styles
|
|
16
12
|
overflowAvatarStyle: "bg-[var(--color-surface)]/60 backdrop-blur-sm text-[var(--color-text-secondary)] font-bold tracking-tight text-[10px] flex items-center justify-center size-6",
|
|
17
13
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { AvatarProps } from '../Avatar/Avatar.types';
|
|
3
|
-
export type AvatarGroupSpacing = 'tight' | 'normal' | 'loose';
|
|
4
3
|
export type AvatarGroupDirection = 'row' | 'row-reverse';
|
|
5
4
|
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
5
|
/**
|
|
@@ -17,11 +16,6 @@ export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
17
16
|
* @default "md"
|
|
18
17
|
*/
|
|
19
18
|
size?: AvatarProps["size"];
|
|
20
|
-
/**
|
|
21
|
-
* Amount of overlap between avatars (higher value = more overlap)
|
|
22
|
-
* @default "normal"
|
|
23
|
-
*/
|
|
24
|
-
spacing?: AvatarGroupSpacing;
|
|
25
19
|
/**
|
|
26
20
|
* Direction of the avatar stack
|
|
27
21
|
* @default "row"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { AvatarGroup } from './AvatarGroup';
|
|
2
|
-
export type { AvatarGroupProps,
|
|
2
|
+
export type { AvatarGroupProps, AvatarGroupDirection } from './AvatarGroup.types';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { Variants } from "motion/react";
|
|
2
2
|
export declare const badgeVariants: Variants;
|
|
3
3
|
export declare const dotVariants: Variants;
|
|
4
|
-
export declare const dismissButtonVariants: Variants;
|
|
5
|
-
export declare const dismissVariants: Variants;
|
|
6
|
-
export declare const animationTiming: {
|
|
7
|
-
dismissDelay: number;
|
|
8
|
-
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
//
|
|
2
|
+
// Badge is a static label — it does not animate in or out. This variant set
|
|
3
|
+
// exists so the root `motion.span` can PROPAGATE `initial`/`animate` down to the
|
|
4
|
+
// dot (motion cascades variant names to motion children). Removing it would stop
|
|
5
|
+
// the dot animating. Keep the values inert.
|
|
3
6
|
const badgeVariants = {
|
|
4
7
|
initial: {
|
|
5
8
|
opacity: 1,
|
|
@@ -8,23 +11,6 @@ const badgeVariants = {
|
|
|
8
11
|
animate: {
|
|
9
12
|
opacity: 1,
|
|
10
13
|
scale: 1,
|
|
11
|
-
transition: {
|
|
12
|
-
type: "spring",
|
|
13
|
-
stiffness: 500,
|
|
14
|
-
damping: 30,
|
|
15
|
-
mass: 1,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
exit: {
|
|
19
|
-
opacity: 0,
|
|
20
|
-
scale: 0.2,
|
|
21
|
-
transition: {
|
|
22
|
-
type: "spring",
|
|
23
|
-
stiffness: 500,
|
|
24
|
-
damping: 25,
|
|
25
|
-
mass: 0.8,
|
|
26
|
-
duration: 0.3,
|
|
27
|
-
},
|
|
28
14
|
},
|
|
29
15
|
};
|
|
30
16
|
// Dot variants
|
|
@@ -42,69 +28,6 @@ const dotVariants = {
|
|
|
42
28
|
damping: 30,
|
|
43
29
|
},
|
|
44
30
|
},
|
|
45
|
-
exit: {
|
|
46
|
-
opacity: 0,
|
|
47
|
-
scale: 0,
|
|
48
|
-
transition: {
|
|
49
|
-
duration: 0.15,
|
|
50
|
-
ease: "easeIn",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
// Dismiss button variants - optimized for performance
|
|
55
|
-
const dismissButtonVariants = {
|
|
56
|
-
initial: {
|
|
57
|
-
opacity: 0.75,
|
|
58
|
-
},
|
|
59
|
-
hover: {
|
|
60
|
-
opacity: 1,
|
|
61
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
62
|
-
},
|
|
63
|
-
tap: {
|
|
64
|
-
scale: 0.95,
|
|
65
|
-
transition: { duration: 0.1, ease: "easeOut" },
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
// Optimized dismiss animation sequence
|
|
69
|
-
// This uses Framer Motion's built-in sequencing capabilities
|
|
70
|
-
const dismissVariants = {
|
|
71
|
-
initial: {
|
|
72
|
-
opacity: 0,
|
|
73
|
-
scale: 0.8,
|
|
74
|
-
},
|
|
75
|
-
animate: {
|
|
76
|
-
opacity: 1,
|
|
77
|
-
scale: 1,
|
|
78
|
-
transition: {
|
|
79
|
-
type: "spring",
|
|
80
|
-
stiffness: 500,
|
|
81
|
-
damping: 30,
|
|
82
|
-
mass: 1,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
// First stage of exit - slight pop
|
|
86
|
-
exit: {
|
|
87
|
-
opacity: 0,
|
|
88
|
-
scale: 0.2,
|
|
89
|
-
transition: {
|
|
90
|
-
opacity: {
|
|
91
|
-
duration: 0.3,
|
|
92
|
-
ease: "easeOut",
|
|
93
|
-
},
|
|
94
|
-
scale: {
|
|
95
|
-
type: "spring",
|
|
96
|
-
stiffness: 300,
|
|
97
|
-
damping: 20,
|
|
98
|
-
// Add a slight delay to create the pop effect
|
|
99
|
-
delay: 0.05,
|
|
100
|
-
},
|
|
101
|
-
duration: 0.4,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
// Animation timing constants (in ms)
|
|
106
|
-
const animationTiming = {
|
|
107
|
-
dismissDelay: 400, // Total animation duration
|
|
108
31
|
};
|
|
109
32
|
|
|
110
|
-
export {
|
|
33
|
+
export { badgeVariants, dotVariants };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BadgeProps } from "./Badge.types";
|
|
3
3
|
/**
|
|
4
|
-
* Badge
|
|
4
|
+
* Badge — a non-interactive status/metadata label.
|
|
5
|
+
*
|
|
6
|
+
* 🔴 Badge is deliberately a PURE LABEL: no dismiss, no disabled, no blessed
|
|
7
|
+
* click target. For a removable chip use `Tag`; for a selectable filter chip use
|
|
8
|
+
* `Pill`; for anything that performs an action use `Button`. See CLAUDE.md §8b.
|
|
5
9
|
*
|
|
6
10
|
* @component
|
|
7
11
|
* @example
|
|
8
12
|
* ```tsx
|
|
9
|
-
* <Badge
|
|
10
|
-
* <Badge
|
|
11
|
-
* <Badge dismissible onDismiss={handleDismiss}>Removable</Badge>
|
|
13
|
+
* <Badge color="primary" size="md" pill>New Feature</Badge>
|
|
14
|
+
* <Badge color="success" withDot>Ready</Badge>
|
|
12
15
|
* ```
|
|
13
16
|
*/
|
|
14
17
|
export declare const Badge: React.NamedExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React__default
|
|
4
|
-
import { useReducedMotion,
|
|
5
|
-
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
6
5
|
import { cn } from '../../../utils/cn.js';
|
|
7
6
|
import { Avatar } from '../Avatar/Avatar.js';
|
|
8
|
-
import {
|
|
7
|
+
import { badgeVariants, dotVariants } from './Badge.animations.js';
|
|
9
8
|
import { badgeTheme } from './Badge.theme.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
* Badge
|
|
11
|
+
* Badge — a non-interactive status/metadata label.
|
|
12
|
+
*
|
|
13
|
+
* 🔴 Badge is deliberately a PURE LABEL: no dismiss, no disabled, no blessed
|
|
14
|
+
* click target. For a removable chip use `Tag`; for a selectable filter chip use
|
|
15
|
+
* `Pill`; for anything that performs an action use `Button`. See CLAUDE.md §8b.
|
|
13
16
|
*
|
|
14
17
|
* @component
|
|
15
18
|
* @example
|
|
16
19
|
* ```tsx
|
|
17
|
-
* <Badge
|
|
18
|
-
* <Badge
|
|
19
|
-
* <Badge dismissible onDismiss={handleDismiss}>Removable</Badge>
|
|
20
|
+
* <Badge color="primary" size="md" pill>New Feature</Badge>
|
|
21
|
+
* <Badge color="success" withDot>Ready</Badge>
|
|
20
22
|
* ```
|
|
21
23
|
*/
|
|
22
|
-
const Badge = React__default.memo(React__default.forwardRef(({ children, variant = "
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
24
|
-
// State management
|
|
25
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
24
|
+
const Badge = React__default.memo(React__default.forwardRef(({ children, variant = "soft", color = "primary", size = "md", pill = false, withDot = false, iconStart, avatar, maxWidth, className, theme: customTheme = {}, darkMode = false, ...props }, ref) => {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
26
26
|
// useReducedMotion is SSR-safe (returns null on server, actual value after hydration)
|
|
27
27
|
const prefersReducedMotion = useReducedMotion();
|
|
28
28
|
const shouldAnimate = !prefersReducedMotion;
|
|
29
29
|
// Development-only warnings
|
|
30
30
|
if (process.env.NODE_ENV !== "production") {
|
|
31
|
-
if (dismissible && !onDismiss) {
|
|
32
|
-
console.warn("[Badge]: onDismiss prop is required when dismissible is true");
|
|
33
|
-
}
|
|
34
31
|
if (avatar && iconStart) {
|
|
35
32
|
console.warn("[Badge]: Both avatar and iconStart provided. Avatar takes precedence.");
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
// Handle dismiss button click
|
|
39
|
-
const handleDismiss = useCallback((e) => {
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
setIsVisible(false);
|
|
42
|
-
// Delay the onDismiss call until after the animation
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(e);
|
|
45
|
-
}, animationTiming.dismissDelay);
|
|
46
|
-
}, [onDismiss]);
|
|
47
|
-
// Handle badge click
|
|
48
|
-
const handleClick = useCallback((e) => {
|
|
49
|
-
if (disabled)
|
|
50
|
-
return;
|
|
51
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
52
|
-
}, [onClick, disabled]);
|
|
53
35
|
// Merge default theme with custom theme overrides
|
|
54
36
|
const theme = {
|
|
55
37
|
...badgeTheme,
|
|
@@ -76,6 +58,10 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
76
58
|
...badgeTheme.sizes,
|
|
77
59
|
...customTheme.sizes,
|
|
78
60
|
},
|
|
61
|
+
radiusSizes: {
|
|
62
|
+
...badgeTheme.radiusSizes,
|
|
63
|
+
...customTheme.radiusSizes,
|
|
64
|
+
},
|
|
79
65
|
pillSizes: {
|
|
80
66
|
...badgeTheme.pillSizes,
|
|
81
67
|
...customTheme.pillSizes,
|
|
@@ -88,18 +74,10 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
88
74
|
...badgeTheme.avatarSizes,
|
|
89
75
|
...customTheme.avatarSizes,
|
|
90
76
|
},
|
|
91
|
-
dismissSizes: {
|
|
92
|
-
...badgeTheme.dismissSizes,
|
|
93
|
-
...customTheme.dismissSizes,
|
|
94
|
-
},
|
|
95
77
|
dotColors: {
|
|
96
78
|
...badgeTheme.dotColors,
|
|
97
79
|
...customTheme.dotColors,
|
|
98
80
|
},
|
|
99
|
-
states: {
|
|
100
|
-
...badgeTheme.states,
|
|
101
|
-
...customTheme.states,
|
|
102
|
-
},
|
|
103
81
|
};
|
|
104
82
|
// Get styles from theme
|
|
105
83
|
const variantStyles = ((_g = theme.variants) === null || _g === void 0 ? void 0 : _g[variant]) || "";
|
|
@@ -107,22 +85,16 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
107
85
|
const sizeStyle = ((_k = theme.sizes) === null || _k === void 0 ? void 0 : _k[size]) || "";
|
|
108
86
|
const shapeStyle = pill
|
|
109
87
|
? "rounded-full"
|
|
110
|
-
:
|
|
111
|
-
const dotColorStyle = ((
|
|
112
|
-
|
|
113
|
-
const isInteractive = dismissible;
|
|
114
|
-
const baseStyles = cn(theme.baseStyle, shapeStyle, variantStyles, colorStyles, sizeStyle, pill && ((_m = theme.pillSizes) === null || _m === void 0 ? void 0 : _m[size]), isInteractive && "cursor-pointer", disabled && ((_o = theme.states) === null || _o === void 0 ? void 0 : _o.disabled), darkMode && "dark", className);
|
|
88
|
+
: ((_l = theme.radiusSizes) === null || _l === void 0 ? void 0 : _l[size]) || "";
|
|
89
|
+
const dotColorStyle = ((_m = theme.dotColors) === null || _m === void 0 ? void 0 : _m[color]) || "";
|
|
90
|
+
const baseStyles = cn(theme.baseStyle, shapeStyle, variantStyles, colorStyles, sizeStyle, pill && ((_o = theme.pillSizes) === null || _o === void 0 ? void 0 : _o[size]), darkMode && "dark", className);
|
|
115
91
|
// Create data attributes for styling hooks
|
|
116
92
|
const dataAttributes = {
|
|
117
93
|
"data-variant": variant,
|
|
118
94
|
"data-color": color,
|
|
119
95
|
"data-size": size,
|
|
120
|
-
"data-state": isVisible ? "visible" : "hidden",
|
|
121
96
|
"data-pill": pill ? "true" : "false",
|
|
122
97
|
"data-with-dot": withDot ? "true" : "false",
|
|
123
|
-
"data-dismissible": dismissible ? "true" : "false",
|
|
124
|
-
"data-disabled": disabled ? "true" : "false",
|
|
125
|
-
"data-interactive": isInteractive ? "true" : "false",
|
|
126
98
|
};
|
|
127
99
|
// Render left content (priority: avatar → iconStart → dot)
|
|
128
100
|
const renderLeftContent = () => {
|
|
@@ -131,7 +103,12 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
131
103
|
return (jsx("span", { className: cn("inline-flex items-center justify-center shrink-0 overflow-hidden [&_div]:!size-full", (_a = theme.avatarSizes) === null || _a === void 0 ? void 0 : _a[size], pill ? "rounded-full -ml-2" : "rounded-full -ml-0"), children: jsx(Avatar, { src: avatar.src, name: avatar.name, gradient: avatar.gradient, gradientVariant: avatar.gradientVariant, gradientColors: avatar.gradientColors, fallback: avatar.fallback, initialsCount: avatar.initialsCount, size: "xs", className: cn("!size-full border-0", pill ? "rounded-full" : "rounded-md ring-0") }) }));
|
|
132
104
|
}
|
|
133
105
|
if (iconStart) {
|
|
134
|
-
return (jsx("span", { className: cn("inline-flex items-center justify-center flex-shrink-0
|
|
106
|
+
return (jsx("span", { className: cn("inline-flex items-center justify-center flex-shrink-0",
|
|
107
|
+
// Optical tuck into the cap curve — pill only (it has the extra
|
|
108
|
+
// pillSizes padding to absorb it). On a regular badge the base
|
|
109
|
+
// px-1 padding is 4px, so -ml-1 left the icon ~1px from the
|
|
110
|
+
// border. Mirrors the avatar path's pill/non-pill conditional.
|
|
111
|
+
pill ? "-ml-1" : "-ml-0", (_b = theme.iconSizes) === null || _b === void 0 ? void 0 : _b[size]), "aria-hidden": "true", children: iconStart }));
|
|
135
112
|
}
|
|
136
113
|
if (withDot) {
|
|
137
114
|
if (shouldAnimate) {
|
|
@@ -141,25 +118,16 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
141
118
|
}
|
|
142
119
|
return null;
|
|
143
120
|
};
|
|
121
|
+
const content = (jsxs(Fragment, { children: [renderLeftContent(), jsx("span", { className: cn("badge-content", maxWidth && "truncate"), style: maxWidth
|
|
122
|
+
? {
|
|
123
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
124
|
+
}
|
|
125
|
+
: undefined, children: children })] }));
|
|
144
126
|
if (!shouldAnimate) {
|
|
145
127
|
// Spread props directly — Badge only receives HTMLSpanElement attributes
|
|
146
|
-
|
|
147
|
-
// Non-animated render for reduced-motion environments
|
|
148
|
-
return isVisible ? (jsxs("span", { ref: ref, className: baseStyles, onClick: handleClick, "aria-disabled": disabled || undefined, ...dataAttributes, ...restHtmlProps, children: [renderLeftContent(), jsx("span", { className: cn("badge-content", maxWidth && "truncate"), style: maxWidth
|
|
149
|
-
? {
|
|
150
|
-
maxWidth: typeof maxWidth === "number"
|
|
151
|
-
? `${maxWidth}px`
|
|
152
|
-
: maxWidth,
|
|
153
|
-
}
|
|
154
|
-
: undefined, children: children }), dismissible && (jsx("button", { type: "button", onClick: handleDismiss, className: "badge-dismiss-btn -mr-0.5 rounded-full p-0.5 cursor-pointer", "aria-label": "Dismiss", disabled: disabled, children: jsx(XMarkIcon, { className: cn("badge-dismiss-icon", (_p = theme.dismissSizes) === null || _p === void 0 ? void 0 : _p[size]), "aria-hidden": "true" }) }))] })) : null;
|
|
128
|
+
return (jsx("span", { ref: ref, className: baseStyles, ...dataAttributes, ...props, children: content }));
|
|
155
129
|
}
|
|
156
|
-
return (jsx(
|
|
157
|
-
? {
|
|
158
|
-
maxWidth: typeof maxWidth === "number"
|
|
159
|
-
? `${maxWidth}px`
|
|
160
|
-
: maxWidth,
|
|
161
|
-
}
|
|
162
|
-
: undefined, children: children }), dismissible && (jsx(motion.button, { type: "button", onClick: handleDismiss, className: "badge-dismiss-btn -mr-0.5 rounded-full p-0.5 cursor-pointer", "aria-label": "Dismiss", disabled: disabled, variants: dismissButtonVariants, initial: "initial", whileHover: "hover", whileTap: "tap", children: jsx(XMarkIcon, { className: cn("badge-dismiss-icon", (_q = theme.dismissSizes) === null || _q === void 0 ? void 0 : _q[size]), "aria-hidden": "true", strokeWidth: 2 }) }))] })) }));
|
|
130
|
+
return (jsx(motion.span, { ref: ref, className: baseStyles, variants: badgeVariants, initial: "initial", animate: "animate", ...dataAttributes, ...props, children: content }));
|
|
163
131
|
}));
|
|
164
132
|
Badge.displayName = "Badge";
|
|
165
133
|
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* Uses variant-first color organization for reliable dark mode and className overrides
|
|
4
4
|
*/
|
|
5
5
|
const badgeTheme = {
|
|
6
|
-
// Base styles applied to all badges
|
|
7
|
-
|
|
6
|
+
// Base styles applied to all badges.
|
|
7
|
+
// No `leading-*` here: `sizes` applies `text-xs` AFTER this string, and tailwind-merge
|
|
8
|
+
// treats font-size as owning line-height, so any leading class here is silently dropped.
|
|
9
|
+
// The badge therefore uses the `text-xs` ramp line-height (16px) → 22px tall.
|
|
10
|
+
// To change it, put the leading class in `sizes`, after `text-xs`.
|
|
11
|
+
baseStyle: "inline-flex items-center align-middle select-none whitespace-nowrap transition-all duration-[var(--motion-duration-slow)] h-fit w-fit tracking-tight font-medium border",
|
|
8
12
|
// Visual style variants (structure only, no colors)
|
|
9
13
|
// All variants keep the 1px `border` from baseStyle so every variant is the
|
|
10
14
|
// SAME height (variant must never change size). `filled` and `soft` make that
|
|
@@ -22,8 +26,8 @@ const badgeTheme = {
|
|
|
22
26
|
variantColors: {
|
|
23
27
|
// Filled variant - solid backgrounds, no visible border
|
|
24
28
|
filled: {
|
|
25
|
-
|
|
26
|
-
"dark:bg-[var(--color-
|
|
29
|
+
mono: "bg-[var(--color-mono-900)] text-white " +
|
|
30
|
+
"dark:bg-[var(--color-mono-700)]",
|
|
27
31
|
// Background drives from the themed base var (mode-aware) so the
|
|
28
32
|
// auto-derived -contrast text always matches. Do NOT pin a fixed step
|
|
29
33
|
// (e.g. dark:bg-primary-600) — that decouples the fill from -contrast and
|
|
@@ -39,7 +43,7 @@ const badgeTheme = {
|
|
|
39
43
|
},
|
|
40
44
|
// Outline variant - transparent bg with colored border
|
|
41
45
|
outline: {
|
|
42
|
-
|
|
46
|
+
mono: "text-[var(--color-text-primary)] border-[var(--color-border-secondary)] " + "",
|
|
43
47
|
primary: "text-[var(--color-primary)] border-[var(--color-primary-600)] " +
|
|
44
48
|
"dark:text-[var(--color-primary-400)] dark:border-[var(--color-primary-400)]",
|
|
45
49
|
success: "text-[var(--color-success)] border-[var(--color-success-600)] " +
|
|
@@ -52,8 +56,8 @@ const badgeTheme = {
|
|
|
52
56
|
// Soft variant - subtle background tints, NO visible border (the transparent
|
|
53
57
|
// 1px border from `variants.soft` only reserves height; the fill shows through it).
|
|
54
58
|
soft: {
|
|
55
|
-
|
|
56
|
-
"dark:bg-[var(--color-
|
|
59
|
+
mono: "bg-[var(--color-mono-100)] text-[var(--color-text-primary)] " +
|
|
60
|
+
"dark:bg-[var(--color-mono-900)]",
|
|
57
61
|
primary: "bg-[var(--color-primary-50)] text-[var(--color-primary-700)] " +
|
|
58
62
|
"dark:bg-[var(--color-primary-400)]/20 dark:text-[var(--color-primary-300)]",
|
|
59
63
|
success: "bg-[var(--color-success-100)]/70 text-[var(--color-success-700)] " +
|
|
@@ -64,16 +68,25 @@ const badgeTheme = {
|
|
|
64
68
|
"dark:bg-[var(--color-danger-400)]/20 dark:text-[var(--color-danger-400)]",
|
|
65
69
|
},
|
|
66
70
|
},
|
|
67
|
-
// Flat size structure (no nested objects)
|
|
71
|
+
// Flat size structure (no nested objects).
|
|
72
|
+
// Paddings are tokenised (--badge-px-*/--badge-py-*) so a theme can grow the
|
|
73
|
+
// chip tier — defaults are px-1/px-1.5 + py-0/py-0.5. See theme.css.
|
|
68
74
|
sizes: {
|
|
69
|
-
sm: "text-xs px-
|
|
70
|
-
md: "text-xs px-
|
|
75
|
+
sm: "text-xs px-[var(--badge-px-sm)] py-[var(--badge-py-sm)] gap-1",
|
|
76
|
+
md: "text-xs px-[var(--badge-px-md)] py-[var(--badge-py-md)] gap-1",
|
|
77
|
+
},
|
|
78
|
+
// Corner radius per size. NOT one shared value: the curve starts `radius` in
|
|
79
|
+
// from the edge while text starts `px + border` in, so the tighter box is the
|
|
80
|
+
// one whose glyphs land inside the curve. See theme.css for the full note.
|
|
81
|
+
radiusSizes: {
|
|
82
|
+
sm: "rounded-[var(--badge-radius-sm)]",
|
|
83
|
+
md: "rounded-[var(--badge-radius-md)]",
|
|
71
84
|
},
|
|
72
85
|
// Additional padding for pill shape — must clear the rounded-full cap radius
|
|
73
86
|
// (≈ height/2), otherwise content sits inside the curve and hugs the edge.
|
|
74
87
|
pillSizes: {
|
|
75
|
-
sm: "px-
|
|
76
|
-
md: "px-
|
|
88
|
+
sm: "px-[var(--badge-pill-px-sm)]",
|
|
89
|
+
md: "px-[var(--badge-pill-px-md)]",
|
|
77
90
|
},
|
|
78
91
|
// Icon sizes — applies to wrapper span; [&>svg] selector ensures SVG scales to fit
|
|
79
92
|
iconSizes: {
|
|
@@ -85,25 +98,14 @@ const badgeTheme = {
|
|
|
85
98
|
sm: "size-4",
|
|
86
99
|
md: "size-5",
|
|
87
100
|
},
|
|
88
|
-
// Dismiss icon sizes — match the text-xs cap (both badge sizes use text-xs) so
|
|
89
|
-
// the dismiss button never grows taller than the text and stretches the badge.
|
|
90
|
-
dismissSizes: {
|
|
91
|
-
sm: "size-3",
|
|
92
|
-
md: "size-3",
|
|
93
|
-
},
|
|
94
101
|
// Dot inherits text color via currentColor — works across all variants/colors
|
|
95
102
|
dotColors: {
|
|
96
|
-
|
|
103
|
+
mono: "bg-current",
|
|
97
104
|
primary: "bg-current",
|
|
98
105
|
success: "bg-current",
|
|
99
106
|
warning: "bg-current",
|
|
100
107
|
danger: "bg-current",
|
|
101
108
|
},
|
|
102
|
-
// State styles
|
|
103
|
-
states: {
|
|
104
|
-
disabled: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
105
|
-
hover: "cursor-pointer",
|
|
106
|
-
},
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
export { badgeTheme };
|