@flikk/ui 1.0.0-beta.31 → 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 +295 -22
- 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/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +2 -2
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.js +27 -3
- 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 +58 -5
- 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 +2 -1
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- 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 +13 -7
- 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.theme.js +1 -1
- package/dist/components/ai/index.d.ts +3 -2
- package/dist/components/ai/index.js +4 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +0 -1
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +0 -1
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +3 -3
- package/dist/components/charts/AreaChart/AreaChart.theme.js +3 -3
- package/dist/components/charts/BarChart/BarChart.js +4 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +2 -2
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +1 -1
- 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.js +1 -1
- package/dist/components/charts/LineChart/LineChart.js +2 -2
- package/dist/components/charts/LollipopChart/LollipopChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +3 -3
- package/dist/components/charts/hooks/useChartAccessibility.js +9 -6
- package/dist/components/charts/index.d.ts +4 -8
- package/dist/components/charts/index.js +2 -4
- 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 +3 -3
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -19
- package/dist/components/core/Accordion/Accordion.theme.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -4
- package/dist/components/core/Alert/Alert.animations.js +11 -4
- package/dist/components/core/Alert/Alert.js +16 -2
- 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.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -84
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +27 -64
- package/dist/components/core/Badge/Badge.theme.js +8 -12
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +4 -4
- package/dist/components/core/Button/Button.js +7 -43
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/Button/Button.types.d.ts +8 -12
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- 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 +29 -1
- 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/CardHeader.js +4 -1
- 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/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 +21 -8
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.js +0 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Link/Link.js +1 -1
- 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 +2 -0
- package/dist/components/core/Message/Message.theme.js +3 -3
- 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.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/ModalHeader.js +0 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -1
- package/dist/components/core/NavItem/NavItem.js +3 -2
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +4 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.js +2 -1
- package/dist/components/core/Pill/Pill.theme.js +4 -2
- 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.theme.js +1 -1
- 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 +3 -3
- 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/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +1 -1
- package/dist/components/core/Sidebar/SidebarSearch.js +2 -2
- package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- 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.theme.js +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- 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/data-display/GanttChart/GanttChart.theme.js +6 -6
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +0 -1
- package/dist/components/data-display/KPI/KPI.js +11 -20
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.theme.js +4 -4
- package/dist/components/data-display/Table/Table.theme.js +2 -2
- package/dist/components/data-display/Table/TableColumnManager.js +1 -2
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableFilter.js +9 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- 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.theme.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +1 -1
- package/dist/components/forms/Combobox/Combobox.js +2 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/Radio/Radio.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1680
- 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.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +70 -7
- 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.js +2 -1
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
- package/dist/components/forms/forms.theme.js +19 -5
- package/dist/components/forms/index.js +1 -0
- 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 +10 -10
- package/dist/components/generative/schema.generated.js +178 -292
- 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 +178 -292
- package/dist/index.js +1 -4
- package/dist/registry.json +2599 -2375
- package/dist/shadcn-compat.css +5 -5
- 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/themes/precision.css +232 -0
- package/dist/tools.json +179 -294
- package/dist/utils/index.d.ts +0 -1
- package/package.json +31 -1
- package/src/global.scss +21 -28
- package/src/styles/theme.css +124 -41
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +30 -20
- 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 -208
- 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 -60
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -19
- 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/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
|
@@ -144,21 +144,6 @@ const CROSSHAIR_FOLLOW_TRANSITION = {
|
|
|
144
144
|
duration: 0.2,
|
|
145
145
|
ease: "easeOut",
|
|
146
146
|
};
|
|
147
|
-
/** Tooltip pop-in: springy position/scale with a quick opacity/scale settle. */
|
|
148
|
-
const TOOLTIP_ENTER_TRANSITION = {
|
|
149
|
-
type: "spring",
|
|
150
|
-
stiffness: 400,
|
|
151
|
-
damping: 30,
|
|
152
|
-
opacity: { duration: 0.15 },
|
|
153
|
-
scale: { duration: 0.15 },
|
|
154
|
-
};
|
|
155
|
-
/** Tooltip pop-out. */
|
|
156
|
-
const TOOLTIP_EXIT_TRANSITION = {
|
|
157
|
-
type: "spring",
|
|
158
|
-
stiffness: 300,
|
|
159
|
-
damping: 25,
|
|
160
|
-
duration: 0.15,
|
|
161
|
-
};
|
|
162
147
|
/** Circular-chart segment hover dim/lift (opacity fade + scale pop). */
|
|
163
148
|
const SEGMENT_HOVER_TRANSITION = {
|
|
164
149
|
scale: { duration: 0.2 },
|
|
@@ -182,9 +167,6 @@ const BAR_GROUP_STAGGER = 0.05;
|
|
|
182
167
|
const BAR_STACK_CATEGORY_DELAY = 0.25;
|
|
183
168
|
/** Shared BarRenderer stacked-mode per-segment stagger. */
|
|
184
169
|
const BAR_STACK_SEGMENT_STAGGER = 0.12;
|
|
185
|
-
/** ScatterPlot per-point stagger + grow duration. */
|
|
186
|
-
const SCATTER_POINT_STAGGER = 0.01;
|
|
187
|
-
const SCATTER_POINT_DURATION = 0.3;
|
|
188
170
|
/** Marker pop-in spring (line/area dots). */
|
|
189
171
|
const DOT_SPRING = { type: "spring", stiffness: 260, damping: 20 };
|
|
190
172
|
/** Bar grow spring (grouped bars / stacked columns). */
|
|
@@ -258,5 +240,23 @@ function stackedSegmentTransition(delay, hasAnimated) {
|
|
|
258
240
|
},
|
|
259
241
|
};
|
|
260
242
|
}
|
|
243
|
+
/* ── Heatmap ───────────────────────────────────────────────────────────────
|
|
244
|
+
* Cells fade in along the (row + col) diagonal. Deterministic on purpose: the
|
|
245
|
+
* delay used to come from Math.random(), which mismatched between the server
|
|
246
|
+
* and client renders and made every snapshot non-reproducible. */
|
|
247
|
+
/** Heatmap cell fade-in duration (seconds). */
|
|
248
|
+
const HEATMAP_CELL_FADE_DURATION = 0.35;
|
|
249
|
+
/** Per-diagonal stagger for the heatmap cell entrance (seconds). */
|
|
250
|
+
const HEATMAP_CELL_STAGGER = 0.02;
|
|
251
|
+
/** Cap on the entrance stagger, so a large grid still settles quickly (seconds). */
|
|
252
|
+
const HEATMAP_CELL_MAX_DELAY = 0.3;
|
|
253
|
+
/** Deterministic entrance delay for the cell at (row, col). */
|
|
254
|
+
function heatmapCellDelay(row, col) {
|
|
255
|
+
return Math.min((row + col) * HEATMAP_CELL_STAGGER, HEATMAP_CELL_MAX_DELAY);
|
|
256
|
+
}
|
|
257
|
+
/** Cell hover scale-up (`whileHover`). */
|
|
258
|
+
const HEATMAP_CELL_HOVER_TRANSITION = { duration: 0.15, ease: "easeOut" };
|
|
259
|
+
/** Cell press scale-down (`whileTap`). */
|
|
260
|
+
const HEATMAP_CELL_TAP_TRANSITION = { duration: 0.1, ease: "easeOut" };
|
|
261
261
|
|
|
262
|
-
export { BAR_GROUP_STAGGER, BAR_SPRING, BAR_STACK_CATEGORY_DELAY, BAR_STACK_SEGMENT_STAGGER, CARTESIAN_ENTRANCE_DURATION, CIRCULAR_CHART_ANIMATIONS, CROSSHAIR_FADE_TRANSITION, CROSSHAIR_FOLLOW_TRANSITION, DOT_SPRING, HALO_FADE_TRANSITION,
|
|
262
|
+
export { BAR_GROUP_STAGGER, BAR_SPRING, BAR_STACK_CATEGORY_DELAY, BAR_STACK_SEGMENT_STAGGER, CARTESIAN_ENTRANCE_DURATION, CIRCULAR_CHART_ANIMATIONS, CROSSHAIR_FADE_TRANSITION, CROSSHAIR_FOLLOW_TRANSITION, DOT_SPRING, HALO_FADE_TRANSITION, HEATMAP_CELL_FADE_DURATION, HEATMAP_CELL_HOVER_TRANSITION, HEATMAP_CELL_MAX_DELAY, HEATMAP_CELL_STAGGER, HEATMAP_CELL_TAP_TRANSITION, LINE_DOT_STAGGER, RING_FADE_TRANSITION, RISE_FROM_BASELINE, SCALE_FROM_CENTER, SEGMENT_HOVER_TRANSITION, SPRING_PRESETS, barEntranceTransition, dotEntranceTransition, getSpringAnimation, getStaggerDelay, heatmapCellDelay, riseTransition, stackedSegmentTransition };
|
|
@@ -8,7 +8,7 @@ const accordionTheme = {
|
|
|
8
8
|
// Item styles for stacked variant (shared borders, no spacing)
|
|
9
9
|
itemStyleStacked: "bg-[var(--color-surface)] border-t border-[var(--color-border)] first-of-type:border-t-0",
|
|
10
10
|
// Trigger styles (shared across variants)
|
|
11
|
-
triggerStyle: "flex w-full gap-3 items-center px-4 py-2.5 text-left font-medium transition-all duration-
|
|
11
|
+
triggerStyle: "flex w-full gap-3 items-center px-4 py-2.5 text-left font-medium transition-all duration-[var(--motion-duration-base)] cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 text-[var(--color-text-primary)] text-sm",
|
|
12
12
|
// Body styles (shared across variants)
|
|
13
13
|
bodyStyle: "data-[state=closed]:max-h-0 data-[state=open]:max-h-[320px] accordion-content overflow-hidden text-sm",
|
|
14
14
|
// Body inner wrapper styles
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Variants } from "motion/react";
|
|
2
2
|
/**
|
|
3
|
-
* Alert
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Alert dismiss animation variants.
|
|
4
|
+
*
|
|
5
|
+
* `visible` is the RESTING state, not an entrance — Alert mounts with
|
|
6
|
+
* `initial={false}` so it paints straight into `visible` and never plays these
|
|
7
|
+
* on mount. Only the `visible -> hidden` direction runs, when the alert is
|
|
8
|
+
* dismissed: fade + slide out while collapsing height/padding/margin so
|
|
9
|
+
* surrounding content closes the gap smoothly.
|
|
10
|
+
*
|
|
11
|
+
* `hidden` therefore keeps its full collapse geometry (that IS the dismiss),
|
|
12
|
+
* and `visible` keeps `y`/`opacity` so the collapse has somewhere to travel
|
|
13
|
+
* from. Uses library spring presets for a premium feel.
|
|
7
14
|
*/
|
|
8
15
|
export declare const alertVariants: Variants;
|
|
9
16
|
/**
|
|
@@ -4,10 +4,17 @@ import '../../../theme/SurfaceContext.js';
|
|
|
4
4
|
import { springs } from '../../../theme/animations.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Alert
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Alert dismiss animation variants.
|
|
8
|
+
*
|
|
9
|
+
* `visible` is the RESTING state, not an entrance — Alert mounts with
|
|
10
|
+
* `initial={false}` so it paints straight into `visible` and never plays these
|
|
11
|
+
* on mount. Only the `visible -> hidden` direction runs, when the alert is
|
|
12
|
+
* dismissed: fade + slide out while collapsing height/padding/margin so
|
|
13
|
+
* surrounding content closes the gap smoothly.
|
|
14
|
+
*
|
|
15
|
+
* `hidden` therefore keeps its full collapse geometry (that IS the dismiss),
|
|
16
|
+
* and `visible` keeps `y`/`opacity` so the collapse has somewhere to travel
|
|
17
|
+
* from. Uses library spring presets for a premium feel.
|
|
11
18
|
*/
|
|
12
19
|
const alertVariants = {
|
|
13
20
|
hidden: {
|
|
@@ -36,7 +36,15 @@ const Alert = React__default.forwardRef(({ color = "primary", title, subtitle, d
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
if (React__default.isValidElement(icon)) {
|
|
39
|
-
|
|
39
|
+
// A custom icon gets the SAME size + semantic color the default icon
|
|
40
|
+
// gets, applied as defaults so a consumer className still wins (§4).
|
|
41
|
+
// Without this the element inherited neither: Phosphor icons default to
|
|
42
|
+
// `1em`, so a custom icon rendered at the root's `text-sm` (14px) inside
|
|
43
|
+
// this 24px box, in the ambient text color rather than the intent color.
|
|
44
|
+
const customIcon = icon;
|
|
45
|
+
return (jsx("div", { className: "flex-shrink-0 w-6 h-6 mt-1", "aria-hidden": "true", children: React__default.cloneElement(customIcon, {
|
|
46
|
+
className: cn("w-6 h-6", iconColor, customIcon.props.className),
|
|
47
|
+
}) }));
|
|
40
48
|
}
|
|
41
49
|
const IconComponent = defaultIcons[color];
|
|
42
50
|
return (jsx("div", { className: "flex-shrink-0 w-6 h-6 mt-1", "aria-hidden": "true", children: jsx(IconComponent, { className: cn("w-6 h-6", iconColor) }) }));
|
|
@@ -47,7 +55,13 @@ const Alert = React__default.forwardRef(({ color = "primary", title, subtitle, d
|
|
|
47
55
|
: title), subtitle && (typeof subtitle === 'string'
|
|
48
56
|
? jsx("div", { className: "text-[var(--color-text-secondary)]/90 mt-1", children: subtitle })
|
|
49
57
|
: subtitle), children && jsx("div", { className: "mt-2", children: children }), actions && (jsx("div", { className: "flex items-center gap-2 mt-6", children: actions }))] }), showDismiss && (jsx(Button, { variant: "ghost", color: "mono", size: "sm", iconOnly: true, onClick: handleDismiss, "aria-label": "Dismiss alert", className: "rounded-full absolute top-2 right-2 flex-shrink-0", children: jsx(X, { className: "size-4", weight: "bold" }) }))] }));
|
|
50
|
-
const alertNode = (jsx(motion.div, { variants: shouldReduceMotion ? reducedMotionAlertVariants : alertVariants,
|
|
58
|
+
const alertNode = (jsx(motion.div, { variants: shouldReduceMotion ? reducedMotionAlertVariants : alertVariants,
|
|
59
|
+
// No mount animation. An Alert is page content, not a transient
|
|
60
|
+
// notification (that's Toast) — it is usually present at first paint, so
|
|
61
|
+
// animating `hidden -> visible` on mount meant every page load played an
|
|
62
|
+
// expand. `initial={false}` starts at the `visible` variant and animates
|
|
63
|
+
// only on a later state change, which is what the collapse below needs.
|
|
64
|
+
initial: false, animate: isDismissing ? "hidden" : "visible", onAnimationComplete: (definition) => {
|
|
51
65
|
if (definition === "hidden" && isDismissing) {
|
|
52
66
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
53
67
|
}
|
|
@@ -6,7 +6,7 @@ import { semanticTextColors } from '../../../utils/colorUtils.js';
|
|
|
6
6
|
*/
|
|
7
7
|
const alertTheme = {
|
|
8
8
|
// Base styles applied to all alerts
|
|
9
|
-
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-sm border border-[var(--color-border)] backdrop-blur-md bg-white dark:bg-[var(--color-
|
|
9
|
+
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-sm border border-[var(--color-border)] backdrop-blur-md bg-white dark:bg-[var(--color-surface)]/80",
|
|
10
10
|
// Icon color styles per color
|
|
11
11
|
iconColors: semanticTextColors,
|
|
12
12
|
// State styles
|
|
@@ -28,9 +28,11 @@ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"
|
|
|
28
28
|
dismissible?: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Custom icon for the alert
|
|
31
|
-
* - Provide custom icon: overrides the default
|
|
31
|
+
* - Provide custom icon: overrides the default color icon. It inherits the
|
|
32
|
+
* default icon's size and semantic color; pass a `className` on the element
|
|
33
|
+
* to override either (e.g. `icon={<Fire className="size-5 text-purple-500" />}`).
|
|
32
34
|
* - Set to null: hides icon completely
|
|
33
|
-
* - Leave undefined: shows default
|
|
35
|
+
* - Leave undefined: shows default color icon
|
|
34
36
|
*/
|
|
35
37
|
icon?: ReactNode | null;
|
|
36
38
|
/** Whether to show the default icon for the variant */
|
|
@@ -15,7 +15,7 @@ import { useModalContext } from '../Modal/ModalContext.js';
|
|
|
15
15
|
*/
|
|
16
16
|
function AlertDialogSubtitle({ children }) {
|
|
17
17
|
const { subtitleId } = useModalContext();
|
|
18
|
-
return (jsx("div", { id: subtitleId, className: "text-[var(--color-text-secondary)] text-
|
|
18
|
+
return (jsx("div", { id: subtitleId, className: "text-[var(--color-text-secondary)] text-sm", children: children }));
|
|
19
19
|
}
|
|
20
20
|
const AlertDialog = ({ trigger, icon, title, subtitle, footer, className, }) => {
|
|
21
21
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -24,7 +24,7 @@ const AlertDialog = ({ trigger, icon, title, subtitle, footer, className, }) =>
|
|
|
24
24
|
const triggerElement = isValidElement(trigger)
|
|
25
25
|
? cloneElement(trigger, { onClick: handleOpen })
|
|
26
26
|
: null;
|
|
27
|
-
return (jsxs(Fragment, { children: [triggerElement, jsxs(Modal, { isOpen: isOpen, onClose: handleClose, size: "sm", closeOnOverlayClick: false, closeOnEsc: !footer, showCloseButton: false, role: "alertdialog", className: cn("!overflow-visible", className), children: [jsxs(Modal.Header, { children: [icon && (jsx("div", { className: "text-2xl rounded-
|
|
27
|
+
return (jsxs(Fragment, { children: [triggerElement, jsxs(Modal, { isOpen: isOpen, onClose: handleClose, size: "sm", closeOnOverlayClick: false, closeOnEsc: !footer, showCloseButton: false, role: "alertdialog", className: cn("!overflow-visible", className), children: [jsxs(Modal.Header, { children: [icon && (jsx("div", { className: "text-2xl rounded-[var(--modal-radius)] p-3 mb-[var(--modal-py)] w-fit border border-[var(--color-border-secondary)]", "aria-hidden": "true", children: icon })), jsx(Modal.Title, { children: title })] }), jsx(Modal.Body, { className: "pt-2", children: jsx(AlertDialogSubtitle, { children: subtitle }) }), footer && (jsx(Modal.Footer, { className: "pt-6 pb-[var(--modal-py)]", children: footer(handleClose) }))] })] }));
|
|
28
28
|
};
|
|
29
29
|
AlertDialog.displayName = "AlertDialog";
|
|
30
30
|
|
|
@@ -5,7 +5,7 @@ const avatarTheme = {
|
|
|
5
5
|
// into the WRAPPER's context and painted over the sibling status dot, which
|
|
6
6
|
// sits at `z-index: auto`. Isolating keeps the circle's internal layering
|
|
7
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-
|
|
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
9
|
// One geometry class for EVERY size. The px value arrives through the
|
|
10
10
|
// `--avatar-size` custom property, which Avatar sets inline: a token maps to
|
|
11
11
|
// its `--avatar-size-*` var, a number to `${n}px`. It has to travel as a
|
|
@@ -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,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//
|
|
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.
|
|
5
6
|
const badgeVariants = {
|
|
6
7
|
initial: {
|
|
7
8
|
opacity: 1,
|
|
@@ -10,23 +11,6 @@ const badgeVariants = {
|
|
|
10
11
|
animate: {
|
|
11
12
|
opacity: 1,
|
|
12
13
|
scale: 1,
|
|
13
|
-
transition: {
|
|
14
|
-
type: "spring",
|
|
15
|
-
stiffness: 500,
|
|
16
|
-
damping: 30,
|
|
17
|
-
mass: 1,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
exit: {
|
|
21
|
-
opacity: 0,
|
|
22
|
-
scale: 0.2,
|
|
23
|
-
transition: {
|
|
24
|
-
type: "spring",
|
|
25
|
-
stiffness: 500,
|
|
26
|
-
damping: 25,
|
|
27
|
-
mass: 0.8,
|
|
28
|
-
duration: 0.3,
|
|
29
|
-
},
|
|
30
14
|
},
|
|
31
15
|
};
|
|
32
16
|
// Dot variants
|
|
@@ -44,69 +28,6 @@ const dotVariants = {
|
|
|
44
28
|
damping: 30,
|
|
45
29
|
},
|
|
46
30
|
},
|
|
47
|
-
exit: {
|
|
48
|
-
opacity: 0,
|
|
49
|
-
scale: 0,
|
|
50
|
-
transition: {
|
|
51
|
-
duration: 0.15,
|
|
52
|
-
ease: "easeIn",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
// Dismiss button variants - optimized for performance
|
|
57
|
-
const dismissButtonVariants = {
|
|
58
|
-
initial: {
|
|
59
|
-
opacity: 0.75,
|
|
60
|
-
},
|
|
61
|
-
hover: {
|
|
62
|
-
opacity: 1,
|
|
63
|
-
transition: HOVER_TRANSITION,
|
|
64
|
-
},
|
|
65
|
-
tap: {
|
|
66
|
-
scale: 0.95,
|
|
67
|
-
transition: PRESS_TRANSITION,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
// Optimized dismiss animation sequence
|
|
71
|
-
// This uses Framer Motion's built-in sequencing capabilities
|
|
72
|
-
const dismissVariants = {
|
|
73
|
-
initial: {
|
|
74
|
-
opacity: 0,
|
|
75
|
-
scale: 0.8,
|
|
76
|
-
},
|
|
77
|
-
animate: {
|
|
78
|
-
opacity: 1,
|
|
79
|
-
scale: 1,
|
|
80
|
-
transition: {
|
|
81
|
-
type: "spring",
|
|
82
|
-
stiffness: 500,
|
|
83
|
-
damping: 30,
|
|
84
|
-
mass: 1,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
// First stage of exit - slight pop
|
|
88
|
-
exit: {
|
|
89
|
-
opacity: 0,
|
|
90
|
-
scale: 0.2,
|
|
91
|
-
transition: {
|
|
92
|
-
opacity: {
|
|
93
|
-
duration: 0.3,
|
|
94
|
-
ease: "easeOut",
|
|
95
|
-
},
|
|
96
|
-
scale: {
|
|
97
|
-
type: "spring",
|
|
98
|
-
stiffness: 300,
|
|
99
|
-
damping: 20,
|
|
100
|
-
// Add a slight delay to create the pop effect
|
|
101
|
-
delay: 0.05,
|
|
102
|
-
},
|
|
103
|
-
duration: 0.4,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
// Animation timing constants (in ms)
|
|
108
|
-
const animationTiming = {
|
|
109
|
-
dismissDelay: 400, // Total animation duration
|
|
110
31
|
};
|
|
111
32
|
|
|
112
|
-
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 { X } from '@phosphor-icons/react';
|
|
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 = () => {
|
|
@@ -146,25 +118,16 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
146
118
|
}
|
|
147
119
|
return null;
|
|
148
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 })] }));
|
|
149
126
|
if (!shouldAnimate) {
|
|
150
127
|
// Spread props directly — Badge only receives HTMLSpanElement attributes
|
|
151
|
-
|
|
152
|
-
// Non-animated render for reduced-motion environments
|
|
153
|
-
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
|
|
154
|
-
? {
|
|
155
|
-
maxWidth: typeof maxWidth === "number"
|
|
156
|
-
? `${maxWidth}px`
|
|
157
|
-
: maxWidth,
|
|
158
|
-
}
|
|
159
|
-
: 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(X, { 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 }));
|
|
160
129
|
}
|
|
161
|
-
return (jsx(
|
|
162
|
-
? {
|
|
163
|
-
maxWidth: typeof maxWidth === "number"
|
|
164
|
-
? `${maxWidth}px`
|
|
165
|
-
: maxWidth,
|
|
166
|
-
}
|
|
167
|
-
: 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(X, { className: cn("badge-dismiss-icon", (_q = theme.dismissSizes) === null || _q === void 0 ? void 0 : _q[size]), "aria-hidden": "true", weight: "bold" }) }))] })) }));
|
|
130
|
+
return (jsx(motion.span, { ref: ref, className: baseStyles, variants: badgeVariants, initial: "initial", animate: "animate", ...dataAttributes, ...props, children: content }));
|
|
168
131
|
}));
|
|
169
132
|
Badge.displayName = "Badge";
|
|
170
133
|
|
|
@@ -8,7 +8,7 @@ const badgeTheme = {
|
|
|
8
8
|
// treats font-size as owning line-height, so any leading class here is silently dropped.
|
|
9
9
|
// The badge therefore uses the `text-xs` ramp line-height (16px) → 22px tall.
|
|
10
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-
|
|
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",
|
|
12
12
|
// Visual style variants (structure only, no colors)
|
|
13
13
|
// All variants keep the 1px `border` from baseStyle so every variant is the
|
|
14
14
|
// SAME height (variant must never change size). `filled` and `soft` make that
|
|
@@ -75,6 +75,13 @@ const badgeTheme = {
|
|
|
75
75
|
sm: "text-xs px-[var(--badge-px-sm)] py-[var(--badge-py-sm)] gap-1",
|
|
76
76
|
md: "text-xs px-[var(--badge-px-md)] py-[var(--badge-py-md)] gap-1",
|
|
77
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)]",
|
|
84
|
+
},
|
|
78
85
|
// Additional padding for pill shape — must clear the rounded-full cap radius
|
|
79
86
|
// (≈ height/2), otherwise content sits inside the curve and hugs the edge.
|
|
80
87
|
pillSizes: {
|
|
@@ -91,12 +98,6 @@ const badgeTheme = {
|
|
|
91
98
|
sm: "size-4",
|
|
92
99
|
md: "size-5",
|
|
93
100
|
},
|
|
94
|
-
// Dismiss icon sizes — match the text-xs cap (both badge sizes use text-xs) so
|
|
95
|
-
// the dismiss button never grows taller than the text and stretches the badge.
|
|
96
|
-
dismissSizes: {
|
|
97
|
-
sm: "size-3",
|
|
98
|
-
md: "size-3",
|
|
99
|
-
},
|
|
100
101
|
// Dot inherits text color via currentColor — works across all variants/colors
|
|
101
102
|
dotColors: {
|
|
102
103
|
mono: "bg-current",
|
|
@@ -105,11 +106,6 @@ const badgeTheme = {
|
|
|
105
106
|
warning: "bg-current",
|
|
106
107
|
danger: "bg-current",
|
|
107
108
|
},
|
|
108
|
-
// State styles
|
|
109
|
-
states: {
|
|
110
|
-
disabled: "opacity-50 cursor-not-allowed pointer-events-none",
|
|
111
|
-
hover: "cursor-pointer",
|
|
112
|
-
},
|
|
113
109
|
};
|
|
114
110
|
|
|
115
111
|
export { badgeTheme };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { SemanticColor } from "../../../utils/colorUtils";
|
|
3
3
|
import type { MeshPaletteName } from "../../effects/MeshGradient";
|
|
4
4
|
export type BadgeVariant = "filled" | "outline" | "soft";
|
|
@@ -25,6 +25,10 @@ export interface BadgeTheme {
|
|
|
25
25
|
* Styles for each badge size (flat structure)
|
|
26
26
|
*/
|
|
27
27
|
sizes: Record<BadgeSize, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Corner radius for each badge size (ignored when `pill` is set)
|
|
30
|
+
*/
|
|
31
|
+
radiusSizes: Record<BadgeSize, string>;
|
|
28
32
|
/**
|
|
29
33
|
* Additional padding for pill-shaped badges
|
|
30
34
|
*/
|
|
@@ -37,21 +41,10 @@ export interface BadgeTheme {
|
|
|
37
41
|
* Avatar sizes for each badge size
|
|
38
42
|
*/
|
|
39
43
|
avatarSizes: Record<BadgeSize, string>;
|
|
40
|
-
/**
|
|
41
|
-
* Dismiss icon sizes (button sizes itself from icon + padding)
|
|
42
|
-
*/
|
|
43
|
-
dismissSizes: Record<BadgeSize, string>;
|
|
44
44
|
/**
|
|
45
45
|
* Color styles for dot indicators
|
|
46
46
|
*/
|
|
47
47
|
dotColors: Record<BadgeColor, string>;
|
|
48
|
-
/**
|
|
49
|
-
* State styles (disabled, hover, selected)
|
|
50
|
-
*/
|
|
51
|
-
states: {
|
|
52
|
-
disabled: string;
|
|
53
|
-
hover: string;
|
|
54
|
-
};
|
|
55
48
|
}
|
|
56
49
|
/**
|
|
57
50
|
* Theme overrides for Badge component
|
|
@@ -61,15 +54,11 @@ export interface BadgeThemeOverrides {
|
|
|
61
54
|
variants?: Partial<Record<BadgeVariant, string>>;
|
|
62
55
|
variantColors?: Partial<Record<BadgeVariant, Partial<Record<BadgeColor, string>>>>;
|
|
63
56
|
sizes?: Partial<Record<BadgeSize, string>>;
|
|
57
|
+
radiusSizes?: Partial<Record<BadgeSize, string>>;
|
|
64
58
|
pillSizes?: Partial<Record<BadgeSize, string>>;
|
|
65
59
|
iconSizes?: Partial<Record<BadgeSize, string>>;
|
|
66
60
|
avatarSizes?: Partial<Record<BadgeSize, string>>;
|
|
67
|
-
dismissSizes?: Partial<Record<BadgeSize, string>>;
|
|
68
61
|
dotColors?: Partial<Record<BadgeColor, string>>;
|
|
69
|
-
states?: Partial<{
|
|
70
|
-
disabled: string;
|
|
71
|
-
hover: string;
|
|
72
|
-
}>;
|
|
73
62
|
}
|
|
74
63
|
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "inputMode"> {
|
|
75
64
|
/**
|
|
@@ -77,8 +66,18 @@ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
77
66
|
*/
|
|
78
67
|
children: ReactNode;
|
|
79
68
|
/**
|
|
80
|
-
* The visual style variant of the badge
|
|
81
|
-
*
|
|
69
|
+
* The visual style variant of the badge.
|
|
70
|
+
*
|
|
71
|
+
* `soft` is the default because a badge is a STATUS/METADATA label, not an
|
|
72
|
+
* action — a tinted chip is the idiom, and a full-strength fill overstates a
|
|
73
|
+
* label sitting next to real controls. Pick a non-default deliberately:
|
|
74
|
+
* - `filled` — on imagery/gradients, or a genuine emphasis flag ("NEW")
|
|
75
|
+
* - `outline` — quiet keyword tags; in practice only reads well at `color="mono"`
|
|
76
|
+
*
|
|
77
|
+
* (Button defaults to `filled` — an action SHOULD be the loudest thing. Same
|
|
78
|
+
* vocabulary, opposite default, on purpose. See CLAUDE.md §8.)
|
|
79
|
+
*
|
|
80
|
+
* @default 'soft'
|
|
82
81
|
*/
|
|
83
82
|
variant?: BadgeVariant;
|
|
84
83
|
/**
|
|
@@ -127,21 +126,6 @@ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
127
126
|
/** Raw gradient color override; wins over `gradientVariant`. */
|
|
128
127
|
gradientColors?: string[];
|
|
129
128
|
};
|
|
130
|
-
/**
|
|
131
|
-
* Whether the badge is dismissible (shows close button)
|
|
132
|
-
* @default false
|
|
133
|
-
*/
|
|
134
|
-
dismissible?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Callback when close button is clicked
|
|
137
|
-
* Required when dismissible is true
|
|
138
|
-
*/
|
|
139
|
-
onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
140
|
-
/**
|
|
141
|
-
* Whether the badge is disabled
|
|
142
|
-
* @default false
|
|
143
|
-
*/
|
|
144
|
-
disabled?: boolean;
|
|
145
129
|
/**
|
|
146
130
|
* Maximum width before truncating the label
|
|
147
131
|
* Accepts CSS width value (e.g., '100px', '10rem') or number (pixels)
|